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:

+ *

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('

'); + } + + 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+7bD72SfPcwBU1XdF5N5aWy2KgqIoeBzPEnWVLMseYnAcRERdV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k379qh4rYKet4GjrhhwEteBgBrH8BssoXEtbHzPpSBRRSpqlNpgAiUoxzHKxLRszoVuggIisxaDQWZqkQvQjAoax3NbDbLLGuUEABNGedXqSyLRupXgDT5JfAGZNLio9B0X8Uiwk4w77MDc1D4yejjWtykPS3DX01UDCY/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+RG4GCBoyAjpmQhZN0YGYFXitdZBIVGAoKoq4CG6Qaswi1CBtkcG6ytrYJubq8vbfAcMK9v7q7D8O1ycrHvsW6zcTKsczNz8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1nC2BUEDiyAMMHZuwoTLAQX3nvDOAUW5Vogru434d4JnAsnPmFB9NBshQXfa9104+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/+A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Iushfc5PXGAzCo0PlD2pnpCYfCXga3lu+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/eV2X13neIcCeBRwxorbZrA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LEsspWg8Io6yv/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 @@ } } + +