ace.define("ace/ext/code_lense",["require","exports","module","ace/line_widgets","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"],function(e,t,n){"use strict";function o(e){var t=e.$textLayer,n=t.$lenses;n&&n.forEach(function(e){e.remove()}),t.$lenses=null}function u(e,t){var n=e&t.CHANGE_LINES||e&t.CHANGE_FULL||e&t.CHANGE_SCROLL||e&t.CHANGE_TEXT;if(!n)return;var r=t.session,i=t.session.lineWidgets,u=t.$textLayer,a=u.$lenses;if(!i){a&&o(t);return}var f=t.$textLayer.$lines.cells,l=t.layerConfig,c=t.$padding;a||(a=u.$lenses=[]);var h=0;for(var p=0;p<f.length;p++){var d=f[p].row,v=i[d],m=v&&v.lenses;if(!m||!m.length)continue;var g=a[h];g||(g=a[h]=s.buildDom(["div",{"class":"ace_codeLense"}],t.container)),g.style.height=l.lineHeight+"px",h++;for(var y=0;y<m.length;y++){var b=g.childNodes[2*y];b||(y!=0&&g.appendChild(s.createTextNode("\u00a0|\u00a0")),b=s.buildDom(["a"],g)),b.textContent=m[y].title,b.lenseCommand=m[y]}while(g.childNodes.length>2*y-1)g.lastChild.remove();var w=t.$cursorLayer.getPixelPosition({row:d,column:0},!0).top-l.lineHeight*v.rowsAbove-l.offset;g.style.top=w+"px";var E=t.gutterWidth,S=r.getLine(d).search(/\S|$/);S==-1&&(S=0),E+=S*l.characterWidth,E-=t.scrollLeft,g.style.paddingLeft=c+E+"px"}while(h<a.length)a.pop().remove()}function a(e){if(!e.lineWidgets)return;var t=e.widgetManager;e.lineWidgets.forEach(function(e){e&&e.lenses&&t.removeLineWidget(e)})}function f(e){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e)),e.renderer.on("afterRender",u),e.$codeLenseClickHandler=function(t){var n=t.target.lenseCommand;n&&e.execCommand(n.id,n.arguments)},e.container.addEventListener("click",e.$codeLenseClickHandler),e.$updateLenses=function(){var n=e.session;if(!n)return;var r=n.codeLensProvider||n.$mode.codeLensProvider,i=r&&r.provideCodeLenses(n),s=n.selection.cursor,o=n.documentToScreenRow(s);t.setLenses(n,i);var u=n.$undoManager&&n.$undoManager.$lastDelta;if(u&&u.action=="remove"&&u.lines.length>1)return;var a=n.documentToScreenRow(s),f=e.renderer.layerConfig.lineHeight,l=n.getScrollTop()+(a-o)*f;n.setScrollTop(l)};var s=i.delayedCall(e.$updateLenses);e.$updateLensesOnInput=function(){s.delay(250)},e.on("input",e.$updateLensesOnInput)}function l(e){e.off("input",e.$updateLensesOnInput),e.renderer.off("afterRender",u),e.$codeLenseClickHandler&&e.container.removeEventListener("click",e.$codeLenseClickHandler)}var r=e("../line_widgets").LineWidgets,i=e("../lib/lang"),s=e("../lib/dom");t.setLenses=function(e,t){var n=Number.MAX_VALUE;a(e),t&&t.forEach(function(t){var r=t.start.row,i=t.start.column,s=e.lineWidgets&&e.lineWidgets[r];if(!s||!s.lenses)s=e.widgetManager.$registerLineWidget({rowCount:1,rowsAbove:1,row:r,column:i,lenses:[]});s.lenses.push(t.command),r<n&&(n=r)}),e._emit("changeFold",{data:{start:{row:n}}})},t.setCodeLenseProvider=function(e,t){e.setOption("enableCodeLense",!0),e.session.codeLensProvider=t,e.$updateLensesOnInput()},t.clear=function(e){t.setLenses(e,null)};var c=e("../editor").Editor;e("../config").defineOptions(c.prototype,"editor",{enableCodeLense:{set:function(e){e?f(this):l(this)}}}),s.importCssString(".ace_codeLense {    position: absolute;    color: #aaa;    font-size: 88%;    background: inherit;    width: 100%;    display: flex;    align-items: flex-end;    pointer-events: none;}.ace_codeLense > a {    cursor: pointer;    pointer-events: auto;}.ace_codeLense > a:hover {    color: #0000ff;    text-decoration: underline;}.ace_dark > .ace_codeLense > a:hover {    color: #4e94ce;}","")});                (function() {
                    ace.require(["ace/ext/code_lense"], function(m) {
                        if (typeof module == "object" && typeof exports == "object" && module) {
                            module.exports = m;
                        }
                    });
                })();
            