Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/fold/brace-fold",["module","exports","require","../../lib/codemirror"],(function(e,r,n){window,function(e){"use strict";e.registerHelper("fold","brace",(function(r,n){var t,i=n.line,o=r.getLine(i);function l(l){for(var f=n.ch,s=0;;){var a=f<=0?-1:o.lastIndexOf(l,f-1);if(-1!=a){if(1==s&&a<n.ch)break;if(t=r.getTokenTypeAt(e.Pos(i,a+1)),!/^(comment|string)/.test(t))return a+1;f=a-1}else{if(1==s)break;s=1,f=o.length}}}var f,s,a,u=l("{"),d=l("[");if(null!=u&&(null==d||d>u))a=u,f="{",s="}";else{if(null==d)return;a=d,f="[",s="]"}var c,g,v=1,p=r.lastLine();e:for(var m=i;m<=p;++m)for(var P=r.getLine(m),b=m==i?a:0;;){var k=P.indexOf(f,b),h=P.indexOf(s,b);if(k<0&&(k=P.length),h<0&&(h=P.length),(b=Math.min(k,h))==P.length)break;if(r.getTokenTypeAt(e.Pos(m,b+1))==t)if(b==k)++v;else if(!--v){c=m,g=b;break e}++b}if(null!=c&&i!=c)return{from:e.Pos(i,a),to:e.Pos(c,g)}})),e.registerHelper("fold","import",(function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);i<=o;++i){var l=r.getLine(i).indexOf(";");if(-1!=l)return{startCh:t.end,end:e.Pos(i,l)}}}var i,o=n.line,l=t(o);if(!l||t(o-1)||(i=t(o-2))&&i.end.line==o-1)return null;for(var f=l.end;;){var s=t(f.line+1);if(null==s)break;f=s.end}return{from:r.clipPos(e.Pos(o,l.startCh+1)),to:f}})),e.registerHelper("fold","include",(function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var i=n.line,o=t(i);if(null==o||null!=t(i-1))return null;for(var l=i;null!=t(l+1);)++l;return{from:e.Pos(i,o+1),to:r.clipPos(e.Pos(l))}}))}("object"==typeof r&&"object"==typeof e?n("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=brace-fold.js.map