\n";for(t in this.objects)if(this.objects.hasOwnProperty(t)){s=0;for(i in this.objects[t].childElements)this.objects[t].childElements.hasOwnProperty(i)&&(s+=1);s>=0&&(e+=""+this.objects[t].id+": ");for(i in this.objects[t].childElements)this.objects[t].childElements.hasOwnProperty(i)&&(e+=this.objects[t].childElements[i].id+"("+this.objects[t].childElements[i].name+"), ");e+="\n"}return e+="
\n",r=window.open(),r.document.open(),r.document.write(e),r.document.close(),this},showXML:function(){var t=window.open("");return t.document.open(),t.document.write(""+u.escapeHTML(this.xmlString)+"
"),t.document.close(),this},prepareUpdate:function(){var t,e,i=this.objectsList.length;for(t=0;i>t;t++)e=this.objectsList[t],e.needsUpdate=e.needsRegularUpdate||this.needsFullUpdate;for(t in this.groups)this.groups.hasOwnProperty(t)&&(e=this.groups[t],e.needsUpdate=e.needsRegularUpdate||this.needsFullUpdate);return this},updateElements:function(t){var e,i;for(t=this.select(t),e=0;et;t++)e=this.objectsList[t],e.updateRenderer();return this},updateRendererCanvas:function(){var t,e,i,r,s,o=this.objectsList.length,n=this.options.layer,a=this.options.layer.numlayers,h=Number.NEGATIVE_INFINITY;for(i=0;a>i;i++){r=Number.POSITIVE_INFINITY;for(s in n)n.hasOwnProperty(s)&&n[s]>h&&n[s]t;t++)e=this.objectsList[t],e.visProp.layer===r&&e.prepareUpdate().updateRenderer()}return this},addHook:function(e,i,r){return t.deprecated("Board.addHook()","Board.on()"),i=u.def(i,"update"),r=u.def(r,this),this.hooks.push([i,e]),this.on(i,e,r),this.hooks.length-1},addEvent:t.shortcut(t.Board.prototype,"on"),removeHook:function(e){return t.deprecated("Board.removeHook()","Board.off()"),this.hooks[e]&&(this.off(this.hooks[e][0],this.hooks[e][1]),this.hooks[e]=null),this},removeEvent:t.shortcut(t.Board.prototype,"off"),updateHooks:function(e){var i=Array.prototype.slice.call(arguments,0);return t.deprecated("Board.updateHooks()","Board.triggerEventHandlers()"),i[0]=u.def(i[0],"update"),this.triggerEventHandlers([i[0]],arguments),this},addChild:function(t){return u.exists(t)&&u.exists(t.containerObj)&&(this.dependentBoards.push(t),this.update()),this},removeChild:function(t){var e;for(e=this.dependentBoards.length-1;e>=0;e--)this.dependentBoards[e]===t&&this.dependentBoards.splice(e,1);return this},update:function(t){var e,i,r,s;if(this.inUpdate||this.isSuspendedUpdate)return this;for(this.inUpdate=!0,"all"===this.attr.minimizereflow&&this.containerObj&&"vml"!==this.renderer.type&&(s=this.renderer.removeToInsertLater(this.containerObj)),"svg"===this.attr.minimizereflow&&"svg"===this.renderer.type&&(s=this.renderer.removeToInsertLater(this.renderer.svgRoot)),this.prepareUpdate().updateElements(t).updateConditions(),this.renderer.suspendRedraw(this),this.updateRenderer(),this.renderer.unsuspendRedraw(),this.triggerEventHandlers(["update"],[]),s&&s(),i=this.dependentBoards.length,e=0;i>e;e++)r=this.dependentBoards[e],u.exists(r)&&r!==this&&(r.updateQuality=this.updateQuality,r.prepareUpdate().updateElements().updateConditions(),r.renderer.suspendRedraw(),r.updateRenderer(),r.renderer.unsuspendRedraw(),r.triggerEventHandlers(["update"],[]));return this.inUpdate=!1,this},fullUpdate:function(){return this.needsFullUpdate=!0,this.update(),this.needsFullUpdate=!1,this},addGrid:function(){return this.create("grid",[]),this},removeGrids:function(){var t;for(t=0;ts;s++)r[i[s].id]=i[s];n=new C(r)}else u.isObject(n)&&t.exists(n.id)&&!t.exists(this.objects[n.id])&&(n=null);return n},hasPoint:function(e,i){var r=e,s=i,o=this.getBoundingBox();return t.exists(e)&&t.isArray(e.usrCoords)&&(r=e.usrCoords[1],s=e.usrCoords[2]),!!(u.isNumber(r)&&u.isNumber(s)&&o[0]s&&s>o[3])},updateCSSTransforms:function(){var t=this.containerObj,e=t,i=t;for(this.cssTransMat=f.getCSSTransformMatrix(e),e=e.offsetParent;e;){for(this.cssTransMat=o.matMatMult(f.getCSSTransformMatrix(e),this.cssTransMat),i=i.parentNode;i!==e;)this.cssTransMat=o.matMatMult(f.getCSSTransformMatrix(e),this.cssTransMat),i=i.parentNode;e=e.offsetParent}return this.cssTransMat=o.inverse(this.cssTransMat),this},startSelectionMode:function(){this.selectingMode=!0,this.selectionPolygon.setAttribute({visible:!0}),this.selectingBox=[[0,0],[0,0]],this._setSelectionPolygonFromBox(),this.selectionPolygon.prepareUpdate().update().updateRenderer()},stopSelectionMode:function(){return this.selectingMode=!1,this.selectionPolygon.setAttribute({visible:!1}),[this.selectionPolygon.vertices[0].coords,this.selectionPolygon.vertices[2].coords]},_startSelecting:function(t){this.isSelecting=!0,this.selectingBox=[[t[0],t[1]],[t[0],t[1]]],this._setSelectionPolygonFromBox()},_moveSelecting:function(t){this.isSelecting&&(this.selectingBox[1]=[t[0],t[1]],this._setSelectionPolygonFromBox(),this.selectionPolygon.prepareUpdate().update().updateRenderer())},_stopSelecting:function(t){var e=this.getMousePosition(t);this.isSelecting=!1,this.selectingBox[1]=[e[0],e[1]],this._setSelectionPolygonFromBox()},_setSelectionPolygonFromBox:function(){var e=this.selectingBox[0],i=this.selectingBox[1];this.selectionPolygon.vertices[0].setPositionDirectly(t.COORDS_BY_SCREEN,[e[0],e[1]]),this.selectionPolygon.vertices[1].setPositionDirectly(t.COORDS_BY_SCREEN,[e[0],i[1]]),this.selectionPolygon.vertices[2].setPositionDirectly(t.COORDS_BY_SCREEN,[i[0],i[1]]),this.selectionPolygon.vertices[3].setPositionDirectly(t.COORDS_BY_SCREEN,[i[0],e[1]])},_testForSelection:function(t){!this.attr.selection.enabled||this.attr.selection.needshift&&!t.shiftKey||this.attr.selection.needctrl&&!t.ctrlKey||this.startSelectionMode()},__evt__down:function(t){},__evt__mousedown:function(t){},__evt__pointerdown:function(t){},__evt__touchstart:function(t){},__evt__up:function(t){},__evt__mouseup:function(t){},__evt__pointerup:function(t){},__evt__touchend:function(t){},__evt__move:function(t,e){},__evt__mousemove:function(t,e){},__evt__pointermove:function(t,e){},__evt__touchmove:function(t,e){},__evt__hit:function(t,e,i){},__evt__mousehit:function(t,e,i){},__evt__update:function(){},__evt__boundingbox:function(){},__evt__startselecting:function(){},__evt__mousestartselecting:function(){},__evt__pointerstartselecting:function(){},__evt__touchstartselecting:function(){},__evt__stopselecting:function(){},__evt__mousestopselecting:function(){},__evt__pointerstopselecting:function(){},__evt__touchstopselecting:function(){},__evt__moveselecting:function(){},__evt__mousemoveselecting:function(){},__evt__pointermoveselecting:function(){},__evt__touchmoveselecting:function(){},__evt:function(){},createRoulette:function(t,e,i,r,o,n,h){var l=this,c=function(){var c,d=0,u=0,p=0,f=i,m=s.root(function(i){var r=t.X(f),s=t.Y(f),o=e.X(i),n=e.Y(i);return(r-o)*(r-o)+(s-n)*(s-n)},[0,2*Math.PI]),g=0,b=0,v=l.create("transform",[function(){return d}],{type:"rotate"}),y=l.create("transform",[function(){return d},function(){return t.X(f)},function(){return t.Y(f)}],{type:"rotate"}),C=l.create("transform",[function(){return u},function(){return p}],{type:"translate"}),P=function(t,e,i){var r=s.D(t.X)(e),o=s.D(t.Y)(e),n=s.D(t.X)(i),a=s.D(t.Y)(i),h=s.D(t.X)(.5*(e+i)),l=s.D(t.Y)(.5*(e+i)),c=Math.sqrt(r*r+o*o),d=Math.sqrt(n*n+a*a),u=Math.sqrt(h*h+l*l);return(c+4*u+d)*(i-e)/6},_=function(t){return c-P(e,m,t)},S=Math.PI/18,E=9*S,x=null;return this.rolling=function(){var i,n,x,w,O;g=f+o*r,c=P(t,f,g),b=s.root(_,m),i=new a(t.X(g),t.Y(g)),n=new a(e.X(b),e.Y(b)),x=new a(s.D(t.X)(g),s.D(t.Y)(g)),w=new a(s.D(e.X)(b),s.D(e.Y)(b)),O=a.C.div(x,w),d=Math.atan2(O.imaginary,O.real),O.div(a.C.abs(O)),O.mult(n),u=i.real-O.real,p=i.imaginary-O.imaginary,-S>d&&d>-E?(d=-S,y.applyOnce(h)):d>S&&E>d?(d=S,y.applyOnce(h)):(v.applyOnce(h),C.applyOnce(h),f=g,m=b),l.update()},this.start=function(){return n>0&&(x=window.setInterval(this.rolling,n)),this},this.stop=function(){return window.clearInterval(x),this},this};return new c}}),t.Board}),define("renderer/svg",["jxg","options","renderer/abstract","base/constants","utils/type","utils/env","utils/color","utils/base64","math/numerics"],function(t,e,i,r,s,o,n,a,h){"use strict";return t.SVGRenderer=function(t,i){var r;for(this.type="svg",this.isIE=-1!==navigator.appVersion.indexOf("MSIE")||navigator.userAgent.match(/Trident\//),this.svgRoot=null,this.svgNamespace="http://www.w3.org/2000/svg",this.xlinkNamespace="http://www.w3.org/1999/xlink",this.container=t,this.container.style.MozUserSelect="none",this.container.style.overflow="hidden",""===this.container.style.position&&(this.container.style.position="relative"),this.svgRoot=this.container.ownerDocument.createElementNS(this.svgNamespace,"svg"),this.svgRoot.style.overflow="hidden",this.resize(i.width,i.height),this.container.appendChild(this.svgRoot),this.defs=this.container.ownerDocument.createElementNS(this.svgNamespace,"defs"),this.svgRoot.appendChild(this.defs),this.filter=this.container.ownerDocument.createElementNS(this.svgNamespace,"filter"),this.filter.setAttributeNS(null,"id",this.container.id+"_f1"),this.filter.setAttributeNS(null,"width","300%"),this.filter.setAttributeNS(null,"height","300%"),this.filter.setAttributeNS(null,"filterUnits","userSpaceOnUse"),this.feOffset=this.container.ownerDocument.createElementNS(this.svgNamespace,"feOffset"),this.feOffset.setAttributeNS(null,"result","offOut"),this.feOffset.setAttributeNS(null,"in","SourceAlpha"),this.feOffset.setAttributeNS(null,"dx","5"),this.feOffset.setAttributeNS(null,"dy","5"),this.filter.appendChild(this.feOffset),this.feGaussianBlur=this.container.ownerDocument.createElementNS(this.svgNamespace,"feGaussianBlur"),this.feGaussianBlur.setAttributeNS(null,"result","blurOut"),this.feGaussianBlur.setAttributeNS(null,"in","offOut"),this.feGaussianBlur.setAttributeNS(null,"stdDeviation","3"),this.filter.appendChild(this.feGaussianBlur),this.feBlend=this.container.ownerDocument.createElementNS(this.svgNamespace,"feBlend"),this.feBlend.setAttributeNS(null,"in","SourceGraphic"),this.feBlend.setAttributeNS(null,"in2","blurOut"),this.feBlend.setAttributeNS(null,"mode","normal"),this.filter.appendChild(this.feBlend),this.defs.appendChild(this.filter),this.layer=[],r=0;re;e++)i=t.ticks[e],o=i[0],n=i[1],s.isNumber(o[0])&&s.isNumber(o[1])&&(a+="M "+o[0]+" "+n[0]+" L "+o[1]+" "+n[1]+" ");r=t.rendNode,s.exists(r)||(r=this.createPrim("path",t.id),this.appendChildPrim(r,t.visProp.layer),t.rendNode=r),r.setAttributeNS(null,"stroke",t.visProp.strokecolor),r.setAttributeNS(null,"stroke-opacity",t.visProp.strokeopacity),r.setAttributeNS(null,"stroke-width",t.visProp.strokewidth),this.updatePathPrim(r,a,t.board)},displayCopyright:function(t,e){var i,r=this.createPrim("text","licenseText");r.setAttributeNS(null,"x","20px"),r.setAttributeNS(null,"y",2+e+"px"),r.setAttributeNS(null,"style","font-family:Arial,Helvetica,sans-serif; font-size:"+e+"px; fill:#356AA0; opacity:0.3;"),i=this.container.ownerDocument.createTextNode(t),r.appendChild(i),this.appendChildPrim(r,0)},drawInternalText:function(t){var e=this.createPrim("text",t.id);return e.setAttributeNS(null,"class",t.visProp.cssclass),e.setAttributeNS("http://www.w3.org/XML/1998/namespace","space","preserve"),t.rendNodeText=this.container.ownerDocument.createTextNode(""),e.appendChild(t.rendNodeText),this.appendChildPrim(e,t.visProp.layer),e},updateInternalText:function(t){var e,i=t.plaintext;isNaN(t.coords.scrCoords[1]+t.coords.scrCoords[2])||(e=t.coords.scrCoords[1],t.visPropOld.left!==t.visProp.anchorx+e&&(t.rendNode.setAttributeNS(null,"x",e+"px"),"left"===t.visProp.anchorx?t.rendNode.setAttributeNS(null,"text-anchor","start"):"right"===t.visProp.anchorx?t.rendNode.setAttributeNS(null,"text-anchor","end"):"middle"===t.visProp.anchorx&&t.rendNode.setAttributeNS(null,"text-anchor","middle"),t.visPropOld.left=t.visProp.anchorx+e),e=t.coords.scrCoords[2],t.visPropOld.top!==t.visProp.anchory+e&&(t.rendNode.setAttributeNS(null,"y",e+.5*this.vOffsetText+"px"),"bottom"===t.visProp.anchory?t.rendNode.setAttributeNS(null,"dominant-baseline","text-after-edge"):"top"===t.visProp.anchory?t.rendNode.setAttributeNS(null,"dominant-baseline","text-before-edge"):"middle"===t.visProp.anchory&&t.rendNode.setAttributeNS(null,"dominant-baseline","middle"),t.visPropOld.top=t.visProp.anchory+e)),t.htmlStr!==i&&(t.rendNodeText.data=i,t.htmlStr=i),this.transformImage(t,t.transformations)},updateInternalTextStyle:function(t,e,i){this.setObjectFillColor(t,e,i)},drawImage:function(t){var e=this.createPrim("image",t.id);e.setAttributeNS(null,"preserveAspectRatio","none"),this.appendChildPrim(e,t.visProp.layer),t.rendNode=e,this.updateImage(t)},transformImage:function(t,e){var i,r,s=t.rendNode,o="",n=e.length;n>0&&(r=this.joinTransforms(t,e),i=[r[1][1],r[2][1],r[1][2],r[2][2],r[1][0],r[2][0]].join(","),o+=" matrix("+i+") ",s.setAttributeNS(null,"transform",o))},updateImageURL:function(t){var e=s.evaluate(t.url);t.rendNode.setAttributeNS(this.xlinkNamespace,"xlink:href",e)},updateImageStyle:function(t,e){var i=e?t.visProp.highlightcssclass:t.visProp.cssclass;t.rendNode.setAttributeNS(null,"class",i)},appendChildPrim:function(t,i){return s.exists(i)?i>=e.layer.numlayers&&(i=e.layer.numlayers-1):i=0,this.layer[i].appendChild(t),t},createPrim:function(t,e){var i=this.container.ownerDocument.createElementNS(this.svgNamespace,t);return i.setAttributeNS(null,"id",this.container.id+"_"+e),i.style.position="absolute","path"===t&&(i.setAttributeNS(null,"stroke-linecap","round"),i.setAttributeNS(null,"stroke-linejoin","round")),i},remove:function(t){s.exists(t)&&s.exists(t.parentNode)&&t.parentNode.removeChild(t)},makeArrows:function(t){var e;return t.visPropOld.firstarrow===t.visProp.firstarrow&&t.visPropOld.lastarrow===t.visProp.lastarrow?void(this.isIE&&t.visProp.visible&&(t.visProp.firstarrow||t.visProp.lastarrow)&&t.rendNode.parentNode.insertBefore(t.rendNode,t.rendNode)):(t.visProp.firstarrow?(e=t.rendNodeTriangleStart,s.exists(e)?this.defs.appendChild(e):(e=this._createArrowHead(t,"End"),this.defs.appendChild(e),t.rendNodeTriangleStart=e,t.rendNode.setAttributeNS(null,"marker-start","url(#"+this.container.id+"_"+t.id+"TriangleEnd)"))):(e=t.rendNodeTriangleStart,s.exists(e)&&this.remove(e)),t.visProp.lastarrow?(e=t.rendNodeTriangleEnd,s.exists(e)?this.defs.appendChild(e):(e=this._createArrowHead(t,"Start"),this.defs.appendChild(e),t.rendNodeTriangleEnd=e,t.rendNode.setAttributeNS(null,"marker-end","url(#"+this.container.id+"_"+t.id+"TriangleStart)"))):(e=t.rendNodeTriangleEnd,s.exists(e)&&this.remove(e)),t.visPropOld.firstarrow=t.visProp.firstarrow,void(t.visPropOld.lastarrow=t.visProp.lastarrow))},updateEllipsePrim:function(t,e,i,r,s){var o=1e6;e=Math.abs(e)"===i?r=" M "+(s[1]-e)+" "+s[2]+" L "+s[1]+" "+(s[2]+e)+" L "+(s[1]+e)+" "+s[2]+" L "+s[1]+" "+(s[2]-e)+" Z ":"^"===i?r=" M "+s[1]+" "+(s[2]-e)+" L "+(s[1]-o)+" "+(s[2]+n)+" L "+(s[1]+o)+" "+(s[2]+n)+" Z ":"v"===i?r=" M "+s[1]+" "+(s[2]+e)+" L "+(s[1]-o)+" "+(s[2]-n)+" L "+(s[1]+o)+" "+(s[2]-n)+" Z ":">"===i?r=" M "+(s[1]+e)+" "+s[2]+" L "+(s[1]-n)+" "+(s[2]-o)+" L "+(s[1]-n)+" "+(s[2]+o)+" Z ":"<"===i&&(r=" M "+(s[1]-e)+" "+s[2]+" L "+(s[1]+n)+" "+(s[2]-o)+" L "+(s[1]+n)+" "+(s[2]+o)+" Z "),r},updatePathStringPrim:function(t){var e,i,r,s=" M ",o=" L ",n=" C ",a=s,h=5e3,l="";if(t.numberPoints<=0)return"";if(r=Math.min(t.points.length,t.numberPoints),1===t.bezierDegree)for(e=0;r>e;e++)i=t.points[e].scrCoords,isNaN(i[1])||isNaN(i[2])?a=s:(i[1]=Math.max(Math.min(i[1],h),-h),i[2]=Math.max(Math.min(i[2],h),-h),l+=a+i[1]+" "+i[2],a=o);else if(3===t.bezierDegree)for(e=0;r>e;)i=t.points[e].scrCoords,isNaN(i[1])||isNaN(i[2])?a=s:(l+=a+i[1]+" "+i[2],a===n&&(e+=1,i=t.points[e].scrCoords,l+=" "+i[1]+" "+i[2],e+=1,i=t.points[e].scrCoords,l+=" "+i[1]+" "+i[2]),a=n),e+=1;return l},updatePathStringBezierPrim:function(t){var e,i,r,s,o,n,a,l=" M ",c=" C ",d=l,u=5e3,p="",f=t.visProp.strokewidth,m="plot"!==t.visProp.curvetype;if(t.numberPoints<=0)return"";for(m&&t.board.options.curve.RDPsmoothing&&(t.points=h.RamerDouglasPeucker(t.points,.5)),a=Math.min(t.points.length,t.numberPoints),i=1;3>i;i++)for(d=l,e=0;a>e;e++)s=t.points[e].scrCoords,isNaN(s[1])||isNaN(s[2])?d=l:(s[1]=Math.max(Math.min(s[1],u),-u),s[2]=Math.max(Math.min(s[2],u),-u),d===l?p+=d+s[1]+" "+s[2]:(r=2*i,p+=[d,o+.333*(s[1]-o)+f*(r*Math.random()-i)," ",n+.333*(s[2]-n)+f*(r*Math.random()-i)," ",o+.666*(s[1]-o)+f*(r*Math.random()-i)," ",n+.666*(s[2]-n)+f*(r*Math.random()-i)," ",s[1]," ",s[2]].join("")),d=c,o=s[1],n=s[2]);return p},updatePolygonPrim:function(t,e){var i,r,s="",o=e.vertices.length;for(t.setAttributeNS(null,"stroke","none"),i=0;o-1>i;i++){if(!e.vertices[i].isReal)return void t.setAttributeNS(null,"points","");r=e.vertices[i].coords.scrCoords,s=s+r[1]+","+r[2],o-2>i&&(s+=" ")}-1===s.indexOf("NaN")&&t.setAttributeNS(null,"points",s)},updateRectPrim:function(t,e,i,r,s){t.setAttributeNS(null,"x",e),t.setAttributeNS(null,"y",i),t.setAttributeNS(null,"width",r),t.setAttributeNS(null,"height",s)},setPropertyPrim:function(t,e,i){"stroked"!==e&&t.setAttributeNS(null,e,i)},show:function(t){var e;t&&t.rendNode&&(e=t.rendNode,e.setAttributeNS(null,"display","inline"),e.style.visibility="inherit")},hide:function(t){var e;t&&t.rendNode&&(e=t.rendNode,e.setAttributeNS(null,"display","none"),e.style.visibility="hidden")},setBuffering:function(t,e){t.rendNode.setAttribute("buffered-rendering",e)},setDashStyle:function(t){var e=t.visProp.dash,i=t.rendNode;t.visProp.dash>0?i.setAttributeNS(null,"stroke-dasharray",this.dashArray[e-1]):i.hasAttributeNS(null,"stroke-dasharray")&&i.removeAttributeNS(null,"stroke-dasharray")},setGradient:function(t){var e,i,r,o,n,a,h,l,c,d=t.rendNode;i=s.evaluate(t.visProp.fillopacity),i=i>0?i:0,e=s.evaluate(t.visProp.fillcolor),"linear"===t.visProp.gradient?(r=this.createPrim("linearGradient",t.id+"_gradient"),a="0%",h="100%",l="0%",c="0%",r.setAttributeNS(null,"x1",a),r.setAttributeNS(null,"x2",h),r.setAttributeNS(null,"y1",l),r.setAttributeNS(null,"y2",c),o=this.createPrim("stop",t.id+"_gradient1"),o.setAttributeNS(null,"offset","0%"),o.setAttributeNS(null,"style","stop-color:"+e+";stop-opacity:"+i),n=this.createPrim("stop",t.id+"_gradient2"),n.setAttributeNS(null,"offset","100%"),n.setAttributeNS(null,"style","stop-color:"+t.visProp.gradientsecondcolor+";stop-opacity:"+t.visProp.gradientsecondopacity),r.appendChild(o),r.appendChild(n),this.defs.appendChild(r),d.setAttributeNS(null,"style","fill:url(#"+this.container.id+"_"+t.id+"_gradient)"),t.gradNode1=o,t.gradNode2=n):"radial"===t.visProp.gradient?(r=this.createPrim("radialGradient",t.id+"_gradient"),r.setAttributeNS(null,"cx","50%"),r.setAttributeNS(null,"cy","50%"),r.setAttributeNS(null,"r","50%"),r.setAttributeNS(null,"fx",100*t.visProp.gradientpositionx+"%"),r.setAttributeNS(null,"fy",100*t.visProp.gradientpositiony+"%"),o=this.createPrim("stop",t.id+"_gradient1"),o.setAttributeNS(null,"offset","0%"),o.setAttributeNS(null,"style","stop-color:"+t.visProp.gradientsecondcolor+";stop-opacity:"+t.visProp.gradientsecondopacity),n=this.createPrim("stop",t.id+"_gradient2"),n.setAttributeNS(null,"offset","100%"),n.setAttributeNS(null,"style","stop-color:"+e+";stop-opacity:"+i),r.appendChild(o),r.appendChild(n),this.defs.appendChild(r),d.setAttributeNS(null,"style","fill:url(#"+this.container.id+"_"+t.id+"_gradient)"),t.gradNode1=o,t.gradNode2=n):d.removeAttributeNS(null,"style")},updateGradient:function(t){var e,i,r=t.gradNode1,o=t.gradNode2;s.exists(r)&&s.exists(o)&&(i=s.evaluate(t.visProp.fillopacity),i=i>0?i:0,e=s.evaluate(t.visProp.fillcolor),"linear"===t.visProp.gradient?(r.setAttributeNS(null,"style","stop-color:"+e+";stop-opacity:"+i),o.setAttributeNS(null,"style","stop-color:"+t.visProp.gradientsecondcolor+";stop-opacity:"+t.visProp.gradientsecondopacity)):"radial"===t.visProp.gradient&&(r.setAttributeNS(null,"style","stop-color:"+t.visProp.gradientsecondcolor+";stop-opacity:"+t.visProp.gradientsecondopacity),o.setAttributeNS(null,"style","stop-color:"+e+";stop-opacity:"+i)))},setObjectFillColor:function(e,i,r,o){var a,h,l,c,d=s.evaluate(i),u=s.evaluate(r);u=u>0?u:0,(e.visPropOld.fillcolor!==d||e.visPropOld.fillopacity!==u)&&(s.exists(d)&&d!==!1&&(9!==d.length?(h=d,c=u):(l=n.rgba2rgbo(d),h=l[0],c=u*l[1]),a=void 0===o?e.rendNode:o,"none"!==h?a.setAttributeNS(null,"fill",h):c=0,e.type===t.OBJECT_TYPE_IMAGE?a.setAttributeNS(null,"opacity",c):a.setAttributeNS(null,"fill-opacity",c),s.exists(e.visProp.gradient)&&this.updateGradient(e)),e.visPropOld.fillcolor=d,e.visPropOld.fillopacity=u)},setObjectStrokeColor:function(t,e,i){var o,a,h,l,c=s.evaluate(e),d=s.evaluate(i);d=d>0?d:0,(t.visPropOld.strokecolor!==c||t.visPropOld.strokeopacity!==d)&&(s.exists(c)&&c!==!1&&(9!==c.length?(o=c,h=d):(a=n.rgba2rgbo(c),o=a[0],h=d*a[1]),l=t.rendNode,t.elementClass===r.OBJECT_CLASS_TEXT?"html"===t.visProp.display?(l.style.color=o,l.style.opacity=h):(l.setAttributeNS(null,"style","fill:"+o),l.setAttributeNS(null,"style","fill-opacity:"+h)):(l.setAttributeNS(null,"stroke",o),l.setAttributeNS(null,"stroke-opacity",h)),t.type===r.OBJECT_TYPE_ARROW?this._setArrowAtts(t.rendNodeTriangle,o,h,t.visProp.strokewidth,t.rendNode):(t.elementClass===r.OBJECT_CLASS_CURVE||t.elementClass===r.OBJECT_CLASS_LINE)&&(t.visProp.firstarrow&&this._setArrowAtts(t.rendNodeTriangleStart,o,h,t.visProp.strokewidth,t.rendNode),t.visProp.lastarrow&&this._setArrowAtts(t.rendNodeTriangleEnd,o,h,t.visProp.strokewidth,t.rendNode))),t.visPropOld.strokecolor=c,t.visPropOld.strokeopacity=d)},setObjectStrokeWidth:function(t,e){var i,o=s.evaluate(e);isNaN(o)||t.visPropOld.strokewidth===o||(i=t.rendNode,this.setPropertyPrim(i,"stroked","true"),s.exists(o)&&(this.setPropertyPrim(i,"stroke-width",o+"px"),t.type===r.OBJECT_TYPE_ARROW?this._setArrowAtts(t.rendNodeTriangle,t.visProp.strokecolor,t.visProp.strokeopacity,o,t.rendNode):(t.elementClass===r.OBJECT_CLASS_CURVE||t.elementClass===r.OBJECT_CLASS_LINE)&&(t.visProp.firstarrow&&this._setArrowAtts(t.rendNodeTriangleStart,t.visProp.strokecolor,t.visProp.strokeopacity,o,t.rendNode),t.visProp.lastarrow&&this._setArrowAtts(t.rendNodeTriangleEnd,t.visProp.strokecolor,t.visProp.strokeopacity,o,t.rendNode))),t.visPropOld.strokewidth=o)},setShadow:function(t){t.visPropOld.shadow!==t.visProp.shadow&&(s.exists(t.rendNode)&&(t.visProp.shadow?t.rendNode.setAttributeNS(null,"filter","url(#"+this.container.id+"_f1)"):t.rendNode.removeAttributeNS(null,"filter")),t.visPropOld.shadow=t.visProp.shadow)},suspendRedraw:function(){},unsuspendRedraw:function(){},resize:function(t,e){this.svgRoot.style.width=parseFloat(t)+"px",this.svgRoot.style.height=parseFloat(e)+"px",this.svgRoot.setAttribute("width",parseFloat(t)),this.svgRoot.setAttribute("height",parseFloat(e))},createTouchpoints:function(t){var e,i,r,s;for(this.touchpoints=[],e=0;t>e;e++)i="touchpoint1_"+e,s=this.createPrim("path",i),this.appendChildPrim(s,19),s.setAttributeNS(null,"d","M 0 0"),this.touchpoints.push(s),this.setPropertyPrim(s,"stroked","true"),this.setPropertyPrim(s,"stroke-width","1px"),s.setAttributeNS(null,"stroke","#000000"),s.setAttributeNS(null,"stroke-opacity",1),s.setAttributeNS(null,"display","none"),r="touchpoint2_"+e,s=this.createPrim("ellipse",r),this.appendChildPrim(s,19),this.updateEllipsePrim(s,0,0,0,0),this.touchpoints.push(s),this.setPropertyPrim(s,"stroked","true"),this.setPropertyPrim(s,"stroke-width","1px"),s.setAttributeNS(null,"stroke","#000000"),s.setAttributeNS(null,"stroke-opacity",1),s.setAttributeNS(null,"fill","#ffffff"),s.setAttributeNS(null,"fill-opacity",0),s.setAttributeNS(null,"display","none")},showTouchpoint:function(t){this.touchpoints&&t>=0&&2*t=0&&2*t=0&&2*t1&&(e=e.replace(/xmlns=\"http:\/\/www.w3.org\/2000\/svg\"/,"")),r=document.getElementById(t),s=r.getContext("2d"),i=new Image,i.onload=function(){setTimeout(function(){r.width=r.width,s.drawImage(i,0,0)},200)},i.src="data:image/svg+xml;base64,"+n(unescape(encodeURIComponent(e))),this}}),t.SVGRenderer}),define("renderer/vml",["jxg","renderer/abstract","base/constants","utils/type","utils/color","math/math","math/numerics"],function(t,e,i,r,s,o,n){"use strict";return t.VMLRenderer=function(e){this.type="vml",this.container=e,this.container.style.overflow="hidden",""===this.container.style.position&&(this.container.style.position="relative"),this.container.onselectstart=function(){return!1},this.resolution=10,r.exists(t.vmlStylesheet)||(e.ownerDocument.namespaces.add("jxgvml","urn:schemas-microsoft-com:vml"),t.vmlStylesheet=this.container.ownerDocument.createStyleSheet(),t.vmlStylesheet.addRule(".jxgvml","behavior:url(#default#VML)"));try{e.ownerDocument.namespaces.jxgvml||e.ownerDocument.namespaces.add("jxgvml","urn:schemas-microsoft-com:vml"),this.createNode=function(t){return e.ownerDocument.createElement("')}}catch(i){this.createNode=function(t){return e.ownerDocument.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="jxgvml">')}}this.dashArray=["Solid","1 1","ShortDash","Dash","LongDash","ShortDashDot","LongDashDot"]},t.VMLRenderer.prototype=new e,t.extend(t.VMLRenderer.prototype,{_setAttr:function(e,i,r,s){try{8===this.container.ownerDocument.documentMode?e[i]=r:e.setAttribute(i,r,s)}catch(o){t.debug("_setAttr: "+i+" "+r+"
\n")}},updateTicks:function(t){var e,i,s,o,n,a=this.resolution,h=[];for(i=t.ticks.length,e=0;i>e;e++)s=t.ticks[e],o=s[0],n=s[1],r.isNumber(o[0])&&r.isNumber(o[1])&&h.push(" m "+Math.round(a*o[0])+", "+Math.round(a*n[0])+" l "+Math.round(a*o[1])+", "+Math.round(a*n[1])+" ");r.exists(t.rendNode)||(t.rendNode=this.createPrim("path",t.id),this.appendChildPrim(t.rendNode,t.visProp.layer)),this._setAttr(t.rendNode,"stroked","true"),this._setAttr(t.rendNode,"strokecolor",t.visProp.strokecolor,1),this._setAttr(t.rendNode,"strokeweight",t.visProp.strokewidth),this._setAttr(t.rendNodeStroke,"opacity",100*t.visProp.strokeopacity+"%"),this.updatePathPrim(t.rendNode,h,t.board)},displayCopyright:function(t,e){var i,r;i=this.createNode("textbox"),i.style.position="absolute",this._setAttr(i,"id",this.container.id+"_licenseText"),i.style.left=20,i.style.top=2,i.style.fontSize=e,i.style.color="#356AA0",i.style.fontFamily="Arial,Helvetica,sans-serif",this._setAttr(i,"opacity","30%"),i.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11='1.0', sizingMethod='auto expand', enabled = false) progid:DXImageTransform.Microsoft.Alpha(opacity = 30, enabled = true)",r=this.container.ownerDocument.createTextNode(t),i.appendChild(r),this.appendChildPrim(i,0)},drawInternalText:function(t){var e;return e=this.createNode("textbox"),e.style.position="absolute",t.rendNodeText=this.container.ownerDocument.createTextNode(""),e.appendChild(t.rendNodeText),this.appendChildPrim(e,9),e.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11='1.0', sizingMethod='auto expand', enabled = false) progid:DXImageTransform.Microsoft.Alpha(opacity = 100, enabled = false)",e},updateInternalText:function(t){var e,i,r,s,n,a,h=t.plaintext,l=this.joinTransforms(t,t.transformations),c=[0,0],d=t.rendNode,u=[];if(!isNaN(t.coords.scrCoords[1]+t.coords.scrCoords[2])){for("right"===t.visProp.anchorx?c[0]=1:"middle"===t.visProp.anchorx&&(c[0]=.5),
"bottom"===t.visProp.anchory?c[1]=1:"middle"===t.visProp.anchory&&(c[1]=.5),u[0]=o.matVecMult(l,[1,t.coords.scrCoords[1]-c[0]*t.size[0],t.coords.scrCoords[2]+(1-c[1])*t.size[1]+this.vOffsetText]),u[0][1]/=u[0][0],u[0][2]/=u[0][0],u[1]=o.matVecMult(l,[1,t.coords.scrCoords[1]+(1-c[0])*t.size[0],t.coords.scrCoords[2]+(1-c[1])*t.size[1]+this.vOffsetText]),u[1][1]/=u[1][0],u[1][2]/=u[1][0],u[2]=o.matVecMult(l,[1,t.coords.scrCoords[1]+(1-c[0])*t.size[0],t.coords.scrCoords[2]-c[1]*t.size[1]+this.vOffsetText]),u[2][1]/=u[2][0],u[2][2]/=u[2][0],u[3]=o.matVecMult(l,[1,t.coords.scrCoords[1]-c[0]*t.size[0],t.coords.scrCoords[2]-c[1]*t.size[1]+this.vOffsetText]),u[3][1]/=u[3][0],u[3][2]/=u[3][0],i=u[0][1],s=u[0][1],r=u[0][2],n=u[0][2],a=1;4>a;a++)i=Math.max(i,u[a][1]),s=Math.min(s,u[a][1]),r=Math.max(r,u[a][2]),n=Math.min(n,u[a][2]);e=1===c[0]?Math.floor(t.board.canvasWidth-i):Math.floor(s),t.visPropOld.left!==t.visProp.anchorx+e&&(1===c[0]?(t.rendNode.style.right=e+"px",t.rendNode.style.left="auto"):(t.rendNode.style.left=e+"px",t.rendNode.style.right="auto"),t.visPropOld.left=t.visProp.anchorx+e),e=1===c[1]?Math.floor(t.board.canvasHeight-r):Math.floor(n),t.visPropOld.top!==t.visProp.anchory+e&&(1===c[1]?(t.rendNode.style.bottom=e+"px",t.rendNode.style.top="auto"):(t.rendNode.style.top=e+"px",t.rendNode.style.bottom="auto"),t.visPropOld.top=t.visProp.anchory+e)}t.htmlStr!==h&&(t.rendNodeText.data=h,t.htmlStr=h),d.filters.item(0).M11=l[1][1],d.filters.item(0).M12=l[1][2],d.filters.item(0).M21=l[2][1],d.filters.item(0).M22=l[2][2],d.filters.item(0).enabled=!0},drawImage:function(t){var e;e=this.container.ownerDocument.createElement("img"),e.style.position="absolute",this._setAttr(e,"id",this.container.id+"_"+t.id),this.container.appendChild(e),this.appendChildPrim(e,t.visProp.layer),e.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11='1.0', sizingMethod='auto expand') progid:DXImageTransform.Microsoft.Alpha(opacity = 100, enabled = false)",t.rendNode=e,this.updateImage(t)},transformImage:function(t,e){var i,r,s,n,a,h,l=t.rendNode,c=[],d=e.length;if(d>0){for(i=this.joinTransforms(t,e),c[0]=o.matVecMult(i,t.coords.scrCoords),c[0][1]/=c[0][0],c[0][2]/=c[0][0],c[1]=o.matVecMult(i,[1,t.coords.scrCoords[1]+t.size[0],t.coords.scrCoords[2]]),c[1][1]/=c[1][0],c[1][2]/=c[1][0],c[2]=o.matVecMult(i,[1,t.coords.scrCoords[1]+t.size[0],t.coords.scrCoords[2]-t.size[1]]),c[2][1]/=c[2][0],c[2][2]/=c[2][0],c[3]=o.matVecMult(i,[1,t.coords.scrCoords[1],t.coords.scrCoords[2]-t.size[1]]),c[3][1]/=c[3][0],c[3][2]/=c[3][0],r=c[0][1],n=c[0][1],s=c[0][2],a=c[0][2],h=1;4>h;h++)r=Math.max(r,c[h][1]),n=Math.min(n,c[h][1]),s=Math.max(s,c[h][2]),a=Math.min(a,c[h][2]);l.style.left=Math.floor(n)+"px",l.style.top=Math.floor(a)+"px",l.filters.item(0).M11=i[1][1],l.filters.item(0).M12=i[1][2],l.filters.item(0).M21=i[2][1],l.filters.item(0).M22=i[2][2],l.filters.item(0).enabled=!0}},updateImageURL:function(t){var e=r.evaluate(t.url);this._setAttr(t.rendNode,"src",e)},appendChildPrim:function(t,e){return r.exists(e)||(e=0),t.style.zIndex=e,this.container.appendChild(t),t},appendNodesToElement:function(t,e){("shape"===e||"path"===e||"polygon"===e)&&(t.rendNodePath=this.getElementById(t.id+"_path")),t.rendNodeFill=this.getElementById(t.id+"_fill"),t.rendNodeStroke=this.getElementById(t.id+"_stroke"),t.rendNodeShadow=this.getElementById(t.id+"_shadow"),t.rendNode=this.getElementById(t.id)},createPrim:function(t,e){var i,r,s=this.createNode("fill"),o=this.createNode("stroke"),n=this.createNode("shadow");return this._setAttr(s,"id",this.container.id+"_"+e+"_fill"),this._setAttr(o,"id",this.container.id+"_"+e+"_stroke"),this._setAttr(n,"id",this.container.id+"_"+e+"_shadow"),"circle"===t||"ellipse"===t?(i=this.createNode("oval"),i.appendChild(s),i.appendChild(o),i.appendChild(n)):"polygon"===t||"path"===t||"shape"===t||"line"===t?(i=this.createNode("shape"),i.appendChild(s),i.appendChild(o),i.appendChild(n),r=this.createNode("path"),this._setAttr(r,"id",this.container.id+"_"+e+"_path"),i.appendChild(r)):(i=this.createNode(t),i.appendChild(s),i.appendChild(o),i.appendChild(n)),i.style.position="absolute",i.style.left="0px",i.style.top="0px",this._setAttr(i,"id",this.container.id+"_"+e),i},remove:function(t){r.exists(t)&&t.removeNode(!0)},makeArrows:function(t){var e;(t.visPropOld.firstarrow!==t.visProp.firstarrow||t.visPropOld.lastarrow!==t.visProp.lastarrow)&&(t.visProp.firstarrow?(e=t.rendNodeStroke,this._setAttr(e,"startarrow","block"),this._setAttr(e,"startarrowlength","long")):(e=t.rendNodeStroke,r.exists(e)&&this._setAttr(e,"startarrow","none")),t.visProp.lastarrow?(e=t.rendNodeStroke,this._setAttr(e,"id",this.container.id+"_"+t.id+"stroke"),this._setAttr(e,"endarrow","block"),this._setAttr(e,"endarrowlength","long")):(e=t.rendNodeStroke,r.exists(e)&&this._setAttr(e,"endarrow","none")),t.visPropOld.firstarrow=t.visProp.firstarrow,t.visPropOld.lastarrow=t.visProp.lastarrow)},updateEllipsePrim:function(t,e,i,r,s){t.style.left=Math.floor(e-r)+"px",t.style.top=Math.floor(i-s)+"px",t.style.width=Math.floor(2*Math.abs(r))+"px",t.style.height=Math.floor(2*Math.abs(s))+"px"},updateLinePrim:function(t,e,i,r,s,o){var n,a=this.resolution;isNaN(e+i+r+s)||(n=["m ",Math.floor(a*e),", ",Math.floor(a*i)," l ",Math.floor(a*r),", ",Math.floor(a*s)],this.updatePathPrim(t,n,o))},updatePathPrim:function(t,e,i){var r=i.canvasWidth,s=i.canvasHeight;e.length<=0&&(e=["m 0,0"]),t.style.width=r,t.style.height=s,this._setAttr(t,"coordsize",[Math.floor(this.resolution*r),Math.floor(this.resolution*s)].join(",")),this._setAttr(t,"path",e.join(""))},updatePathStringPoint:function(t,e,i){var r=[],s=Math.round,o=t.coords.scrCoords,n=e*Math.sqrt(3)*.5,a=.5*e,h=this.resolution;return"x"===i?r.push([" m ",s(h*(o[1]-e)),", ",s(h*(o[2]-e))," l ",s(h*(o[1]+e)),", ",s(h*(o[2]+e))," m ",s(h*(o[1]+e)),", ",s(h*(o[2]-e))," l ",s(h*(o[1]-e)),", ",s(h*(o[2]+e))].join("")):"+"===i?r.push([" m ",s(h*(o[1]-e)),", ",s(h*o[2])," l ",s(h*(o[1]+e)),", ",s(h*o[2])," m ",s(h*o[1]),", ",s(h*(o[2]-e))," l ",s(h*o[1]),", ",s(h*(o[2]+e))].join("")):"<>"===i?r.push([" m ",s(h*(o[1]-e)),", ",s(h*o[2])," l ",s(h*o[1]),", ",s(h*(o[2]+e))," l ",s(h*(o[1]+e)),", ",s(h*o[2])," l ",s(h*o[1]),", ",s(h*(o[2]-e))," x e "].join("")):"^"===i?r.push([" m ",s(h*o[1]),", ",s(h*(o[2]-e))," l ",s(h*(o[1]-n)),", ",s(h*(o[2]+a))," l ",s(h*(o[1]+n)),", ",s(h*(o[2]+a))," x e "].join("")):"v"===i?r.push([" m ",s(h*o[1]),", ",s(h*(o[2]+e))," l ",s(h*(o[1]-n)),", ",s(h*(o[2]-a))," l ",s(h*(o[1]+n)),", ",s(h*(o[2]-a))," x e "].join("")):">"===i?r.push([" m ",s(h*(o[1]+e)),", ",s(h*o[2])," l ",s(h*(o[1]-a)),", ",s(h*(o[2]-n))," l ",s(h*(o[1]-a)),", ",s(h*(o[2]+n))," l ",s(h*(o[1]+e)),", ",s(h*o[2])].join("")):"<"===i&&r.push([" m ",s(h*(o[1]-e)),", ",s(h*o[2])," l ",s(h*(o[1]+a)),", ",s(h*(o[2]-n))," l ",s(h*(o[1]+a)),", ",s(h*(o[2]+n))," x e "].join("")),r},updatePathStringPrim:function(t){var e,i,r=[],s=this.resolution,o=Math.round,n=" m ",a=" l ",h=" c ",l=n,c=Math.min(t.numberPoints,8192);if(t.numberPoints<=0)return"";if(c=Math.min(c,t.points.length),1===t.bezierDegree)for(e=0;c>e;e++)i=t.points[e].scrCoords,isNaN(i[1])||isNaN(i[2])?l=n:(i[1]>2e4?i[1]=2e4:i[1]<-2e4&&(i[1]=-2e4),i[2]>2e4?i[2]=2e4:i[2]<-2e4&&(i[2]=-2e4),r.push([l,o(s*i[1]),", ",o(s*i[2])].join("")),l=a);else if(3===t.bezierDegree)for(e=0;c>e;)i=t.points[e].scrCoords,isNaN(i[1])||isNaN(i[2])?l=n:(r.push([l,o(s*i[1]),", ",o(s*i[2])].join("")),l===h&&(e+=1,i=t.points[e].scrCoords,r.push([" ",o(s*i[1]),", ",o(s*i[2])].join("")),e+=1,i=t.points[e].scrCoords,r.push([" ",o(s*i[1]),", ",o(s*i[2])].join(""))),l=h),e+=1;return r.push(" e"),r},updatePathStringBezierPrim:function(t){var e,i,r,s,o,a,h=[],l=t.visProp.strokewidth,c=this.resolution,d=Math.round,u=" m ",p=" c ",f=u,m="plot"!==t.visProp.curvetype,g=Math.min(t.numberPoints,8192);if(t.numberPoints<=0)return"";for(m&&t.board.options.curve.RDPsmoothing&&(t.points=n.RamerDouglasPeucker(t.points,1)),g=Math.min(g,t.points.length),i=1;3>i;i++)for(f=u,e=0;g>e;e++)s=t.points[e].scrCoords,isNaN(s[1])||isNaN(s[2])?f=u:(s[1]>2e4?s[1]=2e4:s[1]<-2e4&&(s[1]=-2e4),s[2]>2e4?s[2]=2e4:s[2]<-2e4&&(s[2]=-2e4),f===u?h.push([f,d(c*s[1])," ",d(c*s[2])].join("")):(r=2*i,h.push([f,d(c*(o+.333*(s[1]-o)+l*(r*Math.random()-i)))," ",d(c*(a+.333*(s[2]-a)+l*(r*Math.random()-i)))," ",d(c*(o+.666*(s[1]-o)+l*(r*Math.random()-i)))," ",d(c*(a+.666*(s[2]-a)+l*(r*Math.random()-i)))," ",d(c*s[1])," ",d(c*s[2])].join(""))),f=p,o=s[1],a=s[2]);return h.push(" e"),h},updatePolygonPrim:function(t,e){var i,r,s=e.vertices.length,o=this.resolution,n=[];if(this._setAttr(t,"stroked","false"),r=e.vertices[0].coords.scrCoords,!isNaN(r[1]+r[2])){for(n.push(["m ",Math.floor(o*r[1]),",",Math.floor(o*r[2])," l "].join("")),i=1;s-1>i;i++){if(!e.vertices[i].isReal)return void this.updatePathPrim(t,"",e.board);if(r=e.vertices[i].coords.scrCoords,isNaN(r[1]+r[2]))return;n.push(Math.floor(o*r[1])+","+Math.floor(o*r[2])),s-2>i&&n.push(", ")}n.push(" x e"),this.updatePathPrim(t,n,e.board)}},updateRectPrim:function(t,e,i,r,s){t.style.left=Math.floor(e)+"px",t.style.top=Math.floor(i)+"px",r>=0&&(t.style.width=r+"px"),s>=0&&(t.style.height=s+"px")},setPropertyPrim:function(t,e,i){var s,o="";switch(e){case"stroke":o="strokecolor";break;case"stroke-width":o="strokeweight";break;case"stroke-dasharray":o="dashstyle"}""!==o&&(s=r.evaluate(i),this._setAttr(t,o,s))},show:function(t){t&&t.rendNode&&(t.rendNode.style.visibility="inherit")},hide:function(t){t&&t.rendNode&&(t.rendNode.style.visibility="hidden")},setDashStyle:function(t,e){var i;e.dash>=0&&(i=t.rendNodeStroke,this._setAttr(i,"dashstyle",this.dashArray[e.dash]))},setGradient:function(t){var e=t.rendNodeFill;"linear"===t.visProp.gradient?(this._setAttr(e,"type","gradient"),this._setAttr(e,"color2",t.visProp.gradientsecondcolor),this._setAttr(e,"opacity2",t.visProp.gradientsecondopacity),this._setAttr(e,"angle",t.visProp.gradientangle)):"radial"===t.visProp.gradient?(this._setAttr(e,"type","gradientradial"),this._setAttr(e,"color2",t.visProp.gradientsecondcolor),this._setAttr(e,"opacity2",t.visProp.gradientsecondopacity),this._setAttr(e,"focusposition",100*t.visProp.gradientpositionx+"%,"+100*t.visProp.gradientpositiony+"%"),this._setAttr(e,"focussize","0,0")):this._setAttr(e,"type","solid")},setObjectFillColor:function(t,e,o){var n,a,h,l=r.evaluate(e),c=r.evaluate(o),d=t.rendNode;c=c>0?c:0,(t.visPropOld.fillcolor!==l||t.visPropOld.fillopacity!==c)&&(r.exists(l)&&l!==!1&&(9!==l.length?(n=l,h=c):(a=s.rgba2rgbo(l),n=a[0],h=c*a[1]),"none"===n||n===!1?this._setAttr(t.rendNode,"filled","false"):(this._setAttr(t.rendNode,"filled","true"),this._setAttr(t.rendNode,"fillcolor",n),r.exists(h)&&t.rendNodeFill&&this._setAttr(t.rendNodeFill,"opacity",100*h+"%")),t.type===i.OBJECT_TYPE_IMAGE&&d.filters.length>1&&(d.filters.item(1).opacity=Math.round(100*h),d.filters.item(1).enabled=!0)),t.visPropOld.fillcolor=l,t.visPropOld.fillopacity=c)},setObjectStrokeColor:function(t,e,s){var o,n,a,h,l=r.evaluate(e),c=r.evaluate(s),d=t.rendNode;c=c>0?c:0,(t.visPropOld.strokecolor!==l||t.visPropOld.strokeopacity!==c)&&(r.exists(l)&&l!==!1&&(9!==l.length?(o=l,a=c):(n=e.rgba2rgbo(l),o=n[0],a=c*n[1]),t.elementClass===i.OBJECT_CLASS_TEXT?(d.filters.length>1&&(d.filters.item(1).opacity=Math.round(100*a),d.filters.item(1).enabled=!0),d.style.color=o):(o!==!1&&(this._setAttr(d,"stroked","true"),this._setAttr(d,"strokecolor",o)),h=t.rendNodeStroke,r.exists(a)&&t.type!==i.OBJECT_TYPE_IMAGE&&this._setAttr(h,"opacity",100*a+"%"))),t.visPropOld.strokecolor=l,t.visPropOld.strokeopacity=c)},setObjectStrokeWidth:function(t,e){var i,s=r.evaluate(e);isNaN(s)||t.visPropOld.strokewidth===s||(i=t.rendNode,this.setPropertyPrim(i,"stroked","true"),r.exists(s)&&(this.setPropertyPrim(i,"stroke-width",s),0===s&&r.exists(t.rendNodeStroke)&&this._setAttr(i,"stroked","false")),t.visPropOld.strokewidth=s)},setShadow:function(t){var e=t.rendNodeShadow;e&&t.visPropOld.shadow!==t.visProp.shadow&&(t.visProp.shadow?(this._setAttr(e,"On","True"),this._setAttr(e,"Offset","3pt,3pt"),this._setAttr(e,"Opacity","60%"),this._setAttr(e,"Color","#aaaaaa")):this._setAttr(e,"On","False"),t.visPropOld.shadow=t.visProp.shadow)},suspendRedraw:function(){this.container.style.display="none"},unsuspendRedraw:function(){this.container.style.display=""}}),t.VMLRenderer}),define("renderer/canvas",["jxg","renderer/abstract","base/constants","utils/env","utils/type","utils/uuid","utils/color","base/coords","math/math","math/geometry","math/numerics"],function(t,e,i,r,s,o,n,a,h,l,c){"use strict";return t.CanvasRenderer=function(t,e){this.type="canvas",this.canvasRoot=null,this.suspendHandle=null,this.canvasId=o.genUUID(),this.canvasNamespace=null,r.isBrowser?(this.container=t,this.container.style.MozUserSelect="none",this.container.style.overflow="hidden",""===this.container.style.position&&(this.container.style.position="relative"),this.container.innerHTML=['