(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("javascript",function(Z,aj){var l=Z.indentUnit;var A=aj.statementIndent;var aB=aj.jsonld;var z=aj.json||aB;var g=aj.typescript;var au=aj.wordCharacters||/[\w$\xa1-\uffff]/;var ar=function(){function aR(aT){return{type:aT,style:"keyword"}}var aM=aR("keyword a"),aK=aR("keyword b"),aJ=aR("keyword c");var aL=aR("operator"),aP={type:"atom",style:"atom"};var aN={"if":aR("if"),"while":aM,"with":aM,"else":aK,"do":aK,"try":aK,"finally":aK,"return":aJ,"break":aJ,"continue":aJ,"new":aJ,"delete":aJ,"throw":aJ,"debugger":aJ,"var":aR("var"),"const":aR("var"),let:aR("var"),"function":aR("function"),"catch":aR("catch"),"for":aR("for"),"switch":aR("switch"),"case":aR("case"),"default":aR("default"),"in":aL,"typeof":aL,"instanceof":aL,"true":aP,"false":aP,"null":aP,"undefined":aP,"NaN":aP,"Infinity":aP,"this":aR("this"),module:aR("module"),"class":aR("class"),"super":aR("atom"),yield:aJ,"export":aR("export"),"import":aR("import"),"extends":aJ};if(g){var aS={type:"variable",style:"variable-3"};var aO={"interface":aR("interface"),"extends":aR("extends"),constructor:aR("constructor"),"public":aR("public"),"private":aR("private"),"protected":aR("protected"),"static":aR("static"),string:aS,number:aS,bool:aS,any:aS};for(var aQ in aO){aN[aQ]=aO[aQ]}}return aN}();var P=/[+\-*&%=<>!?|~^]/;var aq=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function F(aM){var aK=false,aJ,aL=false;while((aJ=aM.next())!=null){if(!aK){if(aJ=="/"&&!aL){return}if(aJ=="["){aL=true}else{if(aL&&aJ=="]"){aL=false}}}aK=!aK&&aJ=="\\"}}var S,G;function L(aL,aK,aJ){S=aL;G=aJ;return aK}function U(aN,aL){var aJ=aN.next();if(aJ=='"'||aJ=="'"){aL.tokenize=R(aJ);return aL.tokenize(aN,aL)}else{if(aJ=="."&&aN.match(/^\d+(?:[eE][+\-]?\d+)?/)){return L("number","number")}else{if(aJ=="."&&aN.match("..")){return L("spread","meta")}else{if(/[\[\]{}\(\),;\:\.]/.test(aJ)){return L(aJ)}else{if(aJ=="="&&aN.eat(">")){return L("=>","operator")}else{if(aJ=="0"&&aN.eat(/x/i)){aN.eatWhile(/[\da-f]/i);return L("number","number")}else{if(/\d/.test(aJ)){aN.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return L("number","number")}else{if(aJ=="/"){if(aN.eat("*")){aL.tokenize=aA;return aA(aN,aL)}else{if(aN.eat("/")){aN.skipToEnd();return L("comment","comment")}else{if(aL.lastType=="operator"||aL.lastType=="keyword c"||aL.lastType=="sof"||/^[\[{}\(,;:]$/.test(aL.lastType)){F(aN);aN.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return L("regexp","string-2")}else{aN.eatWhile(P);return L("operator","operator",aN.current())}}}}else{if(aJ=="`"){aL.tokenize=aC;return aC(aN,aL)}else{if(aJ=="#"){aN.skipToEnd();return L("error","error")}else{if(P.test(aJ)){aN.eatWhile(P);return L("operator","operator",aN.current())}else{if(au.test(aJ)){aN.eatWhile(au);var aM=aN.current(),aK=ar.propertyIsEnumerable(aM)&&ar[aM];return(aK&&aL.lastType!=".")?L(aK.type,aK.style,aM):L("variable","variable",aM)}}}}}}}}}}}}}function R(aJ){return function(aN,aL){var aM=false,aK;if(aB&&aN.peek()=="@"&&aN.match(aq)){aL.tokenize=U;return L("jsonld-keyword","meta")}while((aK=aN.next())!=null){if(aK==aJ&&!aM){break}aM=!aM&&aK=="\\"}if(!aM){aL.tokenize=U}return L("string","string")}}function aA(aM,aL){var aJ=false,aK;while(aK=aM.next()){if(aK=="/"&&aJ){aL.tokenize=U;break}aJ=(aK=="*")}return L("comment","comment")}function aC(aM,aK){var aL=false,aJ;while((aJ=aM.next())!=null){if(!aL&&(aJ=="`"||aJ=="$"&&aM.eat("{"))){aK.tokenize=U;break}aL=!aL&&aJ=="\\"}return L("quasi","string-2",aM.current())}var m="([{}])";function ax(aP,aM){if(aM.fatArrowAt){aM.fatArrowAt=null}var aL=aP.string.indexOf("=>",aP.start);if(aL<0){return}var aO=0,aK=false;for(var aQ=aL-1;aQ>=0;--aQ){var aJ=aP.string.charAt(aQ);var aN=m.indexOf(aJ);if(aN>=0&&aN<3){if(!aO){++aQ;break}if(--aO==0){break}}else{if(aN>=3&&aN<6){++aO}else{if(au.test(aJ)){aK=true}else{if(/["'\/]/.test(aJ)){return}else{if(aK&&!aO){++aQ;break}}}}}}if(aK&&!aO){aM.fatArrowAt=aQ}}var b={atom:true,number:true,variable:true,string:true,regexp:true,"this":true,"jsonld-keyword":true};function J(aO,aK,aJ,aN,aL,aM){this.indented=aO;this.column=aK;this.type=aJ;this.prev=aL;this.info=aM;if(aN!=null){this.align=aN}}function s(aM,aL){for(var aK=aM.localVars;aK;aK=aK.next){if(aK.name==aL){return true}}for(var aJ=aM.context;aJ;aJ=aJ.prev){for(var aK=aJ.vars;aK;aK=aK.next){if(aK.name==aL){return true}}}}function f(aN,aK,aJ,aM,aO){var aP=aN.cc;D.state=aN;D.stream=aO;D.marked=null,D.cc=aP;D.style=aK;if(!aN.lexical.hasOwnProperty("align")){aN.lexical.align=true}while(true){var aL=aP.length?aP.pop():z?an:aH;if(aL(aJ,aM)){while(aP.length&&aP[aP.length-1].lex){aP.pop()()}if(D.marked){return D.marked}if(aJ=="variable"&&s(aN,aM)){return"variable-2"}return aK}}}var D={state:null,column:null,marked:null,cc:null};function aa(){for(var aJ=arguments.length-1;aJ>=0;aJ--){D.cc.push(arguments[aJ])}}function ae(){aa.apply(null,arguments);return true}function aw(aK){function aJ(aN){for(var aM=aN;aM;aM=aM.next){if(aM.name==aK){return true}}return false}var aL=D.state;if(aL.context){D.marked="def";if(aJ(aL.localVars)){return}aL.localVars={name:aK,next:aL.localVars}}else{if(aJ(aL.globalVars)){return}if(aj.globalVars){aL.globalVars={name:aK,next:aL.globalVars}}}}var q={name:"this",next:{name:"arguments"}};function w(){D.state.context={prev:D.state.context,vars:D.state.localVars};D.state.localVars=q}function x(){D.state.localVars=D.state.context.vars;D.state.context=D.state.context.prev}function aF(aK,aL){var aJ=function(){var aO=D.state,aM=aO.indented;if(aO.lexical.type=="stat"){aM=aO.lexical.indented}else{for(var aN=aO.lexical;aN&&aN.type==")"&&aN.align;aN=aN.prev){aM=aN.indented}}aO.lexical=new J(aM,D.stream.column(),aK,null,aO.lexical,aL)};aJ.lex=true;return aJ}function h(){var aJ=D.state;if(aJ.lexical.prev){if(aJ.lexical.type==")"){aJ.indented=aJ.lexical.indented}aJ.lexical=aJ.lexical.prev}}h.lex=true;function r(aJ){function aK(aL){if(aL==aJ){return ae()}else{if(aJ==";"){return aa()}else{return ae(aK)}}}return aK}function aH(aJ,aK){if(aJ=="var"){return ae(aF("vardef",aK.length),d,r(";"),h)}if(aJ=="keyword a"){return ae(aF("form"),an,aH,h)}if(aJ=="keyword b"){return ae(aF("form"),aH,h)}if(aJ=="{"){return ae(aF("}"),y,h)}if(aJ==";"){return ae()}if(aJ=="if"){if(D.state.lexical.info=="else"&&D.state.cc[D.state.cc.length-1]==h){D.state.cc.pop()()}return ae(aF("form"),an,aH,h,e)}if(aJ=="function"){return ae(M)}if(aJ=="for"){return ae(aF("form"),u,aH,h)}if(aJ=="variable"){return ae(aF("stat"),aI)}if(aJ=="switch"){return ae(aF("form"),an,aF("}","switch"),r("{"),y,h,h)}if(aJ=="case"){return ae(an,r(":"))}if(aJ=="default"){return ae(r(":"))}if(aJ=="catch"){return ae(aF("form"),w,r("("),af,r(")"),aH,h,x)}if(aJ=="module"){return ae(aF("form"),w,H,x,h)}if(aJ=="class"){return ae(aF("form"),V,h)}if(aJ=="export"){return ae(aF("form"),aG,h)}if(aJ=="import"){return ae(aF("form"),ag,h)}return aa(aF("stat"),an,r(";"),h)}function an(aJ){return Y(aJ,false)}function aE(aJ){return Y(aJ,true)}function Y(aK,aM){if(D.state.fatArrowAt==D.stream.start){var aJ=aM?N:W;if(aK=="("){return ae(w,aF(")"),at(i,")"),h,r("=>"),aJ,x)}else{if(aK=="variable"){return aa(w,i,r("=>"),aJ,x)}}}var aL=aM?j:ab;if(b.hasOwnProperty(aK)){return ae(aL)}if(aK=="function"){return ae(M,aL)}if(aK=="keyword c"){return ae(aM?ak:ai)}if(aK=="("){return ae(aF(")"),ai,az,r(")"),h,aL)}if(aK=="operator"||aK=="spread"){return ae(aM?aE:an)}if(aK=="["){return ae(aF("]"),n,h,aL)}if(aK=="{"){return ay(t,"}",null,aL)}if(aK=="quasi"){return aa(Q,aL)}return ae()}function ai(aJ){if(aJ.match(/[;\}\)\],]/)){return aa()}return aa(an)}function ak(aJ){if(aJ.match(/[;\}\)\],]/)){return aa()}return aa(aE)}function ab(aJ,aK){if(aJ==","){return ae(an)}return j(aJ,aK,false)}function j(aJ,aL,aN){var aK=aN==false?ab:j;var aM=aN==false?an:aE;if(aJ=="=>"){return ae(w,aN?N:W,x)}if(aJ=="operator"){if(/\+\+|--/.test(aL)){return ae(aK)}if(aL=="?"){return ae(an,r(":"),aM)}return ae(aM)}if(aJ=="quasi"){return aa(Q,aK)}if(aJ==";"){return}if(aJ=="("){return ay(aE,")","call",aK)}if(aJ=="."){return ae(al,aK)}if(aJ=="["){return ae(aF("]"),ai,r("]"),h,aK)}}function Q(aJ,aK){if(aJ!="quasi"){return aa()}if(aK.slice(aK.length-2)!="${"){return ae(Q)}return ae(an,p)}function p(aJ){if(aJ=="}"){D.marked="string-2";D.state.tokenize=aC;return ae(Q)}}function W(aJ){ax(D.stream,D.state);return aa(aJ=="{"?aH:an)}function N(aJ){ax(D.stream,D.state);return aa(aJ=="{"?aH:aE)}function aI(aJ){if(aJ==":"){return ae(h,aH)}return aa(ab,r(";"),h)}function al(aJ){if(aJ=="variable"){D.marked="property";return ae()}}function t(aJ,aK){if(aJ=="variable"||D.style=="keyword"){D.marked="property";if(aK=="get"||aK=="set"){return ae(I)}return ae(K)}else{if(aJ=="number"||aJ=="string"){D.marked=aB?"property":(D.style+" property");return ae(K)}else{if(aJ=="jsonld-keyword"){return ae(K)}else{if(aJ=="["){return ae(an,r("]"),K)}}}}}function I(aJ){if(aJ!="variable"){return aa(K)}D.marked="property";return ae(M)}function K(aJ){if(aJ==":"){return ae(aE)}if(aJ=="("){return aa(M)}}function at(aL,aJ){function aK(aN){if(aN==","){var aM=D.state.lexical;if(aM.info=="call"){aM.pos=(aM.pos||0)+1}return ae(aL,aK)}if(aN==aJ){return ae()}return ae(r(aJ))}return function(aM){if(aM==aJ){return ae()}return aa(aL,aK)}}function ay(aM,aJ,aL){for(var aK=3;aK<arguments.length;aK++){D.cc.push(arguments[aK])}return ae(aF(aJ,aL),at(aM,aJ),h)}function y(aJ){if(aJ=="}"){return ae()}return aa(aH,y)}function T(aJ){if(g&&aJ==":"){return ae(ad)}}function av(aJ,aK){if(aK=="="){return ae(aE)}}function ad(aJ){if(aJ=="variable"){D.marked="variable-3";return ae()}}function d(){return aa(i,T,ac,X)}function i(aJ,aK){if(aJ=="variable"){aw(aK);return ae()}if(aJ=="["){return ay(i,"]")}if(aJ=="{"){return ay(aD,"}")}}function aD(aJ,aK){if(aJ=="variable"&&!D.stream.match(/^\s*:/,false)){aw(aK);return ae(ac)}if(aJ=="variable"){D.marked="property"}return ae(r(":"),i,ac)}function ac(aJ,aK){if(aK=="="){return ae(aE)}}function X(aJ){if(aJ==","){return ae(d)}}function e(aJ,aK){if(aJ=="keyword b"&&aK=="else"){return ae(aF("form","else"),aH,h)}}function u(aJ){if(aJ=="("){return ae(aF(")"),E,r(")"),h)}}function E(aJ){if(aJ=="var"){return ae(d,r(";"),C)}if(aJ==";"){return ae(C)}if(aJ=="variable"){return ae(v)}return aa(an,r(";"),C)}function v(aJ,aK){if(aK=="in"||aK=="of"){D.marked="keyword";return ae(an)}return ae(ab,C)}function C(aJ,aK){if(aJ==";"){return ae(B)}if(aK=="in"||aK=="of"){D.marked="keyword";return ae(an)}return aa(an,r(";"),B)}function B(aJ){if(aJ!=")"){ae(an)}}function M(aJ,aK){if(aK=="*"){D.marked="keyword";return ae(M)}if(aJ=="variable"){aw(aK);return ae(M)}if(aJ=="("){return ae(w,aF(")"),at(af,")"),h,aH,x)}}function af(aJ){if(aJ=="spread"){return ae(af)}return aa(i,T,av)}function V(aJ,aK){if(aJ=="variable"){aw(aK);return ae(O)}}function O(aJ,aK){if(aK=="extends"){return ae(an,O)}if(aJ=="{"){return ae(aF("}"),o,h)}}function o(aJ,aK){if(aJ=="variable"||D.style=="keyword"){if(aK=="static"){D.marked="keyword";return ae(o)}D.marked="property";if(aK=="get"||aK=="set"){return ae(c,M,o)}return ae(M,o)}if(aK=="*"){D.marked="keyword";return ae(o)}if(aJ==";"){return ae(o)}if(aJ=="}"){return ae()}}function c(aJ){if(aJ!="variable"){return aa()}D.marked="property";return ae()}function H(aJ,aK){if(aJ=="string"){return ae(aH)}if(aJ=="variable"){aw(aK);return ae(ah)}}function aG(aJ,aK){if(aK=="*"){D.marked="keyword";return ae(ah,r(";"))}if(aK=="default"){D.marked="keyword";return ae(an,r(";"))}return aa(aH)}function ag(aJ){if(aJ=="string"){return ae()}return aa(ap,ah)}function ap(aJ,aK){if(aJ=="{"){return ay(ap,"}")}if(aJ=="variable"){aw(aK)}if(aK=="*"){D.marked="keyword"}return ae(k)}function k(aJ,aK){if(aK=="as"){D.marked="keyword";return ae(ap)}}function ah(aJ,aK){if(aK=="from"){D.marked="keyword";return ae(an)}}function n(aJ){if(aJ=="]"){return ae()}return aa(aE,am)}function am(aJ){if(aJ=="for"){return aa(az,r("]"))}if(aJ==","){return ae(at(ak,"]"))}return aa(at(aE,"]"))}function az(aJ){if(aJ=="for"){return ae(u,az)}if(aJ=="if"){return ae(an,az)}}function ao(aK,aJ){return aK.lastType=="operator"||aK.lastType==","||P.test(aJ.charAt(0))||/[,.]/.test(aJ.charAt(0))}return{startState:function(aK){var aJ={tokenize:U,lastType:"sof",cc:[],lexical:new J((aK||0)-l,0,"block",false),localVars:aj.localVars,context:aj.localVars&&{vars:aj.localVars},indented:0};if(aj.globalVars&&typeof aj.globalVars=="object"){aJ.globalVars=aj.globalVars}return aJ},token:function(aL,aK){if(aL.sol()){if(!aK.lexical.hasOwnProperty("align")){aK.lexical.align=false}aK.indented=aL.indentation();ax(aL,aK)}if(aK.tokenize!=aA&&aL.eatSpace()){return null}var aJ=aK.tokenize(aL,aK);if(S=="comment"){return aJ}aK.lastType=S=="operator"&&(G=="++"||G=="--")?"incdec":S;return f(aK,aJ,S,G,aL)},indent:function(aP,aJ){if(aP.tokenize==aA){return a.Pass}if(aP.tokenize!=U){return 0}var aO=aJ&&aJ.charAt(0),aM=aP.lexical;if(!/^\s*else\b/.test(aJ)){for(var aL=aP.cc.length-1;aL>=0;--aL){var aQ=aP.cc[aL];if(aQ==h){aM=aM.prev}else{if(aQ!=e){break}}}}if(aM.type=="stat"&&aO=="}"){aM=aM.prev}if(A&&aM.type==")"&&aM.prev.type=="stat"){aM=aM.prev}var aN=aM.type,aK=aO==aN;if(aN=="vardef"){return aM.indented+(aP.lastType=="operator"||aP.lastType==","?aM.info+1:0)}else{if(aN=="form"&&aO=="{"){return aM.indented}else{if(aN=="form"){return aM.indented+l}else{if(aN=="stat"){return aM.indented+(ao(aP,aJ)?A||l:0)}else{if(aM.info=="switch"&&!aK&&aj.doubleIndentSwitch!=false){return aM.indented+(/^(?:case|default)\b/.test(aJ)?l:2*l)}else{if(aM.align){return aM.column+(aK?0:1)}else{return aM.indented+(aK?0:l)}}}}}}},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:z?null:"/*",blockCommentEnd:z?null:"*/",lineComment:z?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:z?"json":"javascript",jsonldMode:aB,jsonMode:z}});a.registerHelper("wordChars","javascript",/[\w$]/);a.defineMIME("text/javascript","javascript");a.defineMIME("text/ecmascript","javascript");a.defineMIME("application/javascript","javascript");a.defineMIME("application/x-javascript","javascript");a.defineMIME("application/ecmascript","javascript");a.defineMIME("application/json",{name:"javascript",json:true});a.defineMIME("application/x-json",{name:"javascript",json:true});a.defineMIME("application/ld+json",{name:"javascript",jsonld:true});a.defineMIME("text/typescript",{name:"javascript",typescript:true});a.defineMIME("application/typescript",{name:"javascript",typescript:true})});