Liferay.Loader.define("liferay!template-web$codemirror@5.65.2/addon/selection/selection-pointer",["module","exports","require","../../lib/codemirror"],(function(e,t,o){var n,i=void 0;window;n=function(e){"use strict";function reset(e){e.state.selectionPointer.rects=null,scheduleUpdate(e)}function scheduleUpdate(e){e.state.selectionPointer.willUpdate||(e.state.selectionPointer.willUpdate=!0,setTimeout((function(){!function update(e){var t=e.state.selectionPointer;if(t){if(null==t.rects&&null!=t.mouseX&&(t.rects=[],e.somethingSelected()))for(var o=e.display.selectionDiv.firstChild;o;o=o.nextSibling)t.rects.push(o.getBoundingClientRect());var n=!1;if(null!=t.mouseX)for(var i=0;i<t.rects.length;i++){var l=t.rects[i];l.left<=t.mouseX&&l.right>=t.mouseX&&l.top<=t.mouseY&&l.bottom>=t.mouseY&&(n=!0)}var s=n?t.value:"";e.display.lineDiv.style.cursor!=s&&(e.display.lineDiv.style.cursor=s)}}(e),e.state.selectionPointer.willUpdate=!1}),50))}e.defineOption("selectionPointer",!1,(function(t,o){var n=t.state.selectionPointer;n&&(e.off(t.getWrapperElement(),"mousemove",n.mousemove),e.off(t.getWrapperElement(),"mouseout",n.mouseout),e.off(window,"scroll",n.windowScroll),t.off("cursorActivity",reset),t.off("scroll",reset),t.state.selectionPointer=null,t.display.lineDiv.style.cursor=""),o&&(n=t.state.selectionPointer={value:"string"==typeof o?o:"default",mousemove:function(e){!function mousemove(e,t){var o=e.state.selectionPointer;(null==t.buttons?t.which:t.buttons)?o.mouseX=o.mouseY=null:(o.mouseX=t.clientX,o.mouseY=t.clientY),scheduleUpdate(e)}(t,e)},mouseout:function(e){!function mouseout(e,t){if(!e.getWrapperElement().contains(t.relatedTarget)){var o=e.state.selectionPointer;o.mouseX=o.mouseY=null,scheduleUpdate(e)}}(t,e)},windowScroll:function(){reset(t)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},e.on(t.getWrapperElement(),"mousemove",n.mousemove),e.on(t.getWrapperElement(),"mouseout",n.mouseout),e.on(window,"scroll",n.windowScroll),t.on("cursorActivity",reset),t.on("scroll",reset))}))},"object"==typeof t&&"object"==typeof e?n(o("../../lib/codemirror")):"function"==typeof i&&i.amd?i(["../../lib/codemirror"],n):n(CodeMirror)}));
//# sourceMappingURL=selection-pointer.js.map