/*
 * Isomorphic SmartClient
 * Version v8.3_2012-11-20 (2012-11-20)
 * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
 * "SmartClient" is a trademark of Isomorphic Software, Inc.
 *
 * licensing@smartclient.com
 *
 * http://smartclient.com/license
 */
if(window.isc&&window.isc.module_Core&&!window.isc.module_Drawing){isc.module_Drawing=1;isc._moduleStart=isc._Drawing_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log&&isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={message:'Drawing load/parse time: '+(isc._moduleStart-isc._moduleEnd)+'ms',category:'loadTime'};if(isc.Log&&isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime');else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTM;else isc._preLog=[isc._pTM]}isc.definingFramework=true;if(window.isc&&isc.version!="v8.3_2012-11-20/LGPL Development Only"){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'v8.3_2012-11-20/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser."+(isc.Browser.isSGWT?" SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile.":""))}
isc.Browser.hasCANVAS=isc.Browser.geckoVersion>=20051107||isc.Browser.safariVersion>=181||((isc.Browser.isIE&&isc.Browser.version>=9)&&(typeof(document.createElement('canvas').getContext)==='function'));isc.Browser.hasSVG=isc.Browser.geckoVersion>=20051107;isc.Browser.hasVML=isc.Browser.isIE&&isc.Browser.version>=5;isc.Browser.defaultDrawingType=isc.Browser.hasCANVAS?"bitmap":isc.Browser.hasVML?"vml":"none";isc.$100f="http://www.w3.org/1999/xlink";isc.$100g="http://www.w3.org/2000/svg";isc.defineClass("SVGStringConversionContext").addClassProperties({$99a:"xlink"});isc.A=isc.SVGStringConversionContext.getPrototype();isc.A.$99b=1;isc.A.printForExport=true;isc.A.xlinkPrefix=isc.SVGStringConversionContext.$99a;isc.A=isc.SVGStringConversionContext.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_SVGStringConversionContext_init(){this.Super("init",arguments);this.svgDefStrings={}},isc.A.getNextSvgDefNumber=function isc_SVGStringConversionContext_getNextSvgDefNumber(){return this.$99b++});isc.B._maxIndex=isc.C+2;isc.defineClass("DrawPane","Canvas");isc.A=isc.DrawPane.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.drawingType=isc.Browser.defaultDrawingType;isc.A.canDrag=false;isc.A.dragAppearance="none";isc.A.cursor="all-scroll";isc.A.isMouseTransparent=true;isc.A.rotation=0;isc.A.zoomLevel=1;isc.A.translate=null;isc.B.push(isc.A.supportsFractionalCoordinates=function isc_DrawPane_supportsFractionalCoordinates(){var _1=this.drawingType;if(_1=="bitmap")return true;if(_1=="vml")return true;return false},isc.A.createQuadTree=function isc_DrawPane_createQuadTree(){this.quadTree=isc.QuadTree.create({depth:0,maxDepth:50,maxChildren:1});this.quadTree.bounds={x:0,y:0,width:this.getInnerContentWidth(),height:this.getInnerContentHeight()};this.quadTree.root=isc.QuadTreeNode.create({depth:0,maxDepth:8,maxChildren:4});this.quadTree.root.bounds=this.quadTree.bounds},isc.A.updateQuadTree=function isc_DrawPane_updateQuadTree(_1){this.quadTree.update(_1.item)},isc.A.initWidget=function isc_DrawPane_initWidget(){this.gradients={};if(this.drawingType=="svg")this.$l=false;this.drawItems=this.drawItems||[];this.canvasItems=this.canvasItems||[];this.createQuadTree();for(var i=0;i<this.drawItems.length;i++){this.addDrawItem(this.drawItems[i])}
for(var i=0;i<this.canvasItems.length;i++){this.addCanvasItem(this.canvasItems[i])}
this.redrawOnResize=(this.drawingType=="bitmap");this.$43z=this.getInnerContentWidth();this.$430=this.getInnerContentHeight();this.$431=0;this.$432=0;this.$433=this.$43z;this.$434=this.$430;if(isc.Browser.isIE&&this.drawingType=="vml"){document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!document.namespaces.rvml&&document.namespaces.add("rvml","urn:schemas-microsoft-com:vml");this.startTagVML=function(_2){return'<rvml:'+_2+' class="rvml" '};this.endTagVML=function(_2){return'</rvml:'+_2+'>'}}catch(e){this.startTagVML=function(_2){return'<'+_2+' xmlns="urn:schemas-microsoft.com:vml" class="rvml" '};this.endTagVML=function(_2){return'</rvml:'+_2+'>'}}}},isc.A.normalize=function isc_DrawPane_normalize(_1,_2,_3){if(this.zoomLevel!=1||this.rotation!=0){var _4=this.zoomLevel,_5=this.rotation;if(_3){_4=1/_4;_5=-_5}
var _5=-_5*Math.PI/180.0;var _6=_1-this.width/2;var _7=_2-this.height/2;var _8=_6*Math.cos(_5)-_7*Math.sin(_5);var _9=_6*Math.sin(_5)+_7*Math.cos(_5);_8/=_4;_9/=_4;_8+=this.width/2;_9+=this.height/2;return{x:_8,y:_9}}
return{x:_1,y:_2}},isc.A.getDrawItem=function isc_DrawPane_getDrawItem(_1,_2){_1-=this.getPageLeft();_2-=this.getPageTop();var _3=this.normalize(_1,_2);_1=_3.x;_2=_3.y;var _4=this.quadTree.retrieve({x:_1,y:_2});var _5=_4?_4.length:0;if(_5){for(var i=0;i<_5;++i){var _7=_4[i].item||_4[i];var _8=false;if(!_7.shape.hidden){var _9=_7.shape.checkPointInPath;if(_9){_8=_7.shape.isPointInPath(_1,_2)}else{_8=_7.shape.isInBounds(_1,_2)}}
if(_8){return _7.shape}}}
return this},isc.A.getEventTarget=function isc_DrawPane_getEventTarget(_1){switch(_1.eventType){case'mouseUp':case'mouseDown':case'mouseMove':case'mouseOut':case'mouseOver':case'click':case'contextMenu':return this.getDrawItem(_1.x,_1.y);default:return this}
return this},isc.A.prepareForDragging=function isc_DrawPane_prepareForDragging(){if(!isc.EH.dragTarget&&this.canDrag){var _1=this.getDrawItem(isc.EH.lastEvent.x,isc.EH.lastEvent.y);if(_1&&_1.canDrag){isc.EH.dragTarget=_1;isc.EH.dragOperation="drag";return true}}
return this.Super("prepareForDragging",arguments)},isc.A.clear=function isc_DrawPane_clear(){this.Super("clear",arguments);if(this.drawItems!=null){this.drawItems.setProperty("$if",false)}
if(this.drawingType=="bitmap"){this.$437=null}},isc.A.drawBounds=function isc_DrawPane_drawBounds(_1){isc.DrawRect.create({autoDraw:true,drawPane:this,left:Math.round(_1.bounds.x),top:Math.round(_1.bounds.y-_1.bounds.height),width:Math.round(_1.bounds.width),height:Math.round(_1.bounds.height)},{lineColor:"#FF0000",lineOpacity:0.1,lineWidth:1,linePattern:"solid"});if(_1.nodes&&_1.nodes.length){for(var i=0;i<_1.nodes.length;++i){this.drawBounds(_1.nodes[i])}}},isc.A.erase=function isc_DrawPane_erase(_1,_2){if(_2==undefined){_2=true;this.$992()}
if(_1){for(var i=0;i<this.drawItems.length;i++){this.drawItems[i].destroy(true,_2)}}else if(this.isDrawn()){for(var i=0;i<this.drawItems.length;i++){this.drawItems[i].erase(true,_2)}}
if(_2)this.$100h=this.gradients;this.gradients={};if(_2)this.$993=this.drawItems;this.drawItems=[];delete this.$63q;this.canvasItems=[];this.createQuadTree();if(this.drawingType=="bitmap")this.redrawBitmap()},isc.A.destroyItems=function isc_DrawPane_destroyItems(){this.erase(true)},isc.A.destroy=function isc_DrawPane_destroy(){this.Super("destroy",arguments);for(var i=0;i<this.drawItems.length;i++){this.drawItems[i].destroy()}},isc.A.addDrawItem=function isc_DrawPane_addDrawItem(_1,_2){if(_1.drawGroup!=null){_1.drawGroup.removeDrawItem(_1)}else if(_1.drawPane!=null){_1.drawPane.removeDrawItem(_1)}
_1.drawPane=this;if(_2==null)_2=true;if(!this.isDrawn()){if(!this.drawItems.contains(_1))this.drawItems.add(_1);this.shouldDeferDrawing(_1)}else if(_2&&!_1.$if){_1.draw()}},isc.A.removeDrawItem=function isc_DrawPane_removeDrawItem(_1){if(_1.drawPane!=this)return;if(_1.$if){_1.erase()}else{this.drawItems.remove(_1)}
_1.drawPane=null},isc.A.getInnerHTML=function isc_DrawPane_getInnerHTML(){var _1=this.drawingType;if(_1=="vml"){var _2=this.getInnerContentWidth();var _3=this.getInnerContentHeight();return this.startTagVML('GROUP')+" ID='"+this.getID()+"$435' STYLE='position:absolute;left:"+this.padding+"px;top:"+this.padding+"px;width:"+_2+"px; height:"+_3+"px;rotation:"+(this.rotation)+";' coordsize='"+_2+", "+_3+"' coordorig='0 0'>"+this.endTagVML('GROUP')}else if(_1=="bitmap"){return"<CANVAS ID='"+this.getID()+"$436' WIDTH='"+this.getWidth()+"' HEIGHT='"+this.getHeight()+"'></CANVAS>"}else if(_1=="svg"){this.$l=false;return"<IFRAME HEIGHT='100%' WIDTH='100%' SCROLLING='NO' FRAMEBORDER='0' SRC='"+isc.Page.getHelperDir()+"DrawPane.svg?isc_dp_id="+this.getID()+"'></IFRAME>"}else{this.logWarn("DrawPane getInnerHTML: '"+_1+"' is not a supported drawingType");return this.Super("getInnerHTML",arguments)}},isc.A.$104v=function isc_DrawPane__getMeasureCanvas(){return isc.DrawPane.$78l||(isc.DrawPane.$78l=isc.Canvas.create({top:-1000,overflow:"visible",autoDraw:true,height:1,width:1,markForRedraw:function(){}}))},isc.A.measureLabel=function isc_DrawPane_measureLabel(_1,_2){if(!_2)_2={};var _3=_2.fontFamily||isc.DrawLabel.getInstanceProperty("fontFamily"),_4=_2.fontWeight||isc.DrawLabel.getInstanceProperty("fontWeight"),_5=_2.fontSize||isc.DrawLabel.getInstanceProperty("fontSize"),_6=_2.fontStyle||isc.DrawLabel.getInstanceProperty("fontStyle");var _7=_5+":"+_4+":"+_6+":"+_3+":"+_1;var _8;if(_8=this.$100n){if(_8.hasOwnProperty(_7))return _8[_7]}else _8=this.$100n={};var _9=this.$104v();var _10="font-family:"+_3+";font-weight:"+_4+";font-size:"+_5+"px;font-style:"+_6+";white-space:nowrap";var _11="<span style='"+_10+"'>"+_1+"</span>";_9.setContents(_11);_9.redraw("label measurement: "+_1);var _12={width:_9.getVisibleWidth(),height:_9.getVisibleHeight()};return(_8[_7]=_12)},isc.A.getSvgString=function isc_DrawPane_getSvgString(_1){var _2=this.getWidth(),_3=this.getHeight(),_4,_5,_6=_2,_7=_3;var _8=this.getClipHandle();var _9=isc.Element.getBorderSizes(_8);if(this.rotation&&(_5=this.getCenter())&&_5.length==2){_4=((this.rotation%360)+360)%360;var _10=_4*Math.PI/180;var _11=Math.sqrt(_2*_2+_3*_3);var _12;if(0<=_4&&_4<90){_12=Math.atan(_3/_2);_6=_11*Math.cos(_10-_12);_7=_11*Math.sin(_10+_12)}else if(90<=_4&&_4<180){_12=Math.atan(_2/_3);_6=_11*Math.sin(_10-_12);_7=-_11*Math.cos(_10+_12)}else if(180<=_4&&_4<270){_12=Math.atan(_3/_2);_6=-_11*Math.cos(_10-_12);_7=-_11*Math.sin(_10+_12)}else if(270<=_4&&_4<360){_12=Math.atan(_2/_3);_6=-_11*Math.sin(_10-_12);_7=_11*Math.cos(_10+_12)}}
_1=_1||isc.SVGStringConversionContext.create();_1.xlinkPrefix=_1.xlinkPrefix||isc.SVGStringConversionContext.$99a;var _13=_6+_9.right+_9.left,_14=_7+_9.top+_9.bottom;var _15=(this.padding==undefined?0:parseFloat(this.padding));if(this.drawingType!="svg"){_13-=_15;_14-=_15}
var _16="<svg xmlns='"+isc.$100g+"' xmlns:"+_1.xlinkPrefix+"='"+isc.$100f+"' width='"+_13+"px' height='"+_14+"px' viewBox='0 0 "+_13+" "+_14+"' version='1.1'><metadata><!-- Generated by SmartClient "+isc.version+" --></metadata>";if(this.backgroundColor!=null){_16+="<rect x='0' y='0' width='"+_13+"' height='"+_14+"' stroke='none' fill='"+this.backgroundColor+"'/>"}
_16+="<g";if(_4){_16+=" transform='translate("+((_6-_2)/2+_15+_9.left)+" "+((_7-_3)/2+_15+_9.top)+") rotate("+_4+" "+_5[0]+" "+_5[1]+")'"}else{_16+=" transform='translate("+(_15+_9.left)+" "+(_15+_9.top)+")'"}
_16+="><svg width='"+_2+"' height='"+_3+"'>";if(this.drawItems&&this.drawItems.length){_16+="<g id='isc_svg_box";_16+="'>";for(var i=0;i<this.drawItems.length;++i){_16+=this.drawItems[i].getSvgString(_1)}
_16+="</g>";if(_1.svgDefStrings){_16+="<defs id='isc_svg_defs'>";for(var _18 in _1.svgDefStrings){if(_1.svgDefStrings.hasOwnProperty(_18))_16+=_1.svgDefStrings[_18]}
_16+="</defs>"}}
_16+="</svg></g>";var _19={Top:isc.Element.getComputedStyleAttribute(_8,"borderTopStyle"),Right:isc.Element.getComputedStyleAttribute(_8,"borderRightStyle"),Bottom:isc.Element.getComputedStyleAttribute(_8,"borderBottomStyle"),Left:isc.Element.getComputedStyleAttribute(_8,"borderLeftStyle")};var _20={Top:isc.Element.getComputedStyleAttribute(_8,"borderTopColor"),Right:isc.Element.getComputedStyleAttribute(_8,"borderRightColor"),Bottom:isc.Element.getComputedStyleAttribute(_8,"borderBottomColor"),Left:isc.Element.getComputedStyleAttribute(_8,"borderLeftColor")};var _21,_22,_23;if(_9.Top==_9.Right&&_9.Right==_9.Bottom&&_9.Bottom==_9.Left&&_19.Top==_19.Right&&_19.Right==_19.Bottom&&_19.Bottom==_19.Left&&_20.Top==_20.Right&&_20.Right==_20.Bottom&&_20.Bottom==_20.Left)
{if(_9.Top){_21=null;if(_19.Top=="solid")_21="";else if(_19.Top=="dashed")_21=" stroke-dasharray='5,5'";else if(_19.Top=="dotted")_21=" stroke-dasharray='1.5,2'";if(_21!=null&&_20.Top){_23=_22=_9.Top/2;_16+="<rect x='"+_22+"' y='"+_23+"' width='"+(_13-_9.Top)+"' height='"+(_14-_9.Top)+"' stroke='"+_20.Top+"' stroke-width='"+_9.Top+"px'"+_21+" fill='none'/>"}}}else{var _24=["Left","Bottom","Right","Top"],_25,_26,_27,x,y;for(var i=0;i<_24.length;++i){var _30=_24[i];_25=_9[_30];if(_25){_26=_19[_30];_21=null;if(_26=="solid")_21="";else if(_26=="dashed")_21=" stroke-dasharray='5,5'";else if(_26=="dotted")_21=" stroke-dasharray='1.5,2'";if(_21!=null){_27=_20[_30];if(_27){if(_30=="Left"){x=_25/2;_23=_25/2;_16+="<line x1='"+x+"' y1='"+_23+"' x2='"+x+"' y2='"+(_14-_23)}else if(_30=="Bottom"){_22=_25/2;y=_14-_25/2;_16+="<line x1='"+_22+"' y1='"+y+"' x2='"+(_13-_22)+"' y2='"+y}else if(_30=="Right"){x=_13-_25/2;_23=_25/2;_16+="<line x1='"+x+"' y1='"+_23+"' x2='"+x+"' y2='"+(_14-_23)}else{_22=_25/2;y=_25/2;_16+="<line x1='"+_22+"' y1='"+y+"' x2='"+(_13-_22)+"' y2='"+y}
_16+="' stroke='"+_27+"' stroke-width='"+_25+"px'"+_21+"/>"}}}}}
_16+="</svg>";return _16},isc.A.getPrintHTML=function isc_DrawPane_getPrintHTML(_1,_2){if(this.drawingType=="bitmap"){var _3=document.getElementById(this.getID()+"$436");return"<img src='"+_3.toDataURL()+"' width='"+this.getWidth()+"' height='"+this.getHeight()+"' />"}else if(this.drawingType=="vml"){if(_1&&_1.printForExport)return this.getSvgString();var _4=document.getElementById(this.getID()+"$435");return"<div style='position:relative;width:"+this.getInnerContentWidth()+";height:"+this.getInnerContentHeight()+";'>"+_4.parentElement.innerHTML+"</div>"}else if(this.drawingType=="svg"){return this.getSvgString()}else{return""}},isc.A.$99x=function isc_DrawPane__batchDraw(_1){if(_1==null)return;if(this.drawingType=="svg"){if(!this.$44m)return;if(!isc.isAn.Array(_1))_1=[_1];var _2=isc.SVGStringConversionContext.create({printForExport:false});var _3="",_4="";for(var i=0;i<_1.length;i++){var _6=_1[i];if(_6.$44z)_6.$44z.parentNode.removeChild(_6.$44z);var _7=_1[i].getSvgString(_2);if(_6.drawToBack)_3+=_7;else _4+=_7}
var _8="";for(var _9 in _2.svgDefStrings){if(_2.svgDefStrings.hasOwnProperty(_9)&&!this.$44m.getElementById(_9)){var _10=_2.svgDefStrings[_9];_8+=_10}}
var _11=this.$44m.getElementById("isc_svg_box");if(!isc.Browser.isWebKit){var _12=this.$44m.createRange();_12.setStart(this.$44o,0);this.$44o.appendChild(_12.createContextualFragment(_8));_12.setStart(_11,0);_11.insertBefore(_12.createContextualFragment(_3),_11.firstChild);_11.appendChild(_12.createContextualFragment(_4))}else{var _13=new DOMParser();var _14=_13.parseFromString("<svg xmlns='"+isc.$100g+"' xmlns:"+_2.xlinkPrefix+"='"+isc.$100f+"'><defs>"+_8+"</defs><g>"+_3+"</g><g>"+_4+"</g></svg>","image/svg+xml");var _15=_14.documentElement;var _16=this.$44m.importNode(_15.childNodes.item(1),true);var _17=this.$44m.importNode(_15.childNodes.item(2),true);var _18=this.$44m.importNode(_15.childNodes.item(0),true);_15=null;_14=null;var _19;while(_19=_18.firstChild){this.$44o.appendChild(_19)}
var _20=_11.firstChild;while(_19=_16.firstChild){_11.insertBefore(_19,_20)}
while(_19=_17.firstChild){_11.appendChild(_19)}}
for(var i=0;i<_1.length;i++){var _6=_1[i];_6.drawPane=this;_6.drawingSVG=true;_6.$44m=this.$44m;_6.$44y=_11;_6.$44z=this.$44m.getElementById("isc_DrawItem_"+_6.drawItemID);_6.$if=true;_6.$99y()}}else if(this.drawingType=="bitmap"){this.redrawBitmapNow()}else{for(var i=0;i<_1.length;i++){var _6=_1[i];_6.draw()}}},isc.A.isBatchDrawing=function isc_DrawPane_isBatchDrawing(){return this.$99w===true},isc.A.$994=function isc_DrawPane__isBatchDrawing(){return(this.$99w===true||this.$995()||this.$l===false)&&this.$99z!==true},isc.A.beginBatchDrawing=function isc_DrawPane_beginBatchDrawing(){this.$99w=true},isc.A.endBatchDrawing=function isc_DrawPane_endBatchDrawing(_1){if(!this.isBatchDrawing())this.logWarn("Not in batch drawing mode. Exiting.");this.$100i(_1)},isc.A.$100i=function isc_DrawPane__endBatchDrawing(_1){if(!this.$994())return;if(_1==true){this.refreshNow();this.$99w=false}else this.$992()},isc.A.refreshNow=function isc_DrawPane_refreshNow(){this.$99z=true;this.$99x(this.$63q);delete this.$63q;this.$99z=false},isc.A.drawChildren=function isc_DrawPane_drawChildren(){this.Super("drawChildren",arguments);if(this.drawingType!="svg"||!this.$994()){for(var i=0;i<this.drawItems.length;i++){var _2=this.drawItems[i];_2.draw()}}},isc.A.getBitmapContext=function isc_DrawPane_getBitmapContext(){if(this.$437)return this.$437;this.$438=isc.Element.get(this.getID()+"$436");if(!this.$438){this.logWarn("DrawPane failed to get CANVAS element handle");return}
this.$437=this.$438.getContext("2d");if(!this.$437){this.logWarn("DrawPane failed to get CANVAS 2d bitmap context");return}
return this.$437},isc.A.redraw=function isc_DrawPane_redraw(_1){if(this.drawingType=="bitmap"){this.Super("redraw",arguments);this.$437=null;if(!this.$995())this.redrawBitmapNow()}},isc.A.$995=function isc_DrawPane__isRedrawTEAScheduled(){return this.$996==true||(this.drawingType=="bitmap"&&this.$439)},isc.A.$992=function isc_DrawPane__maybeScheduleRedrawTEA(){if(!this.$995()){if(this.drawingType=="bitmap")this.redrawBitmap();else{var _1=this;isc.EH.$ms(function(){_1.$997()});this.$996=true;this.$998=false}}},isc.A.$997=function isc_DrawPane__redrawTEA(){if(this.$998!==false)return;this.$998=true;if(this.$993){for(var i=0;i<this.$993.length;++i){var _2=this.$993[i];if(_2.$999){_2.$999.parentNode.removeChild(_2.$999);delete _2.$999}}
delete this.$993}
if(this.$100h){if(this.drawingType=="svg"&&this.$44m){for(var _3 in this.$100h){if(!this.$100h.hasOwnProperty(_3))continue;var _4=this.$100h[_3].$982;if(!_4)_4=this.$44m.getElementById(_3);if(_4){_4.parentNode.removeChild(_4);_3=_4.getAttributeNS(isc.$100f,"href");if(_3&&_3.charAt(0)=='#')_3=_3.substring(1);if(_3){_4=this.$44m.getElementById(_3);if(_4)_4.parentNode.removeChild(_4)}}}}
delete this.$100h}
this.$99z=true;this.$99x(this.drawItems);this.$99z=false;this.$996=false},isc.A.redrawBitmap=function isc_DrawPane_redrawBitmap(){if(this.$439)return;this.$439=true;var _1=this;isc.EH.$ms(function(){if(!_1.$439)return;_1.redrawBitmapNow()})},isc.A.redrawBitmapNow=function isc_DrawPane_redrawBitmapNow(){if(!this.isDrawn())return;this.$439=false;var _1=this.getBitmapContext();if(!_1)return;var _2=document.getElementById(this.getID()+"$436");_2.width=_2.width;_1.clearRect(0,0,this.getWidth(),this.getHeight());for(var i=0;i<this.drawItems.length;i++){var _4=this.drawItems[i];_4.drawingBitmap=true;if(!_4.hidden){_4.drawBitmap(_1)}}},isc.A.drawing2screen=function isc_DrawPane_drawing2screen(_1){return[Math.round((_1[0]-this.$431)*this.zoomLevel),Math.round((_1[1]-this.$432)*this.zoomLevel),Math.round(_1[2]*this.zoomLevel),Math.round(_1[3]*this.zoomLevel)]},isc.A.screen2drawing=function(screenRect){return[screenRect[0]/this.zoomLevel+this.$431,screenRect[1]/this.zoomLevel+this.$432,screenRect[2]/this.zoomLevel,screenRect[3]/this.zoomLevel]},isc.A.$44a=function isc_DrawPane__setViewBox(_1,_2,_3,_4){var _5=this.drawingType;this.$431=_1;this.$432=_2;this.$433=_3;this.$434=_4;this.$44b();if(_5=="vml"){if(!this.$44c){this.$44c=isc.Element.get(this.getID()+"$435")}
if(this.$44c){this.$44c.coordorigin.x=_1;this.$44c.coordorigin.y=_2;this.$44c.coordsize.x=_3;this.$44c.coordsize.y=_4}}else if(_5=="svg"){if(!this.$44n){var _6=this;setTimeout(function(){_6.$44a(_1,_2,_3,_4)},100)}else{this.$44n.setAttributeNS(null,"transform","translate("+-_1+","+-_2+")")}}},isc.A.addCanvasItem=function isc_DrawPane_addCanvasItem(_1){this.canvasItems.add(_1);_1.drawPane=this;_1.$44e=_1.left;_1.$44f=_1.top;_1.$44g=_1.width;_1.$44h=_1.height;this.addChild(_1);this.$44i(_1);return _1},isc.A.$99c=function isc_DrawPane__getSimpleGradientSvgString(_1,_2){var _3="<linearGradient id='"+_1+"' x1='"+_2.x1+"' y1='"+_2.y1+"' x2='"+_2.x2+"' y2='"+_2.y2+"'>";var _4,_5,_6;_4=_2.startColor;_5=0.0;_6="1";_3+="<stop stop-color='"+_4+"' offset='"+_5+"' stop-opacity='"+_6+"'/>";_4=_2.endColor;_5=1.0;_6="1";_3+="<stop stop-color='"+_4+"' offset='"+_5+"' stop-opacity='"+_6+"'/>";_3+="</linearGradient>";return _3},isc.A.$99d=function isc_DrawPane__getLinearGradientSvgString(_1,_2){var _3="<linearGradient id='"+_1+"' x1='"+_2.x1+"' y1='"+_2.y1+"' x2='"+_2.x2+"' y2='"+_2.y2+"'>";for(var i=0;i<_2.colorStops.length;++i){var _5=_2.colorStops[i];var _6=_5.opacity||"1";_3+="<stop stop-color='"+_5.color+"' offset='"+_5.offset+"' stop-opacity='"+_6+"'/>"}
_3+="</linearGradient>";return _3},isc.A.$99e=function isc_DrawPane__getRadialGradientSvgString(_1,_2,_3){var _4="<radialGradient id='"+_1;if(_2.svgGradientUnits!=null)_4+="' gradientUnits='"+_2.svgGradientUnits;if(_2.cx!=null)_4+="' cx='"+_2.cx;if(_2.cy!=null)_4+="' cy='"+_2.cy;if(_2.r!=null)_4+="' r='"+_2.r;if(_2.fx!=null)_4+="' fx='"+_2.fx;if(_2.fy!=null)_4+="' fy='"+_2.fy;if(_2.$981!=null){var _5=_3.svgDefStrings||(_3.svgDefStrings={});var _6,_7;if(isc.isA.String(_2.$981)){_6=_2.$981;_7=this.gradients[_6]}else{_7=_2.$981;_6=_7.id}
if(!_5[_6]){_5[_6]=this.$99e(_6,_7,_3)}
_4+="' "+(_3.xlinkPrefix||isc.SVGStringConversionContext.$99a)+":href='#"+_6}
if(_2.colorStops&&_2.colorStops.length){_4+="'>";var _8,_9,_10;for(var i=0;i<_2.colorStops.length;++i){_8=_2.colorStops[i].color;_9=_2.colorStops[i].offset;_10=_2.colorStops[i].opacity||"1";_4+="<stop stop-color='"+_8+"' offset='"+_9+"' stop-opacity='"+_10+"'/>"}
_4+="</radialGradient>"}else _4+="'/>";return _4},isc.A.$99f=function isc_DrawPane__getFilterSvgString(_1){if(_1=="isc_ds1"){return"<filter id='isc_ds1'><feOffset result='offOut' in='SourceAlpha' dx='2.4' dy='2.4'/><feGaussianBlur result='blurOut' in='offOut' stdDeviation='1.8'/><feColorMatrix result='cmatOut' in='blurOut' type='matrix' values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.8 0'/><feBlend in='SourceGraphic' in2='cmatOut' mode='normal'/></filter>"}
return null},isc.A.$44i=function isc_DrawPane__updateCanvasItemToViewBox(_1){_1.synchingToPane=true;_1.setRect(this.drawing2screen([_1.$44e,_1.$44f,_1.$44g,_1.$44h]));if(_1.drawBorderSize){_1.getStyleHandle().borderWidth=Math.max(1,_1.drawBorderSize*this.zoomLevel)+"px"}
delete _1.synchingToPane},isc.A.$44b=function isc_DrawPane__updateItemsToViewBox(){for(var i=0,_2;i<this.canvasItems.length;i++){this.$44i(this.canvasItems[i])}
if(this.drawingType=="vml"){for(var i=0,_3,_4;i<this.drawItems.length;i++){_3=this.drawItems[i];if(isc.isA.DrawLabel(_3)){_3.$44j.fontSize=_3.$44k*this.zoomLevel;if(!_3.synchTextMove){_4=this.drawing2screen([_3.left,_3.top,0,0]);_3.$44j.left=_4[0];_3.$44j.top=_4[1]}}else{_3.$44l(_3.lineWidth*this.zoomLevel)}}}},isc.A.pan=function isc_DrawPane_pan(_1,_2){this.$44a(this.$431+_1/this.zoomLevel,this.$432+_2/this.zoomLevel,this.$433,this.$434);if(this.drawingType==='bitmap'){this.translate=this.translate||[0,0];this.translate[0]-=_1;this.translate[1]-=_2;this.redrawBitmap()}},isc.A.zoom=function isc_DrawPane_zoom(_1){var _2=_1/this.zoomLevel,_3=this.$433/_2,_4=this.$434/_2;this.zoomLevel=_1;this.$44a(this.$431+this.$433/2-_3/2,this.$432+this.$434/2-_4/2,_3,_4);if(this.drawingType==='bitmap'){this.redrawBitmap()}},isc.A.rotate=function isc_DrawPane_rotate(_1){var _2=this.drawingType;this.rotation=_1;if(_2==="vml"){if(!this.$44c){this.$44c=isc.Element.get(this.getID()+"$435")}
if(this.$44c){this.$44c.style.rotation=_1}}else if(_2==="svg"){if(!this.$44n){var _3=this;setTimeout(function(){_3.rotate(_1)},100)}else{this.$44n.setAttributeNS(null,"transform","rotate("+_1+")")}}else if(this.drawingType==='bitmap'){var _4=document.getElementById(this.getID()+"$436");if(_4){_4.style['transform']='rotate('+this.rotation+'deg)';_4.style.MozTransform='rotate('+this.rotation+'deg)';_4.style['-webkit-transform']='rotate('+this.rotation+'deg)'}}},isc.A.createSimpleGradient=function isc_DrawPane_createSimpleGradient(_1,_2){_2.id=_1;this.gradients[_1]=_2;return _1},isc.A.createLinearGradient=function isc_DrawPane_createLinearGradient(_1,_2){_2.id=_1;this.gradients[_1]=_2;return _1},isc.A.createRadialGradient=function isc_DrawPane_createRadialGradient(_1,_2){_2.id=_1;this.gradients[_1]=_2;return _1},isc.A.shouldDeferDrawing=function isc_DrawPane_shouldDeferDrawing(_1){if(this.$994()||(this.drawingType=="svg"&&!this.$44m))
{if(!this.$63q){this.$63q=[_1]}else{if(!this.$63q.contains(_1))this.$63q.add(_1)}
return true}else if(this.drawingType=="vml"&&!this.getHandle()){if(!this.$63q){this.$63q=[_1]}else{if(!this.$63q.contains(_1))this.$63q.add(_1)}
if(!this.deferring){var _2=this;_2.deferring=true;setTimeout(function(){if(_2.$63q){_2.$63q.map("draw");delete _2.$63q}
delete _2.deferring},10)}
return true}
return false},isc.A.cancelDeferredDraw=function isc_DrawPane_cancelDeferredDraw(_1){if(this.$63q){return this.$63q.remove(_1)}
return false},isc.A.svgLoaded=function isc_DrawPane_svgLoaded(){this.$44m=this.getHandle().firstChild.contentDocument;this.$44d=this.$44m.getElementById("isc_svg_body");this.$44n=this.$44m.getElementById("isc_svg_box");this.$44o=this.$44m.getElementById("isc_svg_defs");if(this.$63q){if(!this.$995())this.$100i(true)}
this.$l=true});isc.B._maxIndex=isc.C+54;isc.A=isc.DrawPane;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultDrawingType=isc.Browser.defaultDrawingType;isc.A.$44p=[];isc.B.push(isc.A.getDefaultDrawPane=function isc_c_DrawPane_getDefaultDrawPane(_1){if(!_1)_1=this.defaultDrawingType;if(this.$44p[_1])return this.$44p[_1];var _2=this.$44p[_1]=this.create({drawingType:_1,width:isc.Page.getScrollWidth(),height:isc.Page.getScrollHeight(),autoDraw:true});_2.sendToBack();return _2},isc.A.addrgb=function isc_c_DrawPane_addrgb(_1,_2){var _3=Array(parseInt('0x'+_1.substring(1,3),16),parseInt('0x'+_1.substring(3,5),16),parseInt('0x'+_1.substring(5,7),16));var _4=Array(parseInt('0x'+_2.substring(1,3),16),parseInt('0x'+_2.substring(3,5),16),parseInt('0x'+_2.substring(5,7),16));var _5=_3[0]+_4[0];_5=Math.round(_5>0xff?0xff:_5).toString(16);_5=_5.length===1?"0"+_5:_5;var _6=_3[1]+_4[1];_6=Math.round(_6>0xff?0xff:_6).toString(16);_6=_6.length===1?"0"+_6:_6;var _7=_3[2]+_4[2];_7=Math.round(_7>0xff?0xff:_7).toString(16);_7=_7.length===1?"0"+_7:_7;return'#'+_5+_6+_7},isc.A.subtractrgb=function isc_c_DrawPane_subtractrgb(_1,_2){var _3=Array(parseInt('0x'+_1.substring(1,3),16),parseInt('0x'+_1.substring(3,5),16),parseInt('0x'+_1.substring(5,7),16));var _4=Array(parseInt('0x'+_2.substring(1,3),16),parseInt('0x'+_2.substring(3,5),16),parseInt('0x'+_2.substring(5,7),16));var _5=_3[0]-_4[0];_5=Math.round(_5<0x0?0x0:_5).toString(16);_5=_5.length===1?"0"+_5:_5;var _6=_3[1]-_4[1];_6=Math.round(_6<0x0?0x0:_6).toString(16);_6=_6.length===1?"0"+_6:_6;var _7=_3[2]-_4[2];_7=Math.round(_7<0x0?0x0:_7).toString(16);_7=_7.length===1?"0"+_7:_7;return'#'+_5+_6+_7},isc.A.mixrgb=function isc_c_DrawPane_mixrgb(_1,_2){return _2.charAt(0)==='+'?isc.DrawPane.addrgb(_1,_2.substring(1)):_2.charAt(0)==='-'?isc.DrawPane.subtractrgb(_1,_2.substring(1)):_2},isc.A.$105t=function isc_c_DrawPane__mutergb(_1,_2){var _3=parseInt('0x'+_2.substring(1,3),16)/255,_4=parseInt('0x'+_2.substring(3,5),16)/255,_5=parseInt('0x'+_2.substring(5,7),16)/255,_6=Math.min(_3,_4,_5),_7=Math.max(_3,_4,_5),h,s,l=(_6+_7)/2;if(_6==_7){h=s=0}else{var c=_7-_6;s=c/(2*(l<0.5?l:1-l));if(_7==_3){h=(_4-_5)/c;if(_4<_5){h+=6}}else if(_7==_4){h=(_5-_3)/c+2}else{h=(_3-_4)/c+4}
h/=6}
if(_1<=0){l*=(100+_1)/100}else{l+=(_1/100)*(1-l)}
var _12,_13,_14;if(s==0){_12=_13=_14=Math.round(255*l).toString(16)}else{var _15=l+s*(l<0.5?l:1.0-l),_16=2*l-_15,_17=(3*h-Math.floor(3*h))/3,_18=_15-6*(_15-_16)*Math.abs(_17-1/6),r,g,b;switch(Math.floor(h*6)){case 0:case 6:r=_15;g=_18;b=_16;break;case 1:r=_18;g=_15;b=_16;break;case 2:r=_16;g=_15;b=_18;break;case 3:r=_16;g=_18;b=_15;break;case 4:r=_18;g=_16;b=_15;break;case 5:r=_15;g=_16;b=_18;break}
_12=Math.round(255.0*r).toString(16);_13=Math.round(255.0*g).toString(16);_14=Math.round(255.0*b).toString(16)}
_12=_12.length===1?"0"+_12:_12;_13=_13.length===1?"0"+_13:_13;_14=_14.length===1?"0"+_14:_14;return'#'+_12+_13+_14},isc.A.hex2rgb=function isc_c_DrawPane_hex2rgb(_1,_2){var _3=_1.split('#')[1];var _4=_3.length/3;var _5=_3.substring(0,_4);var _6=_3.substring(_4,_4*2);var _7=_3.substring(_4*2,_4*3);var _8=parseInt(_5.toUpperCase(),16);var _9=parseInt(_6.toUpperCase(),16);var _10=parseInt(_7.toUpperCase(),16);var _11=(typeof(_2)!=='undefined')?'rgba('+_8+','+_9+','+_10+','+_2+')':'rgb('+_8+','+_9+','+_10+')';return _11},isc.A.rgb2hex=function isc_c_DrawPane_rgb2hex(_1){var _2="",v,i;var _5=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var h=_5.exec(_1);for(i=1;i<4;i++){v=parseInt(h[i],10).toString(16);if(v.length==1){_2+="0"+v}else{_2+=v}}
return("#"+_2)});isc.B._maxIndex=isc.C+7;isc.defineClass("DrawItem").addProperties({lineWidth:3,lineColor:"#808080",lineOpacity:1.0,linePattern:"solid",lineCap:"round",fillGradient:null,fillOpacity:1.0,shadow:null,rotation:0,scale:null,svgFilter:null,autoOffset:true,canDrag:false,getBoundingBox:function(){return[]},isInBounds:function(_1,_2){var b=this.getBoundingBox();var _4=(_1>=b[0])&&(_1<=b[2])&&(_2>=b[1])&&(_2<=b[3]);return _4},checkPointInPath:true,isPointInPath:function(_1,_2){if(!this.isInBounds(_1,_2)){return false}
if(this.drawPane.drawingType=='bitmap'){var _3=this.drawPane.getBitmapContext();_3.save();var _4=this.lineColor,_5=this.lineOpacity;this.lineColor="#000000";this.lineOpacity=0.0;this.drawStroke(_3);_3.restore();this.lineColor=_4;this.lineOpacity=_5;var _6=_3.isPointInPath(parseFloat(_1),parseFloat(_2));return _6}else if(this.drawPane.drawingType=="vml"){var _7=this.$44u;if(_7){var _8=this.drawPane.normalize(_1,_2,true);var _9=this.drawPane.getPageLeft()+_8.x,_10=this.drawPane.getPageTop()+_8.y;return document.elementFromPoint(_9,_10)==_7}}
return true},computeAngle:function(_1,_2,_3,_4){var _5=_3-_1;var _6=_4-_2;var _7=0;if(_5==0){if(_6==0){_7=0.0}else if(_6>0){_7=Math.PI/2.0}else{_7=Math.PI*3.0/2.0}}else if(_6==0){if(_5>0){_7=0.0}else{_7=Math.PI}}else{if(_5<0){_7=Math.atan(_6/_5)+Math.PI}else if(_6<0){_7=Math.atan(_6/_5)+(2*Math.PI)}else{_7=Math.atan(_6/_5)}}
_7=_7*180/Math.PI;return _7},getHoverTarget:function(_1,_2){return this.drawPane},$kr:function(_1){return false},$k2:function(){},focus:function(_1){},visibleAtPoint:function(_1,_2){return true},getDragAppearance:function(_1){return"none"},bringToFront:function(){},moveToEvent:function(_1,_2){this.moveTo(_1,_2)},dragStartDistance:1,getRect:function(){var _1=this.getBoundingBox();return[_1[0],_1[1],_1[2]-_1[0],_1[3]-_1[1]]},getPageLeft:function(){return this.getBoundingBox()[0]},getPageTop:function(){return this.getBoundingBox()[1]},dragStart:function(_1,_2){if(this.logIsInfoEnabled("drawEvents")){this.logInfo("DragStart on item:"+this.getID(),"drawEvents")}
var _3=this.getBoundingBox();var _4=_3[0];var _5=_3[1];var _6=this.drawPane.normalize(_1.x,_1.y);this.lastDragX=_6.x-this.drawPane.getPageLeft();this.lastDragY=_6.y-this.drawPane.getPageTop();this.dragOffsetX=this.lastDragX-_4;this.dragOffsetY=this.lastDragY-_5;if(this.onDragStart(this.lastDragX,this.lastDragY)==false){return false}
return true},onDragStart:function(_1,_2){},dragMove:function(_1,_2){var _3=this.drawPane.normalize(_1.x,_1.y);var x=_3.x-this.drawPane.getPageLeft();var y=_3.y-this.drawPane.getPageTop();if(this.onDragMove(x,y)==false)return false;this.moveBy(x-this.lastDragX,y-this.lastDragY);this.lastDragX=x;this.lastDragY=y;return true},onDragMove:function(_1,_2){},dragStop:function(_1,_2){var _3=this.drawPane.normalize(_1.x,_1.y);var x=_3.x-this.drawPane.getPageLeft()-this.dragOffsetX;var y=_3.y-this.drawPane.getPageTop()-this.dragOffsetY;this.onDragStop(x,y);return true},onDragStop:function(_1,_2){},click:function(){return true},mouseDown:function(){return true},mouseUp:function(){return true},mouseMove:function(){return true},mouseOut:function(){return true},mouseOver:function(){return true},showContextMenu:function(){var _1=this.contextMenu;if(_1){_1.target=this;if(!isc.isA.Canvas(_1)){_1.autoDraw=false;this.contextMenu=_1=this.getMenuConstructor().create(_1)}
_1.showContextMenu()}
return(_1==null)},getMenuConstructor:function(){var _1=isc.ClassFactory.getClass(this.menuConstructor);if(!_1){isc.logWarn("Class not found for menuConstructor:"+this.menuConstructor+". Defaulting to isc.Menu class");_1=isc.ClassFactory.getClass("Menu")}
return _1},init:function(){this.Super("init");if(this.ID==null||window[this.ID]!=this){isc.ClassFactory.addGlobalID(this)}
this.drawItemID=isc.DrawItem.$44q++;if(this.drawPane)this.drawPane.addDrawItem(this,this.autoDraw)},draw:function(){if(this.$if){this.logDebug("DrawItem already drawn - exiting draw(). Note that this DrawItem may have been auto-drawn if setDrawPane() was called on it, or if DrawPane.addDrawItem() was called to add this DrawItem to a DrawPane.","drawing");return}
if(isc.isA.DrawGroup(this)&&this.drawItems!=null){for(var i=0;i<this.drawItems.length;i++){if(this.drawItems[i]==null){this.logInfo("drawGroup included empty entry in drawItems:"+this.echo(this.drawItems));continue}
this.drawItems[i].drawGroup=this;this.drawItems[i].drawPane=this.drawPane}
this.drawItems.removeEmpty()}
if(this.drawGroup){this.drawPane=this.drawGroup.drawPane}else{if(!this.drawPane)this.drawPane=isc.DrawPane.getDefaultDrawPane(this.drawingType)}
if(this.drawGroup){if(!this.drawGroup.drawItems.contains(this))this.drawGroup.drawItems.add(this)}else{if(!this.drawPane.drawItems.contains(this))this.drawPane.drawItems.add(this)}
if(this.drawGroup&&this.drawGroup.useGroupRect){this.eventParent=this.drawGroup}else{this.eventParent=this.drawPane;var _2=this.getBoundingBox();if(_2&&_2.length===4){this.item={x:_2[0],y:_2[1],width:_2[2]-_2[0],height:_2[3]-_2[1],shape:this};if(!(isNaN(this.item.width)||isNaN(this.item.height))){this.drawPane.quadTree.insert(this.item)}}}
var _3=this.drawPane,_4=_3.getDrawnState();if(_3.shouldDeferDrawing(this)){return}
if(!_3.isDrawn()&&_3.getDrawnState()!=isc.Canvas.HANDLE_DRAWN){return}
if(this.drawGroup){if(!this.drawGroup.$if){this.logWarn("Attempted draw into an undrawn group - calling draw() on the group now");this.drawGroup.draw();if(!this.drawGroup.$if){return}}}
this.drawHandle();this.$if=true;this.$99y()},$99y:function(){if(this.knobs){for(var i=0;i<this.knobs.length;i++)this.$634(this.knobs[i])}},drawHandle:function(){var _1=this.drawPane;var _2=this.drawingType=_1.drawingType;if(_2=="vml"){this.drawingVML=true}else if(_2=="svg"){this.drawingSVG=true}else if(_2=="bitmap"){this.drawingBitmap=true}
if(this.drawingVML){if(isc.isA.DrawLabel(this)&&!this.synchTextMove){this.$44t=_1.getHandle()}else if(this.drawGroup&&this.drawGroup.renderGroupElement){this.$44t=this.drawGroup.$44u}else{this.$44t=isc.Element.get(_1.getID()+"$435")}
var _3="isc_DrawItem_"+this.drawItemID;isc.Element.insertAdjacentHTML(this.$44t,this.drawToBack?"afterBegin":"beforeEnd",this.$44v(_3));this.$44u=isc.Element.get(_3);if(!isc.isA.DrawGroup(this)&&!isc.isA.DrawImage(this)&&!isc.isA.DrawLabel(this)){this.$44w=this.$44u.firstChild;this.$44x=this.$44w.nextSibling}
if(isc.isA.DrawLabel(this)){if(this.synchTextMove){this.$44j=this.$44u.firstChild.style}else{this.$44j=this.$44u.style}}}else if(this.drawingSVG){_1.$99x(this)}else if(this.drawingBitmap){_1.redrawBitmap()}else{this.logWarn("DrawItem: '"+_2+"' is not a supported drawingType");return}},isDrawn:function(){return!!this.$if},moved:function(_1,_2){},$105u:function(_1,_2){this.moved(_1,_2);this.updateControlKnobs()},resized:function(){},$5y:function(){this.resized();this.updateControlKnobs()},rotated:function(){this.updateControlKnobs()},scaled:function(){this.updateControlKnobs()},$634:function(_1){var _2=isc.DrawItem.$632(_1)
if(!this[_2]){this.logWarn("DrawItem specfied with knobType:"+_1+" but no "+_2+" function exists to show the knobs. Ignoring")}else{this[_2]()}},$635:function(_1){var _2=isc.DrawItem.$632(_1,true)
if(!this[_2]){this.logWarn("DrawItem specfied with knobType:"+_1+" but no "+_2+" function exists to hide the knobs.")}else{this[_2]()}},showKnobs:function(_1){if(isc.isAn.Array(_1)){for(var i=0;i<_1.length;i++){this.showKnobs(_1[i])}
return}
if(!this.knobs)this.knobs=[];if(this.knobs.contains(_1))return;this.knobs.add(_1);if(this.$if){this.$634(_1)}},hideKnobs:function(_1){if(!this.knobs)return;if(isc.isAn.Array(_1)){for(var i=0;i<_1.length;i++){this.hideKnobs(_1[i])}
return}
if(this.knobs.contains(_1))this.knobs.remove(_1);if(this.$if){this.$635(_1)}},moveKnobPoint:"TL",$636:function(_1){var x,y;x=_1.contains("L")?this.left:(_1.contains("R")?(this.left+this.width):(this.left+Math.round(this.width/2)));y=_1.contains("T")?this.top:(_1.contains("B")?(this.top+this.height):(this.top+Math.round(this.height/2)));return[x,y]},showMoveKnobs:function(){var _1=this.$636(this.moveKnobPoint),x=_1[0],y=_1[1];if(this.moveKnobOffset){x+=this.moveKnobOffset[0];y+=this.moveKnobOffset[1]}
this.$637=this.createAutoChild("moveKnob",{_constructor:"DrawKnob",x:x,y:y,drawPane:this.drawPane,autoDraw:true});this.observe(this.$637,"updatePoints","observer.moveBy(dX,dY)")},hideMoveKnobs:function(){if(this.$637){this.$637.destroy();delete this.$637}},resizeKnobPoints:["TL","TR","BL","BR"],getResizeKnobProperties:function(_1){},showResizeKnobs:function(){var _1=this.resizeKnobPoints;for(var i=0;i<_1.length;i++){var _3=_1[i],_4=this.$636(_3),x=_4[0],y=_4[1];var _7=isc.addProperties({},this.getResizeKnobProperties(_3),{_constructor:"DrawKnob",targetShape:this,point:_3,x:x,y:y,drawPane:this.drawPane,autoDraw:true});var _8=this.createAutoChild("resizeKnob",_7);_8.addProperties({updatePoints:function(_9,_10,_11,_12){return this.targetShape.handleResizeKnobMove(this.point,_9,_10,_11,_12)}});if(!this.$638)this.$638=[];this.$638.add(_8)}},handleResizeKnobMove:function(_1,_2,_3,_4,_5){var _6=this.left,_7=this.top,_8=this.width,_9=this.height,_10;if(_1.contains("L")){_6=_2;_8-=_4;_10=true}else if(_1.contains("R")){_8+=_4}
if(_1.contains("T")){_7=_3;_9-=_5;_10=true}else if(_1.contains("B")){_9+=_5}
if(_8<1||_9<1)return false;this.resizeTo(_8,_9);if(_10)this.moveTo(_6,_7)},hideResizeKnobs:function(){if(this.$638){this.$638.map("destroy");delete this.$638}},updateControlKnobs:function(){if(this.$637){var _1=this.$636(this.moveKnobPoint);if(this.moveKnobOffset){_1[0]+=this.moveKnobOffset[0];_1[1]+=this.moveKnobOffset[1]}
var _2=this.drawPane.drawing2screen(_1);this.$637.setCenterPoint(_2[0],_2[1])}
if(this.$638){for(var i=0;i<this.$638.length;i++){var _4=this.$638[i],_1=this.$636(_4.point);var _2=this.drawPane.drawing2screen(_1);_4.setCenterPoint(_2[0],_2[1])}}},setDrawPane:function(_1){if(_1==this.drawPane)return;if(_1==null){this.erase();this.drawPane=null;return}
_1.addDrawItem(this)},$63r:function(){return false},$63s:function(){return false},erase:function(_1,_2){if(!this.$if){if(this.drawPane&&this.drawPane.cancelDeferredDraw(this))return;this.logInfo("DrawItem not yet drawn - exiting erase()");return}
if(!_1){if(_2){if(!this.$993)this.$993=[this];else this.$993.add(this)}
if(this.drawGroup){this.drawGroup.drawItems.remove(this)}else{this.drawPane.drawItems.remove(this);this.item&&this.drawPane.quadTree.remove(this.item)}}
if(this.drawingVML){if(isc.Page.isLoaded())this.$44u.outerHTML="";else this.$44t.removeChild(this.$44u);this.$44t=null;this.$44u=null;this.$44w=null;this.$44x=null}else if(this.drawingSVG){if(_2)this.$999=this.$44z
else{if(this.$44y)this.$44y.removeChild(this.$44z)}
this.$44m=null;this.$44y=null;this.$44z=null}else if(this.drawingBitmap&&!_1){this.drawPane.redrawBitmap()}
if(this.knobs){for(var i=0;i<this.knobs.length;i++){this.$635(this.knobs[i])}}
this.$if=false},destroy:function(_1){this.Super("destroy",arguments);if(this.destroyed)return;this.destroying=true;this.erase(_1);isc.ClassFactory.dereferenceGlobalID(this);this.destroyed=true},vmlLineEventsOnly:false,$44v:function(_1){var _2=!this.lineEventsOnly?" ON='true":" ON='false",_3=0,_4=" ON='false",_5,_6,_7,_8,_9="",_10;if(this.shadow){_4=" ON='true' COLOR='"+this.shadow.color+"' OFFSET='"+this.shadow.offset[0]+"pt,"+this.shadow.offset[1]+"pt"}
if(this.fillGradient){_3=this.fillOpacity;var _11=typeof(this.fillGradient)==='string'?this.drawPane.gradients[this.fillGradient]:this.fillGradient;if(typeof(_11.direction)==='number'||_11.x1||typeof(_11.x1)==='number'){_5=this.$830(_11,this.getBoundingBox());_6=_11.direction||180*Math.atan2((_5[3]-_5[1]),(_5[2]-_5[0]))/Math.PI;_6=(270-_6)%360;_9="' COLORS='";if(_11.startColor&&_11.endColor){_9+='0% '+_11.startColor+', 100% '+_11.endColor}else if(_11.colorStops&&_11.colorStops.length){for(var i=0;i<_11.colorStops.length;++i){var _13=_11.colorStops[i];if(typeof(_13.offset)==='string'&&_13.offset.endsWith('%')){_10=_13.offset}else{_10=_13.offset}
_9+=_10+' '+_13.color;if(i<_11.colorStops.length-1){_9+=", "}}}
_2=" TYPE='gradient' ANGLE='"+_6+_9}else{_9="' COLORS='";for(var i=0;i<_11.colorStops.length;++i){var _13=_11.colorStops[i];if(typeof(_13.offset)==='string'&&_13.offset.endsWith('%')){_10=_13.offset}else{_10=parseFloat(_13.offset)*100+'%'}
_9+=_10+' '+_13.color;if(i<_11.colorStops.length-1){_9+=", "}}
_2=" TYPE='gradienttitle' OPACITY='1.0' FOCUS='100%' FOCUSSIZE='0,0' FOCUSPOSITION='0.5,0.5' METHOD='linear"+_9}}else if(this.fillColor&&!isc.isAn.emptyString(this.fillColor)){_3=this.fillOpacity;_2=" COLOR='"+this.fillColor}
var _14=isc.SB.concat(this.drawPane.startTagVML(this.vmlElementName)," ID='",_1,"' ",this.getAttributesVML(),">",this.drawPane.startTagVML('STROKE'),((this.lineColor&&this.lineColor!="")?" COLOR='"+this.lineColor:" ON='false"),"' WEIGHT='",this.lineWidth*this.drawPane.zoomLevel,"px","' OPACITY='",this.lineOpacity,"' DASHSTYLE='",this.linePattern,"' JOINSTYLE='miter' MITERLIMIT='8.0","' ENDCAP='"+((this.lineCap=="butt")?"flat":this.lineCap),(this.startArrow?"' STARTARROW='"+this.startArrow+"' STARTARROWWIDTH='wide":""),(this.endArrow?"' ENDARROW='"+this.endArrow+"' ENDARROWWIDTH='wide":""),"'/>",this.drawPane.startTagVML('FILL'),_2,"' OPACITY='",_3,"'/>",this.drawPane.startTagVML('SHADOW'),_4,"'/>",this.drawPane.endTagVML(this.vmlElementName));return _14},getAttributesVML:function(){return""},getSvgString:function(_1){_1=_1||isc.SVGStringConversionContext.create();var _2=_1.svgDefStrings||(_1.svgDefStrings={});var _3="none",_4,_5;var _6=this.svgFillGradient||this.fillGradient;if(_6){if(isc.isA.String(_6))_6=this.drawPane.gradients[_6];if(_6){if(_6.id==undefined){_6.id="gradient"+_1.getNextSvgDefNumber()}
var _7=_6.id;if(!_2[_7]){var _8;if(_6.direction!=undefined){_8=this.drawPane.$99c(_7,_6)}else if(_6.x1!=undefined){_8=this.drawPane.$99d(_7,_6)}else{_8=this.drawPane.$99e(_7,_6,_1)}
_2[_7]=_8;if(_1.printForExport===false){this.drawPane.gradients[_7]=_6}}
_3="url(#"+_7+")"}}else if(this.fillColor){_3=this.fillColor}
var _9="<"+this.svgElementName+" id='isc_DrawItem_"+this.drawItemID+"' stroke-width='"+this.lineWidth+"px' stroke-opacity='"+this.lineOpacity+"' stroke-dasharray='"+this.$441()+"' stroke-linecap='"+this.lineCap+"' stroke='"+((this.lineColor&&this.lineColor!="")?this.lineColor:"none")+"' fill='"+_3+"' fill-opacity='"+this.fillOpacity;if(this.svgFilter!=null&&this.drawPane){var _10=_2[this.svgFilter]||(_2[this.svgFilter]=this.drawPane.$99f(this.svgFilter));if(_10){_9+="' filter='url(#"+this.svgFilter+")"}}
if(this.rotation&&(_5=this.getCenter())&&_5.length===2){_9+="' transform='rotate("+this.rotation+" "+_5[0]+" "+_5[1]+")"}
if(this.startArrow&&this.$63r()){var _11=this.$442();if(!_2[_11]){_2[_11]=this.$99g(_11,this.lineColor,this.lineOpacity,true)}
_9+="' marker-start='url(#"+_11+")"}
if(this.endArrow&&this.$63s()){var _12=this.$443();if(!_2[_12]){_2[_12]=this.$99g(_12,this.lineColor,this.lineOpacity,false)}
_9+="' marker-end='url(#"+_12+")"}
_9+="' "+this.getAttributesSVG();if(this.contents){_9+=">"+isc.makeXMLSafe(this.contents)+"</"+this.svgElementName+">"}else{_9+="/>"}
return _9},getAttributesSVG:function(){return""},$830:function(_1,_2){var _3=[],_4=Math.abs(_2[2]-_2[0]),_5=Math.abs(_2[3]-_2[1]);if(typeof(_1.direction)==='number'){var _6=Math.round(Math.sqrt(_4*_4+_5*_5));var _7=_1.direction*Math.PI/180.0;_1.x1=_2[0];_1.x2=_2[0]+_6*Math.cos(_7);_1.y1=_2[1];_1.y2=_2[1]+_6*Math.sin(_7)}
if(typeof(_1.x1)==='string'&&_1.x1.endsWith('%')){_3.push(_2[0]+parseFloat(_1.x1)*_4/100.0)}else if(isc.isA.Number(_1.x1)){_3.push(_1.x1)}
if(typeof(_1.y1)==='string'&&_1.y1.endsWith('%')){_3.push(_2[1]+parseFloat(_1.y1)*_5/100.0)}else if(isc.isA.Number(_1.y1)){_3.push(_1.y1)}
if(typeof(_1.x2)==='string'&&_1.x2.endsWith('%')){_3.push(_2[0]+parseFloat(_1.x2)*_4/100.0)}else if(isc.isA.Number(_1.x2)){_3.push(_1.x2)}
if(typeof(_1.y2)==='string'&&_1.y2.endsWith('%')){_3.push(_2[1]+parseFloat(_1.y2)*_5/100.0)}else if(isc.isA.Number(_1.y2)){_3.push(_1.y2)}
return _3},$831:function(_1,_2){var _3=[],r;var _5=this.getCenter();if(typeof(_1.fx)==='string'){if(_1.fx.endsWith('%')){_3.push(_5[0]+(parseFloat(_1.fx)/100.0))}else{_3.push(_5[0]+parseFloat(_1.fx))}}else if(_1.fx!=undefined){_3.push(_5[0]+_1.fx)}else _3.push(_5[0]);if(typeof(_1.fy)==='string'){if(_1.fy.endsWith('%')){_3.push(_5[1]+(parseFloat(_1.fy)/100.0))}else{_3.push(_5[1]+parseFloat(_1.fy))}}else if(_1.fy!=undefined){_3.push(_5[1]+_1.fy)}else _3.push(_5[1]);_3.push(0);if(typeof(_1.cx)==='string'&&isc.isA.Number(_2[0])){if(_1.cx.endsWith('%')){_3.push(_2[0]-Math.round(_2[0]*parseInt(_1.cx)/100.0))}else{_3.push(_5[0]+parseInt(_1.cx))}}else{_3.push(_5[0]+_1.cx)}
if(typeof(_1.cy)==='string'&&isc.isA.Number(_2[1])){if(_1.cx.endsWith('%')){_3.push(_2[1]-Math.round(_2[1]*parseInt(_1.cy)/100.0))}else{_3.push(_5[1]+parseInt(_1.cy))}}else{_3.push(_5[1]+_1.cy)}
if(typeof(_1.r)==='string'&&isc.isA.Number(_2[0])&&isc.isA.Number(_2[1])){r=Math.sqrt(Math.pow(_2[2]-_2[0],2)+Math.pow(_2[3]-_2[1],2));if(_1.r.endsWith('%')){_3.push(r*parseFloat(_1.r)/100.0)}else{_3.push(r*parseFloat(_1.r))}}else{_3.push(_1.r)}
return _3},$85x:function(_1,_2,_3,_4,_5){var _6=[10,5],_7=_6.length,_8=(_3-_1),_9=(_4-_2);var _10=_9/_8;var _11=Math.sqrt(_8*_8+_9*_9);var _12=0,_13,_14,_15=true;switch(this.linePattern.toLowerCase()){default:case"dash":_6=[10,10];break;case"dot":_6=[1,10];break;case"longdash":_6=[20,10];break;case"shortdash":_6=[10,5];break;case"shortdot":_6=[1,5];break}
var _16=true;if(_3<_1){_16=false}
this.bmMoveTo(_1,_2,_5);while(_11>=0.1){_13=_6[_12++%_7];if(_13>_11){_13=_11}
_14=Math.sqrt(_13*_13/(1+_10*_10));if(_16){_1+=_14}else{_1-=_14}
_2+=_10*_14;this[_15?'bmLineTo':'bmMoveTo'](_1,_2,_5);_11-=_13;_15=!_15}},drawStroke:function(_1){_1.lineWidth=this.lineWidth;_1.lineCap=this.lineCap;_1.strokeStyle=this.lineColor;_1.globalAlpha=this.lineOpacity;_1.beginPath();this.drawBitmapPath(_1);_1.stroke()},drawBitmap:function(_1){_1.save();try{if(this.drawPane&&(this.drawPane.zoomLevel||this.drawPane.translate||this.drawPane.rotation)){_1.setTransform(1,0,0,1,0,0);if(this.drawPane.translate){_1.translate(this.drawPane.translate[0],this.drawPane.translate[1])}
if(this.drawPane.zoomLevel){_1.scale(this.drawPane.zoomLevel,this.drawPane.zoomLevel)}}
if(this.translate){_1.translate(this.translate[0],this.translate[1])}
if(this.scale&&this.scale.length===2){_1.scale(this.scale[0],this.scale[1])}
if(this.rotation&&!isc.isA.DrawLabel(this)){var _2=this.getCenter&&this.getCenter();if(_2&&_2.length===2){_1.translate(_2[0],_2[1]);_1.rotate(this.rotation*Math.PI/180.0);_1.translate(-_2[0],-_2[1])}}
var _3=this.fillColor,_4,_5,_6;if(this.fillGradient){_4=typeof(this.fillGradient)==='string'?this.drawPane.gradients[this.fillGradient]:this.fillGradient;if(typeof(_4.direction)==='number'||_4.x1||typeof(_4.x1)==='number'){_5=this.$830(_4,this.getBoundingBox());_3=_1.createLinearGradient(_5[0],_5[1],_5[2],_5[3])}else{_5=this.$831(_4,this.getBoundingBox());_3=_1.createRadialGradient(_5[0],_5[1],_5[2],_5[3],_5[4],_5[5])}
if(_4.startColor&&_4.endColor){_3.addColorStop(0.0,_4.startColor);_3.addColorStop(1.0,_4.endColor)}else if(_4.colorStops&&_4.colorStops.length){for(var i=0;i<_4.colorStops.length;++i){_6=_4.colorStops[i].offset;if(typeof(_6)==='string'&&_6.endsWith('%')){_6=parseFloat(_6.substring(0,_6.length-1))/100.0}
_3.addColorStop(_6,_4.colorStops[i].color)}}}
if(this.shadow){_1.shadowColor=this.shadow.color;_1.shadowBlur=this.shadow.blur;_1.shadowOffsetX=this.shadow.offset[0];_1.shadowOffsetY=this.shadow.offset[1]}
if(_3){_1.fillStyle=_3;_1.globalAlpha=this.fillOpacity;_1.beginPath();this.drawBitmapPath(_1);_1.fill()}
if(this.lineColor){if(this.shadow&&_3){_1.shadowColor=null;_1.shadowBlur=null;_1.shadowOffsetX=0;_1.shadowOffsetY=0}
this.drawStroke(_1)}}catch(e){if(!isc.Log.supportsOnError)this.$am(e);else this.logWarn("exception during drawBitmap(): "+e)}
_1.restore()},$442:function(){if(!this.$444){if(this.startArrow&&this.$44m&&this.$44m.getElementById(this.startArrow)&&(this.startArrow!="open"&&this.startArrow!="closed")){this.$444=this.startArrow}else{this.$444="isc_DrawItem_"+this.drawItemID+"$446"}}
return this.$444},$443:function(){if(!this.$448){if(this.endArrow&&this.$44m&&this.$44m.getElementById(this.endArrow)&&(this.endArrow!="open"&&this.endArrow!="closed")){this.$448=this.endArrow}else{this.$448="isc_DrawItem_"+this.drawItemID+"$45a"}}
return this.$448},$99g:function(_1,_2,_3,_4){return"<marker id='"+_1+"' viewBox='0 0 10 10' refY='5' refX='"+(_4?"10":"0")+"' orient='auto' markerUnits='strokeWidth' markerWidth='4' markerHeight='3'><path d='"+(_4?"M 10 0 L 0 5 L 10 10 z":"M 0 0 L 10 5 L 0 10 z")+"' fill='"+((_2&&_2!="")?_2:"none")+"' fill-opacity='"+_3+"'/></marker>"},show:function(){this.hidden=false;if(this.drawingVML){this.$44u.style.visibility="visible"}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"visibility","visible")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},hide:function(){this.hidden=true;if(this.drawingVML){this.$44u.style.visibility="hidden"}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"visibility","hidden")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setLineWidth:function(_1){if(_1!=null)this.lineWidth=_1;if(this.drawingVML){this.$44l(this.lineWidth*this.drawPane.zoomLevel)}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"stroke-width",this.lineWidth+"px");this.$44z.setAttributeNS(null,"stroke-dasharray",this.$441())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},$44l:function(_1){if(this.$44w){this.$44w.weight=_1+"px"}},setLineColor:function(_1){this.lineColor=_1;if(this.drawingVML){if(this.lineColor&&this.lineColor!=""){this.$44w.on=true;this.$44w.color=this.lineColor}else{this.$44w.on=false}}else if(this.drawingSVG){var _1=(this.lineColor&&this.lineColor!="")?this.lineColor:"none"
this.$44z.setAttributeNS(null,"stroke",_1);if(this.$445){this.$445.setAttributeNS(null,"stroke",_1);this.$445.setAttributeNS(null,"fill",_1)}
if(this.$449){this.$449.setAttributeNS(null,"stroke",_1);this.$449.setAttributeNS(null,"fill",_1)}}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setLineOpacity:function(_1){if(_1!=null)this.lineOpacity=_1;if(this.drawingVML){this.$44w.opacity=this.lineOpacity}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"stroke-opacity",this.lineOpacity);if(this.$445){this.$445.setAttributeNS(null,"stroke-opacity",this.lineOpacity);this.$445.setAttributeNS(null,"fill-opacity",this.lineOpacity)}
if(this.$449){this.$449.setAttributeNS(null,"stroke-opacity",this.lineOpacity);this.$449.setAttributeNS(null,"fill-opacity",this.lineOpacity)}}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setLinePattern:function(_1){this.linePattern=_1;if(this.drawingVML){this.$44w.dashstyle=this.linePattern}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"stroke-dasharray",this.$441())}else if(this.drawingBitmap){}},$44r:{shortdot:1,dot:1,shortdash:3,dash:4,longdash:8},$44s:{shortdot:1,dot:3,shortdash:1,dash:3,longdash:3},$441:function(){var _1=this.linePattern;if(!_1||_1=="solid"||_1=="")return"none";if(isc.isAn.Array(_1))return _1.join("px,")+"px";var _2=this.$44r[_1];var _3=this.$44s[_1];if(this.lineCap!="butt"){_2=Math.max(0.1,_2-1);_3++}
return(_2*this.lineWidth)+"px,"+(_3*this.lineWidth)+"px"},setLineCap:function(_1){if(_1!=null)this.lineCap=_1;if(this.drawingVML){this.$44w.endcap=(this.lineCap=="butt")?"flat":this.lineCap}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"stroke-linecap",this.lineCap);this.$44z.setAttributeNS(null,"stroke-dasharray",this.$441())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setShadow:function(_1){if(_1!=null){this.shadow=_1}
if(this.drawingVML){}else if(this.drawingSVG){}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setStartArrow:function(_1){var _2=this.$63r();var _3;if(_1!==_3)this.startArrow=_1;else _1=this.startArrow;var _4=this.$63r();if(_2!=_4){this.setStartPoint()}
if(_4)_1=null;if(this.drawingVML){this.$44w.startarrow=(_1?_1:"none")}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"marker-start",(_1?"url(#"+this.$442()+")":"none"))}else if(this.drawingBitmap){}},setEndArrow:function(_1){var _2=this.$63s();var _3;if(_1!==_3)this.endArrow=_1;else _1=this.endArrow;var _4=this.$63s();if(_2!=_4){this.setEndPoint()}
if(_4)_1=null;if(this.drawingVML){this.$44w.endarrow=(_1?_1:"none")}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"marker-end",(_1?"url(#"+this.$443()+")":"none"))}else if(this.drawingBitmap){}},moveBy:function(_1,_2){if(this.item){var _3=this.getBoundingBox();this.item.x=_3[0];this.item.y=_3[1];this.item.width=Math.abs(_3[2]-_3[0]);this.item.height=Math.abs(_3[3]-_3[1]);this.drawPane.updateQuadTree(this)}},resizeBy:function(_1,_2){if(this.item){var _3=this.getBoundingBox();this.item.x=_3[0];this.item.y=_3[1];this.item.width=Math.abs(_3[2]-_3[0]);this.item.height=Math.abs(_3[3]-_3[1]);this.drawPane.updateQuadTree(this)}},resizeTo:function(_1,_2){var _3=0,_4=0;if(this.item){if(_1!=null)_3=_1-this.item.width;if(_2!=null)_4=_2-this.item.height}
this.resizeBy(_3,_4)},rotateBy:function(_1){this.rotation+=_1;if(this.drawingVML){this.$44u.style.rotation=this.rotation}else if(this.drawingSVG){var _2=this.getCenter();this.$44z.setAttributeNS(null,"transform","translate("+_2[0]+","+_2[1]+") rotate("+this.rotation+") translate("+-_2[0]+","+-_2[1]+")")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.rotated(_1)},rotateTo:function(_1){this.rotateBy(_1-this.rotation)},scaleBy:function(_1,_2){this.scale=this.scale||[];this.scale[0]=_1;this.scale[1]=_2;if(this.drawingVML){}else if(this.drawingSVG){var _3="scale("+this.scale[0]+","+this.scale[1]+") "+(this.$44z.getAttributeNS(null,"transform")||"");this.$44z.setAttributeNS(null,"transform",_3)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.scaled()},scaleTo:function(_1,_2){this.scaleBy(_1,_2)},setFillColor:function(_1){this.fillColor=_1;if(this.drawingVML){if(this.fillColor&&this.fillColor!=""){this.$44x.on=true;this.$44x.color=this.fillColor}else{this.$44x.on=false}}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"fill",(this.fillColor&&this.fillColor!="")?this.fillColor:"none")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setFillGradient:function(_1){this.gradient=_1;if(this.drawingSVG){this.$44z.setAttributeNS(null,"fill",(this.fillColor&&this.fillColor!="")?this.fillColor:"none")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},setFillOpacity:function(_1){if(_1!=null)this.fillOpacity=_1;if(this.drawingVML){this.$44x.opacity=this.fillOpacity}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"fill-opacity",this.fillOpacity)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},bmMoveTo:function(_1,_2,_3){var _3=_3||this.drawPane.getBitmapContext();var _4=(this.autoOffset&&(this.lineWidth==0||parseInt(this.lineWidth)%2)==1?0.5:0);try{_3.moveTo(_1+_4,_2+_4)}catch(e){this.logWarn("error on moveTo(): left: "+_1+", top: "+_2+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmArc:function(_1,_2,_3,_4,_5,_6){var _6=_6||this.drawPane.getBitmapContext();var _7=(this.autoOffset&&(this.lineWidth==0||parseInt(this.lineWidth)%2)==1?0.5:0);try{_6.arc(_1+_7,_2+_7,_3,_4,_5,false)}catch(e){this.logWarn("error on arc(): centerPointX: "+_1+", centerPointY: , radius: "+_3+", startRadian: "+_4+", endRadian: "+_5+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmLineTo:function(_1,_2,_3){var _3=_3||this.drawPane.getBitmapContext();var _4=(this.autoOffset&&(this.lineWidth==0||parseInt(this.lineWidth)%2)==1?0.5:0);try{_3.lineTo(_1+_4,_2+_4)}catch(e){this.logWarn("error on lineTo(): left: "+_1+", top: "+_2+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmQuadraticCurveTo:function(_1,_2,_3,_4){var _5=_5||this.drawPane.getBitmapContext();var _6=(this.autoOffset&&(this.lineWidth==0||parseInt(this.lineWidth)%2)==1?0.5:0);try{_5.quadraticCurveTo(_1+_6,_2+_6,_3+_6,_4+_6)}catch(e){this.logWarn("error on quadraticCurveTo(): x1: "+_1+", y1: "+_2+", x2: "+_3+", y2: "+_4+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmTranslate:function(_1,_2,_3){var _3=_3||this.drawPane.getBitmapContext();try{_3.translate(_1,_2)}catch(e){this.logWarn("error on translate(): left: "+_1+", top: "+_2+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmRotate:function(_1,_2){var _2=_2||this.drawPane.getBitmapContext();try{_2.rotate(_1)}catch(e){this.logWarn("error on translate(): angle: "+_1+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmFillText:function(_1,_2,_3,_4){var _4=_4||this.drawPane.getBitmapContext();try{_4.fillText(_1,_2,_3)}catch(e){this.logWarn("error on fillText(): text: "+_1+", left: "+_2+", top: "+_3+(this.logIsInfoEnabled()?this.getStackTrace():""))}},bmStrokeText:function(_1,_2,_3,_4){var _4=_4||this.drawPane.getBitmapContext();try{_4.strokeText(_1,_2,_3)}catch(e){this.logWarn("error on fillText(): text: "+_1+", left: "+_2+", top: "+_3+(this.logIsInfoEnabled()?this.getStackTrace():""))}}});isc.A=isc.DrawItem;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$44q=0;isc.A.$630=["show",,"Knobs"];isc.A.$631=["hide",,"Knobs"];isc.B.push(isc.A.$632=function isc_c_DrawItem__getShowKnobsFunctionName(_1,_2){if(!this.$633){this.$633={}}
if(this.$633[_1]==null){_1=_1.substring(0,1).toUpperCase()+_1.substring(1);this.$630[1]=_1;this.$631[1]=_1;this.$633[_1]=[this.$630.join(isc.emptyString),this.$631.join(isc.emptyString)]}
return _2?this.$633[_1][1]:this.$633[_1][0]},isc.A.registerEventStringMethods=function isc_c_DrawItem_registerEventStringMethods(){var _1=isc.EH;for(var _2 in _1.eventTypes){this.registerStringMethods(_1.eventTypes[_2],_1.$i3)}});isc.B._maxIndex=isc.C+2;isc.DrawItem.registerEventStringMethods();isc.defineClass("DrawGroup","DrawItem");isc.A=isc.DrawGroup.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.renderGroupElement=false;isc.A.useGroupRect=true;isc.A.left=0;isc.A.top=0;isc.A.width=1;isc.A.height=1;isc.A.vmlElementName="GROUP";isc.A.checkPointInPath=false;isc.B.push(isc.A.init=function isc_DrawGroup_init(){if(!this.drawItems)this.drawItems=[];for(var i=0;i<this.drawItems.length;i++){this.drawItems[i].drawGroup=this}
this.Super("init")},isc.A.erase=function isc_DrawGroup_erase(_1,_2){for(var i=0;i<this.drawItems.length;i++){this.drawItems[i].erase(true,_2)}
this.drawItems=[];this.Super("erase",arguments)},isc.A.removeDrawItem=function isc_DrawGroup_removeDrawItem(_1){if(_1.$if)_1.erase();else{this.drawItems.remove(_1)}
delete _1.drawGroup;delete _1.drawPane},isc.A.$44v=function isc_DrawGroup__getElementVML(_1){return isc.SB.concat(this.drawPane.startTagVML(this.vmlElementName)," onmousedown='return ",this.drawPane.getID(),".mouseDown();' "," ID='",_1,"' ",this.getAttributesVML(),">",this.drawPane.endTagVML(this.vmlElementName))},isc.A.getSvgString=function isc_DrawGroup_getSvgString(_1){_1=_1||isc.SVGStringConversionContext.create();var _2="<g id='isc_DrawItem_"+this.drawItemID+"' transform='translate("+this.left+","+this.top+")'";var _3=this.getAttributesSVG();if(_3)_2+=" "+_3;if(this.drawItems&&this.drawItems.length){_2+=">";for(var i=0;i<this.drawItems.length;++i){_2+=this.drawItems[i].getSvgString(_1)}
_2+="</g>"}else _2+="/>";return _2},isc.A.draw=function isc_DrawGroup_draw(){if(this.drawItems==null)this.drawItems=[];this.Super("draw",arguments);for(var i=0;i<this.drawItems.length;i++){this.drawItems[i].drawGroup=this;this.drawItems[i].draw()}},isc.A.drawHandle=function isc_DrawGroup_drawHandle(){if(!this.renderGroupElement)return;return this.Super("drawHandle",arguments)},isc.A.drawBitmap=function isc_DrawGroup_drawBitmap(_1){_1.save();_1.translate(this.left,this.top);for(var i=0;i<this.drawItems.length;i++){if(!this.drawItems[i].hidden)this.drawItems[i].drawBitmap(_1)}
_1.restore()},isc.A.setLineWidth=function isc_DrawGroup_setLineWidth(_1){this.logWarn("no setLineWidth")},isc.A.$44l=function isc_DrawGroup__setLineWidthVML(_1){this.logWarn("no $44l")},isc.A.setLineColor=function isc_DrawGroup_setLineColor(_1){this.logWarn("no setLineColor")},isc.A.setLineOpacity=function isc_DrawGroup_setLineOpacity(_1){this.logWarn("no setLineOpacity")},isc.A.setLinePattern=function isc_DrawGroup_setLinePattern(_1){this.logWarn("no setLinePattern")},isc.A.setLineCap=function isc_DrawGroup_setLineCap(_1){this.logWarn("no setLineCap")},isc.A.setStartArrow=function isc_DrawGroup_setStartArrow(_1){this.logWarn("no setStartArrow")},isc.A.setEndArrow=function isc_DrawGroup_setEndArrow(_1){this.logWarn("no setEndArrow")},isc.A.setFillColor=function isc_DrawGroup_setFillColor(_1){this.logWarn("no setFillColor")},isc.A.setFillOpacity=function isc_DrawGroup_setFillOpacity(_1){this.logWarn("no setFillOpacity")},isc.A.setLeft=function isc_DrawGroup_setLeft(_1){if(_1!=null)this.left=_1;if(this.renderGroupElement)this.setElementLeft(_1);if(this.item){var _2=this.getBoundingBox();this.item.x=_2[0];this.item.y=_2[1];this.item.width=Math.abs(_2[2]-_2[0]);this.item.height=Math.abs(_2[3]-_2[1]);this.drawPane.updateQuadTree(this)}},isc.A.setElementLeft=function isc_DrawGroup_setElementLeft(_1){if(this.drawingVML){this.$44u.coordorigin.x=-this.left}else if(this.drawingSVG){var _2="translate("+this.left+","+this.top+") "+(this.$44z.getAttributeNS(null,"transform")||"");this.$44z.setAttributeNS(null,"transform",_2)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},isc.A.setTop=function isc_DrawGroup_setTop(_1){if(_1!=null)this.top=_1;if(this.renderGroupElement)this.setElementTop(_1);if(this.item){var _2=this.getBoundingBox();this.item.x=_2[0];this.item.y=_2[1];this.item.width=Math.abs(_2[2]-_2[0]);this.item.height=Math.abs(_2[3]-_2[1]);this.drawPane.updateQuadTree(this)}},isc.A.setElementTop=function isc_DrawGroup_setElementTop(_1){if(this.drawingVML){this.$44u.coordorigin.y=-this.top}else if(this.drawingSVG){var _2="translate("+this.left+","+this.top+") "+(this.$44z.getAttributeNS(null,"transform")||"");this.$44z.setAttributeNS(null,"transform",_2)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},isc.A.setWidth=function isc_DrawGroup_setWidth(_1){this.width=_1;if(this.item){var _2=this.getBoundingBox();this.item.x=_2[0];this.item.y=_2[1];this.item.width=Math.abs(_2[2]-_2[0]);this.item.height=Math.abs(_2[3]-_2[1]);this.drawPane.updateQuadTree(this)}},isc.A.setHeight=function isc_DrawGroup_setHeight(_1){this.height=_1;if(this.item){var _2=this.getBoundingBox();this.item.x=_2[0];this.item.y=_2[1];this.item.width=Math.abs(_2[2]-_2[0]);this.item.height=Math.abs(_2[3]-_2[1]);this.drawPane.updateQuadTree(this)}},isc.A.getGroupRect=function isc_DrawGroup_getGroupRect(){return[this.left,this.top,this.width,this.height]},isc.A.moveTo=function isc_DrawGroup_moveTo(_1,_2){this.setLeft(_1);this.setTop(_2);if(this.renderGroupElement){this.setElementLeft(this.left);this.setElementTop(this.top)}
this.Super("moveTo",arguments)},isc.A.moveBy=function isc_DrawGroup_moveBy(_1,_2){this.left+=_1;this.top+=_2;if(this.renderGroupElement){this.setElementLeft(this.left);this.setElementTop(this.top)}
for(var i=0;i<this.drawItems.length;++i){var _4=this.drawItems[i];_4.moveBy(_1,_2)}
this.Super("moveBy",arguments);this.$105u(_1,_2)},isc.A.rotateTo=function isc_DrawGroup_rotateTo(_1){for(var i=0;i<this.drawItems.length;i++){var _3=this.drawItems[i];_3.rotateTo(_1)}},isc.A.rotateBy=function isc_DrawGroup_rotateBy(_1){for(var i=0;i<this.drawItems.length;++i){var _3=this.drawItems[i];_3.rotateBy(_1)}},isc.A.scaleBy=function isc_DrawGroup_scaleBy(_1,_2){for(var i=0;i<this.drawItems.length;++i){var _4=this.drawItems[i];_4.scaleBy(_1,_2)}},isc.A.getCenter=function isc_DrawGroup_getCenter(){return[this.left+Math.round(this.width/2),this.top+Math.round(this.height/2)]},isc.A.getBoundingBox=function isc_DrawGroup_getBoundingBox(){return[this.left,this.top,this.left+this.width,this.top+this.height]},isc.A.scaleTo=function isc_DrawGroup_scaleTo(_1,_2){this.scale=this.scale||[];this.scale[0]+=(this.scale[0]||0)+_1;this.scale[1]+=(this.scale[1]||0)+_2;this.scaleBy(_1,_2)});isc.B._maxIndex=isc.C+33;isc.defineClass("DrawLine","DrawItem");isc.A=isc.DrawLine.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.startPoint=[0,0];isc.A.endPoint=[100,100];isc.A.svgElementName="line";isc.A.vmlElementName="LINE";isc.B.push(isc.A.init=function isc_DrawLine_init(){this.startLeft=this.startLeft||this.startPoint[0];this.startTop=this.startTop||this.startPoint[1];this.endLeft=this.endLeft||this.endPoint[0];this.endTop=this.endTop||this.endPoint[1];this.Super("init")},isc.A.$45b=function isc_DrawLine__getArrowAdjustedPoints(){if(this.startArrow||this.endArrow){return isc.GraphMath.trimLineEnds(this.startLeft,this.startTop,this.endLeft,this.endTop,this.startArrow?this.lineWidth*3:0,this.endArrow?this.lineWidth*3:0)}else{return[this.startLeft,this.startTop,this.endLeft,this.endTop]}},isc.A.setLineWidth=function isc_DrawLine_setLineWidth(_1){this.Super("setLineWidth",arguments);if(this.drawingSVG)this.setStartPoint()},isc.A.setStartArrow=function isc_DrawLine_setStartArrow(_1){this.Super("setStartArrow",arguments);if(this.drawingSVG)this.setStartPoint()},isc.A.setEndArrow=function isc_DrawLine_setEndArrow(_1){this.Super("setEndArrow",arguments);if(this.drawingSVG)this.setEndPoint()},isc.A.getAttributesVML=function isc_DrawLine_getAttributesVML(){return isc.SB.concat("FROM='",this.startLeft," ",this.startTop,"' TO='",this.endLeft," ",this.endTop,"'")},isc.A.getAttributesSVG=function isc_DrawLine_getAttributesSVG(){var _1=this.$45b();return"x1='"+_1[0]+"' y1='"+_1[1]+"' x2='"+_1[2]+"' y2='"+_1[3]+"'"},isc.A.drawBitmapPath=function isc_DrawLine_drawBitmapPath(_1){var _2=(this.lineWidth==0||parseInt(this.lineWidth)%2)==1?0.5:0,_3=parseFloat(this.startLeft)+_2,_4=parseFloat(this.startTop)+_2,_5=parseFloat(this.endLeft)+_2,_6=parseFloat(this.endTop)+_2,_7,_8=10,_9,_10;if(this.startArrow=="open"){_1.save();_1.beginPath();_1.strokeStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_7=this.computeAngle(_3,_4,_5,_6);_9=_3;_10=_4;_1.scale(1,1);_1.translate(_9,_10);_1.rotate(_7*Math.PI/180);this.bmMoveTo(_8,-_8,_1);this.bmLineTo(0,0,_1);this.bmLineTo(_8,_8,_1);_1.stroke();_1.restore()}else if(this.startArrow=="block"){_1.save();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_7=this.computeAngle(_3,_4,_5,_6);_9=_3;_10=_4;_1.translate(_9,_10);_1.rotate(_7*Math.PI/180);this.bmMoveTo(_8,-_8,_1);this.bmLineTo(0,0,_1);this.bmLineTo(_8,_8,_1);_1.closePath();_1.fill();_1.stroke();_1.restore()}
if(this.endArrow=="open"){_1.save();_1.beginPath();_1.strokeStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_7=this.computeAngle(_3,_4,_5,_6);_9=_5;_10=_6;_1.translate(_9,_10);_1.rotate(_7*Math.PI/180);this.bmMoveTo(-_8,_8,_1);this.bmLineTo(0,0,_1);this.bmLineTo(-_8,-_8,_1);_1.stroke();_1.restore()}else if(this.endArrow=="block"){_1.save();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_7=this.computeAngle(_3,_4,_5,_6);_9=_5;_10=_6;_1.translate(_9,_10);_1.rotate(_7*Math.PI/180);this.bmMoveTo(-_8,_8,_1);this.bmLineTo(0,0,_1);this.bmLineTo(-_8,-_8,_1);_1.closePath();_1.fill();_1.restore()}
if(this.linePattern.toLowerCase()!=="solid"){this.$85x(_3,_4,_5,_6,_1)}else{this.bmMoveTo(this.startLeft,this.startTop,_1);this.bmLineTo(this.endLeft,this.endTop,_1)}},isc.A.setStartPoint=function isc_DrawLine_setStartPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null)this.startLeft=_1;if(_2!=null)this.startTop=_2;if(this.drawingVML){this.$44u.from=this.startLeft+" "+this.startTop}else if(this.drawingSVG){var _3=this.$45b();this.$44z.setAttributeNS(null,"x1",_3[0]);this.$44z.setAttributeNS(null,"y1",_3[1]);if(this.endArrow){this.$44z.setAttributeNS(null,"x2",_3[2]);this.$44z.setAttributeNS(null,"y2",_3[3])}}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.updateControlKnobs()},isc.A.setEndPoint=function isc_DrawLine_setEndPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null)this.endLeft=_1;if(_2!=null)this.endTop=_2;if(this.drawingVML){this.$44u.to=this.endLeft+" "+this.endTop}else if(this.drawingSVG){var _3=this.$45b();this.$44z.setAttributeNS(null,"x2",_3[2]);this.$44z.setAttributeNS(null,"y2",_3[3]);if(this.startArrow){this.$44z.setAttributeNS(null,"x1",_3[0]);this.$44z.setAttributeNS(null,"y1",_3[1])}}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.updateControlKnobs()},isc.A.getBoundingBox=function isc_DrawLine_getBoundingBox(){var _1=this.startPoint[0],_2=this.startPoint[1],_3=this.endPoint[0],_4=this.endPoint[1];var _5=Math.min(_1,_3),_6=Math.max(_1,_3),_7=Math.min(_2,_4),_8=Math.max(_2,_4);return[_5,_7,_6,_8]},isc.A.getCenter=function isc_DrawLine_getCenter(){return[this.startPoint[0]+Math.round((this.endPoint[0]-this.startPoint[0])/2),this.startPoint[1]+Math.round((this.endPoint[1]-this.startPoint[1])/2)]},isc.A.showStartPointKnobs=function isc_DrawLine_showStartPointKnobs(){this.$639=this.createAutoChild("startKnob",{_constructor:"DrawKnob",x:this.startLeft,y:this.startTop,drawPane:this.drawPane,autoDraw:true});this.observe(this.$639,"updatePoints","observer.setStartPoint(x,y)")},isc.A.hideStartPointKnobs=function isc_DrawLine_hideStartPointKnobs(){if(this.$639){this.$639.destroy();delete this.$639}},isc.A.showEndPointKnobs=function isc_DrawLine_showEndPointKnobs(){this.$64a=this.createAutoChild("endKnob",{_constructor:"DrawKnob",x:this.endLeft,y:this.endTop,drawPane:this.drawPane,autoDraw:true});this.observe(this.$64a,"updatePoints","observer.setEndPoint(x,y)")},isc.A.hideEndPointKnobs=function isc_DrawLine_hideEndPointKnobs(){if(this.$64a){this.$64a.destroy();delete this.$64a}},isc.A.moveBy=function isc_DrawLine_moveBy(_1,_2){this.startLeft+=_1;this.startTop+=_2;this.endLeft+=_1;this.endTop+=_2;this.startPoint[0]=this.startLeft;this.startPoint[1]=this.startTop;this.endPoint[0]=this.endLeft;this.endPoint[1]=this.endTop;if(this.drawingVML){this.$44u.from=this.startLeft+" "+this.startTop;this.$44u.to=this.endLeft+" "+this.endTop}else if(this.drawingSVG){var _3=this.$45b();this.$44z.setAttributeNS(null,"x1",_3[0]);this.$44z.setAttributeNS(null,"y1",_3[1]);this.$44z.setAttributeNS(null,"x2",_3[2]);this.$44z.setAttributeNS(null,"y2",_3[3])}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments)},isc.A.moveTo=function isc_DrawLine_moveTo(_1,_2){this.moveBy(_1-this.startLeft,_2-this.startTop)},isc.A.updateControlKnobs=function isc_DrawLine_updateControlKnobs(){this.Super("updateControlKnobs",arguments);if(this.$639){var _1=this.startLeft,_2=this.startTop,_3=this.drawPane.drawing2screen([_1,_2,0,0]);this.$639.setCenterPoint(_3[0],_3[1])}
if(this.$64a){var _1=this.endLeft,_2=this.endTop,_3=this.drawPane.drawing2screen([_1,_2,0,0]);this.$64a.setCenterPoint(_3[0],_3[1])}});isc.B._maxIndex=isc.C+19;isc.defineClass("DrawRect","DrawItem");isc.A=isc.DrawRect.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.left=0;isc.A.top=0;isc.A.width=100;isc.A.height=100;isc.A.rounding=0;isc.A.lineCap="butt";isc.A.svgElementName="rect";isc.A.vmlElementName="ROUNDRECT";isc.B.push(isc.A.getAttributesVML=function isc_DrawRect_getAttributesVML(){return isc.SB.concat("STYLE='position:absolute; left:",this.left,"px; top:",this.top,"px; width:",this.width,"px; height:",this.height,"px;'"," ARCSIZE='"+this.rounding/2+"'")},isc.A.getAttributesSVG=function isc_DrawRect_getAttributesSVG(){return"x='"+this.left+"' y='"+this.top+"' width='"+this.width+"' height='"+this.height+"'"+(this.rounding?" rx='"+(this.rounding*Math.min(this.width,this.height)/2)+"'":"")},isc.A.drawBitmapPath=function isc_DrawRect_drawBitmapPath(_1){if(this.rounding==0){this.bmMoveTo(this.left,this.top);if(this.linePattern.toLowerCase()!=="solid"){this.$85x(this.left,this.top,this.left+this.width,this.top,_1);this.$85x(this.left+this.width,this.top,this.left+this.width,this.top+this.height,_1);this.$85x(this.left+this.width,this.top+this.height,this.left,this.top+this.height,_1);this.$85x(this.left,this.top+this.height,this.left,this.top,_1)}else{this.bmLineTo(this.left+this.width,this.top);this.bmLineTo(this.left+this.width,this.top+this.height);this.bmLineTo(this.left,this.top+this.height);this.bmLineTo(this.left,this.top)}}else{var r=this.rounding*(Math.min(this.width,this.height)/2);this.bmMoveTo(this.left+r,this.top);this.bmLineTo(this.left+this.width-r,this.top);this.bmQuadraticCurveTo(this.left+this.width,this.top,this.left+this.width,this.top+r);this.bmLineTo(this.left+this.width,this.top+this.height-r);this.bmQuadraticCurveTo(this.left+this.width,this.top+this.height,this.left+this.width-r,this.top+this.height);this.bmLineTo(this.left+r,this.top+this.height);this.bmQuadraticCurveTo(this.left,this.top+this.height,this.left,this.top+this.height-r);this.bmLineTo(this.left,this.top+r);this.bmQuadraticCurveTo(this.left,this.top,this.left+r,this.top)}
_1.closePath()},isc.A.setCenter=function isc_DrawRect_setCenter(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null)_1=_1-Math.round(this.width/2);if(_2!=null)_2=_2-Math.round(this.height/2);this.moveTo(_1,_2)},isc.A.getCenter=function isc_DrawRect_getCenter(){return[this.left+Math.round(this.width/2),this.top+Math.round(this.height/2)]},isc.A.getBoundingBox=function isc_DrawRect_getBoundingBox(){return[this.left,this.top,this.left+this.width,this.top+this.height]},isc.A.moveBy=function isc_DrawRect_moveBy(_1,_2){this.left+=_1;this.top+=_2;if(this.drawingVML){this.$44u.style.left=this.left;this.$44u.style.top=this.top}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"x",this.left);this.$44z.setAttributeNS(null,"y",this.top)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments);this.$105u(_1,_2)},isc.A.moveTo=function isc_DrawRect_moveTo(_1,_2){this.moveBy(_1-this.left,_2-this.top)},isc.A.setLeft=function isc_DrawRect_setLeft(_1){this.moveTo(_1)},isc.A.setTop=function isc_DrawRect_setTop(_1){this.moveTo(null,_1)},isc.A.resizeTo=function isc_DrawRect_resizeTo(_1,_2){var _3=0,_4=0;if(_1!=null)_3=_1-this.width;if(_2!=null)_4=_2-this.height;this.resizeBy(_3,_4)},isc.A.resizeBy=function isc_DrawRect_resizeBy(_1,_2){if(_1!=null)this.width+=_1;if(_2!=null)this.height+=_2;if(this.drawingVML){this.$44u.style.width=this.width;this.$44u.style.height=this.height}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"width",this.width);this.$44z.setAttributeNS(null,"height",this.height)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("resizeBy",arguments);this.$5y(_1,_2)},isc.A.setWidth=function isc_DrawRect_setWidth(_1){this.resizeTo(_1)},isc.A.setHeight=function isc_DrawRect_setHeight(_1){this.resizeTo(null,_1)},isc.A.setRect=function isc_DrawRect_setRect(_1,_2,_3,_4){this.moveTo(_1,_2);this.resizeTo(_3,_4)},isc.A.setRounding=function isc_DrawRect_setRounding(_1){this.rounding=_1;if(this.drawingVML){this.erase();this.draw()}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"rx",(this.rounding?(this.rounding*Math.min(this.width,this.height)/2):null))}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}});isc.B._maxIndex=isc.C+16;isc.defineClass("DrawOval","DrawItem");isc.A=isc.DrawOval.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.left=0;isc.A.top=0;isc.A.width=100;isc.A.height=100;isc.A.svgElementName="ellipse";isc.A.vmlElementName="OVAL";isc.B.push(isc.A.init=function isc_DrawOval_init(){if(!this.radius)this.$63t();else this.$78s();this.Super("init")},isc.A.$78s=function isc_DrawOval__deriveRectFromRadius(){this.rx=this.rx||this.radius;this.ry=this.ry||this.radius;this.width=this.rx*2;this.height=this.ry*2;if(this.centerPoint!=null){this.left=this.centerPoint[0]-this.width/2;this.top=this.centerPoint[1]-this.height/2}else{this.centerPoint=[];this.centerPoint[0]=this.left+this.width/2;this.centerPoint[1]=this.top+this.height/2}},isc.A.$63t=function isc_DrawOval__deriveCenterPointFromRect(){this.centerPoint=[];this.centerPoint[0]=this.left+this.width/2;this.centerPoint[1]=this.top+this.height/2;this.rx=this.width/2;this.ry=this.height/2},isc.A.getAttributesVML=function isc_DrawOval_getAttributesVML(){return isc.SB.concat("STYLE='position:absolute;left:",this.left,"px;top:",this.top,"px;width:",this.width,"px;height:",this.height,"px;'")},isc.A.getAttributesSVG=function isc_DrawOval_getAttributesSVG(){return"cx='"+this.centerPoint[0]+"' cy='"+this.centerPoint[1]+"' rx='"+this.rx+"' ry='"+this.ry+"'"},isc.A.getBoundingBox=function isc_DrawOval_getBoundingBox(){return[this.left,this.top,this.left+this.width,this.top+this.height]},isc.A.drawBitmapPath=function isc_DrawOval_drawBitmapPath(_1){var _2=0.552284749831;var _3=this.rx;var _4=this.ry;var _5=this.centerPoint[0];var _6=this.centerPoint[1];_1.moveTo(_5,_6-_4);_1.bezierCurveTo(_5+(_2*_3),_6-_4,_5+_3,_6-(_2*_4),_5+_3,_6);_1.bezierCurveTo(_5+_3,_6+(_2*_4),_5+(_2*_3),_6+_4,_5,_6+_4);_1.bezierCurveTo(_5-(_2*_3),_6+_4,_5-_3,_6+(_2*_4),_5-_3,_6);_1.bezierCurveTo(_5-_3,_6-(_2*_4),_5-(_2*_3),_6-_4,_5,_6-_4);_1.closePath()},isc.A.setCenterPoint=function isc_DrawOval_setCenterPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
var _3=0,_4=0;if(_1!=null)_3=_1-this.centerPoint[0];if(_2!=null)_4=_2-this.centerPoint[1];this.moveBy(_3,_4)},isc.A.moveBy=function isc_DrawOval_moveBy(_1,_2){if(_1!=null)this.centerPoint[0]+=_1;if(_2!=null)this.centerPoint[1]+=_2;this.$78s();if(this.drawingVML){this.$44u.style.left=this.centerPoint[0]-this.rx;this.$44u.style.top=this.centerPoint[1]-this.ry}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"cx",this.centerPoint[0]);this.$44z.setAttributeNS(null,"cy",this.centerPoint[1])}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments);this.$105u(_1,_2)},isc.A.moveTo=function isc_DrawOval_moveTo(_1,_2){this.moveBy(_1-this.left,_2-this.top)},isc.A.setLeft=function isc_DrawOval_setLeft(_1){this.moveTo(_1)},isc.A.setTop=function isc_DrawOval_setTop(_1){this.moveTo(null,_1)},isc.A.resizeBy=function isc_DrawOval_resizeBy(_1,_2,_3){if(_1!=null)this.width+=_1;if(_2!=null)this.height+=_2;if(_3){if(_1!=null)this.left+=Math.round(_1/2);if(_2!=null)this.top+=Math.round(_2/2)}
this.$63t();if(this.drawingVML){this.$44u.style.width=this.width;this.$44u.style.height=this.height;if(_3){this.$44u.style.left=this.left;this.$44u.style.top=this.top}}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"rx",this.rx);this.$44z.setAttributeNS(null,"ry",this.ry);if(!_3){this.$44z.setAttributeNS(null,"cx",this.centerPoint[0]);this.$44z.setAttributeNS(null,"cy",this.centerPoint[1])}}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("resizeBy",arguments);this.$5y(_1,_2);if(_3)this.$105u(_1/2,_2/2)},isc.A.resizeTo=function isc_DrawOval_resizeTo(_1,_2,_3){var _4=0,_5=0;if(_1!=null)_4=_1-this.width;if(_2!=null)_5=_2-this.height;this.resizeBy(_4,_5,_3)},isc.A.setWidth=function isc_DrawOval_setWidth(_1){this.resizeTo(_1)},isc.A.setHeight=function isc_DrawOval_setHeight(_1){this.resizeTo(null,_1)},isc.A.setRect=function isc_DrawOval_setRect(_1,_2,_3,_4){this.moveTo(_1,_2);this.resizeTo(_3,_4)},isc.A.setRadii=function isc_DrawOval_setRadii(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
var _3,_4;if(_1!=null)_3=2*_1;if(_2!=null)_4=2*_2;this.resizeTo(_3,_4,true)},isc.A.setRadius=function isc_DrawOval_setRadius(_1){this.setRadii(_1,_1)},isc.A.setOval=function isc_DrawOval_setOval(_1,_2,_3,_4){this.setCenterPoint(_1,_2);this.setRadii(_3,_4)},isc.A.getCenter=function isc_DrawOval_getCenter(){return this.centerPoint.slice()});isc.B._maxIndex=isc.C+21;isc.defineClass("DrawSector","DrawItem");isc.A=isc.DrawSector.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.centerPoint=[0,0];isc.A.startAngle=0.0;isc.A.endAngle=20.0;isc.A.radius=100;isc.A.svgElementName="path";isc.A.vmlElementName="SHAPE";isc.B.push(isc.A.init=function isc_DrawSector_init(){this.Super("init")},isc.A.getBoundingBox=function isc_DrawSector_getBoundingBox(){return[this.centerPoint[0],this.centerPoint[1],this.centerPoint[0]+this.radius,this.centerPoint[1]+this.radius]},isc.A.getCenter=function isc_DrawSector_getCenter(){return this.centerPoint.slice()},isc.A.getAttributesVML=function isc_DrawSector_getAttributesVML(){var _1=-this.startAngle;var _2=this.endAngle-this.startAngle;var _3,_4,_5,_6;_3="0px";_4="0px";_5=this.drawPane.width;_6=this.drawPane.height;var _7="STYLE='position:absolute;top:"+_4+";left:"+_3+";width:"+_5+"px;height:"+_6+"px;' coordsize='"+_5+","+_6+"'";var _8="path='m"+Math.round(this.centerPoint[0])+","+Math.round(this.centerPoint[1]);_8+=" ae"+Math.round(this.centerPoint[0])+","+Math.round(this.centerPoint[1]);_8+=" "+Math.round(this.radius)+","+Math.round(this.radius)+" ";_8+=Math.round(_1*65536)+","+Math.round(-_2*65536)+" x e'";return _7+_8},isc.A.getAttributesSVG=function isc_DrawSector_getAttributesSVG(){return"d='"+this.getPathSVG()+"'"},isc.A.getPathSVG=function isc_DrawSector_getPathSVG(){var _1=this.endAngle-this.startAngle+1;var _2=_1*Math.PI/180.0;var _3=this.startAngle*Math.PI/180.0;var _4=this.radius;var _5=0.0;var _6=this.centerPoint[0]+_4*Math.cos(_3);var _7=this.centerPoint[1]+_4*Math.sin(_3);var _8=_4*Math.cos(_2);var _9=_4*Math.sin(_2);var _10=this.centerPoint[0]+_8*Math.cos(_3)-_9*Math.sin(_3);var _11=this.centerPoint[1]+_8*Math.sin(_3)+_9*Math.cos(_3);var _12="M"+this.centerPoint[0]+" "+this.centerPoint[1];_12+=" L"+_6+" "+_7;_12+=" A"+this.radius+" "+this.radius+" 0 "+(_1>179.99999?"1":"0")+" 1 ";_12+=_10+" "+_11+" Z";return _12},isc.A.drawBitmapPath=function isc_DrawSector_drawBitmapPath(_1){var _2=this.endAngle-this.startAngle+1;var _3=_2*Math.PI/180.0;var _4=this.startAngle*Math.PI/180.0;var _5=this.endAngle*Math.PI/180.0;var _6=this.startAngle*Math.PI/180.0;var _7=this.radius;var _8=0.0;var _9=this.centerPoint[0]+_7*Math.cos(_6);var _10=this.centerPoint[1]+_7*Math.sin(_6);var _11=_7*Math.cos(_3);var _12=_7*Math.sin(_3);var _13=this.centerPoint[0]+_11*Math.cos(_6)-_12*Math.sin(_6);var _14=this.centerPoint[1]+_11*Math.sin(_6)+_12*Math.cos(_6);this.bmMoveTo(this.centerPoint[0],this.centerPoint[1],_1);this.bmLineTo(_9,_10,_1);this.bmArc(this.centerPoint[0],this.centerPoint[1],this.radius,_4,_5,false);_1.closePath()},isc.A.setCenterPoint=function isc_DrawSector_setCenterPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
var _3=0,_4=0;if(_1!=null)_3=_1-this.centerPoint[0];if(_2!=null)_4=_2-this.centerPoint[1];this.moveBy(_3,_4)},isc.A.moveTo=function isc_DrawSector_moveTo(_1,_2){this.moveBy(_1-this.centerPoint[0],_2-this.centerPoint[1])},isc.A.moveBy=function isc_DrawSector_moveBy(_1,_2){this.centerPoint[0]+=_1;this.centerPoint[1]+=_2;if(this.drawingVML){this.$44u.path="m"+Math.round(this.centerPoint[0])+","+Math.round(this.centerPoint[1])+" ae"+Math.round(this.centerPoint[0])+","+Math.round(this.centerPoint[1])+" "+Math.round(this.radius)+","+Math.round(this.radius)+" "+Math.round(-this.startAngle*65535)+","+Math.round(-(this.endAngle-this.startAngle)*65536)+" x e'"}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"transform","translate("+_1+","+_2+")")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments);this.$105u()},isc.A.resizeBy=function isc_DrawSector_resizeBy(_1,_2){if(this.scale){this.scale[0]=_1;this.scale[1]=_2;if(this.drawingSVG){this.$44z.setAttributeNS(null,"transform","scale("+this.scale[0]+","+this.scale[1]+")")}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("resizeBy",arguments);this.$5y(_1,_2)}});isc.B._maxIndex=isc.C+11;isc.defineClass("DrawLabel","DrawItem");isc.A=isc.DrawLabel.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.left=0;isc.A.top=0;isc.A.alignment='start';isc.A.fontFamily="Tahoma";isc.A.fontSize=18;isc.A.fontWeight="bold";isc.A.fontStyle="normal";isc.B.push(isc.A.init=function isc_DrawLabel_init(){this.$44k=this.fontSize;this.Super("init")},isc.A.$44v=function isc_DrawLabel__getElementVML(_1){if(this.synchTextMove){return isc.SB.concat(this.drawPane.startTagVML('RECT')," ID='",_1,"' STYLE='position:absolute;left:",this.left,"px; top:",this.top,(this.alignment?"px; text-align:"+(this.alignment=="start"?"left":"right"):"px"),";'>",this.drawPane.startTagVML('TEXTBOX')," INSET='0px, 0px, 0px, 0px' STYLE='overflow:visible","; font-family:",this.fontFamily,"; font-size:",this.fontSize*this.drawPane.zoomLevel,"; font-weight:",this.fontWeight,"; font-style:",this.fontStyle,";'><NOBR>",this.contents,"</NOBR>",this.drawPane.endTagVML('TEXTBOX'),this.drawPane.endTagVML('RECT'))}else{var _2=this.drawPane.drawing2screen([this.left,this.top,0,0]);return isc.SB.concat("<DIV ID='",_1,"' STYLE='position:absolute; overflow:visible; width:1px; height:1px","; left:",_2[0]+this.drawPane.getLeftPadding(),"px; top:",_2[1]+this.drawPane.getTopPadding(),"px",(this.rotation?";writing-mode: tb-rl":""),"; font-family:",this.fontFamily,"; font-size:",(this.fontSize*this.drawPane.zoomLevel)+"px","; font-weight:",this.fontWeight,"; font-style:",this.fontStyle,";color:",this.lineColor,";'><NOBR>",this.contents,"</NOBR></DIV>")}},isc.A.getSvgString=function isc_DrawLabel_getSvgString(_1){_1=_1||isc.SVGStringConversionContext.create();var _2,_3=this.left,_4=this.top,_5=this.rotation,_6;if(!this.synchTextMove&&this.drawPane.drawingType=="vml"&&Math.abs(_5-270)<0.00001){_3-=this.fontSize;_4+=this.getTextHeight()}
var _7="<text id='isc_DrawItem_"+this.drawItemID+"' x='"+_3+"' y='"+(_1.printForExport!==false?_4+this.fontSize:_4)+"' dominant-baseline='text-before-edge' font-family='"+this.fontFamily+"' font-size='"+this.fontSize+"px' font-weight='"+this.fontWeight+"' font-style='"+this.fontStyle+"' fill='"+this.lineColor;if(_5&&(_6=this.getCenter())&&_6.length===2){_7+="' transform='rotate("+_5+" "+_3+" "+_4+")"}
_7+="'";_2=this.getAttributesSVG();if(_2)_7+=" "+_2;if(this.contents!=null){_7+=">"+isc.makeXMLSafe(String(this.contents))+"</text>"}else _7+="/>";return _7},isc.A.moveBy=function isc_DrawLabel_moveBy(_1,_2){this.top+=_2;this.left+=_1;if(this.drawingVML){this.$44u.style.left=this.left;this.$44u.style.top=this.top}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"x",this.left);this.$44z.setAttributeNS(null,"y",this.top)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments)},isc.A.moveTo=function isc_DrawLabel_moveTo(_1,_2){this.moveBy(_1-this.left,_2-this.top)},isc.A.rotateTo=function isc_DrawLabel_rotateTo(_1){this.rotateBy(_1-this.rotation)},isc.A.getCenter=function isc_DrawLabel_getCenter(){var _1,_2;if(this.drawingSVG&&!this.$44z){var _3=this.drawPane.measureLabel(this.contents,this);_1=_3.width;_2=_3.height}else{_1=this.getTextWidth();_2=this.getTextHeight()}
return[this.left+Math.round(_1/2),this.top+Math.round(_2/2)]},isc.A.getBoundingBox=function isc_DrawLabel_getBoundingBox(){var _1,_2;if(this.drawingSVG&&!this.$44z){var _3=this.drawPane.measureLabel(this.contents,this);_1=_3.width;_2=_3.height}else{_1=this.getTextWidth();_2=this.getTextHeight()}
return[this.left,this.top,this.left+_1,this.top+_2]},isc.A.makeHTMLText=function isc_DrawLabel_makeHTMLText(){var _1=this.$45c=isc.HTMLFlow.create({left:this.left,top:this.top,rotation:this.rotation,transformOrigin:"0 0",width:1,height:1,contents:isc.SB.concat("<span style='font-family:",this.fontFamily,";font-weight:",this.fontWeight,";font-size:",Math.round(this.fontSize*this.drawPane.zoomLevel),";font-style:",this.fontStyle,";color:",this.lineColor,";white-space:nowrap'>",this.contents,"</span>"),autoDraw:false});this.drawPane.addChild(_1)},isc.A.drawBitmap=function isc_DrawLabel_drawBitmap(_1){if(this.useHTML||isc.Browser.isIPhone){if(!this.$45c)this.makeHTMLText()}else{this.Super("drawBitmap",arguments)}},isc.A.erase=function isc_DrawLabel_erase(){if(this.$45c)this.$45c.destroy();this.Super("erase",arguments)},isc.A.destroy=function isc_DrawLabel_destroy(){if(this.$45c)this.$45c.destroy();this.Super("destroy",arguments)},isc.A.getFontString=function isc_DrawLabel_getFontString(){return(this.fontStyle!="normal"?this.fontStyle+" ":"")+(this.fontWeight!="normal"?this.fontWeight+" ":"")+this.fontSize+"px "+this.fontFamily},isc.A.$104w=function isc_DrawLabel__calculateAlignMiddleCorrection(){if(!(isc.Browser.isFirefox&&isc.Browser.hasCANVAS&&this.$104x)){return 0}else{var _1=this.drawPane.$104y;if(_1==null){_1=this.drawPane.$104y={}}
var _2=this.getFontString();if(_1.hasOwnProperty(_2)){return _1[_2]}
var _3=this.drawPane.$104v();_3.setContents("<CANVAS></CANVAS>");_3.redraw();var _4=_3.getHandle().getElementsByTagName("canvas")[0];var _5=_4.getContext("2d");_5.font=_2;var _6="The quick, brown fox",_7=_5.measureText(_6),_8=_7.width,_9=_7.height||this.fontSize;var _10=_5.canvas.width=Math.round(_8);var _11=_5.canvas.height=Math.round(3*_9);_5.textBaseline="middle";_5.font=_2;_5.fillText(_6,_9,0);var _12=_5.getImageData(0,0,_10,_11),_13=_12.data;var _14=0;for(var i=_13.length-4;i>0;i-=4){if(_13[i+3]){_14=Math.floor(i/(4*_10))-_9;break}}
_5.clearRect(0,0,_10,_11);_5.textBaseline="hanging";_5.font=_2;_5.fillText(_6,_9,0);_12=_5.getImageData(0,0,_10,_11);_13=_12.data;var _16=0;for(var i=_13.length-4;i>0;i-=4){if(_13[i+3]){_16=Math.floor(i/(4*_10))-_9;break}};var _17=0;for(var i=0,_18=_13.length;i<_18;i+=4){if(_13[i+3]){_17=Math.floor(i/(4*_10))-_9}}
var _19=_16-_17;return(_1[_2]=-Math.round((_19-(_16-_14))/2))}},isc.A.drawBitmapPath=function isc_DrawLabel_drawBitmapPath(_1){_1.textBaseline="top";_1.font=this.getFontString();if(isNaN(this.top))this.top=0;this.bmTranslate(this.left,this.top+this.$104w(),_1);if(this.rotation){this.bmRotate((this.rotation/180)*Math.PI,_1)}
if(this.backgroundColor){_1.fillStyle=this.backgroundColor;_1.globalAlpha=this.fillOpacity;_1.beginPath();var _2=0,_3=this.getTextWidth(),_4=0,_5=this.getTextHeight();this.bmMoveTo(_2,_4);this.bmLineTo(_3,_4);this.bmLineTo(_3,_5);this.bmLineTo(_2,_5);this.bmLineTo(_2,_4);_1.fill()}
_1.fillStyle=this.lineColor;_1.textAlign=this.alignment;this.bmFillText(this.contents,0,0,_1)},isc.A.getTextWidth=function isc_DrawLabel_getTextWidth(){if(this.drawingVML){if(this.synchTextMove){return this.$44u.firstChild.scrollWidth}else{return this.$44u.scrollWidth}}else if(this.drawingSVG){if(this.$44z)return this.$44z.getComputedTextLength();else this.drawPane.measureLabel(this.contents,this).width}else if(this.drawingBitmap){var _1=this.drawPane.getBitmapContext();_1.font=_1.font||this.getFontString();return _1.measureText(this.contents).width}},isc.A.getTextHeight=function isc_DrawLabel_getTextHeight(){if(this.drawingVML){if(this.synchTextMove){return this.$44u.firstChild.scrollHeight}else{return this.$44u.scrollHeight}}else if(this.drawingSVG){if(this.$44z)return this.$44z.getBBox().height;else this.drawPane.measureLabel(this.contents,this).height}else if(this.drawingBitmap){var _1=this.drawPane.getBitmapContext();_1.font=_1.font||this.getFontString();return _1.measureText(this.contents).height||this.fontSize}},isc.A.setFontSize=function isc_DrawLabel_setFontSize(_1){if(_1!=null)this.fontSize=_1;if(this.drawingVML){this.$44j.fontSize=this.fontSize*this.drawPane.zoomLevel}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"font-size",this.fontSize)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},isc.A.setLineWidth=function isc_DrawLabel_setLineWidth(_1){this.logWarn("no setLineWidth")},isc.A.$44l=function isc_DrawLabel__setLineWidthVML(_1){this.logWarn("no $44l")},isc.A.setLineColor=function isc_DrawLabel_setLineColor(_1){this.logWarn("no setLineColor")},isc.A.setLineOpacity=function isc_DrawLabel_setLineOpacity(_1){this.logWarn("no setLineOpacity")},isc.A.setLinePattern=function isc_DrawLabel_setLinePattern(_1){this.logWarn("no setLinePattern")},isc.A.setLineCap=function isc_DrawLabel_setLineCap(_1){this.logWarn("no setLineCap")},isc.A.setStartArrow=function isc_DrawLabel_setStartArrow(_1){this.logWarn("no setStartArrow")},isc.A.setEndArrow=function isc_DrawLabel_setEndArrow(_1){this.logWarn("no setEndArrow")},isc.A.setFillColor=function isc_DrawLabel_setFillColor(_1){this.logWarn("no setFillColor")},isc.A.setFillOpacity=function isc_DrawLabel_setFillOpacity(_1){this.logWarn("no setFillOpacity")});isc.B._maxIndex=isc.C+28;isc.defineClass("DrawImage","DrawItem");isc.A=isc.DrawImage.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.left=0;isc.A.top=0;isc.A.width=16;isc.A.height=16;isc.A.src="blank.png";isc.A.image=null;isc.A.checkPointInPath=false;isc.B.push(isc.A.getBoundingBox=function isc_DrawImage_getBoundingBox(){return[this.left,this.top,this.left+this.width,this.top+this.height]},isc.A.init=function isc_DrawImage_init(){this.Super("init");this.initImage(this.src)},isc.A.initImage=function isc_DrawImage_initImage(_1){if(_1){this.src=this.getSrcURL(_1);this.image=new Image();var _2=this;this.image.onload=function(){if(!_2.$if)_2.draw();else _2.drawBitmap(_2.drawPane.getBitmapContext())}
this.image.src=this.src}},isc.A.getSrcURL=function isc_DrawImage_getSrcURL(_1){var _2=isc.Canvas.getImgURL(_1);return _2},isc.A.$44v=function isc_DrawImage__getElementVML(_1){var _2=isc.SB.concat(this.drawPane.startTagVML('IMAGE')," ID='",_1,"' SRC='",this.getSrcURL(this.src),(this.title?"' ALT='"+this.title:""),"' STYLE='left:",this.left,"px; top:",this.top,"px; width:",this.width,"px; height:",this.height,"px;'>",this.drawPane.endTagVML("IMAGE"));return _2},isc.A.getSvgString=function isc_DrawImage_getSvgString(_1){var _2;var _3="<image id='isc_DrawItem_"+this.drawItemID;if(this.rotation&&(_2=this.getCenter())&&_2.length===2){_3+="' transform='rotate("+this.rotation+" "+_2[0]+" "+_2[1]+")"}
_3+="' x='"+this.left+"' y='"+this.top+"' width='"+this.width+"px' height='"+this.height+"px' "+(_1?_1.xlinkPrefix||isc.SVGStringConversionContext.$99a:isc.SVGStringConversionContext.$99a)+":href='"+this.getSrcURL(this.src)+"'";var _4=this.getAttributesSVG();if(_4)_3+=" "+_4;if(this.title){_3+="><title>"+isc.makeXMLSafe(this.title)+"</title></image>"}else _3+="/>";return _3},isc.A.drawBitmapPath=function isc_DrawImage_drawBitmapPath(_1){_1.drawImage(this.image,this.left,this.top,this.width,this.height)},isc.A.getCenter=function isc_DrawImage_getCenter(){return[this.left+Math.round(this.width/2),this.top+Math.round(this.height/2)]},isc.A.setSrc=function isc_DrawImage_setSrc(_1){this.initImage(_1);if(this.drawingVML){this.$44u.src=this.src}else if(this.drawingSVG){this.$44z.setAttributeNS(isc.$100f,"href",this.src)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},isc.A.setLineWidth=function isc_DrawImage_setLineWidth(_1){this.logWarn("no setLineWidth")},isc.A.$44l=function isc_DrawImage__setLineWidthVML(_1){this.logWarn("no $44l")},isc.A.setLineColor=function isc_DrawImage_setLineColor(_1){this.logWarn("no setLineColor")},isc.A.setLineOpacity=function isc_DrawImage_setLineOpacity(_1){this.logWarn("no setLineOpacity")},isc.A.setLinePattern=function isc_DrawImage_setLinePattern(_1){this.logWarn("no setLinePattern")},isc.A.setLineCap=function isc_DrawImage_setLineCap(_1){this.logWarn("no setLineCap")},isc.A.setStartArrow=function isc_DrawImage_setStartArrow(_1){this.logWarn("no setStartArrow")},isc.A.setEndArrow=function isc_DrawImage_setEndArrow(_1){this.logWarn("no setEndArrow")},isc.A.setFillColor=function isc_DrawImage_setFillColor(_1){this.logWarn("no setFillColor")},isc.A.setFillOpacity=function isc_DrawImage_setFillOpacity(_1){this.logWarn("no setFillOpacity")},isc.A.moveBy=function isc_DrawImage_moveBy(_1,_2){this.left+=_1;this.top+=_2;if(this.drawingVML){this.$44u.style.left=this.left;this.$44u.style.top=this.top}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"x",this.left);this.$44z.setAttributeNS(null,"y",this.top)}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments);this.$105u(_1,_2)},isc.A.moveTo=function isc_DrawImage_moveTo(_1,_2){this.moveBy(_1-this.left,_2-this.top)});isc.B._maxIndex=isc.C+21;isc.defineClass("DrawCurve","DrawItem");isc.A=isc.DrawCurve.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.startPoint=[0,0];isc.A.endPoint=[100,100];isc.A.controlPoint1=[100,0];isc.A.controlPoint2=[0,100];isc.A.svgElementName="path";isc.A.vmlElementName="curve";isc.A.lineCap="butt";isc.B.push(isc.A.init=function isc_DrawCurve_init(){this.Super("init")},isc.A.$636=function isc_DrawCurve__getKnobPosition(_1){var x,y;x=this.endPoint[0]-this.startPoint[0];y=this.endPoint[1]-this.startPoint[1];return[x,y]},isc.A.getCenter=function isc_DrawCurve_getCenter(){return[this.startPoint[0]+Math.round((this.endPoint[0]-this.startPoint[0])/2),this.startPoint[1]+Math.round((this.endPoint[1]-this.startPoint[1])/2)]},isc.A.getAttributesVML=function isc_DrawCurve_getAttributesVML(){return isc.SB.concat("FROM='",this.startPoint[0]," ",this.startPoint[1],"' TO='",this.endPoint[0]," ",this.endPoint[1],"' CONTROL1='",this.controlPoint1[0]," ",this.controlPoint1[1],"' CONTROL2='",this.controlPoint2[0]," ",this.controlPoint2[1],"'")},isc.A.getAttributesSVG=function isc_DrawCurve_getAttributesSVG(){return"d='"+this.getPathSVG()+"'"},isc.A.getPathSVG=function isc_DrawCurve_getPathSVG(){return"M"+this.startPoint[0]+" "+this.startPoint[1]+"C"+this.controlPoint1[0]+" "+this.controlPoint1[1]+" "+this.controlPoint2[0]+" "+this.controlPoint2[1]+" "+this.endPoint[0]+" "+this.endPoint[1]},isc.A.lerp=function isc_DrawCurve_lerp(_1,_2,_3){var _4=[];_4.push(_1[0]+(_2[0]-_1[0])*_3);_4.push(_1[1]+(_2[1]-_1[1])*_3);return _4},isc.A.bezier=function isc_DrawCurve_bezier(_1,_2){var _3,_4,_5,_6,_7;_3=this.lerp(_1[0],_1[1],_2);_4=this.lerp(_1[1],_1[2],_2);_5=this.lerp(_1[2],_1[3],_2);_6=this.lerp(_3,_4,_2);_7=this.lerp(_4,_5,_2);return this.lerp(_6,_7,_2)},isc.A.computeBezierPoint=function isc_DrawCurve_computeBezierPoint(_1){var _2=[];_2.push([this.startPoint[0],this.startPoint[1]]);_2.push([this.controlPoint1[0],this.controlPoint1[1]]);_2.push([this.controlPoint2[0],this.controlPoint2[1]]);_2.push([this.endPoint[0],this.endPoint[1]]);return this.bezier(_2,_1)},isc.A.drawBitmapPath=function isc_DrawCurve_drawBitmapPath(_1){var _2,_3,_4,_5,_6=10;if(this.startArrow=="open"){_1.save();_1.beginPath();_1.strokeStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_2=this.computeBezierPoint(0.01);_3=this.computeAngle(this.startPoint[0],this.startPoint[1],_2[0],_2[1]);_4=this.startPoint[0];_5=this.startPoint[1];_1.scale(1,1);_1.translate(_4,_5);_1.rotate(_3*Math.PI/180);this.bmMoveTo(_6,-_6,_1);this.bmLineTo(0,0,_1);this.bmLineTo(_6,_6,_1);_1.stroke();_1.restore()}else if(this.startArrow=="block"){_1.save();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_2=this.computeBezierPoint(0.01);_3=this.computeAngle(this.startPoint[0],this.startPoint[1],_2[0],_2[1]);_4=this.startPoint[0];_5=this.startPoint[1];_1.translate(_4,_5);_1.rotate(_3*Math.PI/180);this.bmMoveTo(_6,-_6,_1);this.bmLineTo(0,0,_1);this.bmLineTo(_6,_6,_1);_1.closePath();_1.fill();_1.stroke();_1.restore()}
if(this.endArrow=="open"){_1.save();_1.beginPath();_1.strokeStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_2=this.computeBezierPoint(0.99);_3=this.computeAngle(_2[0],_2[1],this.endPoint[0],this.endPoint[1]);_4=this.endPoint[0];_5=this.endPoint[1];_1.translate(_4,_5);_1.rotate(_3*Math.PI/180);this.bmMoveTo(-_6,_6,_1);this.bmLineTo(0,0,_1);this.bmLineTo(-_6,-_6,_1);_1.stroke();_1.restore()}else if(this.endArrow=="block"){_1.save();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_2=this.computeBezierPoint(0.99);_3=this.computeAngle(_2[0],_2[1],this.endPoint[0],this.endPoint[1]);_4=this.endPoint[0];_5=this.endPoint[1];_1.translate(_4,_5);_1.rotate(_3*Math.PI/180);this.bmMoveTo(-_6,_6,_1);this.bmLineTo(0,0,_1);this.bmLineTo(-_6,-_6,_1);_1.closePath();_1.fill();_1.restore()}
_1.moveTo(this.startPoint[0],this.startPoint[1]);_1.bezierCurveTo(this.controlPoint1[0],this.controlPoint1[1],this.controlPoint2[0],this.controlPoint2[1],this.endPoint[0],this.endPoint[1])},isc.A.setStartPoint=function isc_DrawCurve_setStartPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null)this.startPoint[0]=_1;if(_2!=null)this.startPoint[1]=_2;if(this.drawingVML){this.$44u.from=this.startPoint[0]+" "+this.startPoint[1]}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.updateControlKnobs()},isc.A.setEndPoint=function isc_DrawCurve_setEndPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null)this.endPoint[0]=_1;if(_2!=null)this.endPoint[1]=_2;if(this.drawingVML){this.$44u.to=this.endPoint[0]+" "+this.endPoint[1]}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.updateControlKnobs()},isc.A.setControlPoint1=function isc_DrawCurve_setControlPoint1(_1,_2){if(_1!=null)this.controlPoint1[0]=_1;if(_2!=null)this.controlPoint1[1]=_2;if(this.drawingVML){this.$44u.control1=this.controlPoint1[0]+" "+this.controlPoint1[1]}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.updateControlKnobs()},isc.A.setControlPoint2=function isc_DrawCurve_setControlPoint2(_1,_2){if(_1!=null)this.controlPoint2[0]=_1;if(_2!=null)this.controlPoint2[1]=_2;if(this.drawingVML){this.$44u.control2=this.controlPoint2[0]+" "+this.controlPoint2[1]}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.updateControlKnobs()},isc.A.getBoundingBox=function isc_DrawCurve_getBoundingBox(){var _1=this.startPoint[0],_2=this.startPoint[1],_3=this.endPoint[0],_4=this.endPoint[1];var _5=Math.min(_1,_3),_6=Math.max(_1,_3),_7=Math.min(_2,_4),_8=Math.max(_2,_4);return[_5,_7,_6,_8]},isc.A.showStartPointKnobs=function isc_DrawCurve_showStartPointKnobs(){this.$639=this.createAutoChild("startKnob",{_constructor:"DrawKnob",x:this.startPoint[0],y:this.startPoint[1],drawPane:this.drawPane,autoDraw:true});this.observe(this.$639,"updatePoints","observer.setStartPoint(x,y)")},isc.A.hideStartPointKnobs=function isc_DrawCurve_hideStartPointKnobs(){if(this.$639){this.$639.destroy();delete this.$639}},isc.A.showEndPointKnobs=function isc_DrawCurve_showEndPointKnobs(){this.$64a=this.createAutoChild("endKnob",{_constructor:"DrawKnob",x:this.endPoint[0],y:this.endPoint[1],drawPane:this.drawPane,autoDraw:true});this.observe(this.$64a,"updatePoints","observer.setEndPoint(x,y)")},isc.A.hideEndPointKnobs=function isc_DrawCurve_hideEndPointKnobs(){if(this.$64a){this.$64a.destroy();delete this.$64a}},isc.A.showControlPoint1Knobs=function isc_DrawCurve_showControlPoint1Knobs(){this.$64b=this.createAutoChild("c1Knob",{_constructor:"DrawKnob",x:this.controlPoint1[0],y:this.controlPoint1[1],drawPane:this.drawPane,autoDraw:true});this.$64c=this.createAutoChild("c1Line",{_constructor:"DrawLine",startLeft:this.startPoint[0],startTop:this.startPoint[1],endLeft:this.controlPoint1[0],endTop:this.controlPoint1[1],drawPane:this.drawPane,autoDraw:true});this.observe(this.$64b,"updatePoints","observer.setControlPoint1(x,y)")},isc.A.hideControlPoint1Knobs=function isc_DrawCurve_hideControlPoint1Knobs(){if(this.$64b){this.$64b.destroy();delete this.$64b}
if(this.$64c){this.$64c.erase();delete this.$64c}},isc.A.showControlPoint2Knobs=function isc_DrawCurve_showControlPoint2Knobs(){this.$64d=this.createAutoChild("c2Knob",{_constructor:"DrawKnob",x:this.controlPoint2[0],y:this.controlPoint2[1],drawPane:this.drawPane,autoDraw:true});this.$64e=this.createAutoChild("c2Line",{_constructor:"DrawLine",startLeft:this.endPoint[0],startTop:this.endPoint[1],endLeft:this.controlPoint2[0],endTop:this.controlPoint2[1],drawPane:this.drawPane,autoDraw:true});this.observe(this.$64d,"updatePoints","observer.setControlPoint2(x,y)")},isc.A.hideControlPoint2Knobs=function isc_DrawCurve_hideControlPoint2Knobs(){if(this.$64d){this.$64d.destroy();delete this.$64d}
if(this.$64e){this.$64e.erase();delete this.$64e}},isc.A.updateControlKnobs=function isc_DrawCurve_updateControlKnobs(){this.Super("updateControlKnobs",arguments);if(this.$639||this.$64c){var _1=this.startPoint[0],_2=this.startPoint[1];if(this.$64c)this.$64c.setStartPoint(_1,_2);if(this.$639){var _3=this.drawPane.drawing2screen([_1,_2,0,0]);this.$639.setCenterPoint(_3[0],_3[1])}}
if(this.$64a||this.$64e){var _1=this.endPoint[0],_2=this.endPoint[1];if(this.$64e)this.$64e.setStartPoint(_1,_2);if(this.$64a){var _3=this.drawPane.drawing2screen([_1,_2,0,0]);this.$64a.setCenterPoint(_3[0],_3[1])}}
if(this.$64b){var _1=this.controlPoint1[0],_2=this.controlPoint1[1];this.$64c.setEndPoint(_1,_2);var _3=this.drawPane.drawing2screen([_1,_2,0,0]);this.$64b.setCenterPoint(_3[0],_3[1])}
if(this.$64d){var _1=this.controlPoint2[0],_2=this.controlPoint2[1];this.$64e.setEndPoint(_1,_2);var _3=this.drawPane.drawing2screen([_1,_2,0,0]);this.$64d.setCenterPoint(_3[0],_3[1])}},isc.A.moveTo=function isc_DrawCurve_moveTo(_1,_2){this.moveBy(_1-this.startPoint[0],_2-this.startPoint[1])},isc.A.moveBy=function isc_DrawCurve_moveBy(_1,_2){this.startPoint[0]+=_1;this.startPoint[1]+=_2;this.controlPoint1[0]+=_1;this.controlPoint1[1]+=_2;this.controlPoint2[0]+=_1;this.controlPoint2[1]+=_2;this.endPoint[0]+=_1;this.endPoint[1]+=_2;if(this.drawingVML){this.$44u.from=this.startPoint[0]+" "+this.startPoint[1];this.$44u.to=this.endPoint[0]+" "+this.endPoint[1];this.$44u.control1=this.controlPoint1[0]+" "+this.controlPoint1[1];this.$44u.control2=this.controlPoint2[0]+" "+this.controlPoint2[1]}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}
this.Super("moveBy",arguments);this.$105u(_1,_2)});isc.B._maxIndex=isc.C+26;isc.defineClass("DrawBlockConnector","DrawCurve");isc.A=isc.DrawBlockConnector.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.startPoint=[0,0];isc.A.endPoint=[100,100];isc.A.controlPoint1=[100,0];isc.A.controlPoint2=[0,100];isc.A.svgElementName="path";isc.A.vmlElementName="curve";isc.B.push(isc.A.init=function isc_DrawBlockConnector_init(){this.Super("init")},isc.A.getAttributesVML=function isc_DrawBlockConnector_getAttributesVML(){return"FROM='"+this.startPoint[0]+" "+this.startPoint[1]+"' TO='"+this.endPoint[0]+" "+this.endPoint[1]+"' CONTROL1='"+this.controlPoint1[0]+" "+this.controlPoint1[1]+"' CONTROL2='"+this.controlPoint2[0]+" "+this.controlPoint2[1]+"'"},isc.A.getAttributesSVG=function isc_DrawBlockConnector_getAttributesSVG(){return"d='"+this.getPathSVG()+"'"},isc.A.setStartPoint=function isc_DrawBlockConnector_setStartPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null)this.startPoint[0]=_1;if(_2!=null)this.startPoint[1]=_2;if(this.drawingVML){this.$44u.from=this.startPoint[0]+" "+this.startPoint[1]}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}});isc.B._maxIndex=isc.C+4;isc.defineClass("DrawPath","DrawItem");isc.A=isc.DrawPath.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.svgElementName="polyline";isc.A.vmlElementName="POLYLINE";isc.A.points=[[0,0],[100,100]];isc.B.push(isc.A.init=function isc_DrawPath_init(){this.Super("init",arguments)},isc.A.getBoundingBox=function isc_DrawPath_getBoundingBox(){var _1=this.points[0],_2=[_1[0],_1[1]],_3=[_1[0],_1[1]],i;for(i=1;i<this.points.length;++i){_1=this.points[i];_2[0]=Math.min(_2[0],_1[0]);_2[1]=Math.min(_2[1],_1[1]);_3[0]=Math.max(_3[0],_1[0]);_3[1]=Math.max(_3[1],_1[1])}
return[].concat(_2,_3)},isc.A.getPathSVG=function isc_DrawPath_getPathSVG(){var _1="M ",i,_3=this.points[0];_1+=_3[0]+" "+_3[1]+" ";for(i=1;i<this.points.length;++i){_3=this.points[i];_1+=" L "+_3[0]+" "+_3[1]}
return _1},isc.A.getAttributesSVG=function isc_DrawPath_getAttributesSVG(){var _1=this.getPointsText();return"points='"+_1+"'"},isc.A.getPointsText=function isc_DrawPath_getPointsText(){var _1=isc.SB.create(),_2=this.points;for(var i=0;i<_2.length;i++){_1.append(_2[i][0]," ",_2[i][1]);if(i<_2.length-1)_1.append(" ")}
return _1.toString()},isc.A.getAttributesVML=function isc_DrawPath_getAttributesVML(){return isc.SB.concat("STYLE='position:absolute; left:",this.left,"px; top:",this.top,"px; width:",this.width,"px; height:",this.height,"px;'"," POINTS='"+this.getPointsText()+"'")},isc.A.drawBitmapPath=function isc_DrawPath_drawBitmapPath(_1){var _2=this.points,_3,_4=10,_5=_2.length-1,_6,_7;if(this.startArrow=="open"){_1.save();_1.beginPath();_1.strokeStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_3=this.computeAngle(_2[0][0],_2[0][1],_2[1][0],_2[1][1]);_6=_2[0][0];_7=_2[0][1];_1.scale(1,1);_1.translate(_6,_7);_1.rotate(_3*Math.PI/180);this.bmMoveTo(_4,-_4,_1);this.bmLineTo(0,0,_1);this.bmLineTo(_4,_4,_1);_1.stroke();_1.restore()}else if(this.startArrow=="block"){_1.save();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_3=this.computeAngle(_2[0][0],_2[0][1],_2[1][0],_2[1][1]);_6=_2[0][0];_7=_2[0][1];_1.translate(_6,_7);_1.rotate(_3*Math.PI/180);this.bmMoveTo(_4,-_4,_1);this.bmLineTo(0,0,_1);this.bmLineTo(_4,_4,_1);_1.closePath();_1.fill();_1.stroke();_1.restore()}
if(this.endArrow=="open"){_1.save();_1.beginPath();_1.strokeStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_3=this.computeAngle(_2[_5-1][0],_2[_5-1][1],_2[_5][0],_2[_5][1]);_6=_2[_5][0];_7=_2[_5][1];_1.translate(_6,_7);_1.rotate(_3*Math.PI/180);this.bmMoveTo(-_4,_4,_1);this.bmLineTo(0,0,_1);this.bmLineTo(-_4,-_4,_1);_1.stroke();_1.restore()}else if(this.endArrow=="block"){_1.save();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth=this.lineWidth;_1.lineCap="round";_3=this.computeAngle(_2[_5-1][0],_2[_5-1][1],_2[_5][0],_2[_5][1]);_6=_2[_5][0];_7=_2[_5][1];_1.translate(_6,_7);_1.rotate(_3*Math.PI/180);this.bmMoveTo(-_4,_4,_1);this.bmLineTo(0,0,_1);this.bmLineTo(-_4,-_4,_1);_1.closePath();_1.fill();_1.restore()}
this.bmMoveTo(_2[0][0],_2[0][1],_1);for(var i=1;i<_2.length;i++){var _9=_2[i];if(this.linePattern.toLowerCase()!=="solid"){this.$85x(_2[i-1][0],_2[i-1][1],_2[i][0],_2[i][1],_1)}else{this.bmLineTo(_9[0],_9[1],_1)}}},isc.A.getCenter=function isc_DrawPath_getCenter(){var _1,i,x=0,y=0,_5=this.points.length;for(i=0;i<_5;++i){_1=this.points[i];x+=_1[0];y+=_1[1]}
x=Math.round(x/_5);y=Math.round(y/_5);return[x,y]},isc.A.setPoints=function isc_DrawPath_setPoints(_1){this.points=_1;if(this.drawingVML){this.$44u.points.value=this.getPointsText()}else if(this.drawingSVG){this.$44z.setAttributeNS(null,"d",this.getPathSVG())}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}},isc.A.moveTo=function isc_DrawPath_moveTo(_1,_2){var _3=_1-this.points[0][0];var _4=_2-this.points[0][1];this.moveBy(_3,_4)},isc.A.moveBy=function isc_DrawPath_moveBy(_1,_2){if(this.getClass().getClassName()!=='DrawLinePath'){var _3,_4=this.points.length;for(var i=0;i<_4;++i){_3=this.points[i];_3[0]+=_1;_3[1]+=_2}
if(this.drawingVML){this.$44u.points.value=this.getPointsText()}else if(this.drawingBitmap){this.drawPane.redrawBitmap()}}
this.Super("moveBy",arguments)});isc.B._maxIndex=isc.C+11;isc.defineClass("DrawPolygon","DrawPath");isc.A=isc.DrawPolygon.getPrototype();isc.A.lineCap="butt";isc.A.svgElementName="path";isc.A.vmlElementName="POLYLINE";isc.A.points=[[0,0],[50,50],[100,0]];isc.A=isc.DrawPolygon.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_DrawPolygon_init(){this.Super("init")},isc.A.getPointsText=function isc_DrawPolygon_getPointsText(){var _1=isc.SB.create(),_2=this.points;for(var i=0;i<_2.length;i++){_1.append(_2[i][0]," ",_2[i][1]," ")}
_1.append(_2[0][0]," ",_2[0][1]);return _1.toString()},isc.A.getPathSVG=function isc_DrawPolygon_getPathSVG(){return this.Super("getPathSVG",arguments)+" Z"},isc.A.getAttributesSVG=function isc_DrawPolygon_getAttributesSVG(){return"d='"+this.getPathSVG()+"'"},isc.A.drawBitmapPath=function isc_DrawPolygon_drawBitmapPath(_1){var _2=this.points;this.bmMoveTo(_2[0][0],_2[0][1],_1);for(var i=1;i<_2.length;i++){var _4=_2[i];this.bmLineTo(_4[0],_4[1],_1)}
_1.closePath()});isc.B._maxIndex=isc.C+5;isc.defineClass("DrawTriangle","DrawPolygon");isc.defineClass("DrawLinePath","DrawPath");isc.A=isc.DrawLinePath.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.startPoint=[0,0];isc.A.endPoint=[100,100];isc.A.tailSize=30;isc.A.startArrow=null;isc.A.endArrow="open";isc.A.showStartPointKnobs=isc.DrawLine.getPrototype().showStartPointKnobs;isc.A.hideStartPointKnobs=isc.DrawLine.getPrototype().hideStartPointKnobs;isc.A.showEndPointKnobs=isc.DrawLine.getPrototype().showEndPointKnobs;isc.A.hideEndPointKnobs=isc.DrawLine.getPrototype().hideEndPointKnobs;isc.A.updateControlKnobs=isc.DrawLine.getPrototype().updateControlKnobs;isc.B.push(isc.A.init=function isc_DrawLinePath_init(){this.startLeft=this.startLeft||this.startPoint[0];this.startTop=this.startTop||this.startPoint[1];this.endLeft=this.endLeft||this.endPoint[0];this.endTop=this.endTop||this.endPoint[1];this.points=this.$45e();this.Super("init")},isc.A.$45e=function isc_DrawLinePath__getSegmentPoints(){var _1=this.tailSize;if(this.startLeft<=this.endLeft){_1=-_1}
this.$45f=[];this.$45f.addList([[this.startLeft,this.startTop],[this.startLeft-_1,this.startTop],[this.endLeft+_1,this.endTop],[this.endLeft,this.endTop]]);return this.$45f},isc.A.$63r=function isc_DrawLinePath__drawLineStartArrow(){return this.startArrow=="open"},isc.A.$63s=function isc_DrawLinePath__drawLineEndArrow(){return this.endArrow=="open"},isc.A.getCenter=function isc_DrawLinePath_getCenter(){return[this.startPoint[0]+Math.round((this.endPoint[0]-this.startPoint[0])/2),this.startPoint[1]+Math.round((this.endPoint[1]-this.startPoint[1])/2)]},isc.A.setStartPoint=function isc_DrawLinePath_setStartPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null){this.startLeft=this.startPoint[0]=_1}
if(_2!=null){this.startTop=this.startPoint[1]=_2}
this.setPoints(this.$45e());this.updateControlKnobs()},isc.A.setEndPoint=function isc_DrawLinePath_setEndPoint(_1,_2){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
if(_1!=null){this.endLeft=this.endPoint[0]=_1}
if(_2!=null){this.endTop=this.endPoint[1]=_2}
this.setPoints(this.$45e());this.updateControlKnobs()},isc.A.drawBitmapPath=function isc_DrawLinePath_drawBitmapPath(_1){var _2=10;if(this.startLeft>this.endLeft)_2=-_2;if(this.startArrow=="open"){this.bmMoveTo(this.startLeft+_2,this.startTop-_2,_1);this.bmLineTo(this.startLeft,this.startTop,_1);this.bmLineTo(this.startLeft+_2,this.startTop+_2,_1)}else if(this.startArrow=="block"){_1.stroke();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth="1px";_1.lineCap="round";this.bmMoveTo(this.startLeft+_2,this.startTop-_2,_1);this.bmLineTo(this.startLeft,this.startTop,_1);this.bmLineTo(this.startLeft+_2,this.startTop+_2,_1);_1.closePath();_1.fill()}
var _3=this.points;this.bmMoveTo(_3[0][0],_3[0][1],_1);for(var i=1;i<_3.length;i++){var _5=_3[i];if(this.linePattern.toLowerCase()!=="solid"){this.$85x(_3[i-1][0],_3[i-1][1],_3[i][0],_3[i][1],_1)}else{this.bmLineTo(_5[0],_5[1],_1)}}
if(this.endArrow=="open"){this.bmMoveTo(this.endLeft-_2,this.endTop+_2,_1);this.bmLineTo(this.endLeft,this.endTop,_1);this.bmLineTo(this.endLeft-_2,this.endTop-_2,_1)}else if(this.endArrow=="block"){_1.stroke();_1.beginPath();_1.fillStyle=this.lineColor;_1.lineWidth="1px";_1.lineCap="round";this.bmMoveTo(this.endLeft-_2,this.endTop+_2,_1);this.bmLineTo(this.endLeft,this.endTop,_1);this.bmLineTo(this.endLeft-_2,this.endTop-_2,_1);_1.closePath();_1.fill()}},isc.A.getBoundingBox=function isc_DrawLinePath_getBoundingBox(){var _1=this.startPoint[0],_2=this.startPoint[1],_3=this.endPoint[0],_4=this.endPoint[1];var _5=Math.min(_1,_3),_6=Math.max(_1,_3),_7=Math.min(_2,_4),_8=Math.max(_2,_4);return[_5,_7,_6,_8]},isc.A.moveBy=function isc_DrawLinePath_moveBy(_1,_2){this.startLeft+=_1;this.startPoint[0]+=_1;this.startTop+=_2;this.startPoint[1]+=_2;this.endLeft+=_1;this.endPoint[0]+=_1;this.endTop+=_2;this.endPoint[1]+=_2;this.setPoints(this.$45e());this.Super("moveBy",arguments);this.$105u(_1,_2)},isc.A.moveTo=function isc_DrawLinePath_moveTo(_1,_2){this.moveBy(_1-this.startLeft,_2-this.startTop);this.$105u(_1,_2)});isc.B._maxIndex=isc.C+11;isc.GraphMath={zeroPoint:[0,0],polar2screen:function(_1,_2,_3,_4){_3=_3||this.zeroPoint;var _5=Math.PI-((_1+450)%360)/180*Math.PI;var _6=[_3[0]+(_2*Math.cos(_5)),_3[1]+(-_2*Math.sin(_5))]
if(_4){_6[0]=Math.round(_6[0]);_6[1]=Math.round(_6[1])}
return _6},screen2polar:function(_1,_2){return[((Math.PI-Math.atan2(-_2,_1))/Math.PI*180+270)%360,Math.sqrt(Math.pow(_1,2)+Math.pow(_2,2))]},angleDifference:function(_1,_2){var _3=Math.max(_1,_2),_4=Math.min(_1,_2),_5=_3-_4,_6=_4+360-_3;if(_6<_5){var _7=_3==_1?1:-1;return _7*_6}else{var _7=_3==_1?-1:1;return _7*_5}},straightDistance:function(_1,_2){var _3=_1[0]-_2[0],_4=_1[1]-_2[1];return Math.sqrt(_3*_3+_4*_4)},trimLineEnds:function(_1,_2,_3,_4,_5,_6){var _7=Math.sqrt(Math.pow(_3-_1,2)+Math.pow(_4-_2,2));if(_5+_6>_7){var _8=_5/(_5+_6)*(_3-_1)+_1;var _9=_5/(_5+_6)*(_4-_2)+_2;return[_8+(_1==_3?0:_1>_3?0.01:-0.01),_9+(_2==_4?0:_2>_4?0.01:-0.01),_8+(_1==_3?0:_1>_3?-0.01:0.01),_9+(_2==_4?0:_2>_4?-0.01:0.01)]}
var _10=Math.atan2(_2-_4,_3-_1);return[_1+(_5*Math.cos(_10)),_2-(_5*Math.sin(_10)),_3-(_6*Math.cos(_10)),_4+(_6*Math.sin(_10))]}}
isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setCenter=function isc_Canvas_setCenter(_1,_2){this.moveTo(_1-this.getVisibleWidth()/2,_2-this.getVisibleHeight()/2)},isc.A.getCenter=function isc_Canvas_getCenter(){return[this.getLeft()+this.getVisibleWidth()/2,this.getTop()+this.getVisibleHeight()/2]});isc.B._maxIndex=isc.C+2;isc.defineClass("LinkedList","Class");isc.A=isc.LinkedList.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.length=0;isc.B.push(isc.A.init=function isc_LinkedList_init(){this.head=null},isc.A.add=function isc_LinkedList_add(_1){var _2={next:null,data:_1};if(!this.head){this.head=_2}else{var _3=this.head;while(_3.next){_3=_3.next}
_3.next=_2}
this.length++},isc.A.get=function isc_LinkedList_get(_1){var _2=null;if(_1>=0&&_1<this.length){var _3=this.head,i=0;while(i++<_1){_3=_3&&_3.next}
_2=_3.data}
return _2},isc.A.remove=function isc_LinkedList_remove(_1){var _2=null;if(_1>=0&&_1<this.length){var _3=this.head,i=0;if(_1===0){this.head=_3.next}else{var _5;while(i++<_1){_5=_3;_3=_3&&_3.next}
_5.next=_3.next}
_2=_3.data;this.length--}
return _2},isc.A.toArray=function isc_LinkedList_toArray(){var _1=[],_2=this.head;while(_2){_1.push(_2.data);_2=_2.next}
return _1});isc.B._maxIndex=isc.C+5;isc.defineClass("QuadTree","Class");isc.A=isc.QuadTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.depth=0;isc.A.maxDepth=0;isc.A.maxChildren=0;isc.B.push(isc.A.init=function isc_QuadTree_init(){this.root=null;this.bounds=null},isc.A.insert=function isc_QuadTree_insert(_1){if(isc.isAn.Array(_1)){var _2=_1.length;for(var i=0;i<_2;i++){this.root.insert(_1[i])}}else{this.root.insert(_1)}},isc.A.remove=function isc_QuadTree_remove(_1){this.root.remove(_1)},isc.A.clear=function isc_QuadTree_clear(){this.root.clear()},isc.A.retrieve=function isc_QuadTree_retrieve(_1){return this.root.retrieve(_1).slice()},isc.A.update=function isc_QuadTree_update(_1){return this.root.update(_1)});isc.B._maxIndex=isc.C+6;isc.defineClass("QuadTreeNode","Class");isc.A=isc.QuadTreeNode;isc.A.TOP_LEFT=0;isc.A.TOP_RIGHT=1;isc.A.BOTTOM_LEFT=2;isc.A.BOTTOM_RIGHT=3;isc.A=isc.QuadTreeNode.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.depth=0;isc.A.maxDepth=4;isc.A.maxChildren=4;isc.B.push(isc.A.init=function isc_QuadTreeNode_init(){this.bounds=null;this.nodes=[];this.children=isc.LinkedList.create()},isc.A.insert=function isc_QuadTreeNode_insert(_1){if(this.nodes.length){var _2=this.findQuadrants(_1);for(var i=0;i<_2.length;++i){var _4=_2[i];this.nodes[_4].insert(_1)}
return}
this.children.add(_1);var _5=this.children.length;if(!(this.depth>=this.maxDepth)&&_5>this.maxChildren){this.subdivide();for(var i=0;i<_5;i++){this.insert(this.children.get(i))}
this.children=isc.LinkedList.create()}},isc.A.remove=function isc_QuadTreeNode_remove(_1){if(this.nodes.length){var _2=this.findQuadrants(_1);for(var i=0;i<_2.length;++i){var _4=_2[i];this.nodes[_4].remove(_1)}}
for(var j=0;j<this.children.length;++j){var _6=this.children.get(j);if(_6===_1){this.children.remove(j)}}},isc.A.retrieve=function isc_QuadTreeNode_retrieve(_1){if(this.nodes.length){var _2=this.findQuadrant(_1);return this.nodes[_2].retrieve(_1)}
return this.children.toArray()},isc.A.findQuadrant=function isc_QuadTreeNode_findQuadrant(_1){var b=this.bounds;var _3=(_1.x>b.x+b.width/2)?false:true;var _4=(_1.y>b.y+b.height/2)?false:true;var _5=isc.QuadTreeNode.TOP_LEFT;if(_3){if(!_4){_5=isc.QuadTreeNode.BOTTOM_LEFT}}else{if(_4){_5=isc.QuadTreeNode.TOP_RIGHT}else{_5=isc.QuadTreeNode.BOTTOM_RIGHT}}
return _5},isc.A.findQuadrants=function isc_QuadTreeNode_findQuadrants(_1){var _2=[];var _3={};var _4=this.findQuadrant({x:_1.x,y:_1.y});_2.push(_4);_3[_4]=true;_4=this.findQuadrant({x:_1.x+_1.width,y:_1.y+_1.height});if(!_3[_4]){_2.push(_4);_3[_4]=true}
_4=this.findQuadrant({x:_1.x,y:_1.y+_1.height});if(!_3[_4]){_2.push(_4);_3[_4]=true}
_4=this.findQuadrant({x:_1.x+_1.width,y:_1.y});if(!_3[_4]){_2.push(_4)}
return _2},isc.A.subdivide=function isc_QuadTreeNode_subdivide(){var _1=this.depth+1;var _2=this.bounds.x;var _3=this.bounds.y;var _4=(this.bounds.width/2)|0;var _5=(this.bounds.height/2)|0;var _6=_2+_4;var _7=_3+_5;this.nodes[isc.QuadTreeNode.TOP_LEFT]=isc.QuadTreeNode.create({depth:_1});this.nodes[isc.QuadTreeNode.TOP_LEFT].bounds={x:_2,y:_3,width:_4,height:_5};this.nodes[isc.QuadTreeNode.TOP_RIGHT]=isc.QuadTreeNode.create({depth:_1});this.nodes[isc.QuadTreeNode.TOP_RIGHT].bounds={x:_6,y:_3,width:_4,height:_5};this.nodes[isc.QuadTreeNode.BOTTOM_LEFT]=isc.QuadTreeNode.create({depth:_1});this.nodes[isc.QuadTreeNode.BOTTOM_LEFT].bounds={x:_2,y:_7,width:_4,height:_5};this.nodes[isc.QuadTreeNode.BOTTOM_RIGHT]=isc.QuadTreeNode.create({depth:_1});this.nodes[isc.QuadTreeNode.BOTTOM_RIGHT].bounds={x:_6,y:_7,width:_4,height:_5}},isc.A.clear=function isc_QuadTreeNode_clear(){this.children=isc.LinkedList.create();var _1=this.nodes.length;for(var i=0;i<_1;i++){this.nodes[i].clear()}
this.nodes=[];this.depth=0;this.maxDepth=4;this.maxChildren=4},isc.A.update=function isc_QuadTreeNode_update(_1){this.remove(_1);this.insert(_1)});isc.B._maxIndex=isc.C+9;isc.defineClass("DrawKnob","Canvas");isc.A=isc.DrawKnob.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.width=10;isc.A.height=10;isc.A.overflow="hidden";isc.A.cursor="crosshair";isc.A.canDrag=true;isc.A.dragAppearance="target";isc.A.dragMove="return this.$64f()";isc.A.dragStop="return this.$64f()";isc.A.dragAppearance="none";isc.A.keepInParentRect=true;isc.A.autoDraw=false;isc.A.knobShapeDefaults={_constructor:isc.DrawOval,radius:5,lineWidth:2,fillColor:"#FF0000",fillOpacity:0.5,autoDraw:true,updateControlKnobs:function(){return},erase:function(){if(this.erasing)return;this.erasing=true;if(this.creator.isDrawn())this.creator.clear();this.Super("erase",arguments);delete this.erasing}};isc.B.push(isc.A.initWidget=function isc_DrawKnob_initWidget(){this.left=this.x-this.width/2;this.top=this.y-this.height/2},isc.A.setCenterPoint=function isc_DrawKnob_setCenterPoint(_1,_2,_3){if(isc.isAn.Array(_1)){_2=_1[1];_1=_1[0]}
var _4,_5;if(_3){var _6=this.drawPane.drawing2screen([_1-this.$44g/2,_2-this.$44h/2,0,0]);_4=_6[0],_5=_6[1]}else{_4=_1-this.width/2;_5=_2-this.height/2}
this.moveTo(_4,_5)},isc.A.draw=function isc_DrawKnob_draw(){var _1=(this.$907);if(!this.knobShape){this.knobShape=this.createAutoChild("knobShape",{drawPane:this.drawPane,centerPoint:[this.x,this.y]});this.$907=true;;this.drawPane.addCanvasItem(this);delete this.$907}
if(!_1)return this.Super("draw",arguments)},isc.A.moved=function isc_DrawKnob_moved(){if(!this.synchingToPane)this.updateKnobShape()},isc.A.$64f=function isc_DrawKnob__updatePoints(){var _1=isc.EH.getX()-
(this.drawPane.getPageLeft()+this.drawPane.getLeftMargin()+this.drawPane.getLeftBorderSize()),_2=isc.EH.getY()-
(this.drawPane.getPageTop()+this.drawPane.getTopMargin()+this.drawPane.getTopBorderSize());var _3=this.drawPane.screen2drawing([_1,_2,0,0]);var _4=_3[0],_5=_3[1],_6=_4-(this.$44e+this.$44g/2),_7=_5-(this.$44f+this.$44h/2);this.updatePoints(_4,_5,_6,_7)},isc.A.updateKnobShape=function isc_DrawKnob_updateKnobShape(){var _1=this.drawPane.screen2drawing([this.getLeft()+this.getWidth()/2,this.getTop()+this.getHeight()/2,0,0]);var x=_1[0],y=_1[1],_4=x-this.$44g/2,_5=y-this.$44h/2;this.$44e=_4,this.$44f=_5;this.knobShape.setCenterPoint(x,y)},isc.A.updatePoints=function(x,y,dX,dY){},isc.A.clear=function isc_DrawKnob_clear(){this.Super("clear",arguments);this.knobShape.erase()});isc.B._maxIndex=isc.C+8;isc.DrawKnob.registerStringMethods({updatePoints:"x,y,dX,dY"});isc.ClassFactory.defineClass("GaugeSector");isc.A=isc.GaugeSector.getPrototype();isc.A.fillColor=null;isc.A.startAngle=0;isc.A.endAngle=0;isc.A.value=0;isc.A=isc.GaugeSector.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setFillColor=function isc_GaugeSector_setFillColor(_1){this.fillColor=_1},isc.A.setStartAngle=function isc_GaugeSector_setStartAngle(_1){this.startAngle=_1},isc.A.setEndAngle=function isc_GaugeSector_setEndAngle(_1){this.endAngle=_1},isc.A.setValue=function isc_GaugeSector_setValue(_1){this.value=_1});isc.B._maxIndex=isc.C+4;isc.ClassFactory.defineClass("Gauge","DrawPane");isc.A=isc.Gauge.getPrototype();isc.A.width=400;isc.A.height=400;isc.A.redrawOnResize=true;isc.A.dialRadius=150;isc.A.knobRadius=6;isc.A.fontSize=11;isc.A.lineWidth=50;isc.A.sectorColors=["#AFFFFF","#008080","#AAAFFF","#FF0000","#FFCC99","#800080"];isc.A.minValue=0;isc.A.maxValue=100;isc.A.value=0;isc.A.numMajorTicks=0;isc.A.numMinorTicks=0;isc.A.labelPrefix="";isc.A.labelSuffix="%";isc.A.drawnClockwise=true;isc.A.pivotPoint=null;isc.A=isc.Gauge.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.initWidget=function isc_Gauge_initWidget(){this.Super("initWidget",arguments);if(this.fontSize<3){this.logWarn("Gauge specified with fontSize:"+this.fontSize+". Setting to 3.");this.fontSize=3}
if(this.lineWidth<10){this.logWarn("Gauge specified with lineWidth:"+this.lineWidth+". Setting to 10.");this.lineWidth=10}
if(!(this.sectorColors instanceof Array)){this.logWarn("Gauge specified with non-array sectorColors. Setting to [ \"#AFFFFF\" ].");this.sectorColors=["#AFFFFF"]}
if(this.sectorColors.length==0){this.logWarn("Gauge specified with empty sectorColors array. Setting to [ \"#AFFFFF\" ].");this.sectorColors=["#AFFFFF"]}
if(this.minValue>this.maxValue){this.logWarn("Gauge specified with minValue:"+this.minValue+", greater than maxValue:"+this.maxValue+". Swapping.");var _1=this.minValue;this.minValue=this.maxValue;this.maxValue=_1}
if(!(this.maxValue>=0.99999+this.minValue)){this.logWarn("Gauge specified with maxValue:"+this.maxValue+", not at least 1 greater than minValue:"+this.minValue);this.maxValue=1+this.minValue}
this.value=Math.min(Math.max(this.value,this.minValue),this.maxValue);this.numMajorTicks=Math.floor(this.numMajorTicks);this.numMajorTicks=Math.max(0,this.numMajorTicks);if(this.numMajorTicks!=0){this.numMajorTicks=Math.max(2,this.numMajorTicks)}
this.numMinorTicks=Math.floor(this.numMinorTicks);this.numMinorTicks=Math.max(0,this.numMinorTicks);if(this.numMinorTicks!=0){this.numMinorTicks=Math.max(2,this.numMinorTicks)}
if(!this.labelPrefix){this.labelPrefix=""}else{this.labelPrefix+=""}
if(!this.labelSuffix){this.labelSuffix=""}else{this.labelSuffix+=""}
this.drawnClockwise=this.drawnClockwise?true:false;this.sectors=new Array(1);var _2;this.sectors[0]=_2=isc.GaugeSector.create({fillColor:this.getDefaultFillColor(0),startAngle:0,endAngle:180,value:this.maxValue});this.$93v=isc.DrawTriangle.create({fillColor:"#000000"})},isc.A.setWidth=function isc_Gauge_setWidth(_1){this.$93w(_1,this.getHeight());this.Super("setWidth",arguments)},isc.A.setHeight=function isc_Gauge_setHeight(_1){this.$93w(this.getWidth(),_1);this.Super("setHeight",arguments)},isc.A.$93w=function isc_Gauge__makePivotPoint(_1,_2,_3){this.pivotPoint=[_1/2,_2*0.70];this.$93e(this.value);if(_3===undefined||!_3){this.redraw()}},isc.A.draw=function isc_Gauge_draw(){if(!this.pivotPoint){this.$93w(this.getWidth(),this.getHeight(),true)}
this.$93x();this.$93y();this.Super("draw",arguments)},isc.A.redraw=function isc_Gauge_redraw(_1){if(!this.pivotPoint){this.$93w(this.getWidth(),this.getHeight(),true)}
this.$93x();this.$93y();this.Super("redraw",arguments)},isc.A.$93x=function isc_Gauge__makeDrawSectors(){var _1=new Array(this.sectors.length);if(this.$93z){for(var i=0;i<this.$93z.length;++i){this.$93z[i].destroy()}}
var _3=this.sectors;for(var _4=0;_4<_3.length;++_4){var _5=_3[_4];var _6,_7;if(this.drawnClockwise){_6=_5.startAngle-180;_7=_5.endAngle-180}else{_6=-_5.endAngle;_7=-_5.startAngle}
var _8;_1[_4]=_8=isc.DrawSector.create({radius:this.dialRadius,centerPoint:this.pivotPoint,startAngle:_6,endAngle:_7,fillColor:_5.fillColor});this.addDrawItem(_8,true)}
this.$93z=_1;this.$93d()},isc.A.$93d=function isc_Gauge__makeTickLines(){var _1=this.numMajorTicks;var _2=this.numMinorTicks;var _3=this.drawnClockwise;var _4=this.pivotPoint;var _5;var i;if(!this.$930){_5=new Array(_1+_2)}else if(this.$930.length!=_1+_2){for(i=_1+_2;i<this.$930.length;++i){this.$930[i].destroy()}
_5=new Array(_1+_2);for(i=0;i<_5.length;++i){_5[i]=this.$930[i]}}else{_5=this.$930}
for(i=0;i<_1;++i){var _7=Math.PI-Math.PI*i/(_1-1);if(!_3){_7=Math.PI-_7}
var x=(this.dialRadius+3)*Math.cos(_7);var y=(this.dialRadius+3)*Math.sin(_7);var p=[_4[0]+x,_4[1]-y];var _11=(this.dialRadius-10)*Math.cos(_7);var _12=(this.dialRadius-10)*Math.sin(_7);var _13=[_4[0]+_11,_4[1]-_12];if(!_5[i]){_5[i]=isc.DrawLine.create({startPoint:_13,endPoint:p,lineWidth:2})}else{_5[i].setStartPoint(p[0],p[1]);_5[i].setEndPoint(_13[0],_13[1])}}
for(var j=0;j<_2;++j,++i){var _7=Math.PI-Math.PI*j/(_2-1);if(!_3){_7=Math.PI-_7}
var x=this.dialRadius*Math.cos(_7);var y=this.dialRadius*Math.sin(_7);var p=[_4[0]+x,_4[1]-y];var _11=(this.dialRadius-5)*Math.cos(_7);var _12=(this.dialRadius-5)*Math.sin(_7);var _13=[_4[0]+_11,_4[1]-_12];if(!_5[i]){_5[i]=isc.DrawLine.create({startPoint:_13,endPoint:p,lineWidth:1})}else{_5[i].setStartPoint(p[0],p[1]);_5[i].setEndPoint(_13[0],_13[1])}}
for(i=0;i<_5.length;++i){this.addDrawItem(_5[i],true)}
this.$930=_5;this.$931()},isc.A.$931=function isc_Gauge__makeNeedle(){this.addDrawItem(this.$93v,true);this.$932()},isc.A.$932=function isc_Gauge__makeKnob(){var _1;if(!this.$933){this.$933=_1=isc.DrawOval.create({centerPoint:this.pivotPoint,radius:this.knobRadius,fillColor:"#000000"})}else{_1=this.$933;_1.setCenterPoint(this.pivotPoint[0],this.pivotPoint[1]);_1.setRadius(this.knobRadius)}
this.addDrawItem(_1,true)},isc.A.$93y=function isc_Gauge__makeLabels(){var _1=this.sectors;var _2=new Array(1+_1.length);if(this.$934){for(var i=0;i<this.$934.length;++i){this.$934[i].destroy()}}
var _4;_2[0]=_4=this.$93g(this.formatLabelContents(this.minValue),this.minValue);this.addDrawItem(_4,true);for(var _5=0;_5<_1.length;++_5){var _6=_1[_5];var _7=this.$93g(this.formatLabelContents(_6.value),_6.value);_2[1+_5]=_7;this.addDrawItem(_7,true)}
this.$934=_2},isc.A.setMinValue=function isc_Gauge_setMinValue(_1){_1=Math.min(0+_1,this.maxValue-1);this.$93h(_1,this.maxValue)},isc.A.setMaxValue=function isc_Gauge_setMaxValue(_1){_1=Math.max(0+_1,1+this.minValue);this.$93h(this.minValue,_1)},isc.A.$93h=function isc_Gauge__rescaleSectors(_1,_2){var _3=this.maxValue;var _4=this.minValue;var _5=this.sectors;var _6=_3-_4;var _7=_2-_1;var _8=0;for(var _9=0;_9<_5.length;++_9){var _10=_5[_9];var _11=_7*(_10.value-_4)/_6+_1;_10.setValue(_11);_10.setStartAngle(_8);_10.setEndAngle(_8=this.$93i(_11,_1,_7))}
this.value=_7*(this.value-_4)/_6+_1;this.minValue=_4=_1;this.maxValue=_3=_2;if(this.isDrawn()){this.$93y()}},isc.A.setValue=function isc_Gauge_setValue(_1){_1=Math.min(Math.max(0+_1,this.minValue),this.maxValue);if(this.isDrawn()){this.$93e(_1)}
this.value=_1},isc.A.setNumMajorTicks=function isc_Gauge_setNumMajorTicks(_1){_1=Math.floor(_1);if(this.numMajorTicks!=_1){_1=Math.max(0,_1);if(_1!=0){_1=Math.max(2,_1)}
this.numMajorTicks=_1;if(this.isDrawn()){this.$93d()}}},isc.A.setNumMinorTicks=function isc_Gauge_setNumMinorTicks(_1){_1=Math.floor(_1);if(this.numMinorTicks!=_1){_1=Math.max(0,_1);if(_1!=0){_1=Math.max(2,_1)}
this.numMinorTicks=_1;if(this.isDrawn()){this.$93d()}}},isc.A.setLabelPrefix=function isc_Gauge_setLabelPrefix(_1){if(!_1){_1=""}else{_1+=""}
if(this.labelPrefix!=_1){this.labelPrefix=_1;this.reformatLabelContents()}},isc.A.setLabelSuffix=function isc_Gauge_setLabelSuffix(_1){if(!_1){_1=""}else{_1+=""}
if(this.labelSuffix!=_1){this.labelSuffix=_1;this.reformatLabelContents()}},isc.A.setDrawnClockwise=function isc_Gauge_setDrawnClockwise(_1){_1=_1?true:false;if(this.drawnClockwise!=_1){this.drawnClockwise=_1;if(this.isDrawn()){this.$93e(this.value);this.redraw()}}},isc.A.formatLabelContents=function isc_Gauge_formatLabelContents(_1){return this.labelPrefix+(0+_1)+this.labelSuffix},isc.A.reformatLabelContents=function isc_Gauge_reformatLabelContents(){if(this.isDrawn()){this.$93y()}},isc.A.getNumSectors=function isc_Gauge_getNumSectors(){return this.sectors.length},isc.A.getSectorValue=function isc_Gauge_getSectorValue(_1){return this.sectors[_1].value},isc.A.getDefaultFillColor=function isc_Gauge_getDefaultFillColor(_1){var _2=this.sectorColors.length;return this.sectorColors[_1%_2]},isc.A.getSectorFillColor=function isc_Gauge_getSectorFillColor(_1){return this.sectors[_1].fillColor},isc.A.setSectorFillColor=function isc_Gauge_setSectorFillColor(_1,_2){var _3=this.sectors;var _4=this.$93z;_3[_1].setFillColor(_2+"");if(this.isDrawn()){if(_4&&_4.length==_3.length){_4[_1].setFillColor(_2)}else{this.$93x()}}},isc.A.getSectorLabelContents=function isc_Gauge_getSectorLabelContents(_1){return this.formatLabelContents(this.sectors[_1].value)},isc.A.addSector=function isc_Gauge_addSector(_1){_1=Math.min(Math.max(0+_1,this.minValue),this.maxValue);var _2=this.sectors;var _3=this.maxValue;var _4=this.minValue;var _5=0;for(;_5<_2.length&&_2[_5].value<_1;++_5)
{}
var _6=new Array(_2.length+1);for(var _7=0;_7<_5;++_7){_6[_7]=_2[_7]}
var _8=_3-_4;var _9;var _10;_6[_5]=_10=isc.GaugeSector.create({startAngle:this.$93j(_5,_4,_8),endAngle:_9=this.$93i(_1,_4,_8),value:_1});if(_5<=_2.length-1){_10.setFillColor(_2[_5].fillColor)}else{_10.setFillColor(this.getDefaultFillColor(_5))}
if(_5<_2.length){_2[_5].setStartAngle(_9)}
for(var _7=_5;_7<_2.length;++_7){var _11=_2[_7];if(_7<_2.length-1){_11.setFillColor(_2[_7+1].fillColor)}else{_11.setFillColor(this.getDefaultFillColor(_7+1))}
_6[_7+1]=_11}
this.sectors=_2=_6;if(this.isDrawn()){this.$93x();this.$93y()}
return _5},isc.A.removeSector=function isc_Gauge_removeSector(_1){var _2=this.sectors;if(_1==0&&_2.length==1){return}
var _3=new Array(_2.length-1);for(var i=0;i<_1;++i){_3[i]=_2[i]}
var _5=0;if(_1>0){_5=_2[_1-1].endAngle}
if(_1<_2.length-1){_2[_1+1].setStartAngle(_5)}
for(var i=_1+1;i<_2.length;++i){_3[i-1]=_2[i]}
if(_1==_2.length-1){_3[_1-1].setEndAngle(180);_3[_1-1].setValue(this.maxValue)}
this.sectors=_2=_3;if(this.isDrawn()){this.$93x();this.$93y()}},isc.A.$93j=function isc_Gauge__getSectorStartAngle(_1,_2,_3){if(_1==0){return 0}else{var _4=this.sectors[_1-1].value;return 180*(_4-_2)/_3}},isc.A.$93i=function isc_Gauge__getSectorEndAngle(_1,_2,_3){return 180*(_1-_2)/_3},isc.A.$93e=function isc_Gauge__positionNeedleTriangle(_1){var _2=this.pivotPoint;var _3=this.maxValue-this.minValue;var _4=Math.PI-Math.PI*(_1-this.minValue)/_3;if(!this.drawnClockwise){_4=Math.PI-_4}
var x=(this.dialRadius-15)*Math.cos(_4);var y=(this.dialRadius-15)*Math.sin(_4);var p=[_2[0]+x,_2[1]-y];var _8=_4-Math.PI/2.0;var _9=this.knobRadius*Math.cos(_8);var _10=this.knobRadius*Math.sin(_8);var _11=[_2[0]+_9,_2[1]-_10];var _12=_4+Math.PI/2.0;var _13=this.knobRadius*Math.cos(_12);var _14=this.knobRadius*Math.sin(_12);var _15=[_2[0]+_13,_2[1]-_14];this.$93v.setPoints([p,_11,_15])},isc.A.$93g=function isc_Gauge__makePositionedLabel(_1,_2){var _3=this.pivotPoint;var _4=this.maxValue-this.minValue;var _5=Math.PI-Math.PI*(_2-this.minValue)/_4;if(!this.drawnClockwise){_5=Math.PI-_5}
var _6=0.65*this.fontSize*_1.length;var _7=this.fontSize+3;var x=(this.dialRadius+5)*Math.cos(_5);var y=(this.dialRadius+5)*Math.sin(_5);var _10;if(_5<9.0*Math.PI/20.0-0.001){_10=Math.round(_3[0]+x+2)}else if(_5<=11.0*Math.PI/20.0+0.001){_10=Math.round(_3[0]+x-_6/2)}else{_10=Math.round(_3[0]+x-_6-2)}
var _11;if(Math.PI/4.0<=_5&&_5<=3.0*Math.PI/4.0){_11=Math.round(_3[1]-y-_7*(1.0-Math.abs(Math.PI/2.0-_5)*0.5))}else{_11=Math.round(_3[1]-y-_7/2)}
return isc.DrawLabel.create({fontSize:this.fontSize,lineWidth:this.lineWidth,contents:_1,left:_10,top:_11})});isc.B._maxIndex=isc.C+34;isc._moduleEnd=isc._Drawing_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('Drawing module init time: '+(isc._moduleEnd-isc._moduleStart)+'ms','loadTime');delete isc.definingFramework;}else{if(window.isc&&isc.Log&&isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'Drawing'.");}
/*
 * Isomorphic SmartClient
 * Version v8.3_2012-11-20 (2012-11-20)
 * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
 * "SmartClient" is a trademark of Isomorphic Software, Inc.
 *
 * licensing@smartclient.com
 *
 * http://smartclient.com/license
 */
