0&&(g+=", "),g=g+this._round(o)+", "+this._round(u)+", "+this._round(a)+", "+this._round(f)+", "+this._round(i)+", "+this._round(s),o+=b,u+=w,a+=b,f+=w,i+=b,s+=w,c=Math.max(i,Math.max(o,a)),p=Math.max(s,Math.max(u,f)),h=Math.min(i,Math.min(o,a)),d=Math.min(s,Math.min(u,f)),n=Math.abs(c-h),r=Math.abs(p-d),l=[[this._currentX,this._currentY],[o,u],[a,f],[i,s]],this._setCurveBoundingBox(l,n,r),this._currentX=i,this._currentY=s;this._addToPath(g)},quadraticCurveTo:function(){return this._quadraticCurveTo.apply(this,[e.Array(arguments),!1]),this},relativeQuadraticCurveTo:function(){return this._quadraticCurveTo.apply(this,[e.Array(arguments),!0]),this},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l=this._currentX,c=this._currentY,h,p=e.length-3,d=[],v=t?parseFloat(this._currentX):0,m=t?parseFloat(this._currentY):0;for(h=0;h360&&(r=360),this._currentX=e,this._currentY=t,n*=-65535,r*=65536,n=Math.round(n),r=Math.round(r),this.moveTo(e,t),this._addToPath(" ae "+this._round(e)+", "+this._round(t)+", "+this._round(i)+" "+this._round(i)+", "+n+", "+r),this._trackSize(s,s),this},lineTo:function(){return this._lineTo.apply(this,[e.Array(arguments),!1]),this},relativeLineTo:function(){return this._lineTo.apply(this,[e.Array(arguments),!0]),this},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=t?" r ":" l ",a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;if(typeof n=="string"||typeof n=="number"){i=e.length-1;for(r=0;rthis._right&&(this._right=e),ethis._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top},_left:0,_right:0,_top:0,_bottom:0,_width:0,_height:0},e.VMLDrawing=E,p=function(){this._transforms=[],this.matrix=new e.Matrix,this._normalizedMatrix=new e.Matrix,p.superclass.constructor.apply(this,arguments)},p.NAME="shape",e.extend(p,e.GraphicBase,e.mix({_type:"shape",init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t.createNode(),n&&this._setGraphic(n),r&&t._parsePathData(r),this._updateHandler()},_setGraphic:function(t){var n;t instanceof e.VMLGraphic?this._graphic=t:(n=new e.VMLGraphic({render:t}),n._appendShape(this),this._graphic=n,this._appendStrokeAndFill())},_appendStrokeAndFill:function(){this._strokeNode&&this.node.appendChild(this._strokeNode),this._fillNode&&this.node.appendChild(this._fillNode)},createNode:function(){var e,t=this._camelCaseConcat,i=this.get("x"),s=this.get("y"),o=this.get("width"),u=this.get("height"),a,f,l=this.name,h,p=this.get("visible")?"visible":"hidden",d,v,m,g,y,b,E,S,x,T;a=this.get("id"),f=this._type==="path"?"shape":this._type,v=w(r)+" "+w(t(n,r))+" "+w(l)+" "+w(t(n,l))+" "+n+f,m=this._getStrokeProps(),x=this._getFillProps(),h="<"+f+' xmlns="urn:schemas-microsft.com:vml" id="'+a+'" class="'+v+'" style="behavior:url(#default#VML);display:inline-block;position:absolute;left:'+i+"px;top:"+s+"px;width:"+o+"px;height:"+u+"px;visibility:"+p+'"',m&&m.weight&&m.weight>0?(g=m.endcap,y=parseFloat(m.opacity),b=m.joinstyle,E=m.miterlimit,S=m.dashstyle,h+=' stroked="t" strokecolor="'+m.color+'" strokeWeight="'+m.weight+'px"',d='",this._strokeNode=c.createElement(d),h+=' stroked="t"'):h+=' stroked="f"',x&&(x.node&&(T=x.node,this._fillNode=c.createElement(T)),x.color&&(h+=' fillcolor="'+x.color+'"'),h+=' filled="'+x.filled+'"'),h+=">",h+=""+f+">",e=c.createElement(h),this.node=e,this._strokeFlag=!1,this._fillFlag=!1},addClass:function(e){var t=this.node;f.addClass(t,e)},removeClass:function(e){var t=this.node;f.removeClass(t,e)},getXY:function(){var e=this._graphic,t=e.getXY(),n=this.get("x"),r=this.get("y");return[t[0]+n,t[1]+r]},setXY:function(e){var t=this._graphic,n=t.getXY();this.set("x",e[0]-n[0]),this.set("y",e[1]-n[1])},contains:function(t){var n=t instanceof e.Node?t._node:t;return n===this.node},compareTo:function(e){var t=this.node;return t===e},test:function(e){return l.test(this.node,e)},_getStrokeProps:function(){var e,t=this.get("stroke"),n,r,i="",s,o=0,f,l,c;if(t&&t.weight&&t.weight>0){e={},l=t.linecap||"flat",c=t.linejoin||"round",l!=="round"&&l!=="square"&&(l="flat"),n=parseFloat(t.opacity),r=t.dashstyle||"none",t.color=t.color||"#000000",t.weight=t.weight||1,t.opacity=u(n)?n:1,e.stroked=!0,e.color=t.color,e.weight=t.weight,e.endcap=l,e.opacity=t.opacity;if(a(r)){i=[],f=r.length;for(o=0;o0){l=t.linecap||"flat",c=t.linejoin||"round",l!=="round"&&l!=="square"&&(l="flat"),n=parseFloat(t.opacity),r=t.dashstyle||"none",t.color=t.color||"#000000",t.weight=t.weight||1,t.opacity=u(n)?n:1,e.stroked=!0,e.strokeColor=t.color,e.strokeWeight=t.weight+"px",this._strokeNode||(this._strokeNode=this._createGraphicNode("stroke"),e.appendChild(this._strokeNode)),this._strokeNode.endcap=l,this._strokeNode.opacity=t.opacity;if(a(r)){i=[],f=r.length;for(o=0;o",n.node=s}else e.color&&(t=parseFloat(e.opacity),o=!0,n.color=e.color,u(t)&&(t=Math.max(Math.min(t,1),0),n.opacity=t,t<1&&(n.node='')));n.filled=o}return n},_fillChangeHandler:function(){if(!this._fillFlag)return;var e=this.node,t=this.get("fill"),n,r,i=!1,s,o;if(t)if(t.type==="radial"||t.type==="linear"){i=!0,o=this._getGradientFill(t);if(this._fillNode)for(s in o)o.hasOwnProperty(s)&&(s==="colors"?this._fillNode.colors.value=o[s]:this._fillNode[s]=o[s]);else{r='",this._fillNode=c.createElement(r),e.appendChild(this._fillNode)}}else t.color&&(e.fillcolor=t.color,n=parseFloat(t.opacity),i=!0,u(n)&&
n<1?(t.opacity=n,this._fillNode?(this._fillNode.getAttribute("type")!=="solid"&&(this._fillNode.type="solid"),this._fillNode.opacity=n):(r='",this._fillNode=c.createElement(r),e.appendChild(this._fillNode))):this._fillNode&&(this._fillNode.opacity=1,this._fillNode.type="solid"));e.filled=i,this._fillFlag=!1},_updateFillNode:function(e){this._fillNode||(this._fillNode=this._createGraphicNode("fill"),e.appendChild(this._fillNode))},_getGradientFill:function(e){var t={},n,r,i=e.type,s=this.get("width"),o=this.get("height"),a=u,f,l=e.stops,c=l.length,h,p,d,v,m="",g=e.cx,y=e.cy,b=e.fx,w=e.fy,E=e.r,S,x=e.rotation||0;i==="linear"?(x<=270?x=Math.abs(x-270):x<360?x=270+(360-x):x=270,t.type="gradient",t.angle=x):i==="radial"&&(n=s*E*2,r=o*E*2,b=E*2*(b-.5),w=E*2*(w-.5),b+=g,w+=y,t.focussize=n/s/10+"% "+r/o/10+"%",t.alignshape=!1,t.type="gradientradial",t.focus="100%",t.focusposition=Math.round(b*100)+"% "+Math.round(w*100)+"%");for(d=0;d0?d+1:"",t["opacity"+v]=h+"",m+=", "+S+" "+p;return parseFloat(S)<100&&(m+=", 100% "+p),t.colors=m.substr(2),t},_addTransform:function(t,n){n=e.Array(n),this._transform=o.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var t=this.node,n,r,i,s=this.get("x"),o=this.get("y"),u,a,f=this.matrix,l=this._normalizedMatrix,h=this instanceof e.VMLPath,p,d=this._transforms.length;if(this._transforms&&this._transforms.length>0){i=this.get("transformOrigin"),h&&l.translate(this._left,this._top),u=i[0]-.5,a=i[1]-.5,u=Math.max(-0.5,Math.min(.5,u)),a=Math.max(-0.5,Math.min(.5,a));for(p=0;p'),this.node.appendChild(this._skew)),this._skew.matrix=r,this._skew.on=!0,this._skew.origin=u+", "+a),this._type!=="path"&&(this._transforms=[]),t.style.left=s+this._getSkewOffsetValue(l.dx)+"px",t.style.top=o+this._getSkewOffsetValue(l.dy)+"px"},_getSkewOffsetValue:function(t){var n=e.MatrixUtil.sign(t),r=Math.abs(t);return t=Math.min(r,32767)*n,t},_translateX:0,_translateY:0,_transform:"",translate:function(e,t){this._translateX+=e,this._translateY+=t,this._addTransform("translate",arguments)},translateX:function(e){this._translateX+=e,this._addTransform("translateX",arguments)},translateY:function(e){this._translateY+=e,this._addTransform("translateY",arguments)},skew:function(){this._addTransform("skew",arguments)},skewX:function(){this._addTransform("skewX",arguments)},skewY:function(){this._addTransform("skewY",arguments)},rotate:function(){this._addTransform("rotate",arguments)},scale:function(){this._addTransform("scale",arguments)},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.on(t,n,"#"+this.get("id")):e.on.apply(this,arguments)},_draw:function(){},_updateHandler:function(){var e=this,t=e.node;e._fillChangeHandler(),e._strokeChangeHandler(),t.style.width=this.get("width")+"px",t.style.height=this.get("height")+"px",this._draw(),e._updateTransform()},_createGraphicNode:function(e){return e=e||this._type,c.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml"'+' style="behavior:url(#default#VML);display:inline-block;"'+' class="vml'+e+'"'+"/>")},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},set:function(){var e=this;h.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},getBounds:function(){var t=this instanceof e.VMLPath,n=this.get("width"),r=this.get("height"),i=this.get("x"),s=this.get("y");return t&&(i+=this._left,s+=this._top,n=this._right-this._left,r=this._bottom-this._top),this._getContentRect(n,r,i,s)},_getContentRect:function(t,n,r,i){var s=this.get("transformOrigin"),o=s[0]*t,u=s[1]*n,a=this.matrix.getTransformArray(this.get("transform")),f=new e.Matrix,l,c=a.length,h,p,d,v=this instanceof e.VMLPath;v&&f.translate(this._left,this._top),o=isNaN(o)?0:o,u=isNaN(u)?0:u,f.translate(o,u);for(l=0;l-1&&(r.opacity=e.Color._getAlpha(r.color),r.color=e.Color.toHex(r.color))),this._fillFlag=!0,r}},stroke:{valueFn:"_getDefaultStroke",setter:function(t){var n,r,i,s=this.get("stroke")||this._getDefaultStroke();if(t){t.hasOwnProperty("weight")&&(i=parseInt(t.weight,10),isNaN(i)||(t.weight=i));for(n in t)t.hasOwnProperty(n)&&(s[n]=t[n])}return s.color&&s.color.toLowerCase().indexOf("rgba")>-1&&(s.opacity=e.Color._getAlpha(s.color),s.color=e.Color.toHex(s.color)),r=s,this._strokeFlag=!0,r}},autoSize:{value:!1},pointerEvents:{value:"visiblePainted"},node:{readOnly:!0,getter:function(){return this.node}},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.VMLShape=p,v=function(){v.superclass.constructor.apply(this,arguments)},v.NAME="path",e.extend(v,e.VMLShape),v.ATTRS=e.merge(e.VMLShape.ATTRS,{width:{getter:function(){var e=Math.max(this._right-this._left,0);return e}},height:{getter:function(){return Math.max(this._bottom-this._top,0)}},path:{readOnly:!0,getter:function(){return this._path}}}),e.VMLPath=v,m=function(){m.superclass.constructor.apply(this,arguments)},m.NAME="rect",e.extend(m,e.VMLShape,{_type:"rect"}),m.ATTRS=e.VMLShape.ATTRS,e.VMLRect=m,g=function(){g.superclass.constructor.apply(this,arguments)},g.NAME="ellipse",e.extend(g,e.VMLShape,{_type:"oval"}),g.ATTRS=e.merge(e.VMLShape.ATTRS,{xRadius:{lazyAdd:!1,getter:function(){var e=this.get("width");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("width",t),e}},yRadius:{lazyAdd:!1,getter:function(){var e=this.get("height");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("height",t),e}}}),e.VMLEllipse=g,d=function(){d.superclass.constructor.apply(this,arguments)},d.NAME="circle",e.extend(d,p,{_type:"oval"}),d.ATTRS=e.merge(p.ATTRS,{radius:{lazyAdd:!1,value:0},width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}}}),e.VMLCircle=d,b=function(){b.superclass.constructor.apply(this,arguments)},b.NAME="vmlPieSlice",e.extend(b,e.VMLShape,e.mix({_type:"shape",_draw:function(){var e=this.get("cx"),t=this.get("cy"),n=this.get("startAngle"),r=this.get("arc"),i=this.get("radius");this.clear(),this.drawWedge(e,t,n,r,i),this.end()}},e.VMLDrawing.prototype)),b.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.VMLShape.ATTRS),e.VMLPieSlice=b,y=function(){y.superclass.constructor.apply(this,arguments)},y.NAME="vmlGraphic",y.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{resizeDown:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}}},e.extend(y,e.GraphicBase,{set:function(){var t=this,n=arguments[0],r={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},i,s=!1;h.prototype.set.apply(t,arguments);if(t._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(o.isString&&r[n])s=!0;else if(o.isObject(n))for(i in r)if(r.hasOwnProperty(i)&&n[i]){s=!0;break}s&&t._redraw()},_x:0,_y:0,getXY:function(){var t=this.parentNode,n=this.get("x"),r=this.get("y"),i;return t?(i=e.DOM.getXY(t),i[0]+=n,i[1]+=r):i=e.DOM._getOffset(this._node),i},initializer:function(){var e=this.get("render"),t=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._node=this._createGraphic(),this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=t,this._node.setAttribute("id",this.get("id")),e&&this.render(e)},render:function(t){var n=t||c.body,r=this._node,i,s;return t instanceof e.Node?n=t._node:e.Lang.isString(t)&&(n=e.Selector.query(t,c.body,!0)),i=this.get("width")||parseInt(e.DOM.getComputedStyle(n,"width"),10),s=this.get("height")||parseInt(e.DOM.getComputedStyle(n,"height"),10),n.appendChild(r),this.parentNode=n,this.set("width",i),this.set("height",s),this},destroy:function(){this.removeAllShapes(),this._node&&(this._removeChildren(this._node),this._node.parentNode&&this._node.parentNode.removeChild(this._node),this._node=null)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n._appendStrokeAndFill(),n},_appendShape:function(e){var t=e.node,n=this._frag||this._node;this.get("autoDraw")||this.get("autoSize")==="sizeContentToGraphic"?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){e instanceof p||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof p&&(e._destroy(),this._shapes[e.get("id")]=null,delete this._shapes[e.get("id")]
),this.get("autoDraw")&&this._redraw()},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes(),this._removeChildren(this._node)},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._node&&(this._node.style.visibility=r),this._node&&(this._node.style.visibility=r)},setSize:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.width=e+"px",this._node.style.height=t+"px"},setPosition:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.left=e+"px",this._node.style.top=t+"px"},_createGraphic:function(){var e=c.createElement('');return e},_createGraphicNode:function(e){return c.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml"'+' style="behavior:url(#default#VML);display:inline-block;zoom:1;"'+"/>")},getShapeById:function(e){return this._shapes[e]},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.VMLCircle,rect:e.VMLRect,path:e.VMLPath,ellipse:e.VMLEllipse,pieslice:e.VMLPieSlice},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e.apply(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=c.createDocumentFragment()),this._frag},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.leftt.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,n.width=n.right-n.left,n.height=n.bottom-n.top,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_redraw:function(){var t=this.get("autoSize"),n,r=this.parentNode,i=parseFloat(e.DOM.getComputedStyle(r,"width")),s=parseFloat(e.DOM.getComputedStyle(r,"height")),o=0,u=0,a=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,f=a.left,l=a.right,c=a.top,h=a.bottom,p=l-f,d=h-c,v,m,g,y,b,w=this.get("visible");this._node.style.visibility="hidden",t?(t==="sizeContentToGraphic"?(n=this.get("preserveAspectRatio"),n==="none"||p/d===i/s?(o=f,u=c,m=p,g=d):p*s/d>i?(v=s/i,m=p,g=p*v,b=i*(d/p)*(g/s),u=this._calculateCoordOrigin(n.slice(5).toLowerCase(),b,g),u=c+u,o=f):(v=i/s,m=d*v,g=d,y=s*(p/d)*(m/i),o=this._calculateCoordOrigin(n.slice(1,4).toLowerCase(),y,m),o+=f,u=c),this._node.style.width=i+"px",this._node.style.height=s+"px",this._node.coordOrigin=o+", "+u):(m=p,g=d,this._node.style.width=p+"px",this._node.style.height=d+"px",this._state.width=p,this._state.height=d),this._node.coordSize=m+", "+g):(this._node.style.width=i+"px",this._node.style.height=s+"px",this._node.coordSize=i+", "+s),this._frag&&(this._node.appendChild(this._frag),this._frag=null),w&&(this._node.style.visibility="visible")},_calculateCoordOrigin:function(e,t,n){var r;switch(e){case"min":r=0;break;case"mid":r=(t-n)/2;break;case"max":r=t-n}return r},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=o.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=o.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=o.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=o.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=o.isNumber(i.left)?i.left:0,i.top=o.isNumber(i.top)?i.top:0,i.right=o.isNumber(i.right)?i.right:0,i.bottom=o.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_toFront:function(t){var n=this._node;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this._node,r;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.VMLGraphic=y},"3.17.2",{requires:["graphics","color-base"]});