Liferay.Loader.define("fragment-web$codemirror@5.65.2/addon/hint/xml-hint",["module","exports","require","../../lib/codemirror"],(function(t,e,r){var n,i=void 0;window;n=function(t){"use strict";var e=t.Pos;function matches(t,e,r){return r?t.indexOf(e)>=0:0==t.lastIndexOf(e,0)}t.registerHelper("hint","xml",(function getHints(r,n){var i=n&&n.schemaInfo,s=n&&n.quoteChar||'"',a=n&&n.matchInMiddle;if(i){var o=r.getCursor(),l=r.getTokenAt(o);if(l.end>o.ch&&(l.end=o.ch,l.string=l.string.slice(0,o.ch-l.start)),(y=t.innerMode(r.getMode(),l.state)).mode.xmlCurrentTag){var c,h,f=[],g=!1,u=/\btag\b/.test(l.type)&&!/>$/.test(l.string),d=u&&/^\w/.test(l.string);if(d){var m=r.getLine(o.line).slice(Math.max(0,l.start-2),l.start),p=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;p&&(h=l.start-("close"==p?2:1))}else u&&"<"==l.string?p="open":u&&"</"==l.string&&(p="close");var v=y.mode.xmlCurrentTag(y.state);if(!u&&!v||p){d&&(c=l.string),g=p;var y,x=y.mode.xmlCurrentContext?y.mode.xmlCurrentContext(y.state):[],b=(y=x.length&&x[x.length-1])&&i[y],w=y?b&&b.children:i["!top"];if(w&&"close"!=p)for(var C=0;C<w.length;++C)c&&!matches(w[C],c,a)||f.push("<"+w[C]);else if("close"!=p)for(var O in i)!i.hasOwnProperty(O)||"!top"==O||"!attrs"==O||c&&!matches(O,c,a)||f.push("<"+O);y&&(!c||"close"==p&&matches(y,c,a))&&f.push("</"+y+">")}else{var A=(b=v&&i[v.name])&&b.attrs,M=i["!attrs"];if(!A&&!M)return;if(A){if(M){var P={};for(var H in M)M.hasOwnProperty(H)&&(P[H]=M[H]);for(var H in A)A.hasOwnProperty(H)&&(P[H]=A[H]);A=P}}else A=M;if("string"==l.type||"="==l.string){var $,L=(m=r.getRange(e(o.line,Math.max(0,o.ch-60)),e(o.line,"string"==l.type?l.start:l.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!L||!A.hasOwnProperty(L[1])||!($=A[L[1]]))return;if("function"==typeof $&&($=$.call(this,r)),"string"==l.type){c=l.string;var I=0;/['"]/.test(l.string.charAt(0))&&(s=l.string.charAt(0),c=l.string.slice(1),I++);var T=l.string.length;if(/['"]/.test(l.string.charAt(T-1))&&(s=l.string.charAt(T-1),c=l.string.substr(I,T-2)),I){var j=r.getLine(o.line);j.length>l.end&&j.charAt(l.end)==s&&l.end++}g=!0}var returnHintsFromAtValues=function(t){if(t)for(var e=0;e<t.length;++e)c&&!matches(t[e],c,a)||f.push(s+t[e]+s);return returnHints()};return $&&$.then?$.then(returnHintsFromAtValues):returnHintsFromAtValues($)}for(var q in"attribute"==l.type&&(c=l.string,g=!0),A)!A.hasOwnProperty(q)||c&&!matches(q,c,a)||f.push(q)}return returnHints()}}function returnHints(){return{list:f,from:g?e(o.line,null==h?l.start:h):o,to:g?e(o.line,l.end):o}}}))},"object"==typeof e&&"object"==typeof t?n(r("../../lib/codemirror")):"function"==typeof i&&i.amd?i(["../../lib/codemirror"],n):n(CodeMirror)}));
//# sourceMappingURL=xml-hint.js.map