var CodeMirror = (function () { function q(aD, aA) { var bN = {}, a9 = q.defaults; for (var ap in a9) { if (a9.hasOwnProperty(ap)) { bN[ap] = (aA && aA.hasOwnProperty(ap) ? aA : a9)[ap] } } var cy = bN.document; var au = cy.createElement("div"); au.className = "CodeMirror" + (bN.lineWrapping ? " CodeMirror-wrap" : ""); au.innerHTML = '
" + c1.getHTML(bj) + ""; if (c1.className) { c2 = '
' + c2 + "
' : ""), cY); for (var cX = 1; cX < cW.height; ++cX) { cP.push("") } ++cO }); ay.style.display = "none"; aQ.innerHTML = cP.join(""); var cT = String(ck.size).length, cR = aQ.firstChild, cS = B(cR), cQ = ""; while (cS.length + cQ.length < cT) { cQ += "\u00a0" } if (cQ) { cR.insertBefore(cy.createTextNode(cQ), cR.firstChild) } ay.style.display = ""; bk.style.marginLeft = ay.offsetWidth + "px"; aJ = false } function cJ() { var cQ = W(cK.from, cK.to); var cZ = cE(cK.from, true); var cV = cQ ? cZ : cE(cK.to, true); var cT = cK.inverted ? cZ : cV, cO = bC(); var cN = ac(au), cP = ac(ah); bK.style.top = Math.max(0, Math.min(ba.offsetHeight, cT.y + cP.top - cN.top)) + "px"; bK.style.left = Math.max(0, Math.min(ba.offsetWidth, cT.x + cP.left - cN.left)) + "px"; if (cQ) { a3.style.top = cT.y + "px"; a3.style.left = (bN.lineWrapping ? Math.min(cT.x, bk.offsetWidth) : cT.x) + "px"; a3.style.display = ""; a7.style.display = "none" } else { var cX = cZ.y == cV.y, cS = ""; function cY(c3, c2, c1, c0) { cS += '' } if (cK.from.ch && cZ.y >= 0) { var cW = cX ? bk.clientWidth - cV.x : 0; cY(cZ.x, cZ.y, cW, cO) } var cR = Math.max(0, cZ.y + (cK.from.ch ? cO : 0)); var cU = Math.min(cV.y, bk.clientHeight) - cR; if (cU > 0.2 * cO) { cY(0, cR, 0, cU) } if ((!cX || !cK.from.ch) && cV.y < bk.clientHeight - 0.5 * cO) { cY(0, cV.y, bk.clientWidth - cV.x, cO) } a7.innerHTML = cS; a3.style.display = "none"; a7.style.display = "" } } function aW(cN) { if (cN) { b4 = b4 || (cK.inverted ? cK.to : cK.from) } else { b4 = null } } function bn(cP, cO) { var cN = b4 && aK(b4); if (cN) { if (T(cN, cP)) { cP = cN } else { if (T(cO, cN)) { cO = cN } } } bm(cP, cO); bS = true } function bm(cR, cQ, cN, cP) { ch = null; if (cN == null) { cN = cK.from.line; cP = cK.to.line } if (W(cK.from, cR) && W(cK.to, cQ)) { return } if (T(cQ, cR)) { var cO = cQ; cQ = cR; cR = cO } if (cR.line != cN) { cR = bE(cR, cN, cK.from.ch) } if (cQ.line != cP) { cQ = bE(cQ, cP, cK.to.ch) } if (W(cR, cQ)) { cK.inverted = false } else { if (W(cR, cK.to)) { cK.inverted = false } else { if (W(cQ, cK.from)) { cK.inverted = true } } } cK.from = cR; cK.to = cQ; aG = true } function bE(cR, cO, cP) { function cQ(cU) { var cW = cR.line + cU, cT = cU == 1 ? ck.size : -1; while (cW != cT) { var cS = cr(cW); if (!cS.hidden) { var cV = cR.ch; if (cV > cP || cV > cS.text.length) { cV = cS.text.length } return{line: cW, ch: cV} } cW += cU } } var cN = cr(cR.line); if (!cN.hidden) { return cR } if (cR.line >= cO) { return cQ(1) || cQ(-1) } else { return cQ(-1) || cQ(1) } } function aY(cN, cP, cO) { var cQ = aK({line: cN, ch: cP || 0}); (cO ? bn : bm)(cQ, cQ) } function bL(cN) { return Math.max(0, Math.min(cN, ck.size - 1)) } function aK(cP) { if (cP.line < 0) { return{line: 0, ch: 0} } if (cP.line >= ck.size) { return{line: ck.size - 1, ch: cr(ck.size - 1).text.length} } var cN = cP.ch, cO = cr(cP.line).text.length; if (cN == null || cN > cO) { return{line: cP.line, ch: cO} } else { if (cN < 0) { return{line: cP.line, ch: 0} } else { return cP } } } function ca(cQ, cU) { var cR = cK.inverted ? cK.from : cK.to, cV = cR.line, cN = cR.ch; var cT = cr(cV); function cO() { for (var cW = cV + cQ, cY = cQ < 0 ? -1 : ck.size; cW != cY; cW += cQ) { var cX = cr(cW); if (!cX.hidden) { cV = cW; cT = cX; return true } } } function cS(cW) { if (cN == (cQ < 0 ? 0 : cT.text.length)) { if (!cW && cO()) { cN = cQ < 0 ? cT.text.length : 0 } else { return false } } else { cN += cQ } return true } if (cU == "char") { cS() } else { if (cU == "column") { cS(true) } else { if (cU == "word") { var cP = false; for (; ;) { if (cQ < 0) { if (!cS()) { break } } if (Y(cT.text.charAt(cN))) { cP = true } else { if (cP) { if (cQ < 0) { cQ = 1; cS() } break } } if (cQ > 0) { if (!cS()) { break } } } } } } return{line: cV, ch: cN} } function cq(cN, cO) { var cP = cN < 0 ? cK.from : cK.to; if (b4 || W(cK.from, cK.to)) { cP = ca(cN, cO) } aY(cP.line, cP.ch, true) } function b8(cN, cO) { if (!W(cK.from, cK.to)) { bD("", cK.from, cK.to) } else { if (cN < 0) { bD("", ca(cN, cO), cK.to) } else { bD("", cK.from, ca(cN, cO)) } } bS = true } var ch = null; function cj(cN, cO) { var cQ = 0, cR = cE(cK.inverted ? cK.from : cK.to, true); if (ch != null) { cR.x = ch } if (cO == "page") { cQ = Math.min(ba.clientHeight, window.innerHeight || document.documentElement.clientHeight) } else { if (cO == "line") { cQ = bC() } } var cP = bv(cR.x, cR.y + cQ * cN + 2); aY(cP.line, cP.ch, true); ch = cR.x } function bw(cQ) { var cO = cr(cQ.line).text; var cP = cQ.ch, cN = cQ.ch; while (cP > 0 && Y(cO.charAt(cP - 1))) { --cP } while (cN < cO.length && Y(cO.charAt(cN))) { ++cN } bn({line: cQ.line, ch: cP}, {line: cQ.line, ch: cN}) } function aB(cN) { bn({line: cN, ch: 0}, {line: cN, ch: cr(cN).text.length}) } function cn(cP) { if (W(cK.from, cK.to)) { return bo(cK.from.line, cP) } var cO = cK.to.line - (cK.to.ch ? 0 : 1); for (var cN = cK.from.line; cN <= cO; ++cN) { bo(cN, cP) } } function bo(cP, cW) { if (!cW) { cW = "add" } if (cW == "smart") { if (!bX.indent) { cW = "prev" } else { var cN = cg(cP) } } var cX = cr(cP), cR = cX.indentation(bN.tabSize), cO = cX.text.match(/^\s*/)[0], cT; if (cW == "prev") { if (cP) { cT = cr(cP - 1).indentation(bN.tabSize) } else { cT = 0 } } else { if (cW == "smart") { cT = bX.indent(cN, cX.text.slice(cO.length), cX.text) } else { if (cW == "add") { cT = cR + bN.indentUnit } else { if (cW == "subtract") { cT = cR - bN.indentUnit } } } } cT = Math.max(0, cT); var cV = cT - cR; if (!cV) { if (cK.from.line != cP && cK.to.line != cP) { return } var cU = cO } else { var cU = "", cS = 0; if (bN.indentWithTabs) { for (var cQ = Math.floor(cT / bN.tabSize); cQ; --cQ) { cS += bN.tabSize; cU += "\t" } } while (cS < cT) { ++cS; cU += " " } } bD(cU, {line: cP, ch: 0}, {line: cP, ch: cO.length}) } function bG() { bX = q.getMode(bN, bN.mode); ck.iter(0, ck.size, function (cN) { cN.stateAfter = null }); b3 = [0]; bu() } function a5() { var cN = bN.gutter || bN.lineNumbers; ay.style.display = cN ? "" : "none"; if (cN) { aJ = true } else { ah.parentNode.style.marginLeft = 0 } } function cs(cP, cO) { if (bN.lineWrapping) { au.className += " CodeMirror-wrap"; var cN = ba.clientWidth / a8() - 3; ck.iter(0, ck.size, function (cQ) { if (cQ.hidden) { return } var cR = Math.ceil(cQ.text.length / cN) || 1; if (cR != 1) { aV(cQ, cR) } }); bk.style.width = bA.style.width = "" } else { au.className = au.className.replace(" CodeMirror-wrap", ""); aw = null; br = ""; ck.iter(0, ck.size, function (cQ) { if (cQ.height != 1 && !cQ.hidden) { aV(cQ, 1) } if (cQ.text.length > br.length) { br = cQ.text } }) } ar.push({from: 0, to: ck.size}) } function aN() { for (var cO = '', cN = 0; cN < bN.tabSize; ++cN) { cO += " " } return cO + "" } function cI() { bj = aN(); bZ(true) } function cp() { ba.className = ba.className.replace(/\s*cm-s-\w+/g, "") + bN.theme.replace(/(^|\s)\s*/g, " cm-s-") } function cL() { this.set = [] } cL.prototype.clear = ai(function () { var cS = Infinity, cO = -Infinity; for (var cR = 0, cU = this.set.length; cR < cU; ++cR) { var cP = this.set[cR], cN = cP.marked; if (!cN || !cP.parent) { continue } var cT = S(cP); cS = Math.min(cS, cT); cO = Math.max(cO, cT); for (var cQ = 0; cQ < cN.length; ++cQ) { if (cN[cQ].set == this.set) { cN.splice(cQ--, 1) } } } if (cS != Infinity) { ar.push({from: cS, to: cO + 1}) } }); cL.prototype.find = function () { var cS, cT; for (var cP = 0, cR = this.set.length; cP < cR; ++cP) { var cV = this.set[cP], cQ = cV.marked; for (var cO = 0; cO < cQ.length; ++cO) { var cN = cQ[cO]; if (cN.set == this.set) { if (cN.from != null || cN.to != null) { var cU = S(cV); if (cU != null) { if (cN.from != null) { cS = {line: cU, ch: cN.from} } if (cN.to != null) { cT = {line: cU, ch: cN.to} } } } } } } return{from: cS, to: cT} }; function bs(cT, cS, cP) { cT = aK(cT); cS = aK(cS); var cN = new cL(); function cR(cU, cX, cW, cV) { cr(cU).addMark(new E(cX, cW, cV, cN.set)) } if (cT.line == cS.line) { cR(cT.line, cT.ch, cS.ch, cP) } else { cR(cT.line, cT.ch, null, cP); for (var cO = cT.line + 1, cQ = cS.line; cO < cQ; ++cO) { cR(cO, null, null, cP) } cR(cS.line, null, cS.ch, cP) } ar.push({from: cT.line, to: cS.line + 1}); return cN } function aL(cO) { cO = aK(cO); var cN = new A(cO.ch); cr(cO.line).addMark(cN); return cN } function bI(cN, cP, cO) { if (typeof cN == "number") { cN = cr(bL(cN)) } cN.gutterMarker = {text: cP, style: cO}; aJ = true; return cN } function ak(cN) { if (typeof cN == "number") { cN = cr(bL(cN)) } cN.gutterMarker = null; aJ = true } function aP(cO, cQ) { var cP = cO, cN = cO; if (typeof cO == "number") { cN = cr(bL(cO)) } else { cP = S(cO) } if (cP == null) { return null } if (cQ(cN, cP)) { ar.push({from: cP, to: cP + 1}) } else { return null } return cN } function bb(cO, cN) { return aP(cO, function (cP) { if (cP.className != cN) { cP.className = cN; return true } }) } function cw(cO, cN) { return aP(cO, function (cP, cS) { if (cP.hidden != cN) { cP.hidden = cN; aV(cP, cN ? 0 : 1); var cR = cK.from.line, cQ = cK.to.line; if (cN && (cR == cS || cQ == cS)) { var cU = cR == cS ? bE({line: cR, ch: 0}, cR, 0) : cK.from; var cT = cQ == cS ? bE({line: cQ, ch: 0}, cQ, 0) : cK.to; bm(cU, cT) } return(aJ = true) } }) } function aM(cO) { if (typeof cO == "number") { if (!bg(cO)) { return null } var cP = cO; cO = cr(cO); if (!cO) { return null } } else { var cP = S(cO); if (cP == null) { return null } } var cN = cO.gutterMarker; return{line: cP, handle: cO, text: cO.text, markerText: cN && cN.text, markerClass: cN && cN.style, lineClass: cO.className} } function cf(cN) { al.innerHTML = "
") } cP.push("x"; al.firstChild.firstChild.firstChild.nodeValue = cN; return al.firstChild.firstChild.offsetWidth || 10 } function ax(cZ, cT) { if (cT <= 0) { return 0 } var cQ = cr(cZ), cW = cQ.text; function cX(c0) { al.innerHTML = "" + cQ.getHTML(bj, c0) + ""; return al.firstChild.firstChild.offsetWidth } var cU = 0, cS = 0, cV = cW.length, cR; var cO = Math.min(cV, Math.ceil(cT / a8())); for (; ;) { var cP = cX(cO); if (cP <= cT && cO < cV) { cO = Math.min(cV, Math.ceil(cO * 1.2)) } else { cR = cP; cV = cO; break } } if (cT > cR) { return cV } cO = Math.floor(cV * 0.8); cP = cX(cO); if (cP < cT) { cU = cO; cS = cP } for (; ;) { if (cV - cU <= 1) { return(cR - cT > cT - cS) ? cU : cV } var cY = Math.ceil((cU + cV) / 2), cN = cX(cY); if (cN > cT) { cV = cY; cR = cN } else { cU = cY; cS = cN } } } var cl = Math.floor(Math.random() * 16777215).toString(16); function bR(cP, cS) { if (cS == 0) { return{top: 0, left: 0} } var cN = ""; if (bN.lineWrapping) { var cO = cP.text.indexOf(" ", cS + 2); cN = J(cP.text.slice(cS + 1, cO < 0 ? cP.text.length : cO + (C ? 5 : 0))) } al.innerHTML = "" + cP.getHTML(bj, cS) + '' + J(cP.text.charAt(cS) || " ") + "" + cN + ""; var cR = document.getElementById("CodeMirror-temp-" + cl); var cU = cR.offsetTop, cT = cR.offsetLeft; if (C && cU == 0 && cT == 0) { var cQ = document.createElement("span"); cQ.innerHTML = "x"; cR.parentNode.insertBefore(cQ, cR.nextSibling); cU = cQ.offsetTop } return{top: cU, left: cT} } function cE(cS, cQ) { var cN, cO = bC(), cR = cO * (f(ck, cS.line) - (cQ ? a4 : 0)); if (cS.ch == 0) { cN = 0 } else { var cP = bR(cr(cS.line), cS.ch); cN = cP.left; if (bN.lineWrapping) { cR += Math.max(0, cP.top) } } return{x: cN, y: cR, yBot: cR + cO} } function bv(cW, cV) { if (cV < 0) { cV = 0 } var cT = bC(), cR = a8(), c2 = a4 + Math.floor(cV / cT); var cX = R(ck, c2); if (cX >= ck.size) { return{line: ck.size - 1, ch: cr(ck.size - 1).text.length} } var cO = cr(cX), cZ = cO.text; var c4 = bN.lineWrapping, cU = c4 ? c2 - f(ck, cX) : 0; if (cW <= 0 && cU == 0) { return{line: cX, ch: 0} } function c3(c6) { var c7 = bR(cO, c6); if (c4) { var c8 = Math.round(c7.top / cT); return Math.max(0, c7.left + (c8 - cU) * ba.clientWidth) } return c7.left } var c1 = 0, c0 = 0, cP = cZ.length, cN; var cY = Math.min(cP, Math.ceil((cW + cU * ba.clientWidth * 0.9) / cR)); for (; ;) { var cS = c3(cY); if (cS <= cW && cY < cP) { cY = Math.min(cP, Math.ceil(cY * 1.2)) } else { cN = cS; cP = cY; break } } if (cW > cN) { return{line: cX, ch: cP} } cY = Math.floor(cP * 0.8); cS = c3(cY); if (cS < cW) { c1 = cY; c0 = cS } for (; ;) { if (cP - c1 <= 1) { return{line: cX, ch: (cN - cW > cW - c0) ? c1 : cP} } var c5 = Math.ceil((c1 + cP) / 2), cQ = c3(c5); if (cQ > cW) { cP = c5; cN = cQ } else { c1 = c5; c0 = cQ } } } function ag(cP) { var cN = cE(cP, true), cO = ac(bk); return{x: cO.left + cN.x, y: cO.top + cN.y, yBot: cO.top + cN.yBot} } var aS, an, bH; function bC() { if (bH == null) { bH = ""; for (var cO = 0; cO < 49; ++cO) { bH += "x" } var cN = ah.clientHeight; if (cN == an) { return aS } an = cN; al.innerHTML = bH; aS = al.firstChild.offsetHeight / 50 || 1; al.innerHTML = ""; return aS } var cF, bl = 0; function a8() { if (ba.clientWidth == bl) { return cF } bl = ba.clientWidth; return(cF = cf("x")) } function ce() { return bk.offsetTop } function aX() { return bk.offsetLeft } function aU(cR, cQ) { var cP = ac(ba, true), cN, cS; try { cN = cR.clientX; cS = cR.clientY } catch (cR) { return null } if (!cQ && (cN - cP.left > ba.clientWidth || cS - cP.top > ba.clientHeight)) { return null } var cO = ac(bk, true); return bv(cN - cO.left, cS - cO.top) } function aT(cO) { var cS = aU(cO); if (!cS || window.opera) { return } if (W(cK.from, cK.to) || T(cS, cK.from) || !T(cS, cK.to)) { ai(aY)(cS.line, cS.ch) } var cR = bc.style.cssText; bK.style.position = "absolute"; bc.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (cO.clientY - 5) + "px; left: " + (cO.clientX - 5) + "px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; a6 = true; var cQ = bc.value = bP(); bp(); bc.select(); function cN() { var cT = w(bc.value).join("\n"); if (cT != cQ) { ai(bh)(cT, "end") } bK.style.position = "relative"; bc.style.cssText = cR; a6 = false; co(true); ae() } if (H) { s(cO); var cP = n(window, "mouseup", function () { cP(); setTimeout(cN, 20) }, true) } else { setTimeout(cN, 50) } } function cz() { clearInterval(cC); var cN = true; a3.style.visibility = ""; cC = setInterval(function () { a3.style.visibility = (cN = !cN) ? "" : "hidden" }, 650) } var be = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; function b0(cT) { var cN = cK.inverted ? cK.from : cK.to, cV = cr(cN.line), cO = cN.ch - 1; var cS = (cO >= 0 && be[cV.text.charAt(cO)]) || be[cV.text.charAt(++cO)]; if (!cS) { return } var cW = cS.charAt(0), cU = cS.charAt(1) == ">", c6 = cU ? 1 : -1, c1 = cV.styles; for (var c7 = cO + 1, c3 = 0, c5 = c1.length; c3 < c5; c3 += 2) { if ((c7 -= c1[c3].length) <= 0) { var c4 = c1[c3 + 1]; break } } var cQ = [cV.text.charAt(cO)], c0 = /[(){}[\]]/; function cY(dj, de, df) { if (!dj.text) { return } var di = dj.styles, dd = cU ? 0 : dj.text.length - 1, dg; for (var da = cU ? 0 : di.length - 2, dc = cU ? di.length : -2; da != dc; da += 2 * c6) { var dh = di[da]; if (di[da + 1] != null && di[da + 1] != c4) { dd += c6 * dh.length; continue } for (var c9 = cU ? 0 : dh.length - 1, c8 = cU ? dh.length : -1; c9 != c8; c9 += c6, dd += c6) { if (dd >= de && dd < df && c0.test(dg = dh.charAt(c9))) { var db = be[dg]; if (db.charAt(1) == ">" == cU) { cQ.push(dg) } else { if (cQ.pop() != db.charAt(0)) { return{pos: dd, match: false} } else { if (!cQ.length) { return{pos: dd, match: true} } } } } } } } for (var c3 = cN.line, c5 = cU ? Math.min(c3 + 100, ck.size) : Math.max(-1, c3 - 100); c3 != c5; c3 += c6) { var cV = cr(c3), cR = c3 == cN.line; var cX = cY(cV, cR && cU ? cO + 1 : 0, cR && !cU ? cO : cV.text.length); if (cX) { break } } if (!cX) { cX = {pos: null, match: false} } var c4 = cX.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; var c2 = bs({line: cN.line, ch: cO}, {line: cN.line, ch: cO + 1}, c4), cP = cX.pos != null && bs({line: c3, ch: cX.pos}, {line: c3, ch: cX.pos + 1}, c4); var cZ = ai(function () { c2.clear(); cP && cP.clear() }); if (cT) { setTimeout(cZ, 800) } else { bQ = cZ } } function aZ(cT) { var cS, cP; for (var cO = cT, cQ = cT - 40; cO > cQ; --cO) { if (cO == 0) { return 0 } var cN = cr(cO - 1); if (cN.stateAfter) { return cO } var cR = cN.indentation(bN.tabSize); if (cP == null || cS > cR) { cP = cO - 1; cS = cR } } return cP } function cg(cP) { var cO = aZ(cP), cN = cO && cr(cO - 1).stateAfter; if (!cN) { cN = P(bX) } else { cN = l(bX, cN) } ck.iter(cO, cP, function (cQ) { cQ.highlight(bX, cN, bN.tabSize); cQ.stateAfter = l(bX, cN) }); if (cO < cP) { ar.push({from: cO, to: cP}) } if (cP < ck.size && !cr(cP).stateAfter) { b3.push(cP) } return cN } function ct(cP, cN) { var cO = cg(cP); ck.iter(cP, cN, function (cQ) { cQ.highlight(bX, cO, bN.tabSize); cQ.stateAfter = l(bX, cO) }) } function bF() { var cT = +new Date + bN.workTime; var cW = b3.length; while (b3.length) { if (!cr(cD).stateAfter) { var cQ = cD } else { var cQ = b3.pop() } if (cQ >= ck.size) { continue } var cO = aZ(cQ), cN = cO && cr(cO - 1).stateAfter; if (cN) { cN = l(bX, cN) } else { cN = P(bX) } var cS = 0, cP = bX.compareStates, cV = false, cU = cO, cR = false; ck.iter(cU, ck.size, function (cX) { var cY = cX.stateAfter; if (+new Date > cT) { b3.push(cU); bu(bN.workDelay); if (cV) { ar.push({from: cQ, to: cU + 1}) } return(cR = true) } var cZ = cX.highlight(bX, cN, bN.tabSize); if (cZ) { cV = true } cX.stateAfter = l(bX, cN); if (cP) { if (cY && cP(cY, cN)) { return true } } else { if (cZ !== false || !cY) { cS = 0 } else { if (++cS > 3 && (!bX.indent || bX.indent(cY, "") == bX.indent(cN, ""))) { return true } } } ++cU }); if (cR) { return } if (cV) { ar.push({from: cQ, to: cU + 1}) } } if (cW && bN.onHighlightComplete) { bN.onHighlightComplete(bV) } } function bu(cN) { if (!b3.length) { return } am.set(cN, ai(bF)) } function aE() { cb = bS = cA = null; ar = []; aG = false; cm = [] } function ao() { var cR = false, cO; if (aG) { cR = !b1() } if (ar.length) { cO = bZ(ar, true) } else { if (aG) { cJ() } if (aJ) { aC() } } if (cR) { b1() } if (aG) { cM(); cz() } if (b5 && !a6 && (cb === true || (cb !== false && aG))) { co(bS) } if (aG && bN.matchBrackets) { setTimeout(ai(function () { if (bQ) { bQ(); bQ = null } if (W(cK.from, cK.to)) { b0(false) } }), 20) } var cN = cA, cP = cm; if (aG && bN.onCursorActivity) { bN.onCursorActivity(bV) } if (cN && bN.onChange && bV) { bN.onChange(bV, cN) } for (var cQ = 0; cQ < cP.length; ++cQ) { cP[cQ](bV) } if (cO && bN.onUpdate) { bN.onUpdate(bV) } } var cc = 0; function ai(cN) { return function () { if (!cc++) { aE() } try { var cO = cN.apply(this, arguments) } finally { if (!--cc) { ao() } } return cO } } for (var bx in V) { if (V.propertyIsEnumerable(bx) && !bV.propertyIsEnumerable(bx)) { bV[bx] = V[bx] } } return bV } q.defaults = {value: "", mode: null, theme: "default", indentUnit: 2, indentWithTabs: false, smartIndent: true, tabSize: 4, keyMap: "default", extraKeys: null, electricChars: true, onKeyEvent: null, lineWrapping: false, lineNumbers: false, gutter: false, fixedGutter: false, firstLineNumber: 1, readOnly: false, onChange: null, onCursorActivity: null, onGutterClick: null, onHighlightComplete: null, onUpdate: null, onFocus: null, onBlur: null, onScroll: null, matchBrackets: false, workTime: 100, workDelay: 200, pollInterval: 100, undoDepth: 40, tabindex: null, document: window.document}; var o = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); var G = o || /Mac/.test(navigator.platform); var O = /Win/.test(navigator.platform); var ab = {}, M = {}; q.defineMode = function (ae, af) { if (!q.defaults.mode && ae != "null") { q.defaults.mode = ae } ab[ae] = af }; q.defineMIME = function (af, ae) { M[af] = ae }; q.getMode = function (ag, ae) { if (typeof ae == "string" && M.hasOwnProperty(ae)) { ae = M[ae] } if (typeof ae == "string") { var ai = ae, af = {} } else { if (ae != null) { var ai = ae.name, af = ae } } var ah = ab[ai]; if (!ah) { if (window.console) { console.warn("No mode " + ai + " found, falling back to plain text.") } return q.getMode(ag, "text/plain") } return ah(ag, af || {}) }; q.listModes = function () { var af = []; for (var ae in ab) { if (ab.propertyIsEnumerable(ae)) { af.push(ae) } } return af }; q.listMIMEs = function () { var af = []; for (var ae in M) { if (M.propertyIsEnumerable(ae)) { af.push({mime: ae, mode: M[ae]}) } } return af }; var V = q.extensions = {}; q.defineExtension = function (ae, af) { V[ae] = af }; var F = q.commands = {selectAll: function (ae) { ae.setSelection({line: 0, ch: 0}, {line: ae.lineCount() - 1}) }, killLine: function (ae) { var ah = ae.getCursor(true), ag = ae.getCursor(false), af = !W(ah, ag); if (!af && ae.getLine(ah.line).length == ah.ch) { ae.replaceRange("", ah, {line: ah.line + 1, ch: 0}) } else { ae.replaceRange("", ah, af ? ag : {line: ah.line}) } }, deleteLine: function (ae) { var af = ae.getCursor().line; ae.replaceRange("", {line: af, ch: 0}, {line: af}) }, undo: function (ae) { ae.undo() }, redo: function (ae) { ae.redo() }, goDocStart: function (ae) { ae.setCursor(0, 0, true) }, goDocEnd: function (ae) { ae.setSelection({line: ae.lineCount() - 1}, null, true) }, goLineStart: function (ae) { ae.setCursor(ae.getCursor().line, 0, true) }, goLineStartSmart: function (ae) { var ah = ae.getCursor(); var ag = ae.getLine(ah.line), af = Math.max(0, ag.search(/\S/)); ae.setCursor(ah.line, ah.ch <= af && ah.ch ? 0 : af, true) }, goLineEnd: function (ae) { ae.setSelection({line: ae.getCursor().line}, null, true) }, goLineUp: function (ae) { ae.moveV(-1, "line") }, goLineDown: function (ae) { ae.moveV(1, "line") }, goPageUp: function (ae) { ae.moveV(-1, "page") }, goPageDown: function (ae) { ae.moveV(1, "page") }, goCharLeft: function (ae) { ae.moveH(-1, "char") }, goCharRight: function (ae) { ae.moveH(1, "char") }, goColumnLeft: function (ae) { ae.moveH(-1, "column") }, goColumnRight: function (ae) { ae.moveH(1, "column") }, goWordLeft: function (ae) { ae.moveH(-1, "word") }, goWordRight: function (ae) { ae.moveH(1, "word") }, delCharLeft: function (ae) { ae.deleteH(-1, "char") }, delCharRight: function (ae) { ae.deleteH(1, "char") }, delWordLeft: function (ae) { ae.deleteH(-1, "word") }, delWordRight: function (ae) { ae.deleteH(1, "word") }, indentAuto: function (ae) { ae.indentSelection("smart") }, indentMore: function (ae) { ae.indentSelection("add") }, indentLess: function (ae) { ae.indentSelection("subtract") }, insertTab: function (ae) { ae.replaceSelection("\t", "end") }, transposeChars: function (ae) { var ag = ae.getCursor(), af = ae.getLine(ag.line); if (ag.ch > 0 && ag.ch < af.length - 1) { ae.replaceRange(af.charAt(ag.ch) + af.charAt(ag.ch - 1), {line: ag.line, ch: ag.ch - 1}, {line: ag.line, ch: ag.ch + 1}) } }, newlineAndIndent: function (ae) { ae.replaceSelection("\n", "end"); ae.indentLine(ae.getCursor().line) }, toggleOverwrite: function (ae) { ae.toggleOverwrite() }}; var r = q.keyMap = {}; r.basic = {Left: "goCharLeft", Right: "goCharRight", Up: "goLineUp", Down: "goLineDown", End: "goLineEnd", Home: "goLineStartSmart", PageUp: "goPageUp", PageDown: "goPageDown", Delete: "delCharRight", Backspace: "delCharLeft", Tab: "indentMore", "Shift-Tab": "indentLess", Enter: "newlineAndIndent", Insert: "toggleOverwrite"}; r.pcDefault = {"Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", "Ctrl-Left": "goWordLeft", "Ctrl-Right": "goWordRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", "Ctrl-Backspace": "delWordLeft", "Ctrl-Delete": "delWordRight", "Ctrl-S": "save", "Ctrl-F": "find", "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", fallthrough: "basic"}; r.macDefault = {"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goWordLeft", "Alt-Right": "goWordRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delWordLeft", "Ctrl-Alt-Backspace": "delWordRight", "Alt-Delete": "delWordRight", "Cmd-S": "save", "Cmd-F": "find", "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", fallthrough: ["basic", "emacsy"]}; r["default"] = G ? r.macDefault : r.pcDefault; r.emacsy = {"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageUp", "Shift-Ctrl-V": "goPageDown", "Ctrl-D": "delCharRight", "Ctrl-H": "delCharLeft", "Alt-D": "delWordRight", "Alt-Backspace": "delWordLeft", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars"}; function j(af, ae, ah) { function ag(ai, am, an) { var ak = am[ai]; if (ak != null) { return ak } if (an == null) { an = am.fallthrough } if (an == null) { return am.catchall } if (typeof an == "string") { return ag(ai, r[an]) } for (var aj = 0, al = an.length; aj < al; ++aj) { ak = ag(ai, r[an[aj]]); if (ak != null) { return ak } } return null } return ae ? ag(af, ae, ah) : ag(af, r[ah]) } function K(af) { var ae = L[u(af, "keyCode")]; return ae == "Ctrl" || ae == "Alt" || ae == "Shift" || ae == "Mod" } q.fromTextArea = function (af, ah) { if (!ah) { ah = {} } ah.value = af.value; if (!ah.tabindex && af.tabindex) { ah.tabindex = af.tabindex } function aj() { af.value = ae.getValue() } if (af.form) { var ai = n(af.form, "submit", aj, true); if (typeof af.form.submit == "function") { var ag = af.form.submit; function ak() { aj(); af.form.submit = ag; af.form.submit(); af.form.submit = ak } af.form.submit = ak } } af.style.display = "none"; var ae = q(function (al) { af.parentNode.insertBefore(al, af.nextSibling) }, ah); ae.save = aj; ae.getTextArea = function () { return af }; ae.toTextArea = function () { aj(); af.parentNode.removeChild(ae.getWrapperElement()); af.style.display = ""; if (af.form) { ai(); if (typeof af.form.submit == "function") { af.form.submit = ag } } }; return ae }; function l(ah, ae) { if (ae === true) { return ae } if (ah.copyState) { return ah.copyState(ae) } var ag = {}; for (var ai in ae) { var af = ae[ai]; if (af instanceof Array) { af = af.concat([]) } ag[ai] = af } return ag } q.copyState = l; function P(ag, af, ae) { return ag.startState ? ag.startState(af, ae) : true } q.startState = P; function b(ae, af) { this.pos = this.start = 0; this.string = ae; this.tabSize = af || 8 } b.prototype = {eol: function () { return this.pos >= this.string.length }, sol: function () { return this.pos == 0 }, peek: function () { return this.string.charAt(this.pos) }, next: function () { if (this.pos < this.string.length) { return this.string.charAt(this.pos++) } }, eat: function (ae) { var ag = this.string.charAt(this.pos); if (typeof ae == "string") { var af = ag == ae } else { var af = ag && (ae.test ? ae.test(ag) : ae(ag)) } if (af) { ++this.pos; return ag } }, eatWhile: function (ae) { var af = this.pos; while (this.eat(ae)) { } return this.pos > af }, eatSpace: function () { var ae = this.pos; while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos } return this.pos > ae }, skipToEnd: function () { this.pos = this.string.length }, skipTo: function (ae) { var af = this.string.indexOf(ae, this.pos); if (af > -1) { this.pos = af; return true } }, backUp: function (ae) { this.pos -= ae }, column: function () { return k(this.string, this.start, this.tabSize) }, indentation: function () { return k(this.string, null, this.tabSize) }, match: function (ah, af, ae) { if (typeof ah == "string") { function ai(aj) { return ae ? aj.toLowerCase() : aj } if (ai(this.string).indexOf(ai(ah), this.pos) == this.pos) { if (af !== false) { this.pos += ah.length } return true } } else { var ag = this.string.slice(this.pos).match(ah); if (ag && af !== false) { this.pos += ag[0].length } return ag } }, current: function () { return this.string.slice(this.start, this.pos) }}; q.StringStream = b; function E(ah, ag, ae, af) { this.from = ah; this.to = ag; this.style = ae; this.set = af } E.prototype = {attach: function (ae) { this.set.push(ae) }, detach: function (af) { var ae = m(this.set, af); if (ae > -1) { this.set.splice(ae, 1) } }, split: function (ah, ae) { if (this.to <= ah && this.to != null) { return null } var ag = this.from < ah || this.from == null ? null : this.from - ah + ae; var af = this.to == null ? null : this.to - ah + ae; return new E(ag, af, this.style, this.set) }, dup: function () { return new E(null, null, this.style, this.set) }, clipTo: function (af, ai, ae, ah, ag) { if (this.from != null && this.from >= ai) { this.from = Math.max(ah, this.from) + ag } if (this.to != null && this.to > ai) { this.to = ah < this.to ? this.to + ag : ai } if (af && ah > this.from && (ah < this.to || this.to == null)) { this.from = null } if (ae && (ai < this.to || this.to == null) && (ai > this.from || this.from == null)) { this.to = null } }, isDead: function () { return this.from != null && this.to != null && this.from >= this.to }, sameSet: function (ae) { return this.set == ae.set }}; function A(ae) { this.from = ae; this.to = ae; this.line = null } A.prototype = {attach: function (ae) { this.line = ae }, detach: function (ae) { if (this.line == ae) { this.line = null } }, split: function (af, ae) { if (af < this.from) { this.from = this.to = (this.from - af) + ae; return this } }, isDead: function () { return this.from > this.to }, clipTo: function (af, ai, ae, ah, ag) { if ((af || ai < this.from) && (ae || ah > this.to)) { this.from = 0; this.to = -1 } else { if (this.from > ai) { this.from = this.to = Math.max(ah, this.from) + ag } } }, sameSet: function (ae) { return false }, find: function () { if (!this.line || !this.line.parent) { return null } return{line: S(this.line), ch: this.from} }, clear: function () { if (this.line) { var ae = m(this.line.marked, this); if (ae != -1) { this.line.marked.splice(ae, 1) } this.line = null } }}; function d(af, ae) { this.styles = ae || [af, null]; this.text = af; this.height = 1; this.marked = this.gutterMarker = this.className = this.handlers = null; this.stateAfter = this.parent = this.hidden = null } d.inheritMarks = function (ai, al) { var ah = new d(ai), ae = al && al.marked; if (ae) { for (var ag = 0; ag < ae.length; ++ag) { if (ae[ag].to == null && ae[ag].style) { var af = ah.marked || (ah.marked = []), ak = ae[ag]; var aj = ak.dup(); af.push(aj); aj.attach(ah) } } } return ah }; d.prototype = {replace: function (ai, ah, al) { var am = [], ag = this.marked, aj = ah == null ? this.text.length : ah; ad(0, ai, this.styles, am); if (al) { am.push(al, null) } ad(aj, this.text.length, this.styles, am); this.styles = am; this.text = this.text.slice(0, ai) + al + this.text.slice(aj); this.stateAfter = null; if (ag) { var ak = al.length - (aj - ai); for (var af = 0; af < ag.length; ++af) { var ae = ag[af]; ae.clipTo(ai == null, ai || 0, ah == null, aj, ak); if (ae.isDead()) { ae.detach(this); ag.splice(af--, 1) } } } }, split: function (al, aj) { var ah = [aj, null], af = this.marked; ad(al, this.text.length, this.styles, ah); var ag = new d(aj + this.text.slice(al), ah); if (af) { for (var ai = 0; ai < af.length; ++ai) { var ak = af[ai]; var ae = ak.split(al, aj.length); if (ae) { if (!ag.marked) { ag.marked = [] } ag.marked.push(ae); ae.attach(ag) } } } return ag }, append: function (af) { var ak = this.text.length, ae = af.marked, ai = this.marked; this.text += af.text; ad(0, af.text.length, af.styles, this.styles); if (ai) { for (var aj = 0; aj < ai.length; ++aj) { if (ai[aj].to == null) { ai[aj].to = ak } } } if (ae && ae.length) { if (!ai) { this.marked = ai = [] } outer:for (var aj = 0; aj < ae.length; ++aj) { var al = ae[aj]; if (!al.from) { for (var ah = 0; ah < ai.length; ++ah) { var ag = ai[ah]; if (ag.to == ak && ag.sameSet(al)) { ag.to = al.to == null ? null : al.to + ak; if (ag.isDead()) { ag.detach(this); ae.splice(aj--, 1) } continue outer } } } ai.push(al); al.attach(this); al.from += ak; if (al.to != null) { al.to += ak } } } }, fixMarkEnds: function (af) { var ae = this.marked, ai = af.marked; if (!ae) { return } for (var ah = 0; ah < ae.length; ++ah) { var ak = ae[ah], aj = ak.to == null; if (aj && ai) { for (var ag = 0; ag < ai.length; ++ag) { if (ai[ag].sameSet(ak)) { aj = false; break } } } if (aj) { ak.to = this.text.length } } }, fixMarkStarts: function () { var ae = this.marked; if (!ae) { return } for (var af = 0; af < ae.length; ++af) { if (ae[af].from == null) { ae[af].from = 0 } } }, addMark: function (ae) { ae.attach(this); if (this.marked == null) { this.marked = [] } this.marked.push(ae); this.marked.sort(function (ag, af) { return(ag.from || 0) - (af.from || 0) }) }, highlight: function (aj, af, ak) { var an = new b(this.text, ak), ao = this.styles, al = 0; var ai = false, ag = ao[0], am; if (this.text == "" && aj.blankLine) { aj.blankLine(af) } while (!an.eol()) { var ae = aj.token(an, af); var ah = this.text.slice(an.start, an.pos); an.start = an.pos; if (al && ao[al - 1] == ae) { ao[al - 2] += ah } else { if (ah) { if (!ai && (ao[al + 1] != ae || (al && ao[al - 2] != am))) { ai = true } ao[al++] = ah; ao[al++] = ae; am = ag; ag = ao[al] } } if (an.pos > 5000) { ao[al++] = this.text.slice(an.pos); ao[al++] = null; break } } if (ao.length != al) { ao.length = al; ai = true } if (al && ao[al - 2] != am) { ai = true } return ai || (ao.length < 5 && this.text.length < 10 ? null : false) }, getTokenAt: function (aj, ah, ag) { var ae = this.text, ai = new b(ae); while (ai.pos < ag && !ai.eol()) { ai.start = ai.pos; var af = aj.token(ai, ah) } return{start: ai.start, end: ai.pos, string: ai.current(), className: af || null, state: ah} }, indentation: function (ae) { return k(this.text, null, ae) }, getHTML: function (ao, au) { var ak = [], ai = true; function ay(aH, aG) { if (!aH) { return } if (ai && C && aH.charAt(0) == " ") { aH = "\u00a0" + aH.slice(1) } ai = false; if (aG) { ak.push('', J(aH).replace(/\t/g, ao), "") } else { ak.push(J(aH).replace(/\t/g, ao)) } } var ar = this.styles, aj = this.text, ap = this.marked; var aB = aj.length; if (au != null) { aB = Math.min(au, aB) } function ag(aG) { if (!aG) { return null } return"cm-" + aG.replace(/ +/g, " cm-") } if (!aj && au == null) { ay(" ") } else { if (!ap || !ap.length) { for (var az = 0, al = 0; al < aB; az += 2) { var at = ar[az], aC = ar[az + 1], av = at.length; if (al + av > aB) { at = at.slice(0, aB - al) } al += av; ay(at, ag(aC)) } } else { var ah = 0, az = 0, an = "", aC, aF = 0; var aE = ap[0].from || 0, ax = [], aD = 0; function aA() { var aG; while (aD < ap.length && ((aG = ap[aD]).from == ah || aG.from == null)) { if (aG.style != null) { ax.push(aG) } ++aD } aE = aD < ap.length ? ap[aD].from : Infinity; for (var aH = 0; aH < ax.length; ++aH) { var aI = ax[aH].to || Infinity; if (aI == ah) { ax.splice(aH--, 1) } else { aE = Math.min(aI, aE) } } } var aq = 0; while (ah < aB) { if (aE == ah) { aA() } var am = Math.min(aB, aE); while (true) { if (an) { var af = ah + an.length; var ae = aC; for (var aw = 0; aw < ax.length; ++aw) { ae = (ae ? ae + " " : "") + ax[aw].style } ay(af > am ? an.slice(0, am - ah) : an, ae); if (af >= am) { an = an.slice(am - ah); ah = am; break } ah = af } an = ar[az++]; aC = ag(ar[az++]) } } } } return ak.join("") }, cleanUp: function () { this.parent = null; if (this.marked) { for (var ae = 0, af = this.marked.length; ae < af; ++ae) { this.marked[ae].detach(this) } } }}; function ad(ak, al, ae, am) { for (var ai = 0, aj = 0, af = 0; aj < al; ai += 2) { var ag = ae[ai], ah = aj + ag.length; if (af == 0) { if (ah > ak) { am.push(ag.slice(ak - aj, Math.min(ag.length, al - aj)), ae[ai + 1]) } if (ah >= ak) { af = 1 } } else { if (af == 1) { if (ah > al) { am.push(ag.slice(0, al - aj), ae[ai + 1]) } else { am.push(ag, ae[ai + 1]) } } } aj = ah } } function Z(af) { this.lines = af; this.parent = null; for (var ag = 0, ah = af.length, ae = 0; ag < ah; ++ag) { af[ag].parent = this; ae += af[ag].height } this.height = ae } Z.prototype = {chunkSize: function () { return this.lines.length }, remove: function (ae, ak, ai) { for (var ah = ae, aj = ae + ak; ah < aj; ++ah) { var af = this.lines[ah]; this.height -= af.height; af.cleanUp(); if (af.handlers) { for (var ag = 0; ag < af.handlers.length; ++ag) { ai.push(af.handlers[ag]) } } } this.lines.splice(ae, ak) }, collapse: function (ae) { ae.splice.apply(ae, [ae.length, 0].concat(this.lines)) }, insertHeight: function (af, ag, ae) { this.height += ae; this.lines.splice.apply(this.lines, [af, 0].concat(ag)); for (var ah = 0, ai = ag.length; ah < ai; ++ah) { ag[ah].parent = this } }, iterN: function (ae, ah, ag) { for (var af = ae + ah; ae < af; ++ae) { if (ag(this.lines[ae])) { return true } } }}; function g(ah) { this.children = ah; var ag = 0, ae = 0; for (var af = 0, aj = ah.length; af < aj; ++af) { var ai = ah[af]; ag += ai.chunkSize(); ae += ai.height; ai.parent = this } this.size = ag; this.height = ae; this.parent = null } g.prototype = {chunkSize: function () { return this.size }, remove: function (ag, af, aj) { this.size -= af; for (var ah = 0; ah < this.children.length; ++ah) { var ae = this.children[ah], ak = ae.chunkSize(); if (ag < ak) { var ai = Math.min(af, ak - ag), al = ae.height; ae.remove(ag, ai, aj); this.height -= al - ae.height; if (ak == ai) { this.children.splice(ah--, 1); ae.parent = null } if ((af -= ai) == 0) { break } ag = 0 } else { ag -= ak } } if (this.size - af < 25) { var am = []; this.collapse(am); this.children = [new Z(am)]; this.children[0].parent = this } }, collapse: function (ae) { for (var af = 0, ag = this.children.length; af < ag; ++af) { this.children[af].collapse(ae) } }, insert: function (af, ag) { var ae = 0; for (var ah = 0, ai = ag.length; ah < ai; ++ah) { ae += ag[ah].height } this.insertHeight(af, ag, ae) }, insertHeight: function (af, am, al) { this.size += am.length; this.height += al; for (var ag = 0, ai = this.children.length; ag < ai; ++ag) { var ae = this.children[ag], aj = ae.chunkSize(); if (af <= aj) { ae.insertHeight(af, am, al); if (ae.lines && ae.lines.length > 50) { while (ae.lines.length > 50) { var ah = ae.lines.splice(ae.lines.length - 25, 25); var ak = new Z(ah); ae.height -= ak.height; this.children.splice(ag + 1, 0, ak); ak.parent = this } this.maybeSpill() } break } af -= aj } }, maybeSpill: function () { if (this.children.length <= 10) { return } var ah = this; do { var af = ah.children.splice(ah.children.length - 5, 5); var ag = new g(af); if (!ah.parent) { var ai = new g(ah.children); ai.parent = ah; ah.children = [ai, ag]; ah = ai } else { ah.size -= ag.size; ah.height -= ag.height; var ae = m(ah.parent.children, ah); ah.parent.children.splice(ae + 1, 0, ag) } ag.parent = ah.parent } while (ah.children.length > 10); ah.parent.maybeSpill() }, iter: function (ag, af, ae) { this.iterN(ag, af - ag, ae) }, iterN: function (ae, al, ak) { for (var af = 0, ai = this.children.length; af < ai; ++af) { var aj = this.children[af], ah = aj.chunkSize(); if (ae < ah) { var ag = Math.min(al, ah - ae); if (aj.iterN(ae, ag, ak)) { return true } if ((al -= ag) == 0) { break } ae = 0 } else { ae -= ah } } }}; function x(ae, ai) { while (!ae.lines) { for (var af = 0; ; ++af) { var ah = ae.children[af], ag = ah.chunkSize(); if (ai < ag) { ae = ah; break } ai -= ag } } return ae.lines[ai] } function S(ae) { if (ae.parent == null) { return null } var aj = ae.parent, ai = m(aj.lines, ae); for (var af = aj.parent; af; aj = af, af = af.parent) { for (var ag = 0, ah = af.children.length; ; ++ag) { if (af.children[ag] == aj) { break } ai += af.children[ag].chunkSize() } } return ai } function R(ak, ai) { var ag = 0; outer:do { for (var ah = 0, aj = ak.children.length; ah < aj; ++ah) { var af = ak.children[ah], ae = af.height; if (ai < ae) { ak = af; continue outer } ai -= ae; ag += af.chunkSize() } return ag } while (!ak.lines); for (var ah = 0, aj = ak.lines.length; ah < aj; ++ah) { var am = ak.lines[ah], al = am.height; if (ai < al) { break } ai -= al } return ag + ah } function f(ae, ak) { var ag = 0; outer:do { for (var af = 0, ai = ae.children.length; af < ai; ++af) { var aj = ae.children[af], ah = aj.chunkSize(); if (ak < ah) { ae = aj; continue outer } ak -= ah; ag += aj.height } return ag } while (!ae.lines); for (var af = 0; af < ak; ++af) { ag += ae.lines[af].height } return ag } function i() { this.time = 0; this.done = []; this.undone = [] } i.prototype = {addChange: function (ae, ak, af) { this.undone.length = 0; var ag = +new Date, am = this.done[this.done.length - 1], an = am && am[am.length - 1]; var ai = ag - this.time; if (ai > 400 || !an) { this.done.push([ {start: ae, added: ak, old: af} ]) } else { if (an.start > ae + ak || an.start + an.added < ae - an.added + an.old.length) { am.push({start: ae, added: ak, old: af}) } else { var al = 0; if (ae < an.start) { for (var ah = an.start - ae - 1; ah >= 0; --ah) { an.old.unshift(af[ah]) } an.added += an.start - ae; an.start = ae } else { if (an.start < ae) { al = ae - an.start; ak += al } } for (var ah = an.added - al, aj = af.length; ah < aj; ++ah) { an.old.push(af[ah]) } if (an.added < ak) { an.added = ak } } } this.time = ag }}; function D() { s(this) } function I(ae) { if (!ae.stop) { ae.stop = D } return ae } function N(ae) { if (ae.preventDefault) { ae.preventDefault() } else { ae.returnValue = false } } function y(ae) { if (ae.stopPropagation) { ae.stopPropagation() } else { ae.cancelBubble = true } } function s(ae) { N(ae); y(ae) } q.e_stop = s; q.e_preventDefault = N; q.e_stopPropagation = y; function h(ae) { return ae.target || ae.srcElement } function t(ae) { if (ae.which) { return ae.which } else { if (ae.button & 1) { return 1 } else { if (ae.button & 2) { return 3 } else { if (ae.button & 4) { return 2 } } } } } function u(af, ag) { var ae = af.override && af.override.hasOwnProperty(ag); return ae ? af.override[ag] : af[ag] } function n(ah, ag, af, ae) { if (typeof ah.addEventListener == "function") { ah.addEventListener(ag, af, false); if (ae) { return function () { ah.removeEventListener(ag, af, false) } } } else { var ai = function (aj) { af(aj || window.event) }; ah.attachEvent("on" + ag, ai); if (ae) { return function () { ah.detachEvent("on" + ag, ai) } } } } q.connect = n; function v() { this.id = null } v.prototype = {set: function (ae, af) { clearTimeout(this.id); this.id = setTimeout(af, ae) }}; var z = function () { if (/MSIE [1-8]\b/.test(navigator.userAgent)) { return false } var ae = document.createElement("div"); return"draggable" in ae }(); var H = /gecko\/\d{7}/i.test(navigator.userAgent); var C = /MSIE \d/.test(navigator.userAgent); var e = /WebKit\//.test(navigator.userAgent); var c = "\n"; (function () { var ae = document.createElement("textarea"); ae.value = "foo\nbar"; if (ae.value.indexOf("\r") > -1) { c = "\r\n" } }()); function k(af, ae, ah) { if (ae == null) { ae = af.search(/[^\s\u00a0]/); if (ae == -1) { ae = af.length } } for (var ag = 0, ai = 0; ag < ae; ++ag) { if (af.charAt(ag) == "\t") { ai += ah - (ai % ah) } else { ++ai } } return ai } function p(ae) { if (ae.currentStyle) { return ae.currentStyle } return window.getComputedStyle(ae, null) } function ac(af, an) { var ah = af.ownerDocument.body; var am = 0, al = 0, aj = false; for (var ae = af; ae; ae = ae.offsetParent) { var ak = ae.offsetLeft, ag = ae.offsetTop; if (ae == ah) { am += Math.abs(ak); al += Math.abs(ag) } else { am += ak, al += ag } if (an && p(ae).position == "fixed") { aj = true } } var ai = an && !aj ? null : ah; for (var ae = af.parentNode; ae != ai; ae = ae.parentNode) { if (ae.scrollLeft != null) { am -= ae.scrollLeft; al -= ae.scrollTop } } return{left: am, top: al} } if (document.documentElement.getBoundingClientRect != null) { ac = function (ah, ae) { try { var ag = ah.getBoundingClientRect(); ag = {top: ag.top, left: ag.left} } catch (ai) { ag = {top: 0, left: 0} } if (!ae) { if (window.pageYOffset == null) { var af = document.documentElement || document.body.parentNode; if (af.scrollTop == null) { af = document.body } ag.top += af.scrollTop; ag.left += af.scrollLeft } else { ag.top += window.pageYOffset; ag.left += window.pageXOffset } } return ag } } function B(ae) { return ae.textContent || ae.innerText || ae.nodeValue || "" } function a(ae) { if (o) { ae.selectionStart = 0; ae.selectionEnd = ae.value.length } else { ae.select() } } function W(af, ae) { return af.line == ae.line && af.ch == ae.ch } function T(af, ae) { return af.line < ae.line || (af.line == ae.line && af.ch < ae.ch) } function U(ae) { return{line: ae.line, ch: ae.ch} } var aa = document.createElement("pre"); function J(ae) { aa.textContent = ae; return aa.innerHTML } if (J("a") == "\na") { J = function (ae) { aa.textContent = ae; return aa.innerHTML.slice(1) } } else { if (J("\t") != "\t") { J = function (ae) { aa.innerHTML = ""; aa.appendChild(document.createTextNode(ae)); return aa.innerHTML } } } q.htmlEscape = J; function Q(ah, ag) { if (!ag) { return 0 } if (!ah) { return ag.length } for (var af = ah.length, ae = ag.length; af >= 0 && ae >= 0; --af, --ae) { if (ah.charAt(af) != ag.charAt(ae)) { break } } return ae + 1 } function m(ah, ae) { if (ah.indexOf) { return ah.indexOf(ae) } for (var af = 0, ag = ah.length; af < ag; ++af) { if (ah[af] == ae) { return af } } return -1 } function Y(ae) { return/\w/.test(ae) || ae.toUpperCase() != ae.toLowerCase() } var w = "\n\nb".split(/\n/).length != 3 ? function (ag) { var ah = 0, af, ae = []; while ((af = ag.indexOf("\n", ah)) > -1) { ae.push(ag.slice(ah, ag.charAt(af - 1) == "\r" ? af - 1 : af)); ah = af + 1 } ae.push(ag.slice(ah)); return ae } : function (ae) { return ae.split(/\r?\n/) }; q.splitLines = w; var X = window.getSelection ? function (af) { try { return af.selectionStart != af.selectionEnd } catch (ae) { return false } } : function (ag) { try { var ae = ag.ownerDocument.selection.createRange() } catch (af) { } if (!ae || ae.parentElement() != ag) { return false } return ae.compareEndPoints("StartToEnd", ae) != 0 }; q.defineMode("null", function () { return{token: function (ae) { ae.skipToEnd() }} }); q.defineMIME("text/plain", "null"); var L = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home", 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"}; q.keyNames = L; (function () { for (var ae = 0; ae < 10; ae++) { L[ae + 48] = String(ae) } for (var ae = 65; ae <= 90; ae++) { L[ae] = String.fromCharCode(ae) } for (var ae = 1; ae <= 12; ae++) { L[ae + 111] = L[ae + 63235] = "F" + ae } })(); return q })();
" } bH += "x