From 6807a9c7dd8e44d2758bba5ea1f833e1c56a9367 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Mon, 10 Jan 2011 21:11:09 +0000 Subject: [PATCH 01/90] removing old build system --- Makefile | 3 - build.js | 88 - build/ace/background_tokenizer.js | 79 - build/ace/commands/default_commands.js | 152 - build/ace/conf/keybindings/default_mac.js | 5 - build/ace/conf/keybindings/default_win.js | 5 - build/ace/css/editor.css | 71 - build/ace/document.js | 459 --- build/ace/editor.js | 3415 ----------------- build/ace/event_emitter.js | 29 - build/ace/keybinding.js | 56 - build/ace/layer/cursor.js | 63 - build/ace/layer/gutter.js | 30 - build/ace/layer/marker.js | 72 - build/ace/layer/text.js | 158 - build/ace/lib/core.js | 17 - build/ace/lib/dom.js | 65 - build/ace/lib/event.js | 134 - build/ace/lib/lang.js | 56 - build/ace/lib/oop.js | 20 - build/ace/mode/css.js | 80 - build/ace/mode/css_highlight_rules.js | 24 - build/ace/mode/doc_comment_highlight_rules.js | 14 - build/ace/mode/html.js | 57 - build/ace/mode/html_highlight_rules.js | 15 - build/ace/mode/javascript.js | 61 - build/ace/mode/javascript_highlight_rules.js | 16 - build/ace/mode/matching_brace_outdent.js | 30 - build/ace/mode/python.js | 93 - build/ace/mode/python_highlight_rules.js | 15 - build/ace/mode/text.js | 28 - build/ace/mode/text_highlight_rules.js | 19 - build/ace/mode/xml.js | 23 - build/ace/mode/xml_highlight_rules.js | 10 - build/ace/plugin_manager.js | 5 - build/ace/range.js | 68 - build/ace/renderloop.js | 44 - build/ace/scrollbar.js | 32 - build/ace/search.js | 149 - build/ace/selection.js | 255 -- build/ace/test/all.js | 4 - build/ace/test/assertions.js | 0 build/ace/test/change_document_test.js | 0 build/ace/test/document_test.js | 153 - build/ace/test/event_emitter_test.js | 0 build/ace/test/mockrenderer.js | 62 - build/ace/test/mode/css_test.js | 21 - build/ace/test/mode/css_tokenizer_test.js | 26 - build/ace/test/mode/html_test.js | 16 - build/ace/test/mode/html_tokenizer_test.js | 21 - build/ace/test/mode/javascript_test.js | 62 - .../test/mode/javascript_tokenizer_test.js | 34 - build/ace/test/mode/text_test.js | 14 - build/ace/test/mode/xml_test.js | 21 - build/ace/test/mode/xml_tokenizer_test.js | 16 - build/ace/test/navigation_test.js | 0 build/ace/test/range_test.js | 0 build/ace/test/search_test.js | 135 - build/ace/test/selection_test.js | 0 build/ace/test/text_edit_test.js | 185 - build/ace/test/virtual_renderer_test.js | 28 - build/ace/textinput.js | 79 - build/ace/theme/clouds.js | 4 - build/ace/theme/clouds_mignight.js | 4 - build/ace/theme/cobalt.js | 4 - build/ace/theme/dawn.js | 4 - build/ace/theme/eclipse.css | 64 - build/ace/theme/eclipse.js | 5 - build/ace/theme/idle_fingers.js | 4 - build/ace/theme/kr_theme.js | 4 - build/ace/theme/mono_industrial.js | 4 - build/ace/theme/monokai.js | 4 - build/ace/theme/textmate.js | 5 - build/ace/theme/tm.css | 96 - build/ace/theme/twilight.js | 4 - build/ace/tokenizer.js | 46 - build/ace/undomanager.js | 28 - build/ace/virtual_renderer.js | 371 -- build/build.txt | 63 - build/require/i18n.js | 134 - build/require/jsonp.js | 43 - build/require/order.js | 43 - build/require/rhino.js | 13 - build/require/text.js | 94 - build/require/transportD.js | 14 - 85 files changed, 7947 deletions(-) delete mode 100644 Makefile delete mode 100644 build.js delete mode 100644 build/ace/background_tokenizer.js delete mode 100644 build/ace/commands/default_commands.js delete mode 100644 build/ace/conf/keybindings/default_mac.js delete mode 100644 build/ace/conf/keybindings/default_win.js delete mode 100644 build/ace/css/editor.css delete mode 100644 build/ace/document.js delete mode 100644 build/ace/editor.js delete mode 100644 build/ace/event_emitter.js delete mode 100644 build/ace/keybinding.js delete mode 100644 build/ace/layer/cursor.js delete mode 100644 build/ace/layer/gutter.js delete mode 100644 build/ace/layer/marker.js delete mode 100644 build/ace/layer/text.js delete mode 100644 build/ace/lib/core.js delete mode 100644 build/ace/lib/dom.js delete mode 100644 build/ace/lib/event.js delete mode 100644 build/ace/lib/lang.js delete mode 100644 build/ace/lib/oop.js delete mode 100644 build/ace/mode/css.js delete mode 100644 build/ace/mode/css_highlight_rules.js delete mode 100644 build/ace/mode/doc_comment_highlight_rules.js delete mode 100644 build/ace/mode/html.js delete mode 100644 build/ace/mode/html_highlight_rules.js delete mode 100644 build/ace/mode/javascript.js delete mode 100644 build/ace/mode/javascript_highlight_rules.js delete mode 100644 build/ace/mode/matching_brace_outdent.js delete mode 100644 build/ace/mode/python.js delete mode 100644 build/ace/mode/python_highlight_rules.js delete mode 100644 build/ace/mode/text.js delete mode 100644 build/ace/mode/text_highlight_rules.js delete mode 100644 build/ace/mode/xml.js delete mode 100644 build/ace/mode/xml_highlight_rules.js delete mode 100644 build/ace/plugin_manager.js delete mode 100644 build/ace/range.js delete mode 100644 build/ace/renderloop.js delete mode 100644 build/ace/scrollbar.js delete mode 100644 build/ace/search.js delete mode 100644 build/ace/selection.js delete mode 100644 build/ace/test/all.js delete mode 100644 build/ace/test/assertions.js delete mode 100644 build/ace/test/change_document_test.js delete mode 100644 build/ace/test/document_test.js delete mode 100644 build/ace/test/event_emitter_test.js delete mode 100644 build/ace/test/mockrenderer.js delete mode 100644 build/ace/test/mode/css_test.js delete mode 100644 build/ace/test/mode/css_tokenizer_test.js delete mode 100644 build/ace/test/mode/html_test.js delete mode 100644 build/ace/test/mode/html_tokenizer_test.js delete mode 100644 build/ace/test/mode/javascript_test.js delete mode 100644 build/ace/test/mode/javascript_tokenizer_test.js delete mode 100644 build/ace/test/mode/text_test.js delete mode 100644 build/ace/test/mode/xml_test.js delete mode 100644 build/ace/test/mode/xml_tokenizer_test.js delete mode 100644 build/ace/test/navigation_test.js delete mode 100644 build/ace/test/range_test.js delete mode 100644 build/ace/test/search_test.js delete mode 100644 build/ace/test/selection_test.js delete mode 100644 build/ace/test/text_edit_test.js delete mode 100644 build/ace/test/virtual_renderer_test.js delete mode 100644 build/ace/textinput.js delete mode 100644 build/ace/theme/clouds.js delete mode 100644 build/ace/theme/clouds_mignight.js delete mode 100644 build/ace/theme/cobalt.js delete mode 100644 build/ace/theme/dawn.js delete mode 100644 build/ace/theme/eclipse.css delete mode 100644 build/ace/theme/eclipse.js delete mode 100644 build/ace/theme/idle_fingers.js delete mode 100644 build/ace/theme/kr_theme.js delete mode 100644 build/ace/theme/mono_industrial.js delete mode 100644 build/ace/theme/monokai.js delete mode 100644 build/ace/theme/textmate.js delete mode 100644 build/ace/theme/tm.css delete mode 100644 build/ace/theme/twilight.js delete mode 100644 build/ace/tokenizer.js delete mode 100644 build/ace/undomanager.js delete mode 100644 build/ace/virtual_renderer.js delete mode 100644 build/build.txt delete mode 100644 build/require/i18n.js delete mode 100644 build/require/jsonp.js delete mode 100644 build/require/order.js delete mode 100644 build/require/rhino.js delete mode 100644 build/require/text.js delete mode 100644 build/require/transportD.js diff --git a/Makefile b/Makefile deleted file mode 100644 index 82e66a2c..00000000 --- a/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -package: - rm -rf build - support/requirejs/build/build.sh build.js diff --git a/build.js b/build.js deleted file mode 100644 index 7f64186e..00000000 --- a/build.js +++ /dev/null @@ -1,88 +0,0 @@ -{ - baseUrl: "./lib", - dir: "build", - - //- "closure": uses Google's Closure Compiler in simple optimization - //mode to minify the code. - //- "closure.keepLines": Same as closure option, but keeps line returns - //in the minified files. - //- "none": no minification will be done. - optimize: "closure.keepLines", - inlineText: true, - useStrict: false, - - pragmas: { - jquery: false, - requireExcludeModify: true, - requireExcludePlugin: false, - requireExcludePageLoad: false - }, - - skipPragmas: false, - execModules: false, - skipModuleInsertion: false, - - modules: [ - { - name: "ace/editor", - include: [ - "ace/document", - "ace/undomanager", - "ace/virtual_renderer", - - "ace/mode/javascript", - "ace/theme/textmate" - ], - includeRequire: false - }, - - { - name: "ace/theme/eclipse", - exclude: [ - "pilot/lang", - "pilot/dom", - "pilot/oop" - ] - }, - { - name: "ace/mode/xml", - exclude: [ - "pilot/oop", - "ace/tokenizer", - "ace/mode/text" - ] - }, - { - name: "ace/mode/css", - exclude: [ - "pilot/oop", - "pilot/lang", - "ace/tokenizer", - "ace/range", - "ace/mode/text" - ] - }, - { - name: "ace/mode/html", - exclude: [ - "pilot/oop", - "pilot/lang", - "ace/tokenizer", - "ace/range", - "ace/mode/text", - "ace/mode/javascript", - "ace/mode/css", - ] - }, - { - name: "ace/mode/python", - exclude: [ - "ace/lib/oop", - "ace/lib/lang", - "ace/tokenizer", - "ace/range", - "ace/mode/text" - ] - } - ] -} \ No newline at end of file diff --git a/build/ace/background_tokenizer.js b/build/ace/background_tokenizer.js deleted file mode 100644 index 54e2e4af..00000000 --- a/build/ace/background_tokenizer.js +++ /dev/null @@ -1,79 +0,0 @@ -define(function(f) { - var i = f("./lib/oop"), j = f("./event_emitter"); - f = function(a, c) { - this.running = false; - this.textLines = []; - this.lines = []; - this.currentLine = 0; - this.tokenizer = a; - var b = this; - this.$worker = function() { - if(b.running) { - for(var e = new Date, g = b.currentLine, d = b.textLines, h = 0, k = c.getLastVisibleRow();b.currentLine < d.length;) { - b.lines[b.currentLine] = b.$tokenizeRows(b.currentLine, b.currentLine)[0]; - b.currentLine++; - h += 1; - if(h % 5 == 0 && new Date - e > 20) { - b.fireUpdateEvent(g, b.currentLine - 1); - b.running = setTimeout(b.$worker, b.currentLine < k ? 20 : 100); - return - } - }b.running = false; - b.fireUpdateEvent(g, d.length - 1) - } - } - }; - (function() { - i.implement(this, j); - this.setTokenizer = function(a) { - this.tokenizer = a; - this.lines = []; - this.start(0) - }; - this.setLines = function(a) { - this.textLines = a; - this.lines = []; - this.stop() - }; - this.fireUpdateEvent = function(a, c) { - this.$dispatchEvent("update", {data:{first:a, last:c}}) - }; - this.start = function(a) { - this.currentLine = Math.min(a || 0, this.currentLine, this.textLines.length); - this.lines.splice(this.currentLine, this.lines.length); - this.stop(); - this.running = setTimeout(this.$worker, 700) - }; - this.stop = function() { - this.running && clearTimeout(this.running); - this.running = false - }; - this.getTokens = function(a, c, b) { - b(this.$tokenizeRows(a, c)) - }; - this.getState = function(a, c) { - c(this.$tokenizeRows(a, a)[0].state) - }; - this.$tokenizeRows = function(a, c) { - var b = [], e = "start", g = false; - if(a > 0 && this.lines[a - 1]) { - e = this.lines[a - 1].state; - g = true - }for(a = a;a <= c;a++) { - if(this.lines[a]) { - d = this.lines[a]; - e = d.state; - b.push(d) - }else { - var d = this.tokenizer.getLineTokens(this.textLines[a] || "", e); - e = d.state; - b.push(d); - if(g) { - this.lines[a] = d - } - } - }return b - } - }).call(f.prototype); - return f -}); \ No newline at end of file diff --git a/build/ace/commands/default_commands.js b/build/ace/commands/default_commands.js deleted file mode 100644 index 23655967..00000000 --- a/build/ace/commands/default_commands.js +++ /dev/null @@ -1,152 +0,0 @@ -define(function(b) { - b = b("../plugin_manager"); - b.registerCommand("selectall", function(a, c) { - c.selectAll() - }); - b.registerCommand("removeline", function(a) { - a.removeLines() - }); - b.registerCommand("gotoline", function(a) { - var c = parseInt(prompt("Enter line number:")); - isNaN(c) || a.gotoLine(c) - }); - b.registerCommand("togglecomment", function(a) { - a.toggleCommentLines() - }); - b.registerCommand("findnext", function(a) { - a.findNext() - }); - b.registerCommand("findprevious", function(a) { - a.findPrevious() - }); - b.registerCommand("find", function(a) { - var c = prompt("Find:"); - a.find(c) - }); - b.registerCommand("undo", function(a) { - a.undo() - }); - b.registerCommand("redo", function(a) { - a.redo() - }); - b.registerCommand("redo", function(a) { - a.redo() - }); - b.registerCommand("overwrite", function(a) { - a.toggleOverwrite() - }); - b.registerCommand("copylinesup", function(a) { - a.copyLinesUp() - }); - b.registerCommand("movelinesup", function(a) { - a.moveLinesUp() - }); - b.registerCommand("selecttostart", function(a, c) { - c.selectFileStart() - }); - b.registerCommand("gotostart", function(a) { - a.navigateFileStart() - }); - b.registerCommand("selectup", function(a, c) { - c.selectUp() - }); - b.registerCommand("golineup", function(a) { - a.navigateUp() - }); - b.registerCommand("copylinesdown", function(a) { - a.copyLinesDown() - }); - b.registerCommand("movelinesdown", function(a) { - a.moveLinesDown() - }); - b.registerCommand("selecttoend", function(a, c) { - c.selectFileEnd() - }); - b.registerCommand("gotoend", function(a) { - a.navigateFileEnd() - }); - b.registerCommand("selectdown", function(a, c) { - c.selectDown() - }); - b.registerCommand("godown", function(a) { - a.navigateDown() - }); - b.registerCommand("selectwordleft", function(a, c) { - c.selectWordLeft() - }); - b.registerCommand("gotowordleft", function(a) { - a.navigateWordLeft() - }); - b.registerCommand("selecttolinestart", function(a, c) { - c.selectLineStart() - }); - b.registerCommand("gotolinestart", function(a) { - a.navigateLineStart() - }); - b.registerCommand("selectleft", function(a, c) { - c.selectLeft() - }); - b.registerCommand("gotoleft", function(a) { - a.navigateLeft() - }); - b.registerCommand("selectwordright", function(a, c) { - c.selectWordRight() - }); - b.registerCommand("gotowordright", function(a) { - a.navigateWordRight() - }); - b.registerCommand("selecttolineend", function(a, c) { - c.selectLineEnd() - }); - b.registerCommand("gotolineend", function(a) { - a.navigateLineEnd() - }); - b.registerCommand("selectright", function(a, c) { - c.selectRight() - }); - b.registerCommand("gotoright", function(a) { - a.navigateRight() - }); - b.registerCommand("selectpagedown", function(a) { - a.selectPageDown() - }); - b.registerCommand("pagedown", function(a) { - a.scrollPageDown() - }); - b.registerCommand("gotopagedown", function(a) { - a.gotoPageDown() - }); - b.registerCommand("selectpageup", function(a) { - a.selectPageUp() - }); - b.registerCommand("pageup", function(a) { - a.scrollPageUp() - }); - b.registerCommand("gotopageup", function(a) { - a.gotoPageUp() - }); - b.registerCommand("selectlinestart", function(a, c) { - c.selectLineStart() - }); - b.registerCommand("gotolinestart", function(a) { - a.navigateLineStart() - }); - b.registerCommand("selectlineend", function(a, c) { - c.selectLineEnd() - }); - b.registerCommand("gotolineend", function(a) { - a.navigateLineEnd() - }); - b.registerCommand("del", function(a) { - a.removeRight() - }); - b.registerCommand("backspace", function(a) { - a.removeLeft() - }); - b.registerCommand("outdent", function(a) { - a.blockOutdent() - }); - b.registerCommand("indent", function(a) { - a.indent() - }) -}); \ No newline at end of file diff --git a/build/ace/conf/keybindings/default_mac.js b/build/ace/conf/keybindings/default_mac.js deleted file mode 100644 index 1c61910a..00000000 --- a/build/ace/conf/keybindings/default_mac.js +++ /dev/null @@ -1,5 +0,0 @@ -define(function() { - return{selectall:"Command-A", removeline:"Command-D", gotoline:"Command-L", togglecomment:"Command-7", findnext:"Command-K", findprevious:"Command-Shift-K", find:"Command-F", replace:"Command-R", undo:"Command-Z", redo:"Command-Shift-Z|Command-Y", overwrite:"Insert", copylinesup:"Command-Option-Up", movelinesup:"Option-Up", selecttostart:"Command-Shift-Up", gotostart:"Command-Home|Command-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Command-Option-Down", movelinesdown:"Option-Down", - selecttoend:"Command-Shift-Down", gotoend:"Command-End|Command-Down", selectdown:"Shift-Down", godown:"Down", selectwordleft:"Option-Shift-Left", gotowordleft:"Option-Left", selecttolinestart:"Command-Shift-Left", gotolinestart:"Command-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Option-Shift-Right", gotowordright:"Option-Right", selecttolineend:"Command-Shift-Right", gotolineend:"Command-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", - pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End", del:"Delete", backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace", outdent:"Shift-Tab", indent:"Tab"} -}); \ No newline at end of file diff --git a/build/ace/conf/keybindings/default_win.js b/build/ace/conf/keybindings/default_win.js deleted file mode 100644 index 428c47b0..00000000 --- a/build/ace/conf/keybindings/default_win.js +++ /dev/null @@ -1,5 +0,0 @@ -define(function() { - return{selectall:"Ctrl-A", removeline:"Ctrl-D", gotoline:"Ctrl-L", togglecomment:"Ctrl-7", findnext:"Ctrl-K", findprevious:"Ctrl-Shift-K", find:"Ctrl-F", replace:"Ctrl-R", undo:"Ctrl-Z", redo:"Ctrl-Shift-Z|Ctrl-Y", overwrite:"Insert", copylinesup:"Ctrl-Alt-Up", movelinesup:"Alt-Up", selecttostart:"Alt-Shift-Up", gotostart:"Ctrl-Home|Ctrl-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Ctrl-Alt-Down", movelinesdown:"Alt-Down", selecttoend:"Alt-Shift-Down", gotoend:"Ctrl-End|Ctrl-Down", selectdown:"Shift-Down", - godown:"Down", selectwordleft:"Ctrl-Shift-Left", gotowordleft:"Ctrl-Left", selecttolinestart:"Alt-Shift-Left", gotolinestart:"Alt-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Ctrl-Shift-Right", gotowordright:"Ctrl-Right", selecttolineend:"Alt-Shift-Right", gotolineend:"Alt-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End", - del:"Delete", backspace:"Backspace", outdent:"Shift-Tab", indent:"Tab"} -}); \ No newline at end of file diff --git a/build/ace/css/editor.css b/build/ace/css/editor.css deleted file mode 100644 index b8125397..00000000 --- a/build/ace/css/editor.css +++ /dev/null @@ -1,71 +0,0 @@ -.ace_editor { - position: absolute; - overflow: hidden; - font-family: "Menlo", "Monaco", "Courier New", monospace; - font-size: 12px; -} -.ace_scroller { - position: absolute; - overflow-x: scroll; - overflow-y: hidden; -} -.ace_gutter { - position: absolute; - overflow-x: hidden; - overflow-y: hidden; - height: 100%; -} -.ace_editor .ace_sb { - position: absolute; - overflow-x: hidden; - overflow-y: scroll; - right: 0; -} -.ace_editor .ace_sb div { - position: absolute; - width: 1px; - left: 0px; -} -.ace_editor .ace_printMargin { - position: absolute; - height: 100%; -} -.ace_layer { - z-index: 0; - position: absolute; - overflow: hidden; - white-space: nowrap; - height: 100%; -} -.ace_text-layer { - font-family: Monaco, "Courier New", monospace; - color: black; -} -.ace_cursor-layer { - cursor: text; -} -.ace_cursor { - z-index: 3; - position: absolute; -} -.ace_line { - white-space: nowrap; -} -.ace_marker-layer { -} -.ace_marker-layer .ace_step { - position: absolute; - z-index: 2; -} -.ace_marker-layer .ace_selection { - position: absolute; - z-index: 3; -} -.ace_marker-layer .ace_bracket { - position: absolute; - z-index: 4; -} -.ace_marker-layer .ace_active_line { - position: absolute; - z-index: 1; -} diff --git a/build/ace/document.js b/build/ace/document.js deleted file mode 100644 index 681bad90..00000000 --- a/build/ace/document.js +++ /dev/null @@ -1,459 +0,0 @@ -define(function(g) { - var l = g("./lib/oop"), j = g("./lib/lang"), m = g("./event_emitter"), n = g("./selection"), o = g("./mode/text"), h = g("./range"); - g = function(a, b) { - this.modified = true; - this.lines = []; - this.selection = new n(this); - this.$breakpoints = []; - this.listeners = []; - b && this.setMode(b); - j.isArray(a) ? this.$insertLines(0, a) : this.$insert({row:0, column:0}, a) - }; - (function() { - l.implement(this, m); - this.$undoManager = null; - this.$split = function(a) { - return a.split(/\r\n|\r|\n/) - }; - this.setValue = function(a) { - var b = [0, this.lines.length]; - b.push.apply(b, this.$split(a)); - this.lines.splice.apply(this.lines, b); - this.modified = true; - this.fireChangeEvent(0) - }; - this.toString = function() { - return this.lines.join(this.$getNewLineCharacter()) - }; - this.getSelection = function() { - return this.selection - }; - this.fireChangeEvent = function(a, b) { - this.$dispatchEvent("change", {data:{firstRow:a, lastRow:b}}) - }; - this.setUndoManager = function(a) { - this.$undoManager = a; - this.$deltas = []; - this.$informUndoManager && this.$informUndoManager.cancel(); - if(a) { - var b = this; - this.$informUndoManager = j.deferredCall(function() { - b.$deltas.length > 0 && a.execute({action:"aceupdate", args:[b.$deltas, b]}); - b.$deltas = [] - }) - } - }; - this.$defaultUndoManager = {undo:function() { - }, redo:function() { - }}; - this.getUndoManager = function() { - return this.$undoManager || this.$defaultUndoManager - }; - this.getTabString = function() { - return this.getUseSoftTabs() ? j.stringRepeat(" ", this.getTabSize()) : "\t" - }; - this.$useSoftTabs = true; - this.setUseSoftTabs = function(a) { - if(this.$useSoftTabs !== a) { - this.$useSoftTabs = a - } - }; - this.getUseSoftTabs = function() { - return this.$useSoftTabs - }; - this.$tabSize = 4; - this.setTabSize = function(a) { - if(!(isNaN(a) || this.$tabSize === a)) { - this.modified = true; - this.$tabSize = a; - this.$dispatchEvent("changeTabSize") - } - }; - this.getTabSize = function() { - return this.$tabSize - }; - this.getBreakpoints = function() { - return this.$breakpoints - }; - this.setBreakpoints = function(a) { - this.$breakpoints = []; - for(var b = 0;b < a.length;b++) { - this.$breakpoints[a[b]] = true - }this.$dispatchEvent("changeBreakpoint", {}) - }; - this.clearBreakpoints = function() { - this.$breakpoints = []; - this.$dispatchEvent("changeBreakpoint", {}) - }; - this.setBreakpoint = function(a) { - this.$breakpoints[a] = true; - this.$dispatchEvent("changeBreakpoint", {}) - }; - this.clearBreakpoint = function(a) { - delete this.$breakpoints[a]; - this.$dispatchEvent("changeBreakpoint", {}) - }; - this.$detectNewLine = function(a) { - this.$autoNewLine = (a = a.match(/^.*?(\r?\n)/m)) ? a[1] : "\n" - }; - this.tokenRe = /^[\w\d]+/g; - this.nonTokenRe = /^[^\w\d]+/g; - this.getWordRange = function(a, b) { - var c = this.getLine(a), d = false; - if(b > 0) { - d = !!c.charAt(b - 1).match(this.tokenRe) - }d || (d = !!c.charAt(b).match(this.tokenRe)); - d = d ? this.tokenRe : this.nonTokenRe; - var e = b; - if(e > 0) { - do { - e-- - }while(e >= 0 && c.charAt(e).match(d)); - e++ - }for(b = b;b < c.length && c.charAt(b).match(d);) { - b++ - }return new h(a, e, a, b) - }; - this.$getNewLineCharacter = function() { - switch(this.$newLineMode) { - case "windows": - return"\r\n"; - case "unix": - return"\n"; - case "auto": - return this.$autoNewLine - } - }; - this.$autoNewLine = "\n"; - this.$newLineMode = "auto"; - this.setNewLineMode = function(a) { - if(this.$newLineMode !== a) { - this.$newLineMode = a - } - }; - this.getNewLineMode = function() { - return this.$newLineMode - }; - this.$mode = null; - this.setMode = function(a) { - if(this.$mode !== a) { - this.$mode = a; - this.$dispatchEvent("changeMode") - } - }; - this.getMode = function() { - if(!this.$mode) { - this.$mode = new o - }return this.$mode - }; - this.$scrollTop = 0; - this.setScrollTopRow = function(a) { - if(this.$scrollTop !== a) { - this.$scrollTop = a; - this.$dispatchEvent("changeScrollTop") - } - }; - this.getScrollTopRow = function() { - return this.$scrollTop - }; - this.getWidth = function() { - this.$computeWidth(); - return this.width - }; - this.getScreenWidth = function() { - this.$computeWidth(); - return this.screenWith - }; - this.$computeWidth = function() { - if(this.modified) { - this.modified = false; - for(var a = this.lines, b = 0, c = 0, d = this.getTabSize(), e = 0;e < a.length;e++) { - var f = a[e].length; - b = Math.max(b, f); - a[e].replace("\t", function(i) { - f += d - 1; - return i - }); - c = Math.max(c, f) - }this.width = b; - this.screenWith = c - } - }; - this.getLine = function(a) { - return this.lines[a] || "" - }; - this.getDisplayLine = function(a) { - var b = (new Array(this.getTabSize() + 1)).join(" "); - return this.lines[a].replace(/\t/g, b) - }; - this.getLines = function(a, b) { - return this.lines.slice(a, b + 1) - }; - this.getLength = function() { - return this.lines.length - }; - this.getTextRange = function(a) { - if(a.start.row == a.end.row) { - return this.lines[a.start.row].substring(a.start.column, a.end.column) - }else { - var b = []; - b.push(this.lines[a.start.row].substring(a.start.column)); - b.push.apply(b, this.getLines(a.start.row + 1, a.end.row - 1)); - b.push(this.lines[a.end.row].substring(0, a.end.column)); - return b.join(this.$getNewLineCharacter()) - } - }; - this.findMatchingBracket = function(a) { - if(a.column == 0) { - return null - }var b = this.getLine(a.row).charAt(a.column - 1); - if(b == "") { - return null - }b = b.match(/([\(\[\{])|([\)\]\}])/); - if(!b) { - return null - }return b[1] ? this.$findClosingBracket(b[1], a) : this.$findOpeningBracket(b[2], a) - }; - this.$brackets = {")":"(", "(":")", "]":"[", "[":"]", "{":"}", "}":"{"}; - this.$findOpeningBracket = function(a, b) { - var c = this.$brackets[a], d = b.column - 2; - b = b.row; - for(var e = 1, f = this.getLine(b);;) { - for(;d >= 0;) { - var i = f.charAt(d); - if(i == c) { - e -= 1; - if(e == 0) { - return{row:b, column:d} - } - }else { - if(i == a) { - e += 1 - } - }d -= 1 - }b -= 1; - if(b < 0) { - break - }f = this.getLine(b); - d = f.length - 1 - }return null - }; - this.$findClosingBracket = function(a, b) { - var c = this.$brackets[a], d = b.column; - b = b.row; - for(var e = 1, f = this.getLine(b), i = this.getLength();;) { - for(;d < f.length;) { - var k = f.charAt(d); - if(k == c) { - e -= 1; - if(e == 0) { - return{row:b, column:d} - } - }else { - if(k == a) { - e += 1 - } - }d += 1 - }b += 1; - if(b >= i) { - break - }f = this.getLine(b); - d = 0 - }return null - }; - this.insert = function(a, b, c) { - b = this.$insert(a, b, c); - this.fireChangeEvent(a.row, a.row == b.row ? a.row : undefined); - return b - }; - this.$insertLines = function(a, b, c) { - if(b.length != 0) { - var d = [a, 0]; - d.push.apply(d, b); - this.lines.splice.apply(this.lines, d); - if(!c && this.$undoManager) { - c = this.$getNewLineCharacter(); - this.$deltas.push({action:"insertText", range:new h(a, 0, a + b.length, 0), text:b.join(c) + c}); - this.$informUndoManager.schedule() - } - } - }; - this.$insert = function(a, b, c) { - if(b.length == 0) { - return a - }this.modified = true; - this.lines.length <= 1 && this.$detectNewLine(b); - var d = this.$split(b); - if(this.$isNewLine(b)) { - var e = this.lines[a.row] || ""; - this.lines[a.row] = e.substring(0, a.column); - this.lines.splice(a.row + 1, 0, e.substring(a.column)); - d = {row:a.row + 1, column:0} - }else { - if(d.length == 1) { - e = this.lines[a.row] || ""; - this.lines[a.row] = e.substring(0, a.column) + b + e.substring(a.column); - d = {row:a.row, column:a.column + b.length} - }else { - e = this.lines[a.row] || ""; - var f = e.substring(0, a.column) + d[0]; - e = d[d.length - 1] + e.substring(a.column); - this.lines[a.row] = f; - this.$insertLines(a.row + 1, [e], true); - d.length > 2 && this.$insertLines(a.row + 1, d.slice(1, -1), true); - d = {row:a.row + d.length - 1, column:d[d.length - 1].length} - } - }if(!c && this.$undoManager) { - this.$deltas.push({action:"insertText", range:h.fromPoints(a, d), text:b}); - this.$informUndoManager.schedule() - }return d - }; - this.$isNewLine = function(a) { - return a == "\r\n" || a == "\r" || a == "\n" - }; - this.remove = function(a, b) { - if(a.isEmpty()) { - return a.start - }this.$remove(a, b); - this.fireChangeEvent(a.start.row, a.isMultiLine() ? undefined : a.start.row); - return a.start - }; - this.$remove = function(a, b) { - if(!a.isEmpty()) { - if(!b && this.$undoManager) { - this.$getNewLineCharacter(); - this.$deltas.push({action:"removeText", range:a.clone(), text:this.getTextRange(a)}); - this.$informUndoManager.schedule() - }this.modified = true; - b = a.start.row; - var c = a.end.row, d = this.getLine(b).substring(0, a.start.column) + this.getLine(c).substring(a.end.column); - d != "" ? this.lines.splice(b, c - b + 1, d) : this.lines.splice(b, c - b + 1, ""); - return a.start - } - }; - this.undoChanges = function(a) { - this.selection.clearSelection(); - for(var b = a.length - 1;b >= 0;b--) { - var c = a[b]; - if(c.action == "insertText") { - this.remove(c.range, true); - this.selection.moveCursorToPosition(c.range.start) - }else { - this.insert(c.range.start, c.text, true); - this.selection.clearSelection() - } - } - }; - this.redoChanges = function(a) { - this.selection.clearSelection(); - for(var b = 0;b < a.length;b++) { - var c = a[b]; - if(c.action == "insertText") { - this.insert(c.range.start, c.text, true); - this.selection.setSelectionRange(c.range) - }else { - this.remove(c.range, true); - this.selection.moveCursorToPosition(c.range.start) - } - } - }; - this.replace = function(a, b) { - this.$remove(a); - b = b ? this.$insert(a.start, b) : a.start; - var c = a.end.column == 0 ? a.end.column - 1 : a.end.column; - this.fireChangeEvent(a.start.row, c == b.row ? c : undefined); - return b - }; - this.indentRows = function(a, b) { - b.replace("\t", this.getTabString()); - for(var c = a.start.row;c <= a.end.row;c++) { - this.$insert({row:c, column:0}, b) - }this.fireChangeEvent(a.start.row, a.end.row); - return b.length - }; - this.outdentRows = function(a) { - for(var b = new h(0, 0, 0, 0), c = this.getTabSize(), d = a.start.row;d <= a.end.row;++d) { - var e = this.getLine(d); - b.start.row = d; - b.end.row = d; - for(var f = 0;f < c;++f) { - if(e.charAt(f) != " ") { - break - } - }if(f < c && e.charAt(f) == "\t") { - b.start.column = f; - b.end.column = f + 1 - }else { - b.start.column = 0; - b.end.column = f - }if(d == a.start.row) { - a.start.column -= b.end.column - b.start.column - }if(d == a.end.row) { - a.end.column -= b.end.column - b.start.column - }this.$remove(b) - }this.fireChangeEvent(a.start.row, a.end.row); - return a - }; - this.moveLinesUp = function(a, b) { - if(a <= 0) { - return 0 - }var c = this.lines.slice(a, b + 1); - this.$remove(new h(a, 0, b + 1, 0)); - this.$insertLines(a - 1, c); - this.fireChangeEvent(a - 1, b); - return-1 - }; - this.moveLinesDown = function(a, b) { - if(b >= this.lines.length - 1) { - return 0 - }var c = this.lines.slice(a, b + 1); - this.$remove(new h(a, 0, b + 1, 0)); - this.$insertLines(a + 1, c); - this.fireChangeEvent(a, b + 1); - return 1 - }; - this.duplicateLines = function(a, b) { - a = this.$clipRowToDocument(a); - b = this.$clipRowToDocument(b); - var c = this.getLines(a, b); - this.$insertLines(a, c); - b = b - a + 1; - this.fireChangeEvent(a); - return b - }; - this.$clipRowToDocument = function(a) { - return Math.max(0, Math.min(a, this.lines.length - 1)) - }; - this.documentToScreenColumn = function(a, b) { - var c = this.getTabSize(), d = 0; - b = b; - a = this.getLine(a).split("\t"); - for(var e = 0;e < a.length;e++) { - var f = a[e].length; - if(b > f) { - b -= f + 1; - d += f + c - }else { - d += b; - break - } - }return d - }; - this.screenToDocumentColumn = function(a, b) { - var c = this.getTabSize(), d = 0; - b = b; - a = this.getLine(a).split("\t"); - for(var e = 0;e < a.length;e++) { - var f = a[e].length; - if(b >= f + c) { - b -= f + c; - d += f + 1 - }else { - d += b > f ? f : b; - break - } - }return d - } - }).call(g.prototype); - return g -}); \ No newline at end of file diff --git a/build/ace/editor.js b/build/ace/editor.js deleted file mode 100644 index 731b5f77..00000000 --- a/build/ace/editor.js +++ /dev/null @@ -1,3415 +0,0 @@ -/* - RequireJS text Copyright (c) 2010, The Dojo Foundation All Rights Reserved. - Available via the MIT or new BSD license. - see: http://github.com/jrburke/requirejs for details -*/ -(function() { - var h = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"], g = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, e = /]*>\s*([\s\S]+)\s*<\/body>/im; - if(!require.textStrip) { - require.textStrip = function(c) { - if(c) { - c = c.replace(g, ""); - var i = c.match(e); - if(i) { - c = i[1] - } - }else { - c = "" - }return c - } - }if(!require.getXhr) { - require.getXhr = function() { - var c, i, b; - if(typeof XMLHttpRequest !== "undefined") { - return new XMLHttpRequest - }else { - for(i = 0;i < 3;i++) { - b = h[i]; - try { - c = new ActiveXObject(b) - }catch(j) { - }if(c) { - h = [b]; - break - } - } - }if(!c) { - throw new Error("require.getXhr(): XMLHttpRequest not available"); - }return c - } - }if(!require.fetchText) { - require.fetchText = function(c, i) { - var b = require.getXhr(); - b.open("GET", c, true); - b.onreadystatechange = function() { - b.readyState === 4 && i(b.responseText) - }; - b.send(null) - } - }require.plugin({prefix:"text", require:function() { - }, newContext:function(c) { - require.mixin(c, {text:{}, textWaiting:[]}) - }, load:function(c, i) { - var b = false, j = null, a, f = c.indexOf("."), l = c.substring(0, f), n = c.substring(f + 1, c.length), d = require.s.contexts[i], k = d.textWaiting; - f = n.indexOf("!"); - if(f !== -1) { - b = n.substring(f + 1, n.length); - n = n.substring(0, f); - f = b.indexOf("!"); - if(f !== -1 && b.substring(0, f) === "strip") { - j = b.substring(f + 1, b.length); - b = "strip" - }else { - if(b !== "strip") { - j = b; - b = null - } - } - }a = l + "!" + n; - f = b ? a + "!" + b : a; - if(j !== null && !d.text[a]) { - d.defined[c] = d.text[a] = j - }else { - if(!d.text[a] && !d.textWaiting[a] && !d.textWaiting[f]) { - k[f] || (k[f] = k[k.push({name:c, key:a, fullKey:f, strip:!!b}) - 1]); - i = require.nameToUrl(l, "." + n, i); - d.loaded[c] = false; - require.fetchText(i, function(p) { - d.text[a] = p; - d.loaded[c] = true - }) - } - } - }, checkDeps:function() { - }, isWaiting:function(c) { - return!!c.textWaiting.length - }, orderDeps:function(c) { - var i, b, j, a = c.textWaiting; - c.textWaiting = []; - for(i = 0;b = a[i];i++) { - j = c.text[b.key]; - c.defined[b.name] = b.strip ? require.textStrip(j) : j - } - }}) -})(); -define("ace/lib/oop", ["require", "exports", "module"], function() { - var h = {}; - h.inherits = function(g, e) { - var c = function() { - }; - c.prototype = e.prototype; - g.super_ = e.prototype; - g.prototype = new c; - g.prototype.constructor = g - }; - h.mixin = function(g, e) { - for(var c in e) { - g[c] = e[c] - } - }; - h.implement = function(g, e) { - h.mixin(g, e) - }; - return h -}); -define("ace/lib/core", ["require", "exports", "module"], function() { - var h = {}, g = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); - h.isWin = g == "win"; - h.isMac = g == "mac"; - h.isLinux = g == "linux"; - h.isIE = !+"\u000b1"; - h.isGecko = window.controllers && window.navigator.product === "Gecko"; - h.provide = function(e) { - e = e.split("."); - for(var c = window, i = 0;i < e.length;i++) { - var b = e[i]; - c[b] || (c[b] = {}); - c = c[b] - } - }; - return h -}); -define("ace/lib/event", ["require", "exports", "module", "./core"], function(h) { - var g = h("./core"), e = {}; - e.addListener = function(c, i, b) { - if(c.addEventListener) { - return c.addEventListener(i, b, false) - }if(c.attachEvent) { - var j = function() { - b(window.event) - }; - b.$$wrapper = j; - c.attachEvent("on" + i, j) - } - }; - e.removeListener = function(c, i, b) { - if(c.removeEventListener) { - return c.removeEventListener(i, b, false) - }if(c.detachEvent) { - c.detachEvent("on" + i, b.$$wrapper || b) - } - }; - e.stopEvent = function(c) { - e.stopPropagation(c); - e.preventDefault(c); - return false - }; - e.stopPropagation = function(c) { - if(c.stopPropagation) { - c.stopPropagation() - }else { - c.cancelBubble = true - } - }; - e.preventDefault = function(c) { - if(c.preventDefault) { - c.preventDefault() - }else { - c.returnValue = false - } - }; - e.getDocumentX = function(c) { - return c.clientX ? c.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) : c.pageX - }; - e.getDocumentY = function(c) { - return c.clientY ? c.clientY + (document.documentElement.scrollTop || document.body.scrollTop) : c.pageX - }; - e.getButton = function(c) { - return c.preventDefault ? c.button : Math.max(c.button - 1, 2) - }; - e.capture = document.documentElement.setCapture ? function(c, i, b) { - function j(a) { - i && i(a); - b && b(); - e.removeListener(c, "mousemove", i); - e.removeListener(c, "mouseup", j); - e.removeListener(c, "losecapture", j); - c.releaseCapture() - } - e.addListener(c, "mousemove", i); - e.addListener(c, "mouseup", j); - e.addListener(c, "losecapture", j); - c.setCapture() - } : function(c, i, b) { - function j(f) { - i(f); - f.stopPropagation() - } - function a(f) { - i && i(f); - b && b(); - document.removeEventListener("mousemove", j, true); - document.removeEventListener("mouseup", a, true); - f.stopPropagation() - } - document.addEventListener("mousemove", j, true); - document.addEventListener("mouseup", a, true) - }; - e.addMouseWheelListener = function(c, i) { - var b = function(j) { - if(j.wheelDelta !== undefined) { - if(j.wheelDeltaX !== undefined) { - j.wheelX = -j.wheelDeltaX / 8; - j.wheelY = -j.wheelDeltaY / 8 - }else { - j.wheelX = 0; - j.wheelY = -j.wheelDelta / 8 - } - }else { - if(j.axis && j.axis == j.HORIZONTAL_AXIS) { - j.wheelX = (j.detail || 0) * 5; - j.wheelY = 0 - }else { - j.wheelX = 0; - j.wheelY = (j.detail || 0) * 5 - } - }i(j) - }; - e.addListener(c, "DOMMouseScroll", b); - e.addListener(c, "mousewheel", b) - }; - e.addMultiMouseDownListener = function(c, i, b, j, a) { - var f = 0, l, n, d = function(k) { - f += 1; - if(f == 1) { - l = k.clientX; - n = k.clientY; - setTimeout(function() { - f = 0 - }, j || 600) - }if(e.getButton(k) != i || Math.abs(k.clientX - l) > 5 || Math.abs(k.clientY - n) > 5) { - f = 0 - }if(f == b) { - f = 0; - a(k) - }return e.preventDefault(k) - }; - e.addListener(c, "mousedown", d); - g.isIE && e.addListener(c, "dblclick", d) - }; - e.addKeyListener = function(c, i) { - var b = null; - e.addListener(c, "keydown", function(j) { - b = j.keyIdentifier || j.keyCode; - return i(j) - }); - g.isMac && g.isGecko && e.addListener(c, "keypress", function(j) { - if(b !== (j.keyIdentifier || j.keyCode)) { - return i(j) - }else { - b = null - } - }) - }; - return e -}); -define("ace/lib/lang", ["require", "exports", "module"], function() { - var h = {}; - h.stringReverse = function(g) { - return g.split("").reverse().join("") - }; - h.stringRepeat = function(g, e) { - return(new Array(e + 1)).join(g) - }; - h.arrayIndexOf = Array.prototype.indexOf ? function(g, e) { - return g.indexOf(e) - } : function(g, e) { - for(var c = 0;c < g.length;c++) { - if(g[c] == e) { - return c - } - }return-1 - }; - h.isArray = function(g) { - return Object.prototype.toString.call(g) == "[object Array]" - }; - h.copyObject = function(g) { - var e = {}; - for(var c in g) { - e[c] = g[c] - }return e - }; - h.arrayToMap = function(g) { - for(var e = {}, c = 0;c < g.length;c++) { - e[g[c]] = 1 - }return e - }; - h.escapeRegExp = function(g) { - return g.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1") - }; - h.bind = function(g, e) { - return function() { - return g.apply(e, arguments) - } - }; - h.deferredCall = function(g) { - var e = null, c = function() { - e = null; - g() - }; - return{schedule:function() { - e || (e = setTimeout(c, 0)) - }, call:function() { - h.cancel(); - g() - }, cancel:function() { - clearTimeout(e); - e = null - }} - }; - return h -}); -define("ace/textinput", ["require", "exports", "module", "./lib/event"], function(h) { - var g = h("./lib/event"); - return function(e, c) { - function i() { - if(!l) { - var k = b.value; - if(k) { - if(k.charCodeAt(k.length - 1) == a.charCodeAt(0)) { - (k = k.slice(0, -1)) && c.onTextInput(k) - }else { - c.onTextInput(k) - } - } - }l = false; - b.value = a; - b.select() - } - var b = document.createElement("textarea"), j = b.style; - j.position = "absolute"; - j.left = "-10000px"; - j.top = "-10000px"; - e.appendChild(b); - var a = String.fromCharCode(0); - i(); - var f = false, l = false, n = function() { - setTimeout(function() { - f || i() - }, 0) - }, d = function() { - c.onCompositionUpdate(b.value) - }; - g.addListener(b, "keypress", n); - g.addListener(b, "textInput", n); - g.addListener(b, "paste", n); - g.addListener(b, "propertychange", n); - g.addListener(b, "copy", function() { - l = true; - b.value = c.getCopyText(); - b.select(); - l = true; - setTimeout(i, 0) - }); - g.addListener(b, "cut", function() { - l = true; - b.value = c.getCopyText(); - c.onCut(); - b.select(); - setTimeout(i, 0) - }); - g.addListener(b, "compositionstart", function() { - f = true; - i(); - b.value = ""; - c.onCompositionStart(); - setTimeout(d, 0) - }); - g.addListener(b, "compositionupdate", d); - g.addListener(b, "compositionend", function() { - f = false; - c.onCompositionEnd(); - n() - }); - g.addListener(b, "blur", function() { - c.onBlur() - }); - g.addListener(b, "focus", function() { - c.onFocus(); - b.select() - }); - this.focus = function() { - c.onFocus(); - b.select(); - b.focus() - }; - this.blur = function() { - b.blur() - } - } -}); -define("ace/conf/keybindings/default_mac", ["require", "exports", "module"], function() { - return{selectall:"Command-A", removeline:"Command-D", gotoline:"Command-L", togglecomment:"Command-7", findnext:"Command-K", findprevious:"Command-Shift-K", find:"Command-F", replace:"Command-R", undo:"Command-Z", redo:"Command-Shift-Z|Command-Y", overwrite:"Insert", copylinesup:"Command-Option-Up", movelinesup:"Option-Up", selecttostart:"Command-Shift-Up", gotostart:"Command-Home|Command-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Command-Option-Down", movelinesdown:"Option-Down", - selecttoend:"Command-Shift-Down", gotoend:"Command-End|Command-Down", selectdown:"Shift-Down", godown:"Down", selectwordleft:"Option-Shift-Left", gotowordleft:"Option-Left", selecttolinestart:"Command-Shift-Left", gotolinestart:"Command-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Option-Shift-Right", gotowordright:"Option-Right", selecttolineend:"Command-Shift-Right", gotolineend:"Command-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", - pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End", del:"Delete", backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace", outdent:"Shift-Tab", indent:"Tab"} -}); -define("ace/conf/keybindings/default_win", ["require", "exports", "module"], function() { - return{selectall:"Ctrl-A", removeline:"Ctrl-D", gotoline:"Ctrl-L", togglecomment:"Ctrl-7", findnext:"Ctrl-K", findprevious:"Ctrl-Shift-K", find:"Ctrl-F", replace:"Ctrl-R", undo:"Ctrl-Z", redo:"Ctrl-Shift-Z|Ctrl-Y", overwrite:"Insert", copylinesup:"Ctrl-Alt-Up", movelinesup:"Alt-Up", selecttostart:"Alt-Shift-Up", gotostart:"Ctrl-Home|Ctrl-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Ctrl-Alt-Down", movelinesdown:"Alt-Down", selecttoend:"Alt-Shift-Down", gotoend:"Ctrl-End|Ctrl-Down", selectdown:"Shift-Down", - godown:"Down", selectwordleft:"Ctrl-Shift-Left", gotowordleft:"Ctrl-Left", selecttolinestart:"Alt-Shift-Left", gotolinestart:"Alt-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Ctrl-Shift-Right", gotowordright:"Ctrl-Right", selecttolineend:"Alt-Shift-Right", gotolineend:"Alt-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End", - del:"Delete", backspace:"Backspace", outdent:"Shift-Tab", indent:"Tab"} -}); -define("ace/plugin_manager", ["require", "exports", "module"], function() { - return{commands:{}, registerCommand:function(h, g) { - this.commands[h] = g - }} -}); -define("ace/commands/default_commands", ["require", "exports", "module", "../plugin_manager"], function(h) { - h = h("../plugin_manager"); - h.registerCommand("selectall", function(g, e) { - e.selectAll() - }); - h.registerCommand("removeline", function(g) { - g.removeLines() - }); - h.registerCommand("gotoline", function(g) { - var e = parseInt(prompt("Enter line number:")); - isNaN(e) || g.gotoLine(e) - }); - h.registerCommand("togglecomment", function(g) { - g.toggleCommentLines() - }); - h.registerCommand("findnext", function(g) { - g.findNext() - }); - h.registerCommand("findprevious", function(g) { - g.findPrevious() - }); - h.registerCommand("find", function(g) { - var e = prompt("Find:"); - g.find(e) - }); - h.registerCommand("undo", function(g) { - g.undo() - }); - h.registerCommand("redo", function(g) { - g.redo() - }); - h.registerCommand("redo", function(g) { - g.redo() - }); - h.registerCommand("overwrite", function(g) { - g.toggleOverwrite() - }); - h.registerCommand("copylinesup", function(g) { - g.copyLinesUp() - }); - h.registerCommand("movelinesup", function(g) { - g.moveLinesUp() - }); - h.registerCommand("selecttostart", function(g, e) { - e.selectFileStart() - }); - h.registerCommand("gotostart", function(g) { - g.navigateFileStart() - }); - h.registerCommand("selectup", function(g, e) { - e.selectUp() - }); - h.registerCommand("golineup", function(g) { - g.navigateUp() - }); - h.registerCommand("copylinesdown", function(g) { - g.copyLinesDown() - }); - h.registerCommand("movelinesdown", function(g) { - g.moveLinesDown() - }); - h.registerCommand("selecttoend", function(g, e) { - e.selectFileEnd() - }); - h.registerCommand("gotoend", function(g) { - g.navigateFileEnd() - }); - h.registerCommand("selectdown", function(g, e) { - e.selectDown() - }); - h.registerCommand("godown", function(g) { - g.navigateDown() - }); - h.registerCommand("selectwordleft", function(g, e) { - e.selectWordLeft() - }); - h.registerCommand("gotowordleft", function(g) { - g.navigateWordLeft() - }); - h.registerCommand("selecttolinestart", function(g, e) { - e.selectLineStart() - }); - h.registerCommand("gotolinestart", function(g) { - g.navigateLineStart() - }); - h.registerCommand("selectleft", function(g, e) { - e.selectLeft() - }); - h.registerCommand("gotoleft", function(g) { - g.navigateLeft() - }); - h.registerCommand("selectwordright", function(g, e) { - e.selectWordRight() - }); - h.registerCommand("gotowordright", function(g) { - g.navigateWordRight() - }); - h.registerCommand("selecttolineend", function(g, e) { - e.selectLineEnd() - }); - h.registerCommand("gotolineend", function(g) { - g.navigateLineEnd() - }); - h.registerCommand("selectright", function(g, e) { - e.selectRight() - }); - h.registerCommand("gotoright", function(g) { - g.navigateRight() - }); - h.registerCommand("selectpagedown", function(g) { - g.selectPageDown() - }); - h.registerCommand("pagedown", function(g) { - g.scrollPageDown() - }); - h.registerCommand("gotopagedown", function(g) { - g.gotoPageDown() - }); - h.registerCommand("selectpageup", function(g) { - g.selectPageUp() - }); - h.registerCommand("pageup", function(g) { - g.scrollPageUp() - }); - h.registerCommand("gotopageup", function(g) { - g.gotoPageUp() - }); - h.registerCommand("selectlinestart", function(g, e) { - e.selectLineStart() - }); - h.registerCommand("gotolinestart", function(g) { - g.navigateLineStart() - }); - h.registerCommand("selectlineend", function(g, e) { - e.selectLineEnd() - }); - h.registerCommand("gotolineend", function(g) { - g.navigateLineEnd() - }); - h.registerCommand("del", function(g) { - g.removeRight() - }); - h.registerCommand("backspace", function(g) { - g.removeLeft() - }); - h.registerCommand("outdent", function(g) { - g.blockOutdent() - }); - h.registerCommand("indent", function(g) { - g.indent() - }) -}); -define("ace/keybinding", ["require", "exports", "module", "./lib/core", "./lib/event", "./conf/keybindings/default_mac", "./conf/keybindings/default_win", "./plugin_manager", "./commands/default_commands"], function(h) { - var g = h("./lib/core"), e = h("./lib/event"), c = h("./conf/keybindings/default_mac"), i = h("./conf/keybindings/default_win"), b = h("./plugin_manager"); - h("./commands/default_commands"); - h = function(j, a, f) { - this.setConfig(f); - var l = this; - e.addKeyListener(j, function(n) { - var d = (l.config.reverse[0 | (n.ctrlKey ? 1 : 0) | (n.altKey ? 2 : 0) | (n.shiftKey ? 4 : 0) | (n.metaKey ? 8 : 0)] || {})[(l.keyNames[n.keyCode] || String.fromCharCode(n.keyCode)).toLowerCase()]; - if(d = b.commands[d]) { - d(a, a.getSelection()); - return e.stopEvent(n) - } - }) - }; - (function() { - function j(l, n, d, k) { - return(k && l.toLowerCase() || l).replace(/(?:^\s+|\n|\s+$)/g, "").split(new RegExp("[\\s ]*" + n + "[\\s ]*", "g"), d || 999) - } - function a(l, n, d) { - var k, p = 0; - l = j(l, "\\-", null, true); - for(var o = 0, m = l.length;o < m;++o) { - if(this.keyMods[l[o]]) { - p |= this.keyMods[l[o]] - }else { - k = l[o] || "-" - } - }(d[p] || (d[p] = {}))[k] = n; - return d - } - function f(l, n) { - var d, k, p, o, m = {}; - for(d in l) { - o = l[d]; - if(n && typeof o == "string") { - o = o.split(n); - k = 0; - for(p = o.length;k < p;++k) { - a.call(this, o[k], d, m) - } - }else { - a.call(this, o, d, m) - } - }return m - } - this.keyMods = {ctrl:1, alt:2, option:2, shift:4, meta:8, command:8}; - this.keyNames = {"8":"Backspace", "9":"Tab", "13":"Enter", "27":"Esc", "32":"Space", "33":"PageUp", "34":"PageDown", "35":"End", "36":"Home", "37":"Left", "38":"Up", "39":"Right", "40":"Down", "45":"Insert", "46":"Delete", "107":"+", "112":"F1", "113":"F2", "114":"F3", "115":"F4", "116":"F5", "117":"F6", "118":"F7", "119":"F8", "120":"F9", "121":"F10", "122":"F11", "123":"F12"}; - this.setConfig = function(l) { - this.config = l || (g.isMac ? c : i); - if(typeof this.config.reverse == "undefined") { - this.config.reverse = f.call(this, this.config, "|") - } - } - }).call(h.prototype); - return h -}); -define("ace/event_emitter", ["require", "exports", "module", "./lib/lang"], function(h) { - var g = h("./lib/lang"); - h = {}; - h.$dispatchEvent = function(e, c) { - this.$eventRegistry = this.$eventRegistry || {}; - var i = this.$eventRegistry[e]; - if(i && i.length) { - c = c || {}; - c.type = e; - for(e = 0;e < i.length;e++) { - i[e](c) - } - } - }; - h.on = h.addEventListener = function(e, c) { - this.$eventRegistry = this.$eventRegistry || {}; - var i = this.$eventRegistry[e]; - i || (i = this.$eventRegistry[e] = []); - g.arrayIndexOf(i, c) == -1 && i.push(c) - }; - h.removeEventListener = function(e, c) { - this.$eventRegistry = this.$eventRegistry || {}; - if(e = this.$eventRegistry[e]) { - c = g.arrayIndexOf(e, c); - c !== -1 && e.splice(c, 1) - } - }; - return h -}); -define("ace/range", ["require", "exports", "module"], function() { - var h = function(g, e, c, i) { - this.start = {row:g, column:e}; - this.end = {row:c, column:i} - }; - (function() { - this.toString = function() { - return"Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]" - }; - this.contains = function(g, e) { - return this.compare(g, e) == 0 - }; - this.compare = function(g, e) { - if(!this.isMultiLine()) { - if(g === this.start.row) { - return e < this.start.column ? -1 : e > this.end.column ? 1 : 0 - } - }if(g < this.start.row) { - return-1 - }if(g > this.end.row) { - return 1 - }if(this.start.row === g) { - return e >= this.start.column ? 0 : -1 - }if(this.end.row === g) { - return e <= this.end.column ? 0 : 1 - }return 0 - }; - this.clipRows = function(g, e) { - if(this.end.row > e) { - var c = {row:e + 1, column:0} - }if(this.start.row > e) { - var i = {row:e + 1, column:0} - }if(this.start.row < g) { - i = {row:g, column:0} - }if(this.end.row < g) { - c = {row:g, column:0} - }return h.fromPoints(i || this.start, c || this.end) - }; - this.extend = function(g, e) { - var c = this.compare(g, e); - if(c == 0) { - return this - }else { - if(c == -1) { - var i = {row:g, column:e} - }else { - var b = {row:g, column:e} - } - }return h.fromPoints(i || this.start, b || this.end) - }; - this.isEmpty = function() { - return this.start.row == this.end.row && this.start.column == this.end.column - }; - this.isMultiLine = function() { - return this.start.row !== this.end.row - }; - this.clone = function() { - return h.fromPoints(this.start, this.end) - }; - this.toScreenRange = function(g) { - return new h(this.start.row, g.documentToScreenColumn(this.start.row, this.start.column), this.end.row, g.documentToScreenColumn(this.end.row, this.end.column)) - } - }).call(h.prototype); - h.fromPoints = function(g, e) { - return new h(g.row, g.column, e.row, e.column) - }; - return h -}); -define("ace/selection", ["require", "exports", "module", "./lib/oop", "./lib/lang", "./event_emitter", "./range"], function(h) { - var g = h("./lib/oop"), e = h("./lib/lang"), c = h("./event_emitter"), i = h("./range"); - h = function(b) { - this.doc = b; - this.clearSelection(); - this.selectionLead = {row:0, column:0} - }; - (function() { - g.implement(this, c); - this.isEmpty = function() { - return!this.selectionAnchor || this.selectionAnchor.row == this.selectionLead.row && this.selectionAnchor.column == this.selectionLead.column - }; - this.isMultiLine = function() { - if(this.isEmpty()) { - return false - }return this.getRange().isMultiLine() - }; - this.getCursor = function() { - return this.selectionLead - }; - this.setSelectionAnchor = function(b, j) { - b = this.$clipPositionToDocument(b, j); - if(this.selectionAnchor) { - if(this.selectionAnchor.row !== b.row || this.selectionAnchor.column !== b.column) { - this.selectionAnchor = b; - this.$dispatchEvent("changeSelection", {}) - } - }else { - this.selectionAnchor = b; - this.$dispatchEvent("changeSelection", {}) - } - }; - this.getSelectionAnchor = function() { - return this.selectionAnchor ? this.$clone(this.selectionAnchor) : this.$clone(this.selectionLead) - }; - this.getSelectionLead = function() { - return this.$clone(this.selectionLead) - }; - this.shiftSelection = function(b) { - if(this.isEmpty()) { - this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + b) - }else { - var j = this.getSelectionAnchor(), a = this.getSelectionLead(), f = this.isBackwards(); - if(!f || j.column !== 0) { - this.setSelectionAnchor(j.row, j.column + b) - }if(f || a.column !== 0) { - this.$moveSelection(function() { - this.moveCursorTo(a.row, a.column + b) - }) - } - } - }; - this.isBackwards = function() { - var b = this.selectionAnchor || this.selectionLead, j = this.selectionLead; - return b.row > j.row || b.row == j.row && b.column > j.column - }; - this.getRange = function() { - var b = this.selectionAnchor || this.selectionLead, j = this.selectionLead; - return this.isBackwards() ? i.fromPoints(j, b) : i.fromPoints(b, j) - }; - this.clearSelection = function() { - if(this.selectionAnchor) { - this.selectionAnchor = null; - this.$dispatchEvent("changeSelection", {}) - } - }; - this.selectAll = function() { - var b = this.doc.getLength() - 1; - this.setSelectionAnchor(b, this.doc.getLine(b).length); - this.$moveSelection(function() { - this.moveCursorTo(0, 0) - }) - }; - this.setSelectionRange = function(b, j) { - if(j) { - this.setSelectionAnchor(b.end.row, b.end.column); - this.selectTo(b.start.row, b.start.column) - }else { - this.setSelectionAnchor(b.start.row, b.start.column); - this.selectTo(b.end.row, b.end.column) - } - }; - this.$moveSelection = function(b) { - var j = false; - if(!this.selectionAnchor) { - j = true; - this.selectionAnchor = this.$clone(this.selectionLead) - }var a = this.$clone(this.selectionLead); - b.call(this); - if(a.row !== this.selectionLead.row || a.column !== this.selectionLead.column) { - j = true - }j && this.$dispatchEvent("changeSelection", {}) - }; - this.selectTo = function(b, j) { - this.$moveSelection(function() { - this.moveCursorTo(b, j) - }) - }; - this.selectToPosition = function(b) { - this.$moveSelection(function() { - this.moveCursorToPosition(b) - }) - }; - this.selectUp = function() { - this.$moveSelection(this.moveCursorUp) - }; - this.selectDown = function() { - this.$moveSelection(this.moveCursorDown) - }; - this.selectRight = function() { - this.$moveSelection(this.moveCursorRight) - }; - this.selectLeft = function() { - this.$moveSelection(this.moveCursorLeft) - }; - this.selectLineStart = function() { - this.$moveSelection(this.moveCursorLineStart) - }; - this.selectLineEnd = function() { - this.$moveSelection(this.moveCursorLineEnd) - }; - this.selectFileEnd = function() { - this.$moveSelection(this.moveCursorFileEnd) - }; - this.selectFileStart = function() { - this.$moveSelection(this.moveCursorFileStart) - }; - this.selectWordRight = function() { - this.$moveSelection(this.moveCursorWordRight) - }; - this.selectWordLeft = function() { - this.$moveSelection(this.moveCursorWordLeft) - }; - this.selectWord = function() { - var b = this.selectionLead; - this.setSelectionRange(this.doc.getWordRange(b.row, b.column)) - }; - this.selectLine = function() { - this.setSelectionAnchor(this.selectionLead.row, 0); - this.$moveSelection(function() { - this.moveCursorTo(this.selectionLead.row + 1, 0) - }) - }; - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0) - }; - this.moveCursorDown = function() { - this.moveCursorBy(1, 0) - }; - this.moveCursorLeft = function() { - if(this.selectionLead.column == 0) { - this.selectionLead.row > 0 && this.moveCursorTo(this.selectionLead.row - 1, this.doc.getLine(this.selectionLead.row - 1).length) - }else { - this.moveCursorBy(0, -1) - } - }; - this.moveCursorRight = function() { - if(this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) { - this.selectionLead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.selectionLead.row + 1, 0) - }else { - this.moveCursorBy(0, 1) - } - }; - this.moveCursorLineStart = function() { - var b = this.selectionLead.row, j = this.selectionLead.column, a = this.doc.getLine(b).slice(0, j).match(/^\s*/); - if(a[0].length == 0) { - this.moveCursorTo(b, this.doc.getLine(b).match(/^\s*/)[0].length) - }else { - a[0].length >= j ? this.moveCursorTo(b, 0) : this.moveCursorTo(b, a[0].length) - } - }; - this.moveCursorLineEnd = function() { - this.moveCursorTo(this.selectionLead.row, this.doc.getLine(this.selectionLead.row).length) - }; - this.moveCursorFileEnd = function() { - var b = this.doc.getLength() - 1, j = this.doc.getLine(b).length; - this.moveCursorTo(b, j) - }; - this.moveCursorFileStart = function() { - this.moveCursorTo(0, 0) - }; - this.moveCursorWordRight = function() { - var b = this.selectionLead.row, j = this.selectionLead.column, a = this.doc.getLine(b), f = a.substring(j); - this.doc.nonTokenRe.lastIndex = 0; - this.doc.tokenRe.lastIndex = 0; - if(j == a.length) { - this.moveCursorRight() - }else { - if(this.doc.nonTokenRe.exec(f)) { - j += this.doc.nonTokenRe.lastIndex; - this.doc.nonTokenRe.lastIndex = 0 - }else { - if(this.doc.tokenRe.exec(f)) { - j += this.doc.tokenRe.lastIndex; - this.doc.tokenRe.lastIndex = 0 - } - }this.moveCursorTo(b, j) - } - }; - this.moveCursorWordLeft = function() { - var b = this.selectionLead.row, j = this.selectionLead.column, a = this.doc.getLine(b); - a = e.stringReverse(a.substring(0, j)); - this.doc.nonTokenRe.lastIndex = 0; - this.doc.tokenRe.lastIndex = 0; - if(j == 0) { - this.moveCursorLeft() - }else { - if(this.doc.nonTokenRe.exec(a)) { - j -= this.doc.nonTokenRe.lastIndex; - this.doc.nonTokenRe.lastIndex = 0 - }else { - if(this.doc.tokenRe.exec(a)) { - j -= this.doc.tokenRe.lastIndex; - this.doc.tokenRe.lastIndex = 0 - } - }this.moveCursorTo(b, j) - } - }; - this.moveCursorBy = function(b, j) { - this.moveCursorTo(this.selectionLead.row + b, this.selectionLead.column + j) - }; - this.moveCursorToPosition = function(b) { - this.moveCursorTo(b.row, b.column) - }; - this.moveCursorTo = function(b, j) { - b = this.$clipPositionToDocument(b, j); - if(b.row !== this.selectionLead.row || b.column !== this.selectionLead.column) { - this.selectionLead = b; - this.$dispatchEvent("changeCursor", {data:this.getCursor()}) - } - }; - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0) - }; - this.$clipPositionToDocument = function(b, j) { - var a = {}; - if(b >= this.doc.getLength()) { - a.row = Math.max(0, this.doc.getLength() - 1); - a.column = this.doc.getLine(a.row).length - }else { - if(b < 0) { - a.row = 0; - a.column = 0 - }else { - a.row = b; - a.column = Math.min(this.doc.getLine(a.row).length, Math.max(0, j)) - } - }return a - }; - this.$clone = function(b) { - return{row:b.row, column:b.column} - } - }).call(h.prototype); - return h -}); -define("ace/tokenizer", ["require", "exports", "module"], function() { - var h = function(g) { - this.rules = g; - this.regExps = {}; - for(var e in this.rules) { - g = this.rules[e]; - for(var c = [], i = 0;i < g.length;i++) { - c.push(g[i].regex) - }this.regExps[e] = new RegExp("(?:(" + c.join(")|(") + ")|(.))", "g") - } - }; - (function() { - this.getLineTokens = function(g, e) { - e = e; - var c = this.rules[e], i = this.regExps[e]; - i.lastIndex = 0; - for(var b, j = [], a = 0, f = {type:null, value:""};b = i.exec(g);) { - var l = "text", n = b[0]; - if(i.lastIndex == a) { - throw new Error("tokenizer error"); - }a = i.lastIndex; - window.LOG && console.log(e, b); - for(var d = 0;d < c.length;d++) { - if(b[d + 1]) { - l = typeof c[d].token == "function" ? c[d].token(b[0]) : c[d].token; - if(c[d].next && c[d].next !== e) { - e = c[d].next; - c = this.rules[e]; - a = i.lastIndex; - i = this.regExps[e]; - i.lastIndex = a - }break - } - }if(f.type !== l) { - f.type && j.push(f); - f = {type:l, value:n} - }else { - f.value += n - } - }f.type && j.push(f); - window.LOG && console.log(j, e); - return{tokens:j, state:e} - } - }).call(h.prototype); - return h -}); -define("ace/mode/text_highlight_rules", ["require", "exports", "module"], function() { - var h = function() { - this.$rules = {start:[{token:"text", regex:".+"}]} - }; - (function() { - this.addRules = function(g, e) { - for(var c in g) { - for(var i = g[c], b = 0;b < i.length;b++) { - var j = i[b]; - j.next = j.next ? e + j.next : e + c - }this.$rules[e + c] = i - } - }; - this.getRules = function() { - return this.$rules - } - }).call(h.prototype); - return h -}); -define("ace/mode/text", ["require", "exports", "module", "../tokenizer", "./text_highlight_rules"], function(h) { - var g = h("../tokenizer"), e = h("./text_highlight_rules"); - h = function() { - this.$tokenizer = new g((new e).getRules()) - }; - (function() { - this.getTokenizer = function() { - return this.$tokenizer - }; - this.toggleCommentLines = function() { - return 0 - }; - this.getNextLineIndent = function() { - return"" - }; - this.checkOutdent = function() { - return false - }; - this.autoOutdent = function() { - }; - this.$getIndent = function(c) { - if(c = c.match(/^(\s+)/)) { - return c[1] - }return"" - } - }).call(h.prototype); - return h -}); -define("ace/document", ["require", "exports", "module", "./lib/oop", "./lib/lang", "./event_emitter", "./selection", "./mode/text", "./range"], function(h) { - var g = h("./lib/oop"), e = h("./lib/lang"), c = h("./event_emitter"), i = h("./selection"), b = h("./mode/text"), j = h("./range"); - h = function(a, f) { - this.modified = true; - this.lines = []; - this.selection = new i(this); - this.$breakpoints = []; - this.listeners = []; - f && this.setMode(f); - e.isArray(a) ? this.$insertLines(0, a) : this.$insert({row:0, column:0}, a) - }; - (function() { - g.implement(this, c); - this.$undoManager = null; - this.$split = function(a) { - return a.split(/\r\n|\r|\n/) - }; - this.setValue = function(a) { - var f = [0, this.lines.length]; - f.push.apply(f, this.$split(a)); - this.lines.splice.apply(this.lines, f); - this.modified = true; - this.fireChangeEvent(0) - }; - this.toString = function() { - return this.lines.join(this.$getNewLineCharacter()) - }; - this.getSelection = function() { - return this.selection - }; - this.fireChangeEvent = function(a, f) { - this.$dispatchEvent("change", {data:{firstRow:a, lastRow:f}}) - }; - this.setUndoManager = function(a) { - this.$undoManager = a; - this.$deltas = []; - this.$informUndoManager && this.$informUndoManager.cancel(); - if(a) { - var f = this; - this.$informUndoManager = e.deferredCall(function() { - f.$deltas.length > 0 && a.execute({action:"aceupdate", args:[f.$deltas, f]}); - f.$deltas = [] - }) - } - }; - this.$defaultUndoManager = {undo:function() { - }, redo:function() { - }}; - this.getUndoManager = function() { - return this.$undoManager || this.$defaultUndoManager - }; - this.getTabString = function() { - return this.getUseSoftTabs() ? e.stringRepeat(" ", this.getTabSize()) : "\t" - }; - this.$useSoftTabs = true; - this.setUseSoftTabs = function(a) { - if(this.$useSoftTabs !== a) { - this.$useSoftTabs = a - } - }; - this.getUseSoftTabs = function() { - return this.$useSoftTabs - }; - this.$tabSize = 4; - this.setTabSize = function(a) { - if(!(isNaN(a) || this.$tabSize === a)) { - this.modified = true; - this.$tabSize = a; - this.$dispatchEvent("changeTabSize") - } - }; - this.getTabSize = function() { - return this.$tabSize - }; - this.getBreakpoints = function() { - return this.$breakpoints - }; - this.setBreakpoints = function(a) { - this.$breakpoints = []; - for(var f = 0;f < a.length;f++) { - this.$breakpoints[a[f]] = true - }this.$dispatchEvent("changeBreakpoint", {}) - }; - this.clearBreakpoints = function() { - this.$breakpoints = []; - this.$dispatchEvent("changeBreakpoint", {}) - }; - this.setBreakpoint = function(a) { - this.$breakpoints[a] = true; - this.$dispatchEvent("changeBreakpoint", {}) - }; - this.clearBreakpoint = function(a) { - delete this.$breakpoints[a]; - this.$dispatchEvent("changeBreakpoint", {}) - }; - this.$detectNewLine = function(a) { - this.$autoNewLine = (a = a.match(/^.*?(\r?\n)/m)) ? a[1] : "\n" - }; - this.tokenRe = /^[\w\d]+/g; - this.nonTokenRe = /^[^\w\d]+/g; - this.getWordRange = function(a, f) { - var l = this.getLine(a), n = false; - if(f > 0) { - n = !!l.charAt(f - 1).match(this.tokenRe) - }n || (n = !!l.charAt(f).match(this.tokenRe)); - n = n ? this.tokenRe : this.nonTokenRe; - var d = f; - if(d > 0) { - do { - d-- - }while(d >= 0 && l.charAt(d).match(n)); - d++ - }for(f = f;f < l.length && l.charAt(f).match(n);) { - f++ - }return new j(a, d, a, f) - }; - this.$getNewLineCharacter = function() { - switch(this.$newLineMode) { - case "windows": - return"\r\n"; - case "unix": - return"\n"; - case "auto": - return this.$autoNewLine - } - }; - this.$autoNewLine = "\n"; - this.$newLineMode = "auto"; - this.setNewLineMode = function(a) { - if(this.$newLineMode !== a) { - this.$newLineMode = a - } - }; - this.getNewLineMode = function() { - return this.$newLineMode - }; - this.$mode = null; - this.setMode = function(a) { - if(this.$mode !== a) { - this.$mode = a; - this.$dispatchEvent("changeMode") - } - }; - this.getMode = function() { - if(!this.$mode) { - this.$mode = new b - }return this.$mode - }; - this.$scrollTop = 0; - this.setScrollTopRow = function(a) { - if(this.$scrollTop !== a) { - this.$scrollTop = a; - this.$dispatchEvent("changeScrollTop") - } - }; - this.getScrollTopRow = function() { - return this.$scrollTop - }; - this.getWidth = function() { - this.$computeWidth(); - return this.width - }; - this.getScreenWidth = function() { - this.$computeWidth(); - return this.screenWith - }; - this.$computeWidth = function() { - if(this.modified) { - this.modified = false; - for(var a = this.lines, f = 0, l = 0, n = this.getTabSize(), d = 0;d < a.length;d++) { - var k = a[d].length; - f = Math.max(f, k); - a[d].replace("\t", function(p) { - k += n - 1; - return p - }); - l = Math.max(l, k) - }this.width = f; - this.screenWith = l - } - }; - this.getLine = function(a) { - return this.lines[a] || "" - }; - this.getDisplayLine = function(a) { - var f = (new Array(this.getTabSize() + 1)).join(" "); - return this.lines[a].replace(/\t/g, f) - }; - this.getLines = function(a, f) { - return this.lines.slice(a, f + 1) - }; - this.getLength = function() { - return this.lines.length - }; - this.getTextRange = function(a) { - if(a.start.row == a.end.row) { - return this.lines[a.start.row].substring(a.start.column, a.end.column) - }else { - var f = []; - f.push(this.lines[a.start.row].substring(a.start.column)); - f.push.apply(f, this.getLines(a.start.row + 1, a.end.row - 1)); - f.push(this.lines[a.end.row].substring(0, a.end.column)); - return f.join(this.$getNewLineCharacter()) - } - }; - this.findMatchingBracket = function(a) { - if(a.column == 0) { - return null - }var f = this.getLine(a.row).charAt(a.column - 1); - if(f == "") { - return null - }f = f.match(/([\(\[\{])|([\)\]\}])/); - if(!f) { - return null - }return f[1] ? this.$findClosingBracket(f[1], a) : this.$findOpeningBracket(f[2], a) - }; - this.$brackets = {")":"(", "(":")", "]":"[", "[":"]", "{":"}", "}":"{"}; - this.$findOpeningBracket = function(a, f) { - var l = this.$brackets[a], n = f.column - 2; - f = f.row; - for(var d = 1, k = this.getLine(f);;) { - for(;n >= 0;) { - var p = k.charAt(n); - if(p == l) { - d -= 1; - if(d == 0) { - return{row:f, column:n} - } - }else { - if(p == a) { - d += 1 - } - }n -= 1 - }f -= 1; - if(f < 0) { - break - }k = this.getLine(f); - n = k.length - 1 - }return null - }; - this.$findClosingBracket = function(a, f) { - var l = this.$brackets[a], n = f.column; - f = f.row; - for(var d = 1, k = this.getLine(f), p = this.getLength();;) { - for(;n < k.length;) { - var o = k.charAt(n); - if(o == l) { - d -= 1; - if(d == 0) { - return{row:f, column:n} - } - }else { - if(o == a) { - d += 1 - } - }n += 1 - }f += 1; - if(f >= p) { - break - }k = this.getLine(f); - n = 0 - }return null - }; - this.insert = function(a, f, l) { - f = this.$insert(a, f, l); - this.fireChangeEvent(a.row, a.row == f.row ? a.row : undefined); - return f - }; - this.$insertLines = function(a, f, l) { - if(f.length != 0) { - var n = [a, 0]; - n.push.apply(n, f); - this.lines.splice.apply(this.lines, n); - if(!l && this.$undoManager) { - l = this.$getNewLineCharacter(); - this.$deltas.push({action:"insertText", range:new j(a, 0, a + f.length, 0), text:f.join(l) + l}); - this.$informUndoManager.schedule() - } - } - }; - this.$insert = function(a, f, l) { - if(f.length == 0) { - return a - }this.modified = true; - this.lines.length <= 1 && this.$detectNewLine(f); - var n = this.$split(f); - if(this.$isNewLine(f)) { - var d = this.lines[a.row] || ""; - this.lines[a.row] = d.substring(0, a.column); - this.lines.splice(a.row + 1, 0, d.substring(a.column)); - n = {row:a.row + 1, column:0} - }else { - if(n.length == 1) { - d = this.lines[a.row] || ""; - this.lines[a.row] = d.substring(0, a.column) + f + d.substring(a.column); - n = {row:a.row, column:a.column + f.length} - }else { - d = this.lines[a.row] || ""; - var k = d.substring(0, a.column) + n[0]; - d = n[n.length - 1] + d.substring(a.column); - this.lines[a.row] = k; - this.$insertLines(a.row + 1, [d], true); - n.length > 2 && this.$insertLines(a.row + 1, n.slice(1, -1), true); - n = {row:a.row + n.length - 1, column:n[n.length - 1].length} - } - }if(!l && this.$undoManager) { - this.$deltas.push({action:"insertText", range:j.fromPoints(a, n), text:f}); - this.$informUndoManager.schedule() - }return n - }; - this.$isNewLine = function(a) { - return a == "\r\n" || a == "\r" || a == "\n" - }; - this.remove = function(a, f) { - if(a.isEmpty()) { - return a.start - }this.$remove(a, f); - this.fireChangeEvent(a.start.row, a.isMultiLine() ? undefined : a.start.row); - return a.start - }; - this.$remove = function(a, f) { - if(!a.isEmpty()) { - if(!f && this.$undoManager) { - this.$getNewLineCharacter(); - this.$deltas.push({action:"removeText", range:a.clone(), text:this.getTextRange(a)}); - this.$informUndoManager.schedule() - }this.modified = true; - f = a.start.row; - var l = a.end.row, n = this.getLine(f).substring(0, a.start.column) + this.getLine(l).substring(a.end.column); - n != "" ? this.lines.splice(f, l - f + 1, n) : this.lines.splice(f, l - f + 1, ""); - return a.start - } - }; - this.undoChanges = function(a) { - this.selection.clearSelection(); - for(var f = a.length - 1;f >= 0;f--) { - var l = a[f]; - if(l.action == "insertText") { - this.remove(l.range, true); - this.selection.moveCursorToPosition(l.range.start) - }else { - this.insert(l.range.start, l.text, true); - this.selection.clearSelection() - } - } - }; - this.redoChanges = function(a) { - this.selection.clearSelection(); - for(var f = 0;f < a.length;f++) { - var l = a[f]; - if(l.action == "insertText") { - this.insert(l.range.start, l.text, true); - this.selection.setSelectionRange(l.range) - }else { - this.remove(l.range, true); - this.selection.moveCursorToPosition(l.range.start) - } - } - }; - this.replace = function(a, f) { - this.$remove(a); - f = f ? this.$insert(a.start, f) : a.start; - var l = a.end.column == 0 ? a.end.column - 1 : a.end.column; - this.fireChangeEvent(a.start.row, l == f.row ? l : undefined); - return f - }; - this.indentRows = function(a, f) { - f.replace("\t", this.getTabString()); - for(var l = a.start.row;l <= a.end.row;l++) { - this.$insert({row:l, column:0}, f) - }this.fireChangeEvent(a.start.row, a.end.row); - return f.length - }; - this.outdentRows = function(a) { - for(var f = new j(0, 0, 0, 0), l = this.getTabSize(), n = a.start.row;n <= a.end.row;++n) { - var d = this.getLine(n); - f.start.row = n; - f.end.row = n; - for(var k = 0;k < l;++k) { - if(d.charAt(k) != " ") { - break - } - }if(k < l && d.charAt(k) == "\t") { - f.start.column = k; - f.end.column = k + 1 - }else { - f.start.column = 0; - f.end.column = k - }if(n == a.start.row) { - a.start.column -= f.end.column - f.start.column - }if(n == a.end.row) { - a.end.column -= f.end.column - f.start.column - }this.$remove(f) - }this.fireChangeEvent(a.start.row, a.end.row); - return a - }; - this.moveLinesUp = function(a, f) { - if(a <= 0) { - return 0 - }var l = this.lines.slice(a, f + 1); - this.$remove(new j(a, 0, f + 1, 0)); - this.$insertLines(a - 1, l); - this.fireChangeEvent(a - 1, f); - return-1 - }; - this.moveLinesDown = function(a, f) { - if(f >= this.lines.length - 1) { - return 0 - }var l = this.lines.slice(a, f + 1); - this.$remove(new j(a, 0, f + 1, 0)); - this.$insertLines(a + 1, l); - this.fireChangeEvent(a, f + 1); - return 1 - }; - this.duplicateLines = function(a, f) { - a = this.$clipRowToDocument(a); - f = this.$clipRowToDocument(f); - var l = this.getLines(a, f); - this.$insertLines(a, l); - f = f - a + 1; - this.fireChangeEvent(a); - return f - }; - this.$clipRowToDocument = function(a) { - return Math.max(0, Math.min(a, this.lines.length - 1)) - }; - this.documentToScreenColumn = function(a, f) { - var l = this.getTabSize(), n = 0; - f = f; - a = this.getLine(a).split("\t"); - for(var d = 0;d < a.length;d++) { - var k = a[d].length; - if(f > k) { - f -= k + 1; - n += k + l - }else { - n += f; - break - } - }return n - }; - this.screenToDocumentColumn = function(a, f) { - var l = this.getTabSize(), n = 0; - f = f; - a = this.getLine(a).split("\t"); - for(var d = 0;d < a.length;d++) { - var k = a[d].length; - if(f >= k + l) { - f -= k + l; - n += k + 1 - }else { - n += f > k ? k : f; - break - } - }return n - } - }).call(h.prototype); - return h -}); -define("ace/search", ["require", "exports", "module", "./lib/lang", "./lib/oop", "./range"], function(h) { - var g = h("./lib/lang"), e = h("./lib/oop"), c = h("./range"), i = function() { - this.$options = {needle:"", backwards:false, wrap:false, caseSensitive:false, wholeWord:false, scope:i.ALL, regExp:false} - }; - i.ALL = 1; - i.SELECTION = 2; - (function() { - this.set = function(b) { - e.mixin(this.$options, b); - return this - }; - this.getOptions = function() { - return g.copyObject(this.$options) - }; - this.find = function(b) { - if(!this.$options.needle) { - return null - }var j = null; - (this.$options.backwards ? this.$backwardMatchIterator(b) : this.$forwardMatchIterator(b)).forEach(function(a) { - j = a; - return true - }); - return j - }; - this.findAll = function(b) { - if(!this.$options.needle) { - return[] - }var j = []; - (this.$options.backwards ? this.$backwardMatchIterator(b) : this.$forwardMatchIterator(b)).forEach(function(a) { - j.push(a) - }); - return j - }; - this.replace = function(b, j) { - var a = this.$assembleRegExp(), f = a.exec(b); - return f && f[0].length == b.length ? this.$options.regExp ? b.replace(a, j) : j : null - }; - this.$forwardMatchIterator = function(b) { - var j = this.$assembleRegExp(), a = this; - return{forEach:function(f) { - a.$forwardLineIterator(b).forEach(function(l, n, d) { - if(n) { - l = l.substring(n) - }var k = []; - l.replace(j, function(o) { - k.push({str:o, offset:n + arguments[arguments.length - 2]}); - return o - }); - for(l = 0;l < k.length;l++) { - var p = k[l]; - p = a.$rangeFromMatch(d, p.offset, p.str.length); - if(f(p)) { - return true - } - } - }) - }} - }; - this.$backwardMatchIterator = function(b) { - var j = this.$assembleRegExp(), a = this; - return{forEach:function(f) { - a.$backwardLineIterator(b).forEach(function(l, n, d) { - if(n) { - l = l.substring(n) - }var k = []; - l.replace(j, function(o, m) { - k.push({str:o, offset:n + m}); - return o - }); - for(l = k.length - 1;l >= 0;l--) { - var p = k[l]; - p = a.$rangeFromMatch(d, p.offset, p.str.length); - if(f(p)) { - return true - } - } - }) - }} - }; - this.$rangeFromMatch = function(b, j, a) { - return new c(b, j, b, j + a) - }; - this.$assembleRegExp = function() { - var b = this.$options.regExp ? this.$options.needle : g.escapeRegExp(this.$options.needle); - if(this.$options.wholeWord) { - b = "\\b" + b + "\\b" - }var j = "g"; - this.$options.caseSensitive || (j += "i"); - return new RegExp(b, j) - }; - this.$forwardLineIterator = function(b) { - function j(o) { - var m = b.getLine(o); - if(a && o == f.end.row) { - m = m.substring(0, f.end.column) - }return m - } - var a = this.$options.scope == i.SELECTION, f = b.getSelection().getRange(), l = b.getSelection().getCursor(), n = a ? f.start.row : 0, d = a ? f.start.column : 0, k = a ? f.end.row : b.getLength() - 1, p = this.$options.wrap; - return{forEach:function(o) { - for(var m = l.row, r = j(m), q = l.column, s = false;!o(r, q, m);) { - if(s) { - return - }m++; - q = 0; - if(m > k) { - if(p) { - m = n; - q = d - }else { - return - } - }if(m == l.row) { - s = true - }r = j(m) - } - }} - }; - this.$backwardLineIterator = function(b) { - var j = this.$options.scope == i.SELECTION, a = b.getSelection().getRange(), f = j ? a.end : a.start, l = j ? a.start.row : 0, n = j ? a.start.column : 0, d = j ? a.end.row : b.getLength() - 1, k = this.$options.wrap; - return{forEach:function(p) { - for(var o = f.row, m = b.getLine(o).substring(0, f.column), r = 0, q = false;!p(m, r, o);) { - if(q) { - return - }o--; - r = 0; - if(o < l) { - if(k) { - o = d - }else { - return - } - }if(o == f.row) { - q = true - }m = b.getLine(o); - if(j) { - if(o == l) { - r = n - }else { - if(o == d) { - m = m.substring(0, a.end.column) - } - } - } - } - }} - } - }).call(i.prototype); - return i -}); -define("ace/background_tokenizer", ["require", "exports", "module", "./lib/oop", "./event_emitter"], function(h) { - var g = h("./lib/oop"), e = h("./event_emitter"); - h = function(c, i) { - this.running = false; - this.textLines = []; - this.lines = []; - this.currentLine = 0; - this.tokenizer = c; - var b = this; - this.$worker = function() { - if(b.running) { - for(var j = new Date, a = b.currentLine, f = b.textLines, l = 0, n = i.getLastVisibleRow();b.currentLine < f.length;) { - b.lines[b.currentLine] = b.$tokenizeRows(b.currentLine, b.currentLine)[0]; - b.currentLine++; - l += 1; - if(l % 5 == 0 && new Date - j > 20) { - b.fireUpdateEvent(a, b.currentLine - 1); - b.running = setTimeout(b.$worker, b.currentLine < n ? 20 : 100); - return - } - }b.running = false; - b.fireUpdateEvent(a, f.length - 1) - } - } - }; - (function() { - g.implement(this, e); - this.setTokenizer = function(c) { - this.tokenizer = c; - this.lines = []; - this.start(0) - }; - this.setLines = function(c) { - this.textLines = c; - this.lines = []; - this.stop() - }; - this.fireUpdateEvent = function(c, i) { - this.$dispatchEvent("update", {data:{first:c, last:i}}) - }; - this.start = function(c) { - this.currentLine = Math.min(c || 0, this.currentLine, this.textLines.length); - this.lines.splice(this.currentLine, this.lines.length); - this.stop(); - this.running = setTimeout(this.$worker, 700) - }; - this.stop = function() { - this.running && clearTimeout(this.running); - this.running = false - }; - this.getTokens = function(c, i, b) { - b(this.$tokenizeRows(c, i)) - }; - this.getState = function(c, i) { - i(this.$tokenizeRows(c, c)[0].state) - }; - this.$tokenizeRows = function(c, i) { - var b = [], j = "start", a = false; - if(c > 0 && this.lines[c - 1]) { - j = this.lines[c - 1].state; - a = true - }for(c = c;c <= i;c++) { - if(this.lines[c]) { - f = this.lines[c]; - j = f.state; - b.push(f) - }else { - var f = this.tokenizer.getLineTokens(this.textLines[c] || "", j); - j = f.state; - b.push(f); - if(a) { - this.lines[c] = f - } - } - }return b - } - }).call(h.prototype); - return h -}); -define("ace/editor", ["require", "exports", "module", "./lib/oop", "./lib/event", "./lib/lang", "./textinput", "./keybinding", "./document", "./search", "./background_tokenizer", "./range", "./event_emitter"], function(h) { - var g = h("./lib/oop"), e = h("./lib/event"), c = h("./lib/lang"), i = h("./textinput"), b = h("./keybinding"), j = h("./document"), a = h("./search"), f = h("./background_tokenizer"), l = h("./range"), n = h("./event_emitter"); - h = function(d, k) { - var p = d.getContainerElement(); - this.container = p; - this.renderer = d; - this.textInput = new i(p, this); - this.keyBinding = new b(p, this); - var o = this; - e.addListener(p, "mousedown", function(m) { - setTimeout(function() { - o.focus() - }); - return e.preventDefault(m) - }); - e.addListener(p, "selectstart", function(m) { - return e.preventDefault(m) - }); - d = d.getMouseEventTarget(); - e.addListener(d, "mousedown", c.bind(this.onMouseDown, this)); - e.addMultiMouseDownListener(d, 0, 2, 500, c.bind(this.onMouseDoubleClick, this)); - e.addMultiMouseDownListener(d, 0, 3, 600, c.bind(this.onMouseTripleClick, this)); - e.addMouseWheelListener(d, c.bind(this.onMouseWheel, this)); - this.$highlightLineMarker = this.$selectionMarker = null; - this.$blockScrolling = false; - this.$search = (new a).set({wrap:true}); - this.setDocument(k || new j("")); - this.focus() - }; - (function() { - g.implement(this, n); - this.$forwardEvents = {gutterclick:1, gutterdblclick:1}; - this.$originalAddEventListener = this.addEventListener; - this.$originalRemoveEventListener = this.removeEventListener; - this.addEventListener = function(d, k) { - return this.$forwardEvents[d] ? this.renderer.addEventListener(d, k) : this.$originalAddEventListener(d, k) - }; - this.removeEventListener = function(d, k) { - return this.$forwardEvents[d] ? this.renderer.removeEventListener(d, k) : this.$originalRemoveEventListener(d, k) - }; - this.setDocument = function(d) { - if(this.doc != d) { - if(this.doc) { - this.doc.removeEventListener("change", this.$onDocumentChange); - this.doc.removeEventListener("changeMode", this.$onDocumentModeChange); - this.doc.removeEventListener("changeTabSize", this.$onDocumentChangeTabSize); - this.doc.removeEventListener("changeBreakpoint", this.$onDocumentChangeBreakpoint); - var k = this.doc.getSelection(); - k.removeEventListener("changeCursor", this.$onCursorChange); - k.removeEventListener("changeSelection", this.$onSelectionChange); - this.doc.setScrollTopRow(this.renderer.getScrollTopRow()) - }this.doc = d; - this.$onDocumentChange = c.bind(this.onDocumentChange, this); - d.addEventListener("change", this.$onDocumentChange); - this.renderer.setDocument(d); - this.$onDocumentModeChange = c.bind(this.onDocumentModeChange, this); - d.addEventListener("changeMode", this.$onDocumentModeChange); - this.$onDocumentChangeTabSize = c.bind(this.renderer.updateText, this.renderer); - d.addEventListener("changeTabSize", this.$onDocumentChangeTabSize); - this.$onDocumentChangeBreakpoint = c.bind(this.onDocumentChangeBreakpoint, this); - this.doc.addEventListener("changeBreakpoint", this.$onDocumentChangeBreakpoint); - this.selection = d.getSelection(); - this.$desiredColumn = 0; - this.$onCursorChange = c.bind(this.onCursorChange, this); - this.selection.addEventListener("changeCursor", this.$onCursorChange); - this.$onSelectionChange = c.bind(this.onSelectionChange, this); - this.selection.addEventListener("changeSelection", this.$onSelectionChange); - this.onDocumentModeChange(); - this.bgTokenizer.setLines(this.doc.lines); - this.bgTokenizer.start(0); - this.onCursorChange(); - this.onSelectionChange(); - this.onDocumentChangeBreakpoint(); - this.renderer.scrollToRow(d.getScrollTopRow()); - this.renderer.updateFull() - } - }; - this.getDocument = function() { - return this.doc - }; - this.getSelection = function() { - return this.selection - }; - this.resize = function() { - this.renderer.onResize() - }; - this.setTheme = function(d) { - this.renderer.setTheme(d) - }; - this.$highlightBrackets = function() { - if(this.$bracketHighlight) { - this.renderer.removeMarker(this.$bracketHighlight); - this.$bracketHighlight = null - }if(!this.$highlightPending) { - var d = this; - this.$highlightPending = true; - setTimeout(function() { - d.$highlightPending = false; - var k = d.doc.findMatchingBracket(d.getCursorPosition()); - if(k) { - k = new l(k.row, k.column, k.row, k.column + 1); - d.$bracketHighlight = d.renderer.addMarker(k, "ace_bracket") - } - }, 10) - } - }; - this.focus = function() { - this.textInput.focus() - }; - this.blur = function() { - this.textInput.blur() - }; - this.onFocus = function() { - this.renderer.showCursor(); - this.renderer.visualizeFocus() - }; - this.onBlur = function() { - this.renderer.hideCursor(); - this.renderer.visualizeBlur() - }; - this.onDocumentChange = function(d) { - d = d.data; - this.bgTokenizer.start(d.firstRow); - this.renderer.updateLines(d.firstRow, d.lastRow); - this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite) - }; - this.onTokenizerUpdate = function(d) { - d = d.data; - this.renderer.updateLines(d.first, d.last) - }; - this.onCursorChange = function() { - this.$highlightBrackets(); - this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite); - this.$blockScrolling || this.renderer.scrollCursorIntoView(); - this.$updateHighlightActiveLine() - }; - this.$updateHighlightActiveLine = function() { - this.$highlightLineMarker && this.renderer.removeMarker(this.$highlightLineMarker); - this.$highlightLineMarker = null; - if(this.getHighlightActiveLine() && (this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { - var d = this.getCursorPosition(); - this.$highlightLineMarker = this.renderer.addMarker(new l(d.row, 0, d.row + 1, 0), "ace_active_line", "line") - } - }; - this.onSelectionChange = function() { - this.$selectionMarker && this.renderer.removeMarker(this.$selectionMarker); - this.$selectionMarker = null; - if(!this.selection.isEmpty()) { - var d = this.selection.getRange(), k = this.getSelectionStyle(); - this.$selectionMarker = this.renderer.addMarker(d, "ace_selection", k) - }this.onCursorChange() - }; - this.onDocumentChangeBreakpoint = function() { - this.renderer.setBreakpoints(this.doc.getBreakpoints()) - }; - this.onDocumentModeChange = function() { - var d = this.doc.getMode(); - if(this.mode != d) { - this.mode = d; - d = d.getTokenizer(); - if(this.bgTokenizer) { - this.bgTokenizer.setTokenizer(d) - }else { - var k = c.bind(this.onTokenizerUpdate, this); - this.bgTokenizer = new f(d, this); - this.bgTokenizer.addEventListener("update", k) - }this.renderer.setTokenizer(this.bgTokenizer) - } - }; - this.onMouseDown = function(d) { - var k = e.getDocumentX(d), p = e.getDocumentY(d); - k = this.renderer.screenToTextCoordinates(k, p); - k.row = Math.max(0, Math.min(k.row, this.doc.getLength() - 1)); - if(e.getButton(d) != 0) { - this.selection.isEmpty() && this.moveCursorToPosition(k) - }else { - if(d.shiftKey) { - this.selection.selectToPosition(k) - }else { - this.moveCursorToPosition(k); - this.$clickSelection || this.selection.clearSelection(k.row, k.column) - }this.renderer.scrollCursorIntoView(); - var o = this, m, r; - e.capture(this.container, function(s) { - m = e.getDocumentX(s); - r = e.getDocumentY(s) - }, function() { - clearInterval(q); - o.$clickSelection = null - }); - var q = setInterval(function() { - if(!(m === undefined || r === undefined)) { - var s = o.renderer.screenToTextCoordinates(m, r); - s.row = Math.max(0, Math.min(s.row, o.doc.getLength() - 1)); - if(o.$clickSelection) { - if(o.$clickSelection.contains(s.row, s.column)) { - o.selection.setSelectionRange(o.$clickSelection) - }else { - var t = o.$clickSelection.compare(s.row, s.column) == -1 ? o.$clickSelection.end : o.$clickSelection.start; - o.selection.setSelectionAnchor(t.row, t.column); - o.selection.selectToPosition(s) - } - }else { - o.selection.selectToPosition(s) - }o.renderer.scrollCursorIntoView() - } - }, 20); - return e.preventDefault(d) - } - }; - this.onMouseDoubleClick = function() { - this.selection.selectWord(); - this.$clickSelection = this.getSelectionRange(); - this.$updateDesiredColumn() - }; - this.onMouseTripleClick = function() { - this.selection.selectLine(); - this.$clickSelection = this.getSelectionRange(); - this.$updateDesiredColumn() - }; - this.onMouseWheel = function(d) { - var k = this.$scrollSpeed * 2; - this.renderer.scrollBy(d.wheelX * k, d.wheelY * k); - return e.preventDefault(d) - }; - this.getCopyText = function() { - return this.selection.isEmpty() ? "" : this.doc.getTextRange(this.getSelectionRange()) - }; - this.onCut = function() { - if(!this.$readOnly) { - if(!this.selection.isEmpty()) { - this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())); - this.clearSelection() - } - } - }; - this.onTextInput = function(d) { - if(!this.$readOnly) { - var k = this.getCursorPosition(); - d = d.replace("\t", this.doc.getTabString()); - if(this.selection.isEmpty()) { - if(this.$overwrite) { - var p = new l.fromPoints(k, k); - p.end.column += d.length; - this.doc.remove(p) - } - }else { - k = this.doc.remove(this.getSelectionRange()); - this.clearSelection() - }this.clearSelection(); - var o = this; - this.bgTokenizer.getState(k.row, function(m) { - var r = o.mode.checkOutdent(m, o.doc.getLine(k.row), d), q = o.doc.getLine(k.row), s = o.mode.getNextLineIndent(m, q, o.doc.getTabString()), t = o.doc.insert(k, d); - o.bgTokenizer.getState(k.row, function(u) { - if(k.row !== t.row) { - u = o.doc.getTabSize(); - for(var y = Number.MAX_VALUE, w = k.row + 1;w <= t.row;++w) { - var x = 0; - q = o.doc.getLine(w); - for(var v = 0;v < q.length;++v) { - if(q.charAt(v) == "\t") { - x += u - }else { - if(q.charAt(v) == " ") { - x += 1 - }else { - break - } - } - }if(/[^\s]/.test(q)) { - y = Math.min(x, y) - } - }for(w = k.row + 1;w <= t.row;++w) { - x = y; - q = o.doc.getLine(w); - for(v = 0;v < q.length && x > 0;++v) { - if(q.charAt(v) == "\t") { - x -= u - }else { - if(q.charAt(v) == " ") { - x -= 1 - } - } - }o.doc.replace(new l(w, 0, w, q.length), q.substr(v)) - }t.column += o.doc.indentRows(new l(k.row + 1, 0, t.row, t.column), s) - }else { - if(r) { - t.column += o.mode.autoOutdent(u, o.doc, k.row) - } - }o.moveCursorToPosition(t); - o.renderer.scrollCursorIntoView() - }) - }) - } - }; - this.$overwrite = false; - this.setOverwrite = function(d) { - if(this.$overwrite != d) { - this.$overwrite = d; - this.$blockScrolling = true; - this.onCursorChange(); - this.$blockScrolling = false; - this.$dispatchEvent("changeOverwrite", {data:d}) - } - }; - this.getOverwrite = function() { - return this.$overwrite - }; - this.toggleOverwrite = function() { - this.setOverwrite(!this.$overwrite) - }; - this.$scrollSpeed = 1; - this.setScrollSpeed = function(d) { - this.$scrollSpeed = d - }; - this.getScrollSpeed = function() { - return this.$scrollSpeed - }; - this.$selectionStyle = "line"; - this.setSelectionStyle = function(d) { - if(this.$selectionStyle != d) { - this.$selectionStyle = d; - this.onSelectionChange(); - this.$dispatchEvent("changeSelectionStyle", {data:d}) - } - }; - this.getSelectionStyle = function() { - return this.$selectionStyle - }; - this.$highlightActiveLine = true; - this.setHighlightActiveLine = function(d) { - if(this.$highlightActiveLine != d) { - this.$highlightActiveLine = d; - this.$updateHighlightActiveLine() - } - }; - this.getHighlightActiveLine = function() { - return this.$highlightActiveLine - }; - this.setShowInvisibles = function(d) { - this.getShowInvisibles() != d && this.renderer.setShowInvisibles(d) - }; - this.getShowInvisibles = function() { - return this.renderer.getShowInvisibles() - }; - this.setShowPrintMargin = function(d) { - this.renderer.setShowPrintMargin(d) - }; - this.getShowPrintMargin = function() { - return this.renderer.getShowPrintMargin() - }; - this.setPrintMarginColumn = function(d) { - this.renderer.setPrintMarginColumn(d) - }; - this.getPrintMarginColumn = function() { - return this.renderer.getPrintMarginColumn() - }; - this.$readOnly = false; - this.setReadOnly = function(d) { - this.$readOnly = d - }; - this.getReadOnly = function() { - return this.$readOnly - }; - this.removeRight = function() { - if(!this.$readOnly) { - this.selection.isEmpty() && this.selection.selectRight(); - this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())); - this.clearSelection() - } - }; - this.removeLeft = function() { - if(!this.$readOnly) { - this.selection.isEmpty() && this.selection.selectLeft(); - this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())); - this.clearSelection() - } - }; - this.indent = function() { - if(!this.$readOnly) { - var d = this.doc, k = this.getSelectionRange(); - if(k.start.row < k.end.row || k.start.column < k.end.column) { - d = d.indentRows(this.getSelectionRange(), "\t"); - this.selection.shiftSelection(d) - }else { - if(this.doc.getUseSoftTabs()) { - k = d.getTabSize(); - var p = this.getCursorPosition(); - d = d.documentToScreenColumn(p.row, p.column); - d = k - d % k; - d = c.stringRepeat(" ", d) - }else { - d = "\t" - }return this.onTextInput(d) - } - } - }; - this.blockOutdent = function() { - if(!this.$readOnly) { - var d = this.doc.getSelection(), k = this.doc.outdentRows(d.getRange()); - d.setSelectionRange(k, d.isBackwards()); - this.$updateDesiredColumn() - } - }; - this.toggleCommentLines = function() { - if(!this.$readOnly) { - var d = this.$getSelectedRows(), k = new l(d.first, 0, d.last, 0), p = this; - this.bgTokenizer.getState(this.getCursorPosition().row, function(o) { - o = p.mode.toggleCommentLines(o, p.doc, k); - p.selection.shiftSelection(o) - }) - } - }; - this.removeLines = function() { - if(!this.$readOnly) { - var d = this.$getSelectedRows(); - this.selection.setSelectionAnchor(d.last + 1, 0); - this.selection.selectTo(d.first, 0); - this.doc.remove(this.getSelectionRange()); - this.clearSelection() - } - }; - this.moveLinesDown = function() { - this.$readOnly || this.$moveLines(function(d, k) { - return this.doc.moveLinesDown(d, k) - }) - }; - this.moveLinesUp = function() { - this.$readOnly || this.$moveLines(function(d, k) { - return this.doc.moveLinesUp(d, k) - }) - }; - this.copyLinesUp = function() { - this.$readOnly || this.$moveLines(function(d, k) { - this.doc.duplicateLines(d, k); - return 0 - }) - }; - this.copyLinesDown = function() { - this.$readOnly || this.$moveLines(function(d, k) { - return this.doc.duplicateLines(d, k) - }) - }; - this.$moveLines = function(d) { - var k = this.$getSelectedRows(), p = d.call(this, k.first, k.last), o = this.selection; - o.setSelectionAnchor(k.last + p + 1, 0); - o.$moveSelection(function() { - o.moveCursorTo(k.first + p, 0) - }) - }; - this.$getSelectedRows = function() { - var d = this.getSelectionRange(), k = d.start.row, p = d.end.row; - if(d.end.column == 0 && d.start.row !== d.end.row) { - p -= 1 - }return{first:k, last:p} - }; - this.onCompositionStart = function() { - this.renderer.showComposition(this.getCursorPosition()) - }; - this.onCompositionUpdate = function(d) { - this.renderer.setCompositionText(d) - }; - this.onCompositionEnd = function() { - this.renderer.hideComposition() - }; - this.getFirstVisibleRow = function() { - return this.renderer.getFirstVisibleRow() - }; - this.getLastVisibleRow = function() { - return this.renderer.getLastVisibleRow() - }; - this.isRowVisible = function(d) { - return d >= this.getFirstVisibleRow() && d <= this.getLastVisibleRow() - }; - this.getVisibleRowCount = function() { - return this.getLastVisibleRow() - this.getFirstVisibleRow() + 1 - }; - this.getPageDownRow = function() { - return this.renderer.getLastVisibleRow() - 1 - }; - this.getPageUpRow = function() { - var d = this.renderer.getFirstVisibleRow(), k = this.renderer.getLastVisibleRow(); - return d - (k - d) + 1 - }; - this.selectPageDown = function() { - var d = this.getPageDownRow() + Math.floor(this.getVisibleRowCount() / 2); - this.scrollPageDown(); - var k = this.getSelection(); - k.$moveSelection(function() { - k.moveCursorTo(d, k.getSelectionLead().column) - }) - }; - this.selectPageUp = function() { - var d = this.getLastVisibleRow() - this.getFirstVisibleRow(), k = this.getPageUpRow() + Math.round(d / 2); - this.scrollPageUp(); - var p = this.getSelection(); - p.$moveSelection(function() { - p.moveCursorTo(k, p.getSelectionLead().column) - }) - }; - this.gotoPageDown = function() { - var d = this.getPageDownRow(), k = Math.min(this.getCursorPosition().column, this.doc.getLine(d).length); - this.scrollToRow(d); - this.getSelection().moveCursorTo(d, k) - }; - this.gotoPageUp = function() { - var d = this.getPageUpRow(), k = Math.min(this.getCursorPosition().column, this.doc.getLine(d).length); - this.scrollToRow(d); - this.getSelection().moveCursorTo(d, k) - }; - this.scrollPageDown = function() { - this.scrollToRow(this.getPageDownRow()) - }; - this.scrollPageUp = function() { - this.renderer.scrollToRow(this.getPageUpRow()) - }; - this.scrollToRow = function(d) { - this.renderer.scrollToRow(d) - }; - this.getCursorPosition = function() { - return this.selection.getCursor() - }; - this.getSelectionRange = function() { - return this.selection.getRange() - }; - this.clearSelection = function() { - this.selection.clearSelection(); - this.$updateDesiredColumn() - }; - this.moveCursorTo = function(d, k) { - this.selection.moveCursorTo(d, k); - this.$updateDesiredColumn() - }; - this.moveCursorToPosition = function(d) { - this.selection.moveCursorToPosition(d); - this.$updateDesiredColumn() - }; - this.gotoLine = function(d, k) { - this.selection.clearSelection(); - this.$blockScrolling = true; - this.moveCursorTo(d - 1, k || 0); - this.$blockScrolling = false; - this.isRowVisible(this.getCursorPosition().row) || this.scrollToRow(d - 1 - Math.floor(this.getVisibleRowCount() / 2)) - }; - this.navigateTo = function(d, k) { - this.clearSelection(); - this.moveCursorTo(d, k); - this.$updateDesiredColumn(k) - }; - this.navigateUp = function() { - this.selection.clearSelection(); - this.selection.moveCursorBy(-1, 0); - if(this.$desiredColumn) { - var d = this.getCursorPosition(), k = this.doc.screenToDocumentColumn(d.row, this.$desiredColumn); - this.selection.moveCursorTo(d.row, k) - } - }; - this.navigateDown = function() { - this.selection.clearSelection(); - this.selection.moveCursorBy(1, 0); - if(this.$desiredColumn) { - var d = this.getCursorPosition(), k = this.doc.screenToDocumentColumn(d.row, this.$desiredColumn); - this.selection.moveCursorTo(d.row, k) - } - }; - this.$updateDesiredColumn = function() { - var d = this.getCursorPosition(); - this.$desiredColumn = this.doc.documentToScreenColumn(d.row, d.column) - }; - this.navigateLeft = function() { - this.selection.isEmpty() ? this.selection.moveCursorLeft() : this.moveCursorToPosition(this.getSelectionRange().start); - this.clearSelection() - }; - this.navigateRight = function() { - this.selection.isEmpty() ? this.selection.moveCursorRight() : this.moveCursorToPosition(this.getSelectionRange().end); - this.clearSelection() - }; - this.navigateLineStart = function() { - this.selection.moveCursorLineStart(); - this.clearSelection() - }; - this.navigateLineEnd = function() { - this.selection.moveCursorLineEnd(); - this.clearSelection() - }; - this.navigateFileEnd = function() { - this.selection.moveCursorFileEnd(); - this.clearSelection() - }; - this.navigateFileStart = function() { - this.selection.moveCursorFileStart(); - this.clearSelection() - }; - this.navigateWordRight = function() { - this.selection.moveCursorWordRight(); - this.clearSelection() - }; - this.navigateWordLeft = function() { - this.selection.moveCursorWordLeft(); - this.clearSelection() - }; - this.replace = function(d, k) { - k && this.$search.set(k); - k = this.$search.find(this.doc); - this.$tryReplace(k, d); - k !== null && this.selection.setSelectionRange(k); - this.$updateDesiredColumn() - }; - this.replaceAll = function(d, k) { - k && this.$search.set(k); - k = this.$search.findAll(this.doc); - if(k.length) { - this.clearSelection(); - this.selection.moveCursorTo(0, 0); - for(var p = k.length - 1;p >= 0;--p) { - this.$tryReplace(k[p], d) - }k[0] !== null && this.selection.setSelectionRange(k[0]); - this.$updateDesiredColumn() - } - }; - this.$tryReplace = function(d, k) { - k = this.$search.replace(this.doc.getTextRange(d), k); - if(k !== null) { - d.end = this.doc.replace(d, k); - return d - }else { - return null - } - }; - this.getLastSearchOptions = function() { - return this.$search.getOptions() - }; - this.find = function(d, k) { - this.clearSelection(); - k = k || {}; - k.needle = d; - this.$search.set(k); - this.$find() - }; - this.findNext = function(d) { - d = d || {}; - if(typeof d.backwards == "undefined") { - d.backwards = false - }this.$search.set(d); - this.$find() - }; - this.findPrevious = function(d) { - d = d || {}; - if(typeof d.backwards == "undefined") { - d.backwards = true - }this.$search.set(d); - this.$find() - }; - this.$find = function(d) { - this.selection.isEmpty() || this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}); - typeof d != "undefined" && this.$search.set({backwards:d}); - if(d = this.$search.find(this.doc)) { - this.gotoLine(d.end.row + 1, d.end.column); - this.$updateDesiredColumn(); - this.selection.setSelectionRange(d) - } - }; - this.undo = function() { - this.doc.getUndoManager().undo() - }; - this.redo = function() { - this.doc.getUndoManager().redo() - } - }).call(h.prototype); - return h -}); -define("ace/undomanager", ["require", "exports", "module"], function() { - var h = function() { - this.$undoStack = []; - this.$redoStack = [] - }; - (function() { - this.execute = function(g) { - var e = g.args[0]; - this.$doc = g.args[1]; - this.$undoStack.push(e) - }; - this.undo = function() { - var g = this.$undoStack.pop(); - if(g) { - this.$doc.undoChanges(g); - this.$redoStack.push(g) - } - }; - this.redo = function() { - var g = this.$redoStack.pop(); - if(g) { - this.$doc.redoChanges(g); - this.$undoStack.push(g) - } - } - }).call(h.prototype); - return h -}); -define("ace/layer/gutter", ["require", "exports", "module"], function() { - var h = function(g) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - g.appendChild(this.element); - this.$breakpoints = []; - this.$decorations = [] - }; - (function() { - this.addGutterDecoration = function(g, e) { - this.$decorations[g] || (this.$decorations[g] = ""); - this.$decorations[g] += " ace_" + e - }; - this.removeGutterDecoration = function(g, e) { - this.$decorations[g] = this.$decorations[g].replace(" ace_" + e, "") - }; - this.setBreakpoints = function(g) { - this.$breakpoints = g.concat() - }; - this.update = function(g) { - this.$config = g; - for(var e = [], c = g.firstRow;c <= g.lastRow;c++) { - e.push("
", c + 1, "
"); - e.push("") - }this.element.innerHTML = e.join(""); - this.element.style.height = g.minHeight + "px" - } - }).call(h.prototype); - return h -}); -define("ace/layer/marker", ["require", "exports", "module", "../range"], function(h) { - var g = h("../range"); - h = function(e) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_marker-layer"; - e.appendChild(this.element); - this.markers = {}; - this.$markerId = 1 - }; - (function() { - this.setDocument = function(e) { - this.doc = e - }; - this.addMarker = function(e, c, i) { - var b = this.$markerId++; - this.markers[b] = {range:e, type:i || "line", clazz:c}; - return b - }; - this.removeMarker = function(e) { - this.markers[e] && delete this.markers[e] - }; - this.update = function(e) { - if(e = e || this.config) { - this.config = e; - var c = []; - for(var i in this.markers) { - var b = this.markers[i], j = b.range.clipRows(e.firstRow, e.lastRow); - if(!j.isEmpty()) { - if(j.isMultiLine()) { - b.type == "text" ? this.drawTextMarker(c, j, b.clazz, e) : this.drawMultiLineMarker(c, j, b.clazz, e) - }else { - this.drawSingleLineMarker(c, j, b.clazz, e) - } - } - }this.element.innerHTML = c.join("") - } - }; - this.drawTextMarker = function(e, c, i, b) { - var j = c.start.row, a = new g(j, c.start.column, j, this.doc.getLine(j).length); - this.drawSingleLineMarker(e, a, i, b); - j = c.end.row; - a = new g(j, 0, j, c.end.column); - this.drawSingleLineMarker(e, a, i, b); - for(j = c.start.row + 1;j < c.end.row;j++) { - a.start.row = j; - a.end.row = j; - a.end.column = this.doc.getLine(j).length; - this.drawSingleLineMarker(e, a, i, b) - } - }; - this.drawMultiLineMarker = function(e, c, i, b) { - c = c.toScreenRange(this.doc); - var j = b.lineHeight, a = Math.round(b.width - c.start.column * b.characterWidth), f = (c.start.row - b.firstRow) * b.lineHeight, l = Math.round(c.start.column * b.characterWidth); - e.push("
"); - f = (c.end.row - b.firstRow) * b.lineHeight; - a = Math.round(c.end.column * b.characterWidth); - e.push("
"); - j = (c.end.row - c.start.row - 1) * b.lineHeight; - if(!(j < 0)) { - f = (c.start.row + 1 - b.firstRow) * b.lineHeight; - e.push("
") - } - }; - this.drawSingleLineMarker = function(e, c, i, b) { - c = c.toScreenRange(this.doc); - var j = b.lineHeight, a = Math.round((c.end.column - c.start.column) * b.characterWidth), f = (c.start.row - b.firstRow) * b.lineHeight; - c = Math.round(c.start.column * b.characterWidth); - e.push("
") - } - }).call(h.prototype); - return h -}); -define("ace/lib/dom", ["require", "exports", "module", "./lang"], function(h) { - var g = h("./lang"), e = {}; - e.setText = function(c, i) { - if(c.innerText !== undefined) { - c.innerText = i - }if(c.textContent !== undefined) { - c.textContent = i - } - }; - e.hasCssClass = function(c, i) { - c = c.className.split(/\s+/g); - return g.arrayIndexOf(c, i) !== -1 - }; - e.addCssClass = function(c, i) { - e.hasCssClass(c, i) || (c.className += " " + i) - }; - e.removeCssClass = function(c, i) { - for(var b = c.className.split(/\s+/g);;) { - var j = g.arrayIndexOf(b, i); - if(j == -1) { - break - }b.splice(j, 1) - }c.className = b.join(" ") - }; - e.importCssString = function(c, i) { - i = i || document; - if(i.createStyleSheet) { - i.createStyleSheet().cssText = c - }else { - var b = i.createElement("style"); - b.appendChild(i.createTextNode(c)); - i.getElementsByTagName("head")[0].appendChild(b) - } - }; - e.getInnerWidth = function(c) { - return parseInt(e.computedStyle(c, "paddingLeft")) + parseInt(e.computedStyle(c, "paddingRight")) + c.clientWidth - }; - e.getInnerHeight = function(c) { - return parseInt(e.computedStyle(c, "paddingTop")) + parseInt(e.computedStyle(c, "paddingBottom")) + c.clientHeight - }; - e.computedStyle = function(c, i) { - return window.getComputedStyle ? (window.getComputedStyle(c, "") || {})[i] || "" : c.currentStyle[i] - }; - e.scrollbarWidth = function() { - var c = document.createElement("p"); - c.style.width = "100%"; - c.style.height = "200px"; - var i = document.createElement("div"), b = i.style; - b.position = "absolute"; - b.left = "-10000px"; - b.overflow = "hidden"; - b.width = "200px"; - b.height = "150px"; - i.appendChild(c); - document.body.appendChild(i); - var j = c.offsetWidth; - b.overflow = "scroll"; - c = c.offsetWidth; - if(j == c) { - c = i.clientWidth - }document.body.removeChild(i); - return j - c - }; - return e -}); -define("ace/layer/text", ["require", "exports", "module", "../lib/oop", "../lib/dom", "../event_emitter"], function(h) { - var g = h("../lib/oop"), e = h("../lib/dom"), c = h("../event_emitter"); - h = function(i) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - i.appendChild(this.element); - this.$characterSize = this.$measureSizes(); - this.$pollSizeChanges() - }; - (function() { - g.implement(this, c); - this.EOF_CHAR = "¶"; - this.EOL_CHAR = "¬"; - this.TAB_CHAR = "→"; - this.SPACE_CHAR = "·"; - this.setTokenizer = function(i) { - this.tokenizer = i - }; - this.getLineHeight = function() { - return this.$characterSize.height || 1 - }; - this.getCharacterWidth = function() { - return this.$characterSize.width || 1 - }; - this.$pollSizeChanges = function() { - var i = this; - setInterval(function() { - var b = i.$measureSizes(); - if(i.$characterSize.width !== b.width || i.$characterSize.height !== b.height) { - i.$characterSize = b; - i.$dispatchEvent("changeCharaterSize", {data:b}) - } - }, 500) - }; - this.$fontStyles = {fontFamily:1, fontSize:1, fontWeight:1, fontStyle:1, lineHeight:1}; - this.$measureSizes = function() { - var i = document.createElement("div"), b = i.style; - b.width = b.height = "auto"; - b.left = b.top = "-1000px"; - b.visibility = "hidden"; - b.position = "absolute"; - b.overflow = "visible"; - for(var j in this.$fontStyles) { - var a = e.computedStyle(this.element, j); - b[j] = a - }i.innerHTML = (new Array(1E3)).join("Xy"); - document.body.insertBefore(i, document.body.firstChild); - b = {height:i.offsetHeight, width:i.offsetWidth / 2E3}; - document.body.removeChild(i); - return b - }; - this.setDocument = function(i) { - this.doc = i - }; - this.$showInvisibles = false; - this.setShowInvisibles = function(i) { - this.$showInvisibles = i - }; - this.$computeTabString = function() { - var i = this.doc.getTabSize(); - if(this.$showInvisibles) { - i = i / 2; - this.$tabString = "" + (new Array(Math.floor(i))).join(" ") + this.TAB_CHAR + (new Array(Math.ceil(i) + 1)).join(" ") + "" - }else { - this.$tabString = (new Array(i + 1)).join(" ") - } - }; - this.updateLines = function(i, b, j) { - this.$computeTabString(); - this.config = i; - var a = Math.max(b, i.firstRow), f = Math.min(j, i.lastRow), l = this.element.childNodes, n = this; - this.tokenizer.getTokens(a, f, function(d) { - for(var k = a;k <= f;k++) { - var p = l[k - i.firstRow]; - if(p) { - var o = []; - n.$renderLine(o, k, d[k - a].tokens); - p.innerHTML = o.join("") - } - } - }) - }; - this.scrollLines = function(i) { - function b(d) { - i.firstRow < f.firstRow ? a.$renderLinesFragment(i, i.firstRow, f.firstRow - 1, function(k) { - l.firstChild ? l.insertBefore(k, l.firstChild) : l.appendChild(k); - d() - }) : d() - } - function j() { - i.lastRow > f.lastRow && a.$renderLinesFragment(i, f.lastRow + 1, i.lastRow, function(d) { - l.appendChild(d) - }) - } - var a = this; - this.$computeTabString(); - var f = this.config; - this.config = i; - if(!f || f.lastRow < i.firstRow) { - return this.update(i) - }if(i.lastRow < f.firstRow) { - return this.update(i) - }var l = this.element; - if(f.firstRow < i.firstRow) { - for(var n = f.firstRow;n < i.firstRow;n++) { - l.removeChild(l.firstChild) - } - }if(f.lastRow > i.lastRow) { - for(n = i.lastRow + 1;n <= f.lastRow;n++) { - l.removeChild(l.lastChild) - } - }b(j) - }; - this.$renderLinesFragment = function(i, b, j, a) { - var f = document.createDocumentFragment(), l = this; - this.tokenizer.getTokens(b, j, function(n) { - for(var d = b;d <= j;d++) { - var k = document.createElement("div"); - k.className = "ace_line"; - var p = k.style; - p.height = l.$characterSize.height + "px"; - p.width = i.width + "px"; - p = []; - l.$renderLine(p, d, n[d - b].tokens); - k.innerHTML = p.join(""); - f.appendChild(k) - }a(f) - }) - }; - this.update = function(i) { - this.$computeTabString(); - this.config = i; - var b = [], j = this; - this.tokenizer.getTokens(i.firstRow, i.lastRow, function(a) { - for(var f = i.firstRow;f <= i.lastRow;f++) { - b.push("
"); - j.$renderLine(b, f, a[f - i.firstRow].tokens); - b.push("
") - }j.element.innerHTML = b.join("") - }) - }; - this.$textToken = {text:true, rparen:true, lparen:true}; - this.$renderLine = function(i, b, j) { - for(var a = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g, f = 0;f < j.length;f++) { - var l = j[f], n = l.value.replace(/&/g, "&").replace(/", n, "") - } - }if(this.$showInvisibles) { - b !== this.doc.getLength() - 1 ? i.push("" + this.EOL_CHAR + "") : i.push("" + this.EOF_CHAR + "") - } - } - }).call(h.prototype); - return h -}); -define("ace/layer/cursor", ["require", "exports", "module", "../lib/dom"], function(h) { - var g = h("../lib/dom"); - h = function(e) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - e.appendChild(this.element); - this.cursor = document.createElement("div"); - this.cursor.className = "ace_cursor"; - this.isVisible = false - }; - (function() { - this.setDocument = function(e) { - this.doc = e - }; - this.setCursor = function(e, c) { - this.position = {row:e.row, column:this.doc.documentToScreenColumn(e.row, e.column)}; - c ? g.addCssClass(this.cursor, "ace_overwrite") : g.removeCssClass(this.cursor, "ace_overwrite") - }; - this.hideCursor = function() { - this.isVisible = false; - this.cursor.parentNode && this.cursor.parentNode.removeChild(this.cursor); - clearInterval(this.blinkId) - }; - this.showCursor = function() { - this.isVisible = true; - this.element.appendChild(this.cursor); - this.cursor.style.visibility = "visible"; - this.restartTimer() - }; - this.restartTimer = function() { - clearInterval(this.blinkId); - if(this.isVisible) { - var e = this.cursor; - this.blinkId = setInterval(function() { - e.style.visibility = "hidden"; - setTimeout(function() { - e.style.visibility = "visible" - }, 400) - }, 1E3) - } - }; - this.getPixelPosition = function() { - if(!this.config || !this.position) { - return{left:0, top:0} - }var e = this.position.row * this.config.lineHeight; - return{left:Math.round(this.position.column * this.config.characterWidth), top:e} - }; - this.update = function(e) { - if(this.position) { - this.config = e; - var c = Math.round(this.position.column * e.characterWidth), i = this.position.row * e.lineHeight; - this.pixelPos = {left:c, top:i}; - this.cursor.style.left = c + "px"; - this.cursor.style.top = i - e.firstRow * e.lineHeight + "px"; - this.cursor.style.width = e.characterWidth + "px"; - this.cursor.style.height = e.lineHeight + "px"; - this.isVisible && this.element.appendChild(this.cursor); - this.restartTimer() - } - } - }).call(h.prototype); - return h -}); -define("ace/scrollbar", ["require", "exports", "module", "./lib/oop", "./lib/lang", "./lib/dom", "./lib/event", "./event_emitter"], function(h) { - var g = h("./lib/oop"), e = h("./lib/lang"), c = h("./lib/dom"), i = h("./lib/event"), b = h("./event_emitter"); - h = function(j) { - this.element = document.createElement("div"); - this.element.className = "ace_sb"; - this.inner = document.createElement("div"); - this.element.appendChild(this.inner); - j.appendChild(this.element); - this.width = c.scrollbarWidth(); - this.element.style.width = this.width; - i.addListener(this.element, "scroll", e.bind(this.onScroll, this)) - }; - (function() { - g.implement(this, b); - this.onScroll = function() { - this.$dispatchEvent("scroll", {data:this.element.scrollTop}) - }; - this.getWidth = function() { - return this.width - }; - this.setHeight = function(j) { - this.element.style.height = Math.max(0, j - this.width) + "px" - }; - this.setInnerHeight = function(j) { - this.inner.style.height = j + "px" - }; - this.setScrollTop = function(j) { - this.element.scrollTop = j - } - }).call(h.prototype); - return h -}); -define("ace/renderloop", ["require", "exports", "module", "./lib/event"], function(h) { - var g = h("./lib/event"); - h = function(e) { - this.onRender = e; - this.pending = false; - this.changes = 0 - }; - (function() { - this.schedule = function(e) { - this.changes |= e; - if(!this.pending) { - this.pending = true; - var c = this; - this.setTimeoutZero(function() { - c.pending = false; - var i = c.changes; - c.changes = 0; - c.onRender(i) - }) - } - }; - if(window.postMessage) { - this.messageName = "zero-timeout-message"; - this.setTimeoutZero = function(e) { - if(!this.attached) { - var c = this; - g.addListener(window, "message", function(i) { - if(i.source == window && c.callback && i.data == c.messageName) { - g.stopPropagation(i); - c.callback() - } - }); - this.attached = true - }this.callback = e; - window.postMessage(this.messageName, "*") - } - }else { - this.setTimeoutZero = function(e) { - setTimeout(e, 0) - } - } - }).call(h.prototype); - return h -}); -define("ace/virtual_renderer", ["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n position: absolute;\n overflow: hidden;\n\n font-family: "Menlo", "Monaco", "Courier New", monospace;\n font-size: 12px; \n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden; \n}\n\n.ace_gutter {\n position: absolute;\n overflow-x: hidden;\n overflow-y: hidden;\n height: 100%;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0px;\n}\n\n.ace_editor .ace_printMargin {\n position: absolute;\n height: 100%;\n}\n\n.ace_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden; \n white-space: nowrap;\n height: 100%;\n}\n\n.ace_text-layer {\n font-family: Monaco, "Courier New", monospace;\n color: black;\n}\n\n.ace_cursor-layer {\n cursor: text;\n}\n\n.ace_cursor {\n z-index: 3;\n position: absolute;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer {\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 4;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 1;\n}', -"./lib/oop", "./lib/oop", "./lib/event", "./layer/gutter", "./layer/marker", "./layer/text", "./layer/cursor", "./scrollbar", "./renderloop", "./event_emitter"], function(h, g, e, c) { - var i = h("./lib/oop"), b = h("./lib/lang"), j = h("./lib/dom"), a = h("./lib/event"), f = h("./layer/gutter"), l = h("./layer/marker"), n = h("./layer/text"), d = h("./layer/cursor"), k = h("./scrollbar"), p = h("./renderloop"), o = h("./event_emitter"); - j.importCssString(c); - g = function(m, r) { - this.container = m; - j.addCssClass(this.container, "ace_editor"); - this.setTheme(r); - this.$gutter = document.createElement("div"); - this.$gutter.className = "ace_gutter"; - this.container.appendChild(this.$gutter); - this.scroller = document.createElement("div"); - this.scroller.className = "ace_scroller"; - this.container.appendChild(this.scroller); - this.content = document.createElement("div"); - this.content.style.position = "absolute"; - this.scroller.appendChild(this.content); - this.$gutterLayer = new f(this.$gutter); - this.$markerLayer = new l(this.content); - var q = this.$textLayer = new n(this.content); - this.canvas = q.element; - this.characterWidth = q.getCharacterWidth(); - this.lineHeight = q.getLineHeight(); - this.$cursorLayer = new d(this.content); - this.layers = [this.$markerLayer, q, this.$cursorLayer]; - this.scrollBar = new k(m); - this.scrollBar.addEventListener("scroll", b.bind(this.onScroll, this)); - this.scrollTop = 0; - this.cursorPos = {row:0, column:0}; - var s = this; - this.$textLayer.addEventListener("changeCharaterSize", function() { - s.characterWidth = q.getCharacterWidth(); - s.lineHeight = q.getLineHeight(); - s.$loop.schedule(s.CHANGE_FULL) - }); - a.addListener(this.$gutter, "click", b.bind(this.$onGutterClick, this)); - a.addListener(this.$gutter, "dblclick", b.bind(this.$onGutterClick, this)); - this.$size = {width:0, height:0, scrollerHeight:0, scrollerWidth:0}; - this.$loop = new p(b.bind(this.$renderChanges, this)); - this.$loop.schedule(this.CHANGE_FULL); - this.$updatePrintMargin(); - this.setPadding(4) - }; - (function() { - this.showGutter = true; - this.CHANGE_CURSOR = 1; - this.CHANGE_MARKER = 2; - this.CHANGE_GUTTER = 4; - this.CHANGE_SCROLL = 8; - this.CHANGE_LINES = 16; - this.CHANGE_TEXT = 32; - this.CHANGE_SIZE = 64; - this.CHANGE_FULL = 128; - i.implement(this, o); - this.setDocument = function(m) { - this.lines = m.lines; - this.doc = m; - this.$cursorLayer.setDocument(m); - this.$markerLayer.setDocument(m); - this.$textLayer.setDocument(m); - this.$loop.schedule(this.CHANGE_FULL) - }; - this.updateLines = function(m, r) { - if(r === undefined) { - r = Infinity - }if(this.$changedLines) { - if(this.$changedLines.firstRow > m) { - this.$changedLines.firstRow = m - }if(this.$changedLines.lastRow < r) { - this.$changedLines.lastRow = r - } - }else { - this.$changedLines = {firstRow:m, lastRow:r} - }this.$loop.schedule(this.CHANGE_LINES) - }; - this.updateText = function() { - this.$loop.schedule(this.CHANGE_TEXT) - }; - this.updateFull = function() { - this.$loop.schedule(this.CHANGE_FULL) - }; - this.onResize = function() { - this.$loop.schedule(this.CHANGE_SIZE); - var m = j.getInnerHeight(this.container); - if(this.$size.height != m) { - this.$size.height = m; - this.scroller.style.height = m + "px"; - this.scrollBar.setHeight(m); - if(this.doc) { - this.scrollToY(this.getScrollTop()); - this.$loop.schedule(this.CHANGE_FULL) - } - }m = j.getInnerWidth(this.container); - if(this.$size.width != m) { - this.$size.width = m; - var r = this.showGutter ? this.$gutter.offsetWidth : 0; - this.scroller.style.left = r + "px"; - this.scroller.style.width = Math.max(0, m - r - this.scrollBar.getWidth()) + "px" - }this.$size.scrollerWidth = this.scroller.clientWidth; - this.$size.scrollerHeight = this.scroller.clientHeight - }; - this.setTokenizer = function(m) { - this.$tokenizer = m; - this.$textLayer.setTokenizer(m); - this.$loop.schedule(this.CHANGE_TEXT) - }; - this.$onGutterClick = function(m) { - var r = a.getDocumentX(m), q = a.getDocumentY(m); - this.$dispatchEvent("gutter" + m.type, {row:this.screenToTextCoordinates(r, q).row, htmlEvent:m}) - }; - this.$showInvisibles = true; - this.setShowInvisibles = function(m) { - this.$showInvisibles = m; - this.$textLayer.setShowInvisibles(m); - this.$loop.schedule(this.CHANGE_TEXT) - }; - this.getShowInvisibles = function() { - return this.$showInvisibles - }; - this.$showPrintMargin = true; - this.setShowPrintMargin = function(m) { - this.$showPrintMargin = m; - this.$updatePrintMargin() - }; - this.getShowPrintMargin = function() { - return this.$showPrintMargin - }; - this.$printMarginColumn = 80; - this.setPrintMarginColumn = function(m) { - this.$printMarginColumn = m; - this.$updatePrintMargin() - }; - this.getPrintMarginColumn = function() { - return this.$printMarginColumn - }; - this.setShowGutter = function(m) { - this.$gutter.style.display = m ? "block" : "none"; - this.showGutter = m; - this.onResize() - }; - this.$updatePrintMargin = function() { - if(this.$showPrintMargin || this.$printMarginEl) { - if(!this.$printMarginEl) { - this.$printMarginEl = document.createElement("div"); - this.$printMarginEl.className = "ace_printMargin"; - this.content.insertBefore(this.$printMarginEl, this.$textLayer.element) - }var m = this.$printMarginEl.style; - m.left = this.characterWidth * this.$printMarginColumn + "px"; - m.visibility = this.$showPrintMargin ? "visible" : "hidden" - } - }; - this.getContainerElement = function() { - return this.container - }; - this.getMouseEventTarget = function() { - return this.content - }; - this.getFirstVisibleRow = function() { - return(this.layerConfig || {}).firstRow || 0 - }; - this.getFirstFullyVisibleRow = function() { - if(!this.layerConfig) { - return 0 - }return this.layerConfig.firstRow + (this.layerConfig.offset == 0 ? 0 : 1) - }; - this.getLastFullyVisibleRow = function() { - if(!this.layerConfig) { - return 0 - }return this.layerConfig.firstRow - 1 + Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight) - }; - this.getLastVisibleRow = function() { - return(this.layerConfig || {}).lastRow || 0 - }; - this.$padding = null; - this.setPadding = function(m) { - this.$padding = m; - this.content.style.padding = "0 " + m + "px"; - this.$loop.schedule(this.CHANGE_FULL) - }; - this.onScroll = function(m) { - this.scrollToY(m.data) - }; - this.$updateScrollBar = function() { - this.scrollBar.setInnerHeight(this.doc.getLength() * this.lineHeight); - this.scrollBar.setScrollTop(this.scrollTop) - }; - this.$renderChanges = function(m) { - if(!(!m || !this.doc || !this.$tokenizer)) { - if(!this.layerConfig || m & this.CHANGE_FULL || m & this.CHANGE_SIZE || m & this.CHANGE_TEXT || m & this.CHANGE_LINES || m & this.CHANGE_SCROLL) { - this.$computeLayerConfig() - }if(m & this.CHANGE_FULL) { - this.$textLayer.update(this.layerConfig); - this.showGutter && this.$gutterLayer.update(this.layerConfig); - this.$markerLayer.update(this.layerConfig); - this.$cursorLayer.update(this.layerConfig); - this.$updateScrollBar() - }else { - if(m & this.CHANGE_SCROLL) { - m & this.CHANGE_TEXT || m & this.CHANGE_LINES ? this.$textLayer.update(this.layerConfig) : this.$textLayer.scrollLines(this.layerConfig); - this.showGutter && this.$gutterLayer.update(this.layerConfig); - this.$markerLayer.update(this.layerConfig); - this.$cursorLayer.update(this.layerConfig); - this.$updateScrollBar() - }else { - if(m & this.CHANGE_TEXT) { - this.$textLayer.update(this.layerConfig); - this.showGutter && this.$gutterLayer.update(this.layerConfig) - }else { - if(m & this.CHANGE_LINES) { - this.$updateLines(); - this.$updateScrollBar() - } - }m & this.CHANGE_GUTTER && this.showGutter && this.$gutterLayer.update(this.layerConfig); - m & this.CHANGE_CURSOR && this.$cursorLayer.update(this.layerConfig); - m & this.CHANGE_MARKER && this.$markerLayer.update(this.layerConfig); - m & this.CHANGE_SIZE && this.$updateScrollBar() - } - } - } - }; - this.$computeLayerConfig = function() { - var m = this.scrollTop % this.lineHeight, r = this.$size.scrollerHeight + this.lineHeight, q = this.$getLongestLine(), s = !this.layerConfig ? true : this.layerConfig.width != q, t = Math.ceil(r / this.lineHeight), u = Math.max(0, Math.round((this.scrollTop - m) / this.lineHeight)); - t = Math.min(this.lines.length, u + t) - 1; - this.layerConfig = {width:q, padding:this.$padding, firstRow:u, lastRow:t, lineHeight:this.lineHeight, characterWidth:this.characterWidth, minHeight:r, offset:m, height:this.$size.scrollerHeight}; - for(u = 0;u < this.layers.length;u++) { - t = this.layers[u]; - if(s) { - t.element.style.width = q + "px" - } - }this.$gutterLayer.element.style.marginTop = -m + "px"; - this.content.style.marginTop = -m + "px"; - this.content.style.width = q + "px"; - this.content.style.height = r + "px" - }; - this.$updateLines = function() { - var m = this.$changedLines.firstRow, r = this.$changedLines.lastRow; - this.$changedLines = null; - var q = this.layerConfig; - if(q.width != this.$getLongestLine()) { - return this.$textLayer.update(q) - }if(!(m > q.lastRow + 1)) { - if(!(r < q.firstRow)) { - if(r === Infinity) { - this.showGutter && this.$gutterLayer.update(q); - this.$textLayer.update(q) - }else { - this.$textLayer.updateLines(q, m, r) - } - } - } - }; - this.$getLongestLine = function() { - var m = this.doc.getScreenWidth(); - if(this.$showInvisibles) { - m += 1 - }return Math.max(this.$size.scrollerWidth - this.$padding * 2, Math.round(m * this.characterWidth)) - }; - this.addMarker = function(m, r, q) { - m = this.$markerLayer.addMarker(m, r, q); - this.$loop.schedule(this.CHANGE_MARKER); - return m - }; - this.removeMarker = function(m) { - this.$markerLayer.removeMarker(m); - this.$loop.schedule(this.CHANGE_MARKER) - }; - this.addGutterDecoration = function(m, r) { - this.$gutterLayer.addGutterDecoration(m, r); - this.$loop.schedule(this.CHANGE_GUTTER) - }; - this.removeGutterDecoration = function(m, r) { - this.$gutterLayer.removeGutterDecoration(m, r); - this.$loop.schedule(this.CHANGE_GUTTER) - }; - this.setBreakpoints = function(m) { - this.$gutterLayer.setBreakpoints(m); - this.$loop.schedule(this.CHANGE_GUTTER) - }; - this.updateCursor = function(m, r) { - this.$cursorLayer.setCursor(m, r); - this.$loop.schedule(this.CHANGE_CURSOR) - }; - this.hideCursor = function() { - this.$cursorLayer.hideCursor() - }; - this.showCursor = function() { - this.$cursorLayer.showCursor() - }; - this.scrollCursorIntoView = function() { - var m = this.$cursorLayer.getPixelPosition(), r = m.left + this.$padding; - m = m.top; - this.getScrollTop() > m && this.scrollToY(m); - this.getScrollTop() + this.$size.scrollerHeight < m + this.lineHeight && this.scrollToY(m + this.lineHeight - this.$size.scrollerHeight); - this.scroller.scrollLeft > r && this.scrollToX(r); - this.scroller.scrollLeft + this.$size.scrollerWidth < r + this.characterWidth && this.scrollToX(Math.round(r + this.characterWidth - this.$size.scrollerWidth)) - }; - this.getScrollTop = function() { - return this.scrollTop - }; - this.getScrollLeft = function() { - return this.scroller.scrollLeft - }; - this.getScrollTopRow = function() { - return this.scrollTop / this.lineHeight - }; - this.scrollToRow = function(m) { - this.scrollToY(m * this.lineHeight) - }; - this.scrollToY = function(m) { - m = Math.max(0, Math.min(this.lines.length * this.lineHeight - this.$size.scrollerHeight, m)); - if(this.scrollTop !== m) { - this.scrollTop = m; - this.$loop.schedule(this.CHANGE_SCROLL) - } - }; - this.scrollToX = function(m) { - if(m <= this.$padding) { - m = 0 - }this.scroller.scrollLeft = m - }; - this.scrollBy = function(m, r) { - r && this.scrollToY(this.scrollTop + r); - m && this.scrollToX(this.scroller.scrollLeft + m) - }; - this.screenToTextCoordinates = function(m, r) { - var q = this.scroller.getBoundingClientRect(); - m = Math.round((m + this.scroller.scrollLeft - q.left - this.$padding) / this.characterWidth); - r = Math.floor((r + this.scrollTop - q.top) / this.lineHeight); - return{row:r, column:this.doc.screenToDocumentColumn(Math.max(0, Math.min(r, this.doc.getLength() - 1)), m)} - }; - this.textToScreenCoordinates = function(m, r) { - var q = this.scroller.getBoundingClientRect(); - r = this.padding + Math.round(this.doc.documentToScreenColumn(m, r) * this.characterWidth); - m = m * this.lineHeight; - return{pageX:q.left + r - this.getScrollLeft(), pageY:q.top + m - this.getScrollTop()} - }; - this.visualizeFocus = function() { - j.addCssClass(this.container, "ace_focus") - }; - this.visualizeBlur = function() { - j.removeCssClass(this.container, "ace_focus") - }; - this.showComposition = function() { - }; - this.setCompositionText = function() { - }; - this.hideComposition = function() { - }; - this.setTheme = function(m) { - function r(s) { - q.$theme && j.removeCssClass(q.container, q.$theme); - q.$theme = s ? s.cssClass : null; - q.$theme && j.addCssClass(q.container, q.$theme); - if(q.$size) { - q.$size.width = 0; - q.onResize() - } - } - var q = this; - if(!m || typeof m == "string") { - m = m || "ace/theme/textmate"; - h([m], function(s) { - r(s) - }) - }else { - r(m) - }q = this - } - }).call(g.prototype); - return g -}); -define("ace/mode/doc_comment_highlight_rules", ["require", "exports", "module", "../lib/oop", "./text_highlight_rules"], function(h) { - var g = h("../lib/oop"); - h = h("./text_highlight_rules"); - var e = function() { - this.$rules = {start:[{token:"comment.doc", regex:"\\*\\/", next:"start"}, {token:"comment.doc.tag", regex:"@[\\w\\d_]+"}, {token:"comment.doc", regex:"s+"}, {token:"comment.doc", regex:"[^@\\*]+"}, {token:"comment.doc", regex:"."}]} - }; - g.inherits(e, h); - (function() { - this.getStartRule = function(c) { - return{token:"comment.doc", regex:"\\/\\*(?=\\*)", next:c} - } - }).call(e.prototype); - return e -}); -define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "../lib/oop", "../lib/lang", "./doc_comment_highlight_rules", "./text_highlight_rules"], function(h) { - var g = h("../lib/oop"), e = h("../lib/lang"), c = h("./doc_comment_highlight_rules"); - h = h("./text_highlight_rules"); - JavaScriptHighlightRules = function() { - var i = new c, b = e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")), j = e.arrayToMap("true|false|null|undefined|Infinity|NaN|undefined".split("|")), a = e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|")); - this.$rules = {start:[{token:"comment", regex:"\\/\\/.*$"}, i.getStartRule("doc-start"), {token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string.regexp", regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:'["].*\\\\$', next:"qqstring"}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"string", regex:"['].*\\\\$", next:"qstring"}, {token:"constant.numeric", - regex:"0[xX][0-9a-fA-F]+\\b"}, {token:"constant.numeric", regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, {token:function(f) { - return f == "this" ? "variable.language" : b[f] ? "keyword" : j[f] ? "constant.language" : a[f] ? "invalid.illegal" : f == "debugger" ? "invalid.deprecated" : "identifier" - }, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(in|instanceof|new|delete|typeof|void)"}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}], qqstring:[{token:"string", regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next:"start"}, {token:"string", regex:".+"}]}; - this.addRules(i.getRules(), "doc-"); - this.$rules["doc-start"][0].next = "start" - }; - g.inherits(JavaScriptHighlightRules, h); - return JavaScriptHighlightRules -}); -define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../range"], function(h) { - var g = h("../range"); - h = function() { - }; - (function() { - this.checkOutdent = function(e, c) { - if(!/^\s+$/.test(e)) { - return false - }return/^\s*\}/.test(c) - }; - this.autoOutdent = function(e, c) { - var i = e.getLine(c).match(/^(\s*\})/); - if(!i) { - return 0 - }i = i[1].length; - var b = e.findMatchingBracket({row:c, column:i}); - if(!b || b.row == c) { - return 0 - }b = this.$getIndent(e.getLine(b.row)); - e.replace(new g(c, 0, c, i - 1), b); - return b.length - (i - 1) - }; - this.$getIndent = function(e) { - if(e = e.match(/^(\s+)/)) { - return e[1] - }return"" - } - }).call(h.prototype); - return h -}); -define("ace/mode/javascript", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./javascript_highlight_rules", "./matching_brace_outdent", "../range"], function(h) { - var g = h("../lib/oop"), e = h("./text"), c = h("../tokenizer"), i = h("./javascript_highlight_rules"), b = h("./matching_brace_outdent"), j = h("../range"); - h = function() { - this.$tokenizer = new c((new i).getRules()); - this.$outdent = new b - }; - g.inherits(h, e); - (function() { - this.toggleCommentLines = function(a, f, l) { - var n = true; - a = /^(\s*)\/\//; - for(var d = l.start.row;d <= l.end.row;d++) { - if(!a.test(f.getLine(d))) { - n = false; - break - } - }if(n) { - n = new j(0, 0, 0, 0); - for(d = l.start.row;d <= l.end.row;d++) { - var k = f.getLine(d).replace(a, "$1"); - n.start.row = d; - n.end.row = d; - n.end.column = k.length + 2; - f.replace(n, k) - }return-2 - }else { - return f.indentRows(l, "//") - } - }; - this.getNextLineIndent = function(a, f, l) { - var n = this.$getIndent(f), d = this.$tokenizer.getLineTokens(f, a), k = d.tokens; - d = d.state; - if(k.length && k[k.length - 1].type == "comment") { - return n - }if(a == "start") { - if(a = f.match(/^.*[\{\(\[]\s*$/)) { - n += l - } - }else { - if(a == "doc-start") { - if(d == "start") { - return"" - }if(a = f.match(/^\s*(\/?)\*/)) { - if(a[1]) { - n += " " - }n += "* " - }if(a[1]) { - n += " " - }n += "* " - } - }return n - }; - this.checkOutdent = function(a, f, l) { - return this.$outdent.checkOutdent(f, l) - }; - this.autoOutdent = function(a, f, l) { - return this.$outdent.autoOutdent(f, l) - } - }).call(h.prototype); - return h -}); -define("ace/theme/textmate", ["require", "exports", "module", "text!ace/theme/tm.css!.ace-tm .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-tm .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-tm .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-tm .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-tm .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-tm .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_text-layer {\n cursor: text;\n}\n\n.ace-tm .ace_cursor {\n border-left: 2px solid black;\n}\n\n.ace-tm .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid black;\n}\n \n.ace-tm .ace_line .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_line .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_invalid {\n background-color: rgb(153, 0, 0);\n color: white;\n}\n\n.ace-tm .ace_line .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_line .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_line .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_line .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_line .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_line .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0) \n}", -"../lib/dom"], function(h, g, e, c) { - h("../lib/dom").importCssString(c); - return{cssClass:"ace-tm"} -}); \ No newline at end of file diff --git a/build/ace/event_emitter.js b/build/ace/event_emitter.js deleted file mode 100644 index 3579934c..00000000 --- a/build/ace/event_emitter.js +++ /dev/null @@ -1,29 +0,0 @@ -define(function(d) { - var e = d("./lib/lang"); - d = {}; - d.$dispatchEvent = function(a, b) { - this.$eventRegistry = this.$eventRegistry || {}; - var c = this.$eventRegistry[a]; - if(c && c.length) { - b = b || {}; - b.type = a; - for(a = 0;a < c.length;a++) { - c[a](b) - } - } - }; - d.on = d.addEventListener = function(a, b) { - this.$eventRegistry = this.$eventRegistry || {}; - var c = this.$eventRegistry[a]; - c || (c = this.$eventRegistry[a] = []); - e.arrayIndexOf(c, b) == -1 && c.push(b) - }; - d.removeEventListener = function(a, b) { - this.$eventRegistry = this.$eventRegistry || {}; - if(a = this.$eventRegistry[a]) { - b = e.arrayIndexOf(a, b); - b !== -1 && a.splice(b, 1) - } - }; - return d -}); \ No newline at end of file diff --git a/build/ace/keybinding.js b/build/ace/keybinding.js deleted file mode 100644 index 2751eb22..00000000 --- a/build/ace/keybinding.js +++ /dev/null @@ -1,56 +0,0 @@ -define(function(e) { - var m = e("./lib/core"), l = e("./lib/event"), n = e("./conf/keybindings/default_mac"), o = e("./conf/keybindings/default_win"), p = e("./plugin_manager"); - e("./commands/default_commands"); - e = function(j, h, k) { - this.setConfig(k); - var a = this; - l.addKeyListener(j, function(b) { - var c = (a.config.reverse[0 | (b.ctrlKey ? 1 : 0) | (b.altKey ? 2 : 0) | (b.shiftKey ? 4 : 0) | (b.metaKey ? 8 : 0)] || {})[(a.keyNames[b.keyCode] || String.fromCharCode(b.keyCode)).toLowerCase()]; - if(c = p.commands[c]) { - c(h, h.getSelection()); - return l.stopEvent(b) - } - }) - }; - (function() { - function j(a, b, c, f) { - return(f && a.toLowerCase() || a).replace(/(?:^\s+|\n|\s+$)/g, "").split(new RegExp("[\\s ]*" + b + "[\\s ]*", "g"), c || 999) - } - function h(a, b, c) { - var f, g = 0; - a = j(a, "\\-", null, true); - for(var d = 0, i = a.length;d < i;++d) { - if(this.keyMods[a[d]]) { - g |= this.keyMods[a[d]] - }else { - f = a[d] || "-" - } - }(c[g] || (c[g] = {}))[f] = b; - return c - } - function k(a, b) { - var c, f, g, d, i = {}; - for(c in a) { - d = a[c]; - if(b && typeof d == "string") { - d = d.split(b); - f = 0; - for(g = d.length;f < g;++f) { - h.call(this, d[f], c, i) - } - }else { - h.call(this, d, c, i) - } - }return i - } - this.keyMods = {ctrl:1, alt:2, option:2, shift:4, meta:8, command:8}; - this.keyNames = {"8":"Backspace", "9":"Tab", "13":"Enter", "27":"Esc", "32":"Space", "33":"PageUp", "34":"PageDown", "35":"End", "36":"Home", "37":"Left", "38":"Up", "39":"Right", "40":"Down", "45":"Insert", "46":"Delete", "107":"+", "112":"F1", "113":"F2", "114":"F3", "115":"F4", "116":"F5", "117":"F6", "118":"F7", "119":"F8", "120":"F9", "121":"F10", "122":"F11", "123":"F12"}; - this.setConfig = function(a) { - this.config = a || (m.isMac ? n : o); - if(typeof this.config.reverse == "undefined") { - this.config.reverse = k.call(this, this.config, "|") - } - } - }).call(e.prototype); - return e -}); \ No newline at end of file diff --git a/build/ace/layer/cursor.js b/build/ace/layer/cursor.js deleted file mode 100644 index c8450fa9..00000000 --- a/build/ace/layer/cursor.js +++ /dev/null @@ -1,63 +0,0 @@ -define(function(b) { - var d = b("../lib/dom"); - b = function(a) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - a.appendChild(this.element); - this.cursor = document.createElement("div"); - this.cursor.className = "ace_cursor"; - this.isVisible = false - }; - (function() { - this.setDocument = function(a) { - this.doc = a - }; - this.setCursor = function(a, c) { - this.position = {row:a.row, column:this.doc.documentToScreenColumn(a.row, a.column)}; - c ? d.addCssClass(this.cursor, "ace_overwrite") : d.removeCssClass(this.cursor, "ace_overwrite") - }; - this.hideCursor = function() { - this.isVisible = false; - this.cursor.parentNode && this.cursor.parentNode.removeChild(this.cursor); - clearInterval(this.blinkId) - }; - this.showCursor = function() { - this.isVisible = true; - this.element.appendChild(this.cursor); - this.cursor.style.visibility = "visible"; - this.restartTimer() - }; - this.restartTimer = function() { - clearInterval(this.blinkId); - if(this.isVisible) { - var a = this.cursor; - this.blinkId = setInterval(function() { - a.style.visibility = "hidden"; - setTimeout(function() { - a.style.visibility = "visible" - }, 400) - }, 1E3) - } - }; - this.getPixelPosition = function() { - if(!this.config || !this.position) { - return{left:0, top:0} - }var a = this.position.row * this.config.lineHeight; - return{left:Math.round(this.position.column * this.config.characterWidth), top:a} - }; - this.update = function(a) { - if(this.position) { - this.config = a; - var c = Math.round(this.position.column * a.characterWidth), e = this.position.row * a.lineHeight; - this.pixelPos = {left:c, top:e}; - this.cursor.style.left = c + "px"; - this.cursor.style.top = e - a.firstRow * a.lineHeight + "px"; - this.cursor.style.width = a.characterWidth + "px"; - this.cursor.style.height = a.lineHeight + "px"; - this.isVisible && this.element.appendChild(this.cursor); - this.restartTimer() - } - } - }).call(b.prototype); - return b -}); \ No newline at end of file diff --git a/build/ace/layer/gutter.js b/build/ace/layer/gutter.js deleted file mode 100644 index 5934bb53..00000000 --- a/build/ace/layer/gutter.js +++ /dev/null @@ -1,30 +0,0 @@ -define(function() { - var d = function(a) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - a.appendChild(this.element); - this.$breakpoints = []; - this.$decorations = [] - }; - (function() { - this.addGutterDecoration = function(a, b) { - this.$decorations[a] || (this.$decorations[a] = ""); - this.$decorations[a] += " ace_" + b - }; - this.removeGutterDecoration = function(a, b) { - this.$decorations[a] = this.$decorations[a].replace(" ace_" + b, "") - }; - this.setBreakpoints = function(a) { - this.$breakpoints = a.concat() - }; - this.update = function(a) { - this.$config = a; - for(var b = [], c = a.firstRow;c <= a.lastRow;c++) { - b.push("
", c + 1, "
"); - b.push("") - }this.element.innerHTML = b.join(""); - this.element.style.height = a.minHeight + "px" - } - }).call(d.prototype); - return d -}); \ No newline at end of file diff --git a/build/ace/layer/marker.js b/build/ace/layer/marker.js deleted file mode 100644 index ab3dc1d7..00000000 --- a/build/ace/layer/marker.js +++ /dev/null @@ -1,72 +0,0 @@ -define(function(h) { - var i = h("../range"); - h = function(c) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_marker-layer"; - c.appendChild(this.element); - this.markers = {}; - this.$markerId = 1 - }; - (function() { - this.setDocument = function(c) { - this.doc = c - }; - this.addMarker = function(c, a, e) { - var b = this.$markerId++; - this.markers[b] = {range:c, type:e || "line", clazz:a}; - return b - }; - this.removeMarker = function(c) { - this.markers[c] && delete this.markers[c] - }; - this.update = function(c) { - if(c = c || this.config) { - this.config = c; - var a = []; - for(var e in this.markers) { - var b = this.markers[e], d = b.range.clipRows(c.firstRow, c.lastRow); - if(!d.isEmpty()) { - if(d.isMultiLine()) { - b.type == "text" ? this.drawTextMarker(a, d, b.clazz, c) : this.drawMultiLineMarker(a, d, b.clazz, c) - }else { - this.drawSingleLineMarker(a, d, b.clazz, c) - } - } - }this.element.innerHTML = a.join("") - } - }; - this.drawTextMarker = function(c, a, e, b) { - var d = a.start.row, f = new i(d, a.start.column, d, this.doc.getLine(d).length); - this.drawSingleLineMarker(c, f, e, b); - d = a.end.row; - f = new i(d, 0, d, a.end.column); - this.drawSingleLineMarker(c, f, e, b); - for(d = a.start.row + 1;d < a.end.row;d++) { - f.start.row = d; - f.end.row = d; - f.end.column = this.doc.getLine(d).length; - this.drawSingleLineMarker(c, f, e, b) - } - }; - this.drawMultiLineMarker = function(c, a, e, b) { - a = a.toScreenRange(this.doc); - var d = b.lineHeight, f = Math.round(b.width - a.start.column * b.characterWidth), g = (a.start.row - b.firstRow) * b.lineHeight, j = Math.round(a.start.column * b.characterWidth); - c.push("
"); - g = (a.end.row - b.firstRow) * b.lineHeight; - f = Math.round(a.end.column * b.characterWidth); - c.push("
"); - d = (a.end.row - a.start.row - 1) * b.lineHeight; - if(!(d < 0)) { - g = (a.start.row + 1 - b.firstRow) * b.lineHeight; - c.push("
") - } - }; - this.drawSingleLineMarker = function(c, a, e, b) { - a = a.toScreenRange(this.doc); - var d = b.lineHeight, f = Math.round((a.end.column - a.start.column) * b.characterWidth), g = (a.start.row - b.firstRow) * b.lineHeight; - a = Math.round(a.start.column * b.characterWidth); - c.push("
") - } - }).call(h.prototype); - return h -}); \ No newline at end of file diff --git a/build/ace/layer/text.js b/build/ace/layer/text.js deleted file mode 100644 index 7e37774c..00000000 --- a/build/ace/layer/text.js +++ /dev/null @@ -1,158 +0,0 @@ -define(function(k) { - var m = k("../lib/oop"), n = k("../lib/dom"), o = k("../event_emitter"); - k = function(a) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - a.appendChild(this.element); - this.$characterSize = this.$measureSizes(); - this.$pollSizeChanges() - }; - (function() { - m.implement(this, o); - this.EOF_CHAR = "¶"; - this.EOL_CHAR = "¬"; - this.TAB_CHAR = "→"; - this.SPACE_CHAR = "·"; - this.setTokenizer = function(a) { - this.tokenizer = a - }; - this.getLineHeight = function() { - return this.$characterSize.height || 1 - }; - this.getCharacterWidth = function() { - return this.$characterSize.width || 1 - }; - this.$pollSizeChanges = function() { - var a = this; - setInterval(function() { - var b = a.$measureSizes(); - if(a.$characterSize.width !== b.width || a.$characterSize.height !== b.height) { - a.$characterSize = b; - a.$dispatchEvent("changeCharaterSize", {data:b}) - } - }, 500) - }; - this.$fontStyles = {fontFamily:1, fontSize:1, fontWeight:1, fontStyle:1, lineHeight:1}; - this.$measureSizes = function() { - var a = document.createElement("div"), b = a.style; - b.width = b.height = "auto"; - b.left = b.top = "-1000px"; - b.visibility = "hidden"; - b.position = "absolute"; - b.overflow = "visible"; - for(var e in this.$fontStyles) { - var f = n.computedStyle(this.element, e); - b[e] = f - }a.innerHTML = (new Array(1E3)).join("Xy"); - document.body.insertBefore(a, document.body.firstChild); - b = {height:a.offsetHeight, width:a.offsetWidth / 2E3}; - document.body.removeChild(a); - return b - }; - this.setDocument = function(a) { - this.doc = a - }; - this.$showInvisibles = false; - this.setShowInvisibles = function(a) { - this.$showInvisibles = a - }; - this.$computeTabString = function() { - var a = this.doc.getTabSize(); - if(this.$showInvisibles) { - a = a / 2; - this.$tabString = "" + (new Array(Math.floor(a))).join(" ") + this.TAB_CHAR + (new Array(Math.ceil(a) + 1)).join(" ") + "" - }else { - this.$tabString = (new Array(a + 1)).join(" ") - } - }; - this.updateLines = function(a, b, e) { - this.$computeTabString(); - this.config = a; - var f = Math.max(b, a.firstRow), c = Math.min(e, a.lastRow), d = this.element.childNodes, h = this; - this.tokenizer.getTokens(f, c, function(i) { - for(var g = f;g <= c;g++) { - var j = d[g - a.firstRow]; - if(j) { - var l = []; - h.$renderLine(l, g, i[g - f].tokens); - j.innerHTML = l.join("") - } - } - }) - }; - this.scrollLines = function(a) { - function b(i) { - a.firstRow < c.firstRow ? f.$renderLinesFragment(a, a.firstRow, c.firstRow - 1, function(g) { - d.firstChild ? d.insertBefore(g, d.firstChild) : d.appendChild(g); - i() - }) : i() - } - function e() { - a.lastRow > c.lastRow && f.$renderLinesFragment(a, c.lastRow + 1, a.lastRow, function(i) { - d.appendChild(i) - }) - } - var f = this; - this.$computeTabString(); - var c = this.config; - this.config = a; - if(!c || c.lastRow < a.firstRow) { - return this.update(a) - }if(a.lastRow < c.firstRow) { - return this.update(a) - }var d = this.element; - if(c.firstRow < a.firstRow) { - for(var h = c.firstRow;h < a.firstRow;h++) { - d.removeChild(d.firstChild) - } - }if(c.lastRow > a.lastRow) { - for(h = a.lastRow + 1;h <= c.lastRow;h++) { - d.removeChild(d.lastChild) - } - }b(e) - }; - this.$renderLinesFragment = function(a, b, e, f) { - var c = document.createDocumentFragment(), d = this; - this.tokenizer.getTokens(b, e, function(h) { - for(var i = b;i <= e;i++) { - var g = document.createElement("div"); - g.className = "ace_line"; - var j = g.style; - j.height = d.$characterSize.height + "px"; - j.width = a.width + "px"; - j = []; - d.$renderLine(j, i, h[i - b].tokens); - g.innerHTML = j.join(""); - c.appendChild(g) - }f(c) - }) - }; - this.update = function(a) { - this.$computeTabString(); - this.config = a; - var b = [], e = this; - this.tokenizer.getTokens(a.firstRow, a.lastRow, function(f) { - for(var c = a.firstRow;c <= a.lastRow;c++) { - b.push("
"); - e.$renderLine(b, c, f[c - a.firstRow].tokens); - b.push("
") - }e.element.innerHTML = b.join("") - }) - }; - this.$textToken = {text:true, rparen:true, lparen:true}; - this.$renderLine = function(a, b, e) { - for(var f = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g, c = 0;c < e.length;c++) { - var d = e[c], h = d.value.replace(/&/g, "&").replace(/", h, "") - } - }if(this.$showInvisibles) { - b !== this.doc.getLength() - 1 ? a.push("" + this.EOL_CHAR + "") : a.push("" + this.EOF_CHAR + "") - } - } - }).call(k.prototype); - return k -}); \ No newline at end of file diff --git a/build/ace/lib/core.js b/build/ace/lib/core.js deleted file mode 100644 index ee9f8a15..00000000 --- a/build/ace/lib/core.js +++ /dev/null @@ -1,17 +0,0 @@ -define(function() { - var a = {}, d = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); - a.isWin = d == "win"; - a.isMac = d == "mac"; - a.isLinux = d == "linux"; - a.isIE = !+"\u000b1"; - a.isGecko = window.controllers && window.navigator.product === "Gecko"; - a.provide = function(b) { - b = b.split("."); - for(var c = window, e = 0;e < b.length;e++) { - var f = b[e]; - c[f] || (c[f] = {}); - c = c[f] - } - }; - return a -}); \ No newline at end of file diff --git a/build/ace/lib/dom.js b/build/ace/lib/dom.js deleted file mode 100644 index 86245469..00000000 --- a/build/ace/lib/dom.js +++ /dev/null @@ -1,65 +0,0 @@ -define(function(g) { - var f = g("./lang"), c = {}; - c.setText = function(a, b) { - if(a.innerText !== undefined) { - a.innerText = b - }if(a.textContent !== undefined) { - a.textContent = b - } - }; - c.hasCssClass = function(a, b) { - a = a.className.split(/\s+/g); - return f.arrayIndexOf(a, b) !== -1 - }; - c.addCssClass = function(a, b) { - c.hasCssClass(a, b) || (a.className += " " + b) - }; - c.removeCssClass = function(a, b) { - for(var d = a.className.split(/\s+/g);;) { - var e = f.arrayIndexOf(d, b); - if(e == -1) { - break - }d.splice(e, 1) - }a.className = d.join(" ") - }; - c.importCssString = function(a, b) { - b = b || document; - if(b.createStyleSheet) { - b.createStyleSheet().cssText = a - }else { - var d = b.createElement("style"); - d.appendChild(b.createTextNode(a)); - b.getElementsByTagName("head")[0].appendChild(d) - } - }; - c.getInnerWidth = function(a) { - return parseInt(c.computedStyle(a, "paddingLeft")) + parseInt(c.computedStyle(a, "paddingRight")) + a.clientWidth - }; - c.getInnerHeight = function(a) { - return parseInt(c.computedStyle(a, "paddingTop")) + parseInt(c.computedStyle(a, "paddingBottom")) + a.clientHeight - }; - c.computedStyle = function(a, b) { - return window.getComputedStyle ? (window.getComputedStyle(a, "") || {})[b] || "" : a.currentStyle[b] - }; - c.scrollbarWidth = function() { - var a = document.createElement("p"); - a.style.width = "100%"; - a.style.height = "200px"; - var b = document.createElement("div"), d = b.style; - d.position = "absolute"; - d.left = "-10000px"; - d.overflow = "hidden"; - d.width = "200px"; - d.height = "150px"; - b.appendChild(a); - document.body.appendChild(b); - var e = a.offsetWidth; - d.overflow = "scroll"; - a = a.offsetWidth; - if(e == a) { - a = b.clientWidth - }document.body.removeChild(b); - return e - a - }; - return c -}); \ No newline at end of file diff --git a/build/ace/lib/event.js b/build/ace/lib/event.js deleted file mode 100644 index a067cd6b..00000000 --- a/build/ace/lib/event.js +++ /dev/null @@ -1,134 +0,0 @@ -define(function(m) { - var i = m("./core"), c = {}; - c.addListener = function(a, e, d) { - if(a.addEventListener) { - return a.addEventListener(e, d, false) - }if(a.attachEvent) { - var b = function() { - d(window.event) - }; - d.$$wrapper = b; - a.attachEvent("on" + e, b) - } - }; - c.removeListener = function(a, e, d) { - if(a.removeEventListener) { - return a.removeEventListener(e, d, false) - }if(a.detachEvent) { - a.detachEvent("on" + e, d.$$wrapper || d) - } - }; - c.stopEvent = function(a) { - c.stopPropagation(a); - c.preventDefault(a); - return false - }; - c.stopPropagation = function(a) { - if(a.stopPropagation) { - a.stopPropagation() - }else { - a.cancelBubble = true - } - }; - c.preventDefault = function(a) { - if(a.preventDefault) { - a.preventDefault() - }else { - a.returnValue = false - } - }; - c.getDocumentX = function(a) { - return a.clientX ? a.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) : a.pageX - }; - c.getDocumentY = function(a) { - return a.clientY ? a.clientY + (document.documentElement.scrollTop || document.body.scrollTop) : a.pageX - }; - c.getButton = function(a) { - return a.preventDefault ? a.button : Math.max(a.button - 1, 2) - }; - c.capture = document.documentElement.setCapture ? function(a, e, d) { - function b(h) { - e && e(h); - d && d(); - c.removeListener(a, "mousemove", e); - c.removeListener(a, "mouseup", b); - c.removeListener(a, "losecapture", b); - a.releaseCapture() - } - c.addListener(a, "mousemove", e); - c.addListener(a, "mouseup", b); - c.addListener(a, "losecapture", b); - a.setCapture() - } : function(a, e, d) { - function b(f) { - e(f); - f.stopPropagation() - } - function h(f) { - e && e(f); - d && d(); - document.removeEventListener("mousemove", b, true); - document.removeEventListener("mouseup", h, true); - f.stopPropagation() - } - document.addEventListener("mousemove", b, true); - document.addEventListener("mouseup", h, true) - }; - c.addMouseWheelListener = function(a, e) { - var d = function(b) { - if(b.wheelDelta !== undefined) { - if(b.wheelDeltaX !== undefined) { - b.wheelX = -b.wheelDeltaX / 8; - b.wheelY = -b.wheelDeltaY / 8 - }else { - b.wheelX = 0; - b.wheelY = -b.wheelDelta / 8 - } - }else { - if(b.axis && b.axis == b.HORIZONTAL_AXIS) { - b.wheelX = (b.detail || 0) * 5; - b.wheelY = 0 - }else { - b.wheelX = 0; - b.wheelY = (b.detail || 0) * 5 - } - }e(b) - }; - c.addListener(a, "DOMMouseScroll", d); - c.addListener(a, "mousewheel", d) - }; - c.addMultiMouseDownListener = function(a, e, d, b, h) { - var f = 0, j, k, l = function(g) { - f += 1; - if(f == 1) { - j = g.clientX; - k = g.clientY; - setTimeout(function() { - f = 0 - }, b || 600) - }if(c.getButton(g) != e || Math.abs(g.clientX - j) > 5 || Math.abs(g.clientY - k) > 5) { - f = 0 - }if(f == d) { - f = 0; - h(g) - }return c.preventDefault(g) - }; - c.addListener(a, "mousedown", l); - i.isIE && c.addListener(a, "dblclick", l) - }; - c.addKeyListener = function(a, e) { - var d = null; - c.addListener(a, "keydown", function(b) { - d = b.keyIdentifier || b.keyCode; - return e(b) - }); - i.isMac && i.isGecko && c.addListener(a, "keypress", function(b) { - if(d !== (b.keyIdentifier || b.keyCode)) { - return e(b) - }else { - d = null - } - }) - }; - return c -}); \ No newline at end of file diff --git a/build/ace/lib/lang.js b/build/ace/lib/lang.js deleted file mode 100644 index 4a3fac87..00000000 --- a/build/ace/lib/lang.js +++ /dev/null @@ -1,56 +0,0 @@ -define(function() { - var d = {}; - d.stringReverse = function(a) { - return a.split("").reverse().join("") - }; - d.stringRepeat = function(a, b) { - return(new Array(b + 1)).join(a) - }; - d.arrayIndexOf = Array.prototype.indexOf ? function(a, b) { - return a.indexOf(b) - } : function(a, b) { - for(var c = 0;c < a.length;c++) { - if(a[c] == b) { - return c - } - }return-1 - }; - d.isArray = function(a) { - return Object.prototype.toString.call(a) == "[object Array]" - }; - d.copyObject = function(a) { - var b = {}; - for(var c in a) { - b[c] = a[c] - }return b - }; - d.arrayToMap = function(a) { - for(var b = {}, c = 0;c < a.length;c++) { - b[a[c]] = 1 - }return b - }; - d.escapeRegExp = function(a) { - return a.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1") - }; - d.bind = function(a, b) { - return function() { - return a.apply(b, arguments) - } - }; - d.deferredCall = function(a) { - var b = null, c = function() { - b = null; - a() - }; - return{schedule:function() { - b || (b = setTimeout(c, 0)) - }, call:function() { - d.cancel(); - a() - }, cancel:function() { - clearTimeout(b); - b = null - }} - }; - return d -}); \ No newline at end of file diff --git a/build/ace/lib/oop.js b/build/ace/lib/oop.js deleted file mode 100644 index 53011e61..00000000 --- a/build/ace/lib/oop.js +++ /dev/null @@ -1,20 +0,0 @@ -define(function() { - var c = {}; - c.inherits = function(a, b) { - var d = function() { - }; - d.prototype = b.prototype; - a.super_ = b.prototype; - a.prototype = new d; - a.prototype.constructor = a - }; - c.mixin = function(a, b) { - for(var d in b) { - a[d] = b[d] - } - }; - c.implement = function(a, b) { - c.mixin(a, b) - }; - return c -}); \ No newline at end of file diff --git a/build/ace/mode/css.js b/build/ace/mode/css.js deleted file mode 100644 index a41740fb..00000000 --- a/build/ace/mode/css.js +++ /dev/null @@ -1,80 +0,0 @@ -define("ace/mode/css_highlight_rules", ["require", "exports", "module", "../lib/oop", "../lib/lang", "./text_highlight_rules"], function(b) { - var j = b("../lib/oop"), c = b("../lib/lang"); - b = b("./text_highlight_rules"); - var e = function() { - function a(d) { - var l = []; - d = d.split(""); - for(var k = 0;k < d.length;k++) { - l.push("[", d[k].toLowerCase(), d[k].toUpperCase(), "]") - }return l.join("") - } - var f = c.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")), - g = c.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), h = c.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")), - i = c.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|")); - this.$rules = {start:[{token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("em")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ex")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("px")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + - a("cm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("mm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("in")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pt")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pc")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("deg")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + - a("rad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("grad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ms")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("s")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("hz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("khz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))%"}, - {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{6}"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{3}"}, {token:"lparen", regex:"{"}, {token:"rparen", regex:"}"}, {token:function(d) { - return f[d.toLowerCase()] ? "support.type" : g[d.toLowerCase()] ? "support.function" : h[d.toLowerCase()] ? "support.constant" : i[d.toLowerCase()] ? "support.constant.color" : "text" - }, regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}]} - }; - j.inherits(e, b); - return e -}); -define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../range"], function(b) { - var j = b("../range"); - b = function() { - }; - (function() { - this.checkOutdent = function(c, e) { - if(!/^\s+$/.test(c)) { - return false - }return/^\s*\}/.test(e) - }; - this.autoOutdent = function(c, e) { - var a = c.getLine(e).match(/^(\s*\})/); - if(!a) { - return 0 - }a = a[1].length; - var f = c.findMatchingBracket({row:e, column:a}); - if(!f || f.row == e) { - return 0 - }f = this.$getIndent(c.getLine(f.row)); - c.replace(new j(e, 0, e, a - 1), f); - return f.length - (a - 1) - }; - this.$getIndent = function(c) { - if(c = c.match(/^(\s+)/)) { - return c[1] - }return"" - } - }).call(b.prototype); - return b -}); -define("ace/mode/css", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./css_highlight_rules", "./matching_brace_outdent"], function(b) { - var j = b("../lib/oop"), c = b("./text"), e = b("../tokenizer"), a = b("./css_highlight_rules"), f = b("./matching_brace_outdent"); - b = function() { - this.$tokenizer = new e((new a).getRules()); - this.$outdent = new f - }; - j.inherits(b, c); - (function() { - this.getNextLineIndent = function(g, h, i) { - var d = this.$getIndent(h); - g = this.$tokenizer.getLineTokens(h, g).tokens; - if(g.length && g[g.length - 1].type == "comment") { - return d - }if(h.match(/^.*\{\s*$/)) { - d += i - }return d - }; - this.checkOutdent = function(g, h, i) { - return this.$outdent.checkOutdent(h, i) - }; - this.autoOutdent = function(g, h, i) { - return this.$outdent.autoOutdent(h, i) - } - }).call(b.prototype); - return b -}); \ No newline at end of file diff --git a/build/ace/mode/css_highlight_rules.js b/build/ace/mode/css_highlight_rules.js deleted file mode 100644 index a68b8b16..00000000 --- a/build/ace/mode/css_highlight_rules.js +++ /dev/null @@ -1,24 +0,0 @@ -define(function(c) { - var h = c("../lib/oop"), d = c("../lib/lang"); - c = c("./text_highlight_rules"); - var g = function() { - function a(b) { - var f = []; - b = b.split(""); - for(var e = 0;e < b.length;e++) { - f.push("[", b[e].toLowerCase(), b[e].toUpperCase(), "]") - }return f.join("") - } - var i = d.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")), - j = d.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), k = d.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")), - l = d.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|")); - this.$rules = {start:[{token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("em")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ex")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("px")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + - a("cm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("mm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("in")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pt")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pc")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("deg")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + - a("rad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("grad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ms")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("s")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("hz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("khz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))%"}, - {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{6}"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{3}"}, {token:"lparen", regex:"{"}, {token:"rparen", regex:"}"}, {token:function(b) { - return i[b.toLowerCase()] ? "support.type" : j[b.toLowerCase()] ? "support.function" : k[b.toLowerCase()] ? "support.constant" : l[b.toLowerCase()] ? "support.constant.color" : "text" - }, regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}]} - }; - h.inherits(g, c); - return g -}); \ No newline at end of file diff --git a/build/ace/mode/doc_comment_highlight_rules.js b/build/ace/mode/doc_comment_highlight_rules.js deleted file mode 100644 index 9a924e0c..00000000 --- a/build/ace/mode/doc_comment_highlight_rules.js +++ /dev/null @@ -1,14 +0,0 @@ -define(function(a) { - var c = a("../lib/oop"); - a = a("./text_highlight_rules"); - var b = function() { - this.$rules = {start:[{token:"comment.doc", regex:"\\*\\/", next:"start"}, {token:"comment.doc.tag", regex:"@[\\w\\d_]+"}, {token:"comment.doc", regex:"s+"}, {token:"comment.doc", regex:"[^@\\*]+"}, {token:"comment.doc", regex:"."}]} - }; - c.inherits(b, a); - (function() { - this.getStartRule = function(d) { - return{token:"comment.doc", regex:"\\/\\*(?=\\*)", next:d} - } - }).call(b.prototype); - return b -}); \ No newline at end of file diff --git a/build/ace/mode/html.js b/build/ace/mode/html.js deleted file mode 100644 index e4522585..00000000 --- a/build/ace/mode/html.js +++ /dev/null @@ -1,57 +0,0 @@ -define("ace/mode/html_highlight_rules", ["require", "exports", "module", "../lib/oop", "./css_highlight_rules", "./javascript_highlight_rules", "./text_highlight_rules"], function(a) { - var f = a("../lib/oop"), g = a("./css_highlight_rules"), h = a("./javascript_highlight_rules"); - a = a("./text_highlight_rules"); - var d = function() { - this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<(?=s*script)", next:"script"}, {token:"text", regex:"<(?=s*style)", next:"css"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], script:[{token:"text", regex:">", next:"js-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, - {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], css:[{token:"text", regex:">", next:"css-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", next:"start"}, - {token:"text", regex:"\\s+"}, {token:"text", regex:".+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]}; - this.addRules((new h).getRules(), "js-"); - this.$rules["js-start"].unshift({token:"comment", regex:"\\/\\/.*(?=<\\/script>)", next:"tag"}, {token:"text", regex:"<\\/(?=script)", next:"tag"}); - this.addRules((new g).getRules(), "css-"); - this.$rules["css-start"].unshift({token:"text", regex:"<\\/(?=style)", next:"tag"}) - }; - f.inherits(d, a); - return d -}); -define("ace/mode/html", ["require", "exports", "module", "../lib/oop", "./text", "./javascript", "./css", "../tokenizer", "./html_highlight_rules"], function(a) { - var f = a("../lib/oop"), g = a("./text"), h = a("./javascript"), d = a("./css"), k = a("../tokenizer"), l = a("./html_highlight_rules"); - a = function() { - this.$tokenizer = new k((new l).getRules()); - this.$js = new h; - this.$css = new d - }; - f.inherits(a, g); - (function() { - this.toggleCommentLines = function() { - return this.$delegate("toggleCommentLines", arguments, function() { - return 0 - }) - }; - this.getNextLineIndent = function(i, b) { - var e = this; - return this.$delegate("getNextLineIndent", arguments, function() { - return e.$getIndent(b) - }) - }; - this.checkOutdent = function() { - return this.$delegate("checkOutdent", arguments, function() { - return false - }) - }; - this.autoOutdent = function() { - return this.$delegate("autoOutdent", arguments) - }; - this.$delegate = function(i, b, e) { - var j = b[0], c = j.split("js-"); - if(!c[0] && c[1]) { - b[0] = c[1]; - return this.$js[i].apply(this.$js, b) - }c = j.split("css-"); - if(!c[0] && c[1]) { - b[0] = c[1]; - return this.$css[i].apply(this.$css, b) - }return e ? e() : undefined - } - }).call(a.prototype); - return a -}); \ No newline at end of file diff --git a/build/ace/mode/html_highlight_rules.js b/build/ace/mode/html_highlight_rules.js deleted file mode 100644 index f0025ca9..00000000 --- a/build/ace/mode/html_highlight_rules.js +++ /dev/null @@ -1,15 +0,0 @@ -define(function(a) { - var c = a("../lib/oop"), d = a("./css_highlight_rules"), e = a("./javascript_highlight_rules"); - a = a("./text_highlight_rules"); - var b = function() { - this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<(?=s*script)", next:"script"}, {token:"text", regex:"<(?=s*style)", next:"css"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], script:[{token:"text", regex:">", next:"js-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, - {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], css:[{token:"text", regex:">", next:"css-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", next:"start"}, - {token:"text", regex:"\\s+"}, {token:"text", regex:".+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]}; - this.addRules((new e).getRules(), "js-"); - this.$rules["js-start"].unshift({token:"comment", regex:"\\/\\/.*(?=<\\/script>)", next:"tag"}, {token:"text", regex:"<\\/(?=script)", next:"tag"}); - this.addRules((new d).getRules(), "css-"); - this.$rules["css-start"].unshift({token:"text", regex:"<\\/(?=style)", next:"tag"}) - }; - c.inherits(b, a); - return b -}); \ No newline at end of file diff --git a/build/ace/mode/javascript.js b/build/ace/mode/javascript.js deleted file mode 100644 index 0217d3fc..00000000 --- a/build/ace/mode/javascript.js +++ /dev/null @@ -1,61 +0,0 @@ -define(function(f) { - var h = f("../lib/oop"), i = f("./text"), j = f("../tokenizer"), k = f("./javascript_highlight_rules"), l = f("./matching_brace_outdent"), m = f("../range"); - f = function() { - this.$tokenizer = new j((new k).getRules()); - this.$outdent = new l - }; - h.inherits(f, i); - (function() { - this.toggleCommentLines = function(c, d, e) { - var a = true; - c = /^(\s*)\/\//; - for(var b = e.start.row;b <= e.end.row;b++) { - if(!c.test(d.getLine(b))) { - a = false; - break - } - }if(a) { - a = new m(0, 0, 0, 0); - for(b = e.start.row;b <= e.end.row;b++) { - var g = d.getLine(b).replace(c, "$1"); - a.start.row = b; - a.end.row = b; - a.end.column = g.length + 2; - d.replace(a, g) - }return-2 - }else { - return d.indentRows(e, "//") - } - }; - this.getNextLineIndent = function(c, d, e) { - var a = this.$getIndent(d), b = this.$tokenizer.getLineTokens(d, c), g = b.tokens; - b = b.state; - if(g.length && g[g.length - 1].type == "comment") { - return a - }if(c == "start") { - if(c = d.match(/^.*[\{\(\[]\s*$/)) { - a += e - } - }else { - if(c == "doc-start") { - if(b == "start") { - return"" - }if(c = d.match(/^\s*(\/?)\*/)) { - if(c[1]) { - a += " " - }a += "* " - }if(c[1]) { - a += " " - }a += "* " - } - }return a - }; - this.checkOutdent = function(c, d, e) { - return this.$outdent.checkOutdent(d, e) - }; - this.autoOutdent = function(c, d, e) { - return this.$outdent.autoOutdent(d, e) - } - }).call(f.prototype); - return f -}); \ No newline at end of file diff --git a/build/ace/mode/javascript_highlight_rules.js b/build/ace/mode/javascript_highlight_rules.js deleted file mode 100644 index dbc502e7..00000000 --- a/build/ace/mode/javascript_highlight_rules.js +++ /dev/null @@ -1,16 +0,0 @@ -define(function(a) { - var e = a("../lib/oop"), c = a("../lib/lang"), f = a("./doc_comment_highlight_rules"); - a = a("./text_highlight_rules"); - JavaScriptHighlightRules = function() { - var d = new f, g = c.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")), h = c.arrayToMap("true|false|null|undefined|Infinity|NaN|undefined".split("|")), i = c.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|")); - this.$rules = {start:[{token:"comment", regex:"\\/\\/.*$"}, d.getStartRule("doc-start"), {token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string.regexp", regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:'["].*\\\\$', next:"qqstring"}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"string", regex:"['].*\\\\$", next:"qstring"}, {token:"constant.numeric", - regex:"0[xX][0-9a-fA-F]+\\b"}, {token:"constant.numeric", regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, {token:function(b) { - return b == "this" ? "variable.language" : g[b] ? "keyword" : h[b] ? "constant.language" : i[b] ? "invalid.illegal" : b == "debugger" ? "invalid.deprecated" : "identifier" - }, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(in|instanceof|new|delete|typeof|void)"}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}], qqstring:[{token:"string", regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next:"start"}, {token:"string", regex:".+"}]}; - this.addRules(d.getRules(), "doc-"); - this.$rules["doc-start"][0].next = "start" - }; - e.inherits(JavaScriptHighlightRules, a); - return JavaScriptHighlightRules -}); \ No newline at end of file diff --git a/build/ace/mode/matching_brace_outdent.js b/build/ace/mode/matching_brace_outdent.js deleted file mode 100644 index d6a9d5b4..00000000 --- a/build/ace/mode/matching_brace_outdent.js +++ /dev/null @@ -1,30 +0,0 @@ -define(function(e) { - var f = e("../range"); - e = function() { - }; - (function() { - this.checkOutdent = function(a, b) { - if(!/^\s+$/.test(a)) { - return false - }return/^\s*\}/.test(b) - }; - this.autoOutdent = function(a, b) { - var c = a.getLine(b).match(/^(\s*\})/); - if(!c) { - return 0 - }c = c[1].length; - var d = a.findMatchingBracket({row:b, column:c}); - if(!d || d.row == b) { - return 0 - }d = this.$getIndent(a.getLine(d.row)); - a.replace(new f(b, 0, b, c - 1), d); - return d.length - (c - 1) - }; - this.$getIndent = function(a) { - if(a = a.match(/^(\s+)/)) { - return a[1] - }return"" - } - }).call(e.prototype); - return e -}); \ No newline at end of file diff --git a/build/ace/mode/python.js b/build/ace/mode/python.js deleted file mode 100644 index 1df73e4d..00000000 --- a/build/ace/mode/python.js +++ /dev/null @@ -1,93 +0,0 @@ -define("ace/mode/python_highlight_rules", ["require", "exports", "module", "../lib/oop", "../lib/lang", "./text_highlight_rules"], function(a) { - var k = a("../lib/oop"), b = a("../lib/lang"); - a = a("./text_highlight_rules"); - PythonHighlightRules = function() { - var f = b.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), i = b.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), j = b.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")), - l = b.arrayToMap("".split("|")); - this.$rules = {start:[{token:"comment", regex:"#.*$"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}(?:(?:.)|(?:^"{3}))*?"{3}'}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}.*$', next:"qqstring"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}(?:(?:.)|(?:^'{3}))*?'{3}"}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}.*$", next:"qstring"}, {token:"string", - regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"}, {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"}, - {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"}, {token:function(c) { - return f[c] ? "keyword" : i[c] ? "constant.language" : l[c] ? "invalid.illegal" : j[c] ? "support.function" : c == "debugger" ? "invalid.deprecated" : "identifier" - }, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], qqstring:[{token:"string", regex:'(?:^"{3})*?"{3}', next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:^'{3})*?'{3}", next:"start"}, {token:"string", regex:".+"}]} - }; - k.inherits(PythonHighlightRules, a); - return PythonHighlightRules -}); -define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../range"], function(a) { - var k = a("../range"); - a = function() { - }; - (function() { - this.checkOutdent = function(b, f) { - if(!/^\s+$/.test(b)) { - return false - }return/^\s*\}/.test(f) - }; - this.autoOutdent = function(b, f) { - var i = b.getLine(f).match(/^(\s*\})/); - if(!i) { - return 0 - }i = i[1].length; - var j = b.findMatchingBracket({row:f, column:i}); - if(!j || j.row == f) { - return 0 - }j = this.$getIndent(b.getLine(j.row)); - b.replace(new k(f, 0, f, i - 1), j); - return j.length - (i - 1) - }; - this.$getIndent = function(b) { - if(b = b.match(/^(\s+)/)) { - return b[1] - }return"" - } - }).call(a.prototype); - return a -}); -define("ace/mode/python", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./python_highlight_rules", "./matching_brace_outdent", "../range"], function(a) { - var k = a("../lib/oop"), b = a("./text"), f = a("../tokenizer"), i = a("./python_highlight_rules"), j = a("./matching_brace_outdent"), l = a("../range"); - a = function() { - this.$tokenizer = new f((new i).getRules()); - this.$outdent = new j - }; - k.inherits(a, b); - (function() { - this.toggleCommentLines = function(c, e, g) { - var h = true; - c = /^(\s*)#/; - for(var d = g.start.row;d <= g.end.row;d++) { - if(!c.test(e.getLine(d))) { - h = false; - break - } - }if(h) { - h = new l(0, 0, 0, 0); - for(d = g.start.row;d <= g.end.row;d++) { - var m = e.getLine(d).replace(c, "$1"); - h.start.row = d; - h.end.row = d; - h.end.column = m.length + 2; - e.replace(h, m) - }return-2 - }else { - return e.indentRows(g, "#") - } - }; - this.getNextLineIndent = function(c, e, g) { - var h = this.$getIndent(e), d = this.$tokenizer.getLineTokens(e, c).tokens; - if(d.length && d[d.length - 1].type == "comment") { - return h - }if(c == "start") { - if(e.match(/^.*[\{\(\[\:]\s*$/)) { - h += g - } - }return h - }; - this.checkOutdent = function(c, e, g) { - return this.$outdent.checkOutdent(e, g) - }; - this.autoOutdent = function(c, e, g) { - return this.$outdent.autoOutdent(e, g) - } - }).call(a.prototype); - return a -}); \ No newline at end of file diff --git a/build/ace/mode/python_highlight_rules.js b/build/ace/mode/python_highlight_rules.js deleted file mode 100644 index cade2c71..00000000 --- a/build/ace/mode/python_highlight_rules.js +++ /dev/null @@ -1,15 +0,0 @@ -define(function(a) { - var d = a("../lib/oop"), c = a("../lib/lang"); - a = a("./text_highlight_rules"); - PythonHighlightRules = function() { - var e = c.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), f = c.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), g = c.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")), - h = c.arrayToMap("".split("|")); - this.$rules = {start:[{token:"comment", regex:"#.*$"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}(?:(?:.)|(?:^"{3}))*?"{3}'}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}.*$', next:"qqstring"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}(?:(?:.)|(?:^'{3}))*?'{3}"}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}.*$", next:"qstring"}, {token:"string", - regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"}, {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"}, - {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"}, {token:function(b) { - return e[b] ? "keyword" : f[b] ? "constant.language" : h[b] ? "invalid.illegal" : g[b] ? "support.function" : b == "debugger" ? "invalid.deprecated" : "identifier" - }, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], qqstring:[{token:"string", regex:'(?:^"{3})*?"{3}', next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:^'{3})*?'{3}", next:"start"}, {token:"string", regex:".+"}]} - }; - d.inherits(PythonHighlightRules, a); - return PythonHighlightRules -}); \ No newline at end of file diff --git a/build/ace/mode/text.js b/build/ace/mode/text.js deleted file mode 100644 index a6f218e6..00000000 --- a/build/ace/mode/text.js +++ /dev/null @@ -1,28 +0,0 @@ -define(function(a) { - var c = a("../tokenizer"), d = a("./text_highlight_rules"); - a = function() { - this.$tokenizer = new c((new d).getRules()) - }; - (function() { - this.getTokenizer = function() { - return this.$tokenizer - }; - this.toggleCommentLines = function() { - return 0 - }; - this.getNextLineIndent = function() { - return"" - }; - this.checkOutdent = function() { - return false - }; - this.autoOutdent = function() { - }; - this.$getIndent = function(b) { - if(b = b.match(/^(\s+)/)) { - return b[1] - }return"" - } - }).call(a.prototype); - return a -}); \ No newline at end of file diff --git a/build/ace/mode/text_highlight_rules.js b/build/ace/mode/text_highlight_rules.js deleted file mode 100644 index 848b6076..00000000 --- a/build/ace/mode/text_highlight_rules.js +++ /dev/null @@ -1,19 +0,0 @@ -define(function() { - var f = function() { - this.$rules = {start:[{token:"text", regex:".+"}]} - }; - (function() { - this.addRules = function(g, a) { - for(var b in g) { - for(var c = g[b], d = 0;d < c.length;d++) { - var e = c[d]; - e.next = e.next ? a + e.next : a + b - }this.$rules[a + b] = c - } - }; - this.getRules = function() { - return this.$rules - } - }).call(f.prototype); - return f -}); \ No newline at end of file diff --git a/build/ace/mode/xml.js b/build/ace/mode/xml.js deleted file mode 100644 index c99c913d..00000000 --- a/build/ace/mode/xml.js +++ /dev/null @@ -1,23 +0,0 @@ -define("ace/mode/xml_highlight_rules", ["require", "exports", "module", "../lib/oop", "./text_highlight_rules"], function(a) { - var c = a("../lib/oop"); - a = a("./text_highlight_rules"); - var b = function() { - this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", - next:"start"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"(?:[^\\]]|\\](?!\\]>))+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]} - }; - c.inherits(b, a); - return b -}); -define("ace/mode/xml", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./xml_highlight_rules"], function(a) { - var c = a("../lib/oop"), b = a("./text"), d = a("../tokenizer"), e = a("./xml_highlight_rules"); - a = function() { - this.$tokenizer = new d((new e).getRules()) - }; - c.inherits(a, b); - (function() { - this.getNextLineIndent = function(g, f) { - return this.$getIndent(f) - } - }).call(a.prototype); - return a -}); \ No newline at end of file diff --git a/build/ace/mode/xml_highlight_rules.js b/build/ace/mode/xml_highlight_rules.js deleted file mode 100644 index 89886e5e..00000000 --- a/build/ace/mode/xml_highlight_rules.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function(a) { - var c = a("../lib/oop"); - a = a("./text_highlight_rules"); - var b = function() { - this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", - next:"start"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"(?:[^\\]]|\\](?!\\]>))+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]} - }; - c.inherits(b, a); - return b -}); \ No newline at end of file diff --git a/build/ace/plugin_manager.js b/build/ace/plugin_manager.js deleted file mode 100644 index 0d8b92f2..00000000 --- a/build/ace/plugin_manager.js +++ /dev/null @@ -1,5 +0,0 @@ -define(function() { - return{commands:{}, registerCommand:function(a, b) { - this.commands[a] = b - }} -}); \ No newline at end of file diff --git a/build/ace/range.js b/build/ace/range.js deleted file mode 100644 index 504e370b..00000000 --- a/build/ace/range.js +++ /dev/null @@ -1,68 +0,0 @@ -define(function() { - var c = function(a, b, d, e) { - this.start = {row:a, column:b}; - this.end = {row:d, column:e} - }; - (function() { - this.toString = function() { - return"Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]" - }; - this.contains = function(a, b) { - return this.compare(a, b) == 0 - }; - this.compare = function(a, b) { - if(!this.isMultiLine()) { - if(a === this.start.row) { - return b < this.start.column ? -1 : b > this.end.column ? 1 : 0 - } - }if(a < this.start.row) { - return-1 - }if(a > this.end.row) { - return 1 - }if(this.start.row === a) { - return b >= this.start.column ? 0 : -1 - }if(this.end.row === a) { - return b <= this.end.column ? 0 : 1 - }return 0 - }; - this.clipRows = function(a, b) { - if(this.end.row > b) { - var d = {row:b + 1, column:0} - }if(this.start.row > b) { - var e = {row:b + 1, column:0} - }if(this.start.row < a) { - e = {row:a, column:0} - }if(this.end.row < a) { - d = {row:a, column:0} - }return c.fromPoints(e || this.start, d || this.end) - }; - this.extend = function(a, b) { - var d = this.compare(a, b); - if(d == 0) { - return this - }else { - if(d == -1) { - var e = {row:a, column:b} - }else { - var f = {row:a, column:b} - } - }return c.fromPoints(e || this.start, f || this.end) - }; - this.isEmpty = function() { - return this.start.row == this.end.row && this.start.column == this.end.column - }; - this.isMultiLine = function() { - return this.start.row !== this.end.row - }; - this.clone = function() { - return c.fromPoints(this.start, this.end) - }; - this.toScreenRange = function(a) { - return new c(this.start.row, a.documentToScreenColumn(this.start.row, this.start.column), this.end.row, a.documentToScreenColumn(this.end.row, this.end.column)) - } - }).call(c.prototype); - c.fromPoints = function(a, b) { - return new c(a.row, a.column, b.row, b.column) - }; - return c -}); \ No newline at end of file diff --git a/build/ace/renderloop.js b/build/ace/renderloop.js deleted file mode 100644 index fbd33510..00000000 --- a/build/ace/renderloop.js +++ /dev/null @@ -1,44 +0,0 @@ -define(function(d) { - var e = d("./lib/event"); - d = function(b) { - this.onRender = b; - this.pending = false; - this.changes = 0 - }; - (function() { - this.schedule = function(b) { - this.changes |= b; - if(!this.pending) { - this.pending = true; - var a = this; - this.setTimeoutZero(function() { - a.pending = false; - var c = a.changes; - a.changes = 0; - a.onRender(c) - }) - } - }; - if(window.postMessage) { - this.messageName = "zero-timeout-message"; - this.setTimeoutZero = function(b) { - if(!this.attached) { - var a = this; - e.addListener(window, "message", function(c) { - if(c.source == window && a.callback && c.data == a.messageName) { - e.stopPropagation(c); - a.callback() - } - }); - this.attached = true - }this.callback = b; - window.postMessage(this.messageName, "*") - } - }else { - this.setTimeoutZero = function(b) { - setTimeout(b, 0) - } - } - }).call(d.prototype); - return d -}); \ No newline at end of file diff --git a/build/ace/scrollbar.js b/build/ace/scrollbar.js deleted file mode 100644 index 7bcbfcb8..00000000 --- a/build/ace/scrollbar.js +++ /dev/null @@ -1,32 +0,0 @@ -define(function(a) { - var c = a("./lib/oop"), d = a("./lib/lang"), e = a("./lib/dom"), f = a("./lib/event"), g = a("./event_emitter"); - a = function(b) { - this.element = document.createElement("div"); - this.element.className = "ace_sb"; - this.inner = document.createElement("div"); - this.element.appendChild(this.inner); - b.appendChild(this.element); - this.width = e.scrollbarWidth(); - this.element.style.width = this.width; - f.addListener(this.element, "scroll", d.bind(this.onScroll, this)) - }; - (function() { - c.implement(this, g); - this.onScroll = function() { - this.$dispatchEvent("scroll", {data:this.element.scrollTop}) - }; - this.getWidth = function() { - return this.width - }; - this.setHeight = function(b) { - this.element.style.height = Math.max(0, b - this.width) + "px" - }; - this.setInnerHeight = function(b) { - this.inner.style.height = b + "px" - }; - this.setScrollTop = function(b) { - this.element.scrollTop = b - } - }).call(a.prototype); - return a -}); \ No newline at end of file diff --git a/build/ace/search.js b/build/ace/search.js deleted file mode 100644 index 507feec3..00000000 --- a/build/ace/search.js +++ /dev/null @@ -1,149 +0,0 @@ -define(function(o) { - var p = o("./lib/lang"), r = o("./lib/oop"), s = o("./range"), l = function() { - this.$options = {needle:"", backwards:false, wrap:false, caseSensitive:false, wholeWord:false, scope:l.ALL, regExp:false} - }; - l.ALL = 1; - l.SELECTION = 2; - (function() { - this.set = function(a) { - r.mixin(this.$options, a); - return this - }; - this.getOptions = function() { - return p.copyObject(this.$options) - }; - this.find = function(a) { - if(!this.$options.needle) { - return null - }var b = null; - (this.$options.backwards ? this.$backwardMatchIterator(a) : this.$forwardMatchIterator(a)).forEach(function(c) { - b = c; - return true - }); - return b - }; - this.findAll = function(a) { - if(!this.$options.needle) { - return[] - }var b = []; - (this.$options.backwards ? this.$backwardMatchIterator(a) : this.$forwardMatchIterator(a)).forEach(function(c) { - b.push(c) - }); - return b - }; - this.replace = function(a, b) { - var c = this.$assembleRegExp(), g = c.exec(a); - return g && g[0].length == a.length ? this.$options.regExp ? a.replace(c, b) : b : null - }; - this.$forwardMatchIterator = function(a) { - var b = this.$assembleRegExp(), c = this; - return{forEach:function(g) { - c.$forwardLineIterator(a).forEach(function(d, i, k) { - if(i) { - d = d.substring(i) - }var j = []; - d.replace(b, function(e) { - j.push({str:e, offset:i + arguments[arguments.length - 2]}); - return e - }); - for(d = 0;d < j.length;d++) { - var h = j[d]; - h = c.$rangeFromMatch(k, h.offset, h.str.length); - if(g(h)) { - return true - } - } - }) - }} - }; - this.$backwardMatchIterator = function(a) { - var b = this.$assembleRegExp(), c = this; - return{forEach:function(g) { - c.$backwardLineIterator(a).forEach(function(d, i, k) { - if(i) { - d = d.substring(i) - }var j = []; - d.replace(b, function(e, f) { - j.push({str:e, offset:i + f}); - return e - }); - for(d = j.length - 1;d >= 0;d--) { - var h = j[d]; - h = c.$rangeFromMatch(k, h.offset, h.str.length); - if(g(h)) { - return true - } - } - }) - }} - }; - this.$rangeFromMatch = function(a, b, c) { - return new s(a, b, a, b + c) - }; - this.$assembleRegExp = function() { - var a = this.$options.regExp ? this.$options.needle : p.escapeRegExp(this.$options.needle); - if(this.$options.wholeWord) { - a = "\\b" + a + "\\b" - }var b = "g"; - this.$options.caseSensitive || (b += "i"); - return new RegExp(a, b) - }; - this.$forwardLineIterator = function(a) { - function b(e) { - var f = a.getLine(e); - if(c && e == g.end.row) { - f = f.substring(0, g.end.column) - }return f - } - var c = this.$options.scope == l.SELECTION, g = a.getSelection().getRange(), d = a.getSelection().getCursor(), i = c ? g.start.row : 0, k = c ? g.start.column : 0, j = c ? g.end.row : a.getLength() - 1, h = this.$options.wrap; - return{forEach:function(e) { - for(var f = d.row, m = b(f), n = d.column, q = false;!e(m, n, f);) { - if(q) { - return - }f++; - n = 0; - if(f > j) { - if(h) { - f = i; - n = k - }else { - return - } - }if(f == d.row) { - q = true - }m = b(f) - } - }} - }; - this.$backwardLineIterator = function(a) { - var b = this.$options.scope == l.SELECTION, c = a.getSelection().getRange(), g = b ? c.end : c.start, d = b ? c.start.row : 0, i = b ? c.start.column : 0, k = b ? c.end.row : a.getLength() - 1, j = this.$options.wrap; - return{forEach:function(h) { - for(var e = g.row, f = a.getLine(e).substring(0, g.column), m = 0, n = false;!h(f, m, e);) { - if(n) { - return - }e--; - m = 0; - if(e < d) { - if(j) { - e = k - }else { - return - } - }if(e == g.row) { - n = true - }f = a.getLine(e); - if(b) { - if(e == d) { - m = i - }else { - if(e == k) { - f = f.substring(0, c.end.column) - } - } - } - } - }} - } - }).call(l.prototype); - return l -}); \ No newline at end of file diff --git a/build/ace/selection.js b/build/ace/selection.js deleted file mode 100644 index dbbb4ebc..00000000 --- a/build/ace/selection.js +++ /dev/null @@ -1,255 +0,0 @@ -define(function(d) { - var g = d("./lib/oop"), h = d("./lib/lang"), i = d("./event_emitter"), f = d("./range"); - d = function(a) { - this.doc = a; - this.clearSelection(); - this.selectionLead = {row:0, column:0} - }; - (function() { - g.implement(this, i); - this.isEmpty = function() { - return!this.selectionAnchor || this.selectionAnchor.row == this.selectionLead.row && this.selectionAnchor.column == this.selectionLead.column - }; - this.isMultiLine = function() { - if(this.isEmpty()) { - return false - }return this.getRange().isMultiLine() - }; - this.getCursor = function() { - return this.selectionLead - }; - this.setSelectionAnchor = function(a, b) { - a = this.$clipPositionToDocument(a, b); - if(this.selectionAnchor) { - if(this.selectionAnchor.row !== a.row || this.selectionAnchor.column !== a.column) { - this.selectionAnchor = a; - this.$dispatchEvent("changeSelection", {}) - } - }else { - this.selectionAnchor = a; - this.$dispatchEvent("changeSelection", {}) - } - }; - this.getSelectionAnchor = function() { - return this.selectionAnchor ? this.$clone(this.selectionAnchor) : this.$clone(this.selectionLead) - }; - this.getSelectionLead = function() { - return this.$clone(this.selectionLead) - }; - this.shiftSelection = function(a) { - if(this.isEmpty()) { - this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + a) - }else { - var b = this.getSelectionAnchor(), c = this.getSelectionLead(), e = this.isBackwards(); - if(!e || b.column !== 0) { - this.setSelectionAnchor(b.row, b.column + a) - }if(e || c.column !== 0) { - this.$moveSelection(function() { - this.moveCursorTo(c.row, c.column + a) - }) - } - } - }; - this.isBackwards = function() { - var a = this.selectionAnchor || this.selectionLead, b = this.selectionLead; - return a.row > b.row || a.row == b.row && a.column > b.column - }; - this.getRange = function() { - var a = this.selectionAnchor || this.selectionLead, b = this.selectionLead; - return this.isBackwards() ? f.fromPoints(b, a) : f.fromPoints(a, b) - }; - this.clearSelection = function() { - if(this.selectionAnchor) { - this.selectionAnchor = null; - this.$dispatchEvent("changeSelection", {}) - } - }; - this.selectAll = function() { - var a = this.doc.getLength() - 1; - this.setSelectionAnchor(a, this.doc.getLine(a).length); - this.$moveSelection(function() { - this.moveCursorTo(0, 0) - }) - }; - this.setSelectionRange = function(a, b) { - if(b) { - this.setSelectionAnchor(a.end.row, a.end.column); - this.selectTo(a.start.row, a.start.column) - }else { - this.setSelectionAnchor(a.start.row, a.start.column); - this.selectTo(a.end.row, a.end.column) - } - }; - this.$moveSelection = function(a) { - var b = false; - if(!this.selectionAnchor) { - b = true; - this.selectionAnchor = this.$clone(this.selectionLead) - }var c = this.$clone(this.selectionLead); - a.call(this); - if(c.row !== this.selectionLead.row || c.column !== this.selectionLead.column) { - b = true - }b && this.$dispatchEvent("changeSelection", {}) - }; - this.selectTo = function(a, b) { - this.$moveSelection(function() { - this.moveCursorTo(a, b) - }) - }; - this.selectToPosition = function(a) { - this.$moveSelection(function() { - this.moveCursorToPosition(a) - }) - }; - this.selectUp = function() { - this.$moveSelection(this.moveCursorUp) - }; - this.selectDown = function() { - this.$moveSelection(this.moveCursorDown) - }; - this.selectRight = function() { - this.$moveSelection(this.moveCursorRight) - }; - this.selectLeft = function() { - this.$moveSelection(this.moveCursorLeft) - }; - this.selectLineStart = function() { - this.$moveSelection(this.moveCursorLineStart) - }; - this.selectLineEnd = function() { - this.$moveSelection(this.moveCursorLineEnd) - }; - this.selectFileEnd = function() { - this.$moveSelection(this.moveCursorFileEnd) - }; - this.selectFileStart = function() { - this.$moveSelection(this.moveCursorFileStart) - }; - this.selectWordRight = function() { - this.$moveSelection(this.moveCursorWordRight) - }; - this.selectWordLeft = function() { - this.$moveSelection(this.moveCursorWordLeft) - }; - this.selectWord = function() { - var a = this.selectionLead; - this.setSelectionRange(this.doc.getWordRange(a.row, a.column)) - }; - this.selectLine = function() { - this.setSelectionAnchor(this.selectionLead.row, 0); - this.$moveSelection(function() { - this.moveCursorTo(this.selectionLead.row + 1, 0) - }) - }; - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0) - }; - this.moveCursorDown = function() { - this.moveCursorBy(1, 0) - }; - this.moveCursorLeft = function() { - if(this.selectionLead.column == 0) { - this.selectionLead.row > 0 && this.moveCursorTo(this.selectionLead.row - 1, this.doc.getLine(this.selectionLead.row - 1).length) - }else { - this.moveCursorBy(0, -1) - } - }; - this.moveCursorRight = function() { - if(this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) { - this.selectionLead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.selectionLead.row + 1, 0) - }else { - this.moveCursorBy(0, 1) - } - }; - this.moveCursorLineStart = function() { - var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a).slice(0, b).match(/^\s*/); - if(c[0].length == 0) { - this.moveCursorTo(a, this.doc.getLine(a).match(/^\s*/)[0].length) - }else { - c[0].length >= b ? this.moveCursorTo(a, 0) : this.moveCursorTo(a, c[0].length) - } - }; - this.moveCursorLineEnd = function() { - this.moveCursorTo(this.selectionLead.row, this.doc.getLine(this.selectionLead.row).length) - }; - this.moveCursorFileEnd = function() { - var a = this.doc.getLength() - 1, b = this.doc.getLine(a).length; - this.moveCursorTo(a, b) - }; - this.moveCursorFileStart = function() { - this.moveCursorTo(0, 0) - }; - this.moveCursorWordRight = function() { - var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a), e = c.substring(b); - this.doc.nonTokenRe.lastIndex = 0; - this.doc.tokenRe.lastIndex = 0; - if(b == c.length) { - this.moveCursorRight() - }else { - if(this.doc.nonTokenRe.exec(e)) { - b += this.doc.nonTokenRe.lastIndex; - this.doc.nonTokenRe.lastIndex = 0 - }else { - if(this.doc.tokenRe.exec(e)) { - b += this.doc.tokenRe.lastIndex; - this.doc.tokenRe.lastIndex = 0 - } - }this.moveCursorTo(a, b) - } - }; - this.moveCursorWordLeft = function() { - var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a); - c = h.stringReverse(c.substring(0, b)); - this.doc.nonTokenRe.lastIndex = 0; - this.doc.tokenRe.lastIndex = 0; - if(b == 0) { - this.moveCursorLeft() - }else { - if(this.doc.nonTokenRe.exec(c)) { - b -= this.doc.nonTokenRe.lastIndex; - this.doc.nonTokenRe.lastIndex = 0 - }else { - if(this.doc.tokenRe.exec(c)) { - b -= this.doc.tokenRe.lastIndex; - this.doc.tokenRe.lastIndex = 0 - } - }this.moveCursorTo(a, b) - } - }; - this.moveCursorBy = function(a, b) { - this.moveCursorTo(this.selectionLead.row + a, this.selectionLead.column + b) - }; - this.moveCursorToPosition = function(a) { - this.moveCursorTo(a.row, a.column) - }; - this.moveCursorTo = function(a, b) { - a = this.$clipPositionToDocument(a, b); - if(a.row !== this.selectionLead.row || a.column !== this.selectionLead.column) { - this.selectionLead = a; - this.$dispatchEvent("changeCursor", {data:this.getCursor()}) - } - }; - this.moveCursorUp = function() { - this.moveCursorBy(-1, 0) - }; - this.$clipPositionToDocument = function(a, b) { - var c = {}; - if(a >= this.doc.getLength()) { - c.row = Math.max(0, this.doc.getLength() - 1); - c.column = this.doc.getLine(c.row).length - }else { - if(a < 0) { - c.row = 0; - c.column = 0 - }else { - c.row = a; - c.column = Math.min(this.doc.getLine(c.row).length, Math.max(0, b)) - } - }return c - }; - this.$clone = function(a) { - return{row:a.row, column:a.column} - } - }).call(d.prototype); - return d -}); \ No newline at end of file diff --git a/build/ace/test/all.js b/build/ace/test/all.js deleted file mode 100644 index ece34003..00000000 --- a/build/ace/test/all.js +++ /dev/null @@ -1,4 +0,0 @@ -require({paths:{ace:"../src/ace"}}, ["ace/test/assertions", "ace/test/ChangeDocumentTest"], function(a) { - console.log(a); - alert("a " + a) -}); \ No newline at end of file diff --git a/build/ace/test/assertions.js b/build/ace/test/assertions.js deleted file mode 100644 index e69de29b..00000000 diff --git a/build/ace/test/change_document_test.js b/build/ace/test/change_document_test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/build/ace/test/document_test.js b/build/ace/test/document_test.js deleted file mode 100644 index 2e8f4bdd..00000000 --- a/build/ace/test/document_test.js +++ /dev/null @@ -1,153 +0,0 @@ -/* - LGPLv3 -*/ -require("../../../support/paths"); -var Document = require("../document"), UndoManager = require("../undomanager"), MockRenderer = require("./mockrenderer"), Range = require("../range"), assert = require("./assertions"), async = require("async"), Test = {"test: find matching opening bracket":function() { - var a = new Document(["(()(", "())))"]); - assert.position(a.findMatchingBracket({row:0, column:3}), 0, 1); - assert.position(a.findMatchingBracket({row:1, column:2}), 1, 0); - assert.position(a.findMatchingBracket({row:1, column:3}), 0, 3); - assert.position(a.findMatchingBracket({row:1, column:4}), 0, 0); - assert.equal(a.findMatchingBracket({row:1, column:5}), null) -}, "test: find matching closing bracket":function() { - var a = new Document(["(()(", "())))"]); - assert.position(a.findMatchingBracket({row:1, column:1}), 1, 1); - assert.position(a.findMatchingBracket({row:1, column:1}), 1, 1); - assert.position(a.findMatchingBracket({row:0, column:4}), 1, 2); - assert.position(a.findMatchingBracket({row:0, column:2}), 0, 2); - assert.position(a.findMatchingBracket({row:0, column:1}), 1, 3); - assert.equal(a.findMatchingBracket({row:0, column:0}), null) -}, "test: match different bracket types":function() { - var a = new Document(["({[", ")]}"]); - assert.position(a.findMatchingBracket({row:0, column:1}), 1, 0); - assert.position(a.findMatchingBracket({row:0, column:2}), 1, 2); - assert.position(a.findMatchingBracket({row:0, column:3}), 1, 1); - assert.position(a.findMatchingBracket({row:1, column:1}), 0, 0); - assert.position(a.findMatchingBracket({row:1, column:2}), 0, 2); - assert.position(a.findMatchingBracket({row:1, column:3}), 0, 1) -}, "test: move lines down":function() { - var a = new Document(["1", "2", "3", "4"]); - console.log(a.toString().replace(/\n/g, "\\n")); - a.moveLinesDown(0, 1); - console.log(a.toString().replace(/\n/g, "\\n")); - assert.equal(a.toString(), "3\n1\n2\n4"); - a.moveLinesDown(1, 2); - assert.equal(a.toString(), "3\n4\n1\n2"); - a.moveLinesDown(2, 3); - assert.equal(a.toString(), "3\n4\n1\n2"); - a.moveLinesDown(2, 2); - assert.equal(a.toString(), "3\n4\n2\n1") -}, "__test: move lines up":function() { - var a = new Document(["1", "2", "3", "4"]); - console.log(a.toString().replace(/\n/g, "\\n")); - a.moveLinesUp(2, 3); - console.log(a.toString().replace(/\n/g, "\\n")); - assert.equal(a.toString(), "1\n3\n4\n2"); - a.moveLinesUp(1, 2); - assert.equal(a.toString(), "3\n4\n1\n2"); - a.moveLinesUp(0, 1); - assert.equal(a.toString(), "3\n4\n1\n2"); - a.moveLinesUp(2, 2); - assert.equal(a.toString(), "3\n1\n4\n2") -}, "test: duplicate lines":function() { - var a = new Document(["1", "2", "3", "4"]); - a.duplicateLines(1, 2); - assert.equal(a.toString(), "1\n2\n3\n2\n3\n4") -}, "test: duplicate last line":function() { - var a = new Document(["1", "2", "3"]); - a.duplicateLines(2, 2); - assert.equal(a.toString(), "1\n2\n3\n3") -}, "test: duplicate first line":function() { - var a = new Document(["1", "2", "3"]); - a.duplicateLines(0, 0); - assert.equal(a.toString(), "1\n1\n2\n3") -}, "test: should handle unix style new lines":function() { - var a = new Document(["1", "2", "3"]); - assert.equal(a.toString(), "1\n2\n3") -}, "test: should handle windows style new lines":function() { - var a = new Document("1\r\n2\r\n3"); - a.setNewLineMode("unix"); - assert.equal(a.toString(), "1\n2\n3") -}, "test: set new line mode to 'windows' should use '\r\n' as new lines":function() { - var a = new Document("1\n2\n3"); - a.setNewLineMode("windows"); - assert.equal(a.toString(), "1\r\n2\r\n3") -}, "test: set new line mode to 'unix' should use '\n' as new lines":function() { - var a = new Document("1\r\n2\r\n3"); - a.setNewLineMode("unix"); - assert.equal(a.toString(), "1\n2\n3") -}, "test: set new line mode to 'auto' should detect the incoming nl type":function() { - var a = new Document("1\n2\n3"); - a.setNewLineMode("auto"); - assert.equal(a.toString(), "1\n2\n3"); - a = new Document("1\r\n2\r\n3"); - a.setNewLineMode("auto"); - assert.equal(a.toString(), "1\r\n2\r\n3"); - a.replace(new Range(0, 0, 2, 1), "4\n5\n6"); - assert.equal("4\n5\n6", a.toString()) -}, "__test: undo/redo for delete line":function() { - var a = new Document(["111", "222", "333"]), b = new UndoManager; - a.setUndoManager(b); - var d = a.toString(), c = new Editor(new MockRenderer, a); - c.removeLines(); - var e = a.toString(); - assert.equal(e, "222\n333"); - a.$informUndoManager.call(); - c.removeLines(); - var f = a.toString(); - assert.equal(f, "333"); - a.$informUndoManager.call(); - c.removeLines(); - c = a.toString(); - assert.equal(c, ""); - a.$informUndoManager.call(); - b.undo(); - a.$informUndoManager.call(); - assert.equal(a.toString(), f); - b.undo(); - a.$informUndoManager.call(); - assert.equal(a.toString(), e); - b.undo(); - a.$informUndoManager.call(); - assert.equal(a.toString(), d); - b.undo(); - a.$informUndoManager.call(); - assert.equal(a.toString(), d) -}, "test: convert document to screen coordinates":function() { - var a = new Document("01234\t567890\t1234"); - a.setTabSize(4); - assert.equal(a.documentToScreenColumn(0, 0), 0); - assert.equal(a.documentToScreenColumn(0, 4), 4); - assert.equal(a.documentToScreenColumn(0, 5), 5); - assert.equal(a.documentToScreenColumn(0, 6), 9); - assert.equal(a.documentToScreenColumn(0, 12), 15); - assert.equal(a.documentToScreenColumn(0, 13), 19); - a.setTabSize(2); - assert.equal(a.documentToScreenColumn(0, 0), 0); - assert.equal(a.documentToScreenColumn(0, 4), 4); - assert.equal(a.documentToScreenColumn(0, 5), 5); - assert.equal(a.documentToScreenColumn(0, 6), 7); - assert.equal(a.documentToScreenColumn(0, 12), 13); - assert.equal(a.documentToScreenColumn(0, 13), 15) -}, "test: convert document to scrren coordinates with leading tabs":function() { - var a = new Document("\t\t123"); - a.setTabSize(4); - assert.equal(a.documentToScreenColumn(0, 0), 0); - assert.equal(a.documentToScreenColumn(0, 1), 4); - assert.equal(a.documentToScreenColumn(0, 2), 8); - assert.equal(a.documentToScreenColumn(0, 3), 9) -}, "test: convert screen to document coordinates":function() { - var a = new Document("01234\t567890\t1234"); - a.setTabSize(4); - assert.equal(a.screenToDocumentColumn(0, 0), 0); - assert.equal(a.screenToDocumentColumn(0, 4), 4); - assert.equal(a.screenToDocumentColumn(0, 5), 5); - assert.equal(a.screenToDocumentColumn(0, 6), 5); - assert.equal(a.screenToDocumentColumn(0, 7), 5); - assert.equal(a.screenToDocumentColumn(0, 8), 5); - assert.equal(a.screenToDocumentColumn(0, 9), 6); - assert.equal(a.screenToDocumentColumn(0, 15), 12); - assert.equal(a.screenToDocumentColumn(0, 19), 13) -}}; -module.exports = require("async/test").testcase(Test); -module === require.main && module.exports.exec(); \ No newline at end of file diff --git a/build/ace/test/event_emitter_test.js b/build/ace/test/event_emitter_test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/build/ace/test/mockrenderer.js b/build/ace/test/mockrenderer.js deleted file mode 100644 index 54fe2288..00000000 --- a/build/ace/test/mockrenderer.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - LGPLv3 -*/ -define(function() { - MockRenderer = function(a) { - this.container = document.createElement("div"); - this.cursor = {row:0, column:0}; - this.visibleRowCount = a || 20; - this.layerConfig = {firstVisibleRow:0, lastVisibleRow:this.visibleRowCount} - }; - MockRenderer.prototype.getFirstVisibleRow = function() { - return this.layerConfig.firstVisibleRow - }; - MockRenderer.prototype.getLastVisibleRow = function() { - return this.layerConfig.lastVisibleRow - }; - MockRenderer.prototype.getContainerElement = function() { - return this.container - }; - MockRenderer.prototype.getMouseEventTarget = function() { - return this.container - }; - MockRenderer.prototype.setDocument = function(a) { - this.lines = a.lines - }; - MockRenderer.prototype.setTokenizer = function() { - }; - MockRenderer.prototype.updateCursor = function(a) { - this.cursor.row = a.row; - this.cursor.column = a.column - }; - MockRenderer.prototype.scrollCursorIntoView = function() { - if(this.cursor.row < this.layerConfig.firstVisibleRow) { - this.scrollToRow(this.cursor.row) - }else { - this.cursor.row > this.layerConfig.lastVisibleRow && this.scrollToRow(this.cursor.row) - } - }; - MockRenderer.prototype.scrollToRow = function(a) { - a = Math.min(this.lines.length - this.visibleRowCount, Math.max(0, a)); - this.layerConfig.firstVisibleRow = a; - this.layerConfig.lastVisibleRow = a + this.visibleRowCount - }; - MockRenderer.prototype.getScrollTopRow = function() { - return this.layerConfig.firstVisibleRow - }; - MockRenderer.prototype.draw = function() { - }; - MockRenderer.prototype.updateLines = function() { - }; - MockRenderer.prototype.addMarker = function() { - }; - MockRenderer.prototype.setBreakpoints = function() { - }; - MockRenderer.prototype.updateFull = function() { - }; - MockRenderer.prototype.showCursor = function() { - }; - MockRenderer.prototype.visualizeFocus = function() { - }; - return MockRenderer -}); \ No newline at end of file diff --git a/build/ace/test/mode/css_test.js b/build/ace/test/mode/css_test.js deleted file mode 100644 index d2a1eef8..00000000 --- a/build/ace/test/mode/css_test.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - LGPLv3 -*/ -require.def(["ace/Document", "ace/Range", "ace/mode/Css"], function(b, c, d) { - new TestCase("mode.CssTest", {setUp:function() { - this.mode = new d - }, "test: toggle comment lines should not do anything":function() { - var a = new b(" abc\ncde\nfg"), e = new c(0, 3, 1, 1); - this.mode.toggleCommentLines("start", a, e); - assertEquals(" abc\ncde\nfg", a.toString()) - }, "test: lines should keep indentation":function() { - assertEquals(" ", this.mode.getNextLineIndent("start", " abc", " ")); - assertEquals("\t", this.mode.getNextLineIndent("start", "\tabc", " ")) - }, "test: new line after { should increase indent":function() { - assertEquals(" ", this.mode.getNextLineIndent("start", " abc{", " ")); - assertEquals("\t ", this.mode.getNextLineIndent("start", "\tabc { ", " ")) - }, "test: no indent increase after { in a comment":function() { - assertEquals(" ", this.mode.getNextLineIndent("start", " /*{", " ")); - assertEquals(" ", this.mode.getNextLineIndent("start", " /*{ ", " ")) - }}) -}); \ No newline at end of file diff --git a/build/ace/test/mode/css_tokenizer_test.js b/build/ace/test/mode/css_tokenizer_test.js deleted file mode 100644 index 759dfb95..00000000 --- a/build/ace/test/mode/css_tokenizer_test.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - LGPLv3 -*/ -require.def(["ace/mode/Css"], function(b) { - new TestCase("mode.CssTest", {setUp:function() { - this.tokenizer = (new b).getTokenizer() - }, "test: tokenize pixel number":function() { - var a = this.tokenizer.getLineTokens("-12px", "start").tokens; - assertEquals(1, a.length); - assertEquals("number", a[0].type) - }, "test: tokenize hex3 color":function() { - var a = this.tokenizer.getLineTokens("#abc", "start").tokens; - assertEquals(1, a.length); - assertEquals("number", a[0].type) - }, "test: tokenize hex6 color":function() { - var a = this.tokenizer.getLineTokens("#abc012", "start").tokens; - assertEquals(1, a.length); - assertEquals("number", a[0].type) - }, "test: tokenize parens":function() { - var a = this.tokenizer.getLineTokens("{()}", "start").tokens; - assertEquals(3, a.length); - assertEquals("lparen", a[0].type); - assertEquals("text", a[1].type); - assertEquals("rparen", a[2].type) - }}) -}); \ No newline at end of file diff --git a/build/ace/test/mode/html_test.js b/build/ace/test/mode/html_test.js deleted file mode 100644 index 2af56ba6..00000000 --- a/build/ace/test/mode/html_test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - LGPLv3 -*/ -require.def(["ace/Document", "ace/Range", "ace/mode/Html"], function(b, c, d) { - new TestCase("mode.HtmlTest", {setUp:function() { - this.mode = new d - }, "test: toggle comment lines should not do anything":function() { - var a = new b([" abc", "cde", "fg"]), e = new c(0, 3, 1, 1); - this.mode.toggleCommentLines("start", a, e); - assertEquals(" abc\ncde\nfg", a.toString()) - }, "test: next line indent should be the same as the current line indent":function() { - assertEquals(" ", this.mode.getNextLineIndent("start", " abc")); - assertEquals("", this.mode.getNextLineIndent("start", "abc")); - assertEquals("\t", this.mode.getNextLineIndent("start", "\tabc")) - }}) -}); \ No newline at end of file diff --git a/build/ace/test/mode/html_tokenizer_test.js b/build/ace/test/mode/html_tokenizer_test.js deleted file mode 100644 index 3ed6b4b2..00000000 --- a/build/ace/test/mode/html_tokenizer_test.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - LGPLv3 -*/ -require.def(["ace/mode/Html"], function(b) { - new TestCase("mode.HtmlTest", {setUp:function() { - this.tokenizer = (new b).getTokenizer() - }, "test: tokenize embedded script":function() { - var a = this.tokenizer.getLineTokens(" + + + + + + + + + + + + + + + From d984ebbec4e879c36917ed3594fcacfe6de200e5 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 01:16:37 +0000 Subject: [PATCH 10/90] added temporary static web server --- static.py | 242 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 static.py diff --git a/static.py b/static.py new file mode 100644 index 00000000..774cbb9f --- /dev/null +++ b/static.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python2.4 +"""static - A stupidly simple WSGI way to serve static (or mixed) content. + +(See the docstrings of the various functions and classes.) + +Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/ + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to: + +The Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. + +Luke Arno can be found at http://lukearno.com/ + +""" + +import mimetypes +import rfc822 +import time +import string +import sys +from os import path, stat, getcwd +from wsgiref import util +from wsgiref.headers import Headers +from wsgiref.simple_server import make_server +from optparse import OptionParser + +try: from pkg_resources import resource_filename, Requirement +except: pass + +try: import kid +except: pass + + +class MagicError(Exception): pass + + +class StatusApp: + """Used by WSGI apps to return some HTTP status.""" + + def __init__(self, status, message=None): + self.status = status + if message is None: + self.message = status + else: + self.message = message + + def __call__(self, environ, start_response, headers=[]): + if self.message: + Headers(headers).add_header('Content-type', 'text/plain') + start_response(self.status, headers) + if environ['REQUEST_METHOD'] == 'HEAD': + return [""] + else: + return [self.message] + + +class Cling(object): + """A stupidly simple way to serve static content via WSGI. + + Serve the file of the same path as PATH_INFO in self.datadir. + + Look up the Content-type in self.content_types by extension + or use 'text/plain' if the extension is not found. + + Serve up the contents of the file or delegate to self.not_found. + """ + + block_size = 16 * 4096 + index_file = 'index.html' + not_found = StatusApp('404 Not Found') + not_modified = StatusApp('304 Not Modified', "") + moved_permanently = StatusApp('301 Moved Permanently') + method_not_allowed = StatusApp('405 Method Not Allowed') + + def __init__(self, root, **kw): + """Just set the root and any other attribs passes via **kw.""" + self.root = root + for k, v in kw.iteritems(): + setattr(self, k, v) + + def __call__(self, environ, start_response): + """Respond to a request when called in the usual WSGI way.""" + if environ['REQUEST_METHOD'] not in ('GET', 'HEAD'): + headers = [('Allow', 'GET, HEAD')] + return self.method_not_allowed(environ, start_response, headers) + path_info = environ.get('PATH_INFO', '') + full_path = self._full_path(path_info) + if not self._is_under_root(full_path): + return self.not_found(environ, start_response) + if path.isdir(full_path): + if full_path[-1] <> '/' or full_path == self.root: + location = util.request_uri(environ, include_query=False) + '/' + if environ.get('QUERY_STRING'): + location += '?' + environ.get('QUERY_STRING') + headers = [('Location', location)] + return self.moved_permanently(environ, start_response, headers) + else: + full_path = self._full_path(path_info + self.index_file) + content_type = self._guess_type(full_path) + try: + etag, last_modified = self._conditions(full_path, environ) + headers = [('Date', rfc822.formatdate(time.time())), + ('Last-Modified', last_modified), + ('ETag', etag)] + if_modified = environ.get('HTTP_IF_MODIFIED_SINCE') + if if_modified and (rfc822.parsedate(if_modified) + >= rfc822.parsedate(last_modified)): + return self.not_modified(environ, start_response, headers) + if_none = environ.get('HTTP_IF_NONE_MATCH') + if if_none and (if_none == '*' or etag in if_none): + return self.not_modified(environ, start_response, headers) + file_like = self._file_like(full_path) + headers.append(('Content-Type', content_type)) + start_response("200 OK", headers) + if environ['REQUEST_METHOD'] == 'GET': + return self._body(full_path, environ, file_like) + else: + return [''] + except (IOError, OSError), e: + print e + return self.not_found(environ, start_response) + + def _full_path(self, path_info): + """Return the full path from which to read.""" + return self.root + path_info + + def _is_under_root(self, full_path): + """Guard against arbitrary file retrieval.""" + if (path.abspath(full_path) + path.sep)\ + .startswith(path.abspath(self.root) + path.sep): + return True + else: + return False + + def _guess_type(self, full_path): + """Guess the mime type using the mimetypes module.""" + return mimetypes.guess_type(full_path)[0] or 'text/plain' + + def _conditions(self, full_path, environ): + """Return a tuple of etag, last_modified by mtime from stat.""" + mtime = stat(full_path).st_mtime + return str(mtime), rfc822.formatdate(mtime) + + def _file_like(self, full_path): + """Return the appropriate file object.""" + return open(full_path, 'rb') + + def _body(self, full_path, environ, file_like): + """Return an iterator over the body of the response.""" + way_to_send = environ.get('wsgi.file_wrapper', iter_and_close) + return way_to_send(file_like, self.block_size) + + +def iter_and_close(file_like, block_size): + """Yield file contents by block then close the file.""" + while 1: + try: + block = file_like.read(block_size) + if block: yield block + else: raise StopIteration + except StopIteration, si: + file_like.close() + return + + +def cling_wrap(package_name, dir_name, **kw): + """Return a Cling that serves from the given package and dir_name. + + This uses pkg_resources.resource_filename which is not the + recommended way, since it extracts the files. + + I think this works fine unless you have some _very_ serious + requirements for static content, in which case you probably + shouldn't be serving it through a WSGI app, IMHO. YMMV. + """ + resource = Requirement.parse(package_name) + return Cling(resource_filename(resource, dir_name), **kw) + + +def command(): + parser = OptionParser(usage="%prog DIR [HOST][:][PORT]", + version="static 0.3.6") + options, args = parser.parse_args() + if len(args) in (1, 2): + if len(args) == 2: + parts = args[1].split(":") + if len(parts) == 1: + host = parts[0] + port = None + elif len(parts) == 2: + host, port = parts + else: + sys.exit("Invalid host:port specification.") + elif len(args) == 1: + host, port = None, None + if not host: + host = '0.0.0.0' + if not port: + port = 9999 + try: + port = int(port) + except: + sys.exit("Invalid host:port specification.") + app = Cling(args[0]) + try: + make_server(host, port, app).serve_forever() + except KeyboardInterrupt, ki: + print "Cio, baby!" + except: + sys.exit("Problem initializing server.") + else: + parser.print_help(sys.stderr) + sys.exit(1) + + +def test(): + from wsgiref.validate import validator + app = Cling(getcwd()) + try: + print "Serving " + getcwd() + " to http://localhost:9999" + make_server('localhost', 9999, validator(app)).serve_forever() + except KeyboardInterrupt, ki: + print "" + print "Ciao, baby!" + + +if __name__ == '__main__': + test() + From da32d7dc3604d9cfbe3c033f6e9aa9f97e18a53a Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 01:18:58 +0000 Subject: [PATCH 11/90] adding new dryice build files --- Makefile.dryice.js | 1087 ++++++++++++++++++++++++++++++++++++++++++ demo/mini_require.js | 49 ++ 2 files changed, 1136 insertions(+) create mode 100644 Makefile.dryice.js create mode 100644 demo/mini_require.js diff --git a/Makefile.dryice.js b/Makefile.dryice.js new file mode 100644 index 00000000..bde697d0 --- /dev/null +++ b/Makefile.dryice.js @@ -0,0 +1,1087 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +//var copy = require('dryice').copy; +var copy = internalRequire('dryice').copy; + +var aceHome = __dirname; + +var buildStep = copy.createDataObject(); + +// The Javascript files that don't need unwrapping +copy({ + source: [ 'demo/mini_require.js' ], + dest: buildStep +}); + +// JS files that we tweak the define lines on +copy({ + source: [ + { + root: aceHome + '/support/cockpit/support/pilot/lib', + include: /.*\.js$/, + exclude: /tests?\// + }, + { + root: aceHome + '/support/cockpit/lib', + include: /.*\.js$/, + exclude: /tests?\// + }, + { + root: aceHome + '/lib', + include: /.*\.js$/, + exclude: /tests?\// + } + ], + filter: [ copy.filter.moduleDefines ], + dest: buildStep +}); + +// The startup file +copy({ + source: { base: aceHome + '/demo/', path: 'demo_startup.js' }, + filter: [ copy.filter.moduleDefines ], + dest: buildStep +}); + +// The CSS files +copy({ + source: [ + { + root: aceHome + '/support/cockpit/support/pilot/lib', + include: /.*\.css$/, + exclude: /tests?\// + }, + { + root: aceHome + '/support/cockpit/lib', + include: /.*\.css$/, + exclude: /tests?\// + }, + { + root: aceHome + '/lib', + include: /.*\.css$/, + exclude: /tests?\// + } + ], + filter: [ copy.filter.addDefines ], + dest: buildStep +}); + +/* +// The graphics files +copy({ + source: sources.map(function(source) { + return { root: aceHome, include: source + '/.*\\.png$' }; + }, this), + filter: [ copy.filter.base64, copy.filter.addDefines ], + dest: buildStep +}); +*/ + +// The Javascript files that don't need unwrapping +copy({ + source: [ 'demo/boot.js' ], + dest: buildStep +}); + +// Create the compressed and uncompressed output files +/* +copy({ + source: buildStep, + filter: copy.filter.uglifyjs, + dest: 'build/ace.js' +}); +*/ +copy({ + source: buildStep, + dest: 'build/ace-uncompressed.js' +}); + + + +function internalRequire(ignore) { +var exports = {}; + + + +var fs = require("fs"); +var ujs = require("uglify-js"); + +/** + * Dryice is ant for javascript + * @param obj An object that contains source, dest and (optionally) filter objects + * source must be one of: + * - string: a file to read (later a directory too) + * - a data object like { value:OUTPUT_DATA } + * - a findObj like { root:DIR, include:RegExp|[RegExp], exclude:RegExp|[RegExp] } + * - a baseObj like { base:BASE, path:PATH } where BASE+PATH = filename + * (this method allows use of commonjs filters) + * - an array containing entries like the 3 above + * - a function which returns one of the 4 above + * dest must be either a string (pointing to a file) or a data object + */ +function copy(obj) { + // Gather a list of all the input sources + addSource(obj, obj.source); + + // Concatenate all the input sources + var value = ''; + obj.sources.forEach(function(source) { + value += source.value; + }, this); + + // Run filters where onRead=false + value = runFilters(value, obj.filter, false); + + // Output + // TODO: for now we're ignoring the concept of directory destinations. + if (typeof obj.dest.value === 'string') { + obj.dest.value += value; + } + else if (typeof obj.dest === 'string') { + fs.writeFileSync(obj.dest, value); + } + else { + throw new Error('Can\'t handle type of dest: ' + typeof obj.dest); + } +} + +function addName(currentName, newName) { + return currentName === null ? currentName : newName; +} + +function addSource(obj, source) { + if (!obj.sources) { + obj.sources = []; + } + + if (typeof source === 'function') { + addSource(obj, source()); + } + else if (Array.isArray(source)) { + source.forEach(function(s) { + addSource(obj, s); + }, this); + } + else if (source.root) { + copy.findFiles(obj, source); + } + else if (source.base) { + addSourceBase(obj, source); + } + else if (typeof source === 'string') { + addSourceFile(obj, source); + } + else if (typeof source.value === 'string') { + if (!source.filtered) { + source.value = runFilters(source.value, obj.filter, true, source.name); + source.filtered = true; + } + obj.sources.push(source); + } + else { + throw new Error('Can\'t handle type of source: ' + typeof source); + } +} + +function addSourceFile(obj, filename) { + var read = fs.readFileSync(filename).toString(); + obj.sources.push({ + name: filename, + value: runFilters(read, obj.filter, true, filename) + }); +} + +function addSourceBase(obj, baseObj) { + var read = fs.readFileSync(baseObj.base + baseObj.path).toString(); + obj.sources.push({ + name: baseObj, + value: runFilters(read, obj.filter, true, baseObj) + }); +} + +function runFilters(value, filter, reading, name) { + if (!filter) { + return value; + } + + if (Array.isArray(filter)) { + filter.forEach(function(f) { + value = runFilters(value, f, reading, name); + }, this); + return value; + } + + if (filter.onRead == reading) { + return filter(value, name); + } + else { + return value; + } +} + +/** + * A holder is an in-memory store of a result of a copy operation. + *
+ * var holder = copy.createDataObject();
+ * copy({ source: 'x.txt', dest: holder });
+ * copy({ source: 'y.txt', dest: holder });
+ * copy({ source: holder, dest: 'z.txt' });
+ * 
+ */ +copy.createDataObject = function() { + return { value: '' }; +}; + +/** + * An object that contains include and exclude object + */ +copy.findFiles = function(obj, findObj) { + if (!findObj.filter) { + findObj.filter = createFilterFromRegex(findObj); + } + if (!findObj.path) { + findObj.path = ''; + } + + if (findObj.root.length > 0 && findObj.root.substr(-1) !== '/') { + findObj.root += '/'; + } + var path = findObj.path; + if (path.length > 0 && path.substr(-1) !== '/') { + path += '/'; + } + + fs.readdirSync(findObj.root + findObj.path).forEach(function(entry) { + var stat = fs.statSync(findObj.root + path + entry); + if (stat.isFile()) { + if (findObj.filter(path + entry)) { + addSourceBase(obj, { + base: findObj.root, + path: path + entry + }); + } + } + else if (stat.isDirectory()) { + findObj.path = path + entry; + copy.findFiles(obj, findObj); + } + }, this); +}; + +function createFilterFromRegex(obj) { + return function(path) { + function noPathMatch(pattern) { + return !pattern.test(path); + } + if (obj.include instanceof RegExp) { + if (noPathMatch(obj.include)) { + return false; + } + } + if (typeof obj.include === 'string') { + if (noPathMatch(new RegExp(obj.include))) { + return false; + } + } + if (Array.isArray(obj.include)) { + if (obj.include.every(noPathMatch)) { + return false; + } + } + + function pathMatch(pattern) { + return pattern.test(path); + } + if (obj.exclude instanceof RegExp) { + if (pathMatch(obj.exclude)) { + return false; + } + } + if (typeof obj.exclude === 'string') { + if (pathMatch(new RegExp(obj.exclude))) { + return false; + } + } + if (Array.isArray(obj.exclude)) { + if (obj.exclude.some(pathMatch)) { + return false; + } + } + + return true; + }; +} + +/** + * File filters + */ +copy.filter = {}; + +/** + * Compress the given input code using UglifyJS. + * + * @param string input + * @return string output + */ +copy.filter.uglifyjs = function(input) { + var opt = copy.filter.uglifyjs.options; + var ast = ujs.parser.parse(input, opt.parse_strict_semicolons); + + if (opt.mangle) { + ast = ujs.uglify.ast_mangle(ast, opt.mangle_toplevel); + } + + if (opt.squeeze) { + ast = ujs.uglify.ast_squeeze(ast, opt.squeeze_options); + if (opt.squeeze_more) { + ast = ujs.uglify.ast_squeeze_more(ast); + } + } + + return ujs.uglify.gen_code(ast, opt.beautify); +}; +copy.filter.uglifyjs.onRead = false; +/** + * UglifyJS filter options. + */ +copy.filter.uglifyjs.options = { + parse_strict_semicolons: false, + + /** + * The beautify argument used for process.gen_code(). See the UglifyJS + * documentation. + */ + beautify: false, + mangle: true, + mangle_toplevel: false, + squeeze: true, + + /** + * The options argument used for process.ast_squeeze(). See the UglifyJS + * documentation. + */ + squeeze_options: {}, + + /** + * Tells if you want to perform potentially unsafe compression. + */ + squeeze_more: false +}; + +/** + * A filter to munge CommonJS headers + */ +copy.filter.addDefines = function(input, source) { + if (!source) { + throw new Error('Missing filename for moduleDefines'); + } + + if (source.base) { + source = source.path; + } + + var module = source.replace(/\.css$/, ''); + + input = input.replace(/"/g, '\\"'); + input = '"' + input.replace(/\n/g, '" +\n "') + '"'; + + return 'define("text!' + source.toString() + '", ' + input + ');\n\n'; +}; +copy.filter.addDefines.onRead = true; + +/** + * + */ +copy.filter.base64 = function() { + +}; +copy.filter.base64.onRead = true; + +/** + * + */ +copy.filter.moduleDefines = function(input, source) { + if (!source) { + throw new Error('Missing filename for moduleDefines'); + } + + if (source.base) { + source = source.path; + } + + var module = source.replace(/\.js$/, ''); + + return input.replace(/\bdefine\(\s*function\(require,\s*exports,\s*module\)\s*\{/, + "define('" + module + "', function(require, exports, module) {"); +}; +copy.filter.moduleDefines.onRead = true; + + +exports.copy = copy; + + + + + + + + + + + + + +/* +// copy a single file +copy({ source: 'foo.txt', dest: 'bar.txt' }); + +// copy a directory +copy({ source: 'foo', dest: 'bar' }); + +// cat a bunch of files together +copy({ source: [ 'file1.js', 'file2.js' ], dest: 'output.js' }); + +// cat files together using a glob pattern +copy({ source: /.js$/, dest: 'built.js' }); + +// cat together a custom set of files +copy({ + source: function() { + var files = [ 'file1.js' ]; + if (baz) files.push('file2.js'); + return files; + }, + dest: 'built.js' +}); + +// some utils are available to custom functions +copy({ + source: function() { + var files = filesMatching(/.js$/); + arrayRemove(files, 'broken.js'); + return files; + }, + dest: 'built.js' +}); + +// maybe one day we could add multiple destinations +copy({ + source: /src/.*\.js$/, + dest: [ /\(*\)\.js$/, '\1.js.bak' ] +}); + +// use a filter while copying +copy({ + source: /src/.*\.js$/, + filter: compressor, + dest: 'built.js' +}); + +// and you can have multiple (custom) filters +copy({ + source: /src/.*\.js$/, + filter: [ + compressor, + function(name, data) { + return 'wibble'; + } + ], + dest: 'built.js' +}); + +// I think it's possible to see a huge array of operations in these terms. +// I'm not suggesting you implement these, just demoing what the API could do +copy({ + source: '**', + filter: [ zip ], + dest: 'scp://example.com/upload/myproject-0.1.zip' +}); + +copy({ + source: /src/.*\.java$/, + filter: javac, + dest: [ /\(*\)\.java$/, '\1.class' ], + comment: 'only joking' +}); +*/ + +return exports; +}; + + + + + +var sys = require("sys"); +var fs = require("fs"); +var path = require("path"); +var util = require("util"); +var Step = require("step"); + + +function copy0(options, callback) { + var source = options.source; + var data = ""; + + if (typeof source == "function") { + source = source(options); + } + + if (typeof source == "string") { + source = [source]; + } else if (typeof options.source == "object") { + data = source.value || ""; + } + + var filters = options.filter || []; + if (typeof filters == "function") { + filters = [filters]; + } + + if (typeof dest == "string") { + var stat = fs.statSync(); + } + + // read the files + if (Array.isArray(source)) { + source.forEach(function(file) { + var stat = fs.statSync(file); + var result = fs.readFileSync(file); + + // execute the filters + filters.forEach(function(filter) { + filter(input, file); + }); + + data += result + "\n"; + }); + } + + // save the output + var dest = options.dest; + if (typeof dest == "string") { + fs.writeFileSync(dest, data); + } else { + dest.value = data; + } +} + + +var Builder = function Builder(appFolder) { + this.appFolder = appFolder; +}; + +Builder.prototype = { + DEBUG: false, + + /** + * Web application folder - the location where scripts, styles and resources + * are fetched from. + */ + appFolder: ".", + + /** + * Target build folder - the location where the packaged web application is + * saved to. + */ + buildFolder: "./build", + + /** + * The default folder and file modes (permissions for chmod). + */ + folderMode: 0755, + fileMode: 0644, + + /** + * Array holding regular expression patterns. When you add entire folders to + * your build you might want to skip certain files. + */ + ignoreFiles: [], + + log: sys.puts, + + debug: function(message) { + if (this.DEBUG) { + this.log(message); + } + }, + + /** + * Sets and creates the target build folder, asynchronously. + * + * @param string folder + * Tells the target folder where you want to save the packaged web + * application. + * + * @param function callback + * The callback you want executed after the folder is created. + * Callback arguments: + * string|Exception|Error error - Holds the error that occurred + * while trying to set the build folder. This is undefined|null + * when the operation was successful. + * + * Builder build - holds a reference to the build instance. + */ + setBuildFolder: function Builder_setBuildFolder(newFolder, callback) + { + var self = this; + + Step( + function checkFolder() { + path.exists(newFolder, this); + }, + + function makeFolder(exists) { + if (!exists) { + fs.mkdir(newFolder, self.folderMode, this); + } else { + return true; + } + }, + + function folderReady(err) { + if (!err) { + self.buildFolder = newFolder; + } + callback(err, self); + } + ); + }, + + /** + * Copy files from the web application folder to the target build folder. + * + * @param object|array|string aFiles + * Holds the list of files you want to copy to the target build + * folder. If this is a string, you copy only one file. If the + * argument is given as an object, keys are considered source files + * and values are considered target files - this allows you to copy + * files to different locations in the build folder, without + * maintaining the same structure as in the original folder. + * @param function callback + * The callback you want executed after the files are copied. The + * callback arguments are the same as for setBuildFolder(). + * @returns void + */ + copyFiles: function Builder_copyFiles(aFiles, callback) + { + var files = {}; + if (typeof aFiles == "string") { + files[aFiles] = aFiles; + } else if (Array.isArray(aFiles)) { + aFiles.forEach(function(file) { + files[file] = file; + }); + } else { + files = aFiles; + } + + var self = this; + + Step( + function copyFiles() { + var group = this.group(); + for (var file in files) { + fs_copyFile(self.appFolder + "/" + file, + self.buildFolder + "/" + files[file], + group()); + } + }, + + function filesReady(err) { + callback(err, self); + } + ); + }, + + /** + * Copy folders from the web application folder to the target build folder. + * + * @param object|array|string aFolders + * Holds the list of folders you want to copy to the target build + * folder. If this is a string, you copy only one folder. If the + * argument is given as an object, keys are considered source folders + * and values are considered target folders - this allows you to copy + * folders to different locations in the build folder, without + * maintaining the same structure as in the original folder. + * @param function callback + * The callback you want executed after the folders are copied. The + * callback arguments are the same as for setBuildFolder(). + * @param boolean [recursive=true] + * (Optional) True if you want to copy subfolders as well, false if + * you want to copy only the files contained in the folders given. + * Default is true. + * @returns void + */ + copyFolders: function Builder_copyFolders(aFolders, callback, recursive) + { + var folders = {}; + if (typeof aFolders == "string") { + folders[aFolders] = aFolders; + } else if (Array.isArray(aFolders)) { + folders.forEach(function(folder) { + folders[folder] = folder; + }); + } else { + folders = aFolders; + } + if (typeof recursive == "undefined") { + recursive = true; + } + + var self = this; + + Step( + function copyFolders() { + var group = this.group(); + for (var folder in folders) { + self.copyFolder(folder, folders[folder], group(), recursive); + } + }, + function foldersReady(err) { + callback(err, self); + } + ); + }, + + /** + * Copy one folder from the web application folder to the target build + * folder. + * + * @param string source + * The folder you want to copy. + * @param string [destination=source] + * The destination folder. By default this is the same as the source, + * but in the buildFolder. You can change the destination, relative + * to the buildFolder. + * @param function callback + * The callback you want executed after the folder is copied. The + * callback arguments are the same as for setBuildFolder(). + * @param boolean [recursive=true] + * (Optional) True if you want to copy the subfolders as well, false + * if you want to copy only the files contained in the given source + * folder. Default is true. + * @returns void + */ + copyFolder: function Builder_copyFolder() + { + var source, destination, recursive, callback; + switch (arguments.length) { + case 2: // source, callback + source = destination = arguments[0]; + callback = arguments[1]; + recursive = true; + break; + case 3: + // source, callback, recursive + // OR source, destination, callback + source = arguments[0]; + if (typeof arguments[1] == "function") { + destination = source; + callback = arguments[1]; + recursive = arguments[2]; + } else { + destination = arguments[1]; + callback = arguments[2]; + recursive = true; + } + break; + case 4: // source, destination, callback, recursive + source = arguments[0]; + destination = arguments[1]; + callback = arguments[2]; + recursive = arguments[3]; + break; + default: + throw new Error("Invalid arguments."); + } + + var self = this; + + // result from fs.readdir(), without . and .. + var readdir_files = []; + + var files = []; + var subfolders = []; + + Step( + function checkDestination() { + path.exists(self.buildFolder + "/" + destination, this); + }, + + function mkdir_destination(exists) { + if (!exists) { + fs.mkdir(self.buildFolder + "/" + destination, this); + } else { + return true; + } + }, + + function readdir_source(err) { + if (err) { + throw err; + } + + // find the files in the given source folder. + fs.readdir(self.appFolder + "/" + source, this); + }, + + function statFiles(err, result) { + if (err) { + throw err; + } + + var group = this.group(); + result.forEach(function(file) { + if (file != "." && file != ".." && + !self.shouldSkipFile("/" + source + "/" + file)) { + fs.stat(file, group()); + readdir_files.push(file); + } + }); + }, + + function copyFiles(err, stats) { + if (err) { + throw err; + } + + // separate files out from folders + stats.forEach(function(stat, index) { + if (stat.isDirectory()) { + subfolders.push(readdir_files[index]); + } else if (stat.isFile()) { + files.push(readdir_files[index]); + } + }); + + // copy the files + var group = this.group(); + files.forEach(function(file) { + fs_copyFile(self.appFolder + "/" + source + "/" + file, + self.buildFolder + "/" + destination + "/" + file, + group()); + }); + }, + + function copySubfolders(err) { + if (err) { + throw err; + } + + if (!recursive) { + return true; + } + + var group = this.group(); + subfolders.forEach(function(folder) { + self.copyFolder(source + "/" + folder, + destination + "/" + folder, + group(), true); + }); + }, + + function copyDone(err) { + callback(err, self); + } + ); + }, + + /** + * Tells if this builder should ignore a file, given the file name. The + * this.ignoreFiles array of regular expression patterns is used. + * + * @param string filename + * @returns boolean + * True if the file should be ignored, or false otherwise. + */ + shouldSkipFile: function Builder_shouldSkipFile(filename) + { + return this.ignoreFiles.some(function(pattern) { + return pattern.test(filename); + }); + } +}; + +Builder.executeManifest = function Builder_executeManifest(manifest, callback) { + return; // stub +}; + +var Script = function Script(build, filename) { + if (!build) { + throw new Error("The first argument must reference a dryice.Builder instance."); + } else if (!filename) { + throw new Error("The second argument must be the script file name."); + } + + this.build = build; + this.filename = filename; +}; + +Script.prototype = { + inputEncoding: "utf8", + outputEncoding: "utf8", + + /** + * List of functions or filter names that process each input file. + */ + inputFilters: [], + + /** + * List of functions or filter names that process the concatenated output + * file. + */ + outputFilters: [], + + /** + * Add files to the compiled script. + * + * @param array|string files + * @param function callback + * @returns void + */ + addFiles: function Builder_addFiles(files, callback) { + if (typeof files == "string") { + files = [files]; + } + + var self = this; + + Step( + function readFiles() { + var group = this.group(); + + files.forEach(function(file) { + fs.readFile(self.build.appFolder + "/" + file, + self.inputEncoding, group()); + }); + }, + + function filterFiles(err, data) { + if (err) { + throw err; + } + + for (var i = 0; i < data.length; i++) { + data[i] = self.executeFilters(self.inputFilters, data[i], + files[i]); + } + + self.output += data.join("\n"); + + return self; + }, + + callback + ); + }, + + run: function Builder_run(buildCallback) { + var self = this; + + Step( + function readFiles() { + var group = this.group(); + + self.input_files.forEach(function(file) { + fs.readFile(self.basedir + "/" + file, + self.input_encoding, group()); + }); + }, + + function filterInput(err, files) { + if (err) { + throw err; + } + + for (var i = 0; i < files.length; i++) { + files[i] = self.run_filters(self.input_filters, files[i], + self.input_files[i]); + } + + return files; + }, + + function postProcessOutput(err, output) { + if (err) { + throw err; + } + + output = output.join("\n"); + output = self.run_filters(self.output_filters, output); + + if (typeof self.output_file == "string") { + fs.writeFile(self.basedir + "/" + self.output_file, + output, self.output_encoding, this); + } else { + self.output_file.write(output); + self.output_file.end(); + return 1; + } + }, + + function buildComplete(err) { + buildCallback(err, self); + } + ); + }, + + /** + * Given an array of filters (functions or filter names), invoke these + * filters on the given input content. + * + * @param array filters + * @param string input + * @param string [filename] + * Optional filename, useful for some filters. + * @return string + * Final filtered output. + */ + executeFilters: function(filters, input, filename) { + filters.forEach(function(filter) { + if (typeof filter == "string") { + input = input_filters[filter].call(this, input, filename); + } else { + input = filter.call(this, input, filename); + } + }, this); + return input; + } +}; + + diff --git a/demo/mini_require.js b/demo/mini_require.js new file mode 100644 index 00000000..150cdf8e --- /dev/null +++ b/demo/mini_require.js @@ -0,0 +1,49 @@ + +function require(module, callback) { + + if (Array.isArray(module)) { + var params = []; + module.forEach(function(m) { + params.push(require.modules[m]); + }, this); + + if (callback) { + callback.apply(null, params); + } + } + + if (typeof module === 'string') { + var payload = require.modules[module]; + if (payload == null) { + console.error('Missing module: ' + module); + } + + if (typeof payload === 'function') { + var exports = {}; + var module = { + id: '', + uri: '' + }; + payload(require, exports, module); + payload = exports; + } + + if (callback) { + callback(); + } + + return payload; + } +} +require.modules = {}; + +function define(module, payload) { + if (typeof module !== 'string') { + console.error('dropping module because define wasn\'t munged.'); + console.trace(); + return; + } + + console.log('defining module: ' + module + ' as a ' + typeof payload); + require.modules[module] = payload; +} From c13e39c672e1be63de489b161bc23df743037844 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 01:19:49 +0000 Subject: [PATCH 12/90] adding dryice submodule --- .gitmodules | 3 +++ support/dryice | 1 + 2 files changed, 4 insertions(+) create mode 160000 support/dryice diff --git a/.gitmodules b/.gitmodules index 0927bff1..a5d4df2a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "support/cockpit"] path = support/cockpit url = git://github.com/joewalker/cockpit.git +[submodule "support/dryice"] + path = support/dryice + url = git://github.com/mozilla/dryice.git diff --git a/support/dryice b/support/dryice new file mode 160000 index 00000000..89f99bb6 --- /dev/null +++ b/support/dryice @@ -0,0 +1 @@ +Subproject commit 89f99bb65c66d0c25d461ab4af5743ef1676a04d From 8465d733d72f08be6f1f4f204d9ef3bc3c88eca8 Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Tue, 11 Jan 2011 23:15:56 -0500 Subject: [PATCH 13/90] switch to using the mozilla cockpit module --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index a5d4df2a..1789e3a9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -21,7 +21,7 @@ url = git://github.com/tautologistics/node-htmlparser.git [submodule "support/cockpit"] path = support/cockpit - url = git://github.com/joewalker/cockpit.git + url = git://github.com/mozilla/cockpit.git [submodule "support/dryice"] path = support/dryice url = git://github.com/mozilla/dryice.git From bcf8ad2457e47acaef1648b0cdeb1d5dd6937ae4 Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Tue, 11 Jan 2011 23:16:30 -0500 Subject: [PATCH 14/90] updated module that fixes error --- support/cockpit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/cockpit b/support/cockpit index e8c6677e..b68cde76 160000 --- a/support/cockpit +++ b/support/cockpit @@ -1 +1 @@ -Subproject commit e8c6677e969f8a87ba28ae3405471ab6f9cf83e4 +Subproject commit b68cde760fedf57e486705eb74302763bd9b4a0e From 2a2a05bab3df9de9476d67590a0d8d7e3ce588b6 Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Tue, 11 Jan 2011 23:18:23 -0500 Subject: [PATCH 15/90] modules weren't being cached (so doing require("foo") twice would return two independent copies of the foo module, thus messing up any state stored in that module) the visible evidence of this is that commands (such as keyboard movements) could not be found --- demo/mini_require.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo/mini_require.js b/demo/mini_require.js index 150cdf8e..122ebbf9 100644 --- a/demo/mini_require.js +++ b/demo/mini_require.js @@ -14,6 +14,7 @@ function require(module, callback) { if (typeof module === 'string') { var payload = require.modules[module]; + var module_name = module; if (payload == null) { console.error('Missing module: ' + module); } @@ -26,6 +27,8 @@ function require(module, callback) { }; payload(require, exports, module); payload = exports; + // cache the resulting module object for next time + require.modules[module_name] = payload; } if (callback) { From 0439f93487254614fd242047167fbeccbe707144 Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Tue, 11 Jan 2011 23:19:31 -0500 Subject: [PATCH 16/90] updated build --- Makefile.dryice.js | 2 - build/ace-uncompressed.js | 331 +------------------------------------- build/ace.js | 2 +- build/editor.html | 2 +- 4 files changed, 8 insertions(+), 329 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index bde697d0..ddd9118c 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -119,13 +119,11 @@ copy({ }); // Create the compressed and uncompressed output files -/* copy({ source: buildStep, filter: copy.filter.uglifyjs, dest: 'build/ace.js' }); -*/ copy({ source: buildStep, dest: 'build/ace-uncompressed.js' diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index 11671df6..9182f95c 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -14,6 +14,7 @@ function require(module, callback) { if (typeof module === 'string') { var payload = require.modules[module]; + var module_name = module; if (payload == null) { console.error('Missing module: ' + module); } @@ -26,6 +27,8 @@ function require(module, callback) { }; payload(require, exports, module); payload = exports; + // cache the resulting module object for next time + require.modules[module_name] = payload; } if (callback) { @@ -6283,7 +6286,7 @@ oop.inherits(CliRequisition, Requisition); CliRequisition.prototype.getInputStatusMarkup = function() { // 'scores' is an array which tells us what chars are errors // Initialize with everything VALID - var scores = this.toString().split('').map(function(char) { + var scores = this.toString().split('').map(function(ch) { return Status.VALID; }); // For all chars in all hints, check and upgrade the score @@ -6694,8 +6697,6 @@ define('cockpit/commands/basic', function(require, exports, module) { var checks = require("pilot/typecheck"); var canon = require('pilot/canon'); -var Type = require('pilot/types').Type; -var types = require('pilot/types'); /** @@ -6725,334 +6726,15 @@ var bangCommandSpec = { } }; -/** - * '!' command - */ -var gitCommandSpec = { - name: 'git', - description: 'Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.' -}; - -var gitAddCommandSpec = { - name: 'git add', - description: 'Add file contents to the index', - manual: 'This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit. It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.' + - '
The "index" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working directory, and before running the commit command, you must use the add command to add any new or modified files to the index.' + - '
This command can be performed multiple times before a commit. It only adds the content of the specified file(s) at the time the add command is run; if you want subsequent changes included in the next commit, then you must run git add again to add the new content to the index.' + - '
The git status command can be used to obtain a summary of which files have changes that are staged for the next commit.' + - '
The git add command will not add ignored files by default. If any ignored files were explicitly specified on the command line, git add will fail with a list of ignored files. Ignored files reached by directory recursion or filename globbing performed by Git (quote your globs before the shell) will be silently ignored. The git add command can be used to add ignored files with the -f (force) option.' + - '
Please see git-commit(1) for alternative ways to add content to a commit.', - params: [ - { - name: 'dry-run', - short: 'n', - type: 'bool', - description: 'Don\'t actually add the file(s), just show if they exist and/or will be ignored.' - }, - { - name: 'verbose', - short: 'v', - type: 'bool', - description: 'Be verbose.' - }, - { - name: 'force', - short: 'f', - type: 'bool', - description: 'Allow adding otherwise ignored files.' - }, - { - name: 'update', - short: 'u', - type: 'bool', - description: 'Only match filepattern against already tracked files in the index rather than the working tree.', - manual: 'That means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove files from the index if the corresponding files in the working tree have been removed.
If no is given, default to "."; in other words, update all tracked files in the current directory and its subdirectories.' - }, - { - name: 'all', - short: 'A', - type: 'bool', - description: 'Like -u, but match filepattern against files in the working tree in addition to the index.', - manual: 'That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree.' - }, - { - name: 'intent-to-add', - short: 'N', - type: 'bool', - description: 'Record only the fact that the path will be added later.', - manual: 'An entry for the path is placed in the index with no content. This is useful for, among other things, showing the unstaged content of such files with git diff and committing them with git commit -a.' - }, - { - name: 'refresh', - type: 'bool', - description: 'Don\'t add the file(s), but only refresh their stat() information in the index.' - }, - { - name: 'ignore-errors', - type: 'bool', - description: 'If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.', - manual: 'The command shall still exit with non-zero status.' - }, - { - name: 'ignore-missing', - type: 'bool', - description: 'By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.', - manual: 'This option can only be used together with --dry-run.' - }, - { - name: 'filepattern', - type: 'text[]', - description: 'Files to add content from.', - manual: 'Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively.' - } - ], - exec: function(env, args, request) { - var req = new XMLHttpRequest(); - req.open('GET', '/exec?args=' + args.command, true); - req.onreadystatechange = function(ev) { - if (req.readyState == 4) { - if (req.status == 200) { - request.done('
' + req.responseText + '
'); - } - } - }; - req.send(null); - } -}; - -/** - * commitObject really needs some smarts, but for now it is a clone of string - */ -var commitObject = new Type(); - -commitObject.stringify = function(value) { - return value; -}; - -commitObject.parse = function(value) { - if (typeof value != 'string') { - throw new Error('non-string passed to commitObject.parse()'); - } - return new Conversion(value); -}; - -commitObject.name = 'commitObject'; - -/** - * existingFile really needs some smarts, but for now it is a clone of string - */ -var existingFile = new Type(); - -existingFile.stringify = function(value) { - return value; -}; - -existingFile.parse = function(value) { - if (typeof value != 'string') { - throw new Error('non-string passed to existingFile.parse()'); - } - return new Conversion(value); -}; - -existingFile.name = 'existingFile'; - -var gitCommitCommandSpec = { - name: 'git commit', - description: 'Record changes to the repository', - manual: 'Stores the current contents of the index in a new commit along with a log message from the user describing the changes.' + - '
The content to be added can be specified in several ways:' + - '
1. by using git add to incrementally "add" changes to the index before using the commit command (Note: even modified files must be "added");' + - '
2. by using git rm to remove files from the working tree and the index, again before using the commit command;' + - '
3. by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);' + - '
4. by using the -a switch with the commit command to automatically "add" changes from all known files (i.e. all files that are already listed in the index) and to automatically "rm" files in the index that have been removed from the working tree, and then perform the actual commit;' + - '
5. by using the --interactive switch with the commit command to decide one by one which files should be part of the commit, before finalizing the operation. Currently, this is done by invoking git add --interactive.' + - '
The --dry-run option can be used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters (options and paths).' + - '
If you make a commit and then find a mistake immediately after that, you can recover from it with git reset.', - params: [ - { - name: 'all', - short: 'a', - type: 'bool', - description: 'Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected.' - }, - { - name: 'reuse-message', - short: 'C', - type: 'commitObject', - description: 'Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit.' - }, - { - name: 'reset-author', - type: 'bool', - description: 'When used with --reuse-message/--amend options, declare that the authorship of the resulting commit now belongs of the committer. This also renews the author timestamp.' - }, - { - name: 'short', - type: 'bool', - description: 'When doing a dry-run, give the output in the short-format.', - manual: 'See git-status(1) for details. Implies --dry-run.' - }, - { - name: 'porcelain', - type: 'bool', - description: 'When doing a dry-run, give the output in a porcelain-ready format.', - manual: 'See git-status(1) for details. Implies --dry-run.' - }, - { - name: 'terminate-nul', - short: 'z', - type: 'bool', - description: 'When showing short or porcelain status output, terminate entries in the status output with NUL, instead of LF.', - manual: 'If no format is given, implies the --porcelain output format.' - }, - { - name: 'file', - short: 'F', - type: 'existingFile', - description: 'Take the commit message from the given file.', - manual: '' - }, - { - name: 'author', - type: 'text', - description: 'Override the commit author.', - manual: 'Specify an explicit author using the standard A U Thor format. Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found.' - }, - { - name: 'date', - type: 'text', // TODO: Make this of text type - description: 'Override the author date used in the commit.' - }, - { - name: 'message', - short: 'm', - type: 'text', - description: 'Use the given message as the commit message.' - }, - /* - { - name: 'template', - short: 't', - type: 'existingFile', - description: 'Use the contents of the given file as the initial version of the commit message.', - manual: 'The editor is invoked and you can make subsequent changes. If a message is specified using the -m or -F options, this option has no effect. This overrides the commit.template configuration variable.' - }, - */ - { - name: 'signoff', - short: 's', - type: 'bool', - description: 'Add Signed-off-by line by the committer at the end of the commit log message.' - }, - { - name: 'no-verify', - short: 'n', - type: 'bool', - description: 'This option bypasses the pre-commit and commit-msg hooks. See also githooks(5).' - }, - { - name: 'cleanup', - type: { - name: 'selection', - data: [ 'verbatim', 'whitespace', 'strip', 'default' ] - }, - description: 'This option sets how the commit message is cleaned up.', - manual: 'The default mode will strip leading and trailing empty lines and commentary from the commit message only if the message is to be edited. Otherwise only whitespace removed. The verbatim mode does not change message at all, whitespace removes just leading/trailing whitespace lines and strip removes both whitespace and commentary.' - }, - { - name: 'amend', - type: 'bool', - description: 'Used to amend the tip of the current branch.', - manual: 'Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create replaces the current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded.' - }, - { - name: 'include', - short: 'i', - type: 'bool', - description: 'Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.', - manual: 'This is usually not what you want unless you are concluding a conflicted merge.' - }, - { - name: 'only', - short: 'o', - type: 'bool', - description: 'Make a commit only from the paths specified on the command line, disregarding any contents that have been staged so far.', - manual: 'This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged.' - }, - { - name: 'untracked-files', - short: 'u', - type: { - name: 'selection', - data: [ 'no', 'normal', 'all' ] - }, - description: 'Show untracked files (Default: all).', - manual: 'The mode parameter is optional, and is used to specify the handling of untracked files. The possible options are: no - Show no untracked files.
normal Shows untracked files and directories
all Also shows individual files in untracked directories.' - }, - { - name: 'verbose', - short: 'v', - type: 'bool', - description: 'Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template.', - manual: 'Note that this diff output doesn\'t have its lines prefixed with #.' - }, - { - name: 'quiet', - short: 'q', - type: 'bool', - description: 'Suppress commit summary message.' - }, - { - name: 'dry-run', - type: 'bool', - description: 'Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked.' - }, - { - name: 'status', - type: 'bool', - description: 'Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message.', - manual: 'Defaults to on, but can be used to override configuration variable commit.status.' - }, - { - name: 'no-status', - type: 'bool', - description: 'Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message.' - }, - { - name: 'file', - type: 'existingFile[]', - description: 'When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged.', - manual: 'The contents of these files are also staged for the next commit on top of what have been staged before.' - } - ], - exec: function(env, args, request) { - } -}; - - -var commands = [ - gitCommandSpec, - gitAddCommandSpec, - gitCommitCommandSpec, - bangCommandSpec -]; var canon = require('pilot/canon'); exports.startup = function(data, reason) { - types.registerType(commitObject); - types.registerType(existingFile); - commands.forEach(function(command) { - canon.addCommand(command); - }, this); + canon.addCommand(bangCommandSpec); }; exports.shutdown = function(data, reason) { - commands.forEach(function(command) { - canon.removeCommand(command); - }, this); - types.unregisterType(commitObject); - types.unregisterType(existingFile); + canon.removeCommand(bangCommandSpec); }; @@ -7554,7 +7236,6 @@ var templates = document.createElement('div'); templates.innerHTML = requestViewHtml; var row = templates.querySelector('.cptRow'); -console.log(module); /** * Work out the path for images */ diff --git a/build/ace.js b/build/ace.js index 0c0a6434..2a89ab4d 100644 --- a/build/ace.js +++ b/build/ace.js @@ -1 +1 @@ -function require(a,b){var c;if(typeof a==="string"){c=require.modules[a],c==null&&console.error("Missing module: "+a);if(typeof c==="function"){var d={};var a={id:"",uri:""};c(require,d,a),c=d}}b&&b();return c}require.modules={};function define(a,b){console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b}var config={packagePaths:{"../lib":[{name:"ace",lib:"."}],"../support/cockpit/lib":[{name:"cockpit",main:"index",lib:"."}],"../support/cockpit/support/pilot/lib":[{name:"pilot",main:"index",lib:"."}]},paths:{demo_startup:"../demo/demo_startup"}};var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(config),require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index","cockpit/index"]).then(function(){var b=require("pilot/environment").create();a.startupPlugins({env:b}).then(function(){require("demo_startup").launch(b)})})}),define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

Welcome to Skywriter - Code in the Cloud

",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

Sub-Commands of "+e.name+"

"),d.push("

"+e.description+"

")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

Commands starting with '"+b.search+"':

")):d.push("

Available Commands:

");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
"+e.name+""+e.description+"
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
"}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

"+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
"})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("cockpit/cli",function(a,b,c){var d=a("pilot/console");var e=a("pilot/lang");var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/types");var i=a("pilot/types").Status;var j=a("pilot/types").Conversion;var k=a("pilot/canon");b.startup=function(a,b){k.upgradeType("command",p)};function l(a,b,c,d,e){this.status=a,this.message=b;if(typeof c==="number")this.start=c,this.end=d,this.predictions=e;else{var f=c;this.start=f.start,this.end=f.end,this.predictions=f.predictions}}l.prototype={},l.sort=function(a,b){b!==undefined&&a.forEach(function(a){a.start===n.AT_CURSOR?a.distance=0:ba.end?a.distance=b-a.end:a.distance=0},this),a.sort(function(a,c){if(b!==undefined){var d=a.distance-c.distance;if(d!=0)return d}return c.status-a.status}),b!==undefined&&a.forEach(function(a){delete a.distance},this);return a},b.Hint=l;function m(a,b){this.status=a.status,this.message=a.message,b?(this.start=b.start,this.end=b.end):(this.start=0,this.end=0),this.predictions=a.predictions}f.inherits(m,l);function n(a,b,c,d,e,f){this.emitter=a,this.setText(b),this.start=c,this.end=d,this.prefix=e,this.suffix=f}n.prototype={merge:function(a){if(a.emitter!=this.emitter)throw new Error("Can't merge Arguments from different EventEmitters");return new n(this.emitter,this.text+this.suffix+a.prefix+a.text,this.start,a.end,this.prefix,a.suffix)},setText:function(a){if(a==null)throw new Error("Illegal text for Argument: "+a);var b={argument:this,oldText:this.text,text:a};this.text=a,this.emitter._dispatchEvent("argumentChange",b)},toString:function(){return this.prefix+this.text+this.suffix}},n.merge=function(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var d;for(var e=b;e: ";this.param.description&&(b+=this.param.description.trim(),b.charAt(b.length-1)!=="."&&(b+="."),b.charAt(b.length-1)!==" "&&(b+=" "));var c=i.VALID;var d=this.arg?this.arg.start:n.AT_CURSOR;var e=this.arg?this.arg.end:n.AT_CURSOR;var f;this.conversion&&(c=this.conversion.status,this.conversion.message&&(b+=this.conversion.message),f=this.conversion.predictions);var g=this.arg&&this.arg.text!=="";var h=this.value!==undefined||g;this.param.defaultValue===undefined&&!h&&(c=i.INVALID,b+="Required");return new l(c,b,d,e,f)},complete:function(){this.conversion&&this.conversion.predictions&&this.conversion.predictions.length>0&&this.setValue(this.conversion.predictions[0])},isPositionCaptured:function(a){if(!this.arg)return false;if(this.arg.start===-1)return false;if(a>this.arg.end)return false;if(a===this.arg.end)return this.conversion.status!==i.VALID||this.conversion.predictions.length!==0;return true},decrement:function(){var a=this.param.type.decrement(this.value);a!=null&&this.setValue(a)},increment:function(){var a=this.param.type.increment(this.value);a!=null&&this.setValue(a)},toString:function(){return this.arg?this.arg.toString():""}},b.Assignment=o;var p={name:"__command",type:"command",description:"The command to execute",getCustomHint:function(a,b){var c=[];c.push(" > "),c.push(a.name),a.params&&a.params.length>0&&a.params.forEach(function(a){a.defaultValue===undefined?c.push(" ["+a.name+"]"):c.push(" ["+a.name+"]")},this),c.push("
"),c.push(a.description?a.description:"(No description)"),c.push("
"),a.params&&a.params.length>0&&(c.push("
    "),a.params.forEach(function(a){c.push("
  • "),c.push(""+a.name+": "),c.push(a.description?a.description:"(No description)"),a.defaultValue===undefined?c.push(" [Required]"):a.defaultValue===null?c.push(" [Optional]"):c.push(" [Default: "+a.defaultValue+"]"),c.push("
  • ")},this),c.push("
"));return new l(i.VALID,c.join(""),b)}};function q(a){this.env=a,this.commandAssignment=new o(p,this)}q.prototype={commandAssignment:undefined,assignmentCount:undefined,_assignments:undefined,_hints:undefined,_assignmentChanged:function(a){a.param.name!=="__command"||(this._assignments={},a.value&&a.value.params.forEach(function(a){this._assignments[a.name]=new o(a,this)},this),this.assignmentCount=Object.keys(this._assignments).length,this._dispatchEvent("commandChange",{command:a.value}))},getAssignment:function(a){var b=typeof a==="string"?a:Object.keys(this._assignments)[a];return this._assignments[b]},getParameterNames:function(){return Object.keys(this._assignments)},cloneAssignments:function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)},_updateHints:function(){this.getAssignments(true).forEach(function(a){this._hints.push(a.getHint())},this),l.sort(this._hints)},getWorstHint:function(){return this._hints[0]},getArgsObject:function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.value},this);return a},getAssignments:function(a){var b=[];a===true&&b.push(this.commandAssignment),Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b},setDefaultValues:function(){this.getAssignments().forEach(function(a){a.setValue(undefined)},this)},exec:function(){k.exec(this.commandAssignment.value,this.env,this.getArgsObject(),this.toCanonicalString())},toCanonicalString:function(){var a=[];a.push(this.commandAssignment.value.name),Object.keys(this._assignments).forEach(function(b){var c=this._assignments[b];var d=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(d.stringify(c.value)))},this);return a.join("")}},f.implement(q.prototype,g),b.Requisition=q;function r(a,b){q.call(this,a),b&&b.flags&&(this.flags=b.flags)}f.inherits(r,q),function(){r.prototype.update=function(a){this.input=a,this._hints=[];var b=this._tokenize(a.typed);this._split(b),this.commandAssignment.value&&this._assign(b),this._updateHints()},r.prototype.getInputStatusMarkup=function(){var a=this.toString().split("").map(function(a){return i.VALID});this._hints.forEach(function(b){for(var c=b.start;c<=b.end;c++)b.status>a[c]&&(a[c]=b.status)},this);return a},r.prototype.toString=function(){return this.getAssignments(true).map(function(a){return a.toString()},this).join("")};var a=r.prototype._updateHints;r.prototype._updateHints=function(){a.call(this);var b=this.input.cursor;this._hints.forEach(function(a){var c=b.start>=a.start&&b.start<=a.end;var d=b.end>=a.start&&b.end<=a.end;var e=c||d;!e&&a.status===i.INCOMPLETE&&(a.status=i.INVALID)},this),l.sort(this._hints)},r.prototype.getHints=function(){return this._hints},r.prototype.getAssignmentAt=function(a){var b=this.getAssignments(true);for(var c=0;c=a.length){if(f!==b){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,""))}else if(h!==i){var m=a.substring(i,h);var o=k[k.length-1];o?o.suffix+=m:(o=new n(this,"",h,h,m,""),k.push(o))}break}var p=a[h];switch(f){case b:p==="'"?(j=a.substring(i,h+1),f=d,i=h+1):p==="\""?(j=a.substring(i,h+1),f=e,i=h+1):/ /.test(p)||(j=a.substring(i,h),f=c,i=h);break;case c:if(p===" "){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,"")),f=b,i=h,j=""}break;case d:if(p==="'"){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}break;case e:if(p==="\""){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}}h++}return k},r.prototype._split=function(a){var b=1;var c;while(b<=a.length){var c=n.merge(a,0,b);this.commandAssignment.setArgument(c);if(!this.commandAssignment.value)break;if(this.commandAssignment.value.exec){for(var d=0;d=a.length)break;continue}b.param.type.name==="boolean"?b.setValue(true):f+10){var g=n.merge(a);this._hints.push(new l(i.INVALID,"Input '"+g.text+"' makes no sense.",g))}}}}(),b.CliRequisition=r}),define("cockpit/commands/basic",function(a,b,c){var d=a("pilot/typecheck");var e=a("pilot/canon");var f=a("pilot/types").Type;var g=a("pilot/types");var h={name:"sh",description:"Execute a system command (requires server support)",params:[{name:"command",type:"text",description:"The string to send to the os shell."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,true),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
"+d.responseText+"
"))},d.send(null)}};var i={name:"git",description:"Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals."};var j={name:"git add",description:"Add file contents to the index",manual:"This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit. It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.
The \"index\" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working directory, and before running the commit command, you must use the add command to add any new or modified files to the index.
This command can be performed multiple times before a commit. It only adds the content of the specified file(s) at the time the add command is run; if you want subsequent changes included in the next commit, then you must run git add again to add the new content to the index.
The git status command can be used to obtain a summary of which files have changes that are staged for the next commit.
The git add command will not add ignored files by default. If any ignored files were explicitly specified on the command line, git add will fail with a list of ignored files. Ignored files reached by directory recursion or filename globbing performed by Git (quote your globs before the shell) will be silently ignored. The git add command can be used to add ignored files with the -f (force) option.
Please see git-commit(1) for alternative ways to add content to a commit.",params:[{name:"dry-run","short":"n",type:"bool",description:"Don't actually add the file(s), just show if they exist and/or will be ignored."},{name:"verbose","short":"v",type:"bool",description:"Be verbose."},{name:"force","short":"f",type:"bool",description:"Allow adding otherwise ignored files."},{name:"update","short":"u",type:"bool",description:"Only match filepattern against already tracked files in the index rather than the working tree.",manual:"That means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove files from the index if the corresponding files in the working tree have been removed.
If no is given, default to \".\"; in other words, update all tracked files in the current directory and its subdirectories."},{name:"all","short":"A",type:"bool",description:"Like -u, but match filepattern against files in the working tree in addition to the index.",manual:"That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree."},{name:"intent-to-add","short":"N",type:"bool",description:"Record only the fact that the path will be added later.",manual:"An entry for the path is placed in the index with no content. This is useful for, among other things, showing the unstaged content of such files with git diff and committing them with git commit -a."},{name:"refresh",type:"bool",description:"Don't add the file(s), but only refresh their stat() information in the index."},{name:"ignore-errors",type:"bool",description:"If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.",manual:"The command shall still exit with non-zero status."},{name:"ignore-missing",type:"bool",description:"By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.",manual:"This option can only be used together with --dry-run."},{name:"filepattern",type:"text[]",description:"Files to add content from.",manual:"Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,true),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
"+d.responseText+"
"))},d.send(null)}};var k=new f;k.stringify=function(a){return a},k.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to commitObject.parse()");return new Conversion(a)},k.name="commitObject";var l=new f;l.stringify=function(a){return a},l.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to existingFile.parse()");return new Conversion(a)},l.name="existingFile";var m={name:"git commit",description:"Record changes to the repository",manual:"Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
The content to be added can be specified in several ways:
1. by using git add to incrementally \"add\" changes to the index before using the commit command (Note: even modified files must be \"added\");
2. by using git rm to remove files from the working tree and the index, again before using the commit command;
3. by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);
4. by using the -a switch with the commit command to automatically \"add\" changes from all known files (i.e. all files that are already listed in the index) and to automatically \"rm\" files in the index that have been removed from the working tree, and then perform the actual commit;
5. by using the --interactive switch with the commit command to decide one by one which files should be part of the commit, before finalizing the operation. Currently, this is done by invoking git add --interactive.
The --dry-run option can be used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters (options and paths).
If you make a commit and then find a mistake immediately after that, you can recover from it with git reset.",params:[{name:"all","short":"a",type:"bool",description:"Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected."},{name:"reuse-message","short":"C",type:"commitObject",description:"Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit."},{name:"reset-author",type:"bool",description:"When used with --reuse-message/--amend options, declare that the authorship of the resulting commit now belongs of the committer. This also renews the author timestamp."},{name:"short",type:"bool",description:"When doing a dry-run, give the output in the short-format.",manual:"See git-status(1) for details. Implies --dry-run."},{name:"porcelain",type:"bool",description:"When doing a dry-run, give the output in a porcelain-ready format.",manual:"See git-status(1) for details. Implies --dry-run."},{name:"terminate-nul","short":"z",type:"bool",description:"When showing short or porcelain status output, terminate entries in the status output with NUL, instead of LF.",manual:"If no format is given, implies the --porcelain output format."},{name:"file","short":"F",type:"existingFile",description:"Take the commit message from the given file.",manual:""},{name:"author",type:"text",description:"Override the commit author.",manual:"Specify an explicit author using the standard A U Thor format. Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found."},{name:"date",type:"text",description:"Override the author date used in the commit."},{name:"message","short":"m",type:"text",description:"Use the given message as the commit message."},{name:"signoff","short":"s",type:"bool",description:"Add Signed-off-by line by the committer at the end of the commit log message."},{name:"no-verify","short":"n",type:"bool",description:"This option bypasses the pre-commit and commit-msg hooks. See also githooks(5)."},{name:"cleanup",type:{name:"selection",data:["verbatim","whitespace","strip","default"]},description:"This option sets how the commit message is cleaned up.",manual:"The default mode will strip leading and trailing empty lines and commentary from the commit message only if the message is to be edited. Otherwise only whitespace removed. The verbatim mode does not change message at all, whitespace removes just leading/trailing whitespace lines and strip removes both whitespace and commentary."},{name:"amend",type:"bool",description:"Used to amend the tip of the current branch.",manual:"Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create replaces the current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded."},{name:"include","short":"i",type:"bool",description:"Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.",manual:"This is usually not what you want unless you are concluding a conflicted merge."},{name:"only","short":"o",type:"bool",description:"Make a commit only from the paths specified on the command line, disregarding any contents that have been staged so far.",manual:"This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged."},{name:"untracked-files","short":"u",type:{name:"selection",data:["no","normal","all"]},description:"Show untracked files (Default: all).",manual:"The mode parameter is optional, and is used to specify the handling of untracked files. The possible options are: no - Show no untracked files.
normal Shows untracked files and directories
all Also shows individual files in untracked directories."},{name:"verbose","short":"v",type:"bool",description:"Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template.",manual:"Note that this diff output doesn't have its lines prefixed with #."},{name:"quiet","short":"q",type:"bool",description:"Suppress commit summary message."},{name:"dry-run",type:"bool",description:"Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked."},{name:"status",type:"bool",description:"Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message.",manual:"Defaults to on, but can be used to override configuration variable commit.status."},{name:"no-status",type:"bool",description:"Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message."},{name:"file",type:"existingFile[]",description:"When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged.",manual:"The contents of these files are also staged for the next commit on top of what have been staged before."}],exec:function(a,b,c){}};var n=[i,j,m,h];var e=a("pilot/canon");b.startup=function(a,b){g.registerType(k),g.registerType(l),n.forEach(function(a){e.addCommand(a)},this)},b.shutdown=function(a,b){n.forEach(function(a){e.removeCommand(a)},this),g.unregisterType(k),g.unregisterType(l)}}),define("cockpit/index",function(a,b,c){b.startup=function(b,c){var d=a("pilot/index");a("cockpit/cli").startup(b,c),window.testCli=a("cockpit/test/testCli"),a("cockpit/ui/settings").startup(b,c),a("cockpit/ui/cliView").startup(b,c),a("cockpit/commands/basic").startup(b,c)}}),define("cockpit/ui/cliView",function(a,b,c){var d=a("text!cockpit/ui/cliView.css");var e=a("pilot/dom");e.importCssString(d);var f=a("pilot/canon");var g=a("pilot/types").Status;var h=a("pilot/keyboard/keyutil");var i=a("cockpit/cli").CliRequisition;var j=a("cockpit/cli").Hint;var k=a("cockpit/ui/requestView").RequestView;var l=new j(g.VALID,"",0,0);b.startup=function(a,b){var c=new i(a.env);var d=new m(c,a.env)};function m(a,b){this.cli=a,this.doc=document,this.win=this.doc.defaultView,this.element=this.doc.getElementById("cockpitInput");this.element?(this.settings=b.settings,this.hintDirection=this.settings.getSetting("hintDirection"),this.outputDirection=this.settings.getSetting("outputDirection"),this.outputHeight=this.settings.getSetting("outputHeight"),this.isUpdating=false,this.createElements(),this.update()):console.log("No element with an id of cockpit. Bailing on cli")}m.prototype={createElements:function(){var a=this.element;this.element.spellcheck=false,this.output=this.doc.getElementById("cockpitOutput"),this.popupOutput=this.output==null;if(!this.output){this.output=this.doc.createElement("div"),this.output.id="cockpitOutput",this.output.className="cptFocusPopup",a.parentNode.insertBefore(this.output,a.nextSibling);var b=function(){this.output.style.maxHeight=this.outputHeight.get()+"px"}.bind(this);this.outputHeight.addEventListener("change",b),b()}this.completer=this.doc.createElement("div"),this.completer.className="cptCompletion VALID";var c=window.getComputedStyle(a,null);this.completer.style.color=c.color,this.completer.style.fontSize=c.fontSize,this.completer.style.fontFamily=c.fontFamily,this.completer.style.fontWeight=c.fontWeight,this.completer.style.fontStyle=c.fontStyle,a.parentNode.insertBefore(this.completer,a.nextSibling),this.completer.style.backgroundColor=a.style.backgroundColor,a.style.backgroundColor="transparent",this.hinter=this.doc.createElement("div"),this.hinter.className="cptHints cptFocusPopup",a.parentNode.insertBefore(this.hinter,a.nextSibling);var d=this.resizer.bind(this);this.win.addEventListener("resize",d,false),this.hintDirection.addEventListener("change",d),this.outputDirection.addEventListener("change",d),d(),f.addEventListener("output",function(a){new k(a.request,this)}.bind(this)),h.addKeyDownListener(a,this.onKeyDown.bind(this)),a.addEventListener("keyup",this.onKeyUp.bind(this),true),a.addEventListener("mouseup",function(a){this.isUpdating=true,this.update(),this.isUpdating=false}.bind(this),false),this.cli.addEventListener("argumentChange",this.onArgChange.bind(this))},scrollOutputToBottom:function(){var a=Math.max(this.output.scrollHeight,this.output.clientHeight);this.output.scrollTop=a-this.output.clientHeight},resizer:function(){var a=this.element.getClientRects()[0];this.completer.style.top=a.top+"px",this.completer.style.height=a.height+"px",this.completer.style.lineHeight=a.height+"px",this.completer.style.left=a.left+"px",this.completer.style.width=a.width+"px",this.hintDirection.get()==="below"?(this.hinter.style.top=a.bottom+"px",this.hinter.style.bottom="auto"):(this.hinter.style.top="auto",this.hinter.style.bottom=this.win.innerHeight-a.top+"px"),this.hinter.style.left=a.left+30+"px",this.hinter.style.maxWidth=a.width-110+"px",this.popupOutput&&(this.outputDirection.get()==="below"?(this.output.style.top=a.bottom+"px",this.output.style.bottom="auto"):(this.output.style.top="auto",this.output.style.bottom=this.win.innerHeight-a.top+"px"),this.output.style.left=a.left+"px",this.output.style.width=a.width-80+"px")},onKeyDown:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.TAB||a.keyCode===h.KeyHelper.KEY.UP||a.keyCode===h.KeyHelper.KEY.DOWN)return true;return b},onKeyUp:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.RETURN){var c=this.cli.getWorstHint();c.status===g.VALID?(this.cli.exec(),this.element.value=""):(this.element.selectionStart=c.start,this.element.selectionEnd=c.end)}this.update();var d=this.cli.getAssignmentAt(this.element.selectionStart);d&&(a.keyCode===h.KeyHelper.KEY.TAB&&(d.complete(),this.update()),a.keyCode===h.KeyHelper.KEY.UP&&(d.increment(),this.update()),a.keyCode===h.KeyHelper.KEY.DOWN&&(d.decrement(),this.update()));return b},update:function(){this.isUpdating=true;var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};this.cli.update(a);var b=this.cli.getAssignmentAt(a.cursor.start).getHint();e.removeCssClass(this.completer,g.VALID.toString()),e.removeCssClass(this.completer,g.INCOMPLETE.toString()),e.removeCssClass(this.completer,g.INVALID.toString());var c="> ";if(this.element.value.length>0){var d=this.cli.getInputStatusMarkup();c+=this.markupStatusScore(d)}if(this.element.value.length>0&&b.predictions&&b.predictions.length>0){var f=b.predictions[0];c+="  ⇥ "+(f.name?f.name:f)}this.completer.innerHTML=c,e.addCssClass(this.completer,this.cli.getWorstHint().status.toString());var h="";this.element.value.length!==0&&(h+=b.message,b.predictions&&b.predictions.length>0&&(h+=": [ ",b.predictions.forEach(function(a){h+=a.name?a.name:a,h+=" | "},this),h=h.replace(/\| $/,"]"))),this.hinter.innerHTML=h,h.length===0?e.addCssClass(this.hinter,"cptNoPopup"):e.removeCssClass(this.hinter,"cptNoPopup"),this.isUpdating=false},markupStatusScore:function(a){var b="";var c=0;var d=-1;while(true){d!==a[c]&&(b+="",d=a[c]),b+=this.element.value[c],c++;if(c===this.element.value.length){b+="";break}d!==a[c]&&(b+="")}return b},onArgChange:function(a){if(!this.isUpdating){var b=this.element.value.substring(0,a.argument.start);var c=this.element.value.substring(a.argument.end);var d=typeof a.text==="string"?a.text:a.text.name;this.element.value=b+d+c;var e=(b+d).length;this.element.selectionStart=e,this.element.selectionEnd=e}}},b.CliView=m}),define("cockpit/ui/requestView",function(a,b,c){var d=a("pilot/dom");var e=a("pilot/event");var f=a("text!cockpit/ui/requestView.html");var g=a("pilot/domtemplate").Templater;var h=a("text!cockpit/ui/requestView.css");d.importCssString(h);var i=document.createElement("div");i.innerHTML=f;var j=i.querySelector(".cptRow");console.log(c);var k=c.id.split("/").pop()+".js";var l;if(c.uri.substr(-k.length)!==k)console.error("module.id",c.id),console.error("module.uri",c.uri),console.error("filename",k),console.error("Can't work out path from module.uri/module/id"),l=".";else{var m=c.uri.length-k.length;l=c.uri.substr(0,m)+"images"}function n(a,b){this.request=a,this.cliView=b,this.imagePath=l,this.rowin=null,this.rowout=null,this.output=null,this.hide=null,this.show=null,this.duration=null,this.throb=null,(new g).processNode(j.cloneNode(true),this),this.cliView.output.appendChild(this.rowin),this.cliView.output.appendChild(this.rowout),this.request.addEventListener("output",this.onRequestChange.bind(this))}n.prototype={copyToInput:function(){this.cliView.element.value=this.request.typed},executeRequest:function(a){this.cliView.cli.update({typed:this.request.typed,cursor:{start:0,end:0}}),this.cliView.cli.exec()},hideOutput:function(a){this.output.style.display="none",d.addCssClass(this.hide,"cmd_hidden"),d.removeCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},showOutput:function(a){this.output.style.display="block",d.removeCssClass(this.hide,"cmd_hidden"),d.addCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},remove:function(a){this.cliView.output.removeChild(this.rowin),this.cliView.output.removeChild(this.rowout),e.stopPropagation(a)},onRequestChange:function(a){this.duration.innerHTML=this.request.duration?"completed in "+this.request.duration/1e3+" sec ":"",this.output.innerHTML="",this.request.outputs.forEach(function(a){var b;typeof a=="string"?(b=document.createElement("p"),b.innerHTML=a):b=a,this.output.appendChild(b)},this),this.cliView.scrollOutputToBottom(),d.setCssClass(this.output,"cmd_error",this.request.error),this.throb.style.display=this.request.completed?"none":"block"}},b.RequestView=n}),define("cockpit/ui/settings",function(a,b,c){var d=a("pilot/types");var e=a("pilot/types/basic").SelectionType;var f=new e({name:"direction",data:["above","below"]});var g={name:"hintDirection",description:"Are hints shown above or below the command line?",type:"direction",defaultValue:"above"};var h={name:"outputDirection",description:"Is the output window shown above or below the command line?",type:"direction",defaultValue:"above"};var i={name:"outputHeight",description:"What height should the output panel be?",type:"number",defaultValue:300};b.startup=function(a,b){d.registerType(f),a.env.settings.addSetting(g),a.env.settings.addSetting(h),a.env.settings.addSetting(i)},b.shutdown=function(a,b){d.unregisterType(f),a.env.settings.removeSetting(g),a.env.settings.removeSetting(h),a.env.settings.removeSetting(i)}}),define("background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
")}}).call(e.prototype),b.Marker=e}),define("layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
"),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("mode/css",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text").Mode;var f=a("ace/tokenizer").Tokenizer;var g=a("ace/mode/css_highlight_rules").CssHighlightRules;var h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;var i=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(i,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(i.prototype),b.Mode=i}),define("mode/css_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){var a=e.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|"));var b=e.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|"));var c=e.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|"));var d=e.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|"));var f="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";function g(a){var b=[];var c=a.split("");for(var d=0;d"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<(?=s*script)",next:"script"},{token:"text",regex:"<(?=s*style)",next:"css"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],script:[{token:"text",regex:">",next:"js-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],css:[{token:"text",regex:">",next:"css-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]};var a=(new f).getRules();this.addRules(a,"js-"),this.$rules["js-start"].unshift({token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"});var b=(new e).getRules();this.addRules(b,"css-"),this.$rules["css-start"].unshift({token:"text",regex:"<\\/(?=style)",next:"tag"})};d.inherits(h,g),b.HtmlHighlightRules=h}),define("mode/javascript",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text").Mode;var f=a("ace/tokenizer").Tokenizer;var g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;var h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;var i=a("ace/range").Range;var j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=true;var f=[];var g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=false;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a);var f=e.tokens;var g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("mode/php",function(a,b,c){var d=a("pilot/oop");var e=a("./text").Mode;var f=a("../tokenizer").Tokenizer;var g=a("./php_highlight_rules").PhpHighlightRules;var h=a("./matching_brace_outdent").MatchingBraceOutdent;var i=a("../range").Range;var j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=true;var f=[];var g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=false;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a);var f=e.tokens;var g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("mode/php_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;PhpHighlightRules=function(){var a=new f;var b=e.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_response_headers|apache_setenv|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_uassoc|array_fill|array_filter|array_flip|array_intersect|array_intersect_assoc|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_push|array_rand|array_reduce|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_unique|array_unshift|array_values|array_walk|arsort|ascii2ebcdic|asin|asinh|asort|aspell_check|aspell_check_raw|aspell_new|aspell_suggest|assert|assert_options|atan|atan2|atanh|base64_decode|base64_encode|base_convert|basename|bcadd|bccomp|bcdiv|bcmod|bcmul|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|call_user_func|call_user_func_array|call_user_method|call_user_method_array|ccvs_add|ccvs_auth|ccvs_command|ccvs_count|ccvs_delete|ccvs_done|ccvs_init|ccvs_lookup|ccvs_new|ccvs_report|ccvs_return|ccvs_reverse|ccvs_sale|ccvs_status|ccvs_textvalue|ccvs_void|ceil|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_exists|clearstatcache|closedir|closelog|com|com_addref|com_get|com_invoke|com_isenum|com_load|com_load_typelib|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|convert_cyr_string|copy|cos|cosh|count|count_chars|cpdf_add_annotation|cpdf_add_outline|cpdf_arc|cpdf_begin_text|cpdf_circle|cpdf_clip|cpdf_close|cpdf_closepath|cpdf_closepath_fill_stroke|cpdf_closepath_stroke|cpdf_continue_text|cpdf_curveto|cpdf_end_text|cpdf_fill|cpdf_fill_stroke|cpdf_finalize|cpdf_finalize_page|cpdf_global_set_document_limits|cpdf_import_jpeg|cpdf_lineto|cpdf_moveto|cpdf_newpath|cpdf_open|cpdf_output_buffer|cpdf_page_init|cpdf_place_inline_image|cpdf_rect|cpdf_restore|cpdf_rlineto|cpdf_rmoveto|cpdf_rotate|cpdf_rotate_text|cpdf_save|cpdf_save_to_file|cpdf_scale|cpdf_set_action_url|cpdf_set_char_spacing|cpdf_set_creator|cpdf_set_current_page|cpdf_set_font|cpdf_set_font_directories|cpdf_set_font_map_file|cpdf_set_horiz_scaling|cpdf_set_keywords|cpdf_set_leading|cpdf_set_page_animation|cpdf_set_subject|cpdf_set_text_matrix|cpdf_set_text_pos|cpdf_set_text_rendering|cpdf_set_text_rise|cpdf_set_title|cpdf_set_viewer_preferences|cpdf_set_word_spacing|cpdf_setdash|cpdf_setflat|cpdf_setgray|cpdf_setgray_fill|cpdf_setgray_stroke|cpdf_setlinecap|cpdf_setlinejoin|cpdf_setlinewidth|cpdf_setmiterlimit|cpdf_setrgbcolor|cpdf_setrgbcolor_fill|cpdf_setrgbcolor_stroke|cpdf_show|cpdf_show_xy|cpdf_stringwidth|cpdf_stroke|cpdf_text|cpdf_translate|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|curl_close|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_version|current|cybercash_base64_decode|cybercash_base64_encode|cybercash_decr|cybercash_encr|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dblist|dbmclose|dbmdelete|dbmexists|dbmfetch|dbmfirstkey|dbminsert|dbmnextkey|dbmopen|dbmreplace|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debugger_off|debugger_on|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|dotnet_load|doubleval|each|easter_date|easter_days|ebcdic2ascii|echo|empty|end|ereg|ereg_replace|eregi|eregi_replace|error_log|error_reporting|escapeshellarg|escapeshellcmd|eval|exec|exif_imagetype|exif_read_data|exif_thumbnail|exit|exp|explode|expm1|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_select_db|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filetype|floatval|flock|floor|flush|fmod|fnmatch|fopen|fpassthru|fprintf|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gd_info|get_browser|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getcwd|getdate|getenv|gethostbyaddr|gethostbyname|gethostbynamel|getimagesize|getlastmod|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getopt|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|gettext|gettimeofday|gettype|glob|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_xor|gmstrftime|gregoriantojd|gzclose|gzcompress|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|header|headers_list|headers_sent|hebrev|hebrevc|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|http_build_query|hw_api_attribute|hw_api_content|hw_api_object|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_hgcsp|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|idate|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|image2wbmp|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepscopyfont|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchstructure|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implode|import_request_variables|in_array|ingres_autocommit|ingres_close|ingres_commit|ingres_connect|ingres_fetch_array|ingres_fetch_object|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_query|ingres_rollback|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|intval|ip2long|iptcembed|iptcparse|ircg_channel_mode|ircg_disconnect|ircg_fetch_error_msg|ircg_get_username|ircg_html_encode|ircg_ignore_add|ircg_ignore_del|ircg_invite|ircg_is_conn_alive|ircg_join|ircg_kick|ircg_list|ircg_lookup_format_messages|ircg_lusers|ircg_msg|ircg_nick|ircg_nickname_escape|ircg_nickname_unescape|ircg_notice|ircg_oper|ircg_part|ircg_pconnect|ircg_register_format_messages|ircg_set_current|ircg_set_file|ircg_set_on_die|ircg_topic|ircg_who|ircg_whois|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isset|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|juliantojd|key|krsort|ksort|lcg_value|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|levenshtein|link|linkinfo|list|localeconv|localtime|log|log10|log1p|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_strlen|mb_strpos|mb_strrpos|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcal_append_event|mcal_close|mcal_create_calendar|mcal_date_compare|mcal_date_valid|mcal_day_of_week|mcal_day_of_year|mcal_days_in_month|mcal_delete_calendar|mcal_delete_event|mcal_event_add_attribute|mcal_event_init|mcal_event_set_alarm|mcal_event_set_category|mcal_event_set_class|mcal_event_set_description|mcal_event_set_end|mcal_event_set_recur_daily|mcal_event_set_recur_monthly_mday|mcal_event_set_recur_monthly_wday|mcal_event_set_recur_none|mcal_event_set_recur_weekly|mcal_event_set_recur_yearly|mcal_event_set_start|mcal_event_set_title|mcal_expunge|mcal_fetch_current_stream_event|mcal_fetch_event|mcal_is_leap_year|mcal_list_alarms|mcal_list_events|mcal_next_recurrence|mcal_open|mcal_popen|mcal_rename_calendar|mcal_reopen|mcal_snooze|mcal_store_event|mcal_time_valid|mcal_week_of_year|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|mcve_adduser|mcve_adduserarg|mcve_bt|mcve_checkstatus|mcve_chkpwd|mcve_chngpwd|mcve_completeauthorizations|mcve_connect|mcve_connectionerror|mcve_deleteresponse|mcve_deletetrans|mcve_deleteusersetup|mcve_deluser|mcve_destroyconn|mcve_destroyengine|mcve_disableuser|mcve_edituser|mcve_enableuser|mcve_force|mcve_getcell|mcve_getcellbynum|mcve_getcommadelimited|mcve_getheader|mcve_getuserarg|mcve_getuserparam|mcve_gft|mcve_gl|mcve_gut|mcve_initconn|mcve_initengine|mcve_initusersetup|mcve_iscommadelimited|mcve_liststats|mcve_listusers|mcve_maxconntimeout|mcve_monitor|mcve_numcolumns|mcve_numrows|mcve_override|mcve_parsecommadelimited|mcve_ping|mcve_preauth|mcve_preauthcompletion|mcve_qc|mcve_responseparam|mcve_return|mcve_returncode|mcve_returnstatus|mcve_sale|mcve_setblocking|mcve_setdropfile|mcve_setip|mcve_setssl|mcve_setssl_files|mcve_settimeout|mcve_settle|mcve_text_avs|mcve_text_code|mcve_text_cv|mcve_transactionauth|mcve_transactionavs|mcve_transactionbatch|mcve_transactioncv|mcve_transactionid|mcve_transactionitem|mcve_transactionssent|mcve_transactiontext|mcve_transinqueue|mcve_transnew|mcve_transparam|mcve_transsend|mcve_ub|mcve_uwait|mcve_verifyconnection|mcve_verifysslcert|mcve_void|md5|md5_file|mdecrypt_generic|memory_get_usage|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_setcubicthreshold|ming_setscale|ming_useswfversion|mkdir|mktime|money_format|move_uploaded_file|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_getdata|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_setdata|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|muscat_close|muscat_get|muscat_give|muscat_setup|muscat_setup_net|mysql_affected_rows|mysql_change_user|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli_affected_rows|mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_change_user|mysqli_character_set_name|mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_dump_debug_info|mysqli_embedded_connect|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|mysqli_free_result|mysqli_get_client_info|mysqli_get_client_version|mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_master_query|mysqli_more_results|mysqli_multi_query|mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_prepare|mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_report|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|mysqli_send_query|mysqli_server_end|mysqli_server_init|mysqli_set_opt|mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt_init|mysqli_stmt_affected_rows|mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_free_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning_count|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|next|ngettext|nl2br|nl_langinfo|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|number_format|ob_clean|ob_end_clean|ob_end_flush|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_by_name|oci_cancel|oci_close|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_copy|oci_lob_is_equal|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|opendir|openlog|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_new|openssl_csr_sign|openssl_error_string|openssl_free_key|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ora_bind|ora_close|ora_columnname|ora_columnsize|ora_columntype|ora_commit|ora_commitoff|ora_commiton|ora_do|ora_error|ora_errorcode|ora_exec|ora_fetch|ora_fetch_into|ora_getcolumn|ora_logoff|ora_logon|ora_numcols|ora_numrows|ora_open|ora_parse|ora_plogon|ora_rollback|ord|output_add_rewrite_var|output_reset_rewrite_vars|overload|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parse_ini_file|parse_str|parse_url|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_page|pdf_begin_pattern|pdf_begin_template|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_curveto|pdf_delete|pdf_end_page|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_stroke|pdf_findfont|pdf_get_buffer|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_initgraphics|pdf_lineto|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_page|pdf_open_png|pdf_open_tiff|pdf_place_image|pdf_place_pdi_page|pdf_rect|pdf_restore|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_font|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_translate|pfpro_cleanup|pfpro_init|pfpro_process|pfpro_process_raw|pfpro_version|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_fetch_all|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_type|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_pconnect|pg_ping|pg_port|pg_put_line|pg_query|pg_result_error|pg_result_seek|pg_result_status|pg_select|pg_send_query|pg_set_client_encoding|pg_trace|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_ctermid|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_isatty|posix_kill|posix_mkfifo|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_grep|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|qdom_error|qdom_tree|quoted_printable_decode|quotemeta|rad2deg|rand|range|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_read_history|readline_write_history|readlink|realpath|recode|recode_file|recode_string|register_shutdown_function|register_tick_function|rename|reset|restore_error_handler|restore_include_path|rewind|rewinddir|rmdir|round|rsort|rtrim|scandir|sem_acquire|sem_get|sem_release|sem_remove|serialize|sesam_affected_rows|sesam_commit|sesam_connect|sesam_diagnostic|sesam_disconnect|sesam_errormsg|sesam_execimm|sesam_fetch_array|sesam_fetch_result|sesam_fetch_row|sesam_field_array|sesam_field_name|sesam_free_result|sesam_num_fields|sesam_query|sesam_rollback|sesam_seek_row|sesam_settransaction|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|set_error_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_time_limit|setcookie|setlocale|setrawcookie|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|sin|sinh|sizeof|sleep|snmp_get_quick_print|snmp_set_quick_print|snmpget|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_iovec_add|socket_iovec_alloc|socket_iovec_delete|socket_iovec_fetch|socket_iovec_free|socket_iovec_set|socket_last_error|socket_listen|socket_read|socket_readv|socket_recv|socket_recvfrom|socket_recvmsg|socket_select|socket_send|socket_sendmsg|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|socket_writev|sort|soundex|split|spliti|sprintf|sql_regcase|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_fetch_array|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqrt|srand|sscanf|stat|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_context_create|stream_context_get_options|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_register_wrapper|stream_select|stream_set_blocking|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_get_name|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_wrapper_register|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpos|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfbutton_keypress|swfdisplayitem|swffill|swffont|swfgradient|swfmorph|swfmovie|swfshape|swfsprite|swftext|swftextfield|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|syslog|system|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy_access_count|tidy_clean_repair|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_body|tidy_get_config|tidy_get_error_buffer|tidy_get_head|tidy_get_html|tidy_get_html_ver|tidy_get_output|tidy_get_release|tidy_get_root|tidy_get_status|tidy_getopt|tidy_is_xhtml|tidy_is_xml|tidy_load_config|tidy_parse_file|tidy_parse_string|tidy_repair_file|tidy_repair_string|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|time|tmpfile|token_get_all|token_name|touch|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|user_error|usleep|usort|utf8_decode|utf8_encode|var_dump|var_export|variant|version_compare|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|wordwrap|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xpath_eval|xpath_eval_expression|xpath_new_context|xptr_eval|xptr_new_context|xsl_xsltprocessor_get_parameter|xsl_xsltprocessor_has_exslt_support|xsl_xsltprocessor_import_stylesheet|xsl_xsltprocessor_register_php_functions|xsl_xsltprocessor_remove_parameter|xsl_xsltprocessor_set_parameter|xsl_xsltprocessor_transform_to_doc|xsl_xsltprocessor_transform_to_uri|xsl_xsltprocessor_transform_to_xml|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|zlib_get_coding_type".split("|"));var c=e.arrayToMap("abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|include|include_once|global|goto|if|implements|interface|instanceof|namespace|new|old_function|or|private|protected|public|return|require|require_once|static|switch|throw|try|use|var|while|xor".split("|"));var d=e.arrayToMap("true|false|null|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__CLASS__".split("|"));var g=e.arrayToMap("$_GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|"));var h=e.arrayToMap([]);this.$rules={start:[{token:"support",regex:"<\\?(?:php|\\=)"},{token:"support",regex:"\\?>"},{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(a){if(c[a])return"keyword";if(d[a])return"constant.language";if(g[a])return"variable.language";if(h[a])return"invalid.illegal";if(b[a])return"support.function";if(a=="debugger")return"invalid.deprecated";if(a.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))return"variable";return"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(PhpHighlightRules,g),b.PhpHighlightRules=PhpHighlightRules}),define("mode/python",function(a,b,c){var d=a("pilot/oop");var e=a("./text").Mode;var f=a("../tokenizer").Tokenizer;var g=a("./python_highlight_rules").PythonHighlightRules;var h=a("./matching_brace_outdent").MatchingBraceOutdent;var i=a("../range").Range;var j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=true;var f=[];var g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=false;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a);var f=e.tokens;var g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("mode/python_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("./text_highlight_rules").TextHighlightRules;PythonHighlightRules=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|"));var b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|"));var c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|"));var d=e.arrayToMap("".split("|"));var f="(?:(?:[rubRUB])|(?:[ubUB][rR]))?";var g="(?:(?:[1-9]\\d*)|(?:0))";var h="(?:0[oO]?[0-7]+)";var i="(?:0[xX][\\dA-Fa-f]+)";var j="(?:0[bB][01]+)";var k="(?:"+g+"|"+h+"|"+i+"|"+j+")";var l="(?:[eE][+-]?\\d+)";var m="(?:\\.\\d+)";var n="(?:\\d+)";var o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))";var p="(?:(?:"+o+"|"+n+")"+l+")";var q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+"\"{3}(?:(?:.)|(?:^\"{3}))*?\"{3}"},{token:"string",regex:f+"\"{3}.*$",next:"qqstring"},{token:"string",regex:f+"\"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\""},{token:"string",regex:f+"'{3}(?:(?:.)|(?:^'{3}))*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a[e]?"keyword":b[e]?"constant.language":d[e]?"invalid.illegal":c[e]?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:"(?:^\"{3})*?\"{3}",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:^'{3})*?'{3}",next:"start"},{token:"string",regex:".+"}]}},d.inherits(PythonHighlightRules,f),b.PythonHighlightRules=PythonHighlightRules}),define("mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer;var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return false},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;e"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]}};/fd/g,d.inherits(f,e),b.XmlHighlightRules=f}),define("range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("theme/clouds",function(a,b,c){var d=a("pilot/dom");var e=".ace-clouds .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-clouds .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-clouds .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-clouds .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-clouds .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-clouds .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-clouds .ace_scroller {\n background-color: #FFFFFF;\n}\n\n.ace-clouds .ace_text-layer {\n cursor: text;\n color: #000000;\n}\n\n.ace-clouds .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-clouds .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-clouds .ace_marker-layer .ace_selection {\n background: #BDD5FC;\n}\n\n.ace-clouds .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-clouds .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #BFBFBF;\n}\n\n.ace-clouds .ace_marker-layer .ace_active_line {\n background: #FFFBD1;\n}\n\n \n.ace-clouds .ace_invisible {\n color: #BFBFBF;\n}\n\n.ace-clouds .ace_keyword {\n color:#AF956F;\n}\n\n.ace-clouds .ace_keyword.ace_operator {\n color:#484848;\n}\n\n.ace-clouds .ace_constant {\n \n}\n\n.ace-clouds .ace_constant.ace_language {\n color:#39946A;\n}\n\n.ace-clouds .ace_constant.ace_library {\n \n}\n\n.ace-clouds .ace_constant.ace_numeric {\n color:#46A609;\n}\n\n.ace-clouds .ace_invalid {\n background-color:#FF002A;\n}\n\n.ace-clouds .ace_invalid.ace_illegal {\n \n}\n\n.ace-clouds .ace_invalid.ace_deprecated {\n \n}\n\n.ace-clouds .ace_support {\n \n}\n\n.ace-clouds .ace_support.ace_function {\n color:#C52727;\n}\n\n.ace-clouds .ace_function.ace_buildin {\n \n}\n\n.ace-clouds .ace_string {\n color:#5D90CD;\n}\n\n.ace-clouds .ace_string.ace_regexp {\n \n}\n\n.ace-clouds .ace_comment {\n color:#BCC8BA;\n}\n\n.ace-clouds .ace_comment.ace_doc {\n \n}\n\n.ace-clouds .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-clouds .ace_variable {\n \n}\n\n.ace-clouds .ace_variable.ace_language {\n \n}\n\n.ace-clouds .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-clouds"}),define("theme/clouds_mignight",function(a,b,c){var d=a("pilot/dom");var e=".ace-clouds-midnight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-clouds-midnight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-clouds-midnight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-clouds-midnight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-clouds-midnight .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-clouds-midnight .ace_scroller {\n background-color: #191919;\n}\n\n.ace-clouds-midnight .ace_text-layer {\n cursor: text;\n color: #929292;\n}\n\n.ace-clouds-midnight .ace_cursor {\n border-left: 2px solid #7DA5DC;\n}\n\n.ace-clouds-midnight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #7DA5DC;\n}\n \n.ace-clouds-midnight .ace_marker-layer .ace_selection {\n background: #000000;\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #BFBFBF;\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_active_line {\n background: rgba(215, 215, 215, 0.031);\n}\n\n \n.ace-clouds-midnight .ace_invisible {\n color: #BFBFBF;\n}\n\n.ace-clouds-midnight .ace_keyword {\n color:#927C5D;\n}\n\n.ace-clouds-midnight .ace_keyword.ace_operator {\n color:#4B4B4B;\n}\n\n.ace-clouds-midnight .ace_constant {\n \n}\n\n.ace-clouds-midnight .ace_constant.ace_language {\n color:#39946A;\n}\n\n.ace-clouds-midnight .ace_constant.ace_library {\n \n}\n\n.ace-clouds-midnight .ace_constant.ace_numeric {\n color:#46A609;\n}\n\n.ace-clouds-midnight .ace_invalid {\n color:#FFFFFF;\nbackground-color:#E92E2E;\n}\n\n.ace-clouds-midnight .ace_invalid.ace_illegal {\n \n}\n\n.ace-clouds-midnight .ace_invalid.ace_deprecated {\n \n}\n\n.ace-clouds-midnight .ace_support {\n \n}\n\n.ace-clouds-midnight .ace_support.ace_function {\n color:#E92E2E;\n}\n\n.ace-clouds-midnight .ace_function.ace_buildin {\n \n}\n\n.ace-clouds-midnight .ace_string {\n color:#5D90CD;\n}\n\n.ace-clouds-midnight .ace_string.ace_regexp {\n \n}\n\n.ace-clouds-midnight .ace_comment {\n color:#3C403B;\n}\n\n.ace-clouds-midnight .ace_comment.ace_doc {\n \n}\n\n.ace-clouds-midnight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-clouds-midnight .ace_variable {\n \n}\n\n.ace-clouds-midnight .ace_variable.ace_language {\n \n}\n\n.ace-clouds-midnight .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-clouds-midnight"}),define("theme/cobalt",function(a,b,c){var d=a("pilot/dom");var e=".ace-cobalt .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-cobalt .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-cobalt .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-cobalt .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-cobalt .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-cobalt .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-cobalt .ace_scroller {\n background-color: #002240;\n}\n\n.ace-cobalt .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-cobalt .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-cobalt .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-cobalt .ace_marker-layer .ace_selection {\n background: rgba(179, 101, 57, 0.75);\n}\n\n.ace-cobalt .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-cobalt .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.15);\n}\n\n.ace-cobalt .ace_marker-layer .ace_active_line {\n background: rgba(0, 0, 0, 0.35);\n}\n\n \n.ace-cobalt .ace_invisible {\n color: rgba(255, 255, 255, 0.15);\n}\n\n.ace-cobalt .ace_keyword {\n color:#FF9D00;\n}\n\n.ace-cobalt .ace_keyword.ace_operator {\n \n}\n\n.ace-cobalt .ace_constant {\n color:#FF628C;\n}\n\n.ace-cobalt .ace_constant.ace_language {\n \n}\n\n.ace-cobalt .ace_constant.ace_library {\n \n}\n\n.ace-cobalt .ace_constant.ace_numeric {\n \n}\n\n.ace-cobalt .ace_invalid {\n color:#F8F8F8;\nbackground-color:#800F00;\n}\n\n.ace-cobalt .ace_invalid.ace_illegal {\n \n}\n\n.ace-cobalt .ace_invalid.ace_deprecated {\n \n}\n\n.ace-cobalt .ace_support {\n color:#80FFBB;\n}\n\n.ace-cobalt .ace_support.ace_function {\n color:#FFB054;\n}\n\n.ace-cobalt .ace_function.ace_buildin {\n \n}\n\n.ace-cobalt .ace_string {\n \n}\n\n.ace-cobalt .ace_string.ace_regexp {\n color:#80FFC2;\n}\n\n.ace-cobalt .ace_comment {\n font-style:italic;\ncolor:#0088FF;\n}\n\n.ace-cobalt .ace_comment.ace_doc {\n \n}\n\n.ace-cobalt .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-cobalt .ace_variable {\n color:#CCCCCC;\n}\n\n.ace-cobalt .ace_variable.ace_language {\n color:#FF80E1;\n}\n\n.ace-cobalt .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-cobalt"}),define("theme/dawn",function(a,b,c){var d=a("pilot/dom");var e=".ace-dawn .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-dawn .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-dawn .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-dawn .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-dawn .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-dawn .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-dawn .ace_scroller {\n background-color: #F9F9F9;\n}\n\n.ace-dawn .ace_text-layer {\n cursor: text;\n color: #080808;\n}\n\n.ace-dawn .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-dawn .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-dawn .ace_marker-layer .ace_selection {\n background: rgba(39, 95, 255, 0.30);\n}\n\n.ace-dawn .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-dawn .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(75, 75, 126, 0.50);\n}\n\n.ace-dawn .ace_marker-layer .ace_active_line {\n background: rgba(36, 99, 180, 0.12);\n}\n\n \n.ace-dawn .ace_invisible {\n color: rgba(75, 75, 126, 0.50);\n}\n\n.ace-dawn .ace_keyword {\n color:#794938;\n}\n\n.ace-dawn .ace_keyword.ace_operator {\n \n}\n\n.ace-dawn .ace_constant {\n color:#811F24;\n}\n\n.ace-dawn .ace_constant.ace_language {\n \n}\n\n.ace-dawn .ace_constant.ace_library {\n \n}\n\n.ace-dawn .ace_constant.ace_numeric {\n \n}\n\n.ace-dawn .ace_invalid {\n \n}\n\n.ace-dawn .ace_invalid.ace_illegal {\n text-decoration:underline;\nfont-style:italic;\ncolor:#F8F8F8;\nbackground-color:#B52A1D;\n}\n\n.ace-dawn .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#B52A1D;\n}\n\n.ace-dawn .ace_support {\n color:#691C97;\n}\n\n.ace-dawn .ace_support.ace_function {\n color:#693A17;\n}\n\n.ace-dawn .ace_function.ace_buildin {\n \n}\n\n.ace-dawn .ace_string {\n color:#0B6125;\n}\n\n.ace-dawn .ace_string.ace_regexp {\n color:#CF5628;\n}\n\n.ace-dawn .ace_comment {\n font-style:italic;\ncolor:#5A525F;\n}\n\n.ace-dawn .ace_comment.ace_doc {\n \n}\n\n.ace-dawn .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-dawn .ace_variable {\n color:#234A97;\n}\n\n.ace-dawn .ace_variable.ace_language {\n \n}\n\n.ace-dawn .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-dawn"}),define("theme/eclipse",function(a,b,c){var d=a("pilot/dom");var e=a("text!ace/theme/eclipse.css");d.importCssString(e),b.cssClass="ace-eclipse"}),define("theme/idle_fingers",function(a,b,c){var d=a("pilot/dom");var e=".ace-idle-fingers .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-idle-fingers .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-idle-fingers .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-idle-fingers .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-idle-fingers .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-idle-fingers .ace_scroller {\n background-color: #323232;\n}\n\n.ace-idle-fingers .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-idle-fingers .ace_cursor {\n border-left: 2px solid #91FF00;\n}\n\n.ace-idle-fingers .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #91FF00;\n}\n \n.ace-idle-fingers .ace_marker-layer .ace_selection {\n background: rgba(90, 100, 126, 0.88);\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #404040;\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_active_line {\n background: #353637;\n}\n\n \n.ace-idle-fingers .ace_invisible {\n color: #404040;\n}\n\n.ace-idle-fingers .ace_keyword {\n color:#CC7833;\n}\n\n.ace-idle-fingers .ace_keyword.ace_operator {\n \n}\n\n.ace-idle-fingers .ace_constant {\n color:#6C99BB;\n}\n\n.ace-idle-fingers .ace_constant.ace_language {\n \n}\n\n.ace-idle-fingers .ace_constant.ace_library {\n \n}\n\n.ace-idle-fingers .ace_constant.ace_numeric {\n \n}\n\n.ace-idle-fingers .ace_invalid {\n color:#FFFFFF;\nbackground-color:#FF0000;\n}\n\n.ace-idle-fingers .ace_invalid.ace_illegal {\n \n}\n\n.ace-idle-fingers .ace_invalid.ace_deprecated {\n \n}\n\n.ace-idle-fingers .ace_support {\n color:#bc9458;\n}\n\n.ace-idle-fingers .ace_support.ace_function {\n color:#B83426;\n}\n\n.ace-idle-fingers .ace_function.ace_buildin {\n \n}\n\n.ace-idle-fingers .ace_string {\n color:#A5C261;\n}\n\n.ace-idle-fingers .ace_string.ace_regexp {\n color:#CCCC33;\n}\n\n.ace-idle-fingers .ace_comment {\n font-style:italic;\n color:#BC9458;\n}\n\n.ace-idle-fingers .ace_comment.ace_doc {\n \n}\n\n.ace-idle-fingers .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-idle-fingers .ace_variable {\n color:#b7dff8;\n}\n\n.ace-idle-fingers .ace_variable.ace_language {\n color:#b7dff8;\n}\n\n.ace-idle-fingers .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-idle-fingers"}),define("theme/kr_theme",function(a,b,c){var d=a("pilot/dom");var e=".ace-kr-theme .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-kr-theme .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-kr-theme .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-kr-theme .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-kr-theme .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-kr-theme .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-kr-theme .ace_scroller {\n background-color: #0B0A09;\n}\n\n.ace-kr-theme .ace_text-layer {\n cursor: text;\n color: #FCFFE0;\n}\n\n.ace-kr-theme .ace_cursor {\n border-left: 2px solid #FF9900;\n}\n\n.ace-kr-theme .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FF9900;\n}\n \n.ace-kr-theme .ace_marker-layer .ace_selection {\n background: rgba(170, 0, 255, 0.45);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 177, 111, 0.32);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_active_line {\n background: #38403D;\n}\n\n \n.ace-kr-theme .ace_invisible {\n color: rgba(255, 177, 111, 0.32);\n}\n\n.ace-kr-theme .ace_keyword {\n color:#949C8B;\n}\n\n.ace-kr-theme .ace_keyword.ace_operator {\n \n}\n\n.ace-kr-theme .ace_constant {\n color:rgba(210, 117, 24, 0.76);\n}\n\n.ace-kr-theme .ace_constant.ace_language {\n \n}\n\n.ace-kr-theme .ace_constant.ace_library {\n \n}\n\n.ace-kr-theme .ace_constant.ace_numeric {\n \n}\n\n.ace-kr-theme .ace_invalid {\n color:#F8F8F8;\nbackground-color:#A41300;\n}\n\n.ace-kr-theme .ace_invalid.ace_illegal {\n \n}\n\n.ace-kr-theme .ace_invalid.ace_deprecated {\n \n}\n\n.ace-kr-theme .ace_support {\n color:#9FC28A;\n}\n\n.ace-kr-theme .ace_support.ace_function {\n color:#85873A;\n}\n\n.ace-kr-theme .ace_function.ace_buildin {\n \n}\n\n.ace-kr-theme .ace_string {\n \n}\n\n.ace-kr-theme .ace_string.ace_regexp {\n color:rgba(125, 255, 192, 0.65);\n}\n\n.ace-kr-theme .ace_comment {\n font-style:italic;\ncolor:#706D5B;\n}\n\n.ace-kr-theme .ace_comment.ace_doc {\n \n}\n\n.ace-kr-theme .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-kr-theme .ace_variable {\n color:#D1A796;\n}\n\n.ace-kr-theme .ace_variable.ace_language {\n color:#FF80E1;\n}\n\n.ace-kr-theme .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-kr-theme"}),define("theme/mono_industrial",function(a,b,c){var d=a("pilot/dom");var e=".ace-mono-industrial .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-mono-industrial .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-mono-industrial .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-mono-industrial .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-mono-industrial .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-mono-industrial .ace_scroller {\n background-color: #222C28;\n}\n\n.ace-mono-industrial .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-mono-industrial .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-mono-industrial .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-mono-industrial .ace_marker-layer .ace_selection {\n background: rgba(145, 153, 148, 0.40);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(102, 108, 104, 0.50);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_active_line {\n background: rgba(12, 13, 12, 0.25);\n}\n\n \n.ace-mono-industrial .ace_invisible {\n color: rgba(102, 108, 104, 0.50);\n}\n\n.ace-mono-industrial .ace_keyword {\n color:#A39E64;\n}\n\n.ace-mono-industrial .ace_keyword.ace_operator {\n color:#A8B3AB;\n}\n\n.ace-mono-industrial .ace_constant {\n color:#E98800;\n}\n\n.ace-mono-industrial .ace_constant.ace_language {\n \n}\n\n.ace-mono-industrial .ace_constant.ace_library {\n \n}\n\n.ace-mono-industrial .ace_constant.ace_numeric {\n color:#E98800;\n}\n\n.ace-mono-industrial .ace_invalid {\n color:#FFFFFF;\nbackground-color:rgba(153, 0, 0, 0.68);\n}\n\n.ace-mono-industrial .ace_invalid.ace_illegal {\n \n}\n\n.ace-mono-industrial .ace_invalid.ace_deprecated {\n \n}\n\n.ace-mono-industrial .ace_support {\n \n}\n\n.ace-mono-industrial .ace_support.ace_function {\n color:#588E60;\n}\n\n.ace-mono-industrial .ace_function.ace_buildin {\n \n}\n\n.ace-mono-industrial .ace_string {\n \n}\n\n.ace-mono-industrial .ace_string.ace_regexp {\n \n}\n\n.ace-mono-industrial .ace_comment {\n color:#666C68;\nbackground-color:#151C19;\n}\n\n.ace-mono-industrial .ace_comment.ace_doc {\n \n}\n\n.ace-mono-industrial .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-mono-industrial .ace_variable {\n \n}\n\n.ace-mono-industrial .ace_variable.ace_language {\n color:#648BD2;\n}\n\n.ace-mono-industrial .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-mono-industrial"}),define("theme/monokai",function(a,b,c){var d=a("pilot/dom");var e=".ace-monokai .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-monokai .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-monokai .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-monokai .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-monokai .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-monokai .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-monokai .ace_scroller {\n background-color: #272822;\n}\n\n.ace-monokai .ace_text-layer {\n cursor: text;\n color: #F8F8F2;\n}\n\n.ace-monokai .ace_cursor {\n border-left: 2px solid #F8F8F0;\n}\n\n.ace-monokai .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #F8F8F0;\n}\n \n.ace-monokai .ace_marker-layer .ace_selection {\n background: #49483E;\n}\n\n.ace-monokai .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #49483E;\n}\n\n.ace-monokai .ace_marker-layer .ace_active_line {\n background: #49483E;\n}\n\n \n.ace-monokai .ace_invisible {\n color: #49483E;\n}\n\n.ace-monokai .ace_keyword {\n color:#F92672;\n}\n\n.ace-monokai .ace_keyword.ace_operator {\n \n}\n\n.ace-monokai .ace_constant {\n \n}\n\n.ace-monokai .ace_constant.ace_language {\n color:#AE81FF;\n}\n\n.ace-monokai .ace_constant.ace_library {\n \n}\n\n.ace-monokai .ace_constant.ace_numeric {\n color:#AE81FF;\n}\n\n.ace-monokai .ace_invalid {\n color:#F8F8F0;\nbackground-color:#F92672;\n}\n\n.ace-monokai .ace_invalid.ace_illegal {\n \n}\n\n.ace-monokai .ace_invalid.ace_deprecated {\n color:#F8F8F0;\nbackground-color:#AE81FF;\n}\n\n.ace-monokai .ace_support {\n \n}\n\n.ace-monokai .ace_support.ace_function {\n color:#66D9EF;\n}\n\n.ace-monokai .ace_function.ace_buildin {\n \n}\n\n.ace-monokai .ace_string {\n color:#E6DB74;\n}\n\n.ace-monokai .ace_string.ace_regexp {\n \n}\n\n.ace-monokai .ace_comment {\n color:#75715E;\n}\n\n.ace-monokai .ace_comment.ace_doc {\n \n}\n\n.ace-monokai .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-monokai .ace_variable {\n \n}\n\n.ace-monokai .ace_variable.ace_language {\n \n}\n\n.ace-monokai .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-monokai"}),define("theme/pastel_on_dark",function(a,b,c){var d=a("pilot/dom");var e=".ace-pastel-on-dark .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-pastel-on-dark .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-pastel-on-dark .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-pastel-on-dark .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-pastel-on-dark .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-pastel-on-dark .ace_scroller {\n background-color: #2c2828;\n}\n\n.ace-pastel-on-dark .ace_text-layer {\n cursor: text;\n color: #8f938f;\n}\n\n.ace-pastel-on-dark .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-pastel-on-dark .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-pastel-on-dark .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-pastel-on-dark .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-pastel-on-dark .ace_keyword {\n color:#757ad8;\n}\n\n.ace-pastel-on-dark .ace_keyword.ace_operator {\n color:#797878;\n}\n\n.ace-pastel-on-dark .ace_constant {\n color:#4fb7c5;\n}\n\n.ace-pastel-on-dark .ace_constant.ace_language {\n \n}\n\n.ace-pastel-on-dark .ace_constant.ace_library {\n \n}\n\n.ace-pastel-on-dark .ace_constant.ace_numeric {\n \n}\n\n.ace-pastel-on-dark .ace_invalid {\n \n}\n\n.ace-pastel-on-dark .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-pastel-on-dark .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-pastel-on-dark .ace_support {\n color:#9a9a9a;\n}\n\n.ace-pastel-on-dark .ace_support.ace_function {\n color:#aeb2f8;\n}\n\n.ace-pastel-on-dark .ace_function.ace_buildin {\n \n}\n\n.ace-pastel-on-dark .ace_string {\n color:#66a968;\n}\n\n.ace-pastel-on-dark .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-pastel-on-dark .ace_comment {\n color:#656865;\n}\n\n.ace-pastel-on-dark .ace_comment.ace_doc {\n color:A6C6FF;\n}\n\n.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag {\n color:A6C6FF;\n}\n\n.ace-pastel-on-dark .ace_variable {\n color:#bebf55;\n}\n\n.ace-pastel-on-dark .ace_variable.ace_language {\n color:#bebf55;\n}\n\n.ace-pastel-on-dark .ace_xml_pe {\n color:#494949;\n}";d.importCssString(e),b.cssClass="ace-pastel-on-dark"}),define("theme/textmate",function(a,b,c){var d=a("pilot/dom");var e=a("text!ace/theme/tm.css");d.importCssString(e),b.cssClass="ace-tm"}),define("theme/twilight",function(a,b,c){var d=a("pilot/dom");var e=".ace-twilight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-twilight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-twilight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-twilight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-twilight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-twilight .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-twilight .ace_scroller {\n background-color: #141414;\n}\n\n.ace-twilight .ace_text-layer {\n cursor: text;\n color: #F8F8F8;\n}\n\n.ace-twilight .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-twilight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_keyword {\n color:#CDA869;\n}\n\n.ace-twilight .ace_keyword.ace_operator {\n \n}\n\n.ace-twilight .ace_constant {\n color:#CF6A4C;\n}\n\n.ace-twilight .ace_constant.ace_language {\n \n}\n\n.ace-twilight .ace_constant.ace_library {\n \n}\n\n.ace-twilight .ace_constant.ace_numeric {\n \n}\n\n.ace-twilight .ace_invalid {\n \n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-twilight .ace_support {\n color:#9B859D;\n}\n\n.ace-twilight .ace_support.ace_function {\n color:#DAD085;\n}\n\n.ace-twilight .ace_function.ace_buildin {\n \n}\n\n.ace-twilight .ace_string {\n color:#8F9D6A;\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-twilight .ace_comment {\n font-style:italic;\ncolor:#5F5A60;\n}\n\n.ace-twilight .ace_comment.ace_doc {\n \n}\n\n.ace-twilight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-twilight .ace_variable {\n color:#7587A6;\n}\n\n.ace-twilight .ace_variable.ace_language {\n \n}\n\n.ace-twilight .ace_xml_pe {\n color:#494949;\n}";d.importCssString(e),b.cssClass="ace-twilight"}),define("tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidthw)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

Welcome to Skywriter - Code in the Cloud

",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

Sub-Commands of "+e.name+"

"),d.push("

"+e.description+"

")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

Commands starting with '"+b.search+"':

")):d.push("

Available Commands:

");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
"+e.name+""+e.description+"
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
"}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

"+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
"})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("cockpit/cli",function(a,b,c){var d=a("pilot/console");var e=a("pilot/lang");var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/types");var i=a("pilot/types").Status;var j=a("pilot/types").Conversion;var k=a("pilot/canon");b.startup=function(a,b){k.upgradeType("command",p)};function l(a,b,c,d,e){this.status=a,this.message=b;if(typeof c==="number")this.start=c,this.end=d,this.predictions=e;else{var f=c;this.start=f.start,this.end=f.end,this.predictions=f.predictions}}l.prototype={},l.sort=function(a,b){b!==undefined&&a.forEach(function(a){a.start===n.AT_CURSOR?a.distance=0:ba.end?a.distance=b-a.end:a.distance=0},this),a.sort(function(a,c){if(b!==undefined){var d=a.distance-c.distance;if(d!=0)return d}return c.status-a.status}),b!==undefined&&a.forEach(function(a){delete a.distance},this);return a},b.Hint=l;function m(a,b){this.status=a.status,this.message=a.message,b?(this.start=b.start,this.end=b.end):(this.start=0,this.end=0),this.predictions=a.predictions}f.inherits(m,l);function n(a,b,c,d,e,f){this.emitter=a,this.setText(b),this.start=c,this.end=d,this.prefix=e,this.suffix=f}n.prototype={merge:function(a){if(a.emitter!=this.emitter)throw new Error("Can't merge Arguments from different EventEmitters");return new n(this.emitter,this.text+this.suffix+a.prefix+a.text,this.start,a.end,this.prefix,a.suffix)},setText:function(a){if(a==null)throw new Error("Illegal text for Argument: "+a);var b={argument:this,oldText:this.text,text:a};this.text=a,this.emitter._dispatchEvent("argumentChange",b)},toString:function(){return this.prefix+this.text+this.suffix}},n.merge=function(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var d;for(var e=b;e: ";this.param.description&&(b+=this.param.description.trim(),b.charAt(b.length-1)!=="."&&(b+="."),b.charAt(b.length-1)!==" "&&(b+=" "));var c=i.VALID;var d=this.arg?this.arg.start:n.AT_CURSOR;var e=this.arg?this.arg.end:n.AT_CURSOR;var f;this.conversion&&(c=this.conversion.status,this.conversion.message&&(b+=this.conversion.message),f=this.conversion.predictions);var g=this.arg&&this.arg.text!=="";var h=this.value!==undefined||g;this.param.defaultValue===undefined&&!h&&(c=i.INVALID,b+="Required");return new l(c,b,d,e,f)},complete:function(){this.conversion&&this.conversion.predictions&&this.conversion.predictions.length>0&&this.setValue(this.conversion.predictions[0])},isPositionCaptured:function(a){if(!this.arg)return false;if(this.arg.start===-1)return false;if(a>this.arg.end)return false;if(a===this.arg.end)return this.conversion.status!==i.VALID||this.conversion.predictions.length!==0;return true},decrement:function(){var a=this.param.type.decrement(this.value);a!=null&&this.setValue(a)},increment:function(){var a=this.param.type.increment(this.value);a!=null&&this.setValue(a)},toString:function(){return this.arg?this.arg.toString():""}},b.Assignment=o;var p={name:"__command",type:"command",description:"The command to execute",getCustomHint:function(a,b){var c=[];c.push(" > "),c.push(a.name),a.params&&a.params.length>0&&a.params.forEach(function(a){a.defaultValue===undefined?c.push(" ["+a.name+"]"):c.push(" ["+a.name+"]")},this),c.push("
"),c.push(a.description?a.description:"(No description)"),c.push("
"),a.params&&a.params.length>0&&(c.push("
    "),a.params.forEach(function(a){c.push("
  • "),c.push(""+a.name+": "),c.push(a.description?a.description:"(No description)"),a.defaultValue===undefined?c.push(" [Required]"):a.defaultValue===null?c.push(" [Optional]"):c.push(" [Default: "+a.defaultValue+"]"),c.push("
  • ")},this),c.push("
"));return new l(i.VALID,c.join(""),b)}};function q(a){this.env=a,this.commandAssignment=new o(p,this)}q.prototype={commandAssignment:undefined,assignmentCount:undefined,_assignments:undefined,_hints:undefined,_assignmentChanged:function(a){a.param.name!=="__command"||(this._assignments={},a.value&&a.value.params.forEach(function(a){this._assignments[a.name]=new o(a,this)},this),this.assignmentCount=Object.keys(this._assignments).length,this._dispatchEvent("commandChange",{command:a.value}))},getAssignment:function(a){var b=typeof a==="string"?a:Object.keys(this._assignments)[a];return this._assignments[b]},getParameterNames:function(){return Object.keys(this._assignments)},cloneAssignments:function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)},_updateHints:function(){this.getAssignments(true).forEach(function(a){this._hints.push(a.getHint())},this),l.sort(this._hints)},getWorstHint:function(){return this._hints[0]},getArgsObject:function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.value},this);return a},getAssignments:function(a){var b=[];a===true&&b.push(this.commandAssignment),Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b},setDefaultValues:function(){this.getAssignments().forEach(function(a){a.setValue(undefined)},this)},exec:function(){k.exec(this.commandAssignment.value,this.env,this.getArgsObject(),this.toCanonicalString())},toCanonicalString:function(){var a=[];a.push(this.commandAssignment.value.name),Object.keys(this._assignments).forEach(function(b){var c=this._assignments[b];var d=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(d.stringify(c.value)))},this);return a.join("")}},f.implement(q.prototype,g),b.Requisition=q;function r(a,b){q.call(this,a),b&&b.flags&&(this.flags=b.flags)}f.inherits(r,q),function(){r.prototype.update=function(a){this.input=a,this._hints=[];var b=this._tokenize(a.typed);this._split(b),this.commandAssignment.value&&this._assign(b),this._updateHints()},r.prototype.getInputStatusMarkup=function(){var a=this.toString().split("").map(function(a){return i.VALID});this._hints.forEach(function(b){for(var c=b.start;c<=b.end;c++)b.status>a[c]&&(a[c]=b.status)},this);return a},r.prototype.toString=function(){return this.getAssignments(true).map(function(a){return a.toString()},this).join("")};var a=r.prototype._updateHints;r.prototype._updateHints=function(){a.call(this);var b=this.input.cursor;this._hints.forEach(function(a){var c=b.start>=a.start&&b.start<=a.end;var d=b.end>=a.start&&b.end<=a.end;var e=c||d;!e&&a.status===i.INCOMPLETE&&(a.status=i.INVALID)},this),l.sort(this._hints)},r.prototype.getHints=function(){return this._hints},r.prototype.getAssignmentAt=function(a){var b=this.getAssignments(true);for(var c=0;c=a.length){if(f!==b){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,""))}else if(h!==i){var m=a.substring(i,h);var o=k[k.length-1];o?o.suffix+=m:(o=new n(this,"",h,h,m,""),k.push(o))}break}var p=a[h];switch(f){case b:p==="'"?(j=a.substring(i,h+1),f=d,i=h+1):p==="\""?(j=a.substring(i,h+1),f=e,i=h+1):/ /.test(p)||(j=a.substring(i,h),f=c,i=h);break;case c:if(p===" "){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,"")),f=b,i=h,j=""}break;case d:if(p==="'"){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}break;case e:if(p==="\""){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}}h++}return k},r.prototype._split=function(a){var b=1;var c;while(b<=a.length){var c=n.merge(a,0,b);this.commandAssignment.setArgument(c);if(!this.commandAssignment.value)break;if(this.commandAssignment.value.exec){for(var d=0;d=a.length)break;continue}b.param.type.name==="boolean"?b.setValue(true):f+10){var g=n.merge(a);this._hints.push(new l(i.INVALID,"Input '"+g.text+"' makes no sense.",g))}}}}(),b.CliRequisition=r}),define("cockpit/commands/basic",function(a,b,c){var d=a("pilot/typecheck");var e=a("pilot/canon");var f=a("pilot/types").Type;var g=a("pilot/types");var h={name:"sh",description:"Execute a system command (requires server support)",params:[{name:"command",type:"text",description:"The string to send to the os shell."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,true),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
"+d.responseText+"
"))},d.send(null)}};var i={name:"git",description:"Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals."};var j={name:"git add",description:"Add file contents to the index",manual:"This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit. It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.
The \"index\" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working directory, and before running the commit command, you must use the add command to add any new or modified files to the index.
This command can be performed multiple times before a commit. It only adds the content of the specified file(s) at the time the add command is run; if you want subsequent changes included in the next commit, then you must run git add again to add the new content to the index.
The git status command can be used to obtain a summary of which files have changes that are staged for the next commit.
The git add command will not add ignored files by default. If any ignored files were explicitly specified on the command line, git add will fail with a list of ignored files. Ignored files reached by directory recursion or filename globbing performed by Git (quote your globs before the shell) will be silently ignored. The git add command can be used to add ignored files with the -f (force) option.
Please see git-commit(1) for alternative ways to add content to a commit.",params:[{name:"dry-run","short":"n",type:"bool",description:"Don't actually add the file(s), just show if they exist and/or will be ignored."},{name:"verbose","short":"v",type:"bool",description:"Be verbose."},{name:"force","short":"f",type:"bool",description:"Allow adding otherwise ignored files."},{name:"update","short":"u",type:"bool",description:"Only match filepattern against already tracked files in the index rather than the working tree.",manual:"That means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove files from the index if the corresponding files in the working tree have been removed.
If no is given, default to \".\"; in other words, update all tracked files in the current directory and its subdirectories."},{name:"all","short":"A",type:"bool",description:"Like -u, but match filepattern against files in the working tree in addition to the index.",manual:"That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree."},{name:"intent-to-add","short":"N",type:"bool",description:"Record only the fact that the path will be added later.",manual:"An entry for the path is placed in the index with no content. This is useful for, among other things, showing the unstaged content of such files with git diff and committing them with git commit -a."},{name:"refresh",type:"bool",description:"Don't add the file(s), but only refresh their stat() information in the index."},{name:"ignore-errors",type:"bool",description:"If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.",manual:"The command shall still exit with non-zero status."},{name:"ignore-missing",type:"bool",description:"By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.",manual:"This option can only be used together with --dry-run."},{name:"filepattern",type:"text[]",description:"Files to add content from.",manual:"Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,true),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
"+d.responseText+"
"))},d.send(null)}};var k=new f;k.stringify=function(a){return a},k.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to commitObject.parse()");return new Conversion(a)},k.name="commitObject";var l=new f;l.stringify=function(a){return a},l.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to existingFile.parse()");return new Conversion(a)},l.name="existingFile";var m={name:"git commit",description:"Record changes to the repository",manual:"Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
The content to be added can be specified in several ways:
1. by using git add to incrementally \"add\" changes to the index before using the commit command (Note: even modified files must be \"added\");
2. by using git rm to remove files from the working tree and the index, again before using the commit command;
3. by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);
4. by using the -a switch with the commit command to automatically \"add\" changes from all known files (i.e. all files that are already listed in the index) and to automatically \"rm\" files in the index that have been removed from the working tree, and then perform the actual commit;
5. by using the --interactive switch with the commit command to decide one by one which files should be part of the commit, before finalizing the operation. Currently, this is done by invoking git add --interactive.
The --dry-run option can be used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters (options and paths).
If you make a commit and then find a mistake immediately after that, you can recover from it with git reset.",params:[{name:"all","short":"a",type:"bool",description:"Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected."},{name:"reuse-message","short":"C",type:"commitObject",description:"Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit."},{name:"reset-author",type:"bool",description:"When used with --reuse-message/--amend options, declare that the authorship of the resulting commit now belongs of the committer. This also renews the author timestamp."},{name:"short",type:"bool",description:"When doing a dry-run, give the output in the short-format.",manual:"See git-status(1) for details. Implies --dry-run."},{name:"porcelain",type:"bool",description:"When doing a dry-run, give the output in a porcelain-ready format.",manual:"See git-status(1) for details. Implies --dry-run."},{name:"terminate-nul","short":"z",type:"bool",description:"When showing short or porcelain status output, terminate entries in the status output with NUL, instead of LF.",manual:"If no format is given, implies the --porcelain output format."},{name:"file","short":"F",type:"existingFile",description:"Take the commit message from the given file.",manual:""},{name:"author",type:"text",description:"Override the commit author.",manual:"Specify an explicit author using the standard A U Thor format. Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found."},{name:"date",type:"text",description:"Override the author date used in the commit."},{name:"message","short":"m",type:"text",description:"Use the given message as the commit message."},{name:"signoff","short":"s",type:"bool",description:"Add Signed-off-by line by the committer at the end of the commit log message."},{name:"no-verify","short":"n",type:"bool",description:"This option bypasses the pre-commit and commit-msg hooks. See also githooks(5)."},{name:"cleanup",type:{name:"selection",data:["verbatim","whitespace","strip","default"]},description:"This option sets how the commit message is cleaned up.",manual:"The default mode will strip leading and trailing empty lines and commentary from the commit message only if the message is to be edited. Otherwise only whitespace removed. The verbatim mode does not change message at all, whitespace removes just leading/trailing whitespace lines and strip removes both whitespace and commentary."},{name:"amend",type:"bool",description:"Used to amend the tip of the current branch.",manual:"Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create replaces the current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded."},{name:"include","short":"i",type:"bool",description:"Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.",manual:"This is usually not what you want unless you are concluding a conflicted merge."},{name:"only","short":"o",type:"bool",description:"Make a commit only from the paths specified on the command line, disregarding any contents that have been staged so far.",manual:"This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged."},{name:"untracked-files","short":"u",type:{name:"selection",data:["no","normal","all"]},description:"Show untracked files (Default: all).",manual:"The mode parameter is optional, and is used to specify the handling of untracked files. The possible options are: no - Show no untracked files.
normal Shows untracked files and directories
all Also shows individual files in untracked directories."},{name:"verbose","short":"v",type:"bool",description:"Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template.",manual:"Note that this diff output doesn't have its lines prefixed with #."},{name:"quiet","short":"q",type:"bool",description:"Suppress commit summary message."},{name:"dry-run",type:"bool",description:"Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked."},{name:"status",type:"bool",description:"Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message.",manual:"Defaults to on, but can be used to override configuration variable commit.status."},{name:"no-status",type:"bool",description:"Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message."},{name:"file",type:"existingFile[]",description:"When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged.",manual:"The contents of these files are also staged for the next commit on top of what have been staged before."}],exec:function(a,b,c){}};var n=[i,j,m,h];var e=a("pilot/canon");b.startup=function(a,b){g.registerType(k),g.registerType(l),n.forEach(function(a){e.addCommand(a)},this)},b.shutdown=function(a,b){n.forEach(function(a){e.removeCommand(a)},this),g.unregisterType(k),g.unregisterType(l)}}),define("cockpit/index",function(a,b,c){b.startup=function(b,c){var d=a("pilot/index");a("cockpit/cli").startup(b,c),window.testCli=a("cockpit/test/testCli"),a("cockpit/ui/settings").startup(b,c),a("cockpit/ui/cliView").startup(b,c),a("cockpit/commands/basic").startup(b,c)}}),define("cockpit/ui/cliView",function(a,b,c){var d=a("text!cockpit/ui/cliView.css");var e=a("pilot/dom");e.importCssString(d);var f=a("pilot/canon");var g=a("pilot/types").Status;var h=a("pilot/keyboard/keyutil");var i=a("cockpit/cli").CliRequisition;var j=a("cockpit/cli").Hint;var k=a("cockpit/ui/requestView").RequestView;var l=new j(g.VALID,"",0,0);b.startup=function(a,b){var c=new i(a.env);var d=new m(c,a.env)};function m(a,b){this.cli=a,this.doc=document,this.win=this.doc.defaultView,this.element=this.doc.getElementById("cockpitInput");this.element?(this.settings=b.settings,this.hintDirection=this.settings.getSetting("hintDirection"),this.outputDirection=this.settings.getSetting("outputDirection"),this.outputHeight=this.settings.getSetting("outputHeight"),this.isUpdating=false,this.createElements(),this.update()):console.log("No element with an id of cockpit. Bailing on cli")}m.prototype={createElements:function(){var a=this.element;this.element.spellcheck=false,this.output=this.doc.getElementById("cockpitOutput"),this.popupOutput=this.output==null;if(!this.output){this.output=this.doc.createElement("div"),this.output.id="cockpitOutput",this.output.className="cptFocusPopup",a.parentNode.insertBefore(this.output,a.nextSibling);var b=function(){this.output.style.maxHeight=this.outputHeight.get()+"px"}.bind(this);this.outputHeight.addEventListener("change",b),b()}this.completer=this.doc.createElement("div"),this.completer.className="cptCompletion VALID";var c=window.getComputedStyle(a,null);this.completer.style.color=c.color,this.completer.style.fontSize=c.fontSize,this.completer.style.fontFamily=c.fontFamily,this.completer.style.fontWeight=c.fontWeight,this.completer.style.fontStyle=c.fontStyle,a.parentNode.insertBefore(this.completer,a.nextSibling),this.completer.style.backgroundColor=a.style.backgroundColor,a.style.backgroundColor="transparent",this.hinter=this.doc.createElement("div"),this.hinter.className="cptHints cptFocusPopup",a.parentNode.insertBefore(this.hinter,a.nextSibling);var d=this.resizer.bind(this);this.win.addEventListener("resize",d,false),this.hintDirection.addEventListener("change",d),this.outputDirection.addEventListener("change",d),d(),f.addEventListener("output",function(a){new k(a.request,this)}.bind(this)),h.addKeyDownListener(a,this.onKeyDown.bind(this)),a.addEventListener("keyup",this.onKeyUp.bind(this),true),a.addEventListener("mouseup",function(a){this.isUpdating=true,this.update(),this.isUpdating=false}.bind(this),false),this.cli.addEventListener("argumentChange",this.onArgChange.bind(this))},scrollOutputToBottom:function(){var a=Math.max(this.output.scrollHeight,this.output.clientHeight);this.output.scrollTop=a-this.output.clientHeight},resizer:function(){var a=this.element.getClientRects()[0];this.completer.style.top=a.top+"px",this.completer.style.height=a.height+"px",this.completer.style.lineHeight=a.height+"px",this.completer.style.left=a.left+"px",this.completer.style.width=a.width+"px",this.hintDirection.get()==="below"?(this.hinter.style.top=a.bottom+"px",this.hinter.style.bottom="auto"):(this.hinter.style.top="auto",this.hinter.style.bottom=this.win.innerHeight-a.top+"px"),this.hinter.style.left=a.left+30+"px",this.hinter.style.maxWidth=a.width-110+"px",this.popupOutput&&(this.outputDirection.get()==="below"?(this.output.style.top=a.bottom+"px",this.output.style.bottom="auto"):(this.output.style.top="auto",this.output.style.bottom=this.win.innerHeight-a.top+"px"),this.output.style.left=a.left+"px",this.output.style.width=a.width-80+"px")},onKeyDown:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.TAB||a.keyCode===h.KeyHelper.KEY.UP||a.keyCode===h.KeyHelper.KEY.DOWN)return true;return b},onKeyUp:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.RETURN){var c=this.cli.getWorstHint();c.status===g.VALID?(this.cli.exec(),this.element.value=""):(this.element.selectionStart=c.start,this.element.selectionEnd=c.end)}this.update();var d=this.cli.getAssignmentAt(this.element.selectionStart);d&&(a.keyCode===h.KeyHelper.KEY.TAB&&(d.complete(),this.update()),a.keyCode===h.KeyHelper.KEY.UP&&(d.increment(),this.update()),a.keyCode===h.KeyHelper.KEY.DOWN&&(d.decrement(),this.update()));return b},update:function(){this.isUpdating=true;var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};this.cli.update(a);var b=this.cli.getAssignmentAt(a.cursor.start).getHint();e.removeCssClass(this.completer,g.VALID.toString()),e.removeCssClass(this.completer,g.INCOMPLETE.toString()),e.removeCssClass(this.completer,g.INVALID.toString());var c="> ";if(this.element.value.length>0){var d=this.cli.getInputStatusMarkup();c+=this.markupStatusScore(d)}if(this.element.value.length>0&&b.predictions&&b.predictions.length>0){var f=b.predictions[0];c+="  ⇥ "+(f.name?f.name:f)}this.completer.innerHTML=c,e.addCssClass(this.completer,this.cli.getWorstHint().status.toString());var h="";this.element.value.length!==0&&(h+=b.message,b.predictions&&b.predictions.length>0&&(h+=": [ ",b.predictions.forEach(function(a){h+=a.name?a.name:a,h+=" | "},this),h=h.replace(/\| $/,"]"))),this.hinter.innerHTML=h,h.length===0?e.addCssClass(this.hinter,"cptNoPopup"):e.removeCssClass(this.hinter,"cptNoPopup"),this.isUpdating=false},markupStatusScore:function(a){var b="";var c=0;var d=-1;while(true){d!==a[c]&&(b+="",d=a[c]),b+=this.element.value[c],c++;if(c===this.element.value.length){b+="";break}d!==a[c]&&(b+="")}return b},onArgChange:function(a){if(!this.isUpdating){var b=this.element.value.substring(0,a.argument.start);var c=this.element.value.substring(a.argument.end);var d=typeof a.text==="string"?a.text:a.text.name;this.element.value=b+d+c;var e=(b+d).length;this.element.selectionStart=e,this.element.selectionEnd=e}}},b.CliView=m}),define("cockpit/ui/requestView",function(a,b,c){var d=a("pilot/dom");var e=a("pilot/event");var f=a("text!cockpit/ui/requestView.html");var g=a("pilot/domtemplate").Templater;var h=a("text!cockpit/ui/requestView.css");d.importCssString(h);var i=document.createElement("div");i.innerHTML=f;var j=i.querySelector(".cptRow");console.log(c);var k=c.id.split("/").pop()+".js";var l;if(c.uri.substr(-k.length)!==k)console.error("module.id",c.id),console.error("module.uri",c.uri),console.error("filename",k),console.error("Can't work out path from module.uri/module/id"),l=".";else{var m=c.uri.length-k.length;l=c.uri.substr(0,m)+"images"}function n(a,b){this.request=a,this.cliView=b,this.imagePath=l,this.rowin=null,this.rowout=null,this.output=null,this.hide=null,this.show=null,this.duration=null,this.throb=null,(new g).processNode(j.cloneNode(true),this),this.cliView.output.appendChild(this.rowin),this.cliView.output.appendChild(this.rowout),this.request.addEventListener("output",this.onRequestChange.bind(this))}n.prototype={copyToInput:function(){this.cliView.element.value=this.request.typed},executeRequest:function(a){this.cliView.cli.update({typed:this.request.typed,cursor:{start:0,end:0}}),this.cliView.cli.exec()},hideOutput:function(a){this.output.style.display="none",d.addCssClass(this.hide,"cmd_hidden"),d.removeCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},showOutput:function(a){this.output.style.display="block",d.removeCssClass(this.hide,"cmd_hidden"),d.addCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},remove:function(a){this.cliView.output.removeChild(this.rowin),this.cliView.output.removeChild(this.rowout),e.stopPropagation(a)},onRequestChange:function(a){this.duration.innerHTML=this.request.duration?"completed in "+this.request.duration/1e3+" sec ":"",this.output.innerHTML="",this.request.outputs.forEach(function(a){var b;typeof a=="string"?(b=document.createElement("p"),b.innerHTML=a):b=a,this.output.appendChild(b)},this),this.cliView.scrollOutputToBottom(),d.setCssClass(this.output,"cmd_error",this.request.error),this.throb.style.display=this.request.completed?"none":"block"}},b.RequestView=n}),define("cockpit/ui/settings",function(a,b,c){var d=a("pilot/types");var e=a("pilot/types/basic").SelectionType;var f=new e({name:"direction",data:["above","below"]});var g={name:"hintDirection",description:"Are hints shown above or below the command line?",type:"direction",defaultValue:"above"};var h={name:"outputDirection",description:"Is the output window shown above or below the command line?",type:"direction",defaultValue:"above"};var i={name:"outputHeight",description:"What height should the output panel be?",type:"number",defaultValue:300};b.startup=function(a,b){d.registerType(f),a.env.settings.addSetting(g),a.env.settings.addSetting(h),a.env.settings.addSetting(i)},b.shutdown=function(a,b){d.unregisterType(f),a.env.settings.removeSetting(g),a.env.settings.removeSetting(h),a.env.settings.removeSetting(i)}}),define("background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
")}}).call(e.prototype),b.Marker=e}),define("layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
"),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("mode/css",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text").Mode;var f=a("ace/tokenizer").Tokenizer;var g=a("ace/mode/css_highlight_rules").CssHighlightRules;var h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;var i=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(i,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(i.prototype),b.Mode=i}),define("mode/css_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){var a=e.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|"));var b=e.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|"));var c=e.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|"));var d=e.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|"));var f="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";function g(a){var b=[];var c=a.split("");for(var d=0;d"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<(?=s*script)",next:"script"},{token:"text",regex:"<(?=s*style)",next:"css"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],script:[{token:"text",regex:">",next:"js-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],css:[{token:"text",regex:">",next:"css-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]};var a=(new f).getRules();this.addRules(a,"js-"),this.$rules["js-start"].unshift({token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"});var b=(new e).getRules();this.addRules(b,"css-"),this.$rules["css-start"].unshift({token:"text",regex:"<\\/(?=style)",next:"tag"})};d.inherits(h,g),b.HtmlHighlightRules=h}),define("mode/javascript",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text").Mode;var f=a("ace/tokenizer").Tokenizer;var g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;var h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;var i=a("ace/range").Range;var j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=true;var f=[];var g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=false;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a);var f=e.tokens;var g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("mode/php",function(a,b,c){var d=a("pilot/oop");var e=a("./text").Mode;var f=a("../tokenizer").Tokenizer;var g=a("./php_highlight_rules").PhpHighlightRules;var h=a("./matching_brace_outdent").MatchingBraceOutdent;var i=a("../range").Range;var j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=true;var f=[];var g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=false;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a);var f=e.tokens;var g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("mode/php_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;PhpHighlightRules=function(){var a=new f;var b=e.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_response_headers|apache_setenv|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_uassoc|array_fill|array_filter|array_flip|array_intersect|array_intersect_assoc|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_push|array_rand|array_reduce|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_unique|array_unshift|array_values|array_walk|arsort|ascii2ebcdic|asin|asinh|asort|aspell_check|aspell_check_raw|aspell_new|aspell_suggest|assert|assert_options|atan|atan2|atanh|base64_decode|base64_encode|base_convert|basename|bcadd|bccomp|bcdiv|bcmod|bcmul|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|call_user_func|call_user_func_array|call_user_method|call_user_method_array|ccvs_add|ccvs_auth|ccvs_command|ccvs_count|ccvs_delete|ccvs_done|ccvs_init|ccvs_lookup|ccvs_new|ccvs_report|ccvs_return|ccvs_reverse|ccvs_sale|ccvs_status|ccvs_textvalue|ccvs_void|ceil|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_exists|clearstatcache|closedir|closelog|com|com_addref|com_get|com_invoke|com_isenum|com_load|com_load_typelib|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|convert_cyr_string|copy|cos|cosh|count|count_chars|cpdf_add_annotation|cpdf_add_outline|cpdf_arc|cpdf_begin_text|cpdf_circle|cpdf_clip|cpdf_close|cpdf_closepath|cpdf_closepath_fill_stroke|cpdf_closepath_stroke|cpdf_continue_text|cpdf_curveto|cpdf_end_text|cpdf_fill|cpdf_fill_stroke|cpdf_finalize|cpdf_finalize_page|cpdf_global_set_document_limits|cpdf_import_jpeg|cpdf_lineto|cpdf_moveto|cpdf_newpath|cpdf_open|cpdf_output_buffer|cpdf_page_init|cpdf_place_inline_image|cpdf_rect|cpdf_restore|cpdf_rlineto|cpdf_rmoveto|cpdf_rotate|cpdf_rotate_text|cpdf_save|cpdf_save_to_file|cpdf_scale|cpdf_set_action_url|cpdf_set_char_spacing|cpdf_set_creator|cpdf_set_current_page|cpdf_set_font|cpdf_set_font_directories|cpdf_set_font_map_file|cpdf_set_horiz_scaling|cpdf_set_keywords|cpdf_set_leading|cpdf_set_page_animation|cpdf_set_subject|cpdf_set_text_matrix|cpdf_set_text_pos|cpdf_set_text_rendering|cpdf_set_text_rise|cpdf_set_title|cpdf_set_viewer_preferences|cpdf_set_word_spacing|cpdf_setdash|cpdf_setflat|cpdf_setgray|cpdf_setgray_fill|cpdf_setgray_stroke|cpdf_setlinecap|cpdf_setlinejoin|cpdf_setlinewidth|cpdf_setmiterlimit|cpdf_setrgbcolor|cpdf_setrgbcolor_fill|cpdf_setrgbcolor_stroke|cpdf_show|cpdf_show_xy|cpdf_stringwidth|cpdf_stroke|cpdf_text|cpdf_translate|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|curl_close|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_version|current|cybercash_base64_decode|cybercash_base64_encode|cybercash_decr|cybercash_encr|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dblist|dbmclose|dbmdelete|dbmexists|dbmfetch|dbmfirstkey|dbminsert|dbmnextkey|dbmopen|dbmreplace|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debugger_off|debugger_on|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|dotnet_load|doubleval|each|easter_date|easter_days|ebcdic2ascii|echo|empty|end|ereg|ereg_replace|eregi|eregi_replace|error_log|error_reporting|escapeshellarg|escapeshellcmd|eval|exec|exif_imagetype|exif_read_data|exif_thumbnail|exit|exp|explode|expm1|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_select_db|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filetype|floatval|flock|floor|flush|fmod|fnmatch|fopen|fpassthru|fprintf|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gd_info|get_browser|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getcwd|getdate|getenv|gethostbyaddr|gethostbyname|gethostbynamel|getimagesize|getlastmod|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getopt|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|gettext|gettimeofday|gettype|glob|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_xor|gmstrftime|gregoriantojd|gzclose|gzcompress|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|header|headers_list|headers_sent|hebrev|hebrevc|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|http_build_query|hw_api_attribute|hw_api_content|hw_api_object|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_hgcsp|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|idate|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|image2wbmp|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepscopyfont|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchstructure|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implode|import_request_variables|in_array|ingres_autocommit|ingres_close|ingres_commit|ingres_connect|ingres_fetch_array|ingres_fetch_object|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_query|ingres_rollback|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|intval|ip2long|iptcembed|iptcparse|ircg_channel_mode|ircg_disconnect|ircg_fetch_error_msg|ircg_get_username|ircg_html_encode|ircg_ignore_add|ircg_ignore_del|ircg_invite|ircg_is_conn_alive|ircg_join|ircg_kick|ircg_list|ircg_lookup_format_messages|ircg_lusers|ircg_msg|ircg_nick|ircg_nickname_escape|ircg_nickname_unescape|ircg_notice|ircg_oper|ircg_part|ircg_pconnect|ircg_register_format_messages|ircg_set_current|ircg_set_file|ircg_set_on_die|ircg_topic|ircg_who|ircg_whois|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isset|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|juliantojd|key|krsort|ksort|lcg_value|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|levenshtein|link|linkinfo|list|localeconv|localtime|log|log10|log1p|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_strlen|mb_strpos|mb_strrpos|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcal_append_event|mcal_close|mcal_create_calendar|mcal_date_compare|mcal_date_valid|mcal_day_of_week|mcal_day_of_year|mcal_days_in_month|mcal_delete_calendar|mcal_delete_event|mcal_event_add_attribute|mcal_event_init|mcal_event_set_alarm|mcal_event_set_category|mcal_event_set_class|mcal_event_set_description|mcal_event_set_end|mcal_event_set_recur_daily|mcal_event_set_recur_monthly_mday|mcal_event_set_recur_monthly_wday|mcal_event_set_recur_none|mcal_event_set_recur_weekly|mcal_event_set_recur_yearly|mcal_event_set_start|mcal_event_set_title|mcal_expunge|mcal_fetch_current_stream_event|mcal_fetch_event|mcal_is_leap_year|mcal_list_alarms|mcal_list_events|mcal_next_recurrence|mcal_open|mcal_popen|mcal_rename_calendar|mcal_reopen|mcal_snooze|mcal_store_event|mcal_time_valid|mcal_week_of_year|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|mcve_adduser|mcve_adduserarg|mcve_bt|mcve_checkstatus|mcve_chkpwd|mcve_chngpwd|mcve_completeauthorizations|mcve_connect|mcve_connectionerror|mcve_deleteresponse|mcve_deletetrans|mcve_deleteusersetup|mcve_deluser|mcve_destroyconn|mcve_destroyengine|mcve_disableuser|mcve_edituser|mcve_enableuser|mcve_force|mcve_getcell|mcve_getcellbynum|mcve_getcommadelimited|mcve_getheader|mcve_getuserarg|mcve_getuserparam|mcve_gft|mcve_gl|mcve_gut|mcve_initconn|mcve_initengine|mcve_initusersetup|mcve_iscommadelimited|mcve_liststats|mcve_listusers|mcve_maxconntimeout|mcve_monitor|mcve_numcolumns|mcve_numrows|mcve_override|mcve_parsecommadelimited|mcve_ping|mcve_preauth|mcve_preauthcompletion|mcve_qc|mcve_responseparam|mcve_return|mcve_returncode|mcve_returnstatus|mcve_sale|mcve_setblocking|mcve_setdropfile|mcve_setip|mcve_setssl|mcve_setssl_files|mcve_settimeout|mcve_settle|mcve_text_avs|mcve_text_code|mcve_text_cv|mcve_transactionauth|mcve_transactionavs|mcve_transactionbatch|mcve_transactioncv|mcve_transactionid|mcve_transactionitem|mcve_transactionssent|mcve_transactiontext|mcve_transinqueue|mcve_transnew|mcve_transparam|mcve_transsend|mcve_ub|mcve_uwait|mcve_verifyconnection|mcve_verifysslcert|mcve_void|md5|md5_file|mdecrypt_generic|memory_get_usage|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_setcubicthreshold|ming_setscale|ming_useswfversion|mkdir|mktime|money_format|move_uploaded_file|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_getdata|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_setdata|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|muscat_close|muscat_get|muscat_give|muscat_setup|muscat_setup_net|mysql_affected_rows|mysql_change_user|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli_affected_rows|mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_change_user|mysqli_character_set_name|mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_dump_debug_info|mysqli_embedded_connect|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|mysqli_free_result|mysqli_get_client_info|mysqli_get_client_version|mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_master_query|mysqli_more_results|mysqli_multi_query|mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_prepare|mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_report|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|mysqli_send_query|mysqli_server_end|mysqli_server_init|mysqli_set_opt|mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt_init|mysqli_stmt_affected_rows|mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_free_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning_count|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|next|ngettext|nl2br|nl_langinfo|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|number_format|ob_clean|ob_end_clean|ob_end_flush|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_by_name|oci_cancel|oci_close|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_copy|oci_lob_is_equal|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|opendir|openlog|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_new|openssl_csr_sign|openssl_error_string|openssl_free_key|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ora_bind|ora_close|ora_columnname|ora_columnsize|ora_columntype|ora_commit|ora_commitoff|ora_commiton|ora_do|ora_error|ora_errorcode|ora_exec|ora_fetch|ora_fetch_into|ora_getcolumn|ora_logoff|ora_logon|ora_numcols|ora_numrows|ora_open|ora_parse|ora_plogon|ora_rollback|ord|output_add_rewrite_var|output_reset_rewrite_vars|overload|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parse_ini_file|parse_str|parse_url|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_page|pdf_begin_pattern|pdf_begin_template|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_curveto|pdf_delete|pdf_end_page|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_stroke|pdf_findfont|pdf_get_buffer|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_initgraphics|pdf_lineto|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_page|pdf_open_png|pdf_open_tiff|pdf_place_image|pdf_place_pdi_page|pdf_rect|pdf_restore|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_font|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_translate|pfpro_cleanup|pfpro_init|pfpro_process|pfpro_process_raw|pfpro_version|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_fetch_all|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_type|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_pconnect|pg_ping|pg_port|pg_put_line|pg_query|pg_result_error|pg_result_seek|pg_result_status|pg_select|pg_send_query|pg_set_client_encoding|pg_trace|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_ctermid|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_isatty|posix_kill|posix_mkfifo|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_grep|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|qdom_error|qdom_tree|quoted_printable_decode|quotemeta|rad2deg|rand|range|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_read_history|readline_write_history|readlink|realpath|recode|recode_file|recode_string|register_shutdown_function|register_tick_function|rename|reset|restore_error_handler|restore_include_path|rewind|rewinddir|rmdir|round|rsort|rtrim|scandir|sem_acquire|sem_get|sem_release|sem_remove|serialize|sesam_affected_rows|sesam_commit|sesam_connect|sesam_diagnostic|sesam_disconnect|sesam_errormsg|sesam_execimm|sesam_fetch_array|sesam_fetch_result|sesam_fetch_row|sesam_field_array|sesam_field_name|sesam_free_result|sesam_num_fields|sesam_query|sesam_rollback|sesam_seek_row|sesam_settransaction|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|set_error_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_time_limit|setcookie|setlocale|setrawcookie|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|sin|sinh|sizeof|sleep|snmp_get_quick_print|snmp_set_quick_print|snmpget|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_iovec_add|socket_iovec_alloc|socket_iovec_delete|socket_iovec_fetch|socket_iovec_free|socket_iovec_set|socket_last_error|socket_listen|socket_read|socket_readv|socket_recv|socket_recvfrom|socket_recvmsg|socket_select|socket_send|socket_sendmsg|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|socket_writev|sort|soundex|split|spliti|sprintf|sql_regcase|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_fetch_array|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqrt|srand|sscanf|stat|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_context_create|stream_context_get_options|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_register_wrapper|stream_select|stream_set_blocking|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_get_name|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_wrapper_register|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpos|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfbutton_keypress|swfdisplayitem|swffill|swffont|swfgradient|swfmorph|swfmovie|swfshape|swfsprite|swftext|swftextfield|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|syslog|system|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy_access_count|tidy_clean_repair|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_body|tidy_get_config|tidy_get_error_buffer|tidy_get_head|tidy_get_html|tidy_get_html_ver|tidy_get_output|tidy_get_release|tidy_get_root|tidy_get_status|tidy_getopt|tidy_is_xhtml|tidy_is_xml|tidy_load_config|tidy_parse_file|tidy_parse_string|tidy_repair_file|tidy_repair_string|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|time|tmpfile|token_get_all|token_name|touch|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|user_error|usleep|usort|utf8_decode|utf8_encode|var_dump|var_export|variant|version_compare|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|wordwrap|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xpath_eval|xpath_eval_expression|xpath_new_context|xptr_eval|xptr_new_context|xsl_xsltprocessor_get_parameter|xsl_xsltprocessor_has_exslt_support|xsl_xsltprocessor_import_stylesheet|xsl_xsltprocessor_register_php_functions|xsl_xsltprocessor_remove_parameter|xsl_xsltprocessor_set_parameter|xsl_xsltprocessor_transform_to_doc|xsl_xsltprocessor_transform_to_uri|xsl_xsltprocessor_transform_to_xml|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|zlib_get_coding_type".split("|"));var c=e.arrayToMap("abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|include|include_once|global|goto|if|implements|interface|instanceof|namespace|new|old_function|or|private|protected|public|return|require|require_once|static|switch|throw|try|use|var|while|xor".split("|"));var d=e.arrayToMap("true|false|null|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__CLASS__".split("|"));var g=e.arrayToMap("$_GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|"));var h=e.arrayToMap([]);this.$rules={start:[{token:"support",regex:"<\\?(?:php|\\=)"},{token:"support",regex:"\\?>"},{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(a){if(c[a])return"keyword";if(d[a])return"constant.language";if(g[a])return"variable.language";if(h[a])return"invalid.illegal";if(b[a])return"support.function";if(a=="debugger")return"invalid.deprecated";if(a.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))return"variable";return"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(PhpHighlightRules,g),b.PhpHighlightRules=PhpHighlightRules}),define("mode/python",function(a,b,c){var d=a("pilot/oop");var e=a("./text").Mode;var f=a("../tokenizer").Tokenizer;var g=a("./python_highlight_rules").PythonHighlightRules;var h=a("./matching_brace_outdent").MatchingBraceOutdent;var i=a("../range").Range;var j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=true;var f=[];var g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=false;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);var e=this.$tokenizer.getLineTokens(b,a);var f=e.tokens;var g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("mode/python_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("./text_highlight_rules").TextHighlightRules;PythonHighlightRules=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|"));var b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|"));var c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|"));var d=e.arrayToMap("".split("|"));var f="(?:(?:[rubRUB])|(?:[ubUB][rR]))?";var g="(?:(?:[1-9]\\d*)|(?:0))";var h="(?:0[oO]?[0-7]+)";var i="(?:0[xX][\\dA-Fa-f]+)";var j="(?:0[bB][01]+)";var k="(?:"+g+"|"+h+"|"+i+"|"+j+")";var l="(?:[eE][+-]?\\d+)";var m="(?:\\.\\d+)";var n="(?:\\d+)";var o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))";var p="(?:(?:"+o+"|"+n+")"+l+")";var q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+"\"{3}(?:(?:.)|(?:^\"{3}))*?\"{3}"},{token:"string",regex:f+"\"{3}.*$",next:"qqstring"},{token:"string",regex:f+"\"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\""},{token:"string",regex:f+"'{3}(?:(?:.)|(?:^'{3}))*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a[e]?"keyword":b[e]?"constant.language":d[e]?"invalid.illegal":c[e]?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:"(?:^\"{3})*?\"{3}",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:^'{3})*?'{3}",next:"start"},{token:"string",regex:".+"}]}},d.inherits(PythonHighlightRules,f),b.PythonHighlightRules=PythonHighlightRules}),define("mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer;var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return false},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;e"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:"\".*?\""},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]}};/fd/g,d.inherits(f,e),b.XmlHighlightRules=f}),define("range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("theme/clouds",function(a,b,c){var d=a("pilot/dom");var e=".ace-clouds .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-clouds .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-clouds .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-clouds .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-clouds .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-clouds .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-clouds .ace_scroller {\n background-color: #FFFFFF;\n}\n\n.ace-clouds .ace_text-layer {\n cursor: text;\n color: #000000;\n}\n\n.ace-clouds .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-clouds .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-clouds .ace_marker-layer .ace_selection {\n background: #BDD5FC;\n}\n\n.ace-clouds .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-clouds .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #BFBFBF;\n}\n\n.ace-clouds .ace_marker-layer .ace_active_line {\n background: #FFFBD1;\n}\n\n \n.ace-clouds .ace_invisible {\n color: #BFBFBF;\n}\n\n.ace-clouds .ace_keyword {\n color:#AF956F;\n}\n\n.ace-clouds .ace_keyword.ace_operator {\n color:#484848;\n}\n\n.ace-clouds .ace_constant {\n \n}\n\n.ace-clouds .ace_constant.ace_language {\n color:#39946A;\n}\n\n.ace-clouds .ace_constant.ace_library {\n \n}\n\n.ace-clouds .ace_constant.ace_numeric {\n color:#46A609;\n}\n\n.ace-clouds .ace_invalid {\n background-color:#FF002A;\n}\n\n.ace-clouds .ace_invalid.ace_illegal {\n \n}\n\n.ace-clouds .ace_invalid.ace_deprecated {\n \n}\n\n.ace-clouds .ace_support {\n \n}\n\n.ace-clouds .ace_support.ace_function {\n color:#C52727;\n}\n\n.ace-clouds .ace_function.ace_buildin {\n \n}\n\n.ace-clouds .ace_string {\n color:#5D90CD;\n}\n\n.ace-clouds .ace_string.ace_regexp {\n \n}\n\n.ace-clouds .ace_comment {\n color:#BCC8BA;\n}\n\n.ace-clouds .ace_comment.ace_doc {\n \n}\n\n.ace-clouds .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-clouds .ace_variable {\n \n}\n\n.ace-clouds .ace_variable.ace_language {\n \n}\n\n.ace-clouds .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-clouds"}),define("theme/clouds_mignight",function(a,b,c){var d=a("pilot/dom");var e=".ace-clouds-midnight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-clouds-midnight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-clouds-midnight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-clouds-midnight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-clouds-midnight .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-clouds-midnight .ace_scroller {\n background-color: #191919;\n}\n\n.ace-clouds-midnight .ace_text-layer {\n cursor: text;\n color: #929292;\n}\n\n.ace-clouds-midnight .ace_cursor {\n border-left: 2px solid #7DA5DC;\n}\n\n.ace-clouds-midnight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #7DA5DC;\n}\n \n.ace-clouds-midnight .ace_marker-layer .ace_selection {\n background: #000000;\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #BFBFBF;\n}\n\n.ace-clouds-midnight .ace_marker-layer .ace_active_line {\n background: rgba(215, 215, 215, 0.031);\n}\n\n \n.ace-clouds-midnight .ace_invisible {\n color: #BFBFBF;\n}\n\n.ace-clouds-midnight .ace_keyword {\n color:#927C5D;\n}\n\n.ace-clouds-midnight .ace_keyword.ace_operator {\n color:#4B4B4B;\n}\n\n.ace-clouds-midnight .ace_constant {\n \n}\n\n.ace-clouds-midnight .ace_constant.ace_language {\n color:#39946A;\n}\n\n.ace-clouds-midnight .ace_constant.ace_library {\n \n}\n\n.ace-clouds-midnight .ace_constant.ace_numeric {\n color:#46A609;\n}\n\n.ace-clouds-midnight .ace_invalid {\n color:#FFFFFF;\nbackground-color:#E92E2E;\n}\n\n.ace-clouds-midnight .ace_invalid.ace_illegal {\n \n}\n\n.ace-clouds-midnight .ace_invalid.ace_deprecated {\n \n}\n\n.ace-clouds-midnight .ace_support {\n \n}\n\n.ace-clouds-midnight .ace_support.ace_function {\n color:#E92E2E;\n}\n\n.ace-clouds-midnight .ace_function.ace_buildin {\n \n}\n\n.ace-clouds-midnight .ace_string {\n color:#5D90CD;\n}\n\n.ace-clouds-midnight .ace_string.ace_regexp {\n \n}\n\n.ace-clouds-midnight .ace_comment {\n color:#3C403B;\n}\n\n.ace-clouds-midnight .ace_comment.ace_doc {\n \n}\n\n.ace-clouds-midnight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-clouds-midnight .ace_variable {\n \n}\n\n.ace-clouds-midnight .ace_variable.ace_language {\n \n}\n\n.ace-clouds-midnight .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-clouds-midnight"}),define("theme/cobalt",function(a,b,c){var d=a("pilot/dom");var e=".ace-cobalt .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-cobalt .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-cobalt .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-cobalt .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-cobalt .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-cobalt .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-cobalt .ace_scroller {\n background-color: #002240;\n}\n\n.ace-cobalt .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-cobalt .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-cobalt .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-cobalt .ace_marker-layer .ace_selection {\n background: rgba(179, 101, 57, 0.75);\n}\n\n.ace-cobalt .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-cobalt .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.15);\n}\n\n.ace-cobalt .ace_marker-layer .ace_active_line {\n background: rgba(0, 0, 0, 0.35);\n}\n\n \n.ace-cobalt .ace_invisible {\n color: rgba(255, 255, 255, 0.15);\n}\n\n.ace-cobalt .ace_keyword {\n color:#FF9D00;\n}\n\n.ace-cobalt .ace_keyword.ace_operator {\n \n}\n\n.ace-cobalt .ace_constant {\n color:#FF628C;\n}\n\n.ace-cobalt .ace_constant.ace_language {\n \n}\n\n.ace-cobalt .ace_constant.ace_library {\n \n}\n\n.ace-cobalt .ace_constant.ace_numeric {\n \n}\n\n.ace-cobalt .ace_invalid {\n color:#F8F8F8;\nbackground-color:#800F00;\n}\n\n.ace-cobalt .ace_invalid.ace_illegal {\n \n}\n\n.ace-cobalt .ace_invalid.ace_deprecated {\n \n}\n\n.ace-cobalt .ace_support {\n color:#80FFBB;\n}\n\n.ace-cobalt .ace_support.ace_function {\n color:#FFB054;\n}\n\n.ace-cobalt .ace_function.ace_buildin {\n \n}\n\n.ace-cobalt .ace_string {\n \n}\n\n.ace-cobalt .ace_string.ace_regexp {\n color:#80FFC2;\n}\n\n.ace-cobalt .ace_comment {\n font-style:italic;\ncolor:#0088FF;\n}\n\n.ace-cobalt .ace_comment.ace_doc {\n \n}\n\n.ace-cobalt .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-cobalt .ace_variable {\n color:#CCCCCC;\n}\n\n.ace-cobalt .ace_variable.ace_language {\n color:#FF80E1;\n}\n\n.ace-cobalt .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-cobalt"}),define("theme/dawn",function(a,b,c){var d=a("pilot/dom");var e=".ace-dawn .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-dawn .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-dawn .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-dawn .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-dawn .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-dawn .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-dawn .ace_scroller {\n background-color: #F9F9F9;\n}\n\n.ace-dawn .ace_text-layer {\n cursor: text;\n color: #080808;\n}\n\n.ace-dawn .ace_cursor {\n border-left: 2px solid #000000;\n}\n\n.ace-dawn .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #000000;\n}\n \n.ace-dawn .ace_marker-layer .ace_selection {\n background: rgba(39, 95, 255, 0.30);\n}\n\n.ace-dawn .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-dawn .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(75, 75, 126, 0.50);\n}\n\n.ace-dawn .ace_marker-layer .ace_active_line {\n background: rgba(36, 99, 180, 0.12);\n}\n\n \n.ace-dawn .ace_invisible {\n color: rgba(75, 75, 126, 0.50);\n}\n\n.ace-dawn .ace_keyword {\n color:#794938;\n}\n\n.ace-dawn .ace_keyword.ace_operator {\n \n}\n\n.ace-dawn .ace_constant {\n color:#811F24;\n}\n\n.ace-dawn .ace_constant.ace_language {\n \n}\n\n.ace-dawn .ace_constant.ace_library {\n \n}\n\n.ace-dawn .ace_constant.ace_numeric {\n \n}\n\n.ace-dawn .ace_invalid {\n \n}\n\n.ace-dawn .ace_invalid.ace_illegal {\n text-decoration:underline;\nfont-style:italic;\ncolor:#F8F8F8;\nbackground-color:#B52A1D;\n}\n\n.ace-dawn .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#B52A1D;\n}\n\n.ace-dawn .ace_support {\n color:#691C97;\n}\n\n.ace-dawn .ace_support.ace_function {\n color:#693A17;\n}\n\n.ace-dawn .ace_function.ace_buildin {\n \n}\n\n.ace-dawn .ace_string {\n color:#0B6125;\n}\n\n.ace-dawn .ace_string.ace_regexp {\n color:#CF5628;\n}\n\n.ace-dawn .ace_comment {\n font-style:italic;\ncolor:#5A525F;\n}\n\n.ace-dawn .ace_comment.ace_doc {\n \n}\n\n.ace-dawn .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-dawn .ace_variable {\n color:#234A97;\n}\n\n.ace-dawn .ace_variable.ace_language {\n \n}\n\n.ace-dawn .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-dawn"}),define("theme/eclipse",function(a,b,c){var d=a("pilot/dom");var e=a("text!ace/theme/eclipse.css");d.importCssString(e),b.cssClass="ace-eclipse"}),define("theme/idle_fingers",function(a,b,c){var d=a("pilot/dom");var e=".ace-idle-fingers .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-idle-fingers .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-idle-fingers .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-idle-fingers .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-idle-fingers .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-idle-fingers .ace_scroller {\n background-color: #323232;\n}\n\n.ace-idle-fingers .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-idle-fingers .ace_cursor {\n border-left: 2px solid #91FF00;\n}\n\n.ace-idle-fingers .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #91FF00;\n}\n \n.ace-idle-fingers .ace_marker-layer .ace_selection {\n background: rgba(90, 100, 126, 0.88);\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #404040;\n}\n\n.ace-idle-fingers .ace_marker-layer .ace_active_line {\n background: #353637;\n}\n\n \n.ace-idle-fingers .ace_invisible {\n color: #404040;\n}\n\n.ace-idle-fingers .ace_keyword {\n color:#CC7833;\n}\n\n.ace-idle-fingers .ace_keyword.ace_operator {\n \n}\n\n.ace-idle-fingers .ace_constant {\n color:#6C99BB;\n}\n\n.ace-idle-fingers .ace_constant.ace_language {\n \n}\n\n.ace-idle-fingers .ace_constant.ace_library {\n \n}\n\n.ace-idle-fingers .ace_constant.ace_numeric {\n \n}\n\n.ace-idle-fingers .ace_invalid {\n color:#FFFFFF;\nbackground-color:#FF0000;\n}\n\n.ace-idle-fingers .ace_invalid.ace_illegal {\n \n}\n\n.ace-idle-fingers .ace_invalid.ace_deprecated {\n \n}\n\n.ace-idle-fingers .ace_support {\n color:#bc9458;\n}\n\n.ace-idle-fingers .ace_support.ace_function {\n color:#B83426;\n}\n\n.ace-idle-fingers .ace_function.ace_buildin {\n \n}\n\n.ace-idle-fingers .ace_string {\n color:#A5C261;\n}\n\n.ace-idle-fingers .ace_string.ace_regexp {\n color:#CCCC33;\n}\n\n.ace-idle-fingers .ace_comment {\n font-style:italic;\n color:#BC9458;\n}\n\n.ace-idle-fingers .ace_comment.ace_doc {\n \n}\n\n.ace-idle-fingers .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-idle-fingers .ace_variable {\n color:#b7dff8;\n}\n\n.ace-idle-fingers .ace_variable.ace_language {\n color:#b7dff8;\n}\n\n.ace-idle-fingers .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-idle-fingers"}),define("theme/kr_theme",function(a,b,c){var d=a("pilot/dom");var e=".ace-kr-theme .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-kr-theme .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-kr-theme .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-kr-theme .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-kr-theme .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-kr-theme .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-kr-theme .ace_scroller {\n background-color: #0B0A09;\n}\n\n.ace-kr-theme .ace_text-layer {\n cursor: text;\n color: #FCFFE0;\n}\n\n.ace-kr-theme .ace_cursor {\n border-left: 2px solid #FF9900;\n}\n\n.ace-kr-theme .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FF9900;\n}\n \n.ace-kr-theme .ace_marker-layer .ace_selection {\n background: rgba(170, 0, 255, 0.45);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 177, 111, 0.32);\n}\n\n.ace-kr-theme .ace_marker-layer .ace_active_line {\n background: #38403D;\n}\n\n \n.ace-kr-theme .ace_invisible {\n color: rgba(255, 177, 111, 0.32);\n}\n\n.ace-kr-theme .ace_keyword {\n color:#949C8B;\n}\n\n.ace-kr-theme .ace_keyword.ace_operator {\n \n}\n\n.ace-kr-theme .ace_constant {\n color:rgba(210, 117, 24, 0.76);\n}\n\n.ace-kr-theme .ace_constant.ace_language {\n \n}\n\n.ace-kr-theme .ace_constant.ace_library {\n \n}\n\n.ace-kr-theme .ace_constant.ace_numeric {\n \n}\n\n.ace-kr-theme .ace_invalid {\n color:#F8F8F8;\nbackground-color:#A41300;\n}\n\n.ace-kr-theme .ace_invalid.ace_illegal {\n \n}\n\n.ace-kr-theme .ace_invalid.ace_deprecated {\n \n}\n\n.ace-kr-theme .ace_support {\n color:#9FC28A;\n}\n\n.ace-kr-theme .ace_support.ace_function {\n color:#85873A;\n}\n\n.ace-kr-theme .ace_function.ace_buildin {\n \n}\n\n.ace-kr-theme .ace_string {\n \n}\n\n.ace-kr-theme .ace_string.ace_regexp {\n color:rgba(125, 255, 192, 0.65);\n}\n\n.ace-kr-theme .ace_comment {\n font-style:italic;\ncolor:#706D5B;\n}\n\n.ace-kr-theme .ace_comment.ace_doc {\n \n}\n\n.ace-kr-theme .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-kr-theme .ace_variable {\n color:#D1A796;\n}\n\n.ace-kr-theme .ace_variable.ace_language {\n color:#FF80E1;\n}\n\n.ace-kr-theme .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-kr-theme"}),define("theme/mono_industrial",function(a,b,c){var d=a("pilot/dom");var e=".ace-mono-industrial .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-mono-industrial .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-mono-industrial .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-mono-industrial .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-mono-industrial .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-mono-industrial .ace_scroller {\n background-color: #222C28;\n}\n\n.ace-mono-industrial .ace_text-layer {\n cursor: text;\n color: #FFFFFF;\n}\n\n.ace-mono-industrial .ace_cursor {\n border-left: 2px solid #FFFFFF;\n}\n\n.ace-mono-industrial .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #FFFFFF;\n}\n \n.ace-mono-industrial .ace_marker-layer .ace_selection {\n background: rgba(145, 153, 148, 0.40);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(102, 108, 104, 0.50);\n}\n\n.ace-mono-industrial .ace_marker-layer .ace_active_line {\n background: rgba(12, 13, 12, 0.25);\n}\n\n \n.ace-mono-industrial .ace_invisible {\n color: rgba(102, 108, 104, 0.50);\n}\n\n.ace-mono-industrial .ace_keyword {\n color:#A39E64;\n}\n\n.ace-mono-industrial .ace_keyword.ace_operator {\n color:#A8B3AB;\n}\n\n.ace-mono-industrial .ace_constant {\n color:#E98800;\n}\n\n.ace-mono-industrial .ace_constant.ace_language {\n \n}\n\n.ace-mono-industrial .ace_constant.ace_library {\n \n}\n\n.ace-mono-industrial .ace_constant.ace_numeric {\n color:#E98800;\n}\n\n.ace-mono-industrial .ace_invalid {\n color:#FFFFFF;\nbackground-color:rgba(153, 0, 0, 0.68);\n}\n\n.ace-mono-industrial .ace_invalid.ace_illegal {\n \n}\n\n.ace-mono-industrial .ace_invalid.ace_deprecated {\n \n}\n\n.ace-mono-industrial .ace_support {\n \n}\n\n.ace-mono-industrial .ace_support.ace_function {\n color:#588E60;\n}\n\n.ace-mono-industrial .ace_function.ace_buildin {\n \n}\n\n.ace-mono-industrial .ace_string {\n \n}\n\n.ace-mono-industrial .ace_string.ace_regexp {\n \n}\n\n.ace-mono-industrial .ace_comment {\n color:#666C68;\nbackground-color:#151C19;\n}\n\n.ace-mono-industrial .ace_comment.ace_doc {\n \n}\n\n.ace-mono-industrial .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-mono-industrial .ace_variable {\n \n}\n\n.ace-mono-industrial .ace_variable.ace_language {\n color:#648BD2;\n}\n\n.ace-mono-industrial .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-mono-industrial"}),define("theme/monokai",function(a,b,c){var d=a("pilot/dom");var e=".ace-monokai .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-monokai .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-monokai .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-monokai .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-monokai .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-monokai .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-monokai .ace_scroller {\n background-color: #272822;\n}\n\n.ace-monokai .ace_text-layer {\n cursor: text;\n color: #F8F8F2;\n}\n\n.ace-monokai .ace_cursor {\n border-left: 2px solid #F8F8F0;\n}\n\n.ace-monokai .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #F8F8F0;\n}\n \n.ace-monokai .ace_marker-layer .ace_selection {\n background: #49483E;\n}\n\n.ace-monokai .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #49483E;\n}\n\n.ace-monokai .ace_marker-layer .ace_active_line {\n background: #49483E;\n}\n\n \n.ace-monokai .ace_invisible {\n color: #49483E;\n}\n\n.ace-monokai .ace_keyword {\n color:#F92672;\n}\n\n.ace-monokai .ace_keyword.ace_operator {\n \n}\n\n.ace-monokai .ace_constant {\n \n}\n\n.ace-monokai .ace_constant.ace_language {\n color:#AE81FF;\n}\n\n.ace-monokai .ace_constant.ace_library {\n \n}\n\n.ace-monokai .ace_constant.ace_numeric {\n color:#AE81FF;\n}\n\n.ace-monokai .ace_invalid {\n color:#F8F8F0;\nbackground-color:#F92672;\n}\n\n.ace-monokai .ace_invalid.ace_illegal {\n \n}\n\n.ace-monokai .ace_invalid.ace_deprecated {\n color:#F8F8F0;\nbackground-color:#AE81FF;\n}\n\n.ace-monokai .ace_support {\n \n}\n\n.ace-monokai .ace_support.ace_function {\n color:#66D9EF;\n}\n\n.ace-monokai .ace_function.ace_buildin {\n \n}\n\n.ace-monokai .ace_string {\n color:#E6DB74;\n}\n\n.ace-monokai .ace_string.ace_regexp {\n \n}\n\n.ace-monokai .ace_comment {\n color:#75715E;\n}\n\n.ace-monokai .ace_comment.ace_doc {\n \n}\n\n.ace-monokai .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-monokai .ace_variable {\n \n}\n\n.ace-monokai .ace_variable.ace_language {\n \n}\n\n.ace-monokai .ace_xml_pe {\n \n}";d.importCssString(e),b.cssClass="ace-monokai"}),define("theme/pastel_on_dark",function(a,b,c){var d=a("pilot/dom");var e=".ace-pastel-on-dark .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-pastel-on-dark .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-pastel-on-dark .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-pastel-on-dark .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-pastel-on-dark .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-pastel-on-dark .ace_scroller {\n background-color: #2c2828;\n}\n\n.ace-pastel-on-dark .ace_text-layer {\n cursor: text;\n color: #8f938f;\n}\n\n.ace-pastel-on-dark .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-pastel-on-dark .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-pastel-on-dark .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-pastel-on-dark .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-pastel-on-dark .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-pastel-on-dark .ace_keyword {\n color:#757ad8;\n}\n\n.ace-pastel-on-dark .ace_keyword.ace_operator {\n color:#797878;\n}\n\n.ace-pastel-on-dark .ace_constant {\n color:#4fb7c5;\n}\n\n.ace-pastel-on-dark .ace_constant.ace_language {\n \n}\n\n.ace-pastel-on-dark .ace_constant.ace_library {\n \n}\n\n.ace-pastel-on-dark .ace_constant.ace_numeric {\n \n}\n\n.ace-pastel-on-dark .ace_invalid {\n \n}\n\n.ace-pastel-on-dark .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-pastel-on-dark .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-pastel-on-dark .ace_support {\n color:#9a9a9a;\n}\n\n.ace-pastel-on-dark .ace_support.ace_function {\n color:#aeb2f8;\n}\n\n.ace-pastel-on-dark .ace_function.ace_buildin {\n \n}\n\n.ace-pastel-on-dark .ace_string {\n color:#66a968;\n}\n\n.ace-pastel-on-dark .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-pastel-on-dark .ace_comment {\n color:#656865;\n}\n\n.ace-pastel-on-dark .ace_comment.ace_doc {\n color:A6C6FF;\n}\n\n.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag {\n color:A6C6FF;\n}\n\n.ace-pastel-on-dark .ace_variable {\n color:#bebf55;\n}\n\n.ace-pastel-on-dark .ace_variable.ace_language {\n color:#bebf55;\n}\n\n.ace-pastel-on-dark .ace_xml_pe {\n color:#494949;\n}";d.importCssString(e),b.cssClass="ace-pastel-on-dark"}),define("theme/textmate",function(a,b,c){var d=a("pilot/dom");var e=a("text!ace/theme/tm.css");d.importCssString(e),b.cssClass="ace-tm"}),define("theme/twilight",function(a,b,c){var d=a("pilot/dom");var e=".ace-twilight .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-twilight .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-twilight .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-twilight .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-twilight .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-twilight .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-twilight .ace_scroller {\n background-color: #141414;\n}\n\n.ace-twilight .ace_text-layer {\n cursor: text;\n color: #F8F8F8;\n}\n\n.ace-twilight .ace_cursor {\n border-left: 2px solid #A7A7A7;\n}\n\n.ace-twilight .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid #A7A7A7;\n}\n \n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20);\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_marker-layer .ace_active_line {\n background: rgba(255, 255, 255, 0.031);\n}\n\n \n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.ace-twilight .ace_keyword {\n color:#CDA869;\n}\n\n.ace-twilight .ace_keyword.ace_operator {\n \n}\n\n.ace-twilight .ace_constant {\n color:#CF6A4C;\n}\n\n.ace-twilight .ace_constant.ace_language {\n \n}\n\n.ace-twilight .ace_constant.ace_library {\n \n}\n\n.ace-twilight .ace_constant.ace_numeric {\n \n}\n\n.ace-twilight .ace_invalid {\n \n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color:#F8F8F8;\nbackground-color:rgba(86, 45, 86, 0.75);\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration:underline;\nfont-style:italic;\ncolor:#D2A8A1;\n}\n\n.ace-twilight .ace_support {\n color:#9B859D;\n}\n\n.ace-twilight .ace_support.ace_function {\n color:#DAD085;\n}\n\n.ace-twilight .ace_function.ace_buildin {\n \n}\n\n.ace-twilight .ace_string {\n color:#8F9D6A;\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color:#E9C062;\n}\n\n.ace-twilight .ace_comment {\n font-style:italic;\ncolor:#5F5A60;\n}\n\n.ace-twilight .ace_comment.ace_doc {\n \n}\n\n.ace-twilight .ace_comment.ace_doc.ace_tag {\n \n}\n\n.ace-twilight .ace_variable {\n color:#7587A6;\n}\n\n.ace-twilight .ace_variable.ace_language {\n \n}\n\n.ace-twilight .ace_xml_pe {\n color:#494949;\n}";d.importCssString(e),b.cssClass="ace-twilight"}),define("tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidthw)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=!0,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

Welcome to Skywriter - Code in the Cloud

',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

Sub-Commands of "+e.name+"

"),d.push("

"+e.description+"

")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

Commands starting with '"+b.search+"':

")):d.push("

Available Commands:

");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
'+e.name+""+e.description+"
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
"}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

"+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:!0,isKeyUp:!0},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}},e={name:"historyNext",predicates:{isCommandLine:!0,isKeyUp:!0},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}},g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+"
"})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(!0){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div"),c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){function e(){return{settings:d}}var d=a("pilot/settings").settings;b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return!1}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return!0;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return!0}if(f(a))return g(a);return!0},!1),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return!0;return g(a)},!1)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(skywriter.proxy&&skywriter.proxy.xhr)skywriter.proxy.xhr.call(this,a,b,c,e,f);else{var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===4){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}return f},b.Worker=function(a){return skywriter.proxy&&skywriter.proxy.worker?new skywriter.proxy.worker(a):new Worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end,d={row:b.row,col:b.col},e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c),g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift(),j=b.comparePositions(h.start,i.start),k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){function l(){}function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}var d=a("pilot/console"),e=a("pilot/oop"),f=a("pilot/types"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)},j.prototype={get:function(){return this.value},set:function(a){this.value!==a&&(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g),k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k,l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType,e=a("pilot/types/basic").DeferredType,f=a("pilot/types"),g=a("pilot/settings").settings,h,i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}}),j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=!1;while(!0){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=!0}c&&a.predictions.push(b)}}return a}}),k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent,f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+" 1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("cockpit/cli",function(a,b,c){function r(a,b){q.call(this,a),b&&b.flags&&(this.flags=b.flags)}function q(a){this.env=a,this.commandAssignment=new o(p,this)}function o(a,b){this.param=a,this.requisition=b,this.setValue(a.defaultValue)}function n(a,b,c,d,e,f){this.emitter=a,this.setText(b),this.start=c,this.end=d,this.prefix=e,this.suffix=f}function m(a,b){this.status=a.status,this.message=a.message,b?(this.start=b.start,this.end=b.end):(this.start=0,this.end=0),this.predictions=a.predictions}function l(a,b,c,d,e){this.status=a,this.message=b;if(typeof c==="number")this.start=c,this.end=d,this.predictions=e;else{var f=c;this.start=f.start,this.end=f.end,this.predictions=f.predictions}}var d=a("pilot/console"),e=a("pilot/lang"),f=a("pilot/oop"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/types"),i=a("pilot/types").Status,j=a("pilot/types").Conversion,k=a("pilot/canon");b.startup=function(a,b){k.upgradeType("command",p)},l.prototype={},l.sort=function(a,b){b!==undefined&&a.forEach(function(a){a.start===n.AT_CURSOR?a.distance=0:ba.end?a.distance=b-a.end:a.distance=0},this),a.sort(function(a,c){if(b!==undefined){var d=a.distance-c.distance;if(d!=0)return d}return c.status-a.status}),b!==undefined&&a.forEach(function(a){delete a.distance},this);return a},b.Hint=l,f.inherits(m,l),n.prototype={merge:function(a){if(a.emitter!=this.emitter)throw new Error("Can't merge Arguments from different EventEmitters");return new n(this.emitter,this.text+this.suffix+a.prefix+a.text,this.start,a.end,this.prefix,a.suffix)},setText:function(a){if(a==null)throw new Error("Illegal text for Argument: "+a);var b={argument:this,oldText:this.text,text:a};this.text=a,this.emitter._dispatchEvent("argumentChange",b)},toString:function(){return this.prefix+this.text+this.suffix}},n.merge=function(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var d;for(var e=b;e: ";this.param.description&&(b+=this.param.description.trim(),b.charAt(b.length-1)!=="."&&(b+="."),b.charAt(b.length-1)!==" "&&(b+=" "));var c=i.VALID,d=this.arg?this.arg.start:n.AT_CURSOR,e=this.arg?this.arg.end:n.AT_CURSOR,f;this.conversion&&(c=this.conversion.status,this.conversion.message&&(b+=this.conversion.message),f=this.conversion.predictions);var g=this.arg&&this.arg.text!=="",h=this.value!==undefined||g;this.param.defaultValue===undefined&&!h&&(c=i.INVALID,b+="Required");return new l(c,b,d,e,f)},complete:function(){this.conversion&&this.conversion.predictions&&this.conversion.predictions.length>0&&this.setValue(this.conversion.predictions[0])},isPositionCaptured:function(a){if(!this.arg)return!1;if(this.arg.start===-1)return!1;if(a>this.arg.end)return!1;if(a===this.arg.end)return this.conversion.status!==i.VALID||this.conversion.predictions.length!==0;return!0},decrement:function(){var a=this.param.type.decrement(this.value);a!=null&&this.setValue(a)},increment:function(){var a=this.param.type.increment(this.value);a!=null&&this.setValue(a)},toString:function(){return this.arg?this.arg.toString():""}},b.Assignment=o;var p={name:"__command",type:"command",description:"The command to execute",getCustomHint:function(a,b){var c=[];c.push(" > "),c.push(a.name),a.params&&a.params.length>0&&a.params.forEach(function(a){a.defaultValue===undefined?c.push(" ["+a.name+"]"):c.push(" ["+a.name+"]")},this),c.push("
"),c.push(a.description?a.description:"(No description)"),c.push("
"),a.params&&a.params.length>0&&(c.push("
    "),a.params.forEach(function(a){c.push("
  • "),c.push(""+a.name+": "),c.push(a.description?a.description:"(No description)"),a.defaultValue===undefined?c.push(" [Required]"):a.defaultValue===null?c.push(" [Optional]"):c.push(" [Default: "+a.defaultValue+"]"),c.push("
  • ")},this),c.push("
"));return new l(i.VALID,c.join(""),b)}};q.prototype={commandAssignment:undefined,assignmentCount:undefined,_assignments:undefined,_hints:undefined,_assignmentChanged:function(a){a.param.name==="__command"&&(this._assignments={},a.value&&a.value.params.forEach(function(a){this._assignments[a.name]=new o(a,this)},this),this.assignmentCount=Object.keys(this._assignments).length,this._dispatchEvent("commandChange",{command:a.value}))},getAssignment:function(a){var b=typeof a==="string"?a:Object.keys(this._assignments)[a];return this._assignments[b]},getParameterNames:function(){return Object.keys(this._assignments)},cloneAssignments:function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)},_updateHints:function(){this.getAssignments(!0).forEach(function(a){this._hints.push(a.getHint())},this),l.sort(this._hints)},getWorstHint:function(){return this._hints[0]},getArgsObject:function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.value},this);return a},getAssignments:function(a){var b=[];a===!0&&b.push(this.commandAssignment),Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b},setDefaultValues:function(){this.getAssignments().forEach(function(a){a.setValue(undefined)},this)},exec:function(){k.exec(this.commandAssignment.value,this.env,this.getArgsObject(),this.toCanonicalString())},toCanonicalString:function(){var a=[];a.push(this.commandAssignment.value.name),Object.keys(this._assignments).forEach(function(b){var c=this._assignments[b],d=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(d.stringify(c.value)))},this);return a.join("")}},f.implement(q.prototype,g),b.Requisition=q,f.inherits(r,q),function(){r.prototype.update=function(a){this.input=a,this._hints=[];var b=this._tokenize(a.typed);this._split(b),this.commandAssignment.value&&this._assign(b),this._updateHints()},r.prototype.getInputStatusMarkup=function(){var a=this.toString().split("").map(function(a){return i.VALID});this._hints.forEach(function(b){for(var c=b.start;c<=b.end;c++)b.status>a[c]&&(a[c]=b.status)},this);return a},r.prototype.toString=function(){return this.getAssignments(!0).map(function(a){return a.toString()},this).join("")};var a=r.prototype._updateHints;r.prototype._updateHints=function(){a.call(this);var b=this.input.cursor;this._hints.forEach(function(a){var c=b.start>=a.start&&b.start<=a.end,d=b.end>=a.start&&b.end<=a.end,e=c||d;!e&&a.status===i.INCOMPLETE&&(a.status=i.INVALID)},this),l.sort(this._hints)},r.prototype.getHints=function(){return this._hints},r.prototype.getAssignmentAt=function(a){var b=this.getAssignments(!0);for(var c=0;c=a.length){if(f!==b){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,""))}else if(h!==i){var m=a.substring(i,h),o=k[k.length-1];o?o.suffix+=m:(o=new n(this,"",h,h,m,""),k.push(o))}break}var p=a[h];switch(f){case b:p==="'"?(j=a.substring(i,h+1),f=d,i=h+1):p==='"'?(j=a.substring(i,h+1),f=e,i=h+1):/ /.test(p)||(j=a.substring(i,h),f=c,i=h);break;case c:if(p===" "){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,"")),f=b,i=h,j=""}break;case d:if(p==="'"){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}break;case e:if(p==='"'){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}}h++}return k},r.prototype._split=function(a){var b=1,c;while(b<=a.length){var c=n.merge(a,0,b);this.commandAssignment.setArgument(c);if(!this.commandAssignment.value)break;if(this.commandAssignment.value.exec){for(var d=0;d=a.length)break;continue}b.param.type.name==="boolean"?b.setValue(!0):f+10){var g=n.merge(a);this._hints.push(new l(i.INVALID,"Input '"+g.text+"' makes no sense.",g))}}}}(),b.CliRequisition=r}),define("cockpit/commands/basic",function(a,b,c){var d=a("pilot/typecheck"),e=a("pilot/canon"),f={name:"sh",description:"Execute a system command (requires server support)",params:[{name:"command",type:"text",description:"The string to send to the os shell."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,!0),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
"+d.responseText+"
"))},d.send(null)}},e=a("pilot/canon");b.startup=function(a,b){e.addCommand(f)},b.shutdown=function(a,b){e.removeCommand(f)}}),define("cockpit/index",function(a,b,c){b.startup=function(b,c){var d=a("pilot/index");a("cockpit/cli").startup(b,c),window.testCli=a("cockpit/test/testCli"),a("cockpit/ui/settings").startup(b,c),a("cockpit/ui/cliView").startup(b,c),a("cockpit/commands/basic").startup(b,c)}}),define("cockpit/ui/cliView",function(a,b,c){function m(a,b){this.cli=a,this.doc=document,this.win=this.doc.defaultView,this.element=this.doc.getElementById("cockpitInput");this.element?(this.settings=b.settings,this.hintDirection=this.settings.getSetting("hintDirection"),this.outputDirection=this.settings.getSetting("outputDirection"),this.outputHeight=this.settings.getSetting("outputHeight"),this.isUpdating=!1,this.createElements(),this.update()):console.log("No element with an id of cockpit. Bailing on cli")}var d=a("text!cockpit/ui/cliView.css"),e=a("pilot/dom");e.importCssString(d);var f=a("pilot/canon"),g=a("pilot/types").Status,h=a("pilot/keyboard/keyutil"),i=a("cockpit/cli").CliRequisition,j=a("cockpit/cli").Hint,k=a("cockpit/ui/requestView").RequestView,l=new j(g.VALID,"",0,0);b.startup=function(a,b){var c=new i(a.env),d=new m(c,a.env)},m.prototype={createElements:function(){var a=this.element;this.element.spellcheck=!1,this.output=this.doc.getElementById("cockpitOutput"),this.popupOutput=this.output==null;if(!this.output){this.output=this.doc.createElement("div"),this.output.id="cockpitOutput",this.output.className="cptFocusPopup",a.parentNode.insertBefore(this.output,a.nextSibling);var b=function(){this.output.style.maxHeight=this.outputHeight.get()+"px"}.bind(this);this.outputHeight.addEventListener("change",b),b()}this.completer=this.doc.createElement("div"),this.completer.className="cptCompletion VALID";var c=window.getComputedStyle(a,null);this.completer.style.color=c.color,this.completer.style.fontSize=c.fontSize,this.completer.style.fontFamily=c.fontFamily,this.completer.style.fontWeight=c.fontWeight,this.completer.style.fontStyle=c.fontStyle,a.parentNode.insertBefore(this.completer,a.nextSibling),this.completer.style.backgroundColor=a.style.backgroundColor,a.style.backgroundColor="transparent",this.hinter=this.doc.createElement("div"),this.hinter.className="cptHints cptFocusPopup",a.parentNode.insertBefore(this.hinter,a.nextSibling);var d=this.resizer.bind(this);this.win.addEventListener("resize",d,!1),this.hintDirection.addEventListener("change",d),this.outputDirection.addEventListener("change",d),d(),f.addEventListener("output",function(a){new k(a.request,this)}.bind(this)),h.addKeyDownListener(a,this.onKeyDown.bind(this)),a.addEventListener("keyup",this.onKeyUp.bind(this),!0),a.addEventListener("mouseup",function(a){this.isUpdating=!0,this.update(),this.isUpdating=!1}.bind(this),!1),this.cli.addEventListener("argumentChange",this.onArgChange.bind(this))},scrollOutputToBottom:function(){var a=Math.max(this.output.scrollHeight,this.output.clientHeight);this.output.scrollTop=a-this.output.clientHeight},resizer:function(){var a=this.element.getClientRects()[0];this.completer.style.top=a.top+"px",this.completer.style.height=a.height+"px",this.completer.style.lineHeight=a.height+"px",this.completer.style.left=a.left+"px",this.completer.style.width=a.width+"px",this.hintDirection.get()==="below"?(this.hinter.style.top=a.bottom+"px",this.hinter.style.bottom="auto"):(this.hinter.style.top="auto",this.hinter.style.bottom=this.win.innerHeight-a.top+"px"),this.hinter.style.left=a.left+30+"px",this.hinter.style.maxWidth=a.width-110+"px",this.popupOutput&&(this.outputDirection.get()==="below"?(this.output.style.top=a.bottom+"px",this.output.style.bottom="auto"):(this.output.style.top="auto",this.output.style.bottom=this.win.innerHeight-a.top+"px"),this.output.style.left=a.left+"px",this.output.style.width=a.width-80+"px")},onKeyDown:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.TAB||a.keyCode===h.KeyHelper.KEY.UP||a.keyCode===h.KeyHelper.KEY.DOWN)return!0;return b},onKeyUp:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.RETURN){var c=this.cli.getWorstHint();c.status===g.VALID?(this.cli.exec(),this.element.value=""):(this.element.selectionStart=c.start,this.element.selectionEnd=c.end)}this.update();var d=this.cli.getAssignmentAt(this.element.selectionStart);d&&(a.keyCode===h.KeyHelper.KEY.TAB&&(d.complete(),this.update()),a.keyCode===h.KeyHelper.KEY.UP&&(d.increment(),this.update()),a.keyCode===h.KeyHelper.KEY.DOWN&&(d.decrement(),this.update()));return b},update:function(){this.isUpdating=!0;var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};this.cli.update(a);var b=this.cli.getAssignmentAt(a.cursor.start).getHint();e.removeCssClass(this.completer,g.VALID.toString()),e.removeCssClass(this.completer,g.INCOMPLETE.toString()),e.removeCssClass(this.completer,g.INVALID.toString());var c='> ';if(this.element.value.length>0){var d=this.cli.getInputStatusMarkup();c+=this.markupStatusScore(d)}if(this.element.value.length>0&&b.predictions&&b.predictions.length>0){var f=b.predictions[0];c+="  ⇥ "+(f.name?f.name:f)}this.completer.innerHTML=c,e.addCssClass(this.completer,this.cli.getWorstHint().status.toString());var h="";this.element.value.length!==0&&(h+=b.message,b.predictions&&b.predictions.length>0&&(h+=": [ ",b.predictions.forEach(function(a){h+=a.name?a.name:a,h+=" | "},this),h=h.replace(/\| $/,"]"))),this.hinter.innerHTML=h,h.length===0?e.addCssClass(this.hinter,"cptNoPopup"):e.removeCssClass(this.hinter,"cptNoPopup"),this.isUpdating=!1},markupStatusScore:function(a){var b="",c=0,d=-1;while(!0){d!==a[c]&&(b+="",d=a[c]),b+=this.element.value[c],c++;if(c===this.element.value.length){b+="";break}d!==a[c]&&(b+="")}return b},onArgChange:function(a){if(!this.isUpdating){var b=this.element.value.substring(0,a.argument.start),c=this.element.value.substring(a.argument.end),d=typeof a.text==="string"?a.text:a.text.name;this.element.value=b+d+c;var e=(b+d).length;this.element.selectionStart=e,this.element.selectionEnd=e}}},b.CliView=m}),define("cockpit/ui/requestView",function(a,b,c){function n(a,b){this.request=a,this.cliView=b,this.imagePath=l,this.rowin=null,this.rowout=null,this.output=null,this.hide=null,this.show=null,this.duration=null,this.throb=null,(new g).processNode(j.cloneNode(!0),this),this.cliView.output.appendChild(this.rowin),this.cliView.output.appendChild(this.rowout),this.request.addEventListener("output",this.onRequestChange.bind(this))}var d=a("pilot/dom"),e=a("pilot/event"),f=a("text!cockpit/ui/requestView.html"),g=a("pilot/domtemplate").Templater,h=a("text!cockpit/ui/requestView.css");d.importCssString(h);var i=document.createElement("div");i.innerHTML=f;var j=i.querySelector(".cptRow"),k=c.id.split("/").pop()+".js",l;if(c.uri.substr(-k.length)!==k)console.error("module.id",c.id),console.error("module.uri",c.uri),console.error("filename",k),console.error("Can't work out path from module.uri/module/id"),l=".";else{var m=c.uri.length-k.length;l=c.uri.substr(0,m)+"images"}n.prototype={copyToInput:function(){this.cliView.element.value=this.request.typed},executeRequest:function(a){this.cliView.cli.update({typed:this.request.typed,cursor:{start:0,end:0}}),this.cliView.cli.exec()},hideOutput:function(a){this.output.style.display="none",d.addCssClass(this.hide,"cmd_hidden"),d.removeCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},showOutput:function(a){this.output.style.display="block",d.removeCssClass(this.hide,"cmd_hidden"),d.addCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},remove:function(a){this.cliView.output.removeChild(this.rowin),this.cliView.output.removeChild(this.rowout),e.stopPropagation(a)},onRequestChange:function(a){this.duration.innerHTML=this.request.duration?"completed in "+this.request.duration/1e3+" sec ":"",this.output.innerHTML="",this.request.outputs.forEach(function(a){var b;typeof a=="string"?(b=document.createElement("p"),b.innerHTML=a):b=a,this.output.appendChild(b)},this),this.cliView.scrollOutputToBottom(),d.setCssClass(this.output,"cmd_error",this.request.error),this.throb.style.display=this.request.completed?"none":"block"}},b.RequestView=n}),define("cockpit/ui/settings",function(a,b,c){var d=a("pilot/types"),e=a("pilot/types/basic").SelectionType,f=new e({name:"direction",data:["above","below"]}),g={name:"hintDirection",description:"Are hints shown above or below the command line?",type:"direction",defaultValue:"above"},h={name:"outputDirection",description:"Is the output window shown above or below the command line?",type:"direction",defaultValue:"above"},i={name:"outputHeight",description:"What height should the output panel be?",type:"number",defaultValue:300};b.startup=function(a,b){d.registerType(f),a.env.settings.addSetting(g),a.env.settings.addSetting(h),a.env.settings.addSetting(i)},b.shutdown=function(a,b){d.unregisterType(f),a.env.settings.removeSetting(g),a.env.settings.removeSetting(h),a.env.settings.removeSetting(i)}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date,d=c.currentLine,e=c.textLines,f=0,g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=!0);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d),d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("pilot/event_emitter").EventEmitter,g=a("ace/selection").Selection,h=a("ace/mode/text").Mode,i=a("ace/range").Range,j=function(a,b){this.modified=!0,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=!0,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){this.$useSoftTabs!==a&&(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){!isNaN(a)&&this.$tabSize!==a&&(this.modified=!0,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e),d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],d=b.column,e=b.row,f=1,g=this.getLine(e),h=this.getLength();while(!0){while(d=h)break;var g=this.getLine(e),d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(b.length!=0){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=!0,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"",g=e.substring(0,a.column)+d[0],h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],!0),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),!0);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=!0;var d=a.start.row,e=a.end.row,f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,!0),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,!0),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh){d+=h;break}d+=e;break}e-=h+c,d+=h+1}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("ace/textinput").TextInput,h=a("ace/keybinding").KeyBinding,i=a("ace/document").Document,j=a("ace/search").Search,k=a("ace/background_tokenizer").BackgroundTokenizer,l=a("ace/range").Range,m=a("pilot/event_emitter").EventEmitter,n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=!1,this.$search=(new j).set({wrap:!0}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(this.doc!=a){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition(),b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange(),b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(this.mode!=a){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a),c=e.getDocumentY(a),d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this,g,h,i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)},j=function(){clearInterval(l),f.$clickSelection=null},k=function(){if(g!==undefined&&h!==undefined){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a),f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString()),h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=!1,this.setOverwrite=function(a){this.$overwrite!=a&&(this.$overwrite=a,this.$blockScrolling=!0,this.onCursorChange(),this.$blockScrolling=!1,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row>=b.end.row&&b.start.column>=b.end.column){var e;if(this.doc.getUseSoftTabs()){var g=a.getTabSize(),h=this.getCursorPosition(),i=a.documentToScreenColumn(h.row,h.column),d=g-i%g;e=f.stringRepeat(" ",d)}else e="\t";return this.onTextInput(e)}var c=this.$getSelectedRows(),d=a.indentRows(c.first,c.last,"\t");this.selection.shiftSelection(d)}},this.blockOutdent=function(){if(!this.$readOnly){var a=this.doc.getSelection(),b=this.doc.outdentRows(a.getRange());a.setSelectionRange(b,a.isBackwards()),this.$updateDesiredColumn()}},this.toggleCommentLines=function(){if(!this.$readOnly){var a=this;this.bgTokenizer.getState(this.getCursorPosition().row,function(b){var c=a.$getSelectedRows(),d=a.mode.toggleCommentLines(b,a.doc,c.first,c.last);a.selection.shiftSelection(d)})}},this.removeLines=function(){if(!this.$readOnly){var a=this.$getSelectedRows();this.selection.setSelectionAnchor(a.last+1,0),this.selection.selectTo(a.first,0),this.doc.remove(this.getSelectionRange()),this.clearSelection()}},this.moveLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesDown(a,b)})},this.moveLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesUp(a,b)})},this.copyLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){this.doc.duplicateLines(a,b);return 0})},this.copyLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.duplicateLines(a,b)})},this.$moveLines=function(a){var b=this.$getSelectedRows(),c=a.call(this,b.first,b.last),d=this.selection;d.setSelectionAnchor(b.last+c+1,0),d.$moveSelection(function(){d.moveCursorTo(b.first+c,0)})},this.$getSelectedRows=function(){var a=this.getSelectionRange().collapseRows();return{first:a.start.row,last:a.end.row}},this.onCompositionStart=function(a){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(a){this.renderer.setCompositionText(a)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(a){return a>=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow(),b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow(),b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=!0,this.moveCursorTo(a-1,b||0),this.$blockScrolling=!1,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a),b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent"),e=a("pilot/event"),f=a("ace/conf/keybindings/default_mac").bindings,g=a("ace/conf/keybindings/default_win").bindings,h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode],i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()],j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){function c(a,c){var d,e,f,g,h={};for(d in a){g=a[d];if(c&&typeof g=="string"){g=g.split(c);for(e=0,f=g.length;e",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range,e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row,g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight,f=Math.round(b.end.column*d.characterWidth);a.push("
");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(e>=0){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc),e=d.lineHeight,f=Math.round((b.end.column-b.start.column)*d.characterWidth),g=(b.start.row-d.firstRow)*d.lineHeight,h=Math.round(b.start.column*d.characterWidth);a.push("
")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/dom"),f=a("pilot/lang"),g=a("pilot/event_emitter").EventEmitter,h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=!1,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
"),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/css",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/css_highlight_rules").CssHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(i,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(i.prototype),b.Mode=i}),define("ace/mode/css_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){function g(a){var b=[],c=a.split("");for(var d=0;d"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<(?=s*script)",next:"script"},{token:"text",regex:"<(?=s*style)",next:"css"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],script:[{token:"text",regex:">",next:"js-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],css:[{token:"text",regex:">",next:"css-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]};var a=(new f).getRules();this.addRules(a,"js-"),this.$rules["js-start"].unshift({token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"});var b=(new e).getRules();this.addRules(b,"css-"),this.$rules["css-start"].unshift({token:"text",regex:"<\\/(?=style)",next:"tag"})};d.inherits(h,g),b.HtmlHighlightRules=h}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/php",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/php_highlight_rules").PhpHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/php_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;PhpHighlightRules=function(){var a=new f,b=e.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_response_headers|apache_setenv|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_uassoc|array_fill|array_filter|array_flip|array_intersect|array_intersect_assoc|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_push|array_rand|array_reduce|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_unique|array_unshift|array_values|array_walk|arsort|ascii2ebcdic|asin|asinh|asort|aspell_check|aspell_check_raw|aspell_new|aspell_suggest|assert|assert_options|atan|atan2|atanh|base64_decode|base64_encode|base_convert|basename|bcadd|bccomp|bcdiv|bcmod|bcmul|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|call_user_func|call_user_func_array|call_user_method|call_user_method_array|ccvs_add|ccvs_auth|ccvs_command|ccvs_count|ccvs_delete|ccvs_done|ccvs_init|ccvs_lookup|ccvs_new|ccvs_report|ccvs_return|ccvs_reverse|ccvs_sale|ccvs_status|ccvs_textvalue|ccvs_void|ceil|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_exists|clearstatcache|closedir|closelog|com|com_addref|com_get|com_invoke|com_isenum|com_load|com_load_typelib|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|convert_cyr_string|copy|cos|cosh|count|count_chars|cpdf_add_annotation|cpdf_add_outline|cpdf_arc|cpdf_begin_text|cpdf_circle|cpdf_clip|cpdf_close|cpdf_closepath|cpdf_closepath_fill_stroke|cpdf_closepath_stroke|cpdf_continue_text|cpdf_curveto|cpdf_end_text|cpdf_fill|cpdf_fill_stroke|cpdf_finalize|cpdf_finalize_page|cpdf_global_set_document_limits|cpdf_import_jpeg|cpdf_lineto|cpdf_moveto|cpdf_newpath|cpdf_open|cpdf_output_buffer|cpdf_page_init|cpdf_place_inline_image|cpdf_rect|cpdf_restore|cpdf_rlineto|cpdf_rmoveto|cpdf_rotate|cpdf_rotate_text|cpdf_save|cpdf_save_to_file|cpdf_scale|cpdf_set_action_url|cpdf_set_char_spacing|cpdf_set_creator|cpdf_set_current_page|cpdf_set_font|cpdf_set_font_directories|cpdf_set_font_map_file|cpdf_set_horiz_scaling|cpdf_set_keywords|cpdf_set_leading|cpdf_set_page_animation|cpdf_set_subject|cpdf_set_text_matrix|cpdf_set_text_pos|cpdf_set_text_rendering|cpdf_set_text_rise|cpdf_set_title|cpdf_set_viewer_preferences|cpdf_set_word_spacing|cpdf_setdash|cpdf_setflat|cpdf_setgray|cpdf_setgray_fill|cpdf_setgray_stroke|cpdf_setlinecap|cpdf_setlinejoin|cpdf_setlinewidth|cpdf_setmiterlimit|cpdf_setrgbcolor|cpdf_setrgbcolor_fill|cpdf_setrgbcolor_stroke|cpdf_show|cpdf_show_xy|cpdf_stringwidth|cpdf_stroke|cpdf_text|cpdf_translate|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|curl_close|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_version|current|cybercash_base64_decode|cybercash_base64_encode|cybercash_decr|cybercash_encr|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dblist|dbmclose|dbmdelete|dbmexists|dbmfetch|dbmfirstkey|dbminsert|dbmnextkey|dbmopen|dbmreplace|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debugger_off|debugger_on|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|dotnet_load|doubleval|each|easter_date|easter_days|ebcdic2ascii|echo|empty|end|ereg|ereg_replace|eregi|eregi_replace|error_log|error_reporting|escapeshellarg|escapeshellcmd|eval|exec|exif_imagetype|exif_read_data|exif_thumbnail|exit|exp|explode|expm1|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_select_db|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filetype|floatval|flock|floor|flush|fmod|fnmatch|fopen|fpassthru|fprintf|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gd_info|get_browser|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getcwd|getdate|getenv|gethostbyaddr|gethostbyname|gethostbynamel|getimagesize|getlastmod|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getopt|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|gettext|gettimeofday|gettype|glob|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_xor|gmstrftime|gregoriantojd|gzclose|gzcompress|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|header|headers_list|headers_sent|hebrev|hebrevc|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|http_build_query|hw_api_attribute|hw_api_content|hw_api_object|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_hgcsp|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|idate|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|image2wbmp|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepscopyfont|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchstructure|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implode|import_request_variables|in_array|ingres_autocommit|ingres_close|ingres_commit|ingres_connect|ingres_fetch_array|ingres_fetch_object|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_query|ingres_rollback|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|intval|ip2long|iptcembed|iptcparse|ircg_channel_mode|ircg_disconnect|ircg_fetch_error_msg|ircg_get_username|ircg_html_encode|ircg_ignore_add|ircg_ignore_del|ircg_invite|ircg_is_conn_alive|ircg_join|ircg_kick|ircg_list|ircg_lookup_format_messages|ircg_lusers|ircg_msg|ircg_nick|ircg_nickname_escape|ircg_nickname_unescape|ircg_notice|ircg_oper|ircg_part|ircg_pconnect|ircg_register_format_messages|ircg_set_current|ircg_set_file|ircg_set_on_die|ircg_topic|ircg_who|ircg_whois|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isset|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|juliantojd|key|krsort|ksort|lcg_value|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|levenshtein|link|linkinfo|list|localeconv|localtime|log|log10|log1p|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_strlen|mb_strpos|mb_strrpos|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcal_append_event|mcal_close|mcal_create_calendar|mcal_date_compare|mcal_date_valid|mcal_day_of_week|mcal_day_of_year|mcal_days_in_month|mcal_delete_calendar|mcal_delete_event|mcal_event_add_attribute|mcal_event_init|mcal_event_set_alarm|mcal_event_set_category|mcal_event_set_class|mcal_event_set_description|mcal_event_set_end|mcal_event_set_recur_daily|mcal_event_set_recur_monthly_mday|mcal_event_set_recur_monthly_wday|mcal_event_set_recur_none|mcal_event_set_recur_weekly|mcal_event_set_recur_yearly|mcal_event_set_start|mcal_event_set_title|mcal_expunge|mcal_fetch_current_stream_event|mcal_fetch_event|mcal_is_leap_year|mcal_list_alarms|mcal_list_events|mcal_next_recurrence|mcal_open|mcal_popen|mcal_rename_calendar|mcal_reopen|mcal_snooze|mcal_store_event|mcal_time_valid|mcal_week_of_year|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|mcve_adduser|mcve_adduserarg|mcve_bt|mcve_checkstatus|mcve_chkpwd|mcve_chngpwd|mcve_completeauthorizations|mcve_connect|mcve_connectionerror|mcve_deleteresponse|mcve_deletetrans|mcve_deleteusersetup|mcve_deluser|mcve_destroyconn|mcve_destroyengine|mcve_disableuser|mcve_edituser|mcve_enableuser|mcve_force|mcve_getcell|mcve_getcellbynum|mcve_getcommadelimited|mcve_getheader|mcve_getuserarg|mcve_getuserparam|mcve_gft|mcve_gl|mcve_gut|mcve_initconn|mcve_initengine|mcve_initusersetup|mcve_iscommadelimited|mcve_liststats|mcve_listusers|mcve_maxconntimeout|mcve_monitor|mcve_numcolumns|mcve_numrows|mcve_override|mcve_parsecommadelimited|mcve_ping|mcve_preauth|mcve_preauthcompletion|mcve_qc|mcve_responseparam|mcve_return|mcve_returncode|mcve_returnstatus|mcve_sale|mcve_setblocking|mcve_setdropfile|mcve_setip|mcve_setssl|mcve_setssl_files|mcve_settimeout|mcve_settle|mcve_text_avs|mcve_text_code|mcve_text_cv|mcve_transactionauth|mcve_transactionavs|mcve_transactionbatch|mcve_transactioncv|mcve_transactionid|mcve_transactionitem|mcve_transactionssent|mcve_transactiontext|mcve_transinqueue|mcve_transnew|mcve_transparam|mcve_transsend|mcve_ub|mcve_uwait|mcve_verifyconnection|mcve_verifysslcert|mcve_void|md5|md5_file|mdecrypt_generic|memory_get_usage|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_setcubicthreshold|ming_setscale|ming_useswfversion|mkdir|mktime|money_format|move_uploaded_file|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_getdata|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_setdata|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|muscat_close|muscat_get|muscat_give|muscat_setup|muscat_setup_net|mysql_affected_rows|mysql_change_user|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli_affected_rows|mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_change_user|mysqli_character_set_name|mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_dump_debug_info|mysqli_embedded_connect|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|mysqli_free_result|mysqli_get_client_info|mysqli_get_client_version|mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_master_query|mysqli_more_results|mysqli_multi_query|mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_prepare|mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_report|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|mysqli_send_query|mysqli_server_end|mysqli_server_init|mysqli_set_opt|mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt_init|mysqli_stmt_affected_rows|mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_free_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning_count|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|next|ngettext|nl2br|nl_langinfo|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|number_format|ob_clean|ob_end_clean|ob_end_flush|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_by_name|oci_cancel|oci_close|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_copy|oci_lob_is_equal|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|opendir|openlog|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_new|openssl_csr_sign|openssl_error_string|openssl_free_key|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ora_bind|ora_close|ora_columnname|ora_columnsize|ora_columntype|ora_commit|ora_commitoff|ora_commiton|ora_do|ora_error|ora_errorcode|ora_exec|ora_fetch|ora_fetch_into|ora_getcolumn|ora_logoff|ora_logon|ora_numcols|ora_numrows|ora_open|ora_parse|ora_plogon|ora_rollback|ord|output_add_rewrite_var|output_reset_rewrite_vars|overload|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parse_ini_file|parse_str|parse_url|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_page|pdf_begin_pattern|pdf_begin_template|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_curveto|pdf_delete|pdf_end_page|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_stroke|pdf_findfont|pdf_get_buffer|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_initgraphics|pdf_lineto|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_page|pdf_open_png|pdf_open_tiff|pdf_place_image|pdf_place_pdi_page|pdf_rect|pdf_restore|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_font|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_translate|pfpro_cleanup|pfpro_init|pfpro_process|pfpro_process_raw|pfpro_version|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_fetch_all|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_type|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_pconnect|pg_ping|pg_port|pg_put_line|pg_query|pg_result_error|pg_result_seek|pg_result_status|pg_select|pg_send_query|pg_set_client_encoding|pg_trace|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_ctermid|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_isatty|posix_kill|posix_mkfifo|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_grep|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|qdom_error|qdom_tree|quoted_printable_decode|quotemeta|rad2deg|rand|range|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_read_history|readline_write_history|readlink|realpath|recode|recode_file|recode_string|register_shutdown_function|register_tick_function|rename|reset|restore_error_handler|restore_include_path|rewind|rewinddir|rmdir|round|rsort|rtrim|scandir|sem_acquire|sem_get|sem_release|sem_remove|serialize|sesam_affected_rows|sesam_commit|sesam_connect|sesam_diagnostic|sesam_disconnect|sesam_errormsg|sesam_execimm|sesam_fetch_array|sesam_fetch_result|sesam_fetch_row|sesam_field_array|sesam_field_name|sesam_free_result|sesam_num_fields|sesam_query|sesam_rollback|sesam_seek_row|sesam_settransaction|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|set_error_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_time_limit|setcookie|setlocale|setrawcookie|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|sin|sinh|sizeof|sleep|snmp_get_quick_print|snmp_set_quick_print|snmpget|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_iovec_add|socket_iovec_alloc|socket_iovec_delete|socket_iovec_fetch|socket_iovec_free|socket_iovec_set|socket_last_error|socket_listen|socket_read|socket_readv|socket_recv|socket_recvfrom|socket_recvmsg|socket_select|socket_send|socket_sendmsg|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|socket_writev|sort|soundex|split|spliti|sprintf|sql_regcase|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_fetch_array|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqrt|srand|sscanf|stat|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_context_create|stream_context_get_options|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_register_wrapper|stream_select|stream_set_blocking|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_get_name|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_wrapper_register|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpos|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfbutton_keypress|swfdisplayitem|swffill|swffont|swfgradient|swfmorph|swfmovie|swfshape|swfsprite|swftext|swftextfield|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|syslog|system|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy_access_count|tidy_clean_repair|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_body|tidy_get_config|tidy_get_error_buffer|tidy_get_head|tidy_get_html|tidy_get_html_ver|tidy_get_output|tidy_get_release|tidy_get_root|tidy_get_status|tidy_getopt|tidy_is_xhtml|tidy_is_xml|tidy_load_config|tidy_parse_file|tidy_parse_string|tidy_repair_file|tidy_repair_string|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|time|tmpfile|token_get_all|token_name|touch|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|user_error|usleep|usort|utf8_decode|utf8_encode|var_dump|var_export|variant|version_compare|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|wordwrap|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xpath_eval|xpath_eval_expression|xpath_new_context|xptr_eval|xptr_new_context|xsl_xsltprocessor_get_parameter|xsl_xsltprocessor_has_exslt_support|xsl_xsltprocessor_import_stylesheet|xsl_xsltprocessor_register_php_functions|xsl_xsltprocessor_remove_parameter|xsl_xsltprocessor_set_parameter|xsl_xsltprocessor_transform_to_doc|xsl_xsltprocessor_transform_to_uri|xsl_xsltprocessor_transform_to_xml|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|zlib_get_coding_type".split("|")),c=e.arrayToMap("abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|include|include_once|global|goto|if|implements|interface|instanceof|namespace|new|old_function|or|private|protected|public|return|require|require_once|static|switch|throw|try|use|var|while|xor".split("|")),d=e.arrayToMap("true|false|null|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__CLASS__".split("|")),g=e.arrayToMap("$_GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|")),h=e.arrayToMap([]);this.$rules={start:[{token:"support",regex:"<\\?(?:php|\\=)"},{token:"support",regex:"\\?>"},{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(a){if(c[a])return"keyword";if(d[a])return"constant.language";if(g[a])return"variable.language";if(h[a])return"invalid.illegal";if(b[a])return"support.function";if(a=="debugger")return"invalid.deprecated";if(a.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))return"variable";return"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(PhpHighlightRules,g),b.PhpHighlightRules=PhpHighlightRules}),define("ace/mode/python",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;PythonHighlightRules=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:(?:[rubRUB])|(?:[ubUB][rR]))?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:(?:.)|(?:^"{3}))*?"{3}'},{token:"string",regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'},{token:"string",regex:f+"'{3}(?:(?:.)|(?:^'{3}))*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a[e]?"keyword":b[e]?"constant.language":d[e]?"invalid.illegal":c[e]?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:^"{3})*?"{3}',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:^'{3})*?'{3}",next:"start"},{token:"string",regex:".+"}]}},d.inherits(PythonHighlightRules,f),b.PythonHighlightRules=PythonHighlightRules}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;e"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]}};/fd/g,d.inherits(f,e),b.XmlHighlightRules=f}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=a.getSelection().getCursor(),e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(a){var b=d.row,c=j(b),g=d.column,k=!1;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=!0),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=b?c.end:c.start,e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead,b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=!1;this.selectionAnchor||(b=!0,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=!0;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead,b=a.column,c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc,b=a.getTabSize(),c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.rowa&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth * { padding-left: 2px; padding-right: 2px; }.cptRowIn > img { cursor: pointer; }.cptHover { display: none; }.cptRowIn:hover > .cptHover { display: block; }.cptRowIn:hover > .cptHover.cptHidden { display: none; }.cptOutTyped { box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1; font-weight: bold; color: #000; font-size: 120%;}.cptRowOutput { padding-left: 10px; line-height: 1.2em; }.cptRowOutput strong,.cptRowOutput b,.cptRowOutput th,.cptRowOutput h1,.cptRowOutput h2,.cptRowOutput h3 { color: #000; }.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }.cptRowOutput input[type=password],.cptRowOutput input[type=text],.cptRowOutput textarea { color: #000; font-size: 120%; background: transparent; padding: 3px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;}.cptRowOutput table,.cptRowOutput td,.cptRowOutput th { border: 0; padding: 0 2px; }.cptRowOutput .right { text-align: right; }"),define("text!ace/css/editor.css",'.ace_editor { position: absolute; overflow: hidden; font-family: "Menlo", "Monaco", "Courier New", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, "Courier New", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}'),define("text!ace/theme/eclipse.css",".ace-eclipse .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-eclipse .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-eclipse .ace_gutter { width: 40px; background: rgb(227, 227, 227); border-right: 1px solid rgb(159, 159, 159);\t color: rgb(136, 136, 136);}.ace-eclipse .ace_gutter-layer { right: 10px; text-align: right;}.ace-eclipse .ace_text-layer { cursor: text;}.ace-eclipse .ace_cursor { border-left: 1px solid black;}.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable { color: rgb(127, 0, 85);}.ace-eclipse .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-eclipse .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-eclipse .ace_line .ace_function { color: rgb(60, 76, 114);}.ace-eclipse .ace_line .ace_string { color: rgb(42, 0, 255);}.ace-eclipse .ace_line .ace_comment { color: rgb(63, 127, 95);}.ace-eclipse .ace_line .ace_comment.ace_doc { color: rgb(63, 95, 191);}.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(127, 159, 191);}.ace-eclipse .ace_line .ace_constant.ace_numeric {}.ace-eclipse .ace_line .ace_tag {\tcolor: rgb(63, 127, 127);}.ace-eclipse .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-eclipse .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-eclipse .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-eclipse .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var config={packagePaths:{"../lib":[{name:"ace",lib:"."}],"../support/cockpit/lib":[{name:"cockpit",main:"index",lib:"."}],"../support/cockpit/support/pilot/lib":[{name:"pilot",main:"index",lib:"."}]},paths:{demo_startup:"../demo/demo_startup"}},deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(config),require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index","cockpit/index"]).then(function(){var b=require("pilot/environment").create();a.startupPlugins({env:b}).then(function(){require("demo_startup").launch(b)})})}) \ No newline at end of file diff --git a/build/editor.html b/build/editor.html index 45cb8a0c..253044e9 100644 --- a/build/editor.html +++ b/build/editor.html @@ -193,7 +193,7 @@ echo $output; - + From e320a024aa3a99f004d9b67766397aadee9be95e Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Wed, 12 Jan 2011 00:20:16 -0500 Subject: [PATCH 17/90] now creates a new, svelte build --- Makefile.dryice.js | 41 ++++++----- build/editor.html | 169 ++++----------------------------------------- demo/build_boot.js | 70 +++++++++++++++++++ 3 files changed, 105 insertions(+), 175 deletions(-) create mode 100644 demo/build_boot.js diff --git a/Makefile.dryice.js b/Makefile.dryice.js index ddd9118c..cae1112d 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -56,21 +56,36 @@ copy({ include: /.*\.js$/, exclude: /tests?\// }, - { - root: aceHome + '/support/cockpit/lib', - include: /.*\.js$/, - exclude: /tests?\// - }, { root: aceHome + '/lib', include: /.*\.js$/, - exclude: /tests?\// + exclude: /tests?\/|theme\/|mode\// } ], filter: [ copy.filter.moduleDefines ], dest: buildStep }); +// include the TextMate theme only for now +copy({ + source: [ { + root: aceHome + "/lib", + include: /textmate\.js/ + } ], + filter: [ copy.filter.moduleDefines ], + dest: buildStep +}); + +// include the JS mode only for now +copy({ + source: [ { + root: aceHome + '/lib', + include: /\/text\.js|\/javascript\.js|\/text_highlight_rules\.js|\/javascript_highlight_rules\.js|\/doc_comment_highlight_rules\.js|\/matching_brace_outdent\.js/ + } ], + filter: [ copy.filter.moduleDefines ], + dest: buildStep +}); + // The startup file copy({ source: { base: aceHome + '/demo/', path: 'demo_startup.js' }, @@ -81,19 +96,9 @@ copy({ // The CSS files copy({ source: [ - { - root: aceHome + '/support/cockpit/support/pilot/lib', - include: /.*\.css$/, - exclude: /tests?\// - }, - { - root: aceHome + '/support/cockpit/lib', - include: /.*\.css$/, - exclude: /tests?\// - }, { root: aceHome + '/lib', - include: /.*\.css$/, + include: /tm\.css|editor\.css/, exclude: /tests?\// } ], @@ -114,7 +119,7 @@ copy({ // The Javascript files that don't need unwrapping copy({ - source: [ 'demo/boot.js' ], + source: [ 'demo/build_boot.js' ], dest: buildStep }); diff --git a/build/editor.html b/build/editor.html index 253044e9..69fc2a19 100644 --- a/build/editor.html +++ b/build/editor.html @@ -27,173 +27,28 @@ } #editor { - top: 55px; + top: 0px; left: 0px; + height: 100%; + width: 100%; background: white; } - #controls { - width: 100%; - height: 55px; - } - - #jump { - position: absolute; - width: 10px; - height: 10px; - border: 1px solid red; - z-index: 10000; - display: none; - } - - #cockpitInput { - position: absolute; - width: 100%; - bottom: 0; - - border: none; outline: none; - font-family: consolas, courier, monospace; - font-size: 120%; - } - - #cockpitOutput { - padding: 10px; - margin: 0 15px; - border: 1px solid #AAA; - -moz-border-radius-topleft: 10px; - -moz-border-radius-topright: 10px; - border-top-left-radius: 4px; border-top-right-radius: 4px; - background: #DDD; color: #000; - } -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- -
-
- - - - - - - - - - - - - - + + diff --git a/demo/build_boot.js b/demo/build_boot.js new file mode 100644 index 00000000..c56aa6dc --- /dev/null +++ b/demo/build_boot.js @@ -0,0 +1,70 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Kevin Dangoor (kdangoor@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", + "pilot/environment", "demo_startup" ]; + +require(deps, function() { + var catalog = require("pilot/plugin_manager").catalog; + catalog.registerPlugins([ "pilot/index" ]).then(function() { + }); +}); + +var ace = { + edit: function(el) { + if (typeof(el) == "string") { + el = document.getElementById(el); + } + var env = require("pilot/environment").create(); + var catalog = require("pilot/plugin_manager").catalog; + catalog.startupPlugins({ env: env }).then(function() { + var Document = require("ace/document").Document; + var JavaScriptMode = require("ace/mode/javascript").Mode; + var UndoManager = require("ace/undomanager").UndoManager; + var Editor = require("ace/editor").Editor; + var Renderer = require("ace/virtual_renderer").VirtualRenderer; + var theme = require("ace/theme/textmate"); + + var doc = new Document(el.innerHTML); + doc.setMode(new JavaScriptMode()); + doc.setUndoManager(new UndoManager()); + env.editor = new Editor(new Renderer(el, theme)); + env.editor.setDocument(doc); + env.editor.resize(); + }); + } +}; From 7858f84366f0f86098811ede1327e125c38afaab Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Wed, 12 Jan 2011 00:25:34 -0500 Subject: [PATCH 18/90] committing updated build - adding resize handling, though this is incomplete. --- build/ace-uncompressed.js | 7619 +++++-------------------------------- build/ace.js | 2 +- demo/build_boot.js | 3 + 3 files changed, 1014 insertions(+), 6610 deletions(-) diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index 9182f95c..5305db61 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -5486,1951 +5486,6 @@ exports.getOS = function() { } }; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/cli', function(require, exports, module) { - - -var console = require('pilot/console'); -var lang = require('pilot/lang'); -var oop = require('pilot/oop'); -var EventEmitter = require('pilot/event_emitter').EventEmitter; - -//var keyboard = require('keyboard/keyboard'); -var types = require('pilot/types'); -var Status = require('pilot/types').Status; -var Conversion = require('pilot/types').Conversion; -var canon = require('pilot/canon'); - -/** - * Normally type upgrade is done when the owning command is registered, but - * out commandParam isn't part of a command, so it misses out. - */ -exports.startup = function(data, reason) { - canon.upgradeType('command', commandParam); -}; - -/** - * The information required to tell the user there is a problem with their - * input. - * TODO: There a several places where {start,end} crop up. Perhaps we should - * have a Cursor object. - */ -function Hint(status, message, start, end, predictions) { - this.status = status; - this.message = message; - - if (typeof start === 'number') { - this.start = start; - this.end = end; - this.predictions = predictions; - } - else { - var arg = start; - this.start = arg.start; - this.end = arg.end; - this.predictions = arg.predictions; - } -} -Hint.prototype = { -}; -/** - * Loop over the array of hints finding the one we should display. - * @param hints array of hints - */ -Hint.sort = function(hints, cursor) { - // Calculate 'distance from cursor' - if (cursor !== undefined) { - hints.forEach(function(hint) { - if (hint.start === Argument.AT_CURSOR) { - hint.distance = 0; - } - else if (cursor < hint.start) { - hint.distance = hint.start - cursor; - } - else if (cursor > hint.end) { - hint.distance = cursor - hint.end; - } - else { - hint.distance = 0; - } - }, this); - } - // Sort - hints.sort(function(hint1, hint2) { - // Compare first based on distance from cursor - if (cursor !== undefined) { - var diff = hint1.distance - hint2.distance; - if (diff != 0) { - return diff; - } - } - // otherwise go with hint severity - return hint2.status - hint1.status; - }); - // tidy-up - if (cursor !== undefined) { - hints.forEach(function(hint) { - delete hint.distance; - }, this); - } - return hints; -}; -exports.Hint = Hint; - -/** - * A Hint that arose as a result of a Conversion - */ -function ConversionHint(conversion, arg) { - this.status = conversion.status; - this.message = conversion.message; - if (arg) { - this.start = arg.start; - this.end = arg.end; - } - else { - this.start = 0; - this.end = 0; - } - this.predictions = conversion.predictions; -}; -oop.inherits(ConversionHint, Hint); - - -/** - * We record where in the input string an argument comes so we can report errors - * against those string positions. - * We publish a 'change' event when-ever the text changes - * @param emitter Arguments use something else to pass on change events. - * Currently this will be the creating Requisition. This prevents dependency - * loops and prevents us from needing to merge listener lists. - * @param text The string (trimmed) that contains the argument - * @param start The position of the text in the original input string - * @param end See start - * @param prefix Knowledge of quotation marks and whitespace used prior to the - * text in the input string allows us to re-generate the original input from - * the arguments. - * @param suffix Any quotation marks and whitespace used after the text. - * Whitespace is normally placed in the prefix to the succeeding argument, but - * can be used here when this is the last argument. - * @constructor - */ -function Argument(emitter, text, start, end, prefix, suffix) { - this.emitter = emitter; - this.setText(text); - this.start = start; - this.end = end; - this.prefix = prefix; - this.suffix = suffix; -} -Argument.prototype = { - /** - * Return the result of merging these arguments. - * TODO: What happens when we're merging arguments for the single string - * case and some of the arguments are in quotation marks? - */ - merge: function(following) { - if (following.emitter != this.emitter) { - throw new Error('Can\'t merge Arguments from different EventEmitters'); - } - return new Argument( - this.emitter, - this.text + this.suffix + following.prefix + following.text, - this.start, following.end, - this.prefix, - following.suffix); - }, - - /** - * See notes on events in Assignment. We might need to hook changes here - * into a CliRequisition so they appear of the command line. - */ - setText: function(text) { - if (text == null) { - throw new Error('Illegal text for Argument: ' + text); - } - var ev = { argument: this, oldText: this.text, text: text }; - this.text = text; - this.emitter._dispatchEvent('argumentChange', ev); - }, - - /** - * Helper when we're putting arguments back together - */ - toString: function() { - // TODO: There is a bug here - we should re-escape escaped characters - // But can we do that reliably? - return this.prefix + this.text + this.suffix; - } -}; - -/** - * Merge an array of arguments into a single argument. - * All Arguments in the array are expected to have the same emitter - */ -Argument.merge = function(argArray, start, end) { - start = (start === undefined) ? 0 : start; - end = (end === undefined) ? argArray.length : end; - - var joined; - for (var i = start; i < end; i++) { - var arg = argArray[i]; - if (!joined) { - joined = arg; - } - else { - joined = joined.merge(arg); - } - } - return joined; -}; - -/** - * We sometimes need a way to say 'this error occurs where ever the cursor is' - */ -Argument.AT_CURSOR = -1; - - -/** - * A link between a parameter and the data for that parameter. - * The data for the parameter is available as in the preferred type and as - * an Argument for the CLI. - *

We also record validity information where applicable. - *

For values, null and undefined have distinct definitions. null means - * that a value has been provided, undefined means that it has not. - * Thus, null is a valid default value, and common because it identifies an - * parameter that is optional. undefined means there is no value from - * the command line. - * @constructor - */ -function Assignment(param, requisition) { - this.param = param; - this.requisition = requisition; - this.setValue(param.defaultValue); -}; -Assignment.prototype = { - /** - * The parameter that we are assigning to - * @readonly - */ - param: undefined, - - /** - * Report on the status of the last parse() conversion. - * @see types.Conversion - */ - conversion: undefined, - - /** - * The current value in a type as specified by param.type - */ - value: undefined, - - /** - * The string version of the current value - */ - arg: undefined, - - /** - * The current value (i.e. not the string representation) - * Use setValue() to mutate - */ - value: undefined, - setValue: function(value) { - if (this.value === value) { - return; - } - - if (value === undefined) { - this.value = this.param.defaultValue; - this.conversion = this.param.getDefault ? - this.param.getDefault() : - this.param.type.getDefault(); - this.arg = undefined; - } else { - this.value = value; - this.conversion = undefined; - var text = (value == null) ? '' : this.param.type.stringify(value); - if (this.arg) { - this.arg.setText(text); - } - } - - this.requisition._assignmentChanged(this); - }, - - /** - * The textual representation of the current value - * Use setValue() to mutate - */ - arg: undefined, - setArgument: function(arg) { - if (this.arg === arg) { - return; - } - this.arg = arg; - this.conversion = this.param.type.parse(arg.text); - this.conversion.arg = arg; // TODO: make this automatic? - this.value = this.conversion.value; - this.requisition._assignmentChanged(this); - }, - - /** - * Create a list of the hints associated with this parameter assignment. - * Generally there will be only one hint generated because we're currently - * only displaying one hint at a time, ordering by distance from cursor - * and severity. Since distance from cursor will be the same for all hints - * from this assignment all but the most severe will ever be used. It might - * make sense with more experience to alter this to function to be getHint() - */ - getHint: function() { - // Allow the parameter to provide documentation - if (this.param.getCustomHint && this.value && this.arg) { - var hint = this.param.getCustomHint(this.value, this.arg); - if (hint) { - return hint; - } - } - - // If there is no argument, use the cursor position - var message = '' + this.param.name + ': '; - if (this.param.description) { - // TODO: This should be a short description - do we need to trim? - message += this.param.description.trim(); - - // Ensure the help text ends with '. ' - if (message.charAt(message.length - 1) !== '.') { - message += '.'; - } - if (message.charAt(message.length - 1) !== ' ') { - message += ' '; - } - } - var status = Status.VALID; - var start = this.arg ? this.arg.start : Argument.AT_CURSOR; - var end = this.arg ? this.arg.end : Argument.AT_CURSOR; - var predictions; - - // Non-valid conversions will have useful information to pass on - if (this.conversion) { - status = this.conversion.status; - if (this.conversion.message) { - message += this.conversion.message; - } - predictions = this.conversion.predictions; - } - - // Hint if the param is required, but not provided - var argProvided = this.arg && this.arg.text !== ''; - var dataProvided = this.value !== undefined || argProvided; - if (this.param.defaultValue === undefined && !dataProvided) { - status = Status.INVALID; - message += 'Required<\strong>'; - } - - return new Hint(status, message, start, end, predictions); - }, - - /** - * Basically setValue(conversion.predictions[0]) done in a safe - * way. - */ - complete: function() { - if (this.conversion && this.conversion.predictions && - this.conversion.predictions.length > 0) { - this.setValue(this.conversion.predictions[0]); - } - }, - - /** - * If the cursor is at 'position', do we have sufficient data to start - * displaying the next hint. This is both complex and important. - * For example, if the user has just typed:

    - *
  • 'set tabstop ' then they clearly want to know about the valid - * values for the tabstop setting, so the hint is based on the next - * parameter. - *
  • 'set tabstop' (without trailing space) - they will probably still - * want to know about the valid values for the tabstop setting because - * there is no confusion about the setting in question. - *
  • 'set tabsto' they've not finished typing a setting name so the hint - * should be based on the current parameter. - *
  • 'set tabstop' (when there is an additional tabstopstyle setting) we - * can't make assumptions about the setting - we're not finished. - *
- *

Note that the input for 2 and 4 is identical, only the configuration - * has changed, so hint display is environmental. - * - *

This function works out if the cursor is before the end of this - * assignment (assuming that we've asked the same thing of the previous - * assignment) and then attempts to work out if we should use the hint from - * the next assignment even though technically the cursor is still inside - * this one due to the rules above. - */ - isPositionCaptured: function(position) { - if (!this.arg) { - return false; - } - - // Note we don't check if position >= this.arg.start because that's - // implied by the fact that we're asking the assignments in turn, and - // we want to avoid thing falling between the cracks, but we do need - // to check that the argument does have a position - if (this.arg.start === -1) { - return false; - } - - // We're clearly done if the position is past the end of the text - if (position > this.arg.end) { - return false; - } - - // If we're AT the end, the position is captured if either the status - // is not valid or if there are other valid options including current - if (position === this.arg.end) { - return this.conversion.status !== Status.VALID || - this.conversion.predictions.length !== 0; - } - - // Otherwise we're clearly inside - return true; - }, - - /** - * Replace the current value with the lower value if such a concept - * exists. - */ - decrement: function() { - var replacement = this.param.type.decrement(this.value); - if (replacement != null) { - this.setValue(replacement); - } - }, - - /** - * Replace the current value with the higher value if such a concept - * exists. - */ - increment: function() { - var replacement = this.param.type.increment(this.value); - if (replacement != null) { - this.setValue(replacement); - } - }, - - /** - * Helper when we're rebuilding command lines. - */ - toString: function() { - return this.arg ? this.arg.toString() : ''; - } -}; -exports.Assignment = Assignment; - - -/** - * This is a special parameter to reflect the command itself. - */ -var commandParam = { - name: '__command', - type: 'command', - description: 'The command to execute', - - /** - * Provide some documentation for a command. - */ - getCustomHint: function(command, arg) { - var docs = []; - docs.push(' > '); - docs.push(command.name); - if (command.params && command.params.length > 0) { - command.params.forEach(function(param) { - if (param.defaultValue === undefined) { - docs.push(' [' + param.name + ']'); - } - else { - docs.push(' [' + param.name + ']'); - } - }, this); - } - docs.push('
'); - - docs.push(command.description ? command.description : '(No description)'); - docs.push('
'); - - if (command.params && command.params.length > 0) { - docs.push('

    '); - command.params.forEach(function(param) { - docs.push('
  • '); - docs.push('' + param.name + ': '); - docs.push(param.description ? param.description : '(No description)'); - if (param.defaultValue === undefined) { - docs.push(' [Required]'); - } - else if (param.defaultValue === null) { - docs.push(' [Optional]'); - } - else { - docs.push(' [Default: ' + param.defaultValue + ']'); - } - docs.push('
  • '); - }, this); - docs.push('
'); - } - - return new Hint(Status.VALID, docs.join(''), arg); - } -}; - -/** - * A Requisition collects the information needed to execute a command. - * There is no point in a requisition for parameter-less commands because there - * is no information to collect. A Requisition is a collection of assignments - * of values to parameters, each handled by an instance of Assignment. - * CliRequisition adds functions for parsing input from a command line to this - * class. - *

Events

- * We publish the following events:
    - *
  • argumentChange: The text of some argument has changed. It is likely that - * any UI component displaying this argument will need to be updated. (Note that - * this event is actually published by the Argument itself - see the docs for - * Argument for more details) - * The event object looks like: { argument: A, oldText: B, text: B } - *
  • commandChange: The command has changed. It is likely that a UI - * structure will need updating to match the parameters of the new command. - * The event object looks like { command: A } - * @constructor - */ -function Requisition(env) { - this.env = env; - this.commandAssignment = new Assignment(commandParam, this); -} - -Requisition.prototype = { - /** - * The command that we are about to execute. - * @see setCommandConversion() - * @readonly - */ - commandAssignment: undefined, - - /** - * The count of assignments. Excludes the commandAssignment - * @readonly - */ - assignmentCount: undefined, - - /** - * The object that stores of Assignment objects that we are filling out. - * The Assignment objects are stored under their param.name for named - * lookup. Note: We make use of the property of Javascript objects that - * they are not just hashmaps, but linked-list hashmaps which iterate in - * insertion order. - * Excludes the commandAssignment. - */ - _assignments: undefined, - - /** - * The store of hints generated by the assignments. We are trying to prevent - * the UI from needing to access this in broad form, but instead use - * methods that query part of this structure. - */ - _hints: undefined, - - /** - * When the command changes, we need to keep a bunch of stuff in sync - */ - _assignmentChanged: function(assignment) { - // This is all about re-creating Assignments - if (assignment.param.name !== '__command') { - return; - } - - this._assignments = {}; - - if (assignment.value) { - assignment.value.params.forEach(function(param) { - this._assignments[param.name] = new Assignment(param, this); - }, this); - } - - this.assignmentCount = Object.keys(this._assignments).length; - this._dispatchEvent('commandChange', { command: assignment.value }); - }, - - /** - * Assignments have an order, so we need to store them in an array. - * But we also need named access ... - */ - getAssignment: function(nameOrNumber) { - var name = (typeof nameOrNumber === 'string') ? - nameOrNumber : - Object.keys(this._assignments)[nameOrNumber]; - return this._assignments[name]; - }, - - /** - * Where parameter name == assignment names - they are the same. - */ - getParameterNames: function() { - return Object.keys(this._assignments); - }, - - /** - * A *shallow* clone of the assignments. - * This is useful for systems that wish to go over all the assignments - * finding values one way or another and wish to trim an array as they go. - */ - cloneAssignments: function() { - return Object.keys(this._assignments).map(function(name) { - return this._assignments[name]; - }, this); - }, - - /** - * Collect the statuses from the Assignments. - * The hints returned are sorted by severity - */ - _updateHints: function() { - // TODO: work out when to clear this out for the plain Requisition case - // this._hints = []; - this.getAssignments(true).forEach(function(assignment) { - this._hints.push(assignment.getHint()); - }, this); - Hint.sort(this._hints); - - // We would like to put some initial help here, but for anyone but - // a complete novice a 'type help' message is very annoying, so we - // need to find a way to only display this message once, or for - // until the user click a 'close' button or similar - // TODO: Add special case for '' input - }, - - /** - * Returns the most severe status - */ - getWorstHint: function() { - return this._hints[0]; - }, - - /** - * Extract the names and values of all the assignments, and return as - * an object. - */ - getArgsObject: function() { - var args = {}; - this.getAssignments().forEach(function(assignment) { - args[assignment.param.name] = assignment.value; - }, this); - return args; - }, - - /** - * Access the arguments as an array. - * @param includeCommand By default only the parameter arguments are - * returned unless (includeCommand === true), in which case the list is - * prepended with commandAssignment.arg - */ - getAssignments: function(includeCommand) { - var args = []; - if (includeCommand === true) { - args.push(this.commandAssignment); - } - Object.keys(this._assignments).forEach(function(name) { - args.push(this.getAssignment(name)); - }, this); - return args; - }, - - /** - * Reset all the assignments to their default values - */ - setDefaultValues: function() { - this.getAssignments().forEach(function(assignment) { - assignment.setValue(undefined); - }, this); - }, - - /** - * Helper to call canon.exec - */ - exec: function() { - canon.exec(this.commandAssignment.value, - this.env, - this.getArgsObject(), - this.toCanonicalString()); - }, - - /** - * Extract a canonical version of the input - */ - toCanonicalString: function() { - var line = []; - line.push(this.commandAssignment.value.name); - Object.keys(this._assignments).forEach(function(name) { - var assignment = this._assignments[name]; - var type = assignment.param.type; - // TODO: This will cause problems if there is a non-default value - // after a default value. Also we need to decide when to use - // named parameters in place of positional params. Both can wait. - if (assignment.value !== assignment.param.defaultValue) { - line.push(' '); - line.push(type.stringify(assignment.value)); - } - }, this); - return line.join(''); - } -}; -oop.implement(Requisition.prototype, EventEmitter); -exports.Requisition = Requisition; - - -/** - * An object used during command line parsing to hold the various intermediate - * data steps. - *

    The 'output' of the update is held in 2 objects: input.hints which is an - * array of hints to display to the user. In the future this will become a - * single value. - *

    The other output value is input.requisition which gives access to an - * args object for use in executing the final command. - * - *

    The majority of the functions in this class are called in sequence by the - * constructor. Their task is to add to hints fill out the requisition. - *

    The general sequence is:

      - *
    • _tokenize(): convert _typed into _parts - *
    • _split(): convert _parts into _command and _unparsedArgs - *
    • _assign(): convert _unparsedArgs into requisition - *
    - * - * @param typed {string} The instruction as typed by the user so far - * @param options {object} A list of optional named parameters. Can be any of: - * flags: Flags for us to check against the predicates specified with the - * commands. Defaulted to keyboard.buildFlags({ }); - * if not specified. - * @constructor - */ -function CliRequisition(env, options) { - Requisition.call(this, env); - - if (options && options.flags) { - /** - * TODO: We were using a default of keyboard.buildFlags({ }); - * This allowed us to have commands that only existed in certain contexts - * - i.e. Javascript specific commands. - */ - this.flags = options.flags; - } -} -oop.inherits(CliRequisition, Requisition); -(function() { - /** - * Called by the UI when ever the user interacts with a command line input - * @param input A structure that details the state of the input field. - * It should look something like: { typed:a, cursor: { start:b, end:c } } - * Where a is the contents of the input field, and b and c are the start - * and end of the cursor/selection respectively. - */ - CliRequisition.prototype.update = function(input) { - this.input = input; - this._hints = []; - - var args = this._tokenize(input.typed); - this._split(args); - - if (this.commandAssignment.value) { - this._assign(args); - } - - this._updateHints(); - }; - - /** - * Return an array of Status scores so we can create a marked up - * version of the command line input. - */ - CliRequisition.prototype.getInputStatusMarkup = function() { - // 'scores' is an array which tells us what chars are errors - // Initialize with everything VALID - var scores = this.toString().split('').map(function(ch) { - return Status.VALID; - }); - // For all chars in all hints, check and upgrade the score - this._hints.forEach(function(hint) { - for (var i = hint.start; i <= hint.end; i++) { - if (hint.status > scores[i]) { - scores[i] = hint.status; - } - } - }, this); - return scores; - }; - - /** - * Reconstitute the input from the args - */ - CliRequisition.prototype.toString = function() { - return this.getAssignments(true).map(function(assignment) { - return assignment.toString(); - }, this).join(''); - }; - - var superUpdateHints = CliRequisition.prototype._updateHints; - /** - * Marks up hints in a number of ways: - * - Makes INCOMPLETE hints that are not near the cursor INVALID since - * they can't be completed by typing - * - Finds the most severe hint, and annotates the array with it - * - Finds the hint to display, and also annotates the array with it - * TODO: I'm wondering if array annotation is evil and we should replace - * this with an object. Need to find out more. - */ - CliRequisition.prototype._updateHints = function() { - superUpdateHints.call(this); - - // Not knowing about cursor positioning, the requisition and assignments - // can't know this, but anything they mark as INCOMPLETE is actually - // INVALID unless the cursor is actually inside that argument. - var c = this.input.cursor; - this._hints.forEach(function(hint) { - var startInHint = c.start >= hint.start && c.start <= hint.end; - var endInHint = c.end >= hint.start && c.end <= hint.end; - var inHint = startInHint || endInHint; - if (!inHint && hint.status === Status.INCOMPLETE) { - hint.status = Status.INVALID; - } - }, this); - - Hint.sort(this._hints); - }; - - /** - * Accessor for the hints array. - * While we could just use the hints property, using getHints() is - * preferred for symmetry with Requisition where it needs a function due to - * lack of an atomic update system. - */ - CliRequisition.prototype.getHints = function() { - return this._hints; - }; - - /** - * Look through the arguments attached to our assignments for the assignment - * at the given position. - */ - CliRequisition.prototype.getAssignmentAt = function(position) { - var assignments = this.getAssignments(true); - for (var i = 0; i < assignments.length; i++) { - var assignment = assignments[i]; - if (!assignment.arg) { - // There is no argument in this assignment, we've fallen off - // the end of the obvious answers - it must be this one. - return assignment; - } - if (assignment.isPositionCaptured(position)) { - return assignment; - } - } - - return assignment; - }; - - /** - * Split up the input taking into account ' and " - */ - CliRequisition.prototype._tokenize = function(typed) { - // For blank input, place a dummy empty argument into the list - if (typed == null || typed.length === 0) { - return [ new Argument(this, '', 0, 0, '', '') ]; - } - - var OUTSIDE = 1; // The last character was whitespace - var IN_SIMPLE = 2; // The last character was part of a parameter - var IN_SINGLE_Q = 3; // We're inside a single quote: ' - var IN_DOUBLE_Q = 4; // We're inside double quotes: " - - var mode = OUTSIDE; - - // First we un-escape. This list was taken from: - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Unicode - // We are generally converting to their real values except for \', \" - // and '\ ' which we are converting to unicode private characters so we - // can distinguish them from ', " and ' ', which have special meaning. - // They need swapping back post-split - see unescape2() - typed = typed - .replace(/\\\\/g, '\\') - .replace(/\\b/g, '\b') - .replace(/\\f/g, '\f') - .replace(/\\n/g, '\n') - .replace(/\\r/g, '\r') - .replace(/\\t/g, '\t') - .replace(/\\v/g, '\v') - .replace(/\\n/g, '\n') - .replace(/\\r/g, '\r') - .replace(/\\ /g, '\uF000') - .replace(/\\'/g, '\uF001') - .replace(/\\"/g, '\uF002'); - - function unescape2(str) { - return str - .replace(/\uF000/g, ' ') - .replace(/\uF001/g, '\'') - .replace(/\uF002/g, '"'); - } - - var i = 0; - var start = 0; // Where did this section start? - var prefix = ''; - var args = []; - - while (true) { - if (i >= typed.length) { - // There is nothing else to read - tidy up - if (mode !== OUTSIDE) { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, start, i, prefix, '')); - } - else { - if (i !== start) { - // There's a bunch of whitespace at the end of the - // command add it to the last argument's suffix, - // creating an empty argument if needed. - var extra = typed.substring(start, i); - var lastArg = args[args.length - 1]; - if (!lastArg) { - lastArg = new Argument(this, '', i, i, extra, ''); - args.push(lastArg); - } - else { - lastArg.suffix += extra; - } - } - } - break; - } - - var c = typed[i]; - switch (mode) { - case OUTSIDE: - if (c === '\'') { - prefix = typed.substring(start, i + 1); - mode = IN_SINGLE_Q; - start = i + 1; - } - else if (c === '"') { - prefix = typed.substring(start, i + 1); - mode = IN_DOUBLE_Q; - start = i + 1; - } - else if (/ /.test(c)) { - // Still whitespace, do nothing - } - else { - prefix = typed.substring(start, i); - mode = IN_SIMPLE; - start = i; - } - break; - - case IN_SIMPLE: - // There is an edge case of xx'xx which we are assuming to - // be a single parameter (and same with ") - if (c === ' ') { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, - start, i, prefix, '')); - mode = OUTSIDE; - start = i; - prefix = ''; - } - break; - - case IN_SINGLE_Q: - if (c === '\'') { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, - start - 1, i + 1, prefix, c)); - mode = OUTSIDE; - start = i + 1; - prefix = ''; - } - break; - - case IN_DOUBLE_Q: - if (c === '"') { - var str = unescape2(typed.substring(start, i)); - args.push(new Argument(this, str, - start - 1, i + 1, prefix, c)); - mode = OUTSIDE; - start = i + 1; - prefix = ''; - } - break; - } - - i++; - } - - return args; - }; - - /** - * Looks in the canon for a command extension that matches what has been - * typed at the command line. - */ - CliRequisition.prototype._split = function(args) { - var argsUsed = 1; - var arg; - - while (argsUsed <= args.length) { - var arg = Argument.merge(args, 0, argsUsed); - this.commandAssignment.setArgument(arg); - - if (!this.commandAssignment.value) { - // Not found. break with value == null - break; - } - - /* - // Previously we needed a way to hide commands depending context. - // We have not resurrected that feature yet. - if (!keyboard.flagsMatch(command.predicates, this.flags)) { - // If the predicates say 'no match' then go LA LA LA - command = null; - break; - } - */ - - if (this.commandAssignment.value.exec) { - // Valid command, break with command valid - for (var i = 0; i < argsUsed; i++) { - args.shift(); - } - break; - } - - argsUsed++; - } - }; - - /** - * Work out which arguments are applicable to which parameters. - *

    This takes #_command.params and #_unparsedArgs and creates a map of - * param names to 'assignment' objects, which have the following properties: - *

      - *
    • param - The matching parameter. - *
    • index - Zero based index into where the match came from on the input - *
    • value - The matching input - *
    - */ - CliRequisition.prototype._assign = function(args) { - if (args.length === 0) { - this.setDefaultValues(); - return; - } - - // Create an error if the command does not take parameters, but we have - // been given them ... - if (this.assignmentCount === 0) { - // TODO: previously we were doing some extra work to avoid this if - // we determined that we had args that were all whitespace, but - // probably given our tighter tokenize() this won't be an issue? - this._hints.push(new Hint(Status.INVALID, - this.commandAssignment.value.name + - ' does not take any parameters', - Argument.merge(args))); - return; - } - - // Special case: if there is only 1 parameter, and that's of type - // text we put all the params into the first param - if (this.assignmentCount === 1) { - var assignment = this.getAssignment(0); - if (assignment.param.type.name === 'text') { - assignment.setArgument(Argument.merge(args)); - return; - } - } - - var assignments = this.cloneAssignments(); - var names = this.getParameterNames(); - - // Extract all the named parameters - var used = []; - assignments.forEach(function(assignment) { - var namedArgText = '--' + assignment.name; - - var i = 0; - while (true) { - var arg = args[i]; - if (namedArgText !== arg.text) { - i++; - if (i >= args.length) { - break; - } - continue; - } - - // boolean parameters don't have values, default to false - if (assignment.param.type.name === 'boolean') { - assignment.setValue(true); - } - else { - if (i + 1 < args.length) { - // Missing value portion of this named param - this._hints.push(new Hint(Status.INCOMPLETE, - 'Missing value for: ' + namedArgText, - args[i])); - } - else { - args.splice(i + 1, 1); - assignment.setArgument(args[i + 1]); - } - } - - lang.arrayRemove(names, assignment.name); - args.splice(i, 1); - // We don't need to i++ if we splice - } - }, this); - - // What's left are positional parameters assign in order - names.forEach(function(name) { - var assignment = this.getAssignment(name); - if (args.length === 0) { - // No more values - assignment.setValue(undefined); // i.e. default - } - else { - var arg = args[0]; - args.splice(0, 1); - assignment.setArgument(arg); - } - }, this); - - if (args.length > 0) { - var remaining = Argument.merge(args); - this._hints.push(new Hint(Status.INVALID, - 'Input \'' + remaining.text + '\' makes no sense.', - remaining)); - } - }; - -})(); -exports.CliRequisition = CliRequisition; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Skywriter Team (skywriter@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/commands/basic', function(require, exports, module) { - - -var checks = require("pilot/typecheck"); -var canon = require('pilot/canon'); - - -/** - * '!' command - */ -var bangCommandSpec = { - name: 'sh', - description: 'Execute a system command (requires server support)', - params: [ - { - name: 'command', - type: 'text', - description: 'The string to send to the os shell.' - } - ], - exec: function(env, args, request) { - var req = new XMLHttpRequest(); - req.open('GET', '/exec?args=' + args.command, true); - req.onreadystatechange = function(ev) { - if (req.readyState == 4) { - if (req.status == 200) { - request.done('
    ' + req.responseText + '
    '); - } - } - }; - req.send(null); - } -}; - - -var canon = require('pilot/canon'); - -exports.startup = function(data, reason) { - canon.addCommand(bangCommandSpec); -}; - -exports.shutdown = function(data, reason) { - canon.removeCommand(bangCommandSpec); -}; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/index', function(require, exports, module) { - - -exports.startup = function(data, reason) { - - var pilot = require('pilot/index'); - require('cockpit/cli').startup(data, reason); - window.testCli = require('cockpit/test/testCli'); - - require('cockpit/ui/settings').startup(data, reason); - require('cockpit/ui/cliView').startup(data, reason); - require('cockpit/commands/basic').startup(data, reason); -}; - -/* -exports.shutdown(data, reason) { -}; -*/ - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/ui/cliView', function(require, exports, module) { - - -var editorCss = require("text!cockpit/ui/cliView.css"); -var dom = require("pilot/dom"); -dom.importCssString(editorCss); - -var canon = require("pilot/canon"); -var Status = require('pilot/types').Status; -var keyutil = require('pilot/keyboard/keyutil'); - -var CliRequisition = require('cockpit/cli').CliRequisition; -var Hint = require('cockpit/cli').Hint; -var RequestView = require('cockpit/ui/requestView').RequestView; - -var NO_HINT = new Hint(Status.VALID, '', 0, 0); - -/** - * On startup we need to: - * 1. Add 3 sets of elements to the DOM for: - * - command line output - * - input hints - * - completion - * 2. Attach a set of events so the command line works - */ -exports.startup = function(data, reason) { - var cli = new CliRequisition(data.env); - var cliView = new CliView(cli, data.env); -}; - -/** - * A class to handle the simplest UI implementation - */ -function CliView(cli, env) { - this.cli = cli; - this.doc = document; - this.win = this.doc.defaultView; - - // TODO: we should have a better way to specify command lines??? - this.element = this.doc.getElementById('cockpitInput'); - if (!this.element) { - console.log('No element with an id of cockpit. Bailing on cli'); - return; - } - - this.settings = env.settings; - this.hintDirection = this.settings.getSetting('hintDirection'); - this.outputDirection = this.settings.getSetting('outputDirection'); - this.outputHeight = this.settings.getSetting('outputHeight'); - - // If the requisition tells us something has changed, we use this to know - // if we should ignore it - this.isUpdating = false; - - this.createElements(); - this.update(); -} -CliView.prototype = { - /** - * Create divs for completion, hints and output - */ - createElements: function() { - var input = this.element; - - this.element.spellcheck = false; - - this.output = this.doc.getElementById('cockpitOutput'); - this.popupOutput = (this.output == null); - if (!this.output) { - this.output = this.doc.createElement('div'); - this.output.id = 'cockpitOutput'; - this.output.className = 'cptFocusPopup'; - input.parentNode.insertBefore(this.output, input.nextSibling); - - var setMaxOutputHeight = function() { - this.output.style.maxHeight = this.outputHeight.get() + 'px'; - }.bind(this); - this.outputHeight.addEventListener('change', setMaxOutputHeight); - setMaxOutputHeight(); - } - - this.completer = this.doc.createElement('div'); - this.completer.className = 'cptCompletion VALID'; - var style = window.getComputedStyle(input, null); - this.completer.style.color = style.color; - this.completer.style.fontSize = style.fontSize; - this.completer.style.fontFamily = style.fontFamily; - this.completer.style.fontWeight = style.fontWeight; - this.completer.style.fontStyle = style.fontStyle; - input.parentNode.insertBefore(this.completer, input.nextSibling); - - // Transfer background styling to the completer. - this.completer.style.backgroundColor = input.style.backgroundColor; - input.style.backgroundColor = 'transparent'; - - this.hinter = this.doc.createElement('div'); - this.hinter.className = 'cptHints cptFocusPopup'; - input.parentNode.insertBefore(this.hinter, input.nextSibling); - - var resizer = this.resizer.bind(this); - this.win.addEventListener('resize', resizer, false); - this.hintDirection.addEventListener('change', resizer); - this.outputDirection.addEventListener('change', resizer); - resizer(); - - canon.addEventListener('output', function(ev) { - new RequestView(ev.request, this); - }.bind(this)); - - keyutil.addKeyDownListener(input, this.onKeyDown.bind(this)); - input.addEventListener('keyup', this.onKeyUp.bind(this), true); - // cursor position affects hint severity. TODO: shortcuts for speed - input.addEventListener('mouseup', function(ev) { - this.isUpdating = true; - this.update(); - this.isUpdating = false; - }.bind(this), false); - - this.cli.addEventListener('argumentChange', this.onArgChange.bind(this)); - }, - - /** - * We need to see the output of the latest command entered - */ - scrollOutputToBottom: function() { - // Certain browsers have a bug such that scrollHeight is too small - // when content does not fill the client area of the element - var scrollHeight = Math.max(this.output.scrollHeight, this.output.clientHeight); - this.output.scrollTop = scrollHeight - this.output.clientHeight; - }, - - /** - * To be called on window resize or any time we want to align the elements - * with the input box. - */ - resizer: function() { - var rect = this.element.getClientRects()[0]; - - this.completer.style.top = rect.top + 'px'; - this.completer.style.height = rect.height + 'px'; - this.completer.style.lineHeight = rect.height + 'px'; - this.completer.style.left = rect.left + 'px'; - this.completer.style.width = rect.width + 'px'; - - if (this.hintDirection.get() === 'below') { - this.hinter.style.top = rect.bottom + 'px'; - this.hinter.style.bottom = 'auto'; - } - else { - this.hinter.style.top = 'auto'; - this.hinter.style.bottom = (this.win.innerHeight - rect.top) + 'px'; - } - this.hinter.style.left = (rect.left + 30) + 'px'; - this.hinter.style.maxWidth = (rect.width - 110) + 'px'; - - if (this.popupOutput) { - if (this.outputDirection.get() === 'below') { - this.output.style.top = rect.bottom + 'px'; - this.output.style.bottom = 'auto'; - } - else { - this.output.style.top = 'auto'; - this.output.style.bottom = (this.win.innerHeight - rect.top) + 'px'; - } - this.output.style.left = rect.left + 'px'; - this.output.style.width = (rect.width - 80) + 'px'; - } - }, - - /** - * Ensure that TAB isn't handled by the browser - */ - onKeyDown: function(ev) { - var handled; - // var handled = keyboardManager.processKeyEvent(ev, this, { - // isCommandLine: true, isKeyUp: false - // }); - if (ev.keyCode === keyutil.KeyHelper.KEY.TAB || - ev.keyCode === keyutil.KeyHelper.KEY.UP || - ev.keyCode === keyutil.KeyHelper.KEY.DOWN) { - return true; - } - return handled; - }, - - /** - * The main keyboard processing loop - */ - onKeyUp: function(ev) { - var handled; - /* - var handled = keyboardManager.processKeyEvent(ev, this, { - isCommandLine: true, isKeyUp: true - }); - */ - - // RETURN does a special exec/highlight thing - if (ev.keyCode === keyutil.KeyHelper.KEY.RETURN) { - var worst = this.cli.getWorstHint(); - // Deny RETURN unless the command might work - if (worst.status === Status.VALID) { - this.cli.exec(); - this.element.value = ''; - } - else { - // If we've denied RETURN because the command was not VALID, - // select the part of the command line that is causing problems - // TODO: if there are 2 errors are we picking the right one? - this.element.selectionStart = worst.start; - this.element.selectionEnd = worst.end; - } - } - - this.update(); - - // Special actions which delegate to the assignment - var current = this.cli.getAssignmentAt(this.element.selectionStart); - if (current) { - // TAB does a special complete thing - if (ev.keyCode === keyutil.KeyHelper.KEY.TAB) { - current.complete(); - this.update(); - } - - // UP/DOWN look for some history - if (ev.keyCode === keyutil.KeyHelper.KEY.UP) { - current.increment(); - this.update(); - } - if (ev.keyCode === keyutil.KeyHelper.KEY.DOWN) { - current.decrement(); - this.update(); - } - } - - return handled; - }, - - /** - * Actually parse the input and make sure we're all up to date - */ - update: function() { - this.isUpdating = true; - var input = { - typed: this.element.value, - cursor: { - start: this.element.selectionStart, - end: this.element.selectionEnd - } - }; - this.cli.update(input); - - var display = this.cli.getAssignmentAt(input.cursor.start).getHint(); - - // 1. Update the completer with prompt/error marker/TAB info - dom.removeCssClass(this.completer, Status.VALID.toString()); - dom.removeCssClass(this.completer, Status.INCOMPLETE.toString()); - dom.removeCssClass(this.completer, Status.INVALID.toString()); - - var completion = '> '; - if (this.element.value.length > 0) { - var scores = this.cli.getInputStatusMarkup(); - completion += this.markupStatusScore(scores); - } - - // Display the "-> prediction" at the end of the completer - if (this.element.value.length > 0 && - display.predictions && display.predictions.length > 0) { - var tab = display.predictions[0]; - completion += '  ⇥ ' + (tab.name ? tab.name : tab); - } - this.completer.innerHTML = completion; - dom.addCssClass(this.completer, this.cli.getWorstHint().status.toString()); - - // 2. Update the hint element - var hint = ''; - if (this.element.value.length !== 0) { - hint += display.message; - if (display.predictions && display.predictions.length > 0) { - hint += ': [ '; - display.predictions.forEach(function(prediction) { - hint += (prediction.name ? prediction.name : prediction); - hint += ' | '; - }, this); - hint = hint.replace(/\| $/, ']'); - } - } - - this.hinter.innerHTML = hint; - if (hint.length === 0) { - dom.addCssClass(this.hinter, 'cptNoPopup'); - } - else { - dom.removeCssClass(this.hinter, 'cptNoPopup'); - } - - this.isUpdating = false; - }, - - /** - * Markup an array of Status values with spans - */ - markupStatusScore: function(scores) { - var completion = ''; - // Create mark-up - var i = 0; - var lastStatus = -1; - while (true) { - if (lastStatus !== scores[i]) { - completion += ''; - lastStatus = scores[i]; - } - completion += this.element.value[i]; - i++; - if (i === this.element.value.length) { - completion += ''; - break; - } - if (lastStatus !== scores[i]) { - completion += ''; - } - } - - return completion; - }, - - /** - * Update the input element to reflect the changed argument - */ - onArgChange: function(ev) { - if (this.isUpdating) { - return; - } - - var prefix = this.element.value.substring(0, ev.argument.start); - var suffix = this.element.value.substring(ev.argument.end); - var insert = typeof ev.text === 'string' ? ev.text : ev.text.name; - this.element.value = prefix + insert + suffix; - // Fix the cursor. - var insertEnd = (prefix + insert).length; - this.element.selectionStart = insertEnd; - this.element.selectionEnd = insertEnd; - } -}; -exports.CliView = CliView; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/ui/requestView', function(require, exports, module) { - -var dom = require("pilot/dom"); -var event = require("pilot/event"); -var requestViewHtml = require("text!cockpit/ui/requestView.html"); -var Templater = require("pilot/domtemplate").Templater; - -var requestViewCss = require("text!cockpit/ui/requestView.css"); -dom.importCssString(requestViewCss); - -/** - * Pull the HTML into the DOM, but don't add it to the document - */ -var templates = document.createElement('div'); -templates.innerHTML = requestViewHtml; -var row = templates.querySelector('.cptRow'); - -/** - * Work out the path for images - */ -var filename = module.id.split('/').pop() + '.js'; -var imagePath; -if (module.uri.substr(-filename.length) !== filename) { - console.error('module.id', module.id); - console.error('module.uri', module.uri); - console.error('filename', filename); - console.error('Can\'t work out path from module.uri/module/id'); - imagePath = '.'; -} -else { - var end = module.uri.length - filename.length; - imagePath = module.uri.substr(0, end) + 'images'; -} - -/** - * Adds a row to the CLI output display - */ -function RequestView(request, cliView) { - this.request = request; - this.cliView = cliView; - this.imagePath = imagePath; - - // Elements attached to this by the templater. For info only - this.rowin = null; - this.rowout = null; - this.output = null; - this.hide = null; - this.show = null; - this.duration = null; - this.throb = null; - - new Templater().processNode(row.cloneNode(true), this); - - this.cliView.output.appendChild(this.rowin); - this.cliView.output.appendChild(this.rowout); - - this.request.addEventListener('output', this.onRequestChange.bind(this)); -}; - -RequestView.prototype = { - /** - * A single click on an invocation line in the console copies the command to - * the command line - */ - copyToInput: function() { - this.cliView.element.value = this.request.typed; - }, - - /** - * A double click on an invocation line in the console executes the command - */ - executeRequest: function(ev) { - this.cliView.cli.update({ - typed: this.request.typed, - cursor: { start:0, end:0 } - }); - this.cliView.cli.exec(); - }, - - hideOutput: function(ev) { - this.output.style.display = 'none'; - dom.addCssClass(this.hide, 'cmd_hidden'); - dom.removeCssClass(this.show, 'cmd_hidden'); - - event.stopPropagation(ev); - }, - - showOutput: function(ev) { - this.output.style.display = 'block'; - dom.removeCssClass(this.hide, 'cmd_hidden'); - dom.addCssClass(this.show, 'cmd_hidden'); - - event.stopPropagation(ev); - }, - - remove: function(ev) { - this.cliView.output.removeChild(this.rowin); - this.cliView.output.removeChild(this.rowout); - event.stopPropagation(ev); - }, - - onRequestChange: function(ev) { - this.duration.innerHTML = this.request.duration ? - 'completed in ' + (this.request.duration / 1000) + ' sec ' : - ''; - - this.output.innerHTML = ''; - this.request.outputs.forEach(function(output) { - var node; - if (typeof output == 'string') { - node = document.createElement('p'); - node.innerHTML = output; - } else { - node = output; - } - this.output.appendChild(node); - }, this); - this.cliView.scrollOutputToBottom(); - - dom.setCssClass(this.output, 'cmd_error', this.request.error); - - this.throb.style.display = this.request.completed ? 'none' : 'block'; - } -}; -exports.RequestView = RequestView; - - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Joe Walker (jwalker@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('cockpit/ui/settings', function(require, exports, module) { - - -var types = require("pilot/types"); -var SelectionType = require('pilot/types/basic').SelectionType; - -var direction = new SelectionType({ - name: 'direction', - data: [ 'above', 'below' ] -}); - -var hintDirectionSetting = { - name: "hintDirection", - description: "Are hints shown above or below the command line?", - type: "direction", - defaultValue: "above" -}; - -var outputDirectionSetting = { - name: "outputDirection", - description: "Is the output window shown above or below the command line?", - type: "direction", - defaultValue: "above" -}; - -var outputHeightSetting = { - name: "outputHeight", - description: "What height should the output panel be?", - type: "number", - defaultValue: 300 -}; - -exports.startup = function(data, reason) { - types.registerType(direction); - data.env.settings.addSetting(hintDirectionSetting); - data.env.settings.addSetting(outputDirectionSetting); - data.env.settings.addSetting(outputHeightSetting); -}; - -exports.shutdown = function(data, reason) { - types.unregisterType(direction); - data.env.settings.removeSetting(hintDirectionSetting); - data.env.settings.removeSetting(outputDirectionSetting); - data.env.settings.removeSetting(outputHeightSetting); -}; - - }); /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -10703,2419 +8758,6 @@ var Text = function(parentEl) { exports.Text = Text; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/css', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextMode = require("ace/mode/text").Mode; -var Tokenizer = require("ace/tokenizer").Tokenizer; -var CssHighlightRules = require("ace/mode/css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules()); - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - // ignore braces in comments - var tokens = this.$tokenizer.getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - return this.$outdent.autoOutdent(doc, row); - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/css_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var lang = require("pilot/lang"); -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -var CssHighlightRules = function() { - - var properties = lang.arrayToMap( - ("azimuth|background-attachment|background-color|background-image|" + - "background-position|background-repeat|background|border-bottom-color|" + - "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + - "border-color|border-left-color|border-left-style|border-left-width|" + - "border-left|border-right-color|border-right-style|border-right-width|" + - "border-right|border-spacing|border-style|border-top-color|" + - "border-top-style|border-top-width|border-top|border-width|border|" + - "bottom|caption-side|clear|clip|color|content|counter-increment|" + - "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + - "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + - "font-stretch|font-style|font-variant|font-weight|font|height|left|" + - "letter-spacing|line-height|list-style-image|list-style-position|" + - "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + - "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + - "min-width|-moz-border-radius|opacity|orphans|outline-color|" + - "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + - "padding-left|padding-right|padding-top|padding|page-break-after|" + - "page-break-before|page-break-inside|page|pause-after|pause-before|" + - "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + - "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + - "stress|table-layout|text-align|text-decoration|text-indent|" + - "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + - "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + - "z-index").split("|") - ); - - var functions = lang.arrayToMap( - ("rgb|rgba|url|attr|counter|counters").split("|") - ); - - var constants = lang.arrayToMap( - ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" + - "block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|" + - "char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|" + - "decimal-leading-zero|decimal|default|disabled|disc|" + - "distribute-all-lines|distribute-letter|distribute-space|" + - "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" + - "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" + - "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" + - "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" + - "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" + - "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" + - "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" + - "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" + - "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" + - "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" + - "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" + - "solid|square|static|strict|super|sw-resize|table-footer-group|" + - "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" + - "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" + - "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" + - "zero").split("|") - ); - - var colors = lang.arrayToMap( - ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" + - "purple|red|silver|teal|white|yellow").split("|") - ); - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; - - function ic(str) { - var re = []; - var chars = str.split(""); - for (var i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/doc_comment_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : "start" - }, { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc", - regex : "\s+" - }, { - token : "comment.doc", - regex : "TODO" - }, { - token : "comment.doc", - regex : "[^@\\*]+" - }, { - token : "comment.doc", - regex : "." - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -(function() { - - this.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next: start - }; - }; - -}).call(DocCommentHighlightRules.prototype); - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/html', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextMode = require("ace/mode/text").Mode; -var JavaScriptMode = require("ace/mode/javascript").Mode; -var CssMode = require("ace/mode/css").Mode; -var Tokenizer = require("ace/tokenizer").Tokenizer; -var HtmlHighlightRules = require("ace/mode/html_highlight_rules").HtmlHighlightRules; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new HtmlHighlightRules().getRules()); - - this.$js = new JavaScriptMode(); - this.$css = new CssMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - return this.$delegate("toggleCommentLines", arguments, function() { - return 0; - }); - }; - - this.getNextLineIndent = function(state, line, tab) { - var self = this; - return this.$delegate("getNextLineIndent", arguments, function() { - return self.$getIndent(line); - }); - }; - - this.checkOutdent = function(state, line, input) { - return this.$delegate("checkOutdent", arguments, function() { - return false; - }); - }; - - this.autoOutdent = function(state, doc, row) { - return this.$delegate("autoOutdent", arguments); - }; - - this.$delegate = function(method, args, defaultHandler) { - var state = args[0]; - var split = state.split("js-"); - - if (!split[0] && split[1]) { - args[0] = split[1]; - return this.$js[method].apply(this.$js, args); - } - - var split = state.split("css-"); - if (!split[0] && split[1]) { - args[0] = split[1]; - return this.$css[method].apply(this.$css, args); - } - - return defaultHandler ? defaultHandler() : undefined; - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/html_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var CssHighlightRules = require("ace/mode/css_highlight_rules").CssHighlightRules; -var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules; -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -var HtmlHighlightRules = function() { - - // regexp must not have capturing parentheses - // regexps are ordered -> the first match is used - - this.$rules = { - start : [ { - token : "text", - regex : "<\\!\\[CDATA\\[", - next : "cdata" - }, { - token : "xml_pe", - regex : "<\\?.*?\\?>" - }, { - token : "comment", - regex : "<\\!--", - next : "comment" - }, { - token : "text", - regex : "<(?=\s*script)", - next : "script" - }, { - token : "text", - regex : "<(?=\s*style)", - next : "css" - }, { - token : "text", // opening tag - regex : "<\\/?", - next : "tag" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "[^<]+" - } ], - - script : [ { - token : "text", - regex : ">", - next : "js-start" - }, { - token : "keyword", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "text", - regex : "\\s+" - }, { - token : "string", - regex : '".*?"' - }, { - token : "string", - regex : "'.*?'" - } ], - - css : [ { - token : "text", - regex : ">", - next : "css-start" - }, { - token : "keyword", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "text", - regex : "\\s+" - }, { - token : "string", - regex : '".*?"' - }, { - token : "string", - regex : "'.*?'" - } ], - - tag : [ { - token : "text", - regex : ">", - next : "start" - }, { - token : "keyword", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "text", - regex : "\\s+" - }, { - token : "string", - regex : '".*?"' - }, { - token : "string", - regex : "'.*?'" - } ], - - cdata : [ { - token : "text", - regex : "\\]\\]>", - next : "start" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : ".+" - } ], - - comment : [ { - token : "comment", - regex : ".*?-->", - next : "start" - }, { - token : "comment", - regex : ".+" - } ] - }; - - var jsRules = new JavaScriptHighlightRules().getRules(); - this.addRules(jsRules, "js-"); - this.$rules["js-start"].unshift({ - token: "comment", - regex: "\\/\\/.*(?=<\\/script>)", - next: "tag" - }, { - token: "text", - regex: "<\\/(?=script)", - next: "tag" - }); - - var cssRules = new CssHighlightRules().getRules(); - this.addRules(cssRules, "css-"); - this.$rules["css-start"].unshift({ - token: "text", - regex: "<\\/(?=style)", - next: "tag" - }); -}; - -oop.inherits(HtmlHighlightRules, TextHighlightRules); - -exports.HtmlHighlightRules = HtmlHighlightRules; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/javascript', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextMode = require("ace/mode/text").Mode; -var Tokenizer = require("ace/tokenizer").Tokenizer; -var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules; -var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; -var Range = require("ace/range").Range; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules()); - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - var outdent = true; - var outentedRows = []; - var re = /^(\s*)\/\//; - - for (var i=startRow; i<= endRow; i++) { - if (!re.test(doc.getLine(i))) { - outdent = false; - break; - } - } - - if (outdent) { - var deleteRange = new Range(0, 0, 0, 0); - for (var i=startRow; i<= endRow; i++) - { - var line = doc.getLine(i).replace(re, "$1"); - deleteRange.start.row = i; - deleteRange.end.row = i; - deleteRange.end.column = line.length + 2; - doc.replace(deleteRange, line); - } - return -2; - } - else { - return doc.indentRows(startRow, endRow, "//"); - } - }; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.$tokenizer.getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - return this.$outdent.autoOutdent(doc, row); - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/javascript_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var lang = require("pilot/lang"); -var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -JavaScriptHighlightRules = function() { - - var docComment = new DocCommentHighlightRules(); - - var keywords = lang.arrayToMap( - ("break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with").split("|") - ); - - var buildinConstants = lang.arrayToMap( - ("null|Infinity|NaN|undefined").split("|") - ); - - var futureReserved = lang.arrayToMap( - ("class|enum|extends|super|const|export|import|implements|let|private|" + - "public|yield|interface|package|protected|static").split("|") - ); - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - docComment.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : function(value) { - if (value == "this") - return "variable.language"; - else if (keywords[value]) - return "keyword"; - else if (buildinConstants[value]) - return "constant.language"; - else if (futureReserved[value]) - return "invalid.illegal"; - else if (value == "debugger") - return "invalid.deprecated"; - else - return "identifier"; - }, - // TODO: Unicode escape sequences - // TODO: Unicode identifiers - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; - - this.addRules(docComment.getRules(), "doc-"); - this.$rules["doc-start"][0].next = "start"; -}; - -oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - -exports.JavaScriptHighlightRules = JavaScriptHighlightRules; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/matching_brace_outdent', function(require, exports, module) { - -var Range = require("ace/range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - - return indent.length - (column-1); - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); -/* ***** BEGIN LICENSE BLOCK ***** -* Version: MPL 1.1/GPL 2.0/LGPL 2.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is Ajax.org Code Editor (ACE). -* -* The Initial Developer of the Original Code is -* Ajax.org Services B.V. -* Portions created by the Initial Developer are Copyright (C) 2010 -* the Initial Developer. All Rights Reserved. -* -* Contributor(s): -* André Fiedler -* -* Alternatively, the contents of this file may be used under the terms of -* either the GNU General Public License Version 2 or later (the "GPL"), or -* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -* in which case the provisions of the GPL or the LGPL are applicable instead -* of those above. If you wish to allow use of your version of this file only -* under the terms of either the GPL or the LGPL, and not to allow others to -* use your version of this file under the terms of the MPL, indicate your -* decision by deleting the provisions above and replace them with the notice -* and other provisions required by the GPL or the LGPL. If you do not delete -* the provisions above, a recipient may use your version of this file under -* the terms of any one of the MPL, the GPL or the LGPL. -* -* ***** END LICENSE BLOCK ***** */ - -define('ace/mode/php', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextMode = require("ace/mode/text").Mode; -var Tokenizer = require("ace/tokenizer").Tokenizer; -var PhpHighlightRules = require("ace/mode/php_highlight_rules").PhpHighlightRules; -var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; -var Range = require("ace/range").Range; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new PhpHighlightRules().getRules()); - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - var outdent = true; - var outentedRows = []; - var re = /^(\s*)#/; - - for (var i=startRow; i<= endRow; i++) { - if (!re.test(doc.getLine(i))) { - outdent = false; - break; - } - } - - if (outdent) { - var deleteRange = new Range(0, 0, 0, 0); - for (var i=startRow; i<= endRow; i++) - { - var line = doc.getLine(i).replace(re, "$1"); - deleteRange.start.row = i; - deleteRange.end.row = i; - deleteRange.end.column = line.length + 2; - doc.replace(deleteRange, line); - } - return -2; - } - else { - return doc.indentRows(startRow, endRow, "#"); - } - }; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.$tokenizer.getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - return this.$outdent.autoOutdent(doc, row); - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * André Fiedler - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** - */ - -define('ace/mode/php_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var lang = require("pilot/lang"); -var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -PhpHighlightRules = function() { - - var docComment = new DocCommentHighlightRules(); - - var builtinFunctions = lang.arrayToMap( - ('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|' + - 'aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|' + - 'aggregate_properties_by_regexp|aggregation_info|apache_child_terminate|apache_get_modules|' + - 'apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|' + - 'apache_response_headers|apache_setenv|array|array_change_key_case|array_chunk|array_combine|' + - 'array_count_values|array_diff|array_diff_assoc|array_diff_uassoc|array_fill|array_filter|array_flip|' + - 'array_intersect|array_intersect_assoc|array_key_exists|array_keys|array_map|array_merge|' + - 'array_merge_recursive|array_multisort|array_pad|array_pop|array_push|array_rand|array_reduce|' + - 'array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|' + - 'array_udiff_uassoc|array_unique|array_unshift|array_values|array_walk|arsort|ascii2ebcdic|asin|asinh|asort|' + - 'aspell_check|aspell_check_raw|aspell_new|aspell_suggest|assert|assert_options|atan|atan2|atanh|' + - 'base64_decode|base64_encode|base_convert|basename|bcadd|bccomp|bcdiv|bcmod|bcmul|bcpow|bcpowmod|bcscale|' + - 'bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bzclose|bzcompress|bzdecompress|bzerrno|' + - 'bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|' + - 'call_user_func|call_user_func_array|call_user_method|call_user_method_array|ccvs_add|ccvs_auth|ccvs_command|' + - 'ccvs_count|ccvs_delete|ccvs_done|ccvs_init|ccvs_lookup|ccvs_new|ccvs_report|ccvs_return|ccvs_reverse|' + - 'ccvs_sale|ccvs_status|ccvs_textvalue|ccvs_void|ceil|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|' + - 'chroot|chunk_split|class_exists|clearstatcache|closedir|closelog|com|com_addref|com_get|com_invoke|' + - 'com_isenum|com_load|com_load_typelib|com_propget|com_propput|com_propset|com_release|com_set|compact|' + - 'connection_aborted|connection_status|connection_timeout|constant|convert_cyr_string|copy|cos|cosh|count|' + - 'count_chars|cpdf_add_annotation|cpdf_add_outline|cpdf_arc|cpdf_begin_text|cpdf_circle|cpdf_clip|cpdf_close|' + - 'cpdf_closepath|cpdf_closepath_fill_stroke|cpdf_closepath_stroke|cpdf_continue_text|cpdf_curveto|cpdf_end_text|' + - 'cpdf_fill|cpdf_fill_stroke|cpdf_finalize|cpdf_finalize_page|cpdf_global_set_document_limits|cpdf_import_jpeg|' + - 'cpdf_lineto|cpdf_moveto|cpdf_newpath|cpdf_open|cpdf_output_buffer|cpdf_page_init|cpdf_place_inline_image|' + - 'cpdf_rect|cpdf_restore|cpdf_rlineto|cpdf_rmoveto|cpdf_rotate|cpdf_rotate_text|cpdf_save|cpdf_save_to_file|' + - 'cpdf_scale|cpdf_set_action_url|cpdf_set_char_spacing|cpdf_set_creator|cpdf_set_current_page|cpdf_set_font|' + - 'cpdf_set_font_directories|cpdf_set_font_map_file|cpdf_set_horiz_scaling|cpdf_set_keywords|cpdf_set_leading|' + - 'cpdf_set_page_animation|cpdf_set_subject|cpdf_set_text_matrix|cpdf_set_text_pos|cpdf_set_text_rendering|' + - 'cpdf_set_text_rise|cpdf_set_title|cpdf_set_viewer_preferences|cpdf_set_word_spacing|cpdf_setdash|cpdf_setflat|' + - 'cpdf_setgray|cpdf_setgray_fill|cpdf_setgray_stroke|cpdf_setlinecap|cpdf_setlinejoin|cpdf_setlinewidth|' + - 'cpdf_setmiterlimit|cpdf_setrgbcolor|cpdf_setrgbcolor_fill|cpdf_setrgbcolor_stroke|cpdf_show|cpdf_show_xy|' + - 'cpdf_stringwidth|cpdf_stroke|cpdf_text|cpdf_translate|crack_check|crack_closedict|crack_getlastmessage|' + - 'crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|' + - 'ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|curl_close|curl_errno|curl_error|' + - 'curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|' + - 'curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_version|current|' + - 'cybercash_base64_decode|cybercash_base64_encode|cybercash_decr|cybercash_encr|cyrus_authenticate|cyrus_bind|' + - 'cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|' + - 'dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|' + - 'dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|' + - 'dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dblist|' + - 'dbmclose|dbmdelete|dbmexists|dbmfetch|dbmfirstkey|dbminsert|dbmnextkey|dbmopen|dbmreplace|dbplus_add|dbplus_aql|' + - 'dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|' + - 'dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|' + - 'dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|' + - 'dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|' + - 'dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|' + - 'dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|' + - 'dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|' + - 'dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debugger_off|debugger_on|decbin|dechex|' + - 'decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|' + - 'dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|dirname|disk_free_space|disk_total_space|diskfreespace|' + - 'dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|domxml_new_doc|domxml_open_file|domxml_open_mem|' + - 'domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|' + - 'dotnet_load|doubleval|each|easter_date|easter_days|ebcdic2ascii|echo|empty|end|ereg|ereg_replace|eregi|' + - 'eregi_replace|error_log|error_reporting|escapeshellarg|escapeshellcmd|eval|exec|exif_imagetype|exif_read_data|' + - 'exif_thumbnail|exit|exp|explode|expm1|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|' + - 'fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|' + - 'fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|' + - 'fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|' + - 'fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|' + - 'fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|' + - 'fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|' + - 'fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|' + - 'fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|' + - 'fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_select_db|fbsql_set_lob_mode|' + - 'fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_tablename|fbsql_username|fbsql_warnings|' + - 'fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|' + - 'fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|' + - 'fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|' + - 'fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_opt|fdf_set_status|' + - 'fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|' + - 'fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|' + - 'fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|' + - 'filepro_retrieve|filepro_rowcount|filesize|filetype|floatval|flock|floor|flush|fmod|fnmatch|fopen|fpassthru|fprintf|' + - 'fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|' + - 'ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|' + - 'ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|' + - 'ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|' + - 'func_get_args|func_num_args|function_exists|fwrite|gd_info|get_browser|get_cfg_var|get_class|get_class_methods|' + - 'get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|' + - 'get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|' + - 'get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|' + - 'get_parent_class|get_required_files|get_resource_type|getallheaders|getcwd|getdate|getenv|gethostbyaddr|gethostbyname|' + - 'gethostbynamel|getimagesize|getlastmod|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getopt|getprotobyname|' + - 'getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|gettext|gettimeofday|gettype|glob|gmdate|gmmktime|' + - 'gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|' + - 'gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_or|' + - 'gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|' + - 'gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_xor|gmstrftime|gregoriantojd|gzclose|gzcompress|gzdeflate|gzencode|gzeof|' + - 'gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|' + - 'header|headers_list|headers_sent|hebrev|hebrevc|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|' + - 'htmlspecialchars|http_build_query|hw_api_attribute|hw_api_content|hw_api_object|hw_array2objrec|hw_changeobject|' + - 'hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|' + - 'hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|' + - 'hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|' + - 'hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|' + - 'hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|' + - 'hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|' + - 'hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|' + - 'hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|' + - 'hwapi_hgcsp|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|' + - 'ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|' + - 'ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|' + - 'ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|' + - 'ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|' + - 'ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|' + - 'ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|' + - 'ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|' + - 'iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|idate|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|' + - 'ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|' + - 'ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|' + - 'ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|' + - 'ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|' + - 'ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|image2wbmp|image_type_to_mime_type|imagealphablending|' + - 'imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|' + - 'imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|' + - 'imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imagecopy|' + - 'imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|' + - 'imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|' + - 'imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|' + - 'imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|' + - 'imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|' + - 'imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepscopyfont|imagepsencodefont|imagepsextendfont|' + - 'imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|' + - 'imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|' + - 'imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|' + - 'imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|' + - 'imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchstructure|imap_get_quota|imap_get_quotaroot|' + - 'imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|' + - 'imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|' + - 'imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|' + - 'imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_scanmailbox|' + - 'imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|' + - 'imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implode|import_request_variables|in_array|' + - 'ingres_autocommit|ingres_close|ingres_commit|ingres_connect|ingres_fetch_array|ingres_fetch_object|ingres_fetch_row|' + - 'ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|' + - 'ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_query|ingres_rollback|ini_alter|ini_get|ini_get_all|ini_restore|' + - 'ini_set|intval|ip2long|iptcembed|iptcparse|ircg_channel_mode|ircg_disconnect|ircg_fetch_error_msg|ircg_get_username|' + - 'ircg_html_encode|ircg_ignore_add|ircg_ignore_del|ircg_invite|ircg_is_conn_alive|ircg_join|ircg_kick|ircg_list|' + - 'ircg_lookup_format_messages|ircg_lusers|ircg_msg|ircg_nick|ircg_nickname_escape|ircg_nickname_unescape|ircg_notice|ircg_oper|' + - 'ircg_part|ircg_pconnect|ircg_register_format_messages|ircg_set_current|ircg_set_file|ircg_set_on_die|ircg_topic|ircg_who|' + - 'ircg_whois|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|' + - 'is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|' + - 'is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isset|java_last_exception_clear|java_last_exception_get|' + - 'jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|juliantojd|key|' + - 'krsort|ksort|lcg_value|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|' + - 'ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|' + - 'ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|' + - 'ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|' + - 'ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|' + - 'ldap_start_tls|ldap_t61_to_8859|ldap_unbind|levenshtein|link|linkinfo|list|localeconv|localtime|log|log10|log1p|long2ip|lstat|' + - 'ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|' + - 'mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|' + - 'mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|' + - 'mailparse_stream_encode|mailparse_uudecode_all|main|max|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|' + - 'mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|' + - 'mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|' + - 'mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|' + - 'mb_internal_encoding|mb_language|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|' + - 'mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_strlen|mb_strpos|mb_strrpos|mb_strtolower|mb_strtoupper|mb_strwidth|' + - 'mb_substitute_character|mb_substr|mb_substr_count|mcal_append_event|mcal_close|mcal_create_calendar|mcal_date_compare|' + - 'mcal_date_valid|mcal_day_of_week|mcal_day_of_year|mcal_days_in_month|mcal_delete_calendar|mcal_delete_event|' + - 'mcal_event_add_attribute|mcal_event_init|mcal_event_set_alarm|mcal_event_set_category|mcal_event_set_class|' + - 'mcal_event_set_description|mcal_event_set_end|mcal_event_set_recur_daily|mcal_event_set_recur_monthly_mday|' + - 'mcal_event_set_recur_monthly_wday|mcal_event_set_recur_none|mcal_event_set_recur_weekly|mcal_event_set_recur_yearly|' + - 'mcal_event_set_start|mcal_event_set_title|mcal_expunge|mcal_fetch_current_stream_event|mcal_fetch_event|mcal_is_leap_year|' + - 'mcal_list_alarms|mcal_list_events|mcal_next_recurrence|mcal_open|mcal_popen|mcal_rename_calendar|mcal_reopen|mcal_snooze|' + - 'mcal_store_event|mcal_time_valid|mcal_week_of_year|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|' + - 'mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|' + - 'mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|' + - 'mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|' + - 'mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|' + - 'mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|' + - 'mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|' + - 'mcrypt_module_self_test|mcrypt_ofb|mcve_adduser|mcve_adduserarg|mcve_bt|mcve_checkstatus|mcve_chkpwd|mcve_chngpwd|' + - 'mcve_completeauthorizations|mcve_connect|mcve_connectionerror|mcve_deleteresponse|mcve_deletetrans|mcve_deleteusersetup|' + - 'mcve_deluser|mcve_destroyconn|mcve_destroyengine|mcve_disableuser|mcve_edituser|mcve_enableuser|mcve_force|mcve_getcell|' + - 'mcve_getcellbynum|mcve_getcommadelimited|mcve_getheader|mcve_getuserarg|mcve_getuserparam|mcve_gft|mcve_gl|mcve_gut|mcve_initconn|' + - 'mcve_initengine|mcve_initusersetup|mcve_iscommadelimited|mcve_liststats|mcve_listusers|mcve_maxconntimeout|mcve_monitor|' + - 'mcve_numcolumns|mcve_numrows|mcve_override|mcve_parsecommadelimited|mcve_ping|mcve_preauth|mcve_preauthcompletion|mcve_qc|' + - 'mcve_responseparam|mcve_return|mcve_returncode|mcve_returnstatus|mcve_sale|mcve_setblocking|mcve_setdropfile|mcve_setip|' + - 'mcve_setssl|mcve_setssl_files|mcve_settimeout|mcve_settle|mcve_text_avs|mcve_text_code|mcve_text_cv|mcve_transactionauth|' + - 'mcve_transactionavs|mcve_transactionbatch|mcve_transactioncv|mcve_transactionid|mcve_transactionitem|mcve_transactionssent|' + - 'mcve_transactiontext|mcve_transinqueue|mcve_transnew|mcve_transparam|mcve_transsend|mcve_ub|mcve_uwait|mcve_verifyconnection|' + - 'mcve_verifysslcert|mcve_void|md5|md5_file|mdecrypt_generic|memory_get_usage|metaphone|method_exists|mhash|mhash_count|' + - 'mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_setcubicthreshold|ming_setscale|' + - 'ming_useswfversion|mkdir|mktime|money_format|move_uploaded_file|msession_connect|msession_count|msession_create|msession_destroy|' + - 'msession_disconnect|msession_find|msession_get|msession_get_array|msession_getdata|msession_inc|msession_list|msession_listvar|' + - 'msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_setdata|msession_timeout|msession_uniq|' + - 'msession_unlock|msg_get_queue|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql|msql_affected_rows|' + - 'msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|' + - 'msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|' + - 'msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|' + - 'msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|' + - 'msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|' + - 'mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|' + - 'mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|' + - 'mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|' + - 'mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|muscat_close|muscat_get|muscat_give|muscat_setup|' + - 'muscat_setup_net|mysql_affected_rows|mysql_change_user|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|' + - 'mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|' + - 'mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|' + - 'mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|' + - 'mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|' + - 'mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|' + - 'mysql_select_db|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli_affected_rows|mysqli_autocommit|' + - 'mysqli_bind_param|mysqli_bind_result|mysqli_change_user|mysqli_character_set_name|mysqli_client_encoding|mysqli_close|mysqli_commit|' + - 'mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|mysqli_debug|mysqli_disable_reads_from_master|' + - 'mysqli_disable_rpl_parse|mysqli_dump_debug_info|mysqli_embedded_connect|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|' + - 'mysqli_errno|mysqli_error|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|' + - 'mysqli_fetch_field_direct|mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|' + - 'mysqli_field_seek|mysqli_field_tell|mysqli_free_result|mysqli_get_client_info|mysqli_get_client_version|mysqli_get_host_info|' + - 'mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_info|mysqli_init|mysqli_insert_id|' + - 'mysqli_kill|mysqli_master_query|mysqli_more_results|mysqli_multi_query|mysqli_next_result|mysqli_num_fields|mysqli_num_rows|' + - 'mysqli_options|mysqli_param_count|mysqli_ping|mysqli_prepare|mysqli_query|mysqli_real_connect|mysqli_real_escape_string|' + - 'mysqli_real_query|mysqli_report|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|' + - 'mysqli_send_long_data|mysqli_send_query|mysqli_server_end|mysqli_server_init|mysqli_set_opt|mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|' + - 'mysqli_stmt_init|mysqli_stmt_affected_rows|mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|' + - 'mysqli_stmt_errno|mysqli_stmt_error|mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_free_result|mysqli_stmt_num_rows|' + - 'mysqli_stmt_param_count|mysqli_stmt_prepare|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|' + - 'mysqli_stmt_store_result|mysqli_store_result|mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning_count|natcasesort|' + - 'natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|' + - 'ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|' + - 'ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|' + - 'ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|' + - 'ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|' + - 'ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|' + - 'ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|' + - 'ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|' + - 'ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|' + - 'ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|' + - 'ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|' + - 'ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|' + - 'ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|' + - 'ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|' + - 'ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|' + - 'ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|' + - 'ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|' + - 'ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|' + - 'ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|' + - 'ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|' + - 'ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|' + - 'ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|next|ngettext|nl2br|nl_langinfo|notes_body|notes_copy_db|' + - 'notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|' + - 'notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|number_format|' + - 'ob_clean|ob_end_clean|ob_end_flush|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|' + - 'ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_by_name|oci_cancel|oci_close|' + - 'oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|' + - 'oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|' + - 'oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_copy|oci_lob_is_equal|oci_new_collection|oci_new_connect|' + - 'oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|' + - 'oci_server_version|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|' + - 'ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|' + - 'ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|' + - 'ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|' + - 'ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|' + - 'ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|' + - 'odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|' + - 'odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|' + - 'odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|' + - 'odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|' + - 'odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|opendir|' + - 'openlog|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_new|openssl_csr_sign|openssl_error_string|openssl_free_key|' + - 'openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|' + - 'openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|' + - 'openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_seal|openssl_sign|openssl_verify|' + - 'openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|' + - 'openssl_x509_parse|openssl_x509_read|ora_bind|ora_close|ora_columnname|ora_columnsize|ora_columntype|ora_commit|ora_commitoff|' + - 'ora_commiton|ora_do|ora_error|ora_errorcode|ora_exec|ora_fetch|ora_fetch_into|ora_getcolumn|ora_logoff|ora_logon|ora_numcols|' + - 'ora_numrows|ora_open|ora_parse|ora_plogon|ora_rollback|ord|output_add_rewrite_var|output_reset_rewrite_vars|overload|ovrimos_close|' + - 'ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|' + - 'ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|' + - 'ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parse_ini_file|parse_str|parse_url|passthru|pathinfo|pclose|' + - 'pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|' + - 'pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|' + - 'pdf_add_locallink|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|' + - 'pdf_begin_page|pdf_begin_pattern|pdf_begin_template|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|' + - 'pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_curveto|pdf_delete|pdf_end_page|' + - 'pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_stroke|pdf_findfont|pdf_get_buffer|pdf_get_font|pdf_get_fontname|' + - 'pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|' + - 'pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_initgraphics|pdf_lineto|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open|' + - 'pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|' + - 'pdf_open_pdi_page|pdf_open_png|pdf_open_tiff|pdf_place_image|pdf_place_pdi_page|pdf_rect|pdf_restore|pdf_rotate|pdf_save|' + - 'pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_font|' + - 'pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|' + - 'pdf_set_info_title|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|' + - 'pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|' + - 'pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|' + - 'pdf_setrgbcolor_stroke|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_translate|pfpro_cleanup|pfpro_init|' + - 'pfpro_process|pfpro_process_raw|pfpro_version|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|' + - 'pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|' + - 'pg_escape_bytea|pg_escape_string|pg_fetch_all|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|' + - 'pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_type|pg_free_result|pg_get_notify|pg_get_pid|' + - 'pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|' + - 'pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|' + - 'pg_options|pg_pconnect|pg_ping|pg_port|pg_put_line|pg_query|pg_result_error|pg_result_seek|pg_result_status|pg_select|pg_send_query|' + - 'pg_set_client_encoding|pg_trace|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|php_ini_scanned_files|php_logo_guid|php_sapi_name|' + - 'php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_ctermid|posix_get_last_error|posix_getcwd|posix_getegid|' + - 'posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|' + - 'posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_isatty|posix_kill|posix_mkfifo|' + - 'posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|' + - 'posix_uname|pow|preg_grep|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|' + - 'printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|' + - 'printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|' + - 'printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|' + - 'printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|' + - 'printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|' + - 'pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_ignore|' + - 'pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|' + - 'pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|qdom_error|qdom_tree|' + - 'quoted_printable_decode|quotemeta|rad2deg|rand|range|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|' + - 'readline_add_history|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_read_history|' + - 'readline_write_history|readlink|realpath|recode|recode_file|recode_string|register_shutdown_function|register_tick_function|rename|' + - 'reset|restore_error_handler|restore_include_path|rewind|rewinddir|rmdir|round|rsort|rtrim|scandir|sem_acquire|sem_get|sem_release|' + - 'sem_remove|serialize|sesam_affected_rows|sesam_commit|sesam_connect|sesam_diagnostic|sesam_disconnect|sesam_errormsg|sesam_execimm|' + - 'sesam_fetch_array|sesam_fetch_result|sesam_fetch_row|sesam_field_array|sesam_field_name|sesam_free_result|sesam_num_fields|sesam_query|' + - 'sesam_rollback|sesam_seek_row|sesam_settransaction|session_cache_expire|session_cache_limiter|session_commit|session_decode|' + - 'session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|' + - 'session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|' + - 'session_unregister|session_unset|session_write_close|set_error_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|' + - 'set_time_limit|setcookie|setlocale|setrawcookie|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_put_var|' + - 'shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|similar_text|' + - 'simplexml_import_dom|simplexml_load_file|simplexml_load_string|sin|sinh|sizeof|sleep|snmp_get_quick_print|snmp_set_quick_print|' + - 'snmpget|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|' + - 'socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|' + - 'socket_iovec_add|socket_iovec_alloc|socket_iovec_delete|socket_iovec_fetch|socket_iovec_free|socket_iovec_set|socket_last_error|' + - 'socket_listen|socket_read|socket_readv|socket_recv|socket_recvfrom|socket_recvmsg|socket_select|socket_send|socket_sendmsg|' + - 'socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|' + - 'socket_strerror|socket_write|socket_writev|sort|soundex|split|spliti|sprintf|sql_regcase|sqlite_array_query|sqlite_busy_timeout|' + - 'sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|' + - 'sqlite_escape_string|sqlite_fetch_array|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_last_error|' + - 'sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|' + - 'sqlite_query|sqlite_rewind|sqlite_seek|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqrt|srand|sscanf|' + - 'stat|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|' + - 'strcspn|stream_context_create|stream_context_get_options|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|' + - 'stream_filter_append|stream_filter_prepend|stream_filter_register|stream_get_contents|stream_get_filters|stream_get_line|' + - 'stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_register_wrapper|stream_select|stream_set_blocking|' + - 'stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_get_name|stream_socket_recvfrom|' + - 'stream_socket_sendto|stream_socket_server|stream_wrapper_register|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|' + - 'strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpos|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|' + - 'strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|' + - 'swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|' + - 'swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|' + - 'swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|' + - 'swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|' + - 'swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|' + - 'swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|' + - 'swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|' + - 'swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfbutton_keypress|' + - 'swfdisplayitem|swffill|swffont|swfgradient|swfmorph|swfmovie|swfshape|swfsprite|swftext|swftextfield|sybase_affected_rows|sybase_close|' + - 'sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|' + - 'sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|' + - 'sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|' + - 'sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|syslog|system|tan|tanh|tcpwrap_check|tempnam|textdomain|' + - 'tidy_access_count|tidy_clean_repair|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_body|tidy_get_config|tidy_get_error_buffer|' + - 'tidy_get_head|tidy_get_html|tidy_get_html_ver|tidy_get_output|tidy_get_release|tidy_get_root|tidy_get_status|tidy_getopt|tidy_is_xhtml|' + - 'tidy_is_xml|tidy_load_config|tidy_parse_file|tidy_parse_string|tidy_repair_file|tidy_repair_string|tidy_reset_config|tidy_save_config|' + - 'tidy_set_encoding|tidy_setopt|tidy_warning_count|time|tmpfile|token_get_all|token_name|touch|trigger_error|trim|uasort|ucfirst|ucwords|' + - 'udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|' + - 'udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|' + - 'udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|' + - 'uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|user_error|usleep|usort|utf8_decode|' + - 'utf8_encode|var_dump|var_export|variant|version_compare|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|' + - 'vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|' + - 'vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|' + - 'vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|' + - 'w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|' + - 'wddx_serialize_vars|wordwrap|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|' + - 'xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xml_error_string|' + - 'xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|' + - 'xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|' + - 'xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|' + - 'xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|' + - 'xml_set_unparsed_entity_decl_handler|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|' + - 'xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|' + - 'xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xpath_eval|' + - 'xpath_eval_expression|xpath_new_context|xptr_eval|xptr_new_context|xsl_xsltprocessor_get_parameter|xsl_xsltprocessor_has_exslt_support|' + - 'xsl_xsltprocessor_import_stylesheet|xsl_xsltprocessor_register_php_functions|xsl_xsltprocessor_remove_parameter|' + - 'xsl_xsltprocessor_set_parameter|xsl_xsltprocessor_transform_to_doc|xsl_xsltprocessor_transform_to_uri|xsl_xsltprocessor_transform_to_xml|' + - 'xslt_create|xslt_errno|xslt_error|xslt_free|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|' + - 'xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|' + - 'yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|' + - 'yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|' + - 'yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_version|zip_close|' + - 'zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|' + - 'zip_open|zip_read|zlib_get_coding_type').split('|') - ); - - var keywords = lang.arrayToMap( - ('abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|' + - 'else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|' + - 'include|include_once|global|goto|if|implements|interface|instanceof|namespace|new|old_function|or|' + - 'private|protected|public|return|require|require_once|static|switch|throw|try|use|var|while|xor').split('|') - ); - - var builtinConstants = lang.arrayToMap( - ('true|false|null|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__CLASS__').split('|') - ); - - var builtinVariables = lang.arrayToMap( - ('$_GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|' + - '$http_response_header|$argc|$argv').split('|') - ); - - var futureReserved = lang.arrayToMap([]); - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ - { - token : "support", // php open tag - regex : "<\\?(?:php|\\=)" - }, - { - token : "support", // php close tag - regex : "\\?>" - }, - { - token : "comment", - regex : "\\/\\/.*$" - }, - docComment.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language", // constants - regex : "\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|" + - "ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|" + - "HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|" + - "L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|" + - "VERSION))|__COMPILER_HALT_OFFSET__)\\b" - }, { - token : "constant.language", // constants - regex : "\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|" + - "SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|" + - "O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|" + - "R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|" + - "YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|" + - "ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|" + - "T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|" + - "HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|" + - "I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|" + - "O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|" + - "L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|" + - "M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|" + - "OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" + - "P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" + - "RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|" + - "T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b" - }, { - token : function(value) { - if (keywords[value]) - return "keyword"; - else if (builtinConstants[value]) - return "constant.language"; - else if (builtinVariables[value]) - return "variable.language"; - else if (futureReserved[value]) - return "invalid.illegal"; - else if (builtinFunctions[value]) - return "support.function"; - else if (value == "debugger") - return "invalid.deprecated"; - else - if(value.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/)) - return "variable"; - return "identifier"; - }, - // TODO: Unicode escape sequences - // TODO: Unicode identifiers - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "lparen", - regex : "[[({]" - }, { - token : "rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - token : "string", - regex : '.+' - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - token : "string", - regex : '.+' - } - ] - }; - - this.addRules(docComment.getRules(), "doc-"); - this.$rules["doc-start"][0].next = "start"; -}; - -oop.inherits(PhpHighlightRules, TextHighlightRules); - -exports.PhpHighlightRules = PhpHighlightRules; -}); -/* ***** BEGIN LICENSE BLOCK ***** -* Version: MPL 1.1/GPL 2.0/LGPL 2.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is Ajax.org Code Editor (ACE). -* -* The Initial Developer of the Original Code is -* Ajax.org Services B.V. -* Portions created by the Initial Developer are Copyright (C) 2010 -* the Initial Developer. All Rights Reserved. -* -* Contributor(s): -* Fabian Jakobs -* -* Alternatively, the contents of this file may be used under the terms of -* either the GNU General Public License Version 2 or later (the "GPL"), or -* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -* in which case the provisions of the GPL or the LGPL are applicable instead -* of those above. If you wish to allow use of your version of this file only -* under the terms of either the GPL or the LGPL, and not to allow others to -* use your version of this file under the terms of the MPL, indicate your -* decision by deleting the provisions above and replace them with the notice -* and other provisions required by the GPL or the LGPL. If you do not delete -* the provisions above, a recipient may use your version of this file under -* the terms of any one of the MPL, the GPL or the LGPL. -* -* ***** END LICENSE BLOCK ***** */ - -define('ace/mode/python', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextMode = require("ace/mode/text").Mode; -var Tokenizer = require("ace/tokenizer").Tokenizer; -var PythonHighlightRules = require("ace/mode/python_highlight_rules").PythonHighlightRules; -var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; -var Range = require("ace/range").Range; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new PythonHighlightRules().getRules()); - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - var outdent = true; - var outentedRows = []; - var re = /^(\s*)#/; - - for (var i=startRow; i<= endRow; i++) { - if (!re.test(doc.getLine(i))) { - outdent = false; - break; - } - } - - if (outdent) { - var deleteRange = new Range(0, 0, 0, 0); - for (var i=startRow; i<= endRow; i++) - { - var line = doc.getLine(i).replace(re, "$1"); - deleteRange.start.row = i; - deleteRange.end.row = i; - deleteRange.end.column = line.length + 2; - doc.replace(deleteRange, line); - } - return -2; - } - else { - return doc.indentRows(startRow, endRow, "#"); - } - }; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.$tokenizer.getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - return this.$outdent.autoOutdent(doc, row); - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** - * - * TODO: python delimiters - */ - -define('ace/mode/python_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var lang = require("pilot/lang"); -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -PythonHighlightRules = function() { - - var keywords = lang.arrayToMap( - ("and|as|assert|break|class|continue|def|del|elif|else|except|exec|" + - "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" + - "raise|return|try|while|with|yield").split("|") - ); - - var builtinConstants = lang.arrayToMap( - ("True|False|None|NotImplemented|Ellipsis|__debug__").split("|") - ); - - var builtinFunctions = lang.arrayToMap( - ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + - "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" + - "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" + - "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" + - "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" + - "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" + - "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" + - "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern").split("|") - ); - - var futureReserved = lang.arrayToMap( - ("").split("|") - ); - - var strPre = "(?:(?:[rubRUB])|(?:[ubUB][rR]))?"; - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[oO]?[0-7]+)"; - var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; - var binInteger = "(?:0[bB][01]+)"; - var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; - - var exponent = "(?:[eE][+-]?\\d+)"; - var fraction = "(?:\\.\\d+)"; - var intPart = "(?:\\d+)"; - var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; - var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; - var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; - - this.$rules = { - "start" : [ { - token : "comment", - regex : "#.*$" - }, { - token : "string", // """ string - regex : strPre + '"{3}(?:(?:.)|(?:^"{3}))*?"{3}' - }, { - token : "string", // multi line """ string start - regex : strPre + '"{3}.*$', - next : "qqstring" - }, { - token : "string", // " string - regex : strPre + '"(?:(?:\\\\.)|(?:[^"\\\\]))*?"' - }, { - token : "string", // ''' string - regex : strPre + "'{3}(?:(?:.)|(?:^'{3}))*?'{3}" - }, { - token : "string", // multi line ''' string start - regex : strPre + "'{3}.*$", - next : "qstring" - }, { - token : "string", // ' string - regex : strPre + "'(?:(?:\\\\.)|(?:[^'\\\\]))*?'" - }, { - token : "constant.numeric", // imaginary - regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" - }, { - token : "constant.numeric", // float - regex : floatNumber - }, { - token : "constant.numeric", // long integer - regex : integer + "[lL]\\b" - }, { - token : "constant.numeric", // integer - regex : integer + "\\b" - }, { - token : function(value) { - if (keywords[value]) - return "keyword"; - else if (builtinConstants[value]) - return "constant.language"; - else if (futureReserved[value]) - return "invalid.illegal"; - else if (builtinFunctions[value]) - return "support.function"; - else if (value == "debugger") - return "invalid.deprecated"; - else - return "identifier"; - }, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "lparen", - regex : "[\\[\\(\\{]" - }, { - token : "rparen", - regex : "[\\]\\)\\}]" - }, { - token : "text", - regex : "\\s+" - } ], - "qqstring" : [ { - token : "string", // multi line """ string end - regex : '(?:^"{3})*?"{3}', - next : "start" - }, { - token : "string", - regex : '.+' - } ], - "qstring" : [ { - token : "string", // multi line ''' string end - regex : "(?:^'{3})*?'{3}", - next : "start" - }, { - token : "string", - regex : '.+' - } ] - }; -}; - -oop.inherits(PythonHighlightRules, TextHighlightRules); - -exports.PythonHighlightRules = PythonHighlightRules; -});/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/text', function(require, exports, module) { - -var Tokenizer = require("ace/tokenizer").Tokenizer; -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); -}; - -(function() { - - this.getTokenizer = function() { - return this.$tokenizer; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow) { - return 0; - }; - - this.getNextLineIndent = function(state, line, tab) { - return ""; - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.autoOutdent = function(state, doc, row) { - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/text_highlight_rules', function(require, exports, module) { - -var TextHighlightRules = function() { - - // regexp must not have capturing parentheses - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ { - token : "text", - regex : ".+" - } ] - }; -}; - -(function() { - - this.addRules = function(rules, prefix) { - for (var key in rules) { - var state = rules[key]; - for (var i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/xml', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextMode = require("ace/mode/text").Mode; -var Tokenizer = require("ace/tokenizer").Tokenizer; -var XmlHighlightRules = require("ace/mode/xml_highlight_rules").XmlHighlightRules; - -var Mode = function() { - this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules()); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/xml_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); -var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; - -var XmlHighlightRules = function() { - - // regexp must not have capturing parentheses - // regexps are ordered -> the first match is used - - this.$rules = { - start : [ { - token : "text", - regex : "<\\!\\[CDATA\\[", - next : "cdata" - }, { - token : "xml_pe", - regex : "<\\?.*?\\?>" - }, { - token : "comment", - regex : "<\\!--", - next : "comment" - }, { - token : "text", // opening tag - regex : "<\\/?", - next : "tag" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "[^<]+" - } ], - - tag : [ { - token : "text", - regex : ">", - next : "start" - }, { - token : "keyword", - regex : "[-_a-zA-Z0-9:]+" - }, { - token : "text", - regex : "\\s+" - }, { - token : "string", - regex : '".*?"' - }, { - token : "string", - regex : "'.*?'" - } ], - - cdata : [ { - token : "text", - regex : "\\]\\]>", - next : "start" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "(?:[^\\]]|\\](?!\\]>))+" - } ], - - comment : [ { - token : "comment", - regex : ".*?-->", - next : "start" - }, { - token : "comment", - regex : ".+" - } ] - }; -}; - -/fd/g - -oop.inherits(XmlHighlightRules, TextHighlightRules); - -exports.XmlHighlightRules = XmlHighlightRules; }); /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -14403,2074 +10045,6 @@ exports.TextInput = TextInput; * * ***** END LICENSE BLOCK ***** */ -define('ace/theme/clouds', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-clouds .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-clouds .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-clouds .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-clouds .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-clouds .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-clouds .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-clouds .ace_scroller {\ - background-color: #FFFFFF;\ -}\ -\ -.ace-clouds .ace_text-layer {\ - cursor: text;\ - color: #000000;\ -}\ -\ -.ace-clouds .ace_cursor {\ - border-left: 2px solid #000000;\ -}\ -\ -.ace-clouds .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #000000;\ -}\ - \ -.ace-clouds .ace_marker-layer .ace_selection {\ - background: #BDD5FC;\ -}\ -\ -.ace-clouds .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-clouds .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid #BFBFBF;\ -}\ -\ -.ace-clouds .ace_marker-layer .ace_active_line {\ - background: #FFFBD1;\ -}\ -\ - \ -.ace-clouds .ace_invisible {\ - color: #BFBFBF;\ -}\ -\ -.ace-clouds .ace_keyword {\ - color:#AF956F;\ -}\ -\ -.ace-clouds .ace_keyword.ace_operator {\ - color:#484848;\ -}\ -\ -.ace-clouds .ace_constant {\ - \ -}\ -\ -.ace-clouds .ace_constant.ace_language {\ - color:#39946A;\ -}\ -\ -.ace-clouds .ace_constant.ace_library {\ - \ -}\ -\ -.ace-clouds .ace_constant.ace_numeric {\ - color:#46A609;\ -}\ -\ -.ace-clouds .ace_invalid {\ - background-color:#FF002A;\ -}\ -\ -.ace-clouds .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-clouds .ace_invalid.ace_deprecated {\ - \ -}\ -\ -.ace-clouds .ace_support {\ - \ -}\ -\ -.ace-clouds .ace_support.ace_function {\ - color:#C52727;\ -}\ -\ -.ace-clouds .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-clouds .ace_string {\ - color:#5D90CD;\ -}\ -\ -.ace-clouds .ace_string.ace_regexp {\ - \ -}\ -\ -.ace-clouds .ace_comment {\ - color:#BCC8BA;\ -}\ -\ -.ace-clouds .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-clouds .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-clouds .ace_variable {\ - \ -}\ -\ -.ace-clouds .ace_variable.ace_language {\ - \ -}\ -\ -.ace-clouds .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-clouds"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/clouds_mignight', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-clouds-midnight .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-clouds-midnight .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-clouds-midnight .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-clouds-midnight .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-clouds-midnight .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-clouds-midnight .ace_scroller {\ - background-color: #191919;\ -}\ -\ -.ace-clouds-midnight .ace_text-layer {\ - cursor: text;\ - color: #929292;\ -}\ -\ -.ace-clouds-midnight .ace_cursor {\ - border-left: 2px solid #7DA5DC;\ -}\ -\ -.ace-clouds-midnight .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #7DA5DC;\ -}\ - \ -.ace-clouds-midnight .ace_marker-layer .ace_selection {\ - background: #000000;\ -}\ -\ -.ace-clouds-midnight .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-clouds-midnight .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid #BFBFBF;\ -}\ -\ -.ace-clouds-midnight .ace_marker-layer .ace_active_line {\ - background: rgba(215, 215, 215, 0.031);\ -}\ -\ - \ -.ace-clouds-midnight .ace_invisible {\ - color: #BFBFBF;\ -}\ -\ -.ace-clouds-midnight .ace_keyword {\ - color:#927C5D;\ -}\ -\ -.ace-clouds-midnight .ace_keyword.ace_operator {\ - color:#4B4B4B;\ -}\ -\ -.ace-clouds-midnight .ace_constant {\ - \ -}\ -\ -.ace-clouds-midnight .ace_constant.ace_language {\ - color:#39946A;\ -}\ -\ -.ace-clouds-midnight .ace_constant.ace_library {\ - \ -}\ -\ -.ace-clouds-midnight .ace_constant.ace_numeric {\ - color:#46A609;\ -}\ -\ -.ace-clouds-midnight .ace_invalid {\ - color:#FFFFFF;\ -background-color:#E92E2E;\ -}\ -\ -.ace-clouds-midnight .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-clouds-midnight .ace_invalid.ace_deprecated {\ - \ -}\ -\ -.ace-clouds-midnight .ace_support {\ - \ -}\ -\ -.ace-clouds-midnight .ace_support.ace_function {\ - color:#E92E2E;\ -}\ -\ -.ace-clouds-midnight .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-clouds-midnight .ace_string {\ - color:#5D90CD;\ -}\ -\ -.ace-clouds-midnight .ace_string.ace_regexp {\ - \ -}\ -\ -.ace-clouds-midnight .ace_comment {\ - color:#3C403B;\ -}\ -\ -.ace-clouds-midnight .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-clouds-midnight .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-clouds-midnight .ace_variable {\ - \ -}\ -\ -.ace-clouds-midnight .ace_variable.ace_language {\ - \ -}\ -\ -.ace-clouds-midnight .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-clouds-midnight"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/cobalt', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-cobalt .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-cobalt .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-cobalt .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-cobalt .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-cobalt .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-cobalt .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-cobalt .ace_scroller {\ - background-color: #002240;\ -}\ -\ -.ace-cobalt .ace_text-layer {\ - cursor: text;\ - color: #FFFFFF;\ -}\ -\ -.ace-cobalt .ace_cursor {\ - border-left: 2px solid #FFFFFF;\ -}\ -\ -.ace-cobalt .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #FFFFFF;\ -}\ - \ -.ace-cobalt .ace_marker-layer .ace_selection {\ - background: rgba(179, 101, 57, 0.75);\ -}\ -\ -.ace-cobalt .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-cobalt .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgba(255, 255, 255, 0.15);\ -}\ -\ -.ace-cobalt .ace_marker-layer .ace_active_line {\ - background: rgba(0, 0, 0, 0.35);\ -}\ -\ - \ -.ace-cobalt .ace_invisible {\ - color: rgba(255, 255, 255, 0.15);\ -}\ -\ -.ace-cobalt .ace_keyword {\ - color:#FF9D00;\ -}\ -\ -.ace-cobalt .ace_keyword.ace_operator {\ - \ -}\ -\ -.ace-cobalt .ace_constant {\ - color:#FF628C;\ -}\ -\ -.ace-cobalt .ace_constant.ace_language {\ - \ -}\ -\ -.ace-cobalt .ace_constant.ace_library {\ - \ -}\ -\ -.ace-cobalt .ace_constant.ace_numeric {\ - \ -}\ -\ -.ace-cobalt .ace_invalid {\ - color:#F8F8F8;\ -background-color:#800F00;\ -}\ -\ -.ace-cobalt .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-cobalt .ace_invalid.ace_deprecated {\ - \ -}\ -\ -.ace-cobalt .ace_support {\ - color:#80FFBB;\ -}\ -\ -.ace-cobalt .ace_support.ace_function {\ - color:#FFB054;\ -}\ -\ -.ace-cobalt .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-cobalt .ace_string {\ - \ -}\ -\ -.ace-cobalt .ace_string.ace_regexp {\ - color:#80FFC2;\ -}\ -\ -.ace-cobalt .ace_comment {\ - font-style:italic;\ -color:#0088FF;\ -}\ -\ -.ace-cobalt .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-cobalt .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-cobalt .ace_variable {\ - color:#CCCCCC;\ -}\ -\ -.ace-cobalt .ace_variable.ace_language {\ - color:#FF80E1;\ -}\ -\ -.ace-cobalt .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-cobalt"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/dawn', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-dawn .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-dawn .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-dawn .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-dawn .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-dawn .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-dawn .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-dawn .ace_scroller {\ - background-color: #F9F9F9;\ -}\ -\ -.ace-dawn .ace_text-layer {\ - cursor: text;\ - color: #080808;\ -}\ -\ -.ace-dawn .ace_cursor {\ - border-left: 2px solid #000000;\ -}\ -\ -.ace-dawn .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #000000;\ -}\ - \ -.ace-dawn .ace_marker-layer .ace_selection {\ - background: rgba(39, 95, 255, 0.30);\ -}\ -\ -.ace-dawn .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-dawn .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgba(75, 75, 126, 0.50);\ -}\ -\ -.ace-dawn .ace_marker-layer .ace_active_line {\ - background: rgba(36, 99, 180, 0.12);\ -}\ -\ - \ -.ace-dawn .ace_invisible {\ - color: rgba(75, 75, 126, 0.50);\ -}\ -\ -.ace-dawn .ace_keyword {\ - color:#794938;\ -}\ -\ -.ace-dawn .ace_keyword.ace_operator {\ - \ -}\ -\ -.ace-dawn .ace_constant {\ - color:#811F24;\ -}\ -\ -.ace-dawn .ace_constant.ace_language {\ - \ -}\ -\ -.ace-dawn .ace_constant.ace_library {\ - \ -}\ -\ -.ace-dawn .ace_constant.ace_numeric {\ - \ -}\ -\ -.ace-dawn .ace_invalid {\ - \ -}\ -\ -.ace-dawn .ace_invalid.ace_illegal {\ - text-decoration:underline;\ -font-style:italic;\ -color:#F8F8F8;\ -background-color:#B52A1D;\ -}\ -\ -.ace-dawn .ace_invalid.ace_deprecated {\ - text-decoration:underline;\ -font-style:italic;\ -color:#B52A1D;\ -}\ -\ -.ace-dawn .ace_support {\ - color:#691C97;\ -}\ -\ -.ace-dawn .ace_support.ace_function {\ - color:#693A17;\ -}\ -\ -.ace-dawn .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-dawn .ace_string {\ - color:#0B6125;\ -}\ -\ -.ace-dawn .ace_string.ace_regexp {\ - color:#CF5628;\ -}\ -\ -.ace-dawn .ace_comment {\ - font-style:italic;\ -color:#5A525F;\ -}\ -\ -.ace-dawn .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-dawn .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-dawn .ace_variable {\ - color:#234A97;\ -}\ -\ -.ace-dawn .ace_variable.ace_language {\ - \ -}\ -\ -.ace-dawn .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-dawn"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/eclipse', function(require, exports, module) { - - var dom = require("pilot/dom"); - var cssText = require("text!ace/theme/eclipse.css"); - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-eclipse"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/idle_fingers', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-idle-fingers .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-idle-fingers .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-idle-fingers .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-idle-fingers .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-idle-fingers .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-idle-fingers .ace_scroller {\ - background-color: #323232;\ -}\ -\ -.ace-idle-fingers .ace_text-layer {\ - cursor: text;\ - color: #FFFFFF;\ -}\ -\ -.ace-idle-fingers .ace_cursor {\ - border-left: 2px solid #91FF00;\ -}\ -\ -.ace-idle-fingers .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #91FF00;\ -}\ - \ -.ace-idle-fingers .ace_marker-layer .ace_selection {\ - background: rgba(90, 100, 126, 0.88);\ -}\ -\ -.ace-idle-fingers .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-idle-fingers .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid #404040;\ -}\ -\ -.ace-idle-fingers .ace_marker-layer .ace_active_line {\ - background: #353637;\ -}\ -\ - \ -.ace-idle-fingers .ace_invisible {\ - color: #404040;\ -}\ -\ -.ace-idle-fingers .ace_keyword {\ - color:#CC7833;\ -}\ -\ -.ace-idle-fingers .ace_keyword.ace_operator {\ - \ -}\ -\ -.ace-idle-fingers .ace_constant {\ - color:#6C99BB;\ -}\ -\ -.ace-idle-fingers .ace_constant.ace_language {\ - \ -}\ -\ -.ace-idle-fingers .ace_constant.ace_library {\ - \ -}\ -\ -.ace-idle-fingers .ace_constant.ace_numeric {\ - \ -}\ -\ -.ace-idle-fingers .ace_invalid {\ - color:#FFFFFF;\ -background-color:#FF0000;\ -}\ -\ -.ace-idle-fingers .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-idle-fingers .ace_invalid.ace_deprecated {\ - \ -}\ -\ -.ace-idle-fingers .ace_support {\ - color:#bc9458;\ -}\ -\ -.ace-idle-fingers .ace_support.ace_function {\ - color:#B83426;\ -}\ -\ -.ace-idle-fingers .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-idle-fingers .ace_string {\ - color:#A5C261;\ -}\ -\ -.ace-idle-fingers .ace_string.ace_regexp {\ - color:#CCCC33;\ -}\ -\ -.ace-idle-fingers .ace_comment {\ - font-style:italic;\ - color:#BC9458;\ -}\ -\ -.ace-idle-fingers .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-idle-fingers .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-idle-fingers .ace_variable {\ - color:#b7dff8;\ -}\ -\ -.ace-idle-fingers .ace_variable.ace_language {\ - color:#b7dff8;\ -}\ -\ -.ace-idle-fingers .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-idle-fingers"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/kr_theme', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-kr-theme .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-kr-theme .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-kr-theme .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-kr-theme .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-kr-theme .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-kr-theme .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-kr-theme .ace_scroller {\ - background-color: #0B0A09;\ -}\ -\ -.ace-kr-theme .ace_text-layer {\ - cursor: text;\ - color: #FCFFE0;\ -}\ -\ -.ace-kr-theme .ace_cursor {\ - border-left: 2px solid #FF9900;\ -}\ -\ -.ace-kr-theme .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #FF9900;\ -}\ - \ -.ace-kr-theme .ace_marker-layer .ace_selection {\ - background: rgba(170, 0, 255, 0.45);\ -}\ -\ -.ace-kr-theme .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-kr-theme .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgba(255, 177, 111, 0.32);\ -}\ -\ -.ace-kr-theme .ace_marker-layer .ace_active_line {\ - background: #38403D;\ -}\ -\ - \ -.ace-kr-theme .ace_invisible {\ - color: rgba(255, 177, 111, 0.32);\ -}\ -\ -.ace-kr-theme .ace_keyword {\ - color:#949C8B;\ -}\ -\ -.ace-kr-theme .ace_keyword.ace_operator {\ - \ -}\ -\ -.ace-kr-theme .ace_constant {\ - color:rgba(210, 117, 24, 0.76);\ -}\ -\ -.ace-kr-theme .ace_constant.ace_language {\ - \ -}\ -\ -.ace-kr-theme .ace_constant.ace_library {\ - \ -}\ -\ -.ace-kr-theme .ace_constant.ace_numeric {\ - \ -}\ -\ -.ace-kr-theme .ace_invalid {\ - color:#F8F8F8;\ -background-color:#A41300;\ -}\ -\ -.ace-kr-theme .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-kr-theme .ace_invalid.ace_deprecated {\ - \ -}\ -\ -.ace-kr-theme .ace_support {\ - color:#9FC28A;\ -}\ -\ -.ace-kr-theme .ace_support.ace_function {\ - color:#85873A;\ -}\ -\ -.ace-kr-theme .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-kr-theme .ace_string {\ - \ -}\ -\ -.ace-kr-theme .ace_string.ace_regexp {\ - color:rgba(125, 255, 192, 0.65);\ -}\ -\ -.ace-kr-theme .ace_comment {\ - font-style:italic;\ -color:#706D5B;\ -}\ -\ -.ace-kr-theme .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-kr-theme .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-kr-theme .ace_variable {\ - color:#D1A796;\ -}\ -\ -.ace-kr-theme .ace_variable.ace_language {\ - color:#FF80E1;\ -}\ -\ -.ace-kr-theme .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-kr-theme"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/mono_industrial', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-mono-industrial .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-mono-industrial .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-mono-industrial .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-mono-industrial .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-mono-industrial .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-mono-industrial .ace_scroller {\ - background-color: #222C28;\ -}\ -\ -.ace-mono-industrial .ace_text-layer {\ - cursor: text;\ - color: #FFFFFF;\ -}\ -\ -.ace-mono-industrial .ace_cursor {\ - border-left: 2px solid #FFFFFF;\ -}\ -\ -.ace-mono-industrial .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #FFFFFF;\ -}\ - \ -.ace-mono-industrial .ace_marker-layer .ace_selection {\ - background: rgba(145, 153, 148, 0.40);\ -}\ -\ -.ace-mono-industrial .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-mono-industrial .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgba(102, 108, 104, 0.50);\ -}\ -\ -.ace-mono-industrial .ace_marker-layer .ace_active_line {\ - background: rgba(12, 13, 12, 0.25);\ -}\ -\ - \ -.ace-mono-industrial .ace_invisible {\ - color: rgba(102, 108, 104, 0.50);\ -}\ -\ -.ace-mono-industrial .ace_keyword {\ - color:#A39E64;\ -}\ -\ -.ace-mono-industrial .ace_keyword.ace_operator {\ - color:#A8B3AB;\ -}\ -\ -.ace-mono-industrial .ace_constant {\ - color:#E98800;\ -}\ -\ -.ace-mono-industrial .ace_constant.ace_language {\ - \ -}\ -\ -.ace-mono-industrial .ace_constant.ace_library {\ - \ -}\ -\ -.ace-mono-industrial .ace_constant.ace_numeric {\ - color:#E98800;\ -}\ -\ -.ace-mono-industrial .ace_invalid {\ - color:#FFFFFF;\ -background-color:rgba(153, 0, 0, 0.68);\ -}\ -\ -.ace-mono-industrial .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-mono-industrial .ace_invalid.ace_deprecated {\ - \ -}\ -\ -.ace-mono-industrial .ace_support {\ - \ -}\ -\ -.ace-mono-industrial .ace_support.ace_function {\ - color:#588E60;\ -}\ -\ -.ace-mono-industrial .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-mono-industrial .ace_string {\ - \ -}\ -\ -.ace-mono-industrial .ace_string.ace_regexp {\ - \ -}\ -\ -.ace-mono-industrial .ace_comment {\ - color:#666C68;\ -background-color:#151C19;\ -}\ -\ -.ace-mono-industrial .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-mono-industrial .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-mono-industrial .ace_variable {\ - \ -}\ -\ -.ace-mono-industrial .ace_variable.ace_language {\ - color:#648BD2;\ -}\ -\ -.ace-mono-industrial .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-mono-industrial"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/monokai', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-monokai .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-monokai .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-monokai .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-monokai .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-monokai .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-monokai .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-monokai .ace_scroller {\ - background-color: #272822;\ -}\ -\ -.ace-monokai .ace_text-layer {\ - cursor: text;\ - color: #F8F8F2;\ -}\ -\ -.ace-monokai .ace_cursor {\ - border-left: 2px solid #F8F8F0;\ -}\ -\ -.ace-monokai .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #F8F8F0;\ -}\ - \ -.ace-monokai .ace_marker-layer .ace_selection {\ - background: #49483E;\ -}\ -\ -.ace-monokai .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-monokai .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid #49483E;\ -}\ -\ -.ace-monokai .ace_marker-layer .ace_active_line {\ - background: #49483E;\ -}\ -\ - \ -.ace-monokai .ace_invisible {\ - color: #49483E;\ -}\ -\ -.ace-monokai .ace_keyword {\ - color:#F92672;\ -}\ -\ -.ace-monokai .ace_keyword.ace_operator {\ - \ -}\ -\ -.ace-monokai .ace_constant {\ - \ -}\ -\ -.ace-monokai .ace_constant.ace_language {\ - color:#AE81FF;\ -}\ -\ -.ace-monokai .ace_constant.ace_library {\ - \ -}\ -\ -.ace-monokai .ace_constant.ace_numeric {\ - color:#AE81FF;\ -}\ -\ -.ace-monokai .ace_invalid {\ - color:#F8F8F0;\ -background-color:#F92672;\ -}\ -\ -.ace-monokai .ace_invalid.ace_illegal {\ - \ -}\ -\ -.ace-monokai .ace_invalid.ace_deprecated {\ - color:#F8F8F0;\ -background-color:#AE81FF;\ -}\ -\ -.ace-monokai .ace_support {\ - \ -}\ -\ -.ace-monokai .ace_support.ace_function {\ - color:#66D9EF;\ -}\ -\ -.ace-monokai .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-monokai .ace_string {\ - color:#E6DB74;\ -}\ -\ -.ace-monokai .ace_string.ace_regexp {\ - \ -}\ -\ -.ace-monokai .ace_comment {\ - color:#75715E;\ -}\ -\ -.ace-monokai .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-monokai .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-monokai .ace_variable {\ - \ -}\ -\ -.ace-monokai .ace_variable.ace_language {\ - \ -}\ -\ -.ace-monokai .ace_xml_pe {\ - \ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-monokai"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * André Fiedler - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/pastel_on_dark', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-pastel-on-dark .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-pastel-on-dark .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-pastel-on-dark .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-pastel-on-dark .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-pastel-on-dark .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-pastel-on-dark .ace_scroller {\ - background-color: #2c2828;\ -}\ -\ -.ace-pastel-on-dark .ace_text-layer {\ - cursor: text;\ - color: #8f938f;\ -}\ -\ -.ace-pastel-on-dark .ace_cursor {\ - border-left: 2px solid #A7A7A7;\ -}\ -\ -.ace-pastel-on-dark .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #A7A7A7;\ -}\ - \ -.ace-pastel-on-dark .ace_marker-layer .ace_selection {\ - background: rgba(221, 240, 255, 0.20);\ -}\ -\ -.ace-pastel-on-dark .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgba(255, 255, 255, 0.25);\ -}\ -\ -.ace-pastel-on-dark .ace_marker-layer .ace_active_line {\ - background: rgba(255, 255, 255, 0.031);\ -}\ -\ - \ -.ace-pastel-on-dark .ace_invisible {\ - color: rgba(255, 255, 255, 0.25);\ -}\ -\ -.ace-pastel-on-dark .ace_keyword {\ - color:#757ad8;\ -}\ -\ -.ace-pastel-on-dark .ace_keyword.ace_operator {\ - color:#797878;\ -}\ -\ -.ace-pastel-on-dark .ace_constant {\ - color:#4fb7c5;\ -}\ -\ -.ace-pastel-on-dark .ace_constant.ace_language {\ - \ -}\ -\ -.ace-pastel-on-dark .ace_constant.ace_library {\ - \ -}\ -\ -.ace-pastel-on-dark .ace_constant.ace_numeric {\ - \ -}\ -\ -.ace-pastel-on-dark .ace_invalid {\ - \ -}\ -\ -.ace-pastel-on-dark .ace_invalid.ace_illegal {\ - color:#F8F8F8;\ -background-color:rgba(86, 45, 86, 0.75);\ -}\ -\ -.ace-pastel-on-dark .ace_invalid.ace_deprecated {\ - text-decoration:underline;\ -font-style:italic;\ -color:#D2A8A1;\ -}\ -\ -.ace-pastel-on-dark .ace_support {\ - color:#9a9a9a;\ -}\ -\ -.ace-pastel-on-dark .ace_support.ace_function {\ - color:#aeb2f8;\ -}\ -\ -.ace-pastel-on-dark .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-pastel-on-dark .ace_string {\ - color:#66a968;\ -}\ -\ -.ace-pastel-on-dark .ace_string.ace_regexp {\ - color:#E9C062;\ -}\ -\ -.ace-pastel-on-dark .ace_comment {\ - color:#656865;\ -}\ -\ -.ace-pastel-on-dark .ace_comment.ace_doc {\ - color:A6C6FF;\ -}\ -\ -.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag {\ - color:A6C6FF;\ -}\ -\ -.ace-pastel-on-dark .ace_variable {\ - color:#bebf55;\ -}\ -\ -.ace-pastel-on-dark .ace_variable.ace_language {\ - color:#bebf55;\ -}\ -\ -.ace-pastel-on-dark .ace_xml_pe {\ - color:#494949;\ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-pastel-on-dark"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/textmate', function(require, exports, module) { - - var dom = require("pilot/dom"); - var cssText = require("text!ace/theme/tm.css"); - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-tm"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/theme/twilight', function(require, exports, module) { - - var dom = require("pilot/dom"); - - var cssText = ".ace-twilight .ace_editor {\ - border: 2px solid rgb(159, 159, 159);\ -}\ -\ -.ace-twilight .ace_editor.ace_focus {\ - border: 2px solid #327fbd;\ -}\ -\ -.ace-twilight .ace_gutter {\ - width: 50px;\ - background: #e8e8e8;\ - color: #333;\ - overflow : hidden;\ -}\ -\ -.ace-twilight .ace_gutter-layer {\ - width: 100%;\ - text-align: right;\ -}\ -\ -.ace-twilight .ace_gutter-layer .ace_gutter-cell {\ - padding-right: 6px;\ -}\ -\ -.ace-twilight .ace_editor .ace_printMargin {\ - width: 1px;\ - background: #e8e8e8;\ -}\ -\ -.ace-twilight .ace_scroller {\ - background-color: #141414;\ -}\ -\ -.ace-twilight .ace_text-layer {\ - cursor: text;\ - color: #F8F8F8;\ -}\ -\ -.ace-twilight .ace_cursor {\ - border-left: 2px solid #A7A7A7;\ -}\ -\ -.ace-twilight .ace_cursor.ace_overwrite {\ - border-left: 0px;\ - border-bottom: 1px solid #A7A7A7;\ -}\ - \ -.ace-twilight .ace_marker-layer .ace_selection {\ - background: rgba(221, 240, 255, 0.20);\ -}\ -\ -.ace-twilight .ace_marker-layer .ace_step {\ - background: rgb(198, 219, 174);\ -}\ -\ -.ace-twilight .ace_marker-layer .ace_bracket {\ - margin: -1px 0 0 -1px;\ - border: 1px solid rgba(255, 255, 255, 0.25);\ -}\ -\ -.ace-twilight .ace_marker-layer .ace_active_line {\ - background: rgba(255, 255, 255, 0.031);\ -}\ -\ - \ -.ace-twilight .ace_invisible {\ - color: rgba(255, 255, 255, 0.25);\ -}\ -\ -.ace-twilight .ace_keyword {\ - color:#CDA869;\ -}\ -\ -.ace-twilight .ace_keyword.ace_operator {\ - \ -}\ -\ -.ace-twilight .ace_constant {\ - color:#CF6A4C;\ -}\ -\ -.ace-twilight .ace_constant.ace_language {\ - \ -}\ -\ -.ace-twilight .ace_constant.ace_library {\ - \ -}\ -\ -.ace-twilight .ace_constant.ace_numeric {\ - \ -}\ -\ -.ace-twilight .ace_invalid {\ - \ -}\ -\ -.ace-twilight .ace_invalid.ace_illegal {\ - color:#F8F8F8;\ -background-color:rgba(86, 45, 86, 0.75);\ -}\ -\ -.ace-twilight .ace_invalid.ace_deprecated {\ - text-decoration:underline;\ -font-style:italic;\ -color:#D2A8A1;\ -}\ -\ -.ace-twilight .ace_support {\ - color:#9B859D;\ -}\ -\ -.ace-twilight .ace_support.ace_function {\ - color:#DAD085;\ -}\ -\ -.ace-twilight .ace_function.ace_buildin {\ - \ -}\ -\ -.ace-twilight .ace_string {\ - color:#8F9D6A;\ -}\ -\ -.ace-twilight .ace_string.ace_regexp {\ - color:#E9C062;\ -}\ -\ -.ace-twilight .ace_comment {\ - font-style:italic;\ -color:#5F5A60;\ -}\ -\ -.ace-twilight .ace_comment.ace_doc {\ - \ -}\ -\ -.ace-twilight .ace_comment.ace_doc.ace_tag {\ - \ -}\ -\ -.ace-twilight .ace_variable {\ - color:#7587A6;\ -}\ -\ -.ace-twilight .ace_variable.ace_language {\ - \ -}\ -\ -.ace-twilight .ace_xml_pe {\ - color:#494949;\ -}"; - - // import CSS once - dom.importCssString(cssText); - - exports.cssClass = "ace-twilight"; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - define('ace/tokenizer', function(require, exports, module) { var Tokenizer = function(rules) { @@ -17279,6 +10853,987 @@ var VirtualRenderer = function(container, theme) { exports.VirtualRenderer = VirtualRenderer; }); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/theme/textmate', function(require, exports, module) { + + var dom = require("pilot/dom"); + var cssText = require("text!ace/theme/tm.css"); + + // import CSS once + dom.importCssString(cssText); + + exports.cssClass = "ace-tm"; +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/layer/text', function(require, exports, module) { + +var oop = require("pilot/oop"); +var dom = require("pilot/dom"); +var lang = require("pilot/lang"); +var EventEmitter = require("pilot/event_emitter").EventEmitter; + +var Text = function(parentEl) { + this.element = document.createElement("div"); + this.element.className = "ace_layer ace_text-layer"; + parentEl.appendChild(this.element); + + this.$characterSize = this.$measureSizes(); + this.$pollSizeChanges(); +}; + +(function() { + + oop.implement(this, EventEmitter); + + this.EOF_CHAR = "¶"; + this.EOL_CHAR = "¬"; + this.TAB_CHAR = "→"; + this.SPACE_CHAR = "·"; + + this.setTokenizer = function(tokenizer) { + this.tokenizer = tokenizer; + }; + + this.getLineHeight = function() { + return this.$characterSize.height || 1; + }; + + this.getCharacterWidth = function() { + return this.$characterSize.width || 1; + }; + + this.$pollSizeChanges = function() { + var self = this; + setInterval(function() { + var size = self.$measureSizes(); + if (self.$characterSize.width !== size.width || self.$characterSize.height !== size.height) { + self.$characterSize = size; + self._dispatchEvent("changeCharaterSize", {data: size}); + } + }, 500); + }; + + this.$fontStyles = { + fontFamily : 1, + fontSize : 1, + fontWeight : 1, + fontStyle : 1, + lineHeight : 1 + }, + + this.$measureSizes = function() { + var n = 1000; + if (!this.$measureNode) { + var measureNode = this.$measureNode = document.createElement("div"); + var style = measureNode.style; + + style.width = style.height = "auto"; + style.left = style.top = "-1000px"; + + style.visibility = "hidden"; + style.position = "absolute"; + style.overflow = "visible"; + style.whiteSpace = "nowrap"; + + // in FF 3.6 monospace fonts can have a fixed sub pixel width. + // that's why we have to measure many characters + // Note: characterWidth can be a float! + measureNode.innerHTML = lang.stringRepeat("Xy", n); + document.body.insertBefore(measureNode, document.body.firstChild); + } + + var style = this.$measureNode.style; + for (var prop in this.$fontStyles) { + var value = dom.computedStyle(this.element, prop); + style[prop] = value; + } + + var size = { + height: this.$measureNode.offsetHeight, + width: this.$measureNode.offsetWidth / (n * 2) + }; + return size; + }; + + this.setDocument = function(doc) { + this.doc = doc; + }; + + this.$showInvisibles = false; + this.setShowInvisibles = function(showInvisibles) { + this.$showInvisibles = showInvisibles; + }; + + this.$computeTabString = function() { + var tabSize = this.doc.getTabSize(); + if (this.$showInvisibles) { + var halfTab = (tabSize) / 2; + this.$tabString = "" + + new Array(Math.floor(halfTab)).join(" ") + + this.TAB_CHAR + + new Array(Math.ceil(halfTab)+1).join(" ") + + ""; + } else { + this.$tabString = new Array(tabSize+1).join(" "); + } + }; + + this.updateLines = function(layerConfig, firstRow, lastRow) { + this.$computeTabString(); + this.config = layerConfig; + + var first = Math.max(firstRow, layerConfig.firstRow); + var last = Math.min(lastRow, layerConfig.lastRow); + + var lineElements = this.element.childNodes; + var _self = this; + this.tokenizer.getTokens(first, last, function(tokens) { + for ( var i = first; i <= last; i++) { + var lineElement = lineElements[i - layerConfig.firstRow]; + if (!lineElement) + continue; + + var html = []; + _self.$renderLine(html, i, tokens[i-first].tokens); + lineElement.innerHTML = html.join(""); + } + }); + }; + + this.scrollLines = function(config) { + var _self = this; + + this.$computeTabString(); + var oldConfig = this.config; + this.config = config; + + if (!oldConfig || oldConfig.lastRow < config.firstRow) + return this.update(config); + + if (config.lastRow < oldConfig.firstRow) + return this.update(config); + + var el = this.element; + + if (oldConfig.firstRow < config.firstRow) + for (var row=oldConfig.firstRow; row config.lastRow) + for (var row=config.lastRow+1; row<=oldConfig.lastRow; row++) + el.removeChild(el.lastChild); + + appendTop(appendBottom); + + function appendTop(callback) { + if (config.firstRow < oldConfig.firstRow) { + _self.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1, function(fragment) { + if (el.firstChild) + el.insertBefore(fragment, el.firstChild); + else + el.appendChild(fragment); + callback(); + }); + } + else + callback(); + } + + function appendBottom() { + if (config.lastRow > oldConfig.lastRow) { + _self.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow, function(fragment) { + el.appendChild(fragment); + }); + } + } + }; + + this.$renderLinesFragment = function(config, firstRow, lastRow, callback) { + var fragment = document.createDocumentFragment(); + var _self = this; + this.tokenizer.getTokens(firstRow, lastRow, function(tokens) { + for (var row=firstRow; row<=lastRow; row++) { + var lineEl = document.createElement("div"); + lineEl.className = "ace_line"; + var style = lineEl.style; + style.height = _self.$characterSize.height + "px"; + style.width = config.width + "px"; + + var html = []; + _self.$renderLine(html, row, tokens[row-firstRow].tokens); + lineEl.innerHTML = html.join(""); + fragment.appendChild(lineEl); + } + callback(fragment); + }); + }; + + this.update = function(config) { + this.$computeTabString(); + this.config = config; + + var html = []; + var _self = this; + this.tokenizer.getTokens(config.firstRow, config.lastRow, function(tokens) { + for ( var i = config.firstRow; i <= config.lastRow; i++) { + html.push("
    "); + _self.$renderLine(html, i, tokens[i-config.firstRow].tokens), html.push("
    "); + } + + _self.element.innerHTML = html.join(""); + }); + }; + + this.$textToken = { + "text": true, + "rparen": true, + "lparen": true + }; + + this.$renderLine = function(stringBuilder, row, tokens) { +// if (this.$showInvisibles) { +// var self = this; +// var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+/g; +// var spaceReplace = function(space) { +// var space = new Array(space.length+1).join(self.SPACE_CHAR); +// return "" + space + ""; +// }; +// } +// else { + var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g; + var spaceReplace = " "; +// } + + for ( var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + var output = token.value + .replace(/&/g, "&") + .replace(/", output, ""); + } + else { + stringBuilder.push(output); + } + }; + + if (this.$showInvisibles) { + if (row !== this.doc.getLength() - 1) { + stringBuilder.push("" + this.EOL_CHAR + ""); + } else { + stringBuilder.push("" + this.EOF_CHAR + ""); + } + } + }; + +}).call(Text.prototype); + +exports.Text = Text; + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/doc_comment_highlight_rules', function(require, exports, module) { + +var oop = require("pilot/oop"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + + this.$rules = { + "start" : [ { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : "start" + }, { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, { + token : "comment.doc", + regex : "\s+" + }, { + token : "comment.doc", + regex : "TODO" + }, { + token : "comment.doc", + regex : "[^@\\*]+" + }, { + token : "comment.doc", + regex : "." + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +(function() { + + this.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next: start + }; + }; + +}).call(DocCommentHighlightRules.prototype); + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/javascript', function(require, exports, module) { + +var oop = require("pilot/oop"); +var TextMode = require("ace/mode/text").Mode; +var Tokenizer = require("ace/tokenizer").Tokenizer; +var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules; +var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent; +var Range = require("ace/range").Range; + +var Mode = function() { + this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules()); + this.$outdent = new MatchingBraceOutdent(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var outdent = true; + var outentedRows = []; + var re = /^(\s*)\/\//; + + for (var i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; + break; + } + } + + if (outdent) { + var deleteRange = new Range(0, 0, 0, 0); + for (var i=startRow; i<= endRow; i++) + { + var line = doc.getLine(i).replace(re, "$1"); + deleteRange.start.row = i; + deleteRange.end.row = i; + deleteRange.end.column = line.length + 2; + doc.replace(deleteRange, line); + } + return -2; + } + else { + return doc.indentRows(startRow, endRow, "//"); + } + }; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + return this.$outdent.autoOutdent(doc, row); + }; + +}).call(Mode.prototype); + +exports.Mode = Mode; +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/javascript_highlight_rules', function(require, exports, module) { + +var oop = require("pilot/oop"); +var lang = require("pilot/lang"); +var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +JavaScriptHighlightRules = function() { + + var docComment = new DocCommentHighlightRules(); + + var keywords = lang.arrayToMap( + ("break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with").split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("null|Infinity|NaN|undefined").split("|") + ); + + var futureReserved = lang.arrayToMap( + ("class|enum|extends|super|const|export|import|implements|let|private|" + + "public|yield|interface|package|protected|static").split("|") + ); + + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + docComment.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : function(value) { + if (value == "this") + return "variable.language"; + else if (keywords[value]) + return "keyword"; + else if (buildinConstants[value]) + return "constant.language"; + else if (futureReserved[value]) + return "invalid.illegal"; + else if (value == "debugger") + return "invalid.deprecated"; + else + return "identifier"; + }, + // TODO: Unicode escape sequences + // TODO: Unicode identifiers + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ] + }; + + this.addRules(docComment.getRules(), "doc-"); + this.$rules["doc-start"][0].next = "start"; +}; + +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); + +exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/matching_brace_outdent', function(require, exports, module) { + +var Range = require("ace/range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + + return indent.length - (column-1); + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/text', function(require, exports, module) { + +var Tokenizer = require("ace/tokenizer").Tokenizer; +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var Mode = function() { + this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); +}; + +(function() { + + this.getTokenizer = function() { + return this.$tokenizer; + }; + + this.toggleCommentLines = function(state, doc, startRow, endRow) { + return 0; + }; + + this.getNextLineIndent = function(state, line, tab) { + return ""; + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.autoOutdent = function(state, doc, row) { + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(Mode.prototype); + +exports.Mode = Mode; +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/text_highlight_rules', function(require, exports, module) { + +var TextHighlightRules = function() { + + // regexp must not have capturing parentheses + // regexps are ordered -> the first match is used + + this.$rules = { + "start" : [ { + token : "text", + regex : ".+" + } ] + }; +}; + +(function() { + + this.addRules = function(rules, prefix) { + for (var key in rules) { + var state = rules[key]; + for (var i=0; i * { padding-left: 2px; padding-right: 2px; }" + - ".cptRowIn > img { cursor: pointer; }" + - ".cptHover { display: none; }" + - ".cptRowIn:hover > .cptHover { display: block; }" + - ".cptRowIn:hover > .cptHover.cptHidden { display: none; }" + - ".cptOutTyped {" + - " box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;" + - " font-weight: bold; color: #000; font-size: 120%;" + - "}" + - ".cptRowOutput { padding-left: 10px; line-height: 1.2em; }" + - ".cptRowOutput strong," + - ".cptRowOutput b," + - ".cptRowOutput th," + - ".cptRowOutput h1," + - ".cptRowOutput h2," + - ".cptRowOutput h3 { color: #000; }" + - ".cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }" + - ".cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }" + - ".cptRowOutput input[type=password]," + - ".cptRowOutput input[type=text]," + - ".cptRowOutput textarea {" + - " color: #000; font-size: 120%;" + - " background: transparent; padding: 3px;" + - " border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;" + - "}" + - ".cptRowOutput table," + - ".cptRowOutput td," + - ".cptRowOutput th { border: 0; padding: 0 2px; }" + - ".cptRowOutput .right { text-align: right; }" + - ""); - define("text!ace/css/editor.css", ".ace_editor {" + " position: absolute;" + " overflow: hidden;" + @@ -17666,90 +12143,6 @@ define("text!ace/css/editor.css", ".ace_editor {" + " z-index: 1;" + "}"); -define("text!ace/theme/eclipse.css", ".ace-eclipse .ace_editor {" + - " border: 2px solid rgb(159, 159, 159);" + - "}" + - "" + - ".ace-eclipse .ace_editor.ace_focus {" + - " border: 2px solid #327fbd;" + - "}" + - "" + - ".ace-eclipse .ace_gutter {" + - " width: 40px;" + - " background: rgb(227, 227, 227);" + - " border-right: 1px solid rgb(159, 159, 159); " + - " color: rgb(136, 136, 136);" + - "}" + - "" + - ".ace-eclipse .ace_gutter-layer {" + - " right: 10px;" + - " text-align: right;" + - "}" + - "" + - ".ace-eclipse .ace_text-layer {" + - " cursor: text;" + - "}" + - "" + - ".ace-eclipse .ace_cursor {" + - " border-left: 1px solid black;" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {" + - " color: rgb(127, 0, 85);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_constant.ace_buildin {" + - " color: rgb(88, 72, 246);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_constant.ace_library {" + - " color: rgb(6, 150, 14);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_function {" + - " color: rgb(60, 76, 114);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_string {" + - " color: rgb(42, 0, 255);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_comment {" + - " color: rgb(63, 127, 95);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_comment.ace_doc {" + - " color: rgb(63, 95, 191);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {" + - " color: rgb(127, 159, 191);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_constant.ace_numeric {" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_tag {" + - " color: rgb(63, 127, 127);" + - "}" + - "" + - ".ace-eclipse .ace_line .ace_xml_pe {" + - " color: rgb(104, 104, 91);" + - "}" + - "" + - ".ace-eclipse .ace_marker-layer .ace_selection {" + - " background: rgb(181, 213, 255);" + - "}" + - "" + - ".ace-eclipse .ace_marker-layer .ace_bracket {" + - " margin: -1px 0 0 -1px;" + - " border: 1px solid rgb(192, 192, 192);" + - "}" + - "" + - ".ace-eclipse .ace_marker-layer .ace_active_line {" + - " background: rgb(232, 242, 254);" + - "}"); - define("text!ace/theme/tm.css", ".ace-tm .ace_editor {" + " border: 2px solid rgb(159, 159, 159);" + "}" + @@ -17924,31 +12317,39 @@ define("text!ace/theme/tm.css", ".ace-tm .ace_editor {" + * * ***** END LICENSE BLOCK ***** */ -var config = { - packagePaths: { - "../lib": [ - { name:"ace", lib: "." } - ], - "../support/cockpit/lib": [ - { name: "cockpit", main: "index", lib: "." } - ], - "../support/cockpit/support/pilot/lib": [ - { name: "pilot", main: "index", lib: "." } - ] - }, - paths: { demo_startup: "../demo/demo_startup" } -}; - var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", "pilot/environment", "demo_startup" ]; -require(config); require(deps, function() { var catalog = require("pilot/plugin_manager").catalog; - catalog.registerPlugins([ "pilot/index", "cockpit/index" ]).then(function() { - var env = require("pilot/environment").create(); - catalog.startupPlugins({ env: env }).then(function() { - require("demo_startup").launch(env); - }); + catalog.registerPlugins([ "pilot/index" ]).then(function() { }); }); + +var ace = { + edit: function(el) { + if (typeof(el) == "string") { + el = document.getElementById(el); + } + var env = require("pilot/environment").create(); + var catalog = require("pilot/plugin_manager").catalog; + catalog.startupPlugins({ env: env }).then(function() { + var Document = require("ace/document").Document; + var JavaScriptMode = require("ace/mode/javascript").Mode; + var UndoManager = require("ace/undomanager").UndoManager; + var Editor = require("ace/editor").Editor; + var Renderer = require("ace/virtual_renderer").VirtualRenderer; + var theme = require("ace/theme/textmate"); + + var doc = new Document(el.innerHTML); + doc.setMode(new JavaScriptMode()); + doc.setUndoManager(new UndoManager()); + env.editor = new Editor(new Renderer(el, theme)); + env.editor.setDocument(doc); + env.editor.resize(); + window.addEventListener("resize", function() { + env.editor.resize(); + }, false); + }); + } +}; diff --git a/build/ace.js b/build/ace.js index 2a89ab4d..eca68eb5 100644 --- a/build/ace.js +++ b/build/ace.js @@ -1 +1 @@ -function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a],e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={},a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={},define("pilot/canon",function(a,b,c){function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=!1,this.start=new Date,this.end=null,this.completed=!1,this.error=!1}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return!1;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return!0}function t(){return o}function s(a){return n[a]}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=a("pilot/oop"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i=a("pilot/types").Status,j=a("pilot/types"),k=a("pilot/lang"),l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}},n={},o=[];b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[],w=100;f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=!0,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=!0,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

    Welcome to Skywriter - Code in the Cloud

    ',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
    '+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:!0,isKeyUp:!0},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}},e={name:"historyNext",predicates:{isCommandLine:!0,isKeyUp:!0},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}},g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+"
    "})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(!0){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div"),c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){function e(){return{settings:d}}var d=a("pilot/settings").settings;b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return!1}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return!0;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return!0}if(f(a))return g(a);return!0},!1),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return!0;return g(a)},!1)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(skywriter.proxy&&skywriter.proxy.xhr)skywriter.proxy.xhr.call(this,a,b,c,e,f);else{var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===4){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}return f},b.Worker=function(a){return skywriter.proxy&&skywriter.proxy.worker?new skywriter.proxy.worker(a):new Worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end,d={row:b.row,col:b.col},e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c),g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift(),j=b.comparePositions(h.start,i.start),k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){function l(){}function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}var d=a("pilot/console"),e=a("pilot/oop"),f=a("pilot/types"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)},j.prototype={get:function(){return this.value},set:function(a){this.value!==a&&(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g),k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k,l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType,e=a("pilot/types/basic").DeferredType,f=a("pilot/types"),g=a("pilot/settings").settings,h,i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}}),j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=!1;while(!0){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=!0}c&&a.predictions.push(b)}}return a}}),k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent,f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+" 1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("cockpit/cli",function(a,b,c){function r(a,b){q.call(this,a),b&&b.flags&&(this.flags=b.flags)}function q(a){this.env=a,this.commandAssignment=new o(p,this)}function o(a,b){this.param=a,this.requisition=b,this.setValue(a.defaultValue)}function n(a,b,c,d,e,f){this.emitter=a,this.setText(b),this.start=c,this.end=d,this.prefix=e,this.suffix=f}function m(a,b){this.status=a.status,this.message=a.message,b?(this.start=b.start,this.end=b.end):(this.start=0,this.end=0),this.predictions=a.predictions}function l(a,b,c,d,e){this.status=a,this.message=b;if(typeof c==="number")this.start=c,this.end=d,this.predictions=e;else{var f=c;this.start=f.start,this.end=f.end,this.predictions=f.predictions}}var d=a("pilot/console"),e=a("pilot/lang"),f=a("pilot/oop"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/types"),i=a("pilot/types").Status,j=a("pilot/types").Conversion,k=a("pilot/canon");b.startup=function(a,b){k.upgradeType("command",p)},l.prototype={},l.sort=function(a,b){b!==undefined&&a.forEach(function(a){a.start===n.AT_CURSOR?a.distance=0:ba.end?a.distance=b-a.end:a.distance=0},this),a.sort(function(a,c){if(b!==undefined){var d=a.distance-c.distance;if(d!=0)return d}return c.status-a.status}),b!==undefined&&a.forEach(function(a){delete a.distance},this);return a},b.Hint=l,f.inherits(m,l),n.prototype={merge:function(a){if(a.emitter!=this.emitter)throw new Error("Can't merge Arguments from different EventEmitters");return new n(this.emitter,this.text+this.suffix+a.prefix+a.text,this.start,a.end,this.prefix,a.suffix)},setText:function(a){if(a==null)throw new Error("Illegal text for Argument: "+a);var b={argument:this,oldText:this.text,text:a};this.text=a,this.emitter._dispatchEvent("argumentChange",b)},toString:function(){return this.prefix+this.text+this.suffix}},n.merge=function(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var d;for(var e=b;e: ";this.param.description&&(b+=this.param.description.trim(),b.charAt(b.length-1)!=="."&&(b+="."),b.charAt(b.length-1)!==" "&&(b+=" "));var c=i.VALID,d=this.arg?this.arg.start:n.AT_CURSOR,e=this.arg?this.arg.end:n.AT_CURSOR,f;this.conversion&&(c=this.conversion.status,this.conversion.message&&(b+=this.conversion.message),f=this.conversion.predictions);var g=this.arg&&this.arg.text!=="",h=this.value!==undefined||g;this.param.defaultValue===undefined&&!h&&(c=i.INVALID,b+="Required");return new l(c,b,d,e,f)},complete:function(){this.conversion&&this.conversion.predictions&&this.conversion.predictions.length>0&&this.setValue(this.conversion.predictions[0])},isPositionCaptured:function(a){if(!this.arg)return!1;if(this.arg.start===-1)return!1;if(a>this.arg.end)return!1;if(a===this.arg.end)return this.conversion.status!==i.VALID||this.conversion.predictions.length!==0;return!0},decrement:function(){var a=this.param.type.decrement(this.value);a!=null&&this.setValue(a)},increment:function(){var a=this.param.type.increment(this.value);a!=null&&this.setValue(a)},toString:function(){return this.arg?this.arg.toString():""}},b.Assignment=o;var p={name:"__command",type:"command",description:"The command to execute",getCustomHint:function(a,b){var c=[];c.push(" > "),c.push(a.name),a.params&&a.params.length>0&&a.params.forEach(function(a){a.defaultValue===undefined?c.push(" ["+a.name+"]"):c.push(" ["+a.name+"]")},this),c.push("
    "),c.push(a.description?a.description:"(No description)"),c.push("
    "),a.params&&a.params.length>0&&(c.push("
      "),a.params.forEach(function(a){c.push("
    • "),c.push(""+a.name+": "),c.push(a.description?a.description:"(No description)"),a.defaultValue===undefined?c.push(" [Required]"):a.defaultValue===null?c.push(" [Optional]"):c.push(" [Default: "+a.defaultValue+"]"),c.push("
    • ")},this),c.push("
    "));return new l(i.VALID,c.join(""),b)}};q.prototype={commandAssignment:undefined,assignmentCount:undefined,_assignments:undefined,_hints:undefined,_assignmentChanged:function(a){a.param.name==="__command"&&(this._assignments={},a.value&&a.value.params.forEach(function(a){this._assignments[a.name]=new o(a,this)},this),this.assignmentCount=Object.keys(this._assignments).length,this._dispatchEvent("commandChange",{command:a.value}))},getAssignment:function(a){var b=typeof a==="string"?a:Object.keys(this._assignments)[a];return this._assignments[b]},getParameterNames:function(){return Object.keys(this._assignments)},cloneAssignments:function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)},_updateHints:function(){this.getAssignments(!0).forEach(function(a){this._hints.push(a.getHint())},this),l.sort(this._hints)},getWorstHint:function(){return this._hints[0]},getArgsObject:function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.value},this);return a},getAssignments:function(a){var b=[];a===!0&&b.push(this.commandAssignment),Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b},setDefaultValues:function(){this.getAssignments().forEach(function(a){a.setValue(undefined)},this)},exec:function(){k.exec(this.commandAssignment.value,this.env,this.getArgsObject(),this.toCanonicalString())},toCanonicalString:function(){var a=[];a.push(this.commandAssignment.value.name),Object.keys(this._assignments).forEach(function(b){var c=this._assignments[b],d=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(d.stringify(c.value)))},this);return a.join("")}},f.implement(q.prototype,g),b.Requisition=q,f.inherits(r,q),function(){r.prototype.update=function(a){this.input=a,this._hints=[];var b=this._tokenize(a.typed);this._split(b),this.commandAssignment.value&&this._assign(b),this._updateHints()},r.prototype.getInputStatusMarkup=function(){var a=this.toString().split("").map(function(a){return i.VALID});this._hints.forEach(function(b){for(var c=b.start;c<=b.end;c++)b.status>a[c]&&(a[c]=b.status)},this);return a},r.prototype.toString=function(){return this.getAssignments(!0).map(function(a){return a.toString()},this).join("")};var a=r.prototype._updateHints;r.prototype._updateHints=function(){a.call(this);var b=this.input.cursor;this._hints.forEach(function(a){var c=b.start>=a.start&&b.start<=a.end,d=b.end>=a.start&&b.end<=a.end,e=c||d;!e&&a.status===i.INCOMPLETE&&(a.status=i.INVALID)},this),l.sort(this._hints)},r.prototype.getHints=function(){return this._hints},r.prototype.getAssignmentAt=function(a){var b=this.getAssignments(!0);for(var c=0;c=a.length){if(f!==b){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,""))}else if(h!==i){var m=a.substring(i,h),o=k[k.length-1];o?o.suffix+=m:(o=new n(this,"",h,h,m,""),k.push(o))}break}var p=a[h];switch(f){case b:p==="'"?(j=a.substring(i,h+1),f=d,i=h+1):p==='"'?(j=a.substring(i,h+1),f=e,i=h+1):/ /.test(p)||(j=a.substring(i,h),f=c,i=h);break;case c:if(p===" "){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,"")),f=b,i=h,j=""}break;case d:if(p==="'"){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}break;case e:if(p==='"'){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}}h++}return k},r.prototype._split=function(a){var b=1,c;while(b<=a.length){var c=n.merge(a,0,b);this.commandAssignment.setArgument(c);if(!this.commandAssignment.value)break;if(this.commandAssignment.value.exec){for(var d=0;d=a.length)break;continue}b.param.type.name==="boolean"?b.setValue(!0):f+10){var g=n.merge(a);this._hints.push(new l(i.INVALID,"Input '"+g.text+"' makes no sense.",g))}}}}(),b.CliRequisition=r}),define("cockpit/commands/basic",function(a,b,c){var d=a("pilot/typecheck"),e=a("pilot/canon"),f={name:"sh",description:"Execute a system command (requires server support)",params:[{name:"command",type:"text",description:"The string to send to the os shell."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,!0),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
    "+d.responseText+"
    "))},d.send(null)}},e=a("pilot/canon");b.startup=function(a,b){e.addCommand(f)},b.shutdown=function(a,b){e.removeCommand(f)}}),define("cockpit/index",function(a,b,c){b.startup=function(b,c){var d=a("pilot/index");a("cockpit/cli").startup(b,c),window.testCli=a("cockpit/test/testCli"),a("cockpit/ui/settings").startup(b,c),a("cockpit/ui/cliView").startup(b,c),a("cockpit/commands/basic").startup(b,c)}}),define("cockpit/ui/cliView",function(a,b,c){function m(a,b){this.cli=a,this.doc=document,this.win=this.doc.defaultView,this.element=this.doc.getElementById("cockpitInput");this.element?(this.settings=b.settings,this.hintDirection=this.settings.getSetting("hintDirection"),this.outputDirection=this.settings.getSetting("outputDirection"),this.outputHeight=this.settings.getSetting("outputHeight"),this.isUpdating=!1,this.createElements(),this.update()):console.log("No element with an id of cockpit. Bailing on cli")}var d=a("text!cockpit/ui/cliView.css"),e=a("pilot/dom");e.importCssString(d);var f=a("pilot/canon"),g=a("pilot/types").Status,h=a("pilot/keyboard/keyutil"),i=a("cockpit/cli").CliRequisition,j=a("cockpit/cli").Hint,k=a("cockpit/ui/requestView").RequestView,l=new j(g.VALID,"",0,0);b.startup=function(a,b){var c=new i(a.env),d=new m(c,a.env)},m.prototype={createElements:function(){var a=this.element;this.element.spellcheck=!1,this.output=this.doc.getElementById("cockpitOutput"),this.popupOutput=this.output==null;if(!this.output){this.output=this.doc.createElement("div"),this.output.id="cockpitOutput",this.output.className="cptFocusPopup",a.parentNode.insertBefore(this.output,a.nextSibling);var b=function(){this.output.style.maxHeight=this.outputHeight.get()+"px"}.bind(this);this.outputHeight.addEventListener("change",b),b()}this.completer=this.doc.createElement("div"),this.completer.className="cptCompletion VALID";var c=window.getComputedStyle(a,null);this.completer.style.color=c.color,this.completer.style.fontSize=c.fontSize,this.completer.style.fontFamily=c.fontFamily,this.completer.style.fontWeight=c.fontWeight,this.completer.style.fontStyle=c.fontStyle,a.parentNode.insertBefore(this.completer,a.nextSibling),this.completer.style.backgroundColor=a.style.backgroundColor,a.style.backgroundColor="transparent",this.hinter=this.doc.createElement("div"),this.hinter.className="cptHints cptFocusPopup",a.parentNode.insertBefore(this.hinter,a.nextSibling);var d=this.resizer.bind(this);this.win.addEventListener("resize",d,!1),this.hintDirection.addEventListener("change",d),this.outputDirection.addEventListener("change",d),d(),f.addEventListener("output",function(a){new k(a.request,this)}.bind(this)),h.addKeyDownListener(a,this.onKeyDown.bind(this)),a.addEventListener("keyup",this.onKeyUp.bind(this),!0),a.addEventListener("mouseup",function(a){this.isUpdating=!0,this.update(),this.isUpdating=!1}.bind(this),!1),this.cli.addEventListener("argumentChange",this.onArgChange.bind(this))},scrollOutputToBottom:function(){var a=Math.max(this.output.scrollHeight,this.output.clientHeight);this.output.scrollTop=a-this.output.clientHeight},resizer:function(){var a=this.element.getClientRects()[0];this.completer.style.top=a.top+"px",this.completer.style.height=a.height+"px",this.completer.style.lineHeight=a.height+"px",this.completer.style.left=a.left+"px",this.completer.style.width=a.width+"px",this.hintDirection.get()==="below"?(this.hinter.style.top=a.bottom+"px",this.hinter.style.bottom="auto"):(this.hinter.style.top="auto",this.hinter.style.bottom=this.win.innerHeight-a.top+"px"),this.hinter.style.left=a.left+30+"px",this.hinter.style.maxWidth=a.width-110+"px",this.popupOutput&&(this.outputDirection.get()==="below"?(this.output.style.top=a.bottom+"px",this.output.style.bottom="auto"):(this.output.style.top="auto",this.output.style.bottom=this.win.innerHeight-a.top+"px"),this.output.style.left=a.left+"px",this.output.style.width=a.width-80+"px")},onKeyDown:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.TAB||a.keyCode===h.KeyHelper.KEY.UP||a.keyCode===h.KeyHelper.KEY.DOWN)return!0;return b},onKeyUp:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.RETURN){var c=this.cli.getWorstHint();c.status===g.VALID?(this.cli.exec(),this.element.value=""):(this.element.selectionStart=c.start,this.element.selectionEnd=c.end)}this.update();var d=this.cli.getAssignmentAt(this.element.selectionStart);d&&(a.keyCode===h.KeyHelper.KEY.TAB&&(d.complete(),this.update()),a.keyCode===h.KeyHelper.KEY.UP&&(d.increment(),this.update()),a.keyCode===h.KeyHelper.KEY.DOWN&&(d.decrement(),this.update()));return b},update:function(){this.isUpdating=!0;var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};this.cli.update(a);var b=this.cli.getAssignmentAt(a.cursor.start).getHint();e.removeCssClass(this.completer,g.VALID.toString()),e.removeCssClass(this.completer,g.INCOMPLETE.toString()),e.removeCssClass(this.completer,g.INVALID.toString());var c='> ';if(this.element.value.length>0){var d=this.cli.getInputStatusMarkup();c+=this.markupStatusScore(d)}if(this.element.value.length>0&&b.predictions&&b.predictions.length>0){var f=b.predictions[0];c+="  ⇥ "+(f.name?f.name:f)}this.completer.innerHTML=c,e.addCssClass(this.completer,this.cli.getWorstHint().status.toString());var h="";this.element.value.length!==0&&(h+=b.message,b.predictions&&b.predictions.length>0&&(h+=": [ ",b.predictions.forEach(function(a){h+=a.name?a.name:a,h+=" | "},this),h=h.replace(/\| $/,"]"))),this.hinter.innerHTML=h,h.length===0?e.addCssClass(this.hinter,"cptNoPopup"):e.removeCssClass(this.hinter,"cptNoPopup"),this.isUpdating=!1},markupStatusScore:function(a){var b="",c=0,d=-1;while(!0){d!==a[c]&&(b+="",d=a[c]),b+=this.element.value[c],c++;if(c===this.element.value.length){b+="";break}d!==a[c]&&(b+="")}return b},onArgChange:function(a){if(!this.isUpdating){var b=this.element.value.substring(0,a.argument.start),c=this.element.value.substring(a.argument.end),d=typeof a.text==="string"?a.text:a.text.name;this.element.value=b+d+c;var e=(b+d).length;this.element.selectionStart=e,this.element.selectionEnd=e}}},b.CliView=m}),define("cockpit/ui/requestView",function(a,b,c){function n(a,b){this.request=a,this.cliView=b,this.imagePath=l,this.rowin=null,this.rowout=null,this.output=null,this.hide=null,this.show=null,this.duration=null,this.throb=null,(new g).processNode(j.cloneNode(!0),this),this.cliView.output.appendChild(this.rowin),this.cliView.output.appendChild(this.rowout),this.request.addEventListener("output",this.onRequestChange.bind(this))}var d=a("pilot/dom"),e=a("pilot/event"),f=a("text!cockpit/ui/requestView.html"),g=a("pilot/domtemplate").Templater,h=a("text!cockpit/ui/requestView.css");d.importCssString(h);var i=document.createElement("div");i.innerHTML=f;var j=i.querySelector(".cptRow"),k=c.id.split("/").pop()+".js",l;if(c.uri.substr(-k.length)!==k)console.error("module.id",c.id),console.error("module.uri",c.uri),console.error("filename",k),console.error("Can't work out path from module.uri/module/id"),l=".";else{var m=c.uri.length-k.length;l=c.uri.substr(0,m)+"images"}n.prototype={copyToInput:function(){this.cliView.element.value=this.request.typed},executeRequest:function(a){this.cliView.cli.update({typed:this.request.typed,cursor:{start:0,end:0}}),this.cliView.cli.exec()},hideOutput:function(a){this.output.style.display="none",d.addCssClass(this.hide,"cmd_hidden"),d.removeCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},showOutput:function(a){this.output.style.display="block",d.removeCssClass(this.hide,"cmd_hidden"),d.addCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},remove:function(a){this.cliView.output.removeChild(this.rowin),this.cliView.output.removeChild(this.rowout),e.stopPropagation(a)},onRequestChange:function(a){this.duration.innerHTML=this.request.duration?"completed in "+this.request.duration/1e3+" sec ":"",this.output.innerHTML="",this.request.outputs.forEach(function(a){var b;typeof a=="string"?(b=document.createElement("p"),b.innerHTML=a):b=a,this.output.appendChild(b)},this),this.cliView.scrollOutputToBottom(),d.setCssClass(this.output,"cmd_error",this.request.error),this.throb.style.display=this.request.completed?"none":"block"}},b.RequestView=n}),define("cockpit/ui/settings",function(a,b,c){var d=a("pilot/types"),e=a("pilot/types/basic").SelectionType,f=new e({name:"direction",data:["above","below"]}),g={name:"hintDirection",description:"Are hints shown above or below the command line?",type:"direction",defaultValue:"above"},h={name:"outputDirection",description:"Is the output window shown above or below the command line?",type:"direction",defaultValue:"above"},i={name:"outputHeight",description:"What height should the output panel be?",type:"number",defaultValue:300};b.startup=function(a,b){d.registerType(f),a.env.settings.addSetting(g),a.env.settings.addSetting(h),a.env.settings.addSetting(i)},b.shutdown=function(a,b){d.unregisterType(f),a.env.settings.removeSetting(g),a.env.settings.removeSetting(h),a.env.settings.removeSetting(i)}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date,d=c.currentLine,e=c.textLines,f=0,g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=!0);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d),d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("pilot/event_emitter").EventEmitter,g=a("ace/selection").Selection,h=a("ace/mode/text").Mode,i=a("ace/range").Range,j=function(a,b){this.modified=!0,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=!0,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){this.$useSoftTabs!==a&&(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){!isNaN(a)&&this.$tabSize!==a&&(this.modified=!0,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e),d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],d=b.column,e=b.row,f=1,g=this.getLine(e),h=this.getLength();while(!0){while(d=h)break;var g=this.getLine(e),d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(b.length!=0){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=!0,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"",g=e.substring(0,a.column)+d[0],h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],!0),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),!0);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=!0;var d=a.start.row,e=a.end.row,f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,!0),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,!0),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh){d+=h;break}d+=e;break}e-=h+c,d+=h+1}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("ace/textinput").TextInput,h=a("ace/keybinding").KeyBinding,i=a("ace/document").Document,j=a("ace/search").Search,k=a("ace/background_tokenizer").BackgroundTokenizer,l=a("ace/range").Range,m=a("pilot/event_emitter").EventEmitter,n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=!1,this.$search=(new j).set({wrap:!0}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(this.doc!=a){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition(),b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange(),b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(this.mode!=a){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a),c=e.getDocumentY(a),d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this,g,h,i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)},j=function(){clearInterval(l),f.$clickSelection=null},k=function(){if(g!==undefined&&h!==undefined){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a),f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString()),h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=!1,this.setOverwrite=function(a){this.$overwrite!=a&&(this.$overwrite=a,this.$blockScrolling=!0,this.onCursorChange(),this.$blockScrolling=!1,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row>=b.end.row&&b.start.column>=b.end.column){var e;if(this.doc.getUseSoftTabs()){var g=a.getTabSize(),h=this.getCursorPosition(),i=a.documentToScreenColumn(h.row,h.column),d=g-i%g;e=f.stringRepeat(" ",d)}else e="\t";return this.onTextInput(e)}var c=this.$getSelectedRows(),d=a.indentRows(c.first,c.last,"\t");this.selection.shiftSelection(d)}},this.blockOutdent=function(){if(!this.$readOnly){var a=this.doc.getSelection(),b=this.doc.outdentRows(a.getRange());a.setSelectionRange(b,a.isBackwards()),this.$updateDesiredColumn()}},this.toggleCommentLines=function(){if(!this.$readOnly){var a=this;this.bgTokenizer.getState(this.getCursorPosition().row,function(b){var c=a.$getSelectedRows(),d=a.mode.toggleCommentLines(b,a.doc,c.first,c.last);a.selection.shiftSelection(d)})}},this.removeLines=function(){if(!this.$readOnly){var a=this.$getSelectedRows();this.selection.setSelectionAnchor(a.last+1,0),this.selection.selectTo(a.first,0),this.doc.remove(this.getSelectionRange()),this.clearSelection()}},this.moveLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesDown(a,b)})},this.moveLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesUp(a,b)})},this.copyLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){this.doc.duplicateLines(a,b);return 0})},this.copyLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.duplicateLines(a,b)})},this.$moveLines=function(a){var b=this.$getSelectedRows(),c=a.call(this,b.first,b.last),d=this.selection;d.setSelectionAnchor(b.last+c+1,0),d.$moveSelection(function(){d.moveCursorTo(b.first+c,0)})},this.$getSelectedRows=function(){var a=this.getSelectionRange().collapseRows();return{first:a.start.row,last:a.end.row}},this.onCompositionStart=function(a){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(a){this.renderer.setCompositionText(a)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(a){return a>=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow(),b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow(),b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=!0,this.moveCursorTo(a-1,b||0),this.$blockScrolling=!1,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a),b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent"),e=a("pilot/event"),f=a("ace/conf/keybindings/default_mac").bindings,g=a("ace/conf/keybindings/default_win").bindings,h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode],i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()],j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){function c(a,c){var d,e,f,g,h={};for(d in a){g=a[d];if(c&&typeof g=="string"){g=g.split(c);for(e=0,f=g.length;e",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range,e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row,g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight,f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(e>=0){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc),e=d.lineHeight,f=Math.round((b.end.column-b.start.column)*d.characterWidth),g=(b.start.row-d.firstRow)*d.lineHeight,h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/dom"),f=a("pilot/lang"),g=a("pilot/event_emitter").EventEmitter,h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=!1,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/css",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/css_highlight_rules").CssHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(i,e),function(){this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);f&&(d+=c);return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(i.prototype),b.Mode=i}),define("ace/mode/css_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){function g(a){var b=[],c=a.split("");for(var d=0;d"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<(?=s*script)",next:"script"},{token:"text",regex:"<(?=s*style)",next:"css"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],script:[{token:"text",regex:">",next:"js-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],css:[{token:"text",regex:">",next:"css-start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]};var a=(new f).getRules();this.addRules(a,"js-"),this.$rules["js-start"].unshift({token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"text",regex:"<\\/(?=script)",next:"tag"});var b=(new e).getRules();this.addRules(b,"css-"),this.$rules["css-start"].unshift({token:"text",regex:"<\\/(?=style)",next:"tag"})};d.inherits(h,g),b.HtmlHighlightRules=h}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/php",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/php_highlight_rules").PhpHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/php_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;PhpHighlightRules=function(){var a=new f,b=e.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_response_headers|apache_setenv|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_uassoc|array_fill|array_filter|array_flip|array_intersect|array_intersect_assoc|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_push|array_rand|array_reduce|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_unique|array_unshift|array_values|array_walk|arsort|ascii2ebcdic|asin|asinh|asort|aspell_check|aspell_check_raw|aspell_new|aspell_suggest|assert|assert_options|atan|atan2|atanh|base64_decode|base64_encode|base_convert|basename|bcadd|bccomp|bcdiv|bcmod|bcmul|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|call_user_func|call_user_func_array|call_user_method|call_user_method_array|ccvs_add|ccvs_auth|ccvs_command|ccvs_count|ccvs_delete|ccvs_done|ccvs_init|ccvs_lookup|ccvs_new|ccvs_report|ccvs_return|ccvs_reverse|ccvs_sale|ccvs_status|ccvs_textvalue|ccvs_void|ceil|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_exists|clearstatcache|closedir|closelog|com|com_addref|com_get|com_invoke|com_isenum|com_load|com_load_typelib|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|convert_cyr_string|copy|cos|cosh|count|count_chars|cpdf_add_annotation|cpdf_add_outline|cpdf_arc|cpdf_begin_text|cpdf_circle|cpdf_clip|cpdf_close|cpdf_closepath|cpdf_closepath_fill_stroke|cpdf_closepath_stroke|cpdf_continue_text|cpdf_curveto|cpdf_end_text|cpdf_fill|cpdf_fill_stroke|cpdf_finalize|cpdf_finalize_page|cpdf_global_set_document_limits|cpdf_import_jpeg|cpdf_lineto|cpdf_moveto|cpdf_newpath|cpdf_open|cpdf_output_buffer|cpdf_page_init|cpdf_place_inline_image|cpdf_rect|cpdf_restore|cpdf_rlineto|cpdf_rmoveto|cpdf_rotate|cpdf_rotate_text|cpdf_save|cpdf_save_to_file|cpdf_scale|cpdf_set_action_url|cpdf_set_char_spacing|cpdf_set_creator|cpdf_set_current_page|cpdf_set_font|cpdf_set_font_directories|cpdf_set_font_map_file|cpdf_set_horiz_scaling|cpdf_set_keywords|cpdf_set_leading|cpdf_set_page_animation|cpdf_set_subject|cpdf_set_text_matrix|cpdf_set_text_pos|cpdf_set_text_rendering|cpdf_set_text_rise|cpdf_set_title|cpdf_set_viewer_preferences|cpdf_set_word_spacing|cpdf_setdash|cpdf_setflat|cpdf_setgray|cpdf_setgray_fill|cpdf_setgray_stroke|cpdf_setlinecap|cpdf_setlinejoin|cpdf_setlinewidth|cpdf_setmiterlimit|cpdf_setrgbcolor|cpdf_setrgbcolor_fill|cpdf_setrgbcolor_stroke|cpdf_show|cpdf_show_xy|cpdf_stringwidth|cpdf_stroke|cpdf_text|cpdf_translate|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|curl_close|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_version|current|cybercash_base64_decode|cybercash_base64_encode|cybercash_decr|cybercash_encr|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dblist|dbmclose|dbmdelete|dbmexists|dbmfetch|dbmfirstkey|dbminsert|dbmnextkey|dbmopen|dbmreplace|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debugger_off|debugger_on|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|dotnet_load|doubleval|each|easter_date|easter_days|ebcdic2ascii|echo|empty|end|ereg|ereg_replace|eregi|eregi_replace|error_log|error_reporting|escapeshellarg|escapeshellcmd|eval|exec|exif_imagetype|exif_read_data|exif_thumbnail|exit|exp|explode|expm1|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_select_db|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filetype|floatval|flock|floor|flush|fmod|fnmatch|fopen|fpassthru|fprintf|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gd_info|get_browser|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getcwd|getdate|getenv|gethostbyaddr|gethostbyname|gethostbynamel|getimagesize|getlastmod|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getopt|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|gettext|gettimeofday|gettype|glob|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_xor|gmstrftime|gregoriantojd|gzclose|gzcompress|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|header|headers_list|headers_sent|hebrev|hebrevc|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|http_build_query|hw_api_attribute|hw_api_content|hw_api_object|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_hgcsp|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|idate|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|image2wbmp|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepscopyfont|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchstructure|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implode|import_request_variables|in_array|ingres_autocommit|ingres_close|ingres_commit|ingres_connect|ingres_fetch_array|ingres_fetch_object|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_query|ingres_rollback|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|intval|ip2long|iptcembed|iptcparse|ircg_channel_mode|ircg_disconnect|ircg_fetch_error_msg|ircg_get_username|ircg_html_encode|ircg_ignore_add|ircg_ignore_del|ircg_invite|ircg_is_conn_alive|ircg_join|ircg_kick|ircg_list|ircg_lookup_format_messages|ircg_lusers|ircg_msg|ircg_nick|ircg_nickname_escape|ircg_nickname_unescape|ircg_notice|ircg_oper|ircg_part|ircg_pconnect|ircg_register_format_messages|ircg_set_current|ircg_set_file|ircg_set_on_die|ircg_topic|ircg_who|ircg_whois|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isset|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|juliantojd|key|krsort|ksort|lcg_value|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|levenshtein|link|linkinfo|list|localeconv|localtime|log|log10|log1p|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_strlen|mb_strpos|mb_strrpos|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcal_append_event|mcal_close|mcal_create_calendar|mcal_date_compare|mcal_date_valid|mcal_day_of_week|mcal_day_of_year|mcal_days_in_month|mcal_delete_calendar|mcal_delete_event|mcal_event_add_attribute|mcal_event_init|mcal_event_set_alarm|mcal_event_set_category|mcal_event_set_class|mcal_event_set_description|mcal_event_set_end|mcal_event_set_recur_daily|mcal_event_set_recur_monthly_mday|mcal_event_set_recur_monthly_wday|mcal_event_set_recur_none|mcal_event_set_recur_weekly|mcal_event_set_recur_yearly|mcal_event_set_start|mcal_event_set_title|mcal_expunge|mcal_fetch_current_stream_event|mcal_fetch_event|mcal_is_leap_year|mcal_list_alarms|mcal_list_events|mcal_next_recurrence|mcal_open|mcal_popen|mcal_rename_calendar|mcal_reopen|mcal_snooze|mcal_store_event|mcal_time_valid|mcal_week_of_year|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|mcve_adduser|mcve_adduserarg|mcve_bt|mcve_checkstatus|mcve_chkpwd|mcve_chngpwd|mcve_completeauthorizations|mcve_connect|mcve_connectionerror|mcve_deleteresponse|mcve_deletetrans|mcve_deleteusersetup|mcve_deluser|mcve_destroyconn|mcve_destroyengine|mcve_disableuser|mcve_edituser|mcve_enableuser|mcve_force|mcve_getcell|mcve_getcellbynum|mcve_getcommadelimited|mcve_getheader|mcve_getuserarg|mcve_getuserparam|mcve_gft|mcve_gl|mcve_gut|mcve_initconn|mcve_initengine|mcve_initusersetup|mcve_iscommadelimited|mcve_liststats|mcve_listusers|mcve_maxconntimeout|mcve_monitor|mcve_numcolumns|mcve_numrows|mcve_override|mcve_parsecommadelimited|mcve_ping|mcve_preauth|mcve_preauthcompletion|mcve_qc|mcve_responseparam|mcve_return|mcve_returncode|mcve_returnstatus|mcve_sale|mcve_setblocking|mcve_setdropfile|mcve_setip|mcve_setssl|mcve_setssl_files|mcve_settimeout|mcve_settle|mcve_text_avs|mcve_text_code|mcve_text_cv|mcve_transactionauth|mcve_transactionavs|mcve_transactionbatch|mcve_transactioncv|mcve_transactionid|mcve_transactionitem|mcve_transactionssent|mcve_transactiontext|mcve_transinqueue|mcve_transnew|mcve_transparam|mcve_transsend|mcve_ub|mcve_uwait|mcve_verifyconnection|mcve_verifysslcert|mcve_void|md5|md5_file|mdecrypt_generic|memory_get_usage|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_setcubicthreshold|ming_setscale|ming_useswfversion|mkdir|mktime|money_format|move_uploaded_file|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_getdata|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_setdata|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|muscat_close|muscat_get|muscat_give|muscat_setup|muscat_setup_net|mysql_affected_rows|mysql_change_user|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli_affected_rows|mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_change_user|mysqli_character_set_name|mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_dump_debug_info|mysqli_embedded_connect|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|mysqli_free_result|mysqli_get_client_info|mysqli_get_client_version|mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_master_query|mysqli_more_results|mysqli_multi_query|mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_prepare|mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_report|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|mysqli_send_query|mysqli_server_end|mysqli_server_init|mysqli_set_opt|mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt_init|mysqli_stmt_affected_rows|mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_free_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning_count|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|next|ngettext|nl2br|nl_langinfo|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|number_format|ob_clean|ob_end_clean|ob_end_flush|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_by_name|oci_cancel|oci_close|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_copy|oci_lob_is_equal|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|opendir|openlog|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_new|openssl_csr_sign|openssl_error_string|openssl_free_key|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ora_bind|ora_close|ora_columnname|ora_columnsize|ora_columntype|ora_commit|ora_commitoff|ora_commiton|ora_do|ora_error|ora_errorcode|ora_exec|ora_fetch|ora_fetch_into|ora_getcolumn|ora_logoff|ora_logon|ora_numcols|ora_numrows|ora_open|ora_parse|ora_plogon|ora_rollback|ord|output_add_rewrite_var|output_reset_rewrite_vars|overload|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parse_ini_file|parse_str|parse_url|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_page|pdf_begin_pattern|pdf_begin_template|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_curveto|pdf_delete|pdf_end_page|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_stroke|pdf_findfont|pdf_get_buffer|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_initgraphics|pdf_lineto|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_page|pdf_open_png|pdf_open_tiff|pdf_place_image|pdf_place_pdi_page|pdf_rect|pdf_restore|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_font|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_translate|pfpro_cleanup|pfpro_init|pfpro_process|pfpro_process_raw|pfpro_version|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_fetch_all|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_type|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_pconnect|pg_ping|pg_port|pg_put_line|pg_query|pg_result_error|pg_result_seek|pg_result_status|pg_select|pg_send_query|pg_set_client_encoding|pg_trace|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_ctermid|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_isatty|posix_kill|posix_mkfifo|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_grep|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|qdom_error|qdom_tree|quoted_printable_decode|quotemeta|rad2deg|rand|range|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_read_history|readline_write_history|readlink|realpath|recode|recode_file|recode_string|register_shutdown_function|register_tick_function|rename|reset|restore_error_handler|restore_include_path|rewind|rewinddir|rmdir|round|rsort|rtrim|scandir|sem_acquire|sem_get|sem_release|sem_remove|serialize|sesam_affected_rows|sesam_commit|sesam_connect|sesam_diagnostic|sesam_disconnect|sesam_errormsg|sesam_execimm|sesam_fetch_array|sesam_fetch_result|sesam_fetch_row|sesam_field_array|sesam_field_name|sesam_free_result|sesam_num_fields|sesam_query|sesam_rollback|sesam_seek_row|sesam_settransaction|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|set_error_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_time_limit|setcookie|setlocale|setrawcookie|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|sin|sinh|sizeof|sleep|snmp_get_quick_print|snmp_set_quick_print|snmpget|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_iovec_add|socket_iovec_alloc|socket_iovec_delete|socket_iovec_fetch|socket_iovec_free|socket_iovec_set|socket_last_error|socket_listen|socket_read|socket_readv|socket_recv|socket_recvfrom|socket_recvmsg|socket_select|socket_send|socket_sendmsg|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|socket_writev|sort|soundex|split|spliti|sprintf|sql_regcase|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_fetch_array|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqrt|srand|sscanf|stat|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_context_create|stream_context_get_options|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_register_wrapper|stream_select|stream_set_blocking|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_get_name|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_wrapper_register|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpos|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfbutton_keypress|swfdisplayitem|swffill|swffont|swfgradient|swfmorph|swfmovie|swfshape|swfsprite|swftext|swftextfield|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|syslog|system|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy_access_count|tidy_clean_repair|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_body|tidy_get_config|tidy_get_error_buffer|tidy_get_head|tidy_get_html|tidy_get_html_ver|tidy_get_output|tidy_get_release|tidy_get_root|tidy_get_status|tidy_getopt|tidy_is_xhtml|tidy_is_xml|tidy_load_config|tidy_parse_file|tidy_parse_string|tidy_repair_file|tidy_repair_string|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|time|tmpfile|token_get_all|token_name|touch|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|user_error|usleep|usort|utf8_decode|utf8_encode|var_dump|var_export|variant|version_compare|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|wordwrap|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xpath_eval|xpath_eval_expression|xpath_new_context|xptr_eval|xptr_new_context|xsl_xsltprocessor_get_parameter|xsl_xsltprocessor_has_exslt_support|xsl_xsltprocessor_import_stylesheet|xsl_xsltprocessor_register_php_functions|xsl_xsltprocessor_remove_parameter|xsl_xsltprocessor_set_parameter|xsl_xsltprocessor_transform_to_doc|xsl_xsltprocessor_transform_to_uri|xsl_xsltprocessor_transform_to_xml|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|zlib_get_coding_type".split("|")),c=e.arrayToMap("abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|include|include_once|global|goto|if|implements|interface|instanceof|namespace|new|old_function|or|private|protected|public|return|require|require_once|static|switch|throw|try|use|var|while|xor".split("|")),d=e.arrayToMap("true|false|null|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__CLASS__".split("|")),g=e.arrayToMap("$_GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|")),h=e.arrayToMap([]);this.$rules={start:[{token:"support",regex:"<\\?(?:php|\\=)"},{token:"support",regex:"\\?>"},{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(a){if(c[a])return"keyword";if(d[a])return"constant.language";if(g[a])return"variable.language";if(h[a])return"invalid.illegal";if(b[a])return"support.function";if(a=="debugger")return"invalid.deprecated";if(a.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))return"variable";return"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(PhpHighlightRules,g),b.PhpHighlightRules=PhpHighlightRules}),define("ace/mode/python",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;PythonHighlightRules=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:(?:[rubRUB])|(?:[ubUB][rR]))?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:(?:.)|(?:^"{3}))*?"{3}'},{token:"string",regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'},{token:"string",regex:f+"'{3}(?:(?:.)|(?:^'{3}))*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a[e]?"keyword":b[e]?"constant.language":d[e]?"invalid.illegal":c[e]?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:^"{3})*?"{3}',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:^'{3})*?'{3}",next:"start"},{token:"string",regex:".+"}]}},d.inherits(PythonHighlightRules,f),b.PythonHighlightRules=PythonHighlightRules}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;e"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"text",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"text",regex:"[^<]+"}],tag:[{token:"text",regex:">",next:"start"},{token:"keyword",regex:"[-_a-zA-Z0-9:]+"},{token:"text",regex:"\\s+"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]}};/fd/g,d.inherits(f,e),b.XmlHighlightRules=f}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=a.getSelection().getCursor(),e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(a){var b=d.row,c=j(b),g=d.column,k=!1;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=!0),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=b?c.end:c.start,e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead,b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=!1;this.selectionAnchor||(b=!0,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=!0;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead,b=a.column,c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc,b=a.getTabSize(),c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.rowa&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth * { padding-left: 2px; padding-right: 2px; }.cptRowIn > img { cursor: pointer; }.cptHover { display: none; }.cptRowIn:hover > .cptHover { display: block; }.cptRowIn:hover > .cptHover.cptHidden { display: none; }.cptOutTyped { box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1; font-weight: bold; color: #000; font-size: 120%;}.cptRowOutput { padding-left: 10px; line-height: 1.2em; }.cptRowOutput strong,.cptRowOutput b,.cptRowOutput th,.cptRowOutput h1,.cptRowOutput h2,.cptRowOutput h3 { color: #000; }.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }.cptRowOutput input[type=password],.cptRowOutput input[type=text],.cptRowOutput textarea { color: #000; font-size: 120%; background: transparent; padding: 3px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;}.cptRowOutput table,.cptRowOutput td,.cptRowOutput th { border: 0; padding: 0 2px; }.cptRowOutput .right { text-align: right; }"),define("text!ace/css/editor.css",'.ace_editor { position: absolute; overflow: hidden; font-family: "Menlo", "Monaco", "Courier New", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, "Courier New", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}'),define("text!ace/theme/eclipse.css",".ace-eclipse .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-eclipse .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-eclipse .ace_gutter { width: 40px; background: rgb(227, 227, 227); border-right: 1px solid rgb(159, 159, 159);\t color: rgb(136, 136, 136);}.ace-eclipse .ace_gutter-layer { right: 10px; text-align: right;}.ace-eclipse .ace_text-layer { cursor: text;}.ace-eclipse .ace_cursor { border-left: 1px solid black;}.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable { color: rgb(127, 0, 85);}.ace-eclipse .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-eclipse .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-eclipse .ace_line .ace_function { color: rgb(60, 76, 114);}.ace-eclipse .ace_line .ace_string { color: rgb(42, 0, 255);}.ace-eclipse .ace_line .ace_comment { color: rgb(63, 127, 95);}.ace-eclipse .ace_line .ace_comment.ace_doc { color: rgb(63, 95, 191);}.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(127, 159, 191);}.ace-eclipse .ace_line .ace_constant.ace_numeric {}.ace-eclipse .ace_line .ace_tag {\tcolor: rgb(63, 127, 127);}.ace-eclipse .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-eclipse .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-eclipse .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-eclipse .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var config={packagePaths:{"../lib":[{name:"ace",lib:"."}],"../support/cockpit/lib":[{name:"cockpit",main:"index",lib:"."}],"../support/cockpit/support/pilot/lib":[{name:"pilot",main:"index",lib:"."}]},paths:{demo_startup:"../demo/demo_startup"}},deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(config),require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index","cockpit/index"]).then(function(){var b=require("pilot/environment").create();a.startupPlugins({env:b}).then(function(){require("demo_startup").launch(b)})})}) \ No newline at end of file +function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a],e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={},a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={},define("pilot/canon",function(a,b,c){function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=!1,this.start=new Date,this.end=null,this.completed=!1,this.error=!1}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return!1;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return!0}function t(){return o}function s(a){return n[a]}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=a("pilot/oop"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i=a("pilot/types").Status,j=a("pilot/types"),k=a("pilot/lang"),l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}},n={},o=[];b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[],w=100;f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=!0,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=!0,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

    Welcome to Skywriter - Code in the Cloud

    ',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
    '+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:!0,isKeyUp:!0},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}},e={name:"historyNext",predicates:{isCommandLine:!0,isKeyUp:!0},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}},g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+"
    "})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(!0){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div"),c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){function e(){return{settings:d}}var d=a("pilot/settings").settings;b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return!1}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return!0;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return!0}if(f(a))return g(a);return!0},!1),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return!0;return g(a)},!1)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(skywriter.proxy&&skywriter.proxy.xhr)skywriter.proxy.xhr.call(this,a,b,c,e,f);else{var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===4){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}return f},b.Worker=function(a){return skywriter.proxy&&skywriter.proxy.worker?new skywriter.proxy.worker(a):new Worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end,d={row:b.row,col:b.col},e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c),g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift(),j=b.comparePositions(h.start,i.start),k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){function l(){}function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}var d=a("pilot/console"),e=a("pilot/oop"),f=a("pilot/types"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)},j.prototype={get:function(){return this.value},set:function(a){this.value!==a&&(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g),k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k,l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType,e=a("pilot/types/basic").DeferredType,f=a("pilot/types"),g=a("pilot/settings").settings,h,i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}}),j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=!1;while(!0){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=!0}c&&a.predictions.push(b)}}return a}}),k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent,f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+" 1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date,d=c.currentLine,e=c.textLines,f=0,g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=!0);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d),d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("pilot/event_emitter").EventEmitter,g=a("ace/selection").Selection,h=a("ace/mode/text").Mode,i=a("ace/range").Range,j=function(a,b){this.modified=!0,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=!0,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){this.$useSoftTabs!==a&&(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){!isNaN(a)&&this.$tabSize!==a&&(this.modified=!0,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e),d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],d=b.column,e=b.row,f=1,g=this.getLine(e),h=this.getLength();while(!0){while(d=h)break;var g=this.getLine(e),d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(b.length!=0){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=!0,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"",g=e.substring(0,a.column)+d[0],h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],!0),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),!0);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=!0;var d=a.start.row,e=a.end.row,f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,!0),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,!0),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh){d+=h;break}d+=e;break}e-=h+c,d+=h+1}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("ace/textinput").TextInput,h=a("ace/keybinding").KeyBinding,i=a("ace/document").Document,j=a("ace/search").Search,k=a("ace/background_tokenizer").BackgroundTokenizer,l=a("ace/range").Range,m=a("pilot/event_emitter").EventEmitter,n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=!1,this.$search=(new j).set({wrap:!0}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(this.doc!=a){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition(),b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange(),b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(this.mode!=a){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a),c=e.getDocumentY(a),d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this,g,h,i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)},j=function(){clearInterval(l),f.$clickSelection=null},k=function(){if(g!==undefined&&h!==undefined){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a),f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString()),h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=!1,this.setOverwrite=function(a){this.$overwrite!=a&&(this.$overwrite=a,this.$blockScrolling=!0,this.onCursorChange(),this.$blockScrolling=!1,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row>=b.end.row&&b.start.column>=b.end.column){var e;if(this.doc.getUseSoftTabs()){var g=a.getTabSize(),h=this.getCursorPosition(),i=a.documentToScreenColumn(h.row,h.column),d=g-i%g;e=f.stringRepeat(" ",d)}else e="\t";return this.onTextInput(e)}var c=this.$getSelectedRows(),d=a.indentRows(c.first,c.last,"\t");this.selection.shiftSelection(d)}},this.blockOutdent=function(){if(!this.$readOnly){var a=this.doc.getSelection(),b=this.doc.outdentRows(a.getRange());a.setSelectionRange(b,a.isBackwards()),this.$updateDesiredColumn()}},this.toggleCommentLines=function(){if(!this.$readOnly){var a=this;this.bgTokenizer.getState(this.getCursorPosition().row,function(b){var c=a.$getSelectedRows(),d=a.mode.toggleCommentLines(b,a.doc,c.first,c.last);a.selection.shiftSelection(d)})}},this.removeLines=function(){if(!this.$readOnly){var a=this.$getSelectedRows();this.selection.setSelectionAnchor(a.last+1,0),this.selection.selectTo(a.first,0),this.doc.remove(this.getSelectionRange()),this.clearSelection()}},this.moveLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesDown(a,b)})},this.moveLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesUp(a,b)})},this.copyLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){this.doc.duplicateLines(a,b);return 0})},this.copyLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.duplicateLines(a,b)})},this.$moveLines=function(a){var b=this.$getSelectedRows(),c=a.call(this,b.first,b.last),d=this.selection;d.setSelectionAnchor(b.last+c+1,0),d.$moveSelection(function(){d.moveCursorTo(b.first+c,0)})},this.$getSelectedRows=function(){var a=this.getSelectionRange().collapseRows();return{first:a.start.row,last:a.end.row}},this.onCompositionStart=function(a){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(a){this.renderer.setCompositionText(a)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(a){return a>=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow(),b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow(),b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=!0,this.moveCursorTo(a-1,b||0),this.$blockScrolling=!1,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a),b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent"),e=a("pilot/event"),f=a("ace/conf/keybindings/default_mac").bindings,g=a("ace/conf/keybindings/default_win").bindings,h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode],i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()],j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){function c(a,c){var d,e,f,g,h={};for(d in a){g=a[d];if(c&&typeof g=="string"){g=g.split(c);for(e=0,f=g.length;e",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range,e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row,g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight,f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(e>=0){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc),e=d.lineHeight,f=Math.round((b.end.column-b.start.column)*d.characterWidth),g=(b.start.row-d.firstRow)*d.lineHeight,h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/dom"),f=a("pilot/lang"),g=a("pilot/event_emitter").EventEmitter,h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=!1,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=a.getSelection().getCursor(),e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(a){var b=d.row,c=j(b),g=d.column,k=!1;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=!0),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=b?c.end:c.start,e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead,b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=!1;this.selectionAnchor||(b=!0,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=!0;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead,b=a.column,c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc,b=a.getTabSize(),c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.rowa&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth"+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;e Date: Wed, 12 Jan 2011 00:32:16 -0500 Subject: [PATCH 19/90] oops. don't need demo_startup either --- Makefile.dryice.js | 7 -- build/ace-uncompressed.js | 221 -------------------------------------- build/ace.js | 2 +- 3 files changed, 1 insertion(+), 229 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index cae1112d..fecda96f 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -86,13 +86,6 @@ copy({ dest: buildStep }); -// The startup file -copy({ - source: { base: aceHome + '/demo/', path: 'demo_startup.js' }, - filter: [ copy.filter.moduleDefines ], - dest: buildStep -}); - // The CSS files copy({ source: [ diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index 5305db61..5283a236 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -11833,227 +11833,6 @@ var TextHighlightRules = function() { }).call(TextHighlightRules.prototype); exports.TextHighlightRules = TextHighlightRules; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -define('demo_startup', function(require, exports, module) { - -exports.launch = function(env) { - - var event = require("pilot/event"); - var Editor = require("ace/editor").Editor; - var Renderer = require("ace/virtual_renderer").VirtualRenderer; - var theme = require("ace/theme/textmate"); - var Document = require("ace/document").Document; - var JavaScriptMode = require("ace/mode/javascript").Mode; - var CssMode = require("ace/mode/css").Mode; - var HtmlMode = require("ace/mode/html").Mode; - var XmlMode = require("ace/mode/xml").Mode; - var PythonMode = require("ace/mode/python").Mode; - var PhpMode = require("ace/mode/php").Mode; - var TextMode = require("ace/mode/text").Mode; - var UndoManager = require("ace/undomanager").UndoManager; - - var docs = {}; - - docs.js = new Document(document.getElementById("jstext").innerHTML); - docs.js.setMode(new JavaScriptMode()); - docs.js.setUndoManager(new UndoManager()); - - docs.css = new Document(document.getElementById("csstext").innerHTML); - docs.css.setMode(new CssMode()); - docs.css.setUndoManager(new UndoManager()); - - docs.html = new Document(document.getElementById("htmltext").innerHTML); - docs.html.setMode(new HtmlMode()); - docs.html.setUndoManager(new UndoManager()); - - docs.python = new Document(document.getElementById("pythontext").innerHTML); - docs.python.setMode(new PythonMode()); - docs.python.setUndoManager(new UndoManager()); - - docs.php = new Document(document.getElementById("phptext").innerHTML); - docs.php.setMode(new PhpMode()); - docs.php.setUndoManager(new UndoManager()); - - var docEl = document.getElementById("doc"); - - var container = document.getElementById("editor"); - env.editor = new Editor(new Renderer(container, theme)); - - function onDocChange() { - var doc = getDoc(); - env.editor.setDocument(doc); - - var mode = doc.getMode(); - if (mode instanceof JavaScriptMode) { - modeEl.value = "javascript"; - } - else if (mode instanceof CssMode) { - modeEl.value = "css"; - } - else if (mode instanceof HtmlMode) { - modeEl.value = "html"; - } - else if (mode instanceof XmlMode) { - modeEl.value = "xml"; - } - else if (mode instanceof PythonMode) { - modeEl.value = "python"; - } - else if (mode instanceof PhpMode) { - modeEl.value = "php"; - } - else { - modeEl.value = "text"; - } - - env.editor.focus(); - } - docEl.onchange = onDocChange; - - function getDoc() { - return docs[docEl.value]; - } - - var modeEl = document.getElementById("mode"); - modeEl.onchange = function() { - env.editor.getDocument().setMode(modes[modeEl.value] || modes.text); - }; - - var modes = { - text: new TextMode(), - xml: new XmlMode(), - html: new HtmlMode(), - css: new CssMode(), - javascript: new JavaScriptMode(), - python: new PythonMode(), - php: new PhpMode() - }; - - function getMode() { - return modes[modeEl.value]; - } - - var themeEl = document.getElementById("theme"); - themeEl.onchange = function() { - env.editor.setTheme(themeEl.value); - }; - - var selectEl = document.getElementById("select_style"); - selectEl.onchange = function() { - if (selectEl.checked) { - env.editor.setSelectionStyle("line"); - } else { - env.editor.setSelectionStyle("text"); - } - }; - - var activeEl = document.getElementById("highlight_active"); - activeEl.onchange = function() { - env.editor.setHighlightActiveLine(!!activeEl.checked); - }; - - onDocChange(); - - window.jump = function() { - var jump = document.getElementById("jump"); - var cursor = env.editor.getCursorPosition(); - var pos = env.editor.renderer.textToScreenCoordinates(cursor.row, cursor.column); - jump.style.left = pos.pageX + "px"; - jump.style.top = pos.pageY + "px"; - jump.style.display = "block"; - }; - - function onResize() { - container.style.width = (document.documentElement.clientWidth - 4) + "px"; - container.style.height = (document.documentElement.clientHeight - 55 - 4 - 23) + "px"; - env.editor.resize(); - }; - - window.onresize = onResize; - onResize(); - - event.addListener(container, "dragover", function(e) { - return event.preventDefault(e); - }); - - event.addListener(container, "drop", function(e) { - try { - var file = e.dataTransfer.files[0]; - } catch(e) { - return event.stopEvent(); - } - - if (window.FileReader) { - var reader = new FileReader(); - reader.onload = function(e) { - env.editor.getSelection().selectAll(); - - var mode = "text"; - if (/^.*\.js$/i.test(file.name)) { - mode = "javascript"; - } else if (/^.*\.xml$/i.test(file.name)) { - mode = "xml"; - } else if (/^.*\.html$/i.test(file.name)) { - mode = "html"; - } else if (/^.*\.css$/i.test(file.name)) { - mode = "css"; - } else if (/^.*\.py$/i.test(file.name)) { - mode = "python"; - } else if (/^.*\.php$/i.test(file.name)) { - mode = "php"; - } - - env.editor.onTextInput(reader.result); - - modeEl.value = mode; - env.editor.getDocument().setMode(modes[mode]); - }; - reader.readAsText(file); - } - - return event.preventDefault(e); - }); -}; - }); define("text!ace/css/editor.css", ".ace_editor {" + " position: absolute;" + diff --git a/build/ace.js b/build/ace.js index eca68eb5..0ace9164 100644 --- a/build/ace.js +++ b/build/ace.js @@ -1 +1 @@ -function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a],e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={},a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={},define("pilot/canon",function(a,b,c){function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=!1,this.start=new Date,this.end=null,this.completed=!1,this.error=!1}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return!1;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return!0}function t(){return o}function s(a){return n[a]}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=a("pilot/oop"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i=a("pilot/types").Status,j=a("pilot/types"),k=a("pilot/lang"),l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}},n={},o=[];b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[],w=100;f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=!0,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=!0,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

    Welcome to Skywriter - Code in the Cloud

    ',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
    '+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:!0,isKeyUp:!0},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}},e={name:"historyNext",predicates:{isCommandLine:!0,isKeyUp:!0},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}},g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+"
    "})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(!0){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div"),c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){function e(){return{settings:d}}var d=a("pilot/settings").settings;b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return!1}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return!0;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return!0}if(f(a))return g(a);return!0},!1),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return!0;return g(a)},!1)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(skywriter.proxy&&skywriter.proxy.xhr)skywriter.proxy.xhr.call(this,a,b,c,e,f);else{var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===4){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}return f},b.Worker=function(a){return skywriter.proxy&&skywriter.proxy.worker?new skywriter.proxy.worker(a):new Worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end,d={row:b.row,col:b.col},e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c),g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift(),j=b.comparePositions(h.start,i.start),k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){function l(){}function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}var d=a("pilot/console"),e=a("pilot/oop"),f=a("pilot/types"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)},j.prototype={get:function(){return this.value},set:function(a){this.value!==a&&(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g),k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k,l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType,e=a("pilot/types/basic").DeferredType,f=a("pilot/types"),g=a("pilot/settings").settings,h,i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}}),j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=!1;while(!0){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=!0}c&&a.predictions.push(b)}}return a}}),k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent,f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+" 1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date,d=c.currentLine,e=c.textLines,f=0,g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=!0);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d),d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("pilot/event_emitter").EventEmitter,g=a("ace/selection").Selection,h=a("ace/mode/text").Mode,i=a("ace/range").Range,j=function(a,b){this.modified=!0,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=!0,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){this.$useSoftTabs!==a&&(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){!isNaN(a)&&this.$tabSize!==a&&(this.modified=!0,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e),d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],d=b.column,e=b.row,f=1,g=this.getLine(e),h=this.getLength();while(!0){while(d=h)break;var g=this.getLine(e),d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(b.length!=0){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=!0,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"",g=e.substring(0,a.column)+d[0],h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],!0),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),!0);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=!0;var d=a.start.row,e=a.end.row,f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,!0),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,!0),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh){d+=h;break}d+=e;break}e-=h+c,d+=h+1}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("ace/textinput").TextInput,h=a("ace/keybinding").KeyBinding,i=a("ace/document").Document,j=a("ace/search").Search,k=a("ace/background_tokenizer").BackgroundTokenizer,l=a("ace/range").Range,m=a("pilot/event_emitter").EventEmitter,n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=!1,this.$search=(new j).set({wrap:!0}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(this.doc!=a){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition(),b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange(),b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(this.mode!=a){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a),c=e.getDocumentY(a),d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this,g,h,i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)},j=function(){clearInterval(l),f.$clickSelection=null},k=function(){if(g!==undefined&&h!==undefined){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a),f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString()),h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=!1,this.setOverwrite=function(a){this.$overwrite!=a&&(this.$overwrite=a,this.$blockScrolling=!0,this.onCursorChange(),this.$blockScrolling=!1,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row>=b.end.row&&b.start.column>=b.end.column){var e;if(this.doc.getUseSoftTabs()){var g=a.getTabSize(),h=this.getCursorPosition(),i=a.documentToScreenColumn(h.row,h.column),d=g-i%g;e=f.stringRepeat(" ",d)}else e="\t";return this.onTextInput(e)}var c=this.$getSelectedRows(),d=a.indentRows(c.first,c.last,"\t");this.selection.shiftSelection(d)}},this.blockOutdent=function(){if(!this.$readOnly){var a=this.doc.getSelection(),b=this.doc.outdentRows(a.getRange());a.setSelectionRange(b,a.isBackwards()),this.$updateDesiredColumn()}},this.toggleCommentLines=function(){if(!this.$readOnly){var a=this;this.bgTokenizer.getState(this.getCursorPosition().row,function(b){var c=a.$getSelectedRows(),d=a.mode.toggleCommentLines(b,a.doc,c.first,c.last);a.selection.shiftSelection(d)})}},this.removeLines=function(){if(!this.$readOnly){var a=this.$getSelectedRows();this.selection.setSelectionAnchor(a.last+1,0),this.selection.selectTo(a.first,0),this.doc.remove(this.getSelectionRange()),this.clearSelection()}},this.moveLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesDown(a,b)})},this.moveLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesUp(a,b)})},this.copyLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){this.doc.duplicateLines(a,b);return 0})},this.copyLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.duplicateLines(a,b)})},this.$moveLines=function(a){var b=this.$getSelectedRows(),c=a.call(this,b.first,b.last),d=this.selection;d.setSelectionAnchor(b.last+c+1,0),d.$moveSelection(function(){d.moveCursorTo(b.first+c,0)})},this.$getSelectedRows=function(){var a=this.getSelectionRange().collapseRows();return{first:a.start.row,last:a.end.row}},this.onCompositionStart=function(a){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(a){this.renderer.setCompositionText(a)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(a){return a>=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow(),b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow(),b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=!0,this.moveCursorTo(a-1,b||0),this.$blockScrolling=!1,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a),b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent"),e=a("pilot/event"),f=a("ace/conf/keybindings/default_mac").bindings,g=a("ace/conf/keybindings/default_win").bindings,h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode],i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()],j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){function c(a,c){var d,e,f,g,h={};for(d in a){g=a[d];if(c&&typeof g=="string"){g=g.split(c);for(e=0,f=g.length;e",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range,e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row,g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight,f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(e>=0){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc),e=d.lineHeight,f=Math.round((b.end.column-b.start.column)*d.characterWidth),g=(b.start.row-d.firstRow)*d.lineHeight,h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/dom"),f=a("pilot/lang"),g=a("pilot/event_emitter").EventEmitter,h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=!1,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=a.getSelection().getCursor(),e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(a){var b=d.row,c=j(b),g=d.column,k=!1;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=!0),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=b?c.end:c.start,e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead,b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=!1;this.selectionAnchor||(b=!0,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=!0;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead,b=a.column,c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc,b=a.getTabSize(),c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.rowa&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth"+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;ew)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=!0,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

    Welcome to Skywriter - Code in the Cloud

    ',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
    '+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:!0,isKeyUp:!0},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}},e={name:"historyNext",predicates:{isCommandLine:!0,isKeyUp:!0},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}},g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+"
    "})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(!0){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div"),c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){function e(){return{settings:d}}var d=a("pilot/settings").settings;b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return!1}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return!0;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return!0}if(f(a))return g(a);return!0},!1),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return!0;return g(a)},!1)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(skywriter.proxy&&skywriter.proxy.xhr)skywriter.proxy.xhr.call(this,a,b,c,e,f);else{var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===4){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}return f},b.Worker=function(a){return skywriter.proxy&&skywriter.proxy.worker?new skywriter.proxy.worker(a):new Worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end,d={row:b.row,col:b.col},e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c),g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift(),j=b.comparePositions(h.start,i.start),k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){function l(){}function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}var d=a("pilot/console"),e=a("pilot/oop"),f=a("pilot/types"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)},j.prototype={get:function(){return this.value},set:function(a){this.value!==a&&(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g),k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k,l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType,e=a("pilot/types/basic").DeferredType,f=a("pilot/types"),g=a("pilot/settings").settings,h,i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}}),j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=!1;while(!0){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=!0}c&&a.predictions.push(b)}}return a}}),k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent,f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+" 1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date,d=c.currentLine,e=c.textLines,f=0,g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=!0);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d),d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("pilot/event_emitter").EventEmitter,g=a("ace/selection").Selection,h=a("ace/mode/text").Mode,i=a("ace/range").Range,j=function(a,b){this.modified=!0,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=!0,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){this.$useSoftTabs!==a&&(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){!isNaN(a)&&this.$tabSize!==a&&(this.modified=!0,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e),d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],d=b.column,e=b.row,f=1,g=this.getLine(e),h=this.getLength();while(!0){while(d=h)break;var g=this.getLine(e),d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(b.length!=0){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=!0,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"",g=e.substring(0,a.column)+d[0],h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],!0),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),!0);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=!0;var d=a.start.row,e=a.end.row,f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,!0),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,!0),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh){d+=h;break}d+=e;break}e-=h+c,d+=h+1}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("ace/textinput").TextInput,h=a("ace/keybinding").KeyBinding,i=a("ace/document").Document,j=a("ace/search").Search,k=a("ace/background_tokenizer").BackgroundTokenizer,l=a("ace/range").Range,m=a("pilot/event_emitter").EventEmitter,n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=!1,this.$search=(new j).set({wrap:!0}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(this.doc!=a){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition(),b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange(),b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(this.mode!=a){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a),c=e.getDocumentY(a),d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this,g,h,i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)},j=function(){clearInterval(l),f.$clickSelection=null},k=function(){if(g!==undefined&&h!==undefined){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a),f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString()),h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=!1,this.setOverwrite=function(a){this.$overwrite!=a&&(this.$overwrite=a,this.$blockScrolling=!0,this.onCursorChange(),this.$blockScrolling=!1,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row>=b.end.row&&b.start.column>=b.end.column){var e;if(this.doc.getUseSoftTabs()){var g=a.getTabSize(),h=this.getCursorPosition(),i=a.documentToScreenColumn(h.row,h.column),d=g-i%g;e=f.stringRepeat(" ",d)}else e="\t";return this.onTextInput(e)}var c=this.$getSelectedRows(),d=a.indentRows(c.first,c.last,"\t");this.selection.shiftSelection(d)}},this.blockOutdent=function(){if(!this.$readOnly){var a=this.doc.getSelection(),b=this.doc.outdentRows(a.getRange());a.setSelectionRange(b,a.isBackwards()),this.$updateDesiredColumn()}},this.toggleCommentLines=function(){if(!this.$readOnly){var a=this;this.bgTokenizer.getState(this.getCursorPosition().row,function(b){var c=a.$getSelectedRows(),d=a.mode.toggleCommentLines(b,a.doc,c.first,c.last);a.selection.shiftSelection(d)})}},this.removeLines=function(){if(!this.$readOnly){var a=this.$getSelectedRows();this.selection.setSelectionAnchor(a.last+1,0),this.selection.selectTo(a.first,0),this.doc.remove(this.getSelectionRange()),this.clearSelection()}},this.moveLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesDown(a,b)})},this.moveLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesUp(a,b)})},this.copyLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){this.doc.duplicateLines(a,b);return 0})},this.copyLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.duplicateLines(a,b)})},this.$moveLines=function(a){var b=this.$getSelectedRows(),c=a.call(this,b.first,b.last),d=this.selection;d.setSelectionAnchor(b.last+c+1,0),d.$moveSelection(function(){d.moveCursorTo(b.first+c,0)})},this.$getSelectedRows=function(){var a=this.getSelectionRange().collapseRows();return{first:a.start.row,last:a.end.row}},this.onCompositionStart=function(a){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(a){this.renderer.setCompositionText(a)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(a){return a>=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow(),b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow(),b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=!0,this.moveCursorTo(a-1,b||0),this.$blockScrolling=!1,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a),b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent"),e=a("pilot/event"),f=a("ace/conf/keybindings/default_mac").bindings,g=a("ace/conf/keybindings/default_win").bindings,h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode],i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()],j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){function c(a,c){var d,e,f,g,h={};for(d in a){g=a[d];if(c&&typeof g=="string"){g=g.split(c);for(e=0,f=g.length;e",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range,e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row,g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight,f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(e>=0){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc),e=d.lineHeight,f=Math.round((b.end.column-b.start.column)*d.characterWidth),g=(b.start.row-d.firstRow)*d.lineHeight,h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/dom"),f=a("pilot/lang"),g=a("pilot/event_emitter").EventEmitter,h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=!1,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=a.getSelection().getCursor(),e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(a){var b=d.row,c=j(b),g=d.column,k=!1;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=!0),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=b?c.end:c.start,e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead,b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=!1;this.selectionAnchor||(b=!0,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=!0;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead,b=a.column,c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc,b=a.getTabSize(),c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.rowa&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth"+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;e Date: Wed, 12 Jan 2011 10:12:32 +0100 Subject: [PATCH 20/90] remove unused argument --- lib/ace/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/document.js b/lib/ace/document.js index 6f526227..ef2fab6d 100644 --- a/lib/ace/document.js +++ b/lib/ace/document.js @@ -691,7 +691,7 @@ var Document = function(text, mode) { return end; }; - this.indentRows = function(startRow, endRow, indentString) { + this.indentRows = function(startRow, endRow) { indentString = indentString.replace("\t", this.getTabString()); for (var row=startRow; row<=endRow; row++) { this.$insert({row: row, column:0}, indentString); From 03cf6c84fbb242edfef4464dd592dc40ac0341e8 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 12 Jan 2011 10:14:48 +0100 Subject: [PATCH 21/90] replace LGPL license file with pointers to the three licenses --- LICENSE | 168 ++------------------------------------------------------ 1 file changed, 4 insertions(+), 164 deletions(-) diff --git a/LICENSE b/LICENSE index 02bbb60b..4dfec04a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,165 +1,5 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 +This software is available under your choice of the following licenses: - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. \ No newline at end of file +* MPL 1.1 or later: http://www.mozilla.org/MPL/ +* GPL 2.0 or later: http://www.gnu.org/licenses/gpl.html +* LGPL 2.1 or later: http://www.gnu.org/licenses/lgpl.html \ No newline at end of file From ed2300a72cd538196d823fbc48edac6db12ab9f9 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 12 Jan 2011 11:53:31 +0100 Subject: [PATCH 22/90] revert stupid fix --- lib/ace/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/document.js b/lib/ace/document.js index 4edb3167..e7d933d6 100644 --- a/lib/ace/document.js +++ b/lib/ace/document.js @@ -701,7 +701,7 @@ var Document = function(text, mode) { return end; }; - this.indentRows = function(startRow, endRow) { + this.indentRows = function(startRow, endRow, indentString) { indentString = indentString.replace("\t", this.getTabString()); for (var row=startRow; row<=endRow; row++) { this.$insert({row: row, column:0}, indentString); From ecf7ef04c826274734165d28079af3ca25dcc8fd Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 12 Jan 2011 11:56:28 +0100 Subject: [PATCH 23/90] allow all characters a regexp flags --- lib/ace/mode/javascript_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index 207f9ff8..7f6f3fa9 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -76,7 +76,7 @@ JavaScriptHighlightRules = function() { next : "comment" }, { token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" }, { token : "string", // single line regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' From bc85026e230d7b5b5d8ee1c53fc671142c0c0930 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 11:12:35 +0000 Subject: [PATCH 24/90] catchup with cockpit --- support/cockpit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/cockpit b/support/cockpit index e8c6677e..c03e6fb8 160000 --- a/support/cockpit +++ b/support/cockpit @@ -1 +1 @@ -Subproject commit e8c6677e969f8a87ba28ae3405471ab6f9cf83e4 +Subproject commit c03e6fb80c2a153c343b3ab5e30f4b7750507f85 From 0bea52db343dd0ae6dd737b3a4e5d8ecfac54e77 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 12:45:41 +0000 Subject: [PATCH 25/90] simplify the build script --- Makefile.dryice.js | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index fecda96f..5d404ab8 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -56,36 +56,25 @@ copy({ include: /.*\.js$/, exclude: /tests?\// }, + // Exclude all themes/modes so we can just include textmate/js { root: aceHome + '/lib', include: /.*\.js$/, exclude: /tests?\/|theme\/|mode\// - } + }, + { base: aceHome + '/lib/', path: 'ace/theme/textmate.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/text.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/javascript.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/text_highlight_rules.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/javascript_highlight_rules.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/doc_comment_highlight_rules.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/matching_brace_outdent.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/javascript_highlight_rules.js' }, ], filter: [ copy.filter.moduleDefines ], dest: buildStep }); -// include the TextMate theme only for now -copy({ - source: [ { - root: aceHome + "/lib", - include: /textmate\.js/ - } ], - filter: [ copy.filter.moduleDefines ], - dest: buildStep -}); - -// include the JS mode only for now -copy({ - source: [ { - root: aceHome + '/lib', - include: /\/text\.js|\/javascript\.js|\/text_highlight_rules\.js|\/javascript_highlight_rules\.js|\/doc_comment_highlight_rules\.js|\/matching_brace_outdent\.js/ - } ], - filter: [ copy.filter.moduleDefines ], - dest: buildStep -}); - // The CSS files copy({ source: [ From 25573105b785e11f69b09222b6e3324f3c8081a1 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 12:48:01 +0000 Subject: [PATCH 26/90] remove the contents of the div once weve injected into the editor. this may not be the best solution for the long term, but its a win for now --- demo/build_boot.js | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/build_boot.js b/demo/build_boot.js index e3f6b7cf..8a22658f 100644 --- a/demo/build_boot.js +++ b/demo/build_boot.js @@ -60,6 +60,7 @@ var ace = { var theme = require("ace/theme/textmate"); var doc = new Document(el.innerHTML); + el.innerHTML = ''; doc.setMode(new JavaScriptMode()); doc.setUndoManager(new UndoManager()); env.editor = new Editor(new Renderer(el, theme)); From 95d9ac6921767a5544286e258c425702643cd45d Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 12:48:15 +0000 Subject: [PATCH 27/90] new build files --- build/ace-uncompressed.js | 808 ++++++++++++++++---------------------- build/ace.js | 2 +- 2 files changed, 341 insertions(+), 469 deletions(-) diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index 5283a236..dacdd1f1 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -2200,25 +2200,25 @@ define('pilot/index', function(require, exports, module) { exports.startup = function(data, reason) { require('pilot/fixoldbrowsers'); - require('pilot/types/basic').startup(); - require('pilot/types/command').startup(); - require('pilot/types/settings').startup(); - require('pilot/commands/settings').startup(); - require('pilot/commands/basic').startup(); - // require('pilot/commands/history').startup(); - require('pilot/settings/canon').startup(); - require('pilot/canon').startup(); + require('pilot/types/basic').startup(data, reason); + require('pilot/types/command').startup(data, reason); + require('pilot/types/settings').startup(data, reason); + require('pilot/commands/settings').startup(data, reason); + require('pilot/commands/basic').startup(data, reason); + // require('pilot/commands/history').startup(data, reason); + require('pilot/settings/canon').startup(data, reason); + require('pilot/canon').startup(data, reason); }; exports.shutdown = function(data, reason) { - require('pilot/types/basic').shutdown(); - require('pilot/types/command').shutdown(); - require('pilot/types/settings').shutdown(); - require('pilot/commands/settings').shutdown(); - require('pilot/commands/basic').shutdown(); - // require('pilot/commands/history').shutdown(); - require('pilot/settings/canon').shutdown(); - require('pilot/canon').shutdown(); + require('pilot/types/basic').shutdown(data, reason); + require('pilot/types/command').shutdown(data, reason); + require('pilot/types/settings').shutdown(data, reason); + require('pilot/commands/settings').shutdown(data, reason); + require('pilot/commands/basic').shutdown(data, reason); + // require('pilot/commands/history').shutdown(data, reason); + require('pilot/settings/canon').shutdown(data, reason); + require('pilot/canon').shutdown(data, reason); }; @@ -10402,6 +10402,7 @@ var VirtualRenderer = function(container, theme) { var changes = this.CHANGE_SIZE; var height = dom.getInnerHeight(this.container); +console.log('height: ', height, ' this.$size.height: ', this.$size.height); if (this.$size.height != height) { this.$size.height = height; @@ -10415,6 +10416,7 @@ var VirtualRenderer = function(container, theme) { } var width = dom.getInnerWidth(this.container); +console.log('width: ', width, ' this.$size.width: ', this.$size.width); if (this.$size.width != width) { this.$size.width = width; @@ -10422,10 +10424,14 @@ var VirtualRenderer = function(container, theme) { this.scroller.style.left = gutterWidth + "px"; this.scroller.style.width = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()) + "px"; } +console.log('this.scroller.style.width: ', this.scroller.style.width); this.$size.scrollerWidth = this.scroller.clientWidth; this.$size.scrollerHeight = this.scroller.clientHeight; this.$loop.schedule(changes); +console.log('this.$size.scrollerWidth: ', this.$size.scrollerWidth); +console.log('this.$size.scrollerHeight: ', this.$size.scrollerHeight); +console.log('changes: ', changes); }; this.setTokenizer = function(tokenizer) { @@ -10547,7 +10553,7 @@ var VirtualRenderer = function(container, theme) { this.$renderChanges = function(changes) { if (!changes || !this.doc || !this.$tokenizer) return; - + // text, scrolling and resize changes can cause the view port size to change if (!this.layerConfig || changes & this.CHANGE_FULL || @@ -10937,362 +10943,48 @@ define('ace/theme/textmate', function(require, exports, module) { * * ***** END LICENSE BLOCK ***** */ -define('ace/layer/text', function(require, exports, module) { +define('ace/mode/text', function(require, exports, module) { -var oop = require("pilot/oop"); -var dom = require("pilot/dom"); -var lang = require("pilot/lang"); -var EventEmitter = require("pilot/event_emitter").EventEmitter; - -var Text = function(parentEl) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - parentEl.appendChild(this.element); - - this.$characterSize = this.$measureSizes(); - this.$pollSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.EOF_CHAR = "¶"; - this.EOL_CHAR = "¬"; - this.TAB_CHAR = "→"; - this.SPACE_CHAR = "·"; - - this.setTokenizer = function(tokenizer) { - this.tokenizer = tokenizer; - }; - - this.getLineHeight = function() { - return this.$characterSize.height || 1; - }; - - this.getCharacterWidth = function() { - return this.$characterSize.width || 1; - }; - - this.$pollSizeChanges = function() { - var self = this; - setInterval(function() { - var size = self.$measureSizes(); - if (self.$characterSize.width !== size.width || self.$characterSize.height !== size.height) { - self.$characterSize = size; - self._dispatchEvent("changeCharaterSize", {data: size}); - } - }, 500); - }; - - this.$fontStyles = { - fontFamily : 1, - fontSize : 1, - fontWeight : 1, - fontStyle : 1, - lineHeight : 1 - }, - - this.$measureSizes = function() { - var n = 1000; - if (!this.$measureNode) { - var measureNode = this.$measureNode = document.createElement("div"); - var style = measureNode.style; - - style.width = style.height = "auto"; - style.left = style.top = "-1000px"; - - style.visibility = "hidden"; - style.position = "absolute"; - style.overflow = "visible"; - style.whiteSpace = "nowrap"; - - // in FF 3.6 monospace fonts can have a fixed sub pixel width. - // that's why we have to measure many characters - // Note: characterWidth can be a float! - measureNode.innerHTML = lang.stringRepeat("Xy", n); - document.body.insertBefore(measureNode, document.body.firstChild); - } - - var style = this.$measureNode.style; - for (var prop in this.$fontStyles) { - var value = dom.computedStyle(this.element, prop); - style[prop] = value; - } - - var size = { - height: this.$measureNode.offsetHeight, - width: this.$measureNode.offsetWidth / (n * 2) - }; - return size; - }; - - this.setDocument = function(doc) { - this.doc = doc; - }; - - this.$showInvisibles = false; - this.setShowInvisibles = function(showInvisibles) { - this.$showInvisibles = showInvisibles; - }; - - this.$computeTabString = function() { - var tabSize = this.doc.getTabSize(); - if (this.$showInvisibles) { - var halfTab = (tabSize) / 2; - this.$tabString = "" - + new Array(Math.floor(halfTab)).join(" ") - + this.TAB_CHAR - + new Array(Math.ceil(halfTab)+1).join(" ") - + ""; - } else { - this.$tabString = new Array(tabSize+1).join(" "); - } - }; - - this.updateLines = function(layerConfig, firstRow, lastRow) { - this.$computeTabString(); - this.config = layerConfig; - - var first = Math.max(firstRow, layerConfig.firstRow); - var last = Math.min(lastRow, layerConfig.lastRow); - - var lineElements = this.element.childNodes; - var _self = this; - this.tokenizer.getTokens(first, last, function(tokens) { - for ( var i = first; i <= last; i++) { - var lineElement = lineElements[i - layerConfig.firstRow]; - if (!lineElement) - continue; - - var html = []; - _self.$renderLine(html, i, tokens[i-first].tokens); - lineElement.innerHTML = html.join(""); - } - }); - }; - - this.scrollLines = function(config) { - var _self = this; - - this.$computeTabString(); - var oldConfig = this.config; - this.config = config; - - if (!oldConfig || oldConfig.lastRow < config.firstRow) - return this.update(config); - - if (config.lastRow < oldConfig.firstRow) - return this.update(config); - - var el = this.element; - - if (oldConfig.firstRow < config.firstRow) - for (var row=oldConfig.firstRow; row config.lastRow) - for (var row=config.lastRow+1; row<=oldConfig.lastRow; row++) - el.removeChild(el.lastChild); - - appendTop(appendBottom); - - function appendTop(callback) { - if (config.firstRow < oldConfig.firstRow) { - _self.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1, function(fragment) { - if (el.firstChild) - el.insertBefore(fragment, el.firstChild); - else - el.appendChild(fragment); - callback(); - }); - } - else - callback(); - } - - function appendBottom() { - if (config.lastRow > oldConfig.lastRow) { - _self.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow, function(fragment) { - el.appendChild(fragment); - }); - } - } - }; - - this.$renderLinesFragment = function(config, firstRow, lastRow, callback) { - var fragment = document.createDocumentFragment(); - var _self = this; - this.tokenizer.getTokens(firstRow, lastRow, function(tokens) { - for (var row=firstRow; row<=lastRow; row++) { - var lineEl = document.createElement("div"); - lineEl.className = "ace_line"; - var style = lineEl.style; - style.height = _self.$characterSize.height + "px"; - style.width = config.width + "px"; - - var html = []; - _self.$renderLine(html, row, tokens[row-firstRow].tokens); - lineEl.innerHTML = html.join(""); - fragment.appendChild(lineEl); - } - callback(fragment); - }); - }; - - this.update = function(config) { - this.$computeTabString(); - this.config = config; - - var html = []; - var _self = this; - this.tokenizer.getTokens(config.firstRow, config.lastRow, function(tokens) { - for ( var i = config.firstRow; i <= config.lastRow; i++) { - html.push("
    "); - _self.$renderLine(html, i, tokens[i-config.firstRow].tokens), html.push("
    "); - } - - _self.element.innerHTML = html.join(""); - }); - }; - - this.$textToken = { - "text": true, - "rparen": true, - "lparen": true - }; - - this.$renderLine = function(stringBuilder, row, tokens) { -// if (this.$showInvisibles) { -// var self = this; -// var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+/g; -// var spaceReplace = function(space) { -// var space = new Array(space.length+1).join(self.SPACE_CHAR); -// return "" + space + ""; -// }; -// } -// else { - var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g; - var spaceReplace = " "; -// } - - for ( var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - - var output = token.value - .replace(/&/g, "&") - .replace(/", output, ""); - } - else { - stringBuilder.push(output); - } - }; - - if (this.$showInvisibles) { - if (row !== this.doc.getLength() - 1) { - stringBuilder.push("" + this.EOL_CHAR + ""); - } else { - stringBuilder.push("" + this.EOF_CHAR + ""); - } - } - }; - -}).call(Text.prototype); - -exports.Text = Text; - -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/doc_comment_highlight_rules', function(require, exports, module) { - -var oop = require("pilot/oop"); +var Tokenizer = require("ace/tokenizer").Tokenizer; var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; -var DocCommentHighlightRules = function() { - - this.$rules = { - "start" : [ { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : "start" - }, { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, { - token : "comment.doc", - regex : "\s+" - }, { - token : "comment.doc", - regex : "TODO" - }, { - token : "comment.doc", - regex : "[^@\\*]+" - }, { - token : "comment.doc", - regex : "." - }] - }; +var Mode = function() { + this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); }; -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - (function() { - this.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next: start - }; + this.getTokenizer = function() { + return this.$tokenizer; }; -}).call(DocCommentHighlightRules.prototype); + this.toggleCommentLines = function(state, doc, startRow, endRow) { + return 0; + }; -exports.DocCommentHighlightRules = DocCommentHighlightRules; + this.getNextLineIndent = function(state, line, tab) { + return ""; + }; + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.autoOutdent = function(state, doc, row) { + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(Mode.prototype); + +exports.Mode = Mode; }); /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -11458,6 +11150,83 @@ exports.Mode = Mode; * * ***** END LICENSE BLOCK ***** */ +define('ace/mode/text_highlight_rules', function(require, exports, module) { + +var TextHighlightRules = function() { + + // regexp must not have capturing parentheses + // regexps are ordered -> the first match is used + + this.$rules = { + "start" : [ { + token : "text", + regex : ".+" + } ] + }; +}; + +(function() { + + this.addRules = function(rules, prefix) { + for (var key in rules) { + var state = rules[key]; + for (var i=0; i + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define('ace/mode/javascript_highlight_rules', function(require, exports, module) { var oop = require("pilot/oop"); @@ -11594,6 +11363,91 @@ JavaScriptHighlightRules = function() { oop.inherits(JavaScriptHighlightRules, TextHighlightRules); exports.JavaScriptHighlightRules = JavaScriptHighlightRules; +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('ace/mode/doc_comment_highlight_rules', function(require, exports, module) { + +var oop = require("pilot/oop"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + + this.$rules = { + "start" : [ { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : "start" + }, { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, { + token : "comment.doc", + regex : "\s+" + }, { + token : "comment.doc", + regex : "TODO" + }, { + token : "comment.doc", + regex : "[^@\\*]+" + }, { + token : "comment.doc", + regex : "." + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +(function() { + + this.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next: start + }; + }; + +}).call(DocCommentHighlightRules.prototype); + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + }); /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -11714,125 +11568,142 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent; * * ***** END LICENSE BLOCK ***** */ -define('ace/mode/text', function(require, exports, module) { +define('ace/mode/javascript_highlight_rules', function(require, exports, module) { -var Tokenizer = require("ace/tokenizer").Tokenizer; +var oop = require("pilot/oop"); +var lang = require("pilot/lang"); +var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules; var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; -var Mode = function() { - this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); -}; +JavaScriptHighlightRules = function() { -(function() { + var docComment = new DocCommentHighlightRules(); - this.getTokenizer = function() { - return this.$tokenizer; - }; + var keywords = lang.arrayToMap( + ("break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with").split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("null|Infinity|NaN|undefined").split("|") + ); + + var futureReserved = lang.arrayToMap( + ("class|enum|extends|super|const|export|import|implements|let|private|" + + "public|yield|interface|package|protected|static").split("|") + ); - this.toggleCommentLines = function(state, doc, startRow, endRow) { - return 0; - }; - - this.getNextLineIndent = function(state, line, tab) { - return ""; - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.autoOutdent = function(state, doc, row) { - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - -}).call(Mode.prototype); - -exports.Mode = Mode; -}); -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Ajax.org Code Editor (ACE). - * - * The Initial Developer of the Original Code is - * Ajax.org Services B.V. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Fabian Jakobs - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('ace/mode/text_highlight_rules', function(require, exports, module) { - -var TextHighlightRules = function() { - - // regexp must not have capturing parentheses + // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used this.$rules = { - "start" : [ { - token : "text", - regex : ".+" - } ] + "start" : [ + { + token : "comment", + regex : "\\/\\/.*$" + }, + docComment.getStartRule("doc-start"), + { + token : "comment", // multi line comment + regex : "\\/\\*", + next : "comment" + }, { + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)" + }, { + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + }, { + token : "string", // multi line string start + regex : '["].*\\\\$', + next : "qqstring" + }, { + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + }, { + token : "string", // multi line string start + regex : "['].*\\\\$", + next : "qstring" + }, { + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" + }, { + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + }, { + token : "constant.language.boolean", + regex : "(?:true|false)\\b" + }, { + token : function(value) { + if (value == "this") + return "variable.language"; + else if (keywords[value]) + return "keyword"; + else if (buildinConstants[value]) + return "constant.language"; + else if (futureReserved[value]) + return "invalid.illegal"; + else if (value == "debugger") + return "invalid.deprecated"; + else + return "identifier"; + }, + // TODO: Unicode escape sequences + // TODO: Unicode identifiers + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : "keyword.operator", + regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + }, { + token : "lparen", + regex : "[[({]" + }, { + token : "rparen", + regex : "[\\])}]" + }, { + token : "text", + regex : "\\s+" + } + ], + "comment" : [ + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + next : "start" + }, { + token : "comment", // comment spanning whole line + regex : ".+" + } + ], + "qqstring" : [ + { + token : "string", + regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', + next : "start" + }, { + token : "string", + regex : '.+' + } + ], + "qstring" : [ + { + token : "string", + regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", + next : "start" + }, { + token : "string", + regex : '.+' + } + ] }; + + this.addRules(docComment.getRules(), "doc-"); + this.$rules["doc-start"][0].next = "start"; }; -(function() { +oop.inherits(JavaScriptHighlightRules, TextHighlightRules); - this.addRules = function(rules, prefix) { - for (var key in rules) { - var state = rules[key]; - for (var i=0; iw)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=!0,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'

    Welcome to Skywriter - Code in the Cloud

    ',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=!0),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push('"),d.push(""),d.push("")}d.push("
    '+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}},versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:!0,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}},skywriterCommandSpec={name:"skywriter",hidden:!0,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}},messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."],canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:!0,isKeyUp:!0},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}},e={name:"historyNext",predicates:{isCommandLine:!0,isKeyUp:!0},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}},g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+"
    "})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(!0){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div"),c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c!==null&&c!==undefined&&c!==""&&(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){function e(){return{settings:d}}var d=a("pilot/settings").settings;b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,!1);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return!1},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}function e(a){c(a);return b.stopPropagation(a)}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseup",e,!0),a.stopPropagation()}function d(a){b(a),a.stopPropagation()}document.addEventListener("mousemove",d,!0),document.addEventListener("mouseup",e,!0)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0,i,j,k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return!1}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return!0;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return!0}if(f(a))return g(a);return!0},!1),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return!0;return g(a)},!1)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return Array(b+1).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status==this.STARTED&&(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console"),e=a("pilot/stacktrace").Trace,f=-1,g=0,h=1,i=0,j=!1,k=[],l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=!0,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise,c=[],d=0,e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c),f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(skywriter.proxy&&skywriter.proxy.xhr)skywriter.proxy.xhr.call(this,a,b,c,e,f);else{var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===4){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}return f},b.Worker=function(a){return skywriter.proxy&&skywriter.proxy.worker?new skywriter.proxy.worker(a):new Worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end,d={row:b.row,col:b.col},e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c),g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift(),j=b.comparePositions(h.start,i.start),k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){function l(){}function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}var d=a("pilot/console"),e=a("pilot/oop"),f=a("pilot/types"),g=a("pilot/event_emitter").EventEmitter,h=a("pilot/catalog"),i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)},j.prototype={get:function(){return this.value},set:function(a){this.value!==a&&(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g),k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k,l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType,e=a("pilot/types/basic").DeferredType,f=a("pilot/types"),g=a("pilot/settings").settings,h,i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}}),j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=!1;while(!0){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=!0}c&&a.predictions.push(b)}}return a}}),k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent,f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+" 1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date,d=c.currentLine,e=c.textLines,f=0,g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=!0);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d),d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("pilot/event_emitter").EventEmitter,g=a("ace/selection").Selection,h=a("ace/mode/text").Mode,i=a("ace/range").Range,j=function(a,b){this.modified=!0,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=!0,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){this.$useSoftTabs!==a&&(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){!isNaN(a)&&this.$tabSize!==a&&(this.modified=!0,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e),d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],d=b.column,e=b.row,f=1,g=this.getLine(e),h=this.getLength();while(!0){while(d=h)break;var g=this.getLine(e),d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(b.length!=0){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=!0,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"",g=e.substring(0,a.column)+d[0],h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],!0),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),!0);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=!0;var d=a.start.row,e=a.end.row,f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,!0),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,!0),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize(),d=0,e=b,f=this.getLine(a).split("\t");for(var g=0;gh){d+=h;break}d+=e;break}e-=h+c,d+=h+1}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/event"),f=a("pilot/lang"),g=a("ace/textinput").TextInput,h=a("ace/keybinding").KeyBinding,i=a("ace/document").Document,j=a("ace/search").Search,k=a("ace/background_tokenizer").BackgroundTokenizer,l=a("ace/range").Range,m=a("pilot/event_emitter").EventEmitter,n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=!1,this.$search=(new j).set({wrap:!0}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(this.doc!=a){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition(),b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange(),b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(this.mode!=a){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a),c=e.getDocumentY(a),d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this,g,h,i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)},j=function(){clearInterval(l),f.$clickSelection=null},k=function(){if(g!==undefined&&h!==undefined){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a),f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString()),h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=!1,this.setOverwrite=function(a){this.$overwrite!=a&&(this.$overwrite=a,this.$blockScrolling=!0,this.onCursorChange(),this.$blockScrolling=!1,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle!=a&&(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){this.$highlightActiveLine!=a&&(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()!=a&&this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row>=b.end.row&&b.start.column>=b.end.column){var e;if(this.doc.getUseSoftTabs()){var g=a.getTabSize(),h=this.getCursorPosition(),i=a.documentToScreenColumn(h.row,h.column),d=g-i%g;e=f.stringRepeat(" ",d)}else e="\t";return this.onTextInput(e)}var c=this.$getSelectedRows(),d=a.indentRows(c.first,c.last,"\t");this.selection.shiftSelection(d)}},this.blockOutdent=function(){if(!this.$readOnly){var a=this.doc.getSelection(),b=this.doc.outdentRows(a.getRange());a.setSelectionRange(b,a.isBackwards()),this.$updateDesiredColumn()}},this.toggleCommentLines=function(){if(!this.$readOnly){var a=this;this.bgTokenizer.getState(this.getCursorPosition().row,function(b){var c=a.$getSelectedRows(),d=a.mode.toggleCommentLines(b,a.doc,c.first,c.last);a.selection.shiftSelection(d)})}},this.removeLines=function(){if(!this.$readOnly){var a=this.$getSelectedRows();this.selection.setSelectionAnchor(a.last+1,0),this.selection.selectTo(a.first,0),this.doc.remove(this.getSelectionRange()),this.clearSelection()}},this.moveLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesDown(a,b)})},this.moveLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.moveLinesUp(a,b)})},this.copyLinesUp=function(){this.$readOnly||this.$moveLines(function(a,b){this.doc.duplicateLines(a,b);return 0})},this.copyLinesDown=function(){this.$readOnly||this.$moveLines(function(a,b){return this.doc.duplicateLines(a,b)})},this.$moveLines=function(a){var b=this.$getSelectedRows(),c=a.call(this,b.first,b.last),d=this.selection;d.setSelectionAnchor(b.last+c+1,0),d.$moveSelection(function(){d.moveCursorTo(b.first+c,0)})},this.$getSelectedRows=function(){var a=this.getSelectionRange().collapseRows();return{first:a.start.row,last:a.end.row}},this.onCompositionStart=function(a){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(a){this.renderer.setCompositionText(a)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(a){return a>=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow(),b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow(),b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=!0,this.moveCursorTo(a-1,b||0),this.$blockScrolling=!1,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition(),b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a),b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent"),e=a("pilot/event"),f=a("ace/conf/keybindings/default_mac").bindings,g=a("ace/conf/keybindings/default_win").bindings,h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode],i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()],j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){function c(a,c){var d,e,f,g,h={};for(d in a){g=a[d];if(c&&typeof g=="string"){g=g.split(c);for(e=0,f=g.length;e",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range,e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row,g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight,f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(e>=0){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc),e=d.lineHeight,f=Math.round((b.end.column-b.start.column)*d.characterWidth),g=(b.start.row-d.firstRow)*d.lineHeight,h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/dom"),f=a("pilot/lang"),g=a("pilot/event_emitter").EventEmitter,h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=!1,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=a.getSelection().getCursor(),e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(a){var b=d.row,c=j(b),g=d.column,k=!1;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=!0),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=a.getSelection().getRange(),d=b?c.end:c.start,e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead,b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=!1;this.selectionAnchor||(b=!0,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=!0;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead,b=a.column,c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc,b=a.getTabSize(),c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.rowa&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth"+Array(Math.floor(b)).join(" ")+this.TAB_CHAR+Array(Math.ceil(b)+1).join(" ")+""}else this.$tabString=Array(a+1).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow),e=Math.min(c,a.lastRow),f=this.element.childNodes,g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){function g(){a.lastRow>c.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}function f(e){a.firstRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;ew)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

    Welcome to Skywriter - Code in the Cloud

    ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
    "+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
    "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"]).then(function(){})});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file From 5919f7ddae2885c27728f2024df053b07c0459f5 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 13:30:27 +0000 Subject: [PATCH 28/90] fixed handing of strings vs buffers and removed some old cruft --- Makefile.dryice.js | 97 +++++++++------------------------------------- 1 file changed, 18 insertions(+), 79 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 5d404ab8..b528a8d2 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -204,7 +204,7 @@ function addSource(obj, source) { } function addSourceFile(obj, filename) { - var read = fs.readFileSync(filename).toString(); + var read = fs.readFileSync(filename); obj.sources.push({ name: filename, value: runFilters(read, obj.filter, true, filename) @@ -212,7 +212,7 @@ function addSourceFile(obj, filename) { } function addSourceBase(obj, baseObj) { - var read = fs.readFileSync(baseObj.base + baseObj.path).toString(); + var read = fs.readFileSync(baseObj.base + baseObj.path); obj.sources.push({ name: baseObj, value: runFilters(read, obj.filter, true, baseObj) @@ -344,6 +344,10 @@ copy.filter = {}; * @return string output */ copy.filter.uglifyjs = function(input) { + if (typeof input !== 'string') { + input = input.toString(); + } + var opt = copy.filter.uglifyjs.options; var ast = ujs.parser.parse(input, opt.parse_strict_semicolons); @@ -392,6 +396,10 @@ copy.filter.uglifyjs.options = { * A filter to munge CommonJS headers */ copy.filter.addDefines = function(input, source) { + if (typeof input !== 'string') { + input = input.toString(); + } + if (!source) { throw new Error('Missing filename for moduleDefines'); } @@ -412,7 +420,10 @@ copy.filter.addDefines.onRead = true; /** * */ -copy.filter.base64 = function() { +copy.filter.base64 = function(input, source) { + if (typeof input !== 'string') { + input = input.toString(); + } }; copy.filter.base64.onRead = true; @@ -421,6 +432,10 @@ copy.filter.base64.onRead = true; * */ copy.filter.moduleDefines = function(input, source) { + if (typeof input !== 'string') { + input = input.toString(); + } + if (!source) { throw new Error('Missing filename for moduleDefines'); } @@ -449,82 +464,6 @@ exports.copy = copy; - - -/* -// copy a single file -copy({ source: 'foo.txt', dest: 'bar.txt' }); - -// copy a directory -copy({ source: 'foo', dest: 'bar' }); - -// cat a bunch of files together -copy({ source: [ 'file1.js', 'file2.js' ], dest: 'output.js' }); - -// cat files together using a glob pattern -copy({ source: /.js$/, dest: 'built.js' }); - -// cat together a custom set of files -copy({ - source: function() { - var files = [ 'file1.js' ]; - if (baz) files.push('file2.js'); - return files; - }, - dest: 'built.js' -}); - -// some utils are available to custom functions -copy({ - source: function() { - var files = filesMatching(/.js$/); - arrayRemove(files, 'broken.js'); - return files; - }, - dest: 'built.js' -}); - -// maybe one day we could add multiple destinations -copy({ - source: /src/.*\.js$/, - dest: [ /\(*\)\.js$/, '\1.js.bak' ] -}); - -// use a filter while copying -copy({ - source: /src/.*\.js$/, - filter: compressor, - dest: 'built.js' -}); - -// and you can have multiple (custom) filters -copy({ - source: /src/.*\.js$/, - filter: [ - compressor, - function(name, data) { - return 'wibble'; - } - ], - dest: 'built.js' -}); - -// I think it's possible to see a huge array of operations in these terms. -// I'm not suggesting you implement these, just demoing what the API could do -copy({ - source: '**', - filter: [ zip ], - dest: 'scp://example.com/upload/myproject-0.1.zip' -}); - -copy({ - source: /src/.*\.java$/, - filter: javac, - dest: [ /\(*\)\.java$/, '\1.class' ], - comment: 'only joking' -}); -*/ - return exports; }; From d28e826e9ff7d0a0900e39d05876d060123b38fa Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 13:30:47 +0000 Subject: [PATCH 29/90] updated build --- build/ace-uncompressed.js | 8 +------- build/ace.js | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index dacdd1f1..0e4e8d73 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -10402,7 +10402,6 @@ var VirtualRenderer = function(container, theme) { var changes = this.CHANGE_SIZE; var height = dom.getInnerHeight(this.container); -console.log('height: ', height, ' this.$size.height: ', this.$size.height); if (this.$size.height != height) { this.$size.height = height; @@ -10416,7 +10415,6 @@ console.log('height: ', height, ' this.$size.height: ', this.$size.height); } var width = dom.getInnerWidth(this.container); -console.log('width: ', width, ' this.$size.width: ', this.$size.width); if (this.$size.width != width) { this.$size.width = width; @@ -10424,14 +10422,10 @@ console.log('width: ', width, ' this.$size.width: ', this.$size.width); this.scroller.style.left = gutterWidth + "px"; this.scroller.style.width = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()) + "px"; } -console.log('this.scroller.style.width: ', this.scroller.style.width); this.$size.scrollerWidth = this.scroller.clientWidth; this.$size.scrollerHeight = this.scroller.clientHeight; this.$loop.schedule(changes); -console.log('this.$size.scrollerWidth: ', this.$size.scrollerWidth); -console.log('this.$size.scrollerHeight: ', this.$size.scrollerHeight); -console.log('changes: ', changes); }; this.setTokenizer = function(tokenizer) { @@ -10553,7 +10547,7 @@ console.log('changes: ', changes); this.$renderChanges = function(changes) { if (!changes || !this.doc || !this.$tokenizer) return; - + // text, scrolling and resize changes can cause the view port size to change if (!this.layerConfig || changes & this.CHANGE_FULL || diff --git a/build/ace.js b/build/ace.js index 1a987801..91a0b567 100644 --- a/build/ace.js +++ b/build/ace.js @@ -1 +1 @@ -function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

    Welcome to Skywriter - Code in the Cloud

    ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
    "+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
    "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"]).then(function(){})});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file +function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

    Welcome to Skywriter - Code in the Cloud

    ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
    "+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
    "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"]).then(function(){})});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file From de202c1eeec6775510c6c807380e99a6764a50bd Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 14:06:12 +0000 Subject: [PATCH 30/90] tweak build file to make it easy to select which components to include --- Makefile.dryice.js | 93 +++++++++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index b528a8d2..bc224227 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -40,22 +40,44 @@ var copy = internalRequire('dryice').copy; var aceHome = __dirname; -var buildStep = copy.createDataObject(); - -// The Javascript files that don't need unwrapping +// Pilot sources +var pilot = copy.createDataObject(); copy({ - source: [ 'demo/mini_require.js' ], - dest: buildStep + source: [ { + root: aceHome + '/support/cockpit/support/pilot/lib', + include: /.*\.js$/, + exclude: /tests?\// + } ], + filter: [ copy.filter.moduleDefines ], + dest: pilot }); -// JS files that we tweak the define lines on +// Cockpit sources +var cockpit = copy.createDataObject(); +copy({ + source: [ { + root: aceHome + '/support/cockpit/lib', + include: /.*\.js$/, + exclude: /tests?\// + } ], + filter: [ copy.filter.moduleDefines ], + dest: cockpit +}); +/* +// The graphics files +copy({ + source: sources.map(function(source) { + return { root: aceHome, include: source + '/.*\\.png$' }; + }, this), + filter: [ copy.filter.base64, copy.filter.addDefines ], + dest: cockpit +}); +*/ + +// Ace sources +var ace = copy.createDataObject(); copy({ source: [ - { - root: aceHome + '/support/cockpit/support/pilot/lib', - include: /.*\.js$/, - exclude: /tests?\// - }, // Exclude all themes/modes so we can just include textmate/js { root: aceHome + '/lib', @@ -69,55 +91,49 @@ copy({ { base: aceHome + '/lib/', path: 'ace/mode/javascript_highlight_rules.js' }, { base: aceHome + '/lib/', path: 'ace/mode/doc_comment_highlight_rules.js' }, { base: aceHome + '/lib/', path: 'ace/mode/matching_brace_outdent.js' }, - { base: aceHome + '/lib/', path: 'ace/mode/javascript_highlight_rules.js' }, + { base: aceHome + '/lib/', path: 'ace/mode/javascript_highlight_rules.js' } ], filter: [ copy.filter.moduleDefines ], - dest: buildStep + dest: ace }); - -// The CSS files copy({ - source: [ - { + source: [ { root: aceHome + '/lib', include: /tm\.css|editor\.css/, exclude: /tests?\// - } - ], + } ], filter: [ copy.filter.addDefines ], - dest: buildStep + dest: ace }); -/* -// The graphics files +// Piece together the parts that we want +var data = copy.createDataObject(); copy({ - source: sources.map(function(source) { - return { root: aceHome, include: source + '/.*\\.png$' }; - }, this), - filter: [ copy.filter.base64, copy.filter.addDefines ], - dest: buildStep -}); -*/ - -// The Javascript files that don't need unwrapping -copy({ - source: [ 'demo/build_boot.js' ], - dest: buildStep + source: [ + 'demo/mini_require.js', + pilot, + // cockpit, + ace, + 'demo/build_boot.js' + ], + dest: data }); // Create the compressed and uncompressed output files copy({ - source: buildStep, + source: data, filter: copy.filter.uglifyjs, dest: 'build/ace.js' }); copy({ - source: buildStep, + source: data, dest: 'build/ace-uncompressed.js' }); + + function internalRequire(ignore) { var exports = {}; @@ -421,10 +437,11 @@ copy.filter.addDefines.onRead = true; * */ copy.filter.base64 = function(input, source) { - if (typeof input !== 'string') { - input = input.toString(); + if (typeof input === 'string') { + throw new Error('base64 filter needs to be the first in a filter set'); } + return 'define("text!' + source.toString() + '", ' + input + ');\n\n'; }; copy.filter.base64.onRead = true; From ed9b0d4f0a065f8d633a996eca2ee935b8e2c28f Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 12 Jan 2011 15:32:53 +0100 Subject: [PATCH 31/90] the document's lines array is no longer public --- lib/ace/background_tokenizer.js | 18 +++++----- lib/ace/document.js | 60 ++++++++++++++++----------------- lib/ace/editor.js | 2 +- lib/ace/test/mockrenderer.js | 4 +-- lib/ace/virtual_renderer.js | 5 ++- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/lib/ace/background_tokenizer.js b/lib/ace/background_tokenizer.js index a95da503..dba3a9e6 100644 --- a/lib/ace/background_tokenizer.js +++ b/lib/ace/background_tokenizer.js @@ -42,7 +42,7 @@ var EventEmitter = require("pilot/event_emitter").EventEmitter; var BackgroundTokenizer = function(tokenizer, editor) { this.running = false; - this.textLines = []; + this.doc = []; this.lines = []; this.currentLine = 0; this.tokenizer = tokenizer; @@ -54,12 +54,13 @@ var BackgroundTokenizer = function(tokenizer, editor) { var workerStart = new Date(); var startLine = self.currentLine; - var textLines = self.textLines; + var doc = self.doc; var processedLines = 0; var lastVisibleRow = editor.getLastVisibleRow(); - while (self.currentLine < textLines.length) { + var len = doc.getLength(); + while (self.currentLine < len) { self.lines[self.currentLine] = self.$tokenizeRows(self.currentLine, self.currentLine)[0]; self.currentLine++; @@ -76,7 +77,7 @@ var BackgroundTokenizer = function(tokenizer, editor) { self.running = false; - self.fireUpdateEvent(startLine, textLines.length - 1); + self.fireUpdateEvent(startLine, len - 1); }; }; @@ -91,8 +92,8 @@ var BackgroundTokenizer = function(tokenizer, editor) { this.start(0); }; - this.setLines = function(textLines) { - this.textLines = textLines; + this.setDocument = function(doc) { + this.doc = doc; this.lines = []; this.stop(); @@ -108,7 +109,7 @@ var BackgroundTokenizer = function(tokenizer, editor) { this.start = function(startRow) { this.currentLine = Math.min(startRow || 0, this.currentLine, - this.textLines.length); + this.doc.getLength()); // remove all cached items below this line this.lines.splice(this.currentLine, this.lines.length); @@ -143,9 +144,10 @@ var BackgroundTokenizer = function(tokenizer, editor) { doCache = true; } + var lines = this.doc.getLines(firstRow, lastRow); for (var row=firstRow; row<=lastRow; row++) { if (!this.lines[row]) { - var tokens = this.tokenizer.getLineTokens(this.textLines[row] || "", state); + var tokens = this.tokenizer.getLineTokens(lines[row-firstRow] || "", state); var state = tokens.state; rows.push(tokens); diff --git a/lib/ace/document.js b/lib/ace/document.js index e7d933d6..c7892eaf 100644 --- a/lib/ace/document.js +++ b/lib/ace/document.js @@ -47,7 +47,7 @@ var Range = require("ace/range").Range; var Document = function(text, mode) { this.modified = true; - this.lines = []; + this.$lines = []; this.selection = new Selection(this); this.$breakpoints = []; @@ -81,15 +81,15 @@ var Document = function(text, mode) { }; this.setValue = function(text) { - var args = [0, this.lines.length]; + var args = [0, this.$lines.length]; args.push.apply(args, this.$split(text)); - this.lines.splice.apply(this.lines, args); + this.$lines.splice.apply(this.$lines, args); this.modified = true; this.fireChangeEvent(0); }; this.toString = function() { - return this.lines.join(this.$getNewLineCharacter()); + return this.$lines.join(this.$getNewLineCharacter()); }; this.getSelection = function() { @@ -306,7 +306,7 @@ var Document = function(text, mode) { if (this.modified) { this.modified = false; - var lines = this.lines; + var lines = this.$lines; var longestLine = 0; var longestScreenLine = 0; var tabSize = this.getTabSize(); @@ -330,7 +330,7 @@ var Document = function(text, mode) { * Get a verbatim copy of the given line as it is in the document */ this.getLine = function(row) { - return this.lines[row] || ""; + return this.$lines[row] || ""; }; /** @@ -338,27 +338,27 @@ var Document = function(text, mode) { */ this.getDisplayLine = function(row) { var tab = new Array(this.getTabSize()+1).join(" "); - return this.lines[row].replace(/\t/g, tab); + return this.$lines[row].replace(/\t/g, tab); }; this.getLines = function(firstRow, lastRow) { - return this.lines.slice(firstRow, lastRow+1); + return this.$lines.slice(firstRow, lastRow+1); }; this.getLength = function() { - return this.lines.length; + return this.$lines.length; }; this.getTextRange = function(range) { if (range.start.row == range.end.row) { - return this.lines[range.start.row].substring(range.start.column, + return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { var lines = []; - lines.push(this.lines[range.start.row].substring(range.start.column)); + lines.push(this.$lines[range.start.row].substring(range.start.column)); lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.lines[range.end.row].substring(0, range.end.column)); + lines.push(this.$lines[range.end.row].substring(0, range.end.column)); return lines.join(this.$getNewLineCharacter()); } }; @@ -466,7 +466,7 @@ var Document = function(text, mode) { * @param rows Array[Integer] sorted list of rows */ this.multiRowInsert = function(rows, column, text) { - var lines = this.lines; + var lines = this.$lines; for (var i=rows.length-1; i>=0; i--) { var row = rows[i]; @@ -507,7 +507,7 @@ var Document = function(text, mode) { var args = [row, 0]; args.push.apply(args, lines); - this.lines.splice.apply(this.lines, args); + this.$lines.splice.apply(this.$lines, args); if (!fromUndo && this.$undoManager) { var nl = this.$getNewLineCharacter(); @@ -525,16 +525,16 @@ var Document = function(text, mode) { return position; this.modified = true; - if (this.lines.length <= 1) { + if (this.$lines.length <= 1) { this.$detectNewLine(text); } var newLines = this.$split(text); if (this.$isNewLine(text)) { - var line = this.lines[position.row] || ""; - this.lines[position.row] = line.substring(0, position.column); - this.lines.splice(position.row + 1, 0, line.substring(position.column)); + var line = this.$lines[position.row] || ""; + this.$lines[position.row] = line.substring(0, position.column); + this.$lines.splice(position.row + 1, 0, line.substring(position.column)); var end = { row : position.row + 1, @@ -542,8 +542,8 @@ var Document = function(text, mode) { }; } else if (newLines.length == 1) { - var line = this.lines[position.row] || ""; - this.lines[position.row] = line.substring(0, position.column) + text + var line = this.$lines[position.row] || ""; + this.$lines[position.row] = line.substring(0, position.column) + text + line.substring(position.column); var end = { @@ -552,11 +552,11 @@ var Document = function(text, mode) { }; } else { - var line = this.lines[position.row] || ""; + var line = this.$lines[position.row] || ""; var firstLine = line.substring(0, position.column) + newLines[0]; var lastLine = newLines[newLines.length - 1] + line.substring(position.column); - this.lines[position.row] = firstLine; + this.$lines[position.row] = firstLine; this.$insertLines(position.row + 1, [lastLine], true); if (newLines.length > 2) { @@ -603,7 +603,7 @@ var Document = function(text, mode) { var height = range.end.row - rows[0]; for (var i=rows.length-1; i>=0; i--) { var row = rows[i]; - if (row >= this.lines.length) + if (row >= this.$lines.length) continue; var end = this.$remove(new Range(row, range.start.column, row+height, range.end.column), false); @@ -640,9 +640,9 @@ var Document = function(text, mode) { + this.getLine(lastRow).substring(range.end.column); if (row != "") - this.lines.splice(firstRow, lastRow - firstRow + 1, row); + this.$lines.splice(firstRow, lastRow - firstRow + 1, row); else - this.lines.splice(firstRow, lastRow - firstRow + 1, ""); + this.$lines.splice(firstRow, lastRow - firstRow + 1, ""); return range.start; }; @@ -743,8 +743,8 @@ var Document = function(text, mode) { this.moveLinesUp = function(firstRow, lastRow) { if (firstRow <= 0) return 0; - var removed = this.lines.slice(firstRow, lastRow + 1); - this.$remove(new Range(firstRow-1, this.lines[firstRow-1].length, lastRow, this.lines[lastRow].length)); + var removed = this.$lines.slice(firstRow, lastRow + 1); + this.$remove(new Range(firstRow-1, this.$lines[firstRow-1].length, lastRow, this.$lines[lastRow].length)); this.$insertLines(firstRow - 1, removed); this.fireChangeEvent(firstRow - 1, lastRow); @@ -752,9 +752,9 @@ var Document = function(text, mode) { }; this.moveLinesDown = function(firstRow, lastRow) { - if (lastRow >= this.lines.length-1) return 0; + if (lastRow >= this.$lines.length-1) return 0; - var removed = this.lines.slice(firstRow, lastRow + 1); + var removed = this.$lines.slice(firstRow, lastRow + 1); this.$remove(new Range(firstRow, 0, lastRow + 1, 0)); this.$insertLines(firstRow+1, removed); @@ -776,7 +776,7 @@ var Document = function(text, mode) { }; this.$clipRowToDocument = function(row) { - return Math.max(0, Math.min(row, this.lines.length-1)); + return Math.max(0, Math.min(row, this.$lines.length-1)); }; this.documentToScreenColumn = function(row, docColumn) { diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 1c2f2f72..15f51598 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -151,7 +151,7 @@ var Editor =function(renderer, doc) { this.selection.addEventListener("changeSelection", this.$onSelectionChange); this.onDocumentModeChange(); - this.bgTokenizer.setLines(this.doc.lines); + this.bgTokenizer.setDocument(doc); this.bgTokenizer.start(0); this.onCursorChange(); diff --git a/lib/ace/test/mockrenderer.js b/lib/ace/test/mockrenderer.js index 61739218..833d4313 100644 --- a/lib/ace/test/mockrenderer.js +++ b/lib/ace/test/mockrenderer.js @@ -70,7 +70,7 @@ MockRenderer.prototype.getMouseEventTarget = function() { }; MockRenderer.prototype.setDocument = function(doc) { - this.lines = doc.lines; + this.doc = doc; }; MockRenderer.prototype.setTokenizer = function() { @@ -91,7 +91,7 @@ MockRenderer.prototype.scrollCursorIntoView = function() { }; MockRenderer.prototype.scrollToRow = function(row) { - var row = Math.min(this.lines.length - this.visibleRowCount, Math.max(0, + var row = Math.min(this.doc.getLength() - this.visibleRowCount, Math.max(0, row)); this.layerConfig.firstVisibleRow = row; this.layerConfig.lastVisibleRow = row + this.visibleRowCount; diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index b1a2c3a6..475af0be 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -134,7 +134,6 @@ var VirtualRenderer = function(container, theme) { oop.implement(this, EventEmitter); this.setDocument = function(doc) { - this.lines = doc.lines; this.doc = doc; this.$cursorLayer.setDocument(doc); this.$markerLayer.setDocument(doc); @@ -396,7 +395,7 @@ var VirtualRenderer = function(container, theme) { var lineCount = Math.ceil(minHeight / this.lineHeight); var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); - var lastRow = Math.max(0, Math.min(this.lines.length, firstRow + lineCount) - 1); + var lastRow = Math.max(0, Math.min(this.doc.getLength(), firstRow + lineCount) - 1); var layerConfig = this.layerConfig = { width : longestLine, @@ -531,7 +530,7 @@ var VirtualRenderer = function(container, theme) { }; this.scrollToY = function(scrollTop) { - var maxHeight = this.lines.length * this.lineHeight - this.$size.scrollerHeight; + var maxHeight = this.doc.getLength() * this.lineHeight - this.$size.scrollerHeight; var scrollTop = Math.max(0, Math.min(maxHeight, scrollTop)); if (this.scrollTop !== scrollTop) { From 36074ac3a462335fcabdff9a39f2c5373870b2b8 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 12 Jan 2011 15:33:31 +0100 Subject: [PATCH 32/90] make bg tokenizer API sync again --- lib/ace/background_tokenizer.js | 8 +-- lib/ace/editor.js | 113 +++++++++++++++----------------- lib/ace/layer/text.js | 99 +++++++++++----------------- 3 files changed, 98 insertions(+), 122 deletions(-) diff --git a/lib/ace/background_tokenizer.js b/lib/ace/background_tokenizer.js index dba3a9e6..f282c758 100644 --- a/lib/ace/background_tokenizer.js +++ b/lib/ace/background_tokenizer.js @@ -125,12 +125,12 @@ var BackgroundTokenizer = function(tokenizer, editor) { this.running = false; }; - this.getTokens = function(firstRow, lastRow, callback) { - callback(this.$tokenizeRows(firstRow, lastRow)); + this.getTokens = function(firstRow, lastRow) { + return this.$tokenizeRows(firstRow, lastRow); }; - this.getState = function(row, callback) { - callback(this.$tokenizeRows(row, row)[0].state); + this.getState = function(row) { + return this.$tokenizeRows(row, row)[0].state; }; this.$tokenizeRows = function(firstRow, lastRow) { diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 15f51598..85ef430a 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -422,64 +422,61 @@ var Editor =function(renderer, doc) { this.clearSelection(); - var _self = this; - this.bgTokenizer.getState(cursor.row, function (lineState) { - var shouldOutdent = _self.mode.checkOutdent(lineState, _self.doc.getLine(cursor.row), text); - var line = _self.doc.getLine(cursor.row), - lineIndent = _self.mode.getNextLineIndent(lineState, line.slice(0, cursor.column), _self.doc.getTabString()); - var end = _self.doc.insert(cursor, text); + var lineState = this.bgTokenizer.getState(cursor.row); + var shouldOutdent = this.mode.checkOutdent(lineState, this.doc.getLine(cursor.row), text); + var line = this.doc.getLine(cursor.row); + var lineIndent = this.mode.getNextLineIndent(lineState, line.slice(0, cursor.column), this.doc.getTabString()); + var end = this.doc.insert(cursor, text); - /* TODO: This shortcut is somehow broken - if (!shouldOutdent && line != _self.doc.getLine(row) && text != "\n") { - _self.moveCursorToPosition(end); - _self.renderer.scrollCursorIntoView(); - return; + /* TODO: This shortcut is somehow broken + if (!shouldOutdent && line != this.doc.getLine(row) && text != "\n") { + this.moveCursorToPosition(end); + this.renderer.scrollCursorIntoView(); + return; + } + */ + + var lineState = this.bgTokenizer.getState(cursor.row); + // multi line insert + if (cursor.row !== end.row) { + var size = this.doc.getTabSize(), + minIndent = Number.MAX_VALUE; + + for (var row = cursor.row + 1; row <= end.row; ++row) { + var indent = 0; + + line = this.doc.getLine(row); + for (var i = 0; i < line.length; ++i) + if (line.charAt(i) == '\t') + indent += size; + else if (line.charAt(i) == ' ') + indent += 1; + else + break; + if (/[^\s]/.test(line)) + minIndent = Math.min(indent, minIndent); } - */ - _self.bgTokenizer.getState(cursor.row, function(lineState) { - // multi line insert - if (cursor.row !== end.row) { - var size = _self.doc.getTabSize(), - minIndent = Number.MAX_VALUE; + for (var row = cursor.row + 1; row <= end.row; ++row) { + var outdent = minIndent; - for (var row = cursor.row + 1; row <= end.row; ++row) { - var indent = 0; + line = this.doc.getLine(row); + for (var i = 0; i < line.length && outdent > 0; ++i) + if (line.charAt(i) == '\t') + outdent -= size; + else if (line.charAt(i) == ' ') + outdent -= 1; + this.doc.replace(new Range(row, 0, row, line.length), line.substr(i)); + } + end.column += this.doc.indentRows(cursor.row + 1, end.row, lineIndent); + } else { + if (shouldOutdent) { + end.column += this.mode.autoOutdent(lineState, this.doc, cursor.row); + } + } - line = _self.doc.getLine(row); - for (var i = 0; i < line.length; ++i) - if (line.charAt(i) == '\t') - indent += size; - else if (line.charAt(i) == ' ') - indent += 1; - else - break; - if (/[^\s]/.test(line)) - minIndent = Math.min(indent, minIndent); - } - - for (var row = cursor.row + 1; row <= end.row; ++row) { - var outdent = minIndent; - - line = _self.doc.getLine(row); - for (var i = 0; i < line.length && outdent > 0; ++i) - if (line.charAt(i) == '\t') - outdent -= size; - else if (line.charAt(i) == ' ') - outdent -= 1; - _self.doc.replace(new Range(row, 0, row, line.length), line.substr(i)); - } - end.column += _self.doc.indentRows(cursor.row + 1, end.row, lineIndent); - } else { - if (shouldOutdent) { - end.column += _self.mode.autoOutdent(lineState, _self.doc, cursor.row); - } - } - - _self.moveCursorToPosition(end); - _self.renderer.scrollCursorIntoView(); - }); - }); + this.moveCursorToPosition(end); + this.renderer.scrollCursorIntoView(); }; this.$overwrite = false; @@ -640,12 +637,10 @@ var Editor =function(renderer, doc) { if (this.$readOnly) return; - var _self = this; - this.bgTokenizer.getState(this.getCursorPosition().row, function(state) { - var rows = _self.$getSelectedRows() - var addedColumns = _self.mode.toggleCommentLines(state, _self.doc, rows.first, rows.last); - _self.selection.shiftSelection(addedColumns); - }); + var state = this.bgTokenizer.getState(this.getCursorPosition().row); + var rows = this.$getSelectedRows() + var addedColumns = this.mode.toggleCommentLines(state, this.doc, rows.first, rows.last); + this.selection.shiftSelection(addedColumns); }; this.removeLines = function() { diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 736f112a..ca103ead 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -160,23 +160,19 @@ var Text = function(parentEl) { var last = Math.min(lastRow, layerConfig.lastRow); var lineElements = this.element.childNodes; - var _self = this; - this.tokenizer.getTokens(first, last, function(tokens) { - for ( var i = first; i <= last; i++) { - var lineElement = lineElements[i - layerConfig.firstRow]; - if (!lineElement) - continue; + var tokens = this.tokenizer.getTokens(first, last); + for (var i=first; i<=last; i++) { + var lineElement = lineElements[i - layerConfig.firstRow]; + if (!lineElement) + continue; - var html = []; - _self.$renderLine(html, i, tokens[i-first].tokens); - dom.setInnerHtml(lineElement, html.join("")); - } - }); + var html = []; + this.$renderLine(html, i, tokens[i-first].tokens); + dom.setInnerHtml(lineElement, html.join("")); + } }; this.scrollLines = function(config) { - var _self = this; - this.$computeTabString(); var oldConfig = this.config; this.config = config; @@ -197,50 +193,37 @@ var Text = function(parentEl) { for (var row=config.lastRow+1; row<=oldConfig.lastRow; row++) el.removeChild(el.lastChild); - appendTop(appendBottom); - - function appendTop(callback) { - if (config.firstRow < oldConfig.firstRow) { - _self.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1, function(fragment) { - if (el.firstChild) - el.insertBefore(fragment, el.firstChild); - else - el.appendChild(fragment); - callback(); - }); - } + if (config.firstRow < oldConfig.firstRow) { + var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1); + if (el.firstChild) + el.insertBefore(fragment, el.firstChild); else - callback(); + el.appendChild(fragment); } - - function appendBottom() { - if (config.lastRow > oldConfig.lastRow) { - _self.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow, function(fragment) { - el.appendChild(fragment); - }); - } + + if (config.lastRow > oldConfig.lastRow) { + var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow); + el.appendChild(fragment); } }; - this.$renderLinesFragment = function(config, firstRow, lastRow, callback) { + this.$renderLinesFragment = function(config, firstRow, lastRow) { var fragment = document.createDocumentFragment(); - var _self = this; - this.tokenizer.getTokens(firstRow, lastRow, function(tokens) { - for (var row=firstRow; row<=lastRow; row++) { - var lineEl = document.createElement("div"); - lineEl.className = "ace_line"; - var style = lineEl.style; - style.height = _self.$characterSize.height + "px"; - style.width = config.width + "px"; + var tokens = this.tokenizer.getTokens(firstRow, lastRow); + for (var row=firstRow; row<=lastRow; row++) { + var lineEl = document.createElement("div"); + lineEl.className = "ace_line"; + var style = lineEl.style; + style.height = this.$characterSize.height + "px"; + style.width = config.width + "px"; - var html = []; - _self.$renderLine(html, row, tokens[row-firstRow].tokens); - // don't use setInnerHtml since we are working with an empty DIV - lineEl.innerHTML = html.join(""); - fragment.appendChild(lineEl); - } - callback(fragment); - }); + var html = []; + this.$renderLine(html, row, tokens[row-firstRow].tokens); + // don't use setInnerHtml since we are working with an empty DIV + lineEl.innerHTML = html.join(""); + fragment.appendChild(lineEl); + } + return fragment; }; this.update = function(config) { @@ -248,16 +231,14 @@ var Text = function(parentEl) { this.config = config; var html = []; - var _self = this; - this.tokenizer.getTokens(config.firstRow, config.lastRow, function(tokens) { - for ( var i = config.firstRow; i <= config.lastRow; i++) { - html.push("
    "); - _self.$renderLine(html, i, tokens[i-config.firstRow].tokens), html.push("
    "); - } + var tokens = this.tokenizer.getTokens(config.firstRow, config.lastRow); + for (var i=config.firstRow; i<=config.lastRow; i++) { + html.push("
    "); + this.$renderLine(html, i, tokens[i-config.firstRow].tokens), html.push("
    "); + } - _self.element = dom.setInnerHtml(_self.element, html.join("")); - }); + this.element = dom.setInnerHtml(this.element, html.join("")); }; this.$textToken = { From 3a892c7207a5b66d4716dd7eeffb286fb440c3ee Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 12 Jan 2011 15:33:42 +0100 Subject: [PATCH 33/90] fix tests --- lib/ace/test/change_document_test.js | 2 +- support/paths.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ace/test/change_document_test.js b/lib/ace/test/change_document_test.js index 62d076f7..68433dee 100644 --- a/lib/ace/test/change_document_test.js +++ b/lib/ace/test/change_document_test.js @@ -74,7 +74,7 @@ var Test = { assert.notOk(called); this.doc2.duplicateLines(0, 0); - assert.notOk(called); + assert.ok(called); }, "test: should use cursor of new document" : function() { diff --git a/support/paths.js b/support/paths.js index 1be92a90..e5b06350 100644 --- a/support/paths.js +++ b/support/paths.js @@ -1,7 +1,8 @@ require("./requireJS-node"); require.paths.unshift(__dirname + "/../lib"); -require.paths.unshift(__dirname + "/../plugins"); +require.paths.unshift(__dirname + "/cockpit/lib"); +require.paths.unshift(__dirname + "/cockpit/support/pilot/lib"); require.paths.unshift(__dirname + "/async/lib"); require.paths.unshift(__dirname + "/node-htmlparser/lib"); require.paths.unshift(__dirname + "/jsdom/lib"); -require.paths.unshift(__dirname); +require.paths.unshift(__dirname); \ No newline at end of file From 183a0bf5edea56ea41767db487a9c83a5a417d99 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 15:20:19 +0000 Subject: [PATCH 34/90] add optional support for cockpit to build process --- Makefile.dryice.js | 47 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index bc224227..8a09174d 100644 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -63,16 +63,24 @@ copy({ filter: [ copy.filter.moduleDefines ], dest: cockpit }); -/* -// The graphics files copy({ - source: sources.map(function(source) { - return { root: aceHome, include: source + '/.*\\.png$' }; - }, this), - filter: [ copy.filter.base64, copy.filter.addDefines ], + source: [ { + root: aceHome + '/support/cockpit/lib', + include: /.*\.css$|.*\.html$/, + exclude: /tests?\// + } ], + filter: [ copy.filter.addDefines ], + dest: cockpit +}); +copy({ + source: [ { + root: aceHome + '/support/cockpit/lib', + include: /.*\.png$|.*\.gif$/, + exclude: /tests?\// + } ], + filter: [ copy.filter.base64 ], dest: cockpit }); -*/ // Ace sources var ace = copy.createDataObject(); @@ -441,7 +449,25 @@ copy.filter.base64 = function(input, source) { throw new Error('base64 filter needs to be the first in a filter set'); } - return 'define("text!' + source.toString() + '", ' + input + ');\n\n'; + if (!source) { + throw new Error('Missing filename for moduleDefines'); + } + + if (source.base) { + source = source.path; + } + + if (source.substr(-4) === '.png') { + input = 'data:image/png;base64,' + input.toString('base64'); + } + else if (source.substr(-4) === '.gif') { + input = 'data:image/gif;base64,' + input.toString('base64'); + } + else { + throw new Error('Only gif/png supported by base64 filter: ' + source); + } + + return 'define("text!' + source + '", "' + input + '");\n\n'; }; copy.filter.base64.onRead = true; @@ -460,11 +486,10 @@ copy.filter.moduleDefines = function(input, source) { if (source.base) { source = source.path; } - - var module = source.replace(/\.js$/, ''); + source = source.replace(/\.js$/, ''); return input.replace(/\bdefine\(\s*function\(require,\s*exports,\s*module\)\s*\{/, - "define('" + module + "', function(require, exports, module) {"); + "define('" + source + "', function(require, exports, module) {"); }; copy.filter.moduleDefines.onRead = true; From 731119bd566207ddfea8170f6e9b9c3b014826b5 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 15:21:22 +0000 Subject: [PATCH 35/90] simplify html in build demo editor --- build/editor.html | 65 +++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/build/editor.html b/build/editor.html index 69fc2a19..c8918a07 100644 --- a/build/editor.html +++ b/build/editor.html @@ -1,54 +1,29 @@ - - + - - Editor - - - + + + Editor + + -
    function foo(items) { - for (var i=0; i<items.length; i++) { - alert(items[i] + "juhu"); + +
    function foo(items) { + for (var i = 0; i < items.length; i++) { + alert("Ace Rocks " + items[i]); } }
    - - - + + + From 10165e31b6d8070828b2eac84e4a408bac5c60cb Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 15:23:04 +0000 Subject: [PATCH 36/90] updating build files --- build/ace-uncompressed.js | 3 +-- build/ace.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index 0e4e8d73..d0177628 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -11966,8 +11966,7 @@ var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", require(deps, function() { var catalog = require("pilot/plugin_manager").catalog; - catalog.registerPlugins([ "pilot/index" ]).then(function() { - }); + catalog.registerPlugins([ "pilot/index" ]); }); var ace = { diff --git a/build/ace.js b/build/ace.js index 91a0b567..e41b52a4 100644 --- a/build/ace.js +++ b/build/ace.js @@ -1 +1 @@ -function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

    Welcome to Skywriter - Code in the Cloud

    ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
    "+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
    "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,"
    "),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"]).then(function(){})});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file +function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

    Welcome to Skywriter - Code in the Cloud

    ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

    Sub-Commands of "+e.name+"

    "),d.push("

    "+e.description+"

    ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

    Commands starting with '"+b.search+"':

    ")):d.push("

    Available Commands:

    ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
    "+e.name+""+e.description+"
    "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
    ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
    "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

    "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
    "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
    ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
    ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
    ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
    "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
    ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"])});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file From 4f8ffe4ed365bdfca75f944d27b86150c9bee985 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 15:23:39 +0000 Subject: [PATCH 37/90] minor tidyup --- demo/build_boot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/demo/build_boot.js b/demo/build_boot.js index 8a22658f..d73949cc 100644 --- a/demo/build_boot.js +++ b/demo/build_boot.js @@ -40,8 +40,7 @@ var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", require(deps, function() { var catalog = require("pilot/plugin_manager").catalog; - catalog.registerPlugins([ "pilot/index" ]).then(function() { - }); + catalog.registerPlugins([ "pilot/index" ]); }); var ace = { From 78d48515767a9cf627f63f43458becb6ccf045c6 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Wed, 12 Jan 2011 17:27:33 +0000 Subject: [PATCH 38/90] a build that contains ace - only a temporary checkin for reference sake --- build/ace-uncompressed.js | 2540 ++++++++++++++++++++++++++++++++++++- build/ace.js | 2 +- build/editor.html | 19 +- 3 files changed, 2536 insertions(+), 25 deletions(-) diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js index d0177628..e1e6c3d9 100644 --- a/build/ace-uncompressed.js +++ b/build/ace-uncompressed.js @@ -1,10 +1,46 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ function require(module, callback) { if (Array.isArray(module)) { var params = []; module.forEach(function(m) { - params.push(require.modules[m]); + params.push(require._lookup(m)); }, this); if (callback) { @@ -13,33 +49,38 @@ function require(module, callback) { } if (typeof module === 'string') { - var payload = require.modules[module]; - var module_name = module; - if (payload == null) { - console.error('Missing module: ' + module); - } - - if (typeof payload === 'function') { - var exports = {}; - var module = { - id: '', - uri: '' - }; - payload(require, exports, module); - payload = exports; - // cache the resulting module object for next time - require.modules[module_name] = payload; - } - + payload = require._lookup(module); if (callback) { callback(); } - return payload; } } require.modules = {}; +require._lookup = function(moduleName) { + var payload = require.modules[moduleName]; + var module_name = moduleName; + if (payload == null) { + console.error('Missing module: ' + moduleName); + console.trace(); + } + + if (typeof payload === 'function') { + var exports = {}; + var module = { + id: moduleName, + uri: '' + }; + payload(require, exports, module); + payload = exports; + // cache the resulting module object for next time + require.modules[module_name] = payload; + } + + return payload; +}; + function define(module, payload) { if (typeof module !== 'string') { console.error('dropping module because define wasn\'t munged.'); @@ -5487,6 +5528,2461 @@ exports.getOS = function() { }; }); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Joe Walker (jwalker@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/cli', function(require, exports, module) { + + +var console = require('pilot/console'); +var lang = require('pilot/lang'); +var oop = require('pilot/oop'); +var EventEmitter = require('pilot/event_emitter').EventEmitter; + +//var keyboard = require('keyboard/keyboard'); +var types = require('pilot/types'); +var Status = require('pilot/types').Status; +var Conversion = require('pilot/types').Conversion; +var canon = require('pilot/canon'); + +/** + * Normally type upgrade is done when the owning command is registered, but + * out commandParam isn't part of a command, so it misses out. + */ +exports.startup = function(data, reason) { + canon.upgradeType('command', commandParam); +}; + +/** + * The information required to tell the user there is a problem with their + * input. + * TODO: There a several places where {start,end} crop up. Perhaps we should + * have a Cursor object. + */ +function Hint(status, message, start, end, predictions) { + this.status = status; + this.message = message; + + if (typeof start === 'number') { + this.start = start; + this.end = end; + this.predictions = predictions; + } + else { + var arg = start; + this.start = arg.start; + this.end = arg.end; + this.predictions = arg.predictions; + } +} +Hint.prototype = { +}; +/** + * Loop over the array of hints finding the one we should display. + * @param hints array of hints + */ +Hint.sort = function(hints, cursor) { + // Calculate 'distance from cursor' + if (cursor !== undefined) { + hints.forEach(function(hint) { + if (hint.start === Argument.AT_CURSOR) { + hint.distance = 0; + } + else if (cursor < hint.start) { + hint.distance = hint.start - cursor; + } + else if (cursor > hint.end) { + hint.distance = cursor - hint.end; + } + else { + hint.distance = 0; + } + }, this); + } + // Sort + hints.sort(function(hint1, hint2) { + // Compare first based on distance from cursor + if (cursor !== undefined) { + var diff = hint1.distance - hint2.distance; + if (diff != 0) { + return diff; + } + } + // otherwise go with hint severity + return hint2.status - hint1.status; + }); + // tidy-up + if (cursor !== undefined) { + hints.forEach(function(hint) { + delete hint.distance; + }, this); + } + return hints; +}; +exports.Hint = Hint; + +/** + * A Hint that arose as a result of a Conversion + */ +function ConversionHint(conversion, arg) { + this.status = conversion.status; + this.message = conversion.message; + if (arg) { + this.start = arg.start; + this.end = arg.end; + } + else { + this.start = 0; + this.end = 0; + } + this.predictions = conversion.predictions; +}; +oop.inherits(ConversionHint, Hint); + + +/** + * We record where in the input string an argument comes so we can report errors + * against those string positions. + * We publish a 'change' event when-ever the text changes + * @param emitter Arguments use something else to pass on change events. + * Currently this will be the creating Requisition. This prevents dependency + * loops and prevents us from needing to merge listener lists. + * @param text The string (trimmed) that contains the argument + * @param start The position of the text in the original input string + * @param end See start + * @param prefix Knowledge of quotation marks and whitespace used prior to the + * text in the input string allows us to re-generate the original input from + * the arguments. + * @param suffix Any quotation marks and whitespace used after the text. + * Whitespace is normally placed in the prefix to the succeeding argument, but + * can be used here when this is the last argument. + * @constructor + */ +function Argument(emitter, text, start, end, prefix, suffix) { + this.emitter = emitter; + this.setText(text); + this.start = start; + this.end = end; + this.prefix = prefix; + this.suffix = suffix; +} +Argument.prototype = { + /** + * Return the result of merging these arguments. + * TODO: What happens when we're merging arguments for the single string + * case and some of the arguments are in quotation marks? + */ + merge: function(following) { + if (following.emitter != this.emitter) { + throw new Error('Can\'t merge Arguments from different EventEmitters'); + } + return new Argument( + this.emitter, + this.text + this.suffix + following.prefix + following.text, + this.start, following.end, + this.prefix, + following.suffix); + }, + + /** + * See notes on events in Assignment. We might need to hook changes here + * into a CliRequisition so they appear of the command line. + */ + setText: function(text) { + if (text == null) { + throw new Error('Illegal text for Argument: ' + text); + } + var ev = { argument: this, oldText: this.text, text: text }; + this.text = text; + this.emitter._dispatchEvent('argumentChange', ev); + }, + + /** + * Helper when we're putting arguments back together + */ + toString: function() { + // TODO: There is a bug here - we should re-escape escaped characters + // But can we do that reliably? + return this.prefix + this.text + this.suffix; + } +}; + +/** + * Merge an array of arguments into a single argument. + * All Arguments in the array are expected to have the same emitter + */ +Argument.merge = function(argArray, start, end) { + start = (start === undefined) ? 0 : start; + end = (end === undefined) ? argArray.length : end; + + var joined; + for (var i = start; i < end; i++) { + var arg = argArray[i]; + if (!joined) { + joined = arg; + } + else { + joined = joined.merge(arg); + } + } + return joined; +}; + +/** + * We sometimes need a way to say 'this error occurs where ever the cursor is' + */ +Argument.AT_CURSOR = -1; + + +/** + * A link between a parameter and the data for that parameter. + * The data for the parameter is available as in the preferred type and as + * an Argument for the CLI. + *

    We also record validity information where applicable. + *

    For values, null and undefined have distinct definitions. null means + * that a value has been provided, undefined means that it has not. + * Thus, null is a valid default value, and common because it identifies an + * parameter that is optional. undefined means there is no value from + * the command line. + * @constructor + */ +function Assignment(param, requisition) { + this.param = param; + this.requisition = requisition; + this.setValue(param.defaultValue); +}; +Assignment.prototype = { + /** + * The parameter that we are assigning to + * @readonly + */ + param: undefined, + + /** + * Report on the status of the last parse() conversion. + * @see types.Conversion + */ + conversion: undefined, + + /** + * The current value in a type as specified by param.type + */ + value: undefined, + + /** + * The string version of the current value + */ + arg: undefined, + + /** + * The current value (i.e. not the string representation) + * Use setValue() to mutate + */ + value: undefined, + setValue: function(value) { + if (this.value === value) { + return; + } + + if (value === undefined) { + this.value = this.param.defaultValue; + this.conversion = this.param.getDefault ? + this.param.getDefault() : + this.param.type.getDefault(); + this.arg = undefined; + } else { + this.value = value; + this.conversion = undefined; + var text = (value == null) ? '' : this.param.type.stringify(value); + if (this.arg) { + this.arg.setText(text); + } + } + + this.requisition._assignmentChanged(this); + }, + + /** + * The textual representation of the current value + * Use setValue() to mutate + */ + arg: undefined, + setArgument: function(arg) { + if (this.arg === arg) { + return; + } + this.arg = arg; + this.conversion = this.param.type.parse(arg.text); + this.conversion.arg = arg; // TODO: make this automatic? + this.value = this.conversion.value; + this.requisition._assignmentChanged(this); + }, + + /** + * Create a list of the hints associated with this parameter assignment. + * Generally there will be only one hint generated because we're currently + * only displaying one hint at a time, ordering by distance from cursor + * and severity. Since distance from cursor will be the same for all hints + * from this assignment all but the most severe will ever be used. It might + * make sense with more experience to alter this to function to be getHint() + */ + getHint: function() { + // Allow the parameter to provide documentation + if (this.param.getCustomHint && this.value && this.arg) { + var hint = this.param.getCustomHint(this.value, this.arg); + if (hint) { + return hint; + } + } + + // If there is no argument, use the cursor position + var message = '' + this.param.name + ': '; + if (this.param.description) { + // TODO: This should be a short description - do we need to trim? + message += this.param.description.trim(); + + // Ensure the help text ends with '. ' + if (message.charAt(message.length - 1) !== '.') { + message += '.'; + } + if (message.charAt(message.length - 1) !== ' ') { + message += ' '; + } + } + var status = Status.VALID; + var start = this.arg ? this.arg.start : Argument.AT_CURSOR; + var end = this.arg ? this.arg.end : Argument.AT_CURSOR; + var predictions; + + // Non-valid conversions will have useful information to pass on + if (this.conversion) { + status = this.conversion.status; + if (this.conversion.message) { + message += this.conversion.message; + } + predictions = this.conversion.predictions; + } + + // Hint if the param is required, but not provided + var argProvided = this.arg && this.arg.text !== ''; + var dataProvided = this.value !== undefined || argProvided; + if (this.param.defaultValue === undefined && !dataProvided) { + status = Status.INVALID; + message += 'Required<\strong>'; + } + + return new Hint(status, message, start, end, predictions); + }, + + /** + * Basically setValue(conversion.predictions[0]) done in a safe + * way. + */ + complete: function() { + if (this.conversion && this.conversion.predictions && + this.conversion.predictions.length > 0) { + this.setValue(this.conversion.predictions[0]); + } + }, + + /** + * If the cursor is at 'position', do we have sufficient data to start + * displaying the next hint. This is both complex and important. + * For example, if the user has just typed:

      + *
    • 'set tabstop ' then they clearly want to know about the valid + * values for the tabstop setting, so the hint is based on the next + * parameter. + *
    • 'set tabstop' (without trailing space) - they will probably still + * want to know about the valid values for the tabstop setting because + * there is no confusion about the setting in question. + *
    • 'set tabsto' they've not finished typing a setting name so the hint + * should be based on the current parameter. + *
    • 'set tabstop' (when there is an additional tabstopstyle setting) we + * can't make assumptions about the setting - we're not finished. + *
    + *

    Note that the input for 2 and 4 is identical, only the configuration + * has changed, so hint display is environmental. + * + *

    This function works out if the cursor is before the end of this + * assignment (assuming that we've asked the same thing of the previous + * assignment) and then attempts to work out if we should use the hint from + * the next assignment even though technically the cursor is still inside + * this one due to the rules above. + */ + isPositionCaptured: function(position) { + if (!this.arg) { + return false; + } + + // Note we don't check if position >= this.arg.start because that's + // implied by the fact that we're asking the assignments in turn, and + // we want to avoid thing falling between the cracks, but we do need + // to check that the argument does have a position + if (this.arg.start === -1) { + return false; + } + + // We're clearly done if the position is past the end of the text + if (position > this.arg.end) { + return false; + } + + // If we're AT the end, the position is captured if either the status + // is not valid or if there are other valid options including current + if (position === this.arg.end) { + return this.conversion.status !== Status.VALID || + this.conversion.predictions.length !== 0; + } + + // Otherwise we're clearly inside + return true; + }, + + /** + * Replace the current value with the lower value if such a concept + * exists. + */ + decrement: function() { + var replacement = this.param.type.decrement(this.value); + if (replacement != null) { + this.setValue(replacement); + } + }, + + /** + * Replace the current value with the higher value if such a concept + * exists. + */ + increment: function() { + var replacement = this.param.type.increment(this.value); + if (replacement != null) { + this.setValue(replacement); + } + }, + + /** + * Helper when we're rebuilding command lines. + */ + toString: function() { + return this.arg ? this.arg.toString() : ''; + } +}; +exports.Assignment = Assignment; + + +/** + * This is a special parameter to reflect the command itself. + */ +var commandParam = { + name: '__command', + type: 'command', + description: 'The command to execute', + + /** + * Provide some documentation for a command. + */ + getCustomHint: function(command, arg) { + var docs = []; + docs.push(' > '); + docs.push(command.name); + if (command.params && command.params.length > 0) { + command.params.forEach(function(param) { + if (param.defaultValue === undefined) { + docs.push(' [' + param.name + ']'); + } + else { + docs.push(' [' + param.name + ']'); + } + }, this); + } + docs.push('
    '); + + docs.push(command.description ? command.description : '(No description)'); + docs.push('
    '); + + if (command.params && command.params.length > 0) { + docs.push('

      '); + command.params.forEach(function(param) { + docs.push('
    • '); + docs.push('' + param.name + ': '); + docs.push(param.description ? param.description : '(No description)'); + if (param.defaultValue === undefined) { + docs.push(' [Required]'); + } + else if (param.defaultValue === null) { + docs.push(' [Optional]'); + } + else { + docs.push(' [Default: ' + param.defaultValue + ']'); + } + docs.push('
    • '); + }, this); + docs.push('
    '); + } + + return new Hint(Status.VALID, docs.join(''), arg); + } +}; + +/** + * A Requisition collects the information needed to execute a command. + * There is no point in a requisition for parameter-less commands because there + * is no information to collect. A Requisition is a collection of assignments + * of values to parameters, each handled by an instance of Assignment. + * CliRequisition adds functions for parsing input from a command line to this + * class. + *

    Events

    + * We publish the following events:
      + *
    • argumentChange: The text of some argument has changed. It is likely that + * any UI component displaying this argument will need to be updated. (Note that + * this event is actually published by the Argument itself - see the docs for + * Argument for more details) + * The event object looks like: { argument: A, oldText: B, text: B } + *
    • commandChange: The command has changed. It is likely that a UI + * structure will need updating to match the parameters of the new command. + * The event object looks like { command: A } + * @constructor + */ +function Requisition(env) { + this.env = env; + this.commandAssignment = new Assignment(commandParam, this); +} + +Requisition.prototype = { + /** + * The command that we are about to execute. + * @see setCommandConversion() + * @readonly + */ + commandAssignment: undefined, + + /** + * The count of assignments. Excludes the commandAssignment + * @readonly + */ + assignmentCount: undefined, + + /** + * The object that stores of Assignment objects that we are filling out. + * The Assignment objects are stored under their param.name for named + * lookup. Note: We make use of the property of Javascript objects that + * they are not just hashmaps, but linked-list hashmaps which iterate in + * insertion order. + * Excludes the commandAssignment. + */ + _assignments: undefined, + + /** + * The store of hints generated by the assignments. We are trying to prevent + * the UI from needing to access this in broad form, but instead use + * methods that query part of this structure. + */ + _hints: undefined, + + /** + * When the command changes, we need to keep a bunch of stuff in sync + */ + _assignmentChanged: function(assignment) { + // This is all about re-creating Assignments + if (assignment.param.name !== '__command') { + return; + } + + this._assignments = {}; + + if (assignment.value) { + assignment.value.params.forEach(function(param) { + this._assignments[param.name] = new Assignment(param, this); + }, this); + } + + this.assignmentCount = Object.keys(this._assignments).length; + this._dispatchEvent('commandChange', { command: assignment.value }); + }, + + /** + * Assignments have an order, so we need to store them in an array. + * But we also need named access ... + */ + getAssignment: function(nameOrNumber) { + var name = (typeof nameOrNumber === 'string') ? + nameOrNumber : + Object.keys(this._assignments)[nameOrNumber]; + return this._assignments[name]; + }, + + /** + * Where parameter name == assignment names - they are the same. + */ + getParameterNames: function() { + return Object.keys(this._assignments); + }, + + /** + * A *shallow* clone of the assignments. + * This is useful for systems that wish to go over all the assignments + * finding values one way or another and wish to trim an array as they go. + */ + cloneAssignments: function() { + return Object.keys(this._assignments).map(function(name) { + return this._assignments[name]; + }, this); + }, + + /** + * Collect the statuses from the Assignments. + * The hints returned are sorted by severity + */ + _updateHints: function() { + // TODO: work out when to clear this out for the plain Requisition case + // this._hints = []; + this.getAssignments(true).forEach(function(assignment) { + this._hints.push(assignment.getHint()); + }, this); + Hint.sort(this._hints); + + // We would like to put some initial help here, but for anyone but + // a complete novice a 'type help' message is very annoying, so we + // need to find a way to only display this message once, or for + // until the user click a 'close' button or similar + // TODO: Add special case for '' input + }, + + /** + * Returns the most severe status + */ + getWorstHint: function() { + return this._hints[0]; + }, + + /** + * Extract the names and values of all the assignments, and return as + * an object. + */ + getArgsObject: function() { + var args = {}; + this.getAssignments().forEach(function(assignment) { + args[assignment.param.name] = assignment.value; + }, this); + return args; + }, + + /** + * Access the arguments as an array. + * @param includeCommand By default only the parameter arguments are + * returned unless (includeCommand === true), in which case the list is + * prepended with commandAssignment.arg + */ + getAssignments: function(includeCommand) { + var args = []; + if (includeCommand === true) { + args.push(this.commandAssignment); + } + Object.keys(this._assignments).forEach(function(name) { + args.push(this.getAssignment(name)); + }, this); + return args; + }, + + /** + * Reset all the assignments to their default values + */ + setDefaultValues: function() { + this.getAssignments().forEach(function(assignment) { + assignment.setValue(undefined); + }, this); + }, + + /** + * Helper to call canon.exec + */ + exec: function() { + canon.exec(this.commandAssignment.value, + this.env, + this.getArgsObject(), + this.toCanonicalString()); + }, + + /** + * Extract a canonical version of the input + */ + toCanonicalString: function() { + var line = []; + line.push(this.commandAssignment.value.name); + Object.keys(this._assignments).forEach(function(name) { + var assignment = this._assignments[name]; + var type = assignment.param.type; + // TODO: This will cause problems if there is a non-default value + // after a default value. Also we need to decide when to use + // named parameters in place of positional params. Both can wait. + if (assignment.value !== assignment.param.defaultValue) { + line.push(' '); + line.push(type.stringify(assignment.value)); + } + }, this); + return line.join(''); + } +}; +oop.implement(Requisition.prototype, EventEmitter); +exports.Requisition = Requisition; + + +/** + * An object used during command line parsing to hold the various intermediate + * data steps. + *

      The 'output' of the update is held in 2 objects: input.hints which is an + * array of hints to display to the user. In the future this will become a + * single value. + *

      The other output value is input.requisition which gives access to an + * args object for use in executing the final command. + * + *

      The majority of the functions in this class are called in sequence by the + * constructor. Their task is to add to hints fill out the requisition. + *

      The general sequence is:

        + *
      • _tokenize(): convert _typed into _parts + *
      • _split(): convert _parts into _command and _unparsedArgs + *
      • _assign(): convert _unparsedArgs into requisition + *
      + * + * @param typed {string} The instruction as typed by the user so far + * @param options {object} A list of optional named parameters. Can be any of: + * flags: Flags for us to check against the predicates specified with the + * commands. Defaulted to keyboard.buildFlags({ }); + * if not specified. + * @constructor + */ +function CliRequisition(env, options) { + Requisition.call(this, env); + + if (options && options.flags) { + /** + * TODO: We were using a default of keyboard.buildFlags({ }); + * This allowed us to have commands that only existed in certain contexts + * - i.e. Javascript specific commands. + */ + this.flags = options.flags; + } +} +oop.inherits(CliRequisition, Requisition); +(function() { + /** + * Called by the UI when ever the user interacts with a command line input + * @param input A structure that details the state of the input field. + * It should look something like: { typed:a, cursor: { start:b, end:c } } + * Where a is the contents of the input field, and b and c are the start + * and end of the cursor/selection respectively. + */ + CliRequisition.prototype.update = function(input) { + this.input = input; + this._hints = []; + + var args = this._tokenize(input.typed); + this._split(args); + + if (this.commandAssignment.value) { + this._assign(args); + } + + this._updateHints(); + }; + + /** + * Return an array of Status scores so we can create a marked up + * version of the command line input. + */ + CliRequisition.prototype.getInputStatusMarkup = function() { + // 'scores' is an array which tells us what chars are errors + // Initialize with everything VALID + var scores = this.toString().split('').map(function(ch) { + return Status.VALID; + }); + // For all chars in all hints, check and upgrade the score + this._hints.forEach(function(hint) { + for (var i = hint.start; i <= hint.end; i++) { + if (hint.status > scores[i]) { + scores[i] = hint.status; + } + } + }, this); + return scores; + }; + + /** + * Reconstitute the input from the args + */ + CliRequisition.prototype.toString = function() { + return this.getAssignments(true).map(function(assignment) { + return assignment.toString(); + }, this).join(''); + }; + + var superUpdateHints = CliRequisition.prototype._updateHints; + /** + * Marks up hints in a number of ways: + * - Makes INCOMPLETE hints that are not near the cursor INVALID since + * they can't be completed by typing + * - Finds the most severe hint, and annotates the array with it + * - Finds the hint to display, and also annotates the array with it + * TODO: I'm wondering if array annotation is evil and we should replace + * this with an object. Need to find out more. + */ + CliRequisition.prototype._updateHints = function() { + superUpdateHints.call(this); + + // Not knowing about cursor positioning, the requisition and assignments + // can't know this, but anything they mark as INCOMPLETE is actually + // INVALID unless the cursor is actually inside that argument. + var c = this.input.cursor; + this._hints.forEach(function(hint) { + var startInHint = c.start >= hint.start && c.start <= hint.end; + var endInHint = c.end >= hint.start && c.end <= hint.end; + var inHint = startInHint || endInHint; + if (!inHint && hint.status === Status.INCOMPLETE) { + hint.status = Status.INVALID; + } + }, this); + + Hint.sort(this._hints); + }; + + /** + * Accessor for the hints array. + * While we could just use the hints property, using getHints() is + * preferred for symmetry with Requisition where it needs a function due to + * lack of an atomic update system. + */ + CliRequisition.prototype.getHints = function() { + return this._hints; + }; + + /** + * Look through the arguments attached to our assignments for the assignment + * at the given position. + */ + CliRequisition.prototype.getAssignmentAt = function(position) { + var assignments = this.getAssignments(true); + for (var i = 0; i < assignments.length; i++) { + var assignment = assignments[i]; + if (!assignment.arg) { + // There is no argument in this assignment, we've fallen off + // the end of the obvious answers - it must be this one. + return assignment; + } + if (assignment.isPositionCaptured(position)) { + return assignment; + } + } + + return assignment; + }; + + /** + * Split up the input taking into account ' and " + */ + CliRequisition.prototype._tokenize = function(typed) { + // For blank input, place a dummy empty argument into the list + if (typed == null || typed.length === 0) { + return [ new Argument(this, '', 0, 0, '', '') ]; + } + + var OUTSIDE = 1; // The last character was whitespace + var IN_SIMPLE = 2; // The last character was part of a parameter + var IN_SINGLE_Q = 3; // We're inside a single quote: ' + var IN_DOUBLE_Q = 4; // We're inside double quotes: " + + var mode = OUTSIDE; + + // First we un-escape. This list was taken from: + // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Unicode + // We are generally converting to their real values except for \', \" + // and '\ ' which we are converting to unicode private characters so we + // can distinguish them from ', " and ' ', which have special meaning. + // They need swapping back post-split - see unescape2() + typed = typed + .replace(/\\\\/g, '\\') + .replace(/\\b/g, '\b') + .replace(/\\f/g, '\f') + .replace(/\\n/g, '\n') + .replace(/\\r/g, '\r') + .replace(/\\t/g, '\t') + .replace(/\\v/g, '\v') + .replace(/\\n/g, '\n') + .replace(/\\r/g, '\r') + .replace(/\\ /g, '\uF000') + .replace(/\\'/g, '\uF001') + .replace(/\\"/g, '\uF002'); + + function unescape2(str) { + return str + .replace(/\uF000/g, ' ') + .replace(/\uF001/g, '\'') + .replace(/\uF002/g, '"'); + } + + var i = 0; + var start = 0; // Where did this section start? + var prefix = ''; + var args = []; + + while (true) { + if (i >= typed.length) { + // There is nothing else to read - tidy up + if (mode !== OUTSIDE) { + var str = unescape2(typed.substring(start, i)); + args.push(new Argument(this, str, start, i, prefix, '')); + } + else { + if (i !== start) { + // There's a bunch of whitespace at the end of the + // command add it to the last argument's suffix, + // creating an empty argument if needed. + var extra = typed.substring(start, i); + var lastArg = args[args.length - 1]; + if (!lastArg) { + lastArg = new Argument(this, '', i, i, extra, ''); + args.push(lastArg); + } + else { + lastArg.suffix += extra; + } + } + } + break; + } + + var c = typed[i]; + switch (mode) { + case OUTSIDE: + if (c === '\'') { + prefix = typed.substring(start, i + 1); + mode = IN_SINGLE_Q; + start = i + 1; + } + else if (c === '"') { + prefix = typed.substring(start, i + 1); + mode = IN_DOUBLE_Q; + start = i + 1; + } + else if (/ /.test(c)) { + // Still whitespace, do nothing + } + else { + prefix = typed.substring(start, i); + mode = IN_SIMPLE; + start = i; + } + break; + + case IN_SIMPLE: + // There is an edge case of xx'xx which we are assuming to + // be a single parameter (and same with ") + if (c === ' ') { + var str = unescape2(typed.substring(start, i)); + args.push(new Argument(this, str, + start, i, prefix, '')); + mode = OUTSIDE; + start = i; + prefix = ''; + } + break; + + case IN_SINGLE_Q: + if (c === '\'') { + var str = unescape2(typed.substring(start, i)); + args.push(new Argument(this, str, + start - 1, i + 1, prefix, c)); + mode = OUTSIDE; + start = i + 1; + prefix = ''; + } + break; + + case IN_DOUBLE_Q: + if (c === '"') { + var str = unescape2(typed.substring(start, i)); + args.push(new Argument(this, str, + start - 1, i + 1, prefix, c)); + mode = OUTSIDE; + start = i + 1; + prefix = ''; + } + break; + } + + i++; + } + + return args; + }; + + /** + * Looks in the canon for a command extension that matches what has been + * typed at the command line. + */ + CliRequisition.prototype._split = function(args) { + var argsUsed = 1; + var arg; + + while (argsUsed <= args.length) { + var arg = Argument.merge(args, 0, argsUsed); + this.commandAssignment.setArgument(arg); + + if (!this.commandAssignment.value) { + // Not found. break with value == null + break; + } + + /* + // Previously we needed a way to hide commands depending context. + // We have not resurrected that feature yet. + if (!keyboard.flagsMatch(command.predicates, this.flags)) { + // If the predicates say 'no match' then go LA LA LA + command = null; + break; + } + */ + + if (this.commandAssignment.value.exec) { + // Valid command, break with command valid + for (var i = 0; i < argsUsed; i++) { + args.shift(); + } + break; + } + + argsUsed++; + } + }; + + /** + * Work out which arguments are applicable to which parameters. + *

      This takes #_command.params and #_unparsedArgs and creates a map of + * param names to 'assignment' objects, which have the following properties: + *

        + *
      • param - The matching parameter. + *
      • index - Zero based index into where the match came from on the input + *
      • value - The matching input + *
      + */ + CliRequisition.prototype._assign = function(args) { + if (args.length === 0) { + this.setDefaultValues(); + return; + } + + // Create an error if the command does not take parameters, but we have + // been given them ... + if (this.assignmentCount === 0) { + // TODO: previously we were doing some extra work to avoid this if + // we determined that we had args that were all whitespace, but + // probably given our tighter tokenize() this won't be an issue? + this._hints.push(new Hint(Status.INVALID, + this.commandAssignment.value.name + + ' does not take any parameters', + Argument.merge(args))); + return; + } + + // Special case: if there is only 1 parameter, and that's of type + // text we put all the params into the first param + if (this.assignmentCount === 1) { + var assignment = this.getAssignment(0); + if (assignment.param.type.name === 'text') { + assignment.setArgument(Argument.merge(args)); + return; + } + } + + var assignments = this.cloneAssignments(); + var names = this.getParameterNames(); + + // Extract all the named parameters + var used = []; + assignments.forEach(function(assignment) { + var namedArgText = '--' + assignment.name; + + var i = 0; + while (true) { + var arg = args[i]; + if (namedArgText !== arg.text) { + i++; + if (i >= args.length) { + break; + } + continue; + } + + // boolean parameters don't have values, default to false + if (assignment.param.type.name === 'boolean') { + assignment.setValue(true); + } + else { + if (i + 1 < args.length) { + // Missing value portion of this named param + this._hints.push(new Hint(Status.INCOMPLETE, + 'Missing value for: ' + namedArgText, + args[i])); + } + else { + args.splice(i + 1, 1); + assignment.setArgument(args[i + 1]); + } + } + + lang.arrayRemove(names, assignment.name); + args.splice(i, 1); + // We don't need to i++ if we splice + } + }, this); + + // What's left are positional parameters assign in order + names.forEach(function(name) { + var assignment = this.getAssignment(name); + if (args.length === 0) { + // No more values + assignment.setValue(undefined); // i.e. default + } + else { + var arg = args[0]; + args.splice(0, 1); + assignment.setArgument(arg); + } + }, this); + + if (args.length > 0) { + var remaining = Argument.merge(args); + this._hints.push(new Hint(Status.INVALID, + 'Input \'' + remaining.text + '\' makes no sense.', + remaining)); + } + }; + +})(); +exports.CliRequisition = CliRequisition; + + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Skywriter Team (skywriter@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/commands/basic', function(require, exports, module) { + + +var canon = require('pilot/canon'); + +/** + * '!' command + */ +var bangCommandSpec = { + name: 'sh', + description: 'Execute a system command (requires server support)', + params: [ + { + name: 'command', + type: 'text', + description: 'The string to send to the os shell.' + } + ], + exec: function(env, args, request) { + var req = new XMLHttpRequest(); + req.open('GET', '/exec?args=' + args.command, true); + req.onreadystatechange = function(ev) { + if (req.readyState == 4) { + if (req.status == 200) { + request.done('
      ' + req.responseText + '
      '); + } + } + }; + req.send(null); + } +}; + +var canon = require('pilot/canon'); + +exports.startup = function(data, reason) { + canon.addCommand(bangCommandSpec); +}; + +exports.shutdown = function(data, reason) { + canon.removeCommand(bangCommandSpec); +}; + + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Skywriter Team (skywriter@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/commands/git', function(require, exports, module) { + + +var checks = require("pilot/typecheck"); +var canon = require('pilot/canon'); +var Type = require('pilot/types').Type; +var types = require('pilot/types'); + + +/** + * '!' command + */ +var gitCommandSpec = { + name: 'git', + description: 'Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.' +}; + +var gitAddCommandSpec = { + name: 'git add', + description: 'Add file contents to the index', + manual: 'This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit. It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.' + + '
      The "index" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working directory, and before running the commit command, you must use the add command to add any new or modified files to the index.' + + '
      This command can be performed multiple times before a commit. It only adds the content of the specified file(s) at the time the add command is run; if you want subsequent changes included in the next commit, then you must run git add again to add the new content to the index.' + + '
      The git status command can be used to obtain a summary of which files have changes that are staged for the next commit.' + + '
      The git add command will not add ignored files by default. If any ignored files were explicitly specified on the command line, git add will fail with a list of ignored files. Ignored files reached by directory recursion or filename globbing performed by Git (quote your globs before the shell) will be silently ignored. The git add command can be used to add ignored files with the -f (force) option.' + + '
      Please see git-commit(1) for alternative ways to add content to a commit.', + params: [ + { + name: 'dry-run', + short: 'n', + type: 'bool', + description: 'Don\'t actually add the file(s), just show if they exist and/or will be ignored.' + }, + { + name: 'verbose', + short: 'v', + type: 'bool', + description: 'Be verbose.' + }, + { + name: 'force', + short: 'f', + type: 'bool', + description: 'Allow adding otherwise ignored files.' + }, + { + name: 'update', + short: 'u', + type: 'bool', + description: 'Only match filepattern against already tracked files in the index rather than the working tree.', + manual: 'That means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove files from the index if the corresponding files in the working tree have been removed.
      If no is given, default to "."; in other words, update all tracked files in the current directory and its subdirectories.' + }, + { + name: 'all', + short: 'A', + type: 'bool', + description: 'Like -u, but match filepattern against files in the working tree in addition to the index.', + manual: 'That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree.' + }, + { + name: 'intent-to-add', + short: 'N', + type: 'bool', + description: 'Record only the fact that the path will be added later.', + manual: 'An entry for the path is placed in the index with no content. This is useful for, among other things, showing the unstaged content of such files with git diff and committing them with git commit -a.' + }, + { + name: 'refresh', + type: 'bool', + description: 'Don\'t add the file(s), but only refresh their stat() information in the index.' + }, + { + name: 'ignore-errors', + type: 'bool', + description: 'If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.', + manual: 'The command shall still exit with non-zero status.' + }, + { + name: 'ignore-missing', + type: 'bool', + description: 'By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.', + manual: 'This option can only be used together with --dry-run.' + }, + { + name: 'filepattern', + type: 'text[]', + description: 'Files to add content from.', + manual: 'Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively.' + } + ], + exec: function(env, args, request) { + var req = new XMLHttpRequest(); + req.open('GET', '/exec?args=' + args.command, true); + req.onreadystatechange = function(ev) { + if (req.readyState == 4) { + if (req.status == 200) { + request.done('
      ' + req.responseText + '
      '); + } + } + }; + req.send(null); + } +}; + +/** + * commitObject really needs some smarts, but for now it is a clone of string + */ +var commitObject = new Type(); + +commitObject.stringify = function(value) { + return value; +}; + +commitObject.parse = function(value) { + if (typeof value != 'string') { + throw new Error('non-string passed to commitObject.parse()'); + } + return new Conversion(value); +}; + +commitObject.name = 'commitObject'; + +/** + * existingFile really needs some smarts, but for now it is a clone of string + */ +var existingFile = new Type(); + +existingFile.stringify = function(value) { + return value; +}; + +existingFile.parse = function(value) { + if (typeof value != 'string') { + throw new Error('non-string passed to existingFile.parse()'); + } + return new Conversion(value); +}; + +existingFile.name = 'existingFile'; + +var gitCommitCommandSpec = { + name: 'git commit', + description: 'Record changes to the repository', + manual: 'Stores the current contents of the index in a new commit along with a log message from the user describing the changes.' + + '
      The content to be added can be specified in several ways:' + + '
      1. by using git add to incrementally "add" changes to the index before using the commit command (Note: even modified files must be "added");' + + '
      2. by using git rm to remove files from the working tree and the index, again before using the commit command;' + + '
      3. by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);' + + '
      4. by using the -a switch with the commit command to automatically "add" changes from all known files (i.e. all files that are already listed in the index) and to automatically "rm" files in the index that have been removed from the working tree, and then perform the actual commit;' + + '
      5. by using the --interactive switch with the commit command to decide one by one which files should be part of the commit, before finalizing the operation. Currently, this is done by invoking git add --interactive.' + + '
      The --dry-run option can be used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters (options and paths).' + + '
      If you make a commit and then find a mistake immediately after that, you can recover from it with git reset.', + params: [ + { + name: 'all', + short: 'a', + type: 'bool', + description: 'Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected.' + }, + { + name: 'reuse-message', + short: 'C', + type: 'commitObject', + description: 'Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit.' + }, + { + name: 'reset-author', + type: 'bool', + description: 'When used with --reuse-message/--amend options, declare that the authorship of the resulting commit now belongs of the committer. This also renews the author timestamp.' + }, + { + name: 'short', + type: 'bool', + description: 'When doing a dry-run, give the output in the short-format.', + manual: 'See git-status(1) for details. Implies --dry-run.' + }, + { + name: 'porcelain', + type: 'bool', + description: 'When doing a dry-run, give the output in a porcelain-ready format.', + manual: 'See git-status(1) for details. Implies --dry-run.' + }, + { + name: 'terminate-nul', + short: 'z', + type: 'bool', + description: 'When showing short or porcelain status output, terminate entries in the status output with NUL, instead of LF.', + manual: 'If no format is given, implies the --porcelain output format.' + }, + { + name: 'file', + short: 'F', + type: 'existingFile', + description: 'Take the commit message from the given file.', + manual: '' + }, + { + name: 'author', + type: 'text', + description: 'Override the commit author.', + manual: 'Specify an explicit author using the standard A U Thor format. Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found.' + }, + { + name: 'date', + type: 'text', // TODO: Make this of text type + description: 'Override the author date used in the commit.' + }, + { + name: 'message', + short: 'm', + type: 'text', + description: 'Use the given message as the commit message.' + }, + /* + { + name: 'template', + short: 't', + type: 'existingFile', + description: 'Use the contents of the given file as the initial version of the commit message.', + manual: 'The editor is invoked and you can make subsequent changes. If a message is specified using the -m or -F options, this option has no effect. This overrides the commit.template configuration variable.' + }, + */ + { + name: 'signoff', + short: 's', + type: 'bool', + description: 'Add Signed-off-by line by the committer at the end of the commit log message.' + }, + { + name: 'no-verify', + short: 'n', + type: 'bool', + description: 'This option bypasses the pre-commit and commit-msg hooks. See also githooks(5).' + }, + { + name: 'cleanup', + type: { + name: 'selection', + data: [ 'verbatim', 'whitespace', 'strip', 'default' ] + }, + description: 'This option sets how the commit message is cleaned up.', + manual: 'The default mode will strip leading and trailing empty lines and commentary from the commit message only if the message is to be edited. Otherwise only whitespace removed. The verbatim mode does not change message at all, whitespace removes just leading/trailing whitespace lines and strip removes both whitespace and commentary.' + }, + { + name: 'amend', + type: 'bool', + description: 'Used to amend the tip of the current branch.', + manual: 'Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create replaces the current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded.' + }, + { + name: 'include', + short: 'i', + type: 'bool', + description: 'Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.', + manual: 'This is usually not what you want unless you are concluding a conflicted merge.' + }, + { + name: 'only', + short: 'o', + type: 'bool', + description: 'Make a commit only from the paths specified on the command line, disregarding any contents that have been staged so far.', + manual: 'This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged.' + }, + { + name: 'untracked-files', + short: 'u', + type: { + name: 'selection', + data: [ 'no', 'normal', 'all' ] + }, + description: 'Show untracked files (Default: all).', + manual: 'The mode parameter is optional, and is used to specify the handling of untracked files. The possible options are: no - Show no untracked files.
      normal Shows untracked files and directories
      all Also shows individual files in untracked directories.' + }, + { + name: 'verbose', + short: 'v', + type: 'bool', + description: 'Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template.', + manual: 'Note that this diff output doesn\'t have its lines prefixed with #.' + }, + { + name: 'quiet', + short: 'q', + type: 'bool', + description: 'Suppress commit summary message.' + }, + { + name: 'dry-run', + type: 'bool', + description: 'Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked.' + }, + { + name: 'status', + type: 'bool', + description: 'Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message.', + manual: 'Defaults to on, but can be used to override configuration variable commit.status.' + }, + { + name: 'no-status', + type: 'bool', + description: 'Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message.' + }, + { + name: 'file', + type: 'existingFile[]', + description: 'When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged.', + manual: 'The contents of these files are also staged for the next commit on top of what have been staged before.' + } + ], + exec: function(env, args, request) { + } +}; + + +var commands = [ + gitCommandSpec, + gitAddCommandSpec, + gitCommitCommandSpec +]; + +var canon = require('pilot/canon'); + +exports.startup = function(data, reason) { + types.registerType(commitObject); + types.registerType(existingFile); + commands.forEach(function(command) { + canon.addCommand(command); + }, this); +}; + +exports.shutdown = function(data, reason) { + commands.forEach(function(command) { + canon.removeCommand(command); + }, this); + types.unregisterType(commitObject); + types.unregisterType(existingFile); +}; + + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Kevin Dangoor (kdangoor@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/index', function(require, exports, module) { + + +exports.startup = function(data, reason) { + require('pilot/index'); + require('cockpit/cli').startup(data, reason); + // window.testCli = require('cockpit/test/testCli'); + + require('cockpit/ui/settings').startup(data, reason); + require('cockpit/ui/cliView').startup(data, reason); + require('cockpit/commands/basic').startup(data, reason); +}; + +/* +exports.shutdown(data, reason) { +}; +*/ + + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Joe Walker (jwalker@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/ui/cliView', function(require, exports, module) { + + +var editorCss = require("text!cockpit/ui/cliView.css"); +var dom = require("pilot/dom"); +dom.importCssString(editorCss); + +var canon = require("pilot/canon"); +var Status = require('pilot/types').Status; +var keyutil = require('pilot/keyboard/keyutil'); + +var CliRequisition = require('cockpit/cli').CliRequisition; +var Hint = require('cockpit/cli').Hint; +var RequestView = require('cockpit/ui/requestView').RequestView; + +var NO_HINT = new Hint(Status.VALID, '', 0, 0); + +/** + * On startup we need to: + * 1. Add 3 sets of elements to the DOM for: + * - command line output + * - input hints + * - completion + * 2. Attach a set of events so the command line works + */ +exports.startup = function(data, reason) { + var cli = new CliRequisition(data.env); + var cliView = new CliView(cli, data.env); +}; + +/** + * A class to handle the simplest UI implementation + */ +function CliView(cli, env) { + this.cli = cli; + this.doc = document; + this.win = this.doc.defaultView; + + // TODO: we should have a better way to specify command lines??? + this.element = this.doc.getElementById('cockpitInput'); + if (!this.element) { + console.log('No element with an id of cockpit. Bailing on cli'); + return; + } + + this.settings = env.settings; + this.hintDirection = this.settings.getSetting('hintDirection'); + this.outputDirection = this.settings.getSetting('outputDirection'); + this.outputHeight = this.settings.getSetting('outputHeight'); + + // If the requisition tells us something has changed, we use this to know + // if we should ignore it + this.isUpdating = false; + + this.createElements(); + this.update(); +} +CliView.prototype = { + /** + * Create divs for completion, hints and output + */ + createElements: function() { + var input = this.element; + + this.element.spellcheck = false; + + this.output = this.doc.getElementById('cockpitOutput'); + this.popupOutput = (this.output == null); + if (!this.output) { + this.output = this.doc.createElement('div'); + this.output.id = 'cockpitOutput'; + this.output.className = 'cptFocusPopup'; + input.parentNode.insertBefore(this.output, input.nextSibling); + + var setMaxOutputHeight = function() { + this.output.style.maxHeight = this.outputHeight.get() + 'px'; + }.bind(this); + this.outputHeight.addEventListener('change', setMaxOutputHeight); + setMaxOutputHeight(); + } + + this.completer = this.doc.createElement('div'); + this.completer.className = 'cptCompletion VALID'; + var style = window.getComputedStyle(input, null); + this.completer.style.color = style.color; + this.completer.style.fontSize = style.fontSize; + this.completer.style.fontFamily = style.fontFamily; + this.completer.style.fontWeight = style.fontWeight; + this.completer.style.fontStyle = style.fontStyle; + input.parentNode.insertBefore(this.completer, input.nextSibling); + + // Transfer background styling to the completer. + this.completer.style.backgroundColor = input.style.backgroundColor; + input.style.backgroundColor = 'transparent'; + + this.hinter = this.doc.createElement('div'); + this.hinter.className = 'cptHints cptFocusPopup'; + input.parentNode.insertBefore(this.hinter, input.nextSibling); + + var resizer = this.resizer.bind(this); + this.win.addEventListener('resize', resizer, false); + this.hintDirection.addEventListener('change', resizer); + this.outputDirection.addEventListener('change', resizer); + resizer(); + + canon.addEventListener('output', function(ev) { + new RequestView(ev.request, this); + }.bind(this)); + + keyutil.addKeyDownListener(input, this.onKeyDown.bind(this)); + input.addEventListener('keyup', this.onKeyUp.bind(this), true); + // cursor position affects hint severity. TODO: shortcuts for speed + input.addEventListener('mouseup', function(ev) { + this.isUpdating = true; + this.update(); + this.isUpdating = false; + }.bind(this), false); + + this.cli.addEventListener('argumentChange', this.onArgChange.bind(this)); + }, + + /** + * We need to see the output of the latest command entered + */ + scrollOutputToBottom: function() { + // Certain browsers have a bug such that scrollHeight is too small + // when content does not fill the client area of the element + var scrollHeight = Math.max(this.output.scrollHeight, this.output.clientHeight); + this.output.scrollTop = scrollHeight - this.output.clientHeight; + }, + + /** + * To be called on window resize or any time we want to align the elements + * with the input box. + */ + resizer: function() { + var rect = this.element.getClientRects()[0]; + + this.completer.style.top = rect.top + 'px'; + this.completer.style.height = rect.height + 'px'; + this.completer.style.lineHeight = rect.height + 'px'; + this.completer.style.left = rect.left + 'px'; + this.completer.style.width = rect.width + 'px'; + + if (this.hintDirection.get() === 'below') { + this.hinter.style.top = rect.bottom + 'px'; + this.hinter.style.bottom = 'auto'; + } + else { + this.hinter.style.top = 'auto'; + this.hinter.style.bottom = (this.win.innerHeight - rect.top) + 'px'; + } + this.hinter.style.left = (rect.left + 30) + 'px'; + this.hinter.style.maxWidth = (rect.width - 110) + 'px'; + + if (this.popupOutput) { + if (this.outputDirection.get() === 'below') { + this.output.style.top = rect.bottom + 'px'; + this.output.style.bottom = 'auto'; + } + else { + this.output.style.top = 'auto'; + this.output.style.bottom = (this.win.innerHeight - rect.top) + 'px'; + } + this.output.style.left = rect.left + 'px'; + this.output.style.width = (rect.width - 80) + 'px'; + } + }, + + /** + * Ensure that TAB isn't handled by the browser + */ + onKeyDown: function(ev) { + var handled; + // var handled = keyboardManager.processKeyEvent(ev, this, { + // isCommandLine: true, isKeyUp: false + // }); + if (ev.keyCode === keyutil.KeyHelper.KEY.TAB || + ev.keyCode === keyutil.KeyHelper.KEY.UP || + ev.keyCode === keyutil.KeyHelper.KEY.DOWN) { + return true; + } + return handled; + }, + + /** + * The main keyboard processing loop + */ + onKeyUp: function(ev) { + var handled; + /* + var handled = keyboardManager.processKeyEvent(ev, this, { + isCommandLine: true, isKeyUp: true + }); + */ + + // RETURN does a special exec/highlight thing + if (ev.keyCode === keyutil.KeyHelper.KEY.RETURN) { + var worst = this.cli.getWorstHint(); + // Deny RETURN unless the command might work + if (worst.status === Status.VALID) { + this.cli.exec(); + this.element.value = ''; + } + else { + // If we've denied RETURN because the command was not VALID, + // select the part of the command line that is causing problems + // TODO: if there are 2 errors are we picking the right one? + this.element.selectionStart = worst.start; + this.element.selectionEnd = worst.end; + } + } + + this.update(); + + // Special actions which delegate to the assignment + var current = this.cli.getAssignmentAt(this.element.selectionStart); + if (current) { + // TAB does a special complete thing + if (ev.keyCode === keyutil.KeyHelper.KEY.TAB) { + current.complete(); + this.update(); + } + + // UP/DOWN look for some history + if (ev.keyCode === keyutil.KeyHelper.KEY.UP) { + current.increment(); + this.update(); + } + if (ev.keyCode === keyutil.KeyHelper.KEY.DOWN) { + current.decrement(); + this.update(); + } + } + + return handled; + }, + + /** + * Actually parse the input and make sure we're all up to date + */ + update: function() { + this.isUpdating = true; + var input = { + typed: this.element.value, + cursor: { + start: this.element.selectionStart, + end: this.element.selectionEnd + } + }; + this.cli.update(input); + + var display = this.cli.getAssignmentAt(input.cursor.start).getHint(); + + // 1. Update the completer with prompt/error marker/TAB info + dom.removeCssClass(this.completer, Status.VALID.toString()); + dom.removeCssClass(this.completer, Status.INCOMPLETE.toString()); + dom.removeCssClass(this.completer, Status.INVALID.toString()); + + var completion = '> '; + if (this.element.value.length > 0) { + var scores = this.cli.getInputStatusMarkup(); + completion += this.markupStatusScore(scores); + } + + // Display the "-> prediction" at the end of the completer + if (this.element.value.length > 0 && + display.predictions && display.predictions.length > 0) { + var tab = display.predictions[0]; + completion += '  ⇥ ' + (tab.name ? tab.name : tab); + } + this.completer.innerHTML = completion; + dom.addCssClass(this.completer, this.cli.getWorstHint().status.toString()); + + // 2. Update the hint element + var hint = ''; + if (this.element.value.length !== 0) { + hint += display.message; + if (display.predictions && display.predictions.length > 0) { + hint += ': [ '; + display.predictions.forEach(function(prediction) { + hint += (prediction.name ? prediction.name : prediction); + hint += ' | '; + }, this); + hint = hint.replace(/\| $/, ']'); + } + } + + this.hinter.innerHTML = hint; + if (hint.length === 0) { + dom.addCssClass(this.hinter, 'cptNoPopup'); + } + else { + dom.removeCssClass(this.hinter, 'cptNoPopup'); + } + + this.isUpdating = false; + }, + + /** + * Markup an array of Status values with spans + */ + markupStatusScore: function(scores) { + var completion = ''; + // Create mark-up + var i = 0; + var lastStatus = -1; + while (true) { + if (lastStatus !== scores[i]) { + completion += ''; + lastStatus = scores[i]; + } + completion += this.element.value[i]; + i++; + if (i === this.element.value.length) { + completion += ''; + break; + } + if (lastStatus !== scores[i]) { + completion += ''; + } + } + + return completion; + }, + + /** + * Update the input element to reflect the changed argument + */ + onArgChange: function(ev) { + if (this.isUpdating) { + return; + } + + var prefix = this.element.value.substring(0, ev.argument.start); + var suffix = this.element.value.substring(ev.argument.end); + var insert = typeof ev.text === 'string' ? ev.text : ev.text.name; + this.element.value = prefix + insert + suffix; + // Fix the cursor. + var insertEnd = (prefix + insert).length; + this.element.selectionStart = insertEnd; + this.element.selectionEnd = insertEnd; + } +}; +exports.CliView = CliView; + + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Joe Walker (jwalker@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/ui/requestView', function(require, exports, module) { + +var dom = require("pilot/dom"); +var event = require("pilot/event"); +var requestViewHtml = require("text!cockpit/ui/requestView.html"); +var Templater = require("pilot/domtemplate").Templater; + +var requestViewCss = require("text!cockpit/ui/requestView.css"); +dom.importCssString(requestViewCss); + +/** + * Pull the HTML into the DOM, but don't add it to the document + */ +var templates = document.createElement('div'); +templates.innerHTML = requestViewHtml; +var row = templates.querySelector('.cptRow'); + +/** + * Work out the path for images. + * TODO: This should probably live in some utility area somewhere + */ +function imageUrl(path) { + var dataUrl = require('text!cockpit/ui/' + path); + if (dataUrl) { + return dataUrl; + } + + var filename = module.id.split('/').pop() + '.js'; + var imagePath; + + if (module.uri.substr(-filename.length) !== filename) { + console.error('Can\'t work out path from module.uri/module.id'); + return path; + } + + if (module.uri) { + var end = module.uri.length - filename.length - 1; + return module.uri.substr(0, end) + path; + } + + return filename + path; +} + + +/** + * Adds a row to the CLI output display + */ +function RequestView(request, cliView) { + this.request = request; + this.cliView = cliView; + this.imageUrl = imageUrl; + + // Elements attached to this by the templater. For info only + this.rowin = null; + this.rowout = null; + this.output = null; + this.hide = null; + this.show = null; + this.duration = null; + this.throb = null; + + new Templater().processNode(row.cloneNode(true), this); + + this.cliView.output.appendChild(this.rowin); + this.cliView.output.appendChild(this.rowout); + + this.request.addEventListener('output', this.onRequestChange.bind(this)); +}; + +RequestView.prototype = { + /** + * A single click on an invocation line in the console copies the command to + * the command line + */ + copyToInput: function() { + this.cliView.element.value = this.request.typed; + }, + + /** + * A double click on an invocation line in the console executes the command + */ + executeRequest: function(ev) { + this.cliView.cli.update({ + typed: this.request.typed, + cursor: { start:0, end:0 } + }); + this.cliView.cli.exec(); + }, + + hideOutput: function(ev) { + this.output.style.display = 'none'; + dom.addCssClass(this.hide, 'cmd_hidden'); + dom.removeCssClass(this.show, 'cmd_hidden'); + + event.stopPropagation(ev); + }, + + showOutput: function(ev) { + this.output.style.display = 'block'; + dom.removeCssClass(this.hide, 'cmd_hidden'); + dom.addCssClass(this.show, 'cmd_hidden'); + + event.stopPropagation(ev); + }, + + remove: function(ev) { + this.cliView.output.removeChild(this.rowin); + this.cliView.output.removeChild(this.rowout); + event.stopPropagation(ev); + }, + + onRequestChange: function(ev) { + this.duration.innerHTML = this.request.duration ? + 'completed in ' + (this.request.duration / 1000) + ' sec ' : + ''; + + this.output.innerHTML = ''; + this.request.outputs.forEach(function(output) { + var node; + if (typeof output == 'string') { + node = document.createElement('p'); + node.innerHTML = output; + } else { + node = output; + } + this.output.appendChild(node); + }, this); + this.cliView.scrollOutputToBottom(); + + dom.setCssClass(this.output, 'cmd_error', this.request.error); + + this.throb.style.display = this.request.completed ? 'none' : 'block'; + } +}; +exports.RequestView = RequestView; + + +}); +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Joe Walker (jwalker@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cockpit/ui/settings', function(require, exports, module) { + + +var types = require("pilot/types"); +var SelectionType = require('pilot/types/basic').SelectionType; + +var direction = new SelectionType({ + name: 'direction', + data: [ 'above', 'below' ] +}); + +var hintDirectionSetting = { + name: "hintDirection", + description: "Are hints shown above or below the command line?", + type: "direction", + defaultValue: "above" +}; + +var outputDirectionSetting = { + name: "outputDirection", + description: "Is the output window shown above or below the command line?", + type: "direction", + defaultValue: "above" +}; + +var outputHeightSetting = { + name: "outputHeight", + description: "What height should the output panel be?", + type: "number", + defaultValue: 300 +}; + +exports.startup = function(data, reason) { + types.registerType(direction); + data.env.settings.addSetting(hintDirectionSetting); + data.env.settings.addSetting(outputDirectionSetting); + data.env.settings.addSetting(outputHeightSetting); +}; + +exports.shutdown = function(data, reason) { + types.unregisterType(direction); + data.env.settings.removeSetting(hintDirectionSetting); + data.env.settings.removeSetting(outputDirectionSetting); + data.env.settings.removeSetting(outputHeightSetting); +}; + + +}); +define("text!cockpit/ui/cliView.css", "" + + "#cockpitInput { padding-left: 16px; }" + + "" + + "#cockpitOutput { overflow: auto; }" + + "#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }" + + "" + + ".cptFocusPopup { display: none; }" + + "#cockpitInput:focus ~ .cptFocusPopup { display: block; }" + + "#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }" + + "" + + ".cptCompletion { padding: 0; position: absolute; z-index: -1000; }" + + ".cptCompletion.VALID { background: #FFF; }" + + ".cptCompletion.INCOMPLETE { background: #DDD; }" + + ".cptCompletion.INVALID { background: #DDD; }" + + ".cptCompletion span { color: #FFF; }" + + ".cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }" + + ".cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }" + + "span.cptPrompt { color: #66F; font-weight: bold; }" + + "" + + "" + + ".cptHints {" + + " color: #000;" + + " position: absolute;" + + " border: 1px solid rgba(230, 230, 230, 0.8);" + + " background: rgba(250, 250, 250, 0.8);" + + " -moz-border-radius-topleft: 10px;" + + " -moz-border-radius-topright: 10px;" + + " border-top-left-radius: 10px; border-top-right-radius: 10px;" + + " z-index: 1000;" + + " padding: 8px;" + + " display: none;" + + "}" + + ".cptHints ul { margin: 0; padding: 0 15px; }" + + "" + + ".cptGt { font-weight: bold; font-size: 120%; }" + + ""); + +define("text!cockpit/ui/requestView.css", "" + + ".cptRowIn {" + + " display: box; display: -moz-box; display: -webkit-box;" + + " box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal;" + + " box-align: center; -moz-box-align: center; -webkit-box-align: center;" + + " color: #333;" + + " background-color: #EEE;" + + " width: 100%;" + + " font-family: consolas, courier, monospace;" + + "}" + + ".cptRowIn > * { padding-left: 2px; padding-right: 2px; }" + + ".cptRowIn > img { cursor: pointer; }" + + ".cptHover { display: none; }" + + ".cptRowIn:hover > .cptHover { display: block; }" + + ".cptRowIn:hover > .cptHover.cptHidden { display: none; }" + + ".cptOutTyped {" + + " box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;" + + " font-weight: bold; color: #000; font-size: 120%;" + + "}" + + ".cptRowOutput { padding-left: 10px; line-height: 1.2em; }" + + ".cptRowOutput strong," + + ".cptRowOutput b," + + ".cptRowOutput th," + + ".cptRowOutput h1," + + ".cptRowOutput h2," + + ".cptRowOutput h3 { color: #000; }" + + ".cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }" + + ".cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }" + + ".cptRowOutput input[type=password]," + + ".cptRowOutput input[type=text]," + + ".cptRowOutput textarea {" + + " color: #000; font-size: 120%;" + + " background: transparent; padding: 3px;" + + " border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;" + + "}" + + ".cptRowOutput table," + + ".cptRowOutput td," + + ".cptRowOutput th { border: 0; padding: 0 2px; }" + + ".cptRowOutput .right { text-align: right; }" + + ""); + +define("text!cockpit/ui/requestView.html", "" + + "
      " + + " " + + "
      " + + "" + + " " + + "
      >
      " + + "
      ${request.typed}
      " + + "" + + " " + + "
      " + + " \"Hide" + + " \"Show" + + " \"Remove" + + "" + + "
      " + + "" + + " " + + "
      " + + "
      " + + " " + + "
      " + + "
      " + + ""); + +define("text!cockpit/ui/images/closer.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAj9JREFUeNp0ks+LUlEUx7/vV1o8Z8wUx3IEHcQmiBiQlomjRNCiZpEuEqF/oEUwq/6EhvoHggmRcJUQBM1CRJAW0aLIaGQimZJxJsWxyV/P9/R1zzWlFl04vPvOPZ9z7rnnK5imidmKRCIq+zxgdoPZ1T/ut8xeM3tcKpW6s1hhBkaj0Qj7bDebTX+324WmadxvsVigqipcLleN/d4rFoulORiLxTZY8ItOp8MBCpYkiYPj8Xjus9vtlORWoVB4KcTjcQc732dLpSRXvCZaAws6Q4WDdqsO52kNH+oCRFGEz+f7ydwBKRgMPmTXi49GI1x2D/DsznesB06ws2eDbI7w9HYN6bVjvGss4KAjwDAMq81mM2SW5Wa/3weBbz42UL9uYnVpiO2Nr9ANHSGXib2Wgm9tCYIggGKJEVkvlwgi5/FQRmTLxO6hgJVzI1x0T/fJrBtHJxPeL6tI/fsZLA6ot8lkQi8HRVbw94gkWYI5MaHrOjcCGSNRxZosy9y5cErDzn0Dqx7gcwO8WtBp4PndI35GMYqiUMUvBL5yOBz8yRfFNpbPmqgcCFh/IuHa1nR/YXGM8+oUpFhihEQiwcdRLpfVRqOBtWXWq34Gra6AXq8Hp2piZcmKT4cKnE4nwuHwdByVSmWQz+d32WCTlHG/qaHHREN9kgi0sYQfv0R4PB4EAgESQDKXy72fSy6VSnHJVatVf71eR7vd5n66mtfrRSgU4pLLZrOlf7RKK51Ok8g3/yPyR5lMZi7y3wIMAME4EigHWgKnAAAAAElFTkSuQmCC"); + +define("text!cockpit/ui/images/dot_clear.gif", "data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"); + +define("text!cockpit/ui/images/minus.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4xMrIJw5EAAAHcSURBVCjPhZIxSxtxGMZ/976XhJA/RA5EAyJcFksnp64hjUPBoXRyCYLQTyD0UxScu0nFwalCQSgFCVk7dXAwUAiBDA2RO4W7yN1x9+9gcyhU+pteHt4H3pfncay1LOl0OgY4BN4Ar/7KP4BvwNFwOIyWu87S2O12O8DxfD73oygiSRIAarUaxhhWV1fHwMFgMBiWxl6v9y6Koi+3t7ckSUKtVkNVAcjzvNRWVlYwxry9vLz86uzs7HjAZDKZGGstjUaDfxHHMSLC5ubmHdB2VfVwNpuZ5clxHPMcRVFwc3PTXFtbO3RFZHexWJCmabnweAaoVqvlv4vFAhHZdVX1ZZqmOI5DURR8fz/lxbp9Yrz+7bD72SfPcwBU1XdF5N5aWy2KgqIoeBzPEnWVLMseYnAcRERdVR27rrsdxzGqyutP6898+GBsNBqo6i9XVS88z9sOggAR4X94noeqXoiIHPm+H9XrdYIgIAxDwjAkTVPCMESzBy3LMprNJr7v34nIkV5dXd2fn59fG2P2siwjSRIqlQrWWlSVJFcqlQqtVot2u40xZu/s7OxnWbl+v98BjkejkT+dTgmCoDxtY2ODra2tMXBweno6fNJVgP39fQN8eKbkH09OTsqS/wHFRdHPfTSfjwAAAABJRU5ErkJggg=="); + +define("text!cockpit/ui/images/pinaction.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClklEQVQ4EX1TXUhUQRQ+Z3Zmd+9uN1q2P3UpZaEwcikKekkqLKggKHJ96MHe9DmLkCDa9U198Id8kErICmIlRAN96UdE6QdBW/tBA5Uic7E0zN297L17p5mb1zYjD3eYc+d83zlnON8g5xzWNUSEdUBkHTJasRWySPP7fw3hfwkk2GoNsc0vOaJRHo1GV/GiMctkTIJRFlpZli8opK+htmf83gXeG63oteOtra0u25e7TYJIJELb26vYCACTgUe1lXV86BTn745l+MsyHqs53S/Aq4VEUa9Y6ko14eYY4u3AyM3HYwdKU35DZyblGR2+qq6W0X2Nnh07xynnVYpHORx/E1/GvvqaAZUayjMjdM2f/Lgr5E+fV93zR4u3zKCLughsZqKwAzAxaz6dPY6JgjLUF+eSP5OpjmAw2E8DvldHSvJMKPg08aRor1tc4BuALu6mOwGWdQC3mKIqRsC8mKd8wYfD78/earzSYzdMDW9QgKb0Is8CBY1mQXOiaXAHEpMDE5XTJqIq4EiyxUqKlpfkF0pyV1OTAoFAhmTmyCCoDsZNZvIkUjELQpipo0sQqYZAswZHwsEEE10M0pq2SSZY9HqNcDicJcNTpBvQJz40UbSOTh1B8bDpuY0w9Hb3kkn9lPAlBLfhfD39XTtX/blFJqiqrjbkTi63Hbofj2uL4GMsmzFgbDJ/vmMgv/lB4syJ0oXO7d3j++vio6GFsYmD6cHJreWc3/jRVVHhsOYvM8iZ36mtjPDBk/xDZE8CoHlbrlAssbTxDdDJvdb536L7I6S7Vy++6Gi4Xi9BsUthJRaLOYSPz4XALKI4j4iObd/e5UtDKUjZzYyYRyGAJv01Zj8kC5cbs5WY83hQnv0DzCXl+r8APElkq0RU6oMAAAAASUVORK5CYII="); + +define("text!cockpit/ui/images/pinin.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABZ0lEQVQ4Ea2TPUsDQRCGZ89Eo4FACkULEQs1CH4Uamfjn7GxEYJFIFXgChFsbPwzNnZioREkaiHBQtEiEEiMRm/dZ8OEGAxR4sBxx877Pju7M2estTJIxLrNuVwuMxQEx0ZkzcFHyRtjXt02559RtB2GYanTYzoryOfz+6l4Nbszf2niwffKmpGRo9sVW22mDgqFwp5C2gDMm+P32a3JB1N+n5JifUGeP9JeNxGryPLYjcwMP8rJ07Q9fZltQzyAstOJ2vVu5sKc1ZZkRBrOcKeb+HexPidvkpCN5JUcllZtpZFc5DgBWc5M2eysZuMuofMBSA4NWjx4PUCsXefMlI0QY3ewRg4NWi4ZTQsgrjYXema+e4VqtEMK6KXvu+4B9Bklt90vVKMeD2BI6DOt4rZ/Gk7WyKFBi4fNPIAJY0joM61SCCZ9tI1o0OIB8D+DBIkYaJRbCBH9mZgNt+bb++ufSSF/eX8BYcDeAzuQJVUAAAAASUVORK5CYII="); + +define("text!cockpit/ui/images/pinout.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAACyUlEQVQ4EW1TXUgUURQ+Z3ZmnVV3QV2xJbVSEIowQbAfLQx8McLoYX2qjB58MRSkP3vZppceYhGxgrZaIughlYpE7CHFWiiKyj9II0qxWmwlNh1Xtp2f27mz7GDlZX7uuXO+73zfuXeQMQYIgAyALppgyBtse32stsw86txkHhATn+FbfPfzxnPB+vR3RMJYuTwW6bbB4a6WS5O3Yu2VlXIesDiAamiQNKVlVXfx5I0GJ7DY7p0/+erU4dgeMJIA31WNxZmAgibOreXDqF55sY4SFUURqbi+nkjgwTyAbHhLX8yOLsSM2QRA3JRAAgd4RGPbVhkKEp8qeJ7PFyW3fw++YHtC7CkaD0amqyqihSwlMQQ0wa07IjPVI/vbexreIUrVaQV2D4RMQ/o7m12Mdfx4H3PfB9FNzTR1U2cO0Bi45aV6xNvFBNaoIAfbSiwLlqi9/hR/R3Nrhua+Oqi9TEKiB02C7YXz+Pba4MTDrpbLiMAxNgmXb+HpwVkZdoIrkn9isW7nRw/TZYaagZArAWyhfqsSDL/c9aTx7JUjGZCtYExRqCzAwGblwr6aFQ84nTo6qZ7XCeCVQNckE/KSWolvoQnxeoFFgIh8G/nA+kBAxxuQO5m9eFrwLIGJHgcyM63VFMhRSgNVyJr7og8y1vbTQpH8DIEVgxuYuexw0QECIalq5FYgEmpkgoFYltU/lnrqDz5osirSFpF7lrHAFKSWHYfEs+mY/82UnAStyMlW8sUPsVIciTZgz3jV1ebg0CEOpgPF22s1z1YQYKSXPJ1hbAhR8T26WdLhkuVfAzPR+YO1Ox5n58SmCcF6e3uzAoHA77RkevJdWH/3+f2O9TGf3w3fWQ2Hw5F/13mcsWAT+vv6DK4kFApJ/d3d1k+kJtbCrmxXHS3n8ER6b3CQbAqaEHVra6sGxcXW4SovLx+empxapS//FfwD9kpMJjMMBBAAAAAASUVORK5CYII="); + +define("text!cockpit/ui/images/pins.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGYklEQVRIDbVWe0yURxCf/R735o6DO0FBe0RFsaL4iLXGIKa2SY3P6JGa2GpjlJjUV9NosbU++tYUbEnaQIrVaKJBG7WiNFQFUWO1UUEsVg2CAgoeHHLewcH32O58cBdQsX9Y5+7LfrszOzO/2ZnZj1BKgTBiIwVGVvKd49OVVYunDlXn6wdBKh+ogXrv+DOz1melIb+3LM5fNv2XPYE5EHY+L3PJljN5zavHpJjsQNsA/JJEgyC2+WTjy3b0GfoJW8O4aoHtDwiHQrj5lw1LLyyb1bp5zAjJTus9klrVpdD6TqH2ngVO+0dsRJnp06cLIYU4fx7NnRI3bu7UIYOeJ/McnuY88q3k62gc0S4Dgf5qhICQtIXS2lqD7BhSduPk3YfyzXaANhBBJDxYdUqCywB2qS4RdyUuSkTF/VJxcbH5j8N7/75RuFrN3Zh8OS8zqf5m4UpPeenOyP42dbtBeuvVnCdkK1e4PfPouX03mo9se+c33M8wqDk5Ofqed8REUTicQhbySUxp9u3KlMSHTtrFU6Kyn03lz15PPpW25vsZeYSIKyiVURcqeZJOH9lTNZLfnxRjU/uwrjbEUBWsapcSO2Hq4k0VfZg9EzxdDNCEjDxgNqRDme9umz/btwlsHRIEePHgAf73RdnHZ6LTuIUBN7OBQ+c1Fdnp6cZ1BQUdeRuWZi97o3ktDQQkVeFFzqJARd1A5a0Vr7ta6Kp6TZjtZ+NTIOoKF6qDrL7e0QQIUCiqMMKk8Z1Q/SCSKvzocf2B6NEN0SQn/kTO6fKJ0zqjZUlQBSpJ0GjR77w0aoc1Pr6S5/kVJrNpakV5hR+LWKN4t7sLX+p0rx2vqSta64olIulUKUgCSXLWE1R4KPPSj+5vhm2hdDOG+CkQBmhhyyKq6SaFYWTn5bB3QJRNz54AuXKn8TJjhu0Wbv+wNEKQjVhnmKopjo4FxXmetCRnC4F7BhCiCUepqAepRh0TM/gjjzOOSK2NgWZPc05qampRWJHb7dbOffep2ednzLzgczlbrQA6gHYF9BYDh9GY+FjddMweHMscmMuep07gXlMQoqw9ALoYu5MJsak9QmJA2IvAgVmoCRciooyPujJtNCv1uHt3TmK9gegFKrG9kh6oXwZiIEAtBIjORGKNTWR/WeW8XVkbjuJepLAyloM8LmTN//njKZPbraATZaLjCHEww9Ei4FFiPg6Ja5gT6gxYgLgnRDHRQwJXbz2GOw0d4A3K4GXlUtMahJjYVxiYbrwOmxIS10bFnIBOSi6Tl9Jgs0zbOEX18wyEwgLPMrxD1Y4aCK8kmTpgYcpAF27Mzs42Hjx4kA8BICUlJfKArR7LcEvTB1xEC9AoEw9OPagWkVU/D1oesmK6U911zEczMVe01oZjiMggg6ux2Qk379qh4rYKet4GjrhhwEteBgBrH8BssoXEtbHzPpSBRRSpqlNpgAiUoxzHKxLRszoVuggIisxaDQWZqkQvQjAoax3NbDbLLGuUEABNGedXqSyLRupXgDT5JfAGZNLio9B0X8Uiwk4w77MDc1D4yejjWtykPS3DX01UDCY/GPQcVDe0QYT0CIxGFvUorfvBxZsRfVrUuWruMBAb/lXCUofoFNZfzGJtowXOX0vwUSFK4BgyMKm6P6s9wQUZld+jrYyMDC0iIQDaJdG4IyZQfL3RfbFcCBIlRgc+u3CjaTApuZ9KsANgG8PNzHlWWD3tCxd6kafNNiFp5HAalAkkJ0SCV2H3CgOD9Nc/FqrXuyb0Eocvfhq171p5eyuJ1omKJEP5rQGe/FOOnXtq335z8YmvYo9cHb2t8spIb3lVSseZW46FlGY/Sk9P50P2w20UlWJUkUHIushfc5PXGAzCo0PlD2pnpCYfCXga3lu+fPlevEhWrVrFyrN/Orfv87FOW9tlqb2Kc9pV8DzioMk3UNUbXM+8B/ATBr8C8CKdvGXWGD/9sqm3dkxtzA4McMjHMB8D2ftheYXo+qzt3pXvz8/PP/vk+v8537V+yYW87Zu+RZ1ZbrexoKAA/SBpaWn4+aL5w5zGk+/jW59JiMkESW5urpiVlWXENRb1H/Yf2I9txIxz5IdkX3TsraukpsbQjz6090yb4XsAvQoRE0YvJdamtIIbOnRoUVlZ2ftsLVQzIdEXHntsaZdimssVfCpFui109+BnWPsXaWLI/zactygAAAAASUVORK5CYII="); + +define("text!cockpit/ui/images/plus.png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4yFTwuJTkAAAH7SURBVCjPdZKxa1NRFMZ/956XZMgFyyMlCZRA4hBx6lBcQ00GoYi4tEstFPwLAs7iLDi7FWuHThaUggihBDI5OWRoQAmBQFISQgvvpbwX3rsOaR4K+o2H8zvfOZxPWWtZqVarGaAJPAEe3ZW/A1+Bd+1221v1qhW4vb1dA44mk0nZ8zyCIAAgk8lgjGF9fb0PHF5cXLQTsF6vP/c879P19TVBEJDJZBARAKIoSmpra2sYY561Wq3PqtFouMBgMBgYay3ZbJZ/yfd9tNaUSqUboOKISPPq6sqsVvZ9H4AvL34B8PTj/QSO45jpdHovn883Ha31znw+JwzDpCEMQx4UloM8zyOdTif3zudztNY7jog8DMMQpRRxHPPt5TCBAEZvxlyOFTsfykRRBICIlB2t9a21Nh3HMXEc8+d7VhJHWCwWyzcohdZaHBHpO46z6fs+IsLj94XECaD4unCHL8FsNouI/HRE5Nx13c3ZbIbWOnG5HKtl+53TSq7rIiLnand31wUGnU7HjEYjlFLJZN/3yRnL1FMYY8jlcmxtbd0AFel2u7dnZ2eXxpi9xWJBEASkUimstYgIQSSkUimKxSKVSgVjzN7p6emPJHL7+/s14KjX65WHwyGz2SxZbWNjg2q12gcOT05O2n9lFeDg4MAAr/4T8rfHx8dJyH8DvvbYGzKvWukAAAAASUVORK5CYII="); + +define("text!cockpit/ui/images/throbber.gif", "data:image/gif;base64,R0lGODlh3AATAPQAAP///wAAAL6+vqamppycnLi4uLKyssjIyNjY2MTExNTU1Nzc3ODg4OTk5LCwsLy8vOjo6Ozs7MrKyvLy8vT09M7Ozvb29sbGxtDQ0O7u7tbW1sLCwqqqqvj4+KCgoJaWliH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFg8PwKIMHnLF63N2438f0mv1I2O8buXjvaOPtaHx7fn96goR4hmuId4qDdX95c4+RG4GCBoyAjpmQhZN0YGYFXitdZBIVGAoKoq4CG6Qaswi1CBtkcG6ytrYJubq8vbfAcMK9v7q7D8O1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQgDLAQGCQoLDA0QCwUHqfYSFw/xEPz88/X38Onr14+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU7EGNDiRn8Z831cGLHhSIgdE/9chIeBgDoB7gjaWUWTlYAFE3LqzDCTlc9WOHfm7PkTqNCh54rePDqB6M+lR536hCpUqs2gVZM+xbrTqtGoWqdy1emValeXKwgcWABB5y1acFNZmEvXwoJ2cGfJrTv3bl69Ffj2xZt3L1+/fw3XRVw4sGDGcR0fJhxZsF3KtBTThZxZ8mLMgC3fRatCLYMIFCzwLEprg84OsDus/tvqdezZf13Hvr2B9Szdu2X3pg18N+68xXn7rh1c+PLksI/Dhe6cuO3ow3NfV92bdArTqC2Ebc3A8vjf5QWf15Bg7Nz17c2fj69+fnq+8N2Lty+fuP78/eV2X13neIcCeBRwxorbZrAxAJoCDHbgoG8RTshahQ9iSKEEzUmYIYfNWViUhheCGJyIP5E4oom7WWjgCeBBAJNv1DVV01MZdJhhjdkplWNzO/5oXI846njjVEIqR2OS2B1pE5PVscajkxhMycqLJgxQCwT40PjfAV4GqNSXYdZXJn5gSkmmmmJu1aZYb14V51do+pTOCmA00AqVB4hG5IJ9PvYnhIFOxmdqhpaI6GeHCtpooisuutmg+Eg62KOMKuqoTaXgicQWoIYq6qiklmoqFV0UoeqqrLbq6quwxirrrLTWauutJ4QAACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAXHx/EoCzboAcdhcLDdgwJ6nua03YZ8PMFPoBMca215eg98G36IgYNvDgOGh4lqjHd7fXOTjYV9nItvhJaIfYF4jXuIf4CCbHmOBZySdoOtj5eja59wBmYFXitdHhwSFRgKxhobBgUPAmdoyxoI0tPJaM5+u9PaCQZzZ9gP2tPcdM7L4tLVznPn6OQb18nh6NV0fu3i5OvP8/nd1qjwaasHcIPAcf/gBSyAAMMwBANYEAhWYQGDBhAyLihwYJiEjx8fYMxIcsGDAxVA/yYIOZIkBAaGPIK8INJlRpgrPeasaRPmx5QgJfB0abLjz50tSeIM+pFmUo0nQQIV+vRlTJUSnNq0KlXCSq09ozIFexEBAYkeNiwgOaEtn2LFpGEQsKCtXbcSjOmVlqDuhAx3+eg1Jo3u37sZBA9GoMAw4MB5FyMwfLht4sh7G/utPGHlYAV8Nz9OnOBz4c2VFWem/Pivar0aKCP2LFn2XwhnVxBwsPbuBAQbEGiIFg1BggoWkidva5z4cL7IlStfkED48OIYoiufYIH68+cKPkqfnsB58ePjmZd3Dj199/XE20tv6/27XO3S6z9nPCz9BP3FISDefL/Bt192/uWmAv8BFzAQAQUWWFaaBgqA11hbHWTIXWIVXifNhRlq6FqF1sm1QQYhdiAhbNEYc2KKK1pXnAIvhrjhBh0KxxiINlqQAY4UXjdcjSJyeAx2G2BYJJD7NZQkjCPKuCORKnbAIXsuKhlhBxEomAIBBzgIYXIfHfmhAAyMR2ZkHk62gJoWlNlhi33ZJZ2cQiKTJoG05Wjcm3xith9dcOK5X51tLRenoHTuud2iMnaolp3KGXrdBo7eKYF5p/mXgJcogClmcgzAR5gCKymXYqlCgmacdhp2UCqL96mq4nuDBTmgBasaCFp4sHaQHHUsGvNRiiGyep1exyIra2mS7dprrtA5++z/Z8ZKYGuGsy6GqgTIDvupRGE+6CO0x3xI5Y2mOTkBjD4ySeGU79o44mcaSEClhglgsKyJ9S5ZTGY0Bnzrj+3SiKK9Rh5zjAALCywZBk/ayCWO3hYM5Y8Dn6qxxRFsgAGoJwwgDQRtYXAAragyQOmaLKNZKGaEuUlpyiub+ad/KtPqpntypvvnzR30DBtjMhNodK6Eqrl0zU0/GjTUgG43wdN6Ra2pAhGtAAZGE5Ta8TH6wknd2IytNKaiZ+Or79oR/tcvthIcAPe7DGAs9Edwk6r3qWoTaNzY2fb9HuHh2S343Hs1VIHhYtOt+Hh551rh24vP5YvXSGzh+eeghy76GuikU9FFEainrvrqrLfu+uuwxy777LTXfkIIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAWHB2l4CDZo9IDjcBja7UEhTV+3DXi3PJFA8xMcbHiDBgMPG31pgHBvg4Z9iYiBjYx7kWocb26OD398mI2EhoiegJlud4UFiZ5sm6Kdn2mBr5t7pJ9rlG0cHg5gXitdaxwFGArIGgoaGwYCZ3QFDwjU1AoIzdCQzdPV1c0bZ9vS3tUJBmjQaGXl1OB0feze1+faiBvk8wjnimn55e/o4OtWjp+4NPIKogsXjaA3g/fiGZBQAcEAFgQGOChgYEEDCCBBLihwQILJkxIe/3wMKfJBSQkJYJpUyRIkgwcVUJq8QLPmTYoyY6ZcyfJmTp08iYZc8MBkhZgxk9aEcPOlzp5FmwI9KdWn1qASurJkClRoWKwhq6IUqpJBAwQEMBYroAHkhLt3+RyzhgCDgAV48Wbgg+waAnoLMgTOm6DwQ8CLBzdGdvjw38V5JTg2lzhyTMeUEwBWHPgzZc4TSOM1bZia6LuqJxCmnOxv7NSsl1mGHHiw5tOuIWeAEHcFATwJME/ApgFBc3MVLEgPvE+Ddb4JokufPmFBAuvPXWu3MIF89wTOmxvOvp179evQtwf2nr6aApPyzVd3jn089e/8xdfeXe/xdZ9/d1ngHf98lbHH3V0LMrgPgsWpcFwBEFBgHmyNXWeYAgLc1UF5sG2wTHjIhNjBiIKZCN81GGyQwYq9uajeMiBOQGOLJ1KjTI40kmfBYNfc2NcGIpI4pI0vyrhjiT1WFqOOLEIZnjVOVpmajYfBiCSNLGbA5YdOkjdihSkQwIEEEWg4nQUmvYhYe+bFKaFodN5lp3rKvJYfnBKAJ+gGDMi3mmbwWYfng7IheuWihu5p32XcSWdSj+stkF95dp64jJ+RBipocHkCCp6PCiRQ6INookCAAwy0yd2CtNET3Yo7RvihBjFZAOaKDHT43DL4BQnsZMo8xx6uI1oQrHXXhHZrB28G62n/YSYxi+uzP2IrgbbHbiaer7hCiOxDFWhrbmGnLVuus5NFexhFuHLX6gkEECorlLpZo0CWJG4pLjIACykmBsp0eSSVeC15TDJeUhlkowlL+SWLNJpW2WEF87urXzNWSZ6JOEb7b8g1brZMjCg3ezBtWKKc4MvyEtwybPeaMAA1ECRoAQYHYLpbeYYCLfQ+mtL5c9CnfQpYpUtHOSejEgT9ogZ/GSqd0f2m+LR5WzOtHqlQX1pYwpC+WbXKqSYtpJ5Mt4a01lGzS3akF60AxkcTaLgAyRBPWCoDgHfJqwRuBuzdw/1ml3iCwTIeLUWJN0v4McMe7uasCTxseNWPSxc5RbvIgD7geZLbGrqCG3jepUmbbze63Y6fvjiOylbwOITPfIHEFsAHL/zwxBdvPBVdFKH88sw37/zz0Ecv/fTUV2/99SeEAAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2cw8BQEm3T6yHEYHHD4oKCuD9qGvNsxT6QTgAkcHHmFeX11fm17hXwPG35qgnhxbwMPkXaLhgZ9gWp3bpyegX4DcG+inY+Qn6eclpiZkHh6epetgLSUcBxlD2csXXdvBQrHGgoaGhsGaIkFDwjTCArTzX+QadHU3c1ofpHc3dcGG89/4+TYktvS1NYI7OHu3fEJ5tpqBu/k+HX7+nXDB06SuoHm0KXhR65cQT8P3FRAMIAFgVMPwDCAwLHjggIHJIgceeFBg44eC/+ITCCBZYKSJ1FCWPBgpE2YMmc+qNCypwScMmnaXAkUJYOaFVyKLOqx5tCXJnMelcBzJNSYKIX2ZPkzqsyjPLku9Zr1QciVErYxaICAgEUOBRJIgzChbt0MLOPFwyBggV27eCUcmxZvg9+/dfPGo5bg8N/Ag61ZM4w4seDF1fpWhizZmoa+GSortgcaMWd/fkP/HY0MgWbTipVV++wY8GhvqSG4XUEgoYTKE+Qh0OCvggULiBckWEZ4Ggbjx5HXVc58IPQJ0idQJ66XanTpFraTe348+XLizRNcz658eHMN3rNPT+C+G/nodqk3t6a+fN3j+u0Xn3nVTQPfdRPspkL/b+dEIN8EeMm2GAYbTNABdrbJ1hyFFv5lQYTodSZABhc+loCEyhxTYYkZopdMMiNeiBxyIFajV4wYHpfBBspUl8yKHu6ooV5APsZjQxyyeNeJ3N1IYod38cgdPBUid6GCKfRWgAYU4IccSyHew8B3doGJHmMLkGkZcynKk2Z50Ym0zJzLbDCmfBbI6eIyCdyJmJmoqZmnBAXy9+Z/yOlZDZpwYihnj7IZpuYEevrYJ5mJEuqiof4l+NYDEXQpXQcMnNjZNDx1oGqJ4S2nF3EsqWrhqqVWl6JIslpAK5MaIqDeqjJq56qN1aTaQaPbHTPYr8Be6Gsyyh6Da7OkmmqP/7GyztdrNVQBm5+pgw3X7aoYKhfZosb6hyUKBHCgQKij1rghkOAJuZg1SeYIIY+nIpDvf/sqm4yNG5CY64f87qdAwSXKGqFkhPH1ZHb2EgYtw3bpKGVkPz5pJAav+gukjB1UHE/HLNJobWcSX8jiuicMMBFd2OmKwQFs2tjXpDfnPE1j30V3c7iRHlrzBD2HONzODyZtsQJMI4r0AUNaE3XNHQw95c9GC001MpIxDacFQ+ulTNTZlU3O1eWVHa6vb/pnQUUrgHHSBKIuwG+bCPyEqbAg25gMVV1iOB/IGh5YOKLKIQ6xBAcUHmzjIcIqgajZ+Ro42DcvXl7j0U4WOUd+2IGu7DWjI1pt4DYq8BPm0entuGSQY/4tBi9Ss0HqfwngBQtHbCH88MQXb/zxyFfRRRHMN+/889BHL/301Fdv/fXYZ39CCAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2fAKXsKm7R6Q+Y43vABep0mGwwOPH7w2CT+gHZ3d3lyagl+CQNvg4yGh36LcHoGfHR/ZYOElQ9/a4ocmoRygIiRk5p8pYmZjXePaYBujHoOqp5qZHBlHAUFXitddg8PBg8KGsgayxvGkAkFDwgICtPTzX2mftHW3QnOpojG3dbYkNjk1waxsdDS1N7ga9zw1t/aifTk35fu6Qj3numL14fOuHTNECHqU4DDgQEsCCwidiHBAwYQMmpcUOCAhI8gJVzUuLGThAQnP/9abEAyI4MCIVOKZNnyJUqUJxNcGNlywYOQgHZirGkSJ8gHNEky+AkS58qWEJYC/bMzacmbQHkqNdlUJ1KoSz2i9COhmQYCEXtVrCBgwYS3cCf8qTcNQ9u4cFFOq2bPLV65Cf7dxZthbjW+CgbjnWtNgWPFcAsHdoxgWWK/iyV045sAc2S96SDn1exYw17REwpLQEYt2eW/qtPZRQAB7QoC61RW+GsBwYZ/CXb/XRCYLsAKFizEtUAc+G7lcZsjroscOvTmsoUvx15PwccJ0N8yL17N9PG/E7jv9S4hOV7pdIPDdZ+ePDzv2qMXn2b5+wTbKuAWnF3oZbABZY0lVmD/ApQd9thybxno2GGuCVDggaUpoyBsB1bGGgIYbJCBcuFJiOAyGohIInQSmmdeiBnMF2GHfNUlIoc1rncjYRjW6NgGf3VQGILWwNjBfxEZcAFbC7gHXQcfUYOYdwzQNxo5yUhQZXhvRYlMeVSuSOJHKJa5AQMQThBlZWZ6Bp4Fa1qzTAJbijcBlJrtxeaZ4lnnpZwpukWieGQmYx5ATXIplwTL8DdNZ07CtWYybNIJF4Ap4NZHe0920AEDk035kafieQrqXofK5ympn5JHKYjPrfoWcR8WWQGp4Ul32KPVgXdnqxM6OKqspjIYrGPDrlrsZtRIcOuR86nHFwbPvmes/6PH4frrqbvySh+mKGhaAARPzjjdhCramdoGGOhp44i+zogBkSDuWC5KlE4r4pHJkarXrj++Raq5iLmWLlxHBteavjG+6amJrUkJJI4Ro5sBv9AaOK+jAau77sbH7nspCwNIYIACffL7J4JtWQnen421nNzMcB6AqpRa9klonmBSiR4GNi+cJZpvwgX0ejj71W9yR+eIgaVvQgf0l/A8nWjUFhwtZYWC4hVnkZ3p/PJqNQ5NnwUQrQCGBBBMQIGTtL7abK+5JjAv1fi9bS0GLlJHgdjEgYzzARTwC1fgEWdJuKKBZzj331Y23qB3i9v5aY/rSUC4w7PaLeWXmr9NszMFoN79eeiM232o33EJAIzaSGwh++y012777bhT0UURvPfu++/ABy/88MQXb/zxyCd/QggAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEBY5nwCk7xIWNer0hO95wziC9Ttg5b4ND/+Y87IBqZAaEe29zGwmJigmDfHoGiImTjXiQhJEPdYyWhXwDmpuVmHwOoHZqjI6kZ3+MqhyemJKAdo6Ge3OKbEd4ZRwFBV4rc4MPrgYPChrMzAgbyZSJBcoI1tfQoYsJydfe2amT3d7W0OGp1OTl0YtqyQrq0Lt11PDk3KGoG+nxBpvTD9QhwCctm0BzbOyMIwdOUwEDEgawIOCB2oMLgB4wgMCx44IHBySIHClBY0ePfyT/JCB5weRJCAwejFw58kGDlzBTqqTZcuPLmCIBiWx58+VHmiRLFj0JVCVLl0xl7qSZwCbOo0lFWv0pdefQrVFDJtr5gMBEYBgxqBWwYILbtxPsqMPAFu7blfa81bUbN4HAvXAzyLWnoDBguHIRFF6m4LBbwQngMYPXuC3fldbyPrMcGLM3w5wRS1iWWUNlvnElKDZtz/EEwaqvYahQoexEfyILi4RrYYKFZwJ3810QWZ2ECrx9Ew+O3K6F5Yq9zXbb+y30a7olJJ+wnLC16W97Py+uwdtx1NcLWzs/3G9e07stVPc9kHJ0BcLtQp+c3ewKAgYkUAFpCaAmmHqKLSYA/18WHEiZPRhsQF1nlLFWmIR8ZbDBYs0YZuCGpGXWmG92aWiPMwhEOOEEHXRwIALlwXjhio+BeE15IzpnInaLbZBBhhti9x2GbnVQo2Y9ZuCfCgBeMCB+DJDIolt4iVhOaNSJdCOBUfIlkmkyMpPAAvKJ59aXzTQzJo0WoJnmQF36Jp6W1qC4gWW9GZladCiyJd+KnsHImgRRVjfnaDEKuiZvbcYWo5htzefbl5LFWNeSKQAo1QXasdhiiwwUl2B21H3aQaghXnPcp1NagCqYslXAqnV+zYWcpNwVp9l5eepJnHqL4SdBi56CGlmw2Zn6aaiZjZqfb8Y2m+Cz1O0n3f+tnvrGbF6kToApCgAWoNWPeh754JA0vmajiAr4iOuOW7abQXVGNriBWoRdOK8FxNqLwX3oluubhv8yluRbegqGb536ykesuoXhyJqPQJIGbLvQhkcwjKs1zBvBwSZIsbcsDCCBAAf4ya+UEhyQoIiEJtfoZ7oxUOafE2BwgMWMqUydfC1LVtiArk0QtGkWEopzlqM9aJrKHfw5c6wKjFkmXDrbhwFockodtMGFLWpXy9JdiXN1ZDNszV4WSLQCGBKoQYHUyonqrHa4ErewAgMmcAAF7f2baIoVzC2p3gUvJtLcvIWqloy6/R04mIpLwDhciI8qLOB5yud44pHPLbA83hFDWPjNbuk9KnySN57Av+TMBvgEAgzzNhJb5K777rz37vvvVHRRxPDEF2/88cgnr/zyzDfv/PPQnxACACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIUCwcMpO84OT2HDbm8GHLQjnn6wE3g83SA3DB55G3llfHxnfnZ4gglvew6Gf4ySgmYGlpCJknochWiId3kJcZZyDn93i6KPl4eniopwq6SIoZKxhpenbhtHZRxhXisDopwPgHkGDxrLGgjLG8mC0gkFDwjX2AgJ0bXJ2djbgNJsAtbfCNB2oOnn6MmKbeXt226K1fMGi6j359D69ua+QZskjd+3cOvY9XNgp4ABCQNYEDBl7EIeCQkeMIDAseOCBwckiBSZ4ILGjh4B/40kaXIjSggMHmBcifHky5gYE6zM2OAlzGM6Z5rs+fIjTZ0tfcYMSlLCUJ8fL47kCVXmTjwPiKJkUCDnyqc3CxzQmYeAxAEGLGJYiwCDgAUT4sqdgOebArdw507IUNfuW71xdZ7DC5iuhGsKErf9CxhPYgUaEhPWyzfBMgUIJDPW6zhb5M1y+R5GjFkBaLmCM0dOfHqvztXYJnMejaFCBQlmVxAYsEGkYnQV4lqYMNyCtnYSggNekAC58uJxmTufW5w55mwKkg+nLp105uTC53a/nhg88fMTmDfDVl65Xum/IZt/3/zaag3a5W63nll1dvfiWbaaZLmpQIABCVQA2f9lAhTG112PQWYadXE9+FtmEwKWwQYQJrZagxomsOCAGVImInsSbpCBhhwug6KKcXXQQYUcYuDMggrASFmNzjjzzIrh7cUhhhHqONeGpSEW2QYxHsmjhxpgUGAKB16g4IIbMNCkXMlhaJ8GWVJo2I3NyKclYF1GxgyYDEAnXHJrMpNAm/rFBSczPiYAlwXF8ZnmesvoOdyMbx7m4o0S5LWdn4bex2Z4xYmEzaEb5EUcnxbA+WWglqIn6aHPTInCgVbdlZyMqMrIQHMRSiaBBakS1903p04w434n0loBoQFOt1yu2YAnY68RXiNsqh2s2qqxuyKb7Imtmgcrqsp6h8D/fMSpapldx55nwayK/SfqCQd2hcFdAgDp5GMvqhvakF4mZuS710WGIYy30khekRkMu92GNu6bo7r/ttjqwLaua5+HOdrKq5Cl3dcwi+xKiLBwwwom4b0E6xvuYyqOa8IAEghwQAV45VvovpkxBl2mo0W7AKbCZXoAhgMmWnOkEqx2JX5nUufbgJHpXCfMOGu2QAd8eitpW1eaNrNeMGN27mNz0swziYnpSbXN19gYtstzfXrdYjNHtAIYGFVwwAEvR1dfxdjKxVzAP0twAAW/ir2w3nzTd3W4yQWO3t0DfleB4XYnEHCEhffdKgaA29p0eo4fHLng9qoG+OVyXz0gMeWGY7qq3xhiRIEAwayNxBawxy777LTXbjsVXRSh++689+7778AHL/zwxBdv/PEnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLD4BlwHGg0ubBpuzdm9Dk9eCTu+MTZkDb4PXYbeIIcHHxqf4F3gnqGY2kOdQmCjHCGfpCSjHhmh2N+knmEkJmKg3uHfgaaeY2qn6t2i4t7sKAPbwIJD2VhXisDCQZgDrKDBQ8aGgjKyhvDlJMJyAjV1gjCunkP1NfVwpRtk93e2ZVt5NfCk27jD97f0LPP7/Dr4pTp1veLgvrx7AL+Q/BM25uBegoYkDCABYFhEobhkUBRwoMGEDJqXPDgQMUEFC9c1LjxQUUJICX/iMRIEgIDkycrjmzJMSXFlDNJvkwJsmdOjQwKfDz5M+PLoSGLQqgZU6XSoB/voHxawGbFlS2XGktAwKEADB0xiEWAodqGBRPSqp1wx5qCamDRrp2Qoa3bagLkzrULF4GCvHPTglRAmKxZvWsHayBcliDitHUlvGWM97FgCdYWVw4c2e/kw4HZJlCwmDBhwHPrjraGYTHqtaoxVKggoesKAgd2SX5rbUMFCxOAC8cGDwHFwBYWJCgu4XfwtcqZV0grPHj0u2SnqwU+IXph3rK5b1fOu7Bx5+K7L6/2/Xhg8uyXnQ8dvfRiDe7TwyfNuzlybKYpgIFtKhAgwEKkKcOf/wChZbBBgMucRh1so5XH3wbI1WXafRJy9iCErmX4IWHNaIAhZ6uxBxeGHXQA24P3yYfBBhmgSBozESpwongWOBhggn/N1aKG8a1YY2oVAklgCgQUUwGJ8iXAgItrWUARbwpqIOWEal0ZoYJbzmWlZCWSlsAC6VkwZonNbMAAl5cpg+NiZwpnJ0Xylegmlc+tWY1mjnGnZnB4QukMA9UJRxGOf5r4ppqDjjmnfKilh2ejGiyJAgF1XNmYbC2GmhZ5AcJVgajcXecNqM9Rx8B6bingnlotviqdkB3YCg+rtOaapFsUhSrsq6axJ6sEwoZK7I/HWpCsr57FBxJ1w8LqV/81zbkoXK3LfVeNpic0KRQG4NHoIW/XEmZuaiN6tti62/moWbk18uhjqerWS6GFpe2YVotskVssWfBOAHACrZHoWcGQwQhlvmsdXBZ/F9YLMF2jzUuYBP4a7CLCnoEHrgkDSCDAARUILAGaVVqAwQHR8pZXomm9/ONhgjrbgc2lyYxmpIRK9uSNjrXs8gEbTrYyl2ryTJmsLCdKkWzFQl1lWlOXGmifal6p9VnbQfpyY2SZyXKVV7JmZkMrgIFSyrIeUJ2r7YKnXdivUg1kAgdQ8B7IzJjGsd9zKSdwyBL03WpwDGxwuOASEP5vriO2F3nLjQdIrpaRDxqcBdgIHGA74pKrZXiR2ZWuZt49m+o3pKMC3p4Av7SNxBa456777rz37jsVXRQh/PDEF2/88cgnr/zyzDfv/PMnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLDUPAMHGi0weEpbN7wI8cxTzsGj4R+n+DUxwaBeBt7hH1/gYIPhox+Y3Z3iwmGk36BkIN8egOIl3h8hBuOkAaZhQlna4BrpnyWa4mleZOFjrGKcXoFA2ReKwMJBgISDw6abwUPGggazc0bBqG0G8kI1tcIwZp51djW2nC03d7BjG8J49jl4cgP3t/RetLp1+vT6O7v5fKhAvnk0UKFogeP3zmCCIoZkDCABQFhChQYuKBHgkUJkxpA2MhxQYEDFhNcvPBAI8eNCx7/gMQYckPJkxsZPLhIM8FLmDJrYiRp8mTKkCwT8IQJwSPQkENhpgQpEunNkzlpWkwKdSbGihKocowqVSvKWQkIOBSgQOYFDBgQpI0oYMGEt3AzTLKm4BqGtnDjirxW95vbvG/nWlub8G9euRsiqqWLF/AEkRoiprX2wLDeDQgkW9PQGLDgyNc665WguK8C0XAnRY6oGPUEuRLsgk5g+a3cCxUqSBC7gsCBBXcVq6swwULx4hayvctGPK8FCwsSLE9A3Hje6NOrHzeOnW695sffRi/9HfDz7sIVSNB+XXrmugo0rHcM3X388o6jr44ceb51uNjF1xcC8zk3wXiS8aYC/wESaLABBs7ch0ECjr2WAGvLsLZBeHqVFl9kGxooV0T81TVhBo6NiOEyJ4p4IYnNRBQiYCN6x4wCG3ZAY2If8jXjYRcyk2FmG/5nXAY8wqhWAii+1YGOSGLoY4VRfqiAgikwmIeS1gjAgHkWYLQZf9m49V9gDWYWY5nmTYCRM2TS5pxxb8IZGV5nhplmhJyZadxzbrpnZ2d/6rnZgHIid5xIMDaDgJfbLdrgMkKW+Rygz1kEZz1mehabkBpgiQIByVikwGTqVfDkk2/Vxxqiqur4X3fksHccre8xlxerDLiHjQIVUAgXr77yFeyuOvYqXGbMrbrqBMqaFpFFzhL7qv9i1FX7ZLR0LUNdcc4e6Cus263KbV+inkAAHhJg0BeITR6WmHcaxhvXg/AJiKO9R77ILF1FwmVdAu6WBu+ZFua72mkZWMfqBElKu0G8rFZ5n4ATp5jkmvsOq+Nj7u63ZMMPv4bveyYy6fDH+C6brgnACHBABQUrkGirz2FwAHnM4Mmhzq9yijOrOi/MKabH6VwBiYwZdukEQAvILKTWXVq0ZvH5/CfUM7M29Zetthp1eht0eqkFYw8IKXKA6mzXfTeH7fZg9zW0AhgY0TwthUa6Ch9dBeIsbsFrYkRBfgTfiG0FhwMWnbsoq3cABUYOnu/ejU/A6uNeT8u4wMb1WnBCyJJTLjjnr8o3OeJrUcpc5oCiPqAEkz8tXuLkPeDL3Uhs4fvvwAcv/PDEU9FFEcgnr/zyzDfv/PPQRy/99NRXf0IIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIWCw/AoDziOtCHt8BQ28PjmzK57Hom8fo42+P8DeAkbeYQcfX9+gYOFg4d1bIGEjQmPbICClI9/YwaLjHAJdJeKmZOViGtpn3qOqZineoeJgG8CeWUbBV4rAwkGAhIVGL97hGACGsrKCAgbBoTRhLvN1c3PepnU1s2/oZO6AtzdBoPf4eMI3tIJyOnF0YwFD+nY8e3z7+Xfefnj9uz8cVsXCh89axgk7BrAggAwBQsYIChwQILFixIeNIDAseOCBwcSXMy2sSPHjxJE/6a0eEGjSY4MQGK86PIlypUJEmYsaTKmyJ8JW/Ls6HMkzaEn8YwMWtPkx4pGd76E4DMPRqFTY860OGhogwYagBFoKEABA46DEGBAoEBB0AUT4sqdIFKBNbcC4M6dkEEk22oYFOTdG9fvWrtsBxM23MytYL17666t9phwXwlum2lIDHmuSA2IGyuOLOHv38qLMbdFjHruZbWgRXeOe1nC2BUEDiyAMMHZuwoTLAQX3nvDOAUW5Vogru434d4JnAsnPmFB9NBshQXfa9104+Rxl8e13rZxN+CEydtVsFkd+vDjE7C/q52wOvb4s7+faz025frbxefWbSoQIAEDEUCwgf9j7bUlwHN9ZVaegxDK1xYzFMJH24L5saXABhlYxiEzHoKoIV8LYqAMaw9aZqFmJUK4YHuNfRjiXhmk+NcyJgaIolvM8BhiBx3IleN8lH1IWAcRgkZgCgYiaBGJojGgHHFTgtagAFYSZhF7/qnTpY+faVlNAnqJN0EHWa6ozAZjBtgmmBokwMB01LW5jAZwbqfmlNips4B4eOqJgDJ2+imXRZpthuigeC6XZTWIxilXmRo8iYKBCwiWmWkJVEAkfB0w8KI1IvlIpKnOkVpqdB5+h96o8d3lFnijrgprjbfGRSt0lH0nAZG5vsprWxYRW6Suq4UWqrLEsspWg8Io6yv/q6EhK0Fw0GLbjKYn5CZYBYht1laPrnEY67kyrhYbuyceiR28Pso7bYwiXjihjWsWuWF5p/H765HmNoiur3RJsGKNG/jq748XMrwmjhwCfO6QD9v7LQsDxPTAMKsFpthyJCdkmgYiw0VdXF/Om9dyv7YMWGXTLYpZg5wNR11C78oW3p8HSGgul4qyrJppgllJHJZHn0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA=="); + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -11962,11 +14458,11 @@ define("text!ace/theme/tm.css", ".ace-tm .ace_editor {" + * ***** END LICENSE BLOCK ***** */ var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", - "pilot/environment", "demo_startup" ]; + "pilot/environment" ]; require(deps, function() { var catalog = require("pilot/plugin_manager").catalog; - catalog.registerPlugins([ "pilot/index" ]); + catalog.registerPlugins([ "pilot/index", "cockpit/index" ]); }); var ace = { diff --git a/build/ace.js b/build/ace.js index e41b52a4..b95393a8 100644 --- a/build/ace.js +++ b/build/ace.js @@ -1 +1 @@ -function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

      Welcome to Skywriter - Code in the Cloud

      ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

      Sub-Commands of "+e.name+"

      "),d.push("

      "+e.description+"

      ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

      Commands starting with '"+b.search+"':

      ")):d.push("

      Available Commands:

      ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
      "+e.name+""+e.description+"
      "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
      ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
      "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

      "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
      "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
      ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
      ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
      ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
      "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
      ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"])});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file +function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require._lookup(a))},this),b&&b.apply(null,c)}if(typeof a==="string"){payload=require._lookup(a),b&&b();return payload}}require.modules={},require._lookup=function(a){var b=require.modules[a];var c=a;b==null&&(console.error("Missing module: "+a),console.trace());if(typeof b==="function"){var d={};var e={id:a,uri:""};b(require,d,e),b=d,require.modules[c]=b}return b};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"

      Welcome to Skywriter - Code in the Cloud

      ",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("

      Sub-Commands of "+e.name+"

      "),d.push("

      "+e.description+"

      ")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("

      Commands starting with '"+b.search+"':

      ")):d.push("

      Available Commands:

      ");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push(""),d.push(""),d.push("")}d.push("
      "+e.name+""+e.description+"
      "),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
      ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+"
      "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):

      "+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push(""+d+""),c.push(""+a.typed+""),c.push(""),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
      "})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("cockpit/cli",function(a,b,c){var d=a("pilot/console");var e=a("pilot/lang");var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/types");var i=a("pilot/types").Status;var j=a("pilot/types").Conversion;var k=a("pilot/canon");b.startup=function(a,b){k.upgradeType("command",p)};function l(a,b,c,d,e){this.status=a,this.message=b;if(typeof c==="number")this.start=c,this.end=d,this.predictions=e;else{var f=c;this.start=f.start,this.end=f.end,this.predictions=f.predictions}}l.prototype={},l.sort=function(a,b){b!==undefined&&a.forEach(function(a){a.start===n.AT_CURSOR?a.distance=0:ba.end?a.distance=b-a.end:a.distance=0},this),a.sort(function(a,c){if(b!==undefined){var d=a.distance-c.distance;if(d!=0)return d}return c.status-a.status}),b!==undefined&&a.forEach(function(a){delete a.distance},this);return a},b.Hint=l;function m(a,b){this.status=a.status,this.message=a.message,b?(this.start=b.start,this.end=b.end):(this.start=0,this.end=0),this.predictions=a.predictions}f.inherits(m,l);function n(a,b,c,d,e,f){this.emitter=a,this.setText(b),this.start=c,this.end=d,this.prefix=e,this.suffix=f}n.prototype={merge:function(a){if(a.emitter!=this.emitter)throw new Error("Can't merge Arguments from different EventEmitters");return new n(this.emitter,this.text+this.suffix+a.prefix+a.text,this.start,a.end,this.prefix,a.suffix)},setText:function(a){if(a==null)throw new Error("Illegal text for Argument: "+a);var b={argument:this,oldText:this.text,text:a};this.text=a,this.emitter._dispatchEvent("argumentChange",b)},toString:function(){return this.prefix+this.text+this.suffix}},n.merge=function(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var d;for(var e=b;e: ";this.param.description&&(b+=this.param.description.trim(),b.charAt(b.length-1)!=="."&&(b+="."),b.charAt(b.length-1)!==" "&&(b+=" "));var c=i.VALID;var d=this.arg?this.arg.start:n.AT_CURSOR;var e=this.arg?this.arg.end:n.AT_CURSOR;var f;this.conversion&&(c=this.conversion.status,this.conversion.message&&(b+=this.conversion.message),f=this.conversion.predictions);var g=this.arg&&this.arg.text!=="";var h=this.value!==undefined||g;this.param.defaultValue===undefined&&!h&&(c=i.INVALID,b+="Required");return new l(c,b,d,e,f)},complete:function(){this.conversion&&this.conversion.predictions&&this.conversion.predictions.length>0&&this.setValue(this.conversion.predictions[0])},isPositionCaptured:function(a){if(!this.arg)return false;if(this.arg.start===-1)return false;if(a>this.arg.end)return false;if(a===this.arg.end)return this.conversion.status!==i.VALID||this.conversion.predictions.length!==0;return true},decrement:function(){var a=this.param.type.decrement(this.value);a!=null&&this.setValue(a)},increment:function(){var a=this.param.type.increment(this.value);a!=null&&this.setValue(a)},toString:function(){return this.arg?this.arg.toString():""}},b.Assignment=o;var p={name:"__command",type:"command",description:"The command to execute",getCustomHint:function(a,b){var c=[];c.push(" > "),c.push(a.name),a.params&&a.params.length>0&&a.params.forEach(function(a){a.defaultValue===undefined?c.push(" ["+a.name+"]"):c.push(" ["+a.name+"]")},this),c.push("
      "),c.push(a.description?a.description:"(No description)"),c.push("
      "),a.params&&a.params.length>0&&(c.push("
        "),a.params.forEach(function(a){c.push("
      • "),c.push(""+a.name+": "),c.push(a.description?a.description:"(No description)"),a.defaultValue===undefined?c.push(" [Required]"):a.defaultValue===null?c.push(" [Optional]"):c.push(" [Default: "+a.defaultValue+"]"),c.push("
      • ")},this),c.push("
      "));return new l(i.VALID,c.join(""),b)}};function q(a){this.env=a,this.commandAssignment=new o(p,this)}q.prototype={commandAssignment:undefined,assignmentCount:undefined,_assignments:undefined,_hints:undefined,_assignmentChanged:function(a){a.param.name!=="__command"||(this._assignments={},a.value&&a.value.params.forEach(function(a){this._assignments[a.name]=new o(a,this)},this),this.assignmentCount=Object.keys(this._assignments).length,this._dispatchEvent("commandChange",{command:a.value}))},getAssignment:function(a){var b=typeof a==="string"?a:Object.keys(this._assignments)[a];return this._assignments[b]},getParameterNames:function(){return Object.keys(this._assignments)},cloneAssignments:function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)},_updateHints:function(){this.getAssignments(true).forEach(function(a){this._hints.push(a.getHint())},this),l.sort(this._hints)},getWorstHint:function(){return this._hints[0]},getArgsObject:function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.value},this);return a},getAssignments:function(a){var b=[];a===true&&b.push(this.commandAssignment),Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b},setDefaultValues:function(){this.getAssignments().forEach(function(a){a.setValue(undefined)},this)},exec:function(){k.exec(this.commandAssignment.value,this.env,this.getArgsObject(),this.toCanonicalString())},toCanonicalString:function(){var a=[];a.push(this.commandAssignment.value.name),Object.keys(this._assignments).forEach(function(b){var c=this._assignments[b];var d=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(d.stringify(c.value)))},this);return a.join("")}},f.implement(q.prototype,g),b.Requisition=q;function r(a,b){q.call(this,a),b&&b.flags&&(this.flags=b.flags)}f.inherits(r,q),function(){r.prototype.update=function(a){this.input=a,this._hints=[];var b=this._tokenize(a.typed);this._split(b),this.commandAssignment.value&&this._assign(b),this._updateHints()},r.prototype.getInputStatusMarkup=function(){var a=this.toString().split("").map(function(a){return i.VALID});this._hints.forEach(function(b){for(var c=b.start;c<=b.end;c++)b.status>a[c]&&(a[c]=b.status)},this);return a},r.prototype.toString=function(){return this.getAssignments(true).map(function(a){return a.toString()},this).join("")};var a=r.prototype._updateHints;r.prototype._updateHints=function(){a.call(this);var b=this.input.cursor;this._hints.forEach(function(a){var c=b.start>=a.start&&b.start<=a.end;var d=b.end>=a.start&&b.end<=a.end;var e=c||d;!e&&a.status===i.INCOMPLETE&&(a.status=i.INVALID)},this),l.sort(this._hints)},r.prototype.getHints=function(){return this._hints},r.prototype.getAssignmentAt=function(a){var b=this.getAssignments(true);for(var c=0;c=a.length){if(f!==b){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,""))}else if(h!==i){var m=a.substring(i,h);var o=k[k.length-1];o?o.suffix+=m:(o=new n(this,"",h,h,m,""),k.push(o))}break}var p=a[h];switch(f){case b:p==="'"?(j=a.substring(i,h+1),f=d,i=h+1):p==="\""?(j=a.substring(i,h+1),f=e,i=h+1):/ /.test(p)||(j=a.substring(i,h),f=c,i=h);break;case c:if(p===" "){var l=g(a.substring(i,h));k.push(new n(this,l,i,h,j,"")),f=b,i=h,j=""}break;case d:if(p==="'"){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}break;case e:if(p==="\""){var l=g(a.substring(i,h));k.push(new n(this,l,i-1,h+1,j,p)),f=b,i=h+1,j=""}}h++}return k},r.prototype._split=function(a){var b=1;var c;while(b<=a.length){var c=n.merge(a,0,b);this.commandAssignment.setArgument(c);if(!this.commandAssignment.value)break;if(this.commandAssignment.value.exec){for(var d=0;d=a.length)break;continue}b.param.type.name==="boolean"?b.setValue(true):f+10){var g=n.merge(a);this._hints.push(new l(i.INVALID,"Input '"+g.text+"' makes no sense.",g))}}}}(),b.CliRequisition=r}),define("cockpit/commands/basic",function(a,b,c){var d=a("pilot/canon");var e={name:"sh",description:"Execute a system command (requires server support)",params:[{name:"command",type:"text",description:"The string to send to the os shell."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,true),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
      "+d.responseText+"
      "))},d.send(null)}};var d=a("pilot/canon");b.startup=function(a,b){d.addCommand(e)},b.shutdown=function(a,b){d.removeCommand(e)}}),define("cockpit/commands/git",function(a,b,c){var d=a("pilot/typecheck");var e=a("pilot/canon");var f=a("pilot/types").Type;var g=a("pilot/types");var h={name:"git",description:"Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals."};var i={name:"git add",description:"Add file contents to the index",manual:"This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit. It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.
      The \"index\" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working directory, and before running the commit command, you must use the add command to add any new or modified files to the index.
      This command can be performed multiple times before a commit. It only adds the content of the specified file(s) at the time the add command is run; if you want subsequent changes included in the next commit, then you must run git add again to add the new content to the index.
      The git status command can be used to obtain a summary of which files have changes that are staged for the next commit.
      The git add command will not add ignored files by default. If any ignored files were explicitly specified on the command line, git add will fail with a list of ignored files. Ignored files reached by directory recursion or filename globbing performed by Git (quote your globs before the shell) will be silently ignored. The git add command can be used to add ignored files with the -f (force) option.
      Please see git-commit(1) for alternative ways to add content to a commit.",params:[{name:"dry-run","short":"n",type:"bool",description:"Don't actually add the file(s), just show if they exist and/or will be ignored."},{name:"verbose","short":"v",type:"bool",description:"Be verbose."},{name:"force","short":"f",type:"bool",description:"Allow adding otherwise ignored files."},{name:"update","short":"u",type:"bool",description:"Only match filepattern against already tracked files in the index rather than the working tree.",manual:"That means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove files from the index if the corresponding files in the working tree have been removed.
      If no is given, default to \".\"; in other words, update all tracked files in the current directory and its subdirectories."},{name:"all","short":"A",type:"bool",description:"Like -u, but match filepattern against files in the working tree in addition to the index.",manual:"That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree."},{name:"intent-to-add","short":"N",type:"bool",description:"Record only the fact that the path will be added later.",manual:"An entry for the path is placed in the index with no content. This is useful for, among other things, showing the unstaged content of such files with git diff and committing them with git commit -a."},{name:"refresh",type:"bool",description:"Don't add the file(s), but only refresh their stat() information in the index."},{name:"ignore-errors",type:"bool",description:"If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.",manual:"The command shall still exit with non-zero status."},{name:"ignore-missing",type:"bool",description:"By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.",manual:"This option can only be used together with --dry-run."},{name:"filepattern",type:"text[]",description:"Files to add content from.",manual:"Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively."}],exec:function(a,b,c){var d=new XMLHttpRequest;d.open("GET","/exec?args="+b.command,true),d.onreadystatechange=function(a){d.readyState==4&&(d.status==200&&c.done("
      "+d.responseText+"
      "))},d.send(null)}};var j=new f;j.stringify=function(a){return a},j.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to commitObject.parse()");return new Conversion(a)},j.name="commitObject";var k=new f;k.stringify=function(a){return a},k.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to existingFile.parse()");return new Conversion(a)},k.name="existingFile";var l={name:"git commit",description:"Record changes to the repository",manual:"Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
      The content to be added can be specified in several ways:
      1. by using git add to incrementally \"add\" changes to the index before using the commit command (Note: even modified files must be \"added\");
      2. by using git rm to remove files from the working tree and the index, again before using the commit command;
      3. by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git);
      4. by using the -a switch with the commit command to automatically \"add\" changes from all known files (i.e. all files that are already listed in the index) and to automatically \"rm\" files in the index that have been removed from the working tree, and then perform the actual commit;
      5. by using the --interactive switch with the commit command to decide one by one which files should be part of the commit, before finalizing the operation. Currently, this is done by invoking git add --interactive.
      The --dry-run option can be used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters (options and paths).
      If you make a commit and then find a mistake immediately after that, you can recover from it with git reset.",params:[{name:"all","short":"a",type:"bool",description:"Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected."},{name:"reuse-message","short":"C",type:"commitObject",description:"Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit."},{name:"reset-author",type:"bool",description:"When used with --reuse-message/--amend options, declare that the authorship of the resulting commit now belongs of the committer. This also renews the author timestamp."},{name:"short",type:"bool",description:"When doing a dry-run, give the output in the short-format.",manual:"See git-status(1) for details. Implies --dry-run."},{name:"porcelain",type:"bool",description:"When doing a dry-run, give the output in a porcelain-ready format.",manual:"See git-status(1) for details. Implies --dry-run."},{name:"terminate-nul","short":"z",type:"bool",description:"When showing short or porcelain status output, terminate entries in the status output with NUL, instead of LF.",manual:"If no format is given, implies the --porcelain output format."},{name:"file","short":"F",type:"existingFile",description:"Take the commit message from the given file.",manual:""},{name:"author",type:"text",description:"Override the commit author.",manual:"Specify an explicit author using the standard A U Thor format. Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found."},{name:"date",type:"text",description:"Override the author date used in the commit."},{name:"message","short":"m",type:"text",description:"Use the given message as the commit message."},{name:"signoff","short":"s",type:"bool",description:"Add Signed-off-by line by the committer at the end of the commit log message."},{name:"no-verify","short":"n",type:"bool",description:"This option bypasses the pre-commit and commit-msg hooks. See also githooks(5)."},{name:"cleanup",type:{name:"selection",data:["verbatim","whitespace","strip","default"]},description:"This option sets how the commit message is cleaned up.",manual:"The default mode will strip leading and trailing empty lines and commentary from the commit message only if the message is to be edited. Otherwise only whitespace removed. The verbatim mode does not change message at all, whitespace removes just leading/trailing whitespace lines and strip removes both whitespace and commentary."},{name:"amend",type:"bool",description:"Used to amend the tip of the current branch.",manual:"Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create replaces the current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded."},{name:"include","short":"i",type:"bool",description:"Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.",manual:"This is usually not what you want unless you are concluding a conflicted merge."},{name:"only","short":"o",type:"bool",description:"Make a commit only from the paths specified on the command line, disregarding any contents that have been staged so far.",manual:"This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged."},{name:"untracked-files","short":"u",type:{name:"selection",data:["no","normal","all"]},description:"Show untracked files (Default: all).",manual:"The mode parameter is optional, and is used to specify the handling of untracked files. The possible options are: no - Show no untracked files.
      normal Shows untracked files and directories
      all Also shows individual files in untracked directories."},{name:"verbose","short":"v",type:"bool",description:"Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template.",manual:"Note that this diff output doesn't have its lines prefixed with #."},{name:"quiet","short":"q",type:"bool",description:"Suppress commit summary message."},{name:"dry-run",type:"bool",description:"Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked."},{name:"status",type:"bool",description:"Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message.",manual:"Defaults to on, but can be used to override configuration variable commit.status."},{name:"no-status",type:"bool",description:"Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message."},{name:"file",type:"existingFile[]",description:"When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged.",manual:"The contents of these files are also staged for the next commit on top of what have been staged before."}],exec:function(a,b,c){}};var m=[h,i,l];var e=a("pilot/canon");b.startup=function(a,b){g.registerType(j),g.registerType(k),m.forEach(function(a){e.addCommand(a)},this)},b.shutdown=function(a,b){m.forEach(function(a){e.removeCommand(a)},this),g.unregisterType(j),g.unregisterType(k)}}),define("cockpit/index",function(a,b,c){b.startup=function(b,c){a("pilot/index"),a("cockpit/cli").startup(b,c),a("cockpit/ui/settings").startup(b,c),a("cockpit/ui/cliView").startup(b,c),a("cockpit/commands/basic").startup(b,c)}}),define("cockpit/ui/cliView",function(a,b,c){var d=a("text!cockpit/ui/cliView.css");var e=a("pilot/dom");e.importCssString(d);var f=a("pilot/canon");var g=a("pilot/types").Status;var h=a("pilot/keyboard/keyutil");var i=a("cockpit/cli").CliRequisition;var j=a("cockpit/cli").Hint;var k=a("cockpit/ui/requestView").RequestView;var l=new j(g.VALID,"",0,0);b.startup=function(a,b){var c=new i(a.env);var d=new m(c,a.env)};function m(a,b){this.cli=a,this.doc=document,this.win=this.doc.defaultView,this.element=this.doc.getElementById("cockpitInput");this.element?(this.settings=b.settings,this.hintDirection=this.settings.getSetting("hintDirection"),this.outputDirection=this.settings.getSetting("outputDirection"),this.outputHeight=this.settings.getSetting("outputHeight"),this.isUpdating=false,this.createElements(),this.update()):console.log("No element with an id of cockpit. Bailing on cli")}m.prototype={createElements:function(){var a=this.element;this.element.spellcheck=false,this.output=this.doc.getElementById("cockpitOutput"),this.popupOutput=this.output==null;if(!this.output){this.output=this.doc.createElement("div"),this.output.id="cockpitOutput",this.output.className="cptFocusPopup",a.parentNode.insertBefore(this.output,a.nextSibling);var b=function(){this.output.style.maxHeight=this.outputHeight.get()+"px"}.bind(this);this.outputHeight.addEventListener("change",b),b()}this.completer=this.doc.createElement("div"),this.completer.className="cptCompletion VALID";var c=window.getComputedStyle(a,null);this.completer.style.color=c.color,this.completer.style.fontSize=c.fontSize,this.completer.style.fontFamily=c.fontFamily,this.completer.style.fontWeight=c.fontWeight,this.completer.style.fontStyle=c.fontStyle,a.parentNode.insertBefore(this.completer,a.nextSibling),this.completer.style.backgroundColor=a.style.backgroundColor,a.style.backgroundColor="transparent",this.hinter=this.doc.createElement("div"),this.hinter.className="cptHints cptFocusPopup",a.parentNode.insertBefore(this.hinter,a.nextSibling);var d=this.resizer.bind(this);this.win.addEventListener("resize",d,false),this.hintDirection.addEventListener("change",d),this.outputDirection.addEventListener("change",d),d(),f.addEventListener("output",function(a){new k(a.request,this)}.bind(this)),h.addKeyDownListener(a,this.onKeyDown.bind(this)),a.addEventListener("keyup",this.onKeyUp.bind(this),true),a.addEventListener("mouseup",function(a){this.isUpdating=true,this.update(),this.isUpdating=false}.bind(this),false),this.cli.addEventListener("argumentChange",this.onArgChange.bind(this))},scrollOutputToBottom:function(){var a=Math.max(this.output.scrollHeight,this.output.clientHeight);this.output.scrollTop=a-this.output.clientHeight},resizer:function(){var a=this.element.getClientRects()[0];this.completer.style.top=a.top+"px",this.completer.style.height=a.height+"px",this.completer.style.lineHeight=a.height+"px",this.completer.style.left=a.left+"px",this.completer.style.width=a.width+"px",this.hintDirection.get()==="below"?(this.hinter.style.top=a.bottom+"px",this.hinter.style.bottom="auto"):(this.hinter.style.top="auto",this.hinter.style.bottom=this.win.innerHeight-a.top+"px"),this.hinter.style.left=a.left+30+"px",this.hinter.style.maxWidth=a.width-110+"px",this.popupOutput&&(this.outputDirection.get()==="below"?(this.output.style.top=a.bottom+"px",this.output.style.bottom="auto"):(this.output.style.top="auto",this.output.style.bottom=this.win.innerHeight-a.top+"px"),this.output.style.left=a.left+"px",this.output.style.width=a.width-80+"px")},onKeyDown:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.TAB||a.keyCode===h.KeyHelper.KEY.UP||a.keyCode===h.KeyHelper.KEY.DOWN)return true;return b},onKeyUp:function(a){var b;if(a.keyCode===h.KeyHelper.KEY.RETURN){var c=this.cli.getWorstHint();c.status===g.VALID?(this.cli.exec(),this.element.value=""):(this.element.selectionStart=c.start,this.element.selectionEnd=c.end)}this.update();var d=this.cli.getAssignmentAt(this.element.selectionStart);d&&(a.keyCode===h.KeyHelper.KEY.TAB&&(d.complete(),this.update()),a.keyCode===h.KeyHelper.KEY.UP&&(d.increment(),this.update()),a.keyCode===h.KeyHelper.KEY.DOWN&&(d.decrement(),this.update()));return b},update:function(){this.isUpdating=true;var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};this.cli.update(a);var b=this.cli.getAssignmentAt(a.cursor.start).getHint();e.removeCssClass(this.completer,g.VALID.toString()),e.removeCssClass(this.completer,g.INCOMPLETE.toString()),e.removeCssClass(this.completer,g.INVALID.toString());var c="> ";if(this.element.value.length>0){var d=this.cli.getInputStatusMarkup();c+=this.markupStatusScore(d)}if(this.element.value.length>0&&b.predictions&&b.predictions.length>0){var f=b.predictions[0];c+="  ⇥ "+(f.name?f.name:f)}this.completer.innerHTML=c,e.addCssClass(this.completer,this.cli.getWorstHint().status.toString());var h="";this.element.value.length!==0&&(h+=b.message,b.predictions&&b.predictions.length>0&&(h+=": [ ",b.predictions.forEach(function(a){h+=a.name?a.name:a,h+=" | "},this),h=h.replace(/\| $/,"]"))),this.hinter.innerHTML=h,h.length===0?e.addCssClass(this.hinter,"cptNoPopup"):e.removeCssClass(this.hinter,"cptNoPopup"),this.isUpdating=false},markupStatusScore:function(a){var b="";var c=0;var d=-1;while(true){d!==a[c]&&(b+="",d=a[c]),b+=this.element.value[c],c++;if(c===this.element.value.length){b+="";break}d!==a[c]&&(b+="")}return b},onArgChange:function(a){if(!this.isUpdating){var b=this.element.value.substring(0,a.argument.start);var c=this.element.value.substring(a.argument.end);var d=typeof a.text==="string"?a.text:a.text.name;this.element.value=b+d+c;var e=(b+d).length;this.element.selectionStart=e,this.element.selectionEnd=e}}},b.CliView=m}),define("cockpit/ui/requestView",function(a,b,c){var d=a("pilot/dom");var e=a("pilot/event");var f=a("text!cockpit/ui/requestView.html");var g=a("pilot/domtemplate").Templater;var h=a("text!cockpit/ui/requestView.css");d.importCssString(h);var i=document.createElement("div");i.innerHTML=f;var j=i.querySelector(".cptRow");function k(b){var d=a("text!cockpit/ui/"+b);if(d)return d;var e=c.id.split("/").pop()+".js";var f;if(c.uri.substr(-e.length)!==e){console.error("Can't work out path from module.uri/module.id");return b}if(c.uri){var g=c.uri.length-e.length-1;return c.uri.substr(0,g)+b}return e+b}function l(a,b){this.request=a,this.cliView=b,this.imageUrl=k,this.rowin=null,this.rowout=null,this.output=null,this.hide=null,this.show=null,this.duration=null,this.throb=null,(new g).processNode(j.cloneNode(true),this),this.cliView.output.appendChild(this.rowin),this.cliView.output.appendChild(this.rowout),this.request.addEventListener("output",this.onRequestChange.bind(this))}l.prototype={copyToInput:function(){this.cliView.element.value=this.request.typed},executeRequest:function(a){this.cliView.cli.update({typed:this.request.typed,cursor:{start:0,end:0}}),this.cliView.cli.exec()},hideOutput:function(a){this.output.style.display="none",d.addCssClass(this.hide,"cmd_hidden"),d.removeCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},showOutput:function(a){this.output.style.display="block",d.removeCssClass(this.hide,"cmd_hidden"),d.addCssClass(this.show,"cmd_hidden"),e.stopPropagation(a)},remove:function(a){this.cliView.output.removeChild(this.rowin),this.cliView.output.removeChild(this.rowout),e.stopPropagation(a)},onRequestChange:function(a){this.duration.innerHTML=this.request.duration?"completed in "+this.request.duration/1e3+" sec ":"",this.output.innerHTML="",this.request.outputs.forEach(function(a){var b;typeof a=="string"?(b=document.createElement("p"),b.innerHTML=a):b=a,this.output.appendChild(b)},this),this.cliView.scrollOutputToBottom(),d.setCssClass(this.output,"cmd_error",this.request.error),this.throb.style.display=this.request.completed?"none":"block"}},b.RequestView=l}),define("cockpit/ui/settings",function(a,b,c){var d=a("pilot/types");var e=a("pilot/types/basic").SelectionType;var f=new e({name:"direction",data:["above","below"]});var g={name:"hintDirection",description:"Are hints shown above or below the command line?",type:"direction",defaultValue:"above"};var h={name:"outputDirection",description:"Is the output window shown above or below the command line?",type:"direction",defaultValue:"above"};var i={name:"outputHeight",description:"What height should the output panel be?",type:"number",defaultValue:300};b.startup=function(a,b){d.registerType(f),a.env.settings.addSetting(g),a.env.settings.addSetting(h),a.env.settings.addSetting(i)},b.shutdown=function(a,b){d.unregisterType(f),a.env.settings.removeSetting(g),a.env.settings.removeSetting(h),a.env.settings.removeSetting(i)}}),define("text!cockpit/ui/cliView.css","#cockpitInput { padding-left: 16px; }#cockpitOutput { overflow: auto; }#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }.cptFocusPopup { display: none; }#cockpitInput:focus ~ .cptFocusPopup { display: block; }#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }.cptCompletion { padding: 0; position: absolute; z-index: -1000; }.cptCompletion.VALID { background: #FFF; }.cptCompletion.INCOMPLETE { background: #DDD; }.cptCompletion.INVALID { background: #DDD; }.cptCompletion span { color: #FFF; }.cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }.cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }span.cptPrompt { color: #66F; font-weight: bold; }.cptHints { color: #000; position: absolute; border: 1px solid rgba(230, 230, 230, 0.8); background: rgba(250, 250, 250, 0.8); -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; border-top-left-radius: 10px; border-top-right-radius: 10px; z-index: 1000; padding: 8px; display: none;}.cptHints ul { margin: 0; padding: 0 15px; }.cptGt { font-weight: bold; font-size: 120%; }"),define("text!cockpit/ui/requestView.css",".cptRowIn { display: box; display: -moz-box; display: -webkit-box; box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal; box-align: center; -moz-box-align: center; -webkit-box-align: center; color: #333; background-color: #EEE; width: 100%; font-family: consolas, courier, monospace;}.cptRowIn > * { padding-left: 2px; padding-right: 2px; }.cptRowIn > img { cursor: pointer; }.cptHover { display: none; }.cptRowIn:hover > .cptHover { display: block; }.cptRowIn:hover > .cptHover.cptHidden { display: none; }.cptOutTyped { box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1; font-weight: bold; color: #000; font-size: 120%;}.cptRowOutput { padding-left: 10px; line-height: 1.2em; }.cptRowOutput strong,.cptRowOutput b,.cptRowOutput th,.cptRowOutput h1,.cptRowOutput h2,.cptRowOutput h3 { color: #000; }.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }.cptRowOutput input[type=password],.cptRowOutput input[type=text],.cptRowOutput textarea { color: #000; font-size: 120%; background: transparent; padding: 3px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;}.cptRowOutput table,.cptRowOutput td,.cptRowOutput th { border: 0; padding: 0 2px; }.cptRowOutput .right { text-align: right; }"),define("text!cockpit/ui/requestView.html","
      >
      ${request.typed}
      \"Hide \"Show \"Remove
      "),define("text!cockpit/ui/images/closer.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAj9JREFUeNp0ks+LUlEUx7/vV1o8Z8wUx3IEHcQmiBiQlomjRNCiZpEuEqF/oEUwq/6EhvoHggmRcJUQBM1CRJAW0aLIaGQimZJxJsWxyV/P9/R1zzWlFl04vPvOPZ9z7rnnK5imidmKRCIq+zxgdoPZ1T/ut8xeM3tcKpW6s1hhBkaj0Qj7bDebTX+324WmadxvsVigqipcLleN/d4rFoulORiLxTZY8ItOp8MBCpYkiYPj8Xjus9vtlORWoVB4KcTjcQc732dLpSRXvCZaAws6Q4WDdqsO52kNH+oCRFGEz+f7ydwBKRgMPmTXi49GI1x2D/DsznesB06ws2eDbI7w9HYN6bVjvGss4KAjwDAMq81mM2SW5Wa/3weBbz42UL9uYnVpiO2Nr9ANHSGXib2Wgm9tCYIggGKJEVkvlwgi5/FQRmTLxO6hgJVzI1x0T/fJrBtHJxPeL6tI/fsZLA6ot8lkQi8HRVbw94gkWYI5MaHrOjcCGSNRxZosy9y5cErDzn0Dqx7gcwO8WtBp4PndI35GMYqiUMUvBL5yOBz8yRfFNpbPmqgcCFh/IuHa1nR/YXGM8+oUpFhihEQiwcdRLpfVRqOBtWXWq34Gra6AXq8Hp2piZcmKT4cKnE4nwuHwdByVSmWQz+d32WCTlHG/qaHHREN9kgi0sYQfv0R4PB4EAgESQDKXy72fSy6VSnHJVatVf71eR7vd5n66mtfrRSgU4pLLZrOlf7RKK51Ok8g3/yPyR5lMZi7y3wIMAME4EigHWgKnAAAAAElFTkSuQmCC"),define("text!cockpit/ui/images/dot_clear.gif","data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"),define("text!cockpit/ui/images/minus.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4xMrIJw5EAAAHcSURBVCjPhZIxSxtxGMZ/976XhJA/RA5EAyJcFksnp64hjUPBoXRyCYLQTyD0UxScu0nFwalCQSgFCVk7dXAwUAiBDA2RO4W7yN1x9+9gcyhU+pteHt4H3pfncay1LOl0OgY4BN4Ar/7KP4BvwNFwOIyWu87S2O12O8DxfD73oygiSRIAarUaxhhWV1fHwMFgMBiWxl6v9y6Koi+3t7ckSUKtVkNVAcjzvNRWVlYwxry9vLz86uzs7HjAZDKZGGstjUaDfxHHMSLC5ubmHdB2VfVwNpuZ5clxHPMcRVFwc3PTXFtbO3RFZHexWJCmabnweAaoVqvlv4vFAhHZdVX1ZZqmOI5DURR8fz/lxbp9Yrz+7bD72SfPcwBU1XdF5N5aWy2KgqIoeBzPEnWVLMseYnAcRERdVR27rrsdxzGqyutP6898+GBsNBqo6i9XVS88z9sOggAR4X94noeqXoiIHPm+H9XrdYIgIAxDwjAkTVPCMESzBy3LMprNJr7v34nIkV5dXd2fn59fG2P2siwjSRIqlQrWWlSVJFcqlQqtVot2u40xZu/s7OxnWbl+v98BjkejkT+dTgmCoDxtY2ODra2tMXBweno6fNJVgP39fQN8eKbkH09OTsqS/wHFRdHPfTSfjwAAAABJRU5ErkJggg=="),define("text!cockpit/ui/images/pinaction.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClklEQVQ4EX1TXUhUQRQ+Z3Zmd+9uN1q2P3UpZaEwcikKekkqLKggKHJ96MHe9DmLkCDa9U198Id8kErICmIlRAN96UdE6QdBW/tBA5Uic7E0zN297L17p5mb1zYjD3eYc+d83zlnON8g5xzWNUSEdUBkHTJasRWySPP7fw3hfwkk2GoNsc0vOaJRHo1GV/GiMctkTIJRFlpZli8opK+htmf83gXeG63oteOtra0u25e7TYJIJELb26vYCACTgUe1lXV86BTn745l+MsyHqs53S/Aq4VEUa9Y6ko14eYY4u3AyM3HYwdKU35DZyblGR2+qq6W0X2Nnh07xynnVYpHORx/E1/GvvqaAZUayjMjdM2f/Lgr5E+fV93zR4u3zKCLughsZqKwAzAxaz6dPY6JgjLUF+eSP5OpjmAw2E8DvldHSvJMKPg08aRor1tc4BuALu6mOwGWdQC3mKIqRsC8mKd8wYfD78/earzSYzdMDW9QgKb0Is8CBY1mQXOiaXAHEpMDE5XTJqIq4EiyxUqKlpfkF0pyV1OTAoFAhmTmyCCoDsZNZvIkUjELQpipo0sQqYZAswZHwsEEE10M0pq2SSZY9HqNcDicJcNTpBvQJz40UbSOTh1B8bDpuY0w9Hb3kkn9lPAlBLfhfD39XTtX/blFJqiqrjbkTi63Hbofj2uL4GMsmzFgbDJ/vmMgv/lB4syJ0oXO7d3j++vio6GFsYmD6cHJreWc3/jRVVHhsOYvM8iZ36mtjPDBk/xDZE8CoHlbrlAssbTxDdDJvdb536L7I6S7Vy++6Gi4Xi9BsUthJRaLOYSPz4XALKI4j4iObd/e5UtDKUjZzYyYRyGAJv01Zj8kC5cbs5WY83hQnv0DzCXl+r8APElkq0RU6oMAAAAASUVORK5CYII="),define("text!cockpit/ui/images/pinin.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABZ0lEQVQ4Ea2TPUsDQRCGZ89Eo4FACkULEQs1CH4Uamfjn7GxEYJFIFXgChFsbPwzNnZioREkaiHBQtEiEEiMRm/dZ8OEGAxR4sBxx877Pju7M2estTJIxLrNuVwuMxQEx0ZkzcFHyRtjXt02559RtB2GYanTYzoryOfz+6l4Nbszf2niwffKmpGRo9sVW22mDgqFwp5C2gDMm+P32a3JB1N+n5JifUGeP9JeNxGryPLYjcwMP8rJ07Q9fZltQzyAstOJ2vVu5sKc1ZZkRBrOcKeb+HexPidvkpCN5JUcllZtpZFc5DgBWc5M2eysZuMuofMBSA4NWjx4PUCsXefMlI0QY3ewRg4NWi4ZTQsgrjYXema+e4VqtEMK6KXvu+4B9Bklt90vVKMeD2BI6DOt4rZ/Gk7WyKFBi4fNPIAJY0joM61SCCZ9tI1o0OIB8D+DBIkYaJRbCBH9mZgNt+bb++ufSSF/eX8BYcDeAzuQJVUAAAAASUVORK5CYII="),define("text!cockpit/ui/images/pinout.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAACyUlEQVQ4EW1TXUgUURQ+Z3ZmnVV3QV2xJbVSEIowQbAfLQx8McLoYX2qjB58MRSkP3vZppceYhGxgrZaIughlYpE7CHFWiiKyj9II0qxWmwlNh1Xtp2f27mz7GDlZX7uuXO+73zfuXeQMQYIgAyALppgyBtse32stsw86txkHhATn+FbfPfzxnPB+vR3RMJYuTwW6bbB4a6WS5O3Yu2VlXIesDiAamiQNKVlVXfx5I0GJ7DY7p0/+erU4dgeMJIA31WNxZmAgibOreXDqF55sY4SFUURqbi+nkjgwTyAbHhLX8yOLsSM2QRA3JRAAgd4RGPbVhkKEp8qeJ7PFyW3fw++YHtC7CkaD0amqyqihSwlMQQ0wa07IjPVI/vbexreIUrVaQV2D4RMQ/o7m12Mdfx4H3PfB9FNzTR1U2cO0Bi45aV6xNvFBNaoIAfbSiwLlqi9/hR/R3Nrhua+Oqi9TEKiB02C7YXz+Pba4MTDrpbLiMAxNgmXb+HpwVkZdoIrkn9isW7nRw/TZYaagZArAWyhfqsSDL/c9aTx7JUjGZCtYExRqCzAwGblwr6aFQ84nTo6qZ7XCeCVQNckE/KSWolvoQnxeoFFgIh8G/nA+kBAxxuQO5m9eFrwLIGJHgcyM63VFMhRSgNVyJr7og8y1vbTQpH8DIEVgxuYuexw0QECIalq5FYgEmpkgoFYltU/lnrqDz5osirSFpF7lrHAFKSWHYfEs+mY/82UnAStyMlW8sUPsVIciTZgz3jV1ebg0CEOpgPF22s1z1YQYKSXPJ1hbAhR8T26WdLhkuVfAzPR+YO1Ox5n58SmCcF6e3uzAoHA77RkevJdWH/3+f2O9TGf3w3fWQ2Hw5F/13mcsWAT+vv6DK4kFApJ/d3d1k+kJtbCrmxXHS3n8ER6b3CQbAqaEHVra6sGxcXW4SovLx+empxapS//FfwD9kpMJjMMBBAAAAAASUVORK5CYII="),define("text!cockpit/ui/images/pins.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGYklEQVRIDbVWe0yURxCf/R735o6DO0FBe0RFsaL4iLXGIKa2SY3P6JGa2GpjlJjUV9NosbU++tYUbEnaQIrVaKJBG7WiNFQFUWO1UUEsVg2CAgoeHHLewcH32O58cBdQsX9Y5+7LfrszOzO/2ZnZj1BKgTBiIwVGVvKd49OVVYunDlXn6wdBKh+ogXrv+DOz1melIb+3LM5fNv2XPYE5EHY+L3PJljN5zavHpJjsQNsA/JJEgyC2+WTjy3b0GfoJW8O4aoHtDwiHQrj5lw1LLyyb1bp5zAjJTus9klrVpdD6TqH2ngVO+0dsRJnp06cLIYU4fx7NnRI3bu7UIYOeJ/McnuY88q3k62gc0S4Dgf5qhICQtIXS2lqD7BhSduPk3YfyzXaANhBBJDxYdUqCywB2qS4RdyUuSkTF/VJxcbH5j8N7/75RuFrN3Zh8OS8zqf5m4UpPeenOyP42dbtBeuvVnCdkK1e4PfPouX03mo9se+c33M8wqDk5Ofqed8REUTicQhbySUxp9u3KlMSHTtrFU6Kyn03lz15PPpW25vsZeYSIKyiVURcqeZJOH9lTNZLfnxRjU/uwrjbEUBWsapcSO2Hq4k0VfZg9EzxdDNCEjDxgNqRDme9umz/btwlsHRIEePHgAf73RdnHZ6LTuIUBN7OBQ+c1Fdnp6cZ1BQUdeRuWZi97o3ktDQQkVeFFzqJARd1A5a0Vr7ta6Kp6TZjtZ+NTIOoKF6qDrL7e0QQIUCiqMMKk8Z1Q/SCSKvzocf2B6NEN0SQn/kTO6fKJ0zqjZUlQBSpJ0GjR77w0aoc1Pr6S5/kVJrNpakV5hR+LWKN4t7sLX+p0rx2vqSta64olIulUKUgCSXLWE1R4KPPSj+5vhm2hdDOG+CkQBmhhyyKq6SaFYWTn5bB3QJRNz54AuXKn8TJjhu0Wbv+wNEKQjVhnmKopjo4FxXmetCRnC4F7BhCiCUepqAepRh0TM/gjjzOOSK2NgWZPc05qampRWJHb7dbOffep2ednzLzgczlbrQA6gHYF9BYDh9GY+FjddMweHMscmMuep07gXlMQoqw9ALoYu5MJsak9QmJA2IvAgVmoCRciooyPujJtNCv1uHt3TmK9gegFKrG9kh6oXwZiIEAtBIjORGKNTWR/WeW8XVkbjuJepLAyloM8LmTN//njKZPbraATZaLjCHEww9Ei4FFiPg6Ja5gT6gxYgLgnRDHRQwJXbz2GOw0d4A3K4GXlUtMahJjYVxiYbrwOmxIS10bFnIBOSi6Tl9Jgs0zbOEX18wyEwgLPMrxD1Y4aCK8kmTpgYcpAF27Mzs42Hjx4kA8BICUlJfKArR7LcEvTB1xEC9AoEw9OPagWkVU/D1oesmK6U911zEczMVe01oZjiMggg6ux2Qk379qh4rYKet4GjrhhwEteBgBrH8BssoXEtbHzPpSBRRSpqlNpgAiUoxzHKxLRszoVuggIisxaDQWZqkQvQjAoax3NbDbLLGuUEABNGedXqSyLRupXgDT5JfAGZNLio9B0X8Uiwk4w77MDc1D4yejjWtykPS3DX01UDCY/GPQcVDe0QYT0CIxGFvUorfvBxZsRfVrUuWruMBAb/lXCUofoFNZfzGJtowXOX0vwUSFK4BgyMKm6P6s9wQUZld+jrYyMDC0iIQDaJdG4IyZQfL3RfbFcCBIlRgc+u3CjaTApuZ9KsANgG8PNzHlWWD3tCxd6kafNNiFp5HAalAkkJ0SCV2H3CgOD9Nc/FqrXuyb0Eocvfhq171p5eyuJ1omKJEP5rQGe/FOOnXtq335z8YmvYo9cHb2t8spIb3lVSseZW46FlGY/Sk9P50P2w20UlWJUkUHIushfc5PXGAzCo0PlD2pnpCYfCXga3lu+fPlevEhWrVrFyrN/Orfv87FOW9tlqb2Kc9pV8DzioMk3UNUbXM+8B/ATBr8C8CKdvGXWGD/9sqm3dkxtzA4McMjHMB8D2ftheYXo+qzt3pXvz8/PP/vk+v8537V+yYW87Zu+RZ1ZbrexoKAA/SBpaWn4+aL5w5zGk+/jW59JiMkESW5urpiVlWXENRb1H/Yf2I9txIxz5IdkX3TsraukpsbQjz6090yb4XsAvQoRE0YvJdamtIIbOnRoUVlZ2ftsLVQzIdEXHntsaZdimssVfCpFui109+BnWPsXaWLI/zactygAAAAASUVORK5CYII="),define("text!cockpit/ui/images/plus.png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4yFTwuJTkAAAH7SURBVCjPdZKxa1NRFMZ/956XZMgFyyMlCZRA4hBx6lBcQ00GoYi4tEstFPwLAs7iLDi7FWuHThaUggihBDI5OWRoQAmBQFISQgvvpbwX3rsOaR4K+o2H8zvfOZxPWWtZqVarGaAJPAEe3ZW/A1+Bd+1221v1qhW4vb1dA44mk0nZ8zyCIAAgk8lgjGF9fb0PHF5cXLQTsF6vP/c879P19TVBEJDJZBARAKIoSmpra2sYY561Wq3PqtFouMBgMBgYay3ZbJZ/yfd9tNaUSqUboOKISPPq6sqsVvZ9H4AvL34B8PTj/QSO45jpdHovn883Ha31znw+JwzDpCEMQx4UloM8zyOdTif3zudztNY7jog8DMMQpRRxHPPt5TCBAEZvxlyOFTsfykRRBICIlB2t9a21Nh3HMXEc8+d7VhJHWCwWyzcohdZaHBHpO46z6fs+IsLj94XECaD4unCHL8FsNouI/HRE5Nx13c3ZbIbWOnG5HKtl+53TSq7rIiLnand31wUGnU7HjEYjlFLJZN/3yRnL1FMYY8jlcmxtbd0AFel2u7dnZ2eXxpi9xWJBEASkUimstYgIQSSkUimKxSKVSgVjzN7p6emPJHL7+/s14KjX65WHwyGz2SxZbWNjg2q12gcOT05O2n9lFeDg4MAAr/4T8rfHx8dJyH8DvvbYGzKvWukAAAAASUVORK5CYII="),define("text!cockpit/ui/images/throbber.gif","data:image/gif;base64,R0lGODlh3AATAPQAAP///wAAAL6+vqamppycnLi4uLKyssjIyNjY2MTExNTU1Nzc3ODg4OTk5LCwsLy8vOjo6Ozs7MrKyvLy8vT09M7Ozvb29sbGxtDQ0O7u7tbW1sLCwqqqqvj4+KCgoJaWliH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFg8PwKIMHnLF63N2438f0mv1I2O8buXjvaOPtaHx7fn96goR4hmuId4qDdX95c4+RG4GCBoyAjpmQhZN0YGYFXitdZBIVGAoKoq4CG6Qaswi1CBtkcG6ytrYJubq8vbfAcMK9v7q7D8O1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQgDLAQGCQoLDA0QCwUHqfYSFw/xEPz88/X38Onr14+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU7EGNDiRn8Z831cGLHhSIgdE/9chIeBgDoB7gjaWUWTlYAFE3LqzDCTlc9WOHfm7PkTqNCh54rePDqB6M+lR536hCpUqs2gVZM+xbrTqtGoWqdy1emValeXKwgcWABB5y1acFNZmEvXwoJ2cGfJrTv3bl69Ffj2xZt3L1+/fw3XRVw4sGDGcR0fJhxZsF3KtBTThZxZ8mLMgC3fRatCLYMIFCzwLEprg84OsDus/tvqdezZf13Hvr2B9Szdu2X3pg18N+68xXn7rh1c+PLksI/Dhe6cuO3ow3NfV92bdArTqC2Ebc3A8vjf5QWf15Bg7Nz17c2fj69+fnq+8N2Lty+fuP78/eV2X13neIcCeBRwxorbZrAxAJoCDHbgoG8RTshahQ9iSKEEzUmYIYfNWViUhheCGJyIP5E4oom7WWjgCeBBAJNv1DVV01MZdJhhjdkplWNzO/5oXI846njjVEIqR2OS2B1pE5PVscajkxhMycqLJgxQCwT40PjfAV4GqNSXYdZXJn5gSkmmmmJu1aZYb14V51do+pTOCmA00AqVB4hG5IJ9PvYnhIFOxmdqhpaI6GeHCtpooisuutmg+Eg62KOMKuqoTaXgicQWoIYq6qiklmoqFV0UoeqqrLbq6quwxirrrLTWauutJ4QAACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAXHx/EoCzboAcdhcLDdgwJ6nua03YZ8PMFPoBMca215eg98G36IgYNvDgOGh4lqjHd7fXOTjYV9nItvhJaIfYF4jXuIf4CCbHmOBZySdoOtj5eja59wBmYFXitdHhwSFRgKxhobBgUPAmdoyxoI0tPJaM5+u9PaCQZzZ9gP2tPcdM7L4tLVznPn6OQb18nh6NV0fu3i5OvP8/nd1qjwaasHcIPAcf/gBSyAAMMwBANYEAhWYQGDBhAyLihwYJiEjx8fYMxIcsGDAxVA/yYIOZIkBAaGPIK8INJlRpgrPeasaRPmx5QgJfB0abLjz50tSeIM+pFmUo0nQQIV+vRlTJUSnNq0KlXCSq09ozIFexEBAYkeNiwgOaEtn2LFpGEQsKCtXbcSjOmVlqDuhAx3+eg1Jo3u37sZBA9GoMAw4MB5FyMwfLht4sh7G/utPGHlYAV8Nz9OnOBz4c2VFWem/Pivar0aKCP2LFn2XwhnVxBwsPbuBAQbEGiIFg1BggoWkidva5z4cL7IlStfkED48OIYoiufYIH68+cKPkqfnsB58ePjmZd3Dj199/XE20tv6/27XO3S6z9nPCz9BP3FISDefL/Bt192/uWmAv8BFzAQAQUWWFaaBgqA11hbHWTIXWIVXifNhRlq6FqF1sm1QQYhdiAhbNEYc2KKK1pXnAIvhrjhBh0KxxiINlqQAY4UXjdcjSJyeAx2G2BYJJD7NZQkjCPKuCORKnbAIXsuKhlhBxEomAIBBzgIYXIfHfmhAAyMR2ZkHk62gJoWlNlhi33ZJZ2cQiKTJoG05Wjcm3xith9dcOK5X51tLRenoHTuud2iMnaolp3KGXrdBo7eKYF5p/mXgJcogClmcgzAR5gCKymXYqlCgmacdhp2UCqL96mq4nuDBTmgBasaCFp4sHaQHHUsGvNRiiGyep1exyIra2mS7dprrtA5++z/Z8ZKYGuGsy6GqgTIDvupRGE+6CO0x3xI5Y2mOTkBjD4ySeGU79o44mcaSEClhglgsKyJ9S5ZTGY0Bnzrj+3SiKK9Rh5zjAALCywZBk/ayCWO3hYM5Y8Dn6qxxRFsgAGoJwwgDQRtYXAAragyQOmaLKNZKGaEuUlpyiub+ad/KtPqpntypvvnzR30DBtjMhNodK6Eqrl0zU0/GjTUgG43wdN6Ra2pAhGtAAZGE5Ta8TH6wknd2IytNKaiZ+Or79oR/tcvthIcAPe7DGAs9Edwk6r3qWoTaNzY2fb9HuHh2S343Hs1VIHhYtOt+Hh551rh24vP5YvXSGzh+eeghy76GuikU9FFEainrvrqrLfu+uuwxy777LTXfkIIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BAWHB2l4CDZo9IDjcBja7UEhTV+3DXi3PJFA8xMcbHiDBgMPG31pgHBvg4Z9iYiBjYx7kWocb26OD398mI2EhoiegJlud4UFiZ5sm6Kdn2mBr5t7pJ9rlG0cHg5gXitdaxwFGArIGgoaGwYCZ3QFDwjU1AoIzdCQzdPV1c0bZ9vS3tUJBmjQaGXl1OB0feze1+faiBvk8wjnimn55e/o4OtWjp+4NPIKogsXjaA3g/fiGZBQAcEAFgQGOChgYEEDCCBBLihwQILJkxIe/3wMKfJBSQkJYJpUyRIkgwcVUJq8QLPmTYoyY6ZcyfJmTp08iYZc8MBkhZgxk9aEcPOlzp5FmwI9KdWn1qASurJkClRoWKwhq6IUqpJBAwQEMBYroAHkhLt3+RyzhgCDgAV48Wbgg+waAnoLMgTOm6DwQ8CLBzdGdvjw38V5JTg2lzhyTMeUEwBWHPgzZc4TSOM1bZia6LuqJxCmnOxv7NSsl1mGHHiw5tOuIWeAEHcFATwJME/ApgFBc3MVLEgPvE+Ddb4JokufPmFBAuvPXWu3MIF89wTOmxvOvp179evQtwf2nr6aApPyzVd3jn089e/8xdfeXe/xdZ9/d1ngHf98lbHH3V0LMrgPgsWpcFwBEFBgHmyNXWeYAgLc1UF5sG2wTHjIhNjBiIKZCN81GGyQwYq9uajeMiBOQGOLJ1KjTI40kmfBYNfc2NcGIpI4pI0vyrhjiT1WFqOOLEIZnjVOVpmajYfBiCSNLGbA5YdOkjdihSkQwIEEEWg4nQUmvYhYe+bFKaFodN5lp3rKvJYfnBKAJ+gGDMi3mmbwWYfng7IheuWihu5p32XcSWdSj+stkF95dp64jJ+RBipocHkCCp6PCiRQ6INookCAAwy0yd2CtNET3Yo7RvihBjFZAOaKDHT43DL4BQnsZMo8xx6uI1oQrHXXhHZrB28G62n/YSYxi+uzP2IrgbbHbiaer7hCiOxDFWhrbmGnLVuus5NFexhFuHLX6gkEECorlLpZo0CWJG4pLjIACykmBsp0eSSVeC15TDJeUhlkowlL+SWLNJpW2WEF87urXzNWSZ6JOEb7b8g1brZMjCg3ezBtWKKc4MvyEtwybPeaMAA1ECRoAQYHYLpbeYYCLfQ+mtL5c9CnfQpYpUtHOSejEgT9ogZ/GSqd0f2m+LR5WzOtHqlQX1pYwpC+WbXKqSYtpJ5Mt4a01lGzS3akF60AxkcTaLgAyRBPWCoDgHfJqwRuBuzdw/1ml3iCwTIeLUWJN0v4McMe7uasCTxseNWPSxc5RbvIgD7geZLbGrqCG3jepUmbbze63Y6fvjiOylbwOITPfIHEFsAHL/zwxBdvPBVdFKH88sw37/zz0Ecv/fTUV2/99SeEAAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2cw8BQEm3T6yHEYHHD4oKCuD9qGvNsxT6QTgAkcHHmFeX11fm17hXwPG35qgnhxbwMPkXaLhgZ9gWp3bpyegX4DcG+inY+Qn6eclpiZkHh6epetgLSUcBxlD2csXXdvBQrHGgoaGhsGaIkFDwjTCArTzX+QadHU3c1ofpHc3dcGG89/4+TYktvS1NYI7OHu3fEJ5tpqBu/k+HX7+nXDB06SuoHm0KXhR65cQT8P3FRAMIAFgVMPwDCAwLHjggIHJIgceeFBg44eC/+ITCCBZYKSJ1FCWPBgpE2YMmc+qNCypwScMmnaXAkUJYOaFVyKLOqx5tCXJnMelcBzJNSYKIX2ZPkzqsyjPLku9Zr1QciVErYxaICAgEUOBRJIgzChbt0MLOPFwyBggV27eCUcmxZvg9+/dfPGo5bg8N/Ag61ZM4w4seDF1fpWhizZmoa+GSortgcaMWd/fkP/HY0MgWbTipVV++wY8GhvqSG4XUEgoYTKE+Qh0OCvggULiBckWEZ4Ggbjx5HXVc58IPQJ0idQJ66XanTpFraTe348+XLizRNcz658eHMN3rNPT+C+G/nodqk3t6a+fN3j+u0Xn3nVTQPfdRPspkL/b+dEIN8EeMm2GAYbTNABdrbJ1hyFFv5lQYTodSZABhc+loCEyhxTYYkZopdMMiNeiBxyIFajV4wYHpfBBspUl8yKHu6ooV5APsZjQxyyeNeJ3N1IYod38cgdPBUid6GCKfRWgAYU4IccSyHew8B3doGJHmMLkGkZcynKk2Z50Ym0zJzLbDCmfBbI6eIyCdyJmJmoqZmnBAXy9+Z/yOlZDZpwYihnj7IZpuYEevrYJ5mJEuqiof4l+NYDEXQpXQcMnNjZNDx1oGqJ4S2nF3EsqWrhqqVWl6JIslpAK5MaIqDeqjJq56qN1aTaQaPbHTPYr8Be6Gsyyh6Da7OkmmqP/7GyztdrNVQBm5+pgw3X7aoYKhfZosb6hyUKBHCgQKij1rghkOAJuZg1SeYIIY+nIpDvf/sqm4yNG5CY64f87qdAwSXKGqFkhPH1ZHb2EgYtw3bpKGVkPz5pJAav+gukjB1UHE/HLNJobWcSX8jiuicMMBFd2OmKwQFs2tjXpDfnPE1j30V3c7iRHlrzBD2HONzODyZtsQJMI4r0AUNaE3XNHQw95c9GC001MpIxDacFQ+ulTNTZlU3O1eWVHa6vb/pnQUUrgHHSBKIuwG+bCPyEqbAg25gMVV1iOB/IGh5YOKLKIQ6xBAcUHmzjIcIqgajZ+Ro42DcvXl7j0U4WOUd+2IGu7DWjI1pt4DYq8BPm0entuGSQY/4tBi9Ss0HqfwngBQtHbCH88MQXb/zxyFfRRRHMN+/889BHL/301Fdv/fXYZ39CCAAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFh2fAKXsKm7R6Q+Y43vABep0mGwwOPH7w2CT+gHZ3d3lyagl+CQNvg4yGh36LcHoGfHR/ZYOElQ9/a4ocmoRygIiRk5p8pYmZjXePaYBujHoOqp5qZHBlHAUFXitddg8PBg8KGsgayxvGkAkFDwgICtPTzX2mftHW3QnOpojG3dbYkNjk1waxsdDS1N7ga9zw1t/aifTk35fu6Qj3numL14fOuHTNECHqU4DDgQEsCCwidiHBAwYQMmpcUOCAhI8gJVzUuLGThAQnP/9abEAyI4MCIVOKZNnyJUqUJxNcGNlywYOQgHZirGkSJ8gHNEky+AkS58qWEJYC/bMzacmbQHkqNdlUJ1KoSz2i9COhmQYCEXtVrCBgwYS3cCf8qTcNQ9u4cFFOq2bPLV65Cf7dxZthbjW+CgbjnWtNgWPFcAsHdoxgWWK/iyV045sAc2S96SDn1exYw17REwpLQEYt2eW/qtPZRQAB7QoC61RW+GsBwYZ/CXb/XRCYLsAKFizEtUAc+G7lcZsjroscOvTmsoUvx15PwccJ0N8yL17N9PG/E7jv9S4hOV7pdIPDdZ+ePDzv2qMXn2b5+wTbKuAWnF3oZbABZY0lVmD/ApQd9thybxno2GGuCVDggaUpoyBsB1bGGgIYbJCBcuFJiOAyGohIInQSmmdeiBnMF2GHfNUlIoc1rncjYRjW6NgGf3VQGILWwNjBfxEZcAFbC7gHXQcfUYOYdwzQNxo5yUhQZXhvRYlMeVSuSOJHKJa5AQMQThBlZWZ6Bp4Fa1qzTAJbijcBlJrtxeaZ4lnnpZwpukWieGQmYx5ATXIplwTL8DdNZ07CtWYybNIJF4Ap4NZHe0920AEDk035kafieQrqXofK5ympn5JHKYjPrfoWcR8WWQGp4Ul32KPVgXdnqxM6OKqspjIYrGPDrlrsZtRIcOuR86nHFwbPvmes/6PH4frrqbvySh+mKGhaAARPzjjdhCramdoGGOhp44i+zogBkSDuWC5KlE4r4pHJkarXrj++Raq5iLmWLlxHBteavjG+6amJrUkJJI4Ro5sBv9AaOK+jAau77sbH7nspCwNIYIACffL7J4JtWQnen421nNzMcB6AqpRa9klonmBSiR4GNi+cJZpvwgX0ejj71W9yR+eIgaVvQgf0l/A8nWjUFhwtZYWC4hVnkZ3p/PJqNQ5NnwUQrQCGBBBMQIGTtL7abK+5JjAv1fi9bS0GLlJHgdjEgYzzARTwC1fgEWdJuKKBZzj331Y23qB3i9v5aY/rSUC4w7PaLeWXmr9NszMFoN79eeiM232o33EJAIzaSGwh++y012777bhT0UURvPfu++/ABy/88MQXb/zxyCd/QggAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEBY5nwCk7xIWNer0hO95wziC9Ttg5b4ND/+Y87IBqZAaEe29zGwmJigmDfHoGiImTjXiQhJEPdYyWhXwDmpuVmHwOoHZqjI6kZ3+MqhyemJKAdo6Ge3OKbEd4ZRwFBV4rc4MPrgYPChrMzAgbyZSJBcoI1tfQoYsJydfe2amT3d7W0OGp1OTl0YtqyQrq0Lt11PDk3KGoG+nxBpvTD9QhwCctm0BzbOyMIwdOUwEDEgawIOCB2oMLgB4wgMCx44IHBySIHClBY0ePfyT/JCB5weRJCAwejFw58kGDlzBTqqTZcuPLmCIBiWx58+VHmiRLFj0JVCVLl0xl7qSZwCbOo0lFWv0pdefQrVFDJtr5gMBEYBgxqBWwYILbtxPsqMPAFu7blfa81bUbN4HAvXAzyLWnoDBguHIRFF6m4LBbwQngMYPXuC3fldbyPrMcGLM3w5wRS1iWWUNlvnElKDZtz/EEwaqvYahQoexEfyILi4RrYYKFZwJ3810QWZ2ECrx9Ew+O3K6F5Yq9zXbb+y30a7olJJ+wnLC16W97Py+uwdtx1NcLWzs/3G9e07stVPc9kHJ0BcLtQp+c3ewKAgYkUAFpCaAmmHqKLSYA/18WHEiZPRhsQF1nlLFWmIR8ZbDBYs0YZuCGpGXWmG92aWiPMwhEOOEEHXRwIALlwXjhio+BeE15IzpnInaLbZBBhhti9x2GbnVQo2Y9ZuCfCgBeMCB+DJDIolt4iVhOaNSJdCOBUfIlkmkyMpPAAvKJ59aXzTQzJo0WoJnmQF36Jp6W1qC4gWW9GZladCiyJd+KnsHImgRRVjfnaDEKuiZvbcYWo5htzefbl5LFWNeSKQAo1QXasdhiiwwUl2B21H3aQaghXnPcp1NagCqYslXAqnV+zYWcpNwVp9l5eepJnHqL4SdBi56CGlmw2Zn6aaiZjZqfb8Y2m+Cz1O0n3f+tnvrGbF6kToApCgAWoNWPeh754JA0vmajiAr4iOuOW7abQXVGNriBWoRdOK8FxNqLwX3oluubhv8yluRbegqGb536ykesuoXhyJqPQJIGbLvQhkcwjKs1zBvBwSZIsbcsDCCBAAf4ya+UEhyQoIiEJtfoZ7oxUOafE2BwgMWMqUydfC1LVtiArk0QtGkWEopzlqM9aJrKHfw5c6wKjFkmXDrbhwFockodtMGFLWpXy9JdiXN1ZDNszV4WSLQCGBKoQYHUyonqrHa4ErewAgMmcAAF7f2baIoVzC2p3gUvJtLcvIWqloy6/R04mIpLwDhciI8qLOB5yud44pHPLbA83hFDWPjNbuk9KnySN57Av+TMBvgEAgzzNhJb5K777rz37vvvVHRRxPDEF2/88cgnr/zyzDfv/PPQnxACACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIUCwcMpO84OT2HDbm8GHLQjnn6wE3g83SA3DB55G3llfHxnfnZ4gglvew6Gf4ySgmYGlpCJknochWiId3kJcZZyDn93i6KPl4eniopwq6SIoZKxhpenbhtHZRxhXisDopwPgHkGDxrLGgjLG8mC0gkFDwjX2AgJ0bXJ2djbgNJsAtbfCNB2oOnn6MmKbeXt226K1fMGi6j359D69ua+QZskjd+3cOvY9XNgp4ABCQNYEDBl7EIeCQkeMIDAseOCBwckiBSZ4ILGjh4B/40kaXIjSggMHmBcifHky5gYE6zM2OAlzGM6Z5rs+fIjTZ0tfcYMSlLCUJ8fL47kCVXmTjwPiKJkUCDnyqc3CxzQmYeAxAEGLGJYiwCDgAUT4sqdgOebArdw507IUNfuW71xdZ7DC5iuhGsKErf9CxhPYgUaEhPWyzfBMgUIJDPW6zhb5M1y+R5GjFkBaLmCM0dOfHqvztXYJnMejaFCBQlmVxAYsEGkYnQV4lqYMNyCtnYSggNekAC58uJxmTufW5w55mwKkg+nLp105uTC53a/nhg88fMTmDfDVl65Xum/IZt/3/zaag3a5W63nll1dvfiWbaaZLmpQIABCVQA2f9lAhTG112PQWYadXE9+FtmEwKWwQYQJrZagxomsOCAGVImInsSbpCBhhwug6KKcXXQQYUcYuDMggrASFmNzjjzzIrh7cUhhhHqONeGpSEW2QYxHsmjhxpgUGAKB16g4IIbMNCkXMlhaJ8GWVJo2I3NyKclYF1GxgyYDEAnXHJrMpNAm/rFBSczPiYAlwXF8ZnmesvoOdyMbx7m4o0S5LWdn4bex2Z4xYmEzaEb5EUcnxbA+WWglqIn6aHPTInCgVbdlZyMqMrIQHMRSiaBBakS1903p04w434n0loBoQFOt1yu2YAnY68RXiNsqh2s2qqxuyKb7Imtmgcrqsp6h8D/fMSpapldx55nwayK/SfqCQd2hcFdAgDp5GMvqhvakF4mZuS710WGIYy30khekRkMu92GNu6bo7r/ttjqwLaua5+HOdrKq5Cl3dcwi+xKiLBwwwom4b0E6xvuYyqOa8IAEghwQAV45VvovpkxBl2mo0W7AKbCZXoAhgMmWnOkEqx2JX5nUufbgJHpXCfMOGu2QAd8eitpW1eaNrNeMGN27mNz0swziYnpSbXN19gYtstzfXrdYjNHtAIYGFVwwAEvR1dfxdjKxVzAP0twAAW/ir2w3nzTd3W4yQWO3t0DfleB4XYnEHCEhffdKgaA29p0eo4fHLng9qoG+OVyXz0gMeWGY7qq3xhiRIEAwayNxBawxy777LTXbjsVXRSh++689+7778AHL/zwxBdv/PEnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLD4BlwHGg0ubBpuzdm9Dk9eCTu+MTZkDb4PXYbeIIcHHxqf4F3gnqGY2kOdQmCjHCGfpCSjHhmh2N+knmEkJmKg3uHfgaaeY2qn6t2i4t7sKAPbwIJD2VhXisDCQZgDrKDBQ8aGgjKyhvDlJMJyAjV1gjCunkP1NfVwpRtk93e2ZVt5NfCk27jD97f0LPP7/Dr4pTp1veLgvrx7AL+Q/BM25uBegoYkDCABYFhEobhkUBRwoMGEDJqXPDgQMUEFC9c1LjxQUUJICX/iMRIEgIDkycrjmzJMSXFlDNJvkwJsmdOjQwKfDz5M+PLoSGLQqgZU6XSoB/voHxawGbFlS2XGktAwKEADB0xiEWAodqGBRPSqp1wx5qCamDRrp2Qoa3bagLkzrULF4GCvHPTglRAmKxZvWsHayBcliDitHUlvGWM97FgCdYWVw4c2e/kw4HZJlCwmDBhwHPrjraGYTHqtaoxVKggoesKAgd2SX5rbUMFCxOAC8cGDwHFwBYWJCgu4XfwtcqZV0grPHj0u2SnqwU+IXph3rK5b1fOu7Bx5+K7L6/2/Xhg8uyXnQ8dvfRiDe7TwyfNuzlybKYpgIFtKhAgwEKkKcOf/wChZbBBgMucRh1so5XH3wbI1WXafRJy9iCErmX4IWHNaIAhZ6uxBxeGHXQA24P3yYfBBhmgSBozESpwongWOBhggn/N1aKG8a1YY2oVAklgCgQUUwGJ8iXAgItrWUARbwpqIOWEal0ZoYJbzmWlZCWSlsAC6VkwZonNbMAAl5cpg+NiZwpnJ0Xylegmlc+tWY1mjnGnZnB4QukMA9UJRxGOf5r4ppqDjjmnfKilh2ejGiyJAgF1XNmYbC2GmhZ5AcJVgajcXecNqM9Rx8B6bingnlotviqdkB3YCg+rtOaapFsUhSrsq6axJ6sEwoZK7I/HWpCsr57FBxJ1w8LqV/81zbkoXK3LfVeNpic0KRQG4NHoIW/XEmZuaiN6tti62/moWbk18uhjqerWS6GFpe2YVotskVssWfBOAHACrZHoWcGQwQhlvmsdXBZ/F9YLMF2jzUuYBP4a7CLCnoEHrgkDSCDAARUILAGaVVqAwQHR8pZXomm9/ONhgjrbgc2lyYxmpIRK9uSNjrXs8gEbTrYyl2ryTJmsLCdKkWzFQl1lWlOXGmifal6p9VnbQfpyY2SZyXKVV7JmZkMrgIFSyrIeUJ2r7YKnXdivUg1kAgdQ8B7IzJjGsd9zKSdwyBL03WpwDGxwuOASEP5vriO2F3nLjQdIrpaRDxqcBdgIHGA74pKrZXiR2ZWuZt49m+o3pKMC3p4Av7SNxBa456777rz37jsVXRQh/PDEF2/88cgnr/zyzDfv/PMnhAAAIfkECQoAAAAsAAAAANwAEwAABf8gII5kaZ5oqq5s675wLM90bd94ru987//AoHBIBAgGhKRyyWw6n9CodEqtWq/YrHY6ELQEhYLDUPAMHGi0weEpbN7wI8cxTzsGj4R+n+DUxwaBeBt7hH1/gYIPhox+Y3Z3iwmGk36BkIN8egOIl3h8hBuOkAaZhQlna4BrpnyWa4mleZOFjrGKcXoFA2ReKwMJBgISDw6abwUPGggazc0bBqG0G8kI1tcIwZp51djW2nC03d7BjG8J49jl4cgP3t/RetLp1+vT6O7v5fKhAvnk0UKFogeP3zmCCIoZkDCABQFhChQYuKBHgkUJkxpA2MhxQYEDFhNcvPBAI8eNCx7/gMQYckPJkxsZPLhIM8FLmDJrYiRp8mTKkCwT8IQJwSPQkENhpgQpEunNkzlpWkwKdSbGihKocowqVSvKWQkIOBSgQOYFDBgQpI0oYMGEt3AzTLKm4BqGtnDjirxW95vbvG/nWlub8G9euRsiqqWLF/AEkRoiprX2wLDeDQgkW9PQGLDgyNc665WguK8C0XAnRY6oGPUEuRLsgk5g+a3cCxUqSBC7gsCBBXcVq6swwULx4hayvctGPK8FCwsSLE9A3Hje6NOrHzeOnW695sffRi/9HfDz7sIVSNB+XXrmugo0rHcM3X388o6jr44ceb51uNjF1xcC8zk3wXiS8aYC/wESaLABBs7ch0ECjr2WAGvLsLZBeHqVFl9kGxooV0T81TVhBo6NiOEyJ4p4IYnNRBQiYCN6x4wCG3ZAY2If8jXjYRcyk2FmG/5nXAY8wqhWAii+1YGOSGLoY4VRfqiAgikwmIeS1gjAgHkWYLQZf9m49V9gDWYWY5nmTYCRM2TS5pxxb8IZGV5nhplmhJyZadxzbrpnZ2d/6rnZgHIid5xIMDaDgJfbLdrgMkKW+Rygz1kEZz1mehabkBpgiQIByVikwGTqVfDkk2/Vxxqiqur4X3fksHccre8xlxerDLiHjQIVUAgXr77yFeyuOvYqXGbMrbrqBMqaFpFFzhL7qv9i1FX7ZLR0LUNdcc4e6Cus263KbV+inkAAHhJg0BeITR6WmHcaxhvXg/AJiKO9R77ILF1FwmVdAu6WBu+ZFua72mkZWMfqBElKu0G8rFZ5n4ATp5jkmvsOq+Nj7u63ZMMPv4bveyYy6fDH+C6brgnACHBABQUrkGirz2FwAHnM4Mmhzq9yijOrOi/MKabH6VwBiYwZdukEQAvILKTWXVq0ZvH5/CfUM7M29Zetthp1eht0eqkFYw8IKXKA6mzXfTeH7fZg9zW0AhgY0TwthUa6Ch9dBeIsbsFrYkRBfgTfiG0FhwMWnbsoq3cABUYOnu/ejU/A6uNeT8u4wMb1WnBCyJJTLjjnr8o3OeJrUcpc5oCiPqAEkz8tXuLkPeDL3Uhs4fvvwAcv/PDEU9FFEcgnr/zyzDfv/PPQRy/99NRXf0IIACH5BAkKAAAALAAAAADcABMAAAX/ICCOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSAQIBoSkcslsOp/QqHRKrVqv2Kx2OhC0BIWCw/AoDziOtCHt8BQ28PjmzK57Hom8fo42+P8DeAkbeYQcfX9+gYOFg4d1bIGEjQmPbICClI9/YwaLjHAJdJeKmZOViGtpn3qOqZineoeJgG8CeWUbBV4rAwkGAhIVGL97hGACGsrKCAgbBoTRhLvN1c3PepnU1s2/oZO6AtzdBoPf4eMI3tIJyOnF0YwFD+nY8e3z7+Xfefnj9uz8cVsXCh89axgk7BrAggAwBQsYIChwQILFixIeNIDAseOCBwcSXMy2sSPHjxJE/6a0eEGjSY4MQGK86PIlypUJEmYsaTKmyJ8JW/Ls6HMkzaEn8YwMWtPkx4pGd76E4DMPRqFTY860OGhogwYagBFoKEABA46DEGBAoEBB0AUT4sqdIFKBNbcC4M6dkEEk22oYFOTdG9fvWrtsBxM23MytYL17666t9phwXwlum2lIDHmuSA2IGyuOLOHv38qLMbdFjHruZbWgRXeOe1nC2BUEDiyAMMHZuwoTLAQX3nvDOAUW5Vogru434d4JnAsnPmFB9NBshQXfa9104+Rxl8e13rZxN+CEydtVsFkd+vDjE7C/q52wOvb4s7+faz025frbxefWbSoQIAEDEUCwgf9j7bUlwHN9ZVaegxDK1xYzFMJH24L5saXABhlYxiEzHoKoIV8LYqAMaw9aZqFmJUK4YHuNfRjiXhmk+NcyJgaIolvM8BhiBx3IleN8lH1IWAcRgkZgCgYiaBGJojGgHHFTgtagAFYSZhF7/qnTpY+faVlNAnqJN0EHWa6ozAZjBtgmmBokwMB01LW5jAZwbqfmlNips4B4eOqJgDJ2+imXRZpthuigeC6XZTWIxilXmRo8iYKBCwiWmWkJVEAkfB0w8KI1IvlIpKnOkVpqdB5+h96o8d3lFnijrgprjbfGRSt0lH0nAZG5vsprWxYRW6Suq4UWqrLEsspWg8Io6yv/q6EhK0Fw0GLbjKYn5CZYBYht1laPrnEY67kyrhYbuyceiR28Pso7bYwiXjihjWsWuWF5p/H765HmNoiur3RJsGKNG/jq748XMrwmjhwCfO6QD9v7LQsDxPTAMKsFpthyJCdkmgYiw0VdXF/Om9dyv7YMWGXTLYpZg5wNR11C78oW3p8HSGgul4qyrJppgllJHJZHn0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA=="),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("
      ");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("
      ")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("
      ")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[];var c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push("
      "),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
      ");c.element.innerHTML=b.join("")})},this.$textToken={text:true,rparen:true,lparen:true},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;var e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:"[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"},{token:"string",regex:"[\"].*\\\\$",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^\"\\\\]))*?\"",next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index","cockpit/index"])});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}} \ No newline at end of file diff --git a/build/editor.html b/build/editor.html index c8918a07..79c8e523 100644 --- a/build/editor.html +++ b/build/editor.html @@ -4,10 +4,23 @@ Editor - @@ -18,6 +31,8 @@ } } + +