// 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/DomUtil","dojo/_base/lang dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/string dojo/domReady!".split(" "),function(p,m,k,h,n,f,r){function q(){l||(l=h.create("div",{"class":"esriGEOffscreen"},document.body));return l}var g={isHidden:function(a){return a&&k.contains(a,"esriGEHidden")},hasVisibleChildren:function(a){if(!a||!a.children.length)return!1;for(var c=0;c<a.children.length;c++)if(!g.isHidden(a.children[c]))return!0;
return!1},hide:function(a){return g.addTag(a,"esriGEHidden")},show:function(a){return g.removeTag(a,"esriGEHidden")},addTag:function(a,c){return g.applyCallback(a,function(a){a&&k.add(a,c)})},removeTag:function(a,c){return g.applyCallback(a,function(a){a&&k.remove(a,c)})},applyCallback:function(a,c,b){b&&(c=p.hitch(b,c));Array.isArray(a)?a.forEach(c):c(a);return a},enableContent:function(a,c,b){if(a){b=b||{};var d=a.children.length-1;if(!(0>d)){d=a.children[d];k.contains(d,"esriGEDisabledContent")||
(d=null);if(c)d&&a.removeChild(d);else if(d=d||h.create("div",{"class":"esriGEDisabledContent"+(b.overlayClass?" "+b.overlayClass:"")},a),!1!==b.fitParent&&(a=n[b.marginBox?"getMarginBox":"getContentBox"](a).h))a=a.toString()+"px",f.set(d,{height:a,marginTop:"-"+a});return d}}},enableContentAbsolute:function(a,c,b){if(a){b=b||{};var d=f.get(a,"position");"relative"!==d&&"absolute"!==d&&f.set(a,"position","relative");return g.enableContent(a,c,{overlayClass:"esriGEAbsoluteStretched "+(b.overlayClass||
""),fitParent:!1})}},getChildIndex:function(a,c){if(!a||!a.children||!c)return-1;for(var b=0;b<a.children.length;b++)if(a.children[b]===c)return b;return-1},getChildren:function(a){if(!a||!a.children)return null;for(var c=[],b=0;b<a.children.length;b++)c.push(a.children[b]);return c},getChildNodes:function(a){if(!a||!a.childNodes)return null;for(var c=[],b=0;b<a.childNodes.length;b++)c.push(a.childNodes[b]);return c},isChildOf:function(a,c,b){var d=!1,e=function(a){if(b&&!b(a))return!1;a.parentNode===
c?d=!0:a.parentNode&&e(a.parentNode)};a&&e(a);return d},isNodeInLayout:function(a){return g.isChildOf(a,document.body,function(a){return!g.isHidden(a)&&"none"!=f.get(a,"display")})}},l;g.hideNodeInBackground=function(a,c){if(a){if(a._hideNodeInBackgroundUndoController)return a._hideNodeInBackgroundUndoController;var b=h.create("div",null,a,"after"),d=h.create("div",{style:"position: absolute; left: 0px; top: 0px;"},q());h.place(a,d);var e="DomUtil.hideNodeInBackground"+(c?"."+c:"");m.set(b,"_bg_memo_node",
e);m.set(d,"_bg_temp_node",e);e={undo:function(){b&&(h.place(a,b,"replace"),h.destroy(b),h.destroy(d),b=null,delete a._hideNodeInBackgroundUndoController)}};return a._hideNodeInBackgroundUndoController=e}};g.showNodeFromBackground=function(a){a&&a._hideNodeInBackgroundUndoController&&a._hideNodeInBackgroundUndoController.undo()};g.position=function(a){function c(a){for(var b={x:0,y:0};a.offsetParent;)b.x+=a.offsetLeft,b.y+=a.offsetTop,a=a.offsetParent,b.x+=f.get(a,"borderLeftWidth"),b.y+=f.get(a,
"borderTopWidth");return b}function b(a){return f.get(a,"width")+f.get(a,"paddingLeft")+f.get(a,"paddingRight")+f.get(a,"borderLeftWidth")+f.get(a,"borderRightWidth")}function d(a){return f.get(a,"height")+f.get(a,"paddingTop")+f.get(a,"paddingBottom")+f.get(a,"borderTopWidth")+f.get(a,"borderBottomWidth")}if(a){var e;if(a instanceof SVGElement&&a.getBBox)return e=(e=a.ownerSVGElement&&a.ownerSVGElement.parentNode)&&c(e),a=a.getBBox(),{x:(a.x||0)+e.x,y:(a.y||0)+e.y,w:a.width||0,h:a.height||0};e=c(a);
return{x:e.x,y:e.y,w:b(a),h:d(a)}}};g.intersectNodeBoxes=function(a,c){var b=1E6,d=1E6,e=-1E6,f=-1E6;a.forEach(function(a){a=g.position(a);b=Math.min(b,a.x);d=Math.min(d,a.y);e=Math.max(e,a.x+a.w);f=Math.max(f,a.y+a.h)});var h={x:b,y:d,w:e-b,h:f-d};if(c){var k=g.position(c);h.x-=k.x;h.y-=k.y}return h};g.getNodesBox=function(a){var c=1E6,b=-1E6,d=1E6,e=-1E6;a.forEach(function(a){a=n.position(a);c=Math.min(c,a.x);d=Math.min(d,a.y);b=Math.max(b,a.x+a.w);e=Math.max(e,a.y+a.h)});return{x:c,y:d,w:b-c,h:e-
d}};g.traverseChildren=function(a,c){function b(a){if(a&&a.children)for(var d=0;d<a.children.length;d++){var f=a.children[d];if(c(f))break;b(f)}}b(a)};g.scrollToListNode=function(a,c,b){var d=c.offsetTop+c.clientHeight,e=d-(a.scrollTop+a.clientHeight);0<e&&(a.scrollTop+=e);b&&(d-=c.clientHeight-b.offsetTop,e=a.scrollTop-d,0<e&&(a.scrollTop-=e))};return g});