From ef3fb769cecc06de7a010dc19a3ca0418821fca8 Mon Sep 17 00:00:00 2001 From: xiangyu <3170102889@zju.edu.cn> Date: Fri, 6 May 2022 20:01:21 +0800 Subject: [PATCH] add: mind map --- addon/chrome/content/lib/js/go.js | 2204 ++++++++++++++++++++++++++++ addon/chrome/content/mindMap.html | 318 ++++ addon/chrome/content/workspace.xul | 13 +- build.js | 1 + src/knowledge.ts | 11 +- src/views.ts | 148 +- 6 files changed, 2667 insertions(+), 28 deletions(-) create mode 100644 addon/chrome/content/lib/js/go.js create mode 100644 addon/chrome/content/mindMap.html diff --git a/addon/chrome/content/lib/js/go.js b/addon/chrome/content/lib/js/go.js new file mode 100644 index 0000000..b5ccf03 --- /dev/null +++ b/addon/chrome/content/lib/js/go.js @@ -0,0 +1,2204 @@ +/* + * GoJS v2.2.9 JavaScript Library for HTML Diagrams, https://gojs.net + * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. + * Copyright (C) 1998-2022 by Northwoods Software Corporation. All Rights Reserved. + * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.2.9/license.html. + * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. + */ +(function() { var t;function aa(a){var b=0;return function(){return bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c=a.length?a.push(c):a.splice(b,0,c):C("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Ea(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):C("Cannot remove an object from an HTMLCollection or NodeList at "+b)} +function Fa(){var a=Ga.pop();return void 0===a?[]:a}function Ia(a){a.length=0;Ga.push(a)}function Ja(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(za(a)&&a.constructor)return Ja(a.constructor);return typeof a} +function Ka(a){var b=a;za(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function La(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.hB;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} +function Ma(a,b,c){Object.defineProperty(Oa.prototype,a,{get:b,set:c})} +function Pa(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;ec;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;gthis.key)return!1;a=a.m;var b=a.length,c=++this.Qa,d=this.af;if(null!==d)for(;cthis.key)return!1;var b=--this.Qa;if(0<=b)return this.key=b,this.value=a.m[b],!0;this.Qd();return!1};fb.prototype.od=function(){return this.next()}; +fb.prototype.first=function(){var a=this.pb;this.ja=a.Ba;var b=a.m;this.Qa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};fb.prototype.any=function(a){var b=this.pb;b.Ng=null;b=b.m;var c=b.length;this.Qa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};fb.prototype.all=function(a){var b=this.pb;b.Ng=null;b=b.m;var c=b.length;this.Qa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; +fb.prototype.each=function(a){var b=this.pb;b.Ng=null;b=b.m;var c=b.length;this.Qa=c;for(--c;0<=c;c--)a(b[c]);return this};fb.prototype.map=function(a){var b=this.pb;b.Ng=null;var c=[];b=b.m;var d=b.length;this.Qa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.m=c;a.kb();return a.iterator};fb.prototype.filter=function(a){var b=this.pb;b.Ng=null;var c=[];b=b.m;var d=b.length;this.Qa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.m=c;a.kb();return a.iterator}; +fb.prototype.Qd=function(){this.key=-1;this.value=null;this.ja=-1;this.pb.Ng=this};fb.prototype.toString=function(){return"ListIteratorBackwards("+this.Qa+"/"+this.pb.count+")"};na.Object.defineProperties(fb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.pb.m.length}}});fb.prototype.first=fb.prototype.first;fb.prototype.hasNext=fb.prototype.od;fb.prototype.next=fb.prototype.next;fb.prototype.reset=fb.prototype.reset; +fb.className="ListIteratorBackwards";function E(a){Ta(this);this.v=!1;this.m=[];this.Ba=0;this.Ng=this.Ja=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=E.prototype;t.kb=function(){var a=this.Ba;a++;999999999a||a>=b.length)&&xa(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.J(a)};t.Lc=function(a,b){var c=this.m;(0>a||a>=c.length)&&xa(a,"0 <= i < length",E,"setElt:i");this.v&&wa(this,a);c[a]=b};t.set=function(a,b){this.Lc(a,b)};t.first=function(){var a=this.m;return 0===a.length?null:a[0]};t.Xb=function(){var a=this.m,b=a.length;return 0a&&xa(a,">= 0",E,"insertAt:i");this.v&&wa(this,a);var c=this.m;a>=c.length?c.push(b):c.splice(a,0,b);this.kb()};t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=this.m;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.kb();return!0};t.delete=function(a){return this.remove(a)}; +t.eb=function(a){var b=this.m;(0>a||a>=b.length)&&xa(a,"0 <= i < length",E,"removeAt:i");this.v&&wa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.kb()};t.removeRange=function(a,b){var c=this.m,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.v&&wa(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&xa(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a=e)for(c=d.slice(b),c.sort(a),a=b;a=this.m.length)return Za;var a=this.Ja;return null!==a?(a.reset(),a):new ab(this)}},iteratorBackwards:{ +get:function(){if(0>=this.m.length)return Za;var a=this.Ng;return null!==a?(a.reset(),a):new fb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.Wi;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.ew;E.prototype.toArray=E.prototype.xa;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.eb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.ub; +E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Xb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.Lc;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.J;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 hb(a){this.ag=a;a.Ja=null;this.ja=a.Ba;this.la=null}hb.prototype.reset=function(){var a=this.ag;a.Ja=null;this.ja=a.Ba;this.la=null};hb.prototype.next=function(){var a=this.ag;if(a.Ba!==this.ja&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Qd();return!1};hb.prototype.od=function(){return this.next()}; +hb.prototype.first=function(){var a=this.ag;this.ja=a.Ba;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};hb.prototype.any=function(a){var b=this.ag;this.la=b.Ja=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};hb.prototype.all=function(a){var b=this.ag;this.la=b.Ja=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};hb.prototype.each=function(a){var b=this.ag;this.la=b.Ja=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; +hb.prototype.map=function(a){var b=this.ag;b.Ja=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};hb.prototype.filter=function(a){var b=this.ag;b.Ja=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};hb.prototype.Qd=function(){this.value=this.key=null;this.ja=-1;this.ag.Ja=this};hb.prototype.toString=function(){return null!==this.la?"SetIterator@"+this.la.value:"SetIterator"}; +na.Object.defineProperties(hb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ag.Hb}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.od;hb.prototype.next=hb.prototype.next;hb.prototype.reset=hb.prototype.reset;hb.className="SetIterator"; +function G(a){Ta(this);this.v=!1;this.Ib={};this.Hb=0;this.Ja=null;this.Ba=0;this.We=this.ba=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=G.prototype;t.kb=function(){var a=this.Ba;a++;999999999=this.Hb)return Za;var a=this.Ja;return null!==a?(a.reset(),a):new hb(this)}}});G.prototype.toList=G.prototype.dw;G.prototype.toArray=G.prototype.xa;G.prototype.clear=G.prototype.clear;G.prototype.retainAll=G.prototype.SA;G.prototype.removeAll=G.prototype.Bq; +G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.first=G.prototype.first;G.prototype.containsAny=G.prototype.xz;G.prototype.containsAll=G.prototype.wz;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.addAll=G.prototype.addAll;G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;var kb=1;G.className="Set";G.uniqueHash=Ta;G.hashIdUnique=ib;G.hashId=gb; +function lb(a){this.ha=a;this.ja=a.Ba;this.la=null}lb.prototype.reset=function(){this.ja=this.ha.Ba;this.la=null};lb.prototype.next=function(){var a=this.ha;if(a.Ba!==this.ja&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=this.key=a=b.key,!0;this.Qd();return!1};lb.prototype.od=function(){return this.next()};lb.prototype.first=function(){var a=this.ha;this.ja=a.Ba;a=a.ba;return null!==a?(this.la=a,this.value=this.key=a=a.key):null}; +lb.prototype.any=function(a){var b=this.ha;this.la=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};lb.prototype.all=function(a){var b=this.ha;this.la=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};lb.prototype.each=function(a){var b=this.ha;this.la=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};lb.prototype.map=function(a){var b=this.ha;this.la=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator}; +lb.prototype.filter=function(a){var b=this.ha;this.la=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};lb.prototype.Qd=function(){this.value=this.key=null;this.ja=-1};lb.prototype.toString=function(){return null!==this.la?"MapKeySetIterator@"+this.la.value:"MapKeySetIterator"};na.Object.defineProperties(lb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ha.Hb}}}); +lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.od;lb.prototype.next=lb.prototype.next;lb.prototype.reset=lb.prototype.reset;lb.className="MapKeySetIterator";function mb(a){G.call(this);Ta(this);this.v=!0;this.ha=a}ma(mb,G);t=mb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.ha.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ha.contains(a)}; +t.has=function(a){return this.contains(a)};t.remove=function(){C("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)};t.clear=function(){C("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ha.ba;return null!==a?a.key:null};mb.prototype.any=function(a){for(var b=this.ha.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};mb.prototype.all=function(a){for(var b=this.ha.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0}; +mb.prototype.each=function(a){for(var b=this.ha.ba;null!==b;)a(b.key),b=b.oa;return this};mb.prototype.map=function(a){for(var b=new G,c=this.ha.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};mb.prototype.filter=function(a){for(var b=new G,c=this.ha.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};mb.prototype.copy=function(){return new mb(this.ha)};mb.prototype.ew=function(){var a=new G,b=this.ha.Ib,c;for(c in b)a.add(b[c].key);return a}; +mb.prototype.xa=function(){var a=this.ha.Ib,b=Array(this.ha.Hb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};mb.prototype.dw=function(){var a=new E,b=this.ha.Ib,c;for(c in b)a.add(b[c].key);return a};na.Object.defineProperties(mb.prototype,{count:{get:function(){return this.ha.Hb}},size:{get:function(){return this.ha.Hb}},iterator:{get:function(){return 0>=this.ha.Hb?Za:new lb(this.ha)}}}); +mb.prototype.toList=mb.prototype.dw;mb.prototype.toArray=mb.prototype.xa;mb.prototype.toSet=mb.prototype.ew;mb.prototype.first=mb.prototype.first;mb.prototype.clear=mb.prototype.clear;mb.prototype["delete"]=mb.prototype.delete;mb.prototype.remove=mb.prototype.remove;mb.prototype.has=mb.prototype.has;mb.prototype.contains=mb.prototype.contains;mb.prototype.add=mb.prototype.add;mb.prototype.thaw=mb.prototype.ea;mb.prototype.freeze=mb.prototype.freeze;mb.className="MapKeySet"; +function nb(a){this.ha=a;a.Ve=null;this.ja=a.Ba;this.la=null}nb.prototype.reset=function(){var a=this.ha;a.Ve=null;this.ja=a.Ba;this.la=null};nb.prototype.next=function(){var a=this.ha;if(a.Ba!==this.ja&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Qd();return!1};nb.prototype.od=function(){return this.next()}; +nb.prototype.first=function(){var a=this.ha;this.ja=a.Ba;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};nb.prototype.any=function(a){var b=this.ha;this.la=b.Ve=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};nb.prototype.all=function(a){var b=this.ha;this.la=b.Ve=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};nb.prototype.each=function(a){var b=this.ha;this.la=b.Ve=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; +nb.prototype.map=function(a){var b=this.ha;this.la=b.Ve=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};nb.prototype.filter=function(a){var b=this.ha;this.la=b.Ve=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};nb.prototype.Qd=function(){this.value=this.key=null;this.ja=-1;this.ha.Ve=this};nb.prototype.toString=function(){return null!==this.la?"MapValueSetIterator@"+this.la.value:"MapValueSetIterator"}; +na.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ha.Hb}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.od;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="MapValueSetIterator";function jb(a,b){this.key=a;this.value=b;this.Fl=this.oa=null}jb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; +jb.className="KeyValuePair";function ob(a){this.ha=a;a.Ja=null;this.ja=a.Ba;this.la=null}ob.prototype.reset=function(){var a=this.ha;a.Ja=null;this.ja=a.Ba;this.la=null};ob.prototype.next=function(){var a=this.ha;if(a.Ba!==this.ja&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.key=b.key,this.value=b.value,!0;this.Qd();return!1};ob.prototype.od=function(){return this.next()}; +ob.prototype.first=function(){var a=this.ha;this.ja=a.Ba;a=a.ba;return null!==a?(this.la=a,this.key=a.key,this.value=a.value,a):null};ob.prototype.any=function(a){var b=this.ha;this.la=b.Ja=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};ob.prototype.all=function(a){var b=this.ha;this.la=b.Ja=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};ob.prototype.each=function(a){var b=this.ha;this.la=b.Ja=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this}; +ob.prototype.map=function(a){var b=this.ha;this.la=b.Ja=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};ob.prototype.filter=function(a){var b=this.ha;this.la=b.Ja=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};ob.prototype.Qd=function(){this.value=this.key=null;this.ja=-1;this.ha.Ja=this};ob.prototype.toString=function(){return null!==this.la?"MapIterator@"+this.la:"MapIterator"}; +na.Object.defineProperties(ob.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ha.Hb}}});ob.prototype.first=ob.prototype.first;ob.prototype.hasNext=ob.prototype.od;ob.prototype.next=ob.prototype.next;ob.prototype.reset=ob.prototype.reset;ob.className="MapIterator"; +function I(a){Ta(this);this.v=!1;this.Ib={};this.Hb=0;this.Ve=this.Ja=null;this.Ba=0;this.We=this.ba=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=I.prototype;t.kb=function(){var a=this.Ba;a++;999999999=this.count)return Za;var a=this.Ja;return null!==a?(a.reset(),a):new ob(this)}},iteratorKeys:{get:function(){return 0>=this.count?Za:new lb(this)}},iteratorValues:{get:function(){if(0>=this.count)return Za; +var a=this.Ve;return null!==a?(a.reset(),a):new nb(this)}}});I.prototype.toKeySet=I.prototype.Ef;I.prototype.toArray=I.prototype.xa;I.prototype.clear=I.prototype.clear;I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.get=I.prototype.get;I.prototype.getValue=I.prototype.H;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.first=I.prototype.first;I.prototype.addAll=I.prototype.addAll;I.prototype.set=I.prototype.set; +I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.ea;I.prototype.freeze=I.prototype.freeze;I.className="Map";function J(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):C("Invalid arguments to Point constructor: "+a+", "+b);this.v=!1}var pb,rb,tb,ub,vb;J.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.h=function(a,b){this.x=a;this.y=b;return this};J.prototype.ng=function(a,b){this.x=a;this.y=b;return this}; +J.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.copy=function(){var a=new J;a.x=this.x;a.y=this.y;return a};t=J.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!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 J(c,e)}return new J}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 J?this.x===a.x&&this.y===a.y:!1};t.Gi=function(a,b){return this.x===a&&this.y===b};t.Ta=function(a){return L.w(this.x,a.x)&&L.w(this.y,a.y)}; +t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ge=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};J.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=J.prototype; +t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.tf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.nd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}t.vz=function(a,b){return L.em(a.x,a.y,b.x,b.y,this.x,this.y)};t.IA=function(a,b,c,d){L.Eh(a,b,c,d,this.x,this.y,this);return this};t.JA=function(a,b){L.Eh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.XA=function(a,b,c,d){L.jq(this.x,this.y,a,b,c,d,this);return this}; +t.YA=function(a,b){L.jq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.Ui=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};t.Vi=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ya(this);return this};function Ab(a,b){b.Ed(a);return a} +function Bb(a,b,c,d,e,f){var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k}function Cb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}function Gb(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}t.u=function(){return isFinite(this.x)&&isFinite(this.y)}; +J.alloc=function(){var a=Hb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Hb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Hb.push(a)};J.prototype.isReal=J.prototype.u;J.prototype.setSpot=J.prototype.Vi;J.prototype.setRectSpot=J.prototype.Ui;J.prototype.snapToGridPoint=J.prototype.YA;J.prototype.snapToGrid=J.prototype.XA;J.prototype.projectOntoLineSegmentPoint=J.prototype.JA;J.prototype.projectOntoLineSegment=J.prototype.IA; +J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return L.lm(a,b,c,d,e,f,g,h)};J.prototype.compareWithLineSegmentPoint=J.prototype.vz;J.compareWithLineSegment=function(a,b,c,d,e,f){return L.em(a,b,c,d,e,f)};J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Oa;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.nd;J.prototype.distanceSquaredPoint=J.prototype.tf;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate; +J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.ge;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Ta;J.prototype.equalTo=J.prototype.Gi;J.prototype.equals=J.prototype.A;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.ng;var Hb=[];J.className="Point";J.parse=wb;J.stringify=xb;J.distanceLineSegmentSquared=Bb;J.distanceSquared=Cb;J.direction=Gb;J.Origin=pb=(new J(0,0)).ca();J.InfiniteTopLeft=rb=(new J(-Infinity,-Infinity)).ca(); +J.InfiniteBottomRight=tb=(new J(Infinity,Infinity)).ca();J.SixPoint=ub=(new J(6,6)).ca();J.NoPoint=vb=(new J(NaN,NaN)).ca();J.parse=wb;J.stringify=xb;J.distanceLineSegmentSquared=Bb;J.distanceSquared=Cb;J.direction=Gb;function M(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):C("Invalid arguments to Size constructor: "+a+", "+b);this.v=!1}var Ib,Jb,Kb,Lb,Mb,Nb,Ob; +M.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.h=function(a,b){this.width=a;this.height=b;return this};M.prototype.ng=function(a,b){this.width=a;this.height=b;return this};M.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this}; +t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function Pb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new M(c,e)}return new M}function Qb(a){return a.width.toString()+" "+a.height.toString()} +t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof M?this.width===a.width&&this.height===a.height:!1};t.Gi=function(a,b){return this.width===a&&this.height===b};t.Ta=function(a){return L.w(this.width,a.width)&&L.w(this.height,a.height)};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};M.alloc=function(){var a=Sb.pop();return void 0===a?new M:a};M.free=function(a){Sb.push(a)};M.prototype.isReal=M.prototype.u; +M.prototype.equalsApprox=M.prototype.Ta;M.prototype.equalTo=M.prototype.Gi;M.prototype.equals=M.prototype.A;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.ng;var Sb=[];M.className="Size";M.parse=Pb;M.stringify=Qb;M.ZeroSize=Ib=(new M(0,0)).ca();M.OneSize=Jb=(new M(1,1)).ca();M.SixSize=Kb=(new M(6,6)).ca();M.EightSize=Lb=(new M(8,8)).ca();M.TenSize=Mb=(new M(10,10)).ca();M.InfiniteSize=Nb=(new M(Infinity,Infinity)).ca();M.NoSize=Ob=(new M(NaN,NaN)).ca();M.parse=Pb;M.stringify=Qb; +function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:"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):a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof M?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):C("Incorrect second argument supplied to Rect constructor "+ +b)):C("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.v=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Tb(a,b,c){a.width=b;a.height=c}t.ng=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this}; +t.Mc=function(a){this.x=a.x;this.y=a.y;return this};t.WA=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this}; +t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function Ub(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new N(c,e,f,g)}return new N} +function Vb(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 N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Gi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ta=function(a){return L.w(this.x,a.x)&&L.w(this.y,a.y)&&L.w(this.width,a.width)&&L.w(this.height,a.height)}; +function Wb(a,b){return L.aa(a.x,b.x)&&L.aa(a.y,b.y)&&L.aa(a.width,b.width)&&L.aa(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.De=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height}; +t.offset=function(a,b){this.x+=a;this.y+=b;return this};t.Gc=function(a,b){return Xb(this,b,a,b,a)};t.Xp=function(a){return Xb(this,a.top,a.right,a.bottom,a.left)};t.cw=function(a){return Xb(this,-a.top,-a.right,-a.bottom,-a.left)};t.lA=function(a,b,c,d){return Xb(this,a,b,c,d)};function Xb(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.hy=function(a){return Yb(this,a.x,a.y,a.width,a.height)}; +t.zv=function(a,b,c,d){return Yb(this,a,b,c,d)};function Yb(a,b,c,d,e){var f=Math.max(a.x,b),g=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Ic=function(a){return this.Av(a.x,a.y,a.width,a.height)}; +t.Av=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 Zb(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Le=function(a){return $b(this,a.x,a.y,0,0)};t.Nc=function(a){return $b(this,a.x,a.y,a.width,a.height)}; +t.gw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return $b(this,a,b,c,d)};function $b(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.Vi=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function ac(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 bc(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.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.rA=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=cc.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=cc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){cc.push(a)}; +na.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{ +get:function(){return new J(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new M(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new J(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2}, +set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.rA;N.prototype.isReal=N.prototype.u;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return L.iy(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.Vi;N.prototype.union=N.prototype.gw;N.prototype.unionRect=N.prototype.Nc;N.prototype.unionPoint=N.prototype.Le;N.prototype.intersects=N.prototype.Av; +N.prototype.intersectsRect=N.prototype.Ic;N.prototype.intersect=N.prototype.zv;N.prototype.intersectRect=N.prototype.hy;N.prototype.grow=N.prototype.lA;N.prototype.subtractMargin=N.prototype.cw;N.prototype.addMargin=N.prototype.Xp;N.prototype.inflate=N.prototype.Gc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.De;N.prototype.containsPoint=N.prototype.$;N.prototype.equalsApprox=N.prototype.Ta;N.prototype.equalTo=N.prototype.Gi; +N.prototype.equals=N.prototype.A;N.prototype.setSize=N.prototype.WA;N.prototype.setPoint=N.prototype.Mc;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.ng;var gc=null,hc=null,cc=[];N.className="Rect";N.parse=Ub;N.stringify=Vb;N.contains=ac;N.intersects=bc;N.ZeroRect=gc=(new N(0,0,0,0)).ca();N.NoRect=hc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Ub;N.stringify=Vb;N.contains=ac;N.intersects=bc; +function ic(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):C("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.v=!1}ic.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; +ic.prototype.ng=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};ic.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};ic.prototype.copy=function(){var a=new ic;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=ic.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()}; +t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this}; +function mc(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 ic;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new ic(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new ic(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new ic(c,e):new ic(c,e,f,g)}return new ic} +function nc(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 ic?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.Gi=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d}; +t.Ta=function(a){return L.w(this.top,a.top)&&L.w(this.right,a.right)&&L.w(this.bottom,a.bottom)&&L.w(this.left,a.left)};t.u=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};ic.alloc=function(){var a=oc.pop();return void 0===a?new ic:a};ic.free=function(a){oc.push(a)};ic.prototype.isReal=ic.prototype.u;ic.prototype.equalsApprox=ic.prototype.Ta;ic.prototype.equalTo=ic.prototype.Gi;ic.prototype.equals=ic.prototype.A;ic.prototype.set=ic.prototype.set; +ic.prototype.setTo=ic.prototype.ng;var pc=null,qc=null,oc=[];ic.className="Margin";ic.parse=mc;ic.stringify=nc;ic.ZeroMargin=pc=(new ic(0,0,0,0)).ca();ic.TwoMargin=qc=(new ic(2,2,2,2)).ca();ic.parse=mc;ic.stringify=nc;function P(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.v=!1} +var rc,sc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Oc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,ad,bd,cd,dd,ed,fd,gd,hd;P.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};P.prototype.ng=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};P.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this}; +P.prototype.copy=function(){var a=new P;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};t=P.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function id(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a} +function jd(a){if("string"===typeof a){a=a.trim();if("None"===a)return rc;if("TopLeft"===a)return sc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return vc;if("TopRight"===a)return wc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return xc;if("Center"===a)return yc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return zc;if("BottomLeft"===a)return Ac;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Bc;if("BottomRight"===a)return Cc;if("TopSide"===a)return Dc;if("LeftSide"=== +a)return Fc;if("RightSide"===a)return Gc;if("BottomSide"===a)return Hc;if("TopBottomSides"===a)return Ic;if("LeftRightSides"===a)return Jc;if("TopLeftSides"===a)return Kc;if("TopRightSides"===a)return Lc;if("BottomLeftSides"===a)return Mc;if("BottomRightSides"===a)return Nc;if("NotTopSide"===a)return Oc;if("NotLeftSide"===a)return Rc;if("NotRightSide"===a)return Sc;if("NotBottomSide"===a)return Tc;if("AllSides"===a)return Uc;if("Default"===a)return Vc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; +var d=a[b++];void 0!==d&&0a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=qd.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; +t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.ya=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Ed=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; +t.Fx=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=1.25*a.x,d=1.2*a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; +t.Jq=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};qd.alloc=function(){var a=rd.pop();return void 0===a?new qd:a}; +qd.free=function(a){rd.push(a)};qd.prototype.transformRect=qd.prototype.Jq;qd.prototype.transformPoint=qd.prototype.ya;qd.prototype.scale=qd.prototype.scale;qd.prototype.translate=qd.prototype.translate;qd.prototype.rotate=qd.prototype.rotate;qd.prototype.invert=qd.prototype.Ns;qd.prototype.multiplyInverted=qd.prototype.Hv;qd.prototype.multiply=qd.prototype.multiply;qd.prototype.reset=qd.prototype.reset;qd.prototype.isIdentity=qd.prototype.Os;qd.prototype.equals=qd.prototype.A; +qd.prototype.setTransform=qd.prototype.setTransform;qd.prototype.set=qd.prototype.set;var rd=[];qd.className="Transform";qd.xF="54a702f3e53909c447824c6706603faf4c"; +var L={fB:"7da71ca0ad381e90",qg:(Math.sqrt(2)-1)/3*4,uw:null,sqrt:function(a){if(0>=a)return 0;var b=L.uw;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);L.uw=b}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){a-=b;return.5>a&&-.5a&&-5E-8=e&&(e=1E-6);if(am-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},vs:function(a,b,c,d,e,f,g,h,k,l,m,n){if(L.Mb(a,b,g,h,n,c,d)&&L.Mb(a,b,g,h,n,e,f))return L.Mb(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 L.vs(a, +b,p,r,d,c,v,w,k,l,m,n)||L.vs(v,w,q,u,e,f,g,h,k,l,m,n)},pz:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},oz:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Gb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},cm:function(a,b,c,d,e,f,g,h,k,l){if(L.Mb(a,b,g,h,k,c,d)&&L.Mb(a,b,g,h,k,e,f))$b(l,a,b,0,0),$b(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/ +2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;L.cm(a,b,m,n,d,c,q,u,k,l);L.cm(q,u,p,r,e,f,g,h,k,l)}return l},Ce:function(a,b,c,d,e,f,g,h,k,l){if(L.Mb(a,b,g,h,k,c,d)&&L.Mb(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;L.Ce(a,b,m,n,d,c,q,u,k,l);L.Ce(q,u,p,r,e,f,g,h,k,l)}return l},Mv:function(a,b,c,d,e,f,g,h,k,l){if(L.Mb(a,b,e,f,l,c,d))return L.Mb(a, +b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return L.Mv(a,b,m,n,p,r,g,h,k,l)||L.Mv(p,r,c,d,e,f,g,h,k,l)},uB: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},Lv:function(a,b,c,d,e,f,g,h){if(L.Mb(a,b,e,f,g,c,d))$b(h,a,b,0,0),$b(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;L.Lv(a,b,k,l,m,n,g,h);L.Lv(m,n,c,d,e,f,g,h)}return h},xq:function(a,b,c,d,e,f,g,h){if(L.Mb(a,b,e,f,g,c,d))0===h.length&&(h.push(a), +h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;L.xq(a,b,k,l,m,n,g,h);L.xq(m,n,c,d,e,f,g,h)}return h},Zp:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(L.Mb(a,b,g,h,p,c,d)&&L.Mb(a,b,g,h,p,e,f)){if(!L.lm(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;r.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var q=(a+c)/2,u=(b+d)/2,v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/ +2;w=(w+f)/2;var z=(d+v)/2,y=(c+w)/2,A=Infinity,B=!1,F=0,K=0;L.Zp(a,b,q,u,d,c,z,y,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a=m)return r; +if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(ba)return r}else if(aa)return r;0p&&r--}else{q=(a+c)/2;u=(b+d)/2;var v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/2;w=(w+f)/2;var z=(d+v)/2,y=(c+w)/2;r+=L.$p(a,b,q,u,d,c,z,y,k,l,m,n,p);r+=L.$p(z,y,v,w,e,f,g,h,k,l,m,n,p)}return r},Eh:function(a,b,c,d,e,f,g){if(L.aa(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(L.aa(b,d)){aa)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005b)return k.h(a, +b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(L.aa(h,g))return L.Eh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(L.aa(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return L.Eh(a,b,c,d,e,g*(e-a)+b,k)},sB:function(a,b,c,d,e){return L.Ie(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},qB:function(a,b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c*a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k},yf:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(L.Ie(a,b,a, +d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},pB:function(a,b,c,d,e,f,g,h,k){c=a-c;g=e-g;0===c||0===g?0===c?(b=(f-h)/g,h=a,e=b*h+(f-b*e)):(f=(b-d)/c,h=e,e=f*h+(b-f*a)):(d=(b-d)/c,h=(f-h)/g,a=b-d*a, +h=(f-h*e-a)/(d-h),e=d*h+a);k.h(h,e);return k},Ls:function(a,b,c){return L.iy(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},iy:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f=b):f===h?(e=a):ac(a,b,c,d,e,f)||ac(a,b,c,d,g,h)||L.lm(a,b,k,b,e,f,g,h)||L.lm(k,b,k,l,e,f,g,h)||L.lm(k,l,a,l,e,f,g,h)||L.lm(a,l,a,b,e,f,g,h)?!0:!1},lm:function(a,b,c,d,e,f,g,h){return 0>=L.em(a,b,c,d,e,f)*L.em(a,b,c,d,g,h)&&0>=L.em(e,f,g,h,a,b)*L.em(e, +f,g,h,c,d)},em:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return f},vq:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},Lx:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e-d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f;for(;1E-5c,f=0>d;if(al;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=m*m+n*n-1;if(0m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,fa?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case Q.C:var b=new N(this.startX,this.startY,0,0);b.gw(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 Q.M:b=new N(this.startX,this.startY,0,0);b.gw(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 Q.o:b="";c=this.figures.m;for(var d=c.length,e=0;e=A-1?!0:null!==l[u+1].match(B)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());v===v.toLowerCase()&&(b=y.x+b,c=y.y+c);a.h(b,c)}function f(){e(y);return y}function g(){e(z);return z}function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?y:new J(2*y.x-z.x,2*y.y-z.y)}void 0===b&&(b=!1);var k=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2"); +a=a.replace(k,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2");a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var l=a.split(" ");for(a=0;a=A-1);)if(w=v,v=d(),""!==v)switch(v.toUpperCase()){case "X":p=!0;n=m=!1;break;case "M":r=f();null===a.gc||!0===p?(wd(a,r.x,r.y,m,!n),p=!1):a.moveTo(r.x,r.y);for(k.assign(y);!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();)y=new J((v===v.toLowerCase()?y.x:0)+parseFloat(d()), +y.y),a.lineTo(y.x,y.y);break;case "V":for(;!c();)y=new J(y.x,(v===v.toLowerCase()?y.y:0)+parseFloat(d())),a.lineTo(y.x,y.y);break;case "C":for(;!c();){r=new J;e(r);q=g();var F=f();xd(a,r.x,r.y,q.x,q.y,F.x,F.y)}break;case "S":for(;!c();)r=h(),q=g(),F=f(),xd(a,r.x,r.y,q.x,q.y,F.x,F.y);break;case "Q":for(;!c();)r=g(),q=f(),Ad(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)z=r=h(),q=f(),Ad(a,r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d());q=parseFloat(d());F=parseFloat(d());var K=parseFloat(d()), +S=parseFloat(d()),R=S,O=!1;c()||(R=parseFloat(d()),c()||(O=0!==parseFloat(d())));v===v.toLowerCase()&&(F+=y.x,K+=y.y);a.arcTo(r,q,F,K,S,R,O)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),F=parseFloat(d()),S=K=!1,O=R=0,R=d(),1===R.length?(K=!!parseFloat(R),S=!!parseFloat(d()),R=parseFloat(d())):2===R.length?(K=!!parseFloat(R[0]),S=!!parseFloat(R[1]),R=parseFloat(d())):(K=!!parseFloat(R[0]),S=!!parseFloat(R[1]),R=parseFloat(R.slice(2))),O=parseFloat(d()),v===v.toLowerCase()&& +(R=y.x+R,O=y.y+O),y.h(R,O),Bd(a,r,q,F,K,S,R,O);break;case "Z":Cd(a);y.assign(k);break;case "F":r="";for(q=1;l[u+q];)if(null!==l[u+q].match(/[Uu]/))q++;else if(null===l[u+q].match(B))q++;else{r=l[u+q];break}r.match(/[Mm]/)?m=!0:0g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle); +0>d&&(q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case Pd:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;if(0===q.radiusX||0===q.radiusY)break;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c); +q.radiusY*=Math.sqrt(b*b+d*d);break;default:C("Unknown Segment type: "+q.type)}}}}this.qa=!0;return this}; +t.$=function(a,b){void 0===b&&(b=0);var c=this.Zc,d=this.$c,e=this.fc,f=this.oc;switch(this.type){case Q.j:return L.Mb(c,d,e,f,b,a.x,a.y);case Q.C:var g=N.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.$(a);N.free(g);return a;case Q.M:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case Q.o:return Sd(this,a,b,!0,!1);default:return!1}}; +function Sd(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.m,r=p.length,q=0;q=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(fh)return 0}else{if(bf)return 0}else if(eg)return 0}else if(le)return 0;return 0a?a=0:1=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; +t.Xx=function(a){0>a?a=0:1=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; +t.vv=function(a,b){0>a?a=0:1=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2* +a+3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; +t.Yx=function(a){if(this.type===Q.j){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=J.alloc();L.Eh(b,c,d,e,f,a,h);a=h.x;f=h.y;J.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===Q.C){g=this.startX;h=this.startY;var k=this.endX; +e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=J.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;na?0:1a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.m,d=c.length,e=0;ea&&(a+=360),this.Ae=a,this.pi=0,this.ri=Math.max(d,0),this.ah=Math.max(e,0),this.rl="boolean"===typeof g?g:"number"===typeof g?!!g:!1,this.Nk=!!h):(this.Ae=d,this.pi=e,a===Od&&(f=Math.max(f,0)),this.ri=f,"number"===typeof g?(a===Od&&(g=Math.max(g,0)),this.ah=g):this.ah=0, +this.Nk=this.rl=!1);this.yj=!1;this.qa=!0;this.Od=null}Xd.prototype.copy=function(){var a=new Xd;a.ia=this.ia;a.fc=this.fc;a.oc=this.oc;a.Ae=this.Ae;a.pi=this.pi;a.ri=this.ri;a.ah=this.ah;a.rl=this.rl;a.Nk=this.Nk;a.yj=this.yj;a.qa=this.qa;return a};t=Xd.prototype; +t.Ta=function(a){if(!(a instanceof Xd)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Fd:case ud:return L.w(this.endX,a.endX)&&L.w(this.endY,a.endY);case Md:return L.w(this.endX,a.endX)&&L.w(this.endY,a.endY)&&L.w(this.point1X,a.point1X)&&L.w(this.point1Y,a.point1Y)&&L.w(this.point2X,a.point2X)&&L.w(this.point2Y,a.point2Y);case Nd:return L.w(this.endX,a.endX)&&L.w(this.endY,a.endY)&&L.w(this.point1X,a.point1X)&&L.w(this.point1Y,a.point1Y);case Od:return L.w(this.startAngle, +a.startAngle)&&L.w(this.sweepAngle,a.sweepAngle)&&L.w(this.centerX,a.centerX)&&L.w(this.centerY,a.centerY)&&L.w(this.radiusX,a.radiusX)&&L.w(this.radiusY,a.radiusY);case Pd:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&L.w(this.xAxisRotation,a.xAxisRotation)&&L.w(this.endX,a.endX)&&L.w(this.endY,a.endY)&&L.w(this.radiusX,a.radiusX)&&L.w(this.radiusY,a.radiusY);default:return!1}};t.gb=function(a){a.classType===Xd&&(this.type=a)}; +t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Fd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case ud:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Md: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 Nd: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 Od: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 Pd: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.yj?"z":"")};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.close=function(){this.yj=!0;return this}; +function Qd(a,b){if(null!==a.Od&&!1===b.qa)return a.Od;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Od=[],a.Od;b=a.Ae;var e=a.pi,f=L.Lx(0,0,c=r?g=Math.PI:1<=r&&(g=0);!k&&0g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=L.Lx(0,0,b>f?b:f,m,m+g,!0);f=qd.alloc();f.reset();f.translate(c,d);f.rotate(a.Ae,0,0);f.scale(k,r);Q.Ha(b,f);qd.free(f);a.Od=b;return a.Od} +na.Object.defineProperties(Xd.prototype,{isClosed:{get:function(){return this.yj},set:function(a){this.yj!==a&&(this.yj=a,this.qa=!0)}},type:{get:function(){return this.ia},set:function(a){this.v&&wa(this,a);this.ia=a;this.qa=!0}},endX:{get:function(){return this.fc},set:function(a){this.v&&wa(this,a);this.fc=a;this.qa=!0}},endY:{get:function(){return this.oc},set:function(a){this.v&& +wa(this,a);this.oc=a;this.qa=!0}},point1X:{get:function(){return this.Ae},set:function(a){this.v&&wa(this,a);this.Ae=a;this.qa=!0}},point1Y:{get:function(){return this.pi},set:function(a){this.v&&wa(this,a);this.pi=a;this.qa=!0}},point2X:{get:function(){return this.ri},set:function(a){this.v&&wa(this,a);this.ri=a;this.qa=!0}},point2Y:{get:function(){return this.ah},set:function(a){this.v&& +wa(this,a);this.ah=a;this.qa=!0}},centerX:{get:function(){return this.Ae},set:function(a){this.v&&wa(this,a);this.Ae=a;this.qa=!0}},centerY:{get:function(){return this.pi},set:function(a){this.v&&wa(this,a);this.pi=a;this.qa=!0}},radiusX:{get:function(){return this.ri},set:function(a){0>a&&xa(a,">= zero",Xd,"radiusX");this.v&&wa(this,a);this.ri=a;this.qa=!0}},radiusY:{get:function(){return this.ah}, +set:function(a){0>a&&xa(a,">= zero",Xd,"radiusY");this.v&&wa(this,a);this.ah=a;this.qa=!0}},startAngle:{get:function(){return this.fc},set:function(a){this.fc!==a&&(this.v&&wa(this,a),a%=360,0>a&&(a+=360),this.fc=a,this.qa=!0)}},sweepAngle:{get:function(){return this.oc},set:function(a){this.v&&wa(this,a);360a&&(a=-360);this.oc=a;this.qa=!0}},isClockwiseArc:{get:function(){return this.Nk},set:function(a){this.v&& +wa(this,a);this.Nk=a;this.qa=!0}},isLargeArc:{get:function(){return this.rl},set:function(a){this.v&&wa(this,a);this.rl=a;this.qa=!0}},xAxisRotation:{get:function(){return this.Ae},set:function(a){a%=360;0>a&&(a+=360);this.v&&wa(this,a);this.Ae=a;this.qa=!0}}});Xd.prototype.equalsApprox=Xd.prototype.Ta; +var Fd=new D(Xd,"Move",0),ud=new D(Xd,"Line",1),Md=new D(Xd,"Bezier",2),Nd=new D(Xd,"QuadraticBezier",3),Od=new D(Xd,"Arc",4),Pd=new D(Xd,"SvgArc",4);Xd.className="PathSegment";Xd.Move=Fd;Xd.Line=ud;Xd.Bezier=Md;Xd.QuadraticBezier=Nd;Xd.Arc=Od;Xd.SvgArc=Pd;function Zd(){this.F=null;this.Wu=(new J(0,0)).freeze();this.Ht=(new J(0,0)).freeze();this.Sq=this.Lr=0;this.Tq=1;this.ci="";this.rs=this.hr=!1;this.fr=this.Vq=0;this.sg=this.ur=this.Ar=!1;this.lr=null;this.ps=0;this.md=this.os=null} +Zd.prototype.copy=function(){var a=new Zd;return this.clone(a)};Zd.prototype.clone=function(a){a.F=this.F;a.Wu.assign(this.viewPoint);a.Ht.assign(this.documentPoint);a.Lr=this.Lr;a.Sq=this.Sq;a.Tq=this.Tq;a.ci=this.ci;a.hr=this.hr;a.rs=this.rs;a.Vq=this.Vq;a.fr=this.fr;a.Ar=this.Ar;a.ur=this.ur;a.sg=this.sg;a.lr=this.lr;a.ps=this.ps;a.os=this.os;a.md=this.md;return a}; +Zd.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};Zd.prototype.mq=function(a,b){var c=this.diagram;if(null===c)return b;$d(c,this.event,a,b);return b}; +Zd.prototype.fA=function(a,b){var c=this.diagram;if(null===c)return b;$d(c,this.event,a,b);b.assign(c.kt(b));return b}; +na.Object.defineProperties(Zd.prototype,{diagram:{get:function(){return this.F},set:function(a){this.F=a}},viewPoint:{get:function(){return this.Wu},set:function(a){this.Wu.assign(a)}},documentPoint:{get:function(){return this.Ht},set:function(a){this.Ht.assign(a)}},modifiers:{get:function(){return this.Lr},set:function(a){this.Lr=a}},button:{get:function(){return this.Sq}, +set:function(a){this.Sq=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Tq},set:function(a){this.Tq=a}},key:{get:function(){return this.ci},set:function(a){this.ci=a}},down:{get:function(){return this.hr},set:function(a){this.hr=a}},up:{get:function(){return this.rs},set:function(a){this.rs= +a}},clickCount:{get:function(){return this.Vq},set:function(a){this.Vq=a}},delta:{get:function(){return this.fr},set:function(a){this.fr=a}},isMultiTouch:{get:function(){return this.Ar},set:function(a){this.Ar=a}},handled:{get:function(){return this.ur},set:function(a){this.ur=a}},bubbles:{get:function(){return this.sg},set:function(a){this.sg=a}},event:{ +get:function(){return this.lr},set:function(a){this.lr=a}},isTouchEvent:{get:function(){var a=x.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=x.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{get:function(){return this.ps},set:function(a){this.ps=a}},targetDiagram:{get:function(){return this.os},set:function(a){this.os=a}},targetObject:{ +get:function(){return this.md},set:function(a){this.md=a}},control:{get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers| +2:this.modifiers&-3}},meta:{get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a= +this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&4):1===this.button},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}); +Zd.prototype.getMultiTouchDocumentPoint=Zd.prototype.fA;Zd.prototype.getMultiTouchViewPoint=Zd.prototype.mq;Zd.className="InputEvent";function ae(){this.F=null;this.na="";this.Tr=this.ks=null}ae.prototype.copy=function(){var a=new ae;a.F=this.F;a.na=this.na;a.ks=this.ks;a.Tr=this.Tr;return a};ae.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; +na.Object.defineProperties(ae.prototype,{diagram:{get:function(){return this.F},set:function(a){this.F=a}},name:{get:function(){return this.na},set:function(a){this.na=a}},subject:{get:function(){return this.ks},set:function(a){this.ks=a}},parameter:{get:function(){return this.Tr},set:function(a){this.Tr=a}}});ae.className="DiagramEvent"; +function be(){this.fn=ce;this.bf=this.Kr="";this.Mo=this.No=this.So=this.To=this.Ro=this.F=this.Tb=null}be.prototype.clear=function(){this.Mo=this.No=this.So=this.To=this.Ro=this.F=this.Tb=null}; +be.prototype.copy=function(){var a=new be;a.fn=this.fn;a.Kr=this.Kr;a.bf=this.bf;a.Tb=this.Tb;a.F=this.F;a.Ro=this.Ro;var b=this.To;a.To=za(b)&&"function"===typeof b.I?b.I():b;b=this.So;a.So=za(b)&&"function"===typeof b.I?b.I():b;b=this.No;a.No=za(b)&&"function"===typeof b.I?b.I():b;b=this.Mo;a.Mo=za(b)&&"function"===typeof b.I?b.I():b;return a};be.prototype.gb=function(a){a.classType===be&&(this.change=a)}; +be.prototype.toString=function(){var a="";a=this.change===de?a+"* ":this.change===ce?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===de?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ka(this.object)),null!==this.oldValue&&(a+=" old: "+Ka(this.oldValue)),null!== +this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ka(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};be.prototype.H=function(a){return a?this.oldValue:this.newValue};be.prototype.hA=function(a){return a?this.oldParam:this.newParam};be.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; +be.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};be.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};be.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; +na.Object.defineProperties(be.prototype,{model:{get:function(){return this.Tb},set:function(a){this.Tb=a}},diagram:{get:function(){return this.F},set:function(a){this.F=a}},change:{get:function(){return this.fn},set:function(a){this.fn=a}},modelChange:{get:function(){return this.Kr},set:function(a){this.Kr=a}},propertyName:{get:function(){return this.bf}, +set:function(a){this.bf=a}},isTransactionFinished:{get:function(){return this.fn===de&&("CommittedTransaction"===this.bf||"FinishedUndo"===this.bf||"FinishedRedo"===this.bf)}},object:{get:function(){return this.Ro},set:function(a){this.Ro=a}},oldValue:{get:function(){return this.To},set:function(a){this.To=a}},oldParam:{get:function(){return this.So},set:function(a){this.So=a}}, +newValue:{get:function(){return this.No},set:function(a){this.No=a}},newParam:{get:function(){return this.Mo},set:function(a){this.Mo=a}}});be.prototype.redo=be.prototype.redo;be.prototype.canRedo=be.prototype.canRedo;be.prototype.undo=be.prototype.undo;be.prototype.canUndo=be.prototype.canUndo;be.prototype.getParam=be.prototype.hA;be.prototype.getValue=be.prototype.H;be.prototype.clear=be.prototype.clear; +var de=new D(be,"Transaction",-1),ce=new D(be,"Property",0),ee=new D(be,"Insert",1),fe=new D(be,"Remove",2);be.className="ChangedEvent";be.Transaction=de;be.Property=ce;be.Insert=ee;be.Remove=fe;function oe(){this.o=(new E).freeze();this.na="";this.j=!1}oe.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0b&&a.Lc(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; +na.Object.defineProperties(oe.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.na},set:function(a){this.na=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}});oe.prototype.optimize=oe.prototype.Zs;oe.prototype.redo=oe.prototype.redo;oe.prototype.canRedo=oe.prototype.canRedo;oe.prototype.undo=oe.prototype.undo;oe.prototype.canUndo=oe.prototype.canUndo; +oe.prototype.clear=oe.prototype.clear;oe.className="Transaction";function pe(){this.nu=new G;this.td=!1;this.C=(new E).freeze();this.pe=-1;this.o=999;this.re=!1;this.cr=null;this.yi=0;this.j=!1;this.we=(new E).freeze();this.Al=new E;this.Pt=!0;this.Zt=this.yr=this.bu=this.au=!1} +pe.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;da.transactionLevel&&ya("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Cb("CommittingTransaction",c,e));var f=0;if(0a.historyIndex;d--)f=b.J(d),null!==f&&f.clear(),b.eb(d),a.yr=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.J(0),null!==f&&f.clear(),b.eb(0),a.pe--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.pe++);b.freeze()}a.isInternalTransaction||a.Cb("CommittedTransaction",c,e)}else{a.re=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| +a.Cb("RolledBackTransaction",c,e),a.re=!1}null!==e&&e.clear()}a.cr=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.J(e),null!==b&&b.undo(),c.ea(),c.eb(e);c.freeze()}return!1}pe.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.Pt&&(a=a.diagram,null!==a&&!1===a.Pi||ya("Change not within a transaction: "+c.toString()))}}; +pe.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; +na.Object.defineProperties(pe.prototype,{models:{get:function(){return this.nu.iterator}},isEnabled:{get:function(){return this.td},set:function(a){this.td=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.J(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndexe&&(e=-3),0g&&(g=-3);if(void 0===h||void 0===e||void 0===g||0===e&&0===g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3*f*a.scrollVerticalLineChange,0e||Math.abs(b.y-a.y)>d}; +na.Object.defineProperties(re.prototype,{diagram:{get:function(){return this.F},set:function(a){a instanceof T&&(this.F=a)}},name:{get:function(){return this.na},set:function(a){this.na=a}},isEnabled:{get:function(){return this.td},set:function(a){this.td=a}},isActive:{get:function(){return this.Oc},set:function(a){this.Oc=a}},transactionResult:{get:function(){return this.tw}, +set:function(a){this.tw=a}}});re.prototype.startTransaction=re.prototype.wa;re.className="Tool";function Oa(){re.call(this);this.name="ToolManager";this.yc=new E;this.Pc=new E;this.Kd=new E;this.M=this.Ga=850;this.o=(new M(2,2)).ca();this.Wa=5E3;this.Ha=ve;this.C=xe;this.br=this.j=null;this.Vj=-1}ma(Oa,re);Oa.prototype.initializeStandardTools=function(){}; +Oa.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof we&&this.br===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; +Oa.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===ye&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===ze){b.bubbles=!0;return}if(this.gestureBehavior===ye)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var c=this.mouseDownTools.length,d=0;de.right&&(c.x-=d.width+5/b.scale);c.xe.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.yc.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Yf;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=lf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=lf(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.sy&&d.S("LinkRelinked",c,d.sy),c.toPort!==d.ty&&d.S("LinkRelinked",c,d.ty)):mf(e,g,f,k,h):mf(e,null,null,null,null)}}}}De.prototype.doDragOver=function(){}; +function nf(a,b){var c=a.diagram;a.dragsLink&&gf(a,!0);Pe(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;of(a,e,f);f=kf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Ie){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof W&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==Ie){a=N.alloc();for(b= +c.selection.iterator;b.next();)d=b.value,d instanceof W&&pf(c,d,a);N.free(a)}}}function of(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof hf||(c=a.mouseDrop,null!==c&&c(b))}function pf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.De(c)&&(d=!0);a=a.sv(c,function(a){return a.part},function(a){return a instanceof U},!0,function(a){return a instanceof U},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Fd(b)&&c.isAvoiding&&c.Ua()} +De.prototype.doDropOnto=function(){};De.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(bf(this,!1),Le(a,this.copiedParts),df(this,this.copiedParts,!1),Qe(a,this.copiedParts)):this.mayMove()?(Se(this),df(this,this.draggedParts,!0)):this.mayDragOut()?(bf(this,!1),df(this,this.copiedParts,!1)):Se(this),ff(this,a.lastInput.documentPoint))}}; +De.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(Se(this),bf(this,!0),Le(a,this.copiedParts),df(this,this.copiedParts,!1),Qe(a,this.copiedParts),null!==this.copiedParts&&(a.S("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,Se(this),this.mayMove()&&(df(this,this.draggedParts, +!0),ff(this,a.lastInput.documentPoint)));this.Cn=!0;nf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Ef():this.draggedParts.Ef();this.copiedParts=null;b&&qf(this);a.Pa();Qe(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.S(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.S("ChangedSelection",a.selection)}}}; +De.prototype.simulatedMouseMove=function(a,b,c){if(null===Ie)return!1;var d=Ie.diagram;c instanceof T||(c=null);var e=Me;c!==e&&(null!==e&&e!==d&&(e.og(),Ie.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Me=c,null!==c&&c!==d&&($e(),e=c.toolManager.findTool("Dragging"),null!==e&&(He.contains(e)||He.add(e),e.doSimulatedDragEnter())),this.doUpdateCursor(null,!0));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging"); +null!==d&&(null!==a&&(void 0!==a.targetTouches&&(0g&&(g=l),m>h&&(h=m))}}Infinity===d?f.h(0,0,0,0):f.h(d,e,g-d,h-e);d=f.x+f.width/2;e=f.y+f.height/2;N.free(f); +f=a.hs;g=new I;h=J.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof U&&l.canCopy()&&(m=c.H(l),null!==m&&(m.points=l.points,cf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.yd())));for(b=b.iterator;b.next();)l=b.value,l.Jc()&&l.canCopy()&&(k=c.H(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.Sa(),g.add(k,a.yd(h))));J.free(h);a.copiedParts=g;Je(a,g.Ef());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,cf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ +2)));a.doUpdateCursor(null,!0)}}}De.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.ht=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.qo=null};De.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new J}; +na.Object.defineProperties(De.prototype,{isCopyEnabled:{get:function(){return this.Pc},set:function(a){this.Pc=a}},copiesEffectiveCollection:{get:function(){return this.C},set:function(a){this.C=a}},dragOptions:{get:function(){return this.Ha},set:function(a){this.Ha=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled= +a}},isComplexRoutingRealtime:{get:function(){return this.yc},set:function(a){this.yc=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.A(a)||(a=a.I(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{ +get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.A(a)||(a=a.I(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.A(a)||(a=a.I(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink= +a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.M},set:function(a){this.M=a}},moveCursor:{get:function(){return this.Ih},set:function(a){this.Ih=a}},nodropCursor:{get:function(){return this.Jh},set:function(a){this.Jh=a}},currentPart:{get:function(){return this.Ga}, +set:function(a){this.Ga=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Wa},set:function(a){this.Wa=a}},draggingParts:{get:function(){return null!==this.copiedParts?this.copiedParts.Ef():null!==this.draggedParts?this.draggedParts.Ef():this.Zi}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink= +a}},isDragOutStarted:{get:function(){return this.Kd},set:function(a){this.Kd=a}},startPoint:{get:function(){return this.hs},set:function(a){this.hs.A(a)||this.hs.assign(a)}},delay:{get:function(){return this.Zk},set:function(a){this.Zk=a}}});De.prototype.getDraggingSource=De.prototype.eA;var Ie=null,Me=null;De.className="DraggingTool";He=new E; +Ma("draggingTool",function(){return this.findTool("Dragging")},function(a){this.Za("Dragging",a,this.mouseMoveTools)});Oa.prototype.doCancel=function(){null!==Ie&&Ie.doCancel();re.prototype.doCancel.call(this)}; +function tf(){re.call(this);this.Jh=100;this.Ha=!1;this.Sh="pointer";var a=new U,b=new uf;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new uf;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.rw=a;a=new W;b=new uf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Jb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Tm=a;this.j=b;a=new W;b=new uf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth= +2;b.desiredSize=Jb;a.add(b);a.selectable=!1;a.layerName="Tool";this.sw=a;this.o=b;this.Ih=this.Kd=this.yc=this.Wa=this.Pc=null;this.Ga=!0;this.My=new I;this.Zi=this.ii=this.Sm=null}ma(tf,re);tf.prototype.doStop=function(){this.diagram.og();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null}; +tf.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){var f=b.wf(),g=M.alloc();g.width=b.naturalBounds.width*f;g.height=b.naturalBounds.height*f;d.desiredSize=g;M.free(g);e?(d.toSpot=b.toSpot,d.toEndSegmentLength=b.toEndSegmentLength):(d.fromSpot=b.fromSpot,d.fromEndSegmentLength=b.fromEndSegmentLength);c.locationSpot=yc;f=J.alloc();c.location=b.da(yc,f);J.free(f);d.angle=b.Li();null!==this.portTargeted&&this.portTargeted(a,b,c,d,e)}}; +tf.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.desiredSize=Jb,b.fromSpot=rc,b.toSpot=rc);null!==a&&(a.location=this.diagram.lastInput.documentPoint);null!==this.portTargeted&&this.portTargeted(null,null,a,b,c)};tf.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()}; +tf.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort&&this.targetPort.part instanceof W){var b=this.targetPort.part;this.isForwards?this.copyPortProperties(b,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(b,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort, +!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.zs(a.lastInput.viewPoint)}};tf.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.part;if(!(c instanceof W))return null;for(;null!==a;){var d=b?a.toLinkable:a.fromLinkable;if(!0===d&&(null!==a.portId||a instanceof W)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.panel}return null}; +tf.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.kg(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 W){var k=g.da(yc,J.alloc()),l=c.x-k.x,m=c.y-k.y;J.free(k);k=l*l+m*m;kc){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.iq(b).count>=c)return!1}return!0}; +tf.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.Dd(b).count>=c)return!1}return!0}; +tf.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};tf.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof W))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof W))return!1;b=b.portId;null===b&&(b="");for(b=d.Dd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; +tf.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, +c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};tf.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 G;d.add(a);return vf(this,c,b,d)}; +function vf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),vf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),vf(a,b.labeledLink,c,d))?!0:!1} +tf.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!==wf){if(d===Hf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!If(this,a,b,c,!0)}if(d===Jf){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!If(this,a,b,c,!0)}if(d===Kf)return a===b?a=!0:(d=new G,d.add(b),a=Lf(this,d,a,b,c)),!a;if(d===Mf)return!If(this,a,b,c,!1);if(d===Nf)return a===b?a=!0:(d=new G,d.add(b),a=Of(this,d,a,b,c)),!a}return!0};function If(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&If(a,g,c,d,e)))return!0}return!1} +function Lf(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&Lf(a,b,g,d,e)))return!0}return!1}function Of(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&Of(a,b,h,d,e))return!0}}return!1} +na.Object.defineProperties(tf.prototype,{portGravity:{get:function(){return this.Jh},set:function(a){0<=a&&(this.Jh=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.Sh},set:function(a){this.Sh=a}},temporaryLink:{get:function(){return this.rw},set:function(a){this.rw=a}},temporaryFromNode:{ +get:function(){return this.Tm},set:function(a){if(this.Tm=a)this.j=a.port}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.T.indexOf(this.j);b.eb(c);b.ub(c,a)}}this.j=a}},temporaryToNode:{get:function(){return this.sw},set:function(a){if(this.sw=a)this.o=a.port}},temporaryToPort:{get:function(){return this.o},set:function(a){if(null!== +this.o){var b=this.o.panel;if(null!==b){var c=b.T.indexOf(this.o);b.eb(c);b.ub(c,a)}}this.o=a}},originalLink:{get:function(){return this.Pc},set:function(a){this.Pc=a}},originalFromNode:{get:function(){return this.Wa},set:function(a){this.Wa=a}},originalFromPort:{get:function(){return this.yc},set:function(a){this.yc=a}},originalToNode:{get:function(){return this.Kd},set:function(a){this.Kd= +a}},originalToPort:{get:function(){return this.Ih},set:function(a){this.Ih=a}},isForwards:{get:function(){return this.Ga},set:function(a){this.Ga=a}},validPortsCache:{get:function(){return this.My}},targetPort:{get:function(){return this.Sm},set:function(a){this.Sm=a}},linkValidation:{get:function(){return this.ii},set:function(a){this.ii=a}},portTargeted:{ +get:function(){return this.Zi},set:function(a){this.Zi=a}}});tf.className="LinkingBaseTool";function Pf(){tf.call(this);this.name="Linking";this.M={};this.C=null;this.K=Qf;this.Kh=null}ma(Pf,tf);Pf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.Ps()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; +Pf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.Wb(a.firstInput.documentPoint,null,null));if(null===b)return null;a=b.part;if(!(a instanceof W))return null;var c=this.direction;if(c===Qf||c===Rf){var d=this.findValidLinkablePort(b,!1);if(null!==d||this.startObject===a&&(d=a.port,this.findValidLinkablePort(d,!1)))return this.isForwards=!0,d}if(c===Qf||c===Sf)if(b=this.findValidLinkablePort(b,!0),null!==b||this.startObject===a&&(b=a.port,this.findValidLinkablePort(b, +!0)))return this.isForwards=!1,b;return null}; +Pf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null===b?this.stopTool():(this.wa(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.u()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof W&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode, +this.temporaryFromPort,!1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.u()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof W&&(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.Ua(),a.add(this.temporaryLink)),this.isActive=!0)};Pf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.stopTransaction()}; +Pf.prototype.doStop=function(){tf.prototype.doStop.call(this);this.startObject=null}; +Pf.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,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 W&&(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.S("ChangingSelection",a.selection),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.S("LinkDrawn",f)):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.S("ChangedSelection",a.selection)}}};Pf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof U)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}; +Pf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Pf.prototype.doNoLink=function(){}; +na.Object.defineProperties(Pf.prototype,{archetypeLinkData:{get:function(){return this.M},set:function(a){this.M=a}},archetypeLabelNodeData:{get:function(){return this.C},set:function(a){this.C=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Kh},set:function(a){this.Kh=a}}}); +var Qf=new D(Pf,"Either",0),Rf=new D(Pf,"ForwardsOnly",0),Sf=new D(Pf,"BackwardsOnly",0);Pf.className="LinkingTool";Pf.Either=Qf;Pf.ForwardsOnly=Rf;Pf.BackwardsOnly=Sf; +function Ne(){tf.call(this);this.name="Relinking";var a=new uf;a.figure="Diamond";a.desiredSize=Lb;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.M=a;a=new uf;a.figure="Diamond";a.desiredSize=Lb;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.Kh=a;this.C=null;this.hx=new N}ma(Ne,tf); +Ne.prototype.updateAdornments=function(a){if(null!==a&&a instanceof U){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.u()&&a.isVisible()&&d.actualBounds.u()&&d.Bf()&&(c=a.hk(b),null===c&&(c=this.makeAdornment(d,!1),a.th(b,c)))}null===c&&a.Cf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.u()&&a.isVisible()&&d.actualBounds.u()&&d.Bf()&& +(c=a.hk(b),null===c?(c=this.makeAdornment(d,!0),a.th(b,c)):c.s()));null===c&&a.Cf(b)}};Ne.prototype.makeAdornment=function(a,b){var c=new we;c.type=X.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; +Ne.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.Ps()||!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}; +Ne.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 we&&c.adornedPart instanceof U))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.wa(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.hx.set(this.originalLink.actualBounds);null!==this.originalLink&&0b.firstPickIndex+1&&c=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": +"e-resize"}else if(a instanceof X)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};cg.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}; +cg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(a.isMouseCaptured=!0,a.animationManager.nc(),this.wa(this.name),this.Rr.set(this.adornedObject.da(this.handle.alignment.Jv())),this.Uo.set(this.adornedObject.part.location),this.gx.set(this.adornedObject.desiredSize),this.Lt=this.computeCellSize(),this.Nt= +this.computeMinSize(),this.Mt=this.computeMaxSize(),this.isActive=!0))};cg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ie=this.handle=null;this.isActive=a.isMouseCaptured=!1};cg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; +cg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.Nt,c=this.Mt,d=this.Lt,e=this.adornedObject.Hs(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.ed();J.free(e)}}; +cg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.Nt,c=this.Mt,d=this.Lt,e=this.adornedObject.Hs(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);J.free(e);a.Pa();this.transactionResult=this.name;a.S("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; +cg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Sa();c=c.da(this.handle.alignment.Jv());if(a instanceof hf){var d=new E;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Ee;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().ge(c),!0,e)}else a.location=a.location.copy().ge(c).add(this.oppositePoint);b.ed()}}; +cg.prototype.computeResize=function(a,b,c,d,e,f){b.wc()&&(b=yc);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=J.alloc();L.jq(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* +a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= +Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), +a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), +a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));J.free(p);return a};cg.prototype.computeReshape=function(){var a=og;this.adornedObject instanceof uf&&(a=pg(this.adornedObject));return!(a===qg||this.diagram.lastInput.shift)}; +cg.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};cg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.widthc?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ +d,b.y=-d);return a.da(b)};rg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ie=this.handle=null;this.Xr=new J(NaN,NaN);this.isActive=a.isMouseCaptured=!1};rg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};rg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))}; +rg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Pa();this.transactionResult=this.name;a.S("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; +rg.prototype.rotate=function(a){var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Sa();var c=b.locationObject,d=b.rotateObject;if(c===d||c.mg(d))c=this.Uo.copy(),b.location=c.ge(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.ed()}}; +rg.prototype.computeRotate=function(a){a=this.rotationPoint.Oa(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.Li());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a}; +na.Object.defineProperties(rg.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},handle:{get:function(){return this.j},set:function(a){if(null!==a&&!(a.part instanceof we))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.ie},set:function(a){if(null!==a&&a.part instanceof we)throw Error("new handle must not be in an Adornment: "+ +a);this.ie=a}},snapAngleMultiple:{get:function(){return this.Ha},set:function(a){this.Ha=a}},snapAngleEpsilon:{get:function(){return this.Ga},set:function(a){this.Ga=a}},originalAngle:{get:function(){return this.ex}},rotationPoint:{get:function(){return this.Xr},set:function(a){this.Xr=a.copy()}},handleAngle:{get:function(){return this.C},set:function(a){this.C= +a}},handleDistance:{get:function(){return this.M},set:function(a){this.M=a}}});rg.className="RotatingTool";Ma("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.Za("Rotating",a,this.mouseDownTools)});function sg(){re.call(this);this.name="ClickSelecting"}ma(sg,re);sg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; +sg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};sg.className="ClickSelectingTool";function tg(){re.call(this);this.name="Action";this.Dk=null}ma(tg,re); +tg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.Wb(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.Dk=c;a.Tk=a.Wb(b.documentPoint,null,null);return!0}return!1};tg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; +tg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};tg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()}; +tg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};tg.prototype.doStop=function(){this.Dk=null};tg.className="ActionTool";function ug(){re.call(this);this.name="ClickCreating";this.mj=null;this.o=!0;this.j=!1;this.Nw=new J(0,0)}ma(ug,re); +ug.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.Nw=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.Nw))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.im(a.lastInput.documentPoint,!0)?!1:!0}; +ug.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; +ug.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.S("ChangingSelection",b.selection);this.wa(this.name);if(c instanceof V)c.Jc()&&(ng(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);za(e)&&(b.model.nf(e),d=b.vc(e))}if(null!==d){var f=J.allocAt(a.x,a.y);this.isGridSnapEnabled&&vg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);J.free(f)}b.Pa();this.transactionResult= +this.name;b.S("PartCreated",d)}finally{this.stopTransaction(),b.S("ChangedSelection",b.selection)}return d};na.Object.defineProperties(ug.prototype,{archetypeNodeData:{get:function(){return this.mj},set:function(a){this.mj=a}},isDoubleClick:{get:function(){return this.o},set:function(a){this.o=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}});ug.className="ClickCreatingTool"; +function wg(){re.call(this);this.name="DragSelecting";this.Zk=175;this.o=!1;var a=new V;a.layerName="Tool";a.selectable=!1;var b=new uf;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.j=a}ma(wg,re); +wg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestampe.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};Kg.prototype.doStart=function(){Ug=this;null!==this.textBlock&&this.doActivate()}; +Kg.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.Wb(a.lastInput.documentPoint));if(null!==b&&b instanceof Lg&&(this.textBlock=b,null!==b.part)){a.animationManager.nc();this.isActive=!0;this.ja=Rg;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.mh=this.textBlock.copy();var d=new N(this.textBlock.da(sc),this.textBlock.da(Cc));a.Vv(d);c.show(b,a,this);this.currentTextEditor=c}}}};Kg.prototype.doCancel=function(){this.stopTool()}; +Kg.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};Kg.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Vg)};Kg.prototype.acceptText=function(a){switch(a){case Vg:if(this.ja===Xg)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.ja===Rg||this.ja===Tg||this.ja===Sg)this.ja=Yg,Zg(this);break;case $g:case Pg:case Qg:if(Pg!==a||!0!==this.textBlock.isMultiline)if(this.ja===Rg||this.ja===Tg||this.ja===Sg)this.ja=Yg,Zg(this)}}; +function Zg(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());a.isValidText(b,e,f)?(a.wa(a.name),a.ja=Xg,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.S("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.ja=Tg,a.doError(e,f))}} +Kg.prototype.doError=function(a,b){var c=this.textBlock;null!==c.errorFunction&&c.errorFunction(this,a,b);(a=this.currentTextEditor)&&a.show(c,this.diagram,this)};Kg.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};Kg.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.ja=Ng,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};Kg.prototype.doStop=function(){Ug=null}; +Kg.prototype.isValidText=function(a,b,c){var d=this.textValidation;if(null!==d&&!d(a,b,c))return!1;d=a.textValidation;return null===d||d(a,b,c)?!0:!1};Kg.prototype.py=function(a){var b=this.mh;b.text=a;b.measure(this.textBlock.di,Infinity);return b}; +na.Object.defineProperties(Kg.prototype,{textBlock:{get:function(){return this.Ha},set:function(a){this.Ha=a}},currentTextEditor:{get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.Ga},set:function(a){this.Ga=a}},textValidation:{get:function(){return this.vi}, +set:function(a){this.vi=a}},minimumEditorScale:{get:function(){return this.C},set:function(a){this.C=a}},selectsTextOnActivate:{get:function(){return this.M},set:function(a){this.M=a}},state:{get:function(){return this.ja},set:function(a){this.ja!==a&&(this.ja=a)}}});Kg.prototype.measureTemporaryTextBlock=Kg.prototype.py; +var $g=new D(Kg,"LostFocus",0),Vg=new D(Kg,"MouseDown",1),Qg=new D(Kg,"Tab",2),Pg=new D(Kg,"Enter",3),ah=new D(Kg,"SingleClick",0),Mg=new D(Kg,"SingleClickSelected",1),Wg=new D(Kg,"DoubleClick",2),Ng=new D(Kg,"StateNone",0),Rg=new D(Kg,"StateActive",1),Sg=new D(Kg,"StateEditing",2),Yg=new D(Kg,"StateValidating",3),Tg=new D(Kg,"StateInvalid",4),Xg=new D(Kg,"StateValidated",5),Ug=null;Kg.className="TextEditingTool";Kg.LostFocus=$g;Kg.MouseDown=Vg;Kg.Tab=Qg;Kg.Enter=Pg;Kg.SingleClick=ah; +Kg.SingleClickSelected=Mg;Kg.DoubleClick=Wg;Kg.StateNone=Ng;Kg.StateActive=Rg;Kg.StateEditing=Sg;Kg.StateValidating=Yg;Kg.StateInvalid=Tg;Kg.StateValidated=Xg;Ma("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.Za("TextEditing",a,this.mouseUpTools)}); +function bh(a){ch||(dh(),ch=!0);this.F=se;this.gl=this.rb=this.Dr=this.hc=!1;this.ux=!0;this.hl=eh;this.dn=!1;this.Zh=this.td=!0;this.Fg=600;this.Dw=this.sx=!1;this.Md=new G;this.Pd=new fh;this.Pd.Ld=this;this.$i=new G;this.Ou=new G;this.qs=new G;this.Il=new G;a&&Object.assign(this,a)}bh.prototype.Ke=function(a){this.F=a};bh.prototype.canStart=function(){return!0};function gh(a,b){a.td&&a.canStart(b)&&(a.Md.add(b),a.defaultAnimation.isAnimating&&a.nc(),hh(a.F),a.rb=!0)} +function ih(a){if(a.td&&a.rb){var b=a.Pd,c=a.F,d=a.Md.contains("Model");d&&(a.gl=!0,a.hl===eh?(b.isViewportUnconstrained=!0,b.jc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.hl===jh&&b.jc.clear(),a.ux=a.hl===kh&&c.Cu.A(c.ka)?!0:!1,c.S("InitialAnimationStarting",a));d&&!a.Zh||0===b.jc.count?(a.Md.clear(),a.rb=!1,b.jc.clear(),lh(b,c),a.gl=!1,c.N()):(a.Md.clear(),c.eg=!1,d=b.jc.get(c),c.autoScale!==mh&&null!==d&&(delete d.start.scale,delete d.end.scale), +x.requestAnimationFrame(function(){!1===a.rb||b.hc||(c.Fe("temporaryPixelRatio")&&Ke(c),nh(c),a.rb=!1,b.start(),oh(a),c.Pa(),zh(b,0),rf(c,!0),Ah(a),c.S("AnimationStarting",a))}))}}function Bh(a){return a.Md.contains("Trigger")&&1===a.Md.count}function Ch(a,b,c,d){a.isTicking||Bh(a)||b instanceof U&&(null!==b.fromNode||null!==b.toNode)||a.Pd.add(b,"position",c,d,!1)}t=bh.prototype;t.Ys=function(a){return this.Pd.Ys(a)};t.Cv=function(a){return this.Pd.Cv(a)}; +function Dh(a,b){function c(){0f?f+=360:k+=360);f=e(c,f,k-f,d)%360;g=e(c,g,l-g,d);h=e(c,h,m-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} +function dh(){function a(a,b,e,f,g,h){a.position=new J(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new I;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){ga&&xa(a,">= 1",bh,"duration");this.Fg=a}},isAnimating:{get:function(){return this.hc}}, +isTicking:{get:function(){return this.Dr}},isInitial:{get:function(){return this.Zh},set:function(a){this.Zh=a}},defaultAnimation:{get:function(){return this.Pd}},activeAnimations:{get:function(){return this.$i}},initialAnimationStyle:{get:function(){return this.hl},set:function(a){this.hl=a}}});bh.prototype.stopAnimation=bh.prototype.nc; +var Kh=null,ch=!1,eh=new D(bh,"Default",1),kh=new D(bh,"AnimateLocations",2),jh=new D(bh,"None",3);bh.className="AnimationManager";bh.defineAnimationEffect=function(a,b){ch||(dh(),ch=!0);Kh.add(a,b)};bh.Default=eh;bh.AnimateLocations=kh;bh.None=jh; +function fh(a){this.Uu=this.qx=this.Ld=this.F=null;this.ol=this.hc=this.j=!1;this.In=this.zd=0;this.ar=this.Kt=Lh;this.nl=this.jp=!1;this.Bu=1;this.zu=0;this.sd=this.Fg=NaN;this.Hw=0;this.Jn=null;this.o=pb;this.jc=new I;this.ru=new I;this.Zl=new G;this.su=new G;this.Ew=Mh;a&&Object.assign(this,a)}fh.prototype.suspend=function(){this.ol=!0};fh.prototype.advanceTo=function(a,b){b&&(this.ol=!1);this.jp&&a>=this.sd&&(this.nl=!0,a-=this.sd);this.Hw=a;Eh(this,!0);oh(this.Ld);rf(this.F);Ah(this.Ld);this.F.redraw()}; +function lh(a,b){a.ru.clear();a.nl=!1;a.zu=0;a.sd=NaN;0a.In?a.sd:d-a.zd;b&&(e=a.Hw,ea.In&&(a.jp&&!a.nl?(a.zd=+new Date,a.In=a.zd+a.sd,a.nl=!0):a.gm(!1))}}} +function zh(a,b){for(var c=a.sd,d=a.jc.iterator,e=a.nl;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=Kh,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:nodeCollapse"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.ar,b,c,a)}}}t.stop=function(){if(!this.hc)return this;this.gm(!0);return this}; +t.gm=function(a){null!==this.Uu&&this.Uu.qp.remove(this.qx);if(this.hc){var b=this.F,c=this.Ld;this.ol=this.hc=c.gl=!1;oh(c);for(var d=this.jc,e=this.Zl.iterator;e.next();)b.remove(e.value);for(e=this.su.iterator;e.next();)e.value.s();e=this.jp;d=d.iterator;for(var f=Kh;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.nv,n;for(n in l)if(null!==f.get(n)){var p=n;!h.hv||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: +h.hv?k[n]:l[n],this.ar,this.sd,this.sd,this)}h.hv&&void 0!==m.location&&g instanceof V&&(g.location=m.location);h.Pv&&g instanceof V&&g.Nb(!1)}b.Ts.clear();Te(b,!1);b.Pa();b.N();rf(b,!0);if(c.defaultAnimation===this){for(n=c.Il.iterator;n.next();)e=n.value,null!==e.cf&&(e.points=e.cf,e.cf=null);c.Il.clear()}this.isViewportUnconstrained&&(b.scrollMode=this.Ew);Ah(c);this.zu++;!a&&this.Bu>this.zu?(this.nl=!1,this.start()):(this.Jn&&this.Jn(this),lh(this,null),c.gm(this),b.Fb())}}; +t.Yj=function(a,b){var c=b.actualBounds,d=null;b instanceof hf&&(d=b.placeholder);null!==d?(c=d.da(sc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new J(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof hf)for(a=a.memberParts;a.next();)d=a.value,d instanceof W&&this.Yj(d,b)}; +t.Wj=function(a,b){if(a.isVisible()){var c=null;b instanceof hf&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.jc;c.contains(a)&&(c.H(a).Pv=!0);if(a instanceof hf)for(a=a.memberParts;a.next();)c=a.value,c instanceof W&&this.Wj(c,b)}};t.iA=function(a){var b=this.ru.get(a);null===b&&(b={},this.ru.add(a,b));return b}; +na.Object.defineProperties(fh.prototype,{duration:{get:function(){return this.Fg},set:function(a){1>a&&xa(a,">= 1",fh,"duration");this.Fg=a}},reversible:{get:function(){return this.jp},set:function(a){this.jp=a}},runCount:{get:function(){return this.Bu},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Nh(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}fh.className="Animation";fh.EaseLinear=function(a,b,c,d){return c*a/d+b};fh.EaseInOutQuad=Lh;fh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};fh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};fh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};fh.EaseOutExpo=Nh; +function Th(a,b,c){this.start=a;this.end=b;this.nv={};this.hv=c;this.Pv=!1}Th.className="AnimationState";function Uh(a,b,c){this.md=null;this.bf=a;this.Hp=c||Vh;this.Ik=null;void 0!==b&&(this.Ik=b,void 0===c&&(this.Hp=Wh))}Uh.prototype.copy=function(){var a=new Uh(this.bf);a.Hp=this.Hp;var b=this.Ik;if(null!==b){var c={};void 0!==b.duration&&(c.duration=b.duration);void 0!==b.finished&&(c.finished=b.finished);void 0!==b.easing&&(c.easing=b.easing);a.Ik=c}return a}; +function Xh(a,b){a=a.Ik;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))}na.Object.defineProperties(Uh.prototype,{propertyName:{get:function(){return this.bf},set:function(a){this.bf=a}},animationSettings:{get:function(){return this.Ik},set:function(a){this.Ik=a}},startCondition:{get:function(){return this.Hp},set:function(a){this.Hp=a}}}); +var Vh=new D(Uh,"Default",1),Wh=new D(Uh,"Immediate",2),Yh=new D(Uh,"Bundled",3);Uh.className="AnimationTrigger";Uh.Default=Vh;Uh.Immediate=Wh;Uh.Bundled=Yh;function Zh(a){Ta(this);this.F=null;this.Fa=new E;this.na="";this.lb=1;this.o=!1;this.j=this.oi=this.C=this.jj=this.ij=this.hj=this.gj=this.ej=this.fj=this.dj=this.lj=this.cj=this.kj=this.bj=this.aj=!0;this.Vo=[];a&&Object.assign(this,a)}t=Zh.prototype;t.clear=function(){this.Fa.clear();this.Vo.length=0};t.Ke=function(a){this.F=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.Fa.iterator;h.next();){var k=h.value;k instanceof hf?e++:k instanceof W?d++:k instanceof U?f++:k instanceof we?g++:c++}h="";0c.Jr||h.height*e>c.Jr?b.lc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width||0===e.height||isNaN(e.x)|| +isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(bi(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(bi(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),bi(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.Os()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21*b,c.m11*b,b*(c.m21*c.dy-c.m22* +c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.Ec(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.Va(ce,a,this,b,c,d,e)};t.Oi=function(a,b,c){var d=this.Fa;b.ei=this;if(a>=d.count)a=d.count;else if(d.J(a)===b)return-1;d.ub(a,b);b.pq(c);d=this.diagram;null!==d&&(c?d.N():d.Oi(b));ci(this,a,b);return a}; +t.bc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.bc(a,b,c);var d=this.Fa;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.J(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.qq(c);d.eb(a);d=this.diagram;null!==d&&(c?d.N():d.bc(b));b.ei=null;return a}; +function ci(a,b,c){b=di(a,b,c);if(c instanceof hf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Fa.m,f=e.length,g=0;gd&&h.containingGroup===c&&(d=g,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,g=NaN;0<=f;){g=a.J(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;hd)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.eb(b);a.ub(f,c);return f}for(g=NaN;0<=--f&&(g=a.J(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.eb(b);a.ub(h,c);return h}for(k=NaN;++h< +e&&(k=a.J(h).zOrder,isNaN(k)););}return b} +na.Object.defineProperties(Zh.prototype,{parts:{get:function(){return this.Fa.iterator}},partsBackwards:{get:function(){return this.Fa.iteratorBackwards}},diagram:{get:function(){return this.F}},name:{get:function(){return this.na},set:function(a){var b=this.na;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&C("Cannot rename default Layer to: "+a),c=c.layers;c.next();)c.value.name=== +a&&C("Layer.name is already present in this diagram: "+a);this.na=a;this.g("name",b,a);for(a=this.Fa.iterator;a.next();)a.value.layerName=this.na}}},opacity:{get:function(){return this.lb},set:function(a){var b=this.lb;b!==a&&((0>a||1=a)return b;for(var c=this.Na.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};T.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})}; +T.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; +function Li(a){var b=a.Aa.La;b instanceof HTMLCanvasElement&&(a.addEventListener(b,"pointerdown",a.wk,!1),a.addEventListener(b,"pointermove",a.xk,!1),a.addEventListener(b,"pointerup",a.zk,!1),a.addEventListener(b,"pointerout",a.yk,!1),a.addEventListener(b,"pointerenter",a.Gz,!1),a.addEventListener(b,"pointerleave",a.Hz,!1),a.addEventListener(b,"wheel",a.tk,!1),a.addEventListener(b,"keydown",a.uA,!1),a.addEventListener(b,"keyup",a.vA,!1),a.addEventListener(b,"blur",a.rz,!1),a.addEventListener(b,"focus", +a.sz,!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(x,"resize",a.lw,!1),Sa&&a.addEventListener(b,"touchstart",function(a){a.preventDefault()},!1))}function Ke(a){30q&&(this.position=v.h(-(b.scrollWidth-this.ua)+w-this.ua/e+m,this.position.y))),a.$y&&this.allowVerticalScroll&&(hu&&(this.position= +v.h(this.position.x,-(b.scrollHeight-this.ta)+a.scrollTop-this.ta/e+f))),J.free(v),Qi(this),this.wj=this.$r=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,q=e.right,f=d.bottom,u=e.bottom,g=d.x,n=e.x,h=d.y,d=e.y,p>=k&&g>=n&&m<=q&&(c.style.width="1px"),r>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};T.prototype.computeBounds=function(a){void 0===a&&(a=new N);hh(this);return Ri(this,a)}; +function Ri(a,b){if(a.fixedBounds.u())return b.assign(a.fixedBounds),b.Xp(a.mb),b;for(var c=!0,d=a.Na.m,e=d.length,f=0;fc&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===Yi?(b=k>h?(g-a.sb)/d:(f-a.sb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} +T.prototype.zoomToFit=function(){var a=this.Sj;this.Sj=Mh;this.scale=Ti(this,Xi);a!==Mh&&(Si(this,!1),Ui(this,this.documentBounds,this.ua/this.sa,this.ta/this.sa,this.Qk,!1));this.Sj=a};t=T.prototype; +t.gB=function(a,b){void 0===b&&(b=Xi);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Xi||b===Yi)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.ua;var f=this.ta;e=b===Yi?f/d>e/c?(f-(this.Ue?this.sb:0))/d:(e-(this.Of?this.sb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new J(a.x,a.y)}}; +t.lz=function(a,b){this.Sa();var c=this.documentBounds,d=this.viewportBounds;this.position=new J(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))};t.dA=function(a){if(a instanceof Y){this.rr=a;var b=J.alloc();this.sr=this.Iq(a.da(sc,b));J.free(b)}else this.rr=null,this.sr=vb}; +function Ui(a,b,c,d,e,f){var g=J.allocAt(a.ka.x,a.ka.y),h=g.x,k=g.y;if(null!==a.rr){var l=J.alloc();l=a.rr.da(sc,l);h=l.x-a.sr.x/a.scale;k=l.y-a.sr.y/a.scale;e=rc;J.free(l)}if(f||a.scrollMode===Mh)e.hb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.Rj,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb.targetTouches.length)return;b=b.targetTouches[c]}else if(null!==a.El[0])b=a.El[c];else return;c=a.Aa;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.ua/c.width*c.left,b.clientY-a.ta/c.height*c.top))}T.prototype.Pa=function(){this.vj||(this.vj=!0,this.Fb(!0))};function gj(a){a.Vc||hh(a);a.Sa()}T.prototype.redraw=function(){this.ob||this.Vc||(this.N(),Vi(this),this.ed())};t=T.prototype;t.tA=function(){return this.eg}; +t.Bz=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.nc();b.isEnabled=!1;rf(this);this.Qf=!1;this.Cu=new J(NaN,NaN);b.isEnabled=c;this.Vc=!0;var d=this;null!==a&&ua(function(){d.Vc=!1;gh(b,"Model");a(d)},1)};t.Fb=function(a){void 0===a&&(a=!1);if(!0!==this.eg&&!(this.ob||!1===a&&this.Vc)){this.eg=!0;var b=this;x.requestAnimationFrame(function(){b.eg&&b.ed()})}};t.ed=function(){if(!this.Ln||this.eg)this.Ln&&(this.Ln=!1),rf(this)}; +function Wi(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.ob||!a.wj||Oi(a)||(b&&hh(a),c&&Si(a,!1))} +function rf(a,b){if(!a.Vc&&(a.eg=!1,null!==a.Ea||a.Rp.u())){a.Vc=!0;var c=a.animationManager,d=a.$o;if(!c.isAnimating&&0!==d.length){for(var e=d.m,f=e.length,g=0;gb;b++){var c=a.qe.iterator;if(null===c||0===a.qe.count)break;a.qe=new G;a.kw(c,a.qe)}a.nodes.each(function(a){a instanceof hf&&0!==(a.R&65536)!==!1&&(a.R=a.R^65536)})}} +t.kw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Jc()||c instanceof hf||(c.Si()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof hf&&c.isVisible()&&lj(this,c);for(a.reset();a.next();)c=a.value,c instanceof U&&c.isVisible()&&(c.Si()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof we&&c.isVisible()&&(c.Si()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; +function lj(a,b){for(var c=Fa(),d=Fa(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof hf?(mj(f)||nj(f)||oj(f))&&lj(a,f):f instanceof U?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;en&&(z=K.left,y= +K.right),w.height>F&&(A=K.top,B=K.bottom)):(z=K.left,y=K.right,A=K.top,B=K.bottom);K=w.width+z+y;var S=w.height+A+B;z=w.x-z;var R=e.x;y=w.right+y;var O=e.right+r;A=w.y-A;var H=e.y;w=w.bottom+B;B=e.bottom+q;var da="1px",ba="1px";e=a.scale;u=K>u/e;v=S>v/e;a.scrollMode===Mh&&(u||v)&&(u&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(u=1,z+1O+1&&(u=Math.max((y-O)*e+a.ua,u)),n+r+1B+1&&(u=Math.max((w-B)*e+a.ta,u)),F+q+1O+1&&(r=Math.max((y-O)*e+a.ua,r)),n+1B+1&&(q=Math.max((w-B)*e+r,q)),F+1O+1&&(b=a.position.x*e));if(a.io)switch(a.Au){case "negative":b=-(l.scrollWidth-b-l.clientWidth);break;case "reverse":b=l.scrollWidth-b-l.clientWidth}l.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(F+1B+1&&(l.scrollTop=a.position.y*e));u=a.ua;v=a.ta;l.style.width=u+(a.Of?a.sb:0)+"px";l.style.height=v+(a.Ue?a.sb:0)+"px";return c!==u||d!==v||a.animationManager.rb?(c=N.allocAt(f,g,h,k),a.onViewportBoundsChanged(c,a.viewportBounds,e,p),N.free(c),!1):!0}t=T.prototype; +t.add=function(a){var b=a.diagram;if(b!==this&&(null!==b&&C("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.ik(a.layerName),null===b&&(b=this.ik("")),null===b&&C('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.Oi(99999999,a,a.diagram===this);0<=c&&this.Va(ee,"parts",b,null,a,null,c);b.isTemporary||this.Pa();a.B(1);c=a.layerChanged;null!==c&&c(a,null,b)}}; +t.Oi=function(a){this.partManager.Oi(a);var b=this;zj(a,function(a){Aj(b,a)});(a instanceof we||a instanceof hf&&null!==a.placeholder)&&a.s();null!==a.data&&zj(a,function(a){Bj(b.partManager,a)});!0!==nj(a)&&!0!==oj(a)||this.qe.add(a);Cj(a,!0,this);Dj(a)?(a.actualBounds.u()&&this.N(xj(a,a.actualBounds)),this.Pa()):a.isVisible()&&a.actualBounds.u()&&this.N(xj(a,a.actualBounds));this.Fb()}; +t.bc=function(a){a.$j();this.partManager.bc(a);var b=this;null!==a.data&&zj(a,function(a){Ej(b.partManager,a,b)});this.qe.remove(a);Dj(a)?(a.actualBounds.u()&&this.N(xj(a,a.actualBounds)),this.Pa()):a.isVisible()&&a.actualBounds.u()&&this.N(xj(a,a.actualBounds));this.Fb()};t.remove=function(a){Fj(this,a,!0)}; +function Fj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.B(2),c&&b.fk(),c=d.bc(-1,b,!1),0<=c&&a.Va(fe,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.bt=function(a,b){void 0===b&&(b=!1);if(Aa(a))for(var c=a.length,d=0;dd&&this.Pa();return this}; +t.fz=function(a,b){Lj(this,a,b);a.Ke(this);var c=this.Na,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Tb&&this.Va(fe,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Pa();return this}; +t.NA=function(a){a.diagram!==this&&C("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Na,c=b.indexOf(a);if(b.remove(a)){for(b=a.Fa.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.Tb&&this.Va(fe,"layers",this,a,null,c,null);this.N();this.Pa()}}};t.ik=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; +t.Bx=function(a){null===this.$e&&(this.$e=new E);this.$e.add(a);this.model.uh(a);return this};t.PA=function(a){null!==this.$e&&(this.$e.remove(a),0===this.$e.count&&(this.$e=null));this.model.Bk(a)};t.uh=function(a){null===this.ug&&(this.ug=new E);this.ug.add(a);return this};t.Bk=function(a){null!==this.ug&&(this.ug.remove(a),0===this.ug.count&&(this.ug=null))}; +t.ws=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.yv(a);a.change!==de&&(this.isModified=!0);if(null!==this.ug)for(var b=this.ug,c=b.length,d=0;dn.Fa.indexOf(r)&&n.Oi(p,r,q):(r.isSelected=!1,r.isHighlighted=!1,r.Kb(),n.bc(q?p:-1,r,q)))}else n instanceof T?"number"===typeof p&&r instanceof Zh&&(b?(r.Ke(this),this.Na.ub(p,r)):this.Na.eb(p)):C("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==de&&C("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= +c}}};T.prototype.wa=function(a){return this.undoManager.wa(a)};T.prototype.Xa=function(a){return this.undoManager.Xa(a)};T.prototype.Df=function(){return this.undoManager.Df()};T.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.wa(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.Xa(b):this.undoManager.Df(),this.skipsUndoManager=c}};T.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; +T.prototype.Lq=function(){this.partManager.Lq()}; +function Qj(a,b,c){var d=a.animationManager;if(a.ob||a.Vc)a.sa=c,Ji(a),d.rb&&(Bh(d)||d.Pd.add(d.F,"scale",b,a.sa));else if(null===a.Aa)a.sa=c,Ji(a);else{a.ob=!0;var e=a.viewportBounds.copy(),f=a.ua,g=a.ta;e.width=a.ua/b;e.height=a.ta/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.Kc()?l.zf(Fc)?h=0:l.zf(Gc)&&(h=f-1):h=l.hb()?l.x*(f-1):f/2);isNaN(k)&&(l.Kc()?l.zf(Dc)?k=0:l.zf(Hc)&&(k=g-1):k=l.hb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating|| +(c=a.scaleComputation(a,c));ca.maxScale&&(c=a.maxScale);f=J.allocAt(a.ka.x+h/b-h/c,a.ka.y+k/b-k/c);a.position=f;J.free(f);a.sa=c;Ji(a);a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);a.ob=!1;Si(a,!1);d.rb&&(Bh(d)||d.Pd.add(d.F,"scale",b,a.sa));a.N();Vi(a)}} +T.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.A(b)){void 0===d&&(d=!1);d||Vi(this);Qi(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==mh||d||a.width===b.width&&a.height===b.height||e.B();e=this.currentTool;!0===this.ml&&e instanceof Oa&&(this.lastInput.documentPoint=this.kt(this.lastInput.viewPoint),Ae(e,this));this.ob||this.invalidateViewport(a,b);ij(this);this.bd.scale=c;this.bd.position.x=a.x;this.bd.position.y=a.y;this.bd.bounds.assign(a);this.bd.Gx.width= +Math.round(a.width*c);this.bd.Gx.height=Math.round(a.height*c);this.bd.qy.width=this.ua;this.bd.qy.height=this.ta;this.bd.ky=d;this.S("ViewportBoundsChanged",this.bd,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Ic(b)&&a.Ua()})}}; +function ij(a,b){var c=a.Vd;if(null!==c&&c.visible){for(var d=M.alloc(),e=1,f=1,g=c.T.m,h=g.length,k=0;km||(Rj(l.figure)?f=f*m/L.Wx(f,m):e=e*m/L.Wx(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(void 0!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=N.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.u()){N.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;N.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=J.alloc();L.jq(a,g,0,0,d.width,d.height, +b);b.offset(-d.width,-d.height);M.free(d);c.part.location=b;J.free(b)}}T.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.S("ChangingSelection",b);for(var c=b.xa(),d=c.length,e=0;e=d&&!f.defaultAnimation.isAnimating&&!f.rb&&(b||gh(f,"Layout"));a.Nh=!1;for(var g=a.xi.iterator;g.next();)ak(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),hh(a),e.isValidLayout=!0):a.Nh=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.Xa("Layout"),a.undoManager.isInternalTransaction= +!1),!b||0!==d&&1!==d||ih(f),a.Z=c}}}function ak(a,b,c,d){if(null!==b){for(var e=b.zl.iterator;e.next();)ak(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.Fh=!b.location.u(),e.doLayout(b),b.B(32),lj(a,b),e.isValidLayout=!0):a.Nh=!0)}}t.cA=function(){for(var a=new E,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.Ji()&&a.add(c)}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 I,d=new I;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.Jw=c;a.Iw=d} +function uj(a,b){var c=a.Iw.H(b);return null!==c?c:a.Iw.H(b.toLowerCase())}function jk(a,b){var c=a.Jw.H(b);if(null!==c)return c;c=a.Jw.H(b.toLowerCase());if(null!==c)return c;C("Unknown DiagramEvent name: "+b)}t.Xj=function(a,b){a=jk(this,a);null!==a&&a.add(b);return this};t.um=function(a,b){a=jk(this,a);null!==a&&a.remove(b)}; +t.S=function(a,b,c){var d=jk(this,a),e=new ae;e.diagram=this;a=uj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!==c&&(e.parameter=c);b=d.length;if(1===b)d.J(0)(e);else if(0!==b)for(d=d.xa(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=N.allocAt(0,0,d.width*e,d.height*e);var f=J.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&this.allowHorizontalScroll&&(g=Math.max(this.scrollHorizontalLineChange, +1),g|=0,f.x+=g,a.x>d.x+d.width-c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.yd.y+d.height-c.bottom&&this.allowVerticalScroll&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.Ta(pb)||(b=new J(b.x+f.x/e,b.y+f.y/e)); +N.free(d);J.free(f);return b};t=T.prototype;t.Vs=function(){return null};t.Gv=function(){return null};t.jz=function(a,b){this.Xy.add(a,b)};t.ev=function(a){(this.tx=a)||this.nodes.each(function(a){a instanceof hf&&(a.mr=null)})}; +function xk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].ul){f=!1;break}f||a-l>k?b(c,e,h):x.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.$g.iterator;g.next();)if(!g.value[0].ul){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;x.requestAnimationFrame(function(){d()});return null}t.zA=function(a){if(!Jg)return null;void 0===a&&(a={});a.returnType="Image";return this.ny(a)}; +t.ny=function(a){void 0===a&&(a={});return xk(this,this.AA,a)}; +t.AA=function(a,b,c){var d=yk(c,a,"canvas",null);if(null===d)return null;c=d.Y.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case zk+"data":e=d.getImageData(0,0,c.width,c.height);break;case zk:d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&C('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 yk(a,b,c,d){a.animationManager.nc();a.ed();if(null===a.Aa)return null;"object"!==typeof b&&C("properties argument must be an Object.");var e=b.size||null,f=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(f="NaN");var g=b.maxSize;void 0===b.maxSize&&(g="SVG"===c?new M(Infinity,Infinity):new M(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,r=b.elementFinished||null,q=b.showTemporary; +void 0===q&&(q=!n);b=b.showGrid;void 0===b&&(b=q);null!==e&&isNaN(e.width)&&isNaN(e.height)&&(e=null);"number"===typeof l?l=new ic(l):l instanceof ic||C("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.Sb.Ec(!0);n=new Ak(null,p);var u=n.context;if(!(e||f||k||h)){n.width=a.ua+Math.ceil(l.left+l.right);n.height=a.ta+Math.ceil(l.top+l.bottom);if("SVG"===c){if(null===d)return null;d.resize(n.width, +n.height,n.width,n.height);d.ownerDocument=p;d.gq=r;sj(a,d.context,l,new M(n.width,n.height),a.sa,a.ka,k,m,q,b);return d.context}a.Bn=!1;sj(a,u,l,new M(n.width,n.height),a.sa,a.ka,k,m,q,b);a.Bn=!0;return n.context}var v=a.er,w=a.documentBounds.copy();w.cw(a.mb);if(q)for(var z=a.Na.m,y=z.length,A=0;Av?(f=v,e=w.width,w=w.height):(e=g.width,w=g.height)):(e=w.width*f,w=w.height*f):(f=v,e=w.width,w=w.height);null!==l?(e+=h,w+=y):l=new ic(0);null!==g&&(v=g.width,g=g.height,isNaN(v)&&(v=2E3),isNaN(g)&&(g=2E3),isFinite(v)&&(e=Math.min(e, +v)),isFinite(g)&&(w=Math.min(w,g)));n.width=Math.ceil(e);n.height=Math.ceil(w);if("SVG"===c){if(null===d)return null;d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.gq=r;sj(a,d.context,l,new M(Math.ceil(e),Math.ceil(w)),f,z,k,m,q,b);return d.context}a.Bn=!1;sj(a,u,l,new M(Math.ceil(e),Math.ceil(w)),f,z,k,m,q,b);a.Bn=!0;return n.context} +na.Object.defineProperties(T.prototype,{div:{get:function(){return this.Ea},set:function(a){if(this.Ea!==a){var b=this.Ea;null!==b?(b.F=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.Aa&&(b=this.Aa.La,this.removeEventListener(b,"pointermove",this.xk,!1),this.removeEventListener(b,"pointerdown",this.wk,!1),this.removeEventListener(b,"pointerup",this.zk,!1),this.removeEventListener(b,"pointerout",this.yk,!1),this.Aa.Ox()),this.Hl&&(this.Hl.disconnect(), +this.Hl=null),b=this.toolManager,null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}),b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}),b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(),this.currentTool.doCancel(),this.Aa=null,this.removeEventListener(x,"resize",this.lw,!1),this.removeEventListener(x,"wheel",this.tk,!0),se===this&&(se=null)):this.Qf=!1;this.Ea=null;if(null!==a){if(b=a.F)b.div=null;ni(this,a);this.redraw()}}}},Ex:{ +get:function(){return this.Mr}},Pi:{get:function(){return this.Qf}},draggedLink:{get:function(){return this.It},set:function(a){this.It!==a&&(this.It=a,null!==a&&(this.tu=a.fromPort,this.uu=a.toPort))}},sy:{get:function(){return this.tu},set:function(a){this.tu=a}},ty:{get:function(){return this.uu},set:function(a){this.uu=a}},animationManager:{get:function(){return this.Ld}}, +undoManager:{get:function(){return this.Tb.undoManager}},skipsUndoManager:{get:function(){return this.gh},set:function(a){this.gh=a;this.Tb.skipsUndoManager=a}},delaysLayout:{get:function(){return this.Gt},set:function(a){this.Gt=a}},opacity:{get:function(){return this.lb},set:function(a){var b=this.lb;b!==a&&((0>a||1a&&xa(a,">= 0",T,"scrollHorizontalLineChange"),this.Hu=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{get:function(){return this.Lu},set:function(a){var b=this.Lu;b!==a&&(0>a&&xa(a,">= 0",T,"scrollVerticalLineChange"),this.Lu=a,this.g("scrollVerticalLineChange", +b,a))}},lastInput:{get:function(){return this.Dj},set:function(a){this.Dj=a}},previousInput:{get:function(){return this.bh},set:function(a){this.bh=a}},firstInput:{get:function(){return this.pr},set:function(a){this.pr=a}},currentCursor:{get:function(){return this.Dt},set:function(a){""===a&&(a=this.dr);if(this.Dt!==a){var b=this.Aa,c=this.Ea;if(null!==b&&null!==c){this.Dt=a;var d= +b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor=a)))}}}},defaultCursor:{get:function(){return this.dr},set:function(a){""===a&&(a="auto");var b=this.dr;b!==a&&(this.dr=a,this.g("defaultCursor",b,a))}},click:{get:function(){return this.vg}, +set:function(a){var b=this.vg;b!==a&&(this.vg=a,this.g("click",b,a))}},doubleClick:{get:function(){return this.Dg},set:function(a){var b=this.Dg;b!==a&&(this.Dg=a,this.g("doubleClick",b,a))}},contextClick:{get:function(){return this.xg},set:function(a){var b=this.xg;b!==a&&(this.xg=a,this.g("contextClick",b,a))}},mouseOver:{get:function(){return this.Wg},set:function(a){var b=this.Wg;b!==a&&(this.Wg=a,this.g("mouseOver", +b,a))}},mouseHover:{get:function(){return this.Ug},set:function(a){var b=this.Ug;b!==a&&(this.Ug=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return this.Tg},set:function(a){var b=this.Tg;b!==a&&(this.Tg=a,this.g("mouseHold",b,a))}},mouseDragOver:{get:function(){return this.ou},set:function(a){var b=this.ou;b!==a&&(this.ou=a,this.g("mouseDragOver",b,a))}},mouseDrop:{get:function(){return this.Rg}, +set:function(a){var b=this.Rg;b!==a&&(this.Rg=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.Tt},set:function(a){var b=this.Tt;b!==a&&(this.Tt=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{get:function(){return this.Sg},set:function(a){var b=this.Sg;b!==a&&(this.Sg=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return this.Vg},set:function(a){var b= +this.Vg;b!==a&&(this.Vg=a,this.g("mouseLeave",b,a))}},toolTip:{get:function(){return this.qh},set:function(a){var b=this.qh;b!==a&&(this.qh=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return this.yg},set:function(a){var b=this.yg;b!==a&&(this.yg=a,this.g("contextMenu",b,a))}},commandHandler:{get:function(){return this.Oc},set:function(a){this.Oc!==a&&(this.Oc=a,a.Ke(this))}},toolManager:{ +get:function(){return this.Zi},set:function(a){this.Zi!==a&&(this.Zi=a,a.diagram=this)}},defaultTool:{get:function(){return this.Pc},set:function(a){var b=this.Pc;b!==a&&(this.Pc=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{get:function(){return this.yc},set:function(a){var b=this.yc;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(this.yc= +a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.kx}},maxSelectionCount:{get:function(){return this.ju},set:function(a){var b=this.ju;if(b!==a)if(0<=a&&!isNaN(a)){if(this.ju=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",T,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.qu},set:function(a){var b=this.qu;b!==a&&(this.qu=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var b=this.St;b!==a&&(this.St=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.gu}, +set:function(a){var b=this.gu;b!==a&&(this.gu=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{get:function(){return this.Pw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.fo&&this.pe!==a.historyIndex:this.fo},set:function(a){if(this.fo!==a){this.fo=a;var b=this.undoManager;!a&&b.isEnabled&&(this.pe=b.historyIndex);a||Sj(this)}}},model:{ +get:function(){return this.Tb},set:function(a){var b=this.Tb;if(b!==a){this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&C("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.nc(!0);var c=Hi(this,!0);this.Qf=!1;this.Ln=!0;this.pe=-2;this.eg=!1;var d=this.ob;this.ob=!0;gh(this.animationManager,"Model");b&&(null!==this.$e&&this.$e.each(function(a){b.Bk(a)}),b.Bk(this.Ih));this.Tb=a;this.partManager=Tj(this.Tb.type);for(var e= +0;ethis.scale&&(this.scale=a)):xa(a,"> 0",T,"minScale"))}},maxScale:{get:function(){return this.iu},set:function(a){var b=this.iu;b!==a&&(0 0",T,"maxScale"))}},zoomPoint:{get:function(){return this.Yu},set:function(a){this.Yu.A(a)||(this.Yu=a=a.I())}},contentAlignment:{get:function(){return this.Qk}, +set:function(a){var b=this.Qk;b.A(a)||(this.Qk=a=a.I(),this.g("contentAlignment",b,a),Si(this,!1))}},initialContentAlignment:{get:function(){return this.vr},set:function(a){var b=this.vr;b.A(a)||(this.vr=a=a.I(),this.g("initialContentAlignment",b,a))}},padding:{get:function(){return this.mb},set:function(a){"number"===typeof a&&(a=new ic(a));var b=this.mb;b.A(a)||(this.mb=a=a.I(),this.Pa(),this.g("padding",b,a))}},partManager:{ +get:function(){return this.Jh},set:function(a){var b=this.Jh;b!==a&&(null!==a.diagram&&C("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.Ke(null),this.Jh=a,a.Ke(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{ +get:function(){return this.Ac},set:function(a){var b=this.Ac;b!==a&&(this.Ac=a,a.diagram=this,a.group=null,this.Nh=!0,this.g("layout",b,a),this.Fb())}},isTreePathToChildren:{get:function(){return this.du},set:function(a){var b=this.du;if(b!==a&&(this.du=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Bk(a.value)}},treeCollapsePolicy:{get:function(){return this.Tu},set:function(a){var b= +this.Tu;b!==a&&(a!==qi&&a!==Ck&&a!==Dk&&C("Unknown Diagram.treeCollapsePolicy: "+a),this.Tu=a,this.g("treeCollapsePolicy",b,a))}},He:{get:function(){return this.Rw},set:function(a){this.Rw=a}},avoidanceCellSize:{get:function(){return this.Bw},set:function(a){this.si=null;this.Bw=new M(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.Cw},set:function(a){this.Cw=Math.max(1, +a)}},autoScrollInterval:{get:function(){return this.Oq},set:function(a){var b=this.Oq;b!==a&&(this.Oq=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{get:function(){return this.Qq},set:function(a){"number"===typeof a&&(a=new ic(a));var b=this.Qq;b.A(a)||(this.Qq=a=a.I(),this.Pa(),this.g("autoScrollRegion",b,a))}}}); +na.Object.defineProperties(T,{licenseKey:{get:function(){return Ek.Xb()},set:function(a){Ek.add(a.replace(/\s/g,""))}},version:{get:function(){return Fk}}});T.prototype.makeImageData=T.prototype.ny;T.prototype.makeImage=T.prototype.zA;T.prototype.cacheGroupExternalLinks=T.prototype.ev;T.prototype.addRenderer=T.prototype.jz;T.prototype.makeSVG=T.prototype.Gv;T.prototype.makeSvg=T.prototype.Vs;T.prototype.stopAutoScroll=T.prototype.og; +T.prototype.doAutoScroll=T.prototype.zs;T.prototype.isUnoccupied=T.prototype.qk;T.prototype.raiseDiagramEvent=T.prototype.S;T.prototype.removeDiagramListener=T.prototype.um;T.prototype.addDiagramListener=T.prototype.Xj;T.prototype.findTreeRoots=T.prototype.cA;T.prototype.layoutDiagram=T.prototype.xA;T.prototype.findTopLevelGroups=T.prototype.Wz;T.prototype.findTopLevelNodesAndLinks=T.prototype.Xz;T.prototype.ensureBounds=T.prototype.Sa;T.prototype.findLinksByExample=T.prototype.Cs; +T.prototype.findNodesByExample=T.prototype.Ds;T.prototype.findLinkForData=T.prototype.uc;T.prototype.findNodeForData=T.prototype.Hi;T.prototype.findPartForData=T.prototype.vc;T.prototype.findLinkForKey=T.prototype.findLinkForKey;T.prototype.findNodeForKey=T.prototype.Eb;T.prototype.findPartForKey=T.prototype.findPartForKey;T.prototype.rebuildParts=T.prototype.Hd;T.prototype.transformViewToDoc=T.prototype.kt;T.prototype.transformRectDocToView=T.prototype.cB;T.prototype.transformDocToView=T.prototype.Iq; +T.prototype.centerRect=T.prototype.xs;T.prototype.scrollToRect=T.prototype.Vv;T.prototype.scroll=T.prototype.scroll;T.prototype.highlightCollection=T.prototype.oA;T.prototype.highlight=T.prototype.nA;T.prototype.selectCollection=T.prototype.UA;T.prototype.select=T.prototype.select;T.prototype.updateAllRelationshipsFromData=T.prototype.Lq;T.prototype.updateAllTargetBindings=T.prototype.updateAllTargetBindings;T.prototype.commit=T.prototype.commit;T.prototype.rollbackTransaction=T.prototype.Df; +T.prototype.commitTransaction=T.prototype.Xa;T.prototype.startTransaction=T.prototype.wa;T.prototype.raiseChanged=T.prototype.g;T.prototype.raiseChangedEvent=T.prototype.Va;T.prototype.removeChangedListener=T.prototype.Bk;T.prototype.addChangedListener=T.prototype.uh;T.prototype.removeModelChangedListener=T.prototype.PA;T.prototype.addModelChangedListener=T.prototype.Bx;T.prototype.findLayer=T.prototype.ik;T.prototype.removeLayer=T.prototype.NA;T.prototype.addLayerAfter=T.prototype.fz; +T.prototype.addLayerBefore=T.prototype.zx;T.prototype.addLayer=T.prototype.bm;T.prototype.moveParts=T.prototype.moveParts;T.prototype.copyParts=T.prototype.ek;T.prototype.removeParts=T.prototype.bt;T.prototype.remove=T.prototype.remove;T.prototype.add=T.prototype.add;T.prototype.clearDelayedGeometries=T.prototype.fv;T.prototype.setProperties=T.prototype.Hm;T.prototype.attach=T.prototype.dv;T.prototype.set=T.prototype.set;T.prototype.resetInputOptions=T.prototype.yy;T.prototype.setInputOption=T.prototype.VA; +T.prototype.getInputOption=T.prototype.km;T.prototype.resetRenderingHints=T.prototype.zy;T.prototype.setRenderingHint=T.prototype.Dy;T.prototype.getRenderingHint=T.prototype.Fe;T.prototype.maybeUpdate=T.prototype.ed;T.prototype.requestUpdate=T.prototype.Fb;T.prototype.delayInitialization=T.prototype.Bz;T.prototype.isUpdateRequested=T.prototype.tA;T.prototype.invalidateDocumentBounds=T.prototype.Pa;T.prototype.findObjectsNear=T.prototype.kg;T.prototype.findPartsNear=T.prototype.Sz; +T.prototype.findObjectsIn=T.prototype.vf;T.prototype.findPartsIn=T.prototype.Vx;T.prototype.findObjectsAt=T.prototype.Ii;T.prototype.findPartsAt=T.prototype.Rz;T.prototype.findObjectAt=T.prototype.Wb;T.prototype.findPartAt=T.prototype.im;T.prototype.focusObject=T.prototype.dA;T.prototype.alignDocument=T.prototype.lz;T.prototype.zoomToRect=T.prototype.gB;T.prototype.zoomToFit=T.prototype.zoomToFit;T.prototype.diagramScroll=T.prototype.Mx;T.prototype.focus=T.prototype.focus; +var gi=new I,Ki=null,Jg=void 0!==x.document,Ei=null,Gi="",mh=new D(T,"None",0),Xi=new D(T,"Uniform",1),Yi=new D(T,"UniformToFill",2),wf=new D(T,"CycleAll",10),Kf=new D(T,"CycleNotDirected",11),Mf=new D(T,"CycleNotDirectedFast",12),Nf=new D(T,"CycleNotUndirected",13),Hf=new D(T,"CycleDestinationTree",14),Jf=new D(T,"CycleSourceTree",15),Mh=new D(T,"DocumentScroll",1),Oh=new D(T,"InfiniteScroll",2),qi=new D(T,"TreeParentCollapsed",21),Ck=new D(T,"AllParentsCollapsed",22),Dk=new D(T,"AnyParentsCollapsed", +23),Ek=new E,Fk="2.2.9",zk="image",Gk=null,ei=!1; +function fi(){if(Jg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Pa("7ca11abfd022028846");b[c]=Pa("398c3597c01238");for(var d=["5da73c80a36455d6038e4972187c3cae51fd22",sa.Dx+"4ae6247590da4bb21c324ba3a84e385776",qd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Pa("7ca11abfd7330390")](Pa(d[e-1]),10,15*e);b[c]=Pa("39f046ebb36e4b");for(c=1;5>c;c++)b[Pa("7ca11abfd7330390")](Pa(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])qd.prototype.Ed=qd.prototype.Fx; +Gk=a}}T.className="Diagram";T.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.F instanceof T?b.F:null};T.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};T.useDOM=function(a){Jg=a?void 0!==x.document:!1};T.isUsingDOM=function(){return Jg};T.None=mh;T.Uniform=Xi; +T.UniformToFill=Yi;T.CycleAll=wf;T.CycleNotDirected=Kf;T.CycleNotDirectedFast=Mf;T.CycleNotUndirected=Nf;T.CycleDestinationTree=Hf;T.CycleSourceTree=Jf;T.DocumentScroll=Mh;T.InfiniteScroll=Oh;T.TreeParentCollapsed=qi;T.AllParentsCollapsed=Ck;T.AnyParentsCollapsed=Dk;function mi(){this.az=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.hd=this.j=!0:this.hd=null} +function rj(a,b){b.Sb.setTransform(b.ac,0,0,b.ac,0,0);b.Sb.Bd();if(null===a.hd)a:{b="f";var c=x[Pa("76a715b2f73f148a")][Pa("72ba13b5")];a.hd=!0;if(Jg){var d=T[Pa("76a115b6ed251eaf4692")];if(d)for(var e=Ek.iterator;e.next();){d=e.value;d=Pa(d).split(Pa("39e9"));if(6>d.length)break;var f=Pa(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Pa(sa[Pa("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=x[Pa("74a900bae4370f8b51")][Pa("6fbb13a1c2311e8a57")].toLowerCase();g=h[Pa("73a612b6fb191d")](Pa("3aad1ab6e022098b4dc4")); +f=Pa(d[2]);if(-1g&&f!==Pa("7da71ca0ad381e90")&&(g=b[Pa("73a612b6fb191d")](Pa("76a715b2ef3e149757")));0>g&&(g=b[Pa("73a612b6fb191d")](Pa("76a715b2ef3e149757")));0>g&&(g=c[Pa("73a612b6fb191d")](Pa("7baa19a6f76c1988428554")));a.hd=!(0<=g&&gk.length;)k+="9";h=k;k=k.substr(k.length-4);d="";d+=["gsh","gsf"][parseInt(k.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(k.substr(0,1),10)%4];g[Pa("79a417a0f0181a8946")]=d;if(x.document[Pa("78a712aa")]){x.document[Pa("78a712aa")][Pa("7bb806b6ed32388c4a875b")](g); +k=x.getComputedStyle(g).getPropertyValue(Pa("78a704b7e62456904c9b12701b6532a8"));var l=x.getComputedStyle(g).getPropertyValue(Pa("75b817b0ea2202"));x.document[Pa("78a712aa")][Pa("68ad1bbcf533388c4a875b")](g);if(k)if(g=x[Pa("77a902b0eb1b1e804a8a")],l==="0."+parseInt(h,10)%100||-1!==k.indexOf(parseInt(f[1]+f[2],16))&&-1!==k.indexOf(parseInt(f[3]+f[4],16))){a.hd=!1;break}else if(g&&g(Pa("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;fMath.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&& +(d=0Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0c||Math.abs(e.y-b.screenY)>c)?a.Er++:a.Er=1;d.clickCount=a.Er;a.Vw=b.timeStamp;a.Ww.ng(b.screenX,b.screenY); +a.doMouseDown();1===b.button?b.preventDefault():fj(d,b)}};a.xk=function(b){if(a.isEnabled){a.ml=!0;var c=a.El;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]=b;else{if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}if(c[0].pointerId===b.pointerId){c=ej(a,b,!1,!1,!1,null!==c[1]);var d=x.document.elementFromPoint(b.clientX,b.clientY);null!==d&&void 0!==d.shadowRoot&&null!==d.shadowRoot&&(d=d.shadowRoot.elementFromPoint(b.clientX,b.clientY));var e=a,f=b; +d&&d.F&&(f=b,e=d.F);c.targetDiagram=e;cj(a,f,c);c.targetObject=null;a.doMouseMove();fj(c,b)}}};a.zk=function(b){if(a.isEnabled){a.ml=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.wu;if(c&&a.Pu)delete d[b.pointerId],b.preventDefault();else if(d=a.El,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=ej(a,b,!1,!0,!0,!1);var e=x.document.elementFromPoint(b.clientX,b.clientY);null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(b.clientX,b.clientY)); +null!==e&&e.F instanceof T&&e.F!==a&&cj(e.F,b,d);null===e&&(e=b.target);cj(a,b,d);d.clickCount=a.Er;d.targetDiagram=dj(b,e);d.targetObject=null;a.doMouseUp();fj(d,b);c&&(a.cu=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.yk=function(b){if(a.isEnabled){a.ml=!1;var c=a.wu;c[b.pointerId]&&delete c[b.pointerId];c=a.El;null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null);null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null);"touch"!==b.pointerType&&"pen"!==b.pointerType&&(b=a.currentTool, +b.cancelWaitAfter(),b.standardMouseOver())}};a.Jt=d.Y["d"+Hk[1]+Hk[2]+"wI"+zk.slice(1,5)]["b"+Ik.slice(1,b)](d.Y,Gk,b,b);d.Ec(!0);Li(a)}}mi.className="DiagramHelper";function Oe(a){this.j=void 0===a?new J:a;this.o=new J}na.Object.defineProperties(Oe.prototype,{point:{get:function(){return this.j},set:function(a){this.j=a}},shifted:{get:function(){return this.o},set:function(a){this.o=a}}});var Hk="DraggingInfo";Oe.className="DraggingInfo"; +function Jj(a,b,c){this.node=a;this.info=b;this.xv=c}Jj.className="DraggingNodeInfoPair";function Ee(){this.reset()}Ee.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new M(NaN,NaN)).freeze();this.gridSnapCellSpot=sc;this.gridSnapOrigin=(new J(NaN,NaN)).freeze();this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1;this.dragsMembers=this.groupsAlwaysMove=!0};Ee.className="DraggingOptions"; +function Jk(a,b){if("string"===typeof a||x.Element&&a instanceof Element)var c=T.call(this,a)||this;else c=T.call(this)||this,b=a;Kk(c);b&&c.Hm(b);return c}ma(Jk,T);function Kk(a){a.allowDragOut=!0;a.allowMove=!1;a.isReadOnly=!0;a.contentAlignment=vc;a.layout=new Lk}Jk.prototype.reset=function(){T.prototype.reset.call(this);Kk(this)};Jk.className="Palette"; +function Mk(a,b){if("string"===typeof a||x.Element&&a instanceof Element)var c=T.call(this,a)||this;else c=T.call(this)||this,b=a;var d=c;c.animationManager.isEnabled=!1;c.ob=!0;c.Ga=null;c.Yn=!1;c.Zn=!1;c.M=!0;c.C=!0;c.Ha=0;c.o=!1;c.Ol=null;c.Dy("drawShadows",!1);a=new V;var e=new uf;e.stroke="magenta";e.strokeWidth=2;e.fill="transparent";e.name="BOXSHAPE";a.selectable=!0;a.selectionAdorned=!1;a.selectionObjectName="BOXSHAPE";a.locationObjectName="BOXSHAPE";a.resizeObjectName="BOXSHAPE";a.cursor= +"move";a.add(e);c.j=a;c.allowCopy=!1;c.allowDelete=!1;c.allowSelect=!0;c.autoScrollRegion=new ic(0,0,0,0);c.ka.h(0,0);c.toolManager.Za("Dragging",new Nk,c.toolManager.mouseMoveTools);c.click=function(){var a=d.observed;if(null!==a){var b=a.viewportBounds,c=d.lastInput.documentPoint;a.position=new J(c.x-b.width/2,c.y-b.height/2)}};c.Tm=function(){d.Pa();Ok(d)};c.Sm=function(){null!==d.observed&&(d.Pa(),d.N())};c.Wa=function(){1>d.updateDelay?d.N():d.o||(d.o=!0,setTimeout(function(){return d.redraw()}, +d.updateDelay))};c.Kh=function(){null!==d.observed&&Ok(d)};c.autoScale=Xi;c.ob=!1;b&&Object.assign(c,b);return c}ma(Mk,T);Mk.prototype.computePixelRatio=function(){return 1}; +Mk.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.Aa,b=this.Sb;if(null!==a&&null!==b){pj(this);if(null===this.Ol){var c=new Ak(null);c.width=a.width;c.height=a.height;this.Ol=c}try{this.Aa=this.Ol,this.Sb=this.Aa.context,this.Sb.Ec(!0),this.Sb.setTransform(1,0,0,1,0,0),this.Sb.clearRect(0,0,this.Aa.width,this.Aa.height),Pk(this)}finally{this.Aa=a,this.Sb=b}}}T.prototype.redraw.call(this)}; +Mk.prototype.lc=function(){null===this.Ea&&C("No div specified");null===this.Aa&&C("No canvas specified");if(!(this.Aa instanceof wj)&&($h(this.box),this.Uc)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.Pi){pj(this);var b=this.Aa;a=this.Sb;a.Ec(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?Pk(this):null!==this.Ol&&(a.drawImage(this.Ol.La,0,0),b=this.tb,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&& +0===this.position.y||b.translate(-this.position.x,-this.position.y),a.scale(this.ac,this.ac),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy));b=this.Na.m;for(var c=b.length,d=0;da&&(a=0);this.Ha!==a&&(this.Ha=a)}}});Mk.className="Overview";function Nk(){De.call(this);this.j=null}ma(Nk,De); +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.timestampb.maxScale||(b.scale=a))};Qk.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);var b=this.diagram;if(b.autoScale!==mh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom}; +Qk.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;b.autoScale===mh&&(a=b.scale*a,ab.maxScale||(b.scale=a))};Qk.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;if(b.autoScale!==mh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Qk.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;ab.maxScale||(b.scale=a)}; +Qk.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; +Qk.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.nc();a.redraw();var c=a.position,d=a.scale;gh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.Zu&&!isNaN(this.fu)&&a.documentBounds.A(this.Xu)?(a.scale=this.fu,a.position=this.Uw,this.Zu=NaN,this.Xu=gc):(this.fu=d,this.Uw=c.copy(),a.zoomToFit(),this.Zu=a.scale,this.Xu=a.documentBounds.copy());ih(b)};Qk.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; +Qk.prototype.scrollToPart=function(a){void 0===a&&(a=null);var b=this.diagram;b.Sa();if(null===a){try{null!==this.Zf&&(this.Zf.next()?a=this.Zf.value:this.Zf=null)}catch(k){this.Zf=null}null===a&&(0a&&(a+=360));return a}; +t.wf=function(){if(0!==(this.G&4096)===!1)return this.al;var a=this.sa;return null!==this.panel?a*this.panel.wf():a};t.Hs=function(a,b){void 0===b&&(b=new J);b.assign(a);this.de.Ed(b);return b};t.Is=function(a,b,c){return this.kk(a.x,a.y,b.x,b.y,c)}; +t.kk=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,L.yf(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=L.yf(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; +Y.prototype.measure=function(a,b,c,d){if(!1!==mj(this)){var e=this.Pg,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 uf&&(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(hl(this,!0)){case og:g=e=0;h&&(b=a=Infinity); +break;case sd: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.widthh.height&&k.heighta.height||this.qb>a.width)))c=!0;this.G=c?this.G|256:this.G&-257;this.vb.u()||C("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.vb.toString());this.rm(f,this.vb);il(this,!1);N.free(f)};t=Y.prototype;t.vh=function(){}; +function jl(a,b,c,d,e){a.vb.h(b,c,d,e);if(!a.desiredSize.u()){var f=a.ic;c=a.Pg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=hl(a,!0);c===d&&f===e&&(b=og);switch(b){case og:if(c>d||f>e)hj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case sd:hj(a,!0);a.measure(d,e,0,0);break;case Vk:hj(a,!0);a.measure(d,f,0,0);break;case Wk:hj(a,!0),a.measure(c,e,0,0)}}} +t.rm=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||kl(c,!0),this.N(),Wb(a,b)||(c.Ch(),this.Qo(c)))};t.Qo=function(a){null!==this.portId&&(kl(a,!0),a instanceof W&&ll(a,this))}; +t.lc=function(a,b){if(this.visible){var c=this.opacity;if(0!==c){var d=this instanceof X&&(this.type===X.TableRow||this.type===X.TableColumn),e=this.vb;if(d||0!==e.width&&0!==e.height&&!isNaN(e.x)&&!isNaN(e.y)){var f=1;1!==c&&(f=a.globalAlpha,a.globalAlpha=f*c);if(d){e=this.vb;d=this.qc;var g=this.fd,h=this.Rb;null===g&&null===h||a.Bd();null!==g&&(bi(this,a,g,!0,!0,d,e),g instanceof ml&&g.type===nl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.uf(g)):a.fillRect(e.x,e.y,e.width,e.height));null!== +h&&(bi(this,a,h,!0,!1,d,e),h instanceof ml&&h.type===nl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.uf(h)):a.fillRect(e.x,e.y,e.width,e.height));this.Fi(a,b)}else if(!this.Px(a,b)){this instanceof U&&this.sk(!1);d=this.transform;g=this.panel;0!==(this.G&4096)===!0&&ol(this);var k=this.part;h=!1;var l=0;if(k&&b.Fe("drawShadows")&&(h=k.isShadowed)){var m=k.shadowOffset;l=Math.max(m.y,m.x)*b.scale*b.ac}m=this.Ri();var n;if(!(n=b.zj||!m)){var p=this.naturalBounds;n=this.Mh;var r=n.m11,q=n.m21,u= +n.dx,v=n.m12,w=n.m22,z=n.dy,y,A=y=0;n=y*r+A*q+u;var B=y*v+A*w+z;y=p.width+l;A=0;var F=y*r+A*q+u;y=y*v+A*w+z;A=Math.min(n,F);var K=Math.min(B,y);var S=Math.max(n+0,F)-A;var R=Math.max(B+0,y)-K;n=A;B=K;y=p.width+l;A=p.height+l;F=y*r+A*q+u;y=y*v+A*w+z;A=Math.min(n,F);K=Math.min(B,y);S=Math.max(n+S,F)-A;R=Math.max(B+R,y)-K;n=A;B=K;y=0;A=p.height+l;F=y*r+A*q+u;y=y*v+A*w+z;A=Math.min(n,F);K=Math.min(B,y);S=Math.max(n+S,F)-A;R=Math.max(B+R,y)-K;n=A;B=K;l=b.viewportBounds;p=l.x;r=l.y;n=!(n>l.width+p||p>S+ +n||B>l.height+r||r>R+B)}if(n){n=0!==(this.G&256);a.clipInsteadOfFill&&(n=!1);this instanceof Lg&&(a.font=this.font);if(n){B=g.he()?g.naturalBounds:g.actualBounds;null!==this.$a?(p=this.$a,S=p.x,R=p.y,l=p.width,p=p.height):(S=Math.max(e.x,B.x),R=Math.max(e.y,B.y),l=Math.min(e.right,B.right)-S,p=Math.min(e.bottom,B.bottom)-R);if(S>e.width+e.x||e.x>B.width+B.x){1!==c&&(a.globalAlpha=f);return}a.save();a.beginPath();a.rect(S,R,l,p);a.clip()}if(m){if(!k.isVisible()){1!==c&&(a.globalAlpha=f);return}h&& +(B=k.shadowOffset,a.bw(B.x*b.scale*b.ac,B.y*b.scale*b.ac,k.shadowBlur),pl(a),a.shadowColor=k.shadowColor)}h&&!0===this.shadowVisible?pl(a):h&&!1===this.shadowVisible&&ql(a);k=this.naturalBounds;null!==this.fd&&(a.Bd(),bi(this,a,this.fd,!0,!0,k,e),this.fd instanceof ml&&this.fd.type===nl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.uf(this.fd)):a.fillRect(e.x,e.y,e.width,e.height));a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);h&&(null!==g&&0!==(g.G&512)||null!==g&&(g.type===X.Auto||g.type=== +X.Spot)&&g.nb()!==this)&&null===this.shadowVisible&&ql(a);null!==this.Rb&&(a.Bd(),rl(this,a,k,e));h&&(null!==this.Rb||null!==this.fd||null!==g&&0!==(g.G&512)||null!==g&&(g.type===X.Auto||g.type===X.Spot)&&g.nb()!==this)?(sl(this,!0),null===this.shadowVisible&&ql(a)):sl(this,!1);this.Fi(a,b);h&&0!==(this.G&512)===!0&&pl(a);m&&h&&ql(a);n&&(a.restore(),a.Ec(this instanceof X));d.Os()||(b=1/(d.m11*d.m22-d.m12*d.m21),a.transform(d.m22*b,-d.m12*b,-d.m21*b,d.m11*b,b*(d.m21*d.dy-d.m22*d.dx),b*(d.m12*d.dx- +d.m11*d.dy)))}}1!==c&&(a.globalAlpha=f)}}}};function rl(a,b,c,d){var e=a.naturalBounds,f=0,g=0,h=e.width;e=e.height;var k=a.Ow();a instanceof uf&&(e=a.ma.bounds,f=e.x,g=e.y,h=e.width,e=e.height);bi(a,b,a.Rb,!0,!1,c,d);a.Rb instanceof ml&&a.Rb.type===nl?(b.beginPath(),b.rect(f-k/2,g-k/2,h+k,e+k),b.uf(a.Rb)):b.fillRect(f-k/2,g-k/2,h+k,e+k)}t.Px=function(){return!1};t.Fi=function(){}; +function bi(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===tl)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var l=0;a instanceof uf&&(l=a.strokeWidth);h=f.width;k=f.height;e?(h=g.width,k=g.height):d||(h+=l,k+=l);if((f=b instanceof ul)&&c.ke&&(c.type===vl||c.Pk===h&&c.At===k))var m=c.ke;else{var n=0,p=0,r=0,q=0,u=0,v=0;v=u=0;e?(u=g.x,v=g.y):d||(u-=l/2,v-=l/2);n=c.start.x*h+c.start.offsetX;p=c.start.y*k+c.start.offsetY;r=c.end.x*h+ +c.end.offsetX;q=c.end.y*k+c.end.offsetY;n+=u;r+=u;p+=v;q+=v;if(c.type===wl)m=b.createLinearGradient(n,p,r,q);else if(c.type===nl)v=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(u=0,v=Math.max(h,k)/2):u=c.startRadius,m=b.createRadialGradient(n,p,u,r,q,v);else if(c.type===vl)try{m=b.createPattern(c.pattern,"repeat")}catch(z){m=null}if(c.type!==vl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)m.addColorStop(e.key,e.value);if(f&&(c.ke=m,null!==m&&(c.Pk=h,c.At=k),null=== +m&&c.type===vl&&-1!==c.Pk)){c.Pk=-1;var w=a.diagram;null!==w&&-1===c.Pk&&ua(function(){w.redraw()},600)}}d?b.fillStyle=m:b.strokeStyle=m}}}t.mg=function(a){if(a instanceof X)a:{if(this!==a&&null!==a)for(var b=this.panel;null!==b;){if(b===a){a=!0;break a}b=b.panel}a=!1}else a=!1;return a};t.Bf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.Bf():!0};t.Af=function(){for(var a=this instanceof X?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; +function ol(a){if(0!==(a.G&2048)===!0){var b=a.tb;b.reset();if(!a.vb.u()||!a.ic.u()){xl(a,!1);return}b.translate(a.vb.x-a.ic.x,a.vb.y-a.ic.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;a.zp(b,c.x,c.y,c.width,c.height)}xl(a,!1);yl(a,!0)}0!==(a.G&4096)===!0&&(b=a.panel,null===b?(a.Mh.set(a.tb),a.al=a.scale,yl(a,!1)):null!==b.de&&(c=a.Mh,c.reset(),b.he()?c.multiply(b.Mh):null!==b.panel&&c.multiply(b.panel.Mh),c.multiply(a.tb),a.al=a.scale*b.al,yl(a,!1)))} +t.zp=function(a,b,c,d,e){1!==this.sa&&a.scale(this.sa);if(0!==this.xb){var f=J.alloc();f.Vi(b,c,d,e,yc);a.rotate(this.xb,f.x,f.y);J.free(f)}};t.s=function(a){if(!mj(this)){void 0===a&&(a=!1);hj(this,!0);il(this,!0);var b=this.panel;null===b||a||b.s()}};t.mk=function(){mj(this)||(hj(this,!0),il(this,!0))};function zl(a){if(!nj(a)){var b=a.panel;null!==b?b.s():a.Ri()&&(b=a.diagram,null!==b&&(b.qe.add(a),a instanceof W&&a.pd(),b.Fb()));il(a,!0)}} +t.ll=function(){0!==(this.G&2048)===!1&&(xl(this,!0),yl(this,!0))};t.Bv=function(){yl(this,!0)};t.N=function(){var a=this.part;null!==a&&a.N()}; +function hl(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===X.Table)return Al(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===X.Auto&&d.nb()===a)return Bl(a,sd,b);if(c===Uk){if(null!==d){if(d.type===X.Spot&&d.nb()===a)return Bl(a,sd,b);c=d.defaultStretch;return c===Uk?Bl(a,og,b):Bl(a,c,b)}return Bl(a,og,b)}return Bl(a,c,b)} +function Al(a,b,c,d){var e=a.stretch;if(e!==Uk)return Bl(a,e,d);var f=e=null;switch(b.stretch){case Wk:f=!0;break;case sd:f=!0}switch(c.stretch){case Vk:e=!0;break;case sd:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===Vk||b===sd);null===f&&(f=b===Wk||b===sd);return!0===e&&!0===f?Bl(a,sd,d):!0===e?Bl(a,Vk,d):!0===f?Bl(a,Wk,d):Bl(a,og,d)} +function Bl(a,b,c){if(c)return b;if(b===og)return og;c=a.desiredSize;if(c.u())return og;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===Vk)return og;if(b===sd)return Wk}else{if(b===Wk)return og;if(b===sd)return Vk}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===Wk)return og;if(b===sd)return Vk}else{if(b===Vk)return og;if(b===sd)return Wk}return b}function sl(a,b){a.G=b?a.G|512:a.G&-513}function dl(a){return 0!==(a.G&1024)}function Cl(a,b){a.G=b?a.G|1024:a.G&-1025} +function xl(a,b){a.G=b?a.G|2048:a.G&-2049}function yl(a,b){a.G=b?a.G|4096:a.G&-4097}function mj(a){return 0!==(a.G&8192)}function hj(a,b){a.G=b?a.G|8192:a.G&-8193}function nj(a){return 0!==(a.G&16384)}function il(a,b){a.G=b?a.G|16384:a.G&-16385}t.Ti=function(a){this.Xf=a};t.gt=function(){};t.Zv=function(a){this.ka=a;zl(this);return!0};t.Gm=function(a,b){if(this.ka.x!==a||this.ka.y!==b)this.ka.h(a,b),this.ll()};t.Ow=function(){return 0}; +function Dl(a){var b=a.part;if(b instanceof W&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||ll(b,a)}}function El(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof X?a instanceof W?a.pd():a.Mm(a,function(a){Dl(a)}):Dl(a))} +t.bind=function(a,b,c,d){var e=null;"string"===typeof a?e=new ri(a,b,c,d):e=a;e.md=this;a=this.yh();null!==a&&Fl(a)&&C("Cannot add a Binding to a template that has already been copied: "+e);null===this.fb&&(this.fb=new E);this.fb.add(e);return this};t.set=function(a){Object.assign(this,a);return this};t.dv=function(a){Gl(this,a);return this};t.apply=function(a){a(this);return this};t.Hm=function(a){tj(this,a);return this};t.Vz=function(){return this.yh()}; +t.yh=function(){for(var a=this instanceof X?this:this.panel;null!==a;){if(null!==a.Ph)return a;a=a.panel}return null};t.fw=function(a){a.md=this;null===this.rg&&(this.rg=new I);this.rg.add(a.propertyName,a);return this}; +function Hl(a,b){for(var c=1;ce)&&C("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.isRow=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&C("Must specify non-negative integer column for RowColumnDefinition "+ +b+", not: "+e),a.isRow=!1,a.index=e);e=new Wa;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);tj(a,e)}else tj(a,b);else C('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function Ll(a,b){Il.add(a,b)}function Ml(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b} +na.Object.defineProperties(Y.prototype,{shadowVisible:{get:function(){return this.Nl},set:function(a){var b=this.Nl;b!==a&&(this.Nl=a,this.N(),this.g("shadowVisible",b,a))}},enabledChanged:{get:function(){return null!==this.O?this.O.Fn:null},set:function(a){al(this);var b=this.O.Fn;b!==a&&(this.O.Fn=a,this.g("enabledChanged",b,a))}},segmentOrientation:{get:function(){return this.Ll},set:function(a){var b=this.Ll; +b!==a&&(this.Ll=a,this.s(),this.g("segmentOrientation",b,a),a===Vf&&(this.angle=0))}},segmentIndex:{get:function(){return this.sp},set:function(a){a=Math.round(a);var b=this.sp;b!==a&&(this.sp=a,this.s(),this.g("segmentIndex",b,a))}},segmentFraction:{get:function(){return this.Jl},set:function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&C("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.sa=a,this.s(),this.g("scale",b,a))}},angle:{get:function(){return this.xb},set:function(a){var b=this.xb;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.xb=a,El(this),this.s(),this.g("angle",b,a)))}},desiredSize:{get:function(){return this.Sc},set:function(a){var b=a.width,c=a.height,d=this.Sc,e= +d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Sc=a=a.I(),this.s(),this instanceof uf&&this.cc(),this.g("desiredSize",d,a),dl(this)&&(a=this.part,null!==a&&(el(this,a,"width"),el(this,a,"height"))))}},width:{get:function(){return this.Sc.width},set:function(a){var b=this.Sc.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Sc,this.Sc=a=(new M(a,this.Sc.height)).freeze(),this.s(),this instanceof uf&&this.cc(),this.g("desiredSize",b,a),dl(this)&& +(a=this.part,null!==a&&el(this,a,"width")))}},height:{get:function(){return this.Sc.height},set:function(a){var b=this.Sc.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Sc,this.Sc=a=(new M(this.Sc.width,a)).freeze(),this.s(),this instanceof uf&&this.cc(),this.g("desiredSize",b,a),dl(this)&&(a=this.part,null!==a&&el(this,a,"height")))}},minSize:{get:function(){return this.Uf},set:function(a){var b=this.Uf;b.A(a)||(a=a.copy(),isNaN(a.width)&&(a.width= +0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Uf=a,this.s(),this.g("minSize",b,a))}},maxSize:{get:function(){return this.Tf},set:function(a){var b=this.Tf;b.A(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Tf=a,this.s(),this.g("maxSize",b,a))}},measuredBounds:{get:function(){return this.ic}},naturalBounds:{get:function(){return this.qc}},margin:{ +get:function(){return this.Pg},set:function(a){"number"===typeof a&&(a=new ic(a));var b=this.Pg;b.A(a)||(this.Pg=a=a.I(),this.s(),this.g("margin",b,a))}},transform:{get:function(){0!==(this.G&2048)===!0&&ol(this);return this.tb}},de:{get:function(){0!==(this.G&4096)===!0&&ol(this);return this.Mh}},alignment:{get:function(){return this.wb},set:function(a){var b=this.wb;b.A(a)||(a.wc()&&!a.Lb()&& +C("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.wb=a=a.I(),zl(this),this.g("alignment",b,a))}},column:{get:function(){return this.wg},set:function(a){a=Math.round(a);var b=this.wg;b!==a&&(0>a&&xa(a,">= 0",Y,"column"),this.wg=a,this.s(),this.g("column",b,a))}},columnSpan:{get:function(){return this.jn},set:function(a){a=Math.round(a);var b=this.jn;b!==a&&(1>a&&xa(a,">= 1",Y,"columnSpan"),this.jn=a, +this.s(),this.g("columnSpan",b,a))}},row:{get:function(){return this.np},set:function(a){a=Math.round(a);var b=this.np;b!==a&&(0>a&&xa(a,">= 0",Y,"row"),this.np=a,this.s(),this.g("row",b,a))}},rowSpan:{get:function(){return this.op},set:function(a){a=Math.round(a);var b=this.op;b!==a&&(1>a&&xa(a,">= 1",Y,"rowSpan"),this.op=a,this.s(),this.g("rowSpan",b,a))}},spanAllocation:{get:function(){return this.Fp},set:function(a){var b= +this.Fp;b!==a&&(this.Fp=a,this.s(),this.g("spanAllocation",b,a))}},alignmentFocus:{get:function(){return this.Gk},set:function(a){var b=this.Gk;b.A(a)||(this.Gk=a=a.I(),this.s(),this.g("alignmentFocus",b,a))}},portId:{get:function(){return this.ap},set:function(a){var b=this.ap;if(b!==a){var c=this.part;null===c||c instanceof W||C("Cannot set portID on a Link: "+a);null!==b&&null!==c&&Ol(c,this);this.ap=a;null!==a&&null!==c&&(c.Ge=!0,Pl(c, +this));this.g("portId",b,a)}}},toSpot:{get:function(){return null!==this.P?this.P.ph:rc},set:function(a){this.Hc();var b=this.P.ph;b.A(a)||(a=a.I(),this.P.ph=a,this.g("toSpot",b,a),Dl(this))}},toEndSegmentLength:{get:function(){return null!==this.P?this.P.nh:10},set:function(a){this.Hc();var b=this.P.nh;b!==a&&(0>a&&xa(a,">= 0",Y,"toEndSegmentLength"),this.P.nh=a,this.g("toEndSegmentLength",b,a),Dl(this))}},toShortLength:{ +get:function(){return null!==this.P?this.P.oh:0},set:function(a){this.Hc();var b=this.P.oh;b!==a&&(this.P.oh=a,this.g("toShortLength",b,a),Dl(this))}},toLinkable:{get:function(){return null!==this.P?this.P.Mp:null},set:function(a){this.Hc();var b=this.P.Mp;b!==a&&(this.P.Mp=a,this.g("toLinkable",b,a))}},toMaxLinks:{get:function(){return null!==this.P?this.P.Np:Infinity},set:function(a){this.Hc();var b=this.P.Np;b!==a&&(0>a&& +xa(a,">= 0",Y,"toMaxLinks"),this.P.Np=a,this.g("toMaxLinks",b,a))}},fromSpot:{get:function(){return null!==this.P?this.P.Jg:rc},set:function(a){this.Hc();var b=this.P.Jg;b.A(a)||(a=a.I(),this.P.Jg=a,this.g("fromSpot",b,a),Dl(this))}},fromEndSegmentLength:{get:function(){return null!==this.P?this.P.Hg:10},set:function(a){this.Hc();var b=this.P.Hg;b!==a&&(0>a&&xa(a,">= 0",Y,"fromEndSegmentLength"),this.P.Hg=a,this.g("fromEndSegmentLength", +b,a),Dl(this))}},fromShortLength:{get:function(){return null!==this.P?this.P.Ig:0},set:function(a){this.Hc();var b=this.P.Ig;b!==a&&(this.P.Ig=a,this.g("fromShortLength",b,a),Dl(this))}},fromLinkable:{get:function(){return null!==this.P?this.P.Mn:null},set:function(a){this.Hc();var b=this.P.Mn;b!==a&&(this.P.Mn=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{get:function(){return null!==this.P?this.P.Nn:Infinity}, +set:function(a){this.Hc();var b=this.P.Nn;b!==a&&(0>a&&xa(a,">= 0",Y,"fromMaxLinks"),this.P.Nn=a,this.g("fromMaxLinks",b,a))}},cursor:{get:function(){return this.Sh},set:function(a){var b=this.Sh;b!==a&&(this.Sh=a,this.g("cursor",b,a))}},click:{get:function(){return null!==this.O?this.O.vg:null},set:function(a){al(this);var b=this.O.vg;b!==a&&(this.O.vg=a,this.g("click",b,a))}},doubleClick:{get:function(){return null!== +this.O?this.O.Dg:null},set:function(a){al(this);var b=this.O.Dg;b!==a&&(this.O.Dg=a,this.g("doubleClick",b,a))}},contextClick:{get:function(){return null!==this.O?this.O.xg:null},set:function(a){al(this);var b=this.O.xg;b!==a&&(this.O.xg=a,this.g("contextClick",b,a))}},mouseEnter:{get:function(){return null!==this.O?this.O.Sg:null},set:function(a){al(this);var b=this.O.Sg;b!==a&&(this.O.Sg=a,this.g("mouseEnter",b,a))}},mouseLeave:{ +get:function(){return null!==this.O?this.O.Vg:null},set:function(a){al(this);var b=this.O.Vg;b!==a&&(this.O.Vg=a,this.g("mouseLeave",b,a))}},mouseOver:{get:function(){return null!==this.O?this.O.Wg:null},set:function(a){al(this);var b=this.O.Wg;b!==a&&(this.O.Wg=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return null!==this.O?this.O.Ug:null},set:function(a){al(this);var b=this.O.Ug;b!==a&&(this.O.Ug=a,this.g("mouseHover", +b,a))}},mouseHold:{get:function(){return null!==this.O?this.O.Tg:null},set:function(a){al(this);var b=this.O.Tg;b!==a&&(this.O.Tg=a,this.g("mouseHold",b,a))}},mouseDragEnter:{get:function(){return null!==this.O?this.O.Ho:null},set:function(a){al(this);var b=this.O.Ho;b!==a&&(this.O.Ho=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{get:function(){return null!==this.O?this.O.Io:null},set:function(a){al(this); +var b=this.O.Io;b!==a&&(this.O.Io=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{get:function(){return null!==this.O?this.O.Rg:null},set:function(a){al(this);var b=this.O.Rg;b!==a&&(this.O.Rg=a,this.g("mouseDrop",b,a))}},actionDown:{get:function(){return null!==this.O?this.O.Vm:null},set:function(a){al(this);var b=this.O.Vm;b!==a&&(this.O.Vm=a,this.g("actionDown",b,a))}},actionMove:{get:function(){return null!== +this.O?this.O.Wm:null},set:function(a){al(this);var b=this.O.Wm;b!==a&&(this.O.Wm=a,this.g("actionMove",b,a))}},actionUp:{get:function(){return null!==this.O?this.O.Xm:null},set:function(a){al(this);var b=this.O.Xm;b!==a&&(this.O.Xm=a,this.g("actionUp",b,a))}},actionCancel:{get:function(){return null!==this.O?this.O.Um:null},set:function(a){al(this);var b=this.O.Um;b!==a&&(this.O.Um=a,this.g("actionCancel",b,a))}},toolTip:{ +get:function(){return null!==this.O?this.O.qh:null},set:function(a){al(this);var b=this.O.qh;b!==a&&(this.O.qh=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return null!==this.O?this.O.yg:null},set:function(a){al(this);var b=this.O.yg;b!==a&&(this.O.yg=a,this.g("contextMenu",b,a))}}});Y.prototype.trigger=Y.prototype.fw;Y.prototype.findBindingPanel=Y.prototype.yh;Y.prototype.findTemplateBinder=Y.prototype.Vz;Y.prototype.setProperties=Y.prototype.Hm; +Y.prototype.apply=Y.prototype.apply;Y.prototype.attach=Y.prototype.dv;Y.prototype.set=Y.prototype.set;Y.prototype.isEnabledObject=Y.prototype.Af;Y.prototype.isVisibleObject=Y.prototype.Bf;Y.prototype.isContainedBy=Y.prototype.mg;Y.prototype.getNearestIntersectionPoint=Y.prototype.Is;Y.prototype.getLocalPoint=Y.prototype.Hs;Y.prototype.getDocumentScale=Y.prototype.wf;Y.prototype.getDocumentAngle=Y.prototype.Li;Y.prototype.getDocumentBounds=Y.prototype.Mi;Y.prototype.getDocumentPoint=Y.prototype.da; +Y.prototype.intersectsRect=Y.prototype.Ic;Y.prototype.containedInRect=Y.prototype.wh;Y.prototype.containsRect=Y.prototype.De;Y.prototype.containsPoint=Y.prototype.$;Y.prototype.raiseChanged=Y.prototype.g;Y.prototype.raiseChangedEvent=Y.prototype.Va;Y.prototype.addCopyProperty=Y.prototype.yx;var Il=null;Y.className="GraphObject";Il=new I; +Ll("Button",function(){function a(a,b){return null!==a.diagram.Wb(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Hl(X,X.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof X){var c=a.Ya("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", +_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Hl(uf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new P(0,0,2.76142374915397,2.761423749153969),spot2:new P(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Af()&&b instanceof X&&(a=b.Ya("ButtonBorder"),a instanceof uf)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke=c}}; +b.mouseLeave=function(a,b){b.Af()&&b instanceof X&&(a=b.Ya("ButtonBorder"),a instanceof uf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Af()&&b instanceof X&&null!==b._buttonFillPressed&&0===a.button){var c=b.Ya("ButtonBorder");if(c instanceof uf){a=a.diagram;var d=a.skipsUndoManager;a.skipsUndoManager=!0;var g=b._buttonFillPressed;b._buttonFillOver=c.fill;c.fill=g;g=b._buttonStrokePressed;b._buttonStrokeOver=c.stroke;c.stroke=g;a.skipsUndoManager= +d}}};b.actionUp=function(b,d){if(d.Af()&&d instanceof X&&null!==d._buttonFillPressed&&0===b.button){var c=d.Ya("ButtonBorder");if(c instanceof uf){var f=b.diagram,g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionCancel=function(b,d){if(d.Af()&&d instanceof X&&null!==d._buttonFillPressed){var c=d.Ya("ButtonBorder");if(c instanceof uf){var f=b.diagram, +g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionMove=function(b,d){if(d.Af()&&d instanceof X&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.Ya("ButtonBorder"),b instanceof uf))){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}); +Ll("TreeExpanderButton",function(){var a=Hl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Hl(uf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Lb},(new ri("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).wq()),{visible:!1},(new ri("visible","isTreeLeaf",function(a){return!a})).wq());a.click=function(a,c){c=c.part;c instanceof we&&(c=c.adornedPart);if(c instanceof W){var b=c.diagram; +if(null!==b){b=b.commandHandler;if(c.isTreeExpanded){if(!b.canCollapseTree(c))return}else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); +Ll("SubGraphExpanderButton",function(){var a=Hl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Hl(uf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Lb},(new ri("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).wq()));a.click=function(a,c){c=c.part;c instanceof we&&(c=c.adornedPart);if(c instanceof hf){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return; +a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});Ll("ToolTip",function(){return Hl(we,X.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},Hl(uf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new P(0,0,4,6),spot2:new P(1,1,-4,-4)}))}); +Ll("ContextMenu",function(){return Hl(we,X.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},new ri("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Ll("ContextMenuButton",function(){var a=Hl("Button");a.stretch=Vk;var b=a.Ya("ButtonBorder");b instanceof uf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new P(0,0,2,3),b.spot2=new P(1,1,-2,-2));return a}); +Ll("PanelExpanderButton",function(a){var b=Ml(a,"COLLAPSIBLE"),c=Hl("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},Hl(uf,{name:"ButtonIcon",strokeWidth:2},(new ri("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).wq(b))); +a=c.Ya("ButtonBorder");a instanceof uf&&(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.yh();null===e&&(e=c.part);null!==e&&(c=e.Ya(b),null!==c&&(a.handled=!0,d.wa("Collapse/Expand Panel"),c.visible=!c.visible,d.Xa("Collapse/Expand Panel")))}};return c}); +Ll("CheckBoxButton",function(a){var b=Ml(a);a=Hl("Button",{desiredSize:new M(14,14)},Hl(uf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:sd,geometryStretch:qg,visible:!1},""!==b?(new ri("visible",b)).oy():[]));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.Ya("ButtonIcon");c.wa("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, +d);c.Xa("checkbox")}}};return a}); +Ll("CheckBox",function(a){a=Ml(a);a=Hl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new ic(0,1,0,0)});var b=Hl(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=og=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=sd=new D(Y,"Fill",3);Y.Uniform=qg=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=Hl;Y.getBuilders=function(){var a=new I,b;for(b in Il)if(b!==b.toLowerCase()){var c=Il.H(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};Y.defineBuilder=Ll; +Y.build=function(a,b){var c=Il.H(a);if("function"===typeof c&&(c=c(null),c instanceof Y))return b&&c.set(b),c;C('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')};Y.takeBuilderArgument=Ml;function bl(){this.Fn=this.yg=this.qh=this.Um=this.Xm=this.Wm=this.Vm=this.Rg=this.Io=this.Ho=this.Tg=this.Ug=this.Wg=this.Vg=this.Sg=this.xg=this.Dg=this.vg=null} +bl.prototype.copy=function(){var a=new bl;a.vg=this.vg;a.Dg=this.Dg;a.xg=this.xg;a.Sg=this.Sg;a.Vg=this.Vg;a.Wg=this.Wg;a.Ug=this.Ug;a.Tg=this.Tg;a.Ho=this.Ho;a.Io=this.Io;a.Rg=this.Rg;a.Vm=this.Vm;a.Wm=this.Wm;a.Xm=this.Xm;a.Um=this.Um;a.qh=this.qh;a.yg=this.yg;a.Fn=this.Fn;return a};bl.className="GraphObjectEventHandlers";function Ql(){this.Ma=[1,0,0,1,0,0]} +Ql.prototype.copy=function(){var a=new Ql;a.Ma[0]=this.Ma[0];a.Ma[1]=this.Ma[1];a.Ma[2]=this.Ma[2];a.Ma[3]=this.Ma[3];a.Ma[4]=this.Ma[4];a.Ma[5]=this.Ma[5];return a};Ql.prototype.translate=function(a,b){this.Ma[4]+=this.Ma[0]*a+this.Ma[2]*b;this.Ma[5]+=this.Ma[1]*a+this.Ma[3]*b};Ql.prototype.scale=function(a,b){this.Ma[0]*=a;this.Ma[1]*=a;this.Ma[2]*=b;this.Ma[3]*=b};Ql.className="STransform"; +function Rl(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.Ix=[];this.pattern=null}Rl.prototype.addColorStop=function(a,b){this.Ix.push({offset:a,color:b})};Rl.className="SGradient"; +function wj(a,b){this.ownerDocument=a=void 0===b?x.document:b;this.FA="http://www.w3.org/2000/svg";void 0!==a&&(this.La=this.Ob("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.La.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.La.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.gq=null;this.context=new Sl(this)} +wj.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.La.setAttributeNS(null,"width",c+"px"),this.La.setAttributeNS(null,"height",d+"px"),this.La.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.Yw.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.Yw.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; +wj.prototype.Ob=function(a,b,c){a=this.ownerDocument.createElementNS(this.FA,a);if(za(b))for(var d in b)a.setAttributeNS("href"===d?"http://www.w3.org/1999/xlink":"",d,b[d]);void 0!==c&&(a.textContent=c);return a};wj.prototype.getBoundingClientRect=function(){return this.La.getBoundingClientRect()};wj.prototype.focus=function(){this.La.focus()};wj.prototype.Ox=function(){this.ownerDocument=null}; +na.Object.defineProperties(wj.prototype,{width:{get:function(){return this.La.width.baseVal.value},set:function(a){this.La.width=a}},height:{get:function(){return this.La.height.baseVal.value},set:function(a){this.La.height=a}},style:{get:function(){return this.La.style}}});wj.className="SVGSurface"; +function Sl(a){this.jt=a;this.svg=a.La;this.stack=[];this.dd=[];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.bg=this.fs=this.es=0;this.Rs=null;this.path=[];this.Yt=!1;this.ih=null;this.jh=0;this.Ee=new Ql; +Tl(this,1,0,0,1,0,0);var b=kb++,c=this.Ob("clipPath",{id:"mainClip"+b});c.appendChild(this.Ob("rect",{x:0,y:0,width:a.width,height:a.height}));this.Yw=c;this.jt.La.appendChild(c);this.dd[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.HA={}}t=Sl.prototype; +t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,r=b+n,q=f?0:1;d=f?d-e:e-d;(1E-6d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,q,a-m,b-n]),this.path.push(["A",c,c,0,1,q,p,r])):1E-6=Math.PI),q,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[]};t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){}; +t.clip=function(){this.addPath("clipPath",this.path,this.Ee)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new Rl("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.HA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+kb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.Ob("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.Ob(zk,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; +t.createRadialGradient=function(a,b,c,d,e,f){var g=new Rl("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; +t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;a={x:0,y:0,width:m||d,height:n||e,href:l};L.aa(d,h)&&L.aa(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio= +"xMidYMid slice"):a.preserveAspectRatio="none";l="";h/=d;k/=e;if(0!==f||0!==g)l+=" translate("+f+", "+g+")";if(1!==h||1!==k)l+=" scale("+h+", "+k+")";if(0!==b||0!==c)l+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+kb++,g=this.Ob("clipPath",{id:f}),g.appendChild(this.Ob("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),a["clip-path"]="url(#"+f+")";Ul(this,zk,a,this.Ee,l);this.addElement(zk,a)};t.fill=function(){this.addPath("fill",this.path,this.Ee)}; +t.uf=function(){this.clipInsteadOfFill?this.clip():this.fill()};t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};Ul(this,"fill",a,this.Ee);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};Ul(this,"fill",b,this.Ee);this.addElement("text",b,a[0])};t.lineTo=function(a,b){this.path.push(["L",a,b])}; +t.moveTo=function(a,b){this.path.push(["M",a,b])};t.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};t.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; +t.restore=function(){this.Ee=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.lineDashOffset=a.lineDashOffset;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign}; +t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;bb.offset?1:-1});for(e=0;eg.width+g.x||g.x> +k.width+k.x||n>g.height+g.y||g.y>k.height+k.y)return!0;k=!0;Tl(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.Ri()&&!this.isVisible())return!0;a.Ee.Ma=[1,0,0,1,0,0];(this instanceof Lg&&1b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.hn?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.hn?this.clip():this.fill()};t.Xi=function(){this.hn||this.stroke()};t.bw=function(a,b,c){this.es=a;this.fs=b;this.bg=c}; +t.As=function(a,b){var c=this.Y;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.ys=function(){var a=this.Y;void 0!==a.setLineDash&&(a.setLineDash(Wl),a.lineDashOffset=0)};t.Ec=function(a){a&&(this.yt="");this.xt=this.zt=""}; +na.Object.defineProperties(ul.prototype,{fillStyle:{get:function(){return this.Y.fillStyle},set:function(a){this.xt!==a&&(this.xt=this.Y.fillStyle=a)}},font:{get:function(){return this.Y.font},set:function(a){this.yt!==a&&(this.yt=this.Y.font=a)}},globalAlpha:{get:function(){return this.Y.globalAlpha},set:function(a){this.Y.globalAlpha=a}},lineCap:{get:function(){return this.Y.lineCap}, +set:function(a){this.Y.lineCap=a}},lineDashOffset:{get:function(){return this.Y.lineDashOffset},set:function(a){this.Y.lineDashOffset=a}},lineJoin:{get:function(){return this.Y.lineJoin},set:function(a){this.Y.lineJoin=a}},lineWidth:{get:function(){return this.Y.lineWidth},set:function(a){this.Y.lineWidth=a}},miterLimit:{get:function(){return this.Y.miterLimit},set:function(a){this.Y.miterLimit= +a}},shadowBlur:{get:function(){return this.Y.shadowBlur},set:function(a){this.Y.shadowBlur=a}},shadowColor:{get:function(){return this.Y.shadowColor},set:function(a){this.Y.shadowColor=a}},shadowOffsetX:{get:function(){return this.Y.shadowOffsetX},set:function(a){this.Y.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Y.shadowOffsetY},set:function(a){this.Y.shadowOffsetY= +a}},strokeStyle:{get:function(){return this.Y.strokeStyle},set:function(a){this.zt!==a&&(this.zt=this.Y.strokeStyle=a)}},textAlign:{get:function(){return this.Y.textAlign},set:function(a){this.Y.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Y.imageSmoothingEnabled},set:function(a){this.Y.imageSmoothingEnabled=a}},clipInsteadOfFill:{get:function(){return this.hn}, +set:function(a){this.hn=a}}});var Wl=Object.freeze([]);ul.className="CanvasSurfaceContext";function Xl(){this.M=this.o=this.C=this.j=0}Xl.className="ColorNumbers";function ml(a,b){Yl||(Zl(),Yl=!0);Ta(this);this.v=!1;void 0===a?(this.ia=tl,this.Ok="black"):"string"===typeof a?(this.ia=tl,this.Ok=a):(this.ia=a,this.Ok="black");a=this.ia;a===wl?(this.zd=vc,this.bl=Bc):this.bl=a===nl?this.zd=yc:this.zd=rc;this.js=0;this.jr=NaN;this.ke=this.Ur=this.je=null;this.At=this.Pk=0;b&&Object.assign(this,b)} +ml.prototype.copy=function(){var a=new ml;a.ia=this.ia;a.Ok=this.Ok;a.zd=this.zd.I();a.bl=this.bl.I();a.js=this.js;a.jr=this.jr;null!==this.je&&(a.je=this.je.copy());a.Ur=this.Ur;return a};t=ml.prototype;t.freeze=function(){this.v=!0;null!==this.je&&this.je.freeze();return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;null!==this.je&&this.je.ea();return this};t.gb=function(a){a.classType===ml&&(this.type=a)}; +t.toString=function(){var a="Brush(";if(this.type===tl)a+=this.color;else if(a=this.type===wl?a+"Linear ":this.type===nl?a+"Radial ":this.type===vl?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.v&&wa(this);("number"!==typeof a||!isFinite(a)||1a)&&xa(a,"0 <= loc <= 1",ml,"addColorStop:loc");null===this.je&&(this.je=new I);this.je.add(a,b);this.ia===tl&&(this.type=wl);this.ke=null;return this}; +t.yA=function(a,b){this.v&&wa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?$l:b;if(this.type===tl)Ph(this.color),this.color=am(a,b);else if((this.type===wl||this.type===nl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Ph(c.value),this.addColorStop(c.key,am(a,b));return this};function bm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?$l:c;Ph(a);return am(b,c)} +t.Az=function(a,b){this.v&&wa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?$l:b;if(this.type===tl)Ph(this.color),this.color=am(-a,b);else if((this.type===wl||this.type===nl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Ph(c.value),this.addColorStop(c.key,am(-a,b));return this};function cm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?$l:c;Ph(a);return am(-b,c)} +function dm(a,b,c){Ph(a);a=em.j;var d=em.C,e=em.o,f=em.M;Ph(b);void 0===c&&(c=.5);return"rgba("+Math.round((em.j-a)*c+a)+", "+Math.round((em.C-d)*c+d)+", "+Math.round((em.o-e)*c+e)+", "+Math.round((em.M-f)*c+f)+")"} +t.jy=function(){if(this.type===tl)return fm(this.color);if((this.type===wl||this.type===nl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===nl)return fm(a.first().value);if(null!==a.get(.5))return fm(a.get(.5));if(2===a.count)return a=a.xa(),fm(dm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h=e&&hd&&(f=c,c=d,d=f,f=e);e=d-c;return fm(dm(a.get(c),a.get(d),1-f/e))}return!1}; +function fm(a){if(!a)return!1;if(a instanceof ml)return a.jy();Ph(a);return 128>(299*em.j+587*em.C+114*em.o)/1E3} +function am(a,b){switch(b){case $l:b=100*gm(em.j);var c=100*gm(em.C),d=100*gm(em.o);hm.j=.4124564*b+.3575761*c+.1804375*d;hm.C=.2126729*b+.7151522*c+.072175*d;hm.o=.0193339*b+.119192*c+.9503041*d;hm.M=em.M;b=im(hm.j/jm[0]);c=im(hm.C/jm[1]);d=im(hm.o/jm[2]);km.j=116*c-16;km.C=500*(b-c);km.o=200*(c-d);km.M=hm.M;km.j=Math.min(100,Math.max(0,km.j+100*a));a=(km.j+16)/116;b=a-km.o/200;hm.j=jm[0]*lm(km.C/500+a);hm.C=jm[1]*(km.j>mm*nm?Math.pow(a,3):km.j/mm);hm.o=jm[2]*lm(b);hm.M=km.M;a=-.969266*hm.j+1.8760108* +hm.C+.041556*hm.o;b=.0556434*hm.j+-.2040259*hm.C+1.0572252*hm.o;em.j=255*om((3.2404542*hm.j+-1.5371385*hm.C+-.4985314*hm.o)/100);em.C=255*om(a/100);em.o=255*om(b/100);em.M=hm.M;em.j=Math.round(em.j);255em.j&&(em.j=0);em.C=Math.round(em.C);255em.C&&(em.C=0);em.o=Math.round(em.o);255em.o&&(em.o=0);return"rgba("+em.j+", "+em.C+", "+em.o+", "+em.M+")";case pm:return Qh(),Rh.o=Math.min(100,Math.max(0,Rh.o+100*a)),"hsla("+Rh.j+", "+Rh.C+"%, "+Rh.o+"%, "+ +Rh.M+")";default:C("Unknown color space: "+b)}}function Ph(a){Yl||(Zl(),Yl=!0);var b=qm;if(null!==b){b.clearRect(0,0,1,1);b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;b.fillStyle!==c?(b.fillRect(0,0,1,1),a=b.getImageData(0,0,1,1).data,em.j=a[0],em.C=a[1],em.o=a[2],em.M=a[3]/255):(b.fillStyle="#FFFFFF",b.fillStyle=a,em.j=0,em.C=0,em.o=0,em.M=1)}} +function Qh(){var a=em.j/255,b=em.C/255,c=em.o/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}Rh.j=Math.round(g);Rh.C=Math.round(100*a);Rh.o=Math.round(100*e);Rh.M=em.M}function gm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function om(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} +function im(a){return a>nm?Math.pow(a,1/3):(mm*a+16)/116}function lm(a){var b=a*a*a;return b>nm?b:(116*a-16)/mm}function Nl(a,b){"string"!==typeof a&&(a instanceof ml||C("Value for "+b+" must be a color string or a Brush, not "+a))}function Zl(){qm=Jg?(new Ak(null)).context:null} +na.Object.defineProperties(ml.prototype,{type:{get:function(){return this.ia},set:function(a){this.v&&wa(this,a);this.ia=a;this.start.wc()&&(a===wl?this.start=vc:a===nl&&(this.start=yc));this.end.wc()&&(a===wl?this.end=Bc:a===nl&&(this.end=yc));this.ke=null}},color:{get:function(){return this.Ok},set:function(a){this.v&&wa(this,a);this.Ok=a;this.ke=null}},start:{get:function(){return this.zd},set:function(a){this.v&& +wa(this,a);this.zd=a.I();this.ke=null}},end:{get:function(){return this.bl},set:function(a){this.v&&wa(this,a);this.bl=a.I();this.ke=null}},startRadius:{get:function(){return this.js},set:function(a){this.v&&wa(this,a);0>a&&xa(a,">= zero",ml,"startRadius");this.js=a;this.ke=null}},endRadius:{get:function(){return this.jr},set:function(a){this.v&&wa(this,a);0>a&&xa(a,">= zero",ml,"endRadius");this.jr=a;this.ke= +null}},colorStops:{get:function(){return this.je},set:function(a){this.v&&wa(this,a);this.je=a;this.ke=null}},pattern:{get:function(){return this.Ur},set:function(a){this.v&&wa(this,a);this.Ur=a;this.ke=null}}});ml.prototype.isDark=ml.prototype.jy;ml.prototype.darkenBy=ml.prototype.Az;ml.prototype.lightenBy=ml.prototype.yA;ml.prototype.addColorStop=ml.prototype.addColorStop; +var nm=216/24389,mm=24389/27,jm=[95.047,100,108.883],qm=null,em=new Xl,Rh=new Xl,hm=new Xl,km=new Xl,Yl=!1;ml.className="Brush";var tl;ml.Solid=tl=new D(ml,"Solid",0);var wl;ml.Linear=wl=new D(ml,"Linear",1);var nl;ml.Radial=nl=new D(ml,"Radial",2);var vl;ml.Pattern=vl=new D(ml,"Pattern",4);var $l;ml.Lab=$l=new D(ml,"Lab",5);var pm;ml.HSL=pm=new D(ml,"HSL",6); +ml.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}; +ml.isValidColor=function(a){if("black"===a)return!0;if(""===a)return!1;Yl||(Zl(),Yl=!0);var b=qm;if(null===b)return!0;b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;if(b.fillStyle!==c)return!0;b.fillStyle="#FFFFFF";c=b.fillStyle;b.fillStyle=a;return b.fillStyle!==c};ml.lighten=function(a){return bm(a)};ml.lightenBy=bm;ml.darken=function(a){return cm(a)};ml.darkenBy=cm;ml.mix=dm;ml.isDark=fm;function Kl(){this.na="Base"}Kl.prototype.measure=function(){}; +Kl.prototype.BA=function(a,b,c,d,e){a.measure(b,c,d,e)};Kl.prototype.arrange=function(){};Kl.prototype.nz=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Kl.prototype.LA=function(a){a.mk()};Kl.prototype.lc=function(){};na.Object.defineProperties(Kl.prototype,{name:{get:function(){return this.na},set:function(a){this.na=a}},classType:{get:function(){return X}}});Kl.prototype.remeasureObject=Kl.prototype.LA;Kl.prototype.arrangeElement=Kl.prototype.nz; +Kl.prototype.measureElement=Kl.prototype.BA;Kl.className="PanelLayout";function rm(){this.na="Base"}ma(rm,Kl); +rm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=sm(a);for(var k=0;kS&&(Ha=Math.max(S-tc,0));var fg=0===H.ga;H.$b=H.$b+Ha;H.actual=H.ga+Ha;S=Math.max(S-(Ha+(fg?tc:0)),0)}if(1===sb.columnSpan&&(eb===og|| +eb===Wk)){H=a.getColumnDefinition(Rb);var rh=H.Fc();Ha=Math.max(kc-H.actual,0);Ha+rh>K&&(Ha=Math.max(K-rh,0));var wn=0===H.ga;H.$b=H.$b+Ha;H.actual=H.ga+Ha;K=Math.max(K-(Ha+(wn?rh:0)),0)}he&&sb.mk()}}}}}Ia(z);var Gd=0,ie=0;f=a.columnCount;for(var gg=0;gg=a.rowCount);Cf++)H=a.getRowDefinition(Na.row+Cf),Ha=0,Ha=eb===sd||eb===Wk?Math.max(H.minimum,0===ke[Na.row+Cf]?H.maximum:Math.min(ke[Na.row+Cf],H.maximum)):Math.max(H.minimum,isNaN(H.rc)?H.maximum:Math.min(H.rc,H.maximum)),Qc.height+=Ha,Ld+=H.minimum;for(var nd=1;nd=a.columnCount);nd++)H=a.getColumnDefinition(Na.column+ +nd),Ha=0,Ha=eb===sd||eb===Vk?Math.max(H.minimum,0===md[Na.column+nd]?H.maximum:Math.min(md[Na.column+nd],H.maximum)):Math.max(H.minimum,isNaN(H.rc)?H.maximum:Math.min(H.rc,H.maximum)),Qc.width+=Ha,vh+=H.minimum;bb.width+=Qc.width;bb.height+=Qc.height;var Df=Na.margin,zi=Df.right+Df.left,me=Df.top+Df.bottom;Na.measure(bb.width,bb.height,vh,Ld);for(var ig=Na.measuredBounds,Ef=Math.max(ig.width+zi,0),Ai=Math.max(ig.height+me,0),Ze=0,Zc=0;Zc=a.rowCount);Zc++)H=a.getRowDefinition(Na.row+ +Zc),Ze+=H.total||0;if(Ze=od)&&!(Na.row+ne>=a.rowCount);ne++){H=a.getRowDefinition(Na.row+ne);var zd=H.ga||0,fk=Gf(Na,H,Ff);H.actual=Math.min(H.maximum,zd+fk);H.ga!==zd&&(od-=H.ga-zd)}for(;0Ge&&(H.actual=Math.min(H.maximum,Ge+od),H.ga!==Ge&&(od-=H.ga-Ge));if(0===H.index)break;H=a.getRowDefinition(H.index-1)}}for(var wh=0,xh=0;xh=a.columnCount);xh++)H=a.getColumnDefinition(Na.column+xh),wh+=H.total||0;if(wh=$c)&&!(Na.column+yh>=a.columnCount);yh++){H=a.getColumnDefinition(Na.column+yh);var yn=H.ga||0,Wt=xn(Na,H,Bi);H.actual=Math.min(H.maximum,yn+Wt);H.ga!==yn&&($c-=H.ga-yn)}for(;0<$c;){var gk=H.ga||0;isNaN(H.width)&&H.maximum>gk&&(H.actual=Math.min(H.maximum,gk+$c),H.ga!==gk&&($c-=H.ga-gk));if(0=== +H.index)break;H=a.getColumnDefinition(H.index-1)}}}}Ia(y);M.free(Qc);M.free(bb);void 0!==ke&&Ia(ke);void 0!==md&&Ia(md);var jg=0,kg=0,hk=a.desiredSize,fr=a.maxSize;eb=hl(a,!0);var Ci=ie=Gd=0,Di=0;f=a.columnCount;for(var ik=0;ik=a.rowCount);R++){var O=a.getRowDefinition(v+ +R);0!==O.ga&&(u.height+=O.total)}for(R=1;R=a.columnCount);R++)O=a.getColumnDefinition(z+R),0!==O.ga&&(u.width+=O.total);var H=y.ga+u.width,da=w.ga+u.height;R=h;O=k;var ba=H,ra=da,Ca=h,cb=k,db=H,Ha=da;h+H>c.width&&(db=Math.max(c.width-h,0));k+da>c.height&&(Ha=Math.max(c.height-k,0));var zb=K.alignment;if(zb.Lb()){zb=a.defaultAlignment;zb.hb()||(zb=yc);var Db=zb.x;var Yc=zb.y;var Rb=zb.offsetX;zb=zb.offsetY;var jc=y.alignment,Ec=w.alignment;jc.hb()&&(Db=jc.x,Rb=jc.offsetX);Ec.hb()&& +(Yc=Ec.y,zb=Ec.offsetY)}else Db=zb.x,Yc=zb.y,Rb=zb.offsetX,zb=zb.offsetY;if(isNaN(Db)||isNaN(Yc))Yc=Db=.5,zb=Rb=0;jc=S.width;Ec=S.height;var ge=K.margin,xf=ge.left+ge.right,sb=ge.top+ge.bottom,he=Al(K,w,y,!1);!isNaN(K.desiredSize.width)||he!==sd&&he!==Vk||(jc=Math.max(H-xf,0));!isNaN(K.desiredSize.height)||he!==sd&&he!==Wk||(Ec=Math.max(da-sb,0));H=K.maxSize;da=K.minSize;jc=Math.min(H.width,jc);Ec=Math.min(H.height,Ec);jc=Math.max(da.width,jc);Ec=Math.max(da.height,Ec);H=Ec+sb;R+=ba*Db-(jc+xf)*Db+ +Rb+ge.left;O+=ra*Yc-H*Yc+zb+ge.top;K.visible&&(ac(Ca,cb,db,Ha,R,O,S.width,S.height)?K.arrange(R,O,jc,Ec):K.arrange(R,O,jc,Ec,new N(Ca,cb,db,Ha)))}}M.free(u);for(a=0;a=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin,p=n.x;n=n.y;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();for(var r=[],q=a.T.m,u=q.length,v=0;vy)){w=Rj(w.figure);for(var A=0;Ay&&z.push(B))}}}}q= +a.T.m;u=q.length;for(v=0;ve*w*c))){y=F.segmentIndex;if(!isFinite(y)||isNaN(y))y=0;0>y&&(y=w-Math.min(-y,w));y=Math.round(y%w);w=F.opacity;A=1;if(1!==w){if(0===w)continue;A=b.globalAlpha;b.globalAlpha=A*w}B=r[v];var K=!1,S=F.strokeDashArray;null!==S&&(K=!0,b.As(S,F.strokeDashOffset));if("LineV"===F.figure&&null!==F.stroke&&0b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;en)z.measure(Infinity,Infinity,0,0),y=z.measuredBounds,b.Nc(y),q.push(y);else{var A=z.segmentIndex,B=z.segmentFraction,F=z.alignmentFocus;F.wc()&&(F=yc);var K=z.segmentOrientation,S=z.segmentOffset;if(isNaN(A)){var R=h.ma;y=Fa();R.vv(B,y);var O=J.allocAt(y[0],y[1]);O.add(h.i(0)); +R.type===Q.j?O.offset(-R.startX,-R.startY):(R=R.figures.first(),null!==R&&O.offset(-R.startX,-R.startY));R=y[2];if(K!==Vf){var H=h.computeAngle(z,K,R);z.xb=H}H=O.x-l.x;var da=O.y-l.y;J.free(O);Ia(y)}else if(A<-n||A>=n)y=J.alloc(),h.pg(),h.computeMidPoint(y),R=h.midAngle,K!==Vf&&(H=h.computeAngle(z,K,R),z.xb=H),H=y.x-l.x,da=y.y-l.y,J.free(y);else{H=0;0<=A?(da=m.J(A),y=Aba+10?0<=A?R.Oa(da):da.Oa(R):ba>O+10?0<=A?y.Oa(H):H.Oa(y):0<=A?R.Oa(H):H.Oa(R)}else R=0<=A?da.Oa(y):y.Oa(da);K!==Vf&&(H=h.computeAngle(z,K,R),z.xb=H);H=da.x+(y.x-da.x)*B-l.x;da=da.y+(y.y-da.y)*B-l.y}z.measure(Infinity,Infinity,0,0);y=z.measuredBounds;O=z.naturalBounds;var ra=0;z instanceof uf&&(ra=z.strokeWidth);ba=O.width+ra;var Ca=O.height+ra;g.reset();g.translate(-y.x,-y.y);g.scale(z.scale,z.scale);g.rotate(K===Vf?z.angle:R,ba/2,Ca/2);K!==Km&&K!== +Lm||g.rotate(90,ba/2,Ca/2);K!==Mm&&K!==Nm||g.rotate(-90,ba/2,Ca/2);K===Om&&(45R||225R)&&g.rotate(-R,ba/2,Ca/2);O=new N(0,0,ba,Ca);u.Ui(O,F);g.ya(u);F=-u.x+ra/2*z.scale;z=-u.y+ra/2*z.scale;v.assign(S);ra=isNaN(S.x);var cb=isNaN(S.y);if(ra||cb){ba=ba/2+3;Ca=Ca/2+3;var db=45<=R&&135>=R,Ha=225<=R&&315>=R;K===Vf&&(db||Ha)?(v.x=cb?ba:S.y,v.y=ra?Ca:S.x,db?0<=A||isNaN(A)&&.5>B||!ra||(v.y=-Ca):Ha&&((0<=A||isNaN(A)&&.5>B)&&ra&&(v.y=-Ca),cb&&(v.x=-ba))):(ra&&(v.x=0<=A||isNaN(A)&&.5>B?ba:-ba), +cb&&(v.y=-Ca),v.rotate(R))}else v.rotate(R);H+=v.x;da+=v.y;O.set(y);O.h(H+F,da+z,y.width,y.height);q.push(O);b.Nc(O)}}if(null!==f)for(d=f.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.dg=b;a=a.location;a.h(a.x+b.x,a.y+b.y);Tb(e,b.width||0,b.height||0);qd.free(g);J.free(u);J.free(v)}}}}; +Im.prototype.arrange=function(a,b){var c=b.length;if(a instanceof we||a instanceof U){var d=a,e=null;a instanceof we&&(e=a,d=e.adornedPart);var f=a instanceof we?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h=c)q=J.alloc(),r=n,v=q,r.pg(),r.computeMidPoint(v),r=n.midAngle,l!==Vf&&(n=n.computeAngle(g,l,r),g.angle=n),n=q.x,v=q.y, +J.free(q);else{u=0;0<=h?(q=b.m[h],v=hz+10?0<=h?r.Oa(q):q.Oa(r):z>w+10?0<=h?v.Oa(u):u.Oa(v):0<=h?r.Oa(u):u.Oa(r)}else r=0<=h?q.Oa(v):v.Oa(q);l!==Vf&&(n=n.computeAngle(g,l,r),g.angle=n);n=q.x+(v.x-q.x)*k;v=q.y+(v.y-q.y)*k}if(p.Qs())g.location=new J(n,v);else{p.wc()&&(p=yc);q=qd.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle, +0,0);var y=g.naturalBounds;u=N.allocAt(0,0,y.width,y.height);w=J.alloc();w.Ui(u,p);q.ya(w);p=-w.x;z=-w.y;var A=y.width,B=y.height;y=J.alloc();y.assign(m);var F=isNaN(m.x),K=isNaN(m.y);if(F||K){A=A/2+3;B=B/2+3;var S=45<=r&&135>=r,R=225<=r&&315>=r;l===Vf&&(S||R)?(y.x=K?A:m.y,y.y=F?B:m.x,S?0<=h||isNaN(h)&&.5>k||!F||(y.y=-B):R&&((0<=h||isNaN(h)&&.5>k)&&F&&(y.y=-B),K&&(y.x=-A))):(F&&(y.x=0<=h||isNaN(h)&&.5>k?A:-A),K&&(y.y=-B),y.rotate(r))}else y.rotate(r);n+=y.x;v+=y.y;q.Jq(u);p+=u.x;z+=u.y;h=J.allocAt(n+ +p,v+z);g.move(h);J.free(h);J.free(y);J.free(w);N.free(u);qd.free(q)}}null!==e?e.sk(!1):d.sk(!1)}}; +function Jm(a,b,c,d){if(!1!==mj(d)){var e=d.strokeWidth;0===e&&a instanceof we&&a.type===X.Link&&a.adornedObject instanceof uf&&(e=a.adornedObject.strokeWidth);e*=d.sa;a instanceof U&&null!==a.ma?(a=a.ma.bounds,d.ue(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof we&&null!==a.adornedPart.ma?(a=a.adornedPart.ma.bounds,d.ue(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.ue(-(e/2),-(e/2),b+e,c+e);hj(d,!1)}}function Pm(){this.na="Base"}ma(Pm,Kl); +Pm.prototype.measure=function(a,b,c,d,e,f,g){var h=a.nb();a.Kg=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new N(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.Kg.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,v=r.flattenedLengths,w=r.flattenedTotalLength,z=u.length,y=0,A=0,B=Fa(),F=0;Fba&&(ba+=360);S.push(ba)}y=H;A=da}B.push(S)}if(null===a.Nf){for(var ra=[],Ca=a.T.m,cb=Ca.length,db=0;dbDb))for(var Yc=0;YcDb&&zb.push(jc)}}}}a.Nf=ra}var Ec=a.Nf;var ge=a.T.m,xf=ge.length,sb=0,he=0,dg=w;a.tj=[];for(var ph,qh=0;qhbk*ti*w/a.graduatedRange)){var eg=v[0][0],ld=0,kc=0;he=w*eb.graduatedStart-1E-4;dg=w*eb.graduatedEnd+1E-4;var yf=bk*ti,tc=a.graduatedTickBase;if(tca.graduatedMin+yf&&(tc-=Math.floor((tc-a.graduatedMin)/yf)*yf);for(var rh=Ec[qh],wn=tc,Gd=1;tcw&&(sb=w),he<=sb&&sb<=dg)){for(var Hd=B[ld][kc],yd=v[ld][kc];ldeg&&kcec&&.4995ec?0ec||.9995vi){var ck=1-Math.abs(.5-ec);Hd=(je*ck+Pc*(1-ck))%360;break a}}}Hd=je}if(eb instanceof Lg){var Id="";null!== +eb.graduatedFunction?(Id=eb.graduatedFunction(tc),Id=null!==Id&&void 0!==Id?Id.toString():""):Id=(+tc.toFixed(2)).toString();""!==Id&&ph.push({tm:ui,angle:Hd,text:Id})}else ph.push({tm:ui,angle:Hd})}tc=wn+Gd*yf}}}a.tj.push(ph)}Ia(B);var uh=a.tj;if(null!==uh)for(var zf=d.length,bb=0;bbBf;Bf++){switch(Bf){case 0:fc.h(Xe,Ye);break;case 1:fc.h(Xe+wi,Ye);break;case 2:fc.h(Xe,Ye+xi);break;case 3:fc.h(Xe+wi,Ye+xi)}fc.rotate(ek+Eb.angle);fc.offset(dk,Af);0===md&&0===Bf?Qc.h(fc.x,fc.y,0,0):Qc.Le(fc);fc.offset(-dk,-Af);fc.rotate(-ek-Eb.angle)}J.free(fc);null!==lc.Kg&& +lc.Kg.push(Qc);$b(uc,Qc.x,Qc.y,Qc.width,Qc.height)}else if(Eb instanceof Lg){var Na=a,Kd=e;null===Na.mh&&(Na.mh=new Lg);var qb=Na.mh;Qm(qb,Eb);var vh=Eb.alignmentFocus;vh.wc()&&(vh=vc);for(var Ld=Eb.segmentOrientation,Cf=Eb.segmentOffset,nd=new N,Df=0,zi=0,me=0,ig=0,Ef=0,Ai=Fb.length,Ze=0;Zeme||225me)&&zd.rotate(-me,Gf/2,ne/2);var fk=N.allocAt(0,0,Gf,ne),Ge=J.alloc();Ge.Ui(fk,vh);zd.ya(Ge);var wh=-Ge.x,xh=-Ge.y,$c=J.alloc();$c.assign(Cf);isNaN($c.x)&&($c.x=Gf/2+3);isNaN($c.y)&&($c.y=-(ne/2+3));$c.rotate(me); +Df+=$c.x+wh;zi+=$c.y+xh;var Bi=new N(Df,zi,od.width,od.height),xn=new N(od.x,od.y,od.width,od.height),yh=new N(Ff.x,Ff.y,Ff.width,Ff.height);Zc.wA=ig;Zc.lineCount=qb.lineCount;Zc.lines=[qb.qb,qb.di,qb.oe,qb.ze,qb.zc,qb.Pb,qb.me];Zc.actualBounds=Bi;Zc.measuredBounds=xn;Zc.naturalBounds=yh;0===Ze?nd.assign(Bi):nd.Nc(Bi);J.free($c);J.free(Ge);N.free(fk);qd.free(zd)}null!==Na.Kg&&Na.Kg.push(nd);$b(Kd,nd.x,nd.y,nd.width,nd.height)}hj(Eb,!1)}}}; +Pm.prototype.arrange=function(a,b,c){if(null!==a.Kg){var d=a.nb(),e=a.tj;if(null!==e){var f=a.Kg,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=e&&(e=1);for(var g=f.actualBounds,h=a.T.m,k=a.tj,l=h.length,m=0;ma.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e)){var q=n.measuredBounds,u=n.strokeWidth*n.scale,v=n.alignmentFocus;v.wc()&& +(v=vc);for(var w=0;wf.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.Bg:a.Ag);var n=l.separatorStroke;null===n&&(n=c?a.Vh:a.zg);if(0!==m&&null!==n){bi(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null===p&&(p=c?a.Uh:a.Th);null!==p&&(n=!0,b.As(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.mb;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.ys()}}}} +function Vm(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=Xm(a,!0),l=Xm(a,!1),m=0;mp)){var r=n.Fc(),q=n.separatorStrokeWidth;isNaN(q)&&(q=c?a.Bg:a.Ag);var u=n.separatorStroke;null===u&&(u=c?a.Vh:a.zg);if(null===u||n.index===(c?k:l))q=0;r-=q;q=n.position+q;r+=n.actual;q+r>p&&(r=p-q);0>=r||(p=a.mb,bi(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left, +q+p.top,g.width-(p.left+p.right),r):b.fillRect(q+p.left,p.top,r,g.height-(p.top+p.bottom)))}}}}function Xm(a,b){for(var c=b?a.Db.length:a.yb.length,d=0;dd&&e.set(q),J.free(q));J.free(m);f&&e.transform(g);return l}; +t.s=function(a){if(!mj(this)){Y.prototype.s.call(this,a);a=null;if(this.ia===X.Auto||this.ia===X.Link)a=this.nb();for(var b=this.T.m,c=b.length,d=0;dc||f>d)this.s(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case sd:this.s(!0);this.measure(c+h,d+g,0,0);break;case Vk:this.s(!0);this.measure(c+h,f+g,0,0);break;case Wk:this.s(!0),this.measure(b+h,d+g,0,0)}}this.ia.arrange(this,e,this.dg)}}; +t.xh=function(a){var b=this.naturalBounds,c=sm(this);if(ac(0,0,b.width,b.height,a.x,a.y)){b=this.T.m;for(var d=b.length,e=J.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Ab(e.set(a),f.transform),f.$(e))return J.free(e),!0}J.free(e);return null===this.Rb&&null===this.fd?!1:!0}return!1};t.Bs=function(a){if(this.Mk===a)return this;for(var b=this.T.m,c=b.length,d=0;dp.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof X?m:null;p=qd.alloc();p.set(g); +if(null!==m?m.vf(a,b,c,d,e,p):gl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);qd.free(p)}}}void 0===f&&qd.free(g);return d}void 0===f&&qd.free(g);return!1};function dn(a,b,c,d){for(var e=a.T.m,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&&dn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} +t.kg=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.he(),k=h?a:Ab(J.allocAt(a.x,a.y),this.transform),l=h?b:Ab(J.allocAt(b.x,b.y),this.transform),m=k.tf(l),n=0v.width||u.y>v.height||0>u.x+u.width||0>u.y+u.height))if(q.he()?(u=q.transform,Ab(k.set(a),u),Ab(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof X?q:null,null!==q?q.kg(k,l,c,d,e,f):u.Ux(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}J.free(k);J.free(l)}return e?n:g}return!1}; +function ym(a){var b=null;a instanceof uf&&(b=a.spot1,b===Vc&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=sc);return b}function zm(a){var b=null;a instanceof uf&&(b=a.spot2,b===Vc&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Cc);return b}t.add=function(a){for(var b=[],c=0;c=e.count&&a>=e.count)return; +e.eb(f);d=f}else C("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.ub(a,b);if(0===a||b.isPanelMain)this.lh=null;mj(this)||this.s();b.s(!1);null!==b.portId?this.Ge=!0:b instanceof X&&!0===b.Ge&&(this.Ge=!0);this.Nf=null;this.Af()||en(this,b,!1);c=this.part;null!==c&&(c.li=null,c.Sf=NaN,this.Ge&&c instanceof W&&(c.Ge=!0),c.Ge&&c instanceof W&&(c.kc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&&c.Va(fe,"elements", +this,b,null,d,null),c.Va(ee,"elements",this,null,b,null,a)))};function fn(a,b){a.G=b?a.G|16777216:a.G&-16777217}t.remove=function(a){for(var b=this.T.m,c=b.length,d=-1,e=0;ea&&xa(a,">= 0",X,"getRowDefinition:idx");a=Math.round(a);var b=this.Db;if(void 0===b)return null;if(void 0===b[a]){var c=new Nj;c.Ti(this);c.isRow=!0;c.index=a;b[a]=c;this.Va(ee,"rowdefs",this,null,c,null,a)}return b[a]}; +X.prototype.RA=function(a){0>a&&xa(a,">= 0",X,"removeRowDefinition:idx");a=Math.round(a);var b=this.Db;if(void 0!==b){var c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.Va(fe,"rowdefs",this,c,null,a,null);this.s()}}};function Oj(a,b,c){var d=a.Db;if(d&&!(0>b)){d[b]=c instanceof Nj?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.s()}} +X.prototype.getColumnDefinition=function(a){0>a&&xa(a,">= 0",X,"getColumnDefinition:idx");a=Math.round(a);var b=this.yb;if(void 0===b)return null;if(void 0===b[a]){var c=new Nj;c.Ti(this);c.isRow=!1;c.index=a;b[a]=c;this.Va(ee,"coldefs",this,null,c,null,a)}return b[a]};t=X.prototype; +t.MA=function(a){0>a&&xa(a,">= 0",X,"removeColumnDefinition:idx");a=Math.round(a);var b=this.yb;if(void 0!==b){var c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.Va(fe,"coldefs",this,c,null,a,null);this.s()}}};function Pj(a,b,c){var d=a.yb;if(d&&!(0>b)){d[b]=c instanceof Nj?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.s()}} +t.Tz=function(a){if(0>a||this.type!==X.Table)return-1;for(var b=0,c=this.Db,d=c.length,e=this.wi;ea||this.type!==X.Table)return-1;for(var b=0,c=this.yb,d=c.length,e=this.fi;ea;)this.bc(this.T.length-1,!1);jn(this,this.itemArray)}; +function jn(a,b){var c=bn(a);if(null===b||0===b.length)for(;a.T.length>c;)a.bc(a.T.length-1,!1);else if(a.T.length<=c){c=b.length;for(var d=0;dc)){var e=ln(a,b);e=mn(a,e);if(null!==e){ng(e);e=e.copy();if(0!==(e.G&16777216)){var f=a.yh();null!==f&&fn(f,!0)}"object"===typeof b&&(null===a.Xd&&(a.Xd=new I),a.Xd.add(b,e));f=c+bn(a);a.ub(f,e);d&&(e.ib=b,nn(a,f,c),e.ib=null);e.data=b}}} +function nn(a,b,c){for(a=a.T;ba&&xa(a,">= 0",X,"padding"),a=new ic(a)):(0>a.left&&xa(a.left,">= 0",X,"padding:value.left"),0>a.right&&xa(a.right,">= 0",X,"padding:value.right"),0>a.top&&xa(a.top,">= 0",X,"padding:value.top"),0>a.bottom&&xa(a.bottom,">= 0",X,"padding:value.bottom"));var b=this.mb;b.A(a)||(this.mb=a=a.I(),this.s(),this.g("padding",b,a))}},defaultAlignment:{get:function(){return this.wn},set:function(a){var b=this.wn;b.A(a)||(this.wn=a=a.I(),this.s(),this.g("defaultAlignment", +b,a))}},defaultStretch:{get:function(){return this.Kf},set:function(a){var b=this.Kf;b!==a&&(this.Kf=a,this.s(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{get:function(){return void 0===this.oj?pc:this.oj},set:function(a){if(void 0!==this.oj){"number"===typeof a&&(a=new ic(a));var b=this.oj;b.A(a)||(this.oj=a=a.I(),this.s(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{get:function(){return void 0=== +this.Vh?null:this.Vh},set:function(a){var b=this.Vh;b!==a&&(null===a||"string"===typeof a||a instanceof ml)&&(a instanceof ml&&a.freeze(),this.Vh=a,this.N(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return void 0===this.Bg?1:this.Bg},set:function(a){if(void 0!==this.Bg){var b=this.Bg;b!==a&&isFinite(a)&&0<=a&&(this.Bg=a,this.s(),this.g("defaultRowSeparatorStrokeWidth",b,a))}}},defaultRowSeparatorDashArray:{ +get:function(){return void 0===this.Uh?null:this.Uh},set:function(a){if(void 0!==this.Uh){var b=this.Uh;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea)&&C("Panel.topIndex must be greater than zero and a real number, not: "+a),this.wi=a,this.s(), +this.g("topIndex",b,a))}}},leftIndex:{get:function(){return void 0===this.fi?0:this.fi},set:function(a){if(void 0!==this.fi){var b=this.fi;b!==a&&((!isFinite(a)||0>a)&&C("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.fi=a,this.s(),this.g("leftIndex",b,a))}}},data:{get:function(){return this.ib},set:function(a){var b=this.ib;if(b!==a){var c=this instanceof V&&!(this instanceof we);ng(this);this.ib=a;var d=this.diagram; +null!==d&&(c?(c=d.partManager,this instanceof U?(null!==b&&c.Qe.remove(b),null!==a&&c.Qe.add(a,this)):this instanceof V&&(null!==b&&c.Re.remove(b),null!==a&&c.Re.add(a,this))):(c=this.panel,null!==c&&null!==c.Xd&&(null!==b&&c.Xd.remove(b),null!==a&&c.Xd.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Da()}}},itemIndex:{get:function(){return this.oo},set:function(a){var b=this.oo;b!==a&&(this.oo=a,this.g("itemIndex",b,a))}},itemArray:{ +get:function(){return this.bi},set:function(a){var b=this.bi;if(b!==a||null!==a&&hn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Ej(c.partManager,this,c),this.bi=a,null!==c&&null!==a&&Bj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||jn(this,a)}}},itemTemplate:{get:function(){return null===this.se?null:this.se.H("")},set:function(a){if(null===this.se){if(null===a)return;this.se=new I}var b=this.se.H(""); +b!==a&&((a instanceof V||a.isPanelMain)&&C("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.se.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.Ov())}},itemTemplateMap:{get:function(){return this.se},set:function(a){var b=this.se;if(b!==a){for(var c=a.iterator;c.next(););this.se=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.Ov()}}},itemCategoryProperty:{ +get:function(){return this.pl},set:function(a){var b=this.pl;b!==a&&(this.pl=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{get:function(){return 0!==(this.G&1048576)},set:function(a){var b=0!==(this.G&1048576);b!==a&&(this.G^=1048576,this.g("isAtomic",b,a))}},isClipping:{get:function(){return 0!==(this.G&2097152)},set:function(a){var b=0!==(this.G&2097152);b!==a&&(this.G^=2097152,this instanceof hf&&(this.$a=null),this.s(), +this.g("isClipping",b,a))}},isOpposite:{get:function(){return 0!==(this.G&33554432)},set:function(a){var b=0!==(this.G&33554432);b!==a&&(this.G^=33554432,this.s(),this.g("isOpposite",b,a))}},isEnabled:{get:function(){return 0!==(this.G&4194304)},set:function(a){var b=0!==(this.G&4194304);if(b!==a){var c=null===this.panel||this.panel.Af();this.G^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&en(this, +this,a)}}},alignmentFocusName:{get:function(){return this.Oe},set:function(a){var b=this.Oe;b!==a&&(this.Oe=a,this.s(),this.g("alignmentFocusName",b,a))}}}); +na.Object.defineProperties(X,{Position:{get:function(){return Jl.H("Position")}},Horizontal:{get:function(){return Jl.H("Horizontal")}},Vertical:{get:function(){return Jl.H("Vertical")}},Spot:{get:function(){return Jl.H("Spot")}},Auto:{get:function(){return Jl.H("Auto")}},Table:{get:function(){return Jl.H("Table")}},Viewbox:{ +get:function(){return Jl.H("Viewbox")}},TableRow:{get:function(){return Jl.H("TableRow")}},TableColumn:{get:function(){return Jl.H("TableColumn")}},Link:{get:function(){return Jl.H("Link")}},Grid:{get:function(){return Jl.H("Grid")}},Graduated:{get:function(){return Jl.H("Graduated")}}});X.prototype.rebuildItemElements=X.prototype.Ov; +X.prototype.findItemPanelForData=X.prototype.Tx;X.prototype.updateTargetBindings=X.prototype.Da;X.prototype.copyTemplate=X.prototype.yz;X.prototype.graduatedValueForPoint=X.prototype.kA;X.prototype.graduatedPointForValue=X.prototype.jA;X.prototype.findColumnForLocalX=X.prototype.Lz;X.prototype.findRowForLocalY=X.prototype.Tz;X.prototype.removeColumnDefinition=X.prototype.MA;X.prototype.removeRowDefinition=X.prototype.RA;X.prototype.removeAt=X.prototype.eb;X.prototype.remove=X.prototype.remove; +X.prototype.insertAt=X.prototype.ub;X.prototype.elt=X.prototype.J;X.prototype.add=X.prototype.add;X.prototype.findObject=X.prototype.Ya;X.prototype.findInVisualTree=X.prototype.hm;X.prototype.walkVisualTreeFrom=X.prototype.Mm;X.prototype.findMainElement=X.prototype.nb;var pn=!1,qn=null,Jl=new I;X.className="Panel";X.definePanelLayout=rn;rn("Position",new rm);rn("Vertical",new um);rn("Auto",new xm);rn("Link",new Im); +function Nj(){Ta(this);this.Xf=null;this.Br=!0;this.Qa=0;this.rc=NaN;this.Ij=0;this.Hj=Infinity;this.wb=Vc;this.ka=this.$b=this.ga=0;this.fb=null;this.Cp=sn;this.Be=Uk;this.xp=this.$f=null;this.yp=NaN;this.Rb=this.Tj=null;this.sn=!1} +Nj.prototype.copy=function(){var a=new Nj;a.Br=this.Br;a.Qa=this.Qa;a.rc=this.rc;a.Ij=this.Ij;a.Hj=this.Hj;a.wb=this.wb;a.ga=this.ga;a.$b=this.$b;a.ka=this.ka;a.Be=this.Be;a.Cp=this.Cp;null===this.$f?a.$f=null:a.$f=this.$f.I();a.xp=this.xp;a.yp=this.yp;a.Tj=null;null!==this.Tj&&(a.separatorDashArray=Ba(this.separatorDashArray));a.Rb=this.Rb;a.sn=this.sn;a.fb=this.fb;return a};t=Nj.prototype;t.gb=function(a){a.classType===Nj&&(this.sizing=a)}; +t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+gb(this)};t.Ti=function(a){this.Xf=a}; +t.cq=function(a){var b=0,c=this.Xf;this.index!==a&&(a=this.separatorStroke,null===a&&null!==c&&(a=this.isRow?c.defaultRowSeparatorStroke:c.defaultColumnSeparatorStroke),null!==a&&(b=this.separatorStrokeWidth,isNaN(b)&&(null!==c?b=this.isRow?c.defaultRowSeparatorStrokeWidth:c.defaultColumnSeparatorStrokeWidth:b=0)));a=this.$f;if(null===a)if(null!==c)a=c.defaultSeparatorPadding;else return b;return b+(this.isRow?a.top:a.left)}; +t.Fc=function(){var a=0,b=this.Xf,c=0,d=this.isRow;if(null!==b&&b.type===X.Table)for(var e=d?b.Db.length:b.yb.length,f=0;fa&&xa(a,">= 0",Nj,"height"),this.rc=a,this.actual=this.ga,null!==this.panel&&this.panel.s(), +this.Cb("height",b,a))}},width:{get:function(){return this.rc},set:function(a){var b=this.rc;b!==a&&(0>a&&xa(a,">= 0",Nj,"width"),this.rc=a,this.actual=this.ga,null!==this.panel&&this.panel.s(),this.Cb("width",b,a))}},minimum:{get:function(){return this.Ij},set:function(a){var b=this.Ij;b!==a&&((0>a||!isFinite(a))&&xa(a,">= 0",Nj,"minimum"),this.Ij=a,this.actual=this.ga,null!==this.panel&&this.panel.s(),this.Cb("minimum",b,a))}},maximum:{ +get:function(){return this.Hj},set:function(a){var b=this.Hj;b!==a&&(0>a&&xa(a,">= 0",Nj,"maximum"),this.Hj=a,this.actual=this.ga,null!==this.panel&&this.panel.s(),this.Cb("maximum",b,a))}},alignment:{get:function(){return this.wb},set:function(a){var b=this.wb;b.A(a)||(this.wb=a.I(),null!==this.panel&&this.panel.s(),this.Cb("alignment",b,a))}},stretch:{get:function(){return this.Be},set:function(a){var b=this.Be;b!==a&&(this.Be= +a,null!==this.panel&&this.panel.s(),this.Cb("stretch",b,a))}},separatorPadding:{get:function(){return this.$f},set:function(a){"number"===typeof a&&(a=new ic(a));var b=this.$f;null!==a&&null!==b&&b.A(a)||(null!==a&&(a=a.I()),this.$f=a,null!==this.panel&&this.panel.s(),this.Cb("separatorPadding",b,a))}},separatorStroke:{get:function(){return this.xp},set:function(a){var b=this.xp;b!==a&&(null!==a&&Nl(a,"RowColumnDefinition.separatorStroke"), +a instanceof ml&&a.freeze(),this.xp=a,null!==this.panel&&this.panel.s(),this.Cb("separatorStroke",b,a))}},separatorStrokeWidth:{get:function(){return this.yp},set:function(a){var b=this.yp;b!==a&&(this.yp=a,null!==this.panel&&this.panel.s(),this.Cb("separatorStrokeWidth",b,a))}},separatorDashArray:{get:function(){return this.Tj},set:function(a){var b=this.Tj;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ee)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,v=Fa(),w=2;wn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;w=0;q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];for(var z=0;.1<=u;){0===z&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); +if(e>u){Ia(v);return}e>q?(z=e-q,e=q):z=0;var y=Math.sqrt(e*e/(1+p*p));0>n&&(y=-y);h+=y;k+=p*y;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===z&&d.Fi(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==z){w++;if(w===v.length){Ia(v);return}q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Ia(v)}} +t.Fi=function(a,b){var c=this.Dc,d=this.cl;if(null!==c||null!==d){var e=this.ma;if(null!==e){a.Bd();var f=this.actualBounds,g=this.naturalBounds;null!==d&&bi(this,a,d,!0,!1,g,f);var h=this.part,k=this.cg;null===c||0!==k||null===h||!this.isPanelMain&&h.nb()!==this||(k=h.type===X.Link&&h instanceof we&&"Selection"===h.category&&h.adornedObject instanceof uf&&h.adornedPart.nb()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(bi(this,a,c,!1,!1,g,f),a.lineWidth=k,a.lineJoin= +this.Ul,a.lineCap=this.Tl,a.miterLimit=this.Uj);f=!1;h&&b.Fe("drawShadows")&&(f=h.isShadowed);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.As(k,this.jh));if(e.type===Q.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.Xi();else if(e.type===Q.C){var l=e.startX;k=e.startY;var m=e.endX,n=e.endY;e=Math.min(l,m);var p=Math.min(k,n);l=Math.abs(m-l);k=Math.abs(n-k);a.beginPath();a.rect(e,p,l,k);null!==d&&a.uf(d);if(null!== +c){h&&f&&ql(a);if(0===l||0===k)a.beginPath(),a.rect(e,p,Math.max(l,.1),Math.max(k,.1));a.Xi();h&&f&&pl(a)}}else if(e.type===Q.M)l=e.startX,k=e.startY,m=e.endX,n=e.endY,e=Math.abs(m-l)/2,p=Math.abs(n-k)/2,l=Math.min(l,m)+e,k=Math.min(k,n)+p,a.beginPath(),a.moveTo(l,k-p),a.bezierCurveTo(l+L.qg*e,k-p,l+e,k-L.qg*p,l+e,k),a.bezierCurveTo(l+e,k+L.qg*p,l+L.qg*e,k+p,l,k+p),a.bezierCurveTo(l-L.qg*e,k+p,l-e,k+L.qg*p,l-e,k),a.bezierCurveTo(l-e,k-L.qg*p,l-L.qg*e,k-p,l,k-p),a.closePath(),null!==d&&a.uf(d),null!== +c&&(h&&f?(ql(a),a.Xi(),pl(a)):a.Xi());else if(e.type===Q.o)for(e=e.figures,k=e.length,p=0;pu.sweepAngle,null!==r?r.endX:l.startX,null!==r?r.endY:l.startY)}else if(r=Qd(u,l),v=r.length,0===v)a.lineTo(u.centerX,u.centerY);else for(var w=0;w(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;N.free(f);return L.Mb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== +Q.C){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.Gc(-d,-d);if(f.$(a))return N.free(f),!1;f.Gc(d,d)}null!==this.stroke&&f.Gc(e,e);a=f.$(a);N.free(f);return a}if(c.type===Q.M){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return N.free(f),!1; +g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);N.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===Q.o)return N.free(f),null===this.fill?Ud(c,a.x,a.y,e):Sd(c,a,e,1=this.strokeWidth)m=L.Ie(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b), +d=m*b);b=Fa();a=new J;L.Ie(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new J;L.Ie(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new J;L.Ie(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new J;L.Ie(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 Ia(b),!1;m=!0;k=Infinity;for(d=0;dMath.abs(c)){k=g-m-c*(f-d);if(0>a*a*c*c+l*l-k*k){e.x=NaN;e.y=NaN;m=!1;break a}n=Math.sqrt(a*a*c*c+l*l-k*k);h=(-(a*a*c*k)+a*l*n)/(l*l+a*a*c*c)+d;a=(-(a*a*c*k)-a*l*n)/(l*l+a*a*c*c)+d;l=c*(h-d)+k+m;k=c* +(a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))h){e.x=NaN;e.y=NaN;m=!1;break a}k=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)Math.abs(q)?(u*=.5/q,q=.5):0!==u&&.5>Math.abs(u)&&(q*=.5/u,u=.5),w-=q,z-= +u;r.contains(w,z);)w-=q,z-=u;e.x=h;e.y=k;for(u=0;uc?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||L.aa(k.y,a))&&(k.yb||L.aa(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} +t.Ux=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.xh(a,!0))return!0;var e=a.tf(b),f=e;1.5=e||Cb(b,f,0,-n)>=e||Cb(b, +f,0,n)>=e||Cb(b,f,m,0)>=e?!1:!0}else if(b.type===Q.o){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.xl&&a.ye&&Bb(a.x,a.y,f,h,k,h)>e&&Bb(a.x,a.y,k,l,f,l)>e&&Bb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?Ud(b,a.x,a.y,f):Sd(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.m;k=h.length;for(l=0;le)return!1;break;case Md:var p=Fa();L.Ce(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Ia(p);if(g)return!1;g=n.endX;m=n.endY;if(a.nd(g,m)>e)return!1;break;case Nd:p=Fa();L.xq(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Ia(p);if(g)return!1;g=n.endX;m=n.endY;if(a.nd(g,m)>e)return!1;break;case Od:case Pd:p=n.type===Od?Qd(n,f):Rd(n,f,g,m);var r=p.length;if(0===r){g=n.type===Od?n.centerX:n.endX;m=n.type===Od?n.centerY:n.endY;if(a.nd(g,m)>e)return!1; +break}n=null;for(var q=Fa(),u=0;u= 0",uf,"strokeWidth:value")}},strokeCap:{get:function(){return this.Tl}, +set:function(a){var b=this.Tl;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?xa(a,'"butt", "round", or "square"',uf,"strokeCap"):(this.Tl=a,this.N(),this.g("strokeCap",b,a)))}},strokeJoin:{get:function(){return this.Ul},set:function(a){var b=this.Ul;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?xa(a,'"miter", "bevel", or "round"',uf,"strokeJoin"):(this.Ul=a,this.N(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{ +get:function(){return this.Uj},set:function(a){var b=this.Uj;if(b!==a&&1<=a){this.Uj=a;this.N();var c=this.part;null!==c&&(c.Sf=NaN);this.g("strokeMiterLimit",b,a)}}},strokeDashArray:{get:function(){return this.ih},set:function(a){var b=this.ih;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1(n*n+m*m)*p*p&&(c=!0);b.Sb!==a&&(c=!1);!1===b.Fe("textGreeking")&&(c=!1);b=this.ff;n= +this.gf;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)}a.Bd();m=this.Wc;p=(b+g+n)*m;f>p&&(d=this.Bi,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.me)n=this.qb,n>e&&(n=e),this.Ei(this.me,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.zc&&null!==this.Pb)for(p=0;pe&&(r=e);d+=b;this.Ei(this.Pb[p],a,0,d,e,g,r,c,h,k,l);d+=g+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)}}}; +t.Ei=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;h?("left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==Nn?Nn(this,f):.75*f,b.fillText(a,c+n,d+e),a=f/20|0,0===a&&(a=1),"right"===k?n-=g:"center"===k&&(n-=g/2),l&&(k=null!==On?On(this,f):.8*f,b.beginPath(),b.lineWidth=a,b.moveTo(c+n,d+k),b.lineTo(c+n+g,d+k),b.stroke()),m&&(b.beginPath(),b.lineWidth=a,d=d+f-f/2.2|0,0!==a%2&&(d+=.5),b.moveTo(c+n,d),b.lineTo(c+ +n+g,d),b.stroke()))}; +t.qm=function(a,b,c,d){this.di=a;var e=this.ne;null!==In&&Pn!==e&&(Pn=In.font=e);this.qb=this.ze=0;this.me=this.Pb=this.zc=this.oe=null;var f;if(isNaN(this.desiredSize.width)){e=this.Ub.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;){var k=e.indexOf("\n",g);-1===k&&(k=e.length,h=!0);g=e.substr(g,k-g);this.Xh===Ln&&(g=g.trim());f=Math.max(f,Qn(g));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=Qn(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=Rn(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;h=f;if(0!==this.qb&&null!==this.zc&&null!==this.Pb&&this.Vf===Sn&&(b=this.ne,b=this.Vf===Sn?Tn(b):0,k=this.ff+this.gf,k=Math.max(0,Mn(this)+k),h=Math.min(this.maxLines-1,Math.max(Math.floor(h/k+.01)-1,0)),!(h+1>=this.Pb.length))){k=this.Pb[h];for(b=Math.max(1,a-b);Qn(k)>b&&1=a.te)null!==d&&d.h(0,h);else if(g=b,a.gg===Yn){a.ze=1;var l=Qn(b);if(0===k||l<=c)a.qb=Math.max(a.qb,l),Wn(a,b,a.qb),null!==d&&d.h(l,h);else{f=Zn(a,g);g=g.substr(f.length);b=Zn(a,g);for(l=Qn(f+b);0c&&1c;){var n=1;l=Qn(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=Qn(b.substr(0,n));if(1===n){var p=l;f=Math.max(f,l)}else p=m,f=Math.max(f,m);n--;1>n&&(n=1);Wn(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.Wc+k>a.te)break}m=Zn(a,g);for(l=Qn(b+m);0a.te))break}a.ze=Math.min(a.te,k);a.qb=Math.max(a.qb,f);null!==d&&d.h(a.qb,h*a.ze)}}function Zn(a,b){if(a.gg===$n)return b.substr(0,1);for(var c=b.length,d=0,e=ao;d=b.length?b:b.substr(0,d)}function Qn(a){return null===In?8*a.length:In.measureText(a).width} +function Mn(a){if(null!==a.oe)return a.oe;var b=a.ne;if(null===In){var c=16;return a.oe=c}void 0!==co[b]&&5E3>eo?c=co[b]:(c=1.3*In.measureText("M").width,co[b]=c,eo++);return a.oe=c}function Tn(a){if(null===In)return 6;if(void 0!==fo[a]&&5E3>go)var b=fo[a];else b=In.measureText(Un).width,fo[a]=b,go++;return b} +function Rn(a,b){var c=a.Ub.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.ff+a.gf;d=Math.max(0,Mn(a)+d);if(0===c.length)return a.qb=0,a.Wc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Wc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.gg!==Yn){a.ze=0;var k=M.alloc();Xn(a,f,b,k);e+=k.height;M.free(k);a.Wc+=a.ze}else Xn(a,f,b,null),e+=d,a.Wc++;a.Wc===a.te&&(h=!0)}f=g+1}return a.Ir=e} +na.Object.defineProperties(Lg.prototype,{font:{get:function(){return this.ne},set:function(a){var b=this.ne;b!==a&&(this.ne=a,this.oe=null,this.s(),this.g("font",b,a))}},text:{get:function(){return this.Ub},set:function(a){var b=this.Ub;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.Ub=a,this.s(),this.g("text",b,a))}},textAlign:{get:function(){return this.ui},set:function(a){var b=this.ui;b===a||"start"!== +a&&"end"!==a&&"left"!==a&&"right"!==a&&"center"!==a||(this.ui=a,this.N(),this.g("textAlign",b,a))}},flip:{get:function(){return this.Rd},set:function(a){var b=this.Rd;b!==a&&(this.Rd=a,this.N(),this.g("flip",b,a))}},verticalAlignment:{get:function(){return this.Bi},set:function(a){var b=this.Bi;b.A(a)||(this.Bi=a=a.I(),zl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{get:function(){if(!this.qc.u()){var a= +M.alloc();Xn(this,this.Ub,999999,a);var b=a.width;M.free(a);a=Rn(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);Tb(this.qc,b,a)}return this.qc}},isMultiline:{get:function(){return this.Aj},set:function(a){var b=this.Aj;b!==a&&(this.Aj=a,this.s(),this.g("isMultiline",b,a))}},isUnderline:{get:function(){return this.ai},set:function(a){var b=this.ai;b!==a&&(this.ai=a,this.N(),this.g("isUnderline",b, +a))}},isStrikethrough:{get:function(){return this.$h},set:function(a){var b=this.$h;b!==a&&(this.$h=a,this.N(),this.g("isStrikethrough",b,a))}},wrap:{get:function(){return this.gg},set:function(a){var b=this.gg;b!==a&&(this.gg=a,this.s(),this.g("wrap",b,a))}},overflow:{get:function(){return this.Vf},set:function(a){var b=this.Vf;b!==a&&(this.Vf=a,this.s(),this.g("overflow",b,a))}},stroke:{ +get:function(){return this.Dc},set:function(a){var b=this.Dc;b!==a&&(null!==a&&Nl(a,"TextBlock.stroke"),a instanceof ml&&a.freeze(),this.Dc=a,this.N(),this.g("stroke",b,a))}},lineCount:{get:function(){return this.Wc}},lineHeight:{get:function(){return Mn(this)}},editable:{get:function(){return this.En},set:function(a){var b=this.En;b!==a&&(this.En=a,this.g("editable",b,a))}},textEditor:{ +get:function(){return this.Lp},set:function(a){var b=this.Lp;b!==a&&(this.Lp=a,this.g("textEditor",b,a))}},errorFunction:{get:function(){return this.kd},set:function(a){var b=this.kd;b!==a&&(this.kd=a,this.g("errorFunction",b,a))}},interval:{get:function(){return this.Wd},set:function(a){var b=this.Wd;a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){this.Wd=a;this.s();var c=this.panel;null!==c&&(c.Nf=null);this.g("interval",b,a)}}},graduatedStart:{ +get:function(){return this.Ud},set:function(a){var b=this.Ud;b!==a&&(0>a?a=0:1a?a=0:1=a&&xa(a,"> 0",Lg,"maxLines"),this.te=a,this.s(),this.g("maxLines",b,a))}},metrics:{get:function(){return{arrSize:null!==this.zc?this.zc:[this.qb],arrText:null!==this.Pb?this.Pb:[this.me],maxLineWidth:this.qb,fontHeight:this.oe}}},choices:{get:function(){return this.gn},set:function(a){var b=this.gn;b!==a&&(this.gn=a,this.g("choices",b,a))}}}); +var Nn=null,On=null,Yn=new D(Lg,"None",0),Vn=new D(Lg,"WrapFit",1),Kn=new D(Lg,"WrapDesiredSize",2),$n=new D(Lg,"WrapBreakAll",3),Jn=new D(Lg,"OverflowClip",0),Sn=new D(Lg,"OverflowEllipsis",1),Ln=new D(Lg,"FormatTrim",0),bo=new D(Lg,"FormatNone",0),ao=/[ \u200b\u00ad]/,co=new Wa,eo=0,fo=new Wa,go=0,Un="...",Pn="",In=null,Hn=!1;Lg.className="TextBlock";Lg.getEllipsis=function(){return Un};Lg.setEllipsis=function(a){Un=a;fo=new Wa;go=0};Lg.getBaseline=function(){return Nn}; +Lg.setBaseline=function(a){Nn=a};Lg.getUnderline=function(){return On};Lg.setUnderline=function(a){On=a};Lg.isValidFont=function(a){Hn||(In=Jg?(new Ak(null)).context:null,Hn=!0);if(null===In)return!0;var b=In.font;if(a===b||"10px sans-serif"===a)return!0;In.font="10px sans-serif";In.font=a;var c=In.font;if("10px sans-serif"!==c)return In.font=b,!0;In.font="19px serif";var d=In.font;In.font=a;c=In.font;In.font=b;return c!==d};Lg.FormatNone=bo;Lg.FormatTrim=Ln;Lg.None=Yn;Lg.OverflowClip=Jn; +Lg.OverflowEllipsis=Sn;Lg.WrapBreakAll=$n;Lg.WrapDesiredSize=Kn;Lg.WrapFit=Vn;function Vj(a,b){Y.call(this);this.Gg=null;this.Ep="";this.hh=hc;this.fl=sd;this.kh=this.kd=null;this.el=yc;this.Rd=og;this.Wl=null;this.co=!1;this.Kn=!0;this.ul=!1;this.Pl=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var ho;ma(Vj,Y); +Vj.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.element=this.Gg;a.Ep=this.Ep;a.hh=this.hh.I();a.fl=this.fl;a.Rd=this.Rd;a.kd=this.kd;a.kh=this.kh;a.el=this.el.I();a.Kn=this.Kn;a.Pl=this.Pl};Vj.prototype.gb=function(a){a===og||a===qg||a===Xk?this.imageStretch=a:Y.prototype.gb.call(this,a)};Vj.prototype.toString=function(){return"Picture("+this.source+")#"+gb(this)};function Ii(a){void 0===a&&(a="");""!==a?ho[a]&&(delete ho[a],io--):(ho=new Wa,io=0)} +function jo(a,b){b.Vy||(b.Hr=function(c){b.zr=!0;b.Xn=!1;var d=b.Cg.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;var f=b.getAttribute("src")||"";var g=e.$g.H(f);if(null!==g)for(var h=g.length,k=0;k=d.width&&(e=e+r.offsetX+(m*r.x-d.width*r.x));n>=d.height&&(f=f+r.offsetY+(n*r.y-d.height*r.y));h=Math.min(d.width,m);g=Math.min(d.height,n);break;case sd:m=d.width;n=d.height;break;case qg:case Xk:p===qg?(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+(m*r.x-d.width*r.x)/m)*h),n>=d.height&&(f=(f+r.offsetY+(n*r.y-d.height*r.y)/n)*g),h*=1/(m/ +d.width),g*=1/(n/d.height),m=d.width,n=d.height)}p=this.wf()*b.scale;var q=m*p*n*p,u=h*g/q,v=c.__goCache;p=null;var w=ko;if(c.zr&&void 0!==v&&4w*w)for(null===v.Di&&(lo(v,4,k,l,c),lo(v,16,k,l,c)),k=v.Di,l=k.length,q=0;qa)a=5;a=Math.min(a,b/3);a=Math.min(a,c/3);var d="rr"+b+","+c+","+a,e=L.Ff[d];if(void 0!==e)return e;var f=a*L.qg;e=(new Q).add((new Wd(a,0,!0)).add(new Xd(ud,b-a,0)).add(new Xd(Md,b,a,b-f,0,b,f)).add(new Xd(ud,b,c-a)).add(new Xd(Md,b-a,c,b,c-f,b-f,c)).add(new Xd(ud,a,c)).add(new Xd(Md,0,c-a,f,c,0,c-f)).add(new Xd(ud,0,a)).add((new Xd(Md,a,0,0,f,f,0)).close()));1e.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.D^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.ea();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Kb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Fb(),c.skipsUndoManager=d)}}}},isHighlighted:{get:function(){return 0!== +(this.D&524288)},set:function(a){var b=0!==(this.D&524288);if(b!==a){this.D^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ea(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.N();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{get:function(){return 0!==(this.D&8192)},set:function(a){var b=0!==(this.D&8192);b!==a&&(this.D^=8192,this.g("isShadowed",b,a),this.N())}},isAnimated:{get:function(){return 0!== +(this.D&262144)},set:function(a){var b=0!==(this.D&262144);b!==a&&(this.D^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{get:function(){return this.$n},set:function(a){var b=this.$n;b!==a&&(this.$n=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{get:function(){return this.wp},set:function(a){var b=this.wp;b!==a&&(this.wp=a,this.fh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{ +get:function(){return this.tp},set:function(a){var b=this.tp;b!==a&&(this.tp=a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{get:function(){if(null===this.fh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.Ya(a),null!==a?this.fh=a:this.fh=this):this instanceof U?(a=this.path,null!==a?this.fh=a:this.fh=this):this.fh=this}return this.fh}},selectionChanged:{get:function(){return this.vp},set:function(a){var b=this.vp; +b!==a&&(this.vp=a,this.g("selectionChanged",b,a))}},resizeAdornmentTemplate:{get:function(){return this.gp},set:function(a){var b=this.gp;b!==a&&(this.gp=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{get:function(){return this.ip},set:function(a){var b=this.ip;b!==a&&(this.ip=a,this.g("resizeObjectName",b,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.Ya(a), +null!==a)?a:this}},resizeCellSize:{get:function(){return this.hp},set:function(a){var b=this.hp;b.A(a)||(this.hp=a=a.I(),this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{get:function(){return this.kp},set:function(a){var b=this.kp;b!==a&&(this.kp=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{get:function(){return this.lp},set:function(a){var b=this.lp;b!==a&&(this.lp=a,this.g("rotateObjectName", +b,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.Ya(a),null!==a)?a:this}},rotationSpot:{get:function(){return this.mp},set:function(a){var b=this.mp;b.A(a)||(this.mp=a=a.I(),this.g("rotationSpot",b,a))}},text:{get:function(){return this.Ub},set:function(a){var b=this.Ub;b!==a&&(this.Ub=a,this.g("text",b,a))}},containingGroup:{get:function(){return this.Qh}, +set:function(a){if(this.Jc()){var b=this.Qh;if(b!==a){null===a||this!==a&&!a.Fd(this)||(this===a&&C("Cannot make a Group a member of itself: "+this.toString()),C("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.B(2);var c=this.diagram;null!==b?Do(b,this):this instanceof hf&&null!==c&&c.xi.remove(this);this.Qh=a;null!==a?Co(a,this):this instanceof hf&&null!==c&&c.xi.add(this);this.B(1);if(null!==c&&c.Z){var d=this.data,e=c.model;if(null!==d&& +e.pk()){var f=e.pa(null!==a?a.data:null);e.Gq(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.Z,c.Z=!0),d(this,b,a),null!==c&&(c.Z=e));if(this instanceof hf)for(c=new G,Rk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof W)for(d=d.linksConnected;d.next();)Io(d.value);if(this instanceof W){for(c=this.linksConnected;c.next();)Io(c.value);c=this.labeledLink;null!==c&&Io(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ci(b,-1,a))}}else C("cannot set the Part.containingGroup of a Link or Adornment")}}, +containingGroupChanged:{get:function(){return this.kn},set:function(a){var b=this.kn;b!==a&&(this.kn=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{get:function(){return null!==this.containingGroup||this instanceof W&&null!==this.labeledLink?!1:!0}},layoutConditions:{get:function(){return this.so},set:function(a){var b=this.so;b!==a&&(this.so=a,this.g("layoutConditions",b,a))}},dragComputation:{ +get:function(){return this.An},set:function(a){var b=this.An;b!==a&&(this.An=a,this.g("dragComputation",b,a))}},shadowOffset:{get:function(){return this.Bp},set:function(a){var b=this.Bp;b.A(a)||(this.Bp=a=a.I(),this.N(),this.g("shadowOffset",b,a))}},shadowColor:{get:function(){return this.Ap},set:function(a){var b=this.Ap;b!==a&&(this.Ap=a,this.N(),this.g("shadowColor",b,a))}},shadowBlur:{get:function(){return this.bg}, +set:function(a){var b=this.bg;b!==a&&(this.bg=a,this.N(),this.g("shadowBlur",b,a))}}});V.prototype.invalidateLayout=V.prototype.B;V.prototype.findCommonContainingGroup=V.prototype.Rx;V.prototype.isMemberOf=V.prototype.Fd;V.prototype.findTopLevelPart=V.prototype.Yz;V.prototype.findSubGraphLevel=V.prototype.Uz;V.prototype.ensureBounds=V.prototype.Sa;V.prototype.getDocumentBounds=V.prototype.Mi;V.prototype.findObject=V.prototype.Ya;V.prototype.moveTo=V.prototype.moveTo; +V.prototype.invalidateAdornments=V.prototype.Kb;V.prototype.clearAdornments=V.prototype.$j;V.prototype.removeAdornment=V.prototype.Cf;V.prototype.addAdornment=V.prototype.th;V.prototype.findAdornment=V.prototype.hk;V.prototype.updateTargetBindings=V.prototype.Da;var Ao=!1;V.className="Part";V.LayoutNone=0;V.LayoutAdded=1;V.LayoutRemoved=2;V.LayoutShown=4;V.LayoutHidden=8;V.LayoutNodeSized=16;V.LayoutGroupLayout=32;V.LayoutNodeReplaced=64;V.LayoutStandard=127;V.LayoutAll=16777215; +function we(a,b){void 0===a||a instanceof Kl||"string"===typeof a?V.call(this,a):(V.call(this),a&&(b=a));this.D&=-257;this.Og="Adornment";this.ie=null;this.ax=0;this.xx=!1;this.j=this.Ra=null;b&&Object.assign(this,b)}ma(we,V);we.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};we.prototype.updateRelationshipsFromData=function(){}; +we.prototype.sk=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof U&&b instanceof uf){b=c.path;c.sk(a);a=b.geometry;c=this.T.m;b=c.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.He){b.He=!0;var c=new G;c.add(this);To(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===qi);b.He=!1}};function To(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.He){b.He=!0;var c=new G;c.add(this);Vo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===qi);b.He=!1}}; +function Vo(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.iq():a.Dd();k.next();){var l=k.value;l.isTreeLink&&(h||l.rd||l.Ua(),l=l.nq(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Nb(!0),l.Ch(),g&&e.Yj(l,f)),2e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, +a.h(b.x,b.y,0,0));return a};na.Object.defineProperties(mg.prototype,{padding:{get:function(){return this.mb},set:function(a){"number"===typeof a&&(a=new ic(a));var b=this.mb;b.A(a)||(this.mb=a=a.I(),this.g("padding",b,a),this.s())}}});mg.className="Placeholder"; +function U(a){V.call(this,X.Link);this.Ia=8;this.Se=null;this.Te="";this.kf=this.On=null;this.lf="";this.Op=null;this.Ek=Vf;this.rn=0;this.tn=Vf;this.un=NaN;this.Oj=$o;this.Dp=.5;this.ld=null;this.Bb=(new E).freeze();this.cf=this.Zg=null;this.Gl=new N;this.ma=new Q;this.C=this.o=this.If=this.Mf=null;this.Ru=new J;this.qr=this.px=this.ox=null;this.Rt=NaN;this.P=null;this.j=[];a&&Object.assign(this,a)}ma(U,V); +U.prototype.cloneProtected=function(a){V.prototype.cloneProtected.call(this,a);a.Ia=this.Ia&-113;a.Te=this.Te;a.On=this.On;a.lf=this.lf;a.Op=this.Op;a.Ek=this.Ek;a.rn=this.rn;a.tn=this.tn;a.un=this.un;a.Oj=this.Oj;a.Dp=this.Dp;null!==this.P&&(a.P=this.P.copy())};t=U.prototype;t.sf=function(a){V.prototype.sf.call(this,a);this.Te=a.Te;this.lf=a.lf;a.Zg=null;a.Ua();a.If=this.If;var b=a.fromPort;null!==b&&Mo(b);a=a.toPort;null!==a&&Mo(a)}; +t.gb=function(a){a.classType===U?2===(a.value&2)?this.routing=a:a===Yf||a===Uf||a===Tf?this.curve=a:a===ap||a===bp||a===cp?this.adjusting=a:a!==$o&&a!==Vf&&C("Unknown Link enum value for a Link property: "+a):V.prototype.gb.call(this,a)};t.Hc=function(){null===this.P&&(this.P=new cl)};t.Si=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(nj(a)||oj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),nj(a)||oj(a))?!1:!0};t.Zv=function(){return!1}; +t.gt=function(){};t.Jc=function(){return!1};U.prototype.computeAngle=function(a,b,c){return U.computeAngle(b,c)};U.computeAngle=function(a,b){switch(a){default:case Vf:a=0;break;case Rm:a=b;break;case Km:a=b+90;break;case Mm:a=b-90;break;case dp:a=b+180;break;case Sm:a=L.vq(b);90a&&(a-=180);break;case Lm:a=L.vq(b+90);90a&&(a-=180);break;case Nm:a=L.vq(b-90);90a&&(a-=180);break;case Om:a=L.vq(b);if(45a||225a)return 0;90a&&(a-=180)}return L.vq(a)}; +function Io(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.Rx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Qh;if(c!==b){null!==c&&Do(c,a);a.Qh=b;null!==b&&Co(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.Z,g.Z=!0);e(a,c,b);null!==g&&(g.Z=f)}!a.rd||a.ox!==c&&a.px!==c||a.Ua()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=U.prototype; +t.Ch=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&V.prototype.Ch.call(this)};t.nq=function(a){var b=this.fromNode;return a===b?this.toNode:b};t.gA=function(a){var b=this.fromPort;return a===b?this.toPort:b};function Qo(a,b){null===a.ld&&(a.ld=new G);a.ld.add(b);a.s()} +t.pq=function(a){V.prototype.pq.call(this,a);ep(this)&&this.rq(this.actualBounds);if(!a){a=this.Se;var b=null;null!==a&&(b=this.fromPort,Oo(a,this,b));var c=this.kf;if(null!==c){var d=this.toPort;c===a&&d===b||Oo(c,this,d)}fp(this)}};t.qq=function(a){V.prototype.qq.call(this,a);ep(this)&&this.rq(this.actualBounds);if(!a){a=this.Se;var b=null;null!==a&&(b=this.fromPort,Po(a,this,b));var c=this.kf;if(null!==c){var d=this.toPort;c===a&&d===b||Po(c,this,d)}gp(this)}}; +t.fk=function(){this.rd=!0;if(null!==this.ld){var a=this.diagram;if(null!==a)for(var b=this.ld.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};U.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; +U.prototype.move=function(a,b){var c=b?this.location:this.position,d=c.x;isNaN(d)&&(d=0);var e=c.y;isNaN(e)&&(e=0);d=a.x-d;e=a.y-e;!0===b?V.prototype.move.call(this,a,!1):(a=J.allocAt(c.x+d,c.y+e),V.prototype.move.call(this,a,!1),J.free(a));cf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; +U.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};U.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}; +U.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(vb),a;if(1===b)return a.assign(this.i(0)),a;if(2===b){var c=this.i(0),d=this.i(1);a.h((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Yf))return this.ma.uv(.5,a),a.add(this.i(0)),c=this.ma.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===Yf){if(3===b)return this.i(1);d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);var e=this.i(c+1), +f=this.i(c+2);c=this.i(c+3);L.pz(d.x,d.y,e.x,e.y,f.x,f.y,c.x,c.y,a)}else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;dc/2)break;d+=e;f++}b=this.i(f);f=this.i(f+1);1>Math.abs(b.x-f.x)?b.y>f.y?a.h(b.x,b.y-(c/2-d)):a.h(b.x,b.y+(c/2-d)):1>Math.abs(b.y-f.y)?b.x>f.x?a.h(b.x-(c/2-d),b.y):a.h(b.x+(c/2-d),b.y):(c=(c/2-d)/e,a.h(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a}; +U.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).Oa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Yf))return this.ma.Xx(.5);if(this.computeCurve()===Yf&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return L.oz(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.Oa(d)};t=U.prototype;t.i=function(a){return this.Bb.m[a]};t.Mc=function(a,b){this.Bb.Lc(a,b)};t.L=function(a,b,c){this.Bb.Lc(a,new J(b,c))};t.pA=function(a,b){this.Bb.ub(a,b)}; +t.l=function(a,b,c){this.Bb.ub(a,new J(b,c))};t.ce=function(a){this.Bb.add(a)};t.pf=function(a,b){this.Bb.add(new J(a,b))};t.Rv=function(a){this.Bb.eb(a)};t.ak=function(){this.Bb.clear()}; +function cf(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.offset(b,c),a.defaultToPoint&&a.defaultToPoint.offset(b,c);else{for(var d=a.rd,e=new E,f=a.Bb.iterator;f.next();){var g=f.value;e.add((new J(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Bb;a.Bb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.rb?a.s():(a.ae.h(a.ae.x+b,a.ae.y+c),a.ka.h(a.ka.x+b,a.ka.y+c),zl(a));d?hp(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= +a.i(a.pointsCount-1)));null!==g&&g.animationManager.rb&&(b=g.animationManager,a.cf=e,b.Il.add(a));a.g("points",f,e)}}t.Hh=function(){null===this.Zg&&(this.Zg=this.Bb,this.Bb=this.Bb.copy())}; +t.rf=function(){if(null!==this.Zg){for(var a=this.Zg,b=this.Bb,c=Infinity,d=Infinity,e=a.m,f=e.length,g=0;gl&&(n=-n),u= +(0>k?-1:1)*n+r,v=m*(u-r)+q);r=f.x+2*h/3;q=f.y+2*k/3;var w=r,z=q;L.w(k,0)?z=0k?-1:1)*n+r,z=m*(w-r)+q);this.ak();this.ce(f);this.pf(u,v);this.pf(w,z);this.ce(p);this.Mc(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.Mc(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,L.w(c,0)?h=0g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ce(d),this.pf(f,h),this.ce(e);else{this.ce(d);this.ce(e);h=N.alloc();b.Mi(h);k=h.$(e);p.Mi(h);l=h.$(d);if(k||l)g=b.da(mp(g),new J),this.Mc(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.da(mp(c),new J),this.Mc(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));N.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.ak();var y=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);r=u=q=0;if(m||!h||l)v=this.computeEndSegmentLength(a,b,g,!0),r=this.getLinkDirection(a, +b,n,g,!0,m,d,e),l&&(h||g.A(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(r-=m?90:30,0>y&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(v+=Math.abs(y)*(m?1:2)),0===r?q=v:90===r?u=v:180===r?q=-v:270===r?u=-v:(q=v*Math.cos(r*Math.PI/180),u=v*Math.sin(r*Math.PI/180)),g.wc()&&l&&(v=b.da(yc,J.alloc()),w=J.allocAt(v.x+1E3*q,v.y+1E3*u),this.getLinkPointFromPoint(a,b,v,w,!0,n),J.free(v),J.free(w));v=this.getLinkPoint(d,e,c,!1,m,a,b);var A=z=w=0;if(m||!k||l){var B=this.computeEndSegmentLength(d,e,c,!1);A=this.getLinkDirection(d, +e,v,c,!1,m,a,b);l&&(k||g.A(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(A+=m?0:30,0>y&&(A+=180));0>A?A+=360:360<=A&&(A-=360);l&&(B+=Math.abs(y)*(m?1:2));0===A?w=B:90===A?z=B:180===A?w=-B:270===A?z=-B:(w=B*Math.cos(A*Math.PI/180),z=B*Math.sin(A*Math.PI/180));c.wc()&&l&&(c=e.da(yc,J.alloc()),g=J.allocAt(c.x+1E3*w,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,v),J.free(c),J.free(g))}c=n;if(m||!h||l)c=new J(n.x+q,n.y+u);g=v;if(m||!k||l)g=new J(v.x+w,v.y+z);!p&&!m&&h&&3Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} +U.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new J);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));a=null;e=b.panel;null===e||e.he()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.de;e=1/(a.m11*a.m22-a.m12*a.m21);g=a.m22*e;var h=-a.m12*e,k=-a.m21*e,l=a.m11*e,m=e*(a.m21*a.dy-a.m22*a.dx),n=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*g+d.y*k+m;d=d.x*h+d.y*l+n;g=c.x*g+c.y*k+m;c=c.x*h+c.y*l+n}b.kk(e,d,g,c,f);null!== +a&&f.transform(a);return f};function op(a,b){var c=b.bp;null===c&&(c=new pp,c.port=b,c.node=b.part,b.bp=c);return qp(c,a)} +U.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new J);if(c.hb()&&!lp(c))return b.da(c,h),h;if(c.Kc()){var k=op(this,b);if(null!==k){h.assign(k.tq);if(e&&this.routing===rp){var l=op(this,g);if(null!==l&&k.fm=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.zf(Dc)||c.zf(Hc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);J.free(k);J.free(l)}}return h}}c= +b.da(mp(c),J.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=J.alloc(),g=g.da(mp(k),f),e&&(g=np(c,g)),J.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);J.free(c);return h}; +U.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.hb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?np(k,h.copy()):c):(c=J.alloc(),h=h.da(yc,c),J.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>= +k.x?0:180:h.y>=k.y?90:270;J.free(k);k=c}d.wc()&&g.Fd(a)&&(k+=180,360<=k&&(k-=360));if(lp(d))return k;a=b.Li();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};U.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Kc()&&(a=op(this,b),null!==a))return a.mv;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; +U.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=yc:(b=this.fromSpot,b.Lb()&&(b=a.fromSpot),a=b===Vc?rc:b)):(a=b?b:this.toPort,null===a?a=yc:(b=this.toSpot,b.Lb()&&(b=a.toSpot),a=b===Vc?rc:b));return a};function lp(a){return a===rc||.5===a.x&&.5===a.y}function mp(a){return.5===a.x&&.5===a.y?a:yc} +U.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==Vf&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=qd.alloc();n.set(g); +if(m instanceof X)h=m.vf(a,b,c,d,e,n);else if(this.path===m){if(m instanceof uf)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.wh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.De(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var v=J.alloc(),w=J.alloc(),z=J.alloc(),y=qd.alloc();y.set(q);y.Hv(m.transform);y.Ns();w.x=p;w.y=u;w.transform(y);v.x=h;v.y=u;v.transform(y);q=!1;Dn(m,v,w,z)?q=!0:(v.x=p,v.y=r,v.transform(y),Dn(m,v,w,z)?q=!0:(w.x= +h,w.y=r,w.transform(y),Dn(m,v,w,z)?q=!0:(v.x=h,v.y=u,v.transform(y),Dn(m,v,w,z)&&(q=!0))));qd.free(y);J.free(v);J.free(w);J.free(z);h=q}}else h=m.wh(h,n)}else h=gl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));qd.free(n)}}}void 0===f&&qd.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&qd.free(g);return!1}; +U.prototype.computeCurve=function(){if(null===this.Mf){var a=this.fromPort,b=this.isOrthogonal;this.Mf=null!==a&&a===this.toPort&&!b}return this.Mf?Yf:this.curve};U.prototype.computeCorner=function(){if(this.curve===Yf)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; +U.prototype.findMidLabel=function(){for(var a=this.path,b=this.T.m,c=b.length,d=0;dk?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);L.aa(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.Mc(a,b);for(a+=1;ak?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.L(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.Mc(c,d)}}return!0;case cp:f=this.i(a);n=this.i(c);if(!f.Ta(b)||!n.Ta(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var r=1;if(0!==k-h){var q=(p-m)/(k-h);r=Math.sqrt(1+1/(q*q))}else q=9E9;this.Mc(a,b);for(a+=1;ab?b+=360:360<=b&&(b-=360);0>d?d+=360:360<=d&&(d-=360);var g=d;b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=315<=d||45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.actualBounds.copy(),k=f.actualBounds.copy();if(h.u()&&k.u()){h.Gc(up,up);k.Gc(up,up);h.Le(a);k.Le(c);var l=J.alloc(),m=J.alloc();if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x, +a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.$(a)||h.$(c))?l.y= +this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l.h(Math.max((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,a.y,k.right,c.y,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.left,m.x=l.x,m.y=c.y): +180===d&&a.x>k.right&&a.y>k.top&&a.yh.bottom)0===d&&(k.$(a)||h.$(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y= +l.y;if(l.y>h.top&&l.y=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l.h(Math.min((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&k.bottom>a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0), +m.x=c.x,m.y=l.y):180===d&&c.xa.x?(l.y=a.yk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.yk.left&&a.xh.right)270===d&&(k.$(a)||h.$(c))?l.x=this.computeMidOrthoPosition(a.x, +a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l.h(a.x,Math.max((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.$(a)||h.$(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l.h(a.x,Math.min((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x=xp&&(sk(r),h.Gc(r.bq*r.ly,r.aq*r.my),vp(r,a,b,n,d,h,!1),k=wp(r, +n.x,n.y));if(!r.abort&&kthis.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.L(2,h.x,h.y),this.l(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)L.w(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.L(2,h,a.y),this.L(3,h,g.y)):L.w(h.y,g.y)?(Math.abs(a.y-h.y)<=r.aq/2&&(this.L(2,h.x,a.y),this.L(3,g.x,a.y)),this.l(2,h.x,a.y)):this.L(2,a.x,h.y);else if(90===b||270===b)L.w(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): +Math.min(h.y,a.y),this.L(2,a.x,h),this.L(3,g.x,h)):L.w(h.x,g.x)?(Math.abs(a.x-h.x)<=r.bq/2&&(this.L(2,a.x,h.y),this.L(3,a.x,g.y)),this.l(2,a.x,h.y)):this.L(2,h.x,a.y);null!==c&&(a=this.i(1),g=this.i(2),a.x!==g.x&&a.y!==g.y?0===b||180===b?this.l(2,a.x,g.y):this.l(2,g.x,a.y):0===b||180===b?this.l(2,e.x,c.y):this.l(2,c.x,e.y));null!==q&&(0===d||180===d?this.pf(f.x,q.y):this.pf(q.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ce(l.copy()),this.ce(m.copy()));J.free(l);J.free(m)}}; +U.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).Kc()||this.computeSpot(!1,this.toPort).Kc()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; +function Kj(a){if(null===a.diagram||!a.isAvoiding||!nk(a.diagram))return!1;var b=a.points.m,c=b.length;if(4>c)return!1;a=ok(a.diagram,!0,a.containingGroup,null);for(var d=1;dzp&&wp(b,m,n)!==l-1&&(wp(b,c-h,d)===l-1?(e=180,m=c-h,n=d):wp(b,c+h,d)===l-1?(e=0,m=c+h,n=d):wp(b,c,d-k)===l-1?(e=270,m=c,n=d-k):wp(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>zp&&wp(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,--l;if(f){if(l>zp)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/ +k)*k+k/2;l>zp&&(f=e,g=c,m=d,0===e?(f=90,m+=k):90===e?(f=180,g-=h):180===e?(f=270,m-=k):270===e&&(f=0,g+=h),wp(b,g,m)===l-1?yp(a,b,g,m,f,!1,f):(g=c,m=d,0===e?(f=270,m-=k):90===e?(f=0,g+=h):180===e?(f=90,m+=k):270===e&&(f=180,g-=h),wp(b,g,m)===l-1&&yp(a,b,g,m,f,!1,f)));a.pf(c,d)}U.prototype.Kz=function(a){var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Bb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gb)return a.type=Q.j,this.Lm=!0,a;var c=!1,d=this.diagram;null!==d&&ep(this)&&d.Wh.contains(this)&&(0!==this.Gl.width||0!==this.Gl.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.Bb.m;var g=this.computeCurve();if(g===Yf&&3<=b&&!L.aa(this.smoothness,0))if(3===b){var h=this.i(1);d=Math.min(e.x,h.x);var k=Math.min(e.y,h.y);h=this.i(2);d=Math.min(d,h.x);k=Math.min(k,h.y)}else{if(this.isOrthogonal)for(k=0;k=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;kv?q>r?(f.x= +w-y,f.y=r-y,e.x=w+u,e.y=r+u):(f.x=w-y,f.y=r+y,e.x=w+u,e.y=r-u):q>r?(f.x=w+y,f.y=r-y,e.x=w-u,e.y=r+u):(f.x=w+y,f.y=r+y,e.x=w-u,e.y=r-u));L.aa(v,w)&&L.aa(r,q)&&(r>p?(z>w?(f.x=w-y,f.y=r-y,e.x=w+u):(f.x=w+y,f.y=r-y,e.x=w-u),e.y=r+u):(z>w?(f.x=w-y,f.y=r+y,e.x=w+u):(f.x=w+y,f.y=r+y,e.x=w-u),e.y=r-u));if(L.aa(v,w)&&L.aa(w,z)||L.aa(p,r)&&L.aa(r,q))v=.5*(v+z),p=.5*(p+q),f.x=v,f.y=p,e.x=v,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&L.aa(g.x,this.i(0).x)&&L.aa(g.y,this.i(0).y)&&(c.x=.5*(g.x+l.x), +c.y=.5*(g.y+l.y));xd(h,c.x-d,c.y-k,f.x-d,f.y-k,l.x-d,l.y-k);b.set(f);c.set(e);g=l}}l=g.x;g=g.y;m=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(m=Ap(this,m.copy(),!1,pb));l=.5*(l+m.x);g=.5*(g+m.y);xd(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);J.free(b);J.free(c);J.free(f);J.free(e)}else for(c=3;c=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=Ap(this,g.copy(),!1,pb)),xd(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=J.alloc();f.assign(this.i(0)); +e=J.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.A(m))0!==this.computeShortLength(!1)&&(m=Ap(this,m.copy(),!1,pb)),Dp(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?A=p.x-q:A=p.x+q;w.y>p.y?z=p.y+y:z=p.y-y;w=J.allocAt(A,B);Dp(this,h,n,v,f,w,u);J.free(w);Ad(h,p.x+n,p.y+v,r+n,z+v);f.h(r,z)}else L.w(f.x,p.x)&&L.w(p.y,w.y)?(q=Math.min(g,Math.abs(p.y-e.y)/2),q=y=Math.min(q,Math.abs(w.x-p.x)/2),L.w(y,0)?(Dp(this,h,n,v,f,p,u),f.assign(p)):(A=p.x,B=p.y,r=A,z=B,p.y>f.y?B=p.y-q:B=p.y+q,w.x>p.x?r=p.x+y:r=p.x-y,w=J.allocAt(A,B),Dp(this,h,n,v,f,w,u),J.free(w),Ad(h,p.x+n,p.y+v,r+n,z+v),f.h(r,z))):(Dp(this,h,n,v,f,p,u),f.assign(p));e.assign(m);n=l}J.free(f)}Dd= +h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=Ap(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=Ap(this,h,!1,f)),a.type=Q.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.Lm=!0;return a};function Cp(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return L.aa(a,0)?b:L.aa(b,0)?a:Math.sqrt(a*a+b*b)} +function Ap(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=Cp(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a*(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=Cp(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a*(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} +function Bp(a,b,c,d){for(var e=a.pointsCount,f=b;L.aa(b.x,f.x)&&L.aa(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!L.aa(b.x,f.x)&&!L.aa(b.y,f.y))return c-1;for(var g=f;L.aa(b.x,f.x)&&L.aa(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||L.aa(b.y,f.y)&&L.aa(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}U.prototype.computeJumpLength=function(){return 10}; +function Dp(a,b,c,d,e,f,g){if(!g&&ep(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=Ep(a,e,f,k));if(0n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;r=f.y+d;a.curve===Uf?wd(b,n,r,!1):xd(b,p,m,n,m,n,r)}else if(L.w(e.x,f.x))if(e.ym-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;r=f.x+c;m+=d;a.curve===Uf?wd(b,r,m,!1):xd(b,n,p,n,m,r,m)}}b.lineTo(f.x+c,f.y+d)} +function Ep(a,b,c,d){var e=a.diagram;if(null===e||b.A(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Fa.m;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yq&&Math.min(g,v)n&&!L.w(g,v)){h.x=q;h.y=n;m=!0;break a}}else if(!L.w(n,r)&& +L.w(g,v)&&Math.min(n,r)g&&Math.min(q,u)m&&!L.w(q,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}J.free(h)}function ep(a){a=a.curve;return a===Tf||a===Uf}function ip(a,b){if(b||ep(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Wh.contains(a)||0===a.Gl.width&&0===a.Gl.height||b.Wh.add(a,a.Gl.copy())} +U.prototype.rq=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Fa.m;for(var g=e.length,h=0;ha&&xa(a,">= 0",U,"fromEndSegmentLength"),this.P.Hg=a,this.g("fromEndSegmentLength",b,a),this.Ua())}}, +fromShortLength:{get:function(){return null!==this.P?this.P.Ig:NaN},set:function(a){this.Hc();var b=this.P.Ig;b!==a&&(this.P.Ig=a,this.cc(!0),this.g("fromShortLength",b,a))}},toSpot:{get:function(){return null!==this.P?this.P.ph:Vc},set:function(a){this.Hc();var b=this.P.ph;b.A(a)||(a=a.I(),this.P.ph=a,this.g("toSpot",b,a),(b.Kc()||a.Kc())&&null!==this.toNode&&Mo(this.toPort),this.Ua())}},toEndSegmentLength:{ +get:function(){return null!==this.P?this.P.nh:NaN},set:function(a){this.Hc();var b=this.P.nh;b!==a&&(0>a&&xa(a,">= 0",U,"toEndSegmentLength"),this.P.nh=a,this.g("toEndSegmentLength",b,a),this.Ua())}},toShortLength:{get:function(){return null!==this.P?this.P.oh:NaN},set:function(a){this.Hc();var b=this.P.oh;b!==a&&(this.P.oh=a,this.cc(!0),this.g("toShortLength",b,a))}},isLabeledLink:{get:function(){return null===this.ld?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);L.cm(e.x,e.y,g.x,g.y,h.x,h.y,k.x,k.y,.5,a);b=Math.min(k.x,b);c=Math.min(k.y,c);e=k}else for(e=this.i(0),f=this.i(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.h(e.x,e.y,0,0),a.Le(f),e=2;ed&&(d=-d)):L.aa(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.tf(e));a.push(d)}}return this.qr}},flattenedTotalLength:{get:function(){var a=this.Rt;if(isNaN(a)){for(var b= +this.flattenedLengths,c=b.length,d=a=0;d=this.pointsCount?0:this.isOrthogonal||!lp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!lp(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.Ek},set:function(a){var b=this.Ek;b!== +a&&(this.Ek=a,this.g("adjusting",b,a))}},corner:{get:function(){return this.rn},set:function(a){var b=this.rn;b!==a&&(this.rn=a,this.cc(!0),this.g("corner",b,a))}},curve:{get:function(){return this.tn},set:function(a){var b=this.tn;b!==a&&(this.tn=a,this.Ua(),this.cc(!0),ip(this,b===Uf||b===Tf||a===Uf||a===Tf),this.g("curve",b,a))}},curviness:{get:function(){return this.un},set:function(a){var b=this.un;b!== +a&&(this.un=a,this.Ua(),this.cc(!1),this.g("curviness",b,a))}},routing:{get:function(){return this.Oj},set:function(a){var b=this.Oj;b!==a&&(this.Oj=a,this.Mf=null,this.Ua(),ip(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{get:function(){return this.Dp},set:function(a){var b=this.Dp;b!==a&&(this.Dp=a,this.cc(!0),this.g("smoothness",b,a))}},key:{get:function(){var a=this.diagram; +if(null!==a&&a.model.Qi())return a.model.mc(this.data)}}});U.prototype.invalidateOtherJumpOvers=U.prototype.rq;U.prototype.findClosestSegment=U.prototype.Kz;U.prototype.updateRoute=U.prototype.pg;U.prototype.invalidateRoute=U.prototype.Ua;U.prototype.rollbackRoute=U.prototype.Tv;U.prototype.commitRoute=U.prototype.rf;U.prototype.startRoute=U.prototype.Hh;U.prototype.clearPoints=U.prototype.ak;U.prototype.removePoint=U.prototype.Rv;U.prototype.addPointAt=U.prototype.pf;U.prototype.addPoint=U.prototype.ce; +U.prototype.insertPointAt=U.prototype.l;U.prototype.insertPoint=U.prototype.pA;U.prototype.setPointAt=U.prototype.L;U.prototype.setPoint=U.prototype.Mc;U.prototype.getPoint=U.prototype.i;U.prototype.getOtherPort=U.prototype.gA;U.prototype.getOtherNode=U.prototype.nq; +var jp=null,kp=null,$o=new D(U,"Normal",1),Ip=new D(U,"Orthogonal",2),Jp=new D(U,"AvoidsNodes",6),rp=new D(U,"AvoidsNodesStraight",7),Vf=new D(U,"None",0),Yf=new D(U,"Bezier",9),Uf=new D(U,"JumpGap",10),Tf=new D(U,"JumpOver",11),ap=new D(U,"End",17),bp=new D(U,"Scale",18),cp=new D(U,"Stretch",19),Rm=new D(U,"OrientAlong",21),Km=new D(U,"OrientPlus90",22),Mm=new D(U,"OrientMinus90",23),dp=new D(U,"OrientOpposite",24),Sm=new D(U,"OrientUpright",25),Lm=new D(U,"OrientPlus90Upright",26),Nm=new D(U,"OrientMinus90Upright", +27),Om=new D(U,"OrientUpright45",28),tp=16,sp=14,up=8;U.className="Link";U.Normal=$o;U.Orthogonal=Ip;U.AvoidsNodes=Jp;U.AvoidsNodesStraight=rp;U.None=Vf;U.Bezier=Yf;U.JumpGap=Uf;U.JumpOver=Tf;U.End=ap;U.Scale=bp;U.Stretch=cp;U.OrientAlong=Rm;U.OrientPlus90=Km;U.OrientMinus90=Mm;U.OrientOpposite=dp;U.OrientUpright=Sm;U.OrientPlus90Upright=Lm;U.OrientMinus90Upright=Nm;U.OrientUpright45=Om;U.EndSegmentStep=8;U.CurvinessStart=tp;U.SpacingMin=sp;U.OrthoShortCut=up; +function Hp(a,b,c,d){Ta(this);this.re=this.wr=!1;this.Ws=a;this.uy=b;this.Iv=c;this.vy=d;this.links=[]}Hp.prototype.mm=function(){if(!this.wr){var a=this.links;0=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.wd=Math.floor((a.x-this.dc)/this.dc)*this.dc;this.xd=Math.floor((b-this.ec)/this.ec)*this.ec;this.Ao=Math.ceil((c+2*this.dc)/this.dc)*this.dc;this.Bo=Math.ceil((d+2*this.ec)/this.ec)*this.ec;a=1+(Math.ceil((this.Ao-this.wd)/this.dc)|0);b=1+(Math.ceil((this.Bo-this.xd)/this.ec)|0);if(null===this.Qb||this.zi=zp&&(c[d]=Kp)} +pk.prototype.qk=function(a,b,c,d){if(a>this.Ao||a+cthis.Bo||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.zi)|0;for(c=Math.min(b+e-1,this.Ai)|0;a<=d;a++){e=this.Qb[a];for(var f=b;f<=c;f++)if(e[f]===uk)return!1}return!0}; +function Lp(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.Qb[l][m];if(n>=zp&&n=a.Qb[l][m]);)a.Qb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)Lp(a,b,c,1,!e,f,g,h,k),Lp(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)Lp(a,b,c,1,!e,f,g,h,k),Lp(a,b,c,-1,!e,f,g,h, +k)}}function Mp(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=uk,m=zp;for(a.Qb[b][c]=m;l===uk&&b>f&&bh&&cf&&bh&&c=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;d=f.y;b=f.x+f.width;var p=f.y+f.height;n-=a.wd;n/=a.dc;d-=a.xd;d/=a.ec;b-=a.wd;b/=a.dc;p-=a.xd;p/=a.ec;f=Math.max(0,Math.min(a.zi,n|0));b=Math.min(a.zi,Math.max(0,b|0));n=Math.max(0,Math.min(a.Ai,d|0));p=Math.min(a.Ai,Math.max(0,p|0));d=a.Qb;h|=0;k|=0;l|=0;m|= +0;var r=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===uk?(Mp(a,h,k,r,c,f,b,n,p),Mp(a,h,k,1,!c,f,b,n,p),Mp(a,h,k,-1,!c,f,b,n,p)):Mp(a,h,k,r,c,h,k,h,k);d[l][m]===uk?(Np(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),Np(a,l,m,1,!(90===e||270===e),f,b,n,p),Np(a,l,m,-1,!(90===e||270===e),f,b,n,p)):Np(a,l,m,r,c,l,m,l,m);c=Fa();if(g&&Op(a,l,m,e,h,k,c)){if(c[0]!==l||c[1]!==m)c.unshift(m),c.unshift(l);if(c[c.length-2]!==h||c[c.length-1]!==k)c.push(h),c.push(k);a=zp;e=c[c.length-2];g=c[c.length-1];d[e][g]= +a++;for(f=c.length-4;0<=f;f-=2)for(e=c[f+2],g=c[f+3],b=c[f],l=c[f+1];b>e?e++:bg?g++:le)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===Pp)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?pf&&(m=270,p--):90===d?ne&&(m=180,n--):180===d?pf&&(m=270,p--):ne&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==Pp){g.push(k);g.push(l);if(Op(a,k,l, +m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=Pp;if(0===d){if(k===b)return!1;k--}else if(90===d){if(l===c)return!1;l--}else if(180===d){if(k===b)return!1;k++}else{if(l===c)return!1;l++}}} +na.Object.defineProperties(pk.prototype,{bounds:{get:function(){return new N(this.wd,this.xd,this.Ao-this.wd,this.Bo-this.xd)}},bq:{get:function(){return this.dc},set:function(a){0=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case 3:return c>a&&c<=180+a?180:270;case 5:return c>180-a&&c<=360-a?270:0;case 12:return c>a&&c<=180+a?90:0;case 10:return c>180-a&&c<=360-a?180:90;case 7:return 90180+a&&c<=360-a?270:0;case 13:return 180a&&180>=c?90:0;case 14:return c> +a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!==b&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}pp.prototype.mm=function(){this.ee.length=0}; +function qp(a,b){var c=a.ee;if(0===c.length){a:if(!a.uq){c=a.uq;a.uq=!0;var d=null,e=a.node,f=e instanceof hf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.Sx();else{if(!f.actualBounds.u()){a.uq=c;break a}d=f;g=d.ov()}f=a.ee.length=0;var h=a.port.da(sc,J.alloc()),k=a.port.da(Cc,J.alloc());e=N.allocAt(h.x,h.y,0,0);e.Le(k);J.free(h);J.free(k);h=J.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.Li();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& +l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Fd(d),n=l.computeSpot(m,a.port);if(n.Kc()){var p=m?l.toPort:l.fromPort;if(null!==p&&(m=p.part,null!==m)){var r=m.findVisibleNode();null!==r&&r!==m&&(m=r,p=m.port);m=l.computeOtherPoint(m,p);p=h.Oa(p.da(yc));p+=(h.Oa(m)-p)/360;p-=k;0>p?p+=360:360<=p&&(p-=360);n=Qp(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));r=a.ee[f];void 0===r?(r=new Rp(l,p,n),a.ee[f]= +r):(r.link=l,r.angle=p,r.xc=n);r.Kv.set(m);f++}}}}J.free(h);a.ee.sort(pp.prototype.j);k=a.ee.length;d=-1;for(f=h=0;fMath.abs(u)?(z=Math.abs(u)/p,p=Math.abs(u)):z=1;break;case 2:r>Math.abs(y)?(z=Math.abs(y)/r,r=Math.abs(y)):z=1;break;case 1:n>Math.abs(u)?(z=Math.abs(u)/n,n=Math.abs(u)):z=1;break;default:case 4:m> +Math.abs(y)?(z=Math.abs(y)/m,m=Math.abs(y)):z=1}w=0}var F=A.tq;if(d===Xo){A=A.link.computeThickness();A*=z;F.set(B);switch(q){case 8:F.x=B.x+u/2+p/2-w-A/2;break;case 2:F.y=B.y+y/2+r/2-w-A/2;break;case 1:F.x=B.x+u/2-n/2+w+A/2;break;default:case 4:F.y=B.y+y/2-m/2+w+A/2}w+=A}else{var K=.5;d===Jo&&(K=(A.oq+1)/(A.fm+1));F.x=B.x+u*K;F.y=B.y+y*K}}}J.free(h);J.free(k);J.free(g);J.free(l);B=a.ee;for(f=0;fb.xc?1:a.angleb.angle?1:0}; +pp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,rc,b.fromPort===this.port),d=a.oq;if(0>d)return c;var e=a.fm;if(1>=e||!b.isOrthogonal)return c;b=a.Kv;var f=a.tq;if(2===a.xc||8===a.xc)d=e-1-d;return((a=2===a.xc||4===a.xc)?b.y=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; +li.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var b=this.arrangementOrigin.x,c=b,d=this.arrangementOrigin.y,e=0,f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value.node;if(!(null===h||h instanceof U)&&(Up(h),this.Fh(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof hf&&(h.Fh=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e= +0,c=b,d+=f+20,f=0):e++}}};li.prototype.Fh=function(a){return!a.location.u()||a instanceof hf&&a.Fh?!0:!1};function Tp(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 W?k.isLinkLabel||(k instanceof hf?null===k.layout?Tp(a,b,k.memberParts,!1,e,f,g,h):(Up(k),b.add(k)):(Up(k),b.add(k))):g&&k instanceof U?b.add(k):!h||!k.Jc()||k instanceof W||(Up(k),b.add(k)))}} +function Up(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Sa()}li.prototype.Ni=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new N),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; +li.prototype.Hx=function(a){var b=new G;a instanceof T?(Tp(this,b,a.nodes,!0,null,!0,!0,!0),Tp(this,b,a.links,!0,null,!0,!0,!0),Tp(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof hf?Tp(this,b,a.memberParts,!1,null,!0,!0,!0):Tp(this,b,a.iterator,!1,null,!0,!0,!0);return b}; +li.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.da(sc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a};li.prototype.mayUseWorker=function(){return this.mayUseWorkerFunction?this.mayUseWorkerFunction(this):!1};li.prototype.workerLayout=function(){return!1}; +function Vp(a,b){if(null!==a.workerStateChanged){var c={key:a.group?a.group.key:null};void 0!==b&&(c.time=b);null!==a.Qj&&(c.running=Wp(a.Qj));null!==a.fg&&(c.waiting=Wp(a.fg));a.workerStateChanged(c,a)}}function Wp(a){return{vertexes:a.vertexes.count,edges:a.edges.count}}li.prototype.qz=function(){var a=Xp(this.constructor);a&&(null!==a.Me&&a.Me.terminate(),a.Me=null,a.om.iteratorValues.each(function(a){a.us=!1;a.Qj=null;a.fg=null;a.ls=!1;Vp(a)}),a.om.clear())}; +function Yp(a,b){var c=Xp(a);if(c){if(b)for(var d in b)c[d]=b[d]}else throw Error("Unknown Layout class: "+a);}function Xp(a){var b=null;if("function"===typeof a){if(b=Zp.get(a),!b){var c=Ja(a);b=Zp.get(c);b||(b=new $p,b.iv=a,b.name=c,b.j=a.name,b.gy=aq,Zp.set(c,b),Zp.set(a,b),Zp.set(a.name,b))}}else"string"===typeof a&&(b=Zp.get(a));return b} +li.prototype.jw=function(){if("undefined"===typeof Worker||!bq||"undefined"===typeof self||"undefined"!==typeof self.DedicatedWorkerGlobalScope)return!1;if(!this.mayUseWorker())return this.us&&(this.ls=!0,this.fg=this.Qj=null,Vp(this)),!1;var a=Xp(this.constructor);if(null===a)return!1;null===a.Me&&(a.Me=new Worker(bq),a.Me.onerror=function(a){a.preventDefault();ya("Worker Error at: "+a.filename+" "+a.lineno+" "+a.colno+"\n "+a.message)},a.Me.j=function(a){ya("Worker serialization error: "+a)},a.Me.onmessage= +function(b){var c=b.data;if("_GoJS"===c._GoJS)if(c.version&&T.version&&c.version!==T.version)ya("Failure: GoJS v"+T.version+" Worker v"+c.version);else if(b=a.om.get(c.id)){a.om.remove(c.id);b.us=!1;b.Qj=null;if(b.ls)b.ls=!1,b.fg=null;else{var d=cq(b,c,!1);b.network=d;b.updateParts();b.network=null;b.isValidLayout=!0}Vp(b,c.time);c=b.fg;if(null!==c)b.fg=null;else for(d=a.om.iteratorValues;d.next();){var e=d.value;c=e.fg;if(null!==c){e.fg=null;break}}null!==c&&dq(b,c)}},a.Me.postMessage({_GoJS:"_GoJS", +url:a.gy}),Array.isArray(a.scripts)&&a.scripts.forEach(function(b){a.Me.postMessage({_GoJS:"_GoJS",url:b})}),a.Me.postMessage({_GoJS:"_GoJS",version:-1}));null!==this.Qj?this.fg=this.network:dq(this,this.network);Vp(this);this.doMinimalNetworkLayout();this.network=null;return this.isValidLayout=!0};function dq(a,b){a.us=!0;var c=Xp(a.constructor),d=eq(a,b,!0);d._GoJS="_GoJS";c.Me.postMessage(d);c.om.set(gb(a),a);a.Qj=b} +function eq(a,b,c){a.onNetworkSerialization(1,c,b,null);var d={};a.serializeLayoutProperties(d,c);var e=[];b.vertexes.each(function(a){var b={};a.serializeVertexProperties(b,c);e.push(b)});var f=[];b.edges.each(function(a){var b={};a.serializeEdgeProperties(b,c);f.push(b)});d={id:c?gb(a):a.id,layout:Ja(a.constructor),p:d,dB:e,Iz:f};a.onNetworkSerialization(2,c,b,d);return d} +function cq(a,b,c){c&&(a.id=b.id);var d=a.diagram,e=a.createNetwork();a.onNetworkSerialization(3,c,e,b);var f=b.dB,g=new I;f&&f.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.Eb(a.key));null!==b?b=e.Zj(b):(b=e.createVertex(),e.ig(b));c&&null!==a.key&&(b.data={ci:a.key});g.set(a.id,b)});var h=b.Iz,k=new I;h&&h.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.findLinkForKey(a.key));var f=e.createEdge();e.am(f);f.link=b;c&&null!==a.key&&(f.data={ci:a.key});k.set(a.id,f)}); +f&&f.forEach(function(a){var b=g.get(a.id);b&&b.deserializeVertexProperties(a,g,k,c)});h&&h.forEach(function(a){var b=k.get(a.id);b&&b.deserializeEdgeProperties(a,g,k,c)});a.deserializeLayoutProperties(b.p,g,k,c,e);a.onNetworkSerialization(4,c,e,b);return e}li.prototype.onNetworkSerialization=function(){}; +na.Object.defineProperties(li.prototype,{diagram:{get:function(){return this.F},set:function(a){this.F=a}},group:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a,null!==a&&(this.F=a.diagram))}},isOngoing:{get:function(){return this.ho},set:function(a){this.ho!==a&&(this.ho=a)}},isInitial:{get:function(){return this.Zh},set:function(a){this.Zh=a;a||(this.mo=!0)}}, +isViewportSized:{get:function(){return this.no},set:function(a){this.no!==a&&(this.no=a)&&this.B()}},isRouting:{get:function(){return this.ko},set:function(a){this.ko!==a&&(this.ko=a)}},isRealtime:{get:function(){return this.jo},set:function(a){this.jo!==a&&(this.jo=a)}},isValidLayout:{get:function(){return this.mo},set:function(a){this.mo!==a&&(this.mo=a,a||(a=this.diagram,null!== +a&&(a.Nh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{get:function(){return this.en},set:function(a){this.en!==a&&(this.en=a,this.B())}},arrangementOrigin:{get:function(){return this.an},set:function(a){this.an.A(a)||(this.an.assign(a),this.B())}},id:{get:function(){return this.C},set:function(a){this.C= +a}},mayUseWorkerFunction:{get:function(){return this.Co},set:function(a){this.Co!==a&&(this.Co=a)}},workerStateChanged:{get:function(){return this.Tp},set:function(a){this.Tp!==a&&(this.Tp=a)}}});li.prototype.useWorker=li.prototype.jw;li.declareWorkerLayout=Yp;li.prototype.cancelWorker=li.prototype.qz;li.prototype.collectParts=li.prototype.Hx;li.prototype.getLayoutBounds=li.prototype.Ni;li.prototype.invalidateLayout=li.prototype.B; +var Zp=new I,aq="object"===typeof x.document&&x.document.currentScript?x.document.currentScript.src:"",bq="undefined"!==typeof URL&&"function"===typeof URL.createObjectURL&&"function"===typeof Blob?URL.createObjectURL(new Blob(["self.onmessage=function(e){if(e.data.url){\nimportScripts(e.data.url);}}"],{type:"text/javascript"})):"";li.className="Layout";li.GoJSScriptURL=aq;li.declareWorkerLayout=Yp; +"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&(self.onmessage=function(a){a=a.data;if("_GoJS"===a._GoJS)if(a.url)importScripts(a.url);else if(a.version)self.postMessage({_GoJS:"_GoJS",version:T.version},void 0);else{var b=performance.now(),c=null;a.layout&&(c=Xp(a.layout));var d=null;c&&c.iv&&(d=new c.iv);if(!d)throw Error("no registered Worker Layout: "+a.layout);d.network=cq(d,a,!0); +d.workerLayout=function(){var a=eq(d,d.network,!1);a._GoJS="_GoJS";a.time=performance.now()-b;self.postMessage(a,void 0);return!0};d.doLayout(new E)}});function $p(){this.iv=null;this.gy=this.j=this.name="";this.scripts=[];this.Me=null;this.om=new I}function Sp(a){Ta(this);this.Ac=a;this.mf=new G;this.le=new G;this.Xs=new I;this.Ss=new I} +Sp.prototype.clear=function(){if(this.mf)for(var a=this.mf.iterator;a.next();)a.value.clear();if(this.le)for(a=this.le.iterator;a.next();)a.value.clear();this.mf=new G;this.le=new G;this.Xs=new I;this.Ss=new I}; +Sp.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.mf.count+" edges: "+this.le.count;if(1b?1:0):1:null!==b?-1:0} +na.Object.defineProperties(fq.prototype,{sourceEdgesArrayAccess:{get:function(){return this.qd._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.Cd._dataArray}},data:{get:function(){return this.ib},set:function(a){this.ib=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.o.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{get:function(){return this.mi}, +set:function(a){if(this.mi!==a){this.mi=a;a.Sa();var b=this.network.layout,c=N.alloc(),d=b.Ni(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.j.h(b,e,f,d);N.free(c);if(!(a instanceof hf)&&(a=a.locationObject.da(yc),a.u())){this.o.h(a.x-b,a.y-e);return}this.o.h(f/2,d/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.A(a)||this.j.assign(a)}},focus:{get:function(){return this.o},set:function(a){this.o.A(a)|| +this.o.assign(a)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(a){var b=this.j;b.x+this.o.x!==a&&(b.ea(),b.x=a-this.o.x,b.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(a){var b=this.j;b.y+this.o.y!==a&&(b.ea(),b.y=a-this.o.y,b.freeze())}},focusX:{get:function(){return this.o.x},set:function(a){var b=this.o;b.x!==a&&(b.ea(),b.x=a,b.freeze())}},focusY:{ +get:function(){return this.o.y},set:function(a){var b=this.o;b.y!==a&&(b.ea(),b.y=a,b.freeze())}},x:{get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.ea(),b.x=a,b.freeze())}},y:{get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.ea(),b.y=a,b.freeze())}},width:{get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.ea(),b.width= +a,b.freeze())}},height:{get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.ea(),b.height=a,b.freeze())}},network:{get:function(){return this.Pc},set:function(a){this.Pc=a}},sourceVertexes:{get:function(){for(var a=new G,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new G,b= +this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new G,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.qd.iterator}},destinationEdges:{get:function(){return this.Cd.iterator}},edges:{get:function(){for(var a= +new E,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{get:function(){return this.qd.count+this.Cd.count}}});fq.prototype.deleteDestinationEdge=fq.prototype.jv;fq.prototype.addDestinationEdge=fq.prototype.$u;fq.prototype.deleteSourceEdge=fq.prototype.kv;fq.prototype.addSourceEdge=fq.prototype.bv;fq.className="LayoutVertex";fq.standardComparer=mq; +fq.smartComparer=function(a,b){if(null!==a){if(null!==b){a=a.mi;var c=b.mi;if(null!==a){if(null!==c){b=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);a=c.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(c=0;c=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.wa("Layout");d=[];switch(this.alignment){case vq:var h=b,k=c,l=N.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0g)d.push(new N(0,u,g+h,w)),v=0,q=r,u+=w,w=0;w=Math.max(w,F);switch(p){case uq:A=-A.width;break;default:A= +0}y.moveTo(q+A,u);switch(p){case uq:q-=B;break;default:q+=B}v++}d.push(new N(0,u,g+h,w));N.free(l);break;case nq:k=g;m=f;n=b;p=c;g=N.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=J.alloc();for(q=0;q=l&&(k-=l);l=y=0;B=Math.max(this.cellSize.height,1);A=f=0;F=!0;v=J.alloc();for(K=0;Km-1||0k){d.push(new N(0,F?z-f:z,k+n,A+f+p));for(S=0;Sl&&(f.width+=f.x-l,f.x=l);N.free(g)}for(h=f=g=e=0;hb?1:0} +na.Object.defineProperties(Lk.prototype,{wrappingWidth:{get:function(){return this.Vp},set:function(a){this.Vp!==a&&(0n)){var u=n+bn(q);q.bc(u,!0);nn(q,u,n)}}b.isModified=!0}}finally{b.Z=!0}}}}};hi.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Da(a);for(b=this.nodes.iterator;b.next();)b.value.Da(a);for(b=this.links.iterator;b.next();)b.value.Da(a)}; +hi.prototype.Lq=function(){for(var a=this.F.model,b=new G,c=a.nodeDataArray,d=0;d=d)return"[]";var e=new Va;e.add("[");c&&1d)return;Ea(a.Cc,d)}ir(a,"nodeDataArray",fe,"nodeDataArray",a,b,null,d,null);a.Kq(b)}t.QA=function(a){if(Aa(a))for(var b=a.length,c=0;cb&&(b=a.length);Da(a,b,c);ir(this,"",ee,"",a,null,c,null,b)};t.Qv=function(a,b){void 0===b&&(b=-1);a===this.Cc&&C("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Ea(a,b);ir(this,"",fe,"",a,c,null,b,null)}; +t.lq=function(a){if(null===a)return"";var b=this.Kj;if(""===b)return"";b=on(a,b);if(void 0===b)return"";if("string"===typeof b)return b;C("getCategoryForNodeData found a non-string category for "+a+": "+b)};t.Dm=function(a,b){if(null!==a){var c=this.Kj;if(""!==c)if(this.cb(a)){var d=on(a,c);void 0===d&&(d="");d!==b&&(Mj(a,c,b),ir(this,"nodeCategory",ce,c,a,d,b))}else Mj(a,c,b)}};t.Fm=function(a,b){this.Dm(b,this.lq(a))};t.nm=function(){return!1};t.nk=function(){return!1};t.Qi=function(){return!1}; +t.Ps=function(){return!1};t.pk=function(){return!1};function ji(){return new Z}function cr(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 cr(a,b.constructor);return typeof b}function hr(a){return lr[a]?lr[a]:void 0!==x.go&&x.go[a]?x.go[a]:null} +function on(a,b){if(!a||!b)return null;try{if("function"===typeof b)var c=b(a);else"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c}function Mj(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){}} +na.Object.defineProperties(Z.prototype,{name:{get:function(){return this.na},set:function(a){var b=this.na;b!==a&&(this.na=a,this.g("name",b,a))}},dataFormat:{get:function(){return this.vn},set:function(a){var b=this.vn;b!==a&&(this.vn=a,this.g("dataFormat",b,a))}},isReadOnly:{get:function(){return this.Mg},set:function(a){var b=this.Mg;b!==a&&(this.Mg=a,this.g("isReadOnly",b,a))}},modelData:{ +get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(this.j=a,this.g("modelData",b,a),this.Da(a))}},undoManager:{get:function(){return this.o},set:function(a){var b=this.o;b!==a&&(null!==b&&b.xy(this),this.o=a,null!==a&&a.Ax(this))}},skipsUndoManager:{get:function(){return this.gh},set:function(a){this.gh=a}},nodeKeyProperty:{get:function(){return this.ni},set:function(a){var b=this.ni; +b!==a&&(""===a&&C("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===fe){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;za(a)&&"number"===typeof c&&(d=this.mc(a),b?(this.Rf.add(a),this.Xc[c]!==a&&this.Xc.splice(c,0,a),void 0!==d&&this.jb.add(d,a)):(this.Rf.remove(a),this.Xc[c]=== +a&&this.Xc.splice(c,1),void 0!==d&&this.jb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.xf(a.object);Array.isArray(d)&&"number"===typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)));return}}Z.prototype.changeState.call(this,a,b)}};t=nr.prototype;t.pm=function(a){if(void 0!==a){var b=this.mj;if(null!==b){var c=this.Vb(a);null===c&&(c=this.copyNodeData(b),Mj(c,this.nodeKeyProperty,a),this.nf(c))}return a}}; +t.Zx=function(a){return Jq(this,a,!0)};t.Wv=function(a,b){Rq(this,a,b,!0)};t.by=function(a){return Jq(this,a,!1)};t.$v=function(a,b){Rq(this,a,b,!1)};function Jq(a,b,c){if(null!==b&&(a=c?a.Xe:a.Ye,""!==a&&(a=on(b,a),void 0!==a))){if(Lq(a))return a;C((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} +function Rq(a,b,c,d){null===c&&(c=void 0);if(null!==b){var e=d?a.Xe:a.Ye;if(""!==e)if(c=a.pm(c),a.tc(b)){var f=on(b,e);f!==c&&(Pq(a,f,b),Mj(b,e,c),null===a.Vb(c)&&Qq(a,c,b),ir(a,d?"linkFromKey":"linkToKey",ce,e,b,f,c),"string"===typeof e&&a.Da(b,e))}else Mj(b,e,c)}}t.$x=function(a){return Iq(this,a,!0)};t.Xv=function(a,b){Sq(this,a,b,!0)};t.ey=function(a){return Iq(this,a,!1)};t.aw=function(a,b){Sq(this,a,b,!1)}; +function Iq(a,b,c){if(null===b)return"";a=c?a.Fj:a.Gj;if(""===a)return"";b=on(b,a);return void 0===b?"":b}function Sq(a,b,c,d){if(null!==b){var e=d?a.Fj:a.Gj;if(""!==e)if(a.tc(b)){var f=on(b,e);void 0===f&&(f="");f!==c&&(Mj(b,e,c),ir(a,d?"linkFromPortId":"linkToPortId",ce,e,b,f,c),"string"===typeof e&&a.Da(b,e))}else Mj(b,e,c)}}t.xf=function(a){if(null===a)return qr;var b=this.$d;if(""===b)return qr;a=on(a,b);return void 0===a?qr:a}; +t.et=function(a,b){if(null!==a){var c=this.$d;if(""!==c)if(this.tc(a)){var d=on(a,c);void 0===d&&(d=qr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.tc(a)&&(Pq(this,b,a),ir(this,"linkLabelKeys",fe,c,a,b,null,e,null)))}else void 0!==d&&C(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.mc=function(a){if(null!==a){var b=this.gi;if(""!==b&&(b=on(a,b),void 0!==b)){if(Lq(b))return b;C("Key value for link data "+a+" is not a number or a string: "+b)}}}; +t.dt=function(a,b){if(null!==a){var c=this.gi;if(""!==c)if(this.tc(a)){var d=on(a,c);d!==b&&null===this.zh(b)&&(Mj(a,c,b),void 0!==d&&this.jb.remove(d),this.jb.add(b,a),ir(this,"linkKey",ce,c,a,d,b),"string"===typeof c&&this.Da(a,c))}else Mj(a,c,b)}};t.zh=function(a){null===a&&C("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&Lq(a)?this.jb.H(a):null}; +t.Us=function(a){if(null!==a){var b=this.gi;if(""!==b){var c=this.mc(a);if(void 0===c||this.jb.contains(c)){var d=this.wl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.jb.contains(c))){Mj(a,b,c);return}if("string"===typeof c){for(d=2;this.jb.contains(c+d);)d++;Mj(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.jb.count-1;this.jb.contains(c);)c--;Mj(a,b,c)}}}}};t.tc=function(a){return null===a?!1:this.Rf.contains(a)};t.Ci=function(a){null!==a&&(ib(a),this.tc(a)||Nq(this,a,!0))}; +function Nq(a,b,c){if(""!==a.linkKeyProperty){var d=a.mc(b);if(void 0!==d&&a.jb.H(d)===b)return;a.Us(b);d=a.mc(b);void 0===d&&C("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.jb.add(d,b)}a.Rf.add(b);d=null;c&&(d=a.Xc.length,a.Xc.splice(d,0,b));ir(a,"linkDataArray",ee,"linkDataArray",a,null,b,null,d);rr(a,b)}t.hz=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.Xc.splice(d,1)}ir(a,"linkDataArray",fe,"linkDataArray",a,b,null,d,null);c=Jq(a,b,!0);Pq(a,c,b);c=Jq(a,b,!1);Pq(a,c,b);d=a.xf(b);if(Array.isArray(d))for(var e=d.length,f=0;f=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new E;b.addAll(a.iterator);a=new E;var c=new E;var d=this.sort(b);var e,f,g=this.$q;var h=this.arrangement;var k=this.nodeDiameterFormula;var l=this.radius;if(!isFinite(l)||0>=l)l=NaN;var m=this.aspectRatio;if(!isFinite(m)||0>=m)m=1;var n=this.startAngle; +isFinite(n)||(n=0);var p=this.sweepAngle;if(!isFinite(p)||360p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===Ir&&k===Jr?h=ur:h===Ir&&k!==Jr&&(h=this.arrangement);if((this.direction===Dr||this.direction===Er)&&this.sorting!==xr){for(k=0;!(k>=d.length);k+=2){a.add(d.J(k));if(k+1>=d.length)break;c.add(d.J(k+1))}this.direction===Dr?(this.arrangement===Ir&&a.reverse(),d=new E,d.addAll(a),d.addAll(c)):(this.arrangement===Ir&&c.reverse(),d=new E,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;r< +d.length;r++){var q=n+p*f*(this.direction===wr?1:-1)/k,u=d.J(r).diameter;isNaN(u)&&(u=Lr(d.J(r),q));360>p&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===Ir){isNaN(b)&&(b=6);if(h!==ur&&h!==Ir){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g= +r/(360<=p?k:k-1)}this.Lw=h;this.Zb=l;this.Dn=m;this.Mw=n;this.ir=p;this.qj=b;this.be=f;this.$q=g;b=d;d=this.Lw;h=this.Zb;l=this.Mw;m=this.ir;n=this.qj;p=this.be;k=this.$q;if(this.direction!==Dr&&this.direction!==Er||d!==Ir)if(this.direction===Dr||this.direction===Er){g=0;switch(d){case Hr:g=180*Or(this,h,p,l,k)/Math.PI;break;case ur:k=b=0;g=a.first();null!==g&&(b=Lr(g,Math.PI/2));g=c.first();null!==g&&(k=Lr(g,Math.PI/2));g=180*Or(this,h,p,l,n+(b+k)/2)/Math.PI;break;case Gr:g=m/b.length}if(this.direction=== +Dr){switch(d){case Hr:Pr(this,a,l,Fr);break;case ur:Qr(this,a,l,Fr);break;case Gr:Rr(this,a,m/2,l,Fr)}switch(d){case Hr:Pr(this,c,l+g,wr);break;case ur:Qr(this,c,l+g,wr);break;case Gr:Rr(this,c,m/2,l+g,wr)}}else{switch(d){case Hr:Pr(this,c,l,Fr);break;case ur:Qr(this,c,l,Fr);break;case Gr:Rr(this,c,m/2,l,Fr)}switch(d){case Hr:Pr(this,a,l+g,wr);break;case ur:Qr(this,a,l+g,wr);break;case Gr:Rr(this,a,m/2,l+g,wr)}}}else switch(d){case Hr:Pr(this,b,l,this.direction);break;case ur:Qr(this,b,l,this.direction); +break;case Gr:Rr(this,b,m,l,this.direction);break;case Ir:Sr(this,b,m,l,this.direction)}else Sr(this,b,m,l-m/2,wr)}this.updateParts();this.network=null;this.isValidLayout=!0};function Rr(a,b,c,d,e){var f=a.ir,g=a.Zb;a=a.be;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===wr?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;Vr(a,k,l,m,n,e,f)||Wr(a,k,l,m,n,e,f);k=f.x;l=f.y}J.free(f);a.Lj++;if(!(23Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0Math.abs(p)? +0:p;k=Math.abs(f)>Math.abs(n)?0n:0a.Lj?a.Zb-g/(2*Math.PI):5>m.length&&10=n.length-1)break;Vr(a,k,l,n,p,e,m)||Wr(a,k,l,n,p,e,m);k=m.x;l=m.y}J.free(m);a.Lj++;if(!(23a.Lj?a.Zb-f/(2*Math.PI):a.Zb-(0h){f=b-a;if(f<-h)return g.x=f,g.y=l,!1;m=!0}}else if(f=b-a,f<-h){f=b+a;if(f>h)return g.x=f,g.y=l,!1;m=!0}l=Math.sqrt(1-Math.min(1,f*f/(h*h)))*k;0>c!==m&&(l=-l);if(Math.abs(c-l)>(d[e].height+d[e+1].height)/2)return g.x=f,g.y=l,!1;g.x=f;g.y=l;return!0} +function Wr(a,b,c,d,e,f,g){var h=a.Zb,k=a.be,l=0;a=(d[e].height+d[e+1].height)/2+a.qj;d=!1;if(0<=b!==(f===wr)){if(f=c-a,f<-k){f=c+a;if(f>k){g.x=l;g.y=f;return}d=!0}}else if(f=c+a,f>k){f=c-a;if(f<-k){g.x=l;g.y=f;return}d=!0}l=Math.sqrt(1-Math.min(1,f*f/(k*k)))*h;0>b!==d&&(l=-l);g.x=l;g.y=f}tr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; +tr.prototype.commitNodes=function(){var a=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,b=a?this.group.location.copy():null,c=this.actualCenter;a?c=new J(0,0):(c.x=this.arrangementOrigin.x+this.Zb,c.y=this.arrangementOrigin.y+this.be);for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;e.x+=c.x;e.y+=c.y;e.commit()}a&&(this.group.Sa(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.ge(c.ge(a)),this.group.move(b),this.zw=b.ge(a))}; +tr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Nr(a,b,c,d,e){var f=a.Yy;if(.001>Math.abs(a.Dn-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;var g=0;var h=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1));for(var k=0,l=0;l<=f;l++){void 0!==d&&void 0!==e?k=d+l*e/f:k=l*Math.PI/(2*f);var m=Math.sin(k);g+=Math.sqrt(1-a*a*m*m)*h}return void 0!==d&&void 0!==e?(b>c?b:c)*g:4*(b>c?b:c)*g} +function Mr(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?Nr(a,1,c,d,e):Nr(a,1,c))}function Or(a,b,c,d,e){if(.001>Math.abs(a.Dn-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,g=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+h*a);g+=(b>c?b:c)*Math.sqrt(1-f*f*k*k)*a;if(g>=e)return h*a}} +tr.prototype.sort=function(a){switch(this.sorting){case Br:break;case Cr:a.reverse();break;case zr:a.sort(this.comparer);break;case Ar:a.sort(this.comparer);a.reverse();break;case xr:return this.Zs(Xr(a));default:C("Invalid sorting type.")}return a}; +function Xr(a){for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.J(f));b[f]=-1;f=a.J(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<=b[e]&&b[e]++;for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}return c} +tr.prototype.Zs=function(a){for(var b=[],c=0;cb[c].indexOf(e)&&b[c].push(e);for(d=d.sourceEdges;d.next();)e=a.indexOf(d.value.fromVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e)}f=[];for(c=0;cb[c[q]].indexOf(c[q===c.length-1?0:q+1])&&r.push(q===c.length-1?0:q+1);if(0===r.length)for(q=0;qc.indexOf(F)||Bc.indexOf(F)||B=u?B+1:B)),w+=B=u&&B++,y>=u&&y++,B>y&&(A=y,y=B,B=A),y-B<(c.length+2)/2===(Br||r===m||(q=r>m?r-m:m-r,n+=rg-q?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b=a?this.Vl=a:this.Vl=360,this.B())}},arrangement:{get:function(){return this.Gb},set:function(a){this.Gb===a||a!==Ir&&a!==ur&&a!==Hr&&a!==Gr||(this.Gb=a,this.B())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==wr&&a!==Fr&&a!==Dr&&a!==Er||(this.K=a,this.B())}},sorting:{get:function(){return this.Yc},set:function(a){this.Yc===a||a!==Br&&a!==Cr&& +a!==zr&&!Ar&&a!==xr||(this.Yc=a,this.B())}},comparer:{get:function(){return this.Rc},set:function(a){this.Rc!==a&&(this.Rc=a,this.B())}},spacing:{get:function(){return this.ef},set:function(a){this.ef!==a&&(this.ef=a,this.B())}},nodeDiameterFormula:{get:function(){return this.Oo},set:function(a){this.Oo===a||a!==yr&&a!==Jr||(this.Oo=a,this.B())}},actualXRadius:{get:function(){return this.Zb}}, +actualYRadius:{get:function(){return this.be}},actualSpacing:{get:function(){return this.qj}},actualCenter:{get:function(){return this.zw}}}); +var ur=new D(tr,"ConstantSpacing",0),Hr=new D(tr,"ConstantDistance",1),Gr=new D(tr,"ConstantAngle",2),Ir=new D(tr,"Packed",3),wr=new D(tr,"Clockwise",4),Fr=new D(tr,"Counterclockwise",5),Dr=new D(tr,"BidirectionalLeft",6),Er=new D(tr,"BidirectionalRight",7),Br=new D(tr,"Forwards",8),Cr=new D(tr,"Reverse",9),zr=new D(tr,"Ascending",10),Ar=new D(tr,"Descending",11),xr=new D(tr,"Optimized",12),yr=new D(tr,"Pythagorean",13),Jr=new D(tr,"Circular",14);tr.className="CircularLayout";tr.ConstantSpacing=ur; +tr.ConstantDistance=Hr;tr.ConstantAngle=Gr;tr.Packed=Ir;tr.Clockwise=wr;tr.Counterclockwise=Fr;tr.BidirectionalLeft=Dr;tr.BidirectionalRight=Er;tr.Forwards=Br;tr.Reverse=Cr;tr.Ascending=zr;tr.Descending=Ar;tr.Optimized=xr;tr.Pythagorean=yr;tr.Circular=Jr;function vr(){this.jm=-Infinity;this.Pm=this.Ck=null} +vr.prototype.compare=function(a,b){if(0this.jm||Math.abs(a)a&&0h?(e=p.x+p.width/2,f=p.y+p.height/2,l[0]=new J(p.x+p.width+d.width,p.y),l[1]=new J(p.x,p.y+p.height+d.height),h=2):(k=cs(l,h,e,f,p.width,p.height,d),n=l[k],r=new J(n.x+ +p.width+d.width,n.y),p=new J(n.x,n.y+p.height+d.height),k+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().bounds,d=this.network.vertexes.iterator;d.next();){if(d.value.bounds.Ic(c)&&(a++,2a.network.vertexes.count)return!1;a.sh=a.network.vertexes.xa();a=a.sh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Gd-a.Gd});for(b=a.length-1;0<=b&&1>=a[b].Gd;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mr&& +(r=1);h=L.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new N(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new J(p.x+g,p.y+h)}}a.network=d;return c}function gs(a,b){for(var c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Je){var e=d.Je.J(d.Uv);d.Gd=e.mt;var f=e.pw,g=e.qw;d.bounds=new N(d.centerX-f,d.centerY-g,e.nt,e.lt);d.focus=new J(f,g);d.Uv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} +function hs(a,b){var c=b.bk;if(null!==c&&0!==c.count){var d=b.centerX,e=b.centerY,f=b.width,g=b.height;null!==b.Je&&0=n.Gd?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0>1)+l)*(0===h%2?1:-1);k.centerX=d+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} +function cs(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;lm.y&&a[p].x-m.xm.x&&a[p].y-m.yb+f?(c=d+e-g,a=a-b-f,L.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,L.sqrt(c*c+a*a)):a+cb+f?a-(b+f):a+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.centerX,e=d,f=c=c.centerY,g=1;gf-c)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerX-b.centerX}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerY-b.centerY});c=a.Pf;var l=d=h=0;for(f= +0;fc||l-k>c){if(e)break}else if(m-r>c||r-m>c){if(!e)break}else{var q=js(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new ls),q=d.random(), +h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*q):kr?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):kn?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new ls),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;for(e=d=0;ea.epsilonDistance*a.epsilonDistance}$r.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};$r.prototype.moveFixedVertex=function(){};$r.prototype.commitLayout=function(){this.Yv();this.commitNodes();this.isRouting&&this.commitLinks()}; +$r.prototype.Yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=Vc,b.toSpot=Vc)}};$r.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=N.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;N.free(c)}c=N.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}N.free(c)}; +$r.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};$r.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Yk:a};$r.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Xk:a};$r.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Vk:a};$r.prototype.electricalFieldX=function(){return 0};$r.prototype.electricalFieldY=function(){return 0}; +$r.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Wk:a};$r.prototype.gravitationalFieldX=function(){return 0};$r.prototype.gravitationalFieldY=function(){return 0};$r.prototype.isFixed=function(a){return a.isFixed}; +na.Object.defineProperties($r.prototype,{currentIteration:{get:function(){return this.po}},arrangementSpacing:{get:function(){return this.Nd},set:function(a){this.Nd.A(a)||(this.Nd.assign(a),this.B())}},arrangesToOrigin:{get:function(){return this.bn},set:function(a){this.bn!==a&&(this.bn=a,this.B())}},setsPortSpots:{get:function(){return this.df},set:function(a){this.df!==a&&(this.df= +a,this.B())}},comments:{get:function(){return this.gd},set:function(a){this.gd!==a&&(this.gd=a,this.B())}},maxIterations:{get:function(){return this.xl},set:function(a){this.xl!==a&&0<=a&&(this.xl=a,this.B())}},epsilonDistance:{get:function(){return this.Gn},set:function(a){this.Gn!==a&&0u&&0u&&0a[this.pc]&&(this.ji=a[c]-1,this.pc=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.qf===l.qf||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;vn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>v)&&h++,qn||u===n&&v>m)&&h++);f[g*e+g]=h;for(k=g+ +1;k=c)for(h=d[g].destinationEdgesArrayAccess,y=d[k].destinationEdgesArrayAccess,l=0;l=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}ys(a,b,d);return f}function Gs(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();){var h=g.value;var k=h.toVertex;var l=b.layer-k.layer;h=a.linkMinLength(h);l===h&&Gs(a,k,c,d,e,f)}if(f)for(g=b.sourceEdges;g.next();)h=g.value,k=h.fromVertex,l=k.layer-b.layer,h=a.linkMinLength(h),l===h&&Gs(a,k,c,d,e,f)}} +function Hs(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)Hs(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)Hs(a,b.value.fromVertex,c,d,e,f)}} +os.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Uk){default:case Is: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!==Js(a);){for(e=Ks(a);null!==e;)d[c]=e,c--,e.valid=!1,e=Ks(a);for(e=Ls(a);null!==e;)d[b]=e,b++,e.valid=!1,e=Ls(a);e=null;for(var f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.destinationEdges;l.next();)l.value.toVertex.valid&& +k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||fb.toVertex.index&&(a.Am(b),b.rev=!0);break;case ps:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.jg=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Xg=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& +Ms(this,b);for(d.reset();d.next();)b=d.value,-1===b.jg&&Ms(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.jgd){if(0>d)for(b.reset();b.next();)b.value.layer-=d;d=[];for(b.reset();b.next();)c=b.value,e=d[c.layer],void 0===e?d[c.layer]=[c]:e.push(c);for(c=b=0;cg&&Gs(a,h,0,-1,!0,!1)}for(Gs(a,b,1,-1,!0,!0);0!==b.component;){f=0;d=Infinity;h=0;k=null;for(g=a.network.vertexes.iterator;g.next();){var l=g.value;if(1===l.component){var m=0,n=!1,p=l.sourceEdgesArrayAccess; +e=p.length;for(var r=0;rf)&&!m&&(h=g,f=l)}if(0>d){for(c.reset();c.next();)d=c.value,1===d.component&&(d.layer-=e);b.component=0}else h.component=0}}} +function ws(a,b,c){return 90===a.K?c&&!b.rev||!c&&b.rev?270:90:180===a.K?c&&!b.rev||!c&&b.rev?0:180:270===a.K?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} +os.prototype.initializeIndices=function(){switch(this.il){default:case Ts:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.zb[c];this.zb[c]++}break;case rs:a=this.network.vertexes.iterator;for(b=this.ra;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Us(this,c);break;case Vs:for(a=this.network.vertexes.iterator,b=0;b<=this.ra;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Ws(this,c)}}; +function Us(a,b){var c=b.layer;b.index=a.zb[c];a.zb[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;df.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;cf.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c=g;d--)f=Ys(this,d,-1)||f;e=this.countCrossings();e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ys(this,d,1)||f;e=this.countCrossings();e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ys(this,d,1)||f;e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= +Ys(this,d,-1)||f;e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ys(this,d,0)||f;e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ys(this,d,0)||f;e>=a?Bs(this,b):(a=e,b=As(this))}break;default:case ss:for(c=this.ra,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Ys(this,d,-1)||f;e=this.countCrossings();e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ys(this,d,1)||f;e=this.countCrossings();e>=a?Bs(this,b): +(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ys(this,d,1)||f;e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ys(this,d,-1)||f;e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ys(this,d,0)||f;e>=a?Bs(this,b):(a=e,b=As(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ys(this,d,0)||f;e>=a?Bs(this,b):(a=e,b=As(this))}}Bs(this,b)}; +function Xs(a,b,c){var d=xs(a,b),e=a.zb[b],f=Fs(a,b,c),g=Es(a,b,c);for(c=0;cf+1&&(p+=4*(z-f),r+=4*(z-(f+1)))}A=d[f].destinationEdges.iterator;for(A.reset();A.next();)if(z=A.value,y=z.toVertex,z.valid&&y.layer===b){for(z=0;d[z]!==y;)z++;z===f+1&&(r+=1)}A=d[f+1].sourceEdges.iterator;for(A.reset();A.next();)if(z=A.value,y=z.fromVertex,z.valid&&y.layer===b){for(z=0;d[z]!==y;)z++;zf+1&&(p+=4*(z-(f+1)),r+=4*(z-f))}A=d[f+1].destinationEdges.iterator; +for(A.reset();A.next();)if(z=A.value,y=z.toVertex,z.valid&&y.layer===b){for(z=0;d[z]!==y;)z++;z===f&&(p+=1)}z=y=0;A=g[d[f].index];var B=h[d[f].index],F=g[d[f+1].index],K=h[d[f+1].index];-1!==A&&(y+=Math.abs(A-q),z+=Math.abs(A-w));-1!==B&&(y+=Math.abs(B-q),z+=Math.abs(B-w));-1!==F&&(y+=Math.abs(F-u),z+=Math.abs(F-v));-1!==K&&(y+=Math.abs(K-u),z+=Math.abs(K-v));if(r>1)+8*d;this.Ca*=8}if(0!==(this.Wf&2))for(c=!0;c;){c=!1;for(b=this.pc+1;b<=this.ra;b++)c=bt(this,b,1)|| +c;for(b=this.pc-1;0<=b;b--)c=bt(this,b,-1)||c;c=bt(this,this.pc,0)||c}if(0!==(this.Wf&4)){for(b=this.pc+1;b<=this.ra;b++)ct(this,b,1);for(b=this.pc-1;0<=b;b--)ct(this,b,-1);ct(this,this.pc,0)}a&&(dt(this,-1),dt(this,1));if(0!==(this.Wf&2))for(c=!0;c;){c=!1;c=bt(this,this.pc,0)||c;for(b=this.pc+1;b<=this.ra;b++)c=bt(this,b,0)||c;for(b=this.pc-1;0<=b;b--)c=bt(this,b,0)||c}};function bt(a,b,c){for(var d=!1;et(a,b,c);)d=!0;return d} +function et(a,b,c){var d,e=xs(a,b),f=a.zb[b],g=Es(a,b,-1);if(0c)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u=0;if(0>=c)for(var v=e[d].sourceEdges.iterator;v.next();){var w=v.value;var z=w.fromVertex; +if(w.valid&&z.layer!==b){var y=zs(w);var A=w.portFromColOffset;w=w.portToColOffset;z=z.column;p+=(Math.abs(m+w-(z+A))+1)*y;q+=(Math.abs(r+w-(z+A))+1)*y;u+=(Math.abs(n+w-(z+A))+1)*y}}if(0<=c)for(v=e[d].destinationEdges.iterator;v.next();)w=v.value,z=w.toVertex,w.valid&&z.layer!==b&&(y=zs(w),A=w.portFromColOffset,w=w.portToColOffset,z=z.column,p+=(Math.abs(m+A-(z+w))+1)*y,q+=(Math.abs(r+A-(z+w))+1)*y,u+=(Math.abs(n+A-(z+w))+1)*y);w=A=y=0;v=g[e[d].index];z=h[e[d].index];-1!==v&&(y+=Math.abs(v-m),A+= +Math.abs(v-r),w+=Math.abs(v-n));-1!==z&&(y+=Math.abs(z-m),A+=Math.abs(z-r),w+=Math.abs(z-n));if(q=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}ys(a,b,d);a.normalize()} +function ft(a,b){for(var c=!0,d=a.network.vertexes.iterator;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),g=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+g>=b){c=!1;break}}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} +function gt(a,b){var c=b+1;var d,e=[],f=[];for(d=0;d<=a.ra;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();){d=g.value;var h=d.column-a.nodeMinColumnSpace(d,!0),k=d.column+a.nodeMinColumnSpace(d,!1);h<=b&&k>=b&&(e[d.layer]=!0);h<=c&&k>=c&&(f[d.layer]=!0)}h=!0;c=!1;for(d=0;d<=a.ra;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 dt(a,b){for(var c=0;c<=a.Ca;c++)for(;ft(a,c););a.normalize();for(c=0;cf?Bs(a,e):gb)for(c=a.Ca;0<=c;c--)for(e=As(a),f=Ds(a),d=f+1;ff?Bs(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Bc);a.Bc++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Hs(a,b,a.Bc,-1,!0,!0),a.Bc++);var f;b=[];for(f=0;fc)for(g=a.Ca;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} +os.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=vs(this,!0),b=vs(this,!1),c=this.network.edges.iterator;c.next();){var d=c.value.link;null!==d&&(d.fromSpot=a,d.toSpot=b)}this.commitNodes();this.gv();this.isRouting&&this.commitLinks()};function vs(a,b){return 270===a.K?b?cd:fd:90===a.K?b?fd:cd:180===a.K?b?dd:ed:b?ed:dd} +os.prototype.commitNodes=function(){this.Yd=[];this.vd=[];this.ud=[];this.Ka=[];for(var a=0;a<=this.ra;a++)this.Yd[a]=0,this.vd[a]=0,this.ud[a]=0,this.Ka[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.Yd[c]=Math.max(this.Yd[c],this.nodeMinLayerSpace(b,!0));this.vd[c]=Math.max(this.vd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.Zd;for(var d=0;d<=this.ra;d++){var e=c;0>=this.Yd[d]+this.vd[d]&&(e=0);0=n.bounds.bottom?(n=n.bounds.y+n.bounds.height,b.l(q++,A,n+F),b.l(q++,A,n),b.l(q++,A,n-y)):(b.l(q++,A,B+F),b.l(q++,A,B),b.l(q++,A,B-y)):270===this.K?B<=n.bounds.y?(n=n.bounds.y,b.l(q++,A,n-y),b.l(q++,A,n),b.l(q++,A,n+F)):(b.l(q++,A,B-y),b.l(q++,A,B),b.l(q++,A,B+F)):0===this.K&&(A>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.l(q++,n+F,B),b.l(q++,n,B),b.l(q++,n-y,B)):(b.l(q++,A+F,B),b.l(q++,A,B),b.l(q++,A-y,B)));else{b.l(q++,w,z);var K=0;if(180===this.K||0===this.K){if(180===this.K?A>=n.bounds.right: +A<=n.bounds.x)K=(0===this.K?-y:F)/2;b.l(q++,w+K,B)}else{if(270===this.K?B>=n.bounds.bottom:B<=n.bounds.y)K=(90===this.K?-y:F)/2;b.l(q++,A,z+K)}b.l(q++,A,B)}}else y=Math.max(10,this.Yd[v.layer]),F=Math.max(10,this.vd[v.layer]),r?180===this.K?(b.l(q++,A-y-u,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.max(A+F-u/2,A),B),b.l(q++,A+F+u,B)):90===this.K?(b.l(q++,A,B+F+u),b.l(q++,A,Math.max(B+F-u/2,B)),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B-y-u)): +270===this.K?(b.l(q++,A,B-y-u),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,A,Math.max(B+F-u/2,B)),b.l(q++,A,B+F+u)):(b.l(q++,A+F+u,B),b.l(q++,Math.max(A+F-u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A-y-u,B)):b.l(q++,A,B)}n=v}if(null===h||l!==rc||p)if(w=b.i(q-1).x,z=b.i(q-1).y,A=b.i(q).x,B=b.i(q).y,p)u=this.vd[m.layer],180===this.K||0===this.K?(p=z,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.K?A>=m.bounds.x:A<=m.bounds.right)&&(n=m.centerX+(180=== +this.K?-u:u),p=m.bounds.x&&p<=m.bounds.right&&(270===this.K?B>=m.bounds.y:B<=m.bounds.bottom)&&(n=m.centerY+(270===this.K?-u:u),p=m.bounds.x?(n=m.bounds.x+ +m.bounds.width,b.L(q-2,n,z),b.L(q-1,n+F,z)):90===this.K&&B<=m.bounds.bottom?(n=m.bounds.y,b.L(q-2,w,n),b.L(q-1,w,n-y)):270===this.K&&B>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.L(q-2,w,n),b.L(q-1,w,n+F)):0===this.K&&A<=m.bounds.right&&(n=m.bounds.x,b.L(q-2,n,z),b.L(q-1,n-y,z));else{y=Math.max(10,this.Yd[m.layer]);F=Math.max(10,this.vd[m.layer]);p=0;if(180===this.K||0===this.K){if(180===this.K?A<=m.bounds.x:A>=m.bounds.right)p=(0===this.K?F:-y)/2;b.l(q++,A+p,z)}else{if(270===this.K?B<=m.bounds.y: +B>=m.bounds.bottom)p=(90===this.K?F:-y)/2;b.l(q++,w,B+p)}b.l(q++,A,B)}}else{for(;null!==m&&m!==n;){y=v=null;for(m=m.destinationEdges.iterator;m.next()&&(w=m.value,w.link!==c.link||(v=w.toVertex,y=w.fromVertex,null!==y.node&&(y=null),null!==v.node)););if(null===v)break;v!==n&&(w=b.i(q-1).x,z=b.i(q-1).y,A=v.centerX,B=v.centerY,p?180===this.K||0===this.K?(null!==y?y.centerY:z)!==B&&(y=this.Ka[v.layer]+this.Qc.x,q===b.firstPickIndex+1&&(y=0===this.K?Math.max(y,w):Math.min(y,w)),b.l(q++,y,z),b.l(q++,y, +B)):(null!==y?y.centerX:w)!==A&&(y=this.Ka[v.layer]+this.Qc.y,q===b.firstPickIndex+1&&(y=90===this.K?Math.max(y,z):Math.min(y,z)),b.l(q++,w,y),b.l(q++,A,y)):(y=Math.max(10,this.Yd[v.layer]),F=Math.max(10,this.vd[v.layer]),r?180===this.K?(b.l(q++,A+F+u,B),b.l(q++,Math.max(A+F-u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A-y-u,B)):90===this.K?(b.l(q++,A,B-y-u),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,A,Math.max(B+F-u/2,B)),b.l(q++,A,B+F+u)):270=== +this.K?(b.l(q++,A,B+F+u),b.l(q++,A,Math.max(B+F-u/2,B)),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B-y-u)):(b.l(q++,A-y-u,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.max(A+F-u/2,A),B),b.l(q++,A+F+u,B)):180===this.K?(b.l(q++,A+F,B),b.l(q++,A-y,B)):90===this.K?(b.l(q++,A,B-y),b.l(q++,A,B+F)):270===this.K?(b.l(q++,A,B+F),b.l(q++,A,B-y)):(b.l(q++,A-y,B),b.l(q++,A+F,B))));m=v}p&&(w=b.i(q-1).x,z=b.i(q-1).y,A=b.i(q).x,B=b.i(q).y,180===this.K||0===this.K? +z!==B&&(y=0===this.K?Math.min(Math.max((A+w)/2,this.Ka[n.layer]+this.Qc.x),A):Math.max(Math.min((A+w)/2,this.Ka[n.layer]+this.Qc.x),A),b.l(q++,y,z),b.l(q++,y,B)):w!==A&&(y=90===this.K?Math.min(Math.max((B+z)/2,this.Ka[n.layer]+this.Qc.y),B):Math.max(Math.min((B+z)/2,this.Ka[n.layer]+this.Qc.y),B),b.l(q++,w,y),b.l(q++,A,y)))}null!==d&&r&&(null!==g&&(l===rc&&(l=b.i(0),d=b.i(2),l.A(d)||b.L(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,rc,!0,!1,f,h),l.u()||l.set(e.actualBounds.center),b.L(0,l.x,l.y)), +null!==h&&(k===rc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.A(l)||b.L(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,rc,!1,!1,e,g),e.u()||e.set(f.actualBounds.center),b.L(b.pointsCount-1,e.x,e.y)));b.rf();c.commit()}}}this.avoidOrthogonalOverlaps()}; +os.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new E,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0f.y&&(m=l.y>f.y?0:g.xf.x&&(m=l.x>f.x?0:g.yb.layer?1:a.cdb.cd?1:a.scb.sc?1:0:0};t.Ay=function(a,b){return a instanceof it&&b instanceof it&&a!==b?a.firstb.first||a.jb.j||a.cdb.cd?1:a.scb.sc?1:0:0}; +t.ct=function(a,b){return a instanceof it&&b instanceof it&&a!==b?a.Xbb.Xb||a.jb.j||a.cdb.cd?1:a.scb.sc?1:0:0};t.w=function(a,b){a-=b;return-1a}; +t.Wi=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&C("not in range 0 <= from < length: "+c),2===f)d=a[c],e=a[c+1],0=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b=e)for(d=a.slice(c),d.sort(b),b=c;b=a.ve.length){var d=[];for(var e=0;ea&&(this.Wf=a,this.B())}},setsPortSpots:{get:function(){return this.df},set:function(a){this.df!==a&&(this.df=a,this.B())}}, +linkSpacing:{get:function(){return this.vo},set:function(a){this.vo!==a&&0<=a&&(this.vo=a,this.B())}},maxLayer:{get:function(){return this.ra}},maxIndex:{get:function(){return this.ji}},maxColumn:{get:function(){return this.Ca}},minIndexLayer:{get:function(){return this.Qg}},maxIndexLayer:{get:function(){return this.pc}}}); +var ps=new D(os,"CycleDepthFirst",0),Is=new D(os,"CycleGreedy",1),us=new D(os,"CycleFromLayers",2),qs=new D(os,"LayerOptimalLinkLength",0),Ns=new D(os,"LayerLongestPathSink",1),Ps=new D(os,"LayerLongestPathSource",2),rs=new D(os,"InitDepthFirstOut",0),Vs=new D(os,"InitDepthFirstIn",1),Ts=new D(os,"InitNaive",2),Zs=new D(os,"AggressiveNone",0),ss=new D(os,"AggressiveLess",1),$s=new D(os,"AggressiveMore",2),at=8;os.className="LayeredDigraphLayout";os.CycleDepthFirst=ps;os.CycleGreedy=Is; +os.CycleFromLayers=us;os.LayerOptimalLinkLength=qs;os.LayerLongestPathSink=Ns;os.LayerLongestPathSource=Ps;os.InitDepthFirstOut=rs;os.InitDepthFirstIn=Vs;os.InitNaive=Ts;os.AggressiveNone=Zs;os.AggressiveLess=ss;os.AggressiveMore=$s;os.PackNone=0;os.PackExpand=1;os.PackStraighten=2;os.PackMedian=4;os.PackAll=15;function it(){this.index=this.sc=this.cd=this.Xb=this.first=this.layer=0;this.link=null;this.j=0}it.className="SegInfo";function ts(a){Sp.call(this,a)}ma(ts,Sp);ts.prototype.createVertex=function(){return new jt(this)}; +ts.prototype.createEdge=function(){return new kt(this)};ts.className="LayeredDigraphNetwork";function jt(a){fq.call(this,a);this.Qa=this.wg=this.ei=-1;this.C=NaN;this.M=null;this.valid=!1;this.finish=this.jg=NaN;this.qf=0;this.uk=this.vk=null}ma(jt,fq); +jt.prototype.serializeVertexProperties=function(a,b){fq.prototype.serializeVertexProperties.call(this,a,b);a.layer=this.layer;a.column=this.column;a.index=this.index;a.component=this.component;a.near=this.near?gb(this.near):null;a.valid=this.valid;a.jg=this.jg;a.finish=this.finish;a.qf=this.qf;a.vk=this.vk;a.uk=this.uk}; +jt.prototype.deserializeVertexProperties=function(a,b,c,d){fq.prototype.deserializeVertexProperties.call(this,a,b,c,d);this.layer=a.layer;this.column=a.column;this.index=a.index;this.component=a.component;if(b=b.get(a.near))this.near=b;this.valid=a.valid;this.jg=a.jg;this.finish=a.finish;this.qf=a.qf;this.vk=a.vk;this.uk=a.uk}; +na.Object.defineProperties(jt.prototype,{layer:{get:function(){return this.ei},set:function(a){this.ei!==a&&(this.ei=a)}},column:{get:function(){return this.wg},set:function(a){this.wg!==a&&(this.wg=a)}},index:{get:function(){return this.Qa},set:function(a){this.Qa!==a&&(this.Qa=a)}},component:{get:function(){return this.C},set:function(a){this.C!==a&&(this.C=a)}},near:{ +get:function(){return this.M},set:function(a){this.M!==a&&(this.M=a)}}});jt.className="LayeredDigraphVertex";function kt(a){gq.call(this,a);this.j=this.Ha=this.Wa=!1;this.Ga=this.C=NaN;this.M=this.o=0}ma(kt,gq); +kt.prototype.serializeEdgeProperties=function(a,b){gq.prototype.serializeEdgeProperties.call(this,a,b);a.valid=this.valid;a.rev=this.rev;a.forest=this.forest;a.portFromPos=this.portFromPos;a.portToPos=this.portToPos;a.portFromColOffset=this.portFromColOffset;a.portToColOffset=this.portToColOffset}; +kt.prototype.deserializeEdgeProperties=function(a,b,c,d){gq.prototype.deserializeEdgeProperties.call(this,a,b,c,d);this.valid=a.valid;this.rev=a.rev;this.forest=a.forest;this.portFromPos=a.portFromPos;this.portToPos=a.portToPos;this.portFromColOffset=a.portFromColOffset;this.portToColOffset=a.portToColOffset}; +na.Object.defineProperties(kt.prototype,{fromVertex:{get:function(){return this.Tc},set:function(a){this.Tc!==a&&(this.Tc=a)}},toVertex:{get:function(){return this.ad},set:function(a){this.ad!==a&&(this.ad=a)}},valid:{get:function(){return this.Wa},set:function(a){this.Wa!==a&&(this.Wa=a)}},rev:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},forest:{ +get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.C},set:function(a){this.C!==a&&(this.C=a)}},portToPos:{get:function(){return this.Ga},set:function(a){this.Ga!==a&&(this.Ga=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.M}, +set:function(a){this.M!==a&&(this.M=a)}}});kt.className="LayeredDigraphEdge";function lt(a){li.call(this);this.Jb=new G;this.Yo=mt;this.jd=nt;this.Qp=ot;this.Gr=pt;this.Aw=[];this.gd=!0;this.Gb=qt;this.Nd=(new M(10,10)).freeze();var b=new rt(this);this.V=new st(b);this.W=new st(b);this.Qu=[];a&&Object.assign(this,a)}ma(lt,li); +lt.prototype.cloneProtected=function(a){li.prototype.cloneProtected.call(this,a);a.Yo=this.Yo;a.Qp=this.Qp;a.Gr=this.Gr;a.gd=this.gd;a.Gb=this.Gb;a.Nd.assign(this.Nd);a.V.copyInheritedPropertiesFrom(this.V);a.W.copyInheritedPropertiesFrom(this.W)}; +lt.prototype.gb=function(a){a.classType===lt?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:C("Unknown enum value: "+a):li.prototype.gb.call(this,a)};lt.prototype.createNetwork=function(){return new rt(this)}; +lt.prototype.makeNetwork=function(a){function b(a){if(a instanceof W)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof U){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof T?(c.hg(a.nodes,!0,b),c.hg(a.links,!0,b)):a instanceof hf?c.hg(a.memberParts,!1,b):c.hg(a.iterator,!1,b);return c}; +lt.prototype.doLayout=function(a){null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==tt&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof T&&(b=a);this.path===mt&&null!==b?this.jd=b.isTreePathToChildren?nt:ut:this.jd=this.path===mt?nt:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0}lt.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ee?du(a,g,ba,w,z):eu(a,g,ba,w,z);ba=z.x;w=z.width;z=z.height;break;case Pt:for(A=0;An&&(Sdb&&(ju(a,-db,0,da,ra-1),ku(A,-db,0),ku(B,-db,0),db=0)}Ca.U.h(db,R);w=Math.max(w,F);z=Math.max(z,y+(0===O?0:q)+cb.height);S=F}else{0n&&(Rdb&&(ju(a,0,-db,da,ra-1),ku(A,0,-db),ku(B,0,-db),db=0);Ca.U.h(S,db);z=Math.max(z,K);w=Math.max(w,y+(0===O?0:q)+cb.width);R=K}H++}0l&&(l=0),135u&&(u=0),k===Qt&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>w&&(w=pu(k,d-w,0),g=w.x,h=w.y,w=d,l=0):w=nu(a,w,l),0>l&&(g-=l,l=0),135z&&(z=pu(k,0,v-z),g=z.x,h=z.y,z=v,u=0):z=ou(a,z,u),0>u&&(h-=u,u=0),g+=d+c);if(0e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].ye[0].x?e[3].assign(e[2]):e[2].assign(e[3])),O[0].h(l+d,0),O[1].h(O[0].x,v),O[2].ye[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].xe[0].y?e[3].assign(e[2]):e[2].assign(e[3])),O[0].h(0,u+v),O[1].h(d,O[0].y),O[2].xd?du(b,e,H,y, +A):eu(b,e,H,y,A);H=A.x;y=A.width;A=A.height;break;case Pt:for(a=0;ap&&(Fp&&(Kn&&(n=0),135w&&(w=0));b.fa.h(n,w);b.va.h(y,A)}} +function du(a,b,c,d,e){var f=b.length;if(0===f)return new N(c,0,d,e);if(1===f)return a=b[0],d=a.va.width,e=a.va.height,new N(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===Zt(a),l=0,m=0,n=0,p=0;pk&&(d-=k),e=Math.max(e,Math.max(p,n)+h+f.height),0>b.U.x&& +(c=su(a,b.U.x,!1,c,g))):(b.U.h(d+h,c+g/2-b.focus.y-b.fa.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.fa.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.U.y&&(c=su(a,b.U.y,!0,c,g))));return new N(c,0,d,e)} +function eu(a,b,c,d,e){var f=b.length;if(0===f)return new N(c,0,d,e);if(1===f)return b=b[0],d=b.va.width,e=b.va.height,new N(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===Zt(a),l=0,m=0,n=0,p=0;pm&&(d-=m),e=Math.max(e,Math.abs(Math.min(p,n))+q+l.height), +0>h.U.x&&(c=su(a,h.U.x,!1,c,g))):(h.U.h(-d-l.width-q,c+g/2-h.focus.y-h.fa.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.fa.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.U.y&&(c=su(a,h.U.y,!0,c,g))));for(a=0;ab&&(b=c+a.width),0>c&&(b-=c),b;case cu:return a.width>b?a.width:b;case $t:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case Ot:case Et:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case Pt:return a.width-a.focus.x+a.nodeSpacing/2+b;case Qt:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} +function ou(a,b,c){switch(a.alignment){case mu:case lu:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case cu:return a.height>b?a.height:b;case $t:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case Ot:case Et:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case Pt:return a.height-a.focus.y+a.nodeSpacing/2+b;case Qt:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} +function pu(a,b,c){switch(a){case lu:b/=2;c/=2;break;case mu:b/=2;c/=2;break;case cu:c=b=0;break;case $t:break;default:C("Unhandled alignment value "+a.toString())}return new J(b,c)}function gu(a,b,c,d,e,f){b=pu(b,c,d);ju(a,b.x,b.y,e,f)}function ju(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].U;f.x+=b;f.y+=c}} +function hu(a,b,c,d){var e=b.parent;switch(a.jd){case nt:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case ut:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:C("Unhandled path value "+a.jd.toString())}}function ku(a,b,c){for(var d=0;dn.length||null===r||2>r.length))for(e=c=0;cl&&f.yf.y&&lb.length||null===c||2>c.length)d=null;else{m=fu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=fu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=fu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=fu(a,e);for(c=0;cn.length||null===r||2>r.length))for(e=c=0;ck&&f.xf.x&&kb.length||null===c||2>c.length)d=null;else{m=fu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=fu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=fu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=fu(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}function au(a){var b=Zt(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.V.nodeIndentPastParent=a,this.B())}},nodeSpacing:{get:function(){return this.V.nodeSpacing},set:function(a){this.V.nodeSpacing!==a&&(this.V.nodeSpacing=a,this.B())}},layerSpacing:{get:function(){return this.V.layerSpacing},set:function(a){this.V.layerSpacing!== +a&&(this.V.layerSpacing=a,this.B())}},layerSpacingParentOverlap:{get:function(){return this.V.layerSpacingParentOverlap},set:function(a){this.V.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.V.layerSpacingParentOverlap=a,this.B())}},compaction:{get:function(){return this.V.compaction},set:function(a){this.V.compaction===a||a!==Tt&&a!==Vt||(this.V.compaction=a,this.B())}},breadthLimit:{get:function(){return this.V.breadthLimit}, +set:function(a){this.V.breadthLimit!==a&&0<=a&&(this.V.breadthLimit=a,this.B())}},rowSpacing:{get:function(){return this.V.rowSpacing},set:function(a){this.V.rowSpacing!==a&&(this.V.rowSpacing=a,this.B())}},rowIndent:{get:function(){return this.V.rowIndent},set:function(a){this.V.rowIndent!==a&&0<=a&&(this.V.rowIndent=a,this.B())}},commentSpacing:{get:function(){return this.V.commentSpacing},set:function(a){this.V.commentSpacing!== +a&&(this.V.commentSpacing=a,this.B())}},commentMargin:{get:function(){return this.V.commentMargin},set:function(a){this.V.commentMargin!==a&&(this.V.commentMargin=a,this.B())}},setsPortSpot:{get:function(){return this.V.setsPortSpot},set:function(a){this.V.setsPortSpot!==a&&(this.V.setsPortSpot=a,this.B())}},portSpot:{get:function(){return this.V.portSpot},set:function(a){this.V.portSpot.A(a)||(this.V.portSpot= +a,this.B())}},setsChildPortSpot:{get:function(){return this.V.setsChildPortSpot},set:function(a){this.V.setsChildPortSpot!==a&&(this.V.setsChildPortSpot=a,this.B())}},childPortSpot:{get:function(){return this.V.childPortSpot},set:function(a){this.V.childPortSpot.A(a)||(this.V.childPortSpot=a,this.B())}},alternateSorting:{get:function(){return this.W.sorting},set:function(a){this.W.sorting===a||a!==Jt&&a!==Kt&& +a!==Lt&&!Mt||(this.W.sorting=a,this.B())}},alternateComparer:{get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(this.W.comparer=a,this.B())}},alternateAngle:{get:function(){return this.W.angle},set:function(a){this.W.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.W.angle=a,this.B())}},alternateAlignment:{get:function(){return this.W.alignment},set:function(a){this.W.alignment!== +a&&(this.W.alignment=a,this.B())}},alternateNodeIndent:{get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!==a&&0<=a&&(this.W.nodeIndent=a,this.B())}},alternateNodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.B())}},alternateNodeSpacing:{get:function(){return this.W.nodeSpacing}, +set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.B())}},alternateLayerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(this.W.layerSpacing=a,this.B())}},alternateLayerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.B())}},alternateCompaction:{ +get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==Tt&&a!==Vt||(this.W.compaction=a,this.B())}},alternateBreadthLimit:{get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.B())}},alternateRowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.B())}},alternateRowIndent:{ +get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.B())}},alternateCommentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(this.W.commentSpacing=a,this.B())}},alternateCommentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.B())}},alternateSetsPortSpot:{ +get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.B())}},alternatePortSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.A(a)||(this.W.portSpot=a,this.B())}},alternateSetsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.B())}},alternateChildPortSpot:{ +get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.A(a)||(this.W.childPortSpot=a,this.B())}}}); +var mt=new D(lt,"PathDefault",-1),nt=new D(lt,"PathDestination",0),ut=new D(lt,"PathSource",1),Jt=new D(lt,"SortingForwards",10),Kt=new D(lt,"SortingReverse",11),Lt=new D(lt,"SortingAscending",12),Mt=new D(lt,"SortingDescending",13),lu=new D(lt,"AlignmentCenterSubtrees",20),mu=new D(lt,"AlignmentCenterChildren",21),cu=new D(lt,"AlignmentStart",22),$t=new D(lt,"AlignmentEnd",23),Ot=new D(lt,"AlignmentBus",24),Et=new D(lt,"AlignmentBusBranching",25),Pt=new D(lt,"AlignmentTopLeftBus",26),Qt=new D(lt, +"AlignmentBottomRightBus",27),Tt=new D(lt,"CompactionNone",30),Vt=new D(lt,"CompactionBlock",31),ot=new D(lt,"StyleLayered",40),It=new D(lt,"StyleLastParents",41),Ht=new D(lt,"StyleAlternating",42),Gt=new D(lt,"StyleRootOnly",43),qt=new D(lt,"ArrangementVertical",50),uu=new D(lt,"ArrangementHorizontal",51),tt=new D(lt,"ArrangementFixedRoots",52),pt=new D(lt,"LayerIndividual",60),Ct=new D(lt,"LayerSiblings",61),Bt=new D(lt,"LayerUniform",62);lt.className="TreeLayout";lt.PathDefault=mt; +lt.PathDestination=nt;lt.PathSource=ut;lt.SortingForwards=Jt;lt.SortingReverse=Kt;lt.SortingAscending=Lt;lt.SortingDescending=Mt;lt.AlignmentCenterSubtrees=lu;lt.AlignmentCenterChildren=mu;lt.AlignmentStart=cu;lt.AlignmentEnd=$t;lt.AlignmentBus=Ot;lt.AlignmentBusBranching=Et;lt.AlignmentTopLeftBus=Pt;lt.AlignmentBottomRightBus=Qt;lt.CompactionNone=Tt;lt.CompactionBlock=Vt;lt.StyleLayered=ot;lt.StyleLastParents=It;lt.StyleAlternating=Ht;lt.StyleRootOnly=Gt;lt.ArrangementVertical=qt; +lt.ArrangementHorizontal=uu;lt.ArrangementFixedRoots=tt;lt.LayerIndividual=pt;lt.LayerSiblings=Ct;lt.LayerUniform=Bt;function rt(a){Sp.call(this,a)}ma(rt,Sp);rt.prototype.createVertex=function(){return new st(this)};rt.prototype.createEdge=function(){return new wu(this)};rt.className="TreeNetwork"; +function st(a){fq.call(this,a);this.Ga=!1;this.yc=null;this.C=[];this.Oc=this.Wa=this.M=this.Ha=0;this.gd=null;this.U=new J(0,0);this.va=new M(0,0);this.fa=new J(0,0);this.Cm=this.Bm=this.TA=!1;this.Eq=this.sq=null;this.Yc=Jt;this.Rc=mq;this.xb=0;this.wb=mu;this.Pr=this.Or=0;this.Qr=20;this.Zd=50;this.Fr=0;this.Yq=Vt;this.Rq=0;this.Zr=25;this.Xq=this.Yr=10;this.Wq=20;this.ds=!0;this.Vr=Vc;this.cs=!0;this.Uq=Vc}ma(st,fq); +st.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.Yc=a.sorting,this.Rc=a.comparer,this.xb=a.angle,this.wb=a.alignment,this.Or=a.nodeIndent,this.Pr=a.nodeIndentPastParent,this.Qr=a.nodeSpacing,this.Zd=a.layerSpacing,this.Fr=a.layerSpacingParentOverlap,this.Yq=a.compaction,this.Rq=a.breadthLimit,this.Zr=a.rowSpacing,this.Yr=a.rowIndent,this.Xq=a.commentSpacing,this.Wq=a.commentMargin,this.ds=a.setsPortSpot,this.Vr=a.portSpot,this.cs=a.setsChildPortSpot,this.Uq=a.childPortSpot)}; +na.Object.defineProperties(st.prototype,{initialized:{get:function(){return this.Ga},set:function(a){this.Ga!==a&&(this.Ga=a)}},parent:{get:function(){return this.yc},set:function(a){this.yc!==a&&(this.yc=a)}},children:{get:function(){return this.C},set:function(a){if(this.C!==a){if(null!==a)for(var b=a.length,c=0;cp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-bu(c))))):c.alignment===cu?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-bu(c))))):c.alignment===cu?(e=d.left+b.x,0===b.x&&m.xp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-bu(c))))):c.alignment===cu?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-bu(c))))):c.alignment===cu?(e=d.left+b.x,0===b.x&&m.x + + + + +
+ + +
+
+ This text is displayed if your browser does not support the Canvas + HTML element. +
+
+ + diff --git a/addon/chrome/content/workspace.xul b/addon/chrome/content/workspace.xul index 115767a..0f9feb3 100644 --- a/addon/chrome/content/workspace.xul +++ b/addon/chrome/content/workspace.xul @@ -19,8 +19,10 @@ + @@ -30,7 +32,7 @@ - +
@@ -45,11 +47,18 @@
- + + + +
Select Main Knowledge
+
+
+ Switch Outline/Mind Map View +
Add Heading diff --git a/build.js b/build.js index 48a4e77..aa80a7c 100644 --- a/build.js +++ b/build.js @@ -111,6 +111,7 @@ const optionsAddon = { path.join(buildDir, "**/*.rdf"), path.join(buildDir, "**/*.dtd"), path.join(buildDir, "**/*.xul"), + path.join(buildDir, "**/*.html"), path.join(buildDir, "**/*.manifest"), "update.rdf", ], diff --git a/src/knowledge.ts b/src/knowledge.ts index 2c294f1..ef82d74 100644 --- a/src/knowledge.ts +++ b/src/knowledge.ts @@ -42,7 +42,10 @@ class Knowledge extends AddonBase { this._Addon.views.bindTreeViewResize(); this.setWorkspaceNote("main"); this.currentLine = -1; + this._Addon.views.initKnowledgeWindow(win); + this._Addon.views.switchView(true); this._Addon.views.buildOutline(); + // this._Addon.views.buildMindMap(); } } @@ -473,6 +476,7 @@ class Knowledge extends AddonBase { const isLink = lineElement.search(/zotero:\/\/note\//g) !== -1; if (isHeading || isLink) { let name = ""; + let link = ""; if (isHeading) { const startIndex = lineElement.search(headerStartReg); const stopIndex = lineElement.search(headerStopReg); @@ -483,6 +487,8 @@ class Knowledge extends AddonBase { } else { name = lineElement.slice(lineElement.search(/">/g) + 2); name = name.slice(0, name.search(/<\//g)); + link = lineElement.slice(lineElement.search(/href="/g) + 6); + link = link.slice(0, link.search(/"/g)); } while (currentNode.model.rank >= currentRank) { currentNode = currentNode.parent; @@ -497,6 +503,7 @@ class Knowledge extends AddonBase { name: name, lineIndex: i, endIndex: noteLines.length, + link: link, }); currentNode.addChild(lastNode); currentNode = lastNode; @@ -508,7 +515,7 @@ class Knowledge extends AddonBase { getNoteTreeAsList( note: ZoteroItem, filterRoot: boolean = true, - filterLikn: boolean = true + filterLink: boolean = true ): TreeModel.Node[] { note = note || this.getWorkspaceNote(); if (!note) { @@ -517,7 +524,7 @@ class Knowledge extends AddonBase { return this.getNoteTree(note).all( (node) => (!filterRoot || node.model.lineIndex >= 0) && - (!filterLikn || node.model.rank <= 6) + (!filterLink || node.model.rank <= 6) ); } diff --git a/src/views.ts b/src/views.ts index 762f8e5..189ce51 100644 --- a/src/views.ts +++ b/src/views.ts @@ -4,6 +4,8 @@ class AddonViews extends AddonBase { progressWindowIcon: object; editorIcon: object; $: any; + outlineView: boolean; + _initIframe: typeof Promise; constructor(parent: Knowledge4Zotero) { super(parent); @@ -21,7 +23,10 @@ class AddonViews extends AddonBase { export: ``, close: ``, openWorkspaceCollectionView: ``, + switchView: ``, }; + this.outlineView = true; + this._initIframe = Zotero.Promise.defer(); } getEditor(_document: Document) { @@ -181,13 +186,18 @@ class AddonViews extends AddonBase { } if (lineIndex >= indexMap.length) { lineIndex = indexMap.length - 1; - } else if (indexMap.length < 0) { + } else if (lineIndex < 0) { + lineIndex = 0; + } + lineIndex = indexMap[lineIndex]; + if (lineIndex >= editor.children.length) { + lineIndex = editor.children.length - 1; + } else if (lineIndex < 0) { lineIndex = 0; } - const mappedIndex = indexMap[lineIndex]; // @ts-ignore - editor.parentNode.scrollTo(0, editor.children[mappedIndex].offsetTop); + editor.parentNode.scrollTo(0, editor.children[lineIndex].offsetTop); } addNewKnowledgeButton() { @@ -203,7 +213,7 @@ class AddonViews extends AddonBase { }); button.setAttribute( "style", - "list-style-image: url('chrome://Knowledge4Zotero/skin/knowledge.png');" + "list-style-image: url('chrome://Knowledge4Zotero/skin/knowledge@0.5x.png');" ); addNoteButton.after(button); } @@ -347,28 +357,103 @@ class AddonViews extends AddonBase { return reader.annotationItemIDs.length === updateCount; } + initKnowledgeWindow(_window: Window) { + _window.addEventListener("message", (e) => this.messageHandler(e), false); + } + + async messageHandler(e) { + const _window = this._Addon.knowledge.getWorkspaceWindow(); + if (e.data.type === "ready") { + this._initIframe.resolve(); + } else if (e.data.type === "getMindMapData") { + ( + _window.document.getElementById("mindmapIframe") as HTMLIFrameElement + ).contentWindow.postMessage( + { + type: "setMindMapData", + nodes: this._Addon.knowledge.getNoteTreeAsList(), + }, + "*" + ); + } else if (e.data.type === "jumpNode") { + this.scrollToLine( + await this._Addon.knowledge.getWorkspaceEditorInstance(), + e.data.lineIndex + ); + } else if (e.data.type === "jumpNote") { + Zotero.debug(e.data); + this._Addon.events.onEditorEvent( + new EditorMessage("onNoteLink", { + params: await this._Addon.knowledge.getNoteFromLink(e.data.link), + }) + ); + } + } + + switchView(status: boolean = undefined) { + if (typeof status === "undefined") { + status = !this.outlineView; + } + const _window = this._Addon.knowledge.getWorkspaceWindow(); + const mindmap = _window.document.getElementById("mindmap-container"); + const outline = _window.document.getElementById("outline-container"); + this.outlineView = status; + if (this.outlineView) { + mindmap.setAttribute("hidden", "hidden"); + outline.removeAttribute("hidden"); + } else { + outline.setAttribute("hidden", "hidden"); + mindmap.removeAttribute("hidden"); + } + this.buildOutline(this._Addon.knowledge.getWorkspaceNote()); + } + + async updateMindMap() { + Zotero.debug("Knowledge4Zotero: updateMindMap"); + await this._initIframe; + const _window = this._Addon.knowledge.getWorkspaceWindow(); + const iframe = _window.document.getElementById( + "mindmapIframe" + ) as HTMLIFrameElement; + iframe.contentWindow.postMessage( + { + type: "setMindMapData", + nodes: this._Addon.knowledge.getNoteTreeAsList(undefined, true, false), + }, + "*" + ); + } + + /* + * Outline Code Start + */ + async buildOutline(note: ZoteroItem) { - this._Addon.knowledge.currentNodeID = -1; - let treeList = this._Addon.knowledge.getNoteTreeAsList(note, true, false); - const treeData = []; - treeList.map((node: TreeModel.Node) => { - treeData.push({ - id: String(node.model.id), - name: node.model.name, - rank: node.model.rank, - icon: node.model.rank === 7 ? "textdocument" : undefined, - lineIndex: node.model.lineIndex, - endIndex: node.model.endIndex, - isDirectory: node.hasChildren(), - expanded: true, - parentId: - node.model.rank > 1 ? String(node.parent.model.id) : undefined, + if (this.outlineView) { + this._Addon.knowledge.currentNodeID = -1; + let treeList = this._Addon.knowledge.getNoteTreeAsList(note, true, false); + const treeData = []; + treeList.map((node: TreeModel.Node) => { + treeData.push({ + id: String(node.model.id), + name: node.model.name, + rank: node.model.rank, + icon: node.model.rank === 7 ? "textdocument" : undefined, + lineIndex: node.model.lineIndex, + endIndex: node.model.endIndex, + isDirectory: node.hasChildren(), + expanded: true, + parentId: + node.model.rank > 1 ? String(node.parent.model.id) : undefined, + }); }); - }); - this.$(() => { - this.createTreeView("#treeview", treeData); - this.createSortable("#treeview", "treeData"); - }); + this.$(() => { + this.createTreeView("#treeview", treeData); + this.createSortable("#treeview", "treeData"); + }); + } else { + this.updateMindMap(); + } } createTreeView(selector, items) { @@ -399,6 +484,13 @@ class AddonViews extends AddonBase { ); }, }); + this.$("#outline-switchview").dxButton({ + // icon: this.editorIcon["switchView"], + icon: "chart", + onClick: async (e) => { + this.switchView(); + }, + }); this.$("#outline-addafter").dxButton({ icon: "plus", onClick: (e) => { @@ -509,6 +601,10 @@ class AddonViews extends AddonBase { height: `${this.$("window").height() - 130}px`, width: `${this.$("#zotero-knowledge-outline").width() - 10}px`, }); + this.$("#mindmapIframe").css({ + height: `${this.$("window").height() - 58}px`, + width: `${this.$("#zotero-knowledge-outline").width() - 10}px`, + }); } createSortable(selector, driveName) { @@ -668,6 +764,10 @@ class AddonViews extends AddonBase { return null; } + /* + * Outline Code End + */ + showProgressWindow( header: string, context: string,