"),
this.$renderLine(t, i, !1, i == o
? s
: !1),
this.$useLineGroups() && t.push("
"),
i += 1;
}
this.element.innerHTML = t.join("");
},
this.$textToken = {
lparen: !0,
rparen: !0,
text : !0
},
this.$renderToken = function (e, t, n, r) {
var i = this,
o = /\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,
u = function (e, n, r, o, u) {
if (n) {
return i.showInvisibles
? ""),
e.push(s.stringRepeat("\u00a0", n.indent)),
o++,
a = 0,
u = n[o] || Number.MAX_VALUE;
}
c.length != 0 && (i += c.length, a = this.$renderToken(e, a, l, c));
}
}
},
this.$renderSimpleLine = function (e, t) {
var n = 0,
r = t[0],
i = r.value;
this.displayIndentGuides && (i = this.renderIndentGuide(e, i)),
i && (n = this.$renderToken(e, n, r, i));
for (var s = 1; s < t.length; s += 1) {
r = t[s],
i = r.value,
n = this.$renderToken(e, n, r, i);
}
},
this.$renderLine = function (e, t, n, r) {
!r && r != 0 && (r = this.session.getFoldLine(t));
if (r) {
var i = this.$getFoldLineTokens(t, r);
} else {
var i = this
.session
.getTokens(t);
}
n || e.push("
");
if (i.length) {
var s = this
.session
.getRowSplitData(t);
s && s.length
? this.$renderWrappedLine(e, i, s, n)
: this.$renderSimpleLine(e, i);
}
this.showInvisibles && (r && (t = r.end.row), e.push("", t == this.session.getLength() - 1
? this.EOF_CHAR
: this.EOL_CHAR,
"")),
n || e.push("
");
},
this.$getFoldLineTokens = function (e, t) {
function i(e, t, n) {
var i = 0,
s = 0;
while (s + e[i].value.length < t) {
s += e[i].value.length,
i += 1;
if (i == e.length) {
return;
}
}
if (s != t) {
var o = e[i]
.value
.substring(t - s);
o.length > n - t && (o = o.substring(0, n - t)),
r.push({type: e[i].type, value: o}),
s = t + o.length,
i += 1;
}
while (s < n && i < e.length) {
var o = e[i].value;
o.length + s > n
? r.push({
type : e[i].type,
value: o.substring(0, n - s)
})
: r.push(e[i]),
s += o.length,
i += 1;
}
}
var n = this.session,
r = [],
s = n.getTokens(e);
return t.walk(function (e, t, o, u, a) {
e != null
? r.push({type: "fold", value: e})
: (a && (s = n.getTokens(t)), s.length && i(s, u, o));
}, t.end.row, this.session.getLine(t.end.row).length),
r;
},
this.$useLineGroups = function () {
return this
.session
.getUseWrapMode();
},
this.destroy = function () {
clearInterval(this.$pollSizeChangesTimer),
this.$measureNode && this
.$measureNode
.parentNode
.removeChild(this.$measureNode),
delete this.$measureNode;
};
}).call(a.prototype),
t.Text = a;
}),
define("ace/layer/cursor", [
"require", "exports", "module", "ace/lib/dom"
], function (e, t, n) {
"use strict";
var r = e("../lib/dom"),
i,
s = function (e) {
this.element = r.createElement("div"),
this.element.className = "ace_layer ace_cursor-layer",
e.appendChild(this.element),
i === undefined && (i = !("opacity" in this.element.style)),
this.isVisible = !1,
this.isBlinking = !0,
this.blinkInterval = 1e3,
this.smoothBlinking = !1,
this.cursors = [],
this.cursor = this.addCursor(),
r.addCssClass(this.element, "ace_hidden-cursors"),
this.$updateCursors = (i
? this.$updateVisibility
: this.$updateOpacity).bind(this);
};
(function () {
this.$updateVisibility = function (e) {
var t = this.cursors;
for (var n = t.length; n -= 1;) {
t[n].style.visibility = e
? ""
: "hidden";
}
},
this.$updateOpacity = function (e) {
var t = this.cursors;
for (var n = t.length; n -= 1;) {
t[n].style.opacity = e
? ""
: "0";
}
},
this.$padding = 0,
this.setPadding = function (e) {
this.$padding = e;
},
this.setSession = function (e) {
this.session = e;
},
this.setBlinking = function (e) {
e != this.isBlinking && (this.isBlinking = e, this.restartTimer());
},
this.setBlinkInterval = function (e) {
e != this.blinkInterval && (this.blinkInterval = e, this.restartTimer());
},
this.setSmoothBlinking = function (e) {
e != this.smoothBlinking && !i && (this.smoothBlinking = e, r.setCssClass(this.element, "ace_smooth-blinking", e), this.$updateCursors(!0), this.$updateCursors = this.$updateOpacity.bind(this), this.restartTimer());
},
this.addCursor = function () {
var e = r.createElement("div");
return e.className = "ace_cursor",
this
.element
.appendChild(e),
this
.cursors
.push(e),
e;
},
this.removeCursor = function () {
if (this.cursors.length > 1) {
var e = this
.cursors
.pop();
return e
.parentNode
.removeChild(e),
e;
}
},
this.hideCursor = function () {
this.isVisible = !1,
r.addCssClass(this.element, "ace_hidden-cursors"),
this.restartTimer();
},
this.showCursor = function () {
this.isVisible = !0,
r.removeCssClass(this.element, "ace_hidden-cursors"),
this.restartTimer();
},
this.restartTimer = function () {
var e = this.$updateCursors;
clearInterval(this.intervalId),
clearTimeout(this.timeoutId),
this.smoothBlinking && r.removeCssClass(this.element, "ace_smooth-blinking"),
e(!0);
if (!this.isBlinking || !this.blinkInterval || !this.isVisible) {
return;
}
this.smoothBlinking && setTimeout(function () {
r.addCssClass(this.element, "ace_smooth-blinking");
}.bind(this));
var t = function () {
this.timeoutId = setTimeout(function () {
e(!1);
}, .6 * this.blinkInterval);
}.bind(this);
this.intervalId = setInterval(function () {
e(!0),
t();
}, this.blinkInterval),
t();
},
this.getPixelPosition = function (e, t) {
if (!this.config || !this.session) {
return {left: 0, top: 0};
}
e || (e = this.session.selection.getCursor());
var n = this
.session
.documentToScreenPosition(e),
r = this.$padding + n.column * this.config.characterWidth,
i = (n.row - (t
? this.config.firstRowScreen
: 0)) * this.config.lineHeight;
return {left: r, top: i};
},
this.update = function (e) {
this.config = e;
var t = this.session.$selectionMarkers,
n = 0,
r = 0;
if (t === undefined || t.length === 0) {
t = [
{
cursor: null
}
];
}
for (var n = 0, i = t.length; n < i; n += 1) {
var s = this.getPixelPosition(t[n].cursor, !0);
if ((s.top > e.height + e.offset || s.top < 0) && n > 1) {
continue;
}
var o = (this.cursors[r++] || this.addCursor()).style;
this.drawCursor
? this.drawCursor(o, s, e, t[n], this.session)
: (o.left = s.left + "px", o.top = s.top + "px", o.width = e.characterWidth + "px", o.height = e.lineHeight + "px");
}
while (this.cursors.length > r) {
this.removeCursor();
}
var u = this
.session
.getOverwrite();
this.$setOverwrite(u),
this.$pixelPos = s,
this.restartTimer();
},
this.drawCursor = null,
this.$setOverwrite = function (e) {
e != this.overwrite && (this.overwrite = e, e
? r.addCssClass(this.element, "ace_overwrite-cursors")
: r.removeCssClass(this.element, "ace_overwrite-cursors"));
},
this.destroy = function () {
clearInterval(this.intervalId),
clearTimeout(this.timeoutId);
};
}).call(s.prototype),
t.Cursor = s;
}),
define("ace/scrollbar", [
"require",
"exports",
"module",
"ace/lib/oop",
"ace/lib/dom",
"ace/lib/event",
"ace/lib/event_emitter"
], function (e, t, n) {
"use strict";
var r = e("./lib/oop"),
i = e("./lib/dom"),
s = e("./lib/event"),
o = e("./lib/event_emitter").EventEmitter,
u = function (e) {
this.element = i.createElement("div"),
this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix,
this.inner = i.createElement("div"),
this.inner.className = "ace_scrollbar-inner",
this
.element
.appendChild(this.inner),
e.appendChild(this.element),
this.setVisible(!1),
this.skipEvent = !1,
s.addListener(this.element, "scroll", this.onScroll.bind(this)),
s.addListener(this.element, "mousedown", s.preventDefault);
};
(function () {
r.implement(this, o),
this.setVisible = function (e) {
this.element.style.display = e
? ""
: "none",
this.isVisible = e;
};
}).call(u.prototype);
var a = function (e, t) {
u.call(this, e),
this.scrollTop = 0,
t.$scrollbarWidth = this.width = i.scrollbarWidth(e.ownerDocument),
this.inner.style.width = this.element.style.width = (this.width || 15) + 5 + "px";
};
r.inherits(a, u),
function () {
this.classSuffix = "-v",
this.onScroll = function () {
this.skipEvent || (this.scrollTop = this.element.scrollTop, this._emit("scroll", {data: this.scrollTop})),
this.skipEvent = !1;
},
this.getWidth = function () {
return this.isVisible
? this.width
: 0;
},
this.setHeight = function (e) {
this.element.style.height = e + "px";
},
this.setInnerHeight = function (e) {
this.inner.style.height = e + "px";
},
this.setScrollHeight = function (e) {
this.inner.style.height = e + "px";
},
this.setScrollTop = function (e) {
this.scrollTop != e && (this.skipEvent = !0, this.scrollTop = this.element.scrollTop = e);
};
}.call(a.prototype);
var f = function (e, t) {
u.call(this, e),
this.scrollLeft = 0,
this.height = t.$scrollbarWidth,
this.inner.style.height = this.element.style.height = (this.height || 15) + 5 + "px";
};
r.inherits(f, u),
function () {
this.classSuffix = "-h",
this.onScroll = function () {
this.skipEvent || (this.scrollLeft = this.element.scrollLeft, this._emit("scroll", {data: this.scrollLeft})),
this.skipEvent = !1;
},
this.getHeight = function () {
return this.isVisible
? this.height
: 0;
},
this.setWidth = function (e) {
this.element.style.width = e + "px";
},
this.setInnerWidth = function (e) {
this.inner.style.width = e + "px";
},
this.setScrollWidth = function (e) {
this.inner.style.width = e + "px";
},
this.setScrollLeft = function (e) {
this.scrollLeft != e && (this.skipEvent = !0, this.scrollLeft = this.element.scrollLeft = e);
};
}.call(f.prototype),
t.ScrollBar = a,
t.ScrollBarV = a,
t.ScrollBarH = f,
t.VScrollBar = a,
t.HScrollBar = f;
}),
define("ace/renderloop", [
"require", "exports", "module", "ace/lib/event"
], function (e, t, n) {
"use strict";
var r = e("./lib/event"),
i = function (e, t) {
this.onRender = e,
this.pending = !1,
this.changes = 0,
this.window = t || window;
};
(function () {
this.schedule = function (e) {
this.changes = this.changes | e;
if (!this.pending && this.changes) {
this.pending = !0;
var t = this;
r.nextFrame(function () {
t.pending = !1;
var e;
while (e = t.changes) {
t.changes = 0,
t.onRender(e);
}
}, this.window);
}
};
}).call(i.prototype),
t.RenderLoop = i;
}),
define("ace/layer/font_metrics", [
"require",
"exports",
"module",
"ace/lib/oop",
"ace/lib/dom",
"ace/lib/lang",
"ace/lib/useragent",
"ace/lib/event_emitter"
], function (e, t, n) {
var r = e("../lib/oop"),
i = e("../lib/dom"),
s = e("../lib/lang"),
o = e("../lib/useragent"),
u = e("../lib/event_emitter").EventEmitter,
a = 0,
f = t.FontMetrics = function (e, t) {
this.el = i.createElement("div"),
this.$setMeasureNodeStyles(this.el.style, !0),
this.$main = i.createElement("div"),
this.$setMeasureNodeStyles(this.$main.style),
this.$measureNode = i.createElement("div"),
this.$setMeasureNodeStyles(this.$measureNode.style),
this
.el
.appendChild(this.$main),
this
.el
.appendChild(this.$measureNode),
e.appendChild(this.el),
a || this.$testFractionalRect(),
this.$measureNode.innerHTML = s.stringRepeat("X", a),
this.$characterSize = {
height: 0,
width : 0
},
this.checkForSizeChanges();
};
(function () {
r.implement(this, u),
this.$characterSize = {
height: 0,
width : 0
},
this.$testFractionalRect = function () {
var e = i.createElement("div");
this.$setMeasureNodeStyles(e.style),
e.style.width = "0.2px",
document
.documentElement
.appendChild(e);
var t = e
.getBoundingClientRect()
.width;
t > 0 && t < 1
? a = 50
: a = 100,
e
.parentNode
.removeChild(e);
},
this.$setMeasureNodeStyles = function (e, t) {
e.width = e.height = "auto",
e.left = e.top = "0px",
e.visibility = "hidden",
e.position = "absolute",
e.whiteSpace = "pre",
o.isIE < 8
? e["font-family"] = "inherit"
: e.font = "inherit",
e.overflow = t
? "hidden"
: "visible";
},
this.checkForSizeChanges = function () {
var e = this.$measureSizes();
if (e && (this.$characterSize.width !== e.width || this.$characterSize.height !== e.height)) {
this.$measureNode.style.fontWeight = "bold";
var t = this.$measureSizes();
this.$measureNode.style.fontWeight = "",
this.$characterSize = e,
this.charSizes = Object.create(null),
this.allowBoldFonts = t && t.width === e.width && t.height === e.height,
this._emit("changeCharacterSize", {data: e});
}
},
this.$pollSizeChanges = function () {
if (this.$pollSizeChangesTimer) {
return this.$pollSizeChangesTimer;
}
var e = this;
return this.$pollSizeChangesTimer = setInterval(function () {
e.checkForSizeChanges();
}, 500);
},
this.setPolling = function (e) {
e
? this.$pollSizeChanges()
: this.$pollSizeChangesTimer && (clearInterval(this.$pollSizeChangesTimer), this.$pollSizeChangesTimer = 0);
},
this.$measureSizes = function () {
if (a === 50) {
var e = null;
try {
e = this
.$measureNode
.getBoundingClientRect();
} catch (t) {
e = {
height: 0,
width : 0
};
}
var n = {
height: e.height,
width : e.width / a
};
} else {
var n = {
height: this.$measureNode.clientHeight,
width : this.$measureNode.clientWidth / a
};
}
return n.width === 0 || n.height === 0
? null
: n;
},
this.$measureCharWidth = function (e) {
this.$main.innerHTML = s.stringRepeat(e, a);
var t = this
.$main
.getBoundingClientRect();
return t.width / a;
},
this.getCharacterWidth = function (e) {
var t = this.charSizes[e];
return t === undefined && (this.charSizes[e] = this.$measureCharWidth(e) / this.$characterSize.width),
t;
},
this.destroy = function () {
clearInterval(this.$pollSizeChangesTimer),
this.el && this.el.parentNode && this
.el
.parentNode
.removeChild(this.el);
};
}).call(f.prototype);
}),
define("ace/virtual_renderer", [
"require",
"exports",
"module",
"ace/lib/oop",
"ace/lib/dom",
"ace/config",
"ace/lib/useragent",
"ace/layer/gutter",
"ace/layer/marker",
"ace/layer/text",
"ace/layer/cursor",
"ace/scrollbar",
"ace/scrollbar",
"ace/renderloop",
"ace/layer/font_metrics",
"ace/lib/event_emitter"
], function (e, t, n) {
"use strict";
var r = e("./lib/oop"),
i = e("./lib/dom"),
s = e("./config"),
o = e("./lib/useragent"),
u = e("./layer/gutter").Gutter,
a = e("./layer/marker").Marker,
f = e("./layer/text").Text,
l = e("./layer/cursor").Cursor,
c = e("./scrollbar").HScrollBar,
h = e("./scrollbar").VScrollBar,
p = e("./renderloop").RenderLoop,
d = e("./layer/font_metrics").FontMetrics,
v = e("./lib/event_emitter").EventEmitter,
m = ".ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\'," +
" \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;dire" +
"ction: ltr;}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: " +
"0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webk" +
"it-user-select: none;user-select: none;cursor: text;}.ace_content {position: a" +
"bsolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing:" +
" border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: abso" +
"lute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250" +
", 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{backgr" +
"ound: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !imp" +
"ortant;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;b" +
"ottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-se" +
"lect: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-lin" +
"e {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-sha" +
"dow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-lef" +
"t: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_" +
"error {background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB" +
"AAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/Pxsw" +
"FAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx" +
"/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbx" +
"QB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr" +
"/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4w" +
"FAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64r" +
"nWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+" +
"Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtD" +
"rshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5Jt" +
"CQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GB" +
"kzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZh" +
"awjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==');background-repeat: no-repeat;ba" +
"ckground-position: 2px center;}.ace_gutter-cell.ace_warning {background-image:" +
" url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmV" +
"BMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/" +
"rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oG" +
"f/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RX" +
"O8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o" +
"3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaY" +
"YvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MT" +
"AQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==');background-position: " +
"2px center;}.ace_gutter-cell.ace_info {background-image: url('data:image/png;b" +
"ase64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9i" +
"ZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNy" +
"DbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=" +
"');background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {backg" +
"round-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAA" +
"Dt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRS" +
"TlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6R" +
"yJAAAAAElFTkSuQmCC');}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-" +
"index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0" +
";}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollba" +
"r-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {positio" +
"n: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width" +
": 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;a" +
"ppearance: none;border: none;resize: none;outline: none;overflow: hidden;font:" +
" inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text" +
";-moz-user-select: text;-webkit-user-select: text;user-select: text;white-spac" +
"e: pre!important;}.ace_text-input.ace_composition {background: inherit;color: " +
"inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;positi" +
"on: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;" +
"width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-siz" +
"ing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;wi" +
"dth: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inher" +
"it !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor" +
"-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing" +
": border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left" +
": 2px solid;transform: translatez(0);}.ace_slim-cursors .ace_cursor {border-le" +
"ft-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border" +
"-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth" +
"-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0" +
".18s;}.ace_editor.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_ma" +
"rker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index" +
": 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_mar" +
"ker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_" +
"active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-wo" +
"rd {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizi" +
"ng: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: b" +
"order-box;-webkit-box-sizing: border-box;box-sizing: border-box;display: inlin" +
"e-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:" +
"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXR" +
"FWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSo" +
"kD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0" +
"VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO" +
"4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII='),url('data:image/png;base64,i" +
"VBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWF" +
"nZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAA" +
"AAASUVORK5CYII=');background-repeat: no-repeat, repeat-x;background-position: " +
"center center, top left;color: transparent;border: 1px solid black;border-radi" +
"us: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:" +
"hover{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEA" +
"AAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeN" +
"pi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBa" +
"MSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP" +
"1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII='),url('" +
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRT" +
"b2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLME" +
"wJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC');}.ace_tooltip {background-color: #FFF;bac" +
"kground-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));b" +
"ackground-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));b" +
"order: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0" +
".3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999" +
"999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: bor" +
"der-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: no" +
"rmal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-eve" +
"nts: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_" +
"fold-widget {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-si" +
"zing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-alig" +
"n: top;background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA" +
"UAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot" +
"7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==');background-repeat: no-repeat;ba" +
"ckground-position: center;border-radius: 3px;border: 1px solid transparent;cur" +
"sor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; " +
"}.ace_fold-widget.ace_end {background-image: url('data:image/png;base64,iVBORw" +
"0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAike" +
"WkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==');}.ace_fold-" +
"widget.ace_closed {background-image: url('data:image/png;base64,iVBORw0KGgoAAA" +
"ANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHA" +
"zPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==');}.ace_fold-" +
"widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255," +
" 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widg" +
"et:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0" +
", 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-wi" +
"dget {background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAU" +
"AAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAA" +
"ElFTkSuQmCC');}.ace_dark .ace_fold-widget.ace_end {background-image: url('data" +
":image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4" +
"//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==');}.ace_dark .ace" +
"_fold-widget.ace_closed {background-image: url('data:image/png;base64,iVBORw0K" +
"GgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAw" +
"ARji8UIDTfQQAAAABJRU5ErkJggg==');}.ace_dark .ace_fold-widget:hover {box-shadow" +
": 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1" +
");}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255" +
", 0.2);}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: " +
"#DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity " +
"0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold" +
"-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;" +
"transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoratio" +
"n: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight" +
": normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color" +
": rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {ba" +
"ckground-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_br1 " +
"{border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}." +
"ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ac" +
"e_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : " +
"3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3p" +
"x; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px;" +
" border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {b" +
"order-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; bor" +
"der-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; borde" +
"r-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-" +
"top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bo" +
"ttom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-" +
"left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radi" +
"us: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radiu" +
"s: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius :" +
" 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border" +
"-bottom-left-radius: 3px;}";
i.importCssString(m, "ace_editor.css");
var g = function (e, t) {
var n = this;
this.container = e || i.createElement("div"),
this.$keepTextAreaAtCursor = !o.isOldIE,
i.addCssClass(this.container, "ace_editor"),
this.setTheme(t),
this.$gutter = i.createElement("div"),
this.$gutter.className = "ace_gutter",
this
.container
.appendChild(this.$gutter),
this.scroller = i.createElement("div"),
this.scroller.className = "ace_scroller",
this
.container
.appendChild(this.scroller),
this.content = i.createElement("div"),
this.content.className = "ace_content",
this
.scroller
.appendChild(this.content),
this.$gutterLayer = new u(this.$gutter),
this
.$gutterLayer
.on("changeGutterWidth", this.onGutterResize.bind(this)),
this.$markerBack = new a(this.content);
var r = this.$textLayer = new f(this.content);
this.canvas = r.element,
this.$markerFront = new a(this.content),
this.$cursorLayer = new l(this.content),
this.$horizScroll = !1,
this.$vScroll = !1,
this.scrollBar = this.scrollBarV = new h(this.container, this),
this.scrollBarH = new c(this.container, this),
this
.scrollBarV
.addEventListener("scroll", function (e) {
n.$scrollAnimation || n
.session
.setScrollTop(e.data - n.scrollMargin.top);
}),
this
.scrollBarH
.addEventListener("scroll", function (e) {
n.$scrollAnimation || n
.session
.setScrollLeft(e.data - n.scrollMargin.left);
}),
this.scrollTop = 0,
this.scrollLeft = 0,
this.cursorPos = {
column: 0,
row : 0
},
this.$fontMetrics = new d(this.container, 500),
this
.$textLayer
.$setFontMetrics(this.$fontMetrics),
this
.$textLayer
.addEventListener("changeCharacterSize", function (e) {
n.updateCharacterSize(),
n.onResize(!0, n.gutterWidth, n.$size.width, n.$size.height),
n._signal("changeCharacterSize", e);
}),
this.$size = {
$dirty : !0,
height : 0,
scrollerHeight: 0,
scrollerWidth : 0,
width : 0
},
this.layerConfig = {
characterWidth: 0,
firstRow : 0,
firstRowScreen: 0,
gutterOffset : 1,
height : 1,
lastRow : 0,
lineHeight : 0,
maxHeight : 1,
minHeight : 1,
offset : 0,
padding : 0,
width : 1
},
this.scrollMargin = {
bottom: 0,
h : 0,
left : 0,
right : 0,
top : 0,
v : 0
},
this.$loop = new p(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView),
this
.$loop
.schedule(this.CHANGE_FULL),
this.updateCharacterSize(),
this.setPadding(4),
s.resetOptions(this),
s._emit("renderer", this);
};
(function () {
this.CHANGE_CURSOR = 1,
this.CHANGE_MARKER = 2,
this.CHANGE_GUTTER = 4,
this.CHANGE_SCROLL = 8,
this.CHANGE_LINES = 16,
this.CHANGE_TEXT = 32,
this.CHANGE_SIZE = 64,
this.CHANGE_MARKER_BACK = 128,
this.CHANGE_MARKER_FRONT = 256,
this.CHANGE_FULL = 512,
this.CHANGE_H_SCROLL = 1024,
r.implement(this, v),
this.updateCharacterSize = function () {
this.$textLayer.allowBoldFonts != this.$allowBoldFonts && (this.$allowBoldFonts = this.$textLayer.allowBoldFonts, this.setStyle("ace_nobold", !this.$allowBoldFonts)),
this.layerConfig.characterWidth = this.characterWidth = this
.$textLayer
.getCharacterWidth(),
this.layerConfig.lineHeight = this.lineHeight = this
.$textLayer
.getLineHeight(),
this.$updatePrintMargin();
},
this.setSession = function (e) {
this.session && this
.session
.doc
.off("changeNewLineMode", this.onChangeNewLineMode),
this.session = e,
e && this.scrollMargin.top && e.getScrollTop() <= 0 && e.setScrollTop(-this.scrollMargin.top),
this
.$cursorLayer
.setSession(e),
this
.$markerBack
.setSession(e),
this
.$markerFront
.setSession(e),
this
.$gutterLayer
.setSession(e),
this
.$textLayer
.setSession(e);
if (!e) {
return;
}
this
.$loop
.schedule(this.CHANGE_FULL),
this
.session
.$setFontMetrics(this.$fontMetrics),
this.onChangeNewLineMode = this
.onChangeNewLineMode
.bind(this),
this.onChangeNewLineMode(),
this
.session
.doc
.on("changeNewLineMode", this.onChangeNewLineMode);
},
this.updateLines = function (e, t, n) {
t === undefined && (t = Infinity),
this.$changedLines
? (this.$changedLines.firstRow > e && (this.$changedLines.firstRow = e), this.$changedLines.lastRow < t && (this.$changedLines.lastRow = t))
: this.$changedLines = {
firstRow: e,
lastRow : t
};
if (this.$changedLines.lastRow < this.layerConfig.firstRow) {
if (!n) {
return;
}
this.$changedLines.lastRow = this.layerConfig.lastRow;
}
if (this.$changedLines.firstRow > this.layerConfig.lastRow) {
return;
}
this
.$loop
.schedule(this.CHANGE_LINES);
},
this.onChangeNewLineMode = function () {
this
.$loop
.schedule(this.CHANGE_TEXT),
this
.$textLayer
.$updateEolChar();
},
this.onChangeTabSize = function () {
this
.$loop
.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER),
this
.$textLayer
.onChangeTabSize();
},
this.updateText = function () {
this
.$loop
.schedule(this.CHANGE_TEXT);
},
this.updateFull = function (e) {
e
? this.$renderChanges(this.CHANGE_FULL, !0)
: this
.$loop
.schedule(this.CHANGE_FULL);
},
this.updateFontSize = function () {
this
.$textLayer
.checkForSizeChanges();
},
this.$changes = 0,
this.$updateSizeAsync = function () {
this.$loop.pending
? this.$size.$dirty = !0
: this.onResize();
},
this.onResize = function (e, t, n, r) {
if (this.resizing > 2) {
return;
}
this.resizing > 0
? this.resizing++
: this.resizing = e
? 1
: 0;
var i = this.container;
r || (r = i.clientHeight || i.scrollHeight),
n || (n = i.clientWidth || i.scrollWidth);
var s = this.$updateCachedSize(e, t, n, r);
if (!this.$size.scrollerHeight || !n && !r) {
return this.resizing = 0;
}
e && (this.$gutterLayer.$padding = null),
e
? this.$renderChanges(s | this.$changes, !0)
: this
.$loop
.schedule(s | this.$changes),
this.resizing && (this.resizing = 0),
this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;
},
this.$updateCachedSize = function (e, t, n, r) {
r -= this.$extraHeight || 0;
var i = 0,
s = this.$size,
o = {
height : s.height,
scrollerHeight: s.scrollerHeight,
scrollerWidth : s.scrollerWidth,
width : s.width
};
r && (e || s.height != r) && (s.height = r, i |= this.CHANGE_SIZE, s.scrollerHeight = s.height, this.$horizScroll && (s.scrollerHeight -= this.scrollBarH.getHeight()), this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px", i |= this.CHANGE_SCROLL);
if (n && (e || s.width != n)) {
i |= this.CHANGE_SIZE,
s.width = n,
t == null && (t = this.$showGutter
? this.$gutter.offsetWidth
: 0),
this.gutterWidth = t,
this.scrollBarH.element.style.left = this.scroller.style.left = t + "px",
s.scrollerWidth = Math.max(0, n - t - this.scrollBarV.getWidth()),
this.scrollBarH.element.style.right = this.scroller.style.right = this
.scrollBarV
.getWidth() + "px",
this.scroller.style.bottom = this
.scrollBarH
.getHeight() + "px";
if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || e) {
i |= this.CHANGE_FULL;
}
}
return s.$dirty = !n || !r,
i && this._signal("resize", o),
i;
},
this.onGutterResize = function () {
var e = this.$showGutter
? this.$gutter.offsetWidth
: 0;
e != this.gutterWidth && (this.$changes |= this.$updateCachedSize(!0, e, this.$size.width, this.$size.height)),
this
.session
.getUseWrapMode() && this.adjustWrapLimit()
? this
.$loop
.schedule(this.CHANGE_FULL)
: this.$size.$dirty
? this
.$loop
.schedule(this.CHANGE_FULL)
: (this.$computeLayerConfig(), this.$loop.schedule(this.CHANGE_MARKER));
},
this.adjustWrapLimit = function () {
var e = this.$size.scrollerWidth - this.$padding * 2,
t = Math.floor(e / this.characterWidth);
return this
.session
.adjustWrapLimit(t, this.$showPrintMargin && this.$printMarginColumn);
},
this.setAnimatedScroll = function (e) {
this.setOption("animatedScroll", e);
},
this.getAnimatedScroll = function () {
return this.$animatedScroll;
},
this.setShowInvisibles = function (e) {
this.setOption("showInvisibles", e);
},
this.getShowInvisibles = function () {
return this.getOption("showInvisibles");
},
this.getDisplayIndentGuides = function () {
return this.getOption("displayIndentGuides");
},
this.setDisplayIndentGuides = function (e) {
this.setOption("displayIndentGuides", e);
},
this.setShowPrintMargin = function (e) {
this.setOption("showPrintMargin", e);
},
this.getShowPrintMargin = function () {
return this.getOption("showPrintMargin");
},
this.setPrintMarginColumn = function (e) {
this.setOption("printMarginColumn", e);
},
this.getPrintMarginColumn = function () {
return this.getOption("printMarginColumn");
},
this.getShowGutter = function () {
return this.getOption("showGutter");
},
this.setShowGutter = function (e) {
return this.setOption("showGutter", e);
},
this.getFadeFoldWidgets = function () {
return this.getOption("fadeFoldWidgets");
},
this.setFadeFoldWidgets = function (e) {
this.setOption("fadeFoldWidgets", e);
},
this.setHighlightGutterLine = function (e) {
this.setOption("highlightGutterLine", e);
},
this.getHighlightGutterLine = function () {
return this.getOption("highlightGutterLine");
},
this.$updateGutterLineHighlight = function () {
var e = this.$cursorLayer.$pixelPos,
t = this.layerConfig.lineHeight;
if (this.session.getUseWrapMode()) {
var n = this
.session
.selection
.getCursor();
n.column = 0,
e = this
.$cursorLayer
.getPixelPosition(n, !0),
t *= this
.session
.getRowLength(n.row);
}
this.$gutterLineHighlight.style.top = e.top - this.layerConfig.offset + "px",
this.$gutterLineHighlight.style.height = t + "px";
},
this.$updatePrintMargin = function () {
if (!this.$showPrintMargin && !this.$printMarginEl) {
return;
}
if (!this.$printMarginEl) {
var e = i.createElement("div");
e.className = "ace_layer ace_print-margin-layer",
this.$printMarginEl = i.createElement("div"),
this.$printMarginEl.className = "ace_print-margin",
e.appendChild(this.$printMarginEl),
this
.content
.insertBefore(e, this.content.firstChild);
}
var t = this.$printMarginEl.style;
t.left = this.characterWidth * this.$printMarginColumn + this.$padding + "px",
t.visibility = this.$showPrintMargin
? "visible"
: "hidden",
this.session && this.session.$wrap == -1 && this.adjustWrapLimit();
},
this.getContainerElement = function () {
return this.container;
},
this.getMouseEventTarget = function () {
return this.scroller;
},
this.getTextAreaContainer = function () {
return this.container;
},
this.$moveTextAreaToCursor = function () {
if (!this.$keepTextAreaAtCursor) {
return;
}
var e = this.layerConfig,
t = this.$cursorLayer.$pixelPos.top,
n = this.$cursorLayer.$pixelPos.left;
t -= e.offset;
var r = this.textarea.style,
i = this.lineHeight;
if (t < 0 || t > e.height - i) {
r.top = r.left = "0";
return;
}
var s = this.characterWidth;
if (this.$composition) {
var o = this
.textarea
.value
.replace(/^\x01+/, "");
s *= this
.session
.$getStringScreenWidth(o)[0] + 2,
i += 2;
}
n -= this.scrollLeft,
n > this.$size.scrollerWidth - s && (n = this.$size.scrollerWidth - s),
n += this.gutterWidth,
r.height = i + "px",
r.width = s + "px",
r.left = Math.min(n, this.$size.scrollerWidth - s) + "px",
r.top = Math.min(t, this.$size.height - i) + "px";
},
this.getFirstVisibleRow = function () {
return this.layerConfig.firstRow;
},
this.getFirstFullyVisibleRow = function () {
return this.layerConfig.firstRow + (this.layerConfig.offset === 0
? 0
: 1);
},
this.getLastFullyVisibleRow = function () {
var e = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
return this.layerConfig.firstRow - 1 + e;
},
this.getLastVisibleRow = function () {
return this.layerConfig.lastRow;
},
this.$padding = null,
this.setPadding = function (e) {
this.$padding = e,
this
.$textLayer
.setPadding(e),
this
.$cursorLayer
.setPadding(e),
this
.$markerFront
.setPadding(e),
this
.$markerBack
.setPadding(e),
this
.$loop
.schedule(this.CHANGE_FULL),
this.$updatePrintMargin();
},
this.setScrollMargin = function (e, t, n, r) {
var i = this.scrollMargin;
i.top = e | 0,
i.bottom = t | 0,
i.right = r | 0,
i.left = n | 0,
i.v = i.top + i.bottom,
i.h = i.left + i.right,
i.top && this.scrollTop <= 0 && this.session && this
.session
.setScrollTop(-i.top),
this.updateFull();
},
this.getHScrollBarAlwaysVisible = function () {
return this.$hScrollBarAlwaysVisible;
},
this.setHScrollBarAlwaysVisible = function (e) {
this.setOption("hScrollBarAlwaysVisible", e);
},
this.getVScrollBarAlwaysVisible = function () {
return this.$vScrollBarAlwaysVisible;
},
this.setVScrollBarAlwaysVisible = function (e) {
this.setOption("vScrollBarAlwaysVisible", e);
},
this.$updateScrollBarV = function () {
var e = this.layerConfig.maxHeight,
t = this.$size.scrollerHeight;
!this.$maxLines && this.$scrollPastEnd && (e -= (t - this.lineHeight) * this.$scrollPastEnd, this.scrollTop > e - t && (e = this.scrollTop + t, this.scrollBarV.scrollTop = null)),
this
.scrollBarV
.setScrollHeight(e + this.scrollMargin.v),
this
.scrollBarV
.setScrollTop(this.scrollTop + this.scrollMargin.top);
},
this.$updateScrollBarH = function () {
this
.scrollBarH
.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h),
this
.scrollBarH
.setScrollLeft(this.scrollLeft + this.scrollMargin.left);
},
this.$frozen = !1,
this.freeze = function () {
this.$frozen = !0;
},
this.unfreeze = function () {
this.$frozen = !1;
},
this.$renderChanges = function (e, t) {
this.$changes && (e |= this.$changes, this.$changes = 0);
if (!this.session || !this.container.offsetWidth || this.$frozen || !e && !t) {
this.$changes |= e;
return;
}
if (this.$size.$dirty) {
return this.$changes |= e,
this.onResize(!0);
}
this.lineHeight || this
.$textLayer
.checkForSizeChanges(),
this._signal("beforeRender");
var n = this.layerConfig;
if (e & this.CHANGE_FULL || e & this.CHANGE_SIZE || e & this.CHANGE_TEXT || e & this.CHANGE_LINES || e & this.CHANGE_SCROLL || e & this.CHANGE_H_SCROLL) {
e |= this.$computeLayerConfig();
if (n.firstRow != this.layerConfig.firstRow && n.firstRowScreen == this.layerConfig.firstRowScreen) {
var r = this.scrollTop + (n.firstRow - this.layerConfig.firstRow) * this.lineHeight;
r > 0 && (this.scrollTop = r, e |= this.CHANGE_SCROLL, e |= this.$computeLayerConfig());
}
n = this.layerConfig,
this.$updateScrollBarV(),
e & this.CHANGE_H_SCROLL && this.$updateScrollBarH(),
this.$gutterLayer.element.style.marginTop = -n.offset + "px",
this.content.style.marginTop = -n.offset + "px",
this.content.style.width = n.width + 2 * this.$padding + "px",
this.content.style.height = n.minHeight + "px";
}
e & this.CHANGE_H_SCROLL && (this.content.style.marginLeft = -this.scrollLeft + "px", this.scroller.className = this.scrollLeft <= 0
? "ace_scroller"
: "ace_scroller ace_scroll-left");
if (e & this.CHANGE_FULL) {
this
.$textLayer
.update(n),
this.$showGutter && this
.$gutterLayer
.update(n),
this
.$markerBack
.update(n),
this
.$markerFront
.update(n),
this
.$cursorLayer
.update(n),
this.$moveTextAreaToCursor(),
this.$highlightGutterLine && this.$updateGutterLineHighlight(),
this._signal("afterRender");
return;
}
if (e & this.CHANGE_SCROLL) {
e & this.CHANGE_TEXT || e & this.CHANGE_LINES
? this
.$textLayer
.update(n)
: this
.$textLayer
.scrollLines(n),
this.$showGutter && this
.$gutterLayer
.update(n),
this
.$markerBack
.update(n),
this
.$markerFront
.update(n),
this
.$cursorLayer
.update(n),
this.$highlightGutterLine && this.$updateGutterLineHighlight(),
this.$moveTextAreaToCursor(),
this._signal("afterRender");
return;
}
e & this.CHANGE_TEXT
? (this.$textLayer.update(n), this.$showGutter && this.$gutterLayer.update(n))
: e & this.CHANGE_LINES
? (this.$updateLines() || e & this.CHANGE_GUTTER && this.$showGutter) && this
.$gutterLayer
.update(n)
: (e & this.CHANGE_TEXT || e & this.CHANGE_GUTTER) && this.$showGutter && this
.$gutterLayer
.update(n),
e & this.CHANGE_CURSOR && (this.$cursorLayer.update(n), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight()),
e & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) && this
.$markerFront
.update(n),
e & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) && this
.$markerBack
.update(n),
this._signal("afterRender");
},
this.$autosize = function () {
var e = this
.session
.getScreenLength() * this.lineHeight,
t = this.$maxLines * this.lineHeight,
n = Math.max((this.$minLines || 1) * this.lineHeight, Math.min(t, e)) + this.scrollMargin.v +
(this.$extraHeight || 0);
this.$horizScroll && (n += this.scrollBarH.getHeight());
var r = e > t;
if (n != this.desiredHeight || this.$size.height != this.desiredHeight || r != this.$vScroll) {
r != this.$vScroll && (this.$vScroll = r, this.scrollBarV.setVisible(r));
var i = this.container.clientWidth;
this.container.style.height = n + "px",
this.$updateCachedSize(!0, this.$gutterWidth, i, n),
this.desiredHeight = n,
this._signal("autosize");
}
},
this.$computeLayerConfig = function () {
var e = this.session,
t = this.$size,
n = t.height <= 2 * this.lineHeight,
r = this
.session
.getScreenLength(),
i = r * this.lineHeight,
s = this.$getLongestLine(),
o = !n && (this.$hScrollBarAlwaysVisible || t.scrollerWidth - s - 2 * this.$padding < 0),
u = this.$horizScroll !== o;
u && (this.$horizScroll = o, this.scrollBarH.setVisible(o));
var a = this.$vScroll;
this.$maxLines && this.lineHeight > 1 && this.$autosize();
var f = this.scrollTop % this.lineHeight,
l = t.scrollerHeight + this.lineHeight,
c = !this.$maxLines && this.$scrollPastEnd
? (t.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
: 0;
i += c;
var h = this.scrollMargin;
this
.session
.setScrollTop(Math.max(-h.top, Math.min(this.scrollTop, i - t.scrollerHeight + h.bottom))),
this
.session
.setScrollLeft(Math.max(-h.left, Math.min(this.scrollLeft, s + 2 * this.$padding - t.scrollerWidth + h.right)));
var p = !n && (this.$vScrollBarAlwaysVisible || t.scrollerHeight - i + c < 0 || this.scrollTop > h.top),
d = a !== p;
d && (this.$vScroll = p, this.scrollBarV.setVisible(p));
var v = Math.ceil(l / this.lineHeight) - 1,
m = Math.max(0, Math.round((this.scrollTop - f) / this.lineHeight)),
g = m + v,
y,
b,
w = this.lineHeight;
m = e.screenToDocumentRow(m, 0);
var E = e.getFoldLine(m);
E && (m = E.start.row),
y = e.documentToScreenRow(m, 0),
b = e.getRowLength(m) * w,
g = Math.min(e.screenToDocumentRow(g, 0), e.getLength() - 1),
l = t.scrollerHeight + e.getRowLength(g) * w + b,
f = this.scrollTop - y * w;
var S = 0;
this.layerConfig.width != s && (S = this.CHANGE_H_SCROLL);
if (u || d) {
S = this.$updateCachedSize(!0, this.gutterWidth, t.width, t.height),
this._signal("scrollbarVisibilityChanged"),
d && (s = this.$getLongestLine());
}
return this.layerConfig = {
characterWidth: this.characterWidth,
firstRow : m,
firstRowScreen: y,
gutterOffset : Math.max(0, Math.ceil((f + t.height - t.scrollerHeight) / w)),
height : this.$size.scrollerHeight,
lastRow : g,
lineHeight : w,
maxHeight : i,
minHeight : l,
offset : f,
padding : this.$padding,
width : s
},
S;
},
this.$updateLines = function () {
var e = this.$changedLines.firstRow,
t = this.$changedLines.lastRow;
this.$changedLines = null;
var n = this.layerConfig;
if (e > n.lastRow + 1) {
return;
}
if (t < n.firstRow) {
return;
}
if (t === Infinity) {
this.$showGutter && this
.$gutterLayer
.update(n),
this
.$textLayer
.update(n);
return;
}
return this
.$textLayer
.updateLines(n, e, t),
!0;
},
this.$getLongestLine = function () {
var e = this
.session
.getScreenWidth();
return this.showInvisibles && !this.session.$useWrapMode && (e += 1),
Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(e * this.characterWidth));
},
this.updateFrontMarkers = function () {
this
.$markerFront
.setMarkers(this.session.getMarkers(!0)),
this
.$loop
.schedule(this.CHANGE_MARKER_FRONT);
},
this.updateBackMarkers = function () {
this
.$markerBack
.setMarkers(this.session.getMarkers()),
this
.$loop
.schedule(this.CHANGE_MARKER_BACK);
},
this.addGutterDecoration = function (e, t) {
this
.$gutterLayer
.addGutterDecoration(e, t);
},
this.removeGutterDecoration = function (e, t) {
this
.$gutterLayer
.removeGutterDecoration(e, t);
},
this.updateBreakpoints = function (e) {
this
.$loop
.schedule(this.CHANGE_GUTTER);
},
this.setAnnotations = function (e) {
this
.$gutterLayer
.setAnnotations(e),
this
.$loop
.schedule(this.CHANGE_GUTTER);
},
this.updateCursor = function () {
this
.$loop
.schedule(this.CHANGE_CURSOR);
},
this.hideCursor = function () {
this
.$cursorLayer
.hideCursor();
},
this.showCursor = function () {
this
.$cursorLayer
.showCursor();
},
this.scrollSelectionIntoView = function (e, t, n) {
this.scrollCursorIntoView(e, n),
this.scrollCursorIntoView(t, n);
},
this.scrollCursorIntoView = function (e, t, n) {
if (this.$size.scrollerHeight === 0) {
return;
}
var r = this
.$cursorLayer
.getPixelPosition(e),
i = r.left,
s = r.top,
o = n && n.top || 0,
u = n && n.bottom || 0,
a = this.$scrollAnimation
? this
.session
.getScrollTop()
: this.scrollTop;
a + o > s
? (t && (s -= t * this.$size.scrollerHeight), s === 0 && (s = -this.scrollMargin.top), this.session.setScrollTop(s))
: a + this.$size.scrollerHeight - u < s + this.lineHeight && (t && (s += t * this.$size.scrollerHeight), this.session.setScrollTop(s +
this.lineHeight - this.$size.scrollerHeight));
var f = this.scrollLeft;
f > i
? (i < this.$padding + 2 * this.layerConfig.characterWidth && (i = -this.scrollMargin.left), this.session.setScrollLeft(i))
: f + this.$size.scrollerWidth < i + this.characterWidth
? this
.session
.setScrollLeft(Math.round(i + this.characterWidth - this.$size.scrollerWidth))
: f <= this.$padding && i - f < this.characterWidth && this
.session
.setScrollLeft(0);
},
this.getScrollTop = function () {
return this
.session
.getScrollTop();
},
this.getScrollLeft = function () {
return this
.session
.getScrollLeft();
},
this.getScrollTopRow = function () {
return this.scrollTop / this.lineHeight;
},
this.getScrollBottomRow = function () {
return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
},
this.scrollToRow = function (e) {
this
.session
.setScrollTop(e * this.lineHeight);
},
this.alignCursor = function (e, t) {
typeof e == "number" && (e = {
column: 0,
row : e
});
var n = this
.$cursorLayer
.getPixelPosition(e),
r = this.$size.scrollerHeight - this.lineHeight,
i = n.top - r * (t || 0);
return this
.session
.setScrollTop(i),
i;
},
this.STEPS = 8,
this.$calcSteps = function (e, t) {
var n = 0,
r = this.STEPS,
i = [],
s = function (e, t, n) {
return n * (Math.pow(e - 1, 3) + 1) + t;
};
for (n = 0; n < r; n += 1) {
i.push(s(n / this.STEPS, e, t - e));
}
return i;
},
this.scrollToLine = function (e, t, n, r) {
var i = this
.$cursorLayer
.getPixelPosition({column: 0, row: e}),
s = i.top;
t && (s -= this.$size.scrollerHeight / 2);
var o = this.scrollTop;
this
.session
.setScrollTop(s),
n !== !1 && this.animateScrolling(o, r);
},
this.animateScrolling = function (e, t) {
var n = this.scrollTop;
if (!this.$animatedScroll) {
return;
}
var r = this;
if (e == n) {
return;
}
if (this.$scrollAnimation) {
var i = this.$scrollAnimation.steps;
if (i.length) {
e = i[0];
if (e == n) {
return;
}
}
}
var s = r.$calcSteps(e, n);
this.$scrollAnimation = {
from : e,
steps: s,
to : n
},
clearInterval(this.$timer),
r
.session
.setScrollTop(s.shift()),
r.session.$scrollTop = n,
this.$timer = setInterval(function () {
s.length
? (r.session.setScrollTop(s.shift()), r.session.$scrollTop = n)
: n != null
? (r.session.$scrollTop = -1, r.session.setScrollTop(n), n = null)
: (r.$timer = clearInterval(r.$timer), r.$scrollAnimation = null, t && t());
}, 10);
},
this.scrollToY = function (e) {
this.scrollTop !== e && (this.$loop.schedule(this.CHANGE_SCROLL), this.scrollTop = e);
},
this.scrollToX = function (e) {
this.scrollLeft !== e && (this.scrollLeft = e),
this
.$loop
.schedule(this.CHANGE_H_SCROLL);
},
this.scrollTo = function (e, t) {
this
.session
.setScrollTop(t),
this
.session
.setScrollLeft(t);
},
this.scrollBy = function (e, t) {
t && this
.session
.setScrollTop(this.session.getScrollTop() + t),
e && this
.session
.setScrollLeft(this.session.getScrollLeft() + e);
},
this.isScrollableBy = function (e, t) {
if (t < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) {
return !0;
}
if (t > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) {
return !0;
}
if (e < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) {
return !0;
}
if (e > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - this.layerConfig.width < -1 + this.scrollMargin.right) {
return !0;
}
},
this.pixelToScreenCoordinates = function (e, t) {
var n = this
.scroller
.getBoundingClientRect(),
r = (e + this.scrollLeft - n.left - this.$padding) / this.characterWidth,
i = Math.floor((t + this.scrollTop - n.top) / this.lineHeight),
s = Math.round(r);
return {
column: s,
row : i,
side : r - s > 0
? 1
: -1
};
},
this.screenToTextCoordinates = function (e, t) {
var n = this
.scroller
.getBoundingClientRect(),
r = Math.round((e + this.scrollLeft - n.left - this.$padding) / this.characterWidth),
i = (t + this.scrollTop - n.top) / this.lineHeight;
return this
.session
.screenToDocumentPosition(i, Math.max(r, 0));
},
this.textToScreenCoordinates = function (e, t) {
var n = this
.scroller
.getBoundingClientRect(),
r = this
.session
.documentToScreenPosition(e, t),
i = this.$padding + Math.round(r.column * this.characterWidth),
s = r.row * this.lineHeight;
return {
pageX: n.left + i - this.scrollLeft,
pageY: n.top + s - this.scrollTop
};
},
this.visualizeFocus = function () {
i.addCssClass(this.container, "ace_focus");
},
this.visualizeBlur = function () {
i.removeCssClass(this.container, "ace_focus");
},
this.showComposition = function (e) {
this.$composition || (this.$composition = {
cssText : this.textarea.style.cssText,
keepTextAreaAtCursor: this.$keepTextAreaAtCursor
}),
this.$keepTextAreaAtCursor = !0,
i.addCssClass(this.textarea, "ace_composition"),
this.textarea.style.cssText = "",
this.$moveTextAreaToCursor();
},
this.setCompositionText = function (e) {
this.$moveTextAreaToCursor();
},
this.hideComposition = function () {
if (!this.$composition) {
return;
}
i.removeCssClass(this.textarea, "ace_composition"),
this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor,
this.textarea.style.cssText = this.$composition.cssText,
this.$composition = null;
},
this.setTheme = function (e, t) {
function o(r) {
if (n.$themeId != e) {
return t && t();
}
if (!r.cssClass) {
return;
}
i.importCssString(r.cssText, r.cssClass, n.container.ownerDocument),
n.theme && i.removeCssClass(n.container, n.theme.cssClass);
var s = "padding" in r
? r.padding
: "padding" in (n.theme || {})
? 4
: n.$padding;
n.$padding && s != n.$padding && n.setPadding(s),
n.$theme = r.cssClass,
n.theme = r,
i.addCssClass(n.container, r.cssClass),
i.setCssClass(n.container, "ace_dark", r.isDark),
n.$size && (n.$size.width = 0, n.$updateSizeAsync()),
n._dispatchEvent("themeLoaded", {theme: r}),
t && t();
}
var n = this;
this.$themeId = e,
n._dispatchEvent("themeChange", {theme: e});
if (!e || typeof e == "string") {
var r = e || this.$options.theme.initialValue;
s.loadModule([
"theme", r
], o);
} else {
o(e);
}
},
this.getTheme = function () {
return this.$themeId;
},
this.setStyle = function (e, t) {
i.setCssClass(this.container, e, t !== !1);
},
this.unsetStyle = function (e) {
i.removeCssClass(this.container, e);
},
this.setCursorStyle = function (e) {
this.scroller.style.cursor != e && (this.scroller.style.cursor = e);
},
this.setMouseCursor = function (e) {
this.scroller.style.cursor = e;
},
this.destroy = function () {
this
.$textLayer
.destroy(),
this
.$cursorLayer
.destroy();
};
}).call(g.prototype),
s.defineOptions(g.prototype, "renderer", {
animatedScroll : {
initialValue: !1
},
displayIndentGuides : {
initialValue: !0,
set : function (e) {
this
.$textLayer
.setDisplayIndentGuides(e) && this
.$loop
.schedule(this.CHANGE_TEXT);
}
},
fadeFoldWidgets : {
initialValue: !1,
set : function (e) {
i.setCssClass(this.$gutter, "ace_fade-fold-widgets", e);
}
},
fixedWidthGutter : {
set: function (e) {
this.$gutterLayer.$fixedWidth = !!e,
this
.$loop
.schedule(this.CHANGE_GUTTER);
}
},
fontFamily : {
set: function (e) {
this.container.style.fontFamily = e,
this.updateFontSize();
}
},
fontSize : {
initialValue: 12,
set : function (e) {
typeof e == "number" && (e += "px"),
this.container.style.fontSize = e,
this.updateFontSize();
}
},
highlightGutterLine : {
initialValue: !1,
set : function (e) {
if (!this.$gutterLineHighlight) {
this.$gutterLineHighlight = i.createElement("div"),
this.$gutterLineHighlight.className = "ace_gutter-active-line",
this
.$gutter
.appendChild(this.$gutterLineHighlight);
return;
}
this.$gutterLineHighlight.style.display = e
? ""
: "none",
this.$cursorLayer.$pixelPos && this.$updateGutterLineHighlight();
},
value : !0
},
hScrollBarAlwaysVisible: {
initialValue: !1,
set : function (e) {
(!this.$hScrollBarAlwaysVisible || !this.$horizScroll) && this
.$loop
.schedule(this.CHANGE_SCROLL);
}
},
maxLines : {
set: function (e) {
this.updateFull();
}
},
minLines : {
set: function (e) {
this.updateFull();
}
},
printMargin : {
get: function () {
return this.$showPrintMargin && this.$printMarginColumn;
},
set: function (e) {
typeof e == "number" && (this.$printMarginColumn = e),
this.$showPrintMargin = !!e,
this.$updatePrintMargin();
}
},
printMarginColumn : {
initialValue: 80,
set : function () {
this.$updatePrintMargin();
}
},
scrollPastEnd : {
handlesSet : !0,
initialValue: 0,
set : function (e) {
e = +e || 0;
if (this.$scrollPastEnd == e) {
return;
}
this.$scrollPastEnd = e,
this
.$loop
.schedule(this.CHANGE_SCROLL);
}
},
showFoldWidgets : {
initialValue: !0,
set : function (e) {
this
.$gutterLayer
.setShowFoldWidgets(e);
}
},
showGutter : {
initialValue: !0,
set : function (e) {
this.$gutter.style.display = e
? "block"
: "none",
this
.$loop
.schedule(this.CHANGE_FULL),
this.onGutterResize();
}
},
showInvisibles : {
initialValue: !1,
set : function (e) {
this
.$textLayer
.setShowInvisibles(e) && this
.$loop
.schedule(this.CHANGE_TEXT);
}
},
showLineNumbers : {
initialValue: !0,
set : function (e) {
this
.$gutterLayer
.setShowLineNumbers(e),
this
.$loop
.schedule(this.CHANGE_GUTTER);
}
},
showPrintMargin : {
initialValue: !0,
set : function () {
this.$updatePrintMargin();
}
},
theme : {
get : function () {
return this.$themeId || this.theme;
},
handlesSet : !0,
initialValue: "./theme/textmate",
set : function (e) {
this.setTheme(e);
}
},
vScrollBarAlwaysVisible: {
initialValue: !1,
set : function (e) {
(!this.$vScrollBarAlwaysVisible || !this.$vScroll) && this
.$loop
.schedule(this.CHANGE_SCROLL);
}
}
}),
t.VirtualRenderer = g;
}),
define("ace/worker/worker_client", [
"require",
"exports",
"module",
"ace/lib/oop",
"ace/lib/net",
"ace/lib/event_emitter",
"ace/config"
], function (e, t, n) {
"use strict";
var r = e("../lib/oop"),
i = e("../lib/net"),
s = e("../lib/event_emitter").EventEmitter,
o = e("../config"),
u = function (t, n, r, i) {
this.$sendDeltaQueue = this
.$sendDeltaQueue
.bind(this),
this.changeListener = this
.changeListener
.bind(this),
this.onMessage = this
.onMessage
.bind(this),
e.nameToUrl && !e.toUrl && (e.toUrl = e.nameToUrl);
if (o.get("packaged") || !e.toUrl) {
i = i || o.moduleUrl(n, "worker");
} else {
var s = this.$normalizePath;
i = i || s(e.toUrl("ace/worker/worker.js", null, "_"));
var u = {};
t.forEach(function (t) {
u[t] = s(e.toUrl(t, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
});
}
try {
this.$worker = new Worker(i);
} catch (a) {
if (!(a instanceof window.DOMException)) {
throw a;
}
var f = this.$workerBlob(i),
l = window.URL || window.webkitURL,
c = l.createObjectURL(f);
this.$worker = new Worker(c),
l.revokeObjectURL(c);
}
this
.$worker
.postMessage({
classname: r,
init : !0,
module : n,
tlns : u
}),
this.callbackId = 1,
this.callbacks = {},
this.$worker.onmessage = this.onMessage;
};
(function () {
r.implement(this, s),
this.onMessage = function (e) {
var t = e.data;
switch (t.type) {
case "event":
this._signal(t.name, {data: t.data});
break;
case "call":
var n = this.callbacks[t.id];
n && (n(t.data), delete this.callbacks[t.id]);
break;
case "error":
this.reportError(t.data);
break;
case "log":
window.console && console.log && console
.log
.apply(console, t.data);
}
},
this.reportError = function (e) {
window.console && console.error && console.error(e);
},
this.$normalizePath = function (e) {
return i.qualifyURL(e);
},
this.terminate = function () {
this._signal("terminate", {}),
this.deltaQueue = null,
this
.$worker
.terminate(),
this.$worker = null,
this.$doc && this
.$doc
.off("change", this.changeListener),
this.$doc = null;
},
this.send = function (e, t) {
this
.$worker
.postMessage({args: t, command: e});
},
this.call = function (e, t, n) {
if (n) {
var r = this.callbackId++;
this.callbacks[r] = n,
t.push(r);
}
this.send(e, t);
},
this.emit = function (e, t) {
try {
this
.$worker
.postMessage({
data : {
data: t.data
},
event: e
});
} catch (n) {
console.error(n.stack);
}
},
this.attachToDocument = function (e) {
this.$doc && this.terminate(),
this.$doc = e,
this.call("setValue", [e.getValue()]),
e.on("change", this.changeListener);
},
this.changeListener = function (e) {
this.deltaQueue || (this.deltaQueue = [], setTimeout(this.$sendDeltaQueue, 0)),
e.action == "insert"
? this
.deltaQueue
.push(e.start, e.lines)
: this
.deltaQueue
.push(e.start, e.end);
},
this.$sendDeltaQueue = function () {
var e = this.deltaQueue;
if (!e) {
return;
}
this.deltaQueue = null,
e.length > 50 && e.length > this
.$doc
.getLength() >> 1
? this.call("setValue", [
this
.$doc
.getValue()
])
: this.emit("change", {data: e});
},
this.$workerBlob = function (e) {
var t = "importScripts('" + i.qualifyURL(e) + "');";
try {
return new Blob([t], {type: "application/javascript"});
} catch (n) {
var r = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder,
s = new r;
return s.append(t),
s.getBlob("application/javascript");
}
};
}).call(u.prototype);
var a = function (e, t, n) {
this.$sendDeltaQueue = this
.$sendDeltaQueue
.bind(this),
this.changeListener = this
.changeListener
.bind(this),
this.callbackId = 1,
this.callbacks = {},
this.messageBuffer = [];
var r = null,
i = !1,
u = Object.create(s),
a = this;
this.$worker = {},
this.$worker.terminate = function () {},
this.$worker.postMessage = function (e) {
a
.messageBuffer
.push(e),
r && (i
? setTimeout(f)
: f());
},
this.setEmitSync = function (e) {
i = e;
};
var f = function () {
var e = a
.messageBuffer
.shift();
e.command
? r[e.command].apply(r, e.args)
: e.event && u._signal(e.event, e.data);
};
u.postMessage = function (e) {
a.onMessage({data: e});
},
u.callback = function (e, t) {
this.postMessage({data: e, id: t, type: "call"});
},
u.emit = function (e, t) {
this.postMessage({data: t, name: e, type: "event"});
},
o.loadModule([
"worker", t
], function (e) {
r = new e[n](u);
while (a.messageBuffer.length) {
f();
}
});
};
a.prototype = u.prototype,
t.UIWorkerClient = a,
t.WorkerClient = u;
}),
define("ace/placeholder", [
"require",
"exports",
"module",
"ace/range",
"ace/lib/event_emitter",
"ace/lib/oop"
], function (e, t, n) {
"use strict";
var r = e("./range").Range,
i = e("./lib/event_emitter").EventEmitter,
s = e("./lib/oop"),
o = function (e, t, n, r, i, s) {
var o = this;
this.length = t,
this.session = e,
this.doc = e.getDocument(),
this.mainClass = i,
this.othersClass = s,
this.$onUpdate = this
.onUpdate
.bind(this),
this
.doc
.on("change", this.$onUpdate),
this.$others = r,
this.$onCursorChange = function () {
setTimeout(function () {
o.onCursorChange();
});
},
this.$pos = n;
var u = e
.getUndoManager()
.$undoStack || e
.getUndoManager()
.$undostack || {
length: -1
};
this.$undoStackDepth = u.length,
this.setup(),
e
.selection
.on("changeCursor", this.$onCursorChange);
};
(function () {
s.implement(this, i),
this.setup = function () {
var e = this,
t = this.doc,
n = this.session,
i = this.$pos;
this.selectionBefore = n
.selection
.toJSON(),
n.selection.inMultiSelectMode && n
.selection
.toSingleRange(),
this.pos = t.createAnchor(i.row, i.column),
this.markerId = n.addMarker(new r(i.row, i.column, i.row, i.column + this.length), this.mainClass, null, !1),
this
.pos
.on("change", function (t) {
n.removeMarker(e.markerId),
e.markerId = n.addMarker(new r(t.value.row, t.value.column, t.value.row, t.value.column +
e.length), e.mainClass, null, !1);
}),
this.others = [],
this
.$others
.forEach(function (n) {
var r = t.createAnchor(n.row, n.column);
e
.others
.push(r);
}),
n.setUndoSelect(!1);
},
this.showOtherMarkers = function () {
if (this.othersActive) {
return;
}
var e = this.session,
t = this;
this.othersActive = !0,
this
.others
.forEach(function (n) {
n.markerId = e.addMarker(new r(n.row, n.column, n.row, n.column + t.length), t.othersClass, null, !1),
n.on("change", function (i) {
e.removeMarker(n.markerId),
n.markerId = e.addMarker(new r(i.value.row, i.value.column, i.value.row, i.value.column +
t.length), t.othersClass, null, !1);
});
});
},
this.hideOtherMarkers = function () {
if (!this.othersActive) {
return;
}
this.othersActive = !1;
for (var e = 0; e < this.others.length; e += 1) {
this
.session
.removeMarker(this.others[e].markerId);
}
},
this.onUpdate = function (e) {
var t = e;
if (t.start.row !== t.end.row) {
return;
}
if (t.start.row !== this.pos.row) {
return;
}
if (this.$updating) {
return;
}
this.$updating = !0;
var n = e.action === "insert"
? t.end.column - t.start.column
: t.start.column - t.end.column;
if (t.start.column >= this.pos.column && t.start.column <= this.pos.column + this.length + 1) {
var i = t.start.column - this.pos.column;
this.length += n;
if (!this.session.$fromUndo) {
if (e.action === "insert") {
for (var s = this.others.length - 1; s >= 0; s -= 1) {
var o = this.others[s],
u = {
column: o.column + i,
row : o.row
};
o.row === t.start.row && t.start.column < o.column && (u.column += n),
this
.doc
.insertMergedLines(u, e.lines);
}
} else if (e.action === "remove") {
for (var s = this.others.length - 1; s >= 0; s -= 1) {
var o = this.others[s],
u = {
column: o.column + i,
row : o.row
};
o.row === t.start.row && t.start.column < o.column && (u.column += n),
this
.doc
.remove(new r(u.row, u.column, u.row, u.column - n));
}
}
t.start.column === this.pos.column && e.action === "insert"
? setTimeout(function () {
this
.pos
.setPosition(this.pos.row, this.pos.column - n);
for (var e = 0; e < this.others.length; e += 1) {
var r = this.others[e],
i = {
column: r.column - n,
row : r.row
};
r.row === t.start.row && t.start.column < r.column && (i.column += n),
r.setPosition(i.row, i.column);
}
}.bind(this), 0)
: t.start.column === this.pos.column && e.action === "remove" && setTimeout(function () {
for (var e = 0; e < this.others.length; e += 1) {
var r = this.others[e];
r.row === t.start.row && t.start.column < r.column && r.setPosition(r.row, r.column - n);
}
}.bind(this), 0);
}
this
.pos
._emit("change", {value: this.pos});
for (var s = 0; s < this.others.length; s += 1) {
this
.others[s]
._emit("change", {value: this.others[s]});
}
}
this.$updating = !1;
},
this.onCursorChange = function (e) {
if (this.$updating || !this.session) {
return;
}
var t = this
.session
.selection
.getCursor();
t.row === this.pos.row && t.column >= this.pos.column && t.column <= this.pos.column + this.length
? (this.showOtherMarkers(), this._emit("cursorEnter", e))
: (this.hideOtherMarkers(), this._emit("cursorLeave", e));
},
this.detach = function () {
this
.session
.removeMarker(this.markerId),
this.hideOtherMarkers(),
this
.doc
.removeEventListener("change", this.$onUpdate),
this
.session
.selection
.removeEventListener("changeCursor", this.$onCursorChange),
this
.pos
.detach();
for (var e = 0; e < this.others.length; e += 1) {
this
.others[e]
.detach();
}
this
.session
.setUndoSelect(!0),
this.session = null;
},
this.cancel = function () {
if (this.$undoStackDepth === -1) {
throw Error("Canceling placeholders only supported with undo manager attached to session.");
}
var e = this
.session
.getUndoManager(),
t = (e.$undoStack || e.$undostack).length - this.$undoStackDepth;
for (var n = 0; n < t; n += 1) {
e.undo(!0);
}
this.selectionBefore && this
.session
.selection
.fromJSON(this.selectionBefore);
};
}).call(o.prototype),
t.PlaceHolder = o;
}),
define("ace/mouse/multi_select_handler", [
"require", "exports", "module", "ace/lib/event", "ace/lib/useragent"
], function (e, t, n) {
function s(e, t) {
return e.row == t.row && e.column == t.column;
}
function o(e) {
var t = e.domEvent,
n = t.altKey,
o = t.shiftKey,
u = t.ctrlKey,
a = e.getAccelKey(),
f = e.getButton();
u && i.isMac && (f = t.button);
if (e.editor.inMultiSelectMode && f == 2) {
e
.editor
.textInput
.onContextMenu(e.domEvent);
return;
}
if (!u && !n && !a) {
f === 0 && e.editor.inMultiSelectMode && e
.editor
.exitMultiSelectMode();
return;
}
if (f !== 0) {
return;
}
var l = e.editor,
c = l.selection,
h = l.inMultiSelectMode,
p = e.getDocumentPosition(),
d = c.getCursor(),
v = e.inSelection() || c.isEmpty() && s(p, d),
m = e.x,
g = e.y,
y = function (e) {
m = e.clientX,
g = e.clientY;
},
b = l.session,
w = l
.renderer
.pixelToScreenCoordinates(m, g),
E = w,
S;
if (l.$mouseHandler.$enableJumpToDef) {
u && n || a && n
? S = o
? "block"
: "add"
: n && l.$blockSelectEnabled && (S = "block");
} else if (a && !n) {
S = "add";
if (!h && o) {
return;
}
} else {
n && l.$blockSelectEnabled && (S = "block");
}
S && i.isMac && t.ctrlKey && l
.$mouseHandler
.cancelContextMenu();
if (S == "add") {
if (!h && v) {
return;
}
if (!h) {
var x = c.toOrientedRange();
l.addSelectionMarker(x);
}
var T = c
.rangeList
.rangeAtPoint(p);
l.$blockScrolling++,
l.inVirtualSelectionMode = !0,
o && (T = null, x = c.ranges[0] || x, l.removeSelectionMarker(x)),
l.once("mouseup", function () {
var e = c.toOrientedRange();
T && e.isEmpty() && s(T.cursor, e.cursor)
? c.substractPoint(e.cursor)
: (o
? c.substractPoint(x.cursor)
: x && (l.removeSelectionMarker(x), c.addRange(x)),
c.addRange(e)),
l.$blockScrolling--,
l.inVirtualSelectionMode = !1;
});
} else if (S == "block") {
e.stop(),
l.inVirtualSelectionMode = !0;
var N,
C = [],
k = function () {
var e = l
.renderer
.pixelToScreenCoordinates(m, g),
t = b.screenToDocumentPosition(e.row, e.column);
if (s(E, e) && s(t, c.lead)) {
return;
}
E = e,
l.$blockScrolling++,
l
.selection
.moveToPosition(t),
l
.renderer
.scrollCursorIntoView(),
l.removeSelectionMarkers(C),
C = c.rectangularRangeBlock(E, w),
l.$mouseHandler.$clickSelection && C.length == 1 && C[0].isEmpty() && (C[0] = l.$mouseHandler.$clickSelection.clone()),
C.forEach(l.addSelectionMarker, l),
l.updateSelectionMarkers(),
l.$blockScrolling -= 1;
};
l.$blockScrolling++,
h && !a
? c.toSingleRange()
: !h && a && (N = c.toOrientedRange(), l.addSelectionMarker(N)),
o
? w = b.documentToScreenPosition(c.lead)
: c.moveToPosition(p),
l.$blockScrolling--,
E = {
column: -1,
row : -1
};
var L = function (e) {
clearInterval(O),
l.removeSelectionMarkers(C),
C.length || (C = [c.toOrientedRange()]),
l.$blockScrolling++,
N && (l.removeSelectionMarker(N), c.toSingleRange(N));
for (var t = 0; t < C.length; t += 1) {
c.addRange(C[t]);
}
l.inVirtualSelectionMode = !1,
l.$mouseHandler.$clickSelection = null,
l.$blockScrolling -= 1;
},
A = k;
r.capture(l.container, y, L);
var O = setInterval(function () {
A();
}, 20);
return e.preventDefault();
}
}
var r = e("../lib/event"),
i = e("../lib/useragent");
t.onMouseDown = o;
}),
define("ace/commands/multi_select_commands", [
"require", "exports", "module", "ace/keyboard/hash_handler"
], function (e, t, n) {
t.defaultCommands = [
{
bindKey : {
mac: "Ctrl-Alt-Up",
win: "Ctrl-Alt-Up"
},
exec : function (e) {
e.selectMoreLines(-1);
},
name : "addCursorAbove",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Down",
win: "Ctrl-Alt-Down"
},
exec : function (e) {
e.selectMoreLines(1);
},
name : "addCursorBelow",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Shift-Up",
win: "Ctrl-Alt-Shift-Up"
},
exec : function (e) {
e.selectMoreLines(-1, !0);
},
name : "addCursorAboveSkipCurrent",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Shift-Down",
win: "Ctrl-Alt-Shift-Down"
},
exec : function (e) {
e.selectMoreLines(1, !0);
},
name : "addCursorBelowSkipCurrent",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Left",
win: "Ctrl-Alt-Left"
},
exec : function (e) {
e.selectMore(-1);
},
name : "selectMoreBefore",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Right",
win: "Ctrl-Alt-Right"
},
exec : function (e) {
e.selectMore(1);
},
name : "selectMoreAfter",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Shift-Left",
win: "Ctrl-Alt-Shift-Left"
},
exec : function (e) {
e.selectMore(-1, !0);
},
name : "selectNextBefore",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-Shift-Right",
win: "Ctrl-Alt-Shift-Right"
},
exec : function (e) {
e.selectMore(1, !0);
},
name : "selectNextAfter",
readOnly : !0,
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-L",
win: "Ctrl-Alt-L"
},
exec : function (e) {
e
.multiSelect
.splitIntoLines();
},
name : "splitIntoLines",
readOnly: !0
}, {
bindKey : {
mac: "Ctrl-Alt-A",
win: "Ctrl-Alt-A"
},
exec : function (e) {
e.alignCursors();
},
name : "alignCursors",
scrollIntoView: "cursor"
}, {
bindKey : {
mac: "Ctrl-Alt-G",
win: "Ctrl-Alt-K"
},
exec : function (e) {
e.findAll();
},
name : "findAll",
readOnly : !0,
scrollIntoView: "cursor"
}
],
t.multiSelectCommands = [
{
bindKey : "esc",
exec : function (e) {
e.exitMultiSelectMode();
},
isAvailable : function (e) {
return e && e.inMultiSelectMode;
},
name : "singleSelection",
readOnly : !0,
scrollIntoView: "cursor"
}
];
var r = e("../keyboard/hash_handler").HashHandler;
t.keyboardHandler = new r(t.multiSelectCommands);
}),
define("ace/multi_select", [
"require",
"exports",
"module",
"ace/range_list",
"ace/range",
"ace/selection",
"ace/mouse/multi_select_handler",
"ace/lib/event",
"ace/lib/lang",
"ace/commands/multi_select_commands",
"ace/search",
"ace/edit_session",
"ace/editor",
"ace/config"
], function (e, t, n) {
function h(e, t, n) {
return c.$options.wrap = !0,
c.$options.needle = t,
c.$options.backwards = n == -1,
c.find(e);
}
function v(e, t) {
return e.row == t.row && e.column == t.column;
}
function m(e) {
if (e.$multiselectOnSessionChange) {
return;
}
e.$onAddRange = e
.$onAddRange
.bind(e),
e.$onRemoveRange = e
.$onRemoveRange
.bind(e),
e.$onMultiSelect = e
.$onMultiSelect
.bind(e),
e.$onSingleSelect = e
.$onSingleSelect
.bind(e),
e.$multiselectOnSessionChange = t
.onSessionChange
.bind(e),
e.$checkMultiselectChange = e
.$checkMultiselectChange
.bind(e),
e.$multiselectOnSessionChange(e),
e.on("changeSession", e.$multiselectOnSessionChange),
e.on("mousedown", o),
e
.commands
.addCommands(f.defaultCommands),
g(e);
}
function g(e) {
function r(t) {
n && (e.renderer.setMouseCursor(""), n = !1);
}
var t = e
.textInput
.getElement(),
n = !1;
u.addListener(t, "keydown", function (t) {
var i = t.keyCode == 18 && !(t.ctrlKey || t.shiftKey || t.metaKey);
e.$blockSelectEnabled && i
? n || (e.renderer.setMouseCursor("crosshair"), n = !0)
: n && r();
}),
u.addListener(t, "keyup", r),
u.addListener(t, "blur", r);
}
var r = e("./range_list").RangeList,
i = e("./range").Range,
s = e("./selection").Selection,
o = e("./mouse/multi_select_handler").onMouseDown,
u = e("./lib/event"),
a = e("./lib/lang"),
f = e("./commands/multi_select_commands");
t.commands = f
.defaultCommands
.concat(f.multiSelectCommands);
var l = e("./search").Search,
c = new l,
p = e("./edit_session").EditSession;
(function () {
this.getSelectionMarkers = function () {
return this.$selectionMarkers;
};
}).call(p.prototype),
function () {
this.ranges = null,
this.rangeList = null,
this.addRange = function (e, t) {
if (!e) {
return;
}
if (!this.inMultiSelectMode && this.rangeCount === 0) {
var n = this.toOrientedRange();
this
.rangeList
.add(n),
this
.rangeList
.add(e);
if (this.rangeList.ranges.length != 2) {
return this
.rangeList
.removeAll(),
t || this.fromOrientedRange(e);
}
this
.rangeList
.removeAll(),
this
.rangeList
.add(n),
this.$onAddRange(n);
}
e.cursor || (e.cursor = e.end);
var r = this
.rangeList
.add(e);
return this.$onAddRange(e),
r.length && this.$onRemoveRange(r),
this.rangeCount > 1 && !this.inMultiSelectMode && (this._signal("multiSelect"), this.inMultiSelectMode = !0, this.session.$undoSelect = !1, this.rangeList.attach(this.session)),
t || this.fromOrientedRange(e);
},
this.toSingleRange = function (e) {
e = e || this.ranges[0];
var t = this
.rangeList
.removeAll();
t.length && this.$onRemoveRange(t),
e && this.fromOrientedRange(e);
},
this.substractPoint = function (e) {
var t = this
.rangeList
.substractPoint(e);
if (t) {
return this.$onRemoveRange(t),
t[0];
}
},
this.mergeOverlappingRanges = function () {
var e = this
.rangeList
.merge();
e.length
? this.$onRemoveRange(e)
: this.ranges[0] && this.fromOrientedRange(this.ranges[0]);
},
this.$onAddRange = function (e) {
this.rangeCount = this.rangeList.ranges.length,
this
.ranges
.unshift(e),
this._signal("addRange", {range: e});
},
this.$onRemoveRange = function (e) {
this.rangeCount = this.rangeList.ranges.length;
if (this.rangeCount == 1 && this.inMultiSelectMode) {
var t = this
.rangeList
.ranges
.pop();
e.push(t),
this.rangeCount = 0;
}
for (var n = e.length; n -= 1;) {
var r = this
.ranges
.indexOf(e[n]);
this
.ranges
.splice(r, 1);
}
this._signal("removeRange", {ranges: e}),
this.rangeCount === 0 && this.inMultiSelectMode && (this.inMultiSelectMode = !1, this._signal("singleSelect"), this.session.$undoSelect = !0, this.rangeList.detach(this.session)),
t = t || this.ranges[0],
t && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
},
this.$initRangeList = function () {
if (this.rangeList) {
return;
}
this.rangeList = new r,
this.ranges = [],
this.rangeCount = 0;
},
this.getAllRanges = function () {
return this.rangeCount
? this
.rangeList
.ranges
.concat()
: [this.getRange()];
},
this.splitIntoLines = function () {
if (this.rangeCount > 1) {
var e = this.rangeList.ranges,
t = e[e.length - 1],
n = i.fromPoints(e[0].start, t.end);
this.toSingleRange(),
this.setSelectionRange(n, t.cursor == t.start);
} else {
var n = this.getRange(),
r = this.isBackwards(),
s = n.start.row,
o = n.end.row;
if (s == o) {
if (r) {
var u = n.end,
a = n.start;
} else {
var u = n.start,
a = n.end;
}
this.addRange(i.fromPoints(a, a)),
this.addRange(i.fromPoints(u, u));
return;
}
var f = [],
l = this.getLineRange(s, !0);
l.start.column = n.start.column,
f.push(l);
for (var c = s + 1; c < o; c += 1) {
f.push(this.getLineRange(c, !0));
}
l = this.getLineRange(o, !0),
l.end.column = n.end.column,
f.push(l),
f.forEach(this.addRange, this);
}
},
this.toggleBlockSelection = function () {
if (this.rangeCount > 1) {
var e = this.rangeList.ranges,
t = e[e.length - 1],
n = i.fromPoints(e[0].start, t.end);
this.toSingleRange(),
this.setSelectionRange(n, t.cursor == t.start);
} else {
var r = this
.session
.documentToScreenPosition(this.selectionLead),
s = this
.session
.documentToScreenPosition(this.selectionAnchor),
o = this.rectangularRangeBlock(r, s);
o.forEach(this.addRange, this);
}
},
this.rectangularRangeBlock = function (e, t, n) {
var r = [],
s = e.column < t.column;
if (s) {
var o = e.column,
u = t.column;
} else {
var o = t.column,
u = e.column;
}
var a = e.row < t.row;
if (a) {
var f = e.row,
l = t.row;
} else {
var f = t.row,
l = e.row;
}
o < 0 && (o = 0),
f < 0 && (f = 0),
f == l && (n = !0);
for (var c = f; c <= l; c += 1) {
var h = i.fromPoints(this.session.screenToDocumentPosition(c, o), this.session.screenToDocumentPosition(c, u));
if (h.isEmpty()) {
if (p && v(h.end, p)) {
break;
}
var p = h.end;
}
h.cursor = s
? h.start
: h.end,
r.push(h);
}
a && r.reverse();
if (!n) {
var d = r.length - 1;
while (r[d].isEmpty() && d > 0) {
d -= 1;
}
if (d > 0) {
var m = 0;
while (r[m].isEmpty()) {
m += 1;
}
}
for (var g = d; g >= m; g -= 1) {
r[g].isEmpty() && r.splice(g, 1);
}
}
return r;
};
}.call(s.prototype);
var d = e("./editor").Editor;
(function () {
this.updateSelectionMarkers = function () {
this
.renderer
.updateCursor(),
this
.renderer
.updateBackMarkers();
},
this.addSelectionMarker = function (e) {
e.cursor || (e.cursor = e.end);
var t = this.getSelectionStyle();
return e.marker = this
.session
.addMarker(e, "ace_selection", t),
this
.session
.$selectionMarkers
.push(e),
this.session.selectionMarkerCount = this.session.$selectionMarkers.length,
e;
},
this.removeSelectionMarker = function (e) {
if (!e.marker) {
return;
}
this
.session
.removeMarker(e.marker);
var t = this
.session
.$selectionMarkers
.indexOf(e);
t != -1 && this
.session
.$selectionMarkers
.splice(t, 1),
this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
},
this.removeSelectionMarkers = function (e) {
var t = this.session.$selectionMarkers;
for (var n = e.length; n -= 1;) {
var r = e[n];
if (!r.marker) {
continue;
}
this
.session
.removeMarker(r.marker);
var i = t.indexOf(r);
i != -1 && t.splice(i, 1);
}
this.session.selectionMarkerCount = t.length;
},
this.$onAddRange = function (e) {
this.addSelectionMarker(e.range),
this
.renderer
.updateCursor(),
this
.renderer
.updateBackMarkers();
},
this.$onRemoveRange = function (e) {
this.removeSelectionMarkers(e.ranges),
this
.renderer
.updateCursor(),
this
.renderer
.updateBackMarkers();
},
this.$onMultiSelect = function (e) {
if (this.inMultiSelectMode) {
return;
}
this.inMultiSelectMode = !0,
this.setStyle("ace_multiselect"),
this
.keyBinding
.addKeyboardHandler(f.keyboardHandler),
this
.commands
.setDefaultHandler("exec", this.$onMultiSelectExec),
this
.renderer
.updateCursor(),
this
.renderer
.updateBackMarkers();
},
this.$onSingleSelect = function (e) {
if (this.session.multiSelect.inVirtualMode) {
return;
}
this.inMultiSelectMode = !1,
this.unsetStyle("ace_multiselect"),
this
.keyBinding
.removeKeyboardHandler(f.keyboardHandler),
this
.commands
.removeDefaultHandler("exec", this.$onMultiSelectExec),
this
.renderer
.updateCursor(),
this
.renderer
.updateBackMarkers(),
this._emit("changeSelection");
},
this.$onMultiSelectExec = function (e) {
var t = e.command,
n = e.editor;
if (!n.multiSelect) {
return;
}
if (!t.multiSelectAction) {
var r = t.exec(n, e.args || {});
n
.multiSelect
.addRange(n.multiSelect.toOrientedRange()),
n
.multiSelect
.mergeOverlappingRanges();
} else {
t.multiSelectAction == "forEach"
? r = n.forEachSelection(t, e.args)
: t.multiSelectAction == "forEachLine"
? r = n.forEachSelection(t, e.args, !0)
: t.multiSelectAction == "single"
? (n.exitMultiSelectMode(), r = t.exec(n, e.args || {}))
: r = t.multiSelectAction(n, e.args || {});
}
return r;
},
this.forEachSelection = function (e, t, n) {
if (this.inVirtualSelectionMode) {
return;
}
var r = n && n.keepOrder,
i = n == 1 || n && n.$byLines,
o = this.session,
u = this.selection,
a = u.rangeList,
f = (r
? u
: a).ranges,
l;
if (!f.length) {
return e.exec
? e.exec(this, t || {})
: e(this, t || {});
}
var c = u._eventRegistry;
u._eventRegistry = {};
var h = new s(o);
this.inVirtualSelectionMode = !0;
for (var p = f.length; p -= 1;) {
if (i) {
while (p > 0 && f[p].start.row == f[p - 1].end.row) {
p -= 1;
}
}
h.fromOrientedRange(f[p]),
h.index = p,
this.selection = o.selection = h;
var d = e.exec
? e.exec(this, t || {})
: e(this, t || {});
!l && d !== undefined && (l = d),
h.toOrientedRange(f[p]);
}
h.detach(),
this.selection = o.selection = u,
this.inVirtualSelectionMode = !1,
u._eventRegistry = c,
u.mergeOverlappingRanges();
var v = this.renderer.$scrollAnimation;
return this.onCursorChange(),
this.onSelectionChange(),
v && v.from == v.to && this
.renderer
.animateScrolling(v.from),
l;
},
this.exitMultiSelectMode = function () {
if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {
return;
}
this
.multiSelect
.toSingleRange();
},
this.getSelectedText = function () {
var e = "";
if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
var t = this.multiSelect.rangeList.ranges,
n = [];
for (var r = 0; r < t.length; r += 1) {
n.push(this.session.getTextRange(t[r]));
}
var i = this
.session
.getDocument()
.getNewLineCharacter();
e = n.join(i),
e.length == (n.length - 1) * i.length && (e = "");
} else {
this
.selection
.isEmpty() || (e = this.session.getTextRange(this.getSelectionRange()));
}
return e;
},
this.$checkMultiselectChange = function (e, t) {
if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
var n = this
.multiSelect
.ranges[0];
if (this.multiSelect.isEmpty() && t == this.multiSelect.anchor) {
return;
}
var r = t == this.multiSelect.anchor
? n.cursor == n.start
? n.end
: n.start
: n.cursor;
(r.row != t.row || this.session.$clipPositionToDocument(r.row, r.column).column != t.column) && this
.multiSelect
.toSingleRange(this.multiSelect.toOrientedRange());
}
},
this.findAll = function (e, t, n) {
t = t || {},
t.needle = e || t.needle;
if (t.needle == undefined) {
var r = this
.selection
.isEmpty()
? this
.selection
.getWordRange()
: this
.selection
.getRange();
t.needle = this
.session
.getTextRange(r);
}
this
.$search
.set(t);
var i = this
.$search
.findAll(this.session);
if (!i.length) {
return 0;
}
this.$blockScrolling += 1;
var s = this.multiSelect;
n || s.toSingleRange(i[0]);
for (var o = i.length; o -= 1;) {
s.addRange(i[o], !0);
}
return r && s
.rangeList
.rangeAtPoint(r.start) && s.addRange(r, !0),
this.$blockScrolling -= 1,
i.length;
},
this.selectMoreLines = function (e, t) {
var n = this
.selection
.toOrientedRange(),
r = n.cursor == n.end,
s = this
.session
.documentToScreenPosition(n.cursor);
this.selection.$desiredColumn && (s.column = this.selection.$desiredColumn);
var o = this
.session
.screenToDocumentPosition(s.row + e, s.column);
if (!n.isEmpty()) {
var u = this
.session
.documentToScreenPosition(r
? n.end
: n.start),
a = this
.session
.screenToDocumentPosition(u.row + e, u.column);
} else {
var a = o;
}
if (r) {
var f = i.fromPoints(o, a);
f.cursor = f.start;
} else {
var f = i.fromPoints(a, o);
f.cursor = f.end;
}
f.desiredColumn = s.column;
if (!this.selection.inMultiSelectMode) {
this
.selection
.addRange(n);
} else if (t) {
var l = n.cursor;
}
this
.selection
.addRange(f),
l && this
.selection
.substractPoint(l);
},
this.transposeSelections = function (e) {
var t = this.session,
n = t.multiSelect,
r = n.ranges;
for (var i = r.length; i -= 1;) {
var s = r[i];
if (s.isEmpty()) {
var o = t.getWordRange(s.start.row, s.start.column);
s.start.row = o.start.row,
s.start.column = o.start.column,
s.end.row = o.end.row,
s.end.column = o.end.column;
}
}
n.mergeOverlappingRanges();
var u = [];
for (var i = r.length; i -= 1;) {
var s = r[i];
u.unshift(t.getTextRange(s));
}
e < 0
? u.unshift(u.pop())
: u.push(u.shift());
for (var i = r.length; i -= 1;) {
var s = r[i],
o = s.clone();
t.replace(s, u[i]),
s.start.row = o.start.row,
s.start.column = o.start.column;
}
},
this.selectMore = function (e, t, n) {
var r = this.session,
i = r.multiSelect,
s = i.toOrientedRange();
if (s.isEmpty()) {
s = r.getWordRange(s.start.row, s.start.column),
s.cursor = e == -1
? s.start
: s.end,
this
.multiSelect
.addRange(s);
if (n) {
return;
}
}
var o = r.getTextRange(s),
u = h(r, o, e);
u && (u.cursor = e == -1
? u.start
: u.end,
this.$blockScrolling += 1,
this.session.unfold(u),
this.multiSelect.addRange(u),
this.$blockScrolling -= 1,
this.renderer.scrollCursorIntoView(null, .5)),
t && this
.multiSelect
.substractPoint(s.cursor);
},
this.alignCursors = function () {
var e = this.session,
t = e.multiSelect,
n = t.ranges,
r = -1,
s = n.filter(function (e) {
if (e.cursor.row == r) {
return !0;
}
r = e.cursor.row;
});
if (!n.length || s.length == n.length - 1) {
var o = this
.selection
.getRange(),
u = o.start.row,
f = o.end.row,
l = u == f;
if (l) {
var c = this
.session
.getLength(),
h;
do {
h = this
.session
.getLine(f);
} while (/[=:]/.test(h) && ++f < c);
do {
h = this
.session
.getLine(u);
} while (/[=:]/.test(h) && --u > 0);
u < 0 && (u = 0),
f >= c && (f = c - 1);
}
var p = this
.session
.removeFullLines(u, f);
p = this.$reAlignText(p, l),
this
.session
.insert({
column: 0,
row : u
}, p.join("\n") + "\n"),
l || (o.start.column = 0, o.end.column = p[p.length - 1].length),
this
.selection
.setRange(o);
} else {
s.forEach(function (e) {
t.substractPoint(e.cursor);
});
var d = 0,
v = Infinity,
m = n.map(function (t) {
var n = t.cursor,
r = e.getLine(n.row),
i = r
.substr(n.column)
.search(/\S/g);
return i == -1 && (i = 0),
n.column > d && (d = n.column),
i < v && (v = i),
i;
});
n.forEach(function (t, n) {
var r = t.cursor,
s = d - r.column,
o = m[n] - v;
s > o
? e.insert(r, a.stringRepeat(" ", s - o))
: e.remove(new i(r.row, r.column, r.row, r.column - s + o)),
t.start.column = t.end.column = d,
t.start.row = t.end.row = r.row,
t.cursor = t.end;
}),
t.fromOrientedRange(n[0]),
this
.renderer
.updateCursor(),
this
.renderer
.updateBackMarkers();
}
},
this.$reAlignText = function (e, t) {
function u(e) {
return a.stringRepeat(" ", e);
}
function f(e) {
return e[2]
? u(i) + e[2] + u(s - e[2].length + o) + e[4].replace(/^([=:])\s+/, "$1 ")
: e[0];
}
function l(e) {
return e[2]
? u(i + s - e[2].length) + e[2] + u(o, " ") + e[4].replace(/^([=:])\s+/, "$1 ")
: e[0];
}
function c(e) {
return e[2]
? u(i) + e[2] + u(o) + e[4].replace(/^([=:])\s+/, "$1 ")
: e[0];
}
var n = !0,
r = !0,
i,
s,
o;
return e
.map(function (e) {
var t = e.match(/(\s*)(.*?)(\s*)([=:].*)/);
return t
? i == null
? (i = t[1].length, s = t[2].length, o = t[3].length, t)
: (i + s + o != t[1].length + t[2].length + t[3].length && (r = !1), i != t[1].length && (n = !1), i > t[1].length && (i = t[1].length), s < t[2].length && (s = t[2].length), o > t[3].length && (o = t[3].length), t)
: [e];
})
.map(t
? f
: n
? r
? l
: f
: c);
};
}).call(d.prototype),
t.onSessionChange = function (e) {
var t = e.session;
t && !t.multiSelect && (t.$selectionMarkers = [], t.selection.$initRangeList(), t.multiSelect = t.selection),
this.multiSelect = t && t.multiSelect;
var n = e.oldSession;
n && (n.multiSelect.off("addRange", this.$onAddRange), n.multiSelect.off("removeRange", this.$onRemoveRange), n.multiSelect.off("multiSelect", this.$onMultiSelect), n.multiSelect.off("singleSelect", this.$onSingleSelect), n.multiSelect.lead.off("change", this.$checkMultiselectChange), n.multiSelect.anchor.off("change", this.$checkMultiselectChange)),
t && (t.multiSelect.on("addRange", this.$onAddRange), t.multiSelect.on("removeRange", this.$onRemoveRange), t.multiSelect.on("multiSelect", this.$onMultiSelect), t.multiSelect.on("singleSelect", this.$onSingleSelect), t.multiSelect.lead.on("change", this.$checkMultiselectChange), t.multiSelect.anchor.on("change", this.$checkMultiselectChange)),
t && this.inMultiSelectMode != t.selection.inMultiSelectMode && (t.selection.inMultiSelectMode
? this.$onMultiSelect()
: this.$onSingleSelect());
},
t.MultiSelect = m,
e("./config").defineOptions(d.prototype, "editor", {
enableBlockSelect: {
set : function (e) {
this.$blockSelectEnabled = e;
},
value: !0
},
enableMultiselect: {
set : function (e) {
m(this),
e
? (this.on("changeSession", this.$multiselectOnSessionChange), this.on("mousedown", o))
: (this.off("changeSession", this.$multiselectOnSessionChange), this.off("mousedown", o));
},
value: !0
}
});
}),
define("ace/mode/folding/fold_mode", [
"require", "exports", "module", "ace/range"
], function (e, t, n) {
"use strict";
var r = e("../../range").Range,
i = t.FoldMode = function () {};
(function () {
this.foldingStartMarker = null,
this.foldingStopMarker = null,
this.getFoldWidget = function (e, t, n) {
var r = e.getLine(n);
return this
.foldingStartMarker
.test(r)
? "start"
: t == "markbeginend" && this.foldingStopMarker && this
.foldingStopMarker
.test(r)
? "end"
: "";
},
this.getFoldWidgetRange = function (e, t, n) {
return null;
},
this.indentationBlock = function (e, t, n) {
var i = /\S/,
s = e.getLine(t),
o = s.search(i);
if (o == -1) {
return;
}
var u = n || s.length,
a = e.getLength(),
f = t,
l = t;
while (++t < a) {
var c = e
.getLine(t)
.search(i);
if (c == -1) {
continue;
}
if (c <= o) {
break;
}
l = t;
}
if (l > f) {
var h = e
.getLine(l)
.length;
return new r(f, u, l, h);
}
},
this.openingBracketBlock = function (e, t, n, i, s) {
var o = {
column: i + 1,
row : n
},
u = e.$findClosingBracket(t, o, s);
if (!u) {
return;
}
var a = e.foldWidgets[u.row];
return a == null && (a = e.getFoldWidget(u.row)),
a == "start" && u.row > o.row && (u.row--, u.column = e.getLine(u.row).length),
r.fromPoints(o, u);
},
this.closingBracketBlock = function (e, t, n, i, s) {
var o = {
column: i,
row : n
},
u = e.$findOpeningBracket(t, o);
if (!u) {
return;
}
return u.column++,
o.column--,
r.fromPoints(u, o);
};
}).call(i.prototype);
}),
define("ace/theme/textmate", [
"require", "exports", "module", "ace/lib/dom"
], function (e, t, n) {
"use strict";
t.isDark = !1,
t.cssClass = "ace-tm",
t.cssText = ".ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margi" +
"n {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E" +
"6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color" +
": black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_stora" +
"ge,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6" +
", 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ac" +
"e_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_li" +
"brary {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(25" +
"5, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76" +
", 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ac" +
"e_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}" +
".ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_str" +
"ing {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.a" +
"ce-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_" +
"doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {col" +
"or: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm ." +
"ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_functio" +
"n {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_" +
"list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142)" +
";}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-lay" +
"er .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ac" +
"e_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-laye" +
"r .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stac" +
"k {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {mar" +
"gin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-l" +
"ayer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-ac" +
"tive-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected" +
"-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.a" +
"ce-tm .ace_indent-guide {background: url('data:image/png;base64,iVBORw0KGgoAAA" +
"ANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJ" +
"RU5ErkJggg==') right repeat-y;}";
var r = e("../lib/dom");
r.importCssString(t.cssText, t.cssClass);
}),
define("ace/line_widgets", [
"require",
"exports",
"module",
"ace/lib/oop",
"ace/lib/dom",
"ace/range"
], function (e, t, n) {
"use strict";
function o(e) {
this.session = e,
this.session.widgetManager = this,
this.session.getRowLength = this.getRowLength,
this.session.$getWidgetScreenLength = this.$getWidgetScreenLength,
this.updateOnChange = this
.updateOnChange
.bind(this),
this.renderWidgets = this
.renderWidgets
.bind(this),
this.measureWidgets = this
.measureWidgets
.bind(this),
this.session._changedWidgets = [],
this.$onChangeEditor = this
.$onChangeEditor
.bind(this),
this
.session
.on("change", this.updateOnChange),
this
.session
.on("changeEditor", this.$onChangeEditor);
}
var r = e("./lib/oop"),
i = e("./lib/dom"),
s = e("./range").Range;
(function () {
this.getRowLength = function (e) {
var t;
return this.lineWidgets
? t = this.lineWidgets[e] && this
.lineWidgets[e]
.rowCount || 0
: t = 0,
!this.$useWrapMode || !this.$wrapData[e]
? 1 + t
: this
.$wrapData[e]
.length + 1 + t;
},
this.$getWidgetScreenLength = function () {
var e = 0;
return this
.lineWidgets
.forEach(function (t) {
t && t.rowCount && (e += t.rowCount);
}),
e;
},
this.$onChangeEditor = function (e) {
this.attach(e.editor);
},
this.attach = function (e) {
e && e.widgetManager && e.widgetManager != this && e
.widgetManager
.detach();
if (this.editor == e) {
return;
}
this.detach(),
this.editor = e,
e && (e.widgetManager = this, e.renderer.on("beforeRender", this.measureWidgets), e.renderer.on("afterRender", this.renderWidgets));
},
this.detach = function (e) {
var t = this.editor;
if (!t) {
return;
}
this.editor = null,
t.widgetManager = null,
t
.renderer
.off("beforeRender", this.measureWidgets),
t
.renderer
.off("afterRender", this.renderWidgets);
var n = this.session.lineWidgets;
n && n.forEach(function (e) {
e && e.el && e.el.parentNode && (e._inDocument = !1, e.el.parentNode.removeChild(e.el));
});
},
this.updateOnChange = function (e) {
var t = this.session.lineWidgets;
if (!t) {
return;
}
var n = e.start.row,
r = e.end.row - n;
if (r !== 0) {
if (e.action == "remove") {
var i = t.splice(n + 1, r);
i.forEach(function (e) {
e && this.removeLineWidget(e);
}, this),
this.$updateRows();
}
} else {
var s = [r];
s.unshift(n, 0),
t
.splice
.apply(t, s),
this.$updateRows();
}
},
this.$updateRows = function () {
var e = this.session.lineWidgets;
if (!e) {
return;
}
var t = !0;
e.forEach(function (e, n) {
e && (t = !1, e.row = n);
}),
t && (this.session.lineWidgets = null);
},
this.addLineWidget = function (e) {
this.session.lineWidgets || (this.session.lineWidgets = [
this
.session
.getLength()
]),
this
.session
.lineWidgets[e.row] = e;
var t = this.editor.renderer;
return e.html && !e.el && (e.el = i.createElement("div"), e.el.innerHTML = e.html),
e.el && (i.addCssClass(e.el, "ace_lineWidgetContainer"), e.el.style.position = "absolute", e.el.style.zIndex = 5, t.container.appendChild(e.el), e._inDocument = !0),
e.coverGutter || (e.el.style.zIndex = 3),
e.pixelHeight || (e.pixelHeight = e.el.offsetHeight),
e.rowCount == null && (e.rowCount = e.pixelHeight / t.layerConfig.lineHeight),
this
.session
._emit("changeFold", {
data: {
start: {
row: e.row
}
}
}),
this.$updateRows(),
this.renderWidgets(null, t),
e;
},
this.removeLineWidget = function (e) {
e._inDocument = !1,
e.el && e.el.parentNode && e
.el
.parentNode
.removeChild(e.el);
if (e.editor && e.editor.destroy) {
try {
e
.editor
.destroy();
} catch (t) {}
}
this.session.lineWidgets && (this.session.lineWidgets[e.row] = undefined),
this
.session
._emit("changeFold", {
data: {
start: {
row: e.row
}
}
}),
this.$updateRows();
},
this.onWidgetChanged = function (e) {
this
.session
._changedWidgets
.push(e),
this.editor && this
.editor
.renderer
.updateFull();
},
this.measureWidgets = function (e, t) {
var n = this.session._changedWidgets,
r = t.layerConfig;
if (!n || !n.length) {
return;
}
var i = Infinity;
for (var s = 0; s < n.length; s += 1) {
var o = n[s];
o._inDocument || (o._inDocument = !0, t.container.appendChild(o.el)),
o.h = o.el.offsetHeight,
o.fixedWidth || (o.w = o.el.offsetWidth, o.screenWidth = Math.ceil(o.w / r.characterWidth));
var u = o.h / r.lineHeight;
o.coverLine && (u -= this.session.getRowLineCount(o.row), u < 0 && (u = 0)),
o.rowCount != u && (o.rowCount = u, o.row < i && (i = o.row));
}
i != Infinity && (this.session._emit("changeFold", {
data: {
start: {
row: i
}
}
}), this.session.lineWidgetWidth = null),
this.session._changedWidgets = [];
},
this.renderWidgets = function (e, t) {
var n = t.layerConfig,
r = this.session.lineWidgets;
if (!r) {
return;
}
var i = Math.min(this.firstRow, n.firstRow),
s = Math.max(this.lastRow, n.lastRow, r.length);
while (i > 0 && !r[i]) {
i -= 1;
}
this.firstRow = n.firstRow,
this.lastRow = n.lastRow,
t.$cursorLayer.config = n;
for (var o = i; o <= s; o += 1) {
var u = r[o];
if (!u || !u.el) {
continue;
}
u._inDocument || (u._inDocument = !0, t.container.appendChild(u.el));
var a = t
.$cursorLayer
.getPixelPosition({
column: 0,
row : o
}, !0)
.top;
u.coverLine || (a += n.lineHeight * this.session.getRowLineCount(u.row)),
u.el.style.top = a - n.offset + "px";
var f = u.coverGutter
? 0
: t.gutterWidth;
u.fixedWidth || (f -= t.scrollLeft),
u.el.style.left = f + "px",
u.fixedWidth
? u.el.style.right = t
.scrollBar
.getWidth() + "px"
: u.el.style.right = "";
}
};
}).call(o.prototype),
t.LineWidgets = o;
}),
define("ace/ext/error_marker", [
"require",
"exports",
"module",
"ace/line_widgets",
"ace/lib/dom",
"ace/range"
], function (e, t, n) {
"use strict";
function o(e, t, n) {
var r = 0,
i = e.length - 1;
while (r <= i) {
var s = r + i >> 1,
o = n(t, e[s]);
if (o > 0) {
r = s + 1;
} else {
if (!(o < 0)) {
return s;
}
i = s - 1;
}
}
return -(r + 1);
}
function u(e, t, n) {
var r = e
.getAnnotations()
.sort(s.comparePoints);
if (!r.length) {
return;
}
var i = o(r, {
column: -1,
row : t
}, s.comparePoints);
i < 0 && (i = -i - 1),
i >= r.length
? i = n > 0
? 0
: r.length - 1
: i === 0 && n < 0 && (i = r.length - 1);
var u = r[i];
if (!u || !n) {
return;
}
if (u.row === t) {
do {
u = r[i += n];
} while (u && u.row === t);
if (!u) {
return r.slice();
}
}
var a = [];
t = u.row;
do {
a[
n < 0
? "unshift"
: "push"
](u),
u = r[i += n];
} while (u && u.row == t);
return a.length && a;
}
var r = e("../line_widgets").LineWidgets,
i = e("../lib/dom"),
s = e("../range").Range;
t.showErrorMarker = function (e, t) {
var n = e.session;
n.widgetManager || (n.widgetManager = new r(n), n.widgetManager.attach(e));
var s = e.getCursorPosition(),
o = s.row,
a = n.lineWidgets && n.lineWidgets[o];
a
? a.destroy()
: o -= t;
var f = u(n, o, t),
l;
if (f) {
var c = f[0];
s.column = (c.pos && typeof c.column != "number"
? c.pos.sc
: c.column) || 0,
s.row = c.row,
l = e
.renderer
.$gutterLayer
.$annotations[s.row];
} else {
if (a) {
return;
}
l = {
className: "ace_ok",
text : ["Looks good!"]
};
}
e
.session
.unfold(s.row),
e
.selection
.moveToPosition(s);
var h = {
coverGutter: !0,
el : i.createElement("div"),
fixedWidth : !0,
row : s.row
},
p = h
.el
.appendChild(i.createElement("div")),
d = h
.el
.appendChild(i.createElement("div"));
d.className = "error_widget_arrow " + l.className;
var v = e
.renderer
.$cursorLayer
.getPixelPosition(s)
.left;
d.style.left = v + e.renderer.gutterWidth - 5 + "px",
h.el.className = "error_widget_wrapper",
p.className = "error_widget " + l.className,
p.innerHTML = l
.text
.join("
"),
p.appendChild(i.createElement("div"));
var m = function (e, t, n) {
if (t === 0 && (n === "esc" || n === "return")) {
return h.destroy(), {
command: "null"
}
}
};
h.destroy = function () {
if (e.$mouseHandler.isMousePressed) {
return;
}
e
.keyBinding
.removeKeyboardHandler(m),
n
.widgetManager
.removeLineWidget(h),
e.off("changeSelection", h.destroy),
e.off("changeSession", h.destroy),
e.off("mouseup", h.destroy),
e.off("change", h.destroy);
},
e
.keyBinding
.addKeyboardHandler(m),
e.on("changeSelection", h.destroy),
e.on("changeSession", h.destroy),
e.on("mouseup", h.destroy),
e.on("change", h.destroy),
e
.session
.widgetManager
.addLineWidget(h),
h.el.onmousedown = e
.focus
.bind(e),
e
.renderer
.scrollCursorIntoView(null, .5, {bottom: h.el.offsetHeight});
},
i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit;" +
" border:none } .error_widget { border-top: solid 2px; " +
" border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; " +
" white-space: pre-wrap; } .error_widget.ace_error, .error_widget_a" +
"rrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning" +
", .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error" +
"_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a " +
" } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: " +
"#5aaa5a } .error_widget_arrow { position: absolute; border" +
": solid 5px; border-top-color: transparent!important; border-rig" +
"ht-color: transparent!important; border-left-color: transparent!importa" +
"nt; top: -5px; }",
"");
}),
define("ace/ace", [
"require",
"exports",
"module",
"ace/lib/fixoldbrowsers",
"ace/lib/dom",
"ace/lib/event",
"ace/editor",
"ace/edit_session",
"ace/undomanager",
"ace/virtual_renderer",
"ace/worker/worker_client",
"ace/keyboard/hash_handler",
"ace/placeholder",
"ace/multi_select",
"ace/mode/folding/fold_mode",
"ace/theme/textmate",
"ace/ext/error_marker",
"ace/config"
], function (e, t, n) {
"use strict";
e("./lib/fixoldbrowsers");
var r = e("./lib/dom"),
i = e("./lib/event"),
s = e("./editor").Editor,
o = e("./edit_session").EditSession,
u = e("./undomanager").UndoManager,
a = e("./virtual_renderer").VirtualRenderer;
e("./worker/worker_client"),
e("./keyboard/hash_handler"),
e("./placeholder"),
e("./multi_select"),
e("./mode/folding/fold_mode"),
e("./theme/textmate"),
e("./ext/error_marker"),
t.config = e("./config"),
t.require = e,
t.edit = function (e) {
if (typeof e == "string") {
var n = e;
e = document.getElementById(n);
if (!e) {
throw new Error("ace.edit can't find div #" + n);
}
}
if (e && e.env && e.env.editor instanceof s) {
return e.env.editor;
}
var o = "";
if (e && /input|textarea/i.test(e.tagName)) {
var u = e;
o = u.value,
e = r.createElement("pre"),
u
.parentNode
.replaceChild(e, u);
} else {
e && (o = r.getInnerText(e), e.innerHTML = "");
}
var f = t.createEditSession(o),
l = new s(new a(e));
l.setSession(f);
var c = {
document: f,
editor : l,
onResize: l
.resize
.bind(l, null)
};
return u && (c.textarea = u),
i.addListener(window, "resize", c.onResize),
l.on("destroy", function () {
i.removeListener(window, "resize", c.onResize),
c.editor.container.env = null;
}),
l.container.env = l.env = c,
l;
},
t.createEditSession = function (e, t) {
var n = new o(e, t);
return n.setUndoManager(new u),
n;
},
t.EditSession = o,
t.UndoManager = u;
});
(function () {
window.require(["ace/ace"], function (a) {
a && a
.config
.init(true);
if (!window.ace) {
window.ace = a;
}
for (var key in a) {
if (a.hasOwnProperty(key)) {
window.ace[key] = a[key];
}
}
});
})();