snipt/media/js/snipt.js

164 lines
327 KiB
JavaScript

// Underscore.js 1.3.1
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,
h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each=
b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==
null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=
function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=
e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})});
return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,
c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest=
b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]);
return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,
d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};
var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,
c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true:
a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};
b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,
1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};
b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};
b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};b.mixin=function(a){j(b.functions(a),
function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+
u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=
function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=
true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
var JSON;if(!JSON){JSON={};}
(function(){"use strict";function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());
// Backbone.js 0.9.2
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
{};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
!1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
/*!
* Bootstrap.js by @fat & @mdo
* Copyright 2012 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".item.active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide",{relatedTarget:i[0]});this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})})}(window.jQuery),!function(e){"use strict";function r(){i(e(t)).removeClass("open")}function i(t){var n=t.attr("data-target"),r;return n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=e(n),r.length||(r=t.parent()),r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||(s.toggleClass("open"),n.focus()),!1},keydown:function(t){var n,r,s,o,u,a;if(!/(38|40|27)/.test(t.keyCode))return;n=e(this),t.preventDefault(),t.stopPropagation();if(n.is(".disabled, :disabled"))return;o=i(n),u=o.hasClass("open");if(!u||u&&t.keyCode==27)return n.click();r=e("[role=menu] li:not(.divider) a",o);if(!r.length)return;a=r.index(r.filter(":focus")),t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<r.length-1&&a++,~a||(a=0),r.eq(a).focus()}},e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e(function(){e("html").on("click.dropdown.data-api touchstart.dropdown.data-api",r),e("body").on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;e("body").addClass("modal-open"),this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1).focus(),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.trigger("shown")}):t.$element.trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,e("body").removeClass("modal-open"),this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove(),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content > *")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var t=e(this),n=t.data("target")||t.attr("href"),r=/^#\w/.test(n)&&e(n);return r&&r.length&&[[r.position().top,n]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}},e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=e(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:t.top+t.height,left:t.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),(e.browser.chrome||e.browser.webkit||e.browser.msie)&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this))},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=!~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(e){var t=this;setTimeout(function(){t.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")}},e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e(function(){e("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;t.preventDefault(),n.typeahead(n.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))},e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",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",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return;}
var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text"||event.target.type === "password")){return;}
var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),key,modif="",possible={};if(event.altKey&&special!=="alt"){modif+="alt+";}
if(event.ctrlKey&&special!=="ctrl"){modif+="ctrl+";}
if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+";}
if(event.shiftKey&&special!=="shift"){modif+="shift+";}
if(special){possible[modif+special]=true;}else{possible[modif+character]=true;possible[modif+jQuery.hotkeys.shiftNums[character]]=true;if(modif==="shift+"){possible[jQuery.hotkeys.shiftNums[character]]=true;}}
for(var i=0,l=keys.length;i<l;i++){if(possible[keys[i]]){return origHandler.apply(this,arguments);}}};}
jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler};});})(jQuery);
(function($){$.InFieldLabels=function(label,field,options){var base=this;base.$label=$(label);base.label=label;base.$field=$(field);base.field=field;base.$label.data("InFieldLabels",base);base.showing=true;base.init=function(){base.options=$.extend({},$.InFieldLabels.defaultOptions,options);if(base.$field.val()!==""){base.$label.hide();base.showing=false;}
base.$field.focus(function(){base.fadeOnFocus();}).blur(function(){base.checkForEmpty(true);}).bind('keydown.infieldlabel',function(e){base.hideOnChange(e);}).bind('paste',function(e){base.setOpacity(0.0);}).change(function(e){base.checkForEmpty();}).bind('onPropertyChange',function(){base.checkForEmpty();});};base.fadeOnFocus=function(){if(base.showing){base.setOpacity(base.options.fadeOpacity);}};base.setOpacity=function(opacity){base.$label.stop().animate({opacity:opacity},base.options.fadeDuration);base.showing=(opacity>0.0);};base.checkForEmpty=function(blur){if(base.$field.val()===""){base.prepForShow();base.setOpacity(blur?1.0:base.options.fadeOpacity);}else{base.setOpacity(0.0);}};base.prepForShow=function(e){if(!base.showing){base.$label.css({opacity:0.0}).show();base.$field.bind('keydown.infieldlabel',function(e){base.hideOnChange(e);});}};base.hideOnChange=function(e){if((e.keyCode===16)||(e.keyCode===9)||(e.keyCode===27)){return;}
if(base.showing){base.$label.hide();base.showing=false;}
base.$field.unbind('keydown.infieldlabel');};base.init();};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(options){return this.each(function(){var for_attr=$(this).attr('for'),$field;if(!for_attr){return;}
$field=$("input#"+for_attr+"[type='text'],"+"input#"+for_attr+"[type='search'],"+"input#"+for_attr+"[type='tel'],"+"input#"+for_attr+"[type='url'],"+"input#"+for_attr+"[type='email'],"+"input#"+for_attr+"[type='password'],"+"textarea#"+for_attr);if($field.length===0){return;}
(new $.InFieldLabels(this,$field[0],options));});};}(jQuery));
// Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com
//
// Version 0.9.8
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
// This file is generated by `cake build`, do not edit it by hand.
((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d<e;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){if(a.nodeName==="OPTION")return a.text!==""?(b!=null&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},a}(),a.select_to_array=function(b){var c,d,e,f,g;d=new a,g=b.childNodes;for(e=0,f=g.length;e<f;e++)c=g[e],d.add_node(c);return d.parsed},this.SelectParser=a})).call(this),function(){var a,b;b=this,a=function(){function a(a,b){this.form_field=a,this.options=b!=null?b:{},this.set_default_values(),this.is_multiple=this.form_field.multiple,this.default_text_default=this.is_multiple?"Select Some Options":"Select an Option",this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.results_none_found=this.options.no_results_text||"No results match"},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)},a.prototype.input_blur=function(a){var b=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return b.blur_test()},100)},a.prototype.result_add_option=function(a){var b,c;return a.disabled?"":(a.dom_id=this.container_id+"_o_"+a.array_index,b=a.selected&&this.is_multiple?[]:["active-result"],a.selected&&b.push("result-selected"),a.group_array_index!=null&&b.push("group-option"),a.classes!==""&&b.push(a.classes),c=a.style.cssText!==""?' style="'+a.style+'"':"",'<li id="'+a.dom_id+'" class="'+b.join(" ")+'"'+c+">"+a.html+"</li>")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d,e=Object.prototype.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=this,a=jQuery,a.fn.extend({chosen:function(c){return!a.browser.msie||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?a(this).each(function(d){if(!a(this).hasClass("chzn-done"))return new b(this,c)}):this}}),b=function(b){function e(){e.__super__.constructor.apply(this,arguments)}return f(e,b),e.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},e.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},e.prototype.set_up_html=function(){var b,d,e,f;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("<div />",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):b.html('<a href="javascript:void(0)" class="chzn-single chzn-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},e.prototype.register_observers=function(){var a=this;return this.container.mousedown(function(b){return a.container_mousedown(b)}),this.container.mouseup(function(b){return a.container_mouseup(b)}),this.container.mouseenter(function(b){return a.mouse_enter(b)}),this.container.mouseleave(function(b){return a.mouse_leave(b)}),this.search_results.mouseup(function(b){return a.search_results_mouseup(b)}),this.search_results.mouseover(function(b){return a.search_results_mouseover(b)}),this.search_results.mouseout(function(b){return a.search_results_mouseout(b)}),this.form_field_jq.bind("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.blur(function(b){return a.input_blur(b)}),this.search_field.keyup(function(b){return a.keyup_checker(b)}),this.search_field.keydown(function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.click(function(b){return a.choices_click(b)}),this.search_field.focus(function(b){return a.input_focus(b)})):this.container.click(function(a){return a.preventDefault()})},e.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},e.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&!this.results_showing&&b.stopPropagation(),!this.pending_destroy_click&&!c?(this.active_field?!this.is_multiple&&b&&(a(b.target)[0]===this.selected_item[0]||a(b.target).parents("a.chzn-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},e.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},e.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},e.prototype.close_field=function(){return a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},e.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){var a,b,c,e,f;this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),a="",f=this.results_data;for(c=0,e=f.length;c<e;c++)b=f[c],b.group?a+=this.result_add_group(b):b.empty||(a+=this.result_add_option(b),b.selected&&this.is_multiple?this.choice_build(b):b.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(b.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(a),this.parsing=!1},e.prototype.result_add_group=function(b){return b.disabled?"":(b.dom_id=this.container_id+"_g_"+b.array_index,'<li id="'+b.dom_id+'" class="group-result">'+a("<div />").text(b.label).html()+"</li>")},e.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c<f)return this.search_results.scrollTop(c)}},e.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},e.prototype.results_show=function(){var a;return this.is_multiple||(this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected)),a=this.is_multiple?this.container.height():this.container.height()-1,this.dropdown.css({top:a+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},e.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},e.prototype.set_tab_index=function(a){var b;if(this.form_field_jq.attr("tabindex"))return b=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.is_multiple?this.search_field.attr("tabindex",b):(this.selected_item.attr("tabindex",b),this.search_field.attr("tabindex",-1))},e.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},e.prototype.search_results_mouseup=function(b){var c;c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first();if(c.length)return this.result_highlight=c,this.result_select(b)},e.prototype.search_results_mouseover=function(b){var c;c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first();if(c)return this.result_do_highlight(c)},e.prototype.search_results_mouseout=function(b){if(a(b.target).hasClass("active-result"))return this.result_clear_highlight()},e.prototype.choices_click=function(b){b.preventDefault();if(this.active_field&&!a(b.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},e.prototype.choice_build=function(b){var c,d,e=this;return c=this.container_id+"_c_"+b.array_index,this.choices+=1,this.search_container.before('<li class="search-choice" id="'+c+'"><span>'+b.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+b.array_index+'"></a></li>'),d=a("#"+c).find("a").first(),d.click(function(a){return e.choice_destroy_link_click(a)})},e.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),this.is_disabled?b.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(a(b.target)))},e.prototype.choice_destroy=function(a){return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel")),a.parents("li").first().remove()},e.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},e.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight)return b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b,this.selected_item.removeClass("chzn-default")),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.result_activate=function(a){return a.addClass("active-result")},e.prototype.result_deactivate=function(a){return a.removeClass("active-result")},e.prototype.result_deselect=function(b){var c,d;return d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},e.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;this.no_results_clear(),j=0,k=this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html(),g=this.search_contains?"":"^",f=new RegExp(g+k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),n=new RegExp(k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),s=this.results_data;for(o=0,q=s.length;o<q;o++){c=s[o];if(!c.disabled&&!c.empty)if(c.group)a("#"+c.dom_id).css("display","none");else if(!this.is_multiple||!c.selected){b=!1,i=c.dom_id,h=a("#"+i);if(f.test(c.html))b=!0,j+=1;else if(c.html.indexOf(" ")>=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(p=0,r=e.length;p<r;p++)d=e[p],f.test(d)&&(b=!0,j+=1)}b?(k.length?(l=c.html.search(n),m=c.html.substr(0,l+k.length)+"</em>"+c.html.substr(l+k.length),m=m.substr(0,l)+"<em>"+m.substr(l)):m=c.html,h.html(m),this.result_activate(h),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&i===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(h))}}return j<1&&k.length?this.no_results(k):this.winnow_results_set_highlight()},e.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d<e;d++)b=c[d],b=a(b),b.hasClass("group-result")?f.push(b.css("display","auto")):!this.is_multiple||!b.hasClass("result-selected")?f.push(this.result_activate(b)):f.push(void 0);return f},e.prototype.winnow_results_set_highlight=function(){var a,b;if(!this.result_highlight){b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first();if(a!=null)return this.result_do_highlight(a)}},e.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c)},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},e.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},e.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},e.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i<j;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return c=a("<div />",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height(),this.dropdown.css({top:b+"px"})}},e.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},e}(AbstractChosen),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}.call(this);
var snipt={module:function(){var modules={};return function(name){if(modules[name]){return modules[name];}
return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});
(function(Site){var Snipt=snipt.module('snipt');Backbone.oldSync=Backbone.sync;Backbone.Model.prototype.idAttribute='resource_uri';var addSlash=function(str){return str+((str.length>0&&str.charAt(str.length-1)==='/')?'':'/');};Backbone.sync=function(method,model,options){options.headers=_.extend({'Authorization':'ApiKey '+window.user+':'+window.api_key},options.headers);return Backbone.oldSync(method,model,options);};Backbone.Model.prototype.url=function(){var url=this.id;if(!url){url=this.urlRoot;url=url||this.collection&&(_.isFunction(this.collection.url)?this.collection.url():this.collection.url);if(url&&this.has('id')){url=addSlash(url)+this.get('id');}}
url=url&&addSlash(url);if(typeof url==='undefined'){url='/api/private/snipt/';this.unset('id',{'silent':true});this.unset('user',{'silent':true});}
return url||null;};Site.SiteView=Backbone.View.extend({el:'body',initialize:function(opts){this.$body=$(this.el);this.$html=$('html');this.$html_body=this.$body.add(this.$html);this.$aside_nav=$('aside.nav',this.$body);this.$aside_nav_ul=$('ul',this.$aside_nav);this.$search_form=$('form.search',this.$body);this.$search_query=$('input#search-query',this.$body);this.$search_page_query=$('input.search-query',this.$body);this.$search_queries=this.$search_query.add(this.$search_page_query);this.$snipts=$('section#snipts article.snipt',this.$body);this.$modals=$('div.modal',this.$snipts);this.$main_edit=$('section#main-edit');this.$main=$('section#main');this.$keyboard_shortcuts=$('#keyboard-shortcuts',this.$body);this.keyboardShortcuts();this.inFieldLabels();var SniptListView=Snipt.SniptListView;this.snipt_list=new SniptListView({'snipts':this.$snipts});var that=this;this.$body.click(function(){if(!window.ui_halted&&!window.from_modal&&window.$selected){window.$selected.trigger('deselect');}
if(window.from_modal){window.from_modal=false;}
that.$aside_nav.removeClass('open');});this.$aside_nav_ul.click(function(e){e.stopPropagation();});$search_queries=this.$search_queries;$search_queries.focus(function(){if(window.$selected){$selected.trigger('deselect');}});this.$body.on('click','a.close',function(){$(this).parent().parent().modal('hide');window.ui_halted=false;return false;});this.$keyboard_shortcuts.on('hidden',function(){window.ui_halted=false;});if(this.$body.hasClass('pro-signup')){var $form=$('form#pro-signup');var $submit=$('button[type="submit"]',$form);var $name=$('input#name');var $cardNumber=$('input#number');var $expMonth=$('select#exp-month');var $expYear=$('select#exp-year');var $cvc=$('input#cvc');$form.submit(function(){$submit.attr('disabled','disabled');var errors=false;if(!Stripe.validateCardNumber($cardNumber.val())){$cardNumber.parents('div.control-group').addClass('error');errors=true;}else{$cardNumber.parents('div.control-group').removeClass('error');}
if(!Stripe.validateExpiry($expMonth.val(),$expYear.val())){$expMonth.parents('div.control-group').addClass('error');errors=true;}else{$expMonth.parents('div.control-group').removeClass('error');}
if(!Stripe.validateCVC($cvc.val())){$cvc.parents('div.control-group').addClass('error');errors=true;}else{$cvc.parents('div.control-group').removeClass('error');}
if(!errors){$('.payment-errors').hide();$('.payment-loading').show();Stripe.createToken({name:$name.val(),number:$cardNumber.val(),cvc:$cvc.val(),exp_month:$expMonth.val(),exp_year:$expYear.val()},that.stripeResponseHandler);}else{$submit.removeAttr('disabled');}
return false;});}
if(this.$body.hasClass('login')){$('input#id_username').focus();}
window.ui_halted=false;},events:{'showKeyboardShortcuts':'showKeyboardShortcuts','click a.mini-profile':'toggleMiniProfile'},keyboardShortcuts:function(){var $body=this.$body;var that=this;$search_queries=this.$search_queries;$search_page_query=this.$search_page_query;$search_query=this.$search_query;$document=$(document);$document.bind('keydown','/',function(e){if(!window.ui_halted){e.preventDefault();if($body.hasClass('search')){$search_page_query.focus();}else{$search_query.focus();}}});$document.bind('keydown','h',function(e){if(!window.ui_halted){window.ui_halted=true;$body.trigger('showKeyboardShortcuts');}else{if(that.$keyboard_shortcuts.is(':visible')){that.$keyboard_shortcuts.modal('hide');}}});$document.bind('keydown','t',function(e){if(!window.ui_halted){window.open('','_blank');}});$document.bind('keydown','r',function(e){if(!window.ui_halted){location.reload(true);}});$document.bind('keydown','Ctrl+h',function(e){if(!window.ui_halted){history.go(-1);}});$document.bind('keydown','Ctrl+l',function(e){if(!window.ui_halted){history.go(1);}});this.$search_queries.bind('keydown','esc',function(e){if(!window.ui_halted){e.preventDefault();this.blur();}});},showKeyboardShortcuts:function(){this.$keyboard_shortcuts.modal('toggle');},toggleMiniProfile:function(e){this.$aside_nav.toggleClass('open');return false;},inFieldLabels:function(){$('div.infield label',this.$body).inFieldLabels({fadeDuration:200});},stripeResponseHandler:function(status,response){var $form=$('form#pro-signup');if(response.error){$('button[type="submit"]',$form).removeAttr('disabled');$('.payment-loading').hide();$('.payment-errors').text(response.error.message).show();}else{var token=response.id;$('input#name').val('');$('input#number').val('');$('select#exp-month').val('');$('select#exp-year').val('');$('input#cvc').val('');$form.append("<input type='hidden' name='token' value='"+token+"'/>");$form.get(0).submit();}}});})(snipt.module('site'));
(function(Snipt){Snipt.SniptModel=Backbone.Model.extend({toSafe:function(){var snipt=this.toJSON();snipt.code=this.escape('code');snipt.title=this.escape('title');snipt.tags_list=this.escape('tags_list');if(typeof snipt.tags==='object'){for(var i;i<snipt.tags.length;i++){snipt.tags[i].name=_.escape(snipt.tags[i].name);}}
return snipt;}});Snipt.SniptView=Backbone.View.extend({tagName:'article',initialize:function(){this.model.view=this;this.model.bind('change',this.render,this);this.template=_.template($('#snipt').html());this.editTemplate=_.template($('#edit').html());this.initLocalVars();this.initLineNumbers();},events:{'click a.copy':'copyFromClick','click a.edit':'edit','click a.favorite':'favoriteToggle','click a.embed':'embedFromClick','click a.expand':'expand','click .container':'selectFromClick','copyClose':'copyClose','copyRaw':'copy','detail':'detail','deselect':'deselect','destroy':'destroy','edit':'edit','embed':'embed','embedClose':'embedClose','expand':'expand','fadeAndRemove':'fadeAndRemove','goToAuthor':'goToAuthor','next':'next','prev':'prev','selectSnipt':'select'},copy:function(){$('textarea',this.$copyModal).remove();window.ui_halted=true;this.$copyModalBody.append('<textarea class="raw"></textarea>');$textarea=$('textarea.raw',this.$copyModalBody).val(this.model.get('code'));this.$copyModal.modal('show');$textarea.select();},copyClose:function(){$('textarea',this.$copyModal).remove();},copyFromClick:function(){this.copy();return false;},deselect:function(){this.$el.removeClass('selected');window.$selected=false;},detail:function(){window.location=this.model.get('absolute_url');},destroy:function(){this.model.destroy();},edit:function(){window.editing=true;window.ui_halted=true;this.select();that=this;var editPane=this.editTemplate({snipt:this.model.toSafe()});window.site.$main.hide();window.site.$body.addClass('detail editing');window.site.$main_edit.html(editPane);$('option[value="'+this.model.get('lexer')+'"]',window.site.$main_edit).attr('selected','selected');var $selectLexer=$('select#id_lexer',window.site.$main_edit);$selectLexer.chosen();$('label.blog-post input',window.site.$main_edit).on('change',function(){var $checkbox=$(this);var $label=$checkbox.parent();var $publish_date=$label.siblings('label.publish-date');if($checkbox.attr('checked')){$label.removeClass('is-not-blog-post').addClass('is-blog-post');$publish_date.show();}else{$label.addClass('is-not-blog-post').removeClass('is-blog-post');$publish_date.hide();}
return false;}).trigger('change');$('label.public input',window.site.$main_edit).on('change',function(){var $checkbox=$(this);var $label=$checkbox.parent();if($checkbox.attr('checked')){$label.removeClass('is-private').addClass('is-public');}else{$label.addClass('is-private').removeClass('is-public');}
return false;}).trigger('change');window.site.$main_edit.show();var $editor=$('div#editor',window.site.$main_edit);window.editor=CodeMirror($editor.get(0),{autofocus:true,fixedGutter:true,gutter:true,indentUnit:4,lineNumbers:true,matchBrackets:true,mode:that.guessCodeMirrorLexer($selectLexer.val()),value:that.model.get('code')});$selectLexer.change(function(){var $selectedLexer=$('option:selected',$selectLexer);window.editor.setOption('mode',that.guessCodeMirrorLexer($selectedLexer.val()));});window.editor.setSize('100%',$(window).height()-147);$('textarea, input',window.site.$main_edit).bind('keydown','esc',function(e){$(this).blur();return false;});$('button.delete',window.site.$main_edit).on('click',function(){if(confirm('Are you sure you want to delete this snipt?')){that.model.destroy();window.site.snipt_list.escapeUI(true);}
return false;});$('button.cancel',window.site.$main_edit).on('click',function(){window.site.snipt_list.escapeUI();return false;});$('button.save',window.site.$main_edit).on('click',function(){$('button.cancel').text('Close');that.save();return false;});$('button.save-and-close',window.site.$main_edit).on('click',function(){that.save();window.site.snipt_list.escapeUI();return false;});window.scrollTo(0,0);return false;},embed:function(){$('textarea',this.$embedModal).remove();window.ui_halted=true;this.$embedModalBody.append('<textarea class="raw"></textarea>');$textarea=$('textarea.raw',this.$embedModalBody).val('<script type="text/javascript" src="'+this.model.get('embed_url')+'"></script>');this.$embedModal.modal('show');$textarea.select();},embedFromClick:function(){this.embed();return false;},embedClose:function(){$('textarea',this.$embedModal).remove();},expand:function(){this.$container.toggleClass('expanded',100);this.$tags.toggleClass('expanded');this.select();return false;},fadeAndRemove:function(){var $toRemove=$(this.el);var $nextSnipt=$toRemove.next('article.snipt');window.$selected=false;$toRemove.fadeOut('fast',function(){$(this).remove();$nextSnipt.trigger('selectSnipt');});return false;},goToAuthor:function(){window.location=this.model.get('user').absolute_url;},guessCodeMirrorLexer:function(val){if(val==='html'){return'htmlmixed';}
if(val==='js')return'javascript';if(val==='rb')return'ruby';return val;},favoriteToggle:function(){var that=this;if(this.$el.hasClass('favorited')){$.ajax('/api/private/favorite/'+this.model.get('favorite_id')+'/',{type:'delete',success:function(){that.$el.removeClass('favorited');that.$favorite.text('Favorite');},headers:{'Authorization':'ApiKey '+window.user+':'+window.api_key}});}else{$.ajax('/api/private/favorite/',{data:'{"snipt": '+this.model.get('id')+'}',contentType:'application/json',type:'post',success:function(resp){that.$el.addClass('favorited');that.model.set({'favorite_id':resp.id},{'silent':true});that.$favorite.text('Favorited');},headers:{'Authorization':'ApiKey '+window.user+':'+window.api_key}});}
return false;},initLineNumbers:function(){var lines=$('span.special',this.$el);var that=this;$.each(lines,function(){var l=$(this);var num=l.text().trim();var url=that.model.get('absolute_url');l.replaceWith('<a href="'+url+'#line-'+num+'">'+num+'</a>');});},initLocalVars:function(){this.$aside=$('aside',this.$el);this.$container=$('div.container',this.$el);this.$copyModal=$('div.copy-modal',this.$el);this.$copyModalBody=$('div.modal-body',this.$copyModal);this.$embedModal=$('div.embed-modal',this.$el);this.$embedModalBody=$('div.modal-body',this.$embedModal);this.$favorite=$('a.favorite',this.$el);this.$h1=$('header h1 a',this.$el);this.$tags=$('section.tags ul',this.$aside);this.$copyModal.on('hidden',function(e){$(this).parent().trigger('copyClose');window.ui_halted=false;window.from_modal=true;});this.$embedModal.on('hidden',function(e){$(this).parent().trigger('embedClose');window.ui_halted=false;window.from_modal=true;});},next:function(){if(!window.ui_halted){nextSnipt=this.$el.next('article.snipt');if(nextSnipt.length){return nextSnipt.trigger('selectSnipt');}}},prev:function(){if(!window.ui_halted){prevSnipt=this.$el.prev('article.snipt');if(prevSnipt.length){return prevSnipt.trigger('selectSnipt');}}},remove:function(){return false;},render:function(){this.$el.html(this.template({snipt:this.model.toSafe()}));this.initLocalVars();this.initLineNumbers();if(this.model.get('blog_post')===true){this.$el.addClass('blog-post');}else{this.$el.removeClass('blog-post');}
if(this.model.get('public')===true){this.$el.removeClass('private-snipt');}else{this.$el.addClass('private-snipt');}
if(this.model.get('user').username===window.user){this.$el.addClass('editable');}else{this.$el.removeClass('editable');}
if(this.model.get('line_count')>8&&!window.detail){this.$el.addClass('expandable');}else{this.$el.removeClass('expandable');}
$('script#disqus').remove();window.site.$body.append('<script id="disqus" type="text/javascript">'+$('script#disqus-template').text()+'</script>');if(this.$el.attr('id')==='new-snipt'){this.$el.fadeIn('fast');this.$el.attr('id','snipt-'+this.model.get('id'));}
return this;},save:function(){$('button.save, button.save-and-close, button.delete, button.cancel',window.site.$main_edit).attr('disabled','disabled');that.model.save({'title':$('input#snipt_title').val(),'tags':$('label.tags textarea').val(),'tags_list':$('label.tags textarea').val(),'lexer':$('select[name="lexer"]').val(),'lexer_name':$('select[name="lexer"] option:selected').text(),'code':window.editor.getValue(),'blog_post':$('label.blog-post input').is(':checked'),'publish_date':$('label.publish-date input').val(),'public':$('label.public input').is(':checked')},{success:function(model,response){$('button.save, button.save-and-close, button.delete, button.cancel',window.site.$main_edit).removeAttr('disabled');},error:function(model,response){alert('There was a problem saving your snipt. We\'ve been notified. Sorry about that!');}});},select:function(fromClick){$('article.selected',window.site.snipt_list.$el).removeClass('selected');this.$el.addClass('selected');if(fromClick!==true){if(window.site.$snipts.index(this.$el)===0){window.scrollTo(0,0);}else{window.site.$html_body.animate({scrollTop:this.$el.offset().top-50},0);}}
window.$selected=this.$el;},selectFromClick:function(e){this.select(true);e.stopPropagation();window.site.$aside_nav.removeClass('open');}});Snipt.SniptListView=Backbone.View.extend({el:'section#snipts',initialize:function(opts){var that=this;opts.snipts.each(this.addExistingSnipt);this.keyboardShortcuts();var cmd;if(navigator.platform=='MacPPC'||navigator.platform=='MacIntel'){cmd='Cmd';}
else{cmd='Ctrl';}
$('span.cmd-ctrl').text(cmd);$('button#add-snipt').click(function(){that.addNewSnipt();});},addExistingSnipt:function(){var $el=$(this);var $created=$('li.created',$el);var $h1=$('header h1 a',$el);var $public=$('div.public',$el);var $blog_post=$('div.blog-post',$el);var $publish_date=$('div.publish-date',$el);var $user=$('li.author a',$el);var is_public=$public.text()==='True'?true:false;var is_blog_post=$blog_post.text()==='True'?true:false;var tag_lis=$('section.tags li',$el);var tags=[];for(var i=0;i<tag_lis.length;i++){var $tag=$('a',tag_lis.eq(i));tags[i]={name:$tag.text(),absolute_url:$tag.attr('href')};}
var is_pro=$user.siblings('span.pro').length?true:false;var data={code:$('textarea.raw',$el).text(),created:$created.attr('title'),created_formatted:$created.text(),embed_url:$('div.embed-url',$el).text(),absolute_url:$h1.attr('href'),favorite_id:$el.data('favorite-id'),id:parseInt($el.attr('id').replace('snipt-',''),0),key:$('div.key',$el).text(),lexer:$('div.lexer',$el).text(),lexer_name:$('div.lexer-name',$el).text(),line_count:parseInt($('div.line-count',$el).text(),0),modified:$('div.modified',$el).text(),resource_uri:$('div.resource-uri',$el).text(),slug:$('div.slug',$el).text(),stylized:$('div.stylized',$el).text(),tags:tags,publish_date:$publish_date.text(),tags_list:$('div.tags-list',$el).text(),title:$h1.text(),user:{absolute_url:$user.attr('href'),username:$user.text(),profile:{is_pro:is_pro}}};data['public']=is_public;data.blog_post=is_blog_post;var view=new Snipt.SniptView({el:this,model:new Snipt.SniptModel(data)});},addNewSnipt:function(){var $articleNewSnipt=$('article#new-snipt');if($articleNewSnipt.length===0){window.site.snipt_list.$el.prepend('<article id="new-snipt" class="hidden snipt"></article>');var data={id:'',code:'',tags:[],tags_list:'',title:'',lexer:'text',lexer_name:'Text only',new_from_js:true,user:{username:'',profile:{is_pro:window.user_is_pro}}};data['public']=false;data.blog_post=false;var newSniptView=new Snipt.SniptView({el:$('article#new-snipt'),model:new Snipt.SniptModel(data)});newSniptView.edit();}else{$articleNewSnipt.trigger('edit');}
return false;},escapeUI:function(destroyed){if(window.editing||destroyed){if(!window.site.$html.hasClass('detail')){window.site.$body.removeClass('detail');}
window.site.$main_edit.hide();window.site.$body.removeClass('editing');window.site.$main.show();window.editing=true;window.ui_halted=false;if(window.site.$snipts.index(window.$selected)===0){window.scrollTo(0,0);}else{window.site.$html_body.animate({scrollTop:window.$selected.offset().top-50},0);}
if(destroyed){window.$selected.trigger('fadeAndRemove');}}else{if(!window.ui_halted){if($selected){$selected.trigger('deselect');}
window.site.$aside_nav.removeClass('open');}}},keyboardShortcuts:function(){var that=this;$selected=window.selected;$document=$(document);$document.bind('keydown','j',function(){if(!window.ui_halted){if(!$selected){window.site.$snipts.eq(0).trigger('selectSnipt');}else{$selected.trigger('next');}}});$document.bind('keydown','k',function(){if(!window.ui_halted){if(!$selected){window.site.$snipts.eq(0).trigger('selectSnipt');}else{$selected.trigger('prev');}}});$document.bind('keydown','c',function(e){if(!window.ui_halted&&!window.blog_post){if($selected){e.preventDefault();$selected.trigger('copyRaw');}}});$document.bind('keydown','Ctrl+e',function(){if(!window.ui_halted){if($selected){if($selected.hasClass('editable')){$selected.trigger('edit');}}}});$document.bind('keydown','Ctrl+backspace',function(){if(!window.ui_halted||window.editing){if($selected){if($selected.hasClass('editable')){if(confirm('Are you sure you want to delete this snipt?')){$selected.trigger('destroy');window.site.snipt_list.escapeUI(true);}}}}});$document.bind('keydown','Ctrl+del',function(){if(!window.ui_halted||window.editing){if($selected){if($selected.hasClass('editable')){if(confirm('Are you sure you want to delete this snipt?')){$selected.trigger('destroy');window.site.snipt_list.escapeUI(true);}}}}});$document.bind('keydown','Alt+n',function(){if(!window.ui_halted){that.addNewSnipt();}});$document.bind('keydown','Ctrl+n',function(){if(!window.ui_halted){that.addNewSnipt();}});$document.bind('keydown','Ctrl+s',function(){if(window.editing){if($selected){if($selected.hasClass('editable')){$('button.save').click();}}}});$document.bind('keydown','Ctrl+c',function(){if(window.editing){if($selected){if($selected.hasClass('editable')){$('button.save-and-close').click();}}}});$document.bind('keydown','esc',function(){that.escapeUI();});$document.bind('keydown','g',function(){if(!window.ui_halted){if(window.$selected){window.$selected.trigger('deselect');}
window.scrollTo(0,0);}});$document.bind('keydown','Shift+g',function(){if(!window.ui_halted){if(window.$selected){window.$selected.trigger('deselect');}
window.scrollTo(0,document.body.scrollHeight);}});$document.bind('keydown','n',function(){if(!window.ui_halted){var $anc=$('li.next a');if($anc.length){if($anc.attr('href')!=='#'){window.location=$anc.attr('href');}}}});$document.bind('keydown','e',function(){if(!window.ui_halted){if($selected){if($selected.hasClass('expandable')){$selected.trigger('expand');}}}});$document.bind('keydown','u',function(){if(!window.ui_halted){if($selected){$selected.trigger('goToAuthor');}}});$document.bind('keydown','p',function(){if(!window.ui_halted){var $anc=$('li.prev a');if($anc.length){if($anc.attr('href')!=='#'){window.location=$anc.attr('href');}}}});$document.bind('keydown','v',function(e){if(!window.ui_halted&&!window.blog_post){if($selected){e.preventDefault();$selected.trigger('embed');}}});$document.bind('keydown','o',function(){if(!window.ui_halted){if($selected){$selected.trigger('detail');}}});$document.bind('keydown','return',function(){if(!window.ui_halted){if($selected){$selected.trigger('detail');}}});}});})(snipt.module('snipt'));var CodeMirror=function(){function e(r,i){function sn(e){return e>=0&&e<Ct.size}function un(e){return E(Ct,e)}function an(e,t){Wt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function fn(e){var t={line:0,ch:0};Ln(t,{line:Ct.size-1,ch:un(Ct.size-1).text.length},lt(e),t,t),Ft=!0}function ln(e){var t=[];return Ct.iter(0,Ct.size,function(e){t.push(e.text)}),t.join(e||"\n")}function cn(e){K.scrollTop&&(bt.scrollTop+=K.scrollTop,K.scrollTop=0);if(Dt!=bt.scrollTop||Pt!=K.scrollLeft)Dt=bt.scrollTop,Pt=K.scrollLeft,tr([]),s.fixedGutter&&(st.style.left=K.scrollLeft+"px"),s.onScroll&&s.onScroll(on)}function hn(e){function d(e){if(i=="single")ur(n,e);else if(i=="double"){var t=yr(e);rt(e,h)?ur(t.from,p):ur(h,t.to)}else i=="triple"&&(rt(e,h)?ur(p,hr({line:e.line,ch:0})):ur(h,hr({line:e.line+1,ch:0})))}function v(e){var t=ei(e,!0);if(t&&!nt(t,u)){Lt||Tn(),u=t,d(t),Ft=!1;var n=er();if(t.line>=n.to||t.line<n.from)a=setTimeout(pi(function(){v(e)}),150)}}function m(e){clearTimeout(a);var t=ei(e);t&&d(t),L(e),Jn(),Ft=!0,g(),l()}or(D(e,"shiftKey"));for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==G&&t!=Y)return;for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==ot)return s.onGutterClick&&s.onGutterClick(on,at(ot.childNodes,t)+$t,e),L(e);var n=ei(e);switch(_(e)){case 3:j&&ti(e);return;case 2:n&&lr(n.line,n.ch,!0),setTimeout(Jn,20),L(e);return}if(!n){M(e)==K&&L(e);return}Lt||Tn();var r=+(new Date),i="single";if(_t&&_t.time>r-400&&nt(_t.pos,n))i="triple",L(e),setTimeout(Jn,20),br(n.line);else if(Mt&&Mt.time>r-400&&nt(Mt.pos,n)){i="double",_t={time:r,pos:n},L(e);var o=yr(n);ur(o.from,o.to)}else Mt={time:r,pos:n};var u=n,a;if(s.dragDrop&&J&&!s.readOnly&&!nt(At.from,At.to)&&!rt(n,At.from)&&!rt(At.to,n)&&i=="single"){U&&(K.draggable=!0);function f(t){U&&(K.draggable=!1),Ht=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(L(t),lr(n.line,n.ch,!0),Jn())}var l=P(document,"mouseup",pi(f),!0),c=P(K,"drop",pi(f),!0);Ht=!0,K.dragDrop&&K.dragDrop();return}L(e),i=="single"&&lr(n.line,n.ch,!0);var h=At.from,p=At.to,g=P(document,"mousemove",pi(function(e){clearTimeout(a),L(e),!F&&!_(e)?m(e):v(e)}),!0),l=P(document,"mouseup",pi(m),!0)}function pn(e){for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==ot)return L(e);L(e)}function dn(e){if(s.onDragEvent&&s.onDragEvent(on,k(e)))return;e.preventDefault();var t=ei(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){function r(e,n){var r=new FileReader;r.onload=function(){o[n]=r.result,++u==i&&(t=hr(t),pi(function(){var e=jn(o.join(""),t,t);ur(t,e)})())},r.readAsText(e)}var i=n.length,o=Array(i),u=0;for(var a=0;a<i;++a)r(n[a],a)}else{if(Ht&&!rt(t,At.from)&&!rt(At.to,t))return;try{var o=e.dataTransfer.getData("Text");o&&di(function(){var e=At.from,n=At.to;ur(t,t),Ht&&jn("",e,n),Fn(o),Jn()})}catch(e){}}}function vn(e){var t=Rn();e.dataTransfer.setData("Text",t);if(j||z||W){var n=document.createElement("img");n.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(n,0,0)}}function mn(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=Ot;try{s.readOnly&&(jt=!0),t&&(Ot=null),e(on)}catch(r){if(r!=B)throw r;return!1}finally{Ot=n,jt=!1}return!0}function gn(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(wn),n&&!c(e)&&(wn=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,on):n)},50));var r=ht[D(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;D(e,"altKey")&&(r="Alt-"+r),D(e,"ctrlKey")&&(r="Ctrl-"+r),D(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return D(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return mn(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return mn(e)},u):i=l(r,s.extraKeys,s.keyMap,mn,u),o&&(i=!1),i&&(L(e),ni(),F&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function yn(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return mn(e,!0)});return n&&(L(e),ni()),n}function En(e){Lt||Tn(),F&&e.keyCode==27&&(e.returnValue=!1),Un&&Vn()&&(Un=!1);if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;var t=D(e,"keyCode");or(t==16||D(e,"shiftKey"));var r=gn(e);W&&(bn=r?t:null,!r&&t==88&&D(e,n?"metaKey":"ctrlKey")&&Fn(""))}function Sn(e){Un&&Vn();if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;var t=D(e,"keyCode"),n=D(e,"charCode");if(W&&t==bn){bn=null,L(e);return}if((W&&(!e.which||e.which<10)||V)&&gn(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&Nt.electricChars&&s.smartIndent&&!s.readOnly&&Nt.electricChars.indexOf(r)>-1&&setTimeout(pi(function(){Er(At.to.line,"smart")}),75);if(yn(e,r))return;Wn()}function xn(e){if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;D(e,"keyCode")==16&&(Ot=null)}function Tn(){if(s.readOnly=="nocursor")return;Lt||(s.onFocus&&s.onFocus(on),Lt=!0,K.className.search(/\bCodeMirror-focused\b/)==-1&&(K.className+=" CodeMirror-focused"),zt||$n(!0)),zn(),ni()}function Nn(){Lt&&(s.onBlur&&s.onBlur(on),Lt=!1,Qt&&pi(function(){Qt&&(Qt(),Qt=null)})(),K.className=K.className.replace(" CodeMirror-focused","")),clearInterval(Tt),setTimeout(function(){Lt||(Ot=null)},150)}function Cn(e){return e>0&&e<1?1:e>-1&&e<0?-1:Math.round(e)}function kn(e){var t=0,n=0;if(e.type=="DOMMouseScroll"){var r=-e.detail*8;e.axis==e.HORIZONTAL_AXIS?t=r:e.axis==e.VERTICAL_AXIS&&(n=r)}else e.wheelDeltaX!==undefined&&e.wheelDeltaY!==undefined?(t=e.wheelDeltaX/3,n=e.wheelDeltaY/3):e.wheelDelta!==undefined&&(n=e.wheelDelta/3);var i=!1;t=Cn(t),n=Cn(n);if(t>0&&K.scrollLeft>0||t<0&&K.scrollLeft+K.clientWidth<K.scrollWidth)K.scrollLeft-=t,i=!0;if(n>0&&bt.scrollTop>0||n<0&&bt.scrollTop+bt.clientHeight<bt.scrollHeight)bt.scrollTop-=n,i=!0;i&&O(e)}function Ln(e,t,n,r,i){if(jt)return;if(tn){var o=[];Ct.iter(e.line,t.line+1,function(e){o.push(e.text)}),tn.addChange(e.line,n.length,o);while(tn.done.length>s.undoDepth)tn.done.shift()}_n(e,t,n,r,i)}function An(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;Ct.iter(s.start,u,function(e){o.push(e.text)}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:ut(o[o.length-1],s.old[s.old.length-1])};_n({line:s.start,ch:0},{line:u-1,ch:un(u-1).text.length},s.old,a,a)}Ft=!0,t.push(r)}function On(){An(tn.done,tn.undone)}function Mn(){An(tn.undone,tn.done)}function _n(e,t,n,r,i){function T(e){return e<=Math.min(t.line,t.line+y)?e:e+y}if(jt)return;var o=!1,u=Gt.length;s.lineWrapping||Ct.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Wt=!0;var a=t.line-e.line,f=un(e.line),l=un(t.line);if(e.ch==0&&t.ch==0&&n[n.length-1]==""){var c=[],h=null;e.line?(h=un(e.line-1),h.fixMarkEnds(l)):l.fixMarkStarts();for(var p=0,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],h));a&&Ct.remove(e.line,a,Xt),c.length&&Ct.insert(e.line,c)}else if(f==l)if(n.length==1)f.replace(e.ch,t.ch,n[0]);else{l=f.split(t.ch,n[n.length-1]),f.replace(e.ch,null,n[0]),f.fixMarkEnds(l);var c=[];for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));c.push(l),Ct.insert(e.line+1,c)}else if(n.length==1)f.replace(e.ch,null,n[0]),l.replace(null,t.ch,""),f.append(l),Ct.remove(e.line+1,a,Xt);else{var c=[];f.replace(e.ch,null,n[0]),l.replace(null,t.ch,n[n.length-1]),f.fixMarkEnds(l);for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));a>1&&Ct.remove(e.line+1,a-1,Xt),Ct.insert(e.line+1,c)}if(s.lineWrapping){var v=Math.max(5,K.clientWidth/Gr()-3);Ct.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/v)||1;t!=e.height&&an(e,t)})}else Ct.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(Gt=t,u=t.length,Zt=!0,o=!1)}),o&&(Yt=!0);var m=[],y=n.length-a-1;for(var p=0,b=kt.length;p<b;++p){var w=kt[p];w<e.line?m.push(w):w>t.line&&m.push(w+y)}var E=e.line+Math.min(n.length,500);ui(e.line,E),m.push(E),kt=m,fi(100),qt.push({from:e.line,to:t.line+1,diff:y});var S={from:e,to:t,text:n};if(Rt){for(var x=Rt;x.next;x=x.next);x.next=S}else Rt=S;ar(hr(r),hr(i),T(At.from.line),T(At.to.line))}function Dn(){var e=Ct.height*Jr()+2*Yr();return e-1>K.offsetHeight?e:!1}function Pn(e){var t=Dn();bt.style.display=t?"block":"none",t&&(wt.style.height=t+"px",bt.style.height=K.offsetHeight+"px",e!=null&&(bt.scrollTop=e)),Y.style.top=Vt*Jr()-bt.scrollTop+"px"}function Hn(){var e=document.createElement("div"),t=document.createElement("div");e.className="CodeMirror-scrollbar",e.style.cssText="position: absolute; left: -9999px; height: 100px;",t.className="CodeMirror-scrollbar-inner",t.style.height="200px",e.appendChild(t),document.body.appendChild(e);var n=e.offsetWidth<=1;return document.body.removeChild(e),n}function Bn(){var e=0;Gt="",Zt=!0,Ct.iter(0,Ct.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,Gt=n)}),Yt=!1}function jn(e,t,n){function r(r){if(rt(r,t))return r;if(!rt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=hr(t),n?n=hr(n):n=t,e=lt(e);var i;return In(e,t,n,function(e){return i=e,{from:r(At.from),to:r(At.to)}}),i}function Fn(e,t){In(lt(e),At.from,At.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:At.from,to:At.from}:{from:At.from,to:e}})}function In(e,t,n,r){var i=e.length==1?e[0].length+t.ch:e[e.length-1].length,s=r({line:t.line+e.length-1,ch:i});Ln(t,n,e,s.from,s.to)}function qn(e,t,n){var r=e.line,i=t.line;if(r==i)return un(r).text.slice(e.ch,t.ch);var s=[un(r).text.slice(e.ch)];return Ct.iter(r+1,i,function(e){s.push(e.text)}),s.push(un(i).text.slice(0,t.ch)),s.join(n||"\n")}function Rn(e){return qn(At.from,At.to,e)}function zn(){if(Un)return;St.set(s.pollInterval,function(){li(),Vn(),Lt&&zn(),ci()})}function Wn(){function t(){li();var n=Vn();!n&&!e?(e=!0,St.set(60,t)):(Un=!1,zn()),ci()}var e=!1;Un=!0,St.set(20,t)}function Vn(){if(zt||!Lt||ct(X)||s.readOnly)return!1;var e=X.value;if(e==Xn)return!1;Ot=null;var t=0,n=Math.min(Xn.length,e.length);while(t<n&&Xn[t]==e[t])++t;return t<Xn.length?At.from={line:At.from.line,ch:At.from.ch-(Xn.length-t)}:Bt&&nt(At.from,At.to)&&(At.to={line:At.to.line,ch:Math.min(un(At.to.line).text.length,At.to.ch+(e.length-t))}),Fn(e.slice(t),"end"),e.length>1e3?X.value=Xn="":Xn=e,!0}function $n(e){nt(At.from,At.to)?e&&(Xn=X.value=""):(Xn="",X.value=Rn(),tt(X))}function Jn(){s.readOnly!="nocursor"&&X.focus()}function Kn(){var e=vt.getBoundingClientRect();if(F&&e.top==e.bottom)return;var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&Qn()}function Qn(){var e=Gn();return Yn(e.x,e.y,e.x,e.yBot)}function Gn(){var e=Ur(At.inverted?At.from:At.to),t=s.lineWrapping?Math.min(e.x,pt.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function Yn(e,t,n,r){var i=Zn(e,t,n,r),o=!1;i.scrollLeft!=null&&(K.scrollLeft=i.scrollLeft,o=!0),i.scrollTop!=null&&(bt.scrollTop=i.scrollTop,o=!0),o&&s.onScroll&&s.onScroll(on)}function Zn(e,t,n,r){var i=Zr(),o=Yr();t+=o,r+=o,e+=i,n+=i;var u=K.clientHeight,a=bt.scrollTop,f={},l=K.scrollHeight,c=t<o+10,h=r+o>l-10;t<a?f.scrollTop=c?0:Math.max(0,t):r>a+u&&(f.scrollTop=(h?l:r)-u);var p=K.clientWidth,d=K.scrollLeft,v=s.fixedGutter?st.clientWidth:0,m=e<v+i+10;return e<d+v||m?(m&&(e=0),f.scrollLeft=Math.max(0,e-10-v)):n>p+d-3&&(f.scrollLeft=n+10-p),f}function er(e){var t=Jr(),n=(e!=null?e:bt.scrollTop)-Yr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+K.clientHeight)/t);return{from:x(Ct,r),to:x(Ct,i)}}function tr(e,t,n){function d(){var e=yt.firstChild,t=!1;return Ct.iter($t,Jt,function(n){if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(an(n,r),Wt=t=!0)}e=e.nextSibling}),t}if(!K.clientWidth){$t=Jt=Vt=0;return}var r=er(n);if(e!==!0&&e.length==0&&r.from>$t&&r.to<Jt){Pn(n);return}var i=Math.max(r.from-100,0),o=Math.min(Ct.size,r.to+100);$t<i&&i-$t<20&&(i=$t),Jt>o&&Jt-o<20&&(o=Math.min(Ct.size,Jt));var u=e===!0?[]:nr([{from:$t,to:Jt,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==$t&&o==Jt){Pn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Jr(),h=st.style.display;yt.style.display="none",rr(i,o,u),yt.style.display=st.style.display="";var p=i!=$t||o!=Jt||Kt!=K.clientHeight+c;p&&(Kt=K.clientHeight+c),$t=i,Jt=o,Vt=T(Ct,i);if(yt.childNodes.length!=Jt-$t)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(Jt-$t)+" nodes="+yt.childNodes.length);if(s.lineWrapping){d();var v=Dn(),m=v?"block":"none";bt.style.display!=m&&(bt.style.display=m,wt.style.height=v+"px",d())}return st.style.display=h,(p||Wt)&&ir()&&s.lineWrapping&&d()&&ir(),Pn(n),sr(),!t&&s.onUpdate&&s.onUpdate(on),!0}function nr(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function rr(e,t,n){if(!n.length)yt.innerHTML="";else{function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var i=0,s=yt.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=yt.firstChild,f=e,h=document.createElement("div");Ct.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=h.innerHTML="<pre></pre>";else{var t="<pre"+(e.className?' class="'+e.className+'"':"")+">"+e.getHTML(Nr)+"</pre>";e.bgClassName&&(t='<div style="position: relative"><pre class="'+e.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+t+"</div>")}h.innerHTML=t,yt.insertBefore(h.firstChild,s)}else s=s.nextSibling;++f})}function ir(){if(!s.gutter&&!s.lineNumbers)return;var e=Y.offsetHeight,t=K.clientHeight;st.style.height=(e-t<2?t:e)+"px";var n=[],r=$t,i;Ct.iter($t,Math.max(Jt,$t+1),function(e){if(e.hidden)n.push("<pre></pre>");else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o="\u00a0"),n.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",o);for(var u=1;u<e.height;++u)n.push("<br/>&#160;");n.push("</pre>"),t||(i=r)}++r}),st.style.display="none",ot.innerHTML=n.join("");if(i!=null&&s.lineNumbers){var o=ot.childNodes[i-$t],u=String(Ct.size).length,a=et(o.firstChild),f="";while(a.length+f.length<u)f+="\u00a0";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}st.style.display="";var l=Math.abs((parseInt(pt.style.marginLeft)||0)-st.offsetWidth)>2;return pt.style.marginLeft=st.offsetWidth+"px",Wt=!1,l}function sr(){var e=nt(At.from,At.to),t=Ur(At.from,!0),n=e?t:Ur(At.to,!0),r=At.inverted?t:n,i=Jr(),o=Z(C),u=Z(yt);A.style.top=Math.max(0,Math.min(K.offsetHeight,r.y+u.top-o.top))+"px",A.style.left=Math.max(0,Math.min(K.offsetWidth,r.x+u.left-o.left))+"px";if(e)vt.style.top=r.y+"px",vt.style.left=(s.lineWrapping?Math.min(r.x,pt.offsetWidth):r.x)+"px",vt.style.display="",gt.style.display="none";else{var a=t.y==n.y,f="",l=pt.clientWidth||pt.offsetWidth,c=pt.clientHeight||pt.offsetHeight;function h(e,t,n,r){var i=R?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f+='<div class="CodeMirror-selected" style="position: absolute; left: '+e+"px; top: "+t+"px; "+i+"; height: "+r+'px"></div>'}if(At.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(At.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!At.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),gt.innerHTML=f,vt.style.display="none",gt.style.display=""}}function or(e){e?Ot=Ot||(At.inverted?At.to:At.from):Ot=null}function ur(e,t){var n=Ot&&hr(Ot);n&&(rt(n,e)?e=n:rt(t,n)&&(t=n)),ar(e,t),It=!0}function ar(e,t,n,r){mr=null,n==null&&(n=At.from.line,r=At.to.line);if(nt(At.from,e)&&nt(At.to,t))return;if(rt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=fr(e,n,At.from.ch);o?e=o:Br(e.line,!1)}t.line!=r&&(t=fr(t,r,At.to.ch)),nt(e,t)?At.inverted=!1:nt(e,At.to)?At.inverted=!1:nt(t,At.from)&&(At.inverted=!0);if(s.autoClearEmptyLines&&nt(At.from,At.to)){var u=At.inverted?e:t;if(u.line!=At.from.line&&At.from.line<Ct.size){var a=un(At.from.line);/^\s+$/.test(a.text)&&setTimeout(pi(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=S(a);jn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}At.from=e,At.to=t,Ut=!0}function fr(e,t,n){function r(t){var r=e.line+t,i=t==1?Ct.size:-1;while(r!=i){var o=un(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=un(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function lr(e,t,n){var r=hr({line:e,ch:t||0});(n?ur:ar)(r,r)}function cr(e){return Math.max(0,Math.min(e,Ct.size-1))}function hr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Ct.size)return{line:Ct.size-1,ch:un(Ct.size-1).text.length};var t=e.ch,n=un(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function pr(e,t){function o(){for(var t=r+e,n=e<0?-1:Ct.size;t!=n;t+=e){var i=un(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=At.inverted?At.from:At.to,r=n.line,i=n.ch,s=un(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(ft(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function dr(e,t){var n=e<0?At.from:At.to;if(Ot||nt(At.from,At.to))n=pr(e,t);lr(n.line,n.ch,!0)}function vr(e,t){nt(At.from,At.to)?e<0?jn("",pr(e,t),At.to):jn("",At.from,pr(e,t)):jn("",At.from,At.to),It=!0}function gr(e,t){var n=0,r=Ur(At.inverted?At.from:At.to,!0);mr!=null&&(r.x=mr),t=="page"?n=Math.min(K.clientHeight,window.innerHeight||document.documentElement.clientHeight):t=="line"&&(n=Jr());var i=zr(r.x,r.y+n*e+2);t=="page"&&(bt.scrollTop+=Ur(i,!0).y-r.y),lr(i.line,i.ch,!0),mr=r.x}function yr(e){var t=un(e.line).text,n=e.ch,r=e.ch,i=ft(t.charAt(n<t.length?n:n-1))?ft:function(e){return!ft(e)};while(n>0&&i(t.charAt(n-1)))--n;while(r<t.length&&i(t.charAt(r)))++r;return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function br(e){ur({line:e,ch:0},hr({line:e+1,ch:0}))}function wr(e){if(nt(At.from,At.to))return Er(At.from.line,e);var t=At.to.line-(At.to.ch?0:1);for(var n=At.from.line;n<=t;++n)Er(n,e)}function Er(e,t){t||(t="add");if(t=="smart")if(!Nt.indent)t="prev";else var n=oi(e);var r=un(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=Nt.indent(n,r.text.slice(o.length),r.text),u==B&&(t="prev")),t=="prev"?e?u=un(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i,f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";while(l<u)++l,f+=" ";jn(f,{line:e,ch:0},{line:e,ch:o.length})}function Sr(){Nt=e.getMode(s,s.mode),Ct.iter(0,Ct.size,function(e){e.stateAfter=null}),kt=[0],fi()}function xr(){var e=s.gutter||s.lineNumbers;st.style.display=e?"":"none",e?Wt=!0:yt.parentNode.style.marginLeft=0}function Tr(e,t){if(s.lineWrapping){C.className+=" CodeMirror-wrap";var n=K.clientWidth/Gr()-3;Ct.iter(0,Ct.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&an(e,t)}),pt.style.width=G.style.width="",mt.style.left=""}else C.className=C.className.replace(" CodeMirror-wrap",""),Gt="",Zt=!0,Ct.iter(0,Ct.size,function(e){e.height!=1&&!e.hidden&&an(e,1),e.text.length>Gt.length&&(Gt=e.text)});qt.push({from:0,to:Ct.size})}function Nr(e){var t=s.tabSize-e%s.tabSize,n=en[t];if(n)return n;for(var r='<span class="cm-tab">',i=0;i<t;++i)r+=" ";return en[t]={html:r+"</span>",width:t}}function Cr(){K.className=K.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function kr(){var e=a[s.keyMap].style;C.className=C.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function Lr(){this.set=[]}function Ar(e,t,n){function i(e,t,n,i){un(e).addMark(new v(t,n,i,r))}e=hr(e),t=hr(t);var r=new Lr;if(!rt(e,t))return r;if(e.line==t.line)i(e.line,e.ch,t.ch,n);else{i(e.line,e.ch,null,n);for(var s=e.line+1,o=t.line;s<o;++s)i(s,null,null,n);i(t.line,null,t.ch,n)}return qt.push({from:e.line,to:t.line+1}),r}function Or(e){e=hr(e);var t=new m(e.ch);return un(e.line).addMark(t),t}function Mr(e){e=hr(e);var t=[],n=un(e.line).marked;if(!n)return t;for(var r=0,i=n.length;r<i;++r){var s=n[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker||s)}return t}function _r(e,t,n){return typeof e=="number"&&(e=un(cr(e))),e.gutterMarker={text:t,style:n},Wt=!0,e}function Dr(e){typeof e=="number"&&(e=un(cr(e))),e.gutterMarker=null,Wt=!0}function Pr(e,t){var n=e,r=e;return typeof e=="number"?r=un(cr(e)):n=S(e),n==null?null:t(r,n)?(qt.push({from:n,to:n+1}),r):null}function Hr(e,t,n){return Pr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function Br(e,t){return Pr(e,function(e,n){if(e.hidden!=t){e.hidden=t;if(!s.lineWrapping){var r=e.text;t&&r.length==Gt.length?Yt=!0:!t&&r.length>Gt.length&&(Gt=r,Yt=!1)}an(e,t?0:1);var i=At.from.line,o=At.to.line;if(t&&(i==n||o==n)){var u=i==n?fr({line:i,ch:0},i,0):At.from,a=o==n?fr({line:o,ch:0},o,0):At.to;if(!a)return;ar(u,a)}return Wt=!0}})}function jr(e){if(typeof e=="number"){if(!sn(e))return null;var t=e;e=un(e);if(!e)return null}else{var t=S(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function Fr(e){return dt.innerHTML="<pre><span>x</span></pre>",dt.firstChild.firstChild.firstChild.nodeValue=e,dt.firstChild.firstChild.offsetWidth||10}function Ir(e,t){function i(e){return Rr(n,e).left}if(t<=0)return 0;var n=un(e),r=n.text,s=0,o=0,u=r.length,a,f=Math.min(u,Math.ceil(t/Gr()));for(;;){var l=i(f);if(!(l<=t&&f<u)){a=l,u=f;break}f=Math.min(u,Math.ceil(f*1.2))}if(t>a)return u;f=Math.floor(u*.8),l=i(f),l<t&&(s=f,o=l);for(;;){if(u-s<=1)return a-t>t-o?s:u;var c=Math.ceil((s+u)/2),h=i(c);h>t?(u=c,a=h):(s=c,o=h)}}function Rr(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&Q.test(e.text.slice(t-1,t+1));dt.innerHTML="<pre>"+e.getHTML(Nr,t,qr,n)+"</pre>";var r=document.getElementById(qr),i=r.offsetTop,o=r.offsetLeft;if(F&&i==0&&o==0){var u=document.createElement("span");u.innerHTML="x",r.parentNode.insertBefore(u,r.nextSibling),i=u.offsetTop}return{top:i,left:o}}function Ur(e,t){var n,r=Jr(),i=r*(T(Ct,e.line)-(t?Vt:0));if(e.ch==0)n=0;else{var o=Rr(un(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function zr(e,t){function c(e){var t=Rr(u,e);if(f){var r=Math.round(t.top/n);return Math.max(0,t.left+(r-l)*K.clientWidth)}return t.left}t<0&&(t=0);var n=Jr(),r=Gr(),i=Vt+Math.floor(t/n),o=x(Ct,i);if(o>=Ct.size)return{line:Ct.size-1,ch:un(Ct.size-1).text.length};var u=un(o),a=u.text,f=s.lineWrapping,l=f?i-T(Ct,o):0;if(e<=0&&l==0)return{line:o,ch:0};var h=0,p=0,d=a.length,v,m=Math.min(d,Math.ceil((e+l*K.clientWidth*.9)/r));for(;;){var g=c(m);if(!(g<=e&&m<d)){v=g,d=m;break}m=Math.min(d,Math.ceil(m*1.2))}if(e>v)return{line:o,ch:d};m=Math.floor(d*.8),g=c(m),g<e&&(h=m,p=g);for(;;){if(d-h<=1)return{line:o,ch:v-e>e-p?h:d};var y=Math.ceil((h+d)/2),b=c(y);b>e?(d=y,v=b):(h=y,p=b)}}function Wr(e){var t=Ur(e,!0),n=Z(pt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Jr(){if($r==null){$r="<pre>";for(var e=0;e<49;++e)$r+="x<br/>";$r+="x</pre>"}var t=yt.clientHeight;return t==Vr?Xr:(Vr=t,dt.innerHTML=$r,Xr=dt.firstChild.offsetHeight/50||1,dt.innerHTML="",Xr)}function Gr(){return K.clientWidth==Qr?Kr:(Qr=K.clientWidth,Kr=Fr("x"))}function Yr(){return pt.offsetTop}function Zr(){return pt.offsetLeft}function ei(e,t){var n=Z(K,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>K.clientWidth||i-n.top>K.clientHeight))return null;var s=Z(pt,!0);return zr(r-s.left,i-s.top)}function ti(e){function o(){var e=lt(X.value).join("\n");e!=i&&!s.readOnly&&pi(Fn)(e,"end"),A.style.position="relative",X.style.cssText=r,q&&(bt.scrollTop=n),zt=!1,$n(!0),zn()}var t=ei(e),n=bt.scrollTop;if(!t||W)return;(nt(At.from,At.to)||rt(t,At.from)||!rt(t,At.to))&&pi(lr)(t.line,t.ch);var r=X.style.cssText;A.style.position="absolute",X.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",zt=!0;var i=X.value=Rn();Jn(),tt(X);if(j){O(e);var u=P(window,"mouseup",function(){u(),setTimeout(o,20)},!0)}else setTimeout(o,50)}function ni(){clearInterval(Tt);var e=!0;vt.style.visibility="",Tt=setInterval(function(){vt.style.visibility=(e=!e)?"":"hidden"},650)}function ii(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=ri[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=At.inverted?At.from:At.to,n=un(t.line),r=t.ch-1,i=r>=0&&ri[n.text.charAt(r)]||ri[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,Ct.size):Math.max(-1,l-100);l!=c;l+=u){var n=un(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Ar({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Ar({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=pi(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):Qt=w}function si(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=un(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function oi(e){var t=si(e),n=t&&un(t-1).stateAfter;return n?n=h(Nt,n):n=p(Nt),Ct.iter(t,e,function(e){e.highlight(Nt,n,s.tabSize),e.stateAfter=h(Nt,n)}),t<e&&qt.push({from:t,to:e}),e<Ct.size&&!un(e).stateAfter&&kt.push(e),n}function ui(e,t){var n=oi(e);Ct.iter(e,t,function(e){e.highlight(Nt,n,s.tabSize),e.stateAfter=h(Nt,n)})}function ai(){var e=+(new Date)+s.workTime,t=kt.length;while(kt.length){if(!un($t).stateAfter)var n=$t;else var n=kt.pop();if(n>=Ct.size)continue;var r=si(n),i=r&&un(r-1).stateAfter;i?i=h(Nt,i):i=p(Nt);var o=0,u=Nt.compareStates,a=!1,f=r,l=!1;Ct.iter(f,Ct.size,function(t){var r=t.stateAfter;if(+(new Date)>e)return kt.push(f),fi(s.workDelay),a&&qt.push({from:n,to:f+1}),l=!0;var c=t.highlight(Nt,i,s.tabSize);c&&(a=!0),t.stateAfter=h(Nt,i);var p=null;if(u){var d=r&&u(r,i);d!=B&&(p=!!d)}p==null&&(c!==!1||!r?o=0:++o>3&&(!Nt.indent||Nt.indent(r,"")==Nt.indent(i,""))&&(p=!0));if(p)return!0;++f});if(l)return;a&&qt.push({from:n,to:f+1})}t&&s.onHighlightComplete&&s.onHighlightComplete(on)}function fi(e){if(!kt.length)return;xt.set(e,pi(ai))}function li(){Ft=It=Rt=null,qt=[],Ut=!1,Xt=[]}function ci(){Yt&&Bn();if(Zt&&!s.lineWrapping){var e=mt.offsetWidth,t=Fr(Gt);mt.style.left=t+"px",pt.style.minWidth=t+e+"px",Zt=!1}var n,r;if(Ut){var i=Gn();n=Zn(i.x,i.y,i.x,i.yBot)}qt.length?r=tr(qt,!0,n?n.scrollTop:null):(Ut&&sr(),Wt&&ir()),n&&Qn(),Ut&&(Kn(),ni()),Lt&&!zt&&(Ft===!0||Ft!==!1&&Ut)&&$n(It),Ut&&s.matchBrackets&&setTimeout(pi(function(){Qt&&(Qt(),Qt=null),nt(At.from,At.to)&&ii(!1)}),20);var o=Ut,u=Xt;Rt&&s.onChange&&on&&s.onChange(on,Rt),o&&s.onCursorActivity&&s.onCursorActivity(on);for(var a=0;a<u.length;++a)u[a](on);r&&s.onUpdate&&s.onUpdate(on)}function pi(e){return function(){hi++||li();try{var t=e.apply(this,arguments)}finally{--hi||ci()}return t}}function di(e){tn.startCompound();try{return e()}finally{tn.endCompound()}}var s={},d=e.defaults;for(var y in d)d.hasOwnProperty(y)&&(s[y]=(i&&i.hasOwnProperty(y)?i:d)[y]);var C=document.createElement("div");C.className="CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""),C.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scrollbar"><div class="CodeMirror-scrollbar-inner"></div></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><pre class="CodeMirror-cursor" style="visibility: hidden">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',r.appendChild?r.appendChild(C):r(C);var A=C.firstChild,X=A.firstChild,K=C.lastChild,G=K.firstChild,Y=G.firstChild,st=Y.firstChild,ot=st.firstChild,pt=st.nextSibling.firstChild,dt=pt.firstChild,vt=dt.nextSibling,mt=vt.nextSibling,gt=mt.nextSibling,yt=gt.nextSibling,bt=A.nextSibling,wt=bt.firstChild;Cr(),kr(),t&&(X.style.width="0px"),U||(K.draggable=!0),pt.style.outline="none",s.tabindex!=null&&(X.tabIndex=s.tabindex),s.autofocus&&Jn(),!s.gutter&&!s.lineNumbers&&(st.style.display="none"),V&&(A.style.height="1px",A.style.position="absolute"),$?bt.className+=Hn()?" cm-sb-overlap":" cm-sb-nonoverlap":I&&(bt.className+=" cm-sb-ie7");try{Fr("x")}catch(Et){throw Et.message.match(/runtime/i)&&(Et=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),Et}var St=new H,xt=new H,Tt,Nt,Ct=new w([new b([new g("")])]),kt,Lt;Sr();var At={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},Ot,Mt,_t,Dt=0,Pt=0,Ht,Bt=!1,jt=!1,Ft,It,qt,Rt,Ut,zt,Wt,Xt,Vt=0,$t=0,Jt=0,Kt=0,Qt,Gt="",Yt=!1,Zt=!0,en={};pi(function(){fn(s.value||""),Ft=!1})();var tn=new N;P(K,"mousedown",pi(hn)),P(K,"dblclick",pi(pn)),P(pt,"selectstart",L),j||P(K,"contextmenu",ti),P(K,"scroll",cn),P(bt,"scroll",cn),P(bt,"mousedown",function(){Lt&&setTimeout(Jn,0)}),P(K,"mousewheel",kn),P(K,"DOMMouseScroll",kn),P(window,"resize",function(){tr(!0)}),P(X,"keyup",pi(xn)),P(X,"input",Wn),P(X,"keydown",pi(En)),P(X,"keypress",pi(Sn)),P(X,"focus",Tn),P(X,"blur",Nn);if(s.dragDrop){P(K,"dragstart",vn);function nn(e){if(s.onDragEvent&&s.onDragEvent(on,k(e)))return;O(e)}P(K,"dragenter",nn),P(K,"dragover",nn),P(K,"drop",pi(dn))}P(K,"paste",function(){Jn(),Wn()}),P(X,"paste",Wn),P(X,"cut",pi(function(){s.readOnly||Fn("")})),V&&P(G,"mouseup",function(){document.activeElement==X&&X.blur(),Jn()});var rn;try{rn=document.activeElement==X}catch(Et){}rn||s.autofocus?setTimeout(Tn,20):Nn();var on=C.CodeMirror={getValue:ln,setValue:pi(fn),getSelection:Rn,replaceSelection:pi(Fn),focus:function(){window.focus(),Jn(),Tn(),Wn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?Sr():e=="readOnly"&&t=="nocursor"?(Nn(),X.blur()):e=="readOnly"&&!t?$n(!0):e=="theme"?Cr():e=="lineWrapping"&&n!=t?pi(Tr)():e=="tabSize"?tr(!0):e=="keyMap"&&kr();if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme")xr(),tr(!0)},getOption:function(e){return s[e]},undo:pi(On),redo:pi(Mn),indentLine:pi(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),sn(e)&&Er(e,t)}),indentSelection:pi(wr),historySize:function(){return{undo:tn.done.length,redo:tn.undone.length}},clearHistory:function(){tn=new N},setHistory:function(e){tn=new N,tn.done=e.done,tn.undone=e.undone},getHistory:function(){return tn.time=0,{done:tn.done.concat([]),undone:tn.undone.concat([])}},matchBrackets:pi(function(){ii(!0)}),getTokenAt:pi(function(e){return e=hr(e),un(e.line).getTokenAt(Nt,oi(e.line),e.ch)}),getStateAfter:function(e){return e=cr(e==null?Ct.size-1:e),oi(e+1)},cursorCoords:function(e,t){return e==null&&(e=At.inverted),this.charCoords(e?At.from:At.to,t)},charCoords:function(e,t){return e=hr(e),t=="local"?Ur(e,!1):t=="div"?Ur(e,!0):Wr(e)},coordsChar:function(e){var t=Z(pt);return zr(e.x-t.left,e.y-t.top)},markText:pi(Ar),setBookmark:Or,findMarksAt:Mr,setMarker:pi(_r),clearMarker:pi(Dr),setLineClass:pi(Hr),hideLine:pi(function(e){return Br(e,!0)}),showLine:pi(function(e){return Br(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!sn(e))return null;e=un(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:jr,addWidget:function(e,t,n,r,i){e=Ur(hr(e));var s=e.yBot,o=e.x;t.style.position="absolute",G.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(K.offsetHeight,Ct.height*Jr()),a=Math.max(G.clientWidth,pt.clientWidth)-Zr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Yr()+"px",t.style.left=t.style.right="",i=="right"?(o=G.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(G.clientWidth-t.offsetWidth)/2),t.style.left=o+Zr()+"px"),n&&Yn(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Ct.size},clipPos:hr,getCursor:function(e){return e==null&&(e=At.inverted),it(e?At.from:At.to)},somethingSelected:function(){return!nt(At.from,At.to)},setCursor:pi(function(e,t,n){t==null&&typeof e.line=="number"?lr(e.line,e.ch,n):lr(e,t,n)}),setSelection:pi(function(e,t,n){(n?ur:ar)(hr(e),hr(t||e))}),getLine:function(e){if(sn(e))return un(e).text},getLineHandle:function(e){if(sn(e))return un(e)},setLine:pi(function(e,t){sn(e)&&jn(t,{line:e,ch:0},{line:e,ch:un(e).text.length})}),removeLine:pi(function(e){sn(e)&&jn("",{line:e,ch:0},hr({line:e+1,ch:0}))}),replaceRange:pi(jn),getRange:function(e,t,n){return qn(hr(e),hr(t),n)},triggerOnKeyDown:pi(En),execCommand:function(e){return u[e](on)},moveH:pi(dr),deleteH:pi(vr),moveV:pi(gr),toggleOverwrite:function(){Bt?(Bt=!1,vt.className=vt.className.replace(" CodeMirror-overwrite","")):(Bt=!0,vt.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Ct.iter(0,Ct.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),hr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Ct.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(K.scrollLeft=e),t!=null&&(bt.scrollTop=t),tr([])},getScrollInfo:function(){return{x:K.scrollLeft,y:bt.scrollTop,height:bt.scrollHeight,width:K.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(C.style.width=n(e)),t!=null&&(K.style.height=n(t))},operation:function(e){return pi(e)()},compoundChange:function(e){return di(e)},refresh:function(){tr(!0,null,Dt),bt.scrollHeight>Dt&&(bt.scrollTop=Dt)},getInputField:function(){return X},getWrapperElement:function(){return C},getScrollerElement:function(){return K},getGutterElement:function(){return st}},bn=null,wn,Un=!1,Xn="",mr=null;Lr.prototype.clear=pi(function(){var e=Infinity,t=-Infinity;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;if(!s||!i.parent)continue;var o=S(i);e=Math.min(e,o),t=Math.max(t,o);for(var u=0;u<s.length;++u)s[u].marker==this&&s.splice(u--,1)}e!=Infinity&&qt.push({from:e,to:t+1})}),Lr.prototype.find=function(){var e,t;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;for(var o=0;o<s.length;++o){var u=s[o];if(u.marker==this)if(u.from!=null||u.to!=null){var a=S(i);a!=null&&(u.from!=null&&(e={line:a,ch:u.from}),u.to!=null&&(t={line:a,ch:u.to}))}}}return{from:e,to:t}};var qr="CodeMirror-temp-"+Math.floor(Math.random()*16777215).toString(16),Xr,Vr,$r,Kr,Qr=0,ri={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},hi=0;for(var vi in o)o.propertyIsEnumerable(vi)&&!on.propertyIsEnumerable(vi)&&(on[vi]=o[vi]);return on}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=ht[D(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function h(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function p(e,t,n){return e.startState?e.startState(t,n):!0}function d(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function v(e,t,n,r){this.from=e,this.to=t,this.style=n,this.marker=r}function m(e){this.from=e,this.to=e,this.line=null}function g(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function y(e,t,n,r){for(var i=0,s=0,o=0;s<t;i+=2){var u=n[i],a=s+u.length;o==0?(a>e&&r.push(u.slice(e-s,Math.min(u.length,t-s)),n[i+1]),a>=e&&(o=1)):o==1&&(a>t?r.push(u.slice(0,t-s),n[i+1]):r.push(u,n[i+1])),s=a}}function b(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function w(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function E(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function S(e){if(e.parent==null)return null;var t=e.parent,n=at(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function x(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function T(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function N(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function C(){O(this)}function k(e){return e.stop||(e.stop=C),e}function L(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function A(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){L(e),A(e)}function M(e){return e.target||e.srcElement}function _(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}function D(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function P(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function H(){this.id=null}function G(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function Y(e){return e.currentStyle?e.currentStyle:window.getComputedStyle(e,null)}function Z(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n}function et(e){return e.textContent||e.innerText||e.nodeValue||""}function tt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function nt(e,t){return e.line==t.line&&e.ch==t.ch}function rt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function it(e){return{line:e.line,ch:e.ch}}function ot(e){return st.textContent=e,st.innerHTML}function ut(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function at(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function ft(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(e){return e}};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!nt(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.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","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},a.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","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},a["default"]=n?a.macDefault:a.pcDefault,a.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"},e.fromTextArea=function(t,n){function r(){t.value=u.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),n.autofocus==null&&t.getAttribute("autofocus")!=null&&(n.autofocus=!0);if(t.form){var i=P(t.form,"submit",r,!0);if(typeof t.form.submit=="function"){var s=t.form.submit;function o(){r(),t.form.submit=s,t.form.submit(),t.form.submit=o}t.form.submit=o}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return u.save=r,u.getTextArea=function(){return t},u.toTextArea=function(){r(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(i(),typeof t.form.submit=="function"&&(t.form.submit=s))},u},e.copyState=h,e.startState=p,d.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(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return G(this.string,this.start,this.tabSize)},indentation:function(){return G(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&t!==!1&&(this.pos+=i[0].length),i}function r(e){return n?e.toLowerCase():e}if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=d,v.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=at(this.marker.set,e);t>-1&&this.marker.set.splice(t,1)},split:function(e,t){if(this.to<=e&&this.to!=null)return null;var n=this.from<e||this.from==null?null:this.from-e+t,r=this.to==null?null:this.to-e+t;return new v(n,r,this.style,this.marker)},dup:function(){return new v(null,null,this.style,this.marker)},clipTo:function(e,t,n,r,i){e&&r>this.from&&(r<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=t&&(this.from=Math.max(r,this.from)+i),n&&(t<this.to||this.to==null)&&(t>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>t&&(this.to=r<this.to?this.to+i:t)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},m.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,r,i){(e||t<this.from)&&(n||r>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(e){return!1},find:function(){return!this.line||!this.line.parent?null:{line:S(this.line),ch:this.from}},clear:function(){if(this.line){var e=at(this.line.marked,this);e!=-1&&this.line.marked.splice(e,1),this.line=null}}},g.inheritMarks=function(e,t){var n=new g(e),r=t&&t.marked;if(r)for(var i=0;i<r.length;++i)if(r[i].to==null&&r[i].style){var s=n.marked||(n.marked=[]),o=r[i],u=o.dup();s.push(u),u.attach(n)}return n},g.prototype={replace:function(e,t,n){var r=[],i=this.marked,s=t==null?this.text.length:t;y(0,e,this.styles,r),n&&r.push(n,null),y(s,this.text.length,this.styles,r),this.styles=r,this.text=this.text.slice(0,e)+n+this.text.slice(s),this.stateAfter=null;if(i){var o=n.length-(s-e);for(var u=0;u<i.length;++u){var a=i[u];a.clipTo(e==null,e||0,t==null,s,o),a.isDead()&&(a.detach(this),i.splice(u--,1))}}},split:function(e,t){var n=[t,null],r=this.marked;y(e,this.text.length,this.styles,n);var i=new g(t+this.text.slice(e),n);if(r)for(var s=0;s<r.length;++s){var o=r[s],u=o.split(e,t.length);u&&(i.marked||(i.marked=[]),i.marked.push(u),u.attach(i),u==o&&r.splice(s--,1))}return i},append:function(e){var t=this.text.length,n=e.marked,r=this.marked;this.text+=e.text,y(0,e.text.length,e.styles,this.styles);if(r)for(var i=0;i<r.length;++i)r[i].to==null&&(r[i].to=t);if(n&&n.length){r||(this.marked=r=[]);e:for(var i=0;i<n.length;++i){var s=n[i];if(!s.from)for(var o=0;o<r.length;++o){var u=r[o];if(u.to==t&&u.sameSet(s)){u.to=s.to==null?null:s.to+t,u.isDead()&&(u.detach(this),n.splice(i--,1));continue e}}r.push(s),s.attach(this),s.from+=t,s.to!=null&&(s.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked;if(!t)return;e:for(var r=0;r<t.length;++r){var i=t[r],s=i.to==null;if(s&&n)for(var o=0;o<n.length;++o){var u=n[o];if(!u.sameSet(i)||u.from!=null)continue;if(i.from==this.text.length&&u.to==0){n.splice(o,1),t.splice(r--,1);continue e}s=!1;break}s&&(i.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(!e)return;for(var t=0;t<e.length;++t)e[t].from==null&&(e[t].from=0)},addMark:function(e){e.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,n){var r=new d(this.text,n),i=this.styles,s=0,o=!1,u=i[0],a;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var f=e.token(r,t),l=this.text.slice(r.start,r.pos);r.start=r.pos,s&&i[s-1]==f?i[s-2]+=l:l&&(!o&&(i[s+1]!=f||s&&i[s-2]!=a)&&(o=!0),i[s++]=l,i[s++]=f,a=u,u=i[s]);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}return i.length!=s&&(i.length=s,o=!0),s&&i[s-2]!=a&&(o=!0),o||(i.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n){var r=this.text,i=new d(r);while(i.pos<n&&!i.eol()){i.start=i.pos;var s=e.token(i,t)}return{start:i.start,end:i.pos,string:i.current(),className:s||null,state:t}},indentation:function(e){return G(this.text,null,e)},getHTML:function(e,t,n,r){function u(t,n){if(!t)return;s&&F&&t.charAt(0)==" "&&(t="\u00a0"+t.slice(1)),s=!1;if(t.indexOf(" ")==-1){o+=t.length;var r=ot(t)}else{var r="";for(var u=0;;){var a=t.indexOf(" ",u);if(a==-1){r+=ot(t.slice(u)),o+=t.length-u;break}o+=a-u;var f=e(o);r+=ot(t.slice(u,a))+f.html,o+=f.width,u=a+1}}n?i.push('<span class="',n,'">',r,"</span>"):i.push(r)}function v(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var i=[],s=!0,o=0,a=u;if(t!=null){var f=0,l='<span id="'+n+'">';a=function(e,n){var s=e.length;if(t>=f&&t<f+s){t>f&&(u(e.slice(0,t-f),n),r&&i.push("<wbr>")),i.push(l);var o=t-f;u(W?e.slice(o,o+1):e.slice(o),n),i.push("</span>"),W&&u(e.slice(o+1),n),t--,f+=s}else f+=s,u(e,n),f==t&&f==d?i.push(l+(j?"&#x200b;":" ")+"</span>"):f>t+10&&/\s/.test(e)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.marked,d=h.length;if(!h&&t==null)a(" ");else if(!p||!p.length)for(var m=0,g=0;g<d;m+=2){var y=c[m],b=c[m+1],w=y.length;g+w>d&&(y=y.slice(0,d-g)),g+=w,a(y,v(b))}else{var E=0,m=0,S="",b,x=0,T=p[0].from||0,N=[],C=0;function k(){var e;while(C<p.length&&((e=p[C]).from==E||e.from==null))e.style!=null&&N.push(e),++C;T=C<p.length?p[C].from:Infinity;for(var t=0;t<N.length;++t){var n=N[t].to;n==null&&(n=Infinity),n==E?N.splice(t--,1):T=Math.min(n,T)}}var L=0;while(E<d){T==E&&k();var A=Math.min(d,T);for(;;){if(S){var O=E+S.length,M=b;for(var _=0;_<N.length;++_)M=(M?M+" ":"")+N[_].style;a(O>A?S.slice(0,A-E):S,M);if(O>=A){S=S.slice(A-E),E=A;break}E=O}S=c[m++],b=v(c[m++])}}}return i.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},b.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},w.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new b(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new b(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new w(t);if(!e.parent){var r=new w(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=at(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},N.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=this.done[this.done.length-1],s=i&&i[i.length-1],o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=O,e.e_preventDefault=L,e.e_stopPropagation=A,e.connect=P,H.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var B=e.Pass={toString:function(){return"CodeMirror.Pass"}},j=/gecko\/\d{7}/i.test(navigator.userAgent),F=/MSIE \d/.test(navigator.userAgent),I=/MSIE [1-7]\b/.test(navigator.userAgent),q=/MSIE [1-8]\b/.test(navigator.userAgent),R=F&&document.documentMode==5,U=/WebKit\//.test(navigator.userAgent),z=/Chrome\//.test(navigator.userAgent),W=/Opera\//.test(navigator.userAgent),X=/Apple Computer/.test(navigator.vendor),V=/KHTML\//.test(navigator.userAgent),$=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent),J=function(){if(q)return!1;var e=document.createElement("div");return"draggable"in e||"dragDrop"in e}(),K=function(){var e=document.createElement("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),Q=/^$/;j?Q=/$'/:X?Q=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:z&&(Q=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var st=document.createElement("pre");ot("a")=="\na"?ot=function(e){return st.textContent=e,st.innerHTML.slice(1)}:ot(" ")!=" "&&(ot=function(e){return st.innerHTML="",st.appendChild(document.createTextNode(e)),st.innerHTML}),e.htmlEscape=ot;var lt="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=lt;var ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ht={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",109:"-",107:"=",127:"Delete",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"};return e.keyNames=ht,function(){for(var e=0;e<10;e++)ht[e+48]=String(e);for(var e=65;e<=90;e++)ht[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ht[e+111]=ht[e+63235]="F"+e}(),e}();CodeMirror.defineMode("clike",function(e,t){function c(e,t){var n=e.next();if(u[n]){var a=u[n](e,t);if(a!==!1)return a}if(n=='"'||n=="'")return t.tokenize=h(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return l=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if(n=="/"){if(e.eat("*"))return t.tokenize=p,p(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(f.test(n))return e.eatWhile(f),"operator";e.eatWhile(/[\w\$_]/);var c=e.current();return r.propertyIsEnumerable(c)?(s.propertyIsEnumerable(c)&&(l="newstatement"),"keyword"):i.propertyIsEnumerable(c)?(s.propertyIsEnumerable(c)&&(l="newstatement"),"builtin"):o.propertyIsEnumerable(c)?"atom":"variable"}function h(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!a)n.tokenize=null;return"string"}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=null;break}n=r=="*"}return"comment"}function d(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function v(e,t,n){return e.context=new d(e.indented,t,n,null,e.context)}function m(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var n=e.indentUnit,r=t.keywords||{},i=t.builtin||{},s=t.blockKeywords||{},o=t.atoms||{},u=t.hooks||{},a=t.multiLineStrings,f=/[+\-*&%=<>!?|\/]/,l;return{startState:function(e){return{tokenize:null,context:new d((e||0)-n,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0);if(e.eatSpace())return null;l=null;var r=(t.tokenize||c)(e,t);if(r=="comment"||r=="meta")return r;n.align==null&&(n.align=!0);if(l!=";"&&l!=":"||n.type!="statement")if(l=="{")v(t,e.column(),"}");else if(l=="[")v(t,e.column(),"]");else if(l=="(")v(t,e.column(),")");else if(l=="}"){while(n.type=="statement")n=m(t);n.type=="}"&&(n=m(t));while(n.type=="statement")n=m(t)}else l==n.type?m(t):(n.type=="}"||n.type=="top"||n.type=="statement"&&l=="newstatement")&&v(t,e.column(),"statement");else m(t);return t.startOfLine=!1,r},indent:function(e,t){if(e.tokenize!=c&&e.tokenize!=null)return 0;var r=e.context,i=t&&t.charAt(0);r.type=="statement"&&i=="}"&&(r=r.prev);var s=i==r.type;return r.type=="statement"?r.indented+(i=="{"?0:n):r.align?r.column+(s?0:1):r.indented+(s?0:n)},electricChars:"{}"}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return t.startOfLine?(e.skipToEnd(),"meta"):!1}function r(e,t){var n;while((n=e.next())!=null)if(n=='"'&&!e.eat('"')){t.tokenize=null;break}return"string"}var t="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";CodeMirror.defineMIME("text/x-csrc",{name:"clike",keywords:e(t),blockKeywords:e("case do else for if switch while struct"),atoms:e("null"),hooks:{"#":n}}),CodeMirror.defineMIME("text/x-c++src",{name:"clike",keywords:e(t+" asm dynamic_cast namespace reinterpret_cast try bool explicit new "+"static_cast typeid catch operator template typename class friend private "+"this using const_cast inline public throw virtual delete mutable protected "+"wchar_t"),blockKeywords:e("catch class do else finally for if struct switch try while"),atoms:e("true false null"),hooks:{"#":n}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:e("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:e("catch class do else finally for if switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:e("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:e("catch class do else finally for foreach if struct switch try while"),builtin:e("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=r,r(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),CodeMirror.defineMIME("text/x-scala",{name:"clike",keywords:e("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:e("catch class do else finally for forSome if match switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}})}(),CodeMirror.defineMode("clojure",function(e,t){function h(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function y(e,t,n){this.indent=e,this.type=t,this.prev=n}function b(e,t,n){e.indentStack=new y(t,n,e.indentStack)}function w(e){e.indentStack=e.indentStack.prev}function E(e,t){if(e==="0"&&"x"==t.peek().toLowerCase())return t.eat("x"),t.eatWhile(g.hex),!0;if(e=="+"||e=="-")t.eat(g.sign),e=t.next();return g.digit.test(e)?(t.eat(e),t.eatWhile(g.digit),"."==t.peek()&&(t.eat("."),t.eatWhile(g.digit)),"e"==t.peek().toLowerCase()&&(t.eat(g.exponent),t.eat(g.sign),t.eatWhile(g.digit)),!0):!1}var n="builtin",r="comment",i="string",s="tag",o="atom",u="number",a="bracket",f="keyword",l=2,c=1,p=h("true false nil"),d=h("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),v=h("* *1 *2 *3 *agent* *allow-unresolved-vars* *assert *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - / < <= = == > >= accessor aclone agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? extend extend-protocol extend-type extends? extenders false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reify reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq"),m=h("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),g={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-fA-F]/,sign:/[+-]/,exponent:/[eE]/,keyword_char:/[^\s\(\[\;\)\]]/,basic:/[\w\$_\-]/,lang_keyword:/[\w*+!\-_?:\/]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){t.indentStack==null&&e.sol()&&(t.indentation=e.indentation());if(e.eatSpace())return null;var s=null;switch(t.mode){case"string":var c,h=!1;while((c=e.next())!=null){if(c=='"'&&!h){t.mode=!1;break}h=!h&&c=="\\"}s=i;break;default:var y=e.next();if(y=='"')t.mode="string",s=i;else if(y=="'"&&!g.digit_or_colon.test(e.peek()))s=o;else if(y==";")e.skipToEnd(),s=r;else if(E(y,e))s=u;else if(y=="("||y=="["){var S="",x=e.column();if(y=="(")while((letter=e.eat(g.keyword_char))!=null)S+=letter;S.length>0&&m.propertyIsEnumerable(S)?b(t,x+l,y):(e.eatSpace(),e.eol()||e.peek()==";"?b(t,x+1,y):b(t,x+e.current().length,y)),e.backUp(e.current().length-1),s=a}else if(y==")"||y=="]")s=a,t.indentStack!=null&&t.indentStack.type==(y==")"?"(":"[")&&w(t);else{if(y==":")return e.eatWhile(g.lang_keyword),o;e.eatWhile(g.basic),d&&d.propertyIsEnumerable(e.current())?s=f:v&&v.propertyIsEnumerable(e.current())?s=n:p&&p.propertyIsEnumerable(e.current())?s=o:s=null}}return s},indent:function(e,t){return e.indentStack==null?e.indentation:e.indentStack.indent}}}),CodeMirror.defineMIME("text/x-clojure","clojure"),CodeMirror.defineMode("coffeescript",function(e){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function y(e,n){if(e.sol()){var c=n.scopes[0].offset;if(e.eatSpace()){var h=e.indentation();return h>c?"indent":h<c?"dedent":null}c>0&&S(e,n)}if(e.eatSpace())return null;var m=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return n.tokenize=w,n.tokenize(e,n);if(m==="#")return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var y=!1;e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(y=!0),e.match(/^-?\d+\.\d*/)&&(y=!0),e.match(/^-?\.\d+/)&&(y=!0);if(y)return e.peek()=="."&&e.backUp(1),"number";var E=!1;e.match(/^-?0x[0-9a-f]+/i)&&(E=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(E=!0),e.match(/^-?0(?![\dx])/i)&&(E=!0);if(E)return"number"}if(e.match(d))return n.tokenize=b(e.current(),"string"),n.tokenize(e,n);if(e.match(v)){if(e.current()!="/"||e.match(/^.*\//,!1))return n.tokenize=b(e.current(),"string-2"),n.tokenize(e,n);e.backUp(1)}return e.match(u)||e.match(o)?"punctuation":e.match(s)||e.match(r)||e.match(l)?"operator":e.match(i)?"punctuation":e.match(g)?"atom":e.match(p)?"keyword":e.match(a)?"variable":e.match(f)?"property":(e.next(),t)}function b(n,r){var i=n.length==1;return function(o,u){while(!o.eol()){o.eatWhile(/[^'"\/\\]/);if(o.eat("\\")){o.next();if(i&&o.eol())return r}else{if(o.match(n))return u.tokenize=y,r;o.eat(/['"\/]/)}}return i&&(e.mode.singleLineStringErrors?r=t:u.tokenize=y),r}}function w(e,t){while(!e.eol()){e.eatWhile(/[^#]/);if(e.match("###")){t.tokenize=y;break}e.eatWhile("#")}return"comment"}function E(t,n,r){r=r||"coffee";var i=0;if(r==="coffee"){for(var s=0;s<n.scopes.length;s++)if(n.scopes[s].type==="coffee"){i=n.scopes[s].offset+e.indentUnit;break}}else i=t.column()+t.current().length;n.scopes.unshift({offset:i,type:r})}function S(e,t){if(t.scopes.length==1)return;if(t.scopes[0].type==="coffee"){var n=e.indentation(),r=-1;for(var i=0;i<t.scopes.length;++i)if(n===t.scopes[i].offset){r=i;break}if(r===-1)return!0;while(t.scopes[0].offset!==n)t.scopes.shift();return!1}return t.scopes.shift(),!1}function x(e,n){var r=n.tokenize(e,n),i=e.current();if(i===".")return r=n.tokenize(e,n),i=e.current(),r==="variable"?"variable":t;i==="return"&&(n.dedent+=1),((i==="->"||i==="=>")&&!n.lambda&&n.scopes[0].type=="coffee"&&e.peek()===""||r==="indent")&&E(e,n);var s="[({".indexOf(i);return s!==-1&&E(e,n,"])}".slice(s,s+1)),c.exec(i)&&E(e,n),i=="then"&&S(e,n),r==="dedent"&&S(e,n)?t:(s="])}".indexOf(i),s!==-1&&S(e,n)?t:(n.dedent>0&&e.eol()&&n.scopes[0].type=="coffee"&&(n.scopes.length>1&&n.scopes.shift(),n.dedent-=1),r))}var t="error",r=new RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),i=new RegExp("^[\\(\\)\\[\\]\\{\\},:`=;\\.]"),s=new RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),o=new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),u=new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),a=new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),f=new RegExp("^(@|this.)[_A-Za-z$][_A-Za-z$0-9]*"),l=n(["and","or","not","is","isnt","in","instanceof","typeof"]),c=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],h=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],p=n(c.concat(h));c=n(c);var d=new RegExp("^('{3}|\"{3}|['\"])"),v=new RegExp("^(/{3}|/)"),m=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],g=n(m),T={startState:function(e){return{tokenize:y,scopes:[{offset:e||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=x(e,t);return t.lastToken={style:n,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){return e.tokenize!=y?0:e.scopes[0].offset}};return T}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript"),CodeMirror.defineMode("css",function(e){function r(e,t){return n=t,e}function i(e,t){var n=e.next();if(n=="@")return e.eatWhile(/[\w\\\-]/),r("meta",e.current());if(n=="/"&&e.eat("*"))return t.tokenize=s,s(e,t);if(n=="<"&&e.eat("!"))return t.tokenize=o,o(e,t);if(n!="=")return n!="~"&&n!="|"||!e.eat("=")?n=='"'||n=="'"?(t.tokenize=u(n),t.tokenize(e,t)):n=="#"?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):n=="!"?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)?(e.eatWhile(/[\w.%]/),r("number","unit")):/[,.+>*\/]/.test(n)?r(null,"select-op"):/[;{}:\[\]]/.test(n)?r(null,n):(e.eatWhile(/[\w\\\-]/),r("variable","variable")):r(null,"compare");r(null,"compare")}function s(e,t){var n=!1,s;while((s=e.next())!=null){if(n&&s=="/"){t.tokenize=i;break}n=s=="*"}return r("comment","comment")}function o(e,t){var n=0,s;while((s=e.next())!=null){if(n>=2&&s==">"){t.tokenize=i;break}n=s=="-"?n+1:0}return r("comment","comment")}function u(e){return function(t,n){var s=!1,o;while((o=t.next())!=null){if(o==e&&!s)break;s=!s&&o=="\\"}return s||(n.tokenize=i),r("string","string")}}var t=e.indentUnit,n;return{startState:function(e){return{tokenize:i,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t),i=t.stack[t.stack.length-1];if(n=="hash"&&i!="rule")r="string-2";else if(r=="variable")if(i=="rule")r="number";else if(!i||i=="@media{")r="tag";return i=="rule"&&/^[\{\};]$/.test(n)&&t.stack.pop(),n=="{"?i=="@media"?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):n=="}"?t.stack.pop():n=="@media"?t.stack.push("@media"):i=="{"&&n!="comment"&&t.stack.push("rule"),r},indent:function(e,n){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="rule"?2:1),e.baseIndent+r*t},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("diff",function(){var e={"+":"tag","-":"string","@":"meta"};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||n===0)return t.skipToEnd(),("error "+(e[t.string.charAt(0)]||"")).replace(/ $/,"");var r=e[t.peek()]||t.skipToEnd();return n===-1?t.skipToEnd():t.pos=n,r}}}),CodeMirror.defineMIME("text/x-diff","diff"),CodeMirror.defineMode("ecl",function(e){function t(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return t.startOfLine?(e.skipToEnd(),"meta"):!1}function r(e,t){var n;while((n=e.next())!=null)if(n=='"'&&!e.eat('"')){t.tokenize=null;break}return"string"}function m(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(n=='"'||n=="'")return t.tokenize=g(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return v=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if(n=="/"){if(e.eat("*"))return t.tokenize=y,y(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(n))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_]/);var i=e.current().toLowerCase();if(s.propertyIsEnumerable(i))return l.propertyIsEnumerable(i)&&(v="newstatement"),"keyword";if(o.propertyIsEnumerable(i))return l.propertyIsEnumerable(i)&&(v="newstatement"),"variable";if(u.propertyIsEnumerable(i))return l.propertyIsEnumerable(i)&&(v="newstatement"),"variable-2";if(a.propertyIsEnumerable(i))return l.propertyIsEnumerable(i)&&(v="newstatement"),"variable-3";if(f.propertyIsEnumerable(i))return l.propertyIsEnumerable(i)&&(v="newstatement"),"builtin";var p=i.length-1;while(p>=0&&(!isNaN(i[p])||i[p]=="_"))--p;if(p>0){var m=i.substr(0,p+1);if(a.propertyIsEnumerable(m))return l.propertyIsEnumerable(m)&&(v="newstatement"),"variable-3"}return c.propertyIsEnumerable(i)?"atom":null}function g(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!p)n.tokenize=m;return"string"}}function y(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=m;break}n=r=="*"}return"comment"}function b(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function w(e,t,n){return e.context=new b(e.indented,t,n,null,e.context)}function E(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var i=e.indentUnit,s=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),o=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),u=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),a=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),f=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),l=t("catch class do else finally for if switch try while"),c=t("true false null"),h={"#":n},p,d=/[+\-*&%=<>!?|\/]/,v;return{startState:function(e){return{tokenize:null,context:new b((e||0)-i,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0);if(e.eatSpace())return null;v=null;var r=(t.tokenize||m)(e,t);if(r=="comment"||r=="meta")return r;n.align==null&&(n.align=!0);if(v!=";"&&v!=":"||n.type!="statement")if(v=="{")w(t,e.column(),"}");else if(v=="[")w(t,e.column(),"]");else if(v=="(")w(t,e.column(),")");else if(v=="}"){while(n.type=="statement")n=E(t);n.type=="}"&&(n=E(t));while(n.type=="statement")n=E(t)}else v==n.type?E(t):(n.type=="}"||n.type=="top"||n.type=="statement"&&v=="newstatement")&&w(t,e.column(),"statement");else E(t);return t.startOfLine=!1,r},indent:function(e,t){if(e.tokenize!=m&&e.tokenize!=null)return 0;var n=e.context,r=t&&t.charAt(0);n.type=="statement"&&r=="}"&&(n=n.prev);var s=r==n.type;return n.type=="statement"?n.indented+(r=="{"?0:i):n.align?n.column+(s?0:1):n.indented+(s?0:i)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-ecl","ecl"),CodeMirror.defineMIME("text/x-erlang","erlang"),CodeMirror.defineMode("erlang",function(e,t){function n(e,t,n){n=="record"?e.context="record":e.context=!1,n!="whitespace"&&n!="comment"&&(e.lastToken=t.current());switch(n){case"atom":return"atom";case"attribute":return"attribute";case"builtin":return"builtin";case"comment":return"comment";case"fun":return"meta";case"function":return"tag";case"guard":return"property";case"keyword":return"keyword";case"macro":return"variable-2";case"number":return"number";case"operator":return"operator";case"record":return"bracket";case"string":return"string";case"type":return"def";case"variable":return"variable";case"error":return"error";case"separator":return null;case"open_paren":return null;case"close_paren":return null;default:return null}}function S(e,t){return-1<t.indexOf(e)}function x(e,t){var n=e.start,r=t.length;if(r<=n){var i=e.string.slice(n-r,n);return i==t}return!1}function T(e,t){if(e.eatSpace())return n(t,e,"whitespace");if((P(t).token==""||P(t).token==".")&&e.peek()=="-"){e.next();if(e.eat(p)&&e.eatWhile(g))return S(e.current(),r)?n(t,e,"type"):n(t,e,"attribute");e.backUp(1)}var h=e.next();if(h=="%")return e.skipToEnd(),n(t,e,"comment");if(h=="?")return e.eatWhile(g),n(t,e,"macro");if(h=="#")return e.eatWhile(g),n(t,e,"record");if(h=="$")return e.next()=="\\"&&(e.eatWhile(m)||e.next()),n(t,e,"string");if(h=="'")return L(e)?n(t,e,"atom"):n(t,e,"error");if(h=='"')return k(e)?n(t,e,"string"):n(t,e,"error");if(d.test(h))return e.eatWhile(g),n(t,e,"variable");if(p.test(h)){e.eatWhile(g);if(e.peek()=="/")return e.next(),e.eatWhile(v)?n(t,e,"fun"):(e.backUp(1),n(t,e,"atom"));var T=e.current();return S(T,i)?(H(t,e),n(t,e,"keyword")):e.peek()=="("?S(T,c)&&(!x(e,":")||x(e,"erlang:"))?n(t,e,"builtin"):n(t,e,"function"):S(T,l)?n(t,e,"guard"):S(T,o)?n(t,e,"operator"):e.peek()==":"?T=="erlang"?n(t,e,"builtin"):n(t,e,"function"):n(t,e,"atom")}return v.test(h)?(e.eatWhile(v),e.eat("#")?e.eatWhile(v):(e.eat(".")&&e.eatWhile(v),e.eat(/[eE]/)&&(e.eat(/[-+]/),e.eatWhile(v))),n(t,e,"number")):N(e,b,a)?(H(t,e),n(t,e,"open_paren")):N(e,w,f)?(H(t,e),n(t,e,"close_paren")):C(e,E,s)?(t.context==0&&H(t,e),n(t,e,"separator")):C(e,y,u)?n(t,e,"operator"):n(t,e,null)}function N(e,t,n){if(e.current().length==1&&t.test(e.current())){e.backUp(1);while(t.test(e.peek())){e.next();if(S(e.current(),n))return!0}e.backUp(e.current().length-1)}return!1}function C(e,t,n){if(e.current().length==1&&t.test(e.current())){while(t.test(e.peek()))e.next();while(0<e.current().length){if(S(e.current(),n))return!0;e.backUp(1)}e.next()}return!1}function k(e){return A(e,'"',"\\")}function L(e){return A(e,"'","\\")}function A(e,t,n){while(!e.eol()){var r=e.next();if(r==t)return!0;r==n&&e.next()}return!1}function O(e){this.token=e?e.current():"",this.column=e?e.column():0,this.indent=e?e.indentation():0}function M(t,n){var r=e.indentUnit,i=["after","catch"],s=P(t).token,o=_(n,/[^a-z]/);return S(s,a)?P(t).column+s.length:s=="."||s==""?0:s=="->"?o=="end"?P(t,2).column:P(t,2).token=="fun"?P(t,2).column+r:P(t).indent+r:S(o,i)?P(t).indent:P(t).column+r}function _(e,t){var n=e.match(t);return n?e.slice(0,n.index):e}function D(e){return e.tokenStack.pop()}function P(e,t){var n=e.tokenStack.length,r=t?t:1;return n<r?new O:e.tokenStack[n-r]}function H(e,t){var n=t.current(),r=P(e).token;return S(n,h)?!1:j(r,n)?(D(e),!1):B(r,n)?(D(e),H(e,t)):(e.tokenStack.push(new O(t)),!0)}function B(e,t){switch(e+" "+t){case"when ->":return!0;case"-> end":return!0;case"-> .":return!0;case". .":return!0;default:return!1}}function j(e,t){switch(e+" "+t){case"( )":return!0;case"[ ]":return!0;case"{ }":return!0;case"<< >>":return!0;case"begin end":return!0;case"case end":return!0;case"fun end":return!0;case"if end":return!0;case"receive end":return!0;case"try end":return!0;case"-> ;":return!0;default:return!1}}var r=["-type","-spec","-export_type","-opaque"],i=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],s=["->",";",":",".",","],o=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],u=["+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-"],a=["<<","(","[","{"],f=["}","]",")",">>"],l=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],c=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],h=[",",":","catch","after","of","cond","let","query"],p=/[a-z_]/,d=/[A-Z_]/,v=/[0-9]/,m=/[0-7]/,g=/[a-z_A-Z0-9]/,y=/[\+\-\*\/<>=\|:]/,b=/[<\(\[\{]/,w=/[>\)\]\}]/,E=/[\->\.,:;]/;return{startState:function(){return{tokenStack:[],context:!1,lastToken:null}},token:function(e,t){return T(e,t)},indent:function(e,t){return M(e,t)}}}),CodeMirror.defineMode("gfm",function(e,t){function s(e,t){return e.sol()&&e.match(/^```([\w+#]*)/)?(t.localMode=i(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.token=o,"code"):n.token(e,t.mdState)}function o(e,t){return e.sol()&&e.match(/^```/)?(t.localMode=t.localState=null,t.token=s,"code"):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),"code")}function u(e,t){var r;if(e.match(/^\w+:\/\/\S+/))return"link";if(e.match(/^[^\[*\\<>` _][^\[*\\<>` ]*[^\[*\\<>` _]/))return n.getType(t);if(r=e.match(/^[^\[*\\<>` ]+/)){var i=r[0];return i[0]==="_"&&i[i.length-1]==="_"?(e.backUp(i.length),undefined):n.getType(t)}if(e.eatSpace())return null}var n=CodeMirror.getMode(e,"markdown"),r={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp"},i=function(){var t,n={},i={},s,o=CodeMirror.listModes();for(t=0;t<o.length;t++)n[o[t]]=o[t];var u=CodeMirror.listMIMEs();for(t=0;t<u.length;t++)s=u[t].mime,i[s]=u[t].mime;for(var a in r)if(r[a]in n||r[a]in i)n[a]=r[a];return function(t){return n[t]?CodeMirror.getMode(e,n[t]):null}}();return{startState:function(){var e=n.startState();return e.text=u,{token:s,mode:"markdown",mdState:e,localMode:null,localState:null}},copyState:function(e){return{token:e.token,mode:e.mode,mdState:CodeMirror.copyState(n,e.mdState),localMode:e.localMode,localState:e.localMode?CodeMirror.copyState(e.localMode,e.localState):null}},token:function(e,t){if((ch=e.peek())!=undefined&&ch=="["){e.next();if((ch=e.peek())==undefined||ch!="[")return e.backUp(1),t.token(e,t);while((ch=e.next())!=undefined&&ch!="]");if(ch=="]"&&(ch=e.next())!=undefined&&ch=="]")return"link";e.backUp(1)}return e.match(/^\$[^\$]+\$/)?"string":e.match(/^\\\((.*?)\\\)/)?"string":e.match(/^\$\$[^\$]+\$\$/)?"string":e.match(/^\\\[(.*?)\\\]/)?"string":t.token(e,t)}}},"markdown"),CodeMirror.defineMode("go",function(e,t){function a(e,t){var n=e.next();if(n=='"'||n=="'"||n=="`")return t.tokenize=f(n),t.tokenize(e,t);if(/[\d\.]/.test(n))return n=="."?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):n=="0"?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(n))return u=n,null;if(n=="/"){if(e.eat("*"))return t.tokenize=l,l(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(o.test(n))return e.eatWhile(o),"operator";e.eatWhile(/[\w\$_]/);var s=e.current();if(r.propertyIsEnumerable(s)){if(s=="case"||s=="default")u="case";return"keyword"}return i.propertyIsEnumerable(s)?"atom":"variable"}function f(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&e!="`")n.tokenize=a;return"string"}}function l(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=a;break}n=r=="*"}return"comment"}function c(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function h(e,t,n){return e.context=new c(e.indented,t,n,null,e.context)}function p(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var n=e.indentUnit,r={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},i={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},s={"else":!0,"for":!0,func:!0,"if":!0,"interface":!0,select:!0,struct:!0,"switch":!0},o=/[+\-*&^%:=<>!|\/]/,u;return{startState:function(e){return{tokenize:null,context:new c((e||0)-n,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,n.type=="case"&&(n.type="}"));if(e.eatSpace())return null;u=null;var r=(t.tokenize||a)(e,t);return r=="comment"?r:(n.align==null&&(n.align=!0),u=="{"?h(t,e.column(),"}"):u=="["?h(t,e.column(),"]"):u=="("?h(t,e.column(),")"):u=="case"?n.type="case":u=="}"&&n.type=="}"?n=p(t):u==n.type&&p(t),t.startOfLine=!1,r)},indent:function(e,t){if(e.tokenize!=a&&e.tokenize!=null)return 0;var r=e.context,i=t&&t.charAt(0);if(r.type=="case"&&/^(?:case|default)\b/.test(t))return e.context.type="}",r.indented;var s=i==r.type;return r.align?r.column+(s?0:1):r.indented+(s?0:n)},electricChars:"{}:"}}),CodeMirror.defineMIME("text/x-go","go"),CodeMirror.defineMode("groovy",function(e,t){function n(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function u(e,t){var n=e.next();if(n=='"'||n=="'")return a(n,e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return o=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),e.eat(/eE/)&&(e.eat(/\+\-/),e.eatWhile(/\d/)),"number";if(n=="/"){if(e.eat("*"))return t.tokenize.push(l),l(e,t);if(e.eat("/"))return e.skipToEnd(),"comment";if(c(t.lastToken))return a(n,e,t)}if(n=="-"&&e.eat(">"))return o="->",null;if(/[+\-*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";e.eatWhile(/[\w\$_]/);if(n=="@")return e.eatWhile(/[\w\$_\.]/),"meta";if(t.lastToken==".")return"property";if(e.eat(":"))return o="proplabel","property";var u=e.current();return s.propertyIsEnumerable(u)?"atom":r.propertyIsEnumerable(u)?(i.propertyIsEnumerable(u)&&(o="newstatement"),"keyword"):"variable"}function a(e,t,n){function i(t,n){var i=!1,s,o=!r;while((s=t.next())!=null){if(s==e&&!i){if(!r)break;if(t.match(e+e)){o=!0;break}}if(e=='"'&&s=="$"&&!i&&t.eat("{"))return n.tokenize.push(f()),"string";i=!i&&s=="\\"}return o&&n.tokenize.pop(),"string"}var r=!1;if(e!="/"&&t.eat(e)){if(!t.eat(e))return"string";r=!0}return n.tokenize.push(i),i(t,n)}function f(){function t(t,n){if(t.peek()=="}"){e--;if(e==0)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)}else t.peek()=="{"&&e++;return u(t,n)}var e=1;return t.isBase=!0,t}function l(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize.pop();break}n=r=="*"}return"comment"}function c(e){return!e||e=="operator"||e=="->"||/[\.\[\{\(,;:]/.test(e)||e=="newstatement"||e=="keyword"||e=="proplabel"}function h(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function p(e,t,n){return e.context=new h(e.indented,t,n,null,e.context)}function d(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var r=n("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),i=n("catch class do else finally for if switch try while enum interface def"),s=n("null true false this"),o;return u.isBase=!0,{startState:function(t){return{tokenize:[u],context:new h((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,n.type=="statement"&&!c(t.lastToken)&&(d(t),n=t.context));if(e.eatSpace())return null;o=null;var r=t.tokenize[t.tokenize.length-1](e,t);if(r=="comment")return r;n.align==null&&(n.align=!0);if(o!=";"&&o!=":"||n.type!="statement")if(o=="->"&&n.type=="statement"&&n.prev.type=="}")d(t),t.context.align=!1;else if(o=="{")p(t,e.column(),"}");else if(o=="[")p(t,e.column(),"]");else if(o=="(")p(t,e.column(),")");else if(o=="}"){while(n.type=="statement")n=d(t);n.type=="}"&&(n=d(t));while(n.type=="statement")n=d(t)}else o==n.type?d(t):(n.type=="}"||n.type=="top"||n.type=="statement"&&o=="newstatement")&&p(t,e.column(),"statement");else d(t);return t.startOfLine=!1,t.lastToken=o||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;i.type=="statement"&&!c(t.lastToken)&&(i=i.prev);var s=r==i.type;return i.type=="statement"?i.indented+(r=="{"?0:e.indentUnit):i.align?i.column+(s?0:1):i.indented+(s?0:e.indentUnit)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-groovy","groovy"),CodeMirror.defineMode("haskell",function(e,t){function n(e,t,n){return t(n),n(e,t)}function h(e,t){if(e.eatWhile(c))return null;var h=e.next();if(l.test(h)){if(h=="{"&&e.eat("-")){var v="comment";return e.eat("#")&&(v="meta"),n(e,t,p(v,1))}return null}if(h=="'")return e.eat("\\")?e.next():e.next(),e.eat("'")?"string":"error";if(h=='"')return n(e,t,d);if(i.test(h))return e.eatWhile(a),e.eat(".")?"qualifier":"variable-2";if(r.test(h))return e.eatWhile(a),"variable";if(s.test(h)){if(h=="0"){if(e.eat(/[xX]/))return e.eatWhile(o),"integer";if(e.eat(/[oO]/))return e.eatWhile(u),"number"}e.eatWhile(s);var v="number";return e.eat(".")&&(v="number",e.eatWhile(s)),e.eat(/[eE]/)&&(v="number",e.eat(/[-+]/),e.eatWhile(s)),v}if(f.test(h)){if(h=="-"&&e.eat(/-/)){e.eatWhile(/-/);if(!e.eat(f))return e.skipToEnd(),"comment"}var v="variable";return h==":"&&(v="variable-2"),e.eatWhile(f),v}return"error"}function p(e,t){return t==0?h:function(n,r){var i=t;while(!n.eol()){var s=n.next();if(s=="{"&&n.eat("-"))++i;else if(s=="-"&&n.eat("}")){--i;if(i==0)return r(h),e}}return r(p(e,i)),e}}function d(e,t){while(!e.eol()){var n=e.next();if(n=='"')return t(h),"string";if(n=="\\"){if(e.eol()||e.eat(c))return t(v),"string";e.eat("&")||e.next()}}return t(h),"error"}function v(e,t){return e.eat("\\")?n(e,t,d):(e.next(),t(h),"error")}var r=/[a-z_]/,i=/[A-Z]/,s=/[0-9]/,o=/[0-9A-Fa-f]/,u=/[0-7]/,a=/[a-z_A-Z0-9']/,f=/[-!#$%&*+.\/<=>?@\\^|~:]/,l=/[(),;[\]`{}]/,c=/[ \t\v\f]/,m=function(){function t(t){return function(){for(var n=0;n<arguments.length;n++)e[arguments[n]]=t}}var e={};return t("keyword")("case","class","data","default","deriving","do","else","foreign","if","import","in","infix","infixl","infixr","instance","let","module","newtype","of","then","type","where","_"),t("keyword")("..",":","::","=","\\",'"',"<-","->","@","~","=>"),t("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),t("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),t("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3"),e}();return{startState:function(){return{f:h}},copyState:function(e){return{f:e.f}},token:function(e,t){var n=t.f(e,function(e){t.f=e}),r=e.current();return r in m?m[r]:n}}}),CodeMirror.defineMIME("text/x-haskell","haskell"),CodeMirror.defineMode("haxe",function(e,t){function s(e,t,n){return t.tokenize=n,n(e,t)}function o(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function f(e,t,n){return u=e,a=n,t}function l(e,t){var n=e.next();if(n=='"'||n=="'")return s(e,t,c(n));if(/[\[\]{}\(\),;\:\.]/.test(n))return f(n);if(n=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),f("number","number");if(/\d/.test(n)||n=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),f("number","number");if(t.reAllowed&&n=="~"&&e.eat(/\//))return o(e,"/"),e.eatWhile(/[gimsu]/),f("regexp","string-2");if(n=="/")return e.eat("*")?s(e,t,h):e.eat("/")?(e.skipToEnd(),f("comment","comment")):(e.eatWhile(i),f("operator",null,e.current()));if(n=="#")return e.skipToEnd(),f("conditional","meta");if(n=="@")return e.eat(/:/),e.eatWhile(/[\w_]/),f("metadata","meta");if(i.test(n))return e.eatWhile(i),f("operator",null,e.current());var u;if(/[A-Z]/.test(n))return e.eatWhile(/[\w_<>]/),u=e.current(),f("type","variable-3",u);e.eatWhile(/[\w_]/);var u=e.current(),a=r.propertyIsEnumerable(u)&&r[u];return a&&t.kwAllowed?f(a.type,a.style,u):f("variable","variable",u)}function c(e){return function(t,n){return o(t,e)||(n.tokenize=l),f("string","string")}}function h(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=l;break}n=r=="*"}return f("comment","comment")}function d(e,t,n,r,i,s){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=s,r!=null&&(this.align=r)}function v(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function m(e,t,n,r,i){var s=e.cc;b.state=e,b.stream=i,b.marked=null,b.cc=s,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var o=s.length?s.pop():A;if(o(n,r)){while(s.length&&s[s.length-1].lex)s.pop()();return b.marked?b.marked:n=="variable"&&v(e,r)?"variable-2":n=="variable"&&g(e,r)?"variable-3":t}}}function g(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;var n=e.importedtypes.length;for(var r=0;r<n;r++)if(e.importedtypes[r]==t)return!0}function y(e){var t=b.state;for(var n=t.importedtypes;n;n=n.next)if(n.name==e)return;t.importedtypes={name:e,next:t.importedtypes}}function w(){for(var e=arguments.length-1;e>=0;e--)b.cc.push(arguments[e])}function E(){return w.apply(null,arguments),!0}function S(e){var t=b.state;if(t.context){b.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function T(){b.state.context||(b.state.localVars=x),b.state.context={prev:b.state.context,vars:b.state.localVars}}function N(){b.state.localVars=b.state.context.vars,b.state.context=b.state.context.prev}function C(e,t){var n=function(){var n=b.state;n.lexical=new d(n.indented,b.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function k(){var e=b.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function L(e){return function(n){return n==e?E():e==";"?w():E(arguments.callee)}}function A(e){return e=="@"?E(P):e=="var"?E(C("vardef"),z,L(";"),k):e=="keyword a"?E(C("form"),O,A,k):e=="keyword b"?E(C("form"),A,k):e=="{"?E(C("}"),T,U,k,N):e==";"?E():e=="attribute"?E(D):e=="function"?E($):e=="for"?E(C("form"),L("("),C(")"),X,L(")"),k,A,k):e=="variable"?E(C("stat"),F):e=="switch"?E(C("form"),O,C("}","switch"),L("{"),U,k,k):e=="case"?E(O,L(":")):e=="default"?E(L(":")):e=="catch"?E(C("form"),T,L("("),G,L(")"),A,k,N):e=="import"?E(B,L(";")):e=="typedef"?E(j):w(C("stat"),O,L(";"),k)}function O(e){return p.hasOwnProperty(e)?E(_):e=="function"?E($):e=="keyword c"?E(M):e=="("?E(C(")"),M,L(")"),k,_):e=="operator"?E(O):e=="["?E(C("]"),R(O,"]"),k,_):e=="{"?E(C("}"),R(q,"}"),k,_):E()}function M(e){return e.match(/[;\}\)\],]/)?w():w(O)}function _(e,t){if(e=="operator"&&/\+\+|--/.test(t))return E(_);if(e=="operator"||e==":")return E(O);if(e==";")return;if(e=="(")return E(C(")"),R(O,")"),k,_);if(e==".")return E(I,_);if(e=="[")return E(C("]"),O,L("]"),k,_)}function D(e,t){if(e=="attribute")return E(D);if(e=="function")return E($);if(e=="var")return E(z)}function P(e,t){if(e==":")return E(P);if(e=="variable")return E(P);if(e=="(")return E(C(")"),comasep(H,")"),k,A)}function H(e,t){if(typ=="variable")return E()}function B(e,t){if(e=="variable"&&/[A-Z]/.test(t.charAt(0)))return y(t),E();if(e=="variable"||e=="property"||e==".")return E(B)}function j(e,t){if(e=="variable"&&/[A-Z]/.test(t.charAt(0)))return y(t),E()}function F(e){return e==":"?E(k,A):w(_,L(";"),k)}function I(e){if(e=="variable")return b.marked="property",E()}function q(e){e=="variable"&&(b.marked="property");if(p.hasOwnProperty(e))return E(L(":"),O)}function R(e,t){function n(r){return r==","?E(e,n):r==t?E():E(L(t))}return function(i){return i==t?E():w(e,n)}}function U(e){return e=="}"?E():w(A,U)}function z(e,t){return e=="variable"?(S(t),E(J,W)):E()}function W(e,t){if(t=="=")return E(O,W);if(e==",")return E(z)}function X(e,t){return e=="variable"&&S(t),E(C(")"),T,V,O,k,A,N)}function V(e,t){if(t=="in")return E()}function $(e,t){if(e=="variable")return S(t),E($);if(t=="new")return E($);if(e=="(")return E(C(")"),T,R(G,")"),k,J,A,N)}function J(e,t){if(e==":")return E(K)}function K(e,t){if(e=="type")return E();if(e=="variable")return E();if(e=="{")return E(C("}"),R(Q,"}"),k)}function Q(e,t){if(e=="variable")return E(J)}function G(e,t){if(e=="variable")return S(t),E(J)}var n=e.indentUnit,r=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),s={type:"atom",style:"atom"},o={type:"attribute",style:"attribute"},u=e("typedef");return{"if":t,"while":t,"else":n,"do":n,"try":n,"return":r,"break":r,"continue":r,"new":r,"throw":r,"var":e("var"),inline:o,"static":o,using:e("import"),"public":o,"private":o,cast:e("cast"),"import":e("import"),macro:e("macro"),"function":e("function"),"catch":e("catch"),untyped:e("untyped"),callback:e("cb"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,never:e("property_access"),trace:e("trace"),"class":u,"enum":u,"interface":u,typedef:u,"extends":u,"implements":u,dynamic:u,"true":s,"false":s,"null":s}}(),i=/[+\-*&%=<>!?|]/,u,a,p={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},b={state:null,column:null,marked:null,cc:null},x={name:"this",next:null};return k.lex=!0,{startState:function(e){var r=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:l,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new d((e||0)-n,0,"block",!1),localVars:t.localVars,importedtypes:r,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);return u=="comment"?n:(t.reAllowed=u=="operator"||u=="keyword c"||!!u.match(/^[\[{}\(,;:]$/),t.kwAllowed=u!=".",m(t,n,u,a,e))},indent:function(e,t){if(e.tokenize!=l)return 0;var r=t&&t.charAt(0),i=e.lexical;i.type=="stat"&&r=="}"&&(i=i.prev);var s=i.type,o=r==s;return s=="vardef"?i.indented+4:s=="form"&&r=="{"?i.indented:s=="stat"||s=="form"?i.indented+n:i.info=="switch"&&!o?i.indented+(/^(?:case|default)\b/.test(t)?n:2*n):i.align?i.column+(o?0:1):i.indented+(o?0:n)},compareStates:function(e,t){return e.localVars==t.localVars&&e.context==t.context},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-haxe","haxe"),CodeMirror.defineMode("htmlembedded",function(e,t){function o(e,t){return e.match(n,!1)?(t.token=u,i.token(e,t.scriptState)):s.token(e,t.htmlState)}function u(e,t){return e.match(r,!1)?(t.token=o,s.token(e,t.htmlState)):i.token(e,t.scriptState)}var n=t.scriptStartRegex||/^<%/i,r=t.scriptEndRegex||/^%>/i,i,s;return{startState:function(){return i=i||CodeMirror.getMode(e,t.scriptingModeSpec),s=s||CodeMirror.getMode(e,"htmlmixed"),{token:t.startOpen?u:o,htmlState:s.startState(),scriptState:i.startState()}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==o?s.indent(e.htmlState,t):i.indent(e.scriptState,t)},copyState:function(e){return{token:e.token,htmlState:CodeMirror.copyState(s,e.htmlState),scriptState:CodeMirror.copyState(i,e.scriptState)}},electricChars:"/{}:"}},"htmlmixed"),CodeMirror.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),CodeMirror.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),CodeMirror.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),CodeMirror.defineMode("htmlmixed",function(e,t){function s(e,t){var s=n.token(e,t.htmlState);return s=="tag"&&e.current()==">"&&t.htmlState.context&&(/^script$/i.test(t.htmlState.context.tagName)?(t.token=u,t.localState=r.startState(n.indent(t.htmlState,"")),t.mode="javascript"):/^style$/i.test(t.htmlState.context.tagName)&&(t.token=a,t.localState=i.startState(n.indent(t.htmlState,"")),t.mode="css")),s}function o(e,t,n){var r=e.current(),i=r.search(t);return i>-1&&e.backUp(r.length-i),n}function u(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=s,t.localState=null,t.mode="html",s(e,t)):o(e,/<\/\s*script\s*>/,r.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=s,t.localState=null,t.mode="html",s(e,t)):o(e,/<\/\s*style\s*>/,i.token(e,t.localState))}var n=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),r=CodeMirror.getMode(e,"javascript"),i=CodeMirror.getMode(e,"css");return{startState:function(){var e=n.startState();return{token:s,localState:null,mode:"html",htmlState:e}},copyState:function(e){if(e.localState)var t=CodeMirror.copyState(e.token==a?i:r,e.localState);return{token:e.token,localState:t,mode:e.mode,htmlState:CodeMirror.copyState(n,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==s||/^\s*<\//.test(t)?n.indent(e.htmlState,t):e.token==u?r.indent(e.localState,t):i.indent(e.localState,t)},compareStates:function(e,t){return e.mode!=t.mode?!1:e.localState?CodeMirror.Pass:n.compareStates(e.htmlState,t.htmlState)},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(e,t){function o(e,t,n){return t.tokenize=n,n(e,t)}function u(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function l(e,t,n){return a=e,f=n,t}function c(e,t){var n=e.next();if(n=='"'||n=="'")return o(e,t,h(n));if(/[\[\]{}\(\),;\:\.]/.test(n))return l(n);if(n=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),l("number","number");if(/\d/.test(n)||n=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),l("number","number");if(n=="/")return e.eat("*")?o(e,t,p):e.eat("/")?(e.skipToEnd(),l("comment","comment")):t.reAllowed?(u(e,"/"),e.eatWhile(/[gimy]/),l("regexp","string-2")):(e.eatWhile(s),l("operator",null,e.current()));if(n=="#")return e.skipToEnd(),l("error","error");if(s.test(n))return e.eatWhile(s),l("operator",null,e.current());e.eatWhile(/[\w\$_]/);var r=e.current(),a=i.propertyIsEnumerable(r)&&i[r];return a&&t.kwAllowed?l(a.type,a.style,r):l("variable","variable",r)}function h(e){return function(t,n){return u(t,e)||(n.tokenize=c),l("string","string")}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=c;break}n=r=="*"}return l("comment","comment")}function v(e,t,n,r,i,s){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=s,r!=null&&(this.align=r)}function m(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function g(e,t,n,i,s){var o=e.cc;y.state=e,y.stream=s,y.marked=null,y.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var u=o.length?o.pop():r?A:L;if(u(n,i)){while(o.length&&o[o.length-1].lex)o.pop()();return y.marked?y.marked:n=="variable"&&m(e,i)?"variable-2":t}}}function b(){for(var e=arguments.length-1;e>=0;e--)y.cc.push(arguments[e])}function w(){return b.apply(null,arguments),!0}function E(e){var t=y.state;if(t.context){y.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function x(){y.state.context||(y.state.localVars=S),y.state.context={prev:y.state.context,vars:y.state.localVars}}function T(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function N(e,t){var n=function(){var n=y.state;n.lexical=new v(n.indented,y.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function C(){var e=y.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){return function(n){return n==e?w():e==";"?b():w(arguments.callee)}}function L(e){return e=="var"?w(N("vardef"),j,k(";"),C):e=="keyword a"?w(N("form"),A,L,C):e=="keyword b"?w(N("form"),L,C):e=="{"?w(N("}"),B,C):e==";"?w():e=="function"?w(z):e=="for"?w(N("form"),k("("),N(")"),I,k(")"),C,L,C):e=="variable"?w(N("stat"),_):e=="switch"?w(N("form"),A,N("}","switch"),k("{"),B,C,C):e=="case"?w(A,k(":")):e=="default"?w(k(":")):e=="catch"?w(N("form"),x,k("("),W,k(")"),L,C,T):b(N("stat"),A,k(";"),C)}function A(e){return d.hasOwnProperty(e)?w(M):e=="function"?w(z):e=="keyword c"?w(O):e=="("?w(N(")"),O,k(")"),C,M):e=="operator"?w(A):e=="["?w(N("]"),H(A,"]"),C,M):e=="{"?w(N("}"),H(P,"}"),C,M):w()}function O(e){return e.match(/[;\}\)\],]/)?b():b(A)}function M(e,t){if(e=="operator"&&/\+\+|--/.test(t))return w(M);if(e=="operator"||e==":")return w(A);if(e==";")return;if(e=="(")return w(N(")"),H(A,")"),C,M);if(e==".")return w(D,M);if(e=="[")return w(N("]"),A,k("]"),C,M)}function _(e){return e==":"?w(C,L):b(M,k(";"),C)}function D(e){if(e=="variable")return y.marked="property",w()}function P(e){e=="variable"&&(y.marked="property");if(d.hasOwnProperty(e))return w(k(":"),A)}function H(e,t){function n(r){return r==","?w(e,n):r==t?w():w(k(t))}return function(i){return i==t?w():b(e,n)}}function B(e){return e=="}"?w():b(L,B)}function j(e,t){return e=="variable"?(E(t),w(F)):w()}function F(e,t){if(t=="=")return w(A,F);if(e==",")return w(j)}function I(e){return e=="var"?w(j,R):e==";"?b(R):e=="variable"?w(q):b(R)}function q(e,t){return t=="in"?w(A):w(M,R)}function R(e,t){return e==";"?w(U):t=="in"?w(A):w(A,k(";"),U)}function U(e){e!=")"&&w(A)}function z(e,t){if(e=="variable")return E(t),w(z);if(e=="(")return w(N(")"),x,H(W,")"),C,L,T)}function W(e,t){if(e=="variable")return E(t),w()}var n=e.indentUnit,r=t.json,i=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),s={type:"atom",style:"atom"};return{"if":t,"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":s,"false":s,"null":s,"undefined":s,NaN:s,Infinity:s}}(),s=/[+\-*&%=<>!?|]/,a,f,d={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},y={state:null,column:null,marked:null,cc:null},S={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(e){return{tokenize:c,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new v((e||0)-n,0,"block",!1),localVars:t.localVars,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);return a=="comment"?n:(t.reAllowed=a=="operator"||a=="keyword c"||!!a.match(/^[\[{}\(,;:]$/),t.kwAllowed=a!=".",g(t,n,a,f,e))},indent:function(e,t){if(e.tokenize!=c)return 0;var r=t&&t.charAt(0),i=e.lexical;i.type=="stat"&&r=="}"&&(i=i.prev);var s=i.type,o=r==s;return s=="vardef"?i.indented+4:s=="form"&&r=="{"?i.indented:s=="stat"||s=="form"?i.indented+n:i.info=="switch"&&!o?i.indented+(/^(?:case|default)\b/.test(t)?n:2*n):i.align?i.column+(o?0:1):i.indented+(o?0:n)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("jinja2",function(e,t){function r(e,t){var n=e.next();if(n=="{")if(n=e.eat(/\{|%|#/))return e.eat("-"),t.tokenize=i(n),"tag"}function i(e){return e=="{"&&(e="}"),function(t,i){var s=t.next();return(s==e||s=="-"&&t.eat(e))&&t.eat("}")?(i.tokenize=r,"tag"):t.match(n)?"keyword":e=="#"?"comment":"string"}}var n=["block","endblock","for","endfor","in","true","false","loop","none","self","super","if","as","not","and","else","import","with","without","context"];return n=new RegExp("^(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:r}},token:function(e,t){return t.tokenize(e,t)}}}),CodeMirror.defineMode("less",function(e){function r(e,t){return n=t,e}function s(e){for(var t=0;t<i.length;t++)if(e===i[t])return!0}function o(e,t){var n=e.next();if(n=="@")return e.eatWhile(/[\w\-]/),r("meta",e.current());if(n=="/"&&e.eat("*"))return t.tokenize=a,a(e,t);if(n=="<"&&e.eat("!"))return t.tokenize=f,f(e,t);if(n!="=")return n!="~"&&n!="|"||!e.eat("=")?n=='"'||n=="'"?(t.tokenize=l(n),t.tokenize(e,t)):n=="/"?e.eat("/")?(t.tokenize=u,u(e,t)):(e.eatWhile(/[\a-zA-Z0-9\-_.\s]/),/\/|\)|#/.test(e.peek()||e.eol()||e.eatSpace()&&e.peek()==")")?r("string","string"):r("number","unit")):n=="!"?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)?(e.eatWhile(/[\w.%]/),r("number","unit")):/[,+<>*\/]/.test(n)?r(null,"select-op"):/[;{}:\[\]()]/.test(n)?n==":"?(e.eatWhile(/[active|hover|link|visited]/),e.current().match(/active|hover|link|visited/)?r("tag","tag"):r(null,n)):r(null,n):n=="."?(e.eatWhile(/[\a-zA-Z0-9\-_]/),r("tag","tag")):n=="#"?(e.eatWhile(/[A-Za-z0-9]/),e.current().length===4||e.current().length===7?e.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false)!=null?e.current().substring(1)!=e.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false)?r("atom","tag"):(e.eatSpace(),/[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(e.peek())?r("atom","tag"):e.peek()=="}"?r("number","unit"):/[a-zA-Z\\]/.test(e.peek())?r("atom","tag"):e.eol()?r("atom","tag"):r("number","unit")):(e.eatWhile(/[\w\\\-]/),r("atom","tag")):(e.eatWhile(/[\w\\\-]/),r("atom","tag"))):n=="&"?(e.eatWhile(/[\w\-]/),r(null,n)):(e.eatWhile(/[\w\\\-_%.{]/),e.current().match(/http|https/)!=null?(e.eatWhile(/[\w\\\-_%.{:\/]/),r("string","string")):e.peek()=="<"||e.peek()==">"?r("tag","tag"):e.peek().match(/\(/)!=null?r(null,n):e.peek()=="/"&&t.stack[t.stack.length-1]!=undefined?r("string","string"):e.current().match(/\-\d|\-.\d/)?r("number","unit"):s(e.current())?r("tag","tag"):/\/|[\s\)]/.test(e.peek()||e.eol()||e.eatSpace()&&e.peek()=="/")&&e.current().indexOf(".")!==-1?e.current().substring(e.current().length-1,e.current().length)=="{"?(e.backUp(1),r("tag","tag")):e.eatSpace()&&e.peek().match(/[{<>.a-zA-Z]/)!=null||e.eol()?r("tag","tag"):r("string","string"):e.eol()?(e.current().substring(e.current().length-1,e.current().length)=="{"&&e.backUp(1),r("tag","tag")):r("variable","variable")):r(null,"compare");r(null,"compare")}function u(e,t){return e.skipToEnd(),t.tokenize=o,r("comment","comment")}function a(e,t){var n=!1,i;while((i=e.next())!=null){if(n&&i=="/"){t.tokenize=o;break}n=i=="*"}return r("comment","comment")}function f(e,t){var n=0,i;while((i=e.next())!=null){if(n>=2&&i==">"){t.tokenize=o;break}n=i=="-"?n+1:0}return r("comment","comment")}function l(e){return function(t,n){var i=!1,s;while((s=t.next())!=null){if(s==e&&!i)break;i=!i&&s=="\\"}return i||(n.tokenize=o),r("string","string")}}var t=e.indentUnit,n,i=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr"];return{startState:function(e){return{tokenize:o,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t),i=t.stack[t.stack.length-1];if(n=="hash"&&i=="rule")r="atom";else if(r=="variable")if(i=="rule")r=null;else if(!i||i=="@media{")r=e.current()=="when"?"variable":e.string.match(/#/g)!=undefined?null:/[\s,|\s\)]/.test(e.peek())?"tag":null;return i=="rule"&&/^[\{\};]$/.test(n)&&t.stack.pop(),n=="{"?i=="@media"?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):n=="}"?t.stack.pop():n=="@media"?t.stack.push("@media"):i=="{"&&n!="comment"&&t.stack.push("rule"),r},indent:function(e,n){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="rule"?2:1),e.baseIndent+r*t},electricChars:"}"}}),CodeMirror.defineMIME("text/x-less","less"),CodeMirror.mimeModes.hasOwnProperty("text/css")||CodeMirror.defineMIME("text/css","less"),CodeMirror.defineMode("lua",function(e,t){function r(e){return new RegExp("^(?:"+e.join("|")+")","i")}function i(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function c(e){var t=0;while(e.eat("="))++t;return e.eat("["),t}function h(e,t){var n=e.next();return n=="-"&&e.eat("-")?e.eat("[")?(t.cur=p(c(e),"comment"))(e,t):(e.skipToEnd(),"comment"):n=='"'||n=="'"?(t.cur=d(n))(e,t):n=="["&&/[\[=]/.test(e.peek())?(t.cur=p(c(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function p(e,t){return function(n,r){var i=null,s;while((s=n.next())!=null)if(i==null)s=="]"&&(i=0);else if(s=="=")++i;else{if(s=="]"&&i==e){r.cur=h;break}i=null}return t}}function d(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r)break;r=!r&&i=="\\"}return r||(n.cur=h),"string"}}var n=e.indentUnit,s=i(t.specials||[]),o=i(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),u=i(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),a=i(["function","if","repeat","do","\\(","{"]),f=i(["end","until","\\)","}"]),l=r(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:h}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return n=="variable"&&(u.test(r)?n="keyword":o.test(r)?n="builtin":s.test(r)&&(n="variable-2")),n!="comment"&&n!="string"&&(a.test(r)?++t.indentDepth:f.test(r)&&--t.indentDepth),n},indent:function(e,t){var r=l.test(t);return e.basecol+n*(e.indentDepth-(r?1:0))}}}),CodeMirror.defineMIME("text/x-lua","lua"),CodeMirror.defineMode("markdown",function(e,t){function b(e,t,n){return t.f=t.inline=n,n(e,t)}function w(e,t,n){return t.f=t.block=n,n(e,t)}function E(e){return e.em=!1,e.strong=!1,!n&&e.f==x&&(e.f=C,e.block=S),null}function S(e,t){var n;if(t.indentationDiff>=4)return t.indentation-=t.indentationDiff,e.skipToEnd(),s;if(e.eatSpace())return null;if(e.peek()==="#"||e.match(g))t.header=!0;else if(e.eat(">"))t.indentation++,t.quote=!0;else{if(e.peek()==="[")return b(e,t,A);if(e.match(d,!0))return a;if(n=e.match(v,!0)||e.match(m,!0))return t.indentation+=n[0].length,u}return b(e,t,t.inline)}function x(e,t){var i=r.token(e,t.htmlState);return n&&i==="tag"&&t.htmlState.type!=="openTag"&&!t.htmlState.context&&(t.f=C,t.block=S),i}function T(e){var t=[];return e.strong?t.push(e.em?p:h):e.em&&t.push(c),e.header&&t.push(i),e.quote&&t.push(o),t.length?t.join(" "):null}function N(e,t){return e.match(y,!0)?T(t):undefined}function C(e,t){var n=t.text(e,t);if(typeof n!="undefined")return n;var r=e.next();if(r==="\\")return e.next(),T(t);if(r==="`")return b(e,t,_(s,"`"));if(r==="[")return b(e,t,k);if(r==="<"&&e.match(/^\w/,!1))return e.backUp(1),w(e,t,x);var i=T(t);return r==="*"||r==="_"?e.eat(r)?(t.strong=!t.strong)?T(t):i:(t.em=!t.em)?T(t):i:T(t)}function k(e,t){while(!e.eol()){var n=e.next();n==="\\"&&e.next();if(n==="]")return t.inline=t.f=L,f}return f}function L(e,t){e.eatSpace();var n=e.next();return n==="("||n==="["?b(e,t,_(l,n==="("?")":"]")):"error"}function A(e,t){return e.match(/^[^\]]*\]:/,!0)?(t.f=O,f):b(e,t,C)}function O(e,t){return e.eatSpace(),e.match(/^[^\s]+/,!0),t.f=t.inline=C,l}function M(e){return M[e]||(M[e]=new RegExp("^(?:[^\\\\\\"+e+"]|\\\\.)*(?:\\"+e+"|$)")),M[e]}function _(e,t,n){return n=n||C,function(r,i){return r.match(M(t)),i.inline=i.f=n,e}}var n=CodeMirror.mimeModes.hasOwnProperty("text/html"),r=CodeMirror.getMode(e,n?"text/html":"text/plain"),i="header",s="comment",o="quote",u="string",a="hr",f="link",l="string",c="em",h="strong",p="emstrong",d=/^([*\-=_])(?:\s*\1){2,}\s*$/,v=/^[*\-+]\s+/,m=/^[0-9]+\.\s+/,g=/^(?:\={3,}|-{3,})$/,y=/^[^\[*_\\<>`]+/;return{startState:function(){return{f:S,block:S,htmlState:CodeMirror.startState(r),indentation:0,inline:C,text:N,em:!1,strong:!1,header:!1,quote:!1}},copyState:function(e){return{f:e.f,block:e.block,htmlState:CodeMirror.copyState(r,e.htmlState),indentation:e.indentation,inline:e.inline,text:e.text,em:e.em,strong:e.strong,header:e.header,quote:e.quote}},token:function(e,t){if(e.sol()){if(e.match(/^\s*$/,!0))return E(t);t.header=!1,t.quote=!1,t.f=t.block;var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;t.indentationDiff=n-t.indentation,t.indentation=n;if(n>0)return null}return t.f(e,t)},blankLine:E,getType:T}},"xml"),CodeMirror.defineMIME("text/x-markdown","markdown"),CodeMirror.defineMode("mysql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(r=="`")return t.tokenize=f(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r!="-"){if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var l=e.current(),c;return i.test(l)?null:s.test(l)?"keyword":"variable"}var u=e.next();if(u=="-")return e.skipToEnd(),"comment"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"variable-2"}}function l(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")l(t,")",e.column());else if(n=="[")l(t,"]",e.column());else if(n=="{")l(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")c(t);t.context&&n==t.context.type&&c(t)}else n=="."&&t.context&&t.context.type=="pattern"?c(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?l(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql"),CodeMirror.defineMode("ntriples",function(){function e(e,t){var n=e.location,r;n==Location.PRE_SUBJECT&&t=="<"?r=Location.WRITING_SUB_URI:n==Location.PRE_SUBJECT&&t=="_"?r=Location.WRITING_BNODE_URI:n==Location.PRE_PRED&&t=="<"?r=Location.WRITING_PRED_URI:n==Location.PRE_OBJ&&t=="<"?r=Location.WRITING_OBJ_URI:n==Location.PRE_OBJ&&t=="_"?r=Location.WRITING_OBJ_BNODE:n==Location.PRE_OBJ&&t=='"'?r=Location.WRITING_OBJ_LITERAL:n==Location.WRITING_SUB_URI&&t==">"?r=Location.PRE_PRED:n==Location.WRITING_BNODE_URI&&t==" "?r=Location.PRE_PRED:n==Location.WRITING_PRED_URI&&t==">"?r=Location.PRE_OBJ:n==Location.WRITING_OBJ_URI&&t==">"?r=Location.POST_OBJ:n==Location.WRITING_OBJ_BNODE&&t==" "?r=Location.POST_OBJ:n==Location.WRITING_OBJ_LITERAL&&t=='"'?r=Location.POST_OBJ:n==Location.WRITING_LIT_LANG&&t==" "?r=Location.POST_OBJ:n==Location.WRITING_LIT_TYPE&&t==">"?r=Location.POST_OBJ:n==Location.WRITING_OBJ_LITERAL&&t=="@"?r=Location.WRITING_LIT_LANG:n==Location.WRITING_OBJ_LITERAL&&t=="^"?r=Location.WRITING_LIT_TYPE:t!=" "||n!=Location.PRE_SUBJECT&&n!=Location.PRE_PRED&&n!=Location.PRE_OBJ&&n!=Location.POST_OBJ?n==Location.POST_OBJ&&t=="."?r=Location.PRE_SUBJECT:r=Location.ERROR:r=n,e.location=r}return Location={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12},untilSpace=function(e){return e!=" "},untilEndURI=function(e){return e!=">"},{startState:function(){return{location:Location.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(t,n){var r=t.next();if(r=="<"){e(n,r);var i="";return t.eatWhile(function(e){return e!="#"&&e!=">"?(i+=e,!0):!1}),n.uris.push(i),t.match("#",!1)?"variable":(t.next(),e(n,">"),"variable")}if(r=="#"){var s="";return t.eatWhile(function(e){return e!=">"&&e!=" "?(s+=e,!0):!1}),n.anchors.push(s),"variable-2"}if(r==">")return e(n,">"),"variable";if(r=="_"){e(n,r);var o="";return t.eatWhile(function(e){return e!=" "?(o+=e,!0):!1}),n.bnodes.push(o),t.next(),e(n," "),"builtin"}if(r=='"')return e(n,r),t.eatWhile(function(e){return e!='"'}),t.next(),t.peek()!="@"&&t.peek()!="^"&&e(n,'"'),"string";if(r=="@"){e(n,"@");var u="";return t.eatWhile(function(e){return e!=" "?(u+=e,!0):!1}),n.langs.push(u),t.next(),e(n," "),"string-2"}if(r=="^"){t.next(),e(n,"^");var a="";return t.eatWhile(function(e){return e!=">"?(a+=e,!0):!1}),n.types.push(a),t.next(),e(n,">"),"variable"}r==" "&&e(n,r),r=="."&&e(n,r)}}}),CodeMirror.defineMIME("text/n-triples","ntriples"),CodeMirror.defineMode("ocaml",function(e){function n(e,n){var s=e.sol(),o=e.next();if(o==='"')return n.tokenize=r,n.tokenize(e,n);if(o==="("&&e.eat("*"))return n.commentLevel++,n.tokenize=i,n.tokenize(e,n);if(o==="~")return e.eatWhile(/\w/),"variable-2";if(o==="`")return e.eatWhile(/\w/),"quote";if(/\d/.test(o))return e.eatWhile(/[\d]/),e.eat(".")&&e.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(o))return"operator";e.eatWhile(/\w/);var u=e.current();return t[u]||"variable"}function r(e,t){var r,i=!1,s=!1;while((r=e.next())!=null){if(r==='"'&&!s){i=!0;break}s=!s&&r==="\\"}return i&&!s&&(t.tokenize=n),"string"}function i(e,t){var r,i;while(t.commentLevel>0&&(i=e.next())!=null)r==="("&&i==="*"&&t.commentLevel++,r==="*"&&i===")"&&t.commentLevel--,r=i;return t.commentLevel<=0&&(t.tokenize=n),"comment"}var t={"true":"atom","false":"atom",let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword",succ:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",raise:"keyword",begin:"keyword",end:"keyword",open:"builtin",trace:"builtin",ignore:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin"};return{startState:function(){return{tokenize:n,commentLevel:0}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),CodeMirror.defineMIME("text/x-ocaml","ocaml"),CodeMirror.defineMode("pascal",function(e){function t(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function s(e,t){var s=e.next();if(s=="#"&&t.startOfLine)return e.skipToEnd(),"meta";if(s=='"'||s=="'")return t.tokenize=o(s),t.tokenize(e,t);if(s=="("&&e.eat("*"))return t.tokenize=u,u(e,t);if(/[\[\]{}\(\),;\:\.]/.test(s))return null;if(/\d/.test(s))return e.eatWhile(/[\w\.]/),"number";if(s=="/"&&e.eat("/"))return e.skipToEnd(),"comment";if(i.test(s))return e.eatWhile(i),"operator";e.eatWhile(/[\w\$_]/);var a=e.current();return n.propertyIsEnumerable(a)?"keyword":r.propertyIsEnumerable(a)?"atom":"variable"}function o(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r)n.tokenize=null;return"string"}}function u(e,t){var n=!1,r;while(r=e.next()){if(r==")"&&n){t.tokenize=null;break}n=r=="*"}return"comment"}var n=t("and array begin case const div do downto else end file for forward integer boolean char function goto if in label mod nil not of or packed procedure program record repeat set string then to type until var while with"),r={"null":!0},i=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null}},token:function(e,t){if(e.eatSpace())return null;var n=(t.tokenize||s)(e,t);return n=="comment"||n=="meta"?n:n},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-pascal","pascal"),CodeMirror.defineMode("perl",function(e,t){function s(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){var s=!1,o,a=0;while(o=e.next()){if(o===n[a]&&!s)return n[++a]!==undefined?(t.chain=n[a],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=u,r;s=!s&&o=="\\"}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=u),e.skipToEnd(),"string"},t.tokenize(e,t)}function u(e,t){if(e.eatSpace())return null;if(t.chain)return s(e,t,t.chain,t.style,t.tail);if(e.match(/^\-?[\d\.]/,!1)&&e.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(e.match(/^<<(?=\w)/))return e.eatWhile(/\w/),o(e,t,e.current().substr(2));if(e.sol()&&e.match(/^\=item(?!\w)/))return o(e,t,"=cut");var u=e.next();if(u=='"'||u=="'"){if(e.prefix(3)=="<<"+u){var a=e.pos;e.eatWhile(/\w/);var f=e.current().substr(1);if(f&&e.eat(u))return o(e,t,f);e.pos=a}return s(e,t,[u],"string")}if(u=="q"){var l=e.look(-2);if(!l||!/\w/.test(l)){l=e.look(0);if(l=="x"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],r,i);if(l=="[")return e.eatSuffix(2),s(e,t,["]"],r,i);if(l=="{")return e.eatSuffix(2),s(e,t,["}"],r,i);if(l=="<")return e.eatSuffix(2),s(e,t,[">"],r,i);if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],r,i)}else if(l=="q"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],"string");if(l=="[")return e.eatSuffix(2),s(e,t,["]"],"string");if(l=="{")return e.eatSuffix(2),s(e,t,["}"],"string");if(l=="<")return e.eatSuffix(2),s(e,t,[">"],"string");if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],"string")}else if(l=="w"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],"bracket");if(l=="[")return e.eatSuffix(2),s(e,t,["]"],"bracket");if(l=="{")return e.eatSuffix(2),s(e,t,["}"],"bracket");if(l=="<")return e.eatSuffix(2),s(e,t,[">"],"bracket");if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],"bracket")}else if(l=="r"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],r,i);if(l=="[")return e.eatSuffix(2),s(e,t,["]"],r,i);if(l=="{")return e.eatSuffix(2),s(e,t,["}"],r,i);if(l=="<")return e.eatSuffix(2),s(e,t,[">"],r,i);if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],r,i)}else if(/[\^'"!~\/(\[{<]/.test(l)){if(l=="(")return e.eatSuffix(1),s(e,t,[")"],"string");if(l=="[")return e.eatSuffix(1),s(e,t,["]"],"string");if(l=="{")return e.eatSuffix(1),s(e,t,["}"],"string");if(l=="<")return e.eatSuffix(1),s(e,t,[">"],"string");if(/[\^'"!~\/]/.test(l))return s(e,t,[e.eat(l)],"string")}}}if(u=="m"){var l=e.look(-2);if(!l||!/\w/.test(l)){l=e.eat(/[(\[{<\^'"!~\/]/);if(l){if(/[\^'"!~\/]/.test(l))return s(e,t,[l],r,i);if(l=="(")return s(e,t,[")"],r,i);if(l=="[")return s(e,t,["]"],r,i);if(l=="{")return s(e,t,["}"],r,i);if(l=="<")return s(e,t,[">"],r,i)}}}if(u=="s"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}if(u=="y"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}if(u=="t"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat("r");if(l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}}if(u=="`")return s(e,t,[u],"variable-2");if(u=="/")return/~\s*$/.test(e.prefix())?s(e,t,[u],r,i):"operator";if(u=="$"){var a=e.pos;if(e.eatWhile(/\d/)||e.eat("{")&&e.eatWhile(/\d/)&&e.eat("}"))return"variable-2";e.pos=a}if(/[$@%]/.test(u)){var a=e.pos;if(e.eat("^")&&e.eat(/[A-Z]/)||!/[@$%&]/.test(e.look(-2))&&e.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var l=e.current();if(n[l])return"variable-2"}e.pos=a}if(/[$@%&]/.test(u))if(e.eatWhile(/[\w$\[\]]/)||e.eat("{")&&e.eatWhile(/[\w$\[\]]/)&&e.eat("}")){var l=e.current();return n[l]?"variable-2":"variable"}if(u=="#"&&e.look(-2)!="$")return e.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(u)){var a=e.pos;e.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(n[e.current()])return"operator";e.pos=a}if(u=="_"&&e.pos==1){if(e.suffix(6)=="_END__")return s(e,t,["\0"],"comment");if(e.suffix(7)=="_DATA__")return s(e,t,["\0"],"variable-2");if(e.suffix(7)=="_C__")return s(e,t,["\0"],"string")}if(/\w/.test(u)){var a=e.pos;if(e.look(-2)=="{"&&(e.look(0)=="}"||e.eatWhile(/\w/)&&e.look(0)=="}"))return"string";e.pos=a}if(/[A-Z]/.test(u)){var c=e.look(-2),a=e.pos;e.eatWhile(/[A-Z_]/);if(!/[\da-z]/.test(e.look(0))){var l=n[e.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}e.pos=a}if(/[a-zA-Z_]/.test(u)){var c=e.look(-2);e.eatWhile(/\w/);var l=n[e.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}return null}var n={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},r="string-2",i=/[goseximacplud]/;return{startState:function(){return{tokenize:u,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||u)(e,t)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-perl","perl"),CodeMirror.StringStream.prototype.look=function(e){return this.string.charAt(this.pos+(e||0))},CodeMirror.StringStream.prototype.prefix=function(e){if(e){var t=this.pos-e;return this.string.substr(t>=0?t:0,e)}return this.string.substr(0,this.pos-1)},CodeMirror.StringStream.prototype.suffix=function(e){var t=this.string.length,n=t-this.pos+1;return this.string.substr(this.pos,e&&e<t?e:n)},CodeMirror.StringStream.prototype.nsuffix=function(e){var t=this.pos,n=e||this.string.length-this.pos+1;return this.pos+=n,this.string.substr(t,n)},CodeMirror.StringStream.prototype.eatSuffix=function(e){var t=this.pos+e,n;t<=0?this.pos=0:t>=(n=this.string.length-1)?this.pos=n:this.pos=t},function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e){return function(t,n){return t.match(e)?n.tokenize=null:t.skipToEnd(),"string"}}var n={name:"clike",keywords:e("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent"),blockKeywords:e("catch do else elseif for foreach if switch try while"),atoms:e("true false null TRUE FALSE NULL"),multiLineStrings:!0,hooks:{$:function(e,t){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,n){return e.match(/<</)?(e.eatWhile(/[\w\.]/),n.tokenize=t(e.current().slice(3)),n.tokenize(e,n)):!1},"#":function(e,t){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"},"/":function(e,t){if(e.eat("/")){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(e,t){function u(e,t){var n=t.mode=="php";e.sol()&&t.pending!='"'&&(t.pending=null);if(t.curMode==r){if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,t.curClose="?>",t.mode="php","meta";if(t.pending=='"'){while(!e.eol()&&e.next()!='"');var a="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var a=t.pending.style}else var a=r.token(e,t.curState);t.pending=null;var f=e.current(),l=f.search(/<\?/);return l!=-1?(a=="string"&&/\"$/.test(f)&&!/\?>/.test(f)?t.pending='"':t.pending={end:e.pos,style:a},e.backUp(f.length-l)):a=="tag"&&e.current()==">"&&t.curState.context&&(/^script$/i.test(t.curState.context.tagName)?(t.curMode=i,t.curState=i.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*script\s*>/i,t.mode="javascript"):/^style$/i.test(t.curState.context.tagName)&&(t.curMode=s,t.curState=s.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*style\s*>/i,t.mode="css")),a}return(!n||t.php.tokenize==null)&&e.match(t.curClose,n)?(t.curMode=r,t.curState=t.html,t.curClose=null,t.mode="html",n?"meta":u(e,t)):t.curMode.token(e,t.curState)}var r=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),i=CodeMirror.getMode(e,"javascript"),s=CodeMirror.getMode(e,"css"),o=CodeMirror.getMode(e,n);return{startState:function(){var e=r.startState();return{html:e,php:o.startState(),curMode:t.startOpen?o:r,curState:t.startOpen?o.startState():e,curClose:t.startOpen?/^\?>/:null,mode:t.startOpen?"php":"html",pending:null}},copyState:function(e){var t=e.html,n=CodeMirror.copyState(r,t),i=e.php,s=CodeMirror.copyState(o,i),u;return e.curState==t?u=n:e.curState==i?u=s:u=CodeMirror.copyState(e.curMode,e.curState),{html:n,php:s,curMode:e.curMode,curState:u,curClose:e.curClose,mode:e.mode,pending:e.pending}},token:u,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?r.indent(e.html,t):e.curMode.indent(e.curState,t)},electricChars:"/{}:"}},"xml","clike","javascript","css"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",n)}(),CodeMirror.defineMode("pig",function(e,t){function a(e,t,n){return t.tokenize=n,n(e,t)}function l(e,t){return f=e,t}function c(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=p;break}n=r=="*"}return l("comment","comment")}function h(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!o)n.tokenize=p;return l("string","error")}}function p(e,t){var n=e.next();return n=='"'||n=="'"?a(e,t,h(n)):/[\[\]{}\(\),;\.]/.test(n)?l(n):/\d/.test(n)?(e.eatWhile(/[\w\.]/),l("number","number")):n=="/"?e.eat("*")?a(e,t,c):(e.eatWhile(u),l("operator","operator")):n=="-"?e.eat("-")?(e.skipToEnd(),l("comment","comment")):(e.eatWhile(u),l("operator","operator")):u.test(n)?(e.eatWhile(u),l("operator","operator")):(e.eatWhile(/[\w\$_]/),r&&r.propertyIsEnumerable(e.current().toUpperCase())&&!e.eat(")")&&!e.eat(".")?("keyword","keyword"):i&&i.propertyIsEnumerable(e.current().toUpperCase())?("keyword","variable-2"):s&&s.propertyIsEnumerable(e.current().toUpperCase())?("keyword","variable-3"):l("variable","pig-word"))}var n=e.indentUnit,r=t.keywords,i=t.builtins,s=t.types,o=t.multiLineStrings,u=/[*+\-%<>=&?:\/!|]/,f;return{startState:function(e){return{tokenize:p,startOfLine:!0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}var t="ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ",n="VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE NEQ MATCHES TRUE FALSE ",r="BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ";CodeMirror.defineMIME("text/x-pig",{name:"pig",builtins:e(t),keywords:e(n),types:e(r)})}(),CodeMirror.defineMode("plsql",function(e,t){function f(e,t,n){return t.tokenize=n,n(e,t)}function c(e,t){return l=e,t}function h(e,t){var n=e.next();return n=='"'||n=="'"?f(e,t,p(n)):/[\[\]{}\(\),;\.]/.test(n)?c(n):/\d/.test(n)?(e.eatWhile(/[\w\.]/),c("number","number")):n=="/"?e.eat("*")?f(e,t,d):(e.eatWhile(a),c("operator","operator")):n=="-"?e.eat("-")?(e.skipToEnd(),c("comment","comment")):(e.eatWhile(a),c("operator","operator")):n=="@"||n=="$"?(e.eatWhile(/[\w\d\$_]/),c("word","variable")):a.test(n)?(e.eatWhile(a),c("operator","operator")):(e.eatWhile(/[\w\$_]/),r&&r.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","keyword"):i&&i.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","builtin"):s&&s.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","variable-2"):o&&o.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","variable-3"):c("word","variable"))}function p(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!u)n.tokenize=h;return c("string","plsql-string")}}function d(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=h;break}n=r=="*"}return c("comment","plsql-comment")}var n=e.indentUnit,r=t.keywords,i=t.functions,s=t.types,o=t.sqlplus,u=t.multiLineStrings,a=/[+\-*&%=<>!?:\/|]/,l;return{startState:function(e){return{tokenize:h,startOfLine:!0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}var t="abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",n="abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize",r="bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2",i="appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap";CodeMirror.defineMIME("text/x-plsql",{name:"plsql",keywords:e(t),functions:e(n),types:e(r),sqlplus:e(i)})}(),CodeMirror.defineMode("properties",function(){return{token:function(e,t){var n=e.sol()||t.afterSection,r=e.eol();t.afterSection=!1,n&&(t.nextMultiline?(t.inMultiline=!0,t.nextMultiline=!1):t.position="def"),r&&!t.nextMultiline&&(t.inMultiline=!1,t.position="def");if(n)while(e.eatSpace());var i=e.next();return!n||i!=="#"&&i!=="!"&&i!==";"?n&&i==="["?(t.afterSection=!0,e.skipTo("]"),e.eat("]"),"header"):i==="="||i===":"?(t.position="quote",null):(i==="\\"&&t.position==="quote"&&e.next()!=="u"&&(t.nextMultiline=!0),t.position):(t.position="comment",e.skipToEnd(),"comment")},startState:function(){return{position:"def",nextMultiline:!1,inMultiline:!1,afterSection:!1}}}}),CodeMirror.defineMIME("text/x-properties","properties"),CodeMirror.defineMIME("text/x-ini","properties"),CodeMirror.defineMode("python",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function b(e,t){if(e.sol()){var r=t.scopes[0].offset;if(e.eatSpace()){var c=e.indentation();return c>r?y="indent":c<r&&(y="dedent"),null}r>0&&S(e,t)}if(e.eatSpace())return null;var h=e.peek();if(h==="#")return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var p=!1;e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(p=!0),e.match(/^\d+\.\d*/)&&(p=!0),e.match(/^\.\d+/)&&(p=!0);if(p)return e.eat(/J/i),"number";var d=!1;e.match(/^0x[0-9a-f]+/i)&&(d=!0),e.match(/^0b[01]+/i)&&(d=!0),e.match(/^0o[0-7]+/i)&&(d=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),d=!0),e.match(/^0(?![\dx])/i)&&(d=!0);if(d)return e.eat(/L/i),"number"}return e.match(v)?(t.tokenize=w(e.current()),t.tokenize(e,t)):e.match(a)||e.match(u)?null:e.match(o)||e.match(i)||e.match(l)?"operator":e.match(s)?null:e.match(m)?"keyword":e.match(g)?"builtin":e.match(f)?"variable":(e.next(),n)}function w(e){while("rub".indexOf(e.charAt(0).toLowerCase())>=0)e=e.substr(1);var r=e.length==1,i="string";return function(o,u){while(!o.eol()){o.eatWhile(/[^'"\\]/);if(o.eat("\\")){o.next();if(r&&o.eol())return i}else{if(o.match(e))return u.tokenize=b,i;o.eat(/['"]/)}}if(r){if(t.singleLineStringErrors)return n;u.tokenize=b}return i}}function E(t,n,r){r=r||"py";var i=0;if(r==="py"){if(n.scopes[0].type!=="py"){n.scopes[0].offset=t.indentation();return}for(var s=0;s<n.scopes.length;++s)if(n.scopes[s].type==="py"){i=n.scopes[s].offset+e.indentUnit;break}}else i=t.column()+t.current().length;n.scopes.unshift({offset:i,type:r})}function S(e,t,n){n=n||"py";if(t.scopes.length==1)return;if(t.scopes[0].type==="py"){var r=e.indentation(),i=-1;for(var s=0;s<t.scopes.length;++s)if(r===t.scopes[s].offset){i=s;break}if(i===-1)return!0;while(t.scopes[0].offset!==r)t.scopes.shift();return!1}return n==="py"?(t.scopes[0].offset=e.indentation(),!1):t.scopes[0].type!=n?!0:(t.scopes.shift(),!1)}function x(e,t){y=null;var r=t.tokenize(e,t),i=e.current();if(i===".")return r=e.match(f,!1)?null:n,r===null&&t.lastToken==="meta"&&(r="meta"),r;if(i==="@")return e.match(f,!1)?"meta":n;(r==="variable"||r==="builtin")&&t.lastToken==="meta"&&(r="meta");if(i==="pass"||i==="return")t.dedent+=1;i==="lambda"&&(t.lambda=!0),(i===":"&&!t.lambda&&t.scopes[0].type=="py"||y==="indent")&&E(e,t);var s="[({".indexOf(i);return s!==-1&&E(e,t,"])}".slice(s,s+1)),y==="dedent"&&S(e,t)?n:(s="])}".indexOf(i),s!==-1&&S(e,t,i)?n:(t.dedent>0&&e.eol()&&t.scopes[0].type=="py"&&(t.scopes.length>1&&t.scopes.shift(),t.dedent-=1),r))}var n="error",i=new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),s=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),o=new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),u=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),a=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),f=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),l=r(["and","or","not","is","in"]),c=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield"],h=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],p={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},d={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};if(!t.version||parseInt(t.version,10)!==3){c=c.concat(p.keywords),h=h.concat(p.builtins);var v=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}else{c=c.concat(d.keywords),h=h.concat(d.builtins);var v=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}var m=r(c),g=r(h),y=null,T={startState:function(e){return{tokenize:b,scopes:[{offset:e||0,type:"py"}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=x(e,t);return t.lastToken=n,e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){return e.tokenize!=b?0:e.scopes[0].offset}};return T}),CodeMirror.defineMIME("text/x-python","python"),CodeMirror.defineMode("r",function(e){function t(e){var t=e.split(" "),n={};for(var r=0;r<t.length;++r)n[t[r]]=!0;return n}function a(e,t){u=null;var a=e.next();if(a=="#")return e.skipToEnd(),"comment";if(a=="0"&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if(a=="."&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(a))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if(a=="'"||a=='"')return t.tokenize=f(a),"string";if(a=="."&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(a)&&a!="_"){e.eatWhile(/[\w\.]/);var l=e.current();return n.propertyIsEnumerable(l)?"atom":i.propertyIsEnumerable(l)?(s.propertyIsEnumerable(l)&&(u="block"),"keyword"):r.propertyIsEnumerable(l)?"builtin":"variable"}return a=="%"?(e.skipTo("%")&&e.next(),"variable-2"):a=="<"&&e.eat("-")?"arrow":a=="="&&t.ctx.argList?"arg-is":o.test(a)?a=="$"?"dollar":(e.eatWhile(o),"operator"):/[\(\){}\[\];]/.test(a)?(u=a,a==";"?"semi":null):null}function f(e){return function(t,n){if(t.eat("\\")){var r=t.next();return r=="x"?t.match(/^[a-f0-9]{2}/i):(r=="u"||r=="U")&&t.eat("{")&&t.skipTo("}")?t.next():r=="u"?t.match(/^[a-f0-9]{4}/i):r=="U"?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(r)&&t.match(/^[0-7]{1,2}/),"string-2"}var i;while((i=t.next())!=null){if(i==e){n.tokenize=a;break}if(i=="\\"){t.backUp(1);break}}return"string"}}function l(e,t,n){e.ctx={type:t,indent:e.indent,align:null,column:n.column(),prev:e.ctx}}function c(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var n=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),r=t("list quote bquote eval return call parse deparse"),i=t("if else repeat while function for in next break"),s=t("if else repeat while function for"),o=/[+\-*\/^<>=!&|~$:]/,u;return{startState:function(t){return{tokenize:a,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){e.sol()&&(t.ctx.align==null&&(t.ctx.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);n!="comment"&&t.ctx.align==null&&(t.ctx.align=!0);var r=t.ctx.type;return(u==";"||u=="{"||u=="}")&&r=="block"&&c(t),u=="{"?l(t,"}",e):u=="("?(l(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):u=="["?l(t,"]",e):u=="block"?l(t,"block",e):u==r&&c(t),t.afterIdent=n=="variable"||n=="keyword",n},indent:function(t,n){if(t.tokenize!=a)return 0;var r=n&&n.charAt(0),i=t.ctx,s=r==i.type;return i.type=="block"?i.indent+(r=="{"?0:e.indentUnit):i.align?i.column+(s?0:1):i.indent+(s?0:e.indentUnit)}}}),CodeMirror.defineMIME("text/x-rsrc","r"),CodeMirror.defineMode("changes",function(e,t){var n=/^-+$/,r=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,i=/^[\w+.-]+@[\w.-]+/;return{token:function(e){if(e.sol()){if(e.match(n))return"tag";if(e.match(r))return"tag"}return e.match(i)?"string":(e.next(),null)}}}),CodeMirror.defineMIME("text/x-rpm-changes","changes"),CodeMirror.defineMode("spec",function(e,t){var n=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,r=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,i=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,s=/^%(ifnarch|ifarch|if)/,o=/^%(else|endif)/,u=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(e,t){var a=e.peek();if(a=="#")return e.skipToEnd(),"comment";if(e.sol()){if(e.match(r))return"preamble";if(e.match(i))return"section"}if(e.match(/^\$\w+/))return"def";if(e.match(/^\$\{\w+\}/))return"def";if(e.match(o))return"keyword";if(e.match(s))return t.controlFlow=!0,"keyword";if(t.controlFlow){if(e.match(u))return"operator";if(e.match(/^(\d+)/))return"number";e.eol()&&(t.controlFlow=!1)}if(e.match(n))return"number";if(e.match(/^%[\w]+/))return e.match(/^\(/)&&(t.macroParameters=!0),"macro";if(t.macroParameters){if(e.match(/^\d+/))return"number";if(e.match(/^\)/))return t.macroParameters=!1,"macro"}return e.match(/^%\{\??[\w \-]+\}/)?"macro":(e.next(),null)}}}),CodeMirror.defineMIME("text/x-rpm-spec","spec"),CodeMirror.defineMode("rst",function(e,t){function n(e,t,n){e.fn=t,r(e,n)}function r(e,t){e.ctx=t||{}}function i(e,t){if(t&&typeof t!="string"){var r=t.current();t=r[r.length-1]}n(e,x,{back:t})}function s(e){if(e){var t=CodeMirror.listModes();for(var n in t)if(t[n]==e)return!0}return!1}function o(t){return s(t)?CodeMirror.getMode(e,t):null}function x(e,t){function c(e){return s||!t.ctx.back||e.test(t.ctx.back)}function h(t){return e.eol()||e.match(t,!1)}function p(t){return e.match(t)&&c(/\W/)&&h(/\W/)}var r,s,o;if(e.eat(/\\/))return r=e.next(),i(t,r),null;s=e.sol();if(s&&(r=e.eat(f))){for(o=0;e.eat(r);o++);if(o>=3&&e.match(/^\s*$/))return i(t,null),"header";e.backUp(o+1)}if(s&&e.match(m))return e.eol()||n(t,N),"meta";if(e.match(g)){if(!u)n(t,L);else{var l=u;n(t,L,{mode:l,local:l.startState()})}return"meta"}if(s&&e.match(S,!1)){if(!a)return n(t,L),"meta";var l=a;return n(t,L,{mode:l,local:l.startState()}),null}if(p(d))return i(t,e),"footnote";if(p(v))return i(t,e),"citation";r=e.next();if(c(y)){if(!(r!==":"&&r!=="|"||!e.eat(/\S/))){var b;return r===":"?b="builtin":b="atom",n(t,T,{ch:r,wide:!1,prev:null,token:b}),b}if(r==="*"||r==="`"){var w=r,E=!1;r=e.next(),r==w&&(E=!0,r=e.next());if(r&&!/\s/.test(r)){var b;return w==="*"?b=E?"strong":"em":b=E?"string":"string-2",n(t,T,{ch:w,wide:E,prev:null,token:b}),b}}}return i(t,r),null}function T(e,t){function o(e){return t.ctx.prev=e,s}var r=e.next(),s=t.ctx.token;if(r!=t.ctx.ch)return o(r);if(/\s/.test(t.ctx.prev))return o(r);if(t.ctx.wide){r=e.next();if(r!=t.ctx.ch)return o(r)}return!e.eol()&&!b.test(e.peek())?(t.ctx.wide&&e.backUp(1),o(r)):(n(t,x),i(t,r),s)}function N(e,t){var r=null;if(e.match(l))r="attribute";else if(e.match(c))r="link";else if(e.match(h))r="quote";else{if(!e.match(p))return e.eatSpace(),e.eol()?(i(t,e),null):(e.skipToEnd(),n(t,k),"comment");r="quote"}return n(t,C,{start:!0}),r}function C(e,t){var n="body";return!t.ctx.start||e.sol()?A(e,t,n):(e.skipToEnd(),r(t),n)}function k(e,t){return A(e,t,"comment")}function L(e,t){return u?e.sol()?(e.eatSpace()||i(t,e),null):u.token(e,t.ctx.local):A(e,t,"meta")}function A(e,t,n){return e.eol()||e.eatSpace()?(e.skipToEnd(),n):(i(t,e),null)}var u=o(t.verbatim),a=o("python"),f=/^[!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/,l=/^\s*\w([-:.\w]*\w)?::(\s|$)/,c=/^\s*_[\w-]+:(\s|$)/,h=/^\s*\[(\d+|#)\](\s|$)/,p=/^\s*\[[A-Za-z][\w-]*\](\s|$)/,d=/^\[(\d+|#)\]_/,v=/^\[[A-Za-z][\w-]*\]_/,m=/^\.\.(\s|$)/,g=/^::\s*$/,y=/^[-\s"([{</:]/,b=/^[-\s`'")\]}>/:.,;!?\\_]/,w=/^\s*((\d+|[A-Za-z#])[.)]|\((\d+|[A-Z-a-z#])\))\s/,E=/^\s*[-\+\*]\s/,S=/^\s+(>>>|In \[\d+\]:)\s/;return{startState:function(){return{fn:x,ctx:{}}},copyState:function(e){return{fn:e.fn,ctx:e.ctx}},token:function(e,t){var n=t.fn(e,t);return n}}},"python"),CodeMirror.defineMIME("text/x-rst","rst"),CodeMirror.defineMode("ruby",function(e,t){function n(e){var t={};for(var n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function a(e,t,n){return n.tokenize.push(e),e(t,n)}function f(e,t){u=null;if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(p),"comment";if(e.eatSpace())return null;var n=e.next(),r;if(n=="`"||n=="'"||n=='"'||n=="/"&&!e.eol()&&e.peek()!=" ")return a(c(n,"string",n=='"'||n=="`"),e,t);if(n=="%"){var i,s=!1;e.eat("s")?i="atom":e.eat(/[WQ]/)?(i="string",s=!0):e.eat(/[wxqr]/)&&(i="string");var f=e.eat(/[^\w\s]/);return f?(o.propertyIsEnumerable(f)&&(f=o[f]),a(c(f,i,s,!0),e,t)):"operator"}if(n=="#")return e.skipToEnd(),"comment";if(n=="<"&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return a(h(r[1]),e,t);if(n=="0")return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(n))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if(n=="?"){while(e.match(/^\\[CM]-/));return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}return n==":"?e.eat("'")?a(c("'","atom",!1),e,t):e.eat('"')?a(c('"',"atom",!0),e,t):(e.eatWhile(/[\w\?]/),"atom"):n=="@"?(e.eat("@"),e.eatWhile(/[\w\?]/),"variable-2"):n=="$"?(e.next(),e.eatWhile(/[\w\?]/),"variable-3"):/\w/.test(n)?(e.eatWhile(/[\w\?]/),e.eat(":")?"atom":"ident"):n!="|"||!t.varList&&t.lastTok!="{"&&t.lastTok!="do"?/[\(\)\[\]{}\\;]/.test(n)?(u=n,null):n=="-"&&e.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(n)?(e.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(u="|",null)}function l(){var e=1;return function(t,n){if(t.peek()=="}"){e--;if(e==0)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)}else t.peek()=="{"&&e++;return f(t,n)}}function c(e,t,n,r){return function(i,s){var o=!1,u;while((u=i.next())!=null){if(u==e&&(r||!o)){s.tokenize.pop();break}if(n&&u=="#"&&!o&&i.eat("{")){s.tokenize.push(l(arguments.callee));break}o=!o&&u=="\\"}return t}}function h(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function p(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var r=n(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload"]),i=n(["def","class","case","for","while","do","module","then","catch","loop","proc","begin"]),s=n(["end","until"]),o={"[":"]","{":"}","(":")"},u;return{startState:function(){return{tokenize:[f],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n=t.tokenize[t.tokenize.length-1](e,t),o;if(n=="ident"){var a=e.current();n=r.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(a)?"tag":t.lastTok=="def"||t.lastTok=="class"||t.varList?"def":"variable",i.propertyIsEnumerable(a)?o="indent":s.propertyIsEnumerable(a)?o="dedent":(a=="if"||a=="unless")&&e.column()==e.indentation()&&(o="indent")}if(u||n&&n!="comment")t.lastTok=a||u||n;return u=="|"&&(t.varList=!t.varList),o=="indent"||/[\(\[\{]/.test(u)?t.context={prev:t.context,type:u||n,indented:t.indented}:(o=="dedent"||/[\)\]\}]/.test(u))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine=u=="\\"||n=="operator"),n},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=f)return 0;var r=n&&n.charAt(0),i=t.context,s=i.type==o[r]||i.type=="keyword"&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return i.indented+(s?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de"}}),CodeMirror.defineMIME("text/x-ruby","ruby"),CodeMirror.defineMode("rust",function(){function u(e,t){return s=e,t}function a(e,t){var n=e.next();if(n=='"')return t.tokenize=f,t.tokenize(e,t);if(n=="'")return s="atom",e.eat("\\")?e.skipTo("'")?(e.next(),"string"):"error":(e.next(),e.eat("'")?"string":"error");if(n=="/"){if(e.eat("/"))return e.skipToEnd(),"comment";if(e.eat("*"))return t.tokenize=l(1),t.tokenize(e,t)}if(n=="#")return e.eat("[")?(s="open-attr",null):(e.eatWhile(/\w/),u("macro","meta"));if(n==":"&&e.match(":<"))return u("op",null);if(n.match(/\d/)||n=="."&&e.eat(/\d/)){var r=!1;return!e.match(/^x[\da-f]+/i)&&!e.match(/^b[01]+/)&&(e.eatWhile(/\d/),e.eat(".")&&(r=!0,e.eatWhile(/\d/)),e.match(/^e[+\-]?\d+/i)&&(r=!0)),r?e.match(/^f(?:32|64)/):e.match(/^[ui](?:8|16|32|64)/),u("atom","number")}return n.match(/[()\[\]{}:;,]/)?u(n,null):n=="-"&&e.eat(">")?u("->",null):n.match(i)?(e.eatWhile(i),u("op",null)):(e.eatWhile(/\w/),o=e.current(),e.match(/^::\w/)?(e.backUp(1),u("prefix","variable-2")):t.keywords.propertyIsEnumerable(o)?u(t.keywords[o],o.match(/true|false/)?"atom":"keyword"):u("name","variable"))}function f(e,t){var n,r=!1;while(n=e.next()){if(n=='"'&&!r)return t.tokenize=a,u("atom","string");r=!r&&n=="\\"}return u("op","string")}function l(e){return function(t,n){var r=null,i;while(i=t.next()){if(i=="/"&&r=="*"){if(e==1){n.tokenize=a;break}return n.tokenize=l(e-1),n.tokenize(t,n)}if(i=="*"&&r=="/")return n.tokenize=l(e+1),n.tokenize(t,n);r=i}return"comment"}}function h(){for(var e=arguments.length-1;e>=0;e--)c.cc.push(arguments[e])}function p(){return h.apply(null,arguments),!0}function d(e,t){var n=function(){var n=c.state;n.lexical={indented:n.indented,column:c.stream.column(),type:e,prev:n.lexical,info:t}};return n.lex=!0,n}function v(){var e=c.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function m(){c.state.keywords=r}function g(){c.state.keywords=n}function y(e,t){function n(r){return r==","?p(e,n):r==t?p():p(n)}return function(r){return r==t?p():h(e,n)}}function b(e,t){return p(d("stat",t),e,v,w)}function w(e){return e=="}"?p():e=="let"?b(L,"let"):e=="fn"?b(_):e=="type"?p(d("stat"),D,E,v,w):e=="enum"?b(P):e=="mod"?b(B):e=="iface"?b(j):e=="impl"?b(F):e=="open-attr"?p(d("]"),y(S,"]"),v):e=="ignore"||e.match(/[\]\);,]/)?p(w):h(d("stat"),S,v,E,w)}function E(e){return e==";"?p():h()}function S(e){return e=="atom"||e=="name"?p(x):e=="{"?p(d("}"),N,v):e.match(/[\[\(]/)?Q(e,S):e.match(/[\]\)\};,]/)?h():e=="if-style"?p(S,S):e=="else-style"||e=="op"?p(S):e=="for"?p(W,O,M,S,S):e=="alt"?p(S,V):e=="fn"?p(_):e=="macro"?p(K):p()}function x(e){return o=="."?p(T):o=="::<"?p(I,x):e=="op"||o==":"?p(S):e=="("||e=="["?Q(e,S):h()}function T(e){return o.match(/^\w+$/)?(c.marked="variable",p(x)):h(S)}function N(e){if(e=="op"){if(o=="|")return p(k,v,d("}","block"),w);if(o=="||")return p(v,d("}","block"),w)}return o=="mutable"||o.match(/^\w+$/)&&c.stream.peek()==":"&&!c.stream.match("::",!1)?h(C(S)):h(w)}function C(e){function t(n){return o=="mutable"||o=="with"?(c.marked="keyword",p(t)):o.match(/^\w*$/)?(c.marked="variable",p(t)):n==":"?p(e,t):n=="}"?p():p(t)}return t}function k(e){return e=="name"?(c.marked="def",p(k)):e=="op"&&o=="|"?p():p(k)}function L(e){return e.match(/[\]\)\};]/)?p():o=="="?p(S,A):e==","?p(L):h(W,O,L)}function A(e){return e.match(/[\]\)\};,]/)?h(L):h(S,A)}function O(e){return e==":"?p(m,R,g):h()}function M(e){return e=="name"&&o=="in"?(c.marked="keyword",p()):h()}function _(e){return o=="@"||o=="~"?(c.marked="keyword",p(_)):e=="name"?(c.marked="def",p(_)):o=="<"?p(I,_):e=="{"?h(S):e=="("?p(d(")"),y(q,")"),v,_):e=="->"?p(m,R,g,_):e==";"?p():p(_)}function D(e){return e=="name"?(c.marked="def",p(D)):o=="<"?p(I,D):o=="="?p(m,R,g):p(D)}function P(e){return e=="name"?(c.marked="def",p(P)):o=="<"?p(I,P):o=="="?p(m,R,g,E):e=="{"?p(d("}"),m,H,g,v):p(P)}function H(e){return e=="}"?p():e=="("?p(d(")"),y(R,")"),v,H):(o.match(/^\w+$/)&&(c.marked="def"),p(H))}function B(e){return e=="name"?(c.marked="def",p(B)):e=="{"?p(d("}"),w,v):h()}function j(e){return e=="name"?(c.marked="def",p(j)):o=="<"?p(I,j):e=="{"?p(d("}"),w,v):h()}function F(e){return o=="<"?p(I,F):o=="of"||o=="for"?(c.marked="keyword",p(R,F)):e=="name"?(c.marked="def",p(F)):e=="{"?p(d("}"),w,v):h()}function I(e){return o==">"?p():o==","?p(I):o==":"?p(R,I):h(R,I)}function q(e){return e=="name"?(c.marked="def",p(q)):e==":"?p(m,R,g):h()}function R(e){return e=="name"?(c.marked="variable-3",p(U)):o=="mutable"?(c.marked="keyword",p(R)):e=="atom"?p(U):e=="op"||e=="obj"?p(R):e=="fn"?p(z):e=="{"?p(d("{"),C(R),v):Q(e,R)}function U(e){return o=="<"?p(I):h()}function z(e){return e=="("?p(d("("),y(R,")"),v,z):e=="->"?p(R):h()}function W(e){return e=="name"?(c.marked="def",p(X)):e=="atom"?p(X):e=="op"?p(W):e.match(/[\]\)\};,]/)?h():Q(e,W)}function X(e){return e=="op"&&o=="."?p():o=="to"?(c.marked="keyword",p(W)):h()}function V(e){return e=="{"?p(d("}","alt"),$,v):h()}function $(e){return e=="}"?p():e=="|"?p($):o=="when"?(c.marked="keyword",p(S,J)):e.match(/[\]\);,]/)?p($):h(W,J)}function J(e){return e=="{"?p(d("}","alt"),w,v,$):h($)}function K(e){return e.match(/[\[\(\{]/)?Q(e,S):h()}function Q(e,t){return e=="["?p(d("]"),y(t,"]"),v):e=="("?p(d(")"),y(t,")"),v):e=="{"?p(d("}"),y(t,"}"),v):p()}function G(e,t,n){var r=e.cc;c.state=e,c.stream=t,c.marked=null,c.cc=r;for(;;){var i=r.length?r.pop():w;if(i(s)){while(r.length&&r[r.length-1].lex)r.pop()();return c.marked||n}}}var e=4,t=2,n={"if":"if-style","while":"if-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom"},r=function(){var e={fn:"fn",block:"fn",obj:"obj"},t="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" ");for(var n=0,r=t.length;n<r;++n)e[t[n]]="atom";return e}(),i=/[+\-*&%=<>!?|\.@]/,s,o,c={state:null,stream:null,marked:null,cc:null};return v.lex=m.lex=g.lex=!0,{startState:function(){return{tokenize:a,cc:[],lexical:{indented:-e,column:0,type:"top",align:!1},keywords:n,indented:0}},token:function(e,t){e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation());if(e.eatSpace())return null;s=o=null;var n=t.tokenize(e,t);return n=="comment"?n:(t.lexical.hasOwnProperty("align")||(t.lexical.align=!0),s=="prefix"?n:(o||(o=e.current()),G(t,e,n)))},indent:function(n,r){if(n.tokenize!=a)return 0;var i=r&&r.charAt(0),s=n.lexical,o=s.type,u=i==o;return o=="stat"?s.indented+e:s.align?s.column+(u?0:1):s.indented+(u?0:s.info=="alt"?t:e)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-rustsrc","rust"),CodeMirror.defineMode("scheme",function(e,t){function c(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function d(e,t,n){this.indent=e,this.type=t,this.prev=n}function v(e,t,n){e.indentStack=new d(t,n,e.indentStack)}function m(e){e.indentStack=e.indentStack.prev}function E(e){return e.match(g)}function S(e){return e.match(y)}function x(e,t){return t===!0&&e.backUp(1),e.match(w)}function T(e){return e.match(b)}var n="builtin",r="comment",i="string",s="atom",o="number",u="bracket",a="keyword",f=2,l=1,h=c("\u03bb case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),p=c("define let letrec let* lambda"),g=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),y=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),b=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),w=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(e,t){t.indentStack==null&&e.sol()&&(t.indentation=e.indentation());if(e.eatSpace())return null;var a=null;switch(t.mode){case"string":var l,c=!1;while((l=e.next())!=null){if(l=='"'&&!c){t.mode=!1;break}c=!c&&l=="\\"}a=i;break;case"comment":var l,d=!1;while((l=e.next())!=null){if(l=="#"&&d){t.mode=!1;break}d=l=="|"}a=r;break;case"s-expr-comment":t.mode=!1;if(e.peek()!="("&&e.peek()!="["){e.eatWhile(/[^/s]/),a=r;break}t.sExprComment=0;default:var g=e.next();if(g=='"')t.mode="string",a=i;else if(g=="'")a=s;else if(g=="#")if(e.eat("|"))t.mode="comment",a=r;else if(e.eat(/[tf]/i))a=s;else if(e.eat(";"))t.mode="s-expr-comment",a=r;else{var y=null,b=!1,w=!0;e.eat(/[ei]/i)?b=!0:e.backUp(1),e.match(/^#b/i)?y=E:e.match(/^#o/i)?y=S:e.match(/^#x/i)?y=T:e.match(/^#d/i)?y=x:e.match(/^[-+0-9.]/,!1)?(w=!1,y=x):b||e.eat("#"),y!=null&&(w&&!b&&e.match(/^#[ei]/i),y(e)&&(a=o))}else if(/^[-+0-9.]/.test(g)&&x(e,!0))a=o;else if(g==";")e.skipToEnd(),a=r;else if(g=="("||g=="["){var N="",C=e.column();while((letter=e.eat(/[^\s\(\[\;\)\]]/))!=null)N+=letter;N.length>0&&p.propertyIsEnumerable(N)?v(t,C+f,g):(e.eatSpace(),e.eol()||e.peek()==";"?v(t,C+1,g):v(t,C+e.current().length,g)),e.backUp(e.current().length-1),typeof t.sExprComment=="number"&&t.sExprComment++,a=u}else g==")"||g=="]"?(a=u,t.indentStack!=null&&t.indentStack.type==(g==")"?"(":"[")&&(m(t),typeof t.sExprComment=="number"&&--t.sExprComment==0&&(a=r,t.sExprComment=!1))):(e.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),h&&h.propertyIsEnumerable(e.current())?a=n:a="variable")}return typeof t.sExprComment=="number"?r:a},indent:function(e,t){return e.indentStack==null?e.indentation:e.indentStack.indent}}}),CodeMirror.defineMIME("text/x-scheme","scheme"),CodeMirror.defineMode("shell",function(e){function n(e,n){var r=n.split(" ");for(var i=0;i<r.length;i++)t[r[i]]=e}function r(e,n){var r=e.sol(),u=e.next();if(u==="'"||u==='"'||u==="`")return n.tokens.unshift(i(u)),o(e,n);if(u==="#")return r&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if(u==="$")return n.tokens.unshift(s),o(e,n);if(u==="+"||u==="=")return"operator";if(u==="-")return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(u)){e.eatWhile(/\d/);if(!/\w/.test(e.peek()))return"number"}e.eatWhile(/\w/);var a=e.current();return e.peek()==="="&&/\w+/.test(a)?"def":t[a]||null}function i(e){return function(t,n){var r,i=!1,o=!1;while((r=t.next())!=null){if(r===e&&!o){i=!0;break}if(r==="$"&&!o&&e!=="'"){o=!0,t.backUp(1),n.tokens.unshift(s);break}o=!o&&r==="\\"}return(i||!o)&&n.tokens.shift(),e==="`"||e===")"?"quote":"string"}}function o(e,t){return(t.tokens[0]||r)(e,t)}var t={};n("atom","true false"),n("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),n("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var s=function(e,t){t.tokens.length>1&&e.eat("$");var n=e.next(),r=/\w/;return n==="{"&&(r=/[^}]/),n==="("?(t.tokens[0]=i(")"),o(e,t)):(/\d/.test(n)||(e.eatWhile(r),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return e.eatSpace()?null:o(e,t)}}}),CodeMirror.defineMIME("text/x-sh","shell"),CodeMirror.defineMode("smalltalk",function(e,t){var n=/[+\-/\\*~<>=@%|&?!.:;^]/,r=/true|false|nil|self|super|thisContext/,i=function(e,t){this.next=e,this.parent=t},s=function(e,t,n){this.name=e,this.context=t,this.eos=n},o=function(){this.context=new i(u,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};o.prototype.userIndent=function(t){this.userIndentationDelta=t>0?t/e.indentUnit-this.indentation:0};var u=function(e,t,o){var u=new s(null,t,!1),c=e.next();return c==='"'?u=a(e,new i(a,t)):c==="'"?u=f(e,new i(f,t)):c==="#"?(e.eatWhile(/[^ .]/),u.name="string-2"):c==="$"?(e.eatWhile(/[^ ]/),u.name="string-2"):c==="|"&&o.expectVariable?u.context=new i(l,t):/[\[\]{}()]/.test(c)?(u.name="bracket",u.eos=/[\[{(]/.test(c),c==="["?o.indentation++:c==="]"&&(o.indentation=Math.max(0,o.indentation-1))):n.test(c)?(e.eatWhile(n),u.name="operator",u.eos=c!==";"):/\d/.test(c)?(e.eatWhile(/[\w\d]/),u.name="number"):/[\w_]/.test(c)?(e.eatWhile(/[\w\d_]/),u.name=o.expectVariable?r.test(e.current())?"keyword":"variable":null):u.eos=o.expectVariable,u},a=function(e,t){return e.eatWhile(/[^"]/),new s("comment",e.eat('"')?t.parent:t,!0)},f=function(e,t){return e.eatWhile(/[^']/),new s("string",e.eat("'")?t.parent:t,!1)},l=function(e,t,n){var r=new s(null,t,!1),i=e.next();return i==="|"?(r.context=t.parent,r.eos=!0):(e.eatWhile(/[^|]/),r.name="variable"),r};return{startState:function(){return new o},token:function(e,t){t.userIndent(e.indentation());if(e.eatSpace())return null;var n=t.context.next(e,t.context,t);return t.context=n.context,t.expectVariable=n.eos,t.lastToken=n,n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var r=t.context.next===u&&n&&n.charAt(0)==="]"?-1:t.userIndentationDelta;return(t.indentation+r)*e.indentUnit},electricChars:"]"}}),CodeMirror.defineMIME("text/x-stsrc",{name:"smalltalk"}),CodeMirror.defineMode("smarty",function(e,t){function u(e,t){return r=t,e}function a(e,t){function n(n){return t.tokenize=n,n(e,t)}return e.match(s,!0)?e.eat("*")?n(c("comment","*"+o)):(t.tokenize=f,"tag"):(e.next(),null)}function f(e,t){if(e.match(o,!0))return t.tokenize=a,u("tag",null);var s=e.next();if(s=="$")return e.eatWhile(i.validIdentifier),u("variable-2","variable");if(s==".")return u("operator","property");if(i.stringChar.test(s))return t.tokenize=l(s),u("string","string");if(i.operatorChars.test(s))return e.eatWhile(i.operatorChars),u("operator","operator");if(s=="["||s=="]")return u("bracket","bracket");if(/\d/.test(s))return e.eatWhile(/\d/),u("number","number");if(t.last=="variable"){if(s=="@")return e.eatWhile(i.validIdentifier),u("property","property");if(s=="|")return e.eatWhile(i.validIdentifier),u("qualifier","modifier")}else{if(t.last=="whitespace")return e.eatWhile(i.validIdentifier),u("attribute","modifier");if(t.last=="property")return e.eatWhile(i.validIdentifier),u("property",null);if(/\s/.test(s))return r="whitespace",null}var f="";s!="/"&&(f+=s);var c="";while(c=e.eat(i.validIdentifier))f+=c;var h,p;for(h=0,p=n.length;h<p;h++)if(n[h]==f)return u("keyword","keyword");return/\s/.test(s)?null:u("tag","tag")}function l(e){return function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=f;break}return"string"}}function c(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=a;break}n.next()}return e}}var n=["debug","extends","function","include","literal"],r,i={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9\_]/,stringChar:/[\'\"]/},s=typeof e.mode.leftDelimiter!="undefined"?e.mode.leftDelimiter:"{",o=typeof e.mode.rightDelimiter!="undefined"?e.mode.rightDelimiter:"}";return{startState:function(){return{tokenize:a,mode:"smarty",last:null}},token:function(e,t){var n=t.tokenize(e,t);return t.last=r,n},electricChars:""}}),CodeMirror.defineMIME("text/x-smarty","smarty"),CodeMirror.defineMode("sparql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r=="#")return e.skipToEnd(),"comment";if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var u=e.current(),f;return i.test(u)?null:s.test(u)?"keyword":"variable"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function l(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")f(t,")",e.column());else if(n=="[")f(t,"]",e.column());else if(n=="{")f(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")l(t);t.context&&n==t.context.type&&l(t)}else n=="."&&t.context&&t.context.type=="pattern"?l(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?f(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("application/x-sparql-query","sparql"),CodeMirror.defineMode("stex",function(e,t){function n(e,t){e.cmdState.push(t)}function r(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function i(e){if(e.cmdState.length>0){var t=e.cmdState.pop();t.closeBracket()}}function s(e){var t=e.cmdState;for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.name=="DEFAULT")continue;return r.styleIdentifier()}return null}function o(e,t,n,r){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=r,this.brackets=n,this.styleIdentifier=function(e){return this.bracketNo<=this.styles.length?this.styles[this.bracketNo-1]:null},this.openBracket=function(e){return this.bracketNo++,"bracket"},this.closeBracket=function(e){}}}function a(e,t){e.f=t}function f(e,t){if(e.match(/^\\[a-zA-Z@]+/)){var i=e.current();i=i.substr(1,i.length-1);var o;return u.hasOwnProperty(i)?o=u[i]:o=u.DEFAULT,o=new o,n(t,o),a(t,c),o.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";var f=e.next();if(f=="%")return e.eol()||a(t,l),"comment";if(f=="}"||f=="]")return o=r(t),o?(o.closeBracket(f),a(t,c),"bracket"):"error";return f=="{"||f=="["?(o=u.DEFAULT,o=new o,n(t,o),"bracket"):/\d/.test(f)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w-_]/),s(t))}function l(e,t){return e.skipToEnd(),a(t,f),"comment"}function c(e,t){var n=e.peek();if(n=="{"||n=="["){var s=r(t),o=s.openBracket(n);return e.eat(n),a(t,f),"bracket"}return/[ \t\r]/.test(n)?(e.eat(n),null):(a(t,f),s=r(t),s&&i(t),f(e,t))}var u=new Array;return u.importmodule=o("importmodule","tag","{[",["string","builtin"]),u.documentclass=o("documentclass","tag","{[",["","atom"]),u.usepackage=o("documentclass","tag","[",["atom"]),u.begin=o("documentclass","tag","[",["atom"]),u.end=o("documentclass","tag","[",["atom"]),u.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=function(e){},this.openBracket=function(e){},this.closeBracket=function(e){}},{startState:function(){return{f:f,cmdState:[]}},copyState:function(e){return{f:e.f,cmdState:e.cmdState.slice(0,e.cmdState.length)}},token:function(e,t){var n=t.f(e,t),r=e.current();return n}}}),CodeMirror.defineMIME("text/x-stex","stex"),CodeMirror.defineMIME("text/x-latex","stex"),CodeMirror.defineMode("tiddlywiki",function(e,t){function y(e,t,n){return t.tokenize=n,n(e,t)}function b(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function S(e,t,n){return w=e,E=n,t}function x(e,t){var n=e.sol(),i,v;t.block=!1,i=e.peek();if(n&&/[<\/\*{}\-]/.test(i)){if(e.match(d))return t.block=!0,y(e,t,k);if(e.match(f))return S("quote","quote");if(e.match(u)||e.match(a))return S("code","comment");if(e.match(l)||e.match(c)||e.match(h)||e.match(p))return S("code","comment");if(e.match(o))return S("hr","hr")}i=e.next();if(n&&/[\/\*!#;:>|]/.test(i)){if(i=="!")return e.skipToEnd(),S("header","header");if(i=="*")return e.eatWhile("*"),S("list","comment");if(i=="#")return e.eatWhile("#"),S("list","comment");if(i==";")return e.eatWhile(";"),S("list","comment");if(i==":")return e.eatWhile(":"),S("list","comment");if(i==">")return e.eatWhile(">"),S("quote","quote");if(i=="|")return S("table","header")}if(i=="{"&&e.match(/\{\{/))return y(e,t,k);if(/[hf]/i.test(i)&&/[ti]/i.test(e.peek())&&e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return S("link","link");if(i=='"')return S("string","string");if(i=="~")return S("text","brace");if(/[\[\]]/.test(i)&&e.peek()==i)return e.next(),S("brace","brace");if(i=="@")return e.eatWhile(s),S("link","link");if(/\d/.test(i))return e.eatWhile(/\d/),S("number","number");if(i=="/"){if(e.eat("%"))return y(e,t,N);if(e.eat("/"))return y(e,t,L)}if(i=="_"&&e.eat("_"))return y(e,t,A);if(i=="-"&&e.eat("-")){if(e.peek()!=" ")return y(e,t,O);if(e.peek()==" ")return S("text","brace")}if(i=="'"&&e.eat("'"))return y(e,t,C);if(i!="<")return S(i);if(e.eat("<"))return y(e,t,M);e.eatWhile(/[\w\$_]/);var m=e.current(),g=r.propertyIsEnumerable(m)&&r[m];return g?S(g.type,g.style,m):S("text",null,m)}function T(e){return function(t,n){return b(t,e)||(n.tokenize=x),S("string","string")}}function N(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=x;break}n=r=="%"}return S("comment","comment")}function C(e,t){var n=!1,r;while(r=e.next()){if(r=="'"&&n){t.tokenize=x;break}n=r=="'"}return S("text","strong")}function k(e,t){var n,r=t.block;return r&&e.current()?S("code","comment"):!r&&e.match(g)?(t.tokenize=x,S("code","comment")):r&&e.sol()&&e.match(v)?(t.tokenize=x,S("code","comment")):(n=e.next(),r?S("code","comment"):S("code","comment"))}function L(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=x;break}n=r=="/"}return S("text","em")}function A(e,t){var n=!1,r;while(r=e.next()){if(r=="_"&&n){t.tokenize=x;break}n=r=="_"}return S("text","underlined")}function O(e,t){var n=!1,r,i;while(r=e.next()){if(r=="-"&&n){t.tokenize=x;break}n=r=="-"}return S("text","strikethrough")}function M(e,t){var n,r,s,o;return e.current()=="<<"?S("brace","macro"):(n=e.next(),n?n==">"&&e.peek()==">"?(e.next(),t.tokenize=x,S("brace","macro")):(e.eatWhile(/[\w\$_]/),s=e.current(),o=i.propertyIsEnumerable(s)&&i[s],o?S(o.type,o.style,s):S("macro",null,s)):(t.tokenize=x,S(n)))}var n=e.indentUnit,r=function(){function e(e){return{type:e,style:"text"}}return{}}(),i=function(){function e(e){return{type:e,style:"macro"}}return{allTags:e("allTags"),closeAll:e("closeAll"),list:e("list"),newJournal:e("newJournal"),newTiddler:e("newTiddler"),permaview:e("permaview"),saveChanges:e("saveChanges"),search:e("search"),slider:e("slider"),tabs:e("tabs"),tag:e("tag"),tagging:e("tagging"),tags:e("tags"),tiddler:e("tiddler"),timeline:e("timeline"),today:e("today"),version:e("version"),option:e("option"),"with":e("with"),filter:e("filter")}}(),s=/[\w_\-]/i,o=/^\-\-\-\-+$/,u=/^\/\*\*\*$/,a=/^\*\*\*\/$/,f=/^<<<$/,l=/^\/\/\{\{\{$/,c=/^\/\/\}\}\}$/,h=/^<!--\{\{\{-->$/,p=/^<!--\}\}\}-->$/,d=/^\{\{\{$/,v=/^\}\}\}$/,m=/\{\{\{/,g=/.*?\}\}\}/,w,E;return{startState:function(e){return{tokenize:x,indented:0,level:0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},electricChars:""}}),CodeMirror.defineMIME("text/x-tiddlywiki","tiddlywiki"),CodeMirror.defineMode("tiki",function(e,t){function n(e,t,n){return function(r,s){while(!r.eol()){if(r.match(t)){s.tokenize=i;break}r.next()}return n&&(s.tokenize=n),e}}function r(e,t){return function(t,n){while(!t.eol())t.next();return n.tokenize=i,e}}function i(e,t){function s(n){return t.tokenize=n,n(e,t)}var o=e.sol(),f=e.next();switch(f){case"{":u=e.eat("/")?"closeTag":"openTag",e.eatSpace(),tagName="";var l;while(l=e.eat(/[^\s\u00a0=\"\'\/?(}]/))tagName+=l;return t.tokenize=a,"tag";case"_":if(e.eat("_"))return s(n("strong","__",i));break;case"'":if(e.eat("'"))return s(n("em","''",i));break;case"(":if(e.eat("("))return s(n("variable-2","))",i));break;case"[":return s(n("variable-3","]",i));case"|":if(e.eat("|"))return s(n("comment","||"));break;case"-":if(e.eat("="))return s(n("header string","=-",i));if(e.eat("-"))return s(n("error tw-deleted","--",i));break;case"=":if(e.match("=="))return s(n("tw-underline","===",i));break;case":":if(e.eat(":"))return s(n("comment","::"));break;case"^":return s(n("tw-box","^"));case"~":if(e.match("np~"))return s(n("meta","~/np~"))}if(o)switch(f){case"!":return e.match("!!!!!")?s(r("header string")):e.match("!!!!")?s(r("header string")):e.match("!!!")?s(r("header string")):e.match("!!")?s(r("header string")):s(r("header string"));case"*":case"#":case"+":return s(r("tw-listitem bracket"))}return null}function a(e,t){var n=e.next(),r=e.peek();return n=="}"?(t.tokenize=i,"tag"):n=="("||n==")"?"bracket":n=="="?(u="equals",r==">"&&(n=e.next(),r=e.peek()),/[\'\"]/.test(r)||(t.tokenize=l()),"operator"):/[\'\"]/.test(n)?(t.tokenize=f(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function f(e){return function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=a;break}return"string"}}function l(){return function(e,t){while(!e.eol()){var n=e.next(),r=e.peek();if(n==" "||n==","||/[ )}]/.test(r)){t.tokenize=a;break}}return"string"}}function p(){for(var e=arguments.length-1;e>=0;e--)c.cc.push(arguments[e])}function d(){return p.apply(null,arguments),!0}function v(e,t){var n=c.context&&c.context.noIndent;c.context={prev:c.context,pluginName:e,indent:c.indented,startOfLine:t,noIndent:n}}function m(){c.context&&(c.context=c.context.prev)}function g(e){if(e=="openPlugin")return c.pluginName=o,d(w,y(c.startOfLine));if(e=="closePlugin"){var t=!1;return c.context?(t=c.context.pluginName!=o,m()):t=!0,t&&(h="error"),d(b(t))}return e=="string"?((!c.context||c.context.name!="!cdata")&&v("!cdata"),c.tokenize==i&&m(),d()):d()}function y(e){return function(t){return t=="selfclosePlugin"||t=="endPlugin"?d():t=="endPlugin"?(v(c.pluginName,e),d()):d()}}function b(e){return function(t){return e&&(h="error"),t=="endPlugin"?d():p()}}function w(e){return e=="keyword"?(h="attribute",d(w)):e=="equals"?d(E,w):p()}function E(e){return e=="keyword"?(h="string",d()):e=="string"?d(S):p()}function S(e){return e=="string"?d(S):p()}var s=e.indentUnit,o,u,c,h;return{startState:function(){return{tokenize:i,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,t){e.sol()&&(t.startOfLine=!0,t.indented=e.indentation());if(e.eatSpace())return null;h=u=o=null;var n=t.tokenize(e,t);if((n||u)&&n!="comment"){c=t;for(;;){var r=t.cc.pop()||g;if(r(u||n))break}}return t.startOfLine=!1,h||n},indent:function(e,t){var n=e.context;if(n&&n.noIndent)return 0;n&&/^{\//.test(t)&&(n=n.prev);while(n&&!n.startOfLine)n=n.prev;return n?n.indent+s:0},compareStates:function(e,t){if(e.indented!=t.indented||e.pluginName!=t.pluginName)return!1;for(var n=e.context,r=t.context;;n=n.prev,r=r.prev){if(!n||!r)return n==r;if(n.pluginName!=r.pluginName)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("text/tiki","tiki"),CodeMirror.defineMode("vb",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function N(e,t){t.currentIndent++}function C(e,t){t.currentIndent--}function k(e,t){if(e.eatSpace())return null;var r=e.peek();if(r==="'")return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var l=!1;e.match(/^\d*\.\d+F?/i)?l=!0:e.match(/^\d+\.\d*F?/)?l=!0:e.match(/^\.\d+F?/)&&(l=!0);if(l)return e.eat(/J/i),"number";var c=!1;e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0);if(c)return e.eat(/L/i),"number"}return e.match(y)?(t.tokenize=L(e.current()),t.tokenize(e,t)):e.match(a)||e.match(u)?null:e.match(o)||e.match(i)||e.match(p)?"operator":e.match(s)?null:e.match(x)?(N(e,t),t.doInCurrentLine=!0,"keyword"):e.match(b)?(t.doInCurrentLine?t.doInCurrentLine=!1:N(e,t),"keyword"):e.match(w)?"keyword":e.match(S)?(C(e,t),C(e,t),"keyword"):e.match(E)?(C(e,t),"keyword"):e.match(g)?"keyword":e.match(m)?"keyword":e.match(f)?"variable":(e.next(),n)}function L(e){var r=e.length==1,i="string";return function(o,u){while(!o.eol()){o.eatWhile(/[^'"]/);if(o.match(e))return u.tokenize=k,i;o.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return n;u.tokenize=k}return i}}function A(e,t){var r=t.tokenize(e,t),i=e.current();if(i===".")return r=t.tokenize(e,t),i=e.current(),r==="variable"?"variable":n;var s="[({".indexOf(i);return s!==-1&&N(e,t),T==="dedent"&&C(e,t)?n:(s="])}".indexOf(i),s!==-1&&C(e,t)?n:r)}var n="error",i=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),s=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),o=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),u=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),a=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),f=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),l=["class","module","sub","enum","select","while","if","function","get","set","property"],c=["else","elseif","case"],h=["next","loop"],p=r(["and","or","not","xor","in"]),d=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],v=["integer","string","double","decimal","boolean","short","char","float","single"],m=r(d),g=r(v),y='"',b=r(l),w=r(c),E=r(h),S=r(["end"]),x=r(["do"]),T=null,O={electricChars:"dDpPtTfFeE ",startState:function(e){return{tokenize:k,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=A(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(E)||r.match(S)||r.match(w)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return O}),CodeMirror.defineMIME("text/x-vb","vb"),CodeMirror.defineMode("vbscript",function(){var e=/^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im;return{token:function(t){if(t.eatSpace())return null;var n=t.next();if(n=="'")return t.skipToEnd(),"comment";if(n=='"')return t.skipTo('"'),"string";if(/\w/.test(n)){t.eatWhile(/\w/);if(e.test(t.current()))return"keyword"}return null}}}),CodeMirror.defineMIME("text/vbscript","vbscript"),CodeMirror.defineMode("velocity",function(e){function t(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function a(e,t,n){return t.tokenize=n,n(e,t)}function f(e,t){var n=t.beforeParams;t.beforeParams=!1;var u=e.next();if(u!='"'&&u!="'"||!t.inParams){if(/[\[\]{}\(\),;\.]/.test(u))return u=="("&&n?t.inParams=!0:u==")"&&(t.inParams=!1),null;if(/\d/.test(u))return e.eatWhile(/[\w\.]/),"number";if(u=="#"&&e.eat("*"))return a(e,t,c);if(u=="#"&&e.match(/ *\[ *\[/))return a(e,t,h);if(u=="#"&&e.eat("#"))return e.skipToEnd(),"comment";if(u=="$")return e.eatWhile(/[\w\d\$_\.{}]/),s&&s.propertyIsEnumerable(e.current().toLowerCase())?"keyword":(t.beforeParams=!0,"builtin");if(o.test(u))return e.eatWhile(o),"operator";e.eatWhile(/[\w\$_{}]/);var f=e.current().toLowerCase();return r&&r.propertyIsEnumerable(f)?"keyword":i&&i.propertyIsEnumerable(f)||e.current().match(/^#[a-z0-9_]+ *$/i)&&e.peek()=="("?(t.beforeParams=!0,"keyword"):null}return a(e,t,l(u))}function l(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}return s&&(n.tokenize=f),"string"}}function c(e,t){var n=!1,r;while(r=e.next()){if(r=="#"&&n){t.tokenize=f;break}n=r=="*"}return"comment"}function h(e,t){var n=0,r;while(r=e.next()){if(r=="#"&&n==2){t.tokenize=f;break}r=="]"?n++:r!=" "&&(n=0)}return"meta"}var n=e.indentUnit,r=t("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),i=t("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),s=t("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount"),o=/[+\-*&%=<>!?:\/|]/,u=!0;return{startState:function(e){return{tokenize:f,beforeParams:!1,inParams:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),CodeMirror.defineMIME("text/velocity","velocity"),CodeMirror.defineMode("verilog",function(e,t){function l(e,t){var n=e.next();if(o[n]){var u=o[n](e,t);if(u!==!1)return u}if(n=='"')return t.tokenize=c(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return f=n,null;if(/[\d']/.test(n))return e.eatWhile(/[\w\.']/),"number";if(n=="/"){if(e.eat("*"))return t.tokenize=h,h(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(a.test(n))return e.eatWhile(a),"operator";e.eatWhile(/[\w\$_]/);var l=e.current();return r.propertyIsEnumerable(l)?(i.propertyIsEnumerable(l)&&(f="newstatement"),"keyword"):s.propertyIsEnumerable(l)?"atom":"variable"}function c(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!u)n.tokenize=l;return"string"}}function h(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=l;break}n=r=="*"}return"comment"}function p(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function d(e,t,n){return e.context=new p(e.indented,t,n,null,e.context)}function v(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var n=e.indentUnit,r=t.keywords||{},i=t.blockKeywords||{},s=t.atoms||{},o=t.hooks||{},u=t.multiLineStrings,a=/[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/,f;return{startState:function(e){return{tokenize:null,context:new p((e||0)-n,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0);if(e.eatSpace())return null;f=null;var r=(t.tokenize||l)(e,t);if(r=="comment"||r=="meta")return r;n.align==null&&(n.align=!0);if(f!=";"&&f!=":"||n.type!="statement")if(f=="{")d(t,e.column(),"}");else if(f=="[")d(t,e.column(),"]");else if(f=="(")d(t,e.column(),")");else if(f=="}"){while(n.type=="statement")n=v(t);n.type=="}"&&(n=v(t));while(n.type=="statement")n=v(t)}else f==n.type?v(t):(n.type=="}"||n.type=="top"||n.type=="statement"&&f=="newstatement")&&d(t,e.column(),"statement");else v(t);return t.startOfLine=!1,r},indent:function(e,t){if(e.tokenize!=l&&e.tokenize!=null)return 0;var r=t&&t.charAt(0),i=e.context,s=r==i.type;return i.type=="statement"?i.indented+(r=="{"?0:n):i.align?i.column+(s?0:1):i.indented+(s?0:n)},electricChars:"{}"}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function r(e,t){return e.eatWhile(/[\w\$_]/),"meta"}function i(e,t){var n;while((n=e.next())!=null)if(n=='"'&&!e.eat('"')){t.tokenize=null;break}return"string"}var t="always and assign automatic begin buf bufif0 bufif1 case casex casez cell cmos config deassign default defparam design disable edge else end endcase endconfig endfunction endgenerate endmodule endprimitive endspecify endtable endtask event for force forever fork function generate genvar highz0 highz1 if ifnone incdir include initial inout input instance integer join large liblist library localparam macromodule medium module nand negedge nmos nor noshowcancelled not notif0 notif1 or output parameter pmos posedge primitive pull0 pull1 pulldown pullup pulsestyle_onevent pulsestyle_ondetect rcmos real realtime reg release repeat rnmos rpmos rtran rtranif0 rtranif1 scalared showcancelled signed small specify specparam strong0 strong1 supply0 supply1 table task time tran tranif0 tranif1 tri tri0 tri1 triand trior trireg unsigned use vectored wait wand weak0 weak1 while wire wor xnor xor",n="begin bufif0 bufif1 case casex casez config else end endcase endconfig endfunction endgenerate endmodule endprimitive endspecify endtable endtask for forever function generate if ifnone macromodule module primitive repeat specify table task while";CodeMirror.defineMIME("text/x-verilog",{name:"verilog",keywords:e(t),blockKeywords:e(n),atoms:e("null"),hooks:{"`":r,$:r}})}(),CodeMirror.defineMode("xml",function(e,t){function u(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if(r=="<"){if(e.eat("!"))return e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null;if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta";o=e.eat("/")?"closeTag":"openTag",e.eatSpace(),s="";var i;while(i=e.eat(/[^\s\u00a0=<>\"\'\/?]/))s+=i;return t.tokenize=a,"tag"}if(r=="&"){var u;return e.eat("#")?e.eat("x")?u=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):u=e.eatWhile(/[\d]/)&&e.eat(";"):u=e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),u?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();return n==">"||n=="/"&&e.eat(">")?(t.tokenize=u,o=n==">"?"endTag":"selfcloseTag","tag"):n=="="?(o="equals",null):/[\'\"]/.test(n)?(t.tokenize=f(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function f(e){return function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=a;break}return"string"}}function l(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=u;break}n.next()}return e}}function c(e){return function(t,n){var r;while((r=t.next())!=null){if(r=="<")return n.tokenize=c(e+1),n.tokenize(t,n);if(r==">"){if(e==1){n.tokenize=u;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function d(){for(var e=arguments.length-1;e>=0;e--)h.cc.push(arguments[e])}function v(){return d.apply(null,arguments),!0}function m(e,t){var n=r.doNotIndent.hasOwnProperty(e)||h.context&&h.context.noIndent;h.context={prev:h.context,tagName:e,indent:h.indented,startOfLine:t,noIndent:n}}function g(){h.context&&(h.context=h.context.prev)}function y(e){if(e=="openTag")return h.tagName=s,v(S,b(h.startOfLine));if(e=="closeTag"){var t=!1;return h.context?h.context.tagName!=s&&(r.implicitlyClosed.hasOwnProperty(h.context.tagName.toLowerCase())&&g(),t=!h.context||h.context.tagName!=s):t=!0,t&&(p="error"),v(w(t))}return v()}function b(e){return function(t){return t=="selfcloseTag"||t=="endTag"&&r.autoSelfClosers.hasOwnProperty(h.tagName.toLowerCase())?(E(h.tagName.toLowerCase()),v()):t=="endTag"?(E(h.tagName.toLowerCase()),m(h.tagName,e),v()):v()}}function w(e){return function(t){return e&&(p="error"),t=="endTag"?(g(),v()):(p="error",v(arguments.callee))}}function E(e){var t;for(;;){if(!h.context)return;t=h.context.tagName.toLowerCase();if(!r.contextGrabbers.hasOwnProperty(t)||!r.contextGrabbers[t].hasOwnProperty(e))return;g()}}function S(e){return e=="word"?(p="attribute",v(x,S)):e=="endTag"||e=="selfcloseTag"?d():(p="error",v(S))}function x(e){return e=="equals"?v(T,S):(r.allowMissing||(p="error"),e=="endTag"||e=="selfcloseTag"?d():v())}function T(e){return e=="string"?v(N):e=="word"&&r.allowUnquoted?(p="string",v()):(p="error",e=="endTag"||e=="selfCloseTag"?d():v())}function N(e){return e=="string"?v(N):d()}var n=e.indentUnit,r=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},i=t.alignCDATA,s,o,h,p;return{startState:function(){return{tokenize:u,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(e,t){e.sol()&&(t.startOfLine=!0,t.indented=e.indentation());if(e.eatSpace())return null;p=o=s=null;var n=t.tokenize(e,t);t.type=o;if((n||o)&&n!="comment"){h=t;for(;;){var r=t.cc.pop()||y;if(r(o||n))break}}return t.startOfLine=!1,p||n},indent:function(e,t,r){var s=e.context;if(e.tokenize!=a&&e.tokenize!=u||s&&s.noIndent)return r?r.match(/^(\s*)/)[0].length:0;if(i&&/<!\[CDATA\[/.test(t))return 0;s&&/^<\//.test(t)&&(s=s.prev);while(s&&!s.startOfLine)s=s.prev;return s?s.indent+n:0},compareStates:function(e,t){if(e.indented!=t.indented||e.tokenize!=t.tokenize)return!1;for(var n=e.context,r=t.context;;n=n.prev,r=r.prev){if(!n||!r)return n==r;if(n.tagName!=r.tagName||n.indent!=r.indent)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("xquery",function(e,t){function s(e,t,n){return r=e,i=n,t}function o(e,t,n){return t.tokenize=n,n(e,t)}function u(e,t){var r=e.next(),i=!1,u=E(e);if(r=="<"){if(e.match("!--",!0))return o(e,t,p);if(e.match("![CDATA",!1))return t.tokenize=d,s("tag","tag");if(e.match("?",!1))return o(e,t,v);var h=e.eat("/");e.eatSpace();var g="",y;while(y=e.eat(/[^\s\u00a0=<>\"\'\/?]/))g+=y;return o(e,t,c(g,h))}if(r=="{")return x(t,{type:"codeblock"}),s("","");if(r=="}")return T(t),s("","");if(m(t))return r==">"?s("tag","tag"):r=="/"&&e.eat(">")?(T(t),s("tag","tag")):s("word","variable");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),s("number","atom");if(r==="("&&e.eat(":"))return x(t,{type:"comment"}),o(e,t,a);if(!!u||r!=='"'&&r!=="'"){if(r==="$")return o(e,t,l);if(r===":"&&e.eat("="))return s("operator","keyword");if(r==="(")return x(t,{type:"paren"}),s("","");if(r===")")return T(t),s("","");if(r==="[")return x(t,{type:"bracket"}),s("","");if(r==="]")return T(t),s("","");var w=n.propertyIsEnumerable(r)&&n[r];if(u&&r==='"')while(e.next()!=='"');if(u&&r==="'")while(e.next()!=="'");w||e.eatWhile(/[\w\$_-]/);var S=e.eat(":");!e.eat(":")&&S&&e.eatWhile(/[\w\$_-]/),e.match(/^[ \t]*\(/,!1)&&(i=!0);var N=e.current();return w=n.propertyIsEnumerable(N)&&n[N],i&&!w&&(w={type:"function_call",style:"variable def"}),b(t)?(T(t),s("word","variable",N)):((N=="element"||N=="attribute"||w.type=="axis_specifier")&&x(t,{type:"xmlconstructor"}),w?s(w.type,w.style,N):s("word","variable",N))}return o(e,t,f(r))}function a(e,t){var n=!1,r=!1,i=0,o;while(o=e.next()){if(o==")"&&n){if(!(i>0)){T(t);break}i--}else o==":"&&r&&i++;n=o==":",r=o=="("}return s("comment","comment")}function f(e,t){return function(n,r){var i;if(w(r)&&n.current()==e)return T(r),t&&(r.tokenize=t),s("string","string");x(r,{type:"string",name:e,tokenize:f(e,t)});if(n.match("{",!1)&&g(r))return r.tokenize=u,s("string","string");while(i=n.next()){if(i==e){T(r),t&&(r.tokenize=t);break}if(n.match("{",!1)&&g(r))return r.tokenize=u,s("string","string")}return s("string","string")}}function l(e,t){var n=/[\w\$_-]/;if(e.eat('"')){while(e.next()!=='"');e.eat(":")}else e.eatWhile(n),e.match(":=",!1)||e.eat(":");return e.eatWhile(n),t.tokenize=u,s("variable","variable")}function c(e,t){return function(n,r){return n.eatSpace(),t&&n.eat(">")?(T(r),r.tokenize=u,s("tag","tag")):(n.eat("/")||x(r,{type:"tag",name:e,tokenize:u}),n.eat(">")?(r.tokenize=u,s("tag","tag")):(r.tokenize=h,s("tag","tag")))}}function h(e,t){var n=e.next();if(n=="/"&&e.eat(">"))return g(t)&&T(t),m(t)&&T(t),s("tag","tag");if(n==">")return g(t)&&T(t),s("tag","tag");if(n=="=")return s("","");if(n=='"'||n=="'")return o(e,t,f(n,h));g(t)||x(t,{type:"attribute",name:name,tokenize:h}),e.eat(/[a-zA-Z_:]/),e.eatWhile(/[-a-zA-Z0-9_:.]/),e.eatSpace();if(e.match(">",!1)||e.match("/",!1))T(t),t.tokenize=u;return s("attribute","attribute")}function p(e,t){while(ch=e.next())if(ch=="-"&&e.match("->",!0))return t.tokenize=u,s("comment","comment")}function d(e,t){while(ch=e.next())if(ch=="]"&&e.match("]",!0))return t.tokenize=u,s("comment","comment")}function v(e,t){while(ch=e.next())if(ch=="?"&&e.match(">",!0))return t.tokenize=u,s("comment","comment meta")}function m(e){return S(e,"tag")}function g(e){return S(e,"attribute")}function y(e){return S(e,"codeblock")}function b(e){return S(e,"xmlconstructor")}function w(e){return S(e,"string")}function E(e){return e.current()==='"'?e.match(/^[^\"]+\"\:/,!1):e.current()==="'"?e.match(/^[^\"]+\'\:/,!1):!1}function S(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function x(e,t){e.stack.push(t)}function T(e){var t=e.stack.pop(),n=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=n||u}var n=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),s={type:"atom",style:"atom"},o={type:"punctuation",style:""},u={type:"axis_specifier",style:"qualifier"},a={"if":t,"switch":t,"while":t,"for":t,"else":n,then:n,"try":n,"finally":n,"catch":n,element:r,attribute:r,let:r,"implements":r,"import":r,module:r,namespace:r,"return":r,"super":r,"this":r,"throws":r,where:r,"private":r,",":o,"null":s,"fn:false()":s,"fn:true()":s},f=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"];for(var l=0,c=f.length;l<c;l++)a[f[l]]=e(f[l]);var h=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"];for(var l=0,c=h.length;l<c;l++)a[h[l]]=s;var p=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"];for(var l=0,c=p.length;l<c;l++)a[p[l]]=i;var d=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"];for(var l=0,c=d.length;l<c;l++)a[d[l]]=u;return a}(),r,i;return{startState:function(e){return{tokenize:u,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),CodeMirror.defineMIME("application/xquery","xquery"),CodeMirror.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;n.escaped=!1;if(r=="#")return e.skipToEnd(),"comment";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";n.literal&&(n.literal=!1);if(e.sol()){n.keyCol=0,n.pair=!1,n.pairStart=!1;if(e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(!n.pair&&e.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i))return n.pair=!0,n.keyCol=e.indentation(),"atom";if(n.pair&&e.match(/^:\s*/))return n.pairStart=!0,"meta";if(e.match(/^(\{|\}|\[|\])/))return r=="{"?n.inlinePairs++:r=="}"?n.inlinePairs--:r=="["?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&r==",")return e.next(),"meta";if(n.inlinePairs>0&&!i&&r==",")return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(n.inlinePairs==0&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return n.pairStart=!1,n.escaped=r=="\\",e.next(),null},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),CodeMirror.defineMIME("text/x-yaml","yaml")