q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,y=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+t)/2;c=(u+y)/2;var t=(t+e)/2,y=(y+g)/2, w=(d+t)/2,A=(c+y)/2,r=r+Ge(a,b,s,u,d,c,w,A,l,m,n,p,q),r=r+Ge(w,A,t,y,e,g,h,k,l,m,n,p,q)}return r} function db(a,b,c,d,e,g,h){if(Eb(a,c)){var k=0;c=0;bc)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(Eb(b,d)){a c)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-g)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005 c)return l.x=a,l.y=c,!1;l.x=a;l.y=g;return!0}h=(d-b)/(c-a);if(Eb(k,h))return db(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(Eb(h,0)){a c)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}g= h*(e-a)+b;return db(a,b,c,d,e,g,l)}function Ie(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(He(a,b,a,d,e,g,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g);q m} function Je(a,b,c,d,e,g,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(g-k)/m,h=a,n=k*h+(g-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(g-k)/m,a=b-d*a,h=(g-k*e-a)/(d-k),n=d*h+a);l.n(h,n);return l} function Ke(a,b,c){var d=b.x,e=b.y,g=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===g?(g=a=0,e =m):e===h?(d =k):a.Pa(b)||a.Pa(c)||Le(k,m,l,m,d,e,g,h)||Le(l,m,l,n,d,e,g,h)||Le(l,n,k,n,d,e,g,h)||Le(k,n,k,m,d,e,g,h)?!0:!1}function Le(a,b,c,d,e,g,h,k){return 0>=Me(a,b,c,d,e,g)*Me(a,b,c,d,h,k)&&0>=Me(e,g,h,k,a,b)*Me(e,g,h,k,c,d)} function Me(a,b,c,d,e,g){c-=a;d-=b;a=e-a;b=g-b;g=a*d-b*c;0===g&&(g=a*c+b*d,0 g&&(g=0)));return 0>g?-1:0 a&&(a+=360);360<=a&&(a-=360);return a} function Re(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);var g=b>c?-1:1;d=[];var h=e/2,k=b;c=Math.min(2*e,Math.abs(c-b));if(1E-5>c)return b=k+g*Math.min(c,h),g=0+a*Math.cos(k),k=0+a*Math.sin(k),h=0+a*Math.cos(b),a=0+a*Math.sin(b),b=(g+h)/2,c=(k+a)/2,d.push([g,k,b,c,b,c,h,a]),d;for(;1E-5 c,g=0>d,h=0,k=h=0;ag;++g){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0 k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,a a?"M"+this.la.toString()+" "+this.ja.toString()+"L"+this.F.toString()+" "+this.G.toString():"M"+this.la.toFixed(a)+" "+this.ja.toFixed(a)+"L"+this.F.toFixed(a)+" "+this.G.toFixed(a);case Ze:var b=new C(this.la,this.ja,0,0);b.vH(this.F,this.G,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+ "V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case tf:b=new C(this.la,this.ja,0,0);b.vH(this.F,this.G,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ 2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case Ve:for(var b="",c=this.nc.o,d=c.length,e=0;e
=P-1?!0:null!==l[t+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){t++;return l[t]}function e(){var a=new N(parseFloat(d()),parseFloat(d()));y===y.toLowerCase()&&(a.x=B.x+a.x,a.y=B.y+a.y);return a}function g(){return B=e()}function h(){return A=e()}function k(){return"c"!==w.toLowerCase()&&"s"!==w.toLowerCase()?B:new N(2*B.x-A.x,2*B.y-A.y)}void 0===b&&(b=!1);"string"!==typeof a&&D.kc(a,"string",Ue,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=0;m =P-1);)if(w=y,y=d(),""!==y)switch(y.toUpperCase()){case "X":s=!0;r=q=!1;break;case "M":m=g();null===p.fc||!0===s?(S(p,m.x,m.y,q,!1,!r),s=!1):p.moveTo(m.x,m.y);for(n=B;!c();)m=g(),p.lineTo(m.x,m.y);break;case "L":for(;!c();)m= g(),p.lineTo(m.x,m.y);break;case "H":for(;!c();)B=m=new N((y===y.toLowerCase()?B.x:0)+parseFloat(d()),B.y),p.lineTo(B.x,B.y);break;case "V":for(;!c();)B=m=new N(B.x,(y===y.toLowerCase()?B.y:0)+parseFloat(d())),p.lineTo(B.x,B.y);break;case "C":for(;!c();){var u=e(),H=h(),m=g();T(p,u.x,u.y,H.x,H.y,m.x,m.y)}break;case "S":for(;!c();)u=k(),H=h(),m=g(),T(p,u.x,u.y,H.x,H.y,m.x,m.y);break;case "Q":for(;!c();)H=h(),m=g(),yf(p,H.x,H.y,m.x,m.y);break;case "T":for(;!c();)A=H=k(),m=g(),yf(p,H.x,H.y,m.x,m.y); break;case "B":for(;!c();){var m=parseFloat(d()),u=parseFloat(d()),H=parseFloat(d()),Q=parseFloat(d()),Y=parseFloat(d()),U=Y,ea=!1;c()||(U=parseFloat(d()),c()||(ea=0!==parseFloat(d())));y===y.toLowerCase()&&(H+=B.x,Q+=B.y);p.arcTo(m,u,H,Q,Y,U,ea)}break;case "A":for(;!c();)u=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),Q=parseFloat(d()),Y=!!parseFloat(d()),U=!!parseFloat(d()),m=g(),zf(p,u,H,Q,Y,U,m.x,m.y);break;case "Z":m=p.q.nc.o[p.q.nc.length-1];V(p);B=n;break;case "F":u="";for(m=1;l[t+ m];)if(null!==l[t+m].match(/[Uu]/))m++;else if(null===l[t+m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))m++;else{u=l[t+m];break}u.match(/[Mm]/)?q=!0:Af(p);break;case "U":u="";for(m=1;l[t+m];)if(null!==l[t+m].match(/[Ff]/))m++;else if(null===l[t+m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))m++;else{u=l[t+m];break}u.match(/[Mm]/)?r=!0:p.mb(!1)}n=p.q;D.u(p);if(b)for(p=n.nc.j;p.next();)m=p.value,m.Nu=!0;return n}; function Bf(a,b){for(var c=a.length,d=D.O(),e=0;e h&&(h+=360),s.Ne+=h);0>a&&(s.Ne=180-s.Ne,s.Ef=-s.Ef);0>d&&(s.Ne=-s.Ne,s.Ef=-s.Ef);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Hf:h=s.F;k=s.G;s.F=h* a+k*c+e;s.G=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.ek+=h);0>a&&(s.ek=180-s.ek,s.Bm=!s.Bm);0>d&&(s.ek=-s.ek,s.Bm=!s.Bm);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:D.k("Unknown Segment type: "+s.type)}}}}this.qb=!0;return this}; Ue.prototype.Pa=function(a,b,c,d){var e=a.x,g=a.y,h=this.kb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.nc.o,s=r.length,u=0;u =a)return 0;if((e>h?e-h:h-e)<(g>k?g-k:k-g)){if(e=a=0,ge)return 0}else if(e e)return 0;return 0 a?a=0:1=g)return d=(g-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.n(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.n(NaN,NaN);return b}; Ue.prototype.getAngleAlongPath=Ue.prototype.NF=function(a){0>a?a=0:1=e)return b=b[h],b=180*Math.atan2(b[2*a+3]-b[2*a+1],b[2*a+2]-b[2*a])/Math.PI;g+=m}}return NaN}; Ue.prototype.getFractionForPoint=Ue.prototype.UI=function(a){if(this.type===Ye){var b=this.la,c=this.ja,d=this.F,e=this.G;if(b!==d||c!==e){var g=a.x;a=a.y;var h=0,k=0;return b===d?(c =k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b =k?k===b?0:1:Math.abs(g-b)/(k-h)):((g-b)*(g-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===Ze){if(b=this.la,c=this.ja,d=this.F,e=this.G,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,g=a.x; a=a.y;g=Math.min(Math.max(g,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(g-b),d=Math.abs(g-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return g/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-g)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.gy,h=this.xu,k=this.yu,l=D.O(),c=Infinity,b=d=0,g=e.length,n=m=0,p=0;p a?0:1a?"M"+this.la.toString()+" "+this.ja.toString():"M"+this.la.toFixed(a)+" "+this.ja.toFixed(a),c=this.Eb.o,d=c.length,e=0;e a&&(a+=360),this.Xd=a,this.ff=0,v&&D.p(d,Zf,"x1"),this.Ch=Math.max(d,0),v&&D.p(e,Zf,"y1"),this.Ng=Math.max(e,0),this.sp="boolean"===typeof h?!!h:!1,this.No=!!k):(v&&D.p(d,Zf,"x1"),this.Xd=d,v&&D.p(e, Zf,"y1"),this.ff=e,v&&D.p(g,Zf,"x2"),a===Gf&&(g=Math.max(g,0)),this.Ch=g,"number"===typeof h?(a===Gf&&(h=Math.max(h,0)),this.Ng=h):this.Ng=0,this.No=this.sp=!1);this.ki=!1;this.qb=!0;this.ci=null}D.ka("PathSegment",Zf);D.Gi(Zf);Zf.prototype.copy=function(){var a=new Zf;a.da=this.da;a.Db=this.Db;a.Mb=this.Mb;a.Xd=this.Xd;a.ff=this.ff;a.Ch=this.Ch;a.Ng=this.Ng;a.sp=this.sp;a.No=this.No;a.ki=this.ki;a.qb=this.qb;return a}; Zf.prototype.equalsApprox=Zf.prototype.Yc=function(a){if(!(a instanceof Zf)||this.type!==a.type||this.ky!==a.ky)return!1;switch(this.type){case Df:case vf:return bb(this.F,a.F)&&bb(this.G,a.G);case Ef:return bb(this.F,a.F)&&bb(this.G,a.G)&&bb(this.Ec,a.Ec)&&bb(this.bd,a.bd)&&bb(this.Wh,a.Wh)&&bb(this.Xh,a.Xh);case Ff:return bb(this.F,a.F)&&bb(this.G,a.G)&&bb(this.Ec,a.Ec)&&bb(this.bd,a.bd);case Gf:return bb(this.Ne,a.Ne)&&bb(this.Ef,a.Ef)&&bb(this.pa,a.pa)&&bb(this.va,a.va)&&bb(this.radiusX,a.radiusX)&& bb(this.radiusY,a.radiusY);case Hf:return this.Bm===a.Bm&&this.ny===a.ny&&bb(this.ek,a.ek)&&bb(this.F,a.F)&&bb(this.G,a.G)&&bb(this.radiusX,a.radiusX)&&bb(this.radiusY,a.radiusY);default:return!1}};Zf.prototype.pc=function(a){a.Se===Zf?this.type=a:D.ck(this,a)}; Zf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Df:b=0>a?"M"+this.F.toString()+" "+this.G.toString():"M"+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case vf:b=0>a?"L"+this.F.toString()+" "+this.G.toString():"L"+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case Ef:b=0>a?"C"+this.Ec.toString()+" "+this.bd.toString()+" "+this.Wh.toString()+" "+this.Xh.toString()+" "+this.F.toString()+" "+this.G.toString():"C"+this.Ec.toFixed(a)+" "+this.bd.toFixed(a)+" "+this.Wh.toFixed(a)+ " "+this.Xh.toFixed(a)+" "+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case Ff:b=0>a?"Q"+this.Ec.toString()+" "+this.bd.toString()+" "+this.F.toString()+" "+this.G.toString():"Q"+this.Ec.toFixed(a)+" "+this.bd.toFixed(a)+" "+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case Gf:b=0>a?"B"+this.Ne.toString()+" "+this.Ef.toString()+" "+this.pa.toString()+" "+this.va.toString()+" "+this.radiusX:"B"+this.Ne.toFixed(a)+" "+this.Ef.toFixed(a)+" "+this.pa.toFixed(a)+" "+this.va.toFixed(a)+" "+this.radiusX; break;case Hf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.ek.toString()+" "+(this.ny?1:0)+" "+(this.Bm?1:0)+" "+this.F.toString()+" "+this.G.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.ek.toFixed(a)+" "+(this.ny?1:0)+" "+(this.Bm?1:0)+" "+this.F.toFixed(a)+" "+this.G.toFixed(a);break;default:b=this.type.toString()}return b+(this.ki?"z":"")};var Df;Zf.Move=Df=D.s(Zf,"Move",0);var vf;Zf.Line=vf=D.s(Zf,"Line",1);var Ef; Zf.Bezier=Ef=D.s(Zf,"Bezier",2);var Ff;Zf.QuadraticBezier=Ff=D.s(Zf,"QuadraticBezier",3);var Gf;Zf.Arc=Gf=D.s(Zf,"Arc",4);var Hf;Zf.SvgArc=Hf=D.s(Zf,"SvgArc",4);Zf.prototype.freeze=function(){this.J=!0;return this};Zf.prototype.Xa=function(){this.J=!1;return this};Zf.prototype.close=Zf.prototype.close=function(){this.ki=!0;return this}; function If(a,b){if(null!==a.ci&&!1===b.qb)return a.ci;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ci=[],a.ci;var e=a.Xd,g=a.ff,h=Re(c =r?h=Math.PI:1<=r&&(h=0);!l&&0 h&&(h+=2*Math.PI);l=b>g?1:b/g;r=b>g?g/b:1;b=Re(b>g?b:g,n,n+h,!0);g=D.gh();g.reset();g.translate(c,d);g.rotate(a.Xd,0,0);g.scale(l,r);Bf(b,g);D.lf(g);a.ci=b;return a.ci} D.defineProperty(Zf,{ky:"isClosed"},function(){return this.ki},function(a){this.ki!==a&&(this.ki=a,this.qb=!0)});D.defineProperty(Zf,{type:"type"},function(){return this.da},function(a){v&&D.Da(a,Zf,Zf,"type");this.J&&D.qa(this,a);this.da=a;this.qb=!0});D.defineProperty(Zf,{F:"endX"},function(){return this.Db},function(a){v&&D.p(a,Zf,"endX");this.J&&D.qa(this,a);this.Db=a;this.qb=!0}); D.defineProperty(Zf,{G:"endY"},function(){return this.Mb},function(a){v&&D.p(a,Zf,"endY");this.J&&D.qa(this,a);this.Mb=a;this.qb=!0});D.defineProperty(Zf,{Ec:"point1X"},function(){return this.Xd},function(a){v&&D.p(a,Zf,"point1X");this.J&&D.qa(this,a);this.Xd=a;this.qb=!0});D.defineProperty(Zf,{bd:"point1Y"},function(){return this.ff},function(a){v&&D.p(a,Zf,"point1Y");this.J&&D.qa(this,a);this.ff=a;this.qb=!0}); D.defineProperty(Zf,{Wh:"point2X"},function(){return this.Ch},function(a){v&&D.p(a,Zf,"point2X");this.J&&D.qa(this,a);this.Ch=a;this.qb=!0});D.defineProperty(Zf,{Xh:"point2Y"},function(){return this.Ng},function(a){v&&D.p(a,Zf,"point2Y");this.J&&D.qa(this,a);this.Ng=a;this.qb=!0});D.defineProperty(Zf,{pa:"centerX"},function(){return this.Xd},function(a){v&&D.p(a,Zf,"centerX");this.J&&D.qa(this,a);this.Xd=a;this.qb=!0}); D.defineProperty(Zf,{va:"centerY"},function(){return this.ff},function(a){v&&D.p(a,Zf,"centerY");this.J&&D.qa(this,a);this.ff=a;this.qb=!0});D.defineProperty(Zf,{radiusX:"radiusX"},function(){return this.Ch},function(a){v&&D.p(a,Zf,"radiusX");0>a&&D.ua(a,">= zero",Zf,"radiusX");this.J&&D.qa(this,a);this.Ch=a;this.qb=!0});D.defineProperty(Zf,{radiusY:"radiusY"},function(){return this.Ng},function(a){v&&D.p(a,Zf,"radiusY");0>a&&D.ua(a,">= zero",Zf,"radiusY");this.J&&D.qa(this,a);this.Ng=a;this.qb=!0}); D.defineProperty(Zf,{Ne:"startAngle"},function(){return this.Db},function(a){this.Db!==a&&(this.J&&D.qa(this,a),v&&D.p(a,Zf,"startAngle"),a%=360,0>a&&(a+=360),this.Db=a,this.qb=!0)});D.defineProperty(Zf,{Ef:"sweepAngle"},function(){return this.Mb},function(a){v&&D.p(a,Zf,"sweepAngle");this.J&&D.qa(this,a);360a&&(a=-360);this.Mb=a;this.qb=!0});D.defineProperty(Zf,{Bm:"isClockwiseArc"},function(){return this.No},function(a){this.J&&D.qa(this,a);this.No=a;this.qb=!0}); D.defineProperty(Zf,{ny:"isLargeArc"},function(){return this.sp},function(a){this.J&&D.qa(this,a);this.sp=a;this.qb=!0});D.defineProperty(Zf,{ek:"xAxisRotation"},function(){return this.Xd},function(a){v&&D.p(a,Zf,"xAxisRotation");a%=360;0>a&&(a+=360);this.J&&D.qa(this,a);this.Xd=a;this.qb=!0}); function ag(){this.ca=null;this.FA=(new N(0,0)).freeze();this.Mz=(new N(0,0)).freeze();this.Pv=this.Mw=0;this.Qv=1;this.zw="";this.vx=this.cw=!1;this.aw=this.Rv=0;this.hk=this.kw=this.vw=!1;this.as=null;this.tx=0;this.Rg=this.sx=null}D.ka("InputEvent",ag); ag.prototype.copy=function(){var a=new ag;a.ca=this.ca;a.FA.assign(this.Sd);a.Mz.assign(this.ha);a.Mw=this.Mw;a.Pv=this.Pv;a.Qv=this.Qv;a.zw=this.zw;a.cw=this.cw;a.vx=this.vx;a.Rv=this.Rv;a.aw=this.aw;a.vw=this.vw;a.kw=this.kw;a.hk=this.hk;a.as=this.as;a.tx=this.tx;a.sx=this.sx;a.Rg=this.Rg;return a}; ag.prototype.toString=function(){var a="^";0!==this.xd&&(a+="M:"+this.xd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Fe&&(a+="C:"+this.Fe);0!==this.Hi&&(a+="D:"+this.Hi);this.Cc&&(a+="h");this.bubbles&&(a+="b");null!==this.ha&&(a+="@"+this.ha.toString());return a};D.defineProperty(ag,{g:"diagram"},function(){return this.ca},function(a){this.ca=a});D.defineProperty(ag,{Sd:"viewPoint"},function(){return this.FA},function(a){D.l(a,N,ag,"viewPoint");this.FA.assign(a)}); D.defineProperty(ag,{ha:"documentPoint"},function(){return this.Mz},function(a){D.l(a,N,ag,"documentPoint");this.Mz.assign(a)});ag.prototype.getMultiTouchViewPoint=ag.prototype.hy=function(a,b){var c=this.g;if(null===c)return b;bg(c,this.event,a,b);return b};ag.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;bg(c,this.event,a,b);b.assign(c.tC(b));return b};D.defineProperty(ag,{xd:"modifiers"},function(){return this.Mw},function(a){this.Mw=a}); D.defineProperty(ag,{button:"button"},function(){return this.Pv},function(a){this.Pv=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});D.defineProperty(ag,{buttons:"buttons"},function(){return this.Qv},function(a){this.Qv=a});D.defineProperty(ag,{key:"key"},function(){return this.zw},function(a){this.zw=a});D.defineProperty(ag,{Xk:"down"},function(){return this.cw},function(a){this.cw=a}); D.defineProperty(ag,{up:"up"},function(){return this.vx},function(a){this.vx=a});D.defineProperty(ag,{Fe:"clickCount"},function(){return this.Rv},function(a){this.Rv=a});D.defineProperty(ag,{Hi:"delta"},function(){return this.aw},function(a){this.aw=a});D.defineProperty(ag,{Qu:"isMultiTouch"},function(){return this.vw},function(a){this.vw=a});D.defineProperty(ag,{Cc:"handled"},function(){return this.kw},function(a){this.kw=a}); D.defineProperty(ag,{bubbles:"bubbles"},function(){return this.hk},function(a){this.hk=a});D.defineProperty(ag,{event:"event"},function(){return this.as},function(a){this.as=a});D.w(ag,{Sj:"isTouchEvent"},function(){var a=window.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=window.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)});D.w(ag,{Qh:"isMac"},function(){return D.Qh}); D.defineProperty(ag,{timestamp:"timestamp"},function(){return this.tx},function(a){this.tx=a});D.defineProperty(ag,{Rf:"targetDiagram"},function(){return this.sx},function(a){this.sx=a});D.defineProperty(ag,{Oe:"targetObject"},function(){return this.Rg},function(a){this.Rg=a});D.defineProperty(ag,{control:"control"},function(){return 0!==(this.xd&1)},function(a){this.xd=a?this.xd|1:this.xd&-2}); D.defineProperty(ag,{shift:"shift"},function(){return 0!==(this.xd&4)},function(a){this.xd=a?this.xd|4:this.xd&-5});D.defineProperty(ag,{alt:"alt"},function(){return 0!==(this.xd&2)},function(a){this.xd=a?this.xd|2:this.xd&-3});D.defineProperty(ag,{Zu:"meta"},function(){return 0!==(this.xd&8)},function(a){this.xd=a?this.xd|8:this.xd&-9}); D.defineProperty(ag,{left:"left"},function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},function(a){this.buttons=a?this.buttons|1:this.buttons&-2}); D.defineProperty(ag,{right:"right"},function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},function(a){this.buttons=a?this.buttons|2:this.buttons&-3}); D.defineProperty(ag,{iM:"middle"},function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&4):1===this.button},function(a){this.buttons=a?this.buttons|4:this.buttons&-5});function cg(){this.ca=null;this.ac="";this.Vw=this.px=null;this.tr=!1}D.ka("DiagramEvent",cg);cg.prototype.copy=function(){var a=new cg;a.ca=this.ca;a.ac=this.ac;a.px=this.px;a.Vw=this.Vw;a.tr=this.tr;return a}; cg.prototype.toString=function(){var a="*"+this.name;null!==this.lC&&(a+=":"+this.lC.toString());null!==this.QB&&(a+="("+this.QB.toString()+")");return a};D.defineProperty(cg,{g:"diagram"},function(){return this.ca},function(a){this.ca=a});D.defineProperty(cg,{name:"name"},function(){return this.ac},function(a){this.ac=a});D.defineProperty(cg,{lC:"subject"},function(){return this.px},function(a){this.px=a});D.defineProperty(cg,{QB:"parameter"},function(){return this.Vw},function(a){this.Vw=a}); D.defineProperty(cg,{cancel:"cancel"},function(){return this.tr},function(a){this.tr!==a&&D.Sn("DiagramEvent.cancel","2.0");this.tr=a});function dg(){this.ur=eg;this.rn=this.Lw="";this.Ys=this.Zs=this.dt=this.et=this.bt=this.ca=this.Ae=null}D.ka("ChangedEvent",dg);var fg;dg.Transaction=fg=D.s(dg,"Transaction",-1);var eg;dg.Property=eg=D.s(dg,"Property",0);var gg;dg.Insert=gg=D.s(dg,"Insert",1);var hg;dg.Remove=hg=D.s(dg,"Remove",2); dg.prototype.clear=dg.prototype.clear=function(){this.Ys=this.Zs=this.dt=this.et=this.bt=this.ca=this.Ae=null};dg.prototype.copy=function(){var a=new dg;a.ur=this.ur;a.Lw=this.Lw;a.rn=this.rn;a.Ae=this.Ae;a.ca=this.ca;a.bt=this.bt;var b=this.et;a.et=D.Qa(b)&&"function"===typeof b.V?b.V():b;b=this.dt;a.dt=D.Qa(b)&&"function"===typeof b.V?b.V():b;b=this.Zs;a.Zs=D.Qa(b)&&"function"===typeof b.V?b.V():b;b=this.Ys;a.Ys=D.Qa(b)&&"function"===typeof b.V?b.V():b;return a}; dg.prototype.pc=function(a){a.Se===dg?this.Oc=a:D.ck(this,a)}; dg.prototype.toString=function(){var a="",a=this.Oc===fg?a+"* ":this.Oc===eg?a+(null!==this.ea?"!m":"!d"):a+((null!==this.ea?"!m":"!d")+this.Oc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.Df&&this.Df!==this.propertyName&&(a+=" "+this.Df);a+=": ";this.Oc===fg?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=ha(this.object)),null!==this.oldValue&&(a+=" old: "+ha(this.oldValue)),null!==this.Zj&&(a+=" "+this.Zj),null!==this.newValue&& (a+=" new: "+ha(this.newValue)),null!==this.Xj&&(a+=" "+this.Xj));return a};dg.prototype.getValue=dg.prototype.oa=function(a){return a?this.oldValue:this.newValue};dg.prototype.getParam=function(a){return a?this.Zj:this.Xj};dg.prototype.canUndo=dg.prototype.canUndo=function(){return null!==this.ea||null!==this.g?!0:!1};dg.prototype.undo=dg.prototype.undo=function(){this.canUndo()&&(null!==this.ea?this.ea.Jn(this,!0):null!==this.g&&this.g.Jn(this,!0))}; dg.prototype.canRedo=dg.prototype.canRedo=function(){return null!==this.ea||null!==this.g?!0:!1};dg.prototype.redo=dg.prototype.redo=function(){this.canRedo()&&(null!==this.ea?this.ea.Jn(this,!1):null!==this.g&&this.g.Jn(this,!1))};D.defineProperty(dg,{ea:"model"},function(){return this.Ae},function(a){this.Ae=a});D.defineProperty(dg,{g:"diagram"},function(){return this.ca},function(a){this.ca=a}); D.defineProperty(dg,{Oc:"change"},function(){return this.ur},function(a){v&&D.Da(a,dg,dg,"change");this.ur=a});D.defineProperty(dg,{Df:"modelChange"},function(){return this.Lw},function(a){v&&D.h(a,"string",dg,"modelChange");this.Lw=a});D.defineProperty(dg,{propertyName:"propertyName"},function(){return this.rn},function(a){v&&"string"!==typeof a&&D.h(a,"function",dg,"propertyName");this.rn=a}); D.w(dg,{nG:"isTransactionFinished"},function(){return this.ur===fg&&("CommittedTransaction"===this.rn||"FinishedUndo"===this.rn||"FinishedRedo"===this.rn)});D.defineProperty(dg,{object:"object"},function(){return this.bt},function(a){this.bt=a});D.defineProperty(dg,{oldValue:"oldValue"},function(){return this.et},function(a){this.et=a});D.defineProperty(dg,{Zj:"oldParam"},function(){return this.dt},function(a){this.dt=a}); D.defineProperty(dg,{newValue:"newValue"},function(){return this.Zs},function(a){this.Zs=a});D.defineProperty(dg,{Xj:"newParam"},function(){return this.Ys},function(a){this.Ys=a}); function M(a){1 g?b+("\\u000"+a.charCodeAt(d).toString(16)):32>g?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===g?b+"\\u2028":8233===g?b+"\\u2029":b+e}return'"'+b+'"'}; M.prototype.writeJsonValue=M.prototype.Av=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.Av(a.valueOf()):D.isArray(a)?xg(this,a):D.Qa(a)?ug(this,a):"function"===typeof a?"null":a.toString()}; function xg(a,b,c){void 0===c&&(c=!1);var d=D.fb(b);if(0>=d)return"[]";var e=new wa;e.add("[ ");c&&1 d)return;D.Ug(a.Be,d)}$g(a,"nodeDataArray",hg,"nodeDataArray",a,b,null,d,null);a.zv(b)} M.prototype.removeNodeDataCollection=function(a){if(D.isArray(a))for(var b=D.fb(a),c=0;cb&&(b=D.fb(a));D.Ih(a,b,c);$g(this,"",gg,"",a,null,c,null,b)}; M.prototype.removeArrayItem=M.prototype.IG=function(a,b){void 0===b&&(b=-1);v&&(D.ju(a,M,"removeArrayItem:arr"),D.p(b,M,"removeArrayItem:idx"));a===this.Be&&D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=D.fb(a)-1);var c=D.La(a,b);D.Ug(a,b);$g(this,"",hg,"",a,c,null,b,null)};D.defineProperty(M,{so:"nodeCategoryProperty"},function(){return this.mn},function(a){var b=this.mn;b!==a&&(ah(a,M,"nodeCategoryProperty"),this.mn=a,this.i("nodeCategoryProperty",b,a))}); M.prototype.getCategoryForNodeData=M.prototype.jB=function(a){if(null===a)return"";var b=this.mn;if(""===b)return"";b=D.zb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;D.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; M.prototype.setCategoryForNodeData=M.prototype.Xy=function(a,b){D.h(b,"string",M,"setCategoryForNodeData:cat");if(null!==a){var c=this.mn;if(""!==c)if(this.le(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"nodeCategory",eg,c,a,d,b))}else D.Ua(a,c,b)}}; function X(a,b){M.call(this);2 D.mm(d,a.newValue)&&D.Ih(d,c,a.newValue));return}}else if(a.Oc=== hg){c=a.Zj;if("linkDataArray"===a.Df){d=a.oldValue;D.Qa(d)&&"number"===typeof c&&(e=this.mf(d),b?(this.ni.add(d),D.La(this.df,c)!==d&&D.Ih(this.df,c,d),void 0!==e&&this.ud.add(e,d)):(this.ni.remove(d),D.La(this.df,c)===d&&D.Ug(this.df,c),void 0!==e&&this.ud.remove(e)));return}if("linkLabelKeys"===a.Df){d=this.cl(a.object);D.isArray(d)&&"number"===typeof c&&(b?0>D.mm(d,a.newValue)&&D.Ih(d,c,a.newValue):(c=D.mm(d,a.newValue),0<=c&&D.Ug(d,c)));return}}M.prototype.Jn.call(this,a,b)}; D.defineProperty(X,{MA:"archetypeNodeData"},function(){return this.Bl},function(a){var b=this.Bl;b!==a&&(null!==a&&D.l(a,Object,X,"archetypeNodeData"),this.Bl=a,this.i("archetypeNodeData",b,a))});X.prototype.ko=function(a){if(void 0!==a){var b=this.Bl;if(null!==b){var c=this.Ie(a);null===c&&(c=this.copyNodeData(b),D.Ua(c,this.Fk,a),this.im(c))}return a}}; D.defineProperty(X,{io:"linkFromKeyProperty"},function(){return this.oi},function(a){var b=this.oi;b!==a&&(ah(a,X,"linkFromKeyProperty"),this.oi=a,this.i("linkFromKeyProperty",b,a))});X.prototype.getFromKeyForLinkData=X.prototype.ym=function(a){if(null!==a){var b=this.oi;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}}; X.prototype.setFromKeyForLinkData=X.prototype.bC=function(a,b){null===b&&(b=void 0);void 0===b||bh(b)||D.kc(b,"number or string",X,"setFromKeyForLinkData:key");if(null!==a){var c=this.oi;if(""!==c)if(b=this.ko(b),this.Lh(a)){var d=D.zb(a,c);d!==b&&(gh(this,d,a),D.Ua(a,c,b),null===this.Ie(b)&&fh(this,b,a),$g(this,"linkFromKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}}; D.defineProperty(X,{jo:"linkToKeyProperty"},function(){return this.pi},function(a){var b=this.pi;b!==a&&(ah(a,X,"linkToKeyProperty"),this.pi=a,this.i("linkToKeyProperty",b,a))});X.prototype.getToKeyForLinkData=X.prototype.zm=function(a){if(null!==a){var b=this.pi;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}}; X.prototype.setToKeyForLinkData=X.prototype.hC=function(a,b){null===b&&(b=void 0);void 0===b||bh(b)||D.kc(b,"number or string",X,"setToKeyForLinkData:key");if(null!==a){var c=this.pi;if(""!==c)if(b=this.ko(b),this.Lh(a)){var d=D.zb(a,c);d!==b&&(gh(this,d,a),D.Ua(a,c,b),null===this.Ie(b)&&fh(this,b,a),$g(this,"linkToKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}}; D.defineProperty(X,{Vu:"linkFromPortIdProperty"},function(){return this.gn},function(a){var b=this.gn;b!==a&&(ah(a,X,"linkFromPortIdProperty"),a!==this.io&&a!==this.jo||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.gn=a,this.i("linkFromPortIdProperty",b,a))});X.prototype.getFromPortIdForLinkData=X.prototype.VI=function(a){if(null===a)return"";var b=this.gn;if(""===b)return"";a=D.zb(a,b);return void 0===a?"":a}; X.prototype.setFromPortIdForLinkData=X.prototype.cC=function(a,b){D.h(b,"string",X,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.gn;if(""!==c)if(this.Lh(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"linkFromPortId",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}}; D.defineProperty(X,{Xu:"linkToPortIdProperty"},function(){return this.hn},function(a){var b=this.hn;b!==a&&(ah(a,X,"linkToPortIdProperty"),a!==this.io&&a!==this.jo||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.hn=a,this.i("linkToPortIdProperty",b,a))});X.prototype.getToPortIdForLinkData=X.prototype.ZI=function(a){if(null===a)return"";var b=this.hn;if(""===b)return"";a=D.zb(a,b);return void 0===a?"":a}; X.prototype.setToPortIdForLinkData=X.prototype.iC=function(a,b){D.h(b,"string",X,"setToPortIdForLinkData:portname");if(null!==a){var c=this.hn;if(""!==c)if(this.Lh(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"linkToPortId",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};D.defineProperty(X,{Wu:"linkLabelKeysProperty"},function(){return this.Jg},function(a){var b=this.Jg;b!==a&&(ah(a,X,"linkLabelKeysProperty"),this.Jg=a,this.i("linkLabelKeysProperty",b,a))}); X.prototype.getLabelKeysForLinkData=X.prototype.cl=function(a){if(null===a)return D.Go;var b=this.Jg;if(""===b)return D.Go;a=D.zb(a,b);return void 0===a?D.Go:a}; X.prototype.setLabelKeysForLinkData=X.prototype.dH=function(a,b){D.ju(b,X,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Jg;if(""!==c)if(this.Lh(a)){var d=D.zb(a,c);void 0===d&&(d=D.Go);if(d!==b){for(var e=D.fb(d),g=0;g e||(D.Ug(d,e),this.Lh(a)&&(gh(this,b,a),$g(this,"linkLabelKeys",hg,c,a,b,null,e,null)))}else void 0!==d&&D.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; D.defineProperty(X,{Rh:"linkDataArray"},function(){return this.df},function(a){var b=this.df;if(b!==a){D.ju(a,X,"linkDataArray");this.ud.clear();for(var c=D.fb(a),d=0;d d)return;D.Ug(a.df,d)}$g(a,"linkDataArray",hg,"linkDataArray",a,b,null,d,null);c=a.ym(b);gh(a,c,b);c=a.zm(b);gh(a,c,b);d=a.cl(b);if(D.isArray(d))for(var e=D.fb(d),g=0;g a.Oi&&D.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Oi;d&&b&&a.vd("CommittingTransaction",c,a.Jj);var e=0;if(0 a.Nj;e--)g=d.fa(e),null!==g&&g.clear(), d.qd(e),a.eA=!0;e=a.vG;0===e&&(e=1);0 =e&&(g=d.fa(0),null!==g&&g.clear(),d.qd(0),a.qh--);d.add(b);a.qh++;d.freeze();g=b}a.vd("CommittedTransaction",c,g)}else{a.th=!0;try{a.isEnabled&&null!==g&&(g.Lu=!0,g.undo())}finally{a.vd("RolledBackTransaction",c,g),a.th=!1}null!==g&&g.clear()}a.$v=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.fg;for(b=c.count-1;b>=a;b--)d=c.fa(b),null!==d&&d.undo(),c.Xa(),c.qd(b);c.freeze()}return!1} ig.prototype.canUndo=ig.prototype.canUndo=function(){if(!this.isEnabled||0 =this.Oi&&!this.Wz&&(a=a.g,null!==a&&!1===a.co||D.trace("Change not within a transaction: "+c.toString()))}}; ig.prototype.skipsEvent=function(a){if(null===a||0>a.Oc.value)return!0;a=a.object;if(a instanceof O){if(a=a.layer,null!==a&&a.$c)return!0}else if(a instanceof Gg&&a.$c)return!0;return!1};D.w(ig,{QJ:"models"},function(){return this.jA.j});D.defineProperty(ig,{isEnabled:"isEnabled"},function(){return this.rf},function(a){this.rf=a});D.w(ig,{tH:"transactionToUndo"},function(){return 0<=this.Nj&&this.Nj<=this.history.count-1?this.history.fa(this.Nj):null}); D.w(ig,{sH:"transactionToRedo"},function(){return this.Nj b.Sh||(b.scale=a))};pa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.ez);D.p(a,pa,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.nm!==Vh)return!1;a*=b.scale;return a b.Sh?!1:b.Ix}; pa.prototype.increaseZoom=function(a){void 0===a&&(a=this.ez);D.p(a,pa,"increaseZoom:factor");var b=this.g;null!==b&&b.nm===Vh&&(a*=b.scale,a b.Sh||(b.scale=a))};pa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.ez);D.p(a,pa,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.nm!==Vh)return!1;a*=b.scale;return a b.Sh?!1:b.Ix};pa.prototype.resetZoom=function(a){void 0===a&&(a=this.Qx);D.p(a,pa,"resetZoom:newscale");var b=this.g;null===b||a b.Sh||(b.scale=a)}; pa.prototype.canResetZoom=function(a){void 0===a&&(a=this.Qx);D.p(a,pa,"canResetZoom:newscale");var b=this.g;return null===b||a b.Sh?!1:b.Ix};pa.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.JA&&!isNaN(this.fA)&&a.Xc.P(this.IA)?(a.scale=this.fA,a.position=this.RD,this.JA=NaN,this.IA=Kd):(this.fA=b,this.RD=c.copy(),a.zoomToFit(),this.JA=a.scale,this.IA=a.Xc.copy())}};pa.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Ix}; pa.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&D.l(a,F,pa,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.xj&&(this.xj.next()?a=this.xj.value:this.xj=null)}catch(c){this.xj=null}null===a&&(0 h&&(h=-3),0 k&&(k=-3); if(void 0===g||void 0===h||void 0===k||0===h&&0===k||b.shift)!b.shift&&a.De?(g=a.ov,e=3*e*g,0 e||Math.abs(b.y-a.y)>d};D.w(Hg,{g:"diagram"},function(){return this.ca}); D.defineProperty(Hg,{name:"name"},function(){return this.ac},function(a){D.h(a,"string",Hg,"name");this.ac=a});D.defineProperty(Hg,{isEnabled:"isEnabled"},function(){return this.rf},function(a){D.h(a,"boolean",Hg,"isEnabled");this.rf=a});D.defineProperty(Hg,{wa:"isActive"},function(){return this.DD},function(a){D.h(a,"boolean",Hg,"isActive");this.DD=a});D.defineProperty(Hg,{Tf:"transactionResult"},function(){return this.KE},function(a){null!==a&&D.h(a,"string",Hg,"transactionResult");this.KE=a}); function Uh(){Hg.call(this);0 e&&(e=k),l>g&&(g=l))}}Infinity===c?b.n(0,0,0,0):b.n(c,d,e-c,g-d)} function Oi(a,b){if(null===a.mc){var c=a.g;if(!(null===c||b&&(c.rb||c.Nf))&&null!==a.hc){var d=c.na;d.isEnabled&&d.jG?null!==d.Jj&&0 c.ta)){var d=a.g;if(null!==d&&!d.rb){var e=a.vj;if(null!==e){var g=null,h=null;null===c.Z&&(g=Zi(a,c.m(0),!1),null!==g&&(h=g.$));var k=null,l=null;null===c.ba&&(k=Zi(a,c.m(c.ta-1),!0),null!==k&&(l=k.$));e.isValidLink(h,g,l,k)?b?(c.kq=c.m(0),c.lq=c.m(c.ta-1),c.Ni=!1,c.Z=h,null!==g&&(c.hg=g.Rd),c.ba=l,null!==k&&(c.ih=k.Rd),c.oc!==a.Pw&&d.Ja("LinkRelinked",c,a.Pw),c.Gc!==a.Qw&&d.Ja("LinkRelinked",c,a.Qw)):$i(e,h,g,l,k):$i(e,null,null,null,null)}}}} Uh.prototype.doDragOver=function(){}; function aj(a,b){var c=a.g;if(null!==c){a.Lj&&Wi(a,!0);ki(a);var d=Xi(c,b,null,function(b){return!Ui(a,b)}),e=c.U;e.Oe=d;if(null!==d){e.Cc=!1;for(var g=d;null!==g;){var h=g.HB;if(null!==h&&(h(e,g),e.Cc))break;g=Yi(g)}}else g=c.HB,null!==g&&g(e);if(a.wa||null!==di){for(e=(a.mc||a.hc).j;e.next();)g=e.key,g instanceof G&&g.Od.each(function(a){a.Ni=!1});a.doDropOnto(b,d);if(a.wa||null!==di){d=D.Ff();for(e=c.selection.j;e.next();)g=e.value,g instanceof G&&bj(c,g.getAvoidableRect(d));D.Hb(d)}}}} function bj(a,b){var c=!1;a.wb.Vk(b)&&(c=!0);c=a.eB(b,function(a){return a.$},function(a){return a instanceof J},!0,function(a){return a instanceof J},c);if(0!==c.count)for(c=c.j;c.next();){var d=c.value;d.Pj&&d.ec()}}Uh.prototype.doDropOnto=function(){}; Uh.prototype.doMouseMove=function(){if(this.wa){var a=this.g;null!==a&&null!==this.Qn&&null!==this.hc&&(this.mayCopy()?(a.rc="copy",Oi(this,!1),ci(this,this.mc),Pi(this,this.mc,!1),ti(this,this.mc)):this.mayMove()?(Ii(this),Pi(this,this.hc,!0)):this.mayDragOut()?(a.rc="no-drop",Oi(this,!1),Pi(this,this.mc,!1)):Ii(this),Vi(this,a.U.ha))}}; Uh.prototype.doMouseUp=function(){if(this.wa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.mc?(Ii(this),Oi(this,!0),ci(this,this.mc),Pi(this,this.mc,!1),ti(this,this.mc),null!==this.mc&&a.ZG(this.mc.dk())):(b=!0,Ii(this),this.mayMove()&&(Pi(this,this.hc,!0),Vi(this,a.U.ha)));this.Wr=!0;aj(this,a.U.ha);if(this.wa){this.mc=null;if(b&&null!==this.hc)for(b=this.hc.j;b.next();){var d=b.key;d instanceof G&&(d=d.Ka,null===d||null===d.placeholder||this.hc.contains(d)||d.placeholder.K())}a.Qc(); ti(this,this.hc);this.Tf=c?"Copy":"Move";a.Ja(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};Uh.prototype.mayCopy=function(){if(!this.fG)return!1;var a=this.g;if(null===a||a.rb||a.Nf||!a.aq||!a.Sk||(D.Qh?!a.U.alt:!a.U.control))return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canCopy())return!0}return null!==this.wd&&this.Lj&&this.wd.canCopy()?!0:!1}; Uh.prototype.mayDragOut=function(){if(!this.fG)return!1;var a=this.g;if(null===a||!a.gu||!a.Sk||a.km)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canCopy())return!0}return null!==this.wd&&this.Lj&&this.wd.canCopy()?!0:!1};Uh.prototype.mayMove=function(){var a=this.g;if(null===a||a.rb||!a.km)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canMove())return!0}return null!==this.wd&&this.Lj&&this.wd.canMove()?!0:!1};var Gi=new K(Uh),di=null,ei=null; Uh.prototype.getDraggingSource=function(){return di};Uh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.XE||a.rb||a.Nf||!a.aq)return!1;var b=di;return null===b||null===b.g||b.g.ea.sm!==a.ea.sm?!1:!0};Uh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Ra.$h();cj(a);a.Ra.$h();a=di;null!==a&&null!==a.g&&(a.g.rc="copy")}};Uh.prototype.doSimulatedDragLeave=function(){var a=di;null!==a&&a.doSimulatedDragOut();this.doCancel()}; Uh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=di;null!==b&&null!==b.hc&&this.mayDragIn()&&(a.rc="copy",dj(this,b.hc.dk(),!1),Pi(this,this.mc,!1),Vi(this,a.U.ha))}}; Uh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=di;if(null!==b){var c=b.g;b.Wr=!0;Ii(this);this.mayDragIn()&&(this.Qb("Drop"),dj(this,b.hc.dk(),!0),Pi(this,this.mc,!1),null!==this.mc&&a.ZG(this.mc.dk()),aj(this,a.U.ha),a.Qc(),b=a.selection,null!==this.mc?this.Tf="ExternalCopy":b=new L(F),this.mc=null,a.doFocus(),a.Ja("ExternalObjectsDropped",b,c),this.ol())}}}; function dj(a,b,c){if(null===a.mc){var d=a.g;if(null!==d&&!d.rb&&!d.Nf){d.nb=!c;d.ir=!c;a.nl=d.U.ha;c=d.jq(b,d,!0);var e=D.Ff();Ni(b,e);var d=e.x+e.width/2,g=e.y+e.height/2;D.Hb(e);var e=a.nx,h=new ma(F),k=D.O();for(b=b.j;b.next();){var l=b.value,m=c.oa(l);l.te()&&l.canCopy()?(l=l.location,k.n(e.x-(d-l.x),e.y-(g-l.y)),m.location=k,m.kf(),h.add(m,hi(a,k))):l instanceof J&&l.canCopy()&&(m.Wj(e.x-d,e.y-g),h.add(m,hi(a)))}D.A(k);a.mc=h;bi(a,h.dk());null!==a.wd&&(c=a.wd,d=c.wo,c.Wj(a.nl.x-(d.x+d.width/ 2),a.nl.y-(d.y+d.height/2)))}}}Uh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.rc="":a.rc="no-drop")};function ii(a){this.point=a;this.eH=Jd}D.ka("DraggingInfo",ii);function Qi(a,b,c){this.ad=a;this.info=b;this.bJ=c} function ej(){0 =d&&(d=.1);for(var e=this,g=b.Tn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.j;g.next();){var h=g.value,k=h.$;if(k instanceof G){var l=h.gb(mc,D.O()),m=c.x-l.x,n=c.y-l.y;D.A(l);l=m*m+n*n;l c){if(null!==this.uc&&a===this.ah&&b===this.bh)return!0;var d=b.Rd;null===d&&(d="");if(a.ay(d).count>=c)return!1}return!0}; ej.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Dq;if(null!==this.g&&this.g.cb===this&&(null!==a.layer&&!a.layer.hu||!0!==b.oH))return!1;var c=b.EK;if(Infinity>c){if(null!==this.uc&&a===this.dh&&b===this.eh)return!0;var d=b.Rd;null===d&&(d="");if(a.Xg(d).count>=c)return!1}return!0};ej.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.$,d=b.$;return null!==c&&c===d}; ej.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.$;if(!(c instanceof G))return!1;var d=a.Rd;null===d&&(d="");var e=b.$;if(!(e instanceof G))return!1;var g=b.Rd;null===g&&(g="");for(e=e.Xg(g);e.next();)if(g=e.value,g.Z===c&&g.hg===d)return!0;return!1}; ej.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.SI&&d.DK||!this.isInSameNode(b,d))&&(b.RI&&d.CK||!this.isLinked(b,d)))||null!==this.uc&&(null!==a&&this.isLabelDependentOnLink(a,this.uc)||null!==c&&this.isLabelDependentOnLink(c,this.uc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.uc))return!1;if(null!==a){var e=a.xy;if(null!==e&&!e(a,b,c,d,this.uc))return!1}if(null!== c&&(e=c.xy,null!==e&&!e(a,b,c,d,this.uc)))return!1;e=this.xy;return null!==e?e(a,b,c,d,this.uc):!0};ej.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Zb;if(null===c)return!1;if(c===b)return!0;var d=new L(G);d.add(a);return fj(this,c,b,d)};function fj(a,b,c,d){if(b===c)return!0;var e=b.Z;if(null!==e&&e.Mf&&(d.add(e),fj(a,e.Zb,c,d)))return!0;b=b.ba;return null!==b&&b.Mf&&(d.add(b),fj(a,b.Zb,c,d))?!0:!1} ej.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Dq;var d=null!==this.g?this.g.KK:gj;if(d!==gj){if(d===hj){d=c||this.Gf;if(null!==d&&!d.jc)return!0;for(d=b.Od;d.next();){var e=d.value;if(e!==c&&e.jc&&e.ba===b)return!1}return!ij(this,a,b,c,!0)}if(d===jj){d=c||this.Gf;if(null!==d&&!d.jc)return!0;for(d=a.Od;d.next();)if(e=d.value,e!==c&&e.jc&&e.Z===a)return!1;return!ij(this,a,b,c,!0)}if(d===kj)return a===b?a=!0:(d=new L(G),d.add(b),a=lj(this,d,a,b,c)), !a;if(d===mj)return!ij(this,a,b,c,!1);if(d===nj)return a===b?a=!0:(d=new L(G),d.add(b),a=oj(this,d,a,b,c)),!a}return!0};function ij(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.Od;g.next();){var h=g.value;if(h!==d&&(!e||h.jc)&&h.ba===b&&(h=h.Z,h!==b&&ij(a,h,c,d,e)))return!0}return!1} function lj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Od;g.next();){var h=g.value;if(h!==e&&h.ba===c&&(h=h.Z,h!==c&&lj(a,b,h,d,e)))return!0}return!1}function oj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Od;g.next();){var h=g.value;if(h!==e){var k=h.Z,h=h.ba,k=k===c?h:k;if(k!==c&&oj(a,b,k,d,e))return!0}}return!1} D.defineProperty(ej,{xy:"linkValidation"},function(){return this.Ul},function(a){null!==a&&D.h(a,"function",ej,"linkValidation");this.Ul=a});D.defineProperty(ej,{Jy:"portTargeted"},function(){return this.lE},function(a){null!==a&&D.h(a,"function",ej,"portTargeted");this.lE=a});function qa(){0 b.wu+1&&c =c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d? "ne-resize":"e-resize"}else if(a instanceof x)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};D.defineProperty(Xj,{Hu:"handleArchetype"},function(){return this.Kl},function(a){null!==a&&D.l(a,O,Xj,"handleArchetype");this.Kl=a});D.w(Xj,{handle:"handle"},function(){return this.xc});D.defineProperty(Xj,{Cb:"adornedObject"},function(){return this.Tc},function(a){null!==a&&D.l(a,O,Xj,"adornedObject");this.Tc=a}); Xj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.rb&&a.iu&&a.U.left?null!==this.findToolHandleAt(a.Pc.ha,this.name):!1}; Xj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.xc=this.findToolHandleAt(a.Pc.ha,this.name),null!==this.xc&&(this.Tc=this.xc.$.Cb,this.Dp.set(this.Cb.gb(this.handle.alignment.DG())),this.hE.set(this.Tc.$.location),this.cE.set(this.Tc.Ea),this.Sz=this.computeCellSize(),this.Uz=this.computeMinSize(),this.Tz=this.computeMaxSize(),a.of=!0,this.aE=a.Ra.isEnabled,a.Ra.isEnabled=!1,this.Qb(this.name),this.wa=!0))}; Xj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.ol(),this.Tc=this.xc=null,this.wa=a.of=!1,a.Ra.isEnabled=this.aE)};Xj.prototype.doCancel=function(){null!==this.Cb&&(this.Cb.Ea=this.EG,this.Cb.$.location=this.YJ);this.stopTool()};Xj.prototype.doMouseMove=function(){var a=this.g;if(this.wa&&null!==a){var b=this.Uz,c=this.Tz,d=this.Sz,e=this.Cb.OF(a.U.ha,D.O()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);a.lg();D.A(e)}}; Xj.prototype.doMouseUp=function(){var a=this.g;if(this.wa&&null!==a){var b=this.Uz,c=this.Tz,d=this.Sz,e=this.Cb.OF(a.U.ha,D.O()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);D.A(e);a.Qc();this.Tf=this.name;a.Ja("PartResized",this.Cb,this.EG)}this.stopTool()}; Xj.prototype.resize=function(a){var b=this.g;if(null!==b){var c=this.Cb,d=c.$;c.Ea=a.size;d.kf();a=this.Cb.gb(this.handle.alignment.DG());if(d instanceof I){var c=b.bb.oe,e=!1;null!==c&&(e=c.hl,c.hl=!1);var g=new K(F);g.add(d);b.moveParts(g,this.Dp.copy().Mi(a),!0);null!==c&&(c.hl=e)}else d.location=d.location.copy().Mi(a).add(this.Dp)}}; Xj.prototype.computeResize=function(a,b,c,d,e,g){b.ee()&&(b=mc);var h=this.Cb.Fa,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!g){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=D.O();gb(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width, d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.x=m-a.width,a.y=n-a.height)):1<=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.x=m-a.width)):(a.x=Math.max(q.x, m-d.width),a.x=Math.min(a.x,m-c.width),a.width=m-a.x,g||(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p,a.y=l+.5*(n-l-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.y= n-a.height)):1<=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width))):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),g||(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p,a.y=l+.5*(n-l-a.height))):0>=b.y?(a.y=Math.max(q.y,n-d.height), a.y=Math.min(a.y,n-c.height),a.height=n-a.y,g||(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width,a.x=k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width,a.x=k+.5*(m-k-a.width)));D.A(q);return a};Xj.prototype.computeReshape=function(){var a=ak;this.Cb instanceof z&&(a=bk(this.Cb));return!(a===ck||null!==this.g&&this.g.U.shift)}; Xj.prototype.computeMinSize=function(){var a=this.Cb.Zg.copy(),b=this.Zg;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};Xj.prototype.computeMaxSize=function(){var a=this.Cb.pf.copy(),b=this.pf;!isNaN(b.width)&&b.width a&&(a+=360));var b=Math.min(Math.abs(this.wK),180),c=Math.min(Math.abs(this.vK),b/2);(null===this.g||!this.g.U.shift)&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};D.defineProperty(dk,{wK:"snapAngleMultiple"},function(){return this.sE},function(a){D.h(a,"number",dk,"snapAngleMultiple");this.sE=a}); D.defineProperty(dk,{vK:"snapAngleEpsilon"},function(){return this.rE},function(a){D.h(a,"number",dk,"snapAngleEpsilon");this.rE=a});D.w(dk,{pM:"originalAngle"},function(){return this.Rw});function fk(){Hg.call(this);0 e.right&&(c.x-=d.width+5/b.scale);c.x e.bottom&&(c.y-=d.height+5/b.scale);c.y a.U.Fe?!1:!0};qk.prototype.doStart=function(){this.wa||null===this.hh||this.doActivate()}; qk.prototype.doActivate=function(){if(!this.wa){var a=this.g;if(null!==a){var b=this.hh;null===b&&(b=a.Je(a.U.ha));if(null!==b&&b instanceof na&&(this.hh=b,null!==b.$)){this.wa=!0;this.$a=zk;var c=this.yI;null!==b.nH&&(c=b.nH);this.Lk=this.hh.copy();var d=new C(this.hh.gb(ec),this.hh.gb(vc));a.WG(d);if(c instanceof hk)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();a.Kj.appendChild(c);"function"===typeof c.focus&& c.focus();"function"===typeof c.select&&this.Wy&&(c.select(),c.setSelectionRange(0,9999))}this.Ij=c}}}};qk.prototype.doCancel=function(){null!==this.ct&&this.Ij instanceof HTMLElement&&(this.Ij.style.border=this.ct,this.ct=null);this.stopTool()};qk.prototype.doMouseUp=function(){!this.wa&&this.canStart()&&this.doActivate()};qk.prototype.doMouseDown=function(){this.wa&&this.acceptText(vk)}; qk.prototype.acceptText=function(a){switch(a){case vk:if(this.$a===Dk)this.Ij instanceof HTMLElement&&this.Ij.focus();else if(this.$a===zk||this.$a===Ck||this.$a===Ak)this.$a=Bk,Gk(this);break;case uk:case xk:case wk:if(xk===a&&!0===this.AA.oy)break;if(this.$a===zk||this.$a===Ck||this.$a===Ak)this.$a=Bk,Gk(this)}}; function Gk(a){var b=a.hh,c=a.g,d=a.Ij;if(null!==b&&null!==d){var e=b.text,g="";d instanceof hk?null!==d.xC&&(g=d.xC()):(g=d.value,g="function"===typeof g?g():g);a.isValidText(b,e,g)?(a.Qb(a.name),a.$a=Dk,a.Tf=a.name,b.text=g,null!==b.mH&&b.mH(b,e,g),null!==c&&c.Ja("TextEdited",b,e),a.ol(),a.stopTool(),null!==c&&c.doFocus()):(a.$a=Ck,null!==b.dB&&b.dB(a,e,g),d instanceof hk?d.show(b,c,a):(null===a.ct&&(a.ct=d.style.border,d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}} qk.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.$a=sk;this.hh=null;if(null!==this.Ij){var b=this.Ij;if(b instanceof hk)b.$n(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.Kj.removeChild(b)}}this.wa=!1}};qk.prototype.doFocus=function(){v&&D.Sn("TextEditingTool.doFocus","2.0");Ek(this)};qk.prototype.doBlur=function(){v&&D.Sn("TextEditingTool.doBlur","2.0");Fk(this)}; function Ek(a){if(null!==a.Ij&&a.state!==sk){var b=a.Hz;a.$a===zk&&(a.$a=Ak);"function"===typeof b.select&&a.Wy&&(b.select(),b.setSelectionRange(0,9999))}}function Fk(a){if(null!==a.Ij&&a.state!==sk){var b=a.Hz;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.Wy&&(b.select(),b.setSelectionRange(0,9999))}}qk.prototype.isValidText=function(a,b,c){D.l(a,na,qk,"isValidText:textblock");var d=this.nC;if(null!==d&&!d(a,b,c))return!1;d=a.nC;return null===d||d(a,b,c)?!0:!1}; D.defineProperty(qk,{nC:"textValidation"},function(){return this.dm},function(a){null!==a&&D.h(a,"function",qk,"textValidation");this.dm=a});D.defineProperty(qk,{yG:"minimumEditorScale"},function(){return this.WD},function(a){null!==a&&D.h(a,"number",qk,"minimumEditorScale");this.WD=a});D.defineProperty(qk,{Wy:"selectsTextOnActivate"},function(){return this.pE},function(a){null!==a&&D.h(a,"boolean",qk,"selectsTextOnActivate");this.pE=a}); D.defineProperty(qk,{state:"state"},function(){return this.$a},function(a){this.$a!==a&&(D.Da(a,qk,qk,"starting"),this.$a=a)});qk.prototype.measureTemporaryTextBlock=qk.prototype.LJ=function(a){var b=this.Lk;b.text=a;Hk(b,this.hh.tp,Infinity);return b};function Ph(){Hg.call(this);this.name="ToolManager";this.JH=new K(Hg);this.KH=new K(Hg);this.LH=new K(Hg);this.AD=this.BD=850;this.pD=(new Ba(2,2)).Oa();this.IE=5E3;this.$D=ai;this.yD=Ik;this.Zv=this.dD=null;this.Cn=-1}D.Ta(Ph,Hg); D.ka("ToolManager",Ph);var ai;Ph.WheelScroll=ai=D.s(Ph,"WheelScroll",0);var $h;Ph.WheelZoom=$h=D.s(Ph,"WheelZoom",1);Ph.WheelNone=D.s(Ph,"WheelNone",2);var Ik;Ph.GestureZoom=Ik=D.s(Ph,"GestureZoom",3);var Jk;Ph.GestureCancel=Jk=D.s(Ph,"GestureCancel",4);var Kk;Ph.GestureNone=Kk=D.s(Ph,"GestureNone",5);D.defineProperty(Ph,{bv:"mouseWheelBehavior"},function(){return this.$D},function(a){D.Da(a,Ph,Ph,"mouseWheelBehavior");this.$D=a}); D.defineProperty(Ph,{bl:"gestureBehavior"},function(){return this.yD},function(a){D.Da(a,Ph,Ph,"gestureBehavior");this.yD=a});Ph.prototype.initializeStandardTools=function(){this.VH=new gk;this.HG=new fi;this.DJ=new yj;this.TG=new Xj;this.kK=new dk;this.uG=new qa;this.oe=new Uh;this.CI=new ok;this.ZJ=new pk;this.UA=new jk;this.mC=new qk;this.hI=new ra;this.iI=new fk}; Ph.prototype.updateAdornments=function(a){var b=this.rm;if(b instanceof ca&&this.Zv===a){var c=b.Cb;(null!==a?c.$===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Ph.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.U;b.Sj&&this.bl===Jk&&(b.bubbles=!1);if(b.Qu){this.cancelWaitAfter();if(this.bl===Kk){b.bubbles=!0;return}if(this.bl===Jk)return;if(a.cb.canStartMultiTouch()){a.cb.standardPinchZoomStart();return}}var c=a.na;c.OA&&0!==c.Oi&&D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.qf.length,d=0;d e.right&&(c.x-=d.width+5/b.scale);c.x e.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.y a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}D.w(jh,{lL:"animationReasons"},function(){return this.Mv}); jh.prototype.canStart=function(){return!0};jh.prototype.prepareAutomaticAnimation=jh.prototype.to=function(a){this.rf&&(this.Pl||this.ca.co)&&(this.Mv.add(a),this.canStart(a)&&(this.vk&&this.$h(),this.zc=!0))};function el(a){if(a.rf&&(a.Mv.clear(),a.zc))if(!a.Ko)a.zc=!1;else if(0===a.Rm){var b=+new Date;a.Rm=b;requestAnimationFrame(function(){if(!1!==a.zc&&!a.vk&&a.Rm===b){var c=a.ca;c.dl("temporaryPixelRatio")&&(c.Kk=1);fl(c);a.zc=!1;c.Ja("AnimationStarting");gl(a,b)}})}} function hl(a,b,c,d,e,g){if(a.zc&&(v&&D.l(b,O,jh,"addPropToAnimation:obj"),!("position"===c&&d.P(e)||b instanceof F&&!b.dG))){var h=a.nn;if(h.contains(b)){var h=h.oa(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=il(d));h.Nx&&void 0!==l[c]?h.su[c]=il(e):(g||(h.su[c]=il(e)),l[c]=il(e));g&&0===c.indexOf("position:")&&b instanceof F&&(h.su.location=il(b.location))}else k=new ja,l=new ja,k[c]=il(d),l[c]=il(e),d=l,e=k.position,e instanceof N&&!e.H()&&a.Mv.contains("Expand SubGraph")&&e.assign(d.position),k= new $k(k,l,g),g&&0===c.indexOf("position:")&&b instanceof F&&(k.su.location=il(b.location)),h.add(b,k);a.Ko=!0}}function il(a){return a instanceof N?a.copy():a instanceof Ba?a.copy():a} function gl(a,b){var c;function d(){if(!1!==g.vk&&g.Rm===b){var a=+new Date,c=a>s?m:a-r;jl(g);kl(g,e,q,h,c,m);g.Wv&&g.Wv();cj(e);ll(g);a>s?ml(g):requestAnimationFrame(d)}}void 0===c&&(c=new ja);var e=a.ca;if(null!==e){var g=a,h=c.QL||a.eD,k=c.nM||null,l=c.oM||null,m=c.duration||a.Pz,n=a.MH;for(c=a.nn.j;c.next();){var p=c.value.start.position;p instanceof N&&(p.H()||p.assign(n))}a.$C=h;a.Wv=k;a.Xv=l;a.ZC=m;a.Yv=a.nn;var q=a.Yv;for(c=q.j;c.next();)k=c.value.end,k["position:placeholder"]&&(l=c.key.findVisibleNode(), l instanceof I&&null!==l.placeholder&&(l=l.placeholder,n=l.gb(ec),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n));a.vk=!0;jl(a);kl(a,e,q,h,0,m);cj(a.ca);ll(a);var r=+new Date,s=r+m;g.Rm===b&&requestAnimationFrame(function(){d()})}}function jl(a){if(!a.pp){var b=a.ca;a.LE=b.nb;a.NC=b.Xe;a.OC=b.tv;b.nb=!0;b.Xe=!0;b.tv=!0;a.pp=!0}}function ll(a){var b=a.ca;b.nb=a.LE;b.Xe=a.NC;b.tv=a.OC;a.pp=!1} function kl(a,b,c,d,e,g){for(c=c.j;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==nl[m])nl[m](h,l[m],k[m],d,e,g)}d=b.vB;b.vB=!0;m=a.eD;0!==a.Sr&&0!==a.Rr&&(c=a.Sr,b.Ab=m(e,c,a.Rr-c,g));null!==a.Qr&&null!==a.Pr&&(c=a.Qr,a=a.Pr,b.ib=new N(m(e,c.x,a.x-c.x,g),m(e,c.y,a.y-c.y,g)));b.vB=d} jh.prototype.stopAnimation=jh.prototype.$h=function(){!0===this.zc&&(this.zc=!1,this.Rm=0,this.Ko&&this.ca.Le());this.vk&&this.rf&&ml(this)}; function ml(a){a.vk=!1;a.Ko=!1;jl(a);for(var b=a.ca,c=a.$C,d=a.ZC,e=a.Yv.j;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.su,n;for(n in l)if(void 0!==nl[n]){var p=n;!h.Nx||"position:node"!==p&&"position:placeholder"!==p||(p="position");nl[p](g,k[n],void 0!==m[n]?m[n]:h.Nx?k[n]:l[n],c,d,d)}h.Nx&&void 0!==m.location&&g instanceof F&&(g.location=m.location);h.My&&g instanceof F&&g.Pd(!1)}for(c=a.ca.links;c.next();)d=c.value,null!==d.Jp&&(d.points=d.Jp,d.Jp=null);b.yy.clear();b.Kk=null;b.Qc(); b.ra();b.lg();ol(b);ll(a);a.Xv&&a.Xv();a.Rm=0;a.Yv=null;a.Xv=null;a.Wv=null;a.Qr=null;a.Pr=null;a.Sr=0;a.Rr=0;a.nn=new ma(O,$k);b.Ja("AnimationFinished");b.Le()} function pl(a,b,c){var d=b.Y,e=c.Y,g=null;c instanceof I&&(g=c.placeholder);null!==g?(d=g.gb(ec),d.x+=g.padding.left,d.y+=g.padding.top,hl(a,b,"position",d,b.position,!1)):hl(a,b,"position",new N(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);hl(a,b,"scale",.01,b.scale,!1);if(b instanceof I)for(b=b.tc;b.next();)g=b.value,g instanceof G&&pl(a,g,c)} function ql(a,b,c){if(b.isVisible()){var d=null;c instanceof I&&(d=c.placeholder);null!==d?hl(a,b,"position:placeholder",b.position,d,!0):hl(a,b,"position:node",b.position,c,!0);hl(a,b,"scale",b.scale,.01,!0);a.zc&&(d=a.nn,d.contains(b)&&(d.oa(b).My=!0));if(b instanceof I)for(b=b.tc;b.next();)d=b.value,d instanceof G&&ql(a,d,c)}}function rl(a,b,c){a.zc&&(null===a.Qr&&b.H()&&null===a.Pr&&(a.Qr=b.copy()),a.Pr=c.copy(),a.Ko=!0)} function sl(a,b,c){a.zc&&a.ca.co&&(0===a.Sr&&0===a.Rr&&(a.Sr=b),a.Rr=c,a.Ko=!0)}D.defineProperty(jh,{isEnabled:"isEnabled"},function(){return this.rf},function(a){D.h(a,"boolean",jh,"isEnabled");this.rf=a});D.defineProperty(jh,{duration:"duration"},function(){return this.Pz},function(a){D.h(a,"number",jh,"duration");1>a&&D.ua(a,">= 1",jh,"duration");this.Pz=a});D.w(jh,{nf:"isAnimating"},function(){return this.vk});D.w(jh,{vJ:"isTicking"},function(){return this.pp}); D.defineProperty(jh,{kG:"isInitial"},function(){return this.Pl},function(a){D.h(a,"boolean",jh,"isInitial");this.Pl=a});function $k(a,b,c){this.start=a;this.end=b;this.su=new ja;this.Nx=c;this.My=!1} var nl={opacity:function(a,b,c,d,e,g){a.opacity=d(e,b,c-b,g)},position:function(a,b,c,d,e,g){e!==g?a.$y(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):a.position=new N(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},"position:node":function(a,b,c,d,e,g){var h=a.Y,k=c.Y;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==g?a.$y(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g)):a.position=new N(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g))},"position:placeholder":function(a,b,c,d,e,g){e!==g?a.$y(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)): a.position=new N(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},scale:function(a,b,c,d,e,g){a.scale=d(e,b,c-b,g)},visible:function(a,b,c,d,e,g){a.visible=e!==g?b:c}};function Gg(){0 =a)return b;for(var c=0,d=0,e=0,g=0,h=0,k=this.sb.j;k.next();){var l=k.value;l instanceof I?e++:l instanceof G?d++:l instanceof J?g++:l instanceof ca?h++:c++}k="";0 =d.count)a=d.count;else if(d.fa(a)===b)return-1;d.ce(a,b);b.Iu(c);d=this.g;null!==d&&(c?d.ra():d.vq(b));yl(this,a,b);return a}; f.zf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.zf(a,b,c);var d=this.sb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.fa(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Ju(c);d.qd(a);d=this.g;null!==d&&(c?d.ra():d.zf(b));b.Bw=null;return a}; function yl(a,b,c){b=zl(a,b,c);if(c instanceof I&&null!==c&&isNaN(c.Fo)){if(0!==c.tc.count){for(var d=-1,e=a.sb.o,g=e.length,h=0;h d&&k.Ka===c&&(d=h,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var g=b-1,h=NaN;0<=g;){h=a.fa(g).Fo;if(!isNaN(h))break;g--}for(var k=b+1,l=NaN;k d)for(;;){if(-1===g||h<=d){g++;if(g===b)break;a.qd(b);a.ce(g,c);return g}for(h=NaN;0<=--g&&(h=a.fa(g).Fo,isNaN(h)););}else if(!isNaN(l)&&l =d){k--;if(k===b)break;a.qd(b);a.ce(k,c);return k}for(l=NaN;++k a||1parseInt(e[1],10)&&(D.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+D.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),D.Sx.licenseKey=!0);this.mi=1;this.zk=0;this.Aw=new N;this.DA=500;this.Nv=new N;this.Kt=null;this.xk=!1;this.preventDefault=this.Ly=this.Mq=this.Nq=this.Lq=this.Kq=this.oo=this.qo=this.po=this.mo=this.no=this.yC=this.qC=this.rC=this.sC=this.am=this.xt= this.$l=this.wt=null;this.uw=!1;this.Ml=new Ml;void 0!==a&&Nl(this,a);this.gd=!1}D.ka("Diagram",E);E.prototype.clear=E.prototype.clear=function(){this.ea.clear();th=null;uh="";Ol(this,!1);this.bw=(new C(NaN,NaN,NaN,NaN)).freeze();this.ra()}; function Ol(a,b){var c=null;null!==a.Dd&&(c=a.Dd.$);a.Ra.$h();for(var d=[],e=a.dc.length,g=0;g =a)return b;for(var c=this.dc.j;c.next();)b+="\n "+c.value.toString(a-1);return b};E.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.ca instanceof E?b.ca:null}; D.defineProperty(E,{Kj:"div"},function(){return this.Vb},function(a){null!==a&&D.l(a,HTMLDivElement,E,"div");if(this.Vb!==a){Bl=[];var b=this.Vb;null!==b?(b.ca=void 0,b.innerHTML="",null!==this.Gb&&(this.Gb.removeEventListener("touchstart",this.sC,!1),this.Gb.removeEventListener("touchmove",this.rC,!1),this.Gb.removeEventListener("touchend",this.qC,!1),this.Gb.ae.ca=null),b=this.bb,null!==b&&(b.qf.each(function(a){a.cancelWaitAfter()}),b.mg.each(function(a){a.cancelWaitAfter()}),b.ng.each(function(a){a.cancelWaitAfter()})), b.cancelWaitAfter(),this.cb.doCancel(),this.fd=this.Gb=null,window.removeEventListener("resize",this.yC,!1),window.removeEventListener("mousemove",this.no,!0),window.removeEventListener("mousedown",this.mo,!0),window.removeEventListener("mouseup",this.po,!0),window.removeEventListener("wheel",this.qo,!0),window.removeEventListener("mouseout",this.oo,!0)):this.rh=!1;this.Vb=null;if(null!==a){if(b=a.ca)b.Kj=null;Nl(this,a);this.vo()}}}); function Rl(a){var b=a.Gb;a.sz?(b.addEventListener("pointerdown",a.Kq,!1),b.addEventListener("pointermove",a.Lq,!1),b.addEventListener("pointerup",a.Nq,!1),b.addEventListener("pointerout",a.Mq,!1)):(b.addEventListener("touchstart",a.sC,!1),b.addEventListener("touchmove",a.rC,!1),b.addEventListener("touchend",a.qC,!1),b.addEventListener("mousemove",a.no,!1),b.addEventListener("mousedown",a.mo,!1),b.addEventListener("mouseup",a.po,!1),b.addEventListener("mouseout",a.oo,!1));b.addEventListener("wheel", a.qo,!1);b.addEventListener("keydown",a.xJ,!1);b.addEventListener("keyup",a.yJ,!1);b.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturestart",function(b){a.bb.bl!==Kk&&(a.bb.bl===Jk?b.preventDefault():(b.preventDefault(),a.ft=a.scale,a.cb.doCancel()))},!1);b.addEventListener("gesturechange",function(b){if(a.bb.bl!==Kk)if(a.bb.bl===Jk)b.preventDefault();else{b.preventDefault(); var d=b.scale;if(null!==a.ft){var e=a.Lb,g=a.Kb,h=a.Gb.getBoundingClientRect();b=new N(b.pageX-window.scrollX-e/h.width*h.left,b.pageY-window.scrollY-g/h.height*h.top);d*=a.ft;e=a.xb;d!==a.scale&&e.canResetZoom(d)&&(g=a.Ri,a.Ri=b,e.resetZoom(d),a.Ri=g)}}},!1);window.addEventListener("resize",a.yC,!1)} E.prototype.computePixelRatio=function(){if(null!==this.Kk)return this.Kk;var a=this.fd;return(window.devicePixelRatio||1)/(a.za.webkitBackingStorePixelRatio||a.za.mozBackingStorePixelRatio||a.za.msBackingStorePixelRatio||a.za.oBackingStorePixelRatio||a.za.backingStorePixelRatio||1)};E.prototype.doMouseMove=function(){this.cb.doMouseMove()};E.prototype.doMouseDown=function(){this.cb.doMouseDown()};E.prototype.doMouseUp=function(){this.cb.doMouseUp()};E.prototype.doMouseWheel=function(){this.cb.doMouseWheel()}; E.prototype.doKeyDown=function(){this.cb.doKeyDown()};E.prototype.doKeyUp=function(){this.cb.doKeyUp()};E.prototype.doFocus=function(){this.focus()};E.prototype.focus=E.prototype.focus=function(){if(this.Gb)if(this.oK)this.Gb.focus();else{var a=window.scrollX||window.pageXOffset,b=window.scrollY||window.pageYOffset;this.Gb.focus();window.scrollTo(a,b)}}; function fl(a){if(null!==a.Gb){var b=a.Vb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.Ll?a.Jd:0,d=a.tk?a.Jd:0,e=a.hd;a.hd=a.computePixelRatio();a.hd!==e&&(a.ns=!0,a.Le());if(b.clientWidth!==a.Lb+c||b.clientHeight!==a.Kb+d)a.$m=!0,a.Pe=!0,b=a.$b,null!==b&&b.qy&&a.nm===Vh&&(a.Tr=!0,b.L()),a.ke||a.Le()}}} function Kl(a){var b=new Gg;b.name="Background";a.cu(b);b=new Gg;b.name="";a.cu(b);b=new Gg;b.name="Foreground";a.cu(b);b=new Gg;b.name="Adornment";b.$c=!0;a.cu(b);b=new Gg;b.name="Tool";b.$c=!0;b.eG=!0;a.cu(b);b=new Gg;b.name="Grid";b.Kf=!1;b.sg=!1;b.$c=!0;a.YH(b,a.um("Background"))} function Sl(a){a.Dd=new x(Tl);a.Dd.name="GRID";var b=new z;b.Ob="LineH";b.stroke="lightgray";b.ob=.5;b.interval=1;a.Dd.add(b);b=new z;b.Ob="LineH";b.stroke="gray";b.ob=.5;b.interval=5;a.Dd.add(b);b=new z;b.Ob="LineH";b.stroke="gray";b.ob=1;b.interval=10;a.Dd.add(b);b=new z;b.Ob="LineV";b.stroke="lightgray";b.ob=.5;b.interval=1;a.Dd.add(b);b=new z;b.Ob="LineV";b.stroke="gray";b.ob=.5;b.interval=5;a.Dd.add(b);b=new z;b.Ob="LineV";b.stroke="gray";b.ob=1;b.interval=10;a.Dd.add(b);b=new F;b.add(a.Dd); b.Of="Grid";b.Fo=0;b.my=!1;b.dG=!1;b.sg=!1;b.zy="GRID";a.add(b);a.sb.remove(b);a.Dd.visible=!1}function Ul(){this.ca.sA?this.ca.sA=!1:this.ca.isEnabled?this.ca.BI(this):Vl(this.ca)}function Wl(a){this.ca.isEnabled?(this.ca.uA=a.target.scrollTop,this.ca.tA=a.target.scrollLeft):Vl(this.ca)} E.prototype.diagramScroll=E.prototype.BI=function(a){if(null!==this.Gb){this.$w=!0;var b=this.Xc,c=this.wb,d=this.Sy,e=b.x-d.left,g=b.y-d.top,h=b.width+d.left+d.right,k=b.height+d.top+d.bottom,l=b.right+d.right,d=b.bottom+d.bottom,m=c.x,b=c.y,n=c.width,p=c.height,q=c.right,r=c.bottom,c=this.scale,s;s=a.scrollLeft;if(this.ss)switch(this.qA){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;n q&&(this.position=s.n(-(this.gx.scrollWidth-this.Lb)+u-this.Lb/c+l,this.position.y))),a.PH&&this.De&&(gr&&(this.position=s.n(this.position.x,-(this.gx.scrollHeight-this.Kb)+a.scrollTop-this.Kb/c+d))),D.A(s),Xl(this), this.$m=this.$w=!1,b=this.Xc,c=this.wb,l=b.right,q=c.right,d=b.bottom,r=c.bottom,e=b.x,m=c.x,g=b.y,b=c.y,n>=h&&e>=m&&l<=q&&(this.Bt.style.width="1px"),p>=k&&g>=b&&d<=r&&(this.Bt.style.height="1px"))}};E.prototype.computeBounds=E.prototype.Kh=function(){0 c&&(e=c),e a.Sh&&(e=a.Sh),e):b===dm?(e=l>k?(h-a.Jd)/d:(g-a.Jd)/e,e>c&&(e=c),e a.Sh&&(e=a.Sh),e):a.scale}E.prototype.zoomToFit=E.prototype.zoomToFit=function(){this.scale=$l(this,cm);this.Ty!==Cl&&(this.ib.Xa(),am(this,this.ib,this.Xc,this.Lb/this.Ab,this.Kb/this.Ab,this.Vm,!0),this.ib.freeze())}; E.prototype.zoomToRect=function(a,b){void 0===b&&(b=cm);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===cm||b===dm)if(isNaN(c))e=this.wb.height*this.scale/d;else if(isNaN(d))e=this.wb.width*this.scale/c;else var e=this.Lb,g=this.Kb,e=b===dm?g/d>e/c?(g-(this.tk?this.Jd:0))/d:(e-(this.Ll?this.Jd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new N(a.x,a.y)}};D.defineProperty(E,{vB:null},function(){return this.gd},function(a){this.gd=a}); E.prototype.alignDocument=function(a,b){this.uk&&bm(this,this.Kh());var c=this.Xc,d=this.wb;this.position=new N(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; function am(a,b,c,d,e,g,h){var k=b.x,l=b.y;if(h||a.Ty===Cl)g.Zc()&&(d>c.width&&(k=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(l=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY))),g=a.Sy,h=d-c.width,d c.left?k=c.left:k c.top?l=c.top:l b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.Fp[0])e=a.Fp[c];else return;c=a.Gb;b=a.Lb;a=a.Kb;var g=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),g=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.n(g,h)}E.prototype.invalidateDocumentBounds=E.prototype.Qc=function(){this.uk||(this.uk=!0,this.Le(!0))};function ol(a){a.ke||Ti(a);a.uk&&bm(a,a.Kh())} E.prototype.redraw=E.prototype.vo=function(){this.gd||this.ke||(this.ra(),jm(this),Xl(this),this.Qc(),this.lg())};E.prototype.isUpdateRequested=function(){return this.cg};E.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Ra,c=b.isEnabled;b.$h();b.isEnabled=!1;cj(this);this.rh=!1;b.isEnabled=c;null!==a&&D.setTimeout(a,1)}; E.prototype.requestUpdate=E.prototype.Le=function(a){void 0===a&&(a=!1);if(!0!==this.cg&&!(this.gd||!1===a&&this.ke)){this.cg=!0;var b=this;requestAnimationFrame(function(){b.cg&&b.lg()})}};E.prototype.maybeUpdate=E.prototype.lg=function(){if(!this.dp||this.cg)this.dp&&(this.dp=!1),cj(this)};function km(a,b){a.Ra.nf||a.gd||!a.$m||Vl(a)||(b&&Ti(a),Zl(a,!1))} function cj(a){if(!a.ke&&(a.cg=!1,null!==a.Vb)){a.ke=!0;var b=a.Ra,c=a.nA;if(!b.pp&&0!==c.length){for(var d=c.o,e=d.length,g=0;g b;b++){var c=a.Fg.j;if(null===c||0===a.Fg.count)break;a.Fg=new L(F);a.wC(c,a.Fg);v&&22===b&&D.trace("failure to validate parts")}a.qg.each(function(a){a instanceof I&&0!==(a.Ca&65536)!==!1&&(a.Ca^=65536)})}} E.prototype.wC=function(a,b){for(a.reset();a.next();){var c=a.value;!c.te()||c instanceof I||(c.Dm()?(Hk(c,Infinity,Infinity),c.qc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof I&&c.isVisible()&&zm(this,c);for(a.reset();a.next();)c=a.value,c instanceof J&&c.isVisible()&&(c.Dm()?(Hk(c,Infinity,Infinity),c.qc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof ca&&c.isVisible()&&(c.Dm()?(Hk(c,Infinity,Infinity),c.qc()):b.add(c))}; function zm(a,b){for(var c=D.pb(),d=D.pb(),e=b.tc;e.next();){var g=e.value;g.isVisible()&&(g instanceof I?(Nm(g)||Om(g)||Pm(g))&&zm(a,g):g instanceof J?g.Z===b||g.ba===b?d.push(g):c.push(g):(Hk(g,Infinity,Infinity),g.qc()))}for(var e=c.length,h=0;h m&&(q=t.left,r=t.right),p.height>c&&(s=t.top,u=t.bottom)):(q=t.left,r=t.right,s=t.top,u=t.bottom);var t=p.width+q+r,y=p.height+s+u,q=p.x-q,w=n.x,r=p.right+r,A=n.right+ k,s=p.y-s,B=n.y,u=p.bottom+u,n=n.bottom+l,P="1px",H="1px",p=a.scale,Q=!(t A+1&&(P=Math.max((r-A)*p+a.Lb,P)),m+k+1 n+1&&(H=Math.max((u-n)*p+a.Kb,H)),c+l+1 A+1&&(P=Math.max((r-A)*p+a.Lb,P)),m+1 n+1&&(H=Math.max((u-n)*p+k,H)),c+1 A+1&&(k=a.position.x*p));if(a.ss)switch(a.qA){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth- k-b.clientWidth}b.scrollLeft=k;a.pB&&a.De&&(c+1 n+1&&(b.scrollTop=a.position.y*p));m=a.Lb;c=a.Kb;b.style.width=m+(a.Ll?a.Jd:0)+"px";b.style.height=c+(a.tk?a.Jd:0)+"px";return d!==m||e!==c||a.Ra.zc?(n=a.wb,a.fv(g,n,p,a.scale,h),!1):!0} E.prototype.add=E.prototype.add=function(a){D.l(a,F,E,"add:part");var b=a.g;if(b!==this){null!==b&&D.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.ir&&(a.Sl="Tool");var c=a.Of,b=this.um(c);null===b&&(b=this.um(""));null===b&&D.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.vq(99999999,a,a.g===this),0<=c&&this.pd(gg,"parts",b,null,a,null,c),b.$c||this.Qc(),a.L(Wm),c=a.uy,null!== c&&c(a,null,b))}}; E.prototype.vq=function(a){if(a instanceof G){if(this.Cp.add(a),a instanceof I){var b=a.Ka;null===b?this.em.add(a):b.ln.add(a);b=a.$b;null!==b&&(b.g=this)}}else a instanceof J?this.wp.add(a):a instanceof ca||this.sb.add(a);var c=this;Xm(a,function(a){Ym(c,a)});(a instanceof ca||a instanceof I&&null!==a.Tb)&&a.K();b=a.data;null!==b&&(a instanceof ca||(a instanceof J?this.jk.add(b,a):this.Zi.add(b,a)),Xm(a,function(a){Zm(c,a)}));!0!==Om(a)&&!0!==Pm(a)||this.Fg.add(a);$m(a,!0,this);an(a)?(a.Y.H()&&this.ra(xl(a, a.Y)),this.Qc()):a.isVisible()&&a.Y.H()&&this.ra(xl(a,a.Y));this.Le()}; E.prototype.zf=function(a){a.lu();if(a instanceof G){if(this.Cp.remove(a),a instanceof I){var b=a.Ka;null===b?this.em.remove(a):b.ln.remove(a);b=a.$b;null!==b&&(b.g=null)}}else a instanceof J?this.wp.remove(a):a instanceof ca||this.sb.remove(a);var c=this;Xm(a,function(a){bn(c,a)});b=a.data;null!==b&&(a instanceof ca||(a instanceof J?this.jk.remove(b):this.Zi.remove(b)),Xm(a,function(a){cn(c,a)}));this.Fg.remove(a);an(a)?(a.Y.H()&&this.ra(xl(a,a.Y)),this.Qc()):a.isVisible()&&a.Y.H()&&this.ra(xl(a, a.Y));this.Le()};E.prototype.remove=E.prototype.remove=function(a){D.l(a,F,E,"remove:part");dn(this,a,!0)};function dn(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.lb=!1,b.Yg=!1,b.L(en),c&&b.Rn(),c=d.zf(-1,b,!1),0<=c&&a.pd(hg,"parts",d,b,null,c,null),a=b.uy,null!==a&&a(b,d,null))} E.prototype.removeParts=E.prototype.WB=function(a,b){if(D.isArray(a))for(var c=D.fb(a),d=0;d d&&this.Qc()}; E.prototype.addLayerAfter=function(a,b){fn(this,a,b);a.cd(this);var c=this.dc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Ae&&this.pd(hg,"layers",this,a,null,d,null));for(var e=c.count,g=0;g d&&this.Qc()}; E.prototype.removeLayer=function(a){D.l(a,Gg,E,"removeLayer:layer");a.g!==this&&D.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.dc,c=b.indexOf(a);if(b.remove(a)){for(b=a.sb.copy().j;b.next();){var d=b.value,e=d.Of;d.Of=e!==a.name?e:""}null!==this.Ae&&this.pd(hg,"layers",this,a,null,c,null);this.ra();this.Qc()}}};E.prototype.findLayer=E.prototype.um=function(a){for(var b=this.fo;b.next();){var c=b.value;if(c.name===a)return c}return null}; E.prototype.addModelChangedListener=E.prototype.$H=function(a){D.h(a,"function",E,"addModelChangedListener:listener");null===this.xh&&(this.xh=new K("function"));this.xh.add(a);this.ea.Fn(a)};E.prototype.removeModelChangedListener=function(a){D.h(a,"function",E,"removeModelChangedListener:listener");null!==this.xh&&(this.xh.remove(a),0===this.xh.count&&(this.xh=null));this.ea.iv(a)}; E.prototype.addChangedListener=E.prototype.Fn=function(a){D.h(a,"function",E,"addChangedListener:listener");null===this.Ui&&(this.Ui=new K("function"));this.Ui.add(a)};E.prototype.removeChangedListener=E.prototype.iv=function(a){D.h(a,"function",E,"removeChangedListener:listener");null!==this.Ui&&(this.Ui.remove(a),0===this.Ui.count&&(this.Ui=null))};E.prototype.Jx=function(a){this.nb||this.na.YF(a);a.Oc!==fg&&(this.Ki=!0);if(null!==this.Ui)for(var b=this.Ui,c=b.length,d=0;d a.Sh&&(c=a.Sh);e=D.Fb(a.ib.x+h/b-h/c,a.ib.y+k/b-k/c);a.position=e;D.A(e);a.Ab=c;a.fv(d,a.wb,b,c,!1);a.gd=!1;Zl(a, !1);c=a.Ra;c.zc&&sl(c,b,a.Ab);a.ra();jm(a)}} E.prototype.fv=function(a,b,c,d,e){a.P(b)||(void 0===e&&(e=!1),e||jm(this),Xl(this),d=this.$b,null===d||!d.qy||this.nm!==Vh||e||a.width===b.width&&a.height===b.height||d.L(),d=this.cb,!0===this.sh&&d instanceof Ph&&(this.U.ha=this.tC(this.U.Sd),Xk(d,this)),this.gd||this.cG(a,b),mm(this),this.Fh.scale=c,this.Fh.position.x=a.x,this.Fh.position.y=a.y,this.Fh.bounds.set(a),this.Fh.isScroll=e,this.Ja("ViewportBoundsChanged",this.Fh,a),this.AB&&this.links.each(function(a){a.Pj&&a.Y.jg(b)&&a.ec()}))}; function mm(a,b){void 0===b&&(b=null);var c=a.Dd;if(null!==c&&c.visible){for(var d=D.Mm(),e=1,g=1,h=c.xa.o,k=h.length,l=0;l n||(hn(m.Ob)?g=g*n/Se(g,n):e=e*n/Se(e,n))}h=c.iy;d.n(g*h.width,e*h.height);h=g=l=k=0;if(null!==b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=D.Ff();g=a.wb;e.n(g.x,g.y,g.width,g.height);for(h=a.Tw.j;h.next();)g=h.value.wb,g.H()&&Ub(e,g.x,g.y,g.width,g.height);if(!e.H()){D.Hb(e);return}k=e.width;l=e.height;g=e.x;h=e.y;D.Hb(e)}c.width=k+2*d.width;c.height= l+2*d.height;e=D.O();gb(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);D.al(d);c.$.location=e;D.A(e)}}E.prototype.clearSelection=E.prototype.PA=function(){var a=0 a&&D.ua(a,">= 0",E,"scrollHorizontalLineChange"),this.ax=a,this.i("scrollHorizontalLineChange",b,a))}); D.defineProperty(E,{ov:"scrollVerticalLineChange"},function(){return this.hx},function(a){var b=this.hx;b!==a&&(D.h(a,"number",E,"scrollVerticalLineChange"),0>a&&D.ua(a,">= 0",E,"scrollVerticalLineChange"),this.hx=a,this.i("scrollVerticalLineChange",b,a))});D.defineProperty(E,{U:"lastInput"},function(){return this.Wb},function(a){v&&D.l(a,ag,E,"lastInput");this.Wb=a});D.defineProperty(E,{Pc:"firstInput"},function(){return this.ej},function(a){v&&D.l(a,ag,E,"firstInput");this.ej=a}); D.defineProperty(E,{rc:"currentCursor"},function(){return this.Vv},function(a){""===a&&(a=this.Nr);if(this.Vv!==a){D.h(a,"string",E,"currentCursor");var b=this.Gb,c=this.Vb;if(null!==b){this.Vv=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor=a)))}}}); D.defineProperty(E,{zL:"defaultCursor"},function(){return this.Nr},function(a){""===a&&(a="auto");var b=this.Nr;b!==a&&(D.h(a,"string",E,"defaultCursor"),this.Nr=a,this.i("defaultCursor",b,a))});D.defineProperty(E,{click:"click"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(null!==a&&D.h(a,"function",E,"click"),this.Vi=a,this.i("click",b,a))}); D.defineProperty(E,{qu:"doubleClick"},function(){return this.bj},function(a){var b=this.bj;b!==a&&(null!==a&&D.h(a,"function",E,"doubleClick"),this.bj=a,this.i("doubleClick",b,a))});D.defineProperty(E,{TA:"contextClick"},function(){return this.Xi},function(a){var b=this.Xi;b!==a&&(null!==a&&D.h(a,"function",E,"contextClick"),this.Xi=a,this.i("contextClick",b,a))}); D.defineProperty(E,{KB:"mouseOver"},function(){return this.qj},function(a){var b=this.qj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseOver"),this.qj=a,this.i("mouseOver",b,a))});D.defineProperty(E,{JB:"mouseHover"},function(){return this.pj},function(a){var b=this.pj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHover"),this.pj=a,this.i("mouseHover",b,a))}); D.defineProperty(E,{IB:"mouseHold"},function(){return this.oj},function(a){var b=this.oj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHold"),this.oj=a,this.i("mouseHold",b,a))});D.defineProperty(E,{TJ:"mouseDragOver"},function(){return this.Nw},function(a){var b=this.Nw;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDragOver"),this.Nw=a,this.i("mouseDragOver",b,a))}); D.defineProperty(E,{HB:"mouseDrop"},function(){return this.nj},function(a){var b=this.nj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDrop"),this.nj=a,this.i("mouseDrop",b,a))});D.defineProperty(E,{pC:"toolTip"},function(){return this.zj},function(a){var b=this.zj;b!==a&&(!v||null===a||a instanceof ca||a instanceof hk||D.k("Diagram.toolTip must be an Adornment or HTMLInfo."),this.zj=a,this.i("toolTip",b,a))}); D.defineProperty(E,{contextMenu:"contextMenu"},function(){return this.Yi},function(a){var b=this.Yi;b!==a&&(!v||a instanceof ca||a instanceof hk||D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Yi=a,this.i("contextMenu",b,a))});D.defineProperty(E,{xb:"commandHandler"},function(){return this.Cz},function(a){var b=this.Cz;b!==a&&(D.l(a,pa,E,"commandHandler"),null!==a.g&&D.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.cd(null),this.Cz=a,a.cd(this))}); D.defineProperty(E,{bb:"toolManager"},function(){return this.BA},function(a){var b=this.BA;b!==a&&(D.l(a,Ph,E,"toolManager"),null!==a.g&&D.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.cd(null),this.BA=a,a.cd(this))});D.defineProperty(E,{pu:"defaultTool"},function(){return this.Iz},function(a){var b=this.Iz;b!==a&&(D.l(a,Hg,E,"defaultTool"),this.Iz=a,this.cb===b&&(this.cb=a))}); D.defineProperty(E,{cb:"currentTool"},function(){return this.Fz},function(a){var b=this.Fz;null!==b&&(b.wa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.pu);null!==a&&(D.l(a,Hg,E,"currentTool"),this.Fz=a,a.cd(this),a.doStart())});D.w(E,{selection:"selection"},function(){return this.lx}); D.defineProperty(E,{KJ:"maxSelectionCount"},function(){return this.Iw},function(a){var b=this.Iw;if(b!==a)if(D.h(a,"number",E,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Iw=a,this.i("maxSelectionCount",b,a),!this.na.ub&&(a=this.selection.count-a,0= 0",E,"maxSelectionCount")}); D.defineProperty(E,{WJ:"nodeSelectionAdornmentTemplate"},function(){return this.Ow},function(a){var b=this.Ow;b!==a&&(D.l(a,ca,E,"nodeSelectionAdornmentTemplate"),this.Ow=a,this.i("nodeSelectionAdornmentTemplate",b,a))});D.defineProperty(E,{cJ:"groupSelectionAdornmentTemplate"},function(){return this.jw},function(a){var b=this.jw;b!==a&&(D.l(a,ca,E,"groupSelectionAdornmentTemplate"),this.jw=a,this.i("groupSelectionAdornmentTemplate",b,a))}); D.defineProperty(E,{EJ:"linkSelectionAdornmentTemplate"},function(){return this.Dw},function(a){var b=this.Dw;b!==a&&(D.l(a,ca,E,"linkSelectionAdornmentTemplate"),this.Dw=a,this.i("linkSelectionAdornmentTemplate",b,a))});D.w(E,{Am:"highlighteds"},function(){return this.nw}); D.defineProperty(E,{Ki:"isModified"},function(){var a=this.na;return a.isEnabled?null!==a.Jj?!0:this.uw&&this.qh!==a.Nj:this.uw},function(a){if(this.uw!==a){D.h(a,"boolean",E,"isModified");this.uw=a;var b=this.na;!a&&b.isEnabled&&(this.qh=b.Nj);a||ln(this)}});function ln(a){var b=a.Ki;a.NE!==b&&(a.NE=b,a.Ja("Modified"))} D.defineProperty(E,{ea:"model"},function(){return this.Ae},function(a){var b=this.Ae;if(b!==a){D.l(a,M,E,"model");this.cb.doCancel();null!==b&&b.na!==a.na&&b.na.jG&&D.k("Do not replace a Diagram.model while a transaction is in progress.");Ol(this,!0);this.rh=!1;this.dp=!0;this.qh=-2;this.cg=!1;var c=this.ke;this.ke=!0;this.Ra.to("Model");null!==b&&(null!==this.xh&&this.xh.each(function(a){b.iv(a)}),b.iv(this.YD));this.Ae=a;a.Fn(this.XD);mn(this,a.$g);a instanceof X&&nn(this,a.Rh);a.iv(this.XD);a.Fn(this.YD); null!==this.xh&&this.xh.each(function(b){a.Fn(b)});this.ke=c;this.gd||this.ra();null!==b&&(a.na.isEnabled=b.na.isEnabled)}});D.defineProperty(E,{ab:null},function(){return this.QD},function(a){this.QD=a});D.w(E,{yy:null},function(){return this.IH}); function Gl(a,b){if(b.ea===a.ea){var c=b.Oc,d=b.propertyName;if(c===fg&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.bb,c.qf.each(function(b){b.cd(a)}),c.mg.each(function(b){b.cd(a)}),c.ng.each(function(b){b.cd(a)}),a.ke||a.rh||(a.Tr=!0,a.dp&&(a.cg=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Ra;e.nf&&!a.nb&&e.$h();a.Ja("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Ra,e.nf&&!a.nb&&e.$h());else if(a.ab){a.ab=!1;try{var g=b.Df;if(""!==g)if(c===eg){if("linkFromKey"===g){var h= b.object,k=a.gg(h);if(null!==k){var l=b.newValue,m=a.Ue(l);k.Z=m}}else if("linkToKey"===g)h=b.object,k=a.gg(h),null!==k&&(l=b.newValue,m=a.Ue(l),k.ba=m);else if("linkFromPortId"===g){if(h=b.object,k=a.gg(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.hg=n)}}else if("linkToPortId"===g)h=b.object,k=a.gg(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.ih=n));else if("nodeGroupKey"===g){var h=b.object,p=a.Nh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Ue(q);p.Ka=r instanceof I?r: null}else p.Ka=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.gg(h),null!==k){var s=b.oldValue,u=b.newValue;if(D.isArray(s))for(var t=D.fb(s),y=0;y l)){var m=l;vn(k)&&m++;k.zf(m,!0);wn(k,m,l)}}}}function Zm(a,b){var c=b.ij;if(D.isArray(c)){var d=a.cn.oa(c);if(null===d)d=[],d.push(b),a.cn.add(c,d);else{for(c=0;c this.scale&&(this.scale=a)):D.ua(a,"> 0",E,"minScale"))}); D.defineProperty(E,{Sh:"maxScale"},function(){return this.Hw},function(a){D.p(a,E,"maxScale");var b=this.Hw;b!==a&&(0 0",E,"maxScale"))});D.defineProperty(E,{Ri:"zoomPoint"},function(){return this.zx},function(a){this.zx.P(a)||(D.l(a,N,E,"zoomPoint"),this.zx=a=a.V())}); D.defineProperty(E,{SA:"contentAlignment"},function(){return this.Vm},function(a){var b=this.Vm;b.P(a)||(D.l(a,R,E,"contentAlignment"),this.Vm=a=a.V(),this.i("contentAlignment",b,a),Zl(this,!1))});D.defineProperty(E,{WL:"initialContentAlignment"},function(){return this.jp},function(a){var b=this.jp;b.P(a)||(D.l(a,R,E,"initialContentAlignment"),this.jp=a=a.V(),this.i("initialContentAlignment",b,a))}); D.defineProperty(E,{padding:"padding"},function(){return this.tf},function(a){"number"===typeof a?a=new Lb(a):D.l(a,Lb,E,"padding");var b=this.tf;b.P(a)||(this.tf=a=a.V(),this.Qc(),this.i("padding",b,a))});D.w(E,{qg:"nodes"},function(){return this.Cp.j});D.w(E,{links:"links"},function(){return this.wp.j});D.w(E,{Vh:"parts"},function(){return this.sb.j}); E.prototype.findTopLevelNodesAndLinks=function(){for(var a=new L(F),b=this.Cp.j;b.next();){var c=b.value;c.Cq&&a.add(c)}for(b=this.wp.j;b.next();)c=b.value,c.Cq&&a.add(c);return a.j};E.prototype.findTopLevelGroups=function(){return this.em.j};D.defineProperty(E,{$b:"layout"},function(){return this.ye},function(a){var b=this.ye;b!==a&&(D.l(a,Zg,E,"layout"),null!==b&&(b.g=null,b.group=null),this.ye=a,a.g=this,a.group=null,this.gk=!0,this.i("layout",b,a),this.Le())}); E.prototype.layoutDiagram=function(a){Ti(this);a&&Cn(this,!0);nm(this,!1)};function Cn(a,b){for(var c=a.em.j;c.next();)Jn(a,c.value,b);null!==a.$b&&(b?a.$b.Af=!1:a.$b.L())}function Jn(a,b,c){if(null!==b){for(var d=b.ln.j;d.next();)Jn(a,d.value,c);null!==b.$b&&(c?b.$b.Af=!1:b.$b.L())}} function nm(a,b){if(a.gk&&!a.Jz){var c=a.ab;a.ab=!0;var d=a.na.Oi,e=a.$b;try{0===d&&a.Qb("Layout");var g=a.Ra;1>=d&&!g.nf&&!g.zc&&(b||g.to("Layout"));a.gk=!1;for(var h=a.em.j;h.next();)Kn(a,h.value,b,d);e.Af||(!b||e.mG||0===d?(e.doLayout(a),Ti(a),e.Af=!0):a.gk=!0)}finally{0===d&&a.ld("Layout"),a.gk=!e.Af,a.ab=c}}} function Kn(a,b,c,d){if(null!==b){for(var e=b.ln.j;e.next();)Kn(a,e.value,c,d);e=b.$b;null===e||e.Af||(!c||e.mG||0===d?(b.ro=!b.location.H(),e.doLayout(b),b.L(Ln),zm(a,b),e.Af=!0):a.gk=!0)}}D.defineProperty(E,{fe:"isTreePathToChildren"},function(){return this.xw},function(a){var b=this.xw;if(b!==a&&(D.h(a,"boolean",E,"isTreePathToChildren"),this.xw=a,this.i("isTreePathToChildren",b,a),!this.na.ub))for(a=this.qg;a.next();)Mn(a.value)}); E.prototype.findTreeRoots=function(){for(var a=new K(G),b=this.qg;b.next();){var c=b.value;c.Cq&&null===c.Un()&&a.add(c)}return a.j};D.defineProperty(E,{uC:"treeCollapsePolicy"},function(){return this.ux},function(a){var b=this.ux;b!==a&&(a!==El&&a!==jn&&a!==kn&&D.k("Unknown Diagram.treeCollapsePolicy: "+a),this.ux=a,this.i("treeCollapsePolicy",b,a))});D.defineProperty(E,{Ph:null},function(){return this.ED},function(a){this.ED=a}); function Dl(a){function b(a){var b=a.toLowerCase(),h=new K("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ma("string",K),d=new ma("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified"); b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.Lz=c;a.Kz=d} function Fa(a,b){var c=a.Kz.oa(b);return null!==c?c:a.Kz.oa(b.toLowerCase())}function Nn(a,b){var c=a.Lz.oa(b);if(null!==c)return c;c=a.Lz.oa(b.toLowerCase());if(null!==c)return c;D.k("Unknown DiagramEvent name: "+b);return null}E.prototype.addDiagramListener=E.prototype.Ax=function(a,b){D.h(a,"string",E,"addDiagramListener:name");D.h(b,"function",E,"addDiagramListener:listener");var c=Nn(this,a);null!==c&&c.add(b)}; E.prototype.removeDiagramListener=E.prototype.VB=function(a,b){D.h(a,"string",E,"removeDiagramListener:name");D.h(b,"function",E,"addDiagramListener:listener");var c=Nn(this,a);null!==c&&c.remove(b)}; E.prototype.raiseDiagramEvent=E.prototype.Ja=function(a,b,c){v&&D.h(a,"string",E,"raiseDiagramEvent:name");var d=Nn(this,a),e=new cg;e.g=this;a=Fa(this,a);null!==a&&(e.name=a);void 0!==b&&(e.lC=b);void 0!==c&&(e.QB=c);b=d.length;if(1===b)d=d.fa(0),d(e);else if(0!==b)for(c=d.Fc(),a=0;a=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.wb,g=a.scale,e=D.ug(0,0,e.width*g,e.height*g),h=D.Fb(0,0);if(b.x>=e.x&&b.x e.x+e.width-d.right&&(k=Math.max(a.nv,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.y e.y+e.height-d.bottom&&(k=Math.max(a.ov,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Yc(Jd)||(c=new N(c.x+h.x/g,c.y+h.y/g));D.Hb(e);D.A(h);return c}E.prototype.makeSvg=E.prototype.makeSVG=function(a){void 0===a&&(a=new ja);a.context="svg";a=Un(this,a);return null!==a?a.Km:null}; E.prototype.makeImage=function(a){void 0===a&&(a=new ja);var b=(a.document||document).createElement("img");b.src=this.FJ(a);return b}; E.prototype.makeImageData=E.prototype.FJ=function(a){void 0===a&&(a=new ja);var b=Un(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.Wk.getImageData(0,0,b.width,b.height);case "blob":b=b.ae;c=a.callback;if("function"!==typeof c){D.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"=== typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var Vn=!1; function Un(a,b){a.Ra.$h();a.lg();if(null===a.Gb)return null;"object"!==typeof b&&D.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var g=b.maxSize;void 0===b.maxSize&&(c=!0,g="svg"===b.context?new Ba(Infinity,Infinity):new Ba(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r= b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new Lb(l):l instanceof Lb||D.k("MakeImage padding must be a Margin or a number.");l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.fd.Ee(!0);var s=new ia(null,p),u=s.Wk;if(!(d||e||k||h)){s.width=a.Lb+Math.ceil(l.left+l.right);s.height=a.Kb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new qd(s.ae, p,q),Tm(a,u,l,new Ba(s.width,s.height),a.Ab,a.ib,k,m,r,n),u;a.Vr=!1;Tm(a,u,l,new Ba(s.width,s.height),a.Ab,a.ib,k,m,r,n);a.Vr=!0;return s}var t=a.xb.Qx,y=new N(0,0),w=a.Xc.copy();w.kH(a.padding);if(r)for(var A=!0,A=a.dc.o,B=A.length,P=0;Pt?(e=t,h=w.width,ea=w.height):(h=g.width,ea=g.height)):(h=w.width*e,ea=w.height*e):(e=t,h=w.width,ea=w.height);null!==l?(h+=U,ea+=A):l=new Lb(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!Vn&&(h>d||ea>g)&&(D.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ea)+ " vs 2000x2000) Consider increasing the max size."),Vn=!0),isNaN(d)&&(d=2E3),isNaN(g)&&(g=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(g)&&(ea=Math.min(ea,g)));s.width=Math.ceil(h);s.height=Math.ceil(ea);if("svg"===b.context)return u=new qd(s.ae,p,q),Tm(a,u,l,new Ba(Math.ceil(h),Math.ceil(ea)),e,y,k,m,r,n),u;a.Vr=!1;Tm(a,u,l,new Ba(Math.ceil(h),Math.ceil(ea)),e,y,k,m,r,n);a.Vr=!0;return s} E.inherit=function(a,b){D.h(a,"function",E,"inherit");D.h(b,"function",E,"inherit");b.QH&&D.k("Cannot inherit from "+D.xf(b));D.Ta(a,b)};function Ml(){this.xE=null;this.SH="63ad05bbe23a1786468a4c741b6d2";this.cj=this.SH===this._tk?!0:null} Ml.prototype.Om=function(a){a.fd.setTransform(a.hd,0,0,a.hd,0,0);if(null===this.cj){var b="f",c=window[D.Vg("76a715b2f73f148a")][D.Vg("72ba13b5")];a=D.Vg;this.cj=!0;if(window[a("7da7")]&&window[a("7da7")][a("76a115b6ed251eaf4692")]){var d=window[a("7da7")][a("76a115b6ed251eaf4692")],d=a(d).split(a("39e9"));if(!(6>d.length)){var e=a(d[1]).split(".");if("7da71ca0"===d[4]){var g=a(D[a("6cae19")]).split(".");if(e[0]>g[0]||e[0]===g[0]&&e[1]>=g[1]){g=c[a("76ad18b4f73e")];for(e=c[a("73a612b6fb191d")](a("35e7"))+ 2;e c&&a(d[2])!==a("7da71ca0ad381e90")&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));0>c&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));if(this.cj=!(0<=c&&ce.length;)e+="9";e=e.substr(e.length-4);d=""+["gsh","gsf"][parseInt(e.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(e.substr(0, 1),10)%4];c[a("79a417a0f0181a8946")]=d;if(window.document[a("78a712aa")]){if(window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](c),e=window[a("7dad0290ec3b0b91578e5b40007031bf")](c)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")),window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](c),e)if(-1!==e.indexOf(parseInt(b[1]+b[2],16))&&-1!==e.indexOf(parseInt(b[3]+b[4],16)))this.cj=!1;else if(D.Ou||D.Aq||D.Bq||D.wB)for(d="."+d,e=0;e b.timeStamp-a.zk)b.preventDefault();else if(a.xk)b.preventDefault();else{a.Gd=a.Wb;a.Wb=c;em(a,a,b,c,!0);c.Xk=!0;c.Fe=b.detail;if(D.Aq||D.Bq)b.timeStamp-a.zk b.timeStamp-a.zk){b.preventDefault();return}a.zk=b.timeStamp}if(D.ao&&null!==a.Kt)a.Kt=null,b.preventDefault();else{a.Gd=a.Wb;a.Wb=c;em(a,a,b,c,!0);c.up=!0;c.Fe=b.detail;if(D.Aq||D.Bq)c.Fe=a.mi;c.bubbles=b.bubbles;c.Rf=gm(b);a.simulatedMouseUp(b,null,new N,c.Rf)||(a.doMouseUp(),ji(a),fa(a,c,b))}}};a.qo=function(b){if(a.isEnabled){var c= a.Gd;a.Gd=a.Wb;a.Wb=c;em(a,a,b,c,!0);c.bubbles=!0;var d=0,e=0;void 0!==b.deltaX?(d=0 Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(d=0 Math.abs(b.wheelDeltaY)?-d:-e):c.Hi=void 0!==b.wheelDelta?0 n||Math.abs(m.y-b.screenY)>n)?a.mi++:a.mi=1;d.Fe=a.mi;a.zk=b.timeStamp;a.Aw.n(b.screenX,b.screenY);m=0;b.ctrlKey&&(m+=1);b.altKey&&(m+=2);b.shiftKey&&(m+=4);b.metaKey&&(m+=8);d.xd=m;d.button=b.button;void 0===b.buttons||D.Ou||(d.buttons=b.buttons);D.Qh&&0===b.button&&b.ctrlKey&&(d.button=2);d.Xk=!1;d.up=!0;d.Hi=0;d.Cc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.Rf=null===e?gm(b): e.ca?e.ca:null;d.Oe=null;a.simulatedMouseUp(b,null,new N,d.Rf)||(a.doMouseUp(),ji(a),fa(a,d,b),c&&(a.xk=!1))}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.Mq=function(b){if(a.isEnabled){a.sh=!1;var c=a.oA;c[b.pointerId]&&delete c[b.pointerId];c=a.Fp;null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null);null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null);"touch"!==b.pointerType&&"pen"!==b.pointerType&&(b=a.cb,b.cancelWaitAfter(),b.standardMouseOver())}};d.Ee(!0);Rl(a)} function Wn(a){1 a)&&D.ua(a,"0 <= loc <= 1",za,"addColorStop:loc");D.h(b,"string",za,"addColorStop:color");v&&!ya(b)&&D.k('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.oh&&(this.oh=new ma("number","string"));this.oh.add(a,b);this.da===Eg&&(this.type=Fg);this.ph=null}; D.defineProperty(za,{type:"type"},function(){return this.da},function(a){this.J&&D.qa(this,a);D.Da(a,za,za,"type");this.da=a;this.start.ee()&&(a===Fg?this.start=jc:a===Hd&&(this.start=mc));this.end.ee()&&(a===Fg?this.end=uc:a===Hd&&(this.end=mc));this.ph=null});D.defineProperty(za,{color:"color"},function(){return this.Oo},function(a){this.J&&D.qa(this,a);v&&!ya(a)&&D.k('Color "'+a+'" is not a valid color string for Brush.color');this.Oo=a;this.ph=null}); D.defineProperty(za,{start:"start"},function(){return this.Op},function(a){this.J&&D.qa(this,a);D.l(a,R,za,"start");this.Op=a.V();this.ph=null});D.defineProperty(za,{end:"end"},function(){return this.ap},function(a){this.J&&D.qa(this,a);D.l(a,R,za,"end");this.ap=a.V();this.ph=null});D.defineProperty(za,{uv:"startRadius"},function(){return this.ox},function(a){this.J&&D.qa(this,a);D.p(a,za,"startRadius");0>a&&D.ua(a,">= zero",za,"startRadius");this.ox=a;this.ph=null}); D.defineProperty(za,{ru:"endRadius"},function(){return this.fw},function(a){this.J&&D.qa(this,a);D.p(a,za,"endRadius");0>a&&D.ua(a,">= zero",za,"endRadius");this.fw=a;this.ph=null});D.defineProperty(za,{Tk:"colorStops"},function(){return this.oh},function(a){this.J&&D.qa(this,a);v&&D.l(a,ma,za,"colorStops");this.oh=a;this.ph=null});D.defineProperty(za,{pattern:"pattern"},function(){return this.Ww},function(a){this.J&&D.qa(this,a);this.Ww=a;this.ph=null}); za.randomColor=function(a,b){void 0===a&&(a=128);v&&(D.p(a,za,"randomColor:min"),(0>a||255d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+ d+e+c};var ho=(new ia(null)).Wk,ya;za.isValidColor=ya=function(a){if("black"===a)return!0;if(""===a)return!1;v&&D.h(a,"string",za,"isValidColor");ho.fillStyle="#000000";var b=ho.fillStyle;ho.fillStyle=a;if(ho.fillStyle!==b)return!0;ho.fillStyle="#FFFFFF";b=ho.fillStyle;ho.fillStyle=a;return ho.fillStyle!==b};var io=new bo,jo=new bo,ko=new bo,lo=new bo;za.lighten=function(a){return mo(a)}; za.prototype.lightenBy=function(a,b){this.J&&D.qa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?eo:b;if(this.type===Eg)no(this.color),this.color=oo(c,d);else if((this.type===Fg||this.type===Hd)&&null!==this.Tk)for(var e=this.Tk.j;e.next();)no(e.value),this.addColorStop(e.key,oo(c,d));return this};var mo;za.lightenBy=mo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?eo:c;no(a);return oo(b,c)};za.darken=function(a){return po(a)}; za.prototype.darkenBy=function(a,b){this.J&&D.qa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?eo:b;if(this.type===Eg)no(this.color),this.color=oo(-c,d);else if((this.type===Fg||this.type===Hd)&&null!==this.Tk)for(var e=this.Tk.j;e.next();)no(e.value),this.addColorStop(e.key,oo(-c,d));return this};var po;za.darkenBy=po=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?eo:c;no(a);return oo(-b,c)}; function oo(a,b){switch(b){case eo:var c=100*qo(io.Rc),d=100*qo(io.Qd),e=100*qo(io.od);ko.Rc=.4124564*c+.3575761*d+.1804375*e;ko.Qd=.2126729*c+.7151522*d+.072175*e;ko.od=.0193339*c+.119192*d+.9503041*e;ko.pg=io.pg;c=ro(ko.Rc/so[0]);d=ro(ko.Qd/so[1]);e=ro(ko.od/so[2]);lo.Rc=116*d-16;lo.Qd=500*(c-d);lo.od=200*(d-e);lo.pg=ko.pg;lo.Rc=Math.min(100,Math.max(0,lo.Rc+100*a));c=(lo.Rc+16)/116;d=c-lo.od/200;ko.Rc=so[0]*to(lo.Qd/500+c);ko.Qd=so[1]*(lo.Rc>uo*vo?Math.pow(c,3):lo.Rc/uo);ko.od=so[2]*to(d);ko.pg= lo.pg;c=-.969266*ko.Rc+1.8760108*ko.Qd+.041556*ko.od;d=.0556434*ko.Rc+-.2040259*ko.Qd+1.0572252*ko.od;io.Rc=255*wo((3.2404542*ko.Rc+-1.5371385*ko.Qd+-.4985314*ko.od)/100);io.Qd=255*wo(c/100);io.od=255*wo(d/100);io.pg=ko.pg;io.Rc=Math.round(io.Rc);255 io.Rc&&(io.Rc=0);io.Qd=Math.round(io.Qd);255 io.Qd&&(io.Qd=0);io.od=Math.round(io.od);255 io.od&&(io.od=0);return"rgba("+io.Rc+", "+io.Qd+", "+io.od+", "+io.pg+")";case fo:var e=io.Rc/255,g=io.Qd/ 255,h=io.od/255,k=Math.max(e,g,h),d=Math.min(e,g,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(g-h)/l%6;break;case g:c=(h-e)/l+2;break;case h:c=(e-g)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}jo.Rc=Math.round(c);jo.Qd=Math.round(100*e);jo.od=Math.round(100*d);jo.pg=io.pg;jo.od=Math.min(100,Math.max(0,jo.od+100*a));return"hsla("+jo.Rc+", "+jo.Qd+"%, "+jo.od+"%, "+jo.pg+")";default:return D.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} function no(a){ho.clearRect(0,0,1,1);ho.fillStyle="#000000";var b=ho.fillStyle;ho.fillStyle=a;ho.fillStyle!==b?(ho.fillRect(0,0,1,1),a=ho.getImageData(0,0,1,1).data,io.Rc=a[0],io.Qd=a[1],io.od=a[2],io.pg=a[3]/255):(ho.fillStyle="#FFFFFF",b=ho.fillStyle,ho.fillStyle=a,ho.fillStyle===b&&v&&D.k('Color "'+a+'" is not a valid color string for RGBA color conversion'),io.Rc=0,io.Qd=0,io.od=0,io.pg=1)}function qo(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)} function wo(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var vo=216/24389,uo=24389/27,so=[95.047,100,108.883];function ro(a){return a>vo?Math.pow(a,1/3):(uo*a+16)/116}function to(a){var b=a*a*a;return b>vo?b:(116*a-16)/uo} function O(){D.wc(this);this.R=4225027;this.Lc=1;this.uj=null;this.ac="";this.lc=this.Pb=null;this.ib=(new N(NaN,NaN)).freeze();this.$e=he;this.ri=Wd;this.qi=ae;this.Nc=new Ca;this.bi=new Ca;this.lj=new Ca;this.Ab=this.Zo=1;this.vg=0;this.Pg=xo;this.jn=Ld;this.Ed=(new C(NaN,NaN,NaN,NaN)).freeze();this.cc=(new C(NaN,NaN,NaN,NaN)).freeze();this.Vc=(new C(0,0,NaN,NaN)).freeze();this.aa=this.lt=this.mt=null;this.Qm=this.we=Vc;this.yt=0;this.wj=1;this.xr=0;this.Wi=1;this.Ot=null;this.Ct=-Infinity;this.un= 0;this.vn=Jd;this.wn=wj;this.Gr="";this.Hc=this.ma=null;this.Mo=-1;this.An=this.xg=this.El=this.Np=null;this.pA=Rj;this.qn=null}D.Gi(O);D.ka("GraphObject",O); O.prototype.cloneProtected=function(a){a.R=this.R|6144;a.Lc=this.Lc;a.ac=this.ac;a.Pb=this.Pb;a.lc=this.lc;a.ib.assign(this.ib);a.$e=this.$e.V();a.ri=this.ri.V();a.qi=this.qi.V();a.lj=this.lj.copy();a.Ab=this.Ab;a.vg=this.vg;a.Pg=this.Pg;a.jn=this.jn.V();a.Ed.assign(this.Ed);a.cc.assign(this.cc);a.Vc.assign(this.Vc);a.lt=this.lt;null!==this.aa&&(a.aa=this.aa.copy());a.we=this.we.V();a.Qm=this.Qm.V();a.yt=this.yt;a.wj=this.wj;a.xr=this.xr;a.Wi=this.Wi;a.Ot=this.Ot;a.Ct=this.Ct;a.un=this.un;a.vn=this.vn.V(); a.wn=this.wn;a.Gr=this.Gr;null!==this.ma&&(a.ma=this.ma.copy());a.Hc=this.Hc;a.Mo=this.Mo;null!==this.El&&(a.El=D.pm(this.El));null!==this.xg&&(a.xg=this.xg.copy());a.An=this.An};O.prototype.addCopyProperty=O.prototype.XH=function(a){var b=this.El;if(D.isArray(b))for(var c=0;c k;)k+=g[n++%l],p=!p;q=!1}else k=g[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}} O.prototype.raiseChangedEvent=O.prototype.pd=function(a,b,c,d,e,g,h){var k=this.$;if(null!==k&&(k.uo(a,b,c,d,e,g,h),Jo(this)&&c===this&&a===eg&&Ko(this,k,b),c===k&&0!==(k.R&16777216)&&null!==k.data))for(a=this.xa.o,c=a.length,d=0;d a&&(a+=360));return a};O.prototype.getDocumentScale=O.prototype.Mj=function(){if(0!==(this.R&4096)===!1)return this.Zo;var a=this.Ab;return null!==this.Q?a*this.Q.Mj():a};O.prototype.getLocalPoint=O.prototype.OF=function(a,b){void 0===b&&(b=new N);b.assign(a);this.Hh.Oh(b);return b}; O.prototype.getNearestIntersectionPoint=O.prototype.PF=function(a,b,c){return this.Xn(a.x,a.y,b.x,b.y,c)};f=O.prototype;f.Xn=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.lm)return g=this.Y,Ie(g.left,g.top,g.right,g.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.n(0,0);d=this.Fa;c=Ie(0,0,d.width,d.height,h,a,b,c,e);e.transform(g);return c}; function Hk(a,b,c,d,e){if(!1!==Nm(a)){var g=a.margin,h=g.right+g.left,g=g.top+g.bottom;b=Math.max(b-h,0);c=Math.max(c-g,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-g,0);var h=a.angle,g=0,g=a.Ea,k=0;a instanceof z&&(k=a.ob);90===h||270===h?(b=isFinite(g.height)?g.height+k:b,c=isFinite(g.width)?g.width+k:c):(b=isFinite(g.width)?g.width+k:b,c=isFinite(g.height)?g.height+k:c);var g=d||0,k=e||0,l=a instanceof x;switch(Oo(a,!0)){case ak:k=g=0;l&&(c=b=Infinity);break;case Xe:isFinite(b)&&b>d&&(g=b);isFinite(c)&& c>e&&(k=c);break;case zo:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case yo:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.pf,m=a.Zg;g>l.width&&m.width l.height&&m.height a.height||this.sf.Qe>a.width))&&(c=!0);this.R=c?this.R|256:this.R&-257;this.cc.H()|| D.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.cc.toString());this.Ey(g,this.cc);Po(this,!1);D.Hb(g)};f.Fj=function(){}; function Qo(a,b,c,d,e){var g=a.Y;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Ea.H()){g=a.Ed;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=g.width+b;g=g.height+h;d+=b;e+=h;b=Oo(a,!0);c===d&&g===e&&(b=ak);switch(b){case ak:if(c>d||g>e)lm(a,!0),Hk(a,c>d?d:c,g>e?e:g);break;case Xe:lm(a,!0);Hk(a,d,e,0,0);break;case zo:lm(a,!0);Hk(a,d,g,0,0);break;case yo:lm(a,!0),Hk(a,c,e,0,0)}}} f.Ey=function(a,b){var c=this.$;null!==c&&null!==c.g&&(c.Gm!==this&&c.RG!==this&&c.YB!==this||Ro(c,!0),this.ra(),Db(a,b)||(c.gl(),this.at(c)))};f.at=function(a){null!==this.Rd&&(Ro(a,!0),a instanceof G&&So(a,this))};D.defineProperty(O,{yo:"shadowVisible"},function(){return this.An},function(a){var b=this.An;b!==a&&(v&&null!==a&&D.h(a,"boolean",O,"shadowVisible"),this.An=a,this.ra(),this.i("shadowVisible",b,a))}); O.prototype.He=function(a,b){if(this.visible){var c=this.cc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity;if(0!==d){var e=1;1!==d&&(e=a.globalAlpha,a.globalAlpha=e*d);if(a instanceof qd)a:{if(this.visible){var g=null,h=a.sy;if(this instanceof x&&(this.type===To||this.type===Uo))Vo(this,a,b);else{var k=this.cc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.Q;0!==(this.R&4096)===!0&&Wo(this);var c=0!==(this.R&256),n=!1;this instanceof na&&(a.font=this.font);if(c){n=m.jh()?m.Fa:m.Y;if(null!==this.xg)var p=this.xg,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;sd(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.Qj()){var u=this;if(!u.isVisible())break a}a.Mh.bc=[1,0,0,1,0,0];this instanceof na&&1 s.width+p||p>q+k||l>s.height+t||t>r+l)}if(l){k=0!==(this.R&256);a.gq&&(k=!1);this instanceof na&&(a.font=this.font);if(k){v&&v.zF&&D.trace("clip"+this.toString());l=h.jh()?h.Fa:h.Y;null!==this.xg?(p=this.xg,q=p.x,r=p.y,s=p.width,p=p.height):(q=Math.max(c.x,l.x),r=Math.max(c.y,l.y),s=Math.min(c.right,l.right)-q,p=Math.min(c.bottom,l.bottom)- r);if(q>c.width+c.x||c.x>l.width+l.x){1!==d&&(a.globalAlpha=e);return}v&&v.zF&&v.II(a,q,r,s,p);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.Qj()){if(!u.isVisible()){1!==d&&(a.globalAlpha=e);return}m&&(a.jC(n.x*b.scale*b.hd,n.y*b.scale*b.hd,u.Og),a.zo(),a.shadowColor=u.yn)}!0===this.yo?a.zo():!1===this.yo&&a.Im();null!==this.lc&&(Xo(this,a,this.lc,!0,!0),this.lc instanceof za&&this.lc.type===Hd?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Wg(this.lc)):a.fillRect(c.x,c.y,c.width,c.height)); g.Pu()||a.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);m&&(null!==h&&0!==(h.R&512)||null!==h&&(h.type===Ql||h.type===Yj)&&h.Ld()!==this)&&null===this.yo&&a.Im();null!==this.Pb&&(l=this.Fa,n=c=0,u=l.width,l=l.height,q=0,this instanceof z&&(l=this.Za.kb,c=l.x,n=l.y,u=l.width,l=l.height,q=this.Qg),Xo(this,a,this.Pb,!0,!1),this.Pb instanceof za&&this.Pb.type===Hd?(a.beginPath(),a.rect(c-q/2,n-q/2,u+q,l+q),a.Wg(this.Pb)):a.fillRect(c-q/2,n-q/2,u+q,l+q));v&&v.Gj&&v.HI(a,this);m&&(null!==this.Pb||null!== this.lc||null!==h&&0!==(h.R&512)||null!==h&&(h.type===Ql||h.type===Yj)&&h.Ld()!==this)?(Yo(this,!0),null===this.yo&&a.Im()):Yo(this,!1);this.Yk(a,b);m&&0!==(this.R&512)===!0&&a.zo();this.Qj()&&m&&a.Im();k?(a.restore(),this instanceof x?a.Ee(!0):a.Ee(!1)):g.Pu()||(h=1/(g.m11*g.m22-g.m12*g.m21),a.transform(g.m22*h,-g.m12*h,-g.m21*h,g.m11*h,h*(g.m21*g.dy-g.m22*g.dx),h*(g.m12*g.dx-g.m11*g.dy)))}}1!==d&&(a.globalAlpha=e)}}}}; function Vo(a,b,c){var d=a.cc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.lc&&(Xo(a,b,a.lc,!0,!0),a.lc instanceof za&&a.lc.type===Hd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Wg(a.lc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Pb&&(Xo(a,b,a.Pb,!0,!1),a.Pb instanceof za&&a.Pb.type===Hd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Wg(a.Pb)):b.fillRect(d.x,d.y,d.width,d.height)),a.Yk(b,c))}O.prototype.Yk=function(){}; function Xo(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===Eg)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Fa,g=h.width,h=h.height;if(e)var l=a.Y,g=l.width,h=l.height;var m=b instanceof Gd;if(m&&c.ph&&(c.type===co||c.Po===g&&c.Dz===h))k=c.ph;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.Y,g=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*g+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*g+c.end.offsetX;q=c.end.y*h+c.end.offsetY; l+=r;p+=r;n+=s;q+=s;if(c.type===Fg)k=b.createLinearGradient(l,n,p,q);else if(c.type===Hd)s=isNaN(c.ru)?Math.max(g,h)/2:c.ru,isNaN(c.uv)?(r=0,s=Math.max(g,h)/2):r=c.uv,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===co)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else D.kc(c.type,"Brush type");if(c.type!==co&&(e=c.Tk,null!==e))for(e=e.j;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.ph=k,null!==k&&(c.Po=g,c.Dz=h),null===k&&c.type===co&&-1!==c.Po)){c.Po=-1;var t=a.g;null!==t&& -1===c.Po&&D.setTimeout(function(){t.vo()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}O.prototype.isContainedBy=O.prototype.Cm=function(a){if(a instanceof x)a:{if(this!==a&&null!==a)for(var b=this.Q;null!==b;){if(b===a){a=!0;break a}b=b.Q}a=!1}else a=!1;return a};O.prototype.isVisibleObject=O.prototype.Uj=function(){if(!this.visible)return!1;var a=this.Q;return null!==a?a.Uj():!0}; O.prototype.isEnabledObject=O.prototype.Mu=function(){for(var a=this instanceof x?this:this.Q;null!==a&&a.isEnabled;)a=a.Q;return null===a};D.defineProperty(O,{BF:"enabledChanged"},function(){return null!==this.ma?this.ma.Zr:null},function(a){Eo(this);var b=this.ma.Zr;b!==a&&(null!==a&&D.h(a,"function",O,"enabledChanged"),this.ma.Zr=a,this.i("enabledChanged",b,a))}); function Wo(a){if(0!==(a.R&2048)===!0){var b=a.Nc;b.reset();if(!a.cc.H()||!a.Ed.H()){Zo(a,!1);return}b.translate(a.cc.x,a.cc.y);b.translate(-a.Ia.x,-a.Ia.y);var c=a.Fa;Mo(a,b,c.x,c.y,c.width,c.height);Zo(a,!1);$o(a,!0)}0!==(a.R&4096)===!0&&(b=a.Q,null===b?(a.bi.set(a.Nc),a.Zo=a.scale,$o(a,!1)):null!==b.Hh&&(c=a.bi,c.reset(),b.jh()?c.multiply(b.bi):null!==b.Q&&c.multiply(b.Q.bi),c.multiply(a.Nc),a.Zo=a.scale*b.Zo,$o(a,!1)))} function Mo(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=mc;a.Qj()&&a.Pf.Zc()&&(h=a.Pf);var k=D.O();if(a instanceof F&&a.Cf!==a)for(c=a.Cf,d=c.Fa,k.rv(d.x,d.y,d.width,d.height,h),c.lj.vb(k),k.offset(-c.Ia.x,-c.Ia.y),h=c.Q;null!==h&&h!==a;)h.lj.vb(k),k.offset(-h.Ia.x,-h.Ia.y),h=h.Q;else k.rv(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);D.A(k)}}f=O.prototype;f.K=function(a){void 0===a&&(a=!1);if(!0!==Nm(this)){lm(this,!0);Po(this,!0);var b=this.Q;null===b||a||b.K()}}; f.yq=function(){!0!==Nm(this)&&(lm(this,!0),Po(this,!0))};function ap(a){if(!1===Om(a)){var b=a.Q;null!==b?b.K():a.Qj()&&(b=a.g,null!==b&&(b.Fg.add(a),a instanceof G&&a.kg(),b.Le()));Po(a,!0)}}f.gj=function(){0!==(this.R&2048)===!1&&(Zo(this,!0),$o(this,!0))};f.sB=function(){$o(this,!0)};f.ra=function(){var a=this.$;null!==a&&a.ra()}; function Oo(a,b){var c=a.stretch,d=a.Q;if(null!==d&&d.da===da)return bp(a,d.qe(a.Ub),d.pe(a.column),b);if(null!==d&&d.da===Ql&&d.Ld()===a)return cp(a,Xe,b);if(c===xo){if(null!==d){if(d.da===Yj&&d.Ld()===a)return cp(a,Xe,b);c=d.me;return c===xo?cp(a,ak,b):cp(a,c,b)}return cp(a,ak,b)}return cp(a,c,b)} function bp(a,b,c,d){var e=a.stretch;if(e!==xo)return cp(a,e,d);var g=e=null;switch(b.stretch){case yo:g=!0;break;case Xe:g=!0}switch(c.stretch){case zo:e=!0;break;case Xe:e=!0}b=a.Q.me;null===e&&(e=b===zo||b===Xe);null===g&&(g=b===yo||b===Xe);return!0===e&&!0===g?cp(a,Xe,d):!0===e?cp(a,zo,d):!0===g?cp(a,yo,d):cp(a,ak,d)} function cp(a,b,c){if(c)return b;if(b===ak)return ak;c=a.Ea;if(c.H())return ak;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===zo)return ak;if(b===Xe)return yo}else{if(b===yo)return ak;if(b===Xe)return zo}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===yo)return ak;if(b===Xe)return zo}else{if(b===zo)return ak;if(b===Xe)return yo}return b} D.defineProperty(O,{Vq:"segmentOrientation"},function(){return this.wn},function(a){var b=this.wn;b!==a&&(v&&D.Da(a,J,O,"segmentOrientation"),this.wn=a,this.K(),this.i("segmentOrientation",b,a),a===wj&&(this.angle=0))});D.defineProperty(O,{We:"segmentIndex"},function(){return this.Ct},function(a){v&&D.h(a,"number",O,"segmentIndex");a=Math.round(a);var b=this.Ct;b!==a&&(this.Ct=a,this.K(),this.i("segmentIndex",b,a))}); D.defineProperty(O,{$B:"segmentFraction"},function(){return this.un},function(a){v&&D.h(a,"number",O,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1a||1=a&&D.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ab=a,this.gj(),this.K(),this.i("scale",b,a))});D.defineProperty(O,{angle:"angle"},function(){return this.vg},function(a){var b=this.vg;b!==a&&(v&&D.p(a,O,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.vg=a,dp(this),this.K(),this.gj(),this.i("angle",b,a)))}); D.defineProperty(O,{Ea:"desiredSize"},function(){return this.$e},function(a){v&&D.l(a,Ba,O,"desiredSize");var b=a.width,c=a.height,d=this.$e,e=d.width,g=d.height;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))||(this.$e=a=a.V(),this.K(),this instanceof z&&this.se(),this.i("desiredSize",d,a),Jo(this)&&(a=this.$,null!==a&&(Ko(this,a,"width"),Ko(this,a,"height"))))}); D.defineProperty(O,{width:"width"},function(){return this.$e.width},function(a){var b=this.$e.width;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",O,"width"),b=this.$e,this.$e=a=(new Ba(a,this.$e.height)).freeze(),this.K(),this instanceof z&&this.se(),this.i("desiredSize",b,a),Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"width")))}); D.defineProperty(O,{height:"height"},function(){return this.$e.height},function(a){var b=this.$e.height;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",O,"height"),b=this.$e,this.$e=a=(new Ba(this.$e.width,a)).freeze(),this.K(),this instanceof z&&this.se(),this.i("desiredSize",b,a),Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"height")))}); D.defineProperty(O,{Zg:"minSize"},function(){return this.ri},function(a){var b=this.ri;b.P(a)||(v&&D.l(a,Ba,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.ri=a,this.K(),this.i("minSize",b,a))});D.defineProperty(O,{pf:"maxSize"},function(){return this.qi},function(a){var b=this.qi;b.P(a)||(v&&D.l(a,Ba,O,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.qi=a,this.K(),this.i("maxSize",b,a))}); D.w(O,{Ia:"measuredBounds"},function(){return this.Ed});D.w(O,{Fa:"naturalBounds"},function(){return this.Vc},{configurable:!0});D.defineProperty(O,{margin:"margin"},function(){return this.jn},function(a){"number"===typeof a?a=new Lb(a):v&&D.l(a,Lb,O,"margin");var b=this.jn;b.P(a)||(this.jn=a=a.V(),this.K(),this.i("margin",b,a))});D.w(O,{transform:null},function(){0!==(this.R&2048)===!0&&Wo(this);return this.Nc});D.w(O,{Hh:null},function(){0!==(this.R&4096)===!0&&Wo(this);return this.bi}); D.defineProperty(O,{alignment:"alignment"},function(){return this.we},function(a){var b=this.we;b.P(a)||(v&&D.l(a,R,O,"alignment"),a.ee()&&!a.md()&&D.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.we=a=a.V(),ap(this),this.i("alignment",b,a))});D.defineProperty(O,{column:"column"},function(){return this.xr},function(a){v&&D.p(a,O,"column");a=Math.round(a);var b=this.xr;b!==a&&(0>a&&D.ua(a,">= 0",O,"column"),this.xr=a,this.K(),this.i("column",b,a))}); D.defineProperty(O,{lI:"columnSpan"},function(){return this.Wi},function(a){v&&D.h(a,"number",O,"columnSpan");a=Math.round(a);var b=this.Wi;b!==a&&(1>a&&D.ua(a,">= 1",O,"columnSpan"),this.Wi=a,this.K(),this.i("columnSpan",b,a))});D.defineProperty(O,{Ub:"row"},function(){return this.yt},function(a){v&&D.p(a,O,"row");a=Math.round(a);var b=this.yt;b!==a&&(0>a&&D.ua(a,">= 0",O,"row"),this.yt=a,this.K(),this.i("row",b,a))}); D.defineProperty(O,{rowSpan:"rowSpan"},function(){return this.wj},function(a){v&&D.h(a,"number",O,"rowSpan");a=Math.round(a);var b=this.wj;b!==a&&(1>a&&D.ua(a,">= 1",O,"rowSpan"),this.wj=a,this.K(),this.i("rowSpan",b,a))});D.defineProperty(O,{az:"spanAllocation"},function(){return this.Ot},function(a){var b=this.Ot;b!==a&&(null!==a&&D.h(a,"function",O,"spanAllocation"),this.Ot=a,this.K(),this.i("spanAllocation",b,a))}); D.defineProperty(O,{Gh:"alignmentFocus"},function(){return this.Qm},function(a){var b=this.Qm;b.P(a)||(v&&D.l(a,R,O,"alignmentFocus"),!a.ee()||a.md()||a.P(dc)&&this instanceof G||D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Qm=a=a.V(),this.K(),this.i("alignmentFocus",b,a))}); D.defineProperty(O,{Rd:"portId"},function(){return this.lt},function(a){var b=this.lt;if(b!==a){v&&null!==a&&D.h(a,"string",O,"portId");var c=this.$;null===c||c instanceof G||(D.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&fp(c,this);this.lt=a;null!==a&&null!==c&&(c.fl=!0,gp(c,this));this.i("portId",b,a)}});function hp(a){var b=a.$;if(b instanceof G&&(null!==a.Rd||a===b.port)){var c=b.g;null===c||c.na.ub||So(b,a)}} function dp(a){var b=a.g;null===b||b.na.ub||(a instanceof x?a instanceof G?a.kg():ip(a,a,function(a){hp(a)}):hp(a))}D.defineProperty(O,{Jb:"toSpot"},function(){return null!==this.aa?this.aa.Pk:dc},function(a){this.be();var b=this.aa.Pk;b.P(a)||(v&&D.l(a,R,O,"toSpot"),a=a.V(),this.aa.Pk=a,this.i("toSpot",b,a),hp(this))}); D.defineProperty(O,{Nm:"toEndSegmentLength"},function(){return null!==this.aa?this.aa.Nk:10},function(a){this.be();var b=this.aa.Nk;b!==a&&(v&&D.h(a,"number",O,"toEndSegmentLength"),0>a&&D.ua(a,">= 0",O,"toEndSegmentLength"),this.aa.Nk=a,this.i("toEndSegmentLength",b,a),hp(this))}); D.defineProperty(O,{wv:"toEndSegmentDirection"},function(){return null!==this.aa?this.aa.Mk:Ho},function(a){this.be();var b=this.aa.Mk;b!==a&&(D.Sn("GraphObject.toEndSegmentDirection","2.0"),v&&D.Da(a,G,O,"toEndSegmentDirection"),this.aa.Mk=a,this.i("toEndSegmentDirection",b,a),hp(this))}); D.defineProperty(O,{xv:"toShortLength"},function(){return null!==this.aa?this.aa.Ok:0},function(a){this.be();var b=this.aa.Ok;b!==a&&(v&&D.h(a,"number",O,"toShortLength"),this.aa.Ok=a,this.i("toShortLength",b,a),hp(this))});D.defineProperty(O,{oH:"toLinkable"},function(){return null!==this.aa?this.aa.Vt:null},function(a){this.be();var b=this.aa.Vt;b!==a&&(v&&null!==a&&D.h(a,"boolean",O,"toLinkable"),this.aa.Vt=a,this.i("toLinkable",b,a))}); D.defineProperty(O,{EK:"toMaxLinks"},function(){return null!==this.aa?this.aa.Wt:Infinity},function(a){this.be();var b=this.aa.Wt;b!==a&&(v&&D.h(a,"number",O,"toMaxLinks"),0>a&&D.ua(a,">= 0",O,"toMaxLinks"),this.aa.Wt=a,this.i("toMaxLinks",b,a))});D.defineProperty(O,{Ib:"fromSpot"},function(){return null!==this.aa?this.aa.rk:dc},function(a){this.be();var b=this.aa.rk;b.P(a)||(v&&D.l(a,R,O,"fromSpot"),a=a.V(),this.aa.rk=a,this.i("fromSpot",b,a),hp(this))}); D.defineProperty(O,{wm:"fromEndSegmentLength"},function(){return null!==this.aa?this.aa.pk:10},function(a){this.be();var b=this.aa.pk;b!==a&&(v&&D.h(a,"number",O,"fromEndSegmentLength"),0>a&&D.ua(a,">= 0",O,"fromEndSegmentLength"),this.aa.pk=a,this.i("fromEndSegmentLength",b,a),hp(this))}); D.defineProperty(O,{Cu:"fromEndSegmentDirection"},function(){return null!==this.aa?this.aa.ok:Ho},function(a){this.be();var b=this.aa.ok;b!==a&&(D.Sn("GraphObject.fromEndSegmentDirection","2.0"),v&&D.Da(a,G,O,"fromEndSegmentDirection"),this.aa.ok=a,this.i("fromEndSegmentDirection",b,a),hp(this))}); D.defineProperty(O,{Du:"fromShortLength"},function(){return null!==this.aa?this.aa.qk:0},function(a){this.be();var b=this.aa.qk;b!==a&&(v&&D.h(a,"number",O,"fromShortLength"),this.aa.qk=a,this.i("fromShortLength",b,a),hp(this))});D.defineProperty(O,{LF:"fromLinkable"},function(){return null!==this.aa?this.aa.bs:null},function(a){this.be();var b=this.aa.bs;b!==a&&(v&&null!==a&&D.h(a,"boolean",O,"fromLinkable"),this.aa.bs=a,this.i("fromLinkable",b,a))}); D.defineProperty(O,{hB:"fromMaxLinks"},function(){return null!==this.aa?this.aa.cs:Infinity},function(a){this.be();var b=this.aa.cs;b!==a&&(v&&D.h(a,"number",O,"fromMaxLinks"),0>a&&D.ua(a,">= 0",O,"fromMaxLinks"),this.aa.cs=a,this.i("fromMaxLinks",b,a))});D.defineProperty(O,{cursor:"cursor"},function(){return this.Gr},function(a){var b=this.Gr;b!==a&&(D.h(a,"string",O,"cursor"),this.Gr=a,this.i("cursor",b,a))}); D.defineProperty(O,{click:"click"},function(){return null!==this.ma?this.ma.Vi:null},function(a){Eo(this);var b=this.ma.Vi;b!==a&&(null!==a&&D.h(a,"function",O,"click"),this.ma.Vi=a,this.i("click",b,a))});D.defineProperty(O,{qu:"doubleClick"},function(){return null!==this.ma?this.ma.bj:null},function(a){Eo(this);var b=this.ma.bj;b!==a&&(null!==a&&D.h(a,"function",O,"doubleClick"),this.ma.bj=a,this.i("doubleClick",b,a))}); D.defineProperty(O,{TA:"contextClick"},function(){return null!==this.ma?this.ma.Xi:null},function(a){Eo(this);var b=this.ma.Xi;b!==a&&(null!==a&&D.h(a,"function",O,"contextClick"),this.ma.Xi=a,this.i("contextClick",b,a))});D.defineProperty(O,{$u:"mouseEnter"},function(){return null!==this.ma?this.ma.Ss:null},function(a){Eo(this);var b=this.ma.Ss;b!==a&&(null!==a&&D.h(a,"function",O,"mouseEnter"),this.ma.Ss=a,this.i("mouseEnter",b,a))}); D.defineProperty(O,{av:"mouseLeave"},function(){return null!==this.ma?this.ma.Ts:null},function(a){Eo(this);var b=this.ma.Ts;b!==a&&(null!==a&&D.h(a,"function",O,"mouseLeave"),this.ma.Ts=a,this.i("mouseLeave",b,a))});D.defineProperty(O,{KB:"mouseOver"},function(){return null!==this.ma?this.ma.qj:null},function(a){Eo(this);var b=this.ma.qj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseOver"),this.ma.qj=a,this.i("mouseOver",b,a))}); D.defineProperty(O,{JB:"mouseHover"},function(){return null!==this.ma?this.ma.pj:null},function(a){Eo(this);var b=this.ma.pj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseHover"),this.ma.pj=a,this.i("mouseHover",b,a))});D.defineProperty(O,{IB:"mouseHold"},function(){return null!==this.ma?this.ma.oj:null},function(a){Eo(this);var b=this.ma.oj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseHold"),this.ma.oj=a,this.i("mouseHold",b,a))}); D.defineProperty(O,{RJ:"mouseDragEnter"},function(){return null!==this.ma?this.ma.Qs:null},function(a){Eo(this);var b=this.ma.Qs;b!==a&&(null!==a&&D.h(a,"function",O,"mouseDragEnter"),this.ma.Qs=a,this.i("mouseDragEnter",b,a))});D.defineProperty(O,{SJ:"mouseDragLeave"},function(){return null!==this.ma?this.ma.Rs:null},function(a){Eo(this);var b=this.ma.Rs;b!==a&&(null!==a&&D.h(a,"function",O,"mouseDragLeave"),this.ma.Rs=a,this.i("mouseDragLeave",b,a))}); D.defineProperty(O,{HB:"mouseDrop"},function(){return null!==this.ma?this.ma.nj:null},function(a){Eo(this);var b=this.ma.nj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseDrop"),this.ma.nj=a,this.i("mouseDrop",b,a))});D.defineProperty(O,{RE:"actionDown"},function(){return null!==this.ma?this.ma.fr:null},function(a){Eo(this);var b=this.ma.fr;b!==a&&(null!==a&&D.h(a,"function",O,"actionDown"),this.ma.fr=a,this.i("actionDown",b,a))}); D.defineProperty(O,{SE:"actionMove"},function(){return null!==this.ma?this.ma.gr:null},function(a){Eo(this);var b=this.ma.gr;b!==a&&(null!==a&&D.h(a,"function",O,"actionMove"),this.ma.gr=a,this.i("actionMove",b,a))});D.defineProperty(O,{TE:"actionUp"},function(){return null!==this.ma?this.ma.hr:null},function(a){Eo(this);var b=this.ma.hr;b!==a&&(null!==a&&D.h(a,"function",O,"actionUp"),this.ma.hr=a,this.i("actionUp",b,a))}); D.defineProperty(O,{QE:"actionCancel"},function(){return null!==this.ma?this.ma.er:null},function(a){Eo(this);var b=this.ma.er;b!==a&&(null!==a&&D.h(a,"function",O,"actionCancel"),this.ma.er=a,this.i("actionCancel",b,a))});D.defineProperty(O,{pC:"toolTip"},function(){return null!==this.ma?this.ma.zj:null},function(a){Eo(this);var b=this.ma.zj;b!==a&&(!v||null===a||a instanceof ca||a instanceof hk||D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.ma.zj=a,this.i("toolTip",b,a))}); D.defineProperty(O,{contextMenu:"contextMenu"},function(){return null!==this.ma?this.ma.Yi:null},function(a){Eo(this);var b=this.ma.Yi;b!==a&&(!v||a instanceof ca||a instanceof hk||D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.ma.Yi=a,this.i("contextMenu",b,a))});O.prototype.bind=O.prototype.bind=function(a){a.Rg=this;var b=this.vm();null!==b&&jp(b)&&D.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Hc&&(this.Hc=new K(oh));this.Hc.add(a)}; O.prototype.findTemplateBinder=O.prototype.vm=function(){for(var a=this instanceof x?this:this.Q;null!==a;){if(null!==a.Cl)return a;a=a.Q}return null};O.prototype.setProperties=function(a){D.pv(this,a)};var kp; O.make=kp=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=lp.oa(a);"function"===typeof g?(c=D.pm(arguments),d=g(c),D.Qa(d)||D.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=aa[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||D.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);g=1;if(d instanceof E&&1 e)&&D.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.Ke=!0, a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&D.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.Ke=!1,a.index=e);e=new ja;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);D.pv(a,e)}else D.pv(a,b);else D.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var lp=new ma("string","function"); O.getBuilders=function(){var a=new ma("string","function"),b;for(b in lp)if(b!==b.toLowerCase()){var c=lp.oa(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};var np;O.defineBuilder=np=function(a,b){D.h(a,"string",O,"defineBuilder:name");D.h(b,"function",O,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);lp.add(a,b)};var op; O.takeBuilderArgument=op=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b}; np("Button",function(){var a=new za(Fg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new za(Fg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=kp(x,Ql,{Ku:!0,BF:function(a,b){var e=a.Md("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},kp(z,{name:"ButtonBorder",Ob:"Rectangle",C:new R(0,0,2.761423749153968,2.761423749153968), D:new R(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.$u=function(a,b){if(b.Mu()){var e=b.Md("ButtonBorder");if(e instanceof z){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}}};a.av=function(a,b){if(b.Mu()){var e=b.Md("ButtonBorder");e instanceof z&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a}); np("TreeExpanderButton",function(){var a=kp("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},kp(z,{name:"ButtonIcon",Ob:"MinusLine",Ea:Yd},(new oh("figure","isTreeExpanded",function(a,c){var d=c.Q;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).Dy()),{visible:!1},(new oh("visible","isTreeLeaf",function(a){return!a})).Dy());a.click=function(a,c){var d=c.$;d instanceof ca&&(d=d.gf);if(d instanceof G){var e=d.g;if(null!==e){e=e.xb;if(d.Dc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return; a.Cc=!0;d.Dc?e.collapseTree(d):e.expandTree(d)}}};return a}); np("SubGraphExpanderButton",function(){var a=kp("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},kp(z,{name:"ButtonIcon",Ob:"MinusLine",Ea:Yd},(new oh("figure","isSubGraphExpanded",function(a,c){var d=c.Q;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).Dy()));a.click=function(a,c){var d=c.$;d instanceof ca&&(d=d.gf);if(d instanceof I){var e=d.g;if(null!==e){e=e.xb;if(d.nd){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Cc= !0;d.nd?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});np("ToolTip",function(){var a=new ca(Ql),b=new z;b.name="Border";b.fill="#FFFFE0";b.stroke="#CCCCCC";a.add(b);return a});np("ContextMenu",function(){return new ca(Pl)});np("ContextMenuButton",function(){var a=kp("Button");a.stretch=zo;var b=a.Md("ButtonBorder");b instanceof z&&(b.Ob="Rectangle",b.C=new R(0,0,2,3),b.D=new R(1,1,-2,-2));return a}); np("PanelExpanderButton",function(a){var b=op(a,"COLLAPSIBLE"),c=kp("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},kp(z,"TriangleUp",{name:"ButtonIcon",Ea:new Ba(6,4)},(new oh("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Dy(b)));a=c.Md("ButtonBorder");a instanceof z&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var g=c.g;if(null!==g&&!g.rb){var h=c.vm();null===h&&(h=c.$);null!==h&&(h=h.Md(b),null!==h&& (g.Qb("Collapse/Expand Panel"),h.visible=!h.visible,g.ld("Collapse/Expand Panel")))}};return c}); np("CheckBoxButton",function(a){var b=op(a);a=kp("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},kp(z,{name:"ButtonIcon",TI:"M0 4 L3 9 9 0",ob:2,stretch:Xe,iB:ck,visible:!1},""!==b?(new oh("visible",b)).GJ():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.rb||""!==b&&e.ea.rb)){a.Cc=!0;var g=d.Md("ButtonIcon");e.Qb("checkbox");g.visible=!g.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.ld("checkbox")}};return a}); np("CheckBox",function(a){a=op(a);a=kp("CheckBoxButton",a,{name:"Button",margin:new Lb(0,1,0,0)});var b=kp(x,"Horizontal",a,{Ku:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,$u:a.$u,av:a.av,click:a.click,_buttonClick:a.click});a.$u=null;a.av=null;a.click=null;return b}); function Fo(){this.Zr=this.Yi=this.zj=this.er=this.hr=this.gr=this.fr=this.nj=this.Rs=this.Qs=this.oj=this.pj=this.qj=this.Ts=this.Ss=this.Xi=this.bj=this.Vi=null}Fo.prototype.copy=function(){var a=new Fo;a.Vi=this.Vi;a.bj=this.bj;a.Xi=this.Xi;a.Ss=this.Ss;a.Ts=this.Ts;a.qj=this.qj;a.pj=this.pj;a.oj=this.oj;a.Qs=this.Qs;a.Rs=this.Rs;a.nj=this.nj;a.fr=this.fr;a.gr=this.gr;a.hr=this.hr;a.er=this.er;a.zj=this.zj;a.Yi=this.Yi;a.Zr=this.Zr;return a}; function x(a){O.call(this);void 0===a?this.da=ek:(D.Da(a,x,x,"type"),this.da=a);this.xa=new K(O);this.tf=Ld;this.da===Tl&&(this.bo=!0);this.Kr=Vc;this.aj=xo;this.da===da&&pp(this);this.Yp=ck;this.ks=$d;this.ls=Jd;this.gs=0;this.fs=100;this.js=10;this.hs=0;this.Cl=this.Ud=this.sk=this.Xm=this.Zm=null;this.ys=NaN;this.Hg=this.ij=null;this.qp="category";this.Gg=null;this.Bj=new C(NaN,NaN,NaN,NaN);this.Lk=this.zt=this.bm=null;this.fk=""}D.Ta(x,O);D.Gi(x);D.ka("Panel",x); function pp(a){a.kk=Ld;a.ii=1;a.$i=null;a.Gl=null;a.hi=1;a.gi=null;a.Fl=null;a.kd=[];a.ed=[];a.tn=qp;a.Um=qp;a.Aj=0;a.kj=0} x.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.da=this.da;a.tf=this.tf.V();a.Kr=this.Kr.V();a.aj=this.aj;if(a.da===da){a.kk=this.kk.V();a.ii=this.ii;a.$i=this.$i;a.Gl=this.Gl;a.hi=this.hi;a.gi=this.gi;a.Fl=this.Fl;var b=[];if(0 a&&D.ua(a,">= 0",x,"padding"),a=new Lb(a)):(D.l(a,Lb,x,"padding"),0>a.left&&D.ua(a.left,">= 0",x,"padding:value.left"),0>a.right&&D.ua(a.right,">= 0",x,"padding:value.right"),0>a.top&&D.ua(a.top,">= 0",x,"padding:value.top"),0>a.bottom&&D.ua(a.bottom,">= 0",x,"padding:value.bottom"));var b=this.tf;b.P(a)||(this.tf=a=a.V(),this.K(),this.i("padding",b,a))}); D.defineProperty(x,{tm:"defaultAlignment"},function(){return this.Kr},function(a){var b=this.Kr;b.P(a)||(v&&D.l(a,R,x,"defaultAlignment"),this.Kr=a=a.V(),this.K(),this.i("defaultAlignment",b,a))});D.defineProperty(x,{me:"defaultStretch"},function(){return this.aj},function(a){var b=this.aj;b!==a&&(D.Da(a,O,x,"defaultStretch"),this.aj=a,this.K(),this.i("defaultStretch",b,a))}); D.defineProperty(x,{FL:"defaultSeparatorPadding"},function(){return void 0===this.kk?Ld:this.kk},function(a){if(void 0!==this.kk){"number"===typeof a?a=new Lb(a):v&&D.l(a,Lb,x,"defaultSeparatorPadding");var b=this.kk;b.P(a)||(this.kk=a=a.V(),this.K(),this.i("defaultSeparatorPadding",b,a))}}); D.defineProperty(x,{DL:"defaultRowSeparatorStroke"},function(){return void 0===this.$i?null:this.$i},function(a){var b=this.$i;b!==a&&(null===a||"string"===typeof a||a instanceof za)&&(a instanceof za&&a.freeze(),this.$i=a,this.ra(),this.i("defaultRowSeparatorStroke",b,a))}); D.defineProperty(x,{EL:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.ii?1:this.ii},function(a){if(void 0!==this.ii){var b=this.ii;b!==a&&isFinite(a)&&0<=a&&(this.ii=a,this.K(),this.i("defaultRowSeparatorStrokeWidth",b,a))}}); D.defineProperty(x,{CL:"defaultRowSeparatorDashArray"},function(){return void 0===this.Gl?null:this.Gl},function(a){if(void 0!==this.Gl){var b=this.Gl;if(b!==a){null===a||Array.isArray(a)||D.kc(a,"Array",x,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e =c&&(c=1);var d=this.iy,e=d.width,d=d.height,g=this.Fa,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.VF;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.xa.o,q=p.length,r=0;r e*u*c))){s=w.opacity;t=1;if(1!==s){if(0===s)continue;t=a.globalAlpha;a.globalAlpha=t*s}var y=n[r],A=!1,B=!0,P=w.jH;null!==P&&(A=!0,B=a.Wx(P,w.Jf));if("LineV"===w.Ob&&null!==w.stroke){a.lineWidth=w.ob;Xo(this,a,w.stroke,!1,!1);a.beginPath();for(var H=Math.floor(-m.x/e),Q=H;Q<=H+k;Q++){var Y=Q*e+m.x;0<=Y&&Y<=h&&sp(Q,u,y)&&(A&&!B?Io(a,Y,0,Y,g,P,w.Jf):(a.moveTo(Y,0),a.lineTo(Y,g)))}a.stroke()}else if("LineH"===w.Ob&&null!==w.stroke){a.lineWidth=w.ob;Xo(this,a,w.stroke,!1,!1);a.beginPath();for(Q=H=Math.floor(-m.y/ d);Q<=H+l;Q++)Y=Q*d+m.y,0<=Y&&Y<=g&&sp(Q,u,y)&&(A&&!B?Io(a,0,Y,h,Y,P,w.Jf):(a.moveTo(0,Y),a.lineTo(h,Y)));a.stroke()}else if("BarV"===w.Ob&&null!==w.fill)for(Xo(this,a,w.fill,!0,!1),w=w.width,isNaN(w)&&(w=e),Q=H=Math.floor(-m.x/e);Q<=H+k;Q++)Y=Q*e+m.x,0<=Y&&Y<=h&&sp(Q,u,y)&&a.fillRect(Y,0,w,g);else if("BarH"===w.Ob&&null!==w.fill)for(Xo(this,a,w.fill,!0,!1),w=w.height,isNaN(w)&&(w=d),Q=H=Math.floor(-m.y/d);Q<=H+l;Q++)Y=Q*d+m.y,0<=Y&&Y<=g&&sp(Q,u,y)&&a.fillRect(0,Y,h,w);A&&a.Tx();1!==s&&(a.globalAlpha= t)}}a.restore();a.Ee(!1)}else if(this.da===rp){e=this.Fa;c=e.width;e=e.height;a.save();a.beginPath();a.rect(-1,-1,c+1,e+1);a.clip();c=this.Ld();c.He(a,b);e=this.Mj()*b.scale;0>=e&&(e=1);d=c.Y;h=this.xa.o;g=this.Zm;k=h.length;for(l=0;lthis.mB*q.interval*c.wf.yu/this.Gu*e))for(r=q.Ia,u=q.ob*q.scale,s=q.Gh,s.ee()&&(s=jc),p=0;p g.height)continue}else if(l.position>g.width)continue;var m=l.Xq;isNaN(m)&&(m=c?a.ii:a.hi);var n=l.Wq;null===n&&(n=c?a.$i:a.gi);if(0!==m&&null!==n){Xo(a,b,n,!1,!1);var n=!1,p=!0,q=l.rK;null===q&&(q=c?a.Gl:a.Fl);null!==q&&(n=!0,p=b.Wx(q,0));b.beginPath();var r=l.position+m;c?r>g.height&&(m-=r-g.height):r>g.width&&(m-=r-g.width);l=l.position+m/2;b.lineWidth=m;r=a.padding; c?(l+=r.top,m=r.left,r=g.width-r.right,n&&!p?Io(b,m,l,r,l,q,0):(b.moveTo(m,l),b.lineTo(r,l))):(l+=r.left,m=r.top,r=g.height-r.bottom,n&&!p?Io(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&b.Tx()}}}} function Rp(a,b,c,d,e){for(var g=d.length,h=a.Y,k=0;k m)){var n=l.jf(),p=l.Xq;isNaN(p)&&(p=c?a.ii:a.hi);var q=l.Wq;null===q&&(q=c?a.$i:a.gi);null===q&&(p=0);n-=p;p=l.position+p;n+=l.jb;p+n>m&&(n=m-p);0>=n||(m=a.padding,Xo(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}} function sp(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dm&&e.set(s),D.A(s));D.A(n);g&&e.transform(h)}return c}; f.K=function(a){O.prototype.K.call(this,a);a=null;if(this.da===Ql||this.da===tj)a=this.Ld();for(var b=this.xa.o,c=b.length,d=0;d Od&&(rc=Math.max(Od-sc,0));var pg= 0===$.jb;$.jb+=rc;Od=Math.max(Od-(rc+(pg?sc:0)),0)}1!==ba.Wi||Tb!==ak&&Tb!==yo||($=this.pe(Kb),sc=$.jf(),rc=Math.max(hf-$.jb,0),rc+sc>cd&&(rc=Math.max(cd-sc,0)),pg=0===$.jb,$.jb+=rc,cd=Math.max(cd-(rc+(pg?sc:0)),0));ri&&ba.yq()}}}D.ya(df);for(var Gc=0,Fb=0,Jb=this.hq,ka=0;ka =this.Uq);fb++)$=this.qe(ba.Ub+fb),rc=Tb===Xe||Tb===yo?Math.max($.Uh,0===Ad[ba.Ub+fb]?$.ve:Math.min(Ad[ba.Ub+fb],$.ve)):Math.max($.Uh,isNaN($.uf)?$.ve:Math.min($.uf,$.ve)),Pd.height+=rc;for(fb=1;fb =this.hq);fb++)$=this.pe(ba.column+ fb),rc=Tb===Xe||Tb===zo?Math.max($.Uh,0===lf[ba.column+fb]?$.ve:Math.min(lf[ba.column+fb],$.ve)):Math.max($.Uh,isNaN($.uf)?$.ve:Math.min($.uf,$.ve)),Pd.width+=rc;tb.width+=Pd.width;tb.height+=Pd.height;Cc=ba.margin;Of=Cc.right+Cc.left;og=Cc.top+Cc.bottom;Hk(ba,tb.width,tb.height,Aj,Bj);for(var Pf=ba.Ia,hf=Math.max(Pf.width+Of,0),jf=Math.max(Pf.height+og,0),mf=0,fb=0;fb =this.Uq);fb++)$=this.qe(ba.Ub+fb),mf+=$.total||0;if(mf =od)&&!(ba.Ub+fb>=this.Uq);fb++){var $=this.qe(ba.Ub+fb),Ic=$.Ya||0,Rf=nf(ba,$,Pg);v&&"number"!==typeof Rf&&D.k(ba+" spanAllocation does not return a number: "+Rf);$.jb=Math.min($.ve,Ic+Rf);$.Ya!==Ic&&(od-=$.Ya-Ic)}for(;0 Ic&&($.jb=Math.min($.ve,Ic+od),$.Ya!==Ic&&(od-=$.Ya-Ic));if(0===$.index)break;$=this.qe($.index-1)}}for(var Pe=0,fb=0;fb =this.hq);fb++)$=this.pe(ba.column+fb),Pe+=$.total||0;if(Pe =od)&&!(ba.column+fb>=this.hq);fb++)$=this.pe(ba.column+fb),Ic=$.Ya||0,Rf=nf(ba,$,Pg),v&&"number"!==typeof Rf&&D.k(ba+" spanAllocation does not return a number: "+Rf),$.jb=Math.min($.ve,Ic+Rf),$.Ya!==Ic&&(od-=$.Ya-Ic);for(;0 Ic&&($.jb=Math.min($.ve,Ic+od),$.Ya!==Ic&&(od-=$.Ya-Ic));if(0===$.index)break;$=this.pe($.index-1)}}}D.ya(Oe);D.al(Pd);D.al(tb);void 0!==Ad&&D.ya(Ad);void 0!==lf&&D.ya(lf);for(var Qg=0,Rg= 0,Tb=Oo(this,!0),Dj=this.Ea,Ok=this.pf,ye=Fb=Gc=0,dd=0,Jb=this.hq,ka=0;ka vi)Hk(Yb,Infinity,Infinity),ze=Yb.Ia,pf.ai(ze),this.nh.add(ze);else{var Bd=Yb.We,Dt=Yb.$B,wp=Yb.Gh;wp.ee()&&(wp=mc);var qg=Yb.Vq,mw=Yb.aC,Uk=0,Vk=0,ym=0;if(Bd<-vi||Bd>=vi){var Et=Sk.xG,Sf=Sk.wG;qg!==wj&&(ym=Sk.computeAngle(Yb,qg,Sf),Yb.vg=ym);Uk=Et.x-Sg.x;Vk=Et.y-Sg.y}else{var Qd, qf;if(0<=Bd)Qd=Ih.fa(Bd),qf=Bd Gt+10?0<=Bd?xi.Yb(Qd):Qd.Yb(xi):Gt>Ft+10?0<=Bd?qf.Yb(yi):yi.Yb(qf):0<=Bd?xi.Yb(yi):yi.Yb(xi)}else Sf=0<=Bd?Qd.Yb(qf):qf.Yb(Qd);qg!==wj&&(ym=Sk.computeAngle(Yb,qg,Sf),Yb.vg=ym);Uk=Qd.x+(qf.x-Qd.x)*Dt-Sg.x;Vk=Qd.y+(qf.y-Qd.y)*Dt-Sg.y}Hk(Yb, Infinity,Infinity);var ze=Yb.Ia,wm=Yb.Fa,Wk=0;Yb instanceof z&&(Wk=Yb.ob);var zi=wm.width+Wk,Fj=wm.height+Wk;Tg.reset();Tg.translate(-ze.x,-ze.y);Tg.scale(Yb.scale,Yb.scale);Tg.rotate(qg===wj?Yb.angle:Sf,zi/2,Fj/2);qg!==Zp&&qg!==$p||Tg.rotate(90,zi/2,Fj/2);qg!==aq&&qg!==bq||Tg.rotate(-90,zi/2,Fj/2);qg===cq&&(45 Sf||225 Sf)&&Tg.rotate(-Sf,zi/2,Fj/2);var Gj=new C(0,0,zi,Fj);Tk.xo(Gj,wp);Tg.vb(Tk);var nw=-Tk.x+Wk/2*Yb.scale,ow=-Tk.y+Wk/2*Yb.scale;Ug.assign(mw);isNaN(Ug.x)&&(Ug.x=0<=Bd? zi/2+3:-(zi/2+3));isNaN(Ug.y)&&(Ug.y=-(Fj/2+3));Ug.rotate(Sf);Uk+=Ug.x;Vk+=Ug.y;Gj.set(ze);Gj.x=Uk+nw;Gj.y=Vk+ow;this.nh.add(Gj);pf.ai(Gj)}}if(this instanceof J)for(var Ht=this.Bf;Ht.next();)Hk(Ht.value,Infinity,Infinity);this.Bj=pf;var xp=this.mj;xp.n(xp.x+pf.x,xp.y+pf.y);Cb(e,pf.width||0,pf.height||0);D.lf(Tg);D.A(Tk);D.A(Ug)}}}break;case "Grid":break;case "Graduated":var pw=a,qw=b,rw=c,sw=d,Vg=this.Ld();this.Xm=[];var Hj=Vg.margin,tw=Hj.right+Hj.left,uw=Hj.top+Hj.bottom;Hk(Vg,pw,qw,rw,sw);var It= Vg.Ia,vw=It.height,ww=Math.max(It.width+tw,0),xw=Math.max(vw+uw,0),Jt=new C(-Hj.left,-Hj.top,ww,xw);this.Xm.push(Jt);e.assign(Jt);for(var al=Vg.wf,Kt=Vg.ob,yp=al.gy,Ij=al.xu,Ai=al.yu,yw=yp.length,zp=0,Ap=0,Jj=D.pb(),Bp=0;Bp Cd&&(Cd+=360);Lt.push(Cd)}zp=Mt;Ap=Nt}Jj.push(Lt)}var Ot;if(null===this.sk){for(var Pt=[],Dp=this.xa.o,Qt=Dp.length,Ep=0;Ep< Qt;Ep++){var bl=Dp[Ep],Rt=[];Pt.push(Rt);if(bl.visible)for(var Aw=bl.interval,Fp=0;Fp Aw&&Rt.push(St)}}}this.sk=Pt}Ot=this.sk;var Tt=this.xa.o,Bw=Tt.length,Jh=0,Ut=0,Vt=Ai;this.Zm=[];for(var Am=[],Bm=0;Bm Xt*Wt*Ai/this.Gu)){var ee=this.UF,Yt=Ot[Bm],Bi=Ij[0][0],Tf= 0,Dd=0,Ut=Ai*Kh.TF-1E-4,Vt=Ai*Kh.RF+1E-4,Lj=Xt*Wt;if(ee this.el+Lj&&(Ci=Math.floor((ee-this.el)/Lj),ee-=Ci*Lj);for(;ee<=this.lB;){var Gp;a:{for(var Cw=Yt.length,Hp=0;Hp Ai&&(Jh=Ai),Ut<=Jh&&Jh<=Vt)){for(var Cd=Jj[Tf][Dd],Mj=Ij[Tf][Dd];Tf Bi&&Dd Cm?0 Hm;Hm++){switch(Hm){case 0:fe.n(Em,Fm);break;case 1:fe.n(Em+Lp,Fm);break;case 2:fe.n(Em,Fm+Mp);break;case 3:fe.n(Em+Lp,Fm+Mp)}fe.rotate(fu+Mh.angle);fe.offset(du,eu);0===Gm&&0===Hm?Ei.n(fe.x,fe.y,0,0):Ei.Qi(fe);fe.offset(-du,-eu);fe.rotate(-fu-Mh.angle)}D.A(fe);this.Xm.push(Ei);Ub(Fw,Ei.x,Ei.y,Ei.width,Ei.height)}else if(Di instanceof na){var Im=Di,gu=Jp,Iw=e;null===this.Lk&&(this.Lk=new na);var Uf=this.Lk;tp(Im,Uf);var Op=Im.Gh;Op.ee()&&(Op=jc);for(var Nh=Im.Vq,Jw=Im.aC,Fi=null,Jm=0,Km=0,Wg=0,Pp=0,Kw=gu.length,Lm=0;Lm Wg||225 Wg)&&Xg.rotate(-Wg,Pj/2,Qj/2);var hu=D.ug(0,0,Pj,Qj),dl=D.O();dl.xo(hu,Op);Xg.vb(dl);var Lw=-dl.x,Mw=-dl.y,Yg=D.O();Yg.assign(Jw);isNaN(Yg.x)&&(Yg.x=Pj/2+3);isNaN(Yg.y)&&(Yg.y=-(Qj/2+3));Yg.rotate(Wg);var Jm=Jm+(Yg.x+Lw),Km=Km+(Yg.y+Mw),Qp=new C(Jm,Km,Oh.width,Oh.height),Nw=new C(Oh.x,Oh.y,Oh.width,Oh.height),Ow=new C(Oj.x,Oj.y,Oj.width,Oj.height),iu=new dq;iu.iq(Uf.sf);sg.push(Pp);sg.push(Uf.ze); sg.push(iu);sg.push(Qp);sg.push(Nw);sg.push(Ow);0===Lm?Fi=Qp.copy():Fi.ai(Qp);D.A(Yg);D.A(dl);D.Hb(hu);D.lf(Xg)}this.Xm.push(Fi);Ub(Iw,Fi.x,Fi.y,Fi.width,Fi.height)}lm(Di,!1)}}break;case "TableRow":case "TableColumn":D.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:D.k("Unknown panel type: "+n)}}var rf=e.width,sf=e.height,Mm=this.padding,Pw=Mm.top+Mm.bottom,rf=rf+(Mm.left+Mm.right),sf=sf+Pw;isFinite(g.width)&& (rf=g.width);isFinite(g.height)&&(sf=g.height);rf=Math.min(k.width,rf);sf=Math.min(k.height,sf);rf=Math.max(h.width,rf);sf=Math.max(h.height,sf);rf=Math.max(c,rf);sf=Math.max(d,sf);e.width=rf;e.height=sf;Cb(this.Vc,rf,sf);Lo(this,0,0,rf,sf)};x.prototype.findMainElement=x.prototype.Ld=function(){if(null===this.bm){var a=this.xa.o,b=a.length;if(0===b)return null;for(var c=0;cc||p>d)this.K(),Hk(this,n>c?c:n,p>d?d:p);break;case Xe:this.K(!0);Hk(this,c+r,d+s,0,0);break;case zo:this.K(!0);Hk(this,c+r,p+s,0,0);break;case yo:this.K(!0),Hk(this,n+r,d+s,0,0)}}k=this.Y;k.x=a;k.y=b; k.width=c;k.height=d;var u=this.da.ac;switch(u){case "Position":for(var t=g.length,y=e.x-this.padding.left,w=e.y-this.padding.top,A=0;A =this.Uq);Ne++){var mi=this.qe(ob+Ne);ve.height+=mi.total}for(Ne=1;Ne =this.hq);Ne++){var ni=this.pe(bd+Ne);ve.width+=ni.total}var Aj=Mf.Ya+ve.width,Bj=cf.Ya+ve.height;h.x=Nd;h.y=gc;h.width=Aj;h.height=Bj;var Jb=Nd,Ch=gc,Dh=Aj,ka=Bj;Nd+Aj>e.width&&(Dh=Math.max(e.width-Nd,0));gc+Bj>e.height&&(ka=Math.max(e.height-gc,0));var ba=Bb.alignment,ic=0,mg=0,oi=0,Kb=0;if(ba.md()){ba=this.tm;ba.Zc()||(ba=mc);var ic=ba.x,mg=ba.y,oi=ba.offsetX,Kb=ba.offsetY,pi=Mf.alignment, Xb=cf.alignment;pi.Zc()&&(ic=pi.x,oi=pi.offsetX);Xb.Zc()&&(mg=Xb.y,Kb=Xb.offsetY)}else ic=ba.x,mg=ba.y,oi=ba.offsetX,Kb=ba.offsetY;if(isNaN(ic)||isNaN(mg))mg=ic=.5,Kb=oi=0;var df=de.width,Oe=de.height,ef=Bb.margin,we=ef.left+ef.right,xe=ef.top+ef.bottom,cd=bp(Bb,cf,Mf,!1);!isNaN(Bb.Ea.width)||cd!==Xe&&cd!==zo||(df=Math.max(Aj-we,0));!isNaN(Bb.Ea.height)||cd!==Xe&&cd!==yo||(Oe=Math.max(Bj-xe,0));var Od=Bb.pf,Eh=Bb.Zg,df=Math.min(Od.width,df),Oe=Math.min(Od.height,Oe),df=Math.max(Eh.width,df),Oe=Math.max(Eh.height, Oe),$=Oe+xe;h.x+=h.width*ic-(df+we)*ic+oi+ef.left;h.y+=h.height*mg-$*mg+Kb+ef.top;Bb.visible&&(Vb(Jb,Ch,Dh,ka,h.x,h.y,de.width,de.height)?Bb.qc(h.x,h.y,df,Oe):Bb.qc(h.x,h.y,df,Oe,new C(Jb,Ch,Dh,ka)))}else{Bb.gj();Bb.cc.Xa();var nd=Bb.cc,ng=D.ug(nd.x,nd.y,nd.width,nd.height);nd.x=md.type===To?Ah:Nd;nd.y=md.type===Uo?Kg:gc;nd.width=de.width;nd.height=de.height;Bb.cc.freeze();Po(Bb,!1);if(!Db(ng,nd)){var qi=Bb.$;null!==qi&&(qi.gl(),Bb.at(qi))}D.Hb(ng)}}}}D.al(ve);for(ob=0;ob =pg){var Og=this.xG,tb=this.wG;Cj!==wj&&(Ng=this.computeAngle(sc,Cj,tb),sc.angle=Ng);Mg=Og.x;Qf=Og.y}else{var ac=void 0,Hc=void 0;if(0<=Fb)ac=Gc.o[Fb],Hc=Fb fb+10?0<=Fb?Pd.Yb(ac):ac.Yb(Pd):fb>lf+10?0<=Fb?Hc.Yb(Ad):Ad.Yb(Hc):0<=Fb?Pd.Yb(Ad):Ad.Yb(Pd)}else tb=0<=Fb?ac.Yb(Hc):Hc.Yb(ac);Cj!==wj&&(Ng=this.computeAngle(sc,Cj,tb),sc.angle=Ng);Mg=ac.x+(Hc.x-ac.x)*si;Qf=ac.y+(Hc.y-ac.y)*si}if(Lg.P(dc))sc.location=new N(Mg,Qf);else{Lg.ee()&&(Lg=mc);var mf=D.gh();mf.reset();mf.scale(sc.scale,sc.scale);mf.rotate(sc.angle,0,0);var od=sc.Fa,Pg=D.ug(0,0,od.width,od.height),nf=D.O();nf.xo(Pg,Lg);mf.vb(nf);var Ic=-nf.x,Rf=-nf.y,Pe=up.copy();isNaN(Pe.x)&&(Pe.x=0<=Fb?nf.x+ 3:-(nf.x+3));isNaN(Pe.y)&&(Pe.y=-(nf.y+3));Pe.rotate(tb);Mg+=Pe.x;Qf+=Pe.y;mf.uH(Pg);var Ic=Ic+Pg.x,Rf=Rf+Pg.y,Qg=D.Fb(Mg+Ic,Qf+Rf);sc.move(Qg);D.A(Qg);D.A(nf);D.Hb(Pg);D.lf(mf)}}this.Yu(!1)}break;case "Grid":break;case "Graduated":if(null!==this.Xm){var Rg=this.Ld(),Dj=this.Zm,Ok=this.Xm,ye=0,dd=Ok[ye];ye++;Rg.qc(dd.x-e.x,dd.y-e.y,dd.width,dd.height);for(var Pk=g.length,Hh=0;Hh q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof x?n:null;q=D.gh();q.set(h);if(null!==n?n.Zk(a,b,c,d,e,q):No(p,a,d, q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);D.lf(q)}}}void 0===g&&D.lf(h);return d}void 0===g&&D.lf(h);return!1};function iq(a,b,c,d){for(var e=a.xa.o,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.Y,l=a.Fa;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof x&&iq(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}} f.Tn=function(a,b,c,d,e,g){if(!1===this.sg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Fa,k=this.jh(),l=k?a:kb(D.Fb(a.x,a.y),this.transform),m=k?b:kb(D.Fb(b.x,b.y),this.transform),n=l.Lf(m),p=0 t.width||u.y>t.height||0>u.x+u.width||0>u.y+u.height))if(s.jh()?(u=s.transform,kb(l.set(a),u),kb(m.set(b),u)):(l.set(a),m.set(b)),u=s,s=s instanceof x?s:null,null!==s?s.Tn(l,m,c,d,e,g):u.IF(l,m,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||g.add(u)}}D.A(l);D.A(m)}return e? p:h}return!1};function Up(a){var b=null;a instanceof z&&(b=a.C,b===Vc&&(b=null),a=a.wf,null!==a&&null===b&&(b=a.C));null===b&&(b=ec);return b}function Vp(a){var b=null;a instanceof z&&(b=a.D,b===Vc&&(b=null),a=a.wf,null!==a&&null===b&&(b=a.D));null===b&&(b=vc);return b}x.prototype.add=x.prototype.add=function(a){D.l(a,O,x,"add:element");this.ce(this.xa.count,a)};x.prototype.elt=x.prototype.fa=function(a){return this.xa.fa(a)}; x.prototype.insertAt=x.prototype.ce=function(a,b){b instanceof F&&D.k("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.Cm(b))this===b&&D.k("Cannot make a Panel contain itself: "+this.toString()),D.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.Q;null!==c&&c!==this&&D.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+ this.toString());this.da!==Tl||b instanceof z||D.k("Can only add Shapes to a Grid Panel, not: "+b);this.da!==rp||b instanceof z||b instanceof na||D.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Hm(this);b.qn=null;if(null!==this.jl){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Gg&&(this.Gg=new ma(Object,x)),this.Gg.add(d,b))}var e=this.xa,d=-1;if(c===this){for(var g=-1,h=this.xa.o,k=h.length,l=0;l =e.count&& a>=e.count)return;e.qd(g);d=g}else D.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.ce(a,b);if(0===a||b.Ve)this.bm=null;Nm(this)||this.K();b.K(!1);null!==b.Rd?this.fl=!0:b instanceof x&&!0===b.fl&&(this.fl=!0);this.sk=null;c=this.$;null!==c&&(c.Xl=null,c.Ck=NaN,this.fl&&c instanceof G&&(c.fl=!0),c.fl&&c instanceof G&&(c.Re=null),e=this.g,null!==e&&e.na.ub||(-1!==d&&c.pd(hg,"elements",this,b,null,d,null),c.pd(gg,"elements",this,null, b,null,a),this.Mu()||jq(this,b,!1)))};D.defineProperty(x,{fl:null},function(){return 0!==(this.R&8388608)},function(a){0!==(this.R&8388608)!==a&&(this.R^=8388608)});function kq(a,b){a.R=b?a.R|16777216:a.R&-16777217}x.prototype.remove=x.prototype.remove=function(a){D.l(a,O,x,"remove:element");for(var b=this.xa.o,c=b.length,d=-1,e=0;e a&&D.ua(a,">= 0",x,"getRowDefinition:idx");a=Math.round(a);var b=this.kd;if(void 0===b[a]){var c=new ih;c.Hm(this);c.Ke=!0;c.index=a;b[a]=c}return b[a]};x.prototype.removeRowDefinition=x.prototype.LG=function(a){v&&D.p(a,x,"removeRowDefinition:idx");0>a&&D.ua(a,">= 0",x,"removeRowDefinition:idx");a=Math.round(a);var b=this.kd;this.pd(hg,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()}; D.w(x,{hq:"columnCount"},function(){return void 0===this.ed?0:this.ed.length});x.prototype.getColumnDefinition=x.prototype.pe=function(a){v&&D.p(a,x,"getColumnDefinition:idx");0>a&&D.ua(a,">= 0",x,"getColumnDefinition:idx");a=Math.round(a);var b=this.ed;if(void 0===b[a]){var c=new ih;c.Hm(this);c.Ke=!1;c.index=a;b[a]=c}return b[a]}; x.prototype.removeColumnDefinition=x.prototype.JG=function(a){v&&D.p(a,x,"removeColumnDefinition:idx");0>a&&D.ua(a,">= 0",x,"removeColumnDefinition:idx");a=Math.round(a);var b=this.ed;this.pd(hg,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()}; D.defineProperty(x,{mK:"rowSizing"},function(){return void 0===this.tn?qp:this.tn},function(a){if(void 0!==this.tn){var b=this.tn;b!==a&&(a!==qp&&a!==Xp&&D.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.tn=a,this.K(),this.i("rowSizing",b,a))}}); D.defineProperty(x,{kI:"columnSizing"},function(){return void 0===this.Um?qp:this.Um},function(a){if(void 0!==this.Um){var b=this.Um;b!==a&&(a!==qp&&a!==Xp&&D.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Um=a,this.K(),this.i("columnSizing",b,a))}}); D.defineProperty(x,{rH:"topIndex"},function(){return void 0===this.Aj?0:this.Aj},function(a){if(void 0!==this.Aj){var b=this.Aj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Aj=a,this.K(),this.i("topIndex",b,a))}}); D.defineProperty(x,{sG:"leftIndex"},function(){return void 0===this.kj?0:this.kj},function(a){if(void 0!==this.kj){var b=this.kj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.kj=a,this.K(),this.i("leftIndex",b,a))}});x.prototype.findRowForLocalY=function(a){if(0>a||this.type!==da)return-1;for(var b=0,c=this.kd,d=c.length,e=this.Aj;e a||this.type!==da)return-1;for(var b=0,c=this.ed,d=c.length,e=this.kj;e =c.elements.count&&!(c instanceof F)){if(1===c.elements.count){var d=null!==c.jl;if(!d)for(var e=b.j;e.next();)if("itemArray"=== e.value.vv){d=!0;break}}d||(D.trace("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),lq=!0)}}))}var lq=!1;x.prototype.copyTemplate=function(){var a=this.copy();a.LK(function(a){a instanceof x&&(a.Cl=null,a.Ud=null);var c=a.Hc;null!==c&&(a.Hc=null,c.each(function(c){a.bind(c.copy())}))});return a}; x.prototype.updateTargetBindings=x.prototype.Rb=function(a){var b=this.Cl;if(null!==b)for(void 0===a&&(a=""),b=b.j;b.next();){var c=b.value,d=c.gH;if(""===a||""===d||d===a)if(d=c.vv,null!==c.qI||""!==d){var d=this.data,e=c.ar;if(null!==e)d=""===e?this:"/"===e?this:"."===e?this:".."===e?this:this.Md(e);else{var g=this.g;null!==g&&c.py&&(d=g.ea.kl)}if(null===d)v&&D.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.Lm;if(-1!==h){if(g=this.$x(h),null===g)continue}else null!== c.Rg&&(g=c.Rg);"/"===e?d=g.$:"."===e?d=g:".."===e&&(d=g.Q);e=c.St;if(0!==e){if(!(g instanceof x))continue;h=g;1===e?g=h.pe(c.Vp):2===e&&(g=h.qe(c.Vp))}void 0!==g&&c.xH(g,d)}}}}; D.defineProperty(x,{jl:"itemArray"},function(){return this.ij},function(a){var b=this.ij;if(b!==a){v&&null!==a&&!D.isArray(a)&&D.k("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.g;null!==c&&null!==b&&cn(c,this);this.ij=a;null!==c&&null!==a&&Zm(c,this);this.i("itemArray",b,a);null!==c&&c.na.ub||this.UB()}});function vn(a){return a.type===Yj||a.type===Ql||a.type===tj||a.type===da&&0 a;)this.zf(this.xa.length-1,!1);a=this.jl;if(null!==a)for(var b=D.fb(a),c=0;cc)){var d;d=mq(a,b);var e=a.wJ,g=null;null!==e&&(g=e.oa(d));null===g&&(nq||(nq=!0,D.trace('No item template Panel found for category "'+d+'" on '+a),D.trace(" Using default item template."),d=new x,e=new na,e.bind(new oh("text","",ha)),d.add(e),oq=d),g=oq);d=g;null!==d&&(Sh(d),d=d.copy(),0!==(d.R&16777216)&&(e=a.vm(),null!==e&&kq(e,!0)),"object"===typeof b&&(null===a.Gg&&(a.Gg=new ma(Object,x)),a.Gg.add(b,d)),e=c,vn(a)&&e++,a.ce(e,d),d.Ud=b,wn(a,e, c),d.Ud=null,d.data=b)}}function wn(a,b,c){for(a=a.xa;b a&&D.ua(a,">= 0",ih,"height"),this.uf=a,this.jb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("height",b,a))});D.defineProperty(ih,{width:"width"},function(){return this.uf},function(a){var b=this.uf;b!==a&&(v&&D.h(a,"number",ih,"width"),0>a&&D.ua(a,">= 0",ih,"width"),this.uf=a,this.jb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("width",b,a))}); D.defineProperty(ih,{Uh:"minimum"},function(){return this.Ek},function(a){var b=this.Ek;b!==a&&(v&&D.h(a,"number",ih,"minimum"),(0>a||!isFinite(a))&&D.ua(a,">= 0",ih,"minimum"),this.Ek=a,this.jb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("minimum",b,a))});D.defineProperty(ih,{ve:"maximum"},function(){return this.Dk},function(a){var b=this.Dk;b!==a&&(v&&D.h(a,"number",ih,"maximum"),0>a&&D.ua(a,">= 0",ih,"maximum"),this.Dk=a,this.jb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("maximum",b,a))}); D.defineProperty(ih,{alignment:"alignment"},function(){return this.we},function(a){var b=this.we;b.P(a)||(v&&D.l(a,R,ih,"alignment"),this.we=a.V(),null!==this.Q&&this.Q.K(),this.vd("alignment",b,a))});D.defineProperty(ih,{stretch:"stretch"},function(){return this.Pg},function(a){var b=this.Pg;b!==a&&(v&&D.Da(a,O,ih,"stretch"),this.Pg=a,null!==this.Q&&this.Q.K(),this.vd("stretch",b,a))}); D.defineProperty(ih,{aH:"separatorPadding"},function(){return this.Ik},function(a){"number"===typeof a?a=new Lb(a):null!==a&&v&&D.l(a,Lb,ih,"separatorPadding");var b=this.Ik;null!==a&&null!==b&&b.P(a)||(null!==a&&(a=a.V()),this.Ik=a,null!==this.Q&&this.Q.K(),this.vd("separatorPadding",b,a))}); D.defineProperty(ih,{Wq:"separatorStroke"},function(){return this.Gt},function(a){var b=this.Gt;b!==a&&(null===a||"string"===typeof a||a instanceof za)&&(a instanceof za&&a.freeze(),this.Gt=a,null!==this.Q&&this.Q.K(),this.vd("separatorStroke",b,a))});D.defineProperty(ih,{Xq:"separatorStrokeWidth"},function(){return this.Ht},function(a){var b=this.Ht;b!==a&&(this.Ht=a,null!==this.Q&&this.Q.K(),this.vd("separatorStrokeWidth",b,a))}); D.defineProperty(ih,{rK:"separatorDashArray"},function(){return this.ti},function(a){var b=this.ti;if(b!==a){null===a||Array.isArray(a)||D.kc(a,"Array",ih,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e e)){for(var g=d.Ia,h=Math.max(1,g.width),g=g.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=D.pb(),y=2;y p&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,y=0,q=t[y],p=q[0],s=q[1],r=q[2],q=q[3],w=0;.1<=u;){0===w&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){D.ya(t);return}e> q?(w=e-q,e=q):w=0;var A=Math.sqrt(e*e/(1+r*r));0>p&&(A=-A);k+=A;l+=r*A;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(g/2));0===w&&d.Yk(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==w){y++;if(y===t.length){D.ya(t);return}q=t[y];p=q[0];s=q[1];r=q[2];q=q[3];e=w}}D.ya(t)}} z.prototype.Yk=function(a,b){if(null!==this.Bc||null!==this.Wd){null!==this.Wd&&Xo(this,a,this.Wd,!0,!1);null!==this.Bc&&Xo(this,a,this.Bc,!1,!1);var c=this.Qg;if(0===c){var d=this.$;d instanceof ca&&d.type===tj&&"Selection"===d.Kd&&d.Cb instanceof z&&d.gf.Ld()===d.Cb&&(c=d.Cb.ob)}a.lineWidth=c;a.lineJoin=this.Sp;a.lineCap=this.Qp;a.miterLimit=this.Bn;var e=!1;this.$&&b.dl("drawShadows")&&(e=this.$.il);var g=!0;null!==this.Bc&&null===this.Wd&&(g=!1);var d=!1,h=!0,k=this.jH;null!==k&&(d=!0,h=a.Wx(k, this.Jf));var l=this.Za;if(null!==l){if(l.da===Ye)a.beginPath(),d&&!h?Io(a,l.Ac,l.Mc,l.Db,l.Mb,k,this.Jf):(a.moveTo(l.Ac,l.Mc),a.lineTo(l.Db,l.Mb)),null!==this.Wd&&a.Wg(this.Wd),0!==c&&null!==this.Bc&&a.bk();else if(l.da===Ze){var m=l.Ac,n=l.Mc,p=l.Db,q=l.Mb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.Wd&&(a.beginPath(),a.rect(l,r,m,n),a.Wg(this.Wd));if(null!==this.Bc){var s=p=0,u=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= 0,a.shadowBlur=0);d&&!h?(h=D.pb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),rq(a,h,k,this.Jf),a.bk(),D.ya(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.bk());g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.da===tf)m=l.Ac,n=l.Mc,p=l.Db,q=l.Mb,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+Id*l,n-r,m+l,n-Id*r,m+l,n),a.bezierCurveTo(m+ l,n+Id*r,m+Id*l,n+r,m,n+r),a.bezierCurveTo(m-Id*l,n+r,m-l,n+Id*r,m-l,n),a.bezierCurveTo(m-l,n-Id*r,m-Id*l,n-r,m,n-r),a.closePath(),null!==this.Wd&&a.Wg(this.Wd),d&&!h&&(h=D.pb(),Ae(m,n-r,m+Id*l,n-r,m+l,n-Id*r,m+l,n,.5,h),Ae(m+l,n,m+l,n+Id*r,m+Id*l,n+r,m,n+r,.5,h),Ae(m,n+r,m-Id*l,n+r,m-l,n+Id*r,m-l,n,.5,h),Ae(m-l,n,m-l,n-Id*r,m-Id*l,n-r,m,n-r,.5,h),a.beginPath(),rq(a,h,k,this.Jf),D.ya(h)),0!==c&&null!==this.Bc&&(g&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= 0,a.shadowBlur=0,a.bk(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.bk());else if(l.da===Ve){r=l.mk;n=r.length;for(q=0;q y.Ef);else{var t=If(y,m),w=t.length;if(0===w){a.lineTo(y.pa,y.va);break}for(var A=0;A e)){var g=.001,h=c.length,k=b[0],l=b[1];if(4===e)Io(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=g=0,n=0,p=0,q=0,r=p=0,s=D.pb(),u=2;u r&&(g=r);g>p?(t=g-p,g=p):t=0;var y=Math.sqrt(g*g/(1+q*q));0>n&&(y=-y);k+=y;l+= q*y;e?a.lineTo(k,l):a.moveTo(k,l);r-=g;p-=g;if(0!==t){u++;if(u===s.length){D.ya(s);return}p=s[u];n=p[0];q=p[1];p=p[2];g=t}else e=!e}D.ya(s)}}}z.prototype.getDocumentPoint=z.prototype.gb=function(a,b){void 0===b&&(b=new N);if(a instanceof R){a.ee()&&D.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Fa,d=this.ob;b.n(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.Hh.vb(b);return b}; z.prototype.Uk=function(a,b){var c=this.wf;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.kb,e=this.ob/2;c.type!==Ye||b||(e+=2);var g=D.Ff();g.assign(d);g.ig(e+2,e+2);if(!g.Pa(a))return D.Hb(g),!1;d=e+1E-4;if(c.type===Ye){if(null===this.stroke)return!1;d=(c.F-c.la)*(a.x-c.la)+(c.G-c.ja)*(a.y-c.ja);if(0>(c.la-c.F)*(a.x-c.F)+(c.ja-c.G)*(a.y-c.G)||0>d)return!1;D.Hb(g);return pe(c.la,c.ja,c.F,c.G,e,a.x,a.y)}if(c.type===Ze){var h=c.la,k=c.ja,l=c.F,c=c.G;g.x=Math.min(h,l);g.y=Math.min(k, c);g.width=Math.abs(l-h);g.height=Math.abs(c-k);if(null===this.fill){g.ig(-d,-d);if(g.Pa(a))return D.Hb(g),!1;g.ig(d,d)}null!==this.stroke&&g.ig(e,e);d=g.Pa(a);D.Hb(g);return d}if(c.type===tf){var h=c.la,k=c.ja,l=c.F,c=c.G,e=Math.min(h,l),m=Math.min(k,c),h=Math.abs(l-h)/2,k=Math.abs(c-k)/2,e=a.x-(e+h),m=a.y-(m+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=e*e/(h*h)+m*m/(k*k))return D.Hb(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=d,k+=d);D.Hb(g);return 0>=h||0>=k?!1:1>=e*e/(h*h)+m*m/(k*k)}if(c.type=== Ve)return D.Hb(g),null===this.fill?Xf(c,a.x,a.y,e):c.Pa(a,e,1 =this.ob)n=He(p.Ac,p.Mc,p.Db,p.Mb,g,h,k,l,e);else{var r=0,s=0;p.Ac===p.Db?(r=m,s=0):(b=(p.Mb-p.Mc)/(p.Db-p.Ac),s=m/Math.sqrt(1+b*b),r=s*b);d=D.pb();b=new N;He(p.Ac+ r,p.Mc+s,p.Db+r,p.Mb+s,g,h,k,l,b)&&d.push(b);b=new N;He(p.Ac-r,p.Mc-s,p.Db-r,p.Mb-s,g,h,k,l,b)&&d.push(b);b=new N;He(p.Ac+r,p.Mc+s,p.Ac-r,p.Mc-s,g,h,k,l,b)&&d.push(b);b=new N;He(p.Db+r,p.Mb+s,p.Db-r,p.Mb-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return D.ya(d),!1;n=!0;s=Infinity;for(r=0;rMath.abs(c)){n=h-b-c*(g-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-a))+Math.abs((h-b)*(h- b));d k){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);d c?a-c:c-a)<(b>d?b-d:d-b)?(e=b e||Eb(l.y,e))&&(l.ye||Eb(l.x,e))&&(l.x=h&&d<=a}a =h&&g<=a} z.prototype.IF=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d e)return!0;return!1}if(c&&null!==this.fill&&this.Uk(a,!0))return!0;var e=a.Lf(b);b=e;1.5 =e||mb(b,g,0,-p)>=e||mb(b,g,0,p)>=e||mb(b,g,n,0)>= e?!1:!0}else if(g.type===Ve){h=g.kb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.x h&&a.y e&&lb(a.x,a.y,k,l,m,l)>e&&lb(a.x,a.y,m,h,k,h)>e&&lb(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Xf(g,a.x,a.y,b):g.Pa(a,b,!0))return!0}else{c=g.nc;for(b=0;b e)return!1;l=k.Eb.o;m=l.length;for(h=0;h e)return!1;break;case Ef:g=D.pb(); Ae(n,p,q.Ec,q.bd,q.Wh,q.Xh,q.F,q.G,.8,g);n=d(g,a);D.ya(g);if(n)return!1;n=q.F;p=q.G;if(a.oq(n,p)>e)return!1;break;case Ff:g=D.pb();Ee(n,p,q.Ec,q.bd,q.F,q.G,.8,g);n=d(g,a);D.ya(g);if(n)return!1;n=q.F;p=q.G;if(a.oq(n,p)>e)return!1;break;case Gf:case Hf:var r=q.type===Gf?If(q,k):Vf(q,k,n,p),s=r.length;if(0===s){n=q.pa;p=q.va;if(a.oq(n,p)>e)return!1;break}q=null;g=D.pb();for(b=0;b = 0",z,"strokeWidth:value")}); D.defineProperty(z,{IM:"strokeCap"},function(){return this.Qp},function(a){var b=this.Qp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?D.ua(a,'"butt", "round", or "square"',z,"strokeCap"):(this.Qp=a,this.ra(),this.i("strokeCap",b,a)))}); D.defineProperty(z,{KM:"strokeJoin"},function(){return this.Sp},function(a){var b=this.Sp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?D.ua(a,'"miter", "bevel", or "round"',z,"strokeJoin"):(this.Sp=a,this.ra(),this.i("strokeJoin",b,a)))}); D.defineProperty(z,{LM:"strokeMiterLimit"},function(){return this.Bn},function(a){var b=this.Bn;if(b!==a)if(v&&D.p(a,z,"strokeMiterLimit"),1<=a){this.Bn=a;this.ra();var c=this.$;null!==c&&(c.Ck=NaN);this.i("strokeMiterLimit",b,a)}else D.ua(a,"value >= 1",z,"strokeWidth:value")}); D.defineProperty(z,{jH:"strokeDashArray"},function(){return this.Rp},function(a){var b=this.Rp;if(b!==a){null===a||Array.isArray(a)||D.kc(a,"Array",z,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1a?a=0:1a?a=0:1n*l*l&&(h=!0);b.fd!==a&&(h=!1);!1===b.dl("textGreeking")&&(h=!1);n=this.yi;l=this.zi;switch(this.zu){case Co:a.translate(c, 0);a.scale(-1,1);break;case Bo:a.translate(0,d);a.scale(1,-1);break;case Do:a.translate(c,d),a.scale(-1,-1)}var m=this.ze,p=(n+e+l)*m;d>p&&(k=this.gm,k=k.y*d-k.y*p+k.offsetY);for(var p=this.sf,q=0;q c&&(r=c);var k=k+n,u=s,s=a,t=k,y=c,w=e,A=g,B=0;h?("left"===A?B=0:"right"===A?B=y-r:"center"===A&&(B=(y-r)/2),s.fillRect(0+B,t+.25*w,r,1)):("left"===A?B=0:"right"===A?B=y:"center"===A&&(B=y/2),s.fillText(u,0+B,t+w-.25*w),u=w/20|0,0===u&&(u=1),"right"===A?B-=r:"center"=== A&&(B-=r/2),this.yk&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+B,t+w-.2*w),s.lineTo(0+B+r,t+w-.2*w),s.stroke()),this.wk&&(s.beginPath(),s.lineWidth=u,t=t+w-w/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+B,t),s.lineTo(0+B+r,t),s.stroke()));k+=e+l}switch(this.zu){case Co:a.scale(-1,1);a.translate(-c,0);break;case Bo:a.scale(1,-1);a.translate(0,-d);break;case Do:a.scale(-1,-1),a.translate(-c,-d)}}}; na.prototype.lo=function(a,b,c,d){this.tp=a;var e=this.sf;e.reset();var g=0,h=0;if(isNaN(this.Ea.width)){g=this.Zd.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.oy){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=Sq(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.Ag);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=Sq(g,this.Ag);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Ea.width;null!==this.Q&&(g=Math.min(g, this.Q.pf.width));h=Qq(this,g,e);m=h=isNaN(this.Ea.height)?Math.min(h,b/this.scale):this.Ea.height;if(0!==e.Qe&&1!==e.Ze.length&&this.sj===Nq&&(b=this.Ag,l=this.sj===Nq?Tq(b):0,k=this.yi+this.zi,k=Math.max(0,Rq(this)+k),m=Math.min(this.IJ-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Ze.length))){k=e.Ze[m];for(l=Math.max(1,a-l);Sq(k,b)>l&&1 =a.wh)return new Ba(0,l);if(a.Dj===Kq){c.Cj=1;g=Sq(b,k);if(0===h||g<=d)return c.Qe=Math.max(c.Qe,g),c.Hf.push(c.Qe),c.Ze.push(b),new Ba(g,l);var m=Uq(a,b);b=b.substr(m.length);for(var n=Uq(a,b),g=Sq(m+n,k);0 d&&1 d;){n=1;g=Sq(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Sq(m.substr(0,n),k);1===n?(c.Hf[a.ze+p]=g,e=Math.max(e,g)):(c.Hf[a.ze+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Ze[a.ze+p]=m.substr(0,n);p++;m=m.substr(n);if(a.ze+p>a.wh)break}n=Uq(a,b);for(g=Sq(m+n,k);0 a.wh))break}c.Cj=Math.min(a.wh,p);c.Qe=Math.max(c.Qe,e);return new Ba(c.Qe,l*c.Cj)} function Uq(a,b){if(a.Dj===Mq)return b.substr(0,1);for(var c=b.length,d=0;d =c?b:b.substr(0,d)}function Sq(a,b){Iq!==b&&(Iq=Jq.font=b);return Jq.measureText(a).width}function Rq(a){if(null!==a.sf.nk)return a.sf.nk;var b=a.Ag;Iq!==b&&(Iq=Jq.font=b);var c=0;void 0!==Dq[b]&&5E3>Eq?c=Dq[b]:(c=1.3*Jq.measureText("M").width,Dq[b]=c,Eq++);return a.sf.nk=c} function Tq(a){Iq!==a&&(Iq=Jq.font=a);var b=0;void 0!==Fq[a]&&5E3>Gq?b=Fq[a]:(b=Jq.measureText(Hq).width,Fq[a]=b,Gq++);return b} function Qq(a,b,c){var d=a.Zd.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.yi+a.zi,e=Math.max(0,Rq(a)+e);if(0===d.length)return c.Qe=0,a.ze=1,e;if(!a.oy){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=0,h=a.ze=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.Dj!==Kq?(c.Cj=0,h=Pq(a,h,c,b),g+=h.height,a.ze+=c.Cj):(Pq(a,h,c,b),g+=e,a.ze++),a.ze===a.wh&&(l=!0)),h=k+1;return a.Gw=g} D.defineProperty(na,{nC:"textValidation"},function(){return this.dm},function(a){var b=this.dm;b!==a&&(null!==a&&D.h(a,"function",na,"textValidation"),this.dm=a,this.i("textValidation",b,a))});D.defineProperty(na,{mH:"textEdited"},function(){return this.Tt},function(a){var b=this.Tt;b!==a&&(null!==a&&D.h(a,"function",na,"textEdited"),this.Tt=a,this.i("textEdited",b,a))}); D.defineProperty(na,{FM:"spacingAbove"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(v&&D.h(a,"number",na,"spacingAbove"),this.yi=a,this.i("spacingAbove",b,a))});D.defineProperty(na,{GM:"spacingBelow"},function(){return this.zi},function(a){var b=this.zi;b!==a&&(v&&D.h(a,"number",na,"spacingBelow"),this.zi=a,this.i("spacingBelow",b,a))}); D.defineProperty(na,{IJ:"maxLines"},function(){return this.wh},function(a){var b=this.wh;b!==a&&(v&&D.h(a,"number",na,"maxLines"),a=Math.floor(a),0>=a&&D.ua(a,"> 0",na,"maxLines"),this.wh=a,this.i("maxLines",b,a),this.K())});D.w(na,{hM:"metrics"},function(){return this.sf});D.defineProperty(na,{pL:"choices"},function(){return this.vr},function(a){var b=this.vr;b!==a&&(null===a||Array.isArray(a)||D.kc(a,"Array",na,"choices:value"),this.vr=a,this.i("choices",b,a))}); function dq(){this.Qe=this.Cj=0;this.Hf=[];this.Ze=[];this.nk=null}dq.prototype.reset=function(){this.Qe=this.Cj=0;this.nk=null;this.Hf=[];this.Ze=[]};dq.prototype.iq=function(a){this.Cj=a.Cj;this.nk=a.nk;this.Qe=a.Qe;this.Hf=D.pm(a.Hf);this.Ze=D.pm(a.Ze)};D.w(dq,{mL:"arrSize"},function(){return this.Hf});D.w(dq,{nL:"arrText"},function(){return this.Ze});D.w(dq,{gM:"maxLineWidth"},function(){return this.Qe});D.w(dq,{RL:"fontHeight"},function(){return this.nk}); function Hl(){O.call(this);this.af=null;this.Nt="";this.Jk=ie;this.ip=Xe;this.Ci=this.bf=null;this.hp=mc;this.zg=ak;this.Tp=null;this.cA=!1;this.cp=!0;this.Ew=!1;this.Lp=null}D.Ta(Hl,O);D.ka("Picture",Hl);Hl.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.af;a.Nt=this.Nt;a.Jk=this.Jk.V();a.ip=this.ip;a.zg=this.zg;a.bf=this.bf;a.Ci=this.Ci;a.hp=this.hp.V();a.cp=this.cp;a.Lp=this.Lp}; Hl.prototype.pc=function(a){a===ak||a===ck||a===Ao?this.hJ=a:O.prototype.pc.call(this,a)};Hl.prototype.toString=function(){return"Picture("+this.source+")#"+D.Nd(this)};var Vq=new ja,Wq=0,Bl=[];function Xq(){var a=Bl;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d =d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(g=g+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Xe:n=d.width;p=d.height;break;case ck:case Ao:var s=0;q===ck?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===Ao&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(g=(g+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height), n=d.width,p=d.height)}var q=this.Mj()*b.scale,u=k*h/(n*q*p*q),s=Vq[this.source],q=null;if(c.qs&&void 0!==s&&16s.bq.length&&(ar(s,4,l,m),ar(s,16,l,m));for(var l=s.bq,m=l.length,q=l[0],t=0;t e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.2,.22);b.D=new R(.8, .9);D.u(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=er(6);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.07,.25);b.D=new R(.93,.75);D.u(a);return b},Heptagon:function(a,b,c){var d=er(7);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.2,.15);b.D=new R(.8,.85);D.u(a);return b},Octagon:function(a,b,c){var d=er(8);a=D.v();S(a,d[0].x*b,d[0].y*c,!0); for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.85);D.u(a);return b},Nonagon:function(a,b,c){var d=er(9);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.17,.13);b.D=new R(.82,.82);D.u(a);return b},Decagon:function(a,b,c){var d=er(10);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b}, Dodecagon:function(a,b,c){var d=er(12);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b},FivePointedStar:function(a,b,c){var d=dr(5);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);D.u(a);return b},SixPointedStar:function(a,b,c){var d=dr(6);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x* b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);D.u(a);return b},SevenPointedStar:function(a,b,c){var d=dr(7);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);D.u(a);return b},EightPointedStar:function(a,b,c){var d=dr(8);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);D.u(a);return b},NinePointedStar:function(a, b,c){var d=dr(9);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);D.u(a);return b},TenPointedStar:function(a,b,c){var d=dr(10);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ya(d);V(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);D.u(a);return b},FivePointedBurst:function(a,b,c){var d=cr(5);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e a&&(a=.15);var d=D.v(),e=.2*Id;S(d,0,.2*c,!0);T(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);T(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);T(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);T(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c); S(d,0,a*c,!1);d.lineTo(1*b,a*c);d.mb(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},DividedProcess:function(a,b,c){a=a?a.Sc:NaN;if(isNaN(a)||.1>a)a=.1;var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,0,a*c,!1);d.lineTo(1*b,a*c);d.mb(!1);b=d.q;b.C=new R(0,a);b.D=vc;D.u(d);return b},Document:function(a,b,c){c/=.8;a=D.v();S(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);V(a);b=a.q;b.C=ec;b.D=new R(1,.6);D.u(a); return b},ExternalOrganization:function(a,b,c){a=a?a.Sc:NaN;if(isNaN(a)||.2>a)a=.2;var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.mb(!1);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);D.u(d);return b},ExternalProcess:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);V(a); S(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.mb(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);D.u(a);return b},File:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);V(a);S(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.mb(!1);b=a.q;b.C=new R(0,.25);b.D=vc;D.u(a);return b},Interrupt:function(a,b,c){a=D.v();S(a,1*b, .5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},InternalStorage:function(a,b,c){var d=a?a.Sc:NaN;a=a?a.gv:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=D.v();S(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);V(e);S(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.mb(!1);b=e.q;b.C=new R(d,a);b.D=vc;D.u(e);return b},Junction:function(a,b, c){a=D.v();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);T(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);T(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);T(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);S(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.mb(!1);b=a.q;b.me=ck;D.u(a);return b},LinedDocument:function(a,b,c){c/=.8;a=D.v();S(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);V(a);S(a,.1* b,0,!1);a.lineTo(.1*b,.75*c);a.mb(!1);b=a.q;b.C=new R(.1,0);b.D=new R(1,.6);D.u(a);return b},LoopLimit:function(a,b,c){a=D.v();S(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);V(a);b=a.q;b.C=new R(0,.25);b.D=vc;D.u(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=D.v();var d=.5*Id;S(a,.5*b,1*c,!0);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+ d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.8);D.u(a);return b},ManualInput:function(a,b,c){a=D.v();S(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);V(a);b=a.q;b.C=new R(0,.25);b.D=vc;D.u(a);return b},MessageFromUser:function(a,b,c){a=a?a.Sc:NaN;isNaN(a)&&(a=.7);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=ec;b.D=new R(a,1);D.u(d);return b}, MicroformProcessing:function(a,b,c){a=a?a.Sc:NaN;isNaN(a)&&(a=.25);var d=D.v();S(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},MicroformRecording:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=new R(0,.25);b.D=new R(1,.75);D.u(a);return b},MultiDocument:function(a,b,c){c/=.8;a=D.v(); S(a,b,0,!0);a.lineTo(b,.5*c);T(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);T(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);T(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);V(a);S(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.mb(!1);b=a.q;b.C=new R(0,.25);b.D=new R(.8,.77);D.u(a);return b},MultiProcess:function(a,b,c){a=D.v(); S(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);V(a);S(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.mb(!1);b=a.q;b.C=new R(0,.2);b.D=new R(.8,1);D.u(a);return b},OfflineStorage:function(a,b,c){a=a?a.Sc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=D.v();S(e,0,0,!0);e.lineTo(1* b,0);e.lineTo(.5*b,1*c);V(e);S(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.mb(!1);b=e.q;b.C=new R(d/4+.5*a,a);b.D=new R(3*d/4+.5*a,a+.5*d);D.u(e);return b},OffPageConnector:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=ec;b.D=new R(.75,1);D.u(a);return b},Or:function(a,b,c){a=D.v();var d=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a, (.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.mb(!1);b=a.q;b.me=ck;D.u(a);return b},PaperTape:function(a,b,c){c/=.8;a=D.v();S(a,0,.7*c,!0);a.lineTo(0,.3*c);T(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);V(a);b=a.q;b.C=new R(0,.49);b.D=new R(1,.75);D.u(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Sc:NaN;a=a?a.gv:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();S(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1- a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);V(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Sc:NaN;a=a?a.gv:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();S(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);V(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Sc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0, 1*c);V(d);S(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.mb(!1);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},Process:function(a,b,c){a=a?a.Sc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,a*b,0,!1);d.lineTo(a*b,1*c);d.mb(!1);b=d.q;b.C=new R(a,0);b.D=vc;D.u(d);return b},Sort:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);V(a);S(a,0,.5*c,!1);a.lineTo(1*b,.5* c);a.mb(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.5);D.u(a);return b},Start:function(a,b,c){a=D.v();S(a,.25*b,0,!0);S(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);S(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.mb(!1);b=a.q;b.C=new R(.25,0);b.D=new R(.75,1);D.u(a);return b},Terminator:function(a,b,c){a=D.v();S(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.q;b.C=new R(.23,0); b.D=new R(.77,1);D.u(a);return b},TransmittalTape:function(a,b,c){a=a?a.Sc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);V(d);b=d.q;b.C=ec;b.D=new R(1,1-a);D.u(d);return b},AndGate:function(a,b,c){a=D.v();var d=.5*Id;S(a,0,0,!0);a.lineTo(.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=ec;b.D=new R(.55,1);D.u(a);return b},Buffer:function(a,b,c){a=D.v();S(a, 0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Clock:function(a,b,c){a=D.v();var d=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);S(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2* b,.75*c);a.mb(!1);b=a.q;b.me=ck;D.u(a);return b},Ground:function(a,b,c){a=D.v();S(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.q;D.u(a);return b},Inverter:function(a,b,c){a=D.v();var d=.1*Id;S(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);T(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);T(a,.8*b,(.5-d)*c,(.9-d)*b,.4* c,.9*b,.4*c);T(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(0,.25);b.D=new R(.4,.75);D.u(a);return b},NandGate:function(a,b,c){a=D.v();var d=.5*Id,e=.4*Id,g=.1*Id;S(a,.8*b,.5*c,!0);T(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);T(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);S(a,1*b,.5*c,!0);T(a,1*b,(.5+g)*c,(.9+g)*b,.6*c,.9*b,.6*c);T(a,(.9-g)*b,.6*c,.8*b,(.5+g)*c,.8*b,.5*c);T(a,.8*b,(.5-g)*c,(.9-g)*b,.4*c,.9*b,.4*c);T(a,(.9+g)*b,.4*c,1*b,(.5-g)*c,1*b,.5* c);b=a.q;b.C=new R(0,.05);b.D=new R(.55,.95);D.u(a);return b},NorGate:function(a,b,c){a=D.v();var d=.5,e=Id*d,g=0,h=.5;S(a,.8*b,.5*c,!0);T(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,0,1*c);T(a,.25*b,.75*c,.25*b,.25*c,0,0);T(a,(g+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Id;g=.9;h=.5;S(a,(g-d)*b,h*c,!0);T(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);T(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);T(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);T(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C= new R(.2,.25);b.D=new R(.6,.75);D.u(a);return b},OrGate:function(a,b,c){a=D.v();var d=.5*Id;S(a,0,0,!0);T(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);T(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);T(a,.25*b,.75*c,.25*b,.25*c,0,0);V(a);b=a.q;b.C=new R(.2,.25);b.D=new R(.75,.75);D.u(a);return b},XnorGate:function(a,b,c){a=D.v();var d=.5,e=Id*d,g=.2,h=.5;S(a,.1*b,0,!1);T(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);S(a,.8*b,.5*c,!0);T(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,.2*b,1*c);T(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);T(a,(g+e)* b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Id;g=.9;h=.5;S(a,(g-d)*b,h*c,!0);T(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);T(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);T(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);T(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C=new R(.4,.25);b.D=new R(.65,.75);D.u(a);return b},XorGate:function(a,b,c){a=D.v();var d=.5*Id;S(a,.1*b,0,!1);T(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);S(a,.2*b,0,!0);T(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);T(a,.9*b,(.5+d)* c,(.2+d)*b,1*c,.2*b,1*c);T(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);V(a);b=a.q;b.C=new R(.4,.25);b.D=new R(.8,.75);D.u(a);return b},Capacitor:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Resistor:function(a,b,c){a=D.v();S(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.q;D.u(a);return b},Inductor:function(a,b,c){a=D.v();var d=.1*Id,e=.1;S(a,(e-.5* d)*b,c,!1);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;T(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.q;D.u(a);return b},ACvoltageSource:function(a,b,c){a=D.v();var d=.5*Id;S(a,0*b,.5*c,!1);T(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);T(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)* c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);T(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.q;b.me=ck;D.u(a);return b},DCvoltageSource:function(a,b,c){a=D.v();S(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Diode:function(a,b,c){a=D.v();S(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Wifi:function(a,b,c){var d=b,e=c; b*=.38;c*=.6;a=D.v();var g=.8*Id,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;S(a,k*b+d,(l+h)*c+e,!0);T(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);T(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);T(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);T(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a);g=.4*Id;h=.4;k=.2;l=.5;S(a,k*b+d,(l+h)*c+e,!0);T(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);T(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k* b+d,(l-h)*c+e);T(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);T(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a);g=.2*Id;h=.2;l=k=.5;S(a,(k-h)*b+d,l*c+e,!0);T(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);T(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);T(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);g=.4*Id;h=.4;k=.8;l=.5;S(a,k*b+d,(l-h)*c+e,!0);T(a,(k+g)*b+d,(l- h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);T(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);T(a,(k+h-.5*g)*b+d,(l-g)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);V(a);g=.8*Id;h=.8;k=1;l=.5;S(a,k*b+d,(l-h)*c+e,!0);T(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);T(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);T(a,(k+h-.5*g)*b+d,(l-g)*c+ e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);V(a);b=a.q;D.u(a);return b},Email:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);V(a);S(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.mb(!1);b=a.q;D.u(a);return b},Ethernet:function(a,b,c){a=D.v();S(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);V(a);S(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c); a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);V(a);S(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);V(a);S(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.mb(!1);b=a.q;D.u(a);return b},Power:function(a,b,c){a=D.v();var d=.4*Id,e=.4,g=D.O(),h=D.O(),k=D.O(),l=D.O();Be(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);var m=D.Fb(h.x, h.y);S(a,h.x*b,h.y*c,!0);T(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);T(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);Be(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);T(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*Id;e=.3;Be(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);a.lineTo(h.x*b,h.y*c);T(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);T(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+ e)*b,.5*c);Be(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);T(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);V(a);S(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);V(a);D.A(g);D.A(h);D.A(k);D.A(l);D.A(m);b=a.q;b.C=new R(.25,.55);b.D=new R(.75,.8);D.u(a);return b},Fallout:function(a,b,c){a=D.v();var d=.5*Id;S(a,0*b,.5*c,!0);T(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);T(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b, .5*c);var e=d=0;S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;V(a);S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;V(a);S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);V(a);b=a.q;b.me=ck;D.u(a);return b},IrritationHazard:function(a,b,c){a=D.v();S(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8* b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);V(a);b=a.q;b.C=new R(.3,.3);b.D=new R(.7,.7);D.u(a);return b},ElectricalHazard:function(a,b,c){a=D.v();S(a,.37*b,0*c,!0);a.lineTo(.5*b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65* b,.56*c);a.lineTo(0*b,.68*c);V(a);b=a.q;D.u(a);return b},FireHazard:function(a,b,c){a=D.v();S(a,.1*b,1*c,!0);T(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);T(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);T(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);T(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);T(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);T(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);V(a);b=a.q;b.C=new R(.05,.645);b.D=new R(.884,.908);D.u(a);return b},BpmnActivityLoop:function(a,b,c){a=D.v();var d=4*(Math.SQRT2-1)/3*.5;S(a,.65*b,1*c, !1);T(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);T(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);T(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);T(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.q;D.u(a);return b},BpmnActivityParallel:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},BpmnActivitySequential:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(1* b,0);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},BpmnActivityAdHoc:function(a,b,c){a=D.v();S(a,0,0,!1);S(a,1*b,1*c,!1);S(a,0,.5*c,!1);T(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);T(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.q;D.u(a);return b},BpmnActivityCompensation:function(a,b,c){a=D.v();S(a,0,.5*c,!0);a.lineTo(.5*b,0);a.lineTo(.5*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);a.lineTo(.5*b,1*c);V(a);b=a.q;D.u(a);return b},BpmnTaskMessage:function(a, b,c){a=D.v();S(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8*c);a.lineTo(0,.8*c);V(a);S(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.mb(!1);b=a.q;D.u(a);return b},BpmnTaskScript:function(a,b,c){a=D.v();S(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);T(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,0);T(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);V(a);S(a,.45*b,.73*c,!1);a.lineTo(.7*b,.73*c);a.moveTo(.38*b,.5*c);a.lineTo(.63*b,.5*c);a.moveTo(.31*b,.27*c);a.lineTo(.56*b,.27*c);a.mb(!1);b=a.q;D.u(a);return b}, BpmnTaskUser:function(a,b,c){a=D.v();S(a,0,0,!1);S(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);T(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);T(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*b,.405*c);var d=.5-.285,e=Math.PI/4,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;T(a,(.5-(e+d)/2)*b,(d+(d+g)/2)*c,(.5-d)*b,(d+g)*c,(.5-d)*b,d*c);T(a,(.5-d)*b,(d-g)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c); T(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-g)*c,(.5+d)*b,d*c);T(a,(.5+d)*b,(d+g)*c,(.5+(e+d)/2)*b,(d+(d+g)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);S(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);S(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.q;D.u(a);return b},BpmnEventConditional:function(a,b,c){a=D.v();S(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);V(a);S(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8* b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.mb(!1);b=a.q;D.u(a);return b},BpmnEventError:function(a,b,c){a=D.v();S(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);V(a);b=a.q;D.u(a);return b},BpmnEventEscalation:function(a,b,c){a=D.v();S(a,0,0,!1);S(a,1*b,1*c,!1);S(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);V(a);b=a.q;D.u(a);return b},BpmnEventTimer:function(a,b,c){a= D.v();var d=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.mb(!1);b=a.q;b.me=ck;D.u(a);return b}},fr;for(fr in sq)sq[fr.toLowerCase()]=fr; var zq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z", DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z", TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; function wq(a){var b=me[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=me[c];if(void 0===b){var d=null,e;for(e in zq)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=xf(zq[d],!1),me[d]=a,c!==d&&(me[c]=d),d}}return"string"===typeof b?b:b instanceof Ue?a:null} function F(a){x.call(this,a);this.S=2408959;this.Sl=this.Ti="";this.ut=this.rt=this.Dt=this.As=null;this.Ft="";this.kh=this.ms=this.Et=this.xn=null;this.tt="";this.Hp=null;this.st=he;this.vt="";this.Ip=null;this.Zd="";this.Bw=this.yr=this.Dl=null;this.mj=(new N(NaN,NaN)).freeze();this.Fs="";this.Vl=null;this.Gs=ec;this.Os=Ud;this.Hs=Vd;this.Ur=null;this.Bs=gr;this.zn=Td;this.yn="gray";this.Og=4;this.SD=-1;this.bu=NaN;this.FH=new C;this.Xl=null;this.Ck=NaN}D.Ta(F,x);D.ka("Part",F); F.prototype.cloneProtected=function(a){x.prototype.cloneProtected.call(this,a);a.S=this.S&-4097|49152;a.Ti=this.Ti;a.Sl=this.Sl;a.As=this.As;a.Dt=this.Dt;a.rt=this.rt;a.ut=this.ut;a.Ft=this.Ft;a.Et=this.Et;a.ms=this.ms;a.kh=null;a.tt=this.tt;a.st=this.st.V();a.vt=this.vt;a.Zd=this.Zd;a.yr=this.yr;a.mj.assign(this.mj);a.Fs=this.Fs;a.Gs=this.Gs.V();a.Os=this.Os.V();a.Hs=this.Hs.V();a.Ur=this.Ur;a.Bs=this.Bs;a.zn=this.zn.V();a.yn=this.yn;a.Og=this.Og;a.bu=this.bu}; F.prototype.Ii=function(a){x.prototype.Ii.call(this,a);a.gl();a.xn=null;a.Hp=null;a.Ip=null;a.Vl=null;a.Xl=null};F.prototype.toString=function(){var a=D.xf(Object.getPrototypeOf(this))+"#"+D.Nd(this);null!==this.data&&(a+="("+ha(this.data)+")");return a};F.LayoutNone=0;var Wm;F.LayoutAdded=Wm=1;var en;F.LayoutRemoved=en=2;F.LayoutShown=4;F.LayoutHidden=8;F.LayoutNodeSized=16;var Ln;F.LayoutGroupLayout=Ln=32;F.LayoutNodeReplaced=64;var gr;F.LayoutStandard=gr=Wm|en|28|Ln|64;F.LayoutAll=16777215; F.prototype.uo=function(a,b,c,d,e,g,h){var k=this.g;null!==k&&(a===gg&&"elements"===b?e instanceof x?Xm(e,function(a){Zm(k,a);Ym(k,a)}):e instanceof Hl&&xn(k,e):a===hg&&"elements"===b&&(e instanceof x?Xm(e,function(a){cn(k,a);bn(k,a)}):e instanceof Hl&&yn(k,e)),k.pd(a,b,c,d,e,g,h))};F.prototype.updateTargetBindings=F.prototype.Rb=function(a){x.prototype.Rb.call(this,a);if(null!==this.data){a=this.xa.o;for(var b=a.length,c=0;ce.x&&a.y>e.y&&a.right e.x&&b.y>e.y&&b.right =c.KJ)){this.S^=4096;var d=!1;if(null!==c){d=c.nb;c.nb=!0;var e=c.selection;e.Xa();a?e.add(this):e.remove(this);e.freeze()}this.i("isSelected",b,a);this.re();a=this.qK;null!==a&&a(this);null!==c&&(c.Le(),c.nb=d)}}}); D.defineProperty(F,{Yg:"isHighlighted"},function(){return 0!==(this.S&524288)},function(a){var b=0!==(this.S&524288);if(b!==a){v&&D.h(a,"boolean",F,"isHighlighted");this.S^=524288;var c=this.g;null!==c&&(c=c.Am,c.Xa(),a?c.add(this):c.remove(this),c.freeze());this.i("isHighlighted",b,a);this.ra();a=this.fJ;null!==a&&a(this)}}); D.defineProperty(F,{il:"isShadowed"},function(){return 0!==(this.S&8192)},function(a){var b=0!==(this.S&8192);b!==a&&(v&&D.h(a,"boolean",F,"isShadowed"),this.S^=8192,this.i("isShadowed",b,a),this.ra())});function Pm(a){return 0!==(a.S&32768)}function jr(a,b){a.S=b?a.S|32768:a.S&-32769}function Ro(a,b){a.S=b?a.S|65536:a.S&-65537}function tl(a){return 0!==(a.S&131072)}F.prototype.Qf=function(a){this.S=a?this.S|131072:this.S&-131073};function sr(a,b){a.S=b?a.S|1048576:a.S&-1048577} D.defineProperty(F,{dG:"isAnimated"},function(){return 0!==(this.S&262144)},function(a){var b=0!==(this.S&262144);b!==a&&(v&&D.h(a,"boolean",F,"isAnimated"),this.S^=262144,this.i("isAnimated",b,a))});D.defineProperty(F,{fJ:"highlightedChanged"},function(){return this.ms},function(a){var b=this.ms;b!==a&&(null!==a&&D.h(a,"function",F,"highlightedChanged"),this.ms=a,this.i("highlightedChanged",b,a))}); D.defineProperty(F,{Vy:"selectionObjectName"},function(){return this.Ft},function(a){var b=this.Ft;b!==a&&(v&&D.h(a,"string",F,"selectionObjectName"),this.Ft=a,this.xn=null,this.i("selectionObjectName",b,a))});D.defineProperty(F,{pK:"selectionAdornmentTemplate"},function(){return this.Dt},function(a){var b=this.Dt;b!==a&&(v&&D.l(a,ca,F,"selectionAdornmentTemplate"),this.Dt=a,this.i("selectionAdornmentTemplate",b,a))}); D.w(F,{Gm:"selectionObject"},function(){if(null===this.xn){var a=this.Vy;null!==a&&""!==a?(a=this.Md(a),this.xn=null!==a?a:this):this instanceof J?(a=this.path,this.xn=null!==a?a:this):this.xn=this}return this.xn});D.defineProperty(F,{qK:"selectionChanged"},function(){return this.Et},function(a){var b=this.Et;b!==a&&(null!==a&&D.h(a,"function",F,"selectionChanged"),this.Et=a,this.i("selectionChanged",b,a))}); D.defineProperty(F,{QG:"resizeAdornmentTemplate"},function(){return this.rt},function(a){var b=this.rt;b!==a&&(v&&D.l(a,ca,F,"resizeAdornmentTemplate"),this.rt=a,this.i("resizeAdornmentTemplate",b,a))});D.defineProperty(F,{SG:"resizeObjectName"},function(){return this.tt},function(a){var b=this.tt;b!==a&&(v&&D.h(a,"string",F,"resizeObjectName"),this.tt=a,this.Hp=null,this.i("resizeObjectName",b,a))}); D.w(F,{RG:"resizeObject"},function(){if(null===this.Hp){var a=this.SG;null!==a&&""!==a?(a=this.Md(a),this.Hp=null!==a?a:this):this.Hp=this}return this.Hp});D.defineProperty(F,{gK:"resizeCellSize"},function(){return this.st},function(a){var b=this.st;b.P(a)||(v&&D.l(a,Ba,F,"resizeCellSize"),this.st=a=a.V(),this.i("resizeCellSize",b,a))}); D.defineProperty(F,{iK:"rotateAdornmentTemplate"},function(){return this.ut},function(a){var b=this.ut;b!==a&&(v&&D.l(a,ca,F,"rotateAdornmentTemplate"),this.ut=a,this.i("rotateAdornmentTemplate",b,a))});D.defineProperty(F,{jK:"rotateObjectName"},function(){return this.vt},function(a){var b=this.vt;b!==a&&(v&&D.h(a,"string",F,"rotateObjectName"),this.vt=a,this.Ip=null,this.i("rotateObjectName",b,a))}); D.w(F,{YB:"rotateObject"},function(){if(null===this.Ip){var a=this.jK;null!==a&&""!==a?(a=this.Md(a),this.Ip=null!==a?a:this):this.Ip=this}return this.Ip});D.defineProperty(F,{text:"text"},function(){return this.Zd},function(a){var b=this.Zd;b!==a&&(v&&D.h(a,"string",F,"text"),this.Zd=a,this.i("text",b,a))}); D.defineProperty(F,{Ka:"containingGroup"},function(){return this.Dl},function(a){if(this.te()){var b=this.Dl;if(b!==a){v&&null!==a&&D.l(a,I,F,"containingGroup");null===a||this!==a&&!a.Ji(this)||(this===a&&D.k("Cannot make a Group a member of itself: "+this.toString()),D.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.L(en);var c=this.g;null!==b?tr(b,this):this instanceof I&&null!==c&&c.em.remove(this);this.Dl=a;null!==a?ur(a,this):this instanceof I&&null!==c&&c.em.add(this);this.L(Wm);if(null!==c){var d=this.data,e=c.ea;null!==d&&e instanceof X&&e.dC(d,e.yb(null!==a?a.data:null))}d=this.kF;null!==d&&(e=!0,null!==c&&(e=c.ab,c.ab=!0),d(this,b,a),null!==c&&(c.ab=e));if(this instanceof I)for(c=new L(F),Qh(c,this,!0,0,!0),c=c.j;c.next();)if(d=c.value,d instanceof G)for(d=d.Od;d.next();)Bn(d.value);if(this instanceof G){for(d=this.Od;d.next();)Bn(d.value);c=this.Zb;null!==c&&Bn(c)}this.i("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&yl(b, -1,a))}}else D.k("cannot set the Part.containingGroup of a Link or Adornment")});f=F.prototype;f.gl=function(){var a=this.Ka;null!==a&&(a.K(),null!==a.Tb&&a.Tb.K(),a.kg())};f.ra=function(){var a=this.g;null!==a&&!Om(this)&&!Pm(this)&&this.isVisible()&&this.cc.H()&&a.ra(xl(this,this.cc))};f.K=function(){x.prototype.K.call(this);var a=this.g;null!==a&&(a.Fg.add(this),this instanceof G&&null!==this.Zb&&ap(this.Zb),a.Le(!0))};f.Iu=function(a){a||(a=this.Dl,null!==a&&ur(a,this))}; f.Ju=function(a){a||(a=this.Dl,null!==a&&tr(a,this))};f.Rn=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ea,null!==b&&b.Py(a))}};D.defineProperty(F,{kF:"containingGroupChanged"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(null!==a&&D.h(a,"function",F,"containingGroupChanged"),this.yr=a,this.i("containingGroupChanged",b,a))});F.prototype.findSubGraphLevel=function(){return vr(this,this)}; function vr(a,b){var c=b.Ka;return null!==c?1+vr(a,c):b instanceof G&&(c=b.Zb,null!==c)?vr(a,c):0}F.prototype.findTopLevelPart=function(){return wr(this,this)};function wr(a,b){var c=b.Ka;return null!==c?wr(a,c):b instanceof G&&(c=b.Zb,null!==c)?wr(a,c):b}D.w(F,{Cq:"isTopLevel"},function(){return null!==this.Ka||this instanceof G&&null!==this.Zb?!1:!0});F.prototype.isMemberOf=F.prototype.Ji=function(a){return a instanceof I?xr(this,this,a):!1}; function xr(a,b,c){if(b===c||null===c)return!1;var d=b.Ka;return null===d||d!==c&&!xr(a,d,c)?b instanceof G&&(b=b.Zb,null!==b)?xr(a,b,c):!1:!0} F.prototype.findCommonContainingGroup=F.prototype.MI=function(a){if(null===a)return null;v&&D.l(a,F,F,"findCommonContainingGroup:other");if(this===a)return this.Ka;for(var b=this;null!==b;){b instanceof I&&sr(b,!0);if(b instanceof G){var c=b.Zb;null!==c&&(b=c)}b=b.Ka}for(var d=null,b=a;null!==b;){if(0!==(b.S&1048576)){d=b;break}b instanceof G&&(c=b.Zb,null!==c&&(b=c));b=b.Ka}for(b=this;null!==b;)b instanceof I&&sr(b,!1),b instanceof G&&(c=b.Zb,null!==c&&(b=c)),b=b.Ka;return d}; D.defineProperty(F,{AJ:"layoutConditions"},function(){return this.Bs},function(a){var b=this.Bs;b!==a&&(v&&D.h(a,"number",F,"layoutConditions"),this.Bs=a,this.i("layoutConditions",b,a))});F.prototype.canLayout=function(){if(!this.zB||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.$c||this instanceof G&&this.Mf?!1:!0}; F.prototype.invalidateLayout=F.prototype.L=function(a){void 0===a&&(a=16777215);var b;this.zB&&0!==(a&this.AJ)?(b=this.layer,null!==b&&b.$c||this instanceof G&&this.Mf?b=!1:(b=this.g,b=null!==b&&b.na.ub?!1:!0)):b=!1;if(b)if(b=this.Dl,null!==b){var c=b.$b;null!==c?c.L():b.L(a)}else a=this.g,null!==a&&(c=a.$b,null!==c&&c.L())};function an(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.$c?!1:!0} D.defineProperty(F,{Ux:"dragComputation"},function(){return this.Ur},function(a){var b=this.Ur;b!==a&&(null!==a&&D.h(a,"function",F,"dragComputation"),this.Ur=a,this.i("dragComputation",b,a))});D.defineProperty(F,{uK:"shadowOffset"},function(){return this.zn},function(a){var b=this.zn;b.P(a)||(v&&D.l(a,N,F,"shadowOffset"),this.zn=a=a.V(),this.ra(),this.i("shadowOffset",b,a))}); D.defineProperty(F,{shadowColor:"shadowColor"},function(){return this.yn},function(a){var b=this.yn;b!==a&&(v&&D.h(a,"string",F,"shadowColor"),this.yn=a,this.ra(),this.i("shadowColor",b,a))});D.defineProperty(F,{shadowBlur:"shadowBlur"},function(){return this.Og},function(a){var b=this.Og;b!==a&&(v&&D.h(a,"number",F,"shadowBlur"),this.Og=a,this.ra(),this.i("shadowBlur",b,a))}); function ca(a){0===arguments.length?F.call(this,ek):F.call(this,a);this.S&=-257;this.Sl="Adornment";this.Tc=null;this.bE=0;this.OE=!1;this.Tb=this.nh=null}D.Ta(ca,F);D.ka("Adornment",ca);ca.prototype.toString=function(){var a=this.gf;return"Adornment("+this.Kd+")"+(null!==a?a.toString():"")};ca.prototype.updateRelationshipsFromData=function(){}; ca.prototype.Yu=function(a){var b=this.Cb.$,c=this.Cb;if(b instanceof J&&c instanceof z){var d=b.path,c=d.wf;b.Yu(a);c=d.wf;a=this.xa.o;b=a.length;for(d=0;da&&(a=1);var b=this.g;if(null!==b&&!b.Ph){b.Ph=!0;var c=new L(G);c.add(this);Kr(this,c,b.fe,a,b.Ra,this,b.uC===El);b.Ph=!1}}; function Kr(a,b,c,d,e,g,h){if(1 a&&(a=2);var b=this.g;if(null!==b&&!b.Ph){b.Ph=!0;var c=new L(G);c.add(this);Mr(this,c,b.fe,a,b.Ra,this,b.uC===El);b.Ph=!1}};function Mr(a,b,c,d,e,g,h){for(var k=g===a?!1:a.Dc,l=c?a.ay():a.Xg();l.next();){var m=l.value;m.jc&&(k||m.Uf||m.ec(),m=m.kB(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.Pd(!0),m.gl(),h&&pl(e,m,g)),2 c&&(c-=180);break;case $p:c=Qe(b+90);90 c&&(c-=180);break;case bq:c=Qe(b-90);90 c&&(c-=180);break;case cq:c=Qe(b);if(45 c||225 c)return 0;90 c&&(c-=180)}return Qe(c)}; D.defineProperty(J,{Z:"fromNode"},function(){return this.Bg},function(a){var b=this.Bg;if(b!==a){v&&null!==a&&D.l(a,G,J,"fromNode");var c=this.oc;null!==b&&(this.Sg!==b&&Gr(b,this,c),Ur(this),this.L(en));this.Bg=a;null!==a&&this.Pd(a.isVisible());this.dj=null;this.ec();var d=this.g;if(null!==d){var e=this.data,g=d.ea;if(null!==e)if(g instanceof X){var h=null!==a?a.data:null;g.bC(e,g.yb(h))}else g instanceof Ag&&(h=null!==a?a.data:null,d.fe?g.Li(e,g.yb(h)):(null!==b&&g.Li(b.data,void 0),g.Li(h,g.yb(null!== this.Sg?this.Sg.data:null))))}e=this.oc;g=this.MF;null!==g&&(h=!0,null!==d&&(h=d.ab,d.ab=!0),g(this,c,e),null!==d&&(d.ab=h));null!==a&&(this.Sg!==a&&Fr(a,this,e),Vr(this),this.L(Wm));this.i("fromNode",b,a);Bn(this)}}); D.defineProperty(J,{hg:"fromPortId"},function(){return this.ji},function(a){var b=this.ji;if(b!==a){v&&D.h(a,"string",J,"fromPortId");var c=this.Z,d=this.oc;null!==d&&Er(c,d);Ur(this);this.ji=a;var e=this.oc;null!==e&&Er(c,e);c=this.g;if(null!==c){var g=this.data,h=c.ea;null!==g&&h instanceof X&&h.cC(g,a)}d!==e&&(this.dj=null,this.ec(),g=this.MF,null!==g&&(h=!0,null!==c&&(h=c.ab,c.ab=!0),g(this,d,e),null!==c&&(c.ab=h)));Vr(this);this.i("fromPortId",b,a)}}); D.w(J,{oc:"fromPort"},function(){var a=this.Bg;return null===a?null:a.fB(this.ji)});D.defineProperty(J,{MF:"fromPortChanged"},function(){return this.ds},function(a){var b=this.ds;b!==a&&(null!==a&&D.h(a,"function",J,"fromPortChanged"),this.ds=a,this.i("fromPortChanged",b,a))}); D.defineProperty(J,{ba:"toNode"},function(){return this.Sg},function(a){var b=this.Sg;if(b!==a){v&&null!==a&&D.l(a,G,J,"toNode");var c=this.Gc;null!==b&&(this.Bg!==b&&Gr(b,this,c),Ur(this),this.L(en));this.Sg=a;null!==a&&this.Pd(a.isVisible());this.dj=null;this.ec();var d=this.g;if(null!==d){var e=this.data,g=d.ea;if(null!==e)if(g instanceof X){var h=null!==a?a.data:null;g.hC(e,g.yb(h))}else g instanceof Ag&&(h=null!==a?a.data:null,d.fe?(null!==b&&g.Li(b.data,void 0),g.Li(h,g.yb(null!==this.Bg?this.Bg.data: null))):g.Li(e,g.yb(h)))}e=this.Gc;g=this.pH;null!==g&&(h=!0,null!==d&&(h=d.ab,d.ab=!0),g(this,c,e),null!==d&&(d.ab=h));null!==a&&(this.Bg!==a&&Fr(a,this,e),Vr(this),this.L(Wm));this.i("toNode",b,a);Bn(this)}}); D.defineProperty(J,{ih:"toPortId"},function(){return this.Di},function(a){var b=this.Di;if(b!==a){v&&D.h(a,"string",J,"toPortId");var c=this.ba,d=this.Gc;null!==d&&Er(c,d);Ur(this);this.Di=a;var e=this.Gc;null!==e&&Er(c,e);c=this.g;if(null!==c){var g=this.data,h=c.ea;null!==g&&h instanceof X&&h.iC(g,a)}d!==e&&(this.dj=null,this.ec(),g=this.pH,null!==g&&(h=!0,null!==c&&(h=c.ab,c.ab=!0),g(this,d,e),null!==c&&(c.ab=h)));Vr(this);this.i("toPortId",b,a)}}); D.w(J,{Gc:"toPort"},function(){var a=this.Sg;return null===a?null:a.fB(this.Di)});D.defineProperty(J,{pH:"toPortChanged"},function(){return this.Xt},function(a){var b=this.Xt;b!==a&&(null!==a&&D.h(a,"function",J,"toPortChanged"),this.Xt=a,this.i("toPortChanged",b,a))});D.defineProperty(J,{Ib:"fromSpot"},function(){return null!==this.aa?this.aa.rk:Vc},function(a){this.be();var b=this.aa.rk;b.P(a)||(v&&D.l(a,R,J,"fromSpot"),a=a.V(),this.aa.rk=a,this.i("fromSpot",b,a),this.ec())}); D.defineProperty(J,{wm:"fromEndSegmentLength"},function(){return null!==this.aa?this.aa.pk:NaN},function(a){this.be();var b=this.aa.pk;b!==a&&(v&&D.h(a,"number",J,"fromEndSegmentLength"),0>a&&D.ua(a,">= 0",J,"fromEndSegmentLength"),this.aa.pk=a,this.i("fromEndSegmentLength",b,a),this.ec())}); D.defineProperty(J,{Cu:"fromEndSegmentDirection"},function(){return null!==this.aa?this.aa.ok:zr},function(a){this.be();var b=this.aa.ok;b!==a&&(D.Sn("Link.fromEndSegmentDirection","2.0"),v&&D.Da(a,G,J,"fromEndSegmentDirection"),this.aa.ok=a,this.i("fromEndSegmentDirection",b,a),this.ec())}); D.defineProperty(J,{Du:"fromShortLength"},function(){return null!==this.aa?this.aa.qk:NaN},function(a){this.be();var b=this.aa.qk;b!==a&&(v&&D.h(a,"number",J,"fromShortLength"),this.aa.qk=a,this.i("fromShortLength",b,a),this.ec(),this.se())});D.defineProperty(J,{Jb:"toSpot"},function(){return null!==this.aa?this.aa.Pk:Vc},function(a){this.be();var b=this.aa.Pk;b.P(a)||(v&&D.l(a,R,J,"toSpot"),a=a.V(),this.aa.Pk=a,this.i("toSpot",b,a),this.ec())}); D.defineProperty(J,{Nm:"toEndSegmentLength"},function(){return null!==this.aa?this.aa.Nk:NaN},function(a){this.be();var b=this.aa.Nk;b!==a&&(v&&D.h(a,"number",J,"toEndSegmentLength"),0>a&&D.ua(a,">= 0",J,"toEndSegmentLength"),this.aa.Nk=a,this.i("toEndSegmentLength",b,a),this.ec())}); D.defineProperty(J,{wv:"toEndSegmentDirection"},function(){return null!==this.aa?this.aa.Mk:zr},function(a){this.be();var b=this.aa.Mk;b!==a&&(D.Sn("Link.toEndSegmentDirection","2.0"),v&&D.Da(a,G,J,"toEndSegmentDirection"),this.aa.Mk=a,this.i("toEndSegmentDirection",b,a),this.ec())}); D.defineProperty(J,{xv:"toShortLength"},function(){return null!==this.aa?this.aa.Ok:NaN},function(a){this.be();var b=this.aa.Ok;b!==a&&(v&&D.h(a,"number",J,"toShortLength"),this.aa.Ok=a,this.i("toShortLength",b,a),this.ec(),this.se())}); function Bn(a){var b=a.Z,c=a.ba,d=null,b=d=null!==b?null!==c?b.MI(c):b.Ka:null!==c?c.Ka:null,c=a.Dl;if(c!==b){null!==c&&tr(c,a);a.Dl=b;null!==b&&ur(b,a);var e=a.kF;if(null!==e){var g=!0,h=a.g;null!==h&&(g=h.ab,h.ab=!0);e(a,c,b);null!==h&&(h.ab=g)}!a.Uf||a.AE!==c&&a.BE!==c||a.ec()}if(a.pJ)for(a=a.Bf;a.next();)a.value.Ka=d}J.prototype.gl=function(){var a=this.Ka;null!==a&&this.Z!==a&&this.ba!==a&&a.Lx&&F.prototype.gl.call(this)}; J.prototype.getOtherNode=J.prototype.kB=function(a){v&&D.l(a,G,J,"getOtherNode:node");var b=this.Z;return a===b?this.ba:b};J.prototype.getOtherPort=function(a){v&&D.l(a,O,J,"getOtherPort:port");var b=this.oc;return a===b?this.Gc:b};D.w(J,{pJ:"isLabeledLink"},function(){return null===this.If?!1:0 =d&&(h=d-1);var l=this.m(h-1),g=this.m(h);re(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.n(e.x,e.y,0,0),a.Qi(g),h=2;h c&&(c=-c)):Eb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Lf(d)),g.push(c),e+=c;for(d=h=c=0;c e/2)break;c+=d;h++}D.ya(g);b=this.m(h);g=this.m(h+1);b.x===g.x?b.y>g.y?a.n(b.x,b.y-(e/2-c)):a.n(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.n(b.x-(e/2-c),b.y):a.n(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.n(b.x+c*(g.x-b.x),b.y+c*(g.y-b.y)));return a};D.w(J,{wG:"midAngle"},function(){this.Co();return this.computeMidAngle()}); J.prototype.computeMidAngle=function(){var a=this.ta;if(2>a)return NaN;if(this.computeCurve()===Vj&&4<=a&&!this.ic){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.m(c),d=this.m(c+1),a=this.m(c+2),c=this.m(c+3),e=d.x,d=d.y,g=a.x,a=a.y,h=(e+g)/2,k=(d+a)/2;return wb(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(g+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0 e+10?b.Yb(d):e>c+10?d.Yb(a):b.Yb(a)):null===this.Za||this.ic?b.Yb(d):this.Za.NF(.5);if(null!==this.Za&&!this.ic)return this.Za.NF(.5);b=this.m(c-1);d=this.m(c);a=this.m(c+1);c=b.Lf(d);e=d.Lf(a);return c>e+10?b.Yb(d):e>c+10?d.Yb(a):b.Yb(a)}; D.defineProperty(J,{points:"points"},function(){return this.jd},function(a){var b=this.jd;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;e m&&(p=-p),u=(0> l?-1:1)*p+r,t=n*(u-r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,y=r,w=s;bb(l,0)?w=0 l?-1:1)*p+r,w=n*(y-r)+s);this.fq();this.Fi(h);this.Ej(u,t);this.Ej(y,w);this.Fi(q);this.fh(0,this.getLinkPoint(b,c,d,!0,!1,e,g));this.fh(3,this.getLinkPoint(e,g,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,g),a=this.getLinkPoint(e,g,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,g=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,bb(e,0)?k=0 g&&(h= -h),h=(0>e?-1:1)*h+b,k=q*(h-b)+c),this.Fi(d),this.Ej(h,k)):this.Fi(d),this.Fi(a)}else{p=this.Pj;q&&(n&&p||m)&&this.fq();var A=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,g),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,g),m&&(k||d.P(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>A&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(A)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180), u=t*Math.sin(r*Math.PI/180)),d.ee()&&m){var B=c.gb(mc,D.O()),P=D.Fb(B.x+1E3*s,B.y+1E3*u);this.getLinkPointFromPoint(b,c,B,P,!0,p);D.A(B);D.A(P)}var t=this.getLinkPoint(e,g,a,!1,n,b,c),H=w=y=0;if(n||!l||m)B=this.computeEndSegmentLength(e,g,a,!1),H=this.getLinkDirection(e,g,t,a,!1,n,b,c),m&&(l||d.P(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(H+=n?0:30,0>A&&(H+=180)),0>H?H+=360:360<=H&&(H-=360),m&&(B+=Math.abs(A)*(n?1:2)),0===H?y=B:90===H?w=B:180===H?y=-B:270===H?w=-B:(y=B*Math.cos(H*Math.PI/180),w=B*Math.sin(H* Math.PI/180)),a.ee()&&m&&(B=g.gb(mc,D.O()),P=D.Fb(B.x+1E3*y,B.y+1E3*w),this.getLinkPointFromPoint(e,g,B,P,!1,t),D.A(B),D.A(P));a=p;if(n||!k||m)a=new N(p.x+s,p.y+u);d=t;if(n||!l||m)d=new N(t.x+y,t.y+w);!q&&!n&&k&&3Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b} J.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new N);if(null===a||null===b)return g.assign(c),g;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.Q;null===e||e.jh()||(e=e.Q);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.Hh;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Xn(e,h,k,l, g);null!==a&&g.transform(a);return g};function $r(a,b){var c=b.mt;null===c&&(c=new as,c.port=b,c.ad=b.$,b.mt=c);return bs(c,a)} J.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new N);if(c.Zc())return b.gb(c,k),k;if(c.Rj()){var l=$r(this,b);if(null!==l){k.assign(l.Fq);if(e&&this.Ry===Rr){var m=$r(this,h);if(null!==m&&l.Pn =n.y&&a.y<=n.y+n.height?k.y=a.y:(c.Oj(wc)||c.Oj(Dc))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);D.A(l);D.A(m)}}return k}}c=b.gb(mc,D.O());l=g=null; this.ta>(e?6:2)?(l=d?this.m(1):this.m(this.ta-2),e&&(l=Zr(c,l.copy()))):(g=D.O(),l=h.gb(mc,g),e&&(l=Zr(c,l)),D.A(g));this.getLinkPointFromPoint(a,b,c,l,d,k);D.A(c);return k}; J.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.Zc())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x 1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5 (g?6:2)?(n=e?this.m(1):this.m(this.ta-2),n=g?Zr(l,n.copy()):c):(m=D.O(),n=k.gb(mc,m),D.A(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y- l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;D.A(l)}d.ee()&&h.Ji(a)&&(c+=180,360<=c&&(c-=360));a=zr;a=e?this.Cu:this.wv;a===zr&&(a=e?b.Cu:b.wv);switch(a){case Ar:b=b.xm();c+=b;360<=c&&(c-=360);break;case zr:case Ho:if(d.sJ())break;b=b.xm();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c}; J.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Rj()&&(a=$r(this,b),null!==a))return a.Xx;a=NaN;a=d?this.wm:this.Nm;null!==b&&isNaN(a)&&(a=d?b.wm:b.Nm);isNaN(a)&&(a=10);return a};J.prototype.computeSpot=function(a,b){var c;if(a)if(c=b?b:this.oc,null===c)c=mc;else{var d=this.Ib;d.md()&&null!==c&&(d=c.Ib);c=d===Vc?dc:d}else c=b?b:this.Gc,null===c?c=mc:(d=this.Jb,d.md()&&null!==c&&(d=c.Jb),c=d===Vc?dc:d);return c}; J.prototype.computeOtherPoint=function(a,b){var c=b.gb(mc),d;d=b.mt;d=null!==d?bs(d,this):null;null!==d&&(c=d.Fq);return c};J.prototype.computeShortLength=function(a){if(a){if(a=this.Du,isNaN(a)){var b=this.oc;null!==b&&(a=b.Du)}}else a=this.xv,isNaN(a)&&(b=this.Gc,null!==b&&(a=b.xv));return isNaN(a)?0:a}; J.prototype.Zk=function(a,b,c,d,e,g){if(!1===this.sg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=D.gh(),h.reset());h.multiply(this.transform);if(this.Mn(a,h))return iq(this,b,c,e),void 0===g&&D.lf(h),!0;if(this.jg(a,h)){var k=!1;if(!this.bo)for(var l=this.xa.o,m=l.length;m--;){var n=l[m];if(n.visible||n===this.Cf){var p=n.Y,q=this.Fa;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=D.gh();p.set(h);if(n instanceof x)k=n.Zk(a,b,c,d,e,p);else if(this.path=== n){if(n instanceof z){var k=n,r=a,s=d,q=p;if(!1===k.sg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.Mn(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.Vk(k.Y))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,y=D.O(),w=D.O(),A=D.O(),B=D.gh();B.set(t);B.LB(k.transform);B.uB();w.x=r;w.y=s;w.transform(B);y.x=q;y.y=s;y.transform(B);t=!1;vq(k,y,w,A)?t=!0:(y.x=r,y.y=u,y.transform(B),vq(k,y,w,A)?t=!0:(w.x=q,w.y=u,w.transform(B),vq(k,y,w,A)?t=!0:(y.x=q,y.y=s,y.transform(B),vq(k,y,w,A)&& (t=!0))));D.lf(B);D.A(y);D.A(w);D.A(A);k=t}}else k=k.Mn(r,q)}}else k=No(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof L&&e.add(n),e instanceof K&&e.add(n)));D.lf(p)}}}void 0===g&&D.lf(h);return k||null!==this.background||null!==this.lm}void 0===g&&D.lf(h);return!1};D.w(J,{ic:"isOrthogonal"},function(){return 2===(this.sn.value&2)});D.w(J,{Pj:"isAvoiding"},function(){return 4===(this.sn.value&4)}); J.prototype.computeCurve=function(){if(null===this.dj){var a=this.oc,b=this.ic;this.dj=null!==a&&a===this.Gc&&!b}return this.dj?Vj:this.vf};J.prototype.computeCorner=function(){if(this.vf===Vj)return 0;var a=this.XA;if(isNaN(a)||0>a)a=10;return a};J.prototype.findMidLabel=function(){for(var a=this.path,b=this.xa.o,c=b.length,d=0;d l?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Eb(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.fh(a,b);for(a+= 1;a l?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ia(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.fh(c,d)}}return!0;case Qr:g=this.m(a);p=this.m(c);if(!g.Yc(b)||!p.Yc(d)){var e=g.x,g=g.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-g)*(p-g),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.fh(a,b);for(a+=1;a b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.Y.copy(),k=g.Y.copy();if(h.H()&&k.H()){h.ig(8,8);k.ig(8,8);h.Qi(a);k.Qi(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.y a.x||90===d&&c.y>a.y&&k.right>a.x)l=new N(c.x,a.y),m=new N(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y a.y?(l.x=a.x k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.x k.top&&a.y