/* * GoJS v2.0.17 JavaScript Library for HTML Diagrams * Northwoods Software, https://www.nwoods.com/ * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation. * Copyright (C) 1998-2019 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.0.17/license.html. */ (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):v("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Ka(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):v("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function La(){var a=Ma.pop();return void 0===a?[]:a}function Na(a){a.length=0;Ma.push(a)} function wa(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""}function Oa(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(Fa(a)&&a.constructor)return Oa(a.constructor);return typeof a} function Pa(a){var b=a;Fa(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 Qa(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.nA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ra(a,b,c){Object.defineProperty(Sa.prototype,a,{get:b,set:c})}function Ta(){var a=Ua;if(0===a.length)for(var b=pa.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;Aa(a)}a=a.j;var b=a.length,c=++this.Ua,d=this.$e;if(null!==d)for(;cthis.key)return!1;Aa(a)}var b=--this.Ua;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.zd();return!1};rb.prototype.fd=function(){return this.next()}; rb.prototype.first=function(){var a=this.qb;this.na=a.s;var b=a.j;this.Ua=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};rb.prototype.any=function(a){var b=this.qb;b.Vg=null;var c=b.s,d=b.j,e=d.length;this.Ua=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.s!==c&&Aa(b)}return!1};rb.prototype.all=function(a){var b=this.qb;b.Vg=null;var c=b.s,d=b.j,e=d.length;this.Ua=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.s!==c&&Aa(b)}return!0}; rb.prototype.each=function(a){var b=this.qb;b.Vg=null;var c=b.s,d=b.j,e=d.length;this.Ua=e;for(--e;0<=e;e--)a(d[e]),b.s!==c&&Aa(b);return this};rb.prototype.map=function(a){var b=this.qb;b.Vg=null;var c=b.s,d=[],e=b.j,f=e.length;this.Ua=f;for(--f;0<=f;f--)d.push(a(e[f])),b.s!==c&&Aa(b);a=new H;a.j=d;a.lb();return a.iterator}; rb.prototype.filter=function(a){var b=this.qb;b.Vg=null;var c=b.s,d=[],e=b.j,f=e.length;this.Ua=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.s!==c&&Aa(b)}a=new H;a.j=d;a.lb();return a.iterator};rb.prototype.zd=function(){this.key=-1;this.value=null;this.na=-1;this.qb.Vg=this};rb.prototype.toString=function(){return"ListIteratorBackwards("+this.Ua+"/"+this.qb.count+")"}; ma.Object.defineProperties(rb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.qb.j.length}}});rb.prototype.first=rb.prototype.first;rb.prototype.hasNext=rb.prototype.fd;rb.prototype.next=rb.prototype.next;rb.prototype.reset=rb.prototype.reset;rb.className="ListIteratorBackwards"; function H(a){fb(this);this.u=!1;this.j=[];this.s=0;this.Vg=this.Ka=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ea():this.addAll(a))}t=H.prototype;t.lb=function(){var a=this.s;a++;999999999a||a>=b.length)&&ya(a,"0 <= i < length",H,"elt:i");return b[a]};t.get=function(a){return this.O(a)};t.jd=function(a,b){F&&C(a,H,"setElt:i");var c=this.j;(0>a||a>=c.length)&&ya(a,"0 <= i < length",H,"setElt:i");this.u&&va(this,a);c[a]=b};t.set=function(a,b){this.jd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Ub=function(){var a=this.j,b=a.length;return 0a&&ya(a,">= 0",H,"insertAt:i");this.u&&va(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.u&&va(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.nb=function(a){F&&C(a,H,"removeAt:i");var b=this.j;(0>a||a>=b.length)&&ya(a,"0 <= i < length",H,"removeAt:i");this.u&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.lb()}; t.removeRange=function(a,b){F&&(C(a,H,"removeRange:from"),C(b,H,"removeRange:to"));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.u&&va(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&ya(b,"0 <= from < length",H,"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 mb;var a=this.Ka;return null!==a?(a.reset(),a):new qb(this)}},iteratorBackwards:{configurable:!0, enumerable:!0,get:function(){if(0>=this.j.length)return mb;var a=this.Vg;return null!==a?(a.reset(),a):new rb(this)}}});H.prototype.reverse=H.prototype.reverse;H.prototype.sortRange=H.prototype.$i;H.prototype.sort=H.prototype.sort;H.prototype.toSet=H.prototype.Zv;H.prototype.toArray=H.prototype.Oa;H.prototype.removeRange=H.prototype.removeRange;H.prototype.removeAt=H.prototype.nb;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.insertAt=H.prototype.Lb; H.prototype.pop=H.prototype.pop;H.prototype.last=H.prototype.Ub;H.prototype.first=H.prototype.first;H.prototype.set=H.prototype.set;H.prototype.setElt=H.prototype.jd;H.prototype.get=H.prototype.get;H.prototype.elt=H.prototype.O;H.prototype.indexOf=H.prototype.indexOf;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.clear=H.prototype.clear;H.prototype.addAll=H.prototype.addAll;H.prototype.push=H.prototype.push;H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ja; H.prototype.freeze=H.prototype.freeze;H.className="List";function tb(a){this.kg=a;a.Ka=null;this.na=a.s;this.pa=null}tb.prototype.reset=function(){var a=this.kg;a.Ka=null;this.na=a.s;this.pa=null};tb.prototype.next=function(){var a=this.kg;if(a.s!==this.na){if(null===this.key)return!1;Aa(a)}var b=this.pa;b=null===b?a.ga:b.qa;if(null!==b)return this.pa=b,this.value=b.value,this.key=b.key,!0;this.zd();return!1};tb.prototype.fd=function(){return this.next()}; tb.prototype.first=function(){var a=this.kg;this.na=a.s;a=a.ga;if(null!==a){this.pa=a;var b=a.value;this.key=a.key;return this.value=b}return null};tb.prototype.any=function(a){var b=this.kg;b.Ka=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(a(d.value))return!0;b.s!==c&&Aa(b);d=d.qa}return!1};tb.prototype.all=function(a){var b=this.kg;b.Ka=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(!a(d.value))return!1;b.s!==c&&Aa(b);d=d.qa}return!0}; tb.prototype.each=function(a){var b=this.kg;b.Ka=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;)a(d.value),b.s!==c&&Aa(b),d=d.qa;return this};tb.prototype.map=function(a){var b=this.kg;b.Ka=null;for(var c=new H,d=b.s,e=b.ga;null!==e;)c.add(a(e.value)),b.s!==d&&Aa(b),e=e.qa;return c.iterator};tb.prototype.filter=function(a){var b=this.kg;b.Ka=null;for(var c=new H,d=b.s,e=b.ga;null!==e;){var f=e.value;a(f)&&c.add(f);b.s!==d&&Aa(b);e=e.qa}return c.iterator}; tb.prototype.zd=function(){this.value=this.key=null;this.na=-1;this.kg.Ka=this};tb.prototype.toString=function(){return null!==this.pa?"SetIterator@"+this.pa.value:"SetIterator"};ma.Object.defineProperties(tb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.kg.Fb}}});tb.prototype.first=tb.prototype.first;tb.prototype.hasNext=tb.prototype.fd;tb.prototype.next=tb.prototype.next;tb.prototype.reset=tb.prototype.reset; tb.className="SetIterator";function I(a){fb(this);this.u=!1;this.Gb={};this.Fb=0;this.Ka=null;this.s=0;this.We=this.ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ea():this.addAll(a))}t=I.prototype;t.lb=function(){var a=this.s;a++;999999999=this.Fb)return mb;var a=this.Ka;return null!==a?(a.reset(),a):new tb(this)}}});I.prototype.toList=I.prototype.Yv;I.prototype.toArray=I.prototype.Oa;I.prototype.clear=I.prototype.clear;I.prototype.retainAll=I.prototype.aA;I.prototype.removeAll=I.prototype.wq; I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.first=I.prototype.first;I.prototype.containsAny=I.prototype.Cy;I.prototype.containsAll=I.prototype.By;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.addAll=I.prototype.addAll;I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.ja;I.prototype.freeze=I.prototype.freeze;var xb=1;I.className="Set";I.uniqueHash=fb;I.hashIdUnique=vb;I.hashId=sb; function yb(a){this.la=a;this.na=a.s;this.pa=null}yb.prototype.reset=function(){this.na=this.la.s;this.pa=null};yb.prototype.next=function(){var a=this.la;if(a.s!==this.na){if(null===this.key)return!1;Aa(a)}var b=this.pa;b=null===b?a.ga:b.qa;if(null!==b)return this.pa=b,this.value=this.key=a=b.key,!0;this.zd();return!1};yb.prototype.fd=function(){return this.next()};yb.prototype.first=function(){var a=this.la;this.na=a.s;a=a.ga;return null!==a?(this.pa=a,this.value=this.key=a=a.key):null}; yb.prototype.any=function(a){var b=this.la,c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(a(d.key))return!0;b.s!==c&&Aa(b);d=d.qa}return!1};yb.prototype.all=function(a){var b=this.la,c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(!a(d.key))return!1;b.s!==c&&Aa(b);d=d.qa}return!0};yb.prototype.each=function(a){var b=this.la,c=b.s;this.pa=null;for(var d=b.ga;null!==d;)a(d.key),b.s!==c&&Aa(b),d=d.qa;return this}; yb.prototype.map=function(a){var b=this.la,c=b.s;this.pa=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e.key)),b.s!==c&&Aa(b),e=e.qa;return d.iterator};yb.prototype.filter=function(a){var b=this.la,c=b.s;this.pa=null;for(var d=new H,e=b.ga;null!==e;){var f=e.key;a(f)&&d.add(f);b.s!==c&&Aa(b);e=e.qa}return d.iterator};yb.prototype.zd=function(){this.value=this.key=null;this.na=-1};yb.prototype.toString=function(){return null!==this.pa?"MapKeySetIterator@"+this.pa.value:"MapKeySetIterator"}; ma.Object.defineProperties(yb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.la.Fb}}});yb.prototype.first=yb.prototype.first;yb.prototype.hasNext=yb.prototype.fd;yb.prototype.next=yb.prototype.next;yb.prototype.reset=yb.prototype.reset;yb.className="MapKeySetIterator";function zb(a){I.call(this);fb(this);this.u=!0;this.la=a}la(zb,I);t=zb.prototype;t.freeze=function(){return this};t.ja=function(){return this}; t.toString=function(){return"MapKeySet("+this.la.toString()+")"};t.add=function(){v("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.la.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){v("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){v("This Set is read-only: "+this.toString())};t.first=function(){var a=this.la.ga;return null!==a?a.key:null}; zb.prototype.any=function(a){for(var b=this.la.ga;null!==b;){if(a(b.key))return!0;b=b.qa}return!1};zb.prototype.all=function(a){for(var b=this.la.ga;null!==b;){if(!a(b.key))return!1;b=b.qa}return!0};zb.prototype.each=function(a){for(var b=this.la.ga;null!==b;)a(b.key),b=b.qa;return this};zb.prototype.map=function(a){for(var b=new I,c=this.la.ga;null!==c;)b.add(a(c.key)),c=c.qa;return b};zb.prototype.filter=function(a){for(var b=new I,c=this.la.ga;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.qa}return b}; zb.prototype.copy=function(){return new zb(this.la)};zb.prototype.Zv=function(){var a=new I,b=this.la.Gb,c;for(c in b)a.add(b[c].key);return a};zb.prototype.Oa=function(){var a=this.la.Gb,b=Array(this.la.Fb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};zb.prototype.Yv=function(){var a=new H,b=this.la.Gb,c;for(c in b)a.add(b[c].key);return a}; ma.Object.defineProperties(zb.prototype,{count:{configurable:!0,get:function(){return this.la.Fb}},size:{configurable:!0,get:function(){return this.la.Fb}},iterator:{configurable:!0,get:function(){return 0>=this.la.Fb?mb:new yb(this.la)}}});zb.prototype.toList=zb.prototype.Yv;zb.prototype.toArray=zb.prototype.Oa;zb.prototype.toSet=zb.prototype.Zv;zb.prototype.first=zb.prototype.first;zb.prototype.clear=zb.prototype.clear;zb.prototype["delete"]=zb.prototype.delete; zb.prototype.remove=zb.prototype.remove;zb.prototype.has=zb.prototype.has;zb.prototype.contains=zb.prototype.contains;zb.prototype.add=zb.prototype.add;zb.prototype.thaw=zb.prototype.ja;zb.prototype.freeze=zb.prototype.freeze;zb.className="MapKeySet";function Ab(a){this.la=a;a.Ve=null;this.na=a.s;this.pa=null}Ab.prototype.reset=function(){var a=this.la;a.Ve=null;this.na=a.s;this.pa=null}; Ab.prototype.next=function(){var a=this.la;if(a.s!==this.na){if(null===this.key)return!1;Aa(a)}var b=this.pa;b=null===b?a.ga:b.qa;if(null!==b)return this.pa=b,this.value=b.value,this.key=b.key,!0;this.zd();return!1};Ab.prototype.fd=function(){return this.next()};Ab.prototype.first=function(){var a=this.la;this.na=a.s;a=a.ga;if(null!==a){this.pa=a;var b=a.value;this.key=a.key;return this.value=b}return null}; Ab.prototype.any=function(a){var b=this.la;b.Ve=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(a(d.value))return!0;b.s!==c&&Aa(b);d=d.qa}return!1};Ab.prototype.all=function(a){var b=this.la;b.Ve=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(!a(d.value))return!1;b.s!==c&&Aa(b);d=d.qa}return!0};Ab.prototype.each=function(a){var b=this.la;b.Ve=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;)a(d.value),b.s!==c&&Aa(b),d=d.qa;return this}; Ab.prototype.map=function(a){var b=this.la;b.Ve=null;var c=b.s;this.pa=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e.value)),b.s!==c&&Aa(b),e=e.qa;return d.iterator};Ab.prototype.filter=function(a){var b=this.la;b.Ve=null;var c=b.s;this.pa=null;for(var d=new H,e=b.ga;null!==e;){var f=e.value;a(f)&&d.add(f);b.s!==c&&Aa(b);e=e.qa}return d.iterator};Ab.prototype.zd=function(){this.value=this.key=null;this.na=-1;this.la.Ve=this}; Ab.prototype.toString=function(){return null!==this.pa?"MapValueSetIterator@"+this.pa.value:"MapValueSetIterator"};ma.Object.defineProperties(Ab.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.la.Fb}}});Ab.prototype.first=Ab.prototype.first;Ab.prototype.hasNext=Ab.prototype.fd;Ab.prototype.next=Ab.prototype.next;Ab.prototype.reset=Ab.prototype.reset;Ab.className="MapValueSetIterator"; function wb(a,b){this.key=a;this.value=b;this.Cl=this.qa=null}wb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};wb.className="KeyValuePair";function Cb(a){this.la=a;a.Ka=null;this.na=a.s;this.pa=null}Cb.prototype.reset=function(){var a=this.la;a.Ka=null;this.na=a.s;this.pa=null}; Cb.prototype.next=function(){var a=this.la;if(a.s!==this.na){if(null===this.key)return!1;Aa(a)}var b=this.pa;b=null===b?a.ga:b.qa;if(null!==b)return this.pa=b,this.key=b.key,this.value=b.value,!0;this.zd();return!1};Cb.prototype.fd=function(){return this.next()};Cb.prototype.first=function(){var a=this.la;this.na=a.s;a=a.ga;return null!==a?(this.pa=a,this.key=a.key,this.value=a.value,a):null}; Cb.prototype.any=function(a){var b=this.la;b.Ka=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(a(d))return!0;b.s!==c&&Aa(b);d=d.qa}return!1};Cb.prototype.all=function(a){var b=this.la;b.Ka=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;){if(!a(d))return!1;b.s!==c&&Aa(b);d=d.qa}return!0};Cb.prototype.each=function(a){var b=this.la;b.Ka=null;var c=b.s;this.pa=null;for(var d=b.ga;null!==d;)a(d),b.s!==c&&Aa(b),d=d.qa;return this}; Cb.prototype.map=function(a){var b=this.la;b.Ka=null;var c=b.s;this.pa=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e)),b.s!==c&&Aa(b),e=e.qa;return d.iterator};Cb.prototype.filter=function(a){var b=this.la;b.Ka=null;var c=b.s;this.pa=null;for(var d=new H,e=b.ga;null!==e;)a(e)&&d.add(e),b.s!==c&&Aa(b),e=e.qa;return d.iterator};Cb.prototype.zd=function(){this.value=this.key=null;this.na=-1;this.la.Ka=this};Cb.prototype.toString=function(){return null!==this.pa?"MapIterator@"+this.pa:"MapIterator"}; ma.Object.defineProperties(Cb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.la.Fb}}});Cb.prototype.first=Cb.prototype.first;Cb.prototype.hasNext=Cb.prototype.fd;Cb.prototype.next=Cb.prototype.next;Cb.prototype.reset=Cb.prototype.reset;Cb.className="MapIterator"; function Db(a){fb(this);this.u=!1;this.Gb={};this.Fb=0;this.Ve=this.Ka=null;this.s=0;this.We=this.ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ea():this.addAll(a))}t=Db.prototype;t.lb=function(){var a=this.s;a++;999999999=this.count)return mb;var a=this.Ka;return null!==a?(a.reset(),a):new Cb(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?mb:new yb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return mb; var a=this.Ve;return null!==a?(a.reset(),a):new Ab(this)}}});Db.prototype.toKeySet=Db.prototype.$d;Db.prototype.toArray=Db.prototype.Oa;Db.prototype.clear=Db.prototype.clear;Db.prototype["delete"]=Db.prototype.delete;Db.prototype.remove=Db.prototype.remove;Db.prototype.get=Db.prototype.get;Db.prototype.getValue=Db.prototype.K;Db.prototype.has=Db.prototype.has;Db.prototype.contains=Db.prototype.contains;Db.prototype.first=Db.prototype.first;Db.prototype.addAll=Db.prototype.addAll; Db.prototype.set=Db.prototype.set;Db.prototype.add=Db.prototype.add;Db.prototype.thaw=Db.prototype.ja;Db.prototype.freeze=Db.prototype.freeze;Db.className="Map";function J(a,b){void 0===a?this.H=this.G=0:"number"===typeof a&&"number"===typeof b?(this.G=a,this.H=b):v("Invalid arguments to Point constructor: "+a+", "+b);this.u=!1}J.prototype.assign=function(a){this.G=a.G;this.H=a.H;return this};J.prototype.h=function(a,b){this.G=a;this.H=b;return this}; J.prototype.zg=function(a,b){F&&(A(a,"number",J,"setTo:x"),A(b,"number",J,"setTo:y"),this.ha());this.G=a;this.H=b;return this};J.prototype.set=function(a){F&&(w(a,J,J,"set:p"),this.ha());this.G=a.G;this.H=a.H;return this};J.prototype.copy=function(){var a=new J;a.G=this.G;a.H=this.H;return a};t=J.prototype;t.ia=function(){this.u=!0;Object.freeze(this);return this};t.J=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.u=!0;return this}; t.ja=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.u=!1;return this};t.ha=function(a){if(this.u){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function Eb(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 J(c,e)}return new J} function Gb(a){F&&w(a,J);return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof J?this.G===a.x&&this.H===a.y:!1};t.Ji=function(a,b){return this.G===a&&this.H===b};t.Sa=function(a){return K.B(this.G,a.x)&&K.B(this.H,a.y)};t.add=function(a){F&&(w(a,J,J,"add:p"),this.ha());this.G+=a.x;this.H+=a.y;return this};t.Zd=function(a){F&&(w(a,J,J,"subtract:p"),this.ha());this.G-=a.x;this.H-=a.y;return this}; t.offset=function(a,b){F&&(C(a,J,"offset:dx"),C(b,J,"offset:dy"),this.ha());this.G+=a;this.H+=b;return this};J.prototype.rotate=function(a){F&&(C(a,J,"rotate:angle"),this.ha());if(0===a)return this;var b=this.G,c=this.H;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.G=a*b-d*c;this.H=d*b+a*c;return this};t=J.prototype; t.scale=function(a,b){F&&(C(a,J,"scale:sx"),C(b,J,"scale:sy"),this.ha());this.G*=a;this.H*=b;return this};t.Fe=function(a){F&&w(a,J,J,"distanceSquaredPoint:p");var b=a.x-this.G;a=a.y-this.H;return b*b+a*a};t.ed=function(a,b){F&&(C(a,J,"distanceSquared:px"),C(b,J,"distanceSquared:py"));a-=this.G;b-=this.H;return a*a+b*b};t.normalize=function(){F&&this.ha();var a=this.G,b=this.H,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.Uz=function(a,b,c,d){F&&(C(a,J,"projectOntoLineSegment:px"),C(b,J,"projectOntoLineSegment:py"),C(c,J,"projectOntoLineSegment:qx"),C(d,J,"projectOntoLineSegment:qy"));K.Xi(a,b,c,d,this.G,this.H,this);return this};t.Vz=function(a,b){F&&(w(a,J,J,"projectOntoLineSegmentPoint:p"),w(b,J,J,"projectOntoLineSegmentPoint:q"));K.Xi(a.x,a.y,b.x,b.y,this.G,this.H,this);return this}; t.fA=function(a,b,c,d){F&&(C(a,J,"snapToGrid:originx"),C(b,J,"snapToGrid:originy"),C(c,J,"snapToGrid:cellwidth"),C(d,J,"snapToGrid:cellheight"));K.cq(this.G,this.H,a,b,c,d,this);return this};t.gA=function(a,b){F&&(w(a,J,J,"snapToGridPoint:p"),w(b,Ib,J,"snapToGridPoint:q"));K.cq(this.G,this.H,a.x,a.y,b.width,b.height,this);return this};t.Zi=function(a,b){F&&(w(a,L,J,"setRectSpot:r"),w(b,M,J,"setRectSpot:spot"),this.ha());this.G=a.x+b.x*a.width+b.offsetX;this.H=a.y+b.y*a.height+b.offsetY;return this}; t.vk=function(a,b,c,d,e){F&&(C(a,J,"setSpot:x"),C(b,J,"setSpot:y"),C(c,J,"setSpot:w"),C(d,J,"setSpot:h"),(0>c||0>d)&&v("Point.setSpot:Width and height cannot be negative"),w(e,M,J,"setSpot:spot"),this.ha());this.G=a+e.x*c+e.offsetX;this.H=b+e.y*d+e.offsetY;return this};t.transform=function(a){F&&w(a,Jb,J,"transform:t");a.va(this);return this};function Kb(a,b){F&&w(b,Jb,J,"transformInverted:t");b.Wd(a);return a} function Lb(a,b,c,d,e,f){F&&(C(a,J,"distanceLineSegmentSquared:px"),C(b,J,"distanceLineSegmentSquared:py"),C(c,J,"distanceLineSegmentSquared:ax"),C(d,J,"distanceLineSegmentSquared:ay"),C(e,J,"distanceLineSegmentSquared:bx"),C(f,J,"distanceLineSegmentSquared:by"));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 Mb(a,b,c,d){F&&(C(a,J,"distanceSquared:px"),C(b,J,"distanceSquared:py"),C(c,J,"distanceSquared:qx"),C(d,J,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b}function Nb(a,b,c,d){F&&(C(a,J,"direction:px"),C(b,J,"direction:py"),C(c,J,"direction:qx"),C(d,J,"direction:qy"));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.o=function(){return isFinite(this.x)&&isFinite(this.y)};J.alloc=function(){var a=Ob.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Ob.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Ob.push(a)}; ma.Object.defineProperties(J.prototype,{x:{configurable:!0,get:function(){return this.G},set:function(a){F&&(A(a,"number",J,"x"),this.ha(a));this.G=a}},y:{configurable:!0,get:function(){return this.H},set:function(a){F&&(A(a,"number",J,"y"),this.ha(a));this.H=a}}});J.prototype.isReal=J.prototype.o;J.prototype.setSpot=J.prototype.vk;J.prototype.setRectSpot=J.prototype.Zi;J.prototype.snapToGridPoint=J.prototype.gA;J.prototype.snapToGrid=J.prototype.fA; J.prototype.projectOntoLineSegmentPoint=J.prototype.Vz;J.prototype.projectOntoLineSegment=J.prototype.Uz;J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Xa;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.ed;J.prototype.distanceSquaredPoint=J.prototype.Fe;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.Zd;J.prototype.add=J.prototype.add; J.prototype.equalsApprox=J.prototype.Sa;J.prototype.equalTo=J.prototype.Ji;J.prototype.equals=J.prototype.A;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.zg;var Pb=null,Qb=null,Rb=null,Sb=null,Ub=null,Ob=[];J.className="Point";J.parse=Eb;J.stringify=Gb;J.distanceLineSegmentSquared=Lb;J.distanceSquared=Mb;J.direction=Nb;J.Origin=Pb=(new J(0,0)).ia();J.InfiniteTopLeft=Qb=(new J(-Infinity,-Infinity)).ia();J.InfiniteBottomRight=Rb=(new J(Infinity,Infinity)).ia(); J.SixPoint=Sb=(new J(6,6)).ia();J.NoPoint=Ub=(new J(NaN,NaN)).ia();J.parse=Eb;J.stringify=Gb;J.distanceLineSegmentSquared=Lb;J.distanceSquared=Mb;J.direction=Nb;function Ib(a,b){void 0===a?this.$=this.aa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.aa=a,this.$=b):v("Invalid arguments to Size constructor: "+a+", "+b);this.u=!1}var Vb,Wb,Xb,Yb,Zb,$b,ac;Ib.prototype.assign=function(a){this.aa=a.aa;this.$=a.$;return this}; Ib.prototype.h=function(a,b){this.aa=a;this.$=b;return this};Ib.prototype.zg=function(a,b){F&&(A(a,"number",Ib,"setTo:w"),A(b,"number",Ib,"setTo:h"),0>a&&ya(a,">= 0",Ib,"setTo:w"),0>b&&ya(b,">= 0",Ib,"setTo:h"),this.ha());this.aa=a;this.$=b;return this};Ib.prototype.set=function(a){F&&(w(a,Ib,Ib,"set:s"),this.ha());this.aa=a.aa;this.$=a.$;return this};Ib.prototype.copy=function(){var a=new Ib;a.aa=this.aa;a.$=this.$;return a};t=Ib.prototype;t.ia=function(){this.u=!0;Object.freeze(this);return this}; t.J=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.u=!0;return this};t.ja=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.u=!1;return this};t.ha=function(a){if(this.u){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function bc(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 Ib(c,e)}return new Ib}function dc(a){F&&w(a,Ib);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Ib?this.aa===a.width&&this.$===a.height:!1};t.Ji=function(a,b){return this.aa===a&&this.$===b}; t.Sa=function(a){return K.B(this.aa,a.width)&&K.B(this.$,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};Ib.alloc=function(){var a=ec.pop();return void 0===a?new Ib:a};Ib.free=function(a){ec.push(a)}; ma.Object.defineProperties(Ib.prototype,{width:{configurable:!0,get:function(){return this.aa},set:function(a){F&&(A(a,"number",Ib,"width"),this.ha(a));0>a&&ya(a,">= 0",Ib,"width");this.aa=a}},height:{configurable:!0,get:function(){return this.$},set:function(a){F&&(A(a,"number",Ib,"height"),this.ha(a));0>a&&ya(a,">= 0",Ib,"height");this.$=a}}});Ib.prototype.isReal=Ib.prototype.o;Ib.prototype.equalsApprox=Ib.prototype.Sa;Ib.prototype.equalTo=Ib.prototype.Ji; Ib.prototype.equals=Ib.prototype.A;Ib.prototype.set=Ib.prototype.set;Ib.prototype.setTo=Ib.prototype.zg;var ec=[];Ib.className="Size";Ib.parse=bc;Ib.stringify=dc;Ib.ZeroSize=Vb=(new Ib(0,0)).ia();Ib.OneSize=Wb=(new Ib(1,1)).ia();Ib.SixSize=Xb=(new Ib(6,6)).ia();Ib.EightSize=Yb=(new Ib(8,8)).ia();Ib.TenSize=Zb=(new Ib(10,10)).ia();Ib.InfiniteSize=$b=(new Ib(Infinity,Infinity)).ia();Ib.NoSize=ac=(new Ib(NaN,NaN)).ia();Ib.parse=bc;Ib.stringify=dc; function L(a,b,c,d){void 0===a?this.$=this.aa=this.H=this.G=0:a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.G=Math.min(c,d),this.H=Math.min(a,b),this.aa=Math.abs(c-d),this.$=Math.abs(a-b)):b instanceof Ib?(this.G=c,this.H=a,this.aa=b.aa,this.$=b.$):v("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.G=a,this.H=b,this.aa=c,this.$=d):v("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this.u=!1}t=L.prototype;t.assign=function(a){this.G=a.G;this.H=a.H;this.aa=a.aa;this.$=a.$;return this};t.h=function(a,b,c,d){this.G=a;this.H=b;this.aa=c;this.$=d;return this};function fc(a,b,c){a.aa=b;a.$=c}t.zg=function(a,b,c,d){F&&(A(a,"number",L,"setTo:x"),A(b,"number",L,"setTo:y"),A(c,"number",L,"setTo:w"),A(d,"number",L,"setTo:h"),0>c&&ya(c,">= 0",L,"setTo:w"),0>d&&ya(d,">= 0",L,"setTo:h"),this.ha());this.G=a;this.H=b;this.aa=c;this.$=d;return this}; t.set=function(a){F&&(w(a,L,L,"set:r"),this.ha());this.G=a.G;this.H=a.H;this.aa=a.aa;this.$=a.$;return this};t.ld=function(a){F&&(w(a,J,L,"setPoint:p"),this.ha());this.G=a.x;this.H=a.y;return this};t.dA=function(a){F&&(w(a,Ib,L,"setSize:s"),this.ha());this.aa=a.aa;this.$=a.$;return this};L.prototype.copy=function(){var a=new L;a.G=this.G;a.H=this.H;a.aa=this.aa;a.$=this.$;return a};t=L.prototype;t.ia=function(){this.u=!0;Object.freeze(this);return this}; t.J=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.u=!0;return this};t.ja=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.u=!1;return this};t.ha=function(a){if(this.u){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function gc(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 L(c,e,f,g)}return new L}function hc(a){F&&w(a,L);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.A=function(a){return a instanceof L?this.G===a.x&&this.H===a.y&&this.aa===a.width&&this.$===a.height:!1};t.Ji=function(a,b,c,d){return this.G===a&&this.H===b&&this.aa===c&&this.$===d};t.Sa=function(a){return K.B(this.G,a.x)&&K.B(this.H,a.y)&&K.B(this.aa,a.width)&&K.B(this.$,a.height)};function ic(a,b){return K.da(a.G,b.x)&&K.da(a.H,b.y)&&K.da(a.aa,b.width)&&K.da(a.$,b.height)} t.ea=function(a){F&&w(a,J,L,"containsPoint:p");return this.G<=a.x&&this.G+this.aa>=a.x&&this.H<=a.y&&this.H+this.$>=a.y};t.qf=function(a){F&&w(a,L,L,"containsRect:r");return this.G<=a.x&&a.x+a.width<=this.G+this.aa&&this.H<=a.y&&a.y+a.height<=this.H+this.$}; t.contains=function(a,b,c,d){F?(C(a,L,"contains:x"),C(b,L,"contains:y"),void 0===c?c=0:C(c,L,"contains:w"),void 0===d?d=0:C(d,L,"contains:h"),(0>c||0>d)&&v("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.G<=a&&a+c<=this.G+this.aa&&this.H<=b&&b+d<=this.H+this.$};t.reset=function(){F&&this.ha();this.$=this.aa=this.H=this.G=0};t.offset=function(a,b){F&&(C(a,L,"offset:dx"),C(b,L,"offset:dy"),this.ha());this.G+=a;this.H+=b;return this}; t.Xc=function(a,b){F&&(C(a,L,"inflate:w"),C(b,L,"inflate:h"));return jc(this,b,a,b,a)};t.Tp=function(a){F&&w(a,kc,L,"addMargin:m");return jc(this,a.top,a.right,a.bottom,a.left)};t.Xv=function(a){F&&w(a,kc,L,"subtractMargin:m");return jc(this,-a.top,-a.right,-a.bottom,-a.left)};t.xz=function(a,b,c,d){F&&(C(a,L,"grow:t"),C(b,L,"grow:r"),C(c,L,"grow:b"),C(d,L,"grow:l"));return jc(this,a,b,c,d)}; function jc(a,b,c,d,e){F&&a.ha();var f=a.aa;c+e<=-f?(a.G+=f/2,a.aa=0):(a.G-=e,a.aa+=c+e);c=a.$;b+d<=-c?(a.H+=c/2,a.$=0):(a.H-=b,a.$+=b+d);return a}t.Bz=function(a){F&&w(a,L,L,"intersectRect:r");return mc(this,a.x,a.y,a.width,a.height)};t.qv=function(a,b,c,d){F&&(C(a,L,"intersect:x"),C(b,L,"intersect:y"),C(c,L,"intersect:w"),C(d,L,"intersect:h"),(0>c||0>d)&&v("Rect.intersect:Width and height cannot be negative"));return mc(this,a,b,c,d)}; function mc(a,b,c,d,e){F&&a.ha();var f=Math.max(a.G,b),g=Math.max(a.H,c);b=Math.min(a.G+a.aa,b+d);c=Math.min(a.H+a.$,c+e);a.G=f;a.H=g;a.aa=Math.max(0,b-f);a.$=Math.max(0,c-g);return a}t.Kc=function(a){F&&w(a,L,L,"intersectsRect:r");return this.rv(a.x,a.y,a.width,a.height)}; t.rv=function(a,b,c,d){F&&(C(a,L,"intersects:x"),C(b,L,"intersects:y"),C(a,L,"intersects:w"),C(b,L,"intersects:h"),(0>c||0>d)&&v("Rect.intersects:Width and height cannot be negative"));var e=this.aa,f=this.G;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.$;c=this.H;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function nc(a,b,c){var d=a.aa,e=a.G,f=b.x-c;if(e>b.width+c+c+f||f>d+e)return!1;d=a.$;a=a.H;e=b.y-c;return a>b.height+c+c+e||e>d+a?!1:!0}t.Me=function(a){F&&w(a,J,L,"unionPoint:p");return oc(this,a.x,a.y,0,0)};t.Lc=function(a){F&&w(a,L,L,"unionRect:r");return oc(this,a.G,a.H,a.aa,a.$)}; t.dw=function(a,b,c,d){F?(C(a,L,"union:x"),C(b,L,"union:y"),void 0===c?c=0:C(c,L,"union:w"),void 0===d?d=0:C(d,L,"union:h"),(0>c||0>d)&&v("Rect.union:Width and height cannot be negative"),this.ha()):(void 0===c&&(c=0),void 0===d&&(d=0));return oc(this,a,b,c,d)};function oc(a,b,c,d,e){var f=Math.min(a.G,b),g=Math.min(a.H,c);b=Math.max(a.G+a.aa,b+d);c=Math.max(a.H+a.$,c+e);a.G=f;a.H=g;a.aa=b-f;a.$=c-g;return a} t.vk=function(a,b,c){F&&(C(a,L,"setSpot:x"),C(b,L,"setSpot:y"),w(c,M,L,"setSpot:spot"),this.ha());this.G=a-c.offsetX-c.x*this.aa;this.H=b-c.offsetY-c.y*this.$;return this}; function rc(a,b,c,d,e,f,g,h){F?(C(a,L,"contains:rx"),C(b,L,"contains:ry"),C(c,L,"contains:rw"),C(d,L,"contains:rh"),C(e,L,"contains:x"),C(f,L,"contains:y"),void 0===g?g=0:C(g,L,"contains:w"),void 0===h?h=0:C(h,L,"contains:h"),(0>c||0>d||0>g||0>h)&&v("Rect.contains:Width and height cannot be negative")):(void 0===g&&(g=0),void 0===h&&(h=0));return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d} function sc(a,b,c,d,e,f,g,h){F&&(C(a,L,"intersects:rx"),C(b,L,"intersects:ry"),C(c,L,"intersects:rw"),C(d,L,"intersects:rh"),C(e,L,"intersects:x"),C(f,L,"intersects:y"),C(g,L,"intersects:w"),C(h,L,"intersects:h"),(0>c||0>d||0>g||0>h)&&v("Rect.intersects:Width and height cannot be negative"));return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.o=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Dz=function(){return 0===this.width&&0===this.height}; L.alloc=function(){var a=tc.pop();return void 0===a?new L:a};L.allocAt=function(a,b,c,d){var e=tc.pop();return void 0===e?new L(a,b,c,d):e.h(a,b,c,d)};L.free=function(a){tc.push(a)}; ma.Object.defineProperties(L.prototype,{x:{configurable:!0,get:function(){return this.G},set:function(a){F&&(A(a,"number",L,"x"),this.ha(a));this.G=a}},y:{configurable:!0,get:function(){return this.H},set:function(a){F&&(A(a,"number",L,"y"),this.ha(a));this.H=a}},width:{configurable:!0,get:function(){return this.aa},set:function(a){F&&(A(a,"number",L,"width"),this.ha(a));0>a&&ya(a,">= 0",L,"width");this.aa=a}},height:{configurable:!0,get:function(){return this.$}, set:function(a){F&&(A(a,"number",L,"height"),this.ha(a));0>a&&ya(a,">= 0",L,"height");this.$=a}},left:{configurable:!0,get:function(){return this.G},set:function(a){F&&(A(a,"number",L,"left"),this.ha(a));this.G=a}},top:{configurable:!0,get:function(){return this.H},set:function(a){F&&(A(a,"number",L,"top"),this.ha(a));this.H=a}},right:{configurable:!0,get:function(){return this.G+this.aa},set:function(a){F&&(C(a,L,"right"),this.ha(a));this.G+=a-(this.G+this.aa)}}, bottom:{configurable:!0,get:function(){return this.H+this.$},set:function(a){F&&(C(a,L,"top"),this.ha(a));this.H+=a-(this.H+this.$)}},position:{configurable:!0,get:function(){return new J(this.G,this.H)},set:function(a){F&&(w(a,J,L,"position"),this.ha(a));this.G=a.x;this.H=a.y}},size:{configurable:!0,get:function(){return new Ib(this.aa,this.$)},set:function(a){F&&(w(a,Ib,L,"size"),this.ha(a));this.aa=a.width;this.$=a.height}},center:{configurable:!0, get:function(){return new J(this.G+this.aa/2,this.H+this.$/2)},set:function(a){F&&(w(a,J,L,"center"),this.ha(a));this.G=a.x-this.aa/2;this.H=a.y-this.$/2}},centerX:{configurable:!0,get:function(){return this.G+this.aa/2},set:function(a){F&&(C(a,L,"centerX"),this.ha(a));this.G=a-this.aa/2}},centerY:{configurable:!0,get:function(){return this.H+this.$/2},set:function(a){F&&(C(a,L,"centerY"),this.ha(a));this.H=a-this.$/2}}});L.prototype.isEmpty=L.prototype.Dz; L.prototype.isReal=L.prototype.o;L.prototype.setSpot=L.prototype.vk;L.prototype.union=L.prototype.dw;L.prototype.unionRect=L.prototype.Lc;L.prototype.unionPoint=L.prototype.Me;L.prototype.intersects=L.prototype.rv;L.prototype.intersectsRect=L.prototype.Kc;L.prototype.intersect=L.prototype.qv;L.prototype.intersectRect=L.prototype.Bz;L.prototype.grow=L.prototype.xz;L.prototype.subtractMargin=L.prototype.Xv;L.prototype.addMargin=L.prototype.Tp;L.prototype.inflate=L.prototype.Xc;L.prototype.offset=L.prototype.offset; L.prototype.contains=L.prototype.contains;L.prototype.containsRect=L.prototype.qf;L.prototype.containsPoint=L.prototype.ea;L.prototype.equalsApprox=L.prototype.Sa;L.prototype.equalTo=L.prototype.Ji;L.prototype.equals=L.prototype.A;L.prototype.setSize=L.prototype.dA;L.prototype.setPoint=L.prototype.ld;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.zg;var uc=null,vc=null,tc=[];L.className="Rect";L.parse=gc;L.stringify=hc;L.contains=rc;L.intersects=sc;L.ZeroRect=uc=(new L(0,0,0,0)).ia(); L.NoRect=vc=(new L(NaN,NaN,NaN,NaN)).ia();L.parse=gc;L.stringify=hc;L.contains=rc;L.intersects=sc;function kc(a,b,c,d){void 0===a?this.oe=this.ee=this.ye=this.Ae=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):v("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.u=!1} kc.prototype.assign=function(a){this.Ae=a.Ae;this.ye=a.ye;this.ee=a.ee;this.oe=a.oe;return this};kc.prototype.zg=function(a,b,c,d){F&&(A(a,"number",kc,"setTo:t"),A(b,"number",kc,"setTo:r"),A(c,"number",kc,"setTo:b"),A(d,"number",kc,"setTo:l"),this.ha());this.Ae=a;this.ye=b;this.ee=c;this.oe=d;return this};kc.prototype.set=function(a){F&&(w(a,kc,kc,"assign:m"),this.ha());this.Ae=a.Ae;this.ye=a.ye;this.ee=a.ee;this.oe=a.oe;return this}; kc.prototype.copy=function(){var a=new kc;a.Ae=this.Ae;a.ye=this.ye;a.ee=this.ee;a.oe=this.oe;return a};t=kc.prototype;t.ia=function(){this.u=!0;Object.freeze(this);return this};t.J=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.u=!0;return this};t.ja=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.u=!1;return this}; t.ha=function(a){if(this.u){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function wc(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 kc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new kc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new kc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new kc(c,e):new kc(c,e,f,g)}return new kc} function Cc(a){F&&w(a,kc);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.A=function(a){return a instanceof kc?this.Ae===a.top&&this.ye===a.right&&this.ee===a.bottom&&this.oe===a.left:!1};t.Ji=function(a,b,c,d){return this.Ae===a&&this.ye===b&&this.ee===c&&this.oe===d}; t.Sa=function(a){return K.B(this.Ae,a.top)&&K.B(this.ye,a.right)&&K.B(this.ee,a.bottom)&&K.B(this.oe,a.left)};t.o=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};kc.alloc=function(){var a=Dc.pop();return void 0===a?new kc:a};kc.free=function(a){Dc.push(a)}; ma.Object.defineProperties(kc.prototype,{top:{configurable:!0,get:function(){return this.Ae},set:function(a){F&&(C(a,kc,"top"),this.ha(a));this.Ae=a}},right:{configurable:!0,get:function(){return this.ye},set:function(a){F&&(C(a,kc,"right"),this.ha(a));this.ye=a}},bottom:{configurable:!0,get:function(){return this.ee},set:function(a){F&&(C(a,kc,"bottom"),this.ha(a));this.ee=a}},left:{configurable:!0,get:function(){return this.oe},set:function(a){F&& (C(a,kc,"left"),this.ha(a));this.oe=a}}});kc.prototype.isReal=kc.prototype.o;kc.prototype.equalsApprox=kc.prototype.Sa;kc.prototype.equalTo=kc.prototype.Ji;kc.prototype.equals=kc.prototype.A;kc.prototype.set=kc.prototype.set;kc.prototype.setTo=kc.prototype.zg;var Ec=null,Fc=null,Dc=[];kc.className="Margin";kc.parse=wc;kc.stringify=Cc;kc.ZeroMargin=Ec=(new kc(0,0,0,0)).ia();kc.TwoMargin=Fc=(new kc(2,2,2,2)).ia();kc.parse=wc;kc.stringify=Cc; function Jb(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}Jb.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};Jb.prototype.copy=function(){var a=new Jb;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};t=Jb.prototype;t.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}; t.A=function(a){return a instanceof Jb?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};t.jt=function(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22};t.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; t.multiply=function(a){var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,f=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; t.wv=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,g=b*(a.m21*a.dy-a.m22*a.dx);a=b*(a.m12*a.dx-a.m11*a.dy);b=this.m11*c+this.m21*d;c=this.m12*c+this.m22*d;d=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;this.dx=this.m11*g+this.m21*a+this.dx;this.dy=this.m12*g+this.m22*a+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this}; t.ht=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; Jb.prototype.rotate=function(a,b,c){F&&(C(a,Jb,"rotate:angle"),C(b,Jb,"rotate:rx"),C(c,Jb,"rotate:ry"));360<=a?a-=360:0>a&&(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=Jb.prototype; t.translate=function(a,b){F&&(C(a,Jb,"translate:x"),C(b,Jb,"translate:y"));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);F&&(C(a,Jb,"translate:sx"),C(b,Jb,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.va=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.Wd=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.cw=function(a){var b=a.G,c=a.H,d=b+a.aa,e=c+a.$,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.G=e;a.H=r;a.aa=n-e;a.$=p-r;return a}; Jb.alloc=function(){var a=Hc.pop();return void 0===a?new Jb:a};Jb.free=function(a){Hc.push(a)};Jb.prototype.transformRect=Jb.prototype.cw;Jb.prototype.invertedTransformPoint=Jb.prototype.Wd;Jb.prototype.transformPoint=Jb.prototype.va;Jb.prototype.scale=Jb.prototype.scale;Jb.prototype.translate=Jb.prototype.translate;Jb.prototype.rotate=Jb.prototype.rotate;Jb.prototype.invert=Jb.prototype.ht;Jb.prototype.multiplyInverted=Jb.prototype.wv;Jb.prototype.multiply=Jb.prototype.multiply; Jb.prototype.reset=Jb.prototype.reset;Jb.prototype.isIdentity=Jb.prototype.jt;Jb.prototype.equals=Jb.prototype.A;Jb.prototype.set=Jb.prototype.set;var Hc=[];Jb.className="Transform";Jb.xF="54a702f3e53909c447824c6706603faf4c";function M(a,b,c,d){void 0===a?this.Pd=this.Od=this.H=this.G=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.u=!1} var Ic,Jc,Kc,Lc,Oc,Pc,Qc,Rc,Sc,Tc,Uc,Vc,Xc,Yc,Zc,$c,ad,bd,cd,dd,ed,gd,hd,id,jd,kd,ld,md,nd,od,pd,qd,rd,xd,yd,zd;M.prototype.assign=function(a){this.G=a.G;this.H=a.H;this.Od=a.Od;this.Pd=a.Pd;return this};M.prototype.zg=function(a,b,c,d){F&&(Ad(a,"setTo:x"),Ad(b,"setTo:y"),Bd(c,"setTo:offx"),Bd(d,"setTo:offy"),this.ha());this.G=a;this.H=b;this.Od=c;this.Pd=d;return this};M.prototype.set=function(a){F&&(w(a,M,M,"set:s"),this.ha());this.G=a.G;this.H=a.H;this.Od=a.Od;this.Pd=a.Pd;return this}; M.prototype.copy=function(){var a=new M;a.G=this.G;a.H=this.H;a.Od=this.Od;a.Pd=this.Pd;return a};t=M.prototype;t.ia=function(){this.u=!0;Object.freeze(this);return this};t.J=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.u=!0;return this};t.ja=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.u=!1;return this}; t.ha=function(a){if(this.u){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function Cd(a,b){a.G=NaN;a.H=NaN;a.Od=b;return a}function Ad(a,b){(isNaN(a)||1a)&&ya(a,"0 <= "+b+" <= 1",M,b)}function Bd(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&ya(a,"real number, not NaN or Infinity",M,b)} function Dd(a){if("string"===typeof a){a=a.trim();if("None"===a)return Ic;if("TopLeft"===a)return Jc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Kc;if("TopRight"===a)return Lc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Oc;if("Center"===a)return Pc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Qc;if("BottomLeft"===a)return Rc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Sc;if("BottomRight"===a)return Tc;if("TopSide"===a)return Uc;if("LeftSide"=== a)return Vc;if("RightSide"===a)return Xc;if("BottomSide"===a)return Yc;if("TopBottomSides"===a)return Zc;if("LeftRightSides"===a)return $c;if("TopLeftSides"===a)return ad;if("TopRightSides"===a)return bd;if("BottomLeftSides"===a)return cd;if("BottomRightSides"===a)return dd;if("NotTopSide"===a)return ed;if("NotLeftSide"===a)return gd;if("NotRightSide"===a)return hd;if("NotBottomSide"===a)return id;if("AllSides"===a)return jd;if("Default"===a)return kd;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0=a)return 0;var b=K.lw;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.lw=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},B: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},Qs:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Vb(a,b,g,h,n,c,d)&&K.Vb(a,b,g,h,n,e,f))return K.Vb(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 x=(d+q)/2,y=(c+u)/2;return K.Qs(a, b,p,r,d,c,x,y,k,l,m,n)||K.Qs(x,y,q,u,e,f,g,h,k,l,m,n)},xy: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},wy:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Nb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Yl:function(a,b,c,d,e,f,g,h,k,l){if(K.Vb(a,b,g,h,k,c,d)&&K.Vb(a,b,g,h,k,e,f))oc(l,a,b,0,0),oc(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.Yl(a,b,m,n,d,c,q,u,k,l);K.Yl(q,u,p,r,e,f,g,h,k,l)}return l},De:function(a,b,c,d,e,f,g,h,k,l){if(K.Vb(a,b,g,h,k,c,d)&&K.Vb(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.De(a,b,m,n,d,c,q,u,k,l);K.De(q,u,p,r,e,f,g,h,k,l)}return l},Dv:function(a,b,c,d,e,f,g,h,k,l){if(K.Vb(a,b,e,f,l,c,d))return K.Vb(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.Dv(a,b,m,n,p,r,g,h,k,l)||K.Dv(p,r,c,d,e,f,g,h,k,l)},wA: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},Cv:function(a,b,c,d,e,f,g,h){if(K.Vb(a,b,e,f,g,c,d))oc(h,a,b,0,0),oc(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.Cv(a,b,k,l,m,n,g,h);K.Cv(m,n,c,d,e,f,g,h)}return h},uq:function(a,b,c,d,e,f,g,h){if(K.Vb(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.uq(a,b,k,l,m,n,g,h);K.uq(m,n,c,d,e,f,g,h)}return h},Up:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(K.Vb(a,b,g,h,p,c,d)&&K.Vb(a,b,g,h,p,e,f)){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;c=(c+e)/2;d=(d+f)/2;e=(e+g)/2;f=(f+h)/2;var x=(q+c)/2,y=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var z=(x+c)/2,B=(y+d)/2,D=(m-k)*(m-k)+(n-l)*(n-l),G=!1;K.Up(a,b,q,u,x,y,z,B,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 x=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+x)/2;c=(u+y)/2;x=(x+e)/2;y=(y+f)/2;var z=(d+x)/2,B=(c+y)/2;r+=K.Vp(a,b,q,u,d,c,z,B,k,l,m,n,p);r+=K.Vp(z,B,x,y,e,f,g,h,k,l,m,n,p)}return r},Xi:function(a,b,c,d,e,f,g){if(K.da(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(K.da(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.da(h,g))return K.Xi(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.da(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return K.Xi(a,b,c,d,e,g*(e-a)+b,k)},sA:function(a,b,c,d,e){return K.Je(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},rA: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}, Wc:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Je(a,b,a,d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},qA: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},ft:function(a,b,c){var d=b.x,e=b.y,f=c.x,g=c.y,h=a.left,k=a.right,l=a.top,m=a.bottom;return d===f?(e=l):e===g?(d=h):a.ea(b)||a.ea(c)||K.et(h,l,k,l,d,e,f,g)||K.et(k,l,k,m,d,e,f,g)||K.et(k,m,h,m,d,e,f,g)||K.et(h,m,h,l,d,e,f,g)?!0:!1},et:function(a,b,c,d,e,f,g,h){return 0>=K.Ss(a,b,c,d,e,f)*K.Ss(a,b,c,d,g,h)&&0>=K.Ss(e, f,g,h,a,b)*K.Ss(e,f,g,h,c,d)},Ss: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},ix: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 Td:var b=new L(this.startX,this.startY,0,0);b.dw(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 Ud:b=new L(this.startX,this.startY,0,0);b.dw(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 Hd:b="";c=this.figures.j;for(var d=c.length,e=0;e=D-1?!0:null!==k[u+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){u++;return k[u]}function e(){var a=new J(parseFloat(d()),parseFloat(d()));x===x.toLowerCase()&&(a.x=B.x+a.x,a.y=B.y+a.y);return a}function f(){return B=e()}function g(){return z=e()}function h(){var a=y.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?B:new J(2*B.x-z.x,2*B.y-z.y)}void 0===b&&(b=!1);"string"!==typeof a&&xa(a,"string",Gd,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var k=a.split(" ");for(a=0;a=D-1);)if(y=x,x=d(),""!==x)switch(x.toUpperCase()){case "X":p=!0;n=l=!1;break;case "M":r=f();null===a.gc||!0===p?(Xd(a,r.x,r.y,l,!n),p=!1):a.moveTo(r.x,r.y);for(m=B;!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();)B=new J((x===x.toLowerCase()?B.x:0)+parseFloat(d()),B.y),a.lineTo(B.x,B.y);break;case "V":for(;!c();)B=new J(B.x,(x===x.toLowerCase()?B.y:0)+parseFloat(d())),a.lineTo(B.x,B.y);break;case "C":for(;!c();){r=e();q=g();var G=f();Yd(a,r.x,r.y,q.x,q.y,G.x,G.y)}break;case "S":for(;!c();)r=h(),q=g(),G=f(),Yd(a,r.x,r.y,q.x,q.y,G.x,G.y);break;case "Q":for(;!c();)r=g(),q=f(),ce(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)z=r=h(),q=f(),ce(a, r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d());q=parseFloat(d());G=parseFloat(d());var O=parseFloat(d()),Q=parseFloat(d()),R=Q,da=!1;c()||(R=parseFloat(d()),c()||(da=0!==parseFloat(d())));x===x.toLowerCase()&&(G+=B.x,O+=B.y);a.arcTo(r,q,G,O,Q,R,da)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),G=parseFloat(d()),O=!!parseFloat(d()),Q=!!parseFloat(d()),R=f(),de(a,r,q,G,O,Q,R.x,R.y);break;case "Z":ee(a);B=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 me: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:v("Unknown Segment type: "+ q.type)}}}}this.ta=!0;return this}; t.ea=function(a,b,c,d){var e=a.x;a=a.y;for(var f=this.bounds.x-20,g=0,h,k,l,m,n,p=this.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)/m,c=c[h],e=c[2*a],h=c[2*a+1],b.h(e+(c[2*a+2]-e)*d,h+(c[2*a+3]-h)*d),b;g+=m}}b.h(NaN,NaN);return b}; t.sx=function(a){if(this.type===Jd){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)}return c===e?(b=d?d===b?0:1:Math.abs(f-b)/(d-g)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===Td){g=this.startX;var h=this.startY,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=J.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.si=0,F&&C(d,te,"x1"),this.ti=Math.max(d,0),F&&C(e,te,"y1"),this.bh=Math.max(e,0),this.ol="boolean"===typeof g?!!g:!1,this.Kk=!!h):(F&&C(d,te,"x1"),this.xe=d,F&&C(e,te,"y1"),this.si= e,F&&C(f,te,"x2"),a===le&&(f=Math.max(f,0)),this.ti=f,"number"===typeof g?(a===le&&(g=Math.max(g,0)),this.bh=g):this.bh=0,this.Kk=this.ol=!1);this.qj=!1;this.ta=!0;this.Ne=null}te.prototype.copy=function(){var a=new te;a.wa=this.wa;a.nc=this.nc;a.Dc=this.Dc;a.xe=this.xe;a.si=this.si;a.ti=this.ti;a.bh=this.bh;a.ol=this.ol;a.Kk=this.Kk;a.qj=this.qj;a.ta=this.ta;return a};t=te.prototype; t.Sa=function(a){if(!(a instanceof te)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ie:case Rd:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY);case je:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y)&&K.B(this.point2X,a.point2X)&&K.B(this.point2Y,a.point2Y);case ke:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y);case le:return K.B(this.startAngle, a.startAngle)&&K.B(this.sweepAngle,a.sweepAngle)&&K.B(this.centerX,a.centerX)&&K.B(this.centerY,a.centerY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);case me:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.B(this.xAxisRotation,a.xAxisRotation)&&K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);default:return!1}};t.hb=function(a){a.classType===te?this.type=a:Ba(this,a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case ie:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Rd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case je: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 ke: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 le: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 me: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.qj?"z":"")};t.freeze=function(){this.u=!0;return this};t.ja=function(){this.u=!1;return this};t.close=function(){this.qj=!0;return this}; function ne(a,b){if(null!==a.Ne&&!1===b.ta)return a.Ne;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Ne=[],a.Ne;b=a.xe;var e=a.si,f=K.ix(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.ix(0,0,b>f?b:f,m,m+g,!0);f=Jb.alloc();f.reset();f.translate(c,d);f.rotate(a.xe,0,0);f.scale(k,r);ge(b,f);Jb.free(f);a.Ne=b;return a.Ne} ma.Object.defineProperties(te.prototype,{isClosed:{configurable:!0,get:function(){return this.qj},set:function(a){this.qj!==a&&(this.qj=a,this.ta=!0)}},type:{configurable:!0,get:function(){return this.wa},set:function(a){F&&hb(a,te,te,"type");this.u&&va(this,a);this.wa=a;this.ta=!0}},endX:{configurable:!0,get:function(){return this.nc},set:function(a){F&&C(a,te,"endX");this.u&&va(this,a);this.nc=a;this.ta=!0}},endY:{configurable:!0,get:function(){return this.Dc}, set:function(a){F&&C(a,te,"endY");this.u&&va(this,a);this.Dc=a;this.ta=!0}},point1X:{configurable:!0,get:function(){return this.xe},set:function(a){F&&C(a,te,"point1X");this.u&&va(this,a);this.xe=a;this.ta=!0}},point1Y:{configurable:!0,get:function(){return this.si},set:function(a){F&&C(a,te,"point1Y");this.u&&va(this,a);this.si=a;this.ta=!0}},point2X:{configurable:!0,get:function(){return this.ti},set:function(a){F&&C(a,te,"point2X");this.u&&va(this,a);this.ti= a;this.ta=!0}},point2Y:{configurable:!0,get:function(){return this.bh},set:function(a){F&&C(a,te,"point2Y");this.u&&va(this,a);this.bh=a;this.ta=!0}},centerX:{configurable:!0,get:function(){return this.xe},set:function(a){F&&C(a,te,"centerX");this.u&&va(this,a);this.xe=a;this.ta=!0}},centerY:{configurable:!0,get:function(){return this.si},set:function(a){F&&C(a,te,"centerY");this.u&&va(this,a);this.si=a;this.ta=!0}},radiusX:{configurable:!0, get:function(){return this.ti},set:function(a){F&&C(a,te,"radiusX");0>a&&ya(a,">= zero",te,"radiusX");this.u&&va(this,a);this.ti=a;this.ta=!0}},radiusY:{configurable:!0,get:function(){return this.bh},set:function(a){F&&C(a,te,"radiusY");0>a&&ya(a,">= zero",te,"radiusY");this.u&&va(this,a);this.bh=a;this.ta=!0}},startAngle:{configurable:!0,get:function(){return this.nc},set:function(a){this.nc!==a&&(this.u&&va(this,a),F&&C(a,te,"startAngle"),a%=360,0>a&&(a+=360),this.nc= a,this.ta=!0)}},sweepAngle:{configurable:!0,get:function(){return this.Dc},set:function(a){F&&C(a,te,"sweepAngle");this.u&&va(this,a);360a&&(a=-360);this.Dc=a;this.ta=!0}},isClockwiseArc:{configurable:!0,get:function(){return this.Kk},set:function(a){this.u&&va(this,a);this.Kk=a;this.ta=!0}},isLargeArc:{configurable:!0,get:function(){return this.ol},set:function(a){this.u&&va(this,a);this.ol=a;this.ta=!0}},xAxisRotation:{configurable:!0, get:function(){return this.xe},set:function(a){F&&C(a,te,"xAxisRotation");a%=360;0>a&&(a+=360);this.u&&va(this,a);this.xe=a;this.ta=!0}}});te.prototype.equalsApprox=te.prototype.Sa;var ie=new E(te,"Move",0),Rd=new E(te,"Line",1),je=new E(te,"Bezier",2),ke=new E(te,"QuadraticBezier",3),le=new E(te,"Arc",4),me=new E(te,"SvgArc",4);te.className="PathSegment";te.Move=ie;te.Line=Rd;te.Bezier=je;te.QuadraticBezier=ke;te.Arc=le;te.SvgArc=me; function ze(){this.D=null;this.Ju=(new J(0,0)).freeze();this.Zt=(new J(0,0)).freeze();this.Wq=this.cs=0;this.Xq=1;this.Rr="";this.Ls=this.nr=!1;this.mr=this.Zq=0;this.Gg=this.Ar=this.Lr=!1;this.ur=null;this.Js=0;this.Sd=this.Is=null}ze.prototype.copy=function(){var a=new ze;return this.clone(a)}; ze.prototype.clone=function(a){a.D=this.D;a.Ju.assign(this.viewPoint);a.Zt.assign(this.documentPoint);a.cs=this.cs;a.Wq=this.Wq;a.Xq=this.Xq;a.Rr=this.Rr;a.nr=this.nr;a.Ls=this.Ls;a.Zq=this.Zq;a.mr=this.mr;a.Lr=this.Lr;a.Ar=this.Ar;a.Gg=this.Gg;a.ur=this.ur;a.Js=this.Js;a.Is=this.Is;a.Sd=this.Sd;return a}; ze.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};ze.prototype.gq=function(a,b){var c=this.diagram;if(null===c)return b;Ae(c,this.event,a,b);return b}; ze.prototype.nz=function(a,b){var c=this.diagram;if(null===c)return b;Ae(c,this.event,a,b);b.assign(c.Et(b));return b}; ma.Object.defineProperties(ze.prototype,{diagram:{configurable:!0,get:function(){return this.D},set:function(a){this.D=a}},viewPoint:{configurable:!0,get:function(){return this.Ju},set:function(a){w(a,J,ze,"viewPoint");this.Ju.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.Zt},set:function(a){w(a,J,ze,"documentPoint");this.Zt.assign(a)}},modifiers:{configurable:!0,get:function(){return this.cs},set:function(a){this.cs= a}},button:{configurable:!0,get:function(){return this.Wq},set:function(a){this.Wq=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:{configurable:!0,get:function(){return this.Xq},set:function(a){this.Xq=a}},key:{configurable:!0,get:function(){return this.Rr},set:function(a){this.Rr=a}},down:{configurable:!0,get:function(){return this.nr},set:function(a){this.nr=a}},up:{configurable:!0, enumerable:!0,get:function(){return this.Ls},set:function(a){this.Ls=a}},clickCount:{configurable:!0,get:function(){return this.Zq},set:function(a){this.Zq=a}},delta:{configurable:!0,get:function(){return this.mr},set:function(a){this.mr=a}},isMultiTouch:{configurable:!0,get:function(){return this.Lr},set:function(a){this.Lr=a}},handled:{configurable:!0,get:function(){return this.Ar},set:function(a){this.Ar=a}},bubbles:{configurable:!0, get:function(){return this.Gg},set:function(a){this.Gg=a}},event:{configurable:!0,get:function(){return this.ur},set:function(a){this.ur=a}},isTouchEvent:{configurable:!0,get:function(){var a=pa.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=pa.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{configurable:!0,get:function(){return this.Js},set:function(a){this.Js=a}},targetDiagram:{configurable:!0, get:function(){return this.Is},set:function(a){this.Is=a}},targetObject:{configurable:!0,get:function(){return this.Sd},set:function(a){this.Sd=a}},control:{configurable:!0,get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{configurable:!0,get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{configurable:!0, get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{configurable:!0,get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{configurable:!0,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:{configurable:!0,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:{configurable:!0,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}}});ze.prototype.getMultiTouchDocumentPoint=ze.prototype.nz;ze.prototype.getMultiTouchViewPoint=ze.prototype.gq;ze.className="InputEvent";function Be(){this.D=null;this.Wa="";this.ns=this.Gs=null}Be.prototype.copy=function(){var a=new Be;a.D=this.D;a.Wa=this.Wa;a.Gs=this.Gs;a.ns=this.ns;return a}; Be.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(Be.prototype,{diagram:{configurable:!0,get:function(){return this.D},set:function(a){this.D=a}},name:{configurable:!0,get:function(){return this.Wa},set:function(a){this.Wa=a}},subject:{configurable:!0,get:function(){return this.Gs},set:function(a){this.Gs=a}},parameter:{configurable:!0,get:function(){return this.ns},set:function(a){this.ns=a}}});Be.className="DiagramEvent"; function Ce(){this.an=De;this.Ij=this.bs="";this.Ho=this.Io=this.No=this.Oo=this.Mo=this.D=this.ac=null}Ce.prototype.clear=function(){this.Ho=this.Io=this.No=this.Oo=this.Mo=this.D=this.ac=null}; Ce.prototype.copy=function(){var a=new Ce;a.an=this.an;a.bs=this.bs;a.Ij=this.Ij;a.ac=this.ac;a.D=this.D;a.Mo=this.Mo;var b=this.Oo;a.Oo=Fa(b)&&"function"===typeof b.J?b.J():b;b=this.No;a.No=Fa(b)&&"function"===typeof b.J?b.J():b;b=this.Io;a.Io=Fa(b)&&"function"===typeof b.J?b.J():b;b=this.Ho;a.Ho=Fa(b)&&"function"===typeof b.J?b.J():b;return a};Ce.prototype.hb=function(a){a.classType===Ce?this.change=a:Ba(this,a)}; Ce.prototype.toString=function(){var a="";a=this.change===Ee?a+"* ":this.change===De?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===Ee?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Pa(this.object)),null!==this.oldValue&&(a+=" old: "+Pa(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Pa(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};Ce.prototype.K=function(a){return a?this.oldValue:this.newValue};Ce.prototype.pz=function(a){return a?this.oldParam:this.newParam};Ce.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1};Ce.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.Wj(this,!0):null!==this.diagram&&this.diagram.Wj(this,!0))}; Ce.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};Ce.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.Wj(this,!1):null!==this.diagram&&this.diagram.Wj(this,!1))}; ma.Object.defineProperties(Ce.prototype,{model:{configurable:!0,get:function(){return this.ac},set:function(a){this.ac=a}},diagram:{configurable:!0,get:function(){return this.D},set:function(a){this.D=a}},change:{configurable:!0,get:function(){return this.an},set:function(a){F&&hb(a,Ce,Ce,"change");this.an=a}},modelChange:{configurable:!0,get:function(){return this.bs},set:function(a){F&&A(a,"string",Ce,"modelChange");this.bs=a}},propertyName:{configurable:!0, enumerable:!0,get:function(){return this.Ij},set:function(a){F&&"string"!==typeof a&&A(a,"function",Ce,"propertyName");this.Ij=a}},isTransactionFinished:{configurable:!0,get:function(){return this.an===Ee&&("CommittedTransaction"===this.Ij||"FinishedUndo"===this.Ij||"FinishedRedo"===this.Ij)}},object:{configurable:!0,get:function(){return this.Mo},set:function(a){this.Mo=a}},oldValue:{configurable:!0,get:function(){return this.Oo},set:function(a){this.Oo= a}},oldParam:{configurable:!0,get:function(){return this.No},set:function(a){this.No=a}},newValue:{configurable:!0,get:function(){return this.Io},set:function(a){this.Io=a}},newParam:{configurable:!0,get:function(){return this.Ho},set:function(a){this.Ho=a}}});Ce.prototype.redo=Ce.prototype.redo;Ce.prototype.canRedo=Ce.prototype.canRedo;Ce.prototype.undo=Ce.prototype.undo;Ce.prototype.canUndo=Ce.prototype.canUndo;Ce.prototype.getParam=Ce.prototype.pz; Ce.prototype.getValue=Ce.prototype.K;Ce.prototype.clear=Ce.prototype.clear;var Ee=new E(Ce,"Transaction",-1),De=new E(Ce,"Property",0),Fe=new E(Ce,"Insert",1),Ge=new E(Ce,"Remove",2);Ce.className="ChangedEvent";Ce.Transaction=Ee;Ce.Property=De;Ce.Insert=Fe;Ce.Remove=Ge;function He(){this.w=(new H).freeze();this.Wa="";this.l=!1} He.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0a.transactionLevel&&Da("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel;d&&b&&a.zb("CommittingTransaction",c,a.currentTransaction);var e=0;if(0a.historyIndex;e--)f=d.O(e),null!==f&&f.clear(),d.nb(e),a.ku=!0;e=a.maxHistoryLength;0<=e&&(0===e?d.clear():d.count>=e&&(f=d.O(0),null!==f&&f.clear(),d.nb(0),a.je--));0!==e&&(d.add(b),a.je++);d.freeze();f=b}a.zb("CommittedTransaction",c,f)}else{a.le=!0;try{a.isEnabled&&null!==f&&(f.isComplete=!0,f.undo())}finally{a.zb("RolledBackTransaction",c,f),a.le=!1}null!==f&&f.clear()}a.kr=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c= f.changes;for(b=c.count-1;b>=a;b--)d=c.O(b),null!==d&&d.undo(),c.ja(),c.nb(b);c.freeze()}return!1}Ie.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.fu&&(a=a.diagram,null!==a&&!1===a.Vi||Da("Change not within a transaction: "+c.toString()))}}; Ie.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;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(Ie.prototype,{models:{configurable:!0,get:function(){return this.qu.iterator}},isEnabled:{configurable:!0,get:function(){return this.Fc},set:function(a){this.Fc=a}},transactionToUndo:{configurable:!0,get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.O(this.historyIndex):null}},transactionToRedo:{configurable:!0,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(Ke.prototype,{diagram:{configurable:!0,get:function(){return this.D},set:function(a){a instanceof P&&(this.D=a)}},name:{configurable:!0,get:function(){return this.Wa},set:function(a){A(a,"string",Ke,"name");this.Wa=a}},isEnabled:{configurable:!0,get:function(){return this.Fc},set:function(a){A(a,"boolean",Ke,"isEnabled");this.Fc=a}},isActive:{configurable:!0,get:function(){return this.Wb},set:function(a){A(a,"boolean", Ke,"isActive");this.Wb=a}},transactionResult:{configurable:!0,get:function(){return this.Jq},set:function(a){null!==a&&A(a,"string",Ke,"transactionResult");this.Jq=a}}});Ke.prototype.stopTransaction=Ke.prototype.Bg;Ke.prototype.startTransaction=Ke.prototype.Ca;Ke.className="Tool";function Sa(){Ke.call(this);this.name="ToolManager";this.Nc=new H;this.Oc=new H;this.Cg=new H;this.ca=this.Ma=850;this.w=(new Ib(2,2)).ia();this.Xb=5E3;this.Na=Ue;this.L=We;this.jr=this.l=null;this.Pj=-1} la(Sa,Ke);Sa.prototype.initializeStandardTools=function(){};Sa.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Ve&&this.jr===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Sa.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Xe&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Ye){b.bubbles=!0;return}if(this.gestureBehavior===Xe)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;F&&c.checksTransactionLevel&&0!==c.transactionLevel&&Da("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");c=this.mouseDownTools.length; for(var 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 Df(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.gg;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Sf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Sf(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.Bx&&d.ba("LinkRelinked",c,d.Bx),c.toPort!==d.Cx&&d.ba("LinkRelinked",c,d.Cx)):Tf(e,g,f,k,h):Tf(e,null,null,null,null)}}}}cf.prototype.doDragOver=function(){}; function Uf(a,b){var c=a.diagram;a.dragsLink&&Of(a,!0);tf(a);var d=Pf(c,b,null,function(b){return!Hf(a,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;Vf(a,e,f);f=Qf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==ff){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!== ff){b=L.alloc();for(d=c.selection.iterator;d.next();)e=d.value,e instanceof V&&Wf(a,c,e,b);L.free(b)}}}function Vf(a,b,c){a=a.diagram;c instanceof T&&null===c.containingGroup&&!(c instanceof Rf)&&a.handlesDragDropForTopLevelParts&&(c=a.mouseDrop,null!==c&&c(b))} function Wf(a,b,c,d){var e=!1;c.getAvoidableRect(d);b.viewportBounds.qf(d)&&(e=!0);b=b.links;for(a=a.copiedParts||a.draggedParts;b.next();){var f=b.value;if(!e||Xf(f))a.contains(f)&&a.contains(c)||!f.Xd(c)&&f.isAvoiding&&nc(f.actualBounds,d,0)&&f.Ta()}}cf.prototype.doDropOnto=function(){}; cf.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,null,b.targetDiagram||null)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(a.currentCursor="copy",Df(this,!1),pf(a,this.copiedParts),Ff(this,this.copiedParts,!1),uf(a,this.copiedParts)):this.mayMove()?(a.currentCursor="",xf(this),Ff(this,this.draggedParts,!0)):this.mayDragOut()?(a.currentCursor="no-drop",Df(this,!1),Ff(this,this.copiedParts,!1)):xf(this),Nf(this, a.lastInput.documentPoint))}}; cf.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,null,b.documentPoint,b.targetDiagram)){var c=!1;(b=this.mayCopy())&&null!==this.copiedParts?(xf(this),Df(this,!0),pf(a,this.copiedParts),Ff(this,this.copiedParts,!1),uf(a,this.copiedParts),null!==this.copiedParts&&a.Pv(this.copiedParts.$d())):(c=!0,xf(this),this.mayMove()&&(Ff(this,this.draggedParts,!0),Nf(this,a.lastInput.documentPoint)));this.Dn=!0;Uf(this,a.lastInput.documentPoint); if(this.isActive){var d=b?this.copiedParts.$d():this.draggedParts.$d();this.copiedParts=null;if(c&&null!==this.draggedParts)for(c=this.draggedParts.iterator;c.next();){var e=c.key;e instanceof V&&(e=e.containingGroup,null===e||null===e.placeholder||this.draggedParts.contains(e)||e.placeholder.v())}a.Ya();uf(a,this.draggedParts);this.transactionResult=b?"Copy":"Move";a.ba(b?"SelectionCopied":"SelectionMoved",d)}this.stopTool()}}}; cf.prototype.simulatedMouseMove=function(a,b,c){if(null===ff)return!1;var d=ff.diagram;c instanceof P||(c=null);var e=qf;c!==e&&(null!==e&&e!==d&&(e.zf(),ff.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),qf=c,null!==c&&c!==d&&(Af(),e=c.toolManager.findTool("Dragging"),null!==e&&(vf.contains(e)||vf.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.tg(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.oa(Pc,J.alloc()),l=c.x-k.x,m=c.y-k.y;J.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.bq(b).count>=c)return!1}return!0}; $f.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.ud(b).count>=c)return!1}return!0}; $f.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};$f.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.ud(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; $f.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};$f.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 I;d.add(a);return bg(this,c,b,d)}; function bg(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),bg(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),bg(a,b.labeledLink,c,d))?!0:!1} $f.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!==cg){if(d===dg){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!eg(this,a,b,c,!0)}if(d===fg){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!eg(this,a,b,c,!0)}if(d===gg)return a===b?a=!0:(d=new I,d.add(b),a=hg(this,d,a,b,c)),!a;if(d===ig)return!eg(this,a,b,c,!1);if(d===jg)return a===b?a=!0:(d=new I,d.add(b),a=kg(this,d,a,b,c)),!a}return!0};function eg(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&&eg(a,g,c,d,e)))return!0}return!1} function hg(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&&hg(a,b,g,d,e)))return!0}return!1}function kg(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&&kg(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties($f.prototype,{portGravity:{configurable:!0,get:function(){return this.Cg},set:function(a){A(a,"number",$f,"portGravity");0<=a&&(this.Cg=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.ca},set:function(a){A(a,"boolean",$f,"isUnconnectedLinkValid");this.ca=a}},temporaryLink:{configurable:!0,get:function(){return this.Mm},set:function(a){w(a,S,$f,"temporaryLink");this.Mm=a}},temporaryFromNode:{configurable:!0, enumerable:!0,get:function(){return this.Km},set:function(a){w(a,V,$f,"temporaryFromNode");this.Km=a}},temporaryFromPort:{configurable:!0,get:function(){return this.Lm},set:function(a){w(a,N,$f,"temporaryFromPort");this.Lm=a}},temporaryToNode:{configurable:!0,get:function(){return this.Hq},set:function(a){w(a,V,$f,"temporaryToNode");this.Hq=a}},temporaryToPort:{configurable:!0,get:function(){return this.Iq},set:function(a){w(a,N,$f,"temporaryToPort");this.Iq= a}},originalLink:{configurable:!0,get:function(){return this.Xb},set:function(a){null!==a&&w(a,S,$f,"originalLink");this.Xb=a}},originalFromNode:{configurable:!0,get:function(){return this.Ma},set:function(a){null!==a&&w(a,V,$f,"originalFromNode");this.Ma=a}},originalFromPort:{configurable:!0,get:function(){return this.Na},set:function(a){null!==a&&w(a,N,$f,"originalFromPort");this.Na=a}},originalToNode:{configurable:!0,get:function(){return this.Nc}, set:function(a){null!==a&&w(a,V,$f,"originalToNode");this.Nc=a}},originalToPort:{configurable:!0,get:function(){return this.Oc},set:function(a){null!==a&&w(a,N,$f,"originalToPort");this.Oc=a}},isForwards:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"boolean",$f,"isForwards");this.L=a}},validPortsCache:{configurable:!0,get:function(){return this.Xx}},targetPort:{configurable:!0,get:function(){return this.Jm},set:function(a){null!== a&&w(a,N,$f,"targetPort");this.Jm=a}},linkValidation:{configurable:!0,get:function(){return this.mi},set:function(a){null!==a&&A(a,"function",$f,"linkValidation");this.mi=a}},portTargeted:{configurable:!0,get:function(){return this.Im},set:function(a){null!==a&&A(a,"function",$f,"portTargeted");this.Im=a}}});$f.className="LinkingBaseTool";function lg(){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 W)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};Mg.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}; Mg.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.Al.set(this.adornedObject.oa(this.handle.alignment.Av())),this.Qo.set(this.adornedObject.part.location),this.Mw.set(this.adornedObject.desiredSize),this.bu=this.computeCellSize(),this.du=this.computeMinSize(),this.cu=this.computeMaxSize(),a.isMouseCaptured= !0,this.Jw=a.animationManager.isEnabled,a.animationManager.isEnabled=!1,this.Ca(this.name),this.isActive=!0))};Mg.prototype.doDeactivate=function(){var a=this.diagram;this.Bg();this.ce=this.handle=null;this.isActive=a.isMouseCaptured=!1;a.animationManager.isEnabled=this.Jw};Mg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; Mg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.du,c=this.cu,d=this.bu,e=this.adornedObject.bt(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.hd();J.free(e)}}; Mg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.du,c=this.cu,d=this.bu,e=this.adornedObject.bt(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);J.free(e);a.Ya();this.transactionResult=this.name;a.ba("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; Mg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject,d=c.part;c.desiredSize=a.size;d.bc();a=this.adornedObject.oa(this.handle.alignment.Av());d instanceof Rf?(c=new H,c.add(d),b.moveParts(c,this.Al.copy().Zd(a),!0)):d.location=d.location.copy().Zd(a).add(this.Al)}; Mg.prototype.computeResize=function(a,b,c,d,e,f){b.Nb()&&(b=Pc);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=J.alloc();K.cq(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)));J.free(p);return a};Mg.prototype.computeReshape=function(){var a=Pg;this.adornedObject instanceof ag&&(a=Qg(this.adornedObject));return!(a===Rg||this.diagram.lastInput.shift)}; Mg.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};Mg.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.oa(b)};Sg.prototype.doDeactivate=function(){var a=this.diagram;this.Bg();this.ce=this.handle=null;this.xu=new J(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Sg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};Sg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))}; Sg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Ya();this.transactionResult=this.name;a.ba("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Sg.prototype.rotate=function(a){F&&C(a,Sg,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.bc();var c=b.locationObject,d=b.rotateObject;if(c===d||c.wg(d))c=this.Qo.copy(),b.location=c.Zd(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)}}; Sg.prototype.computeRotate=function(a){a=this.rotationPoint.Xa(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.Pi());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(Sg.prototype,{handleArchetype:{configurable:!0,get:function(){return this.w},set:function(a){null!==a&&w(a,N,Sg,"handleArchetype");this.w=a}},handle:{configurable:!0,get:function(){return this.l},set:function(a){if(null!==a&&(w(a,N,Sg,"handle"),!(a.part instanceof Ve)))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{configurable:!0,get:function(){return this.ce},set:function(a){if(null!==a&&(w(a,N, Sg,"handle"),a.part instanceof Ve))throw Error("new handle must not be in an Adornment: "+a);this.ce=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.Na},set:function(a){A(a,"number",Sg,"snapAngleMultiple");this.Na=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.Ma},set:function(a){A(a,"number",Sg,"snapAngleEpsilon");this.Ma=a}},originalAngle:{configurable:!0,get:function(){return this.Lw}},rotationPoint:{configurable:!0, enumerable:!0,get:function(){return this.xu}},handleAngle:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"number",Sg,"handleAngle");this.L=a}},handleDistance:{configurable:!0,get:function(){return this.ca},set:function(a){A(a,"number",Sg,"handleDistance");this.ca=a}}});Sg.className="RotatingTool";Ra("rotatingTool",function(){return this.findTool("Rotating")},function(a){af(this,"Rotating",a,this.mouseDownTools)}); function Tg(){Ke.call(this);0e.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};kh.prototype.doStart=function(){this.isActive||null===this.textBlock||this.doActivate()}; kh.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.Tb(a.lastInput.documentPoint));if(null!==b&&b instanceof lh&&(this.textBlock=b,null!==b.part)){this.isActive=!0;this.na=rh;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.mh=this.textBlock.copy();var d=new L(this.textBlock.oa(Jc),this.textBlock.oa(Tc));a.Ov(d);c.show(b,a,this);this.currentTextEditor=c}}}};kh.prototype.doCancel=function(){this.stopTool()}; kh.prototype.doMouseUp=function(){!this.isActive&&this.canStart()&&this.doActivate()};kh.prototype.doMouseDown=function(){this.isActive&&this.acceptText(vh)}; kh.prototype.acceptText=function(a){switch(a){case vh:if(this.na===wh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.na===rh||this.na===th||this.na===sh)this.na=xh,yh(this);break;case zh:case ph:case qh:if(ph!==a||!0!==this.textBlock.isMultiline)if(this.na===rh||this.na===th||this.na===sh)this.na=xh,yh(this)}}; function yh(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());a.isValidText(b,e,f)?(a.Ca(a.name),a.na=wh,a.transactionResult=a.name,b.text=f,null!==b.textEdited&&b.textEdited(b,e,f),null!==c&&c.ba("TextEdited",b,e),a.Bg(),a.stopTool(),null!==c&&c.doFocus()):(a.na=th,null!==b.errorFunction&&b.errorFunction(a,e,f),d.show(b,c,a))}} kh.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.na=nh,this.textBlock=null,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.isActive=!1)};kh.prototype.isValidText=function(a,b,c){w(a,lh,kh,"isValidText:textblock");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};kh.prototype.Ax=function(a){var b=this.mh;b.text=a;b.measure(this.textBlock.pl,Infinity);return b}; ma.Object.defineProperties(kh.prototype,{textBlock:{configurable:!0,get:function(){return this.Na},set:function(a){null!==a&&w(a,lh,kh,"textBlock");this.Na=a}},currentTextEditor:{configurable:!0,get:function(){return this.w},set:function(a){this.w=a}},defaultTextEditor:{configurable:!0,get:function(){return this.l},set:function(a){!F||a instanceof $e||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.l=a}},starting:{configurable:!0, get:function(){return this.Ma},set:function(a){hb(a,kh,kh,"starting");this.Ma=a}},textValidation:{configurable:!0,get:function(){return this.Ai},set:function(a){null!==a&&A(a,"function",kh,"textValidation");this.Ai=a}},minimumEditorScale:{configurable:!0,get:function(){return this.L},set:function(a){null!==a&&A(a,"number",kh,"minimumEditorScale");this.L=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.ca},set:function(a){null!==a&&A(a, "boolean",kh,"selectsTextOnActivate");this.ca=a}},state:{configurable:!0,get:function(){return this.na},set:function(a){this.na!==a&&(hb(a,kh,kh,"starting"),this.na=a)}}});kh.prototype.measureTemporaryTextBlock=kh.prototype.Ax; var zh=new E(kh,"LostFocus",0),vh=new E(kh,"MouseDown",1),qh=new E(kh,"Tab",2),ph=new E(kh,"Enter",3),Ih=new E(kh,"SingleClick",0),mh=new E(kh,"SingleClickSelected",1),uh=new E(kh,"DoubleClick",2),nh=new E(kh,"StateNone",0),rh=new E(kh,"StateActive",1),sh=new E(kh,"StateEditing",2),xh=new E(kh,"StateValidating",3),th=new E(kh,"StateInvalid",4),wh=new E(kh,"StateValidated",5);kh.className="TextEditingTool";kh.LostFocus=zh;kh.MouseDown=vh;kh.Tab=qh;kh.Enter=ph;kh.SingleClick=Ih; kh.SingleClickSelected=mh;kh.DoubleClick=uh;kh.StateNone=nh;kh.StateActive=rh;kh.StateEditing=sh;kh.StateValidating=xh;kh.StateInvalid=th;kh.StateValidated=wh;Ra("textEditingTool",function(){return this.findTool("TextEditing")},function(a){af(this,"TextEditing",a,this.mouseUpTools)}); function Jh(){Kh||(Lh(),Kh=!0);this.vw=Mh;this.D=Re;this.wn=this.xn=null;this.dj=this.yn=this.zn=0;this.Gk=this.ri=this.sb=this.Or=this.Pf=!1;this.Qf=this.Fc=!0;this.gr=this.fr=this.uw=null;this.tw=0;this.ir=new Db;this.au=600;this.ay=new J(0,0);this.rw=this.qw=this.Sw=!1;this.de=new I;this.Cj=new Db;this.js=new I;this.hr=null}function Nh(a){a.dj=0;a.ir.clear();a.gr=null;a.fr=null;a.xn=null;a.wn=null;a.zn=0;a.yn=0;a.Cj.clear();0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Oh(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}Jh.prototype.canStart=function(){return!0};t=Jh.prototype;t.Eh=function(a,b){this.Fc&&(void 0!==b&&(this.hr=b),(this.Qf||this.D.Vi)&&this.canStart(a)&&(this.de.add(a),this.Pf&&this.xd(),this.ri=this.sb=!0))}; t.Tz=function(a,b){this.Fc&&(void 0!==b&&(this.hr=b),this.Qf||this.D.Vi)&&(this.de.add(a),this.canStart(a)&&(this.Pf&&this.xd(),this.sb=!0))};function Ph(a){if(a.Fc)if(a.de.contains("Model")&&!a.Qf||!a.Gk)a.de.clear(),a.sb=!1,a.ri=!1,Nh(a);else if(a.de.clear(),a.sb&&0===a.dj){var b=+new Date;a.dj=b;pa.requestAnimationFrame(function(){if(!1!==a.sb&&!a.Pf&&a.dj===b){var c=a.D;c.He("temporaryPixelRatio")&&of(c);Qh(c);a.sb=!1;a.ri=!1;c.ba("AnimationStarting");Rh(a,b)}})}} t.uh=function(a,b,c,d,e,f){if(!(!this.sb||(F&&w(a,N,Jh,"addToAnimation:obj"),"position"===b&&c.A(d))||a instanceof T&&!a.isAnimated)){var g=this.Cj;if(g.contains(a)){var h=g.K(a);g=h.start;var k=h.end;void 0===g[b]&&(g[b]=Sh(c));k[b]=Sh(d)}else h={},k={},h[b]=Sh(c),k[b]=Sh(d),d=h.position,d instanceof J&&!d.o()&&this.de.contains("Expand SubGraph")&&d.assign(k.position),h=new Th(h,k,e),g.add(a,h);e&&0===b.indexOf("position:")&&a instanceof T?h.dv.location=Sh(a.location):e&&(h.dv[b]=Sh(c));f&&(h.vt= !0);this.Gk=!0}};function Sh(a){return a instanceof J?a.copy():a instanceof Ib?a.copy():a}function Uh(a,b){if(!a.Pf)return!1;a=a.Cj.K(b);return null!==a&&a.vt} function Rh(a,b){function c(){if(!1!==e.Pf&&e.dj===b){var a=+new Date,f=a>q?l:a-r;Vh(e);Wh(e,d,p,g,f,l);e.fr&&e.fr();Yf(d);Xh(e);a>q?Yh(e):pa.requestAnimationFrame(c)}}var d=a.D;if(null!==d){var e=a,f=a.hr||{},g=f.Qy||a.vw,h=f.uA||null,k=f.vA||null,l=f.duration||a.au,m=a.ay;for(f=a.Cj.iterator;f.next();){var n=f.value.start.position;n instanceof J&&(n.o()||n.assign(m))}a.uw=g;a.fr=h;a.gr=k;a.tw=l;a.ir=a.Cj;var p=a.ir;for(f=p.iterator;f.next();)h=f.value.end,h["position:placeholder"]&&(k=f.key.findVisibleNode(), k instanceof Rf&&null!==k.placeholder&&(m=k.placeholder,k=m.oa(Jc),m=m.padding,k.x+=m.left,k.y+=m.top,h["position:placeholder"]=k));a.Pf=!0;Vh(a);Wh(a,d,p,g,0,l);Yf(a.D,!0);Xh(a);var r=+new Date,q=r+l;e.dj===b&&pa.requestAnimationFrame(function(){c()})}}function Vh(a){if(!a.Or){var b=a.D;a.Sw=b.skipsUndoManager;a.qw=b.skipsModelSourceBindings;a.rw=b.wk;b.skipsUndoManager=!0;b.skipsModelSourceBindings=!0;b.wk=!0;a.Or=!0}} function Xh(a){var b=a.D;b.skipsUndoManager=a.Sw;b.skipsModelSourceBindings=a.qw;b.wk=a.rw;a.Or=!1}function Wh(a,b,c,d,e,f){for(c=c.iterator;c.next();){var g=c.key,h=c.value,k=h.start,l=h.end,m=Zh;for(n in l)"position"===n&&(l["position:placeholder"]||l["position:node"])||null===m.get(n)||m.get(n)(g,k[n],l[n],d,e,f,h)}d=b.tv;b.tv=!0;var n=a.vw;0!==a.zn&&0!==a.yn&&(c=a.zn,b.Da=n(e,c,a.yn-c,f));null!==a.xn&&null!==a.wn&&(c=a.xn,a=a.wn,b.ua=new J(n(e,c.x,a.x-c.x,f),n(e,c.y,a.y-c.y,f)));b.tv=d} t.xd=function(){!0===this.sb&&(this.ri=this.sb=!1,this.de.clear(),this.dj=0,this.Gk&&this.D.ec());this.Pf&&this.Fc&&Yh(this)}; function Yh(a){a.Pf=!1;a.Gk=!1;Vh(a);for(var b=a.D,c=a.uw,d=a.tw,e=a.ir,f=a.js.iterator;f.next();)f.value.v();e=e.iterator;for(f=Zh;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.dv,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Xu||"position:node"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]:h.Xu?k[n]:l[n],c,d,d)}h.Xu&&void 0!==m.location&&g instanceof T&&(g.location=m.location);h.vt&&g instanceof T&&g.Ob(!1)}for(c=a.D.links;c.next();)d=c.value,null!==d.eh&& (d.points=d.eh,d.eh=null);b.mt.clear();yf(b,!1);b.Ya();b.S();b.hd();$h(b);Xh(a);a.gr&&a.gr();Nh(a);b.ba("AnimationFinished");b.ec()} t.Sp=function(a,b){if(this.ri&&(this.de.contains("Expand Tree")||this.de.contains("Expand SubGraph"))){var c=b.actualBounds,d=null;b instanceof Rf&&(d=b.placeholder);null!==d?(c=d.oa(Jc),d=d.padding,c.x+=d.left,c.y+=d.top,this.uh(a,"position",c,a.position,!1)):this.uh(a,"position",new J(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.uh(a,"scale",.01,a.scale,!1);if(a instanceof Rf)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Sp(d,b)}}; t.Rp=function(a,b){if(a.isVisible()&&this.ri&&(this.de.contains("Collapse Tree")||this.de.contains("Collapse SubGraph"))){var c=null;b instanceof Rf&&(c=b.placeholder);null!==c?this.uh(a,"position:placeholder",a.position,c,!0):this.uh(a,"position:node",a.position,b,!0);this.uh(a,"scale",a.scale,.01,!0);this.sb&&(c=this.Cj,c.contains(a)&&(c.K(a).vt=!0));if(a instanceof Rf)for(a=a.memberParts;a.next();)c=a.value,c instanceof V&&this.Rp(c,b)}}; function ai(a,b,c){a.sb&&!b.A(c)&&(null===a.xn&&b.o()&&null===a.wn&&(a.xn=b.copy()),a.wn=c.copy(),a.Gk=!0)}function bi(a,b,c){a.sb&&a.D.Vi&&(0===a.zn&&0===a.yn&&(a.zn=b),a.yn=c,a.Gk=!0)} function Lh(){var a=new Db;a.add("position",function(a,c,d,e,f,g){f!==g?a.Ct(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g)):a.position=new J(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g))});a.add("position:placeholder",function(a,c,d,e,f,g){f!==g?a.Ct(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g)):a.position=new J(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g))});a.add("position:node",function(a,c,d,e,f,g){var b=a.actualBounds,k=d.actualBounds;d=k.x+k.width/2-b.width/2;b=k.y+k.height/2-b.height/2;f!==g?a.Ct(e(f,c.x,d-c.x,g),e(f, c.y,b-c.y,g)):a.position=new J(e(f,c.x,d-c.x,g),e(f,c.y,b-c.y,g))});a.add("opacity",function(a,c,d,e,f,g){a.opacity=e(f,c,d-c,g)});a.add("scale",function(a,c,d,e,f,g){a.scale=e(f,c,d-c,g)});a.add("angle",function(a,c,d,e,f,g){a.angle=e(f,c,d-c,g)});a.add("visible",function(a,c,d,e,f,g){a.visible=f!==g?c:d});Zh=a} ma.Object.defineProperties(Jh.prototype,{animationReasons:{configurable:!0,get:function(){return this.de}},isEnabled:{configurable:!0,get:function(){return this.Fc},set:function(a){A(a,"boolean",Jh,"isEnabled");this.Fc=a}},duration:{configurable:!0,get:function(){return this.au},set:function(a){A(a,"number",Jh,"duration");1>a&&ya(a,">= 1",Jh,"duration");this.au=a}},isAnimating:{configurable:!0,get:function(){return this.Pf}},isTicking:{configurable:!0, enumerable:!0,get:function(){return this.Or}},isInitial:{configurable:!0,get:function(){return this.Qf},set:function(a){A(a,"boolean",Jh,"isInitial");this.Qf=a}}});Jh.prototype.stopAnimation=Jh.prototype.xd;Jh.prototype.addToAnimation=Jh.prototype.uh;Jh.prototype.prepareAnimation=Jh.prototype.Tz;Jh.prototype.prepareAutomaticAnimation=Jh.prototype.Eh;var Zh=null,Kh=!1;Jh.className="AnimationManager";function Th(a,b,c){this.start=a;this.end=b;this.dv={};this.Xu=c;this.vt=!1} Th.className="AnimationStates";function ci(){0=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ga.iterator;h.next();){var k=h.value;k instanceof Rf?e++:k instanceof V?d++:k instanceof S?f++:k instanceof Ve?g++:c++}h="";0b.re||k.height*f>b.re?h.jc(a,b):fi(a,h)}}a.globalAlpha=1}}}; function fi(a,b){var c=b.actualBounds,d=b.naturalBounds;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&b.isVisible()){var e=b.transform;null!==b.areaBackground&&(gi(b,a,b.areaBackground,!0,!0,d,c),a.fillRect(c.x,c.y,c.width,c.height));null===b.areaBackground&&null===b.background&&(gi(b,a,"rgba(0,0,0,0.3)",!0,!1,d,c),a.fillRect(c.x,c.y,c.width,c.height));null!==b.background&&(a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),gi(b,a,b.background,!0,!1,d,c),a.fillRect(0,0,d.width/2,d.height/2), e.jt()||(b=1/(e.m11*e.m22-e.m12*e.m21),a.transform(e.m22*b,-e.m12*b,-e.m21*b,e.m11*b,b*(e.m21*e.dy-e.m22*e.dx),b*(e.m12*e.dx-e.m11*e.dy))))}}t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.cb(De,a,this,b,c,d,e)};t.Ti=function(a,b,c){var d=this.Ga;b.ji=this;if(a>=d.count)a=d.count;else if(d.O(a)===b)return-1;d.Lb(a,b);b.iq(c);d=this.diagram;null!==d&&(c?d.S():d.Ti(b));hi(this,a,b);return a}; t.zc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.zc(a,b,c);var d=this.Ga;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.O(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.jq(c);d.nb(a);d=this.diagram;null!==d&&(c?d.S():d.zc(b));b.ji=null;return a}; function hi(a,b,c){b=ii(a,b,c);if(c instanceof Rf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ga.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.O(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.nb(b);a.Lb(f,c);return f}for(g=NaN;0<=--f&&(g=a.O(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.nb(b);a.Lb(h,c);return h}for(k=NaN;++h< e&&(k=a.O(h).zOrder,isNaN(k)););}return b}t.clear=function(){for(var a=this.Ga.Oa(),b=a.length,c=0;ca||1=a)return b;for(var c=this.Ra.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};P.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,d)}; P.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,d)}; function Ei(a){var b=a.Ea.Ha;b instanceof HTMLCanvasElement&&(a.Tq?(a.addEventListener(b,"pointerdown",a.om,!1),a.addEventListener(b,"pointermove",a.pm,!1),a.addEventListener(b,"pointerup",a.rm,!1),a.addEventListener(b,"pointerout",a.qm,!1)):(a.addEventListener(b,"touchstart",a.bw,!1),a.addEventListener(b,"touchmove",a.aw,!1),a.addEventListener(b,"touchend",a.$v,!1),a.addEventListener(b,"mousemove",a.nk,!1),a.addEventListener(b,"mousedown",a.mk,!1),a.addEventListener(b,"mouseup",a.qk,!1),a.addEventListener(b, "mouseout",a.pk,!1)),a.addEventListener(b,"mouseenter",a.Ly,!1),a.addEventListener(b,"mouseleave",a.My,!1),a.addEventListener(b,"wheel",a.rk,!1),a.addEventListener(b,"keydown",a.Gz,!1),a.addEventListener(b,"keyup",a.Hz,!1),a.addEventListener(b,"blur",a.yy,!1),a.addEventListener(b,"focus",a.zy,!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!== Ye&&(a.toolManager.gestureBehavior===Xe?b.preventDefault():a.Ue&&a.lastInput.handled||(b.preventDefault(),a.Po=a.scale,a.currentTool.doCancel()))},!1),a.addEventListener(b,"gesturechange",function(b){if(a.toolManager.gestureBehavior!==Ye)if(a.toolManager.gestureBehavior===Xe)b.preventDefault();else if(!a.Ue||!a.lastInput.handled){b.preventDefault();var c=b.scale;if(null!==a.Po){var e=a.Ea.getBoundingClientRect();b=new J(b.pageX-window.scrollX-a.Aa/e.width*e.left,b.pageY-window.scrollY-a.ya/e.height* e.top);c=a.Po*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(pa,"resize",a.hw,!1))}function of(a){30p&&(this.position=q.h(-(this.xs.scrollWidth-this.Aa)+u-this.Aa/c+k,this.position.y))),a.gy&&this.allowVerticalScroll&&(fr&&(this.position=q.h(this.position.x, -(this.xs.scrollHeight-this.ya)+a.scrollTop-this.ya/c+d))),J.free(q),Qi(this),this.pj=this.vs=!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.np.style.width="1px"),n>=h&&f>=b&&d<=r&&(this.np.style.height="1px"))}};P.prototype.computeBounds=function(){0c&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===Yi?(b=k>h?(g-a.Jb)/d:(f-a.Jb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} P.prototype.zoomToFit=function(){var a=this.Lj;this.Lj=li;this.scale=Ui(this,Xi);a!==li&&(Ti(this,!1),Vi(this,this.documentBounds,this.Aa/this.Da,this.ya/this.Da,this.hj,!1));this.Lj=a};t=P.prototype; t.mA=function(a,b){void 0===b&&(b=Xi);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Xi||b===Yi)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Aa;var f=this.ya;e=b===Yi?f/d>e/c?(f-(this.Tg?this.Jb:0))/d:(e-(this.ci?this.Jb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new J(a.x,a.y)}}; t.sy=function(a,b){this.Ug&&Wi(this,this.computeBounds());var c=this.documentBounds,d=this.viewportBounds;this.position=new J(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; function Vi(a,b,c,d,e,f){a.ua.ja();var g=a.ua,h=g.x,k=g.y;if(f||a.scrollMode===li)e.Za()&&(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.wi,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.Bl[0])b=a.Bl[c];else return;c=a.Ea;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.Aa/c.width*c.left,b.clientY-a.ya/c.height*c.top))}t=P.prototype;t.Ya=function(){this.Ug||(this.Ug=!0,this.ec(!0))};function $h(a){a.$b||Ri(a);a.Ug&&Wi(a,a.computeBounds())}t.wf=function(){this.pb||this.$b||(this.S(),ij(this),Qi(this),this.Ya(),this.hd())};t.Fz=function(){return this.sd}; t.Gy=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.xd();b.isEnabled=!1;Yf(this);this.ke=!1;b.isEnabled=c;null!==a&&ta(a,1)};t.ec=function(a){void 0===a&&(a=!1);if(!0!==this.sd&&!(this.pb||!1===a&&this.$b)){this.sd=!0;var b=this;pa.requestAnimationFrame(function(){b.sd&&b.hd()})}};t.hd=function(){if(!this.cl||this.sd)this.cl&&(this.cl=!1),Yf(this)};function jj(a,b){a.animationManager.isAnimating||a.pb||!a.pj||Oi(a)||(b&&Ri(a),Ti(a,!1))} function Yf(a,b){if(!a.$b&&(a.sd=!1,null!==a.Ja||a.Mp.o())){a.$b=!0;var c=a.animationManager,d=a.tu;if(!c.isTicking&&0!==d.length){for(var e=d.j,f=e.length,g=0;gb;b++){var c=a.Fd.iterator;if(null===c||0===a.Fd.count)break;a.Fd=new I;a.gw(c,a.Fd);F&&22===b&&Da("failure to validate parts")}a.nodes.each(function(a){a instanceof Rf&&0!==(a.T&65536)!==!1&&(a.T=a.T^65536)})}} t.gw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.dc()||c instanceof Rf||(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof Rf&&c.isVisible()&&oj(this,c);for(a.reset();a.next();)c=a.value,c instanceof S&&c.isVisible()&&(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Ve&&c.isVisible()&&(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function oj(a,b){for(var c=La(),d=La(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof Rf?(pj(f)||qj(f)||rj(f))&&oj(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;eh.re||m.height*g>h.re?l.jc(a, h):fi(a,l)}}a.globalAlpha=1}}}:function(b){b.jc(a,h)};tj(this,a);g=f.length;for(m=0;ma.re||l.height*f>a.re?h.jc(b,a):fi(b,h)}}b.globalAlpha=1}}}}else if(!k&&l){var G=a.grid.part,O=G.layer;D=function(c){c===O?G.jc(b,a):c.jc(b,a,k)}}else D=function(c){c.jc(b,a,k)};for(c=0;cthis.re||y.height*p>this.re?u.jc(f,this):fi(f,u))}f.globalAlpha=1}f.restore();f.Uc(!0);F&&(F.bv||F.Hi)&&F.Zp&&F.Zp(f,this,l);this.di&&uj(this.di,this)&&this.qr();this.oc=this.fi=!1;this.ut()}Na(e);Na(a);this.$b=!1}}else this.hd();L.free(d);c&&(of(this),this.hd(),yf(this,!0))}else c?(of(this),this.hd(),yf(this,!0)):this.hd()}};function ij(a){!1===a.pj&&(a.pj=!0)}function Qi(a){!1===a.fi&&(a.fi=!0)} function sj(a){!1!==a.Un&&(a.Un=!1,Bj(a,a.Aa,a.ya))}function Bj(a,b,c){var d=a.Pb;a.Ea.resize(b*d,c*d,b,c)&&(a.oc=!0,a.$c.Uc(!0))} function Oi(a){var b=a.Ea;if(null===b)return!0;var c=a.Ja,d=a.Aa,e=a.ya,f=a.Tw.copy();if(!f.o())return!0;var g=!1,h=a.ci?a.Jb:0,k=a.Tg?a.Jb:0,l=c.clientWidth||d+h;c=c.clientHeight||e+k;if(l!==d+h||c!==e+k)a.ci=!1,a.Tg=!1,k=h=0,a.Aa=l,a.ya=c,g=a.Un=!0;a.pj=!1;var m=a.viewportBounds,n=a.documentBounds,p=0,r=0,q=0,u=0;l=m.width;c=m.height;var x=a.wi;a.contentAlignment.Za()?(n.width>l&&(p=x.left,r=x.right),n.height>c&&(q=x.top,u=x.bottom)):(p=x.left,r=x.right,q=x.top,u=x.bottom);x=n.width+p+r;var y=n.height+ q+u;p=n.x-p;var z=m.x;r=n.right+r;var B=m.right+h;q=n.y-q;var D=m.y;n=n.bottom+u;u=m.bottom+k;var G="1px",O="1px";m=a.scale;var Q=!(xB+1&&(G=Math.max((r-B)*m+a.Aa,G)),l+h+1u+1&&(O=Math.max((n-u)*m+a.ya,O)),c+k+ 1B+1&&(h=Math.max((r-B)*m+a.Aa,h)),l+1u+1&&(k=Math.max((n-u)*m+h,k)),c+ 1B+1&&(k=a.position.x*m));if(a.Yn)switch(a.yu){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(c+1u+1&&(b.scrollTop=a.position.y*m));l=a.Aa;c=a.ya;b.style.width= l+(a.ci?a.Jb:0)+"px";b.style.height=c+(a.Tg?a.Jb:0)+"px";return d!==l||e!==c||a.animationManager.sb?(a.tq(f,a.viewportBounds,m,g),!1):!0} t.add=function(a){w(a,T,P,"add:part");var b=a.diagram;if(b!==this&&(null!==b&&v("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.em(a.layerName),null===b&&(b=this.em("")),null===b&&v('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.Ti(99999999,a,a.diagram===this);0<=c&&this.cb(Fe,"parts",b,null,a,null,c);b.isTemporary||this.Ya();a.C(1);c=a.layerChanged;null!==c&&c(a,null, b)}};t.Ti=function(a){this.partManager.Ti(a);var b=this;Cj(a,function(a){Dj(b,a)});(a instanceof Ve||a instanceof Rf&&null!==a.placeholder)&&a.v();null!==a.data&&Cj(a,function(a){Ej(b.partManager,a)});!0!==qj(a)&&!0!==rj(a)||this.Fd.add(a);Fj(a,!0,this);Gj(a)?(a.actualBounds.o()&&this.S(Aj(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.o()&&this.S(Aj(a,a.actualBounds));this.ec()}; t.zc=function(a){a.Xj();this.partManager.zc(a);var b=this;null!==a.data&&Cj(a,function(a){Hj(b.partManager,a,b)});this.Fd.remove(a);Gj(a)?(a.actualBounds.o()&&this.S(Aj(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.o()&&this.S(Aj(a,a.actualBounds));this.ec()};t.remove=function(a){w(a,T,P,"remove:part");Ij(this,a,!0)}; function Ij(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.C(2),c&&b.ck(),c=d.zc(-1,b,!1),0<=c&&a.cb(Ge,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.xt=function(a,b){if(Ga(a))for(var c=a.length,d=0;dd&&this.Ya()}; t.my=function(a,b){Oj(this,a,b);a.ib(this);var c=this.Ra,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ac&&this.cb(Ge,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Ya()}; t.Xz=function(a){w(a,ci,P,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Ra,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ga.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.ac&&this.cb(Ge,"layers",this,a,null,c,null);this.S();this.Ya()}}};t.em=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.Zw=function(a){A(a,"function",P,"addModelChangedListener:listener");null===this.se&&(this.se=new H);this.se.add(a);this.model.th(a)};t.Zz=function(a){A(a,"function",P,"removeModelChangedListener:listener");null!==this.se&&(this.se.remove(a),0===this.se.count&&(this.se=null));this.model.uk(a)};t.th=function(a){A(a,"function",P,"addChangedListener:listener");null===this.Ef&&(this.Ef=new H);this.Ef.add(a)}; t.uk=function(a){A(a,"function",P,"removeChangedListener:listener");null!==this.Ef&&(this.Ef.remove(a),0===this.Ef.count&&(this.Ef=null))};t.Rs=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.pv(a);a.change!==Ee&&(this.isModified=!0);if(null!==this.Ef)for(var b=this.Ef,c=b.length,d=0;dp.Ga.indexOf(q)&&p.Ti(r,q,u):(q.isSelected=!1,q.isHighlighted=!1,q.Mb(),p.zc(u?r:-1,q,u)))}else p instanceof P?"number"===typeof r&&q instanceof ci&&(b?(q.ib(this),this.Ra.Lb(r,q)):this.Ra.nb(r)):v("unknown ChangedEvent.Remove object: "+ a.toString());this.isModified=!0}else d!==Ee&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=c}}};t.Ca=function(a){return this.undoManager.Ca(a)};t.ab=function(a){return this.undoManager.ab(a)};t.yf=function(){return this.undoManager.yf()}; P.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ca(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.ab(b):this.undoManager.yf(),this.skipsUndoManager=c}};P.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)};t=P.prototype;t.Eq=function(){this.partManager.Eq()}; function Rj(a,b,c){var d=a.animationManager;if(a.pb||a.$b)a.Da=c,bi(d,b,a.Da);else if(a.pb=!0,null===a.Ea)a.Da=c;else{var e=a.viewportBounds.copy(),f=a.Aa,g=a.ya;e.width=a.Aa/b;e.height=a.ya/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.uf()?l.tf(Vc)?h=0:l.tf(Xc)&&(h=f-1):h=l.Za()?l.x*(f-1):f/2);isNaN(k)&&(l.uf()?l.tf(Uc)?k=0:l.tf(Yc)&&(k=g-1):k=l.Za()?l.y*(g-1):g/2);null!==a.scaleComputation&&(c=a.scaleComputation(a,c));ca.maxScale&&(c=a.maxScale); f=J.allocAt(a.ua.x+h/b-h/c,a.ua.y+k/b-k/c);a.position=f;J.free(f);a.Da=c;a.tq(e,a.viewportBounds,b,!1);a.pb=!1;Ti(a,!1);bi(d,b,a.Da);a.S();ij(a)}} t.tq=function(a,b,c,d){if(!a.A(b)){void 0===d&&(d=!1);d||ij(this);Qi(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==mi||d||a.width===b.width&&a.height===b.height||e.C();e=this.currentTool;!0===this.Te&&e instanceof Sa&&(this.lastInput.documentPoint=this.Et(this.lastInput.viewPoint),Ze(e,this));this.pb||this.vx(a,b);lj(this);this.Be.scale=c;this.Be.position.x=a.x;this.Be.position.y=a.y;this.Be.bounds.assign(a);this.Be.xx=d;this.ba("ViewportBoundsChanged",this.Be,a);this.isVirtualized&& this.links.each(function(a){a.isAvoiding&&a.actualBounds.Kc(b)&&a.Ta()})}}; function lj(a,b){void 0===b&&(b=null);var c=a.Hb;if(null!==c&&c.visible){for(var d=Ib.alloc(),e=1,f=1,g=c.Z.j,h=g.length,k=0;km||(Sj(l.figure)?f=f*m/K.qx(f,m):e=e*m/K.qx(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=L.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.o()){L.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;L.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=J.alloc();K.cq(a,g,0,0, d.width,d.height,b);b.offset(-d.width,-d.height);Ib.free(d);c.part.location=b;J.free(b)}}t.Wp=function(){var a=0=d&&!f.isAnimating&&!f.sb&&(b||f.Eh("Layout"));a.Fg=!1;for(var g=a.Ci.iterator;g.next();)lk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),Ri(a),e.isValidLayout=!0):a.Fg=!0)}finally{0===d&&a.ab("Layout"),a.Fg=!e.isValidLayout,a.fa=c}}} function lk(a,b,c,d){if(null!==b){for(var e=b.xl.iterator;e.next();)lk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.sk=!b.location.o(),e.doLayout(b),b.C(32),oj(a,b),e.isValidLayout=!0):a.Fg=!0)}}t.jz=function(){for(var a=new H,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.Ni()&&a.add(c)}return a.iterator}; function ni(a){function b(a){var b=a.toLowerCase(),e=new H;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new Db,d=new Db;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.Yt=c;a.Xt=d} function xj(a,b){var c=a.Xt.K(b);return null!==c?c:a.Xt.K(b.toLowerCase())}function mk(a,b){var c=a.Yt.K(b);if(null!==c)return c;c=a.Yt.K(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b);return null}t.Sj=function(a,b){A(a,"string",P,"addDiagramListener:name");A(b,"function",P,"addDiagramListener:listener");a=mk(this,a);null!==a&&a.add(b)};t.tm=function(a,b){A(a,"string",P,"removeDiagramListener:name");A(b,"function",P,"addDiagramListener:listener");a=mk(this,a);null!==a&&a.remove(b)}; t.ba=function(a,b,c){F&&A(a,"string",P,"raiseDiagramEvent:name");var d=mk(this,a),e=new Be;e.diagram=this;a=xj(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.O(0)(e);else if(0!==b)for(d=d.Oa(),c=0;c=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.viewportBounds,f=a.scale;e=L.allocAt(0,0,e.width*f,e.height*f);var g=J.allocAt(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(h=Math.max(a.scrollHorizontalLineChange,1),h|=0,g.x+=h,b.x>e.x+e.width-d.right/2&&(g.x+=h),b.x>e.x+e.width-d.right/4&& (g.x+=4*h));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(a=Math.max(a.scrollVerticalLineChange,1),a|=0,g.y+=a,b.y>e.y+e.height-d.bottom/2&&(g.y+=a),b.y>e.y+e.height-d.bottom/4&&(g.y+=4*a));g.Sa(Pb)||(c=new J(c.x+g.x/f,c.y+g.y/f));L.free(e);J.free(g);return c}t.ot=function(){return null};t.vv=function(){return null};t.qy=function(a,b){this.wu.add(a,b)}; function wk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].tl){f=!1;break}f||a-l>k?b(c,e,h):pa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Hj.iterator;g.next();)if(!g.value[0].tl){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;pa.requestAnimationFrame(function(){d()});return null}t.Lz=function(a){if(!jh)return null;void 0===a&&(a=new jb);a.returnType="Image";return this.yx(a)}; t.yx=function(a){void 0===a&&(a=new jb);return wk(this,this.Mz,a)}; t.Mz=function(a,b,c){var d=xk(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&&v('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 xk(a,b,c,d){a.animationManager.xd();a.hd();if(null===a.Ea)return null;"object"!==typeof b&&v("properties argument must be an Object.");var e=!1,f=b.size||null,g=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(g="NaN");var h=b.maxSize;void 0===b.maxSize&&(e=!0,h="SVG"===c?new Ib(Infinity,Infinity):new Ib(2E3,2E3));var k=b.position||null,l=b.parts||null,m=void 0===b.padding?1:b.padding,n=b.background||null,p=b.omitTemporary;void 0===p&&(p=!0);var r=b.document||document,q=b.elementFinished|| null,u=b.showTemporary;void 0===u&&(u=!p);b=b.showGrid;void 0===b&&(b=u);null!==f&&isNaN(f.width)&&isNaN(f.height)&&(f=null);"number"===typeof m?m=new kc(m):m instanceof kc||v("MakeImage padding must be a Margin or a number.");m.left=Math.max(m.left,0);m.right=Math.max(m.right,0);m.top=Math.max(m.top,0);m.bottom=Math.max(m.bottom,0);a.$c.Uc(!0);p=new yk(null,r);var x=p.context;if(!(f||g||l||k)){p.width=a.Aa+Math.ceil(m.left+m.right);p.height=a.ya+Math.ceil(m.top+m.bottom);if("SVG"===c){if(null=== d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.$p=q;vj(a,d.context,m,new Ib(p.width,p.height),a.Da,a.ua,l,n,u,b);return d.context}a.Cn=!1;vj(a,x,m,new Ib(p.width,p.height),a.Da,a.ua,l,n,u,b);a.Cn=!0;return p.context}var y=a.lr,z=a.documentBounds.copy();z.Xv(a.gb);if(u)for(var B=a.Ra.j,D=B.length,G=0;Gy?(g=y,f=z.width,z=z.height):(f=h.width,z=h.height)):(f=z.width*g,z=z.height*g):(g=y,f=z.width,z=z.height);null!==m?(f+=k,z+=Z):m=new kc(0);null!==h&&(y=h.width,h=h.height, "SVG"!==c&&e&&!zk&&F&&(f>y||z>h)&&(Da("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(f)+"x"+Math.ceil(z)+" vs 2000x2000) Consider increasing the max size."),zk=!0),isNaN(y)&&(y=2E3),isNaN(h)&&(h=2E3),isFinite(y)&&(f=Math.min(f,y)),isFinite(h)&&(z=Math.min(z,h)));p.width=Math.ceil(f);p.height=Math.ceil(z);if("SVG"===c){if(null===d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.$p=q;vj(a,d.context,m,new Ib(Math.ceil(f), Math.ceil(z)),g,B,l,n,u,b);return d.context}a.Cn=!1;vj(a,x,m,new Ib(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b);a.Cn=!0;return p.context} ma.Object.defineProperties(P.prototype,{div:{configurable:!0,get:function(){return this.Ja},set:function(a){null!==a&&w(a,HTMLDivElement,P,"div");if(this.Ja!==a){Ua=[];var b=this.Ja;null!==b?(b.D=void 0,b.innerHTML="",null!==this.Ea&&(b=this.Ea.Ha,this.removeEventListener(b,"touchstart",this.bw,!1),this.removeEventListener(b,"touchmove",this.aw,!1),this.removeEventListener(b,"touchend",this.$v,!1),this.Ea.kx()),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.$c=this.Ea=null,this.removeEventListener(pa,"resize",this.hw,!1),this.removeEventListener(pa,"mousemove",this.nk,!0),this.removeEventListener(pa,"mousedown",this.mk,!0),this.removeEventListener(pa,"mouseup",this.qk,!0),this.removeEventListener(pa,"wheel",this.rk,!0),this.removeEventListener(pa,"mouseout",this.pk,!0),Re===this&&(Re=null)): this.ke=!1;this.Ja=null;if(null!==a){if(b=a.D)b.div=null;xi(this,a);this.wf()}}}},ax:{configurable:!0,get:function(){return this.Bo}},tv:{configurable:!0,get:function(){return this.pb},set:function(a){this.pb=a}},Vi:{configurable:!0,get:function(){return this.ke}},draggedLink:{configurable:!0,get:function(){return this.pr},set:function(a){this.pr!==a&&(this.pr=a,null!==a&&(this.ks=a.fromPort,this.ls=a.toPort))}},Bx:{configurable:!0, get:function(){return this.ks},set:function(a){this.ks=a}},Cx:{configurable:!0,get:function(){return this.ls},set:function(a){this.ls=a}},animationManager:{configurable:!0,get:function(){return this.Fk}},undoManager:{configurable:!0,get:function(){return this.ac.undoManager}},skipsUndoManager:{configurable:!0,get:function(){return this.gh},set:function(a){A(a,"boolean",P,"skipsUndoManager");this.gh=a;this.ac.skipsUndoManager=a}},delaysLayout:{configurable:!0, enumerable:!0,get:function(){return this.Wt},set:function(a){this.Wt=a}},validCycle:{configurable:!0,get:function(){return this.Ms},set:function(a){var b=this.Ms;b!==a&&(hb(a,P,P,"validCycle"),this.Ms=a,this.g("validCycle",b,a))}},layers:{configurable:!0,get:function(){return this.Ra.iterator}},isModelReadOnly:{configurable:!0,get:function(){var a=this.ac;return null===a?!1:a.isReadOnly},set:function(a){var b=this.ac;null!==b&&(b.isReadOnly=a)}},isReadOnly:{configurable:!0, enumerable:!0,get:function(){return this.Rf},set:function(a){var b=this.Rf;b!==a&&(A(a,"boolean",P,"isReadOnly"),this.Rf=a,this.g("isReadOnly",b,a))}},isEnabled:{configurable:!0,get:function(){return this.Fc},set:function(a){var b=this.Fc;b!==a&&(A(a,"boolean",P,"isEnabled"),this.Fc=a,this.g("isEnabled",b,a))}},allowClipboard:{configurable:!0,get:function(){return this.Lq},set:function(a){var b=this.Lq;b!==a&&(A(a,"boolean",P,"allowClipboard"),this.Lq=a,this.g("allowClipboard", b,a))}},allowCopy:{configurable:!0,get:function(){return this.Ih},set:function(a){var b=this.Ih;b!==a&&(A(a,"boolean",P,"allowCopy"),this.Ih=a,this.g("allowCopy",b,a))}},allowDelete:{configurable:!0,get:function(){return this.Jh},set:function(a){var b=this.Jh;b!==a&&(A(a,"boolean",P,"allowDelete"),this.Jh=a,this.g("allowDelete",b,a))}},allowDragOut:{configurable:!0,get:function(){return this.Mq},set:function(a){var b=this.Mq;b!==a&&(A(a,"boolean",P,"allowDragOut"), this.Mq=a,this.g("allowDragOut",b,a))}},allowDrop:{configurable:!0,get:function(){return this.Nq},set:function(a){var b=this.Nq;b!==a&&(A(a,"boolean",P,"allowDrop"),this.Nq=a,this.g("allowDrop",b,a))}},allowTextEdit:{configurable:!0,get:function(){return this.Sh},set:function(a){var b=this.Sh;b!==a&&(A(a,"boolean",P,"allowTextEdit"),this.Sh=a,this.g("allowTextEdit",b,a))}},allowGroup:{configurable:!0,get:function(){return this.Kh},set:function(a){var b=this.Kh; b!==a&&(A(a,"boolean",P,"allowGroup"),this.Kh=a,this.g("allowGroup",b,a))}},allowUngroup:{configurable:!0,get:function(){return this.Th},set:function(a){var b=this.Th;b!==a&&(A(a,"boolean",P,"allowUngroup"),this.Th=a,this.g("allowUngroup",b,a))}},allowInsert:{configurable:!0,get:function(){return this.Pq},set:function(a){var b=this.Pq;b!==a&&(A(a,"boolean",P,"allowInsert"),this.Pq=a,this.g("allowInsert",b,a))}},allowLink:{configurable:!0,get:function(){return this.Lh}, set:function(a){var b=this.Lh;b!==a&&(A(a,"boolean",P,"allowLink"),this.Lh=a,this.g("allowLink",b,a))}},allowRelink:{configurable:!0,get:function(){return this.Nh},set:function(a){var b=this.Nh;b!==a&&(A(a,"boolean",P,"allowRelink"),this.Nh=a,this.g("allowRelink",b,a))}},allowMove:{configurable:!0,get:function(){return this.Mh},set:function(a){var b=this.Mh;b!==a&&(A(a,"boolean",P,"allowMove"),this.Mh=a,this.g("allowMove",b,a))}},allowReshape:{configurable:!0, get:function(){return this.Oh},set:function(a){var b=this.Oh;b!==a&&(A(a,"boolean",P,"allowReshape"),this.Oh=a,this.g("allowReshape",b,a))}},allowResize:{configurable:!0,get:function(){return this.Ph},set:function(a){var b=this.Ph;b!==a&&(A(a,"boolean",P,"allowResize"),this.Ph=a,this.g("allowResize",b,a))}},allowRotate:{configurable:!0,get:function(){return this.Qh},set:function(a){var b=this.Qh;b!==a&&(A(a,"boolean",P,"allowRotate"),this.Qh=a,this.g("allowRotate",b,a))}}, allowSelect:{configurable:!0,get:function(){return this.Rh},set:function(a){var b=this.Rh;b!==a&&(A(a,"boolean",P,"allowSelect"),this.Rh=a,this.g("allowSelect",b,a))}},allowUndo:{configurable:!0,get:function(){return this.Qq},set:function(a){var b=this.Qq;b!==a&&(A(a,"boolean",P,"allowUndo"),this.Qq=a,this.g("allowUndo",b,a))}},allowZoom:{configurable:!0,get:function(){return this.Sq},set:function(a){var b=this.Sq;b!==a&&(A(a,"boolean",P,"allowZoom"),this.Sq= a,this.g("allowZoom",b,a))}},hasVerticalScrollbar:{configurable:!0,get:function(){return this.Dr},set:function(a){var b=this.Dr;b!==a&&(A(a,"boolean",P,"hasVerticalScrollbar"),this.Dr=a,ij(this),this.S(),this.g("hasVerticalScrollbar",b,a),Ti(this,!1))}},hasHorizontalScrollbar:{configurable:!0,get:function(){return this.Cr},set:function(a){var b=this.Cr;b!==a&&(A(a,"boolean",P,"hasHorizontalScrollbar"),this.Cr=a,ij(this),this.S(),this.g("hasHorizontalScrollbar",b,a),Ti(this, !1))}},allowHorizontalScroll:{configurable:!0,get:function(){return this.Oq},set:function(a){var b=this.Oq;b!==a&&(A(a,"boolean",P,"allowHorizontalScroll"),this.Oq=a,this.g("allowHorizontalScroll",b,a),Ti(this,!1))}},allowVerticalScroll:{configurable:!0,get:function(){return this.Rq},set:function(a){var b=this.Rq;b!==a&&(A(a,"boolean",P,"allowVerticalScroll"),this.Rq=a,this.g("allowVerticalScroll",b,a),Ti(this,!1))}},scrollHorizontalLineChange:{configurable:!0, get:function(){return this.ws},set:function(a){var b=this.ws;b!==a&&(A(a,"number",P,"scrollHorizontalLineChange"),0>a&&ya(a,">= 0",P,"scrollHorizontalLineChange"),this.ws=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.ys},set:function(a){var b=this.ys;b!==a&&(A(a,"number",P,"scrollVerticalLineChange"),0>a&&ya(a,">= 0",P,"scrollVerticalLineChange"),this.ys=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0, enumerable:!0,get:function(){return this.vj},set:function(a){F&&w(a,ze,P,"lastInput");this.vj=a}},firstInput:{configurable:!0,get:function(){return this.ai},set:function(a){F&&w(a,ze,P,"firstInput");this.ai=a}},currentCursor:{configurable:!0,get:function(){return this.er},set:function(a){""===a&&(a=this.vn);if(this.er!==a){A(a,"string",P,"currentCursor");var b=this.Ea,c=this.Ja;if(null!==b){this.er=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:{configurable:!0,get:function(){return this.vn},set:function(a){""===a&&(a="auto");var b=this.vn;b!==a&&(A(a,"string",P,"defaultCursor"),this.vn=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.Ff},set:function(a){var b=this.Ff;b!== a&&(null!==a&&A(a,"function",P,"click"),this.Ff=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return this.Kf},set:function(a){var b=this.Kf;b!==a&&(null!==a&&A(a,"function",P,"doubleClick"),this.Kf=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return this.Gf},set:function(a){var b=this.Gf;b!==a&&(null!==a&&A(a,"function",P,"contextClick"),this.Gf=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0, get:function(){return this.ag},set:function(a){var b=this.ag;b!==a&&(null!==a&&A(a,"function",P,"mouseOver"),this.ag=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.Zf},set:function(a){var b=this.Zf;b!==a&&(null!==a&&A(a,"function",P,"mouseHover"),this.Zf=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return this.Yf},set:function(a){var b=this.Yf;b!==a&&(null!==a&&A(a,"function",P,"mouseHold"),this.Yf=a,this.g("mouseHold", b,a))}},mouseDragOver:{configurable:!0,get:function(){return this.ds},set:function(a){var b=this.ds;b!==a&&(null!==a&&A(a,"function",P,"mouseDragOver"),this.ds=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.Wf},set:function(a){var b=this.Wf;b!==a&&(F&&null!==a&&A(a,"function",P,"mouseDrop"),this.Wf=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.Br},set:function(a){var b= this.Br;b!==a&&(A(a,"boolean",P,"handlesDragDropForTopLevelParts"),this.Br=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.Xf},set:function(a){var b=this.Xf;b!==a&&(null!==a&&A(a,"function",P,"mouseEnter"),this.Xf=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return this.$f},set:function(a){var b=this.$f;b!==a&&(null!==a&&A(a,"function",P,"mouseLeave"),this.$f=a,this.g("mouseLeave",b,a))}}, toolTip:{configurable:!0,get:function(){return this.mg},set:function(a){var b=this.mg;b!==a&&(!F||null===a||a instanceof Ve||a instanceof $e||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.mg=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.Hf},set:function(a){var b=this.Hf;b!==a&&(!F||a instanceof Ve||a instanceof $e||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Hf=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0, enumerable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(this.L=a,a.ib(this))}},toolManager:{configurable:!0,get:function(){return this.Wb},set:function(a){this.Wb!==a&&(w(a,Sa,P,"toolManager"),this.Wb=a,a.ib(this))}},defaultTool:{configurable:!0,get:function(){return this.Ma},set:function(a){var b=this.Ma;b!==a&&(w(a,Ke,P,"defaultTool"),this.Ma=a,a.ib(this),this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,get:function(){return this.ca}, set:function(a){var b=this.ca;null!==b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(w(a,Ke,P,"currentTool"),this.ca=a,a.ib(this),a.doStart())}},selection:{configurable:!0,get:function(){return this.Jq}},maxSelectionCount:{configurable:!0,get:function(){return this.Zr},set:function(a){var b=this.Zr;if(b!==a)if(A(a,"number",P,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Zr=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&& (a=this.selection.count-a,0= 0",P,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.gs},set:function(a){var b=this.gs;b!==a&&(w(a,Ve,P,"nodeSelectionAdornmentTemplate"),this.gs=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0, enumerable:!0,get:function(){return this.zr},set:function(a){var b=this.zr;b!==a&&(w(a,Ve,P,"groupSelectionAdornmentTemplate"),this.zr=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.Vr},set:function(a){var b=this.Vr;b!==a&&(w(a,Ve,P,"linkSelectionAdornmentTemplate"),this.Vr=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.Hq}},isModified:{configurable:!0, enumerable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.w&&this.je!==a.historyIndex:this.w},set:function(a){if(this.w!==a){A(a,"boolean",P,"isModified");this.w=a;var b=this.undoManager;!a&&b.isEnabled&&(this.je=b.historyIndex);a||Tj(this)}}},model:{configurable:!0,get:function(){return this.ac},set:function(a){var b=this.ac;if(b!==a){w(a,X,P,"model");this.currentTool.doCancel();null!==b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&& v("Do not replace a Diagram.model while a transaction is in progress.");Ai(this,!0);this.ke=!1;this.cl=!0;this.je=-2;this.sd=!1;var c=this.$b;this.$b=!0;this.animationManager.Eh("Model");null!==b&&(null!==this.se&&this.se.each(function(a){b.uk(a)}),b.uk(this.Im));this.ac=a;this.partManager=Uj(this.ac.constructor.type);a.th(this.Cg);this.partManager.addAllModeledParts();a.uk(this.Cg);a.th(this.Im);null!==this.se&&this.se.each(function(b){a.th(b)});this.$b=c;this.pb||this.S();null!==b&&a.undoManager.copyProperties(b.undoManager)}}}, fa:{configurable:!0,get:function(){return this.Oc},set:function(a){this.Oc=a}},mt:{configurable:!0,get:function(){return this.Iq}},skipsModelSourceBindings:{configurable:!0,get:function(){return this.Gh},set:function(a){this.Gh=a}},wk:{configurable:!0,get:function(){return this.Du},set:function(a){this.Du=a}},nodeTemplate:{configurable:!0,get:function(){return this.bg.K("")},set:function(a){var b=this.bg.K("");b!==a&&(w(a,T,P,"nodeTemplate"), this.bg.add("",a),this.g("nodeTemplate",b,a),this.undoManager.isUndoingRedoing||this.wd())}},nodeTemplateMap:{configurable:!0,get:function(){return this.bg},set:function(a){var b=this.bg;b!==a&&(w(a,Db,P,"nodeTemplateMap"),this.bg=a,this.g("nodeTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.wd())}},groupTemplate:{configurable:!0,get:function(){return this.bi.K("")},set:function(a){var b=this.bi.K("");b!==a&&(w(a,Rf,P,"groupTemplate"),this.bi.add("",a),this.g("groupTemplate", b,a),this.undoManager.isUndoingRedoing||this.wd())}},groupTemplateMap:{configurable:!0,get:function(){return this.bi},set:function(a){var b=this.bi;b!==a&&(w(a,Db,P,"groupTemplateMap"),this.bi=a,this.g("groupTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.wd())}},linkTemplate:{configurable:!0,get:function(){return this.Xg.K("")},set:function(a){var b=this.Xg.K("");b!==a&&(w(a,S,P,"linkTemplate"),this.Xg.add("",a),this.g("linkTemplate",b,a),this.undoManager.isUndoingRedoing|| this.wd())}},linkTemplateMap:{configurable:!0,get:function(){return this.Xg},set:function(a){var b=this.Xg;b!==a&&(w(a,Db,P,"linkTemplateMap"),this.Xg=a,this.g("linkTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.wd())}},isMouseOverDiagram:{configurable:!0,get:function(){return this.Te},set:function(a){this.Te=a}},isMouseCaptured:{configurable:!0,get:function(){return this.Nc},set:function(a){var b=this.Ea;null!==b&&(b=b.Ha,b instanceof SVGElement|| (a?(this.lastInput.bubbles=!1,this.Tq?(this.removeEventListener(b,"pointermove",this.pm,!1),this.removeEventListener(b,"pointerdown",this.om,!1),this.removeEventListener(b,"pointerup",this.rm,!1),this.removeEventListener(b,"pointerout",this.qm,!1),this.addEventListener(pa,"pointermove",this.pm,!0),this.addEventListener(pa,"pointerdown",this.om,!0),this.addEventListener(pa,"pointerup",this.rm,!0),this.addEventListener(pa,"pointerout",this.qm,!0)):(this.removeEventListener(b,"mousemove",this.nk,!1), this.removeEventListener(b,"mousedown",this.mk,!1),this.removeEventListener(b,"mouseup",this.qk,!1),this.removeEventListener(b,"mouseout",this.pk,!1),this.addEventListener(pa,"mousemove",this.nk,!0),this.addEventListener(pa,"mousedown",this.mk,!0),this.addEventListener(pa,"mouseup",this.qk,!0),this.addEventListener(pa,"mouseout",this.pk,!0)),this.removeEventListener(b,"wheel",this.rk,!1),this.addEventListener(pa,"wheel",this.rk,!0),this.addEventListener(pa,"selectstart",this.preventDefault,!1)):(this.Tq? (this.removeEventListener(pa,"pointermove",this.pm,!0),this.removeEventListener(pa,"pointerdown",this.om,!0),this.removeEventListener(pa,"pointerup",this.rm,!0),this.removeEventListener(pa,"pointerout",this.qm,!0),this.addEventListener(b,"pointermove",this.pm,!1),this.addEventListener(b,"pointerdown",this.om,!1),this.addEventListener(b,"pointerup",this.rm,!1),this.addEventListener(b,"pointerout",this.qm,!1)):(this.removeEventListener(pa,"mousemove",this.nk,!0),this.removeEventListener(pa,"mousedown", this.mk,!0),this.removeEventListener(pa,"mouseup",this.qk,!0),this.removeEventListener(pa,"mouseout",this.pk,!0),this.addEventListener(b,"mousemove",this.nk,!1),this.addEventListener(b,"mousedown",this.mk,!1),this.addEventListener(b,"mouseup",this.qk,!1),this.addEventListener(b,"mouseout",this.pk,!1)),this.removeEventListener(pa,"wheel",this.rk,!0),this.removeEventListener(pa,"selectstart",this.preventDefault,!1),this.addEventListener(b,"wheel",this.rk,!1)),this.Nc=a))}},position:{configurable:!0, enumerable:!0,get:function(){return this.ua},set:function(a){var b=J.alloc().assign(this.ua);if(!b.A(a)){w(a,J,P,"position");var c=this.viewportBounds.copy();this.ua.assign(a);this.pb||null===this.Ea&&!this.Mp.o()||(this.pb=!0,a=this.scale,Vi(this,this.An,this.Aa/a,this.ya/a,this.hj,!1),this.pb=!1);ai(this.animationManager,b,this.ua);this.pb||this.tq(c,this.viewportBounds,this.Da,!1)}J.free(b)}},initialPosition:{configurable:!0,get:function(){return this.Fr},set:function(a){this.Fr.A(a)|| (w(a,J,P,"initialPosition"),this.Fr=a.J())}},initialScale:{configurable:!0,get:function(){return this.Gr},set:function(a){this.Gr!==a&&(A(a,"number",P,"initialScale"),this.Gr=a)}},grid:{configurable:!0,get:function(){null===this.Hb&&Fi(this);return this.Hb},set:function(a){var b=this.Hb;if(b!==a){null===b&&(Fi(this),b=this.Hb);w(a,W,P,"grid");a.type!==W.Grid&&v("Diagram.grid must be a Panel of type Panel.Grid");var c=b.panel;null!==c&&c.remove(b);this.Hb=a;a.name="GRID"; null!==c&&c.add(a);lj(this);this.S();this.g("grid",b,a)}}},viewportBounds:{configurable:!0,get:function(){var a=this.Tw,b=this.ua,c=this.Da;if(null===this.Ea)return this.Mp.o()&&a.h(b.x,b.y,this.Aa/c,this.ya/c),a;a.h(b.x,b.y,Math.max(this.Aa,0)/c,Math.max(this.ya,0)/c);return a}},viewSize:{configurable:!0,get:function(){return this.Mp},set:function(a){var b=this.viewSize;b.A(a)||(w(a,Ib,P,"viewSize"),this.Mp=a=a.J(),this.Aa=a.width,this.ya=a.height,this.Ya(),this.g("viewSize", b,a))}},fixedBounds:{configurable:!0,get:function(){return this.wr},set:function(a){var b=this.wr;b.A(a)||(w(a,L,P,"fixedBounds"),(F&&Infinity===a.width||-Infinity===a.width||Infinity===a.height||-Infinity===a.height)&&v("fixedBounds width/height must not be Infinity"),this.wr=a=a.J(),this.Ya(),this.g("fixedBounds",b,a))}},scrollMargin:{configurable:!0,get:function(){return this.wi},set:function(a){"number"===typeof a?a=new kc(a):w(a,kc,P,"scrollMargin");var b=this.wi; b.A(a)||(this.wi=a=a.J(),this.g("scrollMargin",b,a),this.wf())}},scrollMode:{configurable:!0,get:function(){return this.Lj},set:function(a){var b=this.Lj;b!==a&&(hb(a,P,P,"scrollMode"),this.Lj=a,a===li&&Ti(this,!1),this.g("scrollMode",b,a),this.wf())}},scrollsPageOnFocus:{configurable:!0,get:function(){return this.zs},set:function(a){var b=this.zs;b!==a&&(A(a,"boolean",P,"scrollsPageOnFocus"),this.zs=a,this.g("scrollsPageOnFocus",b,a))}},positionComputation:{configurable:!0, enumerable:!0,get:function(){return this.qs},set:function(a){var b=this.qs;b!==a&&(null!==a&&A(a,"function",P,"positionComputation"),this.qs=a,Ti(this,!1),this.g("positionComputation",b,a))}},scaleComputation:{configurable:!0,get:function(){return this.us},set:function(a){var b=this.us;b!==a&&(null!==a&&A(a,"function",P,"scaleComputation"),this.us=a,Rj(this,this.scale,this.scale),this.g("scaleComputation",b,a))}},documentBounds:{configurable:!0,get:function(){return this.An}}, isVirtualized:{configurable:!0,get:function(){return this.Qr},set:function(a){var b=this.Qr;b!==a&&(A(a,"boolean",P,"isVirtualized"),this.Qr=a,this.g("isVirtualized",b,a))}},scale:{configurable:!0,get:function(){return this.Da},set:function(a){var b=this.Da;C(a,P,"scale");b!==a&&Rj(this,b,a)}},defaultScale:{configurable:!0,get:function(){return this.lr},set:function(a){F&&C(a,P,"defaultScale");!F||0this.scale&&(this.scale=a)):ya(a,"> 0",P,"minScale"))}},maxScale:{configurable:!0,get:function(){return this.Yr},set:function(a){C(a,P,"maxScale");var b=this.Yr;b!==a&&(0 0",P,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.Ps},set:function(a){this.Ps.A(a)||(w(a,J,P,"zoomPoint"),this.Ps=a=a.J())}},contentAlignment:{configurable:!0, enumerable:!0,get:function(){return this.hj},set:function(a){var b=this.hj;b.A(a)||(w(a,M,P,"contentAlignment"),this.hj=a=a.J(),this.g("contentAlignment",b,a),Ti(this,!1))}},initialContentAlignment:{configurable:!0,get:function(){return this.Tn},set:function(a){var b=this.Tn;b.A(a)||(w(a,M,P,"initialContentAlignment"),this.Tn=a=a.J(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.gb},set:function(a){"number"===typeof a?a=new kc(a): w(a,kc,P,"padding");var b=this.gb;b.A(a)||(this.gb=a=a.J(),this.Ya(),this.g("padding",b,a))}},partManager:{configurable:!0,get:function(){return this.Na},set:function(a){var b=this.Na;b!==a&&(w(a,qi,P,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+a.toString()),null!==b&&b.ib(null),this.Na=a,a.ib(this))}},nodes:{configurable:!0,get:function(){return this.partManager.nodes.iterator}},links:{configurable:!0,get:function(){return this.partManager.links.iterator}}, parts:{configurable:!0,get:function(){return this.partManager.parts.iterator}},layout:{configurable:!0,get:function(){return this.ic},set:function(a){var b=this.ic;b!==a&&(w(a,vi,P,"layout"),this.ic=a,a.diagram=this,a.group=null,this.Fg=!0,this.g("layout",b,a),this.ec())}},isTreePathToChildren:{configurable:!0,get:function(){return this.Pr},set:function(a){var b=this.Pr;if(b!==a&&(A(a,"boolean",P,"isTreePathToChildren"),this.Pr=a,this.g("isTreePathToChildren", b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Ak(a.value)}},treeCollapsePolicy:{configurable:!0,get:function(){return this.Ks},set:function(a){var b=this.Ks;b!==a&&(a!==oi&&a!==Bk&&a!==Ck&&v("Unknown Diagram.treeCollapsePolicy: "+a),this.Ks=a,this.g("treeCollapsePolicy",b,a))}},Ie:{configurable:!0,get:function(){return this.Xb},set:function(a){this.Xb=a}},autoScrollInterval:{configurable:!0,get:function(){return this.Ym},set:function(a){var b= this.Ym;C(a,P,"scale");b!==a&&(this.Ym=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.Zm},set:function(a){"number"===typeof a?a=new kc(a):w(a,kc,P,"autoScrollRegion");var b=this.Zm;b.A(a)||(this.Zm=a=a.J(),this.Ya(),this.g("autoScrollRegion",b,a))}}});ma.Object.defineProperties(P,{licenseKey:{configurable:!0,get:function(){return Dk.Ub()},set:function(a){Dk.add(a)}},version:{configurable:!0,get:function(){return Ek}}}); P.prototype.makeImageData=P.prototype.yx;P.prototype.makeImage=P.prototype.Lz;P.prototype.addRenderer=P.prototype.qy;P.prototype.makeSVG=P.prototype.vv;P.prototype.makeSvg=P.prototype.ot;P.prototype.stopAutoScroll=P.prototype.zf;P.prototype.doAutoScroll=P.prototype.Us;P.prototype.isUnoccupied=P.prototype.jk;P.prototype.raiseDiagramEvent=P.prototype.ba;P.prototype.removeDiagramListener=P.prototype.tm;P.prototype.addDiagramListener=P.prototype.Sj;P.prototype.findTreeRoots=P.prototype.jz; P.prototype.layoutDiagram=P.prototype.Jz;P.prototype.findTopLevelGroups=P.prototype.cz;P.prototype.findTopLevelNodesAndLinks=P.prototype.dz;P.prototype.findLinksByExample=P.prototype.Xs;P.prototype.findNodesByExample=P.prototype.Ys;P.prototype.findLinkForData=P.prototype.wc;P.prototype.findNodeForData=P.prototype.Ki;P.prototype.findPartForData=P.prototype.xc;P.prototype.findNodeForKey=P.prototype.Kb;P.prototype.findPartForKey=P.prototype.findPartForKey;P.prototype.rebuildParts=P.prototype.wd; P.prototype.transformViewToDoc=P.prototype.Et;P.prototype.transformRectDocToView=P.prototype.jA;P.prototype.transformDocToView=P.prototype.Dt;P.prototype.centerRect=P.prototype.Qu;P.prototype.scrollToRect=P.prototype.Ov;P.prototype.scroll=P.prototype.scroll;P.prototype.highlightCollection=P.prototype.zz;P.prototype.highlight=P.prototype.yz;P.prototype.clearHighlighteds=P.prototype.Su;P.prototype.selectCollection=P.prototype.Pv;P.prototype.select=P.prototype.select;P.prototype.clearSelection=P.prototype.Wp; P.prototype.updateAllRelationshipsFromData=P.prototype.Eq;P.prototype.updateAllTargetBindings=P.prototype.updateAllTargetBindings;P.prototype.commit=P.prototype.commit;P.prototype.rollbackTransaction=P.prototype.yf;P.prototype.commitTransaction=P.prototype.ab;P.prototype.startTransaction=P.prototype.Ca;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.cb;P.prototype.removeChangedListener=P.prototype.uk;P.prototype.addChangedListener=P.prototype.th; P.prototype.removeModelChangedListener=P.prototype.Zz;P.prototype.addModelChangedListener=P.prototype.Zw;P.prototype.findLayer=P.prototype.em;P.prototype.removeLayer=P.prototype.Xz;P.prototype.addLayerAfter=P.prototype.my;P.prototype.addLayerBefore=P.prototype.Xw;P.prototype.addLayer=P.prototype.Wl;P.prototype.moveParts=P.prototype.moveParts;P.prototype.copyParts=P.prototype.bk;P.prototype.removeParts=P.prototype.xt;P.prototype.remove=P.prototype.remove;P.prototype.add=P.prototype.add; P.prototype.clearDelayedGeometries=P.prototype.Ru;P.prototype.setProperties=P.prototype.Vv;P.prototype.resetInputOptions=P.prototype.Lv;P.prototype.setInputOption=P.prototype.cA;P.prototype.getInputOption=P.prototype.hm;P.prototype.resetRenderingHints=P.prototype.Mv;P.prototype.setRenderingHint=P.prototype.Ox;P.prototype.getRenderingHint=P.prototype.He;P.prototype.maybeUpdate=P.prototype.hd;P.prototype.requestUpdate=P.prototype.ec;P.prototype.delayInitialization=P.prototype.Gy; P.prototype.isUpdateRequested=P.prototype.Fz;P.prototype.redraw=P.prototype.wf;P.prototype.invalidateDocumentBounds=P.prototype.Ya;P.prototype.findObjectsNear=P.prototype.tg;P.prototype.findPartsNear=P.prototype.$y;P.prototype.findObjectsIn=P.prototype.sg;P.prototype.findPartsIn=P.prototype.px;P.prototype.findObjectsAt=P.prototype.Li;P.prototype.findPartsAt=P.prototype.Zy;P.prototype.findObjectAt=P.prototype.Tb;P.prototype.findPartAt=P.prototype.fm;P.prototype.alignDocument=P.prototype.sy; P.prototype.zoomToRect=P.prototype.mA;P.prototype.zoomToFit=P.prototype.zoomToFit;P.prototype.diagramScroll=P.prototype.jx;P.prototype.focus=P.prototype.focus;P.prototype.reset=P.prototype.reset;P.useDOM=function(a){jh=a?void 0!==pa.document:!1};P.isUsingDOM=function(){return jh}; var Re=null,pi=new Db,Di=null,Ci=null,jh=void 0!==pa.document,yi=null,zi="",mi=new E(P,"None",0),Xi=new E(P,"Uniform",1),Yi=new E(P,"UniformToFill",2),cg=new E(P,"CycleAll",10),gg=new E(P,"CycleNotDirected",11),ig=new E(P,"CycleNotDirectedFast",12),jg=new E(P,"CycleNotUndirected",13),dg=new E(P,"CycleDestinationTree",14),fg=new E(P,"CycleSourceTree",15),li=new E(P,"DocumentScroll",1),yj=new E(P,"InfiniteScroll",2),oi=new E(P,"TreeParentCollapsed",21),Bk=new E(P,"AllParentsCollapsed",22),Ck=new E(P, "AnyParentsCollapsed",23),Dk=new H,Ek="2.0.17",zk=!1,Fk=null,ji=!1; function ki(){if(jh){var a=pa.document.createElement("canvas"),b=a.getContext("2d"),c=Wa("7ca11abfd022028846");b[c]=Wa("398c3597c01238");for(var d=["5da73c80a36455d4038e4972187c3cae51fd22",qa.Dx+"4ae6247590da4bb21c324ba3a84e385776",Jb.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",K.za],e=1;5>e;e++)b[Wa("7ca11abfd7330390")](Wa(d[e-1]),10,15*e);b[c]=Wa("39f046ebb36e4b");for(c=1;5>c;c++)b[Wa("7ca11abfd7330390")](Wa(d[c-1]),10,15*c);Fk=a}}P.className="Diagram"; P.fromDiv=function(a){var b=a;"string"===typeof a&&(b=pa.document.getElementById(a));return b instanceof HTMLDivElement&&b.D instanceof P?b.D:null};P.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);A(a,"function",P,"inherit");A(b,"function",P,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};P.None=mi;P.Uniform=Xi;P.UniformToFill=Yi;P.CycleAll=cg;P.CycleNotDirected=gg; P.CycleNotDirectedFast=ig;P.CycleNotUndirected=jg;P.CycleDestinationTree=dg;P.CycleSourceTree=fg;P.DocumentScroll=li;P.InfiniteScroll=yj;P.TreeParentCollapsed=oi;P.AllParentsCollapsed=Bk;P.AnyParentsCollapsed=Ck;function wi(){this.hy=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Qe=this.l=!0:this.Qe=null} function uj(a,b){b.$c.setTransform(b.Pb,0,0,b.Pb,0,0);if(null===a.Qe){b="f";var c=pa[Wa("76a715b2f73f148a")][Wa("72ba13b5")];a.Qe=!0;if(jh){var d=P[Wa("76a115b6ed251eaf4692")];if(d)for(var e=Dk.iterator;e.next();){d=e.value;d=Wa(d).split(Wa("39e9"));if(6>d.length)break;var f=Wa(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Wa(qa[Wa("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Wa("76ad18b4f73e")];for(g=c[Wa("73a612b6fb191d")](Wa("35e7"))+2;gf&&Wa(d[2])!==Wa("7da71ca0ad381e90")&&(f=b[Wa("73a612b6fb191d")](Wa("76a715b2ef3e149757")));0>f&&(f=b[Wa("73a612b6fb191d")](Wa("76a715b2ef3e149757")));0>f&&(f=c[Wa("73a612b6fb191d")](Wa("7baa19a6f76c1988428554")));a.Qe=!(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[Wa("79a417a0f0181a8946")]=d;if(pa.document[Wa("78a712aa")]){pa.document[Wa("78a712aa")][Wa("7bb806b6ed32388c4a875b")](g);h=pa.getComputedStyle(g).getPropertyValue(Wa("78a704b7e62456904c9b12701b6532a8"));pa.document[Wa("78a712aa")][Wa("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.Qe=!1;break}else if(Xa||ab||bb||cb)for(d="."+d,f=0;f< document.styleSheets.length;f++){g=document.styleSheets[f].rules||document.styleSheets[f].cssRules;for(var k in g)if(d===g[k].selectorText){a.Qe=!1;break}}}else a.Qe=null,a.Qe=!1}}else{k=c[Wa("76ad18b4f73e")];for(e=c[Wa("73a612b6fb191d")](Wa("35e7"))+2;eMath.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.Hd++:a.Hd=1;c.clickCount=a.Hd;a.ql=b.timeStamp;a.Sr.zg(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():hj(a,c,b)}};a.pm=function(b){if(a.isEnabled){a.Te=!0;var c=a.Bl;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=gj(a,b,b,null!==c[1]),a.doMouseMove(),hj(a,c,b))}};a.rm=function(b){if(a.isEnabled){a.Te=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.uu;if(c&&a.Sl)delete d[b.pointerId],b.preventDefault();else if(d=a.Bl,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=fj(a,b,!1,!0,!0,!1);var e=pa.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.D instanceof P&&e.D!==a&&cj(e.D,b,d);cj(a,b,d);d.clickCount=a.Hd;null===e?d.targetDiagram=dj(b):e.D?d.targetDiagram=e.D:d.targetDiagram= null;d.targetObject=null;a.doMouseUp();hj(a,d,b);c&&(a.Ue=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.qm=function(b){if(a.isEnabled){a.Te=!1;var c=a.uu;c[b.pointerId]&&delete c[b.pointerId];c=a.Bl;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.Uc(!0);Ei(a)}}wi.className="DiagramHelper"; function sf(a){this.l=void 0===a?new J:a;this.w=new J}ma.Object.defineProperties(sf.prototype,{point:{configurable:!0,get:function(){return this.l},set:function(a){this.l=a}},shifted:{configurable:!0,get:function(){return this.w},set:function(a){this.w=a}}});sf.className="DraggingInfo";function Mj(a,b,c){this.node=a;this.info=b;this.ov=c}Mj.className="DraggingNodeInfoPair";function df(){this.reset()} df.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Ib(NaN,NaN)).freeze();this.gridSnapCellSpot=Jc;this.gridSnapOrigin=(new J(NaN,NaN)).freeze();this.wz=this.dragsTree=this.dragsLink=!1;this.vz=!0}; function Gk(a){1this.re||u.height*n>this.re?q.jc(b,this):fi(b,q))}b.globalAlpha=1}}e.drawImage(c.Ha,0,0);F&&F.Hi&&(e.fillStyle="red",e.fillRect(0,d.height/2,d.width,4));c=this.Ra.j;d=c.length;for(e=0;eb.maxScale||(b.scale=a))}; Mk.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);C(a,Mk,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==mi)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Mk.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);C(a,Mk,"increaseZoom:factor");var b=this.diagram;b.autoScale===mi&&(a=b.scale*a,ab.maxScale||(b.scale=a))}; Mk.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);C(a,Mk,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==mi)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Mk.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);C(a,Mk,"resetZoom:newscale");var b=this.diagram;ab.maxScale||(b.scale=a)}; Mk.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);C(a,Mk,"canResetZoom:newscale");var b=this.diagram;return ab.maxScale?!1:b.allowZoom};Mk.prototype.zoomToFit=function(){var a=this.diagram,b=a.scale,c=a.position;b===this.Lu&&!isNaN(this.lu)&&a.documentBounds.A(this.Ku)?(a.scale=this.lu,a.position=this.Gw,this.Lu=NaN,this.Ku=uc):(this.lu=b,this.Gw=c.copy(),a.zoomToFit(),this.Lu=a.scale,this.Ku=a.documentBounds.copy())};Mk.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; Mk.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w(a,T,Mk,"part");var b=this.diagram;if(null===a){try{null!==this.ig&&(this.ig.next()?a=this.ig.value:this.ig=null)}catch(k){this.ig=null}null===a&&(0a&&(a+=360));return a}; t.Ge=function(){if(0!==(this.I&4096)===!1)return this.Yk;var a=this.Da;return null!==this.panel?a*this.panel.Ge():a};t.bt=function(a,b){void 0===b&&(b=new J);b.assign(a);this.td.Wd(b);return b};t.Wc=function(a,b,c){return this.gk(a.x,a.y,b.x,b.y,c)}; t.gk=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.Wc(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.Wc(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; N.prototype.measure=function(a,b,c,d){if(!1!==pj(this)){var e=this.Yg,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 ag&&(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 W;switch(fl(this,!0)){case Pg:g=e=0;h&&(b=a=Infinity); break;case Id:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case Rk:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case Sk: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.metrics.maxLineWidth>a.width)))c=!0;this.I=c?this.I|256:this.I&-257;this.wb.o()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.wb.toString());this.rt(f,this.wb);gl(this,!1);L.free(f)};t=N.prototype;t.wh=function(){}; function hl(a,b,c,d,e){a.wb.h(b,c,d,e);if(!a.desiredSize.o()){var f=a.qc;c=a.Yg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=fl(a,!0);c===d&&f===e&&(b=Pg);switch(b){case Pg:if(c>d||f>e)kj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Id:kj(a,!0);a.measure(d,e,0,0);break;case Rk:kj(a,!0);a.measure(d,f,0,0);break;case Sk:kj(a,!0),a.measure(c,e,0,0)}}} t.rt=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||il(c,!0),this.S(),ic(a,b)||(c.Bh(),this.Lo(c)))};t.Lo=function(a){null!==this.portId&&(il(a,!0),a instanceof V&&jl(a,this))}; t.jc=function(a,b){if(this.visible){var c=this instanceof W&&(this.type===W.TableRow||this.type===W.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.lx(a,b))if(c)kl(this,a,b);else{this instanceof S&&this.lk(!1);F&&F.Hi&&F.Ny&&F.Ny(a,this);c=this.transform;var g=this.panel;0!==(this.I&4096)===!0&&ll(this);var h=this.part,k=!1,l=0;if(h&&b.He("drawShadows")&&(k=h.isShadowed)){var m= h.xi;l=Math.max(m.y,m.x)*b.scale*b.Pb}if(!(m=b.rj)){var n=this.naturalBounds;m=this.Hh;var p=m.m11,r=m.m21,q=m.dx,u=m.m12,x=m.m22,y=m.dy,z,B=z=0;m=z*p+B*r+q;var D=z*u+B*x+y;z=n.width+l;B=0;var G=z*p+B*r+q;z=z*u+B*x+y;B=Math.min(m,G);var O=Math.min(D,z);var Q=Math.max(m+0,G)-B;var R=Math.max(D+0,z)-O;m=B;D=O;z=n.width+l;B=n.height+l;G=z*p+B*r+q;z=z*u+B*x+y;B=Math.min(m,G);O=Math.min(D,z);Q=Math.max(m+Q,G)-B;R=Math.max(D+R,z)-O;m=B;D=O;z=0;B=n.height+l;G=z*p+B*r+q;z=z*u+B*x+y;B=Math.min(m,G);O=Math.min(D, z);Q=Math.max(m+Q,G)-B;R=Math.max(D+R,z)-O;m=B;D=O;l=b.viewportBounds;n=l.x;p=l.y;m=!(m>l.aa+n||n>Q+m||D>l.$+p||p>R+D)}if(m){m=0!==(this.I&256);a.clipInsteadOfFill&&(m=!1);this instanceof lh&&(a.font=this.font);if(m){F&&F.Py&&Da("clip"+this.toString());D=g.ae()?g.naturalBounds:g.actualBounds;null!==this.md?(n=this.md,Q=n.x,R=n.y,l=n.width,n=n.height):(Q=Math.max(d.x,D.x),R=Math.max(d.y,D.y),l=Math.min(d.right,D.right)-Q,n=Math.min(d.bottom,D.bottom)-R);if(Q>d.width+d.x||d.x>D.width+D.x){1!==e&&(a.globalAlpha= f);return}a.save();a.beginPath();a.rect(Q,R,l,n);a.clip()}if(this.yg()){if(!h.isVisible()){1!==e&&(a.globalAlpha=f);return}k&&(D=h.xi,a.Wv(D.x*b.scale*b.Pb,D.y*b.scale*b.Pb,h.Qd),ml(a),a.shadowColor=h.Nj)}!0===this.shadowVisible?ml(a):!1===this.shadowVisible&&nl(a);h=this.naturalBounds;null!==this.fc&&(gi(this,a,this.fc,!0,!0,h,d),this.fc instanceof ol&&this.fc.type===pl?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.Vd(this.fc)):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.I&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.Bb()!==this)&&null===this.shadowVisible&&nl(a);null!==this.jb&&(l=this.naturalBounds,Q=D=0,R=l.width,l=l.height,n=0,this instanceof ag&&(l=this.sa.bounds,D=l.x,Q=l.y,R=l.width,l=l.height,n=this.strokeWidth),gi(this,a,this.jb,!0,!1,h,d),this.jb instanceof ol&&this.jb.type===pl?(a.beginPath(),a.rect(D-n/2,Q-n/2,R+n,l+n),a.Vd(this.jb)):a.fillRect(D-n/2,Q-n/2,R+n,l+n));F&&F.Hi&&F.Oy&&F.Oy(a,this);k&&(null!== this.jb||null!==this.fc||null!==g&&0!==(g.I&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.Bb()!==this)?(ql(this,!0),null===this.shadowVisible&&nl(a)):ql(this,!1);this.Ii(a,b);k&&0!==(this.I&512)===!0&&ml(a);this.yg()&&k&&nl(a);m?(a.restore(),this instanceof W?a.Uc(!0):a.Uc(!1)):c.jt()||(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.lx=function(){return!1}; function kl(a,b,c){var d=a.wb,e=a.rc;null!==a.fc&&(gi(a,b,a.fc,!0,!0,e,d),a.fc instanceof ol&&a.fc.type===pl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Vd(a.fc)):b.fillRect(d.x,d.y,d.width,d.height));null!==a.jb&&(gi(a,b,a.jb,!0,!1,e,d),a.jb instanceof ol&&a.jb.type===pl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Vd(a.jb)):b.fillRect(d.x,d.y,d.width,d.height));a.Ii(b,c)}t.Ii=function(){}; function gi(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===rl)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{h=f.width;k=f.height;e&&(h=g.width,k=g.height);if((f=b instanceof sl)&&c.ge&&(c.type===tl||c.Mk===h&&c.Rt===k))var l=c.ge;else{var m=0,n=0,p=0,r=0,q=0,u=0;u=q=0;e&&(q=g.x,u=g.y);m=c.start.x*h+c.start.offsetX;n=c.start.y*k+c.start.offsetY;p=c.end.x*h+c.end.offsetX;r=c.end.y*k+c.end.offsetY;m+=q;p+=q;n+=u;r+=u;if(c.type===ul)l= b.createLinearGradient(m,n,p,r);else if(c.type===pl)u=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(q=0,u=Math.max(h,k)/2):q=c.startRadius,l=b.createRadialGradient(m,n,q,p,r,u);else if(c.type===tl)try{l=b.createPattern(c.pattern,"repeat")}catch(y){l=null}else xa(c.type,"Brush type");if(c.type!==tl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)l.addColorStop(e.key,e.value);if(f&&(c.ge=l,null!==l&&(c.Mk=h,c.Rt=k),null===l&&c.type===tl&&-1!==c.Mk)){c.Mk=-1;var x=a.diagram; null!==x&&-1===c.Mk&&ta(function(){x.wf()},600)}}d?b.fillStyle=l:b.strokeStyle=l}}}t.wg=function(a){if(a instanceof W)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.vf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.vf():!0};t.xg=function(){for(var a=this instanceof W?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; function ll(a){if(0!==(a.I&2048)===!0){var b=a.ub;b.reset();if(!a.wb.o()||!a.qc.o()){vl(a,!1);return}b.translate(a.wb.x-a.qc.x,a.wb.y-a.qc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;dl(a,b,c.x,c.y,c.width,c.height)}vl(a,!1);wl(a,!0)}0!==(a.I&4096)===!0&&(b=a.panel,null===b?(a.Hh.set(a.ub),a.Yk=a.scale,wl(a,!1)):null!==b.td&&(c=a.Hh,c.reset(),b.ae()?c.multiply(b.Hh):null!==b.panel&&c.multiply(b.panel.Hh),c.multiply(a.ub),a.Yk=a.scale*b.Yk,wl(a,!1)))} function dl(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var g=Pc;a.yg()&&a.locationSpot.Za()&&(g=a.locationSpot);var h=J.alloc();if(a instanceof T&&a.locationObject!==a)for(c=a.locationObject,d=c.naturalBounds,h.vk(d.x,d.y,d.width,d.height,g),c.Tf.va(h),h.offset(-c.measuredBounds.x,-c.measuredBounds.y),g=c.panel;null!==g&&g!==a;)g.Tf.va(h),h.offset(-g.measuredBounds.x,-g.measuredBounds.y),g=g.panel;else h.vk(c,d,e,f,g);b.rotate(a.angle,h.x,h.y);J.free(h)}} t.v=function(a){void 0===a&&(a=!1);if(!0!==pj(this)){kj(this,!0);gl(this,!0);var b=this.panel;null===b||a||b.v()}};t.jm=function(){!0!==pj(this)&&(kj(this,!0),gl(this,!0))};function xl(a){if(!1===qj(a)){var b=a.panel;null!==b?b.v():a.yg()&&(b=a.diagram,null!==b&&(b.Fd.add(a),a instanceof V&&a.gd(),b.ec()));gl(a,!0)}}t.ll=function(){0!==(this.I&2048)===!1&&(vl(this,!0),wl(this,!0))};t.sv=function(){wl(this,!0)};t.S=function(){var a=this.part;null!==a&&a.S()}; function fl(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===W.Table)return yl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===W.Auto&&d.Bb()===a)return zl(a,Id,b);if(c===Qk){if(null!==d){if(d.type===W.Spot&&d.Bb()===a)return zl(a,Id,b);c=d.defaultStretch;return c===Qk?zl(a,Pg,b):zl(a,c,b)}return zl(a,Pg,b)}return zl(a,c,b)} function yl(a,b,c,d){var e=a.stretch;if(e!==Qk)return zl(a,e,d);var f=e=null;switch(b.stretch){case Sk:f=!0;break;case Id:f=!0}switch(c.stretch){case Rk:e=!0;break;case Id:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===Rk||b===Id);null===f&&(f=b===Sk||b===Id);return!0===e&&!0===f?zl(a,Id,d):!0===e?zl(a,Rk,d):!0===f?zl(a,Sk,d):zl(a,Pg,d)} function zl(a,b,c){if(c)return b;if(b===Pg)return Pg;c=a.desiredSize;if(c.o())return Pg;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===Rk)return Pg;if(b===Id)return Sk}else{if(b===Sk)return Pg;if(b===Id)return Rk}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===Sk)return Pg;if(b===Id)return Rk}else{if(b===Rk)return Pg;if(b===Id)return Sk}return b}function ql(a,b){a.I=b?a.I|512:a.I&-513}function $k(a){return 0!==(a.I&1024)}function Al(a,b){a.I=b?a.I|1024:a.I&-1025} function vl(a,b){a.I=b?a.I|2048:a.I&-2049}function wl(a,b){a.I=b?a.I|4096:a.I&-4097}function pj(a){return 0!==(a.I&8192)}function kj(a,b){a.I=b?a.I|8192:a.I&-8193}function qj(a){return 0!==(a.I&16384)}function gl(a,b){a.I=b?a.I|16384:a.I&-16385}t.Yi=function(a){this.fg=a};t.Uv=function(){};t.Tv=function(a){this.ua=a;xl(this);return!0};t.Ct=function(a,b){this.ua.h(a,b);this.ll()}; function Bl(a){var b=a.part;if(b instanceof V&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||jl(b,a)}}function Cl(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof W?a instanceof V?a.gd():a.yk(a,function(a){Bl(a)}):Bl(a))}t.bind=function(a){a.Sd=this;var b=this.Mi();null!==b&&Dl(b)&&v("Cannot add a Binding to a template that has already been copied: "+a);null===this.eb&&(this.eb=new H);this.eb.add(a)}; t.Mi=function(){for(var a=this instanceof W?this:this.panel;null!==a;){if(null!==a.Uh)return a;a=a.panel}return null};t.Vv=function(a){wj(this,a)}; function El(a,b){for(var c=1;ce)&&v("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)&&v("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new jb;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);wj(a,e)}else wj(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+ a)}function Jl(a,b){A(a,"string",N,"defineBuilder:name");A(b,"function",N,"defineBuilder:func");var c=a.toLowerCase();F&&(""===a||"none"===c||a===c)&&v("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);Fl.add(a,b)} function Kl(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(N.prototype,{shadowVisible:{configurable:!0,get:function(){return this.Il},set:function(a){var b=this.Il;b!==a&&(F&&null!==a&&A(a,"boolean",N,"shadowVisible"),this.Il=a,this.S(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.P?this.P.Gn:null},set:function(a){Xk(this);var b=this.P.Gn;b!==a&&(null!==a&&A(a,"function",N,"enabledChanged"),this.P.Gn=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0, enumerable:!0,get:function(){return this.Gl},set:function(a){var b=this.Gl;b!==a&&(F&&hb(a,S,N,"segmentOrientation"),this.Gl=a,this.v(),this.g("segmentOrientation",b,a),a===Eg&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return this.op},set:function(a){F&&A(a,"number",N,"segmentIndex");a=Math.round(a);var b=this.op;b!==a&&(this.op=a,this.v(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return this.El},set:function(a){F&& A(a,"number",N,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1a||1=a&&v("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Da=a,this.v(),this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.Bc},set:function(a){var b=this.Bc;b!==a&&(F&&C(a,N,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.Bc=a,Cl(this),this.v(), this.g("angle",b,a)))}},desiredSize:{configurable:!0,get:function(){return this.Qc},set:function(a){F&&w(a,Ib,N,"desiredSize");var b=a.width,c=a.height,d=this.Qc,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Qc=a=a.J(),this.v(),this instanceof ag&&this.cc(),this.g("desiredSize",d,a),$k(this)&&(a=this.part,null!==a&&(al(this,a,"width"),al(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.Qc.width},set:function(a){var b= this.Qc.width;b===a||isNaN(b)&&isNaN(a)||(F&&A(a,"number",N,"width"),b=this.Qc,this.Qc=a=(new Ib(a,this.Qc.height)).freeze(),this.v(),this instanceof ag&&this.cc(),this.g("desiredSize",b,a),$k(this)&&(a=this.part,null!==a&&al(this,a,"width")))}},height:{configurable:!0,get:function(){return this.Qc.height},set:function(a){var b=this.Qc.height;b===a||isNaN(b)&&isNaN(a)||(F&&A(a,"number",N,"height"),b=this.Qc,this.Qc=a=(new Ib(this.Qc.width,a)).freeze(),this.v(),this instanceof ag&&this.cc(), this.g("desiredSize",b,a),$k(this)&&(a=this.part,null!==a&&al(this,a,"height")))}},minSize:{configurable:!0,get:function(){return this.Vf},set:function(a){var b=this.Vf;b.A(a)||(F&&w(a,Ib,N,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Vf=a,this.v(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return this.Uf},set:function(a){var b=this.Uf;b.A(a)||(F&&w(a,Ib,N,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width= Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Uf=a,this.v(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.qc}},naturalBounds:{configurable:!0,get:function(){return this.rc}},margin:{configurable:!0,get:function(){return this.Yg},set:function(a){"number"===typeof a?a=new kc(a):F&&w(a,kc,N,"margin");var b=this.Yg;b.A(a)||(this.Yg=a=a.J(),this.v(),this.g("margin",b,a))}},transform:{configurable:!0, get:function(){0!==(this.I&2048)===!0&&ll(this);return this.ub}},td:{configurable:!0,get:function(){0!==(this.I&4096)===!0&&ll(this);return this.Hh}},alignment:{configurable:!0,get:function(){return this.xb},set:function(a){var b=this.xb;b.A(a)||(F&&w(a,M,N,"alignment"),a.Nb()&&!a.Cb()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.xb=a=a.J(),xl(this),this.g("alignment",b,a))}},column:{configurable:!0,get:function(){return this.Ig}, set:function(a){F&&C(a,N,"column");a=Math.round(a);var b=this.Ig;b!==a&&(0>a&&ya(a,">= 0",N,"column"),this.Ig=a,this.v(),this.g("column",b,a))}},columnSpan:{configurable:!0,get:function(){return this.dn},set:function(a){F&&A(a,"number",N,"columnSpan");a=Math.round(a);var b=this.dn;b!==a&&(1>a&&ya(a,">= 1",N,"columnSpan"),this.dn=a,this.v(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.jp},set:function(a){F&&C(a,N,"row");a=Math.round(a);var b= this.jp;b!==a&&(0>a&&ya(a,">= 0",N,"row"),this.jp=a,this.v(),this.g("row",b,a))}},rowSpan:{configurable:!0,get:function(){return this.kp},set:function(a){F&&A(a,"number",N,"rowSpan");a=Math.round(a);var b=this.kp;b!==a&&(1>a&&ya(a,">= 1",N,"rowSpan"),this.kp=a,this.v(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return this.Ap},set:function(a){var b=this.Ap;b!==a&&(null!==a&&A(a,"function",N,"spanAllocation"),this.Ap=a,this.v(),this.g("spanAllocation", b,a))}},alignmentFocus:{configurable:!0,get:function(){return this.Dk},set:function(a){var b=this.Dk;b.A(a)||(F&&w(a,M,N,"alignmentFocus"),!F||!a.Nb()||a.Cb()||a.lq()&&this instanceof V||v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Dk=a=a.J(),this.v(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.Wo},set:function(a){var b=this.Wo;if(b!==a){F&&null!==a&&A(a,"string",N,"portId");var c=this.part;null=== c||c instanceof V||(v("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&Ml(c,this);this.Wo=a;null!==a&&null!==c&&(c.Ah=!0,Nl(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0,get:function(){return null!==this.R?this.R.ph:Ic},set:function(a){this.Jc();var b=this.R.ph;b.A(a)||(F&&w(a,M,N,"toSpot"),a=a.J(),this.R.ph=a,this.g("toSpot",b,a),Bl(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.R?this.R.nh:10},set:function(a){this.Jc(); var b=this.R.nh;b!==a&&(F&&A(a,"number",N,"toEndSegmentLength"),0>a&&ya(a,">= 0",N,"toEndSegmentLength"),this.R.nh=a,this.g("toEndSegmentLength",b,a),Bl(this))}},toShortLength:{configurable:!0,get:function(){return null!==this.R?this.R.oh:0},set:function(a){this.Jc();var b=this.R.oh;b!==a&&(F&&A(a,"number",N,"toShortLength"),this.R.oh=a,this.g("toShortLength",b,a),Bl(this))}},toLinkable:{configurable:!0,get:function(){return null!==this.R?this.R.Hp:null},set:function(a){this.Jc(); var b=this.R.Hp;b!==a&&(F&&null!==a&&A(a,"boolean",N,"toLinkable"),this.R.Hp=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!==this.R?this.R.Ip:Infinity},set:function(a){this.Jc();var b=this.R.Ip;b!==a&&(F&&A(a,"number",N,"toMaxLinks"),0>a&&ya(a,">= 0",N,"toMaxLinks"),this.R.Ip=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.R?this.R.Rg:Ic},set:function(a){this.Jc();var b=this.R.Rg;b.A(a)||(F&& w(a,M,N,"fromSpot"),a=a.J(),this.R.Rg=a,this.g("fromSpot",b,a),Bl(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.R?this.R.Pg:10},set:function(a){this.Jc();var b=this.R.Pg;b!==a&&(F&&A(a,"number",N,"fromEndSegmentLength"),0>a&&ya(a,">= 0",N,"fromEndSegmentLength"),this.R.Pg=a,this.g("fromEndSegmentLength",b,a),Bl(this))}},fromShortLength:{configurable:!0,get:function(){return null!==this.R?this.R.Qg:0},set:function(a){this.Jc();var b=this.R.Qg; b!==a&&(F&&A(a,"number",N,"fromShortLength"),this.R.Qg=a,this.g("fromShortLength",b,a),Bl(this))}},fromLinkable:{configurable:!0,get:function(){return null!==this.R?this.R.In:null},set:function(a){this.Jc();var b=this.R.In;b!==a&&(F&&null!==a&&A(a,"boolean",N,"fromLinkable"),this.R.In=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0,get:function(){return null!==this.R?this.R.Jn:Infinity},set:function(a){this.Jc();var b=this.R.Jn;b!==a&&(F&&A(a,"number",N,"fromMaxLinks"), 0>a&&ya(a,">= 0",N,"fromMaxLinks"),this.R.Jn=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0,get:function(){return this.on},set:function(a){var b=this.on;b!==a&&(A(a,"string",N,"cursor"),this.on=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.P?this.P.Ff:null},set:function(a){Xk(this);var b=this.P.Ff;b!==a&&(null!==a&&A(a,"function",N,"click"),this.P.Ff=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return null!== this.P?this.P.Kf:null},set:function(a){Xk(this);var b=this.P.Kf;b!==a&&(null!==a&&A(a,"function",N,"doubleClick"),this.P.Kf=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.P?this.P.Gf:null},set:function(a){Xk(this);var b=this.P.Gf;b!==a&&(null!==a&&A(a,"function",N,"contextClick"),this.P.Gf=a,this.g("contextClick",b,a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.P?this.P.Xf:null},set:function(a){Xk(this); var b=this.P.Xf;b!==a&&(null!==a&&A(a,"function",N,"mouseEnter"),this.P.Xf=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.P?this.P.$f:null},set:function(a){Xk(this);var b=this.P.$f;b!==a&&(null!==a&&A(a,"function",N,"mouseLeave"),this.P.$f=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0,get:function(){return null!==this.P?this.P.ag:null},set:function(a){Xk(this);var b=this.P.ag;b!==a&&(null!==a&&A(a,"function",N,"mouseOver"), this.P.ag=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.P?this.P.Zf:null},set:function(a){Xk(this);var b=this.P.Zf;b!==a&&(null!==a&&A(a,"function",N,"mouseHover"),this.P.Zf=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return null!==this.P?this.P.Yf:null},set:function(a){Xk(this);var b=this.P.Yf;b!==a&&(null!==a&&A(a,"function",N,"mouseHold"),this.P.Yf=a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0, enumerable:!0,get:function(){return null!==this.P?this.P.yo:null},set:function(a){Xk(this);var b=this.P.yo;b!==a&&(null!==a&&A(a,"function",N,"mouseDragEnter"),this.P.yo=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0,get:function(){return null!==this.P?this.P.zo:null},set:function(a){Xk(this);var b=this.P.zo;b!==a&&(null!==a&&A(a,"function",N,"mouseDragLeave"),this.P.zo=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{configurable:!0,get:function(){return null!== this.P?this.P.Wf:null},set:function(a){Xk(this);var b=this.P.Wf;b!==a&&(null!==a&&A(a,"function",N,"mouseDrop"),this.P.Wf=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!==this.P?this.P.Om:null},set:function(a){Xk(this);var b=this.P.Om;b!==a&&(null!==a&&A(a,"function",N,"actionDown"),this.P.Om=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!==this.P?this.P.Pm:null},set:function(a){Xk(this);var b=this.P.Pm; b!==a&&(null!==a&&A(a,"function",N,"actionMove"),this.P.Pm=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.P?this.P.Qm:null},set:function(a){Xk(this);var b=this.P.Qm;b!==a&&(null!==a&&A(a,"function",N,"actionUp"),this.P.Qm=a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.P?this.P.Nm:null},set:function(a){Xk(this);var b=this.P.Nm;b!==a&&(null!==a&&A(a,"function",N,"actionCancel"),this.P.Nm= a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.P?this.P.mg:null},set:function(a){Xk(this);var b=this.P.mg;b!==a&&(!F||null===a||a instanceof Ve||a instanceof $e||v("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.P.mg=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.P?this.P.Hf:null},set:function(a){Xk(this);var b=this.P.Hf;b!==a&&(!F||a instanceof Ve||a instanceof $e||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."), this.P.Hf=a,this.g("contextMenu",b,a))}}});N.prototype.setProperties=N.prototype.Vv;N.prototype.findTemplateBinder=N.prototype.Mi;N.prototype.bind=N.prototype.bind;N.prototype.isEnabledObject=N.prototype.xg;N.prototype.isVisibleObject=N.prototype.vf;N.prototype.isContainedBy=N.prototype.wg;N.prototype.getNearestIntersectionPoint=N.prototype.Wc;N.prototype.getLocalPoint=N.prototype.bt;N.prototype.getDocumentScale=N.prototype.Ge;N.prototype.getDocumentAngle=N.prototype.Pi; N.prototype.getDocumentBounds=N.prototype.fq;N.prototype.getDocumentPoint=N.prototype.oa;N.prototype.intersectsRect=N.prototype.Kc;N.prototype.containedInRect=N.prototype.xh;N.prototype.containsRect=N.prototype.qf;N.prototype.containsPoint=N.prototype.ea;N.prototype.raiseChanged=N.prototype.g;N.prototype.raiseChangedEvent=N.prototype.cb;N.prototype.addCopyProperty=N.prototype.Ww;var Fl=null;N.className="GraphObject";Fl=new Db; Jl("Button",function(){function a(a,b){return null!==a.diagram.Tb(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=El(W,W.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof W){var c=a.bb("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"},El(ag,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new M(0,0,2.76142374915397,2.761423749153969),spot2:new M(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.xg()&&b instanceof W&&(a=b.bb("ButtonBorder"),a instanceof ag)){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.xg()&&b instanceof W&&(a=b.bb("ButtonBorder"),a instanceof ag&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.xg()&&b instanceof W&&null!==b._buttonFillPressed&&0===a.button){var c=b.bb("ButtonBorder");if(c instanceof ag){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.xg()&&d instanceof W&&null!==d._buttonFillPressed&&0===b.button){var c=d.bb("ButtonBorder");if(c instanceof ag){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.xg()&&d instanceof W&&null!==d._buttonFillPressed){var c=d.bb("ButtonBorder");if(c instanceof ag){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.xg()&&d instanceof W&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.bb("ButtonBorder"),b instanceof ag))){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}); Jl("TreeExpanderButton",function(){var a=El("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},El(ag,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Yb},(new Bi("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).sq()),{visible:!1},(new Bi("visible","isTreeLeaf",function(a){return!a})).sq());a.click=function(a,c){c=c.part;c instanceof Ve&&(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}); Jl("SubGraphExpanderButton",function(){var a=El("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},El(ag,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Yb},(new Bi("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).sq()));a.click=function(a,c){c=c.part;c instanceof Ve&&(c=c.adornedPart);if(c instanceof Rf){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});Jl("ToolTip",function(){return El(Ve,W.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},El(ag,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new M(0,0,4,6),spot2:new M(1,1,-4,-4)}))}); Jl("ContextMenu",function(){return El(Ve,W.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},new Bi("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Jl("ContextMenuButton",function(){var a=El("Button");a.stretch=Rk;var b=a.bb("ButtonBorder");b instanceof ag&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new M(0,0,2,3),b.spot2=new M(1,1,-2,-2));return a}); Jl("PanelExpanderButton",function(a){var b=Kl(a,"COLLAPSIBLE"),c=El("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},El(ag,{name:"ButtonIcon",strokeWidth:2},(new Bi("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).sq(b))); a=c.bb("ButtonBorder");a instanceof ag&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){a=c.diagram;if(null!==a&&!a.isReadOnly){var d=c.Mi();null===d&&(d=c.part);null!==d&&(c=d.bb(b),null!==c&&(a.Ca("Collapse/Expand Panel"),c.visible=!c.visible,a.ab("Collapse/Expand Panel")))}};return c}); Jl("CheckBoxButton",function(a){var b=Kl(a);a=El("Button",{desiredSize:new Ib(14,14)},El(ag,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Id,geometryStretch:Rg,visible:!1},""!==b?(new Bi("visible",b)).zx():[]));a.click=function(a,d){if(d instanceof W){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.bb("ButtonIcon");c.Ca("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.ab("checkbox")}}};return a}); Jl("CheckBox",function(a){a=Kl(a);a=El("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new kc(0,1,0,0)});var b=El(W,"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});N.None=Pg=new E(N,"None",0);N.Default=Qk=new E(N,"Default",0);N.Vertical=Sk=new E(N,"Vertical",4);N.Horizontal=Rk=new E(N,"Horizontal",5);N.Fill=Id=new E(N,"Fill",3);N.Uniform=Rg=new E(N,"Uniform",1); N.UniformToFill=Tk=new E(N,"UniformToFill",2);N.FlipVertical=Uk=new E(N,"FlipVertical",1);N.FlipHorizontal=Vk=new E(N,"FlipHorizontal",2);N.FlipBoth=Wk=new E(N,"FlipBoth",3);N.make=El;N.getBuilders=function(){var a=new Db,b;for(b in Fl)if(b!==b.toLowerCase()){var c=Fl.K(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};N.defineBuilder=Jl;N.takeBuilderArgument=Kl; function Yk(){this.Gn=this.Hf=this.mg=this.Nm=this.Qm=this.Pm=this.Om=this.Wf=this.zo=this.yo=this.Yf=this.Zf=this.ag=this.$f=this.Xf=this.Gf=this.Kf=this.Ff=null}Yk.prototype.copy=function(){var a=new Yk;a.Ff=this.Ff;a.Kf=this.Kf;a.Gf=this.Gf;a.Xf=this.Xf;a.$f=this.$f;a.ag=this.ag;a.Zf=this.Zf;a.Yf=this.Yf;a.yo=this.yo;a.zo=this.zo;a.Wf=this.Wf;a.Om=this.Om;a.Pm=this.Pm;a.Qm=this.Qm;a.Nm=this.Nm;a.mg=this.mg;a.Hf=this.Hf;a.Gn=this.Gn;return a};Yk.className="GraphObjectEventHandlers"; function Ol(){this.Qa=[1,0,0,1,0,0]}Ol.prototype.copy=function(){var a=new Ol;a.Qa[0]=this.Qa[0];a.Qa[1]=this.Qa[1];a.Qa[2]=this.Qa[2];a.Qa[3]=this.Qa[3];a.Qa[4]=this.Qa[4];a.Qa[5]=this.Qa[5];return a};Ol.prototype.translate=function(a,b){this.Qa[4]+=this.Qa[0]*a+this.Qa[2]*b;this.Qa[5]+=this.Qa[1]*a+this.Qa[3]*b};Ol.prototype.scale=function(a,b){this.Qa[0]*=a;this.Qa[1]*=a;this.Qa[2]*=b;this.Qa[3]*=b};Ol.className="STransform"; function Pl(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.ex=[];this.pattern=null}Pl.prototype.addColorStop=function(a,b){this.ex.push({offset:a,color:b})};Pl.className="SGradient"; function zj(a,b){this.ownerDocument=a=void 0===b?pa.document:b;this.Qz="http://www.w3.org/2000/svg";void 0!==a&&(this.Ha=this.vb("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Ha.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Ha.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.$p=null;this.context=new Ql(this)} zj.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.Ha.setAttributeNS(null,"width",c+"px"),this.Ha.setAttributeNS(null,"height",d+"px"),this.Ha.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.nu.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.nu.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; zj.prototype.vb=function(a,b,c){a=this.ownerDocument.createElementNS(this.Qz,a);if(Fa(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};zj.prototype.getBoundingClientRect=function(){return this.Ha.getBoundingClientRect()};zj.prototype.focus=function(){this.Ha.focus()};zj.prototype.kx=function(){this.ownerDocument=null}; ma.Object.defineProperties(zj.prototype,{width:{configurable:!0,get:function(){return this.Ha.width.baseVal.value},set:function(a){this.Ha.width=a}},height:{configurable:!0,get:function(){return this.Ha.height.baseVal.value},set:function(a){this.Ha.height=a}},style:{configurable:!0,get:function(){return this.Ha.style}}});zj.className="SVGSurface"; function Ql(a){this.xk=a;this.svg=a.Ha;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.Qd=this.wp=this.vp=0;this.mq=null;this.path=[];this.iu=!1;this.ih=null;this.jh=0;this.Ud=new Ol; Rl(this,1,0,0,1,0,0);var b=xb++,c=this.vb("clipPath",{id:"mainClip"+b});c.appendChild(this.vb("rect",{x:0,y:0,width:a.width,height:a.height}));this.nu=c;this.xk.Ha.appendChild(c);this.yc[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.Sz={}}t=Ql.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.Qd=this.wp=this.vp=0;this.mq=null;this.path=[];this.Ud=new Ol;Rl(this,1,0,0,1,0,0);var a=xb++,b=this.vb("clipPath", {id:"mainClip"+a});b.appendChild(this.vb("rect",{x:0,y:0,width:this.xk.width,height:this.xk.height}));this.nu=b;this.xk.Ha.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.Ud);this.addPath("clipPath",this.path,new Ol)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new Pl("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.Sz;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+xb++,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 Pl("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;l={x:0,y:0,width:m||d,height:n||e,href:l,preserveAspectRatio:"xMidYMid slice"};K.da(d,h)&&K.da(e,k)||(l.preserveAspectRatio="none");a="";h/=d;k/=e;if(0!== f||0!==g)a+=" translate("+f+", "+g+")";if(1!==h||1!==k)a+=" scale("+h+", "+k+")";if(0!==b||0!==c)a+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+xb++,g=this.vb("clipPath",{id:f}),g.appendChild(this.vb("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),l["clip-path"]="url(#"+f+")";Sl(this,"image",l,this.Ud,a);this.addElement("image",l)};t.fill=function(){this.addPath("fill",this.path,this.Ud)};t.Vd=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]};Sl(this,"fill",a,this.Ud);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};Sl(this,"fill",b,this.Ud);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.Ud=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;Rl(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.yg()&&!this.isVisible())return!0;a.Ud.Qa=[1,0,0,1,0,0];(this instanceof lh&&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.cn?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.cn?this.clip():this.fill()};t.aj=function(){this.cn||this.stroke()};t.Wv=function(a,b,c){this.vp=a;this.wp=b;this.Qd=c}; t.Vs=function(a,b){var c=this.Y;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Ts=function(){var a=this.Y;void 0!==a.setLineDash&&(a.setLineDash(Ul),a.lineDashOffset=0)};t.Uc=function(a){a&&(this.Pt="");this.Ot=this.Qt=""}; ma.Object.defineProperties(sl.prototype,{fillStyle:{configurable:!0,get:function(){return this.Y.fillStyle},set:function(a){this.Ot!==a&&(this.Ot=this.Y.fillStyle=a)}},font:{configurable:!0,get:function(){return this.Y.font},set:function(a){this.Pt!==a&&(this.Pt=this.Y.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.Y.globalAlpha},set:function(a){this.Y.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.Y.lineCap}, set:function(a){this.Y.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.Y.lineDashOffset},set:function(a){this.Y.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.Y.lineJoin},set:function(a){this.Y.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.Y.lineWidth},set:function(a){this.Y.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.Y.miterLimit},set:function(a){this.Y.miterLimit= a}},shadowBlur:{configurable:!0,get:function(){return this.Y.shadowBlur},set:function(a){this.Y.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.Y.shadowColor},set:function(a){this.Y.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.Y.shadowOffsetX},set:function(a){this.Y.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.Y.shadowOffsetY},set:function(a){this.Y.shadowOffsetY= a}},strokeStyle:{configurable:!0,get:function(){return this.Y.strokeStyle},set:function(a){this.Qt!==a&&(this.Qt=this.Y.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.Y.textAlign},set:function(a){this.Y.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.Y.imageSmoothingEnabled},set:function(a){this.Y.imageSmoothingEnabled=a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.cn}, set:function(a){this.cn=a}}});var Ul=Object.freeze([]);sl.className="CanvasSurfaceContext";function Vl(){this.ca=this.w=this.L=this.l=0}Vl.className="ColorNumbers"; function ol(a){F&&1a)&&ya(a,"0 <= loc <= 1",ol,"addColorStop:loc");A(b,"string",ol,"addColorStop:color");F&&!Yl(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.fe&&(this.fe=new Db);this.fe.add(a,b);this.wa===rl&&(this.type=ul);this.ge=null;return this}; function Yl(a){if("black"===a)return!0;if(""===a)return!1;F&&A(a,"string",ol,"isValidColor");Wl||(Xl(),Wl=!0);var b=Zl;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} t.Kz=function(a,b){this.u&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?$l:b;if(this.type===rl)am(this.color),this.color=bm(a,b);else if((this.type===ul||this.type===pl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)am(c.value),this.addColorStop(c.key,bm(a,b));return this};function cm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?$l:c;am(a);return bm(b,c)} t.Fy=function(a,b){this.u&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?$l:b;if(this.type===rl)am(this.color),this.color=bm(-a,b);else if((this.type===ul||this.type===pl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)am(c.value),this.addColorStop(c.key,bm(-a,b));return this};function dm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?$l:c;am(a);return bm(-b,c)} function em(a,b,c){am(a);a=fm.l;var d=fm.L,e=fm.w,f=fm.ca;am(b);void 0===c&&(c=.5);return"rgba("+Math.round((fm.l-a)*c+a)+", "+Math.round((fm.L-d)*c+d)+", "+Math.round((fm.w-e)*c+e)+", "+Math.round((fm.ca-f)*c+f)+")"} t.wx=function(){if(this.type===rl)return gm(this.color);if((this.type===ul||this.type===pl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===pl)return gm(a.first().value);if(null!==a.get(.5))return gm(a.get(.5));if(2===a.count)return a=a.Oa(),gm(em(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&&(c=[d,d=c][0]);b=d-c;return gm(em(a.get(c),a.get(d),1-e/b))}return!1}; function gm(a){if(null===a)return null;if(a instanceof ol)return a.wx();am(a);return 128>(299*fm.l+587*fm.L+114*fm.w)/1E3} function bm(a,b){switch(b){case $l:var c=100*hm(fm.l);b=100*hm(fm.L);var d=100*hm(fm.w);im.l=.4124564*c+.3575761*b+.1804375*d;im.L=.2126729*c+.7151522*b+.072175*d;im.w=.0193339*c+.119192*b+.9503041*d;im.ca=fm.ca;c=jm(im.l/km[0]);b=jm(im.L/km[1]);d=jm(im.w/km[2]);lm.l=116*b-16;lm.L=500*(c-b);lm.w=200*(b-d);lm.ca=im.ca;lm.l=Math.min(100,Math.max(0,lm.l+100*a));a=(lm.l+16)/116;c=a-lm.w/200;im.l=km[0]*mm(lm.L/500+a);im.L=km[1]*(lm.l>nm*om?Math.pow(a,3):lm.l/nm);im.w=km[2]*mm(c);im.ca=lm.ca;a=-.969266* im.l+1.8760108*im.L+.041556*im.w;c=.0556434*im.l+-.2040259*im.L+1.0572252*im.w;fm.l=255*pm((3.2404542*im.l+-1.5371385*im.L+-.4985314*im.w)/100);fm.L=255*pm(a/100);fm.w=255*pm(c/100);fm.ca=im.ca;fm.l=Math.round(fm.l);255fm.l&&(fm.l=0);fm.L=Math.round(fm.L);255fm.L&&(fm.L=0);fm.w=Math.round(fm.w);255fm.w&&(fm.w=0);return"rgba("+fm.l+", "+fm.L+", "+fm.w+", "+fm.ca+")";case qm:b=fm.l/255;d=fm.L/255;var e=fm.w/255,f=Math.max(b,d,e),g=Math.min(b,d,e),h= f-g;g=(f+g)/2;if(0===h)c=b=0;else{switch(f){case b:c=(d-e)/h%6;break;case d:c=(e-b)/h+2;break;case e:c=(b-d)/h+4}c*=60;0>c&&(c+=360);b=h/(1-Math.abs(2*g-1))}rm.l=Math.round(c);rm.L=Math.round(100*b);rm.w=Math.round(100*g);rm.ca=fm.ca;rm.w=Math.min(100,Math.max(0,rm.w+100*a));return"hsla("+rm.l+", "+rm.L+"%, "+rm.w+"%, "+rm.ca+")";default:return v("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} function am(a){Wl||(Xl(),Wl=!0);var b=Zl;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,fm.l=a[0],fm.L=a[1],fm.w=a[2],fm.ca=a[3]/255):(b.fillStyle="#FFFFFF",c=b.fillStyle,b.fillStyle=a,b.fillStyle===c&&F&&v('Color "'+a+'" is not a valid color string for RGBA color conversion'),fm.l=0,fm.L=0,fm.w=0,fm.ca=1)}}function hm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)} function pm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function jm(a){return a>om?Math.pow(a,1/3):(nm*a+16)/116}function mm(a){var b=a*a*a;return b>om?b:(116*a-16)/nm}function Ll(a,b){"string"===typeof a?F&&!Yl(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof ol||v("Value for "+b+" must be a color string or a Brush, not "+a)}function Xl(){Zl=jh?(new yk(null)).context:null} ma.Object.defineProperties(ol.prototype,{type:{configurable:!0,get:function(){return this.wa},set:function(a){this.u&&va(this,a);hb(a,ol,ol,"type");this.wa=a;this.start.Nb()&&(a===ul?this.start=Kc:a===pl&&(this.start=Pc));this.end.Nb()&&(a===ul?this.end=Sc:a===pl&&(this.end=Pc));this.ge=null}},color:{configurable:!0,get:function(){return this.Lk},set:function(a){this.u&&va(this,a);F&&!Yl(a)&&v('Color "'+a+'" is not a valid color string for Brush.color');this.Lk=a;this.ge= null}},start:{configurable:!0,get:function(){return this.Ml},set:function(a){this.u&&va(this,a);w(a,M,ol,"start");this.Ml=a.J();this.ge=null}},end:{configurable:!0,get:function(){return this.Zk},set:function(a){this.u&&va(this,a);w(a,M,ol,"end");this.Zk=a.J();this.ge=null}},startRadius:{configurable:!0,get:function(){return this.Fs},set:function(a){this.u&&va(this,a);C(a,ol,"startRadius");0>a&&ya(a,">= zero",ol,"startRadius");this.Fs=a;this.ge=null}},endRadius:{configurable:!0, enumerable:!0,get:function(){return this.tr},set:function(a){this.u&&va(this,a);C(a,ol,"endRadius");0>a&&ya(a,">= zero",ol,"endRadius");this.tr=a;this.ge=null}},colorStops:{configurable:!0,get:function(){return this.fe},set:function(a){this.u&&va(this,a);F&&w(a,Db,ol,"colorStops");this.fe=a;this.ge=null}},pattern:{configurable:!0,get:function(){return this.os},set:function(a){this.u&&va(this,a);this.os=a;this.ge=null}}});ol.prototype.isDark=ol.prototype.wx; ol.prototype.darkenBy=ol.prototype.Fy;ol.prototype.lightenBy=ol.prototype.Kz;ol.prototype.addColorStop=ol.prototype.addColorStop;var om=216/24389,nm=24389/27,km=[95.047,100,108.883],Zl=null,fm=new Vl,rm=new Vl,im=new Vl,lm=new Vl,Wl=!1;ol.className="Brush";var rl;ol.Solid=rl=new E(ol,"Solid",0);var ul;ol.Linear=ul=new E(ol,"Linear",1);var pl;ol.Radial=pl=new E(ol,"Radial",2);var tl;ol.Pattern=tl=new E(ol,"Pattern",4);var $l;ol.Lab=$l=new E(ol,"Lab",5);var qm;ol.HSL=qm=new E(ol,"HSL",6); ol.randomColor=function(a,b){void 0===a&&(a=128);F&&(C(a,ol,"randomColor:min"),(0>a||255b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+ a};ol.isValidColor=Yl;ol.lighten=function(a){return cm(a)};ol.lightenBy=cm;ol.darken=function(a){return dm(a)};ol.darkenBy=dm;ol.mix=em;ol.isDark=gm;function Il(){this.name="Base"}Il.prototype.measure=function(){};Il.prototype.Nz=function(a,b,c,d,e){a.measure(b,c,d,e)};Il.prototype.arrange=function(){};Il.prototype.uy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};ma.Object.defineProperties(Il.prototype,{classType:{configurable:!0,get:function(){return W}}}); Il.prototype.arrangeElement=Il.prototype.uy;Il.prototype.measureElement=Il.prototype.Nz;Il.className="PanelLayout";function sm(){this.name="Base";this.name="Position"}la(sm,Il); sm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=tm(a);for(var k=0;kZ&&(Bb=Math.max(Z-Bh,0));var rn=0===U.actual;U.actual=U.actual+Bb;Z=Math.max(Z-(Bb+(rn?Bh:0)),0)}if(1===Mc.columnSpan&&(Tb===Pg||Tb===Sk)){U=a.getColumnDefinition(Gc);var pg=U.vc();Bb=Math.max(fd-U.actual,0);Bb+pg>da&&(Bb=Math.max(da-pg,0));var Yj=0===U.actual;U.actual=U.actual+Bb;da=Math.max(da-(Bb+(Yj?pg:0)),0)}Jf&&Mc.jm()}}}}}Na(D); var lc=0,Wc=0;h=a.columnCount;for(var qc=0;qc=a.rowCount);Ne++)U=a.getRowDefinition($a.row+Ne),Bb=0,Bb=Tb===Id||Tb===Sk?Math.max(U.minimum,0===sd[$a.row+Ne]?U.maximum:Math.min(sd[$a.row+Ne],U.maximum)):Math.max(U.minimum,isNaN(U.Sc)? U.maximum:Math.min(U.Sc,U.maximum)),Od.height+=Bb;for(var Mf=1;Mf<$a.columnSpan&&!($a.column+Mf>=a.columnCount);Mf++)U=a.getColumnDefinition($a.column+Mf),Bb=0,Bb=Tb===Id||Tb===Rk?Math.max(U.minimum,0===ve[$a.column+Mf]?U.maximum:Math.min(ve[$a.column+Mf],U.maximum)):Math.max(U.minimum,isNaN(U.Sc)?U.maximum:Math.min(U.Sc,U.maximum)),Od.width+=Bb;ob.width+=Od.width;ob.height+=Od.height;var mf=$a.margin,be=mf.right+mf.left,Oe=mf.top+mf.bottom;$a.measure(ob.width,ob.height,f,g);for(var nf=$a.measuredBounds, Pe=Math.max(nf.width+be,0),Qe=Math.max(nf.height+Oe,0),ud=0,wg=0;wg<$a.rowSpan&&!($a.row+wg>=a.rowCount);wg++)U=a.getRowDefinition($a.row+wg),ud+=U.total||0;if(ud=xe)&&!($a.row+vd>=a.rowCount);vd++){U=a.getRowDefinition($a.row+vd);var xg=U.ma||0,Ki=yn($a,U,xn);F&&"number"!==typeof Ki&&v($a+" spanAllocation does not return a number: "+Ki);U.actual=Math.min(U.maximum,xg+Ki);U.ma!==xg&&(xe-=U.ma- xg)}for(;0Hh&&(U.actual=Math.min(U.maximum,Hh+xe),U.ma!==Hh&&(xe-=U.ma-Hh));if(0===U.index)break;U=a.getRowDefinition(U.index-1)}}for(var yg=0,Zj=0;Zj<$a.columnSpan&&!($a.column+Zj>=a.columnCount);Zj++)U=a.getColumnDefinition($a.column+Zj),yg+=U.total||0;if(yg=Li)&&!($a.column+ak>=a.columnCount);ak++){U=a.getColumnDefinition($a.column+ak);var zn= U.ma||0,An=Jt($a,U,It);F&&"number"!==typeof An&&v($a+" spanAllocation does not return a number: "+An);U.actual=Math.min(U.maximum,zn+An);U.ma!==zn&&(Li-=U.ma-zn)}for(;0bk&&(U.actual=Math.min(U.maximum,bk+Li),U.ma!==bk&&(Li-=U.ma-bk));if(0===U.index)break;U=a.getColumnDefinition(U.index-1)}}}}Na(G);Ib.free(Od);Ib.free(ob);void 0!==sd&&Na(sd);void 0!==ve&&Na(ve);var zg=0,Ag=0,ck=a.desiredSize,er=a.maxSize;Tb=fl(a,!0);var Mi=Wc=lc=0,Ni=0;h=a.columnCount; for(var dk=0;dk=a.rowCount);R++)Q=a.getRowDefinition(q+R),r.height+=Q.total;for(R=1;R=a.columnCount);R++)Q=a.getColumnDefinition(x+R),r.width+=Q.total;var da=y.ma+r.width,Z=u.ma+r.height; R=h;Q=k;var sa=da,Ca=Z,U=h,Va=k,Ya=da,ub=Z;h+da>c.width&&(Ya=Math.max(c.width-h,0));k+Z>c.height&&(ub=Math.max(c.height-k,0));var Za=G.alignment;if(Za.Cb()){Za=a.defaultAlignment;Za.Za()||(Za=Pc);var Fb=Za.x;var Kd=Za.y;var Bb=Za.offsetX;Za=Za.offsetY;var pc=y.alignment,kb=u.alignment;pc.Za()&&(Fb=pc.x,Bb=pc.offsetX);kb.Za()&&(Kd=kb.y,Za=kb.offsetY)}else Fb=Za.x,Kd=Za.y,Bb=Za.offsetX,Za=Za.offsetY;if(isNaN(Fb)||isNaN(Kd))Kd=Fb=.5,Za=Bb=0;pc=O.width;kb=O.height;var Zd=G.margin,Gc=Zd.left+Zd.right, If=Zd.top+Zd.bottom,hf=yl(G,u,y,!1);!isNaN(G.desiredSize.width)||hf!==Id&&hf!==Rk||(pc=Math.max(da-Gc,0));!isNaN(G.desiredSize.height)||hf!==Id&&hf!==Sk||(kb=Math.max(Z-If,0));da=G.maxSize;Z=G.minSize;pc=Math.min(da.width,pc);kb=Math.min(da.height,kb);pc=Math.max(Z.width,pc);kb=Math.max(Z.height,kb);da=kb+If;R+=sa*Fb-(pc+Gc)*Fb+Bb+Zd.left;Q+=Ca*Kd-da*Kd+Za+Zd.top;G.visible&&(rc(U,Va,Ya,ub,R,Q,O.width,O.height)?G.arrange(R,Q,pc,kb):G.arrange(R,Q,pc,kb,new L(U,Va,Ya,ub)))}else G.ll(),G.actualBounds.ja(), sa=G.actualBounds,R=L.allocAt(sa.x,sa.y,sa.width,sa.height),sa.x=Q.type===W.TableRow?f:h,sa.y=Q.type===W.TableColumn?e:k,sa.width=O.width,sa.height=O.height,G.actualBounds.freeze(),gl(G,!1),ic(R,sa)||(O=G.part,null!==O&&(O.Bh(),G.Lo(O))),L.free(R)}}}Ib.free(r);for(a=0;af)y.measure(Infinity,Infinity,0,0),z=y.measuredBounds,b.Lc(z),a.l.push(z);else{var B=y.segmentIndex;z=y.segmentFraction;var D=y.alignmentFocus;D.Nb()&&(D=Pc);var G=y.segmentOrientation,O=y.segmentOffset;if(B<-f||B>=f){z=k.midPoint;var Q=k.midAngle;if(G!==Eg){var R=k.computeAngle(y,G, Q);y.Bc=R}R=z.x-m.x;var da=z.y-m.y}else{R=0;if(0<=B){da=n.O(B);var Z=BCa+10?0<=B?Q.Xa(da):da.Xa(Q):Ca>sa+10?0<=B?Z.Xa(R):R.Xa(Z):0<=B?Q.Xa(R):R.Xa(Q)}else Q=0<=B?da.Xa(Z):Z.Xa(da);G!==Eg&&(R=k.computeAngle(y,G,Q),y.Bc=R);R=da.x+(Z.x-da.x)*z-m.x;da=da.y+(Z.y-da.y)*z-m.y}y.measure(Infinity,Infinity,0,0);z=y.measuredBounds; Z=y.naturalBounds;var U=0;y instanceof ag&&(U=y.strokeWidth);sa=Z.width+U;Ca=Z.height+U;h.reset();h.translate(-z.x,-z.y);h.scale(y.scale,y.scale);h.rotate(G===Eg?y.angle:Q,sa/2,Ca/2);G!==Jm&&G!==Km||h.rotate(90,sa/2,Ca/2);G!==Lm&&G!==Mm||h.rotate(-90,sa/2,Ca/2);G===Nm&&(45Q||225Q)&&h.rotate(-Q,sa/2,Ca/2);Z=new L(0,0,sa,Ca);q.Zi(Z,D);h.va(q);D=-q.x+U/2*y.scale;y=-q.y+U/2*y.scale;u.assign(O);U=isNaN(O.x);var Va=isNaN(O.y);if(U||Va){sa=sa/2+3;Ca=Ca/2+3;var Ya=45<=Q&&135>=Q,ub=225<=Q&& 315>=Q;G===Eg&&(Ya||ub)?(u.x=Va?sa:O.y,u.y=U?Ca:O.x,Ya?0<=B||!U||(u.y=-Ca):ub&&(0<=B&&U&&(u.y=-Ca),Va&&(u.x=-sa))):(U&&(u.x=0<=B?sa:-sa),Va&&(u.y=-Ca),u.rotate(Q))}else u.rotate(Q);R+=u.x;da+=u.y;Z.set(z);Z.h(R+D,da+y,z.width,z.height);a.l.push(Z);b.Lc(Z)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.ng=b;a=a.location;a.h(a.x+b.x,a.y+b.y);fc(e,b.width||0,b.height||0);Jb.free(h);J.free(q);J.free(u)}}}}; Hm.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Ve||a instanceof S){var d=null,e=null,f=null;a instanceof S&&(e=d=a);a instanceof Ve&&(f=a,d=f.adornedPart);var g=a instanceof Ve?null:d.path;if(0!==a.l.length){var h=a.l,k=0;if(null!==g&&k=c){var q=n.midPoint;m=n.midAngle;r!==Eg&&(n=n.computeAngle(g,r,m),g.angle=n);n=q.x;var u=q.y}else{var x=0;0<=h?(u=b.j[h],q=hz+10?0<=h?m.Xa(u):u.Xa(m):z>y+10?0<=h?q.Xa(x):x.Xa(q): 0<=h?m.Xa(x):x.Xa(m)}else m=0<=h?u.Xa(q):q.Xa(u);r!==Eg&&(n=n.computeAngle(g,r,m),g.angle=n);n=u.x+(q.x-u.x)*p;u=u.y+(q.y-u.y)*p}l.lq()?g.location=new J(n,u):(l.Nb()&&(l=Pc),q=Jb.alloc(),q.reset(),q.scale(g.scale,g.scale),q.rotate(g.angle,0,0),p=g.naturalBounds,p=L.allocAt(0,0,p.width,p.height),r=J.alloc(),r.Zi(p,l),q.va(r),l=-r.x,x=-r.y,k=k.copy(),isNaN(k.x)&&(0<=h?k.x=r.x+3:k.x=-(r.x+3)),isNaN(k.y)&&(k.y=-(r.y+3)),k.rotate(m),n+=k.x,u+=k.y,q.cw(p),l+=p.x,x+=p.y,h=J.allocAt(n+l,u+x),g.move(h),J.free(h), J.free(r),L.free(p),Jb.free(q))}null!==f?f.lk(!1):null!==e&&e.lk(!1)}};function Im(a,b,c,d){if(!1!==pj(d)){var e=d.strokeWidth;0===e&&a instanceof Ve&&a.type===W.Link&&a.adornedObject instanceof ag&&(e=a.adornedObject.strokeWidth);e*=d.Da;a instanceof S&&null!==a.sa?(a=a.sa.bounds,cl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Ve&&null!==a.adornedPart.sa?(a=a.adornedPart.sa.bounds,cl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):cl(d,-(e/2),-(e/2),b+e,c+e);kj(d,!1)}} function Om(){this.name="Base";this.name="Graduated"}la(Om,Il); Om.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Bb();a.mj=[];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 L(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.mj.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,x=r.flattenedLengths,y=r.flattenedTotalLength,z=u.length,B=0,D=0,G=La(),O=0;OU&&(U+=360);R.push(U)}B=sa;D=Ca}G.push(R)}if(null===a.Sg){for(var Va=[],Ya=a.Z.j,ub=Ya.length,Za=0;ZaBb&&Kd.push(Zd)}}}a.Sg=Va}var Gc=a.Sg;var If=a.Z.j,hf=If.length,Le=0,Ah=0,Mc=y;a.oj=[];for(var Jf,jf=0;jfTb*Xj*y/a.graduatedRange)){var Kf=x[0][0],Ld=0,xc=0;Ah=y*$d.graduatedStart-1E-4;Mc=y*$d.graduatedEnd+1E-4;var kf=Tb*Xj,fd=a.graduatedTickBase;if(fda.graduatedMin+kf&&(fd-=Math.floor((fd-a.graduatedMin)/kf)*kf);for(var Bh=Gc[jf];fd<=a.graduatedMax;){a:{for(var rn=Bh.length,pg=0;pgy&&(Le=y),Ah<=Le&&Le<=Mc)){for(var lc=G[Ld][xc],Wc=x[Ld][xc];LdKf&&xclf?0Od;Od++){switch(Od){case 0:pb.h(Md,Nd);break;case 1:pb.h(Md+ug,Nd);break;case 2:pb.h(Md,Nd+zc);break;case 3:pb.h(Md+ug,Nd+zc)}pb.rotate(vg+cc.angle);pb.offset(Fh,Gh);0===Dh&&0===Od?ae.h(pb.x,pb.y,0,0):ae.Me(pb);pb.offset(-Fh,-Gh);pb.rotate(-vg-cc.angle)}J.free(pb);un.mj.push(ae);oc(Ii,ae.x,ae.y,ae.width,ae.height)}else if(cc instanceof lh){var sd=a,ve=e;null===sd.mh&&(sd.mh=new lh);var Ac=sd.mh;Pm(Ac,cc);var Ji=cc.alignmentFocus;Ji.Nb()&&(Ji=Kc);for(var td=cc.segmentOrientation,wn=cc.segmentOffset, we=null,$a=0,Pd=0,Bc=0,Ne=0,Mf=sg.length,mf=0;mfBc||225Bc)&&ud.rotate(-Bc,Pe/2,Qe/2);var wg=L.allocAt(0,0,Pe,Qe),xe=J.alloc();xe.Zi(wg,Ji);ud.va(xe);var xn=-xe.x,yn=-xe.y,vd=J.alloc();vd.assign(wn);isNaN(vd.x)&&(vd.x=Pe/2+3);isNaN(vd.y)&&(vd.y=-(Qe/2+3));vd.rotate(Bc);$a+=vd.x+xn;Pd+=vd.y+yn;var xg=new L($a,Pd,Oe.width,Oe.height),Ki=new L(Oe.x,Oe.y,Oe.width,Oe.height),Hh=new L(nf.x,nf.y,nf.width,nf.height),yg=new Qm;yg.am(Ac.metrics);be.push(Ne);be.push(Ac.lineCount);be.push(yg);be.push(xg);be.push(Ki);be.push(Hh);0===mf?we=xg.copy():we.Lc(xg);J.free(vd); J.free(xe);L.free(wg);Jb.free(ud)}sd.mj.push(we);oc(ve,we.x,we.y,we.width,we.height)}kj(cc,!1)}}};Om.prototype.arrange=function(a,b,c){if(null!==a.mj){var d=a.Bb(),e=a.oj,f=a.mj,g=0,h=f[g];g++;d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=b&&(b=1);var c=this.gridCellSize,d=c.width;c=c.height;var e=this.naturalBounds,f=this.actualBounds,g=e.width,h=e.height,k=Math.ceil(g/d),l=Math.ceil(h/c),m=this.gridOrigin;a.save();a.beginPath();a.rect(0,0,g,h);a.clip();for(var n=[],p=this.Z.j,r=p.length,q=0;qd*x*b))){u=B.opacity;y=1;if(1!==u){if(0===u)continue;y=a.globalAlpha;a.globalAlpha=y*u}z=n[q];var D=!1,G=B.strokeDashArray;null!==G&&(D=!0,a.Vs(G,B.strokeDashOffset));if("LineV"===B.figure&&null!==B.stroke){a.lineWidth=B.strokeWidth;gi(this,a,B.stroke,!1,!1,e,f);a.beginPath();for(G=B=Math.floor(-m.x/d);G<=B+k;G++){var O=G*d+m.x;0<=O&&O<=g&&Tm(G,x,z)&&(a.moveTo(O,0),a.lineTo(O,h))}a.stroke()}else if("LineH"===B.figure&&null!==B.stroke){a.lineWidth= B.strokeWidth;gi(this,a,B.stroke,!1,!1,e,f);a.beginPath();for(G=B=Math.floor(-m.y/c);G<=B+l;G++)O=G*c+m.y,0<=O&&O<=h&&Tm(G,x,z)&&(a.moveTo(0,O),a.lineTo(g,O));a.stroke()}else if("BarV"===B.figure&&null!==B.fill)for(gi(this,a,B.fill,!0,!1,e,f),B=B.width,isNaN(B)&&(B=d),O=G=Math.floor(-m.x/d);O<=G+k;O++){var Q=O*d+m.x;0<=Q&&Q<=g&&Tm(O,x,z)&&a.fillRect(Q,0,B,h)}else if("BarH"===B.figure&&null!==B.fill)for(gi(this,a,B.fill,!0,!1,e,f),B=B.height,isNaN(B)&&(B=c),O=G=Math.floor(-m.y/c);O<=G+l;O++)Q=O*c+ m.y,0<=Q&&Q<=h&&Tm(O,x,z)&&a.fillRect(0,Q,g,B);D&&a.Ts();1!==u&&(a.globalAlpha=y)}}a.restore();a.Uc(!1)}else if(this.wa===W.Graduated){d=b.rj;b.rj=!0;e=this.naturalBounds;c=e.width;e=e.height;a.save();a.beginPath();a.rect(-1,-1,c+1,e+1);a.clip();c=this.Bb();c.jc(a,b);e=this.Ge()*b.scale;0>=e&&(e=1);f=c.actualBounds;g=this.Z.j;h=this.oj;k=g.length;for(l=0;lthis.graduatedTickUnit*p.interval*c.geometry.flattenedTotalLength/ this.graduatedRange*e))for(r=p.measuredBounds,q=p.strokeWidth*p.scale,x=p.alignmentFocus,x.Nb()&&(x=Kc),u=0;uf.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.Mg:a.Lg);var n=l.separatorStroke;null===n&&(n=c?a.Zh:a.Kg);if(0!==m&&null!==n){gi(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null===p&&(p=c?a.Yh:a.Xh);null!==p&&(n=!0,b.Vs(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.gb;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.Ts()}}}} function Um(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=0;km)){var n=l.vc(),p=l.separatorStrokeWidth;isNaN(p)&&(p=c?a.Mg:a.Lg);var r=l.separatorStroke;null===r&&(r=c?a.Zh:a.Kg);null===r&&(p=0);n-=p;p=l.position+p;n+=l.actual;p+n>m&&(n=m-p);0>=n||(m=a.gb,gi(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 Tm(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dd&&e.set(q),J.free(q));J.free(m);f&&e.transform(g);return l}; t.v=function(a){N.prototype.v.call(this,a);a=null;if(this.wa===W.Auto||this.wa===W.Link)a=this.Bb();for(var b=this.Z.j,c=b.length,d=0;dc||f>d)this.v(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Id:this.v(!0);this.measure(c+h,d+g,0,0);break;case Rk:this.v(!0);this.measure(c+h,f+g,0,0);break;case Sk:this.v(!0),this.measure(b+h,d+g,0,0)}}this.wa.arrange(this,e,this.ng)}}; t.yh=function(a){var b=this.naturalBounds,c=tm(this);if(rc(0,0,b.width,b.height,a.x,a.y)){b=this.Z.j;for(var d=b.length,e=J.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Kb(e.set(a),f.transform),f.ea(e))return J.free(e),!0}J.free(e);return null===this.jb&&null===this.fc?!1:!0}return!1};t.Ws=function(a){if(this.Jk===a)return this;for(var b=this.Z.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 W?m:null;p=Jb.alloc();p.set(g); if(null!==m?m.sg(a,b,c,d,e,p):el(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Jb.free(p)}}}void 0===f&&Jb.free(g);return d}void 0===f&&Jb.free(g);return!1};function bn(a,b,c,d){for(var e=a.Z.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 W&&bn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.tg=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.ae(),k=h?a:Kb(J.allocAt(a.x,a.y),this.transform),l=h?b:Kb(J.allocAt(b.x,b.y),this.transform),m=k.Fe(l),n=0x.width||u.y>x.height||0>u.x+u.width||0>u.y+u.height))if(q.ae()?(u=q.transform,Kb(k.set(a),u),Kb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof W?q:null,null!==q?q.tg(k,l,c,d,e,f):u.ox(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}J.free(k);J.free(l)}return e?n:g}return!1}; function ym(a){var b=null;a instanceof ag&&(b=a.spot1,b===kd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Jc);return b}function zm(a){var b=null;a instanceof ag&&(b=a.spot2,b===kd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Tc);return b}t.add=function(a){w(a,N,W,"add:element");this.Lb(this.Z.count,a)};t.O=function(a){return this.Z.O(a)}; t.Lb=function(a,b){b instanceof T&&v("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.wg(b))this===b&&v("Cannot make a Panel contain itself: "+this.toString()),v("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.panel;null!==c&&c!==this&&v("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.wa!==W.Grid||b instanceof ag||v("Can only add Shapes to a Grid Panel, not: "+b);this.wa!==W.Graduated||b instanceof ag||b instanceof lh||v("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Yi(this);b.Fj=null;if(null!==this.itemArray){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Gd&&(this.Gd=new Db),this.Gd.add(d,b))}var e=this.Z;d=-1;if(c===this){for(var f=-1,g=this.Z.j,h=g.length,k=0;k=e.count&&a>=e.count)return; e.nb(f);d=f}else v("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Lb(a,b);if(0===a||b.isPanelMain)this.yi=null;pj(this)||this.v();b.v(!1);null!==b.portId?this.Ah=!0:b instanceof W&&!0===b.Ah&&(this.Ah=!0);this.Sg=null;c=this.part;null!==c&&(c.Aj=null,c.Zg=NaN,this.Ah&&c instanceof V&&(c.Ah=!0),c.Ah&&c instanceof V&&(c.tc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&&c.cb(Ge,"elements",this,b,null,d,null),c.cb(Fe, "elements",this,null,b,null,a),this.xg()||cn(this,b,!1)))};function dn(a,b){a.I=b?a.I|16777216:a.I&-16777217}t.remove=function(a){w(a,N,W,"remove:element");for(var b=this.Z.j,c=b.length,d=-1,e=0;ea&&ya(a,">= 0",W,"getRowDefinition:idx");a=Math.round(a);var b=this.tb;if(void 0===b)return null;if(void 0===b[a]){var c=new Qj;c.Yi(this);c.isRow=!0;c.index=a;b[a]=c}return b[a]};W.prototype.Jv=function(a){F&&C(a,W,"removeRowDefinition:idx");0>a&&ya(a,">= 0",W,"removeRowDefinition:idx");a=Math.round(a);var b=this.tb;void 0!==b&&(this.cb(Ge,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.v())}; W.prototype.getColumnDefinition=function(a){F&&C(a,W,"getColumnDefinition:idx");0>a&&ya(a,">= 0",W,"getColumnDefinition:idx");a=Math.round(a);var b=this.ob;if(void 0===b)return null;if(void 0===b[a]){var c=new Qj;c.Yi(this);c.isRow=!1;c.index=a;b[a]=c}return b[a]};t=W.prototype;t.Hv=function(a){F&&C(a,W,"removeColumnDefinition:idx");0>a&&ya(a,">= 0",W,"removeColumnDefinition:idx");a=Math.round(a);var b=this.ob;void 0!==b&&(this.cb(Ge,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.v())}; t.az=function(a){if(0>a||this.type!==W.Table)return-1;for(var b=0,c=this.tb,d=c.length,e=this.Bi;ea||this.type!==W.Table)return-1;for(var b=0,c=this.ob,d=c.length,e=this.ki;e=c.elements.count&&!(c instanceof T)){var d=!1;if(1===c.elements.count&&(d=null!==c.itemArray,!d))for(h=b.iterator;h.next();)if("itemArray"===h.value.targetProperty){d=!0;break}d||(Da("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),fn=!0)}}))}t.Dy=function(){var a=this.copy();Xm(a,function(a){a instanceof W&&(a.Uh=null,a.kb=null);var b=a.eb;null!==b&&(a.eb=null,b.each(function(b){a.bind(b.copy())}))});return a}; t.Fa=function(a){var b=this.Uh;if(null!==b)for(void 0===a&&(a=""),b=b.iterator;b.next();){var c=b.value,d=c.sourceProperty;if(""===a||""===d||d===a)if(d=c.targetProperty,null!==c.converter||""!==d){d=this.data;var e=c.sourceName;if(null!==e)d=""===e?this:"/"===e?this:"."===e?this:".."===e?this:this.bb(e);else{var f=this.diagram;null!==f&&c.isToModel&&(d=f.model.modelData)}if(null===d)F&&Da("Binding error: missing GraphObject named "+e+" in "+this.toString());else{f=this;var g=c.bj;if(-1!==g){if(f= this.Ws(g),null===f)continue}else null!==c.Sd&&(f=c.Sd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.Ep;if(0!==e){if(!(f instanceof W))continue;1===e?f=f.getColumnDefinition(c.Tl):2===e&&(f=f.getRowDefinition(c.Tl))}void 0!==f&&c.fw(f,d)}}}}; function gn(a,b){a=a.Z.j;for(var c=a.length,d=b.length,e=0,f=null;ea;)this.zc(this.Z.length-1,!1);a=this.itemArray;if(null!==a)for(var b=a.length,c=0;cc)){var d=jn(a,b),e=a.itemTemplateMap,f=null;null!==e&&(f=e.K(d));null===f&&(kn||(kn=!0,Da('No item template Panel found for category "'+d+'" on '+a),Da(" Using default item template."),d=new W,e=new lh,e.bind(new Bi("text","",Pa)),d.add(e),ln=d),f=ln);d=f;null!==d&&(Og(d),d=d.copy(),0!==(d.I&16777216)&&(e=a.Mi(),null!==e&&dn(e,!0)),"object"===typeof b&&(null===a.Gd&&(a.Gd=new Db),a.Gd.add(b,d)),e=c+$m(a),a.Lb(e,d),d.kb=b,mn(a,e,c),d.kb=null,d.data= b)}}function mn(a,b,c){for(a=a.Z;ba&&ya(a,">= 0",W,"padding"),a=new kc(a)):(w(a,kc,W,"padding"),0>a.left&&ya(a.left,">= 0",W,"padding:value.left"),0>a.right&&ya(a.right,">= 0",W,"padding:value.right"),0>a.top&&ya(a.top,">= 0",W,"padding:value.top"),0>a.bottom&&ya(a.bottom,">= 0",W,"padding:value.bottom"));var b=this.gb;b.A(a)||(this.gb=a=a.J(),this.v(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.sn},set:function(a){var b=this.sn;b.A(a)||(F&&w(a,M,W,"defaultAlignment"), this.sn=a=a.J(),this.v(),this.g("defaultAlignment",b,a))}},defaultStretch:{configurable:!0,get:function(){return this.If},set:function(a){var b=this.If;b!==a&&(hb(a,N,W,"defaultStretch"),this.If=a,this.v(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return void 0===this.ij?Ec:this.ij},set:function(a){if(void 0!==this.ij){"number"===typeof a?a=new kc(a):F&&w(a,kc,W,"defaultSeparatorPadding");var b=this.ij;b.A(a)||(this.ij=a=a.J(), this.v(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return void 0===this.Zh?null:this.Zh},set:function(a){var b=this.Zh;b!==a&&(null===a||"string"===typeof a||a instanceof ol)&&(a instanceof ol&&a.freeze(),this.Zh=a,this.S(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return void 0===this.Mg?1:this.Mg},set:function(a){if(void 0!==this.Mg){var b=this.Mg; b!==a&&isFinite(a)&&0<=a&&(this.Mg=a,this.v(),this.g("defaultRowSeparatorStrokeWidth",b,a))}}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return void 0===this.Yh?null:this.Yh},set:function(a){if(void 0!==this.Yh){var b=this.Yh;if(b!==a){null===a||Array.isArray(a)||xa(a,"Array",W,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea)&&v("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Bi=a,this.v(),this.g("topIndex",b,a))}}},leftIndex:{configurable:!0,get:function(){return void 0===this.ki?0:this.ki},set:function(a){if(void 0!==this.ki){var b=this.ki;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+ a),this.ki=a,this.v(),this.g("leftIndex",b,a))}}},data:{configurable:!0,get:function(){return this.kb},set:function(a){var b=this.kb;if(b!==a){var c=this instanceof T&&!(this instanceof Ve);c&&A(a,"object",W,"data");Og(this);this.kb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof S?(null!==b&&c.Jg.remove(b),null!==a&&c.Jg.add(a,this)):this instanceof T&&(null!==b&&c.Pe.remove(b),null!==a&&c.Pe.add(a,this))):(c=this.panel,null!==c&&null!==c.Gd&&(null!==b&&c.Gd.remove(b), null!==a&&c.Gd.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Fa()}}},itemIndex:{configurable:!0,get:function(){return this.eo},set:function(a){var b=this.eo;b!==a&&(this.eo=a,this.g("itemIndex",b,a))}},itemArray:{configurable:!0,get:function(){return this.ii},set:function(a){var b=this.ii;if(b!==a||null!==a&&gn(this,a)){F&&null!==a&&!Ga(a)&&v("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.diagram; b!==a&&(null!==c&&null!==b&&Hj(c.partManager,this,c),this.ii=a,null!==c&&null!==a&&Ej(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||this.tt()}}},itemTemplate:{configurable:!0,get:function(){return null===this.me?null:this.me.K("")},set:function(a){if(null===this.me){if(null===a)return;this.me=new Db}var b=this.me.K("");b!==a&&(w(a,W,W,"itemTemplate"),(a instanceof T||a.isPanelMain)&&v("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+ a),this.me.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.tt())}},itemTemplateMap:{configurable:!0,get:function(){return this.me},set:function(a){var b=this.me;if(b!==a){w(a,Db,W,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;F&&(d instanceof T||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.me=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing|| this.tt()}}},itemCategoryProperty:{configurable:!0,get:function(){return this.ml},set:function(a){var b=this.ml;b!==a&&("string"!==typeof a&&"function"!==typeof a&&xa(a,"string or function",W,"itemCategoryProperty"),this.ml=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{configurable:!0,get:function(){return 0!==(this.I&1048576)},set:function(a){var b=0!==(this.I&1048576);b!==a&&(A(a,"boolean",W,"isAtomic"),this.I^=1048576,this.g("isAtomic",b,a))}},isClipping:{configurable:!0, enumerable:!0,get:function(){return 0!==(this.I&2097152)},set:function(a){var b=0!==(this.I&2097152);b!==a&&(A(a,"boolean",W,"isClipping"),this.I^=2097152,this.v(),this.g("isClipping",b,a))}},isOpposite:{configurable:!0,get:function(){return 0!==(this.I&33554432)},set:function(a){var b=0!==(this.I&33554432);b!==a&&(A(a,"boolean",W,"isOpposite"),this.I^=33554432,this.v(),this.g("isOpposite",b,a))}},isEnabled:{configurable:!0,get:function(){return 0!==(this.I&4194304)},set:function(a){var b= 0!==(this.I&4194304);if(b!==a){A(a,"boolean",W,"isEnabled");var c=null===this.panel||this.panel.xg();this.I^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&cn(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.Eg},set:function(a){var b=this.Eg;b!==a&&(F&&A(a,"string",W,"alignmentFocusName"),this.Eg=a,this.v(),this.g("alignmentFocusName",b,a))}}}); ma.Object.defineProperties(W,{Position:{configurable:!0,get:function(){return Hl.K("Position")}},Horizontal:{configurable:!0,get:function(){return Hl.K("Horizontal")}},Vertical:{configurable:!0,get:function(){return Hl.K("Vertical")}},Spot:{configurable:!0,get:function(){return Hl.K("Spot")}},Auto:{configurable:!0,get:function(){return Hl.K("Auto")}},Table:{configurable:!0,get:function(){return Hl.K("Table")}},Viewbox:{configurable:!0, enumerable:!0,get:function(){return Hl.K("Viewbox")}},TableRow:{configurable:!0,get:function(){return Hl.K("TableRow")}},TableColumn:{configurable:!0,get:function(){return Hl.K("TableColumn")}},Link:{configurable:!0,get:function(){return Hl.K("Link")}},Grid:{configurable:!0,get:function(){return Hl.K("Grid")}},Graduated:{configurable:!0,get:function(){return Hl.K("Graduated")}}});W.prototype.findItemPanelForData=W.prototype.nx; W.prototype.rebuildItemElements=W.prototype.tt;W.prototype.updateTargetBindings=W.prototype.Fa;W.prototype.copyTemplate=W.prototype.Dy;W.prototype.graduatedValueForPoint=W.prototype.uz;W.prototype.graduatedPointForValue=W.prototype.sz;W.prototype.findColumnForLocalX=W.prototype.Ty;W.prototype.findRowForLocalY=W.prototype.az;W.prototype.removeColumnDefinition=W.prototype.Hv;W.prototype.removeRowDefinition=W.prototype.Jv;W.prototype.removeAt=W.prototype.nb;W.prototype.remove=W.prototype.remove; W.prototype.insertAt=W.prototype.Lb;W.prototype.elt=W.prototype.O;W.prototype.add=W.prototype.add;W.prototype.findObject=W.prototype.bb;W.prototype.findInVisualTree=W.prototype.dm;W.prototype.walkVisualTreeFrom=W.prototype.yk;W.prototype.findMainElement=W.prototype.Bb;var fn=!1,kn=!1,ln=null,Hl=new Db;W.className="Panel";W.definePanelLayout=on;on("Position",new sm);on("Vertical",new vm);on("Auto",new xm);on("Link",new Hm);on("Grid",new Gm); function Qj(){fb(this);this.fg=null;this.Mr=!0;this.Ua=0;this.Sc=NaN;this.ah=0;this.$g=Infinity;this.xb=kd;this.ua=this.ma=0;this.eb=null;this.xp=pn;this.ze=Qk;this.sp=this.jg=null;this.tp=NaN;this.jb=this.Mj=null;this.nn=!1} Qj.prototype.copy=function(){var a=new Qj;a.Mr=this.Mr;a.Ua=this.Ua;a.Sc=this.Sc;a.ah=this.ah;a.$g=this.$g;a.xb=this.xb;a.ma=this.ma;a.ua=this.ua;a.ze=this.ze;a.xp=this.xp;null===this.jg?a.jg=null:a.jg=this.jg.J();a.sp=this.sp;a.tp=this.tp;a.Mj=null;null!==this.Mj&&(a.separatorDashArray=Ia(this.separatorDashArray));a.jb=this.jb;a.nn=this.nn;a.eb=this.eb;return a};t=Qj.prototype; t.am=function(a){w(a,Qj,Qj,"copyFrom:pd");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.jg=null===a.separatorPadding?null:a.separatorPadding.J();this.separatorStroke=a.separatorStroke;this.separatorStrokeWidth=a.separatorStrokeWidth;this.Mj=null;a.separatorDashArray&&(this.Mj=Ia(a.separatorDashArray));this.background=a.background;this.coversSeparators=a.coversSeparators;this.eb= a.eb};t.hb=function(a){a.classType===Qj?this.sizing=a:Ba(this,a)};t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+sb(this)};t.Yi=function(a){this.fg=a}; t.Vu=function(){var a=0,b=0,c=this.fg,d=this.isRow;if(null!==c&&c.type===W.Table)for(var e=d?c.tb.length:c.ob.length,f=0;fa&&ya(a,">= 0",Qj,"height"),this.Sc=a,this.actual=this.ma,null!== this.panel&&this.panel.v(),this.zb("height",b,a))}},width:{configurable:!0,get:function(){return this.Sc},set:function(a){var b=this.Sc;b!==a&&(F&&A(a,"number",Qj,"width"),0>a&&ya(a,">= 0",Qj,"width"),this.Sc=a,this.actual=this.ma,null!==this.panel&&this.panel.v(),this.zb("width",b,a))}},minimum:{configurable:!0,get:function(){return this.ah},set:function(a){var b=this.ah;b!==a&&(F&&A(a,"number",Qj,"minimum"),(0>a||!isFinite(a))&&ya(a,">= 0",Qj,"minimum"),this.ah=a,this.actual= this.ma,null!==this.panel&&this.panel.v(),this.zb("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.$g},set:function(a){var b=this.$g;b!==a&&(F&&A(a,"number",Qj,"maximum"),0>a&&ya(a,">= 0",Qj,"maximum"),this.$g=a,this.actual=this.ma,null!==this.panel&&this.panel.v(),this.zb("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.xb},set:function(a){var b=this.xb;b.A(a)||(F&&w(a,M,Qj,"alignment"),this.xb=a.J(),null!==this.panel&&this.panel.v(), this.zb("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.ze},set:function(a){var b=this.ze;b!==a&&(F&&hb(a,N,Qj,"stretch"),this.ze=a,null!==this.panel&&this.panel.v(),this.zb("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.jg},set:function(a){"number"===typeof a?a=new kc(a):null!==a&&F&&w(a,kc,Qj,"separatorPadding");var b=this.jg;null!==a&&null!==b&&b.A(a)||(null!==a&&(a=a.J()),this.jg=a,null!==this.panel&&this.panel.v(), this.zb("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.sp},set:function(a){var b=this.sp;b!==a&&(null!==a&&Ll(a,"RowColumnDefinition.separatorStroke"),a instanceof ol&&a.freeze(),this.sp=a,null!==this.panel&&this.panel.v(),this.zb("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.tp},set:function(a){var b=this.tp;b!==a&&(this.tp=a,null!==this.panel&&this.panel.v(),this.zb("separatorStrokeWidth", b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.Mj},set:function(a){var b=this.Mj;if(b!==a){null===a||Array.isArray(a)||xa(a,"Array",Qj,"separatorDashArray:value");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,x=La(),y=2;yn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;y=0;q=x[y];n=q[0];r=q[1];p=q[2];q=q[3];for(var z=0;.1<=u;){0===z&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); if(e>u){Na(x);return}e>q?(z=e-q,e=q):z=0;var B=Math.sqrt(e*e/(1+p*p));0>n&&(B=-B);h+=B;k+=p*B;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===z&&d.Ii(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==z){y++;if(y===x.length){Na(x);return}q=x[y];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Na(x)}} t.Ii=function(a,b){var c=this.Ic,d=this.al;if(null!==c||null!==d){var e=this.actualBounds,f=this.naturalBounds;null!==d&&gi(this,a,d,!0,!1,f,e);null!==c&&gi(this,a,c,!1,!1,f,e);e=this.part;f=this.kh;0===f&&null!==e&&(f=e instanceof Ve&&e.type===W.Link&&"Selection"===e.category&&e.adornedObject instanceof ag&&e.adornedPart.Bb()===e.adornedObject?e.adornedObject.strokeWidth:0);a.lineWidth=f;a.lineJoin=this.Pl;a.lineCap=this.Ol;a.miterLimit=this.Oj;var g=!1;e&&b.He("drawShadows")&&(g=e.isShadowed);var h= !0;null!==c&&null===d&&(h=!1);e=!1;var k=this.strokeDashArray;null!==k&&(e=!0,a.Vs(k,this.jh));var l=this.sa;if(null!==l){if(l.type===Jd)a.beginPath(),a.moveTo(l.startX,l.startY),a.lineTo(l.endX,l.endY),null!==d&&a.Vd(d),0!==f&&null!==c&&a.aj();else if(l.type===Td){var m=l.startX,n=l.startY,p=l.endX,r=l.endY;k=Math.min(m,p);l=Math.min(n,r);m=Math.abs(p-m);n=Math.abs(r-n);a.beginPath();a.rect(k,l,m,n);null!==d&&a.Vd(d);if(null!==c){p=d=c=0;h&&g&&(c=a.shadowOffsetX,d=a.shadowOffsetY,p=a.shadowBlur, a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);if(0!==f){if(0===m||0===n)a.beginPath(),a.rect(k,l,Math.max(m,.1),Math.max(n,.1));a.aj()}h&&g&&(a.shadowOffsetX=c,a.shadowOffsetY=d,a.shadowBlur=p)}}else if(l.type===Ud)n=l.startX,k=l.startY,p=l.endX,r=l.endY,l=Math.abs(p-n)/2,m=Math.abs(r-k)/2,n=Math.min(n,p)+l,k=Math.min(k,r)+m,a.beginPath(),a.moveTo(n,k-m),a.bezierCurveTo(n+K.Dg*l,k-m,n+l,k-K.Dg*m,n+l,k),a.bezierCurveTo(n+l,k+K.Dg*m,n+K.Dg*l,k+m,n,k+m),a.bezierCurveTo(n-K.Dg*l,k+m,n-l,k+K.Dg* m,n-l,k),a.bezierCurveTo(n-l,k-K.Dg*m,n-K.Dg*l,k-m,n,k-m),a.closePath(),null!==d&&a.Vd(d),0!==f&&null!==c&&(h&&g?(f=a.shadowOffsetX,g=a.shadowOffsetY,c=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0,a.aj(),a.shadowOffsetX=f,a.shadowOffsetY=g,a.shadowBlur=c):a.aj());else if(l.type===Hd)for(k=l.figures,l=k.length,m=0;mx.sweepAngle,null!==q?q.endX:n.startX,null!==q?q.endY:n.startY)}else if(q=ne(x,n),y=q.length,0===y)a.lineTo(x.centerX,x.centerY);else for(var z=0;z(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;L.free(f);return K.Vb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== Td){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.Xc(-d,-d);if(f.ea(a))return L.free(f),!1;f.Xc(d,d)}null!==this.stroke&&f.Xc(e,e);a=f.ea(a);L.free(f);return a}if(c.type===Ud){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 L.free(f),!1; g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);L.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===Hd)return L.free(f),null===this.fill?qe(c,a.x,a.y,e):c.ea(a,e,1=this.strokeWidth)m=K.Je(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=La();a=new J;K.Je(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new J;K.Je(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Je(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Je(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 Na(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.da(k.y,a))&&(k.yb||K.da(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.ox=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.yh(a,!0))return!0;var e=a.Fe(b),f=e;1.5=e||Mb(b,f,0,-n)>=e|| Mb(b,f,0,n)>=e||Mb(b,f,m,0)>=e?!1:!0}else if(b.type===Hd){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&&Lb(a.x,a.y,f,h,k,h)>e&&Lb(a.x,a.y,k,l,f,l)>e&&Lb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?qe(b,a.x,a.y,f):b.ea(a,f,!0))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 je:var p=La();K.De(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Na(p);if(g)return!1;g=n.endX;m=n.endY;if(a.ed(g,m)>e)return!1;break;case ke:p=La();K.uq(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Na(p);if(g)return!1;g=n.endX;m=n.endY;if(a.ed(g,m)>e)return!1;break;case le:case me:p=n.type===le?ne(n,f):oe(n,f,g,m);var r=p.length;if(0===r){g=n.centerX;m=n.centerY;if(a.ed(g,m)>e)return!1;break}n=null;for(var q=La(),u=0;u< r;u++)if(n=p[u],q.length=0,K.De(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.8,q),d(q,a))return Na(q),!1;Na(q);null!==n&&(g=n[6],m=n[7]);break;default:v("Unknown Segment type: "+n.type)}}return!0}}}return!1};t.cc=function(){this.sa=null};function In(a){var b=a.diagram;null!==b&&b.undoManager.isUndoingRedoing||(a.segmentOrientation=Jn,"None"!==a.Vl?(a.segmentIndex=-1,a.alignmentFocus=rd):"None"!==a.dl&&(a.segmentIndex=0,a.alignmentFocus=new M(1-rd.x,rd.y)))} ag.makeGeometry=function(a,b,c){if("None"!==a.toArrow)var d=Kn[a.toArrow];else"None"!==a.fromArrow?d=Kn[a.fromArrow]:(d=K.be[a.figure],"string"===typeof d&&(d=K.be[d]),void 0===d&&v("Unknown Shape.figure: "+a.figure),d=d(a,b,c),d.kl=b,d.il=c);if(null===d){var e=K.be.Rectangle;"function"===typeof e&&(d=e(a,b,c))}F&&(d.bounds.width>b+1E-5||d.bounds.height>c+1E-5)&&v('Geometry made with figure "'+a.figure+'" has bounds that are too large for its given size. See documentation for Shape.defineFigureGenerator.'); return d};function Ln(a){var b=Kn[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Kn[c];if(void 0===b){var d=null,e;for(e in K.Hm)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=Vd(K.Hm[d],!1),Kn[d]=a,c!==d&&(Kn[c]=d),d}}return"string"===typeof b?b:b instanceof Gd?a:null} ma.Object.defineProperties(ag.prototype,{geometry:{configurable:!0,get:function(){return null!==this.sa?this.sa:this.Rd},set:function(a){var b=this.sa;if(b!==a){null!==a?(F&&w(a,Gd,ag,"geometry"),this.Rd=this.sa=a.freeze()):this.Rd=this.sa=null;var c=this.part;null!==c&&(c.Zg=NaN);this.v();this.g("geometry",b,a);$k(this)&&(a=this.part,null!==a&&al(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()}, set:function(a){a=Vd(a);var b=a.normalize();this.geometry=a;this.position=a=J.allocAt(-b.x,-b.y);J.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return this.Wn},set:function(a){F&&A(a,"boolean",ag,"isGeometryPositioned");var b=this.Wn;b!==a&&(this.Wn=a,this.v(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.al},set:function(a){var b=this.al;b!==a&&(null!==a&&Ll(a,"Shape.fill"),a instanceof ol&&a.freeze(),this.al= a,this.S(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Ic},set:function(a){var b=this.Ic;b!==a&&(null!==a&&Ll(a,"Shape.stroke"),a instanceof ol&&a.freeze(),this.Ic=a,this.S(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.kh},set:function(a){var b=this.kh;if(b!==a)if(F&&C(a,ag,"strokeWidth"),0<=a){this.kh=a;this.v();var c=this.part;null!==c&&(c.Zg=NaN);this.g("strokeWidth",b,a)}else ya(a,"value >= 0",ag,"strokeWidth:value")}}, strokeCap:{configurable:!0,get:function(){return this.Ol},set:function(a){var b=this.Ol;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?ya(a,'"butt", "round", or "square"',ag,"strokeCap"):(this.Ol=a,this.S(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return this.Pl},set:function(a){var b=this.Pl;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?ya(a,'"miter", "bevel", or "round"',ag,"strokeJoin"):(this.Pl= a,this.S(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return this.Oj},set:function(a){var b=this.Oj;if(b!==a)if(F&&C(a,ag,"strokeMiterLimit"),1<=a){this.Oj=a;this.S();var c=this.part;null!==c&&(c.Zg=NaN);this.g("strokeMiterLimit",b,a)}else F&&ya(a,"value >= 1",ag,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.ih},set:function(a){var b=this.ih;if(b!==a){null===a||Array.isArray(a)||xa(a,"Array",ag,"strokeDashArray:value"); if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1p*m*m&&(c=!0);b.$c!==a&&(c=!1);!1===b.He("textGreeking")&& (c=!1);b=this.df;p=this.ef;switch(this.flip){case Vk:a.translate(e,0);a.scale(-1,1);break;case Uk:a.translate(0,f);a.scale(1,-1);break;case Wk:a.translate(e,f),a.scale(-1,-1)}m=this.pc;n=(b+g+p)*m;f>n&&(d=this.Ei,d=d.y*f-d.y*n+d.offsetY);n=this.pd;for(var r=0;re&&(q=e);d+=b;var u=n.Cc[r],x=a,y=d,z=h,B=0;if(c)"left"===z?B=0:"right"===z?B=e-q:"center"===z&&(B=(e-q)/2),x.fillRect(0+B,y+.25*g,q,1);else{"left"===z?B=0:"right"===z?B=e:"center"===z&&(B=e/2);var D=null!==Tn?Tn(this, g):.75*g;x.fillText(u,0+B,y+D);u=g/20|0;0===u&&(u=1);"right"===z?B-=q:"center"===z&&(B-=q/2);k&&(z=null!==Un?Un(this,g):.8*g,x.beginPath(),x.lineWidth=u,x.moveTo(0+B,y+z),x.lineTo(0+B+q,y+z),x.stroke());l&&(x.beginPath(),x.lineWidth=u,y=y+g-g/2.2|0,0!==u%2&&(y+=.5),x.moveTo(0+B,y),x.lineTo(0+B+q,y),x.stroke())}d+=g+p}switch(this.flip){case Vk:a.scale(-1,1);a.translate(-e,0);break;case Uk:a.scale(1,-1);a.translate(0,-f);break;case Wk:a.scale(-1,-1),a.translate(-e,-f)}}}; t.nm=function(a,b,c,d){this.pl=a;var e=this.ie;null!==Rn&&Vn!==e&&(Vn=Rn.font=e);e=this.pd;e.reset();var f;if(isNaN(this.desiredSize.width)){var g=this.Rb.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.isMultiline){for(var h=f=0,k=!1;!k;){var l=g.indexOf("\n",h);-1===l&&(l=g.length,k=!0);f=Math.max(f,Wn(g.substr(h,l-h).trim()));h=l+1}g=f}else f=g.indexOf("\n",0),0<=f&&(g=g.substr(0,f)),g=Wn(g);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.desiredSize.width;null!== this.panel&&(g=Math.min(g,this.panel.maxSize.width));f=Xn(this,g,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;h=f;if(0!==e.Gc&&1!==e.Cc.length&&this.dg===Yn&&(b=this.ie,b=this.dg===Yn?Zn(b):0,k=this.df+this.ef,k=Math.max(0,Sn(this)+k),h=Math.min(this.maxLines-1,Math.max(Math.floor(h/k+.01)-1,0)),!(h+1>=e.Cc.length))){k=e.Cc[h];for(b=Math.max(1,a-b);Wn(k)>b&&1=a.qe)null!==e&&e.h(0,h);else{var l=b;if(a.pg===co)if(c.og=1,g=Wn(b),0===k||g<=d)c.Gc=Math.max(c.Gc,g),c.Yc.push(c.Gc),c.Cc.push(b),null!==e&&e.h(g,h);else{f=eo(a,l);l=l.substr(f.length);b=eo(a,l);for(g=Wn(f+b);0d&&1d;){var n=1;g=Wn(m.substr(0,n));for(b=0;g<=d;)n++,b=g,g=Wn(m.substr(0,n));1===n?(c.Yc[a.pc+k]=g,f=Math.max(f,g)):(c.Yc[a.pc+k]=b,f=Math.max(f,b));n--;1>n&&(n=1);c.Cc[a.pc+k]=m.substr(0,n);k++;m=m.substr(n);if(a.pc+k>a.qe)break}b=eo(a,l);for(g=Wn(m+b);0a.qe))break}c.og=Math.min(a.qe,k);c.Gc=Math.max(c.Gc,f);null!==e&&e.h(c.Gc,h*c.og)}}}function eo(a,b){if(a.pg===fo)return b.substr(0,1);a=b.length;for(var c=0,d=go;c=a?b:b.substr(0,c)} function Wn(a){return null===Rn?8*a.length:Rn.measureText(a).width}function Sn(a){if(null!==a.pd.Mf)return a.pd.Mf;var b=a.ie;if(null===Rn){var c=16;return a.pd.Mf=c}void 0!==ho[b]&&5E3>io?c=ho[b]:(c=1.3*Rn.measureText("M").width,ho[b]=c,io++);return a.pd.Mf=c}function Zn(a){if(null===Rn)return 6;if(void 0!==jo[a]&&5E3>ko)var b=jo[a];else b=Rn.measureText($n).width,jo[a]=b,ko++;return b} function Xn(a,b,c){var d=a.Rb.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.df+a.ef;e=Math.max(0,Sn(a)+e);if(0===d.length)return c.Gc=0,a.pc=1,e;if(!a.isMultiline){var f=d.indexOf("\n",0);0<=f&&(d=d.substr(0,f))}f=0;for(var g=a.pc=0,h,k=!1;!k;){h=d.indexOf("\n",g);-1===h&&(h=d.length,k=!0);if(g<=h){g=d.substr(g,h-g);if(a.pg!==co){c.og=0;var l=Ib.alloc();bo(a,g,c,b,l);f+=l.height;Ib.free(l);a.pc+=c.og}else bo(a,g,c,b,null),f+=e,a.pc++;a.pc===a.qe&&(k=!0)}g=h+1}return a.Xr=f} function Nn(){go=/[ \u200b\u00ad]/;ho=new jb;jo=new jb;Rn=jh?(new yk(null)).context:null} ma.Object.defineProperties(lh.prototype,{font:{configurable:!0,get:function(){return this.ie},set:function(a){var b=this.ie;b!==a&&(F&&(A(a,"string",lh,"font"),Qn(a)||v('Not a valid font: "'+a+'"')),this.ie=a,this.pd.Mf=null,this.v(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.Rb},set:function(a){var b=this.Rb;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.Rb=a,this.v(),this.g("text",b,a))}},textAlign:{configurable:!0,get:function(){return this.zi}, set:function(a){var b=this.zi;b!==a&&(F&&A(a,"string",lh,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.zi=a,this.S(),this.g("textAlign",b,a)):F&&ya(a,'"start", "end", "left", "right", or "center"',lh,"textAlign"))}},flip:{configurable:!0,get:function(){return this.Ad},set:function(a){var b=this.Ad;b!==a&&(hb(a,N,lh,"flip"),this.Ad=a,this.S(),this.g("flip",b,a))}},verticalAlignment:{configurable:!0,get:function(){return this.Ei},set:function(a){var b= this.Ei;b.A(a)||(F&&(w(a,M,lh,"verticalAlignment"),a.Nb()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),this.Ei=a=a.J(),xl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.rc.o()){var a=Ib.alloc();bo(this,this.Rb,this.pd,999999,a);var b=a.width;Ib.free(a);a=Xn(this,b,this.pd);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);fc(this.rc,b,a)}return this.rc}},isMultiline:{configurable:!0, enumerable:!0,get:function(){return this.sj},set:function(a){var b=this.sj;b!==a&&(F&&A(a,"boolean",lh,"isMultiline"),this.sj=a,this.v(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return this.hi},set:function(a){var b=this.hi;b!==a&&(F&&A(a,"boolean",lh,"isUnderline"),this.hi=a,this.S(),this.g("isUnderline",b,a))}},isStrikethrough:{configurable:!0,get:function(){return this.gi},set:function(a){var b=this.gi;b!==a&&(F&&A(a,"boolean",lh,"isStrikethrough"), this.gi=a,this.S(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return this.pg},set:function(a){var b=this.pg;b!==a&&(F&&hb(a,lh,lh,"wrap"),this.pg=a,this.v(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return this.dg},set:function(a){var b=this.dg;b!==a&&(F&&hb(a,lh,lh,"overflow"),this.dg=a,this.v(),this.g("overflow",b,a))}},stroke:{configurable:!0,get:function(){return this.Ic},set:function(a){var b=this.Ic;b!== a&&(null!==a&&Ll(a,"TextBlock.stroke"),a instanceof ol&&a.freeze(),this.Ic=a,this.S(),this.g("stroke",b,a))}},lineCount:{configurable:!0,get:function(){return this.pc}},editable:{configurable:!0,get:function(){return this.Fn},set:function(a){var b=this.Fn;b!==a&&(F&&A(a,"boolean",lh,"editable"),this.Fn=a,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return this.Gp},set:function(a){var b=this.Gp;b!==a&&(!F||a instanceof $e||v("TextBlock.textEditor must be an HTMLInfo."), this.Gp=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0,get:function(){return this.Ec},set:function(a){var b=this.Ec;b!==a&&(null!==a&&A(a,"function",lh,"errorFunction"),this.Ec=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return this.Ed},set:function(a){var b=this.Ed;F&&C(a,lh,"interval");a=Math.floor(a);if(b!==a&&0<=a){this.Ed=a;this.v();var c=this.panel;null!==c&&(c.Sg=null);this.g("interval",b,a)}}},graduatedStart:{configurable:!0, enumerable:!0,get:function(){return this.Dd},set:function(a){var b=this.Dd;F&&C(a,lh,"graduatedStart");b!==a&&(0>a?a=0:1a?a=0:1=a&&ya(a,"> 0",lh,"maxLines"),this.qe=a,this.g("maxLines",b,a),this.v())}},metrics:{configurable:!0,get:function(){return this.pd}},choices:{configurable:!0,get:function(){return this.bn},set:function(a){var b=this.bn;b!==a&&(F&&null!==a&&!Array.isArray(a)&& xa(a,"Array",lh,"choices:value"),this.bn=a,this.g("choices",b,a))}}});var Tn=null,Un=null,co=new E(lh,"None",0),ao=new E(lh,"WrapFit",1),Pn=new E(lh,"WrapDesiredSize",2),fo=new E(lh,"WrapBreakAll",3),On=new E(lh,"OverflowClip",0),Yn=new E(lh,"OverflowEllipsis",1),go=null,ho=null,io=0,jo=null,ko=0,$n="...",Vn="",Rn=null,Mn=!1;lh.className="TextBlock";lh.getEllipsis=function(){return $n};lh.setEllipsis=function(a){$n=a;jo=new jb;ko=0};lh.getBaseline=function(){return Tn}; lh.setBaseline=function(a){Tn=a;a=Ta();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 Id:m=d.width;n=d.height;break;case Rg:case Tk:p===Rg?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===Tk&&(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.Ge()*b.scale;var q=m*p*n*p,u=h*g/q,x=c.__goCache;p=null;var y=po;if(c.Kr&&void 0!==x&&4y*y)for(null===x.Gi&&(qo(x,4,k,l,c),qo(x,16,k,l,c)),k=x.Gi,l=k.length,q=0;q=d)d=5;d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*K.Dg;b=(new Gd).add((new se(d,0,!0)).add(new te(Rd,b-d,0)).add(new te(je,b,d,b-a,0,b,a)).add(new te(Rd,b,c-d)).add(new te(je,b-d,c,b,c-a,b-a,c)).add(new te(Rd,d,c)).add(new te(je,0,c-d,a,c,0,c-a)).add(new te(Rd,0,d)).add((new te(je,d,0,0,a,a,0)).close()));1e.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.F^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.ja();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.ec(),c.skipsUndoManager=d)}}}},isHighlighted:{configurable:!0,get:function(){return 0!==(this.F&524288)},set:function(a){var b=0!==(this.F&524288);if(b!==a){F&&A(a,"boolean",T,"isHighlighted");this.F^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ja(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.S();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{configurable:!0,get:function(){return 0!==(this.F&8192)},set:function(a){var b= 0!==(this.F&8192);b!==a&&(F&&A(a,"boolean",T,"isShadowed"),this.F^=8192,this.g("isShadowed",b,a),this.S())}},isAnimated:{configurable:!0,get:function(){return 0!==(this.F&262144)},set:function(a){var b=0!==(this.F&262144);b!==a&&(F&&A(a,"boolean",T,"isAnimated"),this.F^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return this.Sn},set:function(a){var b=this.Sn;b!==a&&(null!==a&&A(a,"function",T,"highlightedChanged"),this.Sn=a,this.g("highlightedChanged", b,a))}},selectionObjectName:{configurable:!0,get:function(){return this.rp},set:function(a){var b=this.rp;b!==a&&(F&&A(a,"string",T,"selectionObjectName"),this.rp=a,this.fh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return this.pp},set:function(a){var b=this.pp;b!==a&&(F&&w(a,Ve,T,"selectionAdornmentTemplate"),this.pp=a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{configurable:!0,get:function(){if(null=== this.fh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.bb(a),null!==a?this.fh=a:this.fh=this):this instanceof S?(a=this.path,null!==a?this.fh=a:this.fh=this):this.fh=this}return this.fh}},selectionChanged:{configurable:!0,get:function(){return this.qp},set:function(a){var b=this.qp;b!==a&&(null!==a&&A(a,"function",T,"selectionChanged"),this.qp=a,this.g("selectionChanged",b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return this.ap},set:function(a){var b= this.ap;b!==a&&(F&&w(a,Ve,T,"resizeAdornmentTemplate"),this.ap=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return this.cp},set:function(a){var b=this.cp;b!==a&&(F&&A(a,"string",T,"resizeObjectName"),this.cp=a,this.g("resizeObjectName",b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.bb(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return this.bp}, set:function(a){var b=this.bp;b.A(a)||(F&&w(a,Ib,T,"resizeCellSize"),this.bp=a=a.J(),this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return this.ep},set:function(a){var b=this.ep;b!==a&&(F&&w(a,Ve,T,"rotateAdornmentTemplate"),this.ep=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0,get:function(){return this.fp},set:function(a){var b=this.fp;b!==a&&(F&&A(a,"string",T,"rotateObjectName"),this.fp=a,this.g("rotateObjectName", b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.bb(a),null!==a)?a:this}},rotationSpot:{configurable:!0,get:function(){return this.gp},set:function(a){var b=this.gp;b.A(a)||(F&&(w(a,M,T,"rotationSpot"),a===kd||a.Za()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+a)),this.gp=a=a.J(),this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.Rb},set:function(a){var b= this.Rb;b!==a&&(F&&A(a,"string",T,"text"),this.Rb=a,this.g("text",b,a))}},containingGroup:{configurable:!0,get:function(){return this.Vh},set:function(a){if(this.dc()){var b=this.Vh;if(b!==a){F&&null!==a&&w(a,Rf,T,"containingGroup");null===a||this!==a&&!a.Xd(this)||(this===a&&v("Cannot make a Group a member of itself: "+this.toString()),v("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.C(2);var c=this.diagram;null!==b?Ho(b,this): this instanceof Rf&&null!==c&&c.Ci.remove(this);this.Vh=a;null!==a?Go(a,this):this instanceof Rf&&null!==c&&c.Ci.add(this);this.C(1);if(null!==c){var d=this.data,e=c.model;if(null!==d&&e.Ui()){var f=e.ra(null!==a?a.data:null);e.At(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.fa,c.fa=!0),d(this,b,a),null!==c&&(c.fa=e));if(this instanceof Rf)for(c=new I,Nk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)Mo(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)Mo(c.value);c=this.labeledLink;null!==c&&Mo(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&hi(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return this.en},set:function(a){var b=this.en;b!==a&&(null!==a&&A(a,"function",T,"containingGroupChanged"),this.en=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{configurable:!0,get:function(){return null!== this.containingGroup||this instanceof V&&null!==this.labeledLink?!1:!0}},layoutConditions:{configurable:!0,get:function(){return this.io},set:function(a){var b=this.io;b!==a&&(F&&A(a,"number",T,"layoutConditions"),this.io=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return this.Bn},set:function(a){var b=this.Bn;b!==a&&(null!==a&&A(a,"function",T,"dragComputation"),this.Bn=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0, enumerable:!0,get:function(){return this.xi},set:function(a){var b=this.xi;b.A(a)||(F&&w(a,J,T,"shadowOffset"),this.xi=a=a.J(),this.S(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return this.Nj},set:function(a){var b=this.Nj;b!==a&&(F&&A(a,"string",T,"shadowColor"),this.Nj=a,this.S(),this.g("shadowColor",b,a))}},shadowBlur:{configurable:!0,get:function(){return this.Qd},set:function(a){var b=this.Qd;b!==a&&(F&&A(a,"number",T,"shadowBlur"), this.Qd=a,this.S(),this.g("shadowBlur",b,a))}}});T.prototype.invalidateLayout=T.prototype.C;T.prototype.findCommonContainingGroup=T.prototype.mx;T.prototype.isMemberOf=T.prototype.Xd;T.prototype.findTopLevelPart=T.prototype.ez;T.prototype.findSubGraphLevel=T.prototype.bz;T.prototype.ensureBounds=T.prototype.bc;T.prototype.getDocumentBounds=T.prototype.fq;T.prototype.getRelativePoint=T.prototype.sf;T.prototype.findObject=T.prototype.bb;T.prototype.moveTo=T.prototype.moveTo; T.prototype.invalidateAdornments=T.prototype.Mb;T.prototype.clearAdornments=T.prototype.Xj;T.prototype.removeAdornment=T.prototype.xf;T.prototype.addAdornment=T.prototype.sh;T.prototype.findAdornment=T.prototype.ek;T.prototype.updateTargetBindings=T.prototype.Fa;var Eo=!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 Ve(a){T.call(this,a);this.F&=-257;this.Wg="Adornment";this.ce=null;this.Kw=0;this.Vw=!1;this.l=[];this.Pa=null}la(Ve,T);Ve.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Ve.prototype.updateRelationshipsFromData=function(){}; Ve.prototype.lk=function(a){var b=this.adornedObject.part;if(b instanceof S&&this.adornedObject instanceof ag){var c=b.path;b.lk(a);a=c.geometry;b=this.Z.j;c=b.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.Ie){b.Ie=!0;var c=new I;c.add(this);Wo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===oi);b.Ie=!1}}; function Wo(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.Ie){b.Ie=!0;var c=new I;c.add(this);Yo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===oi);b.Ie=!1}}; function Yo(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.bq():a.ud();k.next();){var l=k.value;l.isTreeLink&&(h||l.Mc||l.Ta(),l=l.ct(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Ob(!0),l.Bh(),g&&e.Sp(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(Ng.prototype,{padding:{configurable:!0,get:function(){return this.gb},set:function(a){"number"===typeof a?a=new kc(a):w(a,kc,Ng,"padding");var b=this.gb;b.A(a)||(this.gb=a=a.J(),this.g("padding",b,a))}}});Ng.className="Placeholder"; function S(){T.call(this,W.Link);this.Va=8;this.Re=null;this.Se="";this.jf=this.Kn=null;this.kf="";this.Jp=null;this.Rm=Eg;this.mn=0;this.pn=Eg;this.qn=NaN;this.Jj=cp;this.yp=.5;this.bd=null;this.yb=(new H).freeze();this.eh=this.Hc=null;this.Dl=new L;this.sa=new Gd;this.Vn=!0;this.L=this.w=this.Cf=this.Lf=null;this.l=[];this.Gu=new J;this.xr=this.Rw=this.Qw=null;this.gu=NaN;this.R=null}la(S,T); S.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);a.Va=this.Va&-113;a.Se=this.Se;a.Kn=this.Kn;a.kf=this.kf;a.Jp=this.Jp;a.Rm=this.Rm;a.mn=this.mn;a.pn=this.pn;a.qn=this.qn;a.Jj=this.Jj;a.yp=this.yp;null!==this.R&&(a.R=this.R.copy())};t=S.prototype;t.rf=function(a){T.prototype.rf.call(this,a);this.Se=a.Se;this.kf=a.kf;a.Hc=null;a.Ta();a.Cf=this.Cf;var b=a.fromPort;null!==b&&Qo(a.fromNode,b);b=a.toPort;null!==b&&Qo(a.toNode,b)}; t.hb=function(a){a.classType===S?2===(a.value&2)?this.routing=a:a===Hg||a===Dg||a===Cg?this.curve=a:a===dp||a===ep||a===fp?this.adjusting=a:a!==cp&&a!==Eg&&v("Unknown Link enum value for a Link property: "+a):T.prototype.hb.call(this,a)};t.Jc=function(){null===this.R&&(this.R=new Zk)};t.Wi=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(qj(a)||rj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),qj(a)||rj(a))?!1:!0};t.Tv=function(){return!1}; t.Uv=function(){};t.dc=function(){return!1};S.prototype.computeAngle=function(a,b,c){return S.computeAngle(b,c)};S.computeAngle=function(a,b){switch(a){default:case Eg:a=0;break;case Jn:a=b;break;case Jm:a=b+90;break;case Lm:a=b-90;break;case gp:a=b+180;break;case hp:a=K.rq(b);90a&&(a-=180);break;case Km:a=K.rq(b+90);90a&&(a-=180);break;case Mm:a=K.rq(b-90);90a&&(a-=180);break;case Nm:a=K.rq(b);if(45a||225a)return 0;90a&&(a-=180)}return K.rq(a)}; function Mo(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.mx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Vh;if(c!==b){null!==c&&Ho(c,a);a.Vh=b;null!==b&&Go(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.fa,g.fa=!0);e(a,c,b);null!==g&&(g.fa=f)}!a.Mc||a.Qw!==c&&a.Rw!==c||a.Ta()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=S.prototype; t.Bh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&T.prototype.Bh.call(this)};t.ct=function(a){F&&w(a,V,S,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.oz=function(a){F&&w(a,N,S,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function To(a,b){null===a.bd&&(a.bd=new I);a.bd.add(b);a.v()} t.iq=function(a){T.prototype.iq.call(this,a);ip(this)&&this.kq(this.actualBounds);if(!a){a=this.Re;var b=null;null!==a&&(b=this.fromPort,Ro(a,this,b));var c=this.jf;if(null!==c){var d=this.toPort;c===a&&d===b||Ro(c,this,d)}jp(this)}};t.jq=function(a){T.prototype.jq.call(this,a);ip(this)&&this.kq(this.actualBounds);if(!a){a=this.Re;var b=null;null!==a&&(b=this.fromPort,So(a,this,b));var c=this.jf;if(null!==c){var d=this.toPort;c===a&&d===b||So(c,this,d)}kp(this)}}; t.ck=function(){this.Mc=!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=J.allocAt(c.x+d,c.y+e),T.prototype.move.call(this,a,!1),J.free(a));Ef(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(Ub),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()===Hg))return this.sa.mv(.5,a),a.add(this.i(0)),c=this.sa.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===Hg){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.xy(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).Xa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Hg)){a:{a=this.sa;var b=.5;0>b?b=0:1=b){b=c[g];c=b[2*a]; d=b[2*a+1];e=b[2*a+2];a=b[2*a+3];a=1>Math.abs(e-c)&&1>Math.abs(a-d)?0:1>Math.abs(e-c)?0<=a-d?90:270:1>Math.abs(a-d)?0<=e-c?0:180:180*Math.atan2(a-d,e-c)/Math.PI;break a}f+=l}}a=NaN}}return a}if(this.computeCurve()===Hg&&4<=a){d=(a-1)/3|0;c=3*(d/2|0);if(1===d%2)return c=Math.floor(c),a=this.i(c),d=this.i(c+1),e=this.i(c+2),c=this.i(c+3),K.wy(a.x,a.y,d.x,d.y,e.x,e.y,c.x,c.y);if(0e/2)break;b+=f;c++}d=this.i(c);e=this.i(c+1);if(1>Math.abs(d.x-e.x)&&1>Math.abs(d.y-e.y)){if(0Math.abs(d.x-e.x))return d.y>e.y?270:90;if(1>Math.abs(d.y-e.y))return d.x>e.x?180:0}return d.Xa(e)};t=S.prototype;t.i=function(a){return this.yb.j[a]}; t.ld=function(a,b){F&&(w(b,J,S,"setPoint"),b.o()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.jd(a,b)};t.N=function(a,b,c){F&&(C(b,S,"setPointAt:x"),C(c,S,"setPointAt:y"));F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.jd(a,new J(b,c))}; t.Az=function(a,b){F&&(w(b,J,S,"insertPoint"),b.o()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.Lb(a,b)};t.m=function(a,b,c){F&&(C(b,S,"insertPointAt:x"),C(c,S,"insertPointAt:y"));F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.Lb(a,new J(b,c))}; t.Ce=function(a){F&&(w(a,J,S,"addPoint"),a.o()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.add(a)};t.nf=function(a,b){F&&(C(a,S,"insertPointAt:x"),C(b,S,"insertPointAt:y"));F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.add(new J(a,b))}; t.Iv=function(a){F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.nb(a)};t.Yj=function(){F&&null===this.Hc&&v("Call Link.startRoute before modifying the points of the route.");this.yb.clear()}; function Ef(a,b,c){if(0!==b||0!==c){for(var d=a.Mc,e=new H,f=a.yb.iterator;f.next();){var g=f.value;e.add((new J(g.x+b,g.y+c)).freeze())}e.freeze();f=a.yb;a.yb=e;isNaN(b)||isNaN(c)||a.diagram.animationManager.sb?a.v():(a.pe.h(a.pe.x+b,a.pe.y+c),a.ua.h(a.ua.x+b,a.ua.y+c),xl(a));d&&lp(a);b=a.diagram;null!==b&&b.animationManager.sb&&(a.eh=e);a.g("points",f,e)}}t.Fh=function(){null===this.Hc&&(this.Hc=this.yb,this.yb=this.yb.copy())}; t.pf=function(){if(null!==this.Hc){for(var a=this.Hc,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,x=m*(u-r)+q);r=g.x+2*h/3;q=g.y+2*k/3;var y=r,z=q;K.B(k,0)?z=0k?-1:1)*n+r,z=m*(y-r)+q);this.Yj();this.Ce(g);this.nf(u,x);this.nf(y,z);this.Ce(p);this.ld(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.ld(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.B(e,0)?h=0f&&(g=-g),g=(0>e?-1:1)*g+b,h=p*(g-b)+c),this.Ce(d),this.nf(g,h)):this.Ce(d),this.Ce(a)}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Yj();var B=l?this.computeCurviness():0;n=this.getLinkPoint(b,c,d,!0,m,e,f);r=u=q=0;if(m||!h||l)x=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,n,d,!0,m,e,f),l&&(h||d.A(a)||!m&&1===d.x+ a.x&&1===d.y+a.y)&&(r-=m?90:30,0>B&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(x+=Math.abs(B)*(m?1:2)),0===r?q=x:90===r?u=x:180===r?q=-x:270===r?u=-x:(q=x*Math.cos(r*Math.PI/180),u=x*Math.sin(r*Math.PI/180)),d.Nb()&&l&&(x=c.oa(Pc,J.alloc()),y=J.allocAt(x.x+1E3*q,x.y+1E3*u),this.getLinkPointFromPoint(b,c,x,y,!0,n),J.free(x),J.free(y));x=this.getLinkPoint(e,f,a,!1,m,b,c);var D=z=y=0;if(m||!k||l){var G=this.computeEndSegmentLength(e,f,a,!1);D=this.getLinkDirection(e,f,x,a,!1,m,b,c);l&&(k||d.A(a)||!m&& 1===d.x+a.x&&1===d.y+a.y)&&(D+=m?0:30,0>B&&(D+=180));0>D?D+=360:360<=D&&(D-=360);l&&(G+=Math.abs(B)*(m?1:2));0===D?y=G:90===D?z=G:180===D?y=-G:270===D?z=-G:(y=G*Math.cos(D*Math.PI/180),z=G*Math.sin(D*Math.PI/180));a.Nb()&&l&&(a=f.oa(Pc,J.alloc()),d=J.allocAt(a.x+1E3*y,a.y+1E3*z),this.getLinkPointFromPoint(e,f,a,d,!1,x),J.free(a),J.free(d))}a=n;if(m||!h||l)a=new J(n.x+q,n.y+u);d=x;if(m||!k||l)d=new J(x.x+y,x.y+z);!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 J);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.ae()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.td;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.gk(e,d,g,c,f);null!== a&&f.transform(a);return f};function pp(a,b){var c=b.Xo;null===c&&(c=new qp,c.port=b,c.node=b.part,b.Xo=c);return rp(c,a)} S.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new J);if(c.Za()&&!np(c))return b.oa(c,h),h;if(c.uf()){var k=pp(this,b);if(null!==k){h.assign(k.oq);if(e&&this.routing===sp){var l=pp(this,g);if(null!==l&&k.bm=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.tf(Uc)||c.tf(Yc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);J.free(k);J.free(l)}}return h}}c= b.oa(.5===c.x&&.5===c.y?c:Pc,J.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=op(c,g.copy()))):(k=this.computeSpot(!d,g),f=J.alloc(),g=g.oa(.5===k.x&&.5===k.y?k:Pc,f),e&&(g=op(c,g)),J.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);J.free(c);return h}; S.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.Za())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?op(k,h.copy()):c):(c=J.alloc(),h=h.oa(Pc,c),J.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;J.free(k);k=c}d.Nb()&&g.Xd(a)&&(k+=180,360<=k&&(k-=360));if(np(d))return k;a=b.Pi();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.uf()&&(a=pp(this,b),null!==a))return a.cv;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=Pc:(b=this.fromSpot,b.Cb()&&(b=a.fromSpot),a=b===kd?Ic:b)):(a=b?b:this.toPort,null===a?a=Pc:(b=this.toSpot,b.Cb()&&(b=a.toSpot),a=b===kd?Ic:b));return a};function np(a){return a===Ic||.5===a.x&&.5===a.y}S.prototype.computeOtherPoint=function(a,b){a=b.oa(Pc);b=b.Xo;b=null!==b?rp(b,this):null;null!==b&&(a=b.oq);return a}; S.prototype.computeShortLength=function(a){if(a){a=this.fromShortLength;if(isNaN(a)){var b=this.fromPort;null!==b&&(a=b.fromShortLength)}return isNaN(a)?0:a}a=this.toShortLength;isNaN(a)&&(b=this.toPort,null!==b&&(a=b.toShortLength));return isNaN(a)?0:a}; S.prototype.sg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var g=f;void 0===f&&(g=Jb.alloc(),g.reset());g.multiply(this.transform);if(this.xh(a,g))return bn(this,b,c,e),void 0===f&&Jb.free(g),!0;if(this.Kc(a,g)){var h=!1;if(!this.isAtomic)for(var k=this.Z.j,l=k.length;l--;){var m=k[l];if(m.visible||m===this.locationObject){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Jb.alloc();n.set(g); if(m instanceof W)h=m.sg(a,b,c,d,e,n);else if(this.path===m){if(m instanceof ag)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.xh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.qf(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var x=J.alloc(),y=J.alloc(),z=J.alloc(),B=Jb.alloc();B.set(q);B.wv(m.transform);B.ht();y.x=p;y.y=u;y.transform(B);x.x=h;x.y=u;x.transform(B);q=!1;Hn(m,x,y,z)?q=!0:(x.x=p,x.y=r,x.transform(B),Hn(m,x,y,z)?q=!0:(y.x= h,y.y=r,y.transform(B),Hn(m,x,y,z)?q=!0:(x.x=h,x.y=u,x.transform(B),Hn(m,x,y,z)&&(q=!0))));Jb.free(B);J.free(x);J.free(y);J.free(z);h=q}}else h=m.xh(h,n)}else h=el(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Jb.free(n)}}}void 0===f&&Jb.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Jb.free(g);return!1}; S.prototype.computeCurve=function(){if(null===this.Lf){var a=this.fromPort,b=this.isOrthogonal;this.Lf=null!==a&&a===this.toPort&&!b}return this.Lf?Hg:this.curve};S.prototype.computeCorner=function(){if(this.curve===Hg)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.Z.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.da(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.ld(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.N(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.ld(c,d)}}return!0;case fp:f=this.i(a);n=this.i(c);if(!f.Sa(b)||!n.Sa(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.ld(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.o()&&h.o()){g.Xc(8,8);h.Xc(8,8);g.Me(a);h.Me(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 J(c.x,a.y);var l=new J(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.ea(a)||g.ea(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 J(Math.max((a.x+c.x)/2,a.x),a.y),l=new J(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.ea(a)||g.ea(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 J(Math.min((a.x+c.x)/2,a.x),a.y),l=new J(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 J(a.x,c.y),l=new J((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.ea(a)||g.ea(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 J(a.x,Math.max((a.y+c.y)/2,a.y)),l=new J(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.ea(a)||g.ea(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 J(a.x,Math.min((a.y+c.y)/2,a.y)),l=new J(c.x,k.y)}else k.x=180===d||(90===d||270===d)&&c.x=wp&&(rk(q),h=q.Iz,g.Xc(q.$l*h,q.Zl* h),up(q,a,b,p,d,g),h=vp(q,p.x,p.y));!q.abort&&h>=wp&&q.kA&&(rk(q),up(q,a,b,p,d,q.bounds),h=vp(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.N(2,g.x,g.y),this.m(3,g.x,g.y);else if(p=this.i(3),0===b||180===b)K.B(g.x,p.x)?(g=0===b?Math.max(g.x,a.x):Math.min(g.x,a.x),this.N(2,g,a.y),this.N(3,g,p.y)):K.B(g.y,p.y)?(Math.abs(a.y-g.y)<=q.Zl/2&&(this.N(2,g.x,a.y),this.N(3,p.x,a.y)),this.m(2, g.x,a.y)):this.N(2,a.x,g.y);else if(90===b||270===b)K.B(g.y,p.y)?(g=90===b?Math.max(g.y,a.y):Math.min(g.y,a.y),this.N(2,a.x,g),this.N(3,p.x,g)):K.B(g.x,p.x)?(Math.abs(a.x-g.x)<=q.$l/2&&(this.N(2,a.x,g.y),this.N(3,a.x,p.y)),this.m(2,a.x,g.y)):this.N(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.nf(f.x,u.y):this.nf(u.x,f.y));b=!0}else b=!1}}}else b= !1;b||(this.Ce(k),this.Ce(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 Nj(a){if(null===a.diagram||!a.isAvoiding||!nk(a.diagram))return!1;var b=a.points.j,c=b.length;if(4>c)return!1;a=ok(a.diagram,!0,a.containingGroup,null);for(var d=1;dzp&&vp(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>zp)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>zp&&(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),vp(b,l,m)===k-1?yp(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),vp(b,l,m)===k-1&&yp(a,b,l,m,f,!1)));a.nf(c,d)}S.prototype.Sy=function(a){F&&w(a,J,S,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Lb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gb)return a.type=Jd,this.Vn=!1,a;var c=!1,d=this.diagram;null!==d&&ip(this)&&d.$h.contains(this)&&(0!==this.Dl.width||0!==this.Dl.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.yb.j;var g=this.computeCurve();if(g===Hg&&3<=b&&!K.da(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;kx?q>r?(g.x=y-B,g.y=r-B,b.x=y+u,b.y= r+u):(g.x=y-B,g.y=r+B,b.x=y+u,b.y=r-u):q>r?(g.x=y+B,g.y=r-B,b.x=y-u,b.y=r+u):(g.x=y+B,g.y=r+B,b.x=y-u,b.y=r-u));K.da(x,y)&&K.da(r,q)&&(r>p?(z>y?(g.x=y-B,g.y=r-B,b.x=y+u):(g.x=y+B,g.y=r-B,b.x=y-u),b.y=r+u):(z>y?(g.x=y-B,g.y=r+B,b.x=y+u):(g.x=y+B,g.y=r+B,b.x=y-u),b.y=r-u));if(K.da(x,y)&&K.da(y,z)||K.da(p,r)&&K.da(r,q))x=.5*(x+z),p=.5*(p+q),g.x=x,g.y=p,b.x=x,b.y=p;1===n?(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y)):2===n&&K.da(c.x,this.i(0).x)&&K.da(c.y,this.i(0).y)&&(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y));Yd(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=Ap(this,e.copy(),!1,Pb));f=.5*(f+e.x);c=.5*(c+e.y);Yd(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=Ap(this,g.copy(),!1,Pb)),Yd(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=J.alloc();f.assign(this.i(0));g=1;for(e=0;g= b-1){if(!f.A(m))0!==this.computeShortLength(!1)&&(m=Ap(this,m.copy(),!1,Pb)),Dp(this,h,-d,-k,f,m,c);else if(0===e)for(g=1;gf.x?y=m.x-p:y=m.x+p,n.y>m.y?q=m.y+u:q=m.y-u,Dp(this,h,g,l,f,new J(y,r),x),ce(h,m.x+ g,m.y+l,z+g,q+l),f.h(z,q))):K.B(f.x,m.x)&&K.B(m.y,n.y)?(p=this.computeCorner(),p=Math.min(p,Math.abs(m.y-f.y)/2),p=u=Math.min(p,Math.abs(n.x-m.x)/2),K.B(u,0)?(Dp(this,h,g,l,f,m,x),f.assign(m)):(y=m.x,r=m.y,z=y,q=r,m.y>f.y?r=m.y-p:r=m.y+p,n.x>m.x?z=m.x+u:z=m.x-u,Dp(this,h,g,l,f,new J(y,r),x),ce(h,m.x+g,m.y+l,z+g,q+l),f.h(z,q))):(Dp(this,h,g,l,f,m,x),f.assign(m));g=e}J.free(f)}fe=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=Ap(this,e,!0,f)),0!==this.computeShortLength(!1)&& (h=Ap(this,h,!1,f)),a.type=Jd,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.Vn=!1;return a};function Cp(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.da(a,0)?b:K.da(b,0)?a:Math.sqrt(a*a+b*b)} function Ap(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=Cp(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=Cp(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 Bp(a,b,c,d){for(var e=a.pointsCount,f=b;K.da(b.x,f.x)&&K.da(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!K.da(b.x,f.x)&&!K.da(b.y,f.y))return c-1;for(var g=f;K.da(b.x,f.x)&&K.da(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||K.da(b.y,f.y)&&K.da(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 Dp(a,b,c,d,e,f,g){if(!g&&ip(a)){g=[];var h=0;a.isVisible()&&(h=Ep(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===Dg?Xd(b,l,n,!1):Yd(b,m,k,l,k,l,n)}else if(K.B(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===Dg?Xd(b,n,k,!1):Yd(b,l,m,l,k,n,k)}}b.lineTo(f.x+c,f.y+d)} function Ep(a,b,c,d){var e=a.diagram;if(null===e||b.A(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ga.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,x)n&&!K.B(g,x)){h.x=q;h.y=n;m=!0;break a}}else if(!K.B(n,r)&& K.B(g,x)&&Math.min(n,r)g&&Math.min(q,u)m&&!K.B(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}J.free(h)}function ip(a){a=a.curve;return a===Cg||a===Dg}function mp(a,b){if(b||ip(a))b=a.diagram,null===b||b.animationManager.isTicking||b.$h.contains(a)||0===a.Dl.width&&0===a.Dl.height||b.$h.add(a,a.Dl.copy())} S.prototype.kq=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isAnimating){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.Ga.j;for(var g=e.length,h=0;ha&&ya(a,">= 0",S,"fromEndSegmentLength"),this.R.Pg=a,this.g("fromEndSegmentLength",b,a),this.Ta())}},fromShortLength:{configurable:!0,get:function(){return null!==this.R?this.R.Qg:NaN},set:function(a){this.Jc();var b=this.R.Qg;b!==a&&(F&&A(a,"number",S,"fromShortLength"),this.R.Qg=a,this.g("fromShortLength",b,a),this.Ta(),this.cc())}}, toSpot:{configurable:!0,get:function(){return null!==this.R?this.R.ph:kd},set:function(a){this.Jc();var b=this.R.ph;b.A(a)||(F&&w(a,M,S,"toSpot"),a=a.J(),this.R.ph=a,this.g("toSpot",b,a),this.Ta())}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.R?this.R.nh:NaN},set:function(a){this.Jc();var b=this.R.nh;b!==a&&(F&&A(a,"number",S,"toEndSegmentLength"),0>a&&ya(a,">= 0",S,"toEndSegmentLength"),this.R.nh=a,this.g("toEndSegmentLength",b,a),this.Ta())}}, toShortLength:{configurable:!0,get:function(){return null!==this.R?this.R.oh:NaN},set:function(a){this.Jc();var b=this.R.oh;b!==a&&(F&&A(a,"number",S,"toShortLength"),this.R.oh=a,this.g("toShortLength",b,a),this.Ta(),this.cc())}},isLabeledLink:{configurable:!0,get:function(){return null===this.bd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);K.Yl(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.Me(f),e=2;ed&&(d=-d)):K.da(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Fe(e));a.push(d)}}return this.xr}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.gu;if(isNaN(a)){for(var b=this.flattenedLengths, c=b.length,d=a=0;d=this.pointsCount?0:this.isOrthogonal||!np(this.computeSpot(!0))?1:0}},lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!np(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0,get:function(){return this.Rm},set:function(a){var b=this.Rm;b!==a&&(F&&hb(a,S,S,"adjusting"),this.Rm=a,this.g("adjusting",b,a))}},corner:{configurable:!0, enumerable:!0,get:function(){return this.mn},set:function(a){var b=this.mn;b!==a&&(F&&A(a,"number",S,"corner"),this.mn=a,this.cc(),this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.pn},set:function(a){var b=this.pn;b!==a&&(F&&hb(a,S,S,"curve"),this.pn=a,this.Ta(),this.cc(),mp(this,b===Dg||b===Cg||a===Dg||a===Cg),this.g("curve",b,a))}},curviness:{configurable:!0,get:function(){return this.qn},set:function(a){var b=this.qn;b!==a&&(F&&A(a,"number", S,"curviness"),this.qn=a,this.Ta(),this.cc(),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.Jj},set:function(a){var b=this.Jj;b!==a&&(F&&hb(a,S,S,"routing"),this.Jj=a,this.Lf=null,this.Ta(),mp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{configurable:!0,get:function(){return this.yp},set:function(a){var b=this.yp;b!==a&&(F&&A(a,"number",S,"smoothness"),this.yp=a,this.cc(),this.g("smoothness",b,a))}},key:{configurable:!0, enumerable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.km())return a.model.kc(this.data)}}});S.prototype.invalidateOtherJumpOvers=S.prototype.kq;S.prototype.findClosestSegment=S.prototype.Sy;S.prototype.updateRoute=S.prototype.cj;S.prototype.invalidateRoute=S.prototype.Ta;S.prototype.rollbackRoute=S.prototype.Ix;S.prototype.commitRoute=S.prototype.pf;S.prototype.startRoute=S.prototype.Fh;S.prototype.clearPoints=S.prototype.Yj;S.prototype.removePoint=S.prototype.Iv; S.prototype.addPointAt=S.prototype.nf;S.prototype.addPoint=S.prototype.Ce;S.prototype.insertPointAt=S.prototype.m;S.prototype.insertPoint=S.prototype.Az;S.prototype.setPointAt=S.prototype.N;S.prototype.setPoint=S.prototype.ld;S.prototype.getPoint=S.prototype.i;S.prototype.getOtherPort=S.prototype.oz;S.prototype.getOtherNode=S.prototype.ct; var cp=new E(S,"Normal",1),Ip=new E(S,"Orthogonal",2),Jp=new E(S,"AvoidsNodes",6),sp=new E(S,"AvoidsNodesStraight",7),Eg=new E(S,"None",0),Hg=new E(S,"Bezier",9),Dg=new E(S,"JumpGap",10),Cg=new E(S,"JumpOver",11),dp=new E(S,"End",17),ep=new E(S,"Scale",18),fp=new E(S,"Stretch",19),Jn=new E(S,"OrientAlong",21),Jm=new E(S,"OrientPlus90",22),Lm=new E(S,"OrientMinus90",23),gp=new E(S,"OrientOpposite",24),hp=new E(S,"OrientUpright",25),Km=new E(S,"OrientPlus90Upright",26),Mm=new E(S,"OrientMinus90Upright", 27),Nm=new E(S,"OrientUpright45",28);S.className="Link";S.Normal=cp;S.Orthogonal=Ip;S.AvoidsNodes=Jp;S.AvoidsNodesStraight=sp;S.None=Eg;S.Bezier=Hg;S.JumpGap=Dg;S.JumpOver=Cg;S.End=dp;S.Scale=ep;S.Stretch=fp;S.OrientAlong=Jn;S.OrientPlus90=Jm;S.OrientMinus90=Lm;S.OrientOpposite=gp;S.OrientUpright=hp;S.OrientPlus90Upright=Km;S.OrientMinus90Upright=Mm;S.OrientUpright45=Nm;function Hp(a,b,c,d){fb(this);this.le=this.Ir=!1;this.pt=a;this.Ex=b;this.xv=c;this.Fx=d;this.links=[]} Hp.prototype.im=function(){if(!this.Ir){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.Ld=Math.floor((a.x-this.lc)/this.lc)*this.lc;this.Md=Math.floor((b-this.mc)/this.mc)*this.mc;this.qo=Math.ceil((c+2*this.lc)/this.lc)*this.lc;this.ro=Math.ceil((d+2*this.mc)/this.mc)*this.mc;a=1+(Math.ceil((this.qo-this.Ld)/this.lc)|0);b=1+(Math.ceil((this.ro-this.Md)/this.mc)|0);if(null===this.Eb||this.Qj=zp&&(a.Eb[b][c]=Kp)} pk.prototype.jk=function(a,b,c,d){if(a>this.qo||a+cthis.ro||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.Qj)|0;for(c=Math.min(b+e-1,this.Rj)|0;a<=d;a++)for(e=b;e<=c;e++)if(this.Eb[a][e]===xp)return!1;return!0}; function Lp(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.Eb[l][m];if(n>=zp&&n=a.Eb[l][m]);)a.Eb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)Lp(a,b,c,1,!e,f,g,h,k),Lp(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)Lp(a,b,c,1,!e,f,g,h,k),Lp(a,b,c,-1,!e,f,g,h, k)}}function Mp(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=xp,m=zp;for(a.Eb[b][c]=m;l===xp&&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.Ld;k/=a.lc;l-=a.Md;l/=a.mc;m-=a.Ld;m/=a.lc;n-=a.Md;n/=a.mc;f=Math.max(0,Math.min(a.Qj,k|0));m=Math.min(a.Qj,Math.max(0,m|0));l=Math.max(0,Math.min(a.Rj,l|0));n=Math.min(a.Rj,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.Eb[g][h]===xp?(Mp(a,g,h,k,c,f,m,l,n),Mp(a,g,h,1,!c,f,m,l,n),Mp(a,g,h,-1,!c,f,m,l,n)):Mp(a,g,h,k,c,g,h,g,h);a.Eb[b][d]===xp?(Np(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,m,l,n),Np(a,b,d,1,!(90===e||270===e),f,m,l,n),Np(a,b,d,-1,!(90===e||270===e),f,m,l,n)):Np(a,b,d,k,c,b,d,b,d);a.abort||(Lp(a,g,h,1,!1,f,m,l,n),Lp(a,g,h,-1,!1,f,m,l,n),Lp(a,g,h,1,!0,f,m,l,n),Lp(a,g,h,-1,!0,f,m,l,n))}}} ma.Object.defineProperties(pk.prototype,{bounds:{configurable:!0,get:function(){return new L(this.Ld,this.Md,this.qo-this.Ld,this.ro-this.Md)}},$l:{configurable:!0,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}qp.prototype.im=function(){this.Yd.length=0}; function rp(a,b){var c=a.Yd;if(0===c.length){a:if(!a.qq){c=a.qq;a.qq=!0;var d=null,e=a.node;e=e instanceof Rf?e:null;if(null===e||e.isSubGraphExpanded)var f=a.node.fv(a.port.portId);else{if(!e.actualBounds.o()){a.qq=c;break a}d=e;f=d.ev()}var g=a.Yd.length=0,h=a.port.oa(Jc,J.alloc()),k=a.port.oa(Tc,J.alloc());e=L.allocAt(h.x,h.y,0,0);e.Me(k);J.free(h);J.free(k);h=J.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.Pi();for(f=f.iterator;f.next();){var l=f.value;if(l.isVisible()&&l.fromPort!==l.toPort){var m= l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Xd(d),n=l.computeSpot(m,a.port);if(n.uf()&&(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.Xa(m);p-=k;0>p&&(p+=360);n=Op(e,n,p,l.isOrthogonal);0===n?(n=4,180Math.abs(u)?(z=Math.abs(u)/p,p=Math.abs(u)):z=1;break;case 2:r>Math.abs(B)?(z=Math.abs(B)/r,r=Math.abs(B)):z=1;break;case 1:n>Math.abs(u)?(z=Math.abs(u)/n,n=Math.abs(u)):z=1;break;default:case 4:m>Math.abs(B)?(z=Math.abs(B)/m,m=Math.abs(B)):z=1}y=0}var O=D.oq;if(d===$o){D=D.link.computeThickness(); D*=z;O.set(G);switch(q){case 8:O.x=G.x+u/2+p/2-y-D/2;break;case 2:O.y=G.y+B/2+r/2-y-D/2;break;case 1:O.x=G.x+u/2-n/2+y+D/2;break;default:case 4:O.y=G.y+B/2-m/2+y+D/2}y+=D}else{var Q=.5;d===No&&(Q=(D.hq+1)/(D.bm+1));O.x=G.x+u*Q;O.y=G.y+B*Q}}}J.free(h);J.free(k);J.free(f);J.free(l);G=a.Yd;for(g=0;gb.Ac?1:a.angleb.angle?1:0};qp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,Ic,b.fromPort===this.port),d=a.hq;if(0>d)return c;var e=a.bm;if(1>=e||!b.isOrthogonal)return c;b=a.Bv;var f=a.oq;if(2===a.Ac||8===a.Ac)d=e-1-d;return((a=2===a.Ac||4===a.Ac)?b.y=c-1?(g=0,e=d,f+=h+20,h=0):g++}null!==a&&a.ab("Layout")}this.isValidLayout=!0};vi.prototype.sk=function(a){return!a.location.o()||a instanceof Rf&&a.sk?!0:!1}; function Rp(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 Rf?null===k.layout?Rp(a,b,k.memberParts,!1,e,f,g,h):(Sp(k),b.add(k)):(Sp(k),b.add(k))):g&&k instanceof S?b.add(k):!h||!k.dc()||k instanceof V||(Sp(k),b.add(k)))}}function Sp(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.bc()} vi.prototype.Ri=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new L),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b};vi.prototype.bx=function(a){var b=new I;a instanceof P?(Rp(this,b,a.nodes,!0,null,!0,!0,!0),Rp(this,b,a.links,!0,null,!0,!0,!0),Rp(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof Rf?Rp(this,b,a.memberParts,!1,null,!0,!0,!0):Rp(this,b,a.iterator,!1,null,!0,!0,!0);return b}; vi.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.oa(Jc),(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(vi.prototype,{diagram:{configurable:!0,get:function(){return this.D},set:function(a){null!==a&&w(a,P,vi,"diagram");this.D=a}},group:{configurable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(null!==a&&w(a,Rf,vi,"group"),this.L=a,null!==a&&(this.D=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.Xn},set:function(a){this.Xn!==a&&(A(a,"boolean",vi,"isOngoing"),this.Xn=a)}},isInitial:{configurable:!0, enumerable:!0,get:function(){return this.Qf},set:function(a){A(a,"boolean",vi,"isInitial");this.Qf=a;a||(this.bo=!0)}},isViewportSized:{configurable:!0,get:function(){return this.co},set:function(a){this.co!==a&&(A(a,"boolean",vi,"isViewportSized"),(this.co=a)&&this.C())}},isRouting:{configurable:!0,get:function(){return this.$n},set:function(a){this.$n!==a&&(A(a,"boolean",vi,"isRouting"),this.$n=a)}},isRealtime:{configurable:!0,get:function(){return this.Zn}, set:function(a){this.Zn!==a&&(null!==a&&A(a,"boolean",vi,"isRealtime"),this.Zn=a)}},isValidLayout:{configurable:!0,get:function(){return this.bo},set:function(a){this.bo!==a&&(A(a,"boolean",vi,"isValidLayout"),this.bo=a,a||(a=this.diagram,null!==a&&(a.Fg=!0)))}},network:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(null!==a&&w(a,Qp,vi,"network"),this.l=a,null!==a&&(a.layout=this))}},boundsComputation:{configurable:!0,get:function(){return this.w}, set:function(a){this.w!==a&&(null!==a&&A(a,"function",vi,"boundsComputation"),this.w=a,this.C())}},arrangementOrigin:{configurable:!0,get:function(){return this.Vm},set:function(a){w(a,J,vi,"arrangementOrigin");this.Vm.A(a)||(this.Vm.assign(a),this.C())}}});vi.prototype.collectParts=vi.prototype.bx;vi.prototype.getLayoutBounds=vi.prototype.Ri;vi.prototype.invalidateLayout=vi.prototype.C;vi.className="Layout"; function Qp(a){fb(this);F&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.ic=a;this.lf=new I;this.he=new I;this.qt=new Db;this.lt=new Db}Qp.prototype.clear=function(){if(this.lf)for(var a=this.lf.iterator;a.next();)a.value.clear();if(this.he)for(a=this.he.iterator;a.next();)a.value.clear();this.lf=new I;this.he=new I;this.qt=new Db;this.lt=new Db}; Qp.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.lf.count+" edges: "+this.he.count;if(1b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(Tp.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.Ag._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.rg._dataArray}},data:{configurable:!0,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.w.h(d/2,b/2);this.l.h(a,c,d,b)}}},node:{configurable:!0,get:function(){return this.oi}, set:function(a){if(this.oi!==a){F&&null!==a&&w(a,V,Tp,"node");this.oi=a;a.bc();var b=this.network.layout,c=L.alloc(),d=b.Ri(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);L.free(c);if(!(a instanceof Rf)&&(a=a.locationObject.oa(Pc),a.o())){this.w.h(a.x-b,a.y-e);return}this.w.h(f/2,d/2)}}},bounds:{configurable:!0,get:function(){return this.l},set:function(a){this.l.A(a)||(F&&w(a,L,Tp,"bounds"),this.l.assign(a))}},focus:{configurable:!0, get:function(){return this.w},set:function(a){this.w.A(a)||(F&&w(a,J,Tp,"focus"),this.w.assign(a))}},centerX:{configurable:!0,get:function(){return this.l.x+this.w.x},set:function(a){var b=this.l;b.x+this.w.x!==a&&(F&&C(a,Tp,"centerX"),b.ja(),b.x=a-this.w.x,b.freeze())}},centerY:{configurable:!0,get:function(){return this.l.y+this.w.y},set:function(a){var b=this.l;b.y+this.w.y!==a&&(F&&C(a,Tp,"centerY"),b.ja(),b.y=a-this.w.y,b.freeze())}},focusX:{configurable:!0, get:function(){return this.w.x},set:function(a){var b=this.w;b.x!==a&&(b.ja(),b.x=a,b.freeze())}},focusY:{configurable:!0,get:function(){return this.w.y},set:function(a){var b=this.w;b.y!==a&&(b.ja(),b.y=a,b.freeze())}},x:{configurable:!0,get:function(){return this.l.x},set:function(a){var b=this.l;b.x!==a&&(b.ja(),b.x=a,b.freeze())}},y:{configurable:!0,get:function(){return this.l.y},set:function(a){var b=this.l;b.y!==a&&(b.ja(),b.y=a,b.freeze())}},width:{configurable:!0, enumerable:!0,get:function(){return this.l.width},set:function(a){var b=this.l;b.width!==a&&(b.ja(),b.width=a,b.freeze())}},height:{configurable:!0,get:function(){return this.l.height},set:function(a){var b=this.l;b.height!==a&&(b.ja(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.Oc},set:function(a){F&&w(a,Qp,Tp,"network");this.Oc=a}},sourceVertexes:{configurable:!0,get:function(){for(var a=new I,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex); return a.iterator}},destinationVertexes:{configurable:!0,get:function(){for(var a=new I,b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{configurable:!0,get:function(){for(var a=new I,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:{configurable:!0,get:function(){return this.Ag.iterator}},destinationEdges:{configurable:!0, enumerable:!0,get:function(){return this.rg.iterator}},edges:{configurable:!0,get:function(){for(var a=new H,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{configurable:!0,get:function(){return this.Ag.count+this.rg.count}}});Tp.prototype.deleteDestinationEdge=Tp.prototype.Yu;Tp.prototype.addDestinationEdge=Tp.prototype.Mu;Tp.prototype.deleteSourceEdge=Tp.prototype.Zu; Tp.prototype.addSourceEdge=Tp.prototype.Ou;Tp.className="LayoutVertex";Tp.standardComparer=Zp; Tp.smartComparer=function(a,b){F&&w(a,Tp,Tp,"smartComparer:m");F&&w(b,Tp,Tp,"smartComparer:n");if(null!==a){if(null!==b){a=a.oi;var c=b.oi;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.Ca("Layout");d=[];switch(this.alignment){case hq:var h=b,k=c,l=L.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n= m=0;nf-1|| 0g)d.push(new L(0,u,g+h,y)),x=0,q=r,u+=y,y=0;y=Math.max(y,O);switch(p){case gq:D=-D.width;break;default:D=0}B.moveTo(q+D,u);switch(p){case gq:q-=G;break;default:q+=G}x++}d.push(new L(0,u,g+h,y));L.free(l);break;case $p:k=g;m=f;n=b;p=c;g=L.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=J.alloc();for(q=0;q=l&&(k-=l);l=B=0;G=Math.max(this.cellSize.height,1);D=f=0;O=!0;x=J.alloc();for(Q=0;Qm-1||0k){d.push(new L(0,O?z-f:z,k+n,D+f+p));for(R=0;Rl&&(f.width+=f.x-l,f.x=l);L.free(g)}for(h=f=g=e=0;hb?1:0} ma.Object.defineProperties(Hk.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.Pp},set:function(a){this.Pp!==a&&(A(a,"number",Hk,"wrappingWidth"),0n)){var u=n+$m(q);q.zc(u,!0);mn(q,u,n)}}b.isModified=!0}}finally{b.fa=!0}}}}};qi.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Fa(a);for(b=this.nodes.iterator;b.next();)b.value.Fa(a);for(b=this.links.iterator;b.next();)b.value.Fa(a)}; qi.prototype.Eq=function(){for(var a=this.D.model,b=new I,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.Fm=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.Fm(a.valueOf()):Ga(a)?Lq(this,a):Fa(a)?Iq(this,a):"function"===typeof a?"null":a.toString()}; function Lq(a,b,c){void 0===c&&(c=!1);var d=b.length;if(0>=d)return"[]";var e=new ib;e.add("[ ");c&&1d)return;Ka(a.sc,d)}Sq(a,"nodeDataArray",Ge,"nodeDataArray",a,b,null,d,null);a.Dq(b)}t.$z=function(a){if(Ga(a))for(var b=a.length,c=0;cb&&(b=a.length);Ja(a,b,c);Sq(this,"",Fe,"",a,null,c,null,b)}; t.Gv=function(a,b){void 0===b&&(b=-1);F&&(Ha(a,X,"removeArrayItem:arr"),C(b,X,"removeArrayItem:idx"));a===this.sc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Ka(a,b);Sq(this,"",Ge,"",a,c,null,b,null)};t.at=function(a){if(null===a)return"";var b=this.Bj;if(""===b)return"";b=nn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; t.Aq=function(a,b){A(b,"string",X,"setCategoryForNodeData:cat");if(null!==a){var c=this.Bj;if(""!==c)if(this.Ab(a)){var d=nn(a,c);void 0===d&&(d="");d!==b&&(Pj(a,c,b),Sq(this,"nodeCategory",De,c,a,d,b))}else Pj(a,c,b)}};t.lm=function(){return!1};t.ik=function(){return!1};t.km=function(){return!1};t.kt=function(){return!1};t.Ui=function(){return!1};function ui(){return new X} function Oq(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 Oq(a,b.constructor);return typeof b}function Qq(a){return Wq[a]?Wq[a]:null}function nn(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){F&&Da("property get error: "+d.toString())}return c} function Pj(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){F&&Da("property set error: "+d.toString())}} ma.Object.defineProperties(X.prototype,{name:{configurable:!0,get:function(){return this.Wa},set:function(a){var b=this.Wa;b!==a&&(A(a,"string",X,"name"),this.Wa=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.rn},set:function(a){var b=this.rn;b!==a&&(A(a,"string",X,"dataFormat"),this.rn=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.Rf},set:function(a){var b=this.Rf;b!==a&&(A(a,"boolean", X,"isReadOnly"),this.Rf=a,this.g("isReadOnly",b,a))}},modelData:{configurable:!0,get:function(){return this.l},set:function(a){var b=this.l;b!==a&&(A(a,"object",X,"modelData"),this.l=a,this.g("modelData",b,a),this.Fa(a))}},undoManager:{configurable:!0,get:function(){return this.w},set:function(a){var b=this.w;b!==a&&(w(a,Ie,X,"undoManager"),null!==b&&b.Hx(this),this.w=a,null!==a&&a.Yw(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.gh}, set:function(a){A(a,"boolean",X,"skipsUndoManager");this.gh=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.pi},set:function(a){var b=this.pi;b!==a&&(Tq(a,X,"nodeKeyProperty"),""===a&&v("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c, 0,a.newValue));return}}else if(a.change===Ge){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Fa(a)&&"number"===typeof c&&(d=this.kc(a),b?(this.Sf.add(a),this.Rc[c]!==a&&this.Rc.splice(c,0,a),void 0!==d&&this.rb.add(d,a)):(this.Sf.remove(a),this.Rc[c]===a&&this.Rc.splice(c,1),void 0!==d&&this.rb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.vg(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}}X.prototype.Wj.call(this,a,b)};t.mm=function(a){if(void 0!==a){var b=this.ej;if(null!==b){var c=this.Sb(a);null===c&&(c=this.copyNodeData(b),Pj(c,this.nodeKeyProperty,a),this.mf(c))}return a}};t.lz=function(a){return vq(this,a,!0)};t.Lx=function(a,b){Dq(this,a,b,!0)};t.qz=function(a){return vq(this,a,!1)};t.Px=function(a,b){Dq(this,a,b,!1)}; function vq(a,b,c){if(null!==b&&(a=c?a.Xe:a.Ye,""!==a&&(a=nn(b,a),void 0!==a))){if(xq(a))return a;v((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);void 0===c||xq(c)||xa(c,"number or string",Yq,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.Xe:a.Ye;if(""!==e)if(c=a.mm(c),a.Ee(b)){var f=nn(b,e);f!==c&&(Bq(a,f,b),Pj(b,e,c),null===a.Sb(c)&&Cq(a,c,b),Sq(a,d?"linkFromKey":"linkToKey",De,e,b,f,c),"string"===typeof e&&a.Fa(b,e))}else Pj(b,e,c)}}t.mz=function(a){return uq(this,a,!0)};t.Mx=function(a,b){Eq(this,a,b,!0)};t.rz=function(a){return uq(this,a,!1)}; t.Qx=function(a,b){Eq(this,a,b,!1)};function uq(a,b,c){if(null===b)return"";a=c?a.xj:a.yj;if(""===a)return"";b=nn(b,a);return void 0===b?"":b}function Eq(a,b,c,d){A(c,"string",Yq,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.xj:a.yj;if(""!==e)if(a.Ee(b)){var f=nn(b,e);void 0===f&&(f="");f!==c&&(Pj(b,e,c),Sq(a,d?"linkFromPortId":"linkToPortId",De,e,b,f,c),"string"===typeof e&&a.Fa(b,e))}else Pj(b,e,c)}} t.vg=function(a){if(null===a)return Zq;var b=this.Kd;if(""===b)return Zq;a=nn(a,b);return void 0===a?Zq:a};t.Qv=function(a,b){Ha(b,Yq,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Kd;if(""!==c)if(this.Ee(a)){var d=nn(a,c);void 0===d&&(d=Zq);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Ee(a)&&(Bq(this,b,a),Sq(this,"linkLabelKeys",Ge,c,a,b,null,e,null)))}else void 0!==d&&v(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; t.kc=function(a){if(null!==a){var b=this.li;if(""!==b&&(b=nn(a,b),void 0!==b)){if(xq(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.Bt=function(a,b){void 0!==b&&null!==b&&xq(b)||xa(b,"number or string",Yq,"setKeyForLinkData:key");if(null!==a){var c=this.li;if(""!==c)if(this.Ee(a)){var d=nn(a,c);d!==b&&null===this.zh(b)&&(Pj(a,c,b),void 0!==d&&this.rb.remove(d),this.rb.add(b,a),Sq(this,"linkKey",De,c,a,d,b),"string"===typeof c&&this.Fa(a,c))}else Pj(a,c,b)}}; t.zh=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&xq(a)?this.rb.K(a):null}; t.pq=function(a){if(null!==a){var b=this.li;if(""!==b){var c=this.kc(a);if(void 0===c||this.rb.contains(c)){var d=this.vl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.rb.contains(c))){Pj(a,b,c);return}if("string"===typeof c){for(d=2;this.rb.contains(c+d);)d++;Pj(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.rb.count-1;this.rb.contains(c);)c--;Pj(a,b,c)}else F&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}}; t.Ee=function(a){return null===a?!1:this.Sf.contains(a)};t.Fi=function(a){null!==a&&(vb(a),this.Ee(a)||zq(this,a,!0))};function zq(a,b,c){if(""!==a.linkKeyProperty){var d=a.kc(b);if(void 0!==d&&a.rb.K(d)===b)return;a.pq(b);d=a.kc(b);if(void 0===d){v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.rb.add(d,b)}a.Sf.add(b);d=null;c&&(d=a.Rc.length,a.Rc.splice(d,0,b));Sq(a,"linkDataArray",Fe,"linkDataArray",a,null,b,null,d);$q(a,b)} t.oy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.Rc.splice(d,1)}Sq(a,"linkDataArray",Ge,"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.vg(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 H;b.addAll(a.iterator);a=new H;var c=new H;var d=this.sort(b);var e,f,g=this.dr;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===rr&&k===sr?h=cr:h===rr&&k!==sr&&(h=this.arrangement);if((this.direction===mr||this.direction===nr)&&this.sorting!==gr){for(k=0;!(k>=d.length);k+=2){a.add(d.O(k));if(k+1>=d.length)break;c.add(d.O(k+1))}this.direction===mr?(this.arrangement===rr&&a.reverse(),d=new H,d.addAll(a), d.addAll(c)):(this.arrangement===rr&&c.reverse(),d=new H,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;rp&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===rr){isNaN(b)&&(b=6);if(h!==cr&&h!==rr){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g=r/(360<=p?k:k-1)}this.Bw=h;this.Zb=l;this.En=m;this.Cw=n;this.sr=p;this.kj=b;this.Td=f;this.dr=g;b=d;d=this.Bw;h=this.Zb;l=this.Cw;m=this.sr;n=this.kj;p=this.Td;k=this.dr;if(this.direction!==mr&&this.direction!==nr||d!==rr)if(this.direction===mr||this.direction===nr){g=0;switch(d){case qr:g=180*xr(this,h,p,l,k)/Math.PI;break;case cr:k=b=0;g=a.first();null!==g&&(b=ur(g,Math.PI/2));g=c.first(); null!==g&&(k=ur(g,Math.PI/2));g=180*xr(this,h,p,l,n+(b+k)/2)/Math.PI;break;case pr:g=m/b.length}if(this.direction===mr){switch(d){case qr:yr(this,a,l,or);break;case cr:zr(this,a,l,or);break;case pr:Ar(this,a,m/2,l,or)}switch(d){case qr:yr(this,c,l+g,fr);break;case cr:zr(this,c,l+g,fr);break;case pr:Ar(this,c,m/2,l+g,fr)}}else{switch(d){case qr:yr(this,c,l,or);break;case cr:zr(this,c,l,or);break;case pr:Ar(this,c,m/2,l,or)}switch(d){case qr:yr(this,a,l+g,fr);break;case cr:zr(this,a,l+g,fr);break;case pr:Ar(this, a,m/2,l+g,fr)}}}else switch(d){case qr:yr(this,b,l,this.direction);break;case cr:zr(this,b,l,this.direction);break;case pr:Ar(this,b,m,l,this.direction);break;case rr:Br(this,b,m,l,this.direction)}else Br(this,b,m,l-m/2,fr)}this.updateParts();this.network=null;this.isValidLayout=!0}; function Ar(a,b,c,d,e){var f=a.sr,g=a.Zb;a=a.Td;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===fr?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;Er(a,k,l,m,n,e,f)||Fr(a,k,l,m,n,e,f);k=f.x;l=f.y}J.free(f);a.Dj++;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.Dj?a.Zb-g/(2*Math.PI):5>m.length&&10=n.length-1)break;Er(a,k,l,n,p,e,m)||Fr(a,k,l,n,p,e,m);k=m.x;l=m.y}J.free(m);a.Dj++;if(!(23a.Dj?a.Zb-f/(2*Math.PI):a.Zb-(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 Fr(a,b,c,d,e,f,g){var h=a.Zb,k=a.Td,l=0;a=(d[e].height+d[e+1].height)/2+a.kj;d=!1;if(0<=b!==(f===fr)){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}br.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; br.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 J(0,0):(c.x=this.arrangementOrigin.x+this.Zb,c.y=this.arrangementOrigin.y+this.Td);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.bc(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.Zd(c.Zd(a)),this.group.move(b),this.ow=b.Zd(a))}; br.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function wr(a,b,c,d,e){var f=a.by;if(.001>Math.abs(a.En-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 vr(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?wr(a,1,c,d,e):wr(a,1,c))}function xr(a,b,c,d,e){if(.001>Math.abs(a.En-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}} br.prototype.sort=function(a){switch(this.sorting){case kr:break;case lr:a.reverse();break;case ir:a.sort(this.comparer);break;case jr:a.sort(this.comparer);a.reverse();break;case gr:for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.O(f));b[f]=-1;f=a.O(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(O)||Gb.indexOf(O)||G=u?G+1:G)),y+=G=u&&G++,B>=u&&B++,G>B&&(D=B,B=G,G=D),B-G<(b.length+2)/2===(Gr||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.Ql=a:this.Ql=360,this.C())}},arrangement:{configurable:!0,get:function(){return this.Db},set:function(a){this.Db!==a&&(hb(a,br,br,"arrangement"),a===rr||a===cr||a===qr||a===pr)&&(this.Db=a,this.C())}},direction:{configurable:!0,get:function(){return this.M},set:function(a){this.M!==a&&(hb(a,br,br,"direction"), a===fr||a===or||a===mr||a===nr)&&(this.M=a,this.C())}},sorting:{configurable:!0,get:function(){return this.Tc},set:function(a){this.Tc!==a&&(hb(a,br,br,"sorting"),a===kr||a===lr||a===ir||jr||a===gr)&&(this.Tc=a,this.C())}},comparer:{configurable:!0,get:function(){return this.Pc},set:function(a){this.Pc!==a&&(A(a,"function",br,"comparer"),this.Pc=a,this.C())}},spacing:{configurable:!0,get:function(){return this.cf},set:function(a){this.cf!==a&&(A(a,"number", br,"spacing"),this.cf=a,this.C())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.Jo},set:function(a){this.Jo!==a&&(hb(a,br,br,"nodeDiameterFormula"),a===hr||a===sr)&&(this.Jo=a,this.C())}},actualXRadius:{configurable:!0,get:function(){return this.Zb}},actualYRadius:{configurable:!0,get:function(){return this.Td}},actualSpacing:{configurable:!0,get:function(){return this.kj}},actualCenter:{configurable:!0,get:function(){return this.ow}}}); var cr=new E(br,"ConstantSpacing",0),qr=new E(br,"ConstantDistance",1),pr=new E(br,"ConstantAngle",2),rr=new E(br,"Packed",3),fr=new E(br,"Clockwise",4),or=new E(br,"Counterclockwise",5),mr=new E(br,"BidirectionalLeft",6),nr=new E(br,"BidirectionalRight",7),kr=new E(br,"Forwards",8),lr=new E(br,"Reverse",9),ir=new E(br,"Ascending",10),jr=new E(br,"Descending",11),gr=new E(br,"Optimized",12),hr=new E(br,"Pythagorean",13),sr=new E(br,"Circular",14);br.className="CircularLayout";br.ConstantSpacing=cr; br.ConstantDistance=qr;br.ConstantAngle=pr;br.Packed=rr;br.Clockwise=fr;br.Counterclockwise=or;br.BidirectionalLeft=mr;br.BidirectionalRight=nr;br.Forwards=kr;br.Reverse=lr;br.Ascending=ir;br.Descending=jr;br.Optimized=gr;br.Pythagorean=hr;br.Circular=sr;function dr(){this.gm=-Infinity;this.Gm=this.Ak=null} dr.prototype.compare=function(a,b){if(0this.gm||Math.abs(a)a&&0f?(e=r.x+r.width/2,h=r.y+ r.height/2,k[0]=new J(r.x+r.width+d.width,r.y),k[1]=new J(r.x,r.y+r.height+d.height),f=2):(m=Lr(k,f,e,h,r.width,r.height,d),p=k[m],n=new J(p.x+r.width+d.width,p.y),r=new J(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.Kc(c)&&(a++,2a.network.vertexes.count)return!1;a.rh=a.network.vertexes.Oa();a=a.rh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.vd-a.vd});for(b=a.length-1;0<=b&&1>=a[b].vd;)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 L(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new J(p.x+g,p.y+h)}}a.network=d;return c} function Qr(a,b,c){F&&(w(b,Jr,Ir,"popNetwork:oldnet"),C(c,Ir,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Ke){var e=d.Ke.O(d.Nv);d.vd=e.Ht;var f=e.jw,g=e.kw;d.bounds=new L(d.centerX-f,d.centerY-g,e.It,e.Gt);d.focus=new J(f,g);d.Nv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Rr(a,b,c){F&&(w(b,Tr,Ir,"surroundNode:oldnet"),C(c,Ir,"surroundNode:level"));var d=b.Zj;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.Ke&&0=n.vd?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=c+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} function Lr(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.Of;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=Ur(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Wr),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 Wr),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;d=0;e=a.moveLimit;for(c=0;ce&&(g=e),k<-e?k=-e:k>e&&(k=e),f.centerX+=g,f.centerY+=k,d=Math.max(d,g*g+k*k));return d>a.epsilonDistance*a.epsilonDistance}Ir.prototype.moveFixedVertex=function(){};Ir.prototype.commitLayout=function(){this.Sv();this.commitNodes();this.isRouting&&this.commitLinks()};Ir.prototype.Sv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=kd,b.toSpot=kd)}}; Ir.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=L.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;L.free(c)}c=L.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()}L.free(c)};Ir.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()}; Ir.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Vk:a};Ir.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Uk:a};Ir.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Sk:a};Ir.prototype.electricalFieldX=function(){return 0};Ir.prototype.electricalFieldY=function(){return 0};Ir.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Tk:a};Ir.prototype.gravitationalFieldX=function(){return 0}; Ir.prototype.gravitationalFieldY=function(){return 0};Ir.prototype.isFixed=function(a){return a.isFixed}; ma.Object.defineProperties(Ir.prototype,{currentIteration:{configurable:!0,get:function(){return this.fo}},arrangementSpacing:{configurable:!0,get:function(){return this.yd},set:function(a){w(a,Ib,Ir,"arrangementSpacing");this.yd.A(a)||(this.yd.assign(a),this.C())}},arrangesToOrigin:{configurable:!0,get:function(){return this.Wm},set:function(a){this.Wm!==a&&(A(a,"boolean",Ir,"arrangesToOrigin"),this.Wm=a,this.C())}},setsPortSpots:{configurable:!0, get:function(){return this.bf},set:function(a){this.bf!==a&&(A(a,"boolean",Ir,"setsPortSpots"),this.bf=a,this.C())}},comments:{configurable:!0,get:function(){return this.Zc},set:function(a){this.Zc!==a&&(A(a,"boolean",Ir,"comments"),this.Zc=a,this.C())}},maxIterations:{configurable:!0,get:function(){return this.wl},set:function(a){this.wl!==a&&(A(a,"number",Ir,"maxIterations"),0<=a&&(this.wl=a,this.C()))}},epsilonDistance:{configurable:!0,get:function(){return this.Hn}, set:function(a){this.Hn!==a&&(A(a,"number",Ir,"epsilonDistance"),0u&&0u&&0a[this.qd]&&(this.Wr=a[c]-1,this.qd=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Uj===l.Uj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;xn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>x)&&h++,qn||u===n&&x>m)&&h++);f[g*e+g]=h;for(k=g+1;k=c)for(h=d[g].destinationEdgesArrayAccess,B=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)}hs(a,b,d);return f} function ps(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&&ps(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&&ps(a,k,c,d,e,f)}} function qs(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)qs(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)qs(a,b.value.fromVertex,c,d,e,f)}} Yr.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Qk){default:case rs: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!==ss(a);){for(e=ts(a);null!==e;)d[c]=e,c--,e.valid=!1,e=ts(a);for(e=us(a);null!==e;)d[b]=e,b++,e.valid=!1,e=us(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.zm(b),b.rev=!0);break;case Zr:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.cm=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Fo=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& vs(this,b);for(d.reset();d.next();)b=d.value,-1===b.cm&&vs(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.cmd){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&&ps(a,h,0,-1,!0,!1)}for(ps(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 fs(a,b,c){return 90===a.M?c&&!b.rev||!c&&b.rev?270:90:180===a.M?c&&!b.rev||!c&&b.rev?0:180:270===a.M?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} Yr.prototype.initializeIndices=function(){switch(this.hl){default:case Cs:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.hc[c];this.hc[c]++}break;case as:a=this.network.vertexes.iterator;for(b=this.Ba;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Ds(this,c);break;case Es:for(a=this.network.vertexes.iterator,b=0;b<=this.Ba;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Fs(this,c)}}; function Ds(a,b){var c=b.layer;b.index=a.hc[c];a.hc[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=Hs(this,d,-1)||f;e=this.countCrossings();e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Hs(this,d,1)||f;e=this.countCrossings();e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Hs(this,d,1)||f;e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Hs(this,d,-1)||f;e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Hs(this,d,0)||f;e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Hs(this,d,0)||f;e>=a?ks(this,b):(a=e,b=js(this))}break;default:case bs:for(c=this.Ba,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Hs(this,d,-1)||f;e=this.countCrossings();e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Hs(this,d,1)||f;e=this.countCrossings();e>=a?ks(this,b): (a=e,b=js(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Hs(this,d,1)||f;e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Hs(this,d,-1)||f;e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Hs(this,d,0)||f;e>=a?ks(this,b):(a=e,b=js(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Hs(this,d,0)||f;e>=a?ks(this,b):(a=e,b=js(this))}}ks(this,b)}; function Gs(a,b,c){F&&(C(b,Yr,"medianBarycenterCrossingReduction:unfixedLayer"),C(c,Yr,"medianBarycenterCrossingReduction:direction"));var d=gs(a,b),e=a.hc[b],f=os(a,b,c),g=ns(a,b,c);for(c=0;cf+1&&(p+=4*(z-f),r+=4*(z-(f+1)))}D=d[f].destinationEdges.iterator;for(D.reset();D.next();)if(z=D.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f+1&&(r+=1)}D=d[f+1].sourceEdges.iterator;for(D.reset();D.next();)if(z=D.value,B=z.fromVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;zf+1&&(p+=4*(z-(f+1)),r+=4*(z-f))}D=d[f+1].destinationEdges.iterator; for(D.reset();D.next();)if(z=D.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f&&(p+=1)}z=B=0;D=g[d[f].index];var G=h[d[f].index],O=g[d[f+1].index],Q=h[d[f+1].index];-1!==D&&(B+=Math.abs(D-q),z+=Math.abs(D-y));-1!==G&&(B+=Math.abs(G-q),z+=Math.abs(G-y));-1!==O&&(B+=Math.abs(O-u),z+=Math.abs(O-x));-1!==Q&&(B+=Math.abs(Q-u),z+=Math.abs(Q-x));if(r>1)+8*d;this.Ia*=8}if(0!==(this.eg&2))for(c=!0;c;){c=!1;for(b=this.qd+1;b<=this.Ba;b++)c=Ks(this,b,1)||c;for(b= this.qd-1;0<=b;b--)c=Ks(this,b,-1)||c;c=Ks(this,this.qd,0)||c}if(0!==(this.eg&4)){for(b=this.qd+1;b<=this.Ba;b++)Ls(this,b,1);for(b=this.qd-1;0<=b;b--)Ls(this,b,-1);Ls(this,this.qd,0)}a&&(Ms(this,-1),Ms(this,1));if(0!==(this.eg&2))for(c=!0;c;){c=!1;c=Ks(this,this.qd,0)||c;for(b=this.qd+1;b<=this.Ba;b++)c=Ks(this,b,0)||c;for(b=this.qd-1;0<=b;b--)c=Ks(this,b,0)||c}}; function Ks(a,b,c){F&&(C(b,Yr,"bendStraighten:unfixedLayer"),C(c,Yr,"bendStraighten:direction"));for(var d=!1;Ns(a,b,c);)d=!0;return d} function Ns(a,b,c){F&&(C(b,Yr,"shiftbendStraighten:unfixedLayer"),C(c,Yr,"shiftbendStraighten:direction"));var d,e=gs(a,b),f=a.hc[b],g=ns(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 x=e[d].sourceEdges.iterator;x.next();){var y=x.value;var z=y.fromVertex;if(y.valid&&z.layer!==b){var B=is(y);var D=y.portFromColOffset;y=y.portToColOffset;z=z.column;p+=(Math.abs(m+y-(z+D))+1)*B;q+=(Math.abs(r+y-(z+D))+1)*B;u+=(Math.abs(n+y-(z+D))+1)*B}}if(0<=c)for(x=e[d].destinationEdges.iterator;x.next();)y=x.value,z=y.toVertex,y.valid&&z.layer!==b&&(B=is(y),D=y.portFromColOffset,y=y.portToColOffset,z=z.column,p+=(Math.abs(m+D-(z+y))+1)*B,q+=(Math.abs(r+D-(z+y))+1)*B,u+=(Math.abs(n+ D-(z+y))+1)*B);y=D=B=0;x=g[e[d].index];z=h[e[d].index];-1!==x&&(B+=Math.abs(x-m),D+=Math.abs(x-r),y+=Math.abs(x-n));-1!==z&&(B+=Math.abs(z-m),D+=Math.abs(z-r),y+=Math.abs(z-n));if(q=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}hs(a,b, d);a.normalize()}function Os(a,b){F&&(C(b,Yr,"packAux:column"),C(1,Yr,"packAux:direction"));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 Ps(a,b){F&&(C(b,Yr,"tightPackAux:column"),C(1,Yr,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Ba;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.Ba;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 Ms(a,b){F&&C(b,Yr,"componentPack:direction");for(var c=0;c<=a.Ia;c++)for(;Os(a,c););a.normalize();for(c=0;cf?ks(a,e):gb)for(c=a.Ia;0<=c;c--)for(e=js(a),f=ms(a),d=f+1;ff?ks(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Nd);a.Nd++;for(d.reset();d.next();)b=d.value,-1===b.component&&(qs(a,b,a.Nd,-1,!0,!0),a.Nd++);var f;b=[];for(f=0;fc)for(g=a.Ia;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} Yr.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=es(this,!0),b=es(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.Uu();this.isRouting&&this.commitLinks()};function es(a,b){return 270===a.M?b?pd:xd:90===a.M?b?xd:pd:180===a.M?b?qd:rd:b?rd:qd} Yr.prototype.commitNodes=function(){this.Jd=[];this.od=[];this.nd=[];this.La=[];for(var a=0;a<=this.Ba;a++)this.Jd[a]=0,this.od[a]=0,this.nd[a]=0,this.La[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.Jd[c]=Math.max(this.Jd[c],this.nodeMinLayerSpace(b,!0));this.od[c]=Math.max(this.od[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.ne;for(var d=0;d<=this.Ba;d++){var e=c;0>=this.Jd[d]+this.od[d]&&(e=0);0=n.bounds.bottom? (n=n.bounds.y+n.bounds.height,b.m(q++,B,n+G),b.m(q++,B,n),b.m(q++,B,n-z)):(b.m(q++,B,D+G),b.m(q++,B,D),b.m(q++,B,D-z)):270===this.M?D<=n.bounds.y?(n=n.bounds.y,b.m(q++,B,n-z),b.m(q++,B,n),b.m(q++,B,n+G)):(b.m(q++,B,D-z),b.m(q++,B,D),b.m(q++,B,D+G)):0===this.M&&(B>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(q++,n+G,D),b.m(q++,n,D),b.m(q++,n-z,D)):(b.m(q++,B+G,D),b.m(q++,B,D),b.m(q++,B-z,D)));else{b.m(q++,x,y);var O=0;if(180===this.M||0===this.M){if(180===this.M?B>=n.bounds.right:B<=n.bounds.x)O= (0===this.M?-z:G)/2;b.m(q++,x+O,D)}else{if(270===this.M?D>=n.bounds.bottom:D<=n.bounds.y)O=(90===this.M?-z:G)/2;b.m(q++,B,y+O)}b.m(q++,B,D)}}else z=Math.max(10,this.Jd[u.layer]),G=Math.max(10,this.od[u.layer]),180===this.M?(r&&b.m(q++,B-z,D),b.m(q++,B,D),r&&b.m(q++,B+G,D)):90===this.M?(r&&b.m(q++,B,D+G),b.m(q++,B,D),r&&b.m(q++,B,D-z)):270===this.M?(r&&b.m(q++,B,D-z),b.m(q++,B,D),r&&b.m(q++,B,D+G)):(r&&b.m(q++,B+G,D),b.m(q++,B,D),r&&b.m(q++,B-z,D))}n=u}if(null===h||l!==Ic||p)if(x=b.i(q-1).x,y=b.i(q- 1).y,B=b.i(q).x,D=b.i(q).y,p)n=this.od[m.layer],180===this.M||0===this.M?(p=y,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.M?B>=m.bounds.x:B<=m.bounds.right)&&(n=m.centerX+(180===this.M?-n:n),p=m.bounds.x&&p<=m.bounds.right&&(270===this.M?D>=m.bounds.y:D<=m.bounds.bottom)&&(n=m.centerY+(270===this.M?-n:n),p=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.N(q-2,n,y),b.N(q-1,n+G,y)):90===this.M&&D<=m.bounds.bottom?(n=m.bounds.y,b.N(q-2,x,n),b.N(q-1,x,n-z)):270===this.M&&D>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.N(q-2,x,n),b.N(q-1,x,n+G)):0===this.M&&B<=m.bounds.right&&(n=m.bounds.x,b.N(q-2,n,y),b.N(q-1,n-z,y));else{z=Math.max(10,this.Jd[m.layer]);G=Math.max(10, this.od[m.layer]);p=0;if(180===this.M||0===this.M){if(180===this.M?B<=m.bounds.x:B>=m.bounds.right)p=(0===this.M?G:-z)/2;b.m(q++,B+p,y)}else{if(270===this.M?D<=m.bounds.y:D>=m.bounds.bottom)p=(90===this.M?G:-z)/2;b.m(q++,x,D+p)}b.m(q++,B,D)}}else{for(;null!==m&&m!==n;){z=u=null;for(m=m.destinationEdges.iterator;m.next()&&(x=m.value,x.link!==c.link||(u=x.toVertex,z=x.fromVertex,null!==z.node&&(z=null),null!==u.node)););u!==n&&(x=b.i(q-1).x,y=b.i(q-1).y,B=u.centerX,D=u.centerY,p?180===this.M||0===this.M? (null!==z?z.centerY:y)!==D&&(z=this.La[u.layer]+this.Bf.x,q===b.firstPickIndex+1&&(z=0===this.M?Math.max(z,x):Math.min(z,x)),b.m(q++,z,y),b.m(q++,z,D)):(null!==z?z.centerX:x)!==B&&(z=this.La[u.layer]+this.Bf.y,q===b.firstPickIndex+1&&(z=90===this.M?Math.max(z,y):Math.min(z,y)),b.m(q++,x,z),b.m(q++,B,z)):(z=Math.max(10,this.Jd[u.layer]),G=Math.max(10,this.od[u.layer]),180===this.M?(b.m(q++,B+G,D),r&&b.m(q++,B,D),b.m(q++,B-z,D)):90===this.M?(b.m(q++,B,D-z),r&&b.m(q++,B,D),b.m(q++,B,D+G)):270===this.M? (b.m(q++,B,D+G),r&&b.m(q++,B,D),b.m(q++,B,D-z)):(b.m(q++,B-z,D),r&&b.m(q++,B,D),b.m(q++,B+G,D))));m=u}p&&(x=b.i(q-1).x,y=b.i(q-1).y,B=b.i(q).x,D=b.i(q).y,180===this.M||0===this.M?y!==D&&(z=0===this.M?Math.min(Math.max((B+x)/2,this.La[n.layer]+this.Bf.x),B):Math.max(Math.min((B+x)/2,this.La[n.layer]+this.Bf.x),B),b.m(q++,z,y),b.m(q++,z,D)):x!==B&&(z=90===this.M?Math.min(Math.max((D+y)/2,this.La[n.layer]+this.Bf.y),D):Math.max(Math.min((D+y)/2,this.La[n.layer]+this.Bf.y),D),b.m(q++,x,z),b.m(q++,B,z)))}null!== d&&r&&(null!==g&&(l===Ic&&(l=b.i(0),d=b.i(2),l.A(d)||b.N(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,Ic,!0,!1,f,h),l.o()||l.set(e.actualBounds.center),b.N(0,l.x,l.y)),null!==h&&(k===Ic&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.A(l)||b.N(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,Ic,!1,!1,e,g),e.o()||e.set(f.actualBounds.center),b.N(b.pointsCount-1,e.x,e.y)));b.pf();c.commit()}}}this.avoidOrthogonalOverlaps()}; Yr.prototype.avoidOrthogonalOverlaps=function(){for(var a=new H,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.Vcb.Vc?1:a.ucb.uc?1:0:0};t.Jx=function(a,b){return a instanceof Rs&&b instanceof Rs&&a!==b?a.firstb.first||a.lb.l||a.Vcb.Vc?1:a.ucb.uc?1:0:0}; t.yt=function(a,b){return a instanceof Rs&&b instanceof Rs&&a!==b?a.Ubb.Ub||a.lb.l||a.Vcb.Vc?1:a.ucb.uc?1:0:0};t.B=function(a,b){F&&(C(a,Yr,"isApprox:a"),C(b,Yr,"isApprox:b"));a-=b;return-1a}; t.$i=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&v("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.te.length){var d=[];for(var e=0;ea&&(this.eg=a,this.C()))}},setsPortSpots:{configurable:!0,get:function(){return this.bf},set:function(a){this.bf!==a&&(A(a,"boolean",Yr,"setsPortSpots"),this.bf=a,this.C())}},linkSpacing:{configurable:!0,get:function(){return this.lo},set:function(a){this.lo!==a&&(A(a,"number",Yr,"linkSpacing"),0<=a&&(this.lo=a,this.C()))}},maxLayer:{configurable:!0, get:function(){return this.Ba}},maxIndex:{configurable:!0,get:function(){return this.Wr}},maxColumn:{configurable:!0,get:function(){return this.Ia}},minIndexLayer:{configurable:!0,get:function(){return this.vo}},maxIndexLayer:{configurable:!0,get:function(){return this.qd}}}); var Zr=new E(Yr,"CycleDepthFirst",0),rs=new E(Yr,"CycleGreedy",1),ds=new E(Yr,"CycleFromLayers",2),$r=new E(Yr,"LayerOptimalLinkLength",0),ws=new E(Yr,"LayerLongestPathSink",1),ys=new E(Yr,"LayerLongestPathSource",2),as=new E(Yr,"InitDepthFirstOut",0),Es=new E(Yr,"InitDepthFirstIn",1),Cs=new E(Yr,"InitNaive",2),Is=new E(Yr,"AggressiveNone",0),bs=new E(Yr,"AggressiveLess",1),Js=new E(Yr,"AggressiveMore",2);Yr.className="LayeredDigraphLayout";Yr.CycleDepthFirst=Zr;Yr.CycleGreedy=rs; Yr.CycleFromLayers=ds;Yr.LayerOptimalLinkLength=$r;Yr.LayerLongestPathSink=ws;Yr.LayerLongestPathSource=ys;Yr.InitDepthFirstOut=as;Yr.InitDepthFirstIn=Es;Yr.InitNaive=Cs;Yr.AggressiveNone=Is;Yr.AggressiveLess=bs;Yr.AggressiveMore=Js;Yr.PackNone=0;Yr.PackExpand=1;Yr.PackStraighten=2;Yr.PackMedian=4;Yr.PackAll=7;function Rs(){this.index=this.uc=this.Vc=this.Ub=this.first=this.layer=0;this.link=null;this.l=0}Rs.className="SegInfo";function cs(a){Qp.call(this,a)}la(cs,Qp);cs.prototype.createVertex=function(){return new Ts(this)}; cs.prototype.createEdge=function(){return new Us(this)};cs.className="LayeredDigraphNetwork";function Ts(a){Tp.call(this,a);this.Ua=this.Ig=this.ji=-1;this.L=NaN;this.ca=null;this.valid=!1;this.finish=this.cm=NaN;this.Uj=0;this.yv=this.zv=null}la(Ts,Tp); ma.Object.defineProperties(Ts.prototype,{layer:{configurable:!0,get:function(){return this.ji},set:function(a){this.ji!==a&&(A(a,"number",Ts,"layer"),this.ji=a)}},column:{configurable:!0,get:function(){return this.Ig},set:function(a){this.Ig!==a&&(A(a,"number",Ts,"column"),this.Ig=a)}},index:{configurable:!0,get:function(){return this.Ua},set:function(a){this.Ua!==a&&(A(a,"number",Ts,"index"),this.Ua=a)}},component:{configurable:!0,get:function(){return this.L}, set:function(a){this.L!==a&&(A(a,"number",Ts,"component"),this.L=a)}},near:{configurable:!0,get:function(){return this.ca},set:function(a){this.ca!==a&&(F&&null!==a&&w(a,Ts,Ts,"near"),this.ca=a)}}});Ts.className="LayeredDigraphVertex";function Us(a){Up.call(this,a);this.l=this.Na=this.Wb=!1;this.Ma=this.L=NaN;this.ca=this.w=0}la(Us,Up); ma.Object.defineProperties(Us.prototype,{valid:{configurable:!0,get:function(){return this.Wb},set:function(a){this.Wb!==a&&(A(a,"boolean",Us,"valid"),this.Wb=a)}},rev:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na!==a&&(A(a,"boolean",Us,"rev"),this.Na=a)}},forest:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(A(a,"boolean",Us,"forest"),this.l=a)}},portFromPos:{configurable:!0,get:function(){return this.L}, set:function(a){this.L!==a&&(A(a,"number",Us,"portFromPos"),this.L=a)}},portToPos:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma!==a&&(A(a,"number",Us,"portToPos"),this.Ma=a)}},portFromColOffset:{configurable:!0,get:function(){return this.w},set:function(a){this.w!==a&&(A(a,"number",Us,"portFromColOffset"),this.w=a)}},portToColOffset:{configurable:!0,get:function(){return this.ca},set:function(a){this.ca!==a&&(A(a,"number",Us,"portToColOffset"), this.ca=a)}}});Us.className="LayeredDigraphEdge";function Y(){0b.level)return!1;a.removeChild(c.parent,c)}return!0} Y.prototype.removeChild=function(a,b){if(null!==a&&null!==b){F&&w(a,at,Y,"removeChild:p");F&&w(b,at,Y,"removeChild:c");for(var c=a.children,d=0,e=0;ee?Nt(a,g,U,y,z):Ot(a,g,U,y,z);U=z.x;y=z.width;z=z.height;break;case xt:for(D=0;Dn&&(RZa&&(Tt(a,-Za,0,Ca,Va-1),Ut(D,-Za,0),Ut(G,-Za,0),Za=0)}Ya.U.h(Za,da);y=Math.max(y,O);z=Math.max(z,B+(0===Z?0:q)+ub.height);R=O}else{0n&&(daZa&&(Tt(a,0,-Za,Ca,Va-1),Ut(D,0,-Za),Ut(G,0,-Za),Za=0);Ya.U.h(R,Za);z=Math.max(z,Q);y=Math.max(y,B+(0===Z?0:q)+ub.width);da=Q}sa++}0l&&(l=0),135u&&(u=0),k===yt&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>y&&(y=Zt(k,d-y,0),g=y.x,h=y.y,y=d,l=0):y=Xt(a,y,l),0>l&&(g-=l,l=0),135z&&(z=Zt(k,0,x-z),g=z.x,h=z.y,z=x,u=0):z=Yt(a,z,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])),Z[0].h(l+d,0),Z[1].h(Z[0].x,x),Z[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])),Z[0].h(0,u+x),Z[1].h(d,Z[0].y),Z[2].xd?Nt(b,e,sa,B,D):Ot(b,e,sa,B,D);sa=D.x;B=D.width;D=D.height;break;case xt:for(a=0;ap&&(Op&&(Qn&&(n=0),135y&&(y=0));b.ka.h(n,y);b.xa.h(B,D)}} function Nt(a,b,c,d,e){F&&w(a,at,Y,"layoutBusChildrenPosDir:v");var f=b.length;if(0===f)return new L(c,0,d,e);if(1===f)return a=b[0],d=a.xa.width,e=a.xa.height,new L(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===Et(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.U.x&&(c=cu(a,b.U.x,!1,c,g))):(b.U.h(d+h,c+g/2-b.focus.y-b.ka.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.ka.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.U.y&&(c=cu(a,b.U.y,!0,c,g))));return new L(c,0,d,e)} function Ot(a,b,c,d,e){F&&w(a,at,Y,"layoutBusChildrenNegDir:v");var f=b.length;if(0===f)return new L(c,0,d,e);if(1===f)return b=b[0],d=b.xa.width,e=b.xa.height,new L(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===Et(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.U.x&&(c=cu(a,h.U.x,!1,c,g))):(h.U.h(-d-l.width-q,c+g/2-h.focus.y-h.ka.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.ka.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.U.y&&(c=cu(a,h.U.y,!0,c,g))));for(a=0;ab&&(b=c+a.width),0>c&&(b-=c),b;case Ft:return a.width>b?a.width:b;case Gt:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case wt:case mt:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case xt:return a.width-a.focus.x+a.nodeSpacing/2+b;case yt:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function Yt(a,b,c){F&&w(a,at,Y,"calculateSubheight:v");switch(a.alignment){case Wt:case Vt:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Ft:return a.height>b?a.height:b;case Gt:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case wt:case mt:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case xt:return a.height-a.focus.y+a.nodeSpacing/2+b;case yt:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function Zt(a,b,c){F&&w(a,E,Y,"alignOffset:align");switch(a){case Vt:b/=2;c/=2;break;case Wt:b/=2;c/=2;break;case Ft:c=b=0;break;case Gt:break;default:v("Unhandled alignment value "+a.toString())}return new J(b,c)}function Qt(a,b,c,d,e,f){F&&w(a,at,Y,"shiftRelPosAlign:v");F&&w(b,E,Y,"shiftRelPosAlign:align");b=Zt(b,c,d);Tt(a,b.x,b.y,e,f)}function Tt(a,b,c,d,e){F&&w(a,at,Y,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].U;f.x+=b;f.y+=c}} function Rt(a,b,c,d){F&&(w(b,at,Y,"recordMidPoints:v"),A(c,"number",Y,"recordMidPoints:x"),A(d,"number",Y,"recordMidPoints:y"));var e=b.parent;switch(a.ad){case Ws:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case ct:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.ad.toString())}}function Ut(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=Pt(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Pt(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Pt(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x, k.y);f=Pt(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=Pt(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Pt(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Pt(a,n.length+f.length); for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Pt(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Ht(a){F&&w(a,at,Y,"computeLayerSpacing:v");var b=Et(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.V.nodeIndentPastParent=a,this.C()))}},nodeSpacing:{configurable:!0,get:function(){return this.V.nodeSpacing},set:function(a){this.V.nodeSpacing!==a&&(A(a,"number",Y,"nodeSpacing"),this.V.nodeSpacing=a,this.C())}},layerSpacing:{configurable:!0,get:function(){return this.V.layerSpacing},set:function(a){this.V.layerSpacing!==a&&(A(a,"number",Y,"layerSpacing"),this.V.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{configurable:!0, enumerable:!0,get:function(){return this.V.layerSpacingParentOverlap},set:function(a){this.V.layerSpacingParentOverlap!==a&&(A(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.V.layerSpacingParentOverlap=a,this.C()))}},compaction:{configurable:!0,get:function(){return this.V.compaction},set:function(a){this.V.compaction!==a&&(hb(a,Y,Y,"compaction"),a===Bt||a===Dt)&&(this.V.compaction=a,this.C())}},breadthLimit:{configurable:!0,get:function(){return this.V.breadthLimit}, set:function(a){this.V.breadthLimit!==a&&(A(a,"number",Y,"breadthLimit"),0<=a&&(this.V.breadthLimit=a,this.C()))}},rowSpacing:{configurable:!0,get:function(){return this.V.rowSpacing},set:function(a){this.V.rowSpacing!==a&&(A(a,"number",Y,"rowSpacing"),this.V.rowSpacing=a,this.C())}},rowIndent:{configurable:!0,get:function(){return this.V.rowIndent},set:function(a){this.V.rowIndent!==a&&(A(a,"number",Y,"rowIndent"),0<=a&&(this.V.rowIndent=a,this.C()))}},commentSpacing:{configurable:!0, enumerable:!0,get:function(){return this.V.commentSpacing},set:function(a){this.V.commentSpacing!==a&&(A(a,"number",Y,"commentSpacing"),this.V.commentSpacing=a,this.C())}},commentMargin:{configurable:!0,get:function(){return this.V.commentMargin},set:function(a){this.V.commentMargin!==a&&(A(a,"number",Y,"commentMargin"),this.V.commentMargin=a,this.C())}},setsPortSpot:{configurable:!0,get:function(){return this.V.setsPortSpot},set:function(a){this.V.setsPortSpot!==a&&(A(a, "boolean",Y,"setsPortSpot"),this.V.setsPortSpot=a,this.C())}},portSpot:{configurable:!0,get:function(){return this.V.portSpot},set:function(a){w(a,M,Y,"portSpot");this.V.portSpot.A(a)||(this.V.portSpot=a,this.C())}},setsChildPortSpot:{configurable:!0,get:function(){return this.V.setsChildPortSpot},set:function(a){this.V.setsChildPortSpot!==a&&(A(a,"boolean",Y,"setsChildPortSpot"),this.V.setsChildPortSpot=a,this.C())}},childPortSpot:{configurable:!0,get:function(){return this.V.childPortSpot}, set:function(a){w(a,M,Y,"childPortSpot");this.V.childPortSpot.A(a)||(this.V.childPortSpot=a,this.C())}},alternateSorting:{configurable:!0,get:function(){return this.W.sorting},set:function(a){this.W.sorting!==a&&(hb(a,Y,Y,"alternateSorting"),a===rt||a===st||a===tt||ut)&&(this.W.sorting=a,this.C())}},alternateComparer:{configurable:!0,get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(A(a,"function",Y,"alternateComparer"),this.W.comparer=a,this.C())}}, alternateAngle:{configurable:!0,get:function(){return this.W.angle},set:function(a){this.W.angle!==a&&(A(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.W.angle=a,this.C())}},alternateAlignment:{configurable:!0,get:function(){return this.W.alignment},set:function(a){this.W.alignment!==a&&(hb(a,Y,Y,"alternateAlignment"),this.W.alignment=a,this.C())}},alternateNodeIndent:{configurable:!0,get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!== a&&(A(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.W.nodeIndent=a,this.C()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&(A(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.C()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(A(a,"number",Y,"alternateNodeSpacing"), this.W.nodeSpacing=a,this.C())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(A(a,"number",Y,"alternateLayerSpacing"),this.W.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&(A(a,"number",Y,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.W.layerSpacingParentOverlap= a,this.C()))}},alternateCompaction:{configurable:!0,get:function(){return this.W.compaction},set:function(a){this.W.compaction!==a&&(hb(a,Y,Y,"alternateCompaction"),a===Bt||a===Dt)&&(this.W.compaction=a,this.C())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&(A(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.W.breadthLimit=a,this.C()))}},alternateRowSpacing:{configurable:!0,get:function(){return this.W.rowSpacing}, set:function(a){this.W.rowSpacing!==a&&(A(a,"number",Y,"alternateRowSpacing"),this.W.rowSpacing=a,this.C())}},alternateRowIndent:{configurable:!0,get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&(A(a,"number",Y,"alternateRowIndent"),0<=a&&(this.W.rowIndent=a,this.C()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(A(a,"number",Y,"alternateCommentSpacing"), this.W.commentSpacing=a,this.C())}},alternateCommentMargin:{configurable:!0,get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(A(a,"number",Y,"alternateCommentMargin"),this.W.commentMargin=a,this.C())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(A(a,"boolean",Y,"alternateSetsPortSpot"),this.W.setsPortSpot=a,this.C())}},alternatePortSpot:{configurable:!0, enumerable:!0,get:function(){return this.W.portSpot},set:function(a){w(a,M,Y,"alternatePortSpot");this.W.portSpot.A(a)||(this.W.portSpot=a,this.C())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(A(a,"boolean",Y,"alternateSetsChildPortSpot"),this.W.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{configurable:!0,get:function(){return this.W.childPortSpot},set:function(a){w(a, M,Y,"alternateChildPortSpot");this.W.childPortSpot.A(a)||(this.W.childPortSpot=a,this.C())}}}); var Vs=new E(Y,"PathDefault",-1),Ws=new E(Y,"PathDestination",0),ct=new E(Y,"PathSource",1),rt=new E(Y,"SortingForwards",10),st=new E(Y,"SortingReverse",11),tt=new E(Y,"SortingAscending",12),ut=new E(Y,"SortingDescending",13),Vt=new E(Y,"AlignmentCenterSubtrees",20),Wt=new E(Y,"AlignmentCenterChildren",21),Ft=new E(Y,"AlignmentStart",22),Gt=new E(Y,"AlignmentEnd",23),wt=new E(Y,"AlignmentBus",24),mt=new E(Y,"AlignmentBusBranching",25),xt=new E(Y,"AlignmentTopLeftBus",26),yt=new E(Y,"AlignmentBottomRightBus", 27),Bt=new E(Y,"CompactionNone",30),Dt=new E(Y,"CompactionBlock",31),Xs=new E(Y,"StyleLayered",40),qt=new E(Y,"StyleLastParents",41),pt=new E(Y,"StyleAlternating",42),ot=new E(Y,"StyleRootOnly",43),Zs=new E(Y,"ArrangementVertical",50),eu=new E(Y,"ArrangementHorizontal",51),bt=new E(Y,"ArrangementFixedRoots",52),Ys=new E(Y,"LayerIndividual",60),kt=new E(Y,"LayerSiblings",61),jt=new E(Y,"LayerUniform",62);Y.className="TreeLayout";Y.PathDefault=Vs;Y.PathDestination=Ws;Y.PathSource=ct; Y.SortingForwards=rt;Y.SortingReverse=st;Y.SortingAscending=tt;Y.SortingDescending=ut;Y.AlignmentCenterSubtrees=Vt;Y.AlignmentCenterChildren=Wt;Y.AlignmentStart=Ft;Y.AlignmentEnd=Gt;Y.AlignmentBus=wt;Y.AlignmentBusBranching=mt;Y.AlignmentTopLeftBus=xt;Y.AlignmentBottomRightBus=yt;Y.CompactionNone=Bt;Y.CompactionBlock=Dt;Y.StyleLayered=Xs;Y.StyleLastParents=qt;Y.StyleAlternating=pt;Y.StyleRootOnly=ot;Y.ArrangementVertical=Zs;Y.ArrangementHorizontal=eu;Y.ArrangementFixedRoots=bt;Y.LayerIndividual=Ys; Y.LayerSiblings=kt;Y.LayerUniform=jt;function $s(a){Qp.call(this,a)}la($s,Qp);$s.prototype.createVertex=function(){return new at(this)};$s.prototype.createEdge=function(){return new gu(this)};$s.className="TreeNetwork"; function at(a){Tp.call(this,a);this.Ma=!1;this.Nc=null;this.L=[];this.Xb=this.Wb=this.ca=this.Na=0;this.Zc=null;this.U=new J(0,0);this.xa=new Ib(0,0);this.ka=new J(0,0);this.Bm=this.Am=this.bA=!1;this.zq=this.nq=null;this.Tc=rt;this.Pc=Zp;this.Bc=0;this.xb=Wt;this.fs=this.es=0;this.hs=20;this.ne=50;this.Tr=0;this.br=Dt;this.Vq=0;this.ts=25;this.ar=this.ss=10;this.$q=20;this.Cs=!0;this.ps=kd;this.Bs=!0;this.Yq=kd}la(at,Tp); at.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.Tc=a.sorting,this.Pc=a.comparer,this.Bc=a.angle,this.xb=a.alignment,this.es=a.nodeIndent,this.fs=a.nodeIndentPastParent,this.hs=a.nodeSpacing,this.ne=a.layerSpacing,this.Tr=a.layerSpacingParentOverlap,this.br=a.compaction,this.Vq=a.breadthLimit,this.ts=a.rowSpacing,this.ss=a.rowIndent,this.ar=a.commentSpacing,this.$q=a.commentMargin,this.Cs=a.setsPortSpot,this.ps=a.portSpot,this.Bs=a.setsChildPortSpot,this.Yq=a.childPortSpot)}; ma.Object.defineProperties(at.prototype,{initialized:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma!==a&&(A(a,"boolean",at,"initialized"),this.Ma=a)}},parent:{configurable:!0,get:function(){return this.Nc},set:function(a){this.Nc!==a&&(F&&null!==a&&w(a,at,at,"parent"),this.Nc=a)}},children:{configurable:!0,get:function(){return this.L},set:function(a){if(this.L!==a){null===a||Array.isArray(a)||xa(a,"Array",at,"children:value");if(null!== a)for(var b=a.length,c=0;cp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Mt(c))))):c.alignment===Ft?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Mt(c))))):c.alignment===Ft?(e=d.left+b.x,0===b.x&&m.xp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Mt(c))))):c.alignment===Ft?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Mt(c))))):c.alignment===Ft?(e=d.left+b.x,0===b.x&&m.x