Liferay.Loader.define("liferay!template-web$codemirror@5.65.2/mode/cypher/cypher",["module","exports","require","../../lib/codemirror"],(function(e,t,n){var r,o=void 0;window;r=function(e){"use strict";var wordRegexp=function(e){return new RegExp("^(?:"+e.join("|")+")$","i")};e.defineMode("cypher",(function(t){var n,tokenBase=function(e){n=null;var t=e.next();if('"'===t)return e.match(/^[^"]*"/),"string";if("'"===t)return e.match(/^[^']*'/),"string";if(/[{}\(\),\.;\[\]]/.test(t))return n=t,"node";if("/"===t&&e.eat("/"))return e.skipToEnd(),"comment";if(c.test(t))return e.eatWhile(c),null;if(e.eatWhile(/[_\w\d]/),e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var r=e.current();return o.test(r)?"builtin":i.test(r)?"def":a.test(r)||s.test(r)?"keyword":"variable"},pushContext=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},popContext=function(e){return e.indent=e.context.indent,e.context=e.context.prev},r=t.indentUnit,o=wordRegexp(["abs","acos","allShortestPaths","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endnode","exp","extract","filter","floor","haversin","head","id","keys","labels","last","left","length","log","log10","lower","ltrim","max","min","node","nodes","percentileCont","percentileDisc","pi","radians","rand","range","reduce","rel","relationship","relationships","replace","reverse","right","round","rtrim","shortestPath","sign","sin","size","split","sqrt","startnode","stdev","stdevp","str","substring","sum","tail","tan","timestamp","toFloat","toInt","toString","trim","type","upper"]),i=wordRegexp(["all","and","any","contains","exists","has","in","none","not","or","single","xor"]),a=wordRegexp(["as","asc","ascending","assert","by","case","commit","constraint","create","csv","cypher","delete","desc","descending","detach","distinct","drop","else","end","ends","explain","false","fieldterminator","foreach","from","headers","in","index","is","join","limit","load","match","merge","null","on","optional","order","periodic","profile","remove","return","scan","set","skip","start","starts","then","true","union","unique","unwind","using","when","where","with","call","yield"]),s=wordRegexp(["access","active","assign","all","alter","as","catalog","change","copy","create","constraint","constraints","current","database","databases","dbms","default","deny","drop","element","elements","exists","from","grant","graph","graphs","if","index","indexes","label","labels","management","match","name","names","new","node","nodes","not","of","on","or","password","populated","privileges","property","read","relationship","relationships","remove","replace","required","revoke","role","roles","set","show","start","status","stop","suspended","to","traverse","type","types","user","users","with","write"]),c=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:tokenBase,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"!==r&&t.context&&null==t.context.align&&"pattern"!==t.context.type&&(t.context.align=!0),"("===n)pushContext(t,")",e.column());else if("["===n)pushContext(t,"]",e.column());else if("{"===n)pushContext(t,"}",e.column());else if(/[\]\}\)]/.test(n)){for(;t.context&&"pattern"===t.context.type;)popContext(t);t.context&&n===t.context.type&&popContext(t)}else"."===n&&t.context&&"pattern"===t.context.type?popContext(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?pushContext(t,"pattern",e.column()):"pattern"!==t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return r},indent:function(t,n){var o=n&&n.charAt(0),i=t.context;if(/[\]\}]/.test(o))for(;i&&"pattern"===i.type;)i=i.prev;var a=i&&o===i.type;return i?"keywords"===i.type?e.commands.newlineAndIndent:i.align?i.col+(a?0:1):i.indent+(a?0:r):0}}})),e.modeExtensions.cypher={autoFormatLineBreaks:function(e){for(var t=e.split("\n"),n=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,r=0;r<t.length;r++)t[r]=t[r].replace(n," \n$1 ").trim();return t.join("\n")}},e.defineMIME("application/x-cypher-query","cypher")},"object"==typeof t&&"object"==typeof e?r(n("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],r):r(CodeMirror)}));
//# sourceMappingURL=cypher.js.map