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