Liferay.Loader.define("fragment-web$codemirror@5.65.2/addon/hint/javascript-hint",["module","exports","require","../../lib/codemirror"],(function(t,e,r){var n,o=void 0;window;n=function(t){var e=t.Pos;function forEach(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function scriptHint(r,n,o,i){var a=r.getCursor(),s=o(r,a);if(!/\b(?:string|comment)\b/.test(s.type)){var f=t.innerMode(r.getMode(),s.state);if("json"!==f.mode.helperType){s.state=f.state,/^[\w$_]*$/.test(s.string)?s.end>a.ch&&(s.end=a.ch,s.string=s.string.slice(0,a.ch-s.start)):s={start:a.ch,end:a.ch,string:"",state:s.state,type:"."==s.string?"property":null};for(var c=s;"property"==c.type;){if("."!=(c=o(r,e(a.line,c.start))).string)return;if(c=o(r,e(a.line,c.start)),!l)var l=[];l.push(c)}return{list:getCompletions(s,l,n,i),from:e(a.line,s.start),to:e(a.line,s.end)}}}}function getCoffeeScriptToken(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",(function javascriptHint(t,e){return scriptHint(t,i,(function(t,e){return t.getTokenAt(e)}),e)})),t.registerHelper("hint","coffeescript",(function coffeescriptHint(t,e){return scriptHint(t,a,getCoffeeScriptToken,e)}));var r="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),n="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),o="prototype apply call bind".split(" "),i="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),a="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function getCompletions(t,e,i,a){var s=[],f=t.string,c=a&&a.globalScope||window;function maybeAdd(t){0!=t.lastIndexOf(f,0)||function arrayContains(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(s,t)||s.push(t)}function gatherCompletions(t){"string"==typeof t?forEach(r,maybeAdd):t instanceof Array?forEach(n,maybeAdd):t instanceof Function&&forEach(o,maybeAdd),function forAllProps(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,maybeAdd)}if(e&&e.length){var l,p=e.pop();for(p.type&&0===p.type.indexOf("variable")?(a&&a.additionalContext&&(l=a.additionalContext[p.string]),a&&!1===a.useGlobalScope||(l=l||c[p.string])):"string"==p.type?l="":"atom"==p.type?l=1:"function"==p.type&&(null==c.jQuery||"$"!=p.string&&"jQuery"!=p.string||"function"!=typeof c.jQuery?null!=c._&&"_"==p.string&&"function"==typeof c._&&(l=c._()):l=c.jQuery());null!=l&&e.length;)l=l[e.pop().string];null!=l&&gatherCompletions(l)}else{for(var d=t.state.localVars;d;d=d.next)maybeAdd(d.name);for(var u=t.state.context;u;u=u.prev)for(d=u.vars;d;d=d.next)maybeAdd(d.name);for(d=t.state.globalVars;d;d=d.next)maybeAdd(d.name);if(a&&null!=a.additionalContext)for(var y in a.additionalContext)maybeAdd(y);a&&!1===a.useGlobalScope||gatherCompletions(c),forEach(i,maybeAdd)}return s}},"object"==typeof e&&"object"==typeof t?n(r("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)}));
//# sourceMappingURL=javascript-hint.js.map