Z*J*v/t.graduatedRange)){var Q=m[0][0],tt=0,et=0;X=v*W.graduatedStart-1e-4,U=v*W.graduatedEnd+1e-4;var it=Z*J,nt=t.graduatedTickBase;if(ntt.graduatedMin+it&&(nt-=Math.floor((nt-t.graduatedMin)/it)*it);for(var rt=H[$];nt<=t.graduatedMax;){t:{for(var st=rt.length,at=0;at v&&(G=v),X<=G&&G<=U)){for(var ht=x[tt][et],ut=m[tt][et];tt Q&&et pt?0 qt;qt++){switch(qt){case 0:At.h(Bt,zt);break;case 1:At.h(Bt+Ot,zt);break;case 2:At.h(Bt,zt+Dt);break;case 3:At.h(Bt+Ot,zt+Dt)}At.rotate(Yt+Mt.angle),At.offset(Vt,Ht),0===Et&&0===qt?Ft.h(At.x,At.y,0,0):Ft.Ie(At),At.offset(-Vt,-Ht),At.rotate(-Yt-Mt.angle)}mt.free(At),St.hj.push(Ft),$t(Nt,Ft.x,Ft.y,Ft.width,Ft.height)}else if(Mt instanceof mh){var Gt=t,Xt=o;null===Gt.kh&&(Gt.kh=new mh);var Ut=Gt.kh;vh(Ut,Mt);var Kt=Mt.alignmentFocus;Kt.jc()&&(Kt=ue);for(var Wt=Mt.segmentOrientation,Jt=Mt.segmentOffset,Zt=null,Qt=0,te=0,ee=0,ie=0,ne=Ct.length,oe=0;oe ee||225 ee)&&fe.rotate(-ee,he/2,ce/2);var de=_t.allocAt(0,0,he,ce),pe=mt.alloc();pe.Ti(de,Kt),fe.ta(pe);var ge=-pe.x,me=-pe.y,ve=mt.alloc();ve.assign(Jt),isNaN(ve.x)&&(ve.x=he/2+3),isNaN(ve.y)&&(ve.y=-(ce/2+3)),ve.rotate(ee),Qt+=ve.x+ge,te+=ve.y+me;var ye=new _t(Qt,te,se.width,se.height),be=new _t(se.x,se.y,se.width,se.height),we=new _t(le.x,le.y,le.width,le.height),xe=new Hh;xe.Vl(Ut.metrics),re.push(ie),re.push(Ut.lineCount),re.push(xe),re.push(ye),re.push(be),re.push(we),0===oe?Zt=ye.copy():Zt.Jc(ye),mt.free(ve),mt.free(pe),_t.free(de),ae.free(fe)}Gt.hj.push(Zt),$t(Xt,Zt.x,Zt.y,Zt.width,Zt.height)}ga(Mt,!1)}}},Sl.prototype.arrange=function(t,e,i){if(null!==t.hj){var n=t.zb(),o=t.jj,r=t.hj,s=0,a=r[s];s++,n.arrange(a.x-i.x,a.y-i.y,a.width,a.height);for(var l=e.length,h=0;h =e&&(e=1);var i=this.gridCellSize,n=i.width;i=i.height;var o=this.naturalBounds,r=this.actualBounds,s=o.width,a=o.height,l=Math.ceil(s/n),h=Math.ceil(a/i),u=this.gridOrigin;t.save(),t.beginPath(),t.rect(0,0,s,a),t.clip();for(var c=[],f=this.Y.j,d=f.length,p=0;p n*m*e))){if(g=b.opacity,v=1,1!==g){if(0===g)continue;v=t.globalAlpha,t.globalAlpha=v*g}y=c[p];var w=!1,x=b.strokeDashArray;if(null!==x&&(w=!0,t.Ps(x,b.strokeDashOffset)),\"LineV\"===b.figure&&null!==b.stroke){for(t.lineWidth=b.strokeWidth,ia(this,t,b.stroke,!1,!1,o,r),t.beginPath(),x=b=Math.floor(-u.x/n);x<=b+l;x++){var k=x*n+u.x;0<=k&&k<=s&&Ol(x,m,y)&&(t.moveTo(k,0),t.lineTo(k,a))}t.stroke()}else if(\"LineH\"===b.figure&&null!==b.stroke){for(t.lineWidth=b.strokeWidth,ia(this,t,b.stroke,!1,!1,o,r),t.beginPath(),x=b=Math.floor(-u.y/i);x<=b+h;x++)k=x*i+u.y,0<=k&&k<=a&&Ol(x,m,y)&&(t.moveTo(0,k),t.lineTo(s,k));t.stroke()}else if(\"BarV\"===b.figure&&null!==b.fill)for(ia(this,t,b.fill,!0,!1,o,r),b=b.width,isNaN(b)&&(b=n),k=x=Math.floor(-u.x/n);k<=x+l;k++){var M=k*n+u.x;0<=M&&M<=s&&Ol(k,m,y)&&t.fillRect(M,0,b,a)}else if(\"BarH\"===b.figure&&null!==b.fill)for(ia(this,t,b.fill,!0,!1,o,r),b=b.height,isNaN(b)&&(b=i),k=x=Math.floor(-u.y/i);k<=x+h;k++)M=k*i+u.y,0<=M&&M<=a&&Ol(k,m,y)&&t.fillRect(0,M,s,b);w&&t.Ns(),1!==g&&(t.globalAlpha=v)}}t.restore(),t.Rc(!1)}else if(this.va===Nl.Graduated){for(n=e.mj,e.mj=!0,o=this.naturalBounds,i=o.width,o=o.height,t.save(),t.beginPath(),t.rect(-1,-1,i+1,o+1),t.clip(),i=this.zb(),i.hc(t,e),o=this.Ce()*e.scale,0>=o&&(o=1),r=i.actualBounds,s=this.Y.j,a=this.jj,l=s.length,h=0;h this.graduatedTickUnit*f.interval*o))for(d=f.measuredBounds,p=f.strokeWidth*f.scale,m=f.alignmentFocus,m.jc()&&(m=ue),g=0;g n&&o.set(p),mt.free(p)),mt.free(u),r&&o.transform(s),h},i.s=function(t){Ks.prototype.s.call(this,t),t=null,this.va!==Nl.Auto&&this.va!==Nl.Link||(t=this.zb());for(var e=this.Y.j,i=e.length,n=0;ni||r>n)&&(this.s(),this.measure(e>i?i:e,r>n?n:r,0,0));break;case Qr:this.s(!0),this.measure(i+a,n+s,0,0);break;case ns:this.s(!0),this.measure(i+a,r+s,0,0);break;case os:this.s(!0),this.measure(e+a,n+s,0,0)}}this.va.arrange(this,o,this.hg)}},i.vh=function(t){var e=this.naturalBounds,i=jl(this);if(Wt(0,0,e.width,e.height,t.x,t.y)){e=this.Y.j;for(var n=e.length,o=mt.allocAt(0,0);n--;){var r=e[n];if((r.visible||r===i)&&(wt(o.set(t),r.transform),r.ea(o)))return mt.free(o),!0}return mt.free(o),null!==this.ib||null!==this.dc}return!1},i.Qs=function(t){if(this.Dk===t)return this;for(var e=this.Y.j,i=e.length,n=0;nf.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height||(c=u,u=u instanceof Nl?u:null,f=ae.alloc(),f.set(s),(null!==u?u.mg(t,e,i,n,o,f):Qs(c,t,n,f))&&(null!==e&&(c=e(c)),null===c||null!==i&&!i(c)||o.add(c)),ae.free(f))}}return void 0===r&&ae.free(s),n}return void 0===r&&ae.free(s),!1},i.ng=function(t,e,i,n,o,r){if(!1===this.pickable)return!1;void 0===i&&(i=null),void 0===n&&(n=null);var s=this.naturalBounds,a=this.Zd(),l=a?t:wt(mt.allocAt(t.x,t.y),this.transform),h=a?e:wt(mt.allocAt(e.x,e.y),this.transform),u=l.Be(h),c=0 m.width||g.y>m.height||0>g.x+g.width||0>g.y+g.height)||(p.Zd()?(g=p.transform,wt(l.set(t),g),wt(h.set(e),g)):(l.set(t),h.set(e)),g=p,p=p instanceof Nl?p:null,(null!==p?p.ng(l,h,i,n,o,r):g.jx(l,h,o))&&(null!==i&&(g=i(g)),null===g||null!==n&&!n(g)||r.add(g)))}}mt.free(l),mt.free(h)}return o?c:s}return!1},i.add=function(t){this.Ib(this.Y.count,t)},i.N=function(t){return this.Y.N(t)},i.Ib=function(t,e){e instanceof lu&&k(\"Cannot add a Part to a Panel: \"+e+\"; use a Panel instead\"),(this===e||this.qg(e))&&(this===e&&k(\"Cannot make a Panel contain itself: \"+this.toString()),k(\"Cannot make a Panel indirectly contain itself: \"+this.toString()+\" already contains \"+e.toString()));var i=e.panel;if(null!==i&&i!==this&&k(\"Cannot add a GraphObject that already belongs to another Panel to this Panel: \"+e.toString()+\", already contained by \"+i.toString()+\", cannot be shared by this Panel: \"+this.toString()),this.va!==Nl.Grid||e instanceof sh||k(\"Can only add Shapes to a Grid Panel, not: \"+e),this.va!==Nl.Graduated||e instanceof sh||e instanceof mh||k(\"Can only add Shapes or TextBlocks to a Graduated Panel, not: \"+e),e.Si(this),e.Aj=null,null!==this.itemArray){var o=e.data;null!==o&&\"object\"===n(o)&&(null===this.Ed&&(this.Ed=new gt),this.Ed.add(o,e))}var r=this.Y;if(o=-1,i===this){for(var s=-1,a=this.Y.j,l=a.length,h=0;h =r.count&&t>=r.count)return;r.mb(s),o=s}else k(\"element \"+e.toString()+\" has panel \"+i.toString()+\" but is not contained by it.\")}(0>t||t>r.count)&&(t=r.count),r.Ib(t,e),(0===t||e.isPanelMain)&&(this.ti=null),pa(this)||this.s(),e.s(!1),(null!==e.portId||e instanceof Nl&&!0===e.xh)&&(this.xh=!0),this.Mg=null,i=this.part,null!==i&&(i.vj=null,i.Ug=NaN,this.xh&&i instanceof Au&&(i.xh=!0),i.xh&&i instanceof Au&&(i.rc=null),r=this.diagram,null!==r&&r.undoManager.isUndoingRedoing||(-1!==o&&i.ab(Pi,\"elements\",this,e,null,o,null),i.ab(Ni,\"elements\",this,null,e,null,t),this.rg()||Wl(this,e,!1)))},i.remove=function(t){for(var e=this.Y.j,i=e.length,n=-1,o=0;ot&&C(t,\">= 0\",Nl,\"getRowDefinition:idx\"),t=Math.round(t);var e=this.sb;if(void 0===e)return null;if(void 0===e[t]){var i=new eh;i.Si(this),i.isRow=!0,i.index=t,e[t]=i}return e[t]},Nl.prototype.Av=function(t){0>t&&C(t,\">= 0\",Nl,\"removeRowDefinition:idx\"),t=Math.round(t);var e=this.sb;void 0!==e&&(this.ab(Pi,\"coldefs\",this,e[t],null,t,null),e[t]&&delete e[t],this.s())},Nl.prototype.getColumnDefinition=function(t){0>t&&C(t,\">= 0\",Nl,\"getColumnDefinition:idx\"),t=Math.round(t);var e=this.nb;if(void 0===e)return null;if(void 0===e[t]){var i=new eh;i.Si(this),i.isRow=!1,i.index=t,e[t]=i}return e[t]},i=Nl.prototype,i.yv=function(t){0>t&&C(t,\">= 0\",Nl,\"removeColumnDefinition:idx\"),t=Math.round(t);var e=this.nb;void 0!==e&&(this.ab(Pi,\"coldefs\",this,e[t],null,t,null),e[t]&&delete e[t],this.s())},i.Ry=function(t){if(0>t||this.type!==Nl.Table)return-1;for(var e=0,i=this.sb,n=i.length,o=this.wi;o t||this.type!==Nl.Table)return-1;for(var e=0,i=this.nb,n=i.length,o=this.gi;o t;)this.xc(this.Y.length-1,!1);if(t=this.itemArray,null!==t)for(var e=t.length,i=0;i t&&C(t,\">= 0\",Nl,\"padding\"),t=new ee(t)):(0>t.left&&C(t.left,\">= 0\",Nl,\"padding:value.left\"),0>t.right&&C(t.right,\">= 0\",Nl,\"padding:value.right\"),0>t.top&&C(t.top,\">= 0\",Nl,\"padding:value.top\"),0>t.bottom&&C(t.bottom,\">= 0\",Nl,\"padding:value.bottom\"));var e=this.eb;e.A(t)||(this.eb=t=t.I(),this.s(),this.g(\"padding\",e,t))}},defaultAlignment:{get:function(){return this.nn},set:function(t){var e=this.nn;e.A(t)||(this.nn=t=t.I(),this.s(),this.g(\"defaultAlignment\",e,t))}},defaultStretch:{get:function(){return this.Df},set:function(t){var e=this.Df;e!==t&&(this.Df=t,this.s(),this.g(\"defaultStretch\",e,t))}},defaultSeparatorPadding:{get:function(){return void 0===this.dj?oe:this.dj},set:function(t){if(void 0!==this.dj){\"number\"===typeof t&&(t=new ee(t));var e=this.dj;e.A(t)||(this.dj=t=t.I(),this.s(),this.g(\"defaultSeparatorPadding\",e,t))}}},defaultRowSeparatorStroke:{get:function(){return void 0===this.Vh?null:this.Vh},set:function(t){var e=this.Vh;e!==t&&(null===t||\"string\"===typeof t||t instanceof Ra)&&(t instanceof Ra&&t.freeze(),this.Vh=t,this.R(),this.g(\"defaultRowSeparatorStroke\",e,t))}},defaultRowSeparatorStrokeWidth:{get:function(){return void 0===this.Gg?1:this.Gg},set:function(t){if(void 0!==this.Gg){var e=this.Gg;e!==t&&isFinite(t)&&0<=t&&(this.Gg=t,this.s(),this.g(\"defaultRowSeparatorStrokeWidth\",e,t))}}},defaultRowSeparatorDashArray:{get:function(){return void 0===this.Uh?null:this.Uh},set:function(t){if(void 0!==this.Uh){var e=this.Uh;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;ot)&&k(\"Panel.topIndex must be greater than zero and a real number, not: \"+t),this.wi=t,this.s(),this.g(\"topIndex\",e,t))}}},leftIndex:{get:function(){return void 0===this.gi?0:this.gi},set:function(t){if(void 0!==this.gi){var e=this.gi;e!==t&&((!isFinite(t)||0>t)&&k(\"Panel.leftIndex must be greater than zero and a real number, not: \"+t),this.gi=t,this.s(),this.g(\"leftIndex\",e,t))}}},data:{get:function(){return this.jb},set:function(t){var e=this.jb;if(e!==t){var i=this instanceof lu&&!(this instanceof ju);ql(this),this.jb=t;var n=this.diagram;null!==n&&(i?(i=n.partManager,this instanceof nc?(null!==e&&i.Dg.remove(e),null!==t&&i.Dg.add(t,this)):this instanceof lu&&(null!==e&&i.Me.remove(e),null!==t&&i.Me.add(t,this))):(i=this.panel,null!==i&&null!==i.Ed&&(null!==e&&i.Ed.remove(e),null!==t&&i.Ed.add(t,this)))),this.g(\"data\",e,t),null!==n&&n.undoManager.isUndoingRedoing||null!==t&&this.Ea()}}},itemIndex:{get:function(){return this.Zn},set:function(t){var e=this.Zn;e!==t&&(this.Zn=t,this.g(\"itemIndex\",e,t))}},itemArray:{get:function(){return this.ei},set:function(t){var e=this.ei;if(e!==t||null!==t&&Gl(this,t)){var i=this.diagram;e!==t&&(null!==i&&null!==e&&Ff(i.partManager,this),this.ei=t,null!==i&&null!==t&&zf(i.partManager,this)),this.g(\"itemArray\",e,t),null!==i&&i.undoManager.isUndoingRedoing||this.nt()}}},itemTemplate:{get:function(){return null===this.je?null:this.je.J(\"\")},set:function(t){if(null===this.je){if(null===t)return;this.je=new gt}var e=this.je.J(\"\");e!==t&&((t instanceof lu||t.isPanelMain)&&k(\"Panel.itemTemplate must not be a Part or be Panel.isPanelMain: \"+t),this.je.add(\"\",t),this.g(\"itemTemplate\",e,t),t=this.diagram,null!==t&&t.undoManager.isUndoingRedoing||this.nt())}},itemTemplateMap:{get:function(){return this.je},set:function(t){var e=this.je;if(e!==t){for(var i=t.iterator;i.next(););this.je=t,this.g(\"itemTemplateMap\",e,t),t=this.diagram,null!==t&&t.undoManager.isUndoingRedoing||this.nt()}}},itemCategoryProperty:{get:function(){return this.gl},set:function(t){var e=this.gl;e!==t&&(this.gl=t,this.g(\"itemCategoryProperty\",e,t))}},isAtomic:{get:function(){return 0!==(1048576&this.H)},set:function(t){var e=0!==(1048576&this.H);e!==t&&(this.H^=1048576,this.g(\"isAtomic\",e,t))}},isClipping:{get:function(){return 0!==(2097152&this.H)},set:function(t){var e=0!==(2097152&this.H);e!==t&&(this.H^=2097152,this.s(),this.g(\"isClipping\",e,t))}},isOpposite:{get:function(){return 0!==(33554432&this.H)},set:function(t){var e=0!==(33554432&this.H);e!==t&&(this.H^=33554432,this.s(),this.g(\"isOpposite\",e,t))}},isEnabled:{get:function(){return 0!==(4194304&this.H)},set:function(t){var e=0!==(4194304&this.H);if(e!==t){var i=null===this.panel||this.panel.rg();this.H^=4194304,this.g(\"isEnabled\",e,t),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||i&&Wl(this,this,t)}}},alignmentFocusName:{get:function(){return this.yg},set:function(t){var e=this.yg;e!==t&&(this.yg=t,this.s(),this.g(\"alignmentFocusName\",e,t))}}}),p.Object.defineProperties(Nl,{Position:{get:function(){return th.J(\"Position\")}},Horizontal:{get:function(){return th.J(\"Horizontal\")}},Vertical:{get:function(){return th.J(\"Vertical\")}},Spot:{get:function(){return th.J(\"Spot\")}},Auto:{get:function(){return th.J(\"Auto\")}},Table:{get:function(){return th.J(\"Table\")}},Viewbox:{get:function(){return th.J(\"Viewbox\")}},TableRow:{get:function(){return th.J(\"TableRow\")}},TableColumn:{get:function(){return th.J(\"TableColumn\")}},Link:{get:function(){return th.J(\"Link\")}},Grid:{get:function(){return th.J(\"Grid\")}},Graduated:{get:function(){return th.J(\"Graduated\")}}}),Nl.prototype.findItemPanelForData=Nl.prototype.ix,Nl.prototype.rebuildItemElements=Nl.prototype.nt,Nl.prototype.updateTargetBindings=Nl.prototype.Ea,Nl.prototype.copyTemplate=Nl.prototype.xy,Nl.prototype.graduatedValueForPoint=Nl.prototype.jz,Nl.prototype.graduatedPointForValue=Nl.prototype.iz,Nl.prototype.findColumnForLocalX=Nl.prototype.Jy,Nl.prototype.findRowForLocalY=Nl.prototype.Ry,Nl.prototype.removeColumnDefinition=Nl.prototype.yv,Nl.prototype.removeRowDefinition=Nl.prototype.Av,Nl.prototype.removeAt=Nl.prototype.mb,Nl.prototype.remove=Nl.prototype.remove,Nl.prototype.insertAt=Nl.prototype.Ib,Nl.prototype.elt=Nl.prototype.N,Nl.prototype.add=Nl.prototype.add,Nl.prototype.findObject=Nl.prototype.$a,Nl.prototype.findInVisualTree=Nl.prototype.Yl,Nl.prototype.walkVisualTreeFrom=Nl.prototype.ym,Nl.prototype.findMainElement=Nl.prototype.zb;var Zl=!1,Ql=null,th=new gt;function eh(){st(this),this.ag=null,this.Br=!0,this.Sa=0,this.Pc=NaN,this.Wg=0,this.Vg=1/0,this.wb=Ae,this.sa=this.ka=0,this.bb=null,this.op=nh,this.ue=is,this.kp=this.dg=null,this.lp=NaN,this.ib=this.Hj=null,this.hn=!1}function ih(t){if(t.sizing===nh){var e=t.ag;return t.isRow?e.rowSizing:e.columnSizing}return t.sizing}Nl.className=\"Panel\",Nl.definePanelLayout=Jl,Jl(\"Position\",new dl),Jl(\"Vertical\",new gl),Jl(\"Auto\",new vl),Jl(\"Link\",new Ml),Jl(\"Grid\",new kl),eh.prototype.copy=function(){var t=new eh;return t.Br=this.Br,t.Sa=this.Sa,t.Pc=this.Pc,t.Wg=this.Wg,t.Vg=this.Vg,t.wb=this.wb,t.ka=this.ka,t.sa=this.sa,t.ue=this.ue,t.op=this.op,null===this.dg?t.dg=null:t.dg=this.dg.I(),t.kp=this.kp,t.lp=this.lp,t.Hj=null,null!==this.Hj&&(t.separatorDashArray=L(this.separatorDashArray)),t.ib=this.ib,t.hn=this.hn,t.bb=this.bb,t},i=eh.prototype,i.Vl=function(t){t.isRow?this.height=t.height:this.width=t.width,this.minimum=t.minimum,this.maximum=t.maximum,this.alignment=t.alignment,this.stretch=t.stretch,this.sizing=t.sizing,this.dg=null===t.separatorPadding?null:t.separatorPadding.I(),this.separatorStroke=t.separatorStroke,this.separatorStrokeWidth=t.separatorStrokeWidth,this.Hj=null,t.separatorDashArray&&(this.Hj=L(t.separatorDashArray)),this.background=t.background,this.coversSeparators=t.coversSeparators,this.bb=t.bb},i.fb=function(t){t.classType===eh&&(this.sizing=t)},i.toString=function(){return\"RowColumnDefinition \"+(this.isRow?\"(Row \":\"(Column \")+this.index+\") #\"+lt(this)},i.Si=function(t){this.ag=t},i.Nu=function(){var t=0,e=0,i=this.ag,n=this.isRow;if(null!==i&&i.type===Nl.Table)for(var o=n?i.sb.length:i.nb.length,r=0;r t&&C(t,\">= 0\",eh,\"height\"),this.Pc=t,this.actual=this.ka,null!==this.panel&&this.panel.s(),this.yb(\"height\",e,t))}},width:{get:function(){return this.Pc},set:function(t){var e=this.Pc;e!==t&&(0>t&&C(t,\">= 0\",eh,\"width\"),this.Pc=t,this.actual=this.ka,null!==this.panel&&this.panel.s(),this.yb(\"width\",e,t))}},minimum:{get:function(){return this.Wg},set:function(t){var e=this.Wg;e!==t&&((0>t||!isFinite(t))&&C(t,\">= 0\",eh,\"minimum\"),this.Wg=t,this.actual=this.ka,null!==this.panel&&this.panel.s(),this.yb(\"minimum\",e,t))}},maximum:{get:function(){return this.Vg},set:function(t){var e=this.Vg;e!==t&&(0>t&&C(t,\">= 0\",eh,\"maximum\"),this.Vg=t,this.actual=this.ka,null!==this.panel&&this.panel.s(),this.yb(\"maximum\",e,t))}},alignment:{get:function(){return this.wb},set:function(t){var e=this.wb;e.A(t)||(this.wb=t.I(),null!==this.panel&&this.panel.s(),this.yb(\"alignment\",e,t))}},stretch:{get:function(){return this.ue},set:function(t){var e=this.ue;e!==t&&(this.ue=t,null!==this.panel&&this.panel.s(),this.yb(\"stretch\",e,t))}},separatorPadding:{get:function(){return this.dg},set:function(t){\"number\"===typeof t&&(t=new ee(t));var e=this.dg;null!==t&&null!==e&&e.A(t)||(null!==t&&(t=t.I()),this.dg=t,null!==this.panel&&this.panel.s(),this.yb(\"separatorPadding\",e,t))}},separatorStroke:{get:function(){return this.kp},set:function(t){var e=this.kp;e!==t&&(null===t||\"string\"===typeof t||t instanceof Ra)&&(t instanceof Ra&&t.freeze(),this.kp=t,null!==this.panel&&this.panel.s(),this.yb(\"separatorStroke\",e,t))}},separatorStrokeWidth:{get:function(){return this.lp},set:function(t){var e=this.lp;e!==t&&(this.lp=t,null!==this.panel&&this.panel.s(),this.yb(\"separatorStrokeWidth\",e,t))}},separatorDashArray:{get:function(){return this.Hj},set:function(t){var e=this.Hj;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;oo)){var r=n.measuredBounds,s=Math.max(1,r.width);r=r.height;for(var a,l,h,u,c,f,d=i[0],p=i[1],g=0,m=j(),v=2;v h&&(h=1),o=i=h,a=s/2,l=0!==a,v=0,f=m[v],h=f[0],c=f[1],u=f[2],f=f[3];for(var y=0;.1<=g;){if(0===y&&(l?(o=i,o-=a,g-=a,l=!1):o=i,0===o&&(o=1)),o>g)return void A(m);o>f?(y=o-f,o=f):y=0;var b=Math.sqrt(o*o/(1+u*u));if(0>h&&(b=-b),d+=b,p+=u*b,t.translate(d,p),t.rotate(c),t.translate(-s/2,-r/2),0===y&&n.Ci(t,e),t.translate(s/2,r/2),t.rotate(-c),t.translate(-d,-p),g-=o,f-=o,0!==y){if(v++,v===m.length)return void A(m);f=m[v],h=f[0],c=f[1],u=f[2],f=f[3],o=y}}A(m)}}function lh(t){var e=t.geometryStretch;return null!==t.Pd?e===is?Qr:e:e===is?gh[t.figure].defaultStretch:e}function hh(t,e,i,n,o){return t=i.x-t,e=i.y-e,e=t*t+e*e,e i?t-i:i-t)<(e>n?e-n:n-e)?(t=e t||We.ca(l.y,t))&&(l.y e||We.ca(l.x,e))&&(l.x =t&&n<=e):(t =n&&i<=t)}function fh(t){var e=t.diagram;null!==e&&e.undoManager.isUndoingRedoing||(t.segmentOrientation=zc,\"None\"!==t.Pl?(t.segmentIndex=-1,t.alignmentFocus=Ve):\"None\"!==t.Yk&&(t.segmentIndex=0,t.alignmentFocus=new Ge(1-Ve.x,Ve.y)))}function dh(t){var e=ph[t];if(void 0===e){var i=t.toLowerCase();if(\"none\"===i)return\"None\";if(e=ph[i],void 0===e){var n,o=null;for(n in We.Bm)if(n.toLowerCase()===i){o=n;break}if(null!==o)return t=ti(We.Bm[o],!1),ph[o]=t,i!==o&&(ph[i]=o),o}}return\"string\"===typeof e?e:e instanceof Je?t:null}eh.className=\"RowColumnDefinition\",eh.Default=nh,eh.None=oh,eh.ProportionalExtra=rh,d(sh,Ks),sh.prototype.cloneProtected=function(t){Ks.prototype.cloneProtected.call(this,t),t.qa=this.qa,t.Vk=this.Vk,t.Gn=this.Gn,t.Pd=this.Pd,t.Wk=this.Wk,t.Gc=this.Gc,t.ih=this.ih,t.Il=this.Il,t.Jl=this.Jl,t.Jj=this.Jj,null!==this.gh&&(t.gh=L(this.gh)),t.hh=this.hh,t.bf=this.bf.I(),t.cf=this.cf.I(),t.Ko=this.Ko,t.Lo=this.Lo,t.Rn=this.Rn,t.No=this.No,t.Pl=this.Pl,t.Yk=this.Yk,t.Cd=this.Cd,t.Bd=this.Bd,t.zd=this.zd,t.Ad=this.Ad},i=sh.prototype,i.fb=function(t){t===ts||t===es||t===rs||t===is?this.geometryStretch=t:Ks.prototype.fb.call(this,t)},i.toString=function(){return\"Shape(\"+(\"None\"!==this.figure?this.figure:\"None\"!==this.toArrow?this.toArrow:this.fromArrow)+\")#\"+lt(this)},i.Ci=function(t,e){var i=this.Gc,n=this.Wk;if(null!==i||null!==n){var o=this.actualBounds,r=this.naturalBounds;null!==n&&ia(this,t,n,!0,!1,r,o),null!==i&&ia(this,t,i,!1,!1,r,o),o=this.part,r=this.ih,0===r&&null!==o&&(r=o instanceof ju&&o.type===Nl.Link&&\"Selection\"===o.category&&o.adornedObject instanceof sh&&o.adornedPart.zb()===o.adornedObject?o.adornedObject.strokeWidth:0),t.lineWidth=r,t.lineJoin=this.Jl,t.lineCap=this.Il,t.miterLimit=this.Jj;var s=!1;o&&e.De(\"drawShadows\")&&(s=o.isShadowed);var a=!0;null!==i&&null===n&&(a=!1),o=!1;var l=this.strokeDashArray;null!==l&&(o=!0,t.Ps(l,this.hh));var h=this.qa;if(null!==h){if(h.type===ai)t.beginPath(),t.moveTo(h.startX,h.startY),t.lineTo(h.endX,h.endY),null!==n&&t.Td(n),0!==r&&null!==i&&t.Wi();else if(h.type===li){var u=h.startX,c=h.startY,f=h.endX,d=h.endY;l=Math.min(u,f),h=Math.min(c,d),u=Math.abs(f-u),c=Math.abs(d-c),null!==n&&(t.beginPath(),t.rect(l,h,u,c),t.Td(n)),null!==i&&(f=n=i=0,a&&s&&(i=t.shadowOffsetX,n=t.shadowOffsetY,f=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0),0!==r&&(t.beginPath(),t.rect(l,h,u,c),t.Wi()),a&&s&&(t.shadowOffsetX=i,t.shadowOffsetY=n,t.shadowBlur=f))}else if(h.type===hi)c=h.startX,l=h.startY,f=h.endX,d=h.endY,h=Math.abs(f-c)/2,u=Math.abs(d-l)/2,c=Math.min(c,f)+h,l=Math.min(l,d)+u,t.beginPath(),t.moveTo(c,l-u),t.bezierCurveTo(c+We.xg*h,l-u,c+h,l-We.xg*u,c+h,l),t.bezierCurveTo(c+h,l+We.xg*u,c+We.xg*h,l+u,c,l+u),t.bezierCurveTo(c-We.xg*h,l+u,c-h,l+We.xg*u,c-h,l),t.bezierCurveTo(c-h,l-We.xg*u,c-We.xg*h,l-u,c,l-u),t.closePath(),null!==n&&t.Td(n),0!==r&&null!==i&&(a&&s?(r=t.shadowOffsetX,s=t.shadowOffsetY,i=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.Wi(),t.shadowOffsetX=r,t.shadowOffsetY=s,t.shadowBlur=i):t.Wi());else if(h.type===ui)for(l=h.figures,h=l.length,u=0;u m.sweepAngle,null!==p?p.endX:c.startX,null!==p?p.endY:c.startY)}else if(p=di(m,c),v=p.length,0===v)t.lineTo(m.centerX,m.centerY);else for(var y=0;y (i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY)||0>n)&&(_t.free(r),We.Ub(i.startX,i.startY,i.endX,i.endY,o,t.x,t.y)));if(i.type===li){e=i.startX;var s=i.startY,a=i.endX;if(i=i.endY,r.x=Math.min(e,a),r.y=Math.min(s,i),r.width=Math.abs(a-e),r.height=Math.abs(i-s),null===this.fill){if(r.Uc(-n,-n),r.ea(t))return _t.free(r),!1;r.Uc(n,n)}return null!==this.stroke&&r.Uc(o,o),t=r.ea(t),_t.free(r),t}if(i.type===hi){s=i.startX,o=i.startY,a=i.endX;var l=i.endY;if(i=Math.min(s,a),e=Math.min(o,l),s=Math.abs(a-s)/2,o=Math.abs(l-o)/2,i=t.x-(i+s),e=t.y-(e+o),null===this.fill){if(s-=n,o-=n,0>=s||0>=o||1>=i*i/(s*s)+e*e/(o*o))return _t.free(r),!1;s+=n,o+=n}return null!==this.stroke&&(s+=n,o+=n),_t.free(r),!(0>=s||0>=o)&&1>=i*i/(s*s)+e*e/(o*o)}return i.type===ui?(_t.free(r),null===this.fill?oi(i,t.x,t.y,o):i.ea(t,o,1 =this.strokeWidth)u=We.Fe(h.startX,h.startY,h.endX,h.endY,r,s,a,l,o);else{if(h.startX===h.endX?(n=c,u=0):(e=(h.endY-h.startY)/(h.endX-h.startX),u=c/Math.sqrt(1+e*e),n=u*e),e=j(),t=new mt,We.Fe(h.startX+n,h.startY+u,h.endX+n,h.endY+u,r,s,a,l,t)&&e.push(t),t=new mt,We.Fe(h.startX-n,h.startY-u,h.endX-n,h.endY-u,r,s,a,l,t)&&e.push(t),t=new mt,We.Fe(h.startX+n,h.startY+u,h.startX-n,h.startY-u,r,s,a,l,t)&&e.push(t),t=new mt,We.Fe(h.endX+n,h.endY+u,h.endX-n,h.endY-u,r,s,a,l,t)&&e.push(t),a=e.length,0===a)return A(e),!1;for(u=!0,l=1/0,n=0;nMath.abs(i)){if(l=s-u-i*(r-n),0>t*t*i*i+h*h-l*l){o.x=NaN,o.y=NaN,u=!1;break t}c=Math.sqrt(t*t*i*i+h*h-l*l),a=(-t*t*i*l+t*h*c)/(h*h+t*t*i*i)+n,t=(-t*t*i*l-t*h*c)/(h*h+t*t*i*i)+n,h=i*(a-n)+l+u,l=i*(t-n)+l+u,Math.abs((r-a)*(r-a))+Math.abs((s-h)*(s-h)) a){o.x=NaN,o.y=NaN,u=!1;break t}l=Math.sqrt(a),a=u+l,l=u-l,Math.abs(a-s) o)return!0;return!1}if(i&&null!==this.fill&&this.vh(t,!0))return!0;var o=t.Be(e),r=o;if(1.5 =o||kt(e,r,0,-c)>=o||kt(e,r,0,c)>=o||kt(e,r,u,0)>=o);if(t=We.Dy(u,c,e,r),t*t<=o)return!0}else if(e.type===ui){if(h=e.bounds,r=h.x,a=h.y,l=h.x+h.width,h=h.y+h.height,t.x>l&&t.x h&&t.yo&&xt(t.x,t.y,r,a,l,a)>o&&xt(t.x,t.y,l,h,r,h)>o&&xt(t.x,t.y,l,h,l,a)>o)return!1;if(r=Math.sqrt(o),!i){for(i=e.figures,e=0;e o)return!1;for(a=r.segments.j,l=a.length,h=0;h o)return!1;break;case vi:var f=j();if(We.ze(s,u,c.point1X,c.point1Y,c.point2X,c.point2Y,c.endX,c.endY,.8,f),s=n(f,t),A(f),s)return!1;if(s=c.endX,u=c.endY,t.cd(s,u)>o)return!1;break;case yi:if(f=j(),We.jq(s,u,c.point1X,c.point1Y,c.endX,c.endY,.8,f),s=n(f,t),A(f),s)return!1;if(s=c.endX,u=c.endY,t.cd(s,u)>o)return!1;break;case bi:case wi:f=c.type===bi?di(c,r):pi(c,r,s,u);var d=f.length;if(0===d){if(s=c.centerX,u=c.centerY,t.cd(s,u)>o)return!1;break}c=null;for(var p=j(),g=0;g = 0\",sh,\"strokeWidth:value\")}},strokeCap:{get:function(){return this.Il},set:function(t){var e=this.Il;e!==t&&(\"string\"!==typeof t||\"butt\"!==t&&\"round\"!==t&&\"square\"!==t?C(t,'\"butt\", \"round\", or \"square\"',sh,\"strokeCap\"):(this.Il=t,this.R(),this.g(\"strokeCap\",e,t)))}},strokeJoin:{get:function(){return this.Jl},set:function(t){var e=this.Jl;e!==t&&(\"string\"!==typeof t||\"miter\"!==t&&\"bevel\"!==t&&\"round\"!==t?C(t,'\"miter\", \"bevel\", or \"round\"',sh,\"strokeJoin\"):(this.Jl=t,this.R(),this.g(\"strokeJoin\",e,t)))}},strokeMiterLimit:{get:function(){return this.Jj},set:function(t){var e=this.Jj;if(e!==t&&1<=t){this.Jj=t,this.R();var i=this.part;null!==i&&(i.Ug=NaN),this.g(\"strokeMiterLimit\",e,t)}}},strokeDashArray:{get:function(){return this.gh},set:function(t){var e=this.gh;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;ot?t=0:1 t?t=0:1 =t.me)null!==o&&o.h(0,a);else{var h=e;if(t.jg===Ph)if(i.ig=1,s=wh(e),0===l||s<=n)i.Ec=Math.max(i.Ec,s),i.Wc.push(i.Ec),i.Ac.push(e),null!==o&&o.h(s,a);else{for(r=bh(t,h),h=h.substr(r.length),e=bh(t,h),s=wh(r+e);0 n&&1 n;){var c=1;for(s=wh(u.substr(0,c)),e=0;s<=n;)c++,e=s,s=wh(u.substr(0,c));if(1===c?(i.Wc[t.oc+l]=s,r=Math.max(r,s)):(i.Wc[t.oc+l]=e,r=Math.max(r,e)),c--,1>c&&(c=1),i.Ac[t.oc+l]=u.substr(0,c),l++,u=u.substr(c),t.oc+l>t.me)break}for(e=bh(t,h),s=wh(u+e);0 t.me))break}i.ig=Math.min(t.me,l),i.Ec=Math.max(i.Ec,r),null!==o&&o.h(i.Ec,a*i.ig)}}}function bh(t,e){if(t.jg===Oh)return e.substr(0,1);t=e.length;for(var i=0,n=Ah;i =t?e:e.substr(0,i)}function wh(t){return null===Vh?8*t.length:Vh.measureText(t).width}function xh(t){if(null!==t.nd.Hf)return t.nd.Hf;var e=t.ee;if(null===Vh){var i=16;return t.nd.Hf=i}return void 0!==Bh[e]&&5e3>zh?i=Bh[e]:(i=1.3*Vh.measureText(\"M\").width,Bh[e]=i,zh++),t.nd.Hf=i}function kh(t){if(null===Vh)return 6;if(void 0!==Fh[t]&&5e3>Ih)var e=Fh[t];else e=Vh.measureText(Eh).width,Fh[t]=e,Ih++;return e}function Mh(t,e,i){var n=t.Pb.replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\"),o=t.$e+t.af;if(o=Math.max(0,xh(t)+o),0===n.length)return i.Ec=0,t.oc=1,o;if(!t.isMultiline){var r=n.indexOf(\"\\n\",0);0<=r&&(n=n.substr(0,r))}r=0;for(var s,a=t.oc=0,l=!1;!l;){if(s=n.indexOf(\"\\n\",a),-1===s&&(s=n.length,l=!0),a<=s){if(a=n.substr(a,s-a),t.jg!==Ph){i.ig=0;var h=It.alloc();yh(t,a,i,e,h),r+=h.height,It.free(h),t.oc+=i.ig}else yh(t,a,i,e,null),r+=o,t.oc++;t.oc===t.me&&(l=!0)}a=s+1}return t.Mr=r}function Ch(){Ah=/[ \\u200b\\u00ad]/,Bh=new J,Fh=new J,Vh=ds?new za(null).context:null}sh.className=\"Shape\",sh.getFigureGenerators=function(){var t,e=new gt;for(t in We.Je)t!==t.toLowerCase()&&e.add(t,We.Je[t]);return e.freeze(),e},sh.defineFigureGenerator=function(t,e){var i=t.toLowerCase(),n=We.Je;n[t]=e,n[i]=t},sh.getArrowheadGeometries=function(){var t=new gt;for(n in We.Bm)if(void 0===ph[n]){var e=ti(We.Bm[n],!1);ph[n]=e,e=n.toLowerCase(),e!==n&&(ph[e]=n)}for(var i in ph)if(i!==i.toLowerCase()){var n=ph[i];n instanceof Je&&t.add(i,n)}return t.freeze(),t},sh.defineArrowheadGeometry=function(t,e){var i=null;i=\"string\"===typeof e?ti(e,!1):e,e=t.toLowerCase(),\"none\"!==e&&t!==e||k(\"Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: \"+t);var n=ph;n[t]=i,n[e]=t},d(mh,Ks),mh.prototype.cloneProtected=function(t){Ks.prototype.cloneProtected.call(this,t),t.Pb=this.Pb,t.Gc=this.Gc,t.ee=this.ee,t.ui=this.ui,t.yd=this.yd,t.zi=this.zi,t.nj=this.nj,t.di=this.di,t.ci=this.ci,t.Zf=this.Zf,t.jg=this.jg,t.oc=this.oc,t.Mr=this.Mr,t.iu=this.iu,t.hu=this.hu,t.nd.Vl(this.nd),t.An=this.An,t.yp=this.yp,t.vi=this.vi,t.xp=this.xp,t.Xm=this.Xm,t.Cc=this.Cc,t.$e=this.$e,t.af=this.af,t.me=this.me,t.jl=this.jl,t.Cd=this.Cd,t.Bd=this.Bd,t.zd=this.zd,t.ij=this.ij,t.Ad=this.Ad},i=mh.prototype,i.fb=function(t){t.classType===mh?this.wrap=t:Ks.prototype.fb.call(this,t)},i.toString=function(){return 22 f*u*u&&(i=!0),e.Yc!==t&&(i=!1),!1===e.De(\"textGreeking\")&&(i=!1),e=this.$e,f=this.af,this.flip){case as:t.translate(o,0),t.scale(-1,1);break;case ss:t.translate(0,r),t.scale(1,-1);break;case ls:t.translate(o,r),t.scale(-1,-1)}u=this.oc,c=(e+s+f)*u,r>c&&(n=this.zi,n=n.y*r-n.y*c+n.offsetY),c=this.nd;for(var d=0;do&&(p=o),n+=e;var g=c.Ac[d],m=t,v=n,y=a,b=0;if(i)\"left\"===y?b=0:\"right\"===y?b=o-p:\"center\"===y&&(b=(o-p)/2),m.fillRect(0+b,v+.25*s,p,1);else{\"left\"===y?b=0:\"right\"===y?b=o:\"center\"===y&&(b=o/2);var w=null!==Sh?Sh(this,s):.75*s;m.fillText(g,0+b,v+w),g=s/20|0,0===g&&(g=1),\"right\"===y?b-=p:\"center\"===y&&(b-=p/2),l&&(y=null!==Nh?Nh(this,s):.8*s,m.beginPath(),m.lineWidth=g,m.moveTo(0+b,v+y),m.lineTo(0+b+p,v+y),m.stroke()),h&&(m.beginPath(),m.lineWidth=g,v=v+s-s/2.2|0,0!==g%2&&(v+=.5),m.moveTo(0+b,v),m.lineTo(0+b+p,v),m.stroke())}n+=s+f}switch(this.flip){case as:t.scale(-1,1),t.translate(-o,0);break;case ss:t.scale(1,-1),t.translate(0,-r);break;case ls:t.scale(-1,-1),t.translate(-o,-r)}}},i.hm=function(t,e,i,n){this.jl=t;var o,r=this.ee;if(null!==Vh&&Rh!==r&&(Rh=Vh.font=r),r=this.nd,r.reset(),isNaN(this.desiredSize.width)){var s=this.Pb.replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\");if(0===s.length)s=0;else if(this.isMultiline){for(var a=o=0,l=!1;!l;){var h=s.indexOf(\"\\n\",a);-1===h&&(h=s.length,l=!0),o=Math.max(o,wh(s.substr(a,h-a).trim())),a=h+1}s=o}else o=s.indexOf(\"\\n\",0),0<=o&&(s=s.substr(0,o)),s=wh(s);s=Math.min(s,t/this.scale),s=Math.max(8,s)}else s=this.desiredSize.width;if(null!==this.panel&&(s=Math.min(s,this.panel.maxSize.width)),o=Mh(this,s,r),o=isNaN(this.desiredSize.height)?Math.min(o,e/this.scale):this.desiredSize.height,a=o,0!==r.Ec&&1!==r.Ac.length&&this.Zf===jh&&(e=this.ee,e=this.Zf===jh?kh(e):0,l=this.$e+this.af,l=Math.max(0,xh(this)+l),a=Math.min(this.maxLines-1,Math.max(Math.floor(a/l+.01)-1,0)),!(a+1>=r.Ac.length))){for(l=r.Ac[a],e=Math.max(1,t-e);wh(l)>e&&1 t?t=0:1 t?t=0:1 =t&&C(t,\"> 0\",mh,\"maxLines\"),this.me=t,this.g(\"maxLines\",e,t),this.s())}},metrics:{get:function(){return this.nd}},choices:{get:function(){return this.Xm},set:function(t){var e=this.Xm;e!==t&&(this.Xm=t,this.g(\"choices\",e,t))}}});var Sh=null,Nh=null,Ph=new K(mh,\"None\",0),Th=new K(mh,\"WrapFit\",1),Lh=new K(mh,\"WrapDesiredSize\",2),Oh=new K(mh,\"WrapBreakAll\",3),Dh=new K(mh,\"OverflowClip\",0),jh=new K(mh,\"OverflowEllipsis\",1),Ah=null,Bh=null,zh=0,Fh=null,Ih=0,Eh=\"...\",Rh=\"\",Vh=null,_h=!1;function Hh(){this.Ec=this.ig=0,this.Wc=[],this.Ac=[],this.Hf=null}function Yh(){Ks.call(this),this.Ig=null,this.qp=\"\",this.fh=Qt,this.al=Qr,this.df=this.Cc=null,this.$k=de,this.yd=ts,this.Ll=null,this.bu=!1,this.ir=!0,this.nl=!1,this.Dl=null}function qh(t){void 0===t&&(t=\"\"),\"\"!==t?Uh[t]&&(delete Uh[t],Kh--):(Uh=new J,Kh=0)}function Gh(t,e){t.zr=!0,t.Zk=!1;for(var i,n=E(),o=n.length,r=0;r =n.width&&(o=o+d.offsetX+(u*d.x-n.width*d.x)),c>=n.height&&(r=r+d.offsetY+(c*d.y-n.height*d.y)),a=Math.min(n.width,u),s=Math.min(n.height,c);break;case Qr:u=n.width,c=n.height;break;case es:case rs:f===es?(f=Math.min(n.height/c,n.width/u),u*=f,c*=f):f===rs&&(f=Math.max(n.height/c,n.width/u),u*=f,c*=f,u>=n.width&&(o=(o+d.offsetX+(u*d.x-n.width*d.x)/u)*a),c>=n.height&&(r=(r+d.offsetY+(c*d.y-n.height*d.y)/c)*s),a*=1/(u/n.width),s*=1/(c/n.height),u=n.width,c=n.height)}f=this.Ce()*e.scale;var p=a*s/(u*f*c*f),g=i.__goCache;f=null;var m=$h;if(i.zr&&void 0!==g&&p>m*m)for(null===g.Bi&&(Jh(g,4,l,h,i),Jh(g,16,l,h,i)),l=g.Bi,h=l.length,f=l[0],m=0;m =n)&&(n=5),n=Math.min(n,e/3),n=Math.min(n,i/3),t=n*We.xg,e=(new Je).add(new ci(n,0,!0).add(new fi(mi,e-n,0)).add(new fi(vi,e,n,e-t,0,e,t)).add(new fi(mi,e,i-n)).add(new fi(vi,e-n,i,e,i-t,e-t,i)).add(new fi(mi,n,i)).add(new fi(vi,0,i-n,t,i,0,i-t)).add(new fi(mi,0,n)).add(new fi(vi,n,0,0,t,t,0).close())),1 o.x&&t.y>o.y&&t.right o.x&&e.y>o.y&&e.right =i.maxSelectionCount)){this.D^=4096;var n=!1;if(null!==i){n=i.skipsUndoManager,i.skipsUndoManager=!0;var o=i.selection;o.ha(),t?o.add(this):o.remove(this),o.freeze()}this.g(\"isSelected\",e,t),this.Jb(),t=this.selectionChanged,null!==t&&t(this),null!==i&&(i.cc(),i.skipsUndoManager=n)}}}},isHighlighted:{get:function(){return 0!==(524288&this.D)},set:function(t){var e=0!==(524288&this.D);if(e!==t){this.D^=524288;var i=this.diagram;null!==i&&(i=i.highlighteds,i.ha(),t?i.add(this):i.remove(this),i.freeze()),this.g(\"isHighlighted\",e,t),this.R(),t=this.highlightedChanged,null!==t&&t(this)}}},isShadowed:{get:function(){return 0!==(8192&this.D)},set:function(t){var e=0!==(8192&this.D);e!==t&&(this.D^=8192,this.g(\"isShadowed\",e,t),this.R())}},isAnimated:{get:function(){return 0!==(262144&this.D)},set:function(t){var e=0!==(262144&this.D);e!==t&&(this.D^=262144,this.g(\"isAnimated\",e,t))}},highlightedChanged:{get:function(){return this.Nn},set:function(t){var e=this.Nn;e!==t&&(this.Nn=t,this.g(\"highlightedChanged\",e,t))}},selectionObjectName:{get:function(){return this.jp},set:function(t){var e=this.jp;e!==t&&(this.jp=t,this.dh=null,this.g(\"selectionObjectName\",e,t))}},selectionAdornmentTemplate:{get:function(){return this.hp},set:function(t){var e=this.hp;e!==t&&(this.hp=t,this.g(\"selectionAdornmentTemplate\",e,t))}},selectionObject:{get:function(){if(null===this.dh){var t=this.selectionObjectName;null!==t&&\"\"!==t?(t=this.$a(t),this.dh=null!==t?t:this):this instanceof nc?(t=this.path,this.dh=null!==t?t:this):this.dh=this}return this.dh}},selectionChanged:{get:function(){return this.ip},set:function(t){var e=this.ip;e!==t&&(this.ip=t,this.g(\"selectionChanged\",e,t))}},resizeAdornmentTemplate:{get:function(){return this.To},set:function(t){var e=this.To;e!==t&&(this.To=t,this.g(\"resizeAdornmentTemplate\",e,t))}},resizeObjectName:{get:function(){return this.Vo},set:function(t){var e=this.Vo;e!==t&&(this.Vo=t,this.g(\"resizeObjectName\",e,t))}},resizeObject:{get:function(){var t=this.resizeObjectName;return\"\"!==t&&(t=this.$a(t),null!==t)?t:this}},resizeCellSize:{get:function(){return this.Uo},set:function(t){var e=this.Uo;e.A(t)||(this.Uo=t=t.I(),this.g(\"resizeCellSize\",e,t))}},rotateAdornmentTemplate:{get:function(){return this.Wo},set:function(t){var e=this.Wo;e!==t&&(this.Wo=t,this.g(\"rotateAdornmentTemplate\",e,t))}},rotateObjectName:{get:function(){return this.Xo},set:function(t){var e=this.Xo;e!==t&&(this.Xo=t,this.g(\"rotateObjectName\",e,t))}},rotateObject:{get:function(){var t=this.rotateObjectName;return\"\"!==t&&(t=this.$a(t),null!==t)?t:this}},rotationSpot:{get:function(){return this.Yo},set:function(t){var e=this.Yo;e.A(t)||(this.Yo=t=t.I(),this.g(\"rotationSpot\",e,t))}},text:{get:function(){return this.Pb},set:function(t){var e=this.Pb;e!==t&&(this.Pb=t,this.g(\"text\",e,t))}},containingGroup:{get:function(){return this.Rh},set:function(t){if(this.Lb()){var e=this.Rh;if(e!==t){null===t||this!==t&&!t.Vd(this)||(this===t&&k(\"Cannot make a Group a member of itself: \"+this.toString()),k(\"Cannot make a Group indirectly contain itself: \"+this.toString()+\" already contains \"+t.toString())),this.B(2);var i=this.diagram;if(null!==e?Qu(e,this):this instanceof Ju&&null!==i&&i.xi.remove(this),this.Rh=t,null!==t?Zu(t,this):this instanceof Ju&&null!==i&&i.xi.add(this),this.B(1),null!==i){var n=this.data,o=i.model;if(null!==n&&o.dk()){var r=o.pa(null!==t?t.data:null);o.ut(n,r)}}if(n=this.containingGroupChanged,null!==n&&(o=!0,null!==i&&(o=i.da,i.da=!0),n(this,e,t),null!==i&&(i.da=o)),this instanceof Ju)for(i=new rt,Ou(i,this,!0,0,!0),i=i.iterator;i.next();)if(n=i.value,n instanceof Au)for(n=n.linksConnected;n.next();)oc(n.value);if(this instanceof Au){for(i=this.linksConnected;i.next();)oc(i.value);i=this.labeledLink,null!==i&&oc(i)}this.g(\"containingGroup\",e,t),null!==t&&(e=t.layer,null!==e&&Lo(e,-1,t))}}else k(\"cannot set the Part.containingGroup of a Link or Adornment\")}},containingGroupChanged:{get:function(){return this.$m},set:function(t){var e=this.$m;e!==t&&(this.$m=t,this.g(\"containingGroupChanged\",e,t))}},isTopLevel:{get:function(){return!(null!==this.containingGroup||this instanceof Au&&null!==this.labeledLink)}},layoutConditions:{get:function(){return this.bo},set:function(t){var e=this.bo;e!==t&&(this.bo=t,this.g(\"layoutConditions\",e,t))}},dragComputation:{get:function(){return this.wn},set:function(t){var e=this.wn;e!==t&&(this.wn=t,this.g(\"dragComputation\",e,t))}},shadowOffset:{get:function(){return this.si},set:function(t){var e=this.si;e.A(t)||(this.si=t=t.I(),this.R(),this.g(\"shadowOffset\",e,t))}},shadowColor:{get:function(){return this.Ij},set:function(t){var e=this.Ij;e!==t&&(this.Ij=t,this.R(),this.g(\"shadowColor\",e,t))}},shadowBlur:{get:function(){return this.Od},set:function(t){var e=this.Od;e!==t&&(this.Od=t,this.R(),this.g(\"shadowBlur\",e,t))}}}),lu.prototype.invalidateLayout=lu.prototype.B,lu.prototype.findCommonContainingGroup=lu.prototype.hx,lu.prototype.isMemberOf=lu.prototype.Vd,lu.prototype.findTopLevelPart=lu.prototype.Vy,lu.prototype.findSubGraphLevel=lu.prototype.Sy,lu.prototype.ensureBounds=lu.prototype.ac,lu.prototype.getDocumentBounds=lu.prototype.Vp,lu.prototype.getRelativePoint=lu.prototype.nf,lu.prototype.findObject=lu.prototype.$a,lu.prototype.moveTo=lu.prototype.moveTo,lu.prototype.invalidateAdornments=lu.prototype.Jb,lu.prototype.clearAdornments=lu.prototype.Sj,lu.prototype.removeAdornment=lu.prototype.tf,lu.prototype.addAdornment=lu.prototype.qh,lu.prototype.findAdornment=lu.prototype.$j,lu.prototype.updateTargetBindings=lu.prototype.Ea;var Du=!1;function ju(t){lu.call(this,t),this.D&=-257,this.Rg=\"Adornment\",this.$d=null,this.Ew=0,this.Pw=!1,this.l=[],this.Va=null}function Au(t){lu.call(this,t),this.S=13,this.Ya=new nt,this.Cp=this.hl=this.ii=this.eo=this.co=null,this.Ck=re,this.rc=this.Le=null,this.Qo=$u,this.oh=!1}function Bu(t,e){null!==e&&(null===t.Le&&(t.Le=new rt),t.Le.add(e))}function zu(t,e,i,n){if(null===e||null===t.Le)return null;for(var o=t.Le.iterator;o.next();){var r=o.value;if(r.jt===t&&r.ov===e&&r.xx===i&&r.yx===n||r.jt===e&&r.ov===t&&r.xx===n&&r.yx===i)return r}return null}function Fu(t,e){for(var i=t.linksConnected;i.next();){var n=i.value;n.fromPort!==e&&n.toPort!==e||(Iu(t,n.fromPort),Iu(t,n.toPort),n.Ra())}}function Iu(t,e){null!==e&&(e=e.Po,null!==e&&e.cm(),t=t.containingGroup,null===t||t.isSubGraphExpanded||Iu(t,t.port))}function Eu(t,e,i){Iu(t,i);var n=t.Ya.contains(e);if(n||t.Ya.add(e),!n||e.fromNode===e.toNode){var o=t.linkConnected;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.da,s.da=!0),o(t,e,i),null!==s&&(s.da=r)}}!n&&e.isTreeLink&&(i=e.fromNode,e=e.toNode,null!==i&&null!==e&&i!==e&&(n=!0,t=t.diagram,null!==t&&(n=t.isTreePathToChildren),o=n?e:i,r=n?i:e,o.oh||(o.oh=r),!r.isTreeLeaf||null!==t&&t.undoManager.isUndoingRedoing||(n?i===r&&(r.isTreeLeaf=!1):e===r&&(r.isTreeLeaf=!1))))}function Ru(t,e,i){Iu(t,i);var n=t.Ya.remove(e),o=null;if(n||e.toNode===e.fromNode){var r=t.linkDisconnected;if(o=t.diagram,null!==r){var s=!0;null!==o&&(s=o.da,o.da=!0),r(t,e,i),null!==o&&(o.da=s)}}n&&e.isTreeLink&&(i=!0,null!==o&&(i=o.isTreePathToChildren),t=i?e.toNode:e.fromNode,e=i?e.fromNode:e.toNode,null!==t&&(t.oh=!1),null===e||e.isTreeLeaf||(0===e.Ya.count?(e.oh=null,null!==o&&o.undoManager.isUndoingRedoing||(e.isTreeLeaf=!0)):Vu(e)))}function Vu(t){if(t.oh=!1,0!==t.Ya.count){var e=!0,i=t.diagram;if(null===i||!i.undoManager.isUndoingRedoing){for(null!==i&&(e=i.isTreePathToChildren),i=t.Ya.iterator;i.next();){var n=i.value;if(n.isTreeLink)if(e){if(n.fromNode===t)return void(t.isTreeLeaf=!1)}else if(n.toNode===t)return void(t.isTreeLeaf=!1)}t.isTreeLeaf=!0}}}function _u(t){null===t.rc?t.rc=new gt:t.rc.clear(),t.ym(t,(function(t,e){Hu(t,e)})),0===t.rc.count&&t.rc.add(\"\",t)}function Hu(t,e){var i=e.portId;null!==i&&null!==t.rc&&t.rc.add(i,e)}function Yu(t,e,i){var n=e.portId;if(null!==n&&(null!==t.rc&&t.rc.remove(n),e=t.diagram,null!==e&&i)){for(i=null,t=t.Wu(n);t.next();)n=t.value,null===i&&(i=j()),i.push(n);if(null!==i){for(t=0;t t&&(t=1);var e=this.diagram;if(null!==e&&!e.Ee){e.Ee=!0;var i=new rt;i.add(this),Gu(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===Ps),e.Ee=!1}},Au.prototype.expandTree=function(t){void 0===t&&(t=2),2>t&&(t=2);var e=this.diagram;if(null!==e&&!e.Ee){e.Ee=!0;var i=new rt;i.add(this),Uu(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===Ps),e.Ee=!1}},p.Object.defineProperties(Au.prototype,{portSpreading:{get:function(){return this.Qo},set:function(t){var e=this.Qo;e!==t&&(this.Qo=t,this.g(\"portSpreading\",e,t),t=this.diagram,null!==t&&t.undoManager.isUndoingRedoing||this.ed())}},avoidable:{get:function(){return 0!==(8&this.S)},set:function(t){var e=0!==(8&this.S);if(e!==t){this.S^=8;var i=this.diagram;null!==i&&Kr(i,this),this.g(\"avoidable\",e,t)}}},avoidableMargin:{get:function(){return this.Ck},set:function(t){\"number\"===typeof t&&(t=new ee(t));var e=this.Ck;if(!e.A(t)){this.Ck=t=t.I();var i=this.diagram;null!==i&&Kr(i,this),this.g(\"avoidableMargin\",e,t)}}},linksConnected:{get:function(){return this.Ya.iterator}},linkConnected:{get:function(){return this.co},set:function(t){var e=this.co;e!==t&&(this.co=t,this.g(\"linkConnected\",e,t))}},linkDisconnected:{get:function(){return this.eo},set:function(t){var e=this.eo;e!==t&&(this.eo=t,this.g(\"linkDisconnected\",e,t))}},linkValidation:{get:function(){return this.ii},set:function(t){var e=this.ii;e!==t&&(this.ii=t,this.g(\"linkValidation\",e,t))}},isLinkLabel:{get:function(){return null!==this.hl}},labeledLink:{get:function(){return this.hl},set:function(t){var e=this.hl;if(e!==t){var i=this.diagram,n=this.data;if(null!==e){if(null!==e.$c&&(e.$c.remove(this),e.s()),null!==i&&null!==n&&!i.undoManager.isUndoingRedoing){var o=e.data,r=i.model;if(null!==o&&r.em()){var s=r.pa(n);void 0!==s&&r.Ax(o,s)}}this.containingGroup=null}this.hl=t,null!==t&&(rc(t,this),null===i||null===n||i.undoManager.isUndoingRedoing||(o=t.data,i=i.model,null!==o&&i.em()&&(n=i.pa(n),void 0!==n&&i.Gu(o,n))),this.containingGroup=t.containingGroup),ra(this),this.g(\"labeledLink\",e,t)}}},port:{get:function(){return this.Ts(\"\")}},ports:{get:function(){return null===this.rc&&_u(this),this.rc.iteratorValues}},isTreeExpanded:{get:function(){return 0!==(1&this.S)},set:function(t){var e=0!==(1&this.S);if(e!==t){this.S^=1;var i=this.diagram;if(this.g(\"isTreeExpanded\",e,t),e=this.treeExpandedChanged,null!==e){var n=!0;null!==i&&(n=i.da,i.da=!0),e(this),null!==i&&(i.da=n)}null!==i&&i.undoManager.isUndoingRedoing?this.Mb(t):t?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return 0!==(2&this.S)},set:function(t){var e=0!==(2&this.S);e!==t&&(this.S^=2,this.g(\"wasTreeExpanded\",e,t))}},treeExpandedChanged:{get:function(){return this.Cp},set:function(t){var e=this.Cp;e!==t&&(this.Cp=t,this.g(\"treeExpandedChanged\",e,t))}},isTreeLeaf:{get:function(){return 0!==(4&this.S)},set:function(t){var e=0!==(4&this.S);e!==t&&(this.S^=4,this.g(\"isTreeLeaf\",e,t))}}}),Au.prototype.expandTree=Au.prototype.expandTree,Au.prototype.collapseTree=Au.prototype.collapseTree,Au.prototype.findTreeParts=Au.prototype.Yy,Au.prototype.findTreeChildrenNodes=Au.prototype.$u,Au.prototype.findTreeChildrenLinks=Au.prototype.Up,Au.prototype.findTreeLevel=Au.prototype.Wy,Au.prototype.findTreeParentChain=Au.prototype.Xy,Au.prototype.findTreeParentNode=Au.prototype.og,Au.prototype.findTreeParentLink=Au.prototype.Hi,Au.prototype.findCommonTreeParent=Au.prototype.Ky,Au.prototype.findTreeRoot=Au.prototype.Zy,Au.prototype.isInTreeOf=Au.prototype.sz,Au.prototype.findPort=Au.prototype.Ts,Au.prototype.findLinksTo=Au.prototype.Oy,Au.prototype.findLinksBetween=Au.prototype.Ny,Au.prototype.findNodesInto=Au.prototype.Yu,Au.prototype.findNodesOutOf=Au.prototype.Zu,Au.prototype.findNodesConnected=Au.prototype.Xu,Au.prototype.findLinksInto=Au.prototype.sd,Au.prototype.findLinksOutOf=Au.prototype.Sp,Au.prototype.findLinksConnected=Au.prototype.Wu,Au.prototype.invalidateConnectedLinks=Au.prototype.ed,Au.prototype.invalidateLinkBundle=Au.prototype.qz;var Ku=new K(Au,\"SpreadingNone\",10),$u=new K(Au,\"SpreadingEvenly\",11),Wu=new K(Au,\"SpreadingPacked\",12);function Ju(t){Au.call(this,t),this.S|=4608,this.oo=new rt,this.rl=new rt,this.Va=this.tp=this.ji=this.po=this.no=null,this.gc=new hf,this.gc.group=this}function Zu(t,e){if(t.oo.add(e)){e instanceof Ju&&t.rl.add(e);var i=t.memberAdded;if(null!==i){var n=!0,o=t.diagram;null!==o&&(n=o.da,o.da=!0),i(t,e),null!==o&&(o.da=n)}t.isVisible()&&t.isSubGraphExpanded||e.Mb(!1)}e instanceof nc&&!t.computesBoundsIncludingLinks||(e=t.Va,null===e&&(e=t),e.s())}function Qu(t,e){if(t.oo.remove(e)){e instanceof Ju&&t.rl.remove(e);var i=t.memberRemoved;if(null!==i){var n=!0,o=t.diagram;null!==o&&(n=o.da,o.da=!0),i(t,e),null!==o&&(o.da=n)}t.isVisible()&&t.isSubGraphExpanded||e.Mb(!0)}e instanceof nc&&!t.computesBoundsIncludingLinks||(e=t.Va,null===e&&(e=t),e.s())}function tc(t,e,i,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Mb(!1),r instanceof Ju&&r.isSubGraphExpanded&&(r.wasSubGraphExpanded=r.isSubGraphExpanded,tc(r,e,i,n)),r instanceof Au)r.ed(e),i.Jp(r,n);else if(r instanceof nc)for(r=r.labelNodes;r.next();)r.value.ed(e)}t.isSubGraphExpanded=!1}function ec(t,e,i,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Mb(!0),r instanceof Ju&&r.wasSubGraphExpanded&&(r.wasSubGraphExpanded=!1,ec(r,e,i,n)),r instanceof Au)r.ed(e),i.Kp(r,n);else if(r instanceof nc)for(r=r.labelNodes;r.next();)r.value.ed(e)}t.isSubGraphExpanded=!0}function ic(){Ks.call(this),this.eb=oe,this.ep=new _t(NaN,NaN,NaN,NaN)}function nc(){lu.call(this,Nl.Link),this.Ta=8,this.Oe=null,this.Pe=\"\",this.ef=this.Fn=null,this.ff=\"\",this.Bp=null,this.Lm=Tc,this.gn=0,this.kn=Tc,this.ln=NaN,this.Ej=Cc,this.pp=.5,this.$c=null,this.xb=(new nt).freeze(),this.bh=this.Xg=null,this.xl=new _t,this.qa=new Je,this.Qn=!0,this.K=this.u=this.xf=this.Gf=null,this.l=[],this.zu=new mt,this.kr=this.Lw=this.Kw=null,this.au=NaN,this.P=null}function oc(t){var e=t.fromNode,i=t.toNode,n=null;if(n=null!==e?null!==i?e.hx(i):e.containingGroup:null!==i?i.containingGroup:null,e=n,i=t.Rh,i!==e){null!==i&&Qu(i,t),t.Rh=e,null!==e&&Zu(e,t);var o=t.containingGroupChanged;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.da,s.da=!0),o(t,i,e),null!==s&&(s.da=r)}!t.Lc||t.Kw!==i&&t.Lw!==i||t.Ra()}if(t.isLabeledLink)for(t=t.labelNodes;t.next();)t.value.containingGroup=n}function rc(t,e){null===t.$c&&(t.$c=new rt),t.$c.add(e),t.s()}function sc(t,e,i){if(0!==e||0!==i){for(var n=t.Lc,o=new nt,r=t.xb.iterator;r.next();){var s=r.value;o.add(new mt(s.x+e,s.y+i).freeze())}o.freeze(),r=t.xb,t.xb=o,isNaN(e)||isNaN(i)||t.diagram.animationManager.rb?t.s():(t.Of.h(t.Of.x+e,t.Of.y+i),t.sa.h(t.sa.x+e,t.sa.y+i),ra(t)),n&&ac(t),e=t.diagram,null!==e&&e.animationManager.rb&&(t.bh=o),t.g(\"points\",r,o)}}function ac(t){0===t.xb.count?t.Lc=!1:(t.Lc=!0,t.kr=null,t.au=NaN,t.defaultFromPoint=t.i(0),t.defaultToPoint=t.i(t.pointsCount-1),wc(t,!1))}function lc(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?(e.x>=t.x?e.x=t.x+9e9:e.x=t.x-9e9,e.y=t.y):(e.y>=t.y?e.y=t.y+9e9:e.y=t.y-9e9,e.x=t.x),e}function hc(t,e){var i=e.Po;return null===i&&(i=new of,i.port=e,i.node=e.part,e.Po=i),sf(i,t)}function uc(t){return t===le||.5===t.x&&.5===t.y}function cc(t){if(null===t.diagram||!t.isAvoiding||!Gr(t.diagram))return!1;var e=t.points.j,i=e.length;if(4>i)return!1;t=Xr(t.diagram,!0,t.containingGroup,null);for(var n=1;n tf&&Xc(e,h,u)===l-1;)i=h,n=u,0===o?h+=s:90===o?u+=a:180===o?h-=s:u-=a,--l;r?l>tf&&(180===o||0===o?i=Math.floor(i/s)*s+s/2:90!==o&&270!==o||(n=Math.floor(n/a)*a+a/2)):(i=Math.floor(i/s)*s+s/2,n=Math.floor(n/a)*a+a/2),l>tf&&(r=o,h=i,u=n,0===o?(r=90,u+=a):90===o?(r=180,h-=s):180===o?(r=270,u-=a):270===o&&(r=0,h+=s),Xc(e,h,u)===l-1?fc(t,e,h,u,r,!1):(h=i,u=n,0===o?(r=270,u-=a):90===o?(r=0,h+=s):180===o?(r=90,u+=a):270===o&&(r=180,h-=s),Xc(e,h,u)===l-1&&fc(t,e,h,u,r,!1))),t.jf(i,n)}function dc(t,e,i,n){return t=i-t,isNaN(t)||1/0===t||-1/0===t?NaN:(0>t&&(t=-t),e=n-e,isNaN(e)||1/0===e||-1/0===e?NaN:(0>e&&(e=-e),We.ca(t,0)?e:We.ca(e,0)?t:Math.sqrt(t*t+e*e)))}function pc(t,e,i,n){var o=t.pointsCount;if(2>o)return e;if(i){var r=t.i(1);if(i=r.x-n.x,r=r.y-n.y,n=dc(e.x,e.y,i,r),0===n)return e;o=2===o?.5*n:n,t=t.computeShortLength(!0),t>o&&(t=o),o=t*(r-e.y)/n,e.x+=t*(i-e.x)/n,e.y+=o}else{if(r=t.i(o-2),i=r.x-n.x,r=r.y-n.y,n=dc(e.x,e.y,i,r),0===n)return e;o=2===o?.5*n:n,t=t.computeShortLength(!1),t>o&&(t=o),o=t*(e.y-r)/n,e.x-=t*(e.x-i)/n,e.y-=o}return e}function gc(t,e,i,n){for(var o=t.pointsCount,r=e;We.ca(e.x,r.x)&&We.ca(e.y,r.y);){if(i>=o)return o-1;r=t.i(i++)}if(!We.ca(e.x,r.x)&&!We.ca(e.y,r.y))return i-1;for(var s=r;We.ca(e.x,r.x)&&We.ca(r.x,s.x)&&(!n||(e.y>=r.y?r.y>=s.y:r.y<=s.y))||We.ca(e.y,r.y)&&We.ca(r.y,s.y)&&(!n||(e.x>=r.x?r.x>=s.x:r.x<=s.x));){if(i>=o)return o-1;s=t.i(i++)}return i-2}function mc(t,e,i,n,o,r,s){if(!s&&bc(t)){s=[];var a=0;if(t.isVisible()&&(a=vc(t,o,r,s)),0h-10))break;a--,h=Math.max(l-5,r.x)}l=r.y-10+n,h+=i,c=r.y+n,t.curve===Oc?tu(e,h,c,!1):iu(e,u,l,h,l,h,c)}else if(We.w(o.x,r.x))if(o.y l-10))break;a--,l=Math.max(h-5,r.y)}h=r.x-10+i,c=r.x+i,l+=n,t.curve===Oc?tu(e,c,l,!1):iu(e,h,u,h,l,c,l)}}e.lineTo(r.x+i,r.y+n)}function vc(t,e,i,n){var o=t.diagram;if(null===o||e.A(i))return 0;for(o=o.layers;o.next();){var r=o.value;if(null!==r&&r.visible){r=r.Fa.j;for(var s=r.length,a=0;a s.x&&u.x>=h.x||h.xs.y&&u.y>=h.y||h.y s&&Math.min(p,g)u&&!We.w(p,g)){a.x=u,a.y=s,u=!0;break t}}else if(We.w(c,d)&&We.w(p,g)&&Math.min(u,f) p&&Math.min(s,m)
c&&!We.w(s,m)){a.x=p,a.y=c,u=!0;break t}a.x=0,a.y=0,u=!1}u&&(o?i.push(a.x):i.push(a.y)),s=h}mt.free(a)}function bc(t){return t=t.curve,t===Dc||t===Oc}function wc(t,e){(e||bc(t))&&(e=t.diagram,null===e||e.Ui||e.Wh.contains(t)||0===t.xl.width&&0===t.xl.height||e.Wh.add(t,t.xl))}function xc(t,e,i){if(null!==e&&null!==e.qa&&bc(e)){var n=e.routeBounds;n.o()&&(t.routeBounds.Ic(n)||i.Ic(n))&&(t.usesSamePort(e)||e.bc())}}function kc(t){var e=t.Oe;if(null!==e){var i=t.ef;if(null!==i){for(var n=t.Pe,o=t.ff,r=t=null,s=e.Ya.j,a=s.length,l=0;lo&&(o=a.right),a.bottom>r&&(r=a.bottom)}}return isFinite(i)&&isFinite(n)?t.h(i,n,o-i,r-n):(e=e.location,t.h(e.x,e.y,0,0)),t},p.Object.defineProperties(ic.prototype,{padding:{get:function(){return this.eb},set:function(t){\"number\"===typeof t&&(t=new ee(t));var e=this.eb;e.A(t)||(this.eb=t=t.I(),this.g(\"padding\",e,t))}}}),ic.className=\"Placeholder\",d(nc,lu),nc.prototype.cloneProtected=function(t){lu.prototype.cloneProtected.call(this,t),t.Ta=-113&this.Ta,t.Pe=this.Pe,t.Fn=this.Fn,t.ff=this.ff,t.Bp=this.Bp,t.Lm=this.Lm,t.gn=this.gn,t.kn=this.kn,t.ln=this.ln,t.Ej=this.Ej,t.pp=this.pp,null!==this.P&&(t.P=this.P.copy())},i=nc.prototype,i.mf=function(t){lu.prototype.mf.call(this,t),this.Pe=t.Pe,this.ff=t.ff,t.Xg=null,t.Ra(),t.xf=this.xf;var e=t.fromPort;null!==e&&Iu(t.fromNode,e),e=t.toPort,null!==e&&Iu(t.toNode,e)},i.fb=function(t){t.classType===nc?2===(2&t.value)?this.routing=t:t===Lc||t===Oc||t===Dc?this.curve=t:t===jc||t===Ac||t===Bc?this.adjusting=t:t!==Cc&&t!==Tc&&k(\"Unknown Link enum value for a Link property: \"+t):lu.prototype.fb.call(this,t)},i.Hc=function(){null===this.P&&(this.P=new lf)},i.Pi=function(){var t=this.fromNode;if(null!==t){var e=t.findVisibleNode();if(null!==e&&(t=e),ma(t)||xu(t))return!1}return t=this.toNode,null===t||(e=t.findVisibleNode(),null!==e&&(t=e),!ma(t)&&!xu(t))},i.Kv=function(){return!1},i.Lv=function(){},i.Lb=function(){return!1},nc.prototype.computeAngle=function(t,e,i){return nc.computeAngle(e,i)},nc.computeAngle=function(t,e){switch(t){default:case Tc:t=0;break;case zc:t=e;break;case Fc:t=e+90;break;case Ic:t=e-90;break;case Ec:t=e+180;break;case Rc:t=We.gq(e),90 t&&(t-=180);break;case Vc:t=We.gq(e+90),90 t&&(t-=180);break;case _c:t=We.gq(e-90),90 t&&(t-=180);break;case Hc:if(t=We.gq(e),45 t||225 t)return 0;90 t&&(t-=180)}return We.gq(t)},i=nc.prototype,i.yh=function(){var t=this.containingGroup;null!==t&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&lu.prototype.yh.call(this)},i.Xs=function(t){var e=this.fromNode;return t===e?this.toNode:e},i.ez=function(t){var e=this.fromPort;return t===e?this.toPort:e},i.Yp=function(t){if(lu.prototype.Yp.call(this,t),bc(this)&&this.$p(this.actualBounds),!t){t=this.Oe;var e=null;null!==t&&(e=this.fromPort,Eu(t,this,e));var i=this.ef;if(null!==i){var n=this.toPort;i===t&&n===e||Eu(i,this,n)}kc(this)}},i.Zp=function(t){if(lu.prototype.Zp.call(this,t),bc(this)&&this.$p(this.actualBounds),!t){t=this.Oe;var e=null;null!==t&&(e=this.fromPort,Ru(t,this,e));var i=this.ef;if(null!==i){var n=this.toPort;i===t&&n===e||Ru(i,this,n)}Mc(this)}},i.Yj=function(){if(this.Lc=!0,null!==this.$c){var t=this.diagram;if(null!==t)for(var e=this.$c.copy().iterator;e.next();)t.remove(e.value)}null!==this.data&&(t=this.diagram,null!==t&&t.partManager.removeDataForLink(this))},nc.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)}},nc.prototype.move=function(t,e){var i=e?this.location:this.position,n=i.x;isNaN(n)&&(n=0);var o=i.y;for(isNaN(o)&&(o=0),n=t.x-n,o=t.y-o,!0===e?lu.prototype.move.call(this,t,!1):(t=mt.allocAt(i.x+n,i.y+o),lu.prototype.move.call(this,t,!1),mt.free(t)),sc(this,n,o),t=this.labelNodes;t.next();)e=t.value,i=e.position,e.moveTo(i.x+n,i.y+o)},nc.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var t=this.layer;return null===t||!!t.allowRelink&&(t=t.diagram,!(null!==t&&!t.allowRelink))},nc.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var t=this.layer;return null===t||!!t.allowRelink&&(t=t.diagram,!(null!==t&&!t.allowRelink))},nc.prototype.computeMidPoint=function(t){var e=this.pointsCount;if(0===e)return t.assign(zt),t;if(1===e)return t.assign(this.i(0)),t;if(2===e){var i=this.i(0),n=this.i(1);return t.h((i.x+n.x)/2,(i.y+n.y)/2),t}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Lc))return this.qa.cv(.5,t),t.add(this.i(0)),i=this.qa.figures.first(),t.offset(-i.startX,-i.startY),t;if(this.computeCurve()===Lc){if(3===e)return this.i(1);if(n=(e-1)/3|0,i=3*(n/2|0),1===n%2){n=this.i(i);var o=this.i(i+1),r=this.i(i+2);i=this.i(i+3),We.qy(n.x,n.y,o.x,o.y,r.x,r.y,i.x,i.y,t)}else t.assign(this.i(i));return t}var s=this.flattenedLengths;for(i=this.flattenedTotalLength,o=r=n=0;ni/2)break;n+=o,r++}return e=this.i(r),r=this.i(r+1),1>Math.abs(e.x-r.x)?e.y>r.y?t.h(e.x,e.y-(i/2-n)):t.h(e.x,e.y+(i/2-n)):1>Math.abs(e.y-r.y)?e.x>r.x?t.h(e.x-(i/2-n),e.y):t.h(e.x+(i/2-n),e.y):(i=(i/2-n)/o,t.h(e.x+i*(r.x-e.x),e.y+i*(r.y-e.y))),t},nc.prototype.computeMidAngle=function(){var t=this.pointsCount;if(2>t)return NaN;if(2===t)return this.i(0).Wa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Lc)){t:{t=this.qa;var e=.5;if(0>e?e=0:1 =e){e=i[s],i=e[2*t],n=e[2*t+1],o=e[2*t+2],t=e[2*t+3],t=1>Math.abs(o-i)&&1>Math.abs(t-n)?0:1>Math.abs(o-i)?0<=t-n?90:270:1>Math.abs(t-n)?0<=o-i?0:180:180*Math.atan2(t-n,o-i)/Math.PI;break t}r+=h}}t=NaN}}return t}if(this.computeCurve()===Lc&&4<=t){if(n=(t-1)/3|0,i=3*(n/2|0),1===n%2)return i=Math.floor(i),t=this.i(i),n=this.i(i+1),o=this.i(i+2),i=this.i(i+3),We.py(t.x,t.y,n.x,n.y,o.x,o.y,i.x,i.y);if(0o/2)break;e+=r,i++}if(n=this.i(i),o=this.i(i+1),1>Math.abs(n.x-o.x)&&1>Math.abs(n.y-o.y)){if(0Math.abs(n.x-o.x))return n.y>o.y?270:90;if(1>Math.abs(n.y-o.y))return n.x>o.x?180:0}return n.Wa(o)},i=nc.prototype,i.i=function(t){return this.xb.j[t]},i.jd=function(t,e){this.xb.gd(t,e)},i.M=function(t,e,i){this.xb.gd(t,new mt(e,i))},i.oz=function(t,e){this.xb.Ib(t,e)},i.m=function(t,e,i){this.xb.Ib(t,new mt(e,i))},i.xe=function(t){this.xb.add(t)},i.jf=function(t,e){this.xb.add(new mt(t,e))},i.zv=function(t){this.xb.mb(t)},i.Tj=function(){this.xb.clear()},i.Bh=function(){null===this.Xg&&(this.Xg=this.xb,this.xb=this.xb.copy())},i.kf=function(){if(null!==this.Xg){for(var t=this.Xg,e=this.xb,i=1/0,n=1/0,o=t.j,r=o.length,s=0;s h&&(c=-c),g=(0>l?-1:1)*c+d,m=u*(g-d)+p),d=s.x+2*a/3,p=s.y+2*l/3;var v=d,y=p;We.w(l,0)?y=0l?-1:1)*c+d,y=u*(v-d)+p),this.Tj(),this.xe(s),this.jf(g,m),this.jf(v,y),this.xe(f),this.jd(0,this.getLinkPoint(e,i,n,!0,!1,o,r)),this.jd(3,this.getLinkPoint(o,r,t,!1,!1,e,i))}else n=this.getLinkPoint(e,i,n,!0,!1,o,r),t=this.getLinkPoint(o,r,t,!1,!1,e,i),this.hasCurviness()?(f=t.x-n.x,o=t.y-n.y,r=this.computeCurviness(),e=n.x+f/2,i=n.y+o/2,s=e,a=i,We.w(o,0)?a=0 r&&(s=-s),s=(0>o?-1:1)*s+e,a=f*(s-e)+i),this.xe(n),this.jf(s,a)):this.xe(n),this.xe(t)}else{c=this.isAvoiding,f&&(u&&c||h)&&this.Tj();var b=h?this.computeCurviness():0;c=this.getLinkPoint(e,i,n,!0,u,o,r),d=g=p=0,(u||!a||h)&&(m=this.computeEndSegmentLength(e,i,n,!0),d=this.getLinkDirection(e,i,c,n,!0,u,o,r),h&&(a||n.A(t)||!u&&1===n.x+t.x&&1===n.y+t.y)&&(d-=u?90:30,0>b&&(d-=180)),0>d?d+=360:360<=d&&(d-=360),h&&(m+=Math.abs(b)*(u?1:2)),0===d?p=m:90===d?g=m:180===d?p=-m:270===d?g=-m:(p=m*Math.cos(d*Math.PI/180),g=m*Math.sin(d*Math.PI/180)),n.jc()&&h&&(m=i.ma(de,mt.alloc()),v=mt.allocAt(m.x+1e3*p,m.y+1e3*g),this.getLinkPointFromPoint(e,i,m,v,!0,c),mt.free(m),mt.free(v))),m=this.getLinkPoint(o,r,t,!1,u,e,i);var w=y=v=0;if(u||!l||h){var x=this.computeEndSegmentLength(o,r,t,!1);w=this.getLinkDirection(o,r,m,t,!1,u,e,i),h&&(l||n.A(t)||!u&&1===n.x+t.x&&1===n.y+t.y)&&(w+=u?0:30,0>b&&(w+=180)),0>w?w+=360:360<=w&&(w-=360),h&&(x+=Math.abs(b)*(u?1:2)),0===w?v=x:90===w?y=x:180===w?v=-x:270===w?y=-x:(v=x*Math.cos(w*Math.PI/180),y=x*Math.sin(w*Math.PI/180)),t.jc()&&h&&(t=r.ma(de,mt.alloc()),n=mt.allocAt(t.x+1e3*v,t.y+1e3*y),this.getLinkPointFromPoint(o,r,t,n,!1,m),mt.free(t),mt.free(n))}t=c,(u||!a||h)&&(t=new mt(c.x+p,c.y+g)),n=m,(u||!l||h)&&(n=new mt(m.x+v,m.y+y)),!f&&!u&&a&&3 =u.y&&t.y<=u.y+u.height?a.y=t.y:(i.pf(ye)||i.pf(xe))&&t.x>=u.x&&t.x<=u.x+u.width&&(a.x=t.x),mt.free(l),mt.free(h)}}return a}}return i=e.ma(.5===i.x&&.5===i.y?i:de,mt.alloc()),this.pointsCount>(o?6:2)?(s=n?this.i(1):this.i(this.pointsCount-2),o&&(s=lc(i,s.copy()))):(l=this.computeSpot(!n,s),r=mt.alloc(),s=s.ma(.5===l.x&&.5===l.y?l:de,r),o&&(s=lc(i,s)),mt.free(r)),this.getLinkPointFromPoint(t,e,i,s,n,a),mt.free(i),a},nc.prototype.getLinkDirection=function(t,e,i,n,o,r,s,a){t:if(n.gb())var l=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x