/* * GoJS v2.2.16 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-2022 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.2.16/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function ba(a){var b=0;return function(){return b=e}}); ra("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(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 La(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 Na(){var a=Oa.pop();return void 0===a?[]:a}function Pa(a){a.length=0;Oa.push(a)}function ya(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""} function Qa(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(Ga(a)&&a.constructor)return Qa(a.constructor);return typeof a} function Ra(a){var b=a;Ga(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 Sa(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.EA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ta(a,b,c){Object.defineProperty(Ua.prototype,a,{get:b,set:c})} function Va(a){for(var b=[],c=0;256>c;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;Da(a)}a=a.s;var b=a.length,c=++this.bb,d=this.qf;if(null!==d)for(;cthis.key)return!1;Da(a)}var b=--this.bb;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.ce();return!1};ib.prototype.Ad=function(){return this.next()}; ib.prototype.first=function(){var a=this.Cb;this.ta=a.A;var b=a.s;this.bb=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};ib.prototype.any=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=b.s,e=d.length;this.bb=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.A!==c&&Da(b)}return!1};ib.prototype.all=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=b.s,e=d.length;this.bb=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.A!==c&&Da(b)}return!0}; ib.prototype.each=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=b.s,e=d.length;this.bb=e;for(--e;0<=e;e--)a(d[e]),b.A!==c&&Da(b);return this};ib.prototype.map=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=[],e=b.s,f=e.length;this.bb=f;for(--f;0<=f;f--)d.push(a(e[f])),b.A!==c&&Da(b);a=new H;a.s=d;a.xb();return a.iterator}; ib.prototype.filter=function(a){var b=this.Cb;b.Kg=null;var c=b.A,d=[],e=b.s,f=e.length;this.bb=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.A!==c&&Da(b)}a=new H;a.s=d;a.xb();return a.iterator};ib.prototype.ce=function(){this.key=-1;this.value=null;this.ta=-1;this.Cb.Kg=this};ib.prototype.toString=function(){return"ListIteratorBackwards("+this.bb+"/"+this.Cb.count+")"}; oa.Object.defineProperties(ib.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.Cb.s.length}}});ib.prototype.first=ib.prototype.first;ib.prototype.hasNext=ib.prototype.Ad;ib.prototype.next=ib.prototype.next;ib.prototype.reset=ib.prototype.reset;ib.className="ListIteratorBackwards"; function H(a){Za(this);this._isFrozen=!1;this.s=[];this.A=0;this.Kg=this.Ua=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=H.prototype;t.xb=function(){var a=this.A;a++;999999999a||a>=b.length)&&Ba(a,"0 <= i < length",H,"elt:i");return b[a]};t.get=function(a){return this.N(a)};t.ad=function(a,b){G&&E(a,H,"setElt:i");var c=this.s;(0>a||a>=c.length)&&Ba(a,"0 <= i < length",H,"setElt:i");this._isFrozen&&xa(this,a);c[a]=b};t.set=function(a,b){this.ad(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]}; t.lc=function(){var a=this.s,b=a.length;return 0a&&Ba(a,">= 0",H,"insertAt:i");this._isFrozen&&xa(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.xb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&xa(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.xb();return!0};t.delete=function(a){return this.remove(a)}; t.sb=function(a){G&&E(a,H,"removeAt:i");var b=this.s;(0>a||a>=b.length)&&Ba(a,"0 <= i < length",H,"removeAt:i");this._isFrozen&&xa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.xb()};t.removeRange=function(a,b){G&&(E(a,H,"removeRange:from"),E(b,H,"removeRange:to"));var c=this.s,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._isFrozen&&xa(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&Ba(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.s.length)return fb;var a=this.Ua;return null!==a?(a.reset(),a):new hb(this)}},iteratorBackwards:{configurable:!0, enumerable:!0,get:function(){if(0>=this.s.length)return fb;var a=this.Kg;return null!==a?(a.reset(),a):new ib(this)}}});H.prototype.reverse=H.prototype.reverse;H.prototype.sortRange=H.prototype.Ei;H.prototype.sort=H.prototype.sort;H.prototype.toSet=H.prototype.zv;H.prototype.toArray=H.prototype.Ka;H.prototype.removeRange=H.prototype.removeRange;H.prototype.removeAt=H.prototype.sb;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.insertAt=H.prototype.Hb; H.prototype.pop=H.prototype.pop;H.prototype.last=H.prototype.lc;H.prototype.first=H.prototype.first;H.prototype.set=H.prototype.set;H.prototype.setElt=H.prototype.ad;H.prototype.get=H.prototype.get;H.prototype.elt=H.prototype.N;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.pa; H.prototype.freeze=H.prototype.freeze;H.className="List";function mb(a){this.ig=a;a.Ua=null;this.ta=a.A;this.xa=null}mb.prototype.reset=function(){var a=this.ig;a.Ua=null;this.ta=a.A;this.xa=null};mb.prototype.next=function(){var a=this.ig;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.value=b.value,this.key=b.key,!0;this.ce();return!1};mb.prototype.Ad=function(){return this.next()}; mb.prototype.first=function(){var a=this.ig;this.ta=a.A;a=a.ja;if(null!==a){this.xa=a;var b=a.value;this.key=a.key;return this.value=b}return null};mb.prototype.any=function(a){var b=this.ig;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};mb.prototype.all=function(a){var b=this.ig;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Aa}return!0}; mb.prototype.each=function(a){var b=this.ig;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Aa;return this};mb.prototype.map=function(a){var b=this.ig;b.Ua=null;for(var c=new H,d=b.A,e=b.ja;null!==e;)c.add(a(e.value)),b.A!==d&&Da(b),e=e.Aa;return c.iterator};mb.prototype.filter=function(a){var b=this.ig;b.Ua=null;for(var c=new H,d=b.A,e=b.ja;null!==e;){var f=e.value;a(f)&&c.add(f);b.A!==d&&Da(b);e=e.Aa}return c.iterator}; mb.prototype.ce=function(){this.value=this.key=null;this.ta=-1;this.ig.Ua=this};mb.prototype.toString=function(){return null!==this.xa?"SetIterator@"+this.xa.value:"SetIterator"};oa.Object.defineProperties(mb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ig.Ub}}});mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.Ad;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset; mb.className="SetIterator";function I(a){Za(this);this._isFrozen=!1;this.Vb={};this.Ub=0;this.Ua=null;this.A=0;this.kf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=I.prototype;t.xb=function(){var a=this.A;a++;999999999=this.Ub)return fb;var a=this.Ua;return null!==a?(a.reset(),a):new mb(this)}}});I.prototype.toList=I.prototype.yv;I.prototype.toArray=I.prototype.Ka; I.prototype.clear=I.prototype.clear;I.prototype.retainAll=I.prototype.oA;I.prototype.removeAll=I.prototype.Xo;I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.first=I.prototype.first;I.prototype.containsAny=I.prototype.Ry;I.prototype.containsAll=I.prototype.Qy;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.pa;I.prototype.freeze=I.prototype.freeze; var pb=1;I.className="Set";I.uniqueHash=Za;I.hashIdUnique=nb;I.hashId=lb;function qb(a){this.ra=a;this.ta=a.A;this.xa=null}qb.prototype.reset=function(){this.ta=this.ra.A;this.xa=null};qb.prototype.next=function(){var a=this.ra;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.value=this.key=a=b.key,!0;this.ce();return!1};qb.prototype.Ad=function(){return this.next()}; qb.prototype.first=function(){var a=this.ra;this.ta=a.A;a=a.ja;return null!==a?(this.xa=a,this.value=this.key=a=a.key):null};qb.prototype.any=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d.key))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};qb.prototype.all=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d.key))return!1;b.A!==c&&Da(b);d=d.Aa}return!0}; qb.prototype.each=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d.key),b.A!==c&&Da(b),d=d.Aa;return this};qb.prototype.map=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)d.add(a(e.key)),b.A!==c&&Da(b),e=e.Aa;return d.iterator};qb.prototype.filter=function(a){var b=this.ra,c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;){var f=e.key;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Aa}return d.iterator}; qb.prototype.ce=function(){this.value=this.key=null;this.ta=-1};qb.prototype.toString=function(){return null!==this.xa?"MapKeySetIterator@"+this.xa.value:"MapKeySetIterator"};oa.Object.defineProperties(qb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ra.Ub}}});qb.prototype.first=qb.prototype.first;qb.prototype.hasNext=qb.prototype.Ad;qb.prototype.next=qb.prototype.next;qb.prototype.reset=qb.prototype.reset; qb.className="MapKeySetIterator";function rb(a){I.call(this);Za(this);this._isFrozen=!0;this.ra=a}na(rb,I);t=rb.prototype;t.freeze=function(){return this};t.pa=function(){return this};t.toString=function(){return"MapKeySet("+this.ra.toString()+")"};t.add=function(){v("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ra.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){v("This Set is read-only: "+this.toString())};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.ra.ja;return null!==a?a.key:null};rb.prototype.any=function(a){for(var b=this.ra.ja;null!==b;){if(a(b.key))return!0;b=b.Aa}return!1};rb.prototype.all=function(a){for(var b=this.ra.ja;null!==b;){if(!a(b.key))return!1;b=b.Aa}return!0};rb.prototype.each=function(a){for(var b=this.ra.ja;null!==b;)a(b.key),b=b.Aa;return this}; rb.prototype.map=function(a){for(var b=new I,c=this.ra.ja;null!==c;)b.add(a(c.key)),c=c.Aa;return b};rb.prototype.filter=function(a){for(var b=new I,c=this.ra.ja;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Aa}return b};rb.prototype.copy=function(){return new rb(this.ra)};rb.prototype.zv=function(){var a=new I,b=this.ra.Vb,c;for(c in b)a.add(b[c].key);return a};rb.prototype.Ka=function(){var a=this.ra.Vb,b=Array(this.ra.Ub),c=0,d;for(d in a)b[c]=a[d].key,c++;return b}; rb.prototype.yv=function(){var a=new H,b=this.ra.Vb,c;for(c in b)a.add(b[c].key);return a};oa.Object.defineProperties(rb.prototype,{count:{configurable:!0,get:function(){return this.ra.Ub}},size:{configurable:!0,get:function(){return this.ra.Ub}},iterator:{configurable:!0,get:function(){return 0>=this.ra.Ub?fb:new qb(this.ra)}}});rb.prototype.toList=rb.prototype.yv;rb.prototype.toArray=rb.prototype.Ka;rb.prototype.toSet=rb.prototype.zv; rb.prototype.first=rb.prototype.first;rb.prototype.clear=rb.prototype.clear;rb.prototype["delete"]=rb.prototype.delete;rb.prototype.remove=rb.prototype.remove;rb.prototype.has=rb.prototype.has;rb.prototype.contains=rb.prototype.contains;rb.prototype.add=rb.prototype.add;rb.prototype.thaw=rb.prototype.pa;rb.prototype.freeze=rb.prototype.freeze;rb.className="MapKeySet";function ub(a){this.ra=a;a.jf=null;this.ta=a.A;this.xa=null} ub.prototype.reset=function(){var a=this.ra;a.jf=null;this.ta=a.A;this.xa=null};ub.prototype.next=function(){var a=this.ra;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.value=b.value,this.key=b.key,!0;this.ce();return!1};ub.prototype.Ad=function(){return this.next()};ub.prototype.first=function(){var a=this.ra;this.ta=a.A;a=a.ja;if(null!==a){this.xa=a;var b=a.value;this.key=a.key;return this.value=b}return null}; ub.prototype.any=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};ub.prototype.all=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Aa}return!0};ub.prototype.each=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Aa;return this}; ub.prototype.map=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)d.add(a(e.value)),b.A!==c&&Da(b),e=e.Aa;return d.iterator};ub.prototype.filter=function(a){var b=this.ra;b.jf=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;){var f=e.value;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Aa}return d.iterator};ub.prototype.ce=function(){this.value=this.key=null;this.ta=-1;this.ra.jf=this}; ub.prototype.toString=function(){return null!==this.xa?"MapValueSetIterator@"+this.xa.value:"MapValueSetIterator"};oa.Object.defineProperties(ub.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ra.Ub}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.Ad;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapValueSetIterator"; function ob(a,b){this.key=a;this.value=b;this.nl=this.Aa=null}ob.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};ob.className="KeyValuePair";function vb(a){this.ra=a;a.Ua=null;this.ta=a.A;this.xa=null}vb.prototype.reset=function(){var a=this.ra;a.Ua=null;this.ta=a.A;this.xa=null}; vb.prototype.next=function(){var a=this.ra;if(a.A!==this.ta){if(null===this.key)return!1;Da(a)}var b=this.xa;b=null===b?a.ja:b.Aa;if(null!==b)return this.xa=b,this.key=b.key,this.value=b.value,!0;this.ce();return!1};vb.prototype.Ad=function(){return this.next()};vb.prototype.first=function(){var a=this.ra;this.ta=a.A;a=a.ja;return null!==a?(this.xa=a,this.key=a.key,this.value=a.value,a):null}; vb.prototype.any=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(a(d))return!0;b.A!==c&&Da(b);d=d.Aa}return!1};vb.prototype.all=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;){if(!a(d))return!1;b.A!==c&&Da(b);d=d.Aa}return!0};vb.prototype.each=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=b.ja;null!==d;)a(d),b.A!==c&&Da(b),d=d.Aa;return this}; vb.prototype.map=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)d.add(a(e)),b.A!==c&&Da(b),e=e.Aa;return d.iterator};vb.prototype.filter=function(a){var b=this.ra;b.Ua=null;var c=b.A;this.xa=null;for(var d=new H,e=b.ja;null!==e;)a(e)&&d.add(e),b.A!==c&&Da(b),e=e.Aa;return d.iterator};vb.prototype.ce=function(){this.value=this.key=null;this.ta=-1;this.ra.Ua=this};vb.prototype.toString=function(){return null!==this.xa?"MapIterator@"+this.xa:"MapIterator"}; oa.Object.defineProperties(vb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ra.Ub}}});vb.prototype.first=vb.prototype.first;vb.prototype.hasNext=vb.prototype.Ad;vb.prototype.next=vb.prototype.next;vb.prototype.reset=vb.prototype.reset;vb.className="MapIterator"; function yb(a){Za(this);this._isFrozen=!1;this.Vb={};this.Ub=0;this.jf=this.Ua=null;this.A=0;this.kf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=yb.prototype;t.xb=function(){var a=this.A;a++;999999999=this.count)return fb;var a=this.Ua;return null!==a?(a.reset(),a):new vb(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?fb:new qb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return fb; var a=this.jf;return null!==a?(a.reset(),a):new ub(this)}}});yb.prototype.toKeySet=yb.prototype.Of;yb.prototype.toArray=yb.prototype.Ka;yb.prototype.clear=yb.prototype.clear;yb.prototype["delete"]=yb.prototype.delete;yb.prototype.remove=yb.prototype.remove;yb.prototype.get=yb.prototype.get;yb.prototype.getValue=yb.prototype.L;yb.prototype.has=yb.prototype.has;yb.prototype.contains=yb.prototype.contains;yb.prototype.first=yb.prototype.first;yb.prototype.addAll=yb.prototype.addAll; yb.prototype.set=yb.prototype.set;yb.prototype.add=yb.prototype.add;yb.prototype.thaw=yb.prototype.pa;yb.prototype.freeze=yb.prototype.freeze;yb.className="Map";function K(a,b){void 0===a?this.K=this.J=0:"number"===typeof a&&"number"===typeof b?(this.J=a,this.K=b):v("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var zb,Ab,Bb,Cb,Db;K.prototype.assign=function(a){this.J=a.J;this.K=a.K;return this};K.prototype.h=function(a,b){this.J=a;this.K=b;return this}; K.prototype.wg=function(a,b){G&&(A(a,"number",K,"setTo:x"),A(b,"number",K,"setTo:y"),this.la());this.J=a;this.K=b;return this};K.prototype.set=function(a){G&&(w(a,K,K,"set:p"),this.la());this.J=a.J;this.K=a.K;return this};K.prototype.copy=function(){var a=new K;a.J=this.J;a.K=this.K;return a};t=K.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){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 K(c,e)}return new K} function Fb(a){G&&w(a,K);return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.D=function(a){return a instanceof K?this.J===a.x&&this.K===a.y:!1};t.ni=function(a,b){return this.J===a&&this.K===b};t.fb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)};t.add=function(a){G&&(w(a,K,K,"add:p"),this.la());this.J+=a.x;this.K+=a.y;return this};t.re=function(a){G&&(w(a,K,K,"subtract:p"),this.la());this.J-=a.x;this.K-=a.y;return this}; t.offset=function(a,b){G&&(E(a,K,"offset:dx"),E(b,K,"offset:dy"),this.la());this.J+=a;this.K+=b;return this};K.prototype.rotate=function(a){G&&(E(a,K,"rotate:angle"),this.la());if(0===a)return this;var b=this.J,c=this.K;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.J=a*b-d*c;this.K=d*b+a*c;return this};t=K.prototype; t.scale=function(a,b){G&&(E(a,K,"scale:sx"),E(b,K,"scale:sy"),this.la());this.J*=a;this.K*=b;return this};t.Df=function(a){G&&w(a,K,K,"distanceSquaredPoint:p");var b=a.x-this.J;a=a.y-this.K;return b*b+a*a};t.zd=function(a,b){G&&(E(a,K,"distanceSquared:px"),E(b,K,"distanceSquared:py"));a-=this.J;b-=this.K;return a*a+b*b};t.normalize=function(){G&&this.la();var a=this.J,b=this.K,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.Py=function(a,b){G&&(w(a,K,K,"compareWithLineSegmentPoint:p"),w(b,K,K,"compareWithLineSegmentPoint:q"));return L.Gl(a.x,a.y,b.x,b.y,this.x,this.y)};t.eA=function(a,b,c,d){G&&(E(a,K,"projectOntoLineSegment:px"),E(b,K,"projectOntoLineSegment:py"),E(c,K,"projectOntoLineSegment:qx"),E(d,K,"projectOntoLineSegment:qy"));L.qh(a,b,c,d,this.J,this.K,this);return this}; t.fA=function(a,b){G&&(w(a,K,K,"projectOntoLineSegmentPoint:p"),w(b,K,K,"projectOntoLineSegmentPoint:q"));L.qh(a.x,a.y,b.x,b.y,this.J,this.K,this);return this};t.tA=function(a,b,c,d){G&&(E(a,K,"snapToGrid:originx"),E(b,K,"snapToGrid:originy"),E(c,K,"snapToGrid:cellwidth"),E(d,K,"snapToGrid:cellheight"));L.Eo(this.J,this.K,a,b,c,d,this);return this};t.uA=function(a,b){G&&(w(a,K,K,"snapToGridPoint:p"),w(b,Hb,K,"snapToGridPoint:q"));L.Eo(this.J,this.K,a.x,a.y,b.width,b.height,this);return this}; t.Ci=function(a,b){G&&(w(a,M,K,"setRectSpot:r"),w(b,Ib,K,"setRectSpot:spot"),this.la());this.J=a.x+b.x*a.width+b.offsetX;this.K=a.y+b.y*a.height+b.offsetY;return this};t.Di=function(a,b,c,d,e){G&&(E(a,K,"setSpot:x"),E(b,K,"setSpot:y"),E(c,K,"setSpot:w"),E(d,K,"setSpot:h"),(0>c||0>d)&&v("Point.setSpot:Width and height cannot be negative"),w(e,Ib,K,"setSpot:spot"),this.la());this.J=a+e.x*c+e.offsetX;this.K=b+e.y*d+e.offsetY;return this}; t.transform=function(a){G&&w(a,Jb,K,"transform:t");a.La(this);return this};function Kb(a,b){G&&w(b,Jb,K,"transformInverted:t");b.Rd(a);return a} function Lb(a,b,c,d,e,f){G&&(E(a,K,"distanceLineSegmentSquared:px"),E(b,K,"distanceLineSegmentSquared:py"),E(c,K,"distanceLineSegmentSquared:ax"),E(d,K,"distanceLineSegmentSquared:ay"),E(e,K,"distanceLineSegmentSquared:bx"),E(f,K,"distanceLineSegmentSquared:by"));var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k} function Mb(a,b,c,d){G&&(E(a,K,"distanceSquared:px"),E(b,K,"distanceSquared:py"),E(c,K,"distanceSquared:qx"),E(d,K,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b}function Nb(a,b,c,d){G&&(E(a,K,"direction:px"),E(b,K,"direction:py"),E(c,K,"direction:qx"),E(d,K,"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.u=function(){return isFinite(this.x)&&isFinite(this.y)};K.alloc=function(){var a=Ob.pop();return void 0===a?new K:a};K.allocAt=function(a,b){var c=Ob.pop();if(void 0===c)return new K(a,b);c.x=a;c.y=b;return c};K.free=function(a){Ob.push(a)}; oa.Object.defineProperties(K.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(A(a,"number",K,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(A(a,"number",K,"y"),this.la(a));this.K=a}}});K.prototype.isReal=K.prototype.u;K.prototype.setSpot=K.prototype.Di;K.prototype.setRectSpot=K.prototype.Ci;K.prototype.snapToGridPoint=K.prototype.uA;K.prototype.snapToGrid=K.prototype.tA; K.prototype.projectOntoLineSegmentPoint=K.prototype.fA;K.prototype.projectOntoLineSegment=K.prototype.eA;K.intersectingLineSegments=function(a,b,c,d,e,f,g,h){G&&(E(a,K,"intersectingLineSegments:a1x"),E(b,K,"intersectingLineSegments:a1y"),E(c,K,"intersectingLineSegments:a2x"),E(d,K,"intersectingLineSegments:a2y"),E(e,K,"intersectingLineSegments:b1x"),E(f,K,"intersectingLineSegments:b1y"),E(g,K,"intersectingLineSegments:b2x"),E(h,K,"intersectingLineSegments:b2y"));return L.Nl(a,b,c,d,e,f,g,h)}; K.prototype.compareWithLineSegmentPoint=K.prototype.Py;K.compareWithLineSegment=function(a,b,c,d,e,f){G&&(E(a,K,"compareWithLineSegment:a1x"),E(b,K,"compareWithLineSegment:a1y"),E(c,K,"compareWithLineSegment:a2x"),E(d,K,"compareWithLineSegment:a2y"),E(e,K,"compareWithLineSegment:b1x"),E(f,K,"compareWithLineSegment:b1y"));return L.Gl(a,b,c,d,e,f)};K.prototype.direction=K.prototype.direction;K.prototype.directionPoint=K.prototype.cb;K.prototype.normalize=K.prototype.normalize; K.prototype.distanceSquared=K.prototype.zd;K.prototype.distanceSquaredPoint=K.prototype.Df;K.prototype.scale=K.prototype.scale;K.prototype.rotate=K.prototype.rotate;K.prototype.offset=K.prototype.offset;K.prototype.subtract=K.prototype.re;K.prototype.add=K.prototype.add;K.prototype.equalsApprox=K.prototype.fb;K.prototype.equalTo=K.prototype.ni;K.prototype.equals=K.prototype.D;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.wg;var Ob=[];K.className="Point";K.parse=Eb;K.stringify=Fb; K.distanceLineSegmentSquared=Lb;K.distanceSquared=Mb;K.direction=Nb;K.Origin=zb=(new K(0,0)).na();K.InfiniteTopLeft=Ab=(new K(-Infinity,-Infinity)).na();K.InfiniteBottomRight=Bb=(new K(Infinity,Infinity)).na();K.SixPoint=Cb=(new K(6,6)).na();K.NoPoint=Db=(new K(NaN,NaN)).na();K.parse=Eb;K.stringify=Fb;K.distanceLineSegmentSquared=Lb;K.distanceSquared=Mb;K.direction=Nb; function Hb(a,b){void 0===a?this.da=this.fa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.fa=a,this.da=b):v("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Pb,Qb,Rb,Sb,Tb,Ub,Vb;Hb.prototype.assign=function(a){this.fa=a.fa;this.da=a.da;return this};Hb.prototype.h=function(a,b){this.fa=a;this.da=b;return this}; Hb.prototype.wg=function(a,b){G&&(A(a,"number",Hb,"setTo:w"),A(b,"number",Hb,"setTo:h"),0>a&&Ba(a,">= 0",Hb,"setTo:w"),0>b&&Ba(b,">= 0",Hb,"setTo:h"),this.la());this.fa=a;this.da=b;return this};Hb.prototype.set=function(a){G&&(w(a,Hb,Hb,"set:s"),this.la());this.fa=a.fa;this.da=a.da;return this};Hb.prototype.copy=function(){var a=new Hb;a.fa=this.fa;a.da=this.da;return a};t=Hb.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function Zb(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 $b(a){G&&w(a,Hb);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.D=function(a){return a instanceof Hb?this.fa===a.width&&this.da===a.height:!1};t.ni=function(a,b){return this.fa===a&&this.da===b}; t.fb=function(a){return L.C(this.fa,a.width)&&L.C(this.da,a.height)};t.Bc=function(a,b){G&&(E(a,Hb,"inflate:w"),E(b,Hb,"inflate:h"));a=this.width+a;this.fa=0<=a?a:0;b=this.height+b;this.da=0<=b?b:0;return this};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};Hb.alloc=function(){var a=ac.pop();return void 0===a?new Hb:a};Hb.free=function(a){ac.push(a)}; oa.Object.defineProperties(Hb.prototype,{width:{configurable:!0,get:function(){return this.fa},set:function(a){G&&(A(a,"number",Hb,"width"),this.la(a));0>a&&Ba(a,">= 0",Hb,"width");this.fa=a}},height:{configurable:!0,get:function(){return this.da},set:function(a){G&&(A(a,"number",Hb,"height"),this.la(a));0>a&&Ba(a,">= 0",Hb,"height");this.da=a}}});Hb.prototype.isReal=Hb.prototype.u;Hb.prototype.inflate=Hb.prototype.Bc;Hb.prototype.equalsApprox=Hb.prototype.fb; Hb.prototype.equalTo=Hb.prototype.ni;Hb.prototype.equals=Hb.prototype.D;Hb.prototype.set=Hb.prototype.set;Hb.prototype.setTo=Hb.prototype.wg;var ac=[];Hb.className="Size";Hb.parse=Zb;Hb.stringify=$b;Hb.ZeroSize=Pb=(new Hb(0,0)).na();Hb.OneSize=Qb=(new Hb(1,1)).na();Hb.SixSize=Rb=(new Hb(6,6)).na();Hb.EightSize=Sb=(new Hb(8,8)).na();Hb.TenSize=Tb=(new Hb(10,10)).na();Hb.InfiniteSize=Ub=(new Hb(Infinity,Infinity)).na();Hb.NoSize=Vb=(new Hb(NaN,NaN)).na();Hb.parse=Zb;Hb.stringify=$b; function M(a,b,c,d){void 0===a?this.da=this.fa=this.K=this.J=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.J=a,this.K=b,this.fa=c,this.da=d):a instanceof K?(c=a.x,a=a.y,b instanceof K?(d=b.x,b=b.y,this.J=Math.min(c,d),this.K=Math.min(a,b),this.fa=Math.abs(c-d),this.da=Math.abs(a-b)):b instanceof Hb?(this.J=c,this.K=a,this.fa=b.width,this.da=b.height):v("Incorrect second argument supplied to Rect constructor "+b)):v("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=M.prototype;t.assign=function(a){this.J=a.J;this.K=a.K;this.fa=a.fa;this.da=a.da;return this};t.h=function(a,b,c,d){this.J=a;this.K=b;this.fa=c;this.da=d;return this};function bc(a,b,c){a.fa=b;a.da=c}t.wg=function(a,b,c,d){G&&(A(a,"number",M,"setTo:x"),A(b,"number",M,"setTo:y"),A(c,"number",M,"setTo:w"),A(d,"number",M,"setTo:h"),0>c&&Ba(c,">= 0",M,"setTo:w"),0>d&&Ba(d,">= 0",M,"setTo:h"),this.la());this.J=a;this.K=b;this.fa=c;this.da=d;return this}; t.set=function(a){G&&(w(a,M,M,"set:r"),this.la());this.J=a.J;this.K=a.K;this.fa=a.fa;this.da=a.da;return this};t.bd=function(a){G&&(w(a,K,M,"setPoint:p"),this.la());this.J=a.x;this.K=a.y;return this};t.sA=function(a){G&&(w(a,Hb,M,"setSize:s"),this.la());this.fa=a.width;this.da=a.height;return this};M.prototype.copy=function(){var a=new M;a.J=this.J;a.K=this.K;a.fa=this.fa;a.da=this.da;return a};t=M.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function cc(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 M(c,e,f,g)}return new M}function dc(a){G&&w(a,M);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.D=function(a){return a instanceof M?this.J===a.x&&this.K===a.y&&this.fa===a.width&&this.da===a.height:!1};t.ni=function(a,b,c,d){return this.J===a&&this.K===b&&this.fa===c&&this.da===d};t.fb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)&&L.C(this.fa,a.width)&&L.C(this.da,a.height)};function ec(a,b){return L.ha(a.J,b.x)&&L.ha(a.K,b.y)&&L.ha(a.fa,b.width)&&L.ha(a.da,b.height)} t.ga=function(a){G&&w(a,K,M,"containsPoint:p");return this.J<=a.x&&this.J+this.fa>=a.x&&this.K<=a.y&&this.K+this.da>=a.y};t.Re=function(a){G&&w(a,M,M,"containsRect:r");return this.J<=a.x&&a.x+a.width<=this.J+this.fa&&this.K<=a.y&&a.y+a.height<=this.K+this.da}; t.contains=function(a,b,c,d){G?(E(a,M,"contains:x"),E(b,M,"contains:y"),void 0===c?c=0:E(c,M,"contains:w"),void 0===d?d=0:E(d,M,"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.J<=a&&a+c<=this.J+this.fa&&this.K<=b&&b+d<=this.K+this.da};t.offset=function(a,b){G&&(E(a,M,"offset:dx"),E(b,M,"offset:dy"),this.la());this.J+=a;this.K+=b;return this}; t.Bc=function(a,b){G&&(E(a,M,"inflate:w"),E(b,M,"inflate:h"));return fc(this,b,a,b,a)};t.so=function(a){G&&w(a,gc,M,"addMargin:m");return fc(this,a.top,a.right,a.bottom,a.left)};t.xv=function(a){G&&w(a,gc,M,"subtractMargin:m");return fc(this,-a.top,-a.right,-a.bottom,-a.left)};t.Iz=function(a,b,c,d){G&&(E(a,M,"grow:t"),E(b,M,"grow:r"),E(c,M,"grow:b"),E(d,M,"grow:l"));return fc(this,a,b,c,d)}; function fc(a,b,c,d,e){G&&a.la();var f=a.fa;c+e<=-f?(a.J+=f/2,a.fa=0):(a.J-=e,a.fa+=c+e);c=a.da;b+d<=-c?(a.K+=c/2,a.da=0):(a.K-=b,a.da+=b+d);return a}t.zx=function(a){G&&w(a,M,M,"intersectRect:r");return hc(this,a.x,a.y,a.width,a.height)};t.Vu=function(a,b,c,d){G&&(E(a,M,"intersect:x"),E(b,M,"intersect:y"),E(c,M,"intersect:w"),E(d,M,"intersect:h"),(0>c||0>d)&&v("Rect.intersect:Width and height cannot be negative"));return hc(this,a,b,c,d)}; function hc(a,b,c,d,e){G&&a.la();var f=Math.max(a.J,b),g=Math.max(a.K,c);b=Math.min(a.J+a.fa,b+d);c=Math.min(a.K+a.da,c+e);a.J=f;a.K=g;a.fa=Math.max(0,b-f);a.da=Math.max(0,c-g);return a}t.Yc=function(a){G&&w(a,M,M,"intersectsRect:r");return this.Wu(a.x,a.y,a.width,a.height)}; t.Wu=function(a,b,c,d){G&&(E(a,M,"intersects:x"),E(b,M,"intersects:y"),E(a,M,"intersects:w"),E(b,M,"intersects:h"),(0>c||0>d)&&v("Rect.intersects:Width and height cannot be negative"));var e=this.fa,f=this.J;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.da;c=this.K;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function ic(a,b){var c=a.fa,d=a.J,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.da;a=a.K;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ze=function(a){G&&w(a,K,M,"unionPoint:p");return lc(this,a.x,a.y,0,0)};t.cd=function(a){G&&w(a,M,M,"unionRect:r");return lc(this,a.J,a.K,a.fa,a.da)}; t.Bv=function(a,b,c,d){G?(E(a,M,"union:x"),E(b,M,"union:y"),void 0===c?c=0:E(c,M,"union:w"),void 0===d?d=0:E(d,M,"union:h"),(0>c||0>d)&&v("Rect.union:Width and height cannot be negative"),this.la()):(void 0===c&&(c=0),void 0===d&&(d=0));return lc(this,a,b,c,d)};function lc(a,b,c,d,e){var f=Math.min(a.J,b),g=Math.min(a.K,c);b=Math.max(a.J+a.fa,b+d);c=Math.max(a.K+a.da,c+e);a.J=f;a.K=g;a.fa=b-f;a.da=c-g;return a} t.Di=function(a,b,c){G&&(E(a,M,"setSpot:x"),E(b,M,"setSpot:y"),w(c,Ib,M,"setSpot:spot"),this.la());this.J=a-c.offsetX-c.x*this.fa;this.K=b-c.offsetY-c.y*this.da;return this}; function mc(a,b,c,d,e,f,g,h){G?(E(a,M,"contains:rx"),E(b,M,"contains:ry"),E(c,M,"contains:rw"),E(d,M,"contains:rh"),E(e,M,"contains:x"),E(f,M,"contains:y"),void 0===g?g=0:E(g,M,"contains:w"),void 0===h?h=0:E(h,M,"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 nc(a,b,c,d,e,f,g,h){G&&(E(a,M,"intersects:rx"),E(b,M,"intersects:ry"),E(c,M,"intersects:rw"),E(d,M,"intersects:rh"),E(e,M,"intersects:x"),E(f,M,"intersects:y"),E(g,M,"intersects:w"),E(h,M,"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.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Oz=function(){return 0===this.width&&0===this.height}; M.alloc=function(){var a=oc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=oc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){oc.push(a)}; oa.Object.defineProperties(M.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(A(a,"number",M,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(A(a,"number",M,"y"),this.la(a));this.K=a}},width:{configurable:!0,get:function(){return this.fa},set:function(a){G&&(A(a,"number",M,"width"),this.la(a));0>a&&Ba(a,">= 0",M,"width");this.fa=a}},height:{configurable:!0,get:function(){return this.da}, set:function(a){G&&(A(a,"number",M,"height"),this.la(a));0>a&&Ba(a,">= 0",M,"height");this.da=a}},left:{configurable:!0,get:function(){return this.J},set:function(a){G&&(A(a,"number",M,"left"),this.la(a));this.J=a}},top:{configurable:!0,get:function(){return this.K},set:function(a){G&&(A(a,"number",M,"top"),this.la(a));this.K=a}},right:{configurable:!0,get:function(){return this.J+this.fa},set:function(a){G&&(E(a,M,"right"),this.la(a));this.J+=a-(this.J+this.fa)}}, bottom:{configurable:!0,get:function(){return this.K+this.da},set:function(a){G&&(E(a,M,"top"),this.la(a));this.K+=a-(this.K+this.da)}},position:{configurable:!0,get:function(){return new K(this.J,this.K)},set:function(a){G&&(w(a,K,M,"position"),this.la(a));this.J=a.x;this.K=a.y}},size:{configurable:!0,get:function(){return new Hb(this.fa,this.da)},set:function(a){G&&(w(a,Hb,M,"size"),this.la(a));this.fa=a.width;this.da=a.height}},center:{configurable:!0, enumerable:!0,get:function(){return new K(this.J+this.fa/2,this.K+this.da/2)},set:function(a){G&&(w(a,K,M,"center"),this.la(a));this.J=a.x-this.fa/2;this.K=a.y-this.da/2}},centerX:{configurable:!0,get:function(){return this.J+this.fa/2},set:function(a){G&&(E(a,M,"centerX"),this.la(a));this.J=a-this.fa/2}},centerY:{configurable:!0,get:function(){return this.K+this.da/2},set:function(a){G&&(E(a,M,"centerY"),this.la(a));this.K=a-this.da/2}}});M.prototype.isEmpty=M.prototype.Oz; M.prototype.isReal=M.prototype.u;M.intersectsLineSegment=function(a,b,c,d,e,f,g,h){G&&(E(a,M,"intersectsLineSegment:x"),E(b,M,"intersectsLineSegment:y"),E(c,M,"intersectsLineSegment:w"),E(d,M,"intersectsLineSegment:h"),E(e,M,"intersectsLineSegment:p1x"),E(f,M,"intersectsLineSegment:p1y"),E(g,M,"intersectsLineSegment:p2x"),E(h,M,"intersectsLineSegment:p2y"),(0>c||0>d)&&v("Rect.intersectsLineSegment: width and height cannot be negative"));return L.Ax(a,b,c,d,e,f,g,h)};M.prototype.setSpot=M.prototype.Di; M.prototype.union=M.prototype.Bv;M.prototype.unionRect=M.prototype.cd;M.prototype.unionPoint=M.prototype.Ze;M.prototype.intersects=M.prototype.Wu;M.prototype.intersectsRect=M.prototype.Yc;M.prototype.intersect=M.prototype.Vu;M.prototype.intersectRect=M.prototype.zx;M.prototype.grow=M.prototype.Iz;M.prototype.subtractMargin=M.prototype.xv;M.prototype.addMargin=M.prototype.so;M.prototype.inflate=M.prototype.Bc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains; M.prototype.containsRect=M.prototype.Re;M.prototype.containsPoint=M.prototype.ga;M.prototype.equalsApprox=M.prototype.fb;M.prototype.equalTo=M.prototype.ni;M.prototype.equals=M.prototype.D;M.prototype.setSize=M.prototype.sA;M.prototype.setPoint=M.prototype.bd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.wg;var pc=null,qc=null,oc=[];M.className="Rect";M.parse=cc;M.stringify=dc;M.contains=mc;M.intersects=nc;M.ZeroRect=pc=(new M(0,0,0,0)).na();M.NoRect=qc=(new M(NaN,NaN,NaN,NaN)).na(); M.parse=cc;M.stringify=dc;M.contains=mc;M.intersects=nc;function gc(a,b,c,d){void 0===a?this.Fe=this.we=this.Oe=this.Pe=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._isFrozen=!1}gc.prototype.assign=function(a){this.Pe=a.Pe;this.Oe=a.Oe;this.we=a.we;this.Fe=a.Fe;return this}; gc.prototype.wg=function(a,b,c,d){G&&(A(a,"number",gc,"setTo:t"),A(b,"number",gc,"setTo:r"),A(c,"number",gc,"setTo:b"),A(d,"number",gc,"setTo:l"),this.la());this.Pe=a;this.Oe=b;this.we=c;this.Fe=d;return this};gc.prototype.set=function(a){G&&(w(a,gc,gc,"assign:m"),this.la());this.Pe=a.Pe;this.Oe=a.Oe;this.we=a.we;this.Fe=a.Fe;return this};gc.prototype.copy=function(){var a=new gc;a.Pe=this.Pe;a.Oe=this.Oe;a.we=this.we;a.Fe=this.Fe;return a};t=gc.prototype; t.na=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function rc(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 gc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new gc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new gc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new gc(c,e):new gc(c,e,f,g)}return new gc} function sc(a){G&&w(a,gc);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.D=function(a){return a instanceof gc?this.Pe===a.top&&this.Oe===a.right&&this.we===a.bottom&&this.Fe===a.left:!1};t.ni=function(a,b,c,d){return this.Pe===a&&this.Oe===b&&this.we===c&&this.Fe===d}; t.fb=function(a){return L.C(this.Pe,a.top)&&L.C(this.Oe,a.right)&&L.C(this.we,a.bottom)&&L.C(this.Fe,a.left)};t.u=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};gc.alloc=function(){var a=xc.pop();return void 0===a?new gc:a};gc.free=function(a){xc.push(a)}; oa.Object.defineProperties(gc.prototype,{top:{configurable:!0,get:function(){return this.Pe},set:function(a){G&&(E(a,gc,"top"),this.la(a));this.Pe=a}},right:{configurable:!0,get:function(){return this.Oe},set:function(a){G&&(E(a,gc,"right"),this.la(a));this.Oe=a}},bottom:{configurable:!0,get:function(){return this.we},set:function(a){G&&(E(a,gc,"bottom"),this.la(a));this.we=a}},left:{configurable:!0,get:function(){return this.Fe},set:function(a){G&& (E(a,gc,"left"),this.la(a));this.Fe=a}}});gc.prototype.isReal=gc.prototype.u;gc.prototype.equalsApprox=gc.prototype.fb;gc.prototype.equalTo=gc.prototype.ni;gc.prototype.equals=gc.prototype.D;gc.prototype.set=gc.prototype.set;gc.prototype.setTo=gc.prototype.wg;var yc=null,zc=null,xc=[];gc.className="Margin";gc.parse=rc;gc.stringify=sc;gc.ZeroMargin=yc=(new gc(0,0,0,0)).na();gc.TwoMargin=zc=(new gc(2,2,2,2)).na();gc.parse=rc;gc.stringify=sc; function Ib(a,b,c,d){void 0===a?this.le=this.ke=this.K=this.J=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._isFrozen=!1}var Ec,Fc,Gc,Hc,Jc,Kc,Lc,Mc,Nc,Oc,Qc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,$c,ad,ed,fd,gd,hd,id,jd,kd,ld,md,pd,qd,rd,sd,td;Ib.prototype.assign=function(a){this.J=a.J;this.K=a.K;this.ke=a.ke;this.le=a.le;return this}; Ib.prototype.wg=function(a,b,c,d){G&&(ud(a,"setTo:x"),ud(b,"setTo:y"),vd(c,"setTo:offx"),vd(d,"setTo:offy"),this.la());this.J=a;this.K=b;this.ke=c;this.le=d;return this};Ib.prototype.set=function(a){G&&(w(a,Ib,Ib,"set:s"),this.la());this.J=a.J;this.K=a.K;this.ke=a.ke;this.le=a.le;return this};Ib.prototype.copy=function(){var a=new Ib;a.J=this.J;a.K=this.K;a.ke=this.ke;a.le=this.le;return a};t=Ib.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function wd(a,b){a.J=NaN;a.K=NaN;a.ke=b;return a} function ud(a,b){(isNaN(a)||1a)&&Ba(a,"0 <= "+b+" <= 1",Ib,b)}function vd(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&Ba(a,"real number, not NaN or Infinity",Ib,b)} function xd(a){if("string"===typeof a){a=a.trim();if("None"===a)return Ec;if("TopLeft"===a)return Fc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Gc;if("TopRight"===a)return Hc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Jc;if("Center"===a)return Kc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Lc;if("BottomLeft"===a)return Mc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Nc;if("BottomRight"===a)return Oc;if("TopSide"===a)return Qc;if("LeftSide"=== a)return Rc;if("RightSide"===a)return Sc;if("BottomSide"===a)return Tc;if("TopBottomSides"===a)return Uc;if("LeftRightSides"===a)return Vc;if("TopLeftSides"===a)return Wc;if("TopRightSides"===a)return Xc;if("BottomLeftSides"===a)return Yc;if("BottomRightSides"===a)return Zc;if("NotTopSide"===a)return $c;if("NotLeftSide"===a)return ad;if("NotRightSide"===a)return ed;if("NotBottomSide"===a)return fd;if("AllSides"===a)return gd;if("Default"===a)return hd;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=Jb.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.La=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.Rd=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.Tw=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=1.25*a.x,d=1.2*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.fp=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};Jb.alloc=function(){var a=Ad.pop();return void 0===a?new Jb:a}; Jb.free=function(a){Ad.push(a)};Jb.prototype.transformRect=Jb.prototype.fp;Jb.prototype.transformPoint=Jb.prototype.La;Jb.prototype.scale=Jb.prototype.scale;Jb.prototype.translate=Jb.prototype.translate;Jb.prototype.rotate=Jb.prototype.rotate;Jb.prototype.invert=Jb.prototype.gs;Jb.prototype.multiplyInverted=Jb.prototype.bv;Jb.prototype.multiply=Jb.prototype.multiply;Jb.prototype.reset=Jb.prototype.reset;Jb.prototype.isIdentity=Jb.prototype.js;Jb.prototype.equals=Jb.prototype.D; Jb.prototype.setTransform=Jb.prototype.setTransform;Jb.prototype.set=Jb.prototype.set;var Ad=[];Jb.className="Transform";Jb.xF="54a702f3e53909c447824c6706603faf4c"; var L={CA:"7da71ca0ad381e90",zg:(Math.sqrt(2)-1)/3*4,Mv:null,sqrt:function(a){if(0>=a)return 0;var b=L.Mv;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);L.Mv=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},Or:function(a,b,c,d,e,f,g,h,k,l,m,n){if(L.Yb(a,b,g,h,n,c,d)&&L.Yb(a,b,g,h,n,e,f))return L.Yb(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var x=(d+q)/2,y=(c+u)/2;return L.Or(a, b,p,r,d,c,x,y,k,l,m,n)||L.Or(x,y,q,u,e,f,g,h,k,l,m,n)},Uw: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},Ky:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Nb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Dl:function(a,b,c,d,e,f,g,h,k,l){if(L.Yb(a,b,g,h,k,c,d)&&L.Yb(a,b,g,h,k,e,f))lc(l,a,b,0,0),lc(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;L.Dl(a,b,m,n,d,c,q,u,k,l);L.Dl(q,u,p,r,e,f,g,h,k,l)}return l},Qe:function(a,b,c,d,e,f,g,h,k,l){if(L.Yb(a,b,g,h,k,c,d)&&L.Yb(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;L.Qe(a,b,m,n,d,c,q,u,k,l);L.Qe(q,u,p,r,e,f,g,h,k,l)}return l},gv:function(a,b,c,d,e,f,g,h,k,l){if(L.Yb(a,b,e,f,l,c,d))return L.Yb(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 L.gv(a,b,m,n,p,r,g,h,k,l)||L.gv(p,r,c,d,e,f,g,h,k,l)},NA: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},fv:function(a,b,c,d,e,f,g,h){if(L.Yb(a,b,e,f,g,c,d))lc(h,a,b,0,0),lc(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;L.fv(a,b,k,l,m,n,g,h);L.fv(m,n,c,d,e,f,g,h)}return h},To:function(a,b,c,d,e,f,g,h){if(L.Yb(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;L.To(a,b,k,l,m,n,g,h);L.To(m,n,c,d,e,f,g,h)}return h},uo:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(L.Yb(a,b,g,h,p,c,d)&&L.Yb(a,b,g,h,p,e,f)){if(!L.Nl(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;r.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var q=(a+c)/2,u=(b+d)/2,x=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+x)/2;c=(u+y)/2;x=(x+e)/ 2;y=(y+f)/2;var z=(d+x)/2,B=(c+y)/2,C=Infinity,D=!1,J=0,U=0;L.uo(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(ba)return r}else if(aa)return r;0p&&r--}else{q=(a+c)/2;u=(b+d)/2;var x=(c+e)/2,y=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+x)/2;c=(u+y)/2;x=(x+e)/2;y=(y+f)/2;var z=(d+x)/2,B=(c+y)/2;r+=L.vo(a,b,q,u,d,c,z,B,k,l,m,n,p);r+=L.vo(z,B,x,y,e,f,g,h,k,l,m,n,p)}return r},qh:function(a,b,c,d,e,f,g){if(L.ha(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(L.ha(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(L.ha(h,g))return L.qh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(L.ha(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return L.qh(a,b,c,d,e,g*(e-a)+b,k)},LA:function(a,b,c,d,e){return L.We(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},KA: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},If:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(L.We(a,b,a, d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},JA: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},es:function(a,b,c){return L.Ax(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},Ax: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):mc(a,b,c,d,e,f)||mc(a,b,c,d,g,h)||L.Nl(a,b,k,b,e,f,g,h)||L.Nl(k,b,k,l,e,f,g,h)||L.Nl(k,l,a,l,e,f,g,h)||L.Nl(a,l,a,b,e,f,g,h)?!0:!1},Nl:function(a,b,c,d,e,f,g,h){return 0>=L.Gl(a,b,c,d,e,f)*L.Gl(a,b,c,d,g,h)&&0>=L.Gl(e,f,g,h,a,b)*L.Gl(e, f,g,h,c,d)},Gl: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 f},Ro:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},$w: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 N.v:var b=new M(this.startX,this.startY,0,0);b.Bv(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 N.G:b=new M(this.startX,this.startY,0,0);b.Bv(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 N.m:b="";c=this.figures.s;for(var d=c.length,e=0;e=C-1?!0:null!==l[u+1].match(D)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());x===x.toLowerCase()&&(b=B.x+b,c=B.y+c);a.h(b,c)}function f(){e(B);return B}function g(){e(z);return z}function h(){var a=y.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?B:new K(2*B.x-z.x,2*B.y-z.y)}void 0===b&&(b=!1);"string"!==typeof a&&Aa(a,"string",N,"parse:str");var k=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm; a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2");a=a.replace(k,"$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(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var l=a.split(" ");for(a=0;a=C-1);)if(y=x,x=d(),""!==x)switch(x.toUpperCase()){case "X":p=!0;n=m=!1;break;case "M":r=f();null===a.vc||!0===p?(Kd(a,r.x,r.y,m,!n),p=!1):a.moveTo(r.x,r.y);for(k.assign(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 K((x===x.toLowerCase()?B.x:0)+parseFloat(d()),B.y),a.lineTo(B.x,B.y);break;case "V":for(;!c();)B=new K(B.x,(x===x.toLowerCase()?B.y:0)+parseFloat(d())),a.lineTo(B.x,B.y);break;case "C":for(;!c();){r=new K;e(r);q=g();var J=f();Ld(a,r.x,r.y,q.x,q.y,J.x,J.y)}break;case "S":for(;!c();)r=h(),q=g(),J=f(),Ld(a,r.x,r.y,q.x,q.y,J.x,J.y);break;case "Q":for(;!c();)r=g(),q=f(),Md(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)z=r=h(),q=f(),Md(a,r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d()); q=parseFloat(d());J=parseFloat(d());var U=parseFloat(d()),aa=parseFloat(d()),Y=aa,W=!1;c()||(Y=parseFloat(d()),c()||(W=0!==parseFloat(d())));x===x.toLowerCase()&&(J+=B.x,U+=B.y);a.arcTo(r,q,J,U,aa,Y,W)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),J=parseFloat(d()),aa=U=!1,W=Y=0,Y=d(),1===Y.length?(U=!!parseFloat(Y),aa=!!parseFloat(d()),Y=parseFloat(d())):2===Y.length?(U=!!parseFloat(Y[0]),aa=!!parseFloat(Y[1]),Y=parseFloat(d())):(U=!!parseFloat(Y[0]),aa=!!parseFloat(Y[1]), Y=parseFloat(Y.slice(2))),W=parseFloat(d()),x===x.toLowerCase()&&(Y=B.x+Y,W=B.y+W),B.h(Y,W),Nd(a,r,q,J,U,aa,Y,W);break;case "Z":Od(a);B.assign(k);break;case "F":r="";for(q=1;l[u+q];)if(null!==l[u+q].match(/[Uu]/))q++;else if(null===l[u+q].match(D))q++;else{r=l[u+q];break}r.match(/[Mm]/)?m=!0:0g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle); 0>d&&(q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case $d:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;if(0===q.radiusX||0===q.radiusY)break;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._isInvalidBounds=!0;return this}; t.ga=function(a,b){void 0===b&&(b=0);var c=this.nd,d=this.od,e=this.Dc,f=this.Ec;switch(this.type){case N.j:return L.Yb(c,d,e,f,b,a.x,a.y);case N.v:var g=M.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.ga(a);M.free(g);return a;case N.G: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 N.m:return fe(this,a,b,!0,!1);default:return!1}}; function fe(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.s,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.px=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.Ru=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.qx=function(a){if(this.type===N.j){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=K.alloc();L.qh(b,c,d,e,f,a,h);a=h.x;f=h.y;K.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===N.v){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=K.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.s,d=c.length,e=0;ea&&(a+=360),this.Me=a,this.$h=0,G&&E(d,ke,"x1"),this.ai=Math.max(d,0),G&&E(e,ke,"y1"),this.Rg=Math.max(e,0),"boolean"===typeof g?g&&(this.isLargeArc=!0):"number"===typeof g&&g&&(this.isLargeArc=!0),h&&(this.isClockwiseArc= !0)):(G&&E(d,ke,"x1"),this.Me=d,G&&E(e,ke,"y1"),this.$h=e,G&&E(f,ke,"x2"),a===Zd&&(f=Math.max(f,0)),this.ai=f,"number"===typeof g?(a===Zd&&(g=Math.max(g,0)),this.Rg=g):this.Rg=0);this.$d=null}ke.prototype.copy=function(){var a=new ke;a.wa=this.wa;a.o=this.o&-2;a.Dc=this.Dc;a.Ec=this.Ec;a.Me=this.Me;a.$h=this.$h;a.ai=this.ai;a.Rg=this.Rg;return a};t=ke.prototype; t.fb=function(a){if(!(a instanceof ke)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Wd:case Dd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY);case Xd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y)&&L.C(this.point2X,a.point2X)&&L.C(this.point2Y,a.point2Y);case Yd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y);case Zd:return L.C(this.startAngle, a.startAngle)&&L.C(this.sweepAngle,a.sweepAngle)&&L.C(this.centerX,a.centerX)&&L.C(this.centerY,a.centerY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);case $d:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&L.C(this.xAxisRotation,a.xAxisRotation)&&L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);default:return!1}};t.ub=function(a){a.classType===ke?this.type=a:Ea(this,a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Wd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Dd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Xd:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Yd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Zd:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ " "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case $d:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ " "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")};t.freeze=function(){this._isFrozen=!0;return this};t.pa=function(){this._isFrozen=!1;return this};t.close=function(){this.isClosed=!0;return this}; function ae(a,b){if(null!==a.$d&&!1===b._isInvalidBounds)return a.$d;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.$d=[],a.$d;b=a.Me;var e=a.$h,f=L.$w(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=L.$w(0,0,b>f?b:f,m,m+g,!0);f=Jb.alloc();f.reset();f.translate(c,d);f.rotate(a.Me,0,0);f.scale(k,r);N.Ma(b,f); Jb.free(f);a.$d=b;return a.$d} oa.Object.defineProperties(ke.prototype,{_isFrozen:{configurable:!0,get:function(){return 0!==(this.o&1)},set:function(a){this.o=a?this.o|1:this.o&-2}},_isInvalidBounds:{configurable:!0,get:function(){return 0!==(this.o&2)},set:function(a){this.o=a?this.o|2:this.o&-3}},isClosed:{configurable:!0,get:function(){return 0!==(this.o&8)},set:function(a){this.isClosed!==a&&(this.o=a?this.o|8:this.o&-9,this._isInvalidBounds=!0)}},type:{configurable:!0, get:function(){return this.wa},set:function(a){G&&ab(a,ke,ke,"type");this._isFrozen&&xa(this,a);this.wa=a;this._isInvalidBounds=!0}},endX:{configurable:!0,get:function(){return this.Dc},set:function(a){G&&E(a,ke,"endX");this._isFrozen&&xa(this,a);this.Dc=a;this._isInvalidBounds=!0}},endY:{configurable:!0,get:function(){return this.Ec},set:function(a){G&&E(a,ke,"endY");this._isFrozen&&xa(this,a);this.Ec=a;this._isInvalidBounds=!0}},point1X:{configurable:!0, get:function(){return this.Me},set:function(a){G&&E(a,ke,"point1X");this._isFrozen&&xa(this,a);this.Me=a;this._isInvalidBounds=!0}},point1Y:{configurable:!0,get:function(){return this.$h},set:function(a){G&&E(a,ke,"point1Y");this._isFrozen&&xa(this,a);this.$h=a;this._isInvalidBounds=!0}},point2X:{configurable:!0,get:function(){return this.ai},set:function(a){G&&E(a,ke,"point2X");this._isFrozen&&xa(this,a);this.ai=a;this._isInvalidBounds=!0}},point2Y:{configurable:!0, get:function(){return this.Rg},set:function(a){G&&E(a,ke,"point2Y");this._isFrozen&&xa(this,a);this.Rg=a;this._isInvalidBounds=!0}},centerX:{configurable:!0,get:function(){return this.Me},set:function(a){G&&E(a,ke,"centerX");this._isFrozen&&xa(this,a);this.Me=a;this._isInvalidBounds=!0}},centerY:{configurable:!0,get:function(){return this.$h},set:function(a){G&&E(a,ke,"centerY");this._isFrozen&&xa(this,a);this.$h=a;this._isInvalidBounds=!0}},radiusX:{configurable:!0, get:function(){return this.ai},set:function(a){G&&E(a,ke,"radiusX");0>a&&Ba(a,">= zero",ke,"radiusX");this._isFrozen&&xa(this,a);this.ai=a;this._isInvalidBounds=!0}},radiusY:{configurable:!0,get:function(){return this.Rg},set:function(a){G&&E(a,ke,"radiusY");0>a&&Ba(a,">= zero",ke,"radiusY");this._isFrozen&&xa(this,a);this.Rg=a;this._isInvalidBounds=!0}},startAngle:{configurable:!0,get:function(){return this.Dc},set:function(a){G&&E(a,ke,"startAngle");this._isFrozen&&xa(this, a);a%=360;0>a&&(a+=360);this.Dc=a;this._isInvalidBounds=!0}},sweepAngle:{configurable:!0,get:function(){return this.Ec},set:function(a){G&&E(a,ke,"sweepAngle");this._isFrozen&&xa(this,a);360a&&(a=-360);this.Ec=a;this._isInvalidBounds=!0}},isClockwiseArc:{configurable:!0,get:function(){return 0!==(this.o&4)},set:function(a){this._isFrozen&&xa(this,a);this.o=a?this.o|4:this.o&-5;this._isInvalidBounds=!0}},isLargeArc:{configurable:!0,get:function(){return 0!== (this.o&16)},set:function(a){this._isFrozen&&xa(this,a);this.o=a?this.o|16:this.o&-17;this._isInvalidBounds=!0}},xAxisRotation:{configurable:!0,get:function(){return this.Me},set:function(a){G&&E(a,ke,"xAxisRotation");this._isFrozen&&xa(this,a);a%=360;0>a&&(a+=360);this.Me=a;this._isInvalidBounds=!0}}});ke.prototype.equalsApprox=ke.prototype.fb; var Wd=new F(ke,"Move",0),Dd=new F(ke,"Line",1),Xd=new F(ke,"Bezier",2),Yd=new F(ke,"QuadraticBezier",3),Zd=new F(ke,"Arc",4),$d=new F(ke,"SvgArc",4);ke.className="PathSegment";ke.Move=Wd;ke.Line=Dd;ke.Bezier=Xd;ke.QuadraticBezier=Yd;ke.Arc=Zd;ke.SvgArc=$d;function me(){this.H=null;this.pu=(new K(0,0)).freeze();this.at=(new K(0,0)).freeze();this.rp=this.Dq=0;this.sp=1;this.Kh="";this.Ir=this.Kp=!1;this.Ip=this.vp=0;this.Ag=this.bq=this.iq=!1;this.Pp=null;this.Dr=0;this.yd=this.zr=null} me.prototype.copy=function(){var a=new me;return this.clone(a)};me.prototype.clone=function(a){a.H=this.H;a.pu.assign(this.viewPoint);a.at.assign(this.documentPoint);a.Dq=this.Dq;a.rp=this.rp;a.sp=this.sp;a.Kh=this.Kh;a.Kp=this.Kp;a.Ir=this.Ir;a.vp=this.vp;a.Ip=this.Ip;a.iq=this.iq;a.bq=this.bq;a.Ag=this.Ag;a.Pp=this.Pp;a.Dr=this.Dr;a.zr=this.zr;a.yd=this.yd;return a}; me.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};me.prototype.Ho=function(a,b){var c=this.diagram;if(null===c)return b;ne(c,this.event,a,b);return b}; me.prototype.Cz=function(a,b){var c=this.diagram;if(null===c)return b;ne(c,this.event,a,b);b.assign(c.Es(b));return b}; oa.Object.defineProperties(me.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{configurable:!0,get:function(){return this.pu},set:function(a){w(a,K,me,"viewPoint");this.pu.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.at},set:function(a){w(a,K,me,"documentPoint");this.at.assign(a)}},modifiers:{configurable:!0,get:function(){return this.Dq},set:function(a){this.Dq= a}},button:{configurable:!0,get:function(){return this.rp},set:function(a){this.rp=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.sp},set:function(a){this.sp=a}},key:{configurable:!0,get:function(){return this.Kh},set:function(a){this.Kh=a}},down:{configurable:!0,get:function(){return this.Kp},set:function(a){this.Kp=a}},up:{configurable:!0, enumerable:!0,get:function(){return this.Ir},set:function(a){this.Ir=a}},clickCount:{configurable:!0,get:function(){return this.vp},set:function(a){this.vp=a}},delta:{configurable:!0,get:function(){return this.Ip},set:function(a){this.Ip=a}},isMultiTouch:{configurable:!0,get:function(){return this.iq},set:function(a){this.iq=a}},handled:{configurable:!0,get:function(){return this.bq},set:function(a){this.bq=a}},bubbles:{configurable:!0, get:function(){return this.Ag},set:function(a){this.Ag=a}},event:{configurable:!0,get:function(){return this.Pp},set:function(a){this.Pp=a}},isTouchEvent:{configurable:!0,get:function(){var a=sa.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=sa.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{configurable:!0,get:function(){return this.Dr},set:function(a){this.Dr=a}},targetDiagram:{configurable:!0, get:function(){return this.zr},set:function(a){this.zr=a}},targetObject:{configurable:!0,get:function(){return this.yd},set:function(a){this.yd=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}}});me.prototype.getMultiTouchDocumentPoint=me.prototype.Cz;me.prototype.getMultiTouchViewPoint=me.prototype.Ho;me.className="InputEvent";function oe(){this.H=null;this.Ca="";this.Mq=this.vr=null}oe.prototype.copy=function(){var a=new oe;a.H=this.H;a.Ca=this.Ca;a.vr=this.vr;a.Mq=this.Mq;return a}; oe.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; oa.Object.defineProperties(oe.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){this.Ca=a}},subject:{configurable:!0,get:function(){return this.vr},set:function(a){this.vr=a}},parameter:{configurable:!0,get:function(){return this.Mq},set:function(a){this.Mq=a}}});oe.className="DiagramEvent"; function pe(){this.Am=qe;this.rf=this.Cq="";this.En=this.Fn=this.Kn=this.Ln=this.Jn=this.H=this.fc=null}pe.prototype.clear=function(){this.En=this.Fn=this.Kn=this.Ln=this.Jn=this.H=this.fc=null}; pe.prototype.copy=function(){var a=new pe;a.Am=this.Am;a.Cq=this.Cq;a.rf=this.rf;a.fc=this.fc;a.H=this.H;a.Jn=this.Jn;var b=this.Ln;a.Ln=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Kn;a.Kn=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Fn;a.Fn=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.En;a.En=Ga(b)&&"function"===typeof b.M?b.M():b;return a};pe.prototype.ub=function(a){a.classType===pe?this.change=a:Ea(this,a)}; pe.prototype.toString=function(){var a="";a=this.change===re?a+"* ":this.change===qe?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===re?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ra(this.object)),null!==this.oldValue&&(a+=" old: "+Ra(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ra(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};pe.prototype.L=function(a){return a?this.oldValue:this.newValue};pe.prototype.Ez=function(a){return a?this.oldParam:this.newParam};pe.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; pe.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};pe.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};pe.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; oa.Object.defineProperties(pe.prototype,{model:{configurable:!0,get:function(){return this.fc},set:function(a){this.fc=a}},diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},change:{configurable:!0,get:function(){return this.Am},set:function(a){G&&ab(a,pe,pe,"change");this.Am=a}},modelChange:{configurable:!0,get:function(){return this.Cq},set:function(a){G&&A(a,"string",pe,"modelChange");this.Cq=a}},propertyName:{configurable:!0, enumerable:!0,get:function(){return this.rf},set:function(a){G&&"string"!==typeof a&&A(a,"function",pe,"propertyName");this.rf=a}},isTransactionFinished:{configurable:!0,get:function(){return this.Am===re&&("CommittedTransaction"===this.rf||"FinishedUndo"===this.rf||"FinishedRedo"===this.rf)}},object:{configurable:!0,get:function(){return this.Jn},set:function(a){this.Jn=a}},oldValue:{configurable:!0,get:function(){return this.Ln},set:function(a){this.Ln= a}},oldParam:{configurable:!0,get:function(){return this.Kn},set:function(a){this.Kn=a}},newValue:{configurable:!0,get:function(){return this.Fn},set:function(a){this.Fn=a}},newParam:{configurable:!0,get:function(){return this.En},set:function(a){this.En=a}}});pe.prototype.redo=pe.prototype.redo;pe.prototype.canRedo=pe.prototype.canRedo;pe.prototype.undo=pe.prototype.undo;pe.prototype.canUndo=pe.prototype.canUndo;pe.prototype.getParam=pe.prototype.Ez; pe.prototype.getValue=pe.prototype.L;pe.prototype.clear=pe.prototype.clear;var re=new F(pe,"Transaction",-1),qe=new F(pe,"Property",0),se=new F(pe,"Insert",1),te=new F(pe,"Remove",2);pe.className="ChangedEvent";pe.Transaction=re;pe.Property=qe;pe.Insert=se;pe.Remove=te;function ue(){this.m=(new H).freeze();this.Ca="";this.j=!1} ue.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0b&&a.ad(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; oa.Object.defineProperties(ue.prototype,{changes:{configurable:!0,get:function(){return this.m}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){this.Ca=a}},isComplete:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}}});ue.prototype.optimize=ue.prototype.gk;ue.prototype.redo=ue.prototype.redo;ue.prototype.canRedo=ue.prototype.canRedo;ue.prototype.undo=ue.prototype.undo;ue.prototype.canUndo=ue.prototype.canUndo; ue.prototype.clear=ue.prototype.clear;ue.className="Transaction";function ve(){this.Ht=new I;this.Gd=!1;this.v=(new H).freeze();this.Ce=-1;this.m=999;this.Ee=!1;this.Ep=null;this.gi=0;this.j=!1;G&&(this.j=!0);this.Ie=(new H).freeze();this.il=new H;this.it=!0;this.st=this.gq=this.vt=this.ut=!1} ve.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;da.transactionLevel&&Fa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Pb("CommittingTransaction",c,e));var f=0;if(0a.historyIndex;d--)f=b.N(d),null!==f&&f.clear(),b.sb(d),a.gq=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.N(0),null!==f&&f.clear(),b.sb(0),a.Ce--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Ce++);b.freeze()}a.isInternalTransaction||a.Pb("CommittedTransaction",c,e)}else{a.Ee=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| a.Pb("RolledBackTransaction",c,e),a.Ee=!1}null!==e&&e.clear()}a.Ep=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.N(e),null!==b&&b.undo(),c.pa(),c.sb(e);c.freeze()}return!1}ve.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.it&&(a=a.diagram,null!==a&&!1===a.xi||Fa("Change not within a transaction: "+c.toString()))}}; ve.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}; oa.Object.defineProperties(ve.prototype,{models:{configurable:!0,get:function(){return this.Ht.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.N(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}; oa.Object.defineProperties(xe.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){a instanceof P&&(this.H=a)}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){A(a,"string",xe,"name");this.Ca=a}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){A(a,"boolean",xe,"isEnabled");this.Gd=a}},isActive:{configurable:!0,get:function(){return this.ob},set:function(a){A(a,"boolean", xe,"isActive");this.ob=a}},transactionResult:{configurable:!0,get:function(){return this.Ki},set:function(a){null!==a&&A(a,"string",xe,"transactionResult");this.Ki=a}}});xe.prototype.startTransaction=xe.prototype.Ja;xe.className="Tool";function Ua(){xe.call(this);this.name="ToolManager";this.jb=new H;this.tb=new H;this.Ib=new H;this.G=this.$=850;this.m=(new Hb(2,2)).na();this.Ma=5E3;this.ma=Be;this.v=Ie;this.Dp=this.j=null;this.Hj=-1}na(Ua,xe);Ua.prototype.initializeStandardTools=function(){}; Ua.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Ce&&this.Dp===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===Je&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Ke){b.bubbles=!0;return}if(this.gestureBehavior===Je)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;G&&c.checksTransactionLevel&&0!==c.transactionLevel&&Fa("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.yc.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Ne;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Hf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Hf(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.Kx&&d.T("LinkRelinked",c,d.Kx),c.toPort!==d.Lx&&d.T("LinkRelinked",c,d.Lx)):If(e,g,f,k,h):If(e,null,null,null,null)}}}}Oe.prototype.doDragOver=function(){}; function Jf(a,b){var c=a.diagram;a.dragsLink&&vf(a,!0);hf(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;Kf(a,e,f);f=yf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Re){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!==Re){a=M.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof T&&Lf(c,d,a);M.free(a)}}}function Kf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof wf||(c=a.mouseDrop,null!==c&&c(b))}function Lf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Re(c)&&(d=!0);a=a.Ou(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.Sd(b)&&c.isAvoiding&&c.gb()} Oe.prototype.doDropOnto=function(){};Oe.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()?(qf(this,!1),Ue(a,this.copiedParts),sf(this,this.copiedParts,!1),jf(a,this.copiedParts)):this.mayMove()?(lf(this),sf(this,this.draggedParts,!0)):this.mayDragOut()?(qf(this,!1),sf(this,this.copiedParts,!1)):lf(this),uf(this,a.lastInput.documentPoint))}}; Oe.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?(lf(this),qf(this,!0),Ue(a,this.copiedParts),sf(this,this.copiedParts,!1),jf(a,this.copiedParts),null!==this.copiedParts&&(a.T("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,lf(this),this.mayMove()&&(sf(this,this.draggedParts, !0),uf(this,a.lastInput.documentPoint)));this.Tm=!0;Jf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Of():this.draggedParts.Of();this.copiedParts=null;b&&Mf(this);a.ab();jf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.T(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.T("ChangedSelection",a.selection)}}}; Oe.prototype.simulatedMouseMove=function(a,b,c){if(null===Re)return!1;var d=Re.diagram;c instanceof P||(c=null);var e=Ve;c!==e&&(null!==e&&e!==d&&(e.xg(),Re.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Ve=c,null!==c&&c!==d&&(of(),e=c.toolManager.findTool("Dragging"),null!==e&&(Qe.contains(e)||Qe.add(e),e.doSimulatedDragEnter())),this.doUpdateCursor(null,!0));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&&(0g&&(g=l),m>h&&(h=m))}}Infinity===d?f.h(0,0,0,0):f.h(d,e,g-d,h-e);d=f.x+f.width/2;e=f.y+f.height/2;M.free(f); f=a.pr;g=new yb;h=K.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof R&&l.canCopy()&&(m=c.L(l),null!==m&&(m.points=l.points,rf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Md())));for(b=b.iterator;b.next();)l=b.value,l.Zc()&&l.canCopy()&&(k=c.L(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.eb(),g.add(k,a.Md(h))));K.free(h);a.copiedParts=g;Se(a,g.Of());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,rf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ 2)));a.doUpdateCursor(null,!0)}}}Oe.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Bs=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.un=null};Oe.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new K}; oa.Object.defineProperties(Oe.prototype,{isCopyEnabled:{configurable:!0,get:function(){return this.tb},set:function(a){A(a,"boolean",Oe,"isCopyEnabled");this.tb=a}},copiesEffectiveCollection:{configurable:!0,get:function(){return this.v},set:function(a){A(a,"boolean",Oe,"copiesEffectiveCollection");this.v=a}},dragOptions:{configurable:!0,get:function(){return this.ma},set:function(a){w(a,Pe,Oe,"dragOptions");this.ma=a}},isGridSnapEnabled:{configurable:!0, enumerable:!0,get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){A(a,"boolean",Oe,"isGridSnapEnabled");this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{configurable:!0,get:function(){return this.jb},set:function(a){A(a,"boolean",Oe,"isComplexRoutingRealtime");this.jb=a}},isGridSnapRealtime:{configurable:!0,get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){A(a,"boolean",Oe,"isGridSnapRealtime");this.dragOptions.isGridSnapRealtime= a}},gridSnapCellSize:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){w(a,Hb,Oe,"gridSnapCellSize");this.dragOptions.gridSnapCellSize.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){w(a,Ib,Oe,"gridSnapCellSpot");this.dragOptions.gridSnapCellSpot.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{configurable:!0, enumerable:!0,get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){w(a,K,Oe,"gridSnapOrigin");this.dragOptions.gridSnapOrigin.D(a)||(a=a.M(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{configurable:!0,get:function(){return this.dragOptions.dragsLink},set:function(a){A(a,"boolean",Oe,"dragsLink");this.dragOptions.dragsLink=a}},dragsTree:{configurable:!0,get:function(){return this.dragOptions.dragsTree},set:function(a){A(a,"boolean",Oe,"dragsTree"); this.dragOptions.dragsTree=a}},copyCursor:{configurable:!0,get:function(){return this.G},set:function(a){this.G=a}},moveCursor:{configurable:!0,get:function(){return this.Nc},set:function(a){this.Nc=a}},nodropCursor:{configurable:!0,get:function(){return this.Oc},set:function(a){this.Oc=a}},currentPart:{configurable:!0,get:function(){return this.$},set:function(a){null!==a&&w(a,S,Oe,"currentPart");this.$=a}},copiedParts:{configurable:!0, get:function(){return this.m},set:function(a){this.m=a}},draggedParts:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma=a}},draggingParts:{configurable:!0,get:function(){return null!==this.copiedParts?this.copiedParts.Of():null!==this.draggedParts?this.draggedParts.Of():this.ue}},draggedLink:{configurable:!0,get:function(){return this.diagram.draggedLink},set:function(a){null!==a&&w(a,R,Oe,"draggedLink");this.diagram.draggedLink=a}}, isDragOutStarted:{configurable:!0,get:function(){return this.Ib},set:function(a){this.Ib=a}},startPoint:{configurable:!0,get:function(){return this.pr},set:function(a){w(a,K,Oe,"startPoint");this.pr.D(a)||this.pr.assign(a)}},delay:{configurable:!0,get:function(){return this.Jk},set:function(a){A(a,"number",Oe,"delay");this.Jk=a}}});Oe.prototype.getDraggingSource=Oe.prototype.Bz;var Re=null,Ve=null;Oe.className="DraggingTool";Qe=new H; Ta("draggingTool",function(){return this.findTool("Dragging")},function(a){this.nb("Dragging",a,this.mouseMoveTools)});Ua.prototype.doCancel=function(){null!==Re&&Re.doCancel();xe.prototype.doCancel.call(this)}; function Pf(){0=d&&(d=.1);var e=this,f=b.tg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof T){var k=g.oa(Kc,K.alloc()),l=c.x-k.x,m=c.y-k.y;K.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.Do(b).count>=c)return!1}return!0}; Pf.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.Qd(b).count>=c)return!1}return!0}; Pf.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};Pf.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.Qd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Pf.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};Pf.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 Rf(this,c,b,d)}; function Rf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Rf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Rf(a,b.labeledLink,c,d))?!0:!1} Pf.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!==Sf){if(d===Tf){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!Uf(this,a,b,c,!0)}if(d===Vf){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!Uf(this,a,b,c,!0)}if(d===Wf)return a===b?a=!0:(d=new I,d.add(b),a=Xf(this,d,a,b,c)),!a;if(d===Yf)return!Uf(this,a,b,c,!1);if(d===Zf)return a===b?a=!0:(d=new I,d.add(b),a=$f(this,d,a,b,c)),!a}return!0};function Uf(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&&Uf(a,g,c,d,e)))return!0}return!1} function Xf(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&&Xf(a,b,g,d,e)))return!0}return!1}function $f(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&&$f(a,b,h,d,e))return!0}}return!1} oa.Object.defineProperties(Pf.prototype,{portGravity:{configurable:!0,get:function(){return this.ue},set:function(a){A(a,"number",Pf,"portGravity");0<=a&&(this.ue=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.Ma},set:function(a){A(a,"boolean",Pf,"isUnconnectedLinkValid");this.Ma=a}},linkingCursor:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a}},temporaryLink:{configurable:!0,get:function(){return this.Ii}, set:function(a){w(a,R,Pf,"temporaryLink");this.Ii=a}},temporaryFromNode:{configurable:!0,get:function(){return this.Hi},set:function(a){w(a,T,Pf,"temporaryFromNode");if(this.Hi=a)this.j=a.port}},temporaryFromPort:{configurable:!0,get:function(){return this.j},set:function(a){w(a,O,Pf,"temporaryFromPort");if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.U.indexOf(this.j);b.sb(c);b.Hb(c,a)}}this.j=a}},temporaryToNode:{configurable:!0,get:function(){return this.Ji}, set:function(a){w(a,T,Pf,"temporaryToNode");if(this.Ji=a)this.m=a.port}},temporaryToPort:{configurable:!0,get:function(){return this.m},set:function(a){w(a,O,Pf,"temporaryToPort");if(null!==this.m){var b=this.m.panel;if(null!==b){var c=b.U.indexOf(this.m);b.sb(c);b.Hb(c,a)}}this.m=a}},originalLink:{configurable:!0,get:function(){return this.Ib},set:function(a){null!==a&&w(a,R,Pf,"originalLink");this.Ib=a}},originalFromNode:{configurable:!0,get:function(){return this.jb}, set:function(a){null!==a&&w(a,T,Pf,"originalFromNode");this.jb=a}},originalFromPort:{configurable:!0,get:function(){return this.tb},set:function(a){null!==a&&w(a,O,Pf,"originalFromPort");this.tb=a}},originalToNode:{configurable:!0,get:function(){return this.Nc},set:function(a){null!==a&&w(a,T,Pf,"originalToNode");this.Nc=a}},originalToPort:{configurable:!0,get:function(){return this.Oc},set:function(a){null!==a&&w(a,O,Pf,"originalToPort");this.Oc=a}},isForwards:{configurable:!0, enumerable:!0,get:function(){return this.ma},set:function(a){A(a,"boolean",Pf,"isForwards");this.ma=a}},validPortsCache:{configurable:!0,get:function(){return this.jp}},targetPort:{configurable:!0,get:function(){return this.Sf},set:function(a){null!==a&&w(a,O,Pf,"targetPort");this.Sf=a}},linkValidation:{configurable:!0,get:function(){return this.oj},set:function(a){null!==a&&A(a,"function",Pf,"linkValidation");this.oj=a}},portTargeted:{configurable:!0, get:function(){return this.Rf},set:function(a){null!==a&&A(a,"function",Pf,"portTargeted");this.Rf=a}}});Pf.className="LinkingBaseTool";function ag(){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 V)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};ug.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}; ug.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&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ja(this.name),this.Jq.set(this.adornedObject.oa(this.handle.alignment.dv())),this.Mn.set(this.adornedObject.part.location),this.vw.set(this.adornedObject.desiredSize),this.et=this.computeCellSize(),this.gt= this.computeMinSize(),this.ft=this.computeMaxSize(),this.isActive=!0))};ug.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ve=this.handle=null;this.isActive=a.isMouseCaptured=!1};ug.prototype.stopTransaction=function(){var a=this.diagram,b=xe.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.gk();return b}; ug.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};ug.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.gt,c=this.ft,d=this.et,e=this.adornedObject.$r(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.td();K.free(e)}}; ug.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.gt,c=this.ft,d=this.et,e=this.adornedObject.$r(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);K.free(e);a.ab();this.transactionResult=this.name;a.T("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; ug.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.eb();c=c.oa(this.handle.alignment.dv());if(a instanceof wf){var d=new H;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Pe;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().re(c),!0,e)}else a.location=a.location.copy().re(c).add(this.oppositePoint);b.td()}}; ug.prototype.computeResize=function(a,b,c,d,e,f){b.kc()&&(b=Kc);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=K.alloc();L.Eo(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)));K.free(p);return a};ug.prototype.computeReshape=function(){var a=yg;this.adornedObject instanceof Qf&&(a=zg(this.adornedObject));return!(a===Ag||this.diagram.lastInput.shift)}; ug.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};ug.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.widthc?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.oa(b)};Bg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ve=this.handle=null;this.Wq=new K(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Bg.prototype.stopTransaction=function(){var a=this.diagram,b=xe.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.gk();return b};Bg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()}; Bg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};Bg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.ab();this.transactionResult=this.name;a.T("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Bg.prototype.rotate=function(a){G&&E(a,Bg,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.eb();var c=b.locationObject,d=b.rotateObject;if(c===d||c.vg(d))c=this.Mn.copy(),b.location=c.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.td()}}; Bg.prototype.computeRotate=function(a){a=this.rotationPoint.cb(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.si());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}; oa.Object.defineProperties(Bg.prototype,{handleArchetype:{configurable:!0,get:function(){return this.m},set:function(a){null!==a&&w(a,O,Bg,"handleArchetype");this.m=a}},handle:{configurable:!0,get:function(){return this.j},set:function(a){if(null!==a&&(w(a,O,Bg,"handle"),!(a.part instanceof Ce)))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{configurable:!0,get:function(){return this.ve},set:function(a){if(null!==a&&(w(a,O, Bg,"handle"),a.part instanceof Ce))throw Error("new handle must not be in an Adornment: "+a);this.ve=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.ma},set:function(a){A(a,"number",Bg,"snapAngleMultiple");this.ma=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.$},set:function(a){A(a,"number",Bg,"snapAngleEpsilon");this.$=a}},originalAngle:{configurable:!0,get:function(){return this.uw}},rotationPoint:{configurable:!0, get:function(){return this.Wq},set:function(a){this.Wq=a.copy()}},handleAngle:{configurable:!0,get:function(){return this.v},set:function(a){A(a,"number",Bg,"handleAngle");this.v=a}},handleDistance:{configurable:!0,get:function(){return this.G},set:function(a){A(a,"number",Bg,"handleDistance");this.G=a}}});Bg.className="RotatingTool";Ta("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.nb("Rotating",a,this.mouseDownTools)}); function Cg(){xe.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};bh.prototype.doStart=function(){lh=this;null!==this.textBlock&&this.doActivate()}; bh.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.jc(a.lastInput.documentPoint));if(null!==b&&b instanceof ch&&(this.textBlock=b,null!==b.part)){a.animationManager.Cc();this.isActive=!0;this.ta=ih;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.di=this.textBlock.copy();var d=new M(this.textBlock.oa(Fc),this.textBlock.oa(Oc));a.pv(d);c.show(b,a,this);this.currentTextEditor=c}}}};bh.prototype.doCancel=function(){this.stopTool()}; bh.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};bh.prototype.doMouseDown=function(){this.isActive&&this.acceptText(mh)};bh.prototype.acceptText=function(a){switch(a){case mh:if(this.ta===oh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.ta===ih||this.ta===kh||this.ta===jh)this.ta=ph,qh(this);break;case rh:case gh:case hh:if(gh!==a||!0!==this.textBlock.isMultiline)if(this.ta===ih||this.ta===kh||this.ta===jh)this.ta=ph,qh(this)}}; function qh(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());a.isValidText(b,e,f)?(a.Ja(a.name),a.ta=oh,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.T("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.ta=kh,a.doError(e,f))}} bh.prototype.doError=function(a,b){var c=this.textBlock;null!==c.errorFunction&&c.errorFunction(this,a,b);(a=this.currentTextEditor)&&a.show(c,this.diagram,this)};bh.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};bh.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.ta=eh,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};bh.prototype.doStop=function(){lh=null}; bh.prototype.isValidText=function(a,b,c){w(a,ch,bh,"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};bh.prototype.Ix=function(a){var b=this.di;b.text=a;b.measure(this.textBlock.Lh,Infinity);return b}; oa.Object.defineProperties(bh.prototype,{textBlock:{configurable:!0,get:function(){return this.ma},set:function(a){null!==a&&w(a,ch,bh,"textBlock");this.ma=a}},currentTextEditor:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a}},defaultTextEditor:{configurable:!0,get:function(){return this.j},set:function(a){!G||a instanceof Me||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.j=a}},starting:{configurable:!0, get:function(){return this.$},set:function(a){ab(a,bh,bh,"starting");this.$=a}},textValidation:{configurable:!0,get:function(){return this.Dj},set:function(a){null!==a&&A(a,"function",bh,"textValidation");this.Dj=a}},minimumEditorScale:{configurable:!0,get:function(){return this.v},set:function(a){null!==a&&A(a,"number",bh,"minimumEditorScale");this.v=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.G},set:function(a){null!==a&&A(a,"boolean", bh,"selectsTextOnActivate");this.G=a}},state:{configurable:!0,get:function(){return this.ta},set:function(a){this.ta!==a&&(ab(a,bh,bh,"starting"),this.ta=a)}}});bh.prototype.measureTemporaryTextBlock=bh.prototype.Ix; var rh=new F(bh,"LostFocus",0),mh=new F(bh,"MouseDown",1),hh=new F(bh,"Tab",2),gh=new F(bh,"Enter",3),sh=new F(bh,"SingleClick",0),dh=new F(bh,"SingleClickSelected",1),nh=new F(bh,"DoubleClick",2),eh=new F(bh,"StateNone",0),ih=new F(bh,"StateActive",1),jh=new F(bh,"StateEditing",2),ph=new F(bh,"StateValidating",3),kh=new F(bh,"StateInvalid",4),oh=new F(bh,"StateValidated",5),lh=null;bh.className="TextEditingTool";bh.LostFocus=rh;bh.MouseDown=mh;bh.Tab=hh;bh.Enter=gh;bh.SingleClick=sh; bh.SingleClickSelected=dh;bh.DoubleClick=nh;bh.StateNone=eh;bh.StateActive=ih;bh.StateEditing=jh;bh.StateValidating=ph;bh.StateInvalid=kh;bh.StateValidated=oh;Ta("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.nb("TextEditing",a,this.mouseUpTools)}); function th(a){uh||(vh(),uh=!0);this.H=ye;this.Qk=this.Eb=this.kq=this.ec=!1;this.Iw=!0;this.Rk=wh;this.ym=!1;this.Ih=this.Gd=!0;this.Gg=600;this.Vv=this.Gw=!1;this.Yd=new I;this.be=new xh;this.be.Xd=this;this.Li=new I;this.hu=new I;this.Er=new I;this.ql=new I;a&&Object.assign(this,a)}th.prototype.Ye=function(a){this.H=a};th.prototype.canStart=function(){return!0};function yh(a,b){a.Gd&&a.canStart(b)&&(a.Yd.add(b),a.defaultAnimation.isAnimating&&a.Cc(),zh(a.H),a.Eb=!0)} function Ah(a){if(a.Gd&&a.Eb){var b=a.be,c=a.H,d=a.Yd.contains("Model");d&&(a.Qk=!0,a.Rk===wh?(b.isViewportUnconstrained=!0,b.xc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.Rk===Bh&&b.xc.clear(),a.Iw=a.Rk===Ch&&c.Wt.D(c.va)?!0:!1,c.T("InitialAnimationStarting",a));d&&!a.Ih||0===b.xc.count?(a.Yd.clear(),a.Eb=!1,b.xc.clear(),Dh(b,c),a.Qk=!1,c.R()):(a.Yd.clear(),c.og=!1,d=b.xc.get(c),c.autoScale!==Eh&&null!==d&&(delete d.start.scale,delete d.end.scale), sa.requestAnimationFrame(function(){!1===a.Eb||b.ec||(c.Te("temporaryPixelRatio")&&Te(c),Fh(c),a.Eb=!1,b.start(),b.ec&&(Gh(a),c.ab(),Hh(b,0),Nf(c,!0),Ih(a),c.T("AnimationStarting",a)))}))}}function Jh(a){return a.Yd.contains("Trigger")&&1===a.Yd.count}function Kh(a,b,c,d){a.isTicking||Jh(a)||b instanceof R&&(null!==b.fromNode||null!==b.toNode)||a.be.add(b,"position",c,d,!1)}t=th.prototype;t.ss=function(a){return this.be.ss(a)};t.Yu=function(a){return this.be.Yu(a)}; function Lh(a,b){function c(){0f?f+=360:k+=360);f=e(c,f,k-f,d)%360;g=e(c,g,l-g,d);h=e(c,h,m-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} function vh(){function a(a,b,e,f,g,h){a.position=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new yb;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){ga&&Ba(a,">= 1",th,"duration");this.Gg=a}},isAnimating:{configurable:!0, enumerable:!0,get:function(){return this.ec}},isTicking:{configurable:!0,get:function(){return this.kq}},isInitial:{configurable:!0,get:function(){return this.Ih},set:function(a){A(a,"boolean",th,"isInitial");this.Ih=a}},defaultAnimation:{configurable:!0,get:function(){return this.be}},activeAnimations:{configurable:!0,get:function(){return this.Li}},initialAnimationStyle:{configurable:!0,get:function(){return this.Rk},set:function(a){G&& ab(a,th,th,"initialAnimationStyle");this.Rk=a}}});th.prototype.stopAnimation=th.prototype.Cc;var bi=null,uh=!1,wh=new F(th,"Default",1),Ch=new F(th,"AnimateLocations",2),Bh=new F(th,"None",3);th.className="AnimationManager";th.defineAnimationEffect=function(a,b){uh||(vh(),uh=!0);bi.add(a,b)};th.Default=wh;th.AnimateLocations=Ch;th.None=Bh; function xh(a){this.nu=this.Fw=this.Xd=this.H=null;this.Zk=this.ec=this.j=!1;this.Xm=this.Nd=0;this.Cp=this.dt=ci;this.Yk=this.Wn=!1;this.Vt=1;this.Tt=0;this.Ed=this.Gg=NaN;this.Zv=0;this.Ym=null;this.m=zb;this.xc=new yb;this.Lt=new yb;this.Al=new I;this.Mt=new I;this.Wv=di;a&&Object.assign(this,a)}xh.prototype.suspend=function(){this.Zk=!0};xh.prototype.advanceTo=function(a,b){b&&(this.Zk=!1);this.Wn&&a>=this.Ed&&(this.Yk=!0,a-=this.Ed);this.Zv=a;Mh(this,!0);Gh(this.Xd);Nf(this.H);Ih(this.Xd);this.H.redraw()}; function Dh(a,b){a.Lt.clear();a.Yk=!1;a.Tt=0;a.Ed=NaN;0a.Xm?a.Ed:d-a.Nd;b&&(e=a.Zv,ea.Xm&&(a.Wn&&!a.Yk?(a.Nd=+new Date,a.Xm=a.Nd+a.Ed,a.Yk=!0):a.Il(!1))}}} function Hh(a,b){for(var c=a.Ed,d=a.xc.iterator,e=a.Yk;d.next();){var f=d.key;if(!(f instanceof O&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=bi,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:nodeCollapse"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.Cp,b,c,a)}}}t.stop=function(){if(!this.ec)return this;this.Il(!0);return this}; t.Il=function(a){null!==this.nu&&this.nu.Yn.remove(this.Fw);if(this.ec){var b=this.H,c=this.Xd;this.Zk=this.ec=c.Qk=!1;Gh(c);for(var d=this.xc,e=this.Al.iterator;e.next();)b.remove(e.value);for(e=this.Mt.iterator;e.next();)e.value.w();e=this.Wn;d=d.iterator;for(var f=bi;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Ju,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Bu||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: h.Bu?k[n]:l[n],this.Cp,this.Ed,this.Ed,this)}h.Bu&&void 0!==m.location&&g instanceof S&&(g.location=m.location);h.jv&&g instanceof S&&g.Zb(!1)}b.ns.clear();mf(b,!1);b.ab();b.R();Nf(b,!0);if(c.defaultAnimation===this){for(n=c.ql.iterator;n.next();)e=n.value,null!==e.sf&&(e.points=e.sf,e.sf=null);c.ql.clear()}Nf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.Wv);Ih(c);this.Tt++;!a&&this.Vt>this.Tt?(this.Yk=!1,this.start()):(this.Ym&&this.Ym(this),Dh(this,null),c.Il(this),b.Sb())}}; t.Kj=function(a,b){var c=b.actualBounds,d=null;b instanceof wf&&(d=b.placeholder);null!==d?(c=d.oa(Fc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new K(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof wf)for(a=a.memberParts;a.next();)d=a.value,d instanceof T&&this.Kj(d,b)}; t.Ij=function(a,b){if(a.isVisible()){var c=null;b instanceof wf&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.xc;c.contains(a)&&(c.L(a).jv=!0);if(a instanceof wf)for(a=a.memberParts;a.next();)c=a.value,c instanceof T&&this.Ij(c,b)}};t.Fz=function(a){var b=this.Lt.get(a);null===b&&(b={},this.Lt.add(a,b));return b}; oa.Object.defineProperties(xh.prototype,{duration:{configurable:!0,get:function(){return this.Gg},set:function(a){A(a,"number",xh,"duration");1>a&&Ba(a,">= 1",xh,"duration");this.Gg=a}},reversible:{configurable:!0,get:function(){return this.Wn},set:function(a){this.Wn=a}},runCount:{configurable:!0,get:function(){return this.Vt},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function ei(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}xh.className="Animation";xh.EaseLinear=function(a,b,c,d){return c*a/d+b};xh.EaseInOutQuad=ci;xh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};xh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};xh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};xh.EaseOutExpo=ei; function ki(a,b,c){this.start=a;this.end=b;this.Ju={};this.Bu=c;this.jv=!1}ki.className="AnimationState";function li(a,b,c){this.yd=null;this.rf=a;this.io=c||mi;this.vk=null;void 0!==b&&(this.vk=b,void 0===c&&(this.io=ni))}li.prototype.copy=function(){var a=new li(this.rf);a.io=this.io;var b=this.vk;if(null!==b){var c={};void 0!==b.duration&&(c.duration=b.duration);void 0!==b.finished&&(c.finished=b.finished);void 0!==b.easing&&(c.easing=b.easing);a.vk=c}return a}; function oi(a,b){a=a.vk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))} oa.Object.defineProperties(li.prototype,{propertyName:{configurable:!0,get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{configurable:!0,get:function(){return this.vk},set:function(a){this.vk=a}},startCondition:{configurable:!0,get:function(){return this.io},set:function(a){G&&ab(a,li,li,"startCondition");this.io=a}}});var mi=new F(li,"Default",1),ni=new F(li,"Immediate",2),pi=new F(li,"Bundled",3);li.className="AnimationTrigger"; li.Default=mi;li.Immediate=ni;li.Bundled=pi;function qi(a){Za(this);this.H=null;this.Ra=new H;this.Ca="";this.yb=1;this.m=!1;this.j=this.Zh=this.v=this.Vi=this.Ui=this.Ti=this.Si=this.Qi=this.Ri=this.Pi=this.Xi=this.Oi=this.Wi=this.Ni=this.Mi=!0;this.Nn=[];a&&Object.assign(this,a)}t=qi.prototype;t.clear=function(){this.Ra.clear();this.Nn.length=0};t.Ye=function(a){this.H=a}; t.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ra.iterator;h.next();){var k=h.value;k instanceof wf?e++:k instanceof T?d++:k instanceof R?f++:k instanceof Ce?g++:c++}h="";0c.Aq||h.height*e>c.Aq?b.zc(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&&(ti(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(ti(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),ti(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.js()||(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.Uc(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.ib(qe,a,this,b,c,d,e)};t.vi=function(a,b,c){var d=this.Ra;b.Mh=this;if(a>=d.count)a=d.count;else if(d.N(a)===b)return-1;d.Hb(a,b);b.Ko(c);d=this.diagram;null!==d&&(c?d.R():d.vi(b));ui(this,a,b);return a}; t.rc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.rc(a,b,c);var d=this.Ra;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.N(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Lo(c);d.sb(a);d=this.diagram;null!==d&&(c?d.R():d.rc(b));b.Mh=null;return a}; function ui(a,b,c){b=vi(a,b,c);if(c instanceof wf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ra.s,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.N(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.sb(b);a.Hb(f,c);return f}for(g=NaN;0<=--f&&(g=a.N(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.sb(b);a.Hb(h,c);return h}for(k=NaN;++h< e&&(k=a.N(h).zOrder,isNaN(k)););}return b} oa.Object.defineProperties(qi.prototype,{parts:{configurable:!0,get:function(){return this.Ra.iterator}},partsBackwards:{configurable:!0,get:function(){return this.Ra.iteratorBackwards}},diagram:{configurable:!0,get:function(){return this.H}},name:{configurable:!0,get:function(){return this.Ca},set:function(a){A(a,"string",qi,"name");var b=this.Ca;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.Ca=a;this.g("name",b,a);for(a=this.Ra.iterator;a.next();)a.value.layerName=this.Ca}}},opacity:{configurable:!0,get:function(){return this.yb},set:function(a){var b=this.yb;b!==a&&(A(a,"number",qi,"opacity"),(0>a||1=a)return b;for(var c=this.$a.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};P.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})}; P.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; function Ri(a){var b=a.Na.Xa;b instanceof HTMLCanvasElement&&(a.addEventListener(b,"pointerdown",a.hk,!1),a.addEventListener(b,"pointermove",a.ik,!1),a.addEventListener(b,"pointerup",a.kk,!1),a.addEventListener(b,"pointerout",a.jk,!1),a.addEventListener(b,"pointerenter",a.$y,!1),a.addEventListener(b,"pointerleave",a.az,!1),a.addEventListener(b,"wheel",a.dk,!1),a.addEventListener(b,"keydown",a.Rz,!1),a.addEventListener(b,"keyup",a.Sz,!1),a.addEventListener(b,"blur",a.My,!1),a.addEventListener(b,"focus", a.Ny,!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(sa,"resize",a.Gv,!1),Ya&&a.addEventListener(b,"touchstart",function(a){a.preventDefault()},!1))}function Te(a){30q&&(this.position=x.h(-(b.scrollWidth-this.Ha)+y-this.Ha/e+m,this.position.y))),a.uy&&this.allowVerticalScroll&&(hu&&(this.position= x.h(this.position.x,-(b.scrollHeight-this.Ga)+a.scrollTop-this.Ga/e+f))),K.free(x),Wi(this),this.fj=this.$q=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,q=e.right,f=d.bottom,u=e.bottom,g=d.x,n=e.x,h=d.y,d=e.y,p>=k&&g>=n&&m<=q&&(c.style.width="1px"),r>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};P.prototype.computeBounds=function(a){void 0===a&&(a=new M);zh(this);return Xi(this,a)}; function Xi(a,b){if(a.fixedBounds.u())return b.assign(a.fixedBounds),b.so(a.zb),b;for(var c=!0,d=a.$a.s,e=d.length,f=0;fc&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===mj?(b=k>h?(g-a.Fb)/d:(f-a.Fb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} P.prototype.zoomToFit=function(){var a=this.Aj;this.Aj=di;this.scale=hj(this,lj);a!==di&&(Yi(this,!1),ij(this,this.documentBounds,this.Ha/this.Ea,this.Ga/this.Ea,this.Ak,!1));this.Aj=a};t=P.prototype; t.DA=function(a,b){void 0===b&&(b=lj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===lj||b===mj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Ha;var f=this.Ga;e=b===mj?f/d>e/c?(f-(this.hf?this.Fb:0))/d:(e-(this.$f?this.Fb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new K(a.x,a.y)}}; t.Gy=function(a,b){this.eb();var c=this.documentBounds,d=this.viewportBounds;this.position=new K(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.Az=function(a){if(a instanceof O){this.Up=a;var b=K.alloc();this.Vp=this.ep(a.oa(Fc,b));K.free(b)}else this.Up=null,this.Vp=Db}; function ij(a,b,c,d,e,f){var g=K.allocAt(a.va.x,a.va.y),h=g.x,k=g.y;if(null!==a.Up){var l=K.alloc();l=a.Up.oa(Fc,l);h=l.x-a.Vp.x/a.scale;k=l.y-a.Vp.y/a.scale;e=Ec;K.free(l)}if(f||a.scrollMode===di)e.mb()&&(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.zj,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.ml[0])b=a.ml[c];else return;c=a.Na;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.Ha/c.width*c.left,b.clientY-a.Ga/c.height*c.top))}P.prototype.ab=function(){this.ej||(this.ej=!0,this.Sb(!0))};function vj(a){a.jd||zh(a);a.eb()}P.prototype.redraw=function(){this.Bb||this.jd||(this.R(),jj(this),this.td())};t=P.prototype;t.Qz=function(){return this.og}; t.Vy=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.Cc();b.isEnabled=!1;Nf(this);this.bg=!1;this.Wt=new K(NaN,NaN);b.isEnabled=c;this.jd=!0;var d=this;null!==a&&va(function(){d.jd=!1;yh(b,"Model");a(d)},1)};t.Sb=function(a){void 0===a&&(a=!1);if(!0!==this.og&&!(this.Bb||!1===a&&this.jd)){this.og=!0;var b=this;sa.requestAnimationFrame(function(){b.og&&b.td()})}};t.td=function(){if(!this.Zm||this.og)this.Zm&&(this.Zm=!1),Nf(this)}; function kj(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Bb||!a.fj||Ui(a)||(b&&zh(a),c&&Yi(a,!1))} function Nf(a,b){if(!a.jd&&(a.og=!1,null!==a.Qa||a.mo.u())){a.jd=!0;var c=a.animationManager,d=a.Rn;if(!c.isAnimating&&0!==d.length){for(var e=d.s,f=e.length,g=0;gb;b++){var c=a.De.iterator;if(null===c||0===a.De.count)break;a.De=new I;a.Fv(c,a.De);G&&22===b&&Fa("failure to validate parts")}a.nodes.each(function(a){a instanceof wf&&0!==(a.Y&65536)!==!1&&(a.Y=a.Y^65536)})}} t.Fv=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Zc()||c instanceof wf||(c.Ai()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof wf&&c.isVisible()&&Aj(this,c);for(a.reset();a.next();)c=a.value,c instanceof R&&c.isVisible()&&(c.Ai()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Ce&&c.isVisible()&&(c.Ai()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function Aj(a,b){for(var c=Na(),d=Na(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof wf?(Bj(f)||Cj(f)||Dj(f))&&Aj(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;en&&(z=U.left,B= U.right),y.height>J&&(C=U.top,D=U.bottom)):(z=U.left,B=U.right,C=U.top,D=U.bottom);U=y.width+z+B;var aa=y.height+C+D;z=y.x-z;var Y=e.x;B=y.right+B;var W=e.right+r;C=y.y-C;var Q=e.y;y=y.bottom+D;D=e.bottom+q;var la="1px",fa="1px";e=a.scale;u=U>u/e;x=aa>x/e;a.scrollMode===di&&(u||x)&&(u&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(u=1,z+1W+1&&(u=Math.max((B-W)*e+a.Ha,u)),n+r+1D+1&&(u=Math.max((y-D)*e+a.Ga,u)),J+q+1W+1&&(r=Math.max((B-W)*e+a.Ha,r)),n+1D+1&&(q=Math.max((y-D)*e+r,q)),J+1W+1&&(b=a.position.x*e));if(a.mn)switch(a.Ut){case "negative":b=-(l.scrollWidth-b-l.clientWidth);break;case "reverse":b=l.scrollWidth-b-l.clientWidth}l.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(J+1D+1&&(l.scrollTop=a.position.y*e));u=a.Ha;x=a.Ga;l.style.width=u+(a.$f?a.Fb:0)+"px";l.style.height=x+(a.hf?a.Fb:0)+"px";return c!==u||d!==x||a.animationManager.Eb?(c=M.allocAt(f,g,h,k),a.onViewportBoundsChanged(c,a.viewportBounds,e,p),M.free(c),!1):!0}t=P.prototype; t.add=function(a){w(a,S,P,"add:part");var b=a.diagram;if(b!==this&&(null!==b&&v("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.Vj(a.layerName),null===b&&(b=this.Vj("")),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.vi(99999999,a,a.diagram===this);0<=c&&this.ib(se,"parts",b,null,a,null,c);b.isTemporary||this.ab();a.F(1);c=a.layerChanged;null!==c&&c(a,null, b)}};t.vi=function(a){this.partManager.vi(a);var b=this;Oj(a,function(a){Pj(b,a)});(a instanceof Ce||a instanceof wf&&null!==a.placeholder)&&a.w();null!==a.data&&Oj(a,function(a){Qj(b.partManager,a)});!0!==Cj(a)&&!0!==Dj(a)||this.De.add(a);Rj(a,!0,this);Sj(a)?(a.actualBounds.u()&&this.R(Mj(a,a.actualBounds)),this.ab()):a.isVisible()&&a.actualBounds.u()&&this.R(Mj(a,a.actualBounds));this.Sb()}; t.rc=function(a){a.Mj();this.partManager.rc(a);var b=this;null!==a.data&&Oj(a,function(a){Tj(b.partManager,a,b)});this.De.remove(a);Sj(a)?(a.actualBounds.u()&&this.R(Mj(a,a.actualBounds)),this.ab()):a.isVisible()&&a.actualBounds.u()&&this.R(Mj(a,a.actualBounds));this.Sb()};t.remove=function(a){w(a,S,P,"remove:part");Uj(this,a,!0)}; function Uj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.F(2),c&&b.Sj(),c=d.rc(-1,b,!1),0<=c&&a.ib(te,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.vs=function(a,b){void 0===b&&(b=!1);if(Ha(a))for(var c=a.length,d=0;dd&&this.ab();return this}; t.Ay=function(a,b){ak(this,a,b);a.Ye(this);var c=this.$a,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.fc&&this.ib(te,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.ab();return this}; t.jA=function(a){w(a,qi,P,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.$a,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ra.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.fc&&this.ib(te,"layers",this,a,null,c,null);this.R();this.ab()}}};t.Vj=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.Qw=function(a){A(a,"function",P,"addModelChangedListener:listener");null===this.pf&&(this.pf=new H);this.pf.add(a);this.model.fh(a);return this};t.lA=function(a){A(a,"function",P,"removeModelChangedListener:listener");null!==this.pf&&(this.pf.remove(a),0===this.pf.count&&(this.pf=null));this.model.mk(a)};t.fh=function(a){A(a,"function",P,"addChangedListener:listener");null===this.Cg&&(this.Cg=new H);this.Cg.add(a);return this}; t.mk=function(a){A(a,"function",P,"removeChangedListener:listener");null!==this.Cg&&(this.Cg.remove(a),0===this.Cg.count&&(this.Cg=null))};t.Pr=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Uu(a);a.change!==re&&(this.isModified=!0);if(null!==this.Cg)for(var b=this.Cg,c=b.length,d=0;dn.Ra.indexOf(r)&&n.vi(p,r,q):(r.isSelected=!1,r.isHighlighted=!1,r.Xb(),n.rc(q?p:-1,r,q)))}else n instanceof P?"number"===typeof p&&r instanceof qi&&(b?(r.Ye(this),this.$a.Hb(p,r)):this.$a.sb(p)):v("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==re&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= c}}};P.prototype.Ja=function(a){return this.undoManager.Ja(a)};P.prototype.kb=function(a){return this.undoManager.kb(a)};P.prototype.Nf=function(){return this.undoManager.Nf()};P.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ja(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.kb(b):this.undoManager.Nf(),this.skipsUndoManager=c}};P.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; P.prototype.hp=function(){this.partManager.hp()}; function fk(a,b,c){var d=a.animationManager;if(a.Bb||a.jd)a.Ea=c,Pi(a),a=a.Ea,d.Eb&&(Jh(d)||d.be.add(d.H,"scale",b,a));else if(null===a.Na)a.Ea=c,Pi(a);else{a.Bb=!0;var e=a.viewportBounds.copy(),f=a.Ha,g=a.Ga;e.width=a.Ha/b;e.height=a.Ga/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.$c()?l.Jf(Rc)?h=0:l.Jf(Sc)&&(h=f-1):h=l.mb()?l.x*(f-1):f/2);isNaN(k)&&(l.$c()?l.Jf(Qc)?k=0:l.Jf(Tc)&&(k=g-1):k=l.mb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating|| (c=a.scaleComputation(a,c));ca.maxScale&&(c=a.maxScale);f=K.allocAt(a.va.x+h/b-h/c,a.va.y+k/b-k/c);a.position=f;K.free(f);a.Ea=c;Pi(a);a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);a.Bb=!1;Yi(a,!1);c=a.Ea;d.Eb&&(Jh(d)||d.be.add(d.H,"scale",b,c));a.R();jj(a)}} P.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.D(b)){void 0===d&&(d=!1);d||jj(this);Wi(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Eh||d||a.width===b.width&&a.height===b.height||e.F();e=this.currentTool;!0===this.Xk&&e instanceof Ua&&(this.lastInput.documentPoint=this.Es(this.lastInput.viewPoint),Le(e,this));this.Bb||this.invalidateViewport(a,b);xj(this);this.qd.scale=c;this.qd.position.x=a.x;this.qd.position.y=a.y;this.qd.bounds.assign(a);this.qd.Vw.width= Math.round(a.width*c);this.qd.Vw.height=Math.round(a.height*c);this.qd.Jx.width=this.Ha;this.qd.Jx.height=this.Ga;this.qd.Cx=d;this.T("ViewportBoundsChanged",this.qd,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Yc(b)&&a.gb()})}}; function xj(a,b){var c=a.ee;if(null!==c&&c.visible){for(var d=Hb.alloc(),e=1,f=1,g=c.U.s,h=g.length,k=0;km||(gk(l.figure)?f=f*m/L.ox(f,m):e=e*m/L.ox(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(void 0!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=M.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.u()){M.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;M.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=K.alloc();L.Eo(a,g,0,0,d.width, d.height,b);b.offset(-d.width,-d.height);Hb.free(d);c.part.location=b;K.free(b)}}P.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.T("ChangingSelection",b);for(var c=b.Ka(),d=c.length,e=0;e=d&&!f.defaultAnimation.isAnimating&&!f.Eb&&(b||yh(f,"Layout"));a.xh=!1;for(var g=a.fi.iterator;g.next();)ok(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),zh(a),e.isValidLayout=!0):a.xh=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.kb("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||Ah(f),a.ca=c}}}function ok(a,b,c,d){if(null!==b){for(var e=b.hl.iterator;e.next();)ok(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.rh=!b.location.u(),e.doLayout(b),b.F(32),Aj(a,b),e.isValidLayout=!0):a.xh=!0)}}t.zz=function(){for(var a=new H,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.lh()&&a.add(c)}return a.iterator}; function Hi(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 yb,d=new yb;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.aw=c;a.$v=d} function Jj(a,b){var c=a.$v.L(b);return null!==c?c:a.$v.L(b.toLowerCase())}function pk(a,b){var c=a.aw.L(b);if(null!==c)return c;c=a.aw.L(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b)}t.Jj=function(a,b){A(a,"string",P,"addDiagramListener:name");A(b,"function",P,"addDiagramListener:listener");a=pk(this,a);null!==a&&a.add(b);return this};t.Wl=function(a,b){A(a,"string",P,"removeDiagramListener:name");A(b,"function",P,"addDiagramListener:listener");a=pk(this,a);null!==a&&a.remove(b)}; t.T=function(a,b,c){G&&A(a,"string",P,"raiseDiagramEvent:name");var d=pk(this,a),e=new oe;e.diagram=this;a=Jj(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.N(0)(e);else if(0!==b)for(d=d.Ka(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=M.allocAt(0,0,d.width*e,d.height*e);var f=K.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&this.allowHorizontalScroll&&(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&&this.allowVerticalScroll&&(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.fb(zb)||(b=new K(b.x+f.x/e,b.y+f.y/e)); M.free(d);K.free(f);return b};t=P.prototype;t.ps=function(){return null};t.av=function(){return null};t.Ey=function(a,b){this.qy.add(a,b)};t.yu=function(a){(this.Hw=a)||this.nodes.each(function(a){a instanceof wf&&(a.Qp=null)})}; function Ak(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].cl){f=!1;break}f||a-l>k?b(c,e,h):sa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Qg.iterator;g.next();)if(!g.value[0].cl){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;sa.requestAnimationFrame(function(){d()});return null}t.Wz=function(a){if(!ah)return null;void 0===a&&(a={});a.returnType="Image";return this.Gx(a)}; t.Gx=function(a){void 0===a&&(a={});return Ak(this,this.Xz,a)}; t.Xz=function(a,b,c){var d=Bk(c,a,"canvas",null);if(null===d)return null;c=d.ba.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case Ck+"data":e=d.getImageData(0,0,c.width,c.height);break;case Ck: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 Bk(a,b,c,d){a.animationManager.Cc();a.td();if(null===a.Na)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 gc(m):m instanceof gc||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.dc.Uc(!0);p=new Dk(null,r);var x=p.context;if(!(f||g||l||k)){p.width=a.Ha+Math.ceil(m.left+m.right);p.height=a.Ga+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.Bo=q;Hj(a,d.context,m,new Hb(p.width,p.height),a.Ea,a.va,l,n,u,b);return d.context}a.Sm=!1;Hj(a,x,m,new Hb(p.width,p.height),a.Ea,a.va,l,n,u,b);a.Sm=!0;return p.context}var y=a.Gp,z=a.documentBounds.copy();z.xv(a.zb);if(u)for(var B=a.$a.s,C=B.length,D=0;Dy?(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+=C):m=new gc(0);null!==h&&(y=h.width,h=h.height,"SVG"!==c&&e&&!Ek&&G&&(f>y|| z>h)&&(Fa("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."),Ek=!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.Bo=q;Hj(a,d.context,m,new Hb(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b); return d.context}a.Sm=!1;Hj(a,x,m,new Hb(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b);a.Sm=!0;return p.context} oa.Object.defineProperties(P.prototype,{div:{configurable:!0,get:function(){return this.Qa},set:function(a){null!==a&&w(a,HTMLDivElement,P,"div");if(this.Qa!==a){var b=this.Qa;null!==b?(b.H=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.Na&&(b=this.Na.Xa,this.removeEventListener(b,"pointermove",this.ik,!1),this.removeEventListener(b,"pointerdown",this.hk,!1),this.removeEventListener(b,"pointerup",this.kk,!1),this.removeEventListener(b,"pointerout",this.jk,!1),this.Na.ex()), this.pl&&(this.pl.disconnect(),this.pl=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.Na=null,this.removeEventListener(sa,"resize",this.Gv,!1),this.removeEventListener(sa,"wheel",this.dk,!0),ye===this&&(ye=null)):this.bg=!1;this.Qa=null;if(null!==a){if(b=a.H)b.div=null;Fi(this,a);this.redraw()}}}}, Sw:{configurable:!0,get:function(){return this.Eq}},xi:{configurable:!0,get:function(){return this.bg}},draggedLink:{configurable:!0,get:function(){return this.bt},set:function(a){this.bt!==a&&(this.bt=a,null!==a&&(this.Nt=a.fromPort,this.Ot=a.toPort))}},Kx:{configurable:!0,get:function(){return this.Nt},set:function(a){this.Nt=a}},Lx:{configurable:!0,get:function(){return this.Ot},set:function(a){this.Ot=a}},animationManager:{configurable:!0, enumerable:!0,get:function(){return this.Xd}},undoManager:{configurable:!0,get:function(){return this.fc.undoManager}},skipsUndoManager:{configurable:!0,get:function(){return this.Xg},set:function(a){A(a,"boolean",P,"skipsUndoManager");this.Xg=a;this.fc.skipsUndoManager=a}},delaysLayout:{configurable:!0,get:function(){return this.$s},set:function(a){this.$s=a}},opacity:{configurable:!0,get:function(){return this.yb},set:function(a){var b=this.yb; b!==a&&(A(a,"number",P,"opacity"),(0>a||1a&&Ba(a,">= 0",P,"scrollHorizontalLineChange"),this.au=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.eu},set:function(a){var b=this.eu;b!==a&&(A(a,"number",P,"scrollVerticalLineChange"),0>a&&Ba(a,">= 0",P,"scrollVerticalLineChange"), this.eu=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0,get:function(){return this.kj},set:function(a){G&&w(a,me,P,"lastInput");this.kj=a}},previousInput:{configurable:!0,get:function(){return this.Sg},set:function(a){G&&w(a,me,P,"previousInput");this.Sg=a}},firstInput:{configurable:!0,get:function(){return this.Sp},set:function(a){G&&w(a,me,P,"firstInput");this.Sp=a}},currentCursor:{configurable:!0,get:function(){return this.Xs}, set:function(a){""===a&&(a=this.Fp);if(this.Xs!==a){A(a,"string",P,"currentCursor");var b=this.Na,c=this.Qa;if(null!==b&&null!==c){this.Xs=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.Fp},set:function(a){""=== a&&(a="auto");var b=this.Fp;b!==a&&(A(a,"string",P,"defaultCursor"),this.Fp=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.zh},set:function(a){var b=this.zh;b!==a&&(null!==a&&A(a,"function",P,"click"),this.zh=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return this.Fh},set:function(a){var b=this.Fh;b!==a&&(null!==a&&A(a,"function",P,"doubleClick"),this.Fh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0, enumerable:!0,get:function(){return this.Bh},set:function(a){var b=this.Bh;b!==a&&(null!==a&&A(a,"function",P,"contextClick"),this.Bh=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0,get:function(){return this.Vh},set:function(a){var b=this.Vh;b!==a&&(null!==a&&A(a,"function",P,"mouseOver"),this.Vh=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.Th},set:function(a){var b=this.Th;b!==a&&(null!==a&&A(a,"function",P,"mouseHover"), this.Th=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return this.Sh},set:function(a){var b=this.Sh;b!==a&&(null!==a&&A(a,"function",P,"mouseHold"),this.Sh=a,this.g("mouseHold",b,a))}},mouseDragOver:{configurable:!0,get:function(){return this.It},set:function(a){var b=this.It;b!==a&&(null!==a&&A(a,"function",P,"mouseDragOver"),this.It=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.Qh},set:function(a){var b= this.Qh;b!==a&&(G&&null!==a&&A(a,"function",P,"mouseDrop"),this.Qh=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.mt},set:function(a){var b=this.mt;b!==a&&(A(a,"boolean",P,"handlesDragDropForTopLevelParts"),this.mt=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.Rh},set:function(a){var b=this.Rh;b!==a&&(null!==a&&A(a,"function",P,"mouseEnter"),this.Rh=a,this.g("mouseEnter", b,a))}},mouseLeave:{configurable:!0,get:function(){return this.Uh},set:function(a){var b=this.Uh;b!==a&&(null!==a&&A(a,"function",P,"mouseLeave"),this.Uh=a,this.g("mouseLeave",b,a))}},toolTip:{configurable:!0,get:function(){return this.ei},set:function(a){var b=this.ei;b!==a&&(!G||null===a||a instanceof Ce||a instanceof Me||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.ei=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.Ch}, set:function(a){var b=this.Ch;b!==a&&(!G||a instanceof Ce||a instanceof Me||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Ch=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0,get:function(){return this.ob},set:function(a){this.ob!==a&&(this.ob=a,a.Ye(this))}},toolManager:{configurable:!0,get:function(){return this.ue},set:function(a){this.ue!==a&&(w(a,Ua,P,"toolManager"),this.ue=a,a.diagram=this)}},defaultTool:{configurable:!0, get:function(){return this.tb},set:function(a){var b=this.tb;b!==a&&(w(a,xe,P,"defaultTool"),this.tb=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,get:function(){return this.jb},set:function(a){var b=this.jb;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(w(a,xe,P,"currentTool"),this.jb=a,a.diagram=this,a.doStart())}},selection:{configurable:!0,get:function(){return this.zw}}, maxSelectionCount:{configurable:!0,get:function(){return this.Dt},set:function(a){var b=this.Dt;if(b!==a)if(A(a,"number",P,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Dt=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",P,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0, enumerable:!0,get:function(){return this.Kt},set:function(a){var b=this.Kt;b!==a&&(w(a,Ce,P,"nodeSelectionAdornmentTemplate"),this.Kt=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.lt},set:function(a){var b=this.lt;b!==a&&(w(a,Ce,P,"groupSelectionAdornmentTemplate"),this.lt=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.At}, set:function(a){var b=this.At;b!==a&&(w(a,Ce,P,"linkSelectionAdornmentTemplate"),this.At=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.gw}},isModified:{configurable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.kn&&this.Ce!==a.historyIndex:this.kn},set:function(a){if(this.kn!==a){A(a,"boolean",P,"isModified");this.kn=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Ce= b.historyIndex);a||hk(this)}}},model:{configurable:!0,get:function(){return this.fc},set:function(a){var b=this.fc;if(b!==a){w(a,X,P,"model");this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&v("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Cc(!0);var c=Ni(this,!0);this.bg=!1;this.Zm=!0;this.Ce=-2;this.og=!1;var d=this.Bb;this.Bb=!0;yh(this.animationManager,"Model");b&&(null!==this.pf&&this.pf.each(function(a){b.mk(a)}), b.mk(this.Nc));this.fc=a;this.partManager=ik(this.fc.type);for(var e=0;ethis.scale&&(this.scale=a)):Ba(a,"> 0",P,"minScale"))}},maxScale:{configurable:!0, enumerable:!0,get:function(){return this.Ct},set:function(a){E(a,P,"maxScale");var b=this.Ct;b!==a&&(0 0",P,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.ru},set:function(a){this.ru.D(a)||(w(a,K,P,"zoomPoint"),this.ru=a=a.M())}},contentAlignment:{configurable:!0,get:function(){return this.Ak},set:function(a){var b=this.Ak;b.D(a)||(w(a,Ib,P,"contentAlignment"),this.Ak=a=a.M(), this.g("contentAlignment",b,a),Yi(this,!1))}},initialContentAlignment:{configurable:!0,get:function(){return this.eq},set:function(a){var b=this.eq;b.D(a)||(w(a,Ib,P,"initialContentAlignment"),this.eq=a=a.M(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.zb},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,P,"padding");var b=this.zb;b.D(a)||(this.zb=a=a.M(),this.ab(),this.g("padding",b,a))}},partManager:{configurable:!0, enumerable:!0,get:function(){return this.Oc},set:function(a){var b=this.Oc;b!==a&&(w(a,zi,P,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.Ye(null),this.Oc=a,a.Ye(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.Qc},set:function(a){var b=this.Qc;b!==a&&(w(a,Di,P,"layout"),this.Qc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",b,a),this.Sb())}},isTreePathToChildren:{configurable:!0,get:function(){return this.xt},set:function(a){var b=this.xt;if(b!==a&&(A(a,"boolean",P,"isTreePathToChildren"),this.xt=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Fk(a.value)}},treeCollapsePolicy:{configurable:!0, enumerable:!0,get:function(){return this.mu},set:function(a){var b=this.mu;b!==a&&(a!==Ii&&a!==Gk&&a!==Pk&&v("Unknown Diagram.treeCollapsePolicy: "+a),this.mu=a,this.g("treeCollapsePolicy",b,a))}},Ve:{configurable:!0,get:function(){return this.iw},set:function(a){this.iw=a}},avoidanceCellSize:{configurable:!0,get:function(){return this.Tv},set:function(a){this.bi=null;this.Tv=new Hb(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{configurable:!0, get:function(){return this.Uv},set:function(a){this.Uv=Math.max(1,a)}},autoScrollInterval:{configurable:!0,get:function(){return this.lp},set:function(a){var b=this.lp;E(a,P,"scale");b!==a&&(this.lp=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.np},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,P,"autoScrollRegion");var b=this.np;b.D(a)||(this.np=a=a.M(),this.ab(),this.g("autoScrollRegion",b,a))}}}); oa.Object.defineProperties(P,{licenseKey:{configurable:!0,get:function(){return Tk.lc()},set:function(a){Tk.add(a.replace(/\s/g,""))}},version:{configurable:!0,get:function(){return Uk}}});P.prototype.makeImageData=P.prototype.Gx;P.prototype.makeImage=P.prototype.Wz;P.prototype.cacheGroupExternalLinks=P.prototype.yu;P.prototype.addRenderer=P.prototype.Ey;P.prototype.makeSVG=P.prototype.av;P.prototype.makeSvg=P.prototype.ps;P.prototype.stopAutoScroll=P.prototype.xg; P.prototype.doAutoScroll=P.prototype.Sr;P.prototype.isUnoccupied=P.prototype.ak;P.prototype.raiseDiagramEvent=P.prototype.T;P.prototype.removeDiagramListener=P.prototype.Wl;P.prototype.addDiagramListener=P.prototype.Jj;P.prototype.findTreeRoots=P.prototype.zz;P.prototype.layoutDiagram=P.prototype.Uz;P.prototype.findTopLevelGroups=P.prototype.rz;P.prototype.findTopLevelNodesAndLinks=P.prototype.sz;P.prototype.ensureBounds=P.prototype.eb;P.prototype.findLinksByExample=P.prototype.Vr; P.prototype.findNodesByExample=P.prototype.Wr;P.prototype.findLinkForData=P.prototype.Kc;P.prototype.findNodeForData=P.prototype.oi;P.prototype.findPartForData=P.prototype.Lc;P.prototype.findLinkForKey=P.prototype.findLinkForKey;P.prototype.findNodeForKey=P.prototype.Qb;P.prototype.findPartForKey=P.prototype.findPartForKey;P.prototype.rebuildParts=P.prototype.Ud;P.prototype.transformViewToDoc=P.prototype.Es;P.prototype.transformRectDocToView=P.prototype.zA;P.prototype.transformDocToView=P.prototype.ep; P.prototype.centerRect=P.prototype.Qr;P.prototype.scrollToRect=P.prototype.pv;P.prototype.scroll=P.prototype.scroll;P.prototype.highlightCollection=P.prototype.Lz;P.prototype.highlight=P.prototype.Kz;P.prototype.selectCollection=P.prototype.qA;P.prototype.select=P.prototype.select;P.prototype.updateAllRelationshipsFromData=P.prototype.hp;P.prototype.updateAllTargetBindings=P.prototype.updateAllTargetBindings;P.prototype.commit=P.prototype.commit;P.prototype.rollbackTransaction=P.prototype.Nf; P.prototype.commitTransaction=P.prototype.kb;P.prototype.startTransaction=P.prototype.Ja;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.ib;P.prototype.removeChangedListener=P.prototype.mk;P.prototype.addChangedListener=P.prototype.fh;P.prototype.removeModelChangedListener=P.prototype.lA;P.prototype.addModelChangedListener=P.prototype.Qw;P.prototype.findLayer=P.prototype.Vj;P.prototype.removeLayer=P.prototype.jA;P.prototype.addLayerAfter=P.prototype.Ay; P.prototype.addLayerBefore=P.prototype.Ow;P.prototype.addLayer=P.prototype.Cl;P.prototype.moveParts=P.prototype.moveParts;P.prototype.copyParts=P.prototype.Rj;P.prototype.removeParts=P.prototype.vs;P.prototype.remove=P.prototype.remove;P.prototype.add=P.prototype.add;P.prototype.clearDelayedGeometries=P.prototype.zu;P.prototype.setProperties=P.prototype.im;P.prototype.attach=P.prototype.xu;P.prototype.set=P.prototype.set;P.prototype.resetInputOptions=P.prototype.Qx;P.prototype.setInputOption=P.prototype.rA; P.prototype.getInputOption=P.prototype.Ml;P.prototype.resetRenderingHints=P.prototype.Rx;P.prototype.setRenderingHint=P.prototype.Vx;P.prototype.getRenderingHint=P.prototype.Te;P.prototype.maybeUpdate=P.prototype.td;P.prototype.requestUpdate=P.prototype.Sb;P.prototype.delayInitialization=P.prototype.Vy;P.prototype.isUpdateRequested=P.prototype.Qz;P.prototype.invalidateDocumentBounds=P.prototype.ab;P.prototype.findObjectsNear=P.prototype.tg;P.prototype.findPartsNear=P.prototype.nz; P.prototype.findObjectsIn=P.prototype.Ff;P.prototype.findPartsIn=P.prototype.nx;P.prototype.findObjectsAt=P.prototype.pi;P.prototype.findPartsAt=P.prototype.mz;P.prototype.findObjectAt=P.prototype.jc;P.prototype.findPartAt=P.prototype.Kl;P.prototype.focusObject=P.prototype.Az;P.prototype.alignDocument=P.prototype.Gy;P.prototype.zoomToRect=P.prototype.DA;P.prototype.zoomToFit=P.prototype.zoomToFit;P.prototype.diagramScroll=P.prototype.ax;P.prototype.focus=P.prototype.focus; var yi=new yb,Qi=null,ah=void 0!==sa.document,Li=null,Mi="",Eh=new F(P,"None",0),lj=new F(P,"Uniform",1),mj=new F(P,"UniformToFill",2),Sf=new F(P,"CycleAll",10),Wf=new F(P,"CycleNotDirected",11),Yf=new F(P,"CycleNotDirectedFast",12),Zf=new F(P,"CycleNotUndirected",13),Tf=new F(P,"CycleDestinationTree",14),Vf=new F(P,"CycleSourceTree",15),di=new F(P,"DocumentScroll",1),fi=new F(P,"InfiniteScroll",2),Ii=new F(P,"TreeParentCollapsed",21),Gk=new F(P,"AllParentsCollapsed",22),Pk=new F(P,"AnyParentsCollapsed", 23),Tk=new H,Uk="2.2.16",Ck="image",Ek=!1,Vk=null,wi=!1; function xi(){if(ah){var a=sa.document.createElement("canvas"),b=a.getContext("2d")/*,c=Va("7ca11abfd022028846");b[c]=Va("398c3597c01238");for(var d=["5da73c80a36455d6038e4972187c3cae51fd22",ta.Dx+"4ae6247590da4bb21c324ba3a84e385776",Jb.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Va("7ca11abfd7330390")](Va(d[e-1]),10,15*e);b[c]=Va("39f046ebb36e4b");for(c=1;5>c;c++)b[Va("7ca11abfd7330390")](Va(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])Jb.prototype.Rd=Jb.prototype.Tw;*/ Vk=a}}P.className="Diagram";P.fromDiv=function(a){var b=a;"string"===typeof a&&(b=sa.document.getElementById(a));return b instanceof HTMLDivElement&&b.H instanceof P?b.H:null};P.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);A(a,"function",P,"inherit");A(b,"function",P,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};P.useDOM=function(a){ah=a?void 0!==sa.document:!1}; P.isUsingDOM=function(){return ah};P.None=Eh;P.Uniform=lj;P.UniformToFill=mj;P.CycleAll=Sf;P.CycleNotDirected=Wf;P.CycleNotDirectedFast=Yf;P.CycleNotUndirected=Zf;P.CycleDestinationTree=Tf;P.CycleSourceTree=Vf;P.DocumentScroll=di;P.InfiniteScroll=fi;P.TreeParentCollapsed=Ii;P.AllParentsCollapsed=Gk;P.AnyParentsCollapsed=Pk;function Ei(){this.vy=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.vd=this.j=!0:this.vd=null} function Gj(a,b){b.dc.setTransform(b.qc,0,0,b.qc,0,0);b.dc.Vc();if(null===a.vd)a:{b="f";var c=sa[Va("76a715b2f73f148a")][Va("72ba13b5")];a.vd=!0;if(ah){var d=P[Va("76a115b6ed251eaf4692")];if(d)for(var e=Tk.iterator;e.next();){d=e.value;d=Va(d).split(Va("39e9"));if(6>d.length)break;var f=Va(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Va(ta[Va("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=sa[Va("74a900bae4370f8b51")][Va("6fbb13a1c2311e8a57")].toLowerCase();g=h[Va("73a612b6fb191d")](Va("3aad1ab6e022098b4dc4")); f=Va(d[2]);if(-1g&&f!==Va("7da71ca0ad381e90")&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=c[Va("73a612b6fb191d")](Va("7baa19a6f76c1988428554")));a.vd=!(0<=g&&gk.length;)k+="9";h=k;k=k.substr(k.length-4);d="";d+=["gsh","gsf"][parseInt(k.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(k.substr(0,1),10)%4];g[Va("79a417a0f0181a8946")]=d;if(sa.document[Va("78a712aa")]){sa.document[Va("78a712aa")][Va("7bb806b6ed32388c4a875b")](g); k=sa.getComputedStyle(g).getPropertyValue(Va("78a704b7e62456904c9b12701b6532a8"));var l=sa.getComputedStyle(g).getPropertyValue(Va("75b817b0ea2202"));sa.document[Va("78a712aa")][Va("68ad1bbcf533388c4a875b")](g);if(k)if(g=sa[Va("77a902b0eb1b1e804a8a")],l==="0."+parseInt(h,10)%100||-1!==k.indexOf(parseInt(f[1]+f[2],16))&&-1!==k.indexOf(parseInt(f[3]+f[4],16))){a.vd=!1;break}else if(g&&g(Va("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;fMath.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&& (d=0Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0c||Math.abs(e.y-b.screenY)>c)?a.lq++:a.lq=1;d.clickCount=a.lq;a.mw=b.timeStamp;a.nw.wg(b.screenX,b.screenY); a.doMouseDown();1===b.button?b.preventDefault():uj(a,d,b)}};a.ik=function(b){if(a.isEnabled){a.Xk=!0;var c=a.ml;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}if(c[0].pointerId===b.pointerId){c=tj(a,b,!1,!1,!1,null!==c[1]);var d=sa.document.elementFromPoint(b.clientX,b.clientY);null!==d&&void 0!==d.shadowRoot&&null!==d.shadowRoot&&(d=d.shadowRoot.elementFromPoint(b.clientX,b.clientY));var e=a,f= b;d&&d.H&&(f=b,e=d.H);c.targetDiagram=e;rj(a,f,c);c.targetObject=null;a.doMouseMove();uj(a,c,b)}}};a.kk=function(b){if(a.isEnabled){a.Xk=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Qt;if(c&&a.iu)delete d[b.pointerId],b.preventDefault();else if(d=a.ml,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=tj(a,b,!1,!0,!0,!1);var e=sa.document.elementFromPoint(b.clientX,b.clientY);null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(b.clientX,b.clientY)); null!==e&&e.H instanceof P&&e.H!==a&&rj(e.H,b,d);null===e&&(e=b.target);rj(a,b,d);d.clickCount=a.lq;d.targetDiagram=sj(b,e);d.targetObject=null;a.doMouseUp();uj(a,d,b);c&&(a.wt=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.jk=function(b){if(a.isEnabled){a.Xk=!1;var c=a.Qt;c[b.pointerId]&&delete c[b.pointerId];c=a.ml;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())}};a.ct=d.ba["d"+Wk[1]+Wk[2]+"wI"+Ck.slice(1,5)]["b"+Xk.slice(1,b)](d.ba,Vk,b,b);d.Uc(!0);Ri(a)}}Ei.className="DiagramHelper";function Xe(a){this.j=void 0===a?new K:a;this.m=new K}oa.Object.defineProperties(Xe.prototype,{point:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}},shifted:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a}}});var Wk="DraggingInfo"; Xe.className="DraggingInfo";function Yj(a,b,c){this.node=a;this.info=b;this.Tu=c}Yj.className="DraggingNodeInfoPair";function Pe(){this.reset()}Pe.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Hb(NaN,NaN)).freeze();this.gridSnapCellSpot=Fc;this.gridSnapOrigin=(new K(NaN,NaN)).freeze();this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1;this.dragsMembers=this.groupsAlwaysMove=!0};Pe.className="DraggingOptions"; function Yk(a,b){if("string"===typeof a||sa.Element&&a instanceof Element)var c=P.call(this,a)||this;else c=P.call(this)||this,b=a;Zk(c);b&&c.im(b);return c}na(Yk,P);function Zk(a){a.allowDragOut=!0;a.allowMove=!1;a.isReadOnly=!0;a.contentAlignment=Gc;a.layout=new $k}Yk.prototype.reset=function(){P.prototype.reset.call(this);Zk(this)};Yk.className="Palette"; function al(a,b){if("string"===typeof a||sa.Element&&a instanceof Element)var c=P.call(this,a)||this;else c=P.call(this)||this,b=a;var d=c;c.animationManager.isEnabled=!1;c.Bb=!0;c.$=null;c.en=!1;c.fn=!1;c.G=!0;c.v=!0;c.ma=0;c.m=!1;c.sl=null;c.Vx("drawShadows",!1);a=new S;var e=new Qf;e.stroke="magenta";e.strokeWidth=2;e.fill="transparent";e.name="BOXSHAPE";a.selectable=!0;a.selectionAdorned=!1;a.selectionObjectName="BOXSHAPE";a.locationObjectName="BOXSHAPE";a.resizeObjectName="BOXSHAPE";a.cursor= "move";a.add(e);c.j=a;c.allowCopy=!1;c.allowDelete=!1;c.allowSelect=!0;c.autoScrollRegion=new gc(0,0,0,0);c.va.h(0,0);c.toolManager.nb("Dragging",new bl,c.toolManager.mouseMoveTools);c.click=function(){var a=d.observed;if(null!==a){var b=a.viewportBounds,c=d.lastInput.documentPoint;a.position=new K(c.x-b.width/2,c.y-b.height/2)}};c.Sf=function(){d.ab();cl(d)};c.Wd=function(){null!==d.observed&&(d.ab(),d.R())};c.Ma=function(){1>d.updateDelay?d.R():d.m||(d.m=!0,setTimeout(function(){return d.redraw()}, d.updateDelay))};c.Rf=function(){null!==d.observed&&cl(d)};c.autoScale=lj;c.Bb=!1;b&&Object.assign(c,b);return c}na(al,P);al.prototype.computePixelRatio=function(){return 1}; al.prototype.redraw=function(){if(this.m&&1<=this.updateDelay){this.m=!1;var a=this.Na,b=this.dc;if(null!==a&&null!==b){Ej(this);if(null===this.sl){var c=new Dk(null);c.width=a.width;c.height=a.height;this.sl=c}try{this.Na=this.sl,this.dc=this.Na.context,this.dc.Uc(!0),this.dc.setTransform(1,0,0,1,0,0),this.dc.clearRect(0,0,this.Na.width,this.Na.height),dl(this)}finally{this.Na=a,this.dc=b}}}P.prototype.redraw.call(this)}; al.prototype.zc=function(){null===this.Qa&&v("No div specified");null===this.Na&&v("No canvas specified");if(!(this.Na instanceof Lj)&&(ri(this.box),this.hd)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.xi){Ej(this);var b=this.Na;a=this.dc;a.Uc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?dl(this):null!==this.sl&&(a.drawImage(this.sl.Xa,0,0),b=this.Gb,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.qc,this.qc),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy));b=this.$a.s;for(var c=b.length,d=0;da&&(a=0);this.ma!==a&&(this.ma=a)}}});al.className="Overview";function bl(){Oe.call(this);this.j=null}na(bl,Oe); bl.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))}; el.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);E(a,el,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Eh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};el.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);E(a,el,"increaseZoom:factor");var b=this.diagram;b.autoScale===Eh&&(a=b.scale*a,ab.maxScale||(b.scale=a))}; el.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);E(a,el,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Eh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};el.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);E(a,el,"resetZoom:newscale");var b=this.diagram;ab.maxScale||(b.scale=a)}; el.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);E(a,el,"canResetZoom:newscale");var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; el.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Cc();a.redraw();var c=a.position,d=a.scale;yh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.su&&!isNaN(this.zt)&&a.documentBounds.D(this.qu)?(a.scale=this.zt,a.position=this.lw,this.su=NaN,this.qu=pc):(this.zt=d,this.lw=c.copy(),a.zoomToFit(),this.su=a.scale,this.qu=a.documentBounds.copy());Ah(b)};el.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; el.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w(a,S,el,"part");var b=this.diagram;b.eb();if(null===a){try{null!==this.gg&&(this.gg.next()?a=this.gg.value:this.gg=null)}catch(k){this.gg=null}null===a&&(0a&&(a+=360));return a}; t.Gf=function(){if(0!==(this.o&4096)===!1)return this.Lk;var a=this.Ea;return null!==this.panel?a*this.panel.Gf():a};t.$r=function(a,b){void 0===b&&(b=new K);b.assign(a);this.oe.Rd(b);return b};t.bs=function(a,b,c){return this.Xj(a.x,a.y,b.x,b.y,c)}; t.Xj=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,L.If(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=L.If(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; O.prototype.measure=function(a,b,c,d){if(!1!==Bj(this)){var e=this.Mg,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 Qf&&(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 V;switch(wl(this,!0)){case yg:g=e=0;h&&(b=a=Infinity); break;case Bd:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case il:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case jl: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.Db>a.width)))c=!0;this.o=c?this.o|256:this.o&-257;this.Jb.u()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Jb.toString());this.Tl(f,this.Jb);xl(this,!1);M.free(f)};t=O.prototype;t.gh=function(){}; function yl(a,b,c,d,e){a.Jb.h(b,c,d,e);if(!a.desiredSize.u()){var f=a.wc;c=a.Mg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=wl(a,!0);c===d&&f===e&&(b=yg);switch(b){case yg:if(c>d||f>e)wj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Bd:wj(a,!0);a.measure(d,e,0,0);break;case il:wj(a,!0);a.measure(d,f,0,0);break;case jl:wj(a,!0),a.measure(c,e,0,0)}}} t.Tl=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||zl(c,!0),this.R(),ec(a,b)||(c.oh(),this.In(c)))};t.In=function(a){null!==this.portId&&(zl(a,!0),a instanceof T&&Al(a,this))}; t.zc=function(a,b){if(this.visible){var c=this.opacity;if(0!==c){var d=this instanceof V&&(this.type===V.TableRow||this.type===V.TableColumn),e=this.Jb;if(d||0!==e.width&&0!==e.height&&!isNaN(e.x)&&!isNaN(e.y)){var f=1;1!==c&&(f=a.globalAlpha,a.globalAlpha=f*c);if(d){e=this.Jb;d=this.gc;var g=this.areaBackground,h=this.cc;null===g&&null===h||a.Vc();null!==g&&(ti(this,a,g,!0,!0,d,e),g instanceof Bl&&g.type===Cl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.Ef(g)):a.fillRect(e.x,e.y,e.width,e.height)); null!==h&&(ti(this,a,h,!0,!1,d,e),h instanceof Bl&&h.type===Cl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.Ef(h)):a.fillRect(e.x,e.y,e.width,e.height));this.mi(a,b)}else if(!this.gx(a,b)){this instanceof R&&this.ck(!1);G&&G.El&&G.bz&&G.bz(a,this);d=this.transform;g=this.panel;0!==(this.o&4096)===!0&&Dl(this);var k=this.part;h=!1;var l=0;if(k&&b.Te("drawShadows")&&(h=k.isShadowed)){var m=k.shadowOffset;l=Math.max(m.y,m.x)*b.scale*b.qc}m=this.zi();var n;if(!(n=b.hj||!m)){var p=this.naturalBounds; n=this.wh;var r=n.m11,q=n.m21,u=n.dx,x=n.m12,y=n.m22,z=n.dy,B,C=B=0;n=B*r+C*q+u;var D=B*x+C*y+z;B=p.width+l;C=0;var J=B*r+C*q+u;B=B*x+C*y+z;C=Math.min(n,J);var U=Math.min(D,B);var aa=Math.max(n+0,J)-C;var Y=Math.max(D+0,B)-U;n=C;D=U;B=p.width+l;C=p.height+l;J=B*r+C*q+u;B=B*x+C*y+z;C=Math.min(n,J);U=Math.min(D,B);aa=Math.max(n+aa,J)-C;Y=Math.max(D+Y,B)-U;n=C;D=U;B=0;C=p.height+l;J=B*r+C*q+u;B=B*x+C*y+z;C=Math.min(n,J);U=Math.min(D,B);aa=Math.max(n+aa,J)-C;Y=Math.max(D+Y,B)-U;n=C;D=U;l=b.viewportBounds; p=l.x;r=l.y;n=!(n>l.width+p||p>aa+n||D>l.height+r||r>Y+D)}if(n){n=0!==(this.o&256);a.clipInsteadOfFill&&(n=!1);this instanceof ch&&(a.font=this.font);if(n){D=g.se()?g.naturalBounds:g.actualBounds;null!==this.pb?(p=this.pb,aa=p.x,Y=p.y,l=p.width,p=p.height):(aa=Math.max(e.x,D.x),Y=Math.max(e.y,D.y),l=Math.min(e.right,D.right)-aa,p=Math.min(e.bottom,D.bottom)-Y);if(aa>e.width+e.x||e.x>D.width+D.x){1!==c&&(a.globalAlpha=f);return}a.save();a.beginPath();a.rect(aa,Y,l,p);a.clip()}if(m){if(!k.isVisible()){1!== c&&(a.globalAlpha=f);return}h&&(D=k.shadowOffset,a.wv(D.x*b.scale*b.qc,D.y*b.scale*b.qc,k.shadowBlur),El(a),a.shadowColor=k.shadowColor)}h&&!0===this.shadowVisible?El(a):h&&!1===this.shadowVisible&&Fl(a);k=this.naturalBounds;null!==this.areaBackground&&(a.Vc(),ti(this,a,this.areaBackground,!0,!0,k,e),this.areaBackground instanceof Bl&&this.areaBackground.type===Cl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.Ef(this.areaBackground)):a.fillRect(e.x,e.y,e.width,e.height));a.transform(d.m11,d.m12, d.m21,d.m22,d.dx,d.dy);h&&(null!==g&&0!==(g.o&512)||null!==g&&(g.type===V.Auto||g.type===V.Spot)&&g.Ab()!==this)&&null===this.shadowVisible&&Fl(a);null!==this.cc&&(a.Vc(),Gl(this,a,k,e));G&&G.El&&G.cz&&G.cz(a,this);h&&(null!==this.cc||null!==this.areaBackground||null!==g&&0!==(g.o&512)||null!==g&&(g.type===V.Auto||g.type===V.Spot)&&g.Ab()!==this)?(Hl(this,!0),null===this.shadowVisible&&Fl(a)):Hl(this,!1);this.mi(a,b);h&&0!==(this.o&512)===!0&&El(a);m&&h&&Fl(a);n&&(a.restore(),a.Uc(this instanceof V));d.js()||(b=1/(d.m11*d.m22-d.m12*d.m21),a.transform(d.m22*b,-d.m12*b,-d.m21*b,d.m11*b,b*(d.m21*d.dy-d.m22*d.dx),b*(d.m12*d.dx-d.m11*d.dy)))}}1!==c&&(a.globalAlpha=f)}}}};function Gl(a,b,c,d){var e=a.naturalBounds,f=0,g=0,h=e.width;e=e.height;var k=a.fw();a instanceof Qf&&(e=a.ya.bounds,f=e.x,g=e.y,h=e.width,e=e.height);ti(a,b,a.cc,!0,!1,c,d);a.cc instanceof Bl&&a.cc.type===Cl?(b.beginPath(),b.rect(f-k/2,g-k/2,h+k,e+k),b.Ef(a.cc)):b.fillRect(f-k/2,g-k/2,h+k,e+k)}t.gx=function(){return!1};t.mi=function(){}; function ti(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===Il)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var l=0;a instanceof Qf&&(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 Jl)&&c.ye&&(c.type===Kl||c.zk===h&&c.Us===k))var m=c.ye;else{var n=0,p=0,r=0,q=0,u=0,x=0;x=u=0;e?(u=g.x,x=g.y):d||(u-=l/2,x-=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+=x;q+=x;if(c.type===Ll)m=b.createLinearGradient(n,p,r,q);else if(c.type===Cl)x=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(u=0,x=Math.max(h,k)/2):u=c.startRadius,m=b.createRadialGradient(n,p,u,r,q,x);else if(c.type===Kl)try{m=b.createPattern(c.pattern,"repeat")}catch(z){m=null}else Aa(c.type,"Brush type");if(c.type!==Kl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)m.addColorStop(e.key,e.value);if(f&&(c.ye=m,null!== m&&(c.zk=h,c.Us=k),null===m&&c.type===Kl&&-1!==c.zk)){c.zk=-1;var y=a.diagram;null!==y&&-1===c.zk&&va(function(){y.redraw()},600)}}d?b.fillStyle=m:b.strokeStyle=m}}}t.vg=function(a){if(a instanceof V)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.Kf=function(){for(var a=this instanceof V?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; function Dl(a){if(0!==(a.o&2048)===!0){var b=a.Gb;b.reset();if(!a.Jb.u()||!a.wc.u()){Ml(a,!1);return}b.translate(a.Jb.x-a.wc.x,a.Jb.y-a.wc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;a.bo(b,c.x,c.y,c.width,c.height)}Ml(a,!1);Nl(a,!0)}0!==(a.o&4096)===!0&&(b=a.panel,null===b?(a.wh.set(a.Gb),a.Lk=a.scale,Nl(a,!1)):null!==b.oe&&(c=a.wh,c.reset(),b.se()?c.multiply(b.wh):null!==b.panel&&c.multiply(b.panel.wh),c.multiply(a.Gb),a.Lk=a.scale*b.Lk,Nl(a,!1)))} t.bo=function(a,b,c,d,e){1!==this.Ea&&a.scale(this.Ea);if(0!==this.Lb){var f=K.alloc();f.Di(b,c,d,e,Kc);a.rotate(this.Lb,f.x,f.y);K.free(f)}};t.w=function(a){if(!Bj(this)){void 0===a&&(a=!1);wj(this,!0);xl(this,!0);var b=this.panel;null===b||a||b.w()}};t.Zj=function(){Bj(this)||(wj(this,!0),xl(this,!0))};function Ol(a){if(!Cj(a)){var b=a.panel;null!==b?b.w():a.zi()&&(b=a.diagram,null!==b&&(b.De.add(a),a instanceof T&&a.Bd(),b.Sb()));xl(a,!0)}} t.Wk=function(){0!==(this.o&2048)===!1&&(Ml(this,!0),Nl(this,!0))};t.Xu=function(){Nl(this,!0)};t.R=function(){var a=this.part;null!==a&&a.R()}; function wl(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===V.Table)return Pl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===V.Auto&&d.Ab()===a)return Ql(a,Bd,b);if(c===kl){if(null!==d){if(d.type===V.Spot&&d.Ab()===a)return Ql(a,Bd,b);c=d.defaultStretch;return c===kl?Ql(a,yg,b):Ql(a,c,b)}return Ql(a,yg,b)}return Ql(a,c,b)} function Pl(a,b,c,d){var e=a.stretch;if(e!==kl)return Ql(a,e,d);var f=e=null;switch(b.stretch){case jl:f=!0;break;case Bd:f=!0}switch(c.stretch){case il:e=!0;break;case Bd:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===il||b===Bd);null===f&&(f=b===jl||b===Bd);return!0===e&&!0===f?Ql(a,Bd,d):!0===e?Ql(a,il,d):!0===f?Ql(a,jl,d):Ql(a,yg,d)} function Ql(a,b,c){if(c)return b;if(b===yg)return yg;c=a.desiredSize;if(c.u())return yg;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===il)return yg;if(b===Bd)return jl}else{if(b===jl)return yg;if(b===Bd)return il}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===jl)return yg;if(b===Bd)return il}else{if(b===il)return yg;if(b===Bd)return jl}return b}function Hl(a,b){a.o=b?a.o|512:a.o&-513}function sl(a){return 0!==(a.o&1024)}function Rl(a,b){a.o=b?a.o|1024:a.o&-1025} function Ml(a,b){a.o=b?a.o|2048:a.o&-2049}function Nl(a,b){a.o=b?a.o|4096:a.o&-4097}function Bj(a){return 0!==(a.o&8192)}function wj(a,b){a.o=b?a.o|8192:a.o&-8193}function Cj(a){return 0!==(a.o&16384)}function xl(a,b){a.o=b?a.o|16384:a.o&-16385}t.Bi=function(a){this.fg=a};t.As=function(){};t.tv=function(a){this.va=a;Ol(this);return!0};t.hm=function(a,b){if(this.va.x!==a||this.va.y!==b)this.va.h(a,b),this.Wk()};t.fw=function(){return 0}; function Sl(a){var b=a.part;if(b instanceof T&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||Al(b,a)}}function Tl(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof V?a instanceof T?a.Bd():a.nk(a,function(a){Sl(a)}):Sl(a))} t.bind=function(a,b,c,d){var e=null;"string"===typeof a?e=new Ji(a,b,c,d):e=a;e.yd=this;a=this.jh();null!==a&&Ul(a)&&v("Cannot add a Binding to a template that has already been copied: "+e);null===this.localBindings&&(this.localBindings=new H);this.localBindings.add(e);return this};t.set=function(a){if(G)for(var b in a)(b.startsWith("_")||-1!==b.indexOf("."))&&v("Property with underscore or period passed to GraphObject.set. Did you mean to use GraphObject.assign?");Object.assign(this,a);return this}; t.xu=function(a){Vl(this,a);return this};t.apply=function(a){a(this);return this};t.im=function(a){Ij(this,a);return this};t.qz=function(){return this.jh()};t.jh=function(){for(var a=this instanceof V?this:this.panel;null!==a;){if(null!==a.allBindings)return a;a=a.panel}return null};t.Av=function(a){a.yd=this;null===this.animationTriggers&&(this.animationTriggers=new yb);this.animationTriggers.add(a.propertyName,a);return this}; function Wl(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 db;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Ij(a,e)}else Ij(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+ a)}function $l(a,b){A(a,"string",O,"defineBuilder:name");A(b,"function",O,"defineBuilder:func");var c=a.toLowerCase();G&&(""===a||"none"===c||a===c)&&v("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);Xl.add(a,b)} function am(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} oa.Object.defineProperties(O.prototype,{bindingId:{configurable:!0,get:function(){return null!==this.B?this.B.pp:-1},set:function(a){this.bindingId!==a&&(null===this.B&&(this.B=new ql),this.B.pp=a)}},localBindings:{configurable:!0,get:function(){return null!==this.B?this.B.Rf:null},set:function(a){this.localBindings!==a&&(null===this.B&&(this.B=new ql),this.B.Rf=a)}},srcBindings:{configurable:!0,get:function(){return null!==this.B?this.B.jp:null},set:function(a){this.srcBindings!== a&&(null===this.B&&(this.B=new ql),this.B.jp=a)}},shadowVisible:{configurable:!0,get:function(){return null!==this.B?this.B.Ji:null},set:function(a){var b=this.shadowVisible;b!==a&&(G&&null!==a&&A(a,"boolean",O,"shadowVisible"),pl(this),this.B.Ji=a,this.R(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.B?this.B.Nc:null},set:function(a){var b=this.enabledChanged;b!==a&&(null!==a&&A(a,"function",O,"enabledChanged"),pl(this), this.B.Nc=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.ar:mg},set:function(a){var b=this.segmentOrientation;b!==a&&(G&&ab(a,R,O,"segmentOrientation"),null===this.Wa&&(this.Wa=new bm),this.Wa.ar=a,this.w(),this.g("segmentOrientation",b,a),a===mg&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.v:-Infinity},set:function(a){G&&A(a,"number",O,"segmentIndex");a= Math.round(a);var b=this.segmentIndex;b!==a&&(null===this.Wa&&(this.Wa=new bm),this.Wa.v=a,this.w(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return null!==this.Wa?this.Wa.m:0},set:function(a){G&&A(a,"number",O,"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.Ea=a,this.w(),this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.Lb},set:function(a){var b=this.Lb;b!==a&&(G&&E(a,O,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.Lb=a,Tl(this),this.w(),this.g("angle",b,a)))}},desiredSize:{configurable:!0, enumerable:!0,get:function(){return this.fd},set:function(a){G&&w(a,Hb,O,"desiredSize");var b=a.width,c=a.height,d=this.fd,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.fd=a=a.M(),this.w(),this instanceof Qf&&this.sc(),this.g("desiredSize",d,a),sl(this)&&(a=this.part,null!==a&&(tl(this,a,"width"),tl(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.fd.width},set:function(a){var b=this.fd.width;b===a||isNaN(b)&&isNaN(a)||(G&& A(a,"number",O,"width"),b=this.fd,this.fd=a=(new Hb(a,this.fd.height)).freeze(),this.w(),this instanceof Qf&&this.sc(),this.g("desiredSize",b,a),sl(this)&&(a=this.part,null!==a&&tl(this,a,"width")))}},height:{configurable:!0,get:function(){return this.fd.height},set:function(a){var b=this.fd.height;b===a||isNaN(b)&&isNaN(a)||(G&&A(a,"number",O,"height"),b=this.fd,this.fd=a=(new Hb(this.fd.width,a)).freeze(),this.w(),this instanceof Qf&&this.sc(),this.g("desiredSize",b,a),sl(this)&&(a= this.part,null!==a&&tl(this,a,"height")))}},minSize:{configurable:!0,get:function(){return null!==this.B?this.B.v:Pb},set:function(a){var b=this.minSize;b.D(a)||(G&&w(a,Hb,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),pl(this),this.B.v=a,this.w(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return null!==this.B?this.B.m:Ub},set:function(a){var b=this.maxSize;b.D(a)||(G&&w(a,Hb,O,"maxSize"),a=a.copy(),isNaN(a.width)&& (a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),pl(this),this.B.m=a,this.w(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.wc}},naturalBounds:{configurable:!0,get:function(){return this.gc}},margin:{configurable:!0,get:function(){return this.Mg},set:function(a){"number"===typeof a?a=new gc(a):G&&w(a,gc,O,"margin");var b=this.Mg;b.D(a)||(this.Mg=a=a.M(),this.w(),this.g("margin",b,a))}},transform:{configurable:!0, enumerable:!0,get:function(){0!==(this.o&2048)===!0&&Dl(this);return this.Gb}},oe:{configurable:!0,get:function(){0!==(this.o&4096)===!0&&Dl(this);return this.wh}},animationTriggers:{configurable:!0,get:function(){return null!==this.B?this.B.jb:null},set:function(a){this.animationTriggers!==a&&(pl(this),this.B.jb=a)}},reshapingBehavior:{configurable:!0,get:function(){return null!==this.B?this.B.Hi:yg},set:function(a){this.reshapingBehavior!==a&&(pl(this), this.B.Hi=a)}},alignment:{configurable:!0,get:function(){return this.Kb},set:function(a){var b=this.Kb;b.D(a)||(G&&w(a,Ib,O,"alignment"),a.kc()&&!a.Rb()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Kb=a=a.M(),Ol(this),this.g("alignment",b,a))}},column:{configurable:!0,get:function(){return this.Dg},set:function(a){G&&E(a,O,"column");a=Math.round(a);var b=this.Dg;b!==a&&(0>a&&Ba(a,">= 0",O,"column"),this.Dg=a,this.w(),this.g("column", b,a))}},columnSpan:{configurable:!0,get:function(){return null!==this.B?this.B.Ib:1},set:function(a){G&&A(a,"number",O,"columnSpan");a=Math.round(a);var b=this.columnSpan;b!==a&&(1>a&&Ba(a,">= 1",O,"columnSpan"),pl(this),this.B.Ib=a,this.w(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.Xn},set:function(a){G&&E(a,O,"row");a=Math.round(a);var b=this.Xn;b!==a&&(0>a&&Ba(a,">= 0",O,"row"),this.Xn=a,this.w(),this.g("row",b,a))}},rowSpan:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.Ii:1},set:function(a){G&&A(a,"number",O,"rowSpan");a=Math.round(a);var b=this.rowSpan;b!==a&&(1>a&&Ba(a,">= 1",O,"rowSpan"),pl(this),this.B.Ii=a,this.w(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return null!==this.B?this.B.Ki:null},set:function(a){var b=this.spanAllocation;b!==a&&(null!==a&&A(a,"function",O,"spanAllocation"),pl(this),this.B.Ki=a,this.w(),this.g("spanAllocation",b,a))}},alignmentFocus:{configurable:!0, enumerable:!0,get:function(){return this.tk},set:function(a){var b=this.tk;b.D(a)||(G&&w(a,Ib,O,"alignmentFocus"),!G||!a.kc()||a.Rb()||a.No()&&this instanceof T||v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.tk=a=a.M(),this.w(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.Sn},set:function(a){var b=this.Sn;if(b!==a){G&&null!==a&&A(a,"string",O,"portId");var c=this.part;null===c||c instanceof T||v("Cannot set portID on a Link: "+ a);null!==b&&null!==c&&dm(c,this);this.Sn=a;null!==a&&null!==c&&(c.Ue=!0,em(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.Gj:Ec},set:function(a){var b=this.toSpot;b.D(a)||(G&&w(a,Ib,O,"toSpot"),a=a.M(),this.Xc(),this.ea.Gj=a,this.g("toSpot",b,a),Sl(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Ej:10},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&&A(a,"number",O, "toEndSegmentLength"),0>a&&Ba(a,">= 0",O,"toEndSegmentLength"),this.Xc(),this.ea.Ej=a,this.g("toEndSegmentLength",b,a),Sl(this))}},toShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Fj:0},set:function(a){var b=this.toShortLength;b!==a&&(G&&A(a,"number",O,"toShortLength"),this.Xc(),this.ea.Fj=a,this.g("toShortLength",b,a),Sl(this))}},toLinkable:{configurable:!0,get:function(){return null!==this.ea?this.ea.Fr:null},set:function(a){var b=this.toLinkable; b!==a&&(G&&null!==a&&A(a,"boolean",O,"toLinkable"),this.Xc(),this.ea.Fr=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!==this.ea?this.ea.Gr:Infinity},set:function(a){var b=this.toMaxLinks;b!==a&&(G&&A(a,"number",O,"toMaxLinks"),0>a&&Ba(a,">= 0",O,"toMaxLinks"),this.Xc(),this.ea.Gr=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.cj:Ec},set:function(a){var b=this.fromSpot;b.D(a)||(G&& w(a,Ib,O,"fromSpot"),a=a.M(),this.Xc(),this.ea.cj=a,this.g("fromSpot",b,a),Sl(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.aj:10},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(G&&A(a,"number",O,"fromEndSegmentLength"),0>a&&Ba(a,">= 0",O,"fromEndSegmentLength"),this.Xc(),this.ea.aj=a,this.g("fromEndSegmentLength",b,a),Sl(this))}},fromShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.bj:0},set:function(a){var b= this.fromShortLength;b!==a&&(G&&A(a,"number",O,"fromShortLength"),this.Xc(),this.ea.bj=a,this.g("fromShortLength",b,a),Sl(this))}},fromLinkable:{configurable:!0,get:function(){return null!==this.ea?this.ea.Xp:null},set:function(a){var b=this.fromLinkable;b!==a&&(G&&null!==a&&A(a,"boolean",O,"fromLinkable"),this.Xc(),this.ea.Xp=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0,get:function(){return null!==this.ea?this.ea.Yp:Infinity},set:function(a){var b=this.fromMaxLinks; b!==a&&(G&&A(a,"number",O,"fromMaxLinks"),0>a&&Ba(a,">= 0",O,"fromMaxLinks"),this.Xc(),this.ea.Yp=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0,get:function(){return null!==this.B?this.B.j:""},set:function(a){var b=this.cursor;b!==a&&(A(a,"string",O,"cursor"),pl(this),this.B.j=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.B?this.B.zh:null},set:function(a){var b=this.click;b!==a&&(null!==a&&A(a,"function",O,"click"),pl(this), this.B.zh=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return null!==this.B?this.B.Fh:null},set:function(a){var b=this.doubleClick;b!==a&&(null!==a&&A(a,"function",O,"doubleClick"),pl(this),this.B.Fh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.B?this.B.Bh:null},set:function(a){var b=this.contextClick;b!==a&&(null!==a&&A(a,"function",O,"contextClick"),pl(this),this.B.Bh=a,this.g("contextClick",b, a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Rh:null},set:function(a){var b=this.mouseEnter;b!==a&&(null!==a&&A(a,"function",O,"mouseEnter"),pl(this),this.B.Rh=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.B?this.B.Uh:null},set:function(a){var b=this.mouseLeave;b!==a&&(null!==a&&A(a,"function",O,"mouseLeave"),pl(this),this.B.Uh=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0, get:function(){return null!==this.B?this.B.Vh:null},set:function(a){var b=this.mouseOver;b!==a&&(null!==a&&A(a,"function",O,"mouseOver"),pl(this),this.B.Vh=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.B?this.B.Th:null},set:function(a){var b=this.mouseHover;b!==a&&(null!==a&&A(a,"function",O,"mouseHover"),pl(this),this.B.Th=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return null!==this.B?this.B.Sh: null},set:function(a){var b=this.mouseHold;b!==a&&(null!==a&&A(a,"function",O,"mouseHold"),pl(this),this.B.Sh=a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Wd:null},set:function(a){var b=this.mouseDragEnter;b!==a&&(null!==a&&A(a,"function",O,"mouseDragEnter"),pl(this),this.B.Wd=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0,get:function(){return null!==this.B?this.B.Sf:null},set:function(a){var b= this.mouseDragLeave;b!==a&&(null!==a&&A(a,"function",O,"mouseDragLeave"),pl(this),this.B.Sf=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{configurable:!0,get:function(){return null!==this.B?this.B.Qh:null},set:function(a){var b=this.mouseDrop;b!==a&&(null!==a&&A(a,"function",O,"mouseDrop"),pl(this),this.B.Qh=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!==this.B?this.B.$:null},set:function(a){var b=this.actionDown;b!==a&&(null!==a&& A(a,"function",O,"actionDown"),pl(this),this.B.$=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!==this.B?this.B.ma:null},set:function(a){var b=this.actionMove;b!==a&&(null!==a&&A(a,"function",O,"actionMove"),pl(this),this.B.ma=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.B?this.B.Ma:null},set:function(a){var b=this.actionUp;b!==a&&(null!==a&&A(a,"function",O,"actionUp"),pl(this),this.B.Ma= a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.B?this.B.G:null},set:function(a){var b=this.actionCancel;b!==a&&(null!==a&&A(a,"function",O,"actionCancel"),pl(this),this.B.G=a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.B?this.B.ei:null},set:function(a){var b=this.toolTip;b!==a&&(!G||null===a||a instanceof Ce||a instanceof Me||v("GraphObject.toolTip must be an Adornment or HTMLInfo."), pl(this),this.B.ei=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.B?this.B.Ch:null},set:function(a){var b=this.contextMenu;b!==a&&(!G||a instanceof Ce||a instanceof Me||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."),pl(this),this.B.Ch=a,this.g("contextMenu",b,a))}}});O.prototype.trigger=O.prototype.Av;O.prototype.findBindingPanel=O.prototype.jh;O.prototype.findTemplateBinder=O.prototype.qz;O.prototype.setProperties=O.prototype.im; O.prototype.apply=O.prototype.apply;O.prototype.attach=O.prototype.xu;O.prototype.set=O.prototype.set;O.prototype.isEnabledObject=O.prototype.Kf;O.prototype.isVisibleObject=O.prototype.Lf;O.prototype.isContainedBy=O.prototype.vg;O.prototype.getNearestIntersectionPoint=O.prototype.bs;O.prototype.getLocalPoint=O.prototype.$r;O.prototype.getDocumentScale=O.prototype.Gf;O.prototype.getDocumentAngle=O.prototype.si;O.prototype.getDocumentBounds=O.prototype.ti;O.prototype.getDocumentPoint=O.prototype.oa; O.prototype.intersectsRect=O.prototype.Yc;O.prototype.containedInRect=O.prototype.hh;O.prototype.containsRect=O.prototype.Re;O.prototype.containsPoint=O.prototype.ga;O.prototype.raiseChanged=O.prototype.g;O.prototype.raiseChangedEvent=O.prototype.ib;O.prototype.addCopyProperty=O.prototype.Nw;var Xl=null;O.className="GraphObject";Xl=new yb; $l("Button",function(){function a(a,b){return null!==a.diagram.jc(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Wl(V,V.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof V){var c=a.lb("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"},Wl(Qf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Ib(0,0,2.76142374915397,2.761423749153969),spot2:new Ib(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Kf()&&b instanceof V&&(a=b.lb("ButtonBorder"),a instanceof Qf)){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.Kf()&&b instanceof V&&(a=b.lb("ButtonBorder"),a instanceof Qf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Kf()&&b instanceof V&&null!==b._buttonFillPressed&&0===a.button){var c=b.lb("ButtonBorder");if(c instanceof Qf){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.Kf()&&d instanceof V&&null!==d._buttonFillPressed&&0===b.button){var c=d.lb("ButtonBorder");if(c instanceof Qf){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.Kf()&&d instanceof V&&null!==d._buttonFillPressed){var c=d.lb("ButtonBorder");if(c instanceof Qf){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.Kf()&&d instanceof V&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.lb("ButtonBorder"),b instanceof Qf))){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}); $l("TreeExpanderButton",function(){var a=Wl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Wl(Qf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Sb},(new Ji("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).So()),{visible:!1},(new Ji("visible","isTreeLeaf",function(a){return!a})).So());a.click=function(a,c){c=c.part;c instanceof Ce&&(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}); $l("SubGraphExpanderButton",function(){var a=Wl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Wl(Qf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Sb},(new Ji("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).So()));a.click=function(a,c){c=c.part;c instanceof Ce&&(c=c.adornedPart);if(c instanceof wf){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});$l("ToolTip",function(){return Wl(Ce,V.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},Wl(Qf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Ib(0,0,4,6),spot2:new Ib(1,1,-4,-4)}))}); $l("ContextMenu",function(){return Wl(Ce,V.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},new Ji("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});$l("ContextMenuButton",function(){var a=Wl("Button");a.stretch=il;var b=a.lb("ButtonBorder");b instanceof Qf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new Ib(0,0,2,3),b.spot2=new Ib(1,1,-2,-2));return a}); $l("PanelExpanderButton",function(a){var b=am(a,"COLLAPSIBLE"),c=Wl("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},Wl(Qf,{name:"ButtonIcon",strokeWidth:2},(new Ji("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).So(b))); a=c.lb("ButtonBorder");a instanceof Qf&&(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.jh();null===e&&(e=c.part);null!==e&&(c=e.lb(b),null!==c&&(a.handled=!0,d.Ja("Collapse/Expand Panel"),c.visible=!c.visible,d.kb("Collapse/Expand Panel")))}};return c}); $l("CheckBoxButton",function(a){var b=am(a);a=Wl("Button",{desiredSize:new Hb(14,14)},Wl(Qf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Bd,geometryStretch:Ag,visible:!1},""!==b?(new Ji("visible",b)).Hx():[]));a.click=function(a,d){if(d instanceof V){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.lb("ButtonIcon");c.Ja("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.kb("checkbox")}}};return a}); $l("CheckBox",function(a){a=am(a);a=Wl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new gc(0,1,0,0)});var b=Wl(V,"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});O.None=yg=new F(O,"None",0);O.Default=kl=new F(O,"Default",0);O.Vertical=jl=new F(O,"Vertical",4);O.Horizontal=il=new F(O,"Horizontal",5);O.Fill=Bd=new F(O,"Fill",3);O.Uniform=Ag=new F(O,"Uniform",1); O.UniformToFill=ll=new F(O,"UniformToFill",2);O.FlipVertical=ml=new F(O,"FlipVertical",1);O.FlipHorizontal=nl=new F(O,"FlipHorizontal",2);O.FlipBoth=ol=new F(O,"FlipBoth",3);O.make=Wl;O.getBuilders=function(){var a=new yb,b;for(b in Xl)if(b!==b.toLowerCase()){var c=Xl.L(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};O.defineBuilder=$l; O.build=function(a,b){var c=Xl.L(a);if("function"===typeof c&&(c=c(null),c instanceof O))return b&&c.set(b),c;v('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')};O.takeBuilderArgument=am; function ql(){this.oc=!1;this.Ca="";this.pp=-1;this.ob=this.jp=this.Rf=null;this.j="";this.jb=this.Ki=this.Nc=this.Ch=this.ei=this.G=this.Ma=this.ma=this.$=this.Qh=this.Sf=this.Wd=this.Sh=this.Th=this.Vh=this.Uh=this.Rh=this.Bh=this.Fh=this.zh=null;this.v=Pb;this.m=Ub;this.lg=kl;this.Ib=this.Ii=1;this.Hi=yg;this.ue=this.Ji=this.tb=null;this.Oc="category"} ql.prototype.copy=function(){var a=new ql;a.Ca=this.Ca;a.pp=this.pp;a.Rf=this.Rf;a.ob=this.ob;a.j=this.j;a.zh=this.zh;a.Fh=this.Fh;a.Bh=this.Bh;a.Rh=this.Rh;a.Uh=this.Uh;a.Vh=this.Vh;a.Th=this.Th;a.Sh=this.Sh;a.Wd=this.Wd;a.Sf=this.Sf;a.Qh=this.Qh;a.$=this.$;a.ma=this.ma;a.Ma=this.Ma;a.G=this.G;a.ei=this.ei;a.Ch=this.Ch;a.Nc=this.Nc;a.Ki=this.Ki;a.jb=this.jb;a.v=this.v.M();a.m=this.m.M();a.lg=this.lg;a.Ii=this.Ii;a.Ib=this.Ib;a.Hi=this.Hi;a.tb=this.tb;a.Ji=this.Ji;a.ue=this.ue;a.Oc=this.Oc;return a}; function bm(){this.v=-Infinity;this.m=0;this.G=zb;this.ar=mg;this.j=this.$="None"}bm.prototype.copy=function(){var a=new bm;a.v=this.v;a.m=this.m;a.G=this.G.M();a.ar=this.ar;a.$=this.$;a.j=this.j;return a};bm.className="LinkElementSettings";function rl(){this.Gj=this.cj=hd;this.Fj=this.bj=this.Ej=this.aj=NaN;this.Fr=this.Xp=null;this.Gr=this.Yp=Infinity} rl.prototype.copy=function(){var a=new rl;a.cj=this.cj.M();a.Gj=this.Gj.M();a.aj=this.aj;a.Ej=this.Ej;a.bj=this.bj;a.Fj=this.Fj;a.Xp=this.Xp;a.Fr=this.Fr;a.Yp=this.Yp;a.Gr=this.Gr;return a};rl.className="LinkSettings";function fm(){this.Za=[1,0,0,1,0,0]}fm.prototype.copy=function(){var a=new fm;a.Za[0]=this.Za[0];a.Za[1]=this.Za[1];a.Za[2]=this.Za[2];a.Za[3]=this.Za[3];a.Za[4]=this.Za[4];a.Za[5]=this.Za[5];return a}; fm.prototype.translate=function(a,b){this.Za[4]+=this.Za[0]*a+this.Za[2]*b;this.Za[5]+=this.Za[1]*a+this.Za[3]*b};fm.prototype.scale=function(a,b){this.Za[0]*=a;this.Za[1]*=a;this.Za[2]*=b;this.Za[3]*=b};fm.className="STransform";function gm(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.Xw=[];this.pattern=null}gm.prototype.addColorStop=function(a,b){this.Xw.push({offset:a,color:b})};gm.className="SGradient"; function Lj(a,b){this.ownerDocument=a=void 0===b?sa.document:b;this.bA="http://www.w3.org/2000/svg";void 0!==a&&(this.Xa=this.$b("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Xa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Xa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.Bo=null;this.context=new hm(this)} Lj.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.Xa.setAttributeNS(null,"width",c+"px"),this.Xa.setAttributeNS(null,"height",d+"px"),this.Xa.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.pw.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.pw.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Lj.prototype.$b=function(a,b,c){a=this.ownerDocument.createElementNS(this.bA,a);if(Ga(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};Lj.prototype.getBoundingClientRect=function(){return this.Xa.getBoundingClientRect()};Lj.prototype.focus=function(){this.Xa.focus()};Lj.prototype.ex=function(){this.ownerDocument=null}; oa.Object.defineProperties(Lj.prototype,{width:{configurable:!0,get:function(){return this.Xa.width.baseVal.value},set:function(a){this.Xa.width=a}},height:{configurable:!0,get:function(){return this.Xa.height.baseVal.value},set:function(a){this.Xa.height=a}},style:{configurable:!0,get:function(){return this.Xa.style}}});Lj.className="SVGSurface"; function hm(a){this.Ds=a;this.svg=a.Xa;this.stack=[];this.sd=[];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.Wg=this.kr=this.jr=0;this.ls=null;this.path=[];this.rt=!1;this.Zg=null;this.Cj=0;this.Se=new fm; im(this,1,0,0,1,0,0);var b=pb++,c=this.$b("clipPath",{id:"mainClip"+b});c.appendChild(this.$b("rect",{x:0,y:0,width:a.width,height:a.height}));this.pw=c;this.Ds.Xa.appendChild(c);this.sd[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.dA={}}t=hm.prototype; 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.Se)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new gm("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.dA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+pb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.$b("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.$b(Ck,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new gm("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};L.ha(d,h)&&L.ha(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio= "xMidYMid slice"):a.preserveAspectRatio="none";l="";h/=d;k/=e;if(0!==f||0!==g)l+=" translate("+f+", "+g+")";if(1!==h||1!==k)l+=" scale("+h+", "+k+")";if(0!==b||0!==c)l+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+pb++,g=this.$b("clipPath",{id:f}),g.appendChild(this.$b("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),a["clip-path"]="url(#"+f+")";jm(this,Ck,a,this.Se,l);this.addElement(Ck,a)};t.fill=function(){this.addPath("fill",this.path,this.Se)}; t.Ef=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]};jm(this,"fill",a,this.Se);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};jm(this,"fill",b,this.Se);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.Se=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;eg.width+g.x||g.x> k.width+k.x||n>g.height+g.y||g.y>k.height+k.y)return!0;k=!0;im(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.zi()&&!this.isVisible())return!0;a.Se.Za=[1,0,0,1,0,0];(this instanceof ch&&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.Cm?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.Cm?this.clip():this.fill()};t.Fi=function(){this.Cm||this.stroke()};t.wv=function(a,b,c){this.jr=a;this.kr=b;this.Wg=c}; t.Tr=function(a,b){var c=this.ba;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Rr=function(){var a=this.ba;void 0!==a.setLineDash&&(a.setLineDash(lm),a.lineDashOffset=0)};t.Uc=function(a){a&&(this.Ss="");this.Rs=this.Ts=""}; oa.Object.defineProperties(Jl.prototype,{fillStyle:{configurable:!0,get:function(){return this.ba.fillStyle},set:function(a){this.Rs!==a&&(this.Rs=this.ba.fillStyle=a)}},font:{configurable:!0,get:function(){return this.ba.font},set:function(a){this.Ss!==a&&(this.Ss=this.ba.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.ba.globalAlpha},set:function(a){this.ba.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.ba.lineCap}, set:function(a){this.ba.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.ba.lineDashOffset},set:function(a){this.ba.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.ba.lineJoin},set:function(a){this.ba.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.ba.lineWidth},set:function(a){this.ba.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.ba.miterLimit},set:function(a){this.ba.miterLimit= a}},shadowBlur:{configurable:!0,get:function(){return this.ba.shadowBlur},set:function(a){this.ba.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.ba.shadowColor},set:function(a){this.ba.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.ba.shadowOffsetX},set:function(a){this.ba.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.ba.shadowOffsetY},set:function(a){this.ba.shadowOffsetY= a}},strokeStyle:{configurable:!0,get:function(){return this.ba.strokeStyle},set:function(a){this.Ts!==a&&(this.Ts=this.ba.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.ba.textAlign},set:function(a){this.ba.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.ba.imageSmoothingEnabled},set:function(a){this.ba.imageSmoothingEnabled=a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.Cm}, set:function(a){this.Cm=a}}});var lm=Object.freeze([]);Jl.className="CanvasSurfaceContext";function mm(){this.G=this.m=this.v=this.j=0}mm.className="ColorNumbers"; function Bl(a,b){nm||(om(),nm=!0);Za(this);this._isFrozen=!1;void 0===a?(this.wa=Il,this.yk="black"):"string"===typeof a?(this.wa=Il,G&&!pm(a)&&v('Color "'+a+'" is not a valid color string for Brush constructor'),this.yk=a):(G&&ab(a,Bl,Bl,"constructor:type"),this.wa=a,this.yk="black");a=this.wa;a===Ll?(this.Nd=Gc,this.Mk=Nc):this.Mk=a===Cl?this.Nd=Kc:this.Nd=Ec;this.qr=0;this.Np=NaN;this.ye=this.Oq=this.xe=null;this.Us=this.zk=0;b&&Object.assign(this,b)} Bl.prototype.copy=function(){var a=new Bl;a.wa=this.wa;a.yk=this.yk;a.Nd=this.Nd.M();a.Mk=this.Mk.M();a.qr=this.qr;a.Np=this.Np;null!==this.xe&&(a.xe=this.xe.copy());a.Oq=this.Oq;return a};t=Bl.prototype;t.freeze=function(){this._isFrozen=!0;null!==this.xe&&this.xe.freeze();return this};t.pa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;null!==this.xe&&this.xe.pa();return this};t.ub=function(a){a.classType===Bl?this.type=a:Ea(this,a)}; t.toString=function(){var a="Brush(";if(this.type===Il)a+=this.color;else if(a=this.type===Ll?a+"Linear ":this.type===Cl?a+"Radial ":this.type===Kl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; t.addColorStop=function(a,b){this._isFrozen&&xa(this);("number"!==typeof a||!isFinite(a)||1a)&&Ba(a,"0 <= loc <= 1",Bl,"addColorStop:loc");A(b,"string",Bl,"addColorStop:color");G&&!pm(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.xe&&(this.xe=new yb);this.xe.add(a,b);this.wa===Il&&(this.type=Ll);this.ye=null;return this}; function pm(a){if("black"===a)return!0;if(""===a)return!1;G&&A(a,"string",Bl,"isValidColor");nm||(om(),nm=!0);var b=qm;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.Vz=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?rm:b;if(this.type===Il)gi(this.color),this.color=sm(a,b);else if((this.type===Ll||this.type===Cl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)gi(c.value),this.addColorStop(c.key,sm(a,b));return this};function tm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?rm:c;gi(a);return sm(b,c)} t.Uy=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?rm:b;if(this.type===Il)gi(this.color),this.color=sm(-a,b);else if((this.type===Ll||this.type===Cl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)gi(c.value),this.addColorStop(c.key,sm(-a,b));return this};function um(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?rm:c;gi(a);return sm(-b,c)} function vm(a,b,c){gi(a);a=wm.j;var d=wm.v,e=wm.m,f=wm.G;gi(b);void 0===c&&(c=.5);return"rgba("+Math.round((wm.j-a)*c+a)+", "+Math.round((wm.v-d)*c+d)+", "+Math.round((wm.m-e)*c+e)+", "+Math.round((wm.G-f)*c+f)+")"} t.Bx=function(){if(this.type===Il)return xm(this.color);if((this.type===Ll||this.type===Cl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===Cl)return xm(a.first().value);if(null!==a.get(.5))return xm(a.get(.5));if(2===a.count)return a=a.Ka(),xm(vm(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 xm(vm(a.get(c),a.get(d),1-f/e))}return!1}; function xm(a){if(!a)return!1;if(a instanceof Bl)return a.Bx();gi(a);return 128>(299*wm.j+587*wm.v+114*wm.m)/1E3} function sm(a,b){switch(b){case rm:b=100*ym(wm.j);var c=100*ym(wm.v),d=100*ym(wm.m);zm.j=.4124564*b+.3575761*c+.1804375*d;zm.v=.2126729*b+.7151522*c+.072175*d;zm.m=.0193339*b+.119192*c+.9503041*d;zm.G=wm.G;b=Am(zm.j/Bm[0]);c=Am(zm.v/Bm[1]);d=Am(zm.m/Bm[2]);Cm.j=116*c-16;Cm.v=500*(b-c);Cm.m=200*(c-d);Cm.G=zm.G;Cm.j=Math.min(100,Math.max(0,Cm.j+100*a));a=(Cm.j+16)/116;b=a-Cm.m/200;zm.j=Bm[0]*Dm(Cm.v/500+a);zm.v=Bm[1]*(Cm.j>Em*Fm?Math.pow(a,3):Cm.j/Em);zm.m=Bm[2]*Dm(b);zm.G=Cm.G;a=-.969266*zm.j+1.8760108* zm.v+.041556*zm.m;b=.0556434*zm.j+-.2040259*zm.v+1.0572252*zm.m;wm.j=255*Gm((3.2404542*zm.j+-1.5371385*zm.v+-.4985314*zm.m)/100);wm.v=255*Gm(a/100);wm.m=255*Gm(b/100);wm.G=zm.G;wm.j=Math.round(wm.j);255wm.j&&(wm.j=0);wm.v=Math.round(wm.v);255wm.v&&(wm.v=0);wm.m=Math.round(wm.m);255wm.m&&(wm.m=0);return"rgba("+wm.j+", "+wm.v+", "+wm.m+", "+wm.G+")";case Hm:return hi(),ii.m=Math.min(100,Math.max(0,ii.m+100*a)),"hsla("+ii.j+", "+ii.v+"%, "+ii.m+"%, "+ ii.G+")";default:v("Unknown color space: "+b)}}function gi(a){nm||(om(),nm=!0);var b=qm;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,wm.j=a[0],wm.v=a[1],wm.m=a[2],wm.G=a[3]/255):(b.fillStyle="#FFFFFF",c=b.fillStyle,b.fillStyle=a,b.fillStyle===c&&G&&v('Color "'+a+'" is not a valid color string for RGBA color conversion'),wm.j=0,wm.v=0,wm.m=0,wm.G=1)}} function hi(){var a=wm.j/255,b=wm.v/255,c=wm.m/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))}ii.j=Math.round(g);ii.v=Math.round(100*a);ii.m=Math.round(100*e);ii.G=wm.G}function ym(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Gm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function Am(a){return a>Fm?Math.pow(a,1/3):(Em*a+16)/116}function Dm(a){var b=a*a*a;return b>Fm?b:(116*a-16)/Em}function cm(a,b){"string"===typeof a?G&&!pm(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof Bl||v("Value for "+b+" must be a color string or a Brush, not "+a)}function om(){qm=ah?(new Dk(null)).context:null} oa.Object.defineProperties(Bl.prototype,{type:{configurable:!0,get:function(){return this.wa},set:function(a){this._isFrozen&&xa(this,a);ab(a,Bl,Bl,"type");this.wa=a;this.start.kc()&&(a===Ll?this.start=Gc:a===Cl&&(this.start=Kc));this.end.kc()&&(a===Ll?this.end=Nc:a===Cl&&(this.end=Kc));this.ye=null}},color:{configurable:!0,get:function(){return this.yk},set:function(a){this._isFrozen&&xa(this,a);G&&!pm(a)&&v('Color "'+a+'" is not a valid color string for Brush.color'); this.yk=a;this.ye=null}},start:{configurable:!0,get:function(){return this.Nd},set:function(a){this._isFrozen&&xa(this,a);w(a,Ib,Bl,"start");this.Nd=a.M();this.ye=null}},end:{configurable:!0,get:function(){return this.Mk},set:function(a){this._isFrozen&&xa(this,a);w(a,Ib,Bl,"end");this.Mk=a.M();this.ye=null}},startRadius:{configurable:!0,get:function(){return this.qr},set:function(a){this._isFrozen&&xa(this,a);E(a,Bl,"startRadius");0>a&&Ba(a,">= zero",Bl, "startRadius");this.qr=a;this.ye=null}},endRadius:{configurable:!0,get:function(){return this.Np},set:function(a){this._isFrozen&&xa(this,a);E(a,Bl,"endRadius");0>a&&Ba(a,">= zero",Bl,"endRadius");this.Np=a;this.ye=null}},colorStops:{configurable:!0,get:function(){return this.xe},set:function(a){this._isFrozen&&xa(this,a);G&&w(a,yb,Bl,"colorStops");this.xe=a;this.ye=null}},pattern:{configurable:!0,get:function(){return this.Oq},set:function(a){this._isFrozen&& xa(this,a);this.Oq=a;this.ye=null}}});Bl.prototype.isDark=Bl.prototype.Bx;Bl.prototype.darkenBy=Bl.prototype.Uy;Bl.prototype.lightenBy=Bl.prototype.Vz;Bl.prototype.addColorStop=Bl.prototype.addColorStop;var Fm=216/24389,Em=24389/27,Bm=[95.047,100,108.883],qm=null,wm=new mm,ii=new mm,zm=new mm,Cm=new mm,nm=!1;Bl.className="Brush";var Il;Bl.Solid=Il=new F(Bl,"Solid",0);var Ll;Bl.Linear=Ll=new F(Bl,"Linear",1);var Cl;Bl.Radial=Cl=new F(Bl,"Radial",2);var Kl;Bl.Pattern=Kl=new F(Bl,"Pattern",4);var rm; Bl.Lab=rm=new F(Bl,"Lab",5);var Hm;Bl.HSL=Hm=new F(Bl,"HSL",6); Bl.randomColor=function(a,b){void 0===a&&(a=128);G&&(E(a,Bl,"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};Bl.isValidColor=pm;Bl.lighten=function(a){return tm(a)};Bl.lightenBy=tm;Bl.darken=function(a){return um(a)};Bl.darkenBy=um;Bl.mix=vm;Bl.isDark=xm;function Zl(){this.Ca="Base"}Zl.prototype.measure=function(){};Zl.prototype.Yz=function(a,b,c,d,e){a.measure(b,c,d,e)};Zl.prototype.arrange=function(){};Zl.prototype.Iy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Zl.prototype.hA=function(a){a.Zj()};Zl.prototype.zc=function(){}; oa.Object.defineProperties(Zl.prototype,{name:{configurable:!0,get:function(){return this.Ca},set:function(a){this.Ca=a}},classType:{configurable:!0,get:function(){return V}}});Zl.prototype.remeasureObject=Zl.prototype.hA;Zl.prototype.arrangeElement=Zl.prototype.Iy;Zl.prototype.measureElement=Zl.prototype.Yz;Zl.className="PanelLayout";function Im(){this.Ca="Base"}na(Im,Zl); Im.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Jm(a);for(var k=0;kaa&&(tb=Math.max(aa-Af,0));var Hk=0===Q.sa;Q.pc=Q.pc+tb;Q.actual=Q.sa+tb;aa=Math.max(aa-(tb+(Hk?Af:0)),0)}if(1===tc.columnSpan&&(Yb===yg||Yb===jl)){Q=a.getColumnDefinition(Xb);var $i=Q.Wc();tb=Math.max(dg-Q.actual,0);tb+$i>U&&(tb=Math.max(U-$i,0));var fo=0===Q.sa;Q.pc=Q.pc+tb;Q.actual=Q.sa+tb;U=Math.max(U- (tb+(fo?$i:0)),0)}zf&&tc.Zj()}}}}}Pa(z);var ce=0,De=0;f=a.columnCount;for(var Ng=0;Ng=a.rowCount);bf++)Q=a.getRowDefinition(cb.row+bf),tb=0,tb=Yb===Bd||Yb===jl?Math.max(Q.minimum,0===Hd[cb.row+bf]?Q.maximum:Math.min(Hd[cb.row+bf],Q.maximum)):Math.max(Q.minimum,isNaN(Q.Hc)?Q.maximum:Math.min(Q.Hc,Q.maximum)),Ud.height+=tb,Dc+=Q.minimum;for(var dd=1;dd=a.columnCount);dd++)Q=a.getColumnDefinition(cb.column+dd),tb=0,tb=Yb===Bd||Yb===il?Math.max(Q.minimum,0===Pc[cb.column+dd]?Q.maximum:Math.min(Pc[cb.column+dd], Q.maximum)):Math.max(Q.minimum,isNaN(Q.Hc)?Q.maximum:Math.min(Q.Hc,Q.maximum)),Ud.width+=tb,Lk+=Q.minimum;xb.width+=Ud.width;xb.height+=Ud.height;var Zh=cb.margin,Ff=Zh.right+Zh.left,bj=Zh.top+Zh.bottom;cb.measure(xb.width,xb.height,Lk,Dc);for(var $h=cb.measuredBounds,Vd=Math.max($h.width+Ff,0),hg=Math.max($h.height+bj,0),Gf=0,ai=0;ai=a.rowCount);ai++)Q=a.getRowDefinition(cb.row+ai),Gf+=Q.total||0;if(Gf=cf)&&!(cb.row+Ge>=a.rowCount);Ge++){Q=a.getRowDefinition(cb.row+Ge);var ef=Q.sa||0,ff=df(cb,Q,ee);G&&"number"!==typeof ff&&v(cb+" spanAllocation does not return a number: "+ff);Q.actual=Math.min(Q.maximum,ef+ff);Q.sa!==ef&&(cf-=Q.sa-ef)}for(;0Id&&(Q.actual=Math.min(Q.maximum,Id+cf),Q.sa!==Id&&(cf-=Q.sa-Id));if(0===Q.index)break;Q=a.getRowDefinition(Q.index-1)}}for(var Qg=0,gf=0;gf=a.columnCount);gf++)Q= a.getColumnDefinition(cb.column+gf),Qg+=Q.total||0;if(Qg=Rg)&&!(cb.column+ig>=a.columnCount);ig++){Q=a.getColumnDefinition(cb.column+ig);var cj=Q.sa||0,dj=He(cb,Q,ho);G&&"number"!==typeof dj&&v(cb+" spanAllocation does not return a number: "+dj);Q.actual=Math.min(Q.maximum,cj+dj);Q.sa!==cj&&(Rg-=Q.sa-cj)}for(;0Mk&&(Q.actual=Math.min(Q.maximum, Mk+Rg),Q.sa!==Mk&&(Rg-=Q.sa-Mk));if(0===Q.index)break;Q=a.getColumnDefinition(Q.index-1)}}}}Pa(B);Hb.free(Ud);Hb.free(xb);void 0!==Hd&&Pa(Hd);void 0!==Pc&&Pa(Pc);var Sg=0,Tg=0,Nk=a.desiredSize,Kr=a.maxSize;Yb=wl(a,!0);var ej=De=ce=0,fj=0;f=a.columnCount;for(var Ok=0;Ok=a.rowCount);Q++){var la=a.getRowDefinition(z+Q);0!==la.sa&&(y.height+=la.total)}for(Q=1;Q=a.columnCount);Q++)la=a.getColumnDefinition(C+Q),0!==la.sa&&(y.width+=la.total);var fa=D.sa+y.width,za=B.sa+y.height;Q=h;la=k;var Ma=fa,sb=za,wb=h,Wb=k,tb=fa,Ye=za;h+fa>c.width&&(tb=Math.max(c.width-h,0));k+za>c.height&&(Ye=Math.max(c.height-k,0));var jb=Y.alignment;if(jb.Rb()){jb=a.defaultAlignment; jb.mb()||(jb=Kc);var Ed=jb.x;var Xb=jb.y;var Ze=jb.offsetX;jb=jb.offsetY;var Ic=D.alignment,bd=B.alignment;Ic.mb()&&(Ed=Ic.x,Ze=Ic.offsetX);bd.mb()&&(Xb=bd.y,jb=bd.offsetY)}else Ed=jb.x,Xb=jb.y,Ze=jb.offsetX,jb=jb.offsetY;if(isNaN(Ed)||isNaN(Xb))Xb=Ed=.5,jb=Ze=0;Ic=W.width;bd=W.height;var Ac=Y.margin,tc=Ac.left+Ac.right,zf=Ac.top+Ac.bottom,Fd=Pl(Y,B,D,!1);!isNaN(Y.desiredSize.width)||Fd!==Bd&&Fd!==il||(Ic=Math.max(fa-tc,0));!isNaN(Y.desiredSize.height)||Fd!==Bd&&Fd!==jl||(bd=Math.max(za-zf,0));fa= Y.maxSize;za=Y.minSize;Ic=Math.min(fa.width,Ic);bd=Math.min(fa.height,bd);Ic=Math.max(za.width,Ic);bd=Math.max(za.height,bd);fa=bd+zf;Q+=Ma*Ed-(Ic+tc)*Ed+Ze+Ac.left;la+=sb*Xb-fa*Xb+jb+Ac.top;Y.visible&&(mc(wb,Wb,tb,Ye,Q,la,W.width,W.height)?Y.arrange(Q,la,Ic,bd):Y.arrange(Q,la,Ic,bd,new M(wb,Wb,tb,Ye)))}}Hb.free(y);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,p=n.x;n=n.y;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();for(var r=[],q=a.U.s,u=q.length,x=0;xB)){y=gk(y.figure);for(var C=0;CB&&z.push(D))}}}}q= a.U.s;u=q.length;for(x=0;xe*y*c))){B=J.segmentIndex;if(!isFinite(B)||isNaN(B))B=0;0>B&&(B=y-Math.min(-B,y));B=Math.round(B%y);y=J.opacity;C=1;if(1!==y){if(0===y)continue;C=b.globalAlpha;b.globalAlpha=C*y}D=r[x];var U=!1,aa=J.strokeDashArray;null!==aa&&(U=!0,b.Tr(aa,J.strokeDashOffset));if("LineV"===J.figure&&null!==J.stroke&&0b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;en)z.measure(Infinity,Infinity,0,0),B=z.measuredBounds,c.cd(B),r.push(B);else{var C=z.segmentIndex,D=z.segmentFraction,J=z.alignmentFocus;J.kc()&&(J=Kc);var U=z.segmentOrientation,aa=z.segmentOffset;if(isNaN(C)){var Y=k.ya;B=Na();Y.Ru(D,B);var W=K.allocAt(B[0],B[1]);W.add(k.i(0));Y.type=== N.j?W.offset(-Y.startX,-Y.startY):(Y=Y.figures.first(),null!==Y&&W.offset(-Y.startX,-Y.startY));Y=B[2];if(U!==mg){var Q=k.computeAngle(z,U,Y);z.Lb=Q}Q=W.x-b.x;var la=W.y-b.y;K.free(W);Pa(B)}else if(C<-n||C>=n)B=K.alloc(),k.yg(),k.computeMidPoint(B),Y=k.midAngle,U!==mg&&(Q=k.computeAngle(z,U,Y),z.Lb=Q),Q=B.x-b.x,la=B.y-b.y,K.free(B);else{Q=0;0<=C?(la=m.N(C),B=Cfa+10?0<=C?Y.cb(la):la.cb(Y):fa>W+10?0<=C?B.cb(Q):Q.cb(B):0<=C?Y.cb(Q):Q.cb(Y)}else Y=0<=C?la.cb(B):B.cb(la);U!==mg&&(Q=k.computeAngle(z,U,Y),z.Lb=Q);Q=la.x+(B.x-la.x)*D-b.x;la=la.y+(B.y-la.y)*D-b.y}z.measure(Infinity,Infinity,0,0);B=z.measuredBounds;W=z.naturalBounds;var za=0;z instanceof Qf&&(za=z.strokeWidth);fa=W.width+za;var Ma=W.height+za;q.reset();q.translate(-B.x,-B.y);q.scale(z.scale,z.scale);q.rotate(U===mg?z.angle:Y,fa/2,Ma/2);U!==an&&U!==bn||q.rotate(90, fa/2,Ma/2);U!==cn&&U!==dn||q.rotate(-90,fa/2,Ma/2);U===en&&(45Y||225Y)&&q.rotate(-Y,fa/2,Ma/2);W=new M(0,0,fa,Ma);u.Ci(W,J);q.La(u);J=-u.x+za/2*z.scale;z=-u.y+za/2*z.scale;x.assign(aa);za=isNaN(aa.x);var sb=isNaN(aa.y);if(za||sb){fa=fa/2+3;Ma=Ma/2+3;var wb=45<=Y&&135>=Y,Wb=225<=Y&&315>=Y;U===mg&&(wb||Wb)?(x.x=sb?fa:aa.y,x.y=za?Ma:aa.x,wb?0<=C||isNaN(C)&&.5>D||!za||(x.y=-Ma):Wb&&((0<=C||isNaN(C)&&.5>D)&&za&&(x.y=-Ma),sb&&(x.x=-fa))):(za&&(x.x=0<=C||isNaN(C)&&.5>D?fa:-fa),sb&&(x.y=-Ma), x.rotate(Y))}else x.rotate(Y);Q+=x.x;la+=x.y;W.set(B);W.h(Q+J,la+z,B.width,B.height);r.push(W);c.cd(W)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.ng=c;a.position.h(b.x+c.x,b.y+c.y);a.location.h(NaN,NaN);bc(e,c.width||0,c.height||0);Jb.free(q);K.free(u);K.free(x)}}}}; Zm.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Ce||a instanceof R){var d=a,e=null;a instanceof Ce&&(e=a,d=e.adornedPart);var f=a instanceof Ce?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h=c)q=K.alloc(),r=n,x=q,r.yg(),r.computeMidPoint(x),r=n.midAngle,l!==mg&&(n=n.computeAngle(g,l,r),g.angle=n),n=q.x,x=q.y, K.free(q);else{u=0;0<=h?(q=b.s[h],x=hz+10?0<=h?r.cb(q):q.cb(r):z>y+10?0<=h?x.cb(u):u.cb(x):0<=h?r.cb(u):u.cb(r)}else r=0<=h?q.cb(x):x.cb(q);l!==mg&&(n=n.computeAngle(g,l,r),g.angle=n);n=q.x+(x.x-q.x)*k;x=q.y+(x.y-q.y)*k}if(p.No())g.location=new K(n,x);else{p.kc()&&(p=Kc);q=Jb.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle, 0,0);var B=g.naturalBounds;u=M.allocAt(0,0,B.width,B.height);y=K.alloc();y.Ci(u,p);q.La(y);p=-y.x;z=-y.y;var C=B.width,D=B.height;B=K.alloc();B.assign(m);var J=isNaN(m.x),U=isNaN(m.y);if(J||U){C=C/2+3;D=D/2+3;var aa=45<=r&&135>=r,Y=225<=r&&315>=r;l===mg&&(aa||Y)?(B.x=U?C:m.y,B.y=J?D:m.x,aa?0<=h||isNaN(h)&&.5>k||!J||(B.y=-D):Y&&((0<=h||isNaN(h)&&.5>k)&&J&&(B.y=-D),U&&(B.x=-C))):(J&&(B.x=0<=h||isNaN(h)&&.5>k?C:-C),U&&(B.y=-D),B.rotate(r))}else B.rotate(r);n+=B.x;x+=B.y;q.fp(u);p+=u.x;z+=u.y;h=K.allocAt(n+ p,x+z);g.move(h);K.free(h);K.free(B);K.free(y);M.free(u);Jb.free(q)}}null!==e?e.ck(!1):d.ck(!1)}}; function $m(a,b,c,d){if(!1!==Bj(d)){var e=d.strokeWidth;0===e&&a instanceof Ce&&a.type===V.Link&&a.adornedObject instanceof Qf&&(e=a.adornedObject.strokeWidth);e*=d.Ea;a instanceof R&&null!==a.ya?(a=a.ya.bounds,d.Ge(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Ce&&null!==a.adornedPart.ya?(a=a.adornedPart.ya.bounds,d.Ge(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.Ge(-(e/2),-(e/2),b+e,c+e);e=d.desiredSize;e.u()||null===d.ya?d.gc.h(0,0,e.width,e.height):d.gc.assign(d.ya.bounds);wj(d,!1)}} function fn(){this.Ca="Base"}na(fn,Zl); fn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Ab();a.graduatedBounds=[];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 M(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.graduatedBounds.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,x=r.flattenedLengths,y=r.flattenedTotalLength,z=u.length,B=0,C=0,D=Na(),J=0;Jfa&&(fa+=360);aa.push(fa)}B=Q;C=la}D.push(aa)}if(null===a.graduatedIntervals){for(var za=[],Ma=a.U.s,sb=Ma.length,wb=0;wbYe))for(var jb=0;jbYe&&tb.push(Xb)}}}}a.graduatedIntervals=za}var Ze=a.graduatedIntervals;var Ic=a.U.s,bd=Ic.length,Ac=0,tc=0,zf=y;a.graduatedMarks= [];for(var Fd,Sh=0;ShZi*Yb*y/a.graduatedRange&&null===Bc.graduatedSkip)){var Mg=x[0][0],Rd=0,uc=0;tc=y*Bc.graduatedStart-1E-4;zf=y*Bc.graduatedEnd+1E-4;var dg=Zi*Yb,Cc=a.graduatedTickBase;if(Cca.graduatedMin+dg&&(Cc-=Math.floor((Cc-a.graduatedMin)/dg)*dg);for(var Hk=Ze[Sh],$i=Cc,fo=1E-6*a.graduatedMax, ce=1;Cc<=a.graduatedMax+fo;ce++){a:{for(var De=Hk.length,Ng=0;Ng-Th){var Cf=!1;break a}}Cf=!0}if(Cf&&(Cc>a.graduatedMax&&(Cc=a.graduatedMax),null===Bc.graduatedSkip||Bc instanceof ch&&!Bc.graduatedSkip(Cc,Bc)||Bc instanceof Qf&&!Bc.graduatedSkip(Cc,Bc))&&(Ac=(Cc-a.graduatedMin)*y/a.graduatedRange,Ac>y&&(Ac=y),tc<=Ac&&Ac<=zf)){for(var de=D[Rd][uc],$e=x[Rd][uc];RdMg&&uc< x[Rd].length-1;)uc++,de=D[Rd][uc],$e=x[Rd][uc],Mg+=$e;if(Ac<=Mg)break;Rd++;uc=0;de=D[Rd][uc];$e=x[Rd][uc];Mg+=$e}var vc=u[Rd],Sd=vc[2*uc],Ik=vc[2*uc+1],Ee=(Ac-(Mg-$e))/$e,Uh=new K(Sd+(vc[2*uc+2]-Sd)*Ee+q/2-r.bounds.x,Ik+(vc[2*uc+3]-Ik)*Ee+q/2-r.bounds.y);Uh.scale(h.scale,h.scale);a:{var Gd=de,eg=D[Rd];if(!(.5005>Ee&&.4995Ee?0Ee||.9995Og){var Vh=1-Math.abs(.5-Ee);de=(Gd*Vh+Td*(1-Vh))%360;break a}}}de=Gd}if(Bc instanceof ch){var nd="";null!==Bc.graduatedFunction?(nd=Bc.graduatedFunction(Cc,Bc),nd=null!==nd&&void 0!==nd?nd.toString():""):nd=(+Cc.toFixed(2)).toString();""!==nd&&Fd.push({Vl:Uh,angle:de,text:nd})}else Fd.push({Vl:Uh,angle:de})}Cc=$i+ce*dg}}}a.graduatedMarks.push(Fd)}Pa(D); var xb=a.graduatedMarks;if(null!==xb)for(var aj=d.length,jc=0;jcod;od++){switch(od){case 0:wc.h(Ud,Hd);break;case 1:wc.h(Ud+Wh,Hd);break;case 2:wc.h(Ud,Hd+gg);break;case 3:wc.h(Ud+Wh,Hd+gg)}wc.rotate(cb+kb.angle);wc.offset(Kk,Yh);0===Xh&&0===od?Pc.h(wc.x,wc.y,0,0):Pc.Ze(wc);wc.offset(-Kk,-Yh);wc.rotate(-cb-kb.angle)}K.free(wc);null!==Fe.graduatedBounds&&Fe.graduatedBounds.push(Pc);lc(af,Pc.x,Pc.y,Pc.width,Pc.height)}else if(kb instanceof ch){var cd=a,Lk=e;null===cd.temporaryTextBlock&&(cd.temporaryTextBlock=new ch);var Dc=cd.temporaryTextBlock;gn(Dc,kb); var bf=kb.alignmentFocus;bf.kc()&&(bf=Gc);for(var dd=kb.segmentOrientation,Zh=kb.segmentOffset,Ff=new M,bj=0,$h=0,Vd=0,hg=0,Gf=0,ai=kc.length,cf=0;cfVd||225Vd)&&Id.rotate(-Vd,ef/2,ff/2);var Qg=M.allocAt(0,0,ef,ff),gf=K.alloc();gf.Ci(Qg,bf);Id.La(gf);var Rg=-gf.x,ho=-gf.y,He=K.alloc();He.assign(Zh);isNaN(He.x)&&(He.x=ef/2+3);isNaN(He.y)&&(He.y=-(ff/2+3));He.rotate(Vd);bj+=He.x+Rg;$h+=He.y+ho;var ig=new M(bj,$h,df.width,df.height),cj=new M(df.x,df.y,df.width,df.height),dj=new M(Ge.x,Ge.y,Ge.width,Ge.height); ee.Tz=hg;ee.lineCount=Dc.lineCount;ee.lines=[Dc.Db,Dc.Lh,Dc.ef,Dc.Le,Dc.Pc,Dc.ac,Dc.Ae];ee.actualBounds=ig;ee.measuredBounds=cj;ee.naturalBounds=dj;0===cf?Ff.assign(ig):Ff.cd(ig);K.free(He);K.free(gf);M.free(Qg);Jb.free(Id)}null!==cd.graduatedBounds&&cd.graduatedBounds.push(Ff);lc(Lk,Ff.x,Ff.y,Ff.width,Ff.height)}wj(kb,!1)}}}; fn.prototype.arrange=function(a,b,c){if(null!==a.graduatedBounds){var d=a.Ab(),e=a.graduatedMarks;if(null!==e){var f=a.graduatedBounds,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.U.s,k=a.graduatedMarks,l=h.length,m=0;ma.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e&&null===n.graduatedSkip)){var q=n.measuredBounds,u=n.strokeWidth* n.scale,x=n.alignmentFocus;x.kc()&&(x=Gc);for(var y=0;yf.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var n=l.separatorStroke;null===n&&(n=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(0!==m&&null!==n){ti(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray; null===p&&(p=c?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray);null!==p&&(n=!0,b.Tr(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.zb;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.Rr()}}}} function kn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=mn(a,!0),l=mn(a,!1),m=0;mp)){var r=n.Wc(),q=n.separatorStrokeWidth;isNaN(q)&&(q=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var u=n.separatorStroke;null===u&&(u=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(null===u||n.index===(c?k:l))q=0;r-= q;q=n.position+q;r+=n.actual;q+r>p&&(r=p-q);0>=r||(p=a.zb,ti(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left,q+p.top,g.width-(p.left+p.right),r):b.fillRect(q+p.left,p.top,r,g.height-(p.top+p.bottom)))}}}}function mn(a,b){for(var c=b?a.rowCount:a.columnCount,d=0;dd&&e.set(q),K.free(q));K.free(m);f&&e.transform(g);return l}; t.w=function(a){if(!Bj(this)){O.prototype.w.call(this,a);a=null;if(this.wa===V.Auto||this.wa===V.Link)a=this.Ab();for(var b=this.U.s,c=b.length,d=0;dc||f>d)this.w(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Bd:this.w(!0);this.measure(c+h,d+g,0,0);break;case il:this.w(!0);this.measure(c+h,f+g,0,0);break;case jl:this.w(!0),this.measure(b+h,d+g,0,0)}}this.wa.arrange(this,e,this.ng)}}; t.ih=function(a){var b=this.naturalBounds,c=Jm(this);if(mc(0,0,b.width,b.height,a.x,a.y)){b=this.U.s;for(var d=b.length,e=K.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Kb(e.set(a),f.transform),f.ga(e))return K.free(e),!0}K.free(e);return null===this.cc&&null===this.areaBackground?!1:!0}return!1};t.Ur=function(a){if(this.bindingId===a)return this;for(var b=this.U.s,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 V?m:null;p=Jb.alloc();p.set(g); if(null!==m?m.Ff(a,b,c,d,e,p):vl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Jb.free(p)}}}void 0===f&&Jb.free(g);return d}void 0===f&&Jb.free(g);return!1};function tn(a,b,c,d){for(var e=a.U.s,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 V&&tn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.tg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var g=this.naturalBounds,h=this.se(),k=h?a:Kb(K.allocAt(a.x,a.y),this.transform),l=h?b:Kb(K.allocAt(b.x,b.y),this.transform),m=k.Df(l),n=0x.width||u.y>x.height||0>u.x+u.width||0>u.y+u.height))if(q.se()?(u=q.transform,Kb(k.set(a),u),Kb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof V?q:null,null!==q?q.tg(k,l,c,d,e,f):u.mx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}K.free(k);K.free(l)}return e?n:g}return!1}; function Pm(a){var b=null;a instanceof Qf&&(b=a.spot1,b===hd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Fc);return b}function Qm(a){var b=null;a instanceof Qf&&(b=a.spot2,b===hd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Oc);return b}t.add=function(a){for(var b=[],c=0;c=e.count&&a>=e.count)return; e.sb(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.Hb(a,b);if(0===a||b.isPanelMain)this.ah=null;Bj(this)||this.w();b.w(!1);null!==b.portId?this.Ue=!0:b instanceof V&&!0===b.Ue&&(this.Ue=!0);this.graduatedIntervals=null;this.Kf()||un(this,b,!1);c=this.part;null!==c&&(c.Wh=null,c.dg=NaN,this.Ue&&c instanceof T&&(c.Ue=!0),c.Ue&&c instanceof T&&(c.yc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&& c.ib(te,"elements",this,b,null,d,null),c.ib(se,"elements",this,null,b,null,a)))};function vn(a,b){a.o=b?a.o|16777216:a.o&-16777217}t.remove=function(a){w(a,O,V,"remove:element");for(var b=this.U.s,c=b.length,d=-1,e=0;ea&&Ba(a,">= 0",V,"getRowDefinition:idx");a=Math.round(a);var b=this.rowDefs;if(void 0===b[a]){var c=new ck;c.Bi(this);c.isRow=!0;c.index=a;b[a]=c;this.ib(se,"rowdefs",this,null,c,null,a)}return b[a]}; V.prototype.nA=function(a){G&&E(a,V,"removeRowDefinition:idx");0>a&&Ba(a,">= 0",V,"removeRowDefinition:idx");if(0!==this.rowCount){a=Math.round(a);var b=this.rowDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.ib(te,"rowdefs",this,c,null,a,null);this.w()}}};function dk(a,b,c){var d=a.rowDefs;if(!(0>b)){d[b]=c instanceof ck?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} V.prototype.getColumnDefinition=function(a){G&&E(a,V,"getColumnDefinition:idx");0>a&&Ba(a,">= 0",V,"getColumnDefinition:idx");a=Math.round(a);var b=this.colDefs;if(void 0===b[a]){var c=new ck;c.Bi(this);c.isRow=!1;c.index=a;b[a]=c;this.ib(se,"coldefs",this,null,c,null,a)}return b[a]};t=V.prototype; t.iA=function(a){G&&E(a,V,"removeColumnDefinition:idx");0>a&&Ba(a,">= 0",V,"removeColumnDefinition:idx");if(0!==this.columnCount){a=Math.round(a);var b=this.colDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.ib(te,"coldefs",this,c,null,a,null);this.w()}}};function ek(a,b,c){var d=a.colDefs;if(!(0>b)){d[b]=c instanceof ck?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} t.oz=function(a){if(0>a||this.type!==V.Table||0===this.rowCount)return-1;for(var b=0,c=this.rowDefs,d=c.length,e=this.topIndex;ea||this.type!==V.Table||0===this.columnCount)return-1;for(var b=0,c=this.colDefs,d=c.length,e=this.leftIndex;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||(Fa("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),xn=!0)}}))} t.Sy=function(a){void 0===a&&(a=!1);var b=this.copy();on(b,function(a){a instanceof V&&(a.allBindings=null,a.vb=null);var b=a.localBindings;null!==b&&(a.localBindings=null,b.each(function(b){a.bind(b.copy())}));b=a.animationTriggers;null!==b&&(a.animationTriggers=null,b.each(function(b){a.Av(b.value.copy())}))});a&&xg(b);return b}; t.Pa=function(a){var b=this.allBindings;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)if(""===e)d=this;else if("/"===e)d=this;else if("."===e)d=this;else if(".."===e)d=this;else{if(d=this.lb(e),null===d){G&&Fa("Binding error: missing GraphObject named "+e+" in "+this.toString());continue}}else if(c.isToModel)if(d=this.diagram,null!==d)d= d.model.modelData;else continue;var f=this,g=c.Gi;if(-1!==g){if(f=this.Ur(g),null===f)continue}else null!==c.yd&&(f=c.yd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.jo;if(0!==e){if(!(f instanceof V))continue;1===e?f=f.getColumnDefinition(c.yl):2===e&&(f=f.getRowDefinition(c.yl))}void 0!==f&&c.Dv(f,d)}}};t.lx=function(a){if(void 0===a||null===a||null===this.fe)return null;A(a,"object",V,"findItemPanelForData");return this.fe.L(a)}; function yn(a,b){a=a.U.s;for(var c=a.length,d=b.length,e=0,f=null;ea;)this.rc(this.U.length-1,!1);zn(this,this.itemArray)}; function zn(a,b){var c=rn(a);if(null===b||0===b.length)for(;a.U.length>c;)a.rc(a.U.length-1,!1);else if(a.U.length<=c){c=b.length;for(var d=0;dc)){var e=Bn(a,b);e=Cn(a,e);if(null!==e){xg(e);e=e.copy();if(0!==(e.o&16777216)){var f=a.jh();null!==f&&vn(f,!0)}"object"===typeof b&&(null===a.fe&&(a.fe=new yb),a.fe.add(b,e));f=c+rn(a);a.Hb(f,e);d&&(e.vb=b,Dn(a,f,c),e.vb=null);e.data=b}}} function Dn(a,b,c){for(a=a.U;ba&&Ba(a,">= 0",V,"padding"), a=new gc(a)):(w(a,gc,V,"padding"),0>a.left&&Ba(a.left,">= 0",V,"padding:value.left"),0>a.right&&Ba(a.right,">= 0",V,"padding:value.right"),0>a.top&&Ba(a.top,">= 0",V,"padding:value.top"),0>a.bottom&&Ba(a.bottom,">= 0",V,"padding:value.bottom"));var b=this.zb;b.D(a)||(this.zb=a=a.M(),this.w(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.Om},set:function(a){var b=this.Om;b.D(a)||(G&&w(a,Ib,V,"defaultAlignment"),this.Om=a=a.M(),this.w(),this.g("defaultAlignment", b,a))}},defaultStretch:{configurable:!0,get:function(){return this.Wf},set:function(a){var b=this.Wf;b!==a&&(ab(a,O,V,"defaultStretch"),this.Wf=a,this.w(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return null!==this.W?this.W.Hp:yc},set:function(a){"number"===typeof a?a=new gc(a):G&&w(a,gc,V,"defaultSeparatorPadding");var b=this.defaultSeparatorPadding;b.D(a)||(a=a.M(),null===this.W&&(this.W=new In),this.W.Hp=a,this.w(),this.g("defaultSeparatorPadding", b,a))}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return null!==this.W?this.W.ma:null},set:function(a){var b=this.defaultRowSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof Bl)&&(a instanceof Bl&&a.freeze(),null===this.W&&(this.W=new In),this.W.ma=a,this.R(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return null!==this.W?this.W.Ma:1},set:function(a){var b=this.defaultRowSeparatorStrokeWidth; b!==a&&isFinite(a)&&0<=a&&(null===this.W&&(this.W=new In),this.W.Ma=a,this.w(),this.g("defaultRowSeparatorStrokeWidth",b,a))}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return null!==this.W?this.W.$:null},set:function(a){var b=this.defaultRowSeparatorDashArray;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",V,"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),null===this.W&&(this.W=new In),this.W.Ib=a,this.w(),this.g("topIndex",b,a))}},leftIndex:{configurable:!0,get:function(){return null!==this.W?this.W.jb:0},set:function(a){var b= this.leftIndex;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+a),null===this.W&&(this.W=new In),this.W.jb=a,this.w(),this.g("leftIndex",b,a))}},data:{configurable:!0,get:function(){return this.vb},set:function(a){var b=this.vb;if(b!==a){var c=this instanceof S&&!(this instanceof Ce);c&&A(a,"object",V,"data");xg(this);this.vb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof R?(null!==b&&c.cf.remove(b),null!==a&&c.cf.add(a, this)):this instanceof S&&(null!==b&&c.df.remove(b),null!==a&&c.df.add(a,this))):(c=this.panel,null!==c&&null!==c.fe&&(null!==b&&c.fe.remove(b),null!==a&&c.fe.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Pa()}}},itemIndex:{configurable:!0,get:function(){return this.sn},set:function(a){var b=this.sn;b!==a&&(this.sn=a,this.g("itemIndex",b,a))}},allBindings:{configurable:!0,get:function(){return null!==this.B?this.B.ob:null},set:function(a){this.localBindings!== a&&(null===this.B&&(this.B=new ql),this.B.ob=a)}},itemArray:{configurable:!0,get:function(){return this.Jh},set:function(a){G&&null!==a&&!Array.isArray(a)&&v("Panel.itemArray must be an Array-like object or null, not: "+a);var b=this.Jh;if(b!==a||null!==a&&yn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Tj(c.partManager,this,c),this.Jh=a,null!==c&&null!==a&&Qj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||zn(this,a)}}},itemTemplate:{configurable:!0, enumerable:!0,get:function(){return null===this.itemTemplateMap?null:this.itemTemplateMap.L("")},set:function(a){if(null===this.itemTemplateMap){if(null===a)return;this.itemTemplateMap=new yb}var b=this.itemTemplateMap.L("");b!==a&&(w(a,V,V,"itemTemplate"),(a instanceof S||a.isPanelMain)&&v("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.iv())}},itemTemplateMap:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.ue:null},set:function(a){var b=this.itemTemplateMap;if(b!==a){w(a,yb,V,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;G&&(d instanceof S||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}pl(this);this.B.ue=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.iv()}}},itemCategoryProperty:{configurable:!0,get:function(){return null!== this.B?this.B.Oc:"category"},set:function(a){var b=this.itemCategoryProperty;b!==a&&("string"!==typeof a&&"function"!==typeof a&&Aa(a,"string or function",V,"itemCategoryProperty"),pl(this),this.B.Oc=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(A(a,"boolean",V,"isAtomic"),this.o^=1048576,this.g("isAtomic",b,a))}},isClipping:{configurable:!0,get:function(){return 0!== (this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(G&&(A(a,"boolean",V,"isClipping"),!a||this.type===V.Spot||this instanceof wf||Fa("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString())),this.o^=2097152,this instanceof wf&&(this.pb=null),this.w(),this.g("isClipping",b,a))}},isOpposite:{configurable:!0,get:function(){return 0!==(this.o&33554432)},set:function(a){var b=0!==(this.o&33554432);b!==a&&(A(a,"boolean",V,"isOpposite"),this.o^=33554432,this.w(), this.g("isOpposite",b,a))}},isEnabled:{configurable:!0,get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);if(b!==a){A(a,"boolean",V,"isEnabled");var c=null===this.panel||this.panel.Kf();this.o^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&un(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.af},set:function(a){var b=this.af;b!==a&&(G&&A(a,"string",V,"alignmentFocusName"), this.af=a,this.w(),this.g("alignmentFocusName",b,a))}}}); oa.Object.defineProperties(V,{Position:{configurable:!0,get:function(){return Yl.L("Position")}},Horizontal:{configurable:!0,get:function(){return Yl.L("Horizontal")}},Vertical:{configurable:!0,get:function(){return Yl.L("Vertical")}},Spot:{configurable:!0,get:function(){return Yl.L("Spot")}},Auto:{configurable:!0,get:function(){return Yl.L("Auto")}},Table:{configurable:!0,get:function(){return Yl.L("Table")}},Viewbox:{configurable:!0, enumerable:!0,get:function(){return Yl.L("Viewbox")}},TableRow:{configurable:!0,get:function(){return Yl.L("TableRow")}},TableColumn:{configurable:!0,get:function(){return Yl.L("TableColumn")}},Link:{configurable:!0,get:function(){return Yl.L("Link")}},Grid:{configurable:!0,get:function(){return Yl.L("Grid")}},Graduated:{configurable:!0,get:function(){return Yl.L("Graduated")}}});V.prototype.rebuildItemElements=V.prototype.iv; V.prototype.findItemPanelForData=V.prototype.lx;V.prototype.updateTargetBindings=V.prototype.Pa;V.prototype.copyTemplate=V.prototype.Sy;V.prototype.graduatedValueForPoint=V.prototype.Hz;V.prototype.graduatedPointForValue=V.prototype.Gz;V.prototype.findColumnForLocalX=V.prototype.gz;V.prototype.findRowForLocalY=V.prototype.oz;V.prototype.removeColumnDefinition=V.prototype.iA;V.prototype.removeRowDefinition=V.prototype.nA;V.prototype.removeAt=V.prototype.sb;V.prototype.remove=V.prototype.remove; V.prototype.insertAt=V.prototype.Hb;V.prototype.elt=V.prototype.N;V.prototype.add=V.prototype.add;V.prototype.findObject=V.prototype.lb;V.prototype.findInVisualTree=V.prototype.Jl;V.prototype.walkVisualTreeFrom=V.prototype.nk;V.prototype.findMainElement=V.prototype.Ab;var xn=!1,Fn=!1,Gn=null,Yl=new yb;V.className="Panel";V.definePanelLayout=Hn;Hn("Position",new Im);Hn("Vertical",new Lm);Hn("Auto",new Om);Hn("Link",new Zm); function Jn(){this.$p=0;this.G=100;this.ma=10;this.$=0;this.di=this.m=this.j=this.v=null}Jn.prototype.copy=function(){var a=new Jn;a.$p=this.$p;a.G=this.G;a.ma=this.ma;a.$=this.$;a.v=this.v;a.j=this.j;a.m=this.m;a.di=this.di;return a};Jn.className="GradPanelSettings";function In(){this.Oc=[];this.Nc=[];this.j=this.tb=Kn;this.jb=this.Ib=0;this.Hp=yc;this.Ma=1;this.$=this.ma=null;this.G=1;this.ob=this.m=this.v=null} In.prototype.copy=function(a){for(var b=new In,c=this.Oc,d=c.length,e=b.Oc,f=0;fa&&Ba(a,">= 0",ck,"height"),this.Hc=a,this.actual=this.sa,null!== this.panel&&this.panel.w(),this.Pb("height",b,a))}},width:{configurable:!0,get:function(){return this.Hc},set:function(a){var b=this.Hc;b!==a&&(G&&A(a,"number",ck,"width"),0>a&&Ba(a,">= 0",ck,"width"),this.Hc=a,this.actual=this.sa,null!==this.panel&&this.panel.w(),this.Pb("width",b,a))}},minimum:{configurable:!0,get:function(){return this.rj},set:function(a){var b=this.rj;b!==a&&(G&&A(a,"number",ck,"minimum"),(0>a||!isFinite(a))&&Ba(a,">= 0",ck,"minimum"),this.rj=a,this.actual= this.sa,null!==this.panel&&this.panel.w(),this.Pb("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.pj},set:function(a){var b=this.pj;b!==a&&(G&&A(a,"number",ck,"maximum"),0>a&&Ba(a,">= 0",ck,"maximum"),this.pj=a,this.actual=this.sa,null!==this.panel&&this.panel.w(),this.Pb("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.Kb},set:function(a){var b=this.Kb;b.D(a)||(G&&w(a,Ib,ck,"alignment"),this.Kb=a.M(),null!==this.panel&&this.panel.w(), this.Pb("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.lg},set:function(a){var b=this.lg;b!==a&&(G&&ab(a,O,ck,"stretch"),this.lg=a,null!==this.panel&&this.panel.w(),this.Pb("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.hg},set:function(a){"number"===typeof a?a=new gc(a):null!==a&&G&&w(a,gc,ck,"separatorPadding");var b=this.hg;null!==a&&null!==b&&b.D(a)||(null!==a&&(a=a.M()),this.hg=a,null!==this.panel&&this.panel.w(), this.Pb("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.$n},set:function(a){var b=this.$n;b!==a&&(null!==a&&cm(a,"RowColumnDefinition.separatorStroke"),a instanceof Bl&&a.freeze(),this.$n=a,null!==this.panel&&this.panel.w(),this.Pb("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.ao},set:function(a){var b=this.ao;b!==a&&(this.ao=a,null!==this.panel&&this.panel.w(),this.Pb("separatorStrokeWidth", b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.Bj},set:function(a){var b=this.Bj;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",ck,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,x=Na(),y=2;yn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;y=0;q=x[y];n=q[0];r=q[1];p=q[2];q=q[3];for(var z=0;.1<=u;){0===z&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); if(e>u){Pa(x);return}e>q?(z=e-q,e=q):z=0;var B=Math.sqrt(e*e/(1+p*p));0>n&&(B=-B);h+=B;k+=p*B;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===z&&d.mi(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==z){y++;if(y===x.length){Pa(x);return}q=x[y];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Pa(x)}} t.mi=function(a,b){var c=this.Tc,d=this.Nk;if(null!==c||null!==d){var e=this.ya;if(null!==e){a.Vc();var f=this.actualBounds,g=this.naturalBounds;null!==d&&ti(this,a,d,!0,!1,g,f);var h=this.part,k=this.mg;null===c||0!==k||null===h||!this.isPanelMain&&h.Ab()!==this||(k=h.type===V.Link&&h instanceof Ce&&"Selection"===h.category&&h.adornedObject instanceof Qf&&h.adornedPart.Ab()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(ti(this,a,c,!1,!1,g,f),a.lineWidth=k,a.lineJoin= this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit);f=!1;h&&b.Te("drawShadows")&&(f=h.isShadowed);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.Tr(k,this.strokeDashOffset));if(e.type===N.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.Fi();else if(e.type===N.v){var l=e.startX;k=e.startY;var m=e.endX,n=e.endY;e=Math.min(l,m);var p=Math.min(k,n);l=Math.abs(m-l);k=Math.abs(n-k);a.beginPath();a.rect(e, p,l,k);null!==d&&a.Ef(d);if(null!==c){h&&f&&Fl(a);if(0===l||0===k)a.beginPath(),a.rect(e,p,Math.max(l,.1),Math.max(k,.1));a.Fi();h&&f&&El(a)}}else if(e.type===N.G)l=e.startX,k=e.startY,m=e.endX,n=e.endY,e=Math.abs(m-l)/2,p=Math.abs(n-k)/2,l=Math.min(l,m)+e,k=Math.min(k,n)+p,a.beginPath(),a.moveTo(l,k-p),a.bezierCurveTo(l+L.zg*e,k-p,l+e,k-L.zg*p,l+e,k),a.bezierCurveTo(l+e,k+L.zg*p,l+L.zg*e,k+p,l,k+p),a.bezierCurveTo(l-L.zg*e,k+p,l-e,k+L.zg*p,l-e,k),a.bezierCurveTo(l-e,k-L.zg*p,l-L.zg*e,k-p,l,k-p), a.closePath(),null!==d&&a.Ef(d),null!==c&&(h&&f?(Fl(a),a.Fi(),El(a)):a.Fi());else if(e.type===N.m)for(e=e.figures,k=e.length,p=0;pu.sweepAngle,null!==r?r.endX:l.startX,null!==r?r.endY:l.startY)}else if(r=ae(u,l),x=r.length,0===x)a.lineTo(u.centerX,u.centerY);else for(var y=0;y(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;M.free(f);return L.Yb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== N.v){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.Bc(-d,-d);if(f.ga(a))return M.free(f),!1;f.Bc(d,d)}null!==this.stroke&&f.Bc(e,e);a=f.ga(a);M.free(f);return a}if(c.type===N.G){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 M.free(f), !1;g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);M.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===N.m)return M.free(f),null===this.fill?he(c,a.x,a.y,e):fe(c,a,e,1=this.strokeWidth)m=L.We(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=Na();a=new K;L.We(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new K;L.We(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new K;L.We(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new K;L.We(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 Pa(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)Math.abs(q)?(u*=.5/q,q=.5):0!==u&&.5>Math.abs(u)&&(q*=.5/u,u=.5),y-=q,z-= u;r.contains(y,z);)y-=q,z-=u;e.x=h;e.y=k;for(u=0;uc?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||L.ha(k.y,a))&&(k.yb||L.ha(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.mx=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.ih(a,!0))return!0;var e=a.Df(b),f=e;1.5=e||Mb(b,f,0,-n)>= e||Mb(b,f,0,n)>=e||Mb(b,f,m,0)>=e?!1:!0}else if(b.type===N.m){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.xl&&a.ye&&Lb(a.x,a.y,f,h,k,h)>e&&Lb(a.x,a.y,k,l,f,l)>e&&Lb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?he(b,a.x,a.y,f):fe(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.s;k=h.length;for(l=0;le)return!1;break;case Xd:var p=Na();L.Qe(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Yd:p=Na();L.To(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Zd:case $d:p=n.type===Zd?ae(n,f):be(n,f,g,m);var r=p.length;if(0===r){g=n.type===Zd?n.centerX:n.endX;m=n.type===Zd?n.centerY:n.endY;if(a.zd(g,m)> e)return!1;break}n=null;for(var q=Na(),u=0;ub+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 Vn(a){var b=Un[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Un[c];if(void 0===b){var d=null,e;for(e in L.qm)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=N.parse(L.qm[d],!1),Un[d]=a,c!==d&&(Un[c]=d),d}}return"string"===typeof b?b:b instanceof N?a:null} oa.Object.defineProperties(Qf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.ya?this.ya:this.Od},set:function(a){var b=this.ya,c=this.Od;if(b!==a){null!==a?(G&&w(a,N,Qf,"geometry"),this.Od=this.ya=a.freeze()):this.Od=this.ya=null;var d=this.part;null!==d&&(d.dg=NaN);this.w();this.g("geometry",b||c,a);sl(this)&&(a=this.part,null!==a&&tl(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()}, set:function(a){a=N.parse(a);var b=a.normalize();this.geometry=a;this.position=a=K.allocAt(-b.x,-b.y);K.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){G&&A(a,"boolean",Qf,"isGeometryPositioned");var b=0!==(this.o&1048576);b!==a&&(G&&A(a,"boolean",Qf,"isGeometryPositioned"),this.o^=1048576,this.w(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.Nk},set:function(a){var b= this.Nk;b!==a&&(null!==a&&cm(a,"Shape.fill"),a instanceof Bl&&a.freeze(),this.Nk=a,this.R(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Tc},set:function(a){var b=this.Tc;b!==a&&(null!==a&&cm(a,"Shape.stroke"),a instanceof Bl&&a.freeze(),this.Tc=a,this.R(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.mg},set:function(a){var b=this.mg;if(b!==a)if(G&&E(a,Qf,"strokeWidth"),0<=a){this.mg=a;this.w();var c=this.part; null!==c&&(c.dg=NaN);this.g("strokeWidth",b,a)}else Ba(a,"value >= 0",Qf,"strokeWidth:value")}},strokeCap:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.rr:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?Ba(a,'"butt", "round", or "square"',Qf,"strokeCap"):(Mn(this),this.Sa.rr=a,this.R(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.sr:"miter"}, set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?Ba(a,'"miter", "bevel", or "round"',Qf,"strokeJoin"):(Mn(this),this.Sa.sr=a,this.R(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.tr:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a)if(G&&E(a,Qf,"strokeMiterLimit"),1<=a){Mn(this);this.Sa.tr=a;this.R();var c=this.part;null!==c&&(c.dg=NaN);this.g("strokeMiterLimit", b,a)}else G&&Ba(a,"value >= 1",Qf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.Zg},set:function(a){var b=this.Zg;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",Qf,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1(n*n+m*m)*p*p&&(c=!0);b.dc!==a&&(c=!1);!1===b.Te("textGreeking")&& (c=!1);b=this.spacingAbove;n=this.spacingBelow;switch(this.flip){case nl:a.translate(e,0);a.scale(-1,1);break;case ml:a.translate(0,f);a.scale(1,-1);break;case ol:a.translate(e,f),a.scale(-1,-1)}a.Vc();m=this.kd;p=(b+g+n)*m;f>p&&(d=this.verticalAlignment,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.Ae)n=this.Db,n>e&&(n=e),this.li(this.Ae,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.Pc&&null!==this.ac)for(p=0;pe&&(r=e);d+=b;this.li(this.ac[p],a,0,d,e,g,r,c,h,k,l);d+=g+n}switch(this.flip){case nl:a.scale(-1, 1);a.translate(-e,0);break;case ml:a.scale(1,-1);a.translate(0,-f);break;case ol:a.scale(-1,-1),a.translate(-e,-f)}}}; t.li=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!==co?co(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!==eo?eo(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.Sl=function(a,b,c,d){this.Lh=a;var e=this.Be;null!==Yn&&lo!==e&&(lo=Yn.font=e);this.Db=this.Le=0;this.Ae=this.ac=this.Pc=this.ef=null;var f;if(isNaN(this.desiredSize.width)){e=this.hc.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);g=e.substr(g,k-g);this.formatting===mo&&(g=g.trim());f=Math.max(f,no(g));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=no(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=oo(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;h=f;if(0!==this.Db&&null!==this.Pc&&null!==this.ac&&this.overflow===po&&(b=this.Be,b=this.overflow===po?qo(b):0,k=this.spacingAbove+this.spacingBelow,k=Math.max(0,bo(this)+k),h=Math.min(this.maxLines-1,Math.max(Math.floor(h/k+.01)-1,0)),!(h+1>=this.ac.length))){k=this.ac[h];for(b=Math.max(1, a-b);no(k)>b&&1=a.maxLines)null!==d&&d.h(0,h);else if(g=b,a.wrap===vo){a.Le=1;var l=no(b);if(0===k||l<=c)a.Db=Math.max(a.Db,l),to(a,b,a.Db),null!==d&&d.h(l,h);else{f=wo(a,g);g=g.substr(f.length);b=wo(a,g);for(l=no(f+b);0 c&&1c;){var n=1;l=no(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=no(b.substr(0,n));if(1===n){var p=l;f=Math.max(f,l)}else p=m,f=Math.max(f,m);n--;1>n&&(n=1);to(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.kd+k>a.maxLines)break}m=wo(a,g);for(l=no(b+m);0a.maxLines))break}a.Le=Math.min(a.maxLines,k);a.Db=Math.max(a.Db,f);null!==d&&d.h(a.Db,h*a.Le)}} function wo(a,b){if(a.wrap===xo)return b.substr(0,1);for(var c=b.length,d=0,e=yo;d=b.length?b:b.substr(0,d)}function no(a){return null===Yn?8*a.length:Yn.measureText(a).width}function bo(a){if(null!==a.ef)return a.ef;var b=a.Be;if(null===Yn){var c=16;return a.ef=c}void 0!==Ao[b]&&5E3>Bo?c=Ao[b]:(c=1.3*Yn.measureText("M").width,Ao[b]=c,Bo++);return a.ef=c} function qo(a){if(null===Yn)return 6;if(void 0!==Co[a]&&5E3>Do)var b=Co[a];else b=Yn.measureText(ro).width,Co[a]=b,Do++;return b} function oo(a,b){var c=a.hc.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.spacingAbove+a.spacingBelow;d=Math.max(0,bo(a)+d);if(0===c.length)return a.Db=0,a.kd=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.kd=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.wrap!==vo){a.Le=0;var k=Hb.alloc();uo(a,f,b,k);e+=k.height;Hb.free(k);a.kd+=a.Le}else uo(a,f,b,null),e+=d,a.kd++;a.kd===a.maxLines&&(h=!0)}f=g+1}return a.xq=e} oa.Object.defineProperties(ch.prototype,{font:{configurable:!0,get:function(){return this.Be},set:function(a){var b=this.Be;b!==a&&(G&&(A(a,"string",ch,"font"),ao(a)||v('Not a valid font: "'+a+'"')),this.Be=a,this.ef=null,this.w(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.hc},set:function(a){var b=this.hc;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.hc=a,this.w(),this.g("text",b,a))}},textAlign:{configurable:!0,get:function(){return null!== this.ia?this.ia.Ar:"start"},set:function(a){var b=this.textAlign;b!==a&&(G&&A(a,"string",ch,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(Zn(this),this.ia.Ar=a,this.R(),this.g("textAlign",b,a)):G&&Ba(a,'"start", "end", "left", "right", or "center"',ch,"textAlign"))}},flip:{configurable:!0,get:function(){return null!==this.ia?this.ia.Zf:yg},set:function(a){var b=this.flip;b!==a&&(ab(a,O,ch,"flip"),Zn(this),this.ia.Zf=a,this.R(),this.g("flip",b,a))}},verticalAlignment:{configurable:!0, enumerable:!0,get:function(){return null!==this.ia?this.ia.Kr:kd},set:function(a){var b=this.verticalAlignment;b.D(a)||(G&&(w(a,Ib,ch,"verticalAlignment"),a.kc()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),a=a.M(),Zn(this),this.ia.Kr=a,Ol(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.gc.u()){var a=Hb.alloc();uo(this,this.hc,999999,a);var b=a.width;Hb.free(a);a=oo(this,b);var c=this.desiredSize;isNaN(c.width)|| (b=c.width);isNaN(c.height)||(a=c.height);bc(this.gc,b,a)}return this.gc}},isMultiline:{configurable:!0,get:function(){return 0!==(this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(G&&A(a,"boolean",ch,"isMultiline"),this.o^=2097152,this.w(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);b!==a&&(G&&A(a,"boolean",ch,"isUnderline"),this.o^=4194304,this.R(),this.g("isUnderline", b,a))}},isStrikethrough:{configurable:!0,get:function(){return 0!==(this.o&8388608)},set:function(a){var b=0!==(this.o&8388608);b!==a&&(G&&A(a,"boolean",ch,"isStrikethrough"),this.o^=8388608,this.R(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return null!==this.ia?this.ia.Nr:Eo},set:function(a){var b=this.wrap;b!==a&&(G&&ab(a,ch,ch,"wrap"),Zn(this),this.ia.Nr=a,this.w(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return null!== this.ia?this.ia.Lq:Fo},set:function(a){var b=this.overflow;b!==a&&(G&&ab(a,ch,ch,"overflow"),Zn(this),this.ia.Lq=a,this.w(),this.g("overflow",b,a))}},stroke:{configurable:!0,get:function(){return this.Tc},set:function(a){var b=this.Tc;b!==a&&(null!==a&&cm(a,"TextBlock.stroke"),a instanceof Bl&&a.freeze(),this.Tc=a,this.R(),this.g("stroke",b,a))}},lineCount:{configurable:!0,get:function(){return this.kd}},lineHeight:{configurable:!0,get:function(){return bo(this)}}, editable:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(G&&A(a,"boolean",ch,"editable"),this.o^=1048576,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return null!==this.ia?this.ia.Cr:null},set:function(a){var b=this.textEditor;b!==a&&(!G||a instanceof Me||v("TextBlock.textEditor must be an HTMLInfo."),Zn(this),this.ia.Cr=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0, get:function(){return null!==this.ia?this.ia.Fd:null},set:function(a){var b=this.errorFunction;b!==a&&(null!==a&&A(a,"function",ch,"errorFunction"),Zn(this),this.ia.Fd=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return null!==this.ka?this.ka.Vk:1},set:function(a){var b=this.interval;G&&E(a,ch,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.ka&&(this.ka=new Wn);this.ka.Vk=a;this.w();var c=this.panel;null!==c&&(c.graduatedIntervals=null); this.g("interval",b,a)}}},graduatedStart:{configurable:!0,get:function(){return null!==this.ka?this.ka.v:0},set:function(a){var b=this.graduatedStart;G&&E(a,ch,"graduatedStart");b!==a&&(0>a?a=0:1a?a=0:1=a&&Ba(a,"> 0",ch,"maxLines"),Zn(this),this.ia.vq=a,this.w(),this.g("maxLines",b,a))}},metrics:{configurable:!0,get:function(){return{arrSize:null!==this.Pc?this.Pc:[this.Db],arrText:null!==this.ac?this.ac:[this.Ae],maxLineWidth:this.Db,fontHeight:this.ef}}},choices:{configurable:!0,get:function(){return this.Bm},set:function(a){var b=this.Bm;b!==a&&(G&&null!==a&&!Array.isArray(a)&&Aa(a,"Array",ch,"choices:value"),this.Bm=a,this.g("choices",b,a))}}}); var co=null,eo=null,vo=new F(ch,"None",0),so=new F(ch,"WrapFit",1),Eo=new F(ch,"WrapDesiredSize",2),xo=new F(ch,"WrapBreakAll",3),Fo=new F(ch,"OverflowClip",0),po=new F(ch,"OverflowEllipsis",1),mo=new F(ch,"FormatTrim",0),zo=new F(ch,"FormatNone",0),yo=/[ \u200b\u00ad]/,Ao=new db,Bo=0,Co=new db,Do=0,ro="...",lo="",Yn=null,Xn=!1;ch.className="TextBlock"; function $n(){this.oc=!1;this.Fd=null;this.Zf=yg;this.Wp=mo;this.vq=Infinity;this.Lq=Fo;this.nr=this.mr=0;this.Ar="start";this.Dj=this.Cr=this.Br=null;this.Kr=kd;this.Nr=Eo}$n.prototype.copy=function(){var a=new $n;a.Fd=this.Fd;a.Zf=this.Zf;a.Wp=this.Wp;a.vq=this.vq;a.Lq=this.Lq;a.mr=this.mr;a.nr=this.nr;a.Ar=this.Ar;a.Br=this.Br;a.Cr=this.Cr;a.Dj=this.Dj;a.Kr=this.Kr;a.Nr=this.Nr;return a};ch.getEllipsis=function(){return ro};ch.setEllipsis=function(a){ro=a;Co=new db;Do=0};ch.getBaseline=function(){return co}; ch.setBaseline=function(a){co=a};ch.getUnderline=function(){return eo};ch.setUnderline=function(a){eo=a};ch.isValidFont=ao;ch.FormatNone=zo;ch.FormatTrim=mo;ch.None=vo;ch.OverflowClip=Fo;ch.OverflowEllipsis=po;ch.WrapBreakAll=xo;ch.WrapDesiredSize=Eo;ch.WrapFit=so;function Wn(){this.Vk=1;this.v=0;this.j=1;this.m=this.G=null}Wn.prototype.copy=function(){var a=new Wn;a.Vk=this.Vk;a.v=this.v;a.j=this.j;a.G=this.G;a.m=this.m;return a};Wn.className="GradElementSettings"; function kk(a,b){O.call(this);this.Hg=null;this.fo="";this.Yg=qc;this.Pk=Bd;this.$g=this.Fd=null;this.Ok=Kc;this.Zf=yg;this.xl=null;this.jn=!1;this.Gh=!0;this.cl=!1;this.tl=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var Go;na(kk,O);kk.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.fo=this.fo;a.element=this.Hg;a.Yg=this.Yg.M();a.Pk=this.Pk;a.Zf=this.Zf;a.Fd=this.Fd;a.$g=this.$g;a.Ok=this.Ok.M();a.Gh=this.Gh;a.tl=this.tl}; kk.prototype.ub=function(a){a===yg||a===Ag||a===ll?this.imageStretch=a:O.prototype.ub.call(this,a)};kk.prototype.toString=function(){return"Picture("+this.source+")#"+lb(this)};function Oi(a){void 0===a&&(a="");A(a,"string",kk,"clearCache:url");""!==a?Go[a]&&(delete Go[a],Ho--):(Go=new db,Ho=0)} function Io(a,b){b.oy||(b.sq=function(c){b.hq=!0;b.dn=!1;var d=b.Eg.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;var f=b.getAttribute("src")||"";var g=e.Qg.L(f);if(null!==g)for(var h=g.length,k=0;k=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 Bd:m=d.width;n=d.height;break;case Ag:case ll:p===Ag?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===ll&&(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,x=c.__goCache;p=null;var y=Jo;if(c.hq&&void 0!==x&&4y*y)for(null===x.ki&&(Ko(x,4,k,l,c),Ko(x,16,k,l,c)),k=x.ki,l=k.length,q=0;qa)a=5;a=Math.min(a,b/3);a=Math.min(a,c/3);var d="rr"+b+","+c+","+a,e=L.Pf[d];if(void 0!==e)return e;var f=a*L.zg;e=(new N).add((new je(a,0,!0)).add(new ke(Dd,b-a,0)).add(new ke(Xd,b,a,b-f,0,b,f)).add(new ke(Dd,b,c-a)).add(new ke(Xd,b-a,c,b,c-f,b-f,c)).add(new ke(Dd,a,c)).add(new ke(Xd,0,c-a,f,c,0,c-f)).add(new ke(Dd,0,a)).add((new ke(Xd,a,0,0,f,f,0)).close()));1e.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.I^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.pa();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Xb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Sb(),c.skipsUndoManager=d)}}}},isHighlighted:{configurable:!0,get:function(){return 0!==(this.I& 524288)},set:function(a){var b=0!==(this.I&524288);if(b!==a){G&&A(a,"boolean",S,"isHighlighted");this.I^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.pa(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.R();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{configurable:!0,get:function(){return 0!==(this.I&8192)},set:function(a){var b=0!==(this.I&8192);b!==a&&(G&&A(a,"boolean",S,"isShadowed"),this.I^=8192,this.g("isShadowed",b,a),this.R())}}, isAnimated:{configurable:!0,get:function(){return 0!==(this.I&262144)},set:function(a){var b=0!==(this.I&262144);b!==a&&(G&&A(a,"boolean",S,"isAnimated"),this.I^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return null!==this.S?this.S.cq:null},set:function(a){var b=this.highlightedChanged;b!==a&&(null!==a&&A(a,"function",S,"highlightedChanged"),Qo(this),this.S.cq=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{configurable:!0, enumerable:!0,get:function(){return null!==this.S?this.S.er:""},set:function(a){var b=this.selectionObjectName;b!==a&&(G&&A(a,"string",S,"selectionObjectName"),Qo(this),this.S.er=a,this.Vg=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.cr:null},set:function(a){var b=this.selectionAdornmentTemplate;b!==a&&(G&&w(a,Ce,S,"selectionAdornmentTemplate"),Qo(this),this.S.cr=a,this.g("selectionAdornmentTemplate", b,a))}},selectionObject:{configurable:!0,get:function(){if(null===this.Vg){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.lb(a),null!==a?this.Vg=a:this.Vg=this):this instanceof R?(a=this.path,null!==a?this.Vg=a:this.Vg=this):this.Vg=this}return this.Vg}},selectionChanged:{configurable:!0,get:function(){return null!==this.S?this.S.dr:null},set:function(a){var b=this.selectionChanged;b!==a&&(null!==a&&A(a,"function",S,"selectionChanged"),Qo(this),this.S.dr=a,this.g("selectionChanged", b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.Rq:null},set:function(a){var b=this.resizeAdornmentTemplate;b!==a&&(G&&w(a,Ce,S,"resizeAdornmentTemplate"),Qo(this),this.S.Rq=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.Tq:""},set:function(a){var b=this.resizeObjectName;b!==a&&(G&&A(a,"string",S,"resizeObjectName"),Qo(this),this.S.Tq=a,this.g("resizeObjectName", b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.lb(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return null!==this.S?this.S.Sq:Vb},set:function(a){var b=this.resizeCellSize;b.D(a)||(G&&w(a,Hb,S,"resizeCellSize"),a=a.M(),Qo(this),this.S.Sq=a,this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.Uq:null},set:function(a){var b= this.rotateAdornmentTemplate;b!==a&&(G&&w(a,Ce,S,"rotateAdornmentTemplate"),Qo(this),this.S.Uq=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.Vq:""},set:function(a){var b=this.rotateObjectName;b!==a&&(G&&A(a,"string",S,"rotateObjectName"),Qo(this),this.S.Vq=a,this.g("rotateObjectName",b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.lb(a),null!== a)?a:this}},rotationSpot:{configurable:!0,get:function(){return null!==this.S?this.S.Xq:hd},set:function(a){var b=this.rotationSpot;b.D(a)||(G&&(w(a,Ib,S,"rotationSpot"),a===hd||a.mb()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+a)),a=a.M(),Qo(this),this.S.Xq=a,this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.hc},set:function(a){var b=this.hc;b!==a&&(G&&A(a,"string",S,"text"),this.hc=a,this.g("text",b,a))}}, containingGroup:{configurable:!0,get:function(){return this.Ah},set:function(a){if(this.Zc()){var b=this.Ah;if(b!==a){G&&null!==a&&w(a,wf,S,"containingGroup");null===a||this!==a&&!a.Sd(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.F(2);var c=this.diagram;null!==b?dp(b,this):this instanceof wf&&null!==c&&c.fi.remove(this);this.Ah=a;null!==a?cp(a, this):this instanceof wf&&null!==c&&c.fi.add(this);this.F(1);if(null!==c&&c.ca){var d=this.data,e=c.model;if(null!==d&&e.wi()){var f=e.Ba(null!==a?a.data:null);e.bp(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.ca,c.ca=!0),d(this,b,a),null!==c&&(c.ca=e));if(this instanceof wf)for(c=new I,fl(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof T)for(d=d.linksConnected;d.next();)ip(d.value);if(this instanceof T){for(c=this.linksConnected;c.next();)ip(c.value);c=this.labeledLink; null!==c&&ip(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ui(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return null!==this.S?this.S.Bp:null},set:function(a){var b=this.containingGroupChanged;b!==a&&(null!==a&&A(a,"function",S,"containingGroupChanged"),Qo(this),this.S.Bp=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 null!==this.S?this.S.pq:127},set:function(a){var b=this.layoutConditions;b!==a&&(G&&A(a,"number",S,"layoutConditions"),Qo(this),this.S.pq=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return null!==this.S?this.S.Lp:null},set:function(a){var b=this.dragComputation;b!==a&&(null!==a&&A(a,"function",S,"dragComputation"), Qo(this),this.S.Lp=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0,get:function(){return null!==this.S?this.S.ir:Cb},set:function(a){var b=this.shadowOffset;b.D(a)||(G&&w(a,K,S,"shadowOffset"),a=a.M(),Qo(this),this.S.ir=a,this.R(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return null!==this.S?this.S.hr:"gray"},set:function(a){var b=this.shadowColor;b!==a&&(G&&A(a,"string",S,"shadowColor"),Qo(this),this.S.hr=a,this.R(),this.g("shadowColor", b,a))}},shadowBlur:{configurable:!0,get:function(){return null!==this.S?this.S.Wg:4},set:function(a){var b=this.shadowBlur;b!==a&&(G&&A(a,"number",S,"shadowBlur"),Qo(this),this.S.Wg=a,this.R(),this.g("shadowBlur",b,a))}}});S.prototype.invalidateLayout=S.prototype.F;S.prototype.findCommonContainingGroup=S.prototype.jx;S.prototype.isMemberOf=S.prototype.Sd;S.prototype.findTopLevelPart=S.prototype.uz;S.prototype.findSubGraphLevel=S.prototype.pz;S.prototype.ensureBounds=S.prototype.eb; S.prototype.getDocumentBounds=S.prototype.ti;S.prototype.findObject=S.prototype.lb;S.prototype.moveTo=S.prototype.moveTo;S.prototype.invalidateAdornments=S.prototype.Xb;S.prototype.clearAdornments=S.prototype.Mj;S.prototype.removeAdornment=S.prototype.Mf;S.prototype.addAdornment=S.prototype.eh;S.prototype.findAdornment=S.prototype.Uj;S.prototype.updateTargetBindings=S.prototype.Pa;var ap=!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 Ce(a,b){void 0===a||a instanceof Zl||"string"===typeof a?S.call(this,a):(S.call(this),a&&(b=a));this.I&=-257;this.Lg="Adornment";this.ve=null;this.sw=0;this.Mw=!1;this.j=this.Ya=null;b&&Object.assign(this,b)}na(Ce,S);Ce.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Ce.prototype.updateRelationshipsFromData=function(){}; Ce.prototype.ck=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof R&&b instanceof Qf){b=c.path;c.ck(a);a=b.geometry;c=this.U.s;b=c.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.Ve){b.Ve=!0;var c=new I;c.add(this);vp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Ii);b.Ve=!1}}; function vp(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.Ve){b.Ve=!0;var c=new I;c.add(this);xp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Ii);b.Ve=!1}}; function xp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Do():a.Qd();k.next();){var l=k.value;l.isTreeLink&&(h||l.Dd||l.gb(),l=l.Io(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Zb(!0),l.oh(),g&&e.Kj(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};oa.Object.defineProperties(wg.prototype,{padding:{configurable:!0,get:function(){return this.zb},set:function(a){"number"===typeof a?a=new gc(a):w(a,gc,wg,"padding");var b=this.zb;b.D(a)||(this.zb=a=a.M(),this.g("padding",b,a),this.w())}}});wg.className="Placeholder"; function R(a){S.call(this,V.Link);this.Ta=8;this.ff=null;this.gf="";this.vf=this.$m=null;this.wf="";this.ko=null;this.rk=mg;this.Jm=0;this.Lm=mg;this.Mm=NaN;this.xj=Cp;this.eo=.5;this.xd=null;this.Ob=(new H).freeze();this.sf=this.Sc=null;this.ol=new M;this.ya=new N;this.v=this.m=this.Uf=this.Yf=null;this.ku=new K;this.Tp=this.Ew=this.Dw=null;this.kt=NaN;this.ea=null;this.j=[];a&&Object.assign(this,a)}na(R,S); R.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.Ta=this.Ta&-113;a.gf=this.gf;a.$m=this.$m;a.wf=this.wf;a.ko=this.ko;a.rk=this.rk;a.Jm=this.Jm;a.Lm=this.Lm;a.Mm=this.Mm;a.xj=this.xj;a.eo=this.eo;null!==this.ea&&(a.ea=this.ea.copy())};t=R.prototype;t.Cf=function(a){S.prototype.Cf.call(this,a);this.gf=a.gf;this.wf=a.wf;a.Sc=null;a.gb();a.Uf=this.Uf;var b=a.fromPort;null!==b&&op(b);a=a.toPort;null!==a&&op(a)}; t.ub=function(a){a.classType===R?2===(a.value&2)?this.routing=a:a===pg||a===lg||a===kg?this.curve=a:a===Dp||a===Ep||a===Fp?this.adjusting=a:a!==Cp&&a!==mg&&v("Unknown Link enum value for a Link property: "+a):S.prototype.ub.call(this,a)};t.Xc=function(){null===this.ea&&(this.ea=new rl)};t.Ai=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Cj(a)||Dj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Cj(a)||Dj(a))?!1:!0};t.tv=function(){return!1}; t.As=function(){};t.Zc=function(){return!1};R.prototype.computeAngle=function(a,b,c){return R.computeAngle(b,c)};R.computeAngle=function(a,b){switch(a){default:case mg:a=0;break;case hn:a=b;break;case an:a=b+90;break;case cn:a=b-90;break;case Gp:a=b+180;break;case jn:a=L.Ro(b);90a&&(a-=180);break;case bn:a=L.Ro(b+90);90a&&(a-=180);break;case dn:a=L.Ro(b-90);90a&&(a-=180);break;case en:a=L.Ro(b);if(45a||225a)return 0;90a&&(a-=180)}return L.Ro(a)}; function ip(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.jx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Ah;if(c!==b){null!==c&&dp(c,a);a.Ah=b;null!==b&&cp(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.ca,g.ca=!0);e(a,c,b);null!==g&&(g.ca=f)}!a.Dd||a.Dw!==c&&a.Ew!==c||a.gb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=R.prototype; t.oh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&S.prototype.oh.call(this)};t.Io=function(a){G&&w(a,T,R,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.Dz=function(a){G&&w(a,O,R,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function sp(a,b){null===a.xd&&(a.xd=new I);a.xd.add(b);a.w()} t.Ko=function(a){S.prototype.Ko.call(this,a);Hp(this)&&this.Mo(this.actualBounds);if(!a){a=this.ff;var b=null;null!==a&&(b=this.fromPort,qp(a,this,b));var c=this.vf;if(null!==c){var d=this.toPort;c===a&&d===b||qp(c,this,d)}Ip(this)}};t.Lo=function(a){S.prototype.Lo.call(this,a);Hp(this)&&this.Mo(this.actualBounds);if(!a){a=this.ff;var b=null;null!==a&&(b=this.fromPort,rp(a,this,b));var c=this.vf;if(null!==c){var d=this.toPort;c===a&&d===b||rp(c,this,d)}Jp(this)}}; t.Sj=function(){this.Dd=!0;if(null!==this.xd){var a=this.diagram;if(null!==a)for(var b=this.xd.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=K.allocAt(c.x+d,c.y+e),S.prototype.move.call(this,a,!1),K.free(a));rf(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(Db),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()===pg))return this.ya.Qu(.5,a),a.add(this.i(0)),c=this.ya.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===pg){if(3===b){c=this.i(0);d=this.i(1);var e=this.i(2);L.Uw(c.x,c.y,d.x,d.y,d.x,d.y,e.x,e.y,a); return a}d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);e=this.i(c+1);var f=this.i(c+2);c=this.i(c+3);L.Uw(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).cb(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===pg))return this.ya.px(.5);if(this.computeCurve()===pg&&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 L.Ky(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.cb(d)};t=R.prototype;t.i=function(a){return this.Ob.s[a]}; t.bd=function(a,b){G&&(w(b,K,R,"setPoint"),b.u()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.ad(a,b)};t.P=function(a,b,c){G&&(E(b,R,"setPointAt:x"),E(c,R,"setPointAt:y"));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.ad(a,new K(b,c))}; t.Mz=function(a,b){G&&(w(b,K,R,"insertPoint"),b.u()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.Hb(a,b)};t.l=function(a,b,c){G&&(E(b,R,"insertPointAt:x"),E(c,R,"insertPointAt:y"));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.Hb(a,new K(b,c))}; t.ne=function(a){G&&(w(a,K,R,"addPoint"),a.u()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.add(a)};t.zf=function(a,b){G&&(E(a,R,"insertPointAt:x"),E(b,R,"insertPointAt:y"));G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.add(new K(a,b))}; t.lv=function(a){G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.sb(a)};t.Nj=function(){G&&null===this.Sc&&v("Call Link.startRoute before modifying the points of the route.");this.Ob.clear()}; function rf(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.offset(b,c),a.defaultToPoint&&a.defaultToPoint.offset(b,c);else{for(var d=a.Dd,e=new H,f=a.Ob.iterator;f.next();){var g=f.value;e.add((new K(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Ob;a.Ob=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.Eb?a.w():(a.je.h(a.je.x+b,a.je.y+c),a.va.h(a.va.x+b,a.va.y+c),Ol(a));d?Kp(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= a.i(a.pointsCount-1)));null!==g&&g.animationManager.Eb&&(b=g.animationManager,a.sf=e,b.ql.add(a));a.g("points",f,e)}}t.uh=function(){null===this.Sc&&(this.Sc=this.Ob,this.Ob=this.Ob.copy())}; t.Bf=function(){if(null!==this.Sc){for(var a=this.Sc,b=this.Ob,c=Infinity,d=Infinity,e=a.s,f=e.length,g=0;gl&&(n=-n),u= (0>k?-1:1)*n+r,x=m*(u-r)+q);r=f.x+2*h/3;q=f.y+2*k/3;var y=r,z=q;L.C(k,0)?z=0k?-1:1)*n+r,z=m*(y-r)+q);this.Nj();this.ne(f);this.zf(u,x);this.zf(y,z);this.ne(p);this.bd(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.bd(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,L.C(c,0)?h=0g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ne(d),this.zf(f,h),this.ne(e);else{this.ne(d);this.ne(e);h=M.alloc();b.ti(h);k=h.ga(e);p.ti(h);l=h.ga(d);if(k||l)g=b.oa(Pp(g),new K),this.bd(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.oa(Pp(c),new K),this.bd(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));M.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Nj();var B=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);r=u=q=0;if(m||!h||l)x=this.computeEndSegmentLength(a,b,g,!0),r= this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(r-=m?90:30,0>B&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(x+=Math.abs(B)*(m?1:2)),0===r?q=x:90===r?u=x:180===r?q=-x:270===r?u=-x:(q=x*Math.cos(r*Math.PI/180),u=x*Math.sin(r*Math.PI/180)),g.kc()&&l&&(x=b.oa(Kc,K.alloc()),y=K.allocAt(x.x+1E3*q,x.y+1E3*u),this.getLinkPointFromPoint(a,b,x,y,!0,n),K.free(x),K.free(y));x=this.getLinkPoint(d,e,c,!1,m,a,b);var C=z=y=0;if(m||!k||l){var D=this.computeEndSegmentLength(d,e, c,!1);C=this.getLinkDirection(d,e,x,c,!1,m,a,b);l&&(k||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(C+=m?0:30,0>B&&(C+=180));0>C?C+=360:360<=C&&(C-=360);l&&(D+=Math.abs(B)*(m?1:2));0===C?y=D:90===C?z=D:180===C?y=-D:270===C?z=-D:(y=D*Math.cos(C*Math.PI/180),z=D*Math.sin(C*Math.PI/180));c.kc()&&l&&(c=e.oa(Kc,K.alloc()),g=K.allocAt(c.x+1E3*y,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,x),K.free(c),K.free(g))}c=n;if(m||!h||l)c=new K(n.x+q,n.y+u);g=x;if(m||!k||l)g=new K(x.x+y,x.y+z);!p&&!m&&h&&3Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} R.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new K);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.se()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.oe;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.Xj(e,d,g,c,f);null!== a&&f.transform(a);return f};function Rp(a,b){var c=b.Tn;null===c&&(c=new Sp,c.port=b,c.node=b.part,b.Tn=c);return Tp(c,a)} R.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new K);if(c.mb()&&!Op(c))return b.oa(c,h),h;if(c.$c()){var k=Rp(this,b);if(null!==k){h.assign(k.Po);if(e&&this.routing===Up){var l=Rp(this,g);if(null!==l&&k.Hl=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Jf(Qc)||c.Jf(Tc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);K.free(k);K.free(l)}}return h}}c= b.oa(Pp(c),K.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=Qp(c,g.copy()))):(k=this.computeSpot(!d,g),f=K.alloc(),g=g.oa(Pp(k),f),e&&(g=Qp(c,g)),K.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);K.free(c);return h}; R.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.mb())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?Qp(k,h.copy()):c):(c=K.alloc(),h=h.oa(Kc,c),K.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;K.free(k);k=c}d.kc()&&g.Sd(a)&&(k+=180,360<=k&&(k-=360));if(Op(d))return k;a=b.si();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.$c()&&(a=Rp(this,b),null!==a))return a.Iu;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=Kc:(b=this.fromSpot,b.Rb()&&(b=a.fromSpot),a=b===hd?Ec:b)):(a=b?b:this.toPort,null===a?a=Kc:(b=this.toSpot,b.Rb()&&(b=a.toSpot),a=b===hd?Ec:b));return a};function Op(a){return a===Ec||.5===a.x&&.5===a.y}function Pp(a){return.5===a.x&&.5===a.y?a:Kc} R.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==mg&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Jb.alloc();n.set(g); if(m instanceof V)h=m.Ff(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Qf)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.hh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Re(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var x=K.alloc(),y=K.alloc(),z=K.alloc(),B=Jb.alloc();B.set(q);B.bv(m.transform);B.gs();y.x=p;y.y=u;y.transform(B);x.x=h;x.y=u;x.transform(B);q=!1;Sn(m,x,y,z)?q=!0:(x.x=p,x.y=r,x.transform(B),Sn(m,x,y,z)?q=!0:(y.x= h,y.y=r,y.transform(B),Sn(m,x,y,z)?q=!0:(x.x=h,x.y=u,x.transform(B),Sn(m,x,y,z)&&(q=!0))));Jb.free(B);K.free(x);K.free(y);K.free(z);h=q}}else h=m.hh(h,n)}else h=vl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Jb.free(n)}}}void 0===f&&Jb.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Jb.free(g);return!1}; R.prototype.computeCurve=function(){if(null===this.Yf){var a=this.fromPort,b=this.isOrthogonal;this.Yf=null!==a&&a===this.toPort&&!b}return this.Yf?pg:this.curve};R.prototype.computeCorner=function(){if(this.curve===pg)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.U.s,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);L.ha(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.bd(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.P(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.bd(c,d)}}return!0;case Fp:f=this.i(a);n=this.i(c);if(!f.fb(b)||!n.fb(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.bd(a,b);for(a+=1;ab?b+=360:360<=b&&(b-=360);0>d?d+=360:360<=d&&(d-=360);var g=d;b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=315<=d||45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.actualBounds.copy(),k=f.actualBounds.copy();if(h.u()&&k.u()){h.Bc(Xp,Xp);k.Bc(Xp,Xp);h.Ze(a);k.Ze(c);var l=K.alloc(),m=K.alloc();if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.ga(a)||h.ga(c))? l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l.h(Math.max((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,a.y,k.right,c.y,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.left,m.x=l.x, m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.bottom)0===d&&(k.ga(a)||h.ga(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x= c.x,m.y=l.y;if(l.y>h.top&&l.y=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l.h(Math.min((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&k.bottom>a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x, c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.xa.x?(l.y=a.yk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.yk.left&&a.xh.right)270===d&&(k.ga(a)||h.ga(c))?l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l.h(a.x,Math.max((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.ga(a)||h.ga(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l.h(a.x,Math.min((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x=$p&&(vk(r),h.Bc(r.xo*r.Ex,r.wo*r.Fx),Yp(r,a,b,n,d,h,!1),k=Zp(r, n.x,n.y));if(!r.abort&&k<$p&&Zp(r,n.x,n.y)!==xk){aq(this,r,n.x,n.y,d,!0,g);h=this.i(2);if(4>this.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.P(2,h.x,h.y),this.l(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)L.C(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.P(2,h,a.y),this.P(3,h,g.y)):L.C(h.y,g.y)?(Math.abs(a.y-h.y)<=r.wo/2&&(this.P(2,h.x,a.y),this.P(3,g.x,a.y)),this.l(2,h.x,a.y)):this.P(2,a.x,h.y);else if(90===b||270===b)L.C(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): Math.min(h.y,a.y),this.P(2,a.x,h),this.P(3,g.x,h)):L.C(h.x,g.x)?(Math.abs(a.x-h.x)<=r.xo/2&&(this.P(2,a.x,h.y),this.P(3,a.x,g.y)),this.l(2,a.x,h.y)):this.P(2,h.x,a.y);null!==c&&(a=this.i(1),g=this.i(2),a.x!==g.x&&a.y!==g.y?0===b||180===b?this.l(2,a.x,g.y):this.l(2,g.x,a.y):0===b||180===b?this.l(2,e.x,c.y):this.l(2,c.x,e.y));null!==q&&(0===d||180===d?this.zf(f.x,q.y):this.zf(q.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ne(l.copy()),this.ne(m.copy()));K.free(l);K.free(m)}}; R.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; function Zj(a){if(null===a.diagram||!a.isAvoiding||!qk(a.diagram))return!1;var b=a.points.s,c=b.length;if(4>c)return!1;a=rk(a.diagram,!0,a.containingGroup,null);for(var d=1;dbq&&Zp(b,m,n)!==l-1&&(Zp(b,c-h,d)===l-1?(e=180,m=c-h,n=d):Zp(b,c+h,d)===l-1?(e=0,m=c+h,n=d):Zp(b,c,d-k)===l-1?(e=270,m=c,n=d-k):Zp(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>bq&&Zp(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,--l;if(f){if(l>bq)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/ k)*k+k/2;l>bq&&(f=e,g=c,m=d,0===e?(f=90,m+=k):90===e?(f=180,g-=h):180===e?(f=270,m-=k):270===e&&(f=0,g+=h),Zp(b,g,m)===l-1?aq(a,b,g,m,f,!1,f):(g=c,m=d,0===e?(f=270,m-=k):90===e?(f=0,g+=h):180===e?(f=90,m+=k):270===e&&(f=180,g-=h),Zp(b,g,m)===l-1&&aq(a,b,g,m,f,!1,f)));a.zf(c,d)} R.prototype.fz=function(a){G&&w(a,K,R,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Lb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gb)return a.type=N.j,this.mm=!0,a;var c=!1,d=this.diagram;null!==d&&Hp(this)&&d.Eh.contains(this)&&(0!==this.ol.width||0!==this.ol.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.Ob.s;var g=this.computeCurve();if(g===pg&&3<=b&&!L.ha(this.smoothness,0))if(3===b){var h=this.i(1);d=Math.min(e.x,h.x);var k=Math.min(e.y,h.y);h=this.i(2);d=Math.min(d,h.x);k=Math.min(k,h.y)}else{if(this.isOrthogonal)for(k=0;k=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;kx?q>r?(f.x= y-B,f.y=r-B,e.x=y+u,e.y=r+u):(f.x=y-B,f.y=r+B,e.x=y+u,e.y=r-u):q>r?(f.x=y+B,f.y=r-B,e.x=y-u,e.y=r+u):(f.x=y+B,f.y=r+B,e.x=y-u,e.y=r-u));L.ha(x,y)&&L.ha(r,q)&&(r>p?(z>y?(f.x=y-B,f.y=r-B,e.x=y+u):(f.x=y+B,f.y=r-B,e.x=y-u),e.y=r+u):(z>y?(f.x=y-B,f.y=r+B,e.x=y+u):(f.x=y+B,f.y=r+B,e.x=y-u),e.y=r-u));if(L.ha(x,y)&&L.ha(y,z)||L.ha(p,r)&&L.ha(r,q))x=.5*(x+z),p=.5*(p+q),f.x=x,f.y=p,e.x=x,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&L.ha(g.x,this.i(0).x)&&L.ha(g.y,this.i(0).y)&&(c.x=.5*(g.x+l.x), c.y=.5*(g.y+l.y));Ld(h,c.x-d,c.y-k,f.x-d,f.y-k,l.x-d,l.y-k);b.set(f);c.set(e);g=l}}l=g.x;g=g.y;m=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(m=cq(this,m.copy(),!1,zb));l=.5*(l+m.x);g=.5*(g+m.y);Ld(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);K.free(b);K.free(c);K.free(f);K.free(e)}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=cq(this,g.copy(),!1,zb)),Ld(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=K.alloc();f.assign(this.i(0)); e=K.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.D(m))0!==this.computeShortLength(!1)&&(m=cq(this,m.copy(),!1,zb)),fq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?C=p.x-q:C=p.x+q;y.y>p.y?z=p.y+B:z=p.y-B;y=K.allocAt(C,D);fq(this,h,n,x,f,y,u);K.free(y);Md(h,p.x+n,p.y+x,r+n,z+x);f.h(r,z)}else L.C(f.x,p.x)&&L.C(p.y,y.y)?(q=Math.min(g,Math.abs(p.y-e.y)/2),q=B=Math.min(q,Math.abs(y.x-p.x)/2),L.C(B,0)?(fq(this,h,n,x,f,p,u),f.assign(p)):(C=p.x,D=p.y,r=C,z=D,p.y>f.y?D=p.y-q:D=p.y+q,y.x>p.x?r=p.x+B:r=p.x-B,y=K.allocAt(C,D),fq(this,h,n,x,f,y,u),K.free(y),Md(h,p.x+n,p.y+x,r+n,z+x),f.h(r,z))):(fq(this,h,n,x,f,p,u),f.assign(p));e.assign(m);n=l}K.free(f)}Pd= h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=cq(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=cq(this,h,!1,f)),a.type=N.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.mm=!0;return a};function eq(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 L.ha(a,0)?b:L.ha(b,0)?a:Math.sqrt(a*a+b*b)} function cq(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=eq(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=eq(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 dq(a,b,c,d){for(var e=a.pointsCount,f=b;L.ha(b.x,f.x)&&L.ha(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!L.ha(b.x,f.x)&&!L.ha(b.y,f.y))return c-1;for(var g=f;L.ha(b.x,f.x)&&L.ha(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||L.ha(b.y,f.y)&&L.ha(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}R.prototype.computeJumpLength=function(){return 10}; function fq(a,b,c,d,e,f,g){if(!g&&Hp(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=gq(a,e,f,k));if(0n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;r=f.y+d;a.curve===lg?Kd(b,n,r,!1):Ld(b,p,m,n,m,n,r)}else if(L.C(e.x,f.x))if(e.ym-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;r=f.x+c;m+=d;a.curve===lg?Kd(b,r,m,!1):Ld(b,n,p,n,m,r,m)}}b.lineTo(f.x+c,f.y+d)} function gq(a,b,c,d){var e=a.diagram;if(null===e||b.D(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ra.s;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yq&&Math.min(g,x)n&&!L.C(g,x)){h.x=q;h.y=n;m=!0;break a}}else if(!L.C(n,r)&& L.C(g,x)&&Math.min(n,r)g&&Math.min(q,u)m&&!L.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}K.free(h)}function Hp(a){a=a.curve;return a===kg||a===lg}function Lp(a,b){if(b||Hp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Eh.contains(a)||0===a.ol.width&&0===a.ol.height||b.Eh.add(a,a.ol.copy())} R.prototype.Mo=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.Ra.s;for(var g=e.length,h=0;ha&&Ba(a,">= 0",R,"fromEndSegmentLength"),this.Xc(),this.ea.aj=a,this.g("fromEndSegmentLength",b,a),this.gb())}},fromShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.bj:NaN},set:function(a){var b=this.fromShortLength;b!==a&&(G&&A(a,"number",R,"fromShortLength"), this.Xc(),this.ea.bj=a,this.sc(!0),this.g("fromShortLength",b,a))}},toSpot:{configurable:!0,get:function(){return null!==this.ea?this.ea.Gj:hd},set:function(a){var b=this.toSpot;b.D(a)||(G&&w(a,Ib,R,"toSpot"),a=a.M(),this.Xc(),this.ea.Gj=a,this.g("toSpot",b,a),(b.$c()||a.$c())&&null!==this.toNode&&op(this.toPort),this.gb())}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Ej:NaN},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&& A(a,"number",R,"toEndSegmentLength"),0>a&&Ba(a,">= 0",R,"toEndSegmentLength"),this.Xc(),this.ea.Ej=a,this.g("toEndSegmentLength",b,a),this.gb())}},toShortLength:{configurable:!0,get:function(){return null!==this.ea?this.ea.Fj:NaN},set:function(a){var b=this.toShortLength;b!==a&&(G&&A(a,"number",R,"toShortLength"),this.Xc(),this.ea.Fj=a,this.sc(!0),this.g("toShortLength",b,a))}},isLabeledLink:{configurable:!0,get:function(){return null===this.xd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);L.Dl(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.Ze(f),e=2;ed&&(d=-d)):L.ha(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Df(e)); a.push(d)}}return this.Tp}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.kt;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;d=this.pointsCount?0:this.isOrthogonal||!Op(this.computeSpot(!0))?1:0}}, lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!Op(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0,get:function(){return this.rk},set:function(a){var b=this.rk;b!==a&&(G&&a!==mg&&a!==Dp&&a!==Ep&&a!==Fp&&v("Link.adjusting can only be set to Link.None, Link.End, LInk.Scale, or Link.Stretch, not: "+a),this.rk=a,this.g("adjusting",b,a))}},corner:{configurable:!0,get:function(){return this.Jm}, set:function(a){var b=this.Jm;b!==a&&(G&&A(a,"number",R,"corner"),this.Jm=a,this.sc(!0),this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.Lm},set:function(a){var b=this.Lm;b!==a&&(G&&a!==mg&&a!==pg&&a!==lg&&a!==kg&&v("Link.curve can only be set to Link.None, Link.Bezier, LInk.JumpGap, or Link.JumpOver, not: "+a),this.Lm=a,this.gb(),this.sc(!0),Lp(this,b===lg||b===kg||a===lg||a===kg),this.g("curve",b,a))}},curviness:{configurable:!0,get:function(){return this.Mm}, set:function(a){var b=this.Mm;b!==a&&(G&&A(a,"number",R,"curviness"),this.Mm=a,this.gb(),this.sc(!1),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.xj},set:function(a){var b=this.xj;b!==a&&(G&&a!==Cp&&a!==kq&&a!==lq&&a!==Up&&v("Link.routing can only be set to Link.Normal, Link.Orthogonal, LInk.AvoidsNodes, not: "+a),this.xj=a,this.Yf=null,this.gb(),Lp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{configurable:!0, get:function(){return this.eo},set:function(a){var b=this.eo;b!==a&&(G&&A(a,"number",R,"smoothness"),this.eo=a,this.sc(!0),this.g("smoothness",b,a))}},key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.yi())return a.model.Ac(this.data)}}});R.prototype.invalidateOtherJumpOvers=R.prototype.Mo;R.prototype.findClosestSegment=R.prototype.fz;R.prototype.updateRoute=R.prototype.yg;R.prototype.invalidateRoute=R.prototype.gb;R.prototype.rollbackRoute=R.prototype.nv; R.prototype.commitRoute=R.prototype.Bf;R.prototype.startRoute=R.prototype.uh;R.prototype.clearPoints=R.prototype.Nj;R.prototype.removePoint=R.prototype.lv;R.prototype.addPointAt=R.prototype.zf;R.prototype.addPoint=R.prototype.ne;R.prototype.insertPointAt=R.prototype.l;R.prototype.insertPoint=R.prototype.Mz;R.prototype.setPointAt=R.prototype.P;R.prototype.setPoint=R.prototype.bd;R.prototype.getPoint=R.prototype.i;R.prototype.getOtherPort=R.prototype.Dz;R.prototype.getOtherNode=R.prototype.Io; var Mp=null,Np=null,Cp=new F(R,"Normal",1),kq=new F(R,"Orthogonal",2),lq=new F(R,"AvoidsNodes",6),Up=new F(R,"AvoidsNodesStraight",7),mg=new F(R,"None",0),pg=new F(R,"Bezier",9),lg=new F(R,"JumpGap",10),kg=new F(R,"JumpOver",11),Dp=new F(R,"End",17),Ep=new F(R,"Scale",18),Fp=new F(R,"Stretch",19),hn=new F(R,"OrientAlong",21),an=new F(R,"OrientPlus90",22),cn=new F(R,"OrientMinus90",23),Gp=new F(R,"OrientOpposite",24),jn=new F(R,"OrientUpright",25),bn=new F(R,"OrientPlus90Upright",26),dn=new F(R,"OrientMinus90Upright", 27),en=new F(R,"OrientUpright45",28),Wp=16,Vp=14,Xp=8;R.className="Link";R.Normal=Cp;R.Orthogonal=kq;R.AvoidsNodes=lq;R.AvoidsNodesStraight=Up;R.None=mg;R.Bezier=pg;R.JumpGap=lg;R.JumpOver=kg;R.End=Dp;R.Scale=Ep;R.Stretch=Fp;R.OrientAlong=hn;R.OrientPlus90=an;R.OrientMinus90=cn;R.OrientOpposite=Gp;R.OrientUpright=jn;R.OrientPlus90Upright=bn;R.OrientMinus90Upright=dn;R.OrientUpright45=en;R.EndSegmentStep=8;R.CurvinessStart=Wp;R.SpacingMin=Vp;R.OrthoShortCut=Xp; function jq(a,b,c,d){Za(this);this.Ee=this.fq=!1;this.qs=a;this.Mx=b;this.cv=c;this.Nx=d;this.links=[]}jq.prototype.Ol=function(){if(!this.fq){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.Kd=Math.floor((a.x-this.tc)/this.tc)*this.tc;this.Ld=Math.floor((b-this.uc)/this.uc)*this.uc;this.xn=Math.ceil((c+2*this.tc)/this.tc)*this.tc;this.yn=Math.ceil((d+2*this.uc)/this.uc)*this.uc;a=1+(Math.ceil((this.xn-this.Kd)/this.tc)|0);b=1+(Math.ceil((this.yn-this.Ld)/this.uc)|0);if(null===this.bc||this.hi=bq&&(c[d]=mq)} sk.prototype.ak=function(a,b,c,d){if(a>this.xn||a+cthis.yn||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.hi)|0;for(c=Math.min(b+e-1,this.ii)|0;a<=d;a++){e=this.bc[a];for(var f=b;f<=c;f++)if(e[f]===xk)return!1}return!0}; function nq(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.bc[l][m];if(n>=bq&&n<$p)for(e?m+=d:l+=d,n+=1;f<=l&&l<=g&&h<=m&&m<=k&&!(n>=a.bc[l][m]);)a.bc[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)nq(a,b,c,1,!e,f,g,h,k),nq(a,b,c,-1,!e,f,g,h, k)}}function oq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=xk,m=bq;for(a.bc[b][c]=m;l===xk&&b>f&&bh&&cf&&bh&&c=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;d=f.y;b=f.x+f.width;var p=f.y+f.height;n-=a.Kd;n/=a.tc;d-=a.Ld;d/=a.uc;b-=a.Kd;b/=a.tc;p-=a.Ld;p/=a.uc;f=Math.max(0,Math.min(a.hi,n|0));b=Math.min(a.hi,Math.max(0,b|0));n=Math.max(0,Math.min(a.ii,d|0));p=Math.min(a.ii,Math.max(0,p|0));d=a.bc;h|=0;k|=0;l|=0;m|= 0;var r=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===xk?(oq(a,h,k,r,c,f,b,n,p),oq(a,h,k,1,!c,f,b,n,p),oq(a,h,k,-1,!c,f,b,n,p)):oq(a,h,k,r,c,h,k,h,k);d[l][m]===xk?(pq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),pq(a,l,m,1,!(90===e||270===e),f,b,n,p),pq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):pq(a,l,m,r,c,l,m,l,m);c=Na();if(g&&qq(a,l,m,e,h,k,c)){if(c[0]!==l||c[1]!==m)c.unshift(m),c.unshift(l);if(c[c.length-2]!==h||c[c.length-1]!==k)c.push(h),c.push(k);a=bq;e=c[c.length-2];g=c[c.length-1];d[e][g]= a++;for(f=c.length-4;0<=f;f-=2)for(e=c[f+2],g=c[f+3],b=c[f],l=c[f+1];b>e?e++:bg?g++:le)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===rq)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?pf&&(m=270,p--):90===d?ne&&(m=180,n--):180===d?pf&&(m=270,p--):ne&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==rq){g.push(k);g.push(l);if(qq(a,k,l, m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=rq;if(0===d){if(k===b)return!1;k--}else if(90===d){if(l===c)return!1;l--}else if(180===d){if(k===b)return!1;k++}else{if(l===c)return!1;l++}}} oa.Object.defineProperties(sk.prototype,{bounds:{configurable:!0,get:function(){return new M(this.Kd,this.Ld,this.xn-this.Kd,this.yn-this.Ld)}},xo:{configurable:!0,get:function(){return this.tc},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}Sp.prototype.Ol=function(){this.pe.length=0}; function Tp(a,b){var c=a.pe;if(0===c.length){a:if(!a.Qo){c=a.Qo;a.Qo=!0;var d=null,e=a.node,f=e instanceof wf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.kx();else{if(!f.actualBounds.u()){a.Qo=c;break a}d=f;g=d.Ku()}f=a.pe.length=0;var h=a.port.oa(Fc,K.alloc()),k=a.port.oa(Oc,K.alloc());e=M.allocAt(h.x,h.y,0,0);e.Ze(k);K.free(h);K.free(k);h=K.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.si();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.Sd(d),n=l.computeSpot(m,a.port);if(n.$c()&&(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.cb(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=sq(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));r=a.pe[f];void 0===r?(r=new tq(l,p,n),a.pe[f]=r):(r.link=l,r.angle=p,r.Mc= n);r.ev.set(m);f++}}}}K.free(h);a.pe.sort(Sp.prototype.j);k=a.pe.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 J=C.Po;if(d===zp){C=C.link.computeThickness();C*=z;J.set(D);switch(q){case 8:J.x=D.x+u/2+p/2-y-C/2;break;case 2:J.y=D.y+B/2+r/2-y-C/2;break;case 1:J.x=D.x+u/2-n/2+y+C/2;break;default:case 4:J.y=D.y+B/2-m/2+y+C/2}y+=C}else{var U=.5;d===kp&&(U=(C.Jo+1)/(C.Hl+1));J.x=D.x+u*U;J.y=D.y+B*U}}}K.free(h);K.free(k);K.free(g);K.free(l);D=a.pe;for(f=0;fb.Mc?1:a.angleb.angle?1:0}; Sp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,Ec,b.fromPort===this.port),d=a.Jo;if(0>d)return c;var e=a.Hl;if(1>=e||!b.isOrthogonal)return c;b=a.ev;var f=a.Po;if(2===a.Mc||8===a.Mc)d=e-1-d;return((a=2===a.Mc||4===a.Mc)?b.y=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; Di.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var b=this.arrangementOrigin.x,c=b,d=this.arrangementOrigin.y,e=0,f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value.node;if(!(null===h||h instanceof R)&&(wq(h),this.rh(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof wf&&(h.rh=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e= 0,c=b,d+=f+20,f=0):e++}}};Di.prototype.rh=function(a){return!a.location.u()||a instanceof wf&&a.rh?!0:!1};function vq(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 wf?null===k.layout?vq(a,b,k.memberParts,!1,e,f,g,h):(wq(k),b.add(k)):(wq(k),b.add(k))):g&&k instanceof R?b.add(k):!h||!k.Zc()||k instanceof T||(wq(k),b.add(k)))}} function wq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.eb()}Di.prototype.ui=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new M),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; Di.prototype.Ww=function(a){var b=new I;a instanceof P?(vq(this,b,a.nodes,!0,null,!0,!0,!0),vq(this,b,a.links,!0,null,!0,!0,!0),vq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof wf?vq(this,b,a.memberParts,!1,null,!0,!0,!0):vq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Di.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.oa(Fc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a};Di.prototype.mayUseWorker=function(){return this.mayUseWorkerFunction?this.mayUseWorkerFunction(this):!1};Di.prototype.workerLayout=function(){return!1}; function xq(a,b){if(null!==a.workerStateChanged){var c={key:a.group?a.group.key:null};void 0!==b&&(c.time=b);null!==a.yj&&(c.running=yq(a.yj));null!==a.pg&&(c.waiting=yq(a.pg));a.workerStateChanged(c,a)}}function yq(a){return{vertexes:a.vertexes.count,edges:a.edges.count}}Di.prototype.Ly=function(){var a=zq(this.constructor);a&&(null!==a.$e&&a.$e.terminate(),a.$e=null,a.Ql.iteratorValues.each(function(a){a.Mr=!1;a.yj=null;a.pg=null;a.wr=!1;xq(a)}),a.Ql.clear())}; function Aq(a,b){var c=zq(a);if(c){if(b)for(var d in b)c[d]=b[d]}else throw Error("Unknown Layout class: "+a);}function zq(a){var b=null;if("function"===typeof a){if(b=Bq.get(a),!b){var c=Qa(a);b=Bq.get(c);b||(b=new Cq,b.Cu=a,b.name=c,b.j=a.name,b.xx=Dq,Bq.set(c,b),Bq.set(a,b),Bq.set(a.name,b))}}else"string"===typeof a&&(b=Bq.get(a));return b} Di.prototype.Ev=function(){if("undefined"===typeof Worker||!Eq||"undefined"===typeof self||"undefined"!==typeof self.DedicatedWorkerGlobalScope)return!1;if(!this.mayUseWorker())return this.Mr&&(this.wr=!0,this.pg=this.yj=null,xq(this)),!1;var a=zq(this.constructor);if(null===a)return!1;null===a.$e&&(a.$e=new Worker(Eq),a.$e.onerror=function(a){a.preventDefault();Fa("Worker Error at: "+a.filename+" "+a.lineno+" "+a.colno+"\n "+a.message)},a.$e.j=function(a){Fa("Worker serialization error: "+a)},a.$e.onmessage= function(b){var c=b.data;if("_GoJS"===c._GoJS)if(c.version&&P.version&&c.version!==P.version)Fa("Failure: GoJS v"+P.version+" Worker v"+c.version);else if(b=a.Ql.get(c.id)){a.Ql.remove(c.id);b.Mr=!1;b.yj=null;if(b.wr)b.wr=!1,b.pg=null;else{var d=Fq(b,c,!1);b.network=d;b.updateParts();b.network=null;b.isValidLayout=!0}xq(b,c.time);c=b.pg;if(null!==c)b.pg=null;else for(d=a.Ql.iteratorValues;d.next();){var e=d.value;c=e.pg;if(null!==c){e.pg=null;break}}null!==c&&Gq(b,c)}},a.$e.postMessage({_GoJS:"_GoJS", url:a.xx}),Array.isArray(a.scripts)&&a.scripts.forEach(function(b){a.$e.postMessage({_GoJS:"_GoJS",url:b})}),a.$e.postMessage({_GoJS:"_GoJS",version:-1}));null!==this.yj?this.pg=this.network:Gq(this,this.network);xq(this);this.doMinimalNetworkLayout();this.network=null;return this.isValidLayout=!0};function Gq(a,b){a.Mr=!0;var c=zq(a.constructor),d=Hq(a,b,!0);d._GoJS="_GoJS";c.$e.postMessage(d);c.Ql.set(lb(a),a);a.yj=b} function Hq(a,b,c){a.onNetworkSerialization(1,c,b,null);var d={};a.serializeLayoutProperties(d,c);var e=[];b.vertexes.each(function(a){var b={};a.serializeVertexProperties(b,c);e.push(b)});var f=[];b.edges.each(function(a){var b={};a.serializeEdgeProperties(b,c);f.push(b)});d={id:c?lb(a):a.id,layout:Qa(a.constructor),p:d,AA:e,dz:f};a.onNetworkSerialization(2,c,b,d);return d} function Fq(a,b,c){c&&(a.id=b.id);var d=a.diagram,e=a.createNetwork();a.onNetworkSerialization(3,c,e,b);var f=b.AA,g=new yb;f&&f.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.Qb(a.key));null!==b?b=e.Lj(b):(b=e.createVertex(),e.rg(b));c&&null!==a.key&&(b.data={Kh:a.key});g.set(a.id,b)});var h=b.dz,k=new yb;h&&h.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.findLinkForKey(a.key));var f=e.createEdge();e.Bl(f);f.link=b;c&&null!==a.key&&(f.data={Kh:a.key});k.set(a.id, f)});f&&f.forEach(function(a){var b=g.get(a.id);b&&b.deserializeVertexProperties(a,g,k,c)});h&&h.forEach(function(a){var b=k.get(a.id);b&&b.deserializeEdgeProperties(a,g,k,c)});a.deserializeLayoutProperties(b.p,g,k,c,e);a.onNetworkSerialization(4,c,e,b);return e}Di.prototype.onNetworkSerialization=function(){}; oa.Object.defineProperties(Di.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){null!==a&&w(a,P,Di,"diagram");this.H=a}},group:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(null!==a&&w(a,wf,Di,"group"),this.m=a,null!==a&&(this.H=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.ln},set:function(a){this.ln!==a&&(A(a,"boolean",Di,"isOngoing"),this.ln=a)}},isInitial:{configurable:!0, enumerable:!0,get:function(){return this.Ih},set:function(a){A(a,"boolean",Di,"isInitial");this.Ih=a;a||(this.qn=!0)}},isViewportSized:{configurable:!0,get:function(){return this.rn},set:function(a){this.rn!==a&&(A(a,"boolean",Di,"isViewportSized"),(this.rn=a)&&this.F())}},isRouting:{configurable:!0,get:function(){return this.on},set:function(a){this.on!==a&&(A(a,"boolean",Di,"isRouting"),this.on=a)}},isRealtime:{configurable:!0,get:function(){return this.nn}, set:function(a){this.nn!==a&&(null!==a&&A(a,"boolean",Di,"isRealtime"),this.nn=a)}},isValidLayout:{configurable:!0,get:function(){return this.qn},set:function(a){this.qn!==a&&(A(a,"boolean",Di,"isValidLayout"),this.qn=a,a||(a=this.diagram,null!==a&&(a.xh=!0)))}},network:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(null!==a&&w(a,uq,Di,"network"),this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{configurable:!0,get:function(){return this.zm}, set:function(a){this.zm!==a&&(null!==a&&A(a,"function",Di,"boundsComputation"),this.zm=a,this.F())}},arrangementOrigin:{configurable:!0,get:function(){return this.vm},set:function(a){w(a,K,Di,"arrangementOrigin");this.vm.D(a)||(this.vm.assign(a),this.F())}},id:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a}},mayUseWorkerFunction:{configurable:!0,get:function(){return this.zn},set:function(a){this.zn!==a&&(null!==a&&A(a,"function", Di,"mayUseWorkerFunction"),this.zn=a)}},workerStateChanged:{configurable:!0,get:function(){return this.oo},set:function(a){this.oo!==a&&(null!==a&&A(a,"function",Di,"workerStateChanged"),this.oo=a)}}});Di.prototype.useWorker=Di.prototype.Ev;Di.declareWorkerLayout=Aq;Di.prototype.cancelWorker=Di.prototype.Ly;Di.prototype.collectParts=Di.prototype.Ww;Di.prototype.getLayoutBounds=Di.prototype.ui;Di.prototype.invalidateLayout=Di.prototype.F; var Bq=new yb,Dq="object"===typeof sa.document&&sa.document.currentScript?sa.document.currentScript.src:"",Eq="undefined"!==typeof URL&&"function"===typeof URL.createObjectURL&&"function"===typeof Blob?URL.createObjectURL(new Blob(["self.onmessage=function(e){if(e.data.url){\nimportScripts(e.data.url);}}"],{type:"text/javascript"})):"";Di.className="Layout";Di.GoJSScriptURL=Dq;Di.declareWorkerLayout=Aq; "undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&(self.onmessage=function(a){a=a.data;if("_GoJS"===a._GoJS)if(a.url)importScripts(a.url);else if(a.version)self.postMessage({_GoJS:"_GoJS",version:P.version},void 0);else{var b=performance.now(),c=null;a.layout&&(c=zq(a.layout));var d=null;c&&c.Cu&&(d=new c.Cu);if(!d)throw Error("no registered Worker Layout: "+a.layout);d.network=Fq(d,a,!0); d.workerLayout=function(){var a=Hq(d,d.network,!1);a._GoJS="_GoJS";a.time=performance.now()-b;self.postMessage(a,void 0);return!0};d.doLayout(new H)}});function Cq(){this.Cu=null;this.xx=this.j=this.name="";this.scripts=[];this.$e=null;this.Ql=new yb}function uq(a){Za(this);G&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.Qc=a;this.xf=new I;this.ze=new I;this.rs=new yb;this.ms=new yb} uq.prototype.clear=function(){if(this.xf)for(var a=this.xf.iterator;a.next();)a.value.clear();if(this.ze)for(a=this.ze.iterator;a.next();)a.value.clear();this.xf=new I;this.ze=new I;this.rs=new yb;this.ms=new yb}; uq.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.xf.count+" edges: "+this.ze.count;if(1b?1:0):1:null!==b?-1:0} oa.Object.defineProperties(Iq.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.Cd._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.Pd._dataArray}},data:{configurable:!0,get:function(){return this.vb},set:function(a){this.vb=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.m.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{configurable:!0,get:function(){return this.Xh}, set:function(a){if(this.Xh!==a){G&&null!==a&&w(a,T,Iq,"node");this.Xh=a;a.eb();var b=this.network.layout,c=M.alloc(),d=b.ui(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.j.h(b,e,f,d);M.free(c);if(!(a instanceof wf)&&(a=a.locationObject.oa(Kc),a.u())){this.m.h(a.x-b,a.y-e);return}this.m.h(f/2,d/2)}}},bounds:{configurable:!0,get:function(){return this.j},set:function(a){this.j.D(a)||(G&&w(a,M,Iq,"bounds"),this.j.assign(a))}},focus:{configurable:!0, get:function(){return this.m},set:function(a){this.m.D(a)||(G&&w(a,K,Iq,"focus"),this.m.assign(a))}},centerX:{configurable:!0,get:function(){return this.j.x+this.m.x},set:function(a){var b=this.j;b.x+this.m.x!==a&&(G&&E(a,Iq,"centerX"),b.pa(),b.x=a-this.m.x,b.freeze())}},centerY:{configurable:!0,get:function(){return this.j.y+this.m.y},set:function(a){var b=this.j;b.y+this.m.y!==a&&(G&&E(a,Iq,"centerY"),b.pa(),b.y=a-this.m.y,b.freeze())}},focusX:{configurable:!0, get:function(){return this.m.x},set:function(a){var b=this.m;b.x!==a&&(b.pa(),b.x=a,b.freeze())}},focusY:{configurable:!0,get:function(){return this.m.y},set:function(a){var b=this.m;b.y!==a&&(b.pa(),b.y=a,b.freeze())}},x:{configurable:!0,get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.pa(),b.x=a,b.freeze())}},y:{configurable:!0,get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.pa(),b.y=a,b.freeze())}},width:{configurable:!0, enumerable:!0,get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.pa(),b.width=a,b.freeze())}},height:{configurable:!0,get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.pa(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.tb},set:function(a){G&&w(a,uq,Iq,"network");this.tb=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.Cd.iterator}},destinationEdges:{configurable:!0, enumerable:!0,get:function(){return this.Pd.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.Cd.count+this.Pd.count}}});Iq.prototype.deleteDestinationEdge=Iq.prototype.Du;Iq.prototype.addDestinationEdge=Iq.prototype.tu;Iq.prototype.deleteSourceEdge=Iq.prototype.Eu; Iq.prototype.addSourceEdge=Iq.prototype.vu;Iq.className="LayoutVertex";Iq.standardComparer=Pq; Iq.smartComparer=function(a,b){G&&w(a,Iq,Iq,"smartComparer:m");G&&w(b,Iq,Iq,"smartComparer:n");if(null!==a){if(null!==b){a=a.Xh;var c=b.Xh;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.Ja("Layout");d=[];switch(this.alignment){case Yq:var h=b,k=c,l=M.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n= m=0;nf-1|| 0g)d.push(new M(0,u,g+h,y)),x=0,q=r,u+=y,y=0;y=Math.max(y,J);switch(p){case Xq:C=-C.width;break;default:C=0}B.moveTo(q+C,u);switch(p){case Xq:q-=D;break;default:q+=D}x++}d.push(new M(0,u,g+h,y));M.free(l);break;case Qq:k=g;m=f;n=b;p=c;g=M.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=K.alloc();for(q=0;q=l&&(k-=l);l=B=0;D=Math.max(this.cellSize.height,1);C=f=0;J=!0;x=K.alloc();for(U=0;Um-1||0k){d.push(new M(0,J?z-f:z,k+n,C+f+p));for(aa=0;aal&&(f.width+=f.x-l,f.x=l);M.free(g)}for(h=f=g=e=0;hb?1:0} oa.Object.defineProperties($k.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.qo},set:function(a){this.qo!==a&&(A(a,"number",$k,"wrappingWidth"),0n)){var u=n+rn(q);q.rc(u,!0);Dn(q,u,n)}}b.isModified=!0}}finally{b.ca=!0}}}}};zi.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Pa(a);for(b=this.nodes.iterator;b.next();)b.value.Pa(a);for(b=this.links.iterator;b.next();)b.value.Pa(a)}; zi.prototype.hp=function(){for(var a=this.H.model,b=new I,c=a.nodeDataArray,d=0;d=d)return"[]";var e=new bb;e.add("[");c&&1d)return;La(a.Gc,d)}Lr(a,"nodeDataArray",te,"nodeDataArray",a,b,null,d,null);a.gp(b)}t.mA=function(a){if(Ha(a))for(var b=a.length,c=0;cb&&(b=a.length);Ka(a,b,c);Lr(this,"",se,"",a,null,c,null,b)}; t.kv=function(a,b){void 0===b&&(b=-1);G&&(Ia(a,X,"removeArrayItem:arr"),E(b,X,"removeArrayItem:idx"));a===this.Gc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];La(a,b);Lr(this,"",te,"",a,c,null,b,null)};t.Go=function(a){if(null===a)return"";var b=this.tj;if(""===b)return"";b=En(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForNodeData found a non-string category for "+a+": "+b)}; t.em=function(a,b){A(b,"string",X,"setCategoryForNodeData:cat");if(null!==a){var c=this.tj;if(""!==c)if(this.hb(a)){var d=En(a,c);void 0===d&&(d="");d!==b&&(bk(a,c,b),Lr(this,"nodeCategory",qe,c,a,d,b))}else bk(a,c,b)}};t.gm=function(a,b){this.em(b,this.Go(a))};t.Pl=function(){return!1};t.$j=function(){return!1};t.yi=function(){return!1};t.ks=function(){return!1};t.wi=function(){return!1};function Bi(){return new X} function Fr(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 Fr(a,b.constructor);return typeof b}function Ir(a){return Pr[a]?Pr[a]:void 0!==sa.go&&sa.go[a]?sa.go[a]:null}function En(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){G&&Fa("property get error: "+d.toString())}return c} function bk(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){G&&Fa("property set error: "+d.toString())}} oa.Object.defineProperties(X.prototype,{name:{configurable:!0,get:function(){return this.Ca},set:function(a){var b=this.Ca;b!==a&&(A(a,"string",X,"name"),this.Ca=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.Nm},set:function(a){var b=this.Nm;b!==a&&(A(a,"string",X,"dataFormat"),this.Nm=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.Jg},set:function(a){var b=this.Jg;b!==a&&(A(a,"boolean", X,"isReadOnly"),this.Jg=a,this.g("isReadOnly",b,a))}},modelData:{configurable:!0,get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(A(a,"object",X,"modelData"),this.j=a,this.g("modelData",b,a),this.Pa(a))}},undoManager:{configurable:!0,get:function(){return this.m},set:function(a){var b=this.m;b!==a&&(w(a,ve,X,"undoManager"),null!==b&&b.Px(this),this.m=a,null!==a&&a.Pw(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.Xg}, set:function(a){A(a,"boolean",X,"skipsUndoManager");this.Xg=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.Yh},set:function(a){var b=this.Yh;b!==a&&(Mr(a,X,"nodeKeyProperty"),""===a&&v("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===te){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Ga(a)&&"number"===typeof c&&(d=this.Ac(a),b?(this.cg.add(a),this.ld[c]!==a&&this.ld.splice(c,0,a),void 0!==d&&this.wb.add(d,a)):(this.cg.remove(a),this.ld[c]=== a&&this.ld.splice(c,1),void 0!==d&&this.wb.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}}X.prototype.changeState.call(this,a,b)}};t=Rr.prototype;t.Rl=function(a){if(void 0!==a){var b=this.Yi;if(null!==b){var c=this.ic(a);null===c&&(c=this.copyNodeData(b),bk(c,this.nodeKeyProperty,a),this.yf(c))}return a}}; t.sx=function(a){return lr(this,a,!0)};t.qv=function(a,b){tr(this,a,b,!0)};t.vx=function(a){return lr(this,a,!1)};t.uv=function(a,b){tr(this,a,b,!1)};function lr(a,b,c){if(null!==b&&(a=c?a.lf:a.mf,""!==a&&(a=En(b,a),void 0!==a))){if(nr(a))return a;v((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function tr(a,b,c,d){null===c&&(c=void 0);void 0===c||nr(c)||Aa(c,"number or string",Rr,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.lf:a.mf;if(""!==e)if(c=a.Rl(c),a.Jc(b)){var f=En(b,e);f!==c&&(rr(a,f,b),bk(b,e,c),null===a.ic(c)&&sr(a,c,b),Lr(a,d?"linkFromKey":"linkToKey",qe,e,b,f,c),"string"===typeof e&&a.Pa(b,e))}else bk(b,e,c)}}t.tx=function(a){return kr(this,a,!0)};t.rv=function(a,b){ur(this,a,b,!0)};t.wx=function(a){return kr(this,a,!1)}; t.vv=function(a,b){ur(this,a,b,!1)};function kr(a,b,c){if(null===b)return"";a=c?a.mj:a.nj;if(""===a)return"";b=En(b,a);return void 0===b?"":b}function ur(a,b,c,d){A(c,"string",Rr,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.mj:a.nj;if(""!==e)if(a.Jc(b)){var f=En(b,e);void 0===f&&(f="");f!==c&&(bk(b,e,c),Lr(a,d?"linkFromPortId":"linkToPortId",qe,e,b,f,c),"string"===typeof e&&a.Pa(b,e))}else bk(b,e,c)}} t.Hf=function(a){if(null===a)return Ur;var b=this.ie;if(""===b)return Ur;a=En(a,b);return void 0===a?Ur:a};t.ys=function(a,b){Ia(b,Rr,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.ie;if(""!==c)if(this.Jc(a)){var d=En(a,c);void 0===d&&(d=Ur);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Jc(a)&&(rr(this,b,a),Lr(this,"linkLabelKeys",te,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.Nh;if(""!==b&&(b=En(a,b),void 0!==b)){if(nr(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.xs=function(a,b){void 0!==b&&null!==b&&nr(b)||Aa(b,"number or string",Rr,"setKeyForLinkData:key");if(null!==a){var c=this.Nh;if(""!==c)if(this.Jc(a)){var d=En(a,c);d!==b&&null===this.kh(b)&&(bk(a,c,b),void 0!==d&&this.wb.remove(d),this.wb.add(b,a),Lr(this,"linkKey",qe,c,a,d,b),"string"===typeof c&&this.Pa(a,c))}else bk(a,c,b)}}; t.kh=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&nr(a)?this.wb.L(a):null}; t.os=function(a){if(null!==a){var b=this.Nh;if(""!==b){var c=this.Ac(a);if(void 0===c||this.wb.contains(c)){var d=this.el;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.wb.contains(c))){bk(a,b,c);return}if("string"===typeof c){for(d=2;this.wb.contains(c+d);)d++;bk(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.wb.count-1;this.wb.contains(c);)c--;bk(a,b,c)}else G&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}}; t.Jc=function(a){return null===a?!1:this.cg.contains(a)};t.ji=function(a){null!==a&&(nb(a),this.Jc(a)||pr(this,a,!0))};function pr(a,b,c){if(""!==a.linkKeyProperty){var d=a.Ac(b);if(void 0!==d&&a.wb.L(d)===b)return;a.os(b);d=a.Ac(b);void 0===d&&v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.wb.add(d,b)}a.cg.add(b);d=null;c&&(d=a.ld.length,a.ld.splice(d,0,b));Lr(a,"linkDataArray",se,"linkDataArray",a,null,b,null,d);Vr(a,b)} t.Cy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.ld.splice(d,1)}Lr(a,"linkDataArray",te,"linkDataArray",a,b,null,d,null);c=lr(a,b,!0);rr(a,c,b);c=lr(a,b,!1);rr(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.Ap;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===ls&&k===ms?h=Yr:h===ls&&k!==ms&&(h=this.arrangement);if((this.direction===gs||this.direction===hs)&&this.sorting!==as){for(k=0;!(k>=d.length);k+=2){a.add(d.N(k));if(k+1>=d.length)break;c.add(d.N(k+1))}this.direction===gs?(this.arrangement===ls&&a.reverse(),d=new H,d.addAll(a), d.addAll(c)):(this.arrangement===ls&&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===ls){isNaN(b)&&(b=6);if(h!==Yr&&h!==ls){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g=r/(360<=p?k:k-1)}this.cw=h;this.nc=l;this.Um=m;this.dw=n;this.Mp=p;this.$i=b;this.me=f;this.Ap=g;b=d;d=this.cw;h=this.nc;l=this.dw;m=this.Mp;n=this.$i;p=this.me;k=this.Ap;if(this.direction!==gs&&this.direction!==hs||d!==ls)if(this.direction===gs||this.direction===hs){g=0;switch(d){case ks:g=180*rs(this,h,p,l,k)/Math.PI;break;case Yr:k=b=0;g=a.first();null!==g&&(b=os(g,Math.PI/2));g=c.first(); null!==g&&(k=os(g,Math.PI/2));g=180*rs(this,h,p,l,n+(b+k)/2)/Math.PI;break;case js:g=m/b.length}if(this.direction===gs){switch(d){case ks:ss(this,a,l,is);break;case Yr:ts(this,a,l,is);break;case js:us(this,a,m/2,l,is)}switch(d){case ks:ss(this,c,l+g,$r);break;case Yr:ts(this,c,l+g,$r);break;case js:us(this,c,m/2,l+g,$r)}}else{switch(d){case ks:ss(this,c,l,is);break;case Yr:ts(this,c,l,is);break;case js:us(this,c,m/2,l,is)}switch(d){case ks:ss(this,a,l+g,$r);break;case Yr:ts(this,a,l+g,$r);break;case js:us(this, a,m/2,l+g,$r)}}}else switch(d){case ks:ss(this,b,l,this.direction);break;case Yr:ts(this,b,l,this.direction);break;case js:us(this,b,m,l,this.direction);break;case ls:vs(this,b,m,l,this.direction)}else vs(this,b,m,l-m/2,$r)}this.updateParts();this.network=null;this.isValidLayout=!0}; function us(a,b,c,d,e){var f=a.Mp,g=a.nc;a=a.me;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===$r?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;ys(a,k,l,m,n,e,f)||zs(a,k,l,m,n,e,f);k=f.x;l=f.y}K.free(f);a.uj++;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.uj?a.nc-g/(2*Math.PI):5>m.length&&10=n.length-1)break;ys(a,k,l,n,p,e,m)||zs(a,k,l,n,p,e,m);k=m.x;l=m.y}K.free(m);a.uj++;if(!(23a.uj?a.nc-f/(2*Math.PI):a.nc-(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 zs(a,b,c,d,e,f,g){var h=a.nc,k=a.me,l=0;a=(d[e].height+d[e+1].height)/2+a.$i;d=!1;if(0<=b!==(f===$r)){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}Xr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; Xr.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 K(0,0):(c.x=this.arrangementOrigin.x+this.nc,c.y=this.arrangementOrigin.y+this.me);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.eb(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.re(c.re(a)),this.group.move(b),this.Rv=b.re(a))}; Xr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function qs(a,b,c,d,e){var f=a.sy;if(.001>Math.abs(a.Um-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 ps(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?qs(a,1,c,d,e):qs(a,1,c))}function rs(a,b,c,d,e){if(.001>Math.abs(a.Um-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}} Xr.prototype.sort=function(a){switch(this.sorting){case es:break;case fs:a.reverse();break;case cs:a.sort(this.comparer);break;case ds:a.sort(this.comparer);a.reverse();break;case as:return this.gk(As(a));default:v("Invalid sorting type.")}return a}; function As(a){for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.N(f));b[f]=-1;f=a.N(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]++}return c} Xr.prototype.gk=function(a){for(var b=[],c=0;cb[c].indexOf(e)&&b[c].push(e);for(d=d.sourceEdges;d.next();)e=a.indexOf(d.value.fromVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e)}f=[];for(c=0;cb[c[q]].indexOf(c[q===c.length-1?0:q+1])&&r.push(q===c.length-1?0:q+1);if(0===r.length)for(q=0;qc.indexOf(J)||Dc.indexOf(J)||D=u?D+1:D)),y+=D=u&&D++,B>=u&&B++,D>B&&(C=B,B=D,D=C),B-D<(c.length+2)/2===(Dr||r===m||(q=r>m?r-m:m-r,n+=rg-q?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b=a?this.wl=a:this.wl=360,this.F())}},arrangement:{configurable:!0,get:function(){return this.Tb},set:function(a){this.Tb!==a&&(ab(a,Xr,Xr,"arrangement"),a===ls||a===Yr||a===ks||a===js)&&(this.Tb=a,this.F())}},direction:{configurable:!0,get:function(){return this.O},set:function(a){this.O!==a&&(ab(a,Xr,Xr,"direction"), a===$r||a===is||a===gs||a===hs)&&(this.O=a,this.F())}},sorting:{configurable:!0,get:function(){return this.md},set:function(a){this.md!==a&&(ab(a,Xr,Xr,"sorting"),a===es||a===fs||a===cs||ds||a===as)&&(this.md=a,this.F())}},comparer:{configurable:!0,get:function(){return this.ed},set:function(a){this.ed!==a&&(A(a,"function",Xr,"comparer"),this.ed=a,this.F())}},spacing:{configurable:!0,get:function(){return this.uf},set:function(a){this.uf!==a&&(A(a,"number", Xr,"spacing"),this.uf=a,this.F())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.Gn},set:function(a){this.Gn!==a&&(ab(a,Xr,Xr,"nodeDiameterFormula"),a===bs||a===ms)&&(this.Gn=a,this.F())}},actualXRadius:{configurable:!0,get:function(){return this.nc}},actualYRadius:{configurable:!0,get:function(){return this.me}},actualSpacing:{configurable:!0,get:function(){return this.$i}},actualCenter:{configurable:!0,get:function(){return this.Rv}}}); var Yr=new F(Xr,"ConstantSpacing",0),ks=new F(Xr,"ConstantDistance",1),js=new F(Xr,"ConstantAngle",2),ls=new F(Xr,"Packed",3),$r=new F(Xr,"Clockwise",4),is=new F(Xr,"Counterclockwise",5),gs=new F(Xr,"BidirectionalLeft",6),hs=new F(Xr,"BidirectionalRight",7),es=new F(Xr,"Forwards",8),fs=new F(Xr,"Reverse",9),cs=new F(Xr,"Ascending",10),ds=new F(Xr,"Descending",11),as=new F(Xr,"Optimized",12),bs=new F(Xr,"Pythagorean",13),ms=new F(Xr,"Circular",14);Xr.className="CircularLayout";Xr.ConstantSpacing=Yr; Xr.ConstantDistance=ks;Xr.ConstantAngle=js;Xr.Packed=ls;Xr.Clockwise=$r;Xr.Counterclockwise=is;Xr.BidirectionalLeft=gs;Xr.BidirectionalRight=hs;Xr.Forwards=es;Xr.Reverse=fs;Xr.Ascending=cs;Xr.Descending=ds;Xr.Optimized=as;Xr.Pythagorean=bs;Xr.Circular=ms;function Zr(){this.Ll=-Infinity;this.pm=this.pk=null} Zr.prototype.compare=function(a,b){if(0this.Ll||Math.abs(a)a&&0h?(e=p.x+p.width/2,f=p.y+ p.height/2,l[0]=new K(p.x+p.width+d.width,p.y),l[1]=new K(p.x,p.y+p.height+d.height),h=2):(k=Gs(l,h,e,f,p.width,p.height,d),n=l[k],r=new K(n.x+p.width+d.width,n.y),p=new K(n.x,n.y+p.height+d.height),k+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.Yc(c)&&(a++,2a.network.vertexes.count)return!1;a.dh=a.network.vertexes.Ka();a=a.dh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Td-a.Td});for(b=a.length-1;0<=b&&1>=a[b].Td;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mr&&(r=1);h=L.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new M(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new K(p.x+g,p.y+h)}}a.network=d;return c} function Ls(a,b,c){G&&(w(b,Es,Ds,"popNetwork:oldnet"),E(c,Ds,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Xe){var e=d.Xe.N(d.ov);d.Td=e.Gs;var f=e.Kv,g=e.Lv;d.bounds=new M(d.centerX-f,d.centerY-g,e.Hs,e.Fs);d.focus=new K(f,g);d.ov--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Ms(a,b,c){G&&(w(b,Os,Ds,"surroundNode:oldnet"),E(c,Ds,"surroundNode:level"));var d=b.Oj;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.Xe&&0=n.Td?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 Gs(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,L.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,L.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.ag;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=Ps(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Rs),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 Rs),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}Ds.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};Ds.prototype.moveFixedVertex=function(){};Ds.prototype.commitLayout=function(){this.sv();this.commitNodes();this.isRouting&&this.commitLinks()}; Ds.prototype.sv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=hd,b.toSpot=hd)}};Ds.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=M.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;M.free(c)}c=M.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()}M.free(c)}; Ds.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};Ds.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Ik:a};Ds.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Hk:a};Ds.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Fk:a};Ds.prototype.electricalFieldX=function(){return 0};Ds.prototype.electricalFieldY=function(){return 0}; Ds.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Gk:a};Ds.prototype.gravitationalFieldX=function(){return 0};Ds.prototype.gravitationalFieldY=function(){return 0};Ds.prototype.isFixed=function(a){return a.isFixed}; oa.Object.defineProperties(Ds.prototype,{currentIteration:{configurable:!0,get:function(){return this.tn}},arrangementSpacing:{configurable:!0,get:function(){return this.Zd},set:function(a){w(a,Hb,Ds,"arrangementSpacing");this.Zd.D(a)||(this.Zd.assign(a),this.F())}},arrangesToOrigin:{configurable:!0,get:function(){return this.wm},set:function(a){this.wm!==a&&(A(a,"boolean",Ds,"arrangesToOrigin"),this.wm=a,this.F())}},setsPortSpots:{configurable:!0, get:function(){return this.tf},set:function(a){this.tf!==a&&(A(a,"boolean",Ds,"setsPortSpots"),this.tf=a,this.F())}},comments:{configurable:!0,get:function(){return this.ud},set:function(a){this.ud!==a&&(A(a,"boolean",Ds,"comments"),this.ud=a,this.F())}},maxIterations:{configurable:!0,get:function(){return this.fl},set:function(a){this.fl!==a&&(A(a,"number",Ds,"maxIterations"),0<=a&&(this.fl=a,this.F()))}},epsilonDistance:{configurable:!0,get:function(){return this.Vm}, set:function(a){this.Vm!==a&&(A(a,"number",Ds,"epsilonDistance"),0u&&0u&&0a[this.Fc]&&(this.Ph=a[c]-1,this.Fc=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Af===l.Af||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;xn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>x)&&h++,qn||u===n&&x>m)&&h++);f[g*e+g]=h;for(k=g+1;k=c)for(h=d[g].destinationEdgesArrayAccess,B=d[k].destinationEdgesArrayAccess, l=0;l=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}ct(a,b,d);return f} function kt(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&&kt(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&&kt(a,k,c,d,e,f)}} function lt(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)lt(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)lt(a,b.value.fromVertex,c,d,e,f)}} Ts.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Ek){default:case mt: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!==nt(a);){for(e=ot(a);null!==e;)d[c]=e,c--,e.valid=!1,e=ot(a);for(e=pt(a);null!==e;)d[b]=e,b++,e.valid=!1,e=pt(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.bm(b),b.rev=!0);break;case Us:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.sg=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Og=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& qt(this,b);for(d.reset();d.next();)b=d.value,-1===b.sg&&qt(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.sgd){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&&kt(a,h,0,-1,!0,!1)}for(kt(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 at(a,b,c){return 90===a.O?c&&!b.rev||!c&&b.rev?270:90:180===a.O?c&&!b.rev||!c&&b.rev?0:180:270===a.O?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} Ts.prototype.initializeIndices=function(){switch(this.Sk){default:case xt:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.Mb[c];this.Mb[c]++}break;case Ws:a=this.network.vertexes.iterator;for(b=this.Da;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&yt(this,c);break;case zt:for(a=this.network.vertexes.iterator,b=0;b<=this.Da;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&At(this,c)}}; function yt(a,b){var c=b.layer;b.index=a.Mb[c];a.Mb[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=Ct(this,d,-1)||f;e=this.countCrossings();e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,1)||f;e=this.countCrossings();e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Ct(this,d,-1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this))}break;default:case Xs:for(c=this.Da,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Ct(this,d,-1)||f;e=this.countCrossings();e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,1)||f;e=this.countCrossings();e>=a?ft(this,b): (a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,-1)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ct(this,d,0)||f;e>=a?ft(this,b):(a=e,b=et(this))}}ft(this,b)}; function Bt(a,b,c){G&&(E(b,Ts,"medianBarycenterCrossingReduction:unfixedLayer"),E(c,Ts,"medianBarycenterCrossingReduction:direction"));var d=bt(a,b),e=a.Mb[b],f=jt(a,b,c),g=it(a,b,c);for(c=0;cf+1&&(p+=4*(z-f),r+=4*(z-(f+1)))}C=d[f].destinationEdges.iterator;for(C.reset();C.next();)if(z=C.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f+1&&(r+=1)}C=d[f+1].sourceEdges.iterator;for(C.reset();C.next();)if(z=C.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))}C=d[f+1].destinationEdges.iterator; for(C.reset();C.next();)if(z=C.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f&&(p+=1)}z=B=0;C=g[d[f].index];var D=h[d[f].index],J=g[d[f+1].index],U=h[d[f+1].index];-1!==C&&(B+=Math.abs(C-q),z+=Math.abs(C-y));-1!==D&&(B+=Math.abs(D-q),z+=Math.abs(D-y));-1!==J&&(B+=Math.abs(J-u),z+=Math.abs(J-x));-1!==U&&(B+=Math.abs(U-u),z+=Math.abs(U-x));if(r>1)+8*d;this.Oa*=8}if(0!==(this.eg&2))for(c=!0;c;){c=!1;for(b=this.Fc+1;b<=this.Da;b++)c=Gt(this,b,1)|| c;for(b=this.Fc-1;0<=b;b--)c=Gt(this,b,-1)||c;c=Gt(this,this.Fc,0)||c}if(0!==(this.eg&4)){for(b=this.Fc+1;b<=this.Da;b++)Ht(this,b,1);for(b=this.Fc-1;0<=b;b--)Ht(this,b,-1);Ht(this,this.Fc,0)}a&&(It(this,-1),It(this,1));if(0!==(this.eg&2))for(c=!0;c;){c=!1;c=Gt(this,this.Fc,0)||c;for(b=this.Fc+1;b<=this.Da;b++)c=Gt(this,b,0)||c;for(b=this.Fc-1;0<=b;b--)c=Gt(this,b,0)||c}}; function Gt(a,b,c){G&&(E(b,Ts,"bendStraighten:unfixedLayer"),E(c,Ts,"bendStraighten:direction"));for(var d=!1;Jt(a,b,c);)d=!0;return d} function Jt(a,b,c){G&&(E(b,Ts,"shiftbendStraighten:unfixedLayer"),E(c,Ts,"shiftbendStraighten:direction"));var d,e=bt(a,b),f=a.Mb[b],g=it(a,b,-1);if(0c)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u= 0;if(0>=c)for(var x=e[d].sourceEdges.iterator;x.next();){var y=x.value;var z=y.fromVertex;if(y.valid&&z.layer!==b){var B=dt(y);var C=y.portFromColOffset;y=y.portToColOffset;z=z.column;p+=(Math.abs(m+y-(z+C))+1)*B;q+=(Math.abs(r+y-(z+C))+1)*B;u+=(Math.abs(n+y-(z+C))+1)*B}}if(0<=c)for(x=e[d].destinationEdges.iterator;x.next();)y=x.value,z=y.toVertex,y.valid&&z.layer!==b&&(B=dt(y),C=y.portFromColOffset,y=y.portToColOffset,z=z.column,p+=(Math.abs(m+C-(z+y))+1)*B,q+=(Math.abs(r+C-(z+y))+1)*B,u+=(Math.abs(n+ C-(z+y))+1)*B);y=C=B=0;x=g[e[d].index];z=h[e[d].index];-1!==x&&(B+=Math.abs(x-m),C+=Math.abs(x-r),y+=Math.abs(x-n));-1!==z&&(B+=Math.abs(z-m),C+=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)}ct(a,b, d);a.normalize()}function Kt(a,b){G&&(E(b,Ts,"packAux:column"),E(1,Ts,"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 Lt(a,b){G&&(E(b,Ts,"tightPackAux:column"),E(1,Ts,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Da;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.Da;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 It(a,b){G&&E(b,Ts,"componentPack:direction");for(var c=0;c<=a.Oa;c++)for(;Kt(a,c););a.normalize();for(c=0;cf?ft(a,e):gb)for(c=a.Oa;0<=c;c--)for(e=et(a),f=ht(a),d=f+1;ff?ft(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Rc);a.Rc++;for(d.reset();d.next();)b=d.value,-1===b.component&&(lt(a,b,a.Rc,-1,!0,!0),a.Rc++);var f;b=[];for(f=0;fc)for(g=a.Oa;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} Ts.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=$s(this,!0),b=$s(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.Au();this.isRouting&&this.commitLinks()};function $s(a,b){return 270===a.O?b?md:rd:90===a.O?b?rd:md:180===a.O?b?pd:qd:b?qd:pd} Ts.prototype.commitNodes=function(){this.ge=[];this.Jd=[];this.Hd=[];this.Va=[];for(var a=0;a<=this.Da;a++)this.ge[a]=0,this.Jd[a]=0,this.Hd[a]=0,this.Va[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.ge[c]=Math.max(this.ge[c],this.nodeMinLayerSpace(b,!0));this.Jd[c]=Math.max(this.Jd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.he;for(var d=0;d<=this.Da;d++){var e=c;0>=this.ge[d]+this.Jd[d]&&(e=0);0=n.bounds.bottom?(n=n.bounds.y+n.bounds.height,b.l(q++,C,n+J),b.l(q++,C,n),b.l(q++,C,n-B)):(b.l(q++,C,D+J),b.l(q++,C,D),b.l(q++,C,D-B)):270===this.O?D<=n.bounds.y?(n=n.bounds.y,b.l(q++,C,n-B),b.l(q++,C,n),b.l(q++,C,n+J)):(b.l(q++,C,D-B),b.l(q++,C,D),b.l(q++,C,D+J)):0===this.O&&(C>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.l(q++,n+J,D),b.l(q++,n,D),b.l(q++,n-B,D)):(b.l(q++,C+J,D),b.l(q++,C,D),b.l(q++,C-B,D)));else{b.l(q++,y,z);var U=0;if(180===this.O||0===this.O){if(180===this.O?C>=n.bounds.right: C<=n.bounds.x)U=(0===this.O?-B:J)/2;b.l(q++,y+U,D)}else{if(270===this.O?D>=n.bounds.bottom:D<=n.bounds.y)U=(90===this.O?-B:J)/2;b.l(q++,C,z+U)}b.l(q++,C,D)}}else B=Math.max(10,this.ge[x.layer]),J=Math.max(10,this.Jd[x.layer]),r?180===this.O?(b.l(q++,C-B-u,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C+J+u,D)):90===this.O?(b.l(q++,C,D+J+u),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D-B-u)): 270===this.O?(b.l(q++,C,D-B-u),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D+J+u)):(b.l(q++,C+J+u,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C-B-u,D)):b.l(q++,C,D)}n=x}if(null===h||l!==Ec||p)if(y=b.i(q-1).x,z=b.i(q-1).y,C=b.i(q).x,D=b.i(q).y,p)u=this.Jd[m.layer],180===this.O||0===this.O?(p=z,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.O?C>=m.bounds.x:C<=m.bounds.right)&&(n=m.centerX+(180=== this.O?-u:u),p=m.bounds.x&&p<=m.bounds.right&&(270===this.O?D>=m.bounds.y:D<=m.bounds.bottom)&&(n=m.centerY+(270===this.O?-u:u),p=m.bounds.x?(n=m.bounds.x+ m.bounds.width,b.P(q-2,n,z),b.P(q-1,n+J,z)):90===this.O&&D<=m.bounds.bottom?(n=m.bounds.y,b.P(q-2,y,n),b.P(q-1,y,n-B)):270===this.O&&D>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.P(q-2,y,n),b.P(q-1,y,n+J)):0===this.O&&C<=m.bounds.right&&(n=m.bounds.x,b.P(q-2,n,z),b.P(q-1,n-B,z));else{B=Math.max(10,this.ge[m.layer]);J=Math.max(10,this.Jd[m.layer]);p=0;if(180===this.O||0===this.O){if(180===this.O?C<=m.bounds.x:C>=m.bounds.right)p=(0===this.O?J:-B)/2;b.l(q++,C+p,z)}else{if(270===this.O?D<=m.bounds.y: D>=m.bounds.bottom)p=(90===this.O?J:-B)/2;b.l(q++,y,D+p)}b.l(q++,C,D)}}else{for(;null!==m&&m!==n;){B=x=null;for(m=m.destinationEdges.iterator;m.next()&&(y=m.value,y.link!==c.link||(x=y.toVertex,B=y.fromVertex,null!==B.node&&(B=null),null!==x.node)););if(null===x)break;x!==n&&(y=b.i(q-1).x,z=b.i(q-1).y,C=x.centerX,D=x.centerY,p?180===this.O||0===this.O?(null!==B?B.centerY:z)!==D&&(B=this.Va[x.layer]+this.dd.x,q===b.firstPickIndex+1&&(B=0===this.O?Math.max(B,y):Math.min(B,y)),b.l(q++,B,z),b.l(q++,B, D)):(null!==B?B.centerX:y)!==C&&(B=this.Va[x.layer]+this.dd.y,q===b.firstPickIndex+1&&(B=90===this.O?Math.max(B,z):Math.min(B,z)),b.l(q++,y,B),b.l(q++,C,B)):(B=Math.max(10,this.ge[x.layer]),J=Math.max(10,this.Jd[x.layer]),r?180===this.O?(b.l(q++,C+J+u,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C-B-u,D)):90===this.O?(b.l(q++,C,D-B-u),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D+J+u)):270=== this.O?(b.l(q++,C,D+J+u),b.l(q++,C,Math.max(D+J-u/2,D)),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,C,Math.min(D-B+u/2,D)),b.l(q++,C,D-B-u)):(b.l(q++,C-B-u,D),b.l(q++,Math.min(C-B+u/2,C),D),b.l(q++,C,D),b.l(q++,C,D),b.l(q++,Math.max(C+J-u/2,C),D),b.l(q++,C+J+u,D)):180===this.O?(b.l(q++,C+J,D),b.l(q++,C-B,D)):90===this.O?(b.l(q++,C,D-B),b.l(q++,C,D+J)):270===this.O?(b.l(q++,C,D+J),b.l(q++,C,D-B)):(b.l(q++,C-B,D),b.l(q++,C+J,D))));m=x}p&&(y=b.i(q-1).x,z=b.i(q-1).y,C=b.i(q).x,D=b.i(q).y,180===this.O||0===this.O? z!==D&&(B=0===this.O?Math.min(Math.max((C+y)/2,this.Va[n.layer]+this.dd.x),C):Math.max(Math.min((C+y)/2,this.Va[n.layer]+this.dd.x),C),b.l(q++,B,z),b.l(q++,B,D)):y!==C&&(B=90===this.O?Math.min(Math.max((D+z)/2,this.Va[n.layer]+this.dd.y),D):Math.max(Math.min((D+z)/2,this.Va[n.layer]+this.dd.y),D),b.l(q++,y,B),b.l(q++,C,B)))}null!==d&&r&&(null!==g&&(l===Ec&&(l=b.i(0),d=b.i(2),l.D(d)||b.P(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,Ec,!0,!1,f,h),l.u()||l.set(e.actualBounds.center),b.P(0,l.x,l.y)), null!==h&&(k===Ec&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.D(l)||b.P(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,Ec,!1,!1,e,g),e.u()||e.set(f.actualBounds.center),b.P(b.pointsCount-1,e.x,e.y)));b.Bf();c.commit()}}}this.avoidOrthogonalOverlaps()}; Ts.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.rdb.rd?1:a.Icb.Ic?1:0:0};t.Sx=function(a,b){return a instanceof Nt&&b instanceof Nt&&a!==b?a.firstb.first||a.jb.j||a.rdb.rd?1:a.Icb.Ic?1:0:0}; t.ws=function(a,b){return a instanceof Nt&&b instanceof Nt&&a!==b?a.lcb.lc||a.jb.j||a.rdb.rd?1:a.Icb.Ic?1:0:0};t.C=function(a,b){G&&(E(a,Ts,"isApprox:a"),E(b,Ts,"isApprox:b"));a-=b;return-1a}; t.Ei=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.He.length){var d=[];for(var e=0;ea&&(this.eg=a,this.F()))}},setsPortSpots:{configurable:!0,get:function(){return this.tf},set:function(a){this.tf!==a&&(A(a,"boolean",Ts,"setsPortSpots"),this.tf=a,this.F())}},linkSpacing:{configurable:!0,get:function(){return this.vn},set:function(a){this.vn!==a&&(A(a,"number",Ts,"linkSpacing"),0<=a&&(this.vn=a,this.F()))}},maxLayer:{configurable:!0, get:function(){return this.Da}},maxIndex:{configurable:!0,get:function(){return this.Ph}},maxColumn:{configurable:!0,get:function(){return this.Oa}},minIndexLayer:{configurable:!0,get:function(){return this.Ng}},maxIndexLayer:{configurable:!0,get:function(){return this.Fc}}}); var Us=new F(Ts,"CycleDepthFirst",0),mt=new F(Ts,"CycleGreedy",1),Zs=new F(Ts,"CycleFromLayers",2),Vs=new F(Ts,"LayerOptimalLinkLength",0),rt=new F(Ts,"LayerLongestPathSink",1),tt=new F(Ts,"LayerLongestPathSource",2),Ws=new F(Ts,"InitDepthFirstOut",0),zt=new F(Ts,"InitDepthFirstIn",1),xt=new F(Ts,"InitNaive",2),Dt=new F(Ts,"AggressiveNone",0),Xs=new F(Ts,"AggressiveLess",1),Et=new F(Ts,"AggressiveMore",2),Ft=8;Ts.className="LayeredDigraphLayout";Ts.CycleDepthFirst=Us;Ts.CycleGreedy=mt; Ts.CycleFromLayers=Zs;Ts.LayerOptimalLinkLength=Vs;Ts.LayerLongestPathSink=rt;Ts.LayerLongestPathSource=tt;Ts.InitDepthFirstOut=Ws;Ts.InitDepthFirstIn=zt;Ts.InitNaive=xt;Ts.AggressiveNone=Dt;Ts.AggressiveLess=Xs;Ts.AggressiveMore=Et;Ts.PackNone=0;Ts.PackExpand=1;Ts.PackStraighten=2;Ts.PackMedian=4;Ts.PackAll=15;function Nt(){this.index=this.Ic=this.rd=this.lc=this.first=this.layer=0;this.link=null;this.j=0}Nt.className="SegInfo";function Ys(a){uq.call(this,a)}na(Ys,uq);Ys.prototype.createVertex=function(){return new Ot(this)}; Ys.prototype.createEdge=function(){return new Pt(this)};Ys.className="LayeredDigraphNetwork";function Ot(a){Iq.call(this,a);this.bb=this.Dg=this.Mh=-1;this.v=NaN;this.G=null;this.valid=!1;this.finish=this.sg=NaN;this.Af=0;this.ek=this.fk=null}na(Ot,Iq); Ot.prototype.serializeVertexProperties=function(a,b){Iq.prototype.serializeVertexProperties.call(this,a,b);a.layer=this.layer;a.column=this.column;a.index=this.index;a.component=this.component;a.near=this.near?lb(this.near):null;a.valid=this.valid;a.sg=this.sg;a.finish=this.finish;a.Af=this.Af;a.fk=this.fk;a.ek=this.ek}; Ot.prototype.deserializeVertexProperties=function(a,b,c,d){Iq.prototype.deserializeVertexProperties.call(this,a,b,c,d);this.layer=a.layer;this.column=a.column;this.index=a.index;this.component=a.component;if(b=b.get(a.near))this.near=b;this.valid=a.valid;this.sg=a.sg;this.finish=a.finish;this.Af=a.Af;this.fk=a.fk;this.ek=a.ek}; oa.Object.defineProperties(Ot.prototype,{layer:{configurable:!0,get:function(){return this.Mh},set:function(a){this.Mh!==a&&(A(a,"number",Ot,"layer"),this.Mh=a)}},column:{configurable:!0,get:function(){return this.Dg},set:function(a){this.Dg!==a&&(A(a,"number",Ot,"column"),this.Dg=a)}},index:{configurable:!0,get:function(){return this.bb},set:function(a){this.bb!==a&&(A(a,"number",Ot,"index"),this.bb=a)}},component:{configurable:!0,get:function(){return this.v}, set:function(a){this.v!==a&&(A(a,"number",Ot,"component"),this.v=a)}},near:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(G&&null!==a&&w(a,Ot,Ot,"near"),this.G=a)}}});Ot.className="LayeredDigraphVertex";function Pt(a){Jq.call(this,a);this.j=this.ma=this.Ma=!1;this.$=this.v=NaN;this.G=this.m=0}na(Pt,Jq); Pt.prototype.serializeEdgeProperties=function(a,b){Jq.prototype.serializeEdgeProperties.call(this,a,b);a.valid=this.valid;a.rev=this.rev;a.forest=this.forest;a.portFromPos=this.portFromPos;a.portToPos=this.portToPos;a.portFromColOffset=this.portFromColOffset;a.portToColOffset=this.portToColOffset}; Pt.prototype.deserializeEdgeProperties=function(a,b,c,d){Jq.prototype.deserializeEdgeProperties.call(this,a,b,c,d);this.valid=a.valid;this.rev=a.rev;this.forest=a.forest;this.portFromPos=a.portFromPos;this.portToPos=a.portToPos;this.portFromColOffset=a.portFromColOffset;this.portToColOffset=a.portToColOffset}; oa.Object.defineProperties(Pt.prototype,{fromVertex:{configurable:!0,get:function(){return this.gd},set:function(a){this.gd!==a&&(G&&null!==a&&w(a,Ot,Pt,"fromVertex"),this.gd=a)}},toVertex:{configurable:!0,get:function(){return this.pd},set:function(a){this.pd!==a&&(G&&null!==a&&w(a,Ot,Pt,"toVertex"),this.pd=a)}},valid:{configurable:!0,get:function(){return this.Ma},set:function(a){this.Ma!==a&&(A(a,"boolean",Pt,"valid"),this.Ma=a)}},rev:{configurable:!0, enumerable:!0,get:function(){return this.ma},set:function(a){this.ma!==a&&(A(a,"boolean",Pt,"rev"),this.ma=a)}},forest:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(A(a,"boolean",Pt,"forest"),this.j=a)}},portFromPos:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(A(a,"number",Pt,"portFromPos"),this.v=a)}},portToPos:{configurable:!0,get:function(){return this.$},set:function(a){this.$!==a&&(A(a,"number", Pt,"portToPos"),this.$=a)}},portFromColOffset:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(A(a,"number",Pt,"portFromColOffset"),this.m=a)}},portToColOffset:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(A(a,"number",Pt,"portToColOffset"),this.G=a)}}});Pt.className="LayeredDigraphEdge"; function Z(a){Di.call(this);this.Wb=new I;this.Qn=Qt;this.wd=Rt;this.lo=St;this.oq=Tt;this.Sv=[];this.ud=!0;this.Tb=Ut;this.Zd=(new Hb(10,10)).freeze();var b=new Vt(this);this.Z=new Wt(b);this.aa=new Wt(b);this.ju=[];a&&Object.assign(this,a)}na(Z,Di);Z.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Qn=this.Qn;a.lo=this.lo;a.oq=this.oq;a.ud=this.ud;a.Tb=this.Tb;a.Zd.assign(this.Zd);a.Z.copyInheritedPropertiesFrom(this.Z);a.aa.copyInheritedPropertiesFrom(this.aa)}; Z.prototype.ub=function(a){a.classType===Z?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.arrangement=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.treeStyle=a:v("Unknown enum value: "+a):Di.prototype.ub.call(this,a)};Z.prototype.createNetwork=function(){return new Vt(this)}; Z.prototype.makeNetwork=function(a){function b(a){if(a instanceof T)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof R){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof P?(c.qg(a.nodes,!0,b),c.qg(a.links,!0,b)):a instanceof wf?c.qg(a.memberParts,!1,b):c.qg(a.iterator,!1,b);return c}; Z.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==Xt&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof P&&(b=a);this.path===Qt&&null!==b?this.wd=b.isTreePathToChildren?Rt:Yt:this.wd=this.path===Qt?Rt:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0} Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){G&&w(a,Wt,Z,"removeChild:p");G&&w(b,Wt,Z,"removeChild:c");for(var c=a.children,d=0,e=0;ee?Gu(a,g,fa,y,z):Hu(a,g,fa,y,z);fa=z.x;y=z.width;z=z.height;break;case su:for(C=0;Cn&&(aawb&&(Mu(a,-wb,0,la,za-1),Nu(C,-wb,0),Nu(D,-wb,0),wb=0)}Ma.V.h(wb,Y);y=Math.max(y,J);z=Math.max(z,B+(0===W?0:q)+sb.height);aa=J}else{0n&&(Ywb&&(Mu(a,0,-wb,la,za-1),Nu(C,0,-wb),Nu(D,0,-wb),wb=0);Ma.V.h(aa,wb);z=Math.max(z,U);y=Math.max(y,B+(0===W?0:q)+sb.width);Y=U}Q++}0l&&(l=0),135u&&(u=0),k===tu&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>y&&(y=Su(k,d-y,0),g=y.x,h=y.y,y=d,l=0):y=Qu(a,y,l),0>l&&(g-=l,l=0),135z&&(z=Su(k,0,x-z),g=z.x,h=z.y,z=x,u=0):z=Ru(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])),W[0].h(l+d,0),W[1].h(W[0].x,x),W[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])),W[0].h(0,u+x),W[1].h(d,W[0].y),W[2].xd?Gu(b,e,Q,B,C):Hu(b,e,Q,B,C);Q=C.x;B=C.width;C=C.height;break;case su:for(a=0;ap&&(Jp&&(Un&&(n=0),135y&&(y=0));b.qa.h(n,y);b.Ia.h(B,C)}} function Gu(a,b,c,d,e){G&&w(a,Wt,Z,"layoutBusChildrenPosDir:v");var f=b.length;if(0===f)return new M(c,0,d,e);if(1===f)return a=b[0],d=a.Ia.width,e=a.Ia.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===zu(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=Wu(a,b.V.x,!1,c,g))):(b.V.h(d+h,c+g/2-b.focus.y-b.qa.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.qa.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.V.y&&(c=Wu(a,b.V.y,!0,c,g))));return new M(c,0,d,e)} function Hu(a,b,c,d,e){G&&w(a,Wt,Z,"layoutBusChildrenNegDir:v");var f=b.length;if(0===f)return new M(c,0,d,e);if(1===f)return b=b[0],d=b.Ia.width,e=b.Ia.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===zu(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=Wu(a,h.V.x,!1,c,g))):(h.V.h(-d-l.width-q,c+g/2-h.focus.y-h.qa.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.qa.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.V.y&&(c=Wu(a,h.V.y,!0,c,g))));for(a=0;ab&&(b=c+a.width),0>c&&(b-=c),b;case Au:return a.width>b?a.width:b;case Bu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case ru:case hu:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case su:return a.width-a.focus.x+a.nodeSpacing/2+b;case tu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function Ru(a,b,c){G&&w(a,Wt,Z,"calculateSubheight:v");switch(a.alignment){case Pu:case Ou:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Au:return a.height>b?a.height:b;case Bu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case ru:case hu:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case su:return a.height-a.focus.y+a.nodeSpacing/2+b;case tu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function Su(a,b,c){G&&w(a,F,Z,"alignOffset:align");switch(a){case Ou:b/=2;c/=2;break;case Pu:b/=2;c/=2;break;case Au:c=b=0;break;case Bu:break;default:v("Unhandled alignment value "+a.toString())}return new K(b,c)}function Ju(a,b,c,d,e,f){G&&w(a,Wt,Z,"shiftRelPosAlign:v");G&&w(b,F,Z,"shiftRelPosAlign:align");b=Su(b,c,d);Mu(a,b.x,b.y,e,f)}function Mu(a,b,c,d,e){G&&w(a,Wt,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 Ku(a,b,c,d){G&&(w(b,Wt,Z,"recordMidPoints:v"),A(c,"number",Z,"recordMidPoints:x"),A(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.wd){case Rt:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case Yt:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.wd.toString())}}function Nu(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=Iu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Iu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Iu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x, k.y);f=Iu(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=Iu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Iu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Iu(a,n.length+f.length); for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Iu(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Eu(a){G&&w(a,Wt,Z,"computeLayerSpacing:v");var b=zu(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.Z.nodeIndentPastParent=a,this.F()))}},nodeSpacing:{configurable:!0,get:function(){return this.Z.nodeSpacing},set:function(a){this.Z.nodeSpacing!==a&&(A(a,"number",Z,"nodeSpacing"),this.Z.nodeSpacing=a,this.F())}},layerSpacing:{configurable:!0,get:function(){return this.Z.layerSpacing},set:function(a){this.Z.layerSpacing!==a&&(A(a,"number",Z,"layerSpacing"),this.Z.layerSpacing=a,this.F())}},layerSpacingParentOverlap:{configurable:!0, enumerable:!0,get:function(){return this.Z.layerSpacingParentOverlap},set:function(a){this.Z.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.Z.layerSpacingParentOverlap=a,this.F()))}},compaction:{configurable:!0,get:function(){return this.Z.compaction},set:function(a){this.Z.compaction!==a&&(ab(a,Z,Z,"compaction"),a===wu||a===yu)&&(this.Z.compaction=a,this.F())}},breadthLimit:{configurable:!0,get:function(){return this.Z.breadthLimit}, set:function(a){this.Z.breadthLimit!==a&&(A(a,"number",Z,"breadthLimit"),0<=a&&(this.Z.breadthLimit=a,this.F()))}},rowSpacing:{configurable:!0,get:function(){return this.Z.rowSpacing},set:function(a){this.Z.rowSpacing!==a&&(A(a,"number",Z,"rowSpacing"),this.Z.rowSpacing=a,this.F())}},rowIndent:{configurable:!0,get:function(){return this.Z.rowIndent},set:function(a){this.Z.rowIndent!==a&&(A(a,"number",Z,"rowIndent"),0<=a&&(this.Z.rowIndent=a,this.F()))}},commentSpacing:{configurable:!0, enumerable:!0,get:function(){return this.Z.commentSpacing},set:function(a){this.Z.commentSpacing!==a&&(A(a,"number",Z,"commentSpacing"),this.Z.commentSpacing=a,this.F())}},commentMargin:{configurable:!0,get:function(){return this.Z.commentMargin},set:function(a){this.Z.commentMargin!==a&&(A(a,"number",Z,"commentMargin"),this.Z.commentMargin=a,this.F())}},setsPortSpot:{configurable:!0,get:function(){return this.Z.setsPortSpot},set:function(a){this.Z.setsPortSpot!==a&&(A(a, "boolean",Z,"setsPortSpot"),this.Z.setsPortSpot=a,this.F())}},portSpot:{configurable:!0,get:function(){return this.Z.portSpot},set:function(a){w(a,Ib,Z,"portSpot");this.Z.portSpot.D(a)||(this.Z.portSpot=a,this.F())}},setsChildPortSpot:{configurable:!0,get:function(){return this.Z.setsChildPortSpot},set:function(a){this.Z.setsChildPortSpot!==a&&(A(a,"boolean",Z,"setsChildPortSpot"),this.Z.setsChildPortSpot=a,this.F())}},childPortSpot:{configurable:!0,get:function(){return this.Z.childPortSpot}, set:function(a){w(a,Ib,Z,"childPortSpot");this.Z.childPortSpot.D(a)||(this.Z.childPortSpot=a,this.F())}},alternateSorting:{configurable:!0,get:function(){return this.aa.sorting},set:function(a){this.aa.sorting!==a&&(ab(a,Z,Z,"alternateSorting"),a===mu||a===nu||a===ou||pu)&&(this.aa.sorting=a,this.F())}},alternateComparer:{configurable:!0,get:function(){return this.aa.comparer},set:function(a){this.aa.comparer!==a&&(A(a,"function",Z,"alternateComparer"),this.aa.comparer= a,this.F())}},alternateAngle:{configurable:!0,get:function(){return this.aa.angle},set:function(a){this.aa.angle!==a&&(A(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.aa.angle=a,this.F())}},alternateAlignment:{configurable:!0,get:function(){return this.aa.alignment},set:function(a){this.aa.alignment!==a&&(ab(a,Z,Z,"alternateAlignment"),this.aa.alignment=a,this.F())}},alternateNodeIndent:{configurable:!0,get:function(){return this.aa.nodeIndent}, set:function(a){this.aa.nodeIndent!==a&&(A(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.aa.nodeIndent=a,this.F()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.aa.nodeIndentPastParent},set:function(a){this.aa.nodeIndentPastParent!==a&&(A(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.aa.nodeIndentPastParent=a,this.F()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.aa.nodeSpacing},set:function(a){this.aa.nodeSpacing!== a&&(A(a,"number",Z,"alternateNodeSpacing"),this.aa.nodeSpacing=a,this.F())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.aa.layerSpacing},set:function(a){this.aa.layerSpacing!==a&&(A(a,"number",Z,"alternateLayerSpacing"),this.aa.layerSpacing=a,this.F())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.aa.layerSpacingParentOverlap},set:function(a){this.aa.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"alternateLayerSpacingParentOverlap"), 0<=a&&1>=a&&(this.aa.layerSpacingParentOverlap=a,this.F()))}},alternateCompaction:{configurable:!0,get:function(){return this.aa.compaction},set:function(a){this.aa.compaction!==a&&(ab(a,Z,Z,"alternateCompaction"),a===wu||a===yu)&&(this.aa.compaction=a,this.F())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.aa.breadthLimit},set:function(a){this.aa.breadthLimit!==a&&(A(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.aa.breadthLimit=a,this.F()))}}, alternateRowSpacing:{configurable:!0,get:function(){return this.aa.rowSpacing},set:function(a){this.aa.rowSpacing!==a&&(A(a,"number",Z,"alternateRowSpacing"),this.aa.rowSpacing=a,this.F())}},alternateRowIndent:{configurable:!0,get:function(){return this.aa.rowIndent},set:function(a){this.aa.rowIndent!==a&&(A(a,"number",Z,"alternateRowIndent"),0<=a&&(this.aa.rowIndent=a,this.F()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.aa.commentSpacing}, set:function(a){this.aa.commentSpacing!==a&&(A(a,"number",Z,"alternateCommentSpacing"),this.aa.commentSpacing=a,this.F())}},alternateCommentMargin:{configurable:!0,get:function(){return this.aa.commentMargin},set:function(a){this.aa.commentMargin!==a&&(A(a,"number",Z,"alternateCommentMargin"),this.aa.commentMargin=a,this.F())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.aa.setsPortSpot},set:function(a){this.aa.setsPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsPortSpot"), this.aa.setsPortSpot=a,this.F())}},alternatePortSpot:{configurable:!0,get:function(){return this.aa.portSpot},set:function(a){w(a,Ib,Z,"alternatePortSpot");this.aa.portSpot.D(a)||(this.aa.portSpot=a,this.F())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.aa.setsChildPortSpot},set:function(a){this.aa.setsChildPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsChildPortSpot"),this.aa.setsChildPortSpot=a,this.F())}},alternateChildPortSpot:{configurable:!0, enumerable:!0,get:function(){return this.aa.childPortSpot},set:function(a){w(a,Ib,Z,"alternateChildPortSpot");this.aa.childPortSpot.D(a)||(this.aa.childPortSpot=a,this.F())}}}); var Qt=new F(Z,"PathDefault",-1),Rt=new F(Z,"PathDestination",0),Yt=new F(Z,"PathSource",1),mu=new F(Z,"SortingForwards",10),nu=new F(Z,"SortingReverse",11),ou=new F(Z,"SortingAscending",12),pu=new F(Z,"SortingDescending",13),Ou=new F(Z,"AlignmentCenterSubtrees",20),Pu=new F(Z,"AlignmentCenterChildren",21),Au=new F(Z,"AlignmentStart",22),Bu=new F(Z,"AlignmentEnd",23),ru=new F(Z,"AlignmentBus",24),hu=new F(Z,"AlignmentBusBranching",25),su=new F(Z,"AlignmentTopLeftBus",26),tu=new F(Z,"AlignmentBottomRightBus", 27),wu=new F(Z,"CompactionNone",30),yu=new F(Z,"CompactionBlock",31),St=new F(Z,"StyleLayered",40),lu=new F(Z,"StyleLastParents",41),ku=new F(Z,"StyleAlternating",42),ju=new F(Z,"StyleRootOnly",43),Ut=new F(Z,"ArrangementVertical",50),Yu=new F(Z,"ArrangementHorizontal",51),Xt=new F(Z,"ArrangementFixedRoots",52),Tt=new F(Z,"LayerIndividual",60),fu=new F(Z,"LayerSiblings",61),eu=new F(Z,"LayerUniform",62);Z.className="TreeLayout";Z.PathDefault=Qt;Z.PathDestination=Rt;Z.PathSource=Yt; Z.SortingForwards=mu;Z.SortingReverse=nu;Z.SortingAscending=ou;Z.SortingDescending=pu;Z.AlignmentCenterSubtrees=Ou;Z.AlignmentCenterChildren=Pu;Z.AlignmentStart=Au;Z.AlignmentEnd=Bu;Z.AlignmentBus=ru;Z.AlignmentBusBranching=hu;Z.AlignmentTopLeftBus=su;Z.AlignmentBottomRightBus=tu;Z.CompactionNone=wu;Z.CompactionBlock=yu;Z.StyleLayered=St;Z.StyleLastParents=lu;Z.StyleAlternating=ku;Z.StyleRootOnly=ju;Z.ArrangementVertical=Ut;Z.ArrangementHorizontal=Yu;Z.ArrangementFixedRoots=Xt;Z.LayerIndividual=Tt; Z.LayerSiblings=fu;Z.LayerUniform=eu;function Vt(a){uq.call(this,a)}na(Vt,uq);Vt.prototype.createVertex=function(){return new Wt(this)};Vt.prototype.createEdge=function(){return new $u(this)};Vt.className="TreeNetwork"; function Wt(a){Iq.call(this,a);this.$=!1;this.jb=null;this.v=[];this.ob=this.Ma=this.G=this.ma=0;this.ud=null;this.V=new K(0,0);this.Ia=new Hb(0,0);this.qa=new K(0,0);this.dm=this.cm=this.pA=!1;this.$o=this.Oo=null;this.md=mu;this.ed=Pq;this.Lb=0;this.Kb=Pu;this.Hq=this.Gq=0;this.Iq=20;this.he=50;this.nq=0;this.yp=yu;this.qp=0;this.Zq=25;this.xp=this.Yq=10;this.wp=20;this.gr=!0;this.Pq=hd;this.fr=!0;this.tp=hd}na(Wt,Iq); Wt.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.md=a.sorting,this.ed=a.comparer,this.Lb=a.angle,this.Kb=a.alignment,this.Gq=a.nodeIndent,this.Hq=a.nodeIndentPastParent,this.Iq=a.nodeSpacing,this.he=a.layerSpacing,this.nq=a.layerSpacingParentOverlap,this.yp=a.compaction,this.qp=a.breadthLimit,this.Zq=a.rowSpacing,this.Yq=a.rowIndent,this.xp=a.commentSpacing,this.wp=a.commentMargin,this.gr=a.setsPortSpot,this.Pq=a.portSpot,this.fr=a.setsChildPortSpot,this.tp=a.childPortSpot)}; oa.Object.defineProperties(Wt.prototype,{initialized:{configurable:!0,get:function(){return this.$},set:function(a){this.$!==a&&(A(a,"boolean",Wt,"initialized"),this.$=a)}},parent:{configurable:!0,get:function(){return this.jb},set:function(a){this.jb!==a&&(G&&null!==a&&w(a,Wt,Wt,"parent"),this.jb=a)}},children:{configurable:!0,get:function(){return this.v},set:function(a){if(this.v!==a){null===a||Array.isArray(a)||Aa(a,"Array",Wt,"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-Fu(c))))):c.alignment===Au?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Fu(c))))):c.alignment===Au?(e=d.left+b.x,0===b.x&&m.xp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Fu(c))))):c.alignment===Au?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Fu(c))))):c.alignment===Au?(e=d.left+b.x,0===b.x&&m.x