Liferay.Loader.define("liferay!layout-content-page-editor-web$codemirror@5.65.2/mode/jsx/jsx",["module","exports","require","../../lib/codemirror","../xml/xml","../javascript/javascript"],(function(t,e,n){var r;window,r=function(t){"use strict";function Context(t,e,n,r){this.state=t,this.mode=e,this.depth=n,this.prev=r}function copyContext(e){return new Context(t.copyState(e.mode,e.state),e.mode,e.depth,e.prev&&copyContext(e.prev))}t.defineMode("jsx",(function(e,n){var r=t.getMode(e,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),o=t.getMode(e,n&&n.base||"javascript");function flatXMLIndent(t){var e=t.tagName;t.tagName=null;var n=r.indent(t,"","");return t.tagName=e,n}return{startState:function(){return{context:new Context(t.startState(o),o)}},copyState:function(t){return{context:copyContext(t.context)}},token:function token(n,a){return a.context.mode==r?function xmlToken(n,a,i){if(2==i.depth)return n.match(/^.*?\*\//)?i.depth=1:n.skipToEnd(),"comment";if("{"==n.peek()){r.skipAttribute(i.state);var s=flatXMLIndent(i.state),c=i.state.context;if(c&&n.match(/^[^>]*>\s*$/,!1)){for(;c.prev&&!c.startOfLine;)c=c.prev;c.startOfLine?s-=e.indentUnit:i.prev.state.lexical&&(s=i.prev.state.lexical.indented)}else 1==i.depth&&(s+=e.indentUnit);return a.context=new Context(t.startState(o,s),o,0,a.context),null}if(1==i.depth){if("<"==n.peek())return r.skipAttribute(i.state),a.context=new Context(t.startState(r,flatXMLIndent(i.state)),r,0,a.context),null;if(n.match("//"))return n.skipToEnd(),"comment";if(n.match("/*"))return i.depth=2,token(n,a)}var p,x=r.token(n,i.state),d=n.current();return/\btag\b/.test(x)?/>$/.test(d)?i.state.context?i.depth=0:a.context=a.context.prev:/^</.test(d)&&(i.depth=1):!x&&(p=d.indexOf("{"))>-1&&n.backUp(d.length-p),x}(n,a,a.context):function jsToken(e,n,a){if("<"==e.peek()&&o.expressionAllowed(e,a.state))return n.context=new Context(t.startState(r,o.indent(a.state,"","")),r,0,n.context),o.skipExpression(a.state),null;var i=o.token(e,a.state);if(!i&&null!=a.depth){var s=e.current();"{"==s?a.depth++:"}"==s&&0==--a.depth&&(n.context=n.context.prev)}return i}(n,a,a.context)},indent:function(t,e,n){return t.context.mode.indent(t.context.state,e,n)},innerMode:function(t){return t.context}}}),"xml","javascript"),t.defineMIME("text/jsx","jsx"),t.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})},"object"==typeof e&&"object"==typeof t?r(n("../../lib/codemirror"),n("../xml/xml"),n("../javascript/javascript")):r(CodeMirror)}));
//# sourceMappingURL=jsx.js.map