/* * GoJS v2.1.26 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. * Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.26/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function aa(a){var b=0;return function(){return bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c=a.length?a.push(c):a.splice(b,0,c):B("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Da(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):B("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Fa(){var a=Ga.pop();return void 0===a?[]:a}function Ha(a){a.length=0;Ga.push(a)} function Ia(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(za(a)&&a.constructor)return Ia(a.constructor);return typeof a} function Ja(a){var b=a;za(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function Ka(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.LA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function La(a,b,c){Object.defineProperty(Oa.prototype,a,{get:b,set:c})}function Pa(){var a=Qa;if(0===a.length)for(var b=x.document.getElementsByTagName("canvas"),c=b.length,d=0;dc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;ec;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;gthis.key)return!1;a=a.j;var b=a.length,c=++this.Oa,d=this.$e;if(null!==d)for(;cthis.key)return!1;var b=--this.Oa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Ed();return!1};kb.prototype.ed=function(){return this.next()}; kb.prototype.first=function(){var a=this.pb;this.ia=a.Aa;var b=a.j;this.Oa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};kb.prototype.any=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};kb.prototype.all=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; kb.prototype.each=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)a(b[c]);return this};kb.prototype.map=function(a){var b=this.pb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.lb();return a.iterator};kb.prototype.filter=function(a){var b=this.pb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.lb();return a.iterator}; kb.prototype.Ed=function(){this.key=-1;this.value=null;this.ia=-1;this.pb.Zg=this};kb.prototype.toString=function(){return"ListIteratorBackwards("+this.Oa+"/"+this.pb.count+")"};ma.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.pb.j.length}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.ed;kb.prototype.next=kb.prototype.next;kb.prototype.reset=kb.prototype.reset; kb.className="ListIteratorBackwards";function E(a){Ya(this);this.s=!1;this.j=[];this.Aa=0;this.Zg=this.Ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=E.prototype;t.lb=function(){var a=this.Aa;a++;999999999a||a>=b.length)&&va(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.hd=function(a,b){var c=this.j;(0>a||a>=c.length)&&va(a,"0 <= i < length",E,"setElt:i");this.s&&ua(this,a);c[a]=b};t.set=function(a,b){this.hd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Xb=function(){var a=this.j,b=a.length;return 0a&&va(a,">= 0",E,"insertAt:i");this.s&&ua(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.lb()};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=this.j;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.ab=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"removeAt:i");this.s&&ua(this,a);a===b.length-1?b.pop():b.splice(a,1);this.lb()};t.removeRange=function(a,b){var c=this.j,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.s&&ua(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&va(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a=e)for(c=d.slice(b),c.sort(a),a=b;a=this.j.length)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new jb(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return fb;var a=this.Zg;return null!==a?(a.reset(),a):new kb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.hj;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.xw;E.prototype.toArray=E.prototype.na;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.ab;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.ub; E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Xb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.hd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.L;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ea; E.prototype.freeze=E.prototype.freeze;E.className="List";function mb(a){this.og=a;a.Ga=null;this.ia=a.Aa;this.la=null}mb.prototype.reset=function(){var a=this.og;a.Ga=null;this.ia=a.Aa;this.la=null};mb.prototype.next=function(){var a=this.og;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Ed();return!1};mb.prototype.ed=function(){return this.next()}; mb.prototype.first=function(){var a=this.og;this.ia=a.Aa;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};mb.prototype.any=function(a){var b=this.og;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};mb.prototype.all=function(a){var b=this.og;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};mb.prototype.each=function(a){var b=this.og;this.la=b.Ga=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; mb.prototype.map=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};mb.prototype.filter=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};mb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1;this.og.Ga=this};mb.prototype.toString=function(){return null!==this.la?"SetIterator@"+this.la.value:"SetIterator"}; ma.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.og.Eb}}});mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.ed;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="SetIterator"; function F(a){Ya(this);this.s=!1;this.Gb={};this.Eb=0;this.Ga=null;this.Aa=0;this.Ue=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=F.prototype;t.lb=function(){var a=this.Aa;a++;999999999=this.Eb)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new mb(this)}}});F.prototype.toList=F.prototype.ww;F.prototype.toArray=F.prototype.na;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.wA;F.prototype.removeAll=F.prototype.Nq; F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.fz;F.prototype.containsAll=F.prototype.ez;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.addAll=F.prototype.addAll;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ea;F.prototype.freeze=F.prototype.freeze;var pb=1;F.className="Set";F.uniqueHash=Ya;F.hashIdUnique=nb;F.hashId=lb; function qb(a){this.fa=a;this.ia=a.Aa;this.la=null}qb.prototype.reset=function(){this.ia=this.fa.Aa;this.la=null};qb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=this.key=a=b.key,!0;this.Ed();return!1};qb.prototype.ed=function(){return this.next()};qb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;return null!==a?(this.la=a,this.value=this.key=a=a.key):null}; qb.prototype.any=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};qb.prototype.all=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};qb.prototype.each=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};qb.prototype.map=function(a){var b=this.fa;this.la=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator}; qb.prototype.filter=function(a){var b=this.fa;this.la=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};qb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1};qb.prototype.toString=function(){return null!==this.la?"MapKeySetIterator@"+this.la.value:"MapKeySetIterator"};ma.Object.defineProperties(qb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Eb}}}); qb.prototype.first=qb.prototype.first;qb.prototype.hasNext=qb.prototype.ed;qb.prototype.next=qb.prototype.next;qb.prototype.reset=qb.prototype.reset;qb.className="MapKeySetIterator";function rb(a){F.call(this);Ya(this);this.s=!0;this.fa=a}la(rb,F);t=rb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.fa.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.fa.contains(a)}; t.has=function(a){return this.contains(a)};t.remove=function(){B("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){B("This Set is read-only: "+this.toString())};t.first=function(){var a=this.fa.ba;return null!==a?a.key:null};rb.prototype.any=function(a){for(var b=this.fa.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};rb.prototype.all=function(a){for(var b=this.fa.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0}; rb.prototype.each=function(a){for(var b=this.fa.ba;null!==b;)a(b.key),b=b.oa;return this};rb.prototype.map=function(a){for(var b=new F,c=this.fa.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};rb.prototype.filter=function(a){for(var b=new F,c=this.fa.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};rb.prototype.copy=function(){return new rb(this.fa)};rb.prototype.xw=function(){var a=new F,b=this.fa.Gb,c;for(c in b)a.add(b[c].key);return a}; rb.prototype.na=function(){var a=this.fa.Gb,b=Array(this.fa.Eb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};rb.prototype.ww=function(){var a=new E,b=this.fa.Gb,c;for(c in b)a.add(b[c].key);return a};ma.Object.defineProperties(rb.prototype,{count:{get:function(){return this.fa.Eb}},size:{get:function(){return this.fa.Eb}},iterator:{get:function(){return 0>=this.fa.Eb?fb:new qb(this.fa)}}}); rb.prototype.toList=rb.prototype.ww;rb.prototype.toArray=rb.prototype.na;rb.prototype.toSet=rb.prototype.xw;rb.prototype.first=rb.prototype.first;rb.prototype.clear=rb.prototype.clear;rb.prototype["delete"]=rb.prototype.delete;rb.prototype.remove=rb.prototype.remove;rb.prototype.has=rb.prototype.has;rb.prototype.contains=rb.prototype.contains;rb.prototype.add=rb.prototype.add;rb.prototype.thaw=rb.prototype.ea;rb.prototype.freeze=rb.prototype.freeze;rb.className="MapKeySet"; function sb(a){this.fa=a;a.Te=null;this.ia=a.Aa;this.la=null}sb.prototype.reset=function(){var a=this.fa;a.Te=null;this.ia=a.Aa;this.la=null};sb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Ed();return!1};sb.prototype.ed=function(){return this.next()}; sb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};sb.prototype.any=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};sb.prototype.all=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};sb.prototype.each=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; sb.prototype.map=function(a){var b=this.fa;this.la=b.Te=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};sb.prototype.filter=function(a){var b=this.fa;this.la=b.Te=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};sb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1;this.fa.Te=this};sb.prototype.toString=function(){return null!==this.la?"MapValueSetIterator@"+this.la.value:"MapValueSetIterator"}; ma.Object.defineProperties(sb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Eb}}});sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.ed;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapValueSetIterator";function ob(a,b){this.key=a;this.value=b;this.El=this.oa=null}ob.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; ob.className="KeyValuePair";function tb(a){this.fa=a;a.Ga=null;this.ia=a.Aa;this.la=null}tb.prototype.reset=function(){var a=this.fa;a.Ga=null;this.ia=a.Aa;this.la=null};tb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.key=b.key,this.value=b.value,!0;this.Ed();return!1};tb.prototype.ed=function(){return this.next()}; tb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;return null!==a?(this.la=a,this.key=a.key,this.value=a.value,a):null};tb.prototype.any=function(a){var b=this.fa;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};tb.prototype.all=function(a){var b=this.fa;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};tb.prototype.each=function(a){var b=this.fa;this.la=b.Ga=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this}; tb.prototype.map=function(a){var b=this.fa;this.la=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};tb.prototype.filter=function(a){var b=this.fa;this.la=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};tb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1;this.fa.Ga=this};tb.prototype.toString=function(){return null!==this.la?"MapIterator@"+this.la:"MapIterator"}; ma.Object.defineProperties(tb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Eb}}});tb.prototype.first=tb.prototype.first;tb.prototype.hasNext=tb.prototype.ed;tb.prototype.next=tb.prototype.next;tb.prototype.reset=tb.prototype.reset;tb.className="MapIterator"; function H(a){Ya(this);this.s=!1;this.Gb={};this.Eb=0;this.Te=this.Ga=null;this.Aa=0;this.Ue=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=H.prototype;t.lb=function(){var a=this.Aa;a++;999999999=this.count)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new tb(this)}},iteratorKeys:{get:function(){return 0>=this.count?fb:new qb(this)}},iteratorValues:{get:function(){if(0>=this.count)return fb; var a=this.Te;return null!==a?(a.reset(),a):new sb(this)}}});H.prototype.toKeySet=H.prototype.Df;H.prototype.toArray=H.prototype.na;H.prototype.clear=H.prototype.clear;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.get=H.prototype.get;H.prototype.getValue=H.prototype.H;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.first=H.prototype.first;H.prototype.addAll=H.prototype.addAll;H.prototype.set=H.prototype.set; H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ea;H.prototype.freeze=H.prototype.freeze;H.className="Map";function I(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}I.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.h=function(a,b){this.x=a;this.y=b;return this};I.prototype.Bg=function(a,b){this.x=a;this.y=b;return this}; I.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.copy=function(){var a=new I;a.x=this.x;a.y=this.y;return a};t=I.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function ub(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new I(c,e)}return new I}function vb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.w=function(a){return a instanceof I?this.x===a.x&&this.y===a.y:!1};t.Vi=function(a,b){return this.x===a&&this.y===b};t.Ma=function(a){return K.A(this.x,a.x)&&K.A(this.y,a.y)}; t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.be=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};I.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=I.prototype; t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.De=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.dd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}t.pA=function(a,b,c,d){K.Kh(a,b,c,d,this.x,this.y,this);return this};t.qA=function(a,b){K.Kh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.CA=function(a,b,c,d){K.sq(this.x,this.y,a,b,c,d,this);return this};t.DA=function(a,b){K.sq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this}; t.gj=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};t.zk=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ra(this);return this};function Ab(a,b){b.Xd(a);return a}function Bb(a,b,c,d,e,f){var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k}function Cb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b} function Db(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}t.v=function(){return isFinite(this.x)&&isFinite(this.y)};I.alloc=function(){var a=Fb.pop();return void 0===a?new I:a};I.allocAt=function(a,b){var c=Fb.pop();if(void 0===c)return new I(a,b);c.x=a;c.y=b;return c};I.free=function(a){Fb.push(a)};I.prototype.isReal=I.prototype.v; I.prototype.setSpot=I.prototype.zk;I.prototype.setRectSpot=I.prototype.gj;I.prototype.snapToGridPoint=I.prototype.DA;I.prototype.snapToGrid=I.prototype.CA;I.prototype.projectOntoLineSegmentPoint=I.prototype.qA;I.prototype.projectOntoLineSegment=I.prototype.pA;I.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return K.Aq(a,b,c,d,e,f,g,h)};I.prototype.direction=I.prototype.direction;I.prototype.directionPoint=I.prototype.Sa;I.prototype.normalize=I.prototype.normalize; I.prototype.distanceSquared=I.prototype.dd;I.prototype.distanceSquaredPoint=I.prototype.De;I.prototype.scale=I.prototype.scale;I.prototype.rotate=I.prototype.rotate;I.prototype.offset=I.prototype.offset;I.prototype.subtract=I.prototype.be;I.prototype.add=I.prototype.add;I.prototype.equalsApprox=I.prototype.Ma;I.prototype.equalTo=I.prototype.Vi;I.prototype.equals=I.prototype.w;I.prototype.set=I.prototype.set;I.prototype.setTo=I.prototype.Bg;var Gb=null,Hb=null,Ib=null,Jb=null,Kb=null,Fb=[]; I.className="Point";I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=Bb;I.distanceSquared=Cb;I.direction=Db;I.Origin=Gb=(new I(0,0)).ca();I.InfiniteTopLeft=Hb=(new I(-Infinity,-Infinity)).ca();I.InfiniteBottomRight=Ib=(new I(Infinity,Infinity)).ca();I.SixPoint=Jb=(new I(6,6)).ca();I.NoPoint=Kb=(new I(NaN,NaN)).ca();I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=Bb;I.distanceSquared=Cb;I.direction=Db; function M(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Lb,Mb,Nb,Ob,Pb,Qb,Rb;M.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.h=function(a,b){this.width=a;this.height=b;return this};M.prototype.Bg=function(a,b){this.width=a;this.height=b;return this}; M.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function Sb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new M(c,e)}return new M}function Tb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.w=function(a){return a instanceof M?this.width===a.width&&this.height===a.height:!1};t.Vi=function(a,b){return this.width===a&&this.height===b}; t.Ma=function(a){return K.A(this.width,a.width)&&K.A(this.height,a.height)};t.v=function(){return isFinite(this.width)&&isFinite(this.height)};M.alloc=function(){var a=Ub.pop();return void 0===a?new M:a};M.free=function(a){Ub.push(a)};M.prototype.isReal=M.prototype.v;M.prototype.equalsApprox=M.prototype.Ma;M.prototype.equalTo=M.prototype.Vi;M.prototype.equals=M.prototype.w;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Bg;var Ub=[];M.className="Size";M.parse=Sb;M.stringify=Tb; M.ZeroSize=Lb=(new M(0,0)).ca();M.OneSize=Mb=(new M(1,1)).ca();M.SixSize=Nb=(new M(6,6)).ca();M.EightSize=Ob=(new M(8,8)).ca();M.TenSize=Pb=(new M(10,10)).ca();M.InfiniteSize=Qb=(new M(Infinity,Infinity)).ca();M.NoSize=Rb=(new M(NaN,NaN)).ca();M.parse=Sb;M.stringify=Tb; function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof I?(c=a.x,a=a.y,b instanceof I?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof M?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):B("Incorrect arguments supplied to Rect constructor")):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c, this.height=d):B("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Vb(a,b,c){a.width=b;a.height=c}t.Bg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this}; t.jd=function(a){this.x=a.x;this.y=a.y;return this};t.AA=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this}; t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function Wb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new N(c,e,f,g)}return new N} function Zb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.w=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Vi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ma=function(a){return K.A(this.x,a.x)&&K.A(this.y,a.y)&&K.A(this.width,a.width)&&K.A(this.height,a.height)}; function $b(a,b){return K.$(a.x,b.x)&&K.$(a.y,b.y)&&K.$(a.width,b.width)&&K.$(a.height,b.height)}t.aa=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Ce=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};t.offset=function(a,b){this.x+=a;this.y+=b;return this}; t.Fc=function(a,b){return ac(this,b,a,b,a)};t.iq=function(a){return ac(this,a.top,a.right,a.bottom,a.left)};t.vw=function(a){return ac(this,-a.top,-a.right,-a.bottom,-a.left)};t.Tz=function(a,b,c,d){return ac(this,a,b,c,d)};function ac(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.Xz=function(a){return bc(this,a.x,a.y,a.width,a.height)};t.Nv=function(a,b,c,d){return bc(this,a,b,c,d)}; function bc(a,b,c,d,e){var f=Math.max(a.x,b),g=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Ic=function(a){return this.Ov(a.x,a.y,a.width,a.height)};t.Ov=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function dc(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ie=function(a){return ec(this,a.x,a.y,0,0)};t.Jc=function(a){return ec(this,a.x,a.y,a.width,a.height)};t.Cw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ec(this,a,b,c,d)}; function ec(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.zk=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function fc(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}function gc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0} t.v=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Zz=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=hc.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=hc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){hc.push(a)}; ma.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{ get:function(){return new I(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new M(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new I(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2}, set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.Zz;N.prototype.isReal=N.prototype.v;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return K.iy(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.zk;N.prototype.union=N.prototype.Cw;N.prototype.unionRect=N.prototype.Jc;N.prototype.unionPoint=N.prototype.Ie;N.prototype.intersects=N.prototype.Ov; N.prototype.intersectsRect=N.prototype.Ic;N.prototype.intersect=N.prototype.Nv;N.prototype.intersectRect=N.prototype.Xz;N.prototype.grow=N.prototype.Tz;N.prototype.subtractMargin=N.prototype.vw;N.prototype.addMargin=N.prototype.iq;N.prototype.inflate=N.prototype.Fc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Ce;N.prototype.containsPoint=N.prototype.aa;N.prototype.equalsApprox=N.prototype.Ma;N.prototype.equalTo=N.prototype.Vi; N.prototype.equals=N.prototype.w;N.prototype.setSize=N.prototype.AA;N.prototype.setPoint=N.prototype.jd;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.Bg;var ic=null,jc=null,hc=[];N.className="Rect";N.parse=Wb;N.stringify=Zb;N.contains=fc;N.intersects=gc;N.ZeroRect=ic=(new N(0,0,0,0)).ca();N.NoRect=jc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Wb;N.stringify=Zb;N.contains=fc;N.intersects=gc; function oc(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):B("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}oc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; oc.prototype.Bg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};oc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};oc.prototype.copy=function(){var a=new oc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=oc.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()}; t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function pc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new oc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new oc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new oc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new oc(c,e):new oc(c,e,f,g)}return new oc} function qc(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.w=function(a){return a instanceof oc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.Vi=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d}; t.Ma=function(a){return K.A(this.top,a.top)&&K.A(this.right,a.right)&&K.A(this.bottom,a.bottom)&&K.A(this.left,a.left)};t.v=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};oc.alloc=function(){var a=rc.pop();return void 0===a?new oc:a};oc.free=function(a){rc.push(a)};oc.prototype.isReal=oc.prototype.v;oc.prototype.equalsApprox=oc.prototype.Ma;oc.prototype.equalTo=oc.prototype.Vi;oc.prototype.equals=oc.prototype.w;oc.prototype.set=oc.prototype.set; oc.prototype.setTo=oc.prototype.Bg;var sc=null,tc=null,rc=[];oc.className="Margin";oc.parse=pc;oc.stringify=qc;oc.ZeroMargin=sc=(new oc(0,0,0,0)).ca();oc.TwoMargin=tc=(new oc(2,2,2,2)).ca();oc.parse=pc;oc.stringify=qc;function P(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.s=!1} var uc,vc,wc,yc,zc,Ac,Bc,Cc,Dc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Pc,Qc,Rc,Sc,Tc,Uc,Vc,Zc,$c,ad,bd,cd,dd,ed,fd,gd,hd,id,jd;P.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};P.prototype.Bg=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};P.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this}; P.prototype.copy=function(){var a=new P;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};t=P.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function kd(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a} function ld(a){if("string"===typeof a){a=a.trim();if("None"===a)return uc;if("TopLeft"===a)return vc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return wc;if("TopRight"===a)return yc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return zc;if("Center"===a)return Ac;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Bc;if("BottomLeft"===a)return Cc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Dc;if("BottomRight"===a)return Gc;if("TopSide"===a)return Hc;if("LeftSide"=== a)return Ic;if("RightSide"===a)return Jc;if("BottomSide"===a)return Kc;if("TopBottomSides"===a)return Lc;if("LeftRightSides"===a)return Mc;if("TopLeftSides"===a)return Nc;if("TopRightSides"===a)return Pc;if("BottomLeftSides"===a)return Qc;if("BottomRightSides"===a)return Rc;if("NotTopSide"===a)return Sc;if("NotLeftSide"===a)return Tc;if("NotRightSide"===a)return Uc;if("NotBottomSide"===a)return Vc;if("AllSides"===a)return Zc;if("Default"===a)return $c;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=qd.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.ra=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Xd=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.Bw=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};qd.alloc=function(){var a=rd.pop();return void 0===a?new qd:a}; qd.free=function(a){rd.push(a)};qd.prototype.transformRect=qd.prototype.Bw;qd.prototype.invertedTransformPoint=qd.prototype.Xd;qd.prototype.transformPoint=qd.prototype.ra;qd.prototype.scale=qd.prototype.scale;qd.prototype.translate=qd.prototype.translate;qd.prototype.rotate=qd.prototype.rotate;qd.prototype.invert=qd.prototype.Et;qd.prototype.multiplyInverted=qd.prototype.Vv;qd.prototype.multiply=qd.prototype.multiply;qd.prototype.reset=qd.prototype.reset;qd.prototype.isIdentity=qd.prototype.Ft; qd.prototype.equals=qd.prototype.w;qd.prototype.set=qd.prototype.set;var rd=[];qd.className="Transform";qd.xF="54a702f3e53909c447824c6706603faf4c"; var K={JA:"7da71ca0ad381e90",Eg:(Math.sqrt(2)-1)/3*4,Rw:null,sqrt:function(a){if(0>=a)return 0;var b=K.Rw;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.Rw=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},A:function(a,b){a-=b;return.5>a&&-.5a&&-5E-8=e&&(e=1E-6);if(am-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},lt:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Ob(a,b,g,h,n,c,d)&&K.Ob(a,b,g,h,n,e,f))return K.Ob(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var v=(d+q)/2,w=(c+u)/2;return K.lt(a, b,p,r,d,c,v,w,k,l,m,n)||K.lt(v,w,q,u,e,f,g,h,k,l,m,n)},az:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},$y:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Db(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},dm:function(a,b,c,d,e,f,g,h,k,l){if(K.Ob(a,b,g,h,k,c,d)&&K.Ob(a,b,g,h,k,e,f))ec(l,a,b,0,0),ec(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/ 2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;K.dm(a,b,m,n,d,c,q,u,k,l);K.dm(q,u,p,r,e,f,g,h,k,l)}return l},Be:function(a,b,c,d,e,f,g,h,k,l){if(K.Ob(a,b,g,h,k,c,d)&&K.Ob(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;K.Be(a,b,m,n,d,c,q,u,k,l);K.Be(q,u,p,r,e,f,g,h,k,l)}return l},bw:function(a,b,c,d,e,f,g,h,k,l){if(K.Ob(a,b,e,f,l,c,d))return K.Ob(a, b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return K.bw(a,b,m,n,p,r,g,h,k,l)||K.bw(p,r,c,d,e,f,g,h,k,l)},PA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},aw:function(a,b,c,d,e,f,g,h){if(K.Ob(a,b,e,f,g,c,d))ec(h,a,b,0,0),ec(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.aw(a,b,k,l,m,n,g,h);K.aw(m,n,c,d,e,f,g,h)}return h},Kq:function(a,b,c,d,e,f,g,h){if(K.Ob(a,b,e,f,g,c,d))0===h.length&&(h.push(a), h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.Kq(a,b,k,l,m,n,g,h);K.Kq(m,n,c,d,e,f,g,h)}return h},kq:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(K.Ob(a,b,g,h,p,c,d)&&K.Ob(a,b,g,h,p,e,f)){if(ak&&g>k&&a>m&&g>m||bl&&h>l&&b>n&&h>n)return!1;var q=(a-g)*(l-n)-(b-h)*(k-m);if(0===q)return!1;p=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/q;q=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/q;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(bh)return!1}else if(ag)return!1;r.h(p,q);return!0}q=(a+c)/2;var u=(b+d)/2,v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/2;w=(w+f)/2;var y=(d+v)/2,z=(c+w)/2,A=(m-k)*(m-k)+(n-l)*(n-l),C=!1,G=0,L=0;K.kq(a,b,q,u,d,c,y,z,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a=m)return r;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(bb)return r}else if(aa)return r;0p&&r--}else{q=(a+c)/2;u=(b+d)/2;var v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/2;w=(w+f)/2;var y=(d+v)/2,z=(c+w)/2;r+=K.lq(a,b,q,u,d,c,y,z,k,l,m,n,p); r+=K.lq(y,z,v,w,e,f,g,h,k,l,m,n,p)}return r},Kh:function(a,b,c,d,e,f,g){if(K.$(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(K.$(b,d)){aa)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005b)return k.h(a,b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(K.$(h,g))return K.Kh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.$(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return K.Kh(a,b,c,d,e,g*(e-a)+b,k)},OA:function(a,b,c,d,e){return K.Ge(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},NA:function(a, b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c* a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k},Vc:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Ge(a,b,a,d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},MA:function(a,b,c,d,e,f,g,h,k){c=a-c;g=e-g;0===c||0===g?0===c?(b=(f-h)/g,h=a,e=b*h+(f-b*e)):(f=(b-d)/c,h=e,e=f*h+(b-f*a)):(d=(b-d)/c,h=(f-h)/g,a=b-d*a,h=(f-h*e-a)/(d-h),e=d*h+a);k.h(h,e);return k},Ct:function(a,b,c){return K.iy(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},iy:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f=b):f===h?(e=a):fc(a,b,c,d,e,f)||fc(a,b,c,d,g,h)||K.Aq(a,b,k,b,e,f,g,h)|| K.Aq(k,b,k,l,e,f,g,h)||K.Aq(k,l,a,l,e,f,g,h)||K.Aq(a,l,a,b,e,f,g,h)?!0:!1},Aq:function(a,b,c,d,e,f,g,h){return 0>=K.ot(a,b,c,d,e,f)*K.ot(a,b,c,d,g,h)&&0>=K.ot(e,f,g,h,a,b)*K.ot(e,f,g,h,c,d)},ot:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return 0>f?-1:0a&&(a+=360);360<=a&&(a-=360);return a},Ox:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e- d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f;for(;1E-5c,f=0>d;if(al;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=m*m+n*n-1;if(0m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,fa?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case zd:var b=new N(this.startX,this.startY,0,0);b.Cw(this.endX,this.endY,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 Hd:b=new N(this.startX,this.startY,0,0);b.Cw(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.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 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case td:b="";c=this.figures.j;for(var d=c.length,e=0;e=A-1?!0:null!==k[u+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){u++;return k[u]}function e(){var a=new I(parseFloat(d()),parseFloat(d()));v===v.toLowerCase()&&(a.x=z.x+a.x,a.y=z.y+a.y);return a}function f(){return z=e()}function g(){return y=e()}function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?z:new I(2*z.x-y.x,2*z.y-y.y)}void 0===b&&(b=!1);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,"");var k=a.split(" ");for(a=0;a=A-1);)if(w=v,v=d(),""!==v)switch(v.toUpperCase()){case "X":p=!0;n=l=!1;break;case "M":r=f();null===a.fc||!0===p?(Kd(a,r.x,r.y,l,!n),p=!1):a.moveTo(r.x,r.y);for(m=z;!c();)r=f(),a.lineTo(r.x,r.y);break; case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)z=new I((v===v.toLowerCase()?z.x:0)+parseFloat(d()),z.y),a.lineTo(z.x,z.y);break;case "V":for(;!c();)z=new I(z.x,(v===v.toLowerCase()?z.y:0)+parseFloat(d())),a.lineTo(z.x,z.y);break;case "C":for(;!c();){r=e();q=g();var C=f();Ld(a,r.x,r.y,q.x,q.y,C.x,C.y)}break;case "S":for(;!c();)r=h(),q=g(),C=f(),Ld(a,r.x,r.y,q.x,q.y,C.x,C.y);break;case "Q":for(;!c();)r=g(),q=f(),Md(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)y=r=h(),q=f(),Md(a, r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d());q=parseFloat(d());C=parseFloat(d());var G=parseFloat(d()),L=parseFloat(d()),J=L,U=!1;c()||(J=parseFloat(d()),c()||(U=0!==parseFloat(d())));v===v.toLowerCase()&&(C+=z.x,G+=z.y);a.arcTo(r,q,C,G,L,J,U)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),C=parseFloat(d()),G=!!parseFloat(d()),L=!!parseFloat(d()),J=f(),Rd(a,r,q,C,G,L,J.x,J.y);break;case "Z":Sd(a);z=m;break;case "F":r="";for(q=1;k[u+q];)if(null!== k[u+q].match(/[Uu]/))q++;else if(null===k[u+q].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))q++;else{r=k[u+q];break}r.match(/[Mm]/)?l=!0:0g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle);0>d&& (q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case $d:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c);q.radiusY*=Math.sqrt(b*b+d*d);break;default:B("Unknown Segment type: "+ q.type)}}}}this.qa=!0;return this}; t.aa=function(a,b){void 0===b&&(b=0);var c=this.Sc,d=this.Tc,e=this.ec,f=this.nc;switch(this.type){case vd:return K.Ob(c,d,e,f,b,a.x,a.y);case zd:var g=N.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.aa(a);N.free(g);return a;case Hd:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case td:return ce(this,a,b,!0,!1);default:return!1}}; function ce(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.j,r=p.length,q=0;q=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(fh)return 0}else{if(bf)return 0}else if(eg)return 0}else if(le)return 0;return 0a?a=0:1=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; t.Zx=function(a){0>a?a=0:1=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; t.Jv=function(a,b){0>a?a=0:1=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2*a+ 3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; t.$x=function(a){if(this.type===vd){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=I.alloc();K.Kh(b,c,d,e,f,a,h);a=h.x;f=h.y;I.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===zd){g=this.startX;h=this.startY;var k=this.endX; e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=I.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;na?0:1a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.j,d=c.length,e=0;ea&&(a+=360),this.xe=a,this.Hi=0,this.Ii=Math.max(d,0),this.hh=Math.max(e,0),this.tl="boolean"===typeof g?g:"number"===typeof g?!!g:!1,this.Mk=!!h):(this.xe=d,this.Hi=e,a===Zd&&(f=Math.max(f,0)),this.Ii=f,"number"===typeof g?(a===Zd&&(g=Math.max(g,0)),this.hh=g):this.hh=0, this.Mk=this.tl=!1);this.zj=!1;this.qa=!0;this.Le=null}oe.prototype.copy=function(){var a=new oe;a.pa=this.pa;a.ec=this.ec;a.nc=this.nc;a.xe=this.xe;a.Hi=this.Hi;a.Ii=this.Ii;a.hh=this.hh;a.tl=this.tl;a.Mk=this.Mk;a.zj=this.zj;a.qa=this.qa;return a};t=oe.prototype; t.Ma=function(a){if(!(a instanceof oe)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Wd:case xd:return K.A(this.endX,a.endX)&&K.A(this.endY,a.endY);case Xd:return K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)&&K.A(this.point1X,a.point1X)&&K.A(this.point1Y,a.point1Y)&&K.A(this.point2X,a.point2X)&&K.A(this.point2Y,a.point2Y);case Yd:return K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)&&K.A(this.point1X,a.point1X)&&K.A(this.point1Y,a.point1Y);case Zd:return K.A(this.startAngle, a.startAngle)&&K.A(this.sweepAngle,a.sweepAngle)&&K.A(this.centerX,a.centerX)&&K.A(this.centerY,a.centerY)&&K.A(this.radiusX,a.radiusX)&&K.A(this.radiusY,a.radiusY);case $d:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.A(this.xAxisRotation,a.xAxisRotation)&&K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)&&K.A(this.radiusX,a.radiusX)&&K.A(this.radiusY,a.radiusY);default:return!1}};t.gb=function(a){a.classType===oe&&(this.type=a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Wd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case xd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Xd:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Yd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Zd:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ " "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case $d:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ " "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.zj?"z":"")};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.close=function(){this.zj=!0;return this}; function ae(a,b){if(null!==a.Le&&!1===b.qa)return a.Le;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Le=[],a.Le;b=a.xe;var e=a.Hi,f=K.Ox(0,0,c=r?g=Math.PI:1<=r&&(g=0);!k&&0g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=K.Ox(0,0,b>f?b:f,m,m+g,!0);f=qd.alloc();f.reset();f.translate(c,d);f.rotate(a.xe,0,0);f.scale(k,r);Ud(b,f);qd.free(f);a.Le=b;return a.Le} ma.Object.defineProperties(oe.prototype,{isClosed:{get:function(){return this.zj},set:function(a){this.zj!==a&&(this.zj=a,this.qa=!0)}},type:{get:function(){return this.pa},set:function(a){this.s&&ua(this,a);this.pa=a;this.qa=!0}},endX:{get:function(){return this.ec},set:function(a){this.s&&ua(this,a);this.ec=a;this.qa=!0}},endY:{get:function(){return this.nc},set:function(a){this.s&& ua(this,a);this.nc=a;this.qa=!0}},point1X:{get:function(){return this.xe},set:function(a){this.s&&ua(this,a);this.xe=a;this.qa=!0}},point1Y:{get:function(){return this.Hi},set:function(a){this.s&&ua(this,a);this.Hi=a;this.qa=!0}},point2X:{get:function(){return this.Ii},set:function(a){this.s&&ua(this,a);this.Ii=a;this.qa=!0}},point2Y:{get:function(){return this.hh},set:function(a){this.s&& ua(this,a);this.hh=a;this.qa=!0}},centerX:{get:function(){return this.xe},set:function(a){this.s&&ua(this,a);this.xe=a;this.qa=!0}},centerY:{get:function(){return this.Hi},set:function(a){this.s&&ua(this,a);this.Hi=a;this.qa=!0}},radiusX:{get:function(){return this.Ii},set:function(a){0>a&&va(a,">= zero",oe,"radiusX");this.s&&ua(this,a);this.Ii=a;this.qa=!0}},radiusY:{get:function(){return this.hh}, set:function(a){0>a&&va(a,">= zero",oe,"radiusY");this.s&&ua(this,a);this.hh=a;this.qa=!0}},startAngle:{get:function(){return this.ec},set:function(a){this.ec!==a&&(this.s&&ua(this,a),a%=360,0>a&&(a+=360),this.ec=a,this.qa=!0)}},sweepAngle:{get:function(){return this.nc},set:function(a){this.s&&ua(this,a);360a&&(a=-360);this.nc=a;this.qa=!0}},isClockwiseArc:{get:function(){return this.Mk},set:function(a){this.s&& ua(this,a);this.Mk=a;this.qa=!0}},isLargeArc:{get:function(){return this.tl},set:function(a){this.s&&ua(this,a);this.tl=a;this.qa=!0}},xAxisRotation:{get:function(){return this.xe},set:function(a){a%=360;0>a&&(a+=360);this.s&&ua(this,a);this.xe=a;this.qa=!0}}});oe.prototype.equalsApprox=oe.prototype.Ma; var Wd=new D(oe,"Move",0),xd=new D(oe,"Line",1),Xd=new D(oe,"Bezier",2),Yd=new D(oe,"QuadraticBezier",3),Zd=new D(oe,"Arc",4),$d=new D(oe,"SvgArc",4);oe.className="PathSegment";oe.Move=Wd;oe.Line=xd;oe.Bezier=Xd;oe.QuadraticBezier=Yd;oe.Arc=Zd;oe.SvgArc=$d;function qe(){this.B=null;this.kv=(new I(0,0)).freeze();this.uu=(new I(0,0)).freeze();this.lr=this.qs=0;this.mr=1;this.gs="";this.gt=this.Gr=!1;this.Dr=this.pr=0;this.Jg=this.Qr=this.$r=!1;this.Lr=null;this.bt=0;this.cd=this.at=null} qe.prototype.copy=function(){var a=new qe;return this.clone(a)};qe.prototype.clone=function(a){a.B=this.B;a.kv.assign(this.viewPoint);a.uu.assign(this.documentPoint);a.qs=this.qs;a.lr=this.lr;a.mr=this.mr;a.gs=this.gs;a.Gr=this.Gr;a.gt=this.gt;a.pr=this.pr;a.Dr=this.Dr;a.$r=this.$r;a.Qr=this.Qr;a.Jg=this.Jg;a.Lr=this.Lr;a.bt=this.bt;a.at=this.at;a.cd=this.cd;return a}; qe.prototype.toString=function(){var a="^";0!==this.modifiers&&(a+="M:"+this.modifiers);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.clickCount&&(a+="C:"+this.clickCount);0!==this.delta&&(a+="D:"+this.delta);this.handled&&(a+="h");this.bubbles&&(a+="b");null!==this.documentPoint&&(a+="@"+this.documentPoint.toString());return a};qe.prototype.vq=function(a,b){var c=this.diagram;if(null===c)return b;re(c,this.event,a,b);return b}; qe.prototype.Nz=function(a,b){var c=this.diagram;if(null===c)return b;re(c,this.event,a,b);b.assign(c.au(b));return b}; ma.Object.defineProperties(qe.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},viewPoint:{get:function(){return this.kv},set:function(a){this.kv.assign(a)}},documentPoint:{get:function(){return this.uu},set:function(a){this.uu.assign(a)}},modifiers:{get:function(){return this.qs},set:function(a){this.qs=a}},button:{get:function(){return this.lr}, set:function(a){this.lr=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.mr},set:function(a){this.mr=a}},key:{get:function(){return this.gs},set:function(a){this.gs=a}},down:{get:function(){return this.Gr},set:function(a){this.Gr=a}},up:{get:function(){return this.gt},set:function(a){this.gt= a}},clickCount:{get:function(){return this.pr},set:function(a){this.pr=a}},delta:{get:function(){return this.Dr},set:function(a){this.Dr=a}},isMultiTouch:{get:function(){return this.$r},set:function(a){this.$r=a}},handled:{get:function(){return this.Qr},set:function(a){this.Qr=a}},bubbles:{get:function(){return this.Jg},set:function(a){this.Jg=a}},event:{ get:function(){return this.Lr},set:function(a){this.Lr=a}},isTouchEvent:{get:function(){var a=x.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=x.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{get:function(){return this.bt},set:function(a){this.bt=a}},targetDiagram:{get:function(){return this.at},set:function(a){this.at=a}},targetObject:{ get:function(){return this.cd},set:function(a){this.cd=a}},control:{get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers| 2:this.modifiers&-3}},meta:{get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get: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},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get: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},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get: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},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}); qe.prototype.getMultiTouchDocumentPoint=qe.prototype.Nz;qe.prototype.getMultiTouchViewPoint=qe.prototype.vq;qe.className="InputEvent";function se(){this.B=null;this.Qa="";this.As=this.$s=null}se.prototype.copy=function(){var a=new se;a.B=this.B;a.Qa=this.Qa;a.$s=this.$s;a.As=this.As;return a};se.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; ma.Object.defineProperties(se.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},subject:{get:function(){return this.$s},set:function(a){this.$s=a}},parameter:{get:function(){return this.As},set:function(a){this.As=a}}});se.className="DiagramEvent"; function te(){this.hn=ue;this.af=this.ps="";this.To=this.Uo=this.$o=this.ap=this.Zo=this.B=this.ac=null}te.prototype.clear=function(){this.To=this.Uo=this.$o=this.ap=this.Zo=this.B=this.ac=null}; te.prototype.copy=function(){var a=new te;a.hn=this.hn;a.ps=this.ps;a.af=this.af;a.ac=this.ac;a.B=this.B;a.Zo=this.Zo;var b=this.ap;a.ap=za(b)&&"function"===typeof b.G?b.G():b;b=this.$o;a.$o=za(b)&&"function"===typeof b.G?b.G():b;b=this.Uo;a.Uo=za(b)&&"function"===typeof b.G?b.G():b;b=this.To;a.To=za(b)&&"function"===typeof b.G?b.G():b;return a};te.prototype.gb=function(a){a.classType===te&&(this.change=a)}; te.prototype.toString=function(){var a="";a=this.change===ve?a+"* ":this.change===ue?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===ve?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ja(this.object)),null!==this.oldValue&&(a+=" old: "+Ja(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ja(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};te.prototype.H=function(a){return a?this.oldValue:this.newValue};te.prototype.Pz=function(a){return a?this.oldParam:this.newParam};te.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; te.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};te.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};te.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; ma.Object.defineProperties(te.prototype,{model:{get:function(){return this.ac},set:function(a){this.ac=a}},diagram:{get:function(){return this.B},set:function(a){this.B=a}},change:{get:function(){return this.hn},set:function(a){this.hn=a}},modelChange:{get:function(){return this.ps},set:function(a){this.ps=a}},propertyName:{get:function(){return this.af}, set:function(a){this.af=a}},isTransactionFinished:{get:function(){return this.hn===ve&&("CommittedTransaction"===this.af||"FinishedUndo"===this.af||"FinishedRedo"===this.af)}},object:{get:function(){return this.Zo},set:function(a){this.Zo=a}},oldValue:{get:function(){return this.ap},set:function(a){this.ap=a}},oldParam:{get:function(){return this.$o},set:function(a){this.$o=a}}, newValue:{get:function(){return this.Uo},set:function(a){this.Uo=a}},newParam:{get:function(){return this.To},set:function(a){this.To=a}}});te.prototype.redo=te.prototype.redo;te.prototype.canRedo=te.prototype.canRedo;te.prototype.undo=te.prototype.undo;te.prototype.canUndo=te.prototype.canUndo;te.prototype.getParam=te.prototype.Pz;te.prototype.getValue=te.prototype.H;te.prototype.clear=te.prototype.clear; var ve=new D(te,"Transaction",-1),ue=new D(te,"Property",0),we=new D(te,"Insert",1),xe=new D(te,"Remove",2);te.className="ChangedEvent";te.Transaction=ve;te.Property=ue;te.Insert=we;te.Remove=xe;function ye(){this.u=(new E).freeze();this.Qa="";this.l=!1}ye.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0a.transactionLevel&&wa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.zb("CommittingTransaction",c,e));var f=0;if(0a.historyIndex;d--)f=b.L(d),null!==f&&f.clear(),b.ab(d),a.Yr=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.L(0),null!==f&&f.clear(),b.ab(0),a.Kd--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Kd++);b.freeze()}a.isInternalTransaction||a.zb("CommittedTransaction",c,e)}else{a.ne=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| a.zb("RolledBackTransaction",c,e),a.ne=!1}null!==e&&e.clear()}a.Ar=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.L(e),null!==b&&b.undo(),c.ea(),c.ab(e);c.freeze()}return!1}ze.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.Bu&&(a=a.diagram,null!==a&&!1===a.mk||wa("Change not within a transaction: "+c.toString()))}}; ze.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; ma.Object.defineProperties(ze.prototype,{models:{get:function(){return this.Tu.iterator}},isEnabled:{get:function(){return this.ad},set:function(a){this.ad=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.L(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndexe&&(e=-3),0g&&(g=-3);if(void 0===h||void 0===e||void 0===g||0===e&&0===g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3*f*a.scrollVerticalLineChange,0e||Math.abs(b.y-a.y)>d}; ma.Object.defineProperties(Be.prototype,{diagram:{get:function(){return this.B},set:function(a){a instanceof Q&&(this.B=a)}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},isEnabled:{get:function(){return this.ad},set:function(a){this.ad=a}},isActive:{get:function(){return this.kd},set:function(a){this.kd=a}},transactionResult:{get:function(){return this.Qw}, set:function(a){this.Qw=a}}});Be.prototype.stopTransaction=Be.prototype.Dg;Be.prototype.startTransaction=Be.prototype.ua;Be.className="Tool";function Oa(){Be.call(this);this.name="ToolManager";this.Kc=new E;this.Yc=new E;this.Ef=new E;this.T=this.Ia=850;this.u=(new M(2,2)).ca();this.bb=5E3;this.Ja=Fe;this.I=Le;this.zr=this.l=null;this.Tj=-1}la(Oa,Be);Oa.prototype.initializeStandardTools=function(){}; Oa.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Ke&&this.zr===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Oa.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Me&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Ne){b.bubbles=!0;return}if(this.gestureBehavior===Me)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var c=this.mouseDownTools.length,d=0;de.right&&(c.x-=d.width+5/b.scale);c.xe.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.ye&&(e=g),h>f&&(f=h))}}Infinity===c?b.h(0,0,0,0):b.h(c,d,e-c,f-d)} function of(a,b){if(null===a.copiedParts){var c=a.diagram;if((!b||!c.isReadOnly&&!c.isModelReadOnly)&&null!==a.draggedParts){var d=c.undoManager;d.isEnabled&&d.isInTransaction?null!==d.currentTransaction&&0c.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.lg;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=xf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=xf(a,c.i(c.pointsCount-1),!0),null!==h&&(k=h.part));e.isValidLink(g,f,k,h)?b?(c.defaultFromPoint=c.i(0),c.defaultToPoint=c.i(c.pointsCount-1),c.suspendsRouting=!1,c.fromNode=g,null!==f&&(c.fromPortId=f.portId),c.toNode=k,null!==h&&(c.toPortId=h.portId),c.fromPort!== d.oy&&d.R("LinkRelinked",c,d.oy),c.toPort!==d.py&&d.R("LinkRelinked",c,d.py)):Df(e,g,f,k,h):Df(e,null,null,null,null)}}}}Re.prototype.doDragOver=function(){}; function Ef(a,b){var c=a.diagram;a.dragsLink&&tf(a,!0);df(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;Ff(a,e,f);f=wf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Te){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof V&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==Te){a=N.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof V&&Gf(c,d,a);N.free(a)}}}function Ff(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof uf||(c=a.mouseDrop,null!==c&&c(b))}function Gf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Ce(c)&&(d=!0);a=a.Gv(c,function(a){return a.part},function(a){return a instanceof S},!0,function(a){return a instanceof S},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.yd(b)&&c.isAvoiding&&c.Ta()} Re.prototype.doDropOnto=function(){};Re.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(of(this,!1),We(a,this.copiedParts),qf(this,this.copiedParts,!1),ef(a,this.copiedParts)):this.mayMove()?(hf(this),qf(this,this.draggedParts,!0)):this.mayDragOut()?(of(this,!1),qf(this,this.copiedParts,!1)):hf(this),sf(this,a.lastInput.documentPoint))}}; Re.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(hf(this),of(this,!0),We(a,this.copiedParts),qf(this,this.copiedParts,!1),ef(a,this.copiedParts),null!==this.copiedParts&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,hf(this),this.mayMove()&&(qf(this,this.draggedParts, !0),sf(this,a.lastInput.documentPoint)));this.Fn=!0;Ef(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Df():this.draggedParts.Df();this.copiedParts=null;b&&Hf(this);a.Na();ef(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.R(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.R("ChangedSelection",a.selection)}}}; Re.prototype.simulatedMouseMove=function(a,b,c){if(null===Te)return!1;var d=Te.diagram;c instanceof Q||(c=null);var e=Xe;c!==e&&(null!==e&&e!==d&&(e.Cf(),Te.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Xe=c,null!==c&&c!==d&&(lf(),e=c.toolManager.findTool("Dragging"),null!==e&&(ff.contains(e)||ff.add(e),e.doSimulatedDragEnter())));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging");null!==d&&(null!== a&&(void 0!==a.targetTouches&&(0=d&&(d=.1);var e=this,f=b.xg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof V){var k=g.ga(Ac,I.alloc()),l=c.x-k.x,m=c.y-k.y;I.free(k);k=l*l+m*m;kc){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.rq(b).count>=c)return!1}return!0}; Kf.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.xd(b).count>=c)return!1}return!0}; Kf.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;a=a.part;b=b.part;return null!==a&&a===b};Kf.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof V))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof V))return!1;b=b.portId;null===b&&(b="");for(b=d.xd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Kf.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};Kf.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.labeledLink;if(null===c)return!1;if(c===b)return!0;var d=new F;d.add(a);return Lf(this,c,b,d)}; function Lf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Lf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Lf(a,b.labeledLink,c,d))?!0:!1} Kf.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.isUnconnectedLinkValid;var d=this.diagram.validCycle;if(d!==Mf){if(d===Nf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!Of(this,a,b,c,!0)}if(d===Pf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=a.linksConnected;d.next();)if(e=d.value,e!==c&&e.isTreeLink&&e.fromNode=== a)return!1;return!Of(this,a,b,c,!0)}if(d===Qf)return a===b?a=!0:(d=new F,d.add(b),a=Rf(this,d,a,b,c)),!a;if(d===Sf)return!Of(this,a,b,c,!1);if(d===Tf)return a===b?a=!0:(d=new F,d.add(b),a=Uf(this,d,a,b,c)),!a}return!0};function Of(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&Of(a,g,c,d,e)))return!0}return!1} function Rf(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 f=c.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&Rf(a,b,g,d,e)))return!0}return!1}function Uf(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 f=c.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&Uf(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties(Kf.prototype,{portGravity:{get:function(){return this.Qh},set:function(a){0<=a&&(this.Qh=a)}},isUnconnectedLinkValid:{get:function(){return this.Ja},set:function(a){this.Ja=a}},linkingCursor:{get:function(){return this.hi},set:function(a){this.hi=a}},temporaryLink:{get:function(){return this.Ow},set:function(a){this.Ow=a}},temporaryFromNode:{ get:function(){return this.Nw},set:function(a){if(this.Nw=a)this.l=a.port}},temporaryFromPort:{get:function(){return this.l},set:function(a){if(null!==this.l){var b=this.l.panel;if(null!==b){var c=b.W.indexOf(this.l);b.ab(c);b.ub(c,a)}}this.l=a}},temporaryToNode:{get:function(){return this.Pw},set:function(a){if(this.Pw=a)this.u=a.port}},temporaryToPort:{get:function(){return this.u},set:function(a){if(null!== this.u){var b=this.u.panel;if(null!==b){var c=b.W.indexOf(this.u);b.ab(c);b.ub(c,a)}}this.u=a}},originalLink:{get:function(){return this.Yc},set:function(a){this.Yc=a}},originalFromNode:{get:function(){return this.bb},set:function(a){this.bb=a}},originalFromPort:{get:function(){return this.Kc},set:function(a){this.Kc=a}},originalToNode:{get:function(){return this.Ef},set:function(a){this.Ef= a}},originalToPort:{get:function(){return this.Nh},set:function(a){this.Nh=a}},isForwards:{get:function(){return this.Ia},set:function(a){this.Ia=a}},validPortsCache:{get:function(){return this.Gy}},targetPort:{get:function(){return this.Mw},set:function(a){this.Mw=a}},linkValidation:{get:function(){return this.zi},set:function(a){this.zi=a}},portTargeted:{ get:function(){return this.ar},set:function(a){this.ar=a}}});Kf.className="LinkingBaseTool";function Vf(){Kf.call(this);this.name="Linking";this.T={};this.I=null;this.J=Wf;this.Rm=null}la(Vf,Kf);Vf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.Gt()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; Vf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.Ub(a.firstInput.documentPoint,null,null));if(null===b||!(b.part instanceof V))return null;a=this.direction;if(a===Wf||a===Xf){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.isForwards=!0,c}if(a===Wf||a===Yf)if(b=this.findValidLinkablePort(b,!0),null!==b)return this.isForwards=!1,b;return null}; Vf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null!==b&&(this.ua(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.v()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof V&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort, !1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.v()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof V&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode), null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.Ta(),a.add(this.temporaryLink)),this.isActive=!0)};Vf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.Dg()};Vf.prototype.doStop=function(){Kf.prototype.doStop.call(this);this.startObject=null}; Vf.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!==g){var h=g.part;h instanceof V&&(this.isForwards?(null!==this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!==this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&& (b=this.originalFromNode,c=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!==b||null!==d?(f=this.insertLink(b,c,d,e),null!==f?(null===g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",f)):(a.model.mq(),this.doNoLink(b,c, d,e))):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}}; Vf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof S)return a.isTreeLink;var b=this.diagram;if(null===b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!==b?b.isTreeLink:!0};Vf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Vf.prototype.doNoLink=function(){}; ma.Object.defineProperties(Vf.prototype,{archetypeLinkData:{get:function(){return this.T},set:function(a){this.T=a}},archetypeLabelNodeData:{get:function(){return this.I},set:function(a){this.I=a}},direction:{get:function(){return this.J},set:function(a){this.J=a}},startObject:{get:function(){return this.Rm},set:function(a){this.Rm=a}}}); var Wf=new D(Vf,"Either",0),Xf=new D(Vf,"ForwardsOnly",0),Yf=new D(Vf,"BackwardsOnly",0);Vf.className="LinkingTool";Vf.Either=Wf;Vf.ForwardsOnly=Xf;Vf.BackwardsOnly=Yf; function bf(){Kf.call(this);this.name="Relinking";var a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.T=a;a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.Rm=a;this.I=null;this.qx=new N}la(bf,Kf); bf.prototype.updateAdornments=function(a){if(null!==a&&a instanceof S){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.zf()&&(c=a.hk(b),null===c&&(c=this.makeAdornment(d,!1),a.zh(b,c)))}null===c&&a.Af(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.zf()&& (c=a.hk(b),null===c?(c=this.makeAdornment(d,!0),a.zh(b,c)):c.o()));null===c&&a.Af(b)}};bf.prototype.makeAdornment=function(a,b){var c=new Ke;c.type=X.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; bf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.Gt()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!==b}; bf.prototype.doActivate=function(){var a=this.diagram;if(null===this.originalLink){var b=this.handle;null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null===b)return;var c=b.part;if(!(c instanceof Ke&&c.adornedPart instanceof S))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.ua(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor; this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.qx.set(this.originalLink.actualBounds);null!==this.originalLink&&0b.firstPickIndex+1&&c=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": "e-resize"}else if(a instanceof X)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};tg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; tg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(this.ys.set(this.adornedObject.ga(this.handle.alignment.Zv())),this.bp.set(this.adornedObject.part.location),this.px.set(this.adornedObject.desiredSize),this.xu=this.computeCellSize(),this.zu=this.computeMinSize(),this.yu=this.computeMaxSize(),a.isMouseCaptured= !0,this.mx=a.animationManager.isEnabled,a.animationManager.isEnabled=!1,this.ua(this.name),this.isActive=!0))};tg.prototype.doDeactivate=function(){var a=this.diagram;this.Dg();this.de=this.handle=null;this.isActive=a.isMouseCaptured=!1;a.animationManager.isEnabled=this.mx};tg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; tg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.zu,c=this.yu,d=this.xu,e=this.adornedObject.zt(a.lastInput.documentPoint,I.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.Wc();I.free(e)}}; tg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.zu,c=this.yu,d=this.xu,e=this.adornedObject.zt(a.lastInput.documentPoint,I.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);I.free(e);a.Na();this.transactionResult=this.name;a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; tg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Ab();c=c.ga(this.handle.alignment.Zv());if(a instanceof uf){var d=new E;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Se;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().be(c),!0,e)}else a.location=a.location.copy().be(c).add(this.oppositePoint);b.Wc()}}; tg.prototype.computeResize=function(a,b,c,d,e,f){b.kc()&&(b=Ac);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=I.alloc();K.sq(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));I.free(p);return a};tg.prototype.computeReshape=function(){var a=xg;this.adornedObject instanceof W&&(a=yg(this.adornedObject));return!(a===zg||this.diagram.lastInput.shift)}; tg.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};tg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.widthc?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.ga(b)};Ag.prototype.doDeactivate=function(){var a=this.diagram;this.Dg();this.de=this.handle=null;this.Zu=new I(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Ag.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};Ag.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))}; Ag.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Na();this.transactionResult=this.name;a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Ag.prototype.rotate=function(a){var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Ab();var c=b.locationObject,d=b.rotateObject;if(c===d||c.zg(d))c=this.bp.copy(),b.location=c.be(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.Wc()}}; Ag.prototype.computeRotate=function(a){a=this.rotationPoint.Sa(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.aj());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a}; ma.Object.defineProperties(Ag.prototype,{handleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.l},set:function(a){if(null!==a&&!(a.part instanceof Ke))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{get:function(){return this.de},set:function(a){if(null!==a&&a.part instanceof Ke)throw Error("new handle must not be in an Adornment: "+ a);this.de=a}},snapAngleMultiple:{get:function(){return this.Ja},set:function(a){this.Ja=a}},snapAngleEpsilon:{get:function(){return this.Ia},set:function(a){this.Ia=a}},originalAngle:{get:function(){return this.ox}},rotationPoint:{get:function(){return this.Zu}},handleAngle:{get:function(){return this.I},set:function(a){this.I=a}},handleDistance:{ get:function(){return this.T},set:function(a){this.T=a}}});Ag.className="RotatingTool";La("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.Wa("Rotating",a,this.mouseDownTools)});function Bg(){Be.call(this);this.name="ClickSelecting"}la(Bg,Be);Bg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; Bg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};Bg.className="ClickSelectingTool";function Cg(){Be.call(this);this.name="Action";this.Dk=null}la(Cg,Be); Cg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.Ub(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.Dk=c;a.pj=a.Ub(b.documentPoint,null,null);return!0}return!1};Cg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; Cg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};Cg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()}; Cg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};Cg.prototype.doStop=function(){this.Dk=null};Cg.className="ActionTool";function Dg(){Be.call(this);this.name="ClickCreating";this.lj=null;this.u=!0;this.l=!1;this.gx=new I(0,0)}la(Dg,Be); Dg.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===a.lastInput.clickCount&&(this.gx=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.gx))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.lm(a.lastInput.documentPoint,!0)?!1:!0}; Dg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; Dg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.R("ChangingSelection",b.selection);this.ua(this.name);if(c instanceof T)c.Wb()&&(wg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);za(e)&&(b.model.pf(e),d=b.xc(e))}if(null!==d){var f=I.allocAt(a.x,a.y);this.isGridSnapEnabled&&Eg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);I.free(f)}b.Na();this.transactionResult= this.name;b.R("PartCreated",d)}finally{this.Dg(),b.R("ChangedSelection",b.selection)}return d};ma.Object.defineProperties(Dg.prototype,{archetypeNodeData:{get:function(){return this.lj},set:function(a){this.lj=a}},isDoubleClick:{get:function(){return this.u},set:function(a){this.u=a}},isGridSnapEnabled:{get:function(){return this.l},set:function(a){this.l=a}}});Dg.className="ClickCreatingTool"; function Fg(){Be.call(this);this.name="DragSelecting";this.Xk=175;this.u=!1;var a=new T;a.layerName="Tool";a.selectable=!1;var b=new W;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.l=a}la(Fg,Be); Fg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestampe.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};Tg.prototype.doStart=function(){ch=this;null!==this.textBlock&&this.doActivate()}; Tg.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.Ub(a.lastInput.documentPoint));if(null!==b&&b instanceof Ug&&(this.textBlock=b,null!==b.part)){this.isActive=!0;this.ia=$g;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.sh=this.textBlock.copy();var d=new N(this.textBlock.ga(vc),this.textBlock.ga(Gc));a.mw(d);c.show(b,a,this);this.currentTextEditor=c}}}};Tg.prototype.doCancel=function(){this.stopTool()}; Tg.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};Tg.prototype.doMouseDown=function(){this.isActive&&this.acceptText(dh)};Tg.prototype.acceptText=function(a){switch(a){case dh:if(this.ia===fh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.ia===$g||this.ia===bh||this.ia===ah)this.ia=gh,hh(this);break;case ih:case Yg:case Zg:if(Yg!==a||!0!==this.textBlock.isMultiline)if(this.ia===$g||this.ia===bh||this.ia===ah)this.ia=gh,hh(this)}}; function hh(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());if(a.isValidText(b,e,f))a.ua(a.name),a.ia=fh,a.transactionResult=a.name,b.text=f,d=a.textBlock,null!==d.textEdited&&d.textEdited(d,e,f),null!==c&&c.R("TextEdited",b,e),a.Dg(),a.stopTool(),null!==c&&c.doFocus();else{a.ia=bh;var g=a.textBlock;null!==g.errorFunction&&g.errorFunction(a,e,f);d.show(b,c,a)}}} Tg.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.ia=Wg,this.textBlock=null,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.isActive=!1)};Tg.prototype.doStop=function(){ch=null};Tg.prototype.isValidText=function(a,b,c){var d=this.textValidation;if(null!==d&&!d(a,b,c))return!1;d=a.textValidation;return null===d||d(a,b,c)?!0:!1};Tg.prototype.ny=function(a){var b=this.sh;b.text=a;b.measure(this.textBlock.vi,Infinity);return b}; ma.Object.defineProperties(Tg.prototype,{textBlock:{get:function(){return this.Ja},set:function(a){this.Ja=a}},currentTextEditor:{get:function(){return this.u},set:function(a){this.u=a}},defaultTextEditor:{get:function(){return this.l},set:function(a){this.l=a}},starting:{get:function(){return this.Ia},set:function(a){this.Ia=a}},textValidation:{get:function(){return this.Ni}, set:function(a){this.Ni=a}},minimumEditorScale:{get:function(){return this.I},set:function(a){this.I=a}},selectsTextOnActivate:{get:function(){return this.T},set:function(a){this.T=a}},state:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}}});Tg.prototype.measureTemporaryTextBlock=Tg.prototype.ny; var ih=new D(Tg,"LostFocus",0),dh=new D(Tg,"MouseDown",1),Zg=new D(Tg,"Tab",2),Yg=new D(Tg,"Enter",3),jh=new D(Tg,"SingleClick",0),Vg=new D(Tg,"SingleClickSelected",1),eh=new D(Tg,"DoubleClick",2),Wg=new D(Tg,"StateNone",0),$g=new D(Tg,"StateActive",1),ah=new D(Tg,"StateEditing",2),gh=new D(Tg,"StateValidating",3),bh=new D(Tg,"StateInvalid",4),fh=new D(Tg,"StateValidated",5),ch=null;Tg.className="TextEditingTool";Tg.LostFocus=ih;Tg.MouseDown=dh;Tg.Tab=Zg;Tg.Enter=Yg;Tg.SingleClick=jh; Tg.SingleClickSelected=Vg;Tg.DoubleClick=eh;Tg.StateNone=Wg;Tg.StateActive=$g;Tg.StateEditing=ah;Tg.StateValidating=gh;Tg.StateInvalid=bh;Tg.StateValidated=fh;La("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.Wa("TextEditing",a,this.mouseUpTools)}); function kh(){xh||(yh(),xh=!0);this.B=Ce;this.hl=this.Ze=this.qc=this.ds=this.hc=!1;this.Ax=!0;this.il=zh;this.fn=!1;this.ri=this.ad=!0;this.Rg=600;this.Ww=this.zx=!1;this.Ke=new F;this.Dd=new Ah;this.Dd.Lc=this;this.Ek=new F;this.fv=new F;this.ct=new F}kh.prototype.$d=function(a){this.B=a};kh.prototype.canStart=function(){return!0};function Bh(a,b){Ch(a,b)&&(a.Ze=!0)}function Ch(a,b){if(!a.ad||!a.canStart(b))return!1;a.Ke.add(b);a.defaultAnimation.isAnimating&&a.Xc();return a.qc=!0} function Dh(a){if(a.ad&&a.qc){var b=a.Dd,c=a.B,d=a.Ke.contains("Model");d&&(a.hl=!0,a.il===zh?(b.isViewportUnconstrained=!0,b.jc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.il===Eh&&b.jc.clear(),a.Ax=a.il===Fh&&c.Ks.w(c.ma)?!0:!1,c.R("InitialAnimationStarting",a));d&&!a.ri||0===b.jc.count?(a.Ke.clear(),a.qc=!1,a.Ze=!1,b.jc.clear(),Gh(b),a.hl=!1,c.M()):(a.Ke.clear(),c.ze=!1,d=b.jc.get(c),c.autoScale!==Hh&&null!==d&&(delete d.start.scale,delete d.end.scale), x.requestAnimationFrame(function(){!1===a.qc||b.hc||(c.Ee("temporaryPixelRatio")&&Ve(c),Ih(c),a.qc=!1,a.Ze=!1,b.start(),Jh(a),c.Na(),Kh(b,0),If(c,!0),Lh(a),c.R("AnimationStarting",a))}))}}function Mh(a,b,c,d){b instanceof S&&(null!==b.fromNode||null!==b.toNode)||a.Dd.add(b,"position",c,d,!1)}t=kh.prototype;t.Ot=function(a){return this.Dd.Ot(a)};t.Qv=function(a){return this.Dd.Qv(a)}; function Nh(a,b){function c(){0a&&va(a,">= 1",kh,"duration");this.Rg=a}},isAnimating:{get:function(){return this.hc}},isTicking:{get:function(){return this.ds}},isInitial:{ get:function(){return this.ri},set:function(a){this.ri=a}},defaultAnimation:{get:function(){return this.Dd}},activeAnimations:{get:function(){return this.Ek}},initialAnimationStyle:{get:function(){return this.il},set:function(a){this.il=a}}});kh.prototype.stopAnimation=kh.prototype.Xc;var Wh=null,xh=!1,zh=new D(kh,"Default",1),Fh=new D(kh,"AnimateLocations",2),Eh=new D(kh,"None",3); kh.className="AnimationManager";kh.defineAnimationEffect=function(a,b){xh||(yh(),xh=!0);Wh.add(a,b)};kh.Default=zh;kh.AnimateLocations=Fh;kh.None=Eh;function Ah(){this.jv=this.yx=this.Lc=this.B=null;this.ql=this.hc=this.l=!1;this.Ln=this.ud=0;this.xr=this.wu=Xh;this.pl=this.qp=!1;this.$u=1;this.Yu=0;this.nd=this.Rg=NaN;this.Zw=0;this.Mn=null;this.u=Gb;this.jc=new H;this.Uu=new H;this.Zl=new F;this.Vu=new F;this.Xw=Yh}Ah.prototype.suspend=function(){this.ql=!0}; Ah.prototype.advanceTo=function(a,b){b&&(this.ql=!1);this.qp&&a>=this.nd&&(this.pl=!0,a-=this.nd);this.Zw=a;Oh(this,!0);Jh(this.Lc);If(this.B);Lh(this.Lc);this.B.Zd()};function Gh(a){a.Uu.clear();a.pl=!1;a.Yu=0;a.nd=NaN;0a.Ln?a.nd:d-a.ud;b&&(e=a.Zw,ea.Ln&&(a.qp&&!a.pl?(a.ud=+new Date,a.Ln=a.ud+a.nd,a.pl=!0):a.im(!1))}}} function Kh(a,b){for(var c=a.nd,d=a.jc.iterator,e=a.pl;d.next();){var f=d.key;if(!(f instanceof Y&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=Wh,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:node"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.xr,b,c,a)}}}t.stop=function(){this.hc&&this.im(!0)}; t.im=function(a){null!==this.jv&&this.jv.yp.remove(this.yx);if(this.hc){var b=this.B,c=this.Lc;this.ql=this.hc=c.hl=!1;Jh(c);for(var d=this.jc,e=this.Zl.iterator;e.next();)b.remove(e.value);for(e=this.Vu.iterator;e.next();)e.value.o();e=this.qp;d=d.iterator;for(var f=Wh;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Bv,n;for(n in l)if(null!==f.get(n)){var p=n;!h.wv||"position:node"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]:h.wv?k[n]: l[n],this.xr,this.nd,this.nd,this)}h.wv&&void 0!==m.location&&g instanceof T&&(g.location=m.location);h.dw&&g instanceof T&&g.Pb(!1)}if(c.defaultAnimation===this)for(n=this.B.links;n.next();)e=n.value,null===e.lh?(d=e.path,null!==d&&(e.ld=!1,e.o(),d.o())):(e.points=e.lh,e.lh=null);b.Jt.clear();jf(b,!1);b.Na();b.M();If(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.Xw);Lh(c);this.Yu++;!a&&this.$u>this.Yu?(this.pl=!1,this.start()):(this.Mn&&this.Mn(this),Gh(this),c.im(this),b.Bb())}}; t.Yj=function(a,b){var c=b.actualBounds,d=null;b instanceof uf&&(d=b.placeholder);null!==d?(c=d.ga(vc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new I(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof uf)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Yj(d,b)}; t.Wj=function(a,b){if(a.isVisible()){var c=null;b instanceof uf&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:node",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.jc;c.contains(a)&&(c.H(a).dw=!0);if(a instanceof uf)for(a=a.memberParts;a.next();)c=a.value,c instanceof V&&this.Wj(c,b)}};t.Qz=function(a){var b=this.Uu.get(a);null===b&&(b={},this.Uu.add(a,b));return b}; ma.Object.defineProperties(Ah.prototype,{duration:{get:function(){return this.Rg},set:function(a){1>a&&va(a,">= 1",Ah,"duration");this.Rg=a}},reversible:{get:function(){return this.qp},set:function(a){this.qp=a}},runCount:{get:function(){return this.$u},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Zh(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}Ah.className="Animation";Ah.EaseLinear=function(a,b,c,d){return c*a/d+b};Ah.EaseInOutQuad=Xh;Ah.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};Ah.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};Ah.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};Ah.EaseOutExpo=Zh; function bi(a,b,c){this.start=a;this.end=b;this.Bv={};this.wv=c;this.dw=!1}bi.className="AnimationState";function ci(a,b,c){this.cd=null;this.af=a;this.Rp=c||di;this.Jk=null;void 0!==b&&(this.Jk=b,void 0===c&&(this.Rp=ei))}ci.prototype.copy=function(){var a=new ci(this.af);a.Rp=this.Rp;var b=this.Jk;if(null!==b){var c={};void 0!==b.duration&&(c.Sx=b.duration);void 0!==b.finished&&(c.Sx=b.finished);void 0!==b.easing&&(c.Sx=b.easing);a.Jk=c}return a}; function fi(a,b){a=a.Jk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))}ma.Object.defineProperties(ci.prototype,{propertyName:{get:function(){return this.af},set:function(a){this.af=a}},animationSettings:{get:function(){return this.Jk},set:function(a){this.Jk=a}},startCondition:{get:function(){return this.Rp},set:function(a){this.Rp=a}}}); var di=new D(ci,"Default",1),ei=new D(ci,"Immediate",2),gi=new D(ci,"Bundled",3);ci.className="AnimationTrigger";ci.Default=di;ci.Immediate=ei;ci.Bundled=gi;function hi(){Ya(this);this.B=null;this.Ca=new E;this.Qa="";this.rb=1;this.u=!1;this.Fi=this.I=this.bi=this.ai=this.$h=this.Zh=this.Xh=this.Yh=this.Wh=this.di=this.Vh=this.ci=this.Uh=this.Th=!0;this.l=!1;this.cp=[]}t=hi.prototype;t.clear=function(){this.Ca.clear();this.cp.length=0};t.$d=function(a){this.B=a}; t.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ca.iterator;h.next();){var k=h.value;k instanceof uf?e++:k instanceof V?d++:k instanceof S?f++:k instanceof Ke?g++:c++}h="";0c.Go||g.height*e>c.Go?b.bc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width|| 0===e.height||isNaN(e.x)||isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(li(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(li(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),li(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.Ft()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21* b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.sc(!0))};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.$a(ue,a,this,b,c,d,e)};t.cj=function(a,b,c){var d=this.Ca;b.wi=this;if(a>=d.count)a=d.count;else if(d.L(a)===b)return-1;d.ub(a,b);b.yq(c);d=this.diagram;null!==d&&(c?d.M():d.cj(b));mi(this,a,b);return a}; t.Hc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Hc(a,b,c);var d=this.Ca;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.L(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.zq(c);d.ab(a);d=this.diagram;null!==d&&(c?d.M():d.Hc(b));b.wi=null;return a}; function mi(a,b,c){b=ni(a,b,c);if(c instanceof uf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ca.j,f=e.length,g=0;gd&&h.containingGroup===c&&(d=g,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,g=NaN;0<=f;){g=a.L(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;hd)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.ab(b);a.ub(f,c);return f}for(g=NaN;0<=--f&&(g=a.L(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.ab(b);a.ub(h,c);return h}for(k=NaN;++h< e&&(k=a.L(h).zOrder,isNaN(k)););}return b} ma.Object.defineProperties(hi.prototype,{parts:{get:function(){return this.Ca.iterator}},partsBackwards:{get:function(){return this.Ca.iteratorBackwards}},diagram:{get:function(){return this.B}},name:{get:function(){return this.Qa},set:function(a){var b=this.Qa;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&B("Cannot rename default Layer to: "+a),c=c.layers;c.next();)c.value.name=== a&&B("Layer.name is already present in this diagram: "+a);this.Qa=a;this.g("name",b,a);for(a=this.Ca.iterator;a.next();)a.value.layerName=this.Qa}}},opacity:{get:function(){return this.rb},set:function(a){var b=this.rb;b!==a&&((0>a||1=a)return b;for(var c=this.Ka.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};Q.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})}; Q.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; function Pi(a){var b=a.sa.Fa;b instanceof HTMLCanvasElement&&(a.Zm?(a.addEventListener(b,"pointerdown",a.um,!1),a.addEventListener(b,"pointermove",a.vm,!1),a.addEventListener(b,"pointerup",a.xm,!1),a.addEventListener(b,"pointerout",a.wm,!1)):(a.addEventListener(b,"touchstart",a.Aw,!1),a.addEventListener(b,"touchmove",a.zw,!1),a.addEventListener(b,"touchend",a.yw,!1),a.addEventListener(b,"mousemove",a.sk,!1),a.addEventListener(b,"mousedown",a.rk,!1),a.addEventListener(b,"mouseup",a.uk,!1),a.addEventListener(b, "mouseout",a.tk,!1)),a.addEventListener(b,"mouseenter",a.oz,!1),a.addEventListener(b,"mouseleave",a.pz,!1),a.addEventListener(b,"wheel",a.vk,!1),a.addEventListener(b,"keydown",a.bA,!1),a.addEventListener(b,"keyup",a.cA,!1),a.addEventListener(b,"blur",a.bz,!1),a.addEventListener(b,"focus",a.cz,!1),a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"gesturestart",function(b){a.toolManager.gestureBehavior!== Ne&&(a.toolManager.gestureBehavior===Me?b.preventDefault():a.me&&a.lastInput.handled||(b.preventDefault(),a.Dl=a.scale,a.currentTool.doCancel()))},!1),a.addEventListener(b,"gesturechange",function(b){if(a.toolManager.gestureBehavior!==Ne)if(a.toolManager.gestureBehavior===Me)b.preventDefault();else if(!a.me||!a.lastInput.handled){b.preventDefault();var c=b.scale;if(null!==a.Dl){var e=a.sa.getBoundingClientRect();b=new I(b.pageX-x.scrollX-a.wa/e.width*e.left,b.pageY-x.scrollY-a.va/e.height*e.top); c=a.Dl*c;e=a.commandHandler;if(c!==a.scale&&e.canResetZoom(c)){var f=a.zoomPoint;a.zoomPoint=b;e.resetZoom(c);a.zoomPoint=f}}}},!1),a.addEventListener(x,"resize",a.Gw,!1))}function Ve(a){30p&&(this.position=q.h(-(this.Ps.scrollWidth-this.wa)+u-this.wa/c+k,this.position.y))),a.My&&this.allowVerticalScroll&&(fr&&(this.position=q.h(this.position.x, -(this.Ps.scrollHeight-this.va)+a.scrollTop-this.va/c+d))),I.free(q),Ui(this),this.ni=this.Ap=!1,b=this.documentBounds,c=this.viewportBounds,k=b.right,p=c.right,d=b.bottom,r=c.bottom,e=b.x,l=c.x,f=b.y,b=c.y,m>=g&&e>=l&&k<=p&&(this.Bp.style.width="1px"),n>=h&&f>=b&&d<=r&&(this.Bp.style.height="1px"))}};Q.prototype.computeBounds=function(){0c&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===cj?(b=k>h?(g-a.mb)/d:(f-a.mb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} Q.prototype.zoomToFit=function(){var a=this.Ki;this.Ki=Yh;this.scale=Yi(this,bj);a!==Yh&&(Xi(this,!1),Zi(this,this.documentBounds,this.wa/this.ya,this.va/this.ya,this.oj,!1));this.Ki=a};t=Q.prototype; t.KA=function(a,b){void 0===b&&(b=bj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===bj||b===cj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.wa;var f=this.va;e=b===cj?f/d>e/c?(f-(this.ke?this.mb:0))/d:(e-(this.Se?this.mb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new I(a.x,a.y)}}; t.Xy=function(a,b){Li(this);var c=this.documentBounds,d=this.viewportBounds;this.position=new I(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))};t.Lz=function(a){if(a instanceof Y){this.Nn=a;var b=I.alloc();this.On=this.Wq(a.ga(vc,b));I.free(b)}else this.Nn=null,this.On=Kb}; function Zi(a,b,c,d,e,f){var g=I.allocAt(a.ma.x,a.ma.y),h=g.x,k=g.y;if(null!==a.Nn){var l=I.alloc();l=a.Nn.ga(vc,l);h=l.x-a.On.x/a.scale;k=l.y-a.On.y/a.scale;e=uc;I.free(l)}if(f||a.scrollMode===Yh)e.hb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.Ji,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb.targetTouches.length)return;b=b.targetTouches[c]}else if(null!==a.Nj[0])b=a.Nj[c];else return;c=a.sa;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.wa/c.width*c.left,b.clientY-a.va/c.height*c.top))}t=Q.prototype;t.Na=function(){this.mi||(this.mi=!0,this.Bb(!0))};function nj(a){a.Cc||Vi(a);Li(a)}t.Zd=function(){this.Rb||this.Cc||(this.M(),$i(this),Ui(this),this.Na(),this.Wc())};t.aA=function(){return this.ze}; t.jz=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.Xc();b.isEnabled=!1;If(this);this.le=!1;this.Ks=new I(NaN,NaN);b.isEnabled=c;null!==a&&sa(function(){Bh(b,"Model");a()},1)};t.Bb=function(a){void 0===a&&(a=!1);if(!0!==this.ze&&!(this.Rb||!1===a&&this.Cc)){this.ze=!0;var b=this;x.requestAnimationFrame(function(){b.ze&&b.Wc()})}};t.Wc=function(){if(!this.vj||this.ze)this.vj&&(this.vj=!1),If(this)}; function aj(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Rb||!a.ni||Si(a)||(b&&Vi(a),c&&Xi(a,!1))} function If(a,b){if(!a.Cc&&(a.ze=!1,null!==a.Da||a.am.v())){a.Cc=!0;var c=a.animationManager,d=a.Cs;if(!c.isAnimating&&0!==d.length){for(var e=d.j,f=e.length,g=0;gb;b++){var c=a.od.iterator;if(null===c||0===a.od.count)break;a.od=new F;a.Fw(c,a.od)}a.nodes.each(function(a){a instanceof uf&&0!==(a.P&65536)!==!1&&(a.P=a.P^65536)})}} t.Fw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Wb()||c instanceof uf||(c.ej()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof uf&&c.isVisible()&&sj(this,c);for(a.reset();a.next();)c=a.value,c instanceof S&&c.isVisible()&&(c.ej()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Ke&&c.isVisible()&&(c.ej()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function sj(a,b){for(var c=Fa(),d=Fa(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof uf?(tj(f)||uj(f)||vj(f))&&sj(a,f):f instanceof S?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;ec&&(r=y.left,q=y.right),p.height>w&&(u=y.top,v=y.bottom)):(r=y.left, q=y.right,u=y.top,v=y.bottom);y=p.width+r+q;var z=p.height+u+v;r=p.x-r;var A=n.x;q=p.right+q;var C=n.right+h;u=p.y-u;var G=n.y;p=p.bottom+v;n=n.bottom+k;var L="1px",J="1px";v=a.scale;l=y>l/v;m=z>m/v;a.scrollMode===Yh&&(l||m)&&(l&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(l=1,r+1C+1&&(l=Math.max((q-C)*v+a.wa,l)),c+h+1n+1&&(l=Math.max((p-n)*v+a.va,l)),w+k+1C+1&&(h=Math.max((q-C)*v+a.wa,h)),c+1n+1&&(k=Math.max((p-n)*v+h,k)),w+1C+1&&(k=a.position.x*v));if(a.ol)switch(a.Js){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(w+1n+1&&(b.scrollTop=a.position.y* v));l=a.wa;m=a.va;b.style.width=l+(a.Se?a.mb:0)+"px";b.style.height=m+(a.ke?a.mb:0)+"px";return d!==l||e!==m||a.animationManager.qc?(a.Jq(f,a.viewportBounds,v,g),!1):!0} t.add=function(a){var b=a.diagram;if(b!==this&&(null!==b&&B("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.km(a.layerName),null===b&&(b=this.km("")),null===b&&B('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.cj(99999999,a,a.diagram===this);0<=c&&this.$a(we,"parts",b,null,a,null,c);b.isTemporary||this.Na();a.C(1);c=a.layerChanged;null!==c&&c(a,null,b)}}; t.cj=function(a){this.partManager.cj(a);var b=this;Gj(a,function(a){Hj(b,a)});(a instanceof Ke||a instanceof uf&&null!==a.placeholder)&&a.o();null!==a.data&&Gj(a,function(a){Ij(b.partManager,a)});!0!==uj(a)&&!0!==vj(a)||this.od.add(a);Jj(a,!0,this);Kj(a)?(a.actualBounds.v()&&this.M(Ej(a,a.actualBounds)),this.Na()):a.isVisible()&&a.actualBounds.v()&&this.M(Ej(a,a.actualBounds));this.Bb()}; t.Hc=function(a){a.$j();this.partManager.Hc(a);var b=this;null!==a.data&&Gj(a,function(a){Lj(b.partManager,a,b)});this.od.remove(a);Kj(a)?(a.actualBounds.v()&&this.M(Ej(a,a.actualBounds)),this.Na()):a.isVisible()&&a.actualBounds.v()&&this.M(Ej(a,a.actualBounds));this.Bb()};t.remove=function(a){Mj(this,a,!0)}; function Mj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.C(2),c&&b.fk(),c=d.Hc(-1,b,!1),0<=c&&a.$a(xe,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.Ut=function(a,b){if(Aa(a))for(var c=a.length,d=0;dd&&this.Na()}; t.Ry=function(a,b){Sj(this,a,b);a.$d(this);var c=this.Ka,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ac&&this.$a(xe,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Na()}; t.sA=function(a){a.diagram!==this&&B("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Ka,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ca.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.ac&&this.$a(xe,"layers",this,a,null,c,null);this.M();this.Na()}}};t.km=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.Hx=function(a){null===this.re&&(this.re=new E);this.re.add(a);this.model.Ah(a)};t.uA=function(a){null!==this.re&&(this.re.remove(a),0===this.re.count&&(this.re=null));this.model.yk(a)};t.Ah=function(a){null===this.Jf&&(this.Jf=new E);this.Jf.add(a)};t.yk=function(a){null!==this.Jf&&(this.Jf.remove(a),0===this.Jf.count&&(this.Jf=null))}; t.mt=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Mv(a);a.change!==ve&&(this.isModified=!0);if(null!==this.Jf)for(var b=this.Jf,c=b.length,d=0;dp.Ca.indexOf(q)&&p.cj(r,q,u):(q.isSelected=!1,q.isHighlighted=!1,q.Mb(),p.Hc(u?r:-1,q,u)))}else p instanceof Q?"number"===typeof r&&q instanceof hi&&(b?(q.$d(this),this.Ka.ub(r,q)):this.Ka.ab(r)):B("unknown ChangedEvent.Remove object: "+ a.toString());this.isModified=!0}else d!==ve&&B("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=c}}};Q.prototype.ua=function(a){return this.undoManager.ua(a)};Q.prototype.Va=function(a){return this.undoManager.Va(a)};Q.prototype.Bf=function(){return this.undoManager.Bf()}; Q.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.ua(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.Va(b):this.undoManager.Bf(),this.skipsUndoManager=c}};Q.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)};Q.prototype.Yq=function(){this.partManager.Yq()}; function Vj(a,b,c){var d=a.animationManager;if(a.Rb||a.Cc)a.ya=c,d.Ze&&d.Dd.add(d.B,"scale",b,a.ya);else if(null===a.sa)a.ya=c;else{a.Rb=!0;var e=a.viewportBounds.copy(),f=a.wa,g=a.va;e.width=a.wa/b;e.height=a.va/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.gd()?l.xf(Ic)?h=0:l.xf(Jc)&&(h=f-1):h=l.hb()?l.x*(f-1):f/2);isNaN(k)&&(l.gd()?l.xf(Hc)?k=0:l.xf(Kc)&&(k=g-1):k=l.hb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.isAnimating||(c=a.scaleComputation(a, c));ca.maxScale&&(c=a.maxScale);f=I.allocAt(a.ma.x+h/b-h/c,a.ma.y+k/b-k/c);a.position=f;I.free(f);a.ya=c;a.Jq(e,a.viewportBounds,b,!1);a.Rb=!1;Xi(a,!1);d.Ze&&d.Dd.add(d.B,"scale",b,a.ya);a.M();$i(a)}} Q.prototype.Jq=function(a,b,c,d){if(!a.w(b)){void 0===d&&(d=!1);d||$i(this);Ui(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Hh||d||a.width===b.width&&a.height===b.height||e.C();e=this.currentTool;!0===this.Vf&&e instanceof Oa&&(this.lastInput.documentPoint=this.au(this.lastInput.viewPoint),Oe(e,this));this.Rb||this.jy(a,b);pj(this);this.Td.scale=c;this.Td.position.x=a.x;this.Td.position.y=a.y;this.Td.bounds.assign(a);this.Td.Tv=d;this.R("ViewportBoundsChanged",this.Td,a); this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Ic(b)&&a.Ta()})}}; function pj(a,b){void 0===b&&(b=null);var c=a.Hb;if(null!==c&&c.visible){for(var d=M.alloc(),e=1,f=1,g=c.W.j,h=g.length,k=0;km||(Wj(l.figure)?f=f*m/K.Yx(f,m):e=e*m/K.Yx(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(null!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=N.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.v()){N.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;N.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=I.alloc();K.sq(a,g,0,0, d.width,d.height,b);b.offset(-d.width,-d.height);M.free(d);c.part.location=b;I.free(b)}}Q.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.R("ChangingSelection",b);for(var c=b.na(),d=c.length,e=0;e=d&&!f.isAnimating&&!f.qc&&(b||Bh(f,"Layout"));a.Hg=!1;for(var g=a.wh.iterator;g.next();)rk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),Vi(a),e.isValidLayout=!0):a.Hg=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.Va("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||Dh(f),a.Z=c}}}function rk(a,b,c,d){if(null!==b){for(var e=b.Al.iterator;e.next();)rk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.wk=!b.location.v(),e.doLayout(b),b.C(32),sj(a,b),e.isValidLayout=!0):a.Hg=!0)}}t.Kz=function(){for(var a=new E,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.Zi()&&a.add(c)}return a.iterator}; function qi(a){function b(a){var b=a.toLowerCase(),e=new E;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new H,d=new H;b("InitialAnimationStarting");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("GainedFocus");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped"); b("LostFocus");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");b("InvalidateDraw");a.Fr=c;a.Er=d} function Bj(a,b){var c=a.Er.H(b);return null!==c?c:a.Er.H(b.toLowerCase())}function sk(a,b){var c=a.Fr.H(b);if(null!==c)return c;c=a.Fr.H(b.toLowerCase());if(null!==c)return c;B("Unknown DiagramEvent name: "+b)}t.Xj=function(a,b){a=sk(this,a);null!==a&&a.add(b)};t.zm=function(a,b){a=sk(this,a);null!==a&&a.remove(b)}; t.R=function(a,b,c){var d=sk(this,a),e=new se;e.diagram=this;a=Bj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!==c&&(e.parameter=c);b=d.length;if(1===b)d.L(0)(e);else if(0!==b)for(d=d.na(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=N.allocAt(0,0,d.width*e,d.height*e);var f=I.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&(g=Math.max(this.scrollHorizontalLineChange,1),g|=0,f.x+=g,a.x>d.x+d.width- c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.yd.y+d.height-c.bottom&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.Ma(Gb)||(b=new I(b.x+f.x/e,b.y+f.y/e));N.free(d);I.free(f);return b};t=Q.prototype;t.Lt=function(){return null};t.Uv=function(){return null}; t.Vy=function(a,b){this.ux.add(a,b)};function Bk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].wl){f=!1;break}f||a-l>k?b(c,e,h):x.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Gi.iterator;g.next();)if(!g.value[0].wl){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;x.requestAnimationFrame(function(){d()});return null}t.hA=function(a){if(!Sg)return null;void 0===a&&(a=new db);a.returnType="Image";return this.ly(a)}; t.ly=function(a){void 0===a&&(a=new db);return Bk(this,this.iA,a)}; t.iA=function(a,b,c){var d=Ck(c,a,"canvas",null);if(null===d)return null;c=d.Y.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case "imagedata":e=d.getImageData(0,0,c.width,c.height);break;case "image":d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&B('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.');if("function"=== typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";if("function"===typeof c.msToBlob)return b(c.msToBlob()),"msToBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e}; function Ck(a,b,c,d){a.animationManager.Xc();a.Wc();if(null===a.sa)return null;"object"!==typeof b&&B("properties argument must be an Object.");var e=b.size||null,f=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(f="NaN");var g=b.maxSize;void 0===b.maxSize&&(g="SVG"===c?new M(Infinity,Infinity):new M(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,r=b.elementFinished||null,q=b.showTemporary; void 0===q&&(q=!n);b=b.showGrid;void 0===b&&(b=q);null!==e&&isNaN(e.width)&&isNaN(e.height)&&(e=null);"number"===typeof l?l=new oc(l):l instanceof oc||B("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.Fb.sc(!0);n=new Dk(null,p);var u=n.context;if(!(e||f||k||h)){n.width=a.wa+Math.ceil(l.left+l.right);n.height=a.va+Math.ceil(l.top+l.bottom);if("SVG"===c){if(null===d)return null;d.resize(n.width, n.height,n.width,n.height);d.ownerDocument=p;d.pq=r;zj(a,d.context,l,new M(n.width,n.height),a.ya,a.ma,k,m,q,b);return d.context}a.Zk=!1;zj(a,u,l,new M(n.width,n.height),a.ya,a.ma,k,m,q,b);a.Zk=!0;return n.context}var v=a.Cn,w=a.documentBounds.copy();w.vw(a.fb);if(q)for(var y=a.Ka.j,z=y.length,A=0;Av?(f=v,e=w.width,w=w.height):(e=g.width,w=g.height)):(e=w.width*f,w=w.height*f):(f=v,e=w.width,w=w.height);null!==l?(e+=h,w+=U):l=new oc(0);null!==g&&(v=g.width,g=g.height,isNaN(v)&&(v=2E3),isNaN(g)&&(g=2E3),isFinite(v)&& (e=Math.min(e,v)),isFinite(g)&&(w=Math.min(w,g)));n.width=Math.ceil(e);n.height=Math.ceil(w);if("SVG"===c){if(null===d)return null;d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.pq=r;zj(a,d.context,l,new M(Math.ceil(e),Math.ceil(w)),f,y,k,m,q,b);return d.context}a.Zk=!1;zj(a,u,l,new M(Math.ceil(e),Math.ceil(w)),f,y,k,m,q,b);a.Zk=!0;return n.context} ma.Object.defineProperties(Q.prototype,{div:{get:function(){return this.Da},set:function(a){if(this.Da!==a){Qa=[];var b=this.Da;null!==b?(b.B=void 0,b.goDiagram=void 0,b.innerHTML="",null!==this.sa&&(b=this.sa.Fa,this.removeEventListener(b,"touchstart",this.Aw,!1),this.removeEventListener(b,"touchmove",this.zw,!1),this.removeEventListener(b,"touchend",this.yw,!1),this.sa.Qx()),this.Gl&&(this.Gl.disconnect(),this.Gl=null),b=this.toolManager,null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}), b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}),b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(),this.currentTool.doCancel(),this.Fb=this.sa=null,this.removeEventListener(x,"resize",this.Gw,!1),this.removeEventListener(x,"mousemove",this.sk,!0),this.removeEventListener(x,"mousedown",this.rk,!0),this.removeEventListener(x,"mouseup",this.uk,!0),this.removeEventListener(x,"wheel",this.vk,!0),this.removeEventListener(x,"mouseout",this.tk,!0),Ce===this&&(Ce=null)):this.le= !1;this.Da=null;if(null!==a){if(b=a.B)b.div=null;Hi(this,a);this.Zd()}}}},Jx:{get:function(){return this.No}},mk:{get:function(){return this.le}},draggedLink:{get:function(){return this.Hr},set:function(a){this.Hr!==a&&(this.Hr=a,null!==a&&(this.ws=a.fromPort,this.xs=a.toPort))}},oy:{get:function(){return this.ws},set:function(a){this.ws=a}},py:{get:function(){return this.xs}, set:function(a){this.xs=a}},animationManager:{get:function(){return this.Lc}},undoManager:{get:function(){return this.ac.undoManager}},skipsUndoManager:{get:function(){return this.pg},set:function(a){this.pg=a;this.ac.skipsUndoManager=a}},delaysLayout:{get:function(){return this.Cr},set:function(a){this.Cr=a}},opacity:{get:function(){return this.rb}, set:function(a){var b=this.rb;b!==a&&((0>a||1a&&va(a,">= 0",Q,"scrollHorizontalLineChange"),this.Ns=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{get:function(){return this.Rs}, set:function(a){var b=this.Rs;b!==a&&(0>a&&va(a,">= 0",Q,"scrollVerticalLineChange"),this.Rs=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{get:function(){return this.$g},set:function(a){this.$g=a}},firstInput:{get:function(){return this.Rf},set:function(a){this.Rf=a}},currentCursor:{get:function(){return this.wr},set:function(a){""===a&&(a=this.Bn);if(this.wr!==a){var b=this.sa,c=this.Da;if(null!==b){this.wr= 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)))}}}},defaultCursor:{get:function(){return this.Bn},set:function(a){""===a&&(a="auto");var b=this.Bn;b!==a&&(this.Bn=a,this.g("defaultCursor",b,a))}},click:{get:function(){return this.Kf}, set:function(a){var b=this.Kf;b!==a&&(this.Kf=a,this.g("click",b,a))}},doubleClick:{get:function(){return this.Pf},set:function(a){var b=this.Pf;b!==a&&(this.Pf=a,this.g("doubleClick",b,a))}},contextClick:{get:function(){return this.Lf},set:function(a){var b=this.Lf;b!==a&&(this.Lf=a,this.g("contextClick",b,a))}},mouseOver:{get:function(){return this.hg},set:function(a){var b=this.hg;b!==a&&(this.hg=a,this.g("mouseOver", b,a))}},mouseHover:{get:function(){return this.fg},set:function(a){var b=this.fg;b!==a&&(this.fg=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return this.eg},set:function(a){var b=this.eg;b!==a&&(this.eg=a,this.g("mouseHold",b,a))}},mouseDragOver:{get:function(){return this.rs},set:function(a){var b=this.rs;b!==a&&(this.rs=a,this.g("mouseDragOver",b,a))}},mouseDrop:{get:function(){return this.cg}, set:function(a){var b=this.cg;b!==a&&(this.cg=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.Rr},set:function(a){var b=this.Rr;b!==a&&(this.Rr=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{get:function(){return this.dg},set:function(a){var b=this.dg;b!==a&&(this.dg=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return this.gg},set:function(a){var b= this.gg;b!==a&&(this.gg=a,this.g("mouseLeave",b,a))}},toolTip:{get:function(){return this.rg},set:function(a){var b=this.rg;b!==a&&(this.rg=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return this.Mf},set:function(a){var b=this.Mf;b!==a&&(this.Mf=a,this.g("contextMenu",b,a))}},commandHandler:{get:function(){return this.qr},set:function(a){this.qr!==a&&(this.qr=a,a.$d(this))}},toolManager:{ get:function(){return this.dt},set:function(a){this.dt!==a&&(this.dt=a,a.diagram=this)}},defaultTool:{get:function(){return this.Br},set:function(a){var b=this.Br;b!==a&&(this.Br=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{get:function(){return this.yr},set:function(a){var b=this.yr;null!==b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&& (this.yr=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.cv}},maxSelectionCount:{get:function(){return this.ns},set:function(a){var b=this.ns;if(b!==a)if(0<=a&&!isNaN(a)){if(this.ns=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",Q,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.Wo},set:function(a){var b=this.Wo;b!==a&&(this.Wo=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.$n},set:function(a){var b=this.$n;b!==a&&(this.$n=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.vo}, set:function(a){var b=this.vo;b!==a&&(this.vo=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{get:function(){return this.Du}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.fo&&this.Kd!==a.historyIndex:this.fo},set:function(a){if(this.fo!==a){this.fo=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Kd=b.historyIndex);a||Xj(this)}}},model:{ get:function(){return this.ac},set:function(a){var b=this.ac;if(b!==a){this.currentTool.doCancel();null!==b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&B("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Xc(!0);var c=Ki(this,!0);this.le=!1;this.vj=!0;this.Kd=-2;this.ze=!1;var d=this.Cc;this.Cc=!0;Bh(this.animationManager,"Model");null!==b&&(null!==this.re&&this.re.each(function(a){b.yk(a)}),b.yk(this.Kc));this.ac=a;this.partManager=hk(this.ac.type); for(var e=0;ethis.scale&&(this.scale=a)):va(a,"> 0",Q,"minScale"))}},maxScale:{get:function(){return this.ms},set:function(a){var b=this.ms;b!==a&&(0 0",Q,"maxScale"))}},zoomPoint:{get:function(){return this.kt},set:function(a){this.kt.w(a)||(this.kt=a=a.G())}},contentAlignment:{get:function(){return this.oj},set:function(a){var b=this.oj;b.w(a)||(this.oj=a=a.G(),this.g("contentAlignment",b,a),Xi(this,!1))}},initialContentAlignment:{get:function(){return this.bo},set:function(a){var b=this.bo; b.w(a)||(this.bo=a=a.G(),this.g("initialContentAlignment",b,a))}},padding:{get:function(){return this.fb},set:function(a){"number"===typeof a&&(a=new oc(a));var b=this.fb;b.w(a)||(this.fb=a=a.G(),this.Na(),this.g("padding",b,a))}},partManager:{get:function(){return this.Ja},set:function(a){var b=this.Ja;b!==a&&(null!==a.diagram&&B("Cannot share PartManagers between Diagrams: "+a.toString()),null!==b&&b.$d(null),this.Ja=a,a.$d(this))}},nodes:{ get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.ic},set:function(a){var b=this.ic;b!==a&&(this.ic=a,a.diagram=this,a.group=null,this.Hg=!0,this.g("layout",b,a),this.Bb())}},isTreePathToChildren:{get:function(){return this.es}, set:function(a){var b=this.es;if(b!==a&&(this.es=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Ek(a.value)}},treeCollapsePolicy:{get:function(){return this.ft},set:function(a){var b=this.ft;b!==a&&(a!==ri&&a!==Fk&&a!==Gk&&B("Unknown Diagram.treeCollapsePolicy: "+a),this.ft=a,this.g("treeCollapsePolicy",b,a))}},Fe:{get:function(){return this.Gu},set:function(a){this.Gu=a}},autoScrollInterval:{ get:function(){return this.cn},set:function(a){var b=this.cn;b!==a&&(this.cn=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{get:function(){return this.en},set:function(a){"number"===typeof a&&(a=new oc(a));var b=this.en;b.w(a)||(this.en=a=a.G(),this.Na(),this.g("autoScrollRegion",b,a))}}}); ma.Object.defineProperties(Q,{licenseKey:{get:function(){return Hk.Xb()},set:function(a){Hk.add(a)}},version:{get:function(){return Ik}}});Q.prototype.makeImageData=Q.prototype.ly;Q.prototype.makeImage=Q.prototype.hA;Q.prototype.addRenderer=Q.prototype.Vy;Q.prototype.makeSVG=Q.prototype.Uv;Q.prototype.makeSvg=Q.prototype.Lt;Q.prototype.stopAutoScroll=Q.prototype.Cf;Q.prototype.doAutoScroll=Q.prototype.rt;Q.prototype.isUnoccupied=Q.prototype.nk; Q.prototype.raiseDiagramEvent=Q.prototype.R;Q.prototype.removeDiagramListener=Q.prototype.zm;Q.prototype.addDiagramListener=Q.prototype.Xj;Q.prototype.findTreeRoots=Q.prototype.Kz;Q.prototype.layoutDiagram=Q.prototype.fA;Q.prototype.findTopLevelGroups=Q.prototype.Dz;Q.prototype.findTopLevelNodesAndLinks=Q.prototype.Ez;Q.prototype.findLinksByExample=Q.prototype.ut;Q.prototype.findNodesByExample=Q.prototype.vt;Q.prototype.findLinkForData=Q.prototype.wc;Q.prototype.findNodeForData=Q.prototype.Wi; Q.prototype.findPartForData=Q.prototype.xc;Q.prototype.findLinkForKey=Q.prototype.findLinkForKey;Q.prototype.findNodeForKey=Q.prototype.Lb;Q.prototype.findPartForKey=Q.prototype.findPartForKey;Q.prototype.rebuildParts=Q.prototype.Ad;Q.prototype.transformViewToDoc=Q.prototype.au;Q.prototype.transformRectDocToView=Q.prototype.HA;Q.prototype.transformDocToView=Q.prototype.Wq;Q.prototype.centerRect=Q.prototype.nt;Q.prototype.scrollToRect=Q.prototype.mw;Q.prototype.scroll=Q.prototype.scroll; Q.prototype.highlightCollection=Q.prototype.Vz;Q.prototype.highlight=Q.prototype.Uz;Q.prototype.selectCollection=Q.prototype.yA;Q.prototype.select=Q.prototype.select;Q.prototype.updateAllRelationshipsFromData=Q.prototype.Yq;Q.prototype.updateAllTargetBindings=Q.prototype.updateAllTargetBindings;Q.prototype.commit=Q.prototype.commit;Q.prototype.rollbackTransaction=Q.prototype.Bf;Q.prototype.commitTransaction=Q.prototype.Va;Q.prototype.startTransaction=Q.prototype.ua;Q.prototype.raiseChanged=Q.prototype.g; Q.prototype.raiseChangedEvent=Q.prototype.$a;Q.prototype.removeChangedListener=Q.prototype.yk;Q.prototype.addChangedListener=Q.prototype.Ah;Q.prototype.removeModelChangedListener=Q.prototype.uA;Q.prototype.addModelChangedListener=Q.prototype.Hx;Q.prototype.findLayer=Q.prototype.km;Q.prototype.removeLayer=Q.prototype.sA;Q.prototype.addLayerAfter=Q.prototype.Ry;Q.prototype.addLayerBefore=Q.prototype.Fx;Q.prototype.addLayer=Q.prototype.bm;Q.prototype.moveParts=Q.prototype.moveParts; Q.prototype.copyParts=Q.prototype.ek;Q.prototype.removeParts=Q.prototype.Ut;Q.prototype.remove=Q.prototype.remove;Q.prototype.add=Q.prototype.add;Q.prototype.clearDelayedGeometries=Q.prototype.sv;Q.prototype.setProperties=Q.prototype.rw;Q.prototype.resetInputOptions=Q.prototype.jw;Q.prototype.setInputOption=Q.prototype.zA;Q.prototype.getInputOption=Q.prototype.om;Q.prototype.resetRenderingHints=Q.prototype.kw;Q.prototype.setRenderingHint=Q.prototype.zy;Q.prototype.getRenderingHint=Q.prototype.Ee; Q.prototype.maybeUpdate=Q.prototype.Wc;Q.prototype.requestUpdate=Q.prototype.Bb;Q.prototype.delayInitialization=Q.prototype.jz;Q.prototype.isUpdateRequested=Q.prototype.aA;Q.prototype.redraw=Q.prototype.Zd;Q.prototype.invalidateDocumentBounds=Q.prototype.Na;Q.prototype.findObjectsNear=Q.prototype.xg;Q.prototype.findPartsNear=Q.prototype.Az;Q.prototype.findObjectsIn=Q.prototype.tf;Q.prototype.findPartsIn=Q.prototype.Xx;Q.prototype.findObjectsAt=Q.prototype.Xi;Q.prototype.findPartsAt=Q.prototype.zz; Q.prototype.findObjectAt=Q.prototype.Ub;Q.prototype.findPartAt=Q.prototype.lm;Q.prototype.focusObject=Q.prototype.Lz;Q.prototype.alignDocument=Q.prototype.Xy;Q.prototype.zoomToRect=Q.prototype.KA;Q.prototype.zoomToFit=Q.prototype.zoomToFit;Q.prototype.diagramScroll=Q.prototype.Px;Q.prototype.focus=Q.prototype.focus;Q.prototype.reset=Q.prototype.reset;Q.useDOM=function(a){Sg=a?void 0!==x.document:!1};Q.isUsingDOM=function(){return Sg}; var Ce=null,si=new H,Oi=null,Ni=null,Sg=void 0!==x.document,Ii=null,Ji="",Hh=new D(Q,"None",0),bj=new D(Q,"Uniform",1),cj=new D(Q,"UniformToFill",2),Mf=new D(Q,"CycleAll",10),Qf=new D(Q,"CycleNotDirected",11),Sf=new D(Q,"CycleNotDirectedFast",12),Tf=new D(Q,"CycleNotUndirected",13),Nf=new D(Q,"CycleDestinationTree",14),Pf=new D(Q,"CycleSourceTree",15),Yh=new D(Q,"DocumentScroll",1),$h=new D(Q,"InfiniteScroll",2),ri=new D(Q,"TreeParentCollapsed",21),Fk=new D(Q,"AllParentsCollapsed",22),Gk=new D(Q, "AnyParentsCollapsed",23),Hk=new E,Ik="2.1.26",Jk=null,oi=!1; function pi(){if(Sg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Ra("7ca11abfd022028846");b[c]=Ra("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",qa.Dx+"4ae6247590da4bb21c324ba3a84e385776",qd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",K.za],e=1;5>e;e++)b[Ra("7ca11abfd7330390")](Ra(d[e-1]),10,15*e);b[c]=Ra("39f046ebb36e4b");for(c=1;5>c;c++)b[Ra("7ca11abfd7330390")](Ra(d[c-1]),10,15*c);Jk=a}}Q.className="Diagram"; Q.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.B instanceof Q?b.B:null};Q.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};Q.None=Hh;Q.Uniform=bj;Q.UniformToFill=cj;Q.CycleAll=Mf;Q.CycleNotDirected=Qf;Q.CycleNotDirectedFast=Sf;Q.CycleNotUndirected=Tf; Q.CycleDestinationTree=Nf;Q.CycleSourceTree=Pf;Q.DocumentScroll=Yh;Q.InfiniteScroll=$h;Q.TreeParentCollapsed=ri;Q.AllParentsCollapsed=Fk;Q.AnyParentsCollapsed=Gk;function Gi(){this.Ny=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Pe=this.l=!0:this.Pe=null} function yj(a,b){b.Fb.setTransform(b.Sb,0,0,b.Sb,0,0);if(null===a.Pe){b="f";var c=x[Ra("76a715b2f73f148a")][Ra("72ba13b5")];a.Pe=!0;if(Sg){var d=Q[Ra("76a115b6ed251eaf4692")];if(d)for(var e=Hk.iterator;e.next();){d=e.value;d=Ra(d).split(Ra("39e9"));if(6>d.length)break;var f=Ra(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Ra(qa[Ra("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Ra("76ad18b4f73e")];for(g=c[Ra("73a612b6fb191d")](Ra("35e7"))+2;gf&&Ra(d[2])!==Ra("7da71ca0ad381e90")&&(f=b[Ra("73a612b6fb191d")](Ra("76a715b2ef3e149757")));0>f&&(f=b[Ra("73a612b6fb191d")](Ra("76a715b2ef3e149757")));0>f&&(f=c[Ra("73a612b6fb191d")](Ra("7baa19a6f76c1988428554")));a.Pe=!(0<=f&&fh.length;)h+="9";h=h.substr(h.length-4);d="";d+=["gsh","gsf"][parseInt(h.substr(0, 1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(h.substr(0,1),10)%4];g[Ra("79a417a0f0181a8946")]=d;if(x.document[Ra("78a712aa")]){x.document[Ra("78a712aa")][Ra("7bb806b6ed32388c4a875b")](g);h=x.getComputedStyle(g).getPropertyValue(Ra("78a704b7e62456904c9b12701b6532a8"));x.document[Ra("78a712aa")][Ra("68ad1bbcf533388c4a875b")](g);if(!h)break;if(-1!==h.indexOf(parseInt(f[1]+f[2],16))&&-1!==h.indexOf(parseInt(f[3]+f[4],16))){a.Pe=!1;break}else if(Sa||Ta||Ua||Va)for(d="."+d,f=0;fMath.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&&(d=0Math.abs(b.wheelDeltaY)?-d:-e): void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0e||Math.abs(d.y-b.screenY)>e)?a.pd++:a.pd=1;c.clickCount=a.pd;a.Dj=b.timeStamp;a.qo.Bg(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():mj(c,b)}};a.vm=function(b){if(a.isEnabled){a.Vf=!0;var c= a.Nj;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]=b;else{if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}c[0].pointerId===b.pointerId&&(c=lj(a,b,b,null!==c[1]),c.targetDiagram=ij(b),a.doMouseMove(),mj(c,b))}};a.xm=function(b){if(a.isEnabled){a.Vf=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Ds;if(c&&a.Sj)delete d[b.pointerId],b.preventDefault();else if(d=a.Nj,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=kj(a,b,!1,!0,!0,!1); var e=x.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.B instanceof Q&&e.B!==a&&hj(e.B,b,d);hj(a,b,d);d.clickCount=a.pd;null===e?d.targetDiagram=ij(b):e.B?d.targetDiagram=e.B:d.targetDiagram=null;d.targetObject=null;a.doMouseUp();mj(d,b);c&&(a.me=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.wm=function(b){if(a.isEnabled){a.Vf=!1;var c=a.Ds;c[b.pointerId]&&delete c[b.pointerId];c=a.Nj;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.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}};b.sc(!0);Pi(a)}}Gi.className="DiagramHelper";function cf(a){this.l=void 0===a?new I:a;this.u=new I}ma.Object.defineProperties(cf.prototype,{point:{get:function(){return this.l},set:function(a){this.l=a}},shifted:{get:function(){return this.u},set:function(a){this.u=a}}});cf.className="DraggingInfo"; function Qj(a,b,c){this.node=a;this.info=b;this.Lv=c}Qj.className="DraggingNodeInfoPair";function Se(){this.reset()}Se.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new M(NaN,NaN)).freeze();this.gridSnapCellSpot=vc;this.gridSnapOrigin=(new I(NaN,NaN)).freeze();this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1;this.dragsMembers=this.groupsAlwaysMove=!0};Se.className="DraggingOptions"; function Kk(a){1 b.updateDelay?b.M():b.T||(b.T=!0,setTimeout(function(){b.T=!1;Qk(b);b.M()},b.updateDelay))};this.Yc=function(){null!==b.observed&&Pk(b)};this.autoScale=bj;this.Rb=!1}la(Nk,Q);Nk.prototype.computePixelRatio=function(){return 1}; Nk.prototype.bc=function(){null===this.Da&&B("No div specified");null===this.sa&&B("No canvas specified");if(!(this.sa instanceof Dj)&&(ii(this.box),this.Bc)){var a=this.observed;if(null!==a&&!a.animationManager.isAnimating){wj(this);var b=this.sa;a=this.Fb;a.sc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?Rk(this):null!==this.Ol&&(a.drawImage(this.Ol.Fa,0,0),b=this.nb,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&&0===this.position.y||b.translate(-this.position.x, -this.position.y),a.scale(this.Sb,this.Sb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy));b=this.Ka.j;for(var c=b.length,d=0;da&&(a=0);this.bb!==a&&(this.bb=a)}}});Nk.className="Overview";function Ok(){Re.call(this);this.l=null}la(Ok,Re); Ok.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||!a.allowMove||!a.allowSelect)return!1;var b=a.observed;if(null===b)return!1;var c=a.lastInput;if(!c.left||a.currentTool!==this&&(!this.isBeyondDragSize()||c.isTouchEvent&&c.timestamp-a.firstInput.timestampb.maxScale||(b.scale=a))};Sk.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);var b=this.diagram;if(b.autoScale!==Hh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom}; Sk.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;b.autoScale===Hh&&(a=b.scale*a,ab.maxScale||(b.scale=a))};Sk.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;if(b.autoScale!==Hh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Sk.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;ab.maxScale||(b.scale=a)}; Sk.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;return ab.maxScale?!1:b.allowZoom};Sk.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Xc();a.Zd();var c=a.position,d=a.scale;Bh(b,"Zoom To Fit");d===this.nv&&!isNaN(this.Ou)&&a.documentBounds.w(this.mv)?(a.scale=this.Ou,a.position=this.ix,this.nv=NaN,this.mv=ic):(this.Ou=d,this.ix=c.copy(),a.zoomToFit(),this.nv=a.scale,this.mv=a.documentBounds.copy());Dh(b)}; Sk.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; Sk.prototype.scrollToPart=function(a){void 0===a&&(a=null);var b=this.diagram;Li(b);if(null===a){try{null!==this.mg&&(this.mg.next()?a=this.mg.value:this.mg=null)}catch(k){this.mg=null}null===a&&(0a&&(a+=360));return a}; t.uf=function(){if(0!==(this.F&4096)===!1)return this.Yk;var a=this.ya;return null!==this.panel?a*this.panel.uf():a};t.zt=function(a,b){void 0===b&&(b=new I);b.assign(a);this.wd.Xd(b);return b};t.Vc=function(a,b,c){return this.jk(a.x,a.y,b.x,b.y,c)}; t.jk=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,K.Vc(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=K.Vc(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; Y.prototype.measure=function(a,b,c,d){if(!1!==tj(this)){var e=this.bh,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=0;this instanceof W&&(g=this.strokeWidth);90===f||270===f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof X;switch(ll(this,!0)){case xg:g=e=0;h&&(b=a=Infinity); break;case ud:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case Xk:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case Yk:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.widthh.height&&k.heighta.height||this.qb>a.width)))c=!0;this.F=c?this.F|256:this.F&-257;this.wb.v()||B("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.wb.toString());this.Pt(f,this.wb);ml(this,!1);N.free(f)};t=Y.prototype;t.Ch=function(){}; function nl(a,b,c,d,e){a.wb.h(b,c,d,e);if(!a.desiredSize.v()){var f=a.oc;c=a.bh;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=ll(a,!0);c===d&&f===e&&(b=xg);switch(b){case xg:if(c>d||f>e)oj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case ud:oj(a,!0);a.measure(d,e,0,0);break;case Xk:oj(a,!0);a.measure(d,f,0,0);break;case Yk:oj(a,!0),a.measure(c,e,0,0)}}} t.Pt=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||ol(c,!0),this.M(),$b(a,b)||(c.Ih(),this.Yo(c)))};t.Yo=function(a){null!==this.portId&&(ol(a,!0),a instanceof V&&pl(a,this))}; t.bc=function(a,b){if(this.visible){var c=this instanceof X&&(this.type===X.TableRow||this.type===X.TableColumn),d=this.wb;if(c||0!==d.width&&0!==d.height&&!isNaN(d.x)&&!isNaN(d.y)){var e=this.opacity;if(0!==e){var f=1;1!==e&&(f=a.globalAlpha,a.globalAlpha=f*e);if(!this.Rx(a,b))if(c)ql(this,a,b);else{this instanceof S&&this.qk(!1);c=this.transform;var g=this.panel;0!==(this.F&4096)===!0&&rl(this);var h=this.part,k=!1,l=0;if(h&&b.Ee("drawShadows")&&(k=h.isShadowed)){var m=h.shadowOffset;l=Math.max(m.y, m.x)*b.scale*b.Sb}if(!(m=b.pi||!this.yf())){var n=this.naturalBounds;m=this.Sh;var p=m.m11,r=m.m21,q=m.dx,u=m.m12,v=m.m22,w=m.dy,y,z=y=0;m=y*p+z*r+q;var A=y*u+z*v+w;y=n.width+l;z=0;var C=y*p+z*r+q;y=y*u+z*v+w;z=Math.min(m,C);var G=Math.min(A,y);var L=Math.max(m+0,C)-z;var J=Math.max(A+0,y)-G;m=z;A=G;y=n.width+l;z=n.height+l;C=y*p+z*r+q;y=y*u+z*v+w;z=Math.min(m,C);G=Math.min(A,y);L=Math.max(m+L,C)-z;J=Math.max(A+J,y)-G;m=z;A=G;y=0;z=n.height+l;C=y*p+z*r+q;y=y*u+z*v+w;z=Math.min(m,C);G=Math.min(A,y); L=Math.max(m+L,C)-z;J=Math.max(A+J,y)-G;m=z;A=G;l=b.viewportBounds;n=l.x;p=l.y;m=!(m>l.width+n||n>L+m||A>l.height+p||p>J+A)}if(m){m=0!==(this.F&256);a.clipInsteadOfFill&&(m=!1);this instanceof Ug&&(a.font=this.font);if(m){A=g.ce()?g.naturalBounds:g.actualBounds;null!==this.md?(n=this.md,L=n.x,J=n.y,l=n.width,n=n.height):(L=Math.max(d.x,A.x),J=Math.max(d.y,A.y),l=Math.min(d.right,A.right)-L,n=Math.min(d.bottom,A.bottom)-J);if(L>d.width+d.x||d.x>A.width+A.x){1!==e&&(a.globalAlpha=f);return}a.save(); a.beginPath();a.rect(L,J,l,n);a.clip()}if(this.yf()){if(!h.isVisible()){1!==e&&(a.globalAlpha=f);return}k&&(A=h.shadowOffset,a.uw(A.x*b.scale*b.Sb,A.y*b.scale*b.Sb,h.shadowBlur),sl(a),a.shadowColor=h.shadowColor)}!0===this.shadowVisible?sl(a):!1===this.shadowVisible&&tl(a);h=this.naturalBounds;null!==this.dc&&(li(this,a,this.dc,!0,!0,h,d),this.dc instanceof ul&&this.dc.type===vl?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.Wd(this.dc)):a.fillRect(d.x,d.y,d.width,d.height));a.transform(c.m11, c.m12,c.m21,c.m22,c.dx,c.dy);k&&(null!==g&&0!==(g.F&512)||null!==g&&(g.type===X.Auto||g.type===X.Spot)&&g.tb()!==this)&&null===this.shadowVisible&&tl(a);null!==this.jb&&(l=this.naturalBounds,L=A=0,J=l.width,l=l.height,n=0,this instanceof W&&(l=this.ka.bounds,A=l.x,L=l.y,J=l.width,l=l.height,n=this.strokeWidth),li(this,a,this.jb,!0,!1,h,d),this.jb instanceof ul&&this.jb.type===vl?(a.beginPath(),a.rect(A-n/2,L-n/2,J+n,l+n),a.Wd(this.jb)):a.fillRect(A-n/2,L-n/2,J+n,l+n));k&&(null!==this.jb||null!==this.dc|| null!==g&&0!==(g.F&512)||null!==g&&(g.type===X.Auto||g.type===X.Spot)&&g.tb()!==this)?(wl(this,!0),null===this.shadowVisible&&tl(a)):wl(this,!1);this.Ui(a,b);k&&0!==(this.F&512)===!0&&sl(a);this.yf()&&k&&tl(a);m?(a.restore(),this instanceof X?a.sc(!0):a.sc(!1)):c.Ft()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21*b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy)))}}1!==e&&(a.globalAlpha=f)}}}};t.Rx=function(){return!1}; function ql(a,b,c){var d=a.wb,e=a.pc;null!==a.dc&&(li(a,b,a.dc,!0,!0,e,d),a.dc instanceof ul&&a.dc.type===vl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Wd(a.dc)):b.fillRect(d.x,d.y,d.width,d.height));null!==a.jb&&(li(a,b,a.jb,!0,!1,e,d),a.jb instanceof ul&&a.jb.type===vl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Wd(a.jb)):b.fillRect(d.x,d.y,d.width,d.height));a.Ui(b,c)}t.Ui=function(){}; function li(a,b,c,d,e,f,g){if(null!==c){var h=1,k=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===xl)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var l=0;a instanceof W&&(l=a.strokeWidth);h=f.width;k=f.height;e?(h=g.width,k=g.height):d||(h+=l,k+=l);if((f=b instanceof yl)&&c.fe&&(c.type===zl||c.Ok===h&&c.mu===k))var m=c.fe;else{var n=0,p=0,r=0,q=0,u=0,v=0;v=u=0;e?(u=g.x,v=g.y):d||(u-=l/2,v-=l/2);n=c.start.x*h+c.start.offsetX;p=c.start.y*k+c.start.offsetY;r=c.end.x*h+c.end.offsetX; q=c.end.y*k+c.end.offsetY;n+=u;r+=u;p+=v;q+=v;if(c.type===Al)m=b.createLinearGradient(n,p,r,q);else if(c.type===vl)v=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(u=0,v=Math.max(h,k)/2):u=c.startRadius,m=b.createRadialGradient(n,p,u,r,q,v);else if(c.type===zl)try{m=b.createPattern(c.pattern,"repeat")}catch(y){m=null}if(c.type!==zl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)m.addColorStop(e.key,e.value);if(f&&(c.fe=m,null!==m&&(c.Ok=h,c.mu=k),null===m&&c.type===zl&& -1!==c.Ok)){c.Ok=-1;var w=a.diagram;null!==w&&-1===c.Ok&&sa(function(){w.Zd()},600)}}d?b.fillStyle=m:b.strokeStyle=m}}}t.zg=function(a){if(a instanceof X)a:{if(this!==a&&null!==a)for(var b=this.panel;null!==b;){if(b===a){a=!0;break a}b=b.panel}a=!1}else a=!1;return a};t.zf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.zf():!0};t.Ag=function(){for(var a=this instanceof X?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; function rl(a){if(0!==(a.F&2048)===!0){var b=a.nb;b.reset();if(!a.wb.v()||!a.oc.v()){Bl(a,!1);return}b.translate(a.wb.x-a.oc.x,a.wb.y-a.oc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;jl(a,b,c.x,c.y,c.width,c.height)}Bl(a,!1);Cl(a,!0)}0!==(a.F&4096)===!0&&(b=a.panel,null===b?(a.Sh.set(a.nb),a.Yk=a.scale,Cl(a,!1)):null!==b.wd&&(c=a.Sh,c.reset(),b.ce()?c.multiply(b.Sh):null!==b.panel&&c.multiply(b.panel.Sh),c.multiply(a.nb),a.Yk=a.scale*b.Yk,Cl(a,!1)))} function jl(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.Yb){var g=Ac;a.yf()&&a.locationSpot.hb()&&(g=a.locationSpot);var h=I.alloc();if(a instanceof T&&a.locationObject!==a)for(c=a.locationObject,d=c.naturalBounds,h.zk(d.x,d.y,d.width,d.height,g),c.Zf.ra(h),h.offset(-c.measuredBounds.x,-c.measuredBounds.y),g=c.panel;null!==g&&g!==a;)g.Zf.ra(h),h.offset(-g.measuredBounds.x,-g.measuredBounds.y),g=g.panel;else h.zk(c,d,e,f,g);b.rotate(a.Yb,h.x,h.y);I.free(h)}} t.o=function(a){void 0===a&&(a=!1);if(!0!==tj(this)){oj(this,!0);ml(this,!0);var b=this.panel;null===b||a||b.o()}};t.qm=function(){!0!==tj(this)&&(oj(this,!0),ml(this,!0))};function Dl(a){if(!1===uj(a)){var b=a.panel;null!==b?b.o():a.yf()&&(b=a.diagram,null!==b&&(b.od.add(a),a instanceof V&&a.fd(),b.Bb()));ml(a,!0)}}t.nl=function(){0!==(this.F&2048)===!1&&(Bl(this,!0),Cl(this,!0))};t.Pv=function(){Cl(this,!0)};t.M=function(){var a=this.part;null!==a&&a.M()}; function ll(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===X.Table)return El(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===X.Auto&&d.tb()===a)return Fl(a,ud,b);if(c===Wk){if(null!==d){if(d.type===X.Spot&&d.tb()===a)return Fl(a,ud,b);c=d.defaultStretch;return c===Wk?Fl(a,xg,b):Fl(a,c,b)}return Fl(a,xg,b)}return Fl(a,c,b)} function El(a,b,c,d){var e=a.stretch;if(e!==Wk)return Fl(a,e,d);var f=e=null;switch(b.stretch){case Yk:f=!0;break;case ud:f=!0}switch(c.stretch){case Xk:e=!0;break;case ud:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===Xk||b===ud);null===f&&(f=b===Yk||b===ud);return!0===e&&!0===f?Fl(a,ud,d):!0===e?Fl(a,Xk,d):!0===f?Fl(a,Yk,d):Fl(a,xg,d)} function Fl(a,b,c){if(c)return b;if(b===xg)return xg;c=a.desiredSize;if(c.v())return xg;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===Xk)return xg;if(b===ud)return Yk}else{if(b===Yk)return xg;if(b===ud)return Xk}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===Yk)return xg;if(b===ud)return Xk}else{if(b===Xk)return xg;if(b===ud)return Yk}return b}function wl(a,b){a.F=b?a.F|512:a.F&-513}function fl(a){return 0!==(a.F&1024)}function Gl(a,b){a.F=b?a.F|1024:a.F&-1025} function Bl(a,b){a.F=b?a.F|2048:a.F&-2049}function Cl(a,b){a.F=b?a.F|4096:a.F&-4097}function tj(a){return 0!==(a.F&8192)}function oj(a,b){a.F=b?a.F|8192:a.F&-8193}function uj(a){return 0!==(a.F&16384)}function ml(a,b){a.F=b?a.F|16384:a.F&-16385}t.fj=function(a){this.kg=a};t.Zt=function(){};t.qw=function(a){this.ma.assign(a);Dl(this);return!0};t.Tq=function(a,b){if(this.ma.x!==a||this.ma.y!==b)this.ma.h(a,b),this.nl()}; function Hl(a){var b=a.part;if(b instanceof V&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||pl(b,a)}}function Il(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof X?a instanceof V?a.fd():a.Nm(a,function(a){Hl(a)}):Hl(a))}t.bind=function(a){a.cd=this;var b=this.Yi();null!==b&&Jl(b)&&B("Cannot add a Binding to a template that has already been copied: "+a);null===this.cb&&(this.cb=new E);this.cb.add(a)}; t.Yi=function(){for(var a=this instanceof X?this:this.panel;null!==a;){if(null!==a.ei)return a;a=a.panel}return null};t.rw=function(a){Aj(this,a)};function Kl(a,b){b.cd=a;null===a.Gg&&(a.Gg=new H);a.Gg.add(b.propertyName,b)} function Ll(a,b){for(var c=1;ce)&&B("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.isRow= !0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&B("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new db;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Aj(a,e)}else Aj(a,b);else B('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function Ql(a,b){Ml.add(a,b)} function Rl(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} ma.Object.defineProperties(Y.prototype,{shadowVisible:{get:function(){return this.Nl},set:function(a){var b=this.Nl;b!==a&&(this.Nl=a,this.M(),this.g("shadowVisible",b,a))}},enabledChanged:{get:function(){return null!==this.N?this.N.In:null},set:function(a){cl(this);var b=this.N.In;b!==a&&(this.N.In=a,this.g("enabledChanged",b,a))}},segmentOrientation:{get:function(){return this.Ll},set:function(a){var b=this.Ll; b!==a&&(this.Ll=a,this.o(),this.g("segmentOrientation",b,a),a===ag&&(this.angle=0))}},segmentIndex:{get:function(){return this.Cp},set:function(a){a=Math.round(a);var b=this.Cp;b!==a&&(this.Cp=a,this.o(),this.g("segmentIndex",b,a))}},segmentFraction:{get:function(){return this.Jl},set:function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&B("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.ya=a,this.o(),this.g("scale",b,a))}},angle:{get:function(){return this.Yb},set:function(a){var b=this.Yb;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.Yb=a,Il(this),this.o(),this.g("angle",b,a)))}},desiredSize:{get:function(){return this.Nc},set:function(a){var b=a.width,c=a.height,d=this.Nc,e= d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Nc=a=a.G(),this.o(),this instanceof W&&this.cc(),this.g("desiredSize",d,a),fl(this)&&(a=this.part,null!==a&&(gl(this,a,"width"),gl(this,a,"height"))))}},width:{get:function(){return this.Nc.width},set:function(a){var b=this.Nc.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Nc,this.Nc=a=(new M(a,this.Nc.height)).freeze(),this.o(),this instanceof W&&this.cc(),this.g("desiredSize",b,a),fl(this)&& (a=this.part,null!==a&&gl(this,a,"width")))}},height:{get:function(){return this.Nc.height},set:function(a){var b=this.Nc.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Nc,this.Nc=a=(new M(this.Nc.width,a)).freeze(),this.o(),this instanceof W&&this.cc(),this.g("desiredSize",b,a),fl(this)&&(a=this.part,null!==a&&gl(this,a,"height")))}},minSize:{get:function(){return this.bg},set:function(a){var b=this.bg;b.w(a)||(a=a.copy(),isNaN(a.width)&&(a.width= 0),isNaN(a.height)&&(a.height=0),a.freeze(),this.bg=a,this.o(),this.g("minSize",b,a))}},maxSize:{get:function(){return this.ag},set:function(a){var b=this.ag;b.w(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.ag=a,this.o(),this.g("maxSize",b,a))}},measuredBounds:{get:function(){return this.oc}},naturalBounds:{get:function(){return this.pc}},margin:{ get:function(){return this.bh},set:function(a){"number"===typeof a&&(a=new oc(a));var b=this.bh;b.w(a)||(this.bh=a=a.G(),this.o(),this.g("margin",b,a))}},transform:{get:function(){0!==(this.F&2048)===!0&&rl(this);return this.nb}},wd:{get:function(){0!==(this.F&4096)===!0&&rl(this);return this.Sh}},alignment:{get:function(){return this.xb},set:function(a){var b=this.xb;b.w(a)||(a.kc()&&!a.Nb()&& B("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.xb=a=a.G(),Dl(this),this.g("alignment",b,a))}},column:{get:function(){return this.Lg},set:function(a){a=Math.round(a);var b=this.Lg;b!==a&&(0>a&&va(a,">= 0",Y,"column"),this.Lg=a,this.o(),this.g("column",b,a))}},columnSpan:{get:function(){return this.ln},set:function(a){a=Math.round(a);var b=this.ln;b!==a&&(1>a&&va(a,">= 1",Y,"columnSpan"),this.ln=a, this.o(),this.g("columnSpan",b,a))}},row:{get:function(){return this.vp},set:function(a){a=Math.round(a);var b=this.vp;b!==a&&(0>a&&va(a,">= 0",Y,"row"),this.vp=a,this.o(),this.g("row",b,a))}},rowSpan:{get:function(){return this.wp},set:function(a){a=Math.round(a);var b=this.wp;b!==a&&(1>a&&va(a,">= 1",Y,"rowSpan"),this.wp=a,this.o(),this.g("rowSpan",b,a))}},spanAllocation:{get:function(){return this.Pp},set:function(a){var b= this.Pp;b!==a&&(this.Pp=a,this.o(),this.g("spanAllocation",b,a))}},alignmentFocus:{get:function(){return this.Hk},set:function(a){var b=this.Hk;b.w(a)||(this.Hk=a=a.G(),this.o(),this.g("alignmentFocus",b,a))}},portId:{get:function(){return this.ip},set:function(a){var b=this.ip;if(b!==a){var c=this.part;null===c||c instanceof V||(B("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&Tl(c,this);this.ip=a;null!==a&&null!==c&&(c.Hh= !0,Ul(c,this));this.g("portId",b,a)}}},toSpot:{get:function(){return null!==this.O?this.O.vh:uc},set:function(a){this.Gc();var b=this.O.vh;b.w(a)||(a=a.G(),this.O.vh=a,this.g("toSpot",b,a),Hl(this))}},toEndSegmentLength:{get:function(){return null!==this.O?this.O.th:10},set:function(a){this.Gc();var b=this.O.th;b!==a&&(0>a&&va(a,">= 0",Y,"toEndSegmentLength"),this.O.th=a,this.g("toEndSegmentLength",b,a),Hl(this))}},toShortLength:{ get:function(){return null!==this.O?this.O.uh:0},set:function(a){this.Gc();var b=this.O.uh;b!==a&&(this.O.uh=a,this.g("toShortLength",b,a),Hl(this))}},toLinkable:{get:function(){return null!==this.O?this.O.Yp:null},set:function(a){this.Gc();var b=this.O.Yp;b!==a&&(this.O.Yp=a,this.g("toLinkable",b,a))}},toMaxLinks:{get:function(){return null!==this.O?this.O.Zp:Infinity},set:function(a){this.Gc();var b=this.O.Zp;b!==a&&(0>a&& va(a,">= 0",Y,"toMaxLinks"),this.O.Zp=a,this.g("toMaxLinks",b,a))}},fromSpot:{get:function(){return null!==this.O?this.O.Vg:uc},set:function(a){this.Gc();var b=this.O.Vg;b.w(a)||(a=a.G(),this.O.Vg=a,this.g("fromSpot",b,a),Hl(this))}},fromEndSegmentLength:{get:function(){return null!==this.O?this.O.Tg:10},set:function(a){this.Gc();var b=this.O.Tg;b!==a&&(0>a&&va(a,">= 0",Y,"fromEndSegmentLength"),this.O.Tg=a,this.g("fromEndSegmentLength", b,a),Hl(this))}},fromShortLength:{get:function(){return null!==this.O?this.O.Ug:0},set:function(a){this.Gc();var b=this.O.Ug;b!==a&&(this.O.Ug=a,this.g("fromShortLength",b,a),Hl(this))}},fromLinkable:{get:function(){return null!==this.O?this.O.Pn:null},set:function(a){this.Gc();var b=this.O.Pn;b!==a&&(this.O.Pn=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{get:function(){return null!==this.O?this.O.Qn:Infinity}, set:function(a){this.Gc();var b=this.O.Qn;b!==a&&(0>a&&va(a,">= 0",Y,"fromMaxLinks"),this.O.Qn=a,this.g("fromMaxLinks",b,a))}},cursor:{get:function(){return this.hi},set:function(a){var b=this.hi;b!==a&&(this.hi=a,this.g("cursor",b,a))}},click:{get:function(){return null!==this.N?this.N.Kf:null},set:function(a){cl(this);var b=this.N.Kf;b!==a&&(this.N.Kf=a,this.g("click",b,a))}},doubleClick:{get:function(){return null!== this.N?this.N.Pf:null},set:function(a){cl(this);var b=this.N.Pf;b!==a&&(this.N.Pf=a,this.g("doubleClick",b,a))}},contextClick:{get:function(){return null!==this.N?this.N.Lf:null},set:function(a){cl(this);var b=this.N.Lf;b!==a&&(this.N.Lf=a,this.g("contextClick",b,a))}},mouseEnter:{get:function(){return null!==this.N?this.N.dg:null},set:function(a){cl(this);var b=this.N.dg;b!==a&&(this.N.dg=a,this.g("mouseEnter",b,a))}},mouseLeave:{ get:function(){return null!==this.N?this.N.gg:null},set:function(a){cl(this);var b=this.N.gg;b!==a&&(this.N.gg=a,this.g("mouseLeave",b,a))}},mouseOver:{get:function(){return null!==this.N?this.N.hg:null},set:function(a){cl(this);var b=this.N.hg;b!==a&&(this.N.hg=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return null!==this.N?this.N.fg:null},set:function(a){cl(this);var b=this.N.fg;b!==a&&(this.N.fg=a,this.g("mouseHover", b,a))}},mouseHold:{get:function(){return null!==this.N?this.N.eg:null},set:function(a){cl(this);var b=this.N.eg;b!==a&&(this.N.eg=a,this.g("mouseHold",b,a))}},mouseDragEnter:{get:function(){return null!==this.N?this.N.Ko:null},set:function(a){cl(this);var b=this.N.Ko;b!==a&&(this.N.Ko=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{get:function(){return null!==this.N?this.N.Lo:null},set:function(a){cl(this); var b=this.N.Lo;b!==a&&(this.N.Lo=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{get:function(){return null!==this.N?this.N.cg:null},set:function(a){cl(this);var b=this.N.cg;b!==a&&(this.N.cg=a,this.g("mouseDrop",b,a))}},actionDown:{get:function(){return null!==this.N?this.N.Tm:null},set:function(a){cl(this);var b=this.N.Tm;b!==a&&(this.N.Tm=a,this.g("actionDown",b,a))}},actionMove:{get:function(){return null!== this.N?this.N.Um:null},set:function(a){cl(this);var b=this.N.Um;b!==a&&(this.N.Um=a,this.g("actionMove",b,a))}},actionUp:{get:function(){return null!==this.N?this.N.Vm:null},set:function(a){cl(this);var b=this.N.Vm;b!==a&&(this.N.Vm=a,this.g("actionUp",b,a))}},actionCancel:{get:function(){return null!==this.N?this.N.Sm:null},set:function(a){cl(this);var b=this.N.Sm;b!==a&&(this.N.Sm=a,this.g("actionCancel",b,a))}},toolTip:{ get:function(){return null!==this.N?this.N.rg:null},set:function(a){cl(this);var b=this.N.rg;b!==a&&(this.N.rg=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return null!==this.N?this.N.Mf:null},set:function(a){cl(this);var b=this.N.Mf;b!==a&&(this.N.Mf=a,this.g("contextMenu",b,a))}}});Y.prototype.setProperties=Y.prototype.rw;Y.prototype.findTemplateBinder=Y.prototype.Yi;Y.prototype.bind=Y.prototype.bind;Y.prototype.isEnabledObject=Y.prototype.Ag; Y.prototype.isVisibleObject=Y.prototype.zf;Y.prototype.isContainedBy=Y.prototype.zg;Y.prototype.getNearestIntersectionPoint=Y.prototype.Vc;Y.prototype.getLocalPoint=Y.prototype.zt;Y.prototype.getDocumentScale=Y.prototype.uf;Y.prototype.getDocumentAngle=Y.prototype.aj;Y.prototype.getDocumentBounds=Y.prototype.nm;Y.prototype.getDocumentPoint=Y.prototype.ga;Y.prototype.intersectsRect=Y.prototype.Ic;Y.prototype.containedInRect=Y.prototype.Dh;Y.prototype.containsRect=Y.prototype.Ce; Y.prototype.containsPoint=Y.prototype.aa;Y.prototype.raiseChanged=Y.prototype.g;Y.prototype.raiseChangedEvent=Y.prototype.$a;Y.prototype.addCopyProperty=Y.prototype.Ex;var Ml=null;Y.className="GraphObject";Ml=new H; Ql("Button",function(){function a(a,b){return null!==a.diagram.Ub(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Ll(X,X.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof X){var c=a.Za("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", _buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Ll(W,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new P(0,0,2.76142374915397,2.761423749153969),spot2:new P(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Ag()&&b instanceof X&&(a=b.Za("ButtonBorder"),a instanceof W)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke=c}}; b.mouseLeave=function(a,b){b.Ag()&&b instanceof X&&(a=b.Za("ButtonBorder"),a instanceof W&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Ag()&&b instanceof X&&null!==b._buttonFillPressed&&0===a.button){var c=b.Za("ButtonBorder");if(c instanceof W){a=a.diagram;var d=a.skipsUndoManager;a.skipsUndoManager=!0;var g=b._buttonFillPressed;b._buttonFillOver=c.fill;c.fill=g;g=b._buttonStrokePressed;b._buttonStrokeOver=c.stroke;c.stroke=g;a.skipsUndoManager=d}}}; b.actionUp=function(b,d){if(d.Ag()&&d instanceof X&&null!==d._buttonFillPressed&&0===b.button){var c=d.Za("ButtonBorder");if(c instanceof W){var f=b.diagram,g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionCancel=function(b,d){if(d.Ag()&&d instanceof X&&null!==d._buttonFillPressed){var c=d.Za("ButtonBorder");if(c instanceof W){var f=b.diagram,g=f.skipsUndoManager; f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionMove=function(b,d){if(d.Ag()&&d instanceof X&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.Za("ButtonBorder"),b instanceof W))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!==g&&(b.fill=g);g=d._buttonStrokePressed; b.stroke!==g&&(b.stroke=g);c.skipsUndoManager=f}}};return b}); Ql("TreeExpanderButton",function(){var a=Ll("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ll(W,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ob},(new Mi("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).Iq()),{visible:!1},(new Mi("visible","isTreeLeaf",function(a){return!a})).Iq());a.click=function(a,c){c=c.part;c instanceof Ke&&(c=c.adornedPart);if(c instanceof V){var b=c.diagram; if(null!==b){b=b.commandHandler;if(c.isTreeExpanded){if(!b.canCollapseTree(c))return}else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); Ql("SubGraphExpanderButton",function(){var a=Ll("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ll(W,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ob},(new Mi("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).Iq()));a.click=function(a,c){c=c.part;c instanceof Ke&&(c=c.adornedPart);if(c instanceof uf){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return; a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});Ql("ToolTip",function(){return Ll(Ke,X.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new I(0,3),shadowBlur:5},Ll(W,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new P(0,0,4,6),spot2:new P(1,1,-4,-4)}))}); Ql("ContextMenu",function(){return Ll(Ke,X.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new I(0,3),shadowBlur:5},new Mi("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Ql("ContextMenuButton",function(){var a=Ll("Button");a.stretch=Xk;var b=a.Za("ButtonBorder");b instanceof W&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new P(0,0,2,3),b.spot2=new P(1,1,-2,-2));return a}); Ql("PanelExpanderButton",function(a){var b=Rl(a,"COLLAPSIBLE"),c=Ll("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Ll(W,{name:"ButtonIcon",strokeWidth:2},(new Mi("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Iq(b))); a=c.Za("ButtonBorder");a instanceof W&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!==d&&!d.isReadOnly){var e=c.Yi();null===e&&(e=c.part);null!==e&&(c=e.Za(b),null!==c&&(a.handled=!0,d.ua("Collapse/Expand Panel"),c.visible=!c.visible,d.Va("Collapse/Expand Panel")))}};return c}); Ql("CheckBoxButton",function(a){var b=Rl(a);a=Ll("Button",{desiredSize:new M(14,14)},Ll(W,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:ud,geometryStretch:zg,visible:!1},""!==b?(new Mi("visible",b)).my():[]));a.click=function(a,d){if(d instanceof X){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.Za("ButtonIcon");c.ua("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.Va("checkbox")}}};return a}); Ql("CheckBox",function(a){a=Rl(a);a=Ll("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new oc(0,1,0,0)});var b=Ll(X,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave, actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});a.mouseEnter=null;a.mouseLeave=null;a.actionDown=null;a.actionUp=null;a.actionCancel=null;a.actionMove=null;a.click=null;return b});Y.None=xg=new D(Y,"None",0);Y.Default=Wk=new D(Y,"Default",0);Y.Vertical=Yk=new D(Y,"Vertical",4);Y.Horizontal=Xk=new D(Y,"Horizontal",5);Y.Fill=ud=new D(Y,"Fill",3);Y.Uniform=zg=new D(Y,"Uniform",1); Y.UniformToFill=Zk=new D(Y,"UniformToFill",2);Y.FlipVertical=$k=new D(Y,"FlipVertical",1);Y.FlipHorizontal=al=new D(Y,"FlipHorizontal",2);Y.FlipBoth=bl=new D(Y,"FlipBoth",3);Y.make=Ll;Y.getBuilders=function(){var a=new H,b;for(b in Ml)if(b!==b.toLowerCase()){var c=Ml.H(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};Y.defineBuilder=Ql;Y.takeBuilderArgument=Rl; function dl(){this.In=this.Mf=this.rg=this.Sm=this.Vm=this.Um=this.Tm=this.cg=this.Lo=this.Ko=this.eg=this.fg=this.hg=this.gg=this.dg=this.Lf=this.Pf=this.Kf=null}dl.prototype.copy=function(){var a=new dl;a.Kf=this.Kf;a.Pf=this.Pf;a.Lf=this.Lf;a.dg=this.dg;a.gg=this.gg;a.hg=this.hg;a.fg=this.fg;a.eg=this.eg;a.Ko=this.Ko;a.Lo=this.Lo;a.cg=this.cg;a.Tm=this.Tm;a.Um=this.Um;a.Vm=this.Vm;a.Sm=this.Sm;a.rg=this.rg;a.Mf=this.Mf;a.In=this.In;return a};dl.className="GraphObjectEventHandlers"; function Vl(){this.La=[1,0,0,1,0,0]}Vl.prototype.copy=function(){var a=new Vl;a.La[0]=this.La[0];a.La[1]=this.La[1];a.La[2]=this.La[2];a.La[3]=this.La[3];a.La[4]=this.La[4];a.La[5]=this.La[5];return a};Vl.prototype.translate=function(a,b){this.La[4]+=this.La[0]*a+this.La[2]*b;this.La[5]+=this.La[1]*a+this.La[3]*b};Vl.prototype.scale=function(a,b){this.La[0]*=a;this.La[1]*=a;this.La[2]*=b;this.La[3]*=b};Vl.className="STransform"; function Wl(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.Lx=[];this.pattern=null}Wl.prototype.addColorStop=function(a,b){this.Lx.push({offset:a,color:b})};Wl.className="SGradient"; function Dj(a,b){this.ownerDocument=a=void 0===b?x.document:b;this.mA="http://www.w3.org/2000/svg";void 0!==a&&(this.Fa=this.vb("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Fa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Fa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.pq=null;this.context=new Xl(this)} Dj.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.style.width=c+"px",this.style.height=d+"px",this.Fa.setAttributeNS(null,"width",c+"px"),this.Fa.setAttributeNS(null,"height",d+"px"),this.Fa.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.Qu.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.Qu.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Dj.prototype.vb=function(a,b,c){a=this.ownerDocument.createElementNS(this.mA,a);if(za(b))for(var d in b)a.setAttributeNS("href"===d?"http://www.w3.org/1999/xlink":"",d,b[d]);void 0!==c&&(a.textContent=c);return a};Dj.prototype.getBoundingClientRect=function(){return this.Fa.getBoundingClientRect()};Dj.prototype.focus=function(){this.Fa.focus()};Dj.prototype.Qx=function(){this.ownerDocument=null}; ma.Object.defineProperties(Dj.prototype,{width:{get:function(){return this.Fa.width.baseVal.value},set:function(a){this.Fa.width=a}},height:{get:function(){return this.Fa.height.baseVal.value},set:function(a){this.Fa.height=a}},style:{get:function(){return this.Fa.style}}});Dj.className="SVGSurface"; function Xl(a){this.Ak=a;this.svg=a.Fa;this.stack=[];this.yc=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.df=this.Lp=this.Kp=0;this.Cq=null;this.path=[];this.Hu=!1;this.oh=null;this.ph=0;this.Vd=new Vl; Yl(this,1,0,0,1,0,0);var b=pb++,c=this.vb("clipPath",{id:"mainClip"+b});c.appendChild(this.vb("rect",{x:0,y:0,width:a.width,height:a.height}));this.Qu=c;this.Ak.Fa.appendChild(c);this.yc[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.oA={}}t=Xl.prototype; t.reset=function(){this.stack=[];this.yc=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.df=this.Lp=this.Kp=0;this.Cq=null;this.path=[];this.Vd=new Vl;Yl(this,1,0,0,1,0,0);var a=pb++,b=this.vb("clipPath", {id:"mainClip"+a});b.appendChild(this.vb("rect",{x:0,y:0,width:this.Ak.width,height:this.Ak.height}));this.Qu=b;this.Ak.Fa.appendChild(b);this.yc[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}; t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,r=b+n,q=f?0:1;d=f?d-e:e-d;(1E-6d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,q,a-m,b-n]),this.path.push(["A",c,c,0,1,q,p,r])):1E-6=Math.PI),q,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[]};t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){}; t.clip=function(){this.addPath("clipPath",this.path,this.Vd);this.addPath("clipPath",this.path,new Vl)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new Wl("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e}; t.createPattern=function(a){var b="";a instanceof HTMLCanvasElement&&(b=a.toDataURL());a instanceof HTMLImageElement&&(b=a.getAttribute("src"));var c=this.oA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+pb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.vb("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.vb("image",e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new Wl("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;a={x:0,y:0,width:m||d,height:n||e,href:l};K.$(d,h)&&K.$(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio= "xMidYMid slice"):a.preserveAspectRatio="none";l="";h/=d;k/=e;if(0!==f||0!==g)l+=" translate("+f+", "+g+")";if(1!==h||1!==k)l+=" scale("+h+", "+k+")";if(0!==b||0!==c)l+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+pb++,g=this.vb("clipPath",{id:f}),g.appendChild(this.vb("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),a["clip-path"]="url(#"+f+")";Zl(this,"image",a,this.Vd,l);this.addElement("image",a)};t.fill=function(){this.addPath("fill",this.path,this.Vd)}; t.Wd=function(){this.clipInsteadOfFill?this.clip():this.fill()};t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};Zl(this,"fill",a,this.Vd);this.addElement("rect",a)};t.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};Zl(this,"fill",b,this.Vd);this.addElement("text",b,a[0])};t.lineTo=function(a,b){this.path.push(["L",a,b])}; t.moveTo=function(a,b){this.path.push(["M",a,b])};t.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};t.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; t.restore=function(){this.Vd=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.lineDashOffset=a.lineDashOffset;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign}; t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;bb.offset?1:-1});for(e=0;ee.width+e.x||e.x>k.width+k.x||n>e.height+e.y||e.y>k.height+k.y)return!0;k=!0;Yl(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.yf()&&!this.isVisible())return!0;a.Vd.La=[1,0,0,1,0,0];(this instanceof Ug&&1b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.kn?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.kn?this.clip():this.fill()};t.ij=function(){this.kn||this.stroke()};t.uw=function(a,b,c){this.Kp=a;this.Lp=b;this.df=c}; t.st=function(a,b){var c=this.Y;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.qt=function(){var a=this.Y;void 0!==a.setLineDash&&(a.setLineDash(am),a.lineDashOffset=0)};t.sc=function(a){a&&(this.ku="");this.ju=this.lu=""}; ma.Object.defineProperties(yl.prototype,{fillStyle:{get:function(){return this.Y.fillStyle},set:function(a){this.ju!==a&&(this.ju=this.Y.fillStyle=a)}},font:{get:function(){return this.Y.font},set:function(a){this.ku!==a&&(this.ku=this.Y.font=a)}},globalAlpha:{get:function(){return this.Y.globalAlpha},set:function(a){this.Y.globalAlpha=a}},lineCap:{get:function(){return this.Y.lineCap}, set:function(a){this.Y.lineCap=a}},lineDashOffset:{get:function(){return this.Y.lineDashOffset},set:function(a){this.Y.lineDashOffset=a}},lineJoin:{get:function(){return this.Y.lineJoin},set:function(a){this.Y.lineJoin=a}},lineWidth:{get:function(){return this.Y.lineWidth},set:function(a){this.Y.lineWidth=a}},miterLimit:{get:function(){return this.Y.miterLimit},set:function(a){this.Y.miterLimit= a}},shadowBlur:{get:function(){return this.Y.shadowBlur},set:function(a){this.Y.shadowBlur=a}},shadowColor:{get:function(){return this.Y.shadowColor},set:function(a){this.Y.shadowColor=a}},shadowOffsetX:{get:function(){return this.Y.shadowOffsetX},set:function(a){this.Y.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Y.shadowOffsetY},set:function(a){this.Y.shadowOffsetY= a}},strokeStyle:{get:function(){return this.Y.strokeStyle},set:function(a){this.lu!==a&&(this.lu=this.Y.strokeStyle=a)}},textAlign:{get:function(){return this.Y.textAlign},set:function(a){this.Y.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Y.imageSmoothingEnabled},set:function(a){this.Y.imageSmoothingEnabled=a}},clipInsteadOfFill:{get:function(){return this.kn}, set:function(a){this.kn=a}}});var am=Object.freeze([]);yl.className="CanvasSurfaceContext";function bm(){this.T=this.u=this.I=this.l=0}bm.className="ColorNumbers";function ul(a){cm||(dm(),cm=!0);Ya(this);this.s=!1;void 0===a?(this.pa=xl,this.Nk="black"):"string"===typeof a?(this.pa=xl,this.Nk=a):(this.pa=a,this.Nk="black");a=this.pa;a===Al?(this.ud=wc,this.$k=Dc):this.$k=a===vl?this.ud=Ac:this.ud=uc;this.Zs=0;this.Kr=NaN;this.fe=this.Bs=this.ee=null;this.mu=this.Ok=0} ul.prototype.copy=function(){var a=new ul;a.pa=this.pa;a.Nk=this.Nk;a.ud=this.ud.G();a.$k=this.$k.G();a.Zs=this.Zs;a.Kr=this.Kr;null!==this.ee&&(a.ee=this.ee.copy());a.Bs=this.Bs;return a};t=ul.prototype;t.freeze=function(){this.s=!0;null!==this.ee&&this.ee.freeze();return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;null!==this.ee&&this.ee.ea();return this};t.gb=function(a){a.classType===ul&&(this.type=a)}; t.toString=function(){var a="Brush(";if(this.type===xl)a+=this.color;else if(a=this.type===Al?a+"Linear ":this.type===vl?a+"Radial ":this.type===zl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; t.addColorStop=function(a,b){this.s&&ua(this);("number"!==typeof a||!isFinite(a)||1a)&&va(a,"0 <= loc <= 1",ul,"addColorStop:loc");null===this.ee&&(this.ee=new H);this.ee.add(a,b);this.pa===xl&&(this.type=Al);this.fe=null;return this}; t.gA=function(a,b){this.s&&ua(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?em:b;if(this.type===xl)Th(this.color),this.color=fm(a,b);else if((this.type===Al||this.type===vl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Th(c.value),this.addColorStop(c.key,fm(a,b));return this};function gm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?em:c;Th(a);return fm(b,c)} t.iz=function(a,b){this.s&&ua(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?em:b;if(this.type===xl)Th(this.color),this.color=fm(-a,b);else if((this.type===Al||this.type===vl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Th(c.value),this.addColorStop(c.key,fm(-a,b));return this};function hm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?em:c;Th(a);return fm(-b,c)} function im(a,b,c){Th(a);a=jm.l;var d=jm.I,e=jm.u,f=jm.T;Th(b);void 0===c&&(c=.5);return"rgba("+Math.round((jm.l-a)*c+a)+", "+Math.round((jm.I-d)*c+d)+", "+Math.round((jm.u-e)*c+e)+", "+Math.round((jm.T-f)*c+f)+")"} t.ky=function(){if(this.type===xl)return km(this.color);if((this.type===Al||this.type===vl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===vl)return km(a.first().value);if(null!==a.get(.5))return km(a.get(.5));if(2===a.count)return a=a.na(),km(im(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h=e&&hd&&(f=c,c=d,d=f,f=e);e=d-c;return km(im(a.get(c),a.get(d),1-f/e))}return!1}; function km(a){if(!a)return!1;if(a instanceof ul)return a.ky();Th(a);return 128>(299*jm.l+587*jm.I+114*jm.u)/1E3} function fm(a,b){switch(b){case em:b=100*lm(jm.l);var c=100*lm(jm.I),d=100*lm(jm.u);mm.l=.4124564*b+.3575761*c+.1804375*d;mm.I=.2126729*b+.7151522*c+.072175*d;mm.u=.0193339*b+.119192*c+.9503041*d;mm.T=jm.T;b=nm(mm.l/om[0]);c=nm(mm.I/om[1]);d=nm(mm.u/om[2]);pm.l=116*c-16;pm.I=500*(b-c);pm.u=200*(c-d);pm.T=mm.T;pm.l=Math.min(100,Math.max(0,pm.l+100*a));a=(pm.l+16)/116;b=a-pm.u/200;mm.l=om[0]*qm(pm.I/500+a);mm.I=om[1]*(pm.l>rm*sm?Math.pow(a,3):pm.l/rm);mm.u=om[2]*qm(b);mm.T=pm.T;a=-.969266*mm.l+1.8760108* mm.I+.041556*mm.u;b=.0556434*mm.l+-.2040259*mm.I+1.0572252*mm.u;jm.l=255*tm((3.2404542*mm.l+-1.5371385*mm.I+-.4985314*mm.u)/100);jm.I=255*tm(a/100);jm.u=255*tm(b/100);jm.T=mm.T;jm.l=Math.round(jm.l);255jm.l&&(jm.l=0);jm.I=Math.round(jm.I);255jm.I&&(jm.I=0);jm.u=Math.round(jm.u);255jm.u&&(jm.u=0);return"rgba("+jm.l+", "+jm.I+", "+jm.u+", "+jm.T+")";case um:return Uh(),Vh.u=Math.min(100,Math.max(0,Vh.u+100*a)),"hsla("+Vh.l+", "+Vh.I+"%, "+Vh.u+"%, "+ Vh.T+")";default:return B("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}function Th(a){cm||(dm(),cm=!0);var b=vm;if(null!==b){b.clearRect(0,0,1,1);b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;b.fillStyle!==c?(b.fillRect(0,0,1,1),a=b.getImageData(0,0,1,1).data,jm.l=a[0],jm.I=a[1],jm.u=a[2],jm.T=a[3]/255):(b.fillStyle="#FFFFFF",b.fillStyle=a,jm.l=0,jm.I=0,jm.u=0,jm.T=1)}} function Uh(){var a=jm.l/255,b=jm.I/255,c=jm.u/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}Vh.l=Math.round(g);Vh.I=Math.round(100*a);Vh.u=Math.round(100*e);Vh.T=jm.T}function lm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function tm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function nm(a){return a>sm?Math.pow(a,1/3):(rm*a+16)/116}function qm(a){var b=a*a*a;return b>sm?b:(116*a-16)/rm}function Sl(a,b){"string"!==typeof a&&(a instanceof ul||B("Value for "+b+" must be a color string or a Brush, not "+a))}function dm(){vm=Sg?(new Dk(null)).context:null} ma.Object.defineProperties(ul.prototype,{type:{get:function(){return this.pa},set:function(a){this.s&&ua(this,a);this.pa=a;this.start.kc()&&(a===Al?this.start=wc:a===vl&&(this.start=Ac));this.end.kc()&&(a===Al?this.end=Dc:a===vl&&(this.end=Ac));this.fe=null}},color:{get:function(){return this.Nk},set:function(a){this.s&&ua(this,a);this.Nk=a;this.fe=null}},start:{get:function(){return this.ud},set:function(a){this.s&& ua(this,a);this.ud=a.G();this.fe=null}},end:{get:function(){return this.$k},set:function(a){this.s&&ua(this,a);this.$k=a.G();this.fe=null}},startRadius:{get:function(){return this.Zs},set:function(a){this.s&&ua(this,a);0>a&&va(a,">= zero",ul,"startRadius");this.Zs=a;this.fe=null}},endRadius:{get:function(){return this.Kr},set:function(a){this.s&&ua(this,a);0>a&&va(a,">= zero",ul,"endRadius");this.Kr=a;this.fe= null}},colorStops:{get:function(){return this.ee},set:function(a){this.s&&ua(this,a);this.ee=a;this.fe=null}},pattern:{get:function(){return this.Bs},set:function(a){this.s&&ua(this,a);this.Bs=a;this.fe=null}}});ul.prototype.isDark=ul.prototype.ky;ul.prototype.darkenBy=ul.prototype.iz;ul.prototype.lightenBy=ul.prototype.gA;ul.prototype.addColorStop=ul.prototype.addColorStop; var sm=216/24389,rm=24389/27,om=[95.047,100,108.883],vm=null,jm=new bm,Vh=new bm,mm=new bm,pm=new bm,cm=!1;ul.className="Brush";var xl;ul.Solid=xl=new D(ul,"Solid",0);var Al;ul.Linear=Al=new D(ul,"Linear",1);var vl;ul.Radial=vl=new D(ul,"Radial",2);var zl;ul.Pattern=zl=new D(ul,"Pattern",4);var em;ul.Lab=em=new D(ul,"Lab",5);var um;ul.HSL=um=new D(ul,"HSL",6); ul.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a);b=Math.floor(a+Math.random()*c).toString(16);var d=Math.floor(a+Math.random()*c).toString(16);a=Math.floor(a+Math.random()*c).toString(16);2>b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+a}; ul.isValidColor=function(a){if("black"===a)return!0;if(""===a)return!1;cm||(dm(),cm=!0);var b=vm;if(null===b)return!0;b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;if(b.fillStyle!==c)return!0;b.fillStyle="#FFFFFF";c=b.fillStyle;b.fillStyle=a;return b.fillStyle!==c};ul.lighten=function(a){return gm(a)};ul.lightenBy=gm;ul.darken=function(a){return hm(a)};ul.darkenBy=hm;ul.mix=im;ul.isDark=km;function Pl(){this.name="Base"}Pl.prototype.measure=function(){}; Pl.prototype.jA=function(a,b,c,d,e){a.measure(b,c,d,e)};Pl.prototype.arrange=function(){};Pl.prototype.Zy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Pl.prototype.bc=function(){};ma.Object.defineProperties(Pl.prototype,{classType:{get:function(){return X}}});Pl.prototype.arrangeElement=Pl.prototype.Zy;Pl.prototype.measureElement=Pl.prototype.jA;Pl.className="PanelLayout";function wm(){this.name="Base"}la(wm,Pl); wm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=xm(a);for(var k=0;kR&&(ib=Math.max(R-mh,0));var tn=0===O.actual;O.actual=O.actual+ib;R=Math.max(R-(ib+(tn?mh:0)),0)}if(1===Ec.columnSpan&&(Eb===xg||Eb===Yk)){O=a.getColumnDefinition(xc); var fg=O.uc();ib=Math.max(Wc-O.actual,0);ib+fg>U&&(ib=Math.max(U-fg,0));var Zj=0===O.actual;O.actual=O.actual+ib;U=Math.max(U-(ib+(Zj?fg:0)),0)}zf&&Ec.qm()}}}}}Ha(A);var Yb=0,Oc=0;h=a.columnCount;for(var cc=0;cc=a.rowCount);ke++)O=a.getRowDefinition(Na.row+ke),ib=0, ib=Eb===ud||Eb===Yk?Math.max(O.minimum,0===Xc[Na.row+ke]?O.maximum:Math.min(Xc[Na.row+ke],O.maximum)):Math.max(O.minimum,isNaN(O.Qc)?O.maximum:Math.min(O.Qc,O.maximum)),Ed.height+=ib;for(var le=1;le=a.columnCount);le++)O=a.getColumnDefinition(Na.column+le),ib=0,ib=Eb===ud||Eb===Xk?Math.max(O.minimum,0===ie[Na.column+le]?O.maximum:Math.min(ie[Na.column+le],O.maximum)):Math.max(O.minimum,isNaN(O.Qc)?O.maximum:Math.min(O.Qc,O.maximum)),Ed.width+=ib;ab.width+=Ed.width;ab.height+= Ed.height;var sh=Na.margin,th=sh.right+sh.left,Qd=sh.top+sh.bottom;Na.measure(ab.width,ab.height,f,g);for(var me=Na.measuredBounds,Ie=Math.max(me.width+th,0),Je=Math.max(me.height+Qd,0),ne=0,od=0;od=a.rowCount);od++)O=a.getRowDefinition(Na.row+od),ne+=O.total||0;if(ne=Cf)&&!(Na.row+uh>=a.rowCount);uh++){O=a.getRowDefinition(Na.row+uh);var Gd=O.ha||0,zi=xn(Na,O,mg);O.actual= Math.min(O.maximum,Gd+zi);O.ha!==Gd&&(Cf-=O.ha-Gd)}for(;0vh&&(O.actual=Math.min(O.maximum,vh+Cf),O.ha!==vh&&(Cf-=O.ha-vh));if(0===O.index)break;O=a.getRowDefinition(O.index-1)}}for(var wh=0,ck=0;ck=a.columnCount);ck++)O=a.getColumnDefinition(Na.column+ck),wh+=O.total||0;if(wh=Ai)&&!(Na.column+dk>=a.columnCount);dk++){O= a.getColumnDefinition(Na.column+dk);var yn=O.ha||0,Nt=Mt(Na,O,Lt);O.actual=Math.min(O.maximum,yn+Nt);O.ha!==yn&&(Ai-=O.ha-yn)}for(;0ek&&(O.actual=Math.min(O.maximum,ek+Ai),O.ha!==ek&&(Ai-=O.ha-ek));if(0===O.index)break;O=a.getColumnDefinition(O.index-1)}}}}Ha(C);M.free(Ed);M.free(ab);void 0!==Xc&&Ha(Xc);void 0!==ie&&Ha(ie);var ng=0,og=0,fk=a.desiredSize,ir=a.maxSize;Eb=ll(a,!0);var Bi=Oc=Yb=0,Ci=0;h=a.columnCount;for(var gk=0;gk=a.rowCount);J++)L=a.getRowDefinition(q+J),r.height+=L.total;for(J=1;J=a.columnCount);J++)L=a.getColumnDefinition(v+J),r.width+=L.total;var U=w.ha+r.width,R=u.ha+r.height;J= h;L=k;var ca=U,pa=R,O=h,xa=k,Ma=U,hb=R;h+U>c.width&&(Ma=Math.max(c.width-h,0));k+R>c.height&&(hb=Math.max(c.height-k,0));var Ea=C.alignment;if(Ea.Nb()){Ea=a.defaultAlignment;Ea.hb()||(Ea=Ac);var wb=Ea.x;var Ad=Ea.y;var ib=Ea.offsetX;Ea=Ea.offsetY;var Xb=w.alignment,$a=u.alignment;Xb.hb()&&(wb=Xb.x,ib=Xb.offsetX);$a.hb()&&(Ad=$a.y,Ea=$a.offsetY)}else wb=Ea.x,Ad=Ea.y,ib=Ea.offsetX,Ea=Ea.offsetY;if(isNaN(wb)||isNaN(Ad))Ad=wb=.5,Ea=ib=0;Xb=G.width;$a=G.height;var Nd=C.margin,xc=Nd.left+Nd.right,yf=Nd.top+ Nd.bottom,Ye=El(C,u,w,!1);!isNaN(C.desiredSize.width)||Ye!==ud&&Ye!==Xk||(Xb=Math.max(U-xc,0));!isNaN(C.desiredSize.height)||Ye!==ud&&Ye!==Yk||($a=Math.max(R-yf,0));U=C.maxSize;R=C.minSize;Xb=Math.min(U.width,Xb);$a=Math.min(U.height,$a);Xb=Math.max(R.width,Xb);$a=Math.max(R.height,$a);U=$a+yf;J+=ca*wb-(Xb+xc)*wb+ib+Nd.left;L+=pa*Ad-U*Ad+Ea+Nd.top;C.visible&&(fc(O,xa,Ma,hb,J,L,G.width,G.height)?C.arrange(J,L,Xb,$a):C.arrange(J,L,Xb,$a,new N(O,xa,Ma,hb)))}else C.nl(),C.actualBounds.ea(),ca=C.actualBounds, J=N.allocAt(ca.x,ca.y,ca.width,ca.height),ca.x=L.type===X.TableRow?f:h,ca.y=L.type===X.TableColumn?e:k,ca.width=G.width,ca.height=G.height,C.actualBounds.freeze(),ml(C,!1),$b(J,ca)||(G=C.part,null!==G&&(G.Ih(),C.Yo(G))),N.free(J)}}}M.free(r);for(a=0;a=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();for(var p=[],r=a.W.j,q=r.length,u=0;uy)){v=Wj(v.figure);for(var z=0;zy&&w.push(A))}}}}r=a.W.j;q= r.length;for(u=0;ue*Math.abs(w)*c))){y=C.opacity;v=1;if(1!==y){if(0===y)continue;v=b.globalAlpha;b.globalAlpha=v*y}z=p[u];A=!1;var G=C.strokeDashArray;null!==G&&(A=!0,b.st(G,C.strokeDashOffset));if("LineV"===C.figure&&null!==C.stroke&&0b)return 0===a%b;if(0!==a%b)return!1;b=c.length;for(var d=0;df)w.measure(Infinity,Infinity,0,0),y=w.measuredBounds,b.Jc(y),a.l.push(y);else{var z=w.segmentIndex,A=w.segmentFraction,C=w.alignmentFocus;C.kc()&&(C=Ac);var G=w.segmentOrientation,L=w.segmentOffset;if(isNaN(z)){var J=k.ka;y=Fa();J.Jv(A,y);var U=I.allocAt(y[0],y[1]);U.add(k.i(0));J.type=== vd?U.offset(-J.startX,-J.startY):(J=J.figures.first(),U.offset(-J.startX,-J.startY));J=y[2];if(G!==ag){var R=k.computeAngle(w,G,J);w.Yb=R}R=U.x-m.x;var ca=U.y-m.y;I.free(U);Ha(y)}else if(z<-f||z>=f)ca=k.midPoint,J=k.midAngle,G!==ag&&(R=k.computeAngle(w,G,J),w.Yb=R),R=ca.x-m.x,ca=ca.y-m.y;else{R=0;0<=z?(ca=n.L(z),y=zpa+10? 0<=z?J.Sa(ca):ca.Sa(J):pa>U+10?0<=z?y.Sa(R):R.Sa(y):0<=z?J.Sa(R):R.Sa(J)}else J=0<=z?ca.Sa(y):y.Sa(ca);G!==ag&&(R=k.computeAngle(w,G,J),w.Yb=R);R=ca.x+(y.x-ca.x)*A-m.x;ca=ca.y+(y.y-ca.y)*A-m.y}w.measure(Infinity,Infinity,0,0);y=w.measuredBounds;U=w.naturalBounds;var O=0;w instanceof W&&(O=w.strokeWidth);pa=U.width+O;var xa=U.height+O;h.reset();h.translate(-y.x,-y.y);h.scale(w.scale,w.scale);h.rotate(G===ag?w.angle:J,pa/2,xa/2);G!==Om&&G!==Pm||h.rotate(90,pa/2,xa/2);G!==Qm&&G!==Rm||h.rotate(-90,pa/ 2,xa/2);G===Sm&&(45J||225J)&&h.rotate(-J,pa/2,xa/2);U=new N(0,0,pa,xa);q.gj(U,C);h.ra(q);C=-q.x+O/2*w.scale;w=-q.y+O/2*w.scale;u.assign(L);O=isNaN(L.x);var Ma=isNaN(L.y);if(O||Ma){pa=pa/2+3;xa=xa/2+3;var hb=45<=J&&135>=J,Ea=225<=J&&315>=J;G===ag&&(hb||Ea)?(u.x=Ma?pa:L.y,u.y=O?xa:L.x,hb?0<=z||isNaN(z)&&.5>A||!O||(u.y=-xa):Ea&&((0<=z||isNaN(z)&&.5>A)&&O&&(u.y=-xa),Ma&&(u.x=-pa))):(O&&(u.x=0<=z||isNaN(z)&&.5>A?pa:-pa),Ma&&(u.y=-xa),u.rotate(J))}else u.rotate(J);R+=u.x;ca+=u.y;U.set(y); U.h(R+C,ca+w,y.width,y.height);a.l.push(U);b.Jc(U)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.sg=b;a=a.location;a.h(a.x+b.x,a.y+b.y);Vb(e,b.width||0,b.height||0);qd.free(h);I.free(q);I.free(u)}}}}; Mm.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Ke||a instanceof S){var d=null,e=null,f=null;a instanceof S&&(e=d=a);a instanceof Ke&&(f=a,d=f.adornedPart);var g=a instanceof Ke?null:d.path;if(0!==a.l.length){var h=a.l,k=0;if(null!==g&&k=c)v=p.midPoint,n=p.midAngle,l!==ag&&(p=p.computeAngle(g,l,n),g.angle=p),p=v.x,v=v.y; else{u=0;0<=h?(q=b.j[h],v=hy+10?0<=h?n.Sa(q):q.Sa(n):y>w+10?0<=h?v.Sa(u):u.Sa(v):0<=h?n.Sa(u):u.Sa(n)}else n=0<=h?q.Sa(v):v.Sa(q);l!==ag&&(p=p.computeAngle(g,l,n),g.angle=p);p=q.x+(v.x-q.x)*k;v=q.y+(v.y-q.y)*k}if(r.Ht())g.location=new I(p,v);else{r.kc()&&(r=Ac);q=qd.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle,0, 0);var z=g.naturalBounds;u=N.allocAt(0,0,z.width,z.height);w=I.alloc();w.gj(u,r);q.ra(w);r=-w.x;y=-w.y;var A=z.width,C=z.height;z=I.alloc();z.assign(m);var G=isNaN(m.x),L=isNaN(m.y);if(G||L){A=A/2+3;C=C/2+3;var J=45<=n&&135>=n,U=225<=n&&315>=n;l===ag&&(J||U)?(z.x=L?A:m.y,z.y=G?C:m.x,J?0<=h||isNaN(h)&&.5>k||!G||(z.y=-C):U&&((0<=h||isNaN(h)&&.5>k)&&G&&(z.y=-C),L&&(z.x=-A))):(G&&(z.x=0<=h||isNaN(h)&&.5>k?A:-A),L&&(z.y=-C),z.rotate(n))}else z.rotate(n);p+=z.x;v+=z.y;q.Bw(u);r+=u.x;y+=u.y;h=I.allocAt(p+ r,v+y);g.move(h);I.free(h);I.free(z);I.free(w);N.free(u);qd.free(q)}}null!==f?f.qk(!1):null!==e&&e.qk(!1)}}; function Nm(a,b,c,d){if(!1!==tj(d)){var e=d.strokeWidth;0===e&&a instanceof Ke&&a.type===X.Link&&a.adornedObject instanceof W&&(e=a.adornedObject.strokeWidth);e*=d.ya;a instanceof S&&null!==a.ka?(a=a.ka.bounds,il(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Ke&&null!==a.adornedPart.ka?(a=a.adornedPart.ka.bounds,il(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):il(d,-(e/2),-(e/2),b+e,c+e);oj(d,!1)}}function Tm(){this.name="Base"}la(Tm,Pl); Tm.prototype.measure=function(a,b,c,d,e,f,g){var h=a.tb();a.Wg=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new N(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.Wg.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,v=r.flattenedLengths,w=r.flattenedTotalLength,y=u.length,z=0,A=0,C=Fa(),G=0;GO&&(O+=360);J.push(O)}z=ca;A=pa}C.push(J)}if(null===a.Xg){for(var xa=[],Ma=a.W.j,hb=Ma.length,Ea=0;Eaib))for(var Xb=0;Xbib&&Ad.push(Nd)}}}}a.Xg=xa}var xc=a.Xg;var yf=a.W.j,Ye=yf.length,Ge=0,lh=0,Ec=w;a.xj=[];for(var zf,Ze=0;ZeEb*Yj*w/a.graduatedRange)){var Af=v[0][0],Bd=0,kc=0;lh=w*Od.graduatedStart-1E-4;Ec=w*Od.graduatedEnd+1E-4;var $e=Eb*Yj,Wc=a.graduatedTickBase;if(Wca.graduatedMin+$e&&(Wc-=Math.floor((Wc-a.graduatedMin)/$e)*$e);for(var mh=xc[Ze];Wc<=a.graduatedMax;){a:{for(var tn=mh.length,fg=0;fgw&&(Ge=w),lh<=Ge&&Ge<=Ec)){for(var Yb=C[Bd][kc],Oc=v[Bd][kc];BdAf&&kc af?0Ed;Ed++){switch(Ed){case 0:bb.h(Cd,Dd);break;case 1:bb.h(Cd+kg,Dd);break;case 2:bb.h(Cd,Dd+mc);break;case 3:bb.h(Cd+kg,Dd+mc)}bb.rotate(lg+xb.angle);bb.offset(qh,rh);0===oh&&0===Ed?Pd.h(bb.x,bb.y,0,0):Pd.Ie(bb);bb.offset(-qh,-rh);bb.rotate(-lg-xb.angle)}I.free(bb);null!==bk.Wg&&bk.Wg.push(Pd);ec(xi,Pd.x,Pd.y,Pd.width,Pd.height)}else if(xb instanceof Ug){var Xc=a,ie=e;null===Xc.sh&&(Xc.sh=new Ug);var yb=Xc.sh;Um(yb,xb);var yi=xb.alignmentFocus;yi.kc()&&(yi=wc);for(var Yc= xb.segmentOrientation,wn=xb.segmentOffset,je=new N,Na=0,Fd=0,nc=0,ke=0,le=0,sh=ig.length,th=0;thnc||225nc)&&od.rotate(-nc,Je/2,ne/2);var Cf=N.allocAt(0,0,Je,ne),mg=I.alloc();mg.gj(Cf,yi);od.ra(mg);var xn=-mg.x,uh=-mg.y,Gd=I.alloc();Gd.assign(wn);isNaN(Gd.x)&&(Gd.x=Je/2+3);isNaN(Gd.y)&&(Gd.y=-(ne/2+3));Gd.rotate(nc);Na+=Gd.x+xn;Fd+=Gd.y+uh;var zi=new N(Na,Fd,me.width,me.height),vh=new N(me.x,me.y,me.width,me.height),wh=new N(Ie.x,Ie.y,Ie.width,Ie.height);Qd.dA=ke;Qd.lineCount=yb.lineCount;Qd.lines=[yb.qb,yb.vi, yb.je,yb.we,yb.Qb,yb.ib,yb.he];Qd.actualBounds=zi;Qd.measuredBounds=vh;Qd.naturalBounds=wh;0===th?je.assign(zi):je.Jc(zi);I.free(Gd);I.free(mg);N.free(Cf);qd.free(od)}null!==Xc.Wg&&Xc.Wg.push(je);ec(ie,je.x,je.y,je.width,je.height)}oj(xb,!1)}}}; Tm.prototype.arrange=function(a,b,c){if(null!==a.Wg){var d=a.tb(),e=a.xj;if(null!==e){var f=a.Wg,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=e&&(e=1);for(var g=f.actualBounds,h=a.W.j,k=a.xj,l=h.length,m=0;ma.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e)){var q=n.measuredBounds,u=n.strokeWidth*n.scale,v=n.alignmentFocus;v.kc()&& (v=wc);for(var w=0;wf.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.Og:a.Ng);var n=l.separatorStroke;null===n&&(n=c?a.ki:a.Mg);if(0!==m&&null!==n){li(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null===p&&(p=c?a.ji:a.ii);null!==p&&(n=!0,b.st(p,0));b.beginPath();p=l.position+m;c?p>f.height&&(m-= p-f.height):p>f.width&&(m-=p-f.width);l=l.position+m/2;b.lineWidth=m;m=a.fb;c?(l+=m.top,p=f.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=f.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();n&&b.qt()}}}} function Zm(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=0;km)){var n=l.uc(),p=l.separatorStrokeWidth;isNaN(p)&&(p=c?a.Og:a.Ng);var r=l.separatorStroke;null===r&&(r=c?a.ki:a.Mg);null===r&&(p=0);n-=p;p=l.position+p;n+=l.actual;p+n>m&&(n=m-p);0>=n||(m=a.fb,li(a,b,l.background,!0,!1,h,g),c?b.fillRect(m.left,p+m.top,g.width-(m.left+m.right),n):b.fillRect(p+ m.left,m.top,n,g.height-(m.top+m.bottom)))}}}}function Wj(a){return"LineV"===a||"BarV"===a} t.jk=function(a,b,c,d,e){var f=this.ce(),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),r=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.areaBackground)return g=this.actualBounds,K.Vc(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(null!==this.background)return f=a*k+b*m+p,h=a*l+b*n+r,a=c*k+d*m+p,k=c*l+d*n+r,e.h(0,0),c=this.naturalBounds,f=K.Vc(0,0,c.width,c.height,f,h,a,k,e),e.transform(g),f;f||(k=1,m=l=0,n=1,r=p=0);h=a*k+b*m+p;a=a*l+b* n+r;k=c*k+d*m+p;c=c*l+d*n+r;e.h(k,c);d=(k-h)*(k-h)+(c-a)*(c-a);l=!1;n=this.W.j;r=n.length;m=I.alloc();p=null;b=Infinity;var q=null,u=this.isClipping&&this.pa===X.Spot;u&&(q=I.alloc(),p=this.tb(),(l=p.jk(h,a,k,c,q))&&(b=(h-q.x)*(h-q.x)+(a-q.y)*(a-q.y)));for(var v=0;vd&&e.set(q),I.free(q));I.free(m);f&&e.transform(g);return l}; t.o=function(a){if(!0!==tj(this)){Y.prototype.o.call(this,a);a=null;if(this.pa===X.Auto||this.pa===X.Link)a=this.tb();for(var b=this.W.j,c=b.length,d=0;dc||f>d)this.o(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case ud:this.o(!0);this.measure(c+h,d+g,0,0);break;case Xk:this.o(!0);this.measure(c+h,f+g,0,0);break;case Yk:this.o(!0),this.measure(b+h,d+g,0,0)}}this.pa.arrange(this,e,this.sg)}}; t.Eh=function(a){var b=this.naturalBounds,c=xm(this);if(fc(0,0,b.width,b.height,a.x,a.y)){b=this.W.j;for(var d=b.length,e=I.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Ab(e.set(a),f.transform),f.aa(e))return I.free(e),!0}I.free(e);return null===this.jb&&null===this.dc?!1:!0}return!1};t.tt=function(a){if(this.Lk===a)return this;for(var b=this.W.j,c=b.length,d=0;dp.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof X?m:null;p=qd.alloc();p.set(g); if(null!==m?m.tf(a,b,c,d,e,p):kl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);qd.free(p)}}}void 0===f&&qd.free(g);return d}void 0===f&&qd.free(g);return!1};function gn(a,b,c,d){for(var e=a.W.j,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof X&&gn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.xg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var g=this.naturalBounds,h=this.ce(),k=h?a:Ab(I.allocAt(a.x,a.y),this.transform),l=h?b:Ab(I.allocAt(b.x,b.y),this.transform),m=k.De(l),n=0v.width||u.y>v.height||0>u.x+u.width||0>u.y+u.height))if(q.ce()?(u=q.transform,Ab(k.set(a),u),Ab(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof X?q:null,null!==q?q.xg(k,l,c,d,e,f):u.Wx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}I.free(k);I.free(l)}return e?n:g}return!1}; function Cm(a){var b=null;a instanceof W&&(b=a.spot1,b===$c&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=vc);return b}function Dm(a){var b=null;a instanceof W&&(b=a.spot2,b===$c&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Gc);return b}t.add=function(a){this.ub(this.W.count,a)};t.L=function(a){return this.W.L(a)}; t.ub=function(a,b){b instanceof T&&B("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.zg(b))this===b&&B("Cannot make a Panel contain itself: "+this.toString()),B("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.panel;null!==c&&c!==this&&B("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.pa!==X.Grid||b instanceof W||B("Can only add Shapes to a Grid Panel, not: "+b);this.pa!==X.Graduated||b instanceof W||b instanceof Ug||B("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.fj(this);b.Mj=null;if(null!==this.itemArray){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Md&&(this.Md=new H),this.Md.add(d,b))}var e=this.W;d=-1;if(c===this){for(var f=-1,g=this.W.j,h=g.length,k=0;k=e.count&&a>=e.count)return; e.ab(f);d=f}else B("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.ub(a,b);if(0===a||b.isPanelMain)this.Li=null;tj(this)||this.o();b.o(!1);null!==b.portId?this.Hh=!0:b instanceof X&&!0===b.Hh&&(this.Hh=!0);this.Xg=null;c=this.part;null!==c&&(c.Ij=null,c.dh=NaN,this.Hh&&c instanceof V&&(c.Hh=!0),c.Hh&&c instanceof V&&(c.rc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&&c.$a(xe,"elements",this,b,null,d,null),c.$a(we, "elements",this,null,b,null,a),this.Ag()||hn(this,b,!1)))};function jn(a,b){a.F=b?a.F|16777216:a.F&-16777217}t.remove=function(a){for(var b=this.W.j,c=b.length,d=-1,e=0;ea&&va(a,">= 0",X,"getRowDefinition:idx");a=Math.round(a);var b=this.sb;if(void 0===b)return null;if(void 0===b[a]){var c=new Uj;c.fj(this);c.isRow=!0;c.index=a;b[a]=c}return b[a]};X.prototype.hw=function(a){0>a&&va(a,">= 0",X,"removeRowDefinition:idx");a=Math.round(a);var b=this.sb;void 0!==b&&(this.$a(xe,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.o())}; X.prototype.getColumnDefinition=function(a){0>a&&va(a,">= 0",X,"getColumnDefinition:idx");a=Math.round(a);var b=this.ob;if(void 0===b)return null;if(void 0===b[a]){var c=new Uj;c.fj(this);c.isRow=!1;c.index=a;b[a]=c}return b[a]};t=X.prototype;t.fw=function(a){0>a&&va(a,">= 0",X,"removeColumnDefinition:idx");a=Math.round(a);var b=this.ob;void 0!==b&&(this.$a(xe,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.o())}; t.Bz=function(a){if(0>a||this.type!==X.Table)return-1;for(var b=0,c=this.sb,d=c.length,e=this.Oi;ea||this.type!==X.Table)return-1;for(var b=0,c=this.ob,d=c.length,e=this.xi;ea;)this.Hc(this.W.length-1,!1);a=this.itemArray;if(null!==a)for(var b=a.length,c=0;cc)){var d=nn(a,b),e=a.itemTemplateMap,f=null;null!==e&&(f=e.H(d));null===f&&(on||(on=!0,wa('No item template Panel found for category "'+d+'" on '+a),wa(" Using default item template."),d=new X,e=new Ug,e.bind(new Mi("text","",Ja)),d.add(e),pn=d),f=pn);d=f;null!==d&&(wg(d),d=d.copy(),0!==(d.F&16777216)&&(e=a.Yi(),null!==e&&jn(e,!0)),"object"===typeof b&&(null===a.Md&&(a.Md=new H),a.Md.add(b,d)),e=c+en(a),a.ub(e,d),d.kb=b,qn(a,e,c),d.kb=null,d.data= b)}}function qn(a,b,c){for(a=a.W;ba&&va(a,">= 0",X,"padding"),a=new oc(a)):(0>a.left&&va(a.left,">= 0",X,"padding:value.left"),0>a.right&&va(a.right,">= 0",X,"padding:value.right"),0>a.top&&va(a.top,">= 0",X,"padding:value.top"),0>a.bottom&&va(a.bottom,">= 0",X,"padding:value.bottom"));var b=this.fb;b.w(a)||(this.fb=a=a.G(),this.o(),this.g("padding",b,a))}},defaultAlignment:{get:function(){return this.yn},set:function(a){var b=this.yn;b.w(a)||(this.yn=a=a.G(),this.o(),this.g("defaultAlignment", b,a))}},defaultStretch:{get:function(){return this.Nf},set:function(a){var b=this.Nf;b!==a&&(this.Nf=a,this.o(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{get:function(){return void 0===this.qj?sc:this.qj},set:function(a){if(void 0!==this.qj){"number"===typeof a&&(a=new oc(a));var b=this.qj;b.w(a)||(this.qj=a=a.G(),this.o(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{get:function(){return void 0=== this.ki?null:this.ki},set:function(a){var b=this.ki;b!==a&&(null===a||"string"===typeof a||a instanceof ul)&&(a instanceof ul&&a.freeze(),this.ki=a,this.M(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return void 0===this.Og?1:this.Og},set:function(a){if(void 0!==this.Og){var b=this.Og;b!==a&&isFinite(a)&&0<=a&&(this.Og=a,this.o(),this.g("defaultRowSeparatorStrokeWidth",b,a))}}},defaultRowSeparatorDashArray:{ get:function(){return void 0===this.ji?null:this.ji},set:function(a){if(void 0!==this.ji){var b=this.ji;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea)&&B("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Oi=a,this.o(), this.g("topIndex",b,a))}}},leftIndex:{get:function(){return void 0===this.xi?0:this.xi},set:function(a){if(void 0!==this.xi){var b=this.xi;b!==a&&((!isFinite(a)||0>a)&&B("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.xi=a,this.o(),this.g("leftIndex",b,a))}}},data:{get:function(){return this.kb},set:function(a){var b=this.kb;if(b!==a){var c=this instanceof T&&!(this instanceof Ke);wg(this);this.kb=a;var d=this.diagram; null!==d&&(c?(c=d.partManager,this instanceof S?(null!==b&&c.Ne.remove(b),null!==a&&c.Ne.add(a,this)):this instanceof T&&(null!==b&&c.Oe.remove(b),null!==a&&c.Oe.add(a,this))):(c=this.panel,null!==c&&null!==c.Md&&(null!==b&&c.Md.remove(b),null!==a&&c.Md.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Ba()}}},itemIndex:{get:function(){return this.no},set:function(a){var b=this.no;b!==a&&(this.no=a,this.g("itemIndex",b,a))}},itemArray:{ get:function(){return this.ui},set:function(a){var b=this.ui;if(b!==a||null!==a&&ln(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Lj(c.partManager,this,c),this.ui=a,null!==c&&null!==a&&Ij(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||this.Rt()}}},itemTemplate:{get:function(){return null===this.oe?null:this.oe.H("")},set:function(a){if(null===this.oe){if(null===a)return;this.oe=new H}var b=this.oe.H(""); b!==a&&((a instanceof T||a.isPanelMain)&&B("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.oe.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.Rt())}},itemTemplateMap:{get:function(){return this.oe},set:function(a){var b=this.oe;if(b!==a){for(var c=a.iterator;c.next(););this.oe=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.Rt()}}},itemCategoryProperty:{ get:function(){return this.rl},set:function(a){var b=this.rl;b!==a&&(this.rl=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{get:function(){return 0!==(this.F&1048576)},set:function(a){var b=0!==(this.F&1048576);b!==a&&(this.F^=1048576,this.g("isAtomic",b,a))}},isClipping:{get:function(){return 0!==(this.F&2097152)},set:function(a){var b=0!==(this.F&2097152);b!==a&&(a&&this.type!==X.Spot&&wa("Warning: Panel.isClipping set on non-Spot Panel: "+ this.toString()),this.F^=2097152,this.o(),this.g("isClipping",b,a))}},isOpposite:{get:function(){return 0!==(this.F&33554432)},set:function(a){var b=0!==(this.F&33554432);b!==a&&(this.F^=33554432,this.o(),this.g("isOpposite",b,a))}},isEnabled:{get:function(){return 0!==(this.F&4194304)},set:function(a){var b=0!==(this.F&4194304);if(b!==a){var c=null===this.panel||this.panel.Ag();this.F^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!== b&&b.undoManager.isUndoingRedoing||c&&hn(this,this,a)}}},alignmentFocusName:{get:function(){return this.Fg},set:function(a){var b=this.Fg;b!==a&&(this.Fg=a,this.o(),this.g("alignmentFocusName",b,a))}}}); ma.Object.defineProperties(X,{Position:{get:function(){return Ol.H("Position")}},Horizontal:{get:function(){return Ol.H("Horizontal")}},Vertical:{get:function(){return Ol.H("Vertical")}},Spot:{get:function(){return Ol.H("Spot")}},Auto:{get:function(){return Ol.H("Auto")}},Table:{get:function(){return Ol.H("Table")}},Viewbox:{ get:function(){return Ol.H("Viewbox")}},TableRow:{get:function(){return Ol.H("TableRow")}},TableColumn:{get:function(){return Ol.H("TableColumn")}},Link:{get:function(){return Ol.H("Link")}},Grid:{get:function(){return Ol.H("Grid")}},Graduated:{get:function(){return Ol.H("Graduated")}}});X.prototype.findItemPanelForData=X.prototype.Vx; X.prototype.rebuildItemElements=X.prototype.Rt;X.prototype.updateTargetBindings=X.prototype.Ba;X.prototype.copyTemplate=X.prototype.gz;X.prototype.graduatedValueForPoint=X.prototype.Sz;X.prototype.graduatedPointForValue=X.prototype.Rz;X.prototype.findColumnForLocalX=X.prototype.sz;X.prototype.findRowForLocalY=X.prototype.Bz;X.prototype.removeColumnDefinition=X.prototype.fw;X.prototype.removeRowDefinition=X.prototype.hw;X.prototype.removeAt=X.prototype.ab;X.prototype.remove=X.prototype.remove; X.prototype.insertAt=X.prototype.ub;X.prototype.elt=X.prototype.L;X.prototype.add=X.prototype.add;X.prototype.findObject=X.prototype.Za;X.prototype.findInVisualTree=X.prototype.jm;X.prototype.walkVisualTreeFrom=X.prototype.Nm;X.prototype.findMainElement=X.prototype.tb;var on=!1,pn=null,Ol=new H;X.className="Panel";X.definePanelLayout=sn;sn("Position",new wm);sn("Vertical",new zm);sn("Auto",new Bm);sn("Link",new Mm); function Uj(){Ya(this);this.kg=null;this.bs=!0;this.Oa=0;this.Qc=NaN;this.fh=0;this.eh=Infinity;this.xb=$c;this.ma=this.ha=0;this.cb=null;this.Mp=Cn;this.ye=Wk;this.Gp=this.ng=null;this.Hp=NaN;this.jb=this.Qj=null;this.un=!1} Uj.prototype.copy=function(){var a=new Uj;a.bs=this.bs;a.Oa=this.Oa;a.Qc=this.Qc;a.fh=this.fh;a.eh=this.eh;a.xb=this.xb;a.ha=this.ha;a.ma=this.ma;a.ye=this.ye;a.Mp=this.Mp;null===this.ng?a.ng=null:a.ng=this.ng.G();a.Gp=this.Gp;a.Hp=this.Hp;a.Qj=null;null!==this.Qj&&(a.separatorDashArray=Ba(this.separatorDashArray));a.jb=this.jb;a.un=this.un;a.cb=this.cb;return a};t=Uj.prototype; t.pt=function(a){a.isRow?this.height=a.height:this.width=a.width;this.minimum=a.minimum;this.maximum=a.maximum;this.alignment=a.alignment;this.stretch=a.stretch;this.sizing=a.sizing;this.ng=null===a.separatorPadding?null:a.separatorPadding.G();this.separatorStroke=a.separatorStroke;this.separatorStrokeWidth=a.separatorStrokeWidth;this.Qj=null;a.separatorDashArray&&(this.Qj=Ba(a.separatorDashArray));this.background=a.background;this.coversSeparators=a.coversSeparators;this.cb=a.cb}; t.gb=function(a){a.classType===Uj&&(this.sizing=a)};t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+lb(this)};t.fj=function(a){this.kg=a}; t.uv=function(){var a=0,b=0,c=this.kg,d=this.isRow;if(null!==c&&c.type===X.Table)for(var e=d?c.sb.length:c.ob.length,f=0;fa&&va(a,">= 0",Uj,"height"),this.Qc=a,this.actual=this.ha,null!==this.panel&&this.panel.o(), this.zb("height",b,a))}},width:{get:function(){return this.Qc},set:function(a){var b=this.Qc;b!==a&&(0>a&&va(a,">= 0",Uj,"width"),this.Qc=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.zb("width",b,a))}},minimum:{get:function(){return this.fh},set:function(a){var b=this.fh;b!==a&&((0>a||!isFinite(a))&&va(a,">= 0",Uj,"minimum"),this.fh=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.zb("minimum",b,a))}},maximum:{ get:function(){return this.eh},set:function(a){var b=this.eh;b!==a&&(0>a&&va(a,">= 0",Uj,"maximum"),this.eh=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.zb("maximum",b,a))}},alignment:{get:function(){return this.xb},set:function(a){var b=this.xb;b.w(a)||(this.xb=a.G(),null!==this.panel&&this.panel.o(),this.zb("alignment",b,a))}},stretch:{get:function(){return this.ye},set:function(a){var b=this.ye;b!==a&&(this.ye= a,null!==this.panel&&this.panel.o(),this.zb("stretch",b,a))}},separatorPadding:{get:function(){return this.ng},set:function(a){"number"===typeof a&&(a=new oc(a));var b=this.ng;null!==a&&null!==b&&b.w(a)||(null!==a&&(a=a.G()),this.ng=a,null!==this.panel&&this.panel.o(),this.zb("separatorPadding",b,a))}},separatorStroke:{get:function(){return this.Gp},set:function(a){var b=this.Gp;b!==a&&(null!==a&&Sl(a,"RowColumnDefinition.separatorStroke"), a instanceof ul&&a.freeze(),this.Gp=a,null!==this.panel&&this.panel.o(),this.zb("separatorStroke",b,a))}},separatorStrokeWidth:{get:function(){return this.Hp},set:function(a){var b=this.Hp;b!==a&&(this.Hp=a,null!==this.panel&&this.panel.o(),this.zb("separatorStrokeWidth",b,a))}},separatorDashArray:{get:function(){return this.Qj},set:function(a){var b=this.Qj;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ee)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,v=Fa(),w=2;wn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;w=0;q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];for(var y=0;.1<=u;){0===y&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1));if(e> u){Ha(v);return}e>q?(y=e-q,e=q):y=0;var z=Math.sqrt(e*e/(1+p*p));0>n&&(z=-z);h+=z;k+=p*z;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===y&&d.Ui(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==y){w++;if(w===v.length){Ha(v);return}q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];e=y}}Ha(v)}} t.Ui=function(a,b){var c=this.Ec,d=this.al;if(null!==c||null!==d){var e=this.actualBounds,f=this.naturalBounds;null!==d&&li(this,a,d,!0,!1,f,e);var g=this.part,h=this.qh;null!==c&&0===h&&null!==g&&(h=g.type===X.Link&&g instanceof Ke&&"Selection"===g.category&&g.adornedObject instanceof W&&g.adornedPart.tb()===g.adornedObject?g.adornedObject.strokeWidth:0);null!==c&&0!==h&&(li(this,a,c,!1,!1,f,e),a.lineWidth=h,a.lineJoin=this.Ul,a.lineCap=this.Tl,a.miterLimit=this.Rj);e=!1;g&&b.Ee("drawShadows")&& (e=g.isShadowed);g=!0;null===c||null!==d&&"transparent"!==d||(g=!1);f=!1;var k=this.strokeDashArray;null!==k&&(f=!0,a.st(k,this.ph));var l=this.ka;if(null!==l){if(l.type===vd)a.beginPath(),a.moveTo(l.startX,l.startY),a.lineTo(l.endX,l.endY),null!==d&&a.Wd(d),0!==h&&null!==c&&a.ij();else if(l.type===zd){var m=l.startX;k=l.startY;var n=l.endX,p=l.endY;l=Math.min(m,n);var r=Math.min(k,p);m=Math.abs(n-m);k=Math.abs(p-k);a.beginPath();a.rect(l,r,m,k);null!==d&&a.Wd(d);if(null!==c){g&&e&&tl(a);if(0!==h){if(0=== m||0===k)a.beginPath(),a.rect(l,r,Math.max(m,.1),Math.max(k,.1));a.ij()}g&&e&&sl(a)}}else if(l.type===Hd)m=l.startX,k=l.startY,n=l.endX,p=l.endY,l=Math.abs(n-m)/2,r=Math.abs(p-k)/2,m=Math.min(m,n)+l,k=Math.min(k,p)+r,a.beginPath(),a.moveTo(m,k-r),a.bezierCurveTo(m+K.Eg*l,k-r,m+l,k-K.Eg*r,m+l,k),a.bezierCurveTo(m+l,k+K.Eg*r,m+K.Eg*l,k+r,m,k+r),a.bezierCurveTo(m-K.Eg*l,k+r,m-l,k+K.Eg*r,m-l,k),a.bezierCurveTo(m-l,k-K.Eg*r,m-K.Eg*l,k-r,m,k-r),a.closePath(),null!==d&&a.Wd(d),0!==h&&null!==c&&(g&&e?(tl(a), a.ij(),sl(a)):a.ij());else if(l.type===td)for(k=l.figures,l=k.length,r=0;rv.sweepAngle,null!==q?q.endX:m.startX,null!==q?q.endY:m.startY)}else if(q=ae(v,m),w=q.length,0===w)a.lineTo(v.centerX,v.centerY);else for(var y=0;y(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;N.free(f);return K.Ob(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== zd){b=c.startX;var g=c.startY,h=c.endX;c=c.endY;f.x=Math.min(b,h);f.y=Math.min(g,c);f.width=Math.abs(h-b);f.height=Math.abs(c-g);if(null===this.fill){f.Fc(-d,-d);if(f.aa(a))return N.free(f),!1;f.Fc(d,d)}null!==this.stroke&&f.Fc(e,e);a=f.aa(a);N.free(f);return a}if(c.type===Hd){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return N.free(f),!1; g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);N.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===td)return N.free(f),null===this.fill?ee(c,a.x,a.y,e):ce(c,a,e,1=this.strokeWidth)m=K.Ge(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b),d=m* b);b=Fa();a=new I;K.Ge(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new I;K.Ge(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new I;K.Ge(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new I;K.Ge(l.endX+d,l.endY+m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);h=b.length;if(0===h)return Ha(b),!1;m=!0;k=Infinity;for(d=0;dMath.abs(c)){k=g-m-c*(f-d);if(0>a*a*c*c+l*l-k*k){e.x=NaN;e.y=NaN;m=!1;break a}n=Math.sqrt(a*a*c*c+l*l-k*k);h=(-(a*a*c*k)+a*l*n)/(l*l+a*a*c*c)+d;a=(-(a*a*c*k)-a*l*n)/(l*l+a*a*c*c)+d;l=c*(h-d)+k+m;k=c* (a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))h){e.x=NaN;e.y=NaN;m=!1;break a}k=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)c?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||K.$(k.y,a))&&(k.yb||K.$(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.Wx=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.Eh(a,!0))return!0;var e=a.De(b),f=e;1.5=e||Cb(b,f,0,-n)>=e||Cb(b, f,0,n)>=e||Cb(b,f,m,0)>=e?!1:!0}else if(b.type===td){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.xl&&a.ye&&Bb(a.x,a.y,f,h,k,h)>e&&Bb(a.x,a.y,k,l,f,l)>e&&Bb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?ee(b,a.x,a.y,f):ce(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.j;k=h.length;for(l=0;le)return!1;break;case Xd:var p=Fa();K.Be(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Ha(p);if(g)return!1;g=n.endX;m=n.endY;if(a.dd(g,m)>e)return!1;break;case Yd:p=Fa();K.Kq(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Ha(p);if(g)return!1;g=n.endX;m=n.endY;if(a.dd(g,m)>e)return!1;break;case Zd:case $d:p=n.type===Zd?ae(n,f):be(n,f,g,m);var r=p.length;if(0===r){g=n.centerX;m=n.centerY;if(a.dd(g,m)>e)return!1;break}n=null;for(var q=Fa(),u=0;u< r;u++)if(n=p[u],q.length=0,K.Be(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.8,q),d(q,a))return Ha(q),!1;Ha(q);null!==n&&(g=n[6],m=n[7]);break;default:B("Unknown Segment type: "+n.type)}}return!0}}}return!1};t.cc=function(){this.ka=null};function In(a){var b=a.diagram;null!==b&&b.undoManager.isUndoingRedoing||(a.segmentOrientation=Vm,"None"!==a.$l?(a.segmentIndex=-1,a.alignmentFocus=gd):"None"!==a.bl&&(a.segmentIndex=0,a.alignmentFocus=new P(1-gd.x,gd.y)))} W.makeGeometry=function(a,b,c){if("None"!==a.toArrow)var d=Jn[a.toArrow];else"None"!==a.fromArrow?d=Jn[a.fromArrow]:(d=K.Je[a.figure],"string"===typeof d&&(d=K.Je[d]),void 0===d&&B("Unknown Shape.figure: "+a.figure),d=d(a,b,c),d.ll=b,d.kl=c);if(null===d){var e=K.Je.Rectangle;"function"===typeof e&&(d=e(a,b,c))}return d}; function Kn(a){var b=Jn[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Jn[c];if(void 0===b){var d=null,e;for(e in K.Qm)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=Id(K.Qm[d],!1),Jn[d]=a,c!==d&&(Jn[c]=d),d}}return"string"===typeof b?b:b instanceof sd?a:null} ma.Object.defineProperties(W.prototype,{geometry:{get:function(){return null!==this.ka?this.ka:this.vd},set:function(a){var b=this.ka,c=this.vd;if(b!==a){null!==a?this.vd=this.ka=a.freeze():this.vd=this.ka=null;var d=this.part;null!==d&&(d.dh=NaN);this.o();this.g("geometry",b||c,a);fl(this)&&(a=this.part,null!==a&&gl(this,a,"geometryString"))}}},geometryString:{get:function(){return null===this.geometry?"":this.geometry.toString()},set:function(a){a= Id(a);var b=a.normalize();this.geometry=a;this.position=a=I.allocAt(-b.x,-b.y);I.free(a)}},isGeometryPositioned:{get:function(){return this.eo},set:function(a){var b=this.eo;b!==a&&(this.eo=a,this.o(),this.g("isGeometryPositioned",b,a))}},fill:{get:function(){return this.al},set:function(a){var b=this.al;b!==a&&(null!==a&&Sl(a,"Shape.fill"),a instanceof ul&&a.freeze(),this.al=a,this.M(),this.g("fill",b,a))}},stroke:{ get:function(){return this.Ec},set:function(a){var b=this.Ec;b!==a&&(null!==a&&Sl(a,"Shape.stroke"),a instanceof ul&&a.freeze(),this.Ec=a,this.M(),this.g("stroke",b,a))}},strokeWidth:{get:function(){return this.qh},set:function(a){var b=this.qh;if(b!==a)if(0<=a){this.qh=a;this.o();var c=this.part;null!==c&&(c.dh=NaN);this.g("strokeWidth",b,a)}else va(a,"value >= 0",W,"strokeWidth:value")}},strokeCap:{get:function(){return this.Tl},set:function(a){var b= this.Tl;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?va(a,'"butt", "round", or "square"',W,"strokeCap"):(this.Tl=a,this.M(),this.g("strokeCap",b,a)))}},strokeJoin:{get:function(){return this.Ul},set:function(a){var b=this.Ul;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?va(a,'"miter", "bevel", or "round"',W,"strokeJoin"):(this.Ul=a,this.M(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{get:function(){return this.Rj}, set:function(a){var b=this.Rj;if(b!==a&&1<=a){this.Rj=a;this.M();var c=this.part;null!==c&&(c.dh=NaN);this.g("strokeMiterLimit",b,a)}}},strokeDashArray:{get:function(){return this.oh},set:function(a){var b=this.oh;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1p*m*m&&(c=!0);b.Fb!==a&&(c=!1);!1===b.Ee("textGreeking")&& (c=!1);b=this.ff;p=this.gf;switch(this.flip){case al:a.translate(e,0);a.scale(-1,1);break;case $k:a.translate(0,f);a.scale(1,-1);break;case bl:a.translate(e,f),a.scale(-1,-1)}m=this.Oc;n=(b+g+p)*m;f>n&&(d=this.Qi,d=d.y*f-d.y*n+d.offsetY);if(1===m&&null!==this.he)p=this.qb,p>e&&(p=e),this.Ti(this.he,a,0,d+b,e,g,p,c,h,k,l);else if(null!==this.Qb&&null!==this.ib)for(n=0;ne&&(r=e);d+=b;this.Ti(this.ib[n],a,0,d,e,g,r,c,h,k,l);d+=g+p}switch(this.flip){case al:a.scale(-1,1);a.translate(-e, 0);break;case $k:a.scale(1,-1);a.translate(0,-f);break;case bl:a.scale(-1,-1),a.translate(-e,-f)}}}; t.Ti=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;h?("left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==Qn?Qn(this,f):.75*f,b.fillText(a,c+n,d+e),a=f/20|0,0===a&&(a=1),"right"===k?n-=g:"center"===k&&(n-=g/2),l&&(k=null!==Rn?Rn(this,f):.8*f,b.beginPath(),b.lineWidth=a,b.moveTo(c+n,d+k),b.lineTo(c+n+g,d+k),b.stroke()),m&&(b.beginPath(),b.lineWidth=a,d=d+f-f/2.2|0,0!==a%2&&(d+=.5),b.moveTo(c+n,d),b.lineTo(c+ n+g,d),b.stroke()))}; t.tm=function(a,b,c,d){this.vi=a;var e=this.ie;null!==Mn&&Sn!==e&&(Sn=Mn.font=e);this.qb=this.we=0;this.he=this.ib=this.Qb=this.je=null;var f;if(isNaN(this.desiredSize.width)){e=this.Tb.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;){var k=e.indexOf("\n",g);-1===k&&(k=e.length,h=!0);f=Math.max(f,Tn(e.substr(g,k-g).trim()));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=Tn(e);e=Math.min(e,a/this.scale);e=Math.max(8,e)}else e= this.desiredSize.width;null!==this.panel&&(e=Math.min(e,this.panel.maxSize.width));f=Un(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;g=f;if(0!==this.qb&&null!==this.Qb&&null!==this.ib&&this.ig===Vn&&(b=this.ie,b=this.ig===Vn?Wn(b):0,h=this.ff+this.gf,h=Math.max(0,Pn(this)+h),g=Math.min(this.maxLines-1,Math.max(Math.floor(g/h+.01)-1,0)),!(g+1>=this.ib.length))){h=this.ib[g];for(b=Math.max(1,a-b);Tn(h)>b&&1=a.qe)null!==d&&d.h(0,g);else{var k=b;if(a.tg===ao)if(a.we=1,f=Tn(b),0===h||f<=c)a.qb=Math.max(a.qb,f),Zn(a,b,a.qb),null!==d&&d.h(f,g);else{e=bo(a,k);k=k.substr(e.length);b=bo(a,k);for(f=Tn(e+b);0c&&1c;){var m=1;f=Tn(l.substr(0,m));for(b=0;f<=c;)m++,b=f,f=Tn(l.substr(0,m));if(1===m){var n=f;e=Math.max(e,f)}else n=b,e=Math.max(e,b);m--;1>m&&(m=1);Zn(a,l.substr(0,m),n);h++;l=l.substr(m);if(a.Oc+h>a.qe)break}b=bo(a,k);for(f=Tn(l+b);0a.qe))break}a.we=Math.min(a.qe,h);a.qb=Math.max(a.qb,e);null!==d&&d.h(a.qb,g*a.we)}}}function bo(a,b){if(a.tg===co)return b.substr(0,1);a=b.length;for(var c=0,d=eo;c=a?b:b.substr(0,c)}function Tn(a){return null===Mn?8*a.length:Mn.measureText(a).width} function Pn(a){if(null!==a.je)return a.je;var b=a.ie;if(null===Mn){var c=16;return a.je=c}void 0!==fo[b]&&5E3>go?c=fo[b]:(c=1.3*Mn.measureText("M").width,fo[b]=c,go++);return a.je=c}function Wn(a){if(null===Mn)return 6;if(void 0!==ho[a]&&5E3>io)var b=ho[a];else b=Mn.measureText(Xn).width,ho[a]=b,io++;return b} function Un(a,b){var c=a.Tb.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.ff+a.gf;d=Math.max(0,Pn(a)+d);if(0===c.length)return a.qb=0,a.Oc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Oc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.tg!==ao){a.we=0;var k=M.alloc();$n(a,f,b,k);e+=k.height;M.free(k);a.Oc+=a.we}else $n(a,f,b,null),e+=d,a.Oc++;a.Oc===a.qe&&(h=!0)}f=g+1}return a.ls=e} ma.Object.defineProperties(Ug.prototype,{font:{get:function(){return this.ie},set:function(a){var b=this.ie;b!==a&&(this.ie=a,this.je=null,this.o(),this.g("font",b,a))}},text:{get:function(){return this.Tb},set:function(a){var b=this.Tb;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.Tb=a,this.o(),this.g("text",b,a))}},textAlign:{get:function(){return this.Mi},set:function(a){var b=this.Mi;b===a||"start"!== a&&"end"!==a&&"left"!==a&&"right"!==a&&"center"!==a||(this.Mi=a,this.M(),this.g("textAlign",b,a))}},flip:{get:function(){return this.Fd},set:function(a){var b=this.Fd;b!==a&&(this.Fd=a,this.M(),this.g("flip",b,a))}},verticalAlignment:{get:function(){return this.Qi},set:function(a){var b=this.Qi;b.w(a)||(this.Qi=a=a.G(),Dl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{get:function(){if(!this.pc.v()){var a= M.alloc();$n(this,this.Tb,999999,a);var b=a.width;M.free(a);a=Un(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);Vb(this.pc,b,a)}return this.pc}},isMultiline:{get:function(){return this.Aj},set:function(a){var b=this.Aj;b!==a&&(this.Aj=a,this.o(),this.g("isMultiline",b,a))}},isUnderline:{get:function(){return this.ti},set:function(a){var b=this.ti;b!==a&&(this.ti=a,this.M(),this.g("isUnderline",b, a))}},isStrikethrough:{get:function(){return this.si},set:function(a){var b=this.si;b!==a&&(this.si=a,this.M(),this.g("isStrikethrough",b,a))}},wrap:{get:function(){return this.tg},set:function(a){var b=this.tg;b!==a&&(this.tg=a,this.o(),this.g("wrap",b,a))}},overflow:{get:function(){return this.ig},set:function(a){var b=this.ig;b!==a&&(this.ig=a,this.o(),this.g("overflow",b,a))}},stroke:{ get:function(){return this.Ec},set:function(a){var b=this.Ec;b!==a&&(null!==a&&Sl(a,"TextBlock.stroke"),a instanceof ul&&a.freeze(),this.Ec=a,this.M(),this.g("stroke",b,a))}},lineCount:{get:function(){return this.Oc}},editable:{get:function(){return this.Hn},set:function(a){var b=this.Hn;b!==a&&(this.Hn=a,this.g("editable",b,a))}},textEditor:{get:function(){return this.Xp},set:function(a){var b=this.Xp;b!==a&& (this.Xp=a,this.g("textEditor",b,a))}},errorFunction:{get:function(){return this.Ac},set:function(a){var b=this.Ac;b!==a&&(this.Ac=a,this.g("errorFunction",b,a))}},interval:{get:function(){return this.Ld},set:function(a){var b=this.Ld;a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){this.Ld=a;this.o();var c=this.panel;null!==c&&(c.Xg=null);this.g("interval",b,a)}}},graduatedStart:{get:function(){return this.Jd}, set:function(a){var b=this.Jd;b!==a&&(0>a?a=0:1a?a=0:1=a&&va(a,"> 0",Ug,"maxLines"),this.qe=a,this.g("maxLines",b,a),this.o())}},metrics:{get:function(){return{arrSize:null!==this.Qb?this.Qb: [this.qb],arrText:null!==this.ib?this.ib:[this.he],maxLineWidth:this.qb,fontHeight:this.je}}},choices:{get:function(){return this.jn},set:function(a){var b=this.jn;b!==a&&(this.jn=a,this.g("choices",b,a))}}}); var Qn=null,Rn=null,ao=new D(Ug,"None",0),Yn=new D(Ug,"WrapFit",1),On=new D(Ug,"WrapDesiredSize",2),co=new D(Ug,"WrapBreakAll",3),Nn=new D(Ug,"OverflowClip",0),Vn=new D(Ug,"OverflowEllipsis",1),eo=/[ \u200b\u00ad]/,fo=new db,go=0,ho=new db,io=0,Xn="...",Sn="",Mn=null,Ln=!1;Ug.className="TextBlock";Ug.getEllipsis=function(){return Xn};Ug.setEllipsis=function(a){Xn=a;ho=new db;io=0};Ug.getBaseline=function(){return Qn};Ug.setBaseline=function(a){Qn=a;a=Pa();for(var b=a.length,c=0;c=d.width&&(e=e+r.offsetX+(m*r.x-d.width*r.x));n>=d.height&&(f=f+r.offsetY+(n*r.y-d.height*r.y));h=Math.min(d.width,m);g=Math.min(d.height,n);break;case ud:m=d.width;n=d.height;break;case zg:case Zk:p===zg?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===Zk&&(p=Math.max(d.height/n,d.width/m),m*=p,n*=p,m>=d.width&&(e=(e+r.offsetX+(m*r.x-d.width*r.x)/m)*h),n>=d.height&&(f=(f+r.offsetY+(n*r.y-d.height*r.y)/ n)*g),h*=1/(m/d.width),g*=1/(n/d.height),m=d.width,n=d.height)}p=this.uf()*b.scale;var q=m*p*n*p,u=h*g/q,v=c.__goCache;p=null;var w=oo;if(c.Zr&&void 0!==v&&4w*w)for(null===v.Si&&(po(v,4,k,l,c),po(v,16,k,l,c)),k=v.Si,l=k.length,q=0;qK.Ph&&(K.Oh[a]=d,K.Ph++);return d});to("Square",function(a,b,c){a="s"+b+","+c;var d=K.Oh[a];if(void 0!==d)return d;d=new sd(zd);d.endX=b;d.endY=c;d.defaultStretch=zg;50>K.Ph&&(K.Oh[a]=d,K.Ph++);return d}); to("RoundedRectangle",function(a,b,c){var d=a?a.parameter1:NaN;if(isNaN(d)||0>d)d=5;d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*K.Eg;b=(new sd).add((new ge(d,0,!0)).add(new oe(xd,b-d,0)).add(new oe(Xd,b,d,b-a,0,b,a)).add(new oe(xd,b,c-d)).add(new oe(Xd,b-d,c,b,c-a,b-a,c)).add(new oe(xd,d,c)).add(new oe(Xd,0,c-d,a,c,0,c-a)).add(new oe(xd,0,d)).add((new oe(Xd,d,0,0,a,a,0)).close()));1K.Ph&&(K.Oh[a]=d,K.Ph++);return d});to("Circle",function(a,b,c){a="c"+b+","+c;var d=K.Oh[a];if(void 0!==d)return d;d=new sd(Hd);d.endX=b;d.endY=c;d.spot1=id;d.spot2=jd;d.defaultStretch=zg;50>K.Ph&&(K.Oh[a]=d,K.Ph++);return d});to("TriangleRight",function(a,b,c){return(new sd).add((new ge(0,0)).add(new oe(xd,b,.5*c)).add((new oe(xd,0,c)).close())).Mm(0,.25,.5,.75)}); to("TriangleDown",function(a,b,c){return(new sd).add((new ge(0,0)).add(new oe(xd,b,0)).add((new oe(xd,.5*b,c)).close())).Mm(.25,0,.75,.5)});to("TriangleLeft",function(a,b,c){return(new sd).add((new ge(b,c)).add(new oe(xd,0,.5*c)).add((new oe(xd,b,0)).close())).Mm(.5,.25,1,.75)});to("TriangleUp",function(a,b,c){return(new sd).add((new ge(b,c)).add(new oe(xd,0,c)).add((new oe(xd,.5*b,0)).close())).Mm(.25,.5,.75,1)});to("Triangle","TriangleUp"); to("Diamond",function(a,b,c){return(new sd).add((new ge(.5*b,0)).add(new oe(xd,0,.5*c)).add(new oe(xd,.5*b,c)).add((new oe(xd,b,.5*c)).close())).Mm(.25,.25,.75,.75)});to("LineH",function(a,b,c){a=new sd(vd);a.startX=0;a.startY=c/2;a.endX=b;a.endY=c/2;return a});to("LineV",function(a,b,c){a=new sd(vd);a.startX=b/2;a.startY=0;a.endX=b/2;a.endY=c;return a});to("None","Rectangle");to("BarH","Rectangle");to("BarV","Rectangle");to("MinusLine","LineH"); to("PlusLine",function(a,b,c){return(new sd).add((new ge(0,c/2,!1)).add(new oe(xd,b,c/2)).add(new oe(Wd,b/2,0)).add(new oe(xd,b/2,c)))});to("XLine",function(a,b,c){return(new sd).add((new ge(0,c,!1)).add(new oe(xd,b,0)).add(new oe(Wd,0,0)).add(new oe(xd,b,c)))}); K.Qm={"":"",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 T(a){X.call(this,a);this.D=2408959;this.ah=this.If="";this.rp=this.np=this.Dp=this.ro=null;this.Fp="";this.Ff=this.ao=this.Ep=this.mh=null;this.pp="";this.op=Rb;this.Tb=this.sp="";this.wi=this.mn=this.fi=null;this.$f=(new I(NaN,NaN)).freeze();this.yo="";this.Xe=null;this.zo=vc;this.tp=$c;this.Io=Hb;this.Ao=Ib;this.En=null;this.so=127;this.Jp=Jb;this.Ip="gray";this.df=4;this.jx=-1;this.gq=NaN;this.Jy=new N;this.Ij=null;this.dh=NaN}la(T,X); T.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.D=this.D&-4097|49152;a.If=this.If;a.ah=this.ah;a.ro=this.ro;a.Dp=this.Dp;a.np=this.np;a.rp=this.rp;a.Fp=this.Fp;a.Ep=this.Ep;a.ao=this.ao;a.Ff=null;a.pp=this.pp;a.op=this.op.G();a.sp=this.sp;a.tp=this.tp.G();a.Tb=this.Tb;a.mn=this.mn;a.$f.assign(this.$f);a.yo=this.yo;a.zo=this.zo.G();a.Io=this.Io.G();a.Ao=this.Ao.G();a.En=this.En;a.so=this.so;a.Jp=this.Jp.G();a.Ip=this.Ip;a.df=this.df;a.gq=this.gq}; T.prototype.sf=function(a){X.prototype.sf.call(this,a);a.Ih();a.mh=null;a.Xe=null;a.Ij=null};T.prototype.toString=function(){var a=Ia(this.constructor)+"#"+lb(this);null!==this.data&&(a+="("+Ja(this.data)+")");return a};T.prototype.xk=function(a,b,c,d,e,f,g){var h=this.diagram;null!==h&&(a===we&&"elements"===b?e instanceof X?Gj(e,function(a){Ij(h.partManager,a);Hj(h,a)}):lk(h,e):a===xe&&"elements"===b&&(e instanceof X?Gj(e,function(a){Lj(h.partManager,a,h)}):nk(h,e)),h.$a(a,b,c,d,e,f,g))}; T.prototype.Ba=function(a){X.prototype.Ba.call(this,a);if(null!==this.data){for(var b=this.W.j,c=b.length,d=0;de.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.D^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.ea();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Mb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Bb(),c.skipsUndoManager=d)}}}},isHighlighted:{get:function(){return 0!== (this.D&524288)},set:function(a){var b=0!==(this.D&524288);if(b!==a){this.D^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ea(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.M();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{get:function(){return 0!==(this.D&8192)},set:function(a){var b=0!==(this.D&8192);b!==a&&(this.D^=8192,this.g("isShadowed",b,a),this.M())}},isAnimated:{get:function(){return 0!== (this.D&262144)},set:function(a){var b=0!==(this.D&262144);b!==a&&(this.D^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{get:function(){return this.ao},set:function(a){var b=this.ao;b!==a&&(this.ao=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{get:function(){return this.Fp},set:function(a){var b=this.Fp;b!==a&&(this.Fp=a,this.mh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{ get:function(){return this.Dp},set:function(a){var b=this.Dp;b!==a&&(this.Dp=a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{get:function(){if(null===this.mh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.Za(a),null!==a?this.mh=a:this.mh=this):this instanceof S?(a=this.path,null!==a?this.mh=a:this.mh=this):this.mh=this}return this.mh}},selectionChanged:{get:function(){return this.Ep},set:function(a){var b=this.Ep; b!==a&&(this.Ep=a,this.g("selectionChanged",b,a))}},resizeAdornmentTemplate:{get:function(){return this.np},set:function(a){var b=this.np;b!==a&&(this.np=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{get:function(){return this.pp},set:function(a){var b=this.pp;b!==a&&(this.pp=a,this.g("resizeObjectName",b,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.Za(a), null!==a)?a:this}},resizeCellSize:{get:function(){return this.op},set:function(a){var b=this.op;b.w(a)||(this.op=a=a.G(),this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{get:function(){return this.rp},set:function(a){var b=this.rp;b!==a&&(this.rp=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{get:function(){return this.sp},set:function(a){var b=this.sp;b!==a&&(this.sp=a,this.g("rotateObjectName", b,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.Za(a),null!==a)?a:this}},rotationSpot:{get:function(){return this.tp},set:function(a){var b=this.tp;b.w(a)||(this.tp=a=a.G(),this.g("rotationSpot",b,a))}},text:{get:function(){return this.Tb},set:function(a){var b=this.Tb;b!==a&&(this.Tb=a,this.g("text",b,a))}},containingGroup:{get:function(){return this.fi}, set:function(a){if(this.Wb()){var b=this.fi;if(b!==a){null===a||this!==a&&!a.yd(this)||(this===a&&B("Cannot make a Group a member of itself: "+this.toString()),B("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.C(2);var c=this.diagram;null!==b?Go(b,this):this instanceof uf&&null!==c&&c.wh.remove(this);this.fi=a;null!==a?Fo(a,this):this instanceof uf&&null!==c&&c.wh.add(this);this.C(1);if(null!==c&&c.Z){var d=this.data,e=c.model;if(null!==d&& e.lk()){var f=e.ja(null!==a?a.data:null);e.Sq(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.Z,c.Z=!0),d(this,b,a),null!==c&&(c.Z=e));if(this instanceof uf)for(c=new F,Tk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)Lo(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)Lo(c.value);c=this.labeledLink;null!==c&&Lo(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&mi(b,-1,a))}}else B("cannot set the Part.containingGroup of a Link or Adornment")}}, containingGroupChanged:{get:function(){return this.mn},set:function(a){var b=this.mn;b!==a&&(this.mn=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{get:function(){return null!==this.containingGroup||this instanceof V&&null!==this.labeledLink?!1:!0}},layoutConditions:{get:function(){return this.so},set:function(a){var b=this.so;b!==a&&(this.so=a,this.g("layoutConditions",b,a))}},dragComputation:{ get:function(){return this.En},set:function(a){var b=this.En;b!==a&&(this.En=a,this.g("dragComputation",b,a))}},shadowOffset:{get:function(){return this.Jp},set:function(a){var b=this.Jp;b.w(a)||(this.Jp=a=a.G(),this.M(),this.g("shadowOffset",b,a))}},shadowColor:{get:function(){return this.Ip},set:function(a){var b=this.Ip;b!==a&&(this.Ip=a,this.M(),this.g("shadowColor",b,a))}},shadowBlur:{get:function(){return this.df}, set:function(a){var b=this.df;b!==a&&(this.df=a,this.M(),this.g("shadowBlur",b,a))}}});T.prototype.invalidateLayout=T.prototype.C;T.prototype.findCommonContainingGroup=T.prototype.Tx;T.prototype.isMemberOf=T.prototype.yd;T.prototype.findTopLevelPart=T.prototype.Fz;T.prototype.findSubGraphLevel=T.prototype.Cz;T.prototype.ensureBounds=T.prototype.Ab;T.prototype.getDocumentBounds=T.prototype.nm;T.prototype.getRelativePoint=T.prototype.wf;T.prototype.findObject=T.prototype.Za;T.prototype.moveTo=T.prototype.moveTo; T.prototype.invalidateAdornments=T.prototype.Mb;T.prototype.clearAdornments=T.prototype.$j;T.prototype.removeAdornment=T.prototype.Af;T.prototype.addAdornment=T.prototype.zh;T.prototype.findAdornment=T.prototype.hk;T.prototype.updateTargetBindings=T.prototype.Ba;var Do=!1;T.className="Part";T.LayoutNone=0;T.LayoutAdded=1;T.LayoutRemoved=2;T.LayoutShown=4;T.LayoutHidden=8;T.LayoutNodeSized=16;T.LayoutGroupLayout=32;T.LayoutNodeReplaced=64;T.LayoutStandard=127;T.LayoutAll=16777215; function Ke(a){T.call(this,a);this.D&=-257;this.ah="Adornment";this.de=null;this.nx=0;this.Cx=!1;this.l=[];this.Ra=null}la(Ke,T);Ke.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Ke.prototype.updateRelationshipsFromData=function(){}; Ke.prototype.qk=function(a){var b=this.adornedObject.part;if(b instanceof S&&this.adornedObject instanceof W){var c=b.path;b.qk(a);a=c.geometry;b=this.W.j;c=b.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.Fe){b.Fe=!0;var c=new F;c.add(this);Wo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===ri);b.Fe=!1}};function Wo(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.Fe){b.Fe=!0;var c=new F;c.add(this);Yo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===ri);b.Fe=!1}}; function Yo(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.rq():a.xd();k.next();){var l=k.value;l.isTreeLink&&(h||l.ld||l.Ta(),l=l.wq(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Pb(!0),l.Ih(),g&&e.Yj(l,f)),2e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, a.h(b.x,b.y,0,0));return a};ma.Object.defineProperties(vg.prototype,{padding:{get:function(){return this.fb},set:function(a){"number"===typeof a&&(a=new oc(a));var b=this.fb;b.w(a)||(this.fb=a=a.G(),this.g("padding",b,a),this.o())}}});vg.className="Placeholder"; function S(){T.call(this,X.Link);this.Pa=8;this.Qe=null;this.Re="";this.lf=this.Rn=null;this.mf="";this.$p=null;this.Fk=ag;this.tn=0;this.vn=ag;this.wn=NaN;this.Oj=cp;this.Np=.5;this.bd=null;this.yb=(new E).freeze();this.lh=this.gh=null;this.Fl=new N;this.ka=new sd;this.co=!0;this.I=this.u=this.Hf=this.Qf=null;this.l=[];this.hv=new I;this.Pr=this.xx=this.wx=null;this.Cu=NaN;this.O=null}la(S,T); S.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);a.Pa=this.Pa&-113;a.Re=this.Re;a.Rn=this.Rn;a.mf=this.mf;a.$p=this.$p;a.Fk=this.Fk;a.tn=this.tn;a.vn=this.vn;a.wn=this.wn;a.Oj=this.Oj;a.Np=this.Np;null!==this.O&&(a.O=this.O.copy())};t=S.prototype;t.sf=function(a){T.prototype.sf.call(this,a);this.Re=a.Re;this.mf=a.mf;a.gh=null;a.Ta();a.Hf=this.Hf;var b=a.fromPort;null!==b&&Po(a.fromNode,b);b=a.toPort;null!==b&&Po(a.toNode,b)}; t.gb=function(a){a.classType===S?2===(a.value&2)?this.routing=a:a===dg||a===$f||a===Zf?this.curve=a:a===dp||a===ep||a===fp?this.adjusting=a:a!==cp&&a!==ag&&B("Unknown Link enum value for a Link property: "+a):T.prototype.gb.call(this,a)};t.Gc=function(){null===this.O&&(this.O=new el)};t.ej=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(uj(a)||vj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),uj(a)||vj(a))?!1:!0};t.qw=function(){return!1}; t.Zt=function(){};t.Wb=function(){return!1};S.prototype.computeAngle=function(a,b,c){return S.computeAngle(b,c)};S.computeAngle=function(a,b){switch(a){default:case ag:a=0;break;case Vm:a=b;break;case Om:a=b+90;break;case Qm:a=b-90;break;case gp:a=b+180;break;case Wm:a=K.Hq(b);90a&&(a-=180);break;case Pm:a=K.Hq(b+90);90a&&(a-=180);break;case Rm:a=K.Hq(b-90);90a&&(a-=180);break;case Sm:a=K.Hq(b);if(45a||225a)return 0;90a&&(a-=180)}return K.Hq(a)}; function Lo(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.Tx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.fi;if(c!==b){null!==c&&Go(c,a);a.fi=b;null!==b&&Fo(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.Z,g.Z=!0);e(a,c,b);null!==g&&(g.Z=f)}!a.ld||a.wx!==c&&a.xx!==c||a.Ta()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=S.prototype; t.Ih=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&T.prototype.Ih.call(this)};t.wq=function(a){var b=this.fromNode;return a===b?this.toNode:b};t.Oz=function(a){var b=this.fromPort;return a===b?this.toPort:b};function To(a,b){null===a.bd&&(a.bd=new F);a.bd.add(b);a.o()} t.yq=function(a){T.prototype.yq.call(this,a);hp(this)&&this.Bq(this.actualBounds);if(!a){a=this.Qe;var b=null;null!==a&&(b=this.fromPort,Ro(a,this,b));var c=this.lf;if(null!==c){var d=this.toPort;c===a&&d===b||Ro(c,this,d)}ip(this)}};t.zq=function(a){T.prototype.zq.call(this,a);hp(this)&&this.Bq(this.actualBounds);if(!a){a=this.Qe;var b=null;null!==a&&(b=this.fromPort,So(a,this,b));var c=this.lf;if(null!==c){var d=this.toPort;c===a&&d===b||So(c,this,d)}jp(this)}}; t.fk=function(){this.ld=!0;if(null!==this.bd){var a=this.diagram;if(null!==a)for(var b=this.bd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};S.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; S.prototype.move=function(a,b){var c=b?this.location:this.position,d=c.x;isNaN(d)&&(d=0);var e=c.y;isNaN(e)&&(e=0);d=a.x-d;e=a.y-e;!0===b?T.prototype.move.call(this,a,!1):(a=I.allocAt(c.x+d,c.y+e),T.prototype.move.call(this,a,!1),I.free(a));pf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; S.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1};S.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1}; S.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Kb),a;if(1===b)return a.assign(this.i(0)),a;if(2===b){var c=this.i(0),d=this.i(1);a.h((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===dg))return this.ka.Iv(.5,a),a.add(this.i(0)),c=this.ka.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===dg){if(3===b)return this.i(1);d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);var e=this.i(c+1), f=this.i(c+2);c=this.i(c+3);K.az(d.x,d.y,e.x,e.y,f.x,f.y,c.x,c.y,a)}else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;dc/2)break;d+=e;f++}b=this.i(f);f=this.i(f+1);1>Math.abs(b.x-f.x)?b.y>f.y?a.h(b.x,b.y-(c/2-d)):a.h(b.x,b.y+(c/2-d)):1>Math.abs(b.y-f.y)?b.x>f.x?a.h(b.x-(c/2-d),b.y):a.h(b.x+(c/2-d),b.y):(c=(c/2-d)/e,a.h(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a}; S.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).Sa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===dg))return this.ka.Zx(.5);if(this.computeCurve()===dg&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return K.$y(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.Sa(d)};t=S.prototype;t.i=function(a){return this.yb.j[a]};t.jd=function(a,b){this.yb.hd(a,b)};t.K=function(a,b,c){this.yb.hd(a,new I(b,c))};t.Wz=function(a,b){this.yb.ub(a,b)}; t.m=function(a,b,c){this.yb.ub(a,new I(b,c))};t.Ae=function(a){this.yb.add(a)};t.qf=function(a,b){this.yb.add(new I(a,b))};t.gw=function(a){this.yb.ab(a)};t.ak=function(){this.yb.clear()}; function pf(a,b,c){if(0!==b||0!==c){for(var d=a.ld,e=new E,f=a.yb.iterator;f.next();){var g=f.value;e.add((new I(g.x+b,g.y+c)).freeze())}e.freeze();f=a.yb;a.yb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.qc?a.o():(a.$f.h(a.$f.x+b,a.$f.y+c),a.ma.h(a.ma.x+b,a.ma.y+c),Dl(a));d&&kp(a);null!==g&&g.animationManager.qc&&(a.lh=e);a.g("points",f,e)}}t.Mh=function(){null===this.gh&&(this.gh=this.yb,this.yb=this.yb.copy())}; t.rf=function(){if(null!==this.gh){for(var a=this.gh,b=this.yb,c=Infinity,d=Infinity,e=a.j,f=e.length,g=0;gl&&(n=-n),u=(0>k?-1:1)*n+r,v=m*(u-r)+q);r=g.x+2*h/3;q=g.y+2*k/3;var w=r,y=q;K.A(k,0)?y=0k?-1:1)*n+r,y=m*(w-r)+q);this.ak();this.Ae(g);this.qf(u,v);this.qf(w,y);this.Ae(p);this.jd(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.jd(3,this.getLinkPoint(e,f,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,f),a=this.getLinkPoint(e, f,a,!1,!1,b,c),this.hasCurviness()?(p=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+p/2,c=d.y+e/2,g=b,h=c,K.A(e,0)?h=0f&&(g=-g),g=(0>e?-1:1)*g+b,h=p*(g-b)+c),this.Ae(d),this.qf(g,h)):this.Ae(d),this.Ae(a)}else{n=this.isAvoiding;p&&(m&&n||l)&&this.ak();var z=l?this.computeCurviness():0;n=this.getLinkPoint(b,c,d,!0,m,e,f);r=u=q=0;if(m||!h||l)v=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,n,d,!0,m,e,f),l&&(h||d.w(a)||!m&&1===d.x+ a.x&&1===d.y+a.y)&&(r-=m?90:30,0>z&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(v+=Math.abs(z)*(m?1:2)),0===r?q=v:90===r?u=v:180===r?q=-v:270===r?u=-v:(q=v*Math.cos(r*Math.PI/180),u=v*Math.sin(r*Math.PI/180)),d.kc()&&l&&(v=c.ga(Ac,I.alloc()),w=I.allocAt(v.x+1E3*q,v.y+1E3*u),this.getLinkPointFromPoint(b,c,v,w,!0,n),I.free(v),I.free(w));v=this.getLinkPoint(e,f,a,!1,m,b,c);var A=y=w=0;if(m||!k||l){var C=this.computeEndSegmentLength(e,f,a,!1);A=this.getLinkDirection(e,f,v,a,!1,m,b,c);l&&(k||d.w(a)||!m&& 1===d.x+a.x&&1===d.y+a.y)&&(A+=m?0:30,0>z&&(A+=180));0>A?A+=360:360<=A&&(A-=360);l&&(C+=Math.abs(z)*(m?1:2));0===A?w=C:90===A?y=C:180===A?w=-C:270===A?y=-C:(w=C*Math.cos(A*Math.PI/180),y=C*Math.sin(A*Math.PI/180));a.kc()&&l&&(a=f.ga(Ac,I.alloc()),d=I.allocAt(a.x+1E3*w,a.y+1E3*y),this.getLinkPointFromPoint(e,f,a,d,!1,v),I.free(a),I.free(d))}a=n;if(m||!h||l)a=new I(n.x+q,n.y+u);d=v;if(m||!k||l)d=new I(v.x+w,v.y+y);!p&&!m&&h&&3Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} S.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new I);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));a=null;e=b.panel;null===e||e.ce()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.wd;e=1/(a.m11*a.m22-a.m12*a.m21);g=a.m22*e;var h=-a.m12*e,k=-a.m21*e,l=a.m11*e,m=e*(a.m21*a.dy-a.m22*a.dx),n=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*g+d.y*k+m;d=d.x*h+d.y*l+n;g=c.x*g+c.y*k+m;c=c.x*h+c.y*l+n}b.jk(e,d,g,c,f);null!== a&&f.transform(a);return f};function op(a,b){var c=b.jp;null===c&&(c=new pp,c.port=b,c.node=b.part,b.jp=c);return qp(c,a)} S.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new I);if(c.hb()&&!mp(c))return b.ga(c,h),h;if(c.gd()){var k=op(this,b);if(null!==k){h.assign(k.Eq);if(e&&this.routing===rp){var l=op(this,g);if(null!==l&&k.gm=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.xf(Hc)||c.xf(Kc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);I.free(k);I.free(l)}}return h}}c= b.ga(.5===c.x&&.5===c.y?c:Ac,I.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=np(c,g.copy()))):(k=this.computeSpot(!d,g),f=I.alloc(),g=g.ga(.5===k.x&&.5===k.y?k:Ac,f),e&&(g=np(c,g)),I.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);I.free(c);return h}; S.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.hb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?np(k,h.copy()):c):(c=I.alloc(),h=h.ga(Ac,c),I.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>= k.x?0:180:h.y>=k.y?90:270;I.free(k);k=c}d.kc()&&g.yd(a)&&(k+=180,360<=k&&(k-=360));if(mp(d))return k;a=b.aj();if(0===a)return k;45<=a&&135>a?k+=90:135<=a&&225>a?k+=180:225<=a&&315>a&&(k+=270);360<=k&&(k-=360);return k};S.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.gd()&&(a=op(this,b),null!==a))return a.Av;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; S.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Ac:(b=this.fromSpot,b.Nb()&&(b=a.fromSpot),a=b===$c?uc:b)):(a=b?b:this.toPort,null===a?a=Ac:(b=this.toSpot,b.Nb()&&(b=a.toSpot),a=b===$c?uc:b));return a};function mp(a){return a===uc||.5===a.x&&.5===a.y}S.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==ag&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=qd.alloc();n.set(g); if(m instanceof X)h=m.tf(a,b,c,d,e,n);else if(this.path===m){if(m instanceof W)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var r=h,q=n;if(m.Dh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Ce(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var v=I.alloc(),w=I.alloc(),y=I.alloc(),z=qd.alloc();z.set(q);z.Vv(m.transform);z.Et();w.x=p;w.y=u;w.transform(z);v.x=h;v.y=u;v.transform(z);q=!1;Hn(m,v,w,y)?q=!0:(v.x=p,v.y=r,v.transform(z),Hn(m,v,w,y)?q=!0:(w.x= h,w.y=r,w.transform(z),Hn(m,v,w,y)?q=!0:(v.x=h,v.y=u,v.transform(z),Hn(m,v,w,y)&&(q=!0))));qd.free(z);I.free(v);I.free(w);I.free(y);h=q}}else h=m.Dh(h,n)}else h=kl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));qd.free(n)}}}void 0===f&&qd.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&qd.free(g);return!1}; S.prototype.computeCurve=function(){if(null===this.Qf){var a=this.fromPort,b=this.isOrthogonal;this.Qf=null!==a&&a===this.toPort&&!b}return this.Qf?dg:this.curve};S.prototype.computeCorner=function(){if(this.curve===dg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; S.prototype.findMidLabel=function(){for(var a=this.path,b=this.W.j,c=b.length,d=0;dk?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);K.$(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p));l= k/l;m=p-m;this.jd(a,b);for(a+=1;ak?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.K(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.jd(c,d)}}return!0;case fp:f=this.i(a);n=this.i(c);if(!f.Ma(b)||!n.Ma(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var r=1;if(0!==k-h){var q=(p-m)/(k-h);r=Math.sqrt(1+1/(q*q))}else q=9E9;this.jd(a,b);for(a+=1;ab?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 g=e.actualBounds.copy(),h=f.actualBounds.copy();if(g.v()&&h.v()){g.Fc(8,8);h.Fc(8,8);g.Ie(a);h.Ie(c);if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&h.right>a.x){var k=new I(c.x,a.y);var l=new I(c.x,(a.y+c.y)/2);180===d?(k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1),l.x=k.x,l.y=c.y):270===d&&c.ya.y?(k.x=a.xh.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):h.right,l.x=k.x,l.y=c.y):0===d&&a.xh.top&&a.yg.bottom)180===d&&(h.aa(a)||g.aa(c))?k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0): c.ya.y&&(180===d||270===d)&&(k.y=this.computeMidOrthoPosition(a.x,g.bottom,c.x,Math.min(c.y,h.top),!0)),l.x=c.x,l.y=k.y;if(k.y>g.top&&k.y=g.left&&c.x<=a.x||a.x<=h.right&&a.x>=c.x){if(90===d||270===d)k=new I(Math.max((a.x+c.x)/2,a.x),a.y),l=new I(k.x,c.y)}else k.y=270===d||(0===d||180===d)&&c.ya.y&&h.lefta.y?(k.x=a.x>h.right?this.computeMidOrthoPosition(a.x,a.y,h.right,c.y,!1):a.x>h.left&&(270===d&&a.yh.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):h.left,l.x=k.x,l.y=c.y):180===d&&a.x>h.right&&a.y>h.top&&a.y< h.bottom&&(k.x=a.x,k.y=a.yg.bottom)0===d&&(h.aa(a)||g.aa(c))?k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(k.y=this.computeMidOrthoPosition(a.x,g.bottom,c.x,Math.min(c.y,h.top),!0)),l.x=c.x,l.y=k.y;if(k.y>g.top&&k.y=a.x||a.x>=h.left&&a.x<=c.x){if(90===d||270===d)k=new I(Math.min((a.x+c.x)/2,a.x),a.y),l=new I(k.x,c.y)}else k.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&h.bottom>a.y)k=new I(a.x,c.y),l=new I((a.x+c.x)/2,c.y),270===d?(k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0),l.x=c.x,l.y=k.y):180=== d&&c.xa.x?(k.y=a.yh.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):h.bottom,l.x=c.x,l.y=k.y):90===d&&a.yh.left&&a.xg.right)270===d&&(h.aa(a)||g.aa(c))?k.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(k.x=this.computeMidOrthoPosition(g.right,a.y,Math.min(c.x,h.left),c.y,!1)),l.x=k.x,l.y=c.y;if(k.x>g.left&&k.x=g.top&&c.y<=a.y||a.y<=h.bottom&&a.y>=c.y){if(0===d||180===d)k=new I(a.x,Math.max((a.y+c.y)/2,a.y)),l=new I(c.x,k.y)}else k.x=180===d||(90===d||270===d)&&c.xa.x&&h.top=a.x?(k.y=a.y>h.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,h.bottom,!0):a.y>h.top&&(180===d&&a.xh.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):h.top,l.x=c.x,l.y=k.y):270===d&&a.y>h.bottom&&a.x> h.left&&a.xg.right)90===d&&(h.aa(a)||g.aa(c))?k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(k.x=this.computeMidOrthoPosition(g.right,a.y,Math.min(c.x,h.left),c.y,!1)),l.x=k.x,l.y=c.y;if(k.x>g.left&& k.x=a.y||a.y>=h.top&&a.y<=c.y){if(0===d||180===d)k=new I(a.x,Math.min((a.y+c.y)/2,a.y)),l=new I(c.x,k.y)}else k.x=180===d||(90===d||270===d)&&c.x=vp&&(xk(q), h=q.eA,g.Fc(q.fm*h,q.em*h),tp(q,a,b,p,d,g),h=up(q,p.x,p.y));!q.abort&&h>=vp&&q.IA&&(xk(q),tp(q,a,b,p,d,q.bounds),h=up(q,p.x,p.y));if(!q.abort&&hthis.pointsCount)0===b||180===b?(g.x=a.x,g.y=p.y):(g.x=p.x,g.y=a.y),this.K(2,g.x,g.y),this.m(3,g.x,g.y);else if(p=this.i(3),0===b||180===b)K.A(g.x,p.x)?(g=0===b?Math.max(g.x,a.x):Math.min(g.x,a.x),this.K(2,g,a.y),this.K(3,g,p.y)):K.A(g.y,p.y)?(Math.abs(a.y-g.y)<=q.em/2&&(this.K(2,g.x,a.y),this.K(3, p.x,a.y)),this.m(2,g.x,a.y)):this.K(2,a.x,g.y);else if(90===b||270===b)K.A(g.y,p.y)?(g=90===b?Math.max(g.y,a.y):Math.min(g.y,a.y),this.K(2,a.x,g),this.K(3,p.x,g)):K.A(g.x,p.x)?(Math.abs(a.x-g.x)<=q.fm/2&&(this.K(2,a.x,g.y),this.K(3,a.x,p.y)),this.m(2,a.x,g.y)):this.K(2,g.x,a.y);null!==c&&(a=this.i(1),p=this.i(2),a.x!==p.x&&a.y!==p.y?0===b||180===b?this.m(2,a.x,p.y):this.m(2,p.x,a.y):0===b||180===b?this.m(2,e.x,c.y):this.m(2,c.x,e.y));null!==u&&(0===d||180===d?this.qf(f.x,u.y):this.qf(u.x,f.y));b= !0}else b=!1}}}else b=!1;b||(this.Ae(k),this.Ae(l))}};S.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;this.hasCurviness()&&(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; function Rj(a){if(null===a.diagram||!a.isAvoiding||!tk(a.diagram))return!1;var b=a.points.j,c=b.length;if(4>c)return!1;a=uk(a.diagram,!0,a.containingGroup,null);for(var d=1;dyp&&up(b,l,m)===k-1;)c=l,d=m,0===e?l+=g:90===e?m+=h:180===e?l-=g:m-=h,--k;if(f){if(k>yp)if(180===e||0===e)c=Math.floor(c/g)*g+g/2;else if(90===e||270===e)d=Math.floor(d/h)*h+h/2}else c=Math.floor(c/g)*g+g/2,d=Math.floor(d/h)*h+h/2;k>yp&&(f=e,l=c,m=d,0===e?(f=90,m+=h):90===e?(f=180,l-=g):180===e?(f=270,m-=h):270===e&&(f=0,l+=g),up(b,l,m)===k-1?xp(a,b,l,m,f,!1):(l=c,m=d,0===e?(f=270,m-=h):90=== e?(f=0,l+=g):180===e?(f=90,m+=h):270===e&&(f=180,l-=g),up(b,l,m)===k-1&&xp(a,b,l,m,f,!1)));a.qf(c,d)}S.prototype.rz=function(a){var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Bb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gb)return a.type=vd,this.co=!1,a;var c=!1,d=this.diagram;null!==d&&hp(this)&&d.Pg.contains(this)&&(0!==this.Fl.width||0!==this.Fl.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.yb.j;var g=this.computeCurve();if(g===dg&&3<=b&&!K.$(this.smoothness,0))if(3===b){var h=this.i(1);d=Math.min(e.x,h.x);var k=Math.min(e.y,h.y);h=this.i(2);d=Math.min(d,h.x);k=Math.min(k,h.y)}else{if(this.isOrthogonal)for(k=0;k=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;kv?q>r?(g.x=w-z,g.y=r-z,b.x=w+u,b.y=r+u):(g.x= w-z,g.y=r+z,b.x=w+u,b.y=r-u):q>r?(g.x=w+z,g.y=r-z,b.x=w-u,b.y=r+u):(g.x=w+z,g.y=r+z,b.x=w-u,b.y=r-u));K.$(v,w)&&K.$(r,q)&&(r>p?(y>w?(g.x=w-z,g.y=r-z,b.x=w+u):(g.x=w+z,g.y=r-z,b.x=w-u),b.y=r+u):(y>w?(g.x=w-z,g.y=r+z,b.x=w+u):(g.x=w+z,g.y=r+z,b.x=w-u),b.y=r-u));if(K.$(v,w)&&K.$(w,y)||K.$(p,r)&&K.$(r,q))v=.5*(v+y),p=.5*(p+q),g.x=v,g.y=p,b.x=v,b.y=p;1===n?(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y)):2===n&&K.$(c.x,this.i(0).x)&&K.$(c.y,this.i(0).y)&&(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y));Ld(h,e.x-d,e.y-k,g.x-d,g.y- k,l.x-d,l.y-k);f.set(g);e.set(b);c=l}}f=c.x;c=c.y;e=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(e=zp(this,e.copy(),!1,Gb));f=.5*(f+e.x);c=.5*(c+e.y);Ld(h,b.x-d,b.y-k,f-d,c-k,e.x-d,e.y-k)}else for(c=3;c=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=zp(this,g.copy(),!1,Gb)),Ld(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=I.alloc();f.assign(this.i(0));e=I.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.w(m))0!==this.computeShortLength(!1)&&(m=zp(this,m.copy(),!1,Gb)),Cp(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?q=p.x-r:q=p.x+r;u.y>p.y?C=p.y+y:C=p.y-y;Cp(this, h,n,v,f,new I(q,z),w);Md(h,p.x+n,p.y+v,A+n,C+v);f.h(A,C)}else K.A(f.x,p.x)&&K.A(p.y,u.y)?(r=Math.min(g,Math.abs(p.y-e.y)/2),r=y=Math.min(r,Math.abs(u.x-p.x)/2),K.A(y,0)?(Cp(this,h,n,v,f,p,w),f.assign(p)):(q=p.x,z=p.y,A=q,C=z,p.y>f.y?z=p.y-r:z=p.y+r,u.x>p.x?A=p.x+y:A=p.x-y,Cp(this,h,n,v,f,new I(q,z),w),Md(h,p.x+n,p.y+v,A+n,C+v),f.h(A,C))):(Cp(this,h,n,v,f,p,w),f.assign(p));e.assign(m);n=l}I.free(f)}Td=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=zp(this,e,!0,f)),0!== this.computeShortLength(!1)&&(h=zp(this,h,!1,f)),a.type=vd,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.co=!1;return a};function Bp(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return K.$(a,0)?b:K.$(b,0)?a:Math.sqrt(a*a+b*b)} function zp(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=Bp(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a*(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=Bp(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a*(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} function Ap(a,b,c,d){for(var e=a.pointsCount,f=b;K.$(b.x,f.x)&&K.$(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!K.$(b.x,f.x)&&!K.$(b.y,f.y))return c-1;for(var g=f;K.$(b.x,f.x)&&K.$(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||K.$(b.y,f.y)&&K.$(f.y,g.y)&&(!d||(b.x>=f.x?f.x>=g.x:f.x<=g.x));){if(c>=e)return e-1;g=a.i(c++)}return c-2} function Cp(a,b,c,d,e,f,g){if(!g&&hp(a)){g=[];var h=0;a.isVisible()&&(h=Dp(a,e,f,g));if(0 l-10)h--,l=Math.max(k-5,f.x);else break;k=f.y-10+d;l+=c;n=f.y+d;a.curve===$f?Kd(b,l,n,!1):Ld(b,m,k,l,k,l,n)}else if(K.A(e.x,f.x))if(e.yk-10)h--,k=Math.max(l-5,f.y);else break;l=f.x-10+c;n=f.x+c;k+=d;a.curve===$f?Kd(b,n,k,!1):Ld(b,l,m,l,k,n,k)}}b.lineTo(f.x+c,f.y+d)} function Dp(a,b,c,d){var e=a.diagram;if(null===e||b.w(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ca.j;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yq&&Math.min(g,v)n&&!K.A(g,v)){h.x=q;h.y=n;m=!0;break a}}else if(!K.A(n,r)&& K.A(g,v)&&Math.min(n,r)g&&Math.min(q,u)m&&!K.A(q,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}I.free(h)}function hp(a){a=a.curve;return a===Zf||a===$f}function lp(a,b){if(b||hp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Pg.contains(a)||0===a.Fl.width&&0===a.Fl.height||b.Pg.add(a,a.Fl.copy())} S.prototype.Bq=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Ca.j;for(var g=e.length,h=0;ha&&va(a,">= 0",S,"fromEndSegmentLength"), this.O.Tg=a,this.g("fromEndSegmentLength",b,a),this.Ta())}},fromShortLength:{get:function(){return null!==this.O?this.O.Ug:NaN},set:function(a){this.Gc();var b=this.O.Ug;b!==a&&(this.O.Ug=a,this.g("fromShortLength",b,a),this.cc())}},toSpot:{get:function(){return null!==this.O?this.O.vh:$c},set:function(a){this.Gc();var b=this.O.vh;if(!b.w(a)){a=a.G();this.O.vh=a;this.g("toSpot",b,a);if(b.gd()||a.gd())a=this.toNode,null!==a&&Po(a,this.toPort); this.Ta()}}},toEndSegmentLength:{get:function(){return null!==this.O?this.O.th:NaN},set:function(a){this.Gc();var b=this.O.th;b!==a&&(0>a&&va(a,">= 0",S,"toEndSegmentLength"),this.O.th=a,this.g("toEndSegmentLength",b,a),this.Ta())}},toShortLength:{get:function(){return null!==this.O?this.O.uh:NaN},set:function(a){this.Gc();var b=this.O.uh;b!==a&&(this.O.uh=a,this.g("toShortLength",b,a),this.cc())}},isLabeledLink:{ get:function(){return null===this.bd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);K.dm(e.x,e.y,g.x,g.y,h.x,h.y,k.x,k.y,.5,a);b=Math.min(k.x,b);c=Math.min(k.y,c);e=k}else for(e=this.i(0),f=this.i(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.h(e.x,e.y,0,0),a.Ie(f),e=2;ed&&(d=-d)):K.$(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.De(e));a.push(d)}}return this.Pr}},flattenedTotalLength:{ get:function(){var a=this.Cu;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;d=this.pointsCount?0:this.isOrthogonal||!mp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!mp(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.Fk},set:function(a){var b=this.Fk;b!==a&&(this.Fk=a,this.g("adjusting",b,a))}},corner:{get:function(){return this.tn},set:function(a){var b= this.tn;b!==a&&(this.tn=a,this.cc(),this.g("corner",b,a))}},curve:{get:function(){return this.vn},set:function(a){var b=this.vn;b!==a&&(this.vn=a,this.Ta(),this.cc(),lp(this,b===$f||b===Zf||a===$f||a===Zf),this.g("curve",b,a))}},curviness:{get:function(){return this.wn},set:function(a){var b=this.wn;b!==a&&(this.wn=a,this.Ta(),this.cc(),this.g("curviness",b,a))}},routing:{get:function(){return this.Oj},set:function(a){var b= this.Oj;b!==a&&(this.Oj=a,this.Qf=null,this.Ta(),lp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{get:function(){return this.Np},set:function(a){var b=this.Np;b!==a&&(this.Np=a,this.cc(),this.g("smoothness",b,a))}},key:{get:function(){var a=this.diagram;if(null!==a&&a.model.dj())return a.model.Vb(this.data)}}});S.prototype.invalidateOtherJumpOvers=S.prototype.Bq;S.prototype.findClosestSegment=S.prototype.rz; S.prototype.updateRoute=S.prototype.kj;S.prototype.invalidateRoute=S.prototype.Ta;S.prototype.rollbackRoute=S.prototype.vy;S.prototype.commitRoute=S.prototype.rf;S.prototype.startRoute=S.prototype.Mh;S.prototype.clearPoints=S.prototype.ak;S.prototype.removePoint=S.prototype.gw;S.prototype.addPointAt=S.prototype.qf;S.prototype.addPoint=S.prototype.Ae;S.prototype.insertPointAt=S.prototype.m;S.prototype.insertPoint=S.prototype.Wz;S.prototype.setPointAt=S.prototype.K;S.prototype.setPoint=S.prototype.jd; S.prototype.getPoint=S.prototype.i;S.prototype.getOtherPort=S.prototype.Oz;S.prototype.getOtherNode=S.prototype.wq; var cp=new D(S,"Normal",1),Hp=new D(S,"Orthogonal",2),Ip=new D(S,"AvoidsNodes",6),rp=new D(S,"AvoidsNodesStraight",7),ag=new D(S,"None",0),dg=new D(S,"Bezier",9),$f=new D(S,"JumpGap",10),Zf=new D(S,"JumpOver",11),dp=new D(S,"End",17),ep=new D(S,"Scale",18),fp=new D(S,"Stretch",19),Vm=new D(S,"OrientAlong",21),Om=new D(S,"OrientPlus90",22),Qm=new D(S,"OrientMinus90",23),gp=new D(S,"OrientOpposite",24),Wm=new D(S,"OrientUpright",25),Pm=new D(S,"OrientPlus90Upright",26),Rm=new D(S,"OrientMinus90Upright", 27),Sm=new D(S,"OrientUpright45",28);S.className="Link";S.Normal=cp;S.Orthogonal=Hp;S.AvoidsNodes=Ip;S.AvoidsNodesStraight=rp;S.None=ag;S.Bezier=dg;S.JumpGap=$f;S.JumpOver=Zf;S.End=dp;S.Scale=ep;S.Stretch=fp;S.OrientAlong=Vm;S.OrientPlus90=Om;S.OrientMinus90=Qm;S.OrientOpposite=gp;S.OrientUpright=Wm;S.OrientPlus90Upright=Pm;S.OrientMinus90Upright=Rm;S.OrientUpright45=Sm;function Gp(a,b,c,d){Ya(this);this.ne=this.Wr=!1;this.Mt=a;this.qy=b;this.Wv=c;this.sy=d;this.links=[]} Gp.prototype.pm=function(){if(!this.Wr){var a=this.links;0=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Pd=Math.floor((a.x-this.lc)/this.lc)*this.lc;this.Qd=Math.floor((b-this.mc)/this.mc)*this.mc;this.Bo=Math.ceil((c+2*this.lc)/this.lc)*this.lc;this.Co=Math.ceil((d+2*this.mc)/this.mc)*this.mc;a=1+(Math.ceil((this.Bo-this.Pd)/this.lc)|0);b=1+(Math.ceil((this.Co-this.Qd)/this.mc)|0);if(null===this.Db||this.Uj=yp&&(a.Db[b][c]=Jp)} vk.prototype.nk=function(a,b,c,d){if(a>this.Bo||a+cthis.Co||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Uj)|0;for(c=Math.min(b+e-1,this.Vj)|0;a<=d;a++)for(e=b;e<=c;e++)if(this.Db[a][e]===wp)return!1;return!0}; function Kp(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.Db[l][m];if(n>=yp&&n=a.Db[l][m]);)a.Db[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h, k)}}function Lp(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=wp,m=yp;for(a.Db[b][c]=m;l===wp&&b>f&&bh&&cf&&bh&&c=Math.abs(g-b)&&1>=Math.abs(h-d))a.abort=!0;else{var k=f.x,l=f.y,m=f.x+f.width,n=f.y+f.height;k-=a.Pd;k/=a.lc;l-=a.Qd;l/=a.mc;m-=a.Pd;m/=a.lc;n-=a.Qd;n/=a.mc;f=Math.max(0,Math.min(a.Uj,k|0));m=Math.min(a.Uj,Math.max(0,m|0));l=Math.max(0,Math.min(a.Vj,l|0));n=Math.min(a.Vj,Math.max(0,n|0));g|=0;h|=0;b|=0;d|=0;k=0===c||90===c? 1:-1;c=90===c||270===c;a.Db[g][h]===wp?(Lp(a,g,h,k,c,f,m,l,n),Lp(a,g,h,1,!c,f,m,l,n),Lp(a,g,h,-1,!c,f,m,l,n)):Lp(a,g,h,k,c,g,h,g,h);a.Db[b][d]===wp?(Mp(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,m,l,n),Mp(a,b,d,1,!(90===e||270===e),f,m,l,n),Mp(a,b,d,-1,!(90===e||270===e),f,m,l,n)):Mp(a,b,d,k,c,b,d,b,d);a.abort||(Kp(a,g,h,1,!1,f,m,l,n),Kp(a,g,h,-1,!1,f,m,l,n),Kp(a,g,h,1,!0,f,m,l,n),Kp(a,g,h,-1,!0,f,m,l,n))}}} ma.Object.defineProperties(vk.prototype,{bounds:{get:function(){return new N(this.Pd,this.Qd,this.Bo-this.Pd,this.Co-this.Qd)}},fm:{get:function(){return this.lc},set:function(a){0=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case 3:return c>a&&c<=180+a?180:270;case 5:return c>180-a&&c<=360-a?270:0;case 12:return c>a&&c<=180+a?90:0;case 10:return c>180-a&&c<=360-a?180:90;case 7:return 90180+a&&c<=360-a?270:0;case 13:return 180a&&180>=c?90:0;case 14:return c> a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!==b&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}pp.prototype.pm=function(){this.Yd.length=0}; function qp(a,b){var c=a.Yd;if(0===c.length){a:if(!a.Gq){c=a.Gq;a.Gq=!0;var d=null,e=a.node,f=e instanceof uf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.Ux();else{if(!f.actualBounds.v()){a.Gq=c;break a}d=f;g=d.Cv()}f=a.Yd.length=0;var h=a.port.ga(vc,I.alloc()),k=a.port.ga(Gc,I.alloc());e=N.allocAt(h.x,h.y,0,0);e.Ie(k);I.free(h);I.free(k);h=I.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.aj();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.yd(d),n=l.computeSpot(m,a.port);if(n.gd()&&(m=m?l.toPort:l.fromPort,null!==m)){var p=m.part;if(null!==p){var r=p.findVisibleNode();null!==r&&r!==p&&(p=r,m=p.port);m=l.computeOtherPoint(p,m);p=h.Sa(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=Np(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));r=a.Yd[f];void 0===r?(r=new Op(l,p,n),a.Yd[f]=r):(r.link=l,r.angle=p,r.zc= n);r.$v.set(m);f++}}}}I.free(h);a.Yd.sort(pp.prototype.l);k=a.Yd.length;d=-1;for(f=h=0;fMath.abs(u)?(y=Math.abs(u)/p,p=Math.abs(u)):y=1;break;case 2:r>Math.abs(z)?(y=Math.abs(z)/r,r=Math.abs(z)):y=1;break;case 1:n>Math.abs(u)?(y=Math.abs(u)/n,n=Math.abs(u)):y=1;break;default:case 4:m>Math.abs(z)?(y=Math.abs(z)/ m,m=Math.abs(z)):y=1}w=0}var G=A.Eq;if(d===$o){A=A.link.computeThickness();A*=y;G.set(C);switch(q){case 8:G.x=C.x+u/2+p/2-w-A/2;break;case 2:G.y=C.y+z/2+r/2-w-A/2;break;case 1:G.x=C.x+u/2-n/2+w+A/2;break;default:case 4:G.y=C.y+z/2-m/2+w+A/2}w+=A}else{var L=.5;d===Mo&&(L=(A.xq+1)/(A.gm+1));G.x=C.x+u*L;G.y=C.y+z*L}}}I.free(h);I.free(k);I.free(g);I.free(l);C=a.Yd;for(f=0;fb.zc?1:a.angleb.angle?1:0}; pp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,uc,b.fromPort===this.port),d=a.xq;if(0>d)return c;var e=a.gm;if(1>=e||!b.isOrthogonal)return c;b=a.$v;var f=a.Eq;if(2===a.zc||8===a.zc)d=e-1-d;return((a=2===a.zc||4===a.zc)?b.y=c-1?(g=0,e=d,f+=h+20,h=0):g++}null!==a&&a.Va("Layout")}this.isValidLayout=!0};Fi.prototype.wk=function(a){return!a.location.v()||a instanceof uf&&a.wk?!0:!1}; function Qp(a,b,c,d,e,f,g,h){for(c=c.iterator;c.next();){var k=c.value;d&&!k.isTopLevel||null!==e&&!e(k)||!k.canLayout()||(f&&k instanceof V?k.isLinkLabel||(k instanceof uf?null===k.layout?Qp(a,b,k.memberParts,!1,e,f,g,h):(Rp(k),b.add(k)):(Rp(k),b.add(k))):g&&k instanceof S?b.add(k):!h||!k.Wb()||k instanceof V||(Rp(k),b.add(k)))}}function Rp(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Ab()} Fi.prototype.bj=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new N),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b};Fi.prototype.Kx=function(a){var b=new F;a instanceof Q?(Qp(this,b,a.nodes,!0,null,!0,!0,!0),Qp(this,b,a.links,!0,null,!0,!0,!0),Qp(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof uf?Qp(this,b,a.memberParts,!1,null,!0,!0,!0):Qp(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Fi.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.ga(vc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a}; ma.Object.defineProperties(Fi.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},group:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a,null!==a&&(this.B=a.diagram))}},isOngoing:{get:function(){return this.ho},set:function(a){this.ho!==a&&(this.ho=a)}},isInitial:{get:function(){return this.ri},set:function(a){this.ri=a;a||(this.lo=!0)}}, isViewportSized:{get:function(){return this.mo},set:function(a){this.mo!==a&&(this.mo=a)&&this.C()}},isRouting:{get:function(){return this.jo},set:function(a){this.jo!==a&&(this.jo=a)}},isRealtime:{get:function(){return this.io},set:function(a){this.io!==a&&(this.io=a)}},isValidLayout:{get:function(){return this.lo},set:function(a){this.lo!==a&&(this.lo=a,a||(a=this.diagram,null!== a&&(a.Hg=!0)))}},network:{get:function(){return this.l},set:function(a){this.l!==a&&(this.l=a,null!==a&&(a.layout=this))}},boundsComputation:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.C())}},arrangementOrigin:{get:function(){return this.$m},set:function(a){this.$m.w(a)||(this.$m.assign(a),this.C())}}});Fi.prototype.collectParts=Fi.prototype.Kx;Fi.prototype.getLayoutBounds=Fi.prototype.bj; Fi.prototype.invalidateLayout=Fi.prototype.C;Fi.className="Layout";function Pp(a){Ya(this);this.ic=a;this.nf=new F;this.ge=new F;this.Nt=new H;this.It=new H}Pp.prototype.clear=function(){if(this.nf)for(var a=this.nf.iterator;a.next();)a.value.clear();if(this.ge)for(a=this.ge.iterator;a.next();)a.value.clear();this.nf=new F;this.ge=new F;this.Nt=new H;this.It=new H}; Pp.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.nf.count+" edges: "+this.ge.count;if(1b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(Sp.prototype,{sourceEdgesArrayAccess:{get:function(){return this.Cg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.vg._dataArray}},data:{get:function(){return this.kb},set:function(a){this.kb=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.u.h(d/2,b/2);this.l.h(a,c,d,b)}}},node:{get:function(){return this.Ci}, set:function(a){if(this.Ci!==a){this.Ci=a;a.Ab();var b=this.network.layout,c=N.alloc(),d=b.bj(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.l.h(b,e,f,d);N.free(c);if(!(a instanceof uf)&&(a=a.locationObject.ga(Ac),a.v())){this.u.h(a.x-b,a.y-e);return}this.u.h(f/2,d/2)}}},bounds:{get:function(){return this.l},set:function(a){this.l.w(a)||this.l.assign(a)}},focus:{get:function(){return this.u},set:function(a){this.u.w(a)|| this.u.assign(a)}},centerX:{get:function(){return this.l.x+this.u.x},set:function(a){var b=this.l;b.x+this.u.x!==a&&(b.ea(),b.x=a-this.u.x,b.freeze())}},centerY:{get:function(){return this.l.y+this.u.y},set:function(a){var b=this.l;b.y+this.u.y!==a&&(b.ea(),b.y=a-this.u.y,b.freeze())}},focusX:{get:function(){return this.u.x},set:function(a){var b=this.u;b.x!==a&&(b.ea(),b.x=a,b.freeze())}},focusY:{ get:function(){return this.u.y},set:function(a){var b=this.u;b.y!==a&&(b.ea(),b.y=a,b.freeze())}},x:{get:function(){return this.l.x},set:function(a){var b=this.l;b.x!==a&&(b.ea(),b.x=a,b.freeze())}},y:{get:function(){return this.l.y},set:function(a){var b=this.l;b.y!==a&&(b.ea(),b.y=a,b.freeze())}},width:{get:function(){return this.l.width},set:function(a){var b=this.l;b.width!==a&&(b.ea(),b.width= a,b.freeze())}},height:{get:function(){return this.l.height},set:function(a){var b=this.l;b.height!==a&&(b.ea(),b.height=a,b.freeze())}},network:{get:function(){return this.Yc},set:function(a){this.Yc=a}},sourceVertexes:{get:function(){for(var a=new F,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new F,b= this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new F,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.Cg.iterator}},destinationEdges:{get:function(){return this.vg.iterator}},edges:{get:function(){for(var a= new E,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{get:function(){return this.Cg.count+this.vg.count}}});Sp.prototype.deleteDestinationEdge=Sp.prototype.xv;Sp.prototype.addDestinationEdge=Sp.prototype.ov;Sp.prototype.deleteSourceEdge=Sp.prototype.yv;Sp.prototype.addSourceEdge=Sp.prototype.qv;Sp.className="LayoutVertex";Sp.standardComparer=Zp; Sp.smartComparer=function(a,b){if(null!==a){if(null!==b){a=a.Ci;var c=b.Ci;if(null!==a){if(null!==c){b=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);a=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);for(c=0;c=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.ua("Layout");d=[];switch(this.alignment){case hq:var h=b,k=c,l=N.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0g)d.push(new N(0,u,g+h,w)),v=0,q=r,u+=w,w=0;w=Math.max(w,G);switch(p){case gq:A=-A.width;break;default:A= 0}z.moveTo(q+A,u);switch(p){case gq:q-=C;break;default:q+=C}v++}d.push(new N(0,u,g+h,w));N.free(l);break;case $p:k=g;m=f;n=b;p=c;g=N.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=I.alloc();for(q=0;q=l&&(k-=l);l=z=0;C=Math.max(this.cellSize.height,1);A=f=0;G=!0;v=I.alloc();for(L=0;Lm-1||0k){d.push(new N(0,G?y-f:y,k+n,A+f+p));for(J=0;Jl&&(f.width+=f.x-l,f.x=l);N.free(g)}for(h=f=g=e=0;hb?1:0} ma.Object.defineProperties(Mk.prototype,{wrappingWidth:{get:function(){return this.fq},set:function(a){this.fq!==a&&(0n)){var u=n+en(q);q.Hc(u,!0);qn(q,u,n)}}b.isModified=!0}}finally{b.Z=!0}}}}};ti.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Ba(a);for(b=this.nodes.iterator;b.next();)b.value.Ba(a);for(b=this.links.iterator;b.next();)b.value.Ba(a)}; ti.prototype.Yq=function(){for(var a=this.B.model,b=new F,c=a.nodeDataArray,d=0;df?b+("\\u000"+a.charCodeAt(d).toString(16)):32>f?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===f?b+"\\u2028":8233===f?b+"\\u2029":b+e}}return'"'+b+'"'}; t.Om=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.Om(a.valueOf()):Aa(a)?Oq(this,a):za(a)?Lq(this,a):"function"===typeof a?"null":a.toString()}; function Oq(a,b,c){void 0===c&&(c=!1);var d=b.length;if(0>=d)return"[]";var e=new cb;e.add("[ ");c&&1d)return;Da(a.Dc,d)}Wq(a,"nodeDataArray",xe,"nodeDataArray",a,b,null,d,null);a.Xq(b)}t.vA=function(a){if(Aa(a))for(var b=a.length,c=0;cb&&(b=a.length);Ca(a,b,c);Wq(this,"",we,"",a,null,c,null,b)};t.ew=function(a,b){void 0===b&&(b=-1);a===this.Dc&&B("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Da(a,b);Wq(this,"",xe,"",a,c,null,b,null)}; t.uq=function(a){if(null===a)return"";var b=this.Jj;if(""===b)return"";b=rn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;B("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};t.Im=function(a,b){if(null!==a){var c=this.Jj;if(""!==c)if(this.Ya(a)){var d=rn(a,c);void 0===d&&(d="");d!==b&&(Tj(a,c,b),Wq(this,"nodeCategory",ue,c,a,d,b))}else Tj(a,c,b)}};t.Km=function(a,b){this.Im(b,this.uq(a))};t.rm=function(){return!1};t.kk=function(){return!1};t.dj=function(){return!1}; t.Gt=function(){return!1};t.lk=function(){return!1};function Di(){return new Z}function Rq(a,b){if("function"===typeof b){if(b.className)return b.className;if(b.name)return b.name}else if("object"===typeof b&&null!==b&&b.constructor)return Rq(a,b.constructor);return typeof b}function Uq(a){return Zq[a]?Zq[a]:void 0!==x.go&&x.go[a]?x.go[a]:null} function rn(a,b){if(!a||!b)return null;try{if("function"===typeof b)var c=b(a);else"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c}function Tj(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}} ma.Object.defineProperties(Z.prototype,{name:{get:function(){return this.Qa},set:function(a){var b=this.Qa;b!==a&&(this.Qa=a,this.g("name",b,a))}},dataFormat:{get:function(){return this.xn},set:function(a){var b=this.xn;b!==a&&(this.xn=a,this.g("dataFormat",b,a))}},isReadOnly:{get:function(){return this.Wf},set:function(a){var b=this.Wf;b!==a&&(this.Wf=a,this.g("isReadOnly",b,a))}},modelData:{ get:function(){return this.l},set:function(a){var b=this.l;b!==a&&(this.l=a,this.g("modelData",b,a),this.Ba(a))}},undoManager:{get:function(){return this.u},set:function(a){var b=this.u;b!==a&&(null!==b&&b.uy(this),this.u=a,null!==a&&a.Gx(this))}},skipsUndoManager:{get:function(){return this.pg},set:function(a){this.pg=a}},nodeKeyProperty:{get:function(){return this.Di},set:function(a){var b=this.Di; b!==a&&(""===a&&B("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===xe){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;za(a)&&"number"===typeof c&&(d=this.Vb(a),b?(this.Xf.add(a),this.Pc[c]!==a&&this.Pc.splice(c,0,a),void 0!==d&&this.eb.add(d,a)):(this.Xf.remove(a),this.Pc[c]=== a&&this.Pc.splice(c,1),void 0!==d&&this.eb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.vf(a.object);Array.isArray(d)&&"number"===typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)));return}}Z.prototype.changeState.call(this,a,b)}};t=ar.prototype;t.sm=function(a){if(void 0!==a){var b=this.lj;if(null!==b){var c=this.Kb(a);null===c&&(c=this.copyNodeData(b),Tj(c,this.nodeKeyProperty,a),this.pf(c))}return a}}; t.ay=function(a){return vq(this,a,!0)};t.nw=function(a,b){Dq(this,a,b,!0)};t.gy=function(a){return vq(this,a,!1)};t.sw=function(a,b){Dq(this,a,b,!1)};function vq(a,b,c){if(null!==b&&(a=c?a.Ve:a.We,""!==a&&(a=rn(b,a),void 0!==a))){if(xq(a))return a;B((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function Dq(a,b,c,d){null===c&&(c=void 0);if(null!==b){var e=d?a.Ve:a.We;if(""!==e)if(c=a.sm(c),a.vc(b)){var f=rn(b,e);f!==c&&(Bq(a,f,b),Tj(b,e,c),null===a.Kb(c)&&Cq(a,c,b),Wq(a,d?"linkFromKey":"linkToKey",ue,e,b,f,c),"string"===typeof e&&a.Ba(b,e))}else Tj(b,e,c)}}t.by=function(a){return uq(this,a,!0)};t.ow=function(a,b){Eq(this,a,b,!0)};t.hy=function(a){return uq(this,a,!1)};t.tw=function(a,b){Eq(this,a,b,!1)}; function uq(a,b,c){if(null===b)return"";a=c?a.Fj:a.Gj;if(""===a)return"";b=rn(b,a);return void 0===b?"":b}function Eq(a,b,c,d){if(null!==b){var e=d?a.Fj:a.Gj;if(""!==e)if(a.vc(b)){var f=rn(b,e);void 0===f&&(f="");f!==c&&(Tj(b,e,c),Wq(a,d?"linkFromPortId":"linkToPortId",ue,e,b,f,c),"string"===typeof e&&a.Ba(b,e))}else Tj(b,e,c)}}t.vf=function(a){if(null===a)return dr;var b=this.Od;if(""===b)return dr;a=rn(a,b);return void 0===a?dr:a}; t.Xt=function(a,b){if(null!==a){var c=this.Od;if(""!==c)if(this.vc(a)){var d=rn(a,c);void 0===d&&(d=dr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.vc(a)&&(Bq(this,b,a),Wq(this,"linkLabelKeys",xe,c,a,b,null,e,null)))}else void 0!==d&&B(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.Vb=function(a){if(null!==a){var b=this.yi;if(""!==b&&(b=rn(a,b),void 0!==b)){if(xq(b))return b;B("Key value for link data "+a+" is not a number or a string: "+b)}}}; t.Wt=function(a,b){if(null!==a){var c=this.yi;if(""!==c)if(this.vc(a)){var d=rn(a,c);d!==b&&null===this.wg(b)&&(Tj(a,c,b),void 0!==d&&this.eb.remove(d),this.eb.add(b,a),Wq(this,"linkKey",ue,c,a,d,b),"string"===typeof c&&this.Ba(a,c))}else Tj(a,c,b)}};t.wg=function(a){null===a&&B("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&xq(a)?this.eb.H(a):null}; t.Fq=function(a){if(null!==a){var b=this.yi;if(""!==b){var c=this.Vb(a);if(void 0===c||this.eb.contains(c)){var d=this.yl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.eb.contains(c))){Tj(a,b,c);return}if("string"===typeof c){for(d=2;this.eb.contains(c+d);)d++;Tj(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.eb.count-1;this.eb.contains(c);)c--;Tj(a,b,c)}}}}};t.vc=function(a){return null===a?!1:this.Xf.contains(a)};t.Ri=function(a){null!==a&&(nb(a),this.vc(a)||zq(this,a,!0))}; function zq(a,b,c){if(""!==a.linkKeyProperty){var d=a.Vb(b);if(void 0!==d&&a.eb.H(d)===b)return;a.Fq(b);d=a.Vb(b);if(void 0===d){B("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.eb.add(d,b)}a.Xf.add(b);d=null;c&&(d=a.Pc.length,a.Pc.splice(d,0,b));Wq(a,"linkDataArray",we,"linkDataArray",a,null,b,null,d);er(a,b)}t.Ty=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.Pc.splice(d,1)}Wq(a,"linkDataArray",xe,"linkDataArray",a,b,null,d,null);c=vq(a,b,!0);Bq(a,c,b);c=vq(a,b,!1);Bq(a,c,b);d=a.vf(b);if(Array.isArray(d))for(var e=d.length,f=0;f=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new E;b.addAll(a.iterator);a=new E;var c=new E;var d=this.sort(b);var e,f,g=this.vr;var h=this.arrangement;var k=this.nodeDiameterFormula;var l=this.radius;if(!isFinite(l)||0>=l)l=NaN;var m=this.aspectRatio;if(!isFinite(m)||0>=m)m=1;var n=this.startAngle; isFinite(n)||(n=0);var p=this.sweepAngle;if(!isFinite(p)||360p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===wr&&k===xr?h=hr:h===wr&&k!==xr&&(h=this.arrangement);if((this.direction===rr||this.direction===sr)&&this.sorting!==lr){for(k=0;!(k>=d.length);k+=2){a.add(d.L(k));if(k+1>=d.length)break;c.add(d.L(k+1))}this.direction===rr?(this.arrangement===wr&&a.reverse(),d=new E,d.addAll(a),d.addAll(c)):(this.arrangement===wr&&c.reverse(),d=new E,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;r< d.length;r++){var q=n+p*f*(this.direction===kr?1:-1)/k,u=d.L(r).diameter;isNaN(u)&&(u=zr(d.L(r),q));360>p&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===wr){isNaN(b)&&(b=6);if(h!==hr&&h!==wr){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g= r/(360<=p?k:k-1)}this.bx=h;this.$b=l;this.Gn=m;this.ex=n;this.Jr=p;this.tj=b;this.Ud=f;this.vr=g;b=d;d=this.bx;h=this.$b;l=this.ex;m=this.Jr;n=this.tj;p=this.Ud;k=this.vr;if(this.direction!==rr&&this.direction!==sr||d!==wr)if(this.direction===rr||this.direction===sr){g=0;switch(d){case vr:g=180*Cr(this,h,p,l,k)/Math.PI;break;case hr:k=b=0;g=a.first();null!==g&&(b=zr(g,Math.PI/2));g=c.first();null!==g&&(k=zr(g,Math.PI/2));g=180*Cr(this,h,p,l,n+(b+k)/2)/Math.PI;break;case ur:g=m/b.length}if(this.direction=== rr){switch(d){case vr:Dr(this,a,l,tr);break;case hr:Er(this,a,l,tr);break;case ur:Fr(this,a,m/2,l,tr)}switch(d){case vr:Dr(this,c,l+g,kr);break;case hr:Er(this,c,l+g,kr);break;case ur:Fr(this,c,m/2,l+g,kr)}}else{switch(d){case vr:Dr(this,c,l,tr);break;case hr:Er(this,c,l,tr);break;case ur:Fr(this,c,m/2,l,tr)}switch(d){case vr:Dr(this,a,l+g,kr);break;case hr:Er(this,a,l+g,kr);break;case ur:Fr(this,a,m/2,l+g,kr)}}}else switch(d){case vr:Dr(this,b,l,this.direction);break;case hr:Er(this,b,l,this.direction); break;case ur:Fr(this,b,m,l,this.direction);break;case wr:Gr(this,b,m,l,this.direction)}else Gr(this,b,m,l-m/2,kr)}this.updateParts();this.network=null;this.isValidLayout=!0};function Fr(a,b,c,d,e){var f=a.Jr,g=a.$b;a=a.Ud;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===kr?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;Jr(a,k,l,m,n,e,f)||Kr(a,k,l,m,n,e,f);k=f.x;l=f.y}I.free(f);a.Kj++;if(!(23Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0Math.abs(p)? 0:p;k=Math.abs(f)>Math.abs(n)?0n:0a.Kj?a.$b-g/(2*Math.PI):5>m.length&&10=n.length-1)break;Jr(a,k,l,n,p,e,m)||Kr(a,k,l,n,p,e,m);k=m.x;l=m.y}I.free(m);a.Kj++;if(!(23a.Kj?a.$b-f/(2*Math.PI):a.$b-(0h){f=b-a;if(f<-h)return g.x=f,g.y=l,!1;m=!0}}else if(f=b-a,f<-h){f=b+a;if(f>h)return g.x=f,g.y=l,!1;m=!0}l=Math.sqrt(1-Math.min(1,f*f/(h*h)))*k;0>c!==m&&(l=-l);if(Math.abs(c-l)>(d[e].height+d[e+1].height)/2)return g.x=f,g.y=l,!1;g.x=f;g.y=l;return!0} function Kr(a,b,c,d,e,f,g){var h=a.$b,k=a.Ud,l=0;a=(d[e].height+d[e+1].height)/2+a.tj;d=!1;if(0<=b!==(f===kr)){if(f=c-a,f<-k){f=c+a;if(f>k){g.x=l;g.y=f;return}d=!0}}else if(f=c+a,f>k){f=c-a;if(f<-k){g.x=l;g.y=f;return}d=!0}l=Math.sqrt(1-Math.min(1,f*f/(k*k)))*h;0>b!==d&&(l=-l);g.x=l;g.y=f}gr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; gr.prototype.commitNodes=function(){var a=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,b=a?this.group.location.copy():null,c=this.actualCenter;a?c=new I(0,0):(c.x=this.arrangementOrigin.x+this.$b,c.y=this.arrangementOrigin.y+this.Ud);for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;e.x+=c.x;e.y+=c.y;e.commit()}a&&(this.group.Ab(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.be(c.be(a)),this.group.move(b),this.Uw=b.be(a))}; gr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Br(a,b,c,d,e){var f=a.Ky;if(.001>Math.abs(a.Gn-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;var g=0;var h=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1));for(var k=0,l=0;l<=f;l++){void 0!==d&&void 0!==e?k=d+l*e/f:k=l*Math.PI/(2*f);var m=Math.sin(k);g+=Math.sqrt(1-a*a*m*m)*h}return void 0!==d&&void 0!==e?(b>c?b:c)*g:4*(b>c?b:c)*g} function Ar(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?Br(a,1,c,d,e):Br(a,1,c))}function Cr(a,b,c,d,e){if(.001>Math.abs(a.Gn-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,g=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+h*a);g+=(b>c?b:c)*Math.sqrt(1-f*f*k*k)*a;if(g>=e)return h*a}} gr.prototype.sort=function(a){switch(this.sorting){case pr:break;case qr:a.reverse();break;case nr:a.sort(this.comparer);break;case or:a.sort(this.comparer);a.reverse();break;case lr:for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.L(f));b[f]=-1;f=a.L(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<= b[e]&&b[e]++;for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(b=0;ba[b].indexOf(d)&&a[b].push(d);for(e=e.sourceEdges;e.next();)d=c.indexOf(e.value.fromVertex),d!==b&&0>a[b].indexOf(d)&&a[b].push(d)}f=[];for(b=0;ba[b[q]].indexOf(b[q===b.length-1?0:q+1])&&r.push(q===b.length-1?0:q+1);if(0===r.length)for(q=0;qb.indexOf(G)||Cb.indexOf(G)||C=u?C+1:C)),w+=C=u&&C++,z>=u&&z++,C>z&&(A=z,z=C,C=A),z-C<(b.length+2)/2===(Cr||r===m||(q=r>m?r-m:m-r,n+=rg-q?1:-1);b.splice(0>n?m:m+1,0,k);e.splice(h,1);h--}else f=!1;if(f)break;else b.push(e[0]),e.splice(0,1)}for(a=0;a=a?this.Vl=a:this.Vl=360,this.C())}},arrangement:{get:function(){return this.Cb},set:function(a){this.Cb===a||a!==wr&&a!==hr&&a!==vr&&a!==ur||(this.Cb=a,this.C())}},direction:{get:function(){return this.J},set:function(a){this.J===a||a!==kr&&a!==tr&&a!==rr&&a!==sr||(this.J=a,this.C())}},sorting:{get:function(){return this.Rc},set:function(a){this.Rc===a||a!==pr&&a!==qr&& a!==nr&&!or&&a!==lr||(this.Rc=a,this.C())}},comparer:{get:function(){return this.Mc},set:function(a){this.Mc!==a&&(this.Mc=a,this.C())}},spacing:{get:function(){return this.ef},set:function(a){this.ef!==a&&(this.ef=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Vo},set:function(a){this.Vo===a||a!==mr&&a!==xr||(this.Vo=a,this.C())}},actualXRadius:{get:function(){return this.$b}}, actualYRadius:{get:function(){return this.Ud}},actualSpacing:{get:function(){return this.tj}},actualCenter:{get:function(){return this.Uw}}}); var hr=new D(gr,"ConstantSpacing",0),vr=new D(gr,"ConstantDistance",1),ur=new D(gr,"ConstantAngle",2),wr=new D(gr,"Packed",3),kr=new D(gr,"Clockwise",4),tr=new D(gr,"Counterclockwise",5),rr=new D(gr,"BidirectionalLeft",6),sr=new D(gr,"BidirectionalRight",7),pr=new D(gr,"Forwards",8),qr=new D(gr,"Reverse",9),nr=new D(gr,"Ascending",10),or=new D(gr,"Descending",11),lr=new D(gr,"Optimized",12),mr=new D(gr,"Pythagorean",13),xr=new D(gr,"Circular",14);gr.className="CircularLayout";gr.ConstantSpacing=hr; gr.ConstantDistance=vr;gr.ConstantAngle=ur;gr.Packed=wr;gr.Clockwise=kr;gr.Counterclockwise=tr;gr.BidirectionalLeft=rr;gr.BidirectionalRight=sr;gr.Forwards=pr;gr.Reverse=qr;gr.Ascending=nr;gr.Descending=or;gr.Optimized=lr;gr.Pythagorean=mr;gr.Circular=xr;function jr(){this.mm=-Infinity;this.Pm=this.Ck=null} jr.prototype.compare=function(a,b){if(0this.mm||Math.abs(a)a&&0f?(e=r.x+r.width/2,h=r.y+r.height/2,k[0]=new I(r.x+r.width+d.width,r.y),k[1]=new I(r.x,r.y+r.height+d.height),f=2):(m=Qr(k,f,e,h,r.width,r.height,d),p=k[m],n=new I(p.x+r.width+d.width,p.y),r=new I(p.x,p.y+r.height+ d.height),m+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().bounds,d=this.network.vertexes.iterator;d.next();){if(d.value.bounds.Ic(c)&&(a++,2a.network.vertexes.count)return!1;a.yh=a.network.vertexes.na();a=a.yh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.zd-a.zd});for(b=a.length-1;0<=b&&1>=a[b].zd;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mr&& (r=1);h=K.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new N(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new I(p.x+g,p.y+h)}}a.network=d;return c}function Ur(a,b){for(var c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.He){var e=d.He.L(d.lw);d.zd=e.cu;var f=e.Kw,g=e.Lw;d.bounds=new N(d.centerX-f,d.centerY-g,e.du,e.bu);d.focus=new I(f,g);d.lw--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Vr(a,b){var c=b.bk;if(null!==c&&0!==c.count){var d=b.centerX,e=b.centerY,f=b.width,g=b.height;null!==b.He&&0=n.zd?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0>1)+l)*(0===h%2?1:-1);k.centerX=d+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} function Qr(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;lm.y&&a[p].x-m.xm.x&&a[p].y-m.yb+f?(c=d+e-g,a=a-b-f,K.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,K.sqrt(c*c+a*a)):a+cb+f?a-(b+f):a+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.centerX,e=d,f=c=c.centerY,g=1;gf-c)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerX-b.centerX}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerY-b.centerY});c=a.Tf;var l=d=h=0;for(f= 0;fc||l-k>c){if(e)break}else if(m-r>c||r-m>c){if(!e)break}else{var q=Xr(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Zr),q=d.random(), h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*q):kr?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):kn?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Zr),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;for(e=d=0;ea.epsilonDistance*a.epsilonDistance}Nr.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};Nr.prototype.moveFixedVertex=function(){};Nr.prototype.commitLayout=function(){this.pw();this.commitNodes();this.isRouting&&this.commitLinks()}; Nr.prototype.pw=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=$c,b.toSpot=$c)}};Nr.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=N.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;N.free(c)}c=N.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}N.free(c)}; Nr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};Nr.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Wk:a};Nr.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Vk:a};Nr.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Tk:a};Nr.prototype.electricalFieldX=function(){return 0};Nr.prototype.electricalFieldY=function(){return 0}; Nr.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Uk:a};Nr.prototype.gravitationalFieldX=function(){return 0};Nr.prototype.gravitationalFieldY=function(){return 0};Nr.prototype.isFixed=function(a){return a.isFixed}; ma.Object.defineProperties(Nr.prototype,{currentIteration:{get:function(){return this.oo}},arrangementSpacing:{get:function(){return this.Cd},set:function(a){this.Cd.w(a)||(this.Cd.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.an},set:function(a){this.an!==a&&(this.an=a,this.C())}},setsPortSpots:{get:function(){return this.cf},set:function(a){this.cf!==a&&(this.cf= a,this.C())}},comments:{get:function(){return this.Zc},set:function(a){this.Zc!==a&&(this.Zc=a,this.C())}},maxIterations:{get:function(){return this.zl},set:function(a){this.zl!==a&&0<=a&&(this.zl=a,this.C())}},epsilonDistance:{get:function(){return this.Jn},set:function(a){this.Jn!==a&&0u&&0u&&0a[this.sd]&&(this.ks=a[c]-1,this.sd=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Zj===l.Zj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;vn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>v)&&h++,qn||u===n&&v>m)&&h++);f[g*e+g]=h;for(k=g+ 1;k=c)for(h=d[g].destinationEdgesArrayAccess,z=d[k].destinationEdgesArrayAccess,l=0;l=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}ls(a,b,d);return f}function ts(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();){var h=g.value;var k=h.toVertex;var l=b.layer-k.layer;h=a.linkMinLength(h);l===h&&ts(a,k,c,d,e,f)}if(f)for(g=b.sourceEdges;g.next();)h=g.value,k=h.fromVertex,l=k.layer-b.layer,h=a.linkMinLength(h),l===h&&ts(a,k,c,d,e,f)}} function us(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)us(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)us(a,b.value.fromVertex,c,d,e,f)}} bs.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Rk){default:case vs:a=this.network;var b=0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.iterator;e.next();)e.value.valid=!0;for(;null!==ws(a);){for(e=xs(a);null!==e;)d[c]=e,c--,e.valid=!1,e=xs(a);for(e=ys(a);null!==e;)d[b]=e,b++,e.valid=!1,e=ys(a);e=null;for(var f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.destinationEdges;l.next();)l.value.toVertex.valid&& k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||fb.toVertex.index&&(a.Fm(b),b.rev=!0);break;case cs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.hm=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Ro=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& zs(this,b);for(d.reset();d.next();)b=d.value,-1===b.hm&&zs(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.hmd){if(0>d)for(b.reset();b.next();)b.value.layer-=d;d=[];for(b.reset();b.next();)c=b.value,e=d[c.layer],void 0===e?d[c.layer]=[c]:e.push(c);for(c=b=0;cg&&ts(a,h,0,-1,!0,!1)}for(ts(a,b,1,-1,!0,!0);0!==b.component;){f=0;d=Infinity;h=0;k=null;for(g=a.network.vertexes.iterator;g.next();){var l=g.value;if(1===l.component){var m=0,n=!1,p=l.sourceEdgesArrayAccess; e=p.length;for(var r=0;rf)&&!m&&(h=g,f=l)}if(0>d){for(c.reset();c.next();)d=c.value,1===d.component&&(d.layer-=e);b.component=0}else h.component=0}}} function js(a,b,c){return 90===a.J?c&&!b.rev||!c&&b.rev?270:90:180===a.J?c&&!b.rev||!c&&b.rev?0:180:270===a.J?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} bs.prototype.initializeIndices=function(){switch(this.jl){default:case Gs:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.gc[c];this.gc[c]++}break;case es:a=this.network.vertexes.iterator;for(b=this.xa;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Hs(this,c);break;case Is:for(a=this.network.vertexes.iterator,b=0;b<=this.xa;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Js(this,c)}}; function Hs(a,b){var c=b.layer;b.index=a.gc[c];a.gc[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;df.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;cf.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c=g;d--)f=Ls(this,d,-1)||f;e=this.countCrossings();e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ls(this,d,1)||f;e=this.countCrossings();e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ls(this,d,1)||f;e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Ls(this,d,-1)||f;e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ls(this,d,0)||f;e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ls(this,d,0)||f;e>=a?os(this,b):(a=e,b=ns(this))}break;default:case fs:for(c=this.xa,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Ls(this,d,-1)||f;e=this.countCrossings();e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ls(this,d,1)||f;e=this.countCrossings();e>=a?os(this,b): (a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ls(this,d,1)||f;e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ls(this,d,-1)||f;e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ls(this,d,0)||f;e>=a?os(this,b):(a=e,b=ns(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ls(this,d,0)||f;e>=a?os(this,b):(a=e,b=ns(this))}}os(this,b)}; function Ks(a,b,c){var d=ks(a,b),e=a.gc[b],f=ss(a,b,c),g=rs(a,b,c);for(c=0;cf+1&&(p+=4*(y-f),r+=4*(y-(f+1)))}A=d[f].destinationEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;y===f+1&&(r+=1)}A=d[f+1].sourceEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.fromVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;yf+1&&(p+=4*(y-(f+1)),r+=4*(y-f))}A=d[f+1].destinationEdges.iterator; for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;y===f&&(p+=1)}y=z=0;A=g[d[f].index];var C=h[d[f].index],G=g[d[f+1].index],L=h[d[f+1].index];-1!==A&&(z+=Math.abs(A-q),y+=Math.abs(A-w));-1!==C&&(z+=Math.abs(C-q),y+=Math.abs(C-w));-1!==G&&(z+=Math.abs(G-u),y+=Math.abs(G-v));-1!==L&&(z+=Math.abs(L-u),y+=Math.abs(L-v));if(r>1)+8*d;this.Ea*=8}if(0!==(this.jg&2))for(c=!0;c;){c=!1;for(b=this.sd+1;b<=this.xa;b++)c=Os(this,b,1)||c;for(b= this.sd-1;0<=b;b--)c=Os(this,b,-1)||c;c=Os(this,this.sd,0)||c}if(0!==(this.jg&4)){for(b=this.sd+1;b<=this.xa;b++)Ps(this,b,1);for(b=this.sd-1;0<=b;b--)Ps(this,b,-1);Ps(this,this.sd,0)}a&&(Qs(this,-1),Qs(this,1));if(0!==(this.jg&2))for(c=!0;c;){c=!1;c=Os(this,this.sd,0)||c;for(b=this.sd+1;b<=this.xa;b++)c=Os(this,b,0)||c;for(b=this.sd-1;0<=b;b--)c=Os(this,b,0)||c}};function Os(a,b,c){for(var d=!1;Rs(a,b,c);)d=!0;return d} function Rs(a,b,c){var d,e=ks(a,b),f=a.gc[b],g=rs(a,b,-1);if(0c)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u=0;if(0>=c)for(var v=e[d].sourceEdges.iterator;v.next();){var w=v.value;var y=w.fromVertex; if(w.valid&&y.layer!==b){var z=ms(w);var A=w.portFromColOffset;w=w.portToColOffset;y=y.column;p+=(Math.abs(m+w-(y+A))+1)*z;q+=(Math.abs(r+w-(y+A))+1)*z;u+=(Math.abs(n+w-(y+A))+1)*z}}if(0<=c)for(v=e[d].destinationEdges.iterator;v.next();)w=v.value,y=w.toVertex,w.valid&&y.layer!==b&&(z=ms(w),A=w.portFromColOffset,w=w.portToColOffset,y=y.column,p+=(Math.abs(m+A-(y+w))+1)*z,q+=(Math.abs(r+A-(y+w))+1)*z,u+=(Math.abs(n+A-(y+w))+1)*z);w=A=z=0;v=g[e[d].index];y=h[e[d].index];-1!==v&&(z+=Math.abs(v-m),A+= Math.abs(v-r),w+=Math.abs(v-n));-1!==y&&(z+=Math.abs(y-m),A+=Math.abs(y-r),w+=Math.abs(y-n));if(q=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}ls(a,b,d);a.normalize()} function Ss(a,b){for(var c=!0,d=a.network.vertexes.iterator;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),g=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+g>=b){c=!1;break}}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} function Ts(a,b){var c=b+1;var d,e=[],f=[];for(d=0;d<=a.xa;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();){d=g.value;var h=d.column-a.nodeMinColumnSpace(d,!0),k=d.column+a.nodeMinColumnSpace(d,!1);h<=b&&k>=b&&(e[d.layer]=!0);h<=c&&k>=c&&(f[d.layer]=!0)}h=!0;c=!1;for(d=0;d<=a.xa;d++)h=h&&!(e[d]&&f[d]);if(h)for(g.reset();g.next();)a=g.value,a.column>b&&(--a.column,c=!0);return c} function Qs(a,b){for(var c=0;c<=a.Ea;c++)for(;Ss(a,c););a.normalize();for(c=0;cf?os(a,e):gb)for(c=a.Ea;0<=c;c--)for(e=ns(a),f=qs(a),d=f+1;ff?os(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Rd);a.Rd++;for(d.reset();d.next();)b=d.value,-1===b.component&&(us(a,b,a.Rd,-1,!0,!0),a.Rd++);var f;b=[];for(f=0;fc)for(g=a.Ea;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} bs.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=is(this,!0),b=is(this,!1),c=this.network.edges.iterator;c.next();){var d=c.value.link;null!==d&&(d.fromSpot=a,d.toSpot=b)}this.commitNodes();this.tv();this.isRouting&&this.commitLinks()};function is(a,b){return 270===a.J?b?ed:hd:90===a.J?b?hd:ed:180===a.J?b?fd:gd:b?gd:fd} bs.prototype.commitNodes=function(){this.Nd=[];this.rd=[];this.qd=[];this.Ha=[];for(var a=0;a<=this.xa;a++)this.Nd[a]=0,this.rd[a]=0,this.qd[a]=0,this.Ha[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.Nd[c]=Math.max(this.Nd[c],this.nodeMinLayerSpace(b,!0));this.rd[c]=Math.max(this.rd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.pe;for(var d=0;d<=this.xa;d++){var e=c;0>=this.Nd[d]+this.rd[d]&&(e=0);0=n.bounds.bottom? (n=n.bounds.y+n.bounds.height,b.m(q++,z,n+C),b.m(q++,z,n),b.m(q++,z,n-y)):(b.m(q++,z,A+C),b.m(q++,z,A),b.m(q++,z,A-y)):270===this.J?A<=n.bounds.y?(n=n.bounds.y,b.m(q++,z,n-y),b.m(q++,z,n),b.m(q++,z,n+C)):(b.m(q++,z,A-y),b.m(q++,z,A),b.m(q++,z,A+C)):0===this.J&&(z>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(q++,n+C,A),b.m(q++,n,A),b.m(q++,n-y,A)):(b.m(q++,z+C,A),b.m(q++,z,A),b.m(q++,z-y,A)));else{b.m(q++,v,w);var G=0;if(180===this.J||0===this.J){if(180===this.J?z>=n.bounds.right:z<=n.bounds.x)G= (0===this.J?-y:C)/2;b.m(q++,v+G,A)}else{if(270===this.J?A>=n.bounds.bottom:A<=n.bounds.y)G=(90===this.J?-y:C)/2;b.m(q++,z,w+G)}b.m(q++,z,A)}}else y=Math.max(10,this.Nd[u.layer]),C=Math.max(10,this.rd[u.layer]),180===this.J?(r&&b.m(q++,z-y,A),b.m(q++,z,A),r&&b.m(q++,z+C,A)):90===this.J?(r&&b.m(q++,z,A+C),b.m(q++,z,A),r&&b.m(q++,z,A-y)):270===this.J?(r&&b.m(q++,z,A-y),b.m(q++,z,A),r&&b.m(q++,z,A+C)):(r&&b.m(q++,z+C,A),b.m(q++,z,A),r&&b.m(q++,z-y,A))}n=u}if(null===h||l!==uc||p)if(v=b.i(q-1).x,w=b.i(q- 1).y,z=b.i(q).x,A=b.i(q).y,p)n=this.rd[m.layer],180===this.J||0===this.J?(p=w,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.J?z>=m.bounds.x:z<=m.bounds.right)&&(n=m.centerX+(180===this.J?-n:n),p=m.bounds.x&&p<=m.bounds.right&&(270===this.J?A>=m.bounds.y:A<=m.bounds.bottom)&&(n=m.centerY+(270===this.J?-n:n),p=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.K(q-2,n,w),b.K(q-1,n+C,w)):90===this.J&&A<=m.bounds.bottom?(n=m.bounds.y,b.K(q-2,v,n),b.K(q-1,v,n-y)):270===this.J&&A>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.K(q-2,v,n),b.K(q-1,v,n+C)):0===this.J&&z<=m.bounds.right&&(n=m.bounds.x,b.K(q-2,n,w),b.K(q-1,n-y,w));else{y=Math.max(10,this.Nd[m.layer]);C=Math.max(10, this.rd[m.layer]);p=0;if(180===this.J||0===this.J){if(180===this.J?z<=m.bounds.x:z>=m.bounds.right)p=(0===this.J?C:-y)/2;b.m(q++,z+p,w)}else{if(270===this.J?A<=m.bounds.y:A>=m.bounds.bottom)p=(90===this.J?C:-y)/2;b.m(q++,v,A+p)}b.m(q++,z,A)}}else{for(;null!==m&&m!==n;){y=u=null;for(m=m.destinationEdges.iterator;m.next()&&(v=m.value,v.link!==c.link||(u=v.toVertex,y=v.fromVertex,null!==y.node&&(y=null),null!==u.node)););u!==n&&(v=b.i(q-1).x,w=b.i(q-1).y,z=u.centerX,A=u.centerY,p?180===this.J||0===this.J? (null!==y?y.centerY:w)!==A&&(y=this.Ha[u.layer]+this.Gf.x,q===b.firstPickIndex+1&&(y=0===this.J?Math.max(y,v):Math.min(y,v)),b.m(q++,y,w),b.m(q++,y,A)):(null!==y?y.centerX:v)!==z&&(y=this.Ha[u.layer]+this.Gf.y,q===b.firstPickIndex+1&&(y=90===this.J?Math.max(y,w):Math.min(y,w)),b.m(q++,v,y),b.m(q++,z,y)):(y=Math.max(10,this.Nd[u.layer]),C=Math.max(10,this.rd[u.layer]),180===this.J?(b.m(q++,z+C,A),r&&b.m(q++,z,A),b.m(q++,z-y,A)):90===this.J?(b.m(q++,z,A-y),r&&b.m(q++,z,A),b.m(q++,z,A+C)):270===this.J? (b.m(q++,z,A+C),r&&b.m(q++,z,A),b.m(q++,z,A-y)):(b.m(q++,z-y,A),r&&b.m(q++,z,A),b.m(q++,z+C,A))));m=u}p&&(v=b.i(q-1).x,w=b.i(q-1).y,z=b.i(q).x,A=b.i(q).y,180===this.J||0===this.J?w!==A&&(y=0===this.J?Math.min(Math.max((z+v)/2,this.Ha[n.layer]+this.Gf.x),z):Math.max(Math.min((z+v)/2,this.Ha[n.layer]+this.Gf.x),z),b.m(q++,y,w),b.m(q++,y,A)):v!==z&&(y=90===this.J?Math.min(Math.max((A+w)/2,this.Ha[n.layer]+this.Gf.y),A):Math.max(Math.min((A+w)/2,this.Ha[n.layer]+this.Gf.y),A),b.m(q++,v,y),b.m(q++,z,y)))}null!== d&&r&&(null!==g&&(l===uc&&(l=b.i(0),d=b.i(2),l.w(d)||b.K(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,uc,!0,!1,f,h),l.v()||l.set(e.actualBounds.center),b.K(0,l.x,l.y)),null!==h&&(k===uc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.w(l)||b.K(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,uc,!1,!1,e,g),e.v()||e.set(f.actualBounds.center),b.K(b.pointsCount-1,e.x,e.y)));b.rf();c.commit()}}}this.avoidOrthogonalOverlaps()}; bs.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new E,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0f.y&&(m=l.y>f.y?0:g.xf.x&&(m=l.x>f.x?0:g.yb.layer?1:a.Ucb.Uc?1:a.tcb.tc?1:0:0};t.wy=function(a,b){return a instanceof Vs&&b instanceof Vs&&a!==b?a.firstb.first||a.lb.l||a.Ucb.Uc?1:a.tcb.tc?1:0:0}; t.Vt=function(a,b){return a instanceof Vs&&b instanceof Vs&&a!==b?a.Xbb.Xb||a.lb.l||a.Ucb.Uc?1:a.tcb.tc?1:0:0};t.A=function(a,b){a-=b;return-1a}; t.hj=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&B("not in range 0 <= from < length: "+c),2===f)d=a[c],e=a[c+1],0=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b=e)for(d=a.slice(c),d.sort(b),b=c;b=a.se.length){var d=[];for(var e=0;ea&&(this.jg=a,this.C())}},setsPortSpots:{get:function(){return this.cf},set:function(a){this.cf!==a&&(this.cf=a,this.C())}}, linkSpacing:{get:function(){return this.wo},set:function(a){this.wo!==a&&0<=a&&(this.wo=a,this.C())}},maxLayer:{get:function(){return this.xa}},maxIndex:{get:function(){return this.ks}},maxColumn:{get:function(){return this.Ea}},minIndexLayer:{get:function(){return this.Ho}},maxIndexLayer:{get:function(){return this.sd}}}); var cs=new D(bs,"CycleDepthFirst",0),vs=new D(bs,"CycleGreedy",1),hs=new D(bs,"CycleFromLayers",2),ds=new D(bs,"LayerOptimalLinkLength",0),As=new D(bs,"LayerLongestPathSink",1),Cs=new D(bs,"LayerLongestPathSource",2),es=new D(bs,"InitDepthFirstOut",0),Is=new D(bs,"InitDepthFirstIn",1),Gs=new D(bs,"InitNaive",2),Ms=new D(bs,"AggressiveNone",0),fs=new D(bs,"AggressiveLess",1),Ns=new D(bs,"AggressiveMore",2);bs.className="LayeredDigraphLayout";bs.CycleDepthFirst=cs;bs.CycleGreedy=vs; bs.CycleFromLayers=hs;bs.LayerOptimalLinkLength=ds;bs.LayerLongestPathSink=As;bs.LayerLongestPathSource=Cs;bs.InitDepthFirstOut=es;bs.InitDepthFirstIn=Is;bs.InitNaive=Gs;bs.AggressiveNone=Ms;bs.AggressiveLess=fs;bs.AggressiveMore=Ns;bs.PackNone=0;bs.PackExpand=1;bs.PackStraighten=2;bs.PackMedian=4;bs.PackAll=7;function Vs(){this.index=this.tc=this.Uc=this.Xb=this.first=this.layer=0;this.link=null;this.l=0}Vs.className="SegInfo";function gs(a){Pp.call(this,a)}la(gs,Pp);gs.prototype.createVertex=function(){return new Ws(this)}; gs.prototype.createEdge=function(){return new Xs(this)};gs.className="LayeredDigraphNetwork";function Ws(a){Sp.call(this,a);this.Oa=this.Lg=this.wi=-1;this.I=NaN;this.T=null;this.valid=!1;this.finish=this.hm=NaN;this.Zj=0;this.Xv=this.Yv=null}la(Ws,Sp); ma.Object.defineProperties(Ws.prototype,{layer:{get:function(){return this.wi},set:function(a){this.wi!==a&&(this.wi=a)}},column:{get:function(){return this.Lg},set:function(a){this.Lg!==a&&(this.Lg=a)}},index:{get:function(){return this.Oa},set:function(a){this.Oa!==a&&(this.Oa=a)}},component:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a)}},near:{ get:function(){return this.T},set:function(a){this.T!==a&&(this.T=a)}}});Ws.className="LayeredDigraphVertex";function Xs(a){Tp.call(this,a);this.l=this.Ja=this.bb=!1;this.Ia=this.I=NaN;this.T=this.u=0}la(Xs,Tp); ma.Object.defineProperties(Xs.prototype,{valid:{get:function(){return this.bb},set:function(a){this.bb!==a&&(this.bb=a)}},rev:{get:function(){return this.Ja},set:function(a){this.Ja!==a&&(this.Ja=a)}},forest:{get:function(){return this.l},set:function(a){this.l!==a&&(this.l=a)}},portFromPos:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a)}},portToPos:{ get:function(){return this.Ia},set:function(a){this.Ia!==a&&(this.Ia=a)}},portFromColOffset:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToColOffset:{get:function(){return this.T},set:function(a){this.T!==a&&(this.T=a)}}});Xs.className="LayeredDigraphEdge"; function Ys(){Fi.call(this);this.Jb=new F;this.gp=Zs;this.$c=$s;this.bq=at;this.js=bt;this.Vw=[];this.Zc=!0;this.Cb=ct;this.Cd=(new M(10,10)).freeze();var a=new dt(this);this.U=new et(a);this.V=new et(a);this.gv=[]}la(Ys,Fi);Ys.prototype.cloneProtected=function(a){Fi.prototype.cloneProtected.call(this,a);a.gp=this.gp;a.bq=this.bq;a.js=this.js;a.Zc=this.Zc;a.Cb=this.Cb;a.Cd.assign(this.Cd);a.U.copyInheritedPropertiesFrom(this.U);a.V.copyInheritedPropertiesFrom(this.V)}; Ys.prototype.gb=function(a){a.classType===Ys?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.arrangement=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.treeStyle=a:B("Unknown enum value: "+a):Fi.prototype.gb.call(this,a)};Ys.prototype.createNetwork=function(){return new dt(this)}; Ys.prototype.makeNetwork=function(a){function b(a){if(a instanceof V)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof S){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof Q?(c.ug(a.nodes,!0,b),c.ug(a.links,!0,b)):a instanceof uf?c.ug(a.memberParts,!1,b):c.ug(a.iterator,!1,b);return c}; Ys.prototype.doLayout=function(a){null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==ft&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof Q&&(b=a);this.path===Zs&&null!==b?this.$c=b.isTreePathToChildren?$s:gt:this.$c=this.path===Zs?$s:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0}Ys.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ee?St(a,g,O,w,y):Tt(a,g,O,w,y);O=y.x;w=y.width;y=y.height;break;case Bt:for(A=0;An&&(JEa&&(Yt(a,-Ea,0,pa,xa-1),Zt(A,-Ea,0),Zt(C,-Ea,0),Ea=0)}Ma.S.h(Ea,U);w=Math.max(w,G);y=Math.max(y,z+(0===R?0:q)+hb.height);J=G}else{0n&&(UEa&&(Yt(a,0,-Ea,pa,xa-1),Zt(A,0,-Ea),Zt(C,0,-Ea),Ea=0);Ma.S.h(J,Ea);y=Math.max(y,L);w=Math.max(w,z+(0===R?0:q)+hb.width);U=L}ca++}0l&&(l=0),135u&&(u=0), k===Ct&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>w&&(w=du(k,d-w,0),g=w.x,h=w.y,w=d,l=0):w=bu(a,w,l),0>l&&(g-=l,l=0),135y&&(y=du(k,0,v-y),g=y.x,h=y.y,y=v,u=0):y=cu(a,y,u),0>u&&(h-=u,u=0),g+=d+c);if(0e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].ye[0].x?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(l+d,0),R[1].h(R[0].x,v),R[2].ye[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].xe[0].y?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(0,u+v),R[1].h(d,R[0].y),R[2].xd?St(b,e,ca, z,A):Tt(b,e,ca,z,A);ca=A.x;z=A.width;A=A.height;break;case Bt:for(a=0;ap&&(Gp&&(Ln&&(n=0),135w&&(w=0));b.da.h(n,w);b.ta.h(z,A)}} function St(a,b,c,d,e){var f=b.length;if(0===f)return new N(c,0,d,e);if(1===f)return a=b[0],d=a.ta.width,e=a.ta.height,new N(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===It(a),l=0,m=0,n=0,p=0;pk&&(d-=k),e=Math.max(e,Math.max(p,n)+h+f.height),0>b.S.x&& (c=gu(a,b.S.x,!1,c,g))):(b.S.h(d+h,c+g/2-b.focus.y-b.da.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.da.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.S.y&&(c=gu(a,b.S.y,!0,c,g))));return new N(c,0,d,e)} function Tt(a,b,c,d,e){var f=b.length;if(0===f)return new N(c,0,d,e);if(1===f)return b=b[0],d=b.ta.width,e=b.ta.height,new N(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===It(a),l=0,m=0,n=0,p=0;pm&&(d-=m),e=Math.max(e,Math.abs(Math.min(p,n))+q+l.height), 0>h.S.x&&(c=gu(a,h.S.x,!1,c,g))):(h.S.h(-d-l.width-q,c+g/2-h.focus.y-h.da.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.da.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.S.y&&(c=gu(a,h.S.y,!0,c,g))));for(a=0;ab&&(b=c+a.width),0>c&&(b-=c),b;case Rt:return a.width>b?a.width:b;case Jt:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case At:case qt:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case Bt:return a.width-a.focus.x+a.nodeSpacing/2+b;case Ct:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function cu(a,b,c){switch(a.alignment){case au:case $t:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Rt:return a.height>b?a.height:b;case Jt:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case At:case qt:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case Bt:return a.height-a.focus.y+a.nodeSpacing/2+b;case Ct:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function du(a,b,c){switch(a){case $t:b/=2;c/=2;break;case au:b/=2;c/=2;break;case Rt:c=b=0;break;case Jt:break;default:B("Unhandled alignment value "+a.toString())}return new I(b,c)}function Vt(a,b,c,d,e,f){b=du(b,c,d);Yt(a,b.x,b.y,e,f)}function Yt(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].S;f.x+=b;f.y+=c}} function Wt(a,b,c,d){var e=b.parent;switch(a.$c){case $s:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case gt:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:B("Unhandled path value "+a.$c.toString())}}function Zt(a,b,c){for(var d=0;dn.length||null===r||2>r.length))for(e=c=0;cl&&f.yf.y&&lb.length||null===c||2>c.length)d=null;else{m=Ut(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Ut(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Ut(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Ut(a,e);for(c=0;cn.length||null===r||2>r.length))for(e=c=0;ck&&f.xf.x&&kb.length||null===c||2>c.length)d=null;else{m=Ut(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Ut(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Ut(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Ut(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Kt(a){var b=It(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.U.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.U.nodeSpacing},set:function(a){this.U.nodeSpacing!==a&&(this.U.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.U.layerSpacing},set:function(a){this.U.layerSpacing!== a&&(this.U.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.U.layerSpacingParentOverlap},set:function(a){this.U.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.U.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.U.compaction},set:function(a){this.U.compaction===a||a!==Ft&&a!==Ht||(this.U.compaction=a,this.C())}},breadthLimit:{get:function(){return this.U.breadthLimit}, set:function(a){this.U.breadthLimit!==a&&0<=a&&(this.U.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.U.rowSpacing},set:function(a){this.U.rowSpacing!==a&&(this.U.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.U.rowIndent},set:function(a){this.U.rowIndent!==a&&0<=a&&(this.U.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.U.commentSpacing},set:function(a){this.U.commentSpacing!== a&&(this.U.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.U.commentMargin},set:function(a){this.U.commentMargin!==a&&(this.U.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.U.setsPortSpot},set:function(a){this.U.setsPortSpot!==a&&(this.U.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.U.portSpot},set:function(a){this.U.portSpot.w(a)||(this.U.portSpot= a,this.C())}},setsChildPortSpot:{get:function(){return this.U.setsChildPortSpot},set:function(a){this.U.setsChildPortSpot!==a&&(this.U.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.U.childPortSpot},set:function(a){this.U.childPortSpot.w(a)||(this.U.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.V.sorting},set:function(a){this.V.sorting===a||a!==vt&&a!==wt&& a!==xt&&!yt||(this.V.sorting=a,this.C())}},alternateComparer:{get:function(){return this.V.comparer},set:function(a){this.V.comparer!==a&&(this.V.comparer=a,this.C())}},alternateAngle:{get:function(){return this.V.angle},set:function(a){this.V.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.V.angle=a,this.C())}},alternateAlignment:{get:function(){return this.V.alignment},set:function(a){this.V.alignment!== a&&(this.V.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.V.nodeIndent},set:function(a){this.V.nodeIndent!==a&&0<=a&&(this.V.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.V.nodeIndentPastParent},set:function(a){this.V.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.V.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.V.nodeSpacing}, set:function(a){this.V.nodeSpacing!==a&&(this.V.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.V.layerSpacing},set:function(a){this.V.layerSpacing!==a&&(this.V.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.V.layerSpacingParentOverlap},set:function(a){this.V.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.V.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{ get:function(){return this.V.compaction},set:function(a){this.V.compaction===a||a!==Ft&&a!==Ht||(this.V.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.V.breadthLimit},set:function(a){this.V.breadthLimit!==a&&0<=a&&(this.V.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.V.rowSpacing},set:function(a){this.V.rowSpacing!==a&&(this.V.rowSpacing=a,this.C())}},alternateRowIndent:{ get:function(){return this.V.rowIndent},set:function(a){this.V.rowIndent!==a&&0<=a&&(this.V.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.V.commentSpacing},set:function(a){this.V.commentSpacing!==a&&(this.V.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.V.commentMargin},set:function(a){this.V.commentMargin!==a&&(this.V.commentMargin=a,this.C())}},alternateSetsPortSpot:{ get:function(){return this.V.setsPortSpot},set:function(a){this.V.setsPortSpot!==a&&(this.V.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.V.portSpot},set:function(a){this.V.portSpot.w(a)||(this.V.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.V.setsChildPortSpot},set:function(a){this.V.setsChildPortSpot!==a&&(this.V.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{ get:function(){return this.V.childPortSpot},set:function(a){this.V.childPortSpot.w(a)||(this.V.childPortSpot=a,this.C())}}}); var Zs=new D(Ys,"PathDefault",-1),$s=new D(Ys,"PathDestination",0),gt=new D(Ys,"PathSource",1),vt=new D(Ys,"SortingForwards",10),wt=new D(Ys,"SortingReverse",11),xt=new D(Ys,"SortingAscending",12),yt=new D(Ys,"SortingDescending",13),$t=new D(Ys,"AlignmentCenterSubtrees",20),au=new D(Ys,"AlignmentCenterChildren",21),Rt=new D(Ys,"AlignmentStart",22),Jt=new D(Ys,"AlignmentEnd",23),At=new D(Ys,"AlignmentBus",24),qt=new D(Ys,"AlignmentBusBranching",25),Bt=new D(Ys,"AlignmentTopLeftBus",26),Ct=new D(Ys, "AlignmentBottomRightBus",27),Ft=new D(Ys,"CompactionNone",30),Ht=new D(Ys,"CompactionBlock",31),at=new D(Ys,"StyleLayered",40),ut=new D(Ys,"StyleLastParents",41),tt=new D(Ys,"StyleAlternating",42),st=new D(Ys,"StyleRootOnly",43),ct=new D(Ys,"ArrangementVertical",50),iu=new D(Ys,"ArrangementHorizontal",51),ft=new D(Ys,"ArrangementFixedRoots",52),bt=new D(Ys,"LayerIndividual",60),ot=new D(Ys,"LayerSiblings",61),nt=new D(Ys,"LayerUniform",62);Ys.className="TreeLayout";Ys.PathDefault=Zs; Ys.PathDestination=$s;Ys.PathSource=gt;Ys.SortingForwards=vt;Ys.SortingReverse=wt;Ys.SortingAscending=xt;Ys.SortingDescending=yt;Ys.AlignmentCenterSubtrees=$t;Ys.AlignmentCenterChildren=au;Ys.AlignmentStart=Rt;Ys.AlignmentEnd=Jt;Ys.AlignmentBus=At;Ys.AlignmentBusBranching=qt;Ys.AlignmentTopLeftBus=Bt;Ys.AlignmentBottomRightBus=Ct;Ys.CompactionNone=Ft;Ys.CompactionBlock=Ht;Ys.StyleLayered=at;Ys.StyleLastParents=ut;Ys.StyleAlternating=tt;Ys.StyleRootOnly=st;Ys.ArrangementVertical=ct; Ys.ArrangementHorizontal=iu;Ys.ArrangementFixedRoots=ft;Ys.LayerIndividual=bt;Ys.LayerSiblings=ot;Ys.LayerUniform=nt;function dt(a){Pp.call(this,a)}la(dt,Pp);dt.prototype.createVertex=function(){return new et(this)};dt.prototype.createEdge=function(){return new ku(this)};dt.className="TreeNetwork"; function et(a){Sp.call(this,a);this.Ia=!1;this.Kc=null;this.I=[];this.kd=this.bb=this.T=this.Ja=0;this.Zc=null;this.S=new I(0,0);this.ta=new M(0,0);this.da=new I(0,0);this.Hm=this.Gm=this.xA=!1;this.Qq=this.Dq=null;this.Rc=vt;this.Mc=Zp;this.Yb=0;this.xb=au;this.us=this.ts=0;this.vs=20;this.pe=50;this.hs=0;this.tr=Ht;this.kr=0;this.Is=25;this.sr=this.Hs=10;this.rr=20;this.Vs=!0;this.Es=$c;this.Us=!0;this.nr=$c}la(et,Sp); et.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.Rc=a.sorting,this.Mc=a.comparer,this.Yb=a.angle,this.xb=a.alignment,this.ts=a.nodeIndent,this.us=a.nodeIndentPastParent,this.vs=a.nodeSpacing,this.pe=a.layerSpacing,this.hs=a.layerSpacingParentOverlap,this.tr=a.compaction,this.kr=a.breadthLimit,this.Is=a.rowSpacing,this.Hs=a.rowIndent,this.sr=a.commentSpacing,this.rr=a.commentMargin,this.Vs=a.setsPortSpot,this.Es=a.portSpot,this.Us=a.setsChildPortSpot,this.nr=a.childPortSpot)}; ma.Object.defineProperties(et.prototype,{initialized:{get:function(){return this.Ia},set:function(a){this.Ia!==a&&(this.Ia=a)}},parent:{get:function(){return this.Kc},set:function(a){this.Kc!==a&&(this.Kc=a)}},children:{get:function(){return this.I},set:function(a){if(this.I!==a){if(null!==a)for(var b=a.length,c=0;cp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Qt(c))))):c.alignment===Rt?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Qt(c))))):c.alignment===Rt?(e=d.left+b.x,0===b.x&&m.xp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Qt(c))))):c.alignment===Rt?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Qt(c))))):c.alignment===Rt?(e=d.left+b.x,0===b.x&&m.x