gojs插件源码

Posted yafeng666

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gojs插件源码相关的知识,希望对你有一定的参考价值。

/*

  • GoJS v2.1.2 javascript Library for html Diagrams
  • Northwoods Software, https://www.nwoods.com/
  • GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
  • Copyright (C) 1998-2019 by Northwoods Software Corporation. All Rights Reserved.
  • THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.2/license.html. / (function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ca(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var da="function"==typeof Object.create?Object.create:function(a){function b()b.prototype=a;return new b},fa; if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:,ja=;trycatch(a)ha=!1}fa=ha?function(a,b){a.proto=b;if(a.proto!b)throw new TypeError(a+" is not extensible");return a}:null}var ka=fa; function la(a,b){a.prototype=da(b.prototype);a.prototype.constructor=a;if(ka)ka(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties)else a[c]=b[c];a.AA=b.prototype}var ma="undefined"!=typeof window&&window=self?self:"undefined"!=typeof global&&null!=global?global:self,na="function"typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)}; function oa(a){if(a){for(var b=ma,c=["Array","prototype","fill"],d=0;d<c.length-1;d++){var e=c[d];e in b||(b[e]=);b=b[e]}c=c[c.length-1];d=b[c];a=a(d);a!=d&&null!=a&&na(b,c,{writable:!0,value:a})}}oa(function(a){return a?a:function(a,c,d)});var x="object"=typeof self&&self.self=self&&self||"object"=typeof global&&global.global=global&&global||"object"=typeof window&&window.window=window&&window||;void 0=x.requestAnimationFrame&&(x.requestAnimationFrame=x.setImmediate);function qa()function ra(a,b){var c=-1;return function(),b)}}function sa(a,b){return x.setTimeout(a,b)}function ta(a){return x.document.createElement(a)} function B(a){throw Error(a);}function ua(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!b&&(a+=" to value: "+b);B(a)}function va(a,b,c,d){c=null=c?"":"string"typeof c?c:"function"typeof c&&"string"==typeof c.className?c.className:;void 0!==d&&(c+="."+d);B(c+" is not in the range "+b+": "+a)}function wa(a){x.console&&x.console.log(a)} function xa(){x.console&&x.console.log("Warning: List/Map/Set constructors no longer take an argument that enforces type.Instead they take an optional collection of Values to add to the collection. See 2.0 changelog for details.")}function ya(a){return"object"==typeof a&&null!a}function za(a){return Array.isArray(a)||x.NodeList&&a instanceof x.NodeList||x.HTMLCollection&&a instanceof x.HTMLCollection}function Aa(a){return Array.prototype.slice.call(a)} function Ba(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):B("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Ca(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):B("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Da(){var a=Ea.pop();return void 0a?[]:a}function Fa(a) function Ha(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(ya(a)&&a.constructor)return Ha(a.constructor);return typeof a} function Ia(a){var b=a;ya(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.constructorObject&&(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 0b?"undefined":nullb?"null":b.toString()}function Ja(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.uA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function La(a,b,c){Object.defineProperty(Na.prototype,a,{get:b,set:c})}function Oa()return a} function Ra(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;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join();a=a?"0":a;b=[];for(c=0;256>c;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;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f} var Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 9.0"),Ta=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 10.0"),Ua=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Va=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Wa=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Xa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!x.navigator.platform.match(/(iPhone|iPod|iPad)/i), Ea=[];Object.freeze([]);var Qa=[];qa.className="Util";qa.Dx="32ab5ff3b26f42dc0ed90f224d2913b5";qa.adym="gojs.net";qa.vfo="28e647fdb1";qa.className="Util";function D(a,b,c){Za(this);this.l=a;this.Qa=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Qa};function $a(a,b){return void 0b||null=b||===b?null:a[b]} ma.Object.defineProperties(D.prototype,{classType:{get:function()},name:{get:function()},value:{get:function()}});D.className="EnumValue";function cb()cb.prototype.toString=function(){return this.vw.join()};cb.prototype.add=function(a){""!a&&this.vw.push(a)};cb.className="StringBuilder";function db()db.className="PropertyCollection"; function eb()eb.prototype.reset=function();eb.prototype.next=function(){return!1};eb.prototype.fd=function(){return!1};eb.prototype.first=function();eb.prototype.any=function(){return!1};eb.prototype.all=function(){return!0};eb.prototype.each=function();eb.prototype.map=function();eb.prototype.filter=function();eb.prototype.Ad=function();eb.prototype.toString=function(){return"EmptyIterator"}; ma.Object.defineProperties(eb.prototype,{iterator:{get:function()},count:{get:function(){return 0}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.fd;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset;var fb=null;eb.className="EmptyIterator";fb=new eb;function gb(a)gb.prototype.reset=function(); gb.prototype.next=function();gb.prototype.fd=function(){return this.next()};gb.prototype.first=function();gb.prototype.any=function(a){this.key=-1;return a(this.value)};gb.prototype.all=function(a){this.key=-1;return a(this.value)};gb.prototype.each=function(a);gb.prototype.map=function(a){return new gb(a(this.value))}; gb.prototype.filter=function(a){return a(this.value)?new gb(this.value):fb};gb.prototype.Ad=function();gb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};ma.Object.defineProperties(gb.prototype,{iterator:{get:function()},count:{get:function(){return 1}}});gb.prototype.first=gb.prototype.first;gb.prototype.hasNext=gb.prototype.fd;gb.prototype.next=gb.prototype.next; gb.prototype.reset=gb.prototype.reset;gb.className="SingletonIterator";function ib(a)ib.prototype.reset=function();ib.prototype.next=function()else{if(c<b)return this.key=c,this.value=a[c],!0;this.Ad()}return!1}; ib.prototype.fd=function(){return this.next()};ib.prototype.first=function()return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};ib.prototype.any=function(a)return!1}; ib.prototype.all=function(a)return!0};ib.prototype.each=function(a)return this}; ib.prototype.map=function(a)a=new E;a.j=c;a.ib();return a.iterator};ib.prototype.filter=function(a)a=new E;a.j=c;a.ib();return a.iterator}; ib.prototype.Ad=function();ib.prototype.toString=function(){return"ListIterator@"+this.Oa+"/"+this.lb.count}; ma.Object.defineProperties(ib.prototype,{iterator:{get:function()},predicate:{get:function(),set:function(a)},count:{get:function()return this.lb.j.length}}});ib.prototype.first=ib.prototype.first;ib.prototype.hasNext=ib.prototype.fd;ib.prototype.next=ib.prototype.next; ib.prototype.reset=ib.prototype.reset;ib.className="ListIterator";function jb(a)jb.prototype.reset=function();jb.prototype.next=function();jb.prototype.fd=function(){return this.next()}; jb.prototype.first=function(){var a=this.lb;this.ia=a.xa;var b=a.j;this.Oa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};jb.prototype.any=function(a);jb.prototype.all=function(a); jb.prototype.each=function(a);jb.prototype.map=function(a){var b=this.lb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.ib();return a.iterator};jb.prototype.filter=function(a)a=new E;a.j=c;a.ib();return a.iterator}; jb.prototype.Ad=function();jb.prototype.toString=function(){return"ListIteratorBackwards("+this.Oa+"/"+this.lb.count+")"};ma.Object.defineProperties(jb.prototype,{iterator:{get:function()},count:{get:function()}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.fd;jb.prototype.next=jb.prototype.next;jb.prototype.reset=jb.prototype.reset; jb.className="ListIteratorBackwards";function E(a){Za(this);this.s=!1;this.j=[];this.xa=0;this.Zg=this.Ga=null;void 0!a&&("function"typeof a||"string"=typeof a?xa():this.addAll(a))}t=E.prototype;t.ib=function();t.freeze=function();t.ea=function();t.toString=function(){return"List()#"+lb(this)};t.add=function(a){if(nulla)return this;this.s&&ua(this,a);this.j.push(a);this.ib();return this}; t.push=function(a){this.add(a)};t.addAll=function(a){if(null=a)return this;this.s&&ua(this);var b=this.j;if(za(a))for(var c=a.length,d=0;d<c;d++)b.push(a[d]);else for(a=a.iterator;a.next();)b.push(a.value);this.ib();return this};t.clear=function(){this.s&&ua(this);this.j.length=0;this.ib()};t.contains=function(a);t.has=function(a){return this.contains(a)};t.indexOf=function(a); t.L=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 ? i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.hd=function(a,b){var c=this.j;(0>a||a>=c.length)&&va(a,"0 ? i < length",E,"setElt:i");this.s&&ua(this,a);c[a]=b};t.set=function(a,b){this.hd(a,b)};t.first=function(){var a=this.j;return 0=a.length?null:a[0]};t.Vb=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this.s&&ua(this);var a=this.j;return 0<a.length?a.pop():null}; E.prototype.any=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(a(b[d]))return!0;return!1};E.prototype.all=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(!a(b[d]))return!1;return!0};E.prototype.each=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)a(b[d]);return this};E.prototype.map=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.j=c;b.ib();return b}; E.prototype.filter=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++)b.j=c;b.ib();return b};t=E.prototype;t.Kb=function(a,b){0>a&&va(a,">= 0",E,"insertAt:i");this.s&&ua(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.ib()};t.remove=function(a){if(null=a)return!1;this.s&&ua(this,a);var b=this.j;a=b.indexOf(a);if(-1=a)return!1;a=b.length-1?b.pop():b.splice(a,1);this.ib();return!0};t.delete=function(a){return this.remove(a)}; t.jb=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 ? i < length",E,"removeAt:i");this.s&&ua(this,a);a=b.length-1?b.pop():b.splice(a,1);this.ib()};t.removeRange=function(a,b){var c=this.j,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.s&&ua(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.ib();return this};E.prototype.copy=function(){var a=new E,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a}; t=E.prototype;t.ma=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Yv=function(){for(var a=new F,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.s&&ua(this);this.j.sort(a);this.ib();return this}; t.$i=function(a,b,c){var d=this.j,e=d.length;void 0=b&&(b=0);void 0=c&&(c=e);this.s&&ua(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&va(b,"0 ? from < length",E,"sortRange:from");if(2=f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.ib()),this;if(0b)if(c>=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a<c;a++)d[a]=b[a];else if(c>=e)for(c=d.slice(b),c.sort(a),a=b;a<e;a++)d[a]=c[a-b];else for(e=d.slice(b,c),e.sort(a),a=b;a<c;a++)d[a]=e[a-b];this.ib();return this}; t.reverse=function(){this.s&&ua(this);this.j.reverse();this.ib();return this}; ma.Object.defineProperties(E.prototype,{_dataArray:{get:function()},count:{get:function()},size:{get:function()},length:{get:function()},iterator:{get:function(){if(0>=this.j.length)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new ib(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return fb;var a=this.Zg;return null!==a?(a.reset(),a):new jb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.$i;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Yv;E.prototype.toArray=E.prototype.ma;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.jb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.Kb; E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Vb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.hd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.L;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ea; E.prototype.freeze=E.prototype.freeze;E.className="List";function nb(a)nb.prototype.reset=function();nb.prototype.next=function();nb.prototype.fd=function(){return this.next()}; nb.prototype.first=function()return null};nb.prototype.any=function(a)return!1};nb.prototype.all=function(a)return!0};nb.prototype.each=function(a); nb.prototype.map=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.na;return c.iterator};nb.prototype.filter=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;)return c.iterator};nb.prototype.Ad=function();nb.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"}; ma.Object.defineProperties(nb.prototype,{iterator:{get:function()},count:{get:function()}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.fd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="SetIterator"; function F(a){Za(this);this.s=!1;this.Eb=;this.Db=0;this.Ga=null;this.xa=0;this.Re=this.ba=null;void 0!==a&&("function"typeof a||"string"=typeof a?xa():this.addAll(a))}t=F.prototype;t.ib=function();t.freeze=function();t.ea=function();t.toString=function(){return"Set()#"+lb(this)}; t.add=function(a){if(nulla)return this;this.s&&ua(this,a);var b=a;ya(a)&&(b=ob(a));void 0this.Eb[b]&&(this.Db++,a=new pb(a,a),this.Eb[b]=a,b=this.Re,null=b?this.ba=a:(a.Bl=b,b.na=a),this.Re=a,this.ib());return this};t.addAll=function(a){if(null=a)return this;this.s&&ua(this);if(za(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this}; t.contains=function(a){if(null=a)return!1;var b=a;return ya(a)&&(b=lb(a),void 0b)?!1:void 0!this.Eb[b]};t.has=function(a){return this.contains(a)};t.Jy=function(a){if(nulla)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Ky=function(a){if(null=a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(); F.prototype.any=function(a){for(var b=this.ba;null!b;){if(a(b.value))return!0;b=b.na}return!1};F.prototype.all=function(a){for(var b=this.ba;null!b;){if(!a(b.value))return!1;b=b.na}return!0};F.prototype.each=function(a){for(var b=this.ba;null!b;)a(b.value),b=b.na;return this};F.prototype.map=function(a){for(var b=new F,c=this.ba;null!c;)b.add(a(c.value)),c=c.na;return b};F.prototype.filter=function(a){for(var b=new F,c=this.ba;null!c;)return b};t=F.prototype; t.remove=function(a){if(null=a)return!1;this.s&&ua(this,a);var b=a;if(ya(a)&&(b=lb(a),void 0=b))return!1;a=this.Eb[b];if(void 0=a)return!1;var c=a.na,d=a.Bl;null!c&&(c.Bl=d);null!d&&(d.na=c);this.ba=a&&(this.ba=c);this.Re=a&&(this.Re=d);delete this.Eb[b];this.Db--;this.ib();return!0};t.delete=function(a){return this.remove(a)}; t.uq=function(a){if(null=a)return this;this.s&&ua(this);if(za(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};t.fA=function(a){if(null=a||0this.count)return this;this.s&&ua(this);var b=new F;b.addAll(a);a=[];for(var c=this.iterator;c.next();)this.uq(a);return this};t.clear=function(){this.s&&ua(this);this.Eb=;this.Db=0;null!this.Ga&&this.Ga.reset();this.Re=this.ba=null;this.ib()}; F.prototype.copy=function(){var a=new F,b=this.Eb,c;for(c in b)a.add(b[c].value);return a};F.prototype.ma=function(){var a=Array(this.Db),b=this.Eb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.Xv=function(){var a=new E,b=this.Eb,c;for(c in b)a.add(b[c].value);return a};function Za(a)function ob(a){var b=a.__gohashid;void 0b&&(b=rb++,a.__gohashid=b);return b}function lb(a) ma.Object.defineProperties(F.prototype,{count:{get:function()},size:{get:function()},iterator:{get:function(){if(0>=this.Db)return fb;var a=this.Ga;return null!a?(a.reset(),a):new nb(this)}}});F.prototype.toList=F.prototype.Xv;F.prototype.toArray=F.prototype.ma;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.fA;F.prototype.removeAll=F.prototype.uq; F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.Ky;F.prototype.containsAll=F.prototype.Jy;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.addAll=F.prototype.addAll;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ea;F.prototype.freeze=F.prototype.freeze;var rb=1;F.className="Set";F.uniqueHash=Za;F.hashIdUnique=ob;F.hashId=lb; function sb(a)sb.prototype.reset=function();sb.prototype.next=function();sb.prototype.fd=function(){return this.next()};sb.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;return null!a?(this.ka=a,this.value=this.key=a=a.key):null}; sb.prototype.any=function(a)return!1};sb.prototype.all=function(a)return!0};sb.prototype.each=function(a);sb.prototype.map=function(a){var b=this.fa;this.ka=null;var c=new E;for(b=b.ba;null!b;)c.add(a(b.key)),b=b.na;return c.iterator}; sb.prototype.filter=function(a){var b=this.fa;this.ka=null;var c=new E;for(b=b.ba;null!b;)return c.iterator};sb.prototype.Ad=function();sb.prototype.toString=function(){return null!this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};ma.Object.defineProperties(sb.prototype,{iterator:{get:function()},count:{get:function()}}); sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.fd;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapKeySetIterator";function tb(a){F.call(this);Za(this);this.s=!0;this.fa=a}la(tb,F);t=tb.prototype;t.freeze=function();t.ea=function();t.toString=function(){return"MapKeySet("+this.fa.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.fa.contains(a)}; t.has=function(a){return this.contains(a)};t.remove=function(){B("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){B("This Set is read-only: "+this.toString())};t.first=function(){var a=this.fa.ba;return null!a?a.key:null};tb.prototype.any=function(a){for(var b=this.fa.ba;null!b;){if(a(b.key))return!0;b=b.na}return!1};tb.prototype.all=function(a){for(var b=this.fa.ba;null!b;){if(!a(b.key))return!1;b=b.na}return!0}; tb.prototype.each=function(a){for(var b=this.fa.ba;null!b;)a(b.key),b=b.na;return this};tb.prototype.map=function(a){for(var b=new F,c=this.fa.ba;null!c;)b.add(a(c.key)),c=c.na;return b};tb.prototype.filter=function(a){for(var b=new F,c=this.fa.ba;null!c;)return b};tb.prototype.copy=function(){return new tb(this.fa)};tb.prototype.Yv=function(){var a=new F,b=this.fa.Eb,c;for(c in b)a.add(b[c].key);return a}; tb.prototype.ma=function(){var a=this.fa.Eb,b=Array(this.fa.Db),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};tb.prototype.Xv=function(){var a=new E,b=this.fa.Eb,c;for(c in b)a.add(b[c].key);return a};ma.Object.defineProperties(tb.prototype,{count:{get:function()},size:{get:function()},iterator:{get:function(){return 0>=this.fa.Db?fb:new sb(this.fa)}}}); tb.prototype.toList=tb.prototype.Xv;tb.prototype.toArray=tb.prototype.ma;tb.prototype.toSet=tb.prototype.Yv;tb.prototype.first=tb.prototype.first;tb.prototype.clear=tb.prototype.clear;tb.prototype["delete"]=tb.prototype.delete;tb.prototype.remove=tb.prototype.remove;tb.prototype.has=tb.prototype.has;tb.prototype.contains=tb.prototype.contains;tb.prototype.add=tb.prototype.add;tb.prototype.thaw=tb.prototype.ea;tb.prototype.freeze=tb.prototype.freeze;tb.className="MapKeySet"; function ub(a)ub.prototype.reset=function();ub.prototype.next=function();ub.prototype.fd=function(){return this.next()}; ub.prototype.first=function()return null};ub.prototype.any=function(a)return!1};ub.prototype.all=function(a)return!0};ub.prototype.each=function(a); ub.prototype.map=function(a){var b=this.fa;this.ka=b.Qe=null;var c=new E;for(b=b.ba;null!b;)c.add(a(b.value)),b=b.na;return c.iterator};ub.prototype.filter=function(a){var b=this.fa;this.ka=b.Qe=null;var c=new E;for(b=b.ba;null!b;)return c.iterator};ub.prototype.Ad=function();ub.prototype.toString=function(){return null!this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"}; ma.Object.defineProperties(ub.prototype,{iterator:{get:function()},count:{get:function()}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.fd;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapValueSetIterator";function pb(a,b)pb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; pb.className="KeyValuePair";function vb(a)vb.prototype.reset=function();vb.prototype.next=function();vb.prototype.fd=function(){return this.next()}; vb.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;return null!a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};vb.prototype.any=function(a)return!1};vb.prototype.all=function(a)return!0};vb.prototype.each=function(a); vb.prototype.map=function(a){var b=this.fa;this.ka=b.Ga=null;var c=new E;for(b=b.ba;null!b;)c.add(a(b)),b=b.na;return c.iterator};vb.prototype.filter=function(a){var b=this.fa;this.ka=b.Ga=null;var c=new E;for(b=b.ba;null!b;)a(b)&&c.add(b),b=b.na;return c.iterator};vb.prototype.Ad=function();vb.prototype.toString=function(){return null!this.ka?"MapIterator@"+this.ka:"MapIterator"}; ma.Object.defineProperties(vb.prototype,{iterator:{get:function()},count:{get:function()}});vb.prototype.first=vb.prototype.first;vb.prototype.hasNext=vb.prototype.fd;vb.prototype.next=vb.prototype.next;vb.prototype.reset=vb.prototype.reset;vb.className="MapIterator"; function G(a){Za(this);this.s=!1;this.Eb=;this.Db=0;this.Qe=this.Ga=null;this.xa=0;this.Re=this.ba=null;void 0!a&&("function"typeof a||"string"=typeof a?xa():this.addAll(a))}t=G.prototype;t.ib=function();t.freeze=function();t.ea=function();t.toString=function(){return"Map()#"+lb(this)}; t.add=function(a,b){this.s&&ua(this,a);var c=a;ya(a)&&(c=ob(a));var d=this.Eb[c];void 0d?(this.Db++,a=new pb(a,b),this.Eb[c]=a,c=this.Re,null=c?this.ba=a:(a.Bl=c,c.na=a),this.Re=a,this.ib()):d.value=b;return this};t.set=function(a,b){return this.add(a,b)}; t.addAll=function(a){if(null=a)return this;if(za(a))for(var b=a.length,c=0;c<b;c++)else if(a instanceof G)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function();G.prototype.any=function(a){for(var b=this.ba;null!b;){if(a(b))return!0;b=b.na}return!1};G.prototype.all=function(a){for(var b=this.ba;null!b;){if(!a(b))return!1;b=b.na}return!0}; G.prototype.each=function(a){for(var b=this.ba;null!b;)a(b),b=b.na;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!c;)b.add(c.key,a(c)),c=c.na;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ba;null!c;)a(c)&&b.add(c.key,c.value),c=c.na;return b};t=G.prototype;t.contains=function(a){var b=a;return ya(a)&&(b=lb(a),void 0=b)?!1:void 0!this.Eb[b]};t.has=function(a){return this.contains(a)}; t.H=function(a){var b=a;if(ya(a)&&(b=lb(a),void 0=b))return null;a=this.Eb[b];return void 0=a?null:a.value};t.get=function(a){return this.H(a)};t.remove=function(a){if(null=a)return!1;this.s&&ua(this,a);var b=a;if(ya(a)&&(b=lb(a),void 0=b))return!1;a=this.Eb[b];if(void 0=a)return!1;var c=a.na,d=a.Bl;null!c&&(c.Bl=d);null!d&&(d.na=c);this.ba=a&&(this.ba=c);this.Re=a&&(this.Re=d);delete this.Eb[b];this.Db--;this.ib();return!0};t.delete=function(a){return this.remove(a)}; t.clear=function(){this.s&&ua(this);this.Eb=;this.Db=0;null!this.Ga&&this.Ga.reset();null!this.Qe&&this.Qe.reset();this.Re=this.ba=null;this.ib()};G.prototype.copy=function(){var a=new G,b=this.Eb,c;for(c in b)return a};G.prototype.ma=function(){var a=this.Eb,b=Array(this.Db),c=0,d;for(d in a){var e=a[d];b[c]=new pb(e.key,e.value);c++}return b};G.prototype.Af=function(){return new tb(this)}; ma.Object.defineProperties(G.prototype,{count:{get:function()},size:{get:function()},iterator:{get:function(){if(0>=this.count)return fb;var a=this.Ga;return null!a?(a.reset(),a):new vb(this)}},iteratorKeys:{get:function(){return 0>=this.count?fb:new sb(this)}},iteratorValues:{get:function(){if(0>=this.count)return fb; var a=this.Qe;return null!a?(a.reset(),a):new ub(this)}}});G.prototype.toKeySet=G.prototype.Af;G.prototype.toArray=G.prototype.ma;G.prototype.clear=G.prototype.clear;G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.get=G.prototype.get;G.prototype.getValue=G.prototype.H;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.first=G.prototype.first;G.prototype.addAll=G.prototype.addAll;G.prototype.set=G.prototype.set; G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;G.className="Map";function H(a,b){void 0=a?this.y=this.x=0:"number"typeof a&&"number"typeof b?(this.x=a,this.y=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}H.prototype.assign=function(a);H.prototype.h=function(a,b);H.prototype.Cg=function(a,b); H.prototype.set=function(a);H.prototype.copy=function(){var a=new H;a.x=this.x;a.y=this.y;return a};t=H.prototype;t.ca=function();t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function();t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function wb(a){if("string"typeof a){a=a.split(" ");for(var b=0,c=0;===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;=a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new H(c,e)}return new H}function xb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof H?this.xa.x&&this.ya.y:!1};t.Li=function(a,b);t.Ma=function(a){return I.w(this.x,a.x)&&I.w(this.y,a.y)}; t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.Xd=function(a);t.offset=function(a,b){this.x+=a;this.y+=b;return this};H.prototype.rotate=function(a){if(0a)return this;var b=this.x,c=this.y;if(0=b&&0=c)return this;360<=a?a-=360:0>a&&(a+=360);if(90=a)else 180=a?(a=-1,d=0):270=a?(a=0,d=-1):(d=aMath.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=ab-dc;this.y=db+ac;return this};t=H.prototype; t.scale=function(a,b){this.x=a;this.y*=b;return this};t.we=function(a){var b=a.x-this.x;a=a.y-this.y;return bb+aa};t.ed=function(a,b){a-=this.x;b-=this.y;return aa+bb};t.normalize=function();t.Sa=function(a){return yb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return yb(a-this.x,b-this.y)}; function yb(a,b){if(0=a)return 0<b?90:0>b?270:0;if(0=b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}t.$z=function(a,b,c,d){I.Xi(a,b,c,d,this.x,this.y,this);return this};t.aA=function(a,b){I.Xi(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.lA=function(a,b,c,d){I.aq(this.x,this.y,a,b,c,d,this);return this};t.mA=function(a,b){I.aq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this}; t.Zi=function(a,b);t.sk=function(a,b,c,d,e);t.transform=function(a){a.ra(this);return this};function zb(a,b){b.Td(a);return a}function Ab(a,b,c,d,e,f){var g=e-c,h=f-d,k=gg+hh;c-=a;d-=b;var l=-cg-dh;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(cc+dd,gg+hh);a=gd-hc;return aa/k}function Bb(a,b,c,d){a=c-a;b=d-b;return aa+bb} function Cb(a,b,c,d){a=c-a;b=d-b;if(0=a)return 0<b?90:0>b?270:0;if(0=b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}t.v=function(){return isFinite(this.x)&&isFinite(this.y)};H.alloc=function(){var a=Eb.pop();return void 0=a?new H:a};H.allocAt=function(a,b){var c=Eb.pop();if(void 0=c)return new H(a,b);c.x=a;c.y=b;return c};H.free=function(a){Eb.push(a)};H.prototype.isReal=H.prototype.v; H.prototype.setSpot=H.prototype.sk;H.prototype.setRectSpot=H.prototype.Zi;H.prototype.snapToGridPoint=H.prototype.mA;H.prototype.snapToGrid=H.prototype.lA;H.prototype.projectOntoLineSegmentPoint=H.prototype.aA;H.prototype.projectOntoLineSegment=H.prototype.$z;H.prototype.direction=H.prototype.direction;H.prototype.directionPoint=H.prototype.Sa;H.prototype.normalize=H.prototype.normalize;H.prototype.distanceSquared=H.prototype.ed;H.prototype.distanceSquaredPoint=H.prototype.we;H.prototype.scale=H.prototype.scale; H.prototype.rotate=H.prototype.rotate;H.prototype.offset=H.prototype.offset;H.prototype.subtract=H.prototype.Xd;H.prototype.add=H.prototype.add;H.prototype.equalsApprox=H.prototype.Ma;H.prototype.equalTo=H.prototype.Li;H.prototype.equals=H.prototype.A;H.prototype.set=H.prototype.set;H.prototype.setTo=H.prototype.Cg;var Fb=null,Gb=null,Hb=null,Ib=null,Jb=null,Eb=[];H.className="Point";H.parse=wb;H.stringify=xb;H.distanceLineSegmentSquared=Ab;H.distanceSquared=Bb;H.direction=Cb; H.Origin=Fb=(new H(0,0)).ca();H.InfiniteTopLeft=Gb=(new H(-Infinity,-Infinity)).ca();H.InfiniteBottomRight=Hb=(new H(Infinity,Infinity)).ca();H.SixPoint=Ib=(new H(6,6)).ca();H.NoPoint=Jb=(new H(NaN,NaN)).ca();H.parse=wb;H.stringify=xb;H.distanceLineSegmentSquared=Ab;H.distanceSquared=Bb;H.direction=Cb; function Kb(a,b){void 0=a?this.height=this.width=0:"number"typeof a&&(0<=a||isNaN(a))&&"number"typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Lb,Mb,Nb,Ob,Qb,Rb,Sb;Kb.prototype.assign=function(a);Kb.prototype.h=function(a,b);Kb.prototype.Cg=function(a,b); Kb.prototype.set=function(a);Kb.prototype.copy=function(){var a=new Kb;a.width=this.width;a.height=this.height;return a};t=Kb.prototype;t.ca=function();t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function();t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function Tb(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 Kb(c,e)}return new Kb}function Ub(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Kb?this.widtha.width&&this.heighta.height:!1};t.Li=function(a,b); t.Ma=function(a){return I.w(this.width,a.width)&&I.w(this.height,a.height)};t.v=function(){return isFinite(this.width)&&isFinite(this.height)};Kb.alloc=function(){var a=Vb.pop();return void 0a?new Kb:a};Kb.free=function(a){Vb.push(a)};Kb.prototype.isReal=Kb.prototype.v;Kb.prototype.equalsApprox=Kb.prototype.Ma;Kb.prototype.equalTo=Kb.prototype.Li;Kb.prototype.equals=Kb.prototype.A;Kb.prototype.set=Kb.prototype.set;Kb.prototype.setTo=Kb.prototype.Cg;var Vb=[];Kb.className="Size";Kb.parse=Tb; Kb.stringify=Ub;Kb.ZeroSize=Lb=(new Kb(0,0)).ca();Kb.OneSize=Mb=(new Kb(1,1)).ca();Kb.SixSize=Nb=(new Kb(6,6)).ca();Kb.EightSize=Ob=(new Kb(8,8)).ca();Kb.TenSize=Qb=(new Kb(10,10)).ca();Kb.InfiniteSize=Rb=(new Kb(Infinity,Infinity)).ca();Kb.NoSize=Sb=(new Kb(NaN,NaN)).ca();Kb.parse=Tb;Kb.stringify=Ub; function M(a,b,c,d){void 0=a?this.height=this.width=this.y=this.x=0:a instanceof H?(c=a.x,a=a.y,b instanceof H?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof Kb?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):B("Incorrect arguments supplied to Rect constructor")):"number"typeof a&&"number"typeof b&&"number"typeof c&&(0<=c||isNaN(c))&&"number"typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c, this.height=d):B("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}t=M.prototype;t.assign=function(a);t.h=function(a,b,c,d);function Xb(a,b,c)t.Cg=function(a,b,c,d);t.set=function(a); t.jd=function(a);t.jA=function(a);M.prototype.copy=function(){var a=new M;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function();t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(); t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function Yb(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 Zb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.A=function(a){return a instanceof M?this.xa.x&&this.ya.y&&this.widtha.width&&this.heighta.height:!1};t.Li=function(a,b,c,d);t.Ma=function(a){return I.w(this.x,a.x)&&I.w(this.y,a.y)&&I.w(this.width,a.width)&&I.w(this.height,a.height)}; function bc(a,b){return I.Z(a.x,b.x)&&I.Z(a.y,b.y)&&I.Z(a.width,b.width)&&I.Z(a.height,b.height)}t.$=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.nf=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0c&&(c=0);void 0d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height}; t.reset=function();t.offset=function(a,b){this.x+=a;this.y+=b;return this};t.Tc=function(a,b){return cc(this,b,a,b,a)};t.Tp=function(a){return cc(this,a.top,a.right,a.bottom,a.left)};t.Wv=function(a){return cc(this,-a.top,-a.right,-a.bottom,-a.left)};t.Dz=function(a,b,c,d){return cc(this,a,b,c,d)};function cc(a,b,c,d,e) t.Hz=function(a){return dc(this,a.x,a.y,a.width,a.height)};t.pv=function(a,b,c,d){return dc(this,a,b,c,d)};function dc(a,b,c,d,e)t.Gc=function(a){return this.qv(a.x,a.y,a.width,a.height)}; t.qv=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!e&&Infinity!c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!a&&Infinity!d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function ec(a,b,c){var d=a.width,e=a.x,f=b.x-c;if(e>b.width+c+c+f||f>d+e)return!1;d=a.height;a=a.y;e=b.y-c;return a>b.height+c+c+e||e>d+a?!1:!0}t.Ce=function(a){return fc(this,a.x,a.y,0,0)};t.Hc=function(a){return fc(this,a.x,a.y,a.width,a.height)}; t.cw=function(a,b,c,d){void 0=c&&(c=0);void 0=d&&(d=0);return fc(this,a,b,c,d)};function fc(a,b,c,d,e)t.sk=function(a,b,c);function kc(a,b,c,d,e,f,g,h){void 0=g&&(g=0);void 0=h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d} function lc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.v=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Jz=function(){return 0=this.width&&0=this.height};M.alloc=function(){var a=mc.pop();return void 0=a?new M:a};M.allocAt=function(a,b,c,d){var e=mc.pop();return void 0=e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){mc.push(a)}; ma.Object.defineProperties(M.prototype,{left:{get:function(),set:function(a)},top:{get:function(),set:function(a)},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{ get:function(){return new H(this.x,this.y)},set:function(a)},size:{get:function(){return new Kb(this.width,this.height)},set:function(a)},center:{get:function(){return new H(this.x+this.width/2,this.y+this.height/2)},set:function(a)},centerX:{get:function(){return this.x+this.width/ 2},set:function(a)},centerY:{get:function(){return this.y+this.height/2},set:function(a)}});M.prototype.isEmpty=M.prototype.Jz;M.prototype.isReal=M.prototype.v;M.prototype.setSpot=M.prototype.sk;M.prototype.union=M.prototype.cw;M.prototype.unionRect=M.prototype.Hc;M.prototype.unionPoint=M.prototype.Ce;M.prototype.intersects=M.prototype.qv;M.prototype.intersectsRect=M.prototype.Gc;M.prototype.intersect=M.prototype.pv; M.prototype.intersectRect=M.prototype.Hz;M.prototype.grow=M.prototype.Dz;M.prototype.subtractMargin=M.prototype.Wv;M.prototype.addMargin=M.prototype.Tp;M.prototype.inflate=M.prototype.Tc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains;M.prototype.containsRect=M.prototype.nf;M.prototype.containsPoint=M.prototype.$;M.prototype.equalsApprox=M.prototype.Ma;M.prototype.equalTo=M.prototype.Li;M.prototype.equals=M.prototype.A;M.prototype.setSize=M.prototype.jA; M.prototype.setPoint=M.prototype.jd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Cg;var nc=null,oc=null,mc=[];M.className="Rect";M.parse=Yb;M.stringify=Zb;M.contains=kc;M.intersects=lc;M.ZeroRect=nc=(new M(0,0,0,0)).ca();M.NoRect=oc=(new M(NaN,NaN,NaN,NaN)).ca();M.parse=Yb;M.stringify=Zb;M.contains=kc;M.intersects=lc; function pc(a,b,c,d){void 0=a?this.left=this.bottom=this.right=this.top=0:void 0=b?this.left=this.bottom=this.right=this.top=a:void 0=c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!d?(this.top=a,this.right=b,this.bottom=c,this.left=d):B("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}pc.prototype.assign=function(a); pc.prototype.Cg=function(a,b,c,d);pc.prototype.set=function(a);pc.prototype.copy=function(){var a=new pc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=pc.prototype;t.ca=function();t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()}; t.freeze=function();t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function qc(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 pc;for(var e=NaN;a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new pc(c);for(var f=NaN;===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new pc(c,e);for(var g=NaN;=a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new pc(c,e):new pc(c,e,f,g)}return new pc} function rc(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.A=function(a){return a instanceof pc?this.topa.top&&this.righta.right&&this.bottom=a.bottom&&this.left=a.left:!1};t.Li=function(a,b,c,d); t.Ma=function(a){return I.w(this.top,a.top)&&I.w(this.right,a.right)&&I.w(this.bottom,a.bottom)&&I.w(this.left,a.left)};t.v=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};pc.alloc=function(){var a=sc.pop();return void 0=a?new pc:a};pc.free=function(a){sc.push(a)};pc.prototype.isReal=pc.prototype.v;pc.prototype.equalsApprox=pc.prototype.Ma;pc.prototype.equalTo=pc.prototype.Li;pc.prototype.equals=pc.prototype.A;pc.prototype.set=pc.prototype.set; pc.prototype.setTo=pc.prototype.Cg;var tc=null,uc=null,sc=[];pc.className="Margin";pc.parse=qc;pc.stringify=rc;pc.ZeroMargin=tc=(new pc(0,0,0,0)).ca();pc.TwoMargin=uc=(new pc(2,2,2,2)).ca();pc.parse=qc;pc.stringify=rc;function O(a,b,c,d){void 0=a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0=b&&(b=0),void 0=c&&(c=0),void 0=d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.s=!1} var wc,xc,yc,zc,Ac,Bc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Pc,Qc,Rc,Sc,Tc,Uc,Xc,Yc,Zc,$c,ad,bd,cd,dd,ed,fd,gd,hd,id,jd;O.prototype.assign=function(a);O.prototype.Cg=function(a,b,c,d);O.prototype.set=function(a); O.prototype.copy=function(){var a=new O;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};t=O.prototype;t.ca=function();t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function();t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function kd(a,b) function pd(a){if("string"typeof a){a=a.trim();if("None"a)return wc;if("TopLeft"a)return xc;if("Top"a||"TopCenter"a||"MiddleTop"a)return yc;if("TopRight"a)return zc;if("Left"a||"LeftCenter"a||"MiddleLeft"a)return Ac;if("Center"a)return Bc;if("Right"a||"RightCenter"a||"MiddleRight"a)return Ec;if("BottomLeft"a)return Fc;if("Bottom"a||"BottomCenter"a||"MiddleBottom"a)return Gc;if("BottomRight"==a)return Hc;if("TopSide"=a)return Ic;if("LeftSide" a)return Jc;if("RightSide"a)return Kc;if("BottomSide"a)return Lc;if("TopBottomSides"a)return Mc;if("LeftRightSides"a)return Nc;if("TopLeftSides"a)return Pc;if("TopRightSides"a)return Qc;if("BottomLeftSides"a)return Rc;if("BottomRightSides"a)return Sc;if("NotTopSide"a)return Tc;if("NotLeftSide"==a)return Uc;if("NotRightSide"==a)return Xc;if("NotBottomSide"a)return Yc;if("AllSides"a)return Zc;if("Default"a)return $c;a=a.split(" ");for(var b=0,c=0;===a[b];)b++; var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var f=0;===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(f=parseFloat(d));for(var g=0;a[b];)b++;d=a[b++];void 0!d&&0<d.length&&(g=parseFloat(d));return new O(c,e,f,g)}return new O}function qd(a){return a.eb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()} t.toString=function(){return this.eb()?0this.offsetX&&0this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.A(wc)?"None":this.A(xc)?"TopLeft":this.A(yc)?"Top":this.A(zc)?"TopRight":this.A(Ac)?"Left":this.A(Bc)?"Center":this.A(Ec)?"Right":this.A(Fc)?"BottomLeft":this.A(Gc)?"Bottom":this.A(Hc)?"BottomRight":this.A(Ic)?"TopSide":this.A(Jc)?"LeftSide":this.A(Kc)?"RightSide":this.A(Lc)?"BottomSide":this.A(Mc)?"TopBottomSides":this.A(Nc)? "LeftRightSides":this.A(Pc)?"TopLeftSides":this.A(Qc)?"TopRightSides":this.A(Rc)?"BottomLeftSides":this.A(Sc)?"BottomRightSides":this.A(Tc)?"NotTopSide":this.A(Uc)?"NotLeftSide":this.A(Xc)?"NotRightSide":this.A(Yc)?"NotBottomSide":this.A(Zc)?"AllSides":this.A($c)?"Default":"None"};t.A=function(a){return a instanceof O?(this.xa.x||isNaN(this.x)&&isNaN(a.x))&&(this.ya.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetXa.offsetX&&this.offsetYa.offsetY:!1}; t.Av=function(){return new O(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};t.sf=function(a){if(!this.uf())return!1;if(!a.uf())if(a.A(ad))a=Jc;else if(a.A(bd))a=Kc;else if(a.A(cd))a=Ic;else if(a.A(dd))a=Lc;else return!1;a=a.offsetY;return(this.offsetY&a)=a};t.eb=function(){return!isNaN(this.x)&&!isNaN(this.y)};t.jc=function(){return isNaN(this.x)||isNaN(this.y)};t.uf=function(){return isNaN(this.x)&&isNaN(this.y)&&1this.offsetX&&0!this.offsetY}; t.it=function(){return isNaN(this.x)&&isNaN(this.y)&&0this.offsetX&&0this.offsetY};t.Mb=function(){return isNaN(this.x)&&isNaN(this.y)&&-1this.offsetX&&0this.offsetY};O.alloc=function(){var a=rd.pop();return void 0a?new O:a};O.free=function(a){rd.push(a)};O.prototype.isDefault=O.prototype.Mb;O.prototype.isNone=O.prototype.it;O.prototype.isSide=O.prototype.uf;O.prototype.isNoSpot=O.prototype.jc;O.prototype.isSpot=O.prototype.eb;O.prototype.includesSide=O.prototype.sf; O.prototype.opposite=O.prototype.Av;O.prototype.equals=O.prototype.A;O.prototype.set=O.prototype.set;O.prototype.setTo=O.prototype.Cg;var rd=[];O.className="Spot";O.parse=pd;O.stringify=qd;O.None=wc=kd(new O(0,0,0,0),0).ca();O.Default=$c=kd(new O(0,0,-1,0),-1).ca();O.TopLeft=xc=(new O(0,0,0,0)).ca();O.TopCenter=yc=(new O(.5,0,0,0)).ca();O.TopRight=zc=(new O(1,0,0,0)).ca();O.LeftCenter=Ac=(new O(0,.5,0,0)).ca();O.Center=Bc=(new O(.5,.5,0,0)).ca();O.RightCenter=Ec=(new O(1,.5,0,0)).ca(); O.BottomLeft=Fc=(new O(0,1,0,0)).ca();O.BottomCenter=Gc=(new O(.5,1,0,0)).ca();O.BottomRight=Hc=(new O(1,1,0,0)).ca();O.MiddleTop=ed=yc;O.MiddleLeft=fd=Ac;O.MiddleRight=gd=Ec;O.MiddleBottom=hd=Gc;O.Top=cd=yc;O.Left=ad=Ac;O.Right=bd=Ec;O.Bottom=dd=Gc;O.TopSide=Ic=kd(new O(0,0,1,1),1).ca();O.LeftSide=Jc=kd(new O(0,0,1,2),1).ca();O.RightSide=Kc=kd(new O(0,0,1,4),1).ca();O.BottomSide=Lc=kd(new O(0,0,1,8),1).ca();O.TopBottomSides=Mc=kd(new O(0,0,1,9),1).ca();O.LeftRightSides=Nc=kd(new O(0,0,1,6),1).ca(); O.TopLeftSides=Pc=kd(new O(0,0,1,3),1).ca();O.TopRightSides=Qc=kd(new O(0,0,1,5),1).ca();O.BottomLeftSides=Rc=kd(new O(0,0,1,10),1).ca();O.BottomRightSides=Sc=kd(new O(0,0,1,12),1).ca();O.NotTopSide=Tc=kd(new O(0,0,1,14),1).ca();O.NotLeftSide=Uc=kd(new O(0,0,1,13),1).ca();O.NotRightSide=Xc=kd(new O(0,0,1,11),1).ca();O.NotBottomSide=Yc=kd(new O(0,0,1,7),1).ca();O.AllSides=Zc=kd(new O(0,0,1,15),1).ca();id=(new O(.156,.156)).ca();jd=(new O(.844,.844)).ca();O.parse=pd;O.stringify=qd; function sd()sd.prototype.set=function(a);sd.prototype.copy=function(){var a=new sd;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};t=sd.prototype;t.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}; t.A=function(a){return a instanceof sd?this.m11a.m11&&this.m12a.m12&&this.m21a.m21&&this.m22a.m22&&this.dxa.dx&&this.dya.dy:!1};t.gt=function(){return 0this.dx&&0this.dy&&1this.m11&&0this.m12&&0this.m21&&1this.m22};t.reset=function(); t.multiply=function(a); t.wv=function(a); t.ft=function(); sd.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0a)return this;this.translate(b,c);if(90a)else 180a?(a=-1,d=0):270a?(a=0,d=-1):(d=aMath.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12a+this.m22d,f=this.m11-d+this.m21a,g=this.m12-d+this.m22a;this.m11=this.m11a+this.m21d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=sd.prototype;t.translate=function(a,b){this.dx+=this.m11a+this.m21b;this.dy+=this.m12a+this.m22*b;return this}; t.scale=function(a,b){void 0b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.ra=function(a){var b=a.x,c=a.y;return a.h(bthis.m11+cthis.m21+this.dx,bthis.m12+cthis.m22+this.dy)};t.Td=function(a){var b=1/(this.m11this.m22-this.m12this.m21),c=a.x,d=a.y;return a.h(cthis.m22b+d-this.m21b+b*(this.m21this.dy-this.m22this.dx),c-this.m12b+dthis.m11b+b*(this.m12this.dx-this.m11this.dy))}; t.bw=function(a);sd.alloc=function(){var a=td.pop();return void 0a?new sd:a}; sd.free=function(a){td.push(a)};sd.prototype.transformRect=sd.prototype.bw;sd.prototype.invertedTransformPoint=sd.prototype.Td;sd.prototype.transformPoint=sd.prototype.ra;sd.prototype.scale=sd.prototype.scale;sd.prototype.translate=sd.prototype.translate;sd.prototype.rotate=sd.prototype.rotate;sd.prototype.invert=sd.prototype.ft;sd.prototype.multiplyInverted=sd.prototype.wv;sd.prototype.multiply=sd.prototype.multiply;sd.prototype.reset=sd.prototype.reset;sd.prototype.isIdentity=sd.prototype.gt; sd.prototype.equals=sd.prototype.A;sd.prototype.set=sd.prototype.set;var td=[];sd.className="Transform";sd.xF="54a702f3e53909c447824c6706603faf4c"; var I={sA:"7da71ca0ad381e90",Fg:(Math.sqrt(2)-1)/3*4,ow:null,sqrt:function(a){if(0>=a)return 0;var b=I.ow;if(nullb)return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},w:function(a,b),Z:function(a,b){a-=b;return 5E-8>a&&-5E-8<a},Wb:function(a,b,c,d,e,f,g){0>=e&&(e=1E-6);if(a<c)else h=c,k=a;if(b<d)else l=d,m=b;if(ac)return l<=g&&g<=m&&a-e<=f&&f<=a+e;if(bd)return h<= f&&f<=k&&b-e<=g&&g<=b+e;k+=e;h-=e;if(h<=f&&f<=k&&(m+=e,l-=e,l<=g&&g<=m))if(k-h>m-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},Ms:function(a,b,c,d,e,f,g,h,k,l,m,n){if(I.Wb(a,b,g,h,n,c,d)&&I.Wb(a,b,g,h,n,e,f))return I.Wb(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var v=(d+q)/2,w=(c+u)/2;return I.Ms(a, b,p,r,d,c,v,w,k,l,m,n)||I.Ms(v,w,q,u,e,f,g,h,k,l,m,n)},Fy:function(a,b,c,d,e,f,g,h,k),Ey:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Cb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Xl:function(a,b,c,d,e,f,g,h,k,l){if(I.Wb(a,b,g,h,k,c,d)&&I.Wb(a,b,g,h,k,e,f))fc(l,a,b,0,0),fc(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;I.Xl(a,b,m,n,d,c,q,u,k,l);I.Xl(q,u,p,r,e,f,g,h,k,l)}return l},ve:function(a,b,c,d,e,f,g,h,k,l){if(I.Wb(a,b,g,h,k,c,d)&&I.Wb(a,b,g,h,k,e,f))0l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);elsereturn l},Dv:function(a,b,c,d,e,f,g,h,k,l){if(I.Wb(a,b,e,f,l,c,d))return I.Wb(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 I.Dv(a,b,m,n,p,r,g,h,k,l)||I.Dv(p,r,c,d,e,f,g,h,k,l)},yA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},Cv:function(a,b,c,d,e,f,g,h){if(I.Wb(a,b,e,f,g,c,d))fc(h,a,b,0,0),fc(h,e,f,0,0);elsereturn h},rq:function(a,b,c,d,e,f,g,h){if(I.Wb(a,b,e,f,g,c,d))0=h.length&&(h.push(a), h.push(b)),h.push(e),h.push(f);elsereturn h},Up:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(I.Wb(a,b,g,h,p,c,d)&&I.Wb(a,b,g,h,p,e,f))else if(a<g?h=a:(h=g,g=a),p<h||p>g)return!1;r.h(p,q);return!0}q= (a+c)/2;var u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+g)/2;f=(f+h)/2;var v=(q+c)/2,w=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var y=(v+c)/2,z=(w+d)/2,A=(m-k)(m-k)+(n-l)(n-l),C=!1;I.Up(a,b,q,u,v,w,y,z,k,l,m,n,p,r)&&(a=(r.x-k)(r.x-k)+(r.y-l)(r.y-l),a<A&&(A=a,C=!0));a=r.x;b=r.y;I.Up(y,z,c,d,e,f,g,h,k,l,m,n,p,r)&&((r.x-k)(r.x-k)+(r.y-l)(r.y-l)<A?C=!0:r.h(a,b));return C},Vp:function(a,b,c,d,e,f,g,h,k,l,m,n,p){var r=0;if(I.Wb(a,b,g,h,p,c,d)&&I.Wb(a,b,g,h,p,e,f)){p=(a-g)(l-n)-(b-h)(k-m);if(0=p)return r;var q=((a* h-bg)(k-m)-(a-g)(kn-lm))/p,u=((ah-bg)(l-n)-(b-h)(kn-lm))/p;if(q>=m)return r;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(b<h?(a=b,b=h):a=h,u<a||u>b)return r}else if(a<g?(b=a,a=g):b=g,q<b||q>a)return r;0<p?r++:0>p&&r--}elsereturn r},Xi:function(a,b,c,d,e,f,g){if(I.Z(a,c)){b<d?(c=b,b=d):c=d;if(f<c)return g.h(a, c),!1;if(f>b)return g.h(a,b),!1;g.h(a,f);return!0}if(I.Z(b,d)){a<c?(d=a,a=c):d=c;if(e<d)return g.h(d,b),!1;if(e>a)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.000005<e)return g.h(c,d),!1;g.h(a+e(c-a),b+e*(d-b));return!0},ze:function(a,b,c,d,e,f,g,h,k){if(I.w(a,c)&&I.w(b,d))return k.h(a,b),!1;if(I.Z(e,g))return I.Z(a,c)?(I.Xi(a,b,c,d,e,f,k),!1):I.Xi(a,b,c,d,e,(d-b)/(c-a)(e-a)+b,k);h=(h-f)/(g-e);if(I.Z(a,c)){c=h(a-e)+ f;b<d?(e=b,b=d):e=d;if(c<e)return k.h(a,e),!1;if(c>b)return k.h(a,b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(I.Z(h,g))return I.Xi(a,b,c,d,e,f,k),!1;e=(ga-he+f-b)/(g-h);if(I.Z(g,0)){a<c?(d=a,a=c):d=c;if(e<d)return k.h(d,b),!1;if(e>a)return k.h(a,b),!1;k.h(e,b);return!0}return I.Xi(a,b,c,d,e,g*(e-a)+b,k)},xA:function(a,b,c,d,e){return I.ze(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},wA:function(a,b,c,d,e,f,g,h,k,l){function m(c,d)var n=Infinity;m(k.x,k.y); var p=0,r=0,q=0,u=0;e<g?(p=e,r=g):(p=g,r=e);f<h?(q=e,u=g):(q=g,u=e);p=(r-p)/2+l;l=(u-q)/2+l;e=(e+g)/2;f=(f+h)/2;if(0=p||0=l)return k;if(.5>(c>a?c-a:a-c)){p=1-(c-e)(c-e)/(pp);if(0>p)return k;p=Math.sqrt(p);d=-lp+f;m(c,lp+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(pp)+cc/(ll);h=2c*(b-ca)/(ll)-2cf/(ll)-2e/(pp);p=hh-4d(2caf/(ll)-2bf/(ll)+ff/(ll)+ee/(pp)-1+(b-ca)(b-ca)/(ll));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2d);m(l,cl-ca+b);p=(-h-p)/(2d);m(p,cp-ca+b)}return k}, Sc:function(a,b,c,d,e,f,g,h,k)I.ze(c,b,c,d,e,f,g,h,k)&&(p=(k.x-e)(k.x-e)+(k.y-f)(k.y-f),p<l&&(l=p,m=k.x,n=k.y));I.ze(a,b,c,b,e,f,g,h,k)&&(b=(k.x-e)(k.x-e)+(k.y-f)(k.y-f),b<l&&(l=b,m=k.x,n=k.y));I.ze(a,d,c,d,e,f,g,h,k)&&(a=(k.x-e)(k.x-e)+(k.y-f)*(k.y-f),a<l&&(l=a,m=k.x,n=k.y));k.h(m,n);return 1E21>l},vA: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=bh+(f- be)):(f=(b-d)/c,h=e,e=fh+(b-fa)):(d=(b-d)/c,h=(f-h)/g,a=b-da,h=(f-he-a)/(d-h),e=dh+a);k.h(h,e);return k},dt:function(a,b,c),ct:function(a,b,c,d,e,f,g,h){return 0>=I.Ps(a,b,c,d,e,f)I.Ps(a,b,c,d,g,h)&&0>=I.Ps(e, f,g,h,a,b)I.Ps(e,f,g,h,c,d)},Ps:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=ad-bc;0===f&&(f=ac+bd,0<f&&(f=(a-c)c+(b-d)d,0>f&&(f=0)));return 0>f?-1:0<f?1:0},oq:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},sx: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(2g,Math.abs(e-d));if(1E-5>d)return k=l+hMath.min(d,k),h=a+cMath.cos(l),l=b+cMath.sin(l),a+=cMath.cos(k),b+=cMath.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f; for(;1E-5<d;)e=l+hMath.min(d,k),f.push(I.My(c,l,e,a,b)),d-=Math.abs(e-l),l=e;return f},My:function(a,b,c,d,e),aq:function(a,b,c,d,e,f,g){c=Math.floor((a-c)/e)e+c;d=Math.floor((b-d)/f)f+d;var h=c;c+e-a<e/2&&(h=c+e);a=d;d+ f-b<f/2&&(a=d+f);g.h(h,a);return g},Bx:function(a,b){var c=Math.max(a,b);a=Math.min(a,b);var d;do b=c%a,c=d=a,a=b;while(0<b);return d},Ry:function(a,b,c,d)else g=0,h=1;var k=0=g?a:b;var l=0=g?c:d;if(0=g?e:f)l=-l;g=h;c=0=g?c:d;if(0=g?e:f)c=-c;return I.Sy(k,0=g?a:b,l,c,0,0)},Sy:function(a,b,c,d,e,f){if(0<d)if(0<c){e=aa;f=bb;a*=c;var g=bd,h=-f+g,k=-f+Math.sqrt(aa+gg);b=h;for(var l=0;9999999999>l;++l){b=.5(h+k);if(b=h||b=k)break;var m=a/(b+ e),n=g/(b+f);m=mm+nn-1;if(0<m)h=b;else if(0>m)k=b;else break}c=ec/(b+e)-c;d=fd/(b+f)-d;c=Math.sqrt(cc+dd)}else c=Math.abs(d-b);else d=aa-bb,f=ac,f<d?(d=f/d,f=bMath.sqrt(Math.abs(1-dd)),c=ad-c,c=Math.sqrt(cc+ff)):c=Math.abs(c-a);return c},Ee:new db,Hm:new db,Cf:new db,Df:0};I.za=I.sA; function ud(a){Za(this);this.s=!1;void 0a&&(a=vd);this.qa=a;this.Ac=this.mc=this.ad=this.$c=0;this.kj=new E;this.qr=this.kj.xa;this.ar=(new M).freeze();this.pa=!0;this.Rm=this.Ak=null;this.Sm=NaN;this.df=xc;this.ef=Hc;this.gl=this.il=NaN;this.Mf=wd} ud.prototype.copy=function(){var a=new ud;a.qa=this.qa;a.$c=this.$c;a.ad=this.ad;a.mc=this.mc;a.Ac=this.Ac;for(var b=this.kj.j,c=b.length,d=a.kj,e=0;e<c;e++)a.qr=this.qr;a.ar.assign(this.ar);a.pa=this.pa;a.Ak=this.Ak;a.Rm=this.Rm;a.Sm=this.Sm;a.df=this.df.G();a.ef=this.ef.G();a.il=this.il;a.gl=this.gl;a.Mf=this.Mf;return a};t=ud.prototype;t.ca=function(){this.freeze();Object.freeze(this);return this}; t.freeze=function();t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;var a=this.figures;a.ea();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].ea();return this}; t.Ma=function(a){if(!(a instanceof ud))return!1;if(this.type!a.type)return this.typexd&&a.type=vd?Ed(this,a):a.type=xd&&this.type=vd?Ed(a,this):!1;if(this.typevd)return I.w(this.startX,a.startX)&&I.w(this.startY,a.startY)&&I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)}; function Ed(a,b){return a.type!==xd||b.type!vd?!1:1b.figures.count&&(b=b.figures.L(0),1=b.segments.count&&I.w(a.startX,b.startX)&&I.w(a.startY,b.startY)&&(b=b.segments.L(0),b.type=Fd&&I.w(a.endX,b.endX)&&I.w(a.endY,b.endY)))?!0:!1}function Gd(a){return a.toString()}t.cb=function(a); t.toString=function(a){void 0=a&&(a=-1);switch(this.type){case xd:return 0>a?"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 Hd:var b=new M(this.startX,this.startY,0,0);b.cw(this.endX,this.endY,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+ " "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Id:b=new M(this.startX,this.startY,0,0);b.cw(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ 2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case vd:b=;c=this.figures.j;for(var d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.isFilled&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}}; function Jd(a,b){function c(){return u>=A-1?!0:null!k[u+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){u++;return k[u]}function e(){var a=new H(parseFloat(d()),parseFloat(d()));v=v.toLowerCase()&&(a.x=z.x+a.x,a.y=z.y+a.y);return a}function f()function g()function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!a?z:new H(2z.x-y.x,2z.y-y.y)}void 0=b&&(b=!1);a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([s])/gm,"$1 $2");a=a.replace(/([s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+-])/gm,"$1 $2");a=a.replace(/(Aa{3})s+([01])s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[s ]+/gm," ");a=a.replace(/^s+|s+$/g,);var k=a.split(" ");for(a=0;a<k.length;a++)m.push(n);k.splice(a,1);for(l=0;l<m.length;l++)k.splice(a+l,0,m[l]);a+=m.length-1;Fa(m)}}var u=-1,v=,w=;m=new H(0,0);var y=new H(0,0),z=new H(0,0),A=k.length;a=Kd(null);n=l=!1;p=!0;for(r=null;!(u>=A-1);)if(w=v,v=d(),!v)switch(v.toUpperCase()){case "X":p=!0;n=l=!1;break;case "M":r=f();null=a.ec||!0=p?(Ld(a,r.x,r.y,l,!n),p=!1):a.moveTo(r.x,r.y);for(m=z;!c();)r=f(),a.lineTo(r.x,r.y);break; case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)z=new H((v=v.toLowerCase()?z.x:0)+parseFloat(d()),z.y),a.lineTo(z.x,z.y);break;case "V":for(;!c();)z=new H(z.x,(v===v.toLowerCase()?z.y:0)+parseFloat(d())),a.lineTo(z.x,z.y);break;case "C":for(;!c();)break;case "S":for(;!c();)r=h(),q=g(),C=f(),Md(a,r.x,r.y,q.x,q.y,C.x,C.y);break;case "Q":for(;!c();)r=g(),q=f(),Rd(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)y=r=h(),q=f(),Rd(a, r.x,r.y,q.x,q.y);break;case "B":for(;!c();)break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),C=parseFloat(d()),J=!!parseFloat(d()),K=!!parseFloat(d()),L=f(),Sd(a,r,q,C,J,K,L.x,L.y);break;case "Z":Td(a);z=m;break;case "F":r=;for(q=1;k[u+q];)if(null!== k[u+q].match(/[Uu]/))q++;else if(nullk[u+q].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))q++;elser.match(/[Mm]/)?l=!0:0<a.ec.segments.length&&(a.ec.isFilled=!0);break;case "U":r="";for(q=1;k[u+q];)if(null!k[u+q].match(/[Ff]/))q++;else if(nullk[u+q].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))q++;elser.match(/[Mm]/)?n=!0:a.Aq(!1)}m=a.Ys;Ud=a;if(b)for(b=m.figures.iterator;b.next();)b.value.isFilled=!0;return m} function Vd(a,b){for(var c=a.length,d=H.alloc(),e=0;e<c;e++)H.free(d)}t.uv=function(){if(this.pa||this.qr!this.figures.xa)return!0;for(var a=this.figures.j,b=a.length,c=0;c<b;c++)if(a[c].uv())return!0;return!1}; ud.prototype.computeBounds=function()}a=this.ar;a.ea();isNaN(this.il)||isNaN(this.gl)?a.h(0,0,0,0):a.h(0,0,this.il,this.gl);Wd(this,a,!1);fc(a,0,0,0,0);a.freeze()};ud.prototype.qx=function(){var a=new M;Wd(this,a,!0);return a}; function Wd(a,b,c){switch(a.type){case xd:case Hd:case Id:c?b.h(a.$c,a.ad,0,0):fc(b,a.$c,a.ad,0,0);fc(b,a.mc,a.Ac,0,0);break;case vd:var d=a.figures;a=d.j;d=d.length;for(var e=0;e<d;e++){var f=a[e];c&&0=e?b.h(f.startX,f.startY,0,0):fc(b,f.startX,f.startY,0,0);for(var g=f.segments.j,h=g.length,k=f.startX,l=f.startY,m=0;m<h;m++){var n=g[m];switch(n.type){case Fd:case Xd:k=n.endX;l=n.endY;fc(b,k,l,0,0);break;case Yd:I.Xl(k,l,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY; break;case Zd:I.Cv(k,l,n.point1X,n.point1Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY;break;case $d:case ae:var p=n.type=$d?be(n,f):ce(n,f,k,l),r=p.length;if(0r)n=null;for(var q=0;q<r;q++)n=p[q],I.Xl(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.5,b);null!n&&(k=n[6],l=n[7]);break;default:B("Unknown Segment type: "+n.type)}}}break;default:B("Unknown Geometry type: "+a.type)}} ud.prototype.normalize=function(){this.s&&ua(this);var a=this.qx();this.offset(-a.x,-a.y);return new H(-a.x,-a.y)};ud.prototype.offset=function(a,b){this.s&&ua(this);this.transform(1,0,0,1,a,b);return this};ud.prototype.scale=function(a,b){this.s&&ua(this);this.transform(a,0,0,b,0,0);return this};ud.prototype.rotate=function(a,b,c){this.s&&ua(this);void 0b&&(b=0);void 0=c&&(c=0);var d=sd.alloc();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);sd.free(d);return this}; t=ud.prototype; t.transform=function(a,b,c,d,e,f){switch(this.type){case xd:case Hd:case Id:var g=this.$c;var h=this.ad;this.$c=ga+hc+e;this.ad=gb+hd+f;g=this.mc;h=this.Ac;this.mc=ga+hc+e;this.Ac=gb+hd+f;break;case vd:for(var k=this.figures.j,l=k.length,m=0;m<l;m++){var n=k[m];g=n.startX;h=n.startY;n.startX=ga+hc+e;n.startY=gb+hd+f;n=n.segments.j;for(var p=n.length,r=0;r<p;r++){var q=n[r];switch(q.type){case Fd:case Xd:g=q.endX;h=q.endY;q.endX=ga+hc+e;q.endY=gb+hd+f;break;case Yd:g=q.point1X;h=q.point1Y; q.point1X=ga+hc+e;q.point1Y=gb+hd+f;g=q.point2X;h=q.point2Y;q.point2X=ga+hc+e;q.point2Y=gb+hd+f;g=q.endX;h=q.endY;q.endX=ga+hc+e;q.endY=gb+hd+f;break;case Zd:g=q.point1X;h=q.point1Y;q.point1X=ga+hc+e;q.point1Y=gb+hd+f;g=q.endX;h=q.endY;q.endX=ga+hc+e;q.endY=gb+hd+f;break;case $d:g=q.centerX;h=q.centerY;q.centerX=ga+hc+e;q.centerY=gb+hd+f;0!b&&(g=180Math.atan2(b,a)/Math.PI,0>g&&(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(aa+cc);void 0!q.radiusY&&(q.radiusY*=Math.sqrt(bb+dd));break;case ae:g=q.endX;h=q.endY;q.endX=ga+hc+e;q.endY=gb+hd+f;0!=b&&(g=180Math.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(aa+cc);q.radiusY*=Math.sqrt(bb+dd);break;default:B("Unknown Segment type: "+ q.type)}}}}this.pa=!0;return this}; t.(=function(a,b,c,d){var e=a.x;a=a.y;for(var f=this.bounds.x-20,g=0,h,k,l,m,n,p=this.figures.j,r=p.length,q=0;q<r;q++){var u=p[q];if(u.isFilled){if(c&&u.)(e,a,b))return!0;var v=u.segments;h=u.startX;k=u.startY;for(var w=h,y=k,z=v.j,A=0;A<=v.length;A++){var C=void 0;if(A!v.length)else J=Fd,m=w,n=y;switch(J){case Xd:w=de(e,a,f,a,h,k,w,y);if(isNaN(w))return!0;g+=w;w=m;y=n;break;case Fd:h=de(e,a,f,a,h,k,m,n);if(isNaN(h))return!0;g+=h;break;case Yd:l=I.Vp(h,k, C.point1X,C.point1Y,C.point2X,C.point2Y,m,n,f,a,e,a,.5);g+=l;break;case Zd:l=I.Vp(h,k,(h+2C.point1X)/3,(k+2C.point1Y)/3,(2C.point1X+m)/3,(2C.point1Y+n)/3,m,n,f,a,e,a,.5);g+=l;break;case $d:case ae:J=C.type$d?be(C,u):ce(C,u,h,k);var K=J.length;if(0=K)C=null;for(var L=0;L<K;L++)l=I.Vp(C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],f,a,e,a,.5);g+=l}null!C&& (m=C[6],n=C[7]);break;default:B("Unknown Segment type: "+C.type)}h=m;k=n}if(0!g)return!0;g=0}else if(u.$(e,a,d?b:b+2))return!0}return 0!g};function de(a,b,c,d,e,f,g,h){if(I.Wb(e,f,g,h,.05,a,b))return NaN;var k=(a-c)*(f-h);if(0=k)return 0;var l=((ad-bc)(e-g)-(a-c)(eh-fg))/k;b=(ad-bc)*(f-h)/k;if(l>=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(f<h){if(b<f||b>h)return 0}else{if(b<h||b>f)return 0}else if(e<g){if(l<e||l>g)return 0}else if(l<g||l>e)return 0;return 0<k?1:-1} function ee(a,b,c,d) t.lv=function(a,b){0>a?a=0:1<a&&(a=1);void 0=b&&(b=new H);if(this.type=xd)return b.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++)}return b}; t.Cx=function(a){if(this.type=xd)else g=e,d=c;return a<=g?g=c?0:1:a>=d?d=c?0:1:Math.abs(a-c)/(d-g)}return c=e?(b<d?g=b:(g=d,d=b),f<=g?g=b?0:1:f>=d?d=b?0:1:Math.abs(f-b)/(d-g)):((f-b)(f-b)+(a-c)(a-c))/((d-b)(d-b)+(e-c)(e-c))}}else if(this.type=Hd){g=this.startX;var h=this.startY,k=this.endX;e=this.endY;if(g!k||h!e){b=k-g;c=e-h;f=2b+2c;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(2b+2c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=H.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;n<k;n++)for(var p=b[n],r=c[n],q=p.length,u=0;u<q;u+=2){var v=p[u],w=p[u+1];if(0!u){I.Xi(l,m,v,w,a.x,a.y,d);var y=(d.x-a.x)(d.x-a.x)+(d.y- a.y)(d.y-a.y);y<e&&(e=y,g=h,g+=Math.sqrt((d.x-l)(d.x-l)+(d.y-m)(d.y-m)));h+=r[(u-2)/2]}l=v;m=w}H.free(d);a=g/f;return 0>a?0:1<a?1:a}return 0}; function fe(a){if(null=a.Ak){var b=a.Ak=[],c=a.Rm=[],d=[],e=[];if(a.type=xd)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.endY),b.push(d),e.push(Math.sqrt((a.startX-a.endX)(a.startX-a.endX)+(a.startY-a.endY)(a.startY-a.endY))),c.push(e);else if(a.type=Hd)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.startY),d.push(a.endX),d.push(a.endY),d.push(a.startX),d.push(a.endY),d.push(a.startX),d.push(a.startY),b.push(d),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY- a.endY)),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY-a.endY)),c.push(e);else if(a.type=Id){var f=new ge;f.startX=a.endX;f.startY=(a.startY+a.endY)/2;var g=new le($d);g.startAngle=0;g.sweepAngle=360;g.centerX=(a.startX+a.endX)/2;g.centerY=(a.startY+a.endY)/2;g.radiusX=Math.abs(a.startX-a.endX)/2;g.radiusY=Math.abs(a.startY-a.endY)/2;f.add(g);a=be(g,f);e=a.length;if(0=e)d.push(g.centerX),d.push(g.centerY);else{g=f.startX;f=f.startY;for(var h=0;h<e;h++){var k=a[h];I.ve(g,f,k[2],k[3], k[4],k[5],k[6],k[7],.5,d);g=k[6];f=k[7]}}b.push(d);c.push(me(d))}else for(a=a.figures.iterator;a.next();){e=a.value;d=[];d.push(e.startX);d.push(e.startY);g=e.startX;f=e.startY;h=g;k=f;for(var l=e.segments.j,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.type){case Xd:4<=d.length&&(b.push(d),c.push(me(d)));d=[];d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;h=g;k=f;break;case Fd:d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;break;case Yd:I.ve(g,f,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY, .5,d);g=p.endX;f=p.endY;break;case Zd:I.rq(g,f,p.point1X,p.point1Y,p.endX,p.endY,.5,d);g=p.endX;f=p.endY;break;case $d:var r=be(p,e),q=r.length;if(0=q){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(var u=0;u<q;u++)break;case ae:r=ce(p,e,g,f);q=r.length;if(0=q){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(u=0;u<q;u++)v=r[u],I.ve(g,f,v[2],v[3],v[4],v[5],v[6],v[7],.5,d),g=v[6], f=v[7];break;default:B("Segment not of valid type: "+p.type)}p.isClosed&&(d.push(h),d.push(k))}4<=d.length&&(b.push(d),c.push(me(d)))}}}function me(a){for(var b=[],c=0,d=0,e=a.length,f=0;f<e;f+=2)return b}t.add=function(a){this.kj.add(a);return this};t.Dm=function(a,b,c,d,e,f,g,h){this.s&&ua(this);this.df=(new O(a,b,e,f)).freeze();this.ef=(new O(c,d,g,h)).freeze();return this}; ma.Object.defineProperties(ud.prototype,{flattenedSegments:{get:function(){fe(this);return this.Ak}},flattenedLengths:{get:function(){fe(this);return this.Rm}},flattenedTotalLength:{get:function()else if(this.typeHd)a=2Math.abs(this.endX-this.startX)+2Math.abs(this.endY- this.startY);elsethis.Sm=a}return a}},type:{get:function(),set:function(a){this.qa!==a&&(this.s&&ua(this,a),this.qa=a,this.pa=!0)}},startX:{get:function(){return this.$c},set:function(a){this.$c!a&&(this.s&&ua(this,a),this.$c=a,this.pa=!0)}},startY:{get:function(),set:function(a){this.ad! a&&(this.s&&ua(this,a),this.ad=a,this.pa=!0)}},endX:{get:function(),set:function(a){this.mc!==a&&(this.s&&ua(this,a),this.mc=a,this.pa=!0)}},endY:{get:function(),set:function(a){this.Ac!==a&&(this.s&&ua(this,a),this.Ac=a,this.pa=!0)}},figures:{get:function(),set:function(a){this.kj!==a&&(this.s&&ua(this,a),this.kj=a,this.pa=!0)}},spot1:{ get:function(),set:function(a){this.s&&ua(this,a);this.df=a.G()}},spot2:{get:function(),set:function(a){this.s&&ua(this,a);this.ef=a.G()}},defaultStretch:{get:function(),set:function(a){this.s&&ua(this,a);this.Mf=a}},bounds:{get:function(){this.uv()&&this.computeBounds();return this.ar}}});ud.prototype.setSpots=ud.prototype.Dm;ud.prototype.add=ud.prototype.add; ud.prototype.getFractionForPoint=ud.prototype.Cx;ud.prototype.getPointAlongPath=ud.prototype.lv;ud.prototype.transform=ud.prototype.transform;ud.prototype.rotate=ud.prototype.rotate;ud.prototype.scale=ud.prototype.scale;ud.prototype.offset=ud.prototype.offset;ud.prototype.normalize=ud.prototype.normalize;ud.prototype.computeBoundsWithoutOrigin=ud.prototype.qx;ud.prototype.equalsApprox=ud.prototype.Ma; var xd=new D(ud,"Line",0),Hd=new D(ud,"Rectangle",1),Id=new D(ud,"Ellipse",2),vd=new D(ud,"Path",3);ud.className="Geometry";ud.stringify=Gd;ud.fillPath=function(a){a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++){var e=a[d];c=null!e.match(/[Ff]/)?0d?c+e:c+("X"+(" "=e[0]?"":" ")+e):c+((0=d?:"X ")+"F"+(" "===e[0]?:" ")+e)}return c};ud.parse=Jd;ud.Line=xd;ud.Rectangle=Hd;ud.Ellipse=Id;ud.Path=vd; function ge(a,b,c,d){Za(this);this.s=!1;void 0=c&&(c=!0);this.Fr=c;void 0d&&(d=!0);this.Jr=d;void 0!==a?this.$c=a:this.$c=0;void 0!==b?this.ad=b:this.ad=0;this.Gl=new E;this.vs=this.Gl.xa;this.pa=!0}ge.prototype.copy=function(){var a=new ge;a.Fr=this.Fr;a.Jr=this.Jr;a.$c=this.$c;a.ad=this.ad;for(var b=this.Gl.j,c=b.length,d=a.Gl,e=0;e<c;e++)a.vs=this.vs;a.pa=this.pa;return a};t=ge.prototype; t.Ma=function(a){if(!(a instanceof ge&&I.w(this.startX,a.startX)&&I.w(this.startY,a.startY)))return!1;var b=this.segments.j;a=a.segments.j;var c=b.length;if(c!a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Ma(a[d]))return!1;return!0};t.toString=function(a){void 0a&&(a=-1);var b=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.j,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b}; t.freeze=function();t.ea=function();t.uv=function(){if(this.pa)return!0;var a=this.segments;if(this.vs!a.xa)return!0;a=a.j;for(var b=a.length,c=0;c<b;c++)if(a[c].pa)return!0;return!1};t.add=function(a){this.Gl.add(a);return this}; t.$=function(a,b,c){for(var d=this.startX,e=this.startY,f=d,g=e,h=this.segments.j,k=h.length,l=0;l<k;l++){var m=h[l];switch(m.type){case Xd:f=m.endX;g=m.endY;d=m.endX;e=m.endY;break;case Fd:if(I.Wb(d,e,m.endX,m.endY,c,a,b))return!0;d=m.endX;e=m.endY;break;case Yd:if(I.Ms(d,e,m.point1X,m.point1Y,m.point2X,m.point2Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case Zd:if(I.Dv(d,e,m.point1X,m.point1Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case $d:case ae:var n=m.type= $d?be(m,this):ce(m,this,d,e),p=n.length;if(0=p){if(I.Wb(d,e,m.centerX,m.centerY,c,a,b))return!0;d=m.centerX;e=m.centerY;break}for(var r=null,q=0;q<p;q++)if(r=n[q],0q&&I.Wb(d,e,r[0],r[1],c,a,b)||I.Ms(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:B("Unknown Segment type: "+m.type)}if(m.isClosed&&(d!==f||e!g)&&I.Wb(d,e,f,g,c,a,b))return!0}return!1}; ma.Object.defineProperties(ge.prototype,{isFilled:{get:function(),set:function(a){this.s&&ua(this,a);this.Fr=a}},isShadowed:{get:function(),set:function(a){this.s&&ua(this,a);this.Jr=a}},startX:{get:function(){return this.$c},set:function(a){this.s&&ua(this,a);this.$c=a;this.pa=!0}},startY:{get:function(),set:function(a){this.s&&ua(this, a);this.ad=a;this.pa=!0}},segments:{get:function(),set:function(a){this.s&&ua(this,a);this.Gl=a;this.pa=!0}}});ge.prototype.add=ge.prototype.add;ge.prototype.equalsApprox=ge.prototype.Ma;ge.className="PathFigure"; function le(a,b,c,d,e,f,g,h){Za(this);this.s=!1;void 0a&&(a=Fd);this.qa=a;void 0!b?this.mc=b:this.mc=0;void 0!c?this.Ac=c:this.Ac=0;void 0=d&&(d=0);void 0=e&&(e=0);void 0=f&&(f=0);void 0=g&&(g=0);a=ae?(a=f%360,0>a&&(a+=360),this.re=a,this.vi=0,this.wi=Math.max(d,0),this.hh=Math.max(e,0),this.ol="boolean"=typeof g?!!g:!1,this.Fk=!!h):(this.re=d,this.vi=e,a=$d&&(f=Math.max(f,0)),this.wi=f,"number"=typeof g?(a=$d&&(g=Math.max(g,0)),this.hh=g):this.hh=0,this.Fk=this.ol=!1);this.pj= !1;this.pa=!0;this.Ge=null}le.prototype.copy=function(){var a=new le;a.qa=this.qa;a.mc=this.mc;a.Ac=this.Ac;a.re=this.re;a.vi=this.vi;a.wi=this.wi;a.hh=this.hh;a.ol=this.ol;a.Fk=this.Fk;a.pj=this.pj;a.pa=this.pa;return a};t=le.prototype; t.Ma=function(a){if(!(a instanceof le)||this.type!a.type||this.isClosed!a.isClosed)return!1;switch(this.type){case Xd:case Fd:return I.w(this.endX,a.endX)&&I.w(this.endY,a.endY);case Yd:return I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)&&I.w(this.point1X,a.point1X)&&I.w(this.point1Y,a.point1Y)&&I.w(this.point2X,a.point2X)&&I.w(this.point2Y,a.point2Y);case Zd:return I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)&&I.w(this.point1X,a.point1X)&&I.w(this.point1Y,a.point1Y);case $d:return I.w(this.startAngle, a.startAngle)&&I.w(this.sweepAngle,a.sweepAngle)&&I.w(this.centerX,a.centerX)&&I.w(this.centerY,a.centerY)&&I.w(this.radiusX,a.radiusX)&&I.w(this.radiusY,a.radiusY);case ae:return this.isClockwiseArc=a.isClockwiseArc&&this.isLargeArc=a.isLargeArc&&I.w(this.xAxisRotation,a.xAxisRotation)&&I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)&&I.w(this.radiusX,a.radiusX)&&I.w(this.radiusY,a.radiusY);default:return!1}};t.cb=function(a); t.toString=function(a){void 0a&&(a=-1);switch(this.type){case Xd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Fd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Yd: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 Zd: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 $d: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 ae: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.pj?"z":"")};t.freeze=function();t.ea=function();t.close=function(); function be(a,b){if(null!a.Ge&&!1b.pa)return a.Ge;var c=a.radiusX,d=a.radiusY;void 0=d&&(d=c);if(0=c||0=d)return a.Ge=[],a.Ge;b=a.re;var e=a.vi,f=I.sx(0,0,c<d?c:d,a.startAngle,a.startAngle+a.sweepAngle,!1);if(c!d)c=f.length;for(d=0;d<c;d++)g=f[d],g[0]+=b,g[1]+=e,g[2]+=b,g[3]+=e,g[4]+=b,g[5]+=e,g[6]+=b,g[7]+=e;a.Ge=f;return a.Ge} function ce(a,b,c,d){function e(a,b,c,d){return(ad<bc?-1:1)Math.acos((ac+bd)/(Math.sqrt(aa+bb)Math.sqrt(cc+dd)))}if(null!a.Ge&&!1=b.pa)return a.Ge;b=a.wi;var f=a.hh;0=b&&(b=1E-4);0=f&&(f=1E-4);var g=Math.PI/180a.re,h=a.ol,k=a.Fk,l=a.mc,m=a.Ac,n=Math.cos(g),p=Math.sin(g),r=n(c-l)/2+p*(d-m)/2;g=-p*(c-l)/2+n*(d-m)/2;var q=rr/(bb)+gg/(ff);1<q&&(b*=Math.sqrt(q),f*=Math.sqrt(q));q=(h=k?-1:1)Math.sqrt((bbff-bbgg-ffrr)/(bbgg+ffrr));isNaN(q)&&(q=0);h=qbg/f;q=q-f r/b;isNaN(h)&&(h=0);isNaN(q)&&(q=0);c=(c+l)/2+nh-pq;d=(d+m)/2+ph+nq;m=e(1,0,(r-h)/b,(g-q)/f);n=(r-h)/b;l=(g-q)/f;r=(-r-h)/b;h=(-g-q)/f;g=e(n,l,r,h);r=(nr+lh)/(Math.sqrt(nn+ll)Math.sqrt(rr+hh));-1>=r?g=Math.PI:1<=r&&(g=0);!k&&0<g&&(g-=2Math.PI);k&&0>g&&(g+=2Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=I.sx(0,0,b>f?b:f,m,m+g,!0);f=sd.alloc();f.reset();f.translate(c,d);f.rotate(a.re,0,0);f.scale(k,r);Vd(b,f);sd.free(f);a.Ge=b;return a.Ge} ma.Object.defineProperties(le.prototype,{isClosed:{get:function(),set:function(a){this.pj!==a&&(this.pj=a,this.pa=!0)}},type:{get:function(),set:function(a){this.s&&ua(this,a);this.qa=a;this.pa=!0}},endX:{get:function(),set:function(a){this.s&&ua(this,a);this.mc=a;this.pa=!0}},endY:{get:function(),set:function(a){this.s&& ua(this,a);this.Ac=a;this.pa=!0}},point1X:{get:function(),set:function(a){this.s&&ua(this,a);this.re=a;this.pa=!0}},point1Y:{get:function(),set:function(a){this.s&&ua(this,a);this.vi=a;this.pa=!0}},point2X:{get:function(),set:function(a){this.s&&ua(this,a);this.wi=a;this.pa=!0}},point2Y:{get:function(),set:function(a){this.s&& ua(this,a);this.hh=a;this.pa=!0}},centerX:{get:function(),set:function(a){this.s&&ua(this,a);this.re=a;this.pa=!0}},centerY:{get:function(),set:function(a){this.s&&ua(this,a);this.vi=a;this.pa=!0}},radiusX:{get:function(),set:function(a){0>a&&va(a,">= zero",le,"radiusX");this.s&&ua(this,a);this.wi=a;this.pa=!0}},radiusY:{get:function(), set:function(a){0>a&&va(a,">= zero",le,"radiusY");this.s&&ua(this,a);this.hh=a;this.pa=!0}},startAngle:{get:function(),set:function(a){this.mc!a&&(this.s&&ua(this,a),a%=360,0>a&&(a+=360),this.mc=a,this.pa=!0)}},sweepAngle:{get:function(),set:function(a){this.s&&ua(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Ac=a;this.pa=!0}},isClockwiseArc:{get:function(),set:function(a){this.s&& ua(this,a);this.Fk=a;this.pa=!0}},isLargeArc:{get:function(),set:function(a){this.s&&ua(this,a);this.ol=a;this.pa=!0}},xAxisRotation:{get:function(),set:function(a){a%=360;0>a&&(a+=360);this.s&&ua(this,a);this.re=a;this.pa=!0}}});le.prototype.equalsApprox=le.prototype.Ma; var Xd=new D(le,"Move",0),Fd=new D(le,"Line",1),Yd=new D(le,"Bezier",2),Zd=new D(le,"QuadraticBezier",3),$d=new D(le,"Arc",4),ae=new D(le,"SvgArc",4);le.className="PathSegment";le.Move=Xd;le.Line=Fd;le.Bezier=Yd;le.QuadraticBezier=Zd;le.Arc=$d;le.SvgArc=ae;function ne(){this.B=null;this.Lu=(new H(0,0)).freeze();this.Vt=(new H(0,0)).freeze();this.Uq=this.Yr=0;this.Vq=1;this.Nr=;this.Hs=this.ir=!1;this.hr=this.Xq=0;this.Kg=this.yr=this.Hr=!1;this.pr=null;this.Es=0;this.bd=this.Ds=null} ne.prototype.copy=function(){var a=new ne;return this.clone(a)};ne.prototype.clone=function(a); ne.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};ne.prototype.eq=function(a,b){var c=this.diagram;if(null=c)return b;oe(c,this.event,a,b);return b}; ne.prototype.sz=function(a,b){var c=this.diagram;if(null=c)return b;oe(c,this.event,a,b);b.assign(c.Bt(b));return b}; ma.Object.defineProperties(ne.prototype,{diagram:{get:function(),set:function(a)},viewPoint:{get:function(),set:function(a){this.Lu.assign(a)}},documentPoint:{get:function(),set:function(a){this.Vt.assign(a)}},modifiers:{get:function(),set:function(a)},button:{get:function(), set:function(a){this.Uq=a;if(null=this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(),set:function(a)},key:{get:function(),set:function(a)},down:{get:function(),set:function(a)},up:{get:function(),set:function(a)},clickCount:{get:function(),set:function(a)},delta:{get:function(),set:function(a)},isMultiTouch:{get:function(),set:function(a)},handled:{get:function(),set:function(a)},bubbles:{get:function(),set:function(a)},event:{ get:function(),set:function(a)},isTouchEvent:{get:function(){var a=x.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=x.PointerEvent)&&b instanceof a&&("touch"=b.pointerType||"pen"=b.pointerType)}},timestamp:{get:function(),set:function(a)},targetDiagram:{get:function(),set:function(a)},targetObject:{ get:function(),set:function(a)},control:{get:function(){return 0!(this.modifiers&1)},set:function(a)},shift:{get:function(){return 0!(this.modifiers&4)},set:function(a)},alt:{get:function(){return 0!(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers| 2:this.modifiers&-3}},meta:{get:function(){return 0!(this.modifiers&8)},set:function(a)},left:{get:function(),set:function(a)},right:{get:function(),set:function(a)},middle:{get:function(),set:function(a)}}); ne.prototype.getMultiTouchDocumentPoint=ne.prototype.sz;ne.prototype.getMultiTouchViewPoint=ne.prototype.eq;ne.className="InputEvent";function pe()pe.prototype.copy=function(){var a=new pe;a.B=this.B;a.Qa=this.Qa;a.Bs=this.Bs;a.hs=this.hs;return a};pe.prototype.toString=function(){var a=""+this.name;null!this.subject&&(a+=":"+this.subject.toString());null!this.parameter&&(a+="("+this.parameter.toString()+")");return a}; ma.Object.defineProperties(pe.prototype,{diagram:{get:function(),set:function(a)},name:{get:function(),set:function(a)},subject:{get:function(),set:function(a)},parameter:{get:function(),set:function(a)}});pe.className="DiagramEvent"; function qe()qe.prototype.clear=function(); qe.prototype.copy=function(){var a=new qe;a.Zm=this.Zm;a.Xr=this.Xr;a.Ye=this.Ye;a.ac=this.ac;a.B=this.B;a.Io=this.Io;var b=this.Ko;a.Ko=ya(b)&&"function"typeof b.G?b.G():b;b=this.Jo;a.Jo=ya(b)&&"function"==typeof b.G?b.G():b;b=this.Eo;a.Eo=ya(b)&&"function"typeof b.G?b.G():b;b=this.Do;a.Do=ya(b)&&"function"=typeof b.G?b.G():b;return a};qe.prototype.cb=function(a); qe.prototype.toString=function(){var a="";a=this.changese?a+"* ":this.changere?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.changese?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ia(this.object)),null!this.oldValue&&(a+=" old: "+Ia(this.oldValue)),null! this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ia(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};qe.prototype.H=function(a){return a?this.oldValue:this.newValue};qe.prototype.vz=function(a){return a?this.oldParam:this.newParam};qe.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1};qe.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.Sj(this,!0):null!==this.diagram&&this.diagram.Sj(this,!0))}; qe.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};qe.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.Sj(this,!1):null!==this.diagram&&this.diagram.Sj(this,!1))}; ma.Object.defineProperties(qe.prototype,{model:{get:function(),set:function(a)},diagram:{get:function(),set:function(a)},change:{get:function(),set:function(a)},modelChange:{get:function(),set:function(a)},propertyName:{get:function(), set:function(a)},isTransactionFinished:{get:function()},object:{get:function(),set:function(a)},oldValue:{get:function(),set:function(a)},oldParam:{get:function(),set:function(a)}, newValue:{get:function(),set:function(a)},newParam:{get:function(),set:function(a)}});qe.prototype.redo=qe.prototype.redo;qe.prototype.canRedo=qe.prototype.canRedo;qe.prototype.undo=qe.prototype.undo;qe.prototype.canUndo=qe.prototype.canUndo;qe.prototype.getParam=qe.prototype.vz;qe.prototype.getValue=qe.prototype.H;qe.prototype.clear=qe.prototype.clear; var se=new D(qe,"Transaction",-1),re=new D(qe,"Property",0),te=new D(qe,"Insert",1),ue=new D(qe,"Remove",2);qe.className="ChangedEvent";qe.Transaction=se;qe.Property=re;qe.Insert=te;qe.Remove=ue;function ve(){this.u=(new E).freeze();this.Qa=;this.l=!1}ve.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?:", incomplete");if(void 0!==a&&0<a){a=this.changes.count;for(var c=0;c<a;c++){var d=this.changes.L(c);null!==d&&(b+=" "+d.toString())}}return b}; ve.prototype.clear=function()a.clear();a.freeze()};ve.prototype.canUndo=function();ve.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--)};ve.prototype.canRedo=function(); ve.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,b=0;b<a;b++)};ma.Object.defineProperties(ve.prototype,{changes:{get:function()},name:{get:function(),set:function(a)},isComplete:{get:function(),set:function(a)}});ve.prototype.redo=ve.prototype.redo;ve.prototype.canRedo=ve.prototype.canRedo; ve.prototype.undo=ve.prototype.undo;ve.prototype.canUndo=ve.prototype.canUndo;ve.prototype.clear=ve.prototype.clear;ve.className="Transaction";function we(){this.mu=new F;this.Lc=!1;this.I=(new E).freeze();this.fe=-1;this.u=999;this.ge=!1;this.fr=null;this.Gi=0;this.l=!1;this.ne=(new E).freeze();this.xl=new E;this.bu=!0;this.gu=!1} we.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.nestedTransactionNames.L(d);b+="]";if(void 0!a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+=" "+this.history.L(d).toString(a-1);return b}; we.prototype.clear=function()a.clear();this.fe=-1;a.freeze();this.ge=!1;this.fr=null;this.Gi=0;this.ne.ea();this.ne.clear();this.ne.freeze();this.xl.clear()};we.prototype.copyProperties=function(a);t=we.prototype;t.ix=function(a){this.mu.add(a)};t.Qx=function(a){this.mu.remove(a)}; t.ta=function(a){void 0a&&(a="");null=a&&(a="");if(this.isUndoingRedoing)return!1;!0=this.bu&&(this.bu=!1,this.Gi++,this.yb("StartingFirstTransaction",a,this.currentTransaction),0<this.Gi&&this.Gi--);this.isEnabled&&(this.ne.ea(),this.ne.add(a),this.ne.freeze(),null=this.currentTransaction?this.xl.add(0):this.xl.add(this.currentTransaction.changes.count));this.Gi++;var b=1=this.transactionLevel;b&&this.yb("StartedTransaction",a,this.currentTransaction);return b}; t.Ua=function(a){void 0=a&&(a=);return xe(this,!0,a)};t.yf=function(){return xe(this,!1,)}; function xe(a,b,c){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&wa("Ending transaction without having started a transaction: "+c);var d=1=a.transactionLevel;d&&b&&a.yb("CommittingTransaction",c,a.currentTransaction);var e=0;if(0<a.transactionLevel&&(a.Gi--,a.isEnabled))f=a.currentTransaction;if(d){if(b){a.gu=!1;if(a.isEnabled&&null! f)a.yb("CommittedTransaction",c,f)}elsefinally{a.yb("RolledBackTransaction",c,f),a.ge=!1}null!f&&f.clear()}a.fr=null;return!0}if(a.isEnabled&&!b&&null!f){a=e;c= f.changes;for(b=c.count-1;b>=a;b--)d=c.L(b),null!d&&d.undo(),c.ea(),c.jb(b);c.freeze()}return!1}we.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return null!a&&a.canUndo()?!0:!1};we.prototype.undo=function(){if(this.canUndo())catch(b){wa("undo error: "+b.toString())}finally{this.yb("FinishedUndo","Undo",a),this.ge=!1}}}; we.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return null!a&&a.canRedo()?!0:!1};we.prototype.redo=function(){if(this.canRedo())catch(b){wa("redo error: "+b.toString())}finally{this.yb("FinishedRedo","Redo",a),this.ge=!1}}}; we.prototype.yb=function(a,b,c){void 0=c&&(c=null);var d=new qe;d.change=se;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.models;a.next();)b=a.value,d.model=b,b.Ns(d)}; we.prototype.ov=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var b=this.currentTransaction;null=b&&(this.fr=b=new ve);var c=a.copy();b=b.changes;b.ea();b.add(c);b.freeze();this.checksTransactionLevel&&0>=this.transactionLevel&&!this.bu&&(a=a.diagram,null!a&&!1=a.fk||wa("Change not within a transaction: "+c.toString()))}}; we.prototype.skipsEvent=function(a){if(null=a||0>a.change.value)return!0;a=a.object;if(void 0!a.layer){if(a=a.layer,null!=a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; ma.Object.defineProperties(we.prototype,{models:{get:function()},isEnabled:{get:function(),set:function(a)},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.L(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count- 1?this.history.L(this.historyIndex+1):null}},isUndoingRedoing:{get:function()},history:{get:function()},maxHistoryLength:{get:function(),set:function(a)},historyIndex:{get:function()},currentTransaction:{get:function()},transactionLevel:{ get:function()},isInTransaction:{get:function(){return 0<this.Gi}},checksTransactionLevel:{get:function(),set:function(a)},nestedTransactionNames:{get:function()}});we.prototype.handleChanged=we.prototype.ov;we.prototype.redo=we.prototype.redo;we.prototype.undo=we.prototype.undo;we.prototype.canUndo=we.prototype.canUndo; we.prototype.rollbackTransaction=we.prototype.yf;we.prototype.commitTransaction=we.prototype.Ua;we.prototype.startTransaction=we.prototype.ta;we.prototype.removeModel=we.prototype.Qx;we.prototype.addModel=we.prototype.ix;we.prototype.clear=we.prototype.clear;we.className="UndoManager";function ye(){Za(this);this.B=ze;this.Qa=;this.Lc=!0;this.kd=!1;this.nw=null;this.ty=new ne;this.Ks=-1}ye.prototype.toString=function(){return!this.name?this.name+" Tool":Ha(this.constructor)}; ye.prototype.updateAdornments=function();ye.prototype.canStart=function();ye.prototype.doStart=function();ye.prototype.doActivate=function();ye.prototype.doDeactivate=function();ye.prototype.doStop=function();ye.prototype.doCancel=function();ye.prototype.stopTool=function(); ye.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()};ye.prototype.doMouseMove=function();ye.prototype.doMouseUp=function(){this.stopTool()};ye.prototype.doMouseWheel=function();ye.prototype.canStartMultiTouch=function(){return!0}; ye.prototype.standardPinchZoomStart=function()H.free(c);H.free(d)}; ye.prototype.standardPinchZoomMove=function(){var a=this.diagram,b=a.lastInput,c=b.eq(0,H.allocAt(NaN,NaN)),d=b.eq(1,H.allocAt(NaN,NaN));if(c.v()&&d.v()&&(this.doCancel(),a.gm("hasGestureZoom"))){var e=d.x-c.x,f=d.y-c.y;f=Math.sqrt(ee+ff)/a.Uw;e=new H((Math.min(d.x,c.x)+Math.max(d.x,c.x))/2,(Math.min(d.y,c.y)+Math.max(d.y,c.y))/2);f*=a.Lo;var g=a.commandHandler;if(f!a.scale&&g.canResetZoom(f))b.bubbles=!1}H.free(c);H.free(d)}; ye.prototype.doKeyDown=function(){"Esc"=this.diagram.lastInput.key&&this.doCancel()};ye.prototype.doKeyUp=function();ye.prototype.ta=function(a){void 0=a&&(a=this.name);this.transactionResult=null;return this.diagram.ta(a)};ye.prototype.Eg=function(); ye.prototype.standardMouseSelect=function()else if(b.shift){if(!c.isSelected){a.R("ChangingSelection",a.selection);for(b=c;null!b&&!b.canSelect();)b=b.containingGroup;null!b&&(b.isSelected=!0);a.R("ChangedSelection", a.selection)}}else{if(!c.isSelected){for(b=c;null!b&&!b.canSelect();)b=b.containingGroup;null!b&&a.select(b)}}else!b.left||(Wa?b.meta:b.control)||b.shift||a.Tu()}};ye.prototype.standardMouseClick=function(a,b){void 0=a&&(a=null);void 0=b&&(b=function(a){return!a.layer.isTemporary});var c=this.diagram,d=c.lastInput;a=c.Sb(d.documentPoint,a,b);d.targetObject=a;Ae(a,d,c);return d.handled}; function Ae(a,b,c){b.handled=!1;if(null=a||a.Bg()){var d=0;b.left?d=1=b.clickCount?1:2=b.clickCount?2:1:b.right&&1=b.clickCount&&(d=3);var e="ObjectSingleClicked";if(null!a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!d&&c.R(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!d&&c.R(e)}if(null!a)for(;null!a;){c=null;switch(d){case 1:c= a.click;break;case 2:c=a.doubleClick?a.doubleClick:a.click;break;case 3:c=a.contextClick}if(null!c&&(c(b,a),b.handled))break;a=a.panel}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.doubleClick?c.doubleClick:c.click;break;case 3:a=c.contextClick}null!a&&a(b)}}} ye.prototype.standardMouseOver=function()f=f.panel}f=g;for(b.handled=!1;null!d;)d=d.panel}d=a.Kk}if(null!d)a.currentCursor=g;b.handled=!1;for(f=d;null!f;)}else a.currentCursor="",d=a.mouseOver,null!d&&(d(b),e=!0);e&&a.Xb();a.skipsUndoManager=c}};ye.prototype.doCurrentObjectChanged=function(); ye.prototype.standardMouseWheel=function()else if(e=Be&&b.shift||e=Ce&&!b.control){d=a.position.copy();var f=0<c?c:-c,g=b.event,h=g.deltaMode;e=g.deltaX;g=g.deltaY; if(Ta||Ua||Va)h=1,0<e&&(e=3),0>e&&(e=-3),0<g&&(g=3),0>g&&(g=-3);if(void 0=h||void 0=e||void 0=g||0=e&&0=g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3fa.scrollVerticalLineChange,0<c?a.scroll("pixel","up",f):a.scroll("pixel","down",f)):b.shift&&a.allowHorizontalScroll&&(f=3fa.scrollHorizontalLineChange,0<c?a.scroll("pixel","left",f):a.scroll("pixel","right",f));else{switch(h){case 0:c="pixel";break;case 1:c="line";break;case 2:c="page";break;default:c="pixel"}0!e&&a.allowHorizontalScroll&& (e*=a.scrollHorizontalLineChange/16,0<e?a.scroll(c,"left",-e):a.scroll(c,"right",e));0!g&&a.allowVerticalScroll&&(g*=a.scrollVerticalLineChange/16,0<g?a.scroll(c,"up",-g):a.scroll(c,"down",g))}a.position.A(d)||(b.bubbles=!1)}}};ye.prototype.standardWaitAfter=function(a,b){void 0=b&&(b=this.diagram.lastInput);this.cancelWaitAfter();var c=this,d=b.clone(this.ty);this.Ks=sa(function(){c.doWaitAfter(d)},a)};ye.prototype.cancelWaitAfter=function(){-1!this.Ks&&x.clearTimeout(this.Ks);this.Ks=-1}; ye.prototype.doWaitAfter=function();ye.prototype.findToolHandleAt=function(a,b){a=this.diagram.Sb(a,function(a){for(;null!a&&!(a.panel instanceof De);)a=a.panel;return a});return null=a?null:a.part.category=b?a:null};ye.prototype.isBeyondDragSize=function(a,b){var c=this.diagram;void 0=a&&(a=c.firstInput.viewPoint);void 0=b&&(b=c.lastInput.viewPoint);var d=c.toolManager.dragSize,e=d.width;d=d.height;c.firstInput.isTouchEvent&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d}; ma.Object.defineProperties(ye.prototype,{diagram:{get:function(),set:function(a){a instanceof P&&(this.B=a)}},name:{get:function(),set:function(a)},isEnabled:{get:function(),set:function(a)},isActive:{get:function(),set:function(a)},transactionResult:{get:function(), set:function(a)}});ye.prototype.stopTransaction=ye.prototype.Eg;ye.prototype.startTransaction=ye.prototype.ta;ye.className="Tool";function Na(){ye.call(this);this.name="ToolManager";this.Ic=new E;this.Vc=new E;this.Bf=new E;this.Y=this.Ia=850;this.u=(new Kb(2,2)).ca();this.Za=5E3;this.Ja=Ce;this.I=Ke;this.er=this.l=null;this.Kj=-1}la(Na,ye);Na.prototype.initializeStandardTools=function(); Na.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof De&&this.er=a)}; Na.prototype.doMouseDown=function()if(this.gestureBehavior=Le)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var c=this.mouseDownTools.length,d=0;d<c;d++){var e=this.mouseDownTools.L(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool e&&(e.isActive||e.doActivate(),e.doMouseDown());return}}1=a.lastInput.button&&(this.mouseWheelBehavior=Ce?this.mouseWheelBehavior=Be:this.mouseWheelBehavior=Be&&(this.mouseWheelBehavior=Ce));this.doActivate();this.standardWaitAfter(this.holdDelay,b)}; Na.prototype.doMouseMove=function()if(this.gestureBehavior=Le)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var c=this.mouseMoveTools.length,d=0;d<c;d++)}Ne(this, a);a=b.event;null=a||"mousemove"!a.type&&"pointermove"!a.type&&a.cancelable||(b.bubbles=!0)};function Ne(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,b.lastInput)}Na.prototype.doCurrentObjectChanged=function(a,b){a=this.currentToolTip;null=a||null!b&&a instanceof De&&(b=a||b.Ag(a))||this.hideToolTip()}; Na.prototype.doWaitAfter=function(a); Na.prototype.doMouseHover=function()else c=this.isActive?a.mouseHold:a.mouseHover,null!c&&c(b)}; Na.prototype.doToolTip=function(){var a=this.diagram,b=a.lastInput;null=b.targetObject&&(b.targetObject=a.Sb(b.documentPoint,null,null));b=b.targetObject;if(null!b){if(a=this.currentToolTip,!(a instanceof De)||b!a&&!b.Ag(a)){for(;null!b;)b=b.panel}this.hideToolTip()}}else b=a.toolTip,null!b?this.showToolTip(b,null):this.hideToolTip()}; Na.prototype.showToolTip=function(a,b){var c=this.diagram;a!this.currentToolTip&&this.hideToolTip();if(a instanceof De){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category="ToolTip";null!a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!d&&d!c&&d.remove(a);c.add(a);null!b?a.adornedObject=b:a.data=c.model;a.zb();this.positionToolTip(a,b)}else a instanceof Oe&&a!this.currentToolTip&&a.show(b,c,this);this.currentToolTip=a;-1!this.Kj&&(x.clearTimeout(this.Kj), this.Kj=-1);a=this.toolTipDuration;if(0<a&&Infinity!a),a)}};Na.prototype.positionToolTip=function(a){if(null=a.placeholder)}; Na.prototype.hideToolTip=function(){-1!this.Kj&&(x.clearTimeout(this.Kj),this.Kj=-1);var a=this.diagram,b=this.currentToolTip;null!b&&(b instanceof De?(a.remove(b),null!this.er&&this.er.xf(b.category),b.data=null,b.adornedObject=null):b instanceof Oe&&null!b.hide&&b.hide(a,this),this.currentToolTip=null)}; Na.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var b=this.mouseUpTools.length,c=0;c<b;c++)}a.doFocus();this.doDeactivate()};Na.prototype.doMouseWheel=function(){this.standardMouseWheel()};Na.prototype.doKeyDown=function(); Na.prototype.doKeyUp=function();Na.prototype.findTool=function(a){for(var b=this.mouseDownTools.length,c=0;c<b;c++)b=this.mouseMoveTools.length;for(c=0;c<b;c++)if(d=this.mouseMoveTools.L(c),d.name=a)return d;b=this.mouseUpTools.length;for(c=0;c<b;c++)if(d=this.mouseUpTools.L(c),d.name=a)return d;return null}; Na.prototype.replaceTool=function(a,b){null!b&&(b.diagram=this.diagram);for(var c=this.mouseDownTools.length,d=0;d<c;d++){var e=this.mouseDownTools.L(d);if(e.name=a)return null!b?this.mouseDownTools.hd(d,b):this.mouseDownTools.jb(d),e}c=this.mouseMoveTools.length;for(d=0;d<c;d++)if(e=this.mouseMoveTools.L(d),e.name=a)return null!b?this.mouseMoveTools.hd(d,b):this.mouseMoveTools.jb(d),e;c=this.mouseUpTools.length;for(d=0;d<c;d++)if(e=this.mouseUpTools.L(d),e.name=a)return null!b?this.mouseUpTools.hd(d, b):this.mouseUpTools.jb(d),e;return null};Na.prototype.Va=function(a,b,c){null!b&&(b.name=a,b.diagram=this.diagram);this.findTool(a)?this.replaceTool(a,b):null!b&&c.add(b)}; ma.Object.defineProperties(Na.prototype,{mouseWheelBehavior:{get:function(),set:function(a)},gestureBehavior:{get:function(),set:function(a)},currentToolTip:{get:function(),set:function(a){this.l=a;this.er=null!a&&a instanceof De?a.adornedPart:null}},mouseDownTools:{get:function()},mouseMoveTools:{ get:function()},mouseUpTools:{get:function()},hoverDelay:{get:function(),set:function(a)},holdDelay:{get:function(),set:function(a)},dragSize:{get:function(),set:function(a)},toolTipDuration:{get:function(),set:function(a)}});Na.prototype.replaceStandardTool=Na.prototype.Va;var Ce=new D(Na,"WheelScroll",0),Be=new D(Na,"WheelZoom",1),Pe=new D(Na,"WheelNone",2),Ke=new D(Na,"GestureZoom",3),Le=new D(Na,"GestureCancel",4),Me=new D(Na,"GestureNone",5);Na.className="ToolManager";Na.WheelScroll=Ce;Na.WheelZoom=Be;Na.WheelNone=Pe;Na.GestureZoom=Ke;Na.GestureCancel=Le;Na.GestureNone=Me; function Qe(){ye.call(this);this.name="Dragging";this.I=this.Vc=!0;this.u=this.Za=this.Ia=this.kg=null;this.wn=this.Bf=!1;this.Ll=new H(NaN,NaN);this.zs=new H;this.Ic=!0;this.Rk=100;this.Qg=[];this.dj=(new F).freeze();this.Ja=new Re;this.ao=null;this.Y="copy";this.Ih="";this.De="no-drop"}la(Qe,ye); Qe.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!this&&(!this.isBeyondDragSize()||b.isTouchEvent&&b.timestamp-a.firstInput.timestamp<this.Rk)?!1:null!this.findDraggablePart()}; Qe.prototype.findDraggablePart=function(){var a=this.diagram;a=a.em(a.firstInput.documentPoint,!1);if(null=a)return null;for(;null!a&&!a.canSelect();)a=a.containingGroup;return null!a&&(a.canMove()||a.canCopy())?a:null}; Qe.prototype.standardMouseSelect=function()}}; Qe.prototype.doActivate=function(){var a=this.diagram;this.ao=null;null=this.currentPart&&this.standardMouseSelect();var b=this.currentPart;null!b&&(b.canMove()||b.canCopy())&&(Te=null,this.isActive=!0,this.Ll.set(a.position),Ue(this,a.selection),this.Qg.length=0,this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),a.At=!0,!0=a.xe("temporaryPixelRatio")&&30<a.lx&&Ve(a),We(a,this.draggedParts),this.ta("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured= !0,a.allowDragOut&&(this.isDragOutStarted=!0,this.wn=!1,Te=this,Xe=this.diagram,this.doSimulatedDragOut()))};function Ue(a,b){if(a.dragsLink){var c=a.diagram;c.allowRelink&&(c.model.dk()&&1=b.count&&b.first()instanceof Q?(a.draggedLink=b.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Tj(),a.kg=c.toolManager.findTool("Relinking"),null=a.kg&&(a.kg=new Ye,a.kg.diagram=c)):(a.draggedLink=null,a.kg=null))}} Qe.prototype.computeEffectiveCollection=function(a,b){return this.diagram.commandHandler.computeEffectiveCollection(a,b)};Qe.prototype.qd=function(a){return void 0=a?new ef(Fb):this.isGridSnapEnabled?new ef(new H(Math.round(a.x),Math.round(a.y))):new ef(a.copy())}; Qe.prototype.doDeactivate=function()b.clear()}jf(this);this.Ll.h(NaN,NaN);Te=Xe=null;kf(this);a.isMouseCaptured=!1;a.currentCursor="";a.At=!1;this.Eg();lf(a,!0)}; function ff(a)function nf()Qe.prototype.doCancel=function(){kf(this);of(this);var a=this.diagram;this.Ll.v()&&(a.position=this.Ll);this.stopTool()};Qe.prototype.doKeyDown=function(){this.isActive&&("Esc"=this.diagram.lastInput.key?this.doCancel():this.doMouseMove())}; Qe.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function pf(a,b)}Infinity=c?b.h(0,0,0,0):b.h(c,d,e-c,f-d)} function qf(a,b){if(null=a.copiedParts){var c=a.diagram;if((!b||!c.isReadOnly&&!c.isModelReadOnly)&&null!a.draggedParts){var d=c.undoManager;d.isEnabled&&d.isInTransaction?null!d.currentTransaction&&0<d.currentTransaction.changes.count&&(c.undoManager.yf(),c.ta("Drag")):of(a);c.skipsUndoManager=!b;c.partManager.addsToTemporaryLayer=!b;a.startPoint=c.firstInput.documentPoint;b=a.copiesEffectiveCollection?a.draggedParts.Af():c.selection;c=c.Yj(b,c,!0);for(b=c.iterator;b.next();)b.value.location= b.key.location;b=M.alloc();pf(c,b);M.free(b);b=new G;for(d=a.draggedParts.iterator;d.next();)for(c=c.iterator;c.next();)d=c.value,d instanceof Q&&d.canCopy()&&b.add(d,a.qd());a.copiedParts=b;Ue(a,b.Af());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)))}}} function kf(a){var b=a.diagram;if(null!a.copiedParts&&(b.vt(a.copiedParts.Af(),!1),a.copiedParts=null,null!a.draggedParts))for(var c=a.draggedParts.iterator;c.next();)c.key instanceof Q&&(c.value.point=new H(0,0));b.skipsUndoManager=!1;b.partManager.addsToTemporaryLayer=!1;a.startPoint=b.firstInput.documentPoint} function jf(a){if(null!a.draggedLink){if(a.dragsLink&&null!a.kg)a.draggedLink=null;a.kg=null}}function sf(a,b,c)Qe.prototype.moveParts=function(a,b,c); function of(a){if(null!a.draggedParts){for(var b=a.diagram,c=a.draggedParts.iterator;c.next();)for(c=a.draggedParts.iterator;c.next();)if(d=c.key,d instanceof Q&&d.suspendsRouting)b.ud()}}function uf(a,b){if(null=b)return!0;b=b.part;return null=b||b instanceof De||b.layer.isTemporary||a.draggedParts&&a.draggedParts.contains(b)||a.copiedParts&&a.copiedParts.contains(b)?!0:!1} function vf(a,b)),e=c.lastInput;e.targetObject=d;a.doUpdateCursor(d);var f=c.skipsUndoManager,g=!1;try{c.skipsUndoManager=!0;g=mf(a,e,d);if(!a.isActive&&null=Te)return;var h=null!d?d.part:null;if(null=h||c.handlesDragDropForTopLevelParts&&h.isTopLevel&&!(h instanceof S))if(!a.isActive&& null=Te)return;a.doDragOver(b,d);if(!a.isActive&&null=Te)return}finallya.ao=d;c.isReadOnly||!c.allowMove&&!c.allowCopy||!c.allowHorizontalScroll&&!c.allowVerticalScroll||c.Ss(e.viewPoint)}Qe.prototype.doUpdateCursor=function(a); function mf(a,b,c)a.Qg.length=0;if(!a.isActive&&null=Te||null=c)return d;b.handled=!1;for(e=c;null!e;)a.Qg.push(e),e=yf(e);e=a.Qg.length;for(c=0;c<e&&(g=a.Qg[c],h=g.mouseDragEnter,null=h||(h(b,g,f),d=!0,!b.handled));c++);return d} function yf(a){var b=a.panel;return null!b?b:a instanceof T&&!(a instanceof S)&&(a=a.containingGroup,null!a&&a.handlesDragDropForMembers)?a:null}function zf(a,b,c){var d=a.kg;if(null=d)return null;var e=a.diagram.xg(b,d.portGravity,function(a){return d.findValidLinkablePort(a,c)});a=H.alloc();var f=Infinity,g=null;for(e=e.iterator;e.next();)}H.free(a);return g} function wf(a,b){var c=a.draggedLink;if(null!c&&!(2>c.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.kg;if(null!e){var f=null,g=null;null=c.fromNode&&(f=zf(a,c.i(0),!1),null!f&&(g=f.part));var h=null,k=null;null=c.toNode&&(h=zf(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.Lx&&d.R("LinkRelinked",c,d.Lx),c.toPort!d.Mx&&d.R("LinkRelinked",c,d.Mx)):Ff(e,g,f,k,h):Ff(e,null,null,null,null)}}}}Qe.prototype.doDragOver=function(); function Gf(a,b)),e=c.lastInput;e.targetObject=d;if(null!d)}else f=c.mouseDrop,null!f&&f(e);if(a.isActive||null!Te){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof U&&f.linksConnected.each(function(a));a.doDropOnto(b,d);if(a.isActive||null! Te){b=M.alloc();for(d=c.selection.iterator;d.next();)e=d.value,e instanceof U&&If(a,c,e,b);M.free(b)}}}function Hf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof S||(c=a.mouseDrop,null!c&&c(b))}function If(a,b,c,d)} Qe.prototype.doDropOnto=function();Qe.prototype.doMouseMove=function(){if(this.isActive)}; Qe.prototype.doMouseUp=function(){if(this.isActive)))):(b=!0,kf(this),this.mayMove()&&(sf(this,this.draggedParts,!0), vf(this,a.lastInput.documentPoint)));this.wn=!0;Gf(this,a.lastInput.documentPoint);if(this.isActive)this.stopTool();c&&a.R("ChangedSelection",a.selection)}}}; Qe.prototype.simulatedMouseMove=function(a,b,c){if(null=Te)return!1;var d=Te.diagram;c instanceof P||(c=null);var e=Xe;c!e&&(null!e&&e!d&&(e.zf(),Te.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!e&&e.doSimulatedDragLeave()),Xe=c,null!c&&c!d&&(nf(),e=c.toolManager.findTool("Dragging"),null!e&&(hf.contains(e)||hf.add(e),e.doSimulatedDragEnter())));if(null=c||c=d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging");null!d&&(null! a&&(void 0!a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),b=c.getMouse(a)),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.Cq(b),c.lastInput.down=!1,c.lastInput.up=!1,d.doSimulatedDragOver());return!0}; Qe.prototype.simulatedMouseUp=function(a,b,c){if(null=Te)return!1;var d=Xe,e=Te.diagram;if(null=c)return Te.doCancel(),!0;if(c!d){var f=d.toolManager.findTool("Dragging");if(null!d&&d!e&&null!f)return d.zf(),Te.isDragOutStarted=!1,f.doSimulatedDragLeave(),!1;Xe=c;d=c.toolManager.findTool("Dragging");null!d&&(nf(),hf.contains(d)||hf.add(d),d.doSimulatedDragEnter())}return c!this.diagram?(null!a?(void 0!a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&& (a=a.changedTouches[0])),b=c.getMouse(a)):null=b&&(b=new H),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.Cq(b),c.lastInput.down=!1,c.lastInput.up=!0,a=c.toolManager.findTool("Dragging"),null!a&&a.doSimulatedDrop(),a=Te,null!a&&(c=a.mayCopy(),a.transactionResult=c?"Copy":"Move",a.stopTool()),!0):!1}; function Kf(a){if(null!a.draggedParts)for(var b=a.draggedParts.iterator;b.next();){var c=b.key;c instanceof U&&(c=c.containingGroup,null=c||null=c.placeholder||a.draggedParts.contains(c)||c.placeholder.o())}} Qe.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Wa?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)return null!this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1}; Qe.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)return null!this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1}; Qe.prototype.mayMove=function()return null!this.draggedLink&&this.dragsLink&&this.draggedLink.canMove()?!0:!1};Qe.prototype.computeBorder=function(a,b,c){return this.wn||null=this.draggedParts||this.draggedParts.contains(a)?null:c.assign(b)};Qe.prototype.pz=function(); Qe.prototype.mayDragIn=function();Qe.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn())}; Qe.prototype.doSimulatedDragLeave=function();Qe.prototype.doSimulatedDragOver=function(); Qe.prototype.doSimulatedDrop=function())),Gf(this,a.lastInput.documentPoint),a.Ta(),b=a.selection,null!this.copiedParts?this.transactionResult="ExternalCopy":b=new F,this.copiedParts=null, a.doFocus(),a.R("ExternalObjectsDropped",b,c),this.Eg(),a.R("ChangedSelection",a.selection))}}; function Mf(a,b,c,d){if(null=a.copiedParts){var e=a.diagram;if(!e.isReadOnly&&!e.isModelReadOnly){e.skipsUndoManager=!c;e.partManager.addsToTemporaryLayer=!c;a.startPoint=d.documentPoint;c=e.Yj(b,e,!0);var f=M.alloc();pf(b,f);d=f.x+f.width/2;e=f.y+f.height/2;M.free(f);f=a.zs;var g=new G,h=H.alloc();for(b=b.iterator;b.next();){var k=b.value,l=c.H(k);k.Ub()&&k.canCopy()?(k=k.location,h.h(f.x-(d-k.x),f.y-(e-k.y)),l.location=h,l.zb(),g.add(l,a.qd(h))):l instanceof Q&&k.canCopy()&&(rf(l,f.x-d,f.y-e), g.add(l,a.qd()))}H.free(h);a.copiedParts=g;Ue(a,g.Af());null!a.draggedLink&&(c=a.draggedLink,d=c.routeBounds,rf(c,a.startPoint.x-(d.x+d.width/2),a.startPoint.y-(d.y+d.height/2)))}}}Qe.prototype.doSimulatedDragOut=function();Qe.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!c?c.computeMove(a,b,this.dragOptions,d):new H}; ma.Object.defineProperties(Qe.prototype,{isCopyEnabled:{get:function(),set:function(a)},copiesEffectiveCollection:{get:function(),set:function(a)},dragOptions:{get:function(),set:function(a)},isGridSnapEnabled:{get:function(),set:function(a)},isComplexRoutingRealtime:{get:function(),set:function(a)},isGridSnapRealtime:{get:function(),set:function(a)},gridSnapCellSize:{get:function(),set:function(a){this.dragOptions.gridSnapCellSize.A(a)||(a=a.G(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{ get:function(),set:function(a){this.dragOptions.gridSnapCellSpot.A(a)||(a=a.G(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(),set:function(a){this.dragOptions.gridSnapOrigin.A(a)||(a=a.G(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(),set:function(a)},dragsTree:{get:function(),set:function(a)},copyCursor:{get:function(),set:function(a)},moveCursor:{get:function(),set:function(a)},nodropCursor:{get:function(),set:function(a)},currentPart:{get:function(), set:function(a)},copiedParts:{get:function(),set:function(a)},draggedParts:{get:function(),set:function(a)},draggingParts:{get:function(){return null!this.copiedParts?this.copiedParts.Af():null!this.draggedParts?this.draggedParts.Af():this.dj}},draggedLink:{get:function(),set:function(a)},isDragOutStarted:{get:function(),set:function(a)},startPoint:{get:function(),set:function(a){this.zs.A(a)||this.zs.assign(a)}},delay:{get:function(),set:function(a)}});Qe.prototype.getDraggingSource=Qe.prototype.pz;var hf=null,Te=null,Xe=null;Qe.className="DraggingTool";hf=new E; La("draggingTool",function(){return this.findTool("Dragging")},function(a){this.Va("Dragging",a,this.mouseMoveTools)});Na.prototype.doCancel=function(){null!Te&&Te.doCancel();ye.prototype.doCancel.call(this)}; function Nf(){ye.call(this);this.Bf=100;this.Y=!1;this.$h="pointer";var a=new Q,b=new W;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new W;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.Km=a;a=new U;b=new W;b.portId=;b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Mb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Im=a;this.Jm=b;a=new U;b=new W;b.portId=;b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize= Mb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Hq=a;this.mw=b;this.Vc=this.Ic=this.Ja=this.Ia=this.Za=null;this.I=!0;this.iy=new G;this.Ih=this.ri=this.dj=null}la(Nf,ye);Nf.prototype.doStop=function(){this.diagram.zf();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null}; Nf.prototype.copyPortProperties=function(a,b,c,d,e){if(null!a&&null!b&&null!c&&null!d)}; Nf.prototype.setNoTargetPortProperties=function(a,b,c){null!b&&(b.desiredSize=Mb,b.fromSpot=wc,b.toSpot=wc);null!a&&(a.location=this.diagram.lastInput.documentPoint);null!this.portTargeted&&this.portTargeted(null,null,a,b,c)};Nf.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()}; Nf.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!this.targetPort&&this.targetPort.part instanceof U)else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort, !0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.Ss(a.lastInput.viewPoint)}};Nf.prototype.findValidLinkablePort=function(a,b){if(null=a)return null;var c=a.part;if(!(c instanceof U))return null;for(;null!a;){var d=b?a.toLinkable:a.fromLinkable;if(!0=d&&(null!a.portId||a instanceof U)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1=d)break;a=a.panel}return null}; Nf.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.xg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof U){var k=g.ga(Bc,H.alloc()),l=c.x-k.x,m=c.y-k.y;H.free(k);k=ll+mm;k<d&&(l=this.validPortsCache.H(g),null!l?l&&(b=g,d=k):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,h,g)||!a&&this.isValidLink(h, g,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(g,!0),b=g,d=k):this.validPortsCache.add(g,!1))}}return null!b&&(c=b.part,c instanceof U&&(null=c.layer||c.layer.allowLink))?b:null}; Nf.prototype.isValidFrom=function(a,b){if(null=a||null=b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool=this&&(null!a.layer&&!a.layer.allowLink||!0!b.fromLinkable))return!1;var c=b.fromMaxLinks;if(Infinity>c){if(null!this.originalLink&&a=this.originalFromNode&&b=this.originalFromPort)return!0;b=b.portId;null=b&&(b="");if(a.$p(b).count>=c)return!1}return!0}; Nf.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.td(b).count>=c)return!1}return!0}; Nf.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};Nf.prototype.isLinked=function(a,b){if(null=a||null=b)return!1;var c=a.part;if(!(c instanceof U))return!1;a=a.portId;null=a&&(a="");var d=b.part;if(!(d instanceof U))return!1;b=b.portId;null=b&&(b="");for(b=d.td(b);b.next();)if(d=b.value,d.fromNode=c&&d.fromPortId=a)return!0;return!1}; Nf.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)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};Nf.prototype.isLabelDependentOnLink=function(a,b){if(null=a)return!1;var c=a.labeledLink;if(null=c)return!1;if(c=b)return!0;var d=new F;d.add(a);return Of(this,c,b,d)}; function Of(a,b,c,d){if(b=c)return!0;var e=b.fromNode;if(null!e&&e.isLinkLabel&&(d.add(e),Of(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!b&&b.isLinkLabel&&(d.add(b),Of(a,b.labeledLink,c,d))?!0:!1} Nf.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!Pf){if(d=Qf)return!Rf(this,a,b,c,!0)}if(d=Sf){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!Rf(this,a,b,c,!0)}if(d=Tf)return a=b?a=!0:(d=new F,d.add(b),a=Uf(this,d,a,b,c)),!a;if(d=Vf)return!Rf(this,a,b,c,!1);if(d=Wf)return a=b?a=!0:(d=new F,d.add(b),a=Xf(this,d,a,b,c)),!a}return!0};function Rf(a,b,c,d,e){if(b=c)return!0;if(null=b||null=c)return!1;for(var f=b.linksConnected;f.next();)return!1} function Uf(a,b,c,d,e){if(c=d)return!0;if(null=c||null=d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();)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();)}return!1} ma.Object.defineProperties(Nf.prototype,{portGravity:{get:function(),set:function(a){0<=a&&(this.Bf=a)}},isUnconnectedLinkValid:{get:function(),set:function(a)},linkingCursor:{get:function(){return this.$h},set:function(a){this.$h=a}},temporaryLink:{get:function(),set:function(a)},temporaryFromNode:{ get:function(),set:function(a)},temporaryFromPort:{get:function(),set:function(a)},temporaryToNode:{get:function(),set:function(a)},temporaryToPort:{get:function(),set:function(a)},originalLink:{get:function(),set:function(a)},originalFromNode:{ get:function(),set:function(a)},originalFromPort:{get:function(),set:function(a)},originalToNode:{get:function(),set:function(a)},originalToPort:{get:function(),set:function(a)},isForwards:{get:function(),set:function(a)},validPortsCache:{ get:function()},targetPort:{get:function(),set:function(a)},linkValidation:{get:function(),set:function(a)},portTargeted:{get:function(),set:function(a)}});Nf.className="LinkingBaseTool";function Yf(){Nf.call(this);this.name="Linking";this.u=;this.l=null;this.J=Zf;this.De=null}la(Yf,Nf); Yf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.ht()||!a.lastInput.left||a.currentTool!this&&!this.isBeyondDragSize()?!1:null!this.findLinkablePort()}; Yf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null=b&&(b=a.Sb(a.firstInput.documentPoint,null,null));if(null=b||!(b.part instanceof U))return null;a=this.direction;if(a=Zf||a$f)if(a=Zf||a=ag)if(b=this.findValidLinkablePort(b,!0),null!b)return this.isForwards=!1,b;return null}; Yf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null!b&&(this.ta(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null=this.temporaryToNode||this.temporaryToNode.location.v()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof U&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort, !1)):(null=this.temporaryFromNode||this.temporaryFromNode.location.v()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof U&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),null!this.temporaryLink&&(null!this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode), null!this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.Na(),a.add(this.temporaryLink)),this.isActive=!0)};Yf.prototype.doDeactivate=function();Yf.prototype.doStop=function(){Nf.prototype.doStop.call(this);this.startObject=null}; Yf.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!g){var h=g.part;h instanceof U&&(this.isForwards?(null!this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!this.originalFromNode&&this.isUnconnectedLinkValid&& (b=this.originalFromNode,c=this.originalFromPort):null!this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!b||null!d?(f=this.insertLink(b,c,d,e),null!f?(null=g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),f.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",f)):(a.model.Uu(),this.doNoLink(b,c,d,e))):this.isForwards? this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}};Yf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null=a)return!0;if(a instanceof Q)return a.isTreeLink;var b=this.diagram;if(null=b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!b?b.isTreeLink:!0}; Yf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Yf.prototype.doNoLink=function(); ma.Object.defineProperties(Yf.prototype,{archetypeLinkData:{get:function(),set:function(a)},archetypeLabelNodeData:{get:function(),set:function(a)},direction:{get:function(),set:function(a)},startObject:{get:function(),set:function(a)}}); var Zf=new D(Yf,"Either",0),$f=new D(Yf,"ForwardsOnly",0),ag=new D(Yf,"BackwardsOnly",0);Yf.className="LinkingTool";Yf.Either=Zf;Yf.ForwardsOnly=$f;Yf.BackwardsOnly=ag; function Ye(){Nf.call(this);this.name="Relinking";var a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.u=a;a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.De=a;this.l=null;this.Pw=new M}la(Ye,Nf); Ye.prototype.updateAdornments=function(a){if(null!a&&a instanceof Q){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly)null=c&&a.xf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!d&&a.canRelinkTo()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.vf()&& (c=a.ak(b),null=c?(c=this.makeAdornment(d,!0),a.xh(b,c)):c.o()));null=c&&a.xf(b)}};Ye.prototype.makeAdornment=function(a,b){var c=new De;c.type=X.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!b&&c.add(b.copy());c.adornedObject=a;return c}; Ye.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.ht()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null=b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!b}; Ye.prototype.doActivate=function(){var a=this.diagram;if(null=this.originalLink){var b=this.handle;null=b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null=b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null=b)return;var c=b.part;if(!(c instanceof De&&c.adornedPart instanceof Q))return;this.handle=b;this.isForwards=null=c||"RelinkTo"c.category;this.originalLink=c.adornedPart}this.ta(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor; this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.Pw.set(this.originalLink.actualBounds);null!this.originalLink&&0<this.originalLink.pointsCount&&(nullthis.originalLink.fromNode&&(null!this.temporaryFromPort&&(this.temporaryFromPort.desiredSize=Lb),null!this.temporaryFromNode&&(this.temporaryFromNode.location=this.originalLink.i(0))),null=this.originalLink.toNode&& (null!this.temporaryToPort&&(this.temporaryToPort.desiredSize=Lb),null!this.temporaryToNode&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1))));this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1);this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0);a.add(this.temporaryFromNode);a.add(this.temporaryToNode);null!this.temporaryLink&&(null! this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.Na(),a.add(this.temporaryLink));this.isActive=!0}; Ye.prototype.copyLinkProperties=function(a,b){if(null!a&&null!b)}; Ye.prototype.doDeactivate=function();Ye.prototype.doStop=function(){Nf.prototype.doStop.call(this);this.handle=null}; Ye.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var b=this.originalFromNode,c=this.originalFromPort,d=this.originalToNode,e=this.originalToPort,f=this.originalLink;this.targetPort=this.findTargetPort(this.isForwards);if(null!this.targetPort){var g=this.targetPort.part;g instanceof U&&(this.isForwards?(d=g,e=this.targetPort):(b=g,c=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?e=d=null:c=b=null:f=null;null!f?(this.reconnectLink(f, this.isForwards?d:b,this.isForwards?e:c,this.isForwards),null=this.targetPort&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint,f.Na()),a.allowSelect&&(f.isSelected=!0),this.transactionResult=this.name,a.R("LinkRelinked",f,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards);this.originalLink.iq(this.Pw)}this.stopTool()}; Ye.prototype.reconnectLink=function(a,b,c,d);Ye.prototype.doNoRelink=function(); function Ff(a,b,c,d,e){null!b?(a.copyPortProperties(b,c,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode);null!d?(a.copyPortProperties(d,e,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)} ma.Object.defineProperties(Ye.prototype,{fromHandleArchetype:{get:function(),set:function(a)},toHandleArchetype:{get:function(),set:function(a)},handle:{get:function(),set:function(a){if(null!a&&!(a.part instanceof De))throw Error("new handle is not in an Adornment: "+a);this.l=a}}});Ye.className="RelinkingTool"; La("linkingTool",function(){return this.findTool("Linking")},function(a){this.Va("Linking",a,this.mouseMoveTools)});La("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.Va("Relinking",a,this.mouseDownTools)}); function qg(){ye.call(this);this.name="LinkReshaping";var a=new W;a.figure="Rectangle";a.desiredSize=Nb;a.fill="lightblue";a.stroke="dodgerblue";this.u=a;a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="move";this.I=a;this.Y=3;this.Jt=this.l=null;this.zl=new H;this.gs=new E}la(qg,ye);qg.prototype.mv=function(a){return a&&a.ms&&0!a.ms.value?a.ms:rg};qg.prototype.Cm=function(a,b); qg.prototype.updateAdornments=function(a){if(null!a&&a instanceof Q)null=b&&a.xf(this.name)}}; qg.prototype.makeAdornment=function(a){var b=a.part,c=b.pointsCount,d=b.isOrthogonal,e=null;if(null!b.points&&1<c){e=new De;e.type=X.Link;c=b.firstPickIndex;var f=b.lastPickIndex,g=d?1:0;if(b.resegmentable&&b.computeCurve()!sg)for(var h=c+g;h<f-g;h++)for(g=c+1;g<f;g++)if(h=this.makeHandle(a,g),null!h){h.segmentIndex=g;if(g!c)if(g=c+1&&d){k=b.i(c);var l=b.i(c+1);I.w(k.x,l.x)&& I.w(k.y,l.y)&&(l=b.i(c-1));I.w(k.x,l.x)?(this.Cm(h,tg),h.cursor="n-resize"):I.w(k.y,l.y)&&(this.Cm(h,ug),h.cursor="w-resize")}else g=f-1&&d?(k=b.i(f-1),l=b.i(f),I.w(k.x,l.x)&&I.w(k.y,l.y)&&(k=b.i(f+1)),I.w(k.x,l.x)?(this.Cm(h,tg),h.cursor="n-resize"):I.w(k.y,l.y)&&(this.Cm(h,ug),h.cursor="w-resize")):g!f&&(this.Cm(h,vg),h.cursor="move");e.add(h)}e.adornedObject=a}return e};qg.prototype.makeHandle=function(); qg.prototype.makeResegmentHandle=function();qg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?null!this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; qg.prototype.doActivate=function(){var a=this.diagram;null=this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null!this.handle){var b=this.handle.part.adornedPart;if(b instanceof Q)}this.zl=b.i(this.handle.segmentIndex);this.gs=b.points.copy();this.isActive=!0}}};qg.prototype.doDeactivate=function(){this.Eg();this.Jt=this.handle=null;this.isActive=this.diagram.isMouseCaptured=!1};qg.prototype.doCancel=function();qg.prototype.getResegmentingPoint=function(){return this.handle.ga(Bc)}; qg.prototype.doMouseMove=function(); qg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.computeReshape(a.lastInput.documentPoint);this.reshape(b);b=this.adornedLink;if(null!b&&b.resegmentable){var c=this.handle.segmentIndex,d=b.i(c-1),e=b.i(c),f=b.i(c+1);if(b.isOrthogonal){if(c>b.firstPickIndex+1&&c<b.lastPickIndex-1){var g=b.i(c-2);if(Math.abs(d.x-e.x)<this.resegmentingDistance&&Math.abs(d.y-e.y)<this.resegmentingDistance&&(wg(this,g,d,e,f,!0)||wg(this,g,d,e,f,!1))){var h=b.points.copy();wg(this,g,d, e,f,!0)?(h.hd(c-2,new H(g.x,(f.y+g.y)/2)),h.hd(c+1,new H(f.x,(f.y+g.y)/2))):(h.hd(c-2,new H((f.x+g.x)/2,g.y)),h.hd(c+1,new H((f.x+g.x)/2,f.y)));h.jb(c);h.jb(c-1);b.points=h;b.Lb()}else g=b.i(c+2),Math.abs(e.x-f.x)<this.resegmentingDistance&&Math.abs(e.y-f.y)<this.resegmentingDistance&&(wg(this,d,e,f,g,!0)||wg(this,d,e,f,g,!1))&&(h=b.points.copy(),wg(this,d,e,f,g,!0)?(h.hd(c-1,new H(d.x,(d.y+g.y)/2)),h.hd(c+2,new H(g.x,(d.y+g.y)/2))):(h.hd(c-1,new H((d.x+g.x)/2,d.y)),h.hd(c+2,new H((d.x+g.x)/2,g.y))), h.jb(c+1),h.jb(c),b.points=h,b.Lb())}}else g=H.alloc(),I.Xi(d.x,d.y,f.x,f.y,e.x,e.y,g)&&g.we(e)<this.resegmentingDistance*this.resegmentingDistance&&(d=b.points.copy(),d.jb(c),b.points=d,b.Lb()),H.free(g)}a.Ta();this.transactionResult=this.name;a.R("LinkReshaped",this.adornedLink,this.gs)}this.stopTool()}; function wg(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.resegmentingDistance&&Math.abs(c.y-d.y)<a.resegmentingDistance&&Math.abs(d.y-e.y)<a.resegmentingDistance:Math.abs(b.x-c.x)<a.resegmentingDistance&&Math.abs(c.x-d.x)<a.resegmentingDistance&&Math.abs(d.x-e.x)<a.resegmentingDistance} qg.prototype.reshape=function(a){var b=this.adornedLink;b.Hh();var c=this.handle.segmentIndex,d=this.mv(this.handle);if(b.isOrthogonal)if(c=b.firstPickIndex+1)c=b.firstPickIndex+1,d=tg?(b.K(c,b.i(c-1).x,a.y),b.K(c+1,b.i(c+2).x,a.y)):d=ug&&(b.K(c,a.x,b.i(c-1).y),b.K(c+1,a.x,b.i(c+2).y));else if(c=b.lastPickIndex-1)c=b.lastPickIndex-1,d=tg?(b.K(c-1,b.i(c-2).x,a.y),b.K(c,b.i(c+1).x,a.y)):d=ug&&(b.K(c-1,a.x,b.i(c-2).y),b.K(c,a.x,b.i(c+1).y));else{d=c;var e=b.i(d),f=b.i(d-1),g=b.i(d+1);I.w(f.x, e.x)&&I.w(e.y,g.y)?(I.w(f.x,b.i(d-2).x)&&!I.w(f.y,b.i(d-2).y)?(b.m(d,a.x,f.y),c++,d++):b.K(d-1,a.x,f.y),I.w(g.y,b.i(d+2).y)&&!I.w(g.x,b.i(d+2).x)?b.m(d+1,g.x,a.y):b.K(d+1,g.x,a.y)):I.w(f.y,e.y)&&I.w(e.x,g.x)?(I.w(f.y,b.i(d-2).y)&&!I.w(f.x,b.i(d-2).x)?(b.m(d,f.x,a.y),c++,d++):b.K(d-1,f.x,a.y),I.w(g.x,b.i(d+2).x)&&!I.w(g.y,b.i(d+2).y)?b.m(d+1,a.x,g.y):b.K(d+1,a.x,g.y)):I.w(f.x,e.x)&&I.w(e.x,g.x)?(I.w(f.x,b.i(d-2).x)&&!I.w(f.y,b.i(d-2).y)?(b.m(d,a.x,f.y),c++,d++):b.K(d-1,a.x,f.y),I.w(g.x,b.i(d+2).x)&& !I.w(g.y,b.i(d+2).y)?b.m(d+1,a.x,g.y):b.K(d+1,a.x,g.y)):I.w(f.y,e.y)&&I.w(e.y,g.y)&&(I.w(f.y,b.i(d-2).y)&&!I.w(f.x,b.i(d-2).x)?(b.m(d,f.x,a.y),c++,d++):b.K(d-1,f.x,a.y),I.w(g.y,b.i(d+2).y)&&!I.w(g.x,b.i(d+2).x)?b.m(d+1,g.x,a.y):b.K(d+1,g.x,a.y));b.K(c,a.x,a.y)}else b.K(c,a.x,a.y),d=b.fromNode,e=b.fromPort,null!d&&(f=d.findVisibleNode(),null!f&&f!d&&(d=f,e=d.port)),1=c&&b.computeSpot(!0,e).jc()&&(f=e.ga(Bc,H.alloc()),d=b.getLinkPointFromPoint(d,e,f,a,!0,H.alloc()),b.K(0,d.x,d.y),H.free(f), H.free(d)),d=b.toNode,e=b.toPort,null!d&&(f=d.findVisibleNode(),null!f&&f!d&&(d=f,e=d.port)),c=b.pointsCount-2&&b.computeSpot(!1,e).jc()&&(c=e.ga(Bc,H.alloc()),a=b.getLinkPointFromPoint(d,e,c,a,!1,H.alloc()),b.K(b.pointsCount-1,a.x,a.y),H.free(c),H.free(a));b.mf()};qg.prototype.computeReshape=function(a){var b=this.adornedLink,c=this.handle.segmentIndex;switch(this.mv(this.handle)){case vg:return a;case tg:return new H(b.i(c).x,a.y);case ug:return new H(a.x,b.i(c).y);default:case rg:return b.i(c)}}; ma.Object.defineProperties(qg.prototype,{handleArchetype:{get:function(),set:function(a)},midHandleArchetype:{get:function(),set:function(a)},handle:{get:function(),set:function(a){if(null!a&&!(a.part instanceof De))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedLink:{get:function()}, resegmentingDistance:{get:function(),set:function(a)},originalPoint:{get:function()},originalPoints:{get:function()}});qg.prototype.setReshapingBehavior=qg.prototype.Cm;qg.prototype.getReshapingBehavior=qg.prototype.mv;var rg=new D(qg,"None",0),ug=new D(qg,"Horizontal",1),tg=new D(qg,"Vertical",2),vg=new D(qg,"All",3);qg.className="LinkReshapingTool"; qg.None=rg;qg.Horizontal=ug;qg.Vertical=tg;qg.All=vg;La("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.Va("LinkReshaping",a,this.mouseDownTools)}); function xg(){ye.call(this);this.name="Resizing";this.Zf=(new Kb(1,1)).freeze();this.Yf=(new Kb(9999,9999)).freeze();this.Lg=(new Kb(NaN,NaN)).freeze();this.I=!1;this.Zd=null;var a=new W;a.alignmentFocus=Bc;a.figure="Rectangle";a.desiredSize=Nb;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.u=a;this.l=null;this.zl=new H;this.Ow=new Kb;this.Mo=new H;this.$t=new Kb(0,0);this.Zt=new Kb(Infinity,Infinity);this.Yt=new Kb(1,1);this.Lw=!0}la(xg,ye); xg.prototype.updateAdornments=function(a){if(!(null=a||a instanceof Q)){if(a.isSelected&&!this.diagram.isReadOnly)}}a.xf(this.name)}}; xg.prototype.makeAdornment=function(a){var b=a.part.resizeAdornmentTemplate;if(null=b){b=new De;b.type=X.Spot;b.locationSpot=Bc;var c=new yg;c.isPanelMain=!0;b.add(c);b.add(this.makeHandle(a,xc));b.add(this.makeHandle(a,zc));b.add(this.makeHandle(a,Hc));b.add(this.makeHandle(a,Fc));b.add(this.makeHandle(a,ed));b.add(this.makeHandle(a,gd));b.add(this.makeHandle(a,hd));b.add(this.makeHandle(a,fd))}else if(zg(b),b=b.copy(),null=b)return null;b.adornedObject=a;return b}; xg.prototype.makeHandle=function(a,b){a=this.handleArchetype;if(null=a)return null;a=a.copy();a.alignment=b;return a}; xg.prototype.updateResizeHandles=function(a,b){if(null!a)if(!a.alignment.Mb()&&("pointer"a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.jc()&&(c=Bc);if(0>=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": "e-resize"}else if(a instanceof X)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};xg.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}; xg.prototype.doActivate=function(){var a=this.diagram;nullthis.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!this.adornedObject&&(this.zl.set(this.adornedObject.ga(this.handle.alignment.Av())),this.Mo.set(this.adornedObject.part.location),this.Ow.set(this.adornedObject.desiredSize),this.Yt=this.computeCellSize(),this.$t=this.computeMinSize(),this.Zt=this.computeMaxSize(),a.isMouseCaptured= !0,this.Lw=a.animationManager.isEnabled,a.animationManager.isEnabled=!1,this.ta(this.name),this.isActive=!0))};xg.prototype.doDeactivate=function();xg.prototype.doCancel=function(){null!this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; xg.prototype.doMouseMove=function()}; xg.prototype.doMouseUp=function()this.stopTool()}; xg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject,d=c.part;c.desiredSize=a.size;d.zb();a=this.adornedObject.ga(this.handle.alignment.Av());d instanceof S?(c=new E,c.add(d),b.moveParts(c,this.zl.copy().Xd(a),!0)):d.location=d.location.copy().Xd(a).add(this.zl)}; xg.prototype.computeResize=function(a,b,c,d,e,f){b.jc()&&(b=Bc);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)p=H.alloc();I.aq(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=na.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(na.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=na.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(na.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(na.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=na.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(na.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=na.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(na.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=na.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=na.width,a.x=h+.5(l-h-a.width)));H.free(p);return a};xg.prototype.computeReshape=function(){var a=Ag;this.adornedObject instanceof W&&(a=Bg(this.adornedObject));return!(a=Cg||this.diagram.lastInput.shift)}; xg.prototype.computeMinSize=function();xg.prototype.computeMaxSize=function(); xg.prototype.computeCellSize=function(){var a=new Kb(NaN,NaN),b=this.adornedObject.part;null!b&&(b=b.resizeCellSize,!isNaN(b.width)&&0<b.width&&(a.width=b.width),!isNaN(b.height)&&0<b.height&&(a.height=b.height));b=this.cellSize;isNaN(a.width)&&!isNaN(b.width)&&0<b.width&&(a.width=b.width);isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height);b=this.diagram;(isNaN(a.width)||isNaN(a.height))&&b&&(b=b.grid,null!b&&b.visible&&this.isGridSnapEnabled&&(b=b.gridCellSize,isNaN(a.width)&& !isNaN(b.width)&&0<b.width&&(a.width=b.width),isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height)));if(isNaN(a.width)||0=a.width||Infinity=a.width)a.width=1;if(isNaN(a.height)||0=a.height||Infinity=a.height)a.height=1;return a}; ma.Object.defineProperties(xg.prototype,{handleArchetype:{get:function(),set:function(a)},handle:{get:function(),set:function(a){if(null!a&&!(a.part instanceof De))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{get:function(),set:function(a){if(null!a&&a.part instanceof De)throw Error("new handle must not be in an Adornment: "+ a);this.Zd=a}},minSize:{get:function(),set:function(a){if(!this.Zf.A(a))}},maxSize:{get:function(),set:function(a){if(!this.Yf.A(a))}},cellSize:{get:function(),set:function(a){this.Lg.A(a)||this.Lg.assign(a)}}, isGridSnapEnabled:{get:function(),set:function(a)},originalDesiredSize:{get:function()},originalLocation:{get:function()}});xg.className="ResizingTool";La("resizingTool",function(){return this.findTool("Resizing")},function(a){this.Va("Resizing",a,this.mouseDownTools)}); function Dg(){ye.call(this);this.name="Rotating";this.Ja=45;this.Ia=2;this.Mo=new H;this.Zd=null;var a=new W;a.figure="Ellipse";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.u=a;this.l=null;this.Nw=0;this.wu=new H(NaN,NaN);this.I=0;this.Y=50}la(Dg,ye); Dg.prototype.updateAdornments=function(a){if(null!a){if(a.Fh())if(a.isSelected&&!this.diagram.isReadOnly&&(b=a.rotateObject,null!b&&a.canRotate()&&a.actualBounds.v()&&a.isVisible()&&b.actualBounds.v()&&b.vf()))}a.xf(this.name)}}; Dg.prototype.makeAdornment=function(a){var b=a.part.rotateAdornmentTemplate;if(null=b){b=new De;b.type=X.Position;b.locationSpot=Bc;var c=this.handleArchetype;null!c&&b.add(c.copy())}else if(zg(b),b=b.copy(),null=b)return null;b.adornedObject=a;return b};Dg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?null!this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; Dg.prototype.doActivate=function()null!this.adornedObject&&(this.Nw=this.adornedObject.angle,this.wu=this.computeRotationPoint(this.adornedObject),this.Mo=this.adornedObject.part.location.copy(),a.isMouseCaptured=!0,a.delaysLayout=!0,this.ta(this.name),this.isActive=!0)}; Dg.prototype.computeRotationPoint=function(a){var b=a.part,c=b.locationObject;return b.rotationSpot.eb()?a.ga(b.rotationSpot):a=b||a=c?c.ga(b.locationSpot):a.ga(Bc)}; Dg.prototype.computeAdornmentLocation=function(a){var b=this.rotationPoint;b.v()||(b=this.computeRotationPoint(a));b=a.$s(b);var c=this.handleAngle;0>c?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0=c?b.x=a.naturalBounds.width+d:45=c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90=c?b.y=a.naturalBounds.height+d:135=c?(b.x=-d,b.y=a.naturalBounds.height+d):180=c?b.x=-d:225=c?(b.x=-d,b.y=-d):270=c?b.y=-d:315=c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.ga(b)};Dg.prototype.doDeactivate=function(){var a=this.diagram;this.Eg();this.Zd=this.handle=null;this.wu=new H(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Dg.prototype.doCancel=function();Dg.prototype.doMouseMove=function(); Dg.prototype.doMouseUp=function()this.stopTool()};Dg.prototype.rotate=function(a)}; Dg.prototype.computeRotate=function(a); ma.Object.defineProperties(Dg.prototype,{handleArchetype:{get:function(),set:function(a)},handle:{get:function(),set:function(a){if(null!a&&!(a.part instanceof De))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{get:function(),set:function(a){if(null!a&&a.part instanceof De)throw Error("new handle must not be in an Adornment: "+ a);this.Zd=a}},snapAngleMultiple:{get:function(),set:function(a)},snapAngleEpsilon:{get:function(),set:function(a)},originalAngle:{get:function()},rotationPoint:{get:function()},handleAngle:{get:function(),set:function(a)},handleDistance:{ get:function(),set:function(a)}});Dg.className="RotatingTool";La("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.Va("Rotating",a,this.mouseDownTools)});function Eg(){ye.call(this);this.name="ClickSelecting"}la(Eg,ye);Eg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; Eg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};Eg.className="ClickSelectingTool";function Fg(){ye.call(this);this.name="Action";this.wk=null}la(Fg,ye); Fg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.Sb(b.documentPoint,function(a){for(;null!a.panel&&!a.isActionable;)a=a.panel;return a});if(null!c){if(!c.isActionable)return!1;this.wk=c;a.Kk=a.Sb(b.documentPoint,null,null);return!0}return!1};Fg.prototype.doMouseDown=function(){if(this.isActive)else this.canStart()&&this.doActivate()}; Fg.prototype.doMouseMove=function(){if(this.isActive)};Fg.prototype.doMouseUp=function(){if(this.isActive),function(a))}this.stopTool()}; Fg.prototype.doCancel=function();Fg.prototype.doStop=function();Fg.className="ActionTool";function Gg(){ye.call(this);this.name="ClickCreating";this.ej=null;this.u=!0;this.l=!1;this.Ew=new H(0,0)}la(Gg,ye); Gg.prototype.canStart=function(){if(!this.isEnabled||null=this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1=a.lastInput.clickCount&&(this.Ew=a.lastInput.viewPoint.copy()),2!a.lastInput.clickCount||this.isBeyondDragSize(this.Ew))return!1}else if(1!a.lastInput.clickCount)return!1;return a.currentTool!this&&null!a.em(a.lastInput.documentPoint,!0)?!1:!0}; Gg.prototype.doMouseUp=function(); Gg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null=c)return null;var d=null;try{b.R("ChangingSelection",b.selection);this.ta(this.name);if(c instanceof T)c.Ub()&&(zg(c),d=c.copy(),null!d&&b.add(d));else if(null!c)if(null!d)b.Ta();this.transactionResult=this.name; b.R("PartCreated",d)}finally{this.Eg(),b.R("ChangedSelection",b.selection)}return d};ma.Object.defineProperties(Gg.prototype,{archetypeNodeData:{get:function(),set:function(a)},isDoubleClick:{get:function(),set:function(a)},isGridSnapEnabled:{get:function(),set:function(a)}});Gg.className="ClickCreatingTool"; function Ig(){ye.call(this);this.name="DragSelecting";this.Rk=175;this.u=!1;var a=new T;a.layerName="Tool";a.selectable=!1;var b=new W;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.l=a}la(Ig,ye); Ig.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestamp<this.delay||null!a.em(b.documentPoint,!0))?!1:!0};Ig.prototype.doActivate=function(); Ig.prototype.doDeactivate=function();Ig.prototype.doMouseMove=function()}; Ig.prototype.doMouseUp=function(){if(this.isActive)finally}this.stopTool()};Ig.prototype.computeBoxBounds=function(){var a=this.diagram;return new M(a.firstInput.documentPoint,a.lastInput.documentPoint)}; Ig.prototype.selectInRect=function(a){var b=this.diagram,c=b.lastInput;a=b.Ax(a,this.isPartialInclusion);if(Wa?c.meta:c.control)if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected&&(b.isSelected=!1);else for(a=a.iterator;a.next();)b=a.value,b.isSelected=!b.isSelected;else if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0);else{c=new E;for(b=b.selection.iterator;b.next();)for(b=c.iterator;b.next();)b.value.isSelected=!1;for(a= a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0)}};ma.Object.defineProperties(Ig.prototype,{delay:{get:function(),set:function(a)},isPartialInclusion:{get:function(),set:function(a)},box:{get:function(),set:function(a)}});Ig.className="DragSelectingTool"; function Jg(){ye.call(this);this.name="Panning";this.qu=new H;this.sy=new H;this.Kg=!1;var a=this;this.Vw=function()}la(Jg,ye);Jg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!this&&!this.isBeyondDragSize()?!1:!0}; Jg.prototype.doActivate=function();Jg.prototype.doDeactivate=function();Jg.prototype.doCancel=function();Jg.prototype.doMouseMove=function(){this.move()}; Jg.prototype.doMouseUp=function(){this.move();this.stopTool()};Jg.prototype.move=function()}; ma.Object.defineProperties(Jg.prototype,{bubbles:{get:function(),set:function(a)},originalPosition:{get:function()}});Jg.className="PanningTool";La("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.Va("ClickCreating",a,this.mouseUpTools)});La("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.Va("ClickSelecting",a,this.mouseUpTools)}); La("panningTool",function(){return this.findTool("Panning")},function(a){this.Va("Panning",a,this.mouseMoveTools)});La("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.Va("DragSelecting",a,this.mouseMoveTools)});La("actionTool",function(){return this.findTool("Action")},function(a){this.Va("Action",a,this.mouseDownTools)});function Oe() ma.Object.defineProperties(Oe.prototype,{mainElement:{get:function(),set:function(a)},show:{get:function(),set:function(a){this.u!a&&(this.u=a)}},hide:{get:function(),set:function(a){this.l!a&&(this.l=a)}},valueFunction:{get:function(),set:function(a)}});Oe.className="HTMLInfo"; function Kg(a,b,c)Kg.className="ContextMenuButtonInfo";function Lg(){ye.call(this);this.name="ContextMenu";this.u=this.Pt=this.l=null;this.Kw=new H;this.Qt=null;this.fu=!1;var a=this;this.Iu=function(){a.stopTool()}}la(Lg,ye); function Mg(a){var b=new Oe;b.show=function(a,b,c){c.showDefaultContextMenu()};b.hide=function(a,b){b.hideDefaultContextMenu()};Ng=b;a.Iu=function(){a.stopTool()};b=ta("div");var c=ta("div");b.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";c.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;"; var d=ta("style");x.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".goCXul { list-style: none; }",0);d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);d=a.diagram;null!d&&(d.addEventListener(b,"contextmenu",Og,!1),d.addEventListener(b,"selectstart", Og,!1),d.addEventListener(c,"contextmenu",Og,!1));b.className="goCXforeground";c.className="goCXbackground";x.document.body&&(x.document.body.appendChild(b),x.document.body.appendChild(c));Pg=b;Qg=c;Rg=!0}function Og(a){a.preventDefault();return!1}Lg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right?!1:a.lastInput.isTouchEvent&&null!this.defaultTouchContextMenu||null!this.findObjectWithContextMenu()?!0:!1}; Lg.prototype.doStart=function(){this.Kw.set(this.diagram.firstInput.documentPoint)};Lg.prototype.doStop=function(){this.hideContextMenu();this.currentObject=null}; Lg.prototype.findObjectWithContextMenu=function(a){void 0=a&&(a=null);var b=this.diagram,c=b.lastInput,d=null;a instanceof P||(a instanceof Y?d=a:d=b.Sb(c.documentPoint,null,function(a){return!a.layer.isTemporary}));if(null!d){for(a=d;null!a;){if(null!a.contextMenu)return a;a=a.panel}if(b.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return d.part}else if(null!b.contextMenu)return b;return null};Lg.prototype.doActivate=function(); Lg.prototype.doMouseDown=function(){ye.prototype.doMouseDown.call(this);if(this.isActive&&this.currentContextMenu instanceof De)this.diagram.toolManager.mouseDownTools.contains(this)&&Sg(this)}; Lg.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof De)Sg(this)}; function Sg(a){var b=a.diagram;if(a.isActive){var c=a.currentContextMenu;if(null!c){if(!(c instanceof Oe))a.stopTool();a.canStart()&&(b.currentTool=a,a.doMouseUp())}}else a.canStart()&&(Tg(a,!0),a.isActive||a.stopTool())} function Tg(a,b,c){void 0=c&&(c=null);if(!a.fu&&(a.fu=!0,b&&a.standardMouseSelect(),b=a.standardMouseClick(),a.fu=!1,!b))if(a.isActive=!0,b=Ng,null=c&&(c=a.findObjectWithContextMenu()),null!c){var d=c.contextMenu;null!d?(a.currentObject=c instanceof Y?c:null,a.showContextMenu(d,a.currentObject)):null!b&&a.showContextMenu(b,a.currentObject)}else null!b&&a.showContextMenu(b,null)} Lg.prototype.doMouseMove=function(); Lg.prototype.showContextMenu=function(a,b){var c=this.diagram;a!this.currentContextMenu&&this.hideContextMenu();if(a instanceof De){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category=this.name;null!a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!d&&d!c&&d.remove(a);c.add(a);null!b?a.adornedObject=b:a.data=c.model;a.zb();this.positionContextMenu(a,b)}else a instanceof Oe&&a.show(b,c,this);this.currentContextMenu=a}; Lg.prototype.positionContextMenu=function(a){if(null=a.placeholder)}; Lg.prototype.hideContextMenu=function(){var a=this.diagram,b=this.currentContextMenu;null!b&&(b instanceof De?(a.remove(b),null!this.Pt&&this.Pt.xf(b.category),b.data=null,b.adornedObject=null):b instanceof Oe&&(null!b.hide?b.hide(a,this):null!b.mainElement&&(b.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())}; function Ug(a){var b=new E;b.add(new Kg("Copy",function(a){a.commandHandler.copySelection()},function(a){return a.commandHandler.canCopySelection()}));b.add(new Kg("Cut",function(a){a.commandHandler.cutSelection()},function(a){return a.commandHandler.canCutSelection()}));b.add(new Kg("Delete",function(a){a.commandHandler.deleteSelection()},function(a){return a.commandHandler.canDeleteSelection()}));b.add(new Kg("Paste",function(b){b.commandHandler.pasteSelection(a.mouseDownPoint)},function(b){return b.commandHandler.canPasteSelection(a.mouseDownPoint)})); b.add(new Kg("Select All",function(a){a.commandHandler.selectAll()},function(a){return a.commandHandler.canSelectAll()}));b.add(new Kg("Undo",function(a){a.commandHandler.undo()},function(a){return a.commandHandler.canUndo()}));b.add(new Kg("Redo",function(a){a.commandHandler.redo()},function(a){return a.commandHandler.canRedo()}));b.add(new Kg("Scroll To Part",function(a){a.commandHandler.scrollToPart()},function(a){return a.commandHandler.canScrollToPart()}));b.add(new Kg("Zoom To Fit",function(a){a.commandHandler.zoomToFit()}, function(a){return a.commandHandler.canZoomToFit()}));b.add(new Kg("Reset Zoom",function(a){a.commandHandler.resetZoom()},function(a){return a.commandHandler.canResetZoom()}));b.add(new Kg("Group Selection",function(a){a.commandHandler.groupSelection()},function(a){return a.commandHandler.canGroupSelection()}));b.add(new Kg("Ungroup Selection",function(a){a.commandHandler.ungroupSelection()},function(a){return a.commandHandler.canUngroupSelection()}));b.add(new Kg("Edit Text",function(a){a.commandHandler.editTextBlock()}, function(a){return a.commandHandler.canEditTextBlock()}));return b} Lg.prototype.showDefaultContextMenu=function(){var a=this.diagram;null=this.Qt&&(this.Qt=Ug(this));Pg.innerHTML=;Qg.addEventListener("click",this.Iu,!1);var b=this,c=ta("ul");c.className="goCXul";Pg.appendChild(c);c.innerHTML=;for(var d=this.Qt.iterator;d.next();){var e=d.value,f=e.visible;if("function"typeof e.px&&("function"!==typeof f||f(a))){f=ta("li");f.className="goCXli";var g=ta("a");g.className="goCXa";g.href="#";g.ky=e.px;g.addEventListener("click",function(c){this.ky(a);b.stopTool(); c.preventDefault();return!1},!1);g.textContent=e.text;f.appendChild(g);c.appendChild(f)}}Pg.style.display="block";Qg.style.display="block"};Lg.prototype.hideDefaultContextMenu=function(){if(null!this.currentContextMenu&&this.currentContextMenuNg){Pg.style.display="none";Qg.style.display="none";var a=this.diagram;null!a&&a.removeEventListener(Qg,"click",this.Iu,!1);this.currentContextMenu=null}}; ma.Object.defineProperties(Lg.prototype,{currentContextMenu:{get:function(),set:function(a){this.l=a;this.Pt=a instanceof De?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){!1=Rg&&null=Ng&&Vg&&Mg(this);return Ng},set:function(a)},currentObject:{get:function(),set:function(a)},mouseDownPoint:{get:function()}}); var Ng=null,Rg=!1,Qg=null,Pg=null;Lg.className="ContextMenuTool";La("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.Va("ContextMenu",a,this.mouseUpTools)});function Wg(){ye.call(this);this.name="TextEditing";this.rh=new Xg;this.Ja=null;this.Ia=Yg;this.Di=null;this.ia=Zg;this.I=1;this.Y=!0;this.u=null;this.l=new Oe;this.Rt=null;$g(this,this.l)}la(Wg,ye); function $g(a,b){if(Vg)},!1);c.addEventListener("keydown",function(b){if(null!a.textBlock)},!1);c.addEventListener("focus", function(){if(null!a.currentTextEditor&&a.state!Zg){var b=a.Rt;a.ia=ch&&(a.ia=dh);"function"typeof b.select&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1);c.addEventListener("blur",function(){if(null!==a.currentTextEditor&&a.state!==Zg){var b=a.Rt;"function"typeof b.focus&&b.focus();"function"=typeof b.select&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1);b.valueFunction=function();b.mainElement=c;b.show=function(a, b,f){if(a instanceof Xg&&f instanceof Wg)if(f.stateeh)c.style.border="3px solid red",c.focus();else{var d=a.ga(Bc),e=b.position,k=b.scale,l=a.qf()k;l<f.minimumEditorScale&&(l=f.minimumEditorScale);var m=a.naturalBounds.widthl+6,n=a.naturalBounds.height*l+2,p=(d.x-e.x)*k;d=(d.y-e.y)k;c.value=a.text;b.div.style.font=a.font;c.style.position="absolute";c.style.zIndex="100";c.style.font="inherit";c.style.fontSize=100l+"%";c.style.lineHeight="normal";c.style.width=m+"px";c.style.left=(p-m/2|0)-1+ "px";c.style.top=(d-n/2|0)-1+"px";c.style.textAlign=a.textAlign;c.style.margin="0";c.style.padding="1px";c.style.border="0";c.style.outline="none";c.style.whiteSpace="pre-wrap";c.style.overflow="hidden";c.rows=a.lineCount;c.nA=l;c.className="goTXarea";b.div.appendChild(c);c.focus();f.selectsTextOnActivate&&(c.select(),c.setSelectionRange(0,9999))}};b.hide=function(a){a.div.removeChild(c)}}} Wg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(nulla||a.isReadOnly||!a.lastInput.left||this.isBeyondDragSize())return!1;var b=a.Sb(a.lastInput.documentPoint);if(!(null!b&&b instanceof Xg&&b.editable&&b.part.canEdit()))return!1;b=b.part;return null=b||this.starting=Yg&&!b.isSelected||this.starting=fh&&2>a.lastInput.clickCount?!1:!0};Wg.prototype.doStart=function(){this.isActive||null=this.textBlock||this.doActivate()}; Wg.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!a){var b=this.textBlock;null=b&&(b=a.Sb(a.lastInput.documentPoint));if(null!b&&b instanceof Xg&&(this.textBlock=b,null!b.part)){this.isActive=!0;this.ia=ch;var c=this.defaultTextEditor;null!b.textEditor&&(c=b.textEditor);this.rh=this.textBlock.copy();var d=new M(this.textBlock.ga(xc),this.textBlock.ga(Hc));a.Ov(d);c.show(b,a,this);this.currentTextEditor=c}}}};Wg.prototype.doCancel=function(){this.stopTool()}; Wg.prototype.doMouseUp=function(){!this.isActive&&this.canStart()&&this.doActivate()};Wg.prototype.doMouseDown=function(){this.isActive&&this.acceptText(gh)}; Wg.prototype.acceptText=function(a){switch(a){case gh:if(this.ia=hh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.ia=ch||this.ia=eh||this.ia=dh)this.ia=ih,rh(this);break;case sh:case ah:case bh:if(ah!a||!0!this.textBlock.isMultiline)if(this.ia=ch||this.ia=eh||this.ia=dh)this.ia=ih,rh(this)}}; function rh(a)}} Wg.prototype.doDeactivate=function();Wg.prototype.isValidText=function(a,b,c);Wg.prototype.Kx=function(a); ma.Object.defineProperties(Wg.prototype,{textBlock:{get:function(),set:function(a)},currentTextEditor:{get:function(),set:function(a)},defaultTextEditor:{get:function(),set:function(a)},starting:{get:function(),set:function(a)},textValidation:{get:function(), set:function(a)},minimumEditorScale:{get:function(),set:function(a)},selectsTextOnActivate:{get:function(),set:function(a)},state:{get:function(),set:function(a){this.ia!a&&(this.ia=a)}}});Wg.prototype.measureTemporaryTextBlock=Wg.prototype.Kx; var sh=new D(Wg,"LostFocus",0),gh=new D(Wg,"MouseDown",1),bh=new D(Wg,"Tab",2),ah=new D(Wg,"Enter",3),th=new D(Wg,"SingleClick",0),Yg=new D(Wg,"SingleClickSelected",1),fh=new D(Wg,"DoubleClick",2),Zg=new D(Wg,"StateNone",0),ch=new D(Wg,"StateActive",1),dh=new D(Wg,"StateEditing",2),ih=new D(Wg,"StateValidating",3),eh=new D(Wg,"StateInvalid",4),hh=new D(Wg,"StateValidated",5);Wg.className="TextEditingTool";Wg.LostFocus=sh;Wg.MouseDown=gh;Wg.Tab=bh;Wg.Enter=ah;Wg.SingleClick=th; Wg.SingleClickSelected=Yg;Wg.DoubleClick=fh;Wg.StateNone=Zg;Wg.StateActive=ch;Wg.StateEditing=dh;Wg.StateValidating=ih;Wg.StateInvalid=eh;Wg.StateValidated=hh;La("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.Va("TextEditing",a,this.mouseUpTools)}); function uh(){vh||(wh(),vh=!0);this.B=ze;this.dl=this.Ve=this.ic=this.Kr=this.gc=!1;this.$w=!0;this.el=xh;this.ii=this.Lc=!0;this.Rg=600;this.tw=this.Zw=!1;this.Fe=new F;this.zd=new yh;this.zd.zc=this;this.xk=new F;this.Eu=new F;this.Fs=new F}uh.prototype.Wd=function(a);uh.prototype.canStart=function(){return!0};function zh(a,b){Ah(a,b)&&(a.Ve=!0)}function Ah(a,b){if(!a.Lc||!a.canStart(b))return!1;a.Fe.add(b);a.defaultAnimation.isAnimating&&a.Uc();return a.ic=!0} function Bh(a){if(a.Lc&&a.ic){var b=a.zd,c=a.B,d=a.Fe.contains("Model");d&&(a.dl=!0,a.el=xh?(b.isViewportUnconstrained=!0,b.qc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.el=Ch&&b.qc.clear(),c.R("InitialAnimationStarting",a));d&&!a.ii||0=b.qc.count?(a.Fe.clear(),a.ic=!1,a.Ve=!1,b.qc.clear(),Dh(b),a.dl=!1,c.N()):(a.Fe.clear(),c.cd=!1,x.requestAnimationFrame(function(){!1=a.ic||b.gc||(c.xe("temporaryPixelRatio")&&Ve(c),Eh(c),a.ic=!1,a.Ve= !1,a.$w=d&&a.el=Fh&&c.Rw.A(c.la)?!0:!1,b.start(),Gh(a),c.Ta(),Hh(b,0),Lf(c,!0),Ih(a),c.R("AnimationStarting",a))}))}}function Jh(a,b,c,d){b instanceof Q&&(null!b.fromNode||null!b.toNode)||a.zd.add(b,"position",c,d,!1)}t=uh.prototype;t.pt=function(a){return this.zd.pt(a)};t.sv=function(a){return this.zd.sv(a)}; function Kh(a,b){function c(){0<e.Fs.count&&(d.addAll(e.Fs),e.Fs.clear(),e.gc=!0);if(!1!e.gc&&0!d.count){e.Eu.addAll(d);for(var a=e.Eu.iterator;a.next();){var b=a.value;if(!1!b.gc){a:if(0<b.Tl.count)var h=!0;else{for(h=b.qc.iterator;h.next();){var k=h.key;if(k instanceof Y&&null!k.diagram||k instanceof P)}h=!1}h?Lh(b,!1):b.ll=!0}}e.Eu.clear();Gh(e);Lf(e.B);Ih(e);x.requestAnimationFrame(c)}}var d=a.xk,e=a;a.gc?a.Fs.add(b):(a.gc=!0,d.add(b),x.requestAnimationFrame(function(){c()}))} function Mh(a){for(a=a.xk.iterator;a.next();)a.value.ll=!1}function Gh(a){if(!a.Kr)}function Ih(a) t.Uc=function(a)else b.qc.clear(),Dh(b)};t.bm=function(a); t.Pj=function(a,b){this.Ve&&(this.Fe.contains("Expand Tree")||this.Fe.contains("Expand SubGraph"))&&this.zd.Pj(a,b)};t.Nj=function(a,b){this.Ve&&(this.Fe.contains("Collapse Tree")||this.Fe.contains("Collapse SubGraph"))&&(this.zd.Nj(a,b),Nh(this.zd,b,"position",b.position,b.position))};function Oh(a,b,c){a.Ve&&!b.A(c)&&(a.B.fk||(b=c.copy()),Nh(a.zd,a.B,"position",b,c))} function Ph(a,b,c,d,e){null=a&&(a="rgba(0,0,0,0)");null=b&&(b="rgba(0,0,0,0)");Qh(a);Rh();var f=Sh.l,g=Sh.I,h=Sh.u;a=Sh.Y;Qh(b);Rh();var k=Sh.I,l=Sh.u;b=Sh.Y;f=e(c,f,Sh.l-f,d);g=e(c,g,k-g,d);h=e(c,h,l-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} function wh(){var a=new G;a.add("position:diagram",function(a,c,d,e,f,g){a.position=new H(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g))});a.add("position",function(a,c,d,e,f,g){f!g?a.zq(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g),!1):a.position=new H(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g))});a.add("location",function(a,c,d,e,f,g){f!g?a.zq(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g),!0):a.location=new H(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g))});a.add("position:placeholder",function(a,c,d,e,f,g){f!g?a.zq(e(f,c.x, d.x-c.x,g),e(f,c.y,d.y-c.y,g),!1):a.position=new H(e(f,c.x,d.x-c.x,g),e(f,c.y,d.y-c.y,g))});a.add("position:node",function(a,c,d,e,f,g){var b=a.actualBounds,k=d.actualBounds;d=k.x+k.width/2-b.width/2;b=k.y+k.height/2-b.height/2;f!g?a.zq(e(f,c.x,d-c.x,g),e(f,c.y,b-c.y,g),!1):a.position=new H(e(f,c.x,d-c.x,g),e(f,c.y,b-c.y,g))});a.add("desiredSize",function(a,c,d,e,f,g){a.desiredSize=new M(e(f,c.width,d.width-c.width,g),e(f,c.height,d.height-c.height,g))});a.add("width",function(a,c,d,e,f,g));a.add("height",function(a,c,d,e,f,g));a.add("fill",function(a,c,d,e,f,g));a.add("stroke",function(a,c,d,e,f,g));a.add("strokeWidth",function(a,c,d,e,f,g));a.add("strokeDashOffset",function(a,c,d,e,f,g));a.add("background",function(a,c,d,e,f,g));a.add("areaBackground",function(a,c,d,e,f,g));a.add("opacity", function(a,c,d,e,f,g));a.add("scale",function(a,c,d,e,f,g));a.add("angle",function(a,c,d,e,f,g));Th=a} ma.Object.defineProperties(uh.prototype,{animationReasons:{get:function()},isEnabled:{get:function(),set:function(a)},duration:{get:function(),set:function(a){1>a&&va(a,">= 1",uh,"duration");this.Rg=a}},isAnimating:{get:function()},isTicking:{get:function()},isInitial:{ get:function(),set:function(a)},defaultAnimation:{get:function()},activeAnimations:{get:function()},initialAnimationStyle:{get:function(),set:function(a)}});uh.prototype.stopAnimation=uh.prototype.Uc;var Th=null,vh=!1,xh=new D(uh,"Default",1),Fh=new D(uh,"AnimateLocations",2),Ch=new D(uh,"None",3); uh.className="AnimationManager";uh.defineAnimationEffect=function(a,b){vh||(wh(),vh=!0);Th.add(a,b)};uh.Default=xh;uh.AnimateLocations=Fh;uh.None=Ch;function yh(){this.Ku=this.Yw=this.zc=this.B=null;this.ll=this.gc=this.l=!1;this.Bn=this.rd=0;this.dr=this.Xt=Uh;this.kl=this.$o=!1;this.yu=1;this.vu=0;this.md=this.Rg=NaN;this.ww=0;this.Cn=null;this.u=Fb;this.qc=new G;this.ou=new G;this.Tl=new F;this.pu=new F;this.uw=Vh}yh.prototype.suspend=function(); yh.prototype.advanceTo=function(a,b){b&&(this.ll=!1);this.$o&&a>=this.md&&(this.kl=!0,a-=this.md);this.ww=a;Lh(this,!0);Gh(this.zc);Lf(this.B);Ih(this.zc);this.B.wf()};function Dh(a){a.ou.clear();a.kl=!1;a.vu=0;a.md=NaN;0<a.Tl.count&&a.Tl.clear();0<a.pu.count&&a.pu.clear()}t=yh.prototype; t.start=function(){if(0!this.qc.count&&!this.gc){for(var a=this.B,b=this.qc.iterator;b.next();){var c=b.value.end,d=b.key;if(c["position:placeholder"]){var e=d.findVisibleNode();if(e instanceof S&&null!e.placeholder)}null=a&&(d instanceof P?a=d:d instanceof Y&&(a=d.diagram))}null!a&&(this.B=a,b=this.zc=a.animationManager,this.md=isNaN(this.Rg)?b.duration:this.Rg,this.dr=this.Xt,b.dl&&b.el=xh&& this=b.defaultAnimation&&(this.dr=Wh,this.md=isNaN(this.Rg)?600=b.duration?900:b.duration:this.Rg),this.uw=a.scrollMode,this.isViewportUnconstrained&&(a.Ai=Xh),Gh(b),this.Tl.each(function(b)),Ih(b),this.gc=!0,this.rd=+new Date,this.Bn=this.rd+this.md,Kh(b,this))}};t.Ay=function(a,b){a.Ub()&&(this.Tl.add(a),this.B=b)}; t.add=function(a,b,c,d,e){"position"=b&&c.A(d)||(null=this.B&&(a instanceof P?this.B=a:a instanceof Y&&null!a.diagram&&(this.B=a.diagram)),a instanceof T&&!a.isAnimated||Nh(this,a,b,c,d,e))}; function Nh(a,b,c,d,e,f){var g=a.qc;b instanceof P&&"position"=c&&(c="position:diagram");if(g.contains(b)){var h=g.H(b);var k=h.start;var l=h.end;void 0=k[c]&&(k[c]=Yh(d));l[c]=Yh(e)}else k=,l=,k[c]=Yh(d),l[c]=Yh(e),h=k.position,b instanceof Y&&h instanceof H&&!h.v()&&b.diagram.animationManager.Fe.contains("Expand SubGraph")&&h.assign(l.position),h=new Zh(k,l,f),g.add(b,h);g=k[c];g instanceof H&&!g.v()&&g.assign(a.u);f&&0=c.indexOf("position:")&&b instanceof T?h.cv.location=Yh(b.location): f&&(h.cv[c]=Yh(d))}function Yh(a){return a instanceof H?a.copy():a instanceof Kb?a.copy():a}t.pt=function(a){if(!this.gc)return!1;a=this.qc.H(a);return null!a&&a.Fv};t.sv=function(a){if(!this.gc)return!1;a=this.qc.H(a);return null!a&&(a.start.position||a.start.location)}; function Lh(a,b){if(!a.ll||b){var c=a.zc;if(!1!a.gc){var d=+new Date,e=d>a.Bn?a.md:d-a.rd;b&&(e=a.ww,e<a.md?(a.rd=+new Date-e,a.Bn=a.rd+a.md):e=a.md);Gh(c);Hh(a,e);Lf(a.B,!0);Ih(c);d>a.Bn&&(a.$o&&!a.kl?(a.rd=+new Date,a.Bn=a.rd+a.md,a.kl=!0):a.bm(!1))}}} function Hh(a,b){for(var c=a.md,d=a.qc.iterator,e=a.kl;d.next();){var f=d.key;if(!(f instanceof Y&&null=f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=Th,l;for(l in g)"position"=l&&(g["position:placeholder"]||g["position:node"])||null=k.get(l)||k.get(l)(f,h[l],g[l],a.dr,b,c,a)}}}t.stop=function(){this.gc&&this.bm(!0)}; t.bm=function(a){null!=this.Ku&&this.Ku.jp.remove(this.Yw);if(this.gc){var b=this.B,c=this.zc;this.ll=this.gc=c.dl=!1;Gh(c);for(var d=this.qc,e=this.Tl.iterator;e.next();)b.remove(e.value);for(e=this.pu.iterator;e.next();)e.value.o();e=this.$o;d=d.iterator;for(var f=Th;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.cv,n;for(n in l)if(null!f.get(n)){var p=n;!h.Yu||"position:node"!p&&"position:placeholder"!p||(p="position");f.get(p)(g,k[n],void 0!m[n]?m[n]:h.Yu?k[n]: l[n],this.dr,this.md,this.md,this)}h.Yu&&void 0!m.location&&g instanceof T&&(g.location=m.location);h.Fv&&g instanceof T&&g.Nb(!1)}if(c.defaultAnimation=this)for(n=this.B.links;n.next();)e=n.value,null=e.jh?(d=e.path,null!d&&(e.yc=!1,e.o(),d.o())):(e.points=e.jh,e.jh=null);b.kt.clear();lf(b,!1);b.Ta();b.N();Lf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.uw);Ih(c);this.vu++;!a&&this.yu>this.vu?(this.kl=!1,this.start()):(this.Cn&&this.Cn(this),Dh(this),c.bm(this),b.Xb())}}; t.Pj=function(a,b){var c=b.actualBounds,d=null;b instanceof S&&(d=b.placeholder);null!d?(c=d.ga(xc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new H(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof S)for(a=a.memberParts;a.next();)d=a.value,d instanceof U&&this.Pj(d,b)}; t.Nj=function(a,b){if(a.isVisible()){var c=null;b instanceof S&&(c=b.placeholder);null!c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:node",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.qc;c.contains(a)&&(c.H(a).Fv=!0);if(a instanceof S)for(a=a.memberParts;a.next();)c=a.value,c instanceof U&&this.Nj(c,b)}};t.wz=function(a),this.ou.add(a,b));return b}; ma.Object.defineProperties(yh.prototype,{duration:{get:function(),set:function(a){1>a&&va(a,">= 1",yh,"duration");this.Rg=a}},reversible:{get:function(){return this.$o},set:function(a){this.$o=a}},runCount:{get:function(),set:function(a){0<a?this.yu=a:B("Animation.runCount value must be a positive integer.")}},finished:{get:function(), set:function(a){this.Cn!a&&(this.Cn=a)}},easing:{get:function(),set:function(a)},isViewportUnconstrained:{get:function(),set:function(a)},isAnimating:{get:function()}});yh.prototype.getTemporaryState=yh.prototype.wz;yh.prototype.stop=yh.prototype.stop;yh.prototype.add=yh.prototype.add;yh.prototype.addTemporaryPart=yh.prototype.Ay; function Uh(a,b,c,d){a/=d/2;return 1>a?c/2aa+b:-c/2*(--a*(a-2)-1)+b}function Wh(a,b,c,d)yh.className="Animation";yh.EaseLinear=function(a,b,c,d){return ca/d+b};yh.EaseInOutQuad=Uh;yh.EaseInQuad=function(a,b,c,d){return c(a/=d)a+b};yh.EaseOutQuad=function(a,b,c,d){return-c(a/=d)*(a-2)+b};yh.EaseInExpo=function(a,b,c,d){return 0=a?b:cMath.pow(2,10(a/d-1))+b};yh.EaseOutExpo=Wh; function Zh(a,b,c);this.Yu=c;this.Fv=!1}Zh.className="AnimationState";function $h(a,b,c){this.bd=null;this.Ye=a;this.Cp=c||ai;this.Bk=null;void 0!b&&(this.Bk=b,void 0=c&&(this.Cp=bi))}$h.prototype.copy=function(){var a=new $h(this.Ye);a.Cp=this.Cp;var b=this.Bk;if(null!b);void 0!b.duration&&(c.wx=b.duration);void 0!b.finished&&(c.wx=b.finished);void 0!b.easing&&(c.wx=b.easing);a.Bk=c}return a}; function ci(a,b)ma.Object.defineProperties($h.prototype,{propertyName:{get:function(),set:function(a)},animationSettings:{get:function(),set:function(a)},startCondition:{get:function(),set:function(a)}}); var ai=new D($h,"Default",1),bi=new D($h,"Immediate",2),di=new D($h,"Bundled",3);$h.className="AnimationTrigger";$h.Default=ai;$h.Immediate=bi;$h.Bundled=di;function ei(){Za(this);this.B=null;this.Ca=new E;this.Qa="";this.ob=1;this.u=!1;this.Ej=this.I=this.Uh=this.Th=this.Sh=this.Rh=this.Ph=this.Qh=this.Oh=this.Wh=this.Nh=this.Vh=this.Mh=this.Lh=!0;this.l=!1;this.No=[]}t=ei.prototype;t.clear=function(){this.Ca.clear();this.No.length=0};t.Wd=function(a); t.toString=function(a){void 0=a&&(a=0);var b=‘Layer "‘+this.name+‘"‘;if(0>=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ca.iterator;h.next();){var k=h.value;k instanceof S?e++:k instanceof U?d++:k instanceof Q?f++:k instanceof De?g++:c++}h="";0<c&&(h+=c+" Parts ");0<d&&(h+=d+" Nodes ");0<e&&(h+=e+" Groups ");0<f&&(h+=f+" Links ");0<g&&(h+=g+" Adornments ");if(1<a)for(a=this.Ca.iterator;a.next();)c=a.value,h+=" "+c.toString(),d=c.data,null!d&&lb(d)&&(h+=" #"+lb(d)),c instanceof U?h+=" "+ Ia(d):c instanceof Q&&(h+=" "+Ia(c.fromNode)+" "+Ia(c.toNode));return b+" "+this.Ca.count+": "+h};t.Sb=function(a,b,c){void 0=b&&(b=null);void 0=c&&(c=null);if(!1=this.Ej)return null;var d=!1;null!this.diagram&&this.diagram.viewportBounds.$(a)&&(d=!0);for(var e=H.alloc(),f=this.Ca.j,g=f.length;g--;){var h=f[g];if((!0!d||!1!Jf(h))&&h.isVisible()&&(e.assign(a),zb(e,h.sd),h=h.Sb(e,b,c),null!h&&(null!b&&(h=b(h)),null!h&&(null=c||c(h)))))return H.free(e),h}H.free(e);return null}; t.Ni=function(a,b,c,d){void 0=b&&(b=null);void 0=c&&(c=null);d instanceof E||d instanceof F||(d=new F);if(!1=this.Ej)return d;var e=!1;null!this.diagram&&this.diagram.viewportBounds.$(a)&&(e=!0);for(var f=H.alloc(),g=this.Ca.j,h=g.length;h--;)}H.free(f);return d}; t.wg=function(a,b,c,d,e){void 0=b&&(b=null);void 0=c&&(c=null);void 0=d&&(d=!1);e instanceof E||e instanceof F||(e=new F);if(!1=this.Ej)return e;var f=!1;null!this.diagram&&this.diagram.viewportBounds.nf(a)&&(f=!0);for(var g=this.Ca.j,h=g.length;h--;)}return e}; t.xg=function(a,b,c,d,e,f){void 0=c&&(c=null);void 0=d&&(d=null);void 0=e&&(e=!0);if(!1!e&&!0!e){if(e instanceof E||e instanceof F)f=e;e=!0}f instanceof E||f instanceof F||(f=new F);if(!1=this.Ej)return f;var g=!1;null!this.diagram&&this.diagram.viewportBounds.$(a)&&(g=!0);for(var h=H.alloc(),k=H.alloc(),l=this.Ca.j,m=l.length;m--;){var n=l[m];if((!0!g||!1!=Jf(n))&&n.isVisible()){h.assign(a);zb(h,n.sd);k.h(a.x+b,a.y);zb(k,n.sd);var p=n;n.xg(h,k,c,d,e,f)&&(null!c&&(p=c(p)),null p||null!d&&!d(p)||f.add(p))}}H.free(h);H.free(k);return f}; t.xd=function(a,b){if(this.visible){var c=void 0=b?a.viewportBounds:b;var d=this.Ca.j,e=d.length;a=Da();b=Da();for(var f=0;f<e;f++){var g=d[f];g.Jw=f;g instanceof Q&&!1=g.yc||g instanceof De&&null!g.adornedPart||(ec(g.actualBounds,c,10)?(g.xd(!0),a.push(g)):(g.xd(!1),null!g.adornments&&0<g.adornments.count&&b.push(g)))}for(c=0;c<a.length;c++)for(d=a[c],fi(d),d=d.adornments;d.next();)e=d.value,e.measure(Infinity,Infinity),e.arrange(),e.xd(!0);for(c=0;c<b.length;c++)d=b[c],d.updateAdornments(), gi(d,!0);Fa(a);Fa(b)}};function hi(a,b)t.tb=function(a,b,c){if(this.visible&&0!this.ob&&(void 0=c&&(c=!0),c||!this.isTemporary)){c=this.Ca.j;var d=c.length;if(0!d){var e=hi(this,a),f=this.No;f.length=0;for(var g=b.scale,h=0;h<d;h++){var k=c[h];if(Jf(k)){if(k instanceof Q&&(k.isOrthogonal&&f.push(k),!1=k.yc))continue;var l=k.actualBounds;l.widthg>b.ke||l.heightg>b.ke?k.tb(a,b):ii(a,k)}}a.globalAlpha=e}}}; function ii(a,b){var c=b.actualBounds,d=b.naturalBounds;if(0!c.width&&0!c.height&&!isNaN(c.x)&&!isNaN(c.y)&&b.isVisible()){var e=b.transform;null!b.areaBackground&&(ji(b,a,b.areaBackground,!0,!0,d,c),a.fillRect(c.x,c.y,c.width,c.height));null=b.areaBackground&&null=b.background&&(ji(b,a,"rgba(0,0,0,0.3)",!0,!1,d,c),a.fillRect(c.x,c.y,c.width,c.height));null!b.background&&(a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),ji(b,a,b.background,!0,!1,d,c),a.fillRect(0,0,d.width/2,d.height/2), e.gt()||(b=1/(e.m11e.m22-e.m12e.m21),a.transform(e.m22b,-e.m12b,-e.m21b,e.m11b,b*(e.m21e.dy-e.m22e.dx),b*(e.m12e.dx-e.m11e.dy))))}}t.g=function(a,b,c,d,e);t.Vi=function(a,b,c){var d=this.Ca;b.ni=this;if(a>=d.count)a=d.count;else if(d.L(a)b)return-1;d.Kb(a,b);b.gq(c);d=this.diagram;null!==d&&(c?d.N():d.Vi(b));ki(this,a,b);return a}; t.Fc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Fc(a,b,c);var d=this.Ca;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.L(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.hq(c);d.jb(a);d=this.diagram;null!==d&&(c?d.N():d.Fc(b));b.ni=null;return a}; function ki(a,b,c){b=li(a,b,c);if(c instanceof S&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ca.j,f=e.length,g=0;g<f;g++)!(0>d)&&d<b&&(e=a.Ca,e.jb(b),e.Kb(d,c))}c=c.containingGroup;null!c&&ki(a,-1,c)}} function li(a,b,c){var d=c.zOrder;if(isNaN(d))return b;a=a.Ca;var e=a.count;if(1>=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,g=NaN;0<=f;)for(var h=b+1,k=NaN;h<e;)if(!isNaN(g)&&g>d)for(;;){if(-1f||g<=d){f++;if(f=b)break;a.jb(b);a.Kb(f,c);return f}for(g=NaN;0<=--f&&(g=a.L(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k<d)for(;;){if(h=e||k>=d){h--;if(h=b)break;a.jb(b);a.Kb(h,c);return h}for(k=NaN;h< e&&(k=a.L(h).zOrder,isNaN(k)););}return b} ma.Object.defineProperties(ei.prototype,{parts:{get:function()},partsBackwards:{get:function()},diagram:{get:function()},name:{get:function(),set:function(a){var b=this.Qa;if(b!==a){var c=this.diagram;if(null!=c)for(""=b&&B("Cannot rename default Layer to: "+a),c=c.layers;c.next();)c.value.name a&&B("Layer.name is already present in this diagram: "+a);this.Qa=a;this.g("name",b,a);for(a=this.Ca.iterator;a.next();)a.value.layerName=this.Qa}}},opacity:{get:function(),set:function(a){var b=this.ob;b!==a&&((0>a||1<a)&&va(a,"0 ? value ? 1",ei,"opacity"),this.ob=a,this.g("opacity",b,a),a=this.diagram,null!==a&&a.N())}},isTemporary:{get:function(),set:function(a){var b=this.u;b!==a&&(this.u=a,this.g("isTemporary", b,a))}},visible:{get:function(),set:function(a)}},pickable:{get:function(),set:function(a)},isBoundsIncluded:{get:function(),set:function(a){this.l!==a&&(this.l=a,null!==this.diagram&& this.diagram.Ta())}},allowCopy:{get:function(),set:function(a)},allowDelete:{get:function(),set:function(a)},allowTextEdit:{get:function(),set:function(a)},allowGroup:{ get:function(),set:function(a)},allowUngroup:{get:function(),set:function(a)},allowLink:{get:function(),set:function(a)},allowRelink:{get:function(),set:function(a)},allowMove:{get:function(),set:function(a)},allowReshape:{get:function(),set:function(a)},allowResize:{get:function(),set:function(a)}, allowRotate:{get:function(),set:function(a)},allowSelect:{get:function(),set:function(a)}});ei.prototype.findObjectsNear=ei.prototype.xg;ei.prototype.findObjectsIn=ei.prototype.wg;ei.prototype.findObjectsAt=ei.prototype.Ni;ei.prototype.findObjectAt=ei.prototype.Sb;ei.className="Layer"; function P(a){function b(){c.removeEventListener(x.document,"DOMContentLoaded",b,!1);c.setRTL()}1<arguments.length&&B("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");mi||(ni(),mi=!0);Za(this);ze=this;Qa=[];this.Gb=!0;this.zc=new uh;this.zc.Wd(this);this.qb=17;this.Tn=this.Sw=!1;this.xu="default";this.Fa=null;var c=this;Vg&&(null!==x.document.body?this.setRTL():c.addEventListener(x.document,"DOMContentLoaded",b,!1));this.Ka=new E;this.ua=this.va=0;this.Ba= null;this.uu=new G;this.lg=this.Xc=null;this.Mv();this.hl=null;this.Lv();this.ob=1;this.la=(new H(NaN,NaN)).freeze();this.Rw=new H(NaN,NaN);this.gr=this.ya=1;this.Br=(new H(NaN,NaN)).freeze();this.Cr=NaN;this.Wr=1E-4;this.Ur=100;this.rb=new sd;this.Ls=(new H(NaN,NaN)).freeze();this.sr=(new M(NaN,NaN,NaN,NaN)).freeze();this.zi=(new pc(0,0,0,0)).freeze();this.Ai=Vh;this.us=!1;this.ps=this.ls=null;this.Jg=oi;this.gj=$c;this.Tf=oi;this.On=$c;this.Dr=this.Ar=xc;this.nc=!0;this.Pn=!1;this.Gd=new F;this.di= new G;this.vn=!0;this.Wm=250;this.Ck=-1;this.Xm=(new pc(16,16,16,16)).freeze();this.Sk=this.cd=!1;this.Xk=!0;this.ei=new ne;this.ei.diagram=this;this.Xe=new ne;this.Xe.diagram=this;this.uj=new ne;this.uj.diagram=this;this.le=this.If=null;this.Ql=!1;this.Tt=this.Ut=null;this.Rq=x.PointerEvent&&(Ta||Ua||Va)&&x.navigator&&!1!==x.navigator.msPointerEnabled;pi(this);this.Fi=new F;this.Lr=!0;this.Gs=wi;this.kd=!1;this.Is=Pf;this.Ja=null;xi.add("Model",yi);this.Y=this.Ia=this.Za=null;this.cr=;this.sn= "auto";this.$f=this.Zr=this.bg=this.cg=this.eg=this.Kf=this.Of=this.Jf=null;this.zr=!1;this.Lf=this.qg=this.dg=this.ag=null;this.nu=!1;this.su=;this.Al=[null,null];this.I=null;this.St=this.Du=this.De=this.lh=!1;this.Vc=!0;this.qj=this.$b=!1;this.ac=null;var d=this;this.Bf=function(a)finally}};this.Ih=function(a){d.partManager.doModelChanged(a)}; this.bx=!0;this.fe=-2;this.Fj=new G;this.ru=new E;this.Uf=!1;this.Mh=this.Lh=this.Jq=this.Lc=!0;this.Kq=!1;this.Qq=this.Oq=this.Uh=this.Th=this.Sh=this.Rh=this.Ph=this.Qh=this.Oh=this.Nq=this.Wh=this.Nh=this.Vh=this.Lq=!0;this.Yg=this.Ic=!1;this.Pq=this.Mq=this.al=this.$k=!0;this.ts=this.rs=16;this.Au=this.qs=!1;this.lp=this.ss=null;this.Bu=this.Cu=0;this.bb=(new pc(5)).freeze();this.Tw=(new F).freeze();this.Vr=999999999;this.Gw=(new F).freeze();this.hi=this.oj=this.nj=!0;this.Rf=this.Ne=!1;this.hc= null;this.Ig=!0;this.Oe=!1;this.Hq=new F;this.Hw=new F;this.Qb=null;this.Lo=1;this.Uw=0;this.te={scale:1,position:new H,bounds:new M,Hx:!1};this.ax=(new M(NaN,NaN,NaN,NaN)).freeze();this.Np=(new Kb(NaN,NaN)).freeze();this.tn=(new M(NaN,NaN,NaN,NaN)).freeze();this.Mr=!1;this.kr=null;zi(this);this.Rr=this.xr=this.cs=this.yw=this.xw=this.zw=this.ah=this.fi=this.fg=null;Ai(this);this.Fb=null;this.wr=!1;this.Kk=null;this.partManager=new yi;this.toolManager=new Na;this.toolManager.initializeStandardTools(); this.currentTool=this.defaultTool=this.toolManager;this.jr=null;this.Mk=new Re;this.fs=this.es=null;this.Ep=!1;this.commandHandler=Bi();this.model=Ci();this.lh=!0;this.layout=new Di;this.lh=!1;this.Bw=this.Wt=null;this.Pb=1;this.qh=null;this.ke=1;this.xo=0;this.yo=[0,0,0,0,0];this.zo=0;this.Jd=1;this.pl=0;this.Or=new H;this.Ju=500;this.Sq=new H;this.Pe=!1;this.preventDefault=this.tt=this.pm=this.qm=this.om=this.nm=this.lk=this.nk=this.mk=this.jk=this.kk=this.gw=this.Zv=this.$v=this.aw=this.yi=this.fp= this.xi=this.ep=null;this.u=!1;this.gi=new Ei;this.Cs=!1;void 0!==a&&Fi(this,a);this.Gb=!1;this.ur=null;this.vr=Jb}P.prototype.clear=function(){this.model.clear();Gi=null;Hi=;Ii(this,!1);this.tn=(new M(NaN,NaN,NaN,NaN)).freeze();this.N()}; function Ii(a,b){a.animationManager.Uc(!0);a.Tw=(new F).freeze();a.Gw=(new F).freeze();var c=a.skipsUndoManager;null!==a.model&&(a.skipsUndoManager=!0);var d=null;null!==a.Fb&&(d=a.Fb.part,null!==d&&a.remove(d));var e=[],f=a.Ka.length;if(b){for(b=0;b<f;b)for(var g=a.Ka.j[b].parts;g.next();)for(b=0;b<e.length;b++)a.remove(e[b])}for(b=0;b<f;b++)a.Ka.j[b].clear();a.Gd.clear();a.di.clear();a.Fi.clear();a.Kk=null;Ea=[];null!d&&(a.add(d),a.partManager.parts.remove(d)); null!a.model&&(a.skipsUndoManager=c);return e}function Bi() P.prototype.reset=function(){this.Gb=!0;this.clear();this.zc.Uc();this.zc=new uh;this.zc.Wd(this);this.Ka=new E;this.Mv();this.Lv();this.la=(new H(NaN,NaN)).freeze();this.ya=1;this.Br=(new H(NaN,NaN)).freeze();this.Cr=NaN;this.Wr=1E-4;this.Ur=100;this.Ls=(new H(NaN,NaN)).freeze();this.sr=(new M(NaN,NaN,NaN,NaN)).freeze();this.zi=(new pc(0,0,0,0)).freeze();this.Ai=Vh;this.us=!1;this.ps=this.ls=null;this.Jg=oi;this.gj=$c;this.Tf=oi;this.On=$c;this.Dr=this.Ar=xc;this.Wm=250;this.Xm=(new pc(16,16,16, 16)).freeze();this.Lr=!0;this.Gs=wi;this.Is=Pf;this.sn="auto";this.$f=this.Zr=this.bg=this.cg=this.eg=this.Kf=this.Of=this.Jf=null;this.zr=!1;this.Lf=this.qg=this.dg=this.ag=null;this.Uf=!1;this.Mh=this.Lh=this.Jq=this.Lc=!0;this.Kq=!1;this.Pq=this.Mq=this.al=this.$k=this.Qq=this.Oq=this.Uh=this.Th=this.Sh=this.Rh=this.Ph=this.Qh=this.Oh=this.Nq=this.Wh=this.Nh=this.Vh=this.Lq=!0;this.ts=this.rs=16;this.bb=(new pc(5)).freeze();this.Vr=999999999;this.hc=null;this.Mr=!1;this.Pb=1;this.qh=null;this.xo= 0;this.yo=[0,0,0,0,0];this.zo=0;Ai(this);this.Fb=null;this.partManager=new yi;this.toolManager=new Na;this.toolManager.initializeStandardTools();this.fs=this.es=this.jr=null;this.Ep=!1;this.Mk.reset();this.uu=new G;this.uu.clear();this.currentTool=this.defaultTool=this.toolManager;this.commandHandler=Bi();this.lh=!0;zi(this);this.layout=new Di;this.lh=!1;this.model=Ci();this.model.undoManager=new we;this.Oe=!1;this.Xk=!0;this.Gb=this.cd=!1;this.N();this.le=this.If=null;pi(this);this.cr=}; function Ai(a){a.fg=new G;var b=new U,c=new Xg;c.bind(new Ji("text",,Ia));b.add(c);a.zw=b;a.fg.add(,b);b=new U;c=new Xg;c.stroke="brown";c.bind(new Ji("text",,Ia));b.add(c);a.fg.add("Comment",b);b=new U;b.selectable=!1;b.avoidable=!1;c=new W;c.figure="Ellipse";c.fill="black";c.stroke=null;c.desiredSize=(new Kb(3,3)).ca();b.add(c);a.fg.add("LinkLabel",b);a.fi=new G;b=new S;b.selectionObjectName="GROUPPANEL";b.type=X.Vertical;c=new Xg;c.font="bold 12pt sans-serif";c.bind(new Ji("text",,Ia)); b.add(c);c=new X(X.Auto);c.name="GROUPPANEL";var d=new W;d.figure="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new yg;d.padding=(new pc(5,5,5,5)).ca();c.add(d);b.add(c);a.xw=b;a.fi.add(,b);a.ah=new G;b=new Q;c=new W;c.isPanelMain=!0;b.add(c);c=new W;c.toArrow="Standard";c.fill="black";c.stroke=null;c.strokeWidth=0;b.add(c);a.yw=b;a.ah.add("",b);b=new Q;c=new W;c.isPanelMain=!0;c.stroke="brown";b.add(c);a.ah.add("Comment",b);b=new De;b.type=X.Auto;c=new W;c.fill=null;c.stroke= "dodgerblue";c.strokeWidth=3;b.add(c);c=new yg;c.margin=(new pc(1.5,1.5,1.5,1.5)).ca();b.add(c);a.cs=b;a.xr=b;b=new De;b.type=X.Link;c=new W;c.isPanelMain=!0;c.fill=null;c.stroke="dodgerblue";c.strokeWidth=3;b.add(c);a.Rr=b} P.prototype.setRTL=function(a){a=void 0=a?this.div:a;null=a&&(a=x.document.body);var b=ta("div");b.dir="rtl";b.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";b.textContent="A";a.appendChild(b);var c="reverse";0<b.scrollLeft?c="default":(b.scrollLeft=1,0=b.scrollLeft&&(c="negative"));a.removeChild(b);this.xu=c}; P.prototype.setScrollWidth=function(a){a=void 0=a?this.div:a;null=a&&(a=x.document.body);var b=0;if(Vg){var c=Ki;b=Li;null=c&&(c=Ki=ta("p"),c.style.width="100%",c.style.height="200px",c.style.boxSizing="content-box",b=Li=ta("div"),b.style.position="absolute",b.style.visibility="hidden",b.style.width="200px",b.style.height="150px",b.style.boxSizing="content-box",b.appendChild(c));b.style.overflow="hidden";a.appendChild(b);var d=c.offsetWidth;b.style.overflow="scroll";c=c.offsetWidth;d=c&&(c= b.clientWidth);a.removeChild(b);b=d-c;0!b||Xa||(b=11)}this.qb=b;this.Sw=!0};P.prototype.cb=function(a);P.prototype.toString=function(a){void 0=a&&(a=0);var b="";this.div&&this.div.id&&(b=this.div.id);b=‘Diagram "‘+b+‘"‘;if(0>=a)return b;for(var c=this.Ka.iterator;c.next();)b+=" "+c.value.toString(a-1);return b};P.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,d)}; P.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,d)}; function Mi(a){var b=a.Ba.Da;b instanceof HTMLCanvasElement&&(a.Rq?(a.addEventListener(b,"pointerdown",a.nm,!1),a.addEventListener(b,"pointermove",a.om,!1),a.addEventListener(b,"pointerup",a.qm,!1),a.addEventListener(b,"pointerout",a.pm,!1)):(a.addEventListener(b,"touchstart",a.aw,!1),a.addEventListener(b,"touchmove",a.$v,!1),a.addEventListener(b,"touchend",a.Zv,!1),a.addEventListener(b,"mousemove",a.kk,!1),a.addEventListener(b,"mousedown",a.jk,!1),a.addEventListener(b,"mouseup",a.mk,!1),a.addEventListener(b, "mouseout",a.lk,!1)),a.addEventListener(b,"mouseenter",a.Ty,!1),a.addEventListener(b,"mouseleave",a.Uy,!1),a.addEventListener(b,"wheel",a.nk,!1),a.addEventListener(b,"keydown",a.Mz,!1),a.addEventListener(b,"keyup",a.Nz,!1),a.addEventListener(b,"blur",a.Gy,!1),a.addEventListener(b,"focus",a.Hy,!1),a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"gesturestart",function(b){a.toolManager.gestureBehavior! Me&&(a.toolManager.gestureBehavior=Le?b.preventDefault():a.Pe&&a.lastInput.handled||(b.preventDefault(),a.Lo=a.scale,a.currentTool.doCancel()))},!1),a.addEventListener(b,"gesturechange",function(b){if(a.toolManager.gestureBehavior!Me)if(a.toolManager.gestureBehavior=Le)b.preventDefault();else if(!a.Pe||!a.lastInput.handled){b.preventDefault();var c=b.scale;if(null!a.Lo){var e=a.Ba.getBoundingClientRect();b=new H(b.pageX-window.scrollX-a.va/e.widthe.left,b.pageY-window.scrollY-a.ua/e.height e.top);c=a.Lo*c;e=a.commandHandler;if(c!a.scale&&e.canResetZoom(c))}}},!1),a.addEventListener(x,"resize",a.gw,!1))}function Ve(a){30<a.xo&&(a.qh=1)}function lf(a,b){null!a.qh&&(a.qh=null,b&&a.tt(),a.xo=0,a.yo=[0,0,0,0,0],a.zo=0)}P.prototype.computePixelRatio=function(){return null!this.qh?this.qh:x.devicePixelRatio||1};P.prototype.doMouseMove=function(){this.currentTool.doMouseMove()};P.prototype.doMouseDown=function(){this.currentTool.doMouseDown()}; P.prototype.doMouseUp=function(){this.currentTool.doMouseUp()};P.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()};P.prototype.doKeyDown=function(){this.currentTool.doKeyDown()};P.prototype.doKeyUp=function(){this.currentTool.doKeyUp()};P.prototype.doFocus=function(){this.focus()};P.prototype.focus=function(){if(this.Ba)if(this.scrollsPageOnFocus)this.Ba.focus();else};P.prototype.Hy=function(){this.B.R("GainedFocus")}; P.prototype.Gy=function(){this.B.R("LostFocus")};function Eh(a){if(null!a.Ba)}} function zi(a){var b=new ei;b.name="Background";a.Vl(b);b=new ei;b.name="";a.Vl(b);b=new ei;b.name="Foreground";a.Vl(b);b=new ei;b.name="Adornment";b.isTemporary=!0;a.Vl(b);b=new ei;b.name="Tool";b.isTemporary=!0;b.isBoundsIncluded=!0;a.Vl(b);b=new ei;b.name="Grid";b.allowSelect=!1;b.pickable=!1;b.isTemporary=!0;a.hx(b,a.dm("Background"))} function Ni(a){a.Fb=new X(X.Grid);a.Fb.name="GRID";var b=new W;b.figure="LineH";b.stroke="lightgray";b.strokeWidth=.5;b.interval=1;a.Fb.add(b);b=new W;b.figure="LineH";b.stroke="gray";b.strokeWidth=.5;b.interval=5;a.Fb.add(b);b=new W;b.figure="LineH";b.stroke="gray";b.strokeWidth=1;b.interval=10;a.Fb.add(b);b=new W;b.figure="LineV";b.stroke="lightgray";b.strokeWidth=.5;b.interval=1;a.Fb.add(b);b=new W;b.figure="LineV";b.stroke="gray";b.strokeWidth=.5;b.interval=5;a.Fb.add(b);b=new W;b.figure="LineV"; b.stroke="gray";b.strokeWidth=1;b.interval=10;a.Fb.add(b);b=new T;b.add(a.Fb);b.layerName="Grid";b.zOrder=0;b.isInDocumentBounds=!1;b.isAnimated=!1;b.pickable=!1;b.locationObjectName="GRID";a.add(b);a.partManager.parts.remove(b);a.Fb.visible=!1}function Oi(){this.B.Au?this.B.Au=!1:this.B.isEnabled?this.B.tx(this):Pi(this.B)}function Qi(a){this.B.isEnabled?(this.B.Cu=a.target.scrollTop,this.B.Bu=a.target.scrollLeft):Pi(this.B)} P.prototype.tx=function(a){if(null!this.Ba){this.qs=!0;var b=this.documentBounds,c=this.viewportBounds,d=this.zi,e=b.x-d.left,f=b.y-d.top,g=b.width+d.left+d.right,h=b.height+d.top+d.bottom,k=b.right+d.right;d=b.bottom+d.bottom;var l=c.x;b=c.y;var m=c.width,n=c.height,p=c.right,r=c.bottom;c=this.scale;var q=a.scrollLeft;if(this.Tn)switch(this.xu){case "negative":q=q+a.scrollWidth-a.clientWidth;break;case "reverse":q=a.scrollWidth-q-a.clientWidth}var u=q;m<g||n<h?(q=H.allocAt(this.position.x,this.position.y), this.allowHorizontalScroll&&this.Bu!u&&(q.x=u/c+e,this.Bu=u),this.allowVerticalScroll&&this.Cu!a.scrollTop&&(q.y=a.scrollTop/c+f,this.Cu=a.scrollTop),this.position=q,H.free(q),this.oj=this.qs=!1):(q=H.alloc(),a.ny&&this.allowHorizontalScroll&&(e<l&&(this.position=q.h(u+e,this.position.y)),k>p&&(this.position=q.h(-(this.ss.scrollWidth-this.va)+u-this.va/c+k,this.position.y))),a.oy&&this.allowVerticalScroll&&(f<b&&(this.position=q.h(this.position.x,a.scrollTop+f)),d>r&&(this.position=q.h(this.position.x, -(this.ss.scrollHeight-this.ua)+a.scrollTop-this.ua/c+d))),H.free(q),Ri(this),this.oj=this.qs=!1,b=this.documentBounds,c=this.viewportBounds,k=b.right,p=c.right,d=b.bottom,r=c.bottom,e=b.x,l=c.x,f=b.y,b=c.y,m>=g&&e>=l&&k<=p&&(this.lp.style.width="1px"),n>=h&&f>=b&&d<=r&&(this.lp.style.height="1px"))}};P.prototype.computeBounds=function(){0<this.Gd.count&&Si(this);return Ti(this)}; function Ti(a){if(a.fixedBounds.v())for(var c=!0,d=a.Ka.j,e=d.length,f=0;f<e;f++)}}c&&(b=new M(0,0,0,0));b.Tp(a.bb);return b} P.prototype.computePartsBounds=function(a,b){void 0=b&&(b=!1);var c=null;if(za(a))for(var d=0;d<a.length;d++){var e=a[d];!b&&e instanceof Q||(e.zb(),null=c?c=e.actualBounds.copy():c.Hc(e.actualBounds))}else for(a=a.iterator;a.next();)d=a.value,!b&&d instanceof Q||(d.zb(),null=c?c=d.actualBounds.copy():c.Hc(d.actualBounds));return null=c?new M(NaN,NaN,0,0):c}; function Ui(a,b){if((b||a.Oe)&&!a.Gb&&null!=a.Ba&&a.documentBounds.v()){if(b)c=H.alloc();c.Zi(a.documentBounds,a.initialDocumentSpot);var d=a.viewportBounds;d=M.allocAt(0,0,d.width,d.height);var e=H.alloc();e.Zi(d,a.initialViewportSpot);e.h(c.x-e.x,c.y-e.y);a.position=e;M.free(d);H.free(e);H.free(c)}a.Gb=!0;c=a.Jg;b&&a.Tf!oi&&(c=a.Tf);d=c!oi?Vi(a,c):a.scale;c=a.viewportBounds.copy();e=a.va/d;var f=a.ua/d,g=a.gj,h=a.On;b&&!g.eb()&&(h.eb()|| h.Mb())&&(g=h.Mb()?Bc:h);Wi(a,a.documentBounds,e,f,g,b);b=a.scale;a.scale=d;a.Gb=!1;d=a.viewportBounds;d.Ma(c)||a.qq(c,d,b,!1);Xi(a);Yi(a,!0,!1)}} function Vi(a,b){var c=a.gr;if(null=a.Ba)return c;Zi(a);var d=a.documentBounds;if(!d.v())return c;var e=d.width;d=d.height;var f=a.va+(a.Rf?a.qb:0),g=a.ua+(a.Ne?a.qb:0),h=f/e,k=g/d;return b$i?(b=Math.min(k,h),b>c&&(b=c),b<a.minScale&&(b=a.minScale),b>a.maxScale&&(b=a.maxScale),b):b=aj?(b=k>h?(g-a.qb)/d:(f-a.qb)/e,b>c&&(b=c),b<a.minScale&&(b=a.minScale),b>a.maxScale&&(b=a.maxScale),b):a.scale} P.prototype.zoomToFit=function();t=P.prototype; t.tA=function(a,b){void 0=b&&(b=$i);var c=a.width,d=a.height;if(!(0=c||0=d||isNaN(c)&&isNaN(d))){var e=1;if(b$i||b=aj)if(isNaN(c))e=this.viewportBounds.heightthis.scale/d;else if(isNaN(d))e=this.viewportBounds.widththis.scale/c;elsethis.scale=e;this.position=new H(a.x,a.y)}}; t.By=function(a,b){Zi(this);var c=this.documentBounds,d=this.viewportBounds;this.position=new H(c.x+(a.xc.width+a.offsetX)-(b.xd.width-b.offsetX),c.y+(a.yc.height+a.offsetY)-(b.yd.height-b.offsetY))};t.oz=function(a){if(a instanceof Y)else this.ur=null,this.vr=Jb}; function Wi(a,b,c,d,e,f)if(f||a.scrollMode=Vh)e.eb()&&(c>b.width&&(h=b.x+(e.xb.width+e.offsetX)-(e.xc-e.offsetX)),d>b.height&&(k=b.y+(e.yb.height+e.offsetY)-(e.yd-e.offsetY))),e=a.zi,f=c-b.width,c<b.width+e.left+e.right?(h=Math.min(h+c/2,b.right+Math.max(f,e.right)-c/2),h=Math.max(h,b.left-Math.max(f,e.left)+c/2),h-=c/2):h>b.left?h=b.left:h<b.right- c&&(h=b.right-c),c=d-b.height,d<b.height+e.top+e.bottom?(k=Math.min(k+d/2,b.bottom+Math.max(c,e.bottom)-d/2),k=Math.max(k,b.top-Math.max(c,e.top)+d/2),k-=d/2):k>b.top?k=b.top:k<b.bottom-d&&(k=b.bottom-d);g.x=isFinite(h)?h:-a.bb.left;g.y=isFinite(k)?k:-a.bb.top;null!a.positionComputation&&(b=a.positionComputation(a,g),g.x=b.x,g.y=b.y);a.zc.ic&&Oh(a.zc,a.la,g);a.la.h(g.x,g.y);H.free(g)} t.em=function(a,b){void 0=b&&(b=!0);if(b){if(a=xf(this,a,function(a),function(a){return a.canSelect()}),a instanceof T)return a}else if(a=xf(this,a,function(a)),a instanceof T)return a;return null};t.Sb=function(a,b,c){void 0=b&&(b=null);void 0=c&&(c=null);Si(this);for(var d=this.Ka.iteratorBackwards;d.next();)return null}; function xf(a,b,c,d){void 0=c&&(c=null);void 0=d&&(d=null);Si(a);for(a=a.Ka.iteratorBackwards;a.next();)return null}t.cz=function(a,b,c){void 0=b&&(b=!0);return bj(this,a,function(a),b?function(a){return a instanceof T&&a.canSelect()}:null,c)}; function bj(a,b,c,d,e){void 0=c&&(c=null);void 0=d&&(d=null);e instanceof E||e instanceof F||(e=new F);Si(a);for(a=a.Ka.iteratorBackwards;a.next();)return e}t.Ni=function(a,b,c,d){void 0=b&&(b=null);void 0=c&&(c=null);d instanceof E||d instanceof F||(d=new F);Si(this);for(var e=this.Ka.iteratorBackwards;e.next();)return d}; t.Ax=function(a,b,c,d){void 0=b&&(b=!1);void 0=c&&(c=!0);return cj(this,a,function(a){return a instanceof T&&(!c||a.canSelect())},b,d)};t.wg=function(a,b,c,d,e){void 0=b&&(b=null);void 0=c&&(c=null);void 0=d&&(d=!1);e instanceof E||e instanceof F||(e=new F);Si(this);for(var f=this.Ka.iteratorBackwards;f.next();)return e}; function cj(a,b,c,d,e){var f=null;void 0=f&&(f=null);void 0=c&&(c=null);void 0=d&&(d=!1);e instanceof E||e instanceof F||(e=new F);Si(a);for(a=a.Ka.iteratorBackwards;a.next();)return e}t.dz=function(a,b,c,d,e){void 0=c&&(c=!0);void 0=d&&(d=!0);return dj(this,a,b,function(a){return a instanceof T&&(!d||a.canSelect())},c,e)}; t.xg=function(a,b,c,d,e,f){void 0=c&&(c=null);void 0=d&&(d=null);void 0=e&&(e=!0);if(!1!e&&!0!e){if(e instanceof E||e instanceof F)f=e;e=!0}f instanceof E||f instanceof F||(f=new F);Si(this);for(var g=this.Ka.iteratorBackwards;g.next();)return f}; function dj(a,b,c,d,e,f){var g=null;void 0=g&&(g=null);void 0=d&&(d=null);void 0=e&&(e=!0);if(!1!e&&!0!e){if(e instanceof E||e instanceof F)f=e;e=!0}f instanceof E||f instanceof F||(f=new F);Si(a);for(a=a.Ka.iteratorBackwards;a.next();)return f}P.prototype.acceptEvent=function(a){return ej(this,a,a instanceof MouseEvent)}; function ej(a,b,c){var d=a.Xe;a.Xe=a.uj;a.uj=d;d.diagram=a;d.event=b;c?fj(a,b,d):(d.viewPoint=a.Xe.viewPoint,d.documentPoint=a.Xe.documentPoint);a=0;b.ctrlKey&&(a+=1);b.altKey&&(a+=2);b.shiftKey&&(a+=4);b.metaKey&&(a+=8);d.modifiers=a;d.button=b.button;void 0=b.buttons||Sa||(d.buttons=b.buttons);Wa&&0=b.button&&b.ctrlKey&&(d.button=2);d.down=!1;d.up=!1;d.clickCount=1;d.delta=0;d.handled=!1;d.bubbles=!1;d.timestamp=b.timeStamp;d.isMultiTouch=!1;d.targetDiagram=gj(b);d.targetObject=null;return d} function gj(a){var b=a.target.B;if(!b){var c=a.path;c||"function"!typeof a.composedPath||(c=a.composedPath());c&&c[0]&&(b=c[0].B)}return b?b:null}function hj(a,b,c,d) function jj(a,b,c,d){var e;d=ij(a,b,!1,!1,!1,d);null!c?((e=x.document.elementFromPoint(c.clientX,c.clientY))&&e.B?(b=c,c=e.B):(b=void 0!b.targetTouches?b.targetTouches[0]:b,c=a),d.targetDiagram=c,fj(a,b,d)):null!a.Xe?(d.documentPoint=a.Xe.documentPoint,d.viewPoint=a.Xe.viewPoint,d.targetDiagram=a.Xe.targetDiagram):null!a.ei&&(d.documentPoint=a.ei.documentPoint,d.viewPoint=a.ei.viewPoint,d.targetDiagram=a.ei.targetDiagram);d.targetObject=null;return d} function ij(a,b,c,d,e,f){var g=a.Xe;a.Xe=a.uj;a.uj=g;g.diagram=a;g.clickCount=1;var h=g.delta=0;b.ctrlKey&&(h+=1);b.altKey&&(h+=2);b.shiftKey&&(h+=4);b.metaKey&&(h+=8);g.modifiers=h;g.button=0;g.buttons=1;g.event=b;g.timestamp=b.timeStamp;a.Rq&&b instanceof x.PointerEvent&&"touch"!b.pointerType&&(g.button=b.button,void 0=b.buttons||Sa||(g.buttons=b.buttons),Wa&&0=b.button&&b.ctrlKey&&(g.button=2));g.down=c;g.up=d;g.handled=!1;g.bubbles=e;g.isMultiTouch=f;return g} function kj(a,b){if(a.bubbles)return!0;void 0!b.stopPropagation&&b.stopPropagation();!1!b.cancelable&&b.preventDefault();b.cancelBubble=!0;return!1} P.prototype.Mz=function(a){var b=this.B;if(!this.B.isEnabled)return!1;var c=ej(b,a,!1);c.key=String.fromCharCode(a.which);c.down=!0;switch(a.which){case 8:c.key="Backspace";break;case 33:c.key="PageUp";break;case 34:c.key="PageDown";break;case 35:c.key="End";break;case 36:c.key="Home";break;case 37:c.key="Left";break;case 38:c.key="Up";break;case 39:c.key="Right";break;case 40:c.key="Down";break;case 45:c.key="Insert";break;case 46:c.key="Del";break;case 48:c.key="0";break;case 187:case 61:case 107:c.key= "Add";break;case 189:case 173:case 109:c.key="Subtract";break;case 27:c.key="Esc"}b.doKeyDown();return kj(c,a)}; P.prototype.Nz=function(a){var b=this.B;if(!b.isEnabled)return!1;var c=ej(b,a,!1);c.key=String.fromCharCode(a.which);c.up=!0;switch(a.which){case 8:c.key="Backspace";break;case 33:c.key="PageUp";break;case 34:c.key="PageDown";break;case 35:c.key="End";break;case 36:c.key="Home";break;case 37:c.key="Left";break;case 38:c.key="Up";break;case 39:c.key="Right";break;case 40:c.key="Down";break;case 45:c.key="Insert";break;case 46:c.key="Del"}b.doKeyUp();return kj(c,a)}; P.prototype.Ty=function(a){var b=this.B;if(!b.isEnabled)return!1;var c=ej(b,a,!0);null!b.mouseEnter&&b.mouseEnter(c);return kj(c,a)};P.prototype.Uy=function(a){var b=this.B;if(!b.isEnabled)return!1;var c=ej(b,a,!0);null!b.mouseLeave&&b.mouseLeave(c);return kj(c,a)}; P.prototype.getMouse=function(a){var b=this.Ba;if(null=b)return new H(0,0);var c=b.getBoundingClientRect();b=a.clientX-this.va/c.widthc.left;a=a.clientY-this.ua/c.heightc.top;return null!this.rb?zb(new H(b,a),this.rb):new H(b,a)}; function fj(a,b,c) function oe(a,b,c,d){if(void 0!b.targetTouches){if(2>b.targetTouches.length)return;b=b.targetTouches[c]}else if(null!a.Al[0])b=a.Al[c];else return;c=a.Ba;null!c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.va/c.widthc.left,b.clientY-a.ua/c.heightc.top))}t=P.prototype;t.Ta=function(){this.nj||(this.nj=!0,this.Xb(!0))};function lj(a){a.$b||Si(a);Zi(a)}t.wf=function(){this.Gb||this.$b||(this.N(),Xi(this),Ri(this),this.Ta(),this.ud())};t.Lz=function(); t.Oy=function(a){void 0=a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.Uc();b.isEnabled=!1;Lf(this);this.Oe=!1;b.isEnabled=c;null!a&&sa(function(){zh(b,"Model");a()},1)};t.Xb=function(a){void 0=a&&(a=!1);if(!0!this.cd&&!(this.Gb||!1=a&&this.$b)))}};t.ud=function(){if(!this.Xk||this.cd)this.Xk&&(this.Xk=!1),Lf(this)}; function Yi(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Gb||!a.oj||Pi(a)||(b&&Si(a),c&&Ui(a,!1))} function Lf(a,b){if(!a.$b&&(a.cd=!1,null!a.Fa||a.Np.v())){a.$b=!0;var c=a.animationManager,d=a.ru;if(!c.isAnimating&&0!=d.length){for(var e=d.j,f=e.length,g=0;g<f;g++)d.clear()}d=a.Hw;0<d.count&&(d.each(function(a){a.fw()}),d.clear());e=d=!1;c.isAnimating&&(e=!0,d=a.skipsUndoManager,a.skipsUndoManager=!0);c.ic||Eh(a);null!a.Fb&&(a.Fb.visible&&!a.wr&&(nj(a),a.wr=!0),!a.Fb.visible&&a.wr&&(a.wr=!1));Si(a);f=!1;if(!a.Oe||a.Ig)a.Oe?oj(a,!a.Sk):(a.ta("Initial Layout"),!1 c.isEnabled&&c.Uc(),oj(a,!1)),f=!0;a.Sk=!1;Si(a);a.Du||lj(a);g=!1;f?(a.Oe||(g=a.Oe=!0,pj(a)),a.R("LayoutCompleted")):c.dl&&c.$w&&(a.Tf!oi?a.scale=Vi(a,a.Tf):a.Jg!oi?a.scale=Vi(a,a.Jg):(c=a.initialScale,isFinite(c)&&0<c&&(a.scale=c)),Ui(a,!0));Si(a);Yi(a,!0,!1);f&&g&&(a.Ua("Initial Layout"),a.skipsUndoManager||a.undoManager.clear(),sa(function(),1));a.Su();b||a.tb(a.Xc);e&&(a.skipsUndoManager=d);a.$b=!1}} function pj(a)function Si(a){if((a.$b||!a.animationManager.isTicking)&&0!a.Gd.count){for(var b=0;23>b;b++){var c=a.Gd.iterator;if(null=c||0=a.Gd.count)break;a.Gd=new F;a.fw(c,a.Gd)}a.nodes.each(function(a){a instanceof S&&0!(a.P&65536)!!1&&(a.P=a.P^65536)})}} t.fw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Ub()||c instanceof S||(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof S&&c.isVisible()&&qj(this,c);for(a.reset();a.next();)c=a.value,c instanceof Q&&c.isVisible()&&(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof De&&c.isVisible()&&(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function qj(a,b){for(var c=Da(),d=Da(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof S?(rj(f)||sj(f)||tj(f))&&qj(a,f):f instanceof Q?f.fromNode=b||f.toNode=b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;e<a;e++)f=c[e],f.measure(Infinity,Infinity),f.arrange();Fa(c);b.measure(Infinity,Infinity);b.arrange();a=d.length;for(b=0;b<a;b++)c=d[b],c.measure(Infinity,Infinity),c.arrange();Fa(d)} t.xd=function(a,b,c,d){if(this.hi||this.animationManager.isAnimating)for(var e=0;e<b;e++)a[e].xd(c,d)}; t.tb=function(a,b){void 0=b&&(b=null);if(null!this.Fa){null=this.Ba&&B("No canvas specified");var c=this.animationManager;if(!c.ic&&(!c.isAnimating||c.isTicking)){var d=new Date;uj(this);if("0"!this.Fa.style.opacity){var e=a!this.Xc,f=this.Ka.j,g=f.length,h=this;this.xd(f,g,h);if(e)a.Qc(!0),Ri(this);else if(!this.nc&&null=b&&!c.isAnimating)return;g=this.la;var k=this.ya,l=Math.round(g.xk)/k,m=Math.round(g.yk)/k;c=this.rb;c.reset();1!k&&c.scale(k);0=g.x&&0=g.y||c.translate(-l,-m); k=this.Pb;a.setTransform(1,0,0,1,0,0);a.scale(k,k);a.clearRect(0,0,this.va,this.ua);a.setTransform(1,0,0,1,0,0);a.scale(k,k);a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);vj(this,a);a.globalAlpha=this.ob;l=null!b?function(c){var d=b;if(c.visible&&0!c.ob){var e=c.Ca.j,f=e.length;if(0!f){var g=hi(c,a);c=c.No;c.length=0;for(var k=h.scale,l=0;l<f;l++){var m=e[l];if(Jf(m)&&!d.contains(m)){if(m instanceof Q&&(m.isOrthogonal&&c.push(m),!1=m.yc))continue;var n=m.actualBounds;n.widthk>h.ke||n.height k>h.ke?m.tb(a,h):ii(a,m)}}a.globalAlpha=g}}}:function(b){b.tb(a,h)};g=f.length;for(m=0;m<g;m++)a.setTransform(1,0,0,1,0,0),a.scale(k,k),a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),l(f[m]);this.gi&&wj(this.gi,this)&&this.kr();e?(this.Xc.Qc(!0),Ri(this)):this.nc=this.hi=!1;e=+new Date-+d;if(null=this.qh)}}}}; function xj(a,b,c,d,e,f,g,h,k,l){if(null!a.Fa){null=a.Ba&&B("No canvas specified");void 0=g&&(g=null);void 0=h&&(h=null);void 0=k&&(k=!1);void 0=l&&(l=!1);uj(a);a.Xc.Qc(!0);Ri(a);a.qj=!0;var m=a.ya;a.ya=e;var n=a.Ka.j,p=n.length;try{var r=new M(f.x,f.y,d.width/e,d.height/e),q=r.copy();q.Tp(c);nj(a,q);Si(a);a.xd(n,p,a,r);var u=a.Pb;b.setTransform(1,0,0,1,0,0);b.scale(u,u);b.clearRect(0,0,d.width,d.height);null!h&&""!h&&(b.fillStyle=h,b.fillRect(0,0,d.width,d.height));var v=sd.alloc(); v.reset();v.translate(c.left,c.top);v.scale(e);0=f.x&&0=f.y||v.translate(-f.x,-f.y);b.setTransform(v.m11,v.m12,v.m21,v.m22,v.dx,v.dy);sd.free(v);vj(a,b);b.globalAlpha=a.ob;if(null!g){var w=new F,y=g.iterator;for(y.reset();y.next();)var A=function(c){var d=k;if(c.visible&&0!c.ob&&(void 0=d&&(d=!0),d||!c.isTemporary)){d=c.Ca.j;var e=d.length;if(0!e){var f=hi(c,b);c=c.No;c.length=0;for(var g=a.scale,h=0;h<e;h++){var l=d[h]; if(Jf(l)&&w.contains(l)){if(l instanceof Q&&(l.isOrthogonal&&c.push(l),!1=l.yc))continue;var m=l.actualBounds;m.widthg>a.ke||m.heightg>a.ke?l.tb(b,a):ii(b,l)}}b.globalAlpha=f}}}}else if(!k&&l)}else A=function(c){c.tb(b,a,k)};for(c=0;c<p;c++)A(n[c]);a.qj=!1;a.gi&&wj(a.gi,a)&&a.kr()}finally}}t.xe=function(a){return this.lg[a]}; t.Xx=function(a,b){"minDrawingLength"a&&(this.ke=b);this.lg[a]=b;this.wf()};t.Mv=function(){this.lg=new db;this.lg.drawShadows=!0;this.lg.textGreeking=!0;this.lg.viewportOptimizations=Xa||Ta||Ua?!1:!0;this.lg.temporaryPixelRatio=!0;this.lg.pictureRatioOptimization=!0;this.ke=this.lg.minDrawingLength=1};function vj(a,b){a=a.lg;null!==a&&(void 0!==a.imageSmoothingEnabled&&b.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,void 0!==a&&null!==a&&(b.font=a))}t.gm=function(a){return this.hl[a]}; t.iA=function(a,b){this.hl[a]=b};t.Lv=function(){this.hl=new db;this.hl.extraTouchArea=10;this.hl.extraTouchThreshold=10;this.hl.hasGestureZoom=!0};t.Uv=function(a){yj(this,a)}; function yj(a,b){var c=a instanceof X,d=a instanceof P,e;for(e in b){""=e&&B("Setting properties requires non-empty property names");var f=a,g=e;if(c||d){var h=e.indexOf(".");if(0<h){var k=e.substring(0,h);if(c)f=a.Xa(k);else if(f=a[k],void 0f||null=f)f=a.toolManager[k];ya(f)?g=e.substr(h+1):B("Unable to find object named: "+k+" in "+a.toString()+" when trying to set property: "+e)}}if(""!==g[0]&&!Ja(f,g))if(d&&"ModelChanged"===g){a.jx(b[g]);continue}else if(d&&"Changed"===g){a.yh(b[g]);continue}else if(d&& Ja(a.toolManager,g))f=a.toolManager;else if(d&&zj(a,g)){a.Oj(g,b[g]);continue}else if(a instanceof Z&&"Changed"===g){a.yh(b[g]);continue}else B(‘Trying to set undefined property "‘+g+‘" on object: ‘+f.toString());f[g]=b[e];""=g[0]&&f instanceof Y&&f.gx(g)}}t.Su=function(){if(0=this.undoManager.transactionLevel&&0!this.di.count){for(;0<this.di.count;){var a=this.di;this.di=new G;for(a=a.iterator;a.next();)}this.N()}}; t.N=function(a){void 0=a&&(a=null);if(null=a)this.nc=!0,this.Xb();elsethis.R("InvalidateDraw")}; t.Fx=function(a,b){if(!0!this.nc){this.nc=!0;var c=!0=this.xe("temporaryPixelRatio");if(!0=this.xe("viewportOptimizations")&&this.scrollMode!Xh&&this.zi.Li(0,0,0,0)&&b.width=a.width&&b.height=a.height){var d=this.scale,e=Math.max(a.x,b.x),f=Math.max(a.y,b.y);d=M.allocAt(e,f,Math.max(0,Math.min(a.x+a.width,b.x+b.width)-e)*d,Math.max(0,Math.min(a.y+a.height,b.y+b.height)-f)*d);if(!this.Cs&&0<d.width&&0<d.height){if(!(this.$b||(this.cd=!1,null=this.Fa||(this.$b=!0,this.Su(),this.documentBounds.v()|| Aj(this,this.computeBounds()),e=this.Ba,null=e||e instanceof Bj)))){var g=this.Pb;f=this.vag;var h=this.uag,k=this.scaleg,l=Math.round(Math.round(b.xk)-Math.round(a.xk));b=Math.round(Math.round(b.yk)-Math.round(a.yk));k=this.Wt;a=this.Bw;k.width!==f&&(k.width=f);k.height!==h&&(k.height=h);a.clearRect(0,0,f,h);k=190g;var m=70*g,n=Math.max(l,0),p=Math.max(b,0),r=Math.floor(f-n),q=Math.floor(h-p);a.drawImage(e.Da,n,p,r,q,0,0,r,q);wj(this.gi,this)&&a.clearRect(0,0,k,m);e=Da();a=Da();q=Math.abs(l); r=Math.abs(b);var u=0=n?0:f-q;n=H.allocAt(u,0);q=H.allocAt(q+u,h);a.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));var v=this.rb;v.reset();v.scale(g,g);1!this.ya&&v.scale(this.ya);g=this.la;(0!g.x||0!g.y)&&isFinite(g.x)&&isFinite(g.y)&&v.translate(-g.x,-g.y);zb(n,v);zb(q,v);e.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));u=0=p?0:h-r;n.h(0,u);q.h(f,r+u);a.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x- q.x),Math.abs(n.y-q.y)));zb(n,v);zb(q,v);e.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));wj(this.gi,this)&&(f=0<l?0:-l,h=0<b?0:-b,n.h(f,h),q.h(k+f,m+h),a.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y))),zb(n,v),zb(q,v),e.push(new M(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y))));H.free(n);H.free(q);Yi(this,!1,!0);null=this.Fa&&B("No div specified");null=this.Ba&&B("No canvas specified");if(!this.animationManager.ic&& (f=this.Xc,this.nc)){uj(this);h=this.Pb;f.setTransform(1,0,0,1,0,0);f.clearRect(0,0,this.vah,this.uah);f.drawImage(this.Wt.Da,0<l?0:Math.round(-l),0<b?0:Math.round(-b));l=this.la;g=this.ya;k=Math.round(l.xg)/g;m=Math.round(l.yg)/g;b=this.rb;b.reset();1!g&&b.scale(g);0=l.x&&0=l.y||b.translate(-k,-m);f.save();f.beginPath();l=a.length;for(g=0;g<l;g++)k=a[g],0!k.width&&0!k.height&&f.rect(Math.floor(k.x),Math.floor(k.y),Math.ceil(k.width),Math.ceil(k.height));f.clip();f.setTransform(1,0, 0,1,0,0);f.scale(h,h);f.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy);b=this.Ka.j;l=b.length;this.xd(b,l,this);vj(this,f);f.globalAlpha=this.ob;for(h=0;h<l;h++)if(n=b[h],g=e,n.visible&&0!n.ob){k=hi(n,f);m=n.No;m.length=0;p=this.scale;n=n.Ca.j;r=n.length;q=g.length;for(v=0;v<r;v++)if(u=n[v],Jf(u)){if(u instanceof Q&&(u.isOrthogonal&&m.push(u),!1=u.yc))continue;var w=Cj(u,u.actualBounds);a:{var y=2/p;for(var z=4/p,A=0;A<q;A++){var C=g[A];if(0!C.width&&0!C.height&&w.qv(C.x-y,C.y-y,C.width+z,C.height+ z))}y=!1}y&&(w.widthp>this.ke||w.heightp>this.ke?u.tb(f,this):ii(f,u))}f.globalAlpha=k}f.restore();f.Qc(!0);this.gi&&wj(this.gi,this)&&this.kr();this.nc=this.hi=!1;this.tt()}Fa(e);Fa(a);this.$b=!1}}else this.ud();M.free(d);c&&(Ve(this),this.ud(),lf(this,!0))}else c?(Ve(this),this.ud(),lf(this,!0)):this.ud()}};function Xi(a){!1=a.oj&&(a.oj=!0)}function Ri(a){!1=a.hi&&(a.hi=!0)}function uj(a){!1!a.Pn&&(a.Pn=!1,Dj(a,a.va,a.ua))} function Dj(a,b,c) function Pi(a){var b=a.Ba;if(null=b)return!0;var c=a.Fa,d=a.va,e=a.ua,f=a.ax.copy();if(isNaN(f.width)||isNaN(f.height))return!0;var g=!1,h=a.Rf?a.qb:0,k=a.Ne?a.qb:0,l=c.clientWidth||d+h,m=c.clientHeight||e+k;if(l!d+h||m!e+k)a.Rf=!1,a.Ne=!1,k=h=0,a.va=l,a.ua=m,g=a.Pn=!0;if(!(g||a.Rf||a.Ne||a.$k||a.al))return!0;a.oj=!1;var n=a.viewportBounds,p=a.documentBounds,r=0,q=0,u=0,v=0;c=n.width;var w=n.height,y=a.zi;a.contentAlignment.eb()?(p.width>c&&(r=y.left,q=y.right),p.height>w&&(u=y.top,v=y.bottom)): (r=y.left,q=y.right,u=y.top,v=y.bottom);y=p.width+r+q;var z=p.height+u+v;r=p.x-r;var A=n.x;q=p.right+q;var C=n.right+h;u=p.y-u;var J=n.y;p=p.bottom+v;n=n.bottom+k;var K="1px",L="1px";v=a.scale;l=y>l/v;m=z>m/v;a.scrollMode=Vh&&(l||m)&&(l&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(l=1,r+1<A&&(l=Math.max((A-r)*v+a.va,l)),q>C+1&&(l=Math.max((q-C)*v+a.va,l)),c+h+1<y&&(l=Math.max((y-c)*v+a.va,l)),K=l.toString()+"px"),m&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(l=1,u+1<J&&(l=Math.max((J- u)*v+a.ua,l)),p>n+1&&(l=Math.max((p-n)v+a.ua,l)),w+k+1<z&&(l=Math.max((z-w)v+a.ua,l)),L=l.toString()+"px"));l="1px"!==K;m="1px"!L;l&&m||!l&&!m||(m&&(C-=a.qb),l&&(n-=a.qb),y<c+h||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(h=1,r+1<A&&(h=Math.max((A-r)*v+a.va,h)),q>C+1&&(h=Math.max((q-C)*v+a.va,h)),c+1<y&&(h=Math.max((y-c)*v+a.va,h)),K=h.toString()+"px"),l="1px"!K,h=a.ua,l!a.Ne&&(h=l?a.ua-a.qb:a.ua+a.qb),z<w+k||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(k=1,u+1<J&&(k=Math.max((J- u)*v+h,k)),p>n+1&&(k=Math.max((p-n)*v+h,k)),w+1<z&&(k=Math.max((z-w)*v+h,k)),L=k.toString()+"px"),m="1px"!L);if(a.qs&&l=a.Ne&&m=a.Rf)return d=a.va&&e=a.ua||a.ud(),!1;l!==a.Ne&&("1px"==K?a.ua=a.ua+a.qb:a.ua=Math.max(a.ua-a.qb,1),g=!0);a.Ne=l;a.lp.style.width=K;m!==a.Rf&&("1px"L?a.va=a.va+a.qb:a.va=Math.max(a.va-a.qb,1),g=!0,a.Tn&&(k=H.alloc(),m?(b.style.left=a.qb+"px",a.position=k.h(a.la.x+a.qb/a.scale,a.la.y)):(b.style.left="0px",a.position=k.h(a.la.x-a.qb/a.scale,a.la.y)),H.free(k))); a.Rf=m;a.lp.style.height=L;a.Au=!0;g&&(a.Pn=!0);b=a.ss;k=b.scrollLeft;a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(c+1<y?k=(a.position.x-r)v:r+1<A?k=b.scrollWidth-b.clientWidth:q>C+1&&(k=a.position.xv));if(a.Tn)switch(a.xu){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(w+1<z?b.scrollTop=(a.position.y-u)v:u+1<J?b.scrollTop=b.scrollHeight-b.clientHeight:p>n+1&&(b.scrollTop= a.position.yv));l=a.va;m=a.ua;b.style.width=l+(a.Rf?a.qb:0)+"px";b.style.height=m+(a.Ne?a.qb:0)+"px";return d!==l||e!==m||a.animationManager.ic?(a.qq(f,a.viewportBounds,v,g),!1):!0} t.add=function(a){var b=a.diagram;if(b!==this&&(null!b&&B("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.dm(a.layerName),nullb&&(b=this.dm("")),nullb&&B(‘Cannot add a Part when unable find a Layer named "‘+a.layerName+‘" and there is no default Layer‘),a.layer!==b))}; t.Vi=function(a){this.partManager.Vi(a);var b=this;Ej(a,function(a){Fj(b,a)});(a instanceof De||a instanceof S&&null!==a.placeholder)&&a.o();null!==a.data&&Ej(a,function(a){Gj(b.partManager,a)});!0!==sj(a)&&!0!==tj(a)||this.Gd.add(a);Hj(a,!0,this);Ij(a)?(a.actualBounds.v()&&this.N(Cj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.v()&&this.N(Cj(a,a.actualBounds));this.Xb()}; t.Fc=function(a){a.Tj();this.partManager.Fc(a);var b=this;null!a.data&&Ej(a,function(a){Jj(b.partManager,a,b)});this.Gd.remove(a);Ij(a)?(a.actualBounds.v()&&this.N(Cj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.v()&&this.N(Cj(a,a.actualBounds));this.Xb()};t.remove=function(a){Kj(this,a,!0)}; function Kj(a,b,c)t.vt=function(a,b){if(za(a))for(var c=a.length,d=0;d<c;d++)else for(c=new F,c.addAll(a),a=c.iterator;a.next();)c=a.value,b&&!c.canDelete()||this.remove(c)};t.Yj=function(a,b,c){return this.partManager.Yj(a,b,c)}; P.prototype.moveParts=function(a,b,c,d){void 0=d&&(d=Lj(this));if(null!this.toolManager){var e=new G;if(null!a)if(za(a))for(var f=0;f<a.length;f++)Mj(this,e,a[f],c,d);else for(a=a.iterator;a.next();)Mj(this,e,a.value,c,d);else{for(a=this.parts;a.next();)Mj(this,e,a.value,c,d);for(a=this.nodes;a.next();)Mj(this,e,a.value,c,d);for(a=this.links;a.next();)Mj(this,e,a.value,c,d)}tf(this,e,b,d,c)}}; function Mj(a,b,c,d,e,f){if(!b.contains(c)&&(void 0=f&&(f=!1),!d||f||c.canMove()||c.canCopy()))if(void 0=e&&(e=Lj(a)),c instanceof U){b.add(c,a.qd(e,c,c.location));if(c instanceof S)for(f=c.memberParts;f.next();)Mj(a,b,f.value,d,e,e.Bz);for(f=c.linksConnected;f.next();)}if(e.dragsTree)for(c=c.iv();c.next();)Mj(a,b,c.value,d,e)}else if(c instanceof Q)for(b.add(c,a.qd(e, c)),c=c.labelNodes;c.next();)Mj(a,b,c.value,d,e);else c instanceof De||b.add(c,a.qd(e,c,c.location))} function tf(a,b,c,d,e){if(null!==b&&0!b.count){var f=H.alloc(),g=H.alloc();g.assign(c);isNaN(g.x)&&(g.x=0);isNaN(g.y)&&(g.y=0);(c=a.Ep)||We(a,b);for(var h=Da(),k=Da(),l=b.iterator,m=H.alloc();l.next();){var n=l.key,p=l.value;if(n.Ub()){var r=Nj(a,n,b);if(null!r)h.push(new Oj(n,p,r));else if(!e||n.canMove())r=p.point,f.assign(r),a.computeMove(n,f.add(g),d,m),n.location=m,void 0=p.shifted&&(p.shifted=new H),p.shifted.assign(m.Xd(r))}else l.key instanceof Q&&k.push(l.ka)}H.free(m);e=h.length;for(l= 0;l<e;l++)n=h[l],f.assign(n.info.point),void 0=n.nv.shifted&&(n.nv.shifted=new H),n.node.location=f.add(n.nv.shifted);e=H.alloc();l=H.alloc();n=k.length;for(p=0;p<n;p++){var q=k[p];r=q.key;if(r instanceof Q)if(r.suspendsRouting){r.jh=null;m=r.fromNode;var u=r.toNode;if(null!a.draggedLink&&d.dragsLink)if(u=q.value.point,null=r.dragComputation)b.add(r,a.qd(d,r,g)),rf(r,g.x-u.x,g.y-u.y);else{q=H.allocAt(0,0);(m=r.i(0))&&m.v()&&q.assign(m);var v=m=H.alloc().assign(q).add(g);d.isGridSnapEnabled&& (d.isGridSnapRealtime||a.lastInput.up)&&(v=H.alloc(),Hg(a,r,m,v,d));m.assign(r.dragComputation(r,m,v)).Xd(q);b.add(r,a.qd(d,r,m));rf(r,m.x-u.x,m.y-u.y);H.free(q);H.free(m);v!==m&&H.free(v)}else null!==m&&(e.assign(m.location),v=b.H(m),null!==v&&e.Xd(v.point)),null!==u&&(l.assign(u.location),v=b.H(u),null!==v&&l.Xd(v.point)),null!m&&null!u?e.Ma(l)?(m=q.value.point,u=f,u.assign(e),u.Xd(m),b.add(r,a.qd(d,r,e)),rf(r,u.x,u.y)):(r.suspendsRouting=!1,r.Na()):(q=q.value.point,m=null!m?e:null!u?l: g,b.add(r,a.qd(d,r,m)),rf(r,m.x-q.x,m.y-q.y))}else if(null=r.fromNode||null=r.toNode)m=q.value.point,b.add(r,a.qd(d,r,g)),rf(r,g.x-m.x,g.y-m.y)}H.free(f);H.free(g);H.free(e);H.free(l);Fa(h);Fa(k);c||(Si(a),gf(a,b))}} P.prototype.computeMove=function(a,b,c,d){void 0=d&&(d=new H);d.assign(b);if(null=a)return d;var e=b,f=c.isGridSnapEnabled;f&&(c.isGridSnapRealtime||this.lastInput.up)&&(e=H.alloc(),Hg(this,a,b,e,c));c=null!==a.dragComputation?a.dragComputation(a,b,e):e;var g=a.minLocation,h=g.x;isNaN(h)&&(h=f?Math.round(a.location.x):a.location.x);g=g.y;isNaN(g)&&(g=f?Math.round(a.location.y):a.location.y);var k=a.maxLocation,l=k.x;isNaN(l)&&(l=f?Math.round(a.location.x):a.location.x);k=k.y;isNaN(k)&&(k=f?Math.round(a.location.y): a.location.y);d.h(Math.max(h,Math.min(c.x,l)),Math.max(g,Math.min(c.y,k)));e!==b&&H.free(e);return d};function Lj(a){var b=a.toolManager.findTool("Dragging");return null!b?b.dragOptions:a.Mk} function Hg(a,b,c,d,e){void 0=e&&(e=Lj(a));d.assign(c);if(null!==b)f=H.allocAt(0,0);f.sk(0,0,a,b,e);I.aq(c.x,c.y,h+f.x,g+f.y,a,b,d);H.free(f)}}function We(a,b){if(null!==b)for(a.Ep=!0,a=b.iterator;a.next();)b=a.key,b instanceof Q&&(b.suspendsRouting=!0)} function gf(a,b){if(null!==b){for(b=b.iterator;b.next();){var c=b.key;c instanceof Q&&(c.suspendsRouting=!1,Pj(c)&&c.Na())}a.Ep=!1}}function Nj(a,b,c){b=b.containingGroup;if(null!==b){a=Nj(a,b,c);if(null!a)return a;a=c.H(b);if(null!a)return a}return null}t=P.prototype;t.qd=function(a,b,c){if(void 0=c)return new ef(Fb);var d=a.isGridSnapEnabled;a.Cz||null=b.containingGroup||(d=!1);return d?new ef(new H(Math.round(c.x),Math.round(c.y))):new ef(c.copy())}; function ak(a,b,c){null!==b.diagram&&b.diagram!a&&B("Cannot share a Layer with another Diagram: "+b+" of "+b.diagram);null=c?null!==b.diagram&&B("Cannot add an existing Layer to this Diagram again: "+b):(c.diagram!a&&B("Existing Layer must be in this Diagram: "+c+" not in "+c.diagram),b=c&&B("Cannot move a Layer before or after itself: "+b));if(b.diagram!a){b=b.name;a=a.Ka;c=a.count;for(var d=0;d<c;d++)a.L(d).name=b&&B("Cannot add Layer with the name ‘"+b+"‘; a Layer with the same name is already present in this Diagram.")}} t.Vl=function(a){ak(this,a,null);a.Wd(this);var b=this.Ka,c=b.count-1;if(!a.isTemporary)for(;0<=c&&b.L(c).isTemporary;)c--;b.Kb(c+1,a);null!this.ac&&this.Ya(te,"layers",this,null,a,null,c+1);this.N();this.Ta()};t.hx=function(a,b){ak(this,a,b);a.Wd(this);var c=this.Ka,d=c.indexOf(a);0<=d&&(c.remove(a),null!this.ac&&this.Ya(ue,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;f<e;f++)if(c.L(f)b){c.Kb(f,a);break}null!==this.ac&&this.Ya(te,"layers",this,null,a,null,f);this.N();0>d&&this.Ta()}; t.vy=function(a,b){ak(this,a,b);a.Wd(this);var c=this.Ka,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ac&&this.Ya(ue,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;f<e;f++)if(c.L(f)==b){c.Kb(f+1,a);break}null!==this.ac&&this.Ya(te,"layers",this,null,a,null,f+1);this.N();0>d&&this.Ta()}; t.bA=function(a){a.diagram!==this&&B("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name)null!this.ac&&this.Ya(ue,"layers",this,a,null,c,null);this.N();this.Ta()}}};t.dm=function(a){for(var b=this.layers;b.next();)return null}; t.jx=function(a){nullthis.le&&(this.le=new E);this.le.add(a);this.model.yh(a)};t.dA=function(a){null!this.le&&(this.le.remove(a),0this.le.count&&(this.le=null));this.model.rk(a)};t.yh=function(a){null=this.If&&(this.If=new E);this.If.add(a)};t.rk=function(a){null!this.If&&(this.If.remove(a),0=this.If.count&&(this.If=null))}; t.Ns=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.ov(a);a.change!se&&(this.isModified=!0);if(null!this.If)for(var b=this.If,c=b.length,d=0;d<c;d++)b.L(d)(a)};t.Ya=function(a,b,c,d,e,f,g){void 0=f&&(f=null);void 0=g&&(g=null);var h=new qe;h.diagram=this;h.change=a;h.propertyName=b;h.object=c;h.oldValue=d;h.oldParam=f;h.newValue=e;h.newParam=g;this.Ns(h)};t.g=function(a,b,c,d,e){this.Ya(re,a,this,b,c,d,e)}; t.Sj=function(a,b){if(null!a&&a.diagram=this){var c=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var d=a.change;if(d=re){var e=a.object;ek(e,a.propertyName,a.H(b));if(e instanceof Y)this.isModified=!0}else if(d=te){var g=a.object,h=a.newParam,k=a.newValue;if(g instanceof X)if("number"=typeof h&&k instanceof Y){b?g.Fc(h):g.Kb(h,k);var l=g.part;null!==l&&l.Lb()}else{if("number"=typeof h&&k instanceof fk)if(b)k.isRow?g.Jv(h):g.Hv(h);else}else if(g instanceof ei){var n=!0a.oldParam;"number"typeof h&&k instanceof T&&(b?(k.isSelected=!1,k.isHighlighted=!1,k.Lb(),g.Fc(n?h:-1,k,n)):g.Vi(h,k,n))}else g instanceof P?"number"=typeof h&&k instanceof ei&&(b?this.Ka.jb(h):(k.Wd(this),this.Ka.Kb(h,k))):B("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(due){var p=a.object,r=a.oldParam,q=a.oldValue;if(p instanceof X)"number" typeof r&&q instanceof Y?b?p.Kb(r,q):p.Fc(r):"number"=typeof r&&q instanceof fk&&(b?(m=q.isRow?p.getRowDefinition(q.index):p.getColumnDefinition(q.index),m.Qs(q)):q.isRow?p.Jv(r):p.Hv(r));else if(p instanceof ei){var u=!0=a.newParam;"number"typeof r&&q instanceof T&&(b?0>p.Ca.indexOf(q)&&p.Vi(r,q,u):(q.isSelected=!1,q.isHighlighted=!1,q.Lb(),p.Fc(u?r:-1,q,u)))}else p instanceof P?"number"typeof r&&q instanceof ei&&(b?(q.Wd(this),this.Ka.Kb(r,q)):this.Ka.jb(r)):B("unknown ChangedEvent.Remove object: "+ a.toString());this.isModified=!0}else d!se&&B("unknown ChangedEvent: "+a.toString())}finally}};t.ta=function(a){return this.undoManager.ta(a)};t.Ua=function(a){return this.undoManager.Ua(a)};t.yf=function(){return this.undoManager.yf()}; P.prototype.commit=function(a,b){void 0b&&(b="");var c=this.skipsUndoManager;nullb&&(this.skipsUndoManager=!0,b="");this.undoManager.ta(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.Ua(b):this.undoManager.yf(),this.skipsUndoManager=c}};P.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)};t=P.prototype;t.Eq=function(){this.partManager.Eq()}; function gk(a,b,c){var d=a.animationManager;if(a.Gb||a.$b)a.ya=c,d.Ve&&d.zd.add(d.B,"scale",b,a.ya);else if(a.Gb=!0,null=a.Ba)a.ya=c;else{var e=a.viewportBounds.copy(),f=a.va,g=a.ua;e.width=a.va/b;e.height=a.ua/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.uf()?l.sf(Jc)?h=0:l.sf(Kc)&&(h=f-1):h=l.eb()?l.x(f-1):f/2);isNaN(k)&&(l.uf()?l.sf(Ic)?k=0:l.sf(Lc)&&(k=g-1):k=l.eb()?l.y(g-1):g/2);null=a.scaleComputation||a.animationManager.isAnimating||(c=a.scaleComputation(a, c));c<a.minScale&&(c=a.minScale);c>a.maxScale&&(c=a.maxScale);f=H.allocAt(a.la.x+h/b-h/c,a.la.y+k/b-k/c);a.position=f;H.free(f);a.ya=c;a.qq(e,a.viewportBounds,b,!1);a.Gb=!1;Ui(a,!1);d.Ve&&d.zd.add(d.B,"scale",b,a.ya);a.N();Xi(a)}} t.qq=function(a,b,c,d){if(!a.A(b)){void 0=d&&(d=!1);d||Xi(this);Ri(this);var e=this.layout;null=e||!e.isViewportSized||this.autoScale!oi||d||a.width=b.width&&a.height=b.height||e.C();e=this.currentTool;!0=this.Yg&&e instanceof Na&&(this.lastInput.documentPoint=this.Bt(this.lastInput.viewPoint),Ne(e,this));this.Gb||this.Fx(a,b);nj(this);this.te.scale=c;this.te.position.x=a.x;this.te.position.y=a.y;this.te.bounds.assign(a);this.te.Hx=d;this.R("ViewportBoundsChanged",this.te,a);this.isVirtualized&& this.links.each(function(a){a.isAvoiding&&a.actualBounds.Gc(b)&&a.Na()})}}; function nj(a,b){void 0=b&&(b=null);var c=a.Fb;if(null!c&&c.visible){for(var d=Kb.alloc(),e=1,f=1,g=c.W.j,h=g.length,k=0;k<h;k++)g=c.gridCellSize;d.h(fg.width,eg.height);if(null!b)e=b.width,f=b.height,a=b.x,g=b.y;elsee=b.width;f=b.height;a=b.x;g=b.y;M.free(b)}c.width=e+2d.width;c.height=f+2d.height;b=H.alloc();I.aq(a,g,0,0, d.width,d.height,b);b.offset(-d.width,-d.height);Kb.free(d);c.part.location=b;H.free(b)}}t.Tu=function();function Se(a)} t.select=function(a){null!a&&a.layer.diagram=this&&(!a.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),Se(this),a.isSelected=!0,this.R("ChangedSelection",this.selection))}; t.hA=function(a){this.R("ChangingSelection",this.selection);Se(this);if(za(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof T||B("Diagram.selectCollection given something that is not a Part: "+d);d.isSelected=!0}else for(a=a.iterator;a.next();)b=a.value,b instanceof T||B("Diagram.selectCollection given something that is not a Part: "+b),b.isSelected=!0;this.R("ChangedSelection",this.selection)}; t.mx=function()};t.Ez=function(a){null!a&&a.layer.diagram=this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.mx(),a.isHighlighted=!0)}; t.Fz=function(a){a=(new F).addAll(a);for(var b=this.highlighteds.copy().uq(a).iterator;b.next();)b.value.isHighlighted=!1;for(a=a.iterator;a.next();)b=a.value,b instanceof T||B("Diagram.highlightCollection given something that is not a Part: "+b),b.isHighlighted=!0}; t.scroll=function(a,b,c){void 0=c&&(c=1);var d="up"b||"down"==b,e=0;if("pixel"a)e=c;else if("line"a)e=c*(d?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if("page"==a)a=d?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,0!==a&&(e=cMath.max(a-(d?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if("document"===a){e=this.documentBounds;c=this.viewportBounds;d=H.alloc();"up"===b?this.position=d.h(c.x,e.y):"left"===b?this.position= d.h(e.x,c.y):"down"===b?this.position=d.h(c.x,e.bottom-c.height):"right"===b&&(this.position=d.h(e.right-c.width,c.y));H.free(d);return}B("scrolling unit must be ‘pixel‘, ‘line‘, ‘page‘, or ‘document‘, not: "+a)}e/=this.scale;c=this.position.copy();"up"===b?c.y=this.position.y-e:"down"===b?c.y=this.position.y+e:"left"===b?c.x=this.position.x-e:"right"===b?c.x=this.position.x+e:B("scrolling direction must be ‘up‘, ‘down‘, ‘left‘, or ‘right‘, not: "+b);this.position=c}; t.Ov=function(a);t.Os=function(a);t.Cq=function(a){var b=this.rb;b.reset();1!==this.ya&&b.scale(this.ya);var c=this.la;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.rb)}; t.qA=function(a){var b=this.rb,c=a.x,d=a.y,e=c+a.width,f=d+a.height,g=b.m11,h=b.m12,k=b.m21,l=b.m22,m=b.dx,n=b.dy,p=cg+dk+m;b=ch+dl+n;var r=eg+dk+m;a=eh+dl+n;d=cg+fk+m;c=ch+fl+n;g=eg+fk+m;e=eh+f*l+n;f=Math.min(p,r);p=Math.max(p,r);r=Math.min(b,a);b=Math.max(b,a);f=Math.min(f,d);p=Math.max(p,d);r=Math.min(r,c);b=Math.max(b,c);f=Math.min(f,g);p=Math.max(p,g);r=Math.min(r,e);b=Math.max(b,e);return new M(f,r,p-f,b-r)}; t.Bt=function(a){var b=this.rb;b.reset();1!==this.ya&&b.scale(this.ya);var c=this.la;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return zb(a.copy(),this.rb)};function ik(a)function jk(a){a=xi.get(a);return null!a?new a:new yi} P.prototype.doModelChanged=function(a){if(a.modelthis.model));a.mouseMoveTools.each(function(a));a.mouseUpTools.each(function(a));this.$b||this.Oe||(this.Sk=!0,this.Xk&&(this.cd=!0))}else"StartingUndo"==c||"StartingRedo"==c?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&& a.Uc(),this.R("ChangingSelection",this.selection)):"StartedTransaction"==c&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Uc());else if(this.aa){this.aa=!1;try{if(""=a.modelChange&&bse){if("FinishedUndo"c||"FinishedRedo"==c)this.R("ChangedSelection",this.selection),Si(this);var e=this.animationManager;"RolledBackTransaction"==c&&e.Uc();this.Sk=!0;this.ud();0!=this.undoManager.transactionLevel&&1!this.undoManager.transactionLevel||Bh(e);"CommittedTransaction" c&&this.undoManager.gu&&(this.fe=Math.min(this.fe,this.undoManager.historyIndex-1));var f=a.isTransactionFinished;f&&(ik(this),this.kt.clear(),Mh(this.animationManager));if(!this.nu&&f),10)}}}finally}}};function Fj(a,b) function kk(a,b){if(b instanceof lk){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var d=b.Sg;null!==d&&(d.Zk instanceof Event&&null!b.Bc&&b.Bc(b,d.Zk),!0d.Gr&&(null!==b.ff&&b.ff(b,d.zu),null!b.diagram&&b.diagram.ru.add(b)));c=c.getAttribute("src");d=a.Fj.H(c);if(nulld)d=[],d.push(b),a.Fj.add(c,d);else{for(a=0;a<d.length;a++)if(d[a]==b)return;d.push(b)}}}} function mk(a,b){if(b instanceof lk){var c=b.element;if(null!==c&&c instanceof HTMLImageElement)}}}P.prototype.wd=function(){this.partManager.wd()};P.prototype.Nj=function(a,b){this.zc.Nj(a,b)};P.prototype.Pj=function(a,b){this.zc.Pj(a,b)};P.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)};P.prototype.Jb=function(a){return this.partManager.Jb(a)}; P.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)};t=P.prototype;t.vc=function(a){return this.partManager.vc(a)};t.Mi=function(a){return this.partManager.Mi(a)};t.uc=function(a){return this.partManager.uc(a)};t.Ws=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];return this.partManager.Ws.apply(this.partManager,b instanceof Array?b:ca(ba(b)))}; t.Vs=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];return this.partManager.Vs.apply(this.partManager,b instanceof Array?b:ca(ba(b)))};function Aj(a,b)function Zi(a){a.nj&&Aj(a,a.computeBounds())}t.hz=function(){for(var a=new F,b=this.nodes;b.next();)for(b=this.links;b.next();)c=b.value,c.isTopLevel&&a.add(c);return a.iterator};t.gz=function(); t.Qz=function(a){Si(this);a&&ok(this,!0);this.Sk=!0;Lf(this)};function ok(a,b){for(var c=a.Fi.iterator;c.next();)pk(a,c.value,b);null!==a.layout&&(b?a.layout.isValidLayout=!1:a.layout.C())}function pk(a,b,c){if(null!==b){for(var d=b.wl.iterator;d.next();)pk(a,d.value,c);null!b.layout&&(c?b.layout.isValidLayout=!1:b.layout.C())}} function oj(a,b){if(a.Ig&&!a.St)finally{0d&&a.Ua("Layout"),a.Ig=!e.isValidLayout,a.aa=c}}} function qk(a,b,c,d){if(null!b){for(var e=b.wl.iterator;e.next();)qk(a,e.value,c,d);e=b.layout;nulle||e.isValidLayout||(!c||e.isRealtime||0d?(b.pk=!b.location.v(),e.doLayout(b),b.C(32),qj(a,b),e.isValidLayout=!0):a.Ig=!0)}}t.nz=function(){for(var a=new E,b=this.nodes;b.next();)return a.iterator}; function pi(a){function b(a){var b=a.toLowerCase(),e=new E;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new G,d=new G;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.Ut=c;a.Tt=d} function zj(a,b){var c=a.Tt.H(b);return null!==c?c:a.Tt.H(b.toLowerCase())}function rk(a,b){var c=a.Ut.H(b);if(null!==c)return c;c=a.Ut.H(b.toLowerCase());if(null!==c)return c;B("Unknown DiagramEvent name: "+b);return null}t.Oj=function(a,b);t.sm=function(a,b); t.R=function(a,b,c){var d=rk(this,a),e=new pe;e.diagram=this;a=zj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!c&&(e.parameter=c);b=d.length;if(1b)d.L(0)(e);else if(0!b)for(d=d.ma(),c=0;c<b;c++)(0,d[c])(e)};function sk(a){if(a.animationManager.isAnimating)return!1;var b=a.currentTool;return ba.toolManager.findTool("Dragging")?!a.Ep||b.isComplexRoutingRealtime:!0}t.gk=function(a,b){void 0b&&(b=null);return tk(this,!1,null,b).gk(a.x,a.y,a.width,a.height)}; P.prototype.computeOccupiedArea=function(){return this.isVirtualized?this.viewportBounds.copy():this.nj?Ti(this):this.documentBounds.copy()}; function tk(a,b,c,d){nulla.Qb&&(a.Qb=new uk);if(a.Qb.et||a.Qb.group!==c||a.Qb.$x!d){if(nullc)M.free(b)}else{0<c.memberParts.count&&(b=a.computePartsBounds(c.memberParts,!1),b.Tc(20,20),a.Qb.initialize(b));b=M.alloc();for(e=c.memberParts;e.next();)f=e.value,f instanceof U&&vk(a,f,d,b);M.free(b)}a.Qb.group=c;a.Qb.$x=d;a.Qb.et= !1}else b&&wk(a.Qb);return a.Qb}function vk(a,b,c,d){if(b!c)if(b.isVisible()&&b.avoidable&&!b.isLinkLabel)for(e=e.y;e<b;e+=c)xk(a.Qb,d,e);xk(a.Qb,d,b)}else if(b instanceof S)for(b=b.memberParts;b.next();)e=b.value,e instanceof U&&vk(a,e,c,d)} function yk(a,b){null!a.Qb&&!a.Qb.et&&(void 0=b&&(b=null),null=b||b.avoidable&&!b.isLinkLabel)&&(a.Qb.et=!0)}t=P.prototype;t.Ss=function(a){this.Sq.assign(a);zk(this,this.Sq).Ma(this.position)?this.zf():Ak(this)}; function Ak(a){-1=a.Ck&&(a.Ck=sa(function(){if(-1!=a.Ck&&(a.zf(),null!a.lastInput.event))},a.Wm))}t.zf=function(){-1!this.Ck&&(x.clearTimeout(this.Ck),this.Ck=-1)}; function zk(a,b){var c=a.position,d=a.Xm;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.viewportBounds,f=a.scale;e=M.allocAt(0,0,e.widthf,e.heightf);var g=H.allocAt(0,0);if(b.x>=e.x&&b.x<e.x+d.left)else b.x<=e.x+e.width&&b.x>e.x+e.width-d.right&&(h=Math.max(a.scrollHorizontalLineChange,1),h|=0,g.x+=h,b.x>e.x+e.width-d.right/2&&(g.x+=h),b.x>e.x+e.width-d.right/4&& (g.x+=4h));b.y>=e.y&&b.y<e.y+d.top?(a=Math.max(a.scrollVerticalLineChange,1),a|=0,g.y-=a,b.y<e.y+d.top/2&&(g.y-=a),b.y<e.y+d.top/4&&(g.y-=4a)):b.y<=e.y+e.height&&b.y>e.y+e.height-d.bottom&&(a=Math.max(a.scrollVerticalLineChange,1),a|=0,g.y+=a,b.y>e.y+e.height-d.bottom/2&&(g.y+=a),b.y>e.y+e.height-d.bottom/4&&(g.y+=4*a));g.Ma(Fb)||(c=new H(c.x+g.x/f,c.y+g.y/f));M.free(e);H.free(g);return c}t.mt=function();t.vv=function();t.zy=function(a,b){this.uu.add(a,b)}; function Bk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].sl)f||a-l>k?b(c,e,h):x.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Fj.iterator;g.next();)if(!g.value[0].sl)if("function"!typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;x.requestAnimationFrame(function(){d()});return null}t.Sz=function(a){if(!Vg)return null;void 0=a&&(a=new db);a.returnType="Image";return this.Ix(a)}; t.Ix=function(a){void 0=a&&(a=new db);return Bk(this,this.Tz,a)}; t.Tz=function(a,b,c){var d=Ck(c,a,"canvas",null);if(null=d)return null;c=d.V.canvas;var e=null;if(null!c)switch(e=a.returnType,void 0=e?e="string":e=e.toLowerCase(),e){case "imagedata":e=d.getImageData(0,0,c.width,c.height);break;case "image":d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!typeof b&&B(‘Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.‘);if("function" typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";if("function"typeof c.msToBlob)return b(c.msToBlob()),"msToBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"=typeof b?(b(e),null):e}; function Ck(a,b,c,d){a.animationManager.Uc();a.ud();if(nulla.Ba)return null;"object"!typeof b&&B("properties argument must be an Object.");var e=b.size||null,f=b.scale||null;void 0!b.scale&&isNaN(b.scale)&&(f="NaN");var g=b.maxSize;void 0=b.maxSize&&(g="SVG"=c?new Kb(Infinity,Infinity):new Kb(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0=b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0=n&&(n=!0);var p=b.document||document,r=b.elementFinished||null,q=b.showTemporary; void 0=q&&(q=!n);b=b.showGrid;void 0=b&&(b=q);null!e&&isNaN(e.width)&&isNaN(e.height)&&(e=null);"number"typeof l?l=new pc(l):l instanceof pc||B("MakeImage padding must be a Margin or a number.");l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.Xc.Qc(!0);n=new Dk(null,p);var u=n.context;if(!(e||f||k||h)){n.width=a.va+Math.ceil(l.left+l.right);n.height=a.ua+Math.ceil(l.top+l.bottom);if("SVG"=c){if(nulld)return null;d.resize(n.width, n.height,n.width,n.height);d.ownerDocument=p;d.Yp=r;xj(a,d.context,l,new Kb(n.width,n.height),a.ya,a.la,k,m,q,b);return d.context}a.vn=!1;xj(a,u,l,new Kb(n.width,n.height),a.ya,a.la,k,m,q,b);a.vn=!0;return n.context}var v=a.gr,w=a.documentBounds.copy();w.Wv(a.bb);if(q)for(var y=a.Ka.j,z=y.length,A=0;A<z;A++)}}y=new H(w.x,w.y);if(null! k){z=!0;A=k.iterator;for(A.reset();A.next();)if(C=A.value,C instanceof T&&(J=C.layer,(null=J||J.visible)&&(null=J||q||!J.isTemporary)&&C.isVisible()&&(C=C.actualBounds,C.v())))if(z)else V.Hc(C);z&&(V=new M(0,0,0,0));w.width=V.width;w.height=V.height;y.x=V.x;y.y=V.y}null!h&&h.v()&&(y=h,f||(f=v));V=h=0;null!l&&(h=l.left+l.right,V=l.top+l.bottom);z=A=0;null!e&&(A=e.width,z=e.height,isFinite(A)&&(A=Math.max(0,A-h)),isFinite(z)&&(z=Math.max(0,z-V)));null!=e&&null!f?("NaN" f&&(f=v),e.v()?(e=A,w=z):isNaN(z)?(e=A,w=w.heightf):(e=w.widthf,w=z)):null!e?e.v()?(f=Math.min(A/w.width,z/w.height),e=A,w=z):isNaN(z)?(f=A/w.width,e=A,w=w.heightf):(f=z/w.height,e=w.widthf,w=z):null!f?"NaN"f&&g.v()?(f=Math.min((g.width-h)/w.width,(g.height-V)/w.height),f>v?(f=v,e=w.width,w=w.height):(e=g.width,w=g.height)):(e=w.widthf,w=w.heightf):(f=v,e=w.width,w=w.height);null!==l?(e+=h,w+=V):l=new pc(0);null!==g&&(v=g.width,g=g.height,isNaN(v)&&(v=2E3),isNaN(g)&&(g=2E3),isFinite(v)&& (e=Math.min(e,v)),isFinite(g)&&(w=Math.min(w,g)));n.width=Math.ceil(e);n.height=Math.ceil(w);if("SVG"=c){if(nulld)return null;d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.Yp=r;xj(a,d.context,l,new Kb(Math.ceil(e),Math.ceil(w)),f,y,k,m,q,b);return d.context}a.vn=!1;xj(a,u,l,new Kb(Math.ceil(e),Math.ceil(w)),f,y,k,m,q,b);a.vn=!0;return n.context} ma.Object.defineProperties(P.prototype,{div:{get:function(),set:function(a){if(this.Fa!a){Qa=[];var b=this.Fa;null!b?(b.B=void 0,b.innerHTML=,null!==this.Ba&&(b=this.Ba.Da,this.removeEventListener(b,"touchstart",this.aw,!1),this.removeEventListener(b,"touchmove",this.$v,!1),this.removeEventListener(b,"touchend",this.Zv,!1),this.Ba.ux()),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.Xc=this.Ba=null,this.removeEventListener(x,"resize",this.gw,!1),this.removeEventListener(x,"mousemove",this.kk,!0),this.removeEventListener(x,"mousedown",this.jk,!0),this.removeEventListener(x,"mouseup",this.mk,!0),this.removeEventListener(x,"wheel",this.nk,!0),this.removeEventListener(x,"mouseout",this.lk,!0),ze=this&&(ze=null)):this.Oe=!1;this.Fa=null;if(null!==a){if(b=a.B)b.div=null;Fi(this, a);this.wf()}}}},lx:{get:function()},fk:{get:function()},draggedLink:{get:function(),set:function(a){this.jr!==a&&(this.jr=a,null!==a&&(this.es=a.fromPort,this.fs=a.toPort))}},Lx:{get:function(),set:function(a)},Mx:{get:function(),set:function(a)},animationManager:{ get:function()},undoManager:{get:function()},skipsUndoManager:{get:function(),set:function(a)},delaysLayout:{get:function(),set:function(a)},opacity:{get:function(),set:function(a){var b=this.ob;b!==a&&((0>a||1<a)&&va(a,"0 ? value ? 1", P,"opacity"),this.ob=a,this.g("opacity",b,a),this.N())}},validCycle:{get:function(),set:function(a)},layers:{get:function()},isModelReadOnly:{get:function(),set:function(a)},isReadOnly:{get:function(), set:function(a)},isEnabled:{get:function(),set:function(a)},allowClipboard:{get:function(),set:function(a)},allowCopy:{get:function(),set:function(a){var b=this.Lh;b!==a&&(this.Lh=a,this.g("allowCopy", b,a))}},allowDelete:{get:function(),set:function(a)},allowDragOut:{get:function(),set:function(a)},allowDrop:{get:function(),set:function(a)},allowTextEdit:{ get:function(),set:function(a)},allowGroup:{get:function(),set:function(a)},allowUngroup:{get:function(),set:function(a)},allowInsert:{get:function(),set:function(a)},allowLink:{get:function(),set:function(a)},allowRelink:{get:function(),set:function(a)},allowMove:{get:function(),set:function(a)},allowReshape:{ get:function(),set:function(a)},allowResize:{get:function(),set:function(a)},allowRotate:{get:function(),set:function(a)},allowSelect:{get:function(),set:function(a)},allowUndo:{get:function(),set:function(a)},allowZoom:{get:function(),set:function(a)},hasVerticalScrollbar:{get:function(),set:function(a){var b=this.al;b!==a&&(this.al=a,Xi(this),this.N(),this.g("hasVerticalScrollbar", b,a),Ui(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.$k},set:function(a)},allowHorizontalScroll:{get:function(),set:function(a)},allowVerticalScroll:{get:function(),set:function(a)},scrollHorizontalLineChange:{get:function(),set:function(a){var b=this.rs;b!==a&&(0>a&&va(a,">= 0",P,"scrollHorizontalLineChange"),this.rs=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{get:function(),set:function(a){var b=this.ts;b!==a&&(0>a&&va(a,">= 0",P,"scrollVerticalLineChange"),this.ts=a,this.g("scrollVerticalLineChange", b,a))}},lastInput:{get:function(),set:function(a)},firstInput:{get:function(),set:function(a)},currentCursor:{get:function(),set:function(a){a&&(a=this.sn);if(this.cr!==a){var b=this.Ba,c=this.Fa;if(null!b){this.cr=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursord&&(b.style.cursor="-webkit-"+a,c.style.cursor= "-webkit-"+a,b.style.cursor=d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor=d&&(b.style.cursor=a,c.style.cursor=a)))}}}},defaultCursor:{get:function(),set:function(a){===a&&(a="auto");var b=this.sn;b!==a&&(this.sn=a,this.g("defaultCursor",b,a))}},click:{get:function(),set:function(a)},doubleClick:{ get:function(),set:function(a)},contextClick:{get:function(),set:function(a)},mouseOver:{get:function(),set:function(a)},mouseHover:{get:function(),set:function(a)},mouseHold:{get:function(),set:function(a)},mouseDragOver:{get:function(),set:function(a)},mouseDrop:{get:function(){return this.$f},set:function(a)}, handlesDragDropForTopLevelParts:{get:function(),set:function(a)},mouseEnter:{get:function(),set:function(a)},mouseLeave:{get:function(),set:function(a)},toolTip:{ get:function(),set:function(a)},contextMenu:{get:function(),set:function(a)},commandHandler:{get:function(),set:function(a){this.I!==a&&(this.I=a,a.Wd(this))}},toolManager:{get:function(),set:function(a){this.Za!==a&&(this.Za= a,a.diagram=this)}},defaultTool:{get:function(),set:function(a)},currentTool:{get:function(),set:function(a)},selection:{get:function()}, maxSelectionCount:{get:function(),set:function(a)}else va(a,">= 0",P,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{ get:function(),set:function(a)},groupSelectionAdornmentTemplate:{get:function(),set:function(a)},linkSelectionAdornmentTemplate:{get:function(),set:function(a){var b=this.Rr;b!==a&&(this.Rr=a,this.g("linkSelectionAdornmentTemplate",b, a))}},highlighteds:{get:function()},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.u&&this.fe!==a.historyIndex:this.u},set:function(a){if(this.u!==a)}},model:{get:function(),set:function(a){var b=this.ac;if(b!==a){this.currentTool.doCancel(); null!==b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&B("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Uc(!0);var c=Ii(this,!0);this.Oe=!1;this.Xk=!0;this.fe=-2;this.cd=!1;var d=this.$b;this.$b=!0;zh(this.animationManager,"Model");null!==b&&(null!==this.le&&this.le.each(function(a){b.rk(a)}),b.rk(this.Ih));this.ac=a;this.partManager=jk(this.ac.constructor.type);for(var e=0;e<c.length;e++)this.add(c[e]);a.yh(this.Bf);this.partManager.addAllModeledParts(); a.rk(this.Bf);a.yh(this.Ih);null!==this.le&&this.le.each(function(b){a.yh(b)});this.$b=d;this.Gb||this.N();null!==b&&a.undoManager.copyProperties(b.undoManager)}}},aa:{get:function(),set:function(a)},kt:{get:function()},skipsModelSourceBindings:{get:function(),set:function(a)},At:{get:function(), set:function(a)},nodeTemplate:{get:function(){return this.fg.H()},set:function(a)},nodeTemplateMap:{get:function(),set:function(a)},groupTemplate:{get:function(){return this.fi.H()}, set:function(a)},groupTemplateMap:{get:function(),set:function(a)},linkTemplate:{get:function(){return this.ah.H()},set:function(a){var b=this.ah.H();b!==a&&(this.ah.add(,a),this.g("linkTemplate", b,a),this.undoManager.isUndoingRedoing||this.wd())}},linkTemplateMap:{get:function(),set:function(a)},isMouseCaptured:{get:function(),set:function(a){var b=this.Ba;null!b&&(b=b.Da,b instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.Rq?(this.removeEventListener(b,"pointermove",this.om,!1),this.removeEventListener(b, "pointerdown",this.nm,!1),this.removeEventListener(b,"pointerup",this.qm,!1),this.removeEventListener(b,"pointerout",this.pm,!1),this.addEventListener(x,"pointermove",this.om,!0),this.addEventListener(x,"pointerdown",this.nm,!0),this.addEventListener(x,"pointerup",this.qm,!0),this.addEventListener(x,"pointerout",this.pm,!0)):(this.removeEventListener(b,"mousemove",this.kk,!1),this.removeEventListener(b,"mousedown",this.jk,!1),this.removeEventListener(b,"mouseup",this.mk,!1),this.removeEventListener(b, "mouseout",this.lk,!1),this.addEventListener(x,"mousemove",this.kk,!0),this.addEventListener(x,"mousedown",this.jk,!0),this.addEventListener(x,"mouseup",this.mk,!0),this.addEventListener(x,"mouseout",this.lk,!0)),this.removeEventListener(b,"wheel",this.nk,!1),this.addEventListener(x,"wheel",this.nk,!0),this.addEventListener(x,"selectstart",this.preventDefault,!1)):(this.Rq?(this.removeEventListener(x,"pointermove",this.om,!0),this.removeEventListener(x,"pointerdown",this.nm,!0),this.removeEventListener(x, "pointerup",this.qm,!0),this.removeEventListener(x,"pointerout",this.pm,!0),this.addEventListener(b,"pointermove",this.om,!1),this.addEventListener(b,"pointerdown",this.nm,!1),this.addEventListener(b,"pointerup",this.qm,!1),this.addEventListener(b,"pointerout",this.pm,!1)):(this.removeEventListener(x,"mousemove",this.kk,!0),this.removeEventListener(x,"mousedown",this.jk,!0),this.removeEventListener(x,"mouseup",this.mk,!0),this.removeEventListener(x,"mouseout",this.lk,!0),this.addEventListener(b,"mousemove", this.kk,!1),this.addEventListener(b,"mousedown",this.jk,!1),this.addEventListener(b,"mouseup",this.mk,!1),this.addEventListener(b,"mouseout",this.lk,!1)),this.removeEventListener(x,"wheel",this.nk,!0),this.removeEventListener(x,"selectstart",this.preventDefault,!1),this.addEventListener(b,"wheel",this.nk,!1)),this.Ic=a))}},position:{get:function(),set:function(a){var b=H.alloc().assign(this.la);if(!b.A(a)){var c=this.viewportBounds.copy();this.la.assign(a); Oh(this.animationManager,b,this.la);this.Gb||null=this.Ba&&!this.Np.v()||(this.Gb=!0,a=this.scale,Wi(this,this.tn,this.va/a,this.ua/a,this.gj,!1),this.Gb=!1);this.Gb||this.qq(c,this.viewportBounds,this.ya,!1)}H.free(b)}},initialPosition:{get:function(),set:function(a){this.Br.A(a)||(this.Br=a.G())}},initialScale:{get:function(),set:function(a){this.Cr!a&&(this.Cr=a)}},grid:{ get:function(),set:function(a){var b=this.Fb;if(b!a){null=b&&(Ni(this),b=this.Fb);a.type!X.Grid&&B("Diagram.grid must be a Panel of type Panel.Grid");var c=b.panel;null!c&&c.remove(b);this.Fb=a;a.name="GRID";null!c&&c.add(a);nj(this);this.N();this.g("grid",b,a)}}},viewportBounds:{get:function(){var a=this.ax,b=this.la,c=this.ya;if(null=this.Ba)return this.Np.v()&&a.h(b.x,b.y,this.va/c,this.ua/c),a;a.h(b.x,b.y,Math.max(this.va, 0)/c,Math.max(this.ua,0)/c);return a}},viewSize:{get:function(),set:function(a)},fixedBounds:{get:function(),set:function(a){var b=this.sr;b.A(a)||(-Infinity!a.width&&Infinity!a.height&&-Infinity!a.height||B("fixedBounds width/height must not be Infinity"),this.sr=a=a.G(),this.Ta(),this.g("fixedBounds", b,a))}},scrollMargin:{get:function(),set:function(a){"number"typeof a&&(a=new pc(a));var b=this.zi;b.A(a)||(this.zi=a=a.G(),this.g("scrollMargin",b,a),this.wf())}},scrollMode:{get:function(),set:function(a)},scrollsPageOnFocus:{get:function(),set:function(a){var b=this.us; b!==a&&(this.us=a,this.g("scrollsPageOnFocus",b,a))}},positionComputation:{get:function(),set:function(a)},scaleComputation:{get:function(),set:function(a)},documentBounds:{get:function()}, isVirtualized:{get:function(),set:function(a)},scale:{get:function(),set:function(a)},defaultScale:{get:function(),set:function(a)},autoScale:{get:function(),set:function(a){var b=this.Jg;b!==a&&(this.Jg=a,this.g("autoScale", b,a),a!==oi&&Ui(this,!1))}},initialAutoScale:{get:function(),set:function(a)},initialViewportSpot:{get:function(),set:function(a){var b=this.Dr;b!==a&&(a.eb()||B("initialViewportSpot must be a specific Spot: "+a),this.Dr=a,this.g("initialViewportSpot",b,a))}},initialDocumentSpot:{get:function(),set:function(a){var b= this.Ar;b!==a&&(a.eb()||B("initialViewportSpot must be a specific Spot: "+a),this.Ar=a,this.g("initialDocumentSpot",b,a))}},minScale:{get:function(),set:function(a){var b=this.Wr;b!==a&&(0<a?(this.Wr=a,this.g("minScale",b,a),a>this.scale&&(this.scale=a)):va(a,"> 0",P,"minScale"))}},maxScale:{get:function(),set:function(a){var b=this.Ur;b!==a&&(0<a?(this.Ur=a,this.g("maxScale",b,a),a<this.scale&&(this.scale= a)):va(a,"> 0",P,"maxScale"))}},zoomPoint:{get:function(),set:function(a){this.Ls.A(a)||(this.Ls=a=a.G())}},contentAlignment:{get:function(),set:function(a)},initialContentAlignment:{get:function(),set:function(a){var b=this.On;b.A(a)||(this.On=a=a.G(),this.g("initialContentAlignment", b,a))}},padding:{get:function(),set:function(a){"number"==typeof a&&(a=new pc(a));var b=this.bb;b.A(a)||(this.bb=a=a.G(),this.Ta(),this.g("padding",b,a))}},partManager:{get:function(),set:function(a){var b=this.Ja;b!==a&&(null!==a.diagram&&B("Cannot share PartManagers between Diagrams: "+a.toString()),null!==b&&b.Wd(null),this.Ja=a,a.Wd(this))}},nodes:{get:function()}, links:{get:function()},parts:{get:function()},layout:{get:function(),set:function(a)},isTreePathToChildren:{get:function(),set:function(a){var b=this.Lr;if(b!==a&&(this.Lr= a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Ek(a.value)}},treeCollapsePolicy:{get:function(),set:function(a){var b=this.Gs;b!==a&&(a!==wi&&a!==Fk&&a!==Gk&&B("Unknown Diagram.treeCollapsePolicy: "+a),this.Gs=a,this.g("treeCollapsePolicy",b,a))}},ye:{get:function(),set:function(a)},autoScrollInterval:{get:function(), set:function(a)},autoScrollRegion:{get:function(),set:function(a){"number"==typeof a&&(a=new pc(a));var b=this.Xm;b.A(a)||(this.Xm=a=a.G(),this.Ta(),this.g("autoScrollRegion",b,a))}}});ma.Object.defineProperties(P,{licenseKey:{get:function(){return Hk.Vb()},set:function(a){Hk.add(a)}},version:{get:function()}}); P.prototype.makeImageData=P.prototype.Ix;P.prototype.makeImage=P.prototype.Sz;P.prototype.addRenderer=P.prototype.zy;P.prototype.makeSVG=P.prototype.vv;P.prototype.makeSvg=P.prototype.mt;P.prototype.stopAutoScroll=P.prototype.zf;P.prototype.doAutoScroll=P.prototype.Ss;P.prototype.isUnoccupied=P.prototype.gk;P.prototype.raiseDiagramEvent=P.prototype.R;P.prototype.removeDiagramListener=P.prototype.sm;P.prototype.addDiagramListener=P.prototype.Oj;P.prototype.findTreeRoots=P.prototype.nz; P.prototype.layoutDiagram=P.prototype.Qz;P.prototype.findTopLevelGroups=P.prototype.gz;P.prototype.findTopLevelNodesAndLinks=P.prototype.hz;P.prototype.findLinksByExample=P.prototype.Vs;P.prototype.findNodesByExample=P.prototype.Ws;P.prototype.findLinkForData=P.prototype.uc;P.prototype.findNodeForData=P.prototype.Mi;P.prototype.findPartForData=P.prototype.vc;P.prototype.findLinkForKey=P.prototype.findLinkForKey;P.prototype.findNodeForKey=P.prototype.Jb;P.prototype.findPartForKey=P.prototype.findPartForKey; P.prototype.rebuildParts=P.prototype.wd;P.prototype.transformViewToDoc=P.prototype.Bt;P.prototype.transformRectDocToView=P.prototype.qA;P.prototype.transformDocToView=P.prototype.Cq;P.prototype.centerRect=P.prototype.Os;P.prototype.scrollToRect=P.prototype.Ov;P.prototype.scroll=P.prototype.scroll;P.prototype.highlightCollection=P.prototype.Fz;P.prototype.highlight=P.prototype.Ez;P.prototype.clearHighlighteds=P.prototype.mx;P.prototype.selectCollection=P.prototype.hA;P.prototype.select=P.prototype.select; P.prototype.clearSelection=P.prototype.Tu;P.prototype.updateAllRelationshipsFromData=P.prototype.Eq;P.prototype.updateAllTargetBindings=P.prototype.updateAllTargetBindings;P.prototype.commit=P.prototype.commit;P.prototype.rollbackTransaction=P.prototype.yf;P.prototype.commitTransaction=P.prototype.Ua;P.prototype.startTransaction=P.prototype.ta;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.Ya;P.prototype.removeChangedListener=P.prototype.rk; P.prototype.addChangedListener=P.prototype.yh;P.prototype.removeModelChangedListener=P.prototype.dA;P.prototype.addModelChangedListener=P.prototype.jx;P.prototype.findLayer=P.prototype.dm;P.prototype.removeLayer=P.prototype.bA;P.prototype.addLayerAfter=P.prototype.vy;P.prototype.addLayerBefore=P.prototype.hx;P.prototype.addLayer=P.prototype.Vl;P.prototype.moveParts=P.prototype.moveParts;P.prototype.copyParts=P.prototype.Yj;P.prototype.removeParts=P.prototype.vt;P.prototype.remove=P.prototype.remove; P.prototype.add=P.prototype.add;P.prototype.clearDelayedGeometries=P.prototype.Su;P.prototype.setProperties=P.prototype.Uv;P.prototype.resetInputOptions=P.prototype.Lv;P.prototype.setInputOption=P.prototype.iA;P.prototype.getInputOption=P.prototype.gm;P.prototype.resetRenderingHints=P.prototype.Mv;P.prototype.setRenderingHint=P.prototype.Xx;P.prototype.getRenderingHint=P.prototype.xe;P.prototype.maybeUpdate=P.prototype.ud;P.prototype.requestUpdate=P.prototype.Xb;P.prototype.delayInitialization=P.prototype.Oy; P.prototype.isUpdateRequested=P.prototype.Lz;P.prototype.redraw=P.prototype.wf;P.prototype.invalidateDocumentBounds=P.prototype.Ta;P.prototype.findObjectsNear=P.prototype.xg;P.prototype.findPartsNear=P.prototype.dz;P.prototype.findObjectsIn=P.prototype.wg;P.prototype.findPartsIn=P.prototype.Ax;P.prototype.findObjectsAt=P.prototype.Ni;P.prototype.findPartsAt=P.prototype.cz;P.prototype.findObjectAt=P.prototype.Sb;P.prototype.findPartAt=P.prototype.em;P.prototype.focusObject=P.prototype.oz; P.prototype.alignDocument=P.prototype.By;P.prototype.zoomToRect=P.prototype.tA;P.prototype.zoomToFit=P.prototype.zoomToFit;P.prototype.diagramScroll=P.prototype.tx;P.prototype.focus=P.prototype.focus;P.prototype.reset=P.prototype.reset;P.useDOM=function(a){Vg=a?void 0!==x.document:!1};P.isUsingDOM=function(); var ze=null,xi=new G,Li=null,Ki=null,Vg=void 0!==x.document,Gi=null,Hi="",oi=new D(P,"None",0),$i=new D(P,"Uniform",1),aj=new D(P,"UniformToFill",2),Pf=new D(P,"CycleAll",10),Tf=new D(P,"CycleNotDirected",11),Vf=new D(P,"CycleNotDirectedFast",12),Wf=new D(P,"CycleNotUndirected",13),Qf=new D(P,"CycleDestinationTree",14),Sf=new D(P,"CycleSourceTree",15),Vh=new D(P,"DocumentScroll",1),Xh=new D(P,"InfiniteScroll",2),wi=new D(P,"TreeParentCollapsed",21),Fk=new D(P,"AllParentsCollapsed",22),Gk=new D(P, "AnyParentsCollapsed",23),Hk=new E,Ik="2.1.2",Jk=null,mi=!1;function ni(){if(Vg)} P.className="Diagram";P.fromDiv=function(a){var b=a;"string"=typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.B instanceof P?b.B:null};P.inherit=function(a,b){function c()if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class "+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};P.None=oi;P.Uniform=$i;P.UniformToFill=aj;P.CycleAll=Pf;P.CycleNotDirected=Tf;P.CycleNotDirectedFast=Vf; P.CycleNotUndirected=Wf;P.CycleDestinationTree=Qf;P.CycleSourceTree=Sf;P.DocumentScroll=Vh;P.InfiniteScroll=Xh;P.TreeParentCollapsed=wi;P.AllParentsCollapsed=Fk;P.AnyParentsCollapsed=Gk;function Ei() function wj(a,b){b.Xc.setTransform(b.Pb,0,0,b.Pb,0,0);if(nulla.Ke){b="f";var c=x[Ra("76a715b2f73f148a")][Ra("72ba13b5")];a.Ke=!0;if(Vg){var d=P[Ra("76a115b6ed251eaf4692")];if(d)for(var e=Hk.iterator;e.next();){d=e.value;d=Ra(d).split(Ra("39e9"));if(6>d.length)break;var f=Ra(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Ra(qa[Ra("6cae19")]).split(".");if(f[0]>g[0]||f[0]==g[0]&&f[1]>=g[1]){f=c[Ra("76ad18b4f73e")];for(g=cRa("73a612b6fb191d")+2;g<f;g++)b+=c[g];f=bRa("73a612b6fb191d"); 0>f&&Ra(d[2])!Ra("7da71ca0ad381e90")&&(f=bRa("73a612b6fb191d"));0>f&&(f=bRa("73a612b6fb191d"));0>f&&(f=cRa("73a612b6fb191d"));a.Ke=!(0<=f&&f<bRa("73a612b6fb191d")||-1bRa("73a612b6fb191d"));if(!a.Ke)break;f=Ra(d[2]);if("#"!==f[0])break;g=x.document.createElement("div");for(var h=d[0].replace(/[A-Za-z]/g,);4>h.length;)h+="9";h=h.substr(h.length-4);d=;d+=["gsh","gsf"][parseInt(h.substr(0, 1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(h.substr(0,1),10)%4];g[Ra("79a417a0f0181a8946")]=d;if(x.document[Ra("78a712aa")]){x.document[Ra("78a712aa")]Ra("7bb806b6ed32388c4a875b");h=x.getComputedStyle(g).getPropertyValue(Ra("78a704b7e62456904c9b12701b6532a8"));x.document[Ra("78a712aa")]Ra("68ad1bbcf533388c4a875b");if(!h)break;if(-1!==h.indexOf(parseInt(f[1]+f[2],16))&&-1!h.indexOf(parseInt(f[3]+f[4],16)))else if(Sa||Ta||Ua||Va)for(d="."+d,f=0;f<document.styleSheets.length;f++){g= document.styleSheets[f].rules||document.styleSheets[f].cssRules;for(var k in g)if(dg[k].selectorText)}}else a.Ke=null,a.Ke=!1}}else}}return 0<a.Ke&&a!==a.py?!0:!1} function Fi(a,b){if(Vg){void 0!==b&&null!==b||B("Diagram setup requires an argument DIV.");null!==a.Fa&&B("Diagram has already completed setup.");"string"=typeof b?a.Fa=x.document.getElementById(b):b instanceof HTMLDivElement?a.Fa=b:B("No DIV or DIV id supplied: "+b);nulla.Fa&&B("Invalid DIV id; could not get element with id: "+b);void 0!a.Fa.B&&B("Invalid div id; div already has a Diagram associated with it.");"static"x.getComputedStyle(a.Fa,null).position&&(a.Fa.style.position="relative"); a.Fa.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Fa.style["-ms-touch-action"]="none";a.Fa.innerHTML="";a.Fa.B=a;var c=a.Cs?new Bj(a):new Dk(a);void 0!==c.style&&(c.style.position="absolute",c.style.top="0px",c.style.left="0px","rtl"=x.getComputedStyle(a.Fa,null).getPropertyValue("direction")&&(a.Tn=!0),c.style.zIndex="2",c.style.userSelect="none",c.style.webkitUserSelect="none",c.style.MozUserSelect="none");a.Ba=c;a.Xc=c.context;b=a.Xc;a.Pb=a.computePixelRatio();a.va=a.Fa.clientWidth|| 1;a.ua=a.Fa.clientHeight||1;Dj(a,a.va,a.ua);/a.kr=b.V[Ra("7eba17a4ca3b1a8346")]Ra("78a118b7");/a.kr=function();a.Fa.insertBefore(c.Da,a.Fa.firstChild);c=new Dk(null);c.width=1;c.height=1;a.Wt=c;a.Bw=c.context;if(Vg){c=ta("div");var d=ta("div");c.style.position="absolute";c.style.overflow="auto";c.style.width=a.va+"px";c.style.height=a.ua+"px";c.style.zIndex="1";d.style.position="absolute";d.style.width="1px";d.style.height="1px";a.Fa.appendChild(c);c.appendChild(d);c.onscroll=Oi;c.onmousedown=Qi;c.ontouchstart= Qi;c.B=a;c.ny=!0;c.oy=!0;a.ss=c;a.lp=d}a.tt=ra(function(),300);a.gw=ra(function(){Eh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.kk=function(b){if(a.isEnabled)};a.jk=function(b){if(a.isEnabled)if(a.Yg=!0,a.Pe)b.preventDefault();else{var c=ej(a,b,!0);c.down=!0;c.clickCount=b.detail;if(Ta||Ua)b.timeStamp-a.pl<a.Ju&&!a.currentTool.isBeyondDragSize()?a.Jd++:a.Jd=1,a.pl= b.timeStamp,c.clickCount=a.Jd;c.clone(a.firstInput);a.doMouseDown();1b.button?b.preventDefault():kj(c,b)}};a.mk=function(b){if(a.isEnabled)if(a.Pe&&2=b.button)b.preventDefault();else if(a.Pe&&0=b.button&&(a.Pe=!1),a.Ql)b.preventDefault();else};a.nk=function(b){if(a.isEnabled){var c=ej(a,b,!0);c.bubbles=!0;var d=0,e=0;c.delta=0;void 0!b.deltaX? (0!b.deltaX&&(d=0<b.deltaX?1:-1),0!b.deltaY&&(e=0<b.deltaY?1:-1),c.delta=Math.abs(b.deltaX)>Math.abs(b.deltaY)?-d:-e):void 0!b.wheelDeltaX?(0!b.wheelDeltaX&&(d=0<b.wheelDeltaX?-1:1),0!b.wheelDeltaY&&(e=0<b.wheelDeltaY?-1:1),c.delta=Math.abs(b.wheelDeltaX)>Math.abs(b.wheelDeltaY)?-d:-e):void 0!b.wheelDelta&&0!b.wheelDelta&&(c.delta=0<b.wheelDelta?1:-1);a.doMouseWheel();kj(c,b)}};a.lk=function(b){a.isEnabled&&(a.Yg=!1,ej(a,b,!0),b=a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}; a.aw=function(b){if(a.isEnabled)a.doMouseDown();kj(c,b)}};a.$v=function(b){if(a.isEnabled){var c=null;0<b.targetTouches.length?c=b.targetTouches[0]:0< b.changedTouches.length&&(c=b.changedTouches[0]);c=jj(a,b,c,1<b.touches.length);a.doMouseMove();kj(c,b)}};a.Zv=function(b){if(a.isEnabled)if(a.Ql)b.preventDefault();else if(!(1<b.touches.length)){var c=null,d=null;0<b.targetTouches.length?d=b.targetTouches[0]:0<b.changedTouches.length&&(d=b.changedTouches[0]);var e=ij(a,b,!1,!0,!1,!1);null!d&&(c=x.document.elementFromPoint(d.clientX,d.clientY),null!c&&c.B instanceof P&&c.B!a&&fj(c.B,d,e),fj(a,d,e),e.clickCount=a.Jd);null=c?e.targetDiagram= gj(b):c.B?e.targetDiagram=c.B:e.targetDiagram=null;e.targetObject=null;a.doMouseUp();kj(e,b);a.Pe=!1}};a.nm=function(b){if(a.isEnabled){a.Yg=!0;var c=a.su;void 0=c[b.pointerId]&&(c[b.pointerId]=b);c=a.Al;var d=!1;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,d=!0;else if(null=c[0])c[0]=b;else if(null=c[1])c[1]=b,d=!0;else{b.preventDefault();return}if("touch"b.pointerType||"pen"b.pointerType)a.Ql=!1,a.Pe=!0;c=hj(a,b,b,d);d= a.Or;var e="touch"b.pointerType||"pen"=b.pointerType?25:10;b.timeStamp-a.pl<a.Ju&&!(Math.abs(d.x-b.screenX)>e||Math.abs(d.y-b.screenY)>e)?a.Jd++:a.Jd=1;c.clickCount=a.Jd;a.pl=b.timeStamp;a.Or.Cg(b.screenX,b.screenY);a.doMouseDown();1b.button?b.preventDefault():kj(c,b)}};a.om=function(b){if(a.isEnabled)if(nullc[0])c[0]=b;else return}c[0].pointerIdb.pointerId&& (c=jj(a,b,b,null!c[1]),c.targetDiagram=gj(b),a.doMouseMove(),kj(c,b))}};a.qm=function(b){if(a.isEnabled){a.Yg=!0;var c="touch"b.pointerType||"pen"==b.pointerType,d=a.su;if(c&&a.Ql)delete d[b.pointerId],b.preventDefault();else if(d=a.Al,null!d[0]&&d[0].pointerIdb.pointerId){d[0]=null;d=ij(a,b,!1,!0,!0,!1);var e=x.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.B instanceof P&&e.B!a&&fj(e.B,b,d);fj(a,b,d);d.clickCount=a.Jd;nulle?d.targetDiagram=gj(b):e.B?d.targetDiagram=e.B: d.targetDiagram=null;d.targetObject=null;a.doMouseUp();kj(d,b);c&&(a.Pe=!1)}else null!d[1]&&d[1].pointerId=b.pointerId&&(d[1]=null)}};a.pm=function(b){if(a.isEnabled){a.Yg=!1;var c=a.su;c[b.pointerId]&&delete c[b.pointerId];c=a.Al;null!c[0]&&c[0].pointerId=b.pointerId&&(c[0]=null);null!c[1]&&c[1].pointerId=b.pointerId&&(c[1]=null);"touch"!b.pointerType&&"pen"!b.pointerType&&(b=a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}};b.Qc(!0);Mi(a)}}Ei.className="DiagramHelper"; function ef(a){this.l=void 0=a?new H:a;this.u=new H}ma.Object.defineProperties(ef.prototype,{point:{get:function(),set:function(a)},shifted:{get:function(),set:function(a)}});ef.className="DraggingInfo";function Oj(a,b,c)Oj.className="DraggingNodeInfoPair";function Re(){this.reset()} Re.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Kb(NaN,NaN)).freeze();this.gridSnapCellSpot=xc;this.gridSnapOrigin=(new H(NaN,NaN)).freeze();this.Cz=this.dragsTree=this.dragsLink=!1;this.Bz=!0}; function Kk(a){1<arguments.length&&B("Palette constructor can only take one optional argument, the DIV HTML element or its id.");P.call(this,a);this.allowDragOut=!0;this.allowMove=!1;this.isReadOnly=!0;this.contentAlignment=yc;this.layout=new Lk}la(Kk,P);Kk.className="Palette"; function Mk(a){1<arguments.length&&B("Overview constructor can only take one optional argument, the DIV HTML element or its id.");P.call(this,a);this.animationManager.isEnabled=!1;this.Gb=!0;this.gg=null;this.al=this.$k=!1;this.lr=!0;this.Xx("drawShadows",!1);var b=new T,c=new W;c.stroke="magenta";c.strokeWidth=2;c.fill="transparent";c.name="BOXSHAPE";b.selectable=!0;b.selectionAdorned=!1;b.selectionObjectName="BOXSHAPE";b.locationObjectName="BOXSHAPE";b.resizeObjectName="BOXSHAPE";b.cursor="move"; b.add(c);this.l=b;this.allowDelete=this.allowCopy=!1;this.allowSelect=!0;this.autoScrollRegion=new pc(0,0,0,0);this.la.h(0,0);this.Gu=new Dk(null);this.qy=this.Gu.context;this.toolManager.Va("Dragging",new Nk,this.toolManager.mouseMoveTools);var d=this;this.click=function(){var a=d.gg;if(null!a){var b=a.viewportBounds,c=d.lastInput.documentPoint;a.position=new H(c.x-b.width/2,c.y-b.height/2)}};this.Km=function(){d.Ta();Ok(d)};this.Im=function(){null!d.gg&&(d.Ta(),d.N())};this.Jm=function(){d.N()}; this.dj=function(){null!d.gg&&Ok(d)};this.autoScale=$i;this.Gb=!1}la(Mk,P); function Pk(a){a.Gb||a.$b||!1!a.cd||(a.cd=!0,x.requestAnimationFrame(function(){if(a.cd&&!a.$b&&(a.cd=!1,null!a.Fa)){a.$b=!0;Si(a);a.documentBounds.v()||Aj(a,a.computeBounds());null=a.Fa&&B("No div specified");null=a.Ba&&B("No canvas specified");fi(a.box);if(a.nc){var b=a.gg;if(null!b&&!b.animationManager.isAnimating&&!b.animationManager.ic){b=a.Xc;var c=a.Gu;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.Ba.width,a.Ba.height);b.drawImage(c.Da,0,0);c=a.rb;c.reset();1!a.scale&&c.scale(a.scale); 0=a.position.x&&0=a.position.y||c.translate(-a.position.x,-a.position.y);b.scale(a.Pb,a.Pb);b.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);c=a.Ka.j;for(var d=c.length,e=0;e<d;e++)c[e].tb(b,a);a.hi=!1;a.nc=!1}}a.$b=!1}}))}Mk.prototype.computePixelRatio=function(){return 1}; Mk.prototype.tb=function(){null=this.Fa&&B("No div specified");null=this.Ba&&B("No canvas specified");if(!(this.Ba instanceof Bj)&&(fi(this.box),this.nc)){var a=this.gg;if(null!a&&!a.animationManager.isAnimating){uj(this);var b=a.grid;null=b||!b.visible||isNaN(b.width)||isNaN(b.height)||(b=M.alloc().assign(this.viewportBounds).Hc(a.viewportBounds),nj(a,b),M.free(b),Si(a));var c=this.Ba;b=this.Xc;var d=this.Gu,e=this.qy;d.width=c.width;d.height=c.height;b.Qc(!0);b.setTransform(1,0,0,1,0,0); b.clearRect(0,0,c.width,c.height);d=this.rb;d.reset();1!this.scale&&d.scale(this.scale);0=this.position.x&&0=this.position.y||d.translate(-this.position.x,-this.position.y);b.scale(this.Pb,this.Pb);b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);d=this.lr;var f=this.viewportBounds;a=a.Ka.j;for(var g=a.length,h=0;h<g;h++){var k=a[h],l=d;if(k.visible&&0!k.ob&&(void 0=l&&(l=!0),l||!k.isTemporary)){l=hi(k,b);var m=this.scale;k=k.Ca.j;for(var n=k.length,p=0;p<n;p++){var r=k[p],q=r.actualBounds; q.Gc(f)&&(q.widthm>this.ke||q.heightm>this.ke?r.tb(b,this):ii(b,r))}b.globalAlpha=l}}e.drawImage(c.Da,0,0);c=this.Ka.j;e=c.length;for(d=0;d<e;d++)c[d].tb(b,this);this.nc=this.hi=!1}}};function Ok(a){var b=a.box;if(null!b){var c=a.gg;if(null!c){a.nc=!0;c=c.viewportBounds;var d=b.selectionObject,e=Kb.alloc();e.h(c.width,c.height);d.desiredSize=e;Kb.free(e);a=2/a.scale;d instanceof W&&(d.strokeWidth=a);b.location=new H(c.x-a/2,c.y-a/2);b.isSelected=!0}}} Mk.prototype.computeBounds=function(){var a=this.gg;if(null=a)return nc;var b=a.documentBounds.copy();b.Hc(a.viewportBounds);return b};Mk.prototype.Fx=function(){!0!this.nc&&(this.nc=!0,Pk(this))};Mk.prototype.qq=function(a,b,c,d){this.Gb||(Ri(this),this.N(),Xi(this),this.Ta(),Ok(this),this.te.scale=c,this.te.position.x=a.x,this.te.position.y=a.y,this.te.bounds.assign(a),this.te.Hx=d,this.R("ViewportBoundsChanged",this.te,a))}; ma.Object.defineProperties(Mk.prototype,{observed:{get:function(),set:function(a){var b=this.gg;a instanceof Mk&&B("Overview.observed Diagram may not be an Overview itself: "+a);b!a&&(null!b&&(this.remove(this.box),b.sm("ViewportBoundsChanged",this.Km),b.sm("DocumentBoundsChanged",this.Im),b.sm("InvalidateDraw",this.Jm),b.sm("AnimationFinished",this.dj)),this.gg=a,null!a&&(a.Oj("ViewportBoundsChanged",this.Km),a.Oj("DocumentBoundsChanged",this.Im), a.Oj("InvalidateDraw",this.Jm),a.Oj("AnimationFinished",this.dj),this.add(this.box),Ok(this)),this.Ta(),this.g("observed",b,a))}},box:{get:function(),set:function(a)},drawsTemporaryLayers:{get:function(),set:function(a){this.lr!a&&(this.lr=a,this.wf())}}});Mk.className="Overview"; function Nk(){Qe.call(this);this.l=null}la(Nk,Qe); Nk.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.timestamp<this.delay))return!1;null=this.findDraggablePart()&&(c=b.viewportBounds,this.l=new H(c.width/2,c.height/2),a=a.firstInput.documentPoint,b.position=new H(a.x-this.l.x,a.y-this.l.y));return!0}; Nk.prototype.doActivate=function();Nk.prototype.moveParts=function(){var a=this.diagram,b=a.observed;if(null!b){var c=a.box;if(null!c){if(null=this.l){var d=a.firstInput.documentPoint;c=c.location;this.l=new H(d.x-c.x,d.y-c.y)}a=a.lastInput.documentPoint;b.position=new H(a.x-this.l.x,a.y-this.l.y)}}};Nk.className="OverviewDraggingTool"; function Qk(){Za(this);this.B=ze;this.Za=this.I=this.u=!0;this.Y=this.Ia=this.kd=this.Ja=!1;this.si=this.l=null;this.Vc=1.05;this.hu=NaN;this.Iw=null;this.Nu=NaN;this.Mu=nc;this.mg=null;this.Ic=200}Qk.prototype.toString=function(){return"CommandHandler"};Qk.prototype.Wd=function(a); Qk.prototype.doKeyDown=function(){var a=this.diagram,b=a.lastInput,c=Wa?b.meta:b.control,d=b.shift,e=b.alt,f=b.key;!c||"C"!f&&"Insert"!f?c&&"X"f||d&&"Del"f?this.canCutSelection()&&this.cutSelection():c&&"V"==f||d&&"Insert"f?this.canPasteSelection()&&this.pasteSelection():c&&"Y"f||e&&d&&"Backspace"==f?this.canRedo()&&this.redo():c&&"Z"==f||e&&"Backspace"==f?this.canUndo()&&this.undo():"Del"==f||"Backspace"f?this.canDeleteSelection()&&this.deleteSelection():c&&"A"f?this.canSelectAll()&& this.selectAll():"Esc"f?this.canStopCommand()&&this.stopCommand():"Up"f?a.allowVerticalScroll&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"==f?a.allowVerticalScroll&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"f?a.allowHorizontalScroll&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"f?a.allowHorizontalScroll&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"==f?d&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&& a.scroll("page","up"):"PageDown"f?d&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):"Home"f?c&&a.allowVerticalScroll?a.scroll("document","up"):!c&&a.allowHorizontalScroll&&a.scroll("document","left"):"End"==f?c&&a.allowVerticalScroll?a.scroll("document","down"):!c&&a.allowHorizontalScroll&&a.scroll("document","right"):" "f?this.canScrollToPart()&&this.scrollToPart():"Subtract"==f?this.canDecreaseZoom()&&this.decreaseZoom():"Add"==f?this.canIncreaseZoom()&& this.increaseZoom():c&&"0"==f?this.canResetZoom()&&this.resetZoom():d&&"Z"==f?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"f?this.canGroupSelection()&&this.groupSelection():c&&d&&"G"=f?this.canUngroupSelection()&&this.ungroupSelection():b.event&&113b.event.which?this.canEditTextBlock()&&this.editTextBlock():b.event&&93b.event.which?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()}; Qk.prototype.doKeyUp=function();Qk.prototype.stopCommand=function(){var a=this.diagram,b=a.currentTool;b instanceof Na&&a.allowSelect&&a.Tu();null!b&&b.doCancel()};Qk.prototype.canStopCommand=function(){return!0}; Qk.prototype.selectAll=function()finally{a.R("ChangedSelection",a.selection),a.currentCursor=}};Qk.prototype.canSelectAll=function(); Qk.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait";a.R("ChangingSelection",a.selection);a.ta("Delete");a.R("SelectionDeleting",a.selection);for(var b=new F,c=a.selection.iterator;c.next();)Rk(b,c.value,!0,this.deletesTree?Infinity:0,this.deletesConnectedLinks?null:!1,function(a){return a.canDelete()});a.vt(b,!0);a.R("SelectionDeleted",b)}finally{a.Ua("Delete"),a.R("ChangedSelection",a.selection),a.currentCursor=}}; Qk.prototype.canDeleteSelection=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowDelete||0a.selection.count?!1:!0};Qk.prototype.copySelection=function(){var a=this.diagram,b=new F;for(a=a.selection.iterator;a.next();)Rk(b,a.value,!0,this.copiesTree?Infinity:0,this.copiesConnectedLinks,function(a){return a.canCopy()});this.copyToClipboard(b)};Qk.prototype.canCopySelection=function(){var a=this.diagram;return a.allowCopy&&a.allowClipboard&&0!a.selection.count?!0:!1}; Qk.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};Qk.prototype.canCutSelection=function(); Qk.prototype.copyToClipboard=function(a)finally{c.km()&&(c.Xj=d),c.dk()&&(c.Wj=e),c=new E,c.addAll(f),Gi=c,Hi=b.model.dataFormat}}b.R("ClipboardChanged",c)}; Qk.prototype.pasteFromClipboard=function(){var a=new F,b=Gi;if(nullb)return a;var c=this.diagram;if(Hi!c.model.dataFormat)return a;var d=c.model,e=!1,f=!1,g=null;try{d.km()&&(e=d.Xj,d.Xj=this.copiesParentKey),d.dk()&&(f=d.Wj,d.Wj=this.copiesGroupKey),g=c.Yj(b,c,!1)}finally{for(d.km()&&(d.Xj=e),d.dk()&&(d.Wj=f),b=g.iterator;b.next();)c=b.value,d=b.key,c.location.v()||(d.location.v()?c.location=d.location:!c.position.v()&&d.position.v()&&(c.position=d.position)),a.add(c)}return a}; Qk.prototype.pasteSelection=function(a){void 0a&&(a=null);var b=this.diagram;try{b.currentCursor="wait";b.R("ChangingSelection",b.selection);b.ta("Paste");var c=this.pasteFromClipboard();0<c.count&&Se(b);for(var d=c.iterator;d.next();)d.value.isSelected=!0;if(null!a){var e=b.computePartsBounds(b.selection);if(e.v()){var f=this.computeEffectiveCollection(b.selection,b.Mk);tf(b,f,new H(a.x-e.centerX,a.y-e.centerY),b.Mk,!1)}}b.R("ClipboardPasted",c)}finally{b.Ua("Paste"),b.R("ChangedSelection", b.selection),b.currentCursor=""}};Qk.prototype.canPasteSelection=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||nullGi||0Gi.count||Hi!a.model.dataFormat?!1:!0};Qk.prototype.undo=function(){this.diagram.undoManager.undo()};Qk.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()};Qk.prototype.redo=function(){this.diagram.undoManager.redo()}; Qk.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()};Qk.prototype.decreaseZoom=function(a){void 0a&&(a=1/this.zoomFactor);var b=this.diagram;b.autoScaleoi&&(a=b.scale*a,a<b.minScale||a>b.maxScale||(b.scale=a))};Qk.prototype.canDecreaseZoom=function(a){void 0a&&(a=1/this.zoomFactor);var b=this.diagram;if(b.autoScale!oi)return!1;a=b.scale*a;return a<b.minScale||a>b.maxScale?!1:b.allowZoom}; Qk.prototype.increaseZoom=function(a){void 0a&&(a=this.zoomFactor);var b=this.diagram;b.autoScaleoi&&(a=b.scale*a,a<b.minScale||a>b.maxScale||(b.scale=a))};Qk.prototype.canIncreaseZoom=function(a){void 0a&&(a=this.zoomFactor);var b=this.diagram;if(b.autoScale!oi)return!1;a=b.scale*a;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};Qk.prototype.resetZoom=function(a){void 0a&&(a=this.defaultScale);var b=this.diagram;a<b.minScale||a>b.maxScale||(b.scale=a)}; Qk.prototype.canResetZoom=function(a){void 0a&&(a=this.defaultScale);var b=this.diagram;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};Qk.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Uc();a.wf();var c=a.position,d=a.scale;zh(b,"Zoom To Fit");dthis.Nu&&!isNaN(this.hu)&&a.documentBounds.A(this.Mu)?(a.scale=this.hu,a.position=this.Iw,this.Nu=NaN,this.Mu=nc):(this.hu=d,this.Iw=c.copy(),a.zoomToFit(),this.Nu=a.scale,this.Mu=a.documentBounds.copy());Bh(b)}; Qk.prototype.canZoomToFit=function(); Qk.prototype.scrollToPart=function(a){void 0a&&(a=null);var b=this.diagram;Zi(b);if(nulla){try{null!this.mg&&(this.mg.next()?a=this.mg.value:this.mg=null)}catch(k)nulla&&(0<b.highlighteds.count?this.mg=b.highlighteds.iterator:0<b.selection.count&&(this.mg=b.selection.iterator),null!==this.mg&&this.mg.next()&&(a=this.mg.value))}if(null!a){var c=b.animationManager;zh(c,"Scroll To Part");var d=this.scrollToPartPause;if(0<d){var e=Sk(this,a,[a]);if(1e.length)b.ta(),b.Os(a.actualBounds), b.Ua("Scroll To Part");else{var f=function(){b.ta();for(var a=e.pop();0<e.length&&a instanceof U&&a.isTreeExpanded&&(!(a instanceof S)||a.isSubGraphExpanded);)a=e.pop();0<e.length?(a instanceof T&&b.Ov(a.actualBounds),a instanceof U&&!a.isTreeExpanded&&(a.isTreeExpanded=!0),a instanceof S&&!a.isSubGraphExpanded&&(a.isSubGraphExpanded=!0)):(a instanceof T&&b.Os(a.actualBounds),b.sm("LayoutCompleted",g));b.Ua("Scroll To Part")},g=function(){sa(f,(c.isEnabled?c.duration:0)+d)};b.Oj("LayoutCompleted", g);f()}}else}}; function Sk(a,b,c){if(b.isVisible())return c;if(b instanceof De)Sk(a,b.adornedPart,c);else if(b instanceof Q)else b instanceof U&&(d=b.labeledLink,null!==d&&Sk(a,d,c),d=b.yg(),null!==d&&(d.isTreeExpanded||d.wasTreeExpanded||c.push(d),Sk(a,d,c))),b=b.containingGroup,null!b&&(b.isSubGraphExpanded||b.wasSubGraphExpanded||c.push(b),Sk(a,b,c));return c} Qk.prototype.canScrollToPart=function(a){void 0a&&(a=null);if(null!a&&!(a instanceof T))return!1;a=this.diagram;return 0a.selection.count&&0a.highlighteds.count?!1:a.allowHorizontalScroll&&a.allowVerticalScroll}; Qk.prototype.collapseTree=function(a){void 0a&&(a=null);var b=this.diagram;try{b.ta("Collapse Tree");zh(b.animationManager,"Collapse Tree");var c=new E;if(null!a&&a.isTreeExpanded)a.collapseTree(),c.add(a);else if(nulla)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof U&&e.isTreeExpanded&&(e.collapseTree(),c.add(e))}b.R("TreeCollapsed",c)}finally{b.Ua("Collapse Tree")}}; Qk.prototype.canCollapseTree=function(a){void 0a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!a){if(!(a instanceof U&&a.isTreeExpanded))return!1;if(0<a.bq().count)return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof U&&b.isTreeExpanded&&0<b.bq().count)return!0;return!1}; Qk.prototype.expandTree=function(a){void 0=a&&(a=null);var b=this.diagram;try{b.ta("Expand Tree");zh(b.animationManager,"Expand Tree");var c=new E;if(null!a&&!a.isTreeExpanded)a.expandTree(),c.add(a);else if(null=a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof U&&!e.isTreeExpanded&&(e.expandTree(),c.add(e))}b.R("TreeExpanded",c)}finally{b.Ua("Expand Tree")}}; Qk.prototype.canExpandTree=function(a){void 0=a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!a){if(!(a instanceof U)||a.isTreeExpanded)return!1;if(0<a.bq().count)return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof U&&!b.isTreeExpanded&&0<b.bq().count)return!0;return!1}; Qk.prototype.groupSelection=function(){var a=this.diagram,b=a.model;if(b.ek()){var c=this.archetypeGroupData;if(null!c){var d=null;try{a.currentCursor="wait";a.R("ChangingSelection",a.selection);a.ta("Group");for(var e=new E,f=a.selection.iterator;f.next();)for(var h=new E,k=e.iterator;k.next();)f||h.add(l)}if(0<h.count){var n=h.first().containingGroup;if(null!n)for(;null! n;)if(e)n=n.containingGroup;else break}if(c instanceof S)zg(c),d=c.copy(),null!d&&a.add(d);else if(b.tv(c))if(null!d){null!n&&this.isValidMember(n,d)&&(d.containingGroup=n);for(var q=h.iterator;q.next();)Se(a);d.isSelected=!0}}a.R("SelectionGrouped",d)}finally{a.Ua("Group"),a.R("ChangedSelection",a.selection),a.currentCursor= ""}}}};Qk.prototype.canGroupSelection=function()return!1}; function Tk(a){var b=Da();for(a=a.iterator;a.next();){var c=a.value;c instanceof Q||b.push(c)}a=new F;c=b.length;for(var d=0;d<c;d++){for(var e=b[d],f=!0,g=0;g<c;g++)if(e.Ud(b[g]))f&&a.add(e)}Fa(b);return a} Qk.prototype.isValidMember=function(a,b){if(null=b||a=b||b instanceof Q)return!1;if(null!a){if(a=b||a.Ud(b))return!1;var c=a.memberValidation;if(null!c&&!c(a,b)||null=a.data&&null!b.data||null!a.data&&null=b.data)return!1}c=this.memberValidation;return null!c?c(a,b):!0}; Qk.prototype.ungroupSelection=function(a){void 0=a&&(a=null);var b=this.diagram,c=b.model;if(c.ek())try{b.currentCursor="wait";b.R("ChangingSelection",b.selection);b.ta("Ungroup");var d=new E;if(null!a)d.add(a);else for(var e=b.selection.iterator;e.next();){var f=e.value;f instanceof S&&f.canUngroup()&&d.add(f)}var g=new E;if(0<d.count){Se(b);for(var h=d.iterator;h.next();){var k=h.value;k.expandSubGraph();var l=k.containingGroup,m=null!l&&null!l.data?c.ja(l.data):void 0;g.addAll(k.memberParts); for(var n=g.iterator;n.next();){var p=n.value;p.isSelected=!0;if(!(p instanceof Q))}b.remove(k)}}b.R("SelectionUngrouped",d,g)}finally{b.Ua("Ungroup"),b.R("ChangedSelection",b.selection),b.currentCursor=""}}; Qk.prototype.canUngroupSelection=function(a){void 0=a&&(a=null);var b=this.diagram;if(b.isReadOnly||b.isModelReadOnly||!b.allowDelete||!b.allowUngroup||!b.model.ek())return!1;if(null!a){if(!(a instanceof S))return!1;if(a.canUngroup())return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof S&&b.canUngroup())return!0;return!1}; Qk.prototype.addTopLevelParts=function(a,b)return c}; Qk.prototype.collapseSubGraph=function(a){void 0=a&&(a=null);var b=this.diagram;try{b.ta("Collapse SubGraph");zh(b.animationManager,"Collapse SubGraph");var c=new E;if(null!a&&a.isSubGraphExpanded)a.collapseSubGraph(),c.add(a);else if(null=a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof S&&e.isSubGraphExpanded&&(e.collapseSubGraph(),c.add(e))}b.R("SubGraphCollapsed",c)}finally{b.Ua("Collapse SubGraph")}}; Qk.prototype.canCollapseSubGraph=function(a){void 0=a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!a)return a instanceof S&&a.isSubGraphExpanded?!0:!1;for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof S&&b.isSubGraphExpanded)return!0;return!1}; Qk.prototype.expandSubGraph=function(a){void 0=a&&(a=null);var b=this.diagram;try{b.ta("Expand SubGraph");zh(b.animationManager,"Expand SubGraph");var c=new E;if(null!a&&!a.isSubGraphExpanded)a.expandSubGraph(),c.add(a);else if(null=a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof S&&!e.isSubGraphExpanded&&(e.expandSubGraph(),c.add(e))}b.R("SubGraphExpanded",c)}finally{b.Ua("Expand SubGraph")}}; Qk.prototype.canExpandSubGraph=function(a){void 0=a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!a)return a instanceof S&&!a.isSubGraphExpanded?!0:!1;for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof S&&!b.isSubGraphExpanded)return!0;return!1}; Qk.prototype.editTextBlock=function(a){void 0=a&&(a=null);var b=this.diagram,c=b.toolManager.findTool("TextEditing");if(null!c){if(null=a)}if(null=a)return;a=a.cm(function(a){return a instanceof Xg&&a.editable})}null!a&&(b.currentTool=null,c.textBlock=a,b.currentTool=c)}}; Qk.prototype.canEditTextBlock=function(a){void 0=a&&(a=null);var b=this.diagram;if(b.isReadOnly||b.isModelReadOnly||!b.allowTextEdit||null=b.toolManager.findTool("TextEditing"))return!1;if(null!a){if(!(a instanceof Xg))return!1;a=a.part;if(null!a&&a.canEdit())return!0}else for(b=b.selection.iterator;b.next();)if(a=b.value,a.canEdit()&&(a=a.cm(function(a){return a instanceof Xg&&a.editable}),null!a))return!0;return!1}; Qk.prototype.showContextMenu=function(a){var b=this.diagram,c=b.toolManager.findTool("ContextMenu");if(null!c&&(void 0=a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!a)){var d=b.lastInput,e=null;a instanceof Y?e=a.ga(Bc):b.viewportBounds.$(d.documentPoint)||(e=b.viewportBounds,e=new H(e.x+e.width/2,e.y+e.height/2));null!e&&(d.viewPoint=b.Cq(e),d.documentPoint=e,d.left=!1,d.right=!0,d.up=!0);b.currentTool=c;Tg(c,!1,a)}}; Qk.prototype.canShowContextMenu=function(a){var b=this.diagram,c=b.toolManager.findTool("ContextMenu");if(null=c)return!1;void 0=a&&(a=0<b.selection.count?b.selection.first():b);return null=c.findObjectWithContextMenu(a)?!1:!0}; Qk.prototype.computeEffectiveCollection=function(a,b){var c=this.diagram,d=c.toolManager.findTool("Dragging"),e=c.currentTool=d;void 0=b&&(b=e?d.dragOptions:c.Mk);d=new G;if(null=a)return d;for(var f=a.iterator;f.next();)Mj(c,d,f.value,e,b);if(null!c.draggedLink&&b.dragsLink)return d;for(f=a.iterator;f.next();)a=f.value,a instanceof Q&&(b=a.fromNode,null=b||d.contains(b)?(b=a.toNode,null=b||d.contains(b)||d.remove(a)):d.remove(a));return d}; ma.Object.defineProperties(Qk.prototype,{diagram:{get:function()},copiesClipboardData:{get:function(),set:function(a)},copiesConnectedLinks:{get:function(),set:function(a)},deletesConnectedLinks:{get:function(),set:function(a)},copiesTree:{get:function(), set:function(a)},deletesTree:{get:function(),set:function(a)},copiesParentKey:{get:function(),set:function(a)},copiesGroupKey:{get:function(),set:function(a)},archetypeGroupData:{get:function(),set:function(a)},memberValidation:{get:function(), set:function(a)},defaultScale:{get:function(),set:function(a)},zoomFactor:{get:function(),set:function(a){1<a||B("zoomFactor must be larger than 1.0, not: "+a);this.Vc=a}},scrollToPartPause:{get:function(),set:function(a)}});Qk.className="CommandHandler";Bi=function(); function Y(){Za(this);this.F=4225027;this.ob=1;this.jg=null;this.Qa=;this.dc=this.gb=null;this.la=(new H(NaN,NaN)).freeze();this.Kc=Sb;this.Zf=Lb;this.Yf=Rb;this.rb=new sd;this.Kh=new sd;this.Wf=new sd;this.ya=this.Tk=1;this.cc=0;this.se=Uk;this.bh=tc;this.oc=(new M(NaN,NaN,NaN,NaN)).freeze();this.vb=(new M(NaN,NaN,NaN,NaN)).freeze();this.pc=(new M(0,0,NaN,NaN)).freeze();this.O=this.So=this.To=null;this.zk=this.wb=$c;this.gp=0;this.hp=1;this.Mg=0;this.bn=1;this.Ap=null;this.mp=-Infinity;this.Dl= 0;this.El=Fb;this.Fl=pg;this.$h=;this.$a=this.M=null;this.Ek=-1;this.Hl=this.ld=this.Zh=this.Kl=null;this.ms=Ag;this.jp=this.Hg=this.Dj=null}var wd,Ag,Cg,Uk,Vk,Wk,Xk,Yk,Zk,$k; Y.prototype.cloneProtected=function(a);Y.prototype.gx=function(a)else this.Zh=b=[];b.push(a)};Y.prototype.pf=function(a); Y.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!this.Zh)for(var b=0;b<this.Zh.length;b++)return a};Y.prototype.copy=function(){return this.clone()};t=Y.prototype;t.cb=function(a){a.classType=Q?0=a.name.indexOf("Orient")?this.segmentOrientation=a:B("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType=Y&&(this.stretch=a)};t.toString=function(){return Ha(this.constructor)+"#"+lb(this)}; function al(a){null=a.M&&(a.M=new bl)}t.Ec=function(){if(null=this.O){var a=new cl;a.Vg=wc;a.uh=wc;a.Tg=10;a.sh=10;a.Ug=0;a.th=0;this.O=a}}; t.Ya=function(a,b,c,d,e,f,g){var h=this.part;if(null!h&&(h.qk(a,b,c,d,e,f,g),c=this&&a=re&&dl(this)&&el(this,h,b),f=this.diagram,null!this.Hg&&null!f&&f.fk&&!f.undoManager.isUndoingRedoing&&f.currentTool=f.toolManager&&(a=this.Hg.get(b),null=a||f.animationManager.isTicking||(null=this.jp&&(this.jp=new G),g=0=f.undoManager.transactionLevel,a.startCondition=bi?g=!0:a.startCondition=di&&(g=!1),g?(f=new yh,ci(a,f),g=this.jp.get(a),null!g&&g.stop(),this.jp.add(a,f),f.Ku=this,f.Yw= a,f.add(this,b,d,e),f.start()):(Ah(f.animationManager,"Trigger"),f.animationManager.defaultAnimation.add(this,b,d,e)))),this instanceof X&&c=h&&0!(h.F&16777216)&&null!h.data))for(c=this.W.j,d=c.length,e=0;e<d;e++)h=c[e],h instanceof X&&Ej(h,function(a){null!a.data&&0!(a.F&16777216)&&a.Aa(b)})}; function el(a,b,c)else if(f.isToModel)elseg=a&&(h=d.Us(f.bj),null!h&&f.ew(h,g,c))}}t.Us=function(a); t.g=function(a,b,c){this.Ya(re,a,this,b,c)};function gl(a,b,c,d,e)function il(a,b,c,d){if(!1=a.pickable)return!1;d.multiply(a.transform);return c?a.Gc(b,d):a.Bh(b,d)} t.zx=function(a,b,c){if(!1=this.pickable)return!1;var d=this.naturalBounds;b=a.we(b);return c?Ab(a.x,a.y,0,0,0,d.height)<=b||Ab(a.x,a.y,0,d.height,d.width,d.height)<=b||Ab(a.x,a.y,d.width,d.height,d.width,0)<=b||Ab(a.x,a.y,d.width,0,0,0)<=b:a.ed(0,0)<=b&&a.ed(0,d.height)<=b&&a.ed(d.width,0)<=b&&a.ed(d.width,d.height)<=b};t.Yd=function(){return!0}; t.(=function(a){var b=H.alloc();b.assign(a);this.transform.ra(b);var c=this.actualBounds;if(!c.v())return H.free(b),!1;var d=this.diagram;if(null!==d&&d.Pe){var e=d.gm("extraTouchThreshold"),f=d.gm("extraTouchArea"),g=f/2,h=this.naturalBounds;d=this.qf()*d.scale;var k=1/d;if(h.width*d<e&&h.height*d<e)return a=kc(c.x-g*k,c.y-g*k,c.width+f*k,c.height+f*k,b.x,b.y),H.free(b),a}e=!1;if(this instanceof De||this instanceof W?kc(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.)(b))this.ld&&!this.ld.$(b)?e= !1:null!this.dc&&c.((b)?e=!0:null!==this.gb&&this.pc.)(a)?e=!0:e=this.Ch(a);H.free(b);return e};t.Ch=function(a){var b=this.naturalBounds;return kc(0,0,b.width,b.height,a.x,a.y)};t.nf=function(a){if(0=this.angle)return this.actualBounds.nf(a);var b=this.naturalBounds;b=M.allocAt(0,0,b.width,b.height);var c=this.transform,d=!1,e=H.allocAt(a.x,a.y);b.((c.Td(e))&&(e.h(a.x,a.bottom),b.)(c.Td(e))&&(e.h(a.right,a.bottom),b.((c.Td(e))&&(e.h(a.right,a.y),b.)(c.Td(e))&&(d=!0))));H.free(e);M.free(b);return d}; t.Bh=function(a,b){if(void 0=b)return a.nf(this.actualBounds);var c=this.naturalBounds,d=!1,e=H.allocAt(0,0);a.((b.ra(e))&&(e.h(0,c.height),a.)(b.ra(e))&&(e.h(c.width,c.height),a.((b.ra(e))&&(e.h(c.width,0),a.)(b.ra(e))&&(d=!0))));H.free(e);return d}; t.Gc=function(a,b){if(void 0=b&&(b=this.transform,0=this.angle))return a.Gc(this.actualBounds);var c=this.naturalBounds,d=H.allocAt(0,0),e=H.allocAt(0,c.height),f=H.allocAt(c.width,c.height),g=H.allocAt(c.width,0),h=!1;if(a.((b.ra(d))||a.)(b.ra(e))||a.((b.ra(f))||a.)(b.ra(g)))h=!0;else{c=M.allocAt(0,0,c.width,c.height);var k=H.allocAt(a.x,a.y);c.((b.Td(k))?h=!0:(k.h(a.x,a.bottom),c.)(b.Td(k))?h=!0:(k.h(a.right,a.bottom),c.((b.Td(k))?h=!0:(k.h(a.right,a.y),c.)(b.Td(k))&&(h=!0))));H.free(k);M.free(c); !h&&(I.dt(a,d,e)||I.dt(a,e,f)||I.dt(a,f,g)||I.dt(a,g,d))&&(h=!0)}H.free(d);H.free(e);H.free(f);H.free(g);return h};t.ga=function(a,b){void 0=b&&(b=new H);if(a instanceof O)else b.set(a);this.sd.ra(b);return b}; t.cq=function(a){void 0=a&&(a=new M);var b=this.naturalBounds,c=this.sd,d=H.allocAt(0,0).transform(c);a.h(d.x,d.y,0,0);d.h(b.width,0).transform(c);fc(a,d.x,d.y,0,0);d.h(b.width,b.height).transform(c);fc(a,d.x,d.y,0,0);d.h(0,b.height).transform(c);fc(a,d.x,d.y,0,0);H.free(d);return a};t.Ri=function(); t.qf=function(){if(0!(this.F&4096)=!1)return this.Tk;var a=this.ya;return null!this.panel?a*this.panel.qf():a};t.$s=function(a,b){void 0=b&&(b=new H);b.assign(a);this.sd.Td(b);return b};t.Sc=function(a,b,c){return this.ck(a.x,a.y,b.x,b.y,c)}; t.ck=function(a,b,c,d,e); Y.prototype.measure=function(a,b,c,d){if(!1!rj(this)){var e=this.bh,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=0;this instanceof W&&(g=this.strokeWidth);90=f||270=f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof X;switch(jl(this,!0)){case Ag:g=e=0;h&&(b=a=Infinity); break;case wd:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case Vk:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case Wk:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.width<h.width&&(e=h.width);g>h.height&&k.height<h.height&&(g=h.height);c=Math.max(e/this.scale,k.width);d=Math.max(g/this.scale,k.height);h.width<c&&(c=Math.min(k.width,c));h.height<d&&(d=Math.min(k.height,d));a=Math.min(h.width,a);b=Math.min(h.height,b);a=Math.max(c,a);b=Math.max(d, b);if(90=f||270=f)f=a,a=b,b=f,f=c,c=d,d=f;this.oc.ea();this.mm(a,b,c,d);this.oc.freeze();this.oc.v()||B("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.oc.toString());mj(this,!1)}};Y.prototype.mm=function();Y.prototype.tf=function(){return!1}; Y.prototype.arrange=function(a,b,c,d,e){this.jl();var f=M.alloc();f.assign(this.vb);this.vb.ea();!1=sj(this)?this.vb.h(a,b,c,d):this.Ah(a,b,c,d);this.vb.freeze();void 0=e?this.ld=null:this.ld=e;c=!1;if(void 0!e)c=!0;else if(e=this.panel,null=e||e.type!X.TableRow&&e.type!X.TableColumn||(e=e.panel),null!e&&(e=e.pc,d=this.measuredBounds,null!this.areaBackground&&(d=this.vb),c=b+d.height,d=a+d.width,c=!(0<=a+.05&&d<=e.width+.05&&0<=b+.05&&c<=e.height+.05),this instanceof Xg&&(a=this.naturalBounds, this.Tr>a.height||this.nb>a.width)))c=!0;this.F=c?this.F|256:this.F&-257;this.vb.v()||B("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.vb.toString());this.qt(f,this.vb);kl(this,!1);M.free(f)};t=Y.prototype;t.Ah=function(); function ll(a,b,c,d,e){a.vb.h(b,c,d,e);if(!a.desiredSize.v()){var f=a.oc;c=a.bh;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=jl(a,!0);c=d&&f=e&&(b=Ag);switch(b){case Ag:if(c>d||f>e)mj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case wd:mj(a,!0);a.measure(d,e,0,0);break;case Vk:mj(a,!0);a.measure(d,f,0,0);break;case Wk:mj(a,!0),a.measure(c,e,0,0)}}} t.qt=function(a,b);t.Ho=function(a){null!this.portId&&(ml(a,!0),a instanceof U&&nl(a,this))}; t.tb=function(a,b){if(this.visible){var c=this instanceof X&&(this.type=X.TableRow||this.type=X.TableColumn),d=this.vb;if(c||0!d.width&&0!d.height&&!isNaN(d.x)&&!isNaN(d.y)){var e=this.opacity;if(0!e){var f=1;1!e&&(f=a.globalAlpha,a.globalAlpha=f*e);if(!this.vx(a,b))if(c)ol(this,a,b);else{this instanceof Q&&this.ik(!1);c=this.transform;var g=this.panel;0!(this.F&4096)=!0&&pl(this);var h=this.part,k=!1,l=0;if(h&&b.xe("drawShadows")&&(k=h.isShadowed)){var m=h.shadowOffset;l=Math.max(m.y, m.x)b.scaleb.Pb}if(!(m=b.qj||!this.tf()))if(m){m=0!(this.F&256);a.clipInsteadOfFill&&(m=!1);this instanceof Xg&&(a.font=this.font);if(m)a.save(); a.beginPath();a.rect(K,L,l,n);a.clip()}if(this.tf()){if(!h.isVisible()){1!e&&(a.globalAlpha=f);return}k&&(A=h.shadowOffset,a.Vv(A.xb.scaleb.Pb,A.yb.scaleb.Pb,h.shadowBlur),ql(a),a.shadowColor=h.shadowColor)}!0=this.shadowVisible?ql(a):!1=this.shadowVisible&&rl(a);h=this.naturalBounds;null!this.dc&&(ji(this,a,this.dc,!0,!0,h,d),this.dc instanceof sl&&this.dc.type=tl?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.Sd(this.dc)):a.fillRect(d.x,d.y,d.width,d.height));a.transform(c.m11, c.m12,c.m21,c.m22,c.dx,c.dy);k&&(null!g&&0!(g.F&512)||null!g&&(g.type=X.Auto||g.type=X.Spot)&&g.Ab()!this)&&null=this.shadowVisible&&rl(a);null!this.gb&&(l=this.naturalBounds,K=A=0,L=l.width,l=l.height,n=0,this instanceof W&&(l=this.oa.bounds,A=l.x,K=l.y,L=l.width,l=l.height,n=this.strokeWidth),ji(this,a,this.gb,!0,!1,h,d),this.gb instanceof sl&&this.gb.type=tl?(a.beginPath(),a.rect(A-n/2,K-n/2,L+n,l+n),a.Sd(this.gb)):a.fillRect(A-n/2,K-n/2,L+n,l+n));k&&(null!this.gb||null!this.dc|| null!g&&0!(g.F&512)||null!g&&(g.type=X.Auto||g.type=X.Spot)&&g.Ab()!this)?(ul(this,!0),null=this.shadowVisible&&rl(a)):ul(this,!1);this.Ki(a,b);k&&0!(this.F&512)=!0&&ql(a);this.tf()&&k&&rl(a);m?(a.restore(),this instanceof X?a.Qc(!0):a.Qc(!1)):c.gt()||(b=1/(c.m11c.m22-c.m12c.m21),a.transform(c.m22b,-c.m12b,-c.m21b,c.m11b,b*(c.m21c.dy-c.m22c.dx),b*(c.m12c.dx-c.m11c.dy)))}}1!e&&(a.globalAlpha=f)}}}};t.vx=function(){return!1}; function ol(a,b,c){var d=a.vb,e=a.pc;null!a.dc&&(ji(a,b,a.dc,!0,!0,e,d),a.dc instanceof sl&&a.dc.type=tl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Sd(a.dc)):b.fillRect(d.x,d.y,d.width,d.height));null!a.gb&&(ji(a,b,a.gb,!0,!1,e,d),a.gb instanceof sl&&a.gb.type=tl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Sd(a.gb)):b.fillRect(d.x,d.y,d.width,d.height));a.Ki(b,c)}t.Ki=function(); function ji(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=vl)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{h=f.width;k=f.height;e&&(h=g.width,k=g.height);if((f=b instanceof wl)&&c.ae&&(c.type=xl||c.Hk=h&&c.Nt=k))var l=c.ae;else{var m=0,n=0,p=0,r=0,q=0,u=0;u=q=0;e&&(q=g.x,u=g.y);m=c.start.xh+c.start.offsetX;n=c.start.yk+c.start.offsetY;p=c.end.xh+c.end.offsetX;r=c.end.yk+c.end.offsetY;m+=q;p+=q;n+=u;r+=u;if(c.type=yl)l= b.createLinearGradient(m,n,p,r);else if(c.type=tl)u=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(q=0,u=Math.max(h,k)/2):q=c.startRadius,l=b.createRadialGradient(m,n,q,p,r,u);else if(c.type=xl)trycatch(w)if(c.type!xl&&(e=c.colorStops,null!e))for(e=e.iterator;e.next();)l.addColorStop(e.key,e.value);if(f&&(c.ae=l,null!l&&(c.Hk=h,c.Nt=k),null=l&&c.type=xl&&-1!c.Hk)), 600)}}d?b.fillStyle=l:b.strokeStyle=l}}}t.Ag=function(a){if(a instanceof X)a:{if(this!a&&null!a)for(var b=this.panel;null!b;){if(b=a)b=b.panel}a=!1}else a=!1;return a};t.vf=function(){if(!this.visible)return!1;var a=this.panel;return null!a?a.vf():!0};t.Bg=function(){for(var a=this instanceof X?this:this.panel;null!a&&a.isEnabled;)a=a.panel;return null=a}; function pl(a){if(0!(a.F&2048)=!0)b.translate(a.vb.x-a.oc.x,a.vb.y-a.oc.y);if(1!a.scale||0!a.angle)zl(a,!1);Al(a,!0)}0!(a.F&4096)=!0&&(b=a.panel,null=b?(a.Kh.set(a.rb),a.Tk=a.scale,Al(a,!1)):null!b.sd&&(c=a.Kh,c.reset(),b.Yd()?c.multiply(b.Kh):null!b.panel&&c.multiply(b.panel.Kh),c.multiply(a.rb),a.Tk=a.scale*b.Tk,Al(a,!1)))} function hl(a,b,c,d,e,f){1!a.scale&&b.scale(a.scale);if(0!a.cc){var g=Bc;a.tf()&&a.locationSpot.eb()&&(g=a.locationSpot);var h=H.alloc();if(a instanceof T&&a.locationObject!a)for(c=a.locationObject,d=c.naturalBounds,h.sk(d.x,d.y,d.width,d.height,g),c.Wf.ra(h),h.offset(-c.measuredBounds.x,-c.measuredBounds.y),g=c.panel;null!g&&g!a;)g.Wf.ra(h),h.offset(-g.measuredBounds.x,-g.measuredBounds.y),g=g.panel;else h.sk(c,d,e,f,g);b.rotate(a.cc,h.x,h.y);H.free(h)}} t.o=function(a){void 0=a&&(a=!1);if(!0!rj(this)){mj(this,!0);kl(this,!0);var b=this.panel;null=b||a||b.o()}};t.im=function(){!0!rj(this)&&(mj(this,!0),kl(this,!0))};function Bl(a){if(!1=sj(a)){var b=a.panel;null!b?b.o():a.tf()&&(b=a.diagram,null!b&&(b.Gd.add(a),a instanceof U&&a.gd(),b.Xb()));kl(a,!0)}}t.jl=function(){0!(this.F&2048)=!1&&(zl(this,!0),Al(this,!0))};t.rv=function(){Al(this,!0)};t.N=function(); function jl(a,b){var c=a.stretch,d=a.panel;if(null!d&&d.type=X.Table)return Cl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!d&&d.type=X.Auto&&d.Ab()=a)return Dl(a,wd,b);if(c=Uk){if(null!d){if(d.type=X.Spot&&d.Ab()=a)return Dl(a,wd,b);c=d.defaultStretch;return c=Uk?Dl(a,Ag,b):Dl(a,c,b)}return Dl(a,Ag,b)}return Dl(a,c,b)} function Cl(a,b,c,d){var e=a.stretch;if(e!Uk)return Dl(a,e,d);var f=e=null;switch(b.stretch)switch(c.stretch)b=a.panel.defaultStretch;null=e&&(e=b=Vk||b=wd);null=f&&(f=b=Wk||b=wd);return!0=e&&!0=f?Dl(a,wd,d):!0=e?Dl(a,Vk,d):!0=f?Dl(a,Wk,d):Dl(a,Ag,d)} function Dl(a,b,c){if(c)return b;if(b=Ag)return Ag;c=a.desiredSize;if(c.v())return Ag;a=a.angle;if(!isNaN(c.width))if(90!a&&270!a){if(b=Vk)return Ag;if(b=wd)return Wk}else{if(b=Wk)return Ag;if(b=wd)return Vk}if(!isNaN(c.height))if(90!a&&270!a){if(b=Wk)return Ag;if(b=wd)return Vk}else{if(b=Vk)return Ag;if(b=wd)return Wk}return b}function ul(a,b)function dl(a){return 0!(a.F&1024)}function El(a,b) function zl(a,b)function Al(a,b)function rj(a){return 0!(a.F&8192)}function mj(a,b)function sj(a){return 0!(a.F&16384)}function kl(a,b)t.Yi=function(a);t.Tv=function();t.Sv=function(a){this.la.assign(a);Bl(this);return!0};t.zq=function(a,b){if(this.la.x!a||this.la.y!b)this.la.h(a,b),this.jl()}; function Fl(a){var b=a.part;if(b instanceof U&&(null!a.portId||a=b.port))}function Gl(a){var b=a.diagram;null=b||b.undoManager.isUndoingRedoing||(a instanceof X?a instanceof U?a.gd():a.Em(a,function(a){Fl(a)}):Fl(a))}t.bind=function(a){a.bd=this;var b=this.Oi();null!b&&Hl(b)&&B("Cannot add a Binding to a template that has already been copied: "+a);null=this.$a&&(this.$a=new E);this.$a.add(a)}; t.Oi=function(){for(var a=this instanceof X?this:this.panel;null!a;){if(null!a.Xh)return a;a=a.panel}return null};t.Uv=function(a){yj(this,a)};function Il(a,b){b.bd=a;null=a.Hg&&(a.Hg=new G);a.Hg.add(b.propertyName,b)} function Jl(a,b){for(var c=1;c<arguments.length;c);c=arguments;var d=null,e=null;if("function"===typeof a)e=a;else if("string"==typeof a){var f=Kl.H(a);"function"=typeof f?(c=Aa(arguments),d=f(c),ya(d)||B(‘GraphObject.make invoked object builder "‘+a+‘", but it did not return an Object‘)):e=x.go[a]}nulld&&(void 0!==e&&null!==e&&e.constructor||B("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);e=1;if(d instanceof P&&1<c.length){f= d;var g=c[1];if("string"===typeof g||g instanceof HTMLDivElement)Fi(f,g),e}for(;e<c.length;e++)f=c[e],void 0=f?B("Undefined value at argument "+e+" for object being constructed by GraphObject.make: "+d):Ll(d,f);return d} function Ll(a,b){if("string"typeof b)if(a instanceof Xg)a.text=b;else if(a instanceof W)a.figure=b;else if(a instanceof lk)a.source=b;else if(a instanceof X)b=Ml.H(b),null!==b&&(a.type=b);else if(a instanceof sl){var c=$a(sl,b);null!==c?a.type=c:B("Unknown Brush type as an argument to GraphObject.make: "+b)}else a instanceof ud?(b=$a(ud,b),null!==b&&(a.type=b)):a instanceof le&&(b=$a(le,b),null!==b&&(a.type=b));else if(b instanceof Y)a instanceof X||B("A GraphObject can only be added to a Panel, not to: "+ a),a.add(b);else if(b instanceof fk){var d;b.isRow&&"function"==typeof a.getRowDefinition?d=a.getRowDefinition(b.index):b.isRow||"function"!==typeof a.getColumnDefinition||(d=a.getColumnDefinition(b.index));d instanceof fk?d.Qs(b):B("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(b instanceof D)"function"typeof a.cb&&a.cb(b);else if(b instanceof Nl)a.type=b;else if(b instanceof Ji)a instanceof Y?a.bind(b):a instanceof fk?a.bind(b):B("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof $h)a instanceof Y?Il(a,b):B("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(b instanceof ge)a instanceof ud?a.figures.add(b):B("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof le)a instanceof ge?a.segments.add(b):B("A PathSegment can only be added to a PathFigure, not to: "+a);else if(b instanceof Di)a instanceof P? a.layout=b:a instanceof S?a.layout=b:B("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(b))for(c=0;c<b.length;c++)Ll(a,b[c]);else if("object"typeof b&&null!==b)if(a instanceof sl){c=new db;for(var e in b)d=parseFloat(e),isNaN(d)?c[e]=b[e]:a.addColorStop(d,b[e]);yj(a,c)}else if(a instanceof fk){void 0!b.row?(e=b.row,(void 0e||nulle||Infinitye||isNaN(e)||0>e)&&B("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.isRow= !0,a.index=e):void 0!b.column&&(e=b.column,(void 0e||null=e||Infinity=e||isNaN(e)||0>e)&&B("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new db;for(c in b)"row"!c&&"column"!c&&(e[c]=b[c]);yj(a,e)}else yj(a,b);else B(‘Unknown initializer "‘+b+‘" for object being constructed by GraphObject.make: ‘+a)}function Ol(a,b){Kl.add(a,b)} function Pl(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 0b)throw Error("no "+("function"typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b} ma.Object.defineProperties(Y.prototype,{shadowVisible:{get:function(),set:function(a)},enabledChanged:{get:function(){return null!==this.M?this.M.zn:null},set:function(a){al(this);var b=this.M.zn;b!==a&&(this.M.zn=a,this.g("enabledChanged",b,a))}},segmentOrientation:{get:function(),set:function(a){var b=this.Fl; b!a&&(this.Fl=a,this.o(),this.g("segmentOrientation",b,a),apg&&(this.angle=0))}},segmentIndex:{get:function(),set:function(a)},segmentFraction:{get:function(),set:function(a){isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.Dl;b!a&&(this.Dl=a,this.o(),this.g("segmentFraction",b,a))}},segmentOffset:{ get:function(),set:function(a)},stretch:{get:function(),set:function(a)},name:{get:function(),set:function(a)},opacity:{get:function(), set:function(a){var b=this.ob;b!a&&((0>a||1<a)&&va(a,"0 ? value ? 1",Y,"opacity"),this.ob=a,this.g("opacity",b,a),a=this.diagram,b=this.part,null!a&&null!b&&a.N(Cj(b,b.actualBounds)))}},visible:{get:function(){return 0!(this.F&1)},set:function(a)},pickable:{get:function(){return 0!(this.F&2)},set:function(a)},fromLinkableDuplicates:{get:function(){return 0!(this.F&4)},set:function(a)},fromLinkableSelfNode:{get:function(){return 0!(this.F&8)},set:function(a)},toLinkableDuplicates:{get:function(){return 0! (this.F&16)},set:function(a)},toLinkableSelfNode:{get:function(){return 0!(this.F&32)},set:function(a)},isPanelMain:{get:function(){return 0!(this.F&64)},set:function(a)},isActionable:{ get:function(){return 0!(this.F&128)},set:function(a)},areaBackground:{get:function(),set:function(a){var b=this.dc;b!a&&(null!a&&Ql(a,"GraphObject.areaBackground"),a instanceof sl&&a.freeze(),this.dc=a,this.N(),this.g("areaBackground",b,a))}},background:{get:function(),set:function(a){var b=this.gb;b!a&&(null!a&&Ql(a,"GraphObject.background"), a instanceof sl&&a.freeze(),this.gb=a,this.N(),this.g("background",b,a))}},part:{get:function(){if(this.tf())return this;if(null!this.Dj)return this.Dj;var a;for(a=this.panel;a;){if(a instanceof T)return this.Dj=a;a=a.panel}return null}},svg:{get:function(),set:function(a)},panel:{get:function()},layer:{get:function(){var a=this.part; return null!a?a.layer:null}},diagram:{get:function(){var a=this.part;return null!a?a.diagram:null}},position:{get:function(),set:function(a)},actualBounds:{get:function()},scale:{get:function(), set:function(a){var b=this.ya;b!a&&(0>=a&&B("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.ya=a,this.o(),this.g("scale",b,a))}},angle:{get:function(),set:function(a)},desiredSize:{get:function(),set:function(a){var b=a.width,c=a.height,d=this.Kc,e=d.width,f=d.height;(e=b||isNaN(e)&& isNaN(b))&&(f=c||isNaN(f)&&isNaN(c))||(this.Kc=a=a.G(),this.o(),this instanceof W&&this.bc(),this.g("desiredSize",d,a),dl(this)&&(a=this.part,null!a&&(el(this,a,"width"),el(this,a,"height"))))}},width:{get:function(),set:function(a){var b=this.Kc.width;b=a||isNaN(b)&&isNaN(a)||(b=this.Kc,this.Kc=a=(new Kb(a,this.Kc.height)).freeze(),this.o(),this instanceof W&&this.bc(),this.g("desiredSize",b,a),dl(this)&&(a=this.part,null!a&&el(this,a,"width")))}}, height:{get:function(),set:function(a){var b=this.Kc.height;b=a||isNaN(b)&&isNaN(a)||(b=this.Kc,this.Kc=a=(new Kb(this.Kc.width,a)).freeze(),this.o(),this instanceof W&&this.bc(),this.g("desiredSize",b,a),dl(this)&&(a=this.part,null!a&&el(this,a,"height")))}},minSize:{get:function(),set:function(a)},maxSize:{get:function(),set:function(a)},measuredBounds:{get:function()},naturalBounds:{get:function()},margin:{get:function(), set:function(a){"number"=typeof a&&(a=new pc(a));var b=this.bh;b.A(a)||(this.bh=a=a.G(),this.o(),this.g("margin",b,a))}},transform:{get:function(){0!(this.F&2048)=!0&&pl(this);return this.rb}},sd:{get:function(){0!(this.F&4096)=!0&&pl(this);return this.Kh}},alignment:{get:function(),set:function(a){var b=this.wb;b.A(a)||(a.jc()&&!a.Mb()&&B("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+ a),this.wb=a=a.G(),Bl(this),this.g("alignment",b,a))}},column:{get:function(),set:function(a){a=Math.round(a);var b=this.Mg;b!a&&(0>a&&va(a,">= 0",Y,"column"),this.Mg=a,this.o(),this.g("column",b,a))}},columnSpan:{get:function(),set:function(a){a=Math.round(a);var b=this.bn;b!a&&(1>a&&va(a,">= 1",Y,"columnSpan"),this.bn=a,this.o(),this.g("columnSpan",b,a))}},row:{get:function(), set:function(a){a=Math.round(a);var b=this.gp;b!a&&(0>a&&va(a,">= 0",Y,"row"),this.gp=a,this.o(),this.g("row",b,a))}},rowSpan:{get:function(),set:function(a){a=Math.round(a);var b=this.hp;b!a&&(1>a&&va(a,">= 1",Y,"rowSpan"),this.hp=a,this.o(),this.g("rowSpan",b,a))}},spanAllocation:{get:function(),set:function(a)},alignmentFocus:{ get:function(),set:function(a)},portId:{get:function(),set:function(a){var b=this.So;if(b!a){var c=this.part;null=c||c instanceof U||(B("Cannot set portID on a Link: "+a),c=null);null!b&&null!c&&Rl(c,this);this.So=a;null!a&&null!c&&(c.Dh=!0,Sl(c,this));this.g("portId",b,a)}}},toSpot:{get:function(){return null! this.O?this.O.uh:wc},set:function(a){this.Ec();var b=this.O.uh;b.A(a)||(a=a.G(),this.O.uh=a,this.g("toSpot",b,a),Fl(this))}},toEndSegmentLength:{get:function(){return null!this.O?this.O.sh:10},set:function(a){this.Ec();var b=this.O.sh;b!a&&(0>a&&va(a,">= 0",Y,"toEndSegmentLength"),this.O.sh=a,this.g("toEndSegmentLength",b,a),Fl(this))}},toShortLength:{get:function(){return null!this.O?this.O.th:0},set:function(a){this.Ec();var b=this.O.th; b!a&&(this.O.th=a,this.g("toShortLength",b,a),Fl(this))}},toLinkable:{get:function(){return null!this.O?this.O.Ip:null},set:function(a){this.Ec();var b=this.O.Ip;b!a&&(this.O.Ip=a,this.g("toLinkable",b,a))}},toMaxLinks:{get:function(){return null!this.O?this.O.Jp:Infinity},set:function(a){this.Ec();var b=this.O.Jp;b!a&&(0>a&&va(a,">= 0",Y,"toMaxLinks"),this.O.Jp=a,this.g("toMaxLinks",b,a))}},fromSpot:{ get:function(){return null!this.O?this.O.Vg:wc},set:function(a){this.Ec();var b=this.O.Vg;b.A(a)||(a=a.G(),this.O.Vg=a,this.g("fromSpot",b,a),Fl(this))}},fromEndSegmentLength:{get:function(){return null!this.O?this.O.Tg:10},set:function(a){this.Ec();var b=this.O.Tg;b!=a&&(0>a&&va(a,">= 0",Y,"fromEndSegmentLength"),this.O.Tg=a,this.g("fromEndSegmentLength",b,a),Fl(this))}},fromShortLength:{get:function(){return null!this.O?this.O.Ug: 0},set:function(a){this.Ec();var b=this.O.Ug;b!a&&(this.O.Ug=a,this.g("fromShortLength",b,a),Fl(this))}},fromLinkable:{get:function(){return null!this.O?this.O.Dn:null},set:function(a){this.Ec();var b=this.O.Dn;b!a&&(this.O.Dn=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{get:function(){return null!this.O?this.O.En:Infinity},set:function(a){this.Ec();var b=this.O.En;b!a&&(0>a&&va(a,">= 0",Y,"fromMaxLinks"),this.O.En=a,this.g("fromMaxLinks", b,a))}},cursor:{get:function(){return this.$h},set:function(a)},click:{get:function(){return null!this.M?this.M.Jf:null},set:function(a){al(this);var b=this.M.Jf;b!a&&(this.M.Jf=a,this.g("click",b,a))}},doubleClick:{get:function(){return null!this.M?this.M.Of:null},set:function(a){al(this);var b=this.M.Of;b!a&&(this.M.Of=a,this.g("doubleClick",b, a))}},contextClick:{get:function(){return null!this.M?this.M.Kf:null},set:function(a){al(this);var b=this.M.Kf;b!a&&(this.M.Kf=a,this.g("contextClick",b,a))}},mouseEnter:{get:function(){return null!this.M?this.M.ag:null},set:function(a){al(this);var b=this.M.ag;b!=a&&(this.M.ag=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return null!this.M?this.M.dg:null},set:function(a){al(this);var b= this.M.dg;b!a&&(this.M.dg=a,this.g("mouseLeave",b,a))}},mouseOver:{get:function(){return null!this.M?this.M.eg:null},set:function(a){al(this);var b=this.M.eg;b!a&&(this.M.eg=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return null!=this.M?this.M.cg:null},set:function(a){al(this);var b=this.M.cg;b!a&&(this.M.cg=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return null!this.M?this.M.bg: null},set:function(a){al(this);var b=this.M.bg;b!a&&(this.M.bg=a,this.g("mouseHold",b,a))}},mouseDragEnter:{get:function(){return null!this.M?this.M.uo:null},set:function(a){al(this);var b=this.M.uo;b!a&&(this.M.uo=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{get:function(){return null!this.M?this.M.vo:null},set:function(a){al(this);var b=this.M.vo;b!a&&(this.M.vo=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{ get:function(){return null!this.M?this.M.$f:null},set:function(a){al(this);var b=this.M.$f;b!a&&(this.M.$f=a,this.g("mouseDrop",b,a))}},actionDown:{get:function(){return null!this.M?this.M.Mm:null},set:function(a){al(this);var b=this.M.Mm;b!a&&(this.M.Mm=a,this.g("actionDown",b,a))}},actionMove:{get:function(){return null!this.M?this.M.Nm:null},set:function(a){al(this);var b=this.M.Nm;b!a&&(this.M.Nm=a,this.g("actionMove", b,a))}},actionUp:{get:function(){return null!this.M?this.M.Om:null},set:function(a){al(this);var b=this.M.Om;b!a&&(this.M.Om=a,this.g("actionUp",b,a))}},actionCancel:{get:function(){return null!this.M?this.M.Lm:null},set:function(a){al(this);var b=this.M.Lm;b!a&&(this.M.Lm=a,this.g("actionCancel",b,a))}},toolTip:{get:function(){return null!this.M?this.M.qg:null},set:function(a){al(this);var b=this.M.qg; b!a&&(this.M.qg=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return null!this.M?this.M.Lf:null},set:function(a){al(this);var b=this.M.Lf;b!a&&(this.M.Lf=a,this.g("contextMenu",b,a))}}});Y.prototype.setProperties=Y.prototype.Uv;Y.prototype.findTemplateBinder=Y.prototype.Oi;Y.prototype.bind=Y.prototype.bind;Y.prototype.isEnabledObject=Y.prototype.Bg;Y.prototype.isVisibleObject=Y.prototype.vf;Y.prototype.isContainedBy=Y.prototype.Ag; Y.prototype.getNearestIntersectionPoint=Y.prototype.Sc;Y.prototype.getLocalPoint=Y.prototype.(s;Y.prototype.getDocumentScale=Y.prototype.qf;Y.prototype.getDocumentAngle=Y.prototype.Ri;Y.prototype.getDocumentBounds=Y.prototype.cq;Y.prototype.getDocumentPoint=Y.prototype.ga;Y.prototype.intersectsRect=Y.prototype.Gc;Y.prototype.containedInRect=Y.prototype.Bh;Y.prototype.containsRect=Y.prototype.nf;Y.prototype.containsPoint=Y.prototype.);Y.prototype.raiseChanged=Y.prototype.g; Y.prototype.raiseChangedEvent=Y.prototype.Ya;Y.prototype.addCopyProperty=Y.prototype.gx;var Kl=null;Y.className="GraphObject";Kl=new G; Ol("Button",function(){function a(a,b){return null!a.diagram.Sb(a.documentPoint,function(a){for(;null!a.panel&&!a.isActionable;)a=a.panel;return a},function(a))}var b=Jl(X,X.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof X)},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", _buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Jl(W,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new O(0,0,2.76142374915397,2.761423749153969),spot2:new O(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Bg()&&b instanceof X&&(a=b.Xa("ButtonBorder"),a instanceof W))}; b.mouseLeave=function(a,b){b.Bg()&&b instanceof X&&(a=b.Xa("ButtonBorder"),a instanceof W&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Bg()&&b instanceof X&&null!b._buttonFillPressed&&0=a.button){var c=b.Xa("ButtonBorder");if(c instanceof W)}}; b.actionUp=function(b,d){if(d.Bg()&&d instanceof X&&null!d._buttonFillPressed&&0=b.button){var c=d.Xa("ButtonBorder");if(c instanceof W)}};b.actionCancel=function(b,d){if(d.Bg()&&d instanceof X&&null!d._buttonFillPressed){var c=d.Xa("ButtonBorder");if(c instanceof W)}};b.actionMove=function(b,d){if(d.Bg()&&d instanceof X&&null!d._buttonFillPressed){var c=b.diagram;if(0=c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.Xa("ButtonBorder"),b instanceof W))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!g&&(b.fill=g);g=d._buttonStrokePressed; b.stroke!g&&(b.stroke=g);c.skipsUndoManager=f}}};return b}); Ol("TreeExpanderButton",function(),Jl(W,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ob},(new Ji("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).pq()),{visible:!1},(new Ji("visible","isTreeLeaf",function(a){return!a})).pq());a.click=function(a,c){c=c.part;c instanceof De&&(c=c.adornedPart);if(c instanceof U){var b=c.diagram; if(null!b)else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); Ol("SubGraphExpanderButton",function(),Jl(W,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ob},(new Ji("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).pq()));a.click=function(a,c){c=c.part;c instanceof De&&(c=c.adornedPart);if(c instanceof S)else if(!b.canExpandSubGraph(c))return; a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});Ol("ToolTip",function(){return Jl(De,X.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new H(0,3),shadowBlur:5},Jl(W,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new O(0,0,4,6),spot2:new O(1,1,-4,-4)}))}); Ol("ContextMenu",function(){return Jl(De,X.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new H(0,3),shadowBlur:5},new Ji("background",,function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Ol("ContextMenuButton",function(){var a=Jl("Button");a.stretch=Vk;var b=a.Xa("ButtonBorder");b instanceof W&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new O(0,0,2,3),b.spot2=new O(1,1,-2,-2));return a}); Ol("PanelExpanderButton",function(a){var b=Pl(a,"COLLAPSIBLE"),c=Jl("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},Jl(W,{name:"ButtonIcon",strokeWidth:2},(new Ji("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).pq(b))); a=c.Xa("ButtonBorder");a instanceof W&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!d&&!d.isReadOnly){var e=c.Oi();null=e&&(e=c.part);null!==e&&(c=e.Xa(b),null!==c&&(a.handled=!0,d.ta("Collapse/Expand Panel"),c.visible=!c.visible,d.Ua("Collapse/Expand Panel")))}};return c}); Ol("CheckBoxButton",function(a){var b=Pl(a);a=Jl("Button",{desiredSize:new Kb(14,14)},Jl(W,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:wd,geometryStretch:Cg,visible:!1},!b?(new Ji("visible",b)).Jx():[]));a.click=function(a,d){if(d instanceof X){var c=a.diagram;if(!(null=c||c.isReadOnly||!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.Xa("ButtonIcon");c.ta("checkbox");f.visible=!f.visible;"function"==typeof d._doClick&&d._doClick(a, d);c.Ua("checkbox")}}};return a}); Ol("CheckBox",function(a){a=Pl(a);a=Jl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new pc(0,1,0,0)});var b=Jl(X,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave, actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});a.mouseEnter=null;a.mouseLeave=null;a.actionDown=null;a.actionUp=null;a.actionCancel=null;a.actionMove=null;a.click=null;return b});Y.None=Ag=new D(Y,"None",0);Y.Default=Uk=new D(Y,"Default",0);Y.Vertical=Wk=new D(Y,"Vertical",4);Y.Horizontal=Vk=new D(Y,"Horizontal",5);Y.Fill=wd=new D(Y,"Fill",3);Y.Uniform=Cg=new D(Y,"Uniform",1); Y.UniformToFill=Xk=new D(Y,"UniformToFill",2);Y.FlipVertical=Yk=new D(Y,"FlipVertical",1);Y.FlipHorizontal=Zk=new D(Y,"FlipHorizontal",2);Y.FlipBoth=$k=new D(Y,"FlipBoth",3);Y.make=Jl;Y.getBuilders=function(){var a=new G,b;for(b in Kl)if(b!==b.toLowerCase()){var c=Kl.H(b);"function"=typeof c&&a.add(b,c)}a.freeze();return a};Y.defineBuilder=Ol;Y.takeBuilderArgument=Pl; function bl()bl.prototype.copy=function(){var a=new bl;a.Jf=this.Jf;a.Of=this.Of;a.Kf=this.Kf;a.ag=this.ag;a.dg=this.dg;a.eg=this.eg;a.cg=this.cg;a.bg=this.bg;a.uo=this.uo;a.vo=this.vo;a.$f=this.$f;a.Mm=this.Mm;a.Nm=this.Nm;a.Om=this.Om;a.Lm=this.Lm;a.qg=this.qg;a.Lf=this.Lf;a.zn=this.zn;return a};bl.className="GraphObjectEventHandlers"; function Tl()Tl.prototype.copy=function(){var a=new Tl;a.La[0]=this.La[0];a.La[1]=this.La[1];a.La[2]=this.La[2];a.La[3]=this.La[3];a.La[4]=this.La[4];a.La[5]=this.La[5];return a};Tl.prototype.translate=function(a,b){this.La[4]+=this.La[0]a+this.La[2]b;this.La[5]+=this.La[1]a+this.La[3]b};Tl.prototype.scale=function(a,b){this.La[0]=a;this.La[1]=a;this.La[2]=b;this.La[3]=b};Tl.className="STransform"; function Ul(a)Ul.prototype.addColorStop=function(a,b){this.ox.push({offset:a,color:b})};Ul.className="SGradient"; function Bj(a,b){this.ownerDocument=a=void 0b?x.document:b;this.Xz="http://www.w3.org/2000/svg";void 0!==a&&(this.Da=this.ub("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Da.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Da.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.Yp=null;this.context=new Vl(this)} Bj.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.Da.setAttributeNS(null,"width",c+"px"),this.Da.setAttributeNS(null,"height",d+"px"),this.Da.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.ju.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.ju.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Bj.prototype.ub=function(a,b,c){a=this.ownerDocument.createElementNS(this.Xz,a);if(ya(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};Bj.prototype.getBoundingClientRect=function(){return this.Da.getBoundingClientRect()};Bj.prototype.focus=function(){this.Da.focus()};Bj.prototype.ux=function(); ma.Object.defineProperties(Bj.prototype,{width:{get:function(),set:function(a)},height:{get:function(),set:function(a)},style:{get:function()}});Bj.className="SVGSurface"; function Vl(a){this.tk=a;this.svg=a.Da;this.stack=[];this.wc=[];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.$e=this.wp=this.vp=0;this.jq=null;this.path=[];this.eu=!1;this.nh=null;this.oh=0;this.Rd=new Tl; Wl(this,1,0,0,1,0,0);var b=rb++,c=this.ub("clipPath",{id:"mainClip"+b});c.appendChild(this.ub("rect",{x:0,y:0,width:a.width,height:a.height}));this.ju=c;this.tk.Da.appendChild(c);this.wc[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.Zz=}t=Vl.prototype; t.reset=function(){this.stack=[];this.wc=[];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.$e=this.wp=this.vp=0;this.jq=null;this.path=[];this.Rd=new Tl;Wl(this,1,0,0,1,0,0);var a=rb++,b=this.ub("clipPath", {id:"mainClip"+a});b.appendChild(this.ub("rect",{x:0,y:0,width:this.tk.width,height:this.tk.height}));this.ju=b;this.tk.Da.appendChild(b);this.wc[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}; t.arc=function(a,b,c,d,e,f,g,h);t.beginPath=function();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.Rd);this.addPath("clipPath",this.path,new Tl)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new Ul("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.Zz;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+rb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.ub("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.ub("image",e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new Ul("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; t.drawImage=function(a,b,c,d,e,f,g,h,k){var l=;a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0=d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;l={x:0,y:0,width:m||d,height:n||e,href:l,preserveAspectRatio:"xMidYMid slice"};I.Z(d,h)&&I.Z(e,k)||(l.preserveAspectRatio="none");a="";h/=d;k/=e;if(0!f|| 0!g)a+=" translate("+f+", "+g+")";if(1!=h||1!k)a+=" scale("+h+", "+k+")";if(0!b||0!c)a+=" translate("+-b+", "+-c+")";if(0!b||0!c||d!m||e!n)f="CLIP"+rb++,g=this.ub("clipPath",),g.appendChild(this.ub("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),l["clip-path"]="url(#"+f+")";Xl(this,"image",l,this.Rd,a);this.addElement("image",l)};t.fill=function(){this.addPath("fill",this.path,this.Rd)};t.Sd=function(){this.clipInsteadOfFill?this.clip():this.fill()}; t.fillRect=function(a,b,c,d);Xl(this,"fill",a,this.Rd);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};Xl(this,"fill",b,this.Rd);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(); 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;b<this.path.length;b++)a.push(this.path[b]);this.stack.push(a);this.stack.push(this.Rd.copy())}; t.setTransform=function(a,b,c,d,e,f){1a&&0b&&0=c&&1=d&&0=e&&0=f||Wl(this,a,b,c,d,e,f)};t.scale=function(a,b){this.Rd.scale(a,b)};t.translate=function(a,b){this.Rd.translate(a,b)};t.transform=function();t.stroke=function(){this.addPath("stroke",this.path,this.Rd)};t.aj=function(){this.clipInsteadOfFill||this.stroke()};t.ub=function(a,b,c){return this.tk.ub(a,b,c)}; t.addElement=function(a,b,c); function Xl(a,b,c,d,e){1!a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"b?(a.fillStyle instanceof Ul?c.fill=Yl(a,a.fillStyle):(/rgba(/.test(a.fillStyle)&&(b=/srgbas(([,s]+)s*,s*([,s]+)s*,s*([,s]+)s*,s*([,s]+))s*(/i.exec(a.fillStyle),c.fill="rgb("+b[1]+","+b[2]+","+b[3]+")",c["fill-opacity"]=b[4]),c.fill=a.fillStyle),c.stroke="none"):"stroke"===b&&(c.fill="none",a.strokeStyle instanceof Ul?c.stroke=Yl(a,a.strokeStyle):(/^rgba(/.test(a.strokeStyle)&&(b=/^s*rgbas*(([^,s]+)s*,s*([^,s]+)s*,s*([^,s]+)s*,s*([^,s]+))s*)/i.exec(a.strokeStyle), c.stroke="rgb("+b[1]+","+b[2]+","+b[3]+")",c["stroke-opacity"]=b[4]),c.stroke=a.strokeStyle),c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);a=d.La;a="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")";void 0!e&&(a+=e);c.transform=a} function Yl(a,b){var c="GRAD"+rb++;if("linear"b.type)var d=a.ub("linearGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"});else if("radial"b.type)d=a.ub("radialGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c});else throw Error("invalid gradient");var e=b.ox;b=e.length;for(var f=[],g=0;g<b;g++);/rgba(/.test(k)&&(k=/srgbas(([,s]+)s*,s*([,s]+)s*,s*([,s]+)s*,s*([,s]+))s*$/i.exec(k), h["stop-color"]="rgb("+k[1]+","+k[2]+","+k[3]+")",h["stop-opacity"]=k[4]);f.push(h)}f.sort(function(a,b){return a.offset>b.offset?1:-1});for(e=0;e<b;e++)d.appendChild(a.ub("stop",f[e]));a.svg.appendChild(d);return"url(#"+c+")"} t.addPath=function(a,b,c){for(var d=[],e=0;e<b.length;e++){var f=Aa(b[e]),g=[f.shift()];if("A"g[0])g.push(f.shift()+","+f.shift(),f.shift(),f.shift()+","+f.shift(),f.shift()+","+f.shift());else for(;f.length;)g.push(f.shift()+","+f.shift());d.push(g.join(" "))}b={d:d.join(" ")};"stroke"a&&this.eu&&(b["stroke-dasharray"]=this.nh.toString(),b["stroke-dashoffset"]=this.oh);Xl(this,a,b,c);"clipPath"==a?(a="CLIP"+rb++,c=this.ub("clipPath",),c.appendChild(this.ub("path",b)),this.svg.appendChild(c), 0<this.wc.length&&this.wc[this.wc.length-1].setAttributeNS(null,"clip-path","url(#"+a+")")):this.addElement("path",b)};function Wl(a,b,c,d,e,f,g){var h=new Tl;h.La=[b,c,d,e,f,g];b=;Xl(a,"g",b,h);h=a.addElement("g",b);a.wc.push(h)} t.Aq=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!this.shadowBlur){var a="SHADOW"+rb++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null);var c=this.ub("feGaussianBlur",{"in":"SourceAlpha",result:"blur",zA:this.shadowBlur/2});var d=this.ub("feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});var e=this.ub("feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});var f=this.ub("feOffset",{"in":"comp",result:"offsetBlur", dx:this.shadowOffsetX,dy:this.shadowOffsetY});var g=this.ub("feMerge",);g.appendChild(this.ub("feMergeNode",{"in":"offsetBlur"}));g.appendChild(this.ub("feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);b.appendChild(g);0<this.wc.length&&this.wc[this.wc.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};t.Vv=function(a,b,c);function rl(a) function ql(a)t.Ts=function(a,b);t.Rs=function();t.Qc=function();t.Wx=function();Vl.prototype.rotate=function();Vl.prototype.getImageData=function();Vl.prototype.measureText=function();Vl.className="SVGContext"; P.prototype.mt=function(a){var b=new Bj(this,x.document);void 0a&&(a=new db);var c=this;return Bk(this,function(a,e){a=Ck(c,a,"SVG",b);a=null!==a?a.svg:null;return"function"=typeof e?(e(a),null):a},a)};P.prototype.makeSvg=P.prototype.mt;P.prototype.vv=function(a){return this.mt(a)};P.prototype.makeSVG=P.prototype.vv; Y.prototype.vx=function(a,b){if(!(a instanceof Vl))return!1;if(!this.visible)return!0;var c=null,d=a.jq;if(this instanceof X&&(this.typeX.TableRow||this.typeX.TableColumn))return ol(this,a,b),!0;var e=this.vb;if(0e.width||0e.height||isNaN(e.x)||isNaN(e.y))return!0;var f=this.transform,g=this.panel;0!(this.F&4096)!0&&pl(this);var h=0!(this.F&256),k=!1;this instanceof Xg&&(a.font=this.font);if(h)else m=Math.max(e.x,k.x),n=Math.max(e.y,k.y),p=Math.min(e.right,k.right)-m,l=Math.min(e.bottom,k.bottom)-n;if(m>e.width+e.x||e.x>k.width+k.x||n>e.height+e.y||e.y>k.height+k.y)return!0;k=!0;Wl(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.tf()&&!this.isVisible())return!0;a.Rd.La=[1,0,0,1,0,0];(this instanceof Xg&&1<this.lineCount||this instanceof W&&1<this.geometry.figures.length)&&Wl(a,1,0,0,1,0,0);m=!1;this.tf()&&this.isShadowed&&b.xe("drawShadows")&& (n=this.shadowOffset,a.Vv(n.xb.scaleb.Pb,n.yb.scaleb.Pb,this.shadowBlur),ql(a),a.shadowColor=this.shadowColor);n=!1;this.part&&b.xe("drawShadows")&&(n=this.part.isShadowed);!0=this.shadowVisible?(ql(a),!1=m&&n&&(Wl(a,1,0,0,1,0,0),a.Aq(),m=!0)):!1=this.shadowVisible&&rl(a);p=this.naturalBounds;null!this.areaBackground&&(ji(this,a,this.areaBackground,!0,!0,p,e),!1=m&&n&&(Wl(a,1,0,0,1,0,0),a.Aq(),m=!0),this.areaBackground instanceof sl&&this.areaBackground.type=tl?(a.beginPath(),a.rect(e.x, e.y,e.width,e.height),a.Sd(this.areaBackground)):a.fillRect(e.x,e.y,e.width,e.height));this instanceof X?Wl(a,f.m11,f.m12,f.m21,f.m22,f.dx,f.dy):a.Rd.La=[f.m11,f.m12,f.m21,f.m22,f.dx,f.dy];if(null!this.background){!1=m&&n&&(Wl(a,1,0,0,1,0,0),a.Aq(),m=!0);var r=this.naturalBounds;l=f=0;var q=r.width;r=r.height;var u=0;this instanceof W&&(r=this.geometry.bounds,f=r.x,l=r.y,q=r.width,r=r.height,u=this.strokeWidth);ji(this,a,this.background,!0,!1,p,e);this.background instanceof sl&&this.background.type tl?(a.beginPath(),a.rect(f-u/2,l-u/2,q+u,r+u),a.Sd(this.background)):a.fillRect(f-u/2,l-u/2,q+u,r+u)}n&&(null!this.background||null!this.areaBackground||null!g&&0!(g.F&512)||null!g&&(g.type=X.Auto||g.type=X.Spot)&&g.Ab()!this)?(ul(this,!0),null=this.shadowVisible&&rl(a)):ul(this,!1);this.Ki(a,b);n&&0!(this.F&512)=!0&&ql(a);this.tf()&&n&&rl(a);h&&(a.restore(),k&&a.wc.pop());this instanceof X&&(c=a.wc.pop());!0=m&&a.wc.pop();if(this instanceof Xg&&1<this.lineCount||this instanceof W&&1<this.geometry.figures.length)c=a.wc.pop();null!a.tk.Yp&&(null=c&&(d=a.jq?(Wl(a,1,0,0,1,0,0),c=a.wc.pop()):c=a.jq),a.tk.Yp(this,c));this.svg=c;return!0};function Dk(a,b){this.ownerDocument=b=void 0=b?x.document:b;this.Yp=null;b=b.createElement("canvas");b.tabIndex=0;this.Da=b;this.Da.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";this.context=new wl(b);b.B=a} Dk.prototype.resize=function(a,b,c,d){return this.width!a||this.height!b?(this.width=a,this.height=b,this.style.width=c+"px",this.style.height=d+"px",!0):!1};Dk.prototype.toDataURL=function(a,b){return this.Da.toDataURL(a,b)};Dk.prototype.getBoundingClientRect=function(){return this.Da.getBoundingClientRect()};Dk.prototype.focus=function(){this.Da.focus()};Dk.prototype.ux=function(); ma.Object.defineProperties(Dk.prototype,{width:{get:function(),set:function(a)},height:{get:function(),set:function(a)},style:{get:function()}});Dk.className="CanvasSurface"; function wl(a){a.getContext&&a.getContext("2d")||B("Browser does not support HTML Canvas Element");this.V=a.getContext("2d");this.Kt=this.Mt=this.Lt="";this.an=!1;this.$e=this.wp=this.vp=0}t=wl.prototype;t.Wx=function(a);t.arc=function(a,b,c,d,e,f){this.V.arc(a,b,c,d,e,f)};t.beginPath=function(){this.V.beginPath()};t.bezierCurveTo=function(a,b,c,d,e,f){this.V.bezierCurveTo(a,b,c,d,e,f)};t.clearRect=function(a,b,c,d){this.V.clearRect(a,b,c,d)};t.clip=function(){this.V.clip()}; t.closePath=function(){this.V.closePath()};t.createLinearGradient=function(a,b,c,d){return this.V.createLinearGradient(a,b,c,d)};t.createPattern=function(a,b){return this.V.createPattern(a,b)};t.createRadialGradient=function(a,b,c,d,e,f){return this.V.createRadialGradient(a,b,c,d,e,f)};t.drawImage=function(a,b,c,d,e,f,g,h,k){void 0=d?this.V.drawImage(a,b,c):this.V.drawImage(a,b,c,d,e,f,g,h,k)};t.fill=function(){this.V.fill()};t.fillRect=function(a,b,c,d){this.V.fillRect(a,b,c,d)}; t.fillText=function(a,b,c){this.V.fillText(a,b,c)};t.getImageData=function(a,b,c,d){return this.V.getImageData(a,b,c,d)};t.lineTo=function(a,b){this.V.lineTo(a,b)};t.measureText=function(a){return this.V.measureText(a)};t.moveTo=function(a,b){this.V.moveTo(a,b)};t.quadraticCurveTo=function(a,b,c,d){this.V.quadraticCurveTo(a,b,c,d)};t.rect=function(a,b,c,d){this.V.rect(a,b,c,d)};t.restore=function(){this.V.restore()};wl.prototype.rotate=function(a){this.V.rotate(a)};t=wl.prototype;t.save=function(){this.V.save()}; t.setTransform=function(a,b,c,d,e,f){this.V.setTransform(a,b,c,d,e,f)};t.scale=function(a,b){this.V.scale(a,b)};t.stroke=function(){this.V.stroke()};t.transform=function(a,b,c,d,e,f){1=a&&0=b&&0=c&&1=d&&0=e&&0=f||this.V.transform(a,b,c,d,e,f)};t.translate=function(a,b){this.V.translate(a,b)}; t.Sd=function(a){if(a instanceof sl&&a.type=tl)else this.an?this.clip():this.fill()};t.aj=function(){this.an||this.stroke()};t.Vv=function(a,b,c); t.Ts=function(a,b){var c=this.V;void 0!c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Rs=function(){var a=this.V;void 0!a.setLineDash&&(a.setLineDash(Zl),a.lineDashOffset=0)};t.Qc=function(a){a&&(this.Lt=);this.Kt=this.Mt=}; ma.Object.defineProperties(wl.prototype,{fillStyle:{get:function(),set:function(a){this.Kt!a&&(this.Kt=this.V.fillStyle=a)}},font:{get:function(),set:function(a){this.Lt!a&&(this.Lt=this.V.font=a)}},globalAlpha:{get:function(),set:function(a)},lineCap:{get:function(), set:function(a)},lineDashOffset:{get:function(),set:function(a)},lineJoin:{get:function(),set:function(a)},lineWidth:{get:function(),set:function(a)},miterLimit:{get:function(),set:function(a)},shadowBlur:{get:function(),set:function(a)},shadowColor:{get:function(),set:function(a)},shadowOffsetX:{get:function(),set:function(a)},shadowOffsetY:{get:function(),set:function(a)},strokeStyle:{get:function(),set:function(a){this.Mt!a&&(this.Mt=this.V.strokeStyle=a)}},textAlign:{get:function(),set:function(a)},imageSmoothingEnabled:{get:function(),set:function(a)},clipInsteadOfFill:{get:function(), set:function(a)}});var Zl=Object.freeze([]);wl.className="CanvasSurfaceContext";function $l()$l.className="ColorNumbers";function sl(a){am||(bm(),am=!0);Za(this);this.s=!1;void 0=a?(this.qa=vl,this.Gk="black"):"string"=typeof a?(this.qa=vl,this.Gk=a):(this.qa=a,this.Gk="black");a=this.qa;a=yl?(this.rd=yc,this.Uk=Gc):this.Uk=a=tl?this.rd=Bc:this.rd=wc;this.As=0;this.nr=NaN;this.ae=this.js=this.$d=null;this.Nt=this.Hk=0} sl.prototype.copy=function(){var a=new sl;a.qa=this.qa;a.Gk=this.Gk;a.rd=this.rd.G();a.Uk=this.Uk.G();a.As=this.As;a.nr=this.nr;null!this.$d&&(a.$d=this.$d.copy());a.js=this.js;return a};t=sl.prototype;t.freeze=function();t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;null!this.$d&&this.$d.ea();return this};t.cb=function(a); t.toString=function(){var a="Brush(";if(this.type=vl)a+=this.color;else if(a=this.type=yl?a+"Linear ":this.type=tl?a+"Radial ":this.type=xl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; t.addColorStop=function(a,b){this.s&&ua(this);("number"!typeof a||!isFinite(a)||1<a||0>a)&&va(a,"0 ? loc ? 1",sl,"addColorStop:loc");null=this.$d&&(this.$d=new G);this.$d.add(a,b);this.qa=vl&&(this.type=yl);this.ae=null;return this}; t.Rz=function(a,b){this.s&&ua(this);a=void 0=a||"number"!typeof a?.2:a;b=void 0=b?cm:b;if(this.type=vl)Qh(this.color),this.color=dm(a,b);else if((this.type=yl||this.type=tl)&&null!this.colorStops)for(var c=this.colorStops.iterator;c.next();)Qh(c.value),this.addColorStop(c.key,dm(a,b));return this};function em(a,b,c){b=void 0=b||"number"!typeof b?.2:b;c=void 0=c?cm:c;Qh(a);return dm(b,c)} t.Ny=function(a,b){this.s&&ua(this);a=void 0=a||"number"!typeof a?.2:a;b=void 0=b?cm:b;if(this.type=vl)Qh(this.color),this.color=dm(-a,b);else if((this.type=yl||this.type=tl)&&null!this.colorStops)for(var c=this.colorStops.iterator;c.next();)Qh(c.value),this.addColorStop(c.key,dm(-a,b));return this};function fm(a,b,c){b=void 0=b||"number"!typeof b?.2:b;c=void 0=c?cm:c;Qh(a);return dm(-b,c)} function gm(a,b,c){Qh(a);a=hm.l;var d=hm.I,e=hm.u,f=hm.Y;Qh(b);void 0=c&&(c=.5);return"rgba("+Math.round((hm.l-a)*c+a)+", "+Math.round((hm.I-d)*c+d)+", "+Math.round((hm.u-e)*c+e)+", "+Math.round((hm.Y-f)*c+f)+")"} t.Gx=function(){if(this.type=vl)return im(this.color);if((this.type=yl||this.type=tl)&&null!this.colorStops){var a=this.colorStops;if(this.type=tl)return im(a.first().value);if(null!a.get(.5))return im(a.get(.5));if(2=a.count)return a=a.ma(),im(gm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();)c>d&&(c=[d,d=c][0]);b=d-c;return im(gm(a.get(c),a.get(d),1-e/b))}return!1}; function im(a){if(null=a)return null;if(a instanceof sl)return a.Gx();Qh(a);return 128>(299hm.l+587hm.I+114hm.u)/1E3} function dm(a,b){switch(b){case cm:b=100jm(hm.l);var c=100jm(hm.I),d=100jm(hm.u);km.l=.4124564b+.3575761c+.1804375d;km.I=.2126729b+.7151522c+.072175d;km.u=.0193339b+.119192c+.9503041d;km.Y=hm.Y;b=lm(km.l/mm[0]);c=lm(km.I/mm[1]);d=lm(km.u/mm[2]);nm.l=116c-16;nm.I=500*(b-c);nm.u=200*(c-d);nm.Y=km.Y;nm.l=Math.min(100,Math.max(0,nm.l+100a));a=(nm.l+16)/116;b=a-nm.u/200;km.l=mm[0]om(nm.I/500+a);km.I=mm[1](nm.l>pmqm?Math.pow(a,3):nm.l/pm);km.u=mm[2]om(b);km.Y=nm.Y;a=-.969266km.l+1.8760108* km.I+.041556km.u;b=.0556434km.l+-.2040259km.I+1.0572252km.u;hm.l=255rm((3.2404542km.l+-1.5371385km.I+-.4985314km.u)/100);hm.I=255rm(a/100);hm.u=255rm(b/100);hm.Y=km.Y;hm.l=Math.round(hm.l);255<hm.l?hm.l=255:0>hm.l&&(hm.l=0);hm.I=Math.round(hm.I);255<hm.I?hm.I=255:0>hm.I&&(hm.I=0);hm.u=Math.round(hm.u);255<hm.u?hm.u=255:0>hm.u&&(hm.u=0);return"rgba("+hm.l+", "+hm.I+", "+hm.u+", "+hm.Y+")";case sm:return Rh(),Sh.u=Math.min(100,Math.max(0,Sh.u+100a)),"hsla("+Sh.l+", "+Sh.I+"%, "+Sh.u+"%, "+ Sh.Y+")";default:return B("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}function Qh(a){am||(bm(),am=!0);var b=tm;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,hm.l=a[0],hm.I=a[1],hm.u=a[2],hm.Y=a[3]/255):(b.fillStyle="#FFFFFF",b.fillStyle=a,hm.l=0,hm.I=0,hm.u=0,hm.Y=1)}} function Rh()g=60;0>g&&(g+=360);a=f/(1-Math.abs(2e-1))}Sh.l=Math.round(g);Sh.I=Math.round(100a);Sh.u=Math.round(100e);Sh.Y=hm.Y}function jm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function rm(a){return.0031308>=a?12.92a:1.055Math.pow(a,1/2.4)-.055} function lm(a){return a>qm?Math.pow(a,1/3):(pma+16)/116}function om(a){var b=aaa;return b>qm?b:(116*a-16)/pm}function Ql(a,b){"string"!typeof a&&(a instanceof sl||B("Value for "+b+" must be a color string or a Brush, not "+a))}function bm(){tm=Vg?(new Dk(null)).context:null} ma.Object.defineProperties(sl.prototype,{type:{get:function(),set:function(a){this.s&&ua(this,a);this.qa=a;this.start.jc()&&(a=yl?this.start=yc:a=tl&&(this.start=Bc));this.end.jc()&&(a=yl?this.end=Gc:a=tl&&(this.end=Bc));this.ae=null}},color:{get:function(),set:function(a){this.s&&ua(this,a);this.Gk=a;this.ae=null}},start:{get:function(),set:function(a){this.s&& ua(this,a);this.rd=a.G();this.ae=null}},end:{get:function(),set:function(a){this.s&&ua(this,a);this.Uk=a.G();this.ae=null}},startRadius:{get:function(),set:function(a){this.s&&ua(this,a);0>a&&va(a,">= zero",sl,"startRadius");this.As=a;this.ae=null}},endRadius:{get:function(),set:function(a){this.s&&ua(this,a);0>a&&va(a,">= zero",sl,"endRadius");this.nr=a;this.ae= null}},colorStops:{get:function(){return this.$d},set:function(a){this.s&&ua(this,a);this.$d=a;this.ae=null}},pattern:{get:function(),set:function(a){this.s&&ua(this,a);this.js=a;this.ae=null}}});sl.prototype.isDark=sl.prototype.Gx;sl.prototype.darkenBy=sl.prototype.Ny;sl.prototype.lightenBy=sl.prototype.Rz;sl.prototype.addColorStop=sl.prototype.addColorStop; var qm=216/24389,pm=24389/27,mm=[95.047,100,108.883],tm=null,hm=new $l,Sh=new $l,km=new $l,nm=new $l,am=!1;sl.className="Brush";var vl;sl.Solid=vl=new D(sl,"Solid",0);var yl;sl.Linear=yl=new D(sl,"Linear",1);var tl;sl.Radial=tl=new D(sl,"Radial",2);var xl;sl.Pattern=xl=new D(sl,"Pattern",4);var cm;sl.Lab=cm=new D(sl,"Lab",5);var sm;sl.HSL=sm=new D(sl,"HSL",6); sl.randomColor=function(a,b){void 0=a&&(a=128);void 0=b&&(b=Math.max(a,255));var c=Math.abs(b-a);b=Math.floor(a+Math.random()*c).toString(16);var d=Math.floor(a+Math.random()c).toString(16);a=Math.floor(a+Math.random()c).toString(16);2>b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+a}; sl.isValidColor=function(a){if("black"a)return!0;if(""=a)return!1;am||(bm(),am=!0);var b=tm;if(nullb)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};sl.lighten=function(a){return em(a)};sl.lightenBy=em;sl.darken=function(a){return fm(a)};sl.darkenBy=fm;sl.mix=gm;sl.isDark=im;function Nl()Nl.prototype.measure=function(); Nl.prototype.Uz=function(a,b,c,d,e){a.measure(b,c,d,e)};Nl.prototype.arrange=function();Nl.prototype.Dy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Nl.prototype.tb=function();ma.Object.defineProperties(Nl.prototype,{classType:{get:function()}});Nl.prototype.arrangeElement=Nl.prototype.Dy;Nl.prototype.measureElement=Nl.prototype.Uz;Nl.className="PanelLayout";function um(){this.name="Base";this.name="Position"}la(um,Nl); um.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=vm(a);for(var k=0;k<h;k++){var l=d[k];if(l.visible||l=a){var m=l.margin,n=m.right+m.left;m=m.top+m.bottom;l.measure(b,c,f,g);var p=l.measuredBounds;n=Math.max(p.width+n,0);m=Math.max(p.height+m,0);p=l.position.x;var r=l.position.y;isFinite(p)||(p=0);isFinite(r)||(r=0);l instanceof W&&l.isGeometryPositioned&&(l=l.strokeWidth/2,p-=l,r-=l);fc(e,p,r,n,m)}}}; um.prototype.arrange=function(a,b,c){var d=b.length,e=a.padding;a=c.x-e.left;c=c.y-e.top;for(e=0;e<d;e++){var f=b[e],g=f.measuredBounds,h=f.margin,k=f.position.x,l=f.position.y;k=isNaN(k)?-a:k-a;l=isNaN(l)?-c:l-c;if(f instanceof W&&f.isGeometryPositioned)f.visible&&f.arrange(k+h.left,l+h.top,g.width,g.height)}};function wm(){this.name="Base";this.name="Horizontal"}la(wm,Nl); wm.prototype.measure=function(a,b,c,d,e,f,g)}}d=b.length;a.desiredSize.height?c=Math.min(a.desiredSize.height,a.maxSize.height):0!e.height&&(c=Math.min(e.height,a.maxSize.height));for(a=0;a<d;a++)if(k= b[a],k.visible||k=f)m=k.margin,h=m.right+m.left,m=m.top+m.bottom,k.measure(Infinity,c,0,g),k=k.measuredBounds,m=Math.max(k.height+m,0),e.width+=Math.max(k.width+h,0),e.height=Math.max(e.height,m);Fa(b)}; wm.prototype.arrange=function(a,b,c){for(var d=b.length,e=a.padding,f=e.top,g=a.isOpposite,h=g?c.width:e.left,k=0;k<d;k++){var l=f,m=b[k];if(m.visible){var n=m.measuredBounds,p=m.margin,r=p.top+p.bottom,q=f+e.bottom,u=n.height,v=jl(m,!1);if(isNaN(m.desiredSize.height)&&v=wd||v=Wk)u=Math.max(c.height-r-q,0);r=u+r+q;q=m.alignment;q.Mb()&&(q=a.defaultAlignment);q.eb()||(q=Bc);g&&(h-=n.width+p.left+p.right);m.arrange(h+q.offsetX+p.left,l+q.offsetY+p.top+(c.heightq.y-rq.y),n.width,u);g||(h+=n.width+ p.left+p.right)}}};function xm(){this.name="Base";this.name="Vertical"}la(xm,Nl); xm.prototype.measure=function(a,b,c,d,e,f)}}d=c.length;if(0!d){a.desiredSize.width?b=Math.min(a.desiredSize.width,a.maxSize.width):0!e.width&&(b=Math.min(e.width,a.maxSize.width));for(a=0;a<d;a++)if(k= c[a],k.visible||k=h)l=k.margin,g=l.right+l.left,l=l.top+l.bottom,k.measure(b,Infinity,f,0),k=k.measuredBounds,l=Math.max(k.height+l,0),e.width=Math.max(e.width,Math.max(k.width+g,0)),e.height+=l;Fa(c)}}; xm.prototype.arrange=function(a,b,c){for(var d=b.length,e=a.padding,f=e.left,g=a.isOpposite,h=g?c.height:e.top,k=0;k<d;k++){var l=f,m=b[k];if(m.visible){var n=m.measuredBounds,p=m.margin,r=p.left+p.right,q=f+e.right,u=n.width,v=jl(m,!1);if(isNaN(m.desiredSize.width)&&v=wd||v=Vk)u=Math.max(c.width-r-q,0);r=u+r+q;q=m.alignment;q.Mb()&&(q=a.defaultAlignment);q.eb()||(q=Bc);g&&(h-=n.height+p.bottom+p.top);m.arrange(l+q.offsetX+p.left+(c.widthq.x-rq.x),h+q.offsetY+p.top,u,n.height);g||(h+=n.height+ p.bottom+p.top)}}};function ym(){this.name="Base";this.name="Spot"}la(ym,Nl); ym.prototype.measure=function(a,b,c,d,e,f,g)A.measure(b,c,0,0);p=A.measuredBounds;r= Math.max(p.width+r,0);q=Math.max(p.height+q,0);var C=A.alignment;C.Mb()&&(C=a.defaultAlignment);C.eb()||(C=Bc);var J=A.alignmentFocus;J.Mb()&&(J=Bc);var K=null;A instanceof X&&""!A.Gg&&(A.arrange(0,0,p.width,p.height),K=A.Xa(A.Gg),K=A&&(K=null));if(null!K)else A=C.xf+C.offsetX-(J.xp.width+J.offsetX)- l.left,p=C.yg+C.offsetY-(J.yp.height+J.offsetY)-l.top;w?(w=!1,e.h(A,p,r,q)):fc(e,A,p,r,q)}}w?e.assign(v):u?e.pv(v.x,v.y,v.width,v.height):fc(e,v.x,v.y,v.width,v.height);M.free(v);p=k.stretch;p=Uk&&(p=jl(k,!1));switch(p){case Ag:return;case wd:if(!isFinite(b)&&!isFinite(c))return;break;case Vk:if(!isFinite(b))return;break;case Wk:if(!isFinite(c))return}p=k.measuredBounds;f=p.width;g=p.height;r=Math.max(f+m,0);q=Math.max(g+n,0);l=k.margin;v=M.allocAt(-l.left,-l.top,r,q);for(b=0;b<h;b++)c=d[b],c k||!c.visible&&c!y||(l=c.margin,r=l.right+l.left,q=l.top+l.bottom,p=c.measuredBounds,r=Math.max(p.width+r,0),q=Math.max(p.height+q,0),m=c.alignment,m.Mb()&&(m=a.defaultAlignment),m.eb()||(m=Bc),c=c.alignmentFocus,c.Mb()&&(c=Bc),w?(w=!1,e.h(m.xf+m.offsetX-(c.xp.width+c.offsetX)-l.left,m.yg+m.offsetY-(c.yp.height+c.offsetY)-l.top,r,q)):fc(e,m.xf+m.offsetX-(c.xp.width+c.offsetX)-l.left,m.yg+m.offsetY-(c.yp.height+c.offsetY)-l.top,r,q));w?e.assign(v):u?e.pv(v.x,v.y,v.width,v.height):fc(e,v.x, v.y,v.width,v.height);M.free(v)}; ym.prototype.arrange=function(a,b,c){var d=b.length,e=a.Ab(),f=e.measuredBounds,g=f.width;f=f.height;var h=a.padding,k=h.left;h=h.top;var l=k-c.x,m=h-c.y;e.arrange(l,m,g,f);for(var n=0;n<d;n++){var p=b[n];if(p!e){var r=p.measuredBounds,q=r.width;r=r.height;m=p.alignment;m.Mb()&&(m=a.defaultAlignment);m.eb()||(m=Bc);var u=p.alignmentFocus;u.Mb()&&(u=Bc);l=null;p instanceof X&&""!p.Gg&&(l=p.Xa(p.Gg),l=p&&(l=null));if(null!l){var v=l.naturalBounds;for(u=H.allocAt(u.xv.width-u.offsetX,u.yv.height- u.offsetY);l!p;)l.transform.ra(u),l=l.panel;l=m.xg+m.offsetX-u.x;m=m.yf+m.offsetY-u.y;H.free(u)}else l=m.xg+m.offsetX-(u.xq+u.offsetX),m=m.yf+m.offsetY-(u.yr+u.offsetY);l-=c.x;m-=c.y;p.visible&&p.arrange(k+l,h+m,q,r)}}};function zm(){this.name="Base";this.name="Auto"}la(zm,Nl); zm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length,k=a.Ab(),l=k.margin,m=b,n=c,p=l.right+l.left,r=l.top+l.bottom;k.measure(b,c,f,g);l=k.measuredBounds;var q=0,u=null;k instanceof W&&(u=k,q=u.strokeWidthu.scale);var v=Math.max(l.width+p,0);l=Math.max(l.height+r,0);var w=Am(k),y=w.xv+w.offsetX;w=w.yl+w.offsetY;var z=Bm(k),A=z.xv+z.offsetX;z=z.y*l+z.offsetY;isFinite(b)&&(m=Math.max(Math.abs(y-A)-q,0));isFinite(c)&&(n=Math.max(Math.abs(w-z)-q,0));q=Kb.alloc();q.h(0,0);a=vm(a);for(z=0;z<h;z++)w= d[z],w=k||!w.visible&&w!a||(l=w.margin,v=l.right+l.left,y=l.top+l.bottom,w.measure(m,n,0,0),l=w.measuredBounds,v=Math.max(l.width+v,0),l=Math.max(l.height+y,0),q.h(Math.max(v,q.width),Math.max(l,q.height)));if(1=h)e.width=v,e.height=l,Kb.free(q);else{w=Am(k);z=Bm(k);h=d=0;z.x!w.x&&z.y!w.y&&(d=q.width/Math.abs(z.x-w.x),h=q.height/Math.abs(z.y-w.y));Kb.free(q);q=0;null!u&&(q=u.strokeWidthu.scale,Bg(u)=Cg&&(d=h=Math.max(d,h)));d+=Math.abs(w.offsetX)+Math.abs(z.offsetX)+q;h+=Math.abs(w.offsetY)+ Math.abs(z.offsetY)+q;u=k.stretch;u=Uk&&(u=jl(k,!1));switch(u){case Ag:g=f=0;break;case wd:isFinite(b)&&(d=b);isFinite(c)&&(h=c);break;case Vk:isFinite(b)&&(d=b);g=0;break;case Wk:f=0,isFinite(c)&&(h=c)}k.im();k.measure(d,h,f,g);e.width=k.measuredBounds.width+p;e.height=k.measuredBounds.height+r}}; zm.prototype.arrange=function(a,b){var c=b.length,d=a.Ab(),e=d.measuredBounds,f=M.alloc();f.h(0,0,1,1);var g=d.margin,h=g.left;g=g.top;var k=a.padding,l=k.left;k=k.top;d.arrange(l+h,k+g,e.width,e.height);var m=Am(d),n=Bm(d),p=m.ye.height+m.offsetY,r=n.xe.width+n.offsetX;n=n.ye.height+n.offsetY;f.x=m.xe.width+m.offsetX;f.y=p;fc(f,r,n,0,0);f.x+=h+l;f.y+=g+k;for(e=0;e<c;e++)h=b[e],h!==d&&(l=h.measuredBounds,g=h.margin,k=Math.max(l.width+g.right+g.left,0),m=Math.max(l.height+g.top+g.bottom,0),p=h.alignment, p.Mb()&&(p=a.defaultAlignment),p.eb()||(p=Bc),k=f.widthp.x+p.offsetX-kp.x+g.left+f.x,g=f.heightp.y+p.offsetY-m*p.y+g.top+f.y,h.visible&&(kc(f.x,f.y,f.width,f.height,k,g,l.width,l.height)?h.arrange(k,g,l.width,l.height):h.arrange(k,g,l.width,l.height,new M(f.x,f.y,f.width,f.height))));M.free(f)};function Cm(){this.name="Base";this.name="Table"}la(Cm,Nl); Cm.prototype.measure=function(a,b,c,d,e,f,g){for(var h=d.length,k=Da(),l=Da(),m=0;m<h;m++){var n=d[m],p=n instanceof X?n:null;if(null=p||p.type!=X.TableRow&&p.type!X.TableColumn||!n.visible)k.push(n);else{l.push(p);for(var r=p.W.j,q=r.length,u=0;u<q;u++)}}h=k.length;0=h&&(a.getRowDefinition(0),a.getColumnDefinition(0));for(var w=[],y=0;y<h;y++){var z=k[y];mj(z,!0);kl(z,!0);w[z.row]||(w[z.row]= []);w[z.row][z.column]||(w[z.row][z.column]=[]);w[z.row][z.column].push(z)}Fa(k);var A=Da(),C=Da(),J=Da(),K=,L=,V=b,R=c,ea=a.pb;h=ea.length;for(var pa=0;pa<h;pa++){var N=ea[pa];void 0!N&&(N.actual=0)}ea=a.kb;h=ea.length;for(var Ga=0;Ga<h;Ga++)N=ea[Ga],void 0!N&&(N.actual=0);for(var Pa=w.length,hb=0,Ka=0;Ka<Pa;Ka++)w[Ka]&&(hb=Math.max(hb,w[Ka].length));var mb=Math.min(a.topIndex,Pa-1),yd=Math.min(a.leftIndex,hb-1),kb=0;Pa=w.length;for(var $b=vm(a),Ya=0;Ya<Pa;Ya++)if(w[Ya]){hb= w[Ya].length;for(var Nd=a.getRowDefinition(Ya),vc=Nd.actual=0;vc<hb;vc++)if(w[Ya][vc]){var Af=a.getColumnDefinition(vc);void 0=A[vc]&&(Af.actual=0,A[vc]=!0);for(var Ze=w[Ya][vc],Ee=Ze.length,jh=0;jh<Ee;jh++){var Cc=Ze[jh];if(Cc.visible||Cc$b){var Bf=1<Cc.rowSpan||1<Cc.columnSpan;Bf&&(Ya<mb||vc<yd||C.push(Cc));var $e=Cc.margin,Od=$e.right+$e.left,Qj=$e.top+$e.bottom;var Db=Cl(Cc,Nd,Af,!1);var Cf=Cc.desiredSize,zd=!isNaN(Cf.height),gc=!isNaN(Cf.width)&&zd;Bf||Db=Ag||gc||Ya<mb||vc<yd||(void 0! K[vc]||Db!wd&&Db!Vk||(K[vc]=-1,K.count++),void 0!L[Ya]||Db!wd&&Db!Wk||(L[Ya]=-1,L.count++),J.push(Cc));Cc.measure(Infinity,Infinity,0,0);if(!(Ya<mb||vc<yd))if(1=Cc.columnSpan&&(Db=Ag||Db=Wk))Bf&&Cc.im()}}}}}Fa(A);var Wb=0,Oc=0;h=a.columnCount;for(var ac=0;ac<h;ac++){var dg=a.kb[ac];void 0!dg&&(Wb+=dg.ha,0!dg.ha&&(Wb+=dg.tc()))}h=a.rowCount;for(var lh=0;lh<h;lh++){var bf=a.pb[lh];void 0!bf&&(Oc+=bf.ha,0!bf.ha&&(Oc+=bf.tc()))}V=Math.max(b-Wb,0);var qi=R=Math.max(c-Oc,0),he=V;h=J.length;for(var Fe=0;Fe<h;Fe++){var hc=J[Fe],Sj=a.getRowDefinition(hc.row), qn=a.getColumnDefinition(hc.column),eg=hc.measuredBounds,Pb=hc.margin,fg=Pb.right+Pb.left,Tj=Pb.top+Pb.bottom;K[hc.column]=0=qn.actual&&void 0!K[hc.column]?Math.max(eg.width+fg,K[hc.column]):null;L[hc.row]=0=Sj.actual&&void 0!L[hc.row]?Math.max(eg.height+Tj,L[hc.row]):null}var ri=0,gg=0,Df;for(Df in L)"count"!Df&&(ri+=L[Df]);for(Df in K)"count"!=Df&&(gg+=K[Df]);for(var ab=Kb.alloc(),hg=0;hg<h;hg++)var Pd=ic.margin,rn=Pd.right+Pd.left,mh=Pd.top+Pd.bottom;ic.im();ic.measure(ab.width,ab.height,bb.minimum,Dc.minimum);var nh=ic.measuredBounds,oh=Math.max(nh.width+rn,0),ph=Math.max(nh.height+mh,0);isFinite(V)&&(oh=Math.min(oh,ab.width));isFinite(R)&&(ph=Math.min(ph,ab.height));var ig=0;ig=Dc.actual;Dc.actual=Math.max(Dc.actual,ph);kb=Dc.actual-ig;R=Math.max(R-kb,0);ig=bb.actual;bb.actual=Math.max(bb.actual,oh); kb=bb.actual-ig;V=Math.max(V-kb,0)}}Fa(J);var Cd=Kb.alloc(),Wc=Da(),ie=Da();h=C.length;if(0!h)for(var qb=0;qb<Pa;qb++)if(w[qb])}for(var je=0;je<h;je++){var Ma=C[je];if(Ma.visible||Ma$b){var Dd=a.getRowDefinition(Ma.row),jc=a.getColumnDefinition(Ma.column);ab.h(Math.max(jc.minimum,Math.min(b,jc.maximum)),Math.max(Dd.minimum,Math.min(c,Dd.maximum))); Db=Cl(Ma,Dd,jc,!1);switch(Db){case wd:0!ie[jc.index]&&(ab.width=Math.min(ab.width,ie[jc.index]));0!Wc[Dd.index]&&(ab.height=Math.min(ab.height,Wc[Dd.index]));break;case Vk:0!ie[jc.index]&&(ab.width=Math.min(ab.width,ie[jc.index]));break;case Wk:0!Wc[Dd.index]&&(ab.height=Math.min(ab.height,Wc[Dd.index]))}isFinite(jc.width)&&(ab.width=jc.width);isFinite(Dd.height)&&(ab.height=Dd.height);Cd.h(0,0);for(var Ge=1;Ge<Ma.rowSpan&&!(Ma.row+Ge>=a.rowCount);Ge++)N=a.getRowDefinition(Ma.row+Ge),kb=0, kb=Db=wd||Db=Wk?Math.max(N.minimum,0=Wc[Ma.row+Ge]?N.maximum:Math.min(Wc[Ma.row+Ge],N.maximum)):Math.max(N.minimum,isNaN(N.Oc)?N.maximum:Math.min(N.Oc,N.maximum)),Cd.height+=kb;for(var Ef=1;Ef<Ma.columnSpan&&!(Ma.column+Ef>=a.columnCount);Ef++)N=a.getColumnDefinition(Ma.column+Ef),kb=0,kb=Db=wd||Db=Vk?Math.max(N.minimum,0=ie[Ma.column+Ef]?N.maximum:Math.min(ie[Ma.column+Ef],N.maximum)):Math.max(N.minimum,isNaN(N.Oc)?N.maximum:Math.min(N.Oc,N.maximum)),Cd.width+=kb;ab.width+=Cd.width;ab.height+= Cd.height;var cf=Ma.margin,Qd=cf.right+cf.left,He=cf.top+cf.bottom;Ma.measure(ab.width,ab.height,f,g);for(var df=Ma.measuredBounds,Ie=Math.max(df.width+Qd,0),Je=Math.max(df.height+He,0),md=0,jg=0;jg<Ma.rowSpan&&!(Ma.row+jg>=a.rowCount);jg++)N=a.getRowDefinition(Ma.row+jg),md+=N.total||0;if(md<Je){var ke=Je-md,tn=Je-md;if(null!Ma.spanAllocation)for(var un=Ma.spanAllocation,nd=0;nd<Ma.rowSpan&&!(0>=ke)&&!(Ma.row+nd>=a.rowCount);nd++){N=a.getRowDefinition(Ma.row+nd);var kg=N.ha||0,vn=un(Ma,N,tn);N.actual= Math.min(N.maximum,kg+vn);N.ha!kg&&(ke-=N.ha-kg)}for(;0<ke;)}for(var Uj=0,Vj=0;Vj<Ma.columnSpan&&!(Ma.column+Vj>=a.columnCount);Vj++)N=a.getColumnDefinition(Ma.column+Vj),Uj+=N.total||0;if(Uj<Ie){var ti=Ie-Uj,Kt=Ie-Uj;if(null!=Ma.spanAllocation)for(var Lt=Ma.spanAllocation,Wj=0;Wj<Ma.columnSpan&&!(0>=ti)&&!(Ma.column+Wj>=a.columnCount);Wj++)for(;0<ti;)}}}Fa(C);Kb.free(Cd);Kb.free(ab);void 0!Wc&&Fa(Wc);void 0!ie&&Fa(ie);var lg=0,mg=0,Yj=a.desiredSize,hr=a.maxSize;Db=jl(a,!0);var ui=Oc=Wb=0,vi=0;h=a.columnCount;for(var Zj=0;Zj<h;Zj++)void 0!a.kb[Zj]&& (N=a.getColumnDefinition(Zj),isFinite(N.width)?(ui+=N.width,ui+=N.tc()):Dm(N)Em?(ui+=N.ha,ui+=N.tc()):0!==N.ha&&(Wb+=N.ha,Wb+=N.tc()));isFinite(Yj.width)?lg=Math.min(Yj.width,hr.width):lg=Db!Ag&&isFinite(b)?b:Wb;lg=Math.max(lg,a.minSize.width);lg=Math.max(lg-ui,0);for(var Nt=0Wb?1:Math.max(lg/Wb,1),bk=0;bk<h;bk++)void 0!a.kb[bk]&&(N=a.getColumnDefinition(bk),isFinite(N.width)||Dm(N)Em||(N.actual=N.haNt),N.position=e.width,0!==N.ha&&(e.width+=N.ha,e.width+=N.tc()));h=a.rowCount;for(var ck= 0;ck<h;ck++)void 0!==a.pb[ck]&&(N=a.getRowDefinition(ck),isFinite(N.height)?(vi+=N.height,vi+=N.tc()):Dm(N)==Em?(vi+=N.ha,vi+=N.tc()):0!==N.ha&&(Oc+=N.ha,0!==N.ha&&(Oc+=N.tc())));isFinite(Yj.height)?mg=Math.min(Yj.height,hr.height):mg=Db!Ag&&isFinite(c)?c:Oc;mg=Math.max(mg,a.minSize.height);mg=Math.max(mg-vi,0);for(var Ot=0Oc?1:Math.max(mg/Oc,1),dk=0;dk<h;dk++)void 0!==a.pb[dk]&&(N=a.getRowDefinition(dk),isFinite(N.height)||Dm(N)===Em||(N.actual=N.haOt),N.position=e.height,0!==N.ha&&(e.height+= N.ha,0!==N.ha&&(e.height+=N.tc())));h=l.length;for(var xn=0;xn<h;xn++)Fa(l);a.ip=w}; Cm.prototype.arrange=function(a,b,c){var d=b.length,e=a.padding,f=e.left;e=e.top;for(var g=a.ip,h,k,l=g.length,m=0,n=0;n<l;n++)g[n]&&(m=Math.max(m,g[n].length));for(n=Math.min(a.topIndex,l-1);n!l&&(void 0a.pb[n]||0=a.pb[n].ha);)n++;n=Math.min(n,l-1);n=-a.pb[n].position;for(h=Math.min(a.leftIndex,m-1);h!m&&(void 0=a.kb[h]||0=a.kb[h].ha);)h++;h=Math.min(h,m-1);for(var p=-a.kb[h].position,r=Kb.alloc(),q=0;q<l;q++)if(g[q]){m=g[q].length;var u=a.getRowDefinition(q);k=u.position+n+e;0!u.ha&& (k+=u.Wu());for(var v=0;v<m;v++)if(g[q][v]){var w=a.getColumnDefinition(v);h=w.position+p+f;0!w.ha&&(h+=w.Wu());for(var y=g[q][v],z=y.length,A=0;A<z;A++){var C=y[A],J=C.measuredBounds,K=C instanceof X?C:null;if(null=K||K.type!X.TableRow&&K.type!X.TableColumn){r.h(0,0);for(var L=1;L<C.rowSpan&&!(q+L>=a.rowCount);L++)K=a.getRowDefinition(q+L),r.height+=K.total;for(L=1;L<C.columnSpan&&!(v+L>=a.columnCount);L++)K=a.getColumnDefinition(v+L),r.width+=K.total;var V=w.ha+r.width,R=u.ha+r.height;L= h;K=k;var ea=V,pa=R,N=h,Ga=k,Pa=V,hb=R;h+V>c.width&&(Pa=Math.max(c.width-h,0));k+R>c.height&&(hb=Math.max(c.height-k,0));var Ka=C.alignment;if(Ka.Mb()){Ka=a.defaultAlignment;Ka.eb()||(Ka=Bc);var mb=Ka.x;var yd=Ka.y;var kb=Ka.offsetX;Ka=Ka.offsetY;var $b=w.alignment,Ya=u.alignment;$b.eb()&&(mb=$b.x,kb=$b.offsetX);Ya.eb()&&(yd=Ya.y,Ka=Ya.offsetY)}else mb=Ka.x,yd=Ka.y,kb=Ka.offsetX,Ka=Ka.offsetY;if(isNaN(mb)||isNaN(yd))yd=mb=.5,Ka=kb=0;$b=J.width;Ya=J.height;var Nd=C.margin,vc=Nd.left+Nd.right,Af=Nd.top+ Nd.bottom,Ze=Cl(C,u,w,!1);!isNaN(C.desiredSize.width)||Ze!wd&&Ze!Vk||($b=Math.max(V-vc,0));!isNaN(C.desiredSize.height)||Ze!wd&&Ze!Wk||(Ya=Math.max(R-Af,0));V=C.maxSize;R=C.minSize;$b=Math.min(V.width,$b);Ya=Math.min(V.height,Ya);$b=Math.max(R.width,$b);Ya=Math.max(R.height,Ya);V=Ya+Af;L+=eamb-($b+vc)mb+kb+Nd.left;K+=payd-Vyd+Ka+Nd.top;C.visible&&(kc(N,Ga,Pa,hb,L,K,J.width,J.height)?C.arrange(L,K,$b,Ya):C.arrange(L,K,$b,Ya,new M(N,Ga,Pa,hb)))}else C.jl(),C.actualBounds.ea(),ea=C.actualBounds, L=M.allocAt(ea.x,ea.y,ea.width,ea.height),ea.x=K.type=X.TableRow?f:h,ea.y=K.type=X.TableColumn?e:k,ea.width=J.width,ea.height=J.height,C.actualBounds.freeze(),kl(C,!1),bc(L,ea)||(J=C.part,null!J&&(J.Eh(),C.Ho(J))),M.free(L)}}}Kb.free(r);for(a=0;a<d;a++)c=b[a],f=c instanceof X?c:null,null=f||f.type!X.TableRow&&f.type!X.TableColumn||(f=c.actualBounds,c.naturalBounds.ea(),c.naturalBounds.h(0,0,f.width,f.height),c.naturalBounds.freeze())}; function Fm(){this.name="Base";this.name="TableRow"}la(Fm,Nl);Fm.prototype.measure=function();Fm.prototype.arrange=function();function Gm(){this.name="Base";this.name="TableColumn"}la(Gm,Nl);Gm.prototype.measure=function();Gm.prototype.arrange=function();function Hm(){this.name="Base";this.name="Viewbox"}la(Hm,Nl); Hm.prototype.measure=function(a,b,c,d,e,f,g){1<d.length&&B("Viewbox Panel cannot contain more than one GraphObject.");d=d[0];d.ya=1;d.im();d.measure(Infinity,Infinity,f,g);var h=d.measuredBounds,k=d.margin,l=k.right+k.left;k=k.top+k.bottom;if(isFinite(b)||isFinite(c)){var m=d.scale,n=h.width;h=h.height;var p=Math.max(b-l,0),r=Math.max(c-k,0),q=1;a.viewboxStretch=Cg?0!n&&0!h&&(q=Math.min(p/n,r/h)):0!n&&0!h&&(q=Math.max(p/n,r/h));0=q&&(q=1E-4);d.ya*=q;m!d.scale&&(mj(d,!0),d.measure(Infinity, Infinity,f,g))}h=d.measuredBounds;e.width=isFinite(b)?b:Math.max(h.width+l,0);e.height=isFinite(c)?c:Math.max(h.height+k,0)};Hm.prototype.arrange=function(a,b,c);function Im(){this.name="Base";this.name="Grid"}la(Im,Nl); Im.prototype.measure=function();Im.prototype.arrange=function(); Im.prototype.tb=function(a,b,c)}}r=a.W.j;q=r.length;for(u=0;u<q;u++){var A=r[u]; if(A.visible&&(w=A.interval,!(2>ewc)))z=p[u];var C=!1,J=A.strokeDashArray;null!J&&(C=!0,b.Ts(J,A.strokeDashOffset));if("LineV"A.figure&&null!==A.stroke)b.stroke()}else if("LineH"A.figure&&null!==A.stroke){b.lineWidth=A.strokeWidth;ji(a,b, A.stroke,!1,!1,f,g);b.beginPath();for(J=A=Math.floor(-n.y/d);J<=A+m;J++)K=Jd+n.y,0<=K&&K<=k&&Jm(J,w,z)&&(b.moveTo(0,K),b.lineTo(h,K));b.stroke()}else if("BarV"===A.figure&&null!==A.fill)for(ji(a,b,A.fill,!0,!1,f,g),A=A.width,isNaN(A)&&(A=e),K=J=Math.floor(-n.x/e);K<=J+l;K++)else if("BarH"===A.figure&&null!==A.fill)for(ji(a,b,A.fill,!0,!1,f,g),A=A.height,isNaN(A)&&(A=d),K=J=Math.floor(-n.y/d);K<=J+m;K++)L=Kd+n.y,0<=L&&L<=k&&Jm(K,w,z)&&b.fillRect(0, L,h,A);C&&b.Rs();1!==v&&(b.globalAlpha=y)}}b.restore();b.Qc(!1)};function Jm(a,b,c){if(0!a%b)return!1;b=c.length;for(var d=0;d<b;d++)if(0a%c[d])return!1;return!0}function Km(){this.name="Base";this.name="Link"}la(Km,Nl); Km.prototype.measure=function(a,b,c,d,e){c=d.length;if(a instanceof De||a instanceof Q){var f=null,g=null,h=null;a instanceof Q&&(g=f=a);a instanceof De&&(h=a,f=h.adornedPart);if(f instanceof Q){var k=f;if(0c)Xb(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var l=a instanceof De?null:f.path,m=f.routeBounds;b=a.rg;b.h(0,0,m.width,m.height);var n=k.points;f=f.pointsCount;null!h?h.ik(!1):null!g&&g.ik(!1);var p=m.width,r=m.height;a.location.h(m.x,m.y);a.l.length=0;null!l&&(Lm(a,p,r,l), h=l.measuredBounds,b.Hc(h),a.l.push(h));h=sd.alloc();for(var q=H.alloc(),u=H.alloc(),v=0;v<c;v++){var w=d[v];if(w!l)if(w.isPanelMain&&w instanceof W){Lm(a,p,r,w);var y=w.measuredBounds;b.Hc(y);a.l.push(y)}else if(2>f)w.measure(Infinity,Infinity,0,0),y=w.measuredBounds,b.Hc(y),a.l.push(y);else{var z=w.segmentIndex;y=w.segmentFraction;var A=w.alignmentFocus;A.jc()&&(A=Bc);var C=w.segmentOrientation,J=w.segmentOffset;if(z<-f||z>=f){y=k.midPoint;var K=k.midAngle;if(C!pg){var L=k.computeAngle(w,C, K);w.cc=L}L=y.x-m.x;var V=y.y-m.y}elseelse L=f+z,V=n.L(L),R=0<L?n.L(L-1):V;if(V.Ma(R)){0<=z?(K=0<z?n.L(z-1):V,L=z<f-2?n.L(z+2):R):(K=L<f-1?n.L(L+1):V,L=1<L?n.L(L-2):R);var ea=K.we(V),pa=R.we(L);K=ea>pa+10?0<=z?K.Sa(V):V.Sa(K):pa>ea+10?0<=z?R.Sa(L):L.Sa(R):0<=z?K.Sa(L):L.Sa(K)}else K=0<=z?V.Sa(R):R.Sa(V);C!pg&&(L=k.computeAngle(w,C,K),w.cc=L);L=V.x+(R.x-V.x)*y-m.x;V=V.y+(R.y-V.y)*y-m.y}w.measure(Infinity,Infinity,0,0);y=w.measuredBounds;R=w.naturalBounds; var N=0;w instanceof W&&(N=w.strokeWidth);ea=R.width+N;pa=R.height+N;h.reset();h.translate(-y.x,-y.y);h.scale(w.scale,w.scale);h.rotate(C=pg?w.angle:K,ea/2,pa/2);C!Mm&&C!Nm||h.rotate(90,ea/2,pa/2);C!Om&&C!Pm||h.rotate(-90,ea/2,pa/2);C=Qm&&(45<K&&135>K||225<K&&315>K)&&h.rotate(-K,ea/2,pa/2);R=new M(0,0,ea,pa);q.Zi(R,A);h.ra(q);A=-q.x+N/2w.scale;w=-q.y+N/2w.scale;u.assign(J);N=isNaN(J.x);var Ga=isNaN(J.y);if(N||Ga){ea=ea/2+3;pa=pa/2+3;var Pa=45<=K&&135>=K,hb=225<=K&&315>=K;C=pg&&(Pa|| hb)?(u.x=Ga?ea:J.y,u.y=N?pa:J.x,Pa?0<=z||!N||(u.y=-pa):hb&&(0<=z&&N&&(u.y=-pa),Ga&&(u.x=-ea))):(N&&(u.x=0<=z?ea:-ea),Ga&&(u.y=-pa),u.rotate(K))}else u.rotate(K);L+=u.x;V+=u.y;R.set(y);R.h(L+A,V+w,y.width,y.height);a.l.push(R);b.Hc(R)}}if(null!g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.rg=b;a=a.location;a.h(a.x+b.x,a.y+b.y);Xb(e,b.width||0,b.height||0);sd.free(h);H.free(q);H.free(u)}}}}; Km.prototype.arrange=function(a,b){var c=b.length;if(a instanceof De||a instanceof Q){var d=null,e=null,f=null;a instanceof Q&&(e=d=a);a instanceof De&&(f=a,d=f.adornedPart);var g=a instanceof De?null:d.path;if(0!a.l.length)for(l=0;l<c;l++)}}b=d.points;c=b.count;if(2<=c&&a instanceof Q)for(d= a.labelNodes;d.next();)else{var v=0;0<=h?(u=b.j[h],q=h<c-1?b.j[h+1]:u):(v=c+h,u=b.j[v],q=0<v?b.j[v-1]:u);if(u.Ma(q)){0<=h?(m=0<h?b.j[h-1]:u,v=h<c-2?b.j[h+2]:q):(m=v<c-1?b.j[v+1]:u,v=1<v?b.j[v-2]:q);var w=m.we(u),y=q.we(v);m=w>y+10?0<=h?m.Sa(u):u.Sa(m):y>w+10?0<=h?q.Sa(v):v.Sa(q): 0<=h?m.Sa(v):v.Sa(m)}else m=0<=h?u.Sa(q):q.Sa(u);r!pg&&(n=n.computeAngle(g,r,m),g.angle=n);n=u.x+(q.x-u.x)p;u=u.y+(q.y-u.y)p}l.it()?g.location=new H(n,u):(l.jc()&&(l=Bc),q=sd.alloc(),q.reset(),q.scale(g.scale,g.scale),q.rotate(g.angle,0,0),p=g.naturalBounds,p=M.allocAt(0,0,p.width,p.height),r=H.alloc(),r.Zi(p,l),q.ra(r),l=-r.x,v=-r.y,k=k.copy(),isNaN(k.x)&&(0<=h?k.x=r.x+3:k.x=-(r.x+3)),isNaN(k.y)&&(k.y=-(r.y+3)),k.rotate(m),n+=k.x,u+=k.y,q.bw(p),l+=p.x,v+=p.y,h=H.allocAt(n+l,u+v),g.move(h),H.free(h), H.free(r),M.free(p),sd.free(q))}null!==f?f.ik(!1):null!e&&e.ik(!1)}};function Lm(a,b,c,d){if(!1!rj(d)){var e=d.strokeWidth;0=e&&a instanceof De&&a.type=X.Link&&a.adornedObject instanceof W&&(e=a.adornedObject.strokeWidth);e=d.ya;a instanceof Q&&null!==a.oa?(a=a.oa.bounds,gl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof De&&null!==a.adornedPart.oa?(a=a.adornedPart.oa.bounds,gl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):gl(d,-(e/2),-(e/2),b+e,c+e);mj(d,!1)}} function Rm(){this.name="Base";this.name="Graduated"}la(Rm,Nl); Rm.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Ab();a.Wg=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new M(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.Wg.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,v=r.flattenedLengths,w=r.flattenedTotalLength,y=u.length,z=0,A=0,C=Da(),J=0;J<y;J++){var K=u[J],L=[];A=z=0;for(var V=K.length,R=0;R<V;R+=2){var ea=K[R],pa=K[R+1];if(0!==R){var N=180Math.atan2(pa- A,ea-z)/Math.PI;0>N&&(N+=360);L.push(N)}z=ea;A=pa}C.push(L)}if(null=a.Xg){for(var Ga=[],Pa=a.W.j,hb=Pa.length,Ka=0;Ka<hb;Ka++){var mb=Pa[Ka],yd=[];Ga.push(yd);if(mb.visible)for(var kb=mb.interval,$b=0;$b<hb;$b++){var Ya=Pa[$b];if(Ya.visible&&mb!Ya&&!(mb instanceof W&&!(Ya instanceof W)||mb instanceof Xg&&!(Ya instanceof Xg)))}}a.Xg=Ga}var vc=a.Xg;var Af=a.W.j,Ze=Af.length,Ee=0,jh=0,Cc=w;a.mj=[];for(var Bf,$e=0;$e<Ze;$e++){var Od=Af[$e];Bf=[];if(Od.visible&& Od!h)else Vc>a.graduatedMin+af&&(Vc-=Math.floor((Vc-a.graduatedMin)/af)*af);for(var kh=vc[$e];Vc<=a.graduatedMax;){a:{for(var pn=kh.length,cg=0;cg<pn;cg++)if(I.Z((Vc-a.graduatedTickBase)%(kh[cg]*a.graduatedTickUnit), 0))Rj=!0}if(Rj&&(null=Od.graduatedSkip||!Od.graduatedSkip(Vc))&&(Ee=(Vc-a.graduatedMin)w/a.graduatedRange,Ee>w&&(Ee=w),jh<=Ee&&Ee<=Cc)){for(var Wb=C[zd][gc],Oc=v[zd][gc];zd<v.length;){for(;Ee>Cf&&gc<v[zd].length-1;)gc++,Wb=C[zd][gc],Oc=v[zd][gc],Cf+=Oc;if(Ee<=Cf)break;zd++;gc=0;Wb=C[zd][gc];Oc=v[zd][gc];Cf+=Oc}var ac=u[zd],dg=ac[2gc],lh=ac[2gc+1],bf=(Ee-(Cf-Oc))/Oc,qi=new H(dg+(ac[2gc+2]-dg)bf+q/2-r.bounds.x,lh+(ac[2gc+3]-lh)bf+q/2-r.bounds.y);qi.scale(h.scale,h.scale); var he=Wb,Fe=C[zd];1E-4>bf?0<gc?he=Fe[gc-1]:I.Z(ac[0],ac[ac.length-2])&&I.Z(ac[1],ac[ac.length-1])&&(he=Fe[Fe.length-1]):.9999<bf&&(gc+1<Fe.length?he=Fe[gc+1]:I.Z(ac[0],ac[ac.length-2])&&I.Z(ac[1],ac[ac.length-1])&&(he=Fe[0]));Wb!he&&(180<Math.abs(Wb-he)&&(Wb<he?Wb+=360:he+=360),Wb=(Wb+he)/2%360);if(Od instanceof Xg){var hc=;null!==Od.graduatedFunction?(hc=Od.graduatedFunction(Vc),hc=null!==hc&&void 0!==hc?hc.toString():):hc=(+Vc.toFixed(2)).toString();!==hc&&Bf.push({rm:qi,angle:Wb,text:hc})}else Bf.push({rm:qi, angle:Wb})}Vc+=af}}}a.mj.push(Bf)}Fa(C);var Sj=a.mj;if(null!==Sj)for(var qn=d.length,eg=0;eg<qn;eg++){var Pb=d[eg],fg=Sj[eg];if(Pb.visible&&Pb!h&&0!fg.length){if(Pb instanceof W){var Tj=a,ri=e,gg=Pb.alignmentFocus;gg.jc()&&(gg=yc);var Df=Pb.angle;Pb.cc=0;Pb.measure(Infinity,Infinity,0,0);Pb.cc=Df;var ab=Pb.measuredBounds,hg=ab.width,ic=ab.height,Dc=M.allocAt(0,0,hg,ic),bb=H.alloc();bb.Zi(Dc,gg);M.free(Dc);for(var Ad=-bb.x,Bd=-bb.y,Pd=new M,rn=fg.length,mh=0;mh<rn;mh++)for(var nh=fg[mh],oh=nh.rm.x, ph=nh.rm.y,ig=nh.angle,Cd=0;4>Cd;Cd++){switch(Cd){case 0:bb.h(Ad,Bd);break;case 1:bb.h(Ad+hg,Bd);break;case 2:bb.h(Ad,Bd+ic);break;case 3:bb.h(Ad+hg,Bd+ic)}bb.rotate(ig+Pb.angle);bb.offset(oh,ph);0=mh&&0=Cd?Pd.h(bb.x,bb.y,0,0):Pd.Ce(bb);bb.offset(-oh,-ph);bb.rotate(-ig-Pb.angle)}H.free(bb);null!Tj.Wg&&Tj.Wg.push(Pd);fc(ri,Pd.x,Pd.y,Pd.width,Pd.height)}else if(Pb instanceof Xg){var Wc=a,ie=e;null=Wc.rh&&(Wc.rh=new Xg);var qb=Wc.rh;Sm(qb,Pb);var si=Pb.alignmentFocus;si.jc()&&(si=yc);for(var ld= Pb.segmentOrientation,sn=Pb.segmentOffset,je=new M,Ma=0,Dd=0,jc=0,Ge=0,Ef=fg.length,cf=0;cf<Ef;cf++){var Qd=fg[cf];Ma=Qd.rm.x;Dd=Qd.rm.y;jc=Qd.angle;ld!==pg&&(Ge=Q.computeAngle(ld,jc),qb.cc=Ge);qb.text=Qd.text||;qb.measure(Infinity,Infinity,0,0);var He=qb.measuredBounds,df=qb.naturalBounds,Ie=df.width,Je=df.height,md=sd.alloc();md.reset();md.translate(-He.x,-He.y);md.scale(qb.scale,qb.scale);md.rotate(ld=pg?qb.angle:jc,Ie/2,Je/2);ld!==Mm&&ld!==Nm||md.rotate(90,Ie/2,Je/2);ld!Om&&ld!Pm||md.rotate(-90, Ie/2,Je/2);ld=Qm&&(45<jc&&135>jc||225<jc&&315>jc)&&md.rotate(-jc,Ie/2,Je/2);var jg=M.allocAt(0,0,Ie,Je),ke=H.alloc();ke.Zi(jg,si);md.ra(ke);var tn=-ke.x,un=-ke.y,nd=H.alloc();nd.assign(sn);isNaN(nd.x)&&(nd.x=Ie/2+3);isNaN(nd.y)&&(nd.y=-(Je/2+3));nd.rotate(jc);Ma+=nd.x+tn;Dd+=nd.y+un;var kg=new M(Ma,Dd,He.width,He.height),vn=new M(He.x,He.y,He.width,He.height),qh=new M(df.x,df.y,df.width,df.height);Qd.Oz=Ge;Qd.lineCount=qb.lineCount;Qd.lines=[qb.nb,qb.mi,qb.ee,qb.qe,qb.Ob,qb.fb,qb.ce];Qd.actualBounds= kg;Qd.measuredBounds=vn;Qd.naturalBounds=qh;0=cf?je.assign(kg):je.Hc(kg);H.free(nd);H.free(ke);M.free(jg);sd.free(md)}null!==Wc.Wg&&Wc.Wg.push(je);fc(ie,je.x,je.y,je.width,je.height)}mj(Pb,!1)}}}; Rm.prototype.arrange=function(a,b,c){if(null!==a.Wg)a.Wg=null}}}; Rm.prototype.tb=function(a,b,c){var d=c.qj;c.qj=!0;var e=a.naturalBounds,f=e.width;e=e.height;b.save();b.beginPath();b.rect(-1,-1,f+1,e+1);b.clip();f=a.Ab();f.tb(b,c);e=a.qf()c.scale;0>=e&&(e=1);for(var g=f.actualBounds,h=a.W.j,k=a.mj,l=h.length,m=0;m<l;m++){var n=h[m],p=k[m],r=p.length;if(n.visible&&n!==f&&0!==p.length)if(n instanceof W){if(!(2>a.graduatedTickUnitn.intervalf.geometry.flattenedTotalLength/a.graduatedRangee)){var q=n.measuredBounds,u=n.strokeWidthn.scale,v=n.alignmentFocus;v.jc()&& (v=yc);for(var w=0;w<r;w++)}}else if(n instanceof Xg)for(null=a.rh&&(a.rh=new Xg),q=a.rh,Sm(q,n),n=0;n<r;n++)u=p[n],u.actualBounds&&u.measuredBounds&&u.naturalBounds&&(q.Rb=u.text||"",q.cc=u.Oz||0,q.Mc=u.lineCount||0,v=u.lines,void 0! v&&(q.nb=v[0],q.mi=v[1],q.ee=v[2],q.qe=v[3],q.Ob=v[4],q.fb=v[5],q.ce=v[6]),u.naturalBounds&&(q.pc=u.naturalBounds),u.actualBounds&&(v=u.actualBounds,q.arrange(v.x,v.y,v.width,v.height)),v=u.actualBounds,q.arrange(v.x,v.y,v.width,v.height),w=u.measuredBounds,u=u.naturalBounds,y=q.rb,y.reset(),y.translate(v.x+g.x,v.y+g.y),y.translate(-w.x,-w.y),hl(q,y,u.x,u.y,u.width,u.height),zl(q,!1),q.Kh.set(q.rb),q.Tk=q.scale,Al(q,!1),q.tb(b,c))}c.qj=d;b.restore();b.Qc(!0)}; function X(a){Y.call(this);this.qa=void 0=a?X.Position:a;null=this.qa&&B("Panel type not specified or PanelLayout not loaded: "+a);this.W=new E;this.bb=tc;this.qa=X.Grid&&(this.isAtomic=!0);this.pn=$c;this.Mf=Uk;this.qa=X.Table&&Tm(this);this.Op=Cg;this.Ln=Qb;this.Mn=Fb;this.In=0;this.Hn=100;this.Kn=10;this.Jn=0;this.Xh=this.hb=this.Xg=this.Wg=this.mj=null;this.Zn=NaN;this.he=this.li=null;this.ml="category";this.Hd=null;this.rg=new M(NaN,NaN,NaN,NaN);this.rh=this.ip=this.Bi=null;this.Gg=""} la(X,Y);function Tm(a) X.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.qa=this.qa;a.bb=this.bb.G();a.pn=this.pn.G();a.Mf=this.Mf;if(a.qa=X.Table){a.hj=this.hj.G();a.Pg=this.Pg;a.ci=this.ci;a.bi=this.bi;a.Og=this.Og;a.Ng=this.Ng;a.ai=this.ai;var b=[];if(0<this.pb.length)for(var c=this.pb,d=c.length,e=0;e<d;e++)if(void 0!c[e])a.pb=b;b=[];if(0<this.kb.length)for(c=this.kb,d=c.length,e=0;e<d;e++)void 0!c[e]&&(f=c[e].copy(),f.Yi(a),b[e]=f);a.kb=b;a.Hj= this.Hj;a.fj=this.fj;a.Ei=this.Ei;a.oi=this.oi}a.Op=this.Op;a.Ln=this.Ln.G();a.Mn=this.Mn.G();a.In=this.In;a.Hn=this.Hn;a.Kn=this.Kn;a.Jn=this.Jn;a.mj=this.mj;a.Xg=this.Xg;a.hb=this.hb;a.Xh=this.Xh;a.Zn=this.Zn;a.li=this.li;a.he=this.he;a.ml=this.ml;a.rg.assign(this.rg);a.Gg=this.Gg;null!this.ip&&(a.ip=this.ip)};X.prototype.pf=function(a){Y.prototype.pf.call(this,a);a.W=this.W;for(var b=a.W.j,c=b.length,d=0;d<c;d++)b[d].jg=a;a.Bi=null}; X.prototype.copy=function(){var a=Y.prototype.copy.call(this);if(null!a){for(var b=this.W.j,c=b.length,d=0;d<c;d++){var e=b[d].copy();e.Yi(a);e.Dj=null;var f=a.W,g=f.count;f.Kb(g,e);f=a.part;if(null!f){f.zj=null;null!e.portId&&f instanceof U&&(f.Dh=!0);var h=a.diagram;null!h&&h.undoManager.isUndoingRedoing||f.Ya(te,"elements",a,null,e,null,g)}}return a}return null};t=X.prototype;t.toString=function(){return"Panel("+this.type+")#"+lb(this)}; t.Ho=function(a){Y.prototype.Ho.call(this,a);for(var b=this.W.j,c=b.length,d=0;d<c;d++)b[d].Ho(a)}; t.Ki=function(a,b){if(this.qa=X.Grid)this.qa.tb(this,a,b);else if(this.qa=X.Graduated)this.qa.tb(this,a,b);elsec&&(a.restore(),a.Qc(!0))}}; function Wm(a,b,c,d){for(var e=d.length,f=a.actualBounds,g=a.naturalBounds,h=!0,k=0;k<e;k++){var l=d[k];if(void 0!l)if(h)h=!1;else if(0!l.actual){if(c){if(l.position>f.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.Pg:a.Og);var n=l.separatorStroke;null=n&&(n=c?a.ci:a.Ng);if(0!m&&null!n){ji(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null=p&&(p=c?a.bi:a.ai);null!p&&(n=!0,b.Ts(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.bb;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.Rs()}}}} function Vm(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=0;k<f;k++){var l=d[k];if(void 0!l&&null!l.background&&l.coversSeparators!e&&0!l.actual){var m=c?g.height:g.width;if(!(l.position>m)){var n=l.tc(),p=l.separatorStrokeWidth;isNaN(p)&&(p=c?a.Pg:a.Og);var r=l.separatorStroke;null=r&&(r=c?a.ci:a.Ng);null=r&&(p=0);n-=p;p=l.position+p;n+=l.actual;p+n>m&&(n=m-p);0>=n||(m=a.bb,ji(a,b,l.background,!0,!1,h,g),c?b.fillRect(m.left,p+m.top,g.width-(m.left+m.right),n):b.fillRect(p+ m.left,m.top,n,g.height-(m.top+m.bottom)))}}}}function hk(a){return"LineV"a||"BarV"a} t.ck=function(a,b,c,d,e){var f=this.Yd(),g=this.transform,h=1/(g.m11g.m22-g.m12g.m21),k=g.m22h,l=-g.m12h,m=-g.m21h,n=g.m11h,p=h*(g.m21g.dy-g.m22g.dx),r=h*(g.m12g.dx-g.m11g.dy);if(null!==this.areaBackground)return g=this.actualBounds,I.Sc(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(null!==this.background)return f=ak+bm+p,h=al+bn+r,a=ck+dm+p,k=cl+dn+r,e.h(0,0),c=this.naturalBounds,f=I.Sc(0,0,c.width,c.height,f,h,a,k,e),e.transform(g),f;f||(k=1,m=l=0,n=1,r=p=0);h=ak+bm+p;a=al+b n+r;k=ck+dm+p;c=cl+dn+r;e.h(k,c);d=(k-h)(k-h)+(c-a)(c-a);l=!1;n=this.W.j;r=n.length;m=H.alloc();p=null;b=Infinity;var q=null;this.isClipping&&(q=H.alloc(),p=this.Ab(),(l=p.ck(h,a,k,c,q))&&(b=(h-q.x)(h-q.x)+(a-q.y)(a-q.y)));for(var u=0;u<r;u++)this.isClipping&&(b>d&&e.set(q),H.free(q));H.free(m);f&&e.transform(g);return l}; t.o=function(a){if(!0!rj(this)){Y.prototype.o.call(this,a);a=null;if(this.qaX.Auto||this.qaX.Link)a=this.Ab();for(var b=this.W.j,c=b.length,d=0;d<c;d++){var e=b[d];(e=a||e.isPanelMain)&&e.o(!0);if(!e.desiredSize.v()){var f=jl(e,!1);(e instanceof yg||e instanceof X||e instanceof Xg||f!Ag)&&e.o(!0)}}}};t.im=function(){if(!1=rj(this)){mj(this,!0);kl(this,!0);for(var a=this.W.j,b=a.length,c=0;c<b;c++)a[c].im()}}; t.jl=function(){if(0!(this.F&2048)=!1){zl(this,!0);Al(this,!0);for(var a=this.W.j,b=a.length,c=0;c<b;c++)a[c].rv()}};t.rv=function(){Al(this,!0);for(var a=this.W.j,b=a.length,c=0;c<b;c++)a[c].rv()}; t.mm=function(a,b,c,d){var e=this.rg;e.h(0,0,0,0);var f=this.desiredSize,g=this.minSize;void 0=c&&(c=g.width,d=g.height);c=Math.max(c,g.width);d=Math.max(d,g.height);var h=this.maxSize;isNaN(f.width)||(a=Math.min(f.width,h.width));isNaN(f.height)||(b=Math.min(f.height,h.height));a=Math.max(c,a);b=Math.max(d,b);var k=this.bb;a=Math.max(a-k.left-k.right,0);b=Math.max(b-k.top-k.bottom,0);var l=this.W.j;0!l.length&&this.qa.measure(this,a,b,l,e,c,d);a=e.width+k.left+k.right;k=e.height+k.top+k.bottom; isFinite(f.width)&&(a=f.width);isFinite(f.height)&&(k=f.height);a=Math.min(h.width,a);k=Math.min(h.height,k);a=Math.max(g.width,a);k=Math.max(g.height,k);a=Math.max(c,a);k=Math.max(d,k);Xb(e,a,k);Xb(this.naturalBounds,a,k);gl(this,0,0,a,k)};t.Ab=function(){if(null=this.Bi){var a=this.W.j,b=a.length;if(0=b)return null;for(var c=0;c<b;c++)this.Bi=a[0]}return this.Bi};function vm(a){return null!a.part?a.part.locationObject:null} t.Ah=function(a,b,c,d){var e=this.W.j;this.actualBounds.h(a,b,c,d);if(0!e.length){if(!this.desiredSize.v()){a=jl(this,!0);var f=this.measuredBounds;b=f.width;f=f.height;var g=this.bh,h=g.left+g.right;g=g.top+g.bottom;b=c&&f=d&&(a=Ag);switch(a){case Ag:if(b>c||f>d)this.o(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case wd:this.o(!0);this.measure(c+h,d+g,0,0);break;case Vk:this.o(!0);this.measure(c+h,f+g,0,0);break;case Wk:this.o(!0),this.measure(b+h,d+g,0,0)}}this.qa.arrange(this,e,this.rg)}}; t.Ch=function(a){var b=this.naturalBounds,c=vm(this);if(kc(0,0,b.width,b.height,a.x,a.y)){b=this.W.j;for(var d=b.length,e=H.allocAt(0,0);d--;){var f=b[d];if(f.visible||f=c)if(zb(e.set(a),f.transform),f.$(e))return H.free(e),!0}H.free(e);return null=this.gb&&null=this.dc?!1:!0}return!1};t.Us=function(a){if(this.Ek=a)return this;for(var b=this.W.j,c=b.length,d=0;d<c;d++)return null}; t.Em=function(a,b){b(this,a);if(a instanceof X)};function Ej(a,b){Xm(a,a,b)}function Xm(a,b,c){c(b);b=b.W.j;for(var d=b.length,e=0;e<d;e++){var f=b[e];f instanceof X&&Xm(a,f,c)}}function Ym(a,b){Zm(a,a,b)}function Zm(a,b,c){c(b);if(b instanceof X)}t.cm=function(a){return $m(this,this,a)}; function $m(a,b,c){if(c(b))return b;if(b instanceof X)}return null}t.Xa=function(a){if(this.name=a)return this;var b=this.W.j,c=b.length;null=this.li&&null=this.he||(c=an(this));for(var d=0;d<c;d++){var e=b[d];if(e instanceof X)if(e.name=a)return e}return null}; function bn(a){a=a.W.j;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof X)c=Math.max(c,bn(e));else if(e instanceof W){a:{switch(e.Vk){case "None":case "Square":case "Ellipse":case "Circle":case "LineH":case "LineV":case "FramedRectangle":case "RoundedRectangle":case "Line1":case "Line2":case "Border":case "Cube1":case "Cube2":case "Junction":case "Cylinder1":case "Cylinder2":case "Cylinder3":case "Cylinder4":case "PlusLine":case "XLine":case "ThinCross":case "ThickCross":e=0;break a}e= e.ph/2e.Jje.qf()}c=Math.max(c,e)}}return c}t.Yd=function(){return!(this.type=X.TableRow||this.type=X.TableColumn)}; t.Sb=function(a,b,c){if(!1=this.pickable)return null;void 0=b&&(b=null);void 0=c&&(c=null);if(sj(this))return null;var d=this.naturalBounds,e=1/this.qf(),f=this.Yd(),g=f?a:zb(H.allocAt(a.x,a.y),this.transform),h=this.diagram,k=10,l=5;null!h&&(k=h.gm("extraTouchArea"),l=k/2);if(kc(-(le),-(le),d.width+ke,d.height+ke,g.x,g.y)){if(!this.isAtomic){e=this.W.j;var m=e.length;h=H.alloc();l=(k=this.isClipping)?this.Ab():null;if(k&&(l.Yd()?zb(h.set(a),l.transform):h.set(a),!l.$(h)))return H.free(h), f||H.free(g),null;for(var n=vm(this);m--;){var p=e[m];if(p.visible||p=n)if(p.Yd()?zb(h.set(a),p.transform):h.set(a),!k||p!l){var r=null;p instanceof X?r=p.Sb(h,b,c):!0=p.pickable&&p.$(h)&&(r=p);if(null!r&&(null!b&&(r=b(r)),null!r&&(null=c||c(r))))return H.free(h),f||H.free(g),r}}H.free(h)}if(null=this.background&&null=this.areaBackground)return f||H.free(g),null;a=kc(0,0,d.width,d.height,g.x,g.y)?this:null;f||H.free(g);return a}f||H.free(g);return null}; t.Ni=function(a,b,c,d){if(!1=this.pickable)return!1;void 0=b&&(b=null);void 0=c&&(c=null);var e=this.naturalBounds,f=this.Yd(),g=f?a:zb(H.allocAt(a.x,a.y),this.transform);e=kc(0,0,e.width,e.height,g.x,g.y);if(this.type=X.TableRow||this.type=X.TableColumn||e){if(!this.isAtomic){for(var h=this.W.j,k=h.length,l=H.alloc(),m=vm(this);k--;){var n=h[k];if(n.visible||n=m){n.Yd()?zb(l.set(a),n.transform):l.set(a);var p=n;n=n instanceof X?n:null;(null!n?n.Ni(l,b,c,d):p.$(l))&&!1!p.pickable&& (null!b&&(p=b(p)),null=p||null!c&&!c(p)||d.add(p))}}H.free(l)}f||H.free(g);return e&&(null!this.background||null!this.areaBackground)}f||H.free(g);return!1}; t.wg=function(a,b,c,d,e,f){if(!1=this.pickable)return!1;void 0=b&&(b=null);void 0=c&&(c=null);var g=f;void 0=f&&(g=sd.alloc(),g.reset());g.multiply(this.transform);if(this.Bh(a,g))return cn(this,b,c,e),void 0=f&&sd.free(g),!0;if(this.Gc(a,g)){if(!this.isAtomic)for(var h=vm(this),k=this.W.j,l=k.length;l--;){var m=k[l];if(m.visible||m=h){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof X?m:null;p=sd.alloc();p.set(g); if(null!m?m.wg(a,b,c,d,e,p):il(n,a,d,p))null!b&&(n=b(n)),null=n||null!c&&!c(n)||e.add(n);sd.free(p)}}}void 0=f&&sd.free(g);return d}void 0=f&&sd.free(g);return!1};function cn(a,b,c,d){for(var e=a.W.j,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof X&&cn(g,b,c,d),null!b&&(g=b(g)),null=g||null!c&&!c(g)||d.add(g))}}} t.xg=function(a,b,c,d,e,f){if(!1=this.pickable)return!1;void 0=c&&(c=null);void 0=d&&(d=null);var g=this.naturalBounds,h=this.Yd(),k=h?a:zb(H.allocAt(a.x,a.y),this.transform),l=h?b:zb(H.allocAt(b.x,b.y),this.transform),m=k.we(l),n=0<k.x&&k.x<g.width&&0<k.y&&k.y<g.height||Ab(k.x,k.y,0,0,0,g.height)<=m||Ab(k.x,k.y,0,g.height,g.width,g.height)<=m||Ab(k.x,k.y,g.width,g.height,g.width,0)<=m||Ab(k.x,k.y,g.width,0,0,0)<=m;g=k.ed(0,0)<=m&&k.ed(0,g.height)<=m&&k.ed(g.width,0)<=m&&k.ed(g.width,g.height)<= m;h||(H.free(k),H.free(l));if(n){if(!this.isAtomic){k=H.alloc();l=H.alloc();m=vm(this);for(var p=this.W.j,r=p.length;r--;){var q=p[r];if(q.visible||q=m){var u=q.actualBounds,v=this.naturalBounds;if(!h||!(u.x>v.width||u.y>v.height||0>u.x+u.width||0>u.y+u.height))if(q.Yd()?(u=q.transform,zb(k.set(a),u),zb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof X?q:null,null!=q?q.xg(k,l,c,d,e,f):u.zx(k,l,e))null!c&&(u=c(u)),null=u||null!d&&!d(u)||f.add(u)}}H.free(k);H.free(l)}return e?n:g}return!1}; function Am(a){var b=null;a instanceof W&&(b=a.spot1,b$c&&(b=null),a=a.geometry,null!a&&null=b&&(b=a.spot1));null=b&&(b=xc);return b}function Bm(a){var b=null;a instanceof W&&(b=a.spot2,b$c&&(b=null),a=a.geometry,null!a&&null=b&&(b=a.spot2));null=b&&(b=Hc);return b}t.add=function(a){this.Kb(this.W.count,a)};t.L=function(a){return this.W.L(a)}; t.Kb=function(a,b){b instanceof T&&B("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this=b||this.Ag(b))this=b&&B("Cannot make a Panel contain itself: "+this.toString()),B("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.panel;null!c&&c!this&&B("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+this.toString()); this.qa!X.Grid||b instanceof W||B("Can only add Shapes to a Grid Panel, not: "+b);this.qa!X.Graduated||b instanceof W||b instanceof Xg||B("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Yi(this);b.Dj=null;if(null!this.itemArray){var d=b.data;null!d&&"object"=typeof d&&(null=this.Hd&&(this.Hd=new G),this.Hd.add(d,b))}var e=this.W;d=-1;if(c=this){for(var f=-1,g=this.W.j,h=g.length,k=0;k<h;k++)if(g[k]b)if(-1!f){if(fa||f+1>=e.count&&a>=e.count)return; e.jb(f);d=f}else B("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Kb(a,b);if(0=a||b.isPanelMain)this.Bi=null;rj(this)||this.o();b.o(!1);null!b.portId?this.Dh=!0:b instanceof X&&!0=b.Dh&&(this.Dh=!0);this.Xg=null;c=this.part;null!c&&(c.zj=null,c.dh=NaN,this.Dh&&c instanceof U&&(c.Dh=!0),c.Dh&&c instanceof U&&(c.rc=null),e=this.diagram,null!e&&e.undoManager.isUndoingRedoing||(-1!d&&c.Ya(ue,"elements",this,b,null,d,null),c.Ya(te, "elements",this,null,b,null,a),this.Bg()||dn(this,b,!1)))};function en(a,b)t.remove=function(a){for(var b=this.W.j,c=b.length,d=-1,e=0;e<c;e++)if(b[e]a)-1!==d&&this.Fc(d,!0)};t.jb=function(a){0<=a&&this.Fc(a,!0)}; t.Fc=function(a,b){var c=this.W,d=c.L(a);d.Dj=null;d.Yi(null);if(null!==this.Hd){var e=d.data;"object"=typeof e&&this.Hd.remove(e)}c.jb(a);mj(this,!1);this.o();this.Bid&&(this.Bi=null);this.Xg=null;var f=this.part;null!f&&(f.zj=null,f.dh=NaN,f.Lb(),f instanceof U&&(d instanceof X?d.Em(d,function(a,c){Rl(f,c,b)}):Rl(f,d,b)),c=this.diagram,null!c&&c.undoManager.isUndoingRedoing||f.Ya(ue,"elements",this,d,null,a,null))}; X.prototype.getRowDefinition=function(a){0>a&&va(a,">= 0",X,"getRowDefinition:idx");a=Math.round(a);var b=this.pb;if(void 0=b)return null;if(void 0=b[a]){var c=new fk;c.Yi(this);c.isRow=!0;c.index=a;b[a]=c}return b[a]};X.prototype.Jv=function(a){0>a&&va(a,">= 0",X,"removeRowDefinition:idx");a=Math.round(a);var b=this.pb;void 0!b&&(this.Ya(ue,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.o())}; X.prototype.getColumnDefinition=function(a){0>a&&va(a,">= 0",X,"getColumnDefinition:idx");a=Math.round(a);var b=this.kb;if(void 0=b)return null;if(void 0=b[a]){var c=new fk;c.Yi(this);c.isRow=!1;c.index=a;b[a]=c}return b[a]};t=X.prototype;t.Hv=function(a){0>a&&va(a,">= 0",X,"removeColumnDefinition:idx");a=Math.round(a);var b=this.kb;void 0!=b&&(this.Ya(ue,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.o())}; t.ez=function(a){if(0>a||this.type!X.Table)return-1;for(var b=0,c=this.pb,d=c.length,e=this.Ei;e<d;e++){var f=c[e];if(void 0!f&&(b+=f.total,a<b))break}return e};t.Xy=function(a){if(0>a||this.type!X.Table)return-1;for(var b=0,c=this.kb,d=c.length,e=this.oi;e<d;e++){var f=c[e];if(void 0!f&&(b+=f.total,a<b))break}return e}; t.zz=function(a,b){void 0=b&&(b=new H(NaN,NaN));if(this.type!X.Graduated)return b.h(NaN,NaN),b;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var c=this.Ab();c.geometry.lv((a-this.graduatedMin)/this.graduatedRange,b);return c.transform.ra(b)};t.Az=function(a){if(this.type!X.Graduated)return NaN;var b=this.Ab();b.transform.Td(a);return b.geometry.Cx(a)this.graduatedRange+this.graduatedMin};function Hl(a){a=a.Xh;return null!a&&a.s} function zg(a){var b=a.Xh;if(null=b)null!a.data&&B("Template cannot have .data be non-null: "+a),a.Xh=b=new E;else if(b.s)return;var c=new E;en(a,!1);a.Em(a,function(a,d){var e=d.$a;if(null!e)for(El(d,!1),e=e.iterator;e.next();){var f=e.value;f.mode=fn&&El(d,!0);var g=f.sourceName;null!g&&("/"g&&en(a,!0),g=fl(f,a,d),null!g&&(c.add(g),nullg.Kl&&(g.Kl=new E),g.Kl.add(f)));b.add(f)}if(d instanceof X&&d.type=X.Table){if(0<d.pb.length)for(a=d.pb,e=a.length,f=0;f<e;f++)if(g=a[f],void 0! g&&null!g.$a)for(var h=g.$a.iterator;h.next();)if(0<d.kb.length)for(d=d.kb,a=d.length,e=0;e<a;e++)if(f=d[e],void 0!f&&null!f.$a)for(g=f.$a.iterator;g.next();)h=g.value,h.bd=f,h.Fp=1,h.Rl=f.index,b.add(h)}});for(var d=c.iterator;d.next();){var e=d.value;if(null!e.Kl){El(e,!0);for(var f=e.Kl.iterator;f.next();){var g=f.value;null=e.$a&&(e.$a=new E);e.$a.add(g)}}e.Kl=null}for(d=b.iterator;d.next();)if(e=d.value,f=e.bd,null!f){e.bd=null;var h= e.targetProperty,k=h.indexOf(".");0<k&&f instanceof X&&(g=h.substring(0,k),h=h.substr(k+1),k=f.Xa(g),null!k?(f=k,e.targetProperty=h):wa(‘Warning: unable to find GraphObject named "‘+g+‘" for Binding: ‘+e.toString()));f instanceof fk?(g=lb(f.panel),e.bj=void 0=g?-1:g,f.panel.Ek=e.bj):f instanceof Y?(g=lb(f),e.bj=void 0=g?-1:g,f.Ek=e.bj):B("Unknown type of binding target: "+f)}b.freeze();a instanceof T&&a.Ub()&&a.zb()} t.Ly=function(){var a=this.copy();Ym(a,function(a){a instanceof X&&(a.Xh=null,a.hb=null);var b=a.$a;null!b&&(a.$a=null,b.each(function(b){a.bind(b.copy())}));b=a.Hg;null!b&&(a.Hg=null,b.each(function(b){Il(a,b.value.copy())}))});return a}; t.Aa=function(a){var b=this.Xh;if(null!b)for(void 0=a&&(a=""),b=b.iterator;b.next();)if(null!d)else null!=c.bd&&(f=c.bd);"/"=e?d=f.part:"." e?d=f:".."e&&(d=f.panel);e=c.Fp;if(0!e){if(!(f instanceof X))continue;1e?f=f.getColumnDefinition(c.Rl):2=e&&(f=f.getRowDefinition(c.Rl))}void 0!f&&c.ew(f,d)}}}};function gn(a,b){a=a.W.j;for(var c=a.length,d=b.length,e=0,f=null;e<c&&!(f=a[e],f instanceof X&&null!f.data);)e++,f=a[e];if(c-e!d)return!0;if(null=f)return 0<d;for(var g=0;e<c&&g<d;){f=a[e];if(!(f instanceof X)||f.data!b[g])return!0;e++;g++}return!1} function an(a){if(a.type=X.Spot||a.type=X.Auto)return Math.min(a.W.length,1);if(a.type=X.Link){a=a.W;for(var b=a.length,c=0;c<b;c++){var d=a.L(c);if(!(d instanceof W&&d.isPanelMain))break}return c}return a.type=X.Table&&0<a.W.length&&(a=a.W.L(0),a.isPanelMain&&a instanceof X&&(a.type=X.TableRow||a.type=X.TableColumn))?1:0}t.st=function(){for(var a=an(this);this.W.length>a;)this.Fc(this.W.length-1,!1);a=this.itemArray;if(null!a)for(var b=a.length,c=0;c<b;c++)hn(this,a[c],c)}; t.yx=function(a){return void 0=a||null=a||null=this.Hd?null:this.Hd.H(a)}; function hn(a,b,c){if(!(void 0=b||null=b||0>c)){var d=jn(a,b),e=a.itemTemplateMap,f=null;null!e&&(f=e.H(d));null=f&&(kn||(kn=!0,wa(‘No item template Panel found for category "‘+d+‘" on ‘+a),wa(" Using default item template."),d=new X,e=new Xg,e.bind(new Ji("text",,Ia)),d.add(e),ln=d),f=ln);d=f;null!d&&(zg(d),d=d.copy(),0!(d.F&16777216)&&(e=a.Oi(),null!e&&en(e,!0)),"object"=typeof b&&(null=a.Hd&&(a.Hd=new G),a.Hd.add(b,d)),e=c+an(a),a.Kb(e,d),d.hb=b,mn(a,e,c),d.hb=null,d.data= b)}}function mn(a,b,c){for(a=a.W;b<a.length;){var d=a.L(b);if(d instanceof X)b++;c++}}function jn(a,b){if(null=b)return;a=a.ml;if("function"==typeof a)a=a(b);else if("string"==typeof a&&"object"=typeof b){if(===a)return;a=nn(b,a)}else return"";if(void 0a)return"";if("string"typeof a)return a;B("Panel.getCategoryForItemData found a non-string category for "+b+": "+a);return""} function dn(a,b,c){var d=b.enabledChanged;null!d&&d(b,c);if(b instanceof X){b=b.W.j;d=b.length;for(var e=0;e<d;e++){var f=b[e];c&&f instanceof X&&!f.isEnabled||dn(a,f,c)}}}function on(a,b){Ml.add(a,b)} ma.Object.defineProperties(X.prototype,{type:{get:function(),set:function(a)},elements:{get:function()},naturalBounds:{get:function()},padding:{get:function(),set:function(a){"number" typeof a?(0>a&&va(a,">= 0",X,"padding"),a=new pc(a)):(0>a.left&&va(a.left,">= 0",X,"padding:value.left"),0>a.right&&va(a.right,">= 0",X,"padding:value.right"),0>a.top&&va(a.top,">= 0",X,"padding:value.top"),0>a.bottom&&va(a.bottom,">= 0",X,"padding:value.bottom"));var b=this.bb;b.A(a)||(this.bb=a=a.G(),this.o(),this.g("padding",b,a))}},defaultAlignment:{get:function(),set:function(a){var b=this.pn;b.A(a)||(this.pn=a=a.G(),this.o(),this.g("defaultAlignment", b,a))}},defaultStretch:{get:function(),set:function(a)},defaultSeparatorPadding:{get:function(){return void 0this.hj?tc:this.hj},set:function(a){if(void 0!=this.hj){"number"=typeof a&&(a=new pc(a));var b=this.hj;b.A(a)||(this.hj=a=a.G(),this.o(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{get:function(){return void 0 this.ci?null:this.ci},set:function(a){var b=this.ci;b!a&&(null=a||"string"=typeof a||a instanceof sl)&&(a instanceof sl&&a.freeze(),this.ci=a,this.N(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return void 0=this.Pg?1:this.Pg},set:function(a){if(void 0!this.Pg)}},defaultRowSeparatorDashArray:{ get:function(){return void 0=this.bi?null:this.bi},set:function(a){if(void 0!=this.bi){var b=this.bi;if(b!a){if(null!a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"=typeof f&&0<=f&&isFinite(f)||B("defaultRowSeparatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0=d){if(null=b)return;a=null}}this.bi=a;this.N();this.g("defaultRowSeparatorDashArray",b,a)}}}},defaultColumnSeparatorStroke:{get:function(){return void 0 this.Ng?null:this.Ng},set:function(a){if(void 0!==this.Ng){var b=this.Ng;b!a&&(null=a||"string"=typeof a||a instanceof sl)&&(a instanceof sl&&a.freeze(),this.Ng=a,this.N(),this.g("defaultColumnSeparatorStroke",b,a))}}},defaultColumnSeparatorStrokeWidth:{get:function(){return void 0=this.Og?1:this.Og},set:function(a){if(void 0!this.Og)}},defaultColumnSeparatorDashArray:{ get:function(){return void 0=this.ai?null:this.ai},set:function(a){if(void 0!==this.ai){var b=this.ai;if(b!==a){if(null!a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"=typeof f&&0<=f&&isFinite(f)||B("defaultColumnSeparatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0=d){if(null=b)return;a=null}}this.ai=a;this.N();this.g("defaultColumnSeparatorDashArray",b,a)}}}},viewboxStretch:{get:function(), set:function(a)},gridCellSize:{get:function(),set:function(a){var b=this.Ln;if(!b.A(a)){a.v()&&0!==a.width&&0!a.height||B("Invalid Panel.gridCellSize: "+a);this.Ln=a.G();var c=this.diagram;null!c&&this=c.grid&&nj(c);this.N();this.g("gridCellSize",b,a)}}},gridOrigin:{get:function(),set:function(a){var b=this.Mn;if(!b.A(a)){a.v()|| B("Invalid Panel.gridOrigin: "+a);this.Mn=a.G();var c=this.diagram;null!c&&this=c.grid&&nj(c);this.N();this.g("gridOrigin",b,a)}}},graduatedMin:{get:function(),set:function(a)},graduatedMax:{get:function(),set:function(a){var b=this.Hn;b!a&&(this.Hn=a,this.o(),this.g("graduatedMax", b,a),dl(this)&&(a=this.part,null!a&&el(this,a,"graduatedRange")))}},graduatedRange:{get:function()},graduatedTickUnit:{get:function(),set:function(a)},graduatedTickBase:{get:function(),set:function(a){var b=this.Jn;b!a&&(this.Jn=a,this.o(),this.g("graduatedTickBase", b,a))}},Dh:{get:function(){return 0!(this.F&8388608)},set:function(a){0!(this.F&8388608)!a&&(this.F^=8388608)}},rowCount:{get:function(){return void 0=this.pb?0:this.pb.length}},columnCount:{get:function(){return void 0=this.kb?0:this.kb.length}},rowSizing:{get:function(){return void 0=this.Hj?Um:this.Hj},set:function(a){if(void 0!==this.Hj){var b=this.Hj;b!a&&(this.Hj= a,this.o(),this.g("rowSizing",b,a))}}},columnSizing:{get:function(){return void 0=this.fj?Um:this.fj},set:function(a){if(void 0!this.fj)}},topIndex:{get:function(){return void 0=this.Ei?0:this.Ei},set:function(a){if(void 0!==this.Ei){var b=this.Ei;b!a&&((!isFinite(a)||0>a)&&B("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Ei=a,this.o(), this.g("topIndex",b,a))}}},leftIndex:{get:function(){return void 0=this.oi?0:this.oi},set:function(a){if(void 0!==this.oi){var b=this.oi;b!==a&&((!isFinite(a)||0>a)&&B("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.oi=a,this.o(),this.g("leftIndex",b,a))}}},data:{get:function(),set:function(a){var b=this.hb;if(b!==a){var c=this instanceof T&&!(this instanceof De);zg(this);this.hb=a;var d=this.diagram; null!==d&&(c?(c=d.partManager,this instanceof Q?(null!==b&&c.Ie.remove(b),null!==a&&c.Ie.add(a,this)):this instanceof T&&(null!==b&&c.Je.remove(b),null!==a&&c.Je.add(a,this))):(c=this.panel,null!c&&null!c.Hd&&(null!b&&c.Hd.remove(b),null!a&&c.Hd.add(a,this))));this.g("data",b,a);null!d&&d.undoManager.isUndoingRedoing||null!a&&this.Aa()}}},itemIndex:{get:function(),set:function(a)},itemArray:{ get:function(),set:function(a)}},itemTemplate:{get:function(),set:function(a){if(null=this.he){if(null=a)return;this.he=new G}var b=this.he.H(); b!==a&&((a instanceof T||a.isPanelMain)&&B("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.he.add(,a),this.g("itemTemplate",b,a),a=this.diagram,null!a&&a.undoManager.isUndoingRedoing||this.st())}},itemTemplateMap:{get:function(),set:function(a)}},itemCategoryProperty:{ get:function(),set:function(a)},isAtomic:{get:function(){return 0!(this.F&1048576)},set:function(a)},isClipping:{get:function(){return 0!(this.F&2097152)},set:function(a)},isOpposite:{ get:function(){return 0!(this.F&33554432)},set:function(a)},isEnabled:{get:function(){return 0!(this.F&4194304)},set:function(a)}},alignmentFocusName:{ get:function(),set:function(a)}}); ma.Object.defineProperties(X,{Position:{get:function(){return Ml.H("Position")}},Horizontal:{get:function(){return Ml.H("Horizontal")}},Vertical:{get:function(){return Ml.H("Vertical")}},Spot:{get:function(){return Ml.H("Spot")}},Auto:{get:function(){return Ml.H("Auto")}},Table:{get:function(){return Ml.H("Table")}},Viewbox:{ get:function(){return Ml.H("Viewbox")}},TableRow:{get:function(){return Ml.H("TableRow")}},TableColumn:{get:function(){return Ml.H("TableColumn")}},Link:{get:function(){return Ml.H("Link")}},Grid:{get:function(){return Ml.H("Grid")}},Graduated:{get:function(){return Ml.H("Graduated")}}});X.prototype.findItemPanelForData=X.prototype.yx; X.prototype.rebuildItemElements=X.prototype.st;X.prototype.updateTargetBindings=X.prototype.Aa;X.prototype.copyTemplate=X.prototype.Ly;X.prototype.graduatedValueForPoint=X.prototype.Az;X.prototype.graduatedPointForValue=X.prototype.zz;X.prototype.findColumnForLocalX=X.prototype.Xy;X.prototype.findRowForLocalY=X.prototype.ez;X.prototype.removeColumnDefinition=X.prototype.Hv;X.prototype.removeRowDefinition=X.prototype.Jv;X.prototype.removeAt=X.prototype.jb;X.prototype.remove=X.prototype.remove; X.prototype.insertAt=X.prototype.Kb;X.prototype.elt=X.prototype.L;X.prototype.add=X.prototype.add;X.prototype.findObject=X.prototype.Xa;X.prototype.findInVisualTree=X.prototype.cm;X.prototype.walkVisualTreeFrom=X.prototype.Em;X.prototype.findMainElement=X.prototype.Ab;var kn=!1,ln=null,Ml=new G;X.className="Panel";X.definePanelLayout=on;on("Position",new um);on("Vertical",new xm);on("Auto",new zm);on("Link",new Km); function fk(){Za(this);this.jg=null;this.Ir=!0;this.Oa=0;this.Oc=NaN;this.fh=0;this.eh=Infinity;this.wb=$c;this.la=this.ha=0;this.$a=null;this.xp=An;this.se=Uk;this.qp=this.ng=null;this.rp=NaN;this.gb=this.Ij=null;this.ln=!1} fk.prototype.copy=function(){var a=new fk;a.Ir=this.Ir;a.Oa=this.Oa;a.Oc=this.Oc;a.fh=this.fh;a.eh=this.eh;a.wb=this.wb;a.ha=this.ha;a.la=this.la;a.se=this.se;a.xp=this.xp;null=this.ng?a.ng=null:a.ng=this.ng.G();a.qp=this.qp;a.rp=this.rp;a.Ij=null;null!this.Ij&&(a.separatorDashArray=Aa(this.separatorDashArray));a.gb=this.gb;a.ln=this.ln;a.$a=this.$a;return a};t=fk.prototype; t.Qs=function(a){a.isRow?this.height=a.height:this.width=a.width;this.minimum=a.minimum;this.maximum=a.maximum;this.alignment=a.alignment;this.stretch=a.stretch;this.sizing=a.sizing;this.ng=null=a.separatorPadding?null:a.separatorPadding.G();this.separatorStroke=a.separatorStroke;this.separatorStrokeWidth=a.separatorStrokeWidth;this.Ij=null;a.separatorDashArray&&(this.Ij=Aa(a.separatorDashArray));this.background=a.background;this.coversSeparators=a.coversSeparators;this.$a=a.$a}; t.cb=function(a);t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+lb(this)};t.Yi=function(a); t.Wu=function(){var a=0,b=0,c=this.jg,d=this.isRow;if(null!c&&c.type=X.Table)for(var e=d?c.pb.length:c.kb.length,f=0;f<e;f++){var g=d?c.pb[f]:c.kb[f];if(void 0!==g)}this.index!b&&(b=this.separatorStroke,null=b&&null!==c&&(b=this.isRow?c.defaultRowSeparatorStroke:c.defaultColumnSeparatorStroke),null!==b&&(a=this.separatorStrokeWidth,isNaN(a)&&(null!c?a=this.isRow?c.defaultRowSeparatorStrokeWidth:c.defaultColumnSeparatorStrokeWidth:a=0)));b=this.ng;if(null=b)if(null!==c)b= c.defaultSeparatorPadding;else return a;return a+(this.isRow?b.top:b.left)}; t.tc=function(){var a=0,b=this.jg,c=0,d=this.isRow;if(null!b&&b.type=X.Table)for(var e=d?b.pb.length:b.kb.length,f=0;f<e;f++){var g=d?b.pb[f]:b.kb[f];if(void 0!==g)}this.index!c&&(c=this.separatorStroke,null=c&&null!==b&&(c=d?b.defaultRowSeparatorStroke:b.defaultColumnSeparatorStroke),null!==c&&(a=this.separatorStrokeWidth,isNaN(a)&&(null!b?a=d?b.defaultRowSeparatorStrokeWidth:b.defaultColumnSeparatorStrokeWidth:a=0)));d=this.ng;if(null=d)if(null!==b)d=b.defaultSeparatorPadding; else return a;return a+(this.isRow?d.top+d.bottom:d.left+d.right)};t.yb=function(a,b,c){var d=this.jg;if(null!==d&&(d.Ya(re,a,this,b,c,void 0,void 0),null!==this.$a&&(b=d.diagram,null!==b&&!b.skipsModelSourceBindings&&(d=d.Oi(),null!==d&&(b=d.data,null!b)))))for(c=this.$a.iterator;c.next();)c.value.Fq(this,b,a,d)};function Dm(a){if(a.sizing=An){var b=a.jg;return a.isRow?b.rowSizing:b.columnSizing}return a.sizing} t.bind=function(a){a.bd=this;var b=this.panel;if(null!==b){var c=b.Oi();null!c&&Hl(c)&&B("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a+" on "+b)}null=this.$a&&(this.$a=new E);this.$a.add(a)}; ma.Object.defineProperties(fk.prototype,{panel:{get:function()},isRow:{get:function(),set:function(a)},index:{get:function(),set:function(a)},height:{get:function(),set:function(a){var b=this.Oc;b!==a&&(0>a&&va(a,">= 0",fk,"height"),this.Oc=a,this.actual=this.ha,null!==this.panel&&this.panel.o(), this.yb("height",b,a))}},width:{get:function(),set:function(a){var b=this.Oc;b!==a&&(0>a&&va(a,">= 0",fk,"width"),this.Oc=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.yb("width",b,a))}},minimum:{get:function(),set:function(a){var b=this.fh;b!==a&&((0>a||!isFinite(a))&&va(a,">= 0",fk,"minimum"),this.fh=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.yb("minimum",b,a))}},maximum:{ get:function(),set:function(a){var b=this.eh;b!==a&&(0>a&&va(a,">= 0",fk,"maximum"),this.eh=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.yb("maximum",b,a))}},alignment:{get:function(),set:function(a)},stretch:{get:function(),set:function(a){var b=this.se;b!==a&&(this.se= a,null!==this.panel&&this.panel.o(),this.yb("stretch",b,a))}},separatorPadding:{get:function(),set:function(a){"number"typeof a&&(a=new pc(a));var b=this.ng;null!==a&&null!==b&&b.A(a)||(null!==a&&(a=a.G()),this.ng=a,null!==this.panel&&this.panel.o(),this.yb("separatorPadding",b,a))}},separatorStroke:{get:function(),set:function(a){var b=this.qp;b!==a&&(null!==a&&Ql(a,"RowColumnDefinition.separatorStroke"), a instanceof sl&&a.freeze(),this.qp=a,null!this.panel&&this.panel.o(),this.yb("separatorStroke",b,a))}},separatorStrokeWidth:{get:function(),set:function(a)},separatorDashArray:{get:function(),set:function(a){var b=this.Ij;if(b!=a){if(null!a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number" typeof f&&0<=f&&isFinite(f)||B("separatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0d){if(null=b)return;a=null}}this.Ij=a;null!==this.panel&&this.panel.N();this.yb("separatorDashArray",b,a)}}},background:{get:function(),set:function(a){var b=this.gb;b!==a&&(null!==a&&Ql(a,"RowColumnDefinition.background"),a instanceof sl&&a.freeze(),this.gb=a,null!==this.panel&&this.panel.N(),this.yb("background",b,a))}},coversSeparators:{ get:function(),set:function(a)},sizing:{get:function(),set:function(a)},actual:{get:function(),set:function(a){this.ha=isNaN(this.Oc)?Math.max(Math.min(this.eh,a),this.fh):Math.max(Math.min(this.eh, this.Oc),this.fh)}},total:{get:function(){return this.ha+this.tc()},set:function(a)},position:{get:function(),set:function(a)}});fk.prototype.bind=fk.prototype.bind;fk.prototype.computeEffectiveSpacing=fk.prototype.tc;fk.prototype.computeEffectiveSpacingTop=fk.prototype.Wu; var An=new D(fk,"Default",0),Em=new D(fk,"None",1),Um=new D(fk,"ProportionalExtra",2);fk.className="RowColumnDefinition";fk.Default=An;fk.None=Em;fk.ProportionalExtra=Um;function W(){Y.call(this);this.Pd=this.oa=null;this.Vk="None";this.Gn=Uk;this.Dc=this.Wk="black";this.ph=1;this.Ml="butt";this.Nl="miter";this.Jj=10;this.nh=null;this.oh=0;this.ef=this.df=$c;this.Po=this.Oo=NaN;this.Rn=!1;this.Ro=null;this.Yk=this.Ul="None";this.Fd=1;this.Ed=0;this.Cd=1;this.Dd=null}la(W,Y); W.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.oa=this.oa;a.Vk=this.Vk;a.Gn=this.Gn;a.Pd=this.Pd;a.Wk=this.Wk;a.Dc=this.Dc;a.ph=this.ph;a.Ml=this.Ml;a.Nl=this.Nl;a.Jj=this.Jj;null!==this.nh&&(a.nh=Aa(this.nh));a.oh=this.oh;a.df=this.df.G();a.ef=this.ef.G();a.Oo=this.Oo;a.Po=this.Po;a.Rn=this.Rn;a.Ro=this.Ro;a.Ul=this.Ul;a.Yk=this.Yk;a.Fd=this.Fd;a.Ed=this.Ed;a.Cd=this.Cd;a.Dd=this.Dd};t=W.prototype; t.cb=function(a);t.toString=function(){return"Shape("+("None"!==this.figure?this.figure:"None"!this.toArrow?this.toArrow:this.fromArrow)+")#"+lb(this)}; function Bn(a,b,c,d){var e=c.length;if(!(4>e)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,v=Da(),w=2;w<e;w+=2)l=c[w],m=c[w+1],n=l-h,h=m-k,0=n&&(n=.001),p=h/n,r=Math.atan2(h,n),q=Math.sqrt(nn+h*h),v.push([n,r,p,q]),u+=q,h=l,k=m;h=c[0];k=c[1];n=d.measuredBounds.width;d instanceof W&&(n-=d.strokeWidth);1>n&&(n=1);e=c=n;l=g/2;m=0=l?!1:!0;w=0;q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];for(var y=0;.1<=u;){0=y&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0=e&&(e=1));if(e> u){Fa(v);return}e>q?(y=e-q,e=q):y=0;var z=Math.sqrt(ee/(1+pp));0>n&&(z=-z);h+=z;k+=p*z;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0=y&&d.Ki(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!y){w++;if(w=v.length){Fa(v);return}q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];e=y}}Fa(v)}} t.Ki=function(a,b){var c=this.Dc,d=this.Wk;if(null!c||null!d){var e=this.actualBounds,f=this.naturalBounds;null!d&&ji(this,a,d,!0,!1,f,e);var g=this.part,h=this.ph;null!c&&0=h&&null!g&&(h=g.type=X.Link&&g instanceof De&&"Selection"g.category&&g.adornedObject instanceof W&&g.adornedPart.Ab()==g.adornedObject?g.adornedObject.strokeWidth:0);null!==c&&0!h&&(ji(this,a,c,!1,!1,f,e),a.lineWidth=h,a.lineJoin=this.Nl,a.lineCap=this.Ml,a.miterLimit=this.Jj);e=!1;g&&b.xe("drawShadows")&& (e=g.isShadowed);g=!0;nullc||null!==d&&"transparent"!==d||(g=!1);f=!1;var k=this.strokeDashArray;null!==k&&(f=!0,a.Ts(k,this.oh));var l=this.oa;if(null!l){if(l.typexd)a.beginPath(),a.moveTo(l.startX,l.startY),a.lineTo(l.endX,l.endY),null!d&&a.Sd(d),0!h&&null!c&&a.aj();else if(l.type=Hd){var m=l.startX;k=l.startY;var n=l.endX,p=l.endY;l=Math.min(m,n);var r=Math.min(k,p);m=Math.abs(n-m);k=Math.abs(p-k);a.beginPath();a.rect(l,r,m,k);null!d&&a.Sd(d);if(null!=c){g&&e&&rl(a);if(0!h){if(0 m||0=k)a.beginPath(),a.rect(l,r,Math.max(m,.1),Math.max(k,.1));a.aj()}g&&e&&ql(a)}}else if(l.type=Id)m=l.startX,k=l.startY,n=l.endX,p=l.endY,l=Math.abs(n-m)/2,r=Math.abs(p-k)/2,m=Math.min(m,n)+l,k=Math.min(k,p)+r,a.beginPath(),a.moveTo(m,k-r),a.bezierCurveTo(m+I.Fgl,k-r,m+l,k-I.Fgr,m+l,k),a.bezierCurveTo(m+l,k+I.Fgr,m+I.Fgl,k+r,m,k+r),a.bezierCurveTo(m-I.Fgl,k+r,m-l,k+I.Fgr,m-l,k),a.bezierCurveTo(m-l,k-I.Fgr,m-I.Fgl,k-r,m,k-r),a.closePath(),null!d&&a.Sd(d),0!h&&null!c&&(g&&e?(rl(a), a.aj(),ql(a)):a.aj());else if(l.type=vd)for(k=l.figures,l=k.length,r=0;r<l;r++){m=k.j[r];a.beginPath();a.moveTo(m.startX,m.startY);n=m.segments.j;p=n.length;for(var q=null,u=0;u<p;u++){var v=n[u];switch(v.type){case Xd:a.moveTo(v.endX,v.endY);break;case Fd:a.lineTo(v.endX,v.endY);break;case Yd:a.bezierCurveTo(v.point1X,v.point1Y,v.point2X,v.point2Y,v.endX,v.endY);break;case Zd:a.quadraticCurveTo(v.point1X,v.point1Y,v.endX,v.endY);break;case $d:if(v.radiusX=v.radiusY){var w=Math.PI/180;a.arc(v.point1X, v.point1Y,v.radiusX,v.startAngle*w,(v.startAngle+v.sweepAngle)*w,0>v.sweepAngle,null!=q?q.endX:m.startX,null!q?q.endY:m.startY)}else if(q=be(v,m),w=q.length,0=w)a.lineTo(v.centerX,v.centerY);else for(var y=0;y<w;y++)break;case ae:y=w=0;if(null!q&&q.type$d)q=q[z-1]||null;null!q&&(w=q[6],y=q[7])}else w=null!q?q.endX:m.startX,y=null! q?q.endY:m.startY;q=ce(v,m,w,y);w=q.length;if(0=w){a.lineTo(v.centerX,v.centerY);break}for(y=0;y<w;y++)z=q[y],a.bezierCurveTo(z[2],z[3],z[4],z[5],z[6],z[7]);break;default:B("Segment not of valid type: "+v.type)}v.isClosed&&a.closePath();q=v}e?m.isShadowed?(!0=m.isFilled&&"transparent"!d&&null!d&&a.Sd(d),0!h&&null!c&&(g&&rl(a),a.aj(),g&&ql(a))):(g&&rl(a),!0=m.isFilled&&"transparent"!d&&null!d&&a.Sd(d),0!h&&null!c&&a.aj(),g&&ql(a)):(!0=m.isFilled&&null!d&&a.Sd(d),0!h&&null! c&&a.aj())}f&&a.Rs();if(null!this.pathPattern){c=this.pathPattern;c.measure(Infinity,Infinity);d=c.measuredBounds;c.arrange(0,0,d.width,d.height);h=this.geometry;a.save();a.beginPath();d=Da();if(h.type=xd)d.push(h.startX),d.push(h.startY),d.push(h.endX),d.push(h.endY),Bn(a,b,d,c);else if(h.type=vd)for(h=h.figures.iterator;h.next();){e=h.value;d.length=0;d.push(e.startX);d.push(e.startY);g=e.startX;f=e.startY;k=g;l=f;r=e.segments.j;m=r.length;for(n=0;n<m;n++){p=r[n];switch(p.type){case Xd:Bn(a, b,d,c);d.length=0;d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;k=g;l=f;break;case Fd:d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;break;case Yd:I.ve(g,f,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,.5,d);g=p.endX;f=p.endY;break;case Zd:I.rq(g,f,p.point1X,p.point1Y,p.endX,p.endY,.5,d);g=p.endX;f=p.endY;break;case $d:u=be(p,e);v=u.length;if(0=v){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(q=0;q<v;q++)w=u[q],I.ve(g,f,w[2],w[3],w[4],w[5],w[6],w[7],.5,d),g=w[6], f=w[7];break;case ae:u=ce(p,e,g,f);v=u.length;if(0=v){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(q=0;q<v;q++)w=u[q],I.ve(g,f,w[2],w[3],w[4],w[5],w[6],w[7],.5,d),g=w[6],f=w[7];break;default:B("Segment not of valid type: "+p.type)}p.isClosed&&(d.push(k),d.push(l),Bn(a,b,d,c))}Bn(a,b,d,c)}else if(h.type=Hd)d.push(h.startX),d.push(h.startY),d.push(h.endX),d.push(h.startY),d.push(h.endX),d.push(h.endY),d.push(h.startX),d.push(h.endY),d.push(h.startX),d.push(h.startY),Bn(a, b,d,c);else if(h.type=Id){f=new ge;f.startX=h.endX;f.startY=(h.startY+h.endY)/2;g=new le($d);g.startAngle=0;g.sweepAngle=360;g.centerX=(h.startX+h.endX)/2;g.centerY=(h.startY+h.endY)/2;g.radiusX=Math.abs(h.startX-h.endX)/2;g.radiusY=Math.abs(h.startY-h.endY)/2;f.add(g);h=be(g,f);e=h.length;if(0=e)d.push(g.centerX),d.push(g.centerY);else for(g=f.startX,f=f.startY,k=0;k<e;k++)l=h[k],I.ve(g,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d),g=l[6],f=l[7];Bn(a,b,d,c)}Fa(d);a.restore();a.Qc(!1)}}}}; t.ga=function(a,b){void 0=b&&(b=new H);if(a instanceof O){a.jc()&&B("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.naturalBounds,d=this.strokeWidth;b.h(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.sd.ra(b);return b}; t.cq=function(a){void 0=a&&(a=new M);var b=this.naturalBounds,c=this.sd;b=M.allocAt(b.x,b.y,b.width,b.height);var d=this.strokeWidth;b.Tc(d/2,d/2);d=H.allocAt(b.x,b.y).transform(c);a.h(d.x,d.y,0,0);d.h(b.right,b.y).transform(c);fc(a,d.x,d.y,0,0);d.h(b.right,b.bottom).transform(c);fc(a,d.x,d.y,0,0);d.h(b.x,b.bottom).transform(c);fc(a,d.x,d.y,0,0);M.free(b);H.free(d);return a}; t.Ch=function(a,b){var c=this.geometry;if(null=c||null=this.fill&&null=this.stroke)return!1;var d=c.bounds,e=this.strokeWidth/2;c.type!xd||b||(e+=2);var f=M.alloc();f.assign(d);f.Tc(e+2,e+2);if(!f.$(a))return M.free(f),!1;d=e+1E-4;if(c.type=xd){if(null=this.stroke)return!1;d=(c.endX-c.startX)(a.x-c.startX)+(c.endY-c.startY)(a.y-c.startY);if(0>(c.startX-c.endX)(a.x-c.endX)+(c.startY-c.endY)(a.y-c.endY)||0>d)return!1;M.free(f);return I.Wb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type Hd){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.Tc(-d,-d);if(f.((a))return M.free(f),!1;f.Tc(d,d)}null!==this.stroke&&f.Tc(e,e);a=f.)(a);M.free(f);return a}if(c.type=Id){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>=cc/(gg)+bb/(ee))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>=cc/(gg)+bb/(ee)}if(c.type=vd)return M.free(f),null=this.fill?ee(c,a.x,a.y,e):c.$(a,e,1<this.strokeWidth,b);B("Unknown Geometry type: "+c.type);return!1}; t.mm=function(a,b,c,d){var e=this.desiredSize,f=this.ph;a=Math.max(a,0);b=Math.max(b,0);if(null!this.Pd)var g=this.geometry.bounds;else{var h=this.figure,k=Cn[h];if(void 0=k){var l=I.Ee[h];"string"typeof l&&(l=I.Ee[l]);"function"typeof l?(k=l(null,100,100),Cn[h]=k):B("Unsupported Figure: "+h)}g=k.bounds}h=g.width;k=g.height;l=g.width;var m=g.height;switch(jl(this,!0)){case Ag:d=c=0;break;case wd:l=Math.max(a-f,0);m=Math.max(b-f,0);break;case Vk:l=Math.max(a-f,0);d=0;break;case Wk:c=0,m= Math.max(b-f,0)}isFinite(e.width)&&(l=e.width);isFinite(e.height)&&(m=e.height);e=this.maxSize;g=this.minSize;c=Math.max(c-f,g.width);d=Math.max(d-f,g.height);l=Math.min(e.width,l);m=Math.min(e.height,m);l=isFinite(l)?Math.max(c,l):Math.max(h,c);m=isFinite(m)?Math.max(d,m):Math.max(k,d);c=Bg(this);switch(c){case Ag:break;case wd:h=l;k=m;break;case Cg:c=Math.min(l/h,m/k);isFinite(c)||(c=1);h*=c;k*=c;break;default:B(c+" is not a valid geometryStretch.")}null!==this.Pd?(h=Math.max(h,.01),k=Math.max(k, .01),g=null!this.Pd?this.Pd:this.oa,e=h,d=k,c=g.copy(),g=g.bounds,e/=g.width,d/=g.height,isFinite(e)||(e=1),isFinite(d)||(d=1),1e&&1d||c.scale(e,d),this.oa=c):null!this.oa&&I.Z(this.oa.il,a-f)&&I.Z(this.oa.gl,b-f)||(this.oa=W.makeGeometry(this,h,k));g=this.oa.bounds;Infinity=a||Infinity=b?gl(this,g.x-f/2,g.y-f/2,0=a&&0=h?0:g.width+f,0=b&&0=k?0:g.height+f):gl(this,-(f/2),-(f/2),l+f,m+f)}; function Bg(a){var b=a.geometryStretch;return null!a.Pd?b=Uk?wd:b:b=Uk?Cn[a.figure].defaultStretch:b}t.Ah=function(a,b,c,d){ll(this,a,b,c,d)};t.Sc=function(a,b,c){return this.ck(a.x,a.y,b.x,b.y,c)}; t.ck=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11f.m22-f.m12f.m21),h=f.m22g,k=-f.m12g,l=-f.m21g,m=f.m11g,n=g*(f.m21f.dy-f.m22f.dx),p=g*(f.m12f.dx-f.m11f.dy);f=ah+bl+n;g=ak+bm+p;h=ch+dl+n;k=ck+dm+p;n=this.ph/2;l=this.oa;null=l&&(this.measure(Infinity,Infinity),l=this.oa);p=l.bounds;m=!1;if(l.type=xd)if(1.5>=this.strokeWidth)m=I.ze(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+bb),d=m b);b=Da();a=new H;I.ze(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new H;I.ze(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new H;I.ze(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new H;I.ze(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 Fa(b),!1;m=!0;k=Infinity;for(d=0;d<h;d++)a=b[d],c=(a.x-f)(a.x-f)+(a.y-g)(a.y-g),c<k&&(k=c,e.x=a.x,e.y=a.y);Fa(b)}else if(l.type=Hd)m=I.Sc(p.x-n,p.y-n,p.x+p.width+ n,p.y+p.height+n,f,g,h,k,e);else if(l.type=Id){b=M.allocAt(p.x,p.y,p.width,p.height).Tc(n,n);a:if(0=b.width)m=I.ze(b.x,b.y,b.x,b.y+b.height,f,g,h,k,e);else if(0=b.height)m=I.ze(b.x,b.y,b.x+b.width,b.y,f,g,h,k,e);elsen=Math.sqrt(aacc+ll-kk);h=(-(aack)+aln)/(ll+aacc)+d;a=(-(aack)-aln)/(ll+aacc)+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))<Math.abs((f-a)(f-a))+Math.abs((g-k)(g-k))?(e.x=h,e.y=l):(e.x=a,e.y=k)}elsek=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)<Math.abs(k-g)?(e.x=f,e.y=h):(e.x=f,e.y=k)}m=!0}M.free(b)}else if(l.type=vd){p=H.alloc();var r=h-f;var q=k-g;var u=rr+qq;e.x=h;e.y=k;for(var v=0;v<l.figures.count;v++){var w=l.figures.j[v],y=w.segments;r=w.startX;q=w.startY;for(var z=r,A=q,C=0;C<y.count;C++){var J= y.j[C],K=J.type;var L=J.endX;var V=J.endY;var R=!1;switch(K){case Xd:z=L;A=V;break;case Fd:R=Dn(r,q,L,V,f,g,h,k,p);break;case Yd:R=I.Up(r,q,J.point1X,J.point1Y,J.point2X,J.point2Y,L,V,f,g,h,k,.6,p);break;case Zd:R=I.Up(r,q,(r+2J.point1X)/3,(q+2J.point1Y)/3,(2J.point1X+L)/3,(2J.point1X+L)/3,L,V,f,g,h,k,.6,p);break;case $d:case ae:K=J.type$d?be(J,w):ce(J,w,r,q);var ea=K.length;if(0=ea)V=null;for(L=0;L<ea;L++){V=K[L];if(0=L&&Dn(r,q,V[0],V[1], f,g,h,k,p))I.Up(V[0],V[1],V[2],V[3],V[4],V[5],V[6],V[7],f,g,h,k,.6,p)&&(pa=En(f,g,p,u,e),pa<u&&(u=pa,m=!0))}L=V[6];V=V[7];break;default:B("Unknown Segment type: "+K)}r=L;q=V;R&&(R=En(f,g,p,u,e),R<u&&(u=R,m=!0));J.isClosed&&(L=z,V=A,Dn(r,q,L,V,f,g,h,k,p)&&(J=En(f,g,p,u,e),J<u&&(u=J,m=!0)))}}f=c-a;g=d-b;h=Math.sqrt(ff+gg);0!h&&(f/=h,g/=h);e.x-=fn;e.y-=gn;H.free(p)}else B("Unknown Geometry type: "+l.type);if(!m)return!1;this.transform.ra(e);return!0}; function En(a,b,c,d,e){a=c.x-a;b=c.y-b;b=aa+bb;return b<d?(e.x=c.x,e.y=c.y,b):d}function Dn(a,b,c,d,e,f,g,h,k) t.Bh=function(a,b){if(void 0=b)return a.nf(this.actualBounds);var c=this.oa;null=c&&(this.measure(Infinity,Infinity),c=this.oa);c=c.bounds;var d=this.strokeWidth/2,e=!1,f=H.alloc();f.h(c.x-d,c.y-d);a.((b.ra(f))&&(f.h(c.x-d,c.bottom+d),a.)(b.ra(f))&&(f.h(c.right+d,c.bottom+d),a.((b.ra(f))&&(f.h(c.right+d,c.y-d),a.)(b.ra(f))&&(e=!0))));H.free(f);return e}; t.Gc=function(a,b){if(this.Bh(a,b)||void 0=b&&(b=this.transform,a.nf(this.actualBounds)))return!0;var c=sd.alloc();c.set(b);c.ft();var d=a.left,e=a.right,f=a.top;a=a.bottom;var g=H.alloc();g.h(d,f);c.ra(g);if(this.Ch(g,!0))return H.free(g),!0;g.h(e,f);c.ra(g);if(this.Ch(g,!0))return H.free(g),!0;g.h(d,a);c.ra(g);if(this.Ch(g,!0))return H.free(g),!0;g.h(e,a);c.ra(g);if(this.Ch(g,!0))return H.free(g),!0;var h=H.alloc(),k=H.alloc();c.set(b);c.wv(this.transform);c.ft();h.x=e;h.y=f;h.transform(c);g.x= d;g.y=f;g.transform(c);b=!1;Fn(this,g,h,k)?b=!0:(g.x=e,g.y=a,g.transform(c),Fn(this,g,h,k)?b=!0:(h.x=d,h.y=a,h.transform(c),Fn(this,g,h,k)?b=!0:(g.x=d,g.y=f,g.transform(c),Fn(this,g,h,k)&&(b=!0))));H.free(g);sd.free(c);H.free(h);H.free(k);return b};function Fn(a,b,c,d){if(!a.Sc(b,c,d))return!1;a=b.x;b=b.y;var e=c.x,f=c.y;c=d.x;d=d.y;if(a=e)return b<f?(a=b,b=f):a=f,d>=a&&d<=b;a<e?(d=a,a=e):d=e;return c>=d&&c<=a} t.zx=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.ed(a[d],a[d+1])>e)return!0;return!1}if(c&&null!this.fill&&this.Ch(a,!0))return!0;var e=a.we(b),f=e;1.5<this.strokeWidth&&(e=this.strokeWidth/2+Math.sqrt(e),e*=e);b=this.oa;if(null=b&&(this.measure(Infinity,Infinity),b=this.oa,null=b))return!1;if(!c)h=b.startX;k=b.startY;l= b.endX;g=b.endY;if(b.type=xd){if(c=(h-l)(a.x-l)+(k-g)(a.y-g),Ab(a.x,a.y,h,k,l,g)<=(0<=(l-h)(a.x-h)+(g-k)(a.y-k)&&0<=c?e:f))return!0}else{if(b.type=Hd)return b=!1,c&&(b=Ab(a.x,a.y,h,k,h,g)<=e||Ab(a.x,a.y,h,k,l,k)<=e||Ab(a.x,a.y,l,k,l,g)<=e||Ab(a.x,a.y,h,g,l,g)<=e),b;if(b.type=Id){b=a.x-(h+l)/2;f=a.y-(k+g)/2;var m=Math.abs(l-h)/2,n=Math.abs(g-k)/2;if(0=m||0=n)return Ab(a.x,a.y,h,k,l,g)<=e?!0:!1;if(c){if(a=I.Ry(m,n,b,f),a*a<=e)return!0}else return Bb(b,f,-m,0)>=e||Bb(b,f,0,-n)>=e||Bb(b, f,0,n)>=e||Bb(b,f,m,0)>=e?!1:!0}else if(b.type=vd)else{c=b.figures;for(b=0;b<c.count;b++){f=c.j[b];g=f.startX;m=f.startY;if(a.ed(g,m)>e)return!1;h=f.segments.j;k=h.length;for(l=0;l<k;l++)switch(n=h[l],n.type){case Xd:case Fd:g=n.endX;m=n.endY; if(a.ed(g,m)>e)return!1;break;case Yd:var p=Da();I.ve(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Fa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.ed(g,m)>e)return!1;break;case Zd:p=Da();I.rq(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Fa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.ed(g,m)>e)return!1;break;case $d:case ae:p=n.type$d?be(n,f):ce(n,f,g,m);var r=p.length;if(0=r)n=null;for(var q=Da(),u=0;u<r;u++)if(n= p[u],q.length=0,I.ve(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.8,q),d(q,a))return Fa(q),!1;Fa(q);null!n&&(g=n[6],m=n[7]);break;default:B("Unknown Segment type: "+n.type)}}return!0}}}return!1};t.bc=function();function Gn(a){var b=a.diagram;null!b&&b.undoManager.isUndoingRedoing||(a.segmentOrientation=Hn,"None"!a.Ul?(a.segmentIndex=-1,a.alignmentFocus=gd):"None"!a.Yk&&(a.segmentIndex=0,a.alignmentFocus=new O(1-gd.x,gd.y)))} W.makeGeometry=function(a,b,c){if("None"!a.toArrow)var d=In[a.toArrow];else"None"!a.fromArrow?d=In[a.fromArrow]:(d=I.Ee[a.figure],"string"=typeof d&&(d=I.Ee[d]),void 0=d&&B("Unknown Shape.figure: "+a.figure),d=d(a,b,c),d.il=b,d.gl=c);if(null=d){var e=I.Ee.Rectangle;"function"=typeof e&&(d=e(a,b,c))}return d}; function Jn(a){var b=In[a];if(void 0=b){var c=a.toLowerCase();if("none"=c)return"None";b=In[c];if(void 0=b){var d=null,e;for(e in I.Hm)if(e.toLowerCase()c)if(null!==d)return a=Jd(I.Hm[d],!1),In[d]=a,c!==d&&(In[c]=d),d}}return"string"typeof b?b:b instanceof ud?a:null} ma.Object.defineProperties(W.prototype,{geometry:{get:function(){return null!==this.oa?this.oa:this.Pd},set:function(a)}},geometryString:{get:function(),set:function(a)},isGeometryPositioned:{get:function(),set:function(a)},fill:{get:function(),set:function(a){var b=this.Wk;b!==a&&(null!==a&&Ql(a,"Shape.fill"),a instanceof sl&&a.freeze(),this.Wk=a,this.N(),this.g("fill",b,a))}},stroke:{ get:function(),set:function(a){var b=this.Dc;b!==a&&(null!==a&&Ql(a,"Shape.stroke"),a instanceof sl&&a.freeze(),this.Dc=a,this.N(),this.g("stroke",b,a))}},strokeWidth:{get:function(),set:function(a)else va(a,"value >= 0",W,"strokeWidth:value")}},strokeCap:{get:function(),set:function(a){var b= this.Ml;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?va(a,‘"butt", "round", or "square"‘,W,"strokeCap"):(this.Ml=a,this.N(),this.g("strokeCap",b,a)))}},strokeJoin:{get:function(),set:function(a){var b=this.Nl;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?va(a,‘"miter", "bevel", or "round"‘,W,"strokeJoin"):(this.Nl=a,this.N(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{get:function(), set:function(a)}},strokeDashArray:{get:function(),set:function(a){var b=this.nh;if(b!==a){if(null!a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];0<=f&&isFinite(f)||B("strokeDashArray:value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0d){if(nullb)return;a=null}}this.nh=a;this.N();this.g("strokeDashArray", b,a)}}},strokeDashOffset:{get:function(),set:function(a)},figure:{get:function(),set:function(a){var b=this.Vk;if(b!a){var c=I.Ee[a];"function"typeof c?c=a:(c=I.Ee[a.toLowerCase()])||B("Unknown Shape.figure: "+a);b!==c&&(a=this.part,null!a&&(a.dh=NaN),this.Vk=c,this.Pd=null,this.bc(),this.o(),this.g("figure",b,c))}}},toArrow:{ get:function(),set:function(a){var b=this.Ul;!0a?a="Standard":!1=a&&(a="");if(b!a){var c=Jn(a);null=c?B("Unknown Shape.toArrow: "+a):b!c&&(this.Ul=c,this.Pd=null,this.bc(),this.o(),Gn(this),this.g("toArrow",b,c))}}},fromArrow:{get:function(),set:function(a){var b=this.Yk;!0=a?a="Standard":!1=a&&(a=);if(b!a){var c=Jn(a);null=c?B("Unknown Shape.fromArrow: "+a):b!==c&&(this.Yk=c,this.Pd=null,this.bc(),this.o(), Gn(this),this.g("fromArrow",b,c))}}},spot1:{get:function(),set:function(a)},spot2:{get:function(),set:function(a)},parameter1:{get:function(),set:function(a){var b=this.Oo;b!==a&&(this.Oo=a,this.bc(),this.o(),this.g("parameter1", b,a))}},parameter2:{get:function(),set:function(a)},naturalBounds:{get:function(){if(null!==this.oa)return this.pc.assign(this.oa.bounds),this.pc;var a=this.desiredSize;return new M(0,0,a.width,a.height)}},pathPattern:{get:function(),set:function(a){var b=this.Ro;b!==a&&(this.Ro=a,this.N(),this.g("pathPattern", b,a))}},geometryStretch:{get:function(),set:function(a)},interval:{get:function(),set:function(a)}},graduatedStart:{get:function(), set:function(a)},graduatedEnd:{get:function(),set:function(a)},graduatedSkip:{get:function(),set:function(a)}});W.prototype.intersectsRect=W.prototype.Gc; W.prototype.containedInRect=W.prototype.Bh;W.prototype.getNearestIntersectionPoint=W.prototype.Sc;W.prototype.getDocumentBounds=W.prototype.cq;W.prototype.getDocumentPoint=W.prototype.ga;var In=new db,Cn=new db;W.className="Shape";W.getFigureGenerators=function(){var a=new G,b;for(b in I.Ee)b!b.toLowerCase()&&a.add(b,I.Ee[b]);a.freeze();return a};W.defineFigureGenerator=function(a,b); W.getArrowheadGeometries=function(){var a=new G;for(d in I.Hm)if(void 0=In[d])for(var c in In)if(c!==c.toLowerCase()){var d=In[c];d instanceof ud&&a.add(c,d)}a.freeze();return a};W.defineArrowheadGeometry=function(a,b){var c=null;"string"===typeof b?c=Jd(b,!1):c=b;b=a.toLowerCase();"none"!==b&&a!==b||B("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var d=In;d[a]=c;d[b]=a}; function Xg(){Y.call(this);Kn||(Ln=Vg?(new Dk(null)).context:null,Kn=!0);this.Qw=this.Rb=;this.Dc="black";this.de="13px sans-serif";this.Ci="start";this.Bd=Ag;this.Hi=cd;this.rj=!0;this.ji=this.ki=!1;this.hg=Mn;this.sg=Nn;this.Tr=this.nb=this.Mc=0;this.ku=this.lu=null;this.yn=!1;this.Bc=this.$m=this.Gp=this.Di=this.Hp=null;this.cf=this.bf=0;this.je=Infinity;this.mi=0;this.ee=null;this.qe=0;this.ce=this.fb=this.Ob=null;this.Fd=1;this.Ed=0;this.Cd=1;this.Dd=this.lj=null}la(Xg,Y); Xg.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.Rb=this.Rb;a.Qw=this.Qw;a.Dc=this.Dc;a.de=this.de;a.Ci=this.Ci;a.Bd=this.Bd;a.Hi=this.Hi;a.rj=this.rj;a.ki=this.ki;a.ji=this.ji;a.hg=this.hg;a.sg=this.sg;a.Mc=this.Mc;a.Tr=this.Tr;a.nb=this.nb;a.lu=this.lu;a.ku=this.ku;a.yn=this.yn;a.Hp=this.Hp;a.Di=this.Di;a.Gp=this.Gp;a.$m=this.$m;a.Bc=this.Bc;a.bf=this.bf;a.cf=this.cf;a.je=this.je;a.ee=this.ee;a.qe=this.qe;a.Ob=this.Ob;a.fb=this.fb;a.ce=this.ce;a.mi=this.mi;a.Fd= this.Fd;a.Ed=this.Ed;a.Cd=this.Cd;a.lj=this.lj;a.Dd=this.Dd}; function Sm(a,b){a.F=b.F|6144;a.ob=b.opacity;a.gb=b.background;a.dc=b.areaBackground;a.Kc=b.desiredSize.G();a.Zf=b.minSize.G();a.Yf=b.maxSize.G();a.Wf=b.Wf.copy();a.ya=b.scale;a.cc=b.angle;a.se=b.stretch;a.bh=b.margin.G();a.wb=b.alignment.G();a.zk=b.alignmentFocus.G();a.Dl=b.segmentFraction;a.El=b.segmentOffset.G();a.Fl=b.segmentOrientation;null!b.ld&&(a.ld=b.ld.copy());a.Hl=b.shadowVisible;b instanceof Xg&&(a.Rb=b.Rb,a.Dc=b.Dc,a.de=b.de,a.Ci=b.Ci,a.Bd=b.Bd,a.Hi=b.Hi,a.rj=b.rj,a.ki=b.ki,a.ji=b.ji, a.hg=b.hg,a.sg=b.sg,a.ee=null,a.bf=b.bf,a.cf=b.cf,a.je=b.je,a.mi=b.mi,a.Fd=b.Fd,a.Ed=b.Ed,a.Cd=b.Cd,a.lj=b.lj,a.Dd=b.Dd)}t=Xg.prototype;t.cb=function(a);t.toString=function(){return 22<this.Rb.length?‘TextBlock("‘+this.Rb.substring(0,20)+‘"...)‘:‘TextBlock("‘+this.Rb+‘")‘};t.o=function(){Y.prototype.o.call(this);this.ku=this.lu=null}; t.Ki=function(a,b){if(null!this.Dc&&0!this.Rb.length&&null!this.de){var c=this.naturalBounds,d=this.actualBounds,e=c.width,f=c.height,g=On(this),h=a.textAlign=this.Ci,k=b.Tn;"start"h?h=k?"right":"left":"end"h&&(h=k?"left":"right");k=this.ki;var l=this.ji;ji(this,a,this.Dc,!0,!1,c,d);(k||l)&&ji(this,a,this.Dc,!1,!1,c,d);d=0;c=!1;var m=H.allocAt(0,0);this.sd.ra(m);var n=H.allocAt(0,g);this.sd.ra(n);var p=m.we(n);H.free(m);H.free(n);m=b.scale;8>pmm&&(c=!0);b.Xc!a&&(c=!1);!1b.xe("textGreeking")&& (c=!1);b=this.bf;p=this.cf;switch(this.flip){case Zk:a.translate(e,0);a.scale(-1,1);break;case Yk:a.translate(0,f);a.scale(1,-1);break;case $k:a.translate(e,f),a.scale(-1,-1)}m=this.Mc;n=(b+g+p)m;f>n&&(d=this.Hi,d=d.yf-d.y*n+d.offsetY);if(1m&&null!this.ce)p=this.nb,p>e&&(p=e),Pn(this,this.ce,a,d+b,e,g,p,c,h,k,l);else if(null!this.Ob&&null!this.fb)for(n=0;n<m;n++)switch(this.flip){case Zk:a.scale(-1,1);a.translate(-e, 0);break;case Yk:a.scale(1,-1);a.translate(0,-f);break;case $k:a.scale(-1,-1),a.translate(-e,-f)}}}; function Pn(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),c.fillRect(0+n,d+.25f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==Qn?Qn(a,f):.75f,c.fillText(b,0+n,d+e),b=f/20|0,0b&&(b=1),"right"k?n-=g:"center"==k&&(n-=g/2),l&&(a=null!==Rn?Rn(a,f):.8*f,c.beginPath(),c.lineWidth=b,c.moveTo(0+n,d+a),c.lineTo(0+n+g,d+a),c.stroke()),m&&(c.beginPath(),c.lineWidth=b,d=d+f-f/2.2|0,0!==b%2&&(d+=.5),c.moveTo(0+n,d),c.lineTo(0+n+g,d), c.stroke()))} t.mm=function(a,b,c,d){this.mi=a;var e=this.de;null!==Ln&&Sn!e&&(Sn=Ln.font=e);this.nb=this.qe=0;this.ce=this.fb=this.Ob=this.ee=null;var f;if(isNaN(this.desiredSize.width)){e=this.Rb.replace(/ /g," ").replace(/ /g," ");if(0e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;)e=f}else f=e.indexOf(" ",0),0<=f&&(e=e.substr(0,f)),e=Tn(e);e=Math.min(e,a/this.scale);e=Math.max(8,e)}else e= this.desiredSize.width;null!==this.panel&&(e=Math.min(e,this.panel.maxSize.width));f=Un(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;g=f;if(0!==this.nb&&null!==this.Ob&&null!this.fb&&this.hgVn&&(b=this.de,b=this.hgVn?Wn(b):0,h=this.bf+this.cf,h=Math.max(0,On(this)+h),g=Math.min(this.maxLines-1,Math.max(Math.floor(g/h+.01)-1,0)),!(g+1>=this.fb.length))){h=this.fb[g];for(b=Math.max(1,a-b);Tn(h)>b&&1<h.length;)h=h.substr(0,h.length-1);h+=Xn;b=Tn(h); this.fb[g]=h;this.fb=this.fb.slice(0,g+1);this.Ob[g]=b;this.Ob=this.Ob.slice(0,g+1);this.qe=this.fb.length;this.nb=Math.max(this.nb,b);this.Mc=this.qe;1=this.Mc&&(this.ce=this.fb[0])}if(this.wrap=Yn||isNaN(this.desiredSize.width))e=isNaN(a)?this.nb:Math.min(a,this.nb),isNaN(this.desiredSize.width)&&(e=Math.max(8,e));e=Math.max(c,e);f=Math.max(d,f);Xb(this.pc,e,f);gl(this,0,0,e,f)};t.Ah=function(a,b,c,d){ll(this,a,b,c,d)}; function Zn(a,b,c){if(null=a.ce)a.ce=b,a.nb=c;else{if(null=a.fb||null=a.Ob)a.fb=[],a.Ob=[],a.fb.push(a.ce),a.Ob.push(a.nb);a.fb.push(b);a.Ob.push(c)}} function $n(a,b,c,d){b=b.trim();var e=0;var f=a.de;var g=a.bf+a.cf;g=Math.max(0,On(a)+g);var h=a.hg=Vn?Wn(f):0;if(a.Mc>=a.je)null!d&&d.h(0,g);else{var k=b;if(a.sg=ao)if(a.qe=1,f=Tn(b),0=h||f<=c)a.nb=Math.max(a.nb,f),Zn(a,b,a.nb),null!d&&d.h(f,g);else{e=bo(a,k);k=k.substr(e.length);b=bo(a,k);for(f=Tn(e+b);0<b.length&&f<=c;)e+=b,k=k.substr(b.length),b=bo(a,k),f=Tn((e+b).trim());e+=b.trim();for(c=Math.max(1,c-h);Tn(e)>c&&1<e.length;)e=e.substr(0,e.length-1);e+=Xn;b=Tn(e);a.nb=b;Zn(a,e,b);null! d&&d.h(b,g)}elseelse n=b,e=Math.max(e,b);m--;1>m&&(m=1);Zn(a,l.substr(0,m),n);h++;l=l.substr(m);if(a.Mc+h>a.je)break}b=bo(a,k);for(f=Tn(l+b);0<b.length&&f<=c;)l+=b,k=k.substr(b.length),b=bo(a,k),f=Tn((l+b).trim());l=l.trim();if(!==l&&("u00ad"=l[l.length-1]&&(l=l.substring(0,l.length-1)+"u2010"), 0=b.length?(m=f,e=Math.max(e,f)):(m=b=Tn(l),e=Math.max(e,b)),Zn(a,l,m),h++,a.Mc+h>a.je))break}a.qe=Math.min(a.je,h);a.nb=Math.max(a.nb,e);null!d&&d.h(a.nb,g*a.qe)}}}function bo(a,b){if(a.sg=co)return b.substr(0,1);a=b.length;for(var c=0,d=eo;c<a&&!d.test(b.charAt(c));)c++;for(;c<a&&d.test(b.charAt(c));)c++;return c>=a?b:b.substr(0,c)}function Tn(a) function On(a){if(null!a.ee)return a.ee;var b=a.de;if(null=Ln)void 0!fo[b]&&5E3>go?c=fo[b]:(c=1.3*Ln.measureText("M").width,fo[b]=c,go++);return a.ee=c}function Wn(a){if(null=Ln)return 6;if(void 0!ho[a]&&5E3>io)var b=ho[a];else b=Ln.measureText(Xn).width,ho[a]=b,io++;return b} function Un(a,b)e=0;for(var f=a.Mc=0,g,h=!1;!h;)else $n(a,f,b,null),e+=d,a.Mc++;a.Mc=a.je&&(h=!0)}f=g+1}return a.Tr=e} ma.Object.defineProperties(Xg.prototype,{font:{get:function(),set:function(a)},text:{get:function(),set:function(a){var b=this.Rb;null!==a&&void 0!==a?a=a.toString():a=;b!a&&(this.Rb=a,this.o(),this.g("text",b,a))}},textAlign:{get:function(),set:function(a){var b=this.Ci;b=a||"start"! a&&"end"!a&&"left"!a&&"right"!a&&"center"!a||(this.Ci=a,this.N(),this.g("textAlign",b,a))}},flip:{get:function(),set:function(a)},verticalAlignment:{get:function(),set:function(a)},naturalBounds:{get:function(){if(!this.pc.v())return this.pc}},isMultiline:{get:function(),set:function(a)},isUnderline:{get:function(),set:function(a){var b=this.ki;b!a&&(this.ki=a,this.N(),this.g("isUnderline", b,a))}},isStrikethrough:{get:function(),set:function(a)},wrap:{get:function(),set:function(a)},overflow:{get:function(),set:function(a)},stroke:{ get:function(),set:function(a){var b=this.Dc;b!a&&(null!a&&Ql(a,"TextBlock.stroke"),a instanceof sl&&a.freeze(),this.Dc=a,this.N(),this.g("stroke",b,a))}},lineCount:{get:function()},editable:{get:function(),set:function(a)},textEditor:{get:function(),set:function(a){var b=this.Hp;b!a&& (this.Hp=a,this.g("textEditor",b,a))}},errorFunction:{get:function(),set:function(a)},interval:{get:function(),set:function(a)}},graduatedStart:{get:function(),set:function(a)},graduatedEnd:{get:function(),set:function(a)},graduatedFunction:{get:function(),set:function(a)},graduatedSkip:{get:function(), set:function(a)},textValidation:{get:function(),set:function(a)},textEdited:{get:function(),set:function(a)},spacingAbove:{get:function(),set:function(a){var b=this.bf;b! a&&(this.bf=a,this.g("spacingAbove",b,a))}},spacingBelow:{get:function(),set:function(a)},maxLines:{get:function(),set:function(a){var b=this.je;b!a&&(a=Math.floor(a),0>=a&&va(a,"> 0",Xg,"maxLines"),this.je=a,this.g("maxLines",b,a),this.o())}},metrics:{get:function(){return{arrSize:null!this.Ob?this.Ob:[this.nb], arrText:null!this.fb?this.fb:[this.ce],maxLineWidth:this.nb,fontHeight:this.ee}}},choices:{get:function(){return this.$m},set:function(a)}});var Qn=null,Rn=null,ao=new D(Xg,"None",0),Yn=new D(Xg,"WrapFit",1),Nn=new D(Xg,"WrapDesiredSize",2),co=new D(Xg,"WrapBreakAll",3),Mn=new D(Xg,"OverflowClip",0),Vn=new D(Xg,"OverflowEllipsis",1),eo=/[ u200bu00ad]/,fo=new db,go=0,ho=new db,io=0,Xn="...",Sn="",Ln=null,Kn=!1; Xg.className="TextBlock";Xg.getEllipsis=function();Xg.setEllipsis=function(a){Xn=a;ho=new db;io=0};Xg.getBaseline=function();Xg.setBaseline=function(a);Xg.getUnderline=function();Xg.setUnderline=function(a); Xg.isValidFont=function(a){Kn||(Ln=Vg?(new Dk(null)).context:null,Kn=!0);if(null=Ln)return!0;var b=Ln.font;if(a=b||"10px sans-serif"a)return!0;Ln.font="10px sans-serif";Ln.font=a;var c=Ln.font;if("10px sans-serif"!==c)return Ln.font=b,!0;Ln.font="19px serif";var d=Ln.font;Ln.font=a;c=Ln.font;Ln.font=b;return c!d};Xg.None=ao;Xg.WrapFit=Yn;Xg.WrapDesiredSize=Nn;Xg.WrapBreakAll=co;Xg.OverflowClip=Mn;Xg.OverflowEllipsis=Vn;function jo() jo.prototype.reset=function();jo.prototype.Qs=function(a);jo.className="TextBlockMetrics";function lk(){Y.call(this);this.Sg=null;this.zp="";this.mh=oc;this.cl=wd;this.ff=this.Bc=null;this.bl=Bc;this.Bd=Ag;this.Pl=null;this.du=!1;this.rr=!0;this.sl=!1;this.Il=null}la(lk,Y); lk.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.element=this.Sg;a.zp=this.zp;a.mh=this.mh.G();a.cl=this.cl;a.Bd=this.Bd;a.Bc=this.Bc;a.ff=this.ff;a.bl=this.bl.G();a.rr=this.rr;a.Il=this.Il};t=lk.prototype;t.cb=function(a);t.toString=function(){return"Picture("+this.source+")#"+lb(this)};function nk(a){void 0a&&(a=);!a?ko[a]&&(delete ko[a],lo--):(ko=new db,lo=0)} function mo(a,b){a.Gr=!0;a.Zk=!1;for(var c,d=Oa(),e=d.length,f=0;f<e;f++){var g=d[f];c=a.getAttribute("src");var h=g.Fj.H(c);if(null!h)for(var k=h.length,l=0;l<k;l++)c=h[l],g.ru.add(c),g.Xb(),void 0=a.zu&&(a.zu=b,null!c.ff&&c.ff(c,b))}}function no(a,b){a.Zk=b;for(var c,d=Oa(),e=d.length,f=0;f<e;f++)}}t.wf=function(){this.N()}; t.Ki=function(a,b){var c=this.Sg;if(null!c){var d=c.getAttribute("src");c instanceof HTMLImageElement&&(null=d||""=d)&&B(‘Element has no source ("src") attribute: ‘+c);if(!(c.Zk instanceof Event)){d=this.naturalBounds;var e=0,f=0,g=this.du,h=g?+c.width:c.naturalWidth;g=g?+c.height:c.naturalHeight;void 0=h&&c.videoWidth&&(h=c.videoWidth);void 0=g&&c.videoHeight&&(g=c.videoHeight);h=h||d.width;g=g||d.height;if(0!h&&0!g){var k=h,l=g;this.sourceRect.v()&&(e=this.mh.x,f=this.mh.y,h=this.mh.width, g=this.mh.height);var m=h,n=g,p=this.cl,r=this.bl;switch(p){case Ag:if(this.sourceRect.v())break;m>=d.width&&(e=e+r.offsetX+(mr.x-d.widthr.x));n>=d.height&&(f=f+r.offsetY+(nr.y-d.heightr.y));h=Math.min(d.width,m);g=Math.min(d.height,n);break;case wd:m=d.width;n=d.height;break;case Cg:case Xk:p=Cg?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p=Xk&&(p=Math.max(d.height/n,d.width/m),m*=p,n*=p,m>=d.width&&(e=(e+r.offsetX+(mr.x-d.widthr.x)/m)h),n>=d.height&&(f=(f+r.offsetY+(nr.y-d.heightr.y)/ n)g),h=1/(m/d.width),g=1/(n/d.height),m=d.width,n=d.height)}p=this.qf()b.scale;var q=mpnp,u=hg/q,v=c.__goCache;p=null;var w=oo;if(c.Gr&&void 0!==v&&4<q&&u>ww)for(null=v.Ji&&(po(v,4,k,l,c),po(v,16,k,l,c)),k=v.Ji,l=k.length,q=0;q<l;q++)if(k[q].ratio*k[q].ratio<u)p=k[q];else break;if(!b.vn){if(null=this.Pl)if(null=this.Sg)this.Pl=!1;else{k=(new Dk(null)).context;k.drawImage(this.Sg,0,0);try{k.getImageData(0,0,1,1).data[3]&&(this.Pl=!1),this.Pl=!1}catch(y)}if(this.Pl)return}k= 0;m<d.width&&(k=r.offsetX+(d.widthr.x-mr.x));l=0;n<d.height&&(l=r.offsetY+(d.heightr.y-nr.y));switch(this.flip){case Zk:a.translate(Math.min(d.width,m),0);a.scale(-1,1);break;case Yk:a.translate(0,Math.min(d.height,n));a.scale(1,-1);break;case $k:a.translate(Math.min(d.width,m),Math.min(d.height,n)),a.scale(-1,-1)}if(b.xe("pictureRatioOptimization")&&!b.qj&&void 0!v&&null!p&&1!p.ratio){a.save();b=p.ratio;try{a.drawImage(p.source,e/b,f/b,Math.min(p.source.width,h/b),Math.min(p.source.height, g/b),k,l,Math.min(d.width,m),Math.min(d.height,n))}catch(y)a.restore()}else try{a.drawImage(c,e,f,h,g,k,l,Math.min(d.width,m),Math.min(d.height,n))}catch(y)switch(this.flip){case Zk:a.scale(-1,1);a.translate(-Math.min(d.width,m),0);break;case Yk:a.scale(1,-1);a.translate(0,-Math.min(d.height,n));break;case $k:a.scale(-1,-1),a.translate(-Math.min(d.width,m),-Math.min(d.height,n))}}}}}; t.mm=function(a,b,c,d){var e=this.desiredSize,f=jl(this,!0),g=this.Sg,h=this.du;if(h||!this.sl&&g&&g.complete)this.sl=!0;null=g&&(isFinite(e.width)||(a=0),isFinite(e.height)||(b=0));isFinite(e.width)||f=wd||f=Vk?(isFinite(a)||(a=this.sourceRect.v()?this.sourceRect.width:h?+g.width:g.naturalWidth),c=0):null!g&&!1!this.sl&&(a=this.sourceRect.v()?this.sourceRect.width:h?+g.width:g.naturalWidth);isFinite(e.height)||f=wd||f=Wk?(isFinite(b)||(b=this.sourceRect.v()?this.sourceRect.height:h? +g.height:g.naturalHeight),d=0):null!g&&!1!this.sl&&(b=this.sourceRect.v()?this.sourceRect.height:h?+g.height:g.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.maxSize;f=this.minSize;c=Math.max(c,f.width);d=Math.max(d,f.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);null=g||g.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));Xb(this.pc,a,b);gl(this,0,0,a,b)};t.Ah=function(a,b,c,d){ll(this,a,b,c,d)}; ma.Object.defineProperties(lk.prototype,{element:{get:function(),set:function(a){var b=this.Sg;if(b!a){null=a||a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||B("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);this.du=a instanceof HTMLCanvasElement;this.Sg=a;if(null!a)if(a instanceof HTMLCanvasElement||!0=a.complete)a.Zk instanceof Event&&null!this.Bc&&this.Bc(this,a.Zk), !0=a.Gr&&null!this.ff&&this.ff(this,a.zu),a.Gr=!0,this.desiredSize.v()||(mj(this,!1),this.o());else),a.addEventListener("error",function(b){no(a,b)}),a.Fw=!0)}this.g("element",b,a);this.N()}}},source:{get:function(),set:function(a){var b=this.zp;if(b!a){this.zp=a;var c=ko,d=this.diagram,e=null;if(void 0!c[a])e=c[a];else{30<lo&&(nk(),c=ko);e=ta("img"); var f=this;e.addEventListener("load",function(a){mo(e,a);f.desiredSize.v()||(mj(f,!1),f.o())});e.addEventListener("error",function(a){no(e,a)});e.Fw=!0;var g=this.Il;null!g&&(e.crossOrigin=g(this));e.src=a;c[a]=e;lo++}null!d&&mk(d,this);this.element=e;null!d&&kk(d,this);void 0=e.__goCache&&(e.__goCache=new qo);this.o();this.N();this.g("source",b,a)}}},sourceCrossOrigin:{get:function(),set:function(a){if(this.Il!a&&(this.Il=a,null!this.element)){var b= this.element.getAttribute("src");null=a&&"string"typeof b?this.element.crossOrigin=null:null!a&&(this.element.crossOrigin=a(this));this.element.src=b}}},sourceRect:{get:function(),set:function(a)},imageStretch:{get:function(),set:function(a)},flip:{ get:function(),set:function(a)},imageAlignment:{get:function(),set:function(a)},errorFunction:{get:function(),set:function(a)},successFunction:{get:function(), set:function(a)},naturalBounds:{get:function()}});var ko=null,lo=0,oo=4;lk.className="Picture";ko=new db;lk.clearCache=nk;function qo() function po(a,b,c,d,e){nulla.Ji&&(a.Ji=[]);var f=new Dk(null),g=f.context,h=1/b;f.width=c/b;f.height=d/b;0!f.width&&0!f.height&&(b=new ro(f.Da,b),c=1,0<a.Ji.length&&(c=a.Ji[a.Ji.length-1],e=c.source,c=c.ratio),g.setTransform(hc,0,0,hc,0,0),g.drawImage(e,0,0),a.Ji.push(b))}qo.className="PictureCacheArray";function ro(a,b)ro.className="PictureCacheInstance";function so(){this.Ys=new ud;this.ec=null}t=so.prototype; t.reset=function(a){null!a?(a.ea(),this.Ys=a,a.figures.clear()):this.Ys=new ud;this.ec=null};function Ld(a,b,c,d,e){a.ec=new ge;a.ec.startX=b;a.ec.startY=c;a.ec.isFilled=d;a.Ys.figures.add(a.ec);void 0!e&&(a.ec.isShadowed=e)}function Td(a)t.Aq=function(a);t.moveTo=function(a,b,c){void 0=c&&(c=!1);var d=new le(Xd);d.endX=a;d.endY=b;c&&d.close();this.ec.segments.add(d)}; t.lineTo=function(a,b,c){void 0=c&&(c=!1);var d=new le(Fd);d.endX=a;d.endY=b;c&&d.close();this.ec.segments.add(d)};function Md(a,b,c,d,e,f,g){var h;void 0=h&&(h=!1);var k=new le(Yd);k.point1X=b;k.point1Y=c;k.point2X=d;k.point2Y=e;k.endX=f;k.endY=g;h&&k.close();a.ec.segments.add(k)}function Rd(a,b,c,d,e){var f;void 0=f&&(f=!1);var g=new le(Zd);g.point1X=b;g.point1Y=c;g.endX=d;g.endY=e;f&&g.close();a.ec.segments.add(g)} t.arcTo=function(a,b,c,d,e,f,g){void 0=f&&(f=0);void 0=g&&(g=!1);var h=new le($d);h.startAngle=a;h.sweepAngle=b;h.centerX=c;h.centerY=d;h.radiusX=e;h.radiusY=0!f?f:e;g&&h.close();this.ec.segments.add(h)};function Sd(a,b,c,d,e,f,g,h){var k;void 0=k&&(k=!1);b=new le(ae,g,h,b,c,d,e,f);k&&b.close();a.ec.segments.add(b)}function Kd(a){var b=Ud;if(null!b)return Ud=null,b.reset(a),b;b=new so;b.reset(a);return b}var Ud=null;so.className="StreamGeometryContext"; function to(a,b)to("Rectangle",function(a,b,c){a=50>I.Df;var d="r"+b+","+c,e=I.Cf[d];if(void 0!e)return e;e=new ud(Hd);e.endX=b;e.endY=c;a&&(I.Cf[d]=e,I.Df++);return e});to("Square",function(a,b,c){a=50>I.Df;var d="s"+b+","+c,e=I.Cf[d];if(void 0!e)return e;e=new ud(Hd);e.endX=b;e.endY=c;e.defaultStretch=Cg;a&&(I.Cf[d]=e,I.Df++);return e}); to("RoundedRectangle",function(a,b,c){var d=50>I.Df,e="rr"+b+","+c,f=I.Cf[e];if(void 0=f){f=a?a.parameter1:NaN;if(isNaN(f)||0>=f)f=5;f=Math.min(f,b/3);f=Math.min(f,c/3);a=fI.Fg;f=(new ud).add((new ge(f,0,!0)).add(new le(Fd,b-f,0)).add(new le(Yd,b,f,b-a,0,b,a)).add(new le(Fd,b,c-f)).add(new le(Yd,b-f,c,b,c-a,b-a,c)).add(new le(Fd,f,c)).add(new le(Yd,0,c-f,a,c,0,c-a)).add(new le(Fd,0,f)).add((new le(Yd,f,0,0,a,a,0)).close()));1<a&&(f.spot1=new O(0,0,a,a),f.spot2=new O(1,1,-a,-a));d&&(I.Cf[e]=f,I.Df++)}return f}); to("Border","RoundedRectangle");to("Ellipse",function(a,b,c){a=50>I.Df;var d="e"+b+","+c,e=I.Cf[d];if(void 0!==e)return e;e=new ud(Id);e.endX=b;e.endY=c;e.spot1=id;e.spot2=jd;a&&(I.Cf[d]=e,I.Df++);return e});to("Circle",function(a,b,c){a=50>I.Df;var d="c"+b+","+c,e=I.Cf[d];if(void 0!==e)return e;e=new ud(Id);e.endX=b;e.endY=c;e.spot1=id;e.spot2=jd;e.defaultStretch=Cg;a&&(I.Cf[d]=e,I.Df++);return e}); to("TriangleRight",function(a,b,c){return(new ud).add((new ge(0,0)).add(new le(Fd,b,.5c)).add((new le(Fd,0,c)).close())).Dm(0,.25,.5,.75)});to("TriangleDown",function(a,b,c){return(new ud).add((new ge(0,0)).add(new le(Fd,b,0)).add((new le(Fd,.5b,c)).close())).Dm(.25,0,.75,.5)});to("TriangleLeft",function(a,b,c){return(new ud).add((new ge(b,c)).add(new le(Fd,0,.5c)).add((new le(Fd,b,0)).close())).Dm(.5,.25,1,.75)}); to("TriangleUp",function(a,b,c){return(new ud).add((new ge(b,c)).add(new le(Fd,0,c)).add((new le(Fd,.5b,0)).close())).Dm(.25,.5,.75,1)});to("Triangle","TriangleUp");to("Diamond",function(a,b,c){return(new ud).add((new ge(.5b,0)).add(new le(Fd,0,.5c)).add(new le(Fd,.5b,c)).add((new le(Fd,b,.5c)).close())).Dm(.25,.25,.75,.75)});to("LineH",function(a,b,c){a=new ud(xd);a.startX=0;a.startY=c/2;a.endX=b;a.endY=c/2;return a}); to("LineV",function(a,b,c){a=new ud(xd);a.startX=b/2;a.startY=0;a.endX=b/2;a.endY=c;return a});to("None","Rectangle");to("BarH","Rectangle");to("BarV","Rectangle");to("MinusLine","LineH");to("PlusLine",function(a,b,c){return(new ud).add((new ge(0,c/2,!1)).add(new le(Fd,b,c/2)).add(new le(Xd,b/2,0)).add(new le(Fd,b/2,c)))});to("XLine",function(a,b,c){return(new ud).add((new ge(0,c,!1)).add(new le(Fd,b,0)).add(new le(Xd,0,0)).add(new le(Fd,b,c)))}); I.Hm={:,Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z", DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z", TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; function T(a){X.call(this,a);this.D=2408959;this.$g=this.Hf=;this.ap=this.Xo=this.np=this.bo=null;this.pp=;this.Ef=this.Nn=this.op=this.kh=null;this.Zo=;this.Yo=Sb;this.Rb=this.bp=;this.ni=this.cn=this.Yh=null;this.Xf=(new H(NaN,NaN)).freeze();this.jo="";this.Ue=null;this.ko=xc;this.cp=$c;this.so=Gb;this.lo=Hb;this.un=null;this.co=127;this.tp=Ib;this.sp="gray";this.$e=4;this.Jw=-1;this.Rp=NaN;this.ly=new M;this.zj=null;this.dh=NaN}la(T,X); T.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.D=this.D&-4097|49152;a.Hf=this.Hf;a.$g=this.$g;a.bo=this.bo;a.np=this.np;a.Xo=this.Xo;a.ap=this.ap;a.pp=this.pp;a.op=this.op;a.Nn=this.Nn;a.Ef=null;a.Zo=this.Zo;a.Yo=this.Yo.G();a.bp=this.bp;a.cp=this.cp.G();a.Rb=this.Rb;a.cn=this.cn;a.Xf.assign(this.Xf);a.jo=this.jo;a.ko=this.ko.G();a.so=this.so.G();a.lo=this.lo.G();a.un=this.un;a.co=this.co;a.tp=this.tp.G();a.sp=this.sp;a.$e=this.$e;a.Rp=this.Rp}; T.prototype.pf=function(a){X.prototype.pf.call(this,a);a.Eh();a.kh=null;a.Ue=null;a.zj=null};T.prototype.toString=function();T.prototype.qk=function(a,b,c,d,e,f,g){var h=this.diagram;null!h&&(a=te&&"elements"=b?e instanceof X?Ej(e,function(a){Gj(h.partManager,a);Fj(h,a)}):kk(h,e):a=ue&&"elements"==b&&(e instanceof X?Ej(e,function(a){Jj(h.partManager,a,h)}):mk(h,e)),h.Ya(a,b,c,d,e,f,g))}; T.prototype.Aa=function(a){X.prototype.Aa.call(this,a);if(null!==this.data){for(var b=this.W.j,c=b.length,d=0;d<c;d++){var e=b[d];e instanceof X&&Ej(e,function(a){null!==a.data&&a.Aa()})}for(b=this.adornments;b.next();)b.value.Aa(a)}};T.prototype.updateRelationshipsFromData=function(){null!==this.data&&this.diagram.partManager.updateRelationshipsFromData(this)};T.prototype.ak=function(a); T.prototype.xh=function(a,b){if(null!b)nulld&&(this.Ef=d=new G);b.Hf!a&&(b.category=a);d.add(a,b);a=this.diagram;null!a&&(a.add(b),a=b.adornedObject,null!a&&(a=a.Oi(),null!a&&(b.data=a.data)))}}};T.prototype.xf=function(a)b.remove(a);0=b.count&&(this.Ef=null)}}; T.prototype.Tj=function()}; T.prototype.updateAdornments=function()a:{if(this.isSelected&&this.selectionAdorned&&(b=this.selectionObject,null!b&&this.actualBounds.v()&&this.isVisible()&&b.vf()&&b.actualBounds.v())){c=this.ak("Selection");if(null=c){c=this.selectionAdornmentTemplate;null=c&&(c=this.Fh()?a.linkSelectionAdornmentTemplate:this instanceof S?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate); if(!(c instanceof De))break a;zg(c);c=c.copy();null!c&&(this.Fh()&&this.selectionObject=this.path&&(c.type=X.Link),c.adornedObject=b)}if(null!c)}this.xf("Selection")}uo(this,a);for(b=this.adornments;b.next();)b.value.Aa()}};T.prototype.Lb=function();function fi(a){0!(a.D&16384)!!1&&(a.updateAdornments(),gi(a,!1))} function uo(a,b){b.toolManager.mouseDownTools.each(function(b){b.isEnabled&&b.updateAdornments(a)});b.toolManager.updateAdornments(a)}function vo(a){if(!1=tj(a)){wo(a,!0);a.jl();var b=a.diagram;null!b&&(b.Gd.add(a),b.Xb())}}function xo(a){a.D|=2097152;if(!1!tj(a))}T.prototype.move=function(a,b){!0=b?this.location=a:this.position=a}; T.prototype.moveTo=function(a,b,c);T.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!a&&!a.visible)return!1;a=this.diagram;if(null!a&&a.animationManager.pt(this))return!0;a=this.containingGroup;return null=a||a.isSubGraphExpanded&&a.isVisible()?!0:!1};t=T.prototype;t.Nb=function(a); t.Xa=function(a){if(this.name=a)return this;var b=this.zj;null=b&&(this.zj=b=new G);if(null!==b.H(a))return b.H(a);var c=X.prototype.Xa.call(this,a);if(null!c)return b.set(a,c),c;b.set(a,null);return null};t.rf=function(a,b,c){void 0=c&&(c=new H);b=b.jc()?Bc:b;var d=a.naturalBounds;c.h(d.widthb.x+b.offsetX,d.height*b.y+b.offsetY);if(null=a||a=this)return c;a.transform.ra(c);for(a=a.panel;null!a&&a!this;)a.transform.ra(c),a=a.panel;this.Wf.ra(c);c.offset(-this.oc.x,-this.oc.y);return c}; t.cq=function(a){void 0=a&&(a=new M);return a.assign(this.actualBounds)};t.zb=function(){!0=rj(this)&&this.measure(Infinity,Infinity);this.arrange()};function Cj(a,b){var c=a.ly;isNaN(a.dh)&&(a.dh=bn(a));var d=a.dh;var e=2*d;if(!a.isShadowed)return c.h(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;e=b.y;var f=b.width;b=b.height;var g=a.shadowBlur;a=a.shadowOffset;f+=g;b+=g;d-=g/2;e-=g/2;0<a.x?f+=a.x:(d+=a.x,f-=a.x);0<a.y?b+=a.y:(e+=a.y,b-=a.y);c.h(d-1,e-1,f+2,b+2);return c} T.prototype.arrange=function(){if(!1=sj(this))xo(this);else};t=T.prototype; t.qt=function(a,b)0!(this.D&65536)!!0&&a.A(b)||Hj(this,d,c);c.N();bc(a,b)||(this instanceof U&&!c.undoManager.isUndoingRedoing&&this.gd(),this.Eh())}}; t.Sv=function(a,b){if(this.Fh()||!a.v())return!1;var c=this.diagram;if(null!c&&(zo(this,c,a,b),!0=c.undoManager.isUndoingRedoing))return!0;this.la=a;this.D&=-2097153;c=this.Xf;if(c.v())!1=tj(this)&&!1=sj(this)&&(vo(this),xo(this));return!0};function zo(a,b,c,d){null=b||a instanceof De||(b=b.animationManager,b.Ve&&Jh(b,a,d.copy(),c.copy()))} t.zq=function(a,b,c)else{if(e.x=a&&e.y=b)return;tj(this)||sj(this)?d.h(NaN,NaN):d.h(d.x+a-e.x,d.y+b-e.y);e.h(a,b)}vo(this)};t.Tv=function(){this.D&=-2097153;vo(this)}; function yo(a,b,c){var d=H.alloc(),e=a.locationSpot,f=a.locationObject;e.jc()&&B("determineOffset: Part‘s locationSpot must be real: "+e.toString());var g=f.naturalBounds,h=f instanceof W?f.strokeWidth:0;d.sk(0,0,g.width+h,g.height+h,e);if(f!a)for(d.offset(-h/2,-h/2),f.transform.ra(d),e=f.panel;null!e&&e!a;)e.transform.ra(d),e=e.panel;a.Wf.ra(d);d.offset(-a.oc.x,-a.oc.y);e=a.diagram;f=c.v();g=b.v();f&&g?0!(a.D&2097152)?Ao(a,b,c,e,d):Bo(a,b,c,e,d):f?Ao(a,b,c,e,d):g&&Bo(a,b,c,e,d);a.D|=2097152; H.free(d);a.jl()}function Ao(a,b,c,d,e){var f=b.x,g=b.y;b.h(c.x-e.x,c.y-e.y);null!d&&(c=d.animationManager,(e=c.isAnimating)||!c.Ve||a instanceof De||Jh(c,a,new H(f,g),b),e||b.x=f&&b.y=g||(c=d.skipsUndoManager,d.skipsUndoManager=!0,a.g("position",new H(f,g),b),d.skipsUndoManager=c))}function Bo(a,b,c,d,e) function Hj(a,b,c){ml(a,!1);a instanceof U&&yk(c,a);a.layer.isTemporary||b||c.Ta();b=a.vb;var d=c.viewportBounds;d.v()?Jf(a)?(ec(b,d,10)||a.xd(!1),a.updateAdornments()):b.Gc(d)?(a.xd(!0),a.updateAdornments()):a.Lb():c.hi=!0}t.Wi=function(){return!0};t.Ub=function(){return!0};t.Fh=function(){return!1};t.tf=function(){return!0}; function Co(a,b,c,d){b.constructor=a.constructor||Do||(Do=!0,wa(‘Should not change the class of the Part when changing category from "‘+c+‘" to "‘+d+‘"‘),wa(" Old class: "+Ha(a.constructor)+", new class: "+Ha(b.constructor)+", part: "+a.toString()));a.Tj();var e=a.data;c=a.layerName;var f=a.isSelected,g=a.isHighlighted,h=!0,k=!0,l=!1;a instanceof U&&(h=a.isTreeLeaf,k=a.isTreeExpanded,l=a.wasTreeExpanded);b.pf(a);b.cloneProtected(a);a.Hf=d;a.o();a.N();b=a.diagram;d=!0;null!b&&(d=b.skipsUndoManager, b.skipsUndoManager=!0);a.hb=e;a.D=f?a.D|4096:a.D&-4097;a.D=g?a.D|524288:a.D&-524289;a instanceof U&&(a.P=h?a.P|4:a.P&-5,a.P=k?a.P|1:a.P&-2,a.P=l?a.P|2:a.P&-3);null!e&&a.Aa();e=a.layerName;e!c&&(a.$g=c,a.layerName=e);null!b&&(b.skipsUndoManager=d);a.Ub()&&a.C(64)}T.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowCopy)return!1;a=a.diagram;return null=a?!0:a.allowCopy?!0:!1}; T.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowDelete)return!1;a=a.diagram;return null=a?!0:a.allowDelete?!0:!1};T.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowTextEdit)return!1;a=a.diagram;return null=a?!0:a.allowTextEdit?!0:!1}; T.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowGroup)return!1;a=a.diagram;return null=a?!0:a.allowGroup?!0:!1};T.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowMove)return!1;a=a.diagram;return null=a?!0:a.allowMove?!0:!1}; T.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowReshape)return!1;a=a.diagram;return null=a?!0:a.allowReshape?!0:!1};T.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowResize)return!1;a=a.diagram;return null=a?!0:a.allowResize?!0:!1}; T.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowRotate)return!1;a=a.diagram;return null=a?!0:a.allowRotate?!0:!1};T.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;if(null=a)return!0;if(!a.allowSelect)return!1;a=a.diagram;return null=a?!0:a.allowSelect?!0:!1};function gi(a,b)function tj(a){return 0!(a.D&32768)}function wo(a,b) function ml(a,b)function Jf(a){return 0!(a.D&131072)}t=T.prototype;t.xd=function(a);function Eo(a,b)t.Eh=function();t.N=function(); t.o=function(){X.prototype.o.call(this);var a=this.diagram;null!a&&(a.Gd.add(this),this instanceof U&&null!this.labeledLink&&Bl(this.labeledLink),a.Xb(!0))};t.gq=function(a){a||(a=this.Yh,null!a&&Fo(a,this))};t.hq=function(a){a||(a=this.Yh,null!a&&Go(a,this))};t.Zj=function()};t.fz=function(){return Ho(this,this)}; function Ho(a,b){var c=b.containingGroup;return null!c?1+Ho(a,c):b instanceof U&&(b=b.labeledLink,null!b)?Ho(a,b):0}t.iz=function(){return Io(this,this)};function Io(a,b){var c=b.containingGroup;return null!c||b instanceof U&&(c=b.labeledLink,null!c)?Io(a,c):b}t.Ud=function(a){return a instanceof S?Jo(this,this,a):!1};function Jo(a,b,c){if(b=c||null=c)return!1;var d=b.containingGroup;return null=d||d!c&&!Jo(a,d,c)?b instanceof U&&(b=b.labeledLink,null!b)?Jo(a,b,c):!1:!0} t.xx=function(a){if(null=a)return null;if(this=a)return this.containingGroup;for(var b=this;null!b;){b instanceof S&&Eo(b,!0);if(b instanceof U)b=b.containingGroup}c=null;for(b=a;null!b;){if(0!(b.D&1048576))b instanceof U&&(a=b.labeledLink,null!a&&(b=a));b=b.containingGroup}for(b=this;null!b;)b instanceof S&&Eo(b,!1),b instanceof U&&(a=b.labeledLink,null!a&&(b=a)),b=b.containingGroup;return c}; T.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return null!a&&a.isTemporary||this instanceof U&&this.isLinkLabel?!1:!0}; T.prototype.C=function(a){void 0=a&&(a=16777215);if(this.isLayoutPositioned&&0!(a&this.layoutConditions)){var b=this.layer;null!b&&b.isTemporary||this instanceof U&&this.isLinkLabel?b=!1:(b=this.diagram,b=null!b&&b.undoManager.isUndoingRedoing?!1:!0)}else b=!1;if(b)if(b=this.Yh,null!b)else a=this.diagram,null!a&&(a=a.layout,null!a&&a.C())};function Ij(a){if(!a.isVisible())return!1;a=a.layer;return null!a&&a.isTemporary?!1:!0} function Rk(a,b,c,d,e,f){void 0=f&&(f=null);if(!(a.contains(b)||null!f&&!f(b)||b instanceof De))if(a.add(b),b instanceof U){if(c&&b instanceof S)for(var g=b.memberParts;g.next();)Rk(a,g.value,c,d,e,f);if(!1!e)for(g=b.linksConnected;g.next();)}if(1<d)for(b=b.iv();b.next();)Rk(a,b.value,c,d-1,e,f)}else if(b instanceof Q)for(b=b.labelNodes;b.next();)Rk(a, b.value,c,d,e,f)} ma.Object.defineProperties(T.prototype,{key:{get:function(){var a=this.diagram;if(null!a)return a.model.ja(this.data)}},adornments:{get:function()},layer:{get:function()},diagram:{get:function(){var a=this.ni;return null!a?a.diagram:null}},layerName:{get:function(){return this.$g},set:function(a)}}}},layerChanged:{ get:function(),set:function(a)},zOrder:{get:function(),set:function(a)}},locationObject:{get:function(){if(null=this.Ue){var a=this.locationObjectName;""!a?(a=this.Xa(a),null!a?this.Ue=a:this.Ue=this): this instanceof De?this.type!X.Link&&null!this.placeholder?this.Ue=this.placeholder:this.Ue=this:this.Ue=this}return this.Ue.visible?this.Ue:this}},minLocation:{get:function(),set:function(a)},maxLocation:{get:function(),set:function(a)},locationObjectName:{ get:function(),set:function(a)},locationSpot:{get:function(),set:function(a)},location:{get:function(),set:function(a){var b=a.x,c=a.y,d=this.Xf,e=d.x,f=d.y;(e=b||isNaN(e)&&isNaN(b))&&(f=c||isNaN(f)&&isNaN(c))|| (a=a.copy(),b=a,this.Fh()?b=!1:(this.Xf=b,this.D|=2097152,!1=sj(this)&&(vo(this),c=this.la,c.v()&&(e=c.copy(),c.h(c.x+(b.x-d.x),c.y+(b.y-d.y)),zo(this,this.diagram,c,e),this.g("position",e,c))),b=!0),b&&this.g("location",d.copy(),a))}},category:{get:function(),set:function(a){var b=this.Hf;if(b!a){var c=this.diagram,d=this.data,e=null;if(null!c&&null!d&&!(this instanceof De)){var f=c.model.undoManager;f.isEnabled&&!f.isUndoingRedoing&&(e=this.clone(), e.W.addAll(this.W))}this.Hf=a;this.g("category",b,a);null=c||null=d||this instanceof De?this instanceof De&&(e=this.adornedPart,null!e&&(a=e.Ef,null!a&&a.remove(b),e.xh(this.category,this))):(f=c.model,f.undoManager.isUndoingRedoing||(this.Fh()?(c.partManager.setLinkCategoryForData(d,a),c=c.partManager.findLinkTemplateForCategory(a),null!c&&(zg(c),c=c.copy(),null!c&&Co(this,c,b,a))):(null!f&&f.yq(d,a),c=Ko(c.partManager,d,a),null!c&&(zg(c),c=c.copy(),null=c||c instanceof Q||(d=this.location.copy(), Co(this,c,b,a),this.location.v()||(this.location=d)))),null!e&&(b=this.clone(),b.W.addAll(this.W),this.g("self",e,b))))}}},self:{get:function(),set:function(a){Co(this,a,this.category,a.category)}},copyable:{get:function(){return 0!(this.D&1)},set:function(a)},deletable:{get:function(){return 0!(this.D&2)},set:function(a)},textEditable:{get:function(){return 0!(this.D&4)},set:function(a)},groupable:{get:function(){return 0!(this.D&8)},set:function(a)},movable:{get:function(){return 0!(this.D&16)},set:function(a){var b=0! (this.D&16);b!a&&(this.D^=16,this.g("movable",b,a))}},selectionAdorned:{get:function(){return 0!(this.D&32)},set:function(a)},isInDocumentBounds:{get:function(){return 0!(this.D&64)},set:function(a)}},isLayoutPositioned:{ get:function(){return 0!(this.D&128)},set:function(a)},selectable:{get:function(){return 0!(this.D&256)},set:function(a)},reshapable:{get:function(){return 0!(this.D&512)},set:function(a)}, resizable:{get:function(){return 0!(this.D&1024)},set:function(a)},rotatable:{get:function(){return 0!(this.D&2048)},set:function(a)},isSelected:{get:function(){return 0!(this.D&4096)},set:function(a){var b=0!(this.D&4096);if(b!a){var c=this.diagram; if(!a||this.canSelect()&&!(null!c&&c.selection.count>=c.maxSelectionCount)){this.D^=4096;var d=!1;if(null!c)this.g("isSelected",b,a);this.Lb();a=this.selectionChanged;null!a&&a(this);null!c&&(c.Xb(),c.skipsUndoManager=d)}}}},isHighlighted:{get:function(){return 0!(this.D&524288)},set:function(a)}},isShadowed:{get:function(){return 0!(this.D&8192)},set:function(a)},isAnimated:{get:function(){return 0!(this.D&262144)},set:function(a){var b=0!(this.D&262144);b!a&&(this.D^=262144, this.g("isAnimated",b,a))}},highlightedChanged:{get:function(),set:function(a)},selectionObjectName:{get:function(),set:function(a)},selectionAdornmentTemplate:{get:function(),set:function(a){var b=this.np;b!a&&(this.np= a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{get:function(){if(null=this.kh){var a=this.selectionObjectName;null!a&&""!a?(a=this.Xa(a),null!=a?this.kh=a:this.kh=this):this instanceof Q?(a=this.path,null!a?this.kh=a:this.kh=this):this.kh=this}return this.kh}},selectionChanged:{get:function(),set:function(a)},resizeAdornmentTemplate:{ get:function(),set:function(a)},resizeObjectName:{get:function(),set:function(a)},resizeObject:{get:function()},resizeCellSize:{get:function(), set:function(a)},rotateAdornmentTemplate:{get:function(),set:function(a)},rotateObjectName:{get:function(),set:function(a)},rotateObject:{get:function(){var a=this.rotateObjectName; return""!a&&(a=this.Xa(a),null!a)?a:this}},rotationSpot:{get:function(),set:function(a)},text:{get:function(),set:function(a)},containingGroup:{get:function(),set:function(a){if(this.Ub()){var b=this.Yh;if(b!a){null=a||this!a&&!a.Ud(this)|| (this=a&&B("Cannot make a Group a member of itself: "+this.toString()),B("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.C(2);var c=this.diagram;null!b?Go(b,this):this instanceof S&&null!c&&c.Fi.remove(this);this.Yh=a;null!a?Fo(a,this):this instanceof S&&null!c&&c.Fi.add(this);this.C(1);if(null!c)}d=this.containingGroupChanged;null!d&& (e=!0,null!c&&(e=c.aa,c.aa=!0),d(this,b,a),null!c&&(c.aa=e));if(this instanceof S)for(c=new F,Rk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof U)for(d=d.linksConnected;d.next();)Lo(d.value);if(this instanceof U){for(c=this.linksConnected;c.next();)Lo(c.value);c=this.labeledLink;null!c&&Lo(c)}this.g("containingGroup",b,a);null!a&&(b=a.layer,null!b&&ki(b,-1,a))}}else B("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{ get:function(),set:function(a)},isTopLevel:{get:function(){return null!this.containingGroup||this instanceof U&&null!this.labeledLink?!1:!0}},layoutConditions:{get:function(),set:function(a)},dragComputation:{get:function(), set:function(a)},shadowOffset:{get:function(),set:function(a)},shadowColor:{get:function(),set:function(a)},shadowBlur:{get:function(){return this.$e},set:function(a)}});T.prototype.invalidateLayout=T.prototype.C;T.prototype.findCommonContainingGroup=T.prototype.xx;T.prototype.isMemberOf=T.prototype.Ud;T.prototype.findTopLevelPart=T.prototype.iz;T.prototype.findSubGraphLevel=T.prototype.fz;T.prototype.ensureBounds=T.prototype.zb;T.prototype.getDocumentBounds=T.prototype.cq;T.prototype.getRelativePoint=T.prototype.rf;T.prototype.findObject=T.prototype.Xa;T.prototype.moveTo=T.prototype.moveTo; T.prototype.invalidateAdornments=T.prototype.Lb;T.prototype.clearAdornments=T.prototype.Tj;T.prototype.removeAdornment=T.prototype.xf;T.prototype.addAdornment=T.prototype.xh;T.prototype.findAdornment=T.prototype.ak;T.prototype.updateTargetBindings=T.prototype.Aa;var Do=!1;T.className="Part";T.LayoutNone=0;T.LayoutAdded=1;T.LayoutRemoved=2;T.LayoutShown=4;T.LayoutHidden=8;T.LayoutNodeSized=16;T.LayoutGroupLayout=32;T.LayoutNodeReplaced=64;T.LayoutStandard=127;T.LayoutAll=16777215; function De(a){T.call(this,a);this.D&=-257;this.$g="Adornment";this.Zd=null;this.Mw=0;this.ex=!1;this.l=[];this.Ra=null}la(De,T);De.prototype.toString=function();De.prototype.updateRelationshipsFromData=function(); De.prototype.ik=function(a){var b=this.adornedObject.part;if(b instanceof Q&&this.adornedObject instanceof W){var c=b.path;b.ik(a);a=c.geometry;b=this.W.j;c=b.length;for(var d=0;d<c;d++){var e=b[d];e.isPanelMain&&e instanceof W&&(e.oa=a)}}};De.prototype.Wi=function();De.prototype.Ub=function(){return!1}; De.prototype.qk=function(a,b,c,d,e,f,g){if(a=te&&"elements"=b)if(e instanceof yg)null=this.Ra&&(this.Ra=e);else{if(e instanceof X));h instanceof yg&&null=this.Ra&&(this.Ra=h)}}else a=ue&&"elements"b&&null!this.Ra&&(dthis.Ra?this.Ra=null:d instanceof X&&this.Ra.Ag(d)&&(this.Ra=null));T.prototype.qk.call(this,a,b,c,d,e,f,g)};De.prototype.updateAdornments=function();De.prototype.Zj=function(); ma.Object.defineProperties(De.prototype,{placeholder:{get:function()},adornedObject:{get:function(),set:function(a)},adornedPart:{get:function(){var a=this.Zd;return null!a?a.part:null}},containingGroup:{ get:function()}});De.className="Adornment";function U(a){T.call(this,a);this.P=13;this.Wa=new E;this.Lp=this.nl=this.ri=this.fo=this.eo=null;this.Dk=uc;this.rc=this.He=null;this.Uo=Mo;this.vh=!1}la(U,T);U.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);a.P=this.P;a.P=this.P&-17;a.eo=this.eo;a.fo=this.fo;a.ri=this.ri;a.Lp=this.Lp;a.Dk=this.Dk.G();a.Uo=this.Uo};t=U.prototype;t.pf=function(a){T.prototype.pf.call(this,a);a.gd();a.He=this.He;a.rc=null}; function No(a,b){null!b&&(null=a.He&&(a.He=new F),a.He.add(b))}function Oo(a,b,c,d){if(null=b||null=a.He)return null;for(var e=a.He.iterator;e.next();)return null}t.Iz=function(a,b,c){if(void 0=b||null=b)b="";if(void 0=c||null=c)c="";a=Oo(this,a,b,c);null!a&&a.hm()}; t.qk=function(a,b,c,d,e,f,g);t.gd=function(a){void 0=a&&(a=null);for(var b=this.linksConnected;b.next();)};function nl(a,b){for(var c=a.linksConnected;c.next();)} function Po(a,b){null!b&&(b=b.To,null!b&&b.hm(),a=a.containingGroup,null=a||a.isSubGraphExpanded||Po(a,a.port))}t.Wi=function(){return!0};U.prototype.getAvoidableRect=function(a){a.set(this.actualBounds);a.Tp(this.Dk);return a};U.prototype.findVisibleNode=function(){for(var a=this;null!a&&!a.isVisible();)a=a.containingGroup;return a}; U.prototype.isVisible=function(){if(!T.prototype.isVisible.call(this))return!1;var a=!0,b=wi,c=this.diagram;if(null!c){if(c.animationManager.pt(this))return!0;a=c.isTreePathToChildren;b=c.treeCollapsePolicy}if(b=wi){if(a=this.yg(),null!a&&!a.isTreeExpanded)return!1}else if(b=Fk){if(a=a?this.gv():this.hv(),0<a.count&&a.all(function(a){return!a.isTreeExpanded}))return!1}else if(b=Gk&&(a=a?this.gv():this.hv(),0<a.count&&a.any(function(a){return!a.isTreeExpanded})))return!1;a=this.labeledLink; return null!a?a.isVisible():!0};t=U.prototype;t.Nb=function(a){T.prototype.Nb.call(this,a);for(var b=this.linksConnected;b.next();)b.value.Nb(a)};t.ev=function(a){void 0=a&&(a=null);if(null=a)return this.Wa.iterator;var b=new ib(this.Wa),c=this;b.predicate=function(b);return b}; t.$p=function(a){void 0=a&&(a=null);var b=new ib(this.Wa),c=this;b.predicate=function(b){return b.fromNode!c?!1:null=a?!0:b.fromPortId=a};return b};t.td=function(a){void 0=a&&(a=null);var b=new ib(this.Wa),c=this;b.predicate=function(b){return b.toNode!c?!1:null=a?!0:b.toPortId=a};return b}; t.fv=function(a){void 0=a&&(a=null);for(var b=null,c=null,d=this.Wa.iterator;d.next();){var e=d.value;if(e.fromNode=this){if(null=a||e.fromPortId=a)e=e.toNode,null!b?b.add(e):null!=c&&c!e?(b=new F,b.add(c),b.add(e)):c=e}else e.toNode!this||null!a&&e.toPortId!a||(e=e.fromNode,null!b?b.add(e):null!c&&c!e?(b=new F,b.add(c),b.add(e)):c=e)}return null!b?b.iterator:null!c?new gb(c):fb}; t.hv=function(a){void 0=a&&(a=null);for(var b=null,c=null,d=this.Wa.iterator;d.next();){var e=d.value;e.fromNode!this||null!a&&e.fromPortId!a||(e=e.toNode,null!b?b.add(e):null!c&&c!e?(b=new F,b.add(c),b.add(e)):c=e)}return null!b?b.iterator:null!c?new gb(c):fb}; t.gv=function(a){void 0=a&&(a=null);for(var b=null,c=null,d=this.Wa.iterator;d.next();){var e=d.value;e.toNode!this||null!a&&e.toPortId!a||(e=e.fromNode,null!b?b.add(e):null!c&&c!e?(b=new F,b.add(c),b.add(e)):c=e)}return null!b?b.iterator:null!c?new gb(c):fb}; t.az=function(a,b,c){void 0=b&&(b=null);void 0=c&&(c=null);var d=new ib(this.Wa),e=this;d.predicate=function(d){return(d.fromNode!e||d.toNode!a||null!b&&d.fromPortId!b||null!c&&d.toPortId!c)&&(d.fromNode!a||d.toNode!e||null!c&&d.fromPortId!c||null!b&&d.toPortId!b)?!1:!0};return d}; t.bz=function(a,b,c){void 0=b&&(b=null);void 0=c&&(c=null);var d=new ib(this.Wa),e=this;d.predicate=function(d){return d.fromNode!e||d.toNode!a||null!b&&d.fromPortId!b||null!c&&d.toPortId!c?!1:!0};return d}; function Qo(a,b,c){Po(a,c);var d=a.Wa.contains(b);d||a.Wa.add(b);if(!d||b.fromNode=b.toNode)}!d&&b.isTreeLink&&(c=b.fromNode,b=b.toNode,null!c&&null!b&&c!b&&(d=!0,a=a.diagram,null!a&&(d=a.isTreePathToChildren),e=d?b:c,f=d?c:b,e.vh||(e.vh=f),!f.isTreeLeaf||null!a&&a.undoManager.isUndoingRedoing||(d?c=f&&(f.isTreeLeaf=!1):b=f&&(f.isTreeLeaf=!1))))} function Ro(a,b,c){Po(a,c);var d=a.Wa.remove(b),e=null;if(d||b.toNode=b.fromNode)}d&&b.isTreeLink&&(c=!0,null!e&&(c=e.isTreePathToChildren),a=c?b.toNode:b.fromNode,b=c?b.fromNode:b.toNode,null!a&&(a.vh=!1),null=b||b.isTreeLeaf||(0=b.Wa.count?(b.vh=null,null!e&&e.undoManager.isUndoingRedoing||(b.isTreeLeaf=!0)):Ek(b)))} function Ek(a)}else if(d.toNode=a)}a.isTreeLeaf=!0}}}U.prototype.updateRelationshipsFromData=function();t=U.prototype; t.gq=function(a){T.prototype.gq.call(this,a);a||(Ek(this),a=this.nl,null!a&&So(a,this))};t.hq=function(a){T.prototype.hq.call(this,a);a||(a=this.nl,null!a&&null!a.Zc&&(a.Zc.remove(this),a.o()))}; t.Zj=function(){if(0<this.Wa.count)}this.labeledLink=null;T.prototype.Zj.call(this)};t.Xs=function(a){if(null=this.rc){if(=a&&!1=this.Dh)return this;To(this)}var b=this.rc.H(a);return null!==b||!a&&(b=this.rc.H(""),null!b)?b:this}; function To(a){null=a.rc?a.rc=new G:a.rc.clear();a.Em(a,function(a,c){Sl(a,c)});0=a.rc.count&&a.rc.add("",a)}function Sl(a,b)function Rl(a,b,c)}} t.Kz=function(a){if(null=a||a=this)return!1;var b=!0,c=this.diagram;null!c&&(b=c.isTreePathToChildren);c=this;if(b)for(;c!a;)if(b=this||null=b||b=c)return!1;c=b}else for(;c!a;)return!0}; t.mz=function()if(a=this)return this;if(null=a||a=b)return b;b=a}else for(;;){a=null;for(c=b.Wa.iterator;c.next()&&(d=c.value,!d.isTreeLink||(a=d.toNode,a=b||a=this)););if(a=this)return this;if(null=a||a=b)return b;b=a}}; t.Yy=function(a){if(null=a)return null;if(this=a)return this;for(var b=this;null!b;)Eo(b,!0),b=b.yg();var c=null;for(b=a;null!b;){if(0!(b.D&1048576))b=b.yg()}for(b=this;null!b;)Eo(b,!1),b=b.yg();return c};t.Pi=function()else for(;b.next();)if(a=b.value,a.isTreeLink&&a.toNode!this)return a;return null}; t.yg=function(){var a=this.vh;if(null=a)return null;if(a instanceof U)return a;var b=!0;a=this.diagram;null!a&&(b=a.isTreePathToChildren);a=this.Wa.iterator;if(b)for(;a.next();){if(b=a.value,b.isTreeLink&&(b=b.fromNode,b!this))return this.vh=b}else for(;a.next();)if(b=a.value,b.isTreeLink&&(b=b.toNode,b!this))return this.vh=b;return this.vh=null};t.kz=function(){function a(b,d){if(null!b){d.add(b);var c=b.Pi();null!c&&(d.add(c),a(b.yg(),d))}}var b=new F;a(this,b);return b}; t.jz=function(){return Uo(this,this)};function Uo(a,b)t.bq=function(){var a=!0,b=this.diagram;null!b&&(a=b.isTreePathToChildren);b=new ib(this.Wa);var c=this;b.predicate=a?function(a){return a.isTreeLink&&a.fromNode=c?!0:!1}:function(a){return a.isTreeLink&&a.toNode=c?!0:!1};return b}; t.iv=function(){var a=!0,b=this.diagram;null!b&&(a=b.isTreePathToChildren);var c=b=null,d=this.Wa.iterator;if(a)for(;d.next();)a=d.value,a.isTreeLink&&a.fromNode=this&&(a=a.toNode,null!b?b.add(a):null!c&&c!a?(b=new E,b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.isTreeLink&&a.toNode=this&&(a=a.fromNode,null!b?b.add(a):null!c&&c!a?(b=new E,b.add(c),b.add(a)):c=a);return null!b?b.iterator:null!c?new gb(c):fb}; t.lz=function(a){void 0=a&&(a=Infinity);var b=new F;Rk(b,this,!1,a,!0);return b};U.prototype.collapseTree=function(a){void 0=a&&(a=1);1>a&&(a=1);var b=this.diagram;if(null!b&&!b.ye){b.ye=!0;var c=new F;c.add(this);Vo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy=wi);b.ye=!1}};function Vo(a,b,c,d,e,f,g){if(1<d)for(var h=c?a.$p():a.td();h.next();)else Wo(a,b,c,e,f,g)} function Wo(a,b,c,d,e,f){for(var g=e=a?!0:a.isTreeExpanded,h=c?a.$p():a.td();h.next();)}a.isTreeExpanded=!1} U.prototype.expandTree=function(a){void 0=a&&(a=2);2>a&&(a=2);var b=this.diagram;if(null!b&&!b.ye){b.ye=!0;var c=new F;c.add(this);Xo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy=wi);b.ye=!1}}; function Xo(a,b,c,d,e,f,g){for(var h=f=a?!1:a.isTreeExpanded,k=c?a.$p():a.td();k.next();)a.isTreeExpanded=!0} ma.Object.defineProperties(U.prototype,{portSpreading:{get:function(),set:function(a)},avoidable:{get:function(){return 0!(this.P&8)},set:function(a)}},avoidableMargin:{ get:function(),set:function(a){"number"typeof a&&(a=new pc(a));var b=this.Dk;if(!b.A(a))}},linksConnected:{get:function()},linkConnected:{get:function(),set:function(a)},linkDisconnected:{get:function(), set:function(a)},linkValidation:{get:function(),set:function(a)},isLinkLabel:{get:function(){return null!==this.nl}},labeledLink:{get:function(),set:function(a){var b=this.nl;if(b!==a){var c=this.diagram,d=this.data;if(null!==b){null!==b.Zc&&(b.Zc.remove(this), b.o());if(null!==c&&null!==d&&!c.undoManager.isUndoingRedoing){var e=b.data,f=c.model;if(null!==e&&f.jm()){var g=f.ja(d);void 0!==g&&f.Px(e,g)}}this.containingGroup=null}this.nl=a;null!a&&(So(a,this),nullc||null=d||c.undoManager.isUndoingRedoing||(e=a.data,c=c.model,null!e&&c.jm()&&(d=c.ja(d),void 0!d&&c.Pu(e,d))),this.containingGroup=a.containingGroup);Bl(this);this.g("labeledLink",b,a)}}},port:{get:function(){return this.Xs("")}},ports:{ get:function()},isTreeExpanded:{get:function(){return 0!(this.P&1)},set:function(a)null!c&&c.undoManager.isUndoingRedoing?this.Nb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{ get:function(){return 0!(this.P&2)},set:function(a)},treeExpandedChanged:{get:function(),set:function(a)},isTreeLeaf:{get:function(){return 0!(this.P&4)},set:function(a)}});U.prototype.expandTree=U.prototype.expandTree; U.prototype.collapseTree=U.prototype.collapseTree;U.prototype.findTreeParts=U.prototype.lz;U.prototype.findTreeChildrenNodes=U.prototype.iv;U.prototype.findTreeChildrenLinks=U.prototype.bq;U.prototype.findTreeLevel=U.prototype.jz;U.prototype.findTreeParentChain=U.prototype.kz;U.prototype.findTreeParentNode=U.prototype.yg;U.prototype.findTreeParentLink=U.prototype.Pi;U.prototype.findCommonTreeParent=U.prototype.Yy;U.prototype.findTreeRoot=U.prototype.mz;U.prototype.isInTreeOf=U.prototype.Kz; U.prototype.findPort=U.prototype.Xs;U.prototype.findLinksTo=U.prototype.bz;U.prototype.findLinksBetween=U.prototype.az;U.prototype.findNodesInto=U.prototype.gv;U.prototype.findNodesOutOf=U.prototype.hv;U.prototype.findNodesConnected=U.prototype.fv;U.prototype.findLinksInto=U.prototype.td;U.prototype.findLinksOutOf=U.prototype.$p;U.prototype.findLinksConnected=U.prototype.ev;U.prototype.invalidateConnectedLinks=U.prototype.gd;U.prototype.invalidateLinkBundle=U.prototype.Iz; var Yo=new D(U,"SpreadingNone",10),Mo=new D(U,"SpreadingEvenly",11),Zo=new D(U,"SpreadingPacked",12);U.className="Node";U.SpreadingNone=Yo;U.SpreadingEvenly=Mo;U.SpreadingPacked=Zo;function S(a){U.call(this,a);this.P|=4608;this.po=new F;this.wl=new F;this.Ra=this.Dp=this.si=this.qo=this.oo=null;this.hc=new Di;this.hc.group=this}la(S,U); S.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);this.P=this.P&-32769;a.oo=this.oo;a.qo=this.qo;a.si=this.si;a.Dp=this.Dp;var b=a.cm(function(a));b instanceof yg?a.Ra=b:a.Ra=null;null!this.hc?(a.hc=this.hc.copy(),a.hc.group=a):(null!a.hc&&(a.hc.group=null),a.hc=null)};t=S.prototype; t.pf=function(a){U.prototype.pf.call(this,a);var b=a.bk();for(a=a.memberParts;a.next();){var c=a.value;c.o();c.C(8);c.Tj();if(c instanceof U)c.gd(b);else if(c instanceof Q)for(c=c.labelNodes;c.next();)c.value.gd(b)}}; t.qk=function(a,b,c,d,e,f,g){if(a=te&&"elements"=b)if(e instanceof yg)null=this.Ra?this.Ra=e:this.Ra!e&&B("Cannot insert a second Placeholder into the visual tree of a Group.");else{if(e instanceof X));h instanceof yg&&(null=this.Ra?this.Ra=h:this.Ra!h&&B("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a=ue&&"elements"b&&null!this.Ra&&(dthis.Ra?this.Ra=null:d instanceof X&&this.Ra.Ag(d)&&(this.Ra=null)); U.prototype.qk.call(this,a,b,c,d,e,f,g)};t.Ah=function(a,b,c,d);t.zb=function(){this.memberParts.each(function(a){a.zb()});U.prototype.zb.call(this)};t.Wi=function(){if(!U.prototype.Wi.call(this))return!1;for(var a=this.memberParts;a.next();){var b=a.value;if(b instanceof U){if(b.isVisible()&&sj(b))return!1}else if(b instanceof Q&&b.isVisible()&&sj(b)&&b.fromNode!this&&b.toNode!this)return!1}return!0}; function Fo(a,b){if(a.po.add(b)){b instanceof S&&a.wl.add(b);var c=a.memberAdded;if(null!c)a.isVisible()&&a.isSubGraphExpanded||b.Nb(!1)}b instanceof Q&&!a.computesBoundsIncludingLinks||(b=a.Ra,null=b&&(b=a),b.o())} function Go(a,b){if(a.po.remove(b)){b instanceof S&&a.wl.remove(b);var c=a.memberRemoved;if(null!c)a.isVisible()&&a.isSubGraphExpanded||b.Nb(!0)}b instanceof Q&&!a.computesBoundsIncludingLinks||(b=a.Ra,null=b&&(b=a),b.o())}t.Zj=function(){if(0<this.po.count)U.prototype.Zj.call(this)}; S.prototype.canAddMembers=function(a);S.prototype.addMembers=function(a,b)return d}; S.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;if(null!a&&!a.allowUngroup)return!1;a=a.diagram;return null=a||a.allowUngroup?!0:!1};t=S.prototype; t.gd=function(a){void 0=a&&(a=null);var b=0!(this.P&65536);U.prototype.gd.call(this,a);if(!b)for(0!(this.P&65536)!!0&&(this.P=this.P^65536),b=this.dv();b.next();)}}; t.dv=function(){var a=this.bk();a.add(this);for(var b=new F,c=a.iterator;c.next();){var d=c.value;if(d instanceof U)for(d=d.linksConnected;d.next();)}return b.iterator};t.$y=function(){var a=this.bk();a.add(this);for(var b=new F,c=a.iterator;c.next();){var d=c.value;if(d instanceof U)for(d=d.linksConnected;d.next();)}return b.iterator}; t.Zy=function(){function a(b,d){null!b&&(d.add(b),a(b.containingGroup,d))}var b=new F;a(this,b);return b};t.bk=function(){var a=new F;Rk(a,this,!0,0,!0);a.remove(this);return a};t.Nb=function(a){U.prototype.Nb.call(this,a);for(var b=this.memberParts;b.next();)b.value.Nb(a)};S.prototype.collapseSubGraph=function()}; function $o(a,b,c,d){for(var e=a.memberParts;e.next();){var f=e.value;f.Nb(!1);f instanceof S&&f.isSubGraphExpanded&&(f.wasSubGraphExpanded=f.isSubGraphExpanded,$o(f,b,c,d));if(f instanceof U)f.gd(b),c.Nj(f,d);else if(f instanceof Q)for(f=f.labelNodes;f.next();)f.value.gd(b)}a.isSubGraphExpanded=!1}S.prototype.expandSubGraph=function()}; function ap(a,b,c,d){for(var e=a.memberParts;e.next();){var f=e.value;f.Nb(!0);f instanceof S&&f.wasSubGraphExpanded&&(f.wasSubGraphExpanded=!1,ap(f,b,c,d));if(f instanceof U)f.gd(b),c.Pj(f,d);else if(f instanceof Q)for(f=f.labelNodes;f.next();)f.value.gd(b)}a.isSubGraphExpanded=!0} S.prototype.move=function(a,b){void 0=b&&(b=!1);var c=b?this.location:this.position,d=c.x;c=c.y;var e=a.x,f=a.y;if(!(d=e||isNaN(d)&&isNaN(e))||!(c=f||isNaN(c)&&isNaN(f))){d=e-(isNaN(d)?0:d);c=f-(isNaN(c)?0:c);f=H.alloc();U.prototype.move.call(this,a,b);a=new F;for(b=this.bk().iterator;b.next();)if(e=b.value,e instanceof Q&&(e.suspendsRouting&&a.add(e),e.yc||e.fromNode!this&&e.toNode!this))e.suspendsRouting=!0;for(b.reset();b.next();)if(e=b.value,!(e.Fh()||e instanceof U&&e.isLinkLabel))for(b.reset();b.next();)if(e=b.value,e instanceof Q&&(e.suspendsRouting=a.contains(e),e.yc||e.fromNode!this&&e.toNode!this))g=e.position,f.x=g.x+d,f.y=g.y+c,f.v()?e.move(f):e.Na(),Pj(e)&&e.Na();H.free(f)}}; ma.Object.defineProperties(S.prototype,{placeholder:{get:function()},computesBoundsAfterDrag:{get:function(){return 0!(this.P&2048)},set:function(a)},computesBoundsIncludingLinks:{get:function(){return 0!(this.P&4096)},set:function(a){var b=0!(this.P&4096);b!a&&(this.P^=4096,this.g("computesBoundsIncludingLinks", b,a))}},computesBoundsIncludingLocation:{get:function(){return 0!(this.P&8192)},set:function(a)},handlesDragDropForMembers:{get:function(){return 0!(this.P&16384)},set:function(a)},memberParts:{get:function()}, layout:{get:function(),set:function(a)}},memberAdded:{get:function(),set:function(a)},memberRemoved:{get:function(), set:function(a)},memberValidation:{get:function(),set:function(a)},ungroupable:{get:function(){return 0!(this.P&256)},set:function(a)},isSubGraphExpanded:{get:function(){return 0!(this.P&512)}, set:function(a)null!c&&c.undoManager.isUndoingRedoing?(null!this.Ra&&this.Ra.o(),this.memberParts.each(function(a){a.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return 0!(this.P&1024)},set:function(a)},subGraphExpandedChanged:{get:function(),set:function(a)},pk:{get:function(){return 0!(this.P&32768)},set:function(a){0!(this.P&32768)!a&&(this.P^=32768)}}});S.prototype.expandSubGraph=S.prototype.expandSubGraph;S.prototype.collapseSubGraph=S.prototype.collapseSubGraph; S.prototype.findSubGraphparts=S.prototype.bk;S.prototype.findContainingGroupChain=S.prototype.Zy;S.prototype.findExternalNodesConnected=S.prototype.$y;S.prototype.findExternalLinksConnected=S.prototype.dv;S.prototype.ensureBounds=S.prototype.zb;S.className="Group";function yg(){Y.call(this);this.bb=tc;this.kp=new M(NaN,NaN,NaN,NaN)}la(yg,Y);yg.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.bb=this.bb.G();a.kp=this.kp.copy()}; yg.prototype.Ch=function(a){if(null=this.background&&null=this.areaBackground)return!1;var b=this.naturalBounds;return kc(0,0,b.width,b.height,a.x,a.y)}; yg.prototype.mm=function(){var a=this.part;null!a&&(a instanceof S||a instanceof De)||B("Placeholder is not inside a Group or Adornment.");if(a instanceof S)d=a.diagram;!c||null=d||d.animationManager.sv(a)||isNaN(b.x)|| isNaN(b.y)||(c=H.alloc(),c.Zi(b,a.locationSpot),c.A(a.location)||(a.location=new H(c.x,c.y)),H.free(c))}else{b=this.pc;c=this.bb;d=c.left+c.right;var e=c.top+c.bottom,f=a.adornedObject;a.angle=f.Ri();var g=0;f instanceof W&&(g=f.strokeWidth);var h=f.qf(),k=f.naturalBounds,l=(k.width+g)*h;g=(k.height+g)*h;a.type!=X.Link&&(f=f.ga("Selection"a.category?xc:a.locationSpot,H.alloc()),a.location=f,H.free(f));isNaN(l)||isNaN(g)?(a=a.adornedObject,l=a.ga(xc,H.alloc()),f=M.allocAt(l.x,l.y,0,0),f.Ce(a.ga(Hc, l)),f.Ce(a.ga(zc,l)),f.Ce(a.ga(Fc,l)),Xb(b,f.width+d||0,f.height+e||0),gl(this,-c.left,-c.top,b.width,b.height),H.free(l),M.free(f)):(Xb(b,l+d||0,g+e||0),gl(this,-c.left,-c.top,b.width,b.height))}};yg.prototype.Ah=function(a,b,c,d){this.actualBounds.h(a,b,c,d)}; yg.prototype.computeBorder=function(a){var b=this.part,c=b.diagram;if(null!c&&b instanceof S&&!b.layer.isTemporary&&b.computesBoundsAfterDrag&&this.kp.v())c=M.alloc();d=this.computeMemberBounds(c);var e=this.bb;b instanceof S&&!b.isSubGraphExpanded?a.h(d.x-e.left,d.y-e.top,0,0):a.h(d.x-e.left,d.y-e.top,Math.max(d.width+e.left+e.right,0),Math.max(d.height+e.top+e.bottom,0));M.free(c); b instanceof S&&b.computesBoundsIncludingLocation&&b.location.v()&&a.Ce(b.location);return a}; yg.prototype.computeMemberBounds=function(a){if(!(this.part instanceof S))return a.h(0,0,0,0),a;for(var b=this.part,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=b.memberParts;g.next();){var h=g.value;if(h.isVisible()){if(h instanceof Q){if(!b.computesBoundsIncludingLinks)continue;if(rj(h))continue;if(h.fromNodeb||h.toNode=b)continue}h=h.actualBounds;h.left<c&&(c=h.left);h.top<d&&(d=h.top);h.right>e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, a.h(b.x,b.y,0,0));return a};ma.Object.defineProperties(yg.prototype,{padding:{get:function(),set:function(a){"number"typeof a&&(a=new pc(a));var b=this.bb;b.A(a)||(this.bb=a=a.G(),this.g("padding",b,a))}}});yg.className="Placeholder"; function Q(){T.call(this,X.Link);this.Pa=8;this.Le=null;this.Me=;this.gf=this.Fn=null;this.hf=;this.Kp=null;this.Pm=pg;this.kn=0;this.mn=pg;this.nn=NaN;this.Gj=bp;this.yp=.5;this.Zc=null;this.xb=(new E).freeze();this.jh=this.gh=null;this.Cl=new M;this.oa=new ud;this.Qn=!0;this.I=this.u=this.Gf=this.Pf=null;this.l=[];this.Hu=new H;this.tr=this.Xw=this.Ww=null;this.cu=NaN;this.O=null}la(Q,T); Q.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);a.Pa=this.Pa&-113;a.Me=this.Me;a.Fn=this.Fn;a.hf=this.hf;a.Kp=this.Kp;a.Pm=this.Pm;a.kn=this.kn;a.mn=this.mn;a.nn=this.nn;a.Gj=this.Gj;a.yp=this.yp;null!==this.O&&(a.O=this.O.copy())};t=Q.prototype;t.pf=function(a){T.prototype.pf.call(this,a);this.Me=a.Me;this.hf=a.hf;a.gh=null;a.Na();a.Gf=this.Gf;var b=a.fromPort;null!==b&&Po(a.fromNode,b);b=a.toPort;null!b&&Po(a.toNode,b)}; t.cb=function(a){a.classTypeQ?2(a.value&2)?this.routing=a:a=sg||a=og||a=ng?this.curve=a:a=cp||a=dp||a=ep?this.adjusting=a:a!bp&&a!pg&&B("Unknown Link enum value for a Link property: "+a):T.prototype.cb.call(this,a)};t.Ec=function(){null=this.O&&(this.O=new cl)};t.Wi=function()a=this.toNode;return null!a&&(b=a.findVisibleNode(),null!b&&(a=b),sj(a)||tj(a))?!1:!0};t.Sv=function(){return!1}; t.Tv=function();t.Ub=function(){return!1};Q.prototype.computeAngle=function(a,b,c){return Q.computeAngle(b,c)};Q.computeAngle=function(a,b){switch(a){default:case pg:a=0;break;case Hn:a=b;break;case Mm:a=b+90;break;case Om:a=b-90;break;case fp:a=b+180;break;case gp:a=I.oq(b);90<a&&270>a&&(a-=180);break;case Nm:a=I.oq(b+90);90<a&&270>a&&(a-=180);break;case Pm:a=I.oq(b-90);90<a&&270>a&&(a-=180);break;case Qm:a=I.oq(b);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return I.oq(a)}; function Lo(a)!a.yc||a.Ww!c&&a.Xw!c||a.Na()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=Q.prototype; t.Eh=function();t.at=function(a);t.uz=function(a);function So(a,b){null=a.Zc&&(a.Zc=new F);a.Zc.add(b);a.o()} t.gq=function(a){T.prototype.gq.call(this,a);hp(this)&&this.iq(this.actualBounds);if(!a)ip(this)}};t.hq=function(a){T.prototype.hq.call(this,a);hp(this)&&this.iq(this.actualBounds);if(!a)jp(this)}}; t.Zj=function()null!this.data&&(a=this.diagram,null!a&&a.partManager.removeDataForLink(this))};Q.prototype.updateRelationshipsFromData=function(){if(null!this.data)}; Q.prototype.move=function(a,b); Q.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};Q.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}; Q.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0=b)return a.assign(Jb),a;if(1=b)return a.assign(this.i(0)),a;if(2=b)if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()sg))return this.oa.lv(.5,a),a.add(this.i(0)),c=this.oa.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()=sg){if(3b)return this.i(1);d=(b-1)/3|0;c=3*(d/2|0);if(1=d%2)else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;d<c/2&&f<b;)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}; Q.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2=a)return this.i(0).Sa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()sg)){a:f+=l}}a=NaN}}return a}if(this.computeCurve()=sg&&4<=a){d=(a-1)/3|0;c=3*(d/2|0);if(1d%2)return c=Math.floor(c),a=this.i(c),d=this.i(c+1),e=this.i(c+2),c=this.i(c+3),I.Ey(a.x,a.y,d.x,d.y,e.x,e.y,c.x,c.y);if(0<c&&c+1<a)return this.i(c-1).Sa(this.i(c+1))}d=this.flattenedLengths;e=this.flattenedTotalLength;for(c=b=0;b<e/2&&c<a;)d=this.i(c);e=this.i(c+1);if(1>Math.abs(d.x-e.x)&&1>Math.abs(d.y-e.y)){if(0<c&&c+2<a)return this.i(c-1).Sa(this.i(c+2))}else{if(1>Math.abs(d.x-e.x))return d.y>e.y?270:90;if(1>Math.abs(d.y-e.y))return d.x>e.x?180:0}return d.Sa(e)};t=Q.prototype;t.i=function(a){return this.xb.j[a]};t.jd=function(a,b){this.xb.hd(a,b)};t.K=function(a,b,c){this.xb.hd(a,new H(b,c))};t.Gz=function(a,b){this.xb.Kb(a,b)};t.m=function(a,b,c){this.xb.Kb(a,new H(b,c))};t.ue=function(a){this.xb.add(a)}; t.lf=function(a,b){this.xb.add(new H(a,b))};t.Iv=function(a){this.xb.jb(a)};t.Uj=function(){this.xb.clear()};function rf(a,b,c){if(0!b||0!c){for(var d=a.yc,e=new E,f=a.xb.iterator;f.next();){var g=f.value;e.add((new H(g.x+b,g.y+c)).freeze())}e.freeze();f=a.xb;a.xb=e;isNaN(b)||isNaN(c)||a.diagram.animationManager.ic?a.o():(a.Xf.h(a.Xf.x+b,a.Xf.y+c),a.la.h(a.la.x+b,a.la.y+c),Bl(a));d&&kp(a);b=a.diagram;null!b&&b.animationManager.ic&&(a.jh=e);a.g("points",f,e)}} t.Hh=function(); t.mf=function(){if(null!this.gh){for(var a=this.gh,b=this.xb,c=Infinity,d=Infinity,e=a.j,f=e.length,g=0;g<f;g++)h=g=Infinity;for(var k=b.j,l=k.length,m=0;m<l;m++)b.freeze();if(l=f)for(f=0;f<l;f++){if(m=e[f],n=k[f],m.x-c!n.x-g||m.y-d!n.y-h){this.o();this.bc();break}}else this.o(),this.bc();this.gh=null;c=this.diagram;null!c&&c.animationManager.ic&&(this.jh=b);kp(this);this.g("points", a,b)}};t.Rx=function(){null!this.gh&&(this.xb=this.gh,this.gh=null)};function kp(a){0=a.xb.count?a.yc=!1:(a.yc=!0,a.tr=null,a.cu=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),lp(a,!1))} t.Na=function(){if(!this.suspendsRouting)a=this.path;null!a&&(this.yc=!1,this.o(),a.o())}};t.cj=function(){if(!this.yc&&!this.Xu)finally}}; Q.prototype.computePoints=function(){var a=this.diagram;if(null=a)return!1;var b=this.fromNode,c=null;null=b?(a.xi||(a.ep=new W,a.ep.desiredSize=Lb,a.ep.strokeWidth=0,a.xi=new U,a.xi.add(a.ep),a.xi.zb()),this.defaultFromPoint&&(a.xi.position=a.xi.location=this.defaultFromPoint,a.xi.zb(),b=a.xi,c=a.ep)):c=this.fromPort;if(null!c&&!b.isVisible())this.Ww=b;if(null=b||!b.location.v())return!1;for(;!(null=c||c.actualBounds.v()&&c.vf());)c= c.panel;if(null=c)return!1;var e=this.toNode,f=null;null=e?(a.yi||(a.fp=new W,a.fp.desiredSize=Lb,a.fp.strokeWidth=0,a.yi=new U,a.yi.add(a.fp),a.yi.zb()),this.defaultToPoint&&(a.yi.position=a.yi.location=this.defaultToPoint,a.yi.zb(),e=a.yi,f=a.fp)):f=this.toPort;null=f||e.isVisible()||(a=e.findVisibleNode(),null!a&&a!e?(e=a,f=a.port):e=a);this.Xw=e;if(null=e||!e.location.v())return!1;for(;!(null=f||f.actualBounds.v()&&f.vf());)f=f.panel;if(null=f)return!1;var g=this.pointsCount;d= this.computeSpot(!0,c);a=this.computeSpot(!1,f);var h=mp(d),k=mp(a),l=c=f&&null!c,m=this.isOrthogonal,n=this.curve=sg;this.Pf=l&&!m?n=!0:!1;var p=this.adjusting=pg||l;if(!m&&!l&&h&&k){if(h=!1,!p&&3<=g&&(p=this.getLinkPoint(b,c,d,!0,!1,e,f),k=this.getLinkPoint(e,f,a,!1,!1,b,c),h=this.adjustPoints(0,p,g-1,k))&&(p=this.getLinkPoint(b,c,d,!0,!1,e,f),k=this.getLinkPoint(e,f,a,!1,!1,b,c),this.adjustPoints(0,p,g-1,k)),!h)if(this.Uj(),n){g=this.getLinkPoint(b,c,d,!0,!1,e,f);p=this.getLinkPoint(e, f,a,!1,!1,b,c);h=p.x-g.x;k=p.y-g.y;l=this.computeCurviness();n=m=0;var r=g.x+h/3,q=g.y+k/3,u=r,v=q;I.w(k,0)?v=0<h?v-l:v+l:(m=-h/k,n=Math.sqrt(ll/(mm+1)),0>l&&(n=-n),u=(0>k?-1:1)n+r,v=m(u-r)+q);r=g.x+2h/3;q=g.y+2k/3;var w=r,y=q;I.w(k,0)?y=0<h?y-l:y+l:(w=(0>k?-1:1)n+r,y=m(w-r)+q);this.Uj();this.ue(g);this.lf(u,v);this.lf(w,y);this.ue(p);this.jd(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.jd(3,this.getLinkPoint(e,f,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,f),a=this.getLinkPoint(e, f,a,!1,!1,b,c),this.hasCurviness()?(p=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+p/2,c=d.y+e/2,g=b,h=c,I.w(e,0)?h=0<p?h-f:h+f:(p=-p/e,g=Math.sqrt(ff/(pp+1)),0>f&&(g=-g),g=(0>e?-1:1)g+b,h=p(g-b)+c),this.ue(d),this.lf(g,h)):this.ue(d),this.ue(a)}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Uj();var z=l?this.computeCurviness():0;n=this.getLinkPoint(b,c,d,!0,m,e,f);r=u=q=0;if(m||!h||l)v=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,n,d,!0,m,e,f),l&&(h||d.A(a)||!m&&1=d.x+ a.x&&1=d.y+a.y)&&(r-=m?90:30,0>z&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(v+=Math.abs(z)*(m?1:2)),0=r?q=v:90=r?u=v:180=r?q=-v:270=r?u=-v:(q=vMath.cos(rMath.PI/180),u=vMath.sin(rMath.PI/180)),d.jc()&&l&&(v=c.ga(Bc,H.alloc()),w=H.allocAt(v.x+1E3q,v.y+1E3u),this.getLinkPointFromPoint(b,c,v,w,!0,n),H.free(v),H.free(w));v=this.getLinkPoint(e,f,a,!1,m,b,c);var A=y=w=0;if(m||!k||l){var C=this.computeEndSegmentLength(e,f,a,!1);A=this.getLinkDirection(e,f,v,a,!1,m,b,c);l&&(k||d.A(a)||!m&& 1=d.x+a.x&&1=d.y+a.y)&&(A+=m?0:30,0>z&&(A+=180));0>A?A+=360:360<=A&&(A-=360);l&&(C+=Math.abs(z)*(m?1:2));0=A?w=C:90=A?y=C:180=A?w=-C:270=A?y=-C:(w=CMath.cos(AMath.PI/180),y=CMath.sin(AMath.PI/180));a.jc()&&l&&(a=f.ga(Bc,H.alloc()),d=H.allocAt(a.x+1E3w,a.y+1E3y),this.getLinkPointFromPoint(e,f,a,d,!1,v),H.free(a),H.free(d))}a=n;if(m||!h||l)a=new H(n.x+q,n.y+u);d=v;if(m||!k||l)d=new H(v.x+w,v.y+y);!p&&!m&&h&&3<g&&this.adjustPoints(0,n,g-2,d)?this.jd(g-1,v):!p&&!m&&k&&3<g&&this.adjustPoints(1, a,g-1,v)?this.jd(0,n):!p&&(m?6<=g:4<g)&&this.adjustPoints(1,a,g-2,d)?(this.jd(0,n),this.jd(g-1,v)):(this.Uj(),this.ue(n),(m||!h||l)&&this.ue(a),m&&this.addOrthoPoints(a,r,d,A,b,e),(m||!k||l)&&this.ue(d),this.ue(v))}return!0};function np(a,b){Math.abs(b.x-a.x)>Math.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} Q.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0=f&&(f=new H);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.Yd()||(e=e.panel);if(null=e)elseb.ck(e,d,g,c,f);null! a&&f.transform(a);return f};function op(a,b){var c=b.To;null=c&&(c=new pp,c.port=b,c.node=b.part,b.To=c);return qp(c,a)} Q.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0=h&&(h=new H);if(c.eb()&&!mp(c))return b.ga(c,h),h;if(c.uf()){var k=op(this,b);if(null!k){h.assign(k.lq);if(e&&this.routing=rp){var l=op(this,g);if(null!l&&k.$l<l.$l){k=H.alloc();l=H.alloc();var m=new M(b.ga(xc,k),b.ga(Hc,l)),n=this.computeSpot(!d,g);a=this.getLinkPoint(f,g,n,!d,e,a,b,l);(c.sf(Jc)||c.sf(Kc))&&a.y>=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.sf(Ic)||c.sf(Lc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);H.free(k);H.free(l)}}return h}}c= b.ga(.5=c.x&&.5=c.y?c:Bc,H.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=np(c,g.copy()))):(k=this.computeSpot(!d,g),f=H.alloc(),g=g.ga(.5=k.x&&.5=k.y?k:Bc,f),e&&(g=np(c,g)),H.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);H.free(c);return h}; Q.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.eb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x<d.y?d.x>1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5<d.x?45:0;else{if(d.uf()&&(k=op(this,b),null!k))switch(k.xc){case 1:k=270;break a;case 2:k=180;break a;default:case 4:k=0;break a;case 8:k=90;break a}k=b.ga(Bc,H.alloc());this.pointsCount>(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?np(k,h.copy()):c):(c=H.alloc(),h=h.ga(Bc,c),H.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;H.free(k);k=c}d.jc()&&g.Ud(a)&&(k+=180,360<=k&&(k-=360));if(mp(d))return k;a=b.Ri();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};Q.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!b&&c.uf()&&(a=op(this,b),null!a))return a.bv;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; Q.prototype.computeSpot=function(a,b){void 0=b&&(b=null);a?(a=b?b:this.fromPort,null=a?a=Bc:(b=this.fromSpot,b.Mb()&&(b=a.fromSpot),a=b$c?wc:b)):(a=b?b:this.toPort,null=a?a=Bc:(b=this.toSpot,b.Mb()&&(b=a.toSpot),a=b$c?wc:b));return a};function mp(a)Q.prototype.computeOtherPoint=function(a,b); Q.prototype.computeShortLength=function(a){if(a)return isNaN(a)?0:a}a=this.toShortLength;isNaN(a)&&(b=this.toPort,null!b&&(a=b.toShortLength));return isNaN(a)?0:a}; Q.prototype.wg=function(a,b,c,d,e,f){if(!1=this.pickable)return!1;void 0=b&&(b=null);void 0=c&&(c=null);var g=f;void 0=f&&(g=sd.alloc(),g.reset());g.multiply(this.transform);if(this.Bh(a,g))return cn(this,b,c,e),void 0=f&&sd.free(g),!0;if(this.Gc(a,g)){var h=!1;if(!this.isAtomic)for(var k=this.W.j,l=k.length;l--;){var m=k[l];if(m.visible||m=this.locationObject){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=sd.alloc();n.set(g); if(m instanceof X)h=m.wg(a,b,c,d,e,n);else if(this.path=m){if(m instanceof W)if(h=a,p=d,!1=m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var r=h,q=n;if(m.Bh(r,q))h=!0;else{if(void 0=q&&(q=m.transform,r.nf(m.actualBounds)))h=r.left;p=r.right;var u=r.top;r=r.bottom;var v=H.alloc(),w=H.alloc(),y=H.alloc(),z=sd.alloc();z.set(q);z.wv(m.transform);z.ft();w.x=p;w.y=u;w.transform(z);v.x=h;v.y=u;v.transform(z);q=!1;Fn(m,v,w,y)?q=!0:(v.x=p,v.y=r,v.transform(z),Fn(m,v,w,y)?q=!0:(w.x= h,w.y=r,w.transform(z),Fn(m,v,w,y)?q=!0:(v.x=h,v.y=u,v.transform(z),Fn(m,v,w,y)&&(q=!0))));sd.free(z);H.free(v);H.free(w);H.free(y);h=q}}else h=m.Bh(h,n)}else h=il(m,a,d,n);h&&(p=m,null!b&&(p=b(m)),p&&(null=c||c(p))&&e.add(p));sd.free(n)}}}void 0=f&&sd.free(g);return h||null!this.background||null!this.areaBackground}void 0=f&&sd.free(g);return!1}; Q.prototype.computeCurve=function(){if(null=this.Pf)return this.Pf?sg:this.curve};Q.prototype.computeCorner=function(){if(this.curve=sg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; Q.prototype.findMidLabel=function(){for(var a=this.path,b=this.W.j,c=b.length,d=0;d<c;d++)for(a=this.labelNodes;a.next();)if(b=a.value,-Infinity=b.segmentIndex||isNaN(b.segmentIndex))return b;return null}; Q.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=Math.max(14,this.computeThickness());var b=this.fromPort,c=this.toPort;if(null!b&&null!c){var d=this.findMidLabel();if(null!d){var e=d.naturalBounds,f=d.margin,g=isNaN(e.width)?30:e.widthd.scale+f.left+f.right;e=isNaN(e.height)?14:e.heightd.scale+f.top+f.bottom;d=d.segmentOrientation;d=Hn||d=gp||d=fp?a=Math.max(a,e):d=Om||d=Pm||d=Mm||d=Nm?a=Math.max(a,g):(b=b.ga(Bc).Sa(c.ga(Bc))/180*Math.PI,a=Math.max(a, Math.abs(Math.sin(b)*g)+Math.abs(Math.cos(b)*e)+1));this.curve=sg&&(a*=1.333)}}return a};Q.prototype.arrangeBundledLinks=function(a,b){if(b)for(b=0;b<a.length;b++)}; Q.prototype.computeCurviness=function()d=-d/2;for(f=0;f<e.length;f++){if(e[f]=this)d+=c[f]}b.nt=this.fromNode&&(a=-a);Fa(c)}}return a};Q.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!a?Math.max(a.strokeWidth,1):1}; Q.prototype.hasCurviness=function(){return!isNaN(this.curviness)||null!this.Gf}; Q.prototype.adjustPoints=function(a,b,c,d)switch(e){case dp:var f=this.i(a),g=this.i(c);if(!f.Ma(b)||!g.Ma(d)){e=f.x;f=f.y;var h=g.x-e,k=g.y-f,l=Math.sqrt(hh+kk);if(!I.Z(l,0)){if(I.Z(h,0))var m=0>k?-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(hh+pp);I.Z(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p));l=k/l;m=p- m;this.jd(a,b);for(a+=1;a<c;a++)b=this.i(a),h=b.x-e,k=b.y-f,b=Math.sqrt(hh+kk),I.Z(b,0)||(I.Z(h,0)?k=0>k?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.K(a,g+bMath.cos(h),n+bMath.sin(h)));this.jd(c,d)}}return!0;case ep:f=this.i(a);n=this.i(c);if(!f.Ma(b)||!n.Ma(d))else q=9E9;this.jd(a,b);for(a+=1;a<c;a++)this.jd(c,d)}return!0;case cp:a:{if(this.isOrthogonal&&(e=this.i(a),f=this.i(a+1),g=this.i(a+2),h=f.x,m=f.y,n=h,l=m,I.w(e.y,f.y)?I.w(f.x,g.x)?m=b.y:I.w(f.y,g.y)&&(h=b.x):I.w(e.x,f.x)&&(I.w(f.y,g.y)?h=b.x:I.w(f.x,g.x)&&(m=b.y)),this.K(a+1,h,m),e=this.i(c),f=this.i(c-1),g=this.i(c- 2),h=f.x,m=f.y,k=h,p=m,I.w(e.y,f.y)?I.w(f.x,g.x)?m=d.y:I.w(f.y,g.y)&&(h=d.x):I.w(e.x,f.x)&&(I.w(f.y,g.y)?h=d.x:I.w(f.x,g.x)&&(m=d.y)),this.K(c-1,h,m),Pj(this))){this.K(a+1,n,l);this.K(c-1,k,p);c=!1;break a}this.jd(a,b);this.jd(c,d);c=!0}return c;default:return!1}}; Q.prototype.addOrthoPoints=function(a,b,c,d,e,f){b=-45<=b&&45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var g=e.actualBounds.copy(),h=f.actualBounds.copy();if(g.v()&&h.v()){g.Tc(8,8);h.Tc(8,8);g.Ce(a);h.Ce(c);if(0=b)if(c.x>a.x||270=d&&c.y<a.y&&h.right>a.x||90=d&&c.y>a.y&&h.right>a.x){var k=new H(c.x,a.y);var l=new H(c.x,(a.y+c.y)/2);180=d?(k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1),l.x=k.x,l.y=c.y):270=d&&c.y<a.y||90=d&& c.y>a.y?(k.x=a.x<h.left?this.computeMidOrthoPosition(a.x,a.y,h.left,c.y,!1):a.x<h.right&&(270=d&&a.y<h.top||90=d&&a.y>h.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):h.right,l.x=k.x,l.y=c.y):0=d&&a.x<h.left&&a.y>h.top&&a.y<h.bottom&&(k.x=a.x,k.y=a.y<c.y?Math.min(c.y,h.top):Math.max(c.y,h.bottom),l.y=k.y)}else{k=new H(a.x,c.y);l=new H((a.x+c.x)/2,c.y);if(180=d||90=d&&c.y<g.top||270=d&&c.y>g.bottom)180=d&&(h.((a)||g.)(c))?k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0): c.y<a.y&&(180=d||90=d)?k.y=this.computeMidOrthoPosition(a.x,g.top,c.x,Math.max(c.y,h.bottom),!0):c.y>a.y&&(180=d||270=d)&&(k.y=this.computeMidOrthoPosition(a.x,g.bottom,c.x,Math.min(c.y,h.top),!0)),l.x=c.x,l.y=k.y;if(k.y>g.top&&k.y<g.bottom)if(c.x>=g.left&&c.x<=a.x||a.x<=h.right&&a.x>=c.x){if(90=d||270=d)k=new H(Math.max((a.x+c.x)/2,a.x),a.y),l=new H(k.x,c.y)}else k.y=270=d||(0=d||180=d)&&c.y<a.y?Math.min(c.y,0=d?g.top:Math.min(g.top,h.top)):Math.max(c.y,0=d?g.bottom:Math.max(g.bottom, h.bottom)),l.x=c.x,l.y=k.y}else if(180=b)if(c.x<a.x||270=d&&c.y<a.y&&h.left<a.x||90=d&&c.y>a.y&&h.left<a.x)k=new H(c.x,a.y),l=new H(c.x,(a.y+c.y)/2),0=d?(k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1),l.x=k.x,l.y=c.y):270=d&&c.y<a.y||90=d&&c.y>a.y?(k.x=a.x>h.right?this.computeMidOrthoPosition(a.x,a.y,h.right,c.y,!1):a.x>h.left&&(270=d&&a.y<h.top||90=d&&a.y>h.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):h.left,l.x=k.x,l.y=c.y):180=d&&a.x>h.right&&a.y>h.top&&a.y< h.bottom&&(k.x=a.x,k.y=a.y<c.y?Math.min(c.y,h.top):Math.max(c.y,h.bottom),l.y=k.y);else{k=new H(a.x,c.y);l=new H((a.x+c.x)/2,c.y);if(0=d||90=d&&c.y<g.top||270=d&&c.y>g.bottom)0=d&&(h.((a)||g.)(c))?k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.y<a.y&&(0=d||90=d)?k.y=this.computeMidOrthoPosition(a.x,g.top,c.x,Math.max(c.y,h.bottom),!0):c.y>a.y&&(0=d||270=d)&&(k.y=this.computeMidOrthoPosition(a.x,g.bottom,c.x,Math.min(c.y,h.top),!0)),l.x=c.x,l.y=k.y;if(k.y>g.top&&k.y<g.bottom)if(c.x<= g.right&&c.x>=a.x||a.x>=h.left&&a.x<=c.x){if(90=d||270=d)k=new H(Math.min((a.x+c.x)/2,a.x),a.y),l=new H(k.x,c.y)}else k.y=270=d||(0=d||180=d)&&c.y<a.y?Math.min(c.y,180=d?g.top:Math.min(g.top,h.top)):Math.max(c.y,180=d?g.bottom:Math.max(g.bottom,h.bottom)),l.x=c.x,l.y=k.y}else if(90=b)if(c.y>a.y||180=d&&c.x<a.x&&h.bottom>a.y||0=d&&c.x>a.x&&h.bottom>a.y)k=new H(a.x,c.y),l=new H((a.x+c.x)/2,c.y),270=d?(k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0),l.x=c.x,l.y=k.y):180=== d&&c.x<a.x||0=d&&c.x>a.x?(k.y=a.y<h.top?this.computeMidOrthoPosition(a.x,a.y,c.x,h.top,!0):a.y<h.bottom&&(180=d&&a.x<h.left||0=d&&a.x>h.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):h.bottom,l.x=c.x,l.y=k.y):90=d&&a.y<h.top&&a.x>h.left&&a.x<h.right&&(k.x=a.x<c.x?Math.min(c.x,h.left):Math.max(c.x,h.right),k.y=a.y,l.x=k.x);else{k=new H(c.x,a.y);l=new H(c.x,(a.y+c.y)/2);if(270=d||0=d&&c.x<g.left||180=d&&c.x>g.right)270=d&&(h.((a)||g.)(c))?k.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.x<a.x&&(270=d||0=d)?k.x=this.computeMidOrthoPosition(g.left,a.y,Math.max(c.x,h.right),c.y,!1):c.x>a.x&&(270=d||180=d)&&(k.x=this.computeMidOrthoPosition(g.right,a.y,Math.min(c.x,h.left),c.y,!1)),l.x=k.x,l.y=c.y;if(k.x>g.left&&k.x<g.right)if(c.y>=g.top&&c.y<=a.y||a.y<=h.bottom&&a.y>=c.y){if(0=d||180=d)k=new H(a.x,Math.max((a.y+c.y)/2,a.y)),l=new H(c.x,k.y)}else k.x=180=d||(90=d||270=d)&&c.x<a.x?Math.min(c.x,90=d?g.left:Math.min(g.left,h.left)):Math.max(c.x,90=== d?g.right:Math.max(g.right,h.right)),l.x=k.x,l.y=c.y}else if(c.y<a.y||180=d&&c.x<a.x&&h.top<a.y||0=d&&c.x>a.x&&h.top<a.y)k=new H(a.x,c.y),l=new H((a.x+c.x)/2,c.y),90=d?(k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0),l.x=c.x,l.y=k.y):180=d&&c.x<a.x||0=d&&c.x>=a.x?(k.y=a.y>h.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,h.bottom,!0):a.y>h.top&&(180=d&&a.x<h.left||0=d&&a.x>h.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):h.top,l.x=c.x,l.y=k.y):270=d&&a.y>h.bottom&&a.x> h.left&&a.x<h.right&&(k.x=a.x<c.x?Math.min(c.x,h.left):Math.max(c.x,h.right),k.y=a.y,l.x=k.x);else{k=new H(c.x,a.y);l=new H(c.x,(a.y+c.y)/2);if(90=d||0=d&&c.x<g.left||180=d&&c.x>g.right)90=d&&(h.((a)||g.)(c))?k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.x<a.x&&(90=d||0=d)?k.x=this.computeMidOrthoPosition(g.left,a.y,Math.max(c.x,h.right),c.y,!1):c.x>a.x&&(90=d||180=d)&&(k.x=this.computeMidOrthoPosition(g.right,a.y,Math.min(c.x,h.left),c.y,!1)),l.x=k.x,l.y=c.y;if(k.x>g.left&& k.x<g.right)if(c.y<=g.bottom&&c.y>=a.y||a.y>=h.top&&a.y<=c.y){if(0=d||180=d)k=new H(a.x,Math.min((a.y+c.y)/2,a.y)),l=new H(c.x,k.y)}else k.x=180=d||(90=d||270=d)&&c.x<a.x?Math.min(c.x,270=d?g.left:Math.min(g.left,h.left)):Math.max(c.x,270=d?g.right:Math.max(g.right,h.right)),l.x=k.x,l.y=c.y}var m=k,n=l,p=c;if(this.isAvoiding){var r=this.diagram;if(null=r||!sk(r)||g.((p)&&!f.Ud(e)||h.)(a)&&!e.Ud(f)||ef||this.layer.isTemporary)b=!1;else{var q=tk(r,!0,this.containingGroup,null);if(q.gk(Math.min(a.x, m.x),Math.min(a.y,m.y),Math.abs(a.x-m.x),Math.abs(a.y-m.y))&&q.gk(Math.min(m.x,n.x),Math.min(m.y,n.y),Math.abs(m.x-n.x),Math.abs(m.y-n.y))&&q.gk(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y)))b=!1;else{e=a;f=p;var u=c=null;if(r.isVirtualized){r=q.bounds.copy();r.Tc(-q.Zl,-q.Yl);var v=H.alloc();sp(q,a.x,a.y)||(I.Sc(r.x,r.y,r.x+r.width,r.y+r.height,a.x,a.y,m.x,m.y,v)?(c=a=v.copy(),b=v.Sa(m)):I.Sc(r.x,r.y,r.x+r.width,r.y+r.height,m.x,m.y,n.x,n.y,v)?(c=a=v.copy(),b=v.Sa(n)): I.Sc(r.x,r.y,r.x+r.width,r.y+r.height,n.x,n.y,p.x,p.y,v)&&(c=a=v.copy(),b=v.Sa(p)));sp(q,p.x,p.y)||(I.Sc(r.x,r.y,r.x+r.width,r.y+r.height,p.x,p.y,n.x,n.y,v)?(u=p=v.copy(),d=n.Sa(v)):I.Sc(r.x,r.y,r.x+r.width,r.y+r.height,n.x,n.y,m.x,m.y,v)?(u=p=v.copy(),d=m.Sa(v)):I.Sc(r.x,r.y,r.x+r.width,r.y+r.height,m.x,m.y,a.x,a.y,v)&&(u=p=v.copy(),d=a.Sa(v)));H.free(v)}g=g.copy().Hc(h);h=q.kA;g.Tc(q.Zlh,q.Ylh);tp(q,a,b,p,d,g);h=up(q,p.x,p.y);!q.abort&&h>=vp&&(wk(q),h=q.Pz,g.Tc(q.Zlh,q.Ylh),tp(q,a,b,p,d,g), h=up(q,p.x,p.y));!q.abort&&h>=vp&&q.rA&&(wk(q),tp(q,a,b,p,d,q.bounds),h=up(q,p.x,p.y));if(!q.abort&&h<vp&&up(q,p.x,p.y)!wp){xp(this,q,p.x,p.y,d,!0);g=this.i(2);if(4>this.pointsCount)0b||180=b?(g.x=a.x,g.y=p.y):(g.x=p.x,g.y=a.y),this.K(2,g.x,g.y),this.m(3,g.x,g.y);else if(p=this.i(3),0=b||180=b)I.w(g.x,p.x)?(g=0=b?Math.max(g.x,a.x):Math.min(g.x,a.x),this.K(2,g,a.y),this.K(3,g,p.y)):I.w(g.y,p.y)?(Math.abs(a.y-g.y)<=q.Yl/2&&(this.K(2,g.x,a.y),this.K(3,p.x,a.y)),this.m(2,g.x,a.y)):this.K(2, a.x,g.y);else if(90=b||270=b)I.w(g.y,p.y)?(g=90=b?Math.max(g.y,a.y):Math.min(g.y,a.y),this.K(2,a.x,g),this.K(3,p.x,g)):I.w(g.x,p.x)?(Math.abs(a.x-g.x)<=q.Zl/2&&(this.K(2,a.x,g.y),this.K(3,a.x,p.y)),this.m(2,a.x,g.y)):this.K(2,g.x,a.y);null!c&&(a=this.i(1),p=this.i(2),a.x!p.x&&a.y!p.y?0=b||180=b?this.m(2,a.x,p.y):this.m(2,p.x,a.y):0=b||180b?this.m(2,e.x,c.y):this.m(2,c.x,e.y));null!u&&(0d||180=d?this.lf(f.x,u.y):this.lf(u.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ue(k), this.ue(l))}};Q.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;this.hasCurviness()&&(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f};function Pj(a){if(null=a.diagram||!a.isAvoiding||!sk(a.diagram))return!1;var b=a.points.j,c=b.length;if(4>c)return!1;a=tk(a.diagram,!0,a.containingGroup,null);for(var d=1;d<c-2;d++)return!1} function xp(a,b,c,d,e,f){var g=b.Zl,h=b.Yl,k=up(b,c,d),l=c,m=d;for(0=e?l+=g:90=e?m+=h:180=e?l-=g:m-=h;k>yp&&up(b,l,m)=k-1;)c=l,d=m,0=e?l+=g:90=e?m+=h:180=e?l-=g:m-=h,--k;if(f){if(k>yp)if(180=e||0=e)c=Math.floor(c/g)g+g/2;else if(90=e||270=e)d=Math.floor(d/h)h+h/2}else c=Math.floor(c/g)g+g/2,d=Math.floor(d/h)h+h/2;k>yp&&(f=e,l=c,m=d,0=e?(f=90,m+=h):90=e?(f=180,l-=g):180=e?(f=270,m-=h):270=e&&(f=0,l+=g),up(b,l,m)=k-1?xp(a,b,l,m,f,!1):(l=c,m=d,0=e?(f=270,m-=h):90=== e?(f=0,l+=g):180=e?(f=90,m+=h):270=e&&(f=180,l-=g),up(b,l,m)=k-1&&xp(a,b,l,m,f,!1)));a.lf(c,d)}Q.prototype.Wy=function(a)return f};Q.prototype.bc=function(); Q.prototype.ik=function(a){if(!a){if(!1=this.yc)return;a=this.Ab();if(!this.Qn&&(nulla||null!==a.geometry))return}this.oa=this.makeGeometry();a=this.path;if(null!==a){a.oa=this.oa;for(var b=this.W.j,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.isPanelMain&&e instanceof W&&(e.oa=this.oa)}}}; Q.prototype.makeGeometry=function()else{if(this.isOrthogonal)for(k=0;k<b;k++)h=d[k],f.x= Math.min(h.x,f.x),f.y=Math.min(h.y,f.y);else for(d=3;d<b;d+=3)d+3>=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;k<b;k++)h=d[k],f.x=Math.min(h.x,f.x),f.y=Math.min(h.y,f.y);d=f.x;k=f.y}d-=this.Hu.x;k-=this.Hu.y;e.x-=d;e.y-=k;if(2!==b||hp(this)){a.type=vd;h=Kd(a);0!this.computeShortLength(!0)&&(e=zp(this,e,!0,f));Ld(h,e.x,e.y,!1);if(gsg&&3<=b&&!I.Z(this.smoothness,0))if(3=b)c=this.i(1),b=c.x-d,c=c.y-k,e=this.i(2).copy(),e.x-=d,e.y-=k,0!==this.computeShortLength(!1)&& (e=zp(this,e,!1,f)),Md(h,b,c,b,c,e.x,e.y);else if(this.isOrthogonal){f=new H(d,k);e=this.i(1).copy();g=new H(d,k);b=new H(d,k);c=this.i(0);for(var l,m=this.smoothness/3,n=1;n<this.pointsCount-1;n++){l=this.i(n);var p=c,r=l,q=this.i(Ap(this,l,n,!1));if(!I.Z(p.x,r.x)||!I.Z(r.x,q.x))if(!I.Z(p.y,r.y)||!I.Z(r.y,q.y)){var u=m;isNaN(u)&&(u=this.smoothness/3);var v=p.x;p=p.y;var w=r.x;r=r.y;var y=q.x;q=q.y;var z=uBp(v,p,w,r);u=Bp(w,r,y,q);I.Z(p,r)&&I.Z(w,y)&&(w>v?q>r?(g.x=w-z,g.y=r-z,b.x=w+u,b.y=r+u):(g.x= w-z,g.y=r+z,b.x=w+u,b.y=r-u):q>r?(g.x=w+z,g.y=r-z,b.x=w-u,b.y=r+u):(g.x=w+z,g.y=r+z,b.x=w-u,b.y=r-u));I.Z(v,w)&&I.Z(r,q)&&(r>p?(y>w?(g.x=w-z,g.y=r-z,b.x=w+u):(g.x=w+z,g.y=r-z,b.x=w-u),b.y=r+u):(y>w?(g.x=w-z,g.y=r+z,b.x=w+u):(g.x=w+z,g.y=r+z,b.x=w-u),b.y=r-u));if(I.Z(v,w)&&I.Z(w,y)||I.Z(p,r)&&I.Z(r,q))v=.5(v+y),p=.5(p+q),g.x=v,g.y=p,b.x=v,b.y=p;1=n?(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y)):2=n&&I.Z(c.x,this.i(0).x)&&I.Z(c.y,this.i(0).y)&&(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y));Md(h,e.x-d,e.y-k,g.x-d,g.y- k,l.x-d,l.y-k);f.set(g);e.set(b);c=l}}f=c.x;c=c.y;e=this.i(this.pointsCount-1);0!this.computeShortLength(!1)&&(e=zp(this,e.copy(),!1,Fb));f=.5*(f+e.x);c=.5*(c+e.y);Md(h,b.x-d,b.y-k,f-d,c-k,e.x-d,e.y-k)}else for(c=3;c<b;c+=3)f=this.i(c-2),c+3>=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c=b-1&&0!this.computeShortLength(!1)&&(g=zp(this,g.copy(),!1,Fb)),Md(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=H.alloc();f.assign(this.i(0));g=1;for(e=0;g<b;){g=Ap(this,f,g,1<g);m=this.i(g);if(g>=b-1){if(!f.A(m))0! this.computeShortLength(!1)&&(m=zp(this,m.copy(),!1,Fb)),Cp(this,h,-d,-k,f,m,c);else if(0e)for(g=1;g<b;)m=this.i(g++),Cp(this,h,-d,-k,f,m,c),f.assign(m);break}e=Ap(this,m,g+1,g<b-3);g=-d;l=-k;n=this.i(e);v=c;I.w(f.y,m.y)&&I.w(m.x,n.x)?(p=this.computeCorner(),p=Math.min(p,Math.abs(m.x-f.x)/2),p=u=Math.min(p,Math.abs(n.y-m.y)/2),I.w(p,0)?(Cp(this,h,g,l,f,m,v),f.assign(m)):(w=m.x,r=m.y,y=w,q=r,m.x>f.x?w=m.x-p:w=m.x+p,n.y>m.y?q=m.y+u:q=m.y-u,Cp(this,h,g,l,f,new H(w,r),v),Rd(h,m.x+g,m.y+l,y+g,q+l), f.h(y,q))):I.w(f.x,m.x)&&I.w(m.y,n.y)?(p=this.computeCorner(),p=Math.min(p,Math.abs(m.y-f.y)/2),p=u=Math.min(p,Math.abs(n.x-m.x)/2),I.w(u,0)?(Cp(this,h,g,l,f,m,v),f.assign(m)):(w=m.x,r=m.y,y=w,q=r,m.y>f.y?r=m.y-p:r=m.y+p,n.x>m.x?y=m.x+u:y=m.x-u,Cp(this,h,g,l,f,new H(w,r),v),Rd(h,m.x+g,m.y+l,y+g,q+l),f.h(y,q))):(Cp(this,h,g,l,f,m,v),f.assign(m));g=e}H.free(f)}Ud=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=zp(this,e,!0,f)),0!this.computeShortLength(!1)&&(h=zp(this, h,!1,f)),a.type=xd,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.Qn=!1;return a};function Bp(a,b,c,d){a=c-a;if(isNaN(a)||Infinitya||-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 I.Z(a,0)?b:I.Z(b,0)?a:Math.sqrt(aa+bb)} function zp(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=Bp(b.x,b.y,c,f);if(0=d)return b;e=2=e?.5d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=Bp(b.x,b.y,c,f);if(0=d)return b;e=2=e?.5d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} function Ap(a,b,c,d){for(var e=a.pointsCount,f=b;I.Z(b.x,f.x)&&I.Z(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!I.Z(b.x,f.x)&&!I.Z(b.y,f.y))return c-1;for(var g=f;I.Z(b.x,f.x)&&I.Z(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||I.Z(b.y,f.y)&&I.Z(f.y,g.y)&&(!d||(b.x>=f.x?f.x>=g.x:f.x<=g.x));){if(c>=e)return e-1;g=a.i(c++)}return c-2} function Cp(a,b,c,d,e,f,g){if(!g&&hp(a)){g=[];var h=0;a.isVisible()&&(h=Dp(a,e,f,g));if(0<h)if(I.w(e.y,f.y))if(e.x<f.x)for(var k=0;k<h;){var l=Math.max(e.x,Math.min(g[k++]-5,f.x-10));b.lineTo(l+c,f.y+d);var m=l+c;for(var n=Math.min(l+10,f.x);k<h;)if(l=g[k],l<n+10)k++,n=Math.min(l+5,f.x);else break;l=f.y-10+d;n+=c;var p=f.y+d;a.curve=og?Ld(b,n,p,!1):Md(b,m,l,n,l,n,p)}else for(--h;0<=h;){k=Math.min(e.x,Math.max(g[h--]+5,f.x+10));b.lineTo(k+c,f.y+d);m=k+c;for(l=Math.max(k-10,f.x);0<=h;)if(k=g[h],k> l-10)h--,l=Math.max(k-5,f.x);else break;k=f.y-10+d;l+=c;n=f.y+d;a.curve=og?Ld(b,l,n,!1):Md(b,m,k,l,k,l,n)}else if(I.w(e.x,f.x))if(e.y<f.y)for(k=0;k<h;){l=Math.max(e.y,Math.min(g[k++]-5,f.y-10));b.lineTo(f.x+c,l+d);m=l+d;for(l=Math.min(l+10,f.y);k<h;)if(n=g[k],n<l+10)k++,l=Math.min(n+5,f.y);else break;n=f.x-10+c;p=f.x+c;l+=d;a.curve=og?Ld(b,p,l,!1):Md(b,n,m,n,l,p,l)}else for(--h;0<=h;){k=Math.min(e.y,Math.max(g[h--]+5,f.y+10));b.lineTo(f.x+c,k+d);m=k+d;for(k=Math.max(k-10,f.y);0<=h;)if(l=g[h], l>k-10)h--,k=Math.max(l-5,f.y);else break;l=f.x-10+c;n=f.x+c;k+=d;a.curve=og?Ld(b,n,k,!1):Md(b,l,m,l,k,n,k)}}b.lineTo(f.x+c,f.y+d)} function Dp(a,b,c,d){var e=a.diagram;if(nulle||b.A(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!f&&f.visible){f=f.Ca.j;for(var g=f.length,h=0;h<g;h++){var k=f[h];if(k instanceof Q){if(ka)return 0<d.length&&d.sort(function(a,b)),d.length;if(k.isVisible()&&hp(k))}}}}0<d.length&&d.sort(function(a,b));return d.length} function Ep(a,b,c,d){for(var e=I.w(a.y,b.y),f=d.pointsCount,g=d.i(0),h=H.alloc(),k=1;k<f;k++)else if(g.x=l.x&&l.x=m.x&&(l.y>g.y&&m.y>=l.y||l.y<g.y&&m.y<=l.y))continue}a:}else if(!I.w(n,r)&& I.w(g,v)&&Math.min(n,r)<g&&Math.max(n,r)>g&&Math.min(q,u)<m&&Math.max(q,u)>m&&!I.w(q,u))h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}H.free(h)}function hp(a)function lp(a,b){if(b||hp(a))b=a.diagram,null=b||b.animationManager.isTicking||b.di.contains(a)||0=a.Cl.width&&0=a.Cl.height||b.di.add(a,a.Cl.copy())} Q.prototype.iq=function(a){var b=this.layer;if(null!b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!c&&!c.animationManager.isAnimating){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e=b){d=!0;var f=!1;e=e.Ca.j;for(var g=e.length,h=0;h<g;h++){var k=e[h];k instanceof Q&&(k=this?f=!0:f&&Fp(this,k,a))}}else if(d)for(f=e.Ca.j,e=f.length,g=0;g<e;g++)h=f[g],h instanceof Q&&Fp(this,h,a)}}}}; function Fp(a,b,c){if(null!b&&null!b.oa&&hp(b))}Q.prototype.usesSamePort=function(a)else if(this.fromNode=a.fromNode||this.toNode=a.toNode||this.fromNode=a.toNode||this.toNode=a.fromNode)return!0;return!1}; Q.prototype.isVisible=function(){if(!T.prototype.isVisible.call(this))return!1;var a=this.containingGroup,b=!0,c=this.diagram;null!c&&(b=c.isTreePathToChildren);c=this.fromNode;if(null!c){if(this.isTreeLink&&b&&!c.isTreeExpanded)return!1;if(c=a)return!0;for(var d=c;null!d;){if(d.labeledLink=this)return!0;d=d.containingGroup}c=c.findVisibleNode();if(null=c||ca)return!1}c=this.toNode;if(null!c){if(this.isTreeLink&&!b&&!c.isTreeExpanded)return!1;if(ca)return!0;for(b=c;null!b;){if(b.labeledLink= this)return!0;b=b.containingGroup}b=c.findVisibleNode();if(null=b||ba)return!1}return!0};Q.prototype.Nb=function(a){T.prototype.Nb.call(this,a);null!==this.Gf&&this.Gf.hm();if(null!==this.Zc)for(var b=this.Zc.iterator;b.next();)b.value.Nb(a)}; function ip(a)if(null!a){f=Oo(b,c,d,e);nullf&&(f=new Gp(b,d,c,e),No(b,f),No(c,f));f.links=a;for(b=0;b<a.length;b++)a[b].Gf=f;f.hm()}}}}function jp(a) Q.prototype.Fh=function(){return!0}; ma.Object.defineProperties(Q.prototype,{fromNode:{get:function(),set:function(a)null!a&&(this.gf! a&&Qo(a,this,e),ip(this),this.C(1));this.g("fromNode",b,a);Lo(this)}}},fromPortId:{get:function(),set:function(a)c!d&&(this.Pf=null,this.Na(),f=this.fromPortChanged,null!f&&(g=!0,null!e&&(g=e.aa,e.aa=!0),f(this,c,d),null! e&&(e.aa=g)));ip(this);this.g("fromPortId",b,a)}}},fromPort:{get:function()},fromPortChanged:{get:function(),set:function(a)},toNode:{get:function(),set:function(a){var b=this.gf;if(b!a){var c=this.toPort;null!b&&(this.Le!b&&Ro(b,this,c),jp(this),this.C(2));this.gf= a;null!a&&this.Nb(a.isVisible());this.Pf=null;this.Na();var d=this.diagram;null!d&&d.partManager.setToNodeForLink(this,a,b);var e=this.toPort,f=this.toPortChanged;if(null!f)null!a&&(this.Le!=a&&Qo(a,this,e),ip(this),this.C(1));this.g("toNode",b,a);Lo(this)}}},toPortId:{get:function(),set:function(a)c!d&&(this.Pf=null,this.Na(),f=this.toPortChanged,null!=f&&(g=!0,null!e&&(g=e.aa,e.aa=!0),f(this,c,d),null!=e&&(e.aa=g)));ip(this);this.g("toPortId",b,a)}}},toPort:{get:function()},toPortChanged:{get:function(),set:function(a)},fromSpot:{get:function(){return null!this.O?this.O.Vg:$c},set:function(a){this.Ec();var b=this.O.Vg;b.A(a)||(a=a.G(),this.O.Vg=a,this.g("fromSpot",b,a),this.Na())}},fromEndSegmentLength:{get:function(){return null!=this.O?this.O.Tg:NaN},set:function(a){this.Ec();var b=this.O.Tg;b!a&&(0>a&&va(a,">= 0",Q,"fromEndSegmentLength"),this.O.Tg=a,this.g("fromEndSegmentLength",b,a),this.Na())}}, fromShortLength:{get:function(){return null!this.O?this.O.Ug:NaN},set:function(a){this.Ec();var b=this.O.Ug;b!a&&(this.O.Ug=a,this.g("fromShortLength",b,a),this.Na(),this.bc())}},toSpot:{get:function(){return null!this.O?this.O.uh:$c},set:function(a){this.Ec();var b=this.O.uh;b.A(a)||(a=a.G(),this.O.uh=a,this.g("toSpot",b,a),this.Na())}},toEndSegmentLength:{get:function(){return null!this.O?this.O.sh: NaN},set:function(a){this.Ec();var b=this.O.sh;b!a&&(0>a&&va(a,">= 0",Q,"toEndSegmentLength"),this.O.sh=a,this.g("toEndSegmentLength",b,a),this.Na())}},toShortLength:{get:function(){return null!this.O?this.O.th:NaN},set:function(a){this.Ec();var b=this.O.th;b!a&&(this.O.th=a,this.g("toShortLength",b,a),this.Na(),this.bc())}},isLabeledLink:{get:function()},labelNodes:{ get:function()},relinkableFrom:{get:function(){return 0!(this.Pa&1)},set:function(a)},relinkableTo:{get:function(){return 0!(this.Pa&2)},set:function(a)},resegmentable:{get:function(){return 0!(this.Pa& 4)},set:function(a)},isTreeLink:{get:function(){return 0!(this.Pa&8)},set:function(a)},path:{get:function(){var a=this.Ab();return a instanceof W?a:null}},routeBounds:{get:function(){this.cj(); var a=this.Cl,b=Infinity,c=Infinity,d=this.pointsCount;if(0=d)a.h(NaN,NaN,0,0);else{if(1=d)d=this.i(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.h(d.x,d.y,0,0);else if(2=d)else if(this.computeCurve()=sg&&3<=d&&!this.isOrthogonal)if(e=this.i(0),b=e.x,c=e.y,a.h(b,c,0,0),3=d){d=this.i(1);b=Math.min(d.x,b);c=Math.min(d.y,c);var f=this.i(2);b=Math.min(f.x,b);c=Math.min(f.y,c);I.Xl(e.x,e.y,d.x,d.y,d.x,d.y, f.x,f.y,.5,a)}else for(f=3;f<d;f+=3)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.Ce(f),e=2;e<d;e++)f=this.i(e),b=Math.min(f.x,b),c=Math.min(f.y,c),a.Ce(f);this.Hu.h(b-a.x,c-a.y)}return a}},midPoint:{get:function(){this.cj();return this.computeMidPoint(new H)}},midAngle:{ get:function(){this.cj();return this.computeMidAngle()}},flattenedLengths:{get:function(){if(null=this.tr){this.yc||kp(this);for(var a=this.tr=[],b=this.pointsCount,c=0;c<b-1;c++)}return this.tr}},flattenedTotalLength:{get:function()return a}},points:{get:function(),set:function(a){var b=this.xb;if(b!a){var c=null;if(Array.isArray(a)){var d=0=a.length%2;if(d)for(var e=0;e<a.length;e++)if("number"!typeof a[e]||isNaN(a[e]))if(d)for(c=new E,d=0;d<a.length/2;d++)e=(new H(a[2d],a[2d+1])).freeze(),c.add(e);else{d=!0;for(e=0;e<a.length;e++){var f=a[e];if(!ya(f)||"number"!typeof f.x||isNaN(f.x)||"number"!typeof f.y||isNaN(f.y))}if(d)for(c=new E,d=0;d<a.length;d++)e=a[d],c.add((new H(e.x,e.y)).freeze())}}else if(a instanceof E)for(c=a.copy(),a=c.iterator;a.next();)a.value.freeze();else B("Link.points value is not an instance of List or Array: "+a);c.freeze();this.xb=c;this.bc();this.o();kp(this);a=this.diagram;null!a&&(a.fk||a.undoManager.isUndoingRedoing||a.kt.add(this),a.animationManager.ic&&(this.jh=c));this.g("points",b,c)}}},pointsCount:{get:function()}, yc:{get:function(){return 0!(this.Pa&16)},set:function(a){0!(this.Pa&16)!a&&(this.Pa^=16)}},suspendsRouting:{get:function(){return 0!(this.Pa&32)},set:function(a){0!(this.Pa&32)!a&&(this.Pa^=32)}},Xu:{get:function(){return 0!(this.Pa&64)},set:function(a){0!(this.Pa&64)!a&&(this.Pa^=64)}},defaultFromPoint:{get:function(),set:function(a)}, defaultToPoint:{get:function(),set:function(a)},isOrthogonal:{get:function(){return 2(this.Gj.value&2)}},isAvoiding:{get:function(){return 4(this.Gj.value&4)}},geometry:{get:function(){this.Qn&&(this.cj(),this.oa=this.makeGeometry());return this.oa}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal|| !mp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return 0=a?0:2>=a?a-1:this.isOrthogonal||!mp(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(),set:function(a)},corner:{get:function(),set:function(a)},curve:{ get:function(),set:function(a)},curviness:{get:function(),set:function(a)},routing:{get:function(),set:function(a){var b=this.Gj;b!a&&(this.Gj=a,this.Pf=null,this.Na(),lp(this,2(b.value& 2)||2(a.value&2)),this.g("routing",b,a))}},smoothness:{get:function(),set:function(a)},key:{get:function(){var a=this.diagram;if(null!a&&a.model.jm())return a.model.Tb(this.data)}}});Q.prototype.invalidateOtherJumpOvers=Q.prototype.iq;Q.prototype.findClosestSegment=Q.prototype.Wy;Q.prototype.updateRoute=Q.prototype.cj;Q.prototype.invalidateRoute=Q.prototype.Na; Q.prototype.rollbackRoute=Q.prototype.Rx;Q.prototype.commitRoute=Q.prototype.mf;Q.prototype.startRoute=Q.prototype.Hh;Q.prototype.clearPoints=Q.prototype.Uj;Q.prototype.removePoint=Q.prototype.Iv;Q.prototype.addPointAt=Q.prototype.lf;Q.prototype.addPoint=Q.prototype.ue;Q.prototype.insertPointAt=Q.prototype.m;Q.prototype.insertPoint=Q.prototype.Gz;Q.prototype.setPointAt=Q.prototype.K;Q.prototype.setPoint=Q.prototype.jd;Q.prototype.getPoint=Q.prototype.i;Q.prototype.getOtherPort=Q.prototype.uz; Q.prototype.getOtherNode=Q.prototype.at; var bp=new D(Q,"Normal",1),Hp=new D(Q,"Orthogonal",2),Ip=new D(Q,"AvoidsNodes",6),rp=new D(Q,"AvoidsNodesStraight",7),pg=new D(Q,"None",0),sg=new D(Q,"Bezier",9),og=new D(Q,"JumpGap",10),ng=new D(Q,"JumpOver",11),cp=new D(Q,"End",17),dp=new D(Q,"Scale",18),ep=new D(Q,"Stretch",19),Hn=new D(Q,"OrientAlong",21),Mm=new D(Q,"OrientPlus90",22),Om=new D(Q,"OrientMinus90",23),fp=new D(Q,"OrientOpposite",24),gp=new D(Q,"OrientUpright",25),Nm=new D(Q,"OrientPlus90Upright",26),Pm=new D(Q,"OrientMinus90Upright", 27),Qm=new D(Q,"OrientUpright45",28);Q.className="Link";Q.Normal=bp;Q.Orthogonal=Hp;Q.AvoidsNodes=Ip;Q.AvoidsNodesStraight=rp;Q.None=pg;Q.Bezier=sg;Q.JumpGap=og;Q.JumpOver=ng;Q.End=cp;Q.Scale=dp;Q.Stretch=ep;Q.OrientAlong=Hn;Q.OrientPlus90=Mm;Q.OrientMinus90=Om;Q.OrientOpposite=fp;Q.OrientUpright=gp;Q.OrientPlus90Upright=Nm;Q.OrientMinus90Upright=Pm;Q.OrientUpright45=Qm;function Gp(a,b,c,d){Za(this);this.ge=this.Er=!1;this.nt=a;this.Nx=b;this.xv=c;this.Ox=d;this.links=[]} Gp.prototype.hm=function(){if(!this.Er)this.Er=!0};Gp.prototype.fw=function(){if(this.Er)0=a.length&&(a=this.nt,null!this&&null!a.He&&a.He.remove(this),a=this.xv,null!this&&null!a.He&&a.He.remove(this))}}; Gp.className="LinkBundle";function uk(){Za(this);this.$x=this.group=null;this.et=!0;this.abort=!1;this.Nd=this.Md=1;this.no=this.mo=-1;this.lc=this.kc=8;this.Cb=[[]];this.Mj=this.Lj=0;this.rA=!1;this.kA=22;this.Pz=111} uk.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height))a= Jp;if(null!this.Cb)for(b=0;b<=this.Lj;b++)for(c=0;c<=this.Mj;c++)this.Cb[b][c]=a}};function sp(a,b,c){return a.Md<=b&&b<=a.mo&&a.Nd<=c&&c<=a.no}function up(a,b,c){if(!sp(a,b,c))return Jp;b-=a.Md;b/=a.kc;c-=a.Nd;c/=a.lc;return a.Cb[b|0][c|0]}function xk(a,b,c){sp(a,b,c)&&(b-=a.Md,b/=a.kc,c-=a.Nd,c/=a.lc,a.Cb[b|0][c|0]=wp)}function wk(a){if(null!a.Cb)for(var b=0;b<=a.Lj;b++)for(var c=0;c<=a.Mj;c++)a.Cb[b][c]>=yp&&(a.Cb[b][c]=Jp)} uk.prototype.gk=function(a,b,c,d){if(a>this.mo||a+c<this.Md||b>this.no||b+d<this.Nd)return!0;a=(a-this.Md)/this.kc|0;b=(b-this.Nd)/this.lc|0;c=Math.max(0,c)/this.kc+1|0;var e=Math.max(0,d)/this.lc+1|0;0>a&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Lj)|0;for(c=Math.min(b+e-1,this.Mj)|0;a<=d;a++)for(e=b;e<=c;e++)if(this.Cb[a][e]=wp)return!1;return!0}; function Kp(a,b,c,d,e,f,g,h,k){if(!(b<f||b>g||c<h||c>k)){var l=b|0;var m=c|0;var n=a.Cb[l][m];if(n>=yp&&n<vp)for(e?m+=d:l+=d,n+=1;f<=l&&l<=g&&h<=m&&m<=k&&!(n>=a.Cb[l][m]);)a.Cb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0<d)for(c+=d;c<l;c+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h,k);else for(c+=d;c>l;c+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h,k);else if(0<d)for(b+=d;b<l;b+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h,k);else for(b+=d;b>l;b+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h, k)}}function Lp(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=wp,m=yp;for(a.Cb[b][c]=m;l=wp&&b>f&&b<g&&c>h&&c<k;)m+=1,a.Cb[b][c]=m,e?c+=d:b+=d,l=a.Cb[b][c]}function Mp(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=wp,m=vp;for(a.Cb[b][c]=m;l=wp&&b>f&&b<g&&c>h&&c<k;)a.Cb[b][c]=m,e?c+=d:b+=d,l=a.Cb[b][c]} function tp(a,b,c,d,e,f){if(null!a.Cb){a.abort=!1;var g=b.x,h=b.y;if(sp(a,g,h)&&(g-=a.Md,g/=a.kc,h-=a.Nd,h/=a.lc,b=d.x,d=d.y,sp(a,b,d)))if(b-=a.Md,b/=a.kc,d-=a.Nd,d/=a.lc,1>=Math.abs(g-b)&&1>=Math.abs(h-d))a.abort=!0;else{var k=f.x,l=f.y,m=f.x+f.width,n=f.y+f.height;k-=a.Md;k/=a.kc;l-=a.Nd;l/=a.lc;m-=a.Md;m/=a.kc;n-=a.Nd;n/=a.lc;f=Math.max(0,Math.min(a.Lj,k|0));m=Math.min(a.Lj,Math.max(0,m|0));l=Math.max(0,Math.min(a.Mj,l|0));n=Math.min(a.Mj,Math.max(0,n|0));g|=0;h|=0;b|=0;d|=0;k=0=c||90=c? 1:-1;c=90=c||270=c;a.Cb[g][h]wp?(Lp(a,g,h,k,c,f,m,l,n),Lp(a,g,h,1,!c,f,m,l,n),Lp(a,g,h,-1,!c,f,m,l,n)):Lp(a,g,h,k,c,g,h,g,h);a.Cb[b][d]=wp?(Mp(a,b,d,0e||90=e?1:-1,90=e||270=e,f,m,l,n),Mp(a,b,d,1,!(90=e||270=e),f,m,l,n),Mp(a,b,d,-1,!(90=e||270=e),f,m,l,n)):Mp(a,b,d,k,c,b,d,b,d);a.abort||(Kp(a,g,h,1,!1,f,m,l,n),Kp(a,g,h,-1,!1,f,m,l,n),Kp(a,g,h,1,!0,f,m,l,n),Kp(a,g,h,-1,!0,f,m,l,n))}}} ma.Object.defineProperties(uk.prototype,{bounds:{get:function(){return new M(this.Md,this.Nd,this.mo-this.Md,this.no-this.Nd)}},Zl:{get:function(),set:function(a){0<a&&a!this.kc&&(this.kc=a,this.initialize(this.bounds))}},Yl:{get:function(),set:function(a){0<a&&a!this.lc&&(this.lc=a,this.initialize(this.bounds))}}});var wp=0,yp=1,vp=999999,Jp=vp+1;uk.className="PositionArray"; function pp(){Za(this);this.port=this.node=null;this.Vd=[];this.nq=!1}pp.prototype.toString=function(){for(var a=this.Vd,b=this.node.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!d&&(b+=" "+d.toString())}return b}; function Np(a,b,c,d){b=b.offsetY;switch(b){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(b){case 9:return 180<c?270:90;case 6:return 90<c&&270>=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 90<c&&c<=180+a?180:c>180+a&&c<=360-a?270:0;case 13:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case 14:return c> a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!b&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}pp.prototype.hm=function(); function qp(a,b){var c=a.Vd;if(0=c.length){a:if(!a.nq){c=a.nq;a.nq=!0;var d=null,e=a.node;e=e instanceof S?e:null;if(null=e||e.isSubGraphExpanded)var f=a.node.ev(a.port.portId);else{if(!e.actualBounds.v())d=e;f=d.dv()}var g=a.Vd.length=0,h=a.port.ga(xc,H.alloc()),k=a.port.ga(Hc,H.alloc());e=M.allocAt(h.x,h.y,0,0);e.Ce(k);H.free(h);H.free(k);h=H.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.Ri();for(f=f.iterator;f.next();){var l=f.value;if(l.isVisible()&&l.fromPort!l.toPort){var m= l.fromPort=a.port||null!l.fromNode&&l.fromNode.Ud(d),n=l.computeSpot(m,a.port);if(n.uf()&&(m=m?l.toPort:l.fromPort,null!m)){var p=m.part;if(null!p){var r=p.findVisibleNode();null!r&&r!p&&(p=r,m=p.port);m=l.computeOtherPoint(p,m);p=h.Sa(m);p-=k;0>p&&(p+=360);n=Np(e,n,p,l.isOrthogonal);0=n?(n=4,180<p&&(p-=360)):n=90=n?8:180=n?2:1;r=a.Vd[g];void 0=r?(r=new Op(l,p,n),a.Vd[g]=r):(r.link=l,r.angle=p,r.xc=n);r.Bv.set(m);g++}}}}H.free(h);a.Vd.sort(pp.prototype.l);k=a.Vd.length;d=-1;for(g= h=0;g<k;g++)f=a.Vd[g],void 0!f&&(f.xc!d&&(d=f.xc,h=0),f.fq=h,h++);d=-1;h=0;for(g=k-1;0<=g;g--)k=a.Vd[g],void 0!k&&(k.xc!d&&(d=k.xc,h=k.fq+1),k.$l=h);g=a.Vd;n=a.port;d=a.node.portSpreading;h=H.alloc();k=H.alloc();f=H.alloc();l=H.alloc();n.ga(xc,h);n.ga(zc,k);n.ga(Hc,f);n.ga(Fc,l);r=p=m=n=0;if(d=Zo)for(var q=0;q<g.length;q++){var u=g[q];if(null!u){var v=u.link.computeThickness();switch(u.xc){case 8:p+=v;break;case 2:r+=v;break;case 1:n+=v;break;default:case 4:m+=v}}}var w=q=0,y=1,z=u=0; for(v=0;v<g.length;v++){var A=g[v];if(null!A){if(q!A.xc){q=A.xc;switch(q){case 8:var C=f;w=l;break;case 2:C=l;w=h;break;case 1:C=h;w=k;break;default:case 4:C=k,w=f}u=w.x-C.x;z=w.y-C.y;switch(q){case 8:p>Math.abs(u)?(y=Math.abs(u)/p,p=Math.abs(u)):y=1;break;case 2:r>Math.abs(z)?(y=Math.abs(z)/r,r=Math.abs(z)):y=1;break;case 1:n>Math.abs(u)?(y=Math.abs(u)/n,n=Math.abs(u)):y=1;break;default:case 4:m>Math.abs(z)?(y=Math.abs(z)/m,m=Math.abs(z)):y=1}w=0}var J=A.lq;if(d=Zo){A=A.link.computeThickness(); A*=y;J.set(C);switch(q){case 8:J.x=C.x+u/2+p/2-w-A/2;break;case 2:J.y=C.y+z/2+r/2-w-A/2;break;case 1:J.x=C.x+u/2-n/2+w+A/2;break;default:case 4:J.y=C.y+z/2-m/2+w+A/2}w+=A}else}}H.free(h);H.free(k);H.free(f);H.free(l);C=a.Vd;for(g=0;g<C.length;g++)d=C[g],null!d&&(d.bv=a.computeEndSegmentLength(d));a.nq=c;M.free(e)}c=a.Vd}for(a=0;a<c.length;a++)if(e=c[a],null!e&&e.link=b)return e;return null} pp.prototype.l=function(a,b);pp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,wc,b.fromPort=this.port),d=a.fq;if(0>d)return c;var e=a.$l;if(1>=e||!b.isOrthogonal)return c;b=a.Bv;var f=a.lq;if(2=a.xc||8=a.xc)d=e-1-d;return((a=2=a.xc||4=a.xc)?b.y<f.y:b.x<f.x)?c+8*d:(a?b.y=f.y:b.x=f.x)?c:c+8*(e-1-d)};pp.className="Knot"; function Op(a,b,c){this.link=a;this.angle=b;this.xc=c;this.Bv=new H;this.$l=this.fq=0;this.lq=new H;this.bv=0}Op.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.xc.toString()+":"+this.fq.toString()+"/"+this.$l.toString()+" "+this.lq.toString()+" "+this.bv.toString()+" "+this.Bv.toString()};Op.className="LinkInfo";function cl() cl.prototype.copy=function(){var a=new cl;a.Vg=this.Vg.G();a.uh=this.uh.G();a.Tg=this.Tg;a.sh=this.sh;a.Ug=this.Ug;a.th=this.th;a.Dn=this.Dn;a.Ip=this.Ip;a.En=this.En;a.Jp=this.Jp;return a};cl.className="LinkSettings";function Di(){Za(this);this.I=this.B=null;this.ii=this.Sn=!0;this.Yn=!1;this.Tm=(new H(0,0)).freeze();this.Vn=!0;this.Un=null;this.Aw=;this.u=null;this.Xn=!1;this.l=null} Di.prototype.cloneProtected=function(a);Di.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};Di.prototype.cb=function();Di.prototype.toString=function(){var a=Ha(this.constructor);a+="(";null!==this.group&&(a+=" in "+this.group);null!==this.diagram&&(a+=" for "+this.diagram);return a+")"}; Di.prototype.C=function(){if(this.isValidLayout)}};Di.prototype.createNetwork=function(){return new Pp(this)};Di.prototype.makeNetwork=function(a){var b=this.createNetwork();a instanceof P?(b.tg(a.nodes,!0),b.tg(a.links,!0)):a instanceof S?b.tg(a.memberParts):b.tg(a.iterator);return b}; Di.prototype.updateParts=function()this.isValidLayout=!0;try{null!==a&&a.ta("Layout"),this.commitLayout()}finally{null!==a&&a.Ua("Layout")}};Di.prototype.commitLayout=function(){if(null!==this.network){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}}; Di.prototype.doLayout=function(a){var b=new F;a instanceof P?(Qp(this,b,a.nodes,!0,this.pk,!0,!1,!0),Qp(this,b,a.parts,!0,this.pk,!0,!1,!0)):a instanceof S?Qp(this,b,a.memberParts,!1,this.pk,!0,!1,!0):b.addAll(a.iterator);var c=b.count;if(0<c){a=this.diagram;null!==a&&a.ta("Layout");c=Math.ceil(Math.sqrt(c));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var d=this.arrangementOrigin.x,e=d,f=this.arrangementOrigin.y,g=0,h=0;for(b=b.iterator;b.next();){var k=b.value;Rp(k);var l=k.measuredBounds, m=l.width;l=l.height;k.moveTo(e,f);k instanceof S&&(k.pk=!1);e+=Math.max(m,50)+20;h=Math.max(h,Math.max(l,50));g>=c-1?(g=0,e=d,f+=h+20,h=0):g++}null!==a&&a.Ua("Layout")}this.isValidLayout=!0};Di.prototype.pk=function(a){return!a.location.v()||a instanceof S&&a.pk?!0:!1}; function Qp(a,b,c,d,e,f,g,h){for(c=c.iterator;c.next();){var k=c.value;d&&!k.isTopLevel||null!e&&!e(k)||!k.canLayout()||(f&&k instanceof U?k.isLinkLabel||(k instanceof S?null=k.layout?Qp(a,b,k.memberParts,!1,e,f,g,h):(Rp(k),b.add(k)):(Rp(k),b.add(k))):g&&k instanceof Q?b.add(k):!h||!k.Ub()||k instanceof U||(Rp(k),b.add(k)))}}function Rp(a) Di.prototype.Ti=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.nx=function(a){var b=new F;a instanceof P?(Qp(this,b,a.nodes,!0,null,!0,!0,!0),Qp(this,b,a.links,!0,null,!0,!0,!0),Qp(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof S?Qp(this,b,a.memberParts,!1,null,!0,!0,!0):Qp(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Di.prototype.initialOrigin=function(a)return a}; ma.Object.defineProperties(Di.prototype,{diagram:{get:function(),set:function(a)},group:{get:function(),set:function(a){this.I!==a&&(this.I=a,null!==a&&(this.B=a.diagram))}},isOngoing:{get:function(),set:function(a){this.Sn!==a&&(this.Sn=a)}},isInitial:{get:function(),set:function(a)}, isViewportSized:{get:function(),set:function(a){this.Yn!==a&&(this.Yn=a)&&this.C()}},isRouting:{get:function(),set:function(a){this.Vn!==a&&(this.Vn=a)}},isRealtime:{get:function(),set:function(a){this.Un!==a&&(this.Un=a)}},isValidLayout:{get:function(),set:function(a){this.Xn!a&&(this.Xn=a,a||(a=this.diagram,null! a&&(a.Ig=!0)))}},network:{get:function(),set:function(a){this.l!==a&&(this.l=a,null!==a&&(a.layout=this))}},boundsComputation:{get:function(),set:function(a){this.u!a&&(this.u=a,this.C())}},arrangementOrigin:{get:function(),set:function(a){this.Tm.A(a)||(this.Tm.assign(a),this.C())}}});Di.prototype.collectParts=Di.prototype.nx;Di.prototype.getLayoutBounds=Di.prototype.Ti; Di.prototype.invalidateLayout=Di.prototype.C;Di.className="Layout";function Pp(a){Za(this);this.hc=a;this.jf=new F;this.be=new F;this.ot=new G;this.jt=new G}Pp.prototype.clear=function(){if(this.jf)for(var a=this.jf.iterator;a.next();)a.value.clear();if(this.be)for(a=this.be.iterator;a.next();)a.value.clear();this.jf=new F;this.be=new F;this.ot=new G;this.jt=new G}; Pp.prototype.toString=function(a){void 0=a&&(a=0);var b="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":);if(0>=a)return b;b+=" vertexes: "+this.jf.count+" edges: "+this.be.count;if(1<a){for(var c=this.jf.iterator;c.next();)b+=" "+c.value.toString(a-1);for(c=this.be.iterator;c.next();)b+=" "+c.value.toString(a-1)}return b};Pp.prototype.createVertex=function(){return new Sp(this)};Pp.prototype.createEdge=function(){return new Tp(this)}; Pp.prototype.tg=function(a,b,c){if(null!a){void 0=b&&(b=!1);void 0=c&&(c=null);null=c&&(c=function(a){if(a instanceof U)return!a.isLinkLabel;if(a instanceof Q)return!1});for(a=a.iterator;a.next();){var d=a.value;if(d instanceof U&&(!b||d.isTopLevel)&&d.canLayout()&&c(d))if(d instanceof S&&null=d.layout)this.tg(d.memberParts,!1);else if(null=this.Qi(d)){var e=this.createVertex();e.node= d;this.zh(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof Q&&(!b||d.isTopLevel)&&d.canLayout()&&c(d)&&null=this.Zp(d))}};Pp.prototype.findGroupVertex=function(a){if(null=a)return null;var b=a.findVisibleNode();if(null=b)return null;a=this.Qi(b);if(null!a)return a;for(b=b.containingGroup;null!b;){a=this.Qi(b);if(null!a)return a;b=b.containingGroup}return null}; t=Pp.prototype;t.zh=function(a){if(null!a){this.jf.add(a);var b=a.node;null!b&&this.ot.add(b,a);a.network=this}};t.Wl=function(a){if(null=a)return null;var b=this.Qi(a);null=b&&(b=this.createVertex(),b.node=a,this.zh(b));return b};t.av=function(a){if(null!a&&Up(this,a)){for(var b=a.Dg,c=b.count-1;0<=c;c--)b=a.ug;for(a=b.count-1;0<=a;a--)c=b.L(a),this.$j(c)}}; function Up(a,b){if(null=b)return!1;var c=a.jf.remove(b);c&&(b=b.node,null!b&&a.ot.remove(b));return c}t.Qy=function(a){null!a&&(a=this.Qi(a),null!a&&this.av(a))};t.Qi=function(a);t.Sp=function(a){if(null!a){Vp(this,a);var b=a.toVertex;null!b&&b.Qu(a);b=a.fromVertex;null!b&&b.Ou(a)}};function Vp(a,b){if(null!b){a.be.add(b);var c=b.link;null!c&&null=a.Zp(c)&&a.jt.add(c,b);b.network=a}} t.wy=function(a){if(null=a)return null;var b=a.fromNode,c=a.toNode,d=this.Zp(a);null=d?(d=this.createEdge(),d.link=a,null!b&&(d.fromVertex=this.Wl(b)),null!=c&&(d.toVertex=this.Wl(c)),this.Sp(d)):(null!b?d.fromVertex=this.Wl(b):d.fromVertex=null,null!c?d.toVertex=this.Wl(c):d.toVertex=null);return d};t.$j=function(a){if(null!a)}; function Wp(a,b){null!b&&a.be.remove(b)&&(b=b.link,null!b&&a.jt.remove(b))}t.Py=function(a){null!a&&(a=this.Zp(a),null!a&&this.$j(a))};t.Zp=function(a);t.hk=function(a,b,c){if(null=a||null=b)return null;if(a.network=this&&b.network=this)return null};t.ym=function(a){if(null!a)}; t.Xp=function(){for(var a=Da(),b=this.be.iterator;b.next();)b=a.length;for(c=0;c<b;c++)this.$j(a[c]);Fa(a)};Pp.prototype.deleteArtificialVertexes=function(){for(var a=Da(),b=this.jf.iterator;b.next();)c=a.length;for(b=0;b<c;b++)this.av(a[b]);b=Da();for(c=this.be.iterator;c.next();)c=b.length;for(d=0;d<c;d++)this.$j(b[d]);Fa(a);Fa(b)}; function Xp(a){for(var b=Da(),c=a.be.iterator;c.next();)c=b.length;for(d=0;d<c;d++)a.$j(b[d]);Fa(b)} Pp.prototype.ay=function(a){void 0=a&&(a=!0);a&&(this.deleteArtificialVertexes(),Xp(this),this.Xp());a=new E;for(var b=!0;b;)}}a.sort(function(a,b));return a}; function Yp(a,b,c){if(null!c&&c.network!b){Up(a,c);b.zh(c);for(var d=c.sourceEdges;d.next();)for(d=c.destinationEdges;d.next();)c=d.value,c.network!b&&(Wp(a,c),Vp(b,c),Yp(a,b,c.toVertex))}}Pp.prototype.Vy=function(){for(var a=new F,b=this.jf.iterator;b.next();)a.add(b.value.node);for(b=this.be.iterator;b.next();)a.add(b.value.link);return a}; ma.Object.defineProperties(Pp.prototype,{layout:{get:function(),set:function(a){null!a&&(this.hc=a)}},vertexes:{get:function()},edges:{get:function()}});Pp.prototype.findAllParts=Pp.prototype.Vy;Pp.prototype.splitIntoSubNetworks=Pp.prototype.ay;Pp.prototype.deleteSelfEdges=Pp.prototype.Xp;Pp.prototype.reverseEdge=Pp.prototype.ym;Pp.prototype.linkVertexes=Pp.prototype.hk; Pp.prototype.findEdge=Pp.prototype.Zp;Pp.prototype.deleteLink=Pp.prototype.Py;Pp.prototype.deleteEdge=Pp.prototype.$j;Pp.prototype.addLink=Pp.prototype.wy;Pp.prototype.addEdge=Pp.prototype.Sp;Pp.prototype.findVertex=Pp.prototype.Qi;Pp.prototype.deleteNode=Pp.prototype.Qy;Pp.prototype.deleteVertex=Pp.prototype.av;Pp.prototype.addNode=Pp.prototype.Wl;Pp.prototype.addVertex=Pp.prototype.zh;Pp.prototype.addParts=Pp.prototype.tg;Pp.className="LayoutNetwork"; function Sp(a){Za(this);this.Vc=a;this.l=(new M(0,0,10,10)).freeze();this.u=(new H(5,5)).freeze();this.ti=this.hb=null;this.Dg=new E;this.ug=new E}Sp.prototype.clear=function(){this.ti=this.hb=null;this.Dg=new E;this.ug=new E}; Sp.prototype.toString=function(a){void 0=a&&(a=0);var b="LayoutVertex#"+lb(this);if(0<a&&(b+=null!this.node?"("+this.node.toString()+")":,1<a)){a=;for(var c=!0,d=this.Dg.iterator;d.next();)e=;c=!0;for(d=this.ug.iterator;d.next();)b+=" sources: "+a+" destinations: "+e}return b}; Sp.prototype.commit=function()else if(a=this.node,null!==a){b=this.bounds;if(!(a instanceof S))M.free(c)}a.moveTo(b.x,b.y)}};Sp.prototype.Qu=function(a){null!==a&&(this.Dg.contains(a)||this.Dg.add(a))}; Sp.prototype.$u=function(a){null!==a&&this.Dg.remove(a)};Sp.prototype.Ou=function(a){null!==a&&(this.ug.contains(a)||this.ug.add(a))};Sp.prototype.Zu=function(a){null!==a&&this.ug.remove(a)};function Zp(a,b){a=a.ti;b=b.ti;return a?b?(a=a.text,b=b.text,a<b?-1:a>b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(Sp.prototype,{sourceEdgesArrayAccess:{get:function()},destinationEdgesArrayAccess:{get:function()},data:{get:function(),set:function(a)}},node:{get:function(), set:function(a){if(this.ti!==a){this.ti=a;a.zb();var b=this.network.layout,c=M.alloc(),d=b.Ti(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.l.h(b,e,f,d);M.free(c);if(!(a instanceof S)&&(a=a.locationObject.ga(Bc),a.v())){this.u.h(a.x-b,a.y-e);return}this.u.h(f/2,d/2)}}},bounds:{get:function(),set:function(a){this.l.A(a)||this.l.assign(a)}},focus:{get:function(),set:function(a){this.u.A(a)|| this.u.assign(a)}},centerX:{get:function(){return this.l.x+this.u.x},set:function(a)},centerY:{get:function(){return this.l.y+this.u.y},set:function(a)},focusX:{get:function(),set:function(a)},focusY:{ get:function(),set:function(a)},x:{get:function(),set:function(a)},y:{get:function(),set:function(a)},width:{get:function(),set:function(a){var b=this.l;b.width!==a&&(b.ea(),b.width= a,b.freeze())}},height:{get:function(),set:function(a)},network:{get:function(),set:function(a)},sourceVertexes:{get:function(){for(var a=new F,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new F,b= this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new F,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{get:function()},destinationEdges:{get:function()},edges:{get:function(){for(var a= new E,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{get:function(){return this.Dg.count+this.ug.count}}});Sp.prototype.deleteDestinationEdge=Sp.prototype.Zu;Sp.prototype.addDestinationEdge=Sp.prototype.Ou;Sp.prototype.deleteSourceEdge=Sp.prototype.$u;Sp.prototype.addSourceEdge=Sp.prototype.Qu;Sp.className="LayoutVertex";Sp.standardComparer=Zp; Sp.smartComparer=function(a,b){if(null!==a){if(null!==b){a=a.ti;var c=b.ti;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<b.length;c++)if(!a[c]&&void 0!a[c]){var d=parseFloat(b[c]),e=parseFloat(a[c]);if(isNaN(d))if(isNaN(e)){if(0!b[c].localeCompare(a[c]))return b[c].localeCompare(a[c])}else return 1;else{if(isNaN(e))return-1;if(0!=d-e)return d- e}}else if(!==b[c])return 1;return!a[c]&&void 0!a[c]?-1:0}return 1}return null!c?-1:0}return 1}return null!b?-1:0};function Tp(a){Za(this);this.kd=a;this.pg=this.Qf=this.rl=this.hb=null}Tp.prototype.clear=function();Tp.prototype.toString=function(a){void 0=a&&(a=0);var b="LayoutEdge#"+lb(this);0<a&&(b+=null!this.rl?"("+this.rl.toString()+")":"",1<a&&(b+=" "+(this.Qf?this.Qf.toString():"null")+" --x3e "+(this.pg?this.pg.toString():"null")));return b}; Tp.prototype.ym=function();Tp.prototype.commit=function();Tp.prototype.Ex=function(a); ma.Object.defineProperties(Tp.prototype,{network:{get:function(),set:function(a)},data:{get:function(),set:function(a){this.hb!a&&(this.hb=a)}},link:{get:function(),set:function(a){this.rl!a&&(this.rl=a)}},fromVertex:{get:function(),set:function(a){this.Qf!a&&(this.Qf=a)}},toVertex:{ get:function(),set:function(a){this.pg!a&&(this.pg=a)}}});Tp.prototype.getOtherVertex=Tp.prototype.Ex;Tp.className="LayoutEdge";function Lk(){Di.call(this);this.isViewportSized=!0;this.Pp=this.Qp=NaN;this.Lg=(new Kb(NaN,NaN)).freeze();this.af=(new Kb(10,10)).freeze();this.wb=$p;this.Bb=aq;this.Pc=bq;this.Jc=cq}la(Lk,Di); Lk.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Qp=this.Qp;a.Pp=this.Pp;a.Lg.assign(this.Lg);a.af.assign(this.af);a.wb=this.wb;a.Bb=this.Bb;a.Pc=this.Pc;a.Jc=this.Jc};Lk.prototype.cb=function(a){a.classType=Lk?a=bq||a=dq||a=eq||a=fq?this.sorting=a:a=aq||a=gq?this.arrangement=a:a$p||a=hq?this.alignment=a:B("Unknown enum value: "+a):Di.prototype.cb.call(this,a)}; Lk.prototype.doLayout=function(a){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var b=this.nx(a);a=this.diagram;for(var c=b.copy().iterator;c.next();){var d=c.value;if(!d.Fh()||null=d.fromNode&&null=d.toNode){if(d.zb(),d instanceof S)for(d=d.memberParts;d.next();)b.remove(d.value)}else b.remove(d)}var e=b.ma();if(0!e.length){switch(this.sorting){case fq:e.reverse();break;case bq:e.sort(this.comparer);break;case dq:e.sort(this.comparer),e.reverse()}var f=this.wrappingColumn; isNaN(f)&&(f=0);var g=this.wrappingWidth;isNaN(g)&&null!a?(b=a.padding,g=Math.max(a.viewportBounds.width-b.left-b.right,0)):g=Math.max(this.wrappingWidth,0);0>=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!a&&a.ta("Layout");d=[];switch(this.alignment)m=Math.max(m+h,1);n=Math.max(this.cellSize.height, 1);if(!isFinite(n))for(p=n=0;p<e.length;p++)n=Math.max(n+k,1);p=this.arrangement;for(var q=r=this.arrangementOrigin.x,u=this.arrangementOrigin.y,v=0,w=0,y=0;y<e.length;y++)if(0<f&&v>f-1||0<g&&0<v&&K-r>g)d.push(new M(0,u,g+h,w)),v=0,q=r,u+=w,w=0;w=Math.max(w,J);switch(p){case gq:A=-A.width;break;default:A= 0}z.moveTo(q+A,u);switch(p)v++}d.push(new M(0,u,g+h,w));M.free(l);break;case $p:k=g;m=f;n=b;p=c;g=M.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=H.alloc();for(q=0;q<e.length;q++)w=e[q],v=this.Ti(w,g),w=w.rf(w.locationObject,w.locationSpot,h),l=Math.max(l,w.x),u=Math.max(u,v.width-w.x),f=Math.max(f,w.y);q=this.arrangement;switch(q){case gq:l+=n;break;default:u+=n}r=isFinite(r)?Math.max(r+n,1):Math.max(l+u,1);var L=w=this.arrangementOrigin.x;y=this.arrangementOrigin.y; u=0;k>=l&&(k-=l);l=z=0;C=Math.max(this.cellSize.height,1);A=f=0;J=!0;v=H.alloc();for(K=0;K<e.length;K++)else switch(q)switch(q)if(0<m&&u>m-1||0<k&&0<u&&pa>k){d.push(new M(0,J?y-f:y,k+n,A+f+p));for(L=0;L<u&&K!u;L++)A+=p;y=J?y+A:y+(A+f);u=A=f=0;L=w;J=!1}L=w&&(l=q=gq?Math.max(l,R.width-ea.x):Math.min(l,-ea.x));f=Math.max(f,ea.y);A=Math.max(A,R.height-ea.y);isFinite(C)&&(A=Math.max(A,Math.max(R.height,C)-ea.y));J?V.moveTo(L-ea.x,y-ea.y):V.moveTo(L-ea.x,y);switch(q)u++}d.push(new M(0,y,k+n,(J?A:A+f)+p));if(e.length!u)for(k=0;k<u;k++)m=e[e.length-u+k],n=m.rf(m.locationObject,m.locationSpot,h),m.moveTo(m.position.x,m.position.y+f-n.y);H.free(h);H.free(v);if(q=gq)for(e=0;e<d.length;e++)f=d[e],f.width+=l,f.x-=l;else for(e=0;e<d.length;e++)f=d[e],f.x>l&&(f.width+=f.x-l,f.x=l);M.free(g)}for(h=f=g=e=0;h<d.length;h++)k=d[h],e=Math.min(e,k.x),g=Math.min(g,k.y),f=Math.max(f,k.x+k.width);this.arrangement=gq?this.commitLayers(d,new H(e+b/2-(f+e),g-c/2)):this.commitLayers(d, new H(e-b/2,g-c/2));null!a&&a.Ua("Layout");this.isValidLayout=!0}};Lk.prototype.commitLayers=function();function cq(a,b){a=a.text;b=b.text;return a<b?-1:a>b?1:0} ma.Object.defineProperties(Lk.prototype,{wrappingWidth:{get:function(),set:function(a){this.Qp!a&&(0<a||isNaN(a))&&(this.Qp=a,this.isViewportSized=isNaN(a),this.C())}},wrappingColumn:{get:function(),set:function(a){this.Pp!a&&(0<a||isNaN(a))&&(this.Pp=a,this.C())}},cellSize:{get:function(),set:function(a){this.Lg.A(a)||(this.Lg.assign(a),this.C())}},spacing:{ get:function(),set:function(a){this.af.A(a)||(this.af.assign(a),this.C())}},alignment:{get:function(),set:function(a)},arrangement:{get:function(),set:function(a)},sorting:{get:function(),set:function(a){this.Pc=a||a!eq&&a!fq&& a!bq&&a!dq||(this.Pc=a,this.C())}},comparer:{get:function(),set:function(a){this.Jc!a&&(this.Jc=a,this.C())}}});var hq=new D(Lk,"Position",0),$p=new D(Lk,"Location",1),aq=new D(Lk,"LeftToRight",2),gq=new D(Lk,"RightToLeft",3),eq=new D(Lk,"Forward",4),fq=new D(Lk,"Reverse",5),bq=new D(Lk,"Ascending",6),dq=new D(Lk,"Descending",7);Lk.className="GridLayout";Lk.standardComparer=cq; Lk.smartComparer=function(a,b){if(null!a){if(null!b){a=a.text.toLocaleLowerCase().split(/([+-]?[.]?d+(?:.d*)?(?:e[+-]?d+)?)/);b=b.text.toLocaleLowerCase().split(/([+-]?[.]?d+(?:.d*)?(?:e[+-]?d+)?)/);for(var c=0;c<a.length;c++)if(!==b[c]&&void 0!==b[c]){var d=parseFloat(a[c]),e=parseFloat(b[c]);if(isNaN(d))if(isNaN(e)){if(0!==a[c].localeCompare(b[c]))return a[c].localeCompare(b[c])}else return 1;else{if(isNaN(e))return-1;if(0!==d-e)return d-e}}else if(!a[c])return 1;return""! b[c]&&void 0!b[c]?-1:0}return 1}return null!b?-1:0};Lk.Position=hq;Lk.Location=$p;Lk.LeftToRight=aq;Lk.RightToLeft=gq;Lk.Forward=eq;Lk.Reverse=fq;Lk.Ascending=bq;Lk.Descending=dq;function yi(){this.Go=new F;this.io=new F;this.Ca=new F;this.Je=new G;this.Ie=new G;this.sj=new G;this.B=null;this.Iq=!1}t=yi.prototype;t.clear=function(){this.Go.clear();this.io.clear();this.Ca.clear();this.Je.clear();this.Ie.clear();this.sj.clear()};t.Wd=function(a); t.Vi=function(a){if(a instanceof U){if(this.Go.add(a),a instanceof S)}else a instanceof Q?this.io.add(a):a instanceof De||this.Ca.add(a);b=a.data;null=b||a instanceof De||(a instanceof Q?this.Ie.add(b,a):this.Je.add(b,a))}; t.Fc=function(a){a.Tj();if(a instanceof U){if(this.Go.remove(a),a instanceof S)}else a instanceof Q?this.io.remove(a):a instanceof De||this.Ca.remove(a);b=a.data;null=b||a instanceof De||(a instanceof Q?this.Ie.remove(b):this.Je.remove(b))}; t.wd=function(){for(var a=this.B.nodeTemplateMap.iterator;a.next();){var b=a.value,c=a.key;(!b.Ub()||b instanceof S)&&B(‘Invalid node template in Diagram.nodeTemplateMap: template for "‘+c+‘" must be a Node or a simple Part, not a Group or Link: ‘+b)}for(a=this.B.groupTemplateMap.iterator;a.next();)b=a.value,c=a.key,b instanceof S||B(‘Invalid group template in Diagram.groupTemplateMap: template for "‘+c+‘" must be a Group, not a normal Node or Link: ‘+b);for(a=this.B.linkTemplateMap.iterator;a.next();)b= a.value,c=a.key,b instanceof Q||B(‘Invalid link template in Diagram.linkTemplateMap: template for "‘+c+‘" must be a Link, not a normal Node or simple Part: ‘+b);a=Da();for(b=this.B.selection.iterator;b.next();)(c=b.value.data)&&a.push(c);b=Da();for(c=this.B.highlighteds.iterator;c.next();)c=Da();for(d=this.nodes.iterator;d.next();)for(d=this.links.iterator;d.next();)e=d.value,null!e.data&&(c.push(e.data), c.push(e.location));for(d=this.parts.iterator;d.next();)e=d.value,null!e.data&&(c.push(e.data),c.push(e.location));this.removeAllModeledParts();this.addAllModeledParts();for(d=0;d<a.length;d++)e=this.vc(a[d]),null!e&&(e.isSelected=!0);for(d=0;d<b.length;d++)e=this.vc(b[d]),null!e&&(e.isHighlighted=!0);for(d=0;d<c.length;d+=2)e=this.vc(c[d]),null!e&&(e.location=c[d+1]);Fa(a);Fa(b);Fa(c)};yi.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)}; yi.prototype.addModeledParts=function(a,b));a.forEach(function(a){d.sb(a)&&c.resolveReferencesForData(a)});!1!b&&ok(this.diagram,!1)}; function iq(a,b,c){if(void 0!b&&null!b&&!a.diagram.undoManager.isUndoingRedoing&&!a.Je.contains(b)){void 0=c&&(c=!0);a:{if(void 0!b&&null!b&&!a.B.undoManager.isUndoingRedoing&&!a.Je.contains(b))}d=null}null!d&&c&&a.resolveReferencesForData(b)}} yi.prototype.insertLink=function();yi.prototype.resolveReferencesForData=function();yi.prototype.Zs=function(a){return this.B.model.Zs(a)}; function Ko(a,b,c){a=a.B;var d=a.model;d.ek()&&d.tv(b)?(b=a.groupTemplateMap.H(c),null=b&&(b=a.groupTemplateMap.H(""),null=b&&(jq||(jq=!0,wa(‘No Group template found for category "‘+c+‘"‘),wa(" Using default group template")),b=a.xw))):(b=a.nodeTemplateMap.H(c),null=b&&(b=a.nodeTemplateMap.H(""),null=b&&(kq||(kq=!0,wa(‘No Node template found for category "‘+c+‘"‘),wa(" Using default node template")),b=a.zw)));return b}yi.prototype.getLinkCategoryForData=function(){return""}; yi.prototype.setLinkCategoryForData=function();yi.prototype.setFromNodeForLink=function();yi.prototype.setToNodeForLink=function();yi.prototype.findLinkTemplateForCategory=function(a){var b=this.B.linkTemplateMap.H(a);null=b&&(b=this.B.linkTemplateMap.H(""),null=b&&(lq||(lq=!0,wa(‘No Link template found for category "‘+a+‘"‘),wa(" Using default link template")),b=this.B.yw));return b};yi.prototype.removeAllModeledParts=function(){this.ut(this.diagram.model.nodeDataArray)}; yi.prototype.ut=function(a))};yi.prototype.vq=function(a);yi.prototype.unresolveReferencesForPart=function();yi.prototype.removeDataForLink=function();yi.prototype.findPartForKey=function(a){if(null=a||void 0=a)return null;a=this.B.model.Ib(a);return null!a?this.Je.H(a):null}; yi.prototype.Jb=function(a){if(null=a||void 0=a)return null;a=this.B.model.Ib(a);if(null=a)return null;a=this.Je.H(a);return a instanceof U?a:null};yi.prototype.findLinkForKey=function();t=yi.prototype;t.vc=function(a){if(null=a)return null;var b=this.Je.H(a);return null!b?b:b=this.Ie.H(a)};t.Mi=function(a){if(null=a)return null;a=this.Je.H(a);return a instanceof U?a:null};t.uc=function(a); t.Ws=function(a){for(var b=0;b<arguments.length;b);b=new F;for(var c=this.Go.iterator;c.next();)}}return b.iterator};t.Vs=function(a){for(var b=0;b<arguments.length;b);b=new F;for(var c=this.io.iterator;c.next();)}}return b.iterator}; function mq(a,b,c){for(var d in c){var e=b[d],f=c[d];if(za(f)){if(!za(e)||e.length<f.length)return!1;for(var g=0;g<e.length;g){var h=f[g];if(void 0!==h&&!nq(a,e[g],h))return!1}}else if(!nq(a,e,f))return!1}return!0}function nq(a,b,c){if("function"typeof c){if(!c(b))return!1}else if(c instanceof RegExp){if(!b||!c.test(b.toString()))return!1}else if(ya(b)&&ya(c)){if(!mq(a,b,c))return!1}else if(b!c)return!1;return!0} yi.prototype.doModelChanged=function(a){if(this.B){var b=this.B;if(a.modelb.model){var c=a.change;b.doModelChanged(a);if(b.aa){b.aa=!1;try{var d=a.modelChange;if(""!d)if(c=re){if("nodeCategory"d){var e=this.vc(a.object),f=a.newValue;null!==e&&"string"typeof f&&(e.category=f)}else"nodeDataArray"=d&&(this.ut(a.oldValue),this.addModeledParts(a.newValue));b.isModified=!0}else if(cte)else if(cue){var h=a.oldValue; "nodeDataArray"=d&&ya(h)&&this.vq(h);b.isModified=!0}else c=se&&("SourceChanged"d?null!==a.object?this.updateDataBindings(a.object,a.propertyName):(this.Eq(),this.updateAllTargetBindings()):"ModelDisplaced"=d&&this.wd());else if(cre)else this.updateDataBindings(l,k);b.isModified=!0}else if(c=te||c=ue){var m=a.change=te,n=m?a.newParam:a.oldParam, p=m?a.newValue:a.oldValue,r=this.sj.H(a.object);if(Array.isArray(r))for(a=0;a<r.length;a){var q=r[a];if(m)hn(q,p,n);else if(!(0>n))}b.isModified=!0}}finally}}}};yi.prototype.updateAllTargetBindings=function(a){void 0=a&&(a=);for(var b=this.parts.iterator;b.next();)b.value.Aa(a);for(b=this.nodes.iterator;b.next();)b.value.Aa(a);for(b=this.links.iterator;b.next();)b.value.Aa(a)}; yi.prototype.Eq=function(){for(var a=this.B.model,b=new F,c=a.nodeDataArray,d=0;d<c.length;d++)b.add(c[d]);var e=[];this.nodes.each(function(a));this.parts.each(function(a));e.forEach(function(b){oq(a,b,!1)});for(d=0;d<c.length;d++)this.refreshDataBoundLinks();for(c=this.parts.iterator;c.next();)c.value.updateRelationshipsFromData();for(c=this.nodes.iterator;c.next();)c.value.updateRelationshipsFromData(); for(c=this.links.iterator;c.next();)c.value.updateRelationshipsFromData()};yi.prototype.refreshDataBoundLinks=function();yi.prototype.updateRelationshipsFromData=function(); yi.prototype.updateDataBindings=function(a,b){if("string"==typeof b)if(null!==c)break}if(null!c){for(d=0;d<c.length;d++)c[d].Aa(b);Fa(c)}}athis.diagram.model.modelData&&this.updateAllTargetBindings(b)}}; function Gj(a,b)}}function Jj(a,b,c){Ej(b,function(a));var d=b.li;if(za(d))}} yi.prototype.Yj=function(a,b,c){var d=new G;if(za(a))for(var e=0;e<a.length;e++)qq(this,a[e],b,d,c);else for(a=a.iterator;a.next();)qq(this,a.value,b,d,c);if(null!==b){c=b.model;a=b.toolManager.findTool("Dragging");a=null!==a?a.dragOptions.dragsLink:b.Mk.dragsLink;e=new F;for(var f=new G,g=d.iterator;g.next();){var h=g.value;if(h instanceof Q)a||null!==h.fromNode&&null!==h.toNode||e.add(h);else if(h instanceof U&&null!==h.data&&c.km()){var k=h;h=g.key;var l=h.yg();null!==l&&(l=d.H(l),null!==l?(c.Be(k.data, c.ja(l.data)),k=b.uc(k.data),h=h.Pi(),null!==h&&null!==k&&f.add(h,k)):c.Be(k.data,void 0))}}0<e.count&&b.vt(e,!1);if(0<f.count)for(c=f.iterator;c.next();)d.add(c.key,c.value)}if(null!==b&&null!==this.B&&(b=b.model,c=b.afterCopyFunction,null!c)){var m=new G;d.each(function(a){null!a.key.data&&m.add(a.key.data,a.value.data)});c(m,b,this.B.model)}for(b=d.iterator;b.next();)b.value.Aa();return d}; function qq(a,b,c,d,e){if(null=b||e&&!b.canCopy())return null;if(d.contains(b))return d.H(b);var f=a.copyPartData(b,c);if(!(f instanceof T))return null;f.isSelected=!1;f.isHighlighted=!1;d.add(b,f);if(b instanceof U){for(var g=b.linksConnected;g.next();)h.toNode=b&&(h=d.H(h),null!h&&(h.toNode=f))}if(b instanceof S&&f instanceof S)for(b=b.memberParts;b.next();)g=qq(a,b.value,c,d,e),g instanceof Q||null=g||(g.containingGroup= f)}else if(b instanceof Q&&f instanceof Q)for(g=b.fromNode,null!==g&&(g=d.H(g),null!==g&&(f.fromNode=g)),g=b.toNode,null!==g&&(g=d.H(g),null!==g&&(f.toNode=g)),b=b.labelNodes;b.next();)g=qq(a,b.value,c,d,e),null!==g&&g instanceof U&&(g.labeledLink=f);return f} yi.prototype.copyPartData=function(a,b){var c=null,d=a.data;if(null!==d&&null!==b){var e=b.model;a instanceof Q||(d=e.copyNodeData(d),ya(d)&&(e.kf(d),c=b.vc(d)))}else zg(a),c=a.copy(),null!==c&&(e=this.B,null!==b?b.add(c):null!==d&&null!==e&&null!==e.commandHandler&&e.commandHandler.copiesClipboardData&&(b=e.model,e=null,c instanceof Q||(e=b.copyNodeData(d)),ya(e)&&(c.data=e)));return c}; ma.Object.defineProperties(yi.prototype,{nodes:{get:function()},links:{get:function()},parts:{get:function()},diagram:{get:function()},addsToTemporaryLayer:{get:function(),set:function(a)}});yi.prototype.updateAllRelationshipsFromData=yi.prototype.Eq; yi.prototype.findLinksByExample=yi.prototype.Vs;yi.prototype.findNodesByExample=yi.prototype.Ws;yi.prototype.findLinkForData=yi.prototype.uc;yi.prototype.findNodeForData=yi.prototype.Mi;yi.prototype.findPartForData=yi.prototype.vc;yi.prototype.findNodeForKey=yi.prototype.Jb;yi.prototype.removeModeledPart=yi.prototype.vq;yi.prototype.removeModeledParts=yi.prototype.ut;yi.prototype.rebuildParts=yi.prototype.wd;var kq=!1,jq=!1,lq=!1;yi.className="PartManager"; function rq(a){yi.apply(this,arguments)}la(rq,yi);rq.prototype.addAllModeledParts=function();rq.prototype.addModeledParts=function(a){yi.prototype.addModeledParts.call(this,a,!1);for(a=this.links.iterator;a.next();)Lo(a.value);ok(this.diagram,!1)};function sq(a,b){b.forEach(function(b){tq(a,b)});ok(a.diagram,!1)} function tq(a,b){if(void 0!==b&&null!==b&&!a.diagram.undoManager.isUndoingRedoing&&!a.Ie.contains(b)){var c=a.getLinkCategoryForData(b),d=a.findLinkTemplateForCategory(c);if(null!==d){zg(d);var e=d.copy();if(null!==e){d=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;e.Hf=c;e.hb=b;c=a.diagram.model;var f=uq(c,b,!0);!f&&(e.fromPortId=f);f=vq(c,b,!0);void 0!f&&(f=a.Jb(f),f instanceof U&&(e.fromNode=f));f=uq(c,b,!1);!f&&(e.toPortId=f);f=vq(c,b,!1);void 0!f&&(f=a.Jb(f), f instanceof U&&(e.toNode=f));c=c.zg(b);Array.isArray(c)&&c.forEach(function(b));a.Iq&&(e.$g="Tool");a.diagram.add(e);e.hb=null;e.data=b;a.diagram.skipsModelSourceBindings=d}}}}rq.prototype.removeAllModeledParts=function();function wq(a,b){b.forEach(function(b){a.vq(b)})}rq.prototype.getLinkCategoryForData=function(a){return this.diagram.model.jv(a)}; rq.prototype.setLinkCategoryForData=function(a,b){return this.diagram.model.xt(a,b)};rq.prototype.setFromNodeForLink=function(a,b);rq.prototype.setToNodeForLink=function(a,b);rq.prototype.removeDataForLink=function(a){this.diagram.model.tm(a.data)}; rq.prototype.findPartForKey=function(a);rq.prototype.findLinkForKey=function(a){if(null=a||void 0=a)return null;a=this.diagram.model.vg(a);return null!==a?this.Ie.H(a):null}; rq.prototype.doModelChanged=function(a)}else if("linkToKey"===e)}else if("linkFromPortId"===e){var l=this.uc(a.object);if(null!==l){var m=a.newValue; "string"===typeof m&&(l.fromPortId=m)}}else if("linkToPortId"===e){var n=this.uc(a.object);if(null!==n){var p=a.newValue;"string"===typeof p&&(n.toPortId=p)}}else if("nodeGroupKey"===e){var r=this.vc(a.object);if(null!==r){var q=a.newValue;if(void 0!==q){var u=this.Jb(q);u instanceof S?r.containingGroup=u:r.containingGroup=null}else r.containingGroup=null}}else if("linkLabelKeys"===e){var v=this.uc(a.object);if(null!==v){var w=a.oldValue,y=a.newValue;Array.isArray(w)&&w.forEach(function(a){a=b.Jb(a); null!==a&&(a.labeledLink=null)});Array.isArray(y)&&y.forEach(function(a))}}else if("linkCategory"===e){var z=this.uc(a.object),A=a.newValue;null!==z&&"string"==typeof A&&(z.category=A)}else"linkDataArray"=e&&(wq(this,a.oldValue),sq(this,a.newValue));c.isModified=!0}else if(dte){var C=a.newValue;if("linkDataArray"===e&&"object"===typeof C&&null!==C)tq(this,C);else if("linkLabelKeys"==e&&xq(C)){var J=this.uc(a.object),K=this.Jb(C);null!==J&&null!K&&(K.labeledLink= J)}c.isModified=!0}else{if(due){var L=a.oldValue;if("linkDataArray"==e&&"object"==typeof L&&null!==L)this.vq(L);else if("linkLabelKeys"=e&&xq(L))c.isModified=!0}}else if(dre){var R=a.propertyName;a.object!==c.model||"linkFromKeyProperty"!==R&&"linkToKeyProperty"!==R&&"linkFromPortIdProperty"!==R&&"linkToPortIdProperty"!==R&&"linkLabelKeysProperty"!==R&&"nodeIsGroupProperty"!==R&&"nodeGroupKeyProperty"!==R&&"linkCategoryProperty"!==R||c.undoManager.isUndoingRedoing|| this.wd();c.isModified=!0}}finally}}}};rq.prototype.refreshDataBoundLinks=function(){var a=this,b=this.diagram.model,c=new F,d=b.linkDataArray;d.forEach(function(a){c.add(a)});var e=[];this.links.each(function(a));e.forEach(function(a){yq(b,a,!1)});d.forEach(function(c))}; rq.prototype.updateRelationshipsFromData=function(a){var b=a.data;if(null!==b){var c=a.diagram;if(null!==c){var d=c.model;if(a instanceof Q)e=(new F).addAll(b);var g=new F;a.labelNodes.each(function(a){null!==a.data&&(a=d.ja(a.data),void 0!a&&g.add(a))});b=g.copy();b.uq(e);e= e.copy();e.uq(g);if(0<b.count||0<e.count)b.each(function(b)),e.each(function(b))}}else!(a instanceof De)&&(b=d.Si(b),b=c.findPartForKey(b),nullb||b instanceof S)&&(a.containingGroup=b)}}}; rq.prototype.resolveReferencesForData=function(a){var b=this.diagram.model,c=b.ja(a);if(void 0!==c);d.next();){var g=d.value;b.sb(g)?e instanceof S&&b.Si(g)===c&&(g=this.vc(g),null!==g&&(g.containingGroup=e)):(f.link=this.uc(g),null!==f.link&&e instanceof U&&(vq(b,g,!0)==c&&(f.link.fromNode=e),vq(b,g,!1)=c&&(f.link.toNode=e),g=b.zg(g),Array.isArray(g)&&g.some(function(a){return function(b){return bc?(e.labeledLink=a.link, !0):!1}}(f))));f=}Bq(b,c)}a=b.Si(a);void 0!==a&&(a=this.Jb(a),a instanceof S&&(e.containingGroup=a))}};rq.prototype.unresolveReferencesForPart=function(a){var b=this.diagram.model;if(a instanceof U){var c=b.ja(a.data);if(void 0!==c){for(var d=a.linksConnected;d.next();)Cq(b,c,d.value.data);a.isLinkLabel&&(d=a.labeledLink,null!==d&&Cq(b,c,d.data));if(a instanceof S)for(a=a.memberParts;a.next();)d=a.value.data,b.sb(d)&&Cq(b,c,d)}}}; rq.prototype.copyPartData=function(a,b){var c=yi.prototype.copyPartData.call(this,a,b);if(a instanceof Q)if(a=a.data,null!==a&&null!==b){var d=b.model;a=d.Wp(a);"object"===typeof a&&null!==a&&(d.Ii(a),c=b.uc(a))}else null!==c&&(b=this.diagram,null!==a&&null!==b&&null!==b.commandHandler&&b.commandHandler.copiesClipboardData&&(b=b.model.Wp(a),"object"===typeof b&&null!==b&&(c.data=b)));return c}; rq.prototype.insertLink=function(a,b,c,d){var e=this.diagram,f=e.model,g=e.toolManager.findTool("Linking"),h=;null!a&&(null=b&&(b=a),h=b.portId,null=h&&(h=));b=;null!c&&(null=d&&(d=c),b=d.portId,null=b&&(b=));d=g.archetypeLinkData;if(d instanceof Q){if(zg(d),f=d.copy(),null!==f)return f.fromNode=a,f.fromPortId=h,f.toNode=c,f.toPortId=b,e.add(f),a=g.archetypeLabelNodeData,a instanceof U&&(zg(a),a=a.copy(),null!=a&&(a.labeledLink=f,e.add(a))),f}else if(null!d&&(d=f.Wp(d),"object" typeof d&&null!==d))return null!==a&&Dq(f,d,f.ja(a.data),!0),Eq(f,d,h,!0),null!c&&Dq(f,d,f.ja(c.data),!1),Eq(f,d,b,!1),f.Ii(d),a=g.archetypeLabelNodeData,null=a||a instanceof U||(a=f.copyNodeData(a),"object"typeof a&&null!==a&&(f.kf(a),a=f.ja(a),void 0!==a&&f.Pu(d,a))),e.uc(d);return null};rq.prototype.findLinkForKey=rq.prototype.findLinkForKey;rq.prototype.findPartForKey=rq.prototype.findPartForKey;rq.prototype.removeAllModeledParts=rq.prototype.removeAllModeledParts; rq.prototype.addModeledParts=rq.prototype.addModeledParts;rq.prototype.addAllModeledParts=rq.prototype.addAllModeledParts;rq.className="GraphLinksPartManager";function Fq(){yi.apply(this,arguments);this.ih=null}la(Fq,yi); function Gq(a,b,c){if(null!==b&&null!c)else for(e=c,f=b,b=e.linksConnected;b.next();)if(b.value.fromNodee)return;if(null=d||!Rf(d,e,f,null,!0))if(d=a.getLinkCategoryForData(c.data),b=a.findLinkTemplateForCategory(d),null!==b&&(zg(b),b=b.copy(),null!b))}}Fq.prototype.getLinkCategoryForData=function(a){return this.diagram.model.kv(a)};Fq.prototype.setLinkCategoryForData=function(a,b){this.diagram.model.Qv(a,b)}; Fq.prototype.setFromNodeForLink=function(a,b,c){var d=this.diagram.model;void 0=c&&(c=null);b=null!==b?b.data:null;if(this.diagram.isTreePathToChildren)d.Be(a.data,d.ja(b));else{var e=this.ih;this.ih=a;null!==c&&d.Be(c.data,void 0);d.Be(b,d.ja(null!a.toNode?a.toNode.data:null));this.ih=e}}; Fq.prototype.setToNodeForLink=function(a,b,c){var d=this.diagram.model;void 0=c&&(c=null);b=null!==b?b.data:null;if(this.diagram.isTreePathToChildren){var e=this.ih;this.ih=a;null!c&&d.Be(c.data,void 0);d.Be(b,d.ja(null!a.fromNode?a.fromNode.data:null));this.ih=e}else d.Be(a.data,d.ja(b))};Fq.prototype.removeDataForLink=function(a){this.diagram.model.Be(a.data,void 0)}; Fq.prototype.findLinkForKey=function(a){if(null=a||void 0=a)return null;a=this.diagram.model.Ib(a);return null!a?this.Ie.H(a):null}; Fq.prototype.doModelChanged=function(a){yi.prototype.doModelChanged.call(this,a);if(this.diagram){var b=this.diagram;if(a.model=b.model){var c=a.change;if(b.aa){b.aa=!1;try{var d=a.modelChange;if(!d){if(c=re){if("nodeParentKey"d){var e=a.object,f=this.Jb(a.newValue),g=this.Mi(e);if(null!==this.ih)null!==f&&(this.ih.data=e,this.ih.category=this.getLinkCategoryForData(e));else if(null!==g){var h=g.Pi();null!h?nullf?b.remove(h):b.isTreePathToChildren?h.fromNode=f:h.toNode=f:Gq(this,f, g)}}else if("parentLinkCategory"d){var k=this.Mi(a.object),l=a.newValue;if(null!==k&&"string"=typeof l)}b.isModified=!0}}else if(cre)}finally}}}}; Fq.prototype.updateRelationshipsFromData=function(a){var b=a.data;if(null!b){var c=a.diagram;if(null!c){var d=c.model;a instanceof U&&(b=d.Ui(b),b=c.Jb(b),d=a.yg(),b!d&&(d=a.Pi(),null!b?null!d?c.isTreePathToChildren?d.fromNode=b:d.toNode=b:Gq(this,b,a):null!d&&Kj(c,d,!1)))}}};Fq.prototype.updateDataBindings=function(a,b){yi.prototype.updateDataBindings.call(this,a,b);"string"typeof b&&null!==this.vc(a)&&(a=this.uc(a),null!==a&&a.Aa(b))}; Fq.prototype.resolveReferencesForData=function(a){var b=this.diagram.model,c=b.ja(a);if(void 0!==c){var d=Aq(b,c),e=this.vc(a);if(null!==d&&null!==e){for(d=d.iterator;d.next();){var f=d.value;b.sb(f)&&e instanceof U&&b.Ui(f)==c&&Gq(this,e,this.Mi(f))}Bq(b,c)}a=b.Ui(a);void 0!==a&&e instanceof U&&(a=this.Jb(a),Gq(this,a,e))}}; Fq.prototype.unresolveReferencesForPart=function(a){var b=this.diagram.model;if(a instanceof U)}d=this.diagram.isTreePathToChildren;for(a=a.linksConnected;a.next();)e=a.value,e=(d?e.toNode:e.fromNode).data,b.sb(e)&&Cq(b,c,e)}}; Fq.prototype.insertLink=function(a,b,c){b=this.diagram.model;var d=a,e=c;this.diagram.isTreePathToChildren||(d=c,e=a);return null!==d&&null!==e?(b.Be(e.data,b.ja(d.data)),e.Pi()):null};Fq.prototype.findLinkForKey=Fq.prototype.findLinkForKey;Fq.className="TreePartManager"; function Z(a){this.Gt=‘, "insertedNodeKeys": ‘;this.qw=‘, "modifiedNodeData": ‘;this.It=‘, "removedNodeKeys": ‘;this.Jh=null;Za(this);this.on=this.Qa="";this.Uf=!1;this.l=;this.Cc=[];this.ab=new G;this.ui="key";this.Jk=this.tl=null;this.en=this.fn=!1;this.hn=!0;this.Qm=null;this.Aj="category";this.Nf=new G;this.iu=new E;this.lh=!1;this.u=null;this.undoManager=new we;void 0!a&&(this.nodeDataArray=a)} Z.prototype.cloneProtected=function(a);Z.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};Z.prototype.clear=function(); Z.prototype.toString=function(a){void 0a&&(a=0);if(1<a)return this.Bq();var b=(!==this.name?this.name:)+" Model";if(0<a){b+=" node data:";a=this.nodeDataArray;for(var c=a.length,d=0;d<c;d++){var e=a[d];b+=" "+this.ja(e)+":"+Ia(e)}}return b}; Z.prototype.oA=function(a){a.change!==se&&B("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var b=a.object;if(!(a.isTransactionFinished&&b instanceof ve))return null;Hq(this,b);a=this.iw(b,"FinishedUndo"=a.propertyName);this.Jh=null;return a}; Z.prototype.iw=function(a,b){var c=this,d=!1,e=new F,f=new F,g=new F,h=this.Jh;a.changes.each(function(a)):Iq(c,a.object).each(function(a){f.add(a)})):d=!0)});var k=new F;e.each(function(a){k.add(c.ja(a)); b||f.add(a)});var l=new F;g.each(function(a){l.add(c.ja(a));b&&f.add(a)});a=c.cloneDeep(f.ma());var m=null;d&&(nullm&&(m=),m.modelData=this.cloneDeep(this.modelData));0<k.count&&(null=m&&(m=),b?m.removedNodeKeys=k.ma():m.insertedNodeKeys=k.ma());0<a.length&&(null=m&&(m=),m.modifiedNodeData=a);0<l.count&&(null=m&&(m=),b?m.insertedNodeKeys=l.ma():m.removedNodeKeys=l.ma());return m};Z.prototype.cloneDeep=function(a){return Jq(this,a,!0)}; function Jq(a,b,c,d,e){function f(a,b){void 0=a.__gohashid&&e.push(a);d.set(a,b)}if(!ya(b))return b;e||(e=[]);d||(d=new G);var g=d.get(b);if(g)return g;if(Array.isArray(b))else if(b instanceof H||b instanceof Kb||b instanceof M||b instanceof pc||b instanceof O)g=b.copy(),f(b,g);else{if(b instanceof sl||b instanceof ud||b instanceof D)return b;if(b instanceof E)g=(new E).addAll(Jq(a,b.ma(),!1,d,e)),f(b,g);else if(b instanceof F)g= (new F).addAll(Jq(a,b.ma(),!1,d,e)),f(b,g);else if(b instanceof G)g=(new G).addAll(Jq(a,b.ma(),!1,d,e)),f(b,g);else if(b instanceof Date)g=new Date(b.getTime()),f(b,g);else if(b instanceof RegExp)g=new RegExp(b),f(b,g),g.lastIndex=b.lastIndex;else if("function"typeof b.copy)g=b.copy(),f(b,g);else for(h in g=,f(b,g),b)"__gohashid"!==h&&(g[h]=Jq(a,b[h],!1,d,e))}c&&e.forEach(function(a));return g}t=Z.prototype; t.uk=function(){var a=;!this.name&&(a+=‘, "name": ‘+this.quote(this.name));!==this.dataFormat&&(a+=‘, "dataFormat": ‘+this.quote(this.dataFormat));this.isReadOnly&&(a+=‘, "isReadOnly": ‘+this.isReadOnly);"key"!==this.nodeKeyProperty&&"string"==typeof this.nodeKeyProperty&&(a+=‘, "nodeKeyProperty": ‘+this.quote(this.nodeKeyProperty));this.copiesArrays&&(a+=‘, "copiesArrays": true‘);this.copiesArrayObjects&&(a+=‘, "copiesArrayObjects": true‘);this.copiesKey||(a+=‘, "copiesKey": false‘); "category"!==this.nodeCategoryProperty&&"string"=typeof this.nodeCategoryProperty&&(a+=‘, "nodeCategoryProperty": ‘+this.quote(this.nodeCategoryProperty));return a}; t.tq=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.dataFormat=a.dataFormat);a.isReadOnly&&(this.isReadOnly=!0);a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty);a.copiesArrays&&(this.copiesArrays=!0);a.copiesArrayObjects&&(this.copiesArrayObjects=!0);!1a.copiesKey&&(this.copiesKey=!1);a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function Kq(a){return‘, "modelData": ‘+Lq(a,a.modelData)} function Mq(a,b)t.jw=function(){var a=this.modelData,b=!1,c;for(c in a)if(!Nq(c,a[c]))a=;b&&(a=Kq(this));return a+‘, "nodeDataArray": ‘+Oq(this,this.nodeDataArray,!0)};t.Ev=function(a){Mq(this,a);a=a.nodeDataArray;za(a)&&(this.vm(a),this.nodeDataArray=a)}; function Pq(a,b,c,d){if(bc)return!0;if(typeof b!typeof c||"function"typeof b||"function"==typeof c)return!1;if(Array.isArray(b)&&Array.isArray(c)){if(d.H(b)c)return!0;d.add(b,c);if(b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!Pq(a,b[e],c[e],d))return!1;return!0}if(ya(b)&&ya(c)){if(d.H(b)=c)return!0;d.add(b,c);for(var f in b){var g=b[f];if(!Nq(f,g)){var h=c[f];if(void 0h||!Pq(a,g,h,d))return!1}}for(e in c)if(f=c[e],!Nq(e,f)&&(g=b[e],void 0g||!Pq(a,g,f,d)))return!1; return!0}return!1}function Qq(a,b,c){a[c]!==b[c]&&B("Model.computeJsonDifference: Model."+c+‘ is not the same in both models: "‘+a[c]+‘" and "‘+b[c]+‘"‘)} t.Gq=function(a){Qq(this,a,"nodeKeyProperty");for(var b=new F,c=new F,d=(new F).addAll(this.ab.iteratorKeys),e=new G,f=a.nodeDataArray,g=f.length,h=0;h<g;h++){var k=f[h],l=a.ja(k);if(void 0!l){d.remove(l);var m=this.Ib(l);nullm?(b.add(l),c.add(k)):Pq(this,m,k,e)||c.add(k)}else this.lt(k),l=this.ja(k),b.add(l),c.add(k)}f="";Pq(this,this.modelData,a.modelData,e)||(f+=Kq(this));0<b.count&&(f+=this.Gt+Oq(this,b.ma(),!0));0<c.count&&(f+=this.qw+Oq(this,c.ma(),!0));0<d.count&&(f+=this.It+Oq(this,d.ma(), !0));return f};t.Iy=function(a,b){void 0=b&&(b=Rq(this,this));return‘{ "class": ‘+this.quote(b)+‘, "incremental": 1‘+this.uk()+this.Gq(a)+"}"};function Hq(a,b){function c(a,b){b=b.part.data;if(a!b){var c=d.get(a);null=c?(c=new F,c.add(b),d.add(a,c)):c.add(b)}}var d=a.Jh;null=d&&(d=new G,b.changes.each(function(a){if(null!a.diagram){var b=a.change;if(b=re)(a=a.object.panel)&&(b=a.data)&&c(b,a);else if(b=te||b=ue)a=a.object,(b=a.itemArray)&&c(b,a)}}),a.Jh=d)} function Iq(a,b){for(var c=new F,d=0;d<a.nodeDataArray.length;d++)return c}function Sq(a,b,c,d,e){if(Array.isArray(c))for(var f=0;f<c.length;f++){var g=c[f];if(g=b)return e.add(d),!0;if(Sq(a,b,g,d,e))return!0}else if(ya(c)&&Object.getPrototypeOf(c)=Object.prototype)for(f in c){g=c[f];if(g=b)return e.add(d),!0;if(Sq(a,b,g,d,e))return!0}return!1} t.hw=function(a,b){var c=this,d=!1,e=new F,f=new F,g=new F,h=this.Jh;a.changes.each(function(a)):Iq(c,a.object).each(function(a){f.add(a)})):d=!0)});var k=new F;e.each(function(a){k.add(c.ja(a));b|| f.add(a)});var l=new F;g.each(function(a){l.add(c.ja(a));b&&f.add(a)});a=;d&&(a+=Kq(this));0<k.count&&(a+=(b?this.It:this.Gt)+Oq(this,k.ma(),!0));0<f.count&&(a+=this.qw+Oq(this,f.ma(),!0));0<l.count&&(a+=(b?this.Gt:this.It)+Oq(this,l.ma(),!0));return a}; t.sq=function(a){(void 0!==a.name&&a.name!==this.name||void 0!==a.dataFormat&&a.dataFormat!==this.dataFormat||void 0!==a.isReadOnly&&a.isReadOnly!==this.isReadOnly||void 0!==a.nodeKeyProperty&&a.nodeKeyProperty!==this.nodeKeyProperty||void 0!==a.copiesArrays&&a.copiesArrays!==this.copiesArrays||void 0!==a.copiesArrayObjects&&a.copiesArrayObjects!==this.copiesArrayObjects||void 0!==a.copiesKey&&a.copiesKey!==this.copiesKey||void 0!==a.nodeCategoryProperty&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&& B("applyIncrementalJson cannot change Model properties");Mq(this,a);var b=a.insertedNodeKeys,c=a.modifiedNodeData,d=new G;if(Array.isArray(c))for(var e=0;e<c.length;e++){var f=c[e],g=this.ja(f);void 0!==g&&null!g&&d.set(g,f)}if(Array.isArray(b))for(e=b.length,f=0;f<e;f++)),this.Bm(h,g),this.kf(h))}if(Array.isArray(c))for(b=c.length,d=0;d<b;d++)if(e=c[d],f=this.ja(e),f=this.Ib(f),null!=f)for(var k in e)"__gohashid"=k||k this.nodeKeyProperty||this.dk()&&k=this.nodeIsGroupProperty||this.setDataProperty(f,k,e[k]);a=a.removedNodeKeys;if(Array.isArray(a))for(c=a.length,k=0;k<c;k++)b=this.Ib(a[k]),null!==b&&this.um(b)}; t.by=function(a,b){a.change!se&&B("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.isTransactionFinished&&c instanceof ve))return‘{ "incremental": 0 }‘;void 0=b&&(b=Rq(this,this));Hq(this,c);a=this.hw(c,"FinishedUndo"==a.propertyName);this.Jh=null;return"2"=b?‘{ "incremental": 2‘+a+"}":‘{ "class": ‘+this.quote(b)+‘, "incremental": 1‘+this.uk()+a+"}"};t.pA=function(a,b){return this.by(a,b)}; t.Bq=function(a){void 0a&&(a=Rq(this,this));return‘{ "class": ‘+this.quote(a)+this.uk()+this.jw()+"}"};t.toJSON=function(a){return this.Bq(a)};t.kx=function(a){var b=null;if("string"==typeof a)trycatch(d)else"object"==typeof a?b=a:B("Unable to modify a Model from: "+a);var c=b.incremental;"number"!==typeof c&&B("Unable to apply non-incremental changes to Model: "+a);0!==c&&(this.ta("applyIncrementalJson"),this.sq(b),this.Ua("applyIncrementalJson"))};t.Cy=function(a){return this.kx(a)}; Z.constructGraphLinksModel=function();t=Z.prototype; t.vm=function(a){if(za(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];if(ya(d)){var e=c;d=this.vm(d);Array.isArray(a)?a[e]=d:B("Cannot replace an object in an HTMLCollection or NodeList at "+e)}}else if(ya(a)){for(c in a)if(e=a[c],ya(e)&&(e=this.vm(e),a[c]=e,"points"=c&&Array.isArray(e))){d=0e.length%2;for(var f=0;f<e.length;f++)if("number"!==typeof e[f])if(d){d=new E;for(f=0;f<e.length/2;f++)d.add(new H(e[2f],e[2f+1]));d.freeze();a[c]=d}}if("object"=typeof a){c=a;e=a["class"]|| "";0e.indexOf("go.")&&(e=e.substr(3));if("NaN"===e)c=NaN;else if("Date"===e)c=new Date(a.value);else if("Point"===e)c=new H(Tq(a.x),Tq(a.y));else if("Size"===e)c=new Kb(Tq(a.width),Tq(a.height));else if("Rect"===e)c=new M(Tq(a.x),Tq(a.y),Tq(a.width),Tq(a.height));else if("Margin"===e)c=new pc(Tq(a.top),Tq(a.right),Tq(a.bottom),Tq(a.left));else if("Spot"===e)"string"===typeof a["enum"]?c=pd(a["enum"]):c=new O(Tq(a.x),Tq(a.y),Tq(a.offsetX),Tq(a.offsetY));else if("Brush"===e){if(c=new sl,c.type=$a(sl, a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof O&&(c.start=a.start),a.end instanceof O&&(c.end=a.end),"number"===typeof a.startRadius&&(c.startRadius=Tq(a.startRadius)),"number"===typeof a.endRadius&&(c.endRadius=Tq(a.endRadius)),a=a.colorStops,ya(a))for(b in a)c.addColorStop(parseFloat(b),a[b])}else"Geometry"===e?(b=null,"string"===typeof a.path?b=Jd(a.path):b=new ud,b.type=$a(ud,a.type),"number"===typeof a.startX&&(b.startX=Tq(a.startX)),"number"===typeof a.startY&&(b.startY= Tq(a.startY)),"number"===typeof a.endX&&(b.endX=Tq(a.endX)),"number"==typeof a.endY&&(b.endY=Tq(a.endY)),a.spot1 instanceof O&&(b.spot1=a.spot1),a.spot2 instanceof O&&(b.spot2=a.spot2),c=b):"EnumValue"=e&&(b=a.classType,0b.indexOf("go.")&&(b=b.substr(3)),b=Uq(b),"function"===typeof b&&(c=$a(b,a.name)));a=c}}return a}; t.quote=function(a){for(var b=,c=a.length,d=0;d<c;d++){var e=a[d];if(‘"‘e||""==e)b+=""+e;else if(""==e)b+="";else if("f"e)b+="f";else if(" "e)b+=" ";else if(" "e)b+=" ";else if(" "=e)b+=" ";else}return‘"‘+b+‘"‘}; t.Fm=function(a){return void 0a?"undefined":nulla?"null":!0a?"true":!1a?"false":"string"typeof a?this.quote(a):"number"=typeof a?Infinitya?"9e9999":-Infinitya?"-9e9999":isNaN(a)?‘{"class":"NaN"}‘:a.toString():a instanceof Date?‘{"class":"Date", "value":"‘+a.toJSON()+‘"}‘:a instanceof Number?this.Fm(a.valueOf()):za(a)?Oq(this,a):ya(a)?Lq(this,a):"function"=typeof a?"null":a.toString()}; function Oq(a,b,c){void 0c&&(c=!1);var d=b.length;if(0>=d)return"[]";var e=new cb;e.add("[ ");c&&1<d&&e.add(" ");for(var f=0;f<d;f++){var g=b[f];void 0!g&&(0<f&&(e.add(","),c&&e.add(" ")),e.add(a.Fm(g)))}c&&1<d&&e.add(" ");e.add(" ]");return e.toString()}function Nq(a,b){return void 0=b||"__gohashid"a||"_"a[0]||"function"=typeof b?!0:!1}function Vq(a){return isNaN(a)?"NaN":Infinitya?"9e9999":-Infinitya?"-9e9999":a} function Lq(a,b){var c=b;if(c instanceof H)b={"class":"go.Point",x:Vq(c.x),y:Vq(c.y)};else if(c instanceof Kb)b={"class":"go.Size",width:Vq(c.width),height:Vq(c.height)};else if(c instanceof M)b={"class":"go.Rect",x:Vq(c.x),y:Vq(c.y),width:Vq(c.width),height:Vq(c.height)};else if(c instanceof pc)b={"class":"go.Margin",top:Vq(c.top),right:Vq(c.right),bottom:Vq(c.bottom),left:Vq(c.left)};else if(c instanceof O)c.eb()?b={"class":"go.Spot",x:Vq(c.x),y:Vq(c.y),offsetX:Vq(c.offsetX),offsetY:Vq(c.offsetY)}: b={"class":"go.Spot","enum":c.toString()};else if(c instanceof sl);if(c.type=vl)b.color=c.color;else if(c.type=yl||c.type=tl)b.start=c.start,b.end=c.end,c.type=tl&&(0!c.startRadius&&(b.startRadius=Vq(c.startRadius)),isNaN(c.endRadius)||(b.endRadius=Vq(c.endRadius)));if(null!c.colorStops);for(c=c.colorStops.iterator;c.next();)d[c.key]=c.value;b.colorStops=d}}else c instanceof ud?(b={"class":"go.Geometry",type:c.type.name},0!c.startX&&(b.startX= Vq(c.startX)),0!c.startY&&(b.startY=Vq(c.startY)),0!c.endX&&(b.endX=Vq(c.endX)),0!c.endY&&(b.endY=Vq(c.endY)),c.spot1.A(xc)||(b.spot1=c.spot1),c.spot2.A(Hc)||(b.spot2=c.spot2),c.type=vd&&(b.path=Gd(c))):c instanceof D&&(b={"class":"go.EnumValue",classType:Rq(a,c.classType),name:c.name});d="{";c=!0;for(var e in b){var f=nn(b,e);if(!Nq(e,f))if(c?c=!1:d+=", ",d+=‘"‘+e+‘":‘,"points"e&&f instanceof E){var g="[";for(f=f.iterator;f.next();){var h=f.value;1<g.length&&(g+=",");g+=a.Fm(h.x);g+=","; g+=a.Fm(h.y)}g+="]";d+=g}else d+=a.Fm(f)}return d+"}"}function Tq(a){return"number"typeof a?a:"NaN"==a?NaN:"9e9999"a?Infinity:"-9e9999"=a?-Infinity:parseFloat(a)}t.yh=function(a){this.iu.add(a)};t.rk=function(a){this.iu.remove(a)};t.Ns=function(a){this.skipsUndoManager||this.undoManager.ov(a);for(var b=this.iu,c=b.length,d=0;d<c;d++)b.L(d)(a)};t.Ya=function(a,b,c,d,e,f,g){Wq(this,,a,b,c,d,e,f,g)};t.g=function(a,b,c,d,e){Wq(this,,re,a,this,b,c,d,e)}; t.rt=function(a,b,c,d,e,f){Wq(this,"",re,b,a,c,d,e,f)};function Wq(a,b,c,d,e,f,g,h,k){void 0h&&(h=null);void 0k&&(k=null);var l=new qe;l.model=a;l.change=c;l.modelChange=b;l.propertyName=d;l.object=e;l.oldValue=f;l.oldParam=h;l.newValue=g;l.newParam=k;a.Ns(l)} t.Sj=function(a,b){if(null!a&&a.modelthis)if(a.changere)ek(a.object,a.propertyName,a.H(b));else if(a.change=te){var c=a.newParam;if("nodeDataArray"a.modelChange){if(a=a.newValue,ya(a)&&"number"==typeof c){var d=this.ja(a);b?(this.Cc[c]==a&&Ca(this.Cc,c),void 0!==d&&this.ab.remove(d)):(this.Cc[c]!==a&&Ba(this.Cc,c,a),void 0!==d&&this.ab.add(d,a))}}else""==a.modelChange?((d=a.object)&&!za(d)&&a.propertyName&&(d=nn(a.object,a.propertyName)),za(d)&&"number"=typeof c&&(a=a.newValue,b? Ca(d,c):Ba(d,c,a))):B("unknown ChangedEvent.Insert modelChange: "+a.toString())}else a.changeue?(c=a.oldParam,"nodeDataArray"==a.modelChange?(a=a.oldValue,ya(a)&&"number"==typeof c&&(d=this.ja(a),b?(this.Cc[c]!==a&&Ba(this.Cc,c,a),void 0!==d&&this.ab.add(d,a)):(this.Cc[c]a&&Ca(this.Cc,c),void 0!d&&this.ab.remove(d)))):===a.modelChange?((d=a.object)&&!za(d)&&a.propertyName&&(d=nn(a.object,a.propertyName)),za(d)&&"number"==typeof c&&(a=a.oldValue,b?Ba(d,c,a):Ca(d,c))):B("unknown ChangedEvent.Remove modelChange: "+ a.toString())):a.change!se&&B("unknown ChangedEvent: "+a.toString())};t.ta=function(a){return this.undoManager.ta(a)};t.Ua=function(a){return this.undoManager.Ua(a)};t.yf=function(){return this.undoManager.yf()};Z.prototype.commit=function(a,b){void 0b&&(b=);var c=this.skipsUndoManager;nullb&&(this.skipsUndoManager=!0,b="");this.undoManager.ta(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.Ua(b):this.undoManager.yf(),this.skipsUndoManager=c}};t=Z.prototype; t.Aa=function(a,b){void 0b&&(b=);Wq(this,"SourceChanged",se,b,a,null,null)};t.ja=function(a){if(null!==a){var b=this.ui;if(!==b&&(b=nn(a,b),void 0!==b)){if(xq(b))return b;B("Key value for node data "+a+" is not a number or a string: "+b)}}}; t.Bm=function(a,b){if(null!==a){var c=this.ui;if(""!==c)if(this.sb(a)){var d=nn(a,c);d!b&&nullthis.Ib(b)&&(ek(a,c,b),void 0!==d&&this.ab.remove(d),this.ab.add(b,a),Wq(this,"nodeKey",re,c,a,d,b),"string"==typeof c&&this.Aa(a,c),this.wq(d,b))}else ek(a,c,b)}};function xq(a){return"number"==typeof a||"string"=typeof a}t.sb=function(a){var b=this.ja(a);return void 0b?!1:this.ab.H(b)=a}; t.Ib=function(a){nulla&&B("Model.findNodeDataForKey:key must not be null");return void 0!==a&&xq(a)?this.ab.H(a):null};t.lt=function(a){if(null!==a){var b=this.ui;if(""!b){var c=this.ja(a);if(void 0c||this.ab.contains(c)){var d=this.tl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.ab.contains(c))){ek(a,b,c);return}if("string"=typeof c){for(d=2;this.ab.contains(c+d);)d++;ek(a,b,c+d)}else if(void 0c||"number"==typeof c){for(c=-this.ab.count-1;this.ab.contains(c);)c--;ek(a,b,c)}}}}}; t.kf=function(a){null!a&&(ob(a),this.sb(a)||pq(this,a,!0))};function pq(a,b,c){var d=a.ja(b);if(void 0d||a.ab.H(d)!b)a.lt(b),d=a.ja(b),void 0d?B("Model.makeNodeDataKeyUnique failed on "+b+". Data not added to Model."):(a.ab.add(d,b),d=null,c&&(d=a.Cc.length,Ba(a.Cc,d,b)),Wq(a,"nodeDataArray",te,"nodeDataArray",a,null,b,null,d),a.xm(b),a.wm(b))}t.yy=function(a){if(za(a))for(var b=a.length,c=0;c<b;c++)this.kf(a[c]);else for(a=a.iterator;a.next();)this.kf(a.value)}; t.um=function(a){null!a&&oq(this,a,!0)};function oq(a,b,c){var d=a.ja(b);void 0!d&&a.ab.remove(d);d=null;if(c){a:if(c=a.Cc,Array.isArray(c))d=c.indexOf(b);elsed=-1}if(0>d)return;Ca(a.Cc,d)}Wq(a,"nodeDataArray",ue,"nodeDataArray",a,b,null,d,null);a.Dq(b)}t.eA=function(a){if(za(a))for(var b=a.length,c=0;c<b;c++)this.um(a[c]);else for(a=a.iterator;a.next();)this.um(a.value)}; t.Wz=function(a){if(za(a)){for(var b=new F(this.ab.iteratorKeys),c=new F,d=a.length,e=0;e<d;e++){var f=a[e],g=this.ja(f);if(void 0!g){c.add(g);var h=this.Ib(g);null!h?this.Rj(h,f):(h=,this.Bm(h,g),this.Rj(h,f),this.kf(h))}else this.kf(f),c.add(this.ja(f))}for(a=b.iterator;a.next();)b=a.value,c.contains(b)||(b=this.Ib(b))&&this.um(b)}};t.wq=function(a,b){void 0!b&&(a=Aq(this,a),a instanceof F&&this.Nf.add(b,a))};t.dw=function();t.xm=function();t.wm=function();t.Dq=function(); function Cq(a,b,c){if(void 0!b){var d=a.Nf.H(b);null=d&&(d=new F,a.Nf.add(b,d));d.add(c)}}function Bq(a,b,c){if(void 0!b){var d=a.Nf.H(b);d instanceof F&&(void 0=c||null=c?a.Nf.remove(b):(d.remove(c),0=d.count&&a.Nf.remove(b)))}}function Aq(a,b){if(void 0=b)return null;a=a.Nf.H(b);return a instanceof F?a:null}t.Uu=function(a){void 0=a?this.Nf.clear():this.Nf.remove(a)}; Z.prototype.copyNodeData=function(a){if(null=a)return null;var b=this.Jk;a=null!b?b(a,this):Xq(this,a,!0);ya(a)&&Za(a);return a}; function Xq(a,b,c){if(a.copiesArrays&&Array.isArray(b))Za(d);return d}if(c&&ya(b)){c=(c=b.constructor)?new c:;e=a.copiesKey||"string"!typeof a.nodeKeyProperty?null:a.nodeKeyProperty;for(d in b)if("__gohashid"=d)c.__gohashid=void 0;else if(d=e)c[e]=void 0;else{var f=nn(b,d),g=Rq(a,f);"GraphObject"g||"Diagram"g||"Layer"g||"RowColumnDefinition"g||"AnimationManager"==g||"Tool"=g||"CommandHandler" g||"Layout"==g||"InputEvent"g||"DiagramEvent"=g||f instanceof Z||f instanceof we||f instanceof ve||f instanceof qe?ek(c,d,f):(f=Xq(a,f,!1),ek(c,d,f))}Za(c);return c}return b instanceof H?b.copy():b instanceof Kb?b.copy():b instanceof M?b.copy():b instanceof O?b.copy():b instanceof pc?b.copy():b} Z.prototype.setDataProperty=function(a,b,c){if(this.sb(a))if(bthis.nodeKeyProperty)this.Bm(a,c);else{if(bthis.nodeCategoryProperty){this.yq(a,c);return}}else!Yq&&a instanceof Y&&(Yq=!0,wa(‘Model.setDataProperty is modifying a GraphObject, "‘+a.toString()+‘"‘),wa(" Is that really your intent?"));var d=nn(a,b);d!==c&&(ek(a,b,c),this.rt(a,b,d,c))};t=Z.prototype;t.set=function(a,b,c){this.setDataProperty(a,b,c)}; t.Rj=function(a,b){if(b){var c=this.sb(a),d;for(d in b)"__gohashid"=d||c&&dthis.nodeKeyProperty||this.setDataProperty(a,d,b[d])}};t.uy=function(a,b){this.bt(a,-1,b)};t.bt=function(a,b,c){0>b&&(b=a.length);Ba(a,b,c);Wq(this,,te,,a,null,c,null,b)};t.Gv=function(a,b){void 0b&&(b=-1);athis.Cc&&B("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1b&&(b=a.length-1);var c=a[b];Ca(a,b);Wq(this,,ue,,a,c,null,b,null)}; t.Zs=function(a){if(null=a)return"";var b=this.Aj;if(===b)return;b=nn(a,b);if(void 0=b)return"";if("string"typeof b)return b;B("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};t.yq=function(a,b){if(null!==a){var c=this.Aj;if(""!c)if(this.sb(a)){var d=nn(a,c);void 0d&&(d=);d!==b&&(ek(a,c,b),Wq(this,"nodeCategory",re,c,a,d,b))}else ek(a,c,b)}};t.km=function(){return!1};t.dk=function(){return!1};t.jm=function(){return!1};t.ht=function(){return!1};t.ek=function(){return!1}; function Ci()function Rq(a,b){if("function"===typeof b){if(b.className)return b.className;if(b.name)return b.name}else if("object"===typeof b&&null!==b&&b.constructor)return Rq(a,b.constructor);return typeof b}function Uq(a){return Zq[a]?Zq[a]:void 0!==x.go&&x.go[a]?x.go[a]:null}function nn(a,b){if(!a||!b)return null;try{if("function"==typeof b)var c=b(a);else"function"=typeof a.getAttribute?(c=a.getAttribute(b),nullc&&(c=void 0)):c=a[b]}catch(d)return c} function ek(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d)} ma.Object.defineProperties(Z.prototype,{name:{get:function(),set:function(a)},dataFormat:{get:function(),set:function(a)},isReadOnly:{get:function(),set:function(a)},modelData:{ get:function(),set:function(a)},undoManager:{get:function(),set:function(a)},skipsUndoManager:{get:function(),set:function(a)},nodeKeyProperty:{get:function(),set:function(a){var b=this.ui; b!==a&&(a&&B("Model.nodeKeyProperty may not be the empty string"),0<this.ab.count&&B("Cannot set Model.nodeKeyProperty when there is existing node data"),this.ui=a,this.g("nodeKeyProperty",b,a))}},makeUniqueKeyFunction:{get:function(),set:function(a)},nodeDataArray:{get:function(),set:function(a){var b=this.Cc;if(b!a){this.ab.clear(); this.dw();for(var c=a.length,d=0;d<c;d++){var e=a[d];if(!ya(e)){B("Model.nodeDataArray must only contain Objects, not: "+e);return}ob(e)}this.Cc=a;d=new E;for(e=0;e<c;e++){var f=a[e],g=this.ja(f);void 0g?d.add(f):null!this.ab.H(g)?d.add(f):this.ab.add(g,f)}for(d=d.iterator;d.next();)e=d.value,this.lt(e),f=this.ja(e),void 0!f&&this.ab.add(f,e);Wq(this,"nodeDataArray",re,"nodeDataArray",this,b,a);for(b=0;b<c;b++)d=a[b],this.xm(d),this.wm(d);this.Uu();Array.isArray(a)||(this.isReadOnly=!0)}}}, copyNodeDataFunction:{get:function(),set:function(a)},copiesArrays:{get:function(),set:function(a)},copiesArrayObjects:{get:function(),set:function(a)},copiesKey:{ get:function(),set:function(a)},afterCopyFunction:{get:function(),set:function(a)},nodeCategoryProperty:{get:function(),set:function(a)}}); ma.Object.defineProperties(Z,{type:{get:function(){return"Model"}}});Z.prototype.setCategoryForNodeData=Z.prototype.yq;Z.prototype.getCategoryForNodeData=Z.prototype.Zs;Z.prototype.removeArrayItem=Z.prototype.Gv;Z.prototype.insertArrayItem=Z.prototype.bt;Z.prototype.addArrayItem=Z.prototype.uy;Z.prototype.assignAllDataProperties=Z.prototype.Rj;Z.prototype.set=Z.prototype.set;Z.prototype.clearUnresolvedReferences=Z.prototype.Uu;Z.prototype.mergeNodeDataArray=Z.prototype.Wz; Z.prototype.removeNodeDataCollection=Z.prototype.eA;Z.prototype.removeNodeData=Z.prototype.um;Z.prototype.addNodeDataCollection=Z.prototype.yy;Z.prototype.addNodeData=Z.prototype.kf;Z.prototype.makeNodeDataKeyUnique=Z.prototype.lt;Z.prototype.findNodeDataForKey=Z.prototype.Ib;Z.prototype.containsNodeData=Z.prototype.sb;Z.prototype.setKeyForNodeData=Z.prototype.Bm;Z.prototype.getKeyForNodeData=Z.prototype.ja;Z.prototype.updateTargetBindings=Z.prototype.Aa;Z.prototype.commit=Z.prototype.commit; Z.prototype.rollbackTransaction=Z.prototype.yf;Z.prototype.commitTransaction=Z.prototype.Ua;Z.prototype.startTransaction=Z.prototype.ta;Z.prototype.raiseDataChanged=Z.prototype.rt;Z.prototype.raiseChanged=Z.prototype.g;Z.prototype.raiseChangedEvent=Z.prototype.Ya;Z.prototype.removeChangedListener=Z.prototype.rk;Z.prototype.addChangedListener=Z.prototype.yh;Z.prototype.writeJsonValue=Z.prototype.Fm;Z.prototype.replaceJsonObjects=Z.prototype.vm;Z.prototype.applyIncrementalJSON=Z.prototype.Cy; Z.prototype.applyIncrementalJson=Z.prototype.kx;Z.prototype.toJSON=Z.prototype.toJSON;Z.prototype.toJson=Z.prototype.Bq;Z.prototype.toIncrementalJSON=Z.prototype.pA;Z.prototype.toIncrementalJson=Z.prototype.by;Z.prototype.computeJsonDifference=Z.prototype.Iy;Z.prototype.toIncrementalData=Z.prototype.oA;Z.prototype.clear=Z.prototype.clear;var Yq=!1,Zq=;Z.className="Model"; Z.fromJSON=Z.fromJson=function(a,b){void 0=b&&(b=null);var c=null;if("string"typeof a)trycatch(f)else"object"=typeof a?c=a:B("Unable to construct a Model from: "+a);if(nullb){a=null;var d=c["class"];if("string"=typeof d)try{var e=null;0=d.indexOf("go.")?(d=d.substr(3),e=Uq(d)):(e=Uq(d),null=e&&(e=x[d]));"function"=typeof e&&(a=new e)}catch(f)null=a||a instanceof Z?b=a:B("Unable to construct a Model of declared class: "+c["class"])}null=b&&(b=Z.constructGraphLinksModel()); b.tq(c);b.Ev(c);return b};Z.safePropertyValue=nn;Z.safePropertySet=ek;Zq.Brush=sl;Zq.ChangedEvent=qe;Zq.Geometry=ud;Zq.Margin=pc;Zq.Panel=X;Zq.Point=H;Zq.Rect=M;Zq.Size=Kb;Zq.Spot=O;Zq.Transaction=ve;Zq.UndoManager=we;function Ji(a,b,c){Za(this);this.s=!1;void 0=a&&(a="");void 0=b&&(b=a);void 0=c&&(c=null);this.l=-1;this.bd=null;this.Sl=a;this.Rl=this.Fp=0;this.ys=null;this.Wn=!1;this.Jl=b;this.dn=c;this.to=$q;this.Ym=null;this.au=new F} Ji.prototype.copy=function(){var a=new Ji;a.Sl=this.Sl;a.Fp=this.Fp;a.Rl=this.Rl;a.ys=this.ys;a.Wn=this.Wn;a.Jl=this.Jl;a.dn=this.dn;a.to=this.to;a.Ym=this.Ym;return a};t=Ji.prototype;t.cb=function(a);t.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(-1!this.bj?" "+this.bj:"")+" "+this.mode.name+")"};t.freeze=function();t.ea=function(); t.Jx=function(a){void 0=a&&(a=null);this.mode=fn;this.backConverter=a;return this};t.pq=function(a){void 0=a&&(a="");this.sourceName=a;this.isToModel=!1;return this};t.Yz=function();function fl(a,b,c) t.ew=function(a,b,c){var d=this.Jl;if(void 0=c||""=d||d=c){c=this.Sl;var e=this.dn;if(null=e&&""c)wa("Binding error: target property is the empty string: "+this.toString());else{var f=b;""!==d&&(f=nn(b,d));if(void 0!f)if(nulle)!==c&&ek(a,c,f);else try{if(!c)else e(f,a)}catch(h)}}}; t.Fq=function(a,b,c,d){if(this.to=fn){var e=this.Sl;if(void 0=c||e=c){c=this.Jl;var f=this.Ym,g=a;!==e&&(g=nn(a,e));if(void 0!==g&&!this.au.contains(a))try{this.au.add(a);var h=null!==d?d.diagram:null,k=null!h?h.model:null;if(null=f)if(!c)null!k?k.setDataProperty(b,c,g):ek(b,c,g);else{if(null!k&&null!d&&0<=d.itemIndex&&null!d.panel&&Array.isArray(d.panel.itemArray))}else try{if(!==c){var n=f(g,b,k);null!==k?k.setDataProperty(b, c,n):ek(b,c,n)}else{var p=f(g,b,k);if(void 0!==p&&null!==k&&null!==d&&0<=d.itemIndex&&null!==d.panel&&Array.isArray(d.panel.itemArray))}}catch(u)}finally{this.au.remove(a)}}}}; ma.Object.defineProperties(Ji.prototype,{bj:{get:function(),set:function(a){this.s&&ua(this);this.l=a}},targetProperty:{get:function(),set:function(a){this.s&&ua(this);this.Sl=a}},sourceName:{get:function(),set:function(a){this.s&&ua(this);this.ys=a;null!==a&&(this.Wn=!1)}},isToModel:{get:function(),set:function(a){this.s&& ua(this);this.Wn=a}},sourceProperty:{get:function(),set:function(a){this.s&&ua(this);this.Jl=a}},converter:{get:function(),set:function(a){this.s&&ua(this);this.dn=a}},backConverter:{get:function(),set:function(a){this.s&&ua(this);this.Ym=a}},mode:{get:function(),set:function(a){this.s&&ua(this);this.to=a}}}); Ji.prototype.updateSource=Ji.prototype.Fq;Ji.prototype.updateTarget=Ji.prototype.ew;Ji.prototype.ofModel=Ji.prototype.Yz;Ji.prototype.ofObject=Ji.prototype.pq;Ji.prototype.makeTwoWay=Ji.prototype.Jx;var $q=new D(Ji,"OneWay",1),fn=new D(Ji,"TwoWay",2);Ji.className="Binding";Ji.parseEnum=function(a,b){return function(c)};Ji.toString=Ia;Ji.OneWay=$q;Ji.TwoWay=fn; function ar(a,b){Z.call(this);this.Ft=‘, "insertedLinkKeys": ‘;this.pw=‘, "modifiedLinkData": ‘;this.Ht=‘, "removedLinkKeys": ‘;this.Nc=[];this.Vf=new F;this.mb=new G;this.pi=;this.ej=this.Ik=this.ul=null;this.Se="from";this.Te="to";this.xj=this.wj=;this.vj="category";this.Ld=;this.yl="isGroup";this.oe="group";this.gn=!1;void 0!a&&(this.nodeDataArray=a);void 0!b&&(this.linkDataArray=b)}la(ar,Z);ar.constructGraphLinksModel=Z.constructGraphLinksModel; ar.prototype.cloneProtected=function(a){Z.prototype.cloneProtected.call(this,a);a.pi=this.pi;a.ul=this.ul;a.Ik=this.Ik;a.Se=this.Se;a.Te=this.Te;a.wj=this.wj;a.xj=this.xj;a.vj=this.vj;a.Ld=this.Ld;a.yl=this.yl;a.oe=this.oe;a.gn=this.gn};t=ar.prototype;t.clear=function(){Z.prototype.clear.call(this);this.Nc=[];this.mb.clear();this.Vf.clear()}; t.toString=function(a){void 0=a&&(a=0);if(2<=a)return this.Bq();var b=(!==this.name?this.name:)+" GraphLinksModel";if(0<a){b+=" node data:";a=this.nodeDataArray;var c=a.length,d;for(d=0;d<c;d++){var e=a[d];b+=" "+this.ja(e)+":"+Ia(e)}b+=" link data:";a=this.linkDataArray;c=a.length;for(d=0;d<c;d++)e=a[d],b+=" "+vq(this,e,!0)+"--x3e"+vq(this,e,!1)}return b}; t.iw=function(a,b){var c=Z.prototype.iw.call(this,a,b),d=this,e=new F,f=new F,g=new F,h=this.Jh;a.changes.each(function(a)):br(d,a.object).each(function(a){f.add(a)})))});var k=new F;e.each(function(a){k.add(d.Tb(a));b||f.add(a)});var l=new F;g.each(function(a){l.add(d.Tb(a)); b&&f.add(a)});a=d.cloneDeep(f.ma());0<k.count&&(null=c&&(c=),b?c.removedLinkKeys=k.ma():c.insertedLinkKeys=k.ma());0<a.length&&(null=c&&(c=),c.modifiedLinkData=a);0<l.count&&(null=c&&(c=),b?c.insertedLinkKeys=l.ma():c.removedLinkKeys=l.ma());return c}; t.uk=function(){var a=Z.prototype.uk.call(this),b=;"category"!==this.linkCategoryProperty&&"string"===typeof this.linkCategoryProperty&&(b+=‘, "linkCategoryProperty": ‘+this.quote(this.linkCategoryProperty));!this.linkKeyProperty&&"string"typeof this.linkKeyProperty&&(b+=‘, "linkKeyProperty": ‘+this.quote(this.linkKeyProperty));"from"!==this.linkFromKeyProperty&&"string"=typeof this.linkFromKeyProperty&&(b+=‘, "linkFromKeyProperty": ‘+this.quote(this.linkFromKeyProperty));"to"! this.linkToKeyProperty&&"string"==typeof this.linkToKeyProperty&&(b+=‘, "linkToKeyProperty": ‘+this.quote(this.linkToKeyProperty));!==this.linkFromPortIdProperty&&"string"===typeof this.linkFromPortIdProperty&&(b+=‘, "linkFromPortIdProperty": ‘+this.quote(this.linkFromPortIdProperty));!==this.linkToPortIdProperty&&"string"==typeof this.linkToPortIdProperty&&(b+=‘, "linkToPortIdProperty": ‘+this.quote(this.linkToPortIdProperty));!==this.linkLabelKeysProperty&&"string"===typeof this.linkLabelKeysProperty&& (b+=‘, "linkLabelKeysProperty": ‘+this.quote(this.linkLabelKeysProperty));"isGroup"!==this.nodeIsGroupProperty&&"string"===typeof this.nodeIsGroupProperty&&(b+=‘, "nodeIsGroupProperty": ‘+this.quote(this.nodeIsGroupProperty));"group"!==this.nodeGroupKeyProperty&&"string"===typeof this.nodeGroupKeyProperty&&(b+=‘, "nodeGroupKeyProperty": ‘+this.quote(this.nodeGroupKeyProperty));return a+b}; t.tq=function(a){Z.prototype.tq.call(this,a);a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty);a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.linkLabelKeysProperty= a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)};t.jw=function(){var a=Z.prototype.jw.call(this),b=‘, "linkDataArray": ‘+Oq(this,this.linkDataArray,!0);return a+b};t.Ev=function(a){Z.prototype.Ev.call(this,a);a=a.linkDataArray;Array.isArray(a)&&(this.vm(a),this.linkDataArray=a)}; t.Gq=function(a){if(!(a instanceof ar))return B("Model.computeJsonDifference: newmodel must be a GraphLinksModel"),;var b=Z.prototype.Gq.call(this,a);Qq(this,a,"linkKeyProperty");Qq(this,a,"linkFromKeyProperty");Qq(this,a,"linkToKeyProperty");Qq(this,a,"linkLabelKeysProperty");Qq(this,a,"nodeIsGroupProperty");Qq(this,a,"nodeGroupKeyProperty");for(var c=new F,d=new F,e=(new F).addAll(this.mb.iteratorKeys),f=new G,g=a.linkDataArray,h=g.length,k=0;k<h;k++){var l=g[k],m=a.Tb(l);if(void 0!m){e.remove(m); var n=this.vg(m);nulln?(c.add(m),d.add(l)):Pq(this,n,l,f)||d.add(l)}else this.mq(l),m=this.Tb(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.Ft+Oq(this,c.ma(),!0));0<d.count&&(a+=this.pw+Oq(this,d.ma(),!0));0<e.count&&(a+=this.Ht+Oq(this,e.ma(),!0));return a};function br(a,b){for(var c=new F,d=0;d<a.linkDataArray.length;d++)return c} t.hw=function(a,b){var c=Z.prototype.hw.call(this,a,b),d=this,e=new F,f=new F,g=new F,h=this.Jh;a.changes.each(function(a)):br(d,a.object).each(function(a){f.add(a)})))});var k=new F;e.each(function(a){k.add(d.Tb(a));b||f.add(a)});var l=new F;g.each(function(a){l.add(d.Tb(a)); b&&f.add(a)});a=c;0<k.count&&(a+=(b?this.Ht:this.Ft)+Oq(this,k.ma(),!0));0<f.count&&(a+=this.pw+Oq(this,f.ma(),!0));0<l.count&&(a+=(b?this.Ft:this.Ht)+Oq(this,l.ma(),!0));return a}; t.sq=function(a){(void 0!==a.linkCategoryProperty&&a.linkCategoryProperty!==this.linkCategoryProperty||void 0!==a.linkKeyProperty&&a.linkKeyProperty!==this.linkKeyProperty||void 0!==a.linkFromKeyProperty&&a.linkFromKeyProperty!==this.linkFromKeyProperty||void 0!==a.linkToKeyProperty&&a.linkToKeyProperty!==this.linkToKeyProperty||void 0!==a.linkFromPortIdProperty&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||void 0!==a.linkToPortIdProperty&&a.linkToPortIdProperty!==this.linkToPortIdProperty|| void 0!==a.linkLabelKeysProperty&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||void 0!==a.nodeIsGroupProperty&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||void 0!==a.nodeGroupKeyProperty&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&B("applyIncrementalJson cannot change Model properties");Z.prototype.sq.call(this,a);var b=a.insertedLinkKeys;if(Array.isArray(b))for(var c=b.length,d=0;d<c;d++)),this.zt(f,e),this.Ii(f))}b=a.modifiedLinkData; if(Array.isArray(b))for(c=b.length,d=0;d<c;d++)if(e=b[d],f=this.Tb(e),f=this.vg(f),null!==f)for(var g in e)"__gohashid"!==g&&g!==this.linkKeyProperty&&this.setDataProperty(f,g,e[g]);a=a.removedLinkKeys;if(Array.isArray(a))for(g=a.length,b=0;b<g;b++)c=this.vg(a[b]),null!c&&this.tm(c)}; t.Sj=function(a,b){if(a.changete){var c=a.newParam;if("linkDataArray"==a.modelChange){a=a.newValue;if(ya(a)&&"number"==typeof c){var d=this.Tb(a);b?(this.Vf.remove(a),this.Nc[c]==a&&this.Nc.splice(c,1),void 0!==d&&this.mb.remove(d)):(this.Vf.add(a),this.Nc[c]!==a&&this.Nc.splice(c,0,a),void 0!==d&&this.mb.add(d,a))}return}if("linkLabelKeys"==a.modelChange){d=this.zg(a.object);Array.isArray(d)&&"number"=typeof c&&(b?(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)):0>d.indexOf(a.newValue)&&d.splice(c, 0,a.newValue));return}}else if(a.changeue){c=a.oldParam;if("linkDataArray"==a.modelChange){a=a.oldValue;ya(a)&&"number"==typeof c&&(d=this.Tb(a),b?(this.Vf.add(a),this.Nc[c]!==a&&this.Nc.splice(c,0,a),void 0!==d&&this.mb.add(d,a)):(this.Vf.remove(a),this.Nc[c]a&&this.Nc.splice(c,1),void 0!==d&&this.mb.remove(d)));return}if("linkLabelKeys"==a.modelChange){d=this.zg(a.object);Array.isArray(d)&&"number"==typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue), 0<=c&&d.splice(c,1)));return}}Z.prototype.Sj.call(this,a,b)};t.lm=function(a){if(void 0!==a)return a}};t.qz=function(a){return vq(this,a,!0)};t.Ux=function(a,b){Dq(this,a,b,!0)};t.xz=function(a){return vq(this,a,!1)};t.Yx=function(a,b){Dq(this,a,b,!1)}; function vq(a,b,c){if(null!==b&&(a=c?a.Se:a.Te,""!==a&&(a=nn(b,a),void 0!a))){if(xq(a))return a;B((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}}function Dq(a,b,c,d){nullc&&(c=void 0);if(null!==b){var e=d?a.Se:a.Te;if(""!==e)if(c=a.lm(c),a.dd(b)){var f=nn(b,e);f!c&&(Bq(a,f,b),ek(b,e,c),nulla.Ib(c)&&Cq(a,c,b),Wq(a,d?"linkFromKey":"linkToKey",re,e,b,f,c),"string"=typeof e&&a.Aa(b,e))}else ek(b,e,c)}}t.rz=function(a){return uq(this,a,!0)}; t.Vx=function(a,b){Eq(this,a,b,!0)};t.yz=function(a){return uq(this,a,!1)};t.Zx=function(a,b){Eq(this,a,b,!1)};function uq(a,b,c){if(nullb)return"";a=c?a.wj:a.xj;if(===a)return;b=nn(b,a);return void 0b?:b}function Eq(a,b,c,d){if(null!==b){var e=d?a.wj:a.xj;if(!e)if(a.dd(b)){var f=nn(b,e);void 0f&&(f="");f!==c&&(ek(b,e,c),Wq(a,d?"linkFromPortId":"linkToPortId",re,e,b,f,c),"string"=typeof e&&a.Aa(b,e))}else ek(b,e,c)}} t.zg=function(a){if(nulla)return cr;var b=this.Ld;if(""=b)return cr;a=nn(a,b);return void 0a?cr:a};t.Pv=function(a,b){if(null!==a){var c=this.Ld;if(""!c)if(this.dd(a)){var d=nn(a,c);void 0d&&(d=cr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)Bq(this,d[f],a);ek(a,c,b);e=b.length;for(f=0;f<e;f++)Wq(this,"linkLabelKeys",re,c,a,d,b);"string"==typeof c&&this.Aa(a,c)}}else ek(a,c,b)}}; t.Pu=function(a,b){if(null!==b&&void 0!==b&&null!==a){var c=this.Ld;if(""!c){var d=nn(a,c);if(void 0d)c=[],c.push(b),this.Pv(a,c);else if(Array.isArray(d))else B(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}}; t.Px=function(a,b){if(null!==b&&void 0!==b&&null!==a)else void 0!==d&&B(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.Tb=function(a){if(null!==a){var b=this.pi;if(!==b&&(b=nn(a,b),void 0!==b)){if(xq(b))return b;B("Key value for link data "+a+" is not a number or a string: "+b)}}}; t.zt=function(a,b){if(null!==a){var c=this.pi;if(!==c)if(this.dd(a)){var d=nn(a,c);d!b&&nullthis.vg(b)&&(ek(a,c,b),void 0!d&&this.mb.remove(d),this.mb.add(b,a),Wq(this,"linkKey",re,c,a,d,b),"string"=typeof c&&this.Aa(a,c))}else ek(a,c,b)}};t.vg=function(a){null=a&&B("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!a&&xq(a)?this.mb.H(a):null}; t.mq=function(a){if(null!a){var b=this.pi;if(!b){var c=this.Tb(a);if(void 0=c||this.mb.contains(c)){var d=this.ul;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.mb.contains(c))){ek(a,b,c);return}if("string"=typeof c){for(d=2;this.mb.contains(c+d);)d++;ek(a,b,c+d)}else if(void 0=c||"number"===typeof c){for(c=-this.mb.count-1;this.mb.contains(c);)c--;ek(a,b,c)}}}}};t.dd=function(a);t.Ii=function(a){null!==a&&(ob(a),this.dd(a)||zq(this,a,!0))}; function zq(a,b,c){if(!a.linkKeyProperty){var d=a.Tb(b);if(void 0!d&&a.mb.H(d)=b)return;a.mq(b);d=a.Tb(b);if(void 0=d){B("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.mb.add(d,b)}a.Vf.add(b);d=null;c&&(d=a.Nc.length,a.Nc.splice(d,0,b));Wq(a,"linkDataArray",te,"linkDataArray",a,null,b,null,d);dr(a,b)}t.xy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;c<b;c++)this.Ii(a[c]);else for(a=a.iterator;a.next();)this.Ii(a.value)}; t.tm=function(a){null!a&&yq(this,a,!0)};function yq(a,b,c){a.Vf.remove(b);var d=a.Tb(b);void 0!d&&a.mb.remove(d);d=null;if(c)Wq(a,"linkDataArray",ue,"linkDataArray",a,b,null,d,null);c=vq(a,b,!0);Bq(a,c,b);c=vq(a,b,!1);Bq(a,c,b);d=a.zg(b);if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)c=d[f],Bq(a,c,b)}t.cA=function(a){if(Array.isArray(a))for(var b=a.length,c=0;c<b;c++)this.tm(a[c]);else for(a=a.iterator;a.next();)this.tm(a.value)}; t.Vz=function(a){if(za(a)){for(var b=new F(this.mb.iteratorKeys),c=new F,d=a.length,e=0;e<d;e++){var f=a[e],g=this.Tb(f);if(void 0!g){c.add(g);var h=this.vg(g);null!h?this.Rj(h,f):(h=,this.zt(h,g),this.Rj(h,f),this.Ii(h))}else this.Ii(f),c.add(this.Tb(f))}for(a=b.iterator;a.next();)b=a.value,c.contains(b)||(b=this.vg(b))&&this.tm(b)}}; function dr(a,b)t.Wp=function(a){if(null=a)return null;var b=this.Ik;a=null!b?b(a,this):Xq(this,a,!0);ya(a)&&(Za(a),!==this.Se&&ek(a,this.Se,void 0),!this.Te&&ek(a,this.Te,void 0),!this.Ld&&ek(a,this.Ld,[]));return a}; t.tv=function(a){if(null=a)return!1;var b=this.yl;returnb?!1:nn(a,b)?!0:!1};t.Si=function(a){if(null!==a){var b=this.oe;if(""!==b&&(b=nn(a,b),void 0!b)){if(xq(b))return b;B("GroupKey value for node data "+a+" is not a number or a string: "+b)}}}; t.yt=function(a,b){nullb&&(b=void 0);if(null!a){var c=this.oe;if(!==c)if(this.sb(a)){var d=nn(a,c);d!b&&(Bq(this,d,a),ek(a,c,b),null=this.Ib(b)&&Cq(this,b,a),Wq(this,"nodeGroupKey",re,c,a,d,b),"string"=typeof c&&this.Aa(a,c))}else ek(a,c,b)}};ar.prototype.copyNodeData=function(a){if(null=a)return null;a=Z.prototype.copyNodeData.call(this,a);this.Wj||=this.oe||void 0=nn(a,this.oe)||ek(a,this.oe,void 0);return a}; ar.prototype.setDataProperty=function(a,b,c){if(this.sb(a))if(b=this.nodeKeyProperty)this.Bm(a,c);else{if(b=this.nodeCategoryProperty){this.yq(a,c);return}if(b=this.nodeGroupKeyProperty){this.yt(a,c);return}}else if(this.dd(a)){if(b=this.linkFromKeyProperty){Dq(this,a,c,!0);return}if(b=this.linkToKeyProperty){Dq(this,a,c,!1);return}if(b=this.linkFromPortIdProperty){Eq(this,a,c,!0);return}if(b=this.linkToPortIdProperty){Eq(this,a,c,!1);return}if(b=this.linkKeyProperty){this.zt(a,c); return}if(b=this.linkCategoryProperty){this.xt(a,c);return}if(b=this.linkLabelKeysProperty){this.Pv(a,c);return}}var d=nn(a,b);d!c&&(ek(a,b,c),this.rt(a,b,d,c))};t=ar.prototype;t.Rj=function(a,b){if(b){var c=this.sb(a),d=this.dd(a),e;for(e in b)"__gohashid"=e||c&&e=this.nodeKeyProperty||d&&e=this.linkKeyProperty||this.setDataProperty(a,e,b[e])}}; t.wq=function(a,b){Z.prototype.wq.call(this,a,b);for(var c=this.ab.iterator;c.next();)this.Kv(c.value,a,b);for(c=this.Vf.iterator;c.next();){var d=c.value,e=a,f=b;if(vq(this,d,!0)e){var g=this.Se;ek(d,g,f);Wq(this,"linkFromKey",re,g,d,e,f);"string"typeof g&&this.Aa(d,g)}vq(this,d,!1)==e&&(g=this.Te,ek(d,g,f),Wq(this,"linkToKey",re,g,d,e,f),"string"==typeof g&&this.Aa(d,g));g=this.zg(d);if(Array.isArray(g))for(var h=g.length,k=this.Ld,l=0;l<h;l++)g[l]e&&(g[l]=f,Wq(this,"linkLabelKeys",te, k,d,e,f,l,l))}};t.Kv=function(a,b,c){if(this.Si(a)==b){var d=this.oe;ek(a,d,c);Wq(this,"nodeGroupKey",re,d,a,b,c);"string"==typeof d&&this.Aa(a,d)}};t.dw=function(){Z.prototype.dw.call(this);for(var a=this.linkDataArray,b=a.length,c=0;c<b;c++)dr(this,a[c])}; t.xm=function(a){Z.prototype.xm.call(this,a);a=this.ja(a);var b=Aq(this,a);if(null!==b){var c=Da();for(b=b.iterator;b.next();){var d=b.value;if(this.sb(d)){if(this.Si(d)==a){var e=this.oe;Wq(this,"nodeGroupKey",re,e,d,a,a);"string"==typeof e&&this.Aa(d,e);c.push(d)}}else if(vq(this,d,!0)==a&&(e=this.Se,Wq(this,"linkFromKey",re,e,d,a,a),"string"==typeof e&&this.Aa(d,e),c.push(d)),vq(this,d,!1)a&&(e=this.Te,Wq(this,"linkToKey",re,e,d,a,a),"string"typeof e&&this.Aa(d,e),c.push(d)),e=this.zg(d), Array.isArray(e))for(var f=e.length,g=this.Ld,h=0;h<f;h++)e[h]=a&&(Wq(this,"linkLabelKeys",te,g,d,a,a,h,h),c.push(d))}for(b=0;b<c.length;b++)Bq(this,a,c[b]);Fa(c)}};t.wm=function(a){Z.prototype.wm.call(this,a);var b=this.Si(a);nullthis.Ib(b)&&Cq(this,b,a)};t.Dq=function(a){Z.prototype.Dq.call(this,a);var b=this.Si(a);Bq(this,b,a)}; t.jv=function(a){if(nulla)return"";var b=this.vj;if(===b)return;b=nn(a,b);if(void 0b)return"";if("string"==typeof b)return b;B("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};ar.prototype.getLinkCategoryForData=function(a){return this.jv(a)};ar.prototype.xt=function(a,b){if(null!==a){var c=this.vj;if(""!c)if(this.dd(a)){var d=nn(a,c);void 0d&&(d=);d!==b&&(ek(a,c,b),Wq(this,"linkCategory",re,c,a,d,b),"string"===typeof c&&this.Aa(a,c))}else ek(a,c,b)}}; ar.prototype.setLinkCategoryForData=function(a,b){this.xt(a,b)};ar.prototype.dk=function(){return!0};ar.prototype.jm=function(){return!0};ar.prototype.ht=function(){return!0};ar.prototype.ek=function(){return!0}; ma.Object.defineProperties(ar.prototype,{archetypeNodeData:{get:function(),set:function(a)},linkFromKeyProperty:{get:function(),set:function(a)},linkToKeyProperty:{get:function(),set:function(a){var b=this.Te;b!==a&&(this.Te=a,this.g("linkToKeyProperty", b,a))}},linkFromPortIdProperty:{get:function(),set:function(a)},linkToPortIdProperty:{get:function(),set:function(a)},linkLabelKeysProperty:{get:function(),set:function(a){var b=this.Ld;b!==a&&(this.Ld=a,this.g("linkLabelKeysProperty", b,a))}},linkDataArray:{get:function(),set:function(a){var b=this.Nc;if(b!==a){this.mb.clear();for(var c=a.length,d=0;d<c;d++){var e=a[d];if(!ya(e)){B("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}ob(e)}this.Nc=a;if(!this.linkKeyProperty){d=new E;for(e=0;e<c;e++){var f=a[e],g=this.Tb(f);void 0g?d.add(f):null!this.mb.H(g)?d.add(f):this.mb.add(g,f)}for(d=d.iterator;d.next();)e=d.value,this.mq(e),f=this.Tb(e),void 0! f&&this.mb.add(f,e)}d=new F;for(e=0;e<c;e++)d.add(a[e]);this.Vf=d;Wq(this,"linkDataArray",re,"linkDataArray",this,b,a);for(b=0;b<c;b++)dr(this,a[b])}}},linkKeyProperty:{get:function(),set:function(a){var b=this.pi;if(b!a){this.pi=a;this.mb.clear();for(var c=this.linkDataArray.length,d=0;d<c;d++){var e=this.linkDataArray[d],f=this.Tb(e);void 0f&&(this.mq(e),f=this.Tb(e));void 0!==f&&this.mb.add(f,e)}this.g("linkKeyProperty",b,a)}}},makeUniqueLinkKeyFunction:{ get:function(),set:function(a)},copyLinkDataFunction:{get:function(),set:function(a)},nodeIsGroupProperty:{get:function(),set:function(a)},nodeGroupKeyProperty:{ get:function(),set:function(a)},Wj:{get:function(),set:function(a){this.gn!==a&&(this.gn=a)}},linkCategoryProperty:{get:function(),set:function(a)}});ma.Object.defineProperties(ar,{type:{get:function(){return"GraphLinksModel"}}}); ar.prototype.setCategoryForLinkData=ar.prototype.xt;ar.prototype.getCategoryForLinkData=ar.prototype.jv;ar.prototype.assignAllDataProperties=ar.prototype.Rj;ar.prototype.setGroupKeyForNodeData=ar.prototype.yt;ar.prototype.getGroupKeyForNodeData=ar.prototype.Si;ar.prototype.isGroupForNodeData=ar.prototype.tv;ar.prototype.copyLinkData=ar.prototype.Wp;ar.prototype.mergeLinkDataArray=ar.prototype.Vz;ar.prototype.removeLinkDataCollection=ar.prototype.cA;ar.prototype.removeLinkData=ar.prototype.tm; ar.prototype.addLinkDataCollection=ar.prototype.xy;ar.prototype.addLinkData=ar.prototype.Ii;ar.prototype.containsLinkData=ar.prototype.dd;ar.prototype.makeLinkDataKeyUnique=ar.prototype.mq;ar.prototype.findLinkDataForKey=ar.prototype.vg;ar.prototype.setKeyForLinkData=ar.prototype.zt;ar.prototype.getKeyForLinkData=ar.prototype.Tb;ar.prototype.removeLabelKeyForLinkData=ar.prototype.Px;ar.prototype.addLabelKeyForLinkData=ar.prototype.Pu;ar.prototype.setLabelKeysForLinkData=ar.prototype.Pv; ar.prototype.getLabelKeysForLinkData=ar.prototype.zg;ar.prototype.setToPortIdForLinkData=ar.prototype.Zx;ar.prototype.getToPortIdForLinkData=ar.prototype.yz;ar.prototype.setFromPortIdForLinkData=ar.prototype.Vx;ar.prototype.getFromPortIdForLinkData=ar.prototype.rz;ar.prototype.setToKeyForLinkData=ar.prototype.Yx;ar.prototype.getToKeyForLinkData=ar.prototype.xz;ar.prototype.setFromKeyForLinkData=ar.prototype.Ux;ar.prototype.getFromKeyForLinkData=ar.prototype.qz;ar.prototype.clear=ar.prototype.clear; var cr=Object.freeze([]);ar.className="GraphLinksModel";Zq.GraphLinksModel=ar;Z.constructGraphLinksModel=Z.constructGraphLinksModel=function();Z.initDiagramModel=Ci=function();function er(a){Z.call(this);this.pe="parent";this.jn=!1;this.Cj="parentLinkCategory";void 0!a&&(this.nodeDataArray=a)}la(er,Z);er.constructGraphLinksModel=Z.constructGraphLinksModel; er.prototype.cloneProtected=function(a){Z.prototype.cloneProtected.call(this,a);a.pe=this.pe;a.jn=this.jn;a.Cj=this.Cj};t=er.prototype;t.toString=function(a){void 0a&&(a=0);if(2<=a)return this.Bq();var b=(!==this.name?this.name:)+" TreeModel";if(0<a){b+=" node data:";a=this.nodeDataArray;for(var c=a.length,d=0;d<c;d++){var e=a[d];b+=" "+this.ja(e)+":"+Ia(e)}}return b}; t.uk=function(){var a=Z.prototype.uk.call(this),b=;"parent"!==this.nodeParentKeyProperty&&"string"===typeof this.nodeParentKeyProperty&&(b+=‘, "nodeParentKeyProperty": ‘+this.quote(this.nodeParentKeyProperty));return a+b};t.tq=function(a){Z.prototype.tq.call(this,a);a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)};t.Gq=function(a){Qq(this,a,"nodeParentKeyProperty");return Z.prototype.Gq.call(this,a)}; t.sq=function(a){void 0!==a.nodeParentKeyProperty&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&B("applyIncrementalJson cannot change Model properties");Z.prototype.sq.call(this,a)};t.lm=function(a);t.Ui=function(a){if(null!==a){var b=this.pe;if(!==b&&(b=nn(a,b),void 0!b)){if(xq(b))return b;B("ParentKey value for node data "+a+" is not a number or a string: "+b)}}}; t.Be=function(a,b){nullb&&(b=void 0);if(null!==a){var c=this.pe;if(""!==c)if(b=this.lm(b),this.sb(a)){var d=nn(a,c);d!b&&(Bq(this,d,a),ek(a,c,b),nullthis.Ib(b)&&Cq(this,b,a),Wq(this,"nodeParentKey",re,c,a,d,b),"string"=typeof c&&this.Aa(a,c))}else ek(a,c,b)}};t.kv=function(a){if(nulla)return"";var b=this.Cj;if(===b)return;b=nn(a,b);if(void 0b)return"";if("string"==typeof b)return b;B("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""}; er.prototype.getLinkCategoryForData=function(a){return this.kv(a)};er.prototype.Qv=function(a,b){if(null!==a){var c=this.Cj;if(""!c)if(this.sb(a)){var d=nn(a,c);void 0d&&(d="");d!==b&&(ek(a,c,b),Wq(this,"parentLinkCategory",re,c,a,d,b),"string"=typeof c&&this.Aa(a,c))}else ek(a,c,b)}};er.prototype.setLinkCategoryForData=function(a,b){this.Qv(a,b)}; er.prototype.copyNodeData=function(a){if(nulla)return null;a=Z.prototype.copyNodeData.call(this,a);this.Xj||""=this.pe||void 0nn(a,this.pe)||ek(a,this.pe,void 0);return a};er.prototype.setDataProperty=function(a,b,c){if(this.sb(a))if(bthis.nodeKeyProperty)this.Bm(a,c);else{if(b=this.nodeCategoryProperty){this.yq(a,c);return}if(b=this.nodeParentKeyProperty){this.Be(a,c);return}}var d=nn(a,b);d!c&&(ek(a,b,c),this.rt(a,b,d,c))};t=er.prototype; t.wq=function(a,b){Z.prototype.wq.call(this,a,b);for(var c=this.ab.iterator;c.next();)this.Kv(c.value,a,b)};t.Kv=function(a,b,c){if(this.Ui(a)b){var d=this.pe;ek(a,d,c);Wq(this,"nodeParentKey",re,d,a,b,c);"string"typeof d&&this.Aa(a,d)}}; t.xm=function(a){Z.prototype.xm.call(this,a);a=this.ja(a);var b=Aq(this,a);if(null!==b){var c=Da();for(b=b.iterator;b.next();){var d=b.value;if(this.sb(d)&&this.Ui(d)==a){var e=this.pe;Wq(this,"nodeParentKey",re,e,d,a,a);"string"=typeof e&&this.Aa(d,e);c.push(d)}}for(b=0;b<c.length;b++)Bq(this,a,c[b]);Fa(c)}};t.wm=function(a){Z.prototype.wm.call(this,a);var b=this.Ui(a);b=this.lm(b);nullthis.Ib(b)&&Cq(this,b,a)};t.Dq=function(a){Z.prototype.Dq.call(this,a);var b=this.Ui(a);Bq(this,b,a)}; t.km=function(){return!0};t.ht=function(){return!0}; ma.Object.defineProperties(er.prototype,{nodeParentKeyProperty:{get:function(),set:function(a)},Xj:{get:function(),set:function(a){this.jn!a&&(this.jn=a)}},parentLinkCategoryProperty:{get:function(),set:function(a)}, linkCategoryProperty:{get:function(),set:function(a)}});ma.Object.defineProperties(er,{type:{get:function(){return"TreeModel"}}});er.prototype.setParentLinkCategoryForNodeData=er.prototype.Qv;er.prototype.getParentLinkCategoryForNodeData=er.prototype.kv;er.prototype.setParentKeyForNodeData=er.prototype.Be;er.prototype.getParentKeyForNodeData=er.prototype.Ui; er.className="TreeModel";Zq.TreeModel=er;function fr(){Di.call(this);this.Dw=this.xn=this.Zb=0;this.mr=360;this.Cw=gr;this.jj=0;this.rw=new H;this.br=this.Qd=0;this.Js=new ir;this.Ot=this.Bj=0;this.my=600;this.Vo=NaN;this.Vm=1;this.Bp=0;this.Ol=360;this.Bb=gr;this.J=jr;this.Pc=kr;this.Jc=Zp;this.af=6;this.Fo=lr}la(fr,Di); fr.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Vo=this.Vo;a.Vm=this.Vm;a.Bp=this.Bp;a.Ol=this.Ol;a.Bb=this.Bb;a.J=this.J;a.Pc=this.Pc;a.Jc=this.Jc;a.af=this.af;a.Fo=this.Fo}; fr.prototype.cb=function(a){if(a.classTypefr)if(amr||a=nr||a=or||a=pr||a=kr)this.sorting=a;else if(a=qr||a=rr||a=jr||a=sr)this.direction=a;else if(a=tr||a=ur||a=gr||a=vr)this.arrangement=a;else{if(a=wr||a=lr)this.nodeDiameterFormula=a}else Di.prototype.cb.call(this,a)};fr.prototype.createNetwork=function(){return new xr(this)}; fr.prototype.doLayout=function(a){null=this.network&&(this.network=this.makeNetwork(a));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);a=this.network.vertexes;if(1>=a.count)1=a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new E;b.addAll(a.iterator);a=new E;var c=new E;var d=this.sort(b);var e,f,g=this.br;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)||360<p||1>p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h=vr&&k=wr?h=gr:h=vr&&k!wr&&(h=this.arrangement);if((this.direction=qr||this.direction=rr)&&this.sorting!kr){for(k=0;!(k>=d.length);k+=2){a.add(d.L(k));if(k+1>=d.length)break;c.add(d.L(k+1))}this.direction=qr?(this.arrangement=vr&&a.reverse(),d=new E,d.addAll(a),d.addAll(c)):(this.arrangement=vr&&c.reverse(),d=new E,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;r< d.length;r++)if(isNaN(l)||h=vr){isNaN(b)&&(b=6);if(h!gr&&h!vr)else l=zr(this,e+(360<=p?k:k-1)(h!==vr?b:1.6b),m,n* Math.PI/180,pMath.PI/180);f=lm}else if(f=lm,r=Ar(this,l,f,nMath.PI/180,p*Math.PI/180),isNaN(b)){if(h=gr||h=vr)b=(r-e)/(360<=p?k:k-1)}else if(h=gr||h=vr)r=(r-e)/(360<=p?k:k-1),r<b?(l=zr(this,e+b*(360<=p?k:k-1),m,nMath.PI/180,pMath.PI/180),f=l*m):b=r;else{g=-Infinity;for(e=0;e<k;e++)q=d.L(e),u=d.L(e=k-1?0:e+1),isNaN(q.diameter)&&yr(q,0),isNaN(u.diameter)&&yr(u,0),g=Math.max(g,(q.diameter+u.diameter)/2);g+=b;e=zr(this,g*(360<=p?k:k-1),m,nMath.PI/180,pMath.PI/180);e>l?(l=e,f=l*m):g= r/(360<=p?k:k-1)}this.Cw=h;this.Zb=l;this.xn=m;this.Dw=n;this.mr=p;this.jj=b;this.Qd=f;this.br=g;b=d;d=this.Cw;h=this.Zb;l=this.Dw;m=this.mr;n=this.jj;p=this.Qd;k=this.br;if(this.direction!qr&&this.direction!rr||d!vr)if(this.direction=qr||this.direction=rr)if(this.direction qr){switch(d){case ur:Cr(this,a,l,sr);break;case gr:Dr(this,a,l,sr);break;case tr:Er(this,a,m/2,l,sr)}switch(d){case ur:Cr(this,c,l+g,jr);break;case gr:Dr(this,c,l+g,jr);break;case tr:Er(this,c,m/2,l+g,jr)}}else{switch(d){case ur:Cr(this,c,l,sr);break;case gr:Dr(this,c,l,sr);break;case tr:Er(this,c,m/2,l,sr)}switch(d){case ur:Cr(this,a,l+g,jr);break;case gr:Dr(this,a,l+g,jr);break;case tr:Er(this,a,m/2,l+g,jr)}}}else switch(d){case ur:Cr(this,b,l,this.direction);break;case gr:Dr(this,b,l,this.direction); break;case tr:Er(this,b,m,l,this.direction);break;case vr:Fr(this,b,m,l,this.direction)}else Fr(this,b,m,l-m/2,jr)}this.updateParts();this.network=null;this.isValidLayout=!0};function Er(a,b,c,d,e)} function Dr(a,b,c,d)} function Cr(a,b,c,d)}function Fr(a,b,c,d,e){var f=a.mr;a.Bj=0;a.Js=new ir;if(360>c){for(f=d+(e=jr?f:-f);0>f;)f+=360;f%=360;180<f&&(f-=360);f*=Math.PI/180;a.Ot=f;Gr(a,b,c,d,e)}else Hr(a,b,c,d,e);a.Js.commit(b)} function Hr(a,b,c,d,e){var f=a.Zb,g=a.jj,h=a.xn,k=fMath.cos(dMath.PI/180),l=a.QdMath.sin(dMath.PI/180),m=b.ma();if(3=m.length)m[0].centerX=f,m[0].centerY=0,m[1].centerX=m[0].centerX-m[0].width/2-m[1].width/2-g,m[1].y=m[0].y,m[2].centerX=(m[0].centerX+m[1].centerX)/2,m[2].y=m[0].y-m[2].height-g;else if(4=m.length)m[0].centerX=f,m[0].centerY=0,m[2].centerX=-m[0].centerX,m[2].centerY=m[0].centerY,m[1].centerX=0,m[1].y=Math.min(m[0].y,m[2].y)-m[1].height-g,m[3].centerX=0,m[3].y=Math.max(m[0].y+ m[0].height+g,m[2].y+m[2].height+g);elseH.free(f);a.Bj++;if(!(23<a.Bj)){k=m[0].centerX;l=m[0].centerY;f=m[m.length-1].centerX;n=m[m.length-1].centerY;var p=Math.abs(k-f)-((m[0].width+m[m.length-1].width)/2+g),r=Math.abs(l-n)-((m[0].height+m[m.length-1].height)/2+g);g=0;1>Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0<r?r:1>Math.abs(p)? 0:p;k=Math.abs(f)>Math.abs(n)?0<f!l>n:0<n!k<f;if(k=e=jr?k:!k)g=-Math.abs(g),g=Math.min(g,-m[m.length-1].width),g=Math.min(g,-m[m.length-1].height);a.Js.compare(g,m);1<Math.abs(g)&&(a.Zb=8>a.Bj?a.Zb-g/(2Math.PI):5>m.length&&10<g?a.Zb/2:a.Zb-(0<g?1.7:-2.3),a.Qd=a.Zbh,Hr(a,b,c,d,e))}}} function Gr(a,b,c,d,e){for(var f=a.Zb,g=a.Qd,h=a.xn,k=fMath.cos(dMath.PI/180),l=gMath.sin(dMath.PI/180),m=H.alloc(),n=b.ma(),p=0;p<n.length;p++){n[p].centerX=k;n[p].centerY=l;if(p>=n.length-1)break;Ir(a,k,l,n,p,e,m)||Jr(a,k,l,n,p,e,m);k=m.x;l=m.y}H.free(m);a.Bj++;if(!(23<a.Bj)){k=Math.atan2(l,k);k=e=jr?a.Ot-k:k-a.Ot;k=Math.abs(k)<Math.abs(k-2Math.PI)?k:k-2Math.PI;f=k*(f+g)/2;g=a.Js;if(Math.abs(f)<Math.abs(g.fm))for(g.fm=f,g.vk=[],g.Gm=[],k=0;k<n.length;k++)g.vk[k]=n[k].bounds.x,g.Gm[k]=n[k].bounds.y; 1<Math.abs(f)&&(a.Zb=8>a.Bj?a.Zb-f/(2Math.PI):a.Zb-(0<f?1.7:-2.3),a.Qd=a.Zbh,Gr(a,b,c,d,e))}}function Ir(a,b,c,d,e,f,g)}else if(f=b-a,f<-h)l=Math.sqrt(1-Math.min(1,ff/(hh)))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 Jr(a,b,c,d,e,f,g)d=!0}}else if(f=c+a,f>k)d=!0}l=Math.sqrt(1-Math.min(1,ff/(kk)))h;0>b!==d&&(l=-l);g.x=l;g.y=f}fr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; fr.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 H(0,0):(c.x=this.arrangementOrigin.x+this.Zb,c.y=this.arrangementOrigin.y+this.Qd);for(var d=this.network.vertexes.iterator;d.next();)a&&(this.group.zb(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.Xd(c.Xd(a)),this.group.move(b),this.rw=b.Xd(a))}; fr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Ar(a,b,c,d,e){var f=a.my;if(.001>Math.abs(a.xn-1))return void 0!==d&&void 0!==e?eb:2Math.PIb;a=b>c?Math.sqrt(bb-cc)/b:Math.sqrt(cc-bb)/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+le/f:k=lMath.PI/(2f);var m=Math.sin(k);g+=Math.sqrt(1-aamm)h}return void 0!==d&&void 0!==e?(b>c?b:c)g:4(b>c?b:c)g} function zr(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?Ar(a,1,c,d,e):Ar(a,1,c))}function Br(a,b,c,d,e){if(.001>Math.abs(a.xn-1))return e/b;var f=b>c?Math.sqrt(bb-cc)/b:Math.sqrt(cc-bb)/c,g=0;a=2Math.PI/(700a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+ha);g+=(b>c?b:c)Math.sqrt(1-ffk*k)a;if(g>=e)return ha}} fr.prototype.sort=function(a){switch(this.sorting){case or:break;case pr:a.reverse();break;case mr:a.sort(this.comparer);break;case nr:a.sort(this.comparer);a.reverse();break;case kr:for(var b=[],c=0;c<a.length;c++)b.push(0);c=new E;for(var d=0;d<a.length;d++)else for(g=0;g<a.length;g++)h=b[g],h>e&&(e=h,f=g);c.add(a.L(f));b[f]=-1;f=a.L(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<= b[e]&&b[e];for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]}a=[];for(b=0;b<c.length;b++)f=[];for(b=0;b<a.length;b++)f[b]=0;b=[];g=[];h=[];e=[];d=new E;for(var k=0,l=0;l<a.length;l++){var m=a[l].length;if(1=m)e.push(l);else if(0=m)d.add(c.L(l)); else{if(0=k)b.push(l);else{for(var n=m=Infinity,p=-1,r=[],q=0;q<b.length;q++)0>a[b[q]].indexOf(b[q=b.length-1?0:q+1])&&r.push(q=b.length-1?0:q+1);if(0=r.length)for(q=0;q<b.length;q++)r.push(q);for(q=0;q<r.length;q++){for(var u=r[q],v=a[l],w=0,y=0;y<g.length;y++)else C=A;if(C<u&&u<=z)for(A=0;A<v.length;A++)else for(A=0;A<v.length;A++)J=v[A],0>b.indexOf(J)||C<f[J]&&f[J]<z&&C!=f[J]&& z!f[J]&&w++}v=w;for(y=w=0;y<a[l].length;y++)C=b.indexOf(a[l][y]),0<=C&&(C=Math.abs(u-(C>=u?C+1:C)),w+=C<b.length+1-C?C:b.length+1-C);for(y=0;y<g.length;y++)C=f[g[y]],z=f[h[y]],C>=u&&C++,z>=u&&z++,C>z&&(A=z,z=C,C=A),z-C<(b.length+2)/2(C<u&&u<=z)&&w++;if(v<m||v=m&&w<n)m=v,n=w,p=u}b.splice(p,0,l);for(m=0;m<b.length;m++)f[b[m]]=m;for(m=0;m<a[l].length;m++)n=a[l][m],0<=b.indexOf(n)&&(g.push(l),h.push(n))}k++}}for(g=b.length;;)else f=!1;if(f)break;else b.push(e[0]),e.splice(0,1)}for(a=0;a<b.length;a++)d.add(c.L(b[a]));return d;default:B("Invalid sorting type.")}return a}; ma.Object.defineProperties(fr.prototype,{radius:{get:function(),set:function(a){this.Vo!a&&(0<a||isNaN(a))&&(this.Vo=a,this.C())}},aspectRatio:{get:function(),set:function(a){this.Vm!a&&0<a&&(this.Vm=a,this.C())}},startAngle:{get:function(),set:function(a){this.Bp!a&&(this.Bp=a,this.C())}},sweepAngle:{get:function(), set:function(a){this.Ol!a&&(0<a&&360>=a?this.Ol=a:this.Ol=360,this.C())}},arrangement:{get:function(),set:function(a)},direction:{get:function(),set:function(a)},sorting:{get:function(),set:function(a){this.Pc=a||a!or&&a!pr&& a!mr&&!nr&&a!kr||(this.Pc=a,this.C())}},comparer:{get:function(),set:function(a){this.Jc!a&&(this.Jc=a,this.C())}},spacing:{get:function(),set:function(a){this.af!a&&(this.af=a,this.C())}},nodeDiameterFormula:{get:function(),set:function(a)},actualXRadius:{get:function()}, actualYRadius:{get:function()},actualSpacing:{get:function()},actualCenter:{get:function()}}); var gr=new D(fr,"ConstantSpacing",0),ur=new D(fr,"ConstantDistance",1),tr=new D(fr,"ConstantAngle",2),vr=new D(fr,"Packed",3),jr=new D(fr,"Clockwise",4),sr=new D(fr,"Counterclockwise",5),qr=new D(fr,"BidirectionalLeft",6),rr=new D(fr,"BidirectionalRight",7),or=new D(fr,"Forwards",8),pr=new D(fr,"Reverse",9),mr=new D(fr,"Ascending",10),nr=new D(fr,"Descending",11),kr=new D(fr,"Optimized",12),lr=new D(fr,"Pythagorean",13),wr=new D(fr,"Circular",14);fr.className="CircularLayout";fr.ConstantSpacing=gr; fr.ConstantDistance=ur;fr.ConstantAngle=tr;fr.Packed=vr;fr.Clockwise=jr;fr.Counterclockwise=sr;fr.BidirectionalLeft=qr;fr.BidirectionalRight=rr;fr.Forwards=or;fr.Reverse=pr;fr.Ascending=mr;fr.Descending=nr;fr.Optimized=kr;fr.Pythagorean=lr;fr.Circular=wr;function ir() ir.prototype.compare=function(a,b){if(0<a&&0>this.fm||Math.abs(a)<Math.abs(this.fm)&&!(0>a&&0<this.fm))for(this.fm=a,this.vk=[],this.Gm=[],a=0;a<b.length;a++)this.vk[a]=b[a].bounds.x,this.Gm[a]=b[a].bounds.y};ir.prototype.commit=function(a){if(null!this.vk&&null!this.Gm)for(var b=0;b<this.vk.length;b++)};ir.className="VertexArrangement";function xr(a){Pp.call(this,a)}la(xr,Pp);xr.prototype.createVertex=function(){return new Kr(this)}; xr.prototype.createEdge=function(){return new Lr(this)};xr.className="CircularNetwork";function Kr(a){Sp.call(this,a);this.I=this.ij=NaN}la(Kr,Sp); function yr(a,b){var c=a.network;if(null=c)return NaN;c=c.layout;if(null=c)return NaN;if(c.arrangement=vr)if(c.nodeDiameterFormula=wr)a.ij=Math.max(a.width,a.height);else{c=Math.abs(Math.sin(b));b=Math.abs(Math.cos(b));if(0=c)return a.width;if(0=b)return a.height;a.ij=Math.min(a.height/c,a.width/b)}else a.ij=c.nodeDiameterFormula=wr?Math.max(a.width,a.height):Math.sqrt(a.widtha.width+a.heighta.height);return a.ij} ma.Object.defineProperties(Kr.prototype,{diameter:{get:function(),set:function(a){this.ij!a&&(this.ij=a)}},actualAngle:{get:function(),set:function(a){this.I!a&&(this.I=a)}}});Kr.className="CircularVertex";function Lr(a){Tp.call(this,a)}la(Lr,Tp);Lr.className="CircularEdge"; function Mr(){Di.call(this);this.wh=null;this.$n=0;this.yd=(new Kb(100,100)).freeze();this.Um=!1;this.Ze=!0;this.Wc=!1;this.vl=100;this.An=1;this.Sf=1E3;this.wo=10;this.Wo=Math;this.Qk=.05;this.Pk=50;this.Nk=150;this.Ok=0;this.rn=10;this.qn=5}la(Mr,Di); Mr.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.yd.assign(this.yd);a.Um=this.Um;a.Ze=this.Ze;a.Wc=this.Wc;a.vl=this.vl;a.An=this.An;a.Sf=this.Sf;a.wo=this.wo;a.Wo=this.Wo;a.Qk=this.Qk;a.Pk=this.Pk;a.Nk=this.Nk;a.Ok=this.Ok;a.rn=this.rn;a.qn=this.qn};Mr.prototype.createNetwork=function(){return new Nr(this)}; Mr.prototype.doLayout=function(a)for(b=this.network.edges.iterator;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);this.Ru();this.$n=0;if(this.needsClusterLayout()){b=this.network;for(c=b.ay().iterator;c.next();)Or(this,0,a)}this.network=b;c.reset();d=this.arrangementSpacing;for(var f=c.count,g=!0,h=e=0,k=Da(),l=0;l<f+b.vertexes.count+2;l++)k[l]=null;f=0;c.reset();for(var m=M.alloc();c.next();)if(l=c.value,this.computeBounds(l,m),g)g=!1,e=m.x+m.width/2,h=m.y+m.height/2,k[0]=new H(m.x+m.width+d.width,m.y),k[1]=new H(m.x,m.y+m.height+d.height),f=2;else{var n=Pr(k,f,e,h,m.width,m.height, d),p=k[n],r=new H(p.x+m.width+d.width,p.y),q=new H(p.x,p.y+m.height+d.height);n+1<f&&k.splice(n+1,0,null);k[n]=r;k[n+1]=q;f++;n=p.x-m.x;p=p.y-m.y;for(l=l.vertexes.iterator;l.next();)r=l.value,r.centerX+=n,r.centerY+=p}M.free(m);for(l=b.vertexes.iterator;l.next();)g=l.value,r=g.bounds,2>f?(e=r.x+r.width/2,h=r.y+r.height/2,k[0]=new H(r.x+r.width+d.width,r.y),k[1]=new H(r.x,r.y+r.height+d.height),f=2):(m=Pr(k,f,e,h,r.width,r.height,d),p=k[m],n=new H(p.x+r.width+d.width,p.y),r=new H(p.x,p.y+r.height+ d.height),m+1<f&&k.splice(m+1,0,null),k[m]=n,k[m+1]=r,f++,g.centerX=p.x+g.width/2,g.centerY=p.y+g.height/2);Fa(k);for(c.reset();c.next();)}Qr(this,a);this.updateParts()}this.vl=a;this.network=null;this.isValidLayout=!0}; Mr.prototype.needsClusterLayout=function(){if(3>this.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.Gc(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};Mr.prototype.computeBounds=function(a,b)return b}; function Or(a,b,c){if(Rr(a,b)));for(c=0;c<b.length;c++)Ur(a,b[c]);a.Sf=d}} function Rr(a,b){if(10<b||3>a.network.vertexes.count)return!1;a.wh=a.network.vertexes.ma();a=a.wh;a.sort(function(a,b));for(b=a.length-1;0<=b&&1>=a[b].vd;)b--;return 1<a.length-b} function Sr(a,b){for(var c=a.network,d=new Nr(a),e=0;e<a.wh.length;e++){var f=a.wh[e];if(1<f.vd){d.zh(f);var g=new Vr;g.Dt=f.vd;g.Et=f.width;g.Ct=f.height;g.kw=f.focus.x;g.lw=f.focus.y;null=f.Ae&&(f.Ae=new E);f.Ae.add(g);f.Nv=f.Ae.count-1}else break}for(f=c.edges.iterator;f.next();){var h=f.value;e=h.fromVertex;g=h.toVertex;e.network=d&&g.network=d?d.Sp(h):e.network=d?(h=e.Vj,null=h&&(h=new E,e.Vj=h),h.add(g),e.vd--,e.Gh+=g.Gh):g.network=d&&(h=g.Vj,null=h&&(h=new E,g.Vj=h),h.add(e), g.vd--,g.Gh+=e.Gh)}for(e=d.edges.iterator;e.next();)f=e.value,f.length*=Math.max(1,I.sqrt((f.fromVertex.Gh+f.toVertex.Gh)/(4b+1)));for(b=d.vertexes.iterator;b.next();)}null!==p&&(l+=p.length,h+=n.widthn.height)}f=e.centerX;k=e.centerY;m=e.width;n=e.height;p=e.focus;r=mn;1>r&& (r=1);h=I.sqrt((h+r+ll4/(gg))/r);g=(h-1)m/2;h=(h-1)n/2;e.bounds=new M(f-p.x-g,k-p.y-h,m+2g,n+2h);e.focus=new H(p.x+g,p.y+h)}}a.network=d;return c}function Tr(a,b){for(var c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!d.Ae){var e=d.Ae.L(d.Nv);d.vd=e.Dt;var f=e.kw,g=e.lw;d.bounds=new M(d.centerX-f,d.centerY-g,e.Et,e.Ct);d.focus=new H(f,g);d.Nv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Ur(a,b)if(0!k)for(0<l&&(g/=l),l=b=0,b=h?2Math.PI/(k+1):2Math.PI/k,0=k%2&&(l=b/2),1<c.count&&c.sort(function(a,b)), h=0=k%2?0:1,c=c.iterator;c.next();)if(k=c.value,!(1<k.vd||a.isFixed(k)))n=k.width;var p=k.height;n=I.sqrt(nn+pp)/2;m=f+m.length+n;n=g+(b*(h/2>>1)+l)*(0=h%2?1:-1);k.centerX=d+mMath.cos(n);k.centerY=e+mMath.sin(n);h++}}} function Pr(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;l<b;l++){var m=a[l],n=m.x-c,p=m.y-d;n=nn+pp;if(n<h){for(p=l-1;0<=p;p--)if(a[p].y>m.y&&a[p].x-m.x<e+g.width)continue a;for(p=l+1;p<b;p++)if(a[p].x>m.x&&a[p].y-m.y<f+g.height)continue a;k=l;h=n}}return k}Mr.prototype.Ru=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)}; Mr.prototype.addComments=function(a)}if(null=c)for(e=d.sourceEdges;e.next();)if(f=e.value,f.fromVertex=a)null=c&&(c=this.network.hk(a,d,null));c.length=this.defaultCommentSpringLength}}}; function Wr(a,b){var c=a.bounds,d=c.x;a=c.y;var e=c.width;c=c.height;var f=b.bounds,g=f.x;b=f.y;var h=f.width;f=f.height;return d+e<g?a>b+f?(c=d+e-g,a=a-b-f,I.sqrt(cc+aa)):a+c<b?(d=d+e-g,a=a+c-b,I.sqrt(dd+aa)):g-(d+e):d>g+h?a>b+f?(c=d-g-h,a=a-b-f,I.sqrt(cc+aa)):a+c<b?(d=d-g-h,a=a+c-b,I.sqrt(dd+aa)):d-(g+h):a>b+f?a-(b+f):a+c<b?b-(a+c):.1}function Qr(a,b) function Xr(a)(e=e-d>f-c)?b.sort(function(a,b)):b.sort(function(a,b));c=a.Sf;var l=d=h=0;for(f= 0;f<b.length;f++)else if(m-r>c||r-m>c){if(!e)break}else{var q=Wr(g,p);1>q?(d=a.randomNumberGenerator,null=d&&(a.randomNumberGenerator=d=new Yr),q=d.random(), h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)q):k<l?(d=Math.abs(p.bounds.x-g.bounds.right),d=-(1+d)q):(d=Math.max(p.width,g.width),d=(1+d)q-d/2),m>r?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)h):k<l?(l=Math.abs(p.bounds.y-g.bounds.bottom),l=-(1+l)h):(l=Math.max(p.height,g.height),l=(1+l)h-l/2)):(h=-(g.chargep.charge)/(qq),d=(l-k)/qh,l=(r-m)/qh);g.forceX+=d;g.forceY+=l;p.forceX-=d;p.forceY-=l}}}}for(e=a.network.edges.iterator;e.next();)h=e.value,c=h.fromVertex,f=h.toVertex, g=c.bounds,k=c.focus,d=g.x+k.x,g=g.y+k.y,m=f.bounds,n=f.focus,k=m.x+n.x,m=m.y+n.y,n=Wr(c,f),1>n?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Yr),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)/nh,l=(m-g)/nh),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;d=0;e=a.moveLimit;for(c=0;c<b.length;c++)f=b[c],a.isFixed(f)?a.moveFixedVertex(f):(g=f.forceX,k= f.forceY,g<-e?g=-e:g>e&&(g=e),k<-e?k=-e:k>e&&(k=e),f.centerX+=g,f.centerY+=k,d=Math.max(d,gg+kk));return d>a.epsilonDistancea.epsilonDistance}Mr.prototype.moveFixedVertex=function();Mr.prototype.commitLayout=function(){this.Rv();this.commitNodes();this.isRouting&&this.commitLinks()};Mr.prototype.Rv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();)}; Mr.prototype.commitNodes=function()c=M.alloc();for(var d=this.network.vertexes.iterator;d.next();)M.free(c)};Mr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()}; Mr.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Qk:a};Mr.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Pk:a};Mr.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Nk:a};Mr.prototype.electricalFieldX=function(){return 0};Mr.prototype.electricalFieldY=function(){return 0};Mr.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Ok:a};Mr.prototype.gravitationalFieldX=function(){return 0}; Mr.prototype.gravitationalFieldY=function(){return 0};Mr.prototype.isFixed=function(a); ma.Object.defineProperties(Mr.prototype,{currentIteration:{get:function(){return this.$n}},arrangementSpacing:{get:function(),set:function(a){this.yd.A(a)||(this.yd.assign(a),this.C())}},arrangesToOrigin:{get:function(),set:function(a){this.Um!a&&(this.Um=a,this.C())}},setsPortSpots:{get:function(),set:function(a){this.Ze!a&&(this.Ze= a,this.C())}},comments:{get:function(),set:function(a){this.Wc!a&&(this.Wc=a,this.C())}},maxIterations:{get:function(),set:function(a){this.vl!a&&0<=a&&(this.vl=a,this.C())}},epsilonDistance:{get:function(),set:function(a){this.An!a&&0<a&&(this.An=a,this.C())}},infinityDistance:{get:function(),set:function(a){this.Sf! a&&1<a&&(this.Sf=a,this.C())}},moveLimit:{get:function(),set:function(a){this.wo!a&&1<a&&(this.wo=a,this.C())}},randomNumberGenerator:{get:function(),set:function(a){this.Wo!a&&(null!a&&"function"!typeof a.random&&B(‘ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: ‘+a),this.Wo=a)}},defaultSpringStiffness:{get:function(), set:function(a){this.Qk!a&&(this.Qk=a,this.C())}},defaultSpringLength:{get:function(),set:function(a){this.Pk!a&&(this.Pk=a,this.C())}},defaultElectricalCharge:{get:function(),set:function(a){this.Nk!a&&(this.Nk=a,this.C())}},defaultGravitationalMass:{get:function(),set:function(a){this.Ok!a&&(this.Ok=a,this.C())}},defaultCommentSpringLength:{ get:function(),set:function(a){this.rn!a&&(this.rn=a,this.C())}},defaultCommentElectricalCharge:{get:function(),set:function(a){this.qn!a&&(this.qn=a,this.C())}}});Mr.className="ForceDirectedLayout";function Vr()Vr.className="ForceDirectedSubnet";function Nr(a){Pp.call(this,a)}la(Nr,Pp);Nr.prototype.createVertex=function(){return new Zr(this)};Nr.prototype.createEdge=function(){return new $r(this)}; Nr.className="ForceDirectedNetwork";function Zr(a){Sp.call(this,a);this.Ja=!1;this.Za=this.I=NaN;this.Gh=this.vd=this.Ia=this.Y=0;this.Ae=this.Vj=null;this.Nv=0}la(Zr,Sp); ma.Object.defineProperties(Zr.prototype,{isFixed:{get:function(),set:function(a){this.Ja!a&&(this.Ja=a)}},charge:{get:function(),set:function(a){this.I!a&&(this.I=a)}},mass:{get:function(),set:function(a){this.Za!a&&(this.Za=a)}},forceX:{get:function(),set:function(a){this.Y!a&&(this.Y=a)}},forceY:{ get:function(),set:function(a){this.Ia!a&&(this.Ia=a)}}});Zr.className="ForceDirectedVertex";function $r(a){Tp.call(this,a);this.l=this.u=NaN}la($r,Tp);ma.Object.defineProperties($r.prototype,{stiffness:{get:function(),set:function(a){this.u!a&&(this.u=a)}},length:{get:function(),set:function(a){this.l!a&&(this.l=a)}}});$r.className="ForceDirectedEdge"; function Yr(){var a=0;void 0=a&&(a=42);this.seed=a;this.ey=48271;this.hy=2147483647;this.Q=44488.07041494893;this.jy=3399;this.gy=1/2147483647;this.random()}Yr.prototype.random=function(){var a=this.seed%this.Qthis.ey-this.seed/this.Qthis.jy;0<a?this.seed=a:this.seed=a+this.hy;return this.seed*this.gy};Yr.className="RandomNumberGenerator"; function as(){Di.call(this);this.Yb=this.ie=25;this.J=0;this.Lk=bs;this.ql=cs;this.fl=ds;this.tj=4;this.yk=es;this.ig=7;this.Ze=!0;this.ho=4;this.Ea=this.Sr=this.wa=-1;this.pd=this.ro=0;this.Ha=this.nd=this.od=this.Kd=this.fc=null;this.Bo=0;this.Ao=this.yj=null;this.Od=0;this.Co=null;this.Ff=new H;this.me=[];this.me.length=100}la(as,Di); as.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.ie=this.ie;a.Yb=this.Yb;a.J=this.J;a.Lk=this.Lk;a.ql=this.ql;a.fl=this.fl;a.tj=this.tj;a.yk=this.yk;a.ig=this.ig;a.Ze=this.Ze;a.ho=this.ho}; as.prototype.cb=function(a){a.classType=as?0=a.name.indexOf("Aggressive")?this.aggressiveOption=a:0=a.name.indexOf("Cycle")?this.cycleRemoveOption=a:0=a.name.indexOf("Init")?this.initializeOption=a:0=a.name.indexOf("Layer")?this.layeringOption=a:B("Unknown enum value: "+a):Di.prototype.cb.call(this,a)};as.prototype.createNetwork=function(){return new fs(this)}; as.prototype.doLayout=function(a){null=this.network&&(this.network=this.makeNetwork(a));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);this.Sr=-1;this.pd=this.ro=0;this.Co=this.Ao=this.yj=null;for(a=0;a<this.me.length;a++)this.me[a]=null;if(0<this.network.vertexes.count){this.network.Xp();this.cycleRemoveOption!gs&&this.removeCycles();for(a=this.network.vertexes.iterator;a.next();)a.value.layer=-1;this.wa=-1;this.assignLayers();for(a.reset();a.next();)this.wa=Math.max(this.wa, a.value.layer);this.cycleRemoveOption=gs&&this.removeCycles();a=this.network;for(var b=[],c=a.edges.iterator;c.next();)for(c=0;c<b.length;c++)var q= e.focus;l=f.focus;var u=d.rev?f.bounds:e.bounds;r=H.alloc();m!n?u.v()&&n.isVisible()?n.actualBounds.v()?(n.rf(p,Bc,r),r.x+=n.actualBounds.x-u.x,r.y+=n.actualBounds.y-u.y):(n.rf(p,Bc,r),r.v()||r.assign(q)):r.assign(q):u.v()?(n.rf(p,Bc,r),r.v()||r.assign(q)):r.assign(q);n=d.rev?e.bounds:f.bounds;m=H.alloc();g!k?n.v()&&k.isVisible()?k.actualBounds.v()?(k.rf(h,Bc,m),m.x+=k.actualBounds.x-n.x,m.y+=k.actualBounds.y-n.y):(k.rf(h,Bc,m),m.v()||m.assign(l)):m.assign(l):n.v()?(k.rf(h,Bc,m),m.v()||m.assign(l)): m.assign(l);90=this.J||270=this.J?(g=Math.round((r.x-q.x)/this.Yb),k=r.x,h=Math.round((m.x-l.x)/this.Yb),l=m.x):(g=Math.round((r.y-q.y)/this.Yb),k=r.y,h=Math.round((m.y-l.y)/this.Yb),l=m.y);H.free(r);H.free(m);d.portFromColOffset=g;d.portFromPos=k;d.portToColOffset=h;d.portToPos=l}else d.portFromColOffset=0,d.portFromPos=0,d.portToColOffset=0,d.portToPos=0;r=e.layer;m=f.layer;n=0;u=d.link;if(null!u){var v=u.fromPort,w=u.toPort;if(null!v&&null!w){var y=u.fromNode;p=u.toNode;if(null!y&& null!p){var z=hs(this,!0),A=hs(this,!1),C=this.setsPortSpots?z:u.computeSpot(!0,v);q=this.setsPortSpots?A:u.computeSpot(!1,w);var J=u.isOrthogonal;C.uf()&&C.sf(A)&&q.uf()&&q.sf(z)?n=0:(z=u.getLinkPoint(y,v,C,!0,J,p,w,H.alloc()),A=u.getLinkDirection(y,v,z,C,!0,J,p,w),H.free(z),C.it()||A!is(this,d,!0)?this.setsPortSpots&&null!y&&1=y.ports.count&&d.rev&&(n+=1):n+=1,C=u.getLinkPoint(p,w,q,!1,J,y,v,H.alloc()),u=u.getLinkDirection(p,w,C,q,!1,J,y,v),H.free(C),q.it()||u!is(this,d,!1)?this.setsPortSpots&& null!p&&1=p.ports.count&&d.rev&&(n+=2):n+=2)}}}p=n;n=1=p||3=p?!0:!1;if(p=2=p||3=p?!0:!1)q=a.createVertex(),q.node=null,q.Qj=1,q.layer=r,q.near=e,a.zh(q),e=a.hk(e,q,d.link),e.valid=!1,e.rev=d.rev,e.portFromColOffset=g,e.portToColOffset=0,e.portFromPos=k,e.portToPos=0,e=q;u=1;n&&u--;if(r-m>u&&0<r){d.valid=!1;q=a.createVertex();q.node=null;q.Qj=2;q.layer=r-1;a.zh(q);e=a.hk(e,q,d.link);e.valid=!0;e.rev=d.rev;e.portFromColOffset=p?0:g;e.portToColOffset=0;e.portFromPos=p?0:k;e.portToPos=0;e= q;for(r--;r-m>u&&0<r;)q=a.createVertex(),q.node=null,q.Qj=3,q.layer=r-1,a.zh(q),e=a.hk(e,q,d.link),e.valid=!0,e.rev=d.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,r--;e=a.hk(q,f,d.link);e.valid=!n;n&&(q.near=f);e.rev=d.rev;e.portFromColOffset=0;e.portToColOffset=h;e.portFromPos=0;e.portToPos=l}else d.valid=!0}}a=this.fc=[];for(b=0;b<=this.wa;b++)a[b]=0;for(b=this.network.vertexes.iterator;b.next();)b.value.index=-1;this.initializeIndices();this.Sr=-1;for(c=this.pd= this.ro=0;c<=this.wa;c++)a[c]>a[this.pd]&&(this.Sr=a[c]-1,this.pd=c),a[c]<a[this.ro]&&(this.ro=c);this.Co=[];for(c=0;c<a.length;c++)this.Co[c]=[];for(b.reset();b.next();)a=b.value,this.Co[a.layer][a.index]=a;this.Ea=-1;for(a=0;a<=this.wa;a++)this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network= null;this.isValidLayout=!0};as.prototype.linkMinLength=function(){return 1};function ls(a)as.prototype.nodeMinLayerSpace=function(a,b); as.prototype.nodeMinColumnSpace=function(a,b){if(null=a.node)return 0;var c=b?a.zv:a.yv;if(null!c)return c;c=this.J;return 90=c||270=c?b?a.zv=a.focus.x/this.Yb+1|0:a.yv=(a.bounds.width-a.focus.x)/this.Yb+1|0:b?a.zv=a.focus.y/this.Yb+1|0:a.yv=(a.bounds.height-a.focus.y)/this.Yb+1|0};function ms(a)return a.yj} function ns(a,b)} function os(a,b,c)else for(m=g-1;m>k;m--)n=d[m],n.near=l&&n.Qj=l.Qj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;l<k.length;l++)}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;l<k.length;l++)if(r=k[l],r.valid&&r.toVertex.layer!b)for(n=r.toVertex.index,m=r.portToPos,r=r.portFromPos,p=l+1;p<k.length;p++)q=k[p],q.valid&&q.toVertex.layer!b&&(u=q.toVertex.index,v=q.portToPos,q=q.portFromPos,r<q&&(n>u||n=u&&m>v)&&h++,q<r&&(u>n||u=n&&v>m)&&h++);f[ge+g]=h;for(k=g+ 1;k<e;k++)if(0>=c)for(h=d[g].destinationEdgesArrayAccess,z=d[k].destinationEdgesArrayAccess,l=0;l<h.length;l++)if(r=h[l],r.valid&&r.toVertex.layer!b)for(n=r.toVertex.index, m=r.portToPos,p=0;p<z.length;p++)q=z[p],q.valid&&q.toVertex.layer!b&&(u=q.toVertex.index,v=q.portToPos,(n<u||n=u&&m<v)&&y++,(u<n||u=n&&v<m)&&w++);f[ge+k]=w;f[ke+g]=y}}ks(a,b,d);return f}as.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.wa;b++)for(var c=os(this,b,1),d=this.fc[b],e=0;e<d;e++)for(var f=e;f<d;f++)a+=c[ed+f];return a}; function ps(a){for(var b=0,c=0;c<=a.wa;c++){for(var d=a,e=c,f=js(d,e),g=d.fc[e],h=0,k=0;k<g;k++)}}ks(d,e,f);b+=h}return b} as.prototype.normalize=function()for(b.reset();b.next();)b.value.column-=a;this.Ea-=a}; function qs(a,b,c){for(var d=js(a,b),e=a.fc[b],f=[],g=0;g<e;g++)if(null!l)for(k=0;k<l.length;k++)h=l[k],p=h.toVertex,h.valid&&!h.rev&&p.layer!b&&(m+=p.column,n++);f[g]=0=n?-1:m/n}ks(a,b,d);return f} function rs(a,b,c){for(var d=js(a,b),e=a.fc[b],f=[],g=0;g<e;g++){var h=d[g],k=null;0>=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<k.length;p++)if(null!l)for(k=0;k<l.length;k++)h=l[k],p=h.toVertex,h.valid&&!h.rev&&p.layer!b&&(n[m]=p.column+h.portToColOffset, m++);0=m?f[g]=-1:(n.sort(function(a,b)),l=m>>1,f[g]=0!(m&1)?n[l]:n[l-1]+n[l]>>1)}ks(a,b,d);return f}function ss(a,b,c,d,e,f){if(b.component=d)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&&ss(a,k,c,d,e,f)}} function ts(a,b,c,d,e,f){if(b.component=d)} as.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Lk){default:case us: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!vs(a);){for(e=ws(a);null!e;)d[c]=e,c--,e.valid=!1,e=ws(a);for(e=xs(a);null!e;)d[b]=e,b++,e.valid=!1,e=xs(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||f<k-l)e=h,f=k-l}}null!e&&(d[b]=e,b++,e.valid=!1)}for(b=0;b<a.vertexes.count;b++)d[b].index=b;for(d=a.edges.iterator;d.next();)b=d.value,b.fromVertex.index>b.toVertex.index&&(a.ym(b),b.rev=!0);break;case bs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.am=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Bo=0;for(d.reset();d.next();)b=d.value,0=b.sourceEdges.count&& ys(this,b);for(d.reset();d.next();)b=d.value,-1=b.am&&ys(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.am<b.am&&c<f&&(this.network.ym(d),d.rev=!0));break;case gs:a=this.network;b=a.vertexes.iterator;for(d=Infinity;b.next();)d=Math.min(d,b.value.layer);if(Infinity>d){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;c<d.length;c++)if(e=d[c],!e|| 0=e.length)b++;else if(0<c)for(f=0;f<e.length;f++)e[f].layer-=b;for(d=a.edges.iterator;d.next();)b=d.value,b.fromVertex.layer<b.toVertex.layer&&(a.ym(b),b.rev=!0)}}};function vs(a){for(a=a.vertexes.iterator;a.next();)return null}function ws(a){for(a=a.vertexes.iterator;a.next();)if(c)return b}}return null} function xs(a){for(a=a.vertexes.iterator;a.next();)if(c)return b}}return null}function ys(a,b)b.finish=a.Bo;a.Bo++} as.prototype.assignLayers=function(){switch(this.ql){case zs:As(this);break;case Bs:for(var a,b=this.network.vertexes.iterator;b.next();)a=Cs(this,b.value),this.wa=Math.max(a,this.wa);for(b.reset();b.next();)a=b.value,a.layer=this.wa-a.layer;break;default:case cs:As(this);for(b=this.network.vertexes.iterator;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0=a.sourceEdges.count&&Ds(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.wa=-1;for(b.reset();b.next();)}};function As(a){for(var b=a.network.vertexes.iterator;b.next();)}function Es(a,b)b.layer=c}else c=b.layer;return c} function Cs(a,b)b.layer=c}else c=b.layer;return c} function Ds(a,b){if(!b.valid)for(ss(a,b,1,-1,!0,!0);0!b.component;)p=l.destinationEdgesArrayAccess;e=p.length;for(r=0;r<e;r++)q=p[r].toVertex,--m,1!q.component?--f:n=!0;(null=k||m<h)&&!n&&(k=l,h=m)}}if(0<f){for(c.reset();c.next();)e=c.value,1=e.component&&(e.layer+=d);b.component=0}else k.component=0}for(c=a.network.vertexes.iterator;c.next();)c.value.component=-1;for(ss(a,b,1,-1,!0,!1);0!b.component;)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 is(a,b,c){return 90=a.J?c&&!b.rev||!c&&b.rev?270:90:180=a.J?c&&!b.rev||!c&&b.rev?0:180:270=a.J?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} as.prototype.initializeIndices=function(){switch(this.fl){default:case Fs:for(var a=this.network.vertexes.iterator;a.next();)break;case ds:a=this.network.vertexes.iterator;for(b=this.wa;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer=b&&-1=c.index&&Gs(this,c);break;case Hs:for(a=this.network.vertexes.iterator,b=0;b<=this.wa;b++)for(a.reset();a.next();)c=a.value,c.layer=b&&-1=c.index&&Is(this,c)}}; function Gs(a,b)}for(c=0;c<b.length;c++)d=b[c],d.valid&&(d=d.toVertex,-1=d.index&&Gs(a,d))} function Is(a,b)for(c=0;c<b.length;c++)d=b[c],d.valid&&(d=d.fromVertex,-1=d.index&&Is(a,d))} as.prototype.reduceCrossings=function()ns(this,b);for(c=0;c<this.tj;c++){for(d=0;d<=this.wa;d++)Js(this,d,0),Ks(this,d,0);e=this.countCrossings();e<a&&(a=e,b=ms(this));for(d=this.wa;0<=d;d--)Js(this,d,0),Ks(this,d,0);e=this.countCrossings(); e<a&&(a=e,b=ms(this))}ns(this,b);var f,g,h;switch(this.yk){case Ls:break;case Ms:for(h=a+1;(d=this.countCrossings())<h;)for(h=d,c=this.wa;0<=c;c--)for(g=0;g<=c;g++){for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,-1)||f;e=this.countCrossings();e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,1)||f;e=this.countCrossings();e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Ks(this,d,-1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this))}break;default:case es:for(c=this.wa,g=0,h=a+1;(d=this.countCrossings())<h;){h=d;for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,-1)||f;e=this.countCrossings();e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,1)||f;e=this.countCrossings();e>=a?ns(this,b): (a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,-1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this))}}ns(this,b)}; function Js(a,b,c) function Ks(a,b,c){var d=js(a,b),e=a.fc[b];c=os(a,b,c);var f;var g=[];for(f=0;f<e;f++)g[f]=-1;var h=[];for(f=0;f<e;f++)h[f]=-1;for(var k=!1,l=!0;l;)for(l=!1,f=0;f<e-1;f++){var m=c[d[f].indexe+d[f+1].index],n=c[d[f+1].indexe+d[f].index],p=0,r=0,q=d[f].column,u=d[f+1].column,v=a.nodeMinColumnSpace(d[f],!0),w=a.nodeMinColumnSpace(d[f],!1),y=a.nodeMinColumnSpace(d[f+1],!0),z=a.nodeMinColumnSpace(d[f+1],!1);v=q-v+y;w=u-w+z;var A=d[f].sourceEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.fromVertex, y.valid&&z.layer=b){for(y=0;d[y]!z;)y++;y<f&&(p+=2*(f-y),r+=2*(f+1-y));y=f+1&&(p+=1);y>f+1&&(p+=4*(y-f),r+=4*(y-(f+1)))}A=d[f].destinationEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layerb){for(y=0;d[y]!z;)y++;yf+1&&(r+=1)}A=d[f+1].sourceEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.fromVertex,y.valid&&z.layer=b){for(y=0;d[y]!z;)y++;y<f&&(p+=2*(f+1-y),r+=2*(f-y));y=f&&(r+=1);y>f+1&&(p+=4*(y-(f+1)),r+=4*(y-f))}A=d[f+1].destinationEdges.iterator; for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layerb){for(y=0;d[y]!z;)y++;yf&&(p+=1)}y=z=0;A=g[d[f].index];var C=h[d[f].index],J=g[d[f+1].index],K=h[d[f+1].index];-1!A&&(z+=Math.abs(A-q),y+=Math.abs(A-w));-1!C&&(z+=Math.abs(C-q),y+=Math.abs(C-w));-1!J&&(z+=Math.abs(J-u),y+=Math.abs(J-v));-1!K&&(z+=Math.abs(K-u),y+=Math.abs(K-v));if(r<p-.5||r=p&&n<m-.5||r=p&&n=m&&y<z-.5)l=k=!0,d[f].column=w,d[f+1].column=v,m=d[f],d[f]=d[f+1],d[f+1]=m}for(f=0;f<e;f++)d[f].index= f;ks(a,b,d);return k} as.prototype.straightenAndPack=function(){var a=0!(this.ig&1);var b=7=this.ig;1E3<this.network.edges.count&&!b&&(a=!1);if(a){var c=[];for(b=0;b<=this.wa;b++)c[b]=0;for(var d,e=this.network.vertexes.iterator;e.next();)for(e.reset();e.next();)f=e.value,b=f.layer,d=f.column,f.column=(8*(this.Ea-c[b])>>1)+8d;this.Ea=8}if(0!(this.ig&2))for(c=!0;c;){c=!1;for(b=this.pd+1;b<=this.wa;b++)c=Ns(this,b,1)||c;for(b= this.pd-1;0<=b;b--)c=Ns(this,b,-1)||c;c=Ns(this,this.pd,0)||c}if(0!(this.ig&4)){for(b=this.pd+1;b<=this.wa;b++)Os(this,b,1);for(b=this.pd-1;0<=b;b--)Os(this,b,-1);Os(this,this.pd,0)}a&&(Ps(this,-1),Ps(this,1));if(0!(this.ig&2))for(c=!0;c;)};function Ns(a,b,c){for(var d=!1;Qs(a,b,c);)d=!0;return d} function Qs(a,b,c){var d,e=js(a,b),f=a.fc[b],g=qs(a,b,-1);if(0<c)for(d=0;d<f;d++)g[d]=-1;var h=qs(a,b,1);if(0>c)for(d=0;d<f;d++)h[d]=-1;for(var k=!1,l=!0;l;)for(l=!1,d=0;d<f;d++){var m=e[d].column,n=a.nodeMinColumnSpace(e[d],!0),p=a.nodeMinColumnSpace(e[d],!1),r=0;0>d-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u=0;if(0>=c)for(var v=e[d].sourceEdges.iterator;v.next();){var w=v.value;var y=w.fromVertex; if(w.valid&&y.layer!b)}if(0<=c)for(v=e[d].destinationEdges.iterator;v.next();)w=v.value,y=w.toVertex,w.valid&&y.layer!b&&(z=ls(w),A=w.portFromColOffset,w=w.portToColOffset,y=y.column,p+=(Math.abs(m+A-(y+w))+1)*z,q+=(Math.abs(r+A-(y+w))+1)*z,u+=(Math.abs(n+A-(y+w))+1)*z);w=A=z=0;v=g[e[d].index];y=h[e[d].index];-1!v&&(z+=Math.abs(v-m),A+= Math.abs(v-r),w+=Math.abs(v-n));-1!y&&(z+=Math.abs(y-m),A+=Math.abs(y-r),w+=Math.abs(y-n));if(q<p||q=p&&A<z)l=k=!0,e[d].column=r;else if(u<p||u=p&&w<z)l=k=!0,e[d].column=n}ks(a,b,e);a.normalize();return k} function Os(a,b,c){var d=js(a,b),e=a.fc[b],f=rs(a,b,c),g=[];for(c=0;c<e;c++)g[c]=f[c];for(f=!0;f;)for(f=!1,c=0;c<e;c++){var h=d[c].column,k=a.nodeMinColumnSpace(d[c],!0),l=a.nodeMinColumnSpace(d[c],!1),m=0;if(-1=g[c])if(0=c&&c=e-1)m=h;else if(0=c)else c=e-1?(n=d[c-1].column,m=h-n=k+a.nodeMinColumnSpace(d[c-1],!1)?h+1:h):(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+ 1],!0)-l-1,m=(k+l)/2|0);else 0=c&&c=e-1?m=g[c]:0=c?(n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,m=Math.min(g[c],l)):ce-1?(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,m=Math.max(g[c],k)):(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,k<g[c]&&g[c]<l?m=g[c]:k>=g[c]?m=k:l<=g[c]&&(m=l));m!h&&(f=!0,d[c].column=m)}ks(a,b,d);a.normalize()} function Rs(a,b){for(var c=!0,d=a.network.vertexes.iterator;d.next();)}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} function Ss(a,b){var c=b+1;var d,e=[],f=[];for(d=0;d<=a.wa;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();)h=!0;c=!1;for(d=0;d<=a.wa;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 Ps(a,b){for(var c=0;c<=a.Ea;c++)for(;Rs(a,c););a.normalize();for(c=0;c<a.Ea;c++)for(;Ss(a,c););a.normalize();var d;if(0<b)for(c=0;c<=a.Ea;c++)}if(0>b)for(c=a.Ea;0<=c;c--)for(e=ms(a),f=ps(a),d=f+1;f<d;)d=f,Ts(a,c,-1),g=ps(a),g>f?ns(a,e):g<f&&(f=g,e=ms(a));a.normalize()} function Ts(a,b,c)if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Od);a.Od++;for(d.reset();d.next();)b=d.value,-1b.component&&(ts(a,b,a.Od,-1,!0,!0),a.Od++);var f;b=[];for(f=0;f<a.Oda.Od;f++)b[f]=!1;e=[];for(f=0;f<(a.wa+1)(a.Ea+1);f++)e[f]=-1;for(d.reset();d.next();)for(f=0;f<=a.wa;f++){if(0<c)for(g=0;g<a.Ea;g++)-1!e[f*(a.Ea+1)+g]&&-1!e[f*(a.Ea+1)+g+1]&&e[f*(a.Ea+1)+g]!e[f*(a.Ea+1)+g+1]&&(b[e[f*(a.Ea+1)+g]a.Od+e[f(a.Ea+1)+g+1]]=!0);if(0>c)for(g=a.Ea;0<g;g--)-1!e[f*(a.Ea+1)+g]&&-1!e[f*(a.Ea+1)+g-1]&&e[f*(a.Ea+1)+g]!e[f*(a.Ea+1)+g-1]&&(b[e[f*(a.Ea+1)+g]a.Od+e[f(a.Ea+1)+g-1]]=!0)}e= [];for(f=0;f<a.Od;f++)e[f]=!0;g=[];for(g.push(0);0!g.length;)if(k=g[g.length-1],g.pop(),e[k])for(e[k]=!1,f=0;f<a.Od;f++)b[k*a.Od+f]&&g.splice(0,0,f);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&--a.column;if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} as.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=hs(this,!0),b=hs(this,!1),c=this.network.edges.iterator;c.next();)this.commitNodes();this.Vu();this.isRouting&&this.commitLinks()};function hs(a,b){return 270=a.J?b?ed:hd:90=a.J?b?hd:ed:180=a.J?b?fd:gd:b?gd:fd} as.prototype.commitNodes=function()b=0;c=this.ie;for(var d=0;d<=this.wa;d++){var e=c;0>=this.Kd[d]+this.od[d]&&(e=0);0<d&&(b+=e/2);90=this.J||0=this.J?(b+=this.od[d],this.nd[d]=b, b+=this.Kd[d]):(b+=this.Kd[d],this.nd[d]=b,b+=this.od[d]);d<this.wa&&(b+=e/2);this.Ha[d]=b}c=b;b=this.arrangementOrigin;for(d=0;d<=this.wa;d++)270=this.J?this.nd[d]=b.y+this.nd[d]:90=this.J?(this.nd[d]=b.y+c-this.nd[d],this.Ha[d]=c-this.Ha[d]):180=this.J?this.nd[d]=b.x+this.nd[d]:(this.nd[d]=b.x+c-this.nd[d],this.Ha[d]=c-this.Ha[d]);a.reset();for(c=d=Infinity;a.next();)else h=this.nd[f],f=b.y+ this.Ybg;e.centerX=h;e.centerY=f;d=Math.min(e.x,d);c=Math.min(e.y,c)}d=b.x-d;b=b.y-c;this.Ff=new H(d,b);for(a.reset();a.next();)c=a.value,c.x+=d,c.y+=b,c.commit()}; as.prototype.Vu=function(){for(var a=0,b=this.ie,c=0;c<=this.wa;c++)a+=this.Kd[c],a+=this.od[c];a+=this.wab;b=[];c=this.Ybthis.Ea;for(var d=this.maxLayer;0<=d;d--)270=this.J?0=d?b.push(new M(0,0,c,Math.abs(this.Ha[0]))):b.push(new M(0,this.Ha[d-1],c,Math.abs(this.Ha[d-1]-this.Ha[d]))):90=this.J?0=d?b.push(new M(0,this.Ha[0],c,Math.abs(this.Ha[0]-a))):b.push(new M(0,this.Ha[d],c,Math.abs(this.Ha[d-1]-this.Ha[d]))):180=this.J?0=d?b.push(new M(0,0,Math.abs(this.Ha[0]),c)):b.push(new M(this.Ha[d- 1],0,Math.abs(this.Ha[d-1]-this.Ha[d]),c)):0d?b.push(new M(this.Ha[0],0,Math.abs(this.Ha[0]-a),c)):b.push(new M(this.Ha[d],0,Math.abs(this.Ha[d-1]-this.Ha[d]),c));this.commitLayers(b,this.Ff)};as.prototype.commitLayers=function(); as.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,b;a.next();)b=a.value.link,null!==b&&(b.Hh(),b.Uj(),b.mf());for(a.reset();a.next();)b=a.value.link,null!==b&&b.cj();for(a.reset();a.next();)null!==f&&(k=f.findVisibleNode(),null!==k&&k!f&&(f=k,h=k.port));var l=b.computeSpot(!0,g);k=b.computeSpot(!1,h);var m= c.fromVertex,n=c.toVertex;if(c.valid){if(b.curvesg&&4=b.pointsCount)if(m.column===n.column)c=b.getLinkPoint(e,g,l,!0,!1,f,h),g=b.getLinkPoint(f,h,k,!1,!1,e,g),c.v()||c.set(e.actualBounds.center),g.v()||g.set(f.actualBounds.center),b.Uj(),b.lf(c.x,c.y),b.lf((2c.x+g.x)/3,(2c.y+g.y)/3),b.lf((c.x+2g.x)/3,(c.y+2g.y)/3),b.lf(g.x,g.y);else{var p=!1,r=!1;null!g&&l=wc&&(p=!0);null!h&&k=wc&&(r=!0);if(p||r){var q=b.i(0).x;c=b.i(0).y;m=b.i(3).x;d=b.i(3).y;p&&(90=this.J||270=this.J?(p=q,n= (c+d)/2):(p=(q+m)/2,n=c),b.K(1,p,n),l=b.getLinkPoint(e,g,l,!0,!1,f,h),l.v()||l.set(e.actualBounds.center),b.K(0,l.x,l.y));r&&(90=this.J||270=this.J?(l=m,c=(c+d)/2):(l=(q+m)/2,c=d),b.K(2,l,c),e=b.getLinkPoint(f,h,k,!1,!1,e,g),e.v()||e.set(f.actualBounds.center),b.K(3,e.x,e.y))}}b.mf()}else if(m.layer=n.layer)b.mf();elseelse if(b.curve=sg)r=!0,u=b.pointsCount,4<u&&b.points.removeRange(2, u-3),4u&&(q=2);elseif(c.rev){for(;null!==n&&m!==n;){var y=u=null;for(v=n.sourceEdges.iterator;v.next()&&(w=v.value,w.link!==c.link||(u=w.fromVertex,y=w.toVertex,null!==u.node)););if(u!m){v=b.i(q-1).x;w=b.i(q-1).y;var z=u.centerX;var A=u.centerY;if(p)180this.J||0=this.J?qb.firstPickIndex+1?(b.m(q++, v,w),b.m(q++,v,A)):(null!==y?y.centerY:w)!A&&(y=this.Ha[u.layer-1]+this.Ff.x,b.m(q++,y,w),b.m(q++,y,A)):qb.firstPickIndex+1?(b.m(q++,v,w),b.m(q++,z,w)):(null!y?y.centerX:v)!z&&(y=this.Ha[u.layer-1]+this.Ff.y,b.m(q++,v,y),b.m(q++,z,y));else if(q=b.firstPickIndex+1){y=Math.max(10,this.Kd[n.layer]);var C=Math.max(10,this.od[n.layer]);if(r)180=this.J?z<=n.bounds.x?(n=n.bounds.x,b.m(q++,n-y,A),b.m(q++,n,A),b.m(q++,n+C,A)):(b.m(q++,z-y,A),b.m(q++,z,A),b.m(q++,z+C,A)):90=this.J?A>=n.bounds.bottom? (n=n.bounds.y+n.bounds.height,b.m(q++,z,n+C),b.m(q++,z,n),b.m(q++,z,n-y)):(b.m(q++,z,A+C),b.m(q++,z,A),b.m(q++,z,A-y)):270=this.J?A<=n.bounds.y?(n=n.bounds.y,b.m(q++,z,n-y),b.m(q++,z,n),b.m(q++,z,n+C)):(b.m(q++,z,A-y),b.m(q++,z,A),b.m(q++,z,A+C)):0=this.J&&(z>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(q++,n+C,A),b.m(q++,n,A),b.m(q++,n-y,A)):(b.m(q++,z+C,A),b.m(q++,z,A),b.m(q++,z-y,A)));else{b.m(q++,v,w);var J=0;if(180=this.J||0=this.J){if(180=this.J?z>=n.bounds.right:z<=n.bounds.x)J= (0=this.J?-y:C)/2;b.m(q++,v+J,A)}else{if(270=this.J?A>=n.bounds.bottom:A<=n.bounds.y)J=(90=this.J?-y:C)/2;b.m(q++,z,w+J)}b.m(q++,z,A)}}else y=Math.max(10,this.Kd[u.layer]),C=Math.max(10,this.od[u.layer]),180=this.J?(r&&b.m(q++,z-y,A),b.m(q++,z,A),r&&b.m(q++,z+C,A)):90=this.J?(r&&b.m(q++,z,A+C),b.m(q++,z,A),r&&b.m(q++,z,A-y)):270=this.J?(r&&b.m(q++,z,A-y),b.m(q++,z,A),r&&b.m(q++,z,A+C)):(r&&b.m(q++,z+C,A),b.m(q++,z,A),r&&b.m(q++,z-y,A))}n=u}if(null=h||l!wc||p)if(v=b.i(q-1).x,w=b.i(q- 1).y,z=b.i(q).x,A=b.i(q).y,p)n=this.od[m.layer],180=this.J||0=this.J?(p=w,p>=m.bounds.y&&p<=m.bounds.bottom&&(180=this.J?z>=m.bounds.x:z<=m.bounds.right)&&(n=m.centerX+(180=this.J?-n:n),p<m.bounds.y+m.bounds.height/2?p=m.bounds.y-this.Yb/2:p=m.bounds.bottom+this.Yb/2,b.m(q++,n,w),b.m(q++,n,p)),b.m(q++,z,p)):(p=v,p>=m.bounds.x&&p<=m.bounds.right&&(270=this.J?A>=m.bounds.y:A<=m.bounds.bottom)&&(n=m.centerY+(270=this.J?-n:n),p<m.bounds.x+m.bounds.width/2?p=m.bounds.x-this.Yb/2:p=m.bounds.right+ this.Yb/2,b.m(q++,v,n),b.m(q++,p,n)),b.m(q++,p,A)),b.m(q++,z,A);else if(r)y=Math.max(10,this.Kd[m.layer]),C=Math.max(10,this.od[m.layer]),180=this.J&&z>=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.K(q-2,n,w),b.K(q-1,n+C,w)):90=this.J&&A<=m.bounds.bottom?(n=m.bounds.y,b.K(q-2,v,n),b.K(q-1,v,n-y)):270=this.J&&A>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.K(q-2,v,n),b.K(q-1,v,n+C)):0=this.J&&z<=m.bounds.right&&(n=m.bounds.x,b.K(q-2,n,w),b.K(q-1,n-y,w));else{y=Math.max(10,this.Kd[m.layer]);C=Math.max(10, this.od[m.layer]);p=0;if(180=this.J||0=this.J){if(180=this.J?z<=m.bounds.x:z>=m.bounds.right)p=(0=this.J?C:-y)/2;b.m(q++,z+p,w)}else{if(270=this.J?A<=m.bounds.y:A>=m.bounds.bottom)p=(90this.J?C:-y)/2;b.m(q++,v,A+p)}b.m(q++,z,A)}}else{for(;null!==m&&m!==n;){y=u=null;for(m=m.destinationEdges.iterator;m.next()&&(v=m.value,v.link!==c.link||(u=v.toVertex,y=v.fromVertex,null!==y.node&&(y=null),null!==u.node)););u!n&&(v=b.i(q-1).x,w=b.i(q-1).y,z=u.centerX,A=u.centerY,p?180this.J||0=this.J? (null!y?y.centerY:w)!A&&(y=this.Ha[u.layer]+this.Ff.x,q=b.firstPickIndex+1&&(y=0=this.J?Math.max(y,v):Math.min(y,v)),b.m(q++,y,w),b.m(q++,y,A)):(null!y?y.centerX:v)!z&&(y=this.Ha[u.layer]+this.Ff.y,q=b.firstPickIndex+1&&(y=90=this.J?Math.max(y,w):Math.min(y,w)),b.m(q++,v,y),b.m(q++,z,y)):(y=Math.max(10,this.Kd[u.layer]),C=Math.max(10,this.od[u.layer]),180=this.J?(b.m(q++,z+C,A),r&&b.m(q++,z,A),b.m(q++,z-y,A)):90=this.J?(b.m(q++,z,A-y),r&&b.m(q++,z,A),b.m(q++,z,A+C)):270=this.J? (b.m(q++,z,A+C),r&&b.m(q++,z,A),b.m(q++,z,A-y)):(b.m(q++,z-y,A),r&&b.m(q++,z,A),b.m(q++,z+C,A))));m=u}p&&(v=b.i(q-1).x,w=b.i(q-1).y,z=b.i(q).x,A=b.i(q).y,180=this.J||0this.J?w!A&&(y=0this.J?Math.min(Math.max((z+v)/2,this.Ha[n.layer]+this.Ff.x),z):Math.max(Math.min((z+v)/2,this.Ha[n.layer]+this.Ff.x),z),b.m(q++,y,w),b.m(q++,y,A)):v!z&&(y=90=this.J?Math.min(Math.max((A+w)/2,this.Ha[n.layer]+this.Ff.y),A):Math.max(Math.min((A+w)/2,this.Ha[n.layer]+this.Ff.y),A),b.m(q++,v,y),b.m(q++,z,y)))}null! d&&r&&(null!g&&(l=wc&&(l=b.i(0),d=b.i(2),l.A(d)||b.K(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,wc,!0,!1,f,h),l.v()||l.set(e.actualBounds.center),b.K(0,l.x,l.y)),null!h&&(k=wc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.A(l)||b.K(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,wc,!1,!1,e,g),e.v()||e.set(f.actualBounds.center),b.K(b.pointsCount-1,e.x,e.y)));b.mf();c.commit()}}}this.avoidOrthogonalOverlaps()}; as.prototype.avoidOrthogonalOverlaps=function(){for(var a=new E,b=this.network.edges.iterator;b.next();)if(0<a.count)if(90=this.J||270=this.J){b=0;c=[];for(a=a.iterator;a.next();){var d=a.value;if(null!==d&&d.isOrthogonal)for(var e=2;e<d.pointsCount-3;e++){var f=d.i(e);var g=d.i(e+1);if(this.w(f.y,g.y)&&!this.w(f.x,g.x)){var h=new Us;h.layer=Math.floor(f.y/2);var k=d.i(0),l=d.i(d.pointsCount-1);h.first=k.xk.x+k.y;h.Vb=l.x* l.x+l.y;h.Rc=Math.min(f.x,g.x);h.sc=Math.max(f.x,g.x);h.index=e;h.link=d;if(e+2<d.pointsCount)c.push(h)}}}if(1<c.length)for(c.sort(this.Tx),a=0;a<c.length;){f=c[a].layer;for(d=a+1;d<c.length&&c[d].layerf;)d++;if(1<d-a)for(f=a;f<d;){g=c[f].sc;for(e=a+1;e<d&&c[e].Rc<g;)g=Math.max(g,c[e].sc),e++;g=e-f;if(1<g){this.$i(c,this.wt,f,f+g);m=1;h=c[f].Vb;for(k=f;k<e;k++)l=c[k],l.Vb!==h&&(m++,h=l.Vb);this.$i(c, this.Sx,f,f+g);var n=1;h=c[f].first;for(k=f;k<e;k++)l=c[k],l.first!==h&&(n++,h=l.first);k=!0;l=n;m<n?(k=!1,l=m,h=c[f].Vb,this.$i(c,this.wt,f,f+g)):h=c[f].first;m=0;for(n=f;n<e;n++)}f=e}a=d}}else{b=0;c=[];for(a=a.iterator;a.next();)if(d=a.value,null!d&&d.isOrthogonal)for(e=2;e<d.pointsCount-3;e++)f= d.i(e),g=d.i(e+1),this.w(f.x,g.x)&&!this.w(f.y,g.y)&&(h=new Us,h.layer=Math.floor(f.x/2),k=d.i(0),l=d.i(d.pointsCount-1),h.first=k.x+k.yk.y,h.Vb=l.x+l.yl.y,h.Rc=Math.min(f.y,g.y),h.sc=Math.max(f.y,g.y),h.index=e,h.link=d,e+2<d.pointsCount&&(k=d.i(e-1),l=d.i(e+2),m=0,k.x<f.x?m=l.x<f.x?3:f.y<g.y?2:1:k.x>f.x&&(m=l.x>f.x?0:g.y<f.y?2:1),h.l=m),c.push(h));if(1<c.length)for(c.sort(this.Tx),a=0;a<c.length;){f=c[a].layer;for(d=a+1;d<c.length&&c[d].layerf;)d++;if(1<d-a)for(f=a;f<d;){g=c[f].sc;for(e=a+ 1;e<d&&c[e].Rc<g;)g=Math.max(g,c[e].sc),e++;g=e-f;if(1<g){this.$i(c,this.wt,f,f+g);m=1;h=c[f].Vb;for(k=f;k<e;k++)l=c[k],l.Vb!=h&&(m++,h=l.Vb);this.$i(c,this.Sx,f,f+g);n=1;h=c[f].first;for(k=f;k<e;k++)l=c[k],l.first!h&&(n++,h=l.first);k=!0;l=n;m<n?(k=!1,l=m,h=c[f].Vb,this.$i(c,this.wt,f,f+g)):h=c[f].first;m=0;for(n=f;n<e;n++)p=c[n],(k?p.first:p.Vb)!h&&(m++,h=k?p.first:p.Vb),r=p.link,f=r.i(p.index),g=r.i(p.index+1),q=this.linkSpacing*(m-(l-1)/2),b++,r.Hh(),r.K(p.index,f.x+q,f.y),r.K(p.index+1, g.x+q,g.y),r.mf()}f=e}a=d}}};t=as.prototype;t.Tx=function(a,b){return a instanceof Us&&b instanceof Us&&a!b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Rc<b.Rc?-1:a.Rc>b.Rc?1:a.sc<b.sc?-1:a.sc>b.sc?1:0:0};t.Sx=function(a,b){return a instanceof Us&&b instanceof Us&&a!b?a.first<b.first?-1:a.first>b.first||a.l<b.l?1:a.l>b.l||a.Rc<b.Rc?-1:a.Rc>b.Rc?1:a.sc<b.sc?-1:a.sc>b.sc?1:0:0}; t.wt=function(a,b){return a instanceof Us&&b instanceof Us&&a!b?a.Vb<b.Vb?-1:a.Vb>b.Vb||a.l<b.l?1:a.l>b.l||a.Rc<b.Rc?-1:a.Rc>b.Rc?1:a.sc<b.sc?-1:a.sc>b.sc?1:0:0};t.w=function(a,b); t.$i=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&B("not in range 0 ? from < length: "+c),2=f)d=a[c],e=a[c+1],0<b(d,e)&&(a[c]=e,a[c+1]=d);else if(0=c)if(d>=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b<d;b++)a[b]=c[b];else if(d>=e)for(d=a.slice(c),d.sort(b),b=c;b<e;b++)a[b]=d[b-c];else for(e=a.slice(c,d),e.sort(b),b=c;b<d;b++)a[b]=e[b-c]}; function js(a,b)void 0=a.me[c]||null=a.me[c]?d=[]:(d=a.me[c],a.me[c]=null);a=a.Co[b];for(b=0;b<a.length;b++)c=a[b],d[c.index]=c;return d}function ks(a,b,c){a.me[a.fc[b]]=c} ma.Object.defineProperties(as.prototype,{layerSpacing:{get:function(),set:function(a){this.ie!a&&0<=a&&(this.ie=a,this.C())}},columnSpacing:{get:function(),set:function(a){this.Yb!a&&0<a&&(this.Yb=a,this.C())}},direction:{get:function(),set:function(a){this.J!a&&(0=a||90=a||180=a||270=a?(this.J=a,this.C()):B("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}}, cycleRemoveOption:{get:function(),set:function(a)},layeringOption:{get:function(),set:function(a)},initializeOption:{get:function(),set:function(a)},iterations:{ get:function(),set:function(a){this.tj!a&&0<=a&&(this.tj=a,this.C())}},aggressiveOption:{get:function(),set:function(a)},packOption:{get:function(),set:function(a){this.ig!a&&0<=a&&8>a&&(this.ig=a,this.C())}},setsPortSpots:{get:function(),set:function(a){this.Ze!a&&(this.Ze=a,this.C())}}, linkSpacing:{get:function(),set:function(a){this.ho!a&&0<=a&&(this.ho=a,this.C())}},maxLayer:{get:function()},maxIndex:{get:function()},maxColumn:{get:function()},minIndexLayer:{get:function()},maxIndexLayer:{get:function()}}); var bs=new D(as,"CycleDepthFirst",0),us=new D(as,"CycleGreedy",1),gs=new D(as,"CycleFromLayers",2),cs=new D(as,"LayerOptimalLinkLength",0),zs=new D(as,"LayerLongestPathSink",1),Bs=new D(as,"LayerLongestPathSource",2),ds=new D(as,"InitDepthFirstOut",0),Hs=new D(as,"InitDepthFirstIn",1),Fs=new D(as,"InitNaive",2),Ls=new D(as,"AggressiveNone",0),es=new D(as,"AggressiveLess",1),Ms=new D(as,"AggressiveMore",2);as.className="LayeredDigraphLayout";as.CycleDepthFirst=bs;as.CycleGreedy=us; as.CycleFromLayers=gs;as.LayerOptimalLinkLength=cs;as.LayerLongestPathSink=zs;as.LayerLongestPathSource=Bs;as.InitDepthFirstOut=ds;as.InitDepthFirstIn=Hs;as.InitNaive=Fs;as.AggressiveNone=Ls;as.AggressiveLess=es;as.AggressiveMore=Ms;as.PackNone=0;as.PackExpand=1;as.PackStraighten=2;as.PackMedian=4;as.PackAll=7;function Us()Us.className="SegInfo";function fs(a){Pp.call(this,a)}la(fs,Pp);fs.prototype.createVertex=function(){return new Vs(this)}; fs.prototype.createEdge=function(){return new Ws(this)};fs.className="LayeredDigraphNetwork";function Vs(a){Sp.call(this,a);this.Oa=this.Mg=this.ni=-1;this.I=NaN;this.Y=null;this.valid=!1;this.finish=this.am=NaN;this.Qj=0;this.yv=this.zv=null}la(Vs,Sp); ma.Object.defineProperties(Vs.prototype,{layer:{get:function(),set:function(a){this.ni!a&&(this.ni=a)}},column:{get:function(),set:function(a){this.Mg!a&&(this.Mg=a)}},index:{get:function(),set:function(a){this.Oa!a&&(this.Oa=a)}},component:{get:function(),set:function(a){this.I!a&&(this.I=a)}},near:{ get:function(),set:function(a){this.Y!a&&(this.Y=a)}}});Vs.className="LayeredDigraphVertex";function Ws(a){Tp.call(this,a);this.l=this.Ja=this.Za=!1;this.Ia=this.I=NaN;this.Y=this.u=0}la(Ws,Tp); ma.Object.defineProperties(Ws.prototype,{valid:{get:function(),set:function(a){this.Za!a&&(this.Za=a)}},rev:{get:function(),set:function(a){this.Ja!a&&(this.Ja=a)}},forest:{get:function(),set:function(a){this.l!a&&(this.l=a)}},portFromPos:{get:function(),set:function(a){this.I!a&&(this.I=a)}},portToPos:{ get:function(),set:function(a){this.Ia!a&&(this.Ia=a)}},portFromColOffset:{get:function(),set:function(a){this.u!a&&(this.u=a)}},portToColOffset:{get:function(),set:function(a){this.Y!a&&(this.Y=a)}}});Ws.className="LayeredDigraphEdge"; function Xs(){Di.call(this);this.Hb=new F;this.Qo=Ys;this.Yc=Zs;this.Mp=$s;this.Qr=at;this.sw=[];this.Wc=!0;this.Bb=bt;this.yd=(new Kb(10,10)).freeze();var a=new ct(this);this.T=new dt(a);this.U=new dt(a);this.Fu=[]}la(Xs,Di);Xs.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Qo=this.Qo;a.Mp=this.Mp;a.Qr=this.Qr;a.Wc=this.Wc;a.Bb=this.Bb;a.yd.assign(this.yd);a.T.copyInheritedPropertiesFrom(this.T);a.U.copyInheritedPropertiesFrom(this.U)}; Xs.prototype.cb=function(a){a.classType=Xs?0=a.name.indexOf("Alignment")?this.alignment=a:0=a.name.indexOf("Arrangement")?this.arrangement=a:0=a.name.indexOf("Compaction")?this.compaction=a:0=a.name.indexOf("Path")?this.path=a:0=a.name.indexOf("Sorting")?this.sorting=a:0=a.name.indexOf("Style")?this.treeStyle=a:B("Unknown enum value: "+a):Di.prototype.cb.call(this,a)};Xs.prototype.createNetwork=function(){return new ct(this)}; Xs.prototype.makeNetwork=function(a){function b(a){if(a instanceof U)return!a.isLinkLabel&&"Comment"!a.category;if(a instanceof Q)return!1}var c=this.createNetwork();a instanceof P?(c.tg(a.nodes,!0,b),c.tg(a.links,!0,b)):a instanceof S?c.tg(a.memberParts,!1,b):c.tg(a.iterator,!1,b);return c}; Xs.prototype.doLayout=function(a){null=this.network&&(this.network=this.makeNetwork(a));this.arrangement!et&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null=b&&a instanceof P&&(b=a);this.path=Ys&&null!b?this.Yc=b.isTreePathToChildren?Zs:ft:this.Yc=this.path=Ys?Zs:this.path;if(0<this.network.vertexes.count){this.network.Xp();for(a=this.network.vertexes.iterator;a.next();)b=a.value,b.initialized=!1,b.level=0,b.parent=null,b.children=[];if(0<this.Hb.count){a= new F;for(b=this.Hb.iterator;b.next();){var c=b.value;c instanceof U?(c=this.network.Qi(c),null!c&&a.add(c)):c instanceof dt&&a.add(c)}this.Hb=a}0=this.Hb.count&&this.findRoots();for(a=this.Hb.copy().iterator;a.next();)b=a.value,b.initialized||(b.initialized=!0,gt(this,b));b=this.network.vertexes;for(a=null;a=ht(b),0<a.count;)b=it(this,a),null!b&&this.Hb.add(b),b.initialized=!0,gt(this,b),b=a;for(a=this.Hb.iterator;a.next();)b=a.value,b instanceof dt&&jt(this,b);for(a=this.Hb.iterator;a.next();)b= a.value,b instanceof dt&&kt(this,b);for(a=this.Hb.iterator;a.next();)b=a.value,b instanceof dt&&lt(this,b);this.Ru();if(this.layerStyle=mt){a=[];for(b=this.network.vertexes.iterator;b.next();){c=b.value;var d=c.parent;null=d&&(d=c);d=0=d.angle||180=d.angle;var e=a[c.level];void 0=e&&(e=0);a[c.level]=Math.max(e,d?c.width:c.height)}for(b=0;b<a.length;b++)void 0=a[b]&&(a[b]=0);this.sw=a;for(b=this.network.vertexes.iterator;b.next();)c=b.value,d=c.parent,null=d&&(d=c),0=d.angle||180 d.angle?(180=d.angle&&(c.focusX+=a[c.level]-c.width),c.width=a[c.level]):(270=d.angle&&(c.focusY+=a[c.level]-c.height),c.height=a[c.level])}else if(this.layerStyle=nt)for(a=this.network.vertexes.iterator;a.next();)if(0<=d)for(e=0;e<b.children.length;e++)f=b.children[e],c?(180=b.angle&&(f.focusX+=d-f.width),f.width=d):(270=b.angle&&(f.focusY+=d-f.height),f.height= d)}for(a=this.Hb.iterator;a.next();)b=a.value,b instanceof dt&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.Hb=new F;this.isValidLayout=!0};function ht(a){var b=new F;for(a=a.iterator;a.next();)return b} Xs.prototype.findRoots=function(){for(var a=this.network.vertexes,b=a.iterator;b.next();){var c=b.value;switch(this.Yc){case Zs:0=c.sourceEdges.count&&this.Hb.add(c);break;case ft:0=c.destinationEdges.count&&this.Hb.add(c);break;default:B("Unhandled path value "+this.Yc.toString())}}0this.Hb.count&&(a=it(this,a),null!==a&&this.Hb.add(a))}; function it(a,b){var c=999999,d=null;for(b=b.iterator;b.next();){var e=b.value;switch(a.Yc){case Zs:e.sourceEdges.count<c&&(c=e.sourceEdges.count,d=e);break;case ft:e.destinationEdges.count<c&&(c=e.destinationEdges.count,d=e);break;default:B("Unhandled path value "+a.Yc.toString())}}return d} function gt(a,b){if(null!b){switch(a.Yc){case Zs:if(0<b.destinationEdges.count){for(var c=new E,d=b.destinationVertexes;d.next();)0<c.count&&(b.children=c.ma())}break;case ft:if(0<b.sourceEdges.count){c=new E;for(d=b.sourceVertexes;d.next();)e=d.value,ot(a,b,e)&&c.add(e);0<c.count&&(b.children=c.ma())}break;default:B("Unhandled path value"+a.Yc.toString())}c=b.children;d=c.length;for(e=0;e<d;e++)for(b= 0;b<d;b++)gt(a,c[b])}}function ot(a,b,c){if(c.initialized){if(nullb)var d=!1;else{for(d=b.parent;null!d&&d!c;)d=d.parent;d=d=c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0}Xs.prototype.removeChild=function(a,b){if(null!a&&null!b){for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]b&&d++;if(0<d)}}; function jt(a,b){if(null!b){a.initializeTreeVertexValues(b);b.alignmentpt&&a.sortTreeVertexChildren(b);for(var c=0,d=b.childrenCount,e=0,f=b.children,g=f.length,h=0;h<g;h++)b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}} function qt(a,b){switch(a.Mp){default:case $s:return null!b.parent?b.parent:a.T;case rt:return null=b.parent?a.T:null=b.parent.parent?a.U:b.parent;case st:return null!b.parent?null!b.parent.parent?b.parent.parent:a.U:a.T;case tt:var c=!0;if(0=b.childrenCount)c=!1;else for(var d=b.children,e=d.length,f=0;f<e;f++)if(0<d[f].childrenCount)return c&&null!b.parent?a.U:null!b.parent?b.parent:a.T}} Xs.prototype.initializeTreeVertexValues=function(a){a.copyInheritedPropertiesFrom(qt(this,a));if(null!a.parent&&a.parent.alignment=pt){for(var b=a.angle,c=a.parent.children,d=0;d<c.length&&a!c[d];)d++;0=d%2?d!c.length-1&&(b=90=b?180:180=b?270:270=b?180:270):b=90=b?0:180=b?90:270=b?0:90;a.angle=b}a.initialized=!0};function kt(a,b){if(null!b){a.assignTreeVertexValues(b);b=b.children;for(var c=b.length,d=0;d<c;d++)kt(a,b[d])}}Xs.prototype.assignTreeVertexValues=function(); function lt(a,b){if(null!b){b.alignment!pt&&a.sortTreeVertexChildren(b);b=b.children;for(var c=b.length,d=0;d<c;d++)lt(a,b[d])}}Xs.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case ut:break;case vt:a.children.reverse();break;case wt:a.children.sort(a.comparer);break;case xt:a.children.sort(a.comparer);a.children.reverse();break;default:B("Unhandled sorting value "+a.sorting.toString())}};Xs.prototype.Ru=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)}; Xs.prototype.addComments=function(a){var b=a.angle,c=a.parent,d=0;var e=!1;null!c&&(d=c.angle,e=c.alignment,e=yt(e));b=90=b||270=b;d=90=d||270=d;c=0=a.childrenCount;var f=0,g=0,h=0,k=a.commentSpacing;if(null!a.node)for(var l=a.node.fv();l.next();){var m=l.value;"Comment"=m.category&&m.canLayout()&&(null=a.comments&&(a.comments=[]),a.comments.push(m),m.zb(),m=m.measuredBounds,b&&!c||!e&&!d&&c||e&&d&&c?(f=Math.max(f,m.width),g+=m.height+Math.abs(h)):(f+=m.width+Math.abs(h),g=Math.max(g, m.height)),h=k)}null!a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(f+=Math.abs(a.commentMargin),g=Math.max(0,g-a.height)):(g+=Math.abs(a.commentMargin),f=Math.max(0,f-a.width)),e=M.allocAt(0,0,a.bounds.width+f,a.bounds.height+g),a.bounds=e,M.free(e))};function yt(a)function Ct(a) function Dt(a){var b=a.parent;if(null!b){var c=b.alignment;if(yt(c)){if(Ct(c)){b=b.children;for(c=0;c<b.length&&a!b[c];)c++;return 0=c%2}if(c=At)return!0}}return!1} Xs.prototype.layoutComments=function(a){if(null!a.comments){var b=a.node.measuredBounds,c=a.parent,d=a.angle,e=0;var f=!1;null!c&&(e=c.angle,f=c.alignment,f=yt(f));d=90=d||270=d;c=90=e||270=e;for(var g=0=a.childrenCount,h=Dt(a),k=0,l=a.comments,m=l.length,n=H.alloc(),p=0;p<m;p++){var r=l[p],q=r.measuredBounds;if(d&&!g||!f&&!c&&g||f&&c&&g){if(135<e&&!f||c&&h)if(0<=a.commentMargin)for(n.h(a.bounds.x-a.commentMargin-q.width,a.bounds.y+k),r.move(n),r=r.td();r.next();){var u=r.value;u.fromSpot= fd;u.toSpot=gd}else for(n.h(a.bounds.x+2a.focus.x-a.commentMargin,a.bounds.y+k),r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=gd,u.toSpot=fd;else if(0<=a.commentMargin)for(n.h(a.bounds.x+2a.focus.x+a.commentMargin,a.bounds.y+k),r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=gd,u.toSpot=fd;else for(n.h(a.bounds.x+a.commentMargin-q.width,a.bounds.y+k),r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=fd,u.toSpot=gd;k=0<=a.commentSpacing?k+(q.height+a.commentSpacing):k+(a.commentSpacing-q.height)}else{if(135< e&&!f||!c&&h)if(0<=a.commentMargin)for(n.h(a.bounds.x+k,a.bounds.y-a.commentMargin-q.height),r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=ed,u.toSpot=hd;else for(n.h(a.bounds.x+k,a.bounds.y+2a.focus.y-a.commentMargin),r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=hd,u.toSpot=ed;else if(0<=a.commentMargin)for(n.h(a.bounds.x+k,a.bounds.y+2a.focus.y+a.commentMargin),r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=hd,u.toSpot=ed;else for(n.h(a.bounds.x+k,a.bounds.y+a.commentMargin-q.height), r.move(n),r=r.td();r.next();)u=r.value,u.fromSpot=ed,u.toSpot=hd;k=0<=a.commentSpacing?k+(q.width+a.commentSpacing):k+(a.commentSpacing-q.width)}}H.free(n);b=k-a.commentSpacing-(d?b.height:b.width);if(this.Yc=Zs)for(a=a.destinationEdges;a.next();)e=a.value.link,null=e||e.isAvoiding||(e.fromEndSegmentLength=0<b?b:NaN);else for(a=a.sourceEdges;a.next();)e=a.value.link,nulle||e.isAvoiding||(e.toEndSegmentLength=0<b?b:NaN)}}; Xs.prototype.layoutTree=function(a){if(null!a){for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case Et:Ft(this,a);break;case Gt:if(a.alignmentpt)Ft(this,a);else if(0=a.childrenCount)d=a.parent,c=!1,b=0,null!d&&(b=d.angle,c=d.alignment,c=yt(c)),d=Dt(a),a.S.h(0,0),a.sa.h(a.width,a.height),null=a.parent||nulla.comments||(180!==b&&270!b||c)&&!d?a.da.h(0,0):180b&&!c||(90=b||270=b)&&d?a.da.h(a.width-2a.focus.x,0):a.da.h(0,a.height-2a.focus.y), a.kq=null,a.xq=null;else{var e=Ht(a);b=90=e||270=e;var f=0,g=a.children,h=g.length;for(c=0;c<h;c++)d=g[c],f=Math.max(f,b?d.sa.width:d.sa.height);var k=a.alignment,l=k=It,m=yt(k),n=Math.max(0,a.breadthLimit);c=Jt(a);var p=a.nodeSpacing,r=Pt(a),q=a.rowSpacing,u=0;if(k=Qt||l||a.zm||a.Am&&1=a.maxGenerationCount)u=Math.max(0,a.rowIndent);d=a.width;var v=a.height,w=0,y=0,z=0,A=null,C=null,J=0,K=0,L=0,V=0,R=0,ea=0,pa=0,N=0;m&&!Ct(k)&&135<e&&g.reverse();if(Ct(k))if(1<h)for(var Ga=0;Ga<h;Ga++)0=== Ga%2&&Ga!h-1&&(N=Math.max(N,b?g[Ga].sa.width:g[Ga].sa.height));else 1=h&&(N=b?g[0].sa.width:g[0].sa.height);if(m){switch(k){case zt:y=135>e?Rt(a,g,N,w,y):St(a,g,N,w,y);N=y.x;w=y.width;y=y.height;break;case At:for(A=0;A<h;A++)C=g[A],n=C.sa,z=0=ea?0:q,b?(C.S.h(f-n.width,V+z),w=Math.max(w,n.width),y=Math.max(y,V+z+n.height),V+=z+n.height):(C.S.h(L+z,f-n.height),w=Math.max(w,L+z+n.width),y=Math.max(y,n.height),L+=z+n.width),ea++;break;case Bt:for(A=0;A<h;A++)C=g[A],f=C.sa,n=0=ea?0:q,b?(C.S.h(p/ 2+a.focus.x,V+n),w=Math.max(w,f.width),y=Math.max(y,V+n+f.height),V+=n+f.height):(C.S.h(L+n,p/2+a.focus.y),w=Math.max(w,L+n+f.width),y=Math.max(y,f.height),L+=n+f.width),ea++}A=Tt(this,2);C=Tt(this,2);b?(A[0].h(0,0),A[1].h(0,y),C[0].h(w,0)):(A[0].h(0,0),A[1].h(w,0),C[0].h(0,y));C[1].h(w,y)}else for(Ga=0;Ga<h;Ga++)elsePa.S.h(Ka,V);w=Math.max(w,J);y=Math.max(y,z+(0=R?0:q)+hb.height);L=J}else{0<n&&0<ea&&V+p+hb.height>n&&(V<f&&Ut(a,k,0,f-V,pa,Ga-1),R++,ea=0,pa=Ga,z=w,V=0,L=135<e?-w-q:w+q);Vt(this,Pa,L,0);Ka=0;if(0=ea){if(A=Pa.kq,C=Pa.xq, J=hb.width,K=hb.height,null=A||null=C||e!Ht(Pa))A=Tt(this,2),C=Tt(this,2),A[0].h(0,0),A[1].h(J,0),C[0].h(0,K),C[1].h(J,K)}else mb=Da(),K=Wt(this,a,Pa,A,C,J,K,mb),Ka=K.x,A=mb[0],C=mb[1],J=K.width,K=K.height,Fa(mb),V<hb.height&&0>Ka&&(Xt(a,0,-Ka,pa,Ga-1),Yt(A,0,-Ka),Yt(C,0,-Ka),Ka=0);Pa.S.h(L,Ka);y=Math.max(y,K);w=Math.max(w,z+(0=R?0:q)+hb.width);V=K}ea++}0<R&&(b?(y+=Math.max(0,c),L<w&&Ut(a,k,w-L,0,pa,h-1),0<u&&(l||Xt(a,u,0,0,h-1),w+=u)):(w+=Math.max(0,c),V<y&&Ut(a,k,0,y-V,pa,h-1),0<u&&(l|| Xt(a,0,u,0,h-1),y+=u)));u=l=0;switch(k){case Zt:b?l+=w/2-a.focus.x-r/2:u+=y/2-a.focus.y-r/2;break;case $t:0<R?b?l+=w/2-a.focus.x-r/2:u+=y/2-a.focus.y-r/2:b?(N=g[0].S.x+g[0].da.x,l+=N+(g[h-1].S.x+g[h-1].da.x+2g[h-1].focus.x-N)/2-a.focus.x-r/2):(N=g[0].S.y+g[0].da.y,u+=N+(g[h-1].S.y+g[h-1].da.y+2g[h-1].focus.y-N)/2-a.focus.y-r/2);break;case Qt:b?(l-=r,w+=r):(u-=r,y+=r);break;case It:b?(l+=w-a.width+r,w+=r):(u+=y-a.height+r,y+=r);break;case zt:b?1<h?l+=N+p/2-a.focus.x:l+=g[0].focus.x-a.focus.x+g[0].da.x: 1<h?u+=N+p/2-a.focus.y:u+=g[0].focus.y-a.focus.y+g[0].da.y;break;case At:b?l+=w+p/2-a.focus.x:u+=y+p/2-a.focus.y;break;case Bt:break;default:B("Unhandled alignment value "+k.toString())}for(r=0;r<h;r++)N=g[r],b?N.S.h(N.S.x+N.da.x-l,N.S.y+(135<e?(m?-y:-N.sa.height)+N.da.y-c:v+c+N.da.y)):N.S.h(N.S.x+(135<e?(m?-w:-N.sa.width)+N.da.x-c:d+c+N.da.x),N.S.y+N.da.y-u);h=g=0;m?b?(w=au(a,w,l),0>l&&(l=0),135<e&&(u+=y+c),y+=v+c,k=Bt&&(g+=p/2+a.focus.x),h+=v+c):(135<e&&(l+=w+c),w+=d+c,y=bu(a,y,u),0>u&&(u=0), k=Bt&&(h+=p/2+a.focus.y),g+=d+c):b?(null=a.comments?d>w&&(w=cu(k,d-w,0),g=w.x,h=w.y,w=d,l=0):w=au(a,w,l),0>l&&(g-=l,l=0),135<e&&(u+=y+c),y=Math.max(Math.max(y,v),y+v+c),h+=v+c):(135<e&&(l+=w+c),w=Math.max(Math.max(w,d),w+d+c),null=a.comments?v>y&&(y=cu(k,0,v-y),g=y.x,h=y.y,y=v,u=0):y=bu(a,y,u),0>u&&(h-=u,u=0),g+=d+c);if(0<R)e=Tt(this,4),R=Tt(this,4),b?(e[2].h(0,v+c),e[3].h(e[2].x,y),R[2].h(w,e[2].y),R[3].h(R[2].x,e[3].y)):(e[2].h(d+c,0),e[3].h(w,e[2].y),R[2].h(e[2].x,y),R[3].h(e[3].x,R[2].y)); elseb?(e[0].h(l,0),e[1].h(e[0].x,v),e[2].y<e[1].y&&(e[2].x>e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].y<e[2].y&&(e[3].x>e[0].x?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(l+d,0),R[1].h(R[0].x,v),R[2].y<R[1].y&&(R[2].x<R[0].x?R[2].assign(R[1]):R[1].assign(R[2])),R[3].y<R[2].y&&(R[3].x<R[0].x?R[3].assign(R[2]):R[2].assign(R[3])),e[2].y-=c/2,R[2].y-= c/2):(e[0].h(0,u),e[1].h(d,e[0].y),e[2].x<e[1].x&&(e[2].y>e[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].x<e[2].x&&(e[3].y>e[0].y?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(0,u+v),R[1].h(d,R[0].y),R[2].x<R[1].x&&(R[2].y<R[0].y?R[2].assign(R[1]):R[1].assign(R[2])),R[3].x<R[2].x&&(R[3].y<R[0].y?R[3].assign(R[2]):R[2].assign(R[3])),e[2].x-=c/2,R[2].x-=c/2);du(this,A);du(this,C);a.kq=e;a.xq=R;a.da.h(l,u);a.sa.h(w,y)}break;default:B("Unhandled compaction value "+a.compaction.toString())}}}; function Ft(a,b){if(0=b.childrenCount)elsevar l=b.alignment,m=l=Qt,n=l=== It;h=yt(l);var p=Math.max(0,b.breadthLimit);k=Jt(b);var r=b.nodeSpacing,q=Pt(b),u=m||n?0:q/2,v=b.rowSpacing,w=0;if(m||n||b.zm||b.Am&&1=b.maxGenerationCount)w=Math.max(0,b.rowIndent);m=b.width;var y=b.height,z=0,A=0,C=0,J=0,K=0,L=0,V=0,R=0,ea=0;h&&!Ct(l)&&135<d&&e.reverse();if(Ct(l))if(1<g)for(var pa=0;pa<g;pa++)else 1=g&&(ea=c?e[0].sa.width:e[0].sa.height);if(h)switch(l){case zt:case pt:A=135>d?Rt(b,e,ea, z,A):St(b,e,ea,z,A);ea=A.x;z=A.width;A=A.height;break;case At:for(a=0;a<g;a++)p=e[a],u=p.sa,C=0=V?0:v,c?(p.S.h(f-u.width,K+C),z=Math.max(z,u.width),A=Math.max(A,K+C+u.height),K+=C+u.height):(p.S.h(J+C,f-u.height),z=Math.max(z,J+C+u.width),A=Math.max(A,u.height),J+=C+u.width),V++;break;case Bt:for(f=0;f<g;f++)a=e[f],p=a.sa,u=0=V?0:v,c?(a.S.h(r/2+b.focus.x,K+u),z=Math.max(z,p.width),A=Math.max(A,K+u+p.height),K+=u+p.height):(a.S.h(J+u,r/2+b.focus.y),z=Math.max(z,J+u+p.width),A=Math.max(A,p.height), J+=u+p.width),V++}else for(pa=0;pa<g;pa++)else 0<p&&0<V&&K+r+Ga.height>p&&(K<f&&Ut(b,l,0,f-K,R,pa-1),L++,V=0,R=pa,C=z,K=0,J=135<d?-z-v:z+v),Pa=0=V?u:r,Vt(a,N,J,0),N.S.h(J,K+Pa),A=Math.max(A,K+Pa+Ga.height),z=Math.max(z,C+(0=L?0:v)+Ga.width),K+=Pa+Ga.height;V++}0< L&&(c?(A+=Math.max(0,k),J<z&&Ut(b,l,z-J,0,R,g-1),0<w&&(n||Xt(b,w,0,0,g-1),z+=w)):(z+=Math.max(0,k),K<A&&Ut(b,l,0,A-K,R,g-1),0<w&&(n||Xt(b,0,w,0,g-1),A+=w)));w=n=0;switch(l){case Zt:c?n+=z/2-b.focus.x-q/2:w+=A/2-b.focus.y-q/2;break;case $t:0<L?c?n+=z/2-b.focus.x-q/2:w+=A/2-b.focus.y-q/2:c?(l=e[0].S.x+e[0].da.x,n+=l+(e[g-1].S.x+e[g-1].da.x+2e[g-1].focus.x-l)/2-b.focus.x-q/2):(l=e[0].S.y+e[0].da.y,w+=l+(e[g-1].S.y+e[g-1].da.y+2e[g-1].focus.y-l)/2-b.focus.y-q/2);break;case Qt:c?(n-=q,z+=q):(w-=q,A+= q);break;case It:c?(n+=z-b.width+q,z+=q):(w+=A-b.height+q,A+=q);break;case zt:case pt:c?1<g?n+=ea+r/2-b.focus.x:n+=e[0].focus.x-b.focus.x+e[0].da.x:1<g?w+=ea+r/2-b.focus.y:w+=e[0].focus.y-b.focus.y+e[0].da.y;break;case At:c?n+=z+r/2-b.focus.x:w+=A+r/2-b.focus.y;break;case Bt:break;default:B("Unhandled alignment value "+l.toString())}for(q=0;q<g;q++)l=e[q],c?l.S.h(l.S.x+l.da.x-n,l.S.y+(135<d?(h?-A:-l.sa.height)+l.da.y-k:y+k+l.da.y)):l.S.h(l.S.x+(135<d?(h?-z:-l.sa.width)+l.da.x-k:m+k+l.da.x),l.S.y+ l.da.y-w);c?(z=au(b,z,n),0>n&&(n=0),135<d&&(w+=A+k),A+=y+k):(135<d&&(n+=z+k),z+=m+k,A=bu(b,A,w),0>w&&(w=0));b.da.h(n,w);b.sa.h(z,A)}} function Rt(a,b,c,d,e){var f=b.length;if(0=f)return new M(c,0,d,e);if(1=f)return a=b[0],d=a.sa.width,e=a.sa.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90Ht(a),l=0,m=0,n=0,p=0;p<f;p++)if(!(0!p%2||1<f&&pf-1))else v=eu(r)-g,r.S.h(m+u,c-(q.height+v)),e=Math.max(e,q.height+v),d=Math.max(d,m+u+q.width),m+=u+q.width;l++}l=0;r=m;p=n;k? (m=c+g,n=0):(m=0,n=c+g);for(q=0;q<f;q++)if(0!q%2)else y=eu(u)-g,u.S.h(m+w,n+y),d=Math.max(d,m+w+v.width),e=Math.max(e,n+v.height+y),m+=w+v.width;l++}1<f&&1=f%2&&(b=b[f-1],f=b.sa,h=null=b.parent?0:b.parent.rowSpacing,k?(b.S.h(c+g/2-b.focus.x-b.da.x,e+h),k=c+g/2-b.focus.x-b.da.x,d=Math.max(d,k+f.width),0>k&&(d-=k),e=Math.max(e,Math.max(p,n)+h+f.height),0>b.S.x&& (c=fu(a,b.S.x,!1,c,g))):(b.S.h(d+h,c+g/2-b.focus.y-b.da.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.da.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.S.y&&(c=fu(a,b.S.y,!0,c,g))));return new M(c,0,d,e)} function St(a,b,c,d,e){var f=b.length;if(0=f)return new M(c,0,d,e);if(1=f)return b=b[0],d=b.sa.width,e=b.sa.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270Ht(a),l=0,m=0,n=0,p=0;p<f;p++)if(!(0!p%2||1<f&&pf-1))else v=eu(r)-g,m-=u+q.width,r.S.h(m,c-(q.height+v)),e=Math.max(e,q.height+v),d=Math.max(d,Math.abs(m));l++}l=0;r=m;p=n;k?(m= c+g,n=0):(m=0,n=c+g);for(q=0;q<f;q++)if(0!q%2)else y=eu(u)-g,m-=w+v.width,u.S.h(m,n+y),e=Math.max(e,n+v.height+y),d=Math.max(d,Math.abs(m));l++}1<f&&1=f%2&&(h=b[f-1],l=h.sa,q=null=h.parent?0:h.parent.rowSpacing,k?(h.S.h(c+g/2-h.focus.x-h.da.x,-e-l.height-q),m=c+g/2-h.focus.x-h.da.x,d=Math.max(d,m+l.width),0>m&&(d-=m),e=Math.max(e,Math.abs(Math.min(p,n))+q+l.height), 0>h.S.x&&(c=fu(a,h.S.x,!1,c,g))):(h.S.h(-d-l.width-q,c+g/2-h.focus.y-h.da.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.da.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.S.y&&(c=fu(a,h.S.y,!0,c,g))));for(a=0;a<f;a++)g=b[a],k?g.S.h(g.S.x,g.S.y+e):g.S.h(g.S.x+d,g.S.y);return new M(c,0,d,e)}function eu(a) function fu(a,b,c,d,e){a=a.children;for(var f=a.length,g=0;g<f;g++)c?a[g].S.h(a[g].S.x,a[g].S.y-b):a[g].S.h(a[g].S.x-b,a[g].S.y);b=a[f-1];return Math.max(d,c?b.da.y+b.focus.y-e/2:b.da.x+b.focus.x-e/2)} function au(a,b,c){switch(a.alignment){case $t:case Zt:return c+a.width>b&&(b=c+a.width),0>c&&(b-=c),b;case Qt:return a.width>b?a.width:b;case It:return 2a.focus.x>b?a.width:b+a.width-2a.focus.x;case zt:case pt:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case At:return a.width-a.focus.x+a.nodeSpacing/2+b;case Bt:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function bu(a,b,c){switch(a.alignment){case $t:case Zt:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Qt:return a.height>b?a.height:b;case It:return 2a.focus.y>b?a.height:b+a.height-2a.focus.y;case zt:case pt:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case At:return a.height-a.focus.y+a.nodeSpacing/2+b;case Bt:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function cu(a,b,c){switch(a){case Zt:b/=2;c/=2;break;case $t:b/=2;c/=2;break;case Qt:c=b=0;break;case It:break;default:B("Unhandled alignment value "+a.toString())}return new H(b,c)}function Ut(a,b,c,d,e,f)function Xt(a,b,c,d,e){if(0!b||0!c)for(a=a.children;d<=e;d++)} function Vt(a,b,c,d){var e=b.parent;switch(a.Yc){case Zs:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex=e&&b.relativePoint.h(c,d);break;case ft:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex=e&&b.relativePoint.h(c,d);break;default:B("Unhandled path value "+a.Yc.toString())}}function Yt(a,b,c){for(var d=0;d<a.length;d++)} function Wt(a,b,c,d,e,f,g,h)p=d-p;p+=m;c=r;e=p;if(null=b||2>b.length||null=c||2>c.length)d=null;else{m=Tt(a,b.length+c.length);for(d=f=k=0;f<c.length&&c[f].y<b[0].y;)l=c[f++],m[d++].h(l.x+e,l.y);for(;k<b.length;)l=b[k++],m[d++].h(l.x,l.y);for(k=b[b.length-1].y;f< c.length&&c[f].y<=k;)f++;for(;f<c.length&&c[f].y>k;)l=c[f++],m[d++].h(l.x+e,l.y);c=Tt(a,d);for(k=0;k<d;k++)c[k].assign(m[k]);du(a,m);d=c}f=q;k=p;if(null=n||2>n.length||null=f||2>f.length)e=null;elsef= Math.max(0,p)+g.width;g=u;du(a,b);du(a,r);du(a,n);du(a,q);h[0]=d;h[1]=e;return new M(p,0,f,g)}d=9999999;if(!(null=n||2>n.length||null=r||2>r.length))for(e=c=0;c<n.length&&e<r.length;)f=n[c],v=r[e],k=v.x,l=v.y,l+=p,w=f,c+1<n.length&&(w=n[c+1]),y=v,v=y.x,y=y.y,e+1<r.length&&(y=r[e+1],v=y.x,y=y.y,y+=p),z=d,f.x=k?z=l-f.y:f.x>k&&f.x<v?z=l+(f.x-k)/(v-k)(y-l)-f.y:k>f.x&&k<w.x&&(z=l-(f.y+(k-f.x)/(w.x-f.x)(w.y-f.y))),z<d&&(d=z),w.x<=f.x?c++:v<=k?e++:(w.x<=v&&c++,v<=w.x&&e++);p-=d;p+=m;c=r;e=p;if(null= b||2>b.length||null=c||2>c.length)d=null;elsef=q;k=p;if(null=n||2>n.length||nullf||2>f.length)e=null;else{m=Tt(a,n.length+f.length);for(e=l=c=0;c<n.length&&n[c].x<f[0].x;)w=n[c++],m[e++].h(w.x,w.y); for(;l<f.length;)w=f[l++],m[e++].h(w.x,w.y+k);for(f=f[f.length-1].x;c<n.length&&n[c].x<=f;)c++;for(;c<n.length&&n[c].x>f;)k=n[c++],m[e++].h(k.x,k.y);f=Tt(a,e);for(c=0;c<e;c++)f[c].assign(m[c]);du(a,m);e=f}f=u;g=Math.max(0,p)+g.height;du(a,b);du(a,r);du(a,n);du(a,q);h[0]=d;h[1]=e;return new M(p,0,f,g)}function Tt(a,b){a=a.Fu[b];if(void 0!==a&&(a=a.pop(),void 0!a))return a;a=[];for(var c=0;c<b;c++)a[c]=new H;return a} function du(a,b){var c=b.length,d=a.Fu[c];void 0d&&(d=[],a.Fu[c]=d);d.push(b)} Xs.prototype.arrangeTrees=function(){if(this.Bb=et)for(var a=this.Hb.iterator;a.next();){var b=a.value;if(b instanceof dt)}}else{a=[];for(b=this.Hb.iterator;b.next();)c=b.value,c instanceof dt&&a.push(c);switch(this.sorting){case ut:break;case vt:a.reverse();break;case wt:a.sort(this.comparer);break;case xt:a.sort(this.comparer);a.reverse();break;default:B("Unhandled sorting value "+this.sorting.toString())}c= this.arrangementOrigin;b=c.x;c=c.y;for(d=0;d<a.length;d++){var e=a[d];gu(this,e,b+e.da.x,c+e.da.y);switch(this.Bb){case bt:c+=e.sa.height+this.yd.height;break;case hu:b+=e.sa.width+this.yd.width;break;default:B("Unhandled arrangement value "+this.Bb.toString())}}}};function gu(a,b,c,d){if(null!b)}}Xs.prototype.commitLayout=function(){this.Rv();this.commitNodes();this.Vu();this.isRouting&&this.commitLinks()}; Xs.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)}; Xs.prototype.Vu=function(){if(this.layerStyle=mt){for(var a=this.sw,b=[],c=null,d=this.network.vertexes.iterator;d.next();){var e=d.value;null=c?c=e.bounds.copy():c.Hc(e.bounds);var f=b[e.level];void 0=f?f=Jt(e):f=Math.max(f,Jt(e));b[e.level]=f}for(d=0;d<b.length;d++)void 0=b[d]&&(b[d]=0);90=this.angle||270=this.angle?(c.Tc(this.nodeSpacing/2,this.layerSpacing),d=new H(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.Tc(this.layerSpacing,this.nodeSpacing/2),d=new H(-this.layerSpacing/2,-this.nodeSpacing/ 2));e=[];c=90=this.angle||270=this.angle?c.width:c.height;f=0;if(180=this.angle||270=this.angle)for(var g=0;g<a.length;g++)f+=a[g]+b[g];for(g=0;g<a.length;g++){var h=a[g]+b[g];270=this.angle?(f-=h,e.push(new M(0,f,c,h))):90=this.angle?(e.push(new M(0,f,c,h)),f+=h):180=this.angle?(f-=h,e.push(new M(f,0,h,c))):(e.push(new M(f,0,h,c)),f+=h)}this.commitLayers(e,d)}};Xs.prototype.commitLayers=function();Xs.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()}; Xs.prototype.Rv=function(){for(var a=this.Hb.iterator;a.next();){var b=a.value;b instanceof dt&&iu(this,b)}};function iu(a,b){if(null!b){a.setPortSpots(b);b=b.children;for(var c=b.length,d=0;d<c;d++)iu(a,b[d])}} Xs.prototype.setPortSpots=function(a){var b=a.alignment;if(yt(b)){var c=this.Yc=Zs,d=Ht(a);switch(d){case 0:var e=gd;break;case 90:e=hd;break;case 180:e=fd;break;default:e=ed}var f=a.children,g=f.length;switch(b){case zt:case pt:for(b=0;b<g;b++){var h=f[b];h=(c?h.sourceEdges:h.destinationEdges).first();if(null!h&&(h=h.link,null!h)){var k=90=d||270=d?fd:ed;if(1=g||b=g-1&&1=g%2)switch(d){case 0:k=fd;break;case 90:k=ed;break;case 180:k=gd;break;default:k=hd}else 0=b%2&&(k=90=d||270= d?gd:hd);c?(a.setsPortSpot&&(h.fromSpot=e),a.setsChildPortSpot&&(h.toSpot=k)):(a.setsPortSpot&&(h.fromSpot=k),a.setsChildPortSpot&&(h.toSpot=e))}}break;case At:d=90=d||270=d?gd:hd;for(f=c?a.destinationEdges:a.sourceEdges;f.next();)g=f.value.link,null!g&&(c?(a.setsPortSpot&&(g.fromSpot=e),a.setsChildPortSpot&&(g.toSpot=d)):(a.setsPortSpot&&(g.fromSpot=d),a.setsChildPortSpot&&(g.toSpot=e)));break;case Bt:for(d=90=d||270==d?fd:ed,f=c?a.destinationEdges:a.sourceEdges;f.next();)g=f.value.link, null!g&&(c?(a.setsPortSpot&&(g.fromSpot=e),a.setsChildPortSpot&&(g.toSpot=d)):(a.setsPortSpot&&(g.fromSpot=d),a.setsChildPortSpot&&(g.toSpot=e)))}}else if(c=Ht(a),this.YcZs)for(e=a.destinationEdges;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Mb())switch(c){case 0:d.fromSpot=gd;break;case 90:d.fromSpot=hd;break;case 180:d.fromSpot=fd;break;default:d.fromSpot=ed}else d.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Mb())switch(c){case 0:d.toSpot=fd;break; case 90:d.toSpot=ed;break;case 180:d.toSpot=gd;break;default:d.toSpot=hd}else d.toSpot=a.childPortSpot}}else for(e=a.sourceEdges;e.next();)if(d=e.value.link,null!d){if(a.setsPortSpot)if(a.portSpot.Mb())switch(c){case 0:d.toSpot=gd;break;case 90:d.toSpot=hd;break;case 180:d.toSpot=fd;break;default:d.toSpot=ed}else d.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Mb())switch(c){case 0:d.fromSpot=fd;break;case 90:d.fromSpot=ed;break;case 180:d.fromSpot=gd;break;default:d.fromSpot=hd}else d.fromSpot= a.childPortSpot}};function Ht(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Jt(a)c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c}function Pt(a)return c=Math.max(0,c)} ma.Object.defineProperties(Xs.prototype,{roots:{get:function(),set:function(a){this.Hb!a&&(this.Hb=a,this.C())}},path:{get:function(),set:function(a){this.Qo!a&&(this.Qo=a,this.C())}},treeStyle:{get:function(),set:function(a)},layerStyle:{get:function(), set:function(a)},comments:{get:function(),set:function(a){this.Wc!a&&(this.Wc=a,this.C())}},arrangement:{get:function(),set:function(a)},arrangementSpacing:{get:function(),set:function(a){this.yd.A(a)||(this.yd.assign(a),this.C())}},rootDefaults:{ get:function(),set:function(a){this.T!a&&(this.T=a,this.C())}},alternateDefaults:{get:function(),set:function(a){this.U!a&&(this.U=a,this.C())}},sorting:{get:function(),set:function(a)},comparer:{get:function(),set:function(a){this.T.comparer! a&&(this.T.comparer=a,this.C())}},angle:{get:function(),set:function(a){this.T.angle!a&&(0=a||90=a||180=a||270=a?(this.T.angle=a,this.C()):B("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(),set:function(a){this.T.alignment!a&&(this.T.alignment=a,this.C())}},nodeIndent:{get:function(),set:function(a){this.T.nodeIndent! a&&0<=a&&(this.T.nodeIndent=a,this.C())}},nodeIndentPastParent:{get:function(),set:function(a){this.T.nodeIndentPastParent!a&&0<=a&&1>=a&&(this.T.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(),set:function(a){this.T.nodeSpacing!a&&(this.T.nodeSpacing=a,this.C())}},layerSpacing:{get:function(),set:function(a){this.T.layerSpacing! a&&(this.T.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(),set:function(a){this.T.layerSpacingParentOverlap!a&&0<=a&&1>=a&&(this.T.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(),set:function(a)},breadthLimit:{get:function(), set:function(a){this.T.breadthLimit!a&&0<=a&&(this.T.breadthLimit=a,this.C())}},rowSpacing:{get:function(),set:function(a){this.T.rowSpacing!a&&(this.T.rowSpacing=a,this.C())}},rowIndent:{get:function(),set:function(a){this.T.rowIndent!a&&0<=a&&(this.T.rowIndent=a,this.C())}},commentSpacing:{get:function(),set:function(a){this.T.commentSpacing! a&&(this.T.commentSpacing=a,this.C())}},commentMargin:{get:function(),set:function(a){this.T.commentMargin!a&&(this.T.commentMargin=a,this.C())}},setsPortSpot:{get:function(),set:function(a){this.T.setsPortSpot!a&&(this.T.setsPortSpot=a,this.C())}},portSpot:{get:function(),set:function(a){this.T.portSpot.A(a)||(this.T.portSpot= a,this.C())}},setsChildPortSpot:{get:function(),set:function(a){this.T.setsChildPortSpot!a&&(this.T.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(),set:function(a){this.T.childPortSpot.A(a)||(this.T.childPortSpot=a,this.C())}},alternateSorting:{get:function(),set:function(a){this.U.sorting=a||a!ut&&a!vt&& a!wt&&!xt||(this.U.sorting=a,this.C())}},alternateComparer:{get:function(),set:function(a){this.U.comparer!a&&(this.U.comparer=a,this.C())}},alternateAngle:{get:function(),set:function(a)},alternateAlignment:{get:function(),set:function(a){this.U.alignment! a&&(this.U.alignment=a,this.C())}},alternateNodeIndent:{get:function(),set:function(a){this.U.nodeIndent!a&&0<=a&&(this.U.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(),set:function(a){this.U.nodeIndentPastParent!a&&0<=a&&1>=a&&(this.U.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(), set:function(a){this.U.nodeSpacing!a&&(this.U.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(),set:function(a){this.U.layerSpacing!a&&(this.U.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(),set:function(a){this.U.layerSpacingParentOverlap!a&&0<=a&&1>=a&&(this.U.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{ get:function(),set:function(a)},alternateBreadthLimit:{get:function(),set:function(a){this.U.breadthLimit!a&&0<=a&&(this.U.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(),set:function(a){this.U.rowSpacing!a&&(this.U.rowSpacing=a,this.C())}},alternateRowIndent:{ get:function(),set:function(a){this.U.rowIndent!a&&0<=a&&(this.U.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(),set:function(a){this.U.commentSpacing!a&&(this.U.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(),set:function(a){this.U.commentMargin!a&&(this.U.commentMargin=a,this.C())}},alternateSetsPortSpot:{ get:function(),set:function(a){this.U.setsPortSpot!a&&(this.U.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(),set:function(a){this.U.portSpot.A(a)||(this.U.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(),set:function(a){this.U.setsChildPortSpot!a&&(this.U.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{ get:function(),set:function(a){this.U.childPortSpot.A(a)||(this.U.childPortSpot=a,this.C())}}}); var Ys=new D(Xs,"PathDefault",-1),Zs=new D(Xs,"PathDestination",0),ft=new D(Xs,"PathSource",1),ut=new D(Xs,"SortingForwards",10),vt=new D(Xs,"SortingReverse",11),wt=new D(Xs,"SortingAscending",12),xt=new D(Xs,"SortingDescending",13),Zt=new D(Xs,"AlignmentCenterSubtrees",20),$t=new D(Xs,"AlignmentCenterChildren",21),Qt=new D(Xs,"AlignmentStart",22),It=new D(Xs,"AlignmentEnd",23),zt=new D(Xs,"AlignmentBus",24),pt=new D(Xs,"AlignmentBusBranching",25),At=new D(Xs,"AlignmentTopLeftBus",26),Bt=new D(Xs, "AlignmentBottomRightBus",27),Et=new D(Xs,"CompactionNone",30),Gt=new D(Xs,"CompactionBlock",31),$s=new D(Xs,"StyleLayered",40),tt=new D(Xs,"StyleLastParents",41),st=new D(Xs,"StyleAlternating",42),rt=new D(Xs,"StyleRootOnly",43),bt=new D(Xs,"ArrangementVertical",50),hu=new D(Xs,"ArrangementHorizontal",51),et=new D(Xs,"ArrangementFixedRoots",52),at=new D(Xs,"LayerIndividual",60),nt=new D(Xs,"LayerSiblings",61),mt=new D(Xs,"LayerUniform",62);Xs.className="TreeLayout";Xs.PathDefault=Ys; Xs.PathDestination=Zs;Xs.PathSource=ft;Xs.SortingForwards=ut;Xs.SortingReverse=vt;Xs.SortingAscending=wt;Xs.SortingDescending=xt;Xs.AlignmentCenterSubtrees=Zt;Xs.AlignmentCenterChildren=$t;Xs.AlignmentStart=Qt;Xs.AlignmentEnd=It;Xs.AlignmentBus=zt;Xs.AlignmentBusBranching=pt;Xs.AlignmentTopLeftBus=At;Xs.AlignmentBottomRightBus=Bt;Xs.CompactionNone=Et;Xs.CompactionBlock=Gt;Xs.StyleLayered=$s;Xs.StyleLastParents=tt;Xs.StyleAlternating=st;Xs.StyleRootOnly=rt;Xs.ArrangementVertical=bt; Xs.ArrangementHorizontal=hu;Xs.ArrangementFixedRoots=et;Xs.LayerIndividual=at;Xs.LayerSiblings=nt;Xs.LayerUniform=mt;function ct(a){Pp.call(this,a)}la(ct,Pp);ct.prototype.createVertex=function(){return new dt(this)};ct.prototype.createEdge=function(){return new ju(this)};ct.className="TreeNetwork"; function dt(a){Sp.call(this,a);this.Ia=!1;this.Ic=null;this.I=[];this.kd=this.Za=this.Y=this.Ja=0;this.Wc=null;this.S=new H(0,0);this.sa=new Kb(0,0);this.da=new H(0,0);this.Am=this.zm=this.gA=!1;this.xq=this.kq=null;this.Pc=ut;this.Jc=Zp;this.cc=0;this.wb=$t;this.bs=this.$r=0;this.ds=20;this.ie=50;this.Pr=0;this.$q=Gt;this.Tq=0;this.os=25;this.Zq=this.ns=10;this.Yq=20;this.xs=!0;this.ks=$c;this.ws=!0;this.Wq=$c}la(dt,Sp); dt.prototype.copyInheritedPropertiesFrom=function(a){null!a&&(this.Pc=a.sorting,this.Jc=a.comparer,this.cc=a.angle,this.wb=a.alignment,this.$r=a.nodeIndent,this.bs=a.nodeIndentPastParent,this.ds=a.nodeSpacing,this.ie=a.layerSpacing,this.Pr=a.layerSpacingParentOverlap,this.$q=a.compaction,this.Tq=a.breadthLimit,this.os=a.rowSpacing,this.ns=a.rowIndent,this.Zq=a.commentSpacing,this.Yq=a.commentMargin,this.xs=a.setsPortSpot,this.ks=a.portSpot,this.ws=a.setsChildPortSpot,this.Wq=a.childPortSpot)}; ma.Object.defineProperties(dt.prototype,{initialized:{get:function(),set:function(a){this.Ia!a&&(this.Ia=a)}},parent:{get:function(),set:function(a){this.Ic!a&&(this.Ic=a)}},children:{get:function(),set:function(a){if(this.I!a){if(null!a)for(var b=a.length,c=0;c<b;c++);this.I=a}}},level:{get:function(),set:function(a){this.Ja! a&&(this.Ja=a)}},descendantCount:{get:function(),set:function(a){this.Y!a&&(this.Y=a)}},maxChildrenCount:{get:function(),set:function(a){this.Za!a&&(this.Za=a)}},maxGenerationCount:{get:function(),set:function(a){this.kd!a&&(this.kd=a)}},comments:{get:function(),set:function(a){if(this.Wc!a){if(null!a)for(var b= a.length,c=0;c<b;c++);this.Wc=a}}},sorting:{get:function(),set:function(a){this.Pc!a&&(this.Pc=a)}},comparer:{get:function(),set:function(a){this.Jc!a&&(this.Jc=a)}},angle:{get:function(),set:function(a){this.cc!a&&(this.cc=a)}},alignment:{get:function(),set:function(a){this.wb!a&&(this.wb=a)}},nodeIndent:{ get:function(){return this.$r},set:function(a){this.$r!a&&(this.$r=a)}},nodeIndentPastParent:{get:function(),set:function(a){this.bs!a&&(this.bs=a)}},nodeSpacing:{get:function(),set:function(a){this.ds!a&&(this.ds=a)}},layerSpacing:{get:function(),set:function(a){this.ie!a&&(this.ie=a)}},layerSpacingParentOverlap:{ get:function(),set:function(a){this.Pr!a&&(this.Pr=a)}},compaction:{get:function(){return this.$q},set:function(a){this.$q!a&&(this.$q=a)}},breadthLimit:{get:function(),set:function(a){this.Tq!a&&(this.Tq=a)}},rowSpacing:{get:function(),set:function(a){this.os!a&&(this.os=a)}},rowIndent:{get:function(),set:function(a){this.ns! a&&(this.ns=a)}},commentSpacing:{get:function(),set:function(a){this.Zq!a&&(this.Zq=a)}},commentMargin:{get:function(),set:function(a){this.Yq!a&&(this.Yq=a)}},setsPortSpot:{get:function(),set:function(a){this.xs!a&&(this.xs=a)}},portSpot:{get:function(),set:function(a){this.ks.A(a)||(this.ks=a)}},setsChildPortSpot:{ get:function(),set:function(a){this.ws!a&&(this.ws=a)}},childPortSpot:{get:function(),set:function(a){this.Wq.A(a)||(this.Wq=a)}},childrenCount:{get:function()},relativePosition:{get:function(),set:function(a){this.S.set(a)}},subtreeSize:{get:function(),set:function(a){this.sa.set(a)}}, subtreeOffset:{get:function(),set:function(a){this.da.set(a)}}});dt.className="TreeVertex";function ju(a){Tp.call(this,a);this.tu=new H(0,0)}la(ju,Tp); ju.prototype.commit=function(){var a=this.link;if(null!a&&!a.isAvoiding){var b=this.network.layout,c=null,d=null;switch(b.Yc){case Zs:c=this.fromVertex;d=this.toVertex;break;case ft:c=this.toVertex;d=this.fromVertex;break;default:B("Unhandled path value "+b.Yc.toString())}if(null!c&&null!d)if(b=this.tu,0!b.x||0!b.y||c.gA)else{for(l= 1;3<a.pointsCount;)a.Iv(1);m=a.i(0);n=a.i(a.pointsCount-1)}var p=a.i(a.pointsCount-1);0=e?(c.alignment=It?(e=d.bottom+b.y,0=b.y&&m.y>p.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Pt(c))))):c.alignment=Qt?(e=d.top+b.y,0=b.y&&m.y<p.y-c.rowIndent&&(e=Math.max(e,Math.min(m.y,e+Pt(c))))):e=c.zm||c.Am&&1=c.maxGenerationCount?d.top-c.da.y+b.y:d.y+d.height/2+b.y,h?(a.m(l,m.x,e),l++,a.m(l,d.right+f,e),l++,a.m(l,d.right+f+(b.x-g)/3,e),l++,a.m(l,d.right+f+2*(b.x-g)/3,e),l++,a.m(l,d.right+f+(b.x- g),e),l++,a.m(l,n.x,e)):(k&&(a.m(l,d.right+f/2,m.y),l++),a.m(l,d.right+f/2,e),l++,a.m(l,d.right+f+b.x-(k?g/2:g),e),l++,k&&a.m(l,a.i(l-1).x,n.y))):90=e?(c.alignment=It?(e=d.right+b.x,0=b.x&&m.x>p.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Pt(c))))):c.alignment=Qt?(e=d.left+b.x,0=b.x&&m.x<p.x-c.rowIndent&&(e=Math.max(e,Math.min(m.x,e+Pt(c))))):e=c.zm||c.Am&&1=c.maxGenerationCount?d.left-c.da.x+b.x:d.x+d.width/2+b.x,h?(a.m(l,e,m.y),l++,a.m(l,e,d.bottom+f),l++,a.m(l,e,d.bottom+f+(b.y-g)/ 3),l++,a.m(l,e,d.bottom+f+2*(b.y-g)/3),l++,a.m(l,e,d.bottom+f+(b.y-g)),l++,a.m(l,e,n.y)):(k&&(a.m(l,m.x,d.bottom+f/2),l++),a.m(l,e,d.bottom+f/2),l++,a.m(l,e,d.bottom+f+b.y-(k?g/2:g)),l++,k&&a.m(l,n.x,a.i(l-1).y))):180=e?(c.alignment=It?(e=d.bottom+b.y,0=b.y&&m.y>p.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Pt(c))))):c.alignment=Qt?(e=d.top+b.y,0=b.y&&m.y<p.y-c.rowIndent&&(e=Math.max(e,Math.min(m.y,e+Pt(c))))):e=c.zm||c.Am&&1=c.maxGenerationCount?d.top-c.da.y+b.y:d.y+d.height/2+b.y,h? (a.m(l,m.x,e),l++,a.m(l,d.left-f,e),l++,a.m(l,d.left-f+(b.x+g)/3,e),l++,a.m(l,d.left-f+2*(b.x+g)/3,e),l++,a.m(l,d.left-f+(b.x+g),e),l++,a.m(l,n.x,e)):(k&&(a.m(l,d.left-f/2,m.y),l++),a.m(l,d.left-f/2,e),l++,a.m(l,d.left-f+b.x+(k?g/2:g),e),l++,k&&a.m(l,a.i(l-1).x,n.y))):270=e?(c.alignment=It?(e=d.right+b.x,0=b.x&&m.x>p.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Pt(c))))):c.alignment=Qt?(e=d.left+b.x,0=b.x&&m.x<p.x-c.rowIndent&&(e=Math.max(e,Math.min(m.x,e+Pt(c))))):e=c.zm||c.Am&&1=c.maxGenerationCount? d.left-c.da.x+b.x:d.x+d.width/2+b.x,h?(a.m(l,e,m.y),l++,a.m(l,e,d.top-f),l++,a.m(l,e,d.top-f+(b.y+g)/3),l++,a.m(l,e,d.top-f+2*(b.y+g)/3),l++,a.m(l,e,d.top-f+(b.y+g)),l++,a.m(l,e,n.y)):(k&&(a.m(l,m.x,d.top-f/2),l++),a.m(l,e,d.top-f/2),l++,a.m(l,e,d.top-f+b.y+(k?g/2:g)),l++,k&&a.m(l,n.x,a.i(l-1).y))):B("Invalid angle "+e);a.mf()}else a=this.link,f=Ht(c),f!Ht(d)&&(g=Jt(c),h=c.bounds,c=d.bounds,0=f&&c.left-h.right<g+1||90=f&&c.top-h.bottom<g+1||180=f&&h.left-c.right<g+1||270=f&&h.top-c.bottom< g+1||(a.cj(),c=a.curve=sg,b=a.isOrthogonal,d=yt(this.fromVertex.alignment),a.Hh(),0=f?(f=h.right+g/2,c?4=a.pointsCount&&(c=a.i(3).y,a.K(1,f-20,a.i(1).y),a.m(2,f-20,c),a.m(3,f,c),a.m(4,f+20,c),a.K(5,a.i(5).x,c)):b?d?a.K(3,a.i(2).x,a.i(4).y):6=a.pointsCount&&(a.K(2,f,a.i(2).y),a.K(3,f,a.i(3).y)):4=a.pointsCount?a.m(2,f,a.i(2).y):3=a.pointsCount?a.K(1,f,a.i(2).y):2=a.pointsCount&&a.m(1,f,a.i(1).y)):90=f?(f=h.bottom+g/2,c?4=a.pointsCount&&(c=a.i(3).x,a.K(1,a.i(1).x,f-20),a.m(2,c,f-20), a.m(3,c,f),a.m(4,c,f+20),a.K(5,c,a.i(5).y)):b?d?a.K(3,a.i(2).x,a.i(4).y):6=a.pointsCount&&(a.K(2,a.i(2).x,f),a.K(3,a.i(3).x,f)):4=a.pointsCount?a.m(2,a.i(2).x,f):3=a.pointsCount?a.K(1,a.i(2).x,f):2=a.pointsCount&&a.m(1,a.i(1).x,f)):180=f?(f=h.left-g/2,c?4=a.pointsCount&&(c=a.i(3).y,a.K(1,f+20,a.i(1).y),a.m(2,f+20,c),a.m(3,f,c),a.m(4,f-20,c),a.K(5,a.i(5).x,c)):b?d?a.K(3,a.i(2).x,a.i(4).y):6=a.pointsCount&&(a.K(2,f,a.i(2).y),a.K(3,f,a.i(3).y)):4=a.pointsCount?a.m(2,f,a.i(2).y):3=a.pointsCount? a.K(1,f,a.i(2).y):2=a.pointsCount&&a.m(1,f,a.i(1).y)):270=f&&(f=h.top-g/2,c?4=a.pointsCount&&(c=a.i(3).x,a.K(1,a.i(1).x,f+20),a.m(2,c,f+20),a.m(3,c,f),a.m(4,c,f-20),a.K(5,c,a.i(5).y)):b?d?a.K(3,a.i(2).x,a.i(4).y):6=a.pointsCount&&(a.K(2,a.i(2).x,f),a.K(3,a.i(3).x,f)):4=a.pointsCount?a.m(2,a.i(2).x,f):3=a.pointsCount?a.K(1,a.i(2).x,f):2=a.pointsCount&&a.m(1,a.i(1).x,f)),a.mf()))}}; ma.Object.defineProperties(ju.prototype,{relativePoint:{get:function(),set:function(a){this.tu.set(a)}}});ju.className="TreeEdge"; Na.prototype.initializeStandardTools=function(){this.Va("Action",new Fg,this.mouseDownTools);this.Va("Relinking",new Ye,this.mouseDownTools);this.Va("LinkReshaping",new qg,this.mouseDownTools);this.Va("Rotating",new Dg,this.mouseDownTools);this.Va("Resizing",new xg,this.mouseDownTools);this.Va("Linking",new Yf,this.mouseMoveTools);this.Va("Dragging",new Qe,this.mouseMoveTools);this.Va("DragSelecting",new Ig,this.mouseMoveTools);this.Va("Panning",new Jg,this.mouseMoveTools);this.Va("ContextMenu",new Lg, this.mouseUpTools);this.Va("TextEditing",new Wg,this.mouseUpTools);this.Va("ClickCreating",new Gg,this.mouseUpTools);this.Va("ClickSelecting",new Eg,this.mouseUpTools)};on("Horizontal",new wm);on("Spot",new ym);on("Table",new Cm);on("Viewbox",new Hm);on("TableRow",new Fm);on("TableColumn",new Gm);on("Graduated",new Rm);on("Grid",new Im);xi.add(ar.type,rq);xi.add(er.type,Fq); var ku=x.go,lu={get licenseKey(),set licenseKey(a),get version(),Group:S,EnumValue:D,List:E,Set:F,Map:G,Point:H,Size:Kb,Rect:M,Margin:pc,Spot:O,Geometry:ud,PathFigure:ge,PathSegment:le,InputEvent:ne,DiagramEvent:pe,ChangedEvent:qe,Model:Z,GraphLinksModel:ar,TreeModel:er,Binding:Ji,Transaction:ve,UndoManager:we,CommandHandler:Qk,Tool:ye,DraggingTool:Qe,DraggingInfo:ef,LinkingBaseTool:Nf,LinkingTool:Yf,RelinkingTool:Ye,LinkReshapingTool:qg,ResizingTool:xg, RotatingTool:Dg,ClickSelectingTool:Eg,ActionTool:Fg,ClickCreatingTool:Gg,HTMLInfo:Oe,ContextMenuTool:Lg,DragSelectingTool:Ig,PanningTool:Jg,TextEditingTool:Wg,ToolManager:Na,Animation:yh,AnimationManager:uh,AnimationTrigger:$h,Layer:ei,Diagram:P,Palette:Kk,Overview:Mk,Brush:sl,GraphObject:Y,Panel:X,RowColumnDefinition:fk,Shape:W,TextBlock:Xg,TextBlockMetrics:jo,Picture:lk,Part:T,Adornment:De,Node:U,Link:Q,Placeholder:yg,Layout:Di,LayoutNetwork:Pp,LayoutVertex:Sp,LayoutEdge:Tp,GridLayout:Lk,PanelLayout:Nl, CircularLayout:fr,CircularNetwork:xr,CircularVertex:Kr,CircularEdge:Lr,ForceDirectedLayout:Mr,ForceDirectedNetwork:Nr,ForceDirectedVertex:Zr,ForceDirectedEdge:$r,LayeredDigraphLayout:as,LayeredDigraphNetwork:fs,LayeredDigraphVertex:Vs,LayeredDigraphEdge:Ws,TreeLayout:Xs,TreeNetwork:ct,TreeVertex:dt,TreeEdge:ju};ku&&ku.version!==lu.version&&B("WARNING: a go object on the root object is already defined with a version mismatch."+ku.version+". Replaced with version: "+lu.version);x.go=lu; ("undefined"===typeof x||"undefined"===typeof x.module||"object"!==typeof x.module.exports)&&x.define&&"function"===typeof x.define&&x.define.amd&&x.define(lu); ‘undefined‘!==typeof module&&‘object‘===typeof module.exports&&(module.exports=‘undefined‘!==typeof global?global.go:self.go); })();

以上是关于gojs插件源码的主要内容,如果未能解决你的问题,请参考以下文章

前端之gojs插件的基本使用

gojs使用

gojs插件干货:重要概念介绍,数据绑定式,以及怎样去除自带水印方法

代码发布项目——django实现websocket(使用channels)基于channels实现群聊功能gojs插件paramiko模块

20200317 代码发布之模块使用

JS图形化插件利器组件系列 —— Gojs组件