// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/utils/MouseUtil",["dojo/_base/lang","dojo/on","dojo/dom-geometry","./DomUtil","dojo/domReady!"],function(g,h,k,l){var b={_latestEvent:null,_setLatestEvent:function(a){b._latestEvent=a}};h(document.body,"mousemove, touchmove",function(a){b._setLatestEvent(b.fixTouchEvent(a,!0))});var e;h(document.body,"mousedown",function(){e||(e=!0,h.once(document.body,"mouseup, click",function(){e=!1}))});b.getCursorPosition=function(){return b._latestEvent};b.isMouseOver=function(a,
f){if(!(a&&a.parentNode&&a.getBoundingClientRect&&b._latestEvent))return!1;if(f&&f.checkAllChildren){f=g.mixin({},f);delete f.checkAllChildren;var d=!1;l.traverseChildren(a,function(a){if(b.isMouseOver(a,f))return d=!0});return d}var c=k.position(a);if(f&&f.ignoreBorderTolerance){var e=f.ignoreBorderTolerance,c=g.mixin({},c);c.x+=e;c.y+=e;c.w-=2*e;c.h-=2*e}return c.x<=b._latestEvent.clientX&&c.x+c.w>=b._latestEvent.clientX&&c.y<=b._latestEvent.clientY&&c.y+c.h>=b._latestEvent.clientY};b.fixTouchEvent=
function(a,b){a=b?g.mixin({},a):a;if(a.touches&&a.touches.length){var d=a.touches[0];a.clientX=d.clientX;a.clientY=d.clientY;a.pageX=d.pageX;a.pageY=d.pageY}else a.changedTouches&&a.changedTouches.length&&(d=a.changedTouches[0],a.clientX=d.clientX,a.clientY=d.clientY,a.pageX=d.pageX,a.pageY=d.pageY);return a};b.isBeingDragged=function(){return e};return b});