/* * GoJS v2.1.26 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. * Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.26/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function aa(a){var b=0;return function(){return bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c=a.length?a.push(c):a.splice(b,0,c):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=Na.pop();return void 0===a?[]:a}function Oa(a){a.length=0;Na.push(a)} function wa(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""}function Pa(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 Pa(a.constructor);return typeof a} function Qa(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 Ra(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.gB;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Sa(a,b,c){Object.defineProperty(Ua.prototype,a,{get:b,set:c})}function Wa(){var a=Xa;if(0===a.length)for(var b=qa.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.mf;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.Ld();return!1};ob.prototype.ld=function(){return this.next()}; ob.prototype.first=function(){var a=this.ub;this.oa=a.v;var b=a.j;this.Ua=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};ob.prototype.any=function(a){var b=this.ub;b.lh=null;var c=b.v,d=b.j,e=d.length;this.Ua=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.v!==c&&Aa(b)}return!1};ob.prototype.all=function(a){var b=this.ub;b.lh=null;var c=b.v,d=b.j,e=d.length;this.Ua=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.v!==c&&Aa(b)}return!0}; ob.prototype.each=function(a){var b=this.ub;b.lh=null;var c=b.v,d=b.j,e=d.length;this.Ua=e;for(--e;0<=e;e--)a(d[e]),b.v!==c&&Aa(b);return this};ob.prototype.map=function(a){var b=this.ub;b.lh=null;var c=b.v,d=[],e=b.j,f=e.length;this.Ua=f;for(--f;0<=f;f--)d.push(a(e[f])),b.v!==c&&Aa(b);a=new H;a.j=d;a.qb();return a.iterator}; ob.prototype.filter=function(a){var b=this.ub;b.lh=null;var c=b.v,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.v!==c&&Aa(b)}a=new H;a.j=d;a.qb();return a.iterator};ob.prototype.Ld=function(){this.key=-1;this.value=null;this.oa=-1;this.ub.lh=this};ob.prototype.toString=function(){return"ListIteratorBackwards("+this.Ua+"/"+this.ub.count+")"}; ma.Object.defineProperties(ob.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ub.j.length}}});ob.prototype.first=ob.prototype.first;ob.prototype.hasNext=ob.prototype.ld;ob.prototype.next=ob.prototype.next;ob.prototype.reset=ob.prototype.reset;ob.className="ListIteratorBackwards"; function H(a){fb(this);this.s=!1;this.j=[];this.v=0;this.lh=this.La=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ea():this.addAll(a))}t=H.prototype;t.qb=function(){var a=this.v;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.od=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.s&&va(this,a);c[a]=b};t.set=function(a,b){this.od(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.cc=function(){var a=this.j,b=a.length;return 0a&&ya(a,">= 0",H,"insertAt:i");this.s&&va(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.qb()}; t.remove=function(a){if(null===a)return!1;this.s&&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.qb();return!0};t.delete=function(a){return this.remove(a)};t.hb=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.s&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.qb()}; 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.s&&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 lb;var a=this.La;return null!==a?(a.reset(),a):new nb(this)}},iteratorBackwards:{configurable:!0, enumerable:!0,get:function(){if(0>=this.j.length)return lb;var a=this.lh;return null!==a?(a.reset(),a):new ob(this)}}});H.prototype.reverse=H.prototype.reverse;H.prototype.sortRange=H.prototype.tj;H.prototype.sort=H.prototype.sort;H.prototype.toSet=H.prototype.Nw;H.prototype.toArray=H.prototype.ua;H.prototype.removeRange=H.prototype.removeRange;H.prototype.removeAt=H.prototype.hb;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.insertAt=H.prototype.zb; H.prototype.pop=H.prototype.pop;H.prototype.last=H.prototype.cc;H.prototype.first=H.prototype.first;H.prototype.set=H.prototype.set;H.prototype.setElt=H.prototype.od;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.ka; H.prototype.freeze=H.prototype.freeze;H.className="List";function tb(a){this.Ag=a;a.La=null;this.oa=a.v;this.ra=null}tb.prototype.reset=function(){var a=this.Ag;a.La=null;this.oa=a.v;this.ra=null};tb.prototype.next=function(){var a=this.Ag;if(a.v!==this.oa){if(null===this.key)return!1;Aa(a)}var b=this.ra;b=null===b?a.ga:b.va;if(null!==b)return this.ra=b,this.value=b.value,this.key=b.key,!0;this.Ld();return!1};tb.prototype.ld=function(){return this.next()}; tb.prototype.first=function(){var a=this.Ag;this.oa=a.v;a=a.ga;if(null!==a){this.ra=a;var b=a.value;this.key=a.key;return this.value=b}return null};tb.prototype.any=function(a){var b=this.Ag;b.La=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(a(d.value))return!0;b.v!==c&&Aa(b);d=d.va}return!1};tb.prototype.all=function(a){var b=this.Ag;b.La=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(!a(d.value))return!1;b.v!==c&&Aa(b);d=d.va}return!0}; tb.prototype.each=function(a){var b=this.Ag;b.La=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;)a(d.value),b.v!==c&&Aa(b),d=d.va;return this};tb.prototype.map=function(a){var b=this.Ag;b.La=null;for(var c=new H,d=b.v,e=b.ga;null!==e;)c.add(a(e.value)),b.v!==d&&Aa(b),e=e.va;return c.iterator};tb.prototype.filter=function(a){var b=this.Ag;b.La=null;for(var c=new H,d=b.v,e=b.ga;null!==e;){var f=e.value;a(f)&&c.add(f);b.v!==d&&Aa(b);e=e.va}return c.iterator}; tb.prototype.Ld=function(){this.value=this.key=null;this.oa=-1;this.Ag.La=this};tb.prototype.toString=function(){return null!==this.ra?"SetIterator@"+this.ra.value:"SetIterator"};ma.Object.defineProperties(tb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.Ag.Kb}}});tb.prototype.first=tb.prototype.first;tb.prototype.hasNext=tb.prototype.ld;tb.prototype.next=tb.prototype.next;tb.prototype.reset=tb.prototype.reset; tb.className="SetIterator";function I(a){fb(this);this.s=!1;this.Mb={};this.Kb=0;this.La=null;this.v=0;this.ff=this.ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ea():this.addAll(a))}t=I.prototype;t.qb=function(){var a=this.v;a++;999999999=this.Kb)return lb;var a=this.La;return null!==a?(a.reset(),a):new tb(this)}}});I.prototype.toList=I.prototype.Mw;I.prototype.toArray=I.prototype.ua;I.prototype.clear=I.prototype.clear;I.prototype.retainAll=I.prototype.SA;I.prototype.removeAll=I.prototype.cr; I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.first=I.prototype.first;I.prototype.containsAny=I.prototype.zz;I.prototype.containsAll=I.prototype.yz;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.ka;I.prototype.freeze=I.prototype.freeze;var wb=1;I.className="Set";I.uniqueHash=fb;I.hashIdUnique=ub;I.hashId=sb; function zb(a){this.la=a;this.oa=a.v;this.ra=null}zb.prototype.reset=function(){this.oa=this.la.v;this.ra=null};zb.prototype.next=function(){var a=this.la;if(a.v!==this.oa){if(null===this.key)return!1;Aa(a)}var b=this.ra;b=null===b?a.ga:b.va;if(null!==b)return this.ra=b,this.value=this.key=a=b.key,!0;this.Ld();return!1};zb.prototype.ld=function(){return this.next()};zb.prototype.first=function(){var a=this.la;this.oa=a.v;a=a.ga;return null!==a?(this.ra=a,this.value=this.key=a=a.key):null}; zb.prototype.any=function(a){var b=this.la,c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(a(d.key))return!0;b.v!==c&&Aa(b);d=d.va}return!1};zb.prototype.all=function(a){var b=this.la,c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(!a(d.key))return!1;b.v!==c&&Aa(b);d=d.va}return!0};zb.prototype.each=function(a){var b=this.la,c=b.v;this.ra=null;for(var d=b.ga;null!==d;)a(d.key),b.v!==c&&Aa(b),d=d.va;return this}; zb.prototype.map=function(a){var b=this.la,c=b.v;this.ra=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e.key)),b.v!==c&&Aa(b),e=e.va;return d.iterator};zb.prototype.filter=function(a){var b=this.la,c=b.v;this.ra=null;for(var d=new H,e=b.ga;null!==e;){var f=e.key;a(f)&&d.add(f);b.v!==c&&Aa(b);e=e.va}return d.iterator};zb.prototype.Ld=function(){this.value=this.key=null;this.oa=-1};zb.prototype.toString=function(){return null!==this.ra?"MapKeySetIterator@"+this.ra.value:"MapKeySetIterator"}; ma.Object.defineProperties(zb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.la.Kb}}});zb.prototype.first=zb.prototype.first;zb.prototype.hasNext=zb.prototype.ld;zb.prototype.next=zb.prototype.next;zb.prototype.reset=zb.prototype.reset;zb.className="MapKeySetIterator";function Ab(a){I.call(this);fb(this);this.s=!0;this.la=a}la(Ab,I);t=Ab.prototype;t.freeze=function(){return this};t.ka=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}; Ab.prototype.any=function(a){for(var b=this.la.ga;null!==b;){if(a(b.key))return!0;b=b.va}return!1};Ab.prototype.all=function(a){for(var b=this.la.ga;null!==b;){if(!a(b.key))return!1;b=b.va}return!0};Ab.prototype.each=function(a){for(var b=this.la.ga;null!==b;)a(b.key),b=b.va;return this};Ab.prototype.map=function(a){for(var b=new I,c=this.la.ga;null!==c;)b.add(a(c.key)),c=c.va;return b};Ab.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.va}return b}; Ab.prototype.copy=function(){return new Ab(this.la)};Ab.prototype.Nw=function(){var a=new I,b=this.la.Mb,c;for(c in b)a.add(b[c].key);return a};Ab.prototype.ua=function(){var a=this.la.Mb,b=Array(this.la.Kb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Ab.prototype.Mw=function(){var a=new H,b=this.la.Mb,c;for(c in b)a.add(b[c].key);return a}; ma.Object.defineProperties(Ab.prototype,{count:{configurable:!0,get:function(){return this.la.Kb}},size:{configurable:!0,get:function(){return this.la.Kb}},iterator:{configurable:!0,get:function(){return 0>=this.la.Kb?lb:new zb(this.la)}}});Ab.prototype.toList=Ab.prototype.Mw;Ab.prototype.toArray=Ab.prototype.ua;Ab.prototype.toSet=Ab.prototype.Nw;Ab.prototype.first=Ab.prototype.first;Ab.prototype.clear=Ab.prototype.clear;Ab.prototype["delete"]=Ab.prototype.delete; Ab.prototype.remove=Ab.prototype.remove;Ab.prototype.has=Ab.prototype.has;Ab.prototype.contains=Ab.prototype.contains;Ab.prototype.add=Ab.prototype.add;Ab.prototype.thaw=Ab.prototype.ka;Ab.prototype.freeze=Ab.prototype.freeze;Ab.className="MapKeySet";function Bb(a){this.la=a;a.ef=null;this.oa=a.v;this.ra=null}Bb.prototype.reset=function(){var a=this.la;a.ef=null;this.oa=a.v;this.ra=null}; Bb.prototype.next=function(){var a=this.la;if(a.v!==this.oa){if(null===this.key)return!1;Aa(a)}var b=this.ra;b=null===b?a.ga:b.va;if(null!==b)return this.ra=b,this.value=b.value,this.key=b.key,!0;this.Ld();return!1};Bb.prototype.ld=function(){return this.next()};Bb.prototype.first=function(){var a=this.la;this.oa=a.v;a=a.ga;if(null!==a){this.ra=a;var b=a.value;this.key=a.key;return this.value=b}return null}; Bb.prototype.any=function(a){var b=this.la;b.ef=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(a(d.value))return!0;b.v!==c&&Aa(b);d=d.va}return!1};Bb.prototype.all=function(a){var b=this.la;b.ef=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(!a(d.value))return!1;b.v!==c&&Aa(b);d=d.va}return!0};Bb.prototype.each=function(a){var b=this.la;b.ef=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;)a(d.value),b.v!==c&&Aa(b),d=d.va;return this}; Bb.prototype.map=function(a){var b=this.la;b.ef=null;var c=b.v;this.ra=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e.value)),b.v!==c&&Aa(b),e=e.va;return d.iterator};Bb.prototype.filter=function(a){var b=this.la;b.ef=null;var c=b.v;this.ra=null;for(var d=new H,e=b.ga;null!==e;){var f=e.value;a(f)&&d.add(f);b.v!==c&&Aa(b);e=e.va}return d.iterator};Bb.prototype.Ld=function(){this.value=this.key=null;this.oa=-1;this.la.ef=this}; Bb.prototype.toString=function(){return null!==this.ra?"MapValueSetIterator@"+this.ra.value:"MapValueSetIterator"};ma.Object.defineProperties(Bb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.la.Kb}}});Bb.prototype.first=Bb.prototype.first;Bb.prototype.hasNext=Bb.prototype.ld;Bb.prototype.next=Bb.prototype.next;Bb.prototype.reset=Bb.prototype.reset;Bb.className="MapValueSetIterator"; function vb(a,b){this.key=a;this.value=b;this.Sl=this.va=null}vb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};vb.className="KeyValuePair";function Cb(a){this.la=a;a.La=null;this.oa=a.v;this.ra=null}Cb.prototype.reset=function(){var a=this.la;a.La=null;this.oa=a.v;this.ra=null}; Cb.prototype.next=function(){var a=this.la;if(a.v!==this.oa){if(null===this.key)return!1;Aa(a)}var b=this.ra;b=null===b?a.ga:b.va;if(null!==b)return this.ra=b,this.key=b.key,this.value=b.value,!0;this.Ld();return!1};Cb.prototype.ld=function(){return this.next()};Cb.prototype.first=function(){var a=this.la;this.oa=a.v;a=a.ga;return null!==a?(this.ra=a,this.key=a.key,this.value=a.value,a):null}; Cb.prototype.any=function(a){var b=this.la;b.La=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(a(d))return!0;b.v!==c&&Aa(b);d=d.va}return!1};Cb.prototype.all=function(a){var b=this.la;b.La=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;){if(!a(d))return!1;b.v!==c&&Aa(b);d=d.va}return!0};Cb.prototype.each=function(a){var b=this.la;b.La=null;var c=b.v;this.ra=null;for(var d=b.ga;null!==d;)a(d),b.v!==c&&Aa(b),d=d.va;return this}; Cb.prototype.map=function(a){var b=this.la;b.La=null;var c=b.v;this.ra=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e)),b.v!==c&&Aa(b),e=e.va;return d.iterator};Cb.prototype.filter=function(a){var b=this.la;b.La=null;var c=b.v;this.ra=null;for(var d=new H,e=b.ga;null!==e;)a(e)&&d.add(e),b.v!==c&&Aa(b),e=e.va;return d.iterator};Cb.prototype.Ld=function(){this.value=this.key=null;this.oa=-1;this.la.La=this};Cb.prototype.toString=function(){return null!==this.ra?"MapIterator@"+this.ra:"MapIterator"}; ma.Object.defineProperties(Cb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.la.Kb}}});Cb.prototype.first=Cb.prototype.first;Cb.prototype.hasNext=Cb.prototype.ld;Cb.prototype.next=Cb.prototype.next;Cb.prototype.reset=Cb.prototype.reset;Cb.className="MapIterator"; function Db(a){fb(this);this.s=!1;this.Mb={};this.Kb=0;this.ef=this.La=null;this.v=0;this.ff=this.ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ea():this.addAll(a))}t=Db.prototype;t.qb=function(){var a=this.v;a++;999999999=this.count)return lb;var a=this.La;return null!==a?(a.reset(),a):new Cb(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?lb:new zb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return lb; var a=this.ef;return null!==a?(a.reset(),a):new Bb(this)}}});Db.prototype.toKeySet=Db.prototype.Pf;Db.prototype.toArray=Db.prototype.ua;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.ka;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.s=!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.Ng=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&&(x(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.s=!0;Object.freeze(this);return this};t.J=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this}; t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){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 Fb(a){F&&x(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.fj=function(a,b){return this.G===a&&this.H===b};t.Sa=function(a){return K.C(this.G,a.x)&&K.C(this.H,a.y)};t.add=function(a){F&&(x(a,J,J,"add:p"),this.ha());this.G+=a.x;this.H+=a.y;return this};t.je=function(a){F&&(x(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.Qe=function(a){F&&x(a,J,J,"distanceSquaredPoint:p");var b=a.x-this.G;a=a.y-this.H;return b*b+a*a};t.kd=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.LA=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.Vh(a,b,c,d,this.G,this.H,this);return this};t.MA=function(a,b){F&&(x(a,J,J,"projectOntoLineSegmentPoint:p"),x(b,J,J,"projectOntoLineSegmentPoint:q"));K.Vh(a.x,a.y,b.x,b.y,this.G,this.H,this);return this}; t.YA=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.Hq(this.G,this.H,a,b,c,d,this);return this};t.ZA=function(a,b){F&&(x(a,J,J,"snapToGridPoint:p"),x(b,Hb,J,"snapToGridPoint:q"));K.Hq(this.G,this.H,a.x,a.y,b.width,b.height,this);return this};t.sj=function(a,b){F&&(x(a,L,J,"setRectSpot:r"),x(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.Lk=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"),x(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&&x(a,Ib,J,"transform:t");a.xa(this);return this};function Jb(a,b){F&&x(b,Ib,J,"transformInverted:t");b.ee(a);return a} function Kb(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 Lb(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 Mb(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=Nb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Nb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Nb.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.Lk;J.prototype.setRectSpot=J.prototype.sj;J.prototype.snapToGridPoint=J.prototype.ZA;J.prototype.snapToGrid=J.prototype.YA; J.prototype.projectOntoLineSegmentPoint=J.prototype.MA;J.prototype.projectOntoLineSegment=J.prototype.LA;J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){F&&(C(a,L,"intersectingLineSegments:a1x"),C(b,L,"intersectingLineSegments:a1y"),C(c,L,"intersectingLineSegments:a2x"),C(d,L,"intersectingLineSegments:a2y"),C(e,L,"intersectingLineSegments:b1x"),C(f,L,"intersectingLineSegments:b1y"),C(g,L,"intersectingLineSegments:b2x"),C(h,L,"intersectingLineSegments:b2y"));return K.Pq(a,b,c,d,e,f,g,h)}; J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Xa;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.kd;J.prototype.distanceSquaredPoint=J.prototype.Qe;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.je;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Sa;J.prototype.equalTo=J.prototype.fj;J.prototype.equals=J.prototype.A; J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.Ng;var Rb=null,Sb=null,Tb=null,Ub=null,Vb=null,Nb=[];J.className="Point";J.parse=Eb;J.stringify=Fb;J.distanceLineSegmentSquared=Kb;J.distanceSquared=Lb;J.direction=Mb;J.Origin=Rb=(new J(0,0)).ia();J.InfiniteTopLeft=Sb=(new J(-Infinity,-Infinity)).ia();J.InfiniteBottomRight=Tb=(new J(Infinity,Infinity)).ia();J.SixPoint=Ub=(new J(6,6)).ia();J.NoPoint=Vb=(new J(NaN,NaN)).ia();J.parse=Eb;J.stringify=Fb;J.distanceLineSegmentSquared=Kb; J.distanceSquared=Lb;J.direction=Mb;function Hb(a,b){void 0===a?this.da=this.ea=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.ea=a,this.da=b):v("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Wb,Xb,Zb,$b,ac,bc,cc;Hb.prototype.assign=function(a){this.ea=a.ea;this.da=a.da;return this};Hb.prototype.h=function(a,b){this.ea=a;this.da=b;return this}; Hb.prototype.Ng=function(a,b){F&&(A(a,"number",Hb,"setTo:w"),A(b,"number",Hb,"setTo:h"),0>a&&ya(a,">= 0",Hb,"setTo:w"),0>b&&ya(b,">= 0",Hb,"setTo:h"),this.ha());this.ea=a;this.da=b;return this};Hb.prototype.set=function(a){F&&(x(a,Hb,Hb,"set:s"),this.ha());this.ea=a.ea;this.da=a.da;return this};Hb.prototype.copy=function(){var a=new Hb;a.ea=this.ea;a.da=this.da;return a};t=Hb.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this}; t.J=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function dc(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 Hb(c,e)}return new Hb}function ec(a){F&&x(a,Hb);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Hb?this.ea===a.width&&this.da===a.height:!1};t.fj=function(a,b){return this.ea===a&&this.da===b}; t.Sa=function(a){return K.C(this.ea,a.width)&&K.C(this.da,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};Hb.alloc=function(){var a=fc.pop();return void 0===a?new Hb:a};Hb.free=function(a){fc.push(a)}; ma.Object.defineProperties(Hb.prototype,{width:{configurable:!0,get:function(){return this.ea},set:function(a){F&&(A(a,"number",Hb,"width"),this.ha(a));0>a&&ya(a,">= 0",Hb,"width");this.ea=a}},height:{configurable:!0,get:function(){return this.da},set:function(a){F&&(A(a,"number",Hb,"height"),this.ha(a));0>a&&ya(a,">= 0",Hb,"height");this.da=a}}});Hb.prototype.isReal=Hb.prototype.o;Hb.prototype.equalsApprox=Hb.prototype.Sa;Hb.prototype.equalTo=Hb.prototype.fj; Hb.prototype.equals=Hb.prototype.A;Hb.prototype.set=Hb.prototype.set;Hb.prototype.setTo=Hb.prototype.Ng;var fc=[];Hb.className="Size";Hb.parse=dc;Hb.stringify=ec;Hb.ZeroSize=Wb=(new Hb(0,0)).ia();Hb.OneSize=Xb=(new Hb(1,1)).ia();Hb.SixSize=Zb=(new Hb(6,6)).ia();Hb.EightSize=$b=(new Hb(8,8)).ia();Hb.TenSize=ac=(new Hb(10,10)).ia();Hb.InfiniteSize=bc=(new Hb(Infinity,Infinity)).ia();Hb.NoSize=cc=(new Hb(NaN,NaN)).ia();Hb.parse=dc;Hb.stringify=ec; function L(a,b,c,d){void 0===a?this.da=this.ea=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.ea=Math.abs(c-d),this.da=Math.abs(a-b)):b instanceof Hb?(this.G=c,this.H=a,this.ea=b.width,this.da=b.height):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.ea=c,this.da=d):v("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this.s=!1}t=L.prototype;t.assign=function(a){this.G=a.G;this.H=a.H;this.ea=a.ea;this.da=a.da;return this};t.h=function(a,b,c,d){this.G=a;this.H=b;this.ea=c;this.da=d;return this};function gc(a,b,c){a.ea=b;a.da=c}t.Ng=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.ea=c;this.da=d;return this}; t.set=function(a){F&&(x(a,L,L,"set:r"),this.ha());this.G=a.G;this.H=a.H;this.ea=a.ea;this.da=a.da;return this};t.pd=function(a){F&&(x(a,J,L,"setPoint:p"),this.ha());this.G=a.x;this.H=a.y;return this};t.WA=function(a){F&&(x(a,Hb,L,"setSize:s"),this.ha());this.ea=a.width;this.da=a.height;return this};L.prototype.copy=function(){var a=new L;a.G=this.G;a.H=this.H;a.ea=this.ea;a.da=this.da;return a};t=L.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this}; t.J=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function hc(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 ic(a){F&&x(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.ea===a.width&&this.da===a.height:!1};t.fj=function(a,b,c,d){return this.G===a&&this.H===b&&this.ea===c&&this.da===d};t.Sa=function(a){return K.C(this.G,a.x)&&K.C(this.H,a.y)&&K.C(this.ea,a.width)&&K.C(this.da,a.height)};function jc(a,b){return K.ca(a.G,b.x)&&K.ca(a.H,b.y)&&K.ca(a.ea,b.width)&&K.ca(a.da,b.height)} t.fa=function(a){F&&x(a,J,L,"containsPoint:p");return this.G<=a.x&&this.G+this.ea>=a.x&&this.H<=a.y&&this.H+this.da>=a.y};t.Pe=function(a){F&&x(a,L,L,"containsRect:r");return this.G<=a.x&&a.x+a.width<=this.G+this.ea&&this.H<=a.y&&a.y+a.height<=this.H+this.da}; 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.ea&&this.H<=b&&b+d<=this.H+this.da};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.Lc=function(a,b){F&&(C(a,L,"inflate:w"),C(b,L,"inflate:h"));return kc(this,b,a,b,a)};t.xq=function(a){F&&x(a,lc,L,"addMargin:m");return kc(this,a.top,a.right,a.bottom,a.left)};t.Lw=function(a){F&&x(a,lc,L,"subtractMargin:m");return kc(this,-a.top,-a.right,-a.bottom,-a.left)};t.oA=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 kc(this,a,b,c,d)}; function kc(a,b,c,d,e){F&&a.ha();var f=a.ea;c+e<=-f?(a.G+=f/2,a.ea=0):(a.G-=e,a.ea+=c+e);c=a.da;b+d<=-c?(a.H+=c/2,a.da=0):(a.H-=b,a.da+=b+d);return a}t.sA=function(a){F&&x(a,L,L,"intersectRect:r");return mc(this,a.x,a.y,a.width,a.height)};t.dw=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.ea,b+d);c=Math.min(a.H+a.da,c+e);a.G=f;a.H=g;a.ea=Math.max(0,b-f);a.da=Math.max(0,c-g);return a}t.Oc=function(a){F&&x(a,L,L,"intersectsRect:r");return this.ew(a.x,a.y,a.width,a.height)}; t.ew=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.ea,f=this.G;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.da;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){var c=a.ea,d=a.G,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.da;a=a.H;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ve=function(a){F&&x(a,J,L,"unionPoint:p");return qc(this,a.x,a.y,0,0)};t.Pc=function(a){F&&x(a,L,L,"unionRect:r");return qc(this,a.G,a.H,a.ea,a.da)}; t.Sw=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 qc(this,a,b,c,d)};function qc(a,b,c,d,e){var f=Math.min(a.G,b),g=Math.min(a.H,c);b=Math.max(a.G+a.ea,b+d);c=Math.max(a.H+a.da,c+e);a.G=f;a.H=g;a.ea=b-f;a.da=c-g;return a} t.Lk=function(a,b,c){F&&(C(a,L,"setSpot:x"),C(b,L,"setSpot:y"),x(c,M,L,"setSpot:spot"),this.ha());this.G=a-c.offsetX-c.x*this.ea;this.H=b-c.offsetY-c.y*this.da;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.uA=function(){return 0===this.width&&0===this.height}; L.alloc=function(){var a=uc.pop();return void 0===a?new L:a};L.allocAt=function(a,b,c,d){var e=uc.pop();return void 0===e?new L(a,b,c,d):e.h(a,b,c,d)};L.free=function(a){uc.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.ea},set:function(a){F&&(A(a,"number",L,"width"),this.ha(a));0>a&&ya(a,">= 0",L,"width");this.ea=a}},height:{configurable:!0,get:function(){return this.da}, set:function(a){F&&(A(a,"number",L,"height"),this.ha(a));0>a&&ya(a,">= 0",L,"height");this.da=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.ea},set:function(a){F&&(C(a,L,"right"),this.ha(a));this.G+=a-(this.G+this.ea)}}, bottom:{configurable:!0,get:function(){return this.H+this.da},set:function(a){F&&(C(a,L,"top"),this.ha(a));this.H+=a-(this.H+this.da)}},position:{configurable:!0,get:function(){return new J(this.G,this.H)},set:function(a){F&&(x(a,J,L,"position"),this.ha(a));this.G=a.x;this.H=a.y}},size:{configurable:!0,get:function(){return new Hb(this.ea,this.da)},set:function(a){F&&(x(a,Hb,L,"size"),this.ha(a));this.ea=a.width;this.da=a.height}},center:{configurable:!0, enumerable:!0,get:function(){return new J(this.G+this.ea/2,this.H+this.da/2)},set:function(a){F&&(x(a,J,L,"center"),this.ha(a));this.G=a.x-this.ea/2;this.H=a.y-this.da/2}},centerX:{configurable:!0,get:function(){return this.G+this.ea/2},set:function(a){F&&(C(a,L,"centerX"),this.ha(a));this.G=a-this.ea/2}},centerY:{configurable:!0,get:function(){return this.H+this.da/2},set:function(a){F&&(C(a,L,"centerY"),this.ha(a));this.H=a-this.da/2}}});L.prototype.isEmpty=L.prototype.uA; L.prototype.isReal=L.prototype.o;L.intersectsLineSegment=function(a,b,c,d,e,f,g,h){F&&(C(a,L,"intersectsLineSegment:x"),C(b,L,"intersectsLineSegment:y"),C(c,L,"intersectsLineSegment:w"),C(d,L,"intersectsLineSegment:h"),C(e,L,"intersectsLineSegment:p1x"),C(f,L,"intersectsLineSegment:p1y"),C(g,L,"intersectsLineSegment:p2x"),C(h,L,"intersectsLineSegment:p2y"),(0>c||0>d)&&v("Rect.intersectsLineSegment: width and height cannot be negative"));return K.By(a,b,c,d,e,f,g,h)};L.prototype.setSpot=L.prototype.Lk; L.prototype.union=L.prototype.Sw;L.prototype.unionRect=L.prototype.Pc;L.prototype.unionPoint=L.prototype.Ve;L.prototype.intersects=L.prototype.ew;L.prototype.intersectsRect=L.prototype.Oc;L.prototype.intersect=L.prototype.dw;L.prototype.intersectRect=L.prototype.sA;L.prototype.grow=L.prototype.oA;L.prototype.subtractMargin=L.prototype.Lw;L.prototype.addMargin=L.prototype.xq;L.prototype.inflate=L.prototype.Lc;L.prototype.offset=L.prototype.offset;L.prototype.contains=L.prototype.contains; L.prototype.containsRect=L.prototype.Pe;L.prototype.containsPoint=L.prototype.fa;L.prototype.equalsApprox=L.prototype.Sa;L.prototype.equalTo=L.prototype.fj;L.prototype.equals=L.prototype.A;L.prototype.setSize=L.prototype.WA;L.prototype.setPoint=L.prototype.pd;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.Ng;var vc=null,wc=null,uc=[];L.className="Rect";L.parse=hc;L.stringify=ic;L.contains=rc;L.intersects=sc;L.ZeroRect=vc=(new L(0,0,0,0)).ia();L.NoRect=wc=(new L(NaN,NaN,NaN,NaN)).ia(); L.parse=hc;L.stringify=ic;L.contains=rc;L.intersects=sc;function lc(a,b,c,d){void 0===a?this.Ae=this.ne=this.Je=this.Le=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.s=!1}lc.prototype.assign=function(a){this.Le=a.Le;this.Je=a.Je;this.ne=a.ne;this.Ae=a.Ae;return this}; lc.prototype.Ng=function(a,b,c,d){F&&(A(a,"number",lc,"setTo:t"),A(b,"number",lc,"setTo:r"),A(c,"number",lc,"setTo:b"),A(d,"number",lc,"setTo:l"),this.ha());this.Le=a;this.Je=b;this.ne=c;this.Ae=d;return this};lc.prototype.set=function(a){F&&(x(a,lc,lc,"assign:m"),this.ha());this.Le=a.Le;this.Je=a.Je;this.ne=a.ne;this.Ae=a.Ae;return this};lc.prototype.copy=function(){var a=new lc;a.Le=this.Le;a.Je=this.Je;a.ne=this.ne;a.Ae=this.Ae;return a};t=lc.prototype; t.ia=function(){this.s=!0;Object.freeze(this);return this};t.J=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function xc(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 lc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new lc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new lc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new lc(c,e):new lc(c,e,f,g)}return new lc} function yc(a){F&&x(a,lc);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 lc?this.Le===a.top&&this.Je===a.right&&this.ne===a.bottom&&this.Ae===a.left:!1};t.fj=function(a,b,c,d){return this.Le===a&&this.Je===b&&this.ne===c&&this.Ae===d}; t.Sa=function(a){return K.C(this.Le,a.top)&&K.C(this.Je,a.right)&&K.C(this.ne,a.bottom)&&K.C(this.Ae,a.left)};t.o=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};lc.alloc=function(){var a=zc.pop();return void 0===a?new lc:a};lc.free=function(a){zc.push(a)}; ma.Object.defineProperties(lc.prototype,{top:{configurable:!0,get:function(){return this.Le},set:function(a){F&&(C(a,lc,"top"),this.ha(a));this.Le=a}},right:{configurable:!0,get:function(){return this.Je},set:function(a){F&&(C(a,lc,"right"),this.ha(a));this.Je=a}},bottom:{configurable:!0,get:function(){return this.ne},set:function(a){F&&(C(a,lc,"bottom"),this.ha(a));this.ne=a}},left:{configurable:!0,get:function(){return this.Ae},set:function(a){F&& (C(a,lc,"left"),this.ha(a));this.Ae=a}}});lc.prototype.isReal=lc.prototype.o;lc.prototype.equalsApprox=lc.prototype.Sa;lc.prototype.equalTo=lc.prototype.fj;lc.prototype.equals=lc.prototype.A;lc.prototype.set=lc.prototype.set;lc.prototype.setTo=lc.prototype.Ng;var Ec=null,Fc=null,zc=[];lc.className="Margin";lc.parse=xc;lc.stringify=yc;lc.ZeroMargin=Ec=(new lc(0,0,0,0)).ia();lc.TwoMargin=Fc=(new lc(2,2,2,2)).ia();lc.parse=xc;lc.stringify=yc; function M(a,b,c,d){void 0===a?this.Zd=this.Yd=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.s=!1}var Gc,Hc,Ic,Jc,Lc,Mc,Nc,Oc,Pc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,ad,bd,cd,dd,ed,fd,gd,kd,ld,md,nd,od,pd,qd,rd,sd,td,ud,vd;M.prototype.assign=function(a){this.G=a.G;this.H=a.H;this.Yd=a.Yd;this.Zd=a.Zd;return this}; M.prototype.Ng=function(a,b,c,d){F&&(wd(a,"setTo:x"),wd(b,"setTo:y"),xd(c,"setTo:offx"),xd(d,"setTo:offy"),this.ha());this.G=a;this.H=b;this.Yd=c;this.Zd=d;return this};M.prototype.set=function(a){F&&(x(a,M,M,"set:s"),this.ha());this.G=a.G;this.H=a.H;this.Yd=a.Yd;this.Zd=a.Zd;return this};M.prototype.copy=function(){var a=new M;a.G=this.G;a.H=this.H;a.Yd=this.Yd;a.Zd=this.Zd;return a};t=M.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this}; t.J=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function yd(a,b){a.G=NaN;a.H=NaN;a.Yd=b;return a}function wd(a,b){(isNaN(a)||1a)&&ya(a,"0 <= "+b+" <= 1",M,b)} function xd(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&ya(a,"real number, not NaN or Infinity",M,b)} function zd(a){if("string"===typeof a){a=a.trim();if("None"===a)return Gc;if("TopLeft"===a)return Hc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Ic;if("TopRight"===a)return Jc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Lc;if("Center"===a)return Mc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Nc;if("BottomLeft"===a)return Oc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Pc;if("BottomRight"===a)return Sc;if("TopSide"===a)return Tc;if("LeftSide"=== a)return Uc;if("RightSide"===a)return Vc;if("BottomSide"===a)return Wc;if("TopBottomSides"===a)return Xc;if("LeftRightSides"===a)return Yc;if("TopLeftSides"===a)return Zc;if("TopRightSides"===a)return ad;if("BottomLeftSides"===a)return bd;if("BottomRightSides"===a)return cd;if("NotTopSide"===a)return dd;if("NotLeftSide"===a)return ed;if("NotRightSide"===a)return fd;if("NotBottomSide"===a)return gd;if("AllSides"===a)return kd;if("Default"===a)return ld;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=Ib.prototype; t.translate=function(a,b){F&&(C(a,Ib,"translate:x"),C(b,Ib,"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,Ib,"translate:sx"),C(b,Ib,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.xa=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.ee=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.Rw=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};Ib.alloc=function(){var a=Ed.pop();return void 0===a?new Ib:a}; Ib.free=function(a){Ed.push(a)};Ib.prototype.transformRect=Ib.prototype.Rw;Ib.prototype.invertedTransformPoint=Ib.prototype.ee;Ib.prototype.transformPoint=Ib.prototype.xa;Ib.prototype.scale=Ib.prototype.scale;Ib.prototype.translate=Ib.prototype.translate;Ib.prototype.rotate=Ib.prototype.rotate;Ib.prototype.invert=Ib.prototype.Tt;Ib.prototype.multiplyInverted=Ib.prototype.kw;Ib.prototype.multiply=Ib.prototype.multiply;Ib.prototype.reset=Ib.prototype.reset;Ib.prototype.isIdentity=Ib.prototype.Vt; Ib.prototype.equals=Ib.prototype.A;Ib.prototype.set=Ib.prototype.set;var Ed=[];Ib.className="Transform";Ib.xF="54a702f3e53909c447824c6706603faf4c"; var K={eB:"7da71ca0ad381e90",Qg:(Math.sqrt(2)-1)/3*4,jx:null,sqrt:function(a){if(0>=a)return 0;var b=K.jx;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.jx=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},C: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},At:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Ub(a,b,g,h,n,c,d)&&K.Ub(a,b,g,h,n,e,f))return K.Ub(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 w=(d+q)/2,y=(c+u)/2;return K.At(a, b,p,r,d,c,w,y,k,l,m,n)||K.At(w,y,q,u,e,f,g,h,k,l,m,n)},uz: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},sz:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Mb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},rm:function(a,b,c,d,e,f,g,h,k,l){if(K.Ub(a,b,g,h,k,c,d)&&K.Ub(a,b,g,h,k,e,f))qc(l,a,b,0,0),qc(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.rm(a,b,m,n,d,c,q,u,k,l);K.rm(q,u,p,r,e,f,g,h,k,l)}return l},Oe:function(a,b,c,d,e,f,g,h,k,l){if(K.Ub(a,b,g,h,k,c,d)&&K.Ub(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.Oe(a,b,m,n,d,c,q,u,k,l);K.Oe(q,u,p,r,e,f,g,h,k,l)}return l},rw:function(a,b,c,d,e,f,g,h,k,l){if(K.Ub(a,b,e,f,l,c,d))return K.Ub(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.rw(a,b,m,n,p,r,g,h,k,l)||K.rw(p,r,c,d,e,f,g,h,k,l)},oB: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},qw:function(a,b,c,d,e,f,g,h){if(K.Ub(a,b,e,f,g,c,d))qc(h,a,b,0,0),qc(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.qw(a,b,k,l,m,n,g,h);K.qw(m,n,c,d,e,f,g,h)}return h},$q:function(a,b,c,d,e,f,g,h){if(K.Ub(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.$q(a,b,k,l,m,n,g,h);K.$q(m,n,c,d,e,f,g,h)}return h},zq:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(K.Ub(a,b,g,h,p,c,d)&&K.Ub(a,b,g,h,p,e,f)){if(ak&&g>k&&a>m&&g>m||bl&&h>l&&b>n&&h>n)return!1;var q=(a-g)*(l-n)-(b-h)*(k-m);if(0===q)return!1;p=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/q;q=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/q;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(bh)return!1}else if(ag)return!1;r.h(p,q);return!0}q=(a+c)/2;var u=(b+d)/2,w=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+w)/2;c=(u+y)/2;w=(w+e)/2;y=(y+f)/2;var z=(d+w)/2,B=(c+y)/2,D=(m-k)*(m-k)+(n-l)*(n-l),G=!1,O=0,V=0;K.zq(a,b,q,u,d,c,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 w=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+w)/2;c=(u+y)/2;w=(w+e)/2;y=(y+f)/2;var z=(d+w)/2,B=(c+y)/2;r+=K.Aq(a,b,q,u,d,c,z,B,k,l,m,n,p); r+=K.Aq(z,B,w,y,e,f,g,h,k,l,m,n,p)}return r},Vh:function(a,b,c,d,e,f,g){if(K.ca(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(K.ca(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.ca(h,g))return K.Vh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.ca(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return K.Vh(a,b,c,d,e,g*(e-a)+b,k)},mB:function(a,b,c,d,e){return K.Te(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},lB: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},bd:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Te(a,b,a,d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},kB: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},Rt:function(a,b,c){return K.By(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},By:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f=b):f===h?(e=a):rc(a,b,c,d,e,f)||rc(a,b,c,d,g,h)||K.Pq(a,b,k,b,e,f,g,h)|| K.Pq(k,b,k,l,e,f,g,h)||K.Pq(k,l,a,l,e,f,g,h)||K.Pq(a,l,a,b,e,f,g,h)?!0:!1},Pq:function(a,b,c,d,e,f,g,h){return 0>=K.Dt(a,b,c,d,e,f)*K.Dt(a,b,c,d,g,h)&&0>=K.Dt(e,f,g,h,a,b)*K.Dt(e,f,g,h,c,d)},Dt: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},gy: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 Md:var b=new L(this.startX,this.startY,0,0);b.Sw(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.Sw(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 Gd: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()));w===w.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",Fd,"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=w,w=d(),""!==w)switch(w.toUpperCase()){case "X":p=!0;n=l=!1;break;case "M":r=f();null===a.lc||!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((w===w.toLowerCase()?B.x:0)+parseFloat(d()),B.y),a.lineTo(B.x,B.y);break;case "V":for(;!c();)B=new J(B.x,(w===w.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(),Zd(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)z=r=h(),q=f(),Zd(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()),V=parseFloat(d()),P=V,ca=!1;c()||(P=parseFloat(d()),c()||(ca=0!==parseFloat(d())));w===w.toLowerCase()&&(G+=B.x,O+=B.y);a.arcTo(r,q,G,O,V,P,ca)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),G=parseFloat(d()),O=!!parseFloat(d()),V=!!parseFloat(d()),P=f(),de(a,r,q,G,O,V,P.x,P.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.wa=!0;return this}; t.fa=function(a,b){void 0===b&&(b=0);var c=this.Zc,d=this.$c,e=this.kc,f=this.sc;switch(this.type){case Id:return K.Ub(c,d,e,f,b,a.x,a.y);case Md:var g=L.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.fa(a);L.free(g);return a;case Ud:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case Gd:return pe(this,a,b,!0,!1);default:return!1}}; function pe(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.j,r=p.length,q=0;q=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(fh)return 0}else{if(bf)return 0}else if(eg)return 0}else if(le)return 0;return 0a?a=0:1=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; t.ty=function(a){0>a?a=0:1=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; t.$v=function(a,b){0>a?a=0:1=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2*a+ 3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; t.uy=function(a){if(this.type===Id){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=J.alloc();K.Vh(b,c,d,e,f,a,h);a=h.x;f=h.y;J.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===Md){g=this.startX;h=this.startY;var k=this.endX; e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=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.Ie=a,this.Si=0,F&&C(d,ue,"x1"),this.Ti=Math.max(d,0),F&&C(e,ue,"y1"),this.sh=Math.max(e,0),this.Hl="boolean"===typeof g?g:"number"===typeof g?!!g:!1,this.Zk=!!h):(F&&C(d,ue,"x1"),this.Ie=d, F&&C(e,ue,"y1"),this.Si=e,F&&C(f,ue,"x2"),a===le&&(f=Math.max(f,0)),this.Ti=f,"number"===typeof g?(a===le&&(g=Math.max(g,0)),this.sh=g):this.sh=0,this.Zk=this.Hl=!1);this.Lj=!1;this.wa=!0;this.Xe=null}ue.prototype.copy=function(){var a=new ue;a.ta=this.ta;a.kc=this.kc;a.sc=this.sc;a.Ie=this.Ie;a.Si=this.Si;a.Ti=this.Ti;a.sh=this.sh;a.Hl=this.Hl;a.Zk=this.Zk;a.Lj=this.Lj;a.wa=this.wa;return a};t=ue.prototype; t.Sa=function(a){if(!(a instanceof ue)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ie:case Kd:return K.C(this.endX,a.endX)&&K.C(this.endY,a.endY);case je:return K.C(this.endX,a.endX)&&K.C(this.endY,a.endY)&&K.C(this.point1X,a.point1X)&&K.C(this.point1Y,a.point1Y)&&K.C(this.point2X,a.point2X)&&K.C(this.point2Y,a.point2Y);case ke:return K.C(this.endX,a.endX)&&K.C(this.endY,a.endY)&&K.C(this.point1X,a.point1X)&&K.C(this.point1Y,a.point1Y);case le:return K.C(this.startAngle, a.startAngle)&&K.C(this.sweepAngle,a.sweepAngle)&&K.C(this.centerX,a.centerX)&&K.C(this.centerY,a.centerY)&&K.C(this.radiusX,a.radiusX)&&K.C(this.radiusY,a.radiusY);case me:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.C(this.xAxisRotation,a.xAxisRotation)&&K.C(this.endX,a.endX)&&K.C(this.endY,a.endY)&&K.C(this.radiusX,a.radiusX)&&K.C(this.radiusY,a.radiusY);default:return!1}};t.mb=function(a){a.classType===ue?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 Kd: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.Lj?"z":"")};t.freeze=function(){this.s=!0;return this};t.ka=function(){this.s=!1;return this};t.close=function(){this.Lj=!0;return this}; function ne(a,b){if(null!==a.Xe&&!1===b.wa)return a.Xe;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Xe=[],a.Xe;b=a.Ie;var e=a.Si,f=K.gy(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.gy(0,0,b>f?b:f,m,m+g,!0);f=Ib.alloc();f.reset();f.translate(c,d);f.rotate(a.Ie,0,0);f.scale(k,r);ge(b,f);Ib.free(f);a.Xe=b;return a.Xe} ma.Object.defineProperties(ue.prototype,{isClosed:{configurable:!0,get:function(){return this.Lj},set:function(a){this.Lj!==a&&(this.Lj=a,this.wa=!0)}},type:{configurable:!0,get:function(){return this.ta},set:function(a){F&&hb(a,ue,ue,"type");this.s&&va(this,a);this.ta=a;this.wa=!0}},endX:{configurable:!0,get:function(){return this.kc},set:function(a){F&&C(a,ue,"endX");this.s&&va(this,a);this.kc=a;this.wa=!0}},endY:{configurable:!0,get:function(){return this.sc}, set:function(a){F&&C(a,ue,"endY");this.s&&va(this,a);this.sc=a;this.wa=!0}},point1X:{configurable:!0,get:function(){return this.Ie},set:function(a){F&&C(a,ue,"point1X");this.s&&va(this,a);this.Ie=a;this.wa=!0}},point1Y:{configurable:!0,get:function(){return this.Si},set:function(a){F&&C(a,ue,"point1Y");this.s&&va(this,a);this.Si=a;this.wa=!0}},point2X:{configurable:!0,get:function(){return this.Ti},set:function(a){F&&C(a,ue,"point2X");this.s&&va(this,a);this.Ti= a;this.wa=!0}},point2Y:{configurable:!0,get:function(){return this.sh},set:function(a){F&&C(a,ue,"point2Y");this.s&&va(this,a);this.sh=a;this.wa=!0}},centerX:{configurable:!0,get:function(){return this.Ie},set:function(a){F&&C(a,ue,"centerX");this.s&&va(this,a);this.Ie=a;this.wa=!0}},centerY:{configurable:!0,get:function(){return this.Si},set:function(a){F&&C(a,ue,"centerY");this.s&&va(this,a);this.Si=a;this.wa=!0}},radiusX:{configurable:!0, get:function(){return this.Ti},set:function(a){F&&C(a,ue,"radiusX");0>a&&ya(a,">= zero",ue,"radiusX");this.s&&va(this,a);this.Ti=a;this.wa=!0}},radiusY:{configurable:!0,get:function(){return this.sh},set:function(a){F&&C(a,ue,"radiusY");0>a&&ya(a,">= zero",ue,"radiusY");this.s&&va(this,a);this.sh=a;this.wa=!0}},startAngle:{configurable:!0,get:function(){return this.kc},set:function(a){this.kc!==a&&(this.s&&va(this,a),F&&C(a,ue,"startAngle"),a%=360,0>a&&(a+=360),this.kc= a,this.wa=!0)}},sweepAngle:{configurable:!0,get:function(){return this.sc},set:function(a){F&&C(a,ue,"sweepAngle");this.s&&va(this,a);360a&&(a=-360);this.sc=a;this.wa=!0}},isClockwiseArc:{configurable:!0,get:function(){return this.Zk},set:function(a){this.s&&va(this,a);this.Zk=a;this.wa=!0}},isLargeArc:{configurable:!0,get:function(){return this.Hl},set:function(a){this.s&&va(this,a);this.Hl=a;this.wa=!0}},xAxisRotation:{configurable:!0, get:function(){return this.Ie},set:function(a){F&&C(a,ue,"xAxisRotation");a%=360;0>a&&(a+=360);this.s&&va(this,a);this.Ie=a;this.wa=!0}}});ue.prototype.equalsApprox=ue.prototype.Sa;var ie=new E(ue,"Move",0),Kd=new E(ue,"Line",1),je=new E(ue,"Bezier",2),ke=new E(ue,"QuadraticBezier",3),le=new E(ue,"Arc",4),me=new E(ue,"SvgArc",4);ue.className="PathSegment";ue.Move=ie;ue.Line=Kd;ue.Bezier=je;ue.QuadraticBezier=ke;ue.Arc=le;ue.SvgArc=me; function we(){this.B=null;this.zv=(new J(0,0)).freeze();this.Ju=(new J(0,0)).freeze();this.Cr=this.Fs=0;this.Dr=1;this.ws="";this.vt=this.Wr=!1;this.Tr=this.Fr=0;this.Vg=this.fs=this.qs=!1;this.bs=null;this.qt=0;this.jd=this.pt=null}we.prototype.copy=function(){var a=new we;return this.clone(a)}; we.prototype.clone=function(a){a.B=this.B;a.zv.assign(this.viewPoint);a.Ju.assign(this.documentPoint);a.Fs=this.Fs;a.Cr=this.Cr;a.Dr=this.Dr;a.ws=this.ws;a.Wr=this.Wr;a.vt=this.vt;a.Fr=this.Fr;a.Tr=this.Tr;a.qs=this.qs;a.fs=this.fs;a.Vg=this.Vg;a.bs=this.bs;a.qt=this.qt;a.pt=this.pt;a.jd=this.jd;return a}; we.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};we.prototype.Kq=function(a,b){var c=this.diagram;if(null===c)return b;Ee(c,this.event,a,b);return b}; we.prototype.iA=function(a,b){var c=this.diagram;if(null===c)return b;Ee(c,this.event,a,b);b.assign(c.pu(b));return b}; ma.Object.defineProperties(we.prototype,{diagram:{configurable:!0,get:function(){return this.B},set:function(a){this.B=a}},viewPoint:{configurable:!0,get:function(){return this.zv},set:function(a){x(a,J,we,"viewPoint");this.zv.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.Ju},set:function(a){x(a,J,we,"documentPoint");this.Ju.assign(a)}},modifiers:{configurable:!0,get:function(){return this.Fs},set:function(a){this.Fs= a}},button:{configurable:!0,get:function(){return this.Cr},set:function(a){this.Cr=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.Dr},set:function(a){this.Dr=a}},key:{configurable:!0,get:function(){return this.ws},set:function(a){this.ws=a}},down:{configurable:!0,get:function(){return this.Wr},set:function(a){this.Wr=a}},up:{configurable:!0, enumerable:!0,get:function(){return this.vt},set:function(a){this.vt=a}},clickCount:{configurable:!0,get:function(){return this.Fr},set:function(a){this.Fr=a}},delta:{configurable:!0,get:function(){return this.Tr},set:function(a){this.Tr=a}},isMultiTouch:{configurable:!0,get:function(){return this.qs},set:function(a){this.qs=a}},handled:{configurable:!0,get:function(){return this.fs},set:function(a){this.fs=a}},bubbles:{configurable:!0, get:function(){return this.Vg},set:function(a){this.Vg=a}},event:{configurable:!0,get:function(){return this.bs},set:function(a){this.bs=a}},isTouchEvent:{configurable:!0,get:function(){var a=qa.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=qa.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{configurable:!0,get:function(){return this.qt},set:function(a){this.qt=a}},targetDiagram:{configurable:!0, get:function(){return this.pt},set:function(a){this.pt=a}},targetObject:{configurable:!0,get:function(){return this.jd},set:function(a){this.jd=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}}});we.prototype.getMultiTouchDocumentPoint=we.prototype.iA;we.prototype.getMultiTouchViewPoint=we.prototype.Kq;we.className="InputEvent";function Fe(){this.B=null;this.Wa="";this.Ps=this.ot=null}Fe.prototype.copy=function(){var a=new Fe;a.B=this.B;a.Wa=this.Wa;a.ot=this.ot;a.Ps=this.Ps;return a}; Fe.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(Fe.prototype,{diagram:{configurable:!0,get:function(){return this.B},set:function(a){this.B=a}},name:{configurable:!0,get:function(){return this.Wa},set:function(a){this.Wa=a}},subject:{configurable:!0,get:function(){return this.ot},set:function(a){this.ot=a}},parameter:{configurable:!0,get:function(){return this.Ps},set:function(a){this.Ps=a}}});Fe.className="DiagramEvent"; function Ge(){this.xn=He;this.nf=this.Es="";this.ip=this.jp=this.pp=this.qp=this.op=this.B=this.gc=null}Ge.prototype.clear=function(){this.ip=this.jp=this.pp=this.qp=this.op=this.B=this.gc=null}; Ge.prototype.copy=function(){var a=new Ge;a.xn=this.xn;a.Es=this.Es;a.nf=this.nf;a.gc=this.gc;a.B=this.B;a.op=this.op;var b=this.qp;a.qp=Fa(b)&&"function"===typeof b.J?b.J():b;b=this.pp;a.pp=Fa(b)&&"function"===typeof b.J?b.J():b;b=this.jp;a.jp=Fa(b)&&"function"===typeof b.J?b.J():b;b=this.ip;a.ip=Fa(b)&&"function"===typeof b.J?b.J():b;return a};Ge.prototype.mb=function(a){a.classType===Ge?this.change=a:Ba(this,a)}; Ge.prototype.toString=function(){var a="";a=this.change===Ie?a+"* ":this.change===He?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===Ie?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Qa(this.object)),null!==this.oldValue&&(a+=" old: "+Qa(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Qa(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};Ge.prototype.K=function(a){return a?this.oldValue:this.newValue};Ge.prototype.kA=function(a){return a?this.oldParam:this.newParam};Ge.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; Ge.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};Ge.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};Ge.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; ma.Object.defineProperties(Ge.prototype,{model:{configurable:!0,get:function(){return this.gc},set:function(a){this.gc=a}},diagram:{configurable:!0,get:function(){return this.B},set:function(a){this.B=a}},change:{configurable:!0,get:function(){return this.xn},set:function(a){F&&hb(a,Ge,Ge,"change");this.xn=a}},modelChange:{configurable:!0,get:function(){return this.Es},set:function(a){F&&A(a,"string",Ge,"modelChange");this.Es=a}},propertyName:{configurable:!0, enumerable:!0,get:function(){return this.nf},set:function(a){F&&"string"!==typeof a&&A(a,"function",Ge,"propertyName");this.nf=a}},isTransactionFinished:{configurable:!0,get:function(){return this.xn===Ie&&("CommittedTransaction"===this.nf||"FinishedUndo"===this.nf||"FinishedRedo"===this.nf)}},object:{configurable:!0,get:function(){return this.op},set:function(a){this.op=a}},oldValue:{configurable:!0,get:function(){return this.qp},set:function(a){this.qp= a}},oldParam:{configurable:!0,get:function(){return this.pp},set:function(a){this.pp=a}},newValue:{configurable:!0,get:function(){return this.jp},set:function(a){this.jp=a}},newParam:{configurable:!0,get:function(){return this.ip},set:function(a){this.ip=a}}});Ge.prototype.redo=Ge.prototype.redo;Ge.prototype.canRedo=Ge.prototype.canRedo;Ge.prototype.undo=Ge.prototype.undo;Ge.prototype.canUndo=Ge.prototype.canUndo;Ge.prototype.getParam=Ge.prototype.kA; Ge.prototype.getValue=Ge.prototype.K;Ge.prototype.clear=Ge.prototype.clear;var Ie=new E(Ge,"Transaction",-1),He=new E(Ge,"Property",0),Je=new E(Ge,"Insert",1),Ke=new E(Ge,"Remove",2);Ge.className="ChangedEvent";Ge.Transaction=Ie;Ge.Property=He;Ge.Insert=Je;Ge.Remove=Ke;function Le(){this.w=(new H).freeze();this.Wa="";this.l=!1} Le.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0a.transactionLevel&&Ca("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Eb("CommittingTransaction",c,e));var f=0;if(0a.historyIndex;d--)f=b.O(d),null!==f&&f.clear(),b.hb(d),a.os=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.O(0),null!==f&&f.clear(),b.hb(0),a.Qd--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Qd++);b.freeze()}a.isInternalTransaction||a.Eb("CommittedTransaction",c,e)}else{a.xe=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| a.Eb("RolledBackTransaction",c,e),a.xe=!1}null!==e&&e.clear()}a.Qr=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.O(e),null!==b&&b.undo(),c.ka(),c.hb(e);c.freeze()}return!1}Me.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.Qu&&(a=a.diagram,null!==a&&!1===a.zk||Ca("Change not within a transaction: "+c.toString()))}}; Me.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; ma.Object.defineProperties(Me.prototype,{models:{configurable:!0,get:function(){return this.hv.iterator}},isEnabled:{configurable:!0,get:function(){return this.gd},set:function(a){this.gd=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(Oe.prototype,{diagram:{configurable:!0,get:function(){return this.B},set:function(a){a instanceof Q&&(this.B=a)}},name:{configurable:!0,get:function(){return this.Wa},set:function(a){A(a,"string",Oe,"name");this.Wa=a}},isEnabled:{configurable:!0,get:function(){return this.gd},set:function(a){A(a,"boolean",Oe,"isEnabled");this.gd=a}},isActive:{configurable:!0,get:function(){return this.qd},set:function(a){A(a,"boolean", Oe,"isActive");this.qd=a}},transactionResult:{configurable:!0,get:function(){return this.ix},set:function(a){null!==a&&A(a,"string",Oe,"transactionResult");this.ix=a}}});Oe.prototype.stopTransaction=Oe.prototype.Pg;Oe.prototype.startTransaction=Oe.prototype.Ba;Oe.className="Tool";function Ua(){Oe.call(this);this.name="ToolManager";this.Qc=new H;this.Rc=new H;this.Qf=new H;this.W=this.Na=850;this.w=(new Hb(2,2)).ia();this.ib=5E3;this.Oa=Se;this.L=Ue;this.Pr=this.l=null;this.ek=-1} la(Ua,Oe);Ua.prototype.initializeStandardTools=function(){};Ua.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Te&&this.Pr===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Ua.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Ze&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===$e){b.bubbles=!0;return}if(this.gestureBehavior===Ze)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;F&&c.checksTransactionLevel&&0!==c.transactionLevel&&Ca("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 Bf(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.xg;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Kf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Kf(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.Hy&&d.U("LinkRelinked",c,d.Hy),c.toPort!==d.Iy&&d.U("LinkRelinked",c,d.Iy)):Lf(e,g,f,k,h):Lf(e,null,null,null,null)}}}}df.prototype.doDragOver=function(){}; function Mf(a,b){var c=a.diagram;a.dragsLink&&Gf(a,!0);nf(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;Sf(a,e,f);f=Jf(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 T&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==ff){a=L.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof T&&Tf(c,d,a);L.free(a)}}}function Sf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof Hf||(c=a.mouseDrop,null!==c&&c(b))}function Tf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Pe(c)&&(d=!0);a=a.Xv(c,function(a){return a.part},function(a){return a instanceof R},!0,function(a){return a instanceof R},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Ed(b)&&c.isAvoiding&&c.Ya()} df.prototype.doDropOnto=function(){};df.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(Bf(this,!1),jf(a,this.copiedParts),Df(this,this.copiedParts,!1),sf(a,this.copiedParts)):this.mayMove()?(vf(this),Df(this,this.draggedParts,!0)):this.mayDragOut()?(Bf(this,!1),Df(this,this.copiedParts,!1)):vf(this),Ff(this,a.lastInput.documentPoint))}}; df.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(vf(this),Bf(this,!0),jf(a,this.copiedParts),Df(this,this.copiedParts,!1),sf(a,this.copiedParts),null!==this.copiedParts&&(a.U("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,vf(this),this.mayMove()&&(Df(this,this.draggedParts, !0),Ff(this,a.lastInput.documentPoint)));this.Un=!0;Mf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Pf():this.draggedParts.Pf();this.copiedParts=null;b&&Uf(this);a.Ta();sf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.U(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.U("ChangedSelection",a.selection)}}}; df.prototype.simulatedMouseMove=function(a,b,c){if(null===ff)return!1;var d=ff.diagram;c instanceof Q||(c=null);var e=kf;c!==e&&(null!==e&&e!==d&&(e.Of(),ff.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),kf=c,null!==c&&c!==d&&(yf(),e=c.toolManager.findTool("Dragging"),null!==e&&(tf.contains(e)||tf.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.Jg(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 T){var k=g.ma(Mc,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.Gq(b).count>=c)return!1}return!0}; Xf.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.Dd(b).count>=c)return!1}return!0}; Xf.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};Xf.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof T))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof T))return!1;b=b.portId;null===b&&(b="");for(b=d.Dd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Xf.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};Xf.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 Zf(this,c,b,d)}; function Zf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Zf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Zf(a,b.labeledLink,c,d))?!0:!1} Xf.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!==$f){if(d===ag){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!bg(this,a,b,c,!0)}if(d===cg){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!bg(this,a,b,c,!0)}if(d===dg)return a===b?a=!0:(d=new I,d.add(b),a=eg(this,d,a,b,c)),!a;if(d===fg)return!bg(this,a,b,c,!1);if(d===gg)return a===b?a=!0:(d=new I,d.add(b),a=hg(this,d,a,b,c)),!a}return!0};function bg(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&&bg(a,g,c,d,e)))return!0}return!1} function eg(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&&eg(a,b,g,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){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&hg(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties(Xf.prototype,{portGravity:{configurable:!0,get:function(){return this.ai},set:function(a){A(a,"number",Xf,"portGravity");0<=a&&(this.ai=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.Oa},set:function(a){A(a,"boolean",Xf,"isUnconnectedLinkValid");this.Oa=a}},linkingCursor:{configurable:!0,get:function(){return this.ti},set:function(a){this.ti=a}},temporaryLink:{configurable:!0,get:function(){return this.gx}, set:function(a){x(a,R,Xf,"temporaryLink");this.gx=a}},temporaryFromNode:{configurable:!0,get:function(){return this.ex},set:function(a){x(a,T,Xf,"temporaryFromNode");if(this.ex=a)this.l=a.port}},temporaryFromPort:{configurable:!0,get:function(){return this.l},set:function(a){x(a,N,Xf,"temporaryFromPort");if(null!==this.l){var b=this.l.panel;if(null!==b){var c=b.$.indexOf(this.l);b.hb(c);b.zb(c,a)}}this.l=a}},temporaryToNode:{configurable:!0,get:function(){return this.hx}, set:function(a){x(a,T,Xf,"temporaryToNode");if(this.hx=a)this.w=a.port}},temporaryToPort:{configurable:!0,get:function(){return this.w},set:function(a){x(a,N,Xf,"temporaryToPort");if(null!==this.w){var b=this.w.panel;if(null!==b){var c=b.$.indexOf(this.w);b.hb(c);b.zb(c,a)}}this.w=a}},originalLink:{configurable:!0,get:function(){return this.Rc},set:function(a){null!==a&&x(a,R,Xf,"originalLink");this.Rc=a}},originalFromNode:{configurable:!0,get:function(){return this.ib}, set:function(a){null!==a&&x(a,T,Xf,"originalFromNode");this.ib=a}},originalFromPort:{configurable:!0,get:function(){return this.Qc},set:function(a){null!==a&&x(a,N,Xf,"originalFromPort");this.Qc=a}},originalToNode:{configurable:!0,get:function(){return this.Qf},set:function(a){null!==a&&x(a,T,Xf,"originalToNode");this.Qf=a}},originalToPort:{configurable:!0,get:function(){return this.$h},set:function(a){null!==a&&x(a,N,Xf,"originalToPort");this.$h=a}},isForwards:{configurable:!0, enumerable:!0,get:function(){return this.Na},set:function(a){A(a,"boolean",Xf,"isForwards");this.Na=a}},validPortsCache:{configurable:!0,get:function(){return this.Yy}},targetPort:{configurable:!0,get:function(){return this.bx},set:function(a){null!==a&&x(a,N,Xf,"targetPort");this.bx=a}},linkValidation:{configurable:!0,get:function(){return this.Ki},set:function(a){null!==a&&A(a,"function",Xf,"linkValidation");this.Ki=a}},portTargeted:{configurable:!0, get:function(){return this.rr},set:function(a){null!==a&&A(a,"function",Xf,"portTargeted");this.rr=a}}});Xf.className="LinkingBaseTool";function ig(){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 U)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};Ig.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}; Ig.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.Ns.set(this.adornedObject.ma(this.handle.alignment.ow())),this.rp.set(this.adornedObject.part.location),this.Hx.set(this.adornedObject.desiredSize),this.Mu=this.computeCellSize(),this.Ou=this.computeMinSize(),this.Nu=this.computeMaxSize(),a.isMouseCaptured= !0,this.Ex=a.animationManager.isEnabled,a.animationManager.isEnabled=!1,this.Ba(this.name),this.isActive=!0))};Ig.prototype.doDeactivate=function(){var a=this.diagram;this.Pg();this.me=this.handle=null;this.isActive=a.isMouseCaptured=!1;a.animationManager.isEnabled=this.Ex};Ig.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; Ig.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.Ou,c=this.Nu,d=this.Mu,e=this.adornedObject.Ot(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.cd();J.free(e)}}; Ig.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.Ou,c=this.Nu,d=this.Mu,e=this.adornedObject.Ot(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.Ta();this.transactionResult=this.name;a.U("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; Ig.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Fb();c=c.ma(this.handle.alignment.ow());if(a instanceof Hf){var d=new H;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new ef;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().je(c),!0,e)}else a.location=a.location.copy().je(c).add(this.oppositePoint);b.cd()}}; Ig.prototype.computeResize=function(a,b,c,d,e,f){b.Tb()&&(b=Mc);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.Hq(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};Ig.prototype.computeReshape=function(){var a=Mg;this.adornedObject instanceof Yf&&(a=Ng(this.adornedObject));return!(a===Og||this.diagram.lastInput.shift)}; Ig.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};Ig.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.ma(b)};Pg.prototype.doDeactivate=function(){var a=this.diagram;this.Pg();this.me=this.handle=null;this.nv=new J(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Pg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};Pg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))}; Pg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Ta();this.transactionResult=this.name;a.U("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Pg.prototype.rotate=function(a){F&&C(a,Pg,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Fb();var c=b.locationObject,d=b.rotateObject;if(c===d||c.Lg(d))c=this.rp.copy(),b.location=c.je(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.cd()}}; Pg.prototype.computeRotate=function(a){a=this.rotationPoint.Xa(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.lj());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(Pg.prototype,{handleArchetype:{configurable:!0,get:function(){return this.w},set:function(a){null!==a&&x(a,N,Pg,"handleArchetype");this.w=a}},handle:{configurable:!0,get:function(){return this.l},set:function(a){if(null!==a&&(x(a,N,Pg,"handle"),!(a.part instanceof Te)))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{configurable:!0,get:function(){return this.me},set:function(a){if(null!==a&&(x(a,N, Pg,"handle"),a.part instanceof Te))throw Error("new handle must not be in an Adornment: "+a);this.me=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.Oa},set:function(a){A(a,"number",Pg,"snapAngleMultiple");this.Oa=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.Na},set:function(a){A(a,"number",Pg,"snapAngleEpsilon");this.Na=a}},originalAngle:{configurable:!0,get:function(){return this.Gx}},rotationPoint:{configurable:!0, enumerable:!0,get:function(){return this.nv}},handleAngle:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"number",Pg,"handleAngle");this.L=a}},handleDistance:{configurable:!0,get:function(){return this.W},set:function(a){A(a,"number",Pg,"handleDistance");this.W=a}}});Pg.className="RotatingTool";Sa("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.cb("Rotating",a,this.mouseDownTools)}); function Qg(){Oe.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};hh.prototype.doStart=function(){rh=this;null!==this.textBlock&&this.doActivate()}; hh.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.$b(a.lastInput.documentPoint));if(null!==b&&b instanceof ih&&(this.textBlock=b,null!==b.part)){this.isActive=!0;this.oa=oh;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.Dh=this.textBlock.copy();var d=new L(this.textBlock.ma(Hc),this.textBlock.ma(Sc));a.Cw(d);c.show(b,a,this);this.currentTextEditor=c}}}};hh.prototype.doCancel=function(){this.stopTool()}; hh.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};hh.prototype.doMouseDown=function(){this.isActive&&this.acceptText(sh)};hh.prototype.acceptText=function(a){switch(a){case sh:if(this.oa===uh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.oa===oh||this.oa===qh||this.oa===ph)this.oa=vh,wh(this);break;case xh:case mh:case nh:if(mh!==a||!0!==this.textBlock.isMultiline)if(this.oa===oh||this.oa===qh||this.oa===ph)this.oa=vh,wh(this)}}; function wh(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());if(a.isValidText(b,e,f))a.Ba(a.name),a.oa=uh,a.transactionResult=a.name,b.text=f,d=a.textBlock,null!==d.textEdited&&d.textEdited(d,e,f),null!==c&&c.U("TextEdited",b,e),a.Pg(),a.stopTool(),null!==c&&c.doFocus();else{a.oa=qh;var g=a.textBlock;null!==g.errorFunction&&g.errorFunction(a,e,f);d.show(b,c,a)}}} hh.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.oa=kh,this.textBlock=null,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.isActive=!1)};hh.prototype.doStop=function(){rh=null};hh.prototype.isValidText=function(a,b,c){x(a,ih,hh,"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};hh.prototype.Gy=function(a){var b=this.Dh;b.text=a;b.measure(this.textBlock.Gi,Infinity);return b}; ma.Object.defineProperties(hh.prototype,{textBlock:{configurable:!0,get:function(){return this.Oa},set:function(a){null!==a&&x(a,ih,hh,"textBlock");this.Oa=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 bf||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.l=a}},starting:{configurable:!0, get:function(){return this.Na},set:function(a){hb(a,hh,hh,"starting");this.Na=a}},textValidation:{configurable:!0,get:function(){return this.Yi},set:function(a){null!==a&&A(a,"function",hh,"textValidation");this.Yi=a}},minimumEditorScale:{configurable:!0,get:function(){return this.L},set:function(a){null!==a&&A(a,"number",hh,"minimumEditorScale");this.L=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.W},set:function(a){null!==a&&A(a, "boolean",hh,"selectsTextOnActivate");this.W=a}},state:{configurable:!0,get:function(){return this.oa},set:function(a){this.oa!==a&&(hb(a,hh,hh,"starting"),this.oa=a)}}});hh.prototype.measureTemporaryTextBlock=hh.prototype.Gy; var xh=new E(hh,"LostFocus",0),sh=new E(hh,"MouseDown",1),nh=new E(hh,"Tab",2),mh=new E(hh,"Enter",3),yh=new E(hh,"SingleClick",0),jh=new E(hh,"SingleClickSelected",1),th=new E(hh,"DoubleClick",2),kh=new E(hh,"StateNone",0),oh=new E(hh,"StateActive",1),ph=new E(hh,"StateEditing",2),vh=new E(hh,"StateValidating",3),qh=new E(hh,"StateInvalid",4),uh=new E(hh,"StateValidated",5),rh=null;hh.className="TextEditingTool";hh.LostFocus=xh;hh.MouseDown=sh;hh.Tab=nh;hh.Enter=mh;hh.SingleClick=yh; hh.SingleClickSelected=jh;hh.DoubleClick=th;hh.StateNone=kh;hh.StateActive=oh;hh.StateEditing=ph;hh.StateValidating=vh;hh.StateInvalid=qh;hh.StateValidated=uh;Sa("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.cb("TextEditing",a,this.mouseUpTools)}); function zh(){Ah||(Bh(),Ah=!0);this.B=Pe;this.vl=this.lf=this.wc=this.ts=this.nc=!1;this.Rx=!0;this.wl=Ch;this.vn=!1;this.Ci=this.gd=!0;this.dh=600;this.ox=this.Qx=!1;this.We=new I;this.Kd=new Dh;this.Kd.Sc=this;this.Rk=new I;this.uv=new I;this.rt=new I}zh.prototype.he=function(a){this.B=a};zh.prototype.canStart=function(){return!0};function Eh(a,b){Fh(a,b)&&(a.lf=!0)}function Fh(a,b){if(!a.gd||!a.canStart(b))return!1;a.We.add(b);a.defaultAnimation.isAnimating&&a.dd();return a.wc=!0} function Gh(a){if(a.gd&&a.wc){var b=a.Kd,c=a.B,d=a.We.contains("Model");d&&(a.vl=!0,a.wl===Ch?(b.isViewportUnconstrained=!0,b.pc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.wl===Th&&b.pc.clear(),a.Rx=a.wl===Uh&&c.Zs.A(c.sa)?!0:!1,c.U("InitialAnimationStarting",a));d&&!a.Ci||0===b.pc.count?(a.We.clear(),a.wc=!1,a.lf=!1,b.pc.clear(),Vh(b),a.vl=!1,c.P()):(a.We.clear(),c.Me=!1,d=b.pc.get(c),c.autoScale!==Wh&&null!==d&&(delete d.start.scale,delete d.end.scale), qa.requestAnimationFrame(function(){!1===a.wc||b.nc||(c.Re("temporaryPixelRatio")&&hf(c),Xh(c),a.wc=!1,a.lf=!1,b.start(),Yh(a),c.Ta(),Zh(b,0),Vf(c,!0),$h(a),c.U("AnimationStarting",a))}))}}function ai(a,b,c,d){b instanceof R&&(null!==b.fromNode||null!==b.toNode)||a.Kd.add(b,"position",c,d,!1)}t=zh.prototype;t.cu=function(a){return this.Kd.cu(a)};t.gw=function(a){return this.Kd.gw(a)}; function bi(a,b){function c(){0a&&ya(a,">= 1",zh,"duration");this.dh=a}},isAnimating:{configurable:!0,get:function(){return this.nc}},isTicking:{configurable:!0, enumerable:!0,get:function(){return this.ts}},isInitial:{configurable:!0,get:function(){return this.Ci},set:function(a){A(a,"boolean",zh,"isInitial");this.Ci=a}},defaultAnimation:{configurable:!0,get:function(){return this.Kd}},activeAnimations:{configurable:!0,get:function(){return this.Rk}},initialAnimationStyle:{configurable:!0,get:function(){return this.wl},set:function(a){F&&hb(a,zh,zh,"initialAnimationStyle");this.wl=a}}}); zh.prototype.stopAnimation=zh.prototype.dd;var ki=null,Ah=!1,Ch=new E(zh,"Default",1),Uh=new E(zh,"AnimateLocations",2),Th=new E(zh,"None",3);zh.className="AnimationManager";zh.defineAnimationEffect=function(a,b){Ah||(Bh(),Ah=!0);ki.add(a,b)};zh.Default=Ch;zh.AnimateLocations=Uh;zh.None=Th; function Dh(){this.yv=this.Px=this.Sc=this.B=null;this.El=this.nc=this.l=!1;this.$n=this.Ad=0;this.Nr=this.Lu=li;this.Dl=this.Gp=!1;this.ov=1;this.mv=0;this.td=this.dh=NaN;this.sx=0;this.ao=null;this.w=Rb;this.pc=new Db;this.iv=new Db;this.mm=new I;this.jv=new I;this.px=mi}Dh.prototype.suspend=function(){this.El=!0};Dh.prototype.advanceTo=function(a,b){b&&(this.El=!1);this.Gp&&a>=this.td&&(this.Dl=!0,a-=this.td);this.sx=a;ci(this,!0);Yh(this.Sc);Vf(this.B);$h(this.Sc);this.B.ge()}; function Vh(a){a.iv.clear();a.Dl=!1;a.mv=0;a.td=NaN;0a.$n?a.td:d-a.Ad;b&&(e=a.sx,ea.$n&&(a.Gp&&!a.Dl?(a.Ad=+new Date,a.$n=a.Ad+a.td,a.Dl=!0):a.xm(!1))}}} function Zh(a,b){for(var c=a.td,d=a.pc.iterator,e=a.Dl;d.next();){var f=d.key;if(!(f instanceof N&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=ki,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:node"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.Nr,b,c,a)}}}t.stop=function(){this.nc&&this.xm(!0)}; t.xm=function(a){null!==this.yv&&this.yv.Np.remove(this.Px);if(this.nc){var b=this.B,c=this.Sc;this.El=this.nc=c.vl=!1;Yh(c);for(var d=this.pc,e=this.mm.iterator;e.next();)b.remove(e.value);for(e=this.jv.iterator;e.next();)e.value.u();e=this.Gp;d=d.iterator;for(var f=ki;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Sv,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Lv||"position:node"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]:h.Lv?k[n]: l[n],this.Nr,this.td,this.td,this)}h.Lv&&void 0!==m.location&&g instanceof S&&(g.location=m.location);h.tw&&g instanceof S&&g.Vb(!1)}if(c.defaultAnimation===this)for(n=this.B.links;n.next();)e=n.value,null===e.wh?(d=e.path,null!==d&&(e.rd=!1,e.u(),d.u())):(e.points=e.wh,e.wh=null);b.Yt.clear();wf(b,!1);b.Ta();b.P();Vf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.px);$h(c);this.mv++;!a&&this.ov>this.mv?(this.Dl=!1,this.start()):(this.ao&&this.ao(this),Vh(this),c.xm(this),b.Hb())}}; t.jk=function(a,b){var c=b.actualBounds,d=null;b instanceof Hf&&(d=b.placeholder);null!==d?(c=d.ma(Hc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new J(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof Hf)for(a=a.memberParts;a.next();)d=a.value,d instanceof T&&this.jk(d,b)}; t.hk=function(a,b){if(a.isVisible()){var c=null;b instanceof Hf&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:node",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.pc;c.contains(a)&&(c.K(a).tw=!0);if(a instanceof Hf)for(a=a.memberParts;a.next();)c=a.value,c instanceof T&&this.hk(c,b)}};t.lA=function(a){var b=this.iv.get(a);null===b&&(b={},this.iv.add(a,b));return b}; ma.Object.defineProperties(Dh.prototype,{duration:{configurable:!0,get:function(){return this.dh},set:function(a){A(a,"number",Dh,"duration");1>a&&ya(a,">= 1",Dh,"duration");this.dh=a}},reversible:{configurable:!0,get:function(){return this.Gp},set:function(a){this.Gp=a}},runCount:{configurable:!0,get:function(){return this.ov},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function ni(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}Dh.className="Animation";Dh.EaseLinear=function(a,b,c,d){return c*a/d+b};Dh.EaseInOutQuad=li;Dh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};Dh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};Dh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};Dh.EaseOutExpo=ni; function qi(a,b,c){this.start=a;this.end=b;this.Sv={};this.Lv=c;this.tw=!1}qi.className="AnimationState";function ri(a,b,c){this.jd=null;this.nf=a;this.gq=c||si;this.Wk=null;void 0!==b&&(this.Wk=b,void 0===c&&(this.gq=ti))}ri.prototype.copy=function(){var a=new ri(this.nf);a.gq=this.gq;var b=this.Wk;if(null!==b){var c={};void 0!==b.duration&&(c.ly=b.duration);void 0!==b.finished&&(c.ly=b.finished);void 0!==b.easing&&(c.ly=b.easing);a.Wk=c}return a}; function ui(a,b){a=a.Wk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))} ma.Object.defineProperties(ri.prototype,{propertyName:{configurable:!0,get:function(){return this.nf},set:function(a){this.nf=a}},animationSettings:{configurable:!0,get:function(){return this.Wk},set:function(a){this.Wk=a}},startCondition:{configurable:!0,get:function(){return this.gq},set:function(a){F&&hb(a,ri,ri,"startCondition");this.gq=a}}});var si=new E(ri,"Default",1),ti=new E(ri,"Immediate",2),vi=new E(ri,"Bundled",3);ri.className="AnimationTrigger"; ri.Default=si;ri.Immediate=ti;ri.Bundled=vi;function wi(){0=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ha.iterator;h.next();){var k=h.value;k instanceof Hf?e++:k instanceof T?d++:k instanceof R?f++:k instanceof Te?g++:c++}h="";0c.Vo||g.height*e>c.Vo?b.hc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width|| 0===e.height||isNaN(e.x)||isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(Ai(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(Ai(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),Ai(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.Vt()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21* b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.yc(!0))};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.gb(He,a,this,b,c,d,e)};t.nj=function(a,b,c){var d=this.Ha;b.Hi=this;if(a>=d.count)a=d.count;else if(d.O(a)===b)return-1;d.zb(a,b);b.Nq(c);d=this.diagram;null!==d&&(c?d.P():d.nj(b));Bi(this,a,b);return a}; t.Nc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Nc(a,b,c);var d=this.Ha;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.Oq(c);d.hb(a);d=this.diagram;null!==d&&(c?d.P():d.Nc(b));b.Hi=null;return a}; function Bi(a,b,c){b=Ci(a,b,c);if(c instanceof Hf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ha.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.hb(b);a.zb(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.hb(b);a.zb(h,c);return h}for(k=NaN;++h< e&&(k=a.O(h).zOrder,isNaN(k)););}return b} ma.Object.defineProperties(wi.prototype,{parts:{configurable:!0,get:function(){return this.Ha.iterator}},partsBackwards:{configurable:!0,get:function(){return this.Ha.iteratorBackwards}},diagram:{configurable:!0,get:function(){return this.B}},name:{configurable:!0,get:function(){return this.Wa},set:function(a){A(a,"string",wi,"name");var b=this.Wa;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&v("Cannot rename default Layer to: "+a),c= c.layers;c.next();)c.value.name===a&&v("Layer.name is already present in this diagram: "+a);this.Wa=a;this.g("name",b,a);for(a=this.Ha.iterator;a.next();)a.value.layerName=this.Wa}}},opacity:{configurable:!0,get:function(){return this.wb},set:function(a){var b=this.wb;b!==a&&(A(a,"number",wi,"opacity"),(0>a||1=a)return b;for(var c=this.Pa.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};Q.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})}; Q.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; function cj(a){var b=a.ya.Ka;b instanceof HTMLCanvasElement&&(a.on?(a.addEventListener(b,"pointerdown",a.Jm,!1),a.addEventListener(b,"pointermove",a.Km,!1),a.addEventListener(b,"pointerup",a.Mm,!1),a.addEventListener(b,"pointerout",a.Lm,!1)):(a.addEventListener(b,"touchstart",a.Qw,!1),a.addEventListener(b,"touchmove",a.Pw,!1),a.addEventListener(b,"touchend",a.Ow,!1),a.addEventListener(b,"mousemove",a.Ek,!1),a.addEventListener(b,"mousedown",a.Dk,!1),a.addEventListener(b,"mouseup",a.Gk,!1),a.addEventListener(b, "mouseout",a.Fk,!1)),a.addEventListener(b,"mouseenter",a.Iz,!1),a.addEventListener(b,"mouseleave",a.Jz,!1),a.addEventListener(b,"wheel",a.Hk,!1),a.addEventListener(b,"keydown",a.xA,!1),a.addEventListener(b,"keyup",a.yA,!1),a.addEventListener(b,"blur",a.vz,!1),a.addEventListener(b,"focus",a.wz,!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!== $e&&(a.toolManager.gestureBehavior===Ze?b.preventDefault():a.we&&a.lastInput.handled||(b.preventDefault(),a.Rl=a.scale,a.currentTool.doCancel()))},!1),a.addEventListener(b,"gesturechange",function(b){if(a.toolManager.gestureBehavior!==$e)if(a.toolManager.gestureBehavior===Ze)b.preventDefault();else if(!a.we||!a.lastInput.handled){b.preventDefault();var c=b.scale;if(null!==a.Rl){var e=a.ya.getBoundingClientRect();b=new J(b.pageX-qa.scrollX-a.Da/e.width*e.left,b.pageY-qa.scrollY-a.Ca/e.height*e.top); c=a.Rl*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(qa,"resize",a.Ww,!1))}function hf(a){30p&&(this.position=q.h(-(this.dt.scrollWidth-this.Da)+u-this.Da/c+k,this.position.y))),a.dz&&this.allowVerticalScroll&&(fr&&(this.position=q.h(this.position.x, -(this.dt.scrollHeight-this.Ca)+a.scrollTop-this.Ca/c+d))),J.free(q),hj(this),this.zi=this.Pp=!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.Qp.style.width="1px"),n>=h&&f>=b&&d<=r&&(this.Qp.style.height="1px"))}};Q.prototype.computeBounds=function(){0c&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===qj?(b=k>h?(g-a.rb)/d:(f-a.rb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} Q.prototype.zoomToFit=function(){var a=this.Vi;this.Vi=mi;this.scale=lj(this,pj);a!==mi&&(kj(this,!1),mj(this,this.documentBounds,this.Da/this.Fa,this.Ca/this.Fa,this.Aj,!1));this.Vi=a};t=Q.prototype; t.fB=function(a,b){void 0===b&&(b=pj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===pj||b===qj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Da;var f=this.Ca;e=b===qj?f/d>e/c?(f-(this.ue?this.rb:0))/d:(e-(this.df?this.rb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new J(a.x,a.y)}}; t.oz=function(a,b){Zi(this);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))};t.gA=function(a){if(a instanceof N){this.bo=a;var b=J.alloc();this.co=this.lr(a.ma(Hc,b));J.free(b)}else this.bo=null,this.co=Vb}; function mj(a,b,c,d,e,f){var g=J.allocAt(a.sa.x,a.sa.y),h=g.x,k=g.y;if(null!==a.bo){var l=J.alloc();l=a.bo.ma(Hc,l);h=l.x-a.co.x/a.scale;k=l.y-a.co.y/a.scale;e=Gc;J.free(l)}if(f||a.scrollMode===mi)e.bb()&&(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.Ui,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.Zj[0])b=a.Zj[c];else return;c=a.ya;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.Da/c.width*c.left,b.clientY-a.Ca/c.height*c.top))}t=Q.prototype;t.Ta=function(){this.yi||(this.yi=!0,this.Hb(!0))};function Bj(a){a.Ic||ij(a);Zi(a)}t.ge=function(){this.Xb||this.Ic||(this.P(),nj(this),hj(this),this.Ta(),this.cd())};t.wA=function(){return this.Me}; t.Dz=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.dd();b.isEnabled=!1;Vf(this);this.ve=!1;this.Zs=new J(NaN,NaN);b.isEnabled=c;null!==a&&ta(function(){Eh(b,"Model");a()},1)};t.Hb=function(a){void 0===a&&(a=!1);if(!0!==this.Me&&!(this.Xb||!1===a&&this.Ic)){this.Me=!0;var b=this;qa.requestAnimationFrame(function(){b.Me&&b.cd()})}};t.cd=function(){if(!this.Hj||this.Me)this.Hj&&(this.Hj=!1),Vf(this)}; function oj(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Xb||!a.zi||fj(a)||(b&&ij(a),c&&kj(a,!1))} function Vf(a,b){if(!a.Ic&&(a.Me=!1,null!==a.Ia||a.om.o())){a.Ic=!0;var c=a.animationManager,d=a.Rs;if(!c.isAnimating&&0!==d.length){for(var e=d.j,f=e.length,g=0;gb;b++){var c=a.ud.iterator;if(null===c||0===a.ud.count)break;a.ud=new I;a.Vw(c,a.ud);F&&22===b&&Ca("failure to validate parts")}a.nodes.each(function(a){a instanceof Hf&&0!==(a.T&65536)!==!1&&(a.T=a.T^65536)})}} t.Vw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.bc()||c instanceof Hf||(c.qj()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof Hf&&c.isVisible()&&Gj(this,c);for(a.reset();a.next();)c=a.value,c instanceof R&&c.isVisible()&&(c.qj()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Te&&c.isVisible()&&(c.qj()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function Gj(a,b){for(var c=La(),d=La(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof Hf?(Hj(f)||Ij(f)||Jj(f))&&Gj(a,f):f instanceof R?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;ec&&(r=z.left,q=z.right),p.height>y&&(u=z.top,w=z.bottom)):(r=z.left, q=z.right,u=z.top,w=z.bottom);z=p.width+r+q;var B=p.height+u+w;r=p.x-r;var D=n.x;q=p.right+q;var G=n.right+h;u=p.y-u;var O=n.y;p=p.bottom+w;n=n.bottom+k;var V="1px",P="1px";w=a.scale;l=z>l/w;m=B>m/w;a.scrollMode===mi&&(l||m)&&(l&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(l=1,r+1G+1&&(l=Math.max((q-G)*w+a.Da,l)),c+h+1n+1&&(l=Math.max((p-n)*w+a.Ca,l)),y+k+1G+1&&(h=Math.max((q-G)*w+a.Da,h)),c+1n+1&&(k=Math.max((p-n)*w+h,k)),y+1G+1&&(k=a.position.x*w));if(a.Cl)switch(a.Ys){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(y+1n+1&&(b.scrollTop=a.position.y* w));l=a.Da;m=a.Ca;b.style.width=l+(a.df?a.rb:0)+"px";b.style.height=m+(a.ue?a.rb:0)+"px";return d!==l||e!==m||a.animationManager.wc?(a.Zq(f,a.viewportBounds,w,g),!1):!0} t.add=function(a){x(a,S,Q,"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.zm(a.layerName),null===b&&(b=this.zm("")),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.nj(99999999,a,a.diagram===this);0<=c&&this.gb(Je,"parts",b,null,a,null,c);b.isTemporary||this.Ta();a.D(1);c=a.layerChanged;null!==c&&c(a,null, b)}};t.nj=function(a){this.partManager.nj(a);var b=this;Uj(a,function(a){Vj(b,a)});(a instanceof Te||a instanceof Hf&&null!==a.placeholder)&&a.u();null!==a.data&&Uj(a,function(a){Wj(b.partManager,a)});!0!==Ij(a)&&!0!==Jj(a)||this.ud.add(a);Xj(a,!0,this);Yj(a)?(a.actualBounds.o()&&this.P(Sj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.o()&&this.P(Sj(a,a.actualBounds));this.Hb()}; t.Nc=function(a){a.lk();this.partManager.Nc(a);var b=this;null!==a.data&&Uj(a,function(a){Zj(b.partManager,a,b)});this.ud.remove(a);Yj(a)?(a.actualBounds.o()&&this.P(Sj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.o()&&this.P(Sj(a,a.actualBounds));this.Hb()};t.remove=function(a){x(a,S,Q,"remove:part");ak(this,a,!0)}; function ak(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.D(2),c&&b.sk(),c=d.Nc(-1,b,!1),0<=c&&a.gb(Ke,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.iu=function(a,b){if(Ga(a))for(var c=a.length,d=0;dd&&this.Ta()}; t.iz=function(a,b){gk(this,a,b);a.he(this);var c=this.Pa,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.gc&&this.gb(Ke,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Ta()}; t.OA=function(a){x(a,wi,Q,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Pa,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ha.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.gc&&this.gb(Ke,"layers",this,a,null,c,null);this.P();this.Ta()}}};t.zm=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.Xx=function(a){A(a,"function",Q,"addModelChangedListener:listener");null===this.Ce&&(this.Ce=new H);this.Ce.add(a);this.model.Lh(a)};t.QA=function(a){A(a,"function",Q,"removeModelChangedListener:listener");null!==this.Ce&&(this.Ce.remove(a),0===this.Ce.count&&(this.Ce=null));this.model.Kk(a)};t.Lh=function(a){A(a,"function",Q,"addChangedListener:listener");null===this.Vf&&(this.Vf=new H);this.Vf.add(a)}; t.Kk=function(a){A(a,"function",Q,"removeChangedListener:listener");null!==this.Vf&&(this.Vf.remove(a),0===this.Vf.count&&(this.Vf=null))};t.Bt=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.cw(a);a.change!==Ie&&(this.isModified=!0);if(null!==this.Vf)for(var b=this.Vf,c=b.length,d=0;dp.Ha.indexOf(q)&&p.nj(r,q,u):(q.isSelected=!1,q.isHighlighted=!1,q.Sb(),p.Nc(u?r:-1,q,u)))}else p instanceof Q?"number"===typeof r&&q instanceof wi&&(b?(q.he(this),this.Pa.zb(r,q)):this.Pa.hb(r)):v("unknown ChangedEvent.Remove object: "+ a.toString());this.isModified=!0}else d!==Ie&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=c}}};Q.prototype.Ba=function(a){return this.undoManager.Ba(a)};Q.prototype.ab=function(a){return this.undoManager.ab(a)};Q.prototype.Nf=function(){return this.undoManager.Nf()}; Q.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ba(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.ab(b):this.undoManager.Nf(),this.skipsUndoManager=c}};Q.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)};Q.prototype.nr=function(){this.partManager.nr()}; function jk(a,b,c){var d=a.animationManager;if(a.Xb||a.Ic)a.Fa=c,d.lf&&d.Kd.add(d.B,"scale",b,a.Fa);else if(null===a.ya)a.Fa=c;else{a.Xb=!0;var e=a.viewportBounds.copy(),f=a.Da,g=a.Ca;e.width=a.Da/b;e.height=a.Ca/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.nd()?l.Jf(Uc)?h=0:l.Jf(Vc)&&(h=f-1):h=l.bb()?l.x*(f-1):f/2);isNaN(k)&&(l.nd()?l.Jf(Tc)?k=0:l.Jf(Wc)&&(k=g-1):k=l.bb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.isAnimating||(c=a.scaleComputation(a, c));ca.maxScale&&(c=a.maxScale);f=J.allocAt(a.sa.x+h/b-h/c,a.sa.y+k/b-k/c);a.position=f;J.free(f);a.Fa=c;a.Zq(e,a.viewportBounds,b,!1);a.Xb=!1;kj(a,!1);d.lf&&d.Kd.add(d.B,"scale",b,a.Fa);a.P();nj(a)}} Q.prototype.Zq=function(a,b,c,d){if(!a.A(b)){void 0===d&&(d=!1);d||nj(this);hj(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Wh||d||a.width===b.width&&a.height===b.height||e.D();e=this.currentTool;!0===this.gg&&e instanceof Ua&&(this.lastInput.documentPoint=this.pu(this.lastInput.viewPoint),af(e,this));this.Xb||this.Cy(a,b);Dj(this);this.ae.scale=c;this.ae.position.x=a.x;this.ae.position.y=a.y;this.ae.bounds.assign(a);this.ae.iw=d;this.U("ViewportBoundsChanged",this.ae,a); this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Oc(b)&&a.Ya()})}}; function Dj(a,b){void 0===b&&(b=null);var c=a.Nb;if(null!==c&&c.visible){for(var d=Hb.alloc(),e=1,f=1,g=c.$.j,h=g.length,k=0;km||(kk(l.figure)?f=f*m/K.sy(f,m):e=e*m/K.sy(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.Hq(a,g,0,0, d.width,d.height,b);b.offset(-d.width,-d.height);Hb.free(d);c.part.location=b;J.free(b)}}Q.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.U("ChangingSelection",b);for(var c=b.ua(),d=c.length,e=0;e=d&&!f.isAnimating&&!f.wc&&(b||Eh(f,"Layout"));a.Tg=!1;for(var g=a.Hh.iterator;g.next();)Fk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),ij(a),e.isValidLayout=!0):a.Tg=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.ab("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||Gh(f),a.ba=c}}}function Fk(a,b,c,d){if(null!==b){for(var e=b.Ol.iterator;e.next();)Fk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.Ik=!b.location.o(),e.doLayout(b),b.D(32),Gj(a,b),e.isValidLayout=!0):a.Tg=!0)}}t.fA=function(){for(var a=new H,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.jj()&&a.add(c)}return a.iterator}; function Fi(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("InitialAnimationStarting");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("GainedFocus");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped"); b("LostFocus");b("Modified");b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");b("InvalidateDraw");a.Vr=c;a.Ur=d} function Pj(a,b){var c=a.Ur.K(b);return null!==c?c:a.Ur.K(b.toLowerCase())}function Gk(a,b){var c=a.Vr.K(b);if(null!==c)return c;c=a.Vr.K(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b)}t.ik=function(a,b){A(a,"string",Q,"addDiagramListener:name");A(b,"function",Q,"addDiagramListener:listener");a=Gk(this,a);null!==a&&a.add(b)};t.Pm=function(a,b){A(a,"string",Q,"removeDiagramListener:name");A(b,"function",Q,"addDiagramListener:listener");a=Gk(this,a);null!==a&&a.remove(b)}; t.U=function(a,b,c){F&&A(a,"string",Q,"raiseDiagramEvent:name");var d=Gk(this,a),e=new Fe;e.diagram=this;a=Pj(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.ua(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=L.allocAt(0,0,d.width*e,d.height*e);var f=J.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&(g=Math.max(this.scrollHorizontalLineChange,1),g|=0,f.x+=g,a.x>d.x+d.width- c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.yd.y+d.height-c.bottom&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.Sa(Rb)||(b=new J(b.x+f.x/e,b.y+f.y/e));L.free(d);J.free(f);return b};t=Q.prototype;t.$t=function(){return null};t.jw=function(){return null}; t.mz=function(a,b){this.Lx.add(a,b)};function Pk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].Kl){f=!1;break}f||a-l>k?b(c,e,h):qa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Ri.iterator;g.next();)if(!g.value[0].Kl){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;qa.requestAnimationFrame(function(){d()});return null}t.DA=function(a){if(!gh)return null;void 0===a&&(a=new jb);a.returnType="Image";return this.Ey(a)}; t.Ey=function(a){void 0===a&&(a=new jb);return Pk(this,this.EA,a)}; t.EA=function(a,b,c){var d=Qk(c,a,"canvas",null);if(null===d)return null;c=d.aa.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 Qk(a,b,c,d){a.animationManager.dd();a.cd();if(null===a.ya)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 Hb(Infinity,Infinity):new Hb(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 lc(m):m instanceof lc||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.Lb.yc(!0);p=new Rk(null,r);var w=p.context;if(!(f||g||l||k)){p.width=a.Da+Math.ceil(m.left+m.right);p.height=a.Ca+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.Eq=q;Nj(a,d.context,m,new Hb(p.width,p.height),a.Fa,a.sa,l,n,u,b);return d.context}a.ll=!1;Nj(a,w,m,new Hb(p.width,p.height),a.Fa,a.sa,l,n,u,b);a.ll=!0;return p.context}var y=a.Rn,z=a.documentBounds.copy();z.Lw(a.lb);if(u)for(var B=a.Pa.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+=Y):m=new lc(0);null!==h&&(y=h.width,h=h.height, "SVG"!==c&&e&&!Sk&&F&&(f>y||z>h)&&(Ca("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."),Sk=!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.Eq=q;Nj(a,d.context,m,new Hb(Math.ceil(f), Math.ceil(z)),g,B,l,n,u,b);return d.context}a.ll=!1;Nj(a,w,m,new Hb(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b);a.ll=!0;return p.context} ma.Object.defineProperties(Q.prototype,{div:{configurable:!0,get:function(){return this.Ia},set:function(a){null!==a&&x(a,HTMLDivElement,Q,"div");if(this.Ia!==a){Xa=[];var b=this.Ia;null!==b?(b.B=void 0,b.goDiagram=void 0,b.innerHTML="",null!==this.ya&&(b=this.ya.Ka,this.removeEventListener(b,"touchstart",this.Qw,!1),this.removeEventListener(b,"touchmove",this.Pw,!1),this.removeEventListener(b,"touchend",this.Ow,!1),this.ya.iy()),this.Ul&&(this.Ul.disconnect(),this.Ul=null),b=this.toolManager, null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}),b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}),b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(),this.currentTool.doCancel(),this.Lb=this.ya=null,this.removeEventListener(qa,"resize",this.Ww,!1),this.removeEventListener(qa,"mousemove",this.Ek,!0),this.removeEventListener(qa,"mousedown",this.Dk,!0),this.removeEventListener(qa,"mouseup",this.Gk,!0),this.removeEventListener(qa,"wheel",this.Hk,!0),this.removeEventListener(qa, "mouseout",this.Fk,!0),Pe===this&&(Pe=null)):this.ve=!1;this.Ia=null;if(null!==a){if(b=a.B)b.div=null;Pi(this,a);this.ge()}}}},Zx:{configurable:!0,get:function(){return this.bp}},zk:{configurable:!0,get:function(){return this.ve}},draggedLink:{configurable:!0,get:function(){return this.Xr},set:function(a){this.Xr!==a&&(this.Xr=a,null!==a&&(this.Ls=a.fromPort,this.Ms=a.toPort))}},Hy:{configurable:!0,get:function(){return this.Ls},set:function(a){this.Ls= a}},Iy:{configurable:!0,get:function(){return this.Ms},set:function(a){this.Ms=a}},animationManager:{configurable:!0,get:function(){return this.Sc}},undoManager:{configurable:!0,get:function(){return this.gc.undoManager}},skipsUndoManager:{configurable:!0,get:function(){return this.Bg},set:function(a){A(a,"boolean",Q,"skipsUndoManager");this.Bg=a;this.gc.skipsUndoManager=a}},delaysLayout:{configurable:!0,get:function(){return this.Sr}, set:function(a){this.Sr=a}},opacity:{configurable:!0,get:function(){return this.wb},set:function(a){var b=this.wb;b!==a&&(A(a,"number",Q,"opacity"),(0>a||1a&&ya(a,">= 0",Q,"scrollHorizontalLineChange"),this.bt=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.ft},set:function(a){var b=this.ft; b!==a&&(A(a,"number",Q,"scrollVerticalLineChange"),0>a&&ya(a,">= 0",Q,"scrollVerticalLineChange"),this.ft=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0,get:function(){return this.mh},set:function(a){F&&x(a,we,Q,"lastInput");this.mh=a}},firstInput:{configurable:!0,get:function(){return this.cg},set:function(a){F&&x(a,we,Q,"firstInput");this.cg=a}},currentCursor:{configurable:!0,get:function(){return this.Mr},set:function(a){""===a&& (a=this.Qn);if(this.Mr!==a){A(a,"string",Q,"currentCursor");var b=this.ya,c=this.Ia;if(null!==b){this.Mr=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.Qn},set:function(a){""===a&&(a="auto");var b=this.Qn;b!== a&&(A(a,"string",Q,"defaultCursor"),this.Qn=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.Wf},set:function(a){var b=this.Wf;b!==a&&(null!==a&&A(a,"function",Q,"click"),this.Wf=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return this.ag},set:function(a){var b=this.ag;b!==a&&(null!==a&&A(a,"function",Q,"doubleClick"),this.ag=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return this.Xf}, set:function(a){var b=this.Xf;b!==a&&(null!==a&&A(a,"function",Q,"contextClick"),this.Xf=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0,get:function(){return this.tg},set:function(a){var b=this.tg;b!==a&&(null!==a&&A(a,"function",Q,"mouseOver"),this.tg=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.rg},set:function(a){var b=this.rg;b!==a&&(null!==a&&A(a,"function",Q,"mouseHover"),this.rg=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0, enumerable:!0,get:function(){return this.qg},set:function(a){var b=this.qg;b!==a&&(null!==a&&A(a,"function",Q,"mouseHold"),this.qg=a,this.g("mouseHold",b,a))}},mouseDragOver:{configurable:!0,get:function(){return this.Gs},set:function(a){var b=this.Gs;b!==a&&(null!==a&&A(a,"function",Q,"mouseDragOver"),this.Gs=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.og},set:function(a){var b=this.og;b!==a&&(F&&null!==a&&A(a,"function",Q,"mouseDrop"), this.og=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.gs},set:function(a){var b=this.gs;b!==a&&(A(a,"boolean",Q,"handlesDragDropForTopLevelParts"),this.gs=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.pg},set:function(a){var b=this.pg;b!==a&&(null!==a&&A(a,"function",Q,"mouseEnter"),this.pg=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0, get:function(){return this.sg},set:function(a){var b=this.sg;b!==a&&(null!==a&&A(a,"function",Q,"mouseLeave"),this.sg=a,this.g("mouseLeave",b,a))}},toolTip:{configurable:!0,get:function(){return this.Dg},set:function(a){var b=this.Dg;b!==a&&(!F||null===a||a instanceof Te||a instanceof bf||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.Dg=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.Yf},set:function(a){var b=this.Yf;b!== a&&(!F||a instanceof Te||a instanceof bf||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Yf=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0,get:function(){return this.Gr},set:function(a){this.Gr!==a&&(this.Gr=a,a.he(this))}},toolManager:{configurable:!0,get:function(){return this.st},set:function(a){this.st!==a&&(x(a,Ua,Q,"toolManager"),this.st=a,a.diagram=this)}},defaultTool:{configurable:!0,get:function(){return this.Rr}, set:function(a){var b=this.Rr;b!==a&&(x(a,Oe,Q,"defaultTool"),this.Rr=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,get:function(){return this.Or},set:function(a){var b=this.Or;null!==b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(x(a,Oe,Q,"currentTool"),this.Or=a,a.diagram=this,a.doStart())}},selection:{configurable:!0,get:function(){return this.rv}},maxSelectionCount:{configurable:!0, enumerable:!0,get:function(){return this.Cs},set:function(a){var b=this.Cs;if(b!==a)if(A(a,"number",Q,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Cs=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",Q,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0, get:function(){return this.lp},set:function(a){var b=this.lp;b!==a&&(x(a,Te,Q,"nodeSelectionAdornmentTemplate"),this.lp=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.qo},set:function(a){var b=this.qo;b!==a&&(x(a,Te,Q,"groupSelectionAdornmentTemplate"),this.qo=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.Ko},set:function(a){var b= this.Ko;b!==a&&(x(a,Te,Q,"linkSelectionAdornmentTemplate"),this.Ko=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.Su}},isModified:{configurable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.vo&&this.Qd!==a.historyIndex:this.vo},set:function(a){if(this.vo!==a){A(a,"boolean",Q,"isModified");this.vo=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Qd=b.historyIndex); a||lk(this)}}},model:{configurable:!0,get:function(){return this.gc},set:function(a){var b=this.gc;if(b!==a){x(a,W,Q,"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.");this.animationManager.dd(!0);var c=Yi(this,!0);this.ve=!1;this.Hj=!0;this.Qd=-2;this.Me=!1;var d=this.Ic;this.Ic=!0;Eh(this.animationManager,"Model");null!==b&&(null!==this.Ce&&this.Ce.each(function(a){b.Kk(a)}), b.Kk(this.Qc));this.gc=a;this.partManager=mk(this.gc.type);for(var e=0;ethis.scale&&(this.scale=a)):ya(a,"> 0",Q,"minScale"))}},maxScale:{configurable:!0,get:function(){return this.Bs},set:function(a){C(a,Q,"maxScale");var b=this.Bs;b!==a&&(0 0",Q,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.zt},set:function(a){this.zt.A(a)||(x(a,J,Q,"zoomPoint"),this.zt=a=a.J())}},contentAlignment:{configurable:!0,get:function(){return this.Aj},set:function(a){var b=this.Aj;b.A(a)||(x(a,M,Q,"contentAlignment"),this.Aj=a=a.J(),this.g("contentAlignment",b,a),kj(this,!1))}},initialContentAlignment:{configurable:!0,get:function(){return this.so},set:function(a){var b= this.so;b.A(a)||(x(a,M,Q,"initialContentAlignment"),this.so=a=a.J(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.lb},set:function(a){"number"===typeof a?a=new lc(a):x(a,lc,Q,"padding");var b=this.lb;b.A(a)||(this.lb=a=a.J(),this.Ta(),this.g("padding",b,a))}},partManager:{configurable:!0,get:function(){return this.Oa},set:function(a){var b=this.Oa;b!==a&&(x(a,Ii,Q,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+ a.toString()),null!==b&&b.he(null),this.Oa=a,a.he(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.oc},set:function(a){var b=this.oc;b!==a&&(x(a,Ni,Q,"layout"),this.oc=a,a.diagram=this,a.group=null, this.Tg=!0,this.g("layout",b,a),this.Hb())}},isTreePathToChildren:{configurable:!0,get:function(){return this.us},set:function(a){var b=this.us;if(b!==a&&(A(a,"boolean",Q,"isTreePathToChildren"),this.us=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Tk(a.value)}},treeCollapsePolicy:{configurable:!0,get:function(){return this.ut},set:function(a){var b=this.ut;b!==a&&(a!==Gi&&a!==Uk&&a!==Vk&&v("Unknown Diagram.treeCollapsePolicy: "+ a),this.ut=a,this.g("treeCollapsePolicy",b,a))}},Se:{configurable:!0,get:function(){return this.Vu},set:function(a){this.Vu=a}},autoScrollInterval:{configurable:!0,get:function(){return this.sn},set:function(a){var b=this.sn;C(a,Q,"scale");b!==a&&(this.sn=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.un},set:function(a){"number"===typeof a?a=new lc(a):x(a,lc,Q,"autoScrollRegion");var b=this.un;b.A(a)||(this.un= a=a.J(),this.Ta(),this.g("autoScrollRegion",b,a))}}});ma.Object.defineProperties(Q,{licenseKey:{configurable:!0,get:function(){return Wk.cc()},set:function(a){Wk.add(a)}},version:{configurable:!0,get:function(){return Xk}}});Q.prototype.makeImageData=Q.prototype.Ey;Q.prototype.makeImage=Q.prototype.DA;Q.prototype.addRenderer=Q.prototype.mz;Q.prototype.makeSVG=Q.prototype.jw;Q.prototype.makeSvg=Q.prototype.$t;Q.prototype.stopAutoScroll=Q.prototype.Of; Q.prototype.doAutoScroll=Q.prototype.Gt;Q.prototype.isUnoccupied=Q.prototype.Ak;Q.prototype.raiseDiagramEvent=Q.prototype.U;Q.prototype.removeDiagramListener=Q.prototype.Pm;Q.prototype.addDiagramListener=Q.prototype.ik;Q.prototype.findTreeRoots=Q.prototype.fA;Q.prototype.layoutDiagram=Q.prototype.BA;Q.prototype.findTopLevelGroups=Q.prototype.Zz;Q.prototype.findTopLevelNodesAndLinks=Q.prototype.$z;Q.prototype.findLinksByExample=Q.prototype.Jt;Q.prototype.findNodesByExample=Q.prototype.Kt; Q.prototype.findLinkForData=Q.prototype.Cc;Q.prototype.findNodeForData=Q.prototype.gj;Q.prototype.findPartForData=Q.prototype.Dc;Q.prototype.findLinkForKey=Q.prototype.findLinkForKey;Q.prototype.findNodeForKey=Q.prototype.Rb;Q.prototype.findPartForKey=Q.prototype.findPartForKey;Q.prototype.rebuildParts=Q.prototype.Gd;Q.prototype.transformViewToDoc=Q.prototype.pu;Q.prototype.transformRectDocToView=Q.prototype.cB;Q.prototype.transformDocToView=Q.prototype.lr;Q.prototype.centerRect=Q.prototype.Ct; Q.prototype.scrollToRect=Q.prototype.Cw;Q.prototype.scroll=Q.prototype.scroll;Q.prototype.highlightCollection=Q.prototype.qA;Q.prototype.highlight=Q.prototype.pA;Q.prototype.selectCollection=Q.prototype.UA;Q.prototype.select=Q.prototype.select;Q.prototype.updateAllRelationshipsFromData=Q.prototype.nr;Q.prototype.updateAllTargetBindings=Q.prototype.updateAllTargetBindings;Q.prototype.commit=Q.prototype.commit;Q.prototype.rollbackTransaction=Q.prototype.Nf;Q.prototype.commitTransaction=Q.prototype.ab; Q.prototype.startTransaction=Q.prototype.Ba;Q.prototype.raiseChanged=Q.prototype.g;Q.prototype.raiseChangedEvent=Q.prototype.gb;Q.prototype.removeChangedListener=Q.prototype.Kk;Q.prototype.addChangedListener=Q.prototype.Lh;Q.prototype.removeModelChangedListener=Q.prototype.QA;Q.prototype.addModelChangedListener=Q.prototype.Xx;Q.prototype.findLayer=Q.prototype.zm;Q.prototype.removeLayer=Q.prototype.OA;Q.prototype.addLayerAfter=Q.prototype.iz;Q.prototype.addLayerBefore=Q.prototype.Vx; Q.prototype.addLayer=Q.prototype.pm;Q.prototype.moveParts=Q.prototype.moveParts;Q.prototype.copyParts=Q.prototype.rk;Q.prototype.removeParts=Q.prototype.iu;Q.prototype.remove=Q.prototype.remove;Q.prototype.add=Q.prototype.add;Q.prototype.clearDelayedGeometries=Q.prototype.Hv;Q.prototype.setProperties=Q.prototype.Hw;Q.prototype.resetInputOptions=Q.prototype.zw;Q.prototype.setInputOption=Q.prototype.VA;Q.prototype.getInputOption=Q.prototype.Dm;Q.prototype.resetRenderingHints=Q.prototype.Aw; Q.prototype.setRenderingHint=Q.prototype.Ry;Q.prototype.getRenderingHint=Q.prototype.Re;Q.prototype.maybeUpdate=Q.prototype.cd;Q.prototype.requestUpdate=Q.prototype.Hb;Q.prototype.delayInitialization=Q.prototype.Dz;Q.prototype.isUpdateRequested=Q.prototype.wA;Q.prototype.redraw=Q.prototype.ge;Q.prototype.invalidateDocumentBounds=Q.prototype.Ta;Q.prototype.findObjectsNear=Q.prototype.Jg;Q.prototype.findPartsNear=Q.prototype.Wz;Q.prototype.findObjectsIn=Q.prototype.Ff;Q.prototype.findPartsIn=Q.prototype.qy; Q.prototype.findObjectsAt=Q.prototype.hj;Q.prototype.findPartsAt=Q.prototype.Vz;Q.prototype.findObjectAt=Q.prototype.$b;Q.prototype.findPartAt=Q.prototype.Am;Q.prototype.focusObject=Q.prototype.gA;Q.prototype.alignDocument=Q.prototype.oz;Q.prototype.zoomToRect=Q.prototype.fB;Q.prototype.zoomToFit=Q.prototype.zoomToFit;Q.prototype.diagramScroll=Q.prototype.hy;Q.prototype.focus=Q.prototype.focus;Q.prototype.reset=Q.prototype.reset;Q.useDOM=function(a){gh=a?void 0!==qa.document:!1};Q.isUsingDOM=function(){return gh}; var Pe=null,Hi=new Db,bj=null,aj=null,gh=void 0!==qa.document,Qi=null,Ri="",Wh=new E(Q,"None",0),pj=new E(Q,"Uniform",1),qj=new E(Q,"UniformToFill",2),$f=new E(Q,"CycleAll",10),dg=new E(Q,"CycleNotDirected",11),fg=new E(Q,"CycleNotDirectedFast",12),gg=new E(Q,"CycleNotUndirected",13),ag=new E(Q,"CycleDestinationTree",14),cg=new E(Q,"CycleSourceTree",15),mi=new E(Q,"DocumentScroll",1),oi=new E(Q,"InfiniteScroll",2),Gi=new E(Q,"TreeParentCollapsed",21),Uk=new E(Q,"AllParentsCollapsed",22),Vk=new E(Q, "AnyParentsCollapsed",23),Wk=new H,Xk="2.1.26",Sk=!1,Yk=null,Di=!1; function Ei(){if(gh){var a=qa.document.createElement("canvas"),b=a.getContext("2d"),c=Ya("7ca11abfd022028846");b[c]=Ya("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",Ib.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",K.za],e=1;5>e;e++)b[Ya("7ca11abfd7330390")](Ya(d[e-1]),10,15*e);b[c]=Ya("39f046ebb36e4b");for(c=1;5>c;c++)b[Ya("7ca11abfd7330390")](Ya(d[c-1]),10,15*c);Yk=a}}Q.className="Diagram"; Q.fromDiv=function(a){var b=a;"string"===typeof a&&(b=qa.document.getElementById(a));return b instanceof HTMLDivElement&&b.B instanceof Q?b.B:null};Q.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);A(a,"function",Q,"inherit");A(b,"function",Q,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};Q.None=Wh;Q.Uniform=pj;Q.UniformToFill=qj;Q.CycleAll=$f;Q.CycleNotDirected=dg; Q.CycleNotDirectedFast=fg;Q.CycleNotUndirected=gg;Q.CycleDestinationTree=ag;Q.CycleSourceTree=cg;Q.DocumentScroll=mi;Q.InfiniteScroll=oi;Q.TreeParentCollapsed=Gi;Q.AllParentsCollapsed=Uk;Q.AnyParentsCollapsed=Vk;function Oi(){this.ez=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.af=this.l=!0:this.af=null} function Mj(a,b){b.Lb.setTransform(b.Yb,0,0,b.Yb,0,0);if(null===a.af){b="f";var c=qa[Ya("76a715b2f73f148a")][Ya("72ba13b5")];a.af=!0;if(gh){var d=Q[Ya("76a115b6ed251eaf4692")];if(d)for(var e=Wk.iterator;e.next();){d=e.value;d=Ya(d).split(Ya("39e9"));if(6>d.length)break;var f=Ya(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Ya(ra[Ya("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Ya("76ad18b4f73e")];for(g=c[Ya("73a612b6fb191d")](Ya("35e7"))+2;gf&&Ya(d[2])!==Ya("7da71ca0ad381e90")&&(f=b[Ya("73a612b6fb191d")](Ya("76a715b2ef3e149757")));0>f&&(f=b[Ya("73a612b6fb191d")](Ya("76a715b2ef3e149757")));0>f&&(f=c[Ya("73a612b6fb191d")](Ya("7baa19a6f76c1988428554")));a.af=!(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[Ya("79a417a0f0181a8946")]=d;if(qa.document[Ya("78a712aa")]){qa.document[Ya("78a712aa")][Ya("7bb806b6ed32388c4a875b")](g);h=qa.getComputedStyle(g).getPropertyValue(Ya("78a704b7e62456904c9b12701b6532a8"));qa.document[Ya("78a712aa")][Ya("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.af=!1;break}else if(Za||$a||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.af=!1;break}}}else a.af=null,a.af=!1}}else{k=c[Ya("76ad18b4f73e")];for(e=c[Ya("73a612b6fb191d")](Ya("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.vd++:a.vd=1;c.clickCount=a.vd;a.Pj=b.timeStamp;a.Fo.Ng(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():Aj(a,c,b)}};a.Km=function(b){if(a.isEnabled){a.gg=!0; var c=a.Zj;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=zj(a,b,b,null!==c[1]),c.targetDiagram=wj(b),a.doMouseMove(),Aj(a,c,b))}};a.Mm=function(b){if(a.isEnabled){a.gg=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Ss;if(c&&a.dk)delete d[b.pointerId],b.preventDefault();else if(d=a.Zj,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=yj(a,b,!1, !0,!0,!1);var e=qa.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.B instanceof Q&&e.B!==a&&vj(e.B,b,d);vj(a,b,d);d.clickCount=a.vd;null===e?d.targetDiagram=wj(b):e.B?d.targetDiagram=e.B:d.targetDiagram=null;d.targetObject=null;a.doMouseUp();Aj(a,d,b);c&&(a.we=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.Lm=function(b){if(a.isEnabled){a.gg=!1;var c=a.Ss;c[b.pointerId]&&delete c[b.pointerId];c=a.Zj;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.yc(!0);cj(a)}}Oi.className="DiagramHelper";function mf(a){this.l=void 0===a?new J:a;this.w=new J}ma.Object.defineProperties(mf.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}}});mf.className="DraggingInfo"; function ek(a,b,c){this.node=a;this.info=b;this.bw=c}ek.className="DraggingNodeInfoPair";function ef(){this.reset()}ef.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Hb(NaN,NaN)).freeze();this.gridSnapCellSpot=Hc;this.gridSnapOrigin=(new J(NaN,NaN)).freeze();this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1;this.dragsMembers=this.groupsAlwaysMove=!0};ef.className="DraggingOptions"; function Zk(a){1 b.updateDelay?b.P():b.W||(b.W=!0,setTimeout(function(){b.W=!1;el(b);b.P()},b.updateDelay))};this.Rc=function(){null!==b.observed&&dl(b)};this.autoScale=pj;this.Xb=!1}la(bl,Q);bl.prototype.computePixelRatio=function(){return 1}; bl.prototype.hc=function(){null===this.Ia&&v("No div specified");null===this.ya&&v("No canvas specified");if(!(this.ya instanceof Rj)&&(xi(this.box),this.Hc)){var a=this.observed;if(null!==a&&!a.animationManager.isAnimating){Kj(this);var b=this.ya;a=this.Lb;a.yc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?fl(this):null!==this.bm&&(a.drawImage(this.bm.Ka,0,0),b=this.sb,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&&0===this.position.y||b.translate(-this.position.x, -this.position.y),a.scale(this.Yb,this.Yb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy));b=this.Pa.j;for(var c=b.length,d=0;da&&(a=0);this.ib!==a&&(this.ib=a)}}});bl.className="Overview";function cl(){df.call(this);this.l=null}la(cl,df); cl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||!a.allowMove||!a.allowSelect)return!1;var b=a.observed;if(null===b)return!1;var c=a.lastInput;if(!c.left||a.currentTool!==this&&(!this.isBeyondDragSize()||c.isTouchEvent&&c.timestamp-a.firstInput.timestampb.maxScale||(b.scale=a))}; gl.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);C(a,gl,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Wh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};gl.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);C(a,gl,"increaseZoom:factor");var b=this.diagram;b.autoScale===Wh&&(a=b.scale*a,ab.maxScale||(b.scale=a))}; gl.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);C(a,gl,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Wh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};gl.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);C(a,gl,"resetZoom:newscale");var b=this.diagram;ab.maxScale||(b.scale=a)}; gl.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);C(a,gl,"canResetZoom:newscale");var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; gl.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.dd();a.ge();var c=a.position,d=a.scale;Eh(b,"Zoom To Fit");d===this.Cv&&!isNaN(this.cv)&&a.documentBounds.A(this.Bv)?(a.scale=this.cv,a.position=this.zx,this.Cv=NaN,this.Bv=vc):(this.cv=d,this.zx=c.copy(),a.zoomToFit(),this.Cv=a.scale,this.Bv=a.documentBounds.copy());Gh(b)};gl.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; gl.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&x(a,S,gl,"part");var b=this.diagram;Zi(b);if(null===a){try{null!==this.yg&&(this.yg.next()?a=this.yg.value:this.yg=null)}catch(k){this.yg=null}null===a&&(0a&&(a+=360));return a}; t.Gf=function(){if(0!==(this.I&4096)===!1)return this.kl;var a=this.Fa;return null!==this.panel?a*this.panel.Gf():a};t.Ot=function(a,b){void 0===b&&(b=new J);b.assign(a);this.Cd.ee(b);return b};t.bd=function(a,b,c){return this.wk(a.x,a.y,b.x,b.y,c)}; t.wk=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.bd(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.bd(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!==Hj(this)){var e=this.oh,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 Yf&&(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 U;switch(Al(this,!0)){case Mg:g=e=0;h&&(b=a=Infinity); break;case Hd:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case ll:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case ml: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.vb>a.width)))c=!0;this.I=c?this.I|256:this.I&-257;this.Bb.o()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Bb.toString());this.du(f,this.Bb);Bl(this,!1);L.free(f)};t=N.prototype;t.Nh=function(){}; function Cl(a,b,c,d,e){a.Bb.h(b,c,d,e);if(!a.desiredSize.o()){var f=a.tc;c=a.oh;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=Al(a,!0);c===d&&f===e&&(b=Mg);switch(b){case Mg:if(c>d||f>e)Cj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Hd:Cj(a,!0);a.measure(d,e,0,0);break;case ll:Cj(a,!0);a.measure(d,f,0,0);break;case ml:Cj(a,!0),a.measure(c,e,0,0)}}} t.du=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||Dl(c,!0),this.P(),jc(a,b)||(c.Th(),this.np(c)))};t.np=function(a){null!==this.portId&&(Dl(a,!0),a instanceof T&&El(a,this))}; t.hc=function(a,b){if(this.visible){var c=this instanceof U&&(this.type===U.TableRow||this.type===U.TableColumn),d=this.Bb;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.jy(a,b))if(c)Fl(this,a,b);else{this instanceof R&&this.Ck(!1);F&&F.sm&&F.Kz&&F.Kz(a,this);c=this.transform;var g=this.panel;0!==(this.I&4096)===!0&&Gl(this);var h=this.part,k=!1,l=0;if(h&&b.Re("drawShadows")&&(k=h.isShadowed)){var m= h.shadowOffset;l=Math.max(m.y,m.x)*b.scale*b.Yb}if(!(m=b.Bi||!this.Kf())){var n=this.naturalBounds;m=this.ci;var p=m.m11,r=m.m21,q=m.dx,u=m.m12,w=m.m22,y=m.dy,z,B=z=0;m=z*p+B*r+q;var D=z*u+B*w+y;z=n.width+l;B=0;var G=z*p+B*r+q;z=z*u+B*w+y;B=Math.min(m,G);var O=Math.min(D,z);var V=Math.max(m+0,G)-B;var P=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*w+y;B=Math.min(m,G);O=Math.min(D,z);V=Math.max(m+V,G)-B;P=Math.max(D+P,z)-O;m=B;D=O;z=0;B=n.height+l;G=z*p+B*r+q;z=z*u+B*w+y; B=Math.min(m,G);O=Math.min(D,z);V=Math.max(m+V,G)-B;P=Math.max(D+P,z)-O;m=B;D=O;l=b.viewportBounds;n=l.x;p=l.y;m=!(m>l.width+n||n>V+m||D>l.height+p||p>P+D)}if(m){m=0!==(this.I&256);a.clipInsteadOfFill&&(m=!1);this instanceof ih&&(a.font=this.font);if(m){F&&F.Mz&&Ca("clip"+this.toString());D=g.ke()?g.naturalBounds:g.actualBounds;null!==this.sd?(n=this.sd,V=n.x,P=n.y,l=n.width,n=n.height):(V=Math.max(d.x,D.x),P=Math.max(d.y,D.y),l=Math.min(d.right,D.right)-V,n=Math.min(d.bottom,D.bottom)-P);if(V>d.width+ d.x||d.x>D.width+D.x){1!==e&&(a.globalAlpha=f);return}a.save();a.beginPath();a.rect(V,P,l,n);a.clip()}if(this.Kf()){if(!h.isVisible()){1!==e&&(a.globalAlpha=f);return}k&&(D=h.shadowOffset,a.Kw(D.x*b.scale*b.Yb,D.y*b.scale*b.Yb,h.shadowBlur),Hl(a),a.shadowColor=h.shadowColor)}!0===this.shadowVisible?Hl(a):!1===this.shadowVisible&&Il(a);h=this.naturalBounds;null!==this.jc&&(Ai(this,a,this.jc,!0,!0,h,d),this.jc instanceof Jl&&this.jc.type===Kl?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.de(this.jc)): 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===U.Auto||g.type===U.Spot)&&g.yb()!==this)&&null===this.shadowVisible&&Il(a);null!==this.ob&&(l=this.naturalBounds,V=D=0,P=l.width,l=l.height,n=0,this instanceof Yf&&(l=this.qa.bounds,D=l.x,V=l.y,P=l.width,l=l.height,n=this.strokeWidth),Ai(this,a,this.ob,!0,!1,h,d),this.ob instanceof Jl&&this.ob.type===Kl?(a.beginPath(),a.rect(D-n/2,V-n/2,P+n,l+n),a.de(this.ob)):a.fillRect(D- n/2,V-n/2,P+n,l+n));F&&F.sm&&F.Lz&&F.Lz(a,this);k&&(null!==this.ob||null!==this.jc||null!==g&&0!==(g.I&512)||null!==g&&(g.type===U.Auto||g.type===U.Spot)&&g.yb()!==this)?(Ll(this,!0),null===this.shadowVisible&&Il(a)):Ll(this,!1);this.ej(a,b);k&&0!==(this.I&512)===!0&&Hl(a);this.Kf()&&k&&Il(a);m?(a.restore(),this instanceof U?a.yc(!0):a.yc(!1)):c.Vt()||(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.jy=function(){return!1};function Fl(a,b,c){var d=a.Bb,e=a.uc;null!==a.jc&&(Ai(a,b,a.jc,!0,!0,e,d),a.jc instanceof Jl&&a.jc.type===Kl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.de(a.jc)):b.fillRect(d.x,d.y,d.width,d.height));null!==a.ob&&(Ai(a,b,a.ob,!0,!1,e,d),a.ob instanceof Jl&&a.ob.type===Kl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.de(a.ob)):b.fillRect(d.x,d.y,d.width,d.height));a.ej(b,c)}t.ej=function(){}; function Ai(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===Ml)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var l=0;a instanceof Yf&&(l=a.strokeWidth);h=f.width;k=f.height;e?(h=g.width,k=g.height):d||(h+=l,k+=l);if((f=b instanceof Nl)&&c.pe&&(c.type===Ol||c.al===h&&c.Bu===k))var m=c.pe;else{var n=0,p=0,r=0,q=0,u=0,w=0;w=u=0;e?(u=g.x,w=g.y):d||(u-=l/2,w-=l/2);n=c.start.x*h+c.start.offsetX;p=c.start.y*k+c.start.offsetY;r=c.end.x*h+ c.end.offsetX;q=c.end.y*k+c.end.offsetY;n+=u;r+=u;p+=w;q+=w;if(c.type===Pl)m=b.createLinearGradient(n,p,r,q);else if(c.type===Kl)w=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(u=0,w=Math.max(h,k)/2):u=c.startRadius,m=b.createRadialGradient(n,p,u,r,q,w);else if(c.type===Ol)try{m=b.createPattern(c.pattern,"repeat")}catch(z){m=null}else xa(c.type,"Brush type");if(c.type!==Ol&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)m.addColorStop(e.key,e.value);if(f&&(c.pe=m,null!== m&&(c.al=h,c.Bu=k),null===m&&c.type===Ol&&-1!==c.al)){c.al=-1;var y=a.diagram;null!==y&&-1===c.al&&ta(function(){y.ge()},600)}}d?b.fillStyle=m:b.strokeStyle=m}}}t.Lg=function(a){if(a instanceof U)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.Lf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.Lf():!0}; t.Mg=function(){for(var a=this instanceof U?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; function Gl(a){if(0!==(a.I&2048)===!0){var b=a.sb;b.reset();if(!a.Bb.o()||!a.tc.o()){Ql(a,!1);return}b.translate(a.Bb.x-a.tc.x,a.Bb.y-a.tc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;yl(a,b,c.x,c.y,c.width,c.height)}Ql(a,!1);Rl(a,!0)}0!==(a.I&4096)===!0&&(b=a.panel,null===b?(a.ci.set(a.sb),a.kl=a.scale,Rl(a,!1)):null!==b.Cd&&(c=a.ci,c.reset(),b.ke()?c.multiply(b.ci):null!==b.panel&&c.multiply(b.panel.ci),c.multiply(a.sb),a.kl=a.scale*b.kl,Rl(a,!1)))} function yl(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.dc){var g=Mc;a.Kf()&&a.locationSpot.bb()&&(g=a.locationSpot);var h=J.alloc();if(a instanceof S&&a.locationObject!==a)for(c=a.locationObject,d=c.naturalBounds,h.Lk(d.x,d.y,d.width,d.height,g),c.kg.xa(h),h.offset(-c.measuredBounds.x,-c.measuredBounds.y),g=c.panel;null!==g&&g!==a;)g.kg.xa(h),h.offset(-g.measuredBounds.x,-g.measuredBounds.y),g=g.panel;else h.Lk(c,d,e,f,g);b.rotate(a.dc,h.x,h.y);J.free(h)}} t.u=function(a){void 0===a&&(a=!1);if(!0!==Hj(this)){Cj(this,!0);Bl(this,!0);var b=this.panel;null===b||a||b.u()}};t.Fm=function(){!0!==Hj(this)&&(Cj(this,!0),Bl(this,!0))};function Sl(a){if(!1===Ij(a)){var b=a.panel;null!==b?b.u():a.Kf()&&(b=a.diagram,null!==b&&(b.ud.add(a),a instanceof T&&a.md(),b.Hb()));Bl(a,!0)}}t.Bl=function(){0!==(this.I&2048)===!1&&(Ql(this,!0),Rl(this,!0))};t.fw=function(){Rl(this,!0)};t.P=function(){var a=this.part;null!==a&&a.P()}; function Al(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===U.Table)return Tl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===U.Auto&&d.yb()===a)return Ul(a,Hd,b);if(c===kl){if(null!==d){if(d.type===U.Spot&&d.yb()===a)return Ul(a,Hd,b);c=d.defaultStretch;return c===kl?Ul(a,Mg,b):Ul(a,c,b)}return Ul(a,Mg,b)}return Ul(a,c,b)} function Tl(a,b,c,d){var e=a.stretch;if(e!==kl)return Ul(a,e,d);var f=e=null;switch(b.stretch){case ml:f=!0;break;case Hd:f=!0}switch(c.stretch){case ll:e=!0;break;case Hd:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===ll||b===Hd);null===f&&(f=b===ml||b===Hd);return!0===e&&!0===f?Ul(a,Hd,d):!0===e?Ul(a,ll,d):!0===f?Ul(a,ml,d):Ul(a,Mg,d)} function Ul(a,b,c){if(c)return b;if(b===Mg)return Mg;c=a.desiredSize;if(c.o())return Mg;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===ll)return Mg;if(b===Hd)return ml}else{if(b===ml)return Mg;if(b===Hd)return ll}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===ml)return Mg;if(b===Hd)return ll}else{if(b===ll)return Mg;if(b===Hd)return ml}return b}function Ll(a,b){a.I=b?a.I|512:a.I&-513}function ul(a){return 0!==(a.I&1024)}function Vl(a,b){a.I=b?a.I|1024:a.I&-1025} function Ql(a,b){a.I=b?a.I|2048:a.I&-2049}function Rl(a,b){a.I=b?a.I|4096:a.I&-4097}function Hj(a){return 0!==(a.I&8192)}function Cj(a,b){a.I=b?a.I|8192:a.I&-8193}function Ij(a){return 0!==(a.I&16384)}function Bl(a,b){a.I=b?a.I|16384:a.I&-16385}t.rj=function(a){this.wg=a};t.nu=function(){};t.Gw=function(a){this.sa.assign(a);Sl(this);return!0};t.ir=function(a,b){if(this.sa.x!==a||this.sa.y!==b)this.sa.h(a,b),this.Bl()}; function Wl(a){var b=a.part;if(b instanceof T&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||El(b,a)}}function Xl(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof U?a instanceof T?a.md():a.Nk(a,function(a){Wl(a)}):Wl(a))}t.bind=function(a){a.jd=this;var b=this.ij();null!==b&&Yl(b)&&v("Cannot add a Binding to a template that has already been copied: "+a);null===this.jb&&(this.jb=new H);this.jb.add(a)}; t.ij=function(){for(var a=this instanceof U?this:this.panel;null!==a;){if(null!==a.pi)return a;a=a.panel}return null};t.Hw=function(a){Oj(this,a)};function Zl(a,b){b.jd=a;null===a.Sg&&(a.Sg=new Db);a.Sg.add(b.propertyName,b)} function $l(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]);Oj(a,e)}else Oj(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function em(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);am.add(a,b)} function fm(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.am},set:function(a){var b=this.am;b!==a&&(F&&null!==a&&A(a,"boolean",N,"shadowVisible"),this.am=a,this.P(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.R?this.R.Xn:null},set:function(a){rl(this);var b=this.R.Xn;b!==a&&(null!==a&&A(a,"function",N,"enabledChanged"),this.R.Xn=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0, enumerable:!0,get:function(){return this.Zl},set:function(a){var b=this.Zl;b!==a&&(F&&hb(a,R,N,"segmentOrientation"),this.Zl=a,this.u(),this.g("segmentOrientation",b,a),a===og&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return this.Rp},set:function(a){F&&A(a,"number",N,"segmentIndex");a=Math.round(a);var b=this.Rp;b!==a&&(this.Rp=a,this.u(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return this.Xl},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.Fa=a,this.u(),this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.dc},set:function(a){var b=this.dc;b!==a&&(F&&C(a,N,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.dc= a,Xl(this),this.u(),this.g("angle",b,a)))}},desiredSize:{configurable:!0,get:function(){return this.Uc},set:function(a){F&&x(a,Hb,N,"desiredSize");var b=a.width,c=a.height,d=this.Uc,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Uc=a=a.J(),this.u(),this instanceof Yf&&this.ic(),this.g("desiredSize",d,a),ul(this)&&(a=this.part,null!==a&&(vl(this,a,"width"),vl(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.Uc.width}, set:function(a){var b=this.Uc.width;b===a||isNaN(b)&&isNaN(a)||(F&&A(a,"number",N,"width"),b=this.Uc,this.Uc=a=(new Hb(a,this.Uc.height)).freeze(),this.u(),this instanceof Yf&&this.ic(),this.g("desiredSize",b,a),ul(this)&&(a=this.part,null!==a&&vl(this,a,"width")))}},height:{configurable:!0,get:function(){return this.Uc.height},set:function(a){var b=this.Uc.height;b===a||isNaN(b)&&isNaN(a)||(F&&A(a,"number",N,"height"),b=this.Uc,this.Uc=a=(new Hb(this.Uc.width,a)).freeze(),this.u(), this instanceof Yf&&this.ic(),this.g("desiredSize",b,a),ul(this)&&(a=this.part,null!==a&&vl(this,a,"height")))}},minSize:{configurable:!0,get:function(){return this.ng},set:function(a){var b=this.ng;b.A(a)||(F&&x(a,Hb,N,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.ng=a,this.u(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return this.mg},set:function(a){var b=this.mg;b.A(a)||(F&&x(a,Hb,N,"maxSize"), a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.mg=a,this.u(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.tc}},naturalBounds:{configurable:!0,get:function(){return this.uc}},margin:{configurable:!0,get:function(){return this.oh},set:function(a){"number"===typeof a?a=new lc(a):F&&x(a,lc,N,"margin");var b=this.oh;b.A(a)||(this.oh=a=a.J(),this.u(),this.g("margin",b,a))}}, transform:{configurable:!0,get:function(){0!==(this.I&2048)===!0&&Gl(this);return this.sb}},Cd:{configurable:!0,get:function(){0!==(this.I&4096)===!0&&Gl(this);return this.ci}},alignment:{configurable:!0,get:function(){return this.Cb},set:function(a){var b=this.Cb;b.A(a)||(F&&x(a,M,N,"alignment"),a.Tb()&&!a.Gb()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Cb=a=a.J(),Sl(this),this.g("alignment",b,a))}},column:{configurable:!0, enumerable:!0,get:function(){return this.Xg},set:function(a){F&&C(a,N,"column");a=Math.round(a);var b=this.Xg;b!==a&&(0>a&&ya(a,">= 0",N,"column"),this.Xg=a,this.u(),this.g("column",b,a))}},columnSpan:{configurable:!0,get:function(){return this.An},set:function(a){F&&A(a,"number",N,"columnSpan");a=Math.round(a);var b=this.An;b!==a&&(1>a&&ya(a,">= 1",N,"columnSpan"),this.An=a,this.u(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.Kp},set:function(a){F&& C(a,N,"row");a=Math.round(a);var b=this.Kp;b!==a&&(0>a&&ya(a,">= 0",N,"row"),this.Kp=a,this.u(),this.g("row",b,a))}},rowSpan:{configurable:!0,get:function(){return this.Lp},set:function(a){F&&A(a,"number",N,"rowSpan");a=Math.round(a);var b=this.Lp;b!==a&&(1>a&&ya(a,">= 1",N,"rowSpan"),this.Lp=a,this.u(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return this.eq},set:function(a){var b=this.eq;b!==a&&(null!==a&&A(a,"function",N,"spanAllocation"), this.eq=a,this.u(),this.g("spanAllocation",b,a))}},alignmentFocus:{configurable:!0,get:function(){return this.Uk},set:function(a){var b=this.Uk;b.A(a)||(F&&x(a,M,N,"alignmentFocus"),!F||!a.Tb()||a.Gb()||a.Rq()&&this instanceof T||v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Uk=a=a.J(),this.u(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.yp},set:function(a){var b=this.yp;if(b!==a){F&&null!==a&&A(a, "string",N,"portId");var c=this.part;null===c||c instanceof T||(v("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&hm(c,this);this.yp=a;null!==a&&null!==c&&(c.Sh=!0,im(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0,get:function(){return null!==this.S?this.S.Gh:Gc},set:function(a){this.Mc();var b=this.S.Gh;b.A(a)||(F&&x(a,M,N,"toSpot"),a=a.J(),this.S.Gh=a,this.g("toSpot",b,a),Wl(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!== this.S?this.S.Eh:10},set:function(a){this.Mc();var b=this.S.Eh;b!==a&&(F&&A(a,"number",N,"toEndSegmentLength"),0>a&&ya(a,">= 0",N,"toEndSegmentLength"),this.S.Eh=a,this.g("toEndSegmentLength",b,a),Wl(this))}},toShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.Fh:0},set:function(a){this.Mc();var b=this.S.Fh;b!==a&&(F&&A(a,"number",N,"toShortLength"),this.S.Fh=a,this.g("toShortLength",b,a),Wl(this))}},toLinkable:{configurable:!0,get:function(){return null!== this.S?this.S.nq:null},set:function(a){this.Mc();var b=this.S.nq;b!==a&&(F&&null!==a&&A(a,"boolean",N,"toLinkable"),this.S.nq=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!==this.S?this.S.oq:Infinity},set:function(a){this.Mc();var b=this.S.oq;b!==a&&(F&&A(a,"number",N,"toMaxLinks"),0>a&&ya(a,">= 0",N,"toMaxLinks"),this.S.oq=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.S?this.S.hh:Gc},set:function(a){this.Mc(); var b=this.S.hh;b.A(a)||(F&&x(a,M,N,"fromSpot"),a=a.J(),this.S.hh=a,this.g("fromSpot",b,a),Wl(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.S?this.S.fh:10},set:function(a){this.Mc();var b=this.S.fh;b!==a&&(F&&A(a,"number",N,"fromEndSegmentLength"),0>a&&ya(a,">= 0",N,"fromEndSegmentLength"),this.S.fh=a,this.g("fromEndSegmentLength",b,a),Wl(this))}},fromShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.gh:0},set:function(a){this.Mc(); var b=this.S.gh;b!==a&&(F&&A(a,"number",N,"fromShortLength"),this.S.gh=a,this.g("fromShortLength",b,a),Wl(this))}},fromLinkable:{configurable:!0,get:function(){return null!==this.S?this.S.eo:null},set:function(a){this.Mc();var b=this.S.eo;b!==a&&(F&&null!==a&&A(a,"boolean",N,"fromLinkable"),this.S.eo=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0,get:function(){return null!==this.S?this.S.fo:Infinity},set:function(a){this.Mc();var b=this.S.fo;b!==a&&(F&& A(a,"number",N,"fromMaxLinks"),0>a&&ya(a,">= 0",N,"fromMaxLinks"),this.S.fo=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0,get:function(){return this.ti},set:function(a){var b=this.ti;b!==a&&(A(a,"string",N,"cursor"),this.ti=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.R?this.R.Wf:null},set:function(a){rl(this);var b=this.R.Wf;b!==a&&(null!==a&&A(a,"function",N,"click"),this.R.Wf=a,this.g("click",b,a))}},doubleClick:{configurable:!0, enumerable:!0,get:function(){return null!==this.R?this.R.ag:null},set:function(a){rl(this);var b=this.R.ag;b!==a&&(null!==a&&A(a,"function",N,"doubleClick"),this.R.ag=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.R?this.R.Xf:null},set:function(a){rl(this);var b=this.R.Xf;b!==a&&(null!==a&&A(a,"function",N,"contextClick"),this.R.Xf=a,this.g("contextClick",b,a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.R? this.R.pg:null},set:function(a){rl(this);var b=this.R.pg;b!==a&&(null!==a&&A(a,"function",N,"mouseEnter"),this.R.pg=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.R?this.R.sg:null},set:function(a){rl(this);var b=this.R.sg;b!==a&&(null!==a&&A(a,"function",N,"mouseLeave"),this.R.sg=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0,get:function(){return null!==this.R?this.R.tg:null},set:function(a){rl(this);var b=this.R.tg; b!==a&&(null!==a&&A(a,"function",N,"mouseOver"),this.R.tg=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.R?this.R.rg:null},set:function(a){rl(this);var b=this.R.rg;b!==a&&(null!==a&&A(a,"function",N,"mouseHover"),this.R.rg=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return null!==this.R?this.R.qg:null},set:function(a){rl(this);var b=this.R.qg;b!==a&&(null!==a&&A(a,"function",N,"mouseHold"),this.R.qg= a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0,get:function(){return null!==this.R?this.R.Zo:null},set:function(a){rl(this);var b=this.R.Zo;b!==a&&(null!==a&&A(a,"function",N,"mouseDragEnter"),this.R.Zo=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0,get:function(){return null!==this.R?this.R.$o:null},set:function(a){rl(this);var b=this.R.$o;b!==a&&(null!==a&&A(a,"function",N,"mouseDragLeave"),this.R.$o=a,this.g("mouseDragLeave",b,a))}}, mouseDrop:{configurable:!0,get:function(){return null!==this.R?this.R.og:null},set:function(a){rl(this);var b=this.R.og;b!==a&&(null!==a&&A(a,"function",N,"mouseDrop"),this.R.og=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!==this.R?this.R.hn:null},set:function(a){rl(this);var b=this.R.hn;b!==a&&(null!==a&&A(a,"function",N,"actionDown"),this.R.hn=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!== this.R?this.R.jn:null},set:function(a){rl(this);var b=this.R.jn;b!==a&&(null!==a&&A(a,"function",N,"actionMove"),this.R.jn=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.R?this.R.kn:null},set:function(a){rl(this);var b=this.R.kn;b!==a&&(null!==a&&A(a,"function",N,"actionUp"),this.R.kn=a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.R?this.R.gn:null},set:function(a){rl(this);var b=this.R.gn; b!==a&&(null!==a&&A(a,"function",N,"actionCancel"),this.R.gn=a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.R?this.R.Dg:null},set:function(a){rl(this);var b=this.R.Dg;b!==a&&(!F||null===a||a instanceof Te||a instanceof bf||v("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.R.Dg=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.R?this.R.Yf:null},set:function(a){rl(this);var b= this.R.Yf;b!==a&&(!F||a instanceof Te||a instanceof bf||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.R.Yf=a,this.g("contextMenu",b,a))}}});N.prototype.setProperties=N.prototype.Hw;N.prototype.findTemplateBinder=N.prototype.ij;N.prototype.bind=N.prototype.bind;N.prototype.isEnabledObject=N.prototype.Mg;N.prototype.isVisibleObject=N.prototype.Lf;N.prototype.isContainedBy=N.prototype.Lg;N.prototype.getNearestIntersectionPoint=N.prototype.bd;N.prototype.getLocalPoint=N.prototype.Ot; N.prototype.getDocumentScale=N.prototype.Gf;N.prototype.getDocumentAngle=N.prototype.lj;N.prototype.getDocumentBounds=N.prototype.Cm;N.prototype.getDocumentPoint=N.prototype.ma;N.prototype.intersectsRect=N.prototype.Oc;N.prototype.containedInRect=N.prototype.Oh;N.prototype.containsRect=N.prototype.Pe;N.prototype.containsPoint=N.prototype.fa;N.prototype.raiseChanged=N.prototype.g;N.prototype.raiseChangedEvent=N.prototype.gb;N.prototype.addCopyProperty=N.prototype.Ux;var am=null;N.className="GraphObject"; am=new Db; em("Button",function(){function a(a,b){return null!==a.diagram.$b(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=$l(U,U.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof U){var c=a.fb("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"},$l(Yf,{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.Mg()&&b instanceof U&&(a=b.fb("ButtonBorder"),a instanceof Yf)){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.Mg()&& b instanceof U&&(a=b.fb("ButtonBorder"),a instanceof Yf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Mg()&&b instanceof U&&null!==b._buttonFillPressed&&0===a.button){var c=b.fb("ButtonBorder");if(c instanceof Yf){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.Mg()&& d instanceof U&&null!==d._buttonFillPressed&&0===b.button){var c=d.fb("ButtonBorder");if(c instanceof Yf){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.Mg()&&d instanceof U&&null!==d._buttonFillPressed){var c=d.fb("ButtonBorder");if(c instanceof Yf){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.Mg()&&d instanceof U&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.fb("ButtonBorder"),b instanceof Yf))){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}); em("TreeExpanderButton",function(){var a=$l("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},$l(Yf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:$b},(new $i("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).Yq()),{visible:!1},(new $i("visible","isTreeLeaf",function(a){return!a})).Yq());a.click=function(a,c){c=c.part;c instanceof Te&&(c=c.adornedPart);if(c instanceof T){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}); em("SubGraphExpanderButton",function(){var a=$l("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},$l(Yf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:$b},(new $i("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).Yq()));a.click=function(a,c){c=c.part;c instanceof Te&&(c=c.adornedPart);if(c instanceof Hf){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});em("ToolTip",function(){return $l(Te,U.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},$l(Yf,{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)}))}); em("ContextMenu",function(){return $l(Te,U.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},new $i("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});em("ContextMenuButton",function(){var a=$l("Button");a.stretch=ll;var b=a.fb("ButtonBorder");b instanceof Yf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new M(0,0,2,3),b.spot2=new M(1,1,-2,-2));return a}); em("PanelExpanderButton",function(a){var b=fm(a,"COLLAPSIBLE"),c=$l("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},$l(Yf,{name:"ButtonIcon",strokeWidth:2},(new $i("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Yq(b))); a=c.fb("ButtonBorder");a instanceof Yf&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!==d&&!d.isReadOnly){var e=c.ij();null===e&&(e=c.part);null!==e&&(c=e.fb(b),null!==c&&(a.handled=!0,d.Ba("Collapse/Expand Panel"),c.visible=!c.visible,d.ab("Collapse/Expand Panel")))}};return c}); em("CheckBoxButton",function(a){var b=fm(a);a=$l("Button",{desiredSize:new Hb(14,14)},$l(Yf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Hd,geometryStretch:Og,visible:!1},""!==b?(new $i("visible",b)).Fy():[]));a.click=function(a,d){if(d instanceof U){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.fb("ButtonIcon");c.Ba("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.ab("checkbox")}}};return a}); em("CheckBox",function(a){a=fm(a);a=$l("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new lc(0,1,0,0)});var b=$l(U,"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=Mg=new E(N,"None",0);N.Default=kl=new E(N,"Default",0);N.Vertical=ml=new E(N,"Vertical",4);N.Horizontal=ll=new E(N,"Horizontal",5);N.Fill=Hd=new E(N,"Fill",3);N.Uniform=Og=new E(N,"Uniform",1); N.UniformToFill=nl=new E(N,"UniformToFill",2);N.FlipVertical=ol=new E(N,"FlipVertical",1);N.FlipHorizontal=pl=new E(N,"FlipHorizontal",2);N.FlipBoth=ql=new E(N,"FlipBoth",3);N.make=$l;N.getBuilders=function(){var a=new Db,b;for(b in am)if(b!==b.toLowerCase()){var c=am.K(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};N.defineBuilder=em;N.takeBuilderArgument=fm; function sl(){this.Xn=this.Yf=this.Dg=this.gn=this.kn=this.jn=this.hn=this.og=this.$o=this.Zo=this.qg=this.rg=this.tg=this.sg=this.pg=this.Xf=this.ag=this.Wf=null}sl.prototype.copy=function(){var a=new sl;a.Wf=this.Wf;a.ag=this.ag;a.Xf=this.Xf;a.pg=this.pg;a.sg=this.sg;a.tg=this.tg;a.rg=this.rg;a.qg=this.qg;a.Zo=this.Zo;a.$o=this.$o;a.og=this.og;a.hn=this.hn;a.jn=this.jn;a.kn=this.kn;a.gn=this.gn;a.Dg=this.Dg;a.Yf=this.Yf;a.Xn=this.Xn;return a};sl.className="GraphObjectEventHandlers"; function jm(){this.Ra=[1,0,0,1,0,0]}jm.prototype.copy=function(){var a=new jm;a.Ra[0]=this.Ra[0];a.Ra[1]=this.Ra[1];a.Ra[2]=this.Ra[2];a.Ra[3]=this.Ra[3];a.Ra[4]=this.Ra[4];a.Ra[5]=this.Ra[5];return a};jm.prototype.translate=function(a,b){this.Ra[4]+=this.Ra[0]*a+this.Ra[2]*b;this.Ra[5]+=this.Ra[1]*a+this.Ra[3]*b};jm.prototype.scale=function(a,b){this.Ra[0]*=a;this.Ra[1]*=a;this.Ra[2]*=b;this.Ra[3]*=b};jm.className="STransform"; function km(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.ay=[];this.pattern=null}km.prototype.addColorStop=function(a,b){this.ay.push({offset:a,color:b})};km.className="SGradient"; function Rj(a,b){this.ownerDocument=a=void 0===b?qa.document:b;this.IA="http://www.w3.org/2000/svg";void 0!==a&&(this.Ka=this.Ab("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Ka.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Ka.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.Eq=null;this.context=new lm(this)} Rj.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.Ka.setAttributeNS(null,"width",c+"px"),this.Ka.setAttributeNS(null,"height",d+"px"),this.Ka.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.ev.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.ev.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Rj.prototype.Ab=function(a,b,c){a=this.ownerDocument.createElementNS(this.IA,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};Rj.prototype.getBoundingClientRect=function(){return this.Ka.getBoundingClientRect()};Rj.prototype.focus=function(){this.Ka.focus()};Rj.prototype.iy=function(){this.ownerDocument=null}; ma.Object.defineProperties(Rj.prototype,{width:{configurable:!0,get:function(){return this.Ka.width.baseVal.value},set:function(a){this.Ka.width=a}},height:{configurable:!0,get:function(){return this.Ka.height.baseVal.value},set:function(a){this.Ka.height=a}},style:{configurable:!0,get:function(){return this.Ka.style}}});Rj.className="SVGSurface"; function lm(a){this.Mk=a;this.svg=a.Ka;this.stack=[];this.Ec=[];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.rf=this.$p=this.Zp=0;this.Sq=null;this.path=[];this.Wu=!1;this.zh=null;this.Ah=0;this.ce=new jm; mm(this,1,0,0,1,0,0);var b=wb++,c=this.Ab("clipPath",{id:"mainClip"+b});c.appendChild(this.Ab("rect",{x:0,y:0,width:a.width,height:a.height}));this.ev=c;this.Mk.Ka.appendChild(c);this.Ec[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.KA={}}t=lm.prototype; t.reset=function(){this.stack=[];this.Ec=[];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.rf=this.$p=this.Zp=0;this.Sq=null;this.path=[];this.ce=new jm;mm(this,1,0,0,1,0,0);var a=wb++,b=this.Ab("clipPath", {id:"mainClip"+a});b.appendChild(this.Ab("rect",{x:0,y:0,width:this.Mk.width,height:this.Mk.height}));this.ev=b;this.Mk.Ka.appendChild(b);this.Ec[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.ce);this.addPath("clipPath",this.path,new jm)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new km("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.KA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+wb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.Ab("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.Ab("image",e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new km("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;a={x:0,y:0,width:m||d,height:n||e,href:l};K.ca(d,h)&&K.ca(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio= "xMidYMid slice"):a.preserveAspectRatio="none";l="";h/=d;k/=e;if(0!==f||0!==g)l+=" translate("+f+", "+g+")";if(1!==h||1!==k)l+=" scale("+h+", "+k+")";if(0!==b||0!==c)l+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+wb++,g=this.Ab("clipPath",{id:f}),g.appendChild(this.Ab("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),a["clip-path"]="url(#"+f+")";nm(this,"image",a,this.ce,l);this.addElement("image",a)};t.fill=function(){this.addPath("fill",this.path,this.ce)}; t.de=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]};nm(this,"fill",a,this.ce);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};nm(this,"fill",b,this.ce);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.ce=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;mm(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.Kf()&&!this.isVisible())return!0;a.ce.Ra=[1,0,0,1,0,0];(this instanceof ih&&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.zn?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.zn?this.clip():this.fill()};t.uj=function(){this.zn||this.stroke()};t.Kw=function(a,b,c){this.Zp=a;this.$p=b;this.rf=c}; t.Ht=function(a,b){var c=this.aa;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Ft=function(){var a=this.aa;void 0!==a.setLineDash&&(a.setLineDash(pm),a.lineDashOffset=0)};t.yc=function(a){a&&(this.zu="");this.yu=this.Au=""}; ma.Object.defineProperties(Nl.prototype,{fillStyle:{configurable:!0,get:function(){return this.aa.fillStyle},set:function(a){this.yu!==a&&(this.yu=this.aa.fillStyle=a)}},font:{configurable:!0,get:function(){return this.aa.font},set:function(a){this.zu!==a&&(this.zu=this.aa.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.aa.globalAlpha},set:function(a){this.aa.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.aa.lineCap}, set:function(a){this.aa.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.aa.lineDashOffset},set:function(a){this.aa.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.aa.lineJoin},set:function(a){this.aa.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.aa.lineWidth},set:function(a){this.aa.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.aa.miterLimit},set:function(a){this.aa.miterLimit= a}},shadowBlur:{configurable:!0,get:function(){return this.aa.shadowBlur},set:function(a){this.aa.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.aa.shadowColor},set:function(a){this.aa.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.aa.shadowOffsetX},set:function(a){this.aa.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.aa.shadowOffsetY},set:function(a){this.aa.shadowOffsetY= a}},strokeStyle:{configurable:!0,get:function(){return this.aa.strokeStyle},set:function(a){this.Au!==a&&(this.Au=this.aa.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.aa.textAlign},set:function(a){this.aa.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.aa.imageSmoothingEnabled},set:function(a){this.aa.imageSmoothingEnabled=a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.zn}, set:function(a){this.zn=a}}});var pm=Object.freeze([]);Nl.className="CanvasSurfaceContext";function qm(){this.W=this.w=this.L=this.l=0}qm.className="ColorNumbers"; function Jl(a){F&&1a)&&ya(a,"0 <= loc <= 1",Jl,"addColorStop:loc");A(b,"string",Jl,"addColorStop:color");F&&!tm(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.oe&&(this.oe=new Db);this.oe.add(a,b);this.ta===Ml&&(this.type=Pl);this.pe=null;return this}; function tm(a){if("black"===a)return!0;if(""===a)return!1;F&&A(a,"string",Jl,"isValidColor");rm||(sm(),rm=!0);var b=um;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.CA=function(a,b){this.s&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?vm:b;if(this.type===Ml)hi(this.color),this.color=wm(a,b);else if((this.type===Pl||this.type===Kl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)hi(c.value),this.addColorStop(c.key,wm(a,b));return this};function xm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?vm:c;hi(a);return wm(b,c)} t.Cz=function(a,b){this.s&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?vm:b;if(this.type===Ml)hi(this.color),this.color=wm(-a,b);else if((this.type===Pl||this.type===Kl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)hi(c.value),this.addColorStop(c.key,wm(-a,b));return this};function ym(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?vm:c;hi(a);return wm(-b,c)} function zm(a,b,c){hi(a);a=Am.l;var d=Am.L,e=Am.w,f=Am.W;hi(b);void 0===c&&(c=.5);return"rgba("+Math.round((Am.l-a)*c+a)+", "+Math.round((Am.L-d)*c+d)+", "+Math.round((Am.w-e)*c+e)+", "+Math.round((Am.W-f)*c+f)+")"} t.Dy=function(){if(this.type===Ml)return Bm(this.color);if((this.type===Pl||this.type===Kl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===Kl)return Bm(a.first().value);if(null!==a.get(.5))return Bm(a.get(.5));if(2===a.count)return a=a.ua(),Bm(zm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h=e&&hd&&(f=c,c=d,d=f,f=e);e=d-c;return Bm(zm(a.get(c),a.get(d),1-f/e))}return!1}; function Bm(a){if(!a)return!1;if(a instanceof Jl)return a.Dy();hi(a);return 128>(299*Am.l+587*Am.L+114*Am.w)/1E3} function wm(a,b){switch(b){case vm:b=100*Cm(Am.l);var c=100*Cm(Am.L),d=100*Cm(Am.w);Dm.l=.4124564*b+.3575761*c+.1804375*d;Dm.L=.2126729*b+.7151522*c+.072175*d;Dm.w=.0193339*b+.119192*c+.9503041*d;Dm.W=Am.W;b=Em(Dm.l/Fm[0]);c=Em(Dm.L/Fm[1]);d=Em(Dm.w/Fm[2]);Gm.l=116*c-16;Gm.L=500*(b-c);Gm.w=200*(c-d);Gm.W=Dm.W;Gm.l=Math.min(100,Math.max(0,Gm.l+100*a));a=(Gm.l+16)/116;b=a-Gm.w/200;Dm.l=Fm[0]*Hm(Gm.L/500+a);Dm.L=Fm[1]*(Gm.l>Im*Jm?Math.pow(a,3):Gm.l/Im);Dm.w=Fm[2]*Hm(b);Dm.W=Gm.W;a=-.969266*Dm.l+1.8760108* Dm.L+.041556*Dm.w;b=.0556434*Dm.l+-.2040259*Dm.L+1.0572252*Dm.w;Am.l=255*Km((3.2404542*Dm.l+-1.5371385*Dm.L+-.4985314*Dm.w)/100);Am.L=255*Km(a/100);Am.w=255*Km(b/100);Am.W=Dm.W;Am.l=Math.round(Am.l);255Am.l&&(Am.l=0);Am.L=Math.round(Am.L);255Am.L&&(Am.L=0);Am.w=Math.round(Am.w);255Am.w&&(Am.w=0);return"rgba("+Am.l+", "+Am.L+", "+Am.w+", "+Am.W+")";case Lm:return ii(),ji.w=Math.min(100,Math.max(0,ji.w+100*a)),"hsla("+ji.l+", "+ji.L+"%, "+ji.w+"%, "+ ji.W+")";default:return v("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}function hi(a){rm||(sm(),rm=!0);var b=um;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,Am.l=a[0],Am.L=a[1],Am.w=a[2],Am.W=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'),Am.l=0,Am.L=0,Am.w=0,Am.W=1)}} function ii(){var a=Am.l/255,b=Am.L/255,c=Am.w/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}ji.l=Math.round(g);ji.L=Math.round(100*a);ji.w=Math.round(100*e);ji.W=Am.W}function Cm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Km(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function Em(a){return a>Jm?Math.pow(a,1/3):(Im*a+16)/116}function Hm(a){var b=a*a*a;return b>Jm?b:(116*a-16)/Im}function gm(a,b){"string"===typeof a?F&&!tm(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof Jl||v("Value for "+b+" must be a color string or a Brush, not "+a)}function sm(){um=gh?(new Rk(null)).context:null} ma.Object.defineProperties(Jl.prototype,{type:{configurable:!0,get:function(){return this.ta},set:function(a){this.s&&va(this,a);hb(a,Jl,Jl,"type");this.ta=a;this.start.Tb()&&(a===Pl?this.start=Ic:a===Kl&&(this.start=Mc));this.end.Tb()&&(a===Pl?this.end=Pc:a===Kl&&(this.end=Mc));this.pe=null}},color:{configurable:!0,get:function(){return this.$k},set:function(a){this.s&&va(this,a);F&&!tm(a)&&v('Color "'+a+'" is not a valid color string for Brush.color');this.$k=a;this.pe= null}},start:{configurable:!0,get:function(){return this.Ad},set:function(a){this.s&&va(this,a);x(a,M,Jl,"start");this.Ad=a.J();this.pe=null}},end:{configurable:!0,get:function(){return this.ml},set:function(a){this.s&&va(this,a);x(a,M,Jl,"end");this.ml=a.J();this.pe=null}},startRadius:{configurable:!0,get:function(){return this.nt},set:function(a){this.s&&va(this,a);C(a,Jl,"startRadius");0>a&&ya(a,">= zero",Jl,"startRadius");this.nt=a;this.pe=null}},endRadius:{configurable:!0, enumerable:!0,get:function(){return this.$r},set:function(a){this.s&&va(this,a);C(a,Jl,"endRadius");0>a&&ya(a,">= zero",Jl,"endRadius");this.$r=a;this.pe=null}},colorStops:{configurable:!0,get:function(){return this.oe},set:function(a){this.s&&va(this,a);F&&x(a,Db,Jl,"colorStops");this.oe=a;this.pe=null}},pattern:{configurable:!0,get:function(){return this.Qs},set:function(a){this.s&&va(this,a);this.Qs=a;this.pe=null}}});Jl.prototype.isDark=Jl.prototype.Dy; Jl.prototype.darkenBy=Jl.prototype.Cz;Jl.prototype.lightenBy=Jl.prototype.CA;Jl.prototype.addColorStop=Jl.prototype.addColorStop;var Jm=216/24389,Im=24389/27,Fm=[95.047,100,108.883],um=null,Am=new qm,ji=new qm,Dm=new qm,Gm=new qm,rm=!1;Jl.className="Brush";var Ml;Jl.Solid=Ml=new E(Jl,"Solid",0);var Pl;Jl.Linear=Pl=new E(Jl,"Linear",1);var Kl;Jl.Radial=Kl=new E(Jl,"Radial",2);var Ol;Jl.Pattern=Ol=new E(Jl,"Pattern",4);var vm;Jl.Lab=vm=new E(Jl,"Lab",5);var Lm;Jl.HSL=Lm=new E(Jl,"HSL",6); Jl.randomColor=function(a,b){void 0===a&&(a=128);F&&(C(a,Jl,"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};Jl.isValidColor=tm;Jl.lighten=function(a){return xm(a)};Jl.lightenBy=xm;Jl.darken=function(a){return ym(a)};Jl.darkenBy=ym;Jl.mix=zm;Jl.isDark=Bm;function dm(){this.name="Base"}dm.prototype.measure=function(){};dm.prototype.FA=function(a,b,c,d,e){a.measure(b,c,d,e)};dm.prototype.arrange=function(){};dm.prototype.qz=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};dm.prototype.hc=function(){};ma.Object.defineProperties(dm.prototype,{classType:{configurable:!0,get:function(){return U}}}); dm.prototype.arrangeElement=dm.prototype.qz;dm.prototype.measureElement=dm.prototype.FA;dm.className="PanelLayout";function Mm(){this.name="Base"}la(Mm,dm); Mm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Nm(a);for(var k=0;kY&&(yb=Math.max(Y-Ih,0));var Ln=0===X.actual;X.actual=X.actual+yb;Y=Math.max(Y-(yb+(Ln?Ih:0)),0)}if(1===Qc.columnSpan&&(Yb===Mg||Yb===ml)){X=a.getColumnDefinition(Kc);var xg=X.Ac();yb=Math.max(hd-X.actual,0);yb+xg>ca&&(yb=Math.max(ca-xg,0));var pk=0===X.actual;X.actual=X.actual+yb;ca=Math.max(ca-(yb+(pk?xg:0)),0)}Of&&Qc.Fm()}}}}}Oa(D); var pc=0,$c=0;h=a.columnCount;for(var tc=0;tc=a.rowCount);Ae++)X=a.getRowDefinition(ab.row+Ae),yb=0,yb=Yb===Hd||Yb===ml?Math.max(X.minimum,0===id[ab.row+Ae]?X.maximum:Math.min(id[ab.row+Ae],X.maximum)):Math.max(X.minimum,isNaN(X.Xc)? X.maximum:Math.min(X.Xc,X.maximum)),Rd.height+=yb;for(var Be=1;Be=a.columnCount);Be++)X=a.getColumnDefinition(ab.column+Be),yb=0,yb=Yb===Hd||Yb===ll?Math.max(X.minimum,0===ye[ab.column+Be]?X.maximum:Math.min(ye[ab.column+Be],X.maximum)):Math.max(X.minimum,isNaN(X.Xc)?X.maximum:Math.min(X.Xc,X.maximum)),Rd.width+=yb;qb.width+=Rd.width;qb.height+=Rd.height;var Oh=ab.margin,Ph=Oh.right+Oh.left,ce=Oh.top+Oh.bottom;ab.measure(qb.width,qb.height,f,g);for(var Ce=ab.measuredBounds, Xe=Math.max(Ce.width+Ph,0),Ye=Math.max(Ce.height+ce,0),De=0,Bd=0;Bd=a.rowCount);Bd++)X=a.getRowDefinition(ab.row+Bd),De+=X.total||0;if(De=Rf)&&!(ab.row+Qh>=a.rowCount);Qh++){X=a.getRowDefinition(ab.row+Qh);var Td=X.na||0,Fg=Pn(ab,X,Eg);F&&"number"!==typeof Fg&&v(ab+" spanAllocation does not return a number: "+Fg);X.actual=Math.min(X.maximum,Td+Fg);X.na!==Td&&(Rf-=X.na- Td)}for(;0Rh&&(X.actual=Math.min(X.maximum,Rh+Rf),X.na!==Rh&&(Rf-=X.na-Rh));if(0===X.index)break;X=a.getRowDefinition(X.index-1)}}for(var Sh=0,sk=0;sk=a.columnCount);sk++)X=a.getColumnDefinition(ab.column+sk),Sh+=X.total||0;if(Sh=Vi)&&!(ab.column+tk>=a.columnCount);tk++){X=a.getColumnDefinition(ab.column+tk);var Qn= X.na||0,Rn=gu(ab,X,fu);F&&"number"!==typeof Rn&&v(ab+" spanAllocation does not return a number: "+Rn);X.actual=Math.min(X.maximum,Qn+Rn);X.na!==Qn&&(Vi-=X.na-Qn)}for(;0uk&&(X.actual=Math.min(X.maximum,uk+Vi),X.na!==uk&&(Vi-=X.na-uk));if(0===X.index)break;X=a.getColumnDefinition(X.index-1)}}}}Oa(G);Hb.free(Rd);Hb.free(qb);void 0!==id&&Oa(id);void 0!==ye&&Oa(ye);var Gg=0,Hg=0,vk=a.desiredSize,zr=a.maxSize;Yb=Al(a,!0);var Wi=$c=pc=0,Xi=0;h=a.columnCount; for(var wk=0;wk=a.rowCount);P++)V=a.getRowDefinition(q+P),r.height+=V.total;for(P=1;P=a.columnCount);P++)V=a.getColumnDefinition(w+P),r.width+=V.total;var ca=y.na+r.width,Y=u.na+r.height; P=h;V=k;var oa=ca,Da=Y,X=h,Ma=k,Va=ca,xb=Y;h+ca>c.width&&(Va=Math.max(c.width-h,0));k+Y>c.height&&(xb=Math.max(c.height-k,0));var Ta=G.alignment;if(Ta.Gb()){Ta=a.defaultAlignment;Ta.bb()||(Ta=Mc);var Ob=Ta.x;var Nd=Ta.y;var yb=Ta.offsetX;Ta=Ta.offsetY;var oc=y.alignment,pb=u.alignment;oc.bb()&&(Ob=oc.x,yb=oc.offsetX);pb.bb()&&(Nd=pb.y,Ta=pb.offsetY)}else Ob=Ta.x,Nd=Ta.y,yb=Ta.offsetX,Ta=Ta.offsetY;if(isNaN(Ob)||isNaN(Nd))Nd=Ob=.5,Ta=yb=0;oc=O.width;pb=O.height;var $d=G.margin,Kc=$d.left+$d.right, Nf=$d.top+$d.bottom,of=Tl(G,u,y,!1);!isNaN(G.desiredSize.width)||of!==Hd&&of!==ll||(oc=Math.max(ca-Kc,0));!isNaN(G.desiredSize.height)||of!==Hd&&of!==ml||(pb=Math.max(Y-Nf,0));ca=G.maxSize;Y=G.minSize;oc=Math.min(ca.width,oc);pb=Math.min(ca.height,pb);oc=Math.max(Y.width,oc);pb=Math.max(Y.height,pb);ca=pb+Nf;P+=oa*Ob-(oc+Kc)*Ob+yb+$d.left;V+=Da*Nd-ca*Nd+Ta+$d.top;G.visible&&(rc(X,Ma,Va,xb,P,V,O.width,O.height)?G.arrange(P,V,oc,pb):G.arrange(P,V,oc,pb,new L(X,Ma,Va,xb)))}else G.Bl(),G.actualBounds.ka(), oa=G.actualBounds,P=L.allocAt(oa.x,oa.y,oa.width,oa.height),oa.x=V.type===U.TableRow?f:h,oa.y=V.type===U.TableColumn?e:k,oa.width=O.width,oa.height=O.height,G.actualBounds.freeze(),Bl(G,!1),jc(P,oa)||(O=G.part,null!==O&&(O.Th(),G.np(O))),L.free(P)}}}Hb.free(r);for(a=0;a=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();for(var p=[],r=a.$.j,q=r.length,u=0;uz)){w=kk(w.figure);for(var B=0;Bz&&y.push(D))}}}}r=a.$.j;q= r.length;for(u=0;ue*Math.abs(y)*c))){z=G.opacity;w=1;if(1!==z){if(0===z)continue;w=b.globalAlpha;b.globalAlpha=w*z}B=p[u];D=!1;var O=G.strokeDashArray;null!==O&&(D=!0,b.Ht(O,G.strokeDashOffset));if("LineV"===G.figure&&null!==G.stroke&&0b)return 0===a%b;if(0!==a%b)return!1;b=c.length;for(var d=0;df)y.measure(Infinity,Infinity,0,0),z=y.measuredBounds,b.Pc(z),a.l.push(z);else{var B=y.segmentIndex,D=y.segmentFraction,G=y.alignmentFocus;G.Tb()&&(G=Mc);var O=y.segmentOrientation,V=y.segmentOffset;if(isNaN(B)){var P=k.qa;z=La();P.$v(D,z);var ca=J.allocAt(z[0],z[1]);ca.add(k.i(0)); P.type===Id?ca.offset(-P.startX,-P.startY):(P=P.figures.first(),ca.offset(-P.startX,-P.startY));P=z[2];if(O!==og){var Y=k.computeAngle(y,O,P);y.dc=Y}Y=ca.x-m.x;var oa=ca.y-m.y;J.free(ca);Oa(z)}else if(B<-f||B>=f)oa=k.midPoint,P=k.midAngle,O!==og&&(Y=k.computeAngle(y,O,P),y.dc=Y),Y=oa.x-m.x,oa=oa.y-m.y;else{Y=0;0<=B?(oa=n.O(B),z=BDa+10?0<=B?P.Xa(oa):oa.Xa(P):Da>ca+10?0<=B?z.Xa(Y):Y.Xa(z):0<=B?P.Xa(Y):Y.Xa(P)}else P=0<=B?oa.Xa(z):z.Xa(oa);O!==og&&(Y=k.computeAngle(y,O,P),y.dc=Y);Y=oa.x+(z.x-oa.x)*D-m.x;oa=oa.y+(z.y-oa.y)*D-m.y}y.measure(Infinity,Infinity,0,0);z=y.measuredBounds;ca=y.naturalBounds;var X=0;y instanceof Yf&&(X=y.strokeWidth);Da=ca.width+X;var Ma=ca.height+X;h.reset();h.translate(-z.x,-z.y);h.scale(y.scale,y.scale);h.rotate(O===og?y.angle:P,Da/2,Ma/2);O!==dn&&O!==en||h.rotate(90,Da/2,Ma/2);O!==fn&&O!==gn|| h.rotate(-90,Da/2,Ma/2);O===hn&&(45P||225P)&&h.rotate(-P,Da/2,Ma/2);ca=new L(0,0,Da,Ma);q.sj(ca,G);h.xa(q);G=-q.x+X/2*y.scale;y=-q.y+X/2*y.scale;u.assign(V);X=isNaN(V.x);var Va=isNaN(V.y);if(X||Va){Da=Da/2+3;Ma=Ma/2+3;var xb=45<=P&&135>=P,Ta=225<=P&&315>=P;O===og&&(xb||Ta)?(u.x=Va?Da:V.y,u.y=X?Ma:V.x,xb?0<=B||isNaN(B)&&.5>D||!X||(u.y=-Ma):Ta&&((0<=B||isNaN(B)&&.5>D)&&X&&(u.y=-Ma),Va&&(u.x=-Da))):(X&&(u.x=0<=B||isNaN(B)&&.5>D?Da:-Da),Va&&(u.y=-Ma),u.rotate(P))}else u.rotate(P);Y+=u.x; oa+=u.y;ca.set(z);ca.h(Y+G,oa+y,z.width,z.height);a.l.push(ca);b.Pc(ca)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.Eg=b;a=a.location;a.h(a.x+b.x,a.y+b.y);gc(e,b.width||0,b.height||0);Ib.free(h);J.free(q);J.free(u)}}}}; bn.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Te||a instanceof R){var d=null,e=null,f=null;a instanceof R&&(e=d=a);a instanceof Te&&(f=a,d=f.adornedPart);var g=a instanceof Te?null:d.path;if(0!==a.l.length){var h=a.l,k=0;if(null!==g&&k=c)w=p.midPoint,n=p.midAngle,l!==og&&(p=p.computeAngle(g,l,n),g.angle=p),p=w.x,w=w.y; else{u=0;0<=h?(q=b.j[h],w=hz+10?0<=h?n.Xa(q):q.Xa(n):z>y+10?0<=h?w.Xa(u):u.Xa(w):0<=h?n.Xa(u):u.Xa(n)}else n=0<=h?q.Xa(w):w.Xa(q);l!==og&&(p=p.computeAngle(g,l,n),g.angle=p);p=q.x+(w.x-q.x)*k;w=q.y+(w.y-q.y)*k}if(r.Rq())g.location=new J(p,w);else{r.Tb()&&(r=Mc);q=Ib.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle,0, 0);var B=g.naturalBounds;u=L.allocAt(0,0,B.width,B.height);y=J.alloc();y.sj(u,r);q.xa(y);r=-y.x;z=-y.y;var D=B.width,G=B.height;B=J.alloc();B.assign(m);var O=isNaN(m.x),V=isNaN(m.y);if(O||V){D=D/2+3;G=G/2+3;var P=45<=n&&135>=n,ca=225<=n&&315>=n;l===og&&(P||ca)?(B.x=V?D:m.y,B.y=O?G:m.x,P?0<=h||isNaN(h)&&.5>k||!O||(B.y=-G):ca&&((0<=h||isNaN(h)&&.5>k)&&O&&(B.y=-G),V&&(B.x=-D))):(O&&(B.x=0<=h||isNaN(h)&&.5>k?D:-D),V&&(B.y=-G),B.rotate(n))}else B.rotate(n);p+=B.x;w+=B.y;q.Rw(u);r+=u.x;z+=u.y;h=J.allocAt(p+ r,w+z);g.move(h);J.free(h);J.free(B);J.free(y);L.free(u);Ib.free(q)}}null!==f?f.Ck(!1):null!==e&&e.Ck(!1)}}; function cn(a,b,c,d){if(!1!==Hj(d)){var e=d.strokeWidth;0===e&&a instanceof Te&&a.type===U.Link&&a.adornedObject instanceof Yf&&(e=a.adornedObject.strokeWidth);e*=d.Fa;a instanceof R&&null!==a.qa?(a=a.qa.bounds,xl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Te&&null!==a.adornedPart.qa?(a=a.adornedPart.qa.bounds,xl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):xl(d,-(e/2),-(e/2),b+e,c+e);Cj(d,!1)}}function jn(){this.name="Base"}la(jn,dm); jn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.yb();a.ih=[];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.ih.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,w=r.flattenedLengths,y=r.flattenedTotalLength,z=u.length,B=0,D=0,G=La(),O=0;OX&&(X+=360);P.push(X)}B=oa;D=Da}G.push(P)}if(null===a.jh){for(var Ma=[],Va=a.$.j,xb=Va.length,Ta=0;Tayb))for(var oc=0;ocyb&&Nd.push($d)}}}}a.jh=Ma}var Kc=a.jh;var Nf=a.$.j,of=Nf.length,Ve=0,Hh=0,Qc=y;a.Jj=[];for(var Of,pf=0;pfYb*ok*y/a.graduatedRange)){var Pf=w[0][0],Od=0,Ac=0;Hh=y*ae.graduatedStart-1E-4;Qc=y*ae.graduatedEnd+1E-4;var qf=Yb*ok,hd=a.graduatedTickBase;if(hda.graduatedMin+qf&&(hd-=Math.floor((hd-a.graduatedMin)/qf)*qf);for(var Ih=Kc[pf];hd<=a.graduatedMax;){a:{for(var Ln=Ih.length,xg=0;xgy&&(Ve=y),Hh<=Ve&&Ve<=Qc)){for(var pc=G[Od][Ac],$c=w[Od][Ac];OdPf&&Ac rf?0Rd;Rd++){switch(Rd){case 0:rb.h(Pd,Qd);break;case 1:rb.h(Pd+Cg,Qd);break;case 2:rb.h(Pd,Qd+Cc);break;case 3:rb.h(Pd+Cg,Qd+Cc)}rb.rotate(Dg+Pb.angle);rb.offset(Mh,Nh);0===Kh&&0===Rd?be.h(rb.x,rb.y,0,0):be.Ve(rb);rb.offset(-Mh,-Nh);rb.rotate(-Dg-Pb.angle)}J.free(rb);null!==rk.ih&&rk.ih.push(be);qc(Ti,be.x,be.y,be.width,be.height)}else if(Pb instanceof ih){var id=a,ye=e;null===id.Dh&&(id.Dh=new ih);var Qb=id.Dh;kn(Qb,Pb);var Ui=Pb.alignmentFocus;Ui.Tb()&&(Ui=Ic);for(var jd= Pb.segmentOrientation,On=Pb.segmentOffset,ze=new L,ab=0,Sd=0,Dc=0,Ae=0,Be=0,Oh=Ag.length,Ph=0;PhDc||225Dc)&&Bd.rotate(-Dc,Ye/2,De/2);var Rf=L.allocAt(0,0,Ye,De),Eg=J.alloc();Eg.sj(Rf,Ui);Bd.xa(Eg);var Pn=-Eg.x,Qh=-Eg.y,Td=J.alloc();Td.assign(On);isNaN(Td.x)&&(Td.x=Ye/2+3);isNaN(Td.y)&&(Td.y=-(De/2+3));Td.rotate(Dc);ab+=Td.x+Pn;Sd+=Td.y+Qh;var Fg=new L(ab,Sd,Ce.width,Ce.height),Rh=new L(Ce.x,Ce.y,Ce.width,Ce.height),Sh=new L(Xe.x,Xe.y,Xe.width,Xe.height);ce.zA=Ae;ce.lineCount=Qb.lineCount;ce.lines=[Qb.vb,Qb.Gi, Qb.te,Qb.He,Qb.Wb,Qb.nb,Qb.re];ce.actualBounds=Fg;ce.measuredBounds=Rh;ce.naturalBounds=Sh;0===Ph?ze.assign(Fg):ze.Pc(Fg);J.free(Td);J.free(Eg);L.free(Rf);Ib.free(Bd)}null!==id.ih&&id.ih.push(ze);qc(ye,ze.x,ze.y,ze.width,ze.height)}Cj(Pb,!1)}}}; jn.prototype.arrange=function(a,b,c){if(null!==a.ih){var d=a.yb(),e=a.Jj;if(null!==e){var f=a.ih,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=e&&(e=1);for(var g=f.actualBounds,h=a.$.j,k=a.Jj,l=h.length,m=0;ma.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e)){var q=n.measuredBounds,u=n.strokeWidth*n.scale,w=n.alignmentFocus;w.Tb()&& (w=Ic);for(var y=0;yf.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.$g:a.Zg);var n=l.separatorStroke;null===n&&(n=c?a.wi:a.Yg);if(0!==m&&null!==n){Ai(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null===p&&(p=c?a.vi:a.ui);null!==p&&(n=!0,b.Ht(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.lb;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.Ft()}}}} function pn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=0;km)){var n=l.Ac(),p=l.separatorStrokeWidth;isNaN(p)&&(p=c?a.$g:a.Zg);var r=l.separatorStroke;null===r&&(r=c?a.wi:a.Yg);null===r&&(p=0);n-=p;p=l.position+p;n+=l.actual;p+n>m&&(n=m-p);0>=n||(m=a.lb,Ai(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 kk(a){return"LineV"===a||"BarV"===a} t.wk=function(a,b,c,d,e){var f=this.ke(),g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),r=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.areaBackground)return g=this.actualBounds,K.bd(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(null!==this.background)return f=a*k+b*m+p,h=a*l+b*n+r,a=c*k+d*m+p,k=c*l+d*n+r,e.h(0,0),c=this.naturalBounds,f=K.bd(0,0,c.width,c.height,f,h,a,k,e),e.transform(g),f;f||(k=1,m=l=0,n=1,r=p=0);h=a*k+b*m+p;a=a*l+b* n+r;k=c*k+d*m+p;c=c*l+d*n+r;e.h(k,c);d=(k-h)*(k-h)+(c-a)*(c-a);l=!1;n=this.$.j;r=n.length;m=J.alloc();p=null;b=Infinity;var q=null,u=this.isClipping&&this.ta===U.Spot;u&&(q=J.alloc(),p=this.yb(),(l=p.wk(h,a,k,c,q))&&(b=(h-q.x)*(h-q.x)+(a-q.y)*(a-q.y)));for(var w=0;wd&&e.set(q),J.free(q));J.free(m);f&&e.transform(g);return l}; t.u=function(a){if(!0!==Hj(this)){N.prototype.u.call(this,a);a=null;if(this.ta===U.Auto||this.ta===U.Link)a=this.yb();for(var b=this.$.j,c=b.length,d=0;dc||f>d)this.u(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Hd:this.u(!0);this.measure(c+h,d+g,0,0);break;case ll:this.u(!0);this.measure(c+h,f+g,0,0);break;case ml:this.u(!0),this.measure(b+h,d+g,0,0)}}this.ta.arrange(this,e,this.Eg)}}; t.Ph=function(a){var b=this.naturalBounds,c=Nm(this);if(rc(0,0,b.width,b.height,a.x,a.y)){b=this.$.j;for(var d=b.length,e=J.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Jb(e.set(a),f.transform),f.fa(e))return J.free(e),!0}J.free(e);return null===this.ob&&null===this.jc?!1:!0}return!1};t.It=function(a){if(this.Yk===a)return this;for(var b=this.$.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 U?m:null;p=Ib.alloc();p.set(g); if(null!==m?m.Ff(a,b,c,d,e,p):zl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Ib.free(p)}}}void 0===f&&Ib.free(g);return d}void 0===f&&Ib.free(g);return!1};function xn(a,b,c,d){for(var e=a.$.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 U&&xn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.Jg=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.ke(),k=h?a:Jb(J.allocAt(a.x,a.y),this.transform),l=h?b:Jb(J.allocAt(b.x,b.y),this.transform),m=k.Qe(l),n=0w.width||u.y>w.height||0>u.x+u.width||0>u.y+u.height))if(q.ke()?(u=q.transform,Jb(k.set(a),u),Jb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof U?q:null,null!==q?q.Jg(k,l,c,d,e,f):u.py(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 Sm(a){var b=null;a instanceof Yf&&(b=a.spot1,b===ld&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Hc);return b}function Tm(a){var b=null;a instanceof Yf&&(b=a.spot2,b===ld&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Sc);return b}t.add=function(a){x(a,N,U,"add:element");this.zb(this.$.count,a)};t.O=function(a){return this.$.O(a)}; t.zb=function(a,b){b instanceof S&&v("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.Lg(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.ta!==U.Grid||b instanceof Yf||v("Can only add Shapes to a Grid Panel, not: "+b);this.ta!==U.Graduated||b instanceof Yf||b instanceof ih||v("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.rj(this);b.Yj=null;if(null!==this.itemArray){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Sd&&(this.Sd=new Db),this.Sd.add(d,b))}var e=this.$;d=-1;if(c===this){for(var f=-1,g=this.$.j,h=g.length,k=0;k=e.count&&a>=e.count)return; e.hb(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.zb(a,b);if(0===a||b.isPanelMain)this.Wi=null;Hj(this)||this.u();b.u(!1);null!==b.portId?this.Sh=!0:b instanceof U&&!0===b.Sh&&(this.Sh=!0);this.jh=null;c=this.part;null!==c&&(c.Uj=null,c.ph=NaN,this.Sh&&c instanceof T&&(c.Sh=!0),c.Sh&&c instanceof T&&(c.xc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&&c.gb(Ke,"elements",this,b,null,d,null),c.gb(Je, "elements",this,null,b,null,a),this.Mg()||yn(this,b,!1)))};function zn(a,b){a.I=b?a.I|16777216:a.I&-16777217}t.remove=function(a){x(a,N,U,"remove:element");for(var b=this.$.j,c=b.length,d=-1,e=0;ea&&ya(a,">= 0",U,"getRowDefinition:idx");a=Math.round(a);var b=this.xb;if(void 0===b)return null;if(void 0===b[a]){var c=new ik;c.rj(this);c.isRow=!0;c.index=a;b[a]=c}return b[a]};U.prototype.xw=function(a){F&&C(a,U,"removeRowDefinition:idx");0>a&&ya(a,">= 0",U,"removeRowDefinition:idx");a=Math.round(a);var b=this.xb;void 0!==b&&(this.gb(Ke,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.u())}; U.prototype.getColumnDefinition=function(a){F&&C(a,U,"getColumnDefinition:idx");0>a&&ya(a,">= 0",U,"getColumnDefinition:idx");a=Math.round(a);var b=this.tb;if(void 0===b)return null;if(void 0===b[a]){var c=new ik;c.rj(this);c.isRow=!1;c.index=a;b[a]=c}return b[a]};t=U.prototype;t.vw=function(a){F&&C(a,U,"removeColumnDefinition:idx");0>a&&ya(a,">= 0",U,"removeColumnDefinition:idx");a=Math.round(a);var b=this.tb;void 0!==b&&(this.gb(Ke,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.u())}; t.Xz=function(a){if(0>a||this.type!==U.Table)return-1;for(var b=0,c=this.xb,d=c.length,e=this.Zi;ea||this.type!==U.Table)return-1;for(var b=0,c=this.tb,d=c.length,e=this.Ii;e=c.elements.count&&!(c instanceof S)){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||(Ca("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),Bn=!0)}}))} t.Az=function(){var a=this.copy();sn(a,function(a){a instanceof U&&(a.pi=null,a.pb=null);var b=a.jb;null!==b&&(a.jb=null,b.each(function(b){a.bind(b.copy())}));b=a.Sg;null!==b&&(a.Sg=null,b.each(function(b){Zl(a,b.value.copy())}))});return a}; t.Ga=function(a){var b=this.pi;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.fb(e);else{var f=this.diagram;null!==f&&c.isToModel&&(d=f.model.modelData)}if(null===d)F&&Ca("Binding error: missing GraphObject named "+e+" in "+this.toString());else{f=this;var g=c.vj;if(-1!==g){if(f= this.It(g),null===f)continue}else null!==c.jd&&(f=c.jd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.kq;if(0!==e){if(!(f instanceof U))continue;1===e?f=f.getColumnDefinition(c.km):2===e&&(f=f.getRowDefinition(c.km))}void 0!==f&&c.Uw(f,d)}}}}; function Cn(a,b){a=a.$.j;for(var c=a.length,d=b.length,e=0,f=null;ea;)this.Nc(this.$.length-1,!1);a=this.itemArray;if(null!==a)for(var b=a.length,c=0;cc)){var d=En(a,b),e=a.itemTemplateMap,f=null;null!==e&&(f=e.K(d));null===f&&(Fn||(Fn=!0,Ca('No item template Panel found for category "'+d+'" on '+a),Ca(" Using default item template."),d=new U,e=new ih,e.bind(new $i("text","",Qa)),d.add(e),Gn=d),f=Gn);d=f;null!==d&&(Lg(d),d=d.copy(),0!==(d.I&16777216)&&(e=a.ij(),null!==e&&zn(e,!0)),"object"===typeof b&&(null===a.Sd&&(a.Sd=new Db),a.Sd.add(b,d)),e=c+vn(a),a.zb(e,d),d.pb=b,Hn(a,e,c),d.pb=null,d.data= b)}}function Hn(a,b,c){for(a=a.$;ba&&ya(a,">= 0",U,"padding"),a=new lc(a)):(x(a,lc,U,"padding"),0>a.left&&ya(a.left,">= 0",U,"padding:value.left"),0>a.right&&ya(a.right,">= 0",U,"padding:value.right"),0>a.top&&ya(a.top,">= 0",U,"padding:value.top"),0>a.bottom&&ya(a.bottom,">= 0",U,"padding:value.bottom"));var b=this.lb;b.A(a)||(this.lb=a=a.J(),this.u(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.Nn},set:function(a){var b=this.Nn;b.A(a)||(F&&x(a,M,U,"defaultAlignment"), this.Nn=a=a.J(),this.u(),this.g("defaultAlignment",b,a))}},defaultStretch:{configurable:!0,get:function(){return this.Zf},set:function(a){var b=this.Zf;b!==a&&(hb(a,N,U,"defaultStretch"),this.Zf=a,this.u(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return void 0===this.Cj?Ec:this.Cj},set:function(a){if(void 0!==this.Cj){"number"===typeof a?a=new lc(a):F&&x(a,lc,U,"defaultSeparatorPadding");var b=this.Cj;b.A(a)||(this.Cj=a=a.J(), this.u(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return void 0===this.wi?null:this.wi},set:function(a){var b=this.wi;b!==a&&(null===a||"string"===typeof a||a instanceof Jl)&&(a instanceof Jl&&a.freeze(),this.wi=a,this.P(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return void 0===this.$g?1:this.$g},set:function(a){if(void 0!==this.$g){var b=this.$g; b!==a&&isFinite(a)&&0<=a&&(this.$g=a,this.u(),this.g("defaultRowSeparatorStrokeWidth",b,a))}}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return void 0===this.vi?null:this.vi},set:function(a){if(void 0!==this.vi){var b=this.vi;if(b!==a){null===a||Array.isArray(a)||xa(a,"Array",U,"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.Zi=a,this.u(),this.g("topIndex",b,a))}}},leftIndex:{configurable:!0,get:function(){return void 0===this.Ii?0:this.Ii},set:function(a){if(void 0!==this.Ii){var b=this.Ii;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+ a),this.Ii=a,this.u(),this.g("leftIndex",b,a))}}},data:{configurable:!0,get:function(){return this.pb},set:function(a){var b=this.pb;if(b!==a){var c=this instanceof S&&!(this instanceof Te);c&&A(a,"object",U,"data");Lg(this);this.pb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof R?(null!==b&&c.Ze.remove(b),null!==a&&c.Ze.add(a,this)):this instanceof S&&(null!==b&&c.$e.remove(b),null!==a&&c.$e.add(a,this))):(c=this.panel,null!==c&&null!==c.Sd&&(null!==b&&c.Sd.remove(b), null!==a&&c.Sd.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Ga()}}},itemIndex:{configurable:!0,get:function(){return this.Co},set:function(a){var b=this.Co;b!==a&&(this.Co=a,this.g("itemIndex",b,a))}},itemArray:{configurable:!0,get:function(){return this.Fi},set:function(a){var b=this.Fi;if(b!==a||null!==a&&Cn(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&&Zj(c.partManager,this,c),this.Fi=a,null!==c&&null!==a&&Wj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||this.fu()}}},itemTemplate:{configurable:!0,get:function(){return null===this.ye?null:this.ye.K("")},set:function(a){if(null===this.ye){if(null===a)return;this.ye=new Db}var b=this.ye.K("");b!==a&&(x(a,U,U,"itemTemplate"),(a instanceof S||a.isPanelMain)&&v("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+ a),this.ye.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.fu())}},itemTemplateMap:{configurable:!0,get:function(){return this.ye},set:function(a){var b=this.ye;if(b!==a){x(a,Db,U,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;F&&(d instanceof S||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.ye=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing|| this.fu()}}},itemCategoryProperty:{configurable:!0,get:function(){return this.Fl},set:function(a){var b=this.Fl;b!==a&&("string"!==typeof a&&"function"!==typeof a&&xa(a,"string or function",U,"itemCategoryProperty"),this.Fl=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",U,"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",U,"isClipping"),a&&this.type!==U.Spot&&Ca("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString()),this.I^=2097152,this.u(),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",U,"isOpposite"),this.I^=33554432,this.u(),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",U,"isEnabled");var c=null===this.panel||this.panel.Mg();this.I^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&yn(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.Rg},set:function(a){var b=this.Rg;b!==a&&(F&&A(a,"string",U,"alignmentFocusName"),this.Rg= a,this.u(),this.g("alignmentFocusName",b,a))}}}); ma.Object.defineProperties(U,{Position:{configurable:!0,get:function(){return cm.K("Position")}},Horizontal:{configurable:!0,get:function(){return cm.K("Horizontal")}},Vertical:{configurable:!0,get:function(){return cm.K("Vertical")}},Spot:{configurable:!0,get:function(){return cm.K("Spot")}},Auto:{configurable:!0,get:function(){return cm.K("Auto")}},Table:{configurable:!0,get:function(){return cm.K("Table")}},Viewbox:{configurable:!0, enumerable:!0,get:function(){return cm.K("Viewbox")}},TableRow:{configurable:!0,get:function(){return cm.K("TableRow")}},TableColumn:{configurable:!0,get:function(){return cm.K("TableColumn")}},Link:{configurable:!0,get:function(){return cm.K("Link")}},Grid:{configurable:!0,get:function(){return cm.K("Grid")}},Graduated:{configurable:!0,get:function(){return cm.K("Graduated")}}});U.prototype.findItemPanelForData=U.prototype.oy; U.prototype.rebuildItemElements=U.prototype.fu;U.prototype.updateTargetBindings=U.prototype.Ga;U.prototype.copyTemplate=U.prototype.Az;U.prototype.graduatedValueForPoint=U.prototype.nA;U.prototype.graduatedPointForValue=U.prototype.mA;U.prototype.findColumnForLocalX=U.prototype.Pz;U.prototype.findRowForLocalY=U.prototype.Xz;U.prototype.removeColumnDefinition=U.prototype.vw;U.prototype.removeRowDefinition=U.prototype.xw;U.prototype.removeAt=U.prototype.hb;U.prototype.remove=U.prototype.remove; U.prototype.insertAt=U.prototype.zb;U.prototype.elt=U.prototype.O;U.prototype.add=U.prototype.add;U.prototype.findObject=U.prototype.fb;U.prototype.findInVisualTree=U.prototype.ym;U.prototype.walkVisualTreeFrom=U.prototype.Nk;U.prototype.findMainElement=U.prototype.yb;var Bn=!1,Fn=!1,Gn=null,cm=new Db;U.className="Panel";U.definePanelLayout=Jn;Jn("Position",new Mm);Jn("Vertical",new Pm);Jn("Auto",new Rm);Jn("Link",new bn); function ik(){fb(this);this.wg=null;this.rs=!0;this.Ua=0;this.Xc=NaN;this.rh=0;this.qh=Infinity;this.Cb=ld;this.sa=this.na=0;this.jb=null;this.aq=Kn;this.Ke=kl;this.Vp=this.zg=null;this.Wp=NaN;this.ob=this.bk=null;this.Jn=!1} ik.prototype.copy=function(){var a=new ik;a.rs=this.rs;a.Ua=this.Ua;a.Xc=this.Xc;a.rh=this.rh;a.qh=this.qh;a.Cb=this.Cb;a.na=this.na;a.sa=this.sa;a.Ke=this.Ke;a.aq=this.aq;null===this.zg?a.zg=null:a.zg=this.zg.J();a.Vp=this.Vp;a.Wp=this.Wp;a.bk=null;null!==this.bk&&(a.separatorDashArray=Ia(this.separatorDashArray));a.ob=this.ob;a.Jn=this.Jn;a.jb=this.jb;return a};t=ik.prototype; t.Et=function(a){x(a,ik,ik,"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.zg=null===a.separatorPadding?null:a.separatorPadding.J();this.separatorStroke=a.separatorStroke;this.separatorStrokeWidth=a.separatorStrokeWidth;this.bk=null;a.separatorDashArray&&(this.bk=Ia(a.separatorDashArray));this.background=a.background;this.coversSeparators=a.coversSeparators;this.jb= a.jb};t.mb=function(a){a.classType===ik?this.sizing=a:Ba(this,a)};t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+sb(this)};t.rj=function(a){this.wg=a}; t.Jv=function(){var a=0,b=0,c=this.wg,d=this.isRow;if(null!==c&&c.type===U.Table)for(var e=d?c.xb.length:c.tb.length,f=0;fa&&ya(a,">= 0",ik,"height"),this.Xc=a,this.actual=this.na,null!== this.panel&&this.panel.u(),this.Eb("height",b,a))}},width:{configurable:!0,get:function(){return this.Xc},set:function(a){var b=this.Xc;b!==a&&(F&&A(a,"number",ik,"width"),0>a&&ya(a,">= 0",ik,"width"),this.Xc=a,this.actual=this.na,null!==this.panel&&this.panel.u(),this.Eb("width",b,a))}},minimum:{configurable:!0,get:function(){return this.rh},set:function(a){var b=this.rh;b!==a&&(F&&A(a,"number",ik,"minimum"),(0>a||!isFinite(a))&&ya(a,">= 0",ik,"minimum"),this.rh=a,this.actual= this.na,null!==this.panel&&this.panel.u(),this.Eb("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.qh},set:function(a){var b=this.qh;b!==a&&(F&&A(a,"number",ik,"maximum"),0>a&&ya(a,">= 0",ik,"maximum"),this.qh=a,this.actual=this.na,null!==this.panel&&this.panel.u(),this.Eb("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.Cb},set:function(a){var b=this.Cb;b.A(a)||(F&&x(a,M,ik,"alignment"),this.Cb=a.J(),null!==this.panel&&this.panel.u(), this.Eb("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.Ke},set:function(a){var b=this.Ke;b!==a&&(F&&hb(a,N,ik,"stretch"),this.Ke=a,null!==this.panel&&this.panel.u(),this.Eb("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.zg},set:function(a){"number"===typeof a?a=new lc(a):null!==a&&F&&x(a,lc,ik,"separatorPadding");var b=this.zg;null!==a&&null!==b&&b.A(a)||(null!==a&&(a=a.J()),this.zg=a,null!==this.panel&&this.panel.u(), this.Eb("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.Vp},set:function(a){var b=this.Vp;b!==a&&(null!==a&&gm(a,"RowColumnDefinition.separatorStroke"),a instanceof Jl&&a.freeze(),this.Vp=a,null!==this.panel&&this.panel.u(),this.Eb("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.Wp},set:function(a){var b=this.Wp;b!==a&&(this.Wp=a,null!==this.panel&&this.panel.u(),this.Eb("separatorStrokeWidth", b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.bk},set:function(a){var b=this.bk;if(b!==a){null===a||Array.isArray(a)||xa(a,"Array",ik,"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,w=La(),y=2;yn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;y=0;q=w[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){Oa(w);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.ej(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===w.length){Oa(w);return}q=w[y];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Oa(w)}} t.ej=function(a,b){var c=this.Kc,d=this.nl;if(null!==c||null!==d){var e=this.actualBounds,f=this.naturalBounds;null!==d&&Ai(this,a,d,!0,!1,f,e);var g=this.part,h=this.Bh;null!==c&&0===h&&null!==g&&(h=g.type===U.Link&&g instanceof Te&&"Selection"===g.category&&g.adornedObject instanceof Yf&&g.adornedPart.yb()===g.adornedObject?g.adornedObject.strokeWidth:0);null!==c&&0!==h&&(Ai(this,a,c,!1,!1,f,e),a.lineWidth=h,a.lineJoin=this.hm,a.lineCap=this.gm,a.miterLimit=this.ck);e=!1;g&&b.Re("drawShadows")&& (e=g.isShadowed);g=!0;null===c||null!==d&&"transparent"!==d||(g=!1);f=!1;var k=this.strokeDashArray;null!==k&&(f=!0,a.Ht(k,this.Ah));var l=this.qa;if(null!==l){if(l.type===Id)a.beginPath(),a.moveTo(l.startX,l.startY),a.lineTo(l.endX,l.endY),null!==d&&a.de(d),0!==h&&null!==c&&a.uj();else if(l.type===Md){var m=l.startX;k=l.startY;var n=l.endX,p=l.endY;l=Math.min(m,n);var r=Math.min(k,p);m=Math.abs(n-m);k=Math.abs(p-k);a.beginPath();a.rect(l,r,m,k);null!==d&&a.de(d);if(null!==c){g&&e&&Il(a);if(0!==h){if(0=== m||0===k)a.beginPath(),a.rect(l,r,Math.max(m,.1),Math.max(k,.1));a.uj()}g&&e&&Hl(a)}}else if(l.type===Ud)m=l.startX,k=l.startY,n=l.endX,p=l.endY,l=Math.abs(n-m)/2,r=Math.abs(p-k)/2,m=Math.min(m,n)+l,k=Math.min(k,p)+r,a.beginPath(),a.moveTo(m,k-r),a.bezierCurveTo(m+K.Qg*l,k-r,m+l,k-K.Qg*r,m+l,k),a.bezierCurveTo(m+l,k+K.Qg*r,m+K.Qg*l,k+r,m,k+r),a.bezierCurveTo(m-K.Qg*l,k+r,m-l,k+K.Qg*r,m-l,k),a.bezierCurveTo(m-l,k-K.Qg*r,m-K.Qg*l,k-r,m,k-r),a.closePath(),null!==d&&a.de(d),0!==h&&null!==c&&(g&&e?(Il(a), a.uj(),Hl(a)):a.uj());else if(l.type===Gd)for(k=l.figures,l=k.length,r=0;rw.sweepAngle,null!==q?q.endX:m.startX,null!==q?q.endY:m.startY)}else if(q=ne(w,m),y=q.length,0===y)a.lineTo(w.centerX,w.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.Ub(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== Md){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.Lc(-d,-d);if(f.fa(a))return L.free(f),!1;f.Lc(d,d)}null!==this.stroke&&f.Lc(e,e);a=f.fa(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===Gd)return L.free(f),null===this.fill?re(c,a.x,a.y,e):pe(c,a,e,1=this.strokeWidth)m=K.Te(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.Te(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new J;K.Te(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Te(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Te(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 Oa(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.ca(k.y,a))&&(k.yb||K.ca(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.py=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.Ph(a,!0))return!0;var e=a.Qe(b),f=e;1.5=e||Lb(b,f,0,-n)>=e|| Lb(b,f,0,n)>=e||Lb(b,f,m,0)>=e?!1:!0}else if(b.type===Gd){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&&Kb(a.x,a.y,f,h,k,h)>e&&Kb(a.x,a.y,k,l,f,l)>e&&Kb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?re(b,a.x,a.y,f):pe(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.j;k=h.length;for(l=0;le)return!1;break;case je:var p=La();K.Oe(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Oa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.kd(g,m)>e)return!1;break;case ke:p=La();K.$q(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Oa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.kd(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.kd(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.Oe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.8,q),d(q,a))return Oa(q),!1;Oa(q);null!==n&&(g=n[6],m=n[7]);break;default:v("Unknown Segment type: "+n.type)}}return!0}}}return!1};t.ic=function(){this.qa=null};function $n(a){var b=a.diagram;null!==b&&b.undoManager.isUndoingRedoing||(a.segmentOrientation=ln,"None"!==a.nm?(a.segmentIndex=-1,a.alignmentFocus=sd):"None"!==a.pl&&(a.segmentIndex=0,a.alignmentFocus=new M(1-sd.x,sd.y)))} Yf.makeGeometry=function(a,b,c){if("None"!==a.toArrow)var d=ao[a.toArrow];else"None"!==a.fromArrow?d=ao[a.fromArrow]:(d=K.le[a.figure],"string"===typeof d&&(d=K.le[d]),void 0===d&&v("Unknown Shape.figure: "+a.figure),d=d(a,b,c),d.zl=b,d.yl=c);if(null===d){var e=K.le.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 '+d.bounds.toString()+" that are too large for the given size ("+b+","+c+"). See documentation for Shape.defineFigureGenerator."); return d};function bo(a){var b=ao[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=ao[c];if(void 0===b){var d=null,e;for(e in K.en)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=Vd(K.en[d],!1),ao[d]=a,c!==d&&(ao[c]=d),d}}return"string"===typeof b?b:b instanceof Fd?a:null} ma.Object.defineProperties(Yf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.qa?this.qa:this.Bd},set:function(a){var b=this.qa,c=this.Bd;if(b!==a){null!==a?(F&&x(a,Fd,Yf,"geometry"),this.Bd=this.qa=a.freeze()):this.Bd=this.qa=null;var d=this.part;null!==d&&(d.ph=NaN);this.u();this.g("geometry",b||c,a);ul(this)&&(a=this.part,null!==a&&vl(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.uo},set:function(a){F&&A(a,"boolean",Yf,"isGeometryPositioned");var b=this.uo;b!==a&&(this.uo=a,this.u(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.nl},set:function(a){var b=this.nl;b!==a&&(null!==a&&gm(a,"Shape.fill"),a instanceof Jl&&a.freeze(),this.nl= a,this.P(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Kc},set:function(a){var b=this.Kc;b!==a&&(null!==a&&gm(a,"Shape.stroke"),a instanceof Jl&&a.freeze(),this.Kc=a,this.P(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.Bh},set:function(a){var b=this.Bh;if(b!==a)if(F&&C(a,Yf,"strokeWidth"),0<=a){this.Bh=a;this.u();var c=this.part;null!==c&&(c.ph=NaN);this.g("strokeWidth",b,a)}else ya(a,"value >= 0",Yf,"strokeWidth:value")}}, strokeCap:{configurable:!0,get:function(){return this.gm},set:function(a){var b=this.gm;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?ya(a,'"butt", "round", or "square"',Yf,"strokeCap"):(this.gm=a,this.P(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return this.hm},set:function(a){var b=this.hm;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?ya(a,'"miter", "bevel", or "round"',Yf,"strokeJoin"):(this.hm= a,this.P(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return this.ck},set:function(a){var b=this.ck;if(b!==a)if(F&&C(a,Yf,"strokeMiterLimit"),1<=a){this.ck=a;this.P();var c=this.part;null!==c&&(c.ph=NaN);this.g("strokeMiterLimit",b,a)}else F&&ya(a,"value >= 1",Yf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.zh},set:function(a){var b=this.zh;if(b!==a){null===a||Array.isArray(a)||xa(a,"Array",Yf,"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.Lb!==a&&(c=!1);!1===b.Re("textGreeking")&& (c=!1);b=this.tf;p=this.uf;switch(this.flip){case pl:a.translate(e,0);a.scale(-1,1);break;case ol:a.translate(0,f);a.scale(1,-1);break;case ql:a.translate(e,f),a.scale(-1,-1)}m=this.Vc;n=(b+g+p)*m;f>n&&(d=this.aj,d=d.y*f-d.y*n+d.offsetY);if(1===m&&null!==this.re)p=this.vb,p>e&&(p=e),this.dj(this.re,a,0,d+b,e,g,p,c,h,k,l);else if(null!==this.Wb&&null!==this.nb)for(n=0;ne&&(r=e);d+=b;this.dj(this.nb[n],a,0,d,e,g,r,c,h,k,l);d+=g+p}switch(this.flip){case pl:a.scale(-1,1);a.translate(-e, 0);break;case ol:a.scale(1,-1);a.translate(0,-f);break;case ql:a.scale(-1,-1),a.translate(-e,-f)}}}; t.dj=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;h?("left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==jo?jo(this,f):.75*f,b.fillText(a,c+n,d+e),a=f/20|0,0===a&&(a=1),"right"===k?n-=g:"center"===k&&(n-=g/2),l&&(k=null!==ko?ko(this,f):.8*f,b.beginPath(),b.lineWidth=a,b.moveTo(c+n,d+k),b.lineTo(c+n+g,d+k),b.stroke()),m&&(b.beginPath(),b.lineWidth=a,d=d+f-f/2.2|0,0!==a%2&&(d+=.5),b.moveTo(c+n,d),b.lineTo(c+ n+g,d),b.stroke()))}; t.Im=function(a,b,c,d){this.Gi=a;var e=this.se;null!==eo&&lo!==e&&(lo=eo.font=e);this.vb=this.He=0;this.re=this.nb=this.Wb=this.te=null;var f;if(isNaN(this.desiredSize.width)){e=this.Zb.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;){var k=e.indexOf("\n",g);-1===k&&(k=e.length,h=!0);f=Math.max(f,mo(e.substr(g,k-g).trim()));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=mo(e);e=Math.min(e,a/this.scale);e=Math.max(8,e)}else e= this.desiredSize.width;null!==this.panel&&(e=Math.min(e,this.panel.maxSize.width));f=no(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;g=f;if(0!==this.vb&&null!==this.Wb&&null!==this.nb&&this.ug===oo&&(b=this.se,b=this.ug===oo?po(b):0,h=this.tf+this.uf,h=Math.max(0,io(this)+h),g=Math.min(this.maxLines-1,Math.max(Math.floor(g/h+.01)-1,0)),!(g+1>=this.nb.length))){h=this.nb[g];for(b=Math.max(1,a-b);mo(h)>b&&1=a.Be)null!==d&&d.h(0,g);else{var k=b;if(a.Fg===uo)if(a.He=1,f=mo(b),0===h||f<=c)a.vb=Math.max(a.vb,f),so(a,b,a.vb),null!==d&&d.h(f,g);else{e=vo(a,k);k=k.substr(e.length);b=vo(a,k);for(f=mo(e+b);0c&&1c;){var m=1;f=mo(l.substr(0,m));for(b=0;f<=c;)m++,b=f,f=mo(l.substr(0,m));if(1===m){var n=f;e=Math.max(e,f)}else n=b,e=Math.max(e,b);m--;1>m&&(m=1);so(a,l.substr(0,m),n);h++;l=l.substr(m);if(a.Vc+h>a.Be)break}b=vo(a,k);for(f=mo(l+b);0a.Be))break}a.He=Math.min(a.Be,h);a.vb=Math.max(a.vb,e);null!==d&&d.h(a.vb,g*a.He)}}}function vo(a,b){if(a.Fg===wo)return b.substr(0,1);a=b.length;for(var c=0,d=xo;c=a?b:b.substr(0,c)}function mo(a){return null===eo?8*a.length:eo.measureText(a).width} function io(a){if(null!==a.te)return a.te;var b=a.se;if(null===eo){var c=16;return a.te=c}void 0!==yo[b]&&5E3>zo?c=yo[b]:(c=1.3*eo.measureText("M").width,yo[b]=c,zo++);return a.te=c}function po(a){if(null===eo)return 6;if(void 0!==Ao[a]&&5E3>Bo)var b=Ao[a];else b=eo.measureText(qo).width,Ao[a]=b,Bo++;return b} function no(a,b){var c=a.Zb.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.tf+a.uf;d=Math.max(0,io(a)+d);if(0===c.length)return a.vb=0,a.Vc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Vc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.Fg!==uo){a.He=0;var k=Hb.alloc();to(a,f,b,k);e+=k.height;Hb.free(k);a.Vc+=a.He}else to(a,f,b,null),e+=d,a.Vc++;a.Vc===a.Be&&(h=!0)}f=g+1}return a.As=e} ma.Object.defineProperties(ih.prototype,{font:{configurable:!0,get:function(){return this.se},set:function(a){var b=this.se;b!==a&&(F&&(A(a,"string",ih,"font"),ho(a)||v('Not a valid font: "'+a+'"')),this.se=a,this.te=null,this.u(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.Zb},set:function(a){var b=this.Zb;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.Zb=a,this.u(),this.g("text",b,a))}},textAlign:{configurable:!0,get:function(){return this.Xi}, set:function(a){var b=this.Xi;b!==a&&(F&&A(a,"string",ih,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Xi=a,this.P(),this.g("textAlign",b,a)):F&&ya(a,'"start", "end", "left", "right", or "center"',ih,"textAlign"))}},flip:{configurable:!0,get:function(){return this.Md},set:function(a){var b=this.Md;b!==a&&(hb(a,N,ih,"flip"),this.Md=a,this.P(),this.g("flip",b,a))}},verticalAlignment:{configurable:!0,get:function(){return this.aj},set:function(a){var b= this.aj;b.A(a)||(F&&(x(a,M,ih,"verticalAlignment"),a.Tb()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),this.aj=a=a.J(),Sl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.uc.o()){var a=Hb.alloc();to(this,this.Zb,999999,a);var b=a.width;Hb.free(a);a=no(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);gc(this.uc,b,a)}return this.uc}},isMultiline:{configurable:!0, get:function(){return this.Mj},set:function(a){var b=this.Mj;b!==a&&(F&&A(a,"boolean",ih,"isMultiline"),this.Mj=a,this.u(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return this.Ei},set:function(a){var b=this.Ei;b!==a&&(F&&A(a,"boolean",ih,"isUnderline"),this.Ei=a,this.P(),this.g("isUnderline",b,a))}},isStrikethrough:{configurable:!0,get:function(){return this.Di},set:function(a){var b=this.Di;b!==a&&(F&&A(a,"boolean",ih,"isStrikethrough"), this.Di=a,this.P(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return this.Fg},set:function(a){var b=this.Fg;b!==a&&(F&&hb(a,ih,ih,"wrap"),this.Fg=a,this.u(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return this.ug},set:function(a){var b=this.ug;b!==a&&(F&&hb(a,ih,ih,"overflow"),this.ug=a,this.u(),this.g("overflow",b,a))}},stroke:{configurable:!0,get:function(){return this.Kc},set:function(a){var b=this.Kc;b!== a&&(null!==a&&gm(a,"TextBlock.stroke"),a instanceof Jl&&a.freeze(),this.Kc=a,this.P(),this.g("stroke",b,a))}},lineCount:{configurable:!0,get:function(){return this.Vc}},editable:{configurable:!0,get:function(){return this.Wn},set:function(a){var b=this.Wn;b!==a&&(F&&A(a,"boolean",ih,"editable"),this.Wn=a,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return this.mq},set:function(a){var b=this.mq;b!==a&&(!F||a instanceof bf||v("TextBlock.textEditor must be an HTMLInfo."), this.mq=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0,get:function(){return this.Gc},set:function(a){var b=this.Gc;b!==a&&(null!==a&&A(a,"function",ih,"errorFunction"),this.Gc=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return this.Rd},set:function(a){var b=this.Rd;F&&C(a,ih,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){this.Rd=a;this.u();var c=this.panel;null!==c&&(c.jh=null);this.g("interval",b,a)}}},graduatedStart:{configurable:!0, enumerable:!0,get:function(){return this.Pd},set:function(a){var b=this.Pd;F&&C(a,ih,"graduatedStart");b!==a&&(0>a?a=0:1a?a=0:1=a&&ya(a,"> 0",ih,"maxLines"),this.Be=a,this.g("maxLines",b,a),this.u())}},metrics:{configurable:!0,get:function(){return{arrSize:null!==this.Wb?this.Wb:[this.vb],arrText:null!==this.nb?this.nb:[this.re],maxLineWidth:this.vb,fontHeight:this.te}}},choices:{configurable:!0, enumerable:!0,get:function(){return this.yn},set:function(a){var b=this.yn;b!==a&&(F&&null!==a&&!Array.isArray(a)&&xa(a,"Array",ih,"choices:value"),this.yn=a,this.g("choices",b,a))}}});var jo=null,ko=null,uo=new E(ih,"None",0),ro=new E(ih,"WrapFit",1),go=new E(ih,"WrapDesiredSize",2),wo=new E(ih,"WrapBreakAll",3),fo=new E(ih,"OverflowClip",0),oo=new E(ih,"OverflowEllipsis",1),xo=/[ \u200b\u00ad]/,yo=new jb,zo=0,Ao=new jb,Bo=0,qo="...",lo="",eo=null,co=!1;ih.className="TextBlock";ih.getEllipsis=function(){return qo}; ih.setEllipsis=function(a){qo=a;Ao=new jb;Bo=0};ih.getBaseline=function(){return jo};ih.setBaseline=function(a){jo=a;a=Wa();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 Hd:m=d.width;n=d.height;break;case Og:case nl:p===Og?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===nl&&(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.Gf()*b.scale;var q=m*p*n*p,u=h*g/q,w=c.__goCache;p=null;var y=Ho;if(c.ps&&void 0!==w&&4y*y)for(null===w.cj&&(Io(w,4,k,l,c),Io(w,16,k,l,c)),k=w.cj,l=k.length,q=0;qK.Zh&&(K.Yh[a]=d,K.Zh++);return d}); Mo("Square",function(a,b,c){a="s"+b+","+c;var d=K.Yh[a];if(void 0!==d)return d;d=new Fd(Md);d.endX=b;d.endY=c;d.defaultStretch=Og;50>K.Zh&&(K.Yh[a]=d,K.Zh++);return d}); Mo("RoundedRectangle",function(a,b,c){var d=a?a.parameter1:NaN;if(isNaN(d)||0>d)d=5;d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*K.Qg;b=(new Fd).add((new te(d,0,!0)).add(new ue(Kd,b-d,0)).add(new ue(je,b,d,b-a,0,b,a)).add(new ue(Kd,b,c-d)).add(new ue(je,b-d,c,b,c-a,b-a,c)).add(new ue(Kd,d,c)).add(new ue(je,0,c-d,a,c,0,c-a)).add(new ue(Kd,0,d)).add((new ue(je,d,0,0,a,a,0)).close()));1K.Zh&&(K.Yh[a]=d,K.Zh++);return d});Mo("Circle",function(a,b,c){a="c"+b+","+c;var d=K.Yh[a];if(void 0!==d)return d;d=new Fd(Ud);d.endX=b;d.endY=c;d.spot1=ud;d.spot2=vd;d.defaultStretch=Og;50>K.Zh&&(K.Yh[a]=d,K.Zh++);return d});Mo("TriangleRight",function(a,b,c){return(new Fd).add((new te(0,0)).add(new ue(Kd,b,.5*c)).add((new ue(Kd,0,c)).close())).bn(0,.25,.5,.75)}); Mo("TriangleDown",function(a,b,c){return(new Fd).add((new te(0,0)).add(new ue(Kd,b,0)).add((new ue(Kd,.5*b,c)).close())).bn(.25,0,.75,.5)});Mo("TriangleLeft",function(a,b,c){return(new Fd).add((new te(b,c)).add(new ue(Kd,0,.5*c)).add((new ue(Kd,b,0)).close())).bn(.5,.25,1,.75)});Mo("TriangleUp",function(a,b,c){return(new Fd).add((new te(b,c)).add(new ue(Kd,0,c)).add((new ue(Kd,.5*b,0)).close())).bn(.25,.5,.75,1)});Mo("Triangle","TriangleUp"); Mo("Diamond",function(a,b,c){return(new Fd).add((new te(.5*b,0)).add(new ue(Kd,0,.5*c)).add(new ue(Kd,.5*b,c)).add((new ue(Kd,b,.5*c)).close())).bn(.25,.25,.75,.75)});Mo("LineH",function(a,b,c){a=new Fd(Id);a.startX=0;a.startY=c/2;a.endX=b;a.endY=c/2;return a});Mo("LineV",function(a,b,c){a=new Fd(Id);a.startX=b/2;a.startY=0;a.endX=b/2;a.endY=c;return a});Mo("None","Rectangle");Mo("BarH","Rectangle");Mo("BarV","Rectangle");Mo("MinusLine","LineH"); Mo("PlusLine",function(a,b,c){return(new Fd).add((new te(0,c/2,!1)).add(new ue(Kd,b,c/2)).add(new ue(ie,b/2,0)).add(new ue(Kd,b/2,c)))});Mo("XLine",function(a,b,c){return(new Fd).add((new te(0,c,!1)).add(new ue(Kd,b,0)).add(new ue(ie,0,0)).add(new ue(Kd,b,c)))}); K.en={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z", DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z", TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; function S(a){U.call(this,a);this.F=2408959;this.nh=this.Uf="";this.Hp=this.Dp=this.Sp=this.Go=null;this.Up="";this.Rf=this.ro=this.Tp=this.xh=null;this.Fp="";this.Ep=cc;this.Zb=this.Ip="";this.Hi=this.Bn=this.ri=null;this.lg=(new J(NaN,NaN)).freeze();this.No="";this.jf=null;this.Oo=Hc;this.Jp=ld;this.Xo=Sb;this.Po=Tb;this.Tn=null;this.Ho=127;this.Yp=Ub;this.Xp="gray";this.rf=4;this.Ax=-1;this.vq=NaN;this.az=new L;this.Uj=null;this.ph=NaN}la(S,U); S.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.F=this.F&-4097|49152;a.Uf=this.Uf;a.nh=this.nh;a.Go=this.Go;a.Sp=this.Sp;a.Dp=this.Dp;a.Hp=this.Hp;a.Up=this.Up;a.Tp=this.Tp;a.ro=this.ro;a.Rf=null;a.Fp=this.Fp;a.Ep=this.Ep.J();a.Ip=this.Ip;a.Jp=this.Jp.J();a.Zb=this.Zb;a.Bn=this.Bn;a.lg.assign(this.lg);a.No=this.No;a.Oo=this.Oo.J();a.Xo=this.Xo.J();a.Po=this.Po.J();a.Tn=this.Tn;a.Ho=this.Ho;a.Yp=this.Yp.J();a.Xp=this.Xp;a.rf=this.rf;a.vq=this.vq}; S.prototype.Ef=function(a){U.prototype.Ef.call(this,a);a.Th();a.xh=null;a.jf=null;a.Uj=null};S.prototype.toString=function(){var a=Pa(this.constructor)+"#"+sb(this);null!==this.data&&(a+="("+Qa(this.data)+")");return a};S.prototype.Jk=function(a,b,c,d,e,f,g){var h=this.diagram;null!==h&&(a===Je&&"elements"===b?e instanceof U?Uj(e,function(a){Wj(h.partManager,a);Vj(h,a)}):nk(h,e):a===Ke&&"elements"===b&&(e instanceof U?Uj(e,function(a){Zj(h.partManager,a,h)}):Bk(h,e)),h.gb(a,b,c,d,e,f,g))}; S.prototype.Ga=function(a){U.prototype.Ga.call(this,a);if(null!==this.data){for(var b=this.$.j,c=b.length,d=0;de.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.ka();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Sb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Hb(),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",S,"isHighlighted");this.F^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ka(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.P();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",S,"isShadowed"),this.F^=8192,this.g("isShadowed",b,a),this.P())}},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",S,"isAnimated"),this.F^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return this.ro}, set:function(a){var b=this.ro;b!==a&&(null!==a&&A(a,"function",S,"highlightedChanged"),this.ro=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{configurable:!0,get:function(){return this.Up},set:function(a){var b=this.Up;b!==a&&(F&&A(a,"string",S,"selectionObjectName"),this.Up=a,this.xh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return this.Sp},set:function(a){var b=this.Sp;b!==a&&(F&&x(a,Te,S,"selectionAdornmentTemplate"), this.Sp=a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{configurable:!0,get:function(){if(null===this.xh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.fb(a),null!==a?this.xh=a:this.xh=this):this instanceof R?(a=this.path,null!==a?this.xh=a:this.xh=this):this.xh=this}return this.xh}},selectionChanged:{configurable:!0,get:function(){return this.Tp},set:function(a){var b=this.Tp;b!==a&&(null!==a&&A(a,"function",S,"selectionChanged"),this.Tp=a,this.g("selectionChanged", b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return this.Dp},set:function(a){var b=this.Dp;b!==a&&(F&&x(a,Te,S,"resizeAdornmentTemplate"),this.Dp=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return this.Fp},set:function(a){var b=this.Fp;b!==a&&(F&&A(a,"string",S,"resizeObjectName"),this.Fp=a,this.g("resizeObjectName",b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName; return""!==a&&(a=this.fb(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return this.Ep},set:function(a){var b=this.Ep;b.A(a)||(F&&x(a,Hb,S,"resizeCellSize"),this.Ep=a=a.J(),this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return this.Hp},set:function(a){var b=this.Hp;b!==a&&(F&&x(a,Te,S,"rotateAdornmentTemplate"),this.Hp=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0, get:function(){return this.Ip},set:function(a){var b=this.Ip;b!==a&&(F&&A(a,"string",S,"rotateObjectName"),this.Ip=a,this.g("rotateObjectName",b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.fb(a),null!==a)?a:this}},rotationSpot:{configurable:!0,get:function(){return this.Jp},set:function(a){var b=this.Jp;b.A(a)||(F&&(x(a,M,S,"rotationSpot"),a===ld||a.bb()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+ a)),this.Jp=a=a.J(),this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.Zb},set:function(a){var b=this.Zb;b!==a&&(F&&A(a,"string",S,"text"),this.Zb=a,this.g("text",b,a))}},containingGroup:{configurable:!0,get:function(){return this.ri},set:function(a){if(this.bc()){var b=this.ri;if(b!==a){F&&null!==a&&x(a,Hf,S,"containingGroup");null===a||this!==a&&!a.Ed(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.D(2);var c=this.diagram;null!==b?Zo(b,this):this instanceof Hf&&null!==c&&c.Hh.remove(this);this.ri=a;null!==a?Yo(a,this):this instanceof Hf&&null!==c&&c.Hh.add(this);this.D(1);if(null!==c&&c.ba){var d=this.data,e=c.model;if(null!==d&&e.oj()){var f=e.pa(null!==a?a.data:null);e.hr(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.ba,c.ba=!0),d(this,b,a),null!==c&&(c.ba=e));if(this instanceof Hf)for(c=new I,hl(c,this,!0,0,!0), c=c.iterator;c.next();)if(d=c.value,d instanceof T)for(d=d.linksConnected;d.next();)dp(d.value);if(this instanceof T){for(c=this.linksConnected;c.next();)dp(c.value);c=this.labeledLink;null!==c&&dp(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&Bi(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return this.Bn},set:function(a){var b=this.Bn;b!==a&&(null!==a&&A(a,"function",S,"containingGroupChanged"), this.Bn=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{configurable:!0,get:function(){return null!==this.containingGroup||this instanceof T&&null!==this.labeledLink?!1:!0}},layoutConditions:{configurable:!0,get:function(){return this.Ho},set:function(a){var b=this.Ho;b!==a&&(F&&A(a,"number",S,"layoutConditions"),this.Ho=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return this.Tn},set:function(a){var b=this.Tn; b!==a&&(null!==a&&A(a,"function",S,"dragComputation"),this.Tn=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0,get:function(){return this.Yp},set:function(a){var b=this.Yp;b.A(a)||(F&&x(a,J,S,"shadowOffset"),this.Yp=a=a.J(),this.P(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return this.Xp},set:function(a){var b=this.Xp;b!==a&&(F&&A(a,"string",S,"shadowColor"),this.Xp=a,this.P(),this.g("shadowColor",b,a))}},shadowBlur:{configurable:!0, enumerable:!0,get:function(){return this.rf},set:function(a){var b=this.rf;b!==a&&(F&&A(a,"number",S,"shadowBlur"),this.rf=a,this.P(),this.g("shadowBlur",b,a))}}});S.prototype.invalidateLayout=S.prototype.D;S.prototype.findCommonContainingGroup=S.prototype.my;S.prototype.isMemberOf=S.prototype.Ed;S.prototype.findTopLevelPart=S.prototype.aA;S.prototype.findSubGraphLevel=S.prototype.Yz;S.prototype.ensureBounds=S.prototype.Fb;S.prototype.getDocumentBounds=S.prototype.Cm; S.prototype.getRelativePoint=S.prototype.If;S.prototype.findObject=S.prototype.fb;S.prototype.moveTo=S.prototype.moveTo;S.prototype.invalidateAdornments=S.prototype.Sb;S.prototype.clearAdornments=S.prototype.lk;S.prototype.removeAdornment=S.prototype.Mf;S.prototype.addAdornment=S.prototype.Kh;S.prototype.findAdornment=S.prototype.uk;S.prototype.updateTargetBindings=S.prototype.Ga;var Wo=!1;S.className="Part";S.LayoutNone=0;S.LayoutAdded=1;S.LayoutRemoved=2;S.LayoutShown=4;S.LayoutHidden=8; S.LayoutNodeSized=16;S.LayoutGroupLayout=32;S.LayoutNodeReplaced=64;S.LayoutStandard=127;S.LayoutAll=16777215;function Te(a){S.call(this,a);this.F&=-257;this.nh="Adornment";this.me=null;this.Fx=0;this.Tx=!1;this.l=[];this.Qa=null}la(Te,S);Te.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Te.prototype.updateRelationshipsFromData=function(){}; Te.prototype.Ck=function(a){var b=this.adornedObject.part;if(b instanceof R&&this.adornedObject instanceof Yf){var c=b.path;b.Ck(a);a=c.geometry;b=this.$.j;c=b.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.Se){b.Se=!0;var c=new I;c.add(this);op(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Gi);b.Se=!1}}; function op(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.Se){b.Se=!0;var c=new I;c.add(this);qp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Gi);b.Se=!1}}; function qp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Gq():a.Dd();k.next();){var l=k.value;l.isTreeLink&&(h||l.rd||l.Ya(),l=l.Lq(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Vb(!0),l.Th(),g&&e.jk(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(Kg.prototype,{padding:{configurable:!0,get:function(){return this.lb},set:function(a){"number"===typeof a?a=new lc(a):x(a,lc,Kg,"padding");var b=this.lb;b.A(a)||(this.lb=a=a.J(),this.g("padding",b,a),this.u())}}});Kg.className="Placeholder"; function R(){S.call(this,U.Link);this.Va=8;this.bf=null;this.cf="";this.yf=this.ho=null;this.zf="";this.pq=null;this.Sk=og;this.In=0;this.Kn=og;this.Ln=NaN;this.$j=vp;this.bq=.5;this.hd=null;this.Db=(new H).freeze();this.wh=this.Jc=null;this.Tl=new L;this.qa=new Fd;this.to=!0;this.L=this.w=this.Tf=this.bg=null;this.l=[];this.wv=new J;this.es=this.Ox=this.Nx=null;this.Ru=NaN;this.S=null}la(R,S); R.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.Va=this.Va&-113;a.cf=this.cf;a.ho=this.ho;a.zf=this.zf;a.pq=this.pq;a.Sk=this.Sk;a.In=this.In;a.Kn=this.Kn;a.Ln=this.Ln;a.$j=this.$j;a.bq=this.bq;null!==this.S&&(a.S=this.S.copy())};t=R.prototype;t.Ef=function(a){S.prototype.Ef.call(this,a);this.cf=a.cf;this.zf=a.zf;a.Jc=null;a.Ya();a.Tf=this.Tf;var b=a.fromPort;null!==b&&hp(a.fromNode,b);b=a.toPort;null!==b&&hp(a.toNode,b)}; t.mb=function(a){a.classType===R?2===(a.value&2)?this.routing=a:a===rg||a===ng||a===mg?this.curve=a:a===wp||a===xp||a===yp?this.adjusting=a:a!==vp&&a!==og&&v("Unknown Link enum value for a Link property: "+a):S.prototype.mb.call(this,a)};t.Mc=function(){null===this.S&&(this.S=new tl)};t.qj=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Ij(a)||Jj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Ij(a)||Jj(a))?!1:!0};t.Gw=function(){return!1}; t.nu=function(){};t.bc=function(){return!1};R.prototype.computeAngle=function(a,b,c){return R.computeAngle(b,c)};R.computeAngle=function(a,b){switch(a){default:case og:a=0;break;case ln:a=b;break;case dn:a=b+90;break;case fn:a=b-90;break;case zp:a=b+180;break;case mn:a=K.Xq(b);90a&&(a-=180);break;case en:a=K.Xq(b+90);90a&&(a-=180);break;case gn:a=K.Xq(b-90);90a&&(a-=180);break;case hn:a=K.Xq(b);if(45a||225a)return 0;90a&&(a-=180)}return K.Xq(a)}; function dp(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.my(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.ri;if(c!==b){null!==c&&Zo(c,a);a.ri=b;null!==b&&Yo(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.ba,g.ba=!0);e(a,c,b);null!==g&&(g.ba=f)}!a.rd||a.Nx!==c&&a.Ox!==c||a.Ya()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=R.prototype; t.Th=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&S.prototype.Th.call(this)};t.Lq=function(a){F&&x(a,T,R,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.jA=function(a){F&&x(a,N,R,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function lp(a,b){null===a.hd&&(a.hd=new I);a.hd.add(b);a.u()} t.Nq=function(a){S.prototype.Nq.call(this,a);Ap(this)&&this.Qq(this.actualBounds);if(!a){a=this.bf;var b=null;null!==a&&(b=this.fromPort,jp(a,this,b));var c=this.yf;if(null!==c){var d=this.toPort;c===a&&d===b||jp(c,this,d)}Bp(this)}};t.Oq=function(a){S.prototype.Oq.call(this,a);Ap(this)&&this.Qq(this.actualBounds);if(!a){a=this.bf;var b=null;null!==a&&(b=this.fromPort,kp(a,this,b));var c=this.yf;if(null!==c){var d=this.toPort;c===a&&d===b||kp(c,this,d)}Cp(this)}}; t.sk=function(){this.rd=!0;if(null!==this.hd){var a=this.diagram;if(null!==a)for(var b=this.hd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};R.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; R.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?S.prototype.move.call(this,a,!1):(a=J.allocAt(c.x+d,c.y+e),S.prototype.move.call(this,a,!1),J.free(a));Cf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; R.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};R.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}; R.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Vb),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()===rg))return this.qa.Zv(.5,a),a.add(this.i(0)),c=this.qa.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===rg){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.uz(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}; R.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()===rg))return this.qa.ty(.5);if(this.computeCurve()===rg&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return K.sz(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.Xa(d)};t=R.prototype;t.i=function(a){return this.Db.j[a]}; t.pd=function(a,b){F&&(x(b,J,R,"setPoint"),b.o()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.od(a,b)};t.N=function(a,b,c){F&&(C(b,R,"setPointAt:x"),C(c,R,"setPointAt:y"));F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.od(a,new J(b,c))}; t.rA=function(a,b){F&&(x(b,J,R,"insertPoint"),b.o()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.zb(a,b)};t.m=function(a,b,c){F&&(C(b,R,"insertPointAt:x"),C(c,R,"insertPointAt:y"));F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.zb(a,new J(b,c))}; t.Ne=function(a){F&&(x(a,J,R,"addPoint"),a.o()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.add(a)};t.Cf=function(a,b){F&&(C(a,R,"insertPointAt:x"),C(b,R,"insertPointAt:y"));F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.add(new J(a,b))}; t.ww=function(a){F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.hb(a)};t.mk=function(){F&&null===this.Jc&&v("Call Link.startRoute before modifying the points of the route.");this.Db.clear()}; function Cf(a,b,c){if(0!==b||0!==c){for(var d=a.rd,e=new H,f=a.Db.iterator;f.next();){var g=f.value;e.add((new J(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Db;a.Db=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.wc?a.u():(a.lg.h(a.lg.x+b,a.lg.y+c),a.sa.h(a.sa.x+b,a.sa.y+c),Sl(a));d&&Dp(a);null!==g&&g.animationManager.wc&&(a.wh=e);a.g("points",f,e)}}t.Xh=function(){null===this.Jc&&(this.Jc=this.Db,this.Db=this.Db.copy())}; t.Df=function(){if(null!==this.Jc){for(var a=this.Jc,b=this.Db,c=Infinity,d=Infinity,e=a.j,f=e.length,g=0;gl&&(n=-n),u=(0>k?-1:1)*n+r,w=m*(u-r)+q);r=g.x+2*h/3;q=g.y+2*k/3;var y=r,z=q;K.C(k,0)?z=0k?-1:1)*n+r,z=m*(y-r)+q);this.mk();this.Ne(g);this.Cf(u,w);this.Cf(y,z);this.Ne(p);this.pd(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.pd(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.C(e,0)?h=0f&&(g=-g),g=(0>e?-1:1)*g+b,h=p*(g-b)+c),this.Ne(d),this.Cf(g,h)):this.Ne(d),this.Ne(a)}else{n=this.isAvoiding;p&&(m&&n||l)&&this.mk();var B=l?this.computeCurviness():0;n=this.getLinkPoint(b,c,d,!0,m,e,f);r=u=q=0;if(m||!h||l)w=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&&(w+=Math.abs(B)*(m?1:2)),0===r?q=w:90===r?u=w:180===r?q=-w:270===r?u=-w:(q=w*Math.cos(r*Math.PI/180),u=w*Math.sin(r*Math.PI/180)),d.Tb()&&l&&(w=c.ma(Mc,J.alloc()),y=J.allocAt(w.x+1E3*q,w.y+1E3*u),this.getLinkPointFromPoint(b,c,w,y,!0,n),J.free(w),J.free(y));w=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,w,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.Tb()&&l&&(a=f.ma(Mc,J.alloc()),d=J.allocAt(a.x+1E3*y,a.y+1E3*z),this.getLinkPointFromPoint(e,f,a,d,!1,w),J.free(a),J.free(d))}a=n;if(m||!h||l)a=new J(n.x+q,n.y+u);d=w;if(m||!k||l)d=new J(w.x+y,w.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} R.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.ke()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.Cd;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.wk(e,d,g,c,f);null!== a&&f.transform(a);return f};function Hp(a,b){var c=b.zp;null===c&&(c=new Ip,c.port=b,c.node=b.part,b.zp=c);return Jp(c,a)} R.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new J);if(c.bb()&&!Fp(c))return b.ma(c,h),h;if(c.nd()){var k=Hp(this,b);if(null!==k){h.assign(k.Uq);if(e&&this.routing===Kp){var l=Hp(this,g);if(null!==l&&k.vm=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Jf(Tc)||c.Jf(Wc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);J.free(k);J.free(l)}}return h}}c= b.ma(.5===c.x&&.5===c.y?c:Mc,J.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=Gp(c,g.copy()))):(k=this.computeSpot(!d,g),f=J.alloc(),g=g.ma(.5===k.x&&.5===k.y?k:Mc,f),e&&(g=Gp(c,g)),J.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);J.free(c);return h}; R.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.bb())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?Gp(k,h.copy()):c):(c=J.alloc(),h=h.ma(Mc,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.Tb()&&g.Ed(a)&&(k+=180,360<=k&&(k-=360));if(Fp(d))return k;a=b.lj();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};R.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.nd()&&(a=Hp(this,b),null!==a))return a.Rv;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; R.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Mc:(b=this.fromSpot,b.Gb()&&(b=a.fromSpot),a=b===ld?Gc:b)):(a=b?b:this.toPort,null===a?a=Mc:(b=this.toSpot,b.Gb()&&(b=a.toSpot),a=b===ld?Gc:b));return a};function Fp(a){return a===Gc||.5===a.x&&.5===a.y}R.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==og&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Ib.alloc();n.set(g); if(m instanceof U)h=m.Ff(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Yf)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.Oh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Pe(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var w=J.alloc(),y=J.alloc(),z=J.alloc(),B=Ib.alloc();B.set(q);B.kw(m.transform);B.Tt();y.x=p;y.y=u;y.transform(B);w.x=h;w.y=u;w.transform(B);q=!1;Zn(m,w,y,z)?q=!0:(w.x=p,w.y=r,w.transform(B),Zn(m,w,y,z)?q=!0:(y.x= h,y.y=r,y.transform(B),Zn(m,w,y,z)?q=!0:(w.x=h,w.y=u,w.transform(B),Zn(m,w,y,z)&&(q=!0))));Ib.free(B);J.free(w);J.free(y);J.free(z);h=q}}else h=m.Oh(h,n)}else h=zl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Ib.free(n)}}}void 0===f&&Ib.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Ib.free(g);return!1}; R.prototype.computeCurve=function(){if(null===this.bg){var a=this.fromPort,b=this.isOrthogonal;this.bg=null!==a&&a===this.toPort&&!b}return this.bg?rg:this.curve};R.prototype.computeCorner=function(){if(this.curve===rg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; R.prototype.findMidLabel=function(){for(var a=this.path,b=this.$.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.ca(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.pd(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.pd(c,d)}}return!0;case yp: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.pd(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.Lc(8,8);h.Lc(8,8);g.Ve(a);h.Ve(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.fa(a)||g.fa(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.fa(a)||g.fa(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.fa(a)||g.fa(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.fa(a)||g.fa(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=Op&&(Lk(q), h=q.AA,g.Lc(q.um*h,q.tm*h),Mp(q,a,b,p,d,g),h=Np(q,p.x,p.y));!q.abort&&h>=Op&&q.dB&&(Lk(q),Mp(q,a,b,p,d,q.bounds),h=Np(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.C(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.C(g.y,p.y)?(Math.abs(a.y-g.y)<=q.tm/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.C(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.C(g.x,p.x)?(Math.abs(a.x-g.x)<=q.um/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.Cf(f.x,u.y):this.Cf(u.x,f.y));b= !0}else b=!1}}}else b=!1;b||(this.Ne(k),this.Ne(l))}};R.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 fk(a){if(null===a.diagram||!a.isAvoiding||!Hk(a.diagram))return!1;var b=a.points.j,c=b.length;if(4>c)return!1;a=Ik(a.diagram,!0,a.containingGroup,null);for(var d=1;dRp&&Np(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>Rp)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>Rp&&(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),Np(b,l,m)===k-1?Qp(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),Np(b,l,m)===k-1&&Qp(a,b,l,m,f,!1)));a.Cf(c,d)}R.prototype.Oz=function(a){F&&x(a,J,R,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Kb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gb)return a.type=Id,this.to=!1,a;var c=!1,d=this.diagram;null!==d&&Ap(this)&&d.ah.contains(this)&&(0!==this.Tl.width||0!==this.Tl.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.Db.j;var g=this.computeCurve();if(g===rg&&3<=b&&!K.ca(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;kw?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.ca(w,y)&&K.ca(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.ca(w,y)&&K.ca(y,z)||K.ca(p,r)&&K.ca(r,q))w=.5*(w+z),p=.5*(p+q),g.x=w,g.y=p,b.x=w,b.y=p;1===n?(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y)):2===n&&K.ca(c.x,this.i(0).x)&&K.ca(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=Sp(this,e.copy(),!1,Rb));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=Sp(this,g.copy(),!1,Rb)),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));e=J.alloc();e.assign(f);g=this.computeCorner();n=1;for(l= 0;n=b-1){if(!f.A(m))0!==this.computeShortLength(!1)&&(m=Sp(this,m.copy(),!1,Rb)),Vp(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?q=p.x-r:q=p.x+r;u.y>p.y?G=p.y+ z:G=p.y-z;Vp(this,h,n,w,f,new J(q,B),y);Zd(h,p.x+n,p.y+w,D+n,G+w);f.h(D,G)}else K.C(f.x,p.x)&&K.C(p.y,u.y)?(r=Math.min(g,Math.abs(p.y-e.y)/2),r=z=Math.min(r,Math.abs(u.x-p.x)/2),K.C(z,0)?(Vp(this,h,n,w,f,p,y),f.assign(p)):(q=p.x,B=p.y,D=q,G=B,p.y>f.y?B=p.y-r:B=p.y+r,u.x>p.x?D=p.x+z:D=p.x-z,Vp(this,h,n,w,f,new J(q,B),y),Zd(h,p.x+n,p.y+w,D+n,G+w),f.h(D,G))):(Vp(this,h,n,w,f,p,y),f.assign(p));e.assign(m);n=l}J.free(f)}fe=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=Sp(this, e,!0,f)),0!==this.computeShortLength(!1)&&(h=Sp(this,h,!1,f)),a.type=Id,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.to=!1;return a};function Up(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.ca(a,0)?b:K.ca(b,0)?a:Math.sqrt(a*a+b*b)} function Sp(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=Up(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=Up(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 Tp(a,b,c,d){for(var e=a.pointsCount,f=b;K.ca(b.x,f.x)&&K.ca(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!K.ca(b.x,f.x)&&!K.ca(b.y,f.y))return c-1;for(var g=f;K.ca(b.x,f.x)&&K.ca(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||K.ca(b.y,f.y)&&K.ca(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 Vp(a,b,c,d,e,f,g){if(!g&&Ap(a)){g=[];var h=0;a.isVisible()&&(h=Wp(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===ng?Xd(b,l,n,!1):Yd(b,m,k,l,k,l,n)}else if(K.C(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===ng?Xd(b,n,k,!1):Yd(b,l,m,l,k,n,k)}}b.lineTo(f.x+c,f.y+d)} function Wp(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.Ha.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,w)n&&!K.C(g,w)){h.x=q;h.y=n;m=!0;break a}}else if(!K.C(n,r)&& K.C(g,w)&&Math.min(n,r)g&&Math.min(q,u)m&&!K.C(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 Ap(a){a=a.curve;return a===mg||a===ng}function Ep(a,b){if(b||Ap(a))b=a.diagram,null===b||b.animationManager.isTicking||b.ah.contains(a)||0===a.Tl.width&&0===a.Tl.height||b.ah.add(a,a.Tl.copy())} R.prototype.Qq=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Ha.j;for(var g=e.length,h=0;ha&&ya(a,">= 0",R,"fromEndSegmentLength"),this.S.fh=a,this.g("fromEndSegmentLength",b,a),this.Ya())}},fromShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.gh:NaN},set:function(a){this.Mc();var b=this.S.gh;b!==a&&(F&&A(a,"number", R,"fromShortLength"),this.S.gh=a,this.g("fromShortLength",b,a),this.ic())}},toSpot:{configurable:!0,get:function(){return null!==this.S?this.S.Gh:ld},set:function(a){this.Mc();var b=this.S.Gh;if(!b.A(a)){F&&x(a,M,R,"toSpot");a=a.J();this.S.Gh=a;this.g("toSpot",b,a);if(b.nd()||a.nd())a=this.toNode,null!==a&&hp(a,this.toPort);this.Ya()}}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.S?this.S.Eh:NaN},set:function(a){this.Mc();var b=this.S.Eh;b!==a&& (F&&A(a,"number",R,"toEndSegmentLength"),0>a&&ya(a,">= 0",R,"toEndSegmentLength"),this.S.Eh=a,this.g("toEndSegmentLength",b,a),this.Ya())}},toShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.Fh:NaN},set:function(a){this.Mc();var b=this.S.Fh;b!==a&&(F&&A(a,"number",R,"toShortLength"),this.S.Fh=a,this.g("toShortLength",b,a),this.ic())}},isLabeledLink:{configurable:!0,get:function(){return null===this.hd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);K.rm(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.Ve(f),e=2;ed&&(d=-d)):K.ca(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Qe(e)); a.push(d)}}return this.es}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.Ru;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;d=this.pointsCount?0:this.isOrthogonal||!Fp(this.computeSpot(!0))?1:0}},lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!Fp(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0, enumerable:!0,get:function(){return this.Sk},set:function(a){var b=this.Sk;b!==a&&(F&&hb(a,R,R,"adjusting"),this.Sk=a,this.g("adjusting",b,a))}},corner:{configurable:!0,get:function(){return this.In},set:function(a){var b=this.In;b!==a&&(F&&A(a,"number",R,"corner"),this.In=a,this.ic(),this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.Kn},set:function(a){var b=this.Kn;b!==a&&(F&&hb(a,R,R,"curve"),this.Kn=a,this.Ya(),this.ic(),Ep(this,b===ng||b=== mg||a===ng||a===mg),this.g("curve",b,a))}},curviness:{configurable:!0,get:function(){return this.Ln},set:function(a){var b=this.Ln;b!==a&&(F&&A(a,"number",R,"curviness"),this.Ln=a,this.Ya(),this.ic(),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.$j},set:function(a){var b=this.$j;b!==a&&(F&&hb(a,R,R,"routing"),this.$j=a,this.bg=null,this.Ya(),Ep(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{configurable:!0, get:function(){return this.bq},set:function(a){var b=this.bq;b!==a&&(F&&A(a,"number",R,"smoothness"),this.bq=a,this.ic(),this.g("smoothness",b,a))}},key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.pj())return a.model.ac(this.data)}}});R.prototype.invalidateOtherJumpOvers=R.prototype.Qq;R.prototype.findClosestSegment=R.prototype.Oz;R.prototype.updateRoute=R.prototype.wj;R.prototype.invalidateRoute=R.prototype.Ya;R.prototype.rollbackRoute=R.prototype.Ny; R.prototype.commitRoute=R.prototype.Df;R.prototype.startRoute=R.prototype.Xh;R.prototype.clearPoints=R.prototype.mk;R.prototype.removePoint=R.prototype.ww;R.prototype.addPointAt=R.prototype.Cf;R.prototype.addPoint=R.prototype.Ne;R.prototype.insertPointAt=R.prototype.m;R.prototype.insertPoint=R.prototype.rA;R.prototype.setPointAt=R.prototype.N;R.prototype.setPoint=R.prototype.pd;R.prototype.getPoint=R.prototype.i;R.prototype.getOtherPort=R.prototype.jA;R.prototype.getOtherNode=R.prototype.Lq; var vp=new E(R,"Normal",1),$p=new E(R,"Orthogonal",2),aq=new E(R,"AvoidsNodes",6),Kp=new E(R,"AvoidsNodesStraight",7),og=new E(R,"None",0),rg=new E(R,"Bezier",9),ng=new E(R,"JumpGap",10),mg=new E(R,"JumpOver",11),wp=new E(R,"End",17),xp=new E(R,"Scale",18),yp=new E(R,"Stretch",19),ln=new E(R,"OrientAlong",21),dn=new E(R,"OrientPlus90",22),fn=new E(R,"OrientMinus90",23),zp=new E(R,"OrientOpposite",24),mn=new E(R,"OrientUpright",25),en=new E(R,"OrientPlus90Upright",26),gn=new E(R,"OrientMinus90Upright", 27),hn=new E(R,"OrientUpright45",28);R.className="Link";R.Normal=vp;R.Orthogonal=$p;R.AvoidsNodes=aq;R.AvoidsNodesStraight=Kp;R.None=og;R.Bezier=rg;R.JumpGap=ng;R.JumpOver=mg;R.End=wp;R.Scale=xp;R.Stretch=yp;R.OrientAlong=ln;R.OrientPlus90=dn;R.OrientMinus90=fn;R.OrientOpposite=zp;R.OrientUpright=mn;R.OrientPlus90Upright=en;R.OrientMinus90Upright=gn;R.OrientUpright45=hn;function Zp(a,b,c,d){fb(this);this.xe=this.ms=!1;this.au=a;this.Jy=b;this.lw=c;this.Ky=d;this.links=[]} Zp.prototype.Em=function(){if(!this.ms){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.Vd=Math.floor((a.x-this.qc)/this.qc)*this.qc;this.Wd=Math.floor((b-this.rc)/this.rc)*this.rc;this.Qo=Math.ceil((c+2*this.qc)/this.qc)*this.qc;this.Ro=Math.ceil((d+2*this.rc)/this.rc)*this.rc;a=1+(Math.ceil((this.Qo-this.Vd)/this.qc)|0);b=1+(Math.ceil((this.Ro-this.Wd)/this.rc)|0);if(null===this.Jb||this.fk=Rp&&(a.Jb[b][c]=bq)} Jk.prototype.Ak=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.fk)|0;for(c=Math.min(b+e-1,this.gk)|0;a<=d;a++)for(e=b;e<=c;e++)if(this.Jb[a][e]===Pp)return!1;return!0}; function cq(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.Jb[l][m];if(n>=Rp&&n=a.Jb[l][m]);)a.Jb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)cq(a,b,c,1,!e,f,g,h,k),cq(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)cq(a,b,c,1,!e,f,g,h,k),cq(a,b,c,-1,!e,f,g,h, k)}}function dq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Pp,m=Rp;for(a.Jb[b][c]=m;l===Pp&&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.Vd;k/=a.qc;l-=a.Wd;l/=a.rc;m-=a.Vd;m/=a.qc;n-=a.Wd;n/=a.rc;f=Math.max(0,Math.min(a.fk,k|0));m=Math.min(a.fk,Math.max(0,m|0));l=Math.max(0,Math.min(a.gk,l|0));n=Math.min(a.gk,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.Jb[g][h]===Pp?(dq(a,g,h,k,c,f,m,l,n),dq(a,g,h,1,!c,f,m,l,n),dq(a,g,h,-1,!c,f,m,l,n)):dq(a,g,h,k,c,g,h,g,h);a.Jb[b][d]===Pp?(eq(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,m,l,n),eq(a,b,d,1,!(90===e||270===e),f,m,l,n),eq(a,b,d,-1,!(90===e||270===e),f,m,l,n)):eq(a,b,d,k,c,b,d,b,d);a.abort||(cq(a,g,h,1,!1,f,m,l,n),cq(a,g,h,-1,!1,f,m,l,n),cq(a,g,h,1,!0,f,m,l,n),cq(a,g,h,-1,!0,f,m,l,n))}}} ma.Object.defineProperties(Jk.prototype,{bounds:{configurable:!0,get:function(){return new L(this.Vd,this.Wd,this.Qo-this.Vd,this.Ro-this.Wd)}},um:{configurable:!0,get:function(){return this.qc},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}Ip.prototype.Em=function(){this.fe.length=0}; function Jp(a,b){var c=a.fe;if(0===c.length){a:if(!a.Wq){c=a.Wq;a.Wq=!0;var d=null,e=a.node,f=e instanceof Hf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.ny();else{if(!f.actualBounds.o()){a.Wq=c;break a}d=f;g=d.Tv()}f=a.fe.length=0;var h=a.port.ma(Hc,J.alloc()),k=a.port.ma(Sc,J.alloc());e=L.allocAt(h.x,h.y,0,0);e.Ve(k);J.free(h);J.free(k);h=J.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.lj();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Ed(d),n=l.computeSpot(m,a.port);if(n.nd()&&(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:360<=p&&(p-=360);n=fq(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));r=a.fe[f];void 0===r?(r=new gq(l,p,n),a.fe[f]=r):(r.link=l,r.angle=p,r.Fc= n);r.pw.set(m);f++}}}}J.free(h);a.fe.sort(Ip.prototype.l);k=a.fe.length;d=-1;for(f=h=0;fMath.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.Uq;if(d===sp){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 V=.5;d===ep&&(V=(D.Mq+1)/(D.vm+1));O.x=G.x+u*V;O.y=G.y+B*V}}}J.free(h);J.free(k);J.free(g);J.free(l);G=a.fe;for(f=0;fb.Fc?1:a.angleb.angle?1:0}; Ip.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,Gc,b.fromPort===this.port),d=a.Mq;if(0>d)return c;var e=a.vm;if(1>=e||!b.isOrthogonal)return c;b=a.pw;var f=a.Uq;if(2===a.Fc||8===a.Fc)d=e-1-d;return((a=2===a.Fc||4===a.Fc)?b.y=c-1?(g=0,e=d,f+=h+20,h=0):g++}null!==a&&a.ab("Layout")}this.isValidLayout=!0};Ni.prototype.Ik=function(a){return!a.location.o()||a instanceof Hf&&a.Ik?!0:!1}; function iq(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 T?k.isLinkLabel||(k instanceof Hf?null===k.layout?iq(a,b,k.memberParts,!1,e,f,g,h):(jq(k),b.add(k)):(jq(k),b.add(k))):g&&k instanceof R?b.add(k):!h||!k.bc()||k instanceof T||(jq(k),b.add(k)))}}function jq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Fb()} Ni.prototype.mj=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};Ni.prototype.$x=function(a){var b=new I;a instanceof Q?(iq(this,b,a.nodes,!0,null,!0,!0,!0),iq(this,b,a.links,!0,null,!0,!0,!0),iq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof Hf?iq(this,b,a.memberParts,!1,null,!0,!0,!0):iq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Ni.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.ma(Hc),(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(Ni.prototype,{diagram:{configurable:!0,get:function(){return this.B},set:function(a){null!==a&&x(a,Q,Ni,"diagram");this.B=a}},group:{configurable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(null!==a&&x(a,Hf,Ni,"group"),this.L=a,null!==a&&(this.B=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.wo},set:function(a){this.wo!==a&&(A(a,"boolean",Ni,"isOngoing"),this.wo=a)}},isInitial:{configurable:!0, enumerable:!0,get:function(){return this.Ci},set:function(a){A(a,"boolean",Ni,"isInitial");this.Ci=a;a||(this.Ao=!0)}},isViewportSized:{configurable:!0,get:function(){return this.Bo},set:function(a){this.Bo!==a&&(A(a,"boolean",Ni,"isViewportSized"),(this.Bo=a)&&this.D())}},isRouting:{configurable:!0,get:function(){return this.yo},set:function(a){this.yo!==a&&(A(a,"boolean",Ni,"isRouting"),this.yo=a)}},isRealtime:{configurable:!0,get:function(){return this.xo}, set:function(a){this.xo!==a&&(null!==a&&A(a,"boolean",Ni,"isRealtime"),this.xo=a)}},isValidLayout:{configurable:!0,get:function(){return this.Ao},set:function(a){this.Ao!==a&&(A(a,"boolean",Ni,"isValidLayout"),this.Ao=a,a||(a=this.diagram,null!==a&&(a.Tg=!0)))}},network:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(null!==a&&x(a,hq,Ni,"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",Ni,"boundsComputation"),this.w=a,this.D())}},arrangementOrigin:{configurable:!0,get:function(){return this.pn},set:function(a){x(a,J,Ni,"arrangementOrigin");this.pn.A(a)||(this.pn.assign(a),this.D())}}});Ni.prototype.collectParts=Ni.prototype.$x;Ni.prototype.getLayoutBounds=Ni.prototype.mj;Ni.prototype.invalidateLayout=Ni.prototype.D;Ni.className="Layout"; function hq(a){fb(this);F&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.oc=a;this.Af=new I;this.qe=new I;this.bu=new Db;this.Xt=new Db}hq.prototype.clear=function(){if(this.Af)for(var a=this.Af.iterator;a.next();)a.value.clear();if(this.qe)for(a=this.qe.iterator;a.next();)a.value.clear();this.Af=new I;this.qe=new I;this.bu=new Db;this.Xt=new Db}; hq.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.Af.count+" edges: "+this.qe.count;if(1b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(kq.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.Og._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.Hg._dataArray}},data:{configurable:!0,get:function(){return this.pb},set:function(a){this.pb=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.Ni}, set:function(a){if(this.Ni!==a){F&&null!==a&&x(a,T,kq,"node");this.Ni=a;a.Fb();var b=this.network.layout,c=L.alloc(),d=b.mj(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 Hf)&&(a=a.locationObject.ma(Mc),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&&x(a,L,kq,"bounds"),this.l.assign(a))}},focus:{configurable:!0, get:function(){return this.w},set:function(a){this.w.A(a)||(F&&x(a,J,kq,"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,kq,"centerX"),b.ka(),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,kq,"centerY"),b.ka(),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.ka(),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.ka(),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.ka(),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.ka(),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.ka(),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.ka(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.Rc},set:function(a){F&&x(a,hq,kq,"network");this.Rc=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.Og.iterator}},destinationEdges:{configurable:!0, enumerable:!0,get:function(){return this.Hg.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.Og.count+this.Hg.count}}});kq.prototype.deleteDestinationEdge=kq.prototype.Mv;kq.prototype.addDestinationEdge=kq.prototype.Dv;kq.prototype.deleteSourceEdge=kq.prototype.Nv; kq.prototype.addSourceEdge=kq.prototype.Fv;kq.className="LayoutVertex";kq.standardComparer=rq; kq.smartComparer=function(a,b){F&&x(a,kq,kq,"smartComparer:m");F&&x(b,kq,kq,"smartComparer:n");if(null!==a){if(null!==b){a=a.Ni;var c=b.Ni;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.Ba("Layout");d=[];switch(this.alignment){case Aq: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)),w=0,q=r,u+=y,y=0;y=Math.max(y,O);switch(p){case zq:D=-D.width;break;default:D=0}B.moveTo(q+D,u);switch(p){case zq:q-=G;break;default:q+=G}w++}d.push(new L(0,u,g+h,y));L.free(l);break;case sq: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;w=J.alloc();for(V=0;Vm-1||0k){d.push(new L(0,O?z-f:z,k+n,D+f+p));for(P=0;Pl&&(f.width+=f.x-l,f.x=l);L.free(g)}for(h=f=g=e=0;hb?1:0} ma.Object.defineProperties(al.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.uq},set:function(a){this.uq!==a&&(A(a,"number",al,"wrappingWidth"),0n)){var u=n+vn(q);q.Nc(u,!0);Hn(q,u,n)}}b.isModified=!0}}finally{b.ba=!0}}}}};Ii.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Ga(a);for(b=this.nodes.iterator;b.next();)b.value.Ga(a);for(b=this.links.iterator;b.next();)b.value.Ga(a)}; Ii.prototype.nr=function(){for(var a=this.B.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.cn=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.cn(a.valueOf()):Ga(a)?gr(this,a):Fa(a)?dr(this,a):"function"===typeof a?"null":a.toString()}; function gr(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.vc,d)}or(a,"nodeDataArray",Ke,"nodeDataArray",a,b,null,d,null);a.mr(b)}t.RA=function(a){if(Ga(a))for(var b=a.length,c=0;cb&&(b=a.length);Ja(a,b,c);or(this,"",Je,"",a,null,c,null,b)}; t.uw=function(a,b){void 0===b&&(b=-1);F&&(Ha(a,W,"removeArrayItem:arr"),C(b,W,"removeArrayItem:idx"));a===this.vc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Ka(a,b);or(this,"",Ke,"",a,c,null,b,null)};t.Jq=function(a){if(null===a)return"";var b=this.Vj;if(""===b)return"";b=In(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.Ym=function(a,b){A(b,"string",W,"setCategoryForNodeData:cat");if(null!==a){var c=this.Vj;if(""!==c)if(this.Za(a)){var d=In(a,c);void 0===d&&(d="");d!==b&&(hk(a,c,b),or(this,"nodeCategory",He,c,a,d,b))}else hk(a,c,b)}};t.$m=function(a,b){this.Ym(b,this.Jq(a))};t.Gm=function(){return!1};t.yk=function(){return!1};t.pj=function(){return!1};t.Wt=function(){return!1};t.oj=function(){return!1};function Li(){return new W} function jr(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 jr(a,b.constructor);return typeof b}function mr(a){return sr[a]?sr[a]:void 0!==qa.go&&qa.go[a]?qa.go[a]:null}function In(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&&Ca("property get error: "+d.toString())}return c} function hk(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&&Ca("property set error: "+d.toString())}} ma.Object.defineProperties(W.prototype,{name:{configurable:!0,get:function(){return this.Wa},set:function(a){var b=this.Wa;b!==a&&(A(a,"string",W,"name"),this.Wa=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.Mn},set:function(a){var b=this.Mn;b!==a&&(A(a,"string",W,"dataFormat"),this.Mn=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.hg},set:function(a){var b=this.hg;b!==a&&(A(a,"boolean", W,"isReadOnly"),this.hg=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",W,"modelData"),this.l=a,this.g("modelData",b,a),this.Ga(a))}},undoManager:{configurable:!0,get:function(){return this.w},set:function(a){var b=this.w;b!==a&&(x(a,Me,W,"undoManager"),null!==b&&b.My(this),this.w=a,null!==a&&a.Wx(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.Bg}, set:function(a){A(a,"boolean",W,"skipsUndoManager");this.Bg=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.Oi},set:function(a){var b=this.Oi;b!==a&&(pr(a,W,"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===Ke){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Fa(a)&&"number"===typeof c&&(d=this.ac(a),b?(this.ig.add(a),this.Wc[c]!==a&&this.Wc.splice(c,0,a),void 0!==d&&this.kb.add(d,a)):(this.ig.remove(a),this.Wc[c]=== a&&this.Wc.splice(c,1),void 0!==d&&this.kb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Hf(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}}W.prototype.changeState.call(this,a,b)}};t=ur.prototype;t.Hm=function(a){if(void 0!==a){var b=this.xj;if(null!==b){var c=this.Qb(a);null===c&&(c=this.copyNodeData(b),hk(c,this.nodeKeyProperty,a),this.Bf(c))}return a}}; t.vy=function(a){return Oq(this,a,!0)};t.Dw=function(a,b){Wq(this,a,b,!0)};t.yy=function(a){return Oq(this,a,!1)};t.Iw=function(a,b){Wq(this,a,b,!1)};function Oq(a,b,c){if(null!==b&&(a=c?a.gf:a.hf,""!==a&&(a=In(b,a),void 0!==a))){if(Qq(a))return a;v((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function Wq(a,b,c,d){null===c&&(c=void 0);void 0===c||Qq(c)||xa(c,"number or string",ur,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.gf:a.hf;if(""!==e)if(c=a.Hm(c),a.Bc(b)){var f=In(b,e);f!==c&&(Uq(a,f,b),hk(b,e,c),null===a.Qb(c)&&Vq(a,c,b),or(a,d?"linkFromKey":"linkToKey",He,e,b,f,c),"string"===typeof e&&a.Ga(b,e))}else hk(b,e,c)}}t.wy=function(a){return Nq(this,a,!0)};t.Ew=function(a,b){Xq(this,a,b,!0)};t.zy=function(a){return Nq(this,a,!1)}; t.Jw=function(a,b){Xq(this,a,b,!1)};function Nq(a,b,c){if(null===b)return"";a=c?a.Rj:a.Sj;if(""===a)return"";b=In(b,a);return void 0===b?"":b}function Xq(a,b,c,d){A(c,"string",ur,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.Rj:a.Sj;if(""!==e)if(a.Bc(b)){var f=In(b,e);void 0===f&&(f="");f!==c&&(hk(b,e,c),or(a,d?"linkFromPortId":"linkToPortId",He,e,b,f,c),"string"===typeof e&&a.Ga(b,e))}else hk(b,e,c)}} t.Hf=function(a){if(null===a)return xr;var b=this.Ud;if(""===b)return xr;a=In(a,b);return void 0===a?xr:a};t.lu=function(a,b){Ha(b,ur,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Ud;if(""!==c)if(this.Bc(a)){var d=In(a,c);void 0===d&&(d=xr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Bc(a)&&(Uq(this,b,a),or(this,"linkLabelKeys",Ke,c,a,b,null,e,null)))}else void 0!==d&&v(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; t.ac=function(a){if(null!==a){var b=this.Ji;if(""!==b&&(b=In(a,b),void 0!==b)){if(Qq(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.ku=function(a,b){void 0!==b&&null!==b&&Qq(b)||xa(b,"number or string",ur,"setKeyForLinkData:key");if(null!==a){var c=this.Ji;if(""!==c)if(this.Bc(a)){var d=In(a,c);d!==b&&null===this.Ig(b)&&(hk(a,c,b),void 0!==d&&this.kb.remove(d),this.kb.add(b,a),or(this,"linkKey",He,c,a,d,b),"string"===typeof c&&this.Ga(a,c))}else hk(a,c,b)}}; t.Ig=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&Qq(a)?this.kb.K(a):null}; t.Vq=function(a){if(null!==a){var b=this.Ji;if(""!==b){var c=this.ac(a);if(void 0===c||this.kb.contains(c)){var d=this.Ml;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.kb.contains(c))){hk(a,b,c);return}if("string"===typeof c){for(d=2;this.kb.contains(c+d);)d++;hk(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.kb.count-1;this.kb.contains(c);)c--;hk(a,b,c)}else F&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}}; t.Bc=function(a){return null===a?!1:this.ig.contains(a)};t.bj=function(a){null!==a&&(ub(a),this.Bc(a)||Sq(this,a,!0))};function Sq(a,b,c){if(""!==a.linkKeyProperty){var d=a.ac(b);if(void 0!==d&&a.kb.K(d)===b)return;a.Vq(b);d=a.ac(b);if(void 0===d){v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.kb.add(d,b)}a.ig.add(b);d=null;c&&(d=a.Wc.length,a.Wc.splice(d,0,b));or(a,"linkDataArray",Je,"linkDataArray",a,null,b,null,d);yr(a,b)} t.kz=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.Wc.splice(d,1)}or(a,"linkDataArray",Ke,"linkDataArray",a,b,null,d,null);c=Oq(a,b,!0);Uq(a,c,b);c=Oq(a,b,!1);Uq(a,c,b);d=a.Hf(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.Lr;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===Qr&&k===Rr?h=Cr:h===Qr&&k!==Rr&&(h=this.arrangement);if((this.direction===Lr||this.direction===Mr)&&this.sorting!==Fr){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===Lr?(this.arrangement===Qr&&a.reverse(),d=new H,d.addAll(a), d.addAll(c)):(this.arrangement===Qr&&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===Qr){isNaN(b)&&(b=6);if(h!==Cr&&h!==Qr){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g=r/(360<=p?k:k-1)}this.vx=h;this.fc=l;this.Vn=m;this.wx=n;this.Zr=p;this.Fj=b;this.be=f;this.Lr=g;b=d;d=this.vx;h=this.fc;l=this.wx;m=this.Zr;n=this.Fj;p=this.be;k=this.Lr;if(this.direction!==Lr&&this.direction!==Mr||d!==Qr)if(this.direction===Lr||this.direction===Mr){g=0;switch(d){case Pr:g=180*Wr(this,h,p,l,k)/Math.PI;break;case Cr:k=b=0;g=a.first();null!==g&&(b=Tr(g,Math.PI/2));g=c.first(); null!==g&&(k=Tr(g,Math.PI/2));g=180*Wr(this,h,p,l,n+(b+k)/2)/Math.PI;break;case Or:g=m/b.length}if(this.direction===Lr){switch(d){case Pr:Xr(this,a,l,Nr);break;case Cr:Yr(this,a,l,Nr);break;case Or:Zr(this,a,m/2,l,Nr)}switch(d){case Pr:Xr(this,c,l+g,Er);break;case Cr:Yr(this,c,l+g,Er);break;case Or:Zr(this,c,m/2,l+g,Er)}}else{switch(d){case Pr:Xr(this,c,l,Nr);break;case Cr:Yr(this,c,l,Nr);break;case Or:Zr(this,c,m/2,l,Nr)}switch(d){case Pr:Xr(this,a,l+g,Er);break;case Cr:Yr(this,a,l+g,Er);break;case Or:Zr(this, a,m/2,l+g,Er)}}}else switch(d){case Pr:Xr(this,b,l,this.direction);break;case Cr:Yr(this,b,l,this.direction);break;case Or:Zr(this,b,m,l,this.direction);break;case Qr:$r(this,b,m,l,this.direction)}else $r(this,b,m,l-m/2,Er)}this.updateParts();this.network=null;this.isValidLayout=!0}; function Zr(a,b,c,d,e){var f=a.Zr,g=a.fc;a=a.be;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===Er?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;cs(a,k,l,m,n,e,f)||ds(a,k,l,m,n,e,f);k=f.x;l=f.y}J.free(f);a.Wj++;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.Wj?a.fc-g/(2*Math.PI):5>m.length&&10=n.length-1)break;cs(a,k,l,n,p,e,m)||ds(a,k,l,n,p,e,m);k=m.x;l=m.y}J.free(m);a.Wj++;if(!(23a.Wj?a.fc-f/(2*Math.PI):a.fc-(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 ds(a,b,c,d,e,f,g){var h=a.fc,k=a.be,l=0;a=(d[e].height+d[e+1].height)/2+a.Fj;d=!1;if(0<=b!==(f===Er)){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.fc,c.y=this.arrangementOrigin.y+this.be);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.Fb(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.je(c.je(a)),this.group.move(b),this.mx=b.je(a))}; Br.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Vr(a,b,c,d,e){var f=a.bz;if(.001>Math.abs(a.Vn-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 Ur(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?Vr(a,1,c,d,e):Vr(a,1,c))}function Wr(a,b,c,d,e){if(.001>Math.abs(a.Vn-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 Jr:break;case Kr:a.reverse();break;case Hr:a.sort(this.comparer);break;case Ir:a.sort(this.comparer);a.reverse();break;case Fr: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.im=a:this.im=360,this.D())}},arrangement:{configurable:!0,get:function(){return this.Ib},set:function(a){this.Ib!==a&&(hb(a,Br,Br,"arrangement"),a===Qr||a===Cr||a===Pr||a===Or)&&(this.Ib=a,this.D())}},direction:{configurable:!0,get:function(){return this.M},set:function(a){this.M!==a&&(hb(a,Br,Br,"direction"), a===Er||a===Nr||a===Lr||a===Mr)&&(this.M=a,this.D())}},sorting:{configurable:!0,get:function(){return this.Yc},set:function(a){this.Yc!==a&&(hb(a,Br,Br,"sorting"),a===Jr||a===Kr||a===Hr||Ir||a===Fr)&&(this.Yc=a,this.D())}},comparer:{configurable:!0,get:function(){return this.Tc},set:function(a){this.Tc!==a&&(A(a,"function",Br,"comparer"),this.Tc=a,this.D())}},spacing:{configurable:!0,get:function(){return this.sf},set:function(a){this.sf!==a&&(A(a,"number", Br,"spacing"),this.sf=a,this.D())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.kp},set:function(a){this.kp!==a&&(hb(a,Br,Br,"nodeDiameterFormula"),a===Gr||a===Rr)&&(this.kp=a,this.D())}},actualXRadius:{configurable:!0,get:function(){return this.fc}},actualYRadius:{configurable:!0,get:function(){return this.be}},actualSpacing:{configurable:!0,get:function(){return this.Fj}},actualCenter:{configurable:!0,get:function(){return this.mx}}}); var Cr=new E(Br,"ConstantSpacing",0),Pr=new E(Br,"ConstantDistance",1),Or=new E(Br,"ConstantAngle",2),Qr=new E(Br,"Packed",3),Er=new E(Br,"Clockwise",4),Nr=new E(Br,"Counterclockwise",5),Lr=new E(Br,"BidirectionalLeft",6),Mr=new E(Br,"BidirectionalRight",7),Jr=new E(Br,"Forwards",8),Kr=new E(Br,"Reverse",9),Hr=new E(Br,"Ascending",10),Ir=new E(Br,"Descending",11),Fr=new E(Br,"Optimized",12),Gr=new E(Br,"Pythagorean",13),Rr=new E(Br,"Circular",14);Br.className="CircularLayout";Br.ConstantSpacing=Cr; Br.ConstantDistance=Pr;Br.ConstantAngle=Or;Br.Packed=Qr;Br.Clockwise=Er;Br.Counterclockwise=Nr;Br.BidirectionalLeft=Lr;Br.BidirectionalRight=Mr;Br.Forwards=Jr;Br.Reverse=Kr;Br.Ascending=Hr;Br.Descending=Ir;Br.Optimized=Fr;Br.Pythagorean=Gr;Br.Circular=Rr;function Dr(){this.Bm=-Infinity;this.dn=this.Pk=null} Dr.prototype.compare=function(a,b){if(0this.Bm||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=js(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.Oc(c)&&(a++,2a.network.vertexes.count)return!1;a.Jh=a.network.vertexes.ua();a=a.Jh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Fd-a.Fd});for(b=a.length-1;0<=b&&1>=a[b].Fd;)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 os(a,b,c){F&&(x(b,hs,gs,"popNetwork:oldnet"),C(c,gs,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Ue){var e=d.Ue.O(d.Bw);d.Fd=e.ru;var f=e.$w,g=e.ax;d.bounds=new L(d.centerX-f,d.centerY-g,e.su,e.qu);d.focus=new J(f,g);d.Bw--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function ps(a,b,c){F&&(x(b,rs,gs,"surroundNode:oldnet"),C(c,gs,"surroundNode:level"));var d=b.nk;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.Ue&&0=n.Fd?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 js(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.eg;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=ss(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new us),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 us),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;for(e=d=0;ea.epsilonDistance*a.epsilonDistance}gs.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};gs.prototype.moveFixedVertex=function(){};gs.prototype.commitLayout=function(){this.Fw();this.commitNodes();this.isRouting&&this.commitLinks()}; gs.prototype.Fw=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=ld,b.toSpot=ld)}};gs.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)}; gs.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};gs.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.il:a};gs.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.hl:a};gs.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.fl:a};gs.prototype.electricalFieldX=function(){return 0};gs.prototype.electricalFieldY=function(){return 0}; gs.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.gl:a};gs.prototype.gravitationalFieldX=function(){return 0};gs.prototype.gravitationalFieldY=function(){return 0};gs.prototype.isFixed=function(a){return a.isFixed}; ma.Object.defineProperties(gs.prototype,{currentIteration:{configurable:!0,get:function(){return this.Do}},arrangementSpacing:{configurable:!0,get:function(){return this.Jd},set:function(a){x(a,Hb,gs,"arrangementSpacing");this.Jd.A(a)||(this.Jd.assign(a),this.D())}},arrangesToOrigin:{configurable:!0,get:function(){return this.qn},set:function(a){this.qn!==a&&(A(a,"boolean",gs,"arrangesToOrigin"),this.qn=a,this.D())}},setsPortSpots:{configurable:!0, get:function(){return this.qf},set:function(a){this.qf!==a&&(A(a,"boolean",gs,"setsPortSpots"),this.qf=a,this.D())}},comments:{configurable:!0,get:function(){return this.ed},set:function(a){this.ed!==a&&(A(a,"boolean",gs,"comments"),this.ed=a,this.D())}},maxIterations:{configurable:!0,get:function(){return this.Nl},set:function(a){this.Nl!==a&&(A(a,"number",gs,"maxIterations"),0<=a&&(this.Nl=a,this.D()))}},epsilonDistance:{configurable:!0,get:function(){return this.Yn}, set:function(a){this.Yn!==a&&(A(a,"number",gs,"epsilonDistance"),0u&&0u&&0a[this.yd]&&(this.zs=a[c]-1,this.yd=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.kk===l.kk||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;wn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>w)&&h++,qn||u===n&&w>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)}Gs(a,b,d);return f} function Os(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&&Os(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&&Os(a,k,c,d,e,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();)Ps(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)Ps(a,b.value.fromVertex,c,d,e,f)}} ws.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.dl){default:case Qs: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!==Rs(a);){for(e=Ss(a);null!==e;)d[c]=e,c--,e.valid=!1,e=Ss(a);for(e=Ts(a);null!==e;)d[b]=e,b++,e.valid=!1,e=Ts(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.Vm(b),b.rev=!0);break;case xs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.wm=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.gp=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& Us(this,b);for(d.reset();d.next();)b=d.value,-1===b.wm&&Us(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.wmd){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&&Os(a,h,0,-1,!0,!1)}for(Os(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 Es(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} ws.prototype.initializeIndices=function(){switch(this.xl){default:case at:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.mc[c];this.mc[c]++}break;case zs:a=this.network.vertexes.iterator;for(b=this.Ea;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&bt(this,c);break;case ct:for(a=this.network.vertexes.iterator,b=0;b<=this.Ea;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&dt(this,c)}}; function bt(a,b){var c=b.layer;b.index=a.mc[c];a.mc[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=ft(this,d,-1)||f;e=this.countCrossings();e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=ft(this,d,1)||f;e=this.countCrossings();e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=ft(this,d,1)||f;e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= ft(this,d,-1)||f;e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=ft(this,d,0)||f;e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=ft(this,d,0)||f;e>=a?Js(this,b):(a=e,b=Is(this))}break;default:case As:for(c=this.Ea,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=ft(this,d,-1)||f;e=this.countCrossings();e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=ft(this,d,1)||f;e=this.countCrossings();e>=a?Js(this,b): (a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=ft(this,d,1)||f;e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=ft(this,d,-1)||f;e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=ft(this,d,0)||f;e>=a?Js(this,b):(a=e,b=Is(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=ft(this,d,0)||f;e>=a?Js(this,b):(a=e,b=Is(this))}}Js(this,b)}; function et(a,b,c){F&&(C(b,ws,"medianBarycenterCrossingReduction:unfixedLayer"),C(c,ws,"medianBarycenterCrossingReduction:direction"));var d=Fs(a,b),e=a.mc[b],f=Ns(a,b,c),g=Ms(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],V=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-w));-1!==V&&(B+=Math.abs(V-u),z+=Math.abs(V-w));if(r>1)+8*d;this.Ja*=8}if(0!==(this.vg&2))for(c=!0;c;){c=!1;for(b=this.yd+1;b<=this.Ea;b++)c=it(this,b,1)||c;for(b= this.yd-1;0<=b;b--)c=it(this,b,-1)||c;c=it(this,this.yd,0)||c}if(0!==(this.vg&4)){for(b=this.yd+1;b<=this.Ea;b++)jt(this,b,1);for(b=this.yd-1;0<=b;b--)jt(this,b,-1);jt(this,this.yd,0)}a&&(kt(this,-1),kt(this,1));if(0!==(this.vg&2))for(c=!0;c;){c=!1;c=it(this,this.yd,0)||c;for(b=this.yd+1;b<=this.Ea;b++)c=it(this,b,0)||c;for(b=this.yd-1;0<=b;b--)c=it(this,b,0)||c}}; function it(a,b,c){F&&(C(b,ws,"bendStraighten:unfixedLayer"),C(c,ws,"bendStraighten:direction"));for(var d=!1;lt(a,b,c);)d=!0;return d} function lt(a,b,c){F&&(C(b,ws,"shiftbendStraighten:unfixedLayer"),C(c,ws,"shiftbendStraighten:direction"));var d,e=Fs(a,b),f=a.mc[b],g=Ms(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 w=e[d].sourceEdges.iterator;w.next();){var y=w.value;var z=y.fromVertex;if(y.valid&&z.layer!==b){var B=Hs(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(w=e[d].destinationEdges.iterator;w.next();)y=w.value,z=y.toVertex,y.valid&&z.layer!==b&&(B=Hs(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;w=g[e[d].index];z=h[e[d].index];-1!==w&&(B+=Math.abs(w-m),D+=Math.abs(w-r),y+=Math.abs(w-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)}Gs(a,b, d);a.normalize()}function mt(a,b){F&&(C(b,ws,"packAux:column"),C(1,ws,"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 nt(a,b){F&&(C(b,ws,"tightPackAux:column"),C(1,ws,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Ea;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.Ea;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 kt(a,b){F&&C(b,ws,"componentPack:direction");for(var c=0;c<=a.Ja;c++)for(;mt(a,c););a.normalize();for(c=0;cf?Js(a,e):gb)for(c=a.Ja;0<=c;c--)for(e=Is(a),f=Ls(a),d=f+1;ff?Js(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Xd);a.Xd++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Ps(a,b,a.Xd,-1,!0,!0),a.Xd++);var f;b=[];for(f=0;fc)for(g=a.Ja;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} ws.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=Ds(this,!0),b=Ds(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.Iv();this.isRouting&&this.commitLinks()};function Ds(a,b){return 270===a.M?b?qd:td:90===a.M?b?td:qd:180===a.M?b?rd:sd:b?sd:rd} ws.prototype.commitNodes=function(){this.Td=[];this.xd=[];this.wd=[];this.Ma=[];for(var a=0;a<=this.Ea;a++)this.Td[a]=0,this.xd[a]=0,this.wd[a]=0,this.Ma[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.Td[c]=Math.max(this.Td[c],this.nodeMinLayerSpace(b,!0));this.xd[c]=Math.max(this.xd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.ze;for(var d=0;d<=this.Ea;d++){var e=c;0>=this.Td[d]+this.xd[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++,w,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++,w+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.Td[u.layer]),G=Math.max(10,this.xd[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!==Gc||p)if(w=b.i(q-1).x,y=b.i(q- 1).y,B=b.i(q).x,D=b.i(q).y,p)n=this.xd[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,w,n),b.N(q-1,w,n-z)):270===this.M&&D>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.N(q-2,w,n),b.N(q-1,w,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.Td[m.layer]);G=Math.max(10, this.xd[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++,w,D+p)}b.m(q++,B,D)}}else{for(;null!==m&&m!==n;){z=u=null;for(m=m.destinationEdges.iterator;m.next()&&(w=m.value,w.link!==c.link||(u=w.toVertex,z=w.fromVertex,null!==z.node&&(z=null),null!==u.node)););u!==n&&(w=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.Ma[u.layer]+this.Sf.x,q===b.firstPickIndex+1&&(z=0===this.M?Math.max(z,w):Math.min(z,w)),b.m(q++,z,y),b.m(q++,z,D)):(null!==z?z.centerX:w)!==B&&(z=this.Ma[u.layer]+this.Sf.y,q===b.firstPickIndex+1&&(z=90===this.M?Math.max(z,y):Math.min(z,y)),b.m(q++,w,z),b.m(q++,B,z)):(z=Math.max(10,this.Td[u.layer]),G=Math.max(10,this.xd[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&&(w=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+w)/2,this.Ma[n.layer]+this.Sf.x),B):Math.max(Math.min((B+w)/2,this.Ma[n.layer]+this.Sf.x),B),b.m(q++,z,y),b.m(q++,z,D)):w!==B&&(z=90===this.M?Math.min(Math.max((D+y)/2,this.Ma[n.layer]+this.Sf.y),D):Math.max(Math.min((D+y)/2,this.Ma[n.layer]+this.Sf.y),D),b.m(q++,w,z),b.m(q++,B,z)))}null!== d&&r&&(null!==g&&(l===Gc&&(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,Gc,!0,!1,f,h),l.o()||l.set(e.actualBounds.center),b.N(0,l.x,l.y)),null!==h&&(k===Gc&&(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,Gc,!1,!1,e,g),e.o()||e.set(f.actualBounds.center),b.N(b.pointsCount-1,e.x,e.y)));b.Df();c.commit()}}}this.avoidOrthogonalOverlaps()}; ws.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){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.adb.ad?1:a.zcb.zc?1:0:0};t.Oy=function(a,b){return a instanceof pt&&b instanceof pt&&a!==b?a.firstb.first||a.lb.l||a.adb.ad?1:a.zcb.zc?1:0:0}; t.ju=function(a,b){return a instanceof pt&&b instanceof pt&&a!==b?a.ccb.cc||a.lb.l||a.adb.ad?1:a.zcb.zc?1:0:0};t.C=function(a,b){F&&(C(a,ws,"isApprox:a"),C(b,ws,"isApprox:b"));a-=b;return-1a}; t.tj=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.De.length){var d=[];for(var e=0;ea&&(this.vg=a,this.D()))}},setsPortSpots:{configurable:!0,get:function(){return this.qf},set:function(a){this.qf!==a&&(A(a,"boolean",ws,"setsPortSpots"),this.qf=a,this.D())}},linkSpacing:{configurable:!0,get:function(){return this.Lo},set:function(a){this.Lo!==a&&(A(a,"number",ws,"linkSpacing"),0<=a&&(this.Lo=a,this.D()))}},maxLayer:{configurable:!0, get:function(){return this.Ea}},maxIndex:{configurable:!0,get:function(){return this.zs}},maxColumn:{configurable:!0,get:function(){return this.Ja}},minIndexLayer:{configurable:!0,get:function(){return this.Wo}},maxIndexLayer:{configurable:!0,get:function(){return this.yd}}}); var xs=new E(ws,"CycleDepthFirst",0),Qs=new E(ws,"CycleGreedy",1),Cs=new E(ws,"CycleFromLayers",2),ys=new E(ws,"LayerOptimalLinkLength",0),Vs=new E(ws,"LayerLongestPathSink",1),Xs=new E(ws,"LayerLongestPathSource",2),zs=new E(ws,"InitDepthFirstOut",0),ct=new E(ws,"InitDepthFirstIn",1),at=new E(ws,"InitNaive",2),gt=new E(ws,"AggressiveNone",0),As=new E(ws,"AggressiveLess",1),ht=new E(ws,"AggressiveMore",2);ws.className="LayeredDigraphLayout";ws.CycleDepthFirst=xs;ws.CycleGreedy=Qs; ws.CycleFromLayers=Cs;ws.LayerOptimalLinkLength=ys;ws.LayerLongestPathSink=Vs;ws.LayerLongestPathSource=Xs;ws.InitDepthFirstOut=zs;ws.InitDepthFirstIn=ct;ws.InitNaive=at;ws.AggressiveNone=gt;ws.AggressiveLess=As;ws.AggressiveMore=ht;ws.PackNone=0;ws.PackExpand=1;ws.PackStraighten=2;ws.PackMedian=4;ws.PackAll=7;function pt(){this.index=this.zc=this.ad=this.cc=this.first=this.layer=0;this.link=null;this.l=0}pt.className="SegInfo";function Bs(a){hq.call(this,a)}la(Bs,hq);Bs.prototype.createVertex=function(){return new rt(this)}; Bs.prototype.createEdge=function(){return new st(this)};Bs.className="LayeredDigraphNetwork";function rt(a){kq.call(this,a);this.Ua=this.Xg=this.Hi=-1;this.L=NaN;this.W=null;this.valid=!1;this.finish=this.wm=NaN;this.kk=0;this.mw=this.nw=null}la(rt,kq); ma.Object.defineProperties(rt.prototype,{layer:{configurable:!0,get:function(){return this.Hi},set:function(a){this.Hi!==a&&(A(a,"number",rt,"layer"),this.Hi=a)}},column:{configurable:!0,get:function(){return this.Xg},set:function(a){this.Xg!==a&&(A(a,"number",rt,"column"),this.Xg=a)}},index:{configurable:!0,get:function(){return this.Ua},set:function(a){this.Ua!==a&&(A(a,"number",rt,"index"),this.Ua=a)}},component:{configurable:!0,get:function(){return this.L}, set:function(a){this.L!==a&&(A(a,"number",rt,"component"),this.L=a)}},near:{configurable:!0,get:function(){return this.W},set:function(a){this.W!==a&&(F&&null!==a&&x(a,rt,rt,"near"),this.W=a)}}});rt.className="LayeredDigraphVertex";function st(a){lq.call(this,a);this.l=this.Oa=this.ib=!1;this.Na=this.L=NaN;this.W=this.w=0}la(st,lq); ma.Object.defineProperties(st.prototype,{valid:{configurable:!0,get:function(){return this.ib},set:function(a){this.ib!==a&&(A(a,"boolean",st,"valid"),this.ib=a)}},rev:{configurable:!0,get:function(){return this.Oa},set:function(a){this.Oa!==a&&(A(a,"boolean",st,"rev"),this.Oa=a)}},forest:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(A(a,"boolean",st,"forest"),this.l=a)}},portFromPos:{configurable:!0,get:function(){return this.L}, set:function(a){this.L!==a&&(A(a,"number",st,"portFromPos"),this.L=a)}},portToPos:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na!==a&&(A(a,"number",st,"portToPos"),this.Na=a)}},portFromColOffset:{configurable:!0,get:function(){return this.w},set:function(a){this.w!==a&&(A(a,"number",st,"portFromColOffset"),this.w=a)}},portToColOffset:{configurable:!0,get:function(){return this.W},set:function(a){this.W!==a&&(A(a,"number",st,"portToColOffset"), this.W=a)}}});st.className="LayeredDigraphEdge";function Z(){0b.level)return!1;a.removeChild(c.parent,c)}return!0} Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){F&&x(a,zt,Z,"removeChild:p");F&&x(b,zt,Z,"removeChild:c");for(var c=a.children,d=0,e=0;ee?lu(a,g,X,y,z):mu(a,g,X,y,z);X=z.x;y=z.width;z=z.height;break;case Wt:for(D=0;Dn&&(PTa&&(ru(a,-Ta,0,Da,Ma-1),su(D,-Ta,0),su(G,-Ta,0),Ta=0)}Va.V.h(Ta,ca);y=Math.max(y,O);z=Math.max(z,B+(0===Y?0:q)+xb.height);P=O}else{0n&&(caTa&&(ru(a,0,-Ta,Da,Ma-1),su(D,0,-Ta),su(G,0,-Ta),Ta=0);Va.V.h(P,Ta);z=Math.max(z,V);y=Math.max(y,B+(0===Y?0:q)+xb.width);ca=V}oa++}0l&&(l=0),135u&&(u=0),k===Xt&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>y&&(y=xu(k,d-y,0),g=y.x,h=y.y,y=d,l=0):y=vu(a,y,l),0>l&&(g-=l,l=0),135z&&(z=xu(k,0,w-z),g=z.x,h=z.y,z=w,u=0):z=wu(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])),Y[0].h(l+d,0),Y[1].h(Y[0].x,w),Y[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])),Y[0].h(0,u+w),Y[1].h(d,Y[0].y),Y[2].xd?lu(b,e,oa,B,D):mu(b,e,oa,B,D);oa=D.x;B=D.width;D=D.height;break;case Wt:for(a=0;ap&&(Op&&(Vn&&(n=0),135y&&(y=0));b.ja.h(n,y);b.Aa.h(B,D)}} function lu(a,b,c,d,e){F&&x(a,zt,Z,"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.Aa.width,e=a.Aa.height,new L(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===cu(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.V.x&&(c=Bu(a,b.V.x,!1,c,g))):(b.V.h(d+h,c+g/2-b.focus.y-b.ja.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.ja.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.V.y&&(c=Bu(a,b.V.y,!0,c,g))));return new L(c,0,d,e)} function mu(a,b,c,d,e){F&&x(a,zt,Z,"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.Aa.width,e=b.Aa.height,new L(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===cu(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.V.x&&(c=Bu(a,h.V.x,!1,c,g))):(h.V.h(-d-l.width-q,c+g/2-h.focus.y-h.ja.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.ja.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.V.y&&(c=Bu(a,h.V.y,!0,c,g))));for(a=0;ab&&(b=c+a.width),0>c&&(b-=c),b;case du:return a.width>b?a.width:b;case eu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case Vt:case Lt:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case Wt:return a.width-a.focus.x+a.nodeSpacing/2+b;case Xt:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function wu(a,b,c){F&&x(a,zt,Z,"calculateSubheight:v");switch(a.alignment){case uu:case tu:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case du:return a.height>b?a.height:b;case eu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case Vt:case Lt:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case Wt:return a.height-a.focus.y+a.nodeSpacing/2+b;case Xt:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function xu(a,b,c){F&&x(a,E,Z,"alignOffset:align");switch(a){case tu:b/=2;c/=2;break;case uu:b/=2;c/=2;break;case du:c=b=0;break;case eu:break;default:v("Unhandled alignment value "+a.toString())}return new J(b,c)}function ou(a,b,c,d,e,f){F&&x(a,zt,Z,"shiftRelPosAlign:v");F&&x(b,E,Z,"shiftRelPosAlign:align");b=xu(b,c,d);ru(a,b.x,b.y,e,f)}function ru(a,b,c,d,e){F&&x(a,zt,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].V;f.x+=b;f.y+=c}} function pu(a,b,c,d){F&&(x(b,zt,Z,"recordMidPoints:v"),A(c,"number",Z,"recordMidPoints:x"),A(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.fd){case ut:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case Bt:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.fd.toString())}}function su(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=nu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=nu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=nu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x, k.y);f=nu(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=nu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=nu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=nu(a,n.length+f.length); for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=nu(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}function ju(a){F&&x(a,zt,Z,"computeLayerSpacing:v");var b=cu(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.Y.nodeIndentPastParent=a,this.D()))}},nodeSpacing:{configurable:!0,get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(A(a,"number",Z,"nodeSpacing"),this.Y.nodeSpacing=a,this.D())}},layerSpacing:{configurable:!0,get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(A(a,"number",Z,"layerSpacing"),this.Y.layerSpacing=a,this.D())}},layerSpacingParentOverlap:{configurable:!0, enumerable:!0,get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.D()))}},compaction:{configurable:!0,get:function(){return this.Y.compaction},set:function(a){this.Y.compaction!==a&&(hb(a,Z,Z,"compaction"),a===$t||a===bu)&&(this.Y.compaction=a,this.D())}},breadthLimit:{configurable:!0,get:function(){return this.Y.breadthLimit}, set:function(a){this.Y.breadthLimit!==a&&(A(a,"number",Z,"breadthLimit"),0<=a&&(this.Y.breadthLimit=a,this.D()))}},rowSpacing:{configurable:!0,get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(A(a,"number",Z,"rowSpacing"),this.Y.rowSpacing=a,this.D())}},rowIndent:{configurable:!0,get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&(A(a,"number",Z,"rowIndent"),0<=a&&(this.Y.rowIndent=a,this.D()))}},commentSpacing:{configurable:!0, enumerable:!0,get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(A(a,"number",Z,"commentSpacing"),this.Y.commentSpacing=a,this.D())}},commentMargin:{configurable:!0,get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(A(a,"number",Z,"commentMargin"),this.Y.commentMargin=a,this.D())}},setsPortSpot:{configurable:!0,get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(A(a, "boolean",Z,"setsPortSpot"),this.Y.setsPortSpot=a,this.D())}},portSpot:{configurable:!0,get:function(){return this.Y.portSpot},set:function(a){x(a,M,Z,"portSpot");this.Y.portSpot.A(a)||(this.Y.portSpot=a,this.D())}},setsChildPortSpot:{configurable:!0,get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(A(a,"boolean",Z,"setsChildPortSpot"),this.Y.setsChildPortSpot=a,this.D())}},childPortSpot:{configurable:!0,get:function(){return this.Y.childPortSpot}, set:function(a){x(a,M,Z,"childPortSpot");this.Y.childPortSpot.A(a)||(this.Y.childPortSpot=a,this.D())}},alternateSorting:{configurable:!0,get:function(){return this.Z.sorting},set:function(a){this.Z.sorting!==a&&(hb(a,Z,Z,"alternateSorting"),a===Qt||a===Rt||a===St||Tt)&&(this.Z.sorting=a,this.D())}},alternateComparer:{configurable:!0,get:function(){return this.Z.comparer},set:function(a){this.Z.comparer!==a&&(A(a,"function",Z,"alternateComparer"),this.Z.comparer=a,this.D())}}, alternateAngle:{configurable:!0,get:function(){return this.Z.angle},set:function(a){this.Z.angle!==a&&(A(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.Z.angle=a,this.D())}},alternateAlignment:{configurable:!0,get:function(){return this.Z.alignment},set:function(a){this.Z.alignment!==a&&(hb(a,Z,Z,"alternateAlignment"),this.Z.alignment=a,this.D())}},alternateNodeIndent:{configurable:!0,get:function(){return this.Z.nodeIndent},set:function(a){this.Z.nodeIndent!== a&&(A(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.Z.nodeIndent=a,this.D()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.Z.nodeIndentPastParent},set:function(a){this.Z.nodeIndentPastParent!==a&&(A(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.Z.nodeIndentPastParent=a,this.D()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.Z.nodeSpacing},set:function(a){this.Z.nodeSpacing!==a&&(A(a,"number",Z,"alternateNodeSpacing"), this.Z.nodeSpacing=a,this.D())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.Z.layerSpacing},set:function(a){this.Z.layerSpacing!==a&&(A(a,"number",Z,"alternateLayerSpacing"),this.Z.layerSpacing=a,this.D())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.Z.layerSpacingParentOverlap},set:function(a){this.Z.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.Z.layerSpacingParentOverlap= a,this.D()))}},alternateCompaction:{configurable:!0,get:function(){return this.Z.compaction},set:function(a){this.Z.compaction!==a&&(hb(a,Z,Z,"alternateCompaction"),a===$t||a===bu)&&(this.Z.compaction=a,this.D())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.Z.breadthLimit},set:function(a){this.Z.breadthLimit!==a&&(A(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.Z.breadthLimit=a,this.D()))}},alternateRowSpacing:{configurable:!0,get:function(){return this.Z.rowSpacing}, set:function(a){this.Z.rowSpacing!==a&&(A(a,"number",Z,"alternateRowSpacing"),this.Z.rowSpacing=a,this.D())}},alternateRowIndent:{configurable:!0,get:function(){return this.Z.rowIndent},set:function(a){this.Z.rowIndent!==a&&(A(a,"number",Z,"alternateRowIndent"),0<=a&&(this.Z.rowIndent=a,this.D()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.Z.commentSpacing},set:function(a){this.Z.commentSpacing!==a&&(A(a,"number",Z,"alternateCommentSpacing"), this.Z.commentSpacing=a,this.D())}},alternateCommentMargin:{configurable:!0,get:function(){return this.Z.commentMargin},set:function(a){this.Z.commentMargin!==a&&(A(a,"number",Z,"alternateCommentMargin"),this.Z.commentMargin=a,this.D())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.Z.setsPortSpot},set:function(a){this.Z.setsPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsPortSpot"),this.Z.setsPortSpot=a,this.D())}},alternatePortSpot:{configurable:!0, enumerable:!0,get:function(){return this.Z.portSpot},set:function(a){x(a,M,Z,"alternatePortSpot");this.Z.portSpot.A(a)||(this.Z.portSpot=a,this.D())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.Z.setsChildPortSpot},set:function(a){this.Z.setsChildPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsChildPortSpot"),this.Z.setsChildPortSpot=a,this.D())}},alternateChildPortSpot:{configurable:!0,get:function(){return this.Z.childPortSpot},set:function(a){x(a, M,Z,"alternateChildPortSpot");this.Z.childPortSpot.A(a)||(this.Z.childPortSpot=a,this.D())}}}); var tt=new E(Z,"PathDefault",-1),ut=new E(Z,"PathDestination",0),Bt=new E(Z,"PathSource",1),Qt=new E(Z,"SortingForwards",10),Rt=new E(Z,"SortingReverse",11),St=new E(Z,"SortingAscending",12),Tt=new E(Z,"SortingDescending",13),tu=new E(Z,"AlignmentCenterSubtrees",20),uu=new E(Z,"AlignmentCenterChildren",21),du=new E(Z,"AlignmentStart",22),eu=new E(Z,"AlignmentEnd",23),Vt=new E(Z,"AlignmentBus",24),Lt=new E(Z,"AlignmentBusBranching",25),Wt=new E(Z,"AlignmentTopLeftBus",26),Xt=new E(Z,"AlignmentBottomRightBus", 27),$t=new E(Z,"CompactionNone",30),bu=new E(Z,"CompactionBlock",31),vt=new E(Z,"StyleLayered",40),Pt=new E(Z,"StyleLastParents",41),Ot=new E(Z,"StyleAlternating",42),Nt=new E(Z,"StyleRootOnly",43),xt=new E(Z,"ArrangementVertical",50),Du=new E(Z,"ArrangementHorizontal",51),At=new E(Z,"ArrangementFixedRoots",52),wt=new E(Z,"LayerIndividual",60),Jt=new E(Z,"LayerSiblings",61),It=new E(Z,"LayerUniform",62);Z.className="TreeLayout";Z.PathDefault=tt;Z.PathDestination=ut;Z.PathSource=Bt; Z.SortingForwards=Qt;Z.SortingReverse=Rt;Z.SortingAscending=St;Z.SortingDescending=Tt;Z.AlignmentCenterSubtrees=tu;Z.AlignmentCenterChildren=uu;Z.AlignmentStart=du;Z.AlignmentEnd=eu;Z.AlignmentBus=Vt;Z.AlignmentBusBranching=Lt;Z.AlignmentTopLeftBus=Wt;Z.AlignmentBottomRightBus=Xt;Z.CompactionNone=$t;Z.CompactionBlock=bu;Z.StyleLayered=vt;Z.StyleLastParents=Pt;Z.StyleAlternating=Ot;Z.StyleRootOnly=Nt;Z.ArrangementVertical=xt;Z.ArrangementHorizontal=Du;Z.ArrangementFixedRoots=At;Z.LayerIndividual=wt; Z.LayerSiblings=Jt;Z.LayerUniform=It;function yt(a){hq.call(this,a)}la(yt,hq);yt.prototype.createVertex=function(){return new zt(this)};yt.prototype.createEdge=function(){return new Fu(this)};yt.className="TreeNetwork"; function zt(a){kq.call(this,a);this.Na=!1;this.Qc=null;this.L=[];this.qd=this.ib=this.W=this.Oa=0;this.ed=null;this.V=new J(0,0);this.Aa=new Hb(0,0);this.ja=new J(0,0);this.Xm=this.Wm=this.TA=!1;this.fr=this.Tq=null;this.Yc=Qt;this.Tc=rq;this.dc=0;this.Cb=uu;this.Js=this.Is=0;this.Ks=20;this.ze=50;this.xs=0;this.Jr=bu;this.Br=0;this.Xs=25;this.Ir=this.Ws=10;this.Hr=20;this.jt=!0;this.Ts=ld;this.it=!0;this.Er=ld}la(zt,kq); zt.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.Yc=a.sorting,this.Tc=a.comparer,this.dc=a.angle,this.Cb=a.alignment,this.Is=a.nodeIndent,this.Js=a.nodeIndentPastParent,this.Ks=a.nodeSpacing,this.ze=a.layerSpacing,this.xs=a.layerSpacingParentOverlap,this.Jr=a.compaction,this.Br=a.breadthLimit,this.Xs=a.rowSpacing,this.Ws=a.rowIndent,this.Ir=a.commentSpacing,this.Hr=a.commentMargin,this.jt=a.setsPortSpot,this.Ts=a.portSpot,this.it=a.setsChildPortSpot,this.Er=a.childPortSpot)}; ma.Object.defineProperties(zt.prototype,{initialized:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na!==a&&(A(a,"boolean",zt,"initialized"),this.Na=a)}},parent:{configurable:!0,get:function(){return this.Qc},set:function(a){this.Qc!==a&&(F&&null!==a&&x(a,zt,zt,"parent"),this.Qc=a)}},children:{configurable:!0,get:function(){return this.L},set:function(a){if(this.L!==a){null===a||Array.isArray(a)||xa(a,"Array",zt,"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-ku(c))))):c.alignment===du?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-ku(c))))):c.alignment===du?(e=d.left+b.x,0===b.x&&m.xp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-ku(c))))):c.alignment===du?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-ku(c))))):c.alignment===du?(e=d.left+b.x,0===b.x&&m.x