// 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/ShapeUtil",["dojo/dom-style","esri/dijit/geoenrichment/utils/ColorUtil"],function(k,h){var e={createSVGNode:function(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");b&&k.set(c,b);a=[a.xmin||0,a.ymin||0,a.width,a.height].join(" ");c.setAttribute("viewBox",a);c.setAttribute("xmlns","http://www.w3.org/2000/svg");return c},createPathNode:function(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("d",a);
e._setSettingsToNode(c,b);return c},createEllipseNode:function(a,b,c,g,f){var d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");d.setAttribute("cx",a||0);d.setAttribute("cy",b||0);d.setAttribute("rx",c);d.setAttribute("ry",g);e._setSettingsToNode(d,f);return d},createCircleNode:function(a,b,c,g){var f=document.createElementNS("http://www.w3.org/2000/svg","circle");f.setAttribute("cx",a||0);f.setAttribute("cy",b||0);f.setAttribute("r",c);e._setSettingsToNode(f,g);return f},createRectNode:function(a,
b,c,g,f){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");d.setAttribute("x",a||0);d.setAttribute("y",b||0);d.setAttribute("width",c);d.setAttribute("height",g);e._setSettingsToNode(d,f);return d},createLineNode:function(a,b,c,g,f){var d=document.createElementNS("http://www.w3.org/2000/svg","line");d.setAttribute("x1",a||0);d.setAttribute("y1",b||0);d.setAttribute("x2",c||0);d.setAttribute("y2",g||0);e._setSettingsToNode(d,f);return d},createPolygonNode:function(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",
"polygon");c.setAttribute("points",a);e._setSettingsToNode(c,b);return c},createNodeByAttributes:function(a,b){switch(a.name){case "path":return e.createPathNode(a.d,b);case "ellipse":return e.createEllipseNode(a.cx,a.cy,a.rx,a.ry,b);case "circle":return e.createCircleNode(a.cx,a.cy,a.r,b);case "rect":return e.createRectNode(a.x,a.y,a.width,a.height,b);case "line":return e.createLineNode(a.x1,a.y1,a.x2,a.y2,b);case "polygon":return e.createPolygonNode(a.points,b)}return null},_setSettingsToNode:function(a,
b){if(b.borderWidth){var c=e.toColor(b,"border","#000000");a.setAttribute("stroke",h.toCSSColor(c,!0));a.setAttribute("stroke-width",b.borderWidth);a.setAttribute("stroke-opacity",c.a);b.borderDashArray&&a.setAttribute("stroke-dasharray",Array.isArray(b.borderDashArray)?b.borderDashArray.join(","):b.borderDashArray);b.strokeMiterLimit&&a.setAttribute("stroke-miterlimit",b.strokeMiterLimit);b.borderScale||a.setAttribute("vector-effect","non-scaling-stroke")}b.fillColor&&(c=e.toColor(b,"fill","#FFFFFF"),
a.setAttribute("fill",h.toCSSColor(c,!0)),a.setAttribute("fill-opacity",c.a))},toColor:function(a,b,c,e){c=h.toColor(a[b+"Color"],c);1===c.a&&(a=a[b+"Alpha"],isNaN(a)&&(a=e),isNaN(a)||(c.a=a));return c}};return e});