/*
 * GoJS v1.5.9 JavaScript Library for HTML Diagrams
 * Northwoods Software, http://www.nwoods.com/
 * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
 * Copyright (C) 1998-2015 by Northwoods Software Corporation.  All Rights Reserved.
 * THIS SOFTWARE IS LICENSED.  THE LICENSE AGREEMENT IS AT: http://www.gojs.net/1.5.9/doc/license.html.
 */
(function(window) { var g,da={};if(!window.document||void 0===window.document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=(new Date).getTime(),f=Math.max(8,16-(c-a)),h=window.setTimeout(function(){b(c+f)},f);a=c+f;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(a){window.clearTimeout(a)})})();da.Debug=null;
var u={Xc:1,Fc:2,Oc:4,Nc:8,Dm:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),aH:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),bH:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),Em:0<=navigator.platform.toUpperCase().indexOf("MAC"),cH:null!==navigator.platform.match(/(iPhone|iPod|iPad)/i),gD:function(a,b,c){var d=-1;return function(){var e=this,f=arguments;-1!==d&&
u.clearTimeout(d);d=u.setTimeout(function(){d=-1;c||a.apply(e,f)},b);c&&!d&&a.apply(e,f)}},setTimeout:function(a,b){return window.setTimeout(a,b)},clearTimeout:function(a){window.clearTimeout(a)},setInterval:function(a,b){return window.setInterval(a,b)},clearInterval:function(a){window.clearInterval(a)},createElement:function(a){return window.document.createElement(a)},k:function(a){throw Error(a);},I:function(a,b){if(a.Ca){var c="The object is frozen, so its properties cannot be set: "+a.toString();
void 0!==b&&(c+="  to value: "+b);u.k(c)}},C:function(a,b,c,d){a instanceof b||(c=u.getTypeName(c),void 0!==d&&(c+="."+d),u.Kd(a,b,c))},j:function(a,b,c,d){typeof a!==b&&(c=u.getTypeName(c),void 0!==d&&(c+="."+d),u.Kd(a,b,c))},ze:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=u.getTypeName(b),void 0!==c&&(b+="."+c),u.k(b+" must be a real number type, and not NaN or Infinity: "+a))},rb:function(a,b,c,d){a instanceof ea&&a.Ae===b||(c=u.getTypeName(c),void 0!==d&&(c+="."+d),u.Kd(a,"a constant of class "+
u.rg(b),c))},cJ:function(a,b){"string"===typeof a?fa(a)||u.k('Color "'+a+'" is not a valid color string for '+b):a instanceof ga||u.k("Value for "+b+" must be a color string or a Brush, not "+a)},Kd:function(a,b,c,d){b=u.getTypeName(b);c=u.getTypeName(c);void 0!==d&&(c+="."+d);"string"===typeof a?u.k(c+" value is not an instance of "+b+': "'+a+'"'):u.k(c+" value is not an instance of "+b+": "+a)},wa:function(a,b,c,d){c=u.getTypeName(c);void 0!==d&&(c+="."+d);u.k(c+" is not in the range "+b+": "+a)},
Wc:function(a){u.k(u.rg(a)+" constructor cannot take any arguments.")},Mb:function(a){u.k("Collection was modified during iteration: "+a.toString()+"\n  Perhaps you should iterate over a copy of the collection,\n  or you could collect items to be removed from the collection after the iteration.")},trace:function(a){window.console&&window.console.log(a)},Sa:function(a){return"object"===typeof a&&null!==a},isArray:function(a){return Array.isArray(a)||a instanceof NodeList||a instanceof HTMLCollection},
eH:function(a){return Array.isArray(a)},Qy:function(a,b,c){u.isArray(a)||u.Kd(a,"Array or NodeList or HTMLCollection",b,c)},qb:function(a){return a.length},Pk:function(a){return Array.prototype.slice.call(a)},fb:function(a,b){Array.isArray(a);return a[b]},RC:function(a,b,c){Array.isArray(a)?a[b]=c:u.k("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Py:function(a,b){if(Array.isArray(a))return a.indexOf(b);for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1},yi:function(a,
b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):u.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},zi:function(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):u.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},Ww:[],K:function(){var a=u.Ww.pop();return void 0===a?new w:a},fc:function(a,b){var c=u.Ww.pop();if(void 0===c)return new w(a,b);c.x=a;c.y=b;return c},v:function(a){u.Ww.push(a)},xA:[],ul:function(){var a=u.xA.pop();return void 0===
a?new ia:a},Oj:function(a){u.xA.push(a)},Xw:[],Sf:function(){var a=u.Xw.pop();return void 0===a?new z:a},Vj:function(a,b,c,d){var e=u.Xw.pop();if(void 0===e)return new z(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},ic:function(a){u.Xw.push(a)},yA:[],jh:function(){var a=u.yA.pop();return void 0===a?new ja:a},Ye:function(a){u.yA.push(a)},Yw:null,p:function(){var a=u.Yw;return null!==a?(u.Yw=null,a):new ka},q:function(a){a.reset();u.Yw=a},wA:[],eb:function(){var a=u.wA.pop();return void 0===a?
[]:a},ra:function(a){a.length=0;u.wA.push(a)},mh:Object.freeze([]),zA:1,gc:function(a){a.__gohashid=u.zA++},Is:function(a){var b=a.__gohashid;void 0===b&&(b=u.zA++,a.__gohashid=b);return b},Uc:function(a){return a.__gohashid},fa:function(a,b){b.hx=a;da[a]=b},Ga:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Lh:function(a){a.AF=!0},defineProperty:function(a,b,c,d,e){u.j(a,"function","Util.defineProperty:classfunc");u.j(b,"object","Util.defineProperty:propobj");
u.j(c,"function","Util.defineProperty:getter");u.j(d,"function","Util.defineProperty:setter");for(var f in b){b=b[f];c={get:c,set:d};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,f,c);e=Object.getOwnPropertyDescriptor(a.prototype,f);b&&e&&Object.defineProperty(a.prototype,b,e);break}},u:function(a,b,c,d){u.j(a,"function","Util.defineReadOnlyProperty:classfunc");u.j(b,"object","Util.defineReadOnlyProperty:propobj");u.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var f=
b[e];b={get:c,set:function(a){u.k('The property "'+f+'" is read-only and cannot be set to '+a)}};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);f&&d&&Object.defineProperty(a.prototype,f,d);break}},Xd:function(a,b){for(var c in b)b[c]=!0;a.prototype.UB=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?u.rg(a):null===a?"*":""},rg:function(a){if("function"===typeof a){if(a.hx)return a.hx;
if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,c).trim();if(""!==b)return a.hx=b}else if("object"===typeof a&&a.constructor)return u.rg(a.constructor);return typeof a},s:function(a,b,c){u.j(a,"function","Util.defineEnumValue:classfunc");u.j(b,"string","Util.defineEnumValue:name");u.j(c,"number","Util.defineEnumValue:num");c=new ea(a,b,c);Object.freeze(c);a[b]=c;var d=a.Dt;d instanceof la||(d=new la("string",ea),a.Dt=d);d.add(b,c);return c},sb:function(a,b){if(!a||!b)return null;
var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c},Oa:function(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){}},ot:function(a,b){u.j(a,"object","Setting properties requires Objects as arguments");u.j(b,"object","Setting properties requires Objects as arguments");var c=a instanceof A,d=a instanceof D,e;for(e in b){""===e&&u.k("Setting properties requires non-empty property names");
var f=a,h=e;if(c||d){var k=e.indexOf(".");if(0<k){var l=e.substring(0,k);if(c)f=a.je(l);else if(f=a[l],void 0===f||null===f)f=a.tb[l];u.Sa(f)?h=e.substr(k+1):u.k("Unable to find object named: "+l+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==h[0]&&!u.jz(f,h))if(d&&u.jz(a.tb,h))f=a.tb;else if(d&&ma(a,h)){a.Ky(h,b[h]);continue}else u.k('Trying to set undefined property "'+h+'" on object: '+f.toString());f[h]=b[e];"_"===h[0]&&(k=f.Bl,u.isArray(k)||(k=[],f.Bl=k),k.push(h))}},jz:function(a,
b){if(a.hasOwnProperty(b))return!0;for(var c=Object.getPrototypeOf(a);c&&c!==Function;){if(c.hasOwnProperty(b))return!0;var d=c.UB;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},VC:function(a,b){if(!u.Sa(b)||b instanceof Element||b instanceof CanvasRenderingContext2D||b instanceof oa||b instanceof pa)return"";var c="",d;for(d in b)if("string"!==typeof d)""===c&&(c=b+"\n"),c+="  "+d+" is not a string property\n";else if("_"!==d.charAt(0)&&!(2>=d.length)){var e=u.sb(b,d);null===e||"function"===
typeof e||u.jz(b,d)||(""===c&&(c=b+"\n"),c+='  unknown property "'+d+'" has value: '+e+" at "+a+"\n")}return c},Kv:function(a,b){if(null!==b&&"number"!==typeof b&&"string"!==typeof b&&"boolean"!==typeof b&&"function"!==typeof b)if(void 0!==u.Uc(b)){if(!u.bv.contains(b))if(u.bv.add(b),u.Ju.add(u.VC(a,b)),b instanceof E||b instanceof F||b instanceof la)for(var c=b.i;c.next();)u.Kv(a+"["+c.key+"]",c.value);else for(c in b){var d=u.sb(b,c);if(void 0!==d&&null!==d&&u.Sa(d)&&d!==b.UB){if(b instanceof qa){if(d===
b.ej)continue}else if(b instanceof A){if("data"===c||d===b.qh)continue;if("itemArray"===c||d===b.gi)continue;if(b instanceof G&&d===b.Bk)continue}else if(!(b instanceof D))if(b instanceof sa){if("archetypeGroupData"===c||d===b.ax)continue}else if(b instanceof ta){if("archetypeLinkData"===c||d===b.ex)continue;if("archetypeLabelNodeData"===c||d===b.bx)continue}else if(b instanceof va){if("archetypeNodeData"===c||d===b.ik)continue}else if(b instanceof J){if("nodeDataArray"===c||d===b.mf)continue;if("linkDataArray"===
c||d===b.Bh||d===b.Rl)continue;if(d===b.tc)continue;if(d===b.uh)continue}else if(b instanceof xa||b instanceof ya||b instanceof Aa)continue;u.Kv(a+"."+c,d)}}}else if(Array.isArray(b))for(c=0;c<b.length;c++)u.Kv(a+"["+c+"]",b[c]);else u.Ju.add(u.VC(a,b))},check:function(a){void 0===u.bv?u.bv=new F(Object):u.bv.clear();u.Ju=new Ba;u.Kv("",a);a=u.Ju.toString();u.Ju=null;return a},PH:function(a){for(var b=[],c=0;256>c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;
for(var d=c=0,f="",h=0;h<a.length;h++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(h)^b[(b[c]+b[d])%256]);return f},PG:function(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);for(var d=[],e=0,c=0;c<a.length;c+=2)d[e++]=b[a.substr(c,2)];a=d.join("");return""===a?"0":a},Da:function(a){return u.PH(u.PG(a))},wl:null,adym:"7da71ca0ad381e90",XF:"@COLOR1",YF:"@COLOR2"};
u.wl=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[u.Da("7ca11abfd022028846")]=u.Da("398c3597c01238");for(var c=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22412913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[u.Da("7ca11abfd7330390")](u.Da(c[d-1]),10,15*d+0);b[u.Da("7ca11abfd022028846")]=u.Da("39f046ebb36e4b");for(d=1;5>d;d++)b[u.Da("7ca11abfd7330390")](u.Da(c[d-
1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])u.s=function(a,b){var c=new ea(a,b,2);Object.freeze(c);a[b]=c;var d=a.Dt;d instanceof la||(d=new la("string",ea),a.Dt=d);d.add(b,c);return c};return a}();function ea(a,b,c){u.gc(this);this.HA=a;this.Ub=b;this.FF=c}ea.prototype.toString=function(){return u.rg(this.HA)+"."+this.Ub};u.u(ea,{Ae:"classType"},function(){return this.HA});u.u(ea,{name:"name"},function(){return this.Ub});u.u(ea,{value:"value"},function(){return this.FF});var Da;
ea.findName=Da=function(a,b){if(null===b||""===b)return null;u.j(a,"function","findName:classfunc");u.j(b,"string","EnumValue.findName:name");var c=a.Dt;return c instanceof la?c.ta(b):null};function Ba(){this.FA=[]}Ba.prototype.toString=function(){return this.FA.join("")};Ba.prototype.add=function(a){""!==a&&this.FA.push(a)};function pa(){}
function Ga(a){void 0===a&&(a=42);this.seed=a;this.Pw=48271;this.Ct=2147483647;this.uA=this.Ct/this.Pw;this.hF=this.Ct%this.Pw;this.dF=1/this.Ct;this.random()}Ga.prototype.random=function(){var a=this.seed%this.uA*this.Pw-this.seed/this.uA*this.hF;this.seed=0<a?a:a+this.Ct;return this.seed*this.dF};function Ha(){}u.u(Ha,{i:"iterator"},function(){return this});Ha.prototype.reset=Ha.prototype.reset=function(){};Ha.prototype.next=Ha.prototype.hasNext=Ha.prototype.next=function(){return!1};
Ha.prototype.first=Ha.prototype.first=function(){return null};Ha.prototype.any=function(){return!1};Ha.prototype.all=function(){return!0};Ha.prototype.each=function(){};u.u(Ha,{count:"count"},function(){return 0});Ha.prototype.Vf=function(){};Ha.prototype.toString=function(){return"EmptyIterator"};var Ia=new Ha;function Ja(a){this.key=-1;this.value=a}u.Xd(Ja,{key:!0,value:!0});u.u(Ja,{i:"iterator"},function(){return this});Ja.prototype.reset=Ja.prototype.reset=function(){this.key=-1};
Ja.prototype.next=Ja.prototype.hasNext=Ja.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Ja.prototype.first=Ja.prototype.first=function(){this.key=0;return this.value};Ja.prototype.any=function(a){this.key=-1;return a(this.value)};Ja.prototype.all=function(a){this.key=-1;return a(this.value)};Ja.prototype.each=function(a){this.key=-1;a(this.value)};u.u(Ja,{count:"count"},function(){return 1});Ja.prototype.Vf=function(){this.value=null};
Ja.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function Ka(a){this.xd=a;this.sj=null;this.reset()}u.Xd(Ka,{key:!0,value:!0});u.u(Ka,{i:"iterator"},function(){return this});u.defineProperty(Ka,{Km:"predicate"},function(){return this.sj},function(a){this.sj=a});Ka.prototype.reset=Ka.prototype.reset=function(){var a=this.xd;a.wd=null;this.Xa=a.U;this.ud=-1};
Ka.prototype.next=Ka.prototype.hasNext=Ka.prototype.next=function(){var a=this.xd;if(a.U!==this.Xa){if(0>this.key)return!1;u.Mb(a)}var a=a.n,b=a.length,c=++this.ud,d=this.sj;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.ud=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Vf()}return!1};
Ka.prototype.first=Ka.prototype.first=function(){var a=this.xd;this.Xa=a.U;this.ud=0;var a=a.n,b=a.length,c=this.sj;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.ud=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};Ka.prototype.any=function(a){var b=this.xd;b.wd=null;var c=b.U;this.ud=-1;for(var d=b.n,e=d.length,f=this.sj,h=0;h<e;h++){var k=d[h];if(null===f||f(k)){if(a(k))return!0;b.U!==c&&u.Mb(b)}}return!1};
Ka.prototype.all=function(a){var b=this.xd;b.wd=null;var c=b.U;this.ud=-1;for(var d=b.n,e=d.length,f=this.sj,h=0;h<e;h++){var k=d[h];if(null===f||f(k)){if(!a(k))return!1;b.U!==c&&u.Mb(b)}}return!0};Ka.prototype.each=function(a){var b=this.xd;b.wd=null;var c=b.U;this.ud=-1;for(var d=b.n,e=d.length,f=this.sj,h=0;h<e;h++){var k=d[h];if(null===f||f(k))a(k),b.U!==c&&u.Mb(b)}};u.u(Ka,{count:"count"},function(){var a=this.sj;if(null!==a){for(var b=0,c=this.xd.n,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.xd.n.length});
Ka.prototype.Vf=function(){this.key=-1;this.value=null;this.Xa=-1;this.sj=null;this.xd.wd=this};Ka.prototype.toString=function(){return"ListIterator@"+this.ud+"/"+this.xd.count};function La(a){this.xd=a;this.reset()}u.Xd(La,{key:!0,value:!0});u.u(La,{i:"iterator"},function(){return this});La.prototype.reset=La.prototype.reset=function(){var a=this.xd;a.In=null;this.Xa=a.U;this.ud=a.n.length};
La.prototype.next=La.prototype.hasNext=La.prototype.next=function(){var a=this.xd;if(a.U!==this.Xa){if(0>this.key)return!1;u.Mb(a)}var b=--this.ud;if(0<=b)return this.key=b,this.value=a.n[b],!0;this.Vf();return!1};La.prototype.first=La.prototype.first=function(){var a=this.xd;this.Xa=a.U;var b=a.n;this.ud=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};
La.prototype.any=function(a){var b=this.xd;b.In=null;var c=b.U,d=b.n,e=d.length;this.ud=e;for(e-=1;0<=e;e++){if(a(d[e]))return!0;b.U!==c&&u.Mb(b)}return!1};La.prototype.all=function(a){var b=this.xd;b.In=null;var c=b.U,d=b.n,e=d.length;this.ud=e;for(e-=1;0<=e;e++){if(!a(d[e]))return!1;b.U!==c&&u.Mb(b)}return!0};La.prototype.each=function(a){var b=this.xd;b.In=null;var c=b.U,d=b.n,e=d.length;this.ud=e;for(e-=1;0<=e;e++)a(d[e]),b.U!==c&&u.Mb(b)};u.u(La,{count:"count"},function(){return this.xd.n.length});
La.prototype.Vf=function(){this.key=-1;this.value=null;this.Xa=-1;this.xd.In=this};La.prototype.toString=function(){return"ListIteratorBackwards("+this.ud+"/"+this.xd.count+")"};
function E(a){u.gc(this);this.Ca=!1;this.n=[];this.U=0;this.In=this.wd=null;void 0===a||null===a?this.oa=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.oa=a:u.wa(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.oa=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:u.wa(a,"null, a primitive type name, or a class type",
"List constructor: type")}u.fa("List",E);E.prototype.Pd=function(){var a=this.U;a++;999999999<a&&(a=0);this.U=a};E.prototype.freeze=E.prototype.freeze=function(){this.Ca=!0;return this};E.prototype.thaw=E.prototype.La=function(){this.Ca=!1;return this};E.prototype.toString=function(){return"List("+u.getTypeName(this.oa)+")#"+u.Uc(this)};E.prototype.add=E.prototype.push=E.prototype.add=function(a){null!==a&&(u.I(this,a),this.n.push(a),this.Pd())};
E.prototype.addAll=E.prototype.Td=function(a){if(null===a)return this;u.I(this);var b=this.n;if(u.isArray(a))for(var c=u.qb(a),d=0;d<c;d++){var e=u.fb(a,d);b.push(e)}else for(a=a.i;a.next();)e=a.value,b.push(e);this.Pd();return this};E.prototype.clear=E.prototype.clear=function(){u.I(this);this.n.length=0;this.Pd()};E.prototype.contains=E.prototype.has=E.prototype.contains=function(a){return null===a?!1:-1!==this.n.indexOf(a)};
E.prototype.indexOf=E.prototype.indexOf=function(a){return null===a?-1:this.n.indexOf(a)};E.prototype.elt=E.prototype.get=E.prototype.ja=function(a){var b=this.n;(0>a||a>=b.length)&&u.wa(a,"0 <= i < length",E,"elt:i");return b[a]};E.prototype.setElt=E.prototype.set=E.prototype.Bg=function(a,b){var c=this.n;(0>a||a>=c.length)&&u.wa(a,"0 <= i < length",E,"setElt:i");u.I(this,a);c[a]=b};E.prototype.first=E.prototype.first=function(){var a=this.n;return 0===a.length?null:a[0]};
E.prototype.last=E.prototype.Gd=function(){var a=this.n,b=a.length;return 0<b?a[b-1]:null};E.prototype.pop=E.prototype.pop=function(){u.I(this);var a=this.n;return 0<a.length?a.pop():null};E.prototype.any=function(a){for(var b=this.n,c=this.U,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.U!==c&&u.Mb(this)}return!1};E.prototype.all=function(a){for(var b=this.n,c=this.U,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.U!==c&&u.Mb(this)}return!0};
E.prototype.each=function(a){for(var b=this.n,c=this.U,d=b.length,e=0;e<d;e++)a(b[e]),this.U!==c&&u.Mb(this)};E.prototype.insertAt=E.prototype.Yd=function(a,b){0>a&&u.wa(a,">= 0",E,"insertAt:i");u.I(this,a);var c=this.n;a>=c.length?c.push(b):c.splice(a,0,b);this.Pd();return!0};E.prototype.remove=E.prototype["delete"]=E.prototype.remove=function(a){if(null===a)return!1;u.I(this,a);var b=this.n;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Pd();return!0};
E.prototype.removeAt=E.prototype.hd=function(a){var b=this.n;(0>a||a>=b.length)&&u.wa(a,"0 <= i < length",E,"removeAt:i");u.I(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Pd()};E.prototype.removeRange=E.prototype.removeRange=function(a,b){var c=this.n;(0>a||a>=c.length)&&u.wa(a,"0 <= from < length",E,"elt:from");(0>b||b>=c.length)&&u.wa(b,"0 <= to < length",E,"elt:to");u.I(this,a);var d=c.slice((b||a)+1||c.length);c.length=0>a?c.length+a:a;c.push.apply(c,d);this.Pd()};
E.prototype.copy=function(){for(var a=new E(this.oa),b=this.n,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};E.prototype.toArray=E.prototype.Ke=function(){for(var a=this.n,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};E.prototype.toSet=function(){for(var a=new F(this.oa),b=this.n,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};E.prototype.sort=E.prototype.sort=function(a){u.I(this);this.n.sort(a);this.Pd();return this};
E.prototype.sortRange=E.prototype.hp=function(a,b,c){var d=this.n,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);u.I(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&u.wa(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.Pd()),this;if(0===b)if(c>=e)d.sort(a);else for(f=d.slice(0,c),f.sort(a),a=0;a<c;a++)d[a]=f[a];else if(c>=e)for(f=d.slice(b),f.sort(a),a=b;a<e;a++)d[a]=f[a-b];else for(f=d.slice(b,c),f.sort(a),a=b;a<c;a++)d[a]=f[a-b];this.Pd();
return this};E.prototype.reverse=E.prototype.reverse=function(){u.I(this);this.n.reverse();this.Pd();return this};u.u(E,{count:"count"},function(){return this.n.length});u.u(E,{size:"size"},function(){return this.n.length});u.u(E,{length:"length"},function(){return this.n.length});u.u(E,{i:"iterator"},function(){if(0>=this.n.length)return Ia;var a=this.wd;return null!==a?(a.reset(),a):new Ka(this)});
u.u(E,{Fm:"iteratorBackwards"},function(){if(0>=this.n.length)return Ia;var a=this.In;return null!==a?(a.reset(),a):new La(this)});function Ma(a){this.Gk=a;this.reset()}u.Xd(Ma,{key:!0,value:!0});u.u(Ma,{i:"iterator"},function(){return this});Ma.prototype.reset=Ma.prototype.reset=function(){var a=this.Gk;a.wd=null;this.Xa=a.U;this.Cb=null};
Ma.prototype.next=Ma.prototype.hasNext=Ma.prototype.next=function(){var a=this.Gk;if(a.U!==this.Xa){if(null===this.key)return!1;u.Mb(a)}var b=this.Cb,b=null===b?a.bb:b.Sb;if(null!==b)return this.Cb=b,this.value=b.value,this.key=b.key,!0;this.Vf();return!1};Ma.prototype.first=Ma.prototype.first=function(){var a=this.Gk;this.Xa=a.U;a=a.bb;if(null!==a){this.Cb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
Ma.prototype.any=function(a){var b=this.Gk;b.wd=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(a(d.value))return!0;b.U!==c&&u.Mb(b);d=d.Sb}return!1};Ma.prototype.all=function(a){var b=this.Gk;b.wd=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(!a(d.value))return!1;b.U!==c&&u.Mb(b);d=d.Sb}return!0};Ma.prototype.each=function(a){var b=this.Gk;b.wd=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;)a(d.value),b.U!==c&&u.Mb(b),d=d.Sb};u.u(Ma,{count:"count"},function(){return this.Gk.Zc});
Ma.prototype.Vf=function(){this.value=this.key=null;this.Xa=-1;this.Gk.wd=this};Ma.prototype.toString=function(){return null!==this.Cb?"SetIterator@"+this.Cb.value:"SetIterator"};
function F(a){u.gc(this);this.Ca=!1;void 0===a||null===a?this.oa=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.oa=a:u.wa(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.oa=a===Object?"object":a===String?"string":a===Number?"number":a:u.wa(a,"null, a primitive type name, or a class type","Set constructor: type");this.$c={};this.Zc=0;this.wd=null;this.U=0;this.Ah=this.bb=null}u.fa("Set",F);
F.prototype.Pd=function(){var a=this.U;a++;999999999<a&&(a=0);this.U=a};F.prototype.freeze=F.prototype.freeze=function(){this.Ca=!0;return this};F.prototype.thaw=F.prototype.La=function(){this.Ca=!1;return this};F.prototype.toString=function(){return"Set("+u.getTypeName(this.oa)+")#"+u.Uc(this)};
F.prototype.add=F.prototype.add=function(a){if(null===a)return!1;u.I(this,a);var b=a;u.Sa(a)&&(b=u.Is(a));return void 0===this.$c[b]?(this.Zc++,a=new Pa(a,a),this.$c[b]=a,b=this.Ah,null===b?this.bb=a:(a.Un=b,b.Sb=a),this.Ah=a,this.Pd(),!0):!1};F.prototype.addAll=F.prototype.Td=function(a){if(null===a)return this;u.I(this);if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++)this.add(u.fb(a,c));else for(a=a.i;a.next();)this.add(a.value);return this};
F.prototype.contains=F.prototype.has=F.prototype.contains=function(a){if(null===a)return!1;var b=a;return u.Sa(a)&&(b=u.Uc(a),void 0===b)?!1:void 0!==this.$c[b]};F.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(!this.contains(a.value))return!1;return!0};F.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(this.contains(a.value))return!0;return!1};F.prototype.first=F.prototype.first=function(){var a=this.bb;return null===a?null:a.value};
F.prototype.any=function(a){for(var b=this.U,c=this.bb;null!==c;){if(a(c.value))return!0;this.U!==b&&u.Mb(this);c=c.Sb}return!1};F.prototype.all=function(a){for(var b=this.U,c=this.bb;null!==c;){if(!a(c.value))return!1;this.U!==b&&u.Mb(this);c=c.Sb}return!0};F.prototype.each=function(a){for(var b=this.U,c=this.bb;null!==c;)a(c.value),this.U!==b&&u.Mb(this),c=c.Sb};
F.prototype.remove=F.prototype["delete"]=F.prototype.remove=function(a){if(null===a)return!1;u.I(this,a);var b=a;if(u.Sa(a)&&(b=u.Uc(a),void 0===b))return!1;a=this.$c[b];if(void 0===a)return!1;var c=a.Sb,d=a.Un;null!==c&&(c.Un=d);null!==d&&(d.Sb=c);this.bb===a&&(this.bb=c);this.Ah===a&&(this.Ah=d);delete this.$c[b];this.Zc--;this.Pd();return!0};
F.prototype.removeAll=F.prototype.jE=function(a){if(null===a)return this;u.I(this);if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++)this.remove(u.fb(a,c));else for(a=a.i;a.next();)this.remove(a.value);return this};F.prototype.retainAll=function(a){if(null===a||0===this.count)return this;u.I(this);var b=new F(this.oa);b.Td(a);a=new E(this.oa);for(var c=this.i;c.next();)b.contains(c.value)||a.add(c.value);for(b=a.i;b.next();)this.remove(b.value);return this};
F.prototype.clear=F.prototype.clear=function(){u.I(this);this.$c={};this.Zc=0;this.Ah=this.bb=null;this.Pd()};F.prototype.copy=function(){var a=new F(this.oa),b=this.$c,c;for(c in b)a.add(b[c].value);return a};F.prototype.toArray=F.prototype.Ke=function(){var a=Array(this.Zc),b=this.$c,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.toList=function(){var a=new E(this.oa),b=this.$c,c;for(c in b)a.add(b[c].value);return a};u.u(F,{count:"count"},function(){return this.Zc});
u.u(F,{size:"size"},function(){return this.Zc});u.u(F,{i:"iterator"},function(){if(0>=this.Zc)return Ia;var a=this.wd;return null!==a?(a.reset(),a):new Ma(this)});function Qa(a){this.Wa=a;this.reset()}u.Xd(Qa,{key:!0,value:!0});u.u(Qa,{i:"iterator"},function(){return this});Qa.prototype.reset=Qa.prototype.reset=function(){this.Xa=this.Wa.U;this.Cb=null};
Qa.prototype.next=Qa.prototype.hasNext=Qa.prototype.next=function(){var a=this.Wa;if(a.U!==this.Xa){if(null===this.key)return!1;u.Mb(a)}var b=this.Cb,b=null===b?a.bb:b.Sb;if(null!==b)return this.Cb=b,this.value=this.key=a=b.key,!0;this.Vf();return!1};Qa.prototype.first=Qa.prototype.first=function(){var a=this.Wa;this.Xa=a.U;a=a.bb;return null!==a?(this.Cb=a,this.value=this.key=a=a.key):null};
Qa.prototype.any=function(a){var b=this.Wa,c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(a(d.key))return!0;b.U!==c&&u.Mb(b);d=d.Sb}return!1};Qa.prototype.all=function(a){var b=this.Wa,c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(!a(d.key))return!1;b.U!==c&&u.Mb(b);d=d.Sb}return!0};Qa.prototype.each=function(a){var b=this.Wa,c=b.U;this.Cb=null;for(var d=b.bb;null!==d;)a(d.key),b.U!==c&&u.Mb(b),d=d.Sb};u.u(Qa,{count:"count"},function(){return this.Wa.Zc});
Qa.prototype.Vf=function(){this.value=this.key=null;this.Xa=-1};Qa.prototype.toString=function(){return null!==this.Cb?"MapKeySetIterator@"+this.Cb.value:"MapKeySetIterator"};function Ra(a){u.gc(this);this.Ca=!0;this.Wa=a}u.Ga(Ra,F);Ra.prototype.freeze=function(){return this};Ra.prototype.La=function(){return this};Ra.prototype.toString=function(){return"MapKeySet("+this.Wa.toString()+")"};
Ra.prototype.add=Ra.prototype.set=Ra.prototype.add=function(){u.k("This Set is read-only: "+this.toString());return!1};Ra.prototype.contains=Ra.prototype.has=Ra.prototype.contains=function(a){return this.Wa.contains(a)};Ra.prototype.remove=Ra.prototype["delete"]=Ra.prototype.remove=function(){u.k("This Set is read-only: "+this.toString());return!1};Ra.prototype.clear=Ra.prototype.clear=function(){u.k("This Set is read-only: "+this.toString())};
Ra.prototype.first=Ra.prototype.first=function(){var a=this.Wa.bb;return null!==a?a.key:null};Ra.prototype.any=function(a){for(var b=this.Wa.bb;null!==b;){if(a(b.key))return!0;b=b.Sb}return!1};Ra.prototype.all=function(a){for(var b=this.Wa.bb;null!==b;){if(!a(b.key))return!1;b=b.Sb}return!0};Ra.prototype.each=function(a){for(var b=this.Wa.bb;null!==b;)a(b.key),b=b.Sb};Ra.prototype.copy=function(){return new Ra(this.Wa)};
Ra.prototype.toSet=function(){var a=new F(this.Wa.wq),b=this.Wa.$c,c;for(c in b)a.add(b[c].key);return a};Ra.prototype.toArray=Ra.prototype.Ke=function(){var a=this.Wa.$c,b=Array(this.Wa.Zc),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Ra.prototype.toList=function(){var a=new E(this.oa),b=this.Wa.$c,c;for(c in b)a.add(b[c].key);return a};u.u(Ra,{count:"count"},function(){return this.Wa.Zc});u.u(Ra,{size:"size"},function(){return this.Wa.Zc});
u.u(Ra,{i:"iterator"},function(){return 0>=this.Wa.Zc?Ia:new Qa(this.Wa)});function Sa(a){this.Wa=a;this.reset()}u.Xd(Sa,{key:!0,value:!0});u.u(Sa,{i:"iterator"},function(){return this});Sa.prototype.reset=Sa.prototype.reset=function(){var a=this.Wa;a.Jn=null;this.Xa=a.U;this.Cb=null};
Sa.prototype.next=Sa.prototype.hasNext=Sa.prototype.next=function(){var a=this.Wa;if(a.U!==this.Xa){if(null===this.key)return!1;u.Mb(a)}var b=this.Cb,b=null===b?a.bb:b.Sb;if(null!==b)return this.Cb=b,this.value=b.value,this.key=b.key,!0;this.Vf();return!1};Sa.prototype.first=Sa.prototype.first=function(){var a=this.Wa;this.Xa=a.U;a=a.bb;if(null!==a){this.Cb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
Sa.prototype.any=function(a){var b=this.Wa;b.Jn=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(a(d.value))return!0;b.U!==c&&u.Mb(b);d=d.Sb}return!1};Sa.prototype.all=function(a){var b=this.Wa;b.Jn=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(!a(d.value))return!1;b.U!==c&&u.Mb(b);d=d.Sb}return!0};Sa.prototype.each=function(a){var b=this.Wa;b.Jn=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;)a(d.value),b.U!==c&&u.Mb(b),d=d.Sb};u.u(Sa,{count:"count"},function(){return this.Wa.Zc});
Sa.prototype.Vf=function(){this.value=this.key=null;this.Xa=-1;this.Wa.Jn=this};Sa.prototype.toString=function(){return null!==this.Cb?"MapValueSetIterator@"+this.Cb.value:"MapValueSetIterator"};function Pa(a,b){this.key=a;this.value=b;this.Un=this.Sb=null}u.Xd(Pa,{key:!0,value:!0});Pa.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};function Ua(a){this.Wa=a;this.reset()}u.Xd(Ua,{key:!0,value:!0});u.u(Ua,{i:"iterator"},function(){return this});
Ua.prototype.reset=Ua.prototype.reset=function(){var a=this.Wa;a.wd=null;this.Xa=a.U;this.Cb=null};Ua.prototype.next=Ua.prototype.hasNext=Ua.prototype.next=function(){var a=this.Wa;if(a.U!==this.Xa){if(null===this.key)return!1;u.Mb(a)}var b=this.Cb,b=null===b?a.bb:b.Sb;if(null!==b)return this.Cb=b,this.key=b.key,this.value=b.value,!0;this.Vf();return!1};
Ua.prototype.first=Ua.prototype.first=function(){var a=this.Wa;this.Xa=a.U;a=a.bb;return null!==a?(this.Cb=a,this.key=a.key,this.value=a.value,a):null};Ua.prototype.any=function(a){var b=this.Wa;b.wd=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(a(d))return!0;b.U!==c&&u.Mb(b);d=d.Sb}return!1};Ua.prototype.all=function(a){var b=this.Wa;b.wd=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;){if(!a(d))return!1;b.U!==c&&u.Mb(b);d=d.Sb}return!0};
Ua.prototype.each=function(a){var b=this.Wa;b.wd=null;var c=b.U;this.Cb=null;for(var d=b.bb;null!==d;)a(d),b.U!==c&&u.Mb(b),d=d.Sb};u.u(Ua,{count:"count"},function(){return this.Wa.Zc});Ua.prototype.Vf=function(){this.value=this.key=null;this.Xa=-1;this.Wa.wd=this};Ua.prototype.toString=function(){return null!==this.Cb?"MapIterator@"+this.Cb:"MapIterator"};
function la(a,b){u.gc(this);this.Ca=!1;void 0===a||null===a?this.wq=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.wq=a:u.wa(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.wq=a===Object?"object":a===String?"string":a===Number?"number":a:u.wa(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.tv=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
b||"function"===b?this.tv=b:u.wa(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.tv=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:u.wa(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.$c={};this.Zc=0;this.Jn=this.wd=null;this.U=0;this.Ah=this.bb=null}u.fa("Map",la);
la.prototype.Pd=function(){var a=this.U;a++;999999999<a&&(a=0);this.U=a};la.prototype.freeze=la.prototype.freeze=function(){this.Ca=!0;return this};la.prototype.thaw=la.prototype.La=function(){this.Ca=!1;return this};la.prototype.toString=function(){return"Map("+u.getTypeName(this.wq)+","+u.getTypeName(this.tv)+")#"+u.Uc(this)};
la.prototype.add=la.prototype.set=la.prototype.add=function(a,b){u.I(this,a);var c=a;u.Sa(a)&&(c=u.Is(a));var d=this.$c[c];if(void 0===d)return this.Zc++,d=new Pa(a,b),this.$c[c]=d,c=this.Ah,null===c?this.bb=d:(d.Un=c,c.Sb=d),this.Ah=d,this.Pd(),!0;d.value=b;return!1};la.prototype.addAll=la.prototype.Td=function(a){if(null===a)return this;if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++){var d=u.fb(a,c);this.add(d.key,d.value)}else for(a=a.i;a.next();)this.add(a.key,a.value);return this};
la.prototype.first=la.prototype.first=function(){return this.bb};la.prototype.any=function(a){for(var b=this.U,c=this.bb;null!==c;){if(a(c))return!0;this.U!==b&&u.Mb(this);c=c.Sb}return!1};la.prototype.all=function(a){for(var b=this.U,c=this.bb;null!==c;){if(!a(c))return!1;this.U!==b&&u.Mb(this);c=c.Sb}return!0};la.prototype.each=function(a){for(var b=this.U,c=this.bb;null!==c;)a(c),this.U!==b&&u.Mb(this),c=c.Sb};
la.prototype.contains=la.prototype.has=la.prototype.contains=function(a){var b=a;return u.Sa(a)&&(b=u.Uc(a),void 0===b)?!1:void 0!==this.$c[b]};la.prototype.getValue=la.prototype.get=la.prototype.ta=function(a){var b=a;if(u.Sa(a)&&(b=u.Uc(a),void 0===b))return null;a=this.$c[b];return void 0===a?null:a.value};
la.prototype.remove=la.prototype["delete"]=la.prototype.remove=function(a){if(null===a)return!1;u.I(this,a);var b=a;if(u.Sa(a)&&(b=u.Uc(a),void 0===b))return!1;a=this.$c[b];if(void 0===a)return!1;var c=a.Sb,d=a.Un;null!==c&&(c.Un=d);null!==d&&(d.Sb=c);this.bb===a&&(this.bb=c);this.Ah===a&&(this.Ah=d);delete this.$c[b];this.Zc--;this.Pd();return!0};la.prototype.clear=la.prototype.clear=function(){u.I(this);this.$c={};this.Zc=0;this.Ah=this.bb=null;this.Pd()};
la.prototype.copy=function(){var a=new la(this.wq,this.tv),b=this.$c,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};la.prototype.toArray=la.prototype.Ke=function(){var a=this.$c,b=Array(this.Zc),c=0,d;for(d in a){var e=a[d];b[c]=new Pa(e.key,e.value);c++}return b};la.prototype.toKeySet=la.prototype.Ni=function(){return new Ra(this)};u.u(la,{count:"count"},function(){return this.Zc});u.u(la,{size:"size"},function(){return this.Zc});
u.u(la,{i:"iterator"},function(){if(0>=this.count)return Ia;var a=this.wd;return null!==a?(a.reset(),a):new Ua(this)});u.u(la,{NJ:"iteratorKeys"},function(){return 0>=this.count?Ia:new Qa(this)});u.u(la,{RD:"iteratorValues"},function(){if(0>=this.count)return Ia;var a=this.Jn;return null!==a?(a.reset(),a):new Sa(this)});function w(a,b){void 0===a?this.y=this.x=0:(this.x=a,this.y=b);this.Ca=!1}u.fa("Point",w);u.Lh(w);u.Xd(w,{x:!0,y:!0});w.prototype.assign=function(a){this.x=a.x;this.y=a.y};
w.prototype.setTo=w.prototype.m=function(a,b){this.x=a;this.y=b;return this};w.prototype.set=w.prototype.set=function(a){this.I();this.x=a.x;this.y=a.y;return this};w.prototype.copy=function(){var a=new w;a.x=this.x;a.y=this.y;return a};g=w.prototype;g.Ka=function(){this.Ca=!0;Object.freeze(this);return this};g.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};g.freeze=function(){this.Ca=!0;return this};
g.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;return this};g.I=function(a){if(this.Ca){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);u.k(b)}};w.parse=function(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 w(c,e)}return new w};
w.stringify=function(a){return a instanceof w?a.x.toString()+" "+a.y.toString():a.toString()};w.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};w.prototype.equals=w.prototype.L=function(a){return a instanceof w?this.x===a.x&&this.y===a.y:!1};w.prototype.equalTo=w.prototype.Tv=function(a,b){return this.x===a&&this.y===b};w.prototype.equalsApprox=w.prototype.De=function(a){return K.D(this.x,a.x)&&K.D(this.y,a.y)};
w.prototype.add=w.prototype.add=function(a){this.I();this.x+=a.x;this.y+=a.y;return this};w.prototype.subtract=w.prototype.vt=function(a){this.I();this.x-=a.x;this.y-=a.y;return this};w.prototype.offset=w.prototype.offset=function(a,b){this.I();this.x+=a;this.y+=b;return this};
w.prototype.rotate=w.prototype.rotate=function(a){this.I();if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.x=d*b-e*c;this.y=e*b+d*c;return this};w.prototype.scale=w.prototype.scale=function(a,b){this.x*=a;this.y*=b;return this};w.prototype.distanceSquaredPoint=w.prototype.Lj=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};
w.prototype.distanceSquared=w.prototype.ss=function(a,b){var c=a-this.x,d=b-this.y;return c*c+d*d};w.prototype.normalize=w.prototype.normalize=function(){this.I();var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};w.prototype.directionPoint=w.prototype.Fi=function(a){return Va(a.x-this.x,a.y-this.y)};w.prototype.direction=w.prototype.direction=function(a,b){return Va(a-this.x,b-this.y)};
function Va(a,b){if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}w.prototype.projectOntoLineSegment=function(a,b,c,d){K.Hm(a,b,c,d,this.x,this.y,this);return this};w.prototype.projectOntoLineSegmentPoint=function(a,b){K.Hm(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};w.prototype.snapToGrid=function(a,b,c,d){K.xs(this.x,this.y,a,b,c,d,this);return this};
w.prototype.snapToGridPoint=function(a,b){K.xs(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};w.prototype.setRectSpot=w.prototype.pt=function(a,b){this.I();this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};w.prototype.setSpot=w.prototype.rt=function(a,b,c,d,e){this.I();this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};w.prototype.transform=function(a){a.ab(this);return this};function Wa(a,b){b.Oh(a);return a}var Xa;
w.distanceLineSegmentSquared=Xa=function(a,b,c,d,e,f){var h=e-c,k=f-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=f-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var Ya;w.distanceSquared=Ya=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};var Za;w.direction=Za=function(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};
w.prototype.isReal=w.prototype.J=function(){return isFinite(this.x)&&isFinite(this.y)};function ia(a,b){void 0===a?this.height=this.width=0:(this.width=a,this.height=b);this.Ca=!1}u.fa("Size",ia);u.Lh(ia);u.Xd(ia,{width:!0,height:!0});ia.prototype.assign=function(a){this.width=a.width;this.height=a.height};ia.prototype.setTo=ia.prototype.m=function(a,b){this.width=a;this.height=b;return this};ia.prototype.set=ia.prototype.set=function(a){this.I();this.width=a.width;this.height=a.height;return this};
ia.prototype.copy=function(){var a=new ia;a.width=this.width;a.height=this.height;return a};g=ia.prototype;g.Ka=function(){this.Ca=!0;Object.freeze(this);return this};g.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};g.freeze=function(){this.Ca=!0;return this};g.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;return this};
g.I=function(a){if(this.Ca){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);u.k(b)}};ia.parse=function(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 ia(c,e)}return new ia};ia.stringify=function(a){return a instanceof ia?a.width.toString()+" "+a.height.toString():a.toString()};
ia.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};ia.prototype.equals=ia.prototype.L=function(a){return a instanceof ia?this.width===a.width&&this.height===a.height:!1};ia.prototype.equalTo=ia.prototype.Tv=function(a,b){return this.width===a&&this.height===b};ia.prototype.equalsApprox=ia.prototype.De=function(a){return K.D(this.width,a.width)&&K.D(this.height,a.height)};ia.prototype.isReal=ia.prototype.J=function(){return isFinite(this.width)&&isFinite(this.height)};
function z(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof w?b instanceof w?(this.x=Math.min(a.x,b.x),this.y=Math.min(a.y,b.y),this.width=Math.abs(a.x-b.x),this.height=Math.abs(a.y-b.y)):b instanceof ia?(this.x=a.x,this.y=a.y,this.width=b.width,this.height=b.height):u.k("Incorrect arguments supplied to Rect constructor"):(this.x=a,this.y=b,this.width=c,this.height=d);this.Ca=!1}u.fa("Rect",z);u.Lh(z);u.Xd(z,{x:!0,y:!0,width:!0,height:!0});
z.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height};function bb(a,b,c){a.width=b;a.height=c}z.prototype.setTo=z.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};z.prototype.set=z.prototype.set=function(a){this.I();this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};z.prototype.setPoint=z.prototype.yf=function(a){this.I();this.x=a.x;this.y=a.y;return this};
z.prototype.setSize=function(a){this.I();this.width=a.width;this.height=a.height;return this};z.prototype.copy=function(){var a=new z;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};g=z.prototype;g.Ka=function(){this.Ca=!0;Object.freeze(this);return this};g.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};g.freeze=function(){this.Ca=!0;return this};g.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;return this};
g.I=function(a){if(this.Ca){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);u.k(b)}};z.parse=function(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 h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new z(c,e,f,h)}return new z};
z.stringify=function(a){return a instanceof z?a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString():a.toString()};z.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};z.prototype.equals=z.prototype.L=function(a){return a instanceof z?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};z.prototype.equalTo=z.prototype.Tv=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};
z.prototype.equalsApprox=z.prototype.De=function(a){return K.D(this.x,a.x)&&K.D(this.y,a.y)&&K.D(this.width,a.width)&&K.D(this.height,a.height)};z.prototype.containsPoint=z.prototype.Aa=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};z.prototype.containsRect=z.prototype.Kj=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};
z.prototype.contains=z.prototype.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};z.prototype.reset=function(){this.I();this.height=this.width=this.y=this.x=0};z.prototype.offset=z.prototype.offset=function(a,b){this.I();this.x+=a;this.y+=b;return this};z.prototype.inflate=z.prototype.Jf=function(a,b){return hb(this,b,a,b,a)};
z.prototype.addMargin=z.prototype.yv=function(a){return hb(this,a.top,a.right,a.bottom,a.left)};z.prototype.subtractMargin=z.prototype.tI=function(a){return hb(this,-a.top,-a.right,-a.bottom,-a.left)};z.prototype.grow=function(a,b,c,d){return hb(this,a,b,c,d)};function hb(a,b,c,d,e){a.I();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}z.prototype.intersectRect=function(a){return ib(this,a.x,a.y,a.width,a.height)};
z.prototype.intersect=function(a,b,c,d){return ib(this,a,b,c,d)};function ib(a,b,c,d,e){a.I();var f=Math.max(a.x,b),h=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=h;a.width=Math.max(0,b-f);a.height=Math.max(0,c-h);return a}z.prototype.intersectsRect=z.prototype.sg=function(a){return this.HD(a.x,a.y,a.width,a.height)};
z.prototype.intersects=z.prototype.HD=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 jb(a,b){var c=a.width,d=b.width+10+10,e=a.x,f=b.x-10;if(e>d+f||f>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;f=b.y-10;return e>d+f||f>c+e?!1:!0}z.prototype.unionPoint=z.prototype.Oi=function(a){return kb(this,a.x,a.y,0,0)};
z.prototype.unionRect=z.prototype.Sh=function(a){return kb(this,a.x,a.y,a.width,a.height)};z.prototype.union=z.prototype.YE=function(a,b,c,d){this.I();void 0===c&&(c=0);void 0===d&&(d=0);return kb(this,a,b,c,d)};function kb(a,b,c,d,e){var f=Math.min(a.x,b),h=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=h;a.width=b-f;a.height=c-h;return a}
z.prototype.setSpot=z.prototype.rt=function(a,b,c){this.I();this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};var qb;z.contains=qb=function(a,b,c,d,e,f,h,k){void 0===h&&(h=0);void 0===k&&(k=0);return a<=e&&e+h<=a+c&&b<=f&&f+k<=b+d};z.intersects=function(a,b,c,d,e,f,h,k){c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=f;return b>k||f>a?!1:!0};u.defineProperty(z,{left:"left"},function(){return this.x},function(a){this.I(a);this.x=a});
u.defineProperty(z,{top:"top"},function(){return this.y},function(a){this.I(a);this.y=a});u.defineProperty(z,{right:"right"},function(){return this.x+this.width},function(a){this.I(a);this.x+=a-(this.x+this.width)});u.defineProperty(z,{bottom:"bottom"},function(){return this.y+this.height},function(a){this.I(a);this.y+=a-(this.y+this.height)});u.defineProperty(z,{position:"position"},function(){return new w(this.x,this.y)},function(a){this.I(a);this.x=a.x;this.y=a.y});
u.defineProperty(z,{size:"size"},function(){return new ia(this.width,this.height)},function(a){this.I(a);this.width=a.width;this.height=a.height});u.defineProperty(z,{Ok:"center"},function(){return new w(this.x+this.width/2,this.y+this.height/2)},function(a){this.I(a);this.x=a.x-this.width/2;this.y=a.y-this.height/2});u.defineProperty(z,{Ja:"centerX"},function(){return this.x+this.width/2},function(a){this.I(a);this.x=a-this.width/2});
u.defineProperty(z,{Ua:"centerY"},function(){return this.y+this.height/2},function(a){this.I(a);this.y=a-this.height/2});z.prototype.isReal=z.prototype.J=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};z.prototype.isEmpty=function(){return 0===this.width&&0===this.height};
function rb(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?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):u.k("Invalid arguments to Margin constructor");this.Ca=!1}u.fa("Margin",rb);u.Lh(rb);u.Xd(rb,{top:!0,right:!0,bottom:!0,left:!0});rb.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};
rb.prototype.setTo=rb.prototype.m=function(a,b,c,d){this.I();this.top=a;this.right=b;this.bottom=c;this.left=d;return this};rb.prototype.set=rb.prototype.set=function(a){this.I();this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};rb.prototype.copy=function(){var a=new rb;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};g=rb.prototype;g.Ka=function(){this.Ca=!0;Object.freeze(this);return this};
g.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};g.freeze=function(){this.Ca=!0;return this};g.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;return this};g.I=function(a){if(this.Ca){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);u.k(b)}};
rb.parse=function(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 rb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new rb(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new rb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new rb(c,e):new rb(c,e,f,h)}return new rb};
rb.stringify=function(a){return a instanceof rb?a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString():a.toString()};rb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};rb.prototype.equals=rb.prototype.L=function(a){return a instanceof rb?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};
rb.prototype.equalTo=rb.prototype.Tv=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};rb.prototype.equalsApprox=rb.prototype.De=function(a){return K.D(this.top,a.top)&&K.D(this.right,a.right)&&K.D(this.bottom,a.bottom)&&K.D(this.left,a.left)};rb.prototype.isReal=rb.prototype.J=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ja(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}u.Lh(ja);
u.Xd(ja,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});ja.prototype.set=ja.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};ja.prototype.copy=function(){var a=new ja;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};ja.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
ja.prototype.equals=ja.prototype.L=function(a){return a instanceof ja?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};ja.prototype.isIdentity=ja.prototype.Os=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};ja.prototype.reset=ja.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
ja.prototype.multiply=ja.prototype.multiply=function(a){var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,f=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
ja.prototype.multiplyInverted=ja.prototype.aE=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;f=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=f;this.dy=h;return this};
ja.prototype.invert=ja.prototype.oz=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
ja.prototype.rotate=ja.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var f=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=f;this.m22=h;this.translate(-b,-c);return this};
ja.prototype.translate=ja.prototype.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};ja.prototype.scale=ja.prototype.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};ja.prototype.transformPoint=ja.prototype.ab=function(a){var b=a.x,c=a.y;a.x=b*this.m11+c*this.m21+this.dx;a.y=b*this.m12+c*this.m22+this.dy;return a};
ja.prototype.invertedTransformPoint=ja.prototype.Oh=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),f=a.x,h=a.y;a.x=f*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.y=f*c+h*d+e;return a};
ja.prototype.transformRect=ja.prototype.WE=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*f+c*k+m,q=b*h+c*l+n,r=d*f+c*k+m,c=d*h+c*l+n,s=b*f+e*k+m,b=b*h+e*l+n,f=d*f+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,f),e=Math.max(e,f),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=h;a.width=e-p;a.height=q-h;return a};
function L(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.Ca=!1}u.fa("Spot",L);u.Lh(L);u.Xd(L,{x:!0,y:!0,offsetX:!0,offsetY:!0});L.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};L.prototype.setTo=L.prototype.m=function(a,b,c,d){this.I();this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};
L.prototype.set=L.prototype.set=function(a){this.I();this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};L.prototype.copy=function(){var a=new L;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};g=L.prototype;g.Ka=function(){this.Ca=!0;Object.freeze(this);return this};g.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};g.freeze=function(){this.Ca=!0;return this};
g.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;return this};g.I=function(a){if(this.Ca){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);u.k(b)}};function sb(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}var tb;
L.parse=tb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return vb;if("TopLeft"===a)return xb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Db;if("TopRight"===a)return Gb;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Hb;if("Center"===a)return Ib;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Jb;if("BottomLeft"===a)return Kb;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Ub;if("BottomRight"===a)return Vb;if("TopSide"===a)return Wb;if("LeftSide"===
a)return Xb;if("RightSide"===a)return Yb;if("BottomSide"===a)return Zb;if("TopBottomSides"===a)return $b;if("LeftRightSides"===a)return ac;if("TopLeftSides"===a)return bc;if("TopRightSides"===a)return cc;if("BottomLeftSides"===a)return hc;if("BottomRightSides"===a)return ic;if("NotTopSide"===a)return lc;if("NotLeftSide"===a)return mc;if("NotRightSide"===a)return rc;if("NotBottomSide"===a)return sc;if("AllSides"===a)return tc;if("Default"===a)return uc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;
var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(f=parseFloat(d));for(var h=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(h=parseFloat(d));return new L(c,e,f,h)}return new L};L.stringify=function(a){return a instanceof L?a.pd()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString():a.toString()};
L.prototype.toString=function(){return this.pd()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.L(vb)?"None":this.L(xb)?"TopLeft":this.L(Db)?"Top":this.L(Gb)?"TopRight":this.L(Hb)?"Left":this.L(Ib)?"Center":this.L(Jb)?"Right":this.L(Kb)?"BottomLeft":this.L(Ub)?"Bottom":this.L(Vb)?"BottomRight":this.L(Wb)?"TopSide":this.L(Xb)?"LeftSide":this.L(Yb)?"RightSide":this.L(Zb)?"BottomSide":this.L($b)?"TopBottomSides":this.L(ac)?
"LeftRightSides":this.L(bc)?"TopLeftSides":this.L(cc)?"TopRightSides":this.L(hc)?"BottomLeftSides":this.L(ic)?"BottomRightSides":this.L(lc)?"NotTopSide":this.L(mc)?"NotLeftSide":this.L(rc)?"NotRightSide":this.L(sc)?"NotBottomSide":this.L(tc)?"AllSides":this.L(uc)?"Default":"None"};L.prototype.equals=L.prototype.L=function(a){return a instanceof L?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1};
L.prototype.opposite=function(){return new L(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};L.prototype.includesSide=function(a){if(!this.Go()||!a.Go())return!1;a=a.offsetY;return(this.offsetY&a)===a};L.prototype.isSpot=L.prototype.pd=function(){return!isNaN(this.x)&&!isNaN(this.y)};L.prototype.isNoSpot=L.prototype.ne=function(){return isNaN(this.x)||isNaN(this.y)};L.prototype.isSide=L.prototype.Go=function(){return this.ne()&&1===this.offsetX&&0!==this.offsetY};
L.prototype.isDefault=L.prototype.Lc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var vb;L.None=vb=sb(new L(0,0,0,0),0).Ka();var uc;L.Default=uc=sb(new L(0,0,-1,0),-1).Ka();var xb;L.TopLeft=xb=(new L(0,0,0,0)).Ka();var Db;L.TopCenter=Db=(new L(.5,0,0,0)).Ka();var Gb;L.TopRight=Gb=(new L(1,0,0,0)).Ka();var Hb;L.LeftCenter=Hb=(new L(0,.5,0,0)).Ka();var Ib;L.Center=Ib=(new L(.5,.5,0,0)).Ka();var Jb;L.RightCenter=Jb=(new L(1,.5,0,0)).Ka();var Kb;
L.BottomLeft=Kb=(new L(0,1,0,0)).Ka();var Ub;L.BottomCenter=Ub=(new L(.5,1,0,0)).Ka();var Vb;L.BottomRight=Vb=(new L(1,1,0,0)).Ka();var vc;L.MiddleTop=vc=Db;var wc;L.MiddleLeft=wc=Hb;var xc;L.MiddleRight=xc=Jb;var Cc;L.MiddleBottom=Cc=Ub;L.Top=Db;var Dc;L.Left=Dc=Hb;var Kc;L.Right=Kc=Jb;L.Bottom=Ub;var Wb;L.TopSide=Wb=sb(new L(0,0,1,u.Xc),1).Ka();var Xb;L.LeftSide=Xb=sb(new L(0,0,1,u.Fc),1).Ka();var Yb;L.RightSide=Yb=sb(new L(0,0,1,u.Oc),1).Ka();var Zb;L.BottomSide=Zb=sb(new L(0,0,1,u.Nc),1).Ka();
var $b;L.TopBottomSides=$b=sb(new L(0,0,1,u.Xc|u.Nc),1).Ka();var ac;L.LeftRightSides=ac=sb(new L(0,0,1,u.Fc|u.Oc),1).Ka();var bc;L.TopLeftSides=bc=sb(new L(0,0,1,u.Xc|u.Fc),1).Ka();var cc;L.TopRightSides=cc=sb(new L(0,0,1,u.Xc|u.Oc),1).Ka();var hc;L.BottomLeftSides=hc=sb(new L(0,0,1,u.Nc|u.Fc),1).Ka();var ic;L.BottomRightSides=ic=sb(new L(0,0,1,u.Nc|u.Oc),1).Ka();var lc;L.NotTopSide=lc=sb(new L(0,0,1,u.Fc|u.Oc|u.Nc),1).Ka();var mc;L.NotLeftSide=mc=sb(new L(0,0,1,u.Xc|u.Oc|u.Nc),1).Ka();var rc;
L.NotRightSide=rc=sb(new L(0,0,1,u.Xc|u.Fc|u.Nc),1).Ka();var sc;L.NotBottomSide=sc=sb(new L(0,0,1,u.Xc|u.Fc|u.Oc),1).Ka();var tc;L.AllSides=tc=sb(new L(0,0,1,u.Xc|u.Fc|u.Oc|u.Nc),1).Ka();function Lc(){this.$e=[1,0,0,1,0,0]}Lc.prototype.copy=function(){var a=new Lc;a.$e[0]=this.$e[0];a.$e[1]=this.$e[1];a.$e[2]=this.$e[2];a.$e[3]=this.$e[3];a.$e[4]=this.$e[4];a.$e[5]=this.$e[5];return a};function Mc(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.YC=[]}
Mc.prototype.addColorStop=function(a,b){this.YC.push({offset:a,color:b})};
function Nc(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.nw=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.document=b||document;this.nD=c;this.kw=null;this.path=[];this.Ei=new Lc;this.stack=[];this.rf=[];this.HE=this.BD=this.Mv=0;this.Rv=a;this.IH="http://www.w3.org/2000/svg";this.width=
this.Rv.width;this.height=this.Rv.height;this.sl=Oc(this,"svg",{width:this.width+"px",height:this.height+"px",EK:"0 0 "+this.Rv.width+" "+this.Rv.height});this.sl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.sl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");Uc(this,1,0,0,1,0,0);a=Oc(this,"clipPath",{id:"mainClip"});a.appendChild(Oc(this,"rect",{x:0,y:0,width:this.width,height:this.height}));this.sl.appendChild(a);
this.rf[0].setAttributeNS(null,"clip-path","url(#mainClip)")}g=Nc.prototype;g.arc=function(a,b,c,d,e,f){Vc(this,a,b,c,d,e,f)};g.beginPath=function(){this.path=[]};g.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};g.clearRect=function(){};g.clip=function(){Wc(this,"clipPath",this.path,new Lc)};g.closePath=function(){this.path.push(["z"])};g.createLinearGradient=function(a,b,c,d){var e=new Mc("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};g.createPattern=function(){};
g.createRadialGradient=function(a,b,c,d,e,f){var h=new Mc("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=f;return h};
g.drawImage=function(a,b,c,d,e,f,h,k,l){a=[b,c,d,e,f,h,k,l,a];b=this.Ei;e=a[8];c="";e instanceof HTMLCanvasElement&&(c=e.toDataURL());e instanceof HTMLImageElement&&(c=e.src);c={x:0,y:0,width:a[6],height:a[7],href:c};d="";f=a[6]/a[2];h=a[7]/a[3];if(0!==a[4]||0!==a[5])d+=" translate("+a[4]+", "+a[5]+")";if(1!==f||1!==h)d+=" scale("+f+", "+h+")";if(0!==a[0]||0!==a[1])d+=" translate("+-a[0]+", "+-a[1]+")";if(0!==a[0]||0!==a[1]||a[2]!==e.naturalWidth||a[3]!==e.naturalHeight)e="CLIP"+this.Mv,this.Mv++,
f=Oc(this,"clipPath",{id:e}),f.appendChild(Oc(this,"rect",{x:a[0],y:a[1],width:a[2],height:a[3]})),this.sl.appendChild(f),c["clip-path"]="url(#"+e+")";Xc(this,"image",c,b,d);this.addElement("image",c)};g.fill=function(){Wc(this,"fill",this.path,this.Ei)};g.fillRect=function(a,b,c,d){Yc(this,"fill",[a,b,c,d],this.Ei)};
g.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};Xc(this,"fill",b,this.Ei);this.addElement("text",b,a[0])};g.lineTo=function(a,b){this.path.push(["L",a,b])};g.moveTo=function(a,b){this.path.push(["M",a,b])};g.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};g.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"])};
g.restore=function(){this.Ei=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.nw=a.nw;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};
g.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,nw:this.nw,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;b<this.path.length;b++)a.push(this.path[b]);this.stack.push(a);this.stack.push(this.Ei.copy())};
g.setTransform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||Uc(this,a,b,c,d,e,f)};g.scale=function(){};g.stroke=function(){Wc(this,"stroke",this.path,this.Ei)};g.strokeRect=function(a,b,c,d){Yc(this,"stroke",[a,b,c,d],this.Ei)};function Oc(a,b,c,d){a=a.document.createElementNS(a.IH,b);if(u.Sa(c))for(var e in c)a.setAttributeNS("href"===e?"http://www.w3.org/1999/xlink":"",e,c[e]);void 0!==d&&(a.textContent=d);return a}
g.addElement=function(a,b,c){a=Oc(this,a,b,c);0<this.rf.length?this.rf[this.rf.length-1].appendChild(a):this.sl.appendChild(a);return this.kw=a};
function Xc(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"==b?(/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",c["fill-opacity"]=a[4]):c.fill=a.fillStyle instanceof Mc?Zc(a,a.fillStyle):a.fillStyle,c.stroke="none"):"stroke"==b&&(c.fill="none",/^rgba\(/.test(a.strokeStyle)?(b=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
c.stroke="rgb("+b[1]+","+b[2]+","+b[3]+")",c["stroke-opacity"]=b[4]):c.stroke=a.strokeStyle instanceof Mc?Zc(a,a.strokeStyle):a.strokeStyle,c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);d=d.$e;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
function Zc(a,b){var c="GRAD"+a.BD;a.BD++;var d;if("linear"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"},d=Oc(a,"linearGradient",d);else if("radial"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c},d=Oc(a,"radialGradient",d);else throw Error("invalid gradient");for(var e=b.YC,f=e.length,h=[],k=0;k<f;k++){var l=e[k],m=l.color,l={offset:l.offset,"stop-color":m};/^rgba\(/.test(m)&&(m=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m),
l["stop-color"]="rgb("+m[1]+","+m[2]+","+m[3]+")",l["stop-opacity"]=m[4]);h.push(l)}h.sort(function(a,b){return a.offset>b.offset?1:-1});for(k=0;k<f;k++)d.appendChild(Oc(a,"stop",h[k]));a.sl.appendChild(d);return"url(#"+c+")"}function Yc(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};Xc(a,b,c,d);a.addElement("rect",c)}
function Wc(a,b,c,d){for(var e=[],f=0;f<c.length;f++){var h=u.Pk(c[f]),k=[h.shift()];if("A"==k[0])k.push(h.shift()+","+h.shift(),h.shift(),h.shift()+","+h.shift(),h.shift()+","+h.shift());else for(;h.length;)k.push(h.shift()+","+h.shift());e.push(k.join(" "))}c={d:e.join(" ")};Xc(a,b,c,d);"clipPath"===b?(b="CLIP"+a.Mv,a.Mv++,d=Oc(a,"clipPath",{id:b}),d.appendChild(Oc(a,"path",c)),a.sl.appendChild(d),0<a.rf.length&&a.rf[a.rf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
c)}function Vc(a,b,c,d,e,f,h){var k=Math.abs(e-f);if(e!=f){var l=b+d*Math.cos(f);f=c+d*Math.sin(f);k>=2*Math.PI?(Vc(a,b,c,d,e,e+Math.PI,h),Vc(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,f])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k==!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,f]))}}function Uc(a,b,c,d,e,f,h){var k=new Lc;k.$e=[b,c,d,e,f,h];b={};Xc(a,"g",b,k);k=a.addElement("g",b);a.rf.push(k)}
g.$a=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+this.HE;this.HE++;var b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,f,h;c=Oc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",vK:this.shadowBlur/2});d=Oc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=Oc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});f=Oc(this,"feOffset",{"in":"comp",result:"offsetBlur",
dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=Oc(this,"feMerge",{});h.appendChild(Oc(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(Oc(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);b.appendChild(h);0<this.rf.length&&this.rf[this.rf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};
function oa(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.Dd=c;c.getContext&&c.getContext("2d")||u.k("Browser does not support HTML Canvas Element");this.dG=c.getContext("2d");c.Y=a;Object.seal(this)}g=oa.prototype;g.getContext=function(){return this.dG};g.toDataURL=function(a,b){return this.Dd.toDataURL(a,b)};g.getBoundingClientRect=function(){return this.Dd.getBoundingClientRect()};g.focus=function(){return this.Dd.focus()};
g.addEventListener=function(a,b,c){this.Dd.addEventListener(a,b,c)};g.removeEventListener=function(a,b,c){this.Dd.removeEventListener(a,b,c)};u.defineProperty(oa,{width:"width"},function(){return this.Dd.width},function(a){this.Dd.width=a});u.defineProperty(oa,{height:"height"},function(){return this.Dd.height},function(a){this.Dd.height=a});u.defineProperty(oa,{style:"style"},function(){return this.Dd.style},function(a){this.Dd.style=a});
var K={sa:4*((Math.sqrt(2)-1)/3),Wj:(new w(0,0)).Ka(),kF:(new z(0,0,0,0)).Ka(),np:(new rb(0,0,0,0)).Ka(),iF:(new rb(2,2,2,2)).Ka(),jF:(new ia(Infinity,Infinity)).Ka(),fF:(new w(-Infinity,-Infinity)).Ka(),eF:(new w(Infinity,Infinity)).Ka(),op:(new ia(0,0)).Ka(),Tw:(new ia(1,1)).Ka(),mp:(new ia(6,6)).Ka(),Qw:(new ia(8,8)).Ka(),gF:(new w(NaN,NaN)).Ka(),Uw:new pa,Qi:new pa,vA:null,sqrt:function(a){if(0>=a)return 0;var b=K.vA;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.vA=b}return 1>a?
(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},D:function(a,b){var c=a-b;return.5>c&&-.5<c},mb:function(a,b){var c=a-b;return 5E-8>c&&-5E-8<c},Hd:function(a,b,c,d,e,f,h){0>=e&&(e=1E-6);var k=0,l=0,m=0,n=0;a<c?(l=a,k=c):(l=c,k=a);b<d?(n=b,m=d):(n=d,m=b);if(a===c)return n<=h&&h<=m&&a-e<=f&&f<=a+e;if(b===d)return l<=f&&f<=k&&b-e<=h&&h<=b+e;k+=e;l-=e;if(l<=f&&f<=k&&(m+=e,n-=e,n<=h&&h<=m))if(k-l>m-n)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=h&&h<=f+e)return!0}else return!0;else if(b-
d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=f&&f<=h+e)return!0}else return!0;return!1},Iv:function(a,b,c,d,e,f,h,k,l,m,n,p){if(K.Hd(a,b,h,k,p,c,d)&&K.Hd(a,b,h,k,p,e,f))return K.Hd(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,t=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(q+s)/2;c=(r+t)/2;var s=(s+e)/2,t=(t+f)/2,v=(d+s)/2,x=(c+t)/2;return K.Iv(a,b,q,r,d,c,v,x,l,m,n,p)||K.Iv(v,x,s,t,e,f,h,k,l,m,n,p)},UF:function(a,b,c,d,e,f,h,k,l){var m=(c+e)/2,n=(d+f)/2;l.x=(((a+c)/2+m)/2+(m+(e+h)/2)/2)/2;l.y=(((b+d)/2+n)/2+(n+
(f+k)/2)/2)/2;return l},TF:function(a,b,c,d,e,f,h,k){var l=(c+e)/2,m=(d+f)/2;return Za(((a+c)/2+l)/2,((b+d)/2+m)/2,(l+(e+h)/2)/2,(m+(f+k)/2)/2)},oo:function(a,b,c,d,e,f,h,k,l,m){if(K.Hd(a,b,h,k,l,c,d)&&K.Hd(a,b,h,k,l,e,f))kb(m,a,b,0,0),kb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,t=(c+r)/2;K.oo(a,b,n,p,d,c,s,t,l,m);K.oo(s,t,q,r,e,f,h,k,l,m)}return m},ye:function(a,b,c,d,e,f,h,k,l,m){if(K.Hd(a,b,h,k,l,c,d)&&
K.Hd(a,b,h,k,l,e,f))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,t=(c+r)/2;K.ye(a,b,n,p,d,c,s,t,l,m);K.ye(s,t,q,r,e,f,h,k,l,m)}return m},Oz:function(a,b,c,d,e,f,h,k,l,m){if(K.Hd(a,b,e,f,m,c,d))return K.Hd(a,b,e,f,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var q=(n+c)/2,r=(p+d)/2;return K.Oz(a,b,n,p,q,r,h,k,l,m)||K.Oz(q,r,c,d,e,f,h,k,l,m)},nK:function(a,b,c,
d,e,f,h){h.x=((a+c)/2+(c+e)/2)/2;h.y=((b+d)/2+(d+f)/2)/2;return h},Nz:function(a,b,c,d,e,f,h,k){if(K.Hd(a,b,e,f,h,c,d))kb(k,a,b,0,0),kb(k,e,f,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;K.Nz(a,b,l,m,n,p,h,k);K.Nz(n,p,c,d,e,f,h,k)}return k},Xo:function(a,b,c,d,e,f,h,k){if(K.Hd(a,b,e,f,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(f);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;K.Xo(a,b,l,m,n,p,h,k);K.Xo(n,p,c,d,e,f,h,k)}return k},
js:function(a,b,c,d,e,f,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(K.Hd(a,b,h,k,q,c,d)&&K.Hd(a,b,h,k,q,e,f)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,b<k?(l=b,h=k):(l=k,h=b),s<l||s>h)return!1}else if(a<h?l=a:(l=h,h=a),q<l||q>h)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,t=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+h)/2;f=(f+k)/2;var v=(s+c)/2,x=(t+d)/2;c=(c+e)/2;d=(d+f)/2;var B=(v+c)/2,y=(x+d)/
2,C=(n-l)*(n-l)+(p-m)*(p-m),I=!1;K.js(a,b,s,t,v,x,B,y,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<C&&(C=b,I=!0));a=r.x;s=r.y;K.js(B,y,c,d,e,f,h,k,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<C?I=!0:(r.x=a,r.y=s));return I},ks:function(a,b,c,d,e,f,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(K.Hd(a,b,h,k,q,c,d)&&K.Hd(a,b,h,k,q,e,f)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,t=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<
(m>p?m-p:p-m)){if(a=l=0,b<k?(l=b,a=k):(l=k,a=b),t<l||t>a)return r}else if(a<h?(l=a,a=h):l=h,s<l||s>a)return r;0<q?r++:0>q&&r--}else{var s=(a+c)/2,t=(b+d)/2,v=(c+e)/2,x=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(s+v)/2;c=(t+x)/2;var v=(v+e)/2,x=(x+f)/2,B=(d+v)/2,y=(c+x)/2,r=r+K.ks(a,b,s,t,d,c,B,y,l,m,n,p,q),r=r+K.ks(B,y,v,x,e,f,h,k,l,m,n,p,q)}return r},Hm:function(a,b,c,d,e,f,h){if(K.mb(a,c)){var k=0;c=0;b<d?(k=b,c=d):(k=d,c=b);d=f;if(d<k)return h.x=a,h.y=k,!1;if(d>c)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(K.mb(b,
d)){a<c?k=a:(k=c,c=a);d=e;if(d<k)return h.x=k,h.y=b,!1;if(d>c)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005<k)return h.x=c,h.y=d,!1;h.x=a+k*(c-a);h.y=b+k*(d-b);return!0},$g:function(a,b,c,d,e,f,h,k,l){if(K.D(a,c)&&K.D(b,d))return l.x=a,l.y=b,!1;if(K.mb(e,h)){if(K.mb(a,c))return K.Hm(a,b,c,d,e,f,l),!1;f=(d-b)/(c-a)*(e-a)+b;return K.Hm(a,b,c,d,e,f,l)}k=(k-f)/(h-e);if(K.mb(a,c)){f=k*(a-e)+f;c=h=0;b<d?(h=b,
c=d):(h=d,c=b);if(f<h)return l.x=a,l.y=h,!1;if(f>c)return l.x=a,l.y=c,!1;l.x=a;l.y=f;return!0}h=(d-b)/(c-a);if(K.mb(k,h))return K.Hm(a,b,c,d,e,f,l),!1;e=(h*a-k*e+f-b)/(h-k);if(K.mb(h,0)){a<c?h=a:(h=c,c=a);if(e<h)return l.x=h,l.y=b,!1;if(e>c)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}f=h*(e-a)+b;return K.Hm(a,b,c,d,e,f,l)},PJ:function(a,b,c,d,e){return K.$g(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},xJ:function(a,b,c,d,e,f,h,k,l,m){function n(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e<p&&(p=e,l.x=c,l.y=d)}var p=
Infinity;n(l.x,l.y);var q=0,r=0,s=0,t=0;e<h?(q=e,r=h):(q=h,r=e);f<k?(s=e,t=h):(s=h,t=e);q=(r-q)/2+m;m=(t-s)/2+m;e=(e+h)/2;f=(f+k)/2;if(0===q||0===m)return l;if(.5>(c>a?c-a:a-c)){q=1-(c-e)*(c-e)/(q*q);if(0>q)return l;q=Math.sqrt(q);d=-m*q+f;n(c,m*q+f);n(c,d)}else{c=(d-b)/(c-a);d=1/(q*q)+c*c/(m*m);k=2*c*(b-c*a)/(m*m)-2*c*f/(m*m)-2*e/(q*q);q=k*k-4*d*(2*c*a*f/(m*m)-2*b*f/(m*m)+f*f/(m*m)+e*e/(q*q)-1+(b-c*a)*(b-c*a)/(m*m));if(0>q)return l;q=Math.sqrt(q);m=(-k+q)/(2*d);n(m,c*m-c*a+b);q=(-k-q)/(2*d);n(q,
c*q-c*a+b)}return l},bl:function(a,b,c,d,e,f,h,k,l){var m=1E21,n=a,p=b;if(K.$g(a,b,a,d,e,f,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f);q<m&&(m=q,n=l.x,p=l.y)}K.$g(c,b,c,d,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));K.$g(a,b,c,b,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));K.$g(a,d,c,d,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));l.x=n;l.y=p;return 1E21>m},dw:function(a,b,c){var d=b.x,e=b.y,f=c.x,h=c.y,k=a.left,l=a.right,
m=a.top,n=a.bottom;return d===f?(f=a=0,e<h?(a=e,f=h):(a=h,f=e),k<=d&&d<=l&&a<=n&&f>=m):e===h?(d<f?a=d:(a=f,f=d),m<=e&&e<=n&&a<=l&&f>=k):a.Aa(b)||a.Aa(c)||K.cw(k,m,l,m,d,e,f,h)||K.cw(l,m,l,n,d,e,f,h)||K.cw(l,n,k,n,d,e,f,h)||K.cw(k,n,k,m,d,e,f,h)?!0:!1},cw:function(a,b,c,d,e,f,h,k){return 0>=K.Nv(a,b,c,d,e,f)*K.Nv(a,b,c,d,h,k)&&0>=K.Nv(e,f,h,k,a,b)*K.Nv(e,f,h,k,c,d)},Nv: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,0<f&&(f=(a-c)*c+(b-d)*d,0>f&&(f=0)));return 0>f?-1:0<f?1:0},
ct:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},fD:function(a,b,c,d,e,f){void 0===f&&(f=!1);var h=Math.PI;f||(d*=h/180,e*=h/180);f=d<e?1:-1;var k=[],l=h/2,m=d;for(d=Math.min(2*h+1E-5,Math.abs(e-d));1E-5<d;)e=m+f*Math.min(d,l),k.push(K.jG(c,m,e,a,b)),d-=Math.abs(e-m),m=e;return k},jG:function(a,b,c,d,e){var f=(c-b)/2,h=a*Math.cos(f),k=a*Math.sin(f),l=.5522847498*Math.tan(f),m=h+l*k,h=-k+l*h,k=-h,l=f+b,f=Math.cos(l),l=Math.sin(l);return[d+a*Math.cos(b),e+a*Math.sin(b),d+m*f-h*l,e+m*l+h*f,d+
m*f-k*l,e+m*l+k*f,d+a*Math.cos(c),e+a*Math.sin(c)]},xs:function(a,b,c,d,e,f,h){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/f)*f+d;var k=c;c+e-a<e/2&&(k=c+e);a=d;d+f-b<f/2&&(a=d+f);h.m(k,a);return h},xD:function(a,b){var c=Math.max(a,b),d=Math.min(a,b),e=1,f=1;do e=c%d,c=f=d,d=e;while(0<e);return f},sG:function(a,b,c,d){var e=0>c,f=0>d,h=0,k=h=0;a<b?(h=1,k=0):(h=0,k=1);var l=0,m=0,n=0,l=0===h?a:b,m=0===h?c:d;if(0===h?e:f)m=-m;h=k;n=0===h?c:d;if(0===h?e:f)n=-n;return K.tG(l,0===h?a:b,m,n,0,0)},tG:function(a,
b,c,d,e,f){e=0;if(0<d)if(0<c){f=a*a;e=b*b;a*=c;var h=b*d,k=-e+h,l=-e+Math.sqrt(a*a+h*h);b=k;for(var m=0;9999999999>m;++m){b=.5*(k+l);if(b===k||b===l)break;var n=a/(b+f),p=h/(b+e),n=n*n+p*p-1;if(0<n)k=b;else if(0>n)l=b;else break}c=f*c/(b+f)-c;d=e*d/(b+e)-d;e=Math.sqrt(c*c+d*d)}else e=Math.abs(d-b);else d=a*a-b*b,e=a*c,e<d?(d=e/d,e=a*d,f=b*Math.sqrt(Math.abs(1-d*d)),c=e-c,e=Math.sqrt(c*c+f*f)):e=Math.abs(c-a);return e}};
function $c(a){1<arguments.length&&u.k("Geometry constructor can take at most one optional argument, the Geometry type.");u.gc(this);this.Ca=!1;void 0===a&&(a=ad);this.oa=a;this.Bb=this.pb=this.uc=this.nc=0;this.Zi=new E(bd);this.ju=this.Zi.U;this.Ut=(new z).freeze();this.Ta=!0;this.ri=xb;this.si=Vb;this.Cn=this.Dn=NaN;this.bi=cd}u.fa("Geometry",$c);u.Lh($c);
$c.prototype.copy=function(){var a=new $c;a.oa=this.oa;a.nc=this.nc;a.uc=this.uc;a.pb=this.pb;a.Bb=this.Bb;for(var b=this.Zi.n,c=b.length,d=a.Zi,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.ju=this.ju;a.Ut.assign(this.Ut);a.Ta=this.Ta;a.ri=this.ri.Z();a.si=this.si.Z();a.Dn=this.Dn;a.Cn=this.Cn;a.bi=this.bi;return a};var dd;$c.Line=dd=u.s($c,"Line",0);var md;$c.Rectangle=md=u.s($c,"Rectangle",1);var nd;$c.Ellipse=nd=u.s($c,"Ellipse",2);var ad;$c.Path=ad=u.s($c,"Path",3);
$c.prototype.Ka=function(){this.freeze();Object.freeze(this);return this};$c.prototype.freeze=function(){this.Ca=!0;var a=this.ub;a.freeze();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].freeze();return this};$c.prototype.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;var a=this.ub;a.La();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].La();return this};
$c.prototype.equalsApprox=$c.prototype.De=function(a){if(!(a instanceof $c))return!1;if(this.type!==a.type)return this.type===dd&&a.type===ad?od(this,a):a.type===dd&&this.type===ad?od(a,this):!1;if(this.type===ad){var b=this.ub.n;a=a.ub.n;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].De(a[d]))return!1;return!0}return K.D(this.ua,a.ua)&&K.D(this.va,a.va)&&K.D(this.F,a.F)&&K.D(this.G,a.G)};
function od(a,b){if(a.type!==dd||b.type!==ad)return!1;if(1===b.ub.count){var c=b.ub.ja(0);if(1===c.Fa.count&&K.D(a.ua,c.ua)&&K.D(a.va,c.va)&&(c=c.Fa.ja(0),c.type===pd&&K.D(a.F,c.F)&&K.D(a.G,c.G)))return!0}return!1}var qd;$c.stringify=qd=function(a){return a.toString()};
$c.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case dd:return 0>a?"M"+this.ua.toString()+" "+this.va.toString()+"L"+this.F.toString()+" "+this.G.toString():"M"+this.ua.toFixed(a)+" "+this.va.toFixed(a)+"L"+this.F.toFixed(a)+" "+this.G.toFixed(a);case md:var b=new z(this.ua,this.va,0,0);b.YE(this.F,this.G,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 nd:b=new z(this.ua,this.va,0,0);b.YE(this.F,this.G,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.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 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case ad:for(var b="",c=this.ub.n,d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.Ns&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}};var rd;
$c.fillPath=rd=function(a){"string"!==typeof a&&u.Kd(a,"string",$c,"fillPath:str");a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++)var e=a[d],c=null!==e.match(/[Ff]/)?0===d?c+e:c+("X"+(" "===e[0]?"":" ")+e):c+((0===d?"":"X ")+"F"+(" "===e[0]?"":" ")+e);return c};var sd;
$c.parse=sd=function(a,b){function c(){return m>=t-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new w(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function f(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new w(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&u.Kd(a,"string",$c,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,
"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=-1,n="",p="",q=new w(0,0),r=new w(0,0),s=new w(0,
0),t=l.length,v=u.p(),x=!1,B=!1,y=!0;!(m>=t-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":y=!0;B=x=!1;break;case "M":var C=f();null===v.Tb||!0===y?(M(v,C.x,C.y,x,!1,!B),y=!1):v.moveTo(C.x,C.y);for(q=s;!c();)C=f(),v.lineTo(C.x,C.y);break;case "L":for(;!c();)C=f(),v.lineTo(C.x,C.y);break;case "H":for(;!c();)s=C=new w((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),v.lineTo(s.x,s.y);break;case "V":for(;!c();)s=C=new w(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),v.lineTo(s.x,s.y);break;
case "C":for(;!c();){var I=e(),H=h(),C=f();O(v,I.x,I.y,H.x,H.y,C.x,C.y)}break;case "S":for(;!c();)I=k(),H=h(),C=f(),O(v,I.x,I.y,H.x,H.y,C.x,C.y);break;case "Q":for(;!c();)H=h(),C=f(),td(v,H.x,H.y,C.x,C.y);break;case "T":for(;!c();)r=H=k(),C=f(),td(v,H.x,H.y,C.x,C.y);break;case "B":for(;!c();){var C=parseFloat(d()),I=parseFloat(d()),H=parseFloat(d()),T=parseFloat(d()),aa=parseFloat(d()),R=aa,N=!1;c()||(R=parseFloat(d()),c()||(N=0!==parseFloat(d())));n===n.toLowerCase()&&(H+=s.x,T+=s.y);v.arcTo(C,I,
H,T,aa,R,N)}break;case "A":for(;!c();)I=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),T=parseFloat(d()),aa=!!parseFloat(d()),R=!!parseFloat(d()),C=f(),ud(v,I,H,T,aa,R,C.x,C.y);break;case "Z":C=v.o.ub.n[v.o.ub.length-1];P(v);s=q;break;case "F":C="";for(I=1;l[m+I];)if(null!==l[m+I].match(/[Uu]/))I++;else if(null===l[m+I].match(/[A-Za-z]/))I++;else{C=l[m+I];break}C.match(/[Mm]/)?x=!0:vd(v);break;case "U":C="";for(I=1;l[m+I];)if(null!==l[m+I].match(/[Ff]/))I++;else if(null===l[m+I].match(/[A-Za-z]/))I++;
else{C=l[m+I];break}C.match(/[Mm]/)?B=!0:v.$a(!1)}q=v.o;u.q(v);if(b)for(v=q.ub.i;v.next();)C=v.value,C.Ns=!0;return q};function wd(a,b){for(var c=a.length,d=u.K(),e=0;e<c;e++){var f=a[e];d.x=f[0];d.y=f[1];b.ab(d);f[0]=d.x;f[1]=d.y;d.x=f[2];d.y=f[3];b.ab(d);f[2]=d.x;f[3]=d.y;d.x=f[4];d.y=f[5];b.ab(d);f[4]=d.x;f[5]=d.y;d.x=f[6];d.y=f[7];b.ab(d);f[6]=d.x;f[7]=d.y}u.v(d)}
$c.prototype.vz=function(){if(this.Ta||this.ju!==this.ub.U)return!0;for(var a=this.ub.n,b=a.length,c=0;c<b;c++)if(a[c].vz())return!0;return!1};$c.prototype.nA=function(){this.Ta=!1;this.ju=this.ub.U;for(var a=this.ub.n,b=a.length,c=0;c<b;c++)a[c].nA()};$c.prototype.kg=function(){var a=this.Ut;a.La();isNaN(this.Dn)||isNaN(this.Cn)?a.m(0,0,0,0):a.m(0,0,this.Dn,this.Cn);xd(this,a,!1);kb(a,0,0,0,0);a.freeze()};
$c.prototype.computeBoundsWithoutOrigin=$c.prototype.aG=function(){var a=new z;xd(this,a,!0);return a};
function xd(a,b,c){switch(a.type){case dd:case md:case nd:c?b.m(a.nc,a.uc,0,0):kb(b,a.nc,a.uc,0,0);kb(b,a.pb,a.Bb,0,0);break;case ad:var d=a.ub;a=d.n;for(var d=d.length,e=0;e<d;e++){var f=a[e];c&&0===e?b.m(f.ua,f.va,0,0):kb(b,f.ua,f.va,0,0);for(var h=f.Fa.n,k=h.length,l=f.ua,m=f.va,n=0;n<k;n++){var p=h[n];switch(p.type){case pd:case yd:l=p.F;m=p.G;kb(b,l,m,0,0);break;case zd:K.oo(l,m,p.Rb,p.jc,p.df,p.ef,p.F,p.G,.5,b);l=p.F;m=p.G;break;case Ad:K.Nz(l,m,p.Rb,p.jc,p.F,p.G,.5,b);l=p.F;m=p.G;break;case Bd:case Gd:for(var p=
p.type===Bd?Hd(p,f):Id(p,f,l,m),q=p.length,r=null,s=0;s<q;s++)r=p[s],K.oo(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,b);null!==r&&(l=r[6],m=r[7]);break;default:u.k("Unknown Segment type: "+p.type)}}}break;default:u.k("Unknown Geometry type: "+a.type)}}$c.prototype.normalize=$c.prototype.normalize=function(){u.I(this);var a=this.aG();this.offset(-a.x,-a.y);return new w(-a.x,-a.y)};$c.prototype.offset=$c.prototype.offset=function(a,b){u.I(this);this.transform(1,0,0,1,a,b);return this};
$c.prototype.scale=$c.prototype.scale=function(a,b){u.I(this);this.transform(a,0,0,b,0,0);return this};$c.prototype.rotate=$c.prototype.rotate=function(a,b,c){u.I(this);void 0===b&&(b=0);void 0===c&&(c=0);var d=u.jh();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);u.Ye(d);return this};
$c.prototype.transform=$c.prototype.transform=function(a,b,c,d,e,f){var h=0,k=0;switch(this.type){case dd:case md:case nd:h=this.nc;k=this.uc;this.nc=h*a+k*c+e;this.uc=h*b+k*d+f;h=this.pb;k=this.Bb;this.pb=h*a+k*c+e;this.Bb=h*b+k*d+f;break;case ad:for(var l=this.ub.n,m=l.length,n=0;n<m;n++){var p=l[n],h=p.ua,k=p.va;p.ua=h*a+k*c+e;p.va=h*b+k*d+f;for(var p=p.Fa.n,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case pd:case yd:h=s.F;k=s.G;s.F=h*a+k*c+e;s.G=h*b+k*d+f;break;case zd:h=s.Rb;k=s.jc;s.Rb=
h*a+k*c+e;s.jc=h*b+k*d+f;h=s.df;k=s.ef;s.df=h*a+k*c+e;s.ef=h*b+k*d+f;h=s.F;k=s.G;s.F=h*a+k*c+e;s.G=h*b+k*d+f;break;case Ad:h=s.Rb;k=s.jc;s.Rb=h*a+k*c+e;s.jc=h*b+k*d+f;h=s.F;k=s.G;s.F=h*a+k*c+e;s.G=h*b+k*d+f;break;case Bd:h=s.Ja;k=s.Ua;s.Ja=h*a+k*c+e;s.Ua=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Je+=h);0>a&&(s.Je=180-s.Je,s.Qf=-s.Qf);0>d&&(s.Je=-s.Je,s.Qf=-s.Qf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Gd:h=s.F;k=s.G;s.F=h*
a+k*c+e;s.G=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Pi+=h);0>a&&(s.Pi=180-s.Pi,s.fl=!s.fl);0>d&&(s.Pi=-s.Pi,s.fl=!s.fl);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:u.k("Unknown Segment type: "+s.type)}}}}this.Ta=!0;return this};
$c.prototype.Xr=function(a,b){var c=this.nc,d=this.uc,e=this.pb,f=this.Bb,h=Math.min(c,e),k=Math.min(d,f),c=Math.abs(e-c),d=Math.abs(f-d),f=u.K();f.x=h;f.y=k;b.ab(f);e=new bd(f.x,f.y);f.x=h+c;f.y=k;b.ab(f);e.Fa.add(new Jd(pd,f.x,f.y));f.x=h+c;f.y=k+d;b.ab(f);e.Fa.add(new Jd(pd,f.x,f.y));f.x=h;f.y=k+d;b.ab(f);e.Fa.add((new Jd(pd,f.x,f.y)).close());u.v(f);a.type=ad;a.ub.add(e);return a};
$c.prototype.Aa=function(a,b,c,d){var e=a.x,f=a.y,h=this.kb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.ub.n,s=r.length,t=0;t<s;t++){var v=r[t];if(v.Ns){if(c&&v.Aa(e,f,b))return!0;for(var x=v.Fa,l=v.ua,m=v.va,B=l,y=m,C=x.n,I=0;I<=x.length;I++){var H,T;I!==x.length?(H=C[I],T=H.type,p=H.F,q=H.G):(T=pd,p=B,q=y);switch(T){case yd:n=Kd(e,f,h,a,l,m,B,y);if(isNaN(n))return!0;k+=n;B=p;y=q;break;case pd:n=Kd(e,f,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case zd:n=K.ks(l,m,H.Rb,H.jc,H.df,H.ef,p,q,
h,a,e,f,.5);k+=n;break;case Ad:n=K.ks(l,m,(l+2*H.Rb)/3,(m+2*H.jc)/3,(H.Rb+2*p)/3,(H.Rb+2*p)/3,p,q,h,a,e,f,.5);k+=n;break;case Bd:case Gd:T=H.type===Bd?Hd(H,v):Id(H,v,l,m);for(var aa=T.length,R=null,N=0;N<aa;N++){R=T[N];if(0===N){n=Kd(e,f,h,a,l,m,R[0],R[1]);if(isNaN(n))return!0;k+=n}n=K.ks(R[0],R[1],R[2],R[3],R[4],R[5],R[6],R[7],h,a,e,f,.5);k+=n}null!==R&&(p=R[6],q=R[7]);break;default:u.k("Unknown Segment type: "+H.type)}l=p;m=q}if(0!==k)return!0;k=0}else if(v.Aa(e,f,d?b:b+2))return!0}return 0!==k};
function Kd(a,b,c,d,e,f,h,k){if(K.Hd(e,f,h,k,.05,a,b))return NaN;var l=(a-c)*(f-k);if(0===l)return 0;var m=((a*d-b*c)*(e-h)-(a-c)*(e*k-f*h))/l;b=(a*d-b*c)*(f-k)/l;if(m>=a)return 0;if((e>h?e-h:h-e)<(f>k?f-k:k-f)){if(e=a=0,f<k?(a=f,e=k):(a=k,e=f),b<a||b>e)return 0}else if(e<h?(a=e,e=h):a=h,m<a||m>e)return 0;return 0<l?1:-1}function Ld(a,b,c,d){a=a.ub.n;for(var e=a.length,f=0;f<e;f++)if(a[f].Aa(b,c,d))return!0;return!1}
$c.prototype.getPointAlongPath=function(a){(0>a||1<a)&&u.wa(a,"0 <= fraction <= 1",$c,"getPointAlongPath:fraction");var b=this.ub.first(),c=u.eb(),d=[];d.push(b.ua);d.push(b.va);for(var e=b.ua,f=b.va,h=e,k=f,l=b.Fa.n,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.oa){case yd:c.push(d);d=[];d.push(p.F);d.push(p.G);e=p.F;f=p.G;h=e;k=f;break;case pd:d.push(p.F);d.push(p.G);e=p.F;f=p.G;break;case zd:K.ye(e,f,p.bd,p.xe,p.dg,p.eg,p.pb,p.Bb,.5,d);e=p.F;f=p.G;break;case Ad:K.Xo(e,f,p.bd,p.xe,p.pb,p.Bb,.5,d);
e=p.F;f=p.G;break;case Bd:for(var q=Hd(p,b),r=q.length,s=0;s<r;s++){var t=q[s];K.ye(e,f,t[2],t[3],t[4],t[5],t[6],t[7],.5,d);e=t[6];f=t[7]}break;case Gd:q=Id(p,b,e,f);r=q.length;for(s=0;s<r;s++)t=q[s],K.ye(e,f,t[2],t[3],t[4],t[5],t[6],t[7],.5,d),e=t[6],f=t[7];break;default:u.k("Segment not of valid type")}p.zh&&(d.push(h),d.push(k))}c.push(d);q=0;h=c.length;for(k=d=b=0;k<h;k++)for(l=c[k],m=l.length,n=0;n<m;n+=2)e=l[n],f=l[n+1],0!==n&&(p=Math.sqrt(Ya(b,d,e,f)),q+=p),b=e,d=f;a*=q;for(k=q=0;k<h;k++)for(l=
c[k],m=l.length,n=0;n<m;n++){e=l[n];f=l[n+1];if(0!==n){p=Math.sqrt(Ya(b,d,e,f));if(q+p>a)return n=(a-q)/p,u.ra(c),new w(b+(e-b)*n,d+(f-d)*n);q+=p}b=e;d=f}u.ra(c);return null};u.defineProperty($c,{type:"type"},function(){return this.oa},function(a){this.oa!==a&&(u.I(this,a),this.oa=a,this.Ta=!0)});u.defineProperty($c,{ua:"startX"},function(){return this.nc},function(a){this.nc!==a&&(u.I(this,a),this.nc=a,this.Ta=!0)});
u.defineProperty($c,{va:"startY"},function(){return this.uc},function(a){this.uc!==a&&(u.I(this,a),this.uc=a,this.Ta=!0)});u.defineProperty($c,{F:"endX"},function(){return this.pb},function(a){this.pb!==a&&(u.I(this,a),this.pb=a,this.Ta=!0)});u.defineProperty($c,{G:"endY"},function(){return this.Bb},function(a){this.Bb!==a&&(u.I(this,a),this.Bb=a,this.Ta=!0)});u.defineProperty($c,{ub:"figures"},function(){return this.Zi},function(a){this.Zi!==a&&(u.I(this,a),this.Zi=a,this.Ta=!0)});
$c.prototype.add=$c.prototype.add=function(a){this.Zi.add(a);return this};u.defineProperty($c,{A:"spot1"},function(){return this.ri},function(a){u.I(this,a);this.ri=a.Z()});u.defineProperty($c,{B:"spot2"},function(){return this.si},function(a){u.I(this,a);this.si=a.Z()});u.defineProperty($c,{Bd:"defaultStretch"},function(){return this.bi},function(a){u.I(this,a);this.bi=a});u.u($c,{kb:"bounds"},function(){this.vz()&&(this.nA(),this.kg());return this.Ut});
function bd(a,b,c,d){u.gc(this);this.Ca=!1;void 0===c&&(c=!0);this.Il=c;void 0===d&&(d=!0);this.En=d;this.nc=void 0!==a?a:0;this.uc=void 0!==b?b:0;this.Yn=new E(Jd);this.cv=this.Yn.U;this.Ta=!0}u.fa("PathFigure",bd);u.Lh(bd);bd.prototype.copy=function(){var a=new bd;a.Il=this.Il;a.En=this.En;a.nc=this.nc;a.uc=this.uc;for(var b=this.Yn.n,c=b.length,d=a.Yn,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.cv=this.cv;a.Ta=this.Ta;return a};
bd.prototype.equalsApprox=bd.prototype.De=function(a){if(!(a instanceof bd&&K.D(this.ua,a.ua)&&K.D(this.va,a.va)))return!1;var b=this.Fa.n;a=a.Fa.n;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].De(a[d]))return!1;return!0};g=bd.prototype;g.toString=function(a){void 0===a&&(a=-1);for(var b=0>a?"M"+this.ua.toString()+" "+this.va.toString():"M"+this.ua.toFixed(a)+" "+this.va.toFixed(a),c=this.Fa.n,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};
g.freeze=function(){this.Ca=!0;var a=this.Fa;a.freeze();for(var b=a.n,a=a.length,c=0;c<a;c++)b[c].freeze();return this};g.La=function(){this.Ca=!1;var a=this.Fa;a.La();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].La();return this};g.vz=function(){if(this.Ta)return!0;var a=this.Fa;if(this.cv!==a.U)return!0;for(var a=a.n,b=a.length,c=0;c<b;c++)if(a[c].Ta)return!0;return!1};g.nA=function(){this.Ta=!1;var a=this.Fa;this.cv=a.U;for(var a=a.n,b=a.length,c=0;c<b;c++){var d=a[c];d.Ta=!1;d.Ri=null}};
u.defineProperty(bd,{Ns:"isFilled"},function(){return this.Il},function(a){u.I(this,a);this.Il=a});u.defineProperty(bd,{il:"isShadowed"},function(){return this.En},function(a){u.I(this,a);this.En=a});u.defineProperty(bd,{ua:"startX"},function(){return this.nc},function(a){u.I(this,a);this.nc=a;this.Ta=!0});u.defineProperty(bd,{va:"startY"},function(){return this.uc},function(a){u.I(this,a);this.uc=a;this.Ta=!0});
u.defineProperty(bd,{Fa:"segments"},function(){return this.Yn},function(a){u.I(this,a);this.Yn=a;this.Ta=!0});bd.prototype.add=bd.prototype.add=function(a){this.Yn.add(a);return this};
bd.prototype.Aa=function(a,b,c){for(var d=this.ua,e=this.va,f=d,h=e,k=this.Fa.n,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case yd:f=n.F;h=n.G;d=n.F;e=n.G;break;case pd:if(K.Hd(d,e,n.F,n.G,c,a,b))return!0;d=n.F;e=n.G;break;case zd:if(K.Iv(d,e,n.Rb,n.jc,n.df,n.ef,n.F,n.G,.5,a,b,c))return!0;d=n.F;e=n.G;break;case Ad:if(K.Oz(d,e,n.Rb,n.jc,n.F,n.G,.5,a,b,c))return!0;d=n.F;e=n.G;break;case Bd:case Gd:for(var p=n.type===Bd?Hd(n,this):Id(n,this,d,e),q=p.length,r=null,s=0;s<q;s++)if(r=p[s],0===s&&
K.Hd(d,e,r[0],r[1],c,a,b)||K.Iv(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:u.k("Unknown Segment type: "+n.type)}if(n.ew&&(d!==f||e!==h)&&K.Hd(d,e,f,h,c,a,b))return!0}return!1};
function Jd(a,b,c,d,e,f,h,k){u.gc(this);this.Ca=!1;void 0===a&&(a=pd);this.oa=a;this.pb=void 0!==b?b:0;this.Bb=void 0!==c?c:0;a===Gd?(void 0!==f&&(a=f%360,0>a&&(a+=360),this.bd=a),void 0!==d&&(this.dg=Math.max(d,0)),void 0!==e&&(this.eg=Math.max(e,0)),this.Ln=!!h,this.bn=!!k):(void 0!==d&&(this.bd=d),void 0!==e&&(this.xe=e),void 0!==f&&(a===Bd&&(f=Math.max(f,0)),this.dg=f),void 0!==h&&"number"===typeof h&&(a===Bd&&(h=Math.max(h,0)),this.eg=h));this.zh=!1;this.Ta=!0;this.Ri=null}
u.fa("PathSegment",Jd);u.Lh(Jd);Jd.prototype.copy=function(){var a=new Jd;a.oa=this.oa;a.pb=this.pb;a.Bb=this.Bb;void 0!==this.bd&&(a.bd=this.bd);void 0!==this.xe&&(a.xe=this.xe);void 0!==this.dg&&(a.dg=this.dg);void 0!==this.eg&&(a.eg=this.eg);void 0!==this.Ln&&(a.Ln=this.Ln);void 0!==this.bn&&(a.bn=this.bn);a.zh=this.zh;a.Ta=this.Ta;return a};
Jd.prototype.equalsApprox=Jd.prototype.De=function(a){if(!(a instanceof Jd)||this.type!==a.type||this.ew!==a.ew)return!1;switch(this.type){case yd:case pd:return K.D(this.F,a.F)&&K.D(this.G,a.G);case zd:return K.D(this.F,a.F)&&K.D(this.G,a.G)&&K.D(this.Rb,a.Rb)&&K.D(this.jc,a.jc)&&K.D(this.df,a.df)&&K.D(this.ef,a.ef);case Ad:return K.D(this.F,a.F)&&K.D(this.G,a.G)&&K.D(this.Rb,a.Rb)&&K.D(this.jc,a.jc);case Bd:return K.D(this.Je,a.Je)&&K.D(this.Qf,a.Qf)&&K.D(this.Ja,a.Ja)&&K.D(this.Ua,a.Ua)&&K.D(this.radiusX,
a.radiusX)&&K.D(this.radiusY,a.radiusY);case Gd:return this.fl===a.fl&&this.hw===a.hw&&K.D(this.Pi,a.Pi)&&K.D(this.F,a.F)&&K.D(this.G,a.G)&&K.D(this.radiusX,a.radiusX)&&K.D(this.radiusY,a.radiusY);default:return!1}};
Jd.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case yd:b=0>a?"M"+this.F.toString()+" "+this.G.toString():"M"+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case pd:b=0>a?"L"+this.F.toString()+" "+this.G.toString():"L"+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case zd:b=0>a?"C"+this.Rb.toString()+" "+this.jc.toString()+" "+this.df.toString()+" "+this.ef.toString()+" "+this.F.toString()+" "+this.G.toString():"C"+this.Rb.toFixed(a)+" "+this.jc.toFixed(a)+" "+this.df.toFixed(a)+
" "+this.ef.toFixed(a)+" "+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case Ad:b=0>a?"Q"+this.Rb.toString()+" "+this.jc.toString()+" "+this.F.toString()+" "+this.G.toString():"Q"+this.Rb.toFixed(a)+" "+this.jc.toFixed(a)+" "+this.F.toFixed(a)+" "+this.G.toFixed(a);break;case Bd:b=0>a?"B"+this.Je.toString()+" "+this.Qf.toString()+" "+this.Ja.toString()+" "+this.Ua.toString()+" "+this.radiusX:"B"+this.Je.toFixed(a)+" "+this.Qf.toFixed(a)+" "+this.Ja.toFixed(a)+" "+this.Ua.toFixed(a)+" "+this.radiusX;
break;case Gd:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Pi.toString()+" "+(this.hw?1:0)+" "+(this.fl?1:0)+" "+this.F.toString()+" "+this.G.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Pi.toFixed(a)+" "+(this.hw?1:0)+" "+(this.fl?1:0)+" "+this.F.toFixed(a)+" "+this.G.toFixed(a);break;default:b=this.type.toString()}return b+(this.zh?"z":"")};var yd;Jd.Move=yd=u.s(Jd,"Move",0);var pd;Jd.Line=pd=u.s(Jd,"Line",1);var zd;
Jd.Bezier=zd=u.s(Jd,"Bezier",2);var Ad;Jd.QuadraticBezier=Ad=u.s(Jd,"QuadraticBezier",3);var Bd;Jd.Arc=Bd=u.s(Jd,"Arc",4);var Gd;Jd.SvgArc=Gd=u.s(Jd,"SvgArc",4);Jd.prototype.freeze=function(){this.Ca=!0;return this};Jd.prototype.La=function(){this.Ca=!1;return this};Jd.prototype.close=Jd.prototype.close=function(){this.zh=!0;return this};
function Hd(a,b){if(null!==a.Ri&&!1===b.Ta)return a.Ri;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);var e=a.bd,f=a.xe,h=K.fD(0,0,c<d?c:d,a.Je,a.Je+a.Qf,!1);if(c!==d){var k=u.jh();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);wd(h,k);u.Ye(k)}c=h.length;for(d=0;d<c;d++)k=h[d],k[0]+=e,k[1]+=f,k[2]+=e,k[3]+=f,k[4]+=e,k[5]+=f,k[6]+=e,k[7]+=f;a.Ri=h;return a.Ri}
function Id(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos(f(a,b,c,d))}function f(a,b,c,d){return(a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d))}if(null!==a.Ri&&!1===b.Ta)return a.Ri;b=a.dg;var h=a.eg,k=Math.PI/180*a.bd,l=a.Ln,m=a.bn,n=a.pb,p=a.Bb,q=Math.cos(k),r=Math.sin(k),s=q*(c-n)/2+r*(d-p)/2,k=-r*(c-n)/2+q*(d-p)/2,t=s*s/(b*b)+k*k/(h*h);1<t&&(b*=Math.sqrt(t),h*=Math.sqrt(t));t=(l===m?-1:1)*Math.sqrt((b*b*h*h-b*b*k*k-h*h*s*s)/(b*b*k*k+h*h*s*s));isNaN(t)&&(t=0);l=t*b*k/h;t=t*-h*s/
b;isNaN(l)&&(l=0);isNaN(t)&&(t=0);c=(c+n)/2+q*l-r*t;d=(d+p)/2+r*l+q*t;p=e(1,0,(s-l)/b,(k-t)/h);q=(s-l)/b;n=(k-t)/h;s=(-s-l)/b;l=(-k-t)/h;k=e(q,n,s,l);s=f(q,n,s,l);-1>=s?k=Math.PI:1<=s&&(k=0);!m&&0<k&&(k-=2*Math.PI);m&&0>k&&(k+=2*Math.PI);m=b>h?1:b/h;s=b>h?h/b:1;b=K.fD(0,0,b>h?b:h,p,p+k,!0);h=u.jh();h.reset();h.translate(c,d);h.rotate(a.bd,0,0);h.scale(m,s);wd(b,h);u.Ye(h);a.Ri=b;return a.Ri}
u.defineProperty(Jd,{ew:"isClosed"},function(){return this.zh},function(a){this.zh!==a&&(this.zh=a,this.Ta=!0)});u.defineProperty(Jd,{type:"type"},function(){return this.oa},function(a){u.I(this,a);this.oa=a;this.Ta=!0});u.defineProperty(Jd,{F:"endX"},function(){return this.pb},function(a){u.I(this,a);this.pb=a;this.Ta=!0});u.defineProperty(Jd,{G:"endY"},function(){return this.Bb},function(a){u.I(this,a);this.Bb=a;this.Ta=!0});
u.defineProperty(Jd,{Rb:"point1X"},function(){return this.bd},function(a){u.I(this,a);this.bd=a;this.Ta=!0});u.defineProperty(Jd,{jc:"point1Y"},function(){return this.xe},function(a){u.I(this,a);this.xe=a;this.Ta=!0});u.defineProperty(Jd,{df:"point2X"},function(){return this.dg},function(a){u.I(this,a);this.dg=a;this.Ta=!0});u.defineProperty(Jd,{ef:"point2Y"},function(){return this.eg},function(a){u.I(this,a);this.eg=a;this.Ta=!0});
u.defineProperty(Jd,{Ja:"centerX"},function(){return this.bd},function(a){u.I(this,a);this.bd=a;this.Ta=!0});u.defineProperty(Jd,{Ua:"centerY"},function(){return this.xe},function(a){u.I(this,a);this.xe=a;this.Ta=!0});u.defineProperty(Jd,{radiusX:"radiusX"},function(){return this.dg},function(a){0>a&&u.wa(a,">= zero",Jd,"radiusX");u.I(this,a);this.dg=a;this.Ta=!0});
u.defineProperty(Jd,{radiusY:"radiusY"},function(){return this.eg},function(a){0>a&&u.wa(a,">= zero",Jd,"radiusY");u.I(this,a);this.eg=a;this.Ta=!0});u.defineProperty(Jd,{Je:"startAngle"},function(){return this.pb},function(a){this.pb!==a&&(u.I(this,a),a%=360,0>a&&(a+=360),this.pb=a,this.Ta=!0)});u.defineProperty(Jd,{Qf:"sweepAngle"},function(){return this.Bb},function(a){u.I(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Bb=a;this.Ta=!0});
u.defineProperty(Jd,{fl:"isClockwiseArc"},function(){return this.bn},function(a){u.I(this,a);this.bn=a;this.Ta=!0});u.defineProperty(Jd,{hw:"isLargeArc"},function(){return this.Ln},function(a){u.I(this,a);this.Ln=a;this.Ta=!0});u.defineProperty(Jd,{Pi:"xAxisRotation"},function(){return this.bd},function(a){a%=360;0>a&&(a+=360);u.I(this,a);this.bd=a;this.Ta=!0});
function Md(){this.Y=null;this.Hy=(new w(0,0)).freeze();this.Cx=(new w(0,0)).freeze();this.Rt=this.Mu=0;this.Au="";this.rv=this.gu=!1;this.cu=this.Tt=0;this.Si=this.nu=this.wu=!1;this.Vp=null;this.qv=0;this.fg=this.nv=null}u.fa("InputEvent",Md);
Md.prototype.copy=function(){var a=new Md;a.Y=this.Y;a.Hy.assign(this.ff);a.Cx.assign(this.da);a.Mu=this.Mu;a.Rt=this.Rt;a.Au=this.Au;a.gu=this.gu;a.rv=this.rv;a.Tt=this.Tt;a.cu=this.cu;a.wu=this.wu;a.nu=this.nu;a.Si=this.Si;a.Vp=this.Vp;a.qv=this.qv;a.nv=this.nv;a.fg=this.fg;return a};
Md.prototype.toString=function(){var a="^";0!==this.gd&&(a+="M:"+this.gd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Te&&(a+="C:"+this.Te);0!==this.Uk&&(a+="D:"+this.Uk);this.Tc&&(a+="h");this.bubbles&&(a+="b");null!==this.da&&(a+="@"+this.da.toString());return a};u.defineProperty(Md,{g:"diagram"},function(){return this.Y},function(a){this.Y=a});u.defineProperty(Md,{ff:"viewPoint"},function(){return this.Hy},function(a){u.C(a,w,Md,"viewPoint");this.Hy.assign(a)});
u.defineProperty(Md,{da:"documentPoint"},function(){return this.Cx},function(a){u.C(a,w,Md,"documentPoint");this.Cx.assign(a)});u.defineProperty(Md,{gd:"modifiers"},function(){return this.Mu},function(a){this.Mu=a});u.defineProperty(Md,{button:"button"},function(){return this.Rt},function(a){this.Rt=a});u.defineProperty(Md,{key:"key"},function(){return this.Au},function(a){this.Au=a});u.defineProperty(Md,{Wk:"down"},function(){return this.gu},function(a){this.gu=a});
u.defineProperty(Md,{up:"up"},function(){return this.rv},function(a){this.rv=a});u.defineProperty(Md,{Te:"clickCount"},function(){return this.Tt},function(a){this.Tt=a});u.defineProperty(Md,{Uk:"delta"},function(){return this.cu},function(a){this.cu=a});u.defineProperty(Md,{Ps:"isMultiTouch"},function(){return this.wu},function(a){this.wu=a});u.defineProperty(Md,{Tc:"handled"},function(){return this.nu},function(a){this.nu=a});
u.defineProperty(Md,{bubbles:"bubbles"},function(){return this.Si},function(a){this.Si=a});u.defineProperty(Md,{event:"event"},function(){return this.Vp},function(a){this.Vp=a});u.u(Md,{jl:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});u.defineProperty(Md,{timestamp:"timestamp"},function(){return this.qv},function(a){this.qv=a});
u.defineProperty(Md,{Cg:"targetDiagram"},function(){return this.nv},function(a){this.nv=a});u.defineProperty(Md,{pe:"targetObject"},function(){return this.fg},function(a){this.fg=a});u.defineProperty(Md,{control:"control"},function(){return 0!==(this.gd&1)},function(a){this.gd=a?this.gd|1:this.gd&-2});u.defineProperty(Md,{shift:"shift"},function(){return 0!==(this.gd&4)},function(a){this.gd=a?this.gd|4:this.gd&-5});
u.defineProperty(Md,{alt:"alt"},function(){return 0!==(this.gd&2)},function(a){this.gd=a?this.gd|2:this.gd&-3});u.defineProperty(Md,{Ys:"meta"},function(){return 0!==(this.gd&8)},function(a){this.gd=a?this.gd|8:this.gd&-9});u.defineProperty(Md,{left:"left"},function(){return 0===this.button},function(a){this.button=a?0:2});u.defineProperty(Md,{YJ:"middle"},function(){return 1===this.button},function(a){this.button=a?1:0});
u.defineProperty(Md,{right:"right"},function(){return 2===this.button},function(a){this.button=a?2:0});function Nd(){this.Y=null;this.Ub="";this.Vu=this.iv=null;this.St=!1}u.fa("DiagramEvent",Nd);Nd.prototype.copy=function(){var a=new Nd;a.Y=this.Y;a.Ub=this.Ub;a.iv=this.iv;a.Vu=this.Vu;a.St=this.St;return a};Nd.prototype.toString=function(){var a="*"+this.name;this.cancel&&(a+="x");null!==this.hA&&(a+=":"+this.hA.toString());null!==this.Mz&&(a+="("+this.Mz.toString()+")");return a};
u.defineProperty(Nd,{g:"diagram"},function(){return this.Y},function(a){this.Y=a});u.defineProperty(Nd,{name:"name"},function(){return this.Ub},function(a){this.Ub=a});u.defineProperty(Nd,{hA:"subject"},function(){return this.iv},function(a){this.iv=a});u.defineProperty(Nd,{Mz:"parameter"},function(){return this.Vu},function(a){this.Vu=a});u.defineProperty(Nd,{cancel:"cancel"},function(){return this.St},function(a){this.St=a});
function Zd(){this.Bp=$d;this.Xl=this.Lu="";this.Wq=this.Xq=this.ar=this.br=this.$q=this.Y=this.Od=null}u.fa("ChangedEvent",Zd);var ae;Zd.Transaction=ae=u.s(Zd,"Transaction",-1);var $d;Zd.Property=$d=u.s(Zd,"Property",0);var be;Zd.Insert=be=u.s(Zd,"Insert",1);var ce;Zd.Remove=ce=u.s(Zd,"Remove",2);Zd.prototype.clear=Zd.prototype.clear=function(){this.Wq=this.Xq=this.ar=this.br=this.$q=this.Y=this.Od=null};
Zd.prototype.copy=function(){var a=new Zd;a.Od=this.Od;a.Y=this.Y;a.Bp=this.Bp;a.Lu=this.Lu;a.Xl=this.Xl;a.$q=this.$q;var b=this.br;a.br=u.Sa(b)&&"function"===typeof b.Z?b.Z():b;b=this.ar;a.ar=u.Sa(b)&&"function"===typeof b.Z?b.Z():b;b=this.Xq;a.Xq=u.Sa(b)&&"function"===typeof b.Z?b.Z():b;b=this.Wq;a.Wq=u.Sa(b)&&"function"===typeof b.Z?b.Z():b;return a};
Zd.prototype.toString=function(){var a="",a=this.Ad===ae?a+"* ":this.Ad===$d?a+(null!==this.ga?"!m":"!d"):a+((null!==this.ga?"!m":"!d")+this.Ad);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.Lf&&this.Lf!==this.propertyName&&(a+=" "+this.Lf);a+=": ";this.Ad===ae?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=de(this.object)),null!==this.oldValue&&(a+="  old: "+de(this.oldValue)),null!==this.zg&&(a+=" "+this.zg),null!==this.newValue&&
(a+="  new: "+de(this.newValue)),null!==this.xg&&(a+=" "+this.xg));return a};Zd.prototype.getValue=Zd.prototype.ta=function(a){return a?this.oldValue:this.newValue};Zd.prototype.getParam=function(a){return a?this.zg:this.xg};Zd.prototype.canUndo=Zd.prototype.canUndo=function(){return null!==this.ga||null!==this.g?!0:!1};Zd.prototype.undo=Zd.prototype.undo=function(){this.canUndo()&&(null!==this.ga?this.ga.pm(this,!0):null!==this.g&&this.g.pm(this,!0))};
Zd.prototype.canRedo=Zd.prototype.canRedo=function(){return null!==this.ga||null!==this.g?!0:!1};Zd.prototype.redo=Zd.prototype.redo=function(){this.canRedo()&&(null!==this.ga?this.ga.pm(this,!1):null!==this.g&&this.g.pm(this,!1))};u.defineProperty(Zd,{ga:"model"},function(){return this.Od},function(a){this.Od=a});u.defineProperty(Zd,{g:"diagram"},function(){return this.Y},function(a){this.Y=a});u.defineProperty(Zd,{Ad:"change"},function(){return this.Bp},function(a){this.Bp=a});
u.defineProperty(Zd,{Lf:"modelChange"},function(){return this.Lu},function(a){this.Lu=a});u.defineProperty(Zd,{propertyName:"propertyName"},function(){return this.Xl},function(a){this.Xl=a});u.u(Zd,{IJ:"isTransactionFinished"},function(){return this.Bp===ae&&("CommittedTransaction"===this.Xl||"FinishedUndo"===this.Xl||"FinishedRedo"===this.Xl)});u.defineProperty(Zd,{object:"object"},function(){return this.$q},function(a){this.$q=a});
u.defineProperty(Zd,{oldValue:"oldValue"},function(){return this.br},function(a){this.br=a});u.defineProperty(Zd,{zg:"oldParam"},function(){return this.ar},function(a){this.ar=a});u.defineProperty(Zd,{newValue:"newValue"},function(){return this.Xq},function(a){this.Xq=a});u.defineProperty(Zd,{xg:"newParam"},function(){return this.Wq},function(a){this.Wq=a});
function J(a){1<arguments.length&&u.k("Model constructor can only take one optional argument, the Array of node data.");u.gc(this);this.wx=this.Ub="";this.vk=!1;this.gy={};this.mf=[];this.tc=new la(null,Object);this.Tl="key";this.Xt=this.Eu=null;this.nx=this.ox=!1;this.Yq="category";this.uh=new la(null,F);this.jj=null;this.qi=!1;this.Gy=null;this.ha=new ee;void 0!==a&&(this.ah=a)}u.fa("Model",J);J.prototype.clear=J.prototype.clear=function(){this.mf=[];this.tc.clear();this.uh.clear();this.ha.clear()};
g=J.prototype;g.At=function(){var a="";""!==this.name&&(a+=',\n  "name": '+this.quote(this.name));""!==this.Sk&&(a+=',\n  "dataFormat": '+this.quote(this.Sk));this.nb&&(a+=',\n  "isReadOnly": '+this.nb);"key"!==this.Jm&&"string"===typeof this.Jm&&(a+=',\n  "nodeKeyProperty": '+this.quote(this.Jm));this.Xy&&(a+=',\n  "copiesArrays": true');this.Wy&&(a+=',\n  "copiesArrayObjects": true');"category"!==this.Im&&"string"===typeof this.Im&&(a+=',\n  "nodeCategoryProperty": '+this.quote(this.Im));return a};
g.pA=function(){var a="",b=this.Zs,c=!1,d;for(d in b)if(!fe(d,b[d])){c=!0;break}c&&(a=',\n  "modelData": '+oe(this,b));return a+',\n  "nodeDataArray": '+pe(this,this.ah,!0)};g.ft=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Sk=a.dataFormat);a.isReadOnly&&(this.nb=a.isReadOnly);a.nodeKeyProperty&&(this.Jm=a.nodeKeyProperty);a.copiesArrays&&(this.Xy=a.copiesArrays);a.copiesArrayObjects&&(this.Wy=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.Im=a.nodeCategoryProperty)};
g.Qz=function(a){var b=a.modelData;u.Sa(b)&&(this.ht(b),this.Zs=b);a=a.nodeDataArray;u.isArray(a)&&(this.ht(a),this.ah=a)};g.toString=function(a){void 0===a&&(a=0);if(1<a)return this.kA();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.ah;for(var c=u.qb(a),d=0;d<c;d++)var e=u.fb(a,d),b=b+(" "+this.wb(e)+":"+de(e))}return b};
J.prototype.toJson=J.prototype.toJSON=J.prototype.kA=function(a){void 0===a&&(a=this.constructor===J?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===qe?"go.TreeModel":u.rg(this));return'{ "class": '+this.quote(a)+this.At()+this.pA()+"}"};
J.fromJson=J.fromJSON=function(a,b){void 0===b&&(b=null);null!==b&&u.C(b,J,J,"fromJson:model");var c=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){}else u.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:u.k("Unable to construct a Model from: "+a);if(null===b){var e;e=null;var f=c["class"];if("string"===typeof f)try{var h=null;0===f.indexOf("go.")?(f=f.substr(3),h=da[f]):(h=da[f],void 0===h&&(h=window[f]));"function"===typeof h&&
(e=new h)}catch(k){}null===e||e instanceof J?b=e:u.k("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new Q);b.ft(c);b.Qz(c);return b};
J.prototype.replaceJsonObjects=J.prototype.ht=function(a){if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++){var d=u.fb(a,c);u.Sa(d)&&u.RC(a,c,this.ht(d))}else if(u.Sa(a)){for(c in a)if(d=a[c],u.Sa(d)&&(d=this.ht(d),a[c]=d,"points"===c&&Array.isArray(d))){for(var e=0===d.length%2,f=0;f<d.length;f++)if("number"!==typeof d[f]){e=!1;break}if(e){e=new E(w);for(f=0;f<d.length/2;f++)e.add(new w(d[2*f],d[2*f+1]));e.freeze();a[c]=e}}if("object"===typeof a){c=a;d=a["class"];if("NaN"===d)c=NaN;else if("Date"===
d)c=new Date(a.value);else if("go.Point"===d)c=new w(re(a.x),re(a.y));else if("go.Size"===d)c=new ia(re(a.width),re(a.height));else if("go.Rect"===d)c=new z(re(a.x),re(a.y),re(a.width),re(a.height));else if("go.Margin"===d)c=new rb(re(a.top),re(a.right),re(a.bottom),re(a.left));else if("go.Spot"===d)c="string"===typeof a["enum"]?tb(a["enum"]):new L(re(a.x),re(a.y),re(a.offsetX),re(a.offsetY));else if("go.Brush"===d){if(c=new ga,c.type=Da(ga,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof
L&&(c.start=a.start),a.end instanceof L&&(c.end=a.end),"number"===typeof a.startRadius&&(c.ut=re(a.startRadius)),"number"===typeof a.endRadius&&(c.us=re(a.endRadius)),a=a.colorStops,u.Sa(a))for(b in a)c.addColorStop(parseFloat(b),a[b])}else"go.Geometry"===d&&(b=null,b="string"===typeof a.path?sd(a.path):new $c,b.type=Da($c,a.type),"number"===typeof a.startX&&(b.ua=re(a.startX)),"number"===typeof a.startY&&(b.va=re(a.startY)),"number"===typeof a.endX&&(b.F=re(a.endX)),"number"===typeof a.endY&&(b.G=
re(a.endY)),a.spot1 instanceof L&&(b.A=a.spot1),a.spot2 instanceof L&&(b.B=a.spot2),c=b);a=c}}return a};J.prototype.quote=function(a){for(var b="",c=a.length,d=0;d<c;d++)var e=a[d],b='"'===e||"\\"===e?b+("\\"+e):"\b"===e?b+"\\b":"\f"===e?b+"\\f":"\n"===e?b+"\\n":"\r"===e?b+"\\r":"\t"===e?b+"\\t":b+e;return'"'+b+'"'};
J.prototype.writeJsonValue=J.prototype.Bt=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.Bt(a.valueOf()):u.isArray(a)?pe(this,a):u.Sa(a)?oe(this,a):"function"===typeof a?"null":a.toString()};
function pe(a,b,c){void 0===c&&(c=!1);var d=u.qb(b);if(0>=d)return"[]";var e=new Ba;e.add("[ ");c&&1<d&&e.add("\n");for(var f=0;f<d;f++){var h=u.fb(b,f);void 0!==h&&(0<f&&(e.add(","),c&&e.add("\n")),e.add(a.Bt(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function fe(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function se(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
function oe(a,b){var c=b;if(c instanceof w){var d=c;b={"class":"go.Point",x:se(d.x),y:se(d.y)}}else if(c instanceof ia){var e=c;b={"class":"go.Size",width:se(e.width),height:se(e.height)}}else if(c instanceof z)b={"class":"go.Rect",x:se(c.x),y:se(c.y),width:se(c.width),height:se(c.height)};else if(c instanceof rb)b={"class":"go.Margin",top:se(c.top),right:se(c.right),bottom:se(c.bottom),left:se(c.left)};else if(c instanceof L)e=c,b=e.pd()?{"class":"go.Spot",x:se(e.x),y:se(e.y),offsetX:se(e.offsetX),
offsetY:se(e.offsetY)}:{"class":"go.Spot","enum":e.toString()};else if(c instanceof ga){b={"class":"go.Brush",type:c.type.name};if(c.type===te)b.color=c.color;else if(c.type===ue||c.type===ve)b.start=c.start,b.end=c.end,c.type===ve&&(0!==c.ut&&(b.startRadius=se(c.ut)),isNaN(c.us)||(b.endRadius=se(c.us)));if(null!==c.os){for(var f={},h=c.os.i;h.next();)f[h.key]=h.value;b.colorStops=f}}else if(c instanceof $c)b={"class":"go.Geometry",type:c.type.name},0!==c.ua&&(b.startX=se(c.ua)),0!==c.va&&(b.startY=
se(c.va)),0!==c.F&&(b.endX=se(c.F)),0!==c.G&&(b.endY=se(c.G)),c.A.L(xb)||(b.spot1=c.A),c.B.L(Vb)||(b.spot2=c.B),c.type===ad&&(b.path=qd(c));else if(c instanceof S||c instanceof D||c instanceof we||c instanceof J||c instanceof xe||c instanceof sa||c instanceof Je||c instanceof xa||c instanceof ee||c instanceof Ke)return u.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+c.toString()),"{}";f="{";c=!0;for(d in b)if(e=u.sb(b,d),!fe(d,
e))if(c?c=!1:f+=", ",f+='"'+d+'":',"points"===d&&e instanceof E&&e.oa===w){h=e;e="[";for(h=h.i;h.next();){var k=h.value;1<e.length&&(e+=",");e+=a.Bt(k.x);e+=",";e+=a.Bt(k.y)}e+="]";f+=e}else f+=a.Bt(e);return f+"}"}function re(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}u.defineProperty(J,{name:"name"},function(){return this.Ub},function(a){var b=this.Ub;b!==a&&(u.j(a,"string",J,"name"),this.Ub=a,this.h("name",b,a))});
u.defineProperty(J,{Sk:"dataFormat"},function(){return this.wx},function(a){var b=this.wx;b!==a&&(u.j(a,"string",J,"dataFormat"),this.wx=a,this.h("dataFormat",b,a))});u.defineProperty(J,{nb:"isReadOnly"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(u.j(a,"boolean",J,"isReadOnly"),this.vk=a,this.h("isReadOnly",b,a))});u.defineProperty(J,{Zs:"modelData"},function(){return this.gy},function(a){var b=this.gy;b!==a&&(u.j(a,"object",J,"modelData"),this.gy=a,this.h("modelData",b,a),this.Nb(a))});
J.prototype.addChangedListener=J.prototype.Jy=function(a){u.j(a,"function",J,"addChangedListener:listener");null===this.jj&&(this.jj=new E("function"));this.jj.add(a)};J.prototype.removeChangedListener=J.prototype.Tz=function(a){u.j(a,"function",J,"removeChangedListener:listener");null!==this.jj&&(this.jj.remove(a),0===this.jj.count&&(this.jj=null))};
J.prototype.Jv=function(a){this.cb||this.ha.ED(a);if(null!==this.jj){var b=this.jj,c=b.length;if(1===c)b=b.ja(0),b(a);else if(0!==c)for(var d=b.Ke(),e=0;e<c;e++)b=d[e],b(a)}};J.prototype.raiseChangedEvent=J.prototype.Dc=function(a,b,c,d,e,f,h){Le(this,"",a,b,c,d,e,f,h)};J.prototype.raiseChanged=J.prototype.h=function(a,b,c,d,e){Le(this,"",$d,a,this,b,c,d,e)};J.prototype.raiseDataChanged=J.prototype.Pz=function(a,b,c,d,e,f){Le(this,"",$d,b,a,c,d,e,f)};
function Le(a,b,c,d,e,f,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new Zd;m.ga=a;m.Ad=c;m.Lf=b;m.propertyName=d;m.object=e;m.oldValue=f;m.zg=k;m.newValue=h;m.xg=l;a.Jv(m)}u.defineProperty(J,{ha:"undoManager"},function(){return this.Gy},function(a){var b=this.Gy;b!==a&&(u.C(a,ee,J,"undoManager"),null!==b&&b.SH(this),this.Gy=a,null!==a&&a.MF(this))});u.defineProperty(J,{cb:"skipsUndoManager"},function(){return this.qi},function(a){u.j(a,"boolean",J,"skipsUndoManager");this.qi=a});
J.prototype.pm=function(a,b){if(null!==a&&a.ga===this)if(a.Ad===$d){var c=a.object,d=a.propertyName,e=a.ta(b);u.Oa(c,d,e)}else a.Ad===be?"nodeDataArray"===a.Lf?(c=a.newValue,u.Sa(c)&&(d=this.wb(c),void 0!==d&&(b?(u.zi(this.mf,a.xg),this.tc.remove(d)):(u.yi(this.mf,a.xg,c),this.tc.add(d,c))))):""===a.Lf?(c=a.object,!u.isArray(c)&&a.propertyName&&(c=u.sb(a.object,a.propertyName)),u.isArray(c)&&(d=a.newValue,e=a.xg,b?u.zi(c,e):u.yi(c,e,d))):u.k("unknown ChangedEvent.Insert object: "+a.toString()):a.Ad===
ce?"nodeDataArray"===a.Lf?(c=a.oldValue,u.Sa(c)&&(d=this.wb(c),void 0!==d&&(b?(u.yi(this.mf,a.zg,c),this.tc.add(d,c)):(u.zi(this.mf,a.zg),this.tc.remove(d))))):""===a.Lf?(c=a.object,!u.isArray(c)&&a.propertyName&&(c=u.sb(a.object,a.propertyName)),u.isArray(c)&&(d=a.oldValue,e=a.zg,b?u.yi(c,e,d):u.zi(c,e))):u.k("unknown ChangedEvent.Remove object: "+a.toString()):a.Ad!==ae&&u.k("unknown ChangedEvent: "+a.toString())};J.prototype.startTransaction=J.prototype.Wb=function(a){return this.ha.Wb(a)};
J.prototype.commitTransaction=J.prototype.Wd=function(a){return this.ha.Wd(a)};J.prototype.rollbackTransaction=J.prototype.ap=function(){return this.ha.ap()};J.prototype.updateTargetBindings=J.prototype.Nb=function(a,b){void 0===b&&(b="");Le(this,"SourceChanged",ae,b,a,null,null)};
u.defineProperty(J,{Jm:"nodeKeyProperty"},function(){return this.Tl},function(a){var b=this.Tl;b!==a&&(Me(a,J,"nodeKeyProperty"),0<this.tc.count&&u.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Tl=a,this.h("nodeKeyProperty",b,a))});function Me(a,b,c){"string"!==typeof a&&"function"!==typeof a&&u.Kd(a,"string or function",b,c)}
J.prototype.getKeyForNodeData=J.prototype.wb=function(a){if(null!==a){var b=this.Tl;if(""!==b&&(b=u.sb(a,b),void 0!==b)){if(Ne(b))return b;u.k("Key value for node data "+a+" is not a number or a string: "+b)}}};
J.prototype.setKeyForNodeData=J.prototype.bA=function(a,b){void 0!==b&&null!==b&&Ne(b)||u.Kd(b,"number or string",J,"setKeyForNodeData:key");if(null!==a){var c=this.Tl;if(""!==c)if(this.Ue(a)){var d=u.sb(a,c);d!==b&&null===this.qf(b)&&(u.Oa(a,c,b),this.tc.remove(d),this.tc.add(b,a),Le(this,"nodeKey",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c),this.gt(d,b))}else u.Oa(a,c,b)}};
u.defineProperty(J,{RJ:"makeUniqueKeyFunction"},function(){return this.Eu},function(a){var b=this.Eu;b!==a&&(null!==a&&u.j(a,"function",J,"makeUniqueKeyFunction"),this.Eu=a,this.h("makeUniqueKeyFunction",b,a))});function Ne(a){return"number"===typeof a||"string"===typeof a}J.prototype.containsNodeData=J.prototype.Ue=function(a){a=this.wb(a);return void 0===a?!1:this.tc.contains(a)};
J.prototype.findNodeDataForKey=J.prototype.qf=function(a){null===a&&u.k("Model.findNodeDataForKey:key must not be null");return void 0!==a&&Ne(a)?this.tc.ta(a):null};
u.defineProperty(J,{ah:"nodeDataArray"},function(){return this.mf},function(a){var b=this.mf;if(b!==a){u.Qy(a,J,"nodeDataArray");this.tc.clear();this.mA();for(var c=u.qb(a),d=0;d<c;d++){var e=u.fb(a,d);if(!u.Sa(e)){u.k("Model.nodeDataArray must only contain Objects, not: "+e);return}u.Is(e)}this.mf=a;for(var f=new E(Object),d=0;d<c;d++){var e=u.fb(a,d),h=this.wb(e);void 0===h?f.add(e):null!==this.tc.ta(h)?f.add(e):this.tc.add(h,e)}for(d=f.i;d.next();)e=d.value,this.UD(e),f=this.wb(e),void 0!==f&&
this.tc.add(f,e);Le(this,"nodeDataArray",$d,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=u.fb(a,d),this.$o(e),this.Zo(e);this.XC();u.eH(a)||(this.nb=!0)}});
J.prototype.makeNodeDataKeyUnique=J.prototype.UD=function(a){if(null!==a){var b=this.Tl;if(""!==b){var c=this.wb(a);if(void 0===c||this.tc.contains(c)){var d=this.Eu;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.tc.contains(c))){u.Oa(a,b,c);return}if("string"===typeof c){for(d=2;this.tc.contains(c+d);)d++;u.Oa(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.tc.count-1;this.tc.contains(d);)d--;u.Oa(a,b,d)}else u.k("Model.getKeyForNodeData returned something other than a string or a number: "+
c)}}}};J.prototype.addNodeData=J.prototype.km=function(a){if(null!==a){u.Is(a);var b=this.wb(a);if(void 0===b||this.tc.ta(b)!==a)this.UD(a),b=this.wb(a),void 0===b?u.k("Model.makeNodeDataKeyUnique failed on "+a+".  Data not added to Model."):(this.tc.add(b,a),b=u.qb(this.mf),u.yi(this.mf,b,a),Le(this,"nodeDataArray",be,"nodeDataArray",this,null,a,null,b),this.$o(a),this.Zo(a))}};
J.prototype.addNodeDataCollection=function(a){if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++)this.km(u.fb(a,c));else for(a=a.i;a.next();)this.km(a.value)};J.prototype.removeNodeData=J.prototype.Vz=function(a){if(null!==a){var b=this.wb(a);void 0!==b&&this.tc.contains(b)&&(this.tc.remove(b),b=u.Py(this.mf,a),0>b||(u.zi(this.mf,b),Le(this,"nodeDataArray",ce,"nodeDataArray",this,a,null,b,null),this.zt(a)))}};
J.prototype.removeNodeDataCollection=function(a){if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++)this.Vz(u.fb(a,c));else for(a=a.i;a.next();)this.Vz(a.value)};g=J.prototype;g.gt=function(a,b){var c=Oe(this,a);c instanceof F&&this.uh.add(b,c)};g.mA=function(){};g.$o=function(){};g.Zo=function(){};g.zt=function(){};function Pe(a,b,c){if(void 0!==b){var d=a.uh.ta(b);null===d&&(d=new F(Object),a.uh.add(b,d));d.add(c)}}
function Qe(a,b,c){if(void 0!==b){var d=a.uh.ta(b);d instanceof F&&(void 0===c||null===c?a.uh.remove(b):(d.remove(c),0===d.count&&a.uh.remove(b)))}}function Oe(a,b){if(void 0===b)return null;var c=a.uh.ta(b);return c instanceof F?c:null}J.prototype.clearUnresolvedReferences=J.prototype.XC=function(a){void 0===a?this.uh.clear():this.uh.remove(a)};
u.defineProperty(J,{fJ:"copyNodeDataFunction"},function(){return this.Xt},function(a){var b=this.Xt;b!==a&&(null!==a&&u.j(a,"function",J,"copyNodeDataFunction"),this.Xt=a,this.h("copyNodeDataFunction",b,a))});u.defineProperty(J,{Xy:"copiesArrays"},function(){return this.ox},function(a){var b=this.ox;b!==a&&(null!==a&&u.j(a,"boolean",J,"copiesArrays"),this.ox=a,this.h("copiesArrays",b,a))});
u.defineProperty(J,{Wy:"copiesArrayObjects"},function(){return this.nx},function(a){var b=this.nx;b!==a&&(null!==a&&u.j(a,"boolean",J,"copiesArrayObjects"),this.nx=a,this.h("copiesArrayObjects",b,a))});J.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.Xt,b=null!==b?b(a,this):Re(this,a,!0);u.Sa(b)&&u.gc(b);return b};
function Re(a,b,c){if(a.Xy&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Re(a,b[c],a.Wy);d.push(e)}u.gc(d);return d}if(c&&u.Sa(b)){c=(c=b.constructor)?new c:{};for(d in b)if("__gohashid"!==d){var e=u.sb(b,d),f;f=e;f instanceof S||f instanceof D||f instanceof we||f instanceof Se||f instanceof Te||f instanceof xe||f instanceof sa||f instanceof Je||f instanceof Md||f instanceof Nd?("_"!==d[0]&&u.trace('Warning: found GraphObject or Diagram reference when copying model data on property "'+
d+'" of data object: '+b.toString()+"  \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+f.toString()),f=!0):f=f instanceof J||f instanceof ee||f instanceof Ke||f instanceof Zd?!0:!1;f||(e=Re(a,e,!1));u.Oa(c,d,e)}u.gc(c);return c}return b}var Ue=!1;
J.prototype.setDataProperty=function(a,b,c){if(this.Ue(a))if(b===this.Jm)this.bA(a,c);else{if(b===this.Im){this.Dw(a,c);return}}else!Ue&&a instanceof S&&(Ue=!0,u.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),u.trace("  Is that really your intent?"));var d=u.sb(a,b);d!==c&&(u.Oa(a,b,c),this.Pz(a,b,d,c))};J.prototype.addArrayItem=function(a,b){this.XG(a,-1,b)};
J.prototype.insertArrayItem=J.prototype.XG=function(a,b,c){a===this.mf&&u.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=u.qb(a));u.yi(a,b,c);Le(this,"",be,"",a,null,c,null,b)};J.prototype.removeArrayItem=function(a,b){void 0===b&&(b=-1);a===this.mf&&u.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=u.qb(a)-1);var c=u.fb(a,b);u.zi(a,b);Le(this,"",ce,"",a,c,null,b,null)};
u.defineProperty(J,{Im:"nodeCategoryProperty"},function(){return this.Yq},function(a){var b=this.Yq;b!==a&&(Me(a,J,"nodeCategoryProperty"),this.Yq=a,this.h("nodeCategoryProperty",b,a))});J.prototype.getCategoryForNodeData=J.prototype.fz=function(a){if(null===a)return"";var b=this.Yq;if(""===b)return"";b=u.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;u.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
J.prototype.setCategoryForNodeData=J.prototype.Dw=function(a,b){u.j(b,"string",J,"setCategoryForNodeData:cat");if(null!==a){var c=this.Yq;if(""!==c)if(this.Ue(a)){var d=u.sb(a,c);void 0===d&&(d="");d!==b&&(u.Oa(a,c,b),Le(this,"nodeCategory",$d,c,a,d,b))}else u.Oa(a,c,b)}};
function Q(a,b){2<arguments.length&&u.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");J.call(this);this.Bh=[];this.Rl=new F(Object);this.ik=this.Wt=null;this.fj="from";this.ij="to";this.Dq=this.Cq="";this.zq="category";this.Ch="";this.Ou="isGroup";this.pj="group";this.px=!1;void 0!==a&&(this.ah=a);void 0!==b&&(this.Qj=b)}u.Ga(Q,J);u.fa("GraphLinksModel",Q);
Q.prototype.clear=Q.prototype.clear=function(){J.prototype.clear.call(this);this.Bh=[];this.Rl.clear()};g=Q.prototype;g.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.kA();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.ah;for(var c=u.qb(a),d=0,d=0;d<c;d++)var e=u.fb(a,d),b=b+(" "+this.wb(e)+":"+de(e));b+="\n link data:";a=this.Qj;c=u.qb(a);for(d=0;d<c;d++)e=u.fb(a,d),b+=" "+this.$k(e)+"--\x3e"+this.cl(e)}return b};
g.At=function(){var a=J.prototype.At.call(this),b="";"category"!==this.Ts&&"string"===typeof this.Ts&&(b+=',\n  "linkCategoryProperty": '+this.quote(this.Ts));"from"!==this.Ko&&"string"===typeof this.Ko&&(b+=',\n  "linkFromKeyProperty": '+this.quote(this.Ko));"to"!==this.Mo&&"string"===typeof this.Mo&&(b+=',\n  "linkToKeyProperty": '+this.quote(this.Mo));""!==this.Us&&"string"===typeof this.Us&&(b+=',\n  "linkFromPortIdProperty": '+this.quote(this.Us));""!==this.Ws&&"string"===typeof this.Ws&&(b+=
',\n  "linkToPortIdProperty": '+this.quote(this.Ws));""!==this.Vs&&"string"===typeof this.Vs&&(b+=',\n  "linkLabelKeysProperty": '+this.quote(this.Vs));"isGroup"!==this.bt&&"string"===typeof this.bt&&(b+=',\n  "nodeIsGroupProperty": '+this.quote(this.bt));"group"!==this.Vo&&"string"===typeof this.Vo&&(b+=',\n  "nodeGroupKeyProperty": '+this.quote(this.Vo));return a+b};g.pA=function(){var a=J.prototype.pA.call(this),b=',\n  "linkDataArray": '+pe(this,this.Qj,!0);return a+b};
g.ft=function(a){J.prototype.ft.call(this,a);a.linkFromKeyProperty&&(this.Ko=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.Mo=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.Us=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.Ws=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.Ts=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.Vs=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.bt=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&(this.Vo=a.nodeGroupKeyProperty)};
g.Qz=function(a){J.prototype.Qz.call(this,a);a=a.linkDataArray;u.isArray(a)&&(this.ht(a),this.Qj=a)};g.pm=function(a,b){var c=null;if(a.Ad===be){if("linkDataArray"===a.Lf?c=this.Bh:"linkLabelKeys"===a.Lf&&(c=this.Pj(a.object)),u.isArray(c)){b?u.zi(c,a.xg):u.yi(c,a.xg,a.newValue);return}}else if(a.Ad===ce&&("linkDataArray"===a.Lf?c=this.Bh:"linkLabelKeys"===a.Lf&&(c=this.Pj(a.object)),u.isArray(c))){b?u.yi(c,a.zg,a.oldValue):u.zi(c,a.zg);return}J.prototype.pm.call(this,a,b)};
u.defineProperty(Q,{Oy:"archetypeNodeData"},function(){return this.ik},function(a){var b=this.ik;b!==a&&(null!==a&&u.C(a,Object,Q,"archetypeNodeData"),this.ik=a,this.h("archetypeNodeData",b,a))});Q.prototype.Gm=function(a){if(void 0!==a){var b=this.ik;if(null!==b){var c=this.qf(a);null===c&&(c=this.copyNodeData(b),u.Oa(c,this.Tl,a),this.km(c))}return a}};
u.defineProperty(Q,{Ko:"linkFromKeyProperty"},function(){return this.fj},function(a){var b=this.fj;b!==a&&(Me(a,Q,"linkFromKeyProperty"),this.fj=a,this.h("linkFromKeyProperty",b,a))});Q.prototype.getFromKeyForLinkData=Q.prototype.$k=function(a){if(null!==a){var b=this.fj;if(""!==b&&(b=u.sb(a,b),void 0!==b)){if(Ne(b))return b;u.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setFromKeyForLinkData=Q.prototype.Ew=function(a,b){null===b&&(b=void 0);void 0===b||Ne(b)||u.Kd(b,"number or string",Q,"setFromKeyForLinkData:key");if(null!==a){var c=this.fj;if(""!==c)if(b=this.Gm(b),this.Ci(a)){var d=u.sb(a,c);d!==b&&(Qe(this,d,a),u.Oa(a,c,b),null===this.qf(b)&&Pe(this,b,a),Le(this,"linkFromKey",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};
u.defineProperty(Q,{Mo:"linkToKeyProperty"},function(){return this.ij},function(a){var b=this.ij;b!==a&&(Me(a,Q,"linkToKeyProperty"),this.ij=a,this.h("linkToKeyProperty",b,a))});Q.prototype.getToKeyForLinkData=Q.prototype.cl=function(a){if(null!==a){var b=this.ij;if(""!==b&&(b=u.sb(a,b),void 0!==b)){if(Ne(b))return b;u.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setToKeyForLinkData=Q.prototype.Gw=function(a,b){null===b&&(b=void 0);void 0===b||Ne(b)||u.Kd(b,"number or string",Q,"setToKeyForLinkData:key");if(null!==a){var c=this.ij;if(""!==c)if(b=this.Gm(b),this.Ci(a)){var d=u.sb(a,c);d!==b&&(Qe(this,d,a),u.Oa(a,c,b),null===this.qf(b)&&Pe(this,b,a),Le(this,"linkToKey",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};
u.defineProperty(Q,{Us:"linkFromPortIdProperty"},function(){return this.Cq},function(a){var b=this.Cq;b!==a&&(Me(a,Q,"linkFromPortIdProperty"),this.Cq=a,this.h("linkFromPortIdProperty",b,a))});Q.prototype.getFromPortIdForLinkData=Q.prototype.FG=function(a){if(null===a)return"";var b=this.Cq;if(""===b)return"";a=u.sb(a,b);return void 0===a?"":a};
Q.prototype.setFromPortIdForLinkData=Q.prototype.aA=function(a,b){u.j(b,"string",Q,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Cq;if(""!==c)if(this.Ci(a)){var d=u.sb(a,c);void 0===d&&(d="");d!==b&&(u.Oa(a,c,b),Le(this,"linkFromPortId",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};u.defineProperty(Q,{Ws:"linkToPortIdProperty"},function(){return this.Dq},function(a){var b=this.Dq;b!==a&&(Me(a,Q,"linkToPortIdProperty"),this.Dq=a,this.h("linkToPortIdProperty",b,a))});
Q.prototype.getToPortIdForLinkData=Q.prototype.IG=function(a){if(null===a)return"";var b=this.Dq;if(""===b)return"";a=u.sb(a,b);return void 0===a?"":a};Q.prototype.setToPortIdForLinkData=Q.prototype.eA=function(a,b){u.j(b,"string",Q,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Dq;if(""!==c)if(this.Ci(a)){var d=u.sb(a,c);void 0===d&&(d="");d!==b&&(u.Oa(a,c,b),Le(this,"linkToPortId",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};
u.defineProperty(Q,{Vs:"linkLabelKeysProperty"},function(){return this.Ch},function(a){var b=this.Ch;b!==a&&(Me(a,Q,"linkLabelKeysProperty"),this.Ch=a,this.h("linkLabelKeysProperty",b,a))});Q.prototype.getLabelKeysForLinkData=Q.prototype.Pj=function(a){if(null===a)return u.mh;var b=this.Ch;if(""===b)return u.mh;a=u.sb(a,b);return void 0===a?u.mh:a};
Q.prototype.setLabelKeysForLinkData=Q.prototype.FE=function(a,b){u.Qy(b,Q,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Ch;if(""!==c)if(this.Ci(a)){var d=u.sb(a,c);void 0===d&&(d=u.mh);if(d!==b){for(var e=u.qb(d),f=0;f<e;f++){var h=u.fb(d,f);Qe(this,h,a)}u.Oa(a,c,b);e=u.qb(b);for(f=0;f<e;f++)h=u.fb(b,f),null===this.qf(h)&&Pe(this,h,a);Le(this,"linkLabelKeys",$d,c,a,d,b);"string"===typeof c&&this.Nb(a,c)}}else u.Oa(a,c,b)}};
Q.prototype.addLabelKeyForLinkData=Q.prototype.Ly=function(a,b){if(null!==b&&void 0!==b&&(Ne(b)||u.Kd(b,"number or string",Q,"addLabelKeyForLinkData:key"),null!==a)){var c=this.Ch;if(""!==c){var d=u.sb(a,c);void 0===d?(c=[],c.push(b),this.FE(a,c)):u.isArray(d)?0<=u.Py(d,b)||(u.yi(d,Infinity,b),this.Ci(a)&&(null===this.qf(b)&&Pe(this,b,a),Le(this,"linkLabelKeys",be,c,a,null,b))):u.k(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
Q.prototype.removeLabelKeyForLinkData=Q.prototype.mE=function(a,b){if(null!==b&&void 0!==b&&(Ne(b)||u.Kd(b,"number or string",Q,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.Ch;if(""!==c){var d=u.sb(a,c);if(u.isArray(d)){var e=u.Py(d,b);0>e||(u.zi(d,e),this.Ci(a)&&(Qe(this,b,a),Le(this,"linkLabelKeys",ce,c,a,b,null)))}else void 0!==d&&u.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
u.defineProperty(Q,{Qj:"linkDataArray"},function(){return this.Bh},function(a){var b=this.Bh;if(b!==a){u.Qy(a,Q,"linkDataArray");for(var c=u.qb(a),d=0;d<c;d++){var e=u.fb(a,d);if(!u.Sa(e)){u.k("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}u.Is(e)}this.Bh=a;for(var f=new F(Object),d=0;d<c;d++)e=u.fb(a,d),f.add(e);this.Rl=f;Le(this,"linkDataArray",$d,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=u.fb(a,d),af(this,e)}});
Q.prototype.containsLinkData=Q.prototype.Ci=function(a){return null===a?!1:this.Rl.contains(a)};Q.prototype.addLinkData=Q.prototype.xv=function(a){if(null!==a){if(void 0===u.Uc(a))u.gc(a);else if(this.Ci(a))return;this.Rl.add(a);var b=u.qb(this.Bh);u.yi(this.Bh,b,a);Le(this,"linkDataArray",be,"linkDataArray",this,null,a,null,b);af(this,a)}};Q.prototype.addLinkDataCollection=function(a){if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++)this.xv(u.fb(a,c));else for(a=a.i;a.next();)this.xv(a.value)};
Q.prototype.removeLinkData=Q.prototype.Uz=function(a){if(null!==a){this.Rl.remove(a);var b=this.Bh.indexOf(a);if(!(0>b)){u.zi(this.Bh,b);Le(this,"linkDataArray",ce,"linkDataArray",this,a,null,b,null);b=this.$k(a);Qe(this,b,a);b=this.cl(a);Qe(this,b,a);var c=this.Pj(a);if(u.isArray(c))for(var d=u.qb(c),e=0;e<d;e++)b=u.fb(c,e),Qe(this,b,a)}}};Q.prototype.removeLinkDataCollection=function(a){if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++)this.Uz(u.fb(a,c));else for(a=a.i;a.next();)this.Uz(a.value)};
function af(a,b){var c=a.$k(b),c=a.Gm(c);null===a.qf(c)&&Pe(a,c,b);c=a.cl(b);c=a.Gm(c);null===a.qf(c)&&Pe(a,c,b);var d=a.Pj(b);if(u.isArray(d))for(var e=u.qb(d),f=0;f<e;f++)c=u.fb(d,f),null===a.qf(c)&&Pe(a,c,b)}u.defineProperty(Q,{eJ:"copyLinkDataFunction"},function(){return this.Wt},function(a){var b=this.Wt;b!==a&&(null!==a&&u.j(a,"function",Q,"copyLinkDataFunction"),this.Wt=a,this.h("copyLinkDataFunction",b,a))});
Q.prototype.copyLinkData=Q.prototype.eD=function(a){if(null===a)return null;var b=null,b=this.Wt;if(null!==b)b=b(a,this);else{var b=new a.constructor,c;for(c in a)if("__gohashid"!==c){var d=u.sb(a,c);u.Oa(b,c,d)}}null!==b&&(u.gc(b),""!==this.fj&&u.Oa(b,this.fj,void 0),""!==this.ij&&u.Oa(b,this.ij,void 0),""!==this.Ch&&u.Oa(b,this.Ch,[]));return b};
u.defineProperty(Q,{bt:"nodeIsGroupProperty"},function(){return this.Ou},function(a){var b=this.Ou;b!==a&&(Me(a,Q,"nodeIsGroupProperty"),this.Ou=a,this.h("nodeIsGroupProperty",b,a))});Q.prototype.isGroupForNodeData=Q.prototype.sz=function(a){if(null===a)return!1;var b=this.Ou;return""===b?!1:u.sb(a,b)?!0:!1};u.defineProperty(Q,{Vo:"nodeGroupKeyProperty"},function(){return this.pj},function(a){var b=this.pj;b!==a&&(Me(a,Q,"nodeGroupKeyProperty"),this.pj=a,this.h("nodeGroupKeyProperty",b,a))});
u.defineProperty(Q,{tm:"copiesGroupKeyOfNodeData"},function(){return this.px},function(a){this.px!==a&&(u.j(a,"boolean",Q,"copiesGroupKeyOfNodeData"),this.px=a)});Q.prototype.getGroupKeyForNodeData=Q.prototype.Bm=function(a){if(null!==a){var b=this.pj;if(""!==b&&(b=u.sb(a,b),void 0!==b)){if(Ne(b))return b;u.k("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setGroupKeyForNodeData=Q.prototype.Fw=function(a,b){null===b&&(b=void 0);void 0===b||Ne(b)||u.Kd(b,"number or string",Q,"setGroupKeyForNodeData:key");if(null!==a){var c=this.pj;if(""!==c)if(this.Ue(a)){var d=u.sb(a,c);d!==b&&(Qe(this,d,a),u.Oa(a,c,b),null===this.qf(b)&&Pe(this,b,a),Le(this,"nodeGroupKey",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};
Q.prototype.copyNodeData=function(a){if(null===a)return null;a=J.prototype.copyNodeData.call(this,a);this.tm||""===this.pj||u.Oa(a,this.pj,void 0);return a};
Q.prototype.setDataProperty=function(a,b,c){if(this.Ue(a))if(b===this.Jm)this.bA(a,c);else{if(b===this.Im){this.Dw(a,c);return}if(b===this.Vo){this.Fw(a,c);return}b===this.bt&&u.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.Ci(a)){if(b===this.Ko){this.Ew(a,c);return}if(b===this.Mo){this.Gw(a,c);return}if(b===this.Us){this.aA(a,c);return}if(b===this.Ws){this.eA(a,c);return}if(b===this.Ts){this.EE(a,c);return}if(b===this.Vs){this.FE(a,c);return}}else!Ue&&
a instanceof S&&(Ue=!0,u.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),u.trace("  Is that really your intent?"));var d=u.sb(a,b);d!==c&&(u.Oa(a,b,c),this.Pz(a,b,d,c))};g=Q.prototype;
g.gt=function(a,b){J.prototype.gt.call(this,a,b);for(var c=this.tc.i;c.next();)this.Xz(c.value,a,b);for(var d=this.Rl.i;d.next();){var e=c.value,f=a,h=b;if(this.$k(e)===f){var k=this.fj;u.Oa(e,k,h);Le(this,"linkFromKey",$d,k,e,f,h);"string"===typeof k&&this.Nb(e,k)}this.cl(e)===f&&(k=this.ij,u.Oa(e,k,h),Le(this,"linkToKey",$d,k,e,f,h),"string"===typeof k&&this.Nb(e,k));var l=this.Pj(e);if(u.isArray(l))for(var m=u.qb(l),k=this.Ch,n=0;n<m;n++)u.fb(l,n)===f&&(u.RC(l,n,h),Le(this,"linkLabelKeys",be,k,
e,f,h))}};g.Xz=function(a,b,c){if(this.Bm(a)===b){var d=this.pj;u.Oa(a,d,c);Le(this,"nodeGroupKey",$d,d,a,b,c);"string"===typeof d&&this.Nb(a,d)}};g.mA=function(){J.prototype.mA.call(this);for(var a=this.Qj,b=u.qb(a),c=0;c<b;c++){var d=u.fb(a,c);af(this,d)}};
g.$o=function(a){J.prototype.$o.call(this,a);a=this.wb(a);var b=Oe(this,a);if(null!==b){for(var c=new E(Object),b=b.i;b.next();){var d=b.value;if(this.Ue(d)){if(this.Bm(d)===a){var e=this.pj;Le(this,"nodeGroupKey",$d,e,d,a,a);"string"===typeof e&&this.Nb(d,e);c.add(d)}}else{this.$k(d)===a&&(e=this.fj,Le(this,"linkFromKey",$d,e,d,a,a),"string"===typeof e&&this.Nb(d,e),c.add(d));this.cl(d)===a&&(e=this.ij,Le(this,"linkToKey",$d,e,d,a,a),"string"===typeof e&&this.Nb(d,e),c.add(d));var f=this.Pj(d);if(u.isArray(f))for(var h=
u.qb(f),e=this.Ch,k=0;k<h;k++)u.fb(f,k)===a&&(Le(this,"linkLabelKeys",be,e,d,a,a),c.add(d))}}for(c=c.i;c.next();)Qe(this,a,c.value)}};g.Zo=function(a){J.prototype.Zo.call(this,a);var b=this.Bm(a);null===this.qf(b)&&Pe(this,b,a)};g.zt=function(a){J.prototype.zt.call(this,a);var b=this.Bm(a);Qe(this,b,a)};u.defineProperty(Q,{Ts:"linkCategoryProperty"},function(){return this.zq},function(a){var b=this.zq;b!==a&&(Me(a,Q,"linkCategoryProperty"),this.zq=a,this.h("linkCategoryProperty",b,a))});
Q.prototype.getCategoryForLinkData=Q.prototype.Zv=function(a){if(null===a)return"";var b=this.zq;if(""===b)return"";b=u.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;u.k("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
Q.prototype.setCategoryForLinkData=Q.prototype.EE=function(a,b){u.j(b,"string",Q,"setCategoryForLinkData:cat");if(null!==a){var c=this.zq;if(""===c)return"";if(this.Ci(a)){var d=u.sb(a,c);void 0===d&&(d="");d!==b&&(u.Oa(a,c,b),Le(this,"linkCategory",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};
function qe(a){1<arguments.length&&u.k("TreeModel constructor can only take one optional argument, the Array of node data.");J.call(this);this.qj="parent";this.qx=!1;this.er="parentLinkCategory";void 0!==a&&(this.ah=a)}u.Ga(qe,J);u.fa("TreeModel",qe);qe.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.kA();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.ah;for(var c=u.qb(a),d=0;d<c;d++)var e=u.fb(a,d),b=b+(" "+this.wb(e)+":"+de(e))}return b};
qe.prototype.At=function(){var a=J.prototype.At.call(this),b="";"parent"!==this.Wo&&"string"===typeof this.Wo&&(b+=',\n  "nodeParentKeyProperty": '+this.quote(this.Wo));return a+b};qe.prototype.ft=function(a){J.prototype.ft.call(this,a);a.nodeParentKeyProperty&&(this.Wo=a.nodeParentKeyProperty)};qe.prototype.Gm=function(a){return a};
u.defineProperty(qe,{Wo:"nodeParentKeyProperty"},function(){return this.qj},function(a){var b=this.qj;b!==a&&(Me(a,qe,"nodeParentKeyProperty"),this.qj=a,this.h("nodeParentKeyProperty",b,a))});u.defineProperty(qe,{um:"copiesParentKeyOfNodeData"},function(){return this.qx},function(a){this.qx!==a&&(u.j(a,"boolean",qe,"copiesParentKeyOfNodeData"),this.qx=a)});
qe.prototype.getParentKeyForNodeData=qe.prototype.Cm=function(a){if(null!==a){var b=this.qj;if(""!==b&&(b=u.sb(a,b),void 0!==b)){if(Ne(b))return b;u.k("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
qe.prototype.setParentKeyForNodeData=qe.prototype.ih=function(a,b){null===b&&(b=void 0);void 0===b||Ne(b)||u.Kd(b,"number or string",qe,"setParentKeyForNodeData:key");if(null!==a){var c=this.qj;if(""!==c)if(b=this.Gm(b),this.Ue(a)){var d=u.sb(a,c);d!==b&&(Qe(this,d,a),u.Oa(a,c,b),null===this.qf(b)&&Pe(this,b,a),Le(this,"nodeParentKey",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};
u.defineProperty(qe,{lK:"parentLinkCategoryProperty"},function(){return this.er},function(a){var b=this.er;b!==a&&(Me(a,qe,"parentLinkCategoryProperty"),this.er=a,this.h("parentLinkCategoryProperty",b,a))});qe.prototype.getParentLinkCategoryForNodeData=qe.prototype.HG=function(a){if(null===a)return"";var b=this.er;if(""===b)return"";b=u.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;u.k("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
qe.prototype.setParentLinkCategoryForNodeData=qe.prototype.hI=function(a,b){u.j(b,"string",qe,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.er;if(""===c)return"";if(this.Ue(a)){var d=u.sb(a,c);void 0===d&&(d="");d!==b&&(u.Oa(a,c,b),Le(this,"parentLinkCategory",$d,c,a,d,b),"string"===typeof c&&this.Nb(a,c))}else u.Oa(a,c,b)}};qe.prototype.copyNodeData=function(a){if(null===a)return null;a=J.prototype.copyNodeData.call(this,a);this.um||""===this.qj||u.Oa(a,this.qj,void 0);return a};
qe.prototype.setDataProperty=function(a,b,c){if(this.Ue(a))if(b===this.Jm)this.bA(a,c);else{if(b===this.Im){this.Dw(a,c);return}if(b===this.Wo){this.ih(a,c);return}}else!Ue&&a instanceof S&&(Ue=!0,u.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),u.trace("  Is that really your intent?"));var d=u.sb(a,b);d!==c&&(u.Oa(a,b,c),this.Pz(a,b,d,c))};g=qe.prototype;g.gt=function(a,b){J.prototype.gt.call(this,a,b);for(var c=this.tc.i;c.next();)this.Xz(c.value,a,b)};
g.Xz=function(a,b,c){if(this.Cm(a)===b){var d=this.qj;u.Oa(a,d,c);Le(this,"nodeParentKey",$d,d,a,b,c);"string"===typeof d&&this.Nb(a,d)}};g.$o=function(a){J.prototype.$o.call(this,a);a=this.wb(a);var b=Oe(this,a);if(null!==b){for(var c=new E(Object),b=b.i;b.next();){var d=b.value;if(this.Ue(d)&&this.Cm(d)===a){var e=this.qj;Le(this,"nodeParentKey",$d,e,d,a,a);"string"===typeof e&&this.Nb(d,e);c.add(d)}}for(c=c.i;c.next();)Qe(this,a,c.value)}};
g.Zo=function(a){J.prototype.Zo.call(this,a);var b=this.Cm(a),b=this.Gm(b);null===this.qf(b)&&Pe(this,b,a)};g.zt=function(a){J.prototype.zt.call(this,a);var b=this.Cm(a);Qe(this,b,a)};
function bf(a,b,c){u.gc(this);this.Ca=!1;void 0===a?a="":u.j(a,"string",bf,"constructor:targetprop");void 0===b?b=a:u.j(b,"string",bf,"constructor:sourceprop");void 0===c?c=null:null!==c&&u.j(c,"function",bf,"constructor:conv");this.mC=-1;this.fg=null;this.ov=a;this.mv=this.Ay=0;this.hC=null;this.Ey=!1;this.fv=b;this.mx=c;this.ey=cf;this.gx=null}u.fa("Binding",bf);var cf;bf.OneWay=cf=u.s(bf,"OneWay",1);var df;bf.TwoWay=df=u.s(bf,"TwoWay",2);
bf.parseEnum=function(a,b){u.j(a,"function",bf,"parseEnum:ctor");u.rb(b,a,bf,"parseEnum:defval");return function(c){c=Da(a,c);return null===c?b:c}};var de;bf.toString=de=function(a){var b=a;u.Sa(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()};
bf.prototype.toString=function(){return"Binding("+this.Lw+":"+this.LE+(-1!==this.tl?" "+this.tl:"")+" "+this.mode.name+")"};bf.prototype.freeze=function(){this.Ca=!0;return this};bf.prototype.La=function(){this.Ca=!1;return this};u.defineProperty(bf,{tl:null},function(){return this.mC},function(a){u.I(this);u.j(a,"number",bf,"targetId");this.mC=a});u.defineProperty(bf,{Lw:"targetProperty"},function(){return this.ov},function(a){u.I(this);u.j(a,"string",bf,"targetProperty");this.ov=a});
u.defineProperty(bf,{Nm:"sourceName"},function(){return this.hC},function(a){u.I(this);null!==a&&u.j(a,"string",bf,"sourceName");this.hC=a;null!==a&&(this.Ey=!1)});u.defineProperty(bf,{xt:"toModel"},function(){return this.Ey},function(a){u.I(this);u.j(a,"boolean",bf,"toModel");this.Ey=a});u.defineProperty(bf,{LE:"sourceProperty"},function(){return this.fv},function(a){u.I(this);u.j(a,"string",bf,"sourceProperty");this.fv=a});
u.defineProperty(bf,{eG:"converter"},function(){return this.mx},function(a){u.I(this);null!==a&&u.j(a,"function",bf,"converter");this.mx=a});u.defineProperty(bf,{SF:"backConverter"},function(){return this.gx},function(a){u.I(this);null!==a&&u.j(a,"function",bf,"backConverter");this.gx=a});u.defineProperty(bf,{mode:"mode"},function(){return this.ey},function(a){u.I(this);u.rb(a,bf,bf,"mode");this.ey=a});
bf.prototype.makeTwoWay=function(a){void 0===a&&(a=null);null!==a&&u.j(a,"function",bf,"makeTwoWay");this.mode=df;this.SF=a;return this};bf.prototype.ofObject=bf.prototype.rw=function(a){void 0===a&&(a="");this.Nm=a;this.xt=!1;return this};bf.prototype.ofModel=function(){this.Nm=null;this.xt=!0;return this};bf.prototype.ofData=function(){this.Nm=null;this.xt=!1;return this};function ef(a,b,c){a=a.Nm;var d=null;return d=null===a||""===a?b:"."===a?c:".."===a?c.S:b.je(a)}
bf.prototype.updateTarget=bf.prototype.ZE=function(a,b,c){var d=this.fv;if(void 0===c||d===c){c=this.ov;var e=this.mx;if(null===e&&""===c)u.trace("Binding error: target property is the empty string: "+this.toString());else{var f=b;""!==d&&(f=u.sb(b,d));if(void 0!==f)if(null===e)""!==c&&u.Oa(a,c,f);else try{if(""!==c){var h=e(f,a);u.Oa(a,c,h)}else e(f,a)}catch(k){}}}};
bf.prototype.updateSource=bf.prototype.Mw=function(a,b,c,d){void 0===d&&(d=null);if(this.ey===df){var e=this.ov;if(void 0===c||e===c){c=this.fv;var f=this.gx;if(null!==f||""!==c){var h=a;""!==e&&(h=u.sb(a,e));if(void 0!==h)if(null===f)null!==d&&d.ga?d.ga.setDataProperty(b,c,h):u.Oa(b,c,h);else try{if(""!==c){var k=f(h,b);null!==d&&d.ga?d.ga.setDataProperty(b,c,k):u.Oa(b,c,k)}else f(h,b)}catch(l){}}}}};function Ke(){this.mF=(new E(Zd)).freeze();this.Ub="";this.nB=!1}u.fa("Transaction",Ke);
Ke.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.Ug.count.toString()+(this.Ms?"":", incomplete");if(void 0!==a&&0<a){a=this.Ug.count;for(var c=0;c<a;c++){var d=this.Ug.ja(c);null!==d&&(b+="\n  "+d.toString())}}return b};Ke.prototype.clear=Ke.prototype.clear=function(){var a=this.Ug;a.La();for(var b=a.count-1;0<=b;b--){var c=a.ja(b);null!==c&&c.clear()}a.clear();a.freeze()};Ke.prototype.canUndo=Ke.prototype.canUndo=function(){return this.Ms};
Ke.prototype.undo=Ke.prototype.undo=function(){if(this.canUndo())for(var a=this.Ug.count-1;0<=a;a--){var b=this.Ug.ja(a);null!==b&&b.undo()}};Ke.prototype.canRedo=Ke.prototype.canRedo=function(){return this.Ms};Ke.prototype.redo=Ke.prototype.redo=function(){if(this.canRedo())for(var a=this.Ug.count,b=0;b<a;b++){var c=this.Ug.ja(b);null!==c&&c.redo()}};u.u(Ke,{Ug:"changes"},function(){return this.mF});u.defineProperty(Ke,{name:"name"},function(){return this.Ub},function(a){this.Ub=a});
u.defineProperty(Ke,{Ms:"isComplete"},function(){return this.nB},function(a){this.nB=a});function ee(){this.hy=new F(J);this.Ne=!1;this.tF=(new E(Ke)).freeze();this.Ig=-1;this.CB=999;this.fi=!1;this.bu=null;this.Jk=0;this.GA=!1;this.Og=(new E("string")).freeze();this.Qn=new E("number");this.Kx=!0;this.Yx=!1}u.fa("UndoManager",ee);
ee.prototype.toString=function(a){for(var b="UndoManager "+this.Ii+"<"+this.history.count+"<="+this.VD,b=b+"[",c=this.bE.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.bE.ja(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.ja(d).toString(a-1);return b};
ee.prototype.clear=ee.prototype.clear=function(){var a=this.history;a.La();for(var b=a.count-1;0<=b;b--){var c=a.ja(b);null!==c&&c.clear()}a.clear();this.Ig=-1;a.freeze();this.fi=!1;this.bu=null;this.Jk=0;this.Og.La();this.Og.clear();this.Og.freeze();this.Qn.clear()};ee.prototype.addModel=ee.prototype.MF=function(a){this.hy.add(a)};ee.prototype.removeModel=ee.prototype.SH=function(a){this.hy.remove(a)};
ee.prototype.startTransaction=ee.prototype.Wb=function(a){void 0===a&&(a="");null===a&&(a="");if(this.gb)return!1;!0===this.Kx&&(this.Kx=!1,this.Jk++,this.Rc("StartingFirstTransaction",a,this.Di),0<this.Jk&&this.Jk--);this.isEnabled&&(this.Og.La(),this.Og.add(a),this.Og.freeze(),null===this.Di?this.Qn.add(0):this.Qn.add(this.Di.Ug.count));this.Jk++;var b=1===this.Le;b&&this.Rc("StartedTransaction",a,this.Di);return b};
ee.prototype.commitTransaction=ee.prototype.Wd=function(a){void 0===a&&(a="");return ff(this,!0,a)};ee.prototype.rollbackTransaction=ee.prototype.ap=function(){return ff(this,!1,"")};
function ff(a,b,c){if(a.gb)return!1;a.Ry&&1>a.Le&&u.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Le;d&&b&&a.isEnabled&&a.Rc("CommittingTransaction",c,a.Di);var e=0;if(0<a.Le&&(a.Jk--,a.isEnabled)){var f=a.Og.count;0<f&&(""===c&&(c=a.Og.ja(0)),a.Og.La(),a.Og.hd(f-1),a.Og.freeze());f=a.Qn.count;0<f&&(e=a.Qn.ja(f-1),a.Qn.hd(f-1))}f=a.Di;if(d){if(b){a.Yx=!1;if(a.isEnabled&&null!==f){b=f;b.Ms=!0;b.name=c;d=a.history;d.La();for(e=d.count-1;e>a.Ii;e--)f=d.ja(e),null!==
f&&f.clear(),d.hd(e),a.Yx=!0;e=a.VD;0===e&&(e=1);0<e&&d.count>=e&&(f=d.ja(0),null!==f&&f.clear(),d.hd(0),a.Ig--);d.add(b);a.Ig++;d.freeze();f=b}a.Rc("CommittedTransaction",c,f)}else{a.fi=!0;try{a.isEnabled&&null!==f&&(f.Ms=!0,f.undo())}finally{a.Rc("RolledBackTransaction",c,f),a.fi=!1}null!==f&&f.clear()}a.bu=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c=f.Ug;for(b=c.count-1;b>=a;b--)d=c.ja(b),null!==d&&d.undo(),c.La(),c.hd(b);c.freeze()}return!1}
ee.prototype.canUndo=ee.prototype.canUndo=function(){if(!this.isEnabled||0<this.Le||this.gb)return!1;var a=this.UE;return null!==a&&a.canUndo()?!0:!1};ee.prototype.undo=ee.prototype.undo=function(){if(this.canUndo()){var a=this.UE;try{this.Rc("StartingUndo","Undo",a),this.fi=!0,this.Ig--,a.undo()}catch(b){u.trace("undo error: "+b.toString())}finally{this.fi=!1,this.Rc("FinishedUndo","Undo",a)}}};
ee.prototype.canRedo=ee.prototype.canRedo=function(){if(!this.isEnabled||0<this.Le||this.gb)return!1;var a=this.TE;return null!==a&&a.canRedo()?!0:!1};ee.prototype.redo=ee.prototype.redo=function(){if(this.canRedo()){var a=this.TE;try{this.Rc("StartingRedo","Redo",a),this.fi=!0,this.Ig++,a.redo()}catch(b){u.trace("redo error: "+b.toString())}finally{this.fi=!1,this.Rc("FinishedRedo","Redo",a)}}};
ee.prototype.Rc=function(a,b,c){void 0===c&&(c=null);var d=new Zd;d.Ad=ae;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.BH;a.next();)b=a.value,d.ga=b,b.Jv(d)};ee.prototype.handleChanged=ee.prototype.ED=function(a){if(this.isEnabled&&!this.gb&&!this.skipsEvent(a)){var b=this.Di;null===b&&(this.bu=b=new Ke);var c=a.copy(),b=b.Ug;b.La();b.add(c);b.freeze();this.Ry&&0>=this.Le&&!this.Kx&&(a=a.g,null!==a&&!1===a.lf||u.trace("Change not within a transaction: "+c.toString()))}};
ee.prototype.skipsEvent=function(a){if(null===a||0>a.Ad.value)return!0;a=a.object;if(a instanceof S){if(a=a.layer,null!==a&&a.Ac)return!0}else if(a instanceof we&&a.Ac)return!0;return!1};u.u(ee,{BH:"models"},function(){return this.hy.i});u.defineProperty(ee,{isEnabled:"isEnabled"},function(){return this.Ne},function(a){this.Ne=a});u.u(ee,{UE:"transactionToUndo"},function(){return 0<=this.Ii&&this.Ii<=this.history.count-1?this.history.ja(this.Ii):null});
u.u(ee,{TE:"transactionToRedo"},function(){return this.Ii<this.history.count-1?this.history.ja(this.Ii+1):null});u.u(ee,{gb:"isUndoingRedoing"},function(){return this.fi});u.u(ee,{history:"history"},function(){return this.tF});u.defineProperty(ee,{VD:"maxHistoryLength"},function(){return this.CB},function(a){this.CB=a});u.u(ee,{Ii:"historyIndex"},function(){return this.Ig});u.u(ee,{Di:"currentTransaction"},function(){return this.bu});u.u(ee,{Le:"transactionLevel"},function(){return this.Jk});
u.u(ee,{ND:"isInTransaction"},function(){return 0<this.Jk});u.defineProperty(ee,{Ry:"checksTransactionLevel"},function(){return this.GA},function(a){this.GA=a});u.u(ee,{bE:"nestedTransactionNames"},function(){return this.Og});function sa(){0<arguments.length&&u.Wc(sa);u.gc(this);this.Y=null;this.JA=!0;this.LA=this.MA=this.XA=this.NA=!1;this.Ak=this.ax=null;this.EC=1.05;this.VA=1;this.Zx=NaN;this.zB=null;this.FC=NaN}u.fa("CommandHandler",sa);var gf=null,hf="";sa.prototype.toString=function(){return"CommandHandler"};
u.u(sa,{g:"diagram"},function(){return this.Y});sa.prototype.Ec=function(a){this.Y=a};
sa.prototype.doKeyDown=function(){var a=this.g;if(null!==a){var b=a.N,c=u.Em?b.Ys:b.control,d=b.shift,e=b.alt,f=b.key;!c||"C"!==f&&"Insert"!==f?c&&"X"===f||d&&"Del"===f?this.canCutSelection()&&this.cutSelection():c&&"V"===f||d&&"Insert"===f?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===f||e&&d&&"Backspace"===f?this.canRedo()&&this.redo():c&&"Z"===f||e&&"Backspace"===f?this.canUndo()&&this.undo():"Del"===f||"Backspace"===f?this.canDeleteSelection()&&this.deleteSelection():c&&"A"===f?this.canSelectAll()&&
this.selectAll():"Esc"===f?this.canStopCommand()&&this.stopCommand():"Up"===f?a.Se&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===f?a.Se&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===f?a.Re&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===f?a.Re&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===f?d&&a.Re?a.scroll("page","left"):a.Se&&a.scroll("page","up"):"PageDown"===f?d&&a.Re?a.scroll("page","right"):a.Se&&a.scroll("page","down"):"Home"===
f?(b=a.Cd,c&&a.Se?a.position=new w(a.position.x,b.y):!c&&a.Re&&(a.position=new w(b.x,a.position.y))):"End"===f?(b=a.Cd,d=a.ob,c&&a.Se?a.position=new w(d.x,b.bottom-d.height):!c&&a.Re&&(a.position=new w(b.right-d.width,d.y))):"Subtract"===f?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===f?this.canIncreaseZoom()&&this.increaseZoom():c&&"0"===f?this.canResetZoom()&&this.resetZoom():d&&"Z"===f?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===f?this.canGroupSelection()&&this.groupSelection():c&&
d&&"G"===f?this.canUngroupSelection()&&this.ungroupSelection():b.event&&113===b.event.which?this.canEditTextBlock()&&this.editTextBlock():b.event&&93===b.event.which?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()}};sa.prototype.doKeyUp=function(){var a=this.g;null!==a&&(a.N.bubbles=!0)};sa.prototype.stopCommand=function(){var a=this.g;if(null!==a){var b=a.Va;b instanceof jf&&a.of&&a.Lv();null!==b&&b.doCancel()}};
sa.prototype.canStopCommand=function(){return!0};sa.prototype.selectAll=function(){var a=this.g;if(null!==a){a.ma();try{a.ac="wait";a.za("ChangingSelection");for(var b=a.Sj;b.next();)b.value.Za=!0;for(var c=a.yg;c.next();)c.value.Za=!0;for(var d=a.links;d.next();)d.value.Za=!0}finally{a.za("ChangedSelection"),a.ac=""}}};sa.prototype.canSelectAll=function(){var a=this.g;return null!==a&&a.of};
sa.prototype.deleteSelection=function(){var a=this.g;if(null!==a&&!a.za("SelectionDeleting",a.selection))try{a.ac="wait";a.Wb("Delete");a.za("ChangingSelection");for(var b=new F(G),c=a.selection.i;c.next();)kf(b,c.value,!0,this.qG?Infinity:0,!0,function(a){return a.canDelete()});a.Wz(b,!0);a.za("SelectionDeleted",b)}finally{a.za("ChangedSelection"),a.Wd("Delete"),a.ac=""}};sa.prototype.canDeleteSelection=function(){var a=this.g;return null===a||a.nb||a.uf||!a.lm||0===a.selection.count?!1:!0};
function kf(a,b,c,d,e,f){void 0===f&&(f=null);if(!(a.contains(b)||null!==f&&!f(b)||b instanceof lf))if(a.add(b),b instanceof U){if(c&&b instanceof V)for(var h=b.Mc;h.next();)kf(a,h.value,c,d,e,f);if(e)for(h=b.oe;h.next();){var k=h.value;if(!a.contains(k)){var l=k.W,m=k.ca;null!==l&&a.contains(l)&&null!==m&&a.contains(m)?kf(a,k,c,d,e,f):null!==l&&null!==m||kf(a,k,c,d,e,f)}}if(1<d)for(b=b.tD();b.next();)kf(a,b.value,c,d-1,e,f)}else if(b instanceof W)for(h=b.ug;h.next();)kf(a,h.value,c,d,e,f)}
sa.prototype.to=function(a,b,c){var d=new la(G,G);for(a=a.i;a.next();)mf(this,a.value,b,d,c);if(null!==b){c=b.ga;a=!1;null!==b.tb.Ed&&(a=b.tb.Ed.Gi);for(var e=new F(W),f=new la(W,W),h=d.i;h.next();){var k=h.value;if(k instanceof W){var l=k;a||null!==l.W&&null!==l.ca||e.add(l)}else if(c instanceof qe&&k instanceof U&&null!==k.data){var l=c,m=k,k=h.key,n=k.zm();null!==n&&(n=d.ta(n),null!==n?(l.ih(m.data,l.wb(n.data)),l=b.ng(m.data),k=k.As(),null!==k&&null!==l&&f.add(k,l)):l.ih(m.data,void 0))}}0<e.count&&
b.Wz(e,!1);if(0<f.count)for(b=f.i;b.next();)d.add(b.key,b.value)}for(b=d.i;b.next();)b.value.Nb();return d};
function mf(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.ta(b);var f=null,h=b.data;if(null!==h&&null!==c){var k=c.ga;b instanceof W?k instanceof Q&&(h=k.eD(h),u.Sa(h)&&(k.xv(h),f=c.ng(h))):(h=k.copyNodeData(h),u.Sa(h)&&(k.km(h),f=c.Nh(h)))}else nf(b),f=b.copy(),null!==c&&null!==f&&c.add(f);if(!(f instanceof G))return null;f.Za=!1;f.Wg=!1;d.add(b,f);if(b instanceof U){for(k=b.oe;k.next();){h=k.value;if(h.W===b){var l=d.ta(h);null!==l&&(l.W=f)}h.ca===b&&(l=d.ta(h),null!==
l&&(l.ca=f))}if(b instanceof V&&f instanceof V)for(k=f,b=b.Mc;b.next();)h=mf(a,b.value,c,d,e),h instanceof W||null===h||(h.Ra=k)}else if(b instanceof W)for(k=b.W,null!==k&&(k=d.ta(k),null!==k&&(f.W=k)),k=b.ca,null!==k&&(k=d.ta(k),null!==k&&(f.ca=k)),b=b.ug;b.next();)k=mf(a,b.value,c,d,e),null!==k&&(k.ce=f);return f}
sa.prototype.copySelection=function(){var a=this.g;if(null!==a){for(var b=new F(G),a=a.selection.i;a.next();)kf(b,a.value,!0,this.hG?Infinity:0,this.fG,function(a){return a.canCopy()});this.copyToClipboard(b)}};sa.prototype.canCopySelection=function(){var a=this.g;return null!==a&&a.Ij&&a.My&&0!==a.selection.count?!0:!1};sa.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
sa.prototype.canCutSelection=function(){var a=this.g;return null!==a&&!a.nb&&!a.uf&&a.Ij&&a.lm&&a.My&&0!==a.selection.count?!0:!1};sa.prototype.copyToClipboard=function(a){var b=this.g;if(null!==b){var c=null;if(null===a)gf=null,hf="";else{var c=b.ga,d=!1,e=!1,f=null;try{if(c instanceof qe){var h=c,d=h.um;h.um=this.dD}c instanceof Q&&(h=c,e=h.tm,h.tm=this.cD);f=b.to(a,null,!0)}finally{c instanceof qe&&(c.um=d),c instanceof Q&&(c.tm=e),c=new E(G),c.Td(f),gf=c,hf=b.ga.Sk}}b.za("ClipboardChanged",c)}};
sa.prototype.pasteFromClipboard=function(){var a=new F(G),b=gf;if(null===b)return a;var c=this.g;if(null===c||hf!==c.ga.Sk)return a;var d=c.ga,e=!1,f=!1,h=null;try{if(d instanceof qe){var k=d,e=k.um;k.um=this.dD}d instanceof Q&&(k=d,f=k.tm,k.tm=this.cD);h=c.to(b,c,!1)}finally{for(d instanceof qe&&(d.um=e),d instanceof Q&&(d.tm=f),b=h.i;b.next();)c=b.value,d=b.key,c.location.J()||(d.location.J()?c.location=d.location:!c.position.J()&&d.position.J()&&(c.position=d.position)),a.add(c)}return a};
sa.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.ac="wait";b.Wb("Paste");b.za("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&of(b);for(var d=c.i;d.next();)d.value.Za=!0;b.za("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e){var f=b.tb.Ed;null===f&&(f=new uf,f.Ec(b));var h=f.computeEffectiveCollection(b.selection);f.moveParts(h,new w(a.x-e.Ja,a.y-e.Ua),!1)}}b.za("ClipboardPasted",c)}finally{b.Wd("Paste"),b.ac=
""}};sa.prototype.canPasteSelection=function(){var a=this.g;return null===a||a.nb||a.uf||!a.lo||!a.My||null===gf||hf!==a.ga.Sk?!1:!0};sa.prototype.undo=function(){var a=this.g;null!==a&&a.ha.undo()};sa.prototype.canUndo=function(){var a=this.g;return null===a||a.nb||a.uf?!1:a.NC&&a.ha.canUndo()};sa.prototype.redo=function(){var a=this.g;null!==a&&a.ha.redo()};sa.prototype.canRedo=function(){var a=this.g;return null===a||a.nb||a.uf?!1:a.NC&&a.ha.canRedo()};
sa.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.Ow);u.ze(a,sa,"decreaseZoom:factor");var b=this.g;null!==b&&b.no===vf&&(a*=b.scale,a<b.Yg||a>b.Xg||(b.scale=a))};sa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.Ow);u.ze(a,sa,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.no!==vf)return!1;a*=b.scale;return a<b.Yg||a>b.Xg?!1:b.Gv};
sa.prototype.increaseZoom=function(a){void 0===a&&(a=this.Ow);u.ze(a,sa,"increaseZoom:factor");var b=this.g;null!==b&&b.no===vf&&(a*=b.scale,a<b.Yg||a>b.Xg||(b.scale=a))};sa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.Ow);u.ze(a,sa,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.no!==vf)return!1;a*=b.scale;return a<b.Yg||a>b.Xg?!1:b.Gv};sa.prototype.resetZoom=function(a){void 0===a&&(a=this.Pv);u.ze(a,sa,"resetZoom:newscale");var b=this.g;null===b||a<b.Yg||a>b.Xg||(b.scale=a)};
sa.prototype.canResetZoom=function(a){void 0===a&&(a=this.Pv);u.ze(a,sa,"canResetZoom:newscale");var b=this.g;return null===b||a<b.Yg||a>b.Xg?!1:b.Gv};sa.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b!==this.FC||isNaN(this.Zx)?(this.Zx=b,this.zB=c.copy(),a.zoomToFit(),a.bf(),this.FC=a.scale):(a.scale=this.Zx,a.position=this.zB)}};sa.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Gv};
sa.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return!1;try{b.Wb("Collapse Tree");var c=new E(U);if(null!==a&&a.Vc)a.collapseTree(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof U&&(a=e,a.Vc&&(a.collapseTree(),c.add(a)))}b.za("TreeCollapsed",c)}finally{b.Wd("Collapse Tree")}};
sa.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.nb)return!1;if(null!==a){if(!a.Vc)return!1;if(0<a.Yv().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof U&&b.Vc&&0<b.Yv().count)return!0;return!1};
sa.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return!1;try{b.Wb("Expand Tree");var c=new E(U);if(null===a||a.Vc)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof U&&(a=e,a.Vc||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.za("TreeExpanded",c)}finally{b.Wd("Expand Tree")}};
sa.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.nb)return!1;if(null!==a){if(a.Vc)return!1;if(0<a.Yv().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof U&&!b.Vc&&0<b.Yv().count)return!0;return!1};
sa.prototype.groupSelection=function(){var a=this.g;if(null!==a){var b=a.ga;if(b instanceof Q){var c=this.OC;if(null!==c){var d=null;try{a.ac="wait";a.Wb("Group");a.za("ChangingSelection");for(var e=new E(G),f=a.selection.i;f.next();){var h=f.value;h.Fd()&&h.canGroup()&&e.add(h)}for(var k=new E(G),l=e.i;l.next();){for(var m=l.value,f=!1,n=e.i;n.next();)if(m.Ph(n.value)){f=!0;break}f||k.add(m)}if(0<k.count){var p=k.first().Ra;if(null!==p)for(;null!==p;){for(var e=!1,q=k.i;q.next();)if(!q.value.Ph(p)){e=
!0;break}if(e)p=p.Ra;else break}if(c instanceof V)nf(c),d=c.copy(),null!==d&&a.add(d);else if(b.sz(c)){var r=b.copyNodeData(c);u.Sa(r)&&(b.km(r),d=a.Xv(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.Ra=p);for(var s=k.i;s.next();){var t=s.value;this.isValidMember(d,t)&&(t.Ra=d)}a.select(d)}}a.za("ChangedSelection");a.za("SelectionGrouped",d)}finally{a.Wd("Group"),a.ac=""}}}}};
sa.prototype.canGroupSelection=function(){var a=this.g;if(null===a||a.nb||a.uf||!a.lo||!a.Bv||!(a.ga instanceof Q)||null===this.OC)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.Fd()&&b.canGroup())return!0}return!1};function wf(a){var b=u.eb();for(a=a.i;a.next();){var c=a.value;c instanceof W||b.push(c)}a=new F(G);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],f=!0,h=0;h<c;h++)if(e.Ph(b[h])){f=!1;break}f&&a.add(e)}u.ra(b);return a}
sa.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof W)return!1;if(null!==a){if(a===b||a.Ph(b))return!1;var c=a.Bz;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.Bz;return null!==c?c(a,b):!0};
sa.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b){var c=b.ga;if(c instanceof Q)try{b.ac="wait";b.Wb("Ungroup");b.za("ChangingSelection");var d=new E(V);if(null!==a)d.add(a);else for(var e=b.selection.i;e.next();){var f=e.value;f instanceof V&&(a=f,a.canUngroup()&&d.add(a))}if(0<d.count){b.Lv();for(var h=d.i;h.next();){var k=h.value;k.expandSubGraph();var l=k.Ra,m=null!==l&&null!==l.data?c.wb(l.data):void 0,n=new E(G);n.Td(k.Mc);for(var p=n.i;p.next();){var q=
p.value;q.Za=!0;if(!(q instanceof W)){var r=q.data;null!==r?c.Fw(r,m):q.Ra=l}}b.remove(k)}}b.za("ChangedSelection");b.za("SelectionUngrouped",d,n)}finally{b.Wd("Ungroup"),b.ac=""}}};sa.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.nb||b.uf||!b.lm||!b.Fv||!(b.ga instanceof Q))return!1;if(null!==a){if(a.canUngroup())return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&b.canUngroup())return!0;return!1};
sa.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=wf(a).i;d.next();){var e=d.value;null!==e.Ra&&(!b||this.isValidMember(null,e)?e.Ra=null:c=!1)}return c};sa.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return!1;try{b.Wb("Collapse SubGraph");var c=new E(V);if(null!==a&&a.be)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof V&&(a=e,a.be&&(a.collapseSubGraph(),c.add(a)))}b.za("SubGraphCollapsed",c)}finally{b.Wd("Collapse SubGraph")}};
sa.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.nb)return!1;if(null!==a)return a.be?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&b.be)return!0;return!1};
sa.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return!1;try{b.Wb("Expand SubGraph");var c=new E(V);if(null===a||a.be)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof V&&(a=e,a.be||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.za("SubGraphExpanded",c)}finally{b.Wd("Expand SubGraph")}};
sa.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.nb)return!1;if(null!==a)return a.be?!1:!0;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&!b.be)return!0;return!1};
sa.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&u.C(a,qa,sa,"editTextBlock");var b=this.g;if(null!==b){var c=b.tb.iA;if(null!==c){if(null===a){a=null;for(var d=b.selection.i;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.vs(function(a){return a instanceof qa&&a.bz})}null!==a&&(b.Va=null,c.kh=a,b.Va=c)}}};
sa.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);null!==a&&u.C(a,qa,sa,"canEditTextBlock");var b=this.g;if(null===b||b.nb||b.uf||!b.Ev||null===b.tb.iA)return!1;if(null!==a){if(a=a.T,null!==a&&a.canEdit())return!0}else for(b=b.selection.i;b.next();)if(a=b.value,a.canEdit()&&(a=a.vs(function(a){return a instanceof qa&&a.bz}),null!==a))return!0;return!1};
sa.prototype.showContextMenu=function(a){var b=this.g;if(null!==b){var c=b.tb.Vy;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new Md,e=null;a instanceof S?e=a.lb(Ib):b.fH||(e=b.ob,e=new w(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.ff=b.VE(e),d.da=e,b.N=d);b.Va=c;xf(c,!1,a)}}};
sa.prototype.canShowContextMenu=function(a){var b=this.g;if(null===b)return!1;var c=b.tb.Vy;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};u.defineProperty(sa,{fG:"copiesConnectedLinks"},function(){return this.JA},function(a){u.j(a,"boolean",sa,"copiesConnectedLinks");this.JA=a});u.defineProperty(sa,{hG:"copiesTree"},function(){return this.NA},function(a){u.j(a,"boolean",sa,"copiesTree");this.NA=a});
u.defineProperty(sa,{qG:"deletesTree"},function(){return this.XA},function(a){u.j(a,"boolean",sa,"deletesTree");this.XA=a});u.defineProperty(sa,{dD:"copiesParentKey"},function(){return this.MA},function(a){u.j(a,"boolean",sa,"copiesParentKey");this.MA=a});u.defineProperty(sa,{cD:"copiesGroupKey"},function(){return this.LA},function(a){u.j(a,"boolean",sa,"copiesGroupKey");this.LA=a});
u.defineProperty(sa,{OC:"archetypeGroupData"},function(){return this.ax},function(a){null!==a&&u.C(a,Object,sa,"archetypeGroupData");var b=this.g;null!==b&&(b=b.ga,b instanceof Q&&(a instanceof V||b.sz(a)||u.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.ax=a});u.defineProperty(sa,{Bz:"memberValidation"},function(){return this.Ak},function(a){null!==a&&u.j(a,"function",sa,"memberValidation");this.Ak=a});
u.defineProperty(sa,{Pv:"defaultScale"},function(){return this.VA},function(a){u.ze(a,sa,"defaultScale");0<a||u.k("defaultScale must be larger than zero, not: "+a);this.VA=a});u.defineProperty(sa,{Ow:"zoomFactor"},function(){return this.EC},function(a){u.ze(a,sa,"zoomFactor");1<a||u.k("zoomFactor must be larger than 1.0, not: "+a);this.EC=a});function xe(){0<arguments.length&&u.Wc(xe);u.gc(this);this.Y=null;this.Ub="";this.Ne=!0;this.lB=!1;this.AC=null;this.vv=-1}u.fa("Tool",xe);
xe.prototype.Ec=function(a){this.Y=a};xe.prototype.toString=function(){return""!==this.name?this.name+" Tool":u.rg(Object.getPrototypeOf(this))};xe.prototype.updateAdornments=function(){};xe.prototype.canStart=function(){return this.isEnabled};xe.prototype.doStart=function(){};xe.prototype.doActivate=function(){this.na=!0};xe.prototype.doDeactivate=function(){this.na=!1};xe.prototype.doStop=function(){};xe.prototype.doCancel=function(){this.stopTool()};
xe.prototype.stopTool=function(){var a=this.g;null!==a&&a.Va===this&&(a.Va=null,a.ac="")};xe.prototype.doMouseDown=function(){!this.na&&this.canStart()&&this.doActivate()};xe.prototype.doMouseMove=function(){};xe.prototype.doMouseUp=function(){this.stopTool()};xe.prototype.doMouseWheel=function(){};xe.prototype.canStartMultiTouch=function(){return!0};
xe.prototype.standardPinchZoomStart=function(){var a=this.g;if(null!==a){var b=a.N.event,c=null,d=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;c=b.targetTouches[0];d=b.targetTouches[1]}else if(null!==a.Df[0])c=a.Df[0],d=a.Df[1];else return;this.doCancel();if(a.yn){a.Lx=!0;a.MB=a.scale;var e=a.Ab,f=a.zb,h=a.ib.getBoundingClientRect(),k=c.clientX-e/h.width*h.left,l=c.clientY-f/h.height*h.top,c=d,d=c.clientX-e/h.width*h.left-k,f=c.clientY-f/h.height*h.top-l,f=Math.sqrt(d*d+f*
f);a.iC=f;b.preventDefault();b.cancelBubble=!0}else yf(a)}};
xe.prototype.standardPinchZoomMove=function(){var a=this.g;if(null!==a){var b=a.N.event;this.doCancel();yf(a);var c=null,d=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;c=b.targetTouches[0];d=b.targetTouches[1]}else if(null!==a.Df[0])c=a.Df[0],d=a.Df[1];else return;if(a.yn&&a.Lx){var e=a.Ab,f=a.zb,h=a.ib.getBoundingClientRect(),k=c,c=k.clientX-e/h.width*h.left,l=k.clientY-f/h.height*h.top,k=d,d=k.clientX-e/h.width*h.left,f=k.clientY-f/h.height*h.top,h=d-c,e=f-l,h=Math.sqrt(h*
h+e*e)/a.iC,c=new w((Math.min(d,c)+Math.max(d,c))/2,(Math.min(f,l)+Math.max(f,l))/2),l=a.MB*h,d=a.Eb;l!==a.scale&&d.canResetZoom(l)&&(f=a.Rm,a.Rm=c,d.resetZoom(l),a.Rm=f);b.preventDefault();b.cancelBubble=!0}}};xe.prototype.doKeyDown=function(){var a=this.g;null!==a&&"Esc"===a.N.key&&this.doCancel()};xe.prototype.doKeyUp=function(){};xe.prototype.startTransaction=xe.prototype.Wb=function(a){void 0===a&&(a=this.name);this.zf=null;var b=this.g;return null===b?!1:b.Wb(a)};
xe.prototype.stopTransaction=xe.prototype.Uj=function(){var a=this.g;return null===a?!1:null===this.zf?a.ap():a.Wd(this.zf)};
xe.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.of){var b=a.N,c=a.zs(b.da,!1);if(null!==c)if(u.Em?b.Ys:b.control){a.za("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Ra;null!==b&&(b.Za=!b.Za);a.za("ChangedSelection")}else if(b.shift){if(!c.Za){a.za("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Ra;null!==b&&(b.Za=!0);a.za("ChangedSelection")}}else{if(!c.Za){for(b=c;null!==b&&!b.canSelect();)b=b.Ra;null!==b&&a.select(b)}}else!b.left||(u.Em?b.Ys:b.control)||
b.shift||a.Lv()}};xe.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Ac});var c=this.g;if(null!==c){var d=c.N,e=c.ke(d.da,a,b);d.pe=e;zf(e,d,c)}};
function zf(a,b,c){var d=0;b.left?d=1===b.Te?1:2===b.Te?2:1:b.right&&1===b.Te&&(d=3);var e="";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.za(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.za(e)}if(null!==a)for(b.Tc=!1;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.ts?a.ts:a.click;break;case 3:c=
a.Uy}if(null!==c&&(c(b,a),b.Tc))break;a=a.S}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.ts?c.ts:c.click;break;case 3:a=c.Uy}null!==a&&a(b)}}
xe.prototype.standardMouseOver=function(){var a=this.g;if(null!==a){var b=a.N;if(null!==b.g&&!0!==a.Lb.ld){var c=a.cb;a.cb=!0;var d=a.ke(b.da,null,null);b.pe=d;var e=!1;if(d!==a.en){var f=a.en,h=f;a.en=d;this.doCurrentObjectChanged(f,d);for(b.Tc=!1;null!==f;){var k=f.$D;if(null!==k){if(d===f)break;if(null!==d&&d.gl(f))break;k(b,f,d);e=!0;if(b.Tc)break}f=f.S}f=h;for(b.Tc=!1;null!==d;){k=d.ZD;if(null!==k){if(f===d)break;if(null!==f&&f.gl(d))break;k(b,d,f);e=!0;if(b.Tc)break}d=d.S}d=a.en}if(null!==d){f=
d;for(k="";null!==f;){k=f.cursor;if(""!==k)break;f=f.S}a.ac=k;b.Tc=!1;for(f=d;null!==f;){k=f.Fz;if(null!==k&&(k(b,f),e=!0,b.Tc))break;f=f.S}}else a.ac="",k=a.Fz,null!==k&&(k(b),e=!0);e&&a.de();a.cb=c}}};xe.prototype.doCurrentObjectChanged=function(){};
xe.prototype.standardMouseWheel=function(){var a=this.g;if(null!==a){var b=a.N,c=b.Uk;if(0!==c&&a.Cd.J()){var d=a.Eb,e=a.tb.$s;if((e===Af&&!b.shift||e===Bf&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.Rm,a.Rm=b.ff,0<c?d.increaseZoom():d.decreaseZoom(),a.Rm=e,b.bubbles=!1;else if(e===Af&&b.shift||e===Bf&&!b.control){d=a.position.copy();e=0<c?c:-c;if(!b.shift&&a.Se){var f=a.mt,e=e/40*f;0<c?a.scroll("pixel","up",e):a.scroll("pixel","down",e)}else b.shift&&a.Re&&(f=a.lt,e=e/40*f,0<c?
a.scroll("pixel","left",e):a.scroll("pixel","right",e));a.position.L(d)||(b.bubbles=!1)}}}};xe.prototype.standardWaitAfter=function(a){u.j(a,"number",xe,"standardWaitAfter:delay");this.cancelWaitAfter();var b=this;this.vv=u.setTimeout(function(){b.doWaitAfter()},a)};xe.prototype.cancelWaitAfter=function(){-1!==this.vv&&u.clearTimeout(this.vv);this.vv=-1};xe.prototype.doWaitAfter=function(){};
xe.prototype.findToolHandleAt=function(a,b){var c=this.g;if(null===c)return null;c=c.ke(a,null,function(a){a=a.T;return null===a?!1:null!==a.vc});if(null===c)return null;var d=c.T;return null===d||d.Kc!==b?null:c};xe.prototype.isBeyondDragSize=function(a,b){var c=this.g;if(null===c)return!1;void 0===a&&(a=c.wc.ff);void 0===b&&(b=c.N.ff);var d=c.tb.vG,e=d.width,d=d.height;c.wc.jl&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};u.u(xe,{g:"diagram"},function(){return this.Y});
u.defineProperty(xe,{name:"name"},function(){return this.Ub},function(a){u.j(a,"string",xe,"name");this.Ub=a});u.defineProperty(xe,{isEnabled:"isEnabled"},function(){return this.Ne},function(a){u.j(a,"boolean",xe,"isEnabled");this.Ne=a});u.defineProperty(xe,{na:"isActive"},function(){return this.lB},function(a){u.j(a,"boolean",xe,"isActive");this.lB=a});u.defineProperty(xe,{zf:"transactionResult"},function(){return this.AC},function(a){null!==a&&u.j(a,"string",xe,"transactionResult");this.AC=a});
function uf(){0<arguments.length&&u.Wc(uf);xe.call(this);this.name="Dragging";this.KA=this.pB=!0;this.iq=this.cB=!1;this.tB=!0;this.Mx=(new ia(NaN,NaN)).freeze();this.Nx=xb;this.Ox=(new w(NaN,NaN)).freeze();this.bB=!1;this.$A=this.IA=this.aB=this.QA=this.pi=null;this.Rp=this.rB=!1;this.bo=new w(NaN,NaN);this.gv=new w;this.jv=!1;this.ev=this.oB=!0;this.pn=100;this.Yi=[];this.sF=(new F(G)).freeze()}u.Ga(uf,xe);u.fa("DraggingTool",uf);
u.defineProperty(uf,{MD:"isCopyEnabled"},function(){return this.pB},function(a){u.j(a,"boolean",uf,"isCopyEnabled");this.pB=a});u.defineProperty(uf,{gG:"copiesEffectiveCollection"},function(){return this.KA},function(a){u.j(a,"boolean",uf,"copiesEffectiveCollection");this.KA=a});u.defineProperty(uf,{wG:"dragsTree"},function(){return this.cB},function(a){u.j(a,"boolean",uf,"dragsTree");this.cB=a});
u.defineProperty(uf,{gw:"isGridSnapEnabled"},function(){return this.iq},function(a){u.j(a,"boolean",uf,"isGridSnapEnabled");this.iq=a});u.defineProperty(uf,{YG:"isComplexRoutingRealtime"},function(){return this.oB},function(a){u.j(a,"boolean",uf,"isComplexRoutingRealtime");this.oB=a});u.defineProperty(uf,{$G:"isGridSnapRealtime"},function(){return this.tB},function(a){u.j(a,"boolean",uf,"isGridSnapRealtime");this.tB=a});
u.defineProperty(uf,{DD:"gridSnapCellSize"},function(){return this.Mx},function(a){u.C(a,ia,uf,"gridSnapCellSize");this.Mx.L(a)||(this.Mx=a=a.Z())});u.defineProperty(uf,{JG:"gridSnapCellSpot"},function(){return this.Nx},function(a){u.C(a,L,uf,"gridSnapCellSpot");this.Nx.L(a)||(this.Nx=a=a.Z())});u.defineProperty(uf,{KG:"gridSnapOrigin"},function(){return this.Ox},function(a){u.C(a,w,uf,"gridSnapOrigin");this.Ox.L(a)||(this.Ox=a=a.Z())});
u.defineProperty(uf,{Gi:"dragsLink"},function(){return this.bB},function(a){u.j(a,"boolean",uf,"dragsLink");this.bB=a});u.defineProperty(uf,{rs:"currentPart"},function(){return this.QA},function(a){null!==a&&u.C(a,G,uf,"currentPart");this.QA=a});u.defineProperty(uf,{oc:"copiedParts"},function(){return this.IA},function(a){this.IA=a});u.defineProperty(uf,{cc:"draggedParts"},function(){return this.aB},function(a){this.aB=a});
u.u(uf,{uJ:"draggingParts"},function(){return null!==this.oc?this.oc.Ni():null!==this.cc?this.cc.Ni():this.sF});u.defineProperty(uf,{Sc:"draggedLink"},function(){return this.$A},function(a){null!==a&&u.C(a,W,uf,"draggedLink");this.$A=a});u.defineProperty(uf,{fw:"isDragOutStarted"},function(){return this.rB},function(a){this.rB=a});u.defineProperty(uf,{Tj:"startPoint"},function(){return this.gv},function(a){u.C(a,w,uf,"startPoint");this.gv.L(a)||(this.gv=a=a.Z())});
u.defineProperty(uf,{iD:"delay"},function(){return this.pn},function(a){u.j(a,"number",uf,"delay");this.pn=a});uf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.Nk&&!a.Ij&&!a.Av||!a.of)return!1;var b=a.N;return!b.left||a.Va!==this&&(!this.isBeyondDragSize()||b.jl&&b.timestamp-a.wc.timestamp<this.pn)?!1:null!==this.findDraggablePart()};
uf.prototype.findDraggablePart=function(){var a=this.g;if(null===a)return null;a=a.zs(a.wc.da,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.Ra;return null!==a&&(a.canMove()||a.canCopy())?a:null};uf.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.of){var b=a.zs(a.wc.da,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.Ra;this.rs=b;this.rs.Za||(a.za("ChangingSelection"),b=a.N,(u.Em?b.Ys:b.control)||b.shift||of(a),this.rs.Za=!0,a.za("ChangedSelection"))}}};
uf.prototype.doActivate=function(){var a=this.g;if(null!==a){this.standardMouseSelect();var b=this.rs;null!==b&&(b.canMove()||b.canCopy())&&(this.na=!0,this.bo.set(a.position),Cf(this,a.selection),this.Yi.length=0,this.cc=this.computeEffectiveCollection(a.selection),a.tt=!0,Df(this,this.cc),this.Wb("Drag"),this.Tj=a.wc.da,a.Ge=!0,a.Av&&(this.fw=!0,this.Rp=!1,Ef=this,Ff=this.g,this.doSimulatedDragOut()))}};
function Cf(a,b){if(a.Gi){var c=a.g;null!==c&&c.mm&&(c.ga instanceof Q&&1===b.count&&b.first()instanceof W?(a.Sc=b.first(),a.Sc.canRelinkFrom()&&a.Sc.canRelinkTo()&&a.Sc.ls(),a.pi=c.tb.iE,null===a.pi&&(a.pi=new Gf,a.pi.Ec(c))):(a.Sc=null,a.pi=null))}}
uf.prototype.computeEffectiveCollection=function(a){var b=null!==this.g&&this.g.Va===this,c=new la(G);if(null===a)return c;for(var d=a.i;d.next();)Hf(this,c,d.value,b);if(null!==this.Sc&&this.Gi)return c;for(d=a.i;d.next();)a=d.value,a instanceof W&&(b=a.W,null===b||c.contains(b)?(b=a.ca,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function If(a){return void 0===a?new Jf(K.Wj):new Jf(a.copy())}
function Hf(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof U){b.add(c,If(c.location));if(c instanceof V)for(var e=c.Mc;e.next();)Hf(a,b,e.value,d);for(e=c.oe;e.next();){var f=e.value;if(!b.contains(f)){var h=f.W,k=f.ca;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&Hf(a,b,f,d)}}if(a.wG)for(c=c.tD();c.next();)Hf(a,b,c.value,d)}else if(c instanceof W)for(f=c,b.add(f,If()),e=f.ug;e.next();)Hf(a,b,e.value,d);else c instanceof lf||b.add(c,If(c.location))}
uf.prototype.doDeactivate=function(){this.na=!1;var a=this.g;null!==a&&Kf(a);Zf(this);$f(this,this.cc);this.cc=null;this.Rp=this.fw=!1;if(0<ag.count){for(var b=ag.length,c=0;c<b;c++){var d=ag.ja(c);bg(d);cg(d);Zf(d);null!==d.g&&Kf(d.g)}ag.clear()}bg(this);this.bo.m(NaN,NaN);Ef=Ff=null;cg(this);a.Ge=!1;a.ac="";a.tt=!1;this.Uj()};function Zf(a){var b=a.g;if(null!==b){var c=b.cb;b.cb=!0;dg(a,b.N,null);b.cb=c}a.Yi.length=0}
function eg(){var a=Ef;cg(a);fg(a);var b=a.g;null!==b&&a.bo.J()&&(b.position=a.bo);null!==b&&Kf(b)}uf.prototype.doCancel=function(){cg(this);fg(this);var a=this.g;null!==a&&this.bo.J()&&(a.position=this.bo);this.stopTool()};function Df(a,b){if(null!==b){a.jv=!0;for(var c=b.i;c.next();){var d=c.key;d instanceof W&&(d.ip=!0)}}}function $f(a,b){if(null!==b){for(var c=b.i;c.next();){var d=c.key;d instanceof W&&(d.ip=!1,d.el&&gg(d)&&d.Vb())}a.jv=!1}}
uf.prototype.doKeyDown=function(){var a=this.g;null!==a&&(a=a.N,null!==a&&this.na&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};uf.prototype.doKeyUp=function(){var a=this.g;null!==a&&null!==a.N&&this.na&&this.doMouseMove()};function hg(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,h=a.i;h.next();){var k=h.value;if(k.Fd()&&k.Ea()){var l=k.location,k=l.x,l=l.y;isNaN(k)||isNaN(l)||(k<c&&(c=k),l<d&&(d=l),k>e&&(e=k),l>f&&(f=l))}}Infinity===c?b.m(0,0,0,0):b.m(c,d,e-c,f-d)}
function ig(a,b){if(null===a.oc){var c=a.g;if(!(null===c||b&&(c.nb||c.uf))&&null!==a.cc){var d=c.ha;d.isEnabled&&d.ND?null!==d.Di&&0<d.Di.Ug.count&&(c.ha.ap(),c.Wb("Drag")):fg(a);c.cb=!b;c.Vm=!b;a.Tj=c.wc.da;d=a.gG?a.cc.Ni():c.selection;d=c.to(d,c,!0);for(c=d.i;c.next();)c.value.location=c.key.location;c=u.Sf();hg(d,c);u.ic(c);for(var c=new la(G),e=a.cc.i;e.next();){var f=e.key;f.Fd()&&f.canCopy()&&(f=d.ta(f),null!==f&&(f.pf(),c.add(f,If(f.location))))}for(d=d.i;d.next();)e=d.value,e instanceof W&&
e.canCopy()&&c.add(e,If());a.oc=c;Cf(a,c.Ni());null!==a.Sc&&(c=a.Sc,d=c.Mm,c.ll(a.Tj.x-(d.x+d.width/2),a.Tj.y-(d.y+d.height/2)))}}}function cg(a){var b=a.g;if(null!==b){if(null!==a.oc&&(b.Wz(a.oc.Ni(),!1),a.oc=null,null!==a.cc))for(var c=a.cc.i;c.next();)c.key instanceof W&&(c.value.point=new w(0,0));b.cb=!1;b.Vm=!1;a.Tj=b.wc.da}}function bg(a){if(null!==a.Sc){if(a.Gi&&null!==a.pi){var b=a.pi;b.g.remove(b.qe);b.g.remove(b.re)}a.Sc=null;a.pi=null}}
function jg(a,b,c){var d=a.g;if(null!==d){var e=a.Tj,f=u.K();f.assign(d.N.da);a.moveParts(b,f.vt(e),c);u.v(f)}}
uf.prototype.moveParts=function(a,b,c){if(null!==a&&(u.C(a,la,uf,"moveParts:parts"),0!==a.count)){var d=u.K(),e=u.K();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);var f=this.jv;f||Df(this,a);for(var h=new E(kg),k=new E(Pa),l=a.i;l.next();){var m=l.key;if(m.Fd()){var n=lg(this,m,a);if(null!==n)h.add(new kg(m,l.value,n));else if(!c||m.canMove()){n=l.value.point;d.assign(n);var p=u.K(),q=this.computeMove(m,d.add(e),a,p);m.location=q;u.v(p);l.value.IE=p.vt(n)}}else l.key instanceof W&&k.add(l.Cb)}for(c=
h.i;c.next();)h=c.value,n=h.info.point,d.assign(n),h.Cc.location=d.add(h.LG.IE);n=u.K();c=u.K();for(k=k.i;k.next();)if(p=k.value,h=p.key,h instanceof W)if(h.ip)l=h.W,m=h.ca,null!==this.Sc&&this.Gi?(p=p.value.point,a.add(h,If(e)),l=b.x-p.x,m=b.y-p.y,h.ll(l,m)):(null!==l&&(n.assign(l.location),q=a.ta(l),null!==q&&n.vt(q.point)),null!==m&&(c.assign(m.location),q=a.ta(m),null!==q&&c.vt(q.point)),null!==l&&null!==m?n.De(c)?(p=p.value.point,l=d,l.assign(n),l.vt(p),a.add(h,If(n)),h.ll(l.x,l.y)):(h.ip=!1,
h.Vb()):(p=p.value.point,a.add(h,If(null!==l?n:null!==m?c:b)),l=e.x-p.x,m=e.y-p.y,h.ll(l,m)));else if(null===h.W||null===h.ca)p=p.value.point,a.add(h,If(b)),l=e.x-p.x,m=e.y-p.y,h.ll(l,m);u.v(d);u.v(e);u.v(n);u.v(c);f||$f(this,a)}};function lg(a,b,c){b=b.Ra;if(null!==b){a=lg(a,b,c);if(null!==a)return a;a=c.ta(b);if(null!==a)return a}return null}
function fg(a){if(null!==a.cc){for(var b=a.g,c=a.cc.i;c.next();){var d=c.key;d.Fd()&&(d.location=c.value.point)}for(c=a.cc.i;c.next();)if(d=c.key,d instanceof W&&d.ip){var e=c.value.point;a.cc.add(d,If());d.ll(-e.x,-e.y)}b.bf()}}
uf.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new w);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.gw&&(this.$G||null===c||this.g.N.up)&&(e=u.K(),c=e,c.assign(b),null!==a)){var f=this.g;if(null!==f){var h=f.Gs,k=this.DD,f=k.width,k=k.height,l=this.KG,m=l.x,l=l.y,n=this.JG;if(null!==h){var p=h.aw;isNaN(f)&&(f=p.width);isNaN(k)&&(k=p.height);h=h.CD;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=u.fc(0,0);h.rt(0,0,f,k,n);K.xs(b.x,b.y,m+h.x,l+h.y,f,k,c);u.v(h)}}c=null!==a.mD?
a.mD(a,b,e):e;k=a.AH;f=k.x;isNaN(f)&&(f=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.vH;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.m(Math.max(f,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&u.v(e);return d};function mg(a,b){if(null===b)return!0;var c=b.T;return null===c||c instanceof lf||c.layer.Ac||a.cc&&a.cc.contains(c)||a.oc&&a.oc.contains(c)?!0:!1}
function ng(a,b,c,d){var e=a.g;if(null!==e){a.Gi&&(null!==a.Sc&&(a.Sc.W=null,a.Sc.ca=null),vg(a,!1));var f=!1;!1===a.ev&&(f=e.cb,e.cb=!0);var h=wg(e,b,null,function(b){return!mg(a,b)}),k=e.N;k.pe=h;var l=e.cb;e.cb=!0;var m=dg(a,k,h);if(a.na||null!==Ef){if(null===h){var n=e.EH;null!==n&&(n(k),m=!0)}if(a.na||null!==Ef)if(a.doDragOver(b,h),a.na||null!==Ef)e.cb=l,m&&e.bf(),!1===a.ev&&(e.cb=f),(e.Re||e.Se)&&(c||d)&&xg(e,k.ff)}}}
function dg(a,b,c){var d=!1,e=a.Yi.length,f=0<e?a.Yi[0]:null;if(c===f)return!1;b.Tc=!1;for(var h=0;h<e;h++){var k=a.Yi[h],l=k.DH;if(null!==l&&(l(b,k,c),d=!0,b.Tc))break}a.Yi.length=0;if(!a.na&&null===Ef||null===c)return d;for(b.Tc=!1;null!==c;)a.Yi.push(c),c=yg(c);e=a.Yi.length;for(h=0;h<e&&(k=a.Yi[h],l=k.CH,null===l||(l(b,k,f),d=!0,!b.Tc));h++);return d}function yg(a){var b=a.S;return null!==b?b:a instanceof G&&!(a instanceof V)&&(a=a.Ra,null!==a&&a.OG)?a:null}
function zg(a,b,c){var d=a.pi;if(null===d)return null;var e=a.g.ym(b,d.fE,function(a){return d.findValidLinkablePort(a,c)});a=u.K();for(var f=Infinity,h=null,e=e.i;e.next();){var k=e.value;if(null!==k.T){var l=k.lb(Ib,a),l=b.Lj(l);l<f&&(h=k,f=l)}}u.v(a);return h}
function vg(a,b){var c=a.Sc;if(null!==c&&!(2>c.ka)){var d=a.g;if(null!==d&&!d.nb&&(d=a.pi,null!==d)){var e=null,f=null;null===c.W&&(e=zg(a,c.l(0),!1),null!==e&&(f=e.T));var h=null,k=null;null===c.ca&&(h=zg(a,c.l(c.ka-1),!0),null!==h&&(k=h.T));d.isValidLink(f,e,k,h)?b?(c.jn=c.l(0).copy(),c.nn=c.l(c.ka-1).copy(),c.ip=!1,c.W=f,null!==e&&(c.pg=e.Jd),c.ca=k,null!==h&&(c.lh=h.Jd)):Ag(d,f,e,k,h):Ag(d,null,null,null,null)}}}uf.prototype.doDragOver=function(){};
function Bg(a,b){var c=a.g;if(null!==c){a.Gi&&vg(a,!0);Zf(a);var d=wg(c,b,null,function(b){return!mg(a,b)}),e=c.N;e.pe=d;if(null!==d){e.Tc=!1;for(var f=d;null!==f;){var h=f.Cz;if(null!==h&&(h(e,f),e.Tc))break;f=yg(f)}}else h=c.Cz,null!==h&&h(e);if(a.na||null!==Ef)if(a.doDropOnto(b,d),a.na||null!==Ef)for(d=c.selection.i;d.next();)e=d.value,e instanceof U&&Cg(c,e.ba)}}uf.prototype.doDropOnto=function(){};
uf.prototype.doMouseMove=function(){if(this.na){var a=this.g;if(null!==a&&null!==this.rs&&null!==this.cc){var b=!1,c=!1;this.mayCopy()?(b=!0,a.ac="copy",ig(this,!1),Df(this,this.oc),jg(this,this.oc,!1),$f(this,this.oc)):this.mayMove()?(c=!0,a.ac="default",cg(this),jg(this,this.cc,!0)):this.mayDragOut()?(a.ac="no-drop",ig(this,!1),jg(this,this.oc,!1)):cg(this);ng(this,a.N.da,c,b)}}};
uf.prototype.doMouseUp=function(){if(this.na){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.oc?(cg(this),ig(this,!0),Df(this,this.oc),jg(this,this.oc,!1),$f(this,this.oc),null!==this.oc&&a.CE(this.oc.Ni())):(b=!0,cg(this),this.mayMove()&&(jg(this,this.cc,!0),this.ev=!1,ng(this,a.N.da,!0,!1),this.ev=!0));this.Rp=!0;Bg(this,a.N.da);if(this.na){this.oc=null;if(b&&null!==this.cc)for(b=this.cc.i;b.next();){var d=b.key;d instanceof U&&(d=d.Ra,null===d||null===d.placeholder||this.cc.contains(d)||
d.aD&&d.R())}a.pc();$f(this,this.cc);this.zf=c?"Copy":"Move";a.za(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};uf.prototype.mayCopy=function(){if(!this.MD)return!1;var a=this.g;if(null===a||a.nb||a.uf||!a.lo||!a.Ij||(u.Em?!a.N.alt:!a.N.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.Fd()&&b.canCopy())return!0}return null!==this.Sc&&this.Gi&&this.Sc.canCopy()?!0:!1};
uf.prototype.mayDragOut=function(){if(!this.MD)return!1;var a=this.g;if(null===a||!a.Av||!a.Ij||a.Nk)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.Fd()&&b.canCopy())return!0}return null!==this.Sc&&this.Gi&&this.Sc.canCopy()?!0:!1};uf.prototype.mayMove=function(){var a=this.g;if(null===a||a.nb||!a.Nk)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.Fd()&&b.canMove())return!0}return null!==this.Sc&&this.Gi&&this.Sc.canMove()?!0:!1};var ag=new E(uf),Ef=null,Ff=null;
uf.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.MC||a.nb||a.uf||!a.lo)return!1;var b=Ef;return null===b||b.g.ga.Sk!==a.ga.Sk?!1:!0};uf.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Lb.Mi();Dg(a);a=Ef;null!==a&&(a.g.ac="copy")}};uf.prototype.doSimulatedDragLeave=function(){var a=Ef;null!==a&&a.doSimulatedDragOut();this.doCancel()};
uf.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Ef;null!==b&&null!==b.cc&&this.mayDragIn()&&(a.ac="copy",Eg(this,b.cc.Ni(),!1),jg(this,this.oc,!1),ng(this,a.N.da,!1,!0))}};
uf.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Ef;null!==b&&(b.Rp=!0,cg(this),this.mayDragIn()&&(this.Wb("Drop"),Eg(this,b.cc.Ni(),!0),jg(this,this.oc,!1),null!==this.oc&&a.CE(this.oc.Ni()),this.zf="ExternalCopy",Bg(this,a.N.da),a.pc(),this.oc=null,a.focus(),a.za("ExternalObjectsDropped",a.selection),this.Uj()))}};
function Eg(a,b,c){if(null===a.oc){var d=a.g;if(null!==d&&!d.nb&&!d.uf){d.cb=!c;d.Vm=!c;a.Tj=d.N.da;d=d.to(b,d,!0);c=u.Sf();hg(b,c);var e=c.x+c.width/2,f=c.y+c.height/2;u.ic(c);var h=a.gv;c=new la(G);var k=u.K();for(b=b.i;b.next();){var l=b.value;if(l.Fd()&&l.canCopy()){var m=l.location,l=d.ta(l);k.m(h.x-(e-m.x),h.y-(f-m.y));l.location=k;l.pf();c.add(l,If(k))}}u.v(k);for(d=d.i;d.next();)e=d.value,e instanceof W&&e.canCopy()&&c.add(e,If());a.oc=c;Cf(a,c.Ni());null!==a.Sc&&(c=a.Sc,d=c.Mm,c.ll(a.Tj.x-
(d.x+d.width/2),a.Tj.y-(d.y+d.height/2)))}}}uf.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.ac="":a.ac="no-drop")};function Jf(a){this.point=a;this.IE=K.Wj}u.fa("DraggingInfo",Jf);function kg(a,b,c){this.Cc=a;this.info=b;this.LG=c}
function Fg(){0<arguments.length&&u.Wc(Fg);xe.call(this);this.XB=100;this.xB=!1;var a=new W,b=new X;b.tg=!0;b.stroke="blue";a.add(b);b=new X;b.jp="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.wf="Tool";this.tC=a;a=new U;b=new X;b.Jd="";b.Fb="Rectangle";b.fill=null;b.stroke="magenta";b.hb=2;b.xa=K.Tw;a.add(b);a.pl=!1;a.wf="Tool";this.rC=a;this.sC=b;a=new U;b=new X;b.Jd="";b.Fb="Rectangle";b.fill=null;b.stroke="magenta";b.hb=2;b.xa=K.Tw;a.add(b);a.pl=!1;a.wf="Tool";this.uC=a;this.vC=b;this.TB=
this.SB=this.OB=this.NB=this.PB=null;this.sB=!0;this.EF=new la(S,"boolean");this.YB=this.xk=this.nC=null}u.Ga(Fg,xe);u.fa("LinkingBaseTool",Fg);Fg.prototype.doStop=function(){var a=this.g;null!==a&&Kf(a);this.fh=this.eh=this.dh=this.bh=this.qc=null;this.Nw.clear();this.Rf=null};u.defineProperty(Fg,{fE:"portGravity"},function(){return this.XB},function(a){u.j(a,"number",Fg,"portGravity");0<=a&&(this.XB=a)});
u.defineProperty(Fg,{Io:"isUnconnectedLinkValid"},function(){return this.xB},function(a){u.j(a,"boolean",Fg,"isUnconnectedLinkValid");this.xB=a});u.defineProperty(Fg,{Dg:"temporaryLink"},function(){return this.tC},function(a){u.C(a,W,Fg,"temporaryLink");this.tC=a});u.defineProperty(Fg,{qe:"temporaryFromNode"},function(){return this.rC},function(a){u.C(a,U,Fg,"temporaryFromNode");this.rC=a});
u.defineProperty(Fg,{Om:"temporaryFromPort"},function(){return this.sC},function(a){u.C(a,S,Fg,"temporaryFromPort");this.sC=a});u.defineProperty(Fg,{re:"temporaryToNode"},function(){return this.uC},function(a){u.C(a,U,Fg,"temporaryToNode");this.uC=a});u.defineProperty(Fg,{Pm:"temporaryToPort"},function(){return this.vC},function(a){u.C(a,S,Fg,"temporaryToPort");this.vC=a});u.defineProperty(Fg,{qc:"originalLink"},function(){return this.PB},function(a){null!==a&&u.C(a,W,Fg,"originalLink");this.PB=a});
u.defineProperty(Fg,{bh:"originalFromNode"},function(){return this.NB},function(a){null!==a&&u.C(a,U,Fg,"originalFromNode");this.NB=a});u.defineProperty(Fg,{dh:"originalFromPort"},function(){return this.OB},function(a){null!==a&&u.C(a,S,Fg,"originalFromPort");this.OB=a});u.defineProperty(Fg,{eh:"originalToNode"},function(){return this.SB},function(a){null!==a&&u.C(a,U,Fg,"originalToNode");this.SB=a});
u.defineProperty(Fg,{fh:"originalToPort"},function(){return this.TB},function(a){null!==a&&u.C(a,S,Fg,"originalToPort");this.TB=a});u.defineProperty(Fg,{$d:"isForwards"},function(){return this.sB},function(a){u.j(a,"boolean",Fg,"isForwards");this.sB=a});u.u(Fg,{Nw:"validPortsCache"},function(){return this.EF});u.defineProperty(Fg,{Rf:"targetPort"},function(){return this.nC},function(a){null!==a&&u.C(a,S,Fg,"targetPort");this.nC=a});
Fg.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.xa=b.ba.size;e?(d.xb=b.xb,d.vl=b.vl):(d.vb=b.vb,d.Yk=b.Yk);c.Ze=Ib;var f=u.K();c.location=b.lb(Ib,f);u.v(f);d.angle=b.Zk();null!==this.ww&&this.ww(a,b,c,d,e)}};Fg.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.xa=K.Tw,b.vb=vb,b.xb=vb);null!==a&&(a.location=this.g.N.da);null!==this.ww&&this.ww(null,null,a,b,c)};Fg.prototype.doMouseDown=function(){this.na&&this.doMouseMove()};
Fg.prototype.doMouseMove=function(){if(this.na){var a=this.g;if(null!==a){this.Rf=this.findTargetPort(this.$d);if(null!==this.Rf){var b=this.Rf.T;if(b instanceof U){this.$d?this.copyPortProperties(b,this.Rf,this.re,this.Pm,!0):this.copyPortProperties(b,this.Rf,this.qe,this.Om,!1);return}}this.$d?this.setNoTargetPortProperties(this.re,this.Pm,!0):this.setNoTargetPortProperties(this.qe,this.Om,!1);(a.Re||a.Se)&&xg(a,a.N.ff)}}};
Fg.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.T;if(!(c instanceof U))return null;for(;null!==a;){var d=b?a.OE:a.vD;if(!0===d&&(null!==a.Jd||a instanceof U)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.S}return null};
Fg.prototype.findTargetPort=function(a){var b=this.g,c=b.N.da,d=this.fE;0>=d&&(d=.1);for(var e=this,f=b.ym(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,f=f.i;f.next();){var h=f.value,k=h.T;if(k instanceof U){var l=h.lb(Ib,u.K()),m=c.x-l.x,n=c.y-l.y;u.v(l);l=m*m+n*n;l<d&&(m=this.Nw.ta(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.bh,this.dh,k,h)||!a&&this.isValidLink(k,h,this.eh,this.fh)?(this.Nw.add(h,!0),b=h,d=l):this.Nw.add(h,!1))}}return null!==b&&(c=b.T,
c instanceof U&&(null===c.layer||c.layer.gs))?b:null};Fg.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.Io;if(this.g.Va===this&&(null!==a.layer&&!a.layer.gs||!0!==b.vD))return!1;var c=b.DG;if(Infinity>c){if(null!==this.qc&&a===this.bh&&b===this.dh)return!0;var d=b.Jd;null===d&&(d="");if(a.Wv(d).count>=c)return!1}return!0};
Fg.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Io;if(this.g.Va===this&&(null!==a.layer&&!a.layer.gs||!0!==b.OE))return!1;var c=b.yI;if(Infinity>c){if(null!==this.qc&&a===this.eh&&b===this.fh)return!0;var d=b.Jd;null===d&&(d="");if(a.og(d).count>=c)return!1}return!0};Fg.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.T,d=b.T;return null!==c&&c===d};
Fg.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.T;if(!(c instanceof U))return!1;var d=a.Jd;null===d&&(d="");var e=b.T;if(!(e instanceof U))return!1;var f=b.Jd;null===f&&(f="");for(e=e.og(f);e.next();)if(f=e.value,f.W===c&&f.pg===d)return!0;return!1};
Fg.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.CG&&d.xI||!this.isInSameNode(b,d))&&(b.BG&&d.wI||!this.isLinked(b,d)))||null!==this.qc&&(null!==a&&this.isLabelDependentOnLink(a,this.qc)||null!==c&&this.isLabelDependentOnLink(c,this.qc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.qc))return!1;if(null!==a){var e=a.pw;if(null!==e&&!e(a,b,c,d,this.qc))return!1}if(null!==
c&&(e=c.pw,null!==e&&!e(a,b,c,d,this.qc)))return!1;e=this.pw;return null!==e?e(a,b,c,d,this.qc):!0};Fg.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.ce;if(null===c)return!1;if(c===b)return!0;var d=new F(U);d.add(a);return Gg(this,c,b,d)};function Gg(a,b,c,d){if(b===c)return!0;var e=b.W;if(null!==e&&e.tf&&(d.add(e),Gg(a,e.ce,c,d)))return!0;b=b.ca;return null!==b&&b.tf&&(d.add(b),Gg(a,b.ce,c,d))?!0:!1}
Fg.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Io;var d=this.g.DI;if(d!==Hg){if(d===Ig){if(null!==c&&!c.Bc)return!0;for(d=b.oe;d.next();){var e=d.value;if(e!==c&&e.Bc&&e.ca===b)return!1}return!Jg(this,a,b,c,!0)}if(d===Kg){if(null!==c&&!c.Bc)return!0;for(d=a.oe;d.next();)if(e=d.value,e!==c&&e.Bc&&e.W===a)return!1;return!Jg(this,a,b,c,!0)}if(d===Lg)return a===b?a=!0:(d=new F(U),d.add(b),a=Ug(this,d,a,b,c)),!a;if(d===Vg)return!Jg(this,a,b,c,!1);if(d===
Wg)return a===b?a=!0:(d=new F(U),d.add(b),a=Xg(this,d,a,b,c)),!a}return!0};function Jg(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.oe;f.next();){var h=f.value;if(h!==d&&(!e||h.Bc)&&h.ca===b&&(h=h.W,h!==b&&Jg(a,h,c,d,e)))return!0}return!1}function Ug(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.oe;f.next();){var h=f.value;if(h!==e&&h.ca===c&&(h=h.W,h!==c&&Ug(a,b,h,d,e)))return!0}return!1}
function Xg(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.oe;f.next();){var h=f.value;if(h!==e){var k=h.W,h=h.ca,k=k===c?h:k;if(k!==c&&Xg(a,b,k,d,e))return!0}}return!1}u.defineProperty(Fg,{pw:"linkValidation"},function(){return this.xk},function(a){null!==a&&u.j(a,"function",Fg,"linkValidation");this.xk=a});u.defineProperty(Fg,{ww:"portTargeted"},function(){return this.YB},function(a){null!==a&&u.j(a,"function",Fg,"portTargeted");this.YB=a});
function ta(){0<arguments.length&&u.Wc(ta);Fg.call(this);this.name="Linking";this.ex={};this.bx=null;this.la=Yg;this.yy=this.jC=null}u.Ga(ta,Fg);u.fa("LinkingTool",ta);var Yg;ta.Either=Yg=u.s(ta,"Either",0);var Zg;ta.ForwardsOnly=Zg=u.s(ta,"ForwardsOnly",0);var $g;ta.BackwardsOnly=$g=u.s(ta,"BackwardsOnly",0);u.defineProperty(ta,{OF:"archetypeLinkData"},function(){return this.ex},function(a){null!==a&&u.C(a,Object,ta,"archetypeLinkData");a instanceof S&&u.C(a,W,ta,"archetypeLinkData");this.ex=a});
u.defineProperty(ta,{PC:"archetypeLabelNodeData"},function(){return this.bx},function(a){null!==a&&u.C(a,Object,ta,"archetypeLabelNodeData");a instanceof S&&u.C(a,U,ta,"archetypeLabelNodeData");this.bx=a});u.defineProperty(ta,{direction:"direction"},function(){return this.la},function(a){u.rb(a,ta,ta,"direction");this.la=a});u.defineProperty(ta,{ME:"startObject"},function(){return this.jC},function(a){null!==a&&u.C(a,S,ta,"startObject");this.jC=a});u.u(ta,{Kw:"startPort"},function(){return this.yy});
ta.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.nb||a.uf||!a.gs)return!1;var b=a.ga;return(b instanceof Q||b instanceof qe)&&a.N.left&&(a.Va===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
ta.prototype.findLinkablePort=function(){var a=this.g;if(null===a)return null;var b=this.ME;null===b&&(b=a.ke(a.wc.da,null,null));if(null===b||!(b.T instanceof U))return null;a=this.direction;if(a===Yg||a===Zg){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.$d=!0,c}if(a===Yg||a===$g)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.$d=!1,c;return null};
ta.prototype.doActivate=function(){var a=this.g;if(null!==a&&(null===this.Kw&&(this.yy=this.findLinkablePort()),null!==this.Kw)){this.Wb(this.name);a.Ge=!0;a.ac="pointer";if(this.$d){this.dh=this.Kw;var b=this.dh.T;b instanceof U&&(this.bh=b);this.copyPortProperties(this.bh,this.dh,this.qe,this.Om,!1)}else this.fh=this.Kw,b=this.fh.T,b instanceof U&&(this.eh=b),this.copyPortProperties(this.eh,this.fh,this.re,this.Pm,!0);a.add(this.qe);a.add(this.re);null!==this.Dg&&(null!==this.qe&&(this.Dg.W=this.qe),
null!==this.re&&(this.Dg.ca=this.re),this.Dg.Vb(),a.add(this.Dg));this.na=!0}};ta.prototype.doDeactivate=function(){this.na=!1;var a=this.g;null!==a&&(a.remove(this.Dg),a.remove(this.qe),a.remove(this.re),a.Ge=!1,a.ac="",this.Uj())};ta.prototype.doStop=function(){Fg.prototype.doStop.call(this);this.ME=this.yy=null};
ta.prototype.doMouseUp=function(){if(this.na){var a=this.g;if(null===a)return;var b=this.zf=null,c=null,d=null,e=null,f=this.Rf=this.findTargetPort(this.$d);if(null!==f){var h=f.T;h instanceof U&&(this.$d?(null!==this.bh&&(b=this.bh,c=this.dh),d=h,e=f):(b=h,c=f,null!==this.eh&&(d=this.eh,e=this.fh)))}else this.$d?null!==this.bh&&this.Io&&(b=this.bh,c=this.dh):null!==this.eh&&this.Io&&(d=this.eh,e=this.fh);if(null!==b||null!==d)b=this.insertLink(b,c,d,e),null!==b?(null===f&&(this.$d?b.nn=a.N.da.copy():
b.jn=a.N.da.copy()),a.of&&a.select(b),this.zf=this.name,a.za("LinkDrawn",b)):a.ga.XC()}this.stopTool()};
ta.prototype.insertLink=function(a,b,c,d){var e=this.g;if(null===e)return null;var f=e.ga;if(f instanceof qe){var h=a;b=c;e.qd||(h=c,b=a);if(null!==h&&null!==b)return f.ih(b.data,f.wb(h.data)),b.As()}else if(f instanceof Q)if(h="",null!==a&&(null===b&&(b=a),h=b.Jd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.Jd,null===b&&(b="")),d=this.OF,d instanceof W){if(nf(d),f=d.copy(),null!==f)return f.W=a,f.pg=h,f.ca=c,f.lh=b,e.add(f),a=this.PC,a instanceof U&&(nf(a),a=a.copy(),null!==a&&(a.ce=f,e.add(a))),
f}else if(null!==d&&(d=f.eD(d),u.Sa(d)))return null!==a&&f.Ew(d,f.wb(a.data)),f.aA(d,h),null!==c&&f.Gw(d,f.wb(c.data)),f.eA(d,b),f.xv(d),a=this.PC,null===a||a instanceof U||(a=f.copyNodeData(a),u.Sa(a)&&(f.km(a),a=f.wb(a),void 0!==a&&f.Ly(d,a))),f=e.ng(d);return null};
function Gf(){0<arguments.length&&u.Wc(Gf);Fg.call(this);this.name="Relinking";var a=new X;a.Fb="Diamond";a.xa=K.Qw;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Pf=0;this.gB=a;a=new X;a.Fb="Diamond";a.xa=K.Qw;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Pf=-1;this.wC=a;this.Yb=null;this.QB=new z}u.Ga(Gf,Fg);u.fa("RelinkingTool",Gf);
Gf.prototype.updateAdornments=function(a){if(null!==a&&a instanceof W){var b="RelinkFrom",c=null;if(a.Za&&!this.g.nb){var d=a.nt;null!==d&&a.canRelinkFrom()&&a.ba.J()&&a.Ea()&&d.ba.J()&&d.kl()&&(c=a.xo(b),null===c&&(c=this.makeAdornment(d,!1),null!==c&&(c.Kc=b),a.Kk(b,c)))}null===c&&a.ol(b);b="RelinkTo";c=null;a.Za&&!this.g.nb&&(d=a.nt,null!==d&&a.canRelinkTo()&&a.ba.J()&&a.Ea()&&d.ba.J()&&d.kl()&&(c=a.xo(b),null===c&&(c=this.makeAdornment(d,!0),null!==c&&(c.Kc=b),a.Kk(b,c))));null===c&&a.ol(b)}};
Gf.prototype.makeAdornment=function(a,b){var c=new lf;c.type=ah;var d=b?this.vI:this.AG;null!==d&&c.add(d.copy());c.vc=a;return c};u.defineProperty(Gf,{AG:"fromHandleArchetype"},function(){return this.gB},function(a){null!==a&&u.C(a,S,Gf,"fromHandleArchetype");this.gB=a});u.defineProperty(Gf,{vI:"toHandleArchetype"},function(){return this.wC},function(a){null!==a&&u.C(a,S,Gf,"toHandleArchetype");this.wC=a});u.u(Gf,{handle:"handle"},function(){return this.Yb});
Gf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.nb||a.uf||!a.mm)return!1;var b=a.ga;if(!(b instanceof Q||b instanceof qe)||!a.N.left)return!1;b=this.findToolHandleAt(a.wc.da,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.wc.da,"RelinkTo"));return null!==b};
Gf.prototype.doActivate=function(){var a=this.g;if(null!==a){if(null===this.qc){var b=this.findToolHandleAt(a.wc.da,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.wc.da,"RelinkTo"));if(null===b)return;var c=b.T;if(!(c instanceof lf&&c.Kh instanceof W))return;this.Yb=b;this.$d=null===c||"RelinkTo"===c.Kc;this.qc=c.Kh}this.Wb(this.name);a.Ge=!0;a.ac="pointer";this.dh=this.qc.od;this.bh=this.qc.W;this.fh=this.qc.fe;this.eh=this.qc.ca;this.QB.set(this.qc.ba);null!==this.qc&&0<this.qc.ka&&(null===
this.qc.W&&(null!==this.Om&&(this.Om.xa=K.op),null!==this.qe&&(this.qe.location=this.qc.l(0))),null===this.qc.ca&&(null!==this.Pm&&(this.Pm.xa=K.op),null!==this.re&&(this.re.location=this.qc.l(this.qc.ka-1))));this.copyPortProperties(this.bh,this.dh,this.qe,this.Om,!1);this.copyPortProperties(this.eh,this.fh,this.re,this.Pm,!0);a.add(this.qe);a.add(this.re);null!==this.Dg&&(null!==this.qe&&(this.Dg.W=this.qe),null!==this.re&&(this.Dg.ca=this.re),this.copyLinkProperties(this.qc,this.Dg),this.Dg.Vb(),
a.add(this.Dg));this.na=!0}};Gf.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.es=a.es;b.Yy=a.Yy;var c=a.Ve;if(c===bh||c===ch)c=dh;b.Ve=c;b.Ov=a.Ov;b.zw=a.zw;b.gp=a.gp;b.vb=a.vb;b.Yk=a.Yk;b.Es=a.Es;b.Fs=a.Fs;b.xb=a.xb;b.vl=a.vl;b.wt=a.wt;b.yt=a.yt}};Gf.prototype.doDeactivate=function(){this.na=!1;var a=this.g;null!==a&&(a.remove(this.Dg),a.remove(this.qe),a.remove(this.re),a.Ge=!1,a.ac="",this.Uj())};Gf.prototype.doStop=function(){Fg.prototype.doStop.call(this);this.Yb=null};
Gf.prototype.doMouseUp=function(){if(this.na){var a=this.g;if(null===a)return;this.zf=null;var b=this.bh,c=this.dh,d=this.eh,e=this.fh,f=this.qc;this.Rf=this.findTargetPort(this.$d);if(null!==this.Rf){var h=this.Rf.T;h instanceof U&&(this.$d?(d=h,e=this.Rf):(b=h,c=this.Rf))}else this.Io?this.$d?e=d=null:c=b=null:f=null;null!==f&&(this.reconnectLink(f,this.$d?d:b,this.$d?e:c,this.$d),null===this.Rf&&(this.$d?f.nn=a.N.da.copy():f.jn=a.N.da.copy(),f.Vb()),a.of&&(f.Za=!0),this.zf=this.name,a.za("LinkRelinked",
f,this.$d?this.fh:this.dh));eh(this.qc,this.QB)}this.stopTool()};Gf.prototype.reconnectLink=function(a,b,c,d){if(null===this.g)return!1;c=null!==c&&null!==c.Jd?c.Jd:"";d?(a.ca=b,a.lh=c):(a.W=b,a.pg=c);return!0};function Ag(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.qe,a.Om,!1),a.g.add(a.qe)):a.g.remove(a.qe);null!==d?(a.copyPortProperties(d,e,a.re,a.Pm,!0),a.g.add(a.re)):a.g.remove(a.re)}
function fh(){0<arguments.length&&u.Wc(fh);xe.call(this);this.name="LinkReshaping";var a=new X;a.Fb="Rectangle";a.xa=K.mp;a.fill="lightblue";a.stroke="dodgerblue";this.pk=a;a=new X;a.Fb="Diamond";a.xa=K.mp;a.fill="lightblue";a.stroke="dodgerblue";this.DB=a;this.ZB=3;this.$w=this.Yb=null;this.RB=new w;this.my=null}u.Ga(fh,xe);u.fa("LinkReshapingTool",fh);var gh;fh.None=gh=u.s(fh,"None",0);var hh;fh.Horizontal=hh=u.s(fh,"Horizontal",1);var ih;fh.Vertical=ih=u.s(fh,"Vertical",2);var jh;
fh.All=jh=u.s(fh,"All",3);fh.prototype.getReshapingBehavior=fh.prototype.AD=function(a){return a&&a.$B?a.$B:gh};fh.prototype.setReshapingBehavior=fh.prototype.qt=function(a,b){u.C(a,S,fh,"setReshapingBehavior:obj");u.rb(b,fh,fh,"setReshapingBehavior:behavior");a.$B=b};
fh.prototype.updateAdornments=function(a){if(null!==a&&a instanceof W){if(a.Za&&!this.g.nb){var b=a.path;if(null!==b&&a.canReshape()&&a.ba.J()&&a.Ea()&&b.ba.J()&&b.kl()){var c=a.xo(this.name);if(null===c||c.xF!==a.ka||c.GF!==a.it)c=this.makeAdornment(b),null!==c&&(c.xF=a.ka,c.GF=a.it,a.Kk(this.name,c));if(null!==c){c.location=a.position;return}}}a.ol(this.name)}};
fh.prototype.makeAdornment=function(a){var b=a.T,c=b.ka,d=b.dc,e=null;if(null!==b.points&&1<c){e=new lf;e.type=ah;var c=b.Bs,f=b.lw,h=d?1:0;if(b.it&&b.Ve!==kh)for(var k=c+h;k<f-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.Pf=k,l.Bw=.5,e.add(l))}for(k=c+1;k<f;k++)if(l=this.makeHandle(a,k),null!==l){l.Pf=k;if(k!==c)if(k===c+1&&d){var h=b.l(c),m=b.l(c+1);K.D(h.x,m.x)&&K.D(h.y,m.y)&&(m=b.l(c-1));K.D(h.x,m.x)?(this.qt(l,ih),l.cursor="n-resize"):K.D(h.y,m.y)&&(this.qt(l,hh),l.cursor="w-resize")}else k===
f-1&&d?(h=b.l(f-1),m=b.l(f),K.D(h.x,m.x)&&K.D(h.y,m.y)&&(h=b.l(f+1)),K.D(h.x,m.x)?(this.qt(l,ih),l.cursor="n-resize"):K.D(h.y,m.y)&&(this.qt(l,hh),l.cursor="w-resize")):k!==f&&(this.qt(l,jh),l.cursor="move");e.add(l)}e.Kc=this.name;e.vc=a}return e};fh.prototype.makeHandle=function(){var a=this.Hs;return null===a?null:a.copy()};u.defineProperty(fh,{Hs:"handleArchetype"},function(){return this.pk},function(a){null!==a&&u.C(a,S,fh,"handleArchetype");this.pk=a});
fh.prototype.makeResegmentHandle=function(){var a=this.zH;return null===a?null:a.copy()};u.defineProperty(fh,{zH:"midHandleArchetype"},function(){return this.DB},function(a){null!==a&&u.C(a,S,fh,"midHandleArchetype");this.DB=a});u.u(fh,{handle:"handle"},function(){return this.Yb});u.u(fh,{fs:"adornedLink"},function(){return this.$w});fh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.nb&&a.Cv&&a.N.left?null!==this.findToolHandleAt(a.wc.da,this.name):!1};
fh.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.Yb=this.findToolHandleAt(a.wc.da,this.name),null!==this.Yb)){var b=this.Yb.T.Kh;if(b instanceof W){this.$w=b;a.Ge=!0;this.Wb(this.name);if(b.it&&.5===this.Yb.Bw){var c=b.points.copy(),d=this.Yb.lb(Ib);c.Yd(this.Yb.Pf+1,d);b.dc&&c.Yd(this.Yb.Pf+1,d);b.points=c;b.Zd();this.Yb=this.findToolHandleAt(a.wc.da,this.name)}this.RB=b.l(this.Yb.Pf);this.my=b.points.copy();this.na=!0}}};
fh.prototype.doDeactivate=function(){this.Uj();this.$w=this.Yb=null;var a=this.g;null!==a&&(a.Ge=!1);this.na=!1};fh.prototype.doCancel=function(){var a=this.fs;null!==a&&(a.points=this.my);this.stopTool()};fh.prototype.doMouseMove=function(){var a=this.g;this.na&&null!==a&&(a=this.computeReshape(a.N.da),this.reshape(a))};
fh.prototype.doMouseUp=function(){var a=this.g;if(this.na&&null!==a){var b=this.computeReshape(a.N.da);this.reshape(b);b=this.fs;if(null!==b&&b.it){var c=this.handle.Pf,d=b.l(c-1),e=b.l(c),f=b.l(c+1);if(b.dc){if(c>b.Bs+1&&c<b.lw-1){var h=b.l(c-2);if(Math.abs(d.x-e.x)<this.gh&&Math.abs(d.y-e.y)<this.gh&&(lh(this,h,d,e,f,!0)||lh(this,h,d,e,f,!1))){var k=b.points.copy();lh(this,h,d,e,f,!0)?(k.Bg(c-2,new w(h.x,(f.y+h.y)/2)),k.Bg(c+1,new w(f.x,(f.y+h.y)/2))):(k.Bg(c-2,new w((f.x+h.x)/2,h.y)),k.Bg(c+1,
new w((f.x+h.x)/2,f.y)));k.hd(c);k.hd(c-1);b.points=k;b.Zd()}else h=b.l(c+2),Math.abs(e.x-f.x)<this.gh&&Math.abs(e.y-f.y)<this.gh&&(lh(this,d,e,f,h,!0)||lh(this,d,e,f,h,!1))&&(k=b.points.copy(),lh(this,d,e,f,h,!0)?(k.Bg(c-1,new w(d.x,(d.y+h.y)/2)),k.Bg(c+2,new w(h.x,(d.y+h.y)/2))):(k.Bg(c-1,new w((d.x+h.x)/2,d.y)),k.Bg(c+2,new w((d.x+h.x)/2,h.y))),k.hd(c+1),k.hd(c),b.points=k,b.Zd())}}else h=u.K(),K.Hm(d.x,d.y,f.x,f.y,e.x,e.y,h)&&h.Lj(e)<this.gh*this.gh&&(k=b.points.copy(),k.hd(c),b.points=k,b.Zd()),
u.v(h)}a.pc();this.zf=this.name;a.za("LinkReshaped",this.fs)}this.stopTool()};function lh(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.gh&&Math.abs(c.y-d.y)<a.gh&&Math.abs(d.y-e.y)<a.gh:Math.abs(b.x-c.x)<a.gh&&Math.abs(c.x-d.x)<a.gh&&Math.abs(d.x-e.x)<a.gh}u.defineProperty(fh,{gh:"resegmentingDistance"},function(){return this.ZB},function(a){u.j(a,"number",fh,"resegmentingDistance");this.ZB=a});
fh.prototype.reshape=function(a){var b=this.fs;b.rl();var c=this.handle.Pf,d=this.AD(this.handle);if(b.dc)if(c===b.Bs+1)c=b.Bs+1,d===ih?(b.V(c,b.l(c-1).x,a.y),b.V(c+1,b.l(c+2).x,a.y)):d===hh&&(b.V(c,a.x,b.l(c-1).y),b.V(c+1,a.x,b.l(c+2).y));else if(c===b.lw-1)c=b.lw-1,d===ih?(b.V(c-1,b.l(c-2).x,a.y),b.V(c,b.l(c+1).x,a.y)):d===hh&&(b.V(c-1,a.x,b.l(c-2).y),b.V(c,a.x,b.l(c+1).y));else{var d=c,e=b.l(d),f=b.l(d-1),h=b.l(d+1);K.D(f.x,e.x)&&K.D(e.y,h.y)?(K.D(f.x,b.l(d-2).x)&&!K.D(f.y,b.l(d-2).y)?(b.w(d,a.x,
f.y),c++,d++):b.V(d-1,a.x,f.y),K.D(h.y,b.l(d+2).y)&&!K.D(h.x,b.l(d+2).x)?b.w(d+1,h.x,a.y):b.V(d+1,h.x,a.y)):K.D(f.y,e.y)&&K.D(e.x,h.x)?(K.D(f.y,b.l(d-2).y)&&!K.D(f.x,b.l(d-2).x)?(b.w(d,f.x,a.y),c++,d++):b.V(d-1,f.x,a.y),K.D(h.x,b.l(d+2).x)&&!K.D(h.y,b.l(d+2).y)?b.w(d+1,a.x,h.y):b.V(d+1,a.x,h.y)):K.D(f.x,e.x)&&K.D(e.x,h.x)?(K.D(f.x,b.l(d-2).x)&&!K.D(f.y,b.l(d-2).y)?(b.w(d,a.x,f.y),c++,d++):b.V(d-1,a.x,f.y),K.D(h.x,b.l(d+2).x)&&!K.D(h.y,b.l(d+2).y)?b.w(d+1,a.x,h.y):b.V(d+1,a.x,h.y)):K.D(f.y,e.y)&&K.D(e.y,
h.y)&&(K.D(f.y,b.l(d-2).y)&&!K.D(f.x,b.l(d-2).x)?(b.w(d,f.x,a.y),c++,d++):b.V(d-1,f.x,a.y),K.D(h.y,b.l(d+2).y)&&!K.D(h.x,b.l(d+2).x)?b.w(d+1,h.x,a.y):b.V(d+1,h.x,a.y));b.V(c,a.x,a.y)}else b.V(c,a.x,a.y),1===c&&b.computeSpot(!0).ne()&&(e=b.W,f=b.od,null===e||e.Ea()||(e=e.findVisibleNode(),e!==b.W&&(f=e.Xk(""))),d=f.lb(Ib,u.K()),e=b.getLinkPointFromPoint(e,f,d,a,!0,u.K()),b.V(0,e.x,e.y),u.v(d),u.v(e)),c===b.ka-2&&b.computeSpot(!1).ne()&&(c=b.ca,e=b.fe,null===c||c.Ea()||(c=c.findVisibleNode(),c!==b.ca&&
(e=c.Xk(""))),d=e.lb(Ib,u.K()),e=b.getLinkPointFromPoint(c,e,d,a,!1,u.K()),b.V(b.ka-1,e.x,e.y),u.v(d),u.v(e));b.Bi()};fh.prototype.computeReshape=function(a){var b=this.fs,c=this.handle.Pf;switch(this.AD(this.handle)){case jh:return a;case ih:return b=b.l(c),new w(b.x,a.y);case hh:return b=b.l(c),new w(a.x,b.y);default:case gh:return b.l(c)}};u.u(fh,{hK:"originalPoint"},function(){return this.RB});u.u(fh,{iK:"originalPoints"},function(){return this.my});
function mh(){0<arguments.length&&u.Wc(mh);xe.call(this);this.name="Resizing";this.nj=(new ia(1,1)).freeze();this.lj=(new ia(9999,9999)).freeze();this.Ti=(new ia(NaN,NaN)).freeze();this.iq=!1;this.Gb=null;var a=new X;a.Hj=Ib;a.Fb="Rectangle";a.xa=K.mp;a.fill="lightblue";a.stroke="dodgerblue";a.hb=1;a.cursor="pointer";this.pk=a;this.Yb=null;this.Tu=new ia;this.ly=new w;this.Jx=new ia(0,0);this.Ix=new ia(Infinity,Infinity);this.Hx=new ia(1,1);this.KB=!0}u.Ga(mh,xe);u.fa("ResizingTool",mh);
mh.prototype.updateAdornments=function(a){if(!(null===a||a instanceof W)){if(a.Za&&!this.g.nb){var b=a.sE;if(null!==b&&a.canResize()&&a.ba.J()&&a.Ea()&&b.ba.J()&&b.kl()){var c=a.xo(this.name);null===c&&(c=this.makeAdornment(b));if(null!==c){var d=b.Zk();c.angle=d;var e=b.lb(c.Ze,u.K()),f=b.Hi();c.location=e;u.v(e);e=c.placeholder;if(null!==e){var b=b.Ha,h=u.ul();h.m(b.width*f,b.height*f);e.xa=h;u.Oj(h)}nh(this,c,d);a.Kk(this.name,c);return}}}a.ol(this.name)}};
mh.prototype.makeAdornment=function(a){var b=null,b=a.T.rE;if(null===b){b=new lf;b.type=oh;b.Ze=Ib;var c=new ph;c.tg=!0;b.add(c);b.add(this.makeHandle(a,xb));b.add(this.makeHandle(a,Gb));b.add(this.makeHandle(a,Vb));b.add(this.makeHandle(a,Kb));b.add(this.makeHandle(a,vc));b.add(this.makeHandle(a,xc));b.add(this.makeHandle(a,Cc));b.add(this.makeHandle(a,wc))}else if(nf(b),b=b.copy(),null===b)return null;b.Kc=this.name;b.vc=a;return b};
mh.prototype.makeHandle=function(a,b){var c=this.Hs;if(null===c)return null;c=c.copy();c.alignment=b;return c};
function nh(a,b,c){if(null!==b)if(!b.alignment.Lc()&&""!==b.cursor)a:{a=b.alignment;a.ne()&&(a=Ib);if(0>=a.x)c=0>=a.y?c+225:1<=a.y?c+135:c+180;else if(1<=a.x)0>=a.y?c+=315:1<=a.y&&(c+=45);else if(0>=a.y)c+=270;else if(1<=a.y)c+=90;else break a;0>c?c+=360:360<=c&&(c-=360);b.cursor=22.5>c?"e-resize":67.5>c?"se-resize":112.5>c?"s-resize":157.5>c?"sw-resize":202.5>c?"w-resize":247.5>c?"nw-resize":292.5>c?"n-resize":337.5>c?"ne-resize":"e-resize"}else if(b instanceof A)for(b=b.elements;b.next();)nh(a,
b.value,c)}u.defineProperty(mh,{Hs:"handleArchetype"},function(){return this.pk},function(a){null!==a&&u.C(a,S,mh,"handleArchetype");this.pk=a});u.u(mh,{handle:"handle"},function(){return this.Yb});u.defineProperty(mh,{vc:"adornedObject"},function(){return this.Gb},function(a){null!==a&&u.C(a,S,mh,"adornedObject");this.Gb=a});mh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.nb&&a.hs&&a.N.left?null!==this.findToolHandleAt(a.wc.da,this.name)?!0:!1:!1};
mh.prototype.doActivate=function(){var a=this.g;null!==a&&(this.Yb=this.findToolHandleAt(a.wc.da,this.name),null!==this.Yb&&(this.Gb=this.Yb.T.vc,this.ly.set(this.Gb.T.location),this.Tu.set(this.Gb.xa),this.Hx=this.computeCellSize(),this.Jx=this.computeMinSize(),this.Ix=this.computeMaxSize(),a.Ge=!0,this.KB=a.Lb.isEnabled,a.Lb.isEnabled=!1,this.Wb(this.name),this.na=!0))};mh.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Uj(),this.Gb=this.Yb=null,this.na=a.Ge=!1,a.Lb.isEnabled=this.KB)};
mh.prototype.doCancel=function(){this.Gb.xa=this.Tu;this.Gb.T.location=this.ly;this.stopTool()};mh.prototype.doMouseMove=function(){var a=this.g;if(this.na&&null!==a){var b=this.Jx,c=this.Ix,d=this.Hx,e=this.Gb.zD(a.N.da,u.K()),f=qh;this.Gb instanceof X&&(f=rh(this.Gb));b=this.computeResize(e,this.Yb.alignment,b,c,d,!(f===sh||f===th||a.N.shift));this.resize(b);a.bf();u.v(e)}};
mh.prototype.doMouseUp=function(){var a=this.g;if(this.na&&null!==a){var b=this.Jx,c=this.Ix,d=this.Hx,e=this.Gb.zD(a.N.da,u.K()),f=qh;this.Gb instanceof X&&(f=rh(this.Gb));b=this.computeResize(e,this.Yb.alignment,b,c,d,!(f===sh||f===th||a.N.shift));this.resize(b);u.v(e);a.pc();this.zf=this.name;a.za("PartResized",this.Gb,this.Tu)}this.stopTool()};
mh.prototype.resize=function(a){if(null!==this.g){var b=this.vc,c=b.T,d=b.Zk(),e=b.Hi(),f=Math.PI*d/180,h=Math.cos(f),f=Math.sin(f),k=0<d&&180>d?1:0,l=90<d&&270>d?1:0,d=180<d&&360>d?1:0,m=b.Ha.width,n=b.Ha.height;b.xa=a.size;var p=c.position.copy();c.pf();m=b.Ha.width-m;n=b.Ha.height-n;if(0!==m||0!==n)0!==m&&(p.x+=e*((a.x+m*l)*h-(a.y+n*k)*f)),0!==n&&(p.y+=e*((a.x+m*d)*f+(a.y+n*l)*h)),c.move(p)}};
mh.prototype.computeResize=function(a,b,c,d,e,f){b.ne()&&(b=Ib);var h=this.vc.Ha,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!f){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=u.K();K.xs(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):
(a.width=a.height/p,a.x=m-a.width))):1<=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,p<b?a.height=p*a.width:(a.width=a.height/p,a.x=m-a.width))):(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=m-a.x,f||(a.height=p*a.width,a.y=l+.5*(n-l-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-
c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):a.width=a.height/p)):1<=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,p<b?a.height=p*a.width:a.width=a.height/p)):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),f||(a.height=p*a.width,a.y=l+.5*(n-l-a.height))):0>=b.y?(a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=n-a.y,f||(a.width=a.height/
p,a.x=k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));u.v(q);return a};mh.prototype.computeMinSize=function(){var a=this.vc.vg.copy(),b=this.vg;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
mh.prototype.computeMaxSize=function(){var a=this.vc.af.copy(),b=this.af;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
mh.prototype.computeCellSize=function(){var a=new ia(NaN,NaN),b=this.vc.T;if(null!==b){var c=b.VH;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.qo;isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width);isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height);b=this.g;(isNaN(a.width)||isNaN(a.height))&&b&&(c=b.tb.Ed,null!==c&&c.gw&&(c=c.DD,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&
0<c.height&&(a.height=c.height)),b=b.Gs,null!==b&&b.visible&&this.gw&&(c=b.aw,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height)));if(isNaN(a.width)||0===a.width||Infinity===a.width)a.width=1;if(isNaN(a.height)||0===a.height||Infinity===a.height)a.height=1;return a};
u.defineProperty(mh,{vg:"minSize"},function(){return this.nj},function(a){u.C(a,ia,mh,"minSize");if(!this.nj.L(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.nj.m(b,a)}});u.defineProperty(mh,{af:"maxSize"},function(){return this.lj},function(a){u.C(a,ia,mh,"maxSize");if(!this.lj.L(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.lj.m(b,a)}});
u.defineProperty(mh,{qo:"cellSize"},function(){return this.Ti},function(a){u.C(a,ia,mh,"cellSize");this.Ti.L(a)||this.Ti.assign(a)});u.defineProperty(mh,{gw:"isGridSnapEnabled"},function(){return this.iq},function(a){u.j(a,"boolean",mh,"isGridSnapEnabled");this.iq=a});u.u(mh,{fK:"originalDesiredSize"},function(){return this.Tu});u.u(mh,{gK:"originalLocation"},function(){return this.ly});
function uh(){0<arguments.length&&u.Wc(uh);xe.call(this);this.name="Rotating";this.gC=45;this.fC=2;this.Gb=null;var a=new X;a.Fb="Ellipse";a.xa=K.Qw;a.fill="lightblue";a.stroke="dodgerblue";a.hb=1;a.cursor="pointer";this.pk=a;this.Yb=null;this.Su=0;this.aC=new w}u.Ga(uh,xe);u.fa("RotatingTool",uh);
uh.prototype.updateAdornments=function(a){if(!(null===a||a instanceof W)){if(a.Za&&!this.g.nb){var b=a.vE;if(null!==b&&a.canRotate()&&a.ba.J()&&a.Ea()&&b.ba.J()&&b.kl()){var c=a.xo(this.name);null===c&&(c=this.makeAdornment(b));if(null!==c){c.angle=b.Zk();var d=null,e=null;b===a||b===a.ec?(d=a.ec,e=a.Ze):(d=b,e=Ib);for(var f=d.Ha,e=u.fc(f.width*e.x+e.offsetX,f.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.ab(e),d=d.S;var d=e.y,f=Math.max(e.x-b.Ha.width,0),h=u.K();c.location=b.lb(new L(1,0,50+
f,d),h);u.v(h);u.v(e);a.Kk(this.name,c);return}}}a.ol(this.name)}};uh.prototype.makeAdornment=function(a){var b=null,b=a.T.YH;if(null===b){b=new lf;b.type=vh;b.Ze=Ib;var c=this.Hs;null!==c&&b.add(c.copy())}else if(nf(b),b=b.copy(),null===b)return null;b.Kc=this.name;b.vc=a;return b};u.defineProperty(uh,{Hs:"handleArchetype"},function(){return this.pk},function(a){null!==a&&u.C(a,S,uh,"handleArchetype");this.pk=a});u.u(uh,{handle:"handle"},function(){return this.Yb});
u.defineProperty(uh,{vc:"adornedObject"},function(){return this.Gb},function(a){null!==a&&u.C(a,S,uh,"adornedObject");this.Gb=a});uh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.nb&&a.Dv&&a.N.left?null!==this.findToolHandleAt(a.wc.da,this.name)?!0:!1:!1};
uh.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.Yb=this.findToolHandleAt(a.wc.da,this.name),null!==this.Yb)){this.Gb=this.Yb.T.vc;var b=this.Gb.T,c=b.ec;this.aC=this.Gb===b||this.Gb===c?c.lb(b.Ze):this.Gb.lb(Ib);this.Su=this.Gb.angle;a.Ge=!0;a.az=!0;this.Wb(this.name);this.na=!0}};uh.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Uj(),this.Gb=this.Yb=null,this.na=a.Ge=!1)};uh.prototype.doCancel=function(){var a=this.g;null!==a&&(a.az=!1);this.rotate(this.Su);this.stopTool()};
uh.prototype.doMouseMove=function(){var a=this.g;this.na&&null!==a&&(a=this.computeRotate(a.N.da),this.rotate(a))};uh.prototype.doMouseUp=function(){var a=this.g;if(this.na&&null!==a){a.az=!1;var b=this.computeRotate(a.N.da);this.rotate(b);a.pc();this.zf=this.name;a.za("PartRotated",this.Gb,this.Su)}this.stopTool()};uh.prototype.rotate=function(a){null!==this.Gb&&(this.Gb.angle=a)};
uh.prototype.computeRotate=function(a){a=this.aC.Fi(a);var b=this.Gb.S;null!==b&&(a-=b.Zk(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.mI),180),c=Math.min(Math.abs(this.lI),b/2);!this.g.N.shift&&0<b&&0<c&&(a%b<c?a=Math.floor(a/b)*b:a%b>b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};u.defineProperty(uh,{mI:"snapAngleMultiple"},function(){return this.gC},function(a){u.j(a,"number",uh,"snapAngleMultiple");this.gC=a});
u.defineProperty(uh,{lI:"snapAngleEpsilon"},function(){return this.fC},function(a){u.j(a,"number",uh,"snapAngleEpsilon");this.fC=a});u.u(uh,{eK:"originalAngle"},function(){return this.Su});function wh(){0<arguments.length&&u.Wc(wh);xe.call(this);this.name="ClickSelecting"}u.Ga(wh,xe);u.fa("ClickSelectingTool",wh);wh.prototype.canStart=function(){return!this.isEnabled||null===this.g||this.isBeyondDragSize()?!1:!0};
wh.prototype.doMouseUp=function(){this.na&&(this.standardMouseSelect(),this.standardMouseClick());this.stopTool()};function xh(){0<arguments.length&&u.Wc(xh);xe.call(this);this.name="Action";this.Um=null}u.Ga(xh,xe);u.fa("ActionTool",xh);xh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a)return!1;var b=a.N,c=a.ke(b.da,function(a){for(;null!==a.S&&!a.pz;)a=a.S;return a},function(a){return a.pz});return null!==c?(this.Um=c,a.en=a.ke(b.da,null,null),!0):!1};
xh.prototype.doMouseDown=function(){if(this.na){var a=this.g.N,b=this.Um;null!==b&&(a.pe=b,null!==b.HC&&b.HC(a,b))}else this.canStart()&&this.doActivate()};xh.prototype.doMouseMove=function(){if(this.na){var a=this.g.N,b=this.Um;null!==b&&(a.pe=b,null!==b.IC&&b.IC(a,b))}};xh.prototype.doMouseUp=function(){if(this.na){var a=this.g,b=a.N,c=this.Um;if(null===c)return;b.pe=c;null!==c.JC&&c.JC(b,c);this.isBeyondDragSize()||zf(c,b,a)}this.stopTool()};
xh.prototype.doCancel=function(){var a=this.g;if(null!==a){var a=a.N,b=this.Um;if(null===b)return;a.pe=b;null!==b.GC&&b.GC(a,b)}this.stopTool()};xh.prototype.doStop=function(){this.Um=null};function va(){0<arguments.length&&u.Wc(va);xe.call(this);this.name="ClickCreating";this.ik=null;this.qB=!0;this.fB=new w(0,0)}u.Ga(va,xe);u.fa("ClickCreatingTool",va);
va.prototype.canStart=function(){if(!this.isEnabled||null===this.Oy)return!1;var a=this.g;if(null===a||a.nb||a.uf||!a.lo||!a.N.left||this.isBeyondDragSize())return!1;if(this.ZG){if(1===a.N.Te&&(this.fB=a.N.ff.copy()),2!==a.N.Te||this.isBeyondDragSize(this.fB))return!1}else if(1!==a.N.Te)return!1;return a.Va!==this&&null!==a.zs(a.N.da,!0)?!1:!0};va.prototype.doMouseUp=function(){var a=this.g;this.na&&null!==a&&this.insertPart(a.N.da);this.stopTool()};
va.prototype.insertPart=function(a){var b=this.g;if(null===b)return null;var c=this.Oy;if(null===c)return null;this.Wb(this.name);var d=null;c instanceof G?c.Fd()&&(nf(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.ga.copyNodeData(c),u.Sa(c)&&(b.ga.km(c),d=b.Nh(c)));null!==d&&(d.location=a,b.of&&b.select(d));b.pc();this.zf=this.name;b.za("PartCreated",d);this.Uj();return d};
u.defineProperty(va,{Oy:"archetypeNodeData"},function(){return this.ik},function(a){null!==a&&u.C(a,Object,va,"archetypeNodeData");this.ik=a});u.defineProperty(va,{ZG:"isDoubleClick"},function(){return this.qB},function(a){u.j(a,"boolean",va,"isDoubleClick");this.qB=a});function Hh(a,b,c){this.text=a;this.ZC=b;this.visible=c}function Ih(){0<arguments.length&&u.Wc(Ih);xe.call(this);this.name="ContextMenu";this.fn=this.OA=null;this.HB=new w;this.xx=this.on=null;Jh(this)}u.Ga(Ih,xe);
u.fa("ContextMenuTool",Ih);u.hD=!1;u.ms=null;u.ns=null;
function Jh(a){a.on=new lf;a.xC=function(){a.stopTool()};if(!1===u.hD){var b=u.createElement("div"),c=u.createElement("div");b.style.cssText="top: 0px;z-index:300;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";c.style.cssText="z-index:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);";var d=
u.createElement("style");window.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".defaultCXul { list-style: none; }",0);d.sheet.insertRule(".defaultCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".defaultCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},
!1);b.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);c.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);window.document.body&&(window.document.body.appendChild(b),window.document.body.appendChild(c));u.ns=b;u.ms=c;u.hD=!0}}Ih.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||this.isBeyondDragSize()||!a.N.right?!1:null!==this.on&&a.N.jl||null!==this.findObjectWithContextMenu()?!0:!1};
Ih.prototype.doStart=function(){var a=this.g;null!==a&&this.HB.set(a.wc.da)};Ih.prototype.doStop=function(){this.hideDefaultContextMenu();this.hideContextMenu();this.fn=null};
Ih.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return null;var c=b.N,d=null;a instanceof D||(d=a instanceof S?a:b.ke(c.da,null,function(a){return!a.layer.Ac}));if(null!==d){for(a=d;null!==a;){c=a.contextMenu;if(null!==c)return a;a=a.S}if(null!==this.on&&b.N.jl)return d.T}else if(c=b.contextMenu,null!==c)return b;return null};Ih.prototype.doActivate=function(){};
Ih.prototype.doMouseUp=function(){var a=this.g;null!==a&&(this.na?null!==this.Hf&&(a=a.ke(a.N.da,null,null),null!==a&&a.gl(this.Hf)&&this.standardMouseClick(null,null),this.stopTool()):this.canStart()&&xf(this,!0))};
function xf(a,b,c){void 0===c&&(c=null);a.na=!0;b&&a.standardMouseSelect();a.standardMouseClick();a.fn=null;null===c&&(c=a.findObjectWithContextMenu());null!==c?(b=c.contextMenu,null!==b?(a.fn=c instanceof S?c:null,a.showContextMenu(b,a.fn)):a.showDefaultContextMenu()):a.showDefaultContextMenu()}Ih.prototype.doMouseMove=function(){this.na&&this.standardMouseOver()};
Ih.prototype.showContextMenu=function(a,b){u.C(a,lf,Ih,"showContextMenu:contextmenu");null!==b&&u.C(b,S,Ih,"showContextMenu:obj");var c=this.g;if(null!==c){a!==this.Hf&&this.hideContextMenu();a.wf="Tool";a.pl=!1;a.scale=1/c.scale;a.Kc=this.name;c.add(a);if(null!==b){var c=null,d=b.zo();null!==d&&(c=d.data);a.vc=b;a.data=c}else a.data=c.ga;a.pf();this.positionContextMenu(a,b);this.Hf=a}};
Ih.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.g;if(null!==b){var c=b.N.da.copy(),d=a.Ba,e=b.ob;b.N.jl&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5);c.y<e.y&&(c.y=e.y);a.position=c}}};Ih.prototype.hideContextMenu=function(){var a=this.g;null!==a&&null!==this.Hf&&(this.Hf.data=null,this.Hf.vc=null,a.remove(this.Hf),this.Hf=null,this.standardMouseOver())};
Ih.prototype.initializeDefaultButtons=function(){if(null===this.g)return null;var a=new E(Hh);a.add(new Hh("Copy",function(a){a.Eb.copySelection()},function(a){return a.Eb.canCopySelection()}));a.add(new Hh("Cut",function(a){a.Eb.cutSelection()},function(a){return a.Eb.canCutSelection()}));a.add(new Hh("Delete",function(a){a.Eb.deleteSelection()},function(a){return a.Eb.canDeleteSelection()}));a.add(new Hh("Paste",function(a){a.Eb.pasteSelection(a.N.da)},function(a){return a.Eb.canPasteSelection()}));
a.add(new Hh("Select All",function(a){a.Eb.selectAll()},function(a){return a.Eb.canSelectAll()}));a.add(new Hh("Undo",function(a){a.Eb.undo()},function(a){return a.Eb.canUndo()}));a.add(new Hh("Redo",function(a){a.Eb.redo()},function(a){return a.Eb.canRedo()}));a.add(new Hh("Zoom To Fit",function(a){a.Eb.zoomToFit()},function(a){return a.Eb.canZoomToFit()}));a.add(new Hh("Reset Zoom",function(a){a.Eb.resetZoom()},function(a){return a.Eb.canResetZoom()}));a.add(new Hh("Group Selection",function(a){a.Eb.groupSelection()},
function(a){return a.Eb.canGroupSelection()}));a.add(new Hh("Ungroup Selection",function(a){a.Eb.ungroupSelection()},function(a){return a.Eb.canUngroupSelection()}));a.add(new Hh("Edit Text",function(a){a.Eb.editTextBlock()},function(a){return a.Eb.canEditTextBlock()}));return a};
Ih.prototype.showDefaultContextMenu=function(){var a=this.g;if(null!==a){null===this.xx&&(this.xx=this.initializeDefaultButtons());this.on!==this.Hf&&this.hideContextMenu();u.ns.innerHTML="";u.ms.addEventListener("click",this.xC,!1);var b=this,c=u.createElement("ul");c.className="defaultCXul";u.ns.appendChild(c);c.innerHTML="";for(var d=this.xx.i;d.next();){var e=d.value,f=e.text,h=e.visible;if("function"===typeof e.ZC&&("function"!==typeof h||h(a))){h=u.createElement("li");h.className="defaultCXli";
var k=u.createElement("a");k.className="defaultCXa";k.href="#";k.nF=e.ZC;k.addEventListener("click",function(c){this.nF(a);b.stopTool();c.preventDefault();return!1},!1);k.textContent=f;h.appendChild(k);c.appendChild(h)}}u.ns.style.display="block";u.ms.style.display="block";this.Hf=this.on}};Ih.prototype.hideDefaultContextMenu=function(){null!==this.Hf&&this.Hf===this.on&&(u.ns.style.display="none",u.ms.style.display="none",u.ms.removeEventListener("click",this.xC,!1),this.Hf=null)};
u.defineProperty(Ih,{Hf:"currentContextMenu"},function(){return this.OA},function(a){null!==a&&u.C(a,lf,Ih,"currentContextMenu");this.OA=a});u.defineProperty(Ih,{hJ:"currentObject"},function(){return this.fn},function(a){null!==a&&u.C(a,S,Ih,"currentObject");this.fn=a});u.u(Ih,{$J:"mouseDownPoint"},function(){return this.HB});
function Kh(){0<arguments.length&&u.Wc(Kh);xe.call(this);this.name="DragSelecting";this.pn=175;this.vB=!1;var a=new G;a.wf="Tool";a.pl=!1;var b=new X;b.name="SHAPE";b.Fb="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.zl=a}u.Ga(Kh,xe);u.fa("DragSelectingTool",Kh);
Kh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.of)return!1;var b=a.N;return!b.left||a.Va!==this&&(!this.isBeyondDragSize()||b.timestamp-a.wc.timestamp<this.iD||null!==a.zs(b.da,!0))?!1:!0};Kh.prototype.doActivate=function(){var a=this.g;null!==a&&(this.na=!0,a.Ge=!0,a.cb=!0,a.add(this.Tg),this.doMouseMove())};Kh.prototype.doDeactivate=function(){var a=this.g;null!==a&&(a.remove(this.Tg),a.cb=!1,this.na=a.Ge=!1)};
Kh.prototype.doMouseMove=function(){if(null!==this.g&&this.na&&null!==this.Tg){var a=this.computeBoxBounds(),b=this.Tg.je("SHAPE");null===b&&(b=this.Tg.If());b.xa=a.size;this.Tg.position=a.position}};Kh.prototype.doMouseUp=function(){if(this.na){var a=this.g;a.remove(this.Tg);try{a.ac="wait",this.selectInRect(this.computeBoxBounds())}finally{a.ac=""}}this.stopTool()};Kh.prototype.computeBoxBounds=function(){var a=this.g;return null===a?new z(0,0,0,0):new z(a.wc.da,a.N.da)};
Kh.prototype.selectInRect=function(a){var b=this.g;if(null!==b){var c=b.N;b.za("ChangingSelection");a=b.Nj(a,null,function(a){return a instanceof G?a.canSelect():!1},this.hH);if(u.Em?c.Ys:c.control)if(c.shift)for(a=a.i;a.next();)c=a.value,c.Za&&(c.Za=!1);else for(a=a.i;a.next();)c=a.value,c.Za=!c.Za;else{if(!c.shift){for(var c=new E(G),d=b.selection.i;d.next();){var e=d.value;a.contains(e)||c.add(e)}for(c=c.i;c.next();)c.value.Za=!1}for(a=a.i;a.next();)c=a.value,c.Za||(c.Za=!0)}b.za("ChangedSelection")}};
u.defineProperty(Kh,{iD:"delay"},function(){return this.pn},function(a){u.j(a,"number",Kh,"delay");this.pn=a});u.defineProperty(Kh,{hH:"isPartialInclusion"},function(){return this.vB},function(a){u.j(a,"boolean",Kh,"isPartialInclusion");this.vB=a});u.defineProperty(Kh,{Tg:"box"},function(){return this.zl},function(a){null!==a&&u.C(a,G,Kh,"box");this.zl=a});
function Lh(){0<arguments.length&&u.Wc(Lh);xe.call(this);this.name="Panning";this.ny=new w;this.Si=!1;var a=this;this.lC=function(){window.document.removeEventListener("scroll",a.lC,!1);a.stopTool()}}u.Ga(Lh,xe);u.fa("PanningTool",Lh);Lh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||!a.Re&&!a.Se||!a.N.left||a.Va!==this&&!this.isBeyondDragSize()?!1:!0};
Lh.prototype.doActivate=function(){var a=this.g;null!==a&&(this.Si?(a.N.bubbles=!0,window.document.addEventListener("scroll",this.lC,!1)):(a.ac="move",a.Ge=!0,this.ny=a.position.copy()),this.na=!0)};Lh.prototype.doDeactivate=function(){var a=this.g;null!==a&&(a.ac="",this.na=a.Ge=!1)};Lh.prototype.doCancel=function(){var a=this.g;null!==a&&(a.position=this.ny,a.Ge=!1);this.stopTool()};Lh.prototype.doMouseMove=function(){this.move()};Lh.prototype.doMouseUp=function(){this.move();this.stopTool()};
Lh.prototype.move=function(){var a=this.g;if(this.na&&a)if(this.Si)a.N.bubbles=!0;else{var b=a.position,c=a.wc.da,d=a.N.da,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.Re||(e=b.x);a.Se||(c=b.y);a.position=new w(e,c)}};u.defineProperty(Lh,{bubbles:"bubbles"},function(){return this.Si},function(a){u.j(a,"boolean",Lh,"bubbles");this.Si=a});u.u(Lh,{jK:"originalPosition"},function(){return this.ny});
function Mh(){0<arguments.length&&u.Wc(Mh);xe.call(this);this.name="TextEditing";this.pC=null;this.Qx=0;this.RA=this.pv=null;this.kC=Nh;this.Hk=null;this.Xa=Oh;this.Dk=null;this.EB=1;this.dC=!0;var a=u.createElement("textarea");a.AA=!0;this.WA=a;a.addEventListener("input",function(){var a=this.textEditingTool,c=a.pC;c.text=this.value;Ph(c,a.Qx,Infinity);this.rows=c.oH},!1);a.addEventListener("keydown",function(a){var c=a.which,d=this.textEditingTool;if(null!==d)if(13===c)!1===d.pv.iw&&a.preventDefault(),
d.acceptText(Qh);else{if(9===c)return d.acceptText(Rh),a.preventDefault(),!1;27===c&&(d.doCancel(),null!==d.g&&d.g.focus())}},!1);a.addEventListener("focus",function(){var a=this.textEditingTool;a.Xa===Sh?a.Xa=Th:a.Xa===Uh?a.Xa=Vh:a.Xa===Vh&&(a.Xa=Th);"function"===typeof this.select&&a.$z&&this.select()},!1);a.addEventListener("blur",function(){"function"===typeof this.focus&&this.focus();var a=this.textEditingTool;"function"===typeof this.select&&a.$z&&this.select()},!1)}u.fa("TextEditingTool",Mh);
u.Ga(Mh,xe);var Wh;Mh.LostFocus=Wh=u.s(Mh,"LostFocus",0);var Xh;Mh.MouseDown=Xh=u.s(Mh,"MouseDown",1);var Rh;Mh.Tab=Rh=u.s(Mh,"Tab",2);var Qh;Mh.Enter=Qh=u.s(Mh,"Enter",3);Mh.SingleClick=u.s(Mh,"SingleClick",0);var Nh;Mh.SingleClickSelected=Nh=u.s(Mh,"SingleClickSelected",1);var Oh=u.s(Mh,"StateNone",0),Sh=u.s(Mh,"StateActive",1),Th=u.s(Mh,"StateEditing",2),Vh=u.s(Mh,"StateEditing2",3),Yh=u.s(Mh,"StateValidating",4),Uh=u.s(Mh,"StateValidated",5);
u.defineProperty(Mh,{kh:"textBlock"},function(){return this.pv},function(a){null!==a&&u.C(a,qa,Mh,"textBlock");this.pv=a});u.defineProperty(Mh,{mg:"currentTextEditor"},function(){return this.RA},function(a){this.RA=a});u.defineProperty(Mh,{nG:"defaultTextEditor"},function(){return this.WA},function(a){u.C(a,Element,Mh,"defaultTextEditor");this.WA=a});u.defineProperty(Mh,{pI:"starting"},function(){return this.kC},function(a){u.rb(a,Mh,Mh,"starting");this.kC=a});
Mh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.nb||!a.N.left||this.isBeyondDragSize())return!1;a=a.ke(a.N.da,null,function(a){return a instanceof qa});if(null===a||!a.bz||!a.T.canEdit())return!1;a=a.T;return null===a||this.pI===Nh&&!a.Za?!1:!0};Mh.prototype.doStart=function(){this.na||null===this.kh||this.doActivate()};
Mh.prototype.doActivate=function(){if(!this.na){var a=this.g;if(null!==a){var b=this.kh;null===b&&(b=a.ke(a.N.da,function(a){return a instanceof qa?a:null}));if(null!==b){this.kh=b;var c=b.T;if(null!==c){this.na=!0;this.Xa=Sh;var d=this.nG,e=!1;null!==b.NE&&(d=b.NE);null===d||d.AA||(e=!0);this.pC=this.kh.copy();a.cI(c.ba);if(d.AA){var f=b.lb(Ib),h=a.position,k=a.scale,l=b.Hi()*k;l<this.YD&&(l=this.YD);this.Qx=b.Ha.width;var c=this.Qx*l,m=b.Ha.height*l,n=(f.x-h.x)*k,f=(f.y-h.y)*k;d.value=b.text;a.Vk.style.font=
b.font;d.style.font="inherit";d.style.fontSize=100*l+"%";d.style.lineHeight="normal";d.style.width=c+6+"px";d.style.height=m+2+"px";d.style.left=(n-c/2|0)-1+"px";d.style.top=(f-m/2|0)-1+"px";d.style.textAlign=b.textAlign;d.style.margin="0";d.style.padding="1px";d.style.border="0";d.style.outline="none";d.style["white-space"]="pre-wrap";d.style.overflow="hidden"}a.Vk.appendChild(d);d.style.position="absolute";d.style.zIndex=100;d.className="start";d.textEditingTool=this;d.BK=l;if(e&&"function"===typeof d.onActivate)d.onActivate();
this.mg=d;"function"===typeof d.focus&&d.focus();"function"===typeof d.select&&this.$z&&d.select()}}}}};Mh.prototype.doCancel=function(){null!==this.Dk&&(this.mg.style.border=this.Dk,this.Dk=null);this.stopTool()};Mh.prototype.doMouseUp=function(){!this.na&&this.canStart()&&this.doActivate()};Mh.prototype.doMouseDown=function(){this.na&&this.acceptText(Xh)};
Mh.prototype.acceptText=function(a){switch(a){case Xh:if(this.Xa===Uh||this.Xa===Vh)"function"===typeof this.mg.focus&&this.mg.focus();else if(this.Xa===Sh||this.Xa===Th)this.Xa=Yh,Zh(this);break;case Wh:case Qh:case Rh:if(Qh===a&&!0===this.pv.iw)break;if(this.Xa===Sh||this.Xa===Th)this.Xa=Yh,Zh(this)}};
function Zh(a){if(null!==a.kh&&null!==a.mg){var b=a.kh,c=a.kh.text,d=a.mg.value,e="",e="function"===typeof d?d():d;if(!a.isValidText(a.kh,c,e)){a.Xa=Th;null!==b.cz&&b.cz(a,c,e);null===a.Dk&&(a.Dk=a.mg.style.border,a.mg.style.border="3px solid red");"function"===typeof a.mg.focus&&a.mg.focus();return}a.Wb(a.name);a.Xa=Uh;c!==e&&(a.kh.text=e);a.zf=a.name;b=a.g;null!==b&&b.za("TextEdited",a.kh,c);a.Uj();a.stopTool();null!==b&&b.focus()}null!==a.Dk&&(a.mg.style.border=a.Dk,a.Dk=null)}
Mh.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.Xa=Oh;this.kh=null;if(null!==this.mg){var b=this.mg;if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.Vk.removeChild(b)}this.na=!1}};Mh.prototype.isValidText=function(a,b,c){u.C(a,qa,Mh,"isValidText:textblock");var d=this.jA;if(null!==d&&!d(a,b,c))return!1;d=a.jA;return null===d||d(a,b,c)?!0:!1};
u.defineProperty(Mh,{jA:"textValidation"},function(){return this.Hk},function(a){null!==a&&u.j(a,"function",Mh,"textValidation");this.Hk=a});u.defineProperty(Mh,{YD:"minimumEditorScale"},function(){return this.EB},function(a){null!==a&&u.j(a,"number",Mh,"minimumEditorScale");this.EB=a});u.defineProperty(Mh,{$z:"selectsTextOnActivate"},function(){return this.dC},function(a){null!==a&&u.j(a,"boolean",Mh,"selectsTextOnActivate");this.dC=a});
function jf(){xe.call(this);this.name="ToolManager";this.uF=new E(xe);this.vF=new E(xe);this.wF=new E(xe);this.jB=this.kB=1E3;this.ZA=(new ia(2,2)).Ka();this.au=this.vx=null;this.IB=Bf;this.hB=$h}u.Ga(jf,xe);u.fa("ToolManager",jf);var Bf;jf.WheelScroll=Bf=u.s(jf,"WheelScroll",0);var Af;jf.WheelZoom=Af=u.s(jf,"WheelZoom",1);jf.WheelNone=u.s(jf,"WheelNone",2);var $h;jf.GestureZoom=$h=u.s(jf,"GestureZoom",3);var ai;jf.GestureCancel=ai=u.s(jf,"GestureCancel",4);var bi;
jf.GestureNone=bi=u.s(jf,"GestureNone",5);u.defineProperty(jf,{$s:"mouseWheelBehavior"},function(){return this.IB},function(a){u.rb(a,jf,jf,"mouseWheelBehavior");this.IB=a});u.defineProperty(jf,{Bo:"gestureBehavior"},function(){return this.hB},function(a){u.rb(a,jf,jf,"gestureBehavior");this.hB=a});
jf.prototype.initializeStandardTools=function(){this.HF=new xh;this.iE=new Gf;this.rH=new fh;this.uE=new mh;this.$H=new uh;this.TD=new ta;this.Ed=new uf;this.uG=new Kh;this.JH=new Lh;this.Vy=new Ih;this.iA=new Mh;this.VF=new va;this.WF=new wh};
jf.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.N;b.jl&&this.Bo===ai&&(b.bubbles=!1);if(b.Ps){if(this.Bo===bi){b.bubbles=!0;return}if(this.Bo===ai)return;if(a.Va.canStartMultiTouch()){a.Va.standardPinchZoomStart();return}}b=a.ha;b.Ry&&0!==b.Le&&u.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var b=this.cf.length,c=0;c<b;c++){var d=this.cf.ja(c);null===d.g&&d.Ec(this.g);if(d.canStart()){a.Va=d;a.Va===d&&(d.na||d.doActivate(),d.doMouseDown());
return}}1===a.N.button&&(this.$s===Bf?this.$s=Af:this.$s===Af&&(this.$s=Bf));this.doActivate();this.standardWaitAfter(this.FD)}};
jf.prototype.doMouseMove=function(){var a=this.g;if(null!==a){var b=a.N;if(b.Ps){if(this.Bo===bi){b.bubbles=!0;return}if(this.Bo===ai)return;if(a.Va.canStartMultiTouch()){a.Va.standardPinchZoomMove();return}}if(this.na)for(var b=this.Mf.length,c=0;c<b;c++){var d=this.Mf.ja(c);null===d.g&&d.Ec(this.g);if(d.canStart()){a.Va=d;a.Va===d&&(d.na||d.doActivate(),d.doMouseMove());return}}this.standardMouseOver();this.isBeyondDragSize()&&this.standardWaitAfter(this.na?this.FD:this.QG)}};
jf.prototype.doCurrentObjectChanged=function(a,b){var c=this.Rk;null===c||null!==b&&(b===c||b.gl(c))||this.hideToolTip()};jf.prototype.doWaitAfter=function(){var a=this.g;null!==a&&a.ib&&(this.doMouseHover(),this.na||this.doToolTip())};jf.prototype.doMouseHover=function(){var a=this.g;if(null!==a){var b=a.N;null===b.pe&&(b.pe=a.ke(b.da,null,null));var c=b.pe;if(null!==c)for(b.Tc=!1;null!==c;){a=this.na?c.Dz:c.Ez;if(null!==a&&(a(b,c),b.Tc))break;c=c.S}else a=this.na?a.Dz:a.Ez,null!==a&&a(b)}};
jf.prototype.doToolTip=function(){var a=this.g;if(null!==a){var b=a.N;null===b.pe&&(b.pe=a.ke(b.da,null,null));b=b.pe;if(null!==b){if(b!==this.Rk&&!b.gl(this.Rk)){for(;null!==b;){a=b.lA;if(null!==a){this.showToolTip(a,b);return}b=b.S}this.hideToolTip()}}else a=a.lA,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
jf.prototype.showToolTip=function(a,b){u.C(a,lf,jf,"showToolTip:tooltip");null!==b&&u.C(b,S,jf,"showToolTip:obj");var c=this.g;if(null!==c){a!==this.Rk&&this.hideToolTip();a.wf="Tool";a.pl=!1;a.scale=1/c.scale;c.add(a);if(null!==b&&b!==this.au){var c=null,d=b.zo();null!==d&&(c=d.data);a.vc=b;a.data=c}else null===b&&(a.data=c.ga);if(null===b||b!==this.au)a.pf(),this.positionToolTip(a,b);this.vx=a;this.au=b}};
jf.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.g;if(null!==b){var c=b.N.da.copy(),d=a.Ba,e=b.ob;b.N.jl&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y=c.y+20+d.height>e.bottom?c.y-(d.height+5):c.y+20;c.y<e.y&&(c.y=e.y);a.position=c}}};jf.prototype.hideToolTip=function(){if(null!==this.Rk){var a=this.g;null!==a&&(this.Rk.data=null,this.Rk.vc=null,a.remove(this.Rk),this.au=this.vx=null)}};u.u(jf,{Rk:"currentToolTip"},function(){return this.vx});
jf.prototype.doMouseUp=function(){this.cancelWaitAfter();if(this.na){var a=this.g;if(null===a)return;for(var b=this.Nf.length,c=0;c<b;c++){var d=this.Nf.ja(c);null===d.g&&d.Ec(this.g);if(d.canStart()){a.Va=d;a.Va===d&&(d.na||d.doActivate(),d.doMouseUp());return}}}this.doDeactivate()};jf.prototype.doMouseWheel=function(){this.standardMouseWheel()};jf.prototype.doKeyDown=function(){var a=this.g;null!==a&&a.Eb.doKeyDown()};jf.prototype.doKeyUp=function(){var a=this.g;null!==a&&a.Eb.doKeyUp()};
jf.prototype.doCancel=function(){null!==Ef&&Ef.doCancel();xe.prototype.doCancel.call(this)};jf.prototype.findTool=function(a){u.j(a,"string",jf,"findTool:name");for(var b=this.cf.length,c=0;c<b;c++){var d=this.cf.ja(c);if(d.name===a)return d}b=this.Mf.length;for(c=0;c<b;c++)if(d=this.Mf.ja(c),d.name===a)return d;b=this.Nf.length;for(c=0;c<b;c++)if(d=this.Nf.ja(c),d.name===a)return d;return null};
jf.prototype.replaceTool=function(a,b){u.j(a,"string",jf,"replaceTool:name");null!==b&&(u.C(b,xe,jf,"replaceTool:newtool"),b.g&&b.g!==this.g&&u.k("Cannot share tools between Diagrams: "+b.toString()),b.Ec(this.g));for(var c=this.cf.length,d=0;d<c;d++){var e=this.cf.ja(d);if(e.name===a)return null!==b?this.cf.Bg(d,b):this.cf.hd(d),e}c=this.Mf.length;for(d=0;d<c;d++)if(e=this.Mf.ja(d),e.name===a)return null!==b?this.Mf.Bg(d,b):this.Mf.hd(d),e;c=this.Nf.length;for(d=0;d<c;d++)if(e=this.Nf.ja(d),e.name===
a)return null!==b?this.Nf.Bg(d,b):this.Nf.hd(d),e;return null};function ci(a,b,c,d){u.j(b,"string",jf,"replaceStandardTool:name");u.C(d,E,jf,"replaceStandardTool:list");null!==c&&(u.C(c,xe,jf,"replaceStandardTool:newtool"),c.g&&c.g!==a.g&&u.k("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.Ec(a.g));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}u.u(jf,{cf:"mouseDownTools"},function(){return this.uF});u.u(jf,{Mf:"mouseMoveTools"},function(){return this.vF});
u.u(jf,{Nf:"mouseUpTools"},function(){return this.wF});u.defineProperty(jf,{QG:"hoverDelay"},function(){return this.kB},function(a){u.j(a,"number",jf,"hoverDelay");this.kB=a});u.defineProperty(jf,{FD:"holdDelay"},function(){return this.jB},function(a){u.j(a,"number",jf,"holdDelay");this.jB=a});u.defineProperty(jf,{vG:"dragSize"},function(){return this.ZA},function(a){u.C(a,ia,jf,"dragSize");this.ZA=a.Z()});
u.defineProperty(jf,{HF:"actionTool"},function(){return this.findTool("Action")},function(a){ci(this,"Action",a,this.cf)});u.defineProperty(jf,{iE:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){ci(this,"Relinking",a,this.cf)});u.defineProperty(jf,{rH:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){ci(this,"LinkReshaping",a,this.cf)});
u.defineProperty(jf,{uE:"resizingTool"},function(){return this.findTool("Resizing")},function(a){ci(this,"Resizing",a,this.cf)});u.defineProperty(jf,{$H:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){ci(this,"Rotating",a,this.cf)});u.defineProperty(jf,{TD:"linkingTool"},function(){return this.findTool("Linking")},function(a){ci(this,"Linking",a,this.Mf)});
u.defineProperty(jf,{Ed:"draggingTool"},function(){return this.findTool("Dragging")},function(a){ci(this,"Dragging",a,this.Mf)});u.defineProperty(jf,{uG:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){ci(this,"DragSelecting",a,this.Mf)});u.defineProperty(jf,{JH:"panningTool"},function(){return this.findTool("Panning")},function(a){ci(this,"Panning",a,this.Mf)});
u.defineProperty(jf,{Vy:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){ci(this,"ContextMenu",a,this.Nf)});u.defineProperty(jf,{iA:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){ci(this,"TextEditing",a,this.Nf)});u.defineProperty(jf,{VF:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){ci(this,"ClickCreating",a,this.Nf)});
u.defineProperty(jf,{WF:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){ci(this,"ClickSelecting",a,this.Nf)});function Te(){this.pF=di;this.Fl=this.Gl=this.Y=null;this.CA=this.ld=this.Fn=this.dj=!1;this.Ne=!0;this.$t=this.Zt=this.PA=null;this.tx=0;this.Ex=600;this.yF=new w(0,0);this.EA=this.DA=this.BC=!1;this.Sn=new la(S,ei)}u.fa("AnimationManager",Te);Te.prototype.Ec=function(a){this.Y=a};function di(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}
Te.prototype.prepareAnimation=Te.prototype.ml=function(){this.Ne&&(this.dj&&this.Mi(),this.ld=!0,this.CA=!1)};function fi(a){a.Ne&&requestAnimationFrame(function(){!1===a.ld||a.dj||(a.Y.im=1,gi(a.Y),a.ld=!1,a.Y.za("AnimationStarting"),hi(a))})}function ii(a,b,c,d,e){if(a.ld&&(!(b instanceof G)||b.JD)){var f=a.Sn;if(f.contains(b)){b=f.ta(b);a=b.start;var h=b.end;void 0===a[c]&&(a[c]=ji(d));h[c]=ji(e)}else a=new pa,h=new pa,a[c]=ji(d),h[c]=ji(e),f.add(b,new ei(a,h))}}
function ji(a){return a instanceof w?a.copy():a instanceof ia?a.copy():a}
function hi(a){var b;void 0===b&&(b=new pa);var c=a.Y;if(null!==c)if(0===a.Sn.count)a.dj=!1,ki(c,!1),c.bf();else{a.dj=!0;var d=b.wJ||a.pF,e=b.cK||null,f=b.dK||null,h=b.duration||a.Ex;b=a.yF;for(var k=a.Sn.i;k.next();){var l=k.value.start.position;l instanceof w&&(l.J()||l.assign(b))}a.PA=d;a.Zt=e;a.$t=f;a.tx=h;var m=a.oF=a.Sn;li(a);mi(a,c,m,d,0,h,null!==a.Gl&&null!==a.Fl);Dg(a.Y);ni(a);requestAnimationFrame(function(b){var e=b||+new Date,f=e+h;(function s(b){if(!1!==a.dj){b=b||+new Date;var k=b>f?
h:b-e;li(a);mi(a,c,m,d,k,h,null!==a.Gl&&null!==a.Fl);a.Zt&&a.Zt();Dg(c);ni(a);b>f?oi(a):requestAnimationFrame(s)}})(e)})}}var pi={opacity:function(a,b,c,d,e,f){a.opacity=d(e,b,c-b,f)},position:function(a,b,c,d,e,f){e!==f?a.GE(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):a.position=new w(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},scale:function(a,b,c,d,e,f){a.scale=d(e,b,c-b,f)},visible:function(a,b,c,d,e,f){a.visible=e!==f?b:c}};
function li(a){if(!a.Fn){var b=a.Y;a.BC=b.cb;a.DA=b.Iw;a.EA=b.tt;b.cb=!0;b.Iw=!0;b.tt=!0;a.Fn=!0}}function ni(a){var b=a.Y;b.cb=a.BC;b.Iw=a.DA;b.tt=a.EA;a.Fn=!1}function mi(a,b,c,d,e,f,h){for(c=c.i;c.next();){var k=c.key,l=c.value,m=l.start,l=l.end,n;for(n in l)if(void 0!==pi[n])pi[n](k,m[n],l[n],d,e,f)}h&&(h=a.Gl,a=a.Fl,n=a.y-h.y,a=d(e,h.x,a.x-h.x,f),d=d(e,h.y,n,f),e=b.qz,b.qz=!0,b.position=new w(a,d),b.qz=e)}
Te.prototype.stopAnimation=Te.prototype.Mi=function(){!0===this.ld&&(this.ld=!1,this.CA&&this.Y.de());this.dj&&this.Ne&&(li(this),mi(this,this.Y,this.oF,this.PA,this.tx,this.tx,null!==this.Gl&&null!==this.Fl),ni(this),oi(this))};function oi(a){a.dj=!1;a.Gl=null;a.Fl=null;a.Sn=new la(S,ei);li(a);for(var b=a.Y.links;b.next();){var c=b.value;null!==c.Xn&&(c.points=c.Xn,c.Xn=null)}b=a.Y;ki(b,!1);b.pc();b.bf();qi(b);ni(a);a.$t&&a.$t();a.$t=null;a.Zt=null;b.za("AnimationFinished");b.de()}
function ri(a,b,c){var d=b.ba,e=c.ba,f=null;c instanceof V&&(f=c.placeholder);null!==f?(c=f.lb(xb),c.x+=f.padding.left,c.y+=f.padding.top,ii(a,b,"position",c,b.position)):ii(a,b,"position",new w(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position);ii(a,b,"opacity",.01,b.opacity)}function si(a,b,c){a.ld&&(null===a.Gl&&b.J()&&null===a.Fl&&(a.Gl=b.copy()),a.Fl=c.copy())}
u.defineProperty(Te,{isEnabled:"isEnabled"},function(){return this.Ne},function(a){u.j(a,"boolean",Te,"isEnabled");this.Ne=a});u.defineProperty(Te,{duration:"duration"},function(){return this.Ex},function(a){u.j(a,"number",Te,"duration");1>a&&u.wa(a,">= 1",Te,"duration");this.Ex=a});u.u(Te,{Vg:"isAnimating"},function(){return this.dj});u.u(Te,{HJ:"isTicking"},function(){return this.Fn});function ei(a,b){this.start=a;this.end=b}
function we(){0<arguments.length&&u.Wc(we);u.gc(this);this.Y=null;this.Db=new E(G);this.Ub="";this.Ic=1;this.Wx=!1;this.Fk=this.Iy=this.fk=this.ek=this.dk=this.ck=this.ak=this.bk=this.$j=this.hk=this.Zj=this.gk=this.Yj=this.Xj=!0;this.Rx=!1;this.Uu=[]}u.fa("Layer",we);we.prototype.Ec=function(a){this.Y=a};
we.prototype.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,h=0,k=this.Db.i;k.next();){var l=k.value;l instanceof V?e++:l instanceof U?d++:l instanceof W?f++:l instanceof lf?h++:c++}k="";0<c&&(k+=c+" Parts ");0<d&&(k+=d+" Nodes ");0<e&&(k+=e+" Groups ");0<f&&(k+=f+" Links ");0<h&&(k+=h+" Adornments ");if(1<a)for(a=this.Db.i;a.next();)c=a.value,k+="\n    "+c.toString(),d=c.data,null!==d&&u.Uc(d)&&(k+=" #"+u.Uc(d)),c instanceof U?k+=" "+
de(d):c instanceof W&&(k+=" "+de(c.W)+" "+de(c.ca));return b+" "+this.Db.count+": "+k};we.prototype.findObjectAt=we.prototype.ke=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.Fk)return null;var d=!1;this.g.ob.Aa(a)&&(d=!0);for(var e=u.K(),f=this.Db.n,h=f.length;h--;){var k=f[h];if((!0!==d||!1!==ti(k))&&k.Ea()&&(e.assign(a),Wa(e,k.Ff),k=k.ke(e,b,c),null!==k&&(null!==b&&(k=b(k)),null!==k&&(null===c||c(k)))))return u.v(e),k}u.v(e);return null};
we.prototype.findObjectsAt=we.prototype.ys=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof E||d instanceof F||(d=new F(S));if(!1===this.Fk)return d;var e=!1;this.g.ob.Aa(a)&&(e=!0);for(var f=u.K(),h=this.Db.n,k=h.length;k--;){var l=h[k];!0===e&&!1===ti(l)||!l.Ea()||(f.assign(a),Wa(f,l.Ff),l.ys(f,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l)))}u.v(f);return d};
we.prototype.findObjectsIn=we.prototype.Nj=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof E||e instanceof F||(e=new F(S));if(!1===this.Fk)return e;var f=!1;this.g.ob.Kj(a)&&(f=!0);for(var h=this.Db.n,k=h.length;k--;){var l=h[k];(!0!==f||!1!==ti(l))&&l.Ea()&&l.Nj(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}return e};
we.prototype.dz=function(a,b,c,d,e,f,h){if(!1===this.Fk)return e;for(var k=this.Db.n,l=k.length;l--;){var m=k[l];(!0!==h||!1!==ti(m))&&f(m)&&m.Ea()&&m.Nj(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}return e};
we.prototype.findObjectsNear=we.prototype.ym=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof E||e instanceof F)f=e;e=!0}f instanceof E||f instanceof F||(f=new F(S));if(!1===this.Fk)return f;var h=!1;this.g.ob.Aa(a)&&(h=!0);for(var k=u.K(),l=u.K(),m=this.Db.n,n=m.length;n--;){var p=m[n];!0===h&&!1===ti(p)||!p.Ea()||(k.assign(a),Wa(k,p.Ff),l.m(a.x+b,a.y),Wa(l,p.Ff),p.ym(k,l,c,d,e,f)&&(null!==c&&(p=c(p)),null===p||null!==d&&!d(p)||
f.add(p)))}u.v(k);u.v(l);return f};g=we.prototype;g.xf=function(a,b){if(this.visible){var c;c=void 0===b?a.ob:b;for(var d=this.Db.n,e=d.length,f=0;f<e;f++){var h=d[f];h.BB=f;if(!(h instanceof W&&!1===h.hg)){if(h instanceof lf){var k=h;if(null!==k.Kh)continue}if(jb(h.ba,c))for(h.xf(!0),ui(h),h=h.zv;h.next();)k=h.value,Ph(k,Infinity,Infinity),k.zc(),k.xf(!0);else h.xf(!1),null!==h.zv&&0<h.zv.count&&ui(h)}}}};
g.We=function(a,b,c,d){if(this.visible&&0!==this.Ic&&(void 0===d&&(d=!0),d||!this.Ac)){1!==this.Ic&&(a.globalAlpha=this.Ic);c=this.Uu;c.length=0;d=b.scale;for(var e=this.Db.n,f=e.length,h=0;h<f;h++){var k=e[h];if(ti(k)||vi(k)){if(k instanceof W){var l=k;l.dc&&c.push(l);if(!1===l.hg)continue}l=k.ba;1<l.width*d||1<l.height*d?k.We(a,b):wi(k,a)}}a.globalAlpha=1}};
function xi(a,b,c,d){if(a.visible&&0!==a.Ic){1!==a.Ic&&(b.globalAlpha=a.Ic);var e=a.Uu;e.length=0;var f=c.scale;a=a.Db.n;for(var h=a.length,k=d.length,l=0;l<h;l++){var m=a[l];if(ti(m)||vi(m)){if(m instanceof W){var n=m;n.dc&&e.push(n);if(!1===n.hg)continue}var n=yi(m,m.ba),p;a:{p=n;for(var q=d,r=k,s=2/f,t=4/f,v=0;v<r;v++){var x=q[v];if(0!==x.width&&0!==x.height&&p.HD(x.x-s,x.y-s,x.width+t,x.height+t)){p=!0;break a}}p=!1}p&&(1<n.width*f||1<n.height*f?m.We(b,c):wi(m,b))}}b.globalAlpha=1}}
g.h=function(a,b,c,d,e){var f=this.g;null!==f&&f.Dc($d,a,this,b,c,d,e)};g.Eo=function(a,b,c){var d=this.Db;b.Bu=this;if(a>=d.count)a=d.count;else if(d.ja(a)===b)return-1;d.Yd(a,b);b.Js(c);d=this.g;null!==d&&(c?d.ma():d.Eo(b));b instanceof V&&this.Jw(b);return a};
g.Fe=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Fe(a,b,c);var d=this.Db;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.ja(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Ks(c);d.hd(a);d=this.g;null!==d&&(c?d.ma():d.Fe(b));b.Bu=null;return a};
g.Jw=function(a){for(;null!==a;){if(a.layer===this){var b=a;if(0!==b.Mc.count){for(var c=-1,d=-1,e=this.Db.n,f=e.length,h=0;h<f;h++){var k=e[h];if(k===b&&(c=h,0<=d))break;if(0>d&&k.Ra===b&&(d=h,0<=c))break}!(0>d)&&d<c&&(e=this.Db,e.hd(c),e.Yd(d,b))}}a=a.Ra}};g.clear=function(){for(var a=this.Db.Ke(),b=a.length,c=0;c<b;c++)a[c].xf(!1),this.Fe(-1,a[c],!1)};u.u(we,{Sj:"parts"},function(){return this.Db.i});u.u(we,{mK:"partsBackwards"},function(){return this.Db.Fm});u.u(we,{g:"diagram"},function(){return this.Y});
u.defineProperty(we,{name:"name"},function(){return this.Ub},function(a){u.j(a,"string",we,"name");var b=this.Ub;if(b!==a){var c=this.g;if(null!==c)for(""===b&&u.k("Cannot rename default Layer to: "+a),c=c.mw;c.next();)c.value.name===a&&u.k("Layer.name is already present in this diagram: "+a);this.Ub=a;this.h("name",b,a);for(a=this.Db.i;a.next();)a.value.wf=this.Ub}});
u.defineProperty(we,{opacity:"opacity"},function(){return this.Ic},function(a){var b=this.Ic;b!==a&&(u.j(a,"number",we,"opacity"),(0>a||1<a)&&u.wa(a,"0 <= value <= 1",we,"opacity"),this.Ic=a,this.h("opacity",b,a),a=this.g,null!==a&&a.ma())});u.defineProperty(we,{Ac:"isTemporary"},function(){return this.Wx},function(a){var b=this.Wx;b!==a&&(u.j(a,"boolean",we,"isTemporary"),this.Wx=a,this.h("isTemporary",b,a))});
u.defineProperty(we,{visible:"visible"},function(){return this.Iy},function(a){var b=this.Iy;if(b!==a){u.j(a,"boolean",we,"visible");this.Iy=a;this.h("visible",b,a);for(b=this.Db.i;b.next();)b.value.He(a);a=this.g;null!==a&&a.ma()}});u.defineProperty(we,{Ag:"pickable"},function(){return this.Fk},function(a){var b=this.Fk;b!==a&&(u.j(a,"boolean",we,"pickable"),this.Fk=a,this.h("pickable",b,a))});
u.defineProperty(we,{KD:"isBoundsIncluded"},function(){return this.Rx},function(a){this.Rx!==a&&(this.Rx=a,null!==this.g&&this.g.pc())});u.defineProperty(we,{Ij:"allowCopy"},function(){return this.Xj},function(a){var b=this.Xj;b!==a&&(u.j(a,"boolean",we,"allowCopy"),this.Xj=a,this.h("allowCopy",b,a))});u.defineProperty(we,{lm:"allowDelete"},function(){return this.Yj},function(a){var b=this.Yj;b!==a&&(u.j(a,"boolean",we,"allowDelete"),this.Yj=a,this.h("allowDelete",b,a))});
u.defineProperty(we,{Ev:"allowTextEdit"},function(){return this.gk},function(a){var b=this.gk;b!==a&&(u.j(a,"boolean",we,"allowTextEdit"),this.gk=a,this.h("allowTextEdit",b,a))});u.defineProperty(we,{Bv:"allowGroup"},function(){return this.Zj},function(a){var b=this.Zj;b!==a&&(u.j(a,"boolean",we,"allowGroup"),this.Zj=a,this.h("allowGroup",b,a))});
u.defineProperty(we,{Fv:"allowUngroup"},function(){return this.hk},function(a){var b=this.hk;b!==a&&(u.j(a,"boolean",we,"allowUngroup"),this.hk=a,this.h("allowUngroup",b,a))});u.defineProperty(we,{gs:"allowLink"},function(){return this.$j},function(a){var b=this.$j;b!==a&&(u.j(a,"boolean",we,"allowLink"),this.$j=a,this.h("allowLink",b,a))});
u.defineProperty(we,{mm:"allowRelink"},function(){return this.bk},function(a){var b=this.bk;b!==a&&(u.j(a,"boolean",we,"allowRelink"),this.bk=a,this.h("allowRelink",b,a))});u.defineProperty(we,{Nk:"allowMove"},function(){return this.ak},function(a){var b=this.ak;b!==a&&(u.j(a,"boolean",we,"allowMove"),this.ak=a,this.h("allowMove",b,a))});
u.defineProperty(we,{Cv:"allowReshape"},function(){return this.ck},function(a){var b=this.ck;b!==a&&(u.j(a,"boolean",we,"allowReshape"),this.ck=a,this.h("allowReshape",b,a))});u.defineProperty(we,{hs:"allowResize"},function(){return this.dk},function(a){var b=this.dk;b!==a&&(u.j(a,"boolean",we,"allowResize"),this.dk=a,this.h("allowResize",b,a))});
u.defineProperty(we,{Dv:"allowRotate"},function(){return this.ek},function(a){var b=this.ek;b!==a&&(u.j(a,"boolean",we,"allowRotate"),this.ek=a,this.h("allowRotate",b,a))});u.defineProperty(we,{of:"allowSelect"},function(){return this.fk},function(a){var b=this.fk;b!==a&&(u.j(a,"boolean",we,"allowSelect"),this.fk=a,this.h("allowSelect",b,a))});
function D(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);Li(c)}1<arguments.length&&u.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");u.gc(this);Mi=[];this.sc=!0;this.Uh=new Te;this.Uh.Ec(this);this.zd=17;var c=this;null!==window.document.body?Li(this):window.document.addEventListener("DOMContentLoaded",b,!1);this.wB=!1;this.Zb=new E(we);this.zb=this.Ab=0;this.Qg=this.Jb=this.Gg=this.ib=null;this.qE();this.dq=null;this.pE();
this.Ma=(new w(NaN,NaN)).freeze();this.$b=1;this.tu=(new w(NaN,NaN)).freeze();this.uu=NaN;this.Ku=1E-4;this.Hu=100;this.Sd=new ja;this.wv=(new w(NaN,NaN)).freeze();this.ku=(new z(NaN,NaN,NaN,NaN)).freeze();this.vy=(new rb(0,0,0,0)).freeze();this.wy=Ni;this.qy=this.oy=null;this.xl=vf;this.dn=uc;this.tk=vf;this.An=uc;this.vu=this.su=xb;this.Xf=new F(S);this.Md=!0;this.fq=!1;this.El=new la(W,z);this.qn=!0;this.lF=250;this.Zm=-1;this.Qt=(new rb(16,16,16,16)).freeze();this.du=this.Ef=!1;this.un=!0;this.nk=
new Md;this.Jc=new Md;this.Ob=new Md;this.Ui=null;this.lv=-1;this.kv=!1;this.Ax=this.Bx=null;Oi(this);this.Rn=new F(U);this.Ik=new F(V);this.Nn=new F(W);this.Db=new F(G);this.yu=!0;this.mB=!1;this.sv=Hg;this.gj=10;this.ux=this.yx=this.Fy=null;this.sx="";this.Pp="auto";this.Zh=this.ti=this.ji=this.Nu=this.ki=this.li=this.mi=this.Yh=this.ci=this.Wh=null;this.yn=!0;this.iy=!1;this.WB={};this.hr=0;this.Df=[null,null];this.ix=null;this.zu=this.Vm=this.zx=this.xy=this.eC=this.qi=!1;this.yB=!0;this.Tx=this.vd=
!1;this.Od=null;var d=this;this.FB=function(a){if(a.ga===d.ga&&d.Na){d.Na=!1;try{var b=a.Ad;""===a.Lf&&b===$d&&Pi(d,a.object,a.propertyName)}finally{d.Na=!0}}};this.GB=function(a){Qi(d,a)};this.DC=!0;this.Ig=-2;this.$h=new la(Object,G);this.lk=new la(Object,W);this.Ml=new la(Object,Array);this.Tn=new la("string",Array);this.VB=new E(Ri);this.vk=!1;this.Yj=this.Xj=this.Gt=this.Ne=!0;this.It=this.Ht=!1;this.Nt=this.Lt=this.fk=this.ek=this.dk=this.ck=this.ak=this.bk=this.$j=this.Kt=this.hk=this.Zj=this.gk=
!0;this.Jl=this.uB=!1;this.Mt=this.Jt=this.qu=this.pu=!0;this.av=this.$u=16;this.sy=this.Zu=!1;this.uy=this.ty=this.vj=this.uj=null;this.Pe=(new rb(5)).freeze();this.dv=(new F(G)).freeze();this.Iu=999999999;this.ru=(new F(G)).freeze();this.uk=this.Hl=this.ei=!0;this.rk=this.qk=!1;this.Nd=null;this.Ot=!0;this.lf=!1;this.md=null;this.MB=1;this.Lx=!1;this.iC=0;this.CC=(new z(NaN,NaN,NaN,NaN)).freeze();this.eu=(new z(NaN,NaN,NaN,NaN)).freeze();this.Ul=new F(Si);Ti(this);this.Du=this.mu=this.Pu=this.TA=
this.SA=this.UA=this.hj=this.ok=this.ni=null;Ui(this);this.ad=null;this.lu=!1;this.en=null;this.tb=new jf;this.tb.initializeStandardTools();this.Va=this.$y=this.tb;this.Eb=new sa;this.ga=new Q;this.qi=!0;this.Qb=new Je;this.qi=!1;this.dB=this.Dx=null;this.nf=1;this.im=null;this.sk=new Vi;void 0!==a&&Wi(this,a);this.Ol=1;this.Pl=0;this.AB=new w;this.zC=500;this.Pt=new w;this.Ir=null;this.sc=this.Xx=!1}u.fa("Diagram",D);
function Ui(a){a.ni=new la("string",G);var b=new U,c=new qa;c.bind(new bf("text","",de));b.add(c);a.UA=b;a.ni.add("",b);b=new U;c=new qa;c.stroke="brown";c.bind(new bf("text","",de));b.add(c);a.ni.add("Comment",b);b=new U;b.pl=!1;b.TC=!1;c=new X;c.Fb="Ellipse";c.fill="black";c.stroke=null;c.xa=(new ia(3,3)).Ka();b.add(c);a.ni.add("LinkLabel",b);a.ok=new la("string",V);b=new V;b.Zz="GROUPPANEL";b.type=Xi;c=new qa;c.font="bold 12pt sans-serif";c.bind(new bf("text","",de));b.add(c);c=new A(Yi);c.name=
"GROUPPANEL";var d=new X;d.Fb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new ph;d.padding=(new rb(5,5,5,5)).Ka();c.add(d);b.add(c);a.SA=b;a.ok.add("",b);a.hj=new la("string",W);b=new W;c=new X;c.tg=!0;b.add(c);c=new X;c.jp="Standard";c.fill="black";c.stroke=null;c.hb=0;b.add(c);a.TA=b;a.hj.add("",b);b=new W;c=new X;c.tg=!0;c.stroke="brown";b.add(c);a.hj.add("Comment",b);b=new lf;b.type=Yi;c=new X;c.fill=null;c.stroke="dodgerblue";c.hb=3;b.add(c);c=new ph;c.margin=(new rb(1.5,
1.5,1.5,1.5)).Ka();b.add(c);a.Pu=b;a.mu=b;b=new lf;b.type=ah;c=new X;c.tg=!0;c.fill=null;c.stroke="dodgerblue";c.hb=3;b.add(c);a.Du=b}
function Li(a){var b=u.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=u.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.style.boxSizing="content-box";c.appendChild(b);window.document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);window.document.body.removeChild(c);a.zd=d-b}
D.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.id&&(b=this.id);this.Vk&&this.Vk.id&&(b=this.Vk.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.Zb.i;c.next();)b+="\n  "+c.value.toString(a-1);return b};D.prototype.checkProperties=function(){return u.check(this)};D.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Y instanceof D?b.Y:null};
u.defineProperty(D,{Vk:"div"},function(){return this.Jb},function(a){null!==a&&u.C(a,HTMLDivElement,D,"div");if(this.Jb!==a){Mi=[];var b=this.Jb;null!==b?(b.Y=void 0,b.innerHTML="",null!==this.ib&&(this.ib.removeEventListener("touchstart",this.SE,!1),this.ib.removeEventListener("touchmove",this.RE,!1),this.ib.removeEventListener("touchend",this.QE,!1),this.ib.Dd.Y=null),b=this.tb,null!==b&&(b.cf.each(function(a){a.cancelWaitAfter()}),b.Mf.each(function(a){a.cancelWaitAfter()}),b.Nf.each(function(a){a.cancelWaitAfter()})),
b.cancelWaitAfter(),this.Va.doCancel(),this.Gg=this.ib=null,window.removeEventListener("resize",this.aF,!1),window.removeEventListener("mousemove",this.Qo,!0),window.removeEventListener("mousedown",this.Po,!0),window.removeEventListener("mouseup",this.So,!0),window.removeEventListener("mousewheel",this.Zg,!0),window.removeEventListener("DOMMouseScroll",this.Zg,!0),window.removeEventListener("mouseout",this.Ro,!0)):this.lf=!1;this.Jb=null;if(null!==a){if(b=a.Y)b.Vk=null;Wi(this,a);this.Sz()}}});
function Zi(a){var b=a.ib;b.addEventListener("touchstart",a.SE,!1);b.addEventListener("touchmove",a.RE,!1);b.addEventListener("touchend",a.QE,!1);b.addEventListener("mousemove",a.Qo,!1);b.addEventListener("mousedown",a.Po,!1);b.addEventListener("mouseup",a.So,!1);b.addEventListener("mousewheel",a.Zg,!1);b.addEventListener("DOMMouseScroll",a.Zg,!1);b.addEventListener("mouseout",a.Ro,!1);b.addEventListener("keydown",a.kH,!1);b.addEventListener("keyup",a.lH,!1);b.addEventListener("selectstart",function(a){a.preventDefault();
return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.tb.Bo===ai&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.KH,!1);b.addEventListener("pointermove",a.MH,!1);b.addEventListener("pointerleave",a.LH,!1);window.addEventListener("resize",a.aF,!1)}function ki(a,b){a.im=null;b&&a.hE()}
D.prototype.computePixelRatio=function(){if(null!==this.im)return this.im;var a=this.Gg;return(window.devicePixelRatio||1)/(a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1)};D.prototype.doMouseMove=function(){this.Va.doMouseMove()};D.prototype.doMouseDown=function(){this.Va.doMouseDown()};D.prototype.doMouseUp=function(){this.Va.doMouseUp()};D.prototype.doMouseWheel=function(){this.Va.doMouseWheel()};
D.prototype.doKeyDown=function(){this.Va.doKeyDown()};D.prototype.doKeyUp=function(){this.Va.doKeyUp()};function gi(a){if(null!==a.ib){var b=a.Jb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.rk?a.zd:0,d=a.qk?a.zd:0,e=a.nf;a.nf=a.computePixelRatio();a.nf!==e&&(a.fq=!0,a.de());if(b.clientWidth!==a.Ab+c||b.clientHeight!==a.zb+d)a.Hl=!0,a.Md=!0,b=a.Qb,null!==b&&b.jw&&b.H(),a.vd||a.de()}}}D.prototype.focus=D.prototype.focus=function(){this.ib&&this.ib.focus()};
function $i(a,b,c){void 0===b&&(b=a.Gg);void 0===c&&(c=!0);c&&(b.Et="");b.Tm="";b.Sm=""}function Ti(a){var b=new we;b.name="Background";a.cs(b);b=new we;b.name="";a.cs(b);b=new we;b.name="Foreground";a.cs(b);b=new we;b.name="Adornment";b.Ac=!0;a.cs(b);b=new we;b.name="Tool";b.Ac=!0;b.KD=!0;a.cs(b);b=new we;b.name="Grid";b.of=!1;b.Ag=!1;b.Ac=!0;a.LF(b,a.ws("Background"))}
function aj(a){a.ad=new A(bj);a.ad.name="GRID";var b=new X;b.Fb="LineH";b.stroke="lightgray";b.hb=.5;b.interval=1;a.ad.add(b);b=new X;b.Fb="LineH";b.stroke="gray";b.hb=.5;b.interval=5;a.ad.add(b);b=new X;b.Fb="LineH";b.stroke="gray";b.hb=1;b.interval=10;a.ad.add(b);b=new X;b.Fb="LineV";b.stroke="lightgray";b.hb=.5;b.interval=1;a.ad.add(b);b=new X;b.Fb="LineV";b.stroke="gray";b.hb=.5;b.interval=5;a.ad.add(b);b=new X;b.Fb="LineV";b.stroke="gray";b.hb=1;b.interval=10;a.ad.add(b);b=new G;b.add(a.ad);
b.wf="Grid";b.uz=!1;b.JD=!1;b.Ag=!1;b.zz="GRID";a.add(b);a.Db.remove(b);a.ad.visible=!1}
D.prototype.LB=function(){if(this.Y.isEnabled){var a=this.Y;if(a.sy&&null!==a.ib){a.Zu=!0;var b=a.Cd,c=a.ob,d=b.width,e=c.width,f=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=a.scale;if(e<d||h<f){var s=u.K();this.bC&&a.Re?(s.m(this.scrollLeft/r+p,a.position.y),a.position=s):this.cC&&a.Se&&(s.m(a.position.x,this.scrollTop/r+b),a.position=s);u.v(s);a.Zu=!1;a.Hl=!1}else s=u.K(),this.bC&&a.Re&&(p<q&&(a.position=new w(this.scrollLeft+p,a.position.y)),k>l&&(a.position=
new w(-(a.uj.scrollWidth-a.Ab)+this.scrollLeft-a.Ab/r+a.Cd.right,a.position.y))),this.cC&&a.Se&&(b<c&&(a.position=new w(a.position.x,this.scrollTop+b)),m>n&&(a.position=new w(a.position.x,-(a.vj.scrollHeight-a.zb)+this.scrollTop-a.zb/r+a.Cd.bottom))),u.v(s),cj(a),a.Zu=!1,a.Hl=!1,b=a.Cd,c=a.ob,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(a.ty.style.width="1px"),h>=f&&b>=c&&m<=n&&(a.uy.style.height="1px")}}else dj(this.Y)};
D.prototype.Ru=function(){this.Y.isEnabled?this.Y.sy=!0:dj(this.Y)};D.prototype.computeBounds=D.prototype.kg=function(){0<this.Xf.count&&ej(this);return fj(this)};function fj(a){if(a.uD.J()){var b=a.uD.copy();b.yv(a.padding);return b}for(var c=!0,d=a.Zb.n,e=d.length,f=0;f<e;f++){var h=d[f];if(h.visible&&(!h.Ac||h.KD))for(var h=h.Db.n,k=h.length,l=0;l<k;l++){var m=h[l];m.uz&&m.Ea()&&(m=m.ba,m.J()&&(c?(c=!1,b=m.copy()):b.Sh(m)))}}c&&(b=new z(0,0,0,0));b.yv(a.padding);return b}
D.prototype.computePartsBounds=function(a){var b=null;for(a=a.i;a.next();){var c=a.value;c instanceof W||(c.pf(),null===b?b=c.ba.copy():b.Sh(c.ba))}return null===b?new z(NaN,NaN,0,0):b};
function gj(a,b){if((b||a.lf)&&!a.sc&&null!==a.ib&&!a.Lb.Vg&&a.Cd.J()){a.sc=!0;var c=a.xl;b&&a.tk!==vf&&(c=a.tk);var d=c!==vf?hj(a,c):a.scale,c=a.ob.copy(),e=a.Ab/d,f=a.zb/d,h=null,k=a.Lb;k.ld&&(h=a.Ma.copy());a.position.La();var l=a.dn;b&&!l.pd()&&a.An.pd()&&(l=a.An);ij(a,a.Ma,a.Cd,e,f,l,b);a.position.freeze();null!==h&&si(k,h,a.Ma);a.scale=d;a.sc=!1;d=a.ob;d.De(c)||a.dt(c,d)}}
function hj(a,b){var c=a.Eb.Pv;if(null===a.ib)return c;a.ei&&jj(a,a.kg());var d=a.Cd;if(!d.J())return c;var e=d.width,d=d.height,f=a.Ab,h=a.zb,k=f/e,l=h/d;return b===kj?(e=Math.min(l,k),e>c&&(e=c),e<a.Yg&&(e=a.Yg),e>a.Xg&&(e=a.Xg),e):b===lj?(e=l>k?(h-a.zd)/d:(f-a.zd)/e,e>c&&(e=c),e<a.Yg&&(e=a.Yg),e>a.Xg&&(e=a.Xg),e):a.scale}D.prototype.zoomToFit=D.prototype.zoomToFit=function(){this.scale=hj(this,kj)};
D.prototype.zoomToRect=function(a,b){void 0===b&&(b=kj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===kj||b===lj)if(isNaN(c))e=this.ob.height*this.scale/d;else if(isNaN(d))e=this.ob.width*this.scale/c;else var e=this.Ab,f=this.zb,e=b===lj?f/d>e/c?(f-(this.qk?this.zd:0))/d:(e-(this.rk?this.zd:0))/c:Math.min(f/d,e/c);this.scale=e;this.position=new w(a.x,a.y)}};u.defineProperty(D,{qz:null},function(){return this.sc},function(a){this.sc=a});
D.prototype.alignDocument=function(a,b){this.ei&&jj(this,this.kg());var c=this.Cd,d=this.ob,e=this.sc;this.sc=!0;this.position=new w(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));this.sc=e;this.ma()};
function ij(a,b,c,d,e,f,h){var k=b.x,l=b.y;if(h||a.yE===Ni)f.pd()&&(d>c.width&&(k=c.x+(f.x*c.width+f.offsetX)-(f.x*d-f.offsetX)),e>c.height&&(l=c.y+(f.y*c.height+f.offsetY)-(f.y*e-f.offsetY))),f=a.xE,h=d-c.width,d<c.width+f.left+f.right?(k=Math.min(k+d/2,c.right+Math.max(h,f.right)-d/2),k=Math.max(k,c.left-Math.max(h,f.left)+d/2),k-=d/2):k>c.left?k=c.left:k<c.right-d&&(k=c.right-d),d=e-c.height,e<c.height+f.top+f.bottom?(l=Math.min(l+e/2,c.bottom+Math.max(d,f.bottom)-e/2),l=Math.max(l,c.top-Math.max(d,
f.top)+e/2),l-=e/2):l>c.top?l=c.top:l<c.bottom-e&&(l=c.bottom-e);b.x=isFinite(k)?k:-a.padding.left;b.y=isFinite(l)?l:-a.padding.top;null!==a.gE&&(a=a.gE(a,b),b.x=a.x,b.y=a.y)}D.prototype.findPartAt=D.prototype.zs=function(a,b){var c=b?wg(this,a,function(a){return a.T},function(a){return a.canSelect()}):wg(this,a,function(a){return a.T});return c instanceof G?c:null};
D.prototype.findObjectAt=D.prototype.ke=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);ej(this);for(var d=this.Zb.Fm;d.next();){var e=d.value;if(e.visible&&(e=e.ke(a,b,c),null!==e))return e}return null};function wg(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);ej(a);for(a=a.Zb.Fm;a.next();){var e=a.value;if(e.visible&&!e.Ac&&(e=e.ke(b,c,d),null!==e))return e}return null}
D.prototype.findObjectsAt=D.prototype.ys=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof E||d instanceof F||(d=new F(S));ej(this);for(var e=this.Zb.Fm;e.next();){var f=e.value;f.visible&&f.ys(a,b,c,d)}return d};D.prototype.findObjectsIn=D.prototype.Nj=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof E||e instanceof F||(e=new F(S));ej(this);for(var f=this.Zb.Fm;f.next();){var h=f.value;h.visible&&h.Nj(a,b,c,d,e)}return e};
D.prototype.dz=function(a,b,c,d,e,f){var h=new F(S);ej(this);for(var k=this.Zb.Fm;k.next();){var l=k.value;l.visible&&l.dz(a,b,c,d,h,e,f)}return h};D.prototype.findObjectsNear=D.prototype.ym=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof E||e instanceof F)f=e;e=!0}f instanceof E||f instanceof F||(f=new F(S));ej(this);for(var h=this.Zb.Fm;h.next();){var k=h.value;k.visible&&k.ym(a,b,c,d,e,f)}return f};
function yf(a){-1!==a.lv&&(u.clearTimeout(a.lv),a.lv=-1)}function mj(a,b){var c=b.copy();a.lv=u.setTimeout(function(){c.button=2;a.N=c;a.kv=!0;a.doMouseUp()},850)}D.prototype.acceptEvent=function(a){var b=this.Jc;this.Jc=this.Ob;this.Ob=b;nj(this,this,a,b,a instanceof MouseEvent);return b};
function nj(a,b,c,d,e){d.g=b;e?oj(a,c,d):(d.ff=b.Ob.ff,d.da=b.Ob.da);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.gd=a;d.button=c.button;u.Em&&0===c.button&&c.ctrlKey&&(d.button=2);d.Wk=!1;d.up=!1;d.Te=1;d.Uk=0;d.Tc=!1;d.bubbles=!1;d.event=c;d.timestamp=Date.now();d.Ps=!1;d.Cg=c.target.Y?c.target.Y:null;d.pe=null}
function pj(a,b,c,d,e){d.g=a;oj(a,c,d);d.gd=0;d.button=0;d.Wk=!0;d.up=!1;d.Te=1;d.Uk=0;d.Tc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.Ps=e;d.Cg=b.target.Y?b.target.Y:null;d.pe=null;a.nk=d.copy();Ef=null}
function qj(a,b,c,d,e){var f=null;d.g=a;if(null!==c){var f=window.document.elementFromPoint(c.clientX,c.clientY),h;f&&f.Y?h=f.Y:(c=b.changedTouches[0],h=a);oj(a,c,d)}else null!==a.Jc?(d.da=a.Jc.da,d.ff=a.Jc.ff,d.Cg=a.Jc.Cg):null!==a.nk&&(d.da=a.nk.da,d.ff=a.nk.ff,d.Cg=a.nk.Cg);d.gd=0;d.button=0;d.Wk=!1;d.up=!1;d.Te=1;d.Uk=0;d.Tc=!1;d.bubbles=!1;d.event=b;d.timestamp=Date.now();d.Ps=e;d.Cg=h;d.pe=null}
function rj(a,b){if(a.bubbles)return!0;void 0!==b.stopPropagation&&b.stopPropagation();(void 0===b.touches||2>b.touches.length)&&b.preventDefault();b.cancelBubble=!0;return!1}
D.prototype.kH=function(a){if(!this.Y.isEnabled)return!1;var b=this.Y.Ob;nj(this.Y,this.Y,a,b,!1);b.key=String.fromCharCode(a.which);b.Wk=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key=
"Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.Y.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?rj(b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)};
D.prototype.lH=function(a){if(!this.Y.isEnabled)return!1;var b=this.Y.Ob;nj(this.Y,this.Y,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 93:a.preventDefault()}this.Y.doKeyUp();
return rj(b,a)};D.prototype.$p=function(a){var b=this.ib;if(null===b)return new w(0,0);var c=this.Ab,d=this.zb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Sd?(a=new w(c,a),Wa(a,this.Sd),a):new w(c,a)};function oj(a,b,c){var d=a.ib,e=a.Ab,f=a.zb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-f/d.height*d.top);c.ff.m(h,k);null!==a.Sd?(b=u.fc(h,k),a.Sd.Oh(b),c.da.assign(b),u.v(b)):c.da.m(h,k)}
D.prototype.invalidateDocumentBounds=D.prototype.pc=function(){this.ei||(this.ei=!0,this.de(!0))};function qi(a){a.vd||ej(a);a.ei&&jj(a,a.kg());for(a=a.Ul.i;a.next();)qi(a.value)}D.prototype.redraw=D.prototype.Sz=function(){this.sc||this.vd||(this.ma(),sj(this),cj(this),this.pc(),this.bf())};D.prototype.isUpdateRequested=function(){return this.Ef};
D.prototype.delayInitialization=D.prototype.oG=function(a){void 0===a&&(a=null);var b=this.Lb,c=b.isEnabled;b.Mi();b.isEnabled=!1;Dg(this);this.lf=!1;b.isEnabled=c;null!==a&&u.setTimeout(a,1)};D.prototype.requestUpdate=D.prototype.de=function(a){void 0===a&&(a=!1);if(!0!==this.Ef&&!(this.sc||!1===a&&this.vd)){this.Ef=!0;var b=this;requestAnimationFrame(function(){b.Ef&&b.bf()})}};D.prototype.maybeUpdate=D.prototype.bf=function(){if(!this.un||this.Ef)this.un&&(this.un=!1),Dg(this)};
function tj(a,b){a.sc||!a.Hl||dj(a)||(b&&ej(a),gj(a,!1))}
function Dg(a){if(!a.vd&&(a.Ef=!1,null!==a.Jb)){a.vd=!0;var b=a.Uh,c=a.VB;if(!b.Fn&&0!==c.length){for(var d=c.n,e=d.length,f=0;f<e;f++){var h=d[f];uj(h,!1);h.R()}c.clear()}d=c=!1;b.Vg&&(d=!0,c=a.cb,a.cb=!0);b.ld||gi(a);tj(a,!1);null!==a.ad&&(a.ad.visible&&!a.lu&&(vj(a),a.lu=!0),!a.ad.visible&&a.lu&&(a.lu=!1));ej(a);0!==a.El.count&&(wj(a),ej(a));e=!1;if(!a.lf||a.Ot)a.lf?xj(a,!a.du):(a.Wb("Initial Layout"),!1===b.isEnabled&&b.Mi(),xj(a,!1)),e=!0;a.du=!1;ej(a);a.xy||b.Vg||qi(a);e&&(a.lf||(b=a.Zb.n,a.xf(b,
b.length,a),yj(a),vj(a)),a.za("LayoutCompleted"));tj(a,!0);ej(a);e&&!a.lf&&(a.lf=!0,a.Wd("Initial Layout"),a.cb||a.ha.clear(),u.setTimeout(function(){a.Qh=!1},1));a.We();d&&(a.cb=c);a.vd=!1}}
function yj(a){if(a.tk!==vf)a.scale=hj(a,a.tk);else if(a.xl!==vf)a.scale=hj(a,a.xl);else{var b=a.UG;isFinite(b)&&0<b&&(a.scale=b)}a.ei&&jj(a,a.kg());b=a.TG;if(b.J())a.position=b;else{b=u.K();b.pt(a.Cd,a.SG);var c=a.ob,c=u.Vj(0,0,c.width,c.height),d=u.K();d.pt(c,a.VG);a.position=new w(b.x-d.x,b.y-d.y);u.ic(c);u.v(d);u.v(b);gj(a,!0)}a.za("InitialLayoutCompleted")}
function ej(a){if((a.vd||!a.Lb.Vg)&&0!==a.Xf.count)for(var b=0;23>b;b++){var c=a.Xf.i;if(null===c||0===a.Xf.count)break;a.Xf=new F(S);var d=a,e=a.Xf;for(c.reset();c.next();){var f=c.value;!f.Fd()||f instanceof V||!f.Ea()||(f.hl()?(Ph(f,Infinity,Infinity),f.zc()):e.add(f))}for(c.reset();c.next();)f=c.value,f instanceof V&&f.Ea()&&zj(d,f);for(c.reset();c.next();)f=c.value,f instanceof W&&(d=f,d.Ea()&&(d.hl()?(Ph(d,Infinity,Infinity),d.zc(),d.Xs()):e.add(d)));for(c.reset();c.next();)d=c.value,d instanceof
lf&&d.Ea()&&(d.hl()?(Ph(d,Infinity,Infinity),d.zc()):e.add(d))}}function zj(a,b){for(var c=u.eb(),d=u.eb(),e=b.Mc;e.next();){var f=e.value;f.Ea()&&(f instanceof V?(Aj(f)||Bj(f)||Cj(f))&&zj(a,f):f instanceof W?f.W==b||f.ca==b?d.push(f):c.push(f):(Ph(f,Infinity,Infinity),f.zc()))}for(var e=c.length,h=0;h<e;h++)f=c[h],Ph(f,Infinity,Infinity),f.zc();u.ra(c);Ph(b,Infinity,Infinity);b.zc();e=d.length;for(h=0;h<e;h++)f=d[h],Ph(f,Infinity,Infinity),f.zc();u.ra(d)}
D.prototype.xf=function(a,b,c,d){var e=this.Uh;if(this.uk||e.Vg)for(e=0;e<b;e++)a[e].xf(c,d)};
D.prototype.We=function(a,b){void 0===a&&(a=this.Gg);void 0===b&&(b=null);null===this.Jb&&u.k("No div specified");var c=this.ib;null===c&&u.k("No canvas specified");if(this.Uh.ld)0===this.ha.Le&&this.de(!0);else{Dj(this);var d=a!==this.Gg,e=this.Zb.n,f=e.length,h=this;this.xf(e,f,h);if(d)$i(this,a),cj(this);else if(!this.Md&&null===b)return;var k=this.Ma,l=this.$b,m=Math.round(k.x*l)/l,n=Math.round(k.y*l)/l,f=this.Sd;f.reset();1!==l&&f.scale(l);0===k.x&&0===k.y||f.translate(-m,-n);k=this.nf;u.Dm?
(c.width=c.width,$i(this,a),a.scale(k,k)):(a.setTransform(1,0,0,1,0,0),a.scale(k,k),a.clearRect(0,0,this.Ab,this.zb));a.miterLimit=9;a.setTransform(1,0,0,1,0,0);a.scale(k,k);a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);c=null!==b?function(c){var d=a,e=b;if(c.visible&&0!==c.Ic){1!==c.Ic&&(d.globalAlpha=c.Ic);var f=c.Uu;f.length=0;var k=h.scale;c=c.Db.n;for(var l=c.length,m=0;m<l;m++){var n=c[m];if((ti(n)||vi(n))&&!e.contains(n)){if(n instanceof W){var y=n;y.dc&&f.push(y);if(!1===y.hg)continue}y=
n.ba;1<y.width*k||1<y.height*k?n.We(d,h):wi(n,d)}}d.globalAlpha=1}}:function(b){b.We(a,h)};Ej(this,a);f=e.length;for(k=0;k<f;k++)c(e[k]);this.sk?this.sk.wl(this)&&this.Zw():this.$p=function(){return new w(0,0)};d?($i(this),cj(this)):this.Md=this.uk=!1}};
function Fj(a,b,c,d,e){null===a.Jb&&u.k("No div specified");var f=a.ib;null===f&&u.k("No canvas specified");var h=a.Gg;if(a.Md){Dj(a);var k=a.nf;u.Dm?(f.width=f.width,$i(a,h)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Ab*k,a.zb*k));h.GD=!1;h.drawImage(a.Dx.Dd,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.Ma;var f=a.$b,l=Math.round(e.x*f)/f,m=Math.round(e.y*f)/f;d=a.Sd;d.reset();1!==f&&d.scale(f);0===e.x&&0===e.y||d.translate(-l,-m);h.save();h.beginPath();e=c.length;for(f=0;f<e;f++)l=c[f],0!==
l.width&&0!==l.height&&h.rect(Math.floor(l.x),Math.floor(l.y),Math.ceil(l.width),Math.ceil(l.height));h.clip();h.setTransform(1,0,0,1,0,0);h.scale(k,k);h.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=a.Zb.n;e=c.length;a.xf(c,e,a);Ej(a,h);for(f=0;f<e;f++)xi(c[f],h,a,b);h.restore();$i(a);a.sk?a.sk.wl(a)&&a.Zw():a.$p=function(){return new w(0,0)};a.uk=!1;a.Md=!1;a.hE()}}
function Gj(a,b,c,d,e,f,h,k,l,m){null===a.Jb&&u.k("No div specified");null===a.ib&&u.k("No canvas specified");void 0===h&&(h=null);void 0===k&&(k=null);void 0===l&&(l=!1);void 0===m&&(m=!1);Dj(a);$i(a);cj(a);a.Tx=!0;var n=new z(f.x,f.y,d.width/e,d.height/e),p=n.copy();p.yv(c);vj(a,p);ej(a);var p=a.Zb.n,q=p.length;a.xf(p,q,a,n);var r=a.nf;b.setTransform(1,0,0,1,0,0);b.scale(r,r);b.clearRect(0,0,d.width,d.height);null!==k&&""!==k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));d=u.jh();d.reset();
d.translate(c.left,c.top);d.scale(e);0===f.x&&0===f.y||d.translate(-f.x,-f.y);b.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);u.Ye(d);Ej(a,b);if(null!==h){var s=new F(S);c=h.i;for(c.reset();c.next();)e=c.value,!1===m&&"Grid"===e.layer.name||null===e||s.add(e);c=function(c){var d=l;if(c.visible&&0!==c.Ic&&(void 0===d&&(d=!0),d||!c.Ac)){1!==c.Ic&&(b.globalAlpha=c.Ic);d=c.Uu;d.length=0;var e=a.scale;c=c.Db.n;for(var f=c.length,h=0;h<f;h++){var k=c[h];if((ti(k)||vi(k))&&s.contains(k)){if(k instanceof
W){var m=k;m.dc&&d.push(m);if(!1===m.hg)continue}m=k.ba;1<m.width*e||1<m.height*e?k.We(b,a):wi(k,b)}}b.globalAlpha=1}}}else if(!l&&m){var t=a.Gs.T,v=t.layer;c=function(c){c===v?t.We(b,a):c.We(b,a,n,l,m)}}else c=function(c){c.We(b,a,n,l,m)};for(e=0;e<q;e++)c(p[e]);a.Tx=!1;a.sk?a.sk.wl(a)&&a.Zw():a.$p=function(){return new w(0,0)};$i(a);cj(a);a.xf(p,q,a);vj(a)}D.prototype.getRenderingHint=D.prototype.$v=function(a){return this.Qg[a]};
D.prototype.setRenderingHint=D.prototype.iI=function(a,b){this.Qg[a]=b;this.Sz()};D.prototype.resetRenderingHints=D.prototype.qE=function(){this.Qg=new pa;this.Qg.drawShadows=!0;this.Qg.textGreeking=!0;this.Qg.viewportOptimizations=u.cH?!1:!0;this.Qg.temporaryPixelRatio=!0;this.Qg.pictureRatioOptimization=!0};function Ej(a,b){var c=a.Qg;if(null!==c){if(void 0!==c.imageSmoothingEnabled){var d=!!c.imageSmoothingEnabled;b.GD=d;b.aK=d}c=c.defaultFont;void 0!==c&&null!==c&&(b.font=c,b.Et=c)}}
D.prototype.getInputOption=D.prototype.gz=function(a){return this.dq[a]};D.prototype.setInputOption=function(a,b){this.dq[a]=b};D.prototype.resetInputOptions=D.prototype.pE=function(){this.dq=new pa;this.dq.extraTouchArea=10;this.dq.extraTouchThreshold=10};D.prototype.setProperties=function(a){u.ot(this,a)};function wj(a){if(0===a.ha.Le){for(var b=a.El.i;b.next();){var c=b.key,d=b.value;c.le();eh(c,d)}a.El.clear()}}
D.prototype.ma=function(a){void 0===a&&(a=null);if(null===a)this.Md=!0,this.de();else{var b=this.ob;null!==a&&a.J()&&b.sg(a)&&(this.Md=!0,this.de())}for(b=this.Ul.i;b.next();)b.value.ma(a)};
D.prototype.nz=function(a,b){if(!0!==this.Md){this.Md=!0;var c=!0===this.$v("temporaryPixelRatio");if(!0===this.$v("viewportOptimizations")&&this.yE!==Hj&&this.xE.Tv(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=u.Sf(),f=Math.max(a.x,b.x),h=Math.max(a.y,b.y),k=Math.min(a.x+a.width,b.x+b.width),l=Math.min(a.y+a.height,b.y+b.height);e.x=f;e.y=h;e.width=Math.max(0,k-f)*d;e.height=Math.max(0,l-h)*d;if(0<e.width&&0<e.height){if(!this.vd&&(this.Ef=!1,null!==this.Jb)){this.vd=!0;ej(this);
0!==this.El.count&&(wj(this),ej(this));this.Cd.J()||jj(this,this.kg());var m=this.ib;if(null!==m){var n=this.nf,h=this.Ab*n,k=this.zb*n,f=this.scale*n,d=Math.round(Math.round(b.x*f)-Math.round(a.x*f)),f=Math.round(Math.round(b.y*f)-Math.round(a.y*f)),l=this.Dx,p=this.dB;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.nf,q=70*this.nf,r=Math.max(d,0),s=Math.max(f,0),t=Math.floor(h-r),v=Math.floor(k-s);p.GD=!1;p.drawImage(m.Dd,r,s,t,v,0,0,t,v);this.sk.wl(this)&&
p.clearRect(0,0,l,q);var m=u.eb(),p=u.eb(),v=Math.abs(d),t=Math.abs(f),x=0===r?0:h-v,r=u.fc(x,0),v=u.fc(v+x,k);p.push(new z(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));var B=this.Sd;B.reset();B.scale(n,n);1!==this.$b&&B.scale(this.$b);n=this.Ma;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&B.translate(-n.x,-n.y);Wa(r,B);Wa(v,B);m.push(new z(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));x=0===s?0:k-t;r.m(0,x);v.m(h,t+x);p.push(new z(Math.min(r.x,
v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));Wa(r,B);Wa(v,B);m.push(new z(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));this.sk.wl(this)&&(h=0<d?0:-d,k=0<f?0:-f,r.m(h,k),v.m(l+h,q+k),p.push(new z(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))),Wa(r,B),Wa(v,B),m.push(new z(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))));u.v(r);u.v(v);tj(this,!1);Fj(this,m,p,d,f);u.ra(m);u.ra(p);this.vd=!1}}}else this.bf();
u.ic(e);c&&(this.im=1,this.bf(),ki(this,!0))}else c?(this.im=1,this.bf(),ki(this,!0)):this.bf();for(c=this.Ul.i;c.next();)c.value.nz()}};function sj(a){!1===a.Hl&&(a.Hl=!0)}function cj(a){!1===a.uk&&(a.uk=!0)}function Dj(a){!1!==a.fq&&(a.fq=!1,Ij(a,a.Ab,a.zb))}function Ij(a,b,c){var d=a.ib,e=a.nf,f=b*e,e=c*e;if(d.width!==f||d.height!==e)d.width=f,d.height=e,d.style.width=b+"px",d.style.height=c+"px",a.Md=!0,$i(a)}
function dj(a){var b=a.ib;if(null===b)return!0;var c=a.Jb,d=a.Ab,e=a.zb,f=a.CC.copy(),h=!1,k=a.rk?a.zd:0,l=a.qk?a.zd:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.rk=!1,a.qk=!1,l=k=0,a.Ab=m,a.zb=c,h=a.fq=!0;a.Hl=!1;if(a.Lb.Vg)return h?(a.Lb.Mi(),a.oG(),!1):!0;var n=a.ob,p=a.Cd,m=p.width,c=p.height,q=n.width,r=n.height,s=p.x,t=n.x,v=p.right,k=n.right+k,x=p.y,B=n.y,p=p.bottom,l=n.bottom+l,y=n="1px",C=a.scale;a.kz&&a.Re&&(n=1,s+1<t&&(n=Math.max((t-s)*C+a.Ab,n)),v>k+1&&(n=Math.max((v-
k)*C+a.Ab,n)),q+1<m&&(n=Math.max((m-q)*C+a.Ab,n)),n+="px");a.lz&&a.Se&&(y=1,x+1<B&&(y=Math.max((B-x)*C+a.zb,y)),p>l+1&&(y=Math.max((p-l)*C+a.zb,y)),r+1<c&&(y=Math.max((c-r)*C+a.zb,y)),y+="px");var I="1px"!==n,H="1px"!==y;if((!I||!H)&&I||H)H&&(k-=a.zd),I&&(l-=a.zd),a.kz&&a.Re&&(n=1,s+1<t&&(n=Math.max((t-s)*C+a.Ab,n)),v>k+1&&(n=Math.max((v-k)*C+a.Ab,n)),q+1<m&&(n=Math.max((m-q)*C+a.Ab,n)),n+="px"),a.lz&&a.Se&&(y=1,x+1<B&&(y=Math.max((B-x)*C+a.zb,y)),p>l+1&&(y=Math.max((p-l)*C+a.zb,y)),r+1<c&&(y=Math.max((c-
r)*C+a.zb,y)),y+="px"),I="1px"!==n,H="1px"!==y;if(a.Zu&&I===a.qk&&H===a.rk)return d===a.Ab&&e===a.zb||a.bf(),!1;I!==a.qk&&(a.zb="1px"===n?a.zb+a.zd:Math.max(a.zb-a.zd,1),h=!0);a.qk=I;a.ty.style.width=n;H!==a.rk&&(a.Ab="1px"===y?a.Ab+a.zd:Math.max(a.Ab-a.zd,1),h=!0,a.wB&&(H?(b.style.left=a.zd+"px",a.position=new w(a.Ma.x+a.zd/a.scale,a.Ma.y)):(b.style.left="0px",a.position=new w(a.Ma.x-a.zd/a.scale,a.Ma.y))));a.rk=H;a.uy.style.height=y;a.kz&&a.Re&&(q+1<m?a.uj.scrollLeft=(a.position.x-s)*C:s+1<t?a.uj.scrollLeft=
a.uj.scrollWidth-a.uj.clientWidth:v>k+1&&(a.uj.scrollLeft=a.position.x*C));a.lz&&a.Se&&(r+1<c?a.vj.scrollTop=(a.position.y-x)*C:x+1<B?a.vj.scrollTop=a.vj.scrollHeight-a.vj.clientHeight:p>l+1&&(a.vj.scrollTop=a.position.y*C));h&&(a.fq=!0);m=a.Ab;c=a.zb;a.vj.style.height=c+"px";a.vj.style.width=m+(a.rk?a.zd:0)+"px";a.uj.style.width=m+"px";a.uj.style.height=c+(a.qk?a.zd:0)+"px";a.sy=!1;return d!==m||e!==c||a.Lb.ld?(n=a.ob,a.dt(f,n,h),!1):!0}
D.prototype.add=D.prototype.add=function(a){u.C(a,G,D,"add:part");var b=a.g;if(b!==this){null!==b&&u.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.Vm&&(a.wk="Tool");var c=a.wf,b=this.ws(c);null===b&&(b=this.ws(""));null===b&&u.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.Eo(99999999,a,a.g===this),0<=c&&this.Dc(be,"parts",b,null,a,null,c),b.Ac||this.pc(),a.H(Jj),c=a.Rs,null!==
c&&c(a,null,b))}};
D.prototype.Eo=function(a){if(a instanceof U){if(this.Rn.add(a),a instanceof V){var b=a.Ra;null===b?this.Ik.add(a):b.Pn.add(a);b=a.Qb;null!==b&&(b.g=this)}}else a instanceof W?this.Nn.add(a):a instanceof lf||this.Db.add(a);var c=this;Kj(a,function(a){Lj(c,a)});a.Pb&&a.R();b=a.data;null!==b&&(a instanceof lf||(a instanceof W?this.lk.add(b,a):this.$h.add(b,a)),Kj(a,function(a){Mj(c,a)}));!0!==Bj(a)&&!0!==Cj(a)||this.Xf.add(a);Nj(a,!0,this);Oj(a)?(a.ba.J()&&this.ma(yi(a,a.ba)),this.pc()):a.Ea()&&a.ba.J()&&
this.ma(yi(a,a.ba));this.de()};
D.prototype.Fe=function(a){a.ls();if(a instanceof U){if(this.Rn.remove(a),a instanceof V){var b=a.Ra;null===b?this.Ik.remove(a):b.Pn.remove(a);b=a.Qb;null!==b&&(b.g=null)}}else a instanceof W?this.Nn.remove(a):a instanceof lf||this.Db.remove(a);var c=this;Kj(a,function(a){Pj(c,a)});b=a.data;null!==b&&(a instanceof lf||(a instanceof W?this.lk.remove(b):this.$h.remove(b)),Kj(a,function(a){Qj(c,a)}));this.Xf.remove(a);Oj(a)?(a.ba.J()&&this.ma(yi(a,a.ba)),this.pc()):a.Ea()&&a.ba.J()&&this.ma(yi(a,a.ba));
this.de()};D.prototype.remove=D.prototype.remove=function(a){u.C(a,G,D,"remove:part");a.Za=!1;a.Wg=!1;var b=a.layer;if(null!==b&&b.g===this){a.H(Rj);a.xm();var c=b.Fe(-1,a,!1);0<=c&&this.Dc(ce,"parts",b,a,null,c,null);c=a.Rs;null!==c&&c(a,b,null)}};D.prototype.removeParts=D.prototype.Wz=function(a,b){if(u.isArray(a))for(var c=u.qb(a),d=0;d<c;d++){var e=u.fb(a,d);b&&!e.canDelete()||this.remove(e)}else for(e=new F(G),e.Td(a),c=e.i;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};
D.prototype.copyParts=D.prototype.to=function(a,b,c){return this.Eb.to(a,b,c)};D.prototype.moveParts=D.prototype.moveParts=function(a,b,c){u.C(b,w,D,"moveParts:offset");var d=this.tb;if(null!==d){d=d.Ed;null===d&&(d=new uf,d.Ec(this));var e=new la(G,Object);if(null!==a)a=a.i;else{for(a=this.Sj;a.next();)Hf(d,e,a.value,c);for(a=this.yg;a.next();)Hf(d,e,a.value,c);a=this.links}for(;a.next();)Hf(d,e,a.value,c);d.moveParts(e,b,c)}};
function Sj(a,b,c){u.C(b,we,D,"addLayer:layer");null!==b.g&&b.g!==a&&u.k("Cannot share a Layer with another Diagram: "+b+" of "+b.g);null===c?null!==b.g&&u.k("Cannot add an existing Layer to this Diagram again: "+b):(u.C(c,we,D,"addLayer:existingLayer"),c.g!==a&&u.k("Existing Layer must be in this Diagram: "+c+" not in "+c.g),b===c&&u.k("Cannot move a Layer before or after itself: "+b));if(b.g!==a){b=b.name;a=a.Zb;c=a.count;for(var d=0;d<c;d++)a.ja(d).name===b&&u.k("Cannot add Layer with the name '"+
b+"'; a Layer with the same name is already present in this Diagram.")}}D.prototype.addLayer=D.prototype.cs=function(a){Sj(this,a,null);a.Ec(this);var b=this.Zb,c=b.count-1;if(!a.Ac)for(;0<=c&&b.ja(c).Ac;)c--;b.Yd(c+1,a);null!==this.Od&&this.Dc(be,"layers",this,null,a,null,c+1);this.ma();this.pc()};
D.prototype.addLayerBefore=D.prototype.LF=function(a,b){Sj(this,a,b);a.Ec(this);var c=this.Zb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Od&&this.Dc(ce,"layers",this,a,null,d,null));for(var e=c.count,f=0;f<e;f++)if(c.ja(f)===b){c.Yd(f,a);break}null!==this.Od&&this.Dc(be,"layers",this,null,a,null,f);this.ma();0>d&&this.pc()};
D.prototype.addLayerAfter=function(a,b){Sj(this,a,b);a.Ec(this);var c=this.Zb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Od&&this.Dc(ce,"layers",this,a,null,d,null));for(var e=c.count,f=0;f<e;f++)if(c.ja(f)===b){c.Yd(f+1,a);break}null!==this.Od&&this.Dc(be,"layers",this,null,a,null,f+1);this.ma();0>d&&this.pc()};
D.prototype.removeLayer=function(a){u.C(a,we,D,"removeLayer:layer");a.g!==this&&u.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.Zb,c=b.indexOf(a);if(b.remove(a)){for(b=a.Db.copy().i;b.next();){var d=b.value,e=d.wf;d.wf=e!==a.name?e:""}null!==this.Od&&this.Dc(ce,"layers",this,a,null,c,null);this.ma();this.pc()}}};D.prototype.findLayer=D.prototype.ws=function(a){for(var b=this.mw;b.next();){var c=b.value;if(c.name===a)return c}return null};
D.prototype.addChangedListener=D.prototype.Jy=function(a){u.j(a,"function",D,"addChangedListener:listener");null===this.Ui&&(this.Ui=new E("function"));this.Ui.add(a)};D.prototype.removeChangedListener=D.prototype.Tz=function(a){u.j(a,"function",D,"removeChangedListener:listener");null!==this.Ui&&(this.Ui.remove(a),0===this.Ui.count&&(this.Ui=null))};
D.prototype.Jv=function(a){this.cb||this.ha.ED(a);a.Ad!==ae&&(this.Qh=!0);if(null!==this.Ui){var b=this.Ui,c=b.length;if(1===c)b=b.ja(0),b(a);else if(0!==c)for(var d=b.Ke(),e=0;e<c;e++)b=d[e],b(a)}};D.prototype.raiseChangedEvent=D.prototype.Dc=function(a,b,c,d,e,f,h){void 0===f&&(f=null);void 0===h&&(h=null);var k=new Zd;k.g=this;k.Ad=a;k.propertyName=b;k.object=c;k.oldValue=d;k.zg=f;k.newValue=e;k.xg=h;this.Jv(k)};
D.prototype.raiseChanged=D.prototype.h=function(a,b,c,d,e){this.Dc($d,a,this,b,c,d,e)};u.u(D,{Lb:"animationManager"},function(){return this.Uh});u.u(D,{ha:"undoManager"},function(){return this.Od.ha});u.defineProperty(D,{cb:"skipsUndoManager"},function(){return this.qi},function(a){u.j(a,"boolean",D,"skipsUndoManager");this.qi=a;this.Od.qi=a});u.defineProperty(D,{az:"delaysLayout"},function(){return this.zx},function(a){this.zx=a});
D.prototype.pm=function(a,b){if(null!==a&&a.g===this){var c=a.Ad;if(c===$d){var d=a.object,c=a.propertyName,e=a.ta(b);u.Oa(d,c,e);d instanceof S&&(d=d.T,null!==d&&d.Zd());this.Qh=!0}else if(c===be){e=a.object;c=a.xg;d=a.newValue;if(e instanceof A)if("number"===typeof c&&d instanceof S){var f=e;b?f.Fe(c):f.Yd(c,d);d=e.T;null!==d&&d.Zd()}else"number"===typeof c&&d instanceof Se&&(f=e,b?d.ae?f.oE(c):f.kE(c):(c=d.ae?f.fd(d.index):f.ed(d.index),c.qs(d)));else e instanceof we?(f=!0===a.zg,"number"===typeof c&&
d instanceof G&&(b?(d.Zd(),e.Fe(f?c:-1,d,f)):e.Eo(c,d,f))):e instanceof D?"number"===typeof c&&d instanceof we&&(e=d,b?this.Zb.hd(c):(e.Ec(this),this.Zb.Yd(c,e))):u.k("unknown ChangedEvent.Insert object: "+a.toString());this.Qh=!0}else c===ce?(e=a.object,c=a.zg,d=a.oldValue,e instanceof A?"number"===typeof c&&d instanceof S?(f=e,b?f.Yd(c,d):f.Fe(c)):"number"===typeof c&&d instanceof Se&&(f=e,b?(c=d.ae?f.fd(d.index):f.ed(d.index),c.qs(d)):d.ae?f.oE(c):f.kE(c)):e instanceof we?(f=!0===a.xg,"number"===
typeof c&&d instanceof G&&(b?e.Eo(c,d,f):(d.Zd(),e.Fe(f?c:-1,d,f)))):e instanceof D?"number"===typeof c&&d instanceof we&&(e=d,b?(e.Ec(this),this.Zb.Yd(c,e)):this.Zb.hd(c)):u.k("unknown ChangedEvent.Remove object: "+a.toString()),this.Qh=!0):c!==ae&&u.k("unknown ChangedEvent: "+a.toString())}};D.prototype.startTransaction=D.prototype.Wb=function(a){return this.ha.Wb(a)};D.prototype.commitTransaction=D.prototype.Wd=function(a){return this.ha.Wd(a)};D.prototype.rollbackTransaction=D.prototype.ap=function(){return this.ha.ap()};
D.prototype.updateAllTargetBindings=D.prototype.CI=function(a){void 0===a&&(a="");for(var b=this.Sj;b.next();)b.value.Nb(a);for(b=this.yg;b.next();)b.value.Nb(a);for(b=this.links;b.next();)b.value.Nb(a)};D.prototype.updateAllRelationshipsFromData=function(){for(var a=this.Sj;a.next();)a.value.updateRelationshipsFromData();for(a=this.yg;a.next();)a.value.updateRelationshipsFromData();for(a=this.links;a.next();)a.value.updateRelationshipsFromData()};
function Yj(a,b,c){if(a.sc||a.vd)a.$b=c;else if(a.sc=!0,null===a.ib)a.$b=c;else{var d=a.ob.copy(),e=a.Ab,f=a.zb;d.width=a.Ab/b;d.height=a.zb/b;var h=a.Rm.copy();if(isNaN(h.x))switch(a.Ty){case Xb:h.x=0;break;case Yb:h.x=e-1;break;case Ib:h.x=e/2;break;case uc:case tc:h.x=e/2}if(isNaN(h.y))switch(a.Ty){case Wb:h.y=0;break;case Zb:h.y=f-1;break;case Ib:h.y=f/2;break;case uc:case tc:h.y=f/2}null!==a.wE&&(c=a.wE(a,c));c<a.Yg&&(c=a.Yg);c>a.Xg&&(c=a.Xg);a.position=new w(a.Ma.x+h.x/b-h.x/c,a.Ma.y+h.y/b-
h.y/c);a.sc=!1;a.$b=c;a.dt(d,a.ob);gj(a,!1);a.ma();sj(a)}}D.prototype.dt=function(a,b,c){void 0===c&&(c=!1);c||sj(this);cj(this);var d=this.Qb;null===d||!d.jw||c||a.width===b.width&&a.height===b.height||d.H();d=this.Va;!0===this.Jl&&d instanceof jf&&(this.N.da=this.XE(this.N.ff),d.doMouseMove());this.nz(a,b);vj(this);this.za("ViewportBoundsChanged",c?u.mh:null,a)};
function vj(a,b){void 0===b&&(b=null);var c=a.ad;if(null!==c&&c.visible){for(var d=u.ul(),e=1,f=1,h=c.ya.n,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(hk(m.Fb)?f=f*n/K.xD(f,n):e=e*n/K.xD(e,n))}h=c.aw;d.m(f*h.width,e*h.height);h=f=l=k=0;if(null!==b)k=b.width,l=b.height,f=b.x,h=b.y;else{e=u.Sf();f=a.ob;e.m(f.x,f.y,f.width,f.height);for(h=a.Ul.i;h.next();)f=h.value.ob,f.J()&&kb(e,f.x,f.y,f.width,f.height);k=e.width;l=e.height;f=e.x;h=e.y;if(!e.J())return}c.width=k+2*d.width;c.height=l+2*d.height;
e=u.K();K.xs(f,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);u.Oj(d);c.T.location=e;u.v(e)}}D.prototype.clearSelection=D.prototype.Lv=function(){var a=0<this.selection.count;a&&this.za("ChangingSelection");of(this);a&&this.za("ChangedSelection")};function of(a){a=a.selection;if(0<a.count){for(var b=a.Ke(),c=b.length,d=0;d<c;d++)b[d].Za=!1;a.La();a.clear();a.freeze()}}
D.prototype.select=D.prototype.select=function(a){null!==a&&(u.C(a,G,D,"select:part"),a.layer.g===this&&(!a.Za||1<this.selection.count)&&(this.za("ChangingSelection"),of(this),a.Za=!0,this.za("ChangedSelection")))};
D.prototype.selectCollection=D.prototype.CE=function(a){this.za("ChangingSelection");of(this);if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++){var d=u.fb(a,c);d instanceof G||u.k("Diagram.selectCollection given something that is not a Part: "+d);d.Za=!0}else for(a=a.i;a.next();)d=a.value,d instanceof G||u.k("Diagram.selectCollection given something that is not a Part: "+d),d.Za=!0;this.za("ChangedSelection")};
D.prototype.clearHighlighteds=D.prototype.WC=function(){var a=this.bw;if(0<a.count){for(var b=a.Ke(),c=b.length,d=0;d<c;d++)b[d].Wg=!1;a.La();a.clear();a.freeze()}};D.prototype.highlight=function(a){null!==a&&a.layer.g===this&&(u.C(a,G,D,"highlight:part"),!a.Wg||1<this.bw.count)&&(this.WC(),a.Wg=!0)};
D.prototype.highlightCollection=function(a){this.WC();if(u.isArray(a))for(var b=u.qb(a),c=0;c<b;c++){var d=u.fb(a,c);d instanceof G||u.k("Diagram.highlightCollection given something that is not a Part: "+d);d.Wg=!0}else for(a=a.i;a.next();)d=a.value,d instanceof G||u.k("Diagram.highlightCollection given something that is not a Part: "+d),d.Wg=!0};
D.prototype.scroll=D.prototype.scroll=function(a,b,c){void 0===c&&(c=1);var d="up"===b||"down"===b,e=0;"pixel"===a?e=c:"line"===a?e=c*(d?this.mt:this.lt):"page"===a?(a=d?this.ob.height:this.ob.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.mt:this.lt),0),e*=c)):u.k("scrolling unit must be 'pixel', 'line', or 'page', not: "+a);e/=this.scale;c=this.position.copy();"up"===b?c.y=this.position.y-e:"down"===b?c.y=this.position.y+e:"left"===b?c.x=this.position.x-e:"right"===b?c.x=this.position.x+e:u.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+
b);this.position=c};D.prototype.scrollToRect=D.prototype.cI=function(a){var b=this.ob;b.Kj(a)||(a=a.Ok,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};D.prototype.centerRect=function(a){var b=this.ob;a=a.Ok;a.x-=b.width/2;a.y-=b.height/2;this.position=a};D.prototype.transformDocToView=D.prototype.VE=function(a){var b=this.Sd;b.reset();1!==this.$b&&b.scale(this.$b);var c=this.Ma;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.Sd)};
D.prototype.transformViewToDoc=D.prototype.XE=function(a){var b=this.Sd;b.reset();1!==this.$b&&b.scale(this.$b);var c=this.Ma;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return Wa(a.copy(),this.Sd)};var vf;D.None=vf=u.s(D,"None",0);var kj;D.Uniform=kj=u.s(D,"Uniform",1);var lj;D.UniformToFill=lj=u.s(D,"UniformToFill",2);var Hg;D.CycleAll=Hg=u.s(D,"CycleAll",10);var Lg;D.CycleNotDirected=Lg=u.s(D,"CycleNotDirected",11);var Vg;
D.CycleNotDirectedFast=Vg=u.s(D,"CycleNotDirectedFast",12);var Wg;D.CycleNotUndirected=Wg=u.s(D,"CycleNotUndirected",13);var Ig;D.CycleDestinationTree=Ig=u.s(D,"CycleDestinationTree",14);var Kg;D.CycleSourceTree=Kg=u.s(D,"CycleSourceTree",15);var Ni;D.DocumentScroll=Ni=u.s(D,"DocumentScroll",1);var Hj;D.InfiniteScroll=Hj=u.s(D,"InfiniteScroll",2);
u.defineProperty(D,{DI:"validCycle"},function(){return this.sv},function(a){var b=this.sv;b!==a&&(u.rb(a,D,D,"validCycle"),this.sv=a,this.h("validCycle",b,a))});u.defineProperty(D,{ow:"linkSpacing"},function(){return this.gj},function(a){var b=this.gj;b!==a&&(u.ze(a,D,"linkSpacing"),0>a&&u.wa(a,">= zero",D,"linkSpacing"),this.gj=a,this.h("linkSpacing",b,a))});u.u(D,{mw:"layers"},function(){return this.Zb.i});
u.defineProperty(D,{uf:"isModelReadOnly"},function(){var a=this.Od;return null===a?!1:a.nb},function(a){var b=this.Od;null!==b&&(b.nb=a)});u.defineProperty(D,{nb:"isReadOnly"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(u.j(a,"boolean",D,"isReadOnly"),this.vk=a,this.h("isReadOnly",b,a))});u.defineProperty(D,{isEnabled:"isEnabled"},function(){return this.Ne},function(a){var b=this.Ne;b!==a&&(u.j(a,"boolean",D,"isEnabled"),this.Ne=a,this.h("isEnabled",b,a))});
u.defineProperty(D,{My:"allowClipboard"},function(){return this.Gt},function(a){var b=this.Gt;b!==a&&(u.j(a,"boolean",D,"allowClipboard"),this.Gt=a,this.h("allowClipboard",b,a))});u.defineProperty(D,{Ij:"allowCopy"},function(){return this.Xj},function(a){var b=this.Xj;b!==a&&(u.j(a,"boolean",D,"allowCopy"),this.Xj=a,this.h("allowCopy",b,a))});
u.defineProperty(D,{lm:"allowDelete"},function(){return this.Yj},function(a){var b=this.Yj;b!==a&&(u.j(a,"boolean",D,"allowDelete"),this.Yj=a,this.h("allowDelete",b,a))});u.defineProperty(D,{Av:"allowDragOut"},function(){return this.Ht},function(a){var b=this.Ht;b!==a&&(u.j(a,"boolean",D,"allowDragOut"),this.Ht=a,this.h("allowDragOut",b,a))});
u.defineProperty(D,{MC:"allowDrop"},function(){return this.It},function(a){var b=this.It;b!==a&&(u.j(a,"boolean",D,"allowDrop"),this.It=a,this.h("allowDrop",b,a))});u.defineProperty(D,{Ev:"allowTextEdit"},function(){return this.gk},function(a){var b=this.gk;b!==a&&(u.j(a,"boolean",D,"allowTextEdit"),this.gk=a,this.h("allowTextEdit",b,a))});
u.defineProperty(D,{Bv:"allowGroup"},function(){return this.Zj},function(a){var b=this.Zj;b!==a&&(u.j(a,"boolean",D,"allowGroup"),this.Zj=a,this.h("allowGroup",b,a))});u.defineProperty(D,{Fv:"allowUngroup"},function(){return this.hk},function(a){var b=this.hk;b!==a&&(u.j(a,"boolean",D,"allowUngroup"),this.hk=a,this.h("allowUngroup",b,a))});
u.defineProperty(D,{lo:"allowInsert"},function(){return this.Kt},function(a){var b=this.Kt;b!==a&&(u.j(a,"boolean",D,"allowInsert"),this.Kt=a,this.h("allowInsert",b,a))});u.defineProperty(D,{gs:"allowLink"},function(){return this.$j},function(a){var b=this.$j;b!==a&&(u.j(a,"boolean",D,"allowLink"),this.$j=a,this.h("allowLink",b,a))});
u.defineProperty(D,{mm:"allowRelink"},function(){return this.bk},function(a){var b=this.bk;b!==a&&(u.j(a,"boolean",D,"allowRelink"),this.bk=a,this.h("allowRelink",b,a))});u.defineProperty(D,{Nk:"allowMove"},function(){return this.ak},function(a){var b=this.ak;b!==a&&(u.j(a,"boolean",D,"allowMove"),this.ak=a,this.h("allowMove",b,a))});
u.defineProperty(D,{Cv:"allowReshape"},function(){return this.ck},function(a){var b=this.ck;b!==a&&(u.j(a,"boolean",D,"allowReshape"),this.ck=a,this.h("allowReshape",b,a))});u.defineProperty(D,{hs:"allowResize"},function(){return this.dk},function(a){var b=this.dk;b!==a&&(u.j(a,"boolean",D,"allowResize"),this.dk=a,this.h("allowResize",b,a))});
u.defineProperty(D,{Dv:"allowRotate"},function(){return this.ek},function(a){var b=this.ek;b!==a&&(u.j(a,"boolean",D,"allowRotate"),this.ek=a,this.h("allowRotate",b,a))});u.defineProperty(D,{of:"allowSelect"},function(){return this.fk},function(a){var b=this.fk;b!==a&&(u.j(a,"boolean",D,"allowSelect"),this.fk=a,this.h("allowSelect",b,a))});
u.defineProperty(D,{NC:"allowUndo"},function(){return this.Lt},function(a){var b=this.Lt;b!==a&&(u.j(a,"boolean",D,"allowUndo"),this.Lt=a,this.h("allowUndo",b,a))});u.defineProperty(D,{Gv:"allowZoom"},function(){return this.Nt},function(a){var b=this.Nt;b!==a&&(u.j(a,"boolean",D,"allowZoom"),this.Nt=a,this.h("allowZoom",b,a))});
u.defineProperty(D,{lz:"hasVerticalScrollbar"},function(){return this.qu},function(a){var b=this.qu;b!==a&&(u.j(a,"boolean",D,"hasVerticalScrollbar"),this.qu=a,sj(this),this.ma(),this.h("hasVerticalScrollbar",b,a),gj(this,!1))});u.defineProperty(D,{kz:"hasHorizontalScrollbar"},function(){return this.pu},function(a){var b=this.pu;b!==a&&(u.j(a,"boolean",D,"hasHorizontalScrollbar"),this.pu=a,sj(this),this.ma(),this.h("hasHorizontalScrollbar",b,a),gj(this,!1))});
u.defineProperty(D,{Re:"allowHorizontalScroll"},function(){return this.Jt},function(a){var b=this.Jt;b!==a&&(u.j(a,"boolean",D,"allowHorizontalScroll"),this.Jt=a,this.h("allowHorizontalScroll",b,a),gj(this,!1))});u.defineProperty(D,{Se:"allowVerticalScroll"},function(){return this.Mt},function(a){var b=this.Mt;b!==a&&(u.j(a,"boolean",D,"allowVerticalScroll"),this.Mt=a,this.h("allowVerticalScroll",b,a),gj(this,!1))});
u.defineProperty(D,{lt:"scrollHorizontalLineChange"},function(){return this.$u},function(a){var b=this.$u;b!==a&&(u.j(a,"number",D,"scrollHorizontalLineChange"),0>a&&u.wa(a,">= 0",D,"scrollHorizontalLineChange"),this.$u=a,this.h("scrollHorizontalLineChange",b,a))});
u.defineProperty(D,{mt:"scrollVerticalLineChange"},function(){return this.av},function(a){var b=this.av;b!==a&&(u.j(a,"number",D,"scrollVerticalLineChange"),0>a&&u.wa(a,">= 0",D,"scrollVerticalLineChange"),this.av=a,this.h("scrollVerticalLineChange",b,a))});u.defineProperty(D,{N:"lastInput"},function(){return this.Ob},function(a){this.Ob=a});u.defineProperty(D,{wc:"firstInput"},function(){return this.nk},function(a){this.nk=a});
u.defineProperty(D,{ac:"currentCursor"},function(){return this.sx},function(a){""===a&&(a=this.Pp);this.sx!==a&&(u.j(a,"string",D,"currentCursor"),null!==this.ib&&(this.sx=a,this.ib.style.cursor=a,this.Jb.style.cursor=a))});u.defineProperty(D,{lJ:"defaultCursor"},function(){return this.Pp},function(a){""===a&&(a="auto");var b=this.Pp;b!==a&&(u.j(a,"string",D,"defaultCursor"),this.Pp=a,this.h("defaultCursor",b,a))});
u.defineProperty(D,{zJ:"hasGestureZoom"},function(){return this.yn},function(a){var b=this.yn;b!==a&&(u.j(a,"boolean",D,"hasGestureZoom"),this.yn=a,this.h("hasGestureZoom",b,a))});u.defineProperty(D,{click:"click"},function(){return this.Wh},function(a){var b=this.Wh;b!==a&&(null!==a&&u.j(a,"function",D,"click"),this.Wh=a,this.h("click",b,a))});
u.defineProperty(D,{ts:"doubleClick"},function(){return this.ci},function(a){var b=this.ci;b!==a&&(null!==a&&u.j(a,"function",D,"doubleClick"),this.ci=a,this.h("doubleClick",b,a))});u.defineProperty(D,{Uy:"contextClick"},function(){return this.Yh},function(a){var b=this.Yh;b!==a&&(null!==a&&u.j(a,"function",D,"contextClick"),this.Yh=a,this.h("contextClick",b,a))});
u.defineProperty(D,{Fz:"mouseOver"},function(){return this.mi},function(a){var b=this.mi;b!==a&&(null!==a&&u.j(a,"function",D,"mouseOver"),this.mi=a,this.h("mouseOver",b,a))});u.defineProperty(D,{Ez:"mouseHover"},function(){return this.li},function(a){var b=this.li;b!==a&&(null!==a&&u.j(a,"function",D,"mouseHover"),this.li=a,this.h("mouseHover",b,a))});
u.defineProperty(D,{Dz:"mouseHold"},function(){return this.ki},function(a){var b=this.ki;b!==a&&(null!==a&&u.j(a,"function",D,"mouseHold"),this.ki=a,this.h("mouseHold",b,a))});u.defineProperty(D,{EH:"mouseDragOver"},function(){return this.Nu},function(a){var b=this.Nu;b!==a&&(null!==a&&u.j(a,"function",D,"mouseDragOver"),this.Nu=a,this.h("mouseDragOver",b,a))});
u.defineProperty(D,{Cz:"mouseDrop"},function(){return this.ji},function(a){var b=this.ji;b!==a&&(null!==a&&u.j(a,"function",D,"mouseDrop"),this.ji=a,this.h("mouseDrop",b,a))});u.defineProperty(D,{lA:"toolTip"},function(){return this.ti},function(a){var b=this.ti;b!==a&&(null!==a&&u.C(a,lf,D,"toolTip"),this.ti=a,this.h("toolTip",b,a))});
u.defineProperty(D,{contextMenu:"contextMenu"},function(){return this.Zh},function(a){var b=this.Zh;b!==a&&(null!==a&&u.C(a,lf,D,"contextMenu"),this.Zh=a,this.h("contextMenu",b,a))});u.defineProperty(D,{Eb:"commandHandler"},function(){return this.ix},function(a){var b=this.ix;b!==a&&(u.C(a,sa,D,"commandHandler"),null!==a.g&&u.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Ec(null),this.ix=a,a.Ec(this))});
u.defineProperty(D,{tb:"toolManager"},function(){return this.Fy},function(a){var b=this.Fy;b!==a&&(u.C(a,jf,D,"toolManager"),null!==a.g&&u.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Ec(null),this.Fy=a,a.Ec(this))});u.defineProperty(D,{$y:"defaultTool"},function(){return this.yx},function(a){var b=this.yx;b!==a&&(u.C(a,xe,D,"defaultTool"),this.yx=a,this.Va===b&&(this.Va=a))});
u.defineProperty(D,{Va:"currentTool"},function(){return this.ux},function(a){var b=this.ux;if(null!==b)for(b.na&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop(),b=this.Ul.i;b.next();)b.value.ma();null===a&&(a=this.$y);null!==a&&(u.C(a,xe,D,"currentTool"),this.ux=a,a.Ec(this),a.doStart())});u.u(D,{selection:"selection"},function(){return this.dv});
u.defineProperty(D,{wH:"maxSelectionCount"},function(){return this.Iu},function(a){var b=this.Iu;if(b!==a)if(u.j(a,"number",D,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Iu=a,this.h("maxSelectionCount",b,a),!this.ha.gb&&(a=this.selection.count-a,0<a)){this.za("ChangingSelection");for(var b=this.selection.Ke(),c=0;c<a;c++)b[c].Za=!1;this.za("ChangedSelection")}}else u.wa(a,">= 0",D,"maxSelectionCount")});
u.defineProperty(D,{HH:"nodeSelectionAdornmentTemplate"},function(){return this.Pu},function(a){var b=this.Pu;b!==a&&(u.C(a,lf,D,"nodeSelectionAdornmentTemplate"),this.Pu=a,this.h("nodeSelectionAdornmentTemplate",b,a))});u.defineProperty(D,{MG:"groupSelectionAdornmentTemplate"},function(){return this.mu},function(a){var b=this.mu;b!==a&&(u.C(a,lf,D,"groupSelectionAdornmentTemplate"),this.mu=a,this.h("groupSelectionAdornmentTemplate",b,a))});
u.defineProperty(D,{sH:"linkSelectionAdornmentTemplate"},function(){return this.Du},function(a){var b=this.Du;b!==a&&(u.C(a,lf,D,"linkSelectionAdornmentTemplate"),this.Du=a,this.h("linkSelectionAdornmentTemplate",b,a))});u.u(D,{bw:"highlighteds"},function(){return this.ru});
u.defineProperty(D,{Qh:"isModified"},function(){var a=this.ha;return a.isEnabled?null!==a.Di?!0:this.Vx&&this.Ig!==a.Ii:this.Vx},function(a){if(this.Vx!==a){u.j(a,"boolean",D,"isModified");this.Vx=a;var b=this.ha;!a&&b.isEnabled&&(this.Ig=b.Ii);a||ik(this)}});function ik(a){var b=a.Qh;a.DC!==b&&(a.DC=b,a.za("Modified"))}
u.defineProperty(D,{ga:"model"},function(){return this.Od},function(a){var b=this.Od;if(b!==a){u.C(a,J,D,"model");this.Va.doCancel();null!==b&&b.ha!==a.ha&&b.ha.ND&&u.k("Do not replace a Diagram.model while a transaction is in progress.");this.Lb.Mi();this.Lv();this.lf=!1;this.un=!0;this.Ig=-2;this.Ef=!1;var c=this.vd;this.vd=!0;this.Lb.ml();null!==b&&(b.Tz(this.GB),b instanceof Q&&jk(this,b.Qj),jk(this,b.ah));this.Od=a;a.Jy(this.FB);kk(this,a.ah);a instanceof Q&&lk(this,a.Qj);a.Tz(this.FB);a.Jy(this.GB);
this.vd=c;this.sc||this.ma();null!==b&&(a.ha.isEnabled=b.ha.isEnabled)}});u.defineProperty(D,{Na:null},function(){return this.yB},function(a){this.yB=a});
function Qi(a,b){if(b.ga===a.ga){var c=b.Ad,d=b.propertyName;if(c===ae&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.tb,c.cf.each(function(b){b.Ec(a)}),c.Mf.each(function(b){b.Ec(a)}),c.Nf.each(function(b){b.Ec(a)}),a.vd||a.lf||(a.du=!0,a.un&&(a.Ef=!0),a.Uh.ml());else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Lb;e.Vg&&!a.cb&&e.Mi();a.za("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Lb,e.Vg&&!a.cb&&e.Mi(),a.zu&&e.ml());else if(a.Na){a.Na=!1;try{var f=b.Lf;if(""!==f)if(c===$d){if("linkFromKey"===
f){var h=b.object,k=a.ng(h);if(null!==k){var l=b.newValue,m=a.Xe(l);k.W=m}}else if("linkToKey"===f)h=b.object,k=a.ng(h),null!==k&&(l=b.newValue,m=a.Xe(l),k.ca=m);else if("linkFromPortId"===f){if(h=b.object,k=a.ng(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.pg=n)}}else if("linkToPortId"===f)h=b.object,k=a.ng(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.lh=n));else if("nodeGroupKey"===f){var h=b.object,p=a.Nh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Xe(q);p.Ra=r instanceof
V?r:null}else p.Ra=null}}else if("linkLabelKeys"===f){if(h=b.object,k=a.ng(h),null!==k){var s=b.oldValue,t=b.newValue;if(u.isArray(s))for(var v=u.qb(s),x=0;x<v;x++){var B=u.fb(s,x),m=a.Xe(B);null!==m&&(m.ce=null)}if(u.isArray(t))for(v=u.qb(t),x=0;x<v;x++)B=u.fb(t,x),m=a.Xe(B),null!==m&&(m.ce=k)}}else if("nodeParentKey"===f){var y=b.object,C=a.Xe(b.newValue),I=a.Xv(y);if(null!==I){var H=I.As();null!==H?null===C?a.remove(H):a.qd?H.W=C:H.ca=C:mk(a,C,I)}}else if("parentLinkCategory"===f){var y=b.object,
I=a.Xv(y),T=b.newValue;null!==I&&"string"===typeof T&&(H=I.As(),null!==H&&(H.Kc=T))}else if("nodeCategory"===f){var h=b.object,aa=a.Nh(h),T=b.newValue;null!==aa&&"string"===typeof T&&(aa.Kc=T)}else if("linkCategory"===f){var h=b.object,R=a.ng(h),T=b.newValue;null!==R&&"string"===typeof T&&(R.Kc=T)}else if("nodeDataArray"===f){var N=b.oldValue;jk(a,N);var Z=b.newValue;kk(a,Z)}else"linkDataArray"===f&&(N=b.oldValue,jk(a,N),Z=b.newValue,lk(a,Z));a.Qh=!0}else c===be?(Z=b.newValue,"nodeDataArray"===f&&
u.Sa(Z)?nk(a,Z):"linkDataArray"===f&&u.Sa(Z)?ok(a,Z):"linkLabelKeys"===f&&Ne(Z)&&(k=a.ng(b.object),m=a.Xe(Z),null!==k&&null!==m&&(m.ce=k)),a.Qh=!0):c===ce?(N=b.oldValue,"nodeDataArray"===f&&u.Sa(N)?pk(a,N):"linkDataArray"===f&&u.Sa(N)?pk(a,N):"linkLabelKeys"===f&&Ne(N)&&(m=a.Xe(N),null!==m&&(m.ce=null)),a.Qh=!0):c===ae&&("SourceChanged"===f?Pi(a,b.object,b.propertyName):"ModelDisplaced"===f&&a.nl());else if(c===$d){var Ea=b.propertyName,h=b.object;if(h===a.ga){if("nodeKeyProperty"===Ea||"nodeCategoryProperty"===
Ea||"linkFromKeyProperty"===Ea||"linkToKeyProperty"===Ea||"linkFromPortIdProperty"===Ea||"linkToPortIdProperty"===Ea||"linkLabelKeysProperty"===Ea||"nodeIsGroupProperty"===Ea||"nodeGroupKeyProperty"===Ea||"nodeParentKeyProperty"===Ea||"linkCategoryProperty"===Ea)a.ha.gb||a.nl()}else Pi(a,h,Ea);a.Qh=!0}else if(c===be||c===ce)qk(a,b),a.Qh=!0;else if(c===ae){if("FinishedUndo"===d||"FinishedRedo"===d)a.ha.fi=!0,a.za("ChangedSelection"),ej(a),a.ha.fi=!1;a.du=!0;a.bf();e=a.Uh;e.ld&&0===a.ha.Le&&fi(e);"CommittedTransaction"===
d&&a.ha.Yx&&(a.Ig=Math.min(a.Ig,a.ha.Ii-1));ik(a);a.iy||"CommittedTransaction"!==d&&"FinishedUndo"!==d&&"FinishedRedo"!==d||(a.iy=!0,u.setTimeout(function(){a.Va.standardMouseOver();a.iy=!1},10))}}finally{a.Na=!0}}}}
function Pi(a,b,c){if("string"===typeof c){var d=a.Nh(b);if(null!==d)d.Nb(c),a.ga instanceof qe&&(d=a.ng(b),null!==d&&d.Nb(c));else{for(var d=null,e=a.Ml.i;e.next();){for(var f=e.value,h=0;h<f.length;h++){var k=f[h];null!==k.Yf&&(k=k.Yf.ta(b),null!==k&&(null===d&&(d=u.eb()),d.push(k)))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Nb(c);u.ra(d)}}b===a.ga.Zs&&a.CI(c)}}u.defineProperty(D,{Iw:"skipsModelSourceBindings"},function(){return this.eC},function(a){this.eC=a});
u.defineProperty(D,{tt:null},function(){return this.xy},function(a){this.xy=a});function qk(a,b){var c=b.Ad===be,d=c?b.xg:b.zg,e=c?b.newValue:b.oldValue,f=a.Ml.ta(b.object);if(Array.isArray(f))for(var h=0;h<f.length;h++){var k=f[h];if(c)rk(k,e,d);else{var l=d;if(!(0>l)){var m=l;sk(k)&&m++;k.Fe(m);tk(k,m,l)}}}}function Mj(a,b){var c=b.gi;if(u.isArray(c)){var d=a.Ml.ta(c);if(null===d)d=[],d.push(b),a.Ml.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function Qj(a,b){var c=b.gi;if(u.isArray(c)){var d=a.Ml.ta(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Ml.remove(c);break}}}function Lj(a,b){for(var c=b.ya.n,d=c.length,e=0;e<d;e++){var f=c[e];f instanceof Ri&&uk(a,f)}}function uk(a,b){var c=b.element;if(null!==c){var c=c.src,d=a.Tn.ta(c);if(null===d)d=[],d.push(b),a.Tn.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function Pj(a,b){for(var c=b.ya.n,d=c.length,e=0;e<d;e++){var f=c[e];f instanceof Ri&&vk(a,f)}}function vk(a,b){var c=b.element;if(null!==c){var c=c.src,d=a.Tn.ta(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Tn.remove(c);break}}}
D.prototype.clear=D.prototype.clear=function(){var a=null;null!==this.ad&&(a=this.ad.T);this.ga.clear();for(var b=this.Zb.length,c=0;c<b;c++)this.Zb.n[c].clear();this.Xf.clear();this.El.clear();this.Rn.clear();this.Ik.clear();this.Nn.clear();this.Db.clear();this.$h.clear();this.lk.clear();this.Ml.clear();this.dv.La();this.dv.clear();this.dv.freeze();this.ru.La();this.ru.clear();this.ru.freeze();gf=this.en=null;hf="";this.eu=(new z(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.Db.remove(a));
this.ma()};
D.prototype.reset=D.prototype.reset=function(){this.sc=!0;this.clear();this.Zb=new E(we);this.qE();this.pE();this.Ma=(new w(NaN,NaN)).freeze();this.$b=1;this.tu=(new w(NaN,NaN)).freeze();this.uu=NaN;this.Ku=1E-4;this.Hu=100;this.wv=(new w(NaN,NaN)).freeze();this.ku=(new z(NaN,NaN,NaN,NaN)).freeze();this.xl=vf;this.dn=uc;this.tk=vf;this.An=uc;this.vu=this.su=xb;this.Qt=(new rb(16,16,16,16)).freeze();this.yu=!0;this.sv=Hg;this.Pp="auto";this.Zh=this.ti=this.ji=this.Nu=this.ki=this.li=this.mi=this.Yh=
this.ci=this.Wh=null;this.vk=!1;this.Yj=this.Xj=this.Gt=this.Ne=!0;this.It=this.Ht=!1;this.Mt=this.Jt=this.qu=this.pu=this.Nt=this.Lt=this.fk=this.ek=this.dk=this.ck=this.ak=this.bk=this.$j=this.Kt=this.hk=this.Zj=this.gk=!0;this.av=this.$u=16;this.Pe=(new rb(5)).freeze();this.Iu=999999999;this.Nd=null;Ui(this);this.ad=null;this.qi=!0;Ti(this);this.Qb=new Je;this.qi=!1;this.ga=new Q;this.lf=!1;this.un=!0;this.sc=this.Ef=!1;this.ma()};
D.prototype.rebuildParts=D.prototype.nl=function(){for(var a=this.Jz.i;a.next();){var b=a.value,c=a.key;(!b.Fd()||b instanceof V)&&u.k('Invalid node template in Diagram.nodeTemplateMap: template for "'+c+'" must be a Node or a simple Part, not a Group or Link: '+b)}for(a=this.iz.i;a.next();)b=a.value,c=a.key,b instanceof V||u.k('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.xz.i;a.next();)b=a.value,c=a.key,b instanceof
W||u.k('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=u.eb();for(b=this.selection.i;b.next();)(c=b.value.data)&&a.push(c);for(var b=u.eb(),d=this.bw.i;d.next();)(c=d.value.data)&&b.push(c);c=u.eb();for(d=this.yg.i;d.next();){var e=d.value;null!==e.data&&(c.push(e.data),c.push(e.location))}for(d=this.links.i;d.next();)e=d.value,null!==e.data&&(c.push(e.data),c.push(e.location));for(d=this.Sj.i;d.next();)e=d.value,null!==
e.data&&(c.push(e.data),c.push(e.location));d=this.ga;d instanceof Q&&jk(this,d.Qj);jk(this,d.ah);kk(this,d.ah);d instanceof Q&&lk(this,d.Qj);for(d=0;d<a.length;d++)e=this.Nh(a[d]),null!==e&&(e.Za=!0);for(d=0;d<b.length;d++)e=this.Nh(b[d]),null!==e&&(e.Wg=!0);for(d=0;d<c.length;d+=2)e=this.Nh(c[d]),null!==e&&(e.location=c[d+1]);u.ra(a);u.ra(b);u.ra(c)};
function kk(a,b){if(null!==b){for(var c=a.ga,d=u.qb(b),e=0;e<d;e++){var f=u.fb(b,e);c.Ue(f)?nk(a,f,!1):c instanceof Q&&ok(a,f)}if(c instanceof Q||c instanceof qe){for(e=0;e<d;e++)f=u.fb(b,e),c.Ue(f)&&wk(a,f);if(c instanceof Q)for(c=a.links;c.next();)xk(c.value)}yk(a,!1)}}function nk(a,b,c){if(void 0!==b&&null!==b&&!a.ha.gb&&!a.$h.contains(b)){void 0===c&&(c=!0);var d=a.fz(b),e=zk(a,b,d);null!==e&&(nf(e),e=e.copy(),null!==e&&(e.Vh=d,a.Vm&&(e.wk="Tool"),a.add(e),e.data=b,c&&wk(a,b)))}}
D.prototype.fz=function(a){return this.ga.fz(a)};var Ak=!1,Bk=!1;function zk(a,b,c){var d=!1,e=a.ga;e instanceof Q&&(d=e.sz(b));d?(b=a.iz.ta(c),null===b&&(b=a.iz.ta(""),null===b&&(Bk||(Bk=!0,u.trace('No Group template found for category "'+c+'"'),u.trace("  Using default group template")),b=a.SA))):(b=a.Jz.ta(c),null===b&&(b=a.Jz.ta(""),null===b&&(Ak||(Ak=!0,u.trace('No Node template found for category "'+c+'"'),u.trace("  Using default node template")),b=a.UA)));return b}
function wk(a,b){var c=a.ga;if(c instanceof Q||c instanceof qe){var d=c.wb(b);if(void 0!==d){var e=Oe(c,d),f=a.Nh(b);if(null!==e&&null!==f){for(e=e.i;e.next();){var h=e.value;if(c instanceof Q){var k=c;if(k.Ue(h)){if(f instanceof V&&k.Bm(h)===d){var l=f,h=a.Nh(h);null!==h&&(h.Ra=l)}}else{var m=a.ng(h);if(null!==m&&f instanceof U&&(l=f,k.$k(h)===d&&(m.W=l),k.cl(h)===d&&(m.ca=l),h=k.Pj(h),u.isArray(h)))for(k=0;k<u.qb(h);k++)if(u.fb(h,k)===d){l.ce=m;break}}}else c instanceof qe&&(m=c,m.Ue(h)&&f instanceof
U&&(l=f,m.Cm(h)===d&&(h=a.Xv(h),mk(a,l,h))))}Qe(c,d)}c instanceof Q?(c=c.Bm(b),void 0!==c&&(c=a.Xe(c),c instanceof V&&(f.Ra=c))):c instanceof qe&&(c=c.Cm(b),void 0!==c&&f instanceof U&&(l=f,f=a.Xe(c),mk(a,f,l)))}}}
function mk(a,b,c){if(null!==b&&null!==c){var d=a.tb.TD,e=b,f=c;if(a.qd)for(b=f.oe;b.next();){if(b.value.ca===f)return}else for(e=c,f=b,b=e.oe;b.next();)if(b.value.W===e)return;null!==d&&Jg(d,e,f,null,!0)||(d=a.Zv(c.data),b=Ck(a,d),null!==b&&(nf(b),b=b.copy(),null!==b&&(b.Vh=d,b.W=e,b.ca=f,a.add(b),b.data=c.data)))}}function lk(a,b){if(null!==b){for(var c=u.qb(b),d=0;d<c;d++){var e=u.fb(b,d);ok(a,e)}yk(a,!1)}}
function ok(a,b){if(void 0!==b&&null!==b&&!a.ha.gb&&!a.lk.contains(b)){var c=a.Zv(b),d=Ck(a,c);if(null!==d&&(nf(d),d=d.copy(),null!==d)){d.Vh=c;var c=a.ga,e=c.FG(b);""!==e&&(d.pg=e);e=c.$k(b);void 0!==e&&(e=a.Xe(e),e instanceof U&&(d.W=e));e=c.IG(b);""!==e&&(d.lh=e);e=c.cl(b);void 0!==e&&(e=a.Xe(e),e instanceof U&&(d.ca=e));c=c.Pj(b);if(u.isArray(c))for(var e=u.qb(c),f=0;f<e;f++){var h=u.fb(c,f),h=a.Xe(h);null!==h&&(h.ce=d)}a.add(d);d.data=b}}}
D.prototype.Zv=function(a){var b=this.ga,c="";b instanceof Q?c=b.Zv(a):b instanceof qe&&(c=b.HG(a));return c};var Dk=!1;function Ck(a,b){var c=a.xz.ta(b);null===c&&(c=a.xz.ta(""),null===c&&(Dk||(Dk=!0,u.trace('No Link template found for category "'+b+'"'),u.trace("  Using default link template")),c=a.TA));return c}function jk(a,b){for(var c=u.qb(b),d=0;d<c;d++){var e=u.fb(b,d);pk(a,e)}}
function pk(a,b){if(void 0!==b&&null!==b){var c=a.Nh(b);if(null!==c){c.Za=!1;c.Wg=!1;var d=c.layer;if(null!==d&&d.g===a){var e=a.ga;if(e instanceof Q&&c instanceof U){var f=c,h=e.wb(f.data);if(void 0!==h){for(var k=f.oe;k.next();)Pe(e,h,k.value.data);f.tf&&(k=f.ce,null!==k&&Pe(e,h,k.data));if(f instanceof V)for(f=f.Mc;f.next();)k=f.value.data,e.Ue(k)&&Pe(e,h,k)}}else if(e instanceof qe&&c instanceof U){f=c;k=a.ng(f.data);if(null!==k){k.Za=!1;k.Wg=!1;var l=k.layer;if(null!==l){var m=l.Fe(-1,k,!1);
0<=m&&a.Dc(ce,"parts",l,k,null,m,null);m=k.Rs;null!==m&&m(k,l,null)}}k=a.qd;for(f=f.oe;f.next();)l=f.value,l=(k?l.ca:l.W).data,e.Ue(l)&&Pe(e,h,l)}e=d.Fe(-1,c,!1);0<=e&&a.Dc(ce,"parts",d,c,null,e,null);e=c.Rs;null!==e&&e(c,d,null)}}}}D.prototype.findPartForKey=D.prototype.zG=function(a){if(null===a||void 0===a)return null;a=this.ga.qf(a);return null===a?null:this.$h.ta(a)};
D.prototype.findNodeForKey=D.prototype.Xe=function(a){if(null===a||void 0===a)return null;a=this.ga.qf(a);if(null===a)return null;a=this.$h.ta(a);return a instanceof U?a:null};D.prototype.findPartForData=D.prototype.Nh=function(a){if(null===a)return null;var b=this.$h.ta(a);return null!==b?b:b=this.lk.ta(a)};D.prototype.findNodeForData=D.prototype.Xv=function(a){if(null===a)return null;a=this.$h.ta(a);return a instanceof U?a:null};
D.prototype.findLinkForData=D.prototype.ng=function(a){return null===a?null:this.lk.ta(a)};D.prototype.findNodesByExample=function(a){for(var b=new F,c=this.Rn.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var h=arguments[f];if(u.Sa(h)&&Ek(this,e,h)){b.add(d);break}}}return b.i};
D.prototype.findLinksByExample=function(a){for(var b=new F,c=this.Nn.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var h=arguments[f];if(u.Sa(h)&&Ek(this,e,h)){b.add(d);break}}}return b.i};function Ek(a,b,c){for(var d in c){var e=b[d],f=c[d];if(u.isArray(f)){if(!u.isArray(e)||e.length>=f.length)return!1;for(var h=0;h<e.length;h++){var k=e[h],l=f[h];if(void 0!==l&&!Fk(a,k,l))return!1}}else if(!Fk(a,e,f))return!1}return!0}
function Fk(a,b,c){if("function"===typeof c){if(!c(b))return!1}else if(c instanceof RegExp){if(!b||!c.test(b.toString()))return!1}else if(u.Sa(b)&&u.Sa(c)){if(!Ek(a,b,c))return!1}else if(b!==c)return!1;return!0}u.defineProperty(D,{bK:"nodeTemplate"},function(){return this.ni.ta("")},function(a){var b=this.ni.ta("");b!==a&&(u.C(a,G,D,"nodeTemplate"),this.ni.add("",a),this.h("nodeTemplate",b,a),this.ha.gb||this.nl())});
u.defineProperty(D,{Jz:"nodeTemplateMap"},function(){return this.ni},function(a){var b=this.ni;b!==a&&(u.C(a,la,D,"nodeTemplateMap"),this.ni=a,this.h("nodeTemplateMap",b,a),this.ha.gb||this.nl())});u.defineProperty(D,{yJ:"groupTemplate"},function(){return this.ok.ta("")},function(a){var b=this.ok.ta("");b!==a&&(u.C(a,V,D,"groupTemplate"),this.ok.add("",a),this.h("groupTemplate",b,a),this.ha.gb||this.nl())});
u.defineProperty(D,{iz:"groupTemplateMap"},function(){return this.ok},function(a){var b=this.ok;b!==a&&(u.C(a,la,D,"groupTemplateMap"),this.ok=a,this.h("groupTemplateMap",b,a),this.ha.gb||this.nl())});u.defineProperty(D,{QJ:"linkTemplate"},function(){return this.hj.ta("")},function(a){var b=this.hj.ta("");b!==a&&(u.C(a,W,D,"linkTemplate"),this.hj.add("",a),this.h("linkTemplate",b,a),this.ha.gb||this.nl())});
u.defineProperty(D,{xz:"linkTemplateMap"},function(){return this.hj},function(a){var b=this.hj;b!==a&&(u.C(a,la,D,"linkTemplateMap"),this.hj=a,this.h("linkTemplateMap",b,a),this.ha.gb||this.nl())});u.defineProperty(D,{fH:null},function(){return this.Jl},function(a){this.Jl=a});
u.defineProperty(D,{Ge:"isMouseCaptured"},function(){return this.uB},function(a){var b=this.ib;null!==b&&(a?(this.N.bubbles=!1,b.removeEventListener("mousemove",this.Qo,!1),b.removeEventListener("mousedown",this.Po,!1),b.removeEventListener("mouseup",this.So,!1),b.removeEventListener("mousewheel",this.Zg,!1),b.removeEventListener("DOMMouseScroll",this.Zg,!1),b.removeEventListener("mouseout",this.Ro,!1),window.addEventListener("mousemove",this.Qo,!0),window.addEventListener("mousedown",this.Po,!0),
window.addEventListener("mouseup",this.So,!0),window.addEventListener("mousewheel",this.Zg,!0),window.addEventListener("DOMMouseScroll",this.Zg,!0),window.addEventListener("mouseout",this.Ro,!0),window.addEventListener("selectstart",this.preventDefault,!1)):(window.removeEventListener("mousemove",this.Qo,!0),window.removeEventListener("mousedown",this.Po,!0),window.removeEventListener("mouseup",this.So,!0),window.removeEventListener("mousewheel",this.Zg,!0),window.removeEventListener("DOMMouseScroll",
this.Zg,!0),window.removeEventListener("mouseout",this.Ro,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("mousemove",this.Qo,!1),b.addEventListener("mousedown",this.Po,!1),b.addEventListener("mouseup",this.So,!1),b.addEventListener("mousewheel",this.Zg,!1),b.addEventListener("DOMMouseScroll",this.Zg,!1),b.addEventListener("mouseout",this.Ro,!1)),this.uB=a)});
u.defineProperty(D,{position:"position"},function(){return this.Ma},function(a){var b=this.Ma;if(!b.L(a)){u.C(a,w,D,"position");var c=this.ob.copy();a=a.copy();if(!this.sc&&null!==this.ib){this.sc=!0;var d=this.scale;ij(this,a,this.Cd,this.Ab/d,this.zb/d,this.dn,!1);this.sc=!1}this.Ma=a.Z();a=this.Lb;a.ld&&si(a,b,this.Ma);this.sc||this.dt(c,this.ob)}});u.defineProperty(D,{TG:"initialPosition"},function(){return this.tu},function(a){this.tu.L(a)||(u.C(a,w,D,"initialPosition"),this.tu=a.Z())});
u.defineProperty(D,{UG:"initialScale"},function(){return this.uu},function(a){this.uu!==a&&(u.j(a,"number",D,"initialScale"),this.uu=a)});u.defineProperty(D,{Gs:"grid"},function(){null===this.ad&&aj(this);return this.ad},function(a){var b=this.ad;if(b!==a){null===b&&(aj(this),b=this.ad);u.C(a,A,D,"grid");a.type!==bj&&u.k("Diagram.grid must be a Panel of type Panel.Grid");var c=b.S;null!==c&&c.remove(b);this.ad=a;a.name="GRID";null!==c&&c.add(a);vj(this);this.ma();this.h("grid",b,a)}});
u.u(D,{ob:"viewportBounds"},function(){var a=this.CC;if(null===this.ib)return a;var b=this.Ma,c=this.$b;a.m(b.x,b.y,Math.max(this.Ab,0)/c,Math.max(this.zb,0)/c);return a});u.defineProperty(D,{uD:"fixedBounds"},function(){return this.ku},function(a){var b=this.ku;b.L(a)||(u.C(a,z,D,"fixedBounds"),-Infinity!==a.width&&Infinity!==a.height&&-Infinity!==a.height||u.k("fixedBounds width/height must not be Infinity"),this.ku=a=a.Z(),this.pc(),this.h("fixedBounds",b,a))});
u.defineProperty(D,{xE:"scrollMargin"},function(){return this.vy},function(a){"number"===typeof a?a=new rb(a):u.C(a,rb,D,"scrollMargin");var b=this.vy;b.L(a)||(this.vy=a=a.Z(),this.pc(),this.h("scrollMargin",b,a))});u.defineProperty(D,{yE:"scrollMode"},function(){return this.wy},function(a){var b=this.wy;b!==a&&(u.rb(a,D,D,"scrollMode"),this.wy=a,a===Ni&&gj(this,!1),this.h("scrollMode",b,a))});
u.defineProperty(D,{gE:"positionComputation"},function(){return this.oy},function(a){var b=this.oy;b!==a&&(null!==a&&u.j(a,"function",D,"positionComputation"),this.oy=a,gj(this,!1),this.h("positionComputation",b,a))});u.defineProperty(D,{wE:"scaleComputation"},function(){return this.qy},function(a){var b=this.qy;b!==a&&(null!==a&&u.j(a,"function",D,"scaleComputation"),this.qy=a,Yj(this,this.scale,this.scale),this.h("scaleComputation",b,a))});u.u(D,{Cd:"documentBounds"},function(){return this.eu});
function jj(a,b){a.ei=!1;var c=a.eu;c.L(b)||(b=b.Z(),a.eu=b,gj(a,!1),a.za("DocumentBoundsChanged",null,c.copy()),sj(a))}u.defineProperty(D,{scale:"scale"},function(){return this.$b},function(a){var b=this.$b;u.ze(a,D,"scale");b!==a&&Yj(this,b,a)});u.defineProperty(D,{no:"autoScale"},function(){return this.xl},function(a){var b=this.xl;b!==a&&(u.rb(a,D,D,"autoScale"),this.xl=a,this.h("autoScale",b,a),a!==vf&&gj(this,!1))});
u.defineProperty(D,{BJ:"initialAutoScale"},function(){return this.tk},function(a){var b=this.tk;b!==a&&(u.rb(a,D,D,"initialAutoScale"),this.tk=a,this.h("initialAutoScale",b,a))});u.defineProperty(D,{VG:"initialViewportSpot"},function(){return this.vu},function(a){var b=this.vu;b!==a&&(u.C(a,L,D,"initialViewportSpot"),a.pd()||u.k("initialViewportSpot must be a real Spot: "+a),this.vu=a,this.h("initialViewportSpot",b,a))});
u.defineProperty(D,{SG:"initialDocumentSpot"},function(){return this.su},function(a){var b=this.su;b!==a&&(u.C(a,L,D,"initialDocumentSpot"),a.pd()||u.k("initialViewportSpot must be a real Spot: "+a),this.su=a,this.h("initialDocumentSpot",b,a))});u.defineProperty(D,{Yg:"minScale"},function(){return this.Ku},function(a){u.ze(a,D,"minScale");var b=this.Ku;b!==a&&(0<a?(this.Ku=a,this.h("minScale",b,a),a>this.scale&&(this.scale=a)):u.wa(a,"> 0",D,"minScale"))});
u.defineProperty(D,{Xg:"maxScale"},function(){return this.Hu},function(a){u.ze(a,D,"maxScale");var b=this.Hu;b!==a&&(0<a?(this.Hu=a,this.h("maxScale",b,a),a<this.scale&&(this.scale=a)):u.wa(a,"> 0",D,"maxScale"))});u.defineProperty(D,{Rm:"zoomPoint"},function(){return this.wv},function(a){this.wv.L(a)||(u.C(a,w,D,"zoomPoint"),this.wv=a=a.Z())});
u.defineProperty(D,{Ty:"contentAlignment"},function(){return this.dn},function(a){var b=this.dn;b.L(a)||(u.C(a,L,D,"contentAlignment"),this.dn=a=a.Z(),this.h("contentAlignment",b,a),gj(this,!1))});u.defineProperty(D,{CJ:"initialContentAlignment"},function(){return this.An},function(a){var b=this.An;b.L(a)||(u.C(a,L,D,"initialContentAlignment"),this.An=a=a.Z(),this.h("initialContentAlignment",b,a))});
u.defineProperty(D,{padding:"padding"},function(){return this.Pe},function(a){"number"===typeof a?a=new rb(a):u.C(a,rb,D,"padding");var b=this.Pe;b.L(a)||(this.Pe=a=a.Z(),this.pc(),this.h("padding",b,a))});u.u(D,{yg:"nodes"},function(){return this.Rn.i});u.u(D,{links:"links"},function(){return this.Nn.i});u.u(D,{Sj:"parts"},function(){return this.Db.i});
D.prototype.findTopLevelNodesAndLinks=function(){for(var a=new F(G),b=this.Rn.i;b.next();){var c=b.value;c.Ho&&a.add(c)}for(b=this.Nn.i;b.next();)c=b.value,c.Ho&&a.add(c);return a.i};D.prototype.findTopLevelGroups=function(){return this.Ik.i};u.defineProperty(D,{Qb:"layout"},function(){return this.Nd},function(a){var b=this.Nd;b!==a&&(u.C(a,Je,D,"layout"),null!==b&&(b.g=null,b.group=null),this.Nd=a,a.g=this,a.group=null,this.Ot=!0,this.h("layout",b,a),this.de())});
D.prototype.layoutDiagram=function(a){ej(this);a&&yk(this,!0);xj(this,!1)};function yk(a,b){for(var c=a.Ik.i;c.next();)Gk(a,c.value,b);null!==a.Qb&&(b?a.Qb.vf=!1:a.Qb.H())}function Gk(a,b,c){if(null!==b){for(var d=b.Pn.i;d.next();)Gk(a,d.value,c);null!==b.Qb&&(c?b.Qb.vf=!1:b.Qb.H())}}
function xj(a,b){if(!a.zx){var c=a.Qb,d=a.zu;a.zu=!0;var e=a.Na;a.Na=!0;try{a.Wb("Layout");for(var f=a.Ik.i;f.next();)Hk(a,f.value,b);c.vf||b&&!c.PD||(c.doLayout(a),ej(a),c.vf=!0)}finally{a.Wd("Layout"),a.Ot=!c.vf,a.zu=d,a.Na=e}}}function Hk(a,b,c){if(null!==b){for(var d=b.Pn.i;d.next();)Hk(a,d.value,c);d=b.Qb;null===d||d.vf||c&&!d.PD||(b.jy=!b.location.J(),d.doLayout(b),b.H(Ik),d.vf=!0,zj(a,b))}}
u.defineProperty(D,{qd:"isTreePathToChildren"},function(){return this.yu},function(a){var b=this.yu;if(b!==a&&(u.j(a,"boolean",D,"isTreePathToChildren"),this.yu=a,this.h("isTreePathToChildren",b,a),!this.ha.gb))for(a=this.yg;a.next();)Jk(a.value)});D.prototype.findTreeRoots=function(){for(var a=new E(U),b=this.yg;b.next();){var c=b.value;c.Ho&&null===c.As()&&a.add(c)}return a.i};u.defineProperty(D,{me:null},function(){return this.mB},function(a){this.mB=a});
function Oi(a){function b(a){var b=a.toLowerCase(),h=new E("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new la("string",E),d=new la("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");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");a.Bx=c;a.Ax=d}
function ma(a,b){var c=a.Ax.ta(b);return null!==c?c:a.Ax.ta(b.toLowerCase())}function Kk(a,b){var c=a.Bx.ta(b);if(null!==c)return c;c=a.Bx.ta(b.toLowerCase());if(null!==c)return c;u.k("Unknown DiagramEvent name: "+b);return null}D.prototype.addDiagramListener=D.prototype.Ky=function(a,b){u.j(a,"string",D,"addDiagramListener:name");u.j(b,"function",D,"addDiagramListener:listener");var c=Kk(this,a);null!==c&&c.add(b)};
D.prototype.removeDiagramListener=D.prototype.lE=function(a,b){u.j(a,"string",D,"removeDiagramListener:name");u.j(b,"function",D,"addDiagramListener:listener");var c=Kk(this,a);null!==c&&c.remove(b)};D.prototype.raiseDiagramEvent=D.prototype.za=function(a,b,c){var d=Kk(this,a),e=new Nd;e.g=this;e.name=ma(this,a);void 0!==b&&(e.hA=b);void 0!==c&&(e.Mz=c);a=d.length;if(1===a)d=d.ja(0),d(e);else if(0!==a)for(b=d.Ke(),c=0;c<a;c++)d=b[c],d(e);return e.cancel};
function Cg(a,b){var c=!1;a.ob.Kj(b)&&(c=!0);c=a.dz(b,function(a){return a.T},function(a){return a instanceof W},!0,function(a){return a instanceof W},c);if(0!==c.count)for(c=c.i;c.next();){var d=c.value;d.el&&d.Vb()}}D.prototype.isUnoccupied=D.prototype.Jo=function(a,b){void 0===b&&(b=null);return Lk(this,!1,null,b).Jo(a.x,a.y,a.width,a.height)};
function Lk(a,b,c,d){null===a.md&&(a.md=new Mk);if(a.md.Ls||a.md.group!==c||a.md.fA!==d){if(null===c){b=a.ei?fj(a):a.Cd.copy();b.Jf(100,100);a.md.initialize(b);b=u.Sf();for(var e=a.yg;e.next();){var f=e.value,h=f.layer;null!==h&&h.visible&&!h.Ac&&Nk(a,f,d,b)}}else for(c.ba.J()||c.pf(),b=c.ba.copy(),b.Jf(20,20),a.md.initialize(b),b=u.Sf(),e=c.Mc;e.next();)f=e.value,f instanceof U&&Nk(a,f,d,b);u.ic(b);a.md.group=c;a.md.fA=d;a.md.Ls=!1}else b&&Ok(a.md);return a.md}
function Nk(a,b,c,d){if(b!==c)if(b.Ea()&&b.canAvoid()){c=b.getAvoidableRect(d);d=a.md.ro;b=a.md.po;for(var e=c.x+c.width,f=c.y+c.height,h=c.x;h<e;h+=d){for(var k=c.y;k<f;k+=b)Pk(a.md,h,k);Pk(a.md,h,f)}for(k=c.y;k<f;k+=b)Pk(a.md,e,k);Pk(a.md,e,f)}else if(b instanceof V)for(b=b.Mc;b.next();)e=b.value,e instanceof U&&Nk(a,e,c,d)}function Qk(a,b){null===a.md||a.md.Ls||null!==b&&!b.canAvoid()||(a.md.Ls=!0)}
D.prototype.simulatedMouseMove=D.prototype.Hw=function(a,b,c){if(null!==Ef){var d=Ef.g;c instanceof D||(c=null);var e=Ff;c!==e&&(null!==e&&e!==d&&null!==e.tb.Ed&&(Kf(e),Ef.fw=!1,e.tb.Ed.doSimulatedDragLeave()),Ff=c,null!==c&&c!==d&&null!==c.tb.Ed&&(eg(),e=c.tb.Ed,ag.contains(e)||ag.add(e),c.tb.Ed.doSimulatedDragEnter()));if(null===c||c===d||!c.MC||c.nb||!c.lo)return!1;d=c.tb.Ed;null!==d&&(null!==a?b=c.$p(a):null===b&&(b=new w),c.Ob.da=b,c.Ob.Wk=!1,c.Ob.up=!1,d.doSimulatedDragOver());return!0}return!1};
D.prototype.simulatedMouseUp=D.prototype.JE=function(a,b,c,d){if(null!==Ef){null===d&&(d=b);b=Ff;var e=Ef.g;if(d!==b){if(null!==b&&b!==e&&null!==b.tb.Ed)return Kf(b),Ef.fw=!1,b.tb.Ed.doSimulatedDragLeave(),!1;Ff=d;null!==d&&null!==d.tb.Ed&&(eg(),b=d.tb.Ed,ag.contains(b)||ag.add(b),d.tb.Ed.doSimulatedDragEnter())}if(null===d)return Ef.doCancel(),!0;if(d!==this)return null!==a&&(c=d.$p(a)),d.Ob.da=c,d.Ob.Wk=!1,d.Ob.up=!0,a=d.tb.Ed,null!==a&&a.doSimulatedDrop(),a=Ef,null!==a&&(d=a.mayCopy(),a.zf=d?"Copy":
"Move",a.stopTool()),!0}return!1};u.defineProperty(D,{SC:"autoScrollRegion"},function(){return this.Qt},function(a){"number"===typeof a?a=new rb(a):u.C(a,rb,D,"autoScrollRegion");var b=this.Qt;b.L(a)||(this.Qt=a=a.Z(),this.pc(),this.h("autoScrollRegion",b,a))});function xg(a,b){a.Pt.assign(b);Rk(a,a.Pt).De(a.position)?Kf(a):Sk(a)}
function Sk(a){-1===a.Zm&&(a.Zm=u.setInterval(function(){if(-1!==a.Zm){Kf(a);var b=a.N.event;if(null!==b){var c=Rk(a,a.Pt);c.De(a.position)||(a.position=c,a.N.da=a.XE(a.Pt),a.Hw(b,null,b.target.Y)||a.doMouseMove(),a.ei=!0,jj(a,a.kg()),a.Md=!0,a.bf(),Sk(a))}}},a.lF))}function Kf(a){-1!==a.Zm&&(u.clearInterval(a.Zm),a.Zm=-1)}
function Rk(a,b){var c=a.position,d=a.SC;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.ob,f=a.scale,e=u.Vj(0,0,e.width*f,e.height*f),h=u.fc(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.lt,1),k=k|0;h.x-=k;b.x<e.x+d.left/2&&(h.x-=k);b.x<e.x+d.left/4&&(h.x-=4*k)}else b.x<=e.x+e.width&&b.x>e.x+e.width-d.right&&(k=Math.max(a.lt,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.y<e.y+d.top?(k=Math.max(a.mt,1),k|=0,h.y-=k,b.y<e.y+
d.top/2&&(h.y-=k),b.y<e.y+d.top/4&&(h.y-=4*k)):b.y<=e.y+e.height&&b.y>e.y+e.height-d.bottom&&(k=Math.max(a.mt,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.De(K.Wj)||(c=new w(c.x+h.x/f,c.y+h.y/f));u.ic(e);u.v(h);return c}D.prototype.makeSVG=D.prototype.makeSvg=function(a){void 0===a&&(a=new pa);a.context="svg";a=Tk(this,a);return null!==a?a.sl:null};
D.prototype.makeImage=function(a){void 0===a&&(a=new pa);var b=(a.document||document).createElement("img");b.src=this.tH(a);return b};D.prototype.makeImageData=D.prototype.tH=function(a){void 0===a&&(a=new pa);var b=Tk(this,a);return null!==b?b.toDataURL(a.type,a.details):""};var Uk=!1;
function Tk(a,b){a.Lb.Mi();a.bf();if(null===a.ib)return null;"object"!==typeof b&&u.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var f=b.maxSize;void 0===b.maxSize&&(c=!0,f="svg"===b.context?new ia(Infinity,Infinity):new ia(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,q=b.elementFinished||null,r=
b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new rb(l):l instanceof rb||(l=new rb(0));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.qn=!1;$i(a);var s=new oa(null,p),t=s.getContext("2d"),v=s;if(!(d||e||k||h))return s.width=a.Ab+Math.ceil(l.left+l.right),s.height=a.zb+Math.ceil(l.top+l.bottom),"svg"===b.context&&(t=v=new Nc(s.Dd,p,q),t instanceof
Nc&&(a.qn=!0)),Gj(a,t,l,new ia(s.width,s.height),a.$b,a.Ma,k,m,r,n),a.qn=!0,v;var x=a.Eb.Pv,B=new w(0,0),y=a.Cd.copy();y.tI(a.padding);if(r)for(var C=!0,C=a.Zb.n,I=C.length,H=0;H<I;H++){var T=C[H];if(T.visible&&T.Ac)for(var aa=T.Db.n,T=aa.length,R=0;R<T;R++){var N=aa[R];N.uz&&N.Ea()&&(N=N.ba,N.J()&&y.Sh(N))}}B.x=y.x;B.y=y.y;if(null!==k){var Z,C=!0,aa=k.i;for(aa.reset();aa.next();)I=aa.value,I instanceof G&&(N=I,T=N.layer,null!==T&&!T.visible||null!==T&&!r&&T.Ac||!N.Ea()||(N=N.ba,N.J()&&(C?(C=!1,Z=
N.copy()):Z.Sh(N))));C&&(Z=new z(0,0,0,0));y.width=Z.width;y.height=Z.height;B.x=Z.x;B.y=Z.y}null!==h&&h.J()&&(B=h,e||(e=x));C=aa=0;null!==l&&(aa=l.left+l.right,C=l.top+l.bottom);H=I=0;null!==d&&(I=d.width,H=d.height,isFinite(I)&&(I=Math.max(0,I-aa)),isFinite(H)&&(H=Math.max(0,H-C)));Z=h=0;null!==d&&null!==e?("NaN"===e&&(e=x),d.J()?(h=I,Z=H):isNaN(H)?(h=I,Z=y.height*e):(h=y.width*e,Z=H)):null!==d?d.J()?(e=Math.min(I/y.width,H/y.height),h=I,Z=H):isNaN(H)?(e=I/y.width,h=I,Z=y.height*e):(e=H/y.height,
h=y.width*e,Z=H):null!==e?"NaN"===e&&f.J()?(e=Math.min((f.width-aa)/y.width,(f.height-C)/y.height),e>x?(e=x,h=y.width,Z=y.height):(h=f.width,Z=f.height)):(h=y.width*e,Z=y.height*e):(e=x,h=y.width,Z=y.height);null!==l?(h+=aa,Z+=C):l=new rb(0);null!==f&&(d=f.width,f=f.height,"svg"!==b.context&&c&&!Uk&&(h>d||Z>f)&&(u.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(Z)+" vs 2000x2000) Consider increasing the max size."),Uk=!0),
isNaN(d)&&(d=2E3),isNaN(f)&&(f=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(f)&&(Z=Math.min(Z,f)));s.width=Math.ceil(h);s.height=Math.ceil(Z);"svg"===b.context&&(t=v=new Nc(s.Dd,p,q),t instanceof Nc&&(a.qn=!0));Gj(a,t,l,new ia(Math.ceil(h),Math.ceil(Z)),e,B,k,m,r,n);a.qn=!0;return v}D.inherit=function(a,b){u.j(a,"function",D,"inherit");u.j(b,"function",D,"inherit");b.AF&&u.k("Cannot inherit from "+u.rg(b));u.Ga(a,b)};
function Vi(){this.DF="63ad05bbe23a1786468a4c741b6d2";this.DF===this._tk?this.vh=!0:Vk(this,!1)}
function Vk(a,b){var c="p",d=window[u.Da("76a715b2f73f148a")][u.Da("72ba13b5")];if(u.Da("77bb5bb2f32603de")===window[u.Da("76a715b2f73f148a")][u.Da("6aba19a7ec351488")])try{a.vh=!window[u.Da("4da118b7ec2108")]([u.Da("5bb806bfea351a904a84515e1b6d38b6")])([u.Da("49bc19a1e6")])([u.Da("59bd04a1e6380fa5539b")])([u.Da("7bb8069ae7")]===u.Da(u.adym));if(!1===a.vh)return;a.vh=!window[u.Da("4da118b7ec2108")]([u.Da("5bb806bfea351a904a84515e1b6d38b6")])([u.Da("49bc19a1e6")])([u.Da("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([u.Da("7bb8069ae7")]===u.Da(u.adym));
if(!1===a.vh)return}catch(e){}for(var f=d[u.Da("76ad18b4f73e")],h=d[u.Da("73a612b6fb191d")](u.Da("35e7"))+2;h<f;h++)c+=d[h];d=c[u.Da("73a612b6fb191d")](u.Da(u.adym));0>=d&&u.Da(u.adym)!==u.Da("7da71ca0ad381e90")&&(d=c[u.Da("73a612b6fb191d")](u.Da("76a715b2ef3e149757")));a.vh=!(0<d&&d<c[u.Da("73a612b6fb191d")](u.Da("35")));a.vh&&(c=window.document[u.Da("79ba13b2f7333e8846865a7d00")]("div"),d=u.Da("02cncncn"),"."===d[0]&&(d=d[u.Da("69bd14a0f724128a44")](1)),c[u.Da("79a417a0f0181a8946")]=d,window.document[u.Da("78a712aa")]?
(window.document[u.Da("78a712aa")][u.Da("7bb806b6ed32388c4a875b")](c),d=window[u.Da("7dad0290ec3b0b91578e5b40007031bf")](c)[u.Da("7dad0283f1390b81519f4645156528bf")](u.Da("78a704b7e62456904c9b12701b6532a8")),window.document[u.Da("78a712aa")][u.Da("68ad1bbcf533388c4a875b")](c),d&&-1!==d.indexOf(u.Da(u.XF))&&-1!==d.indexOf(u.Da(u.YF))&&(a.vh=!1)):(a.vh=null,b&&(a.vh=!1)))}
Vi.prototype.wl=function(a){a.Gg.setTransform(a.nf,0,0,a.nf,0,0);null===this.vh&&Vk(this,!0);return 0<this.vh&&this!==this.BF?!0:!1};Vi.prototype.t=function(){this.BF=null};
function Wi(a,b){void 0!==b&&null!==b||u.k("Diagram setup requires an argument DIV.");null!==a.Jb&&u.k("Diagram has already completed setup.");"string"===typeof b?a.Jb=window.document.getElementById(b):b instanceof HTMLDivElement?a.Jb=b:u.k("No DIV or DIV id supplied: "+b);null===a.Jb&&u.k("Invalid DIV id; could not get element with id: "+b);void 0!==a.Jb.Y&&u.k("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Jb,null).position&&(a.Jb.style.position=
"relative");a.Jb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Jb.style["-ms-touch-action"]="none";a.Jb.innerHTML="";a.Jb.Y=a;var c=new oa(a);c.Dd.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";void 0!==c.style&&(c.style.position="absolute",c.style.top="0px",c.style.left="0px","rtl"===window.getComputedStyle(a.Jb,null).getPropertyValue("direction")&&(a.wB=!0),c.style.zIndex="2",c.style.DK="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
"none");a.Ab=a.Jb.clientWidth||1;a.zb=a.Jb.clientHeight||1;a.ib=c;a.Gg=c.getContext("2d");var d=a.Gg;a.nf=a.computePixelRatio();Ij(a,a.Ab,a.zb);a.Zw=d[u.Da("7eba17a4ca3b1a8346")][u.Da("78a118b7")](d,u.wl,4,4);a.Jb.insertBefore(c.Dd,a.Jb.firstChild);c=new oa(null);c.width=1;c.height=1;a.Dx=c;a.dB=c.getContext("2d");var c=u.createElement("div"),d=u.createElement("div"),e=u.createElement("div"),f=u.createElement("div");c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Ab+"px";c.style.height=
a.zb+"px";c.style.zIndex="1";d.style.position="absolute";d.style.overflow="auto";d.style.width=a.Ab+"px";d.style.height=a.zb+"px";d.style.zIndex="1";e.style.position="absolute";e.style.width="1px";e.style.height="1px";f.style.position="absolute";f.style.width="1px";f.style.height="1px";a.Jb.appendChild(c);a.Jb.appendChild(d);c.appendChild(e);d.appendChild(f);c.onscroll=a.LB;c.onmousedown=a.Ru;c.ontouchstart=a.Ru;c.Y=a;c.bC=!0;d.onscroll=a.LB;d.onmousedown=a.Ru;d.ontouchstart=a.Ru;d.Y=a;d.cC=!0;a.uj=
c;a.vj=d;a.ty=e;a.uy=f;a.hE=u.gD(function(){a.im=null;a.ma()},300,!1);a.aF=u.gD(function(){gi(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.Qo=function(b){if(a.isEnabled){a.Jl=!0;var c=a.Jc;u.Dm&&c.jl?(b.preventDefault(),b.simulated=!0,a.Ir=b):(a.Jc=a.Ob,a.Ob=c,nj(a,a,b,c,!0),a.Hw(b,null,b.target.Y)||(a.doMouseMove(),a.Va.isBeyondDragSize()&&(yf(a),a.Ol=0)))}};a.Po=function(b){if(a.isEnabled){a.Jl=!0;var c=a.Jc;if(u.Dm&&null!==a.Ir)a.Ir=b,b.preventDefault();else if(u.Dm&&
400>b.timeStamp-a.Pl)b.preventDefault();else if(a.Jc=a.Ob,a.Ob=c,nj(a,a,b,c,!0),c.Wk=!0,c.Te=b.detail,a.nk=c.copy(),!0===c.Vp.simulated)b.preventDefault(),b.simulated=!0;else if(Ef=null,a.doMouseDown(),1===b.button)return b.preventDefault(),!1}};a.So=function(b){if(a.isEnabled){a.Jl=!0;var c=a.Jc;if(u.Dm){if(400>b.timeStamp-a.Pl){b.preventDefault();return}a.Pl=b.timeStamp}if(u.Dm&&null!==a.Ir)a.Ir=null,b.preventDefault();else{a.Jc=a.Ob;a.Ob=c;nj(a,a,b,c,!0);c.up=!0;c.Te=b.detail;if(u.aH||u.bH)b.timeStamp-
a.Pl<a.zC&&!a.Va.isBeyondDragSize()?a.Ol++:a.Ol=1,a.Pl=b.timeStamp,c.Te=a.Ol;c.bubbles=b.bubbles;b.target.Y&&(c.Cg=b.target.Y);a.JE(b,null,new w,c.Cg)||(a.doMouseUp(),Kf(a),rj(c,b))}}};a.Zg=function(b){if(a.isEnabled){var c=a.Jc;a.Jc=a.Ob;a.Ob=c;nj(a,a,b,c,!0);c.bubbles=!0;c.Uk=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();rj(c,b)}};a.Ro=function(){if(a.isEnabled){a.Jl=!1;var b=a.Va;b.cancelWaitAfter();b instanceof jf&&b.hideToolTip()}};a.SE=function(b){if(a.isEnabled){a.kv=!1;
a.Xx=!0;var c=a.Jc;a.Jc=a.Ob;a.Ob=c;pj(a,b,b.targetTouches[0],c,1<b.touches.length);a.doMouseDown();2>b.touches.length&&mj(a,c);rj(c,b)}};a.RE=function(b){if(a.isEnabled){var c=a.Jc;a.Jc=a.Ob;a.Ob=c;var d=null;0<b.changedTouches.length?d=b.changedTouches[0]:0<b.targetTouches.length&&(d=b.targetTouches[0]);qj(a,b,d,c,1<b.touches.length);(a.Va.isBeyondDragSize()||1<b.touches.length)&&yf(a);a.Hw(d?d:b,null,c.Cg)||(a.doMouseMove(),rj(c,b))}};a.QE=function(b){if(a.isEnabled){yf(a);if(a.kv)return b.preventDefault(),
!1;var c=a.Jc;a.Jc=a.Ob;a.Ob=c;if(1<b.touches.length)a.yn&&(a.Lx=!1);else{var d=null,e=null;0<b.changedTouches.length?e=b.changedTouches[0]:0<b.targetTouches.length&&(e=b.targetTouches[0]);c.g=a;c.Te=1;if(null!==e){var d=window.document.elementFromPoint(e.clientX,e.clientY),f,p;d&&d.Y?(p=e,f=d.Y):(p=b.changedTouches[0],f=a);oj(f,p,c);f=e.screenX;p=e.screenY;var q=a.AB;b.timeStamp-a.Pl<a.zC&&!(25<Math.abs(q.x-f)||25<Math.abs(q.y-p))?a.Ol++:a.Ol=1;c.Te=a.Ol;a.Pl=b.timeStamp;a.AB.m(f,p)}c.gd=0;c.button=
0;c.Wk=!1;c.up=!0;c.Uk=0;c.Tc=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.Cg=null===d?b.target.Y:d.Y?d.Y:null;c.pe=null;a.JE(e?e:b,null,new w,c.Cg)||(a.doMouseUp(),rj(c,b),a.Xx=!1)}}};a.KH=function(b){if("touch"===b.pointerType){var c=a.WB;void 0===c[b.pointerId]&&(a.hr++,c[b.pointerId]=b);a.Df[0]=null;a.Df[1]=null;for(var d in c)if(null===a.Df[0])a.Df[0]=c[d];else if(null===a.Df[1]){a.Df[1]=c[d];break}a.isEnabled&&(a.kv=!1,c=a.Jc,a.Jc=a.Ob,a.Ob=c,pj(a,b,b,c,1<a.hr),a.doMouseDown(),2>a.hr&&
mj(a,c),rj(c,b))}};a.MH=function(b){if("touch"===b.pointerType&&!(2>a.hr)){var c=a.Df;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Jc,a.Jc=a.Ob,a.Ob=c,qj(a,b,b,c,!0),yf(a),a.Hw(b,null,c.Cg)||(a.doMouseMove(),rj(c,b)))}};a.LH=function(b){if("touch"===b.pointerType){var c=a.WB;void 0!==c[b.pointerId]&&(a.hr--,delete c[b.pointerId],c=a.Df,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};
$i(a);Zi(a)}function Wk(a){1<arguments.length&&u.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");D.call(this,a);this.Av=!0;this.Nk=!1;this.nb=!0;this.Ty=Db;this.Qb=new Xk}u.Ga(Wk,D);u.fa("Palette",Wk);
function Si(a){1<arguments.length&&u.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");D.call(this,a);this.Uh.isEnabled=!1;this.sc=!0;this.rj=null;this.rF=this.hu=!0;this.iI("drawShadows",!1);var b=new G,c=new X;c.stroke="magenta";c.hb=2;c.fill="transparent";c.name="BOXSHAPE";b.pl=!0;b.Zz="BOXSHAPE";b.zz="BOXSHAPE";b.tE="BOXSHAPE";b.cursor="move";b.add(c);this.zl=b;c=new lf;c.type=oh;c.Ze=Ib;var d=new ph;d.tg=!0;c.add(d);d=new X;d.Hj=Ib;d.Fb="Rectangle";
d.xa=new ia(64,64);d.cursor="se-resize";d.alignment=Vb;c.add(d);b.rE=c;this.lm=this.Ij=!1;this.of=this.hs=!0;this.SC=0;this.Cy=u.createElement("canvas");this.CF=this.Cy.getContext("2d");this.tb.Ed=new Yk;this.tb.uE=new Zk;var e=this;this.click=function(){var a=e.rj;if(null!==a){var b=a.ob,c=e.N.da;a.position=new w(c.x-b.width/2,c.y-b.height/2)}};this.dE=function(){$k(e)};this.cE=function(){null!==e.rj&&(e.pc(),e.ma())};this.no=kj;this.sc=!1}u.Ga(Si,D);u.fa("Overview",Si);
function al(a){a.sc||a.vd||!1!==a.Ef||(a.Ef=!0,requestAnimationFrame(function(){if(a.Ef&&!a.vd&&(a.Ef=!1,null!==a.Jb)){a.vd=!0;ej(a);a.Cd.J()||jj(a,a.kg());null===a.Jb&&u.k("No div specified");null===a.ib&&u.k("No canvas specified");if(a.Md){var b=a.rj;if(null!==b&&!b.Lb.Vg&&!b.Lb.ld){var b=a.Gg,c=a.Cy;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.ib.width,a.ib.height);b.drawImage(c,0,0);c=a.Sd;c.reset();1!==a.$b&&c.scale(a.scale);0===a.position.x&&0===a.position.y||c.translate(-a.Ma.x,-a.Ma.y);b.setTransform(c.m11,
c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.Zb.n,d=c.length,e=0;e<d;e++)c[e].We(b,a);a.uk=!1;a.Md=!1}}a.vd=!1}}))}Si.prototype.computePixelRatio=function(){return 1};
Si.prototype.We=function(){null===this.Jb&&u.k("No div specified");null===this.ib&&u.k("No canvas specified");if(this.Md){var a=this.rj;if(null!==a&&!a.Lb.Vg&&!a.Lb.ld){if(!this.rF){var b=a.tb.Ed;if(null!==b&&b.na)return}Dj(this);b=a.Gs;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&vj(a);var c=this.ib,b=this.Gg,d=this.Cy,e=this.CF;d.width=c.width;d.height=c.height;b.Et="";b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,this.ib.width,this.ib.height);d=this.Sd;d.reset();1!==this.$b&&d.scale(this.scale);
0===this.position.x&&0===this.position.y||d.translate(-this.Ma.x,-this.Ma.y);b.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);for(var d=this.hu,f=this.ob,h=a.Zb.n,k=h.length,a=0;a<k;a++){var l=h[a],m=b,n=f,p=d;if(l.visible&&0!==l.Ic&&(void 0===p&&(p=!0),p||!l.Ac)){1!==l.Ic&&(m.globalAlpha=l.Ic);for(var p=this.scale,l=l.Db.n,q=l.length,r=0;r<q;r++){var s=l[r],t=s.ba;t.sg(n)&&(1<t.width*p||1<t.height*p?s.We(m,this):wi(s,m))}m.globalAlpha=1}}e.drawImage(c.Dd,0,0);c=this.Zb.n;e=c.length;for(a=0;a<e;a++)c[a].We(b,
this);this.Md=this.uk=!1}}};
u.defineProperty(Si,{Lz:"observed"},function(){return this.rj},function(a){var b=this.rj;null!==a&&u.C(a,D,Si,"observed");a instanceof Si&&u.k("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.Tg),b.lE("ViewportBoundsChanged",this.dE),b.lE("DocumentBoundsChanged",this.cE),b.Ul.remove(this)),this.rj=a,null!==a&&(a.Ky("ViewportBoundsChanged",this.dE),a.Ky("DocumentBoundsChanged",this.cE),a.Ul.add(this),this.add(this.Tg),$k(this)),this.pc(),this.h("observed",
b,a))});u.defineProperty(Si,{Tg:"box"},function(){return this.zl},function(a){var b=this.zl;b!==a&&(this.zl=a,this.remove(b),this.add(this.zl),$k(this),this.h("box",b,a))});u.defineProperty(Si,{vJ:"drawsTemporaryLayers"},function(){return this.hu},function(a){this.hu!==a&&(this.hu=a,this.Sz())});
function $k(a){var b=a.Tg;if(null!==b){var c=a.rj;if(null!==c){a.Md=!0;var c=c.ob,d=b.nt,e=u.ul();e.m(c.width,c.height);d.xa=e;u.Oj(e);a=2/a.scale;d instanceof X&&(d.hb=a);b.location=new w(c.x-a/2,c.y-a/2)}}}Si.prototype.kg=function(){var a=this.rj;return null===a?K.kF:a.Cd};Si.prototype.nz=function(){!0!==this.Md&&(this.Md=!0,al(this))};Si.prototype.dt=function(a){this.sc||(cj(this),this.ma(),sj(this),this.pc(),$k(this),this.za("ViewportBoundsChanged",null,a))};
function Yk(){uf.call(this);this.Ck=null}u.Ga(Yk,uf);Yk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.Nk||!a.of)return!1;var b=a.Lz;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.ob;this.Ck=new w(c.width/2,c.height/2);a=a.wc.da;b.position=new w(a.x-this.Ck.x,a.y-this.Ck.y)}return!0};Yk.prototype.doActivate=function(){this.Ck=null;uf.prototype.doActivate.call(this)};
Yk.prototype.moveParts=function(){var a=this.g,b=a.Lz;if(null!==b){var c=a.Tg;if(null!==c){if(null===this.Ck){var d=a.wc.da,c=c.location;this.Ck=new w(d.x-c.x,d.y-c.y)}a=a.N.da;b.position=new w(a.x-this.Ck.x,a.y-this.Ck.y)}}};function Zk(){mh.call(this)}u.Ga(Zk,mh);Zk.prototype.resize=function(a){var b=this.g.Lz;if(null!==b){var c=b.ob.copy();b.position=a.position;(c.width!==a.width||c.height!==a.height)&&0<a.width&&0<a.height&&(b.scale=Math.min(c.width/a.width,c.height/a.height))}};
function ga(a){1<arguments.length&&u.k("Brush constructor can take at most one optional argument, the Brush type.");u.gc(this);this.Ca=!1;void 0===a?(this.oa=te,this.cn="black"):"string"===typeof a?(this.oa=te,this.cn=a):(this.oa=a,this.cn="black");var b=this.oa;b===ue?(this.ao=Db,this.sn=Ub):this.sn=b===ve?this.ao=Ib:this.ao=vb;this.hv=0;this.iu=NaN;this.Fg=this.Wu=this.Eg=null;this.kx=this.lx=0}u.fa("Brush",ga);var te;ga.Solid=te=u.s(ga,"Solid",0);var ue;ga.Linear=ue=u.s(ga,"Linear",1);var ve;
ga.Radial=ve=u.s(ga,"Radial",2);var bl;ga.Pattern=bl=u.s(ga,"Pattern",4);ga.prototype.copy=function(){var a=new ga;a.oa=this.oa;a.cn=this.cn;a.ao=this.ao.Z();a.sn=this.sn.Z();a.hv=this.hv;a.iu=this.iu;null!==this.Eg&&(a.Eg=this.Eg.copy());a.Wu=this.Wu;return a};ga.prototype.Ka=function(){this.freeze();Object.freeze(this);return this};ga.prototype.freeze=function(){this.Ca=!0;null!==this.Eg&&this.Eg.freeze();return this};
ga.prototype.La=function(){Object.isFrozen(this)&&u.k("cannot thaw constant: "+this);this.Ca=!1;null!==this.Eg&&this.Eg.La();return this};ga.prototype.toString=function(){var a="Brush(";if(this.type===te)a+=this.color;else if(a=this.type===ue?a+"Linear ":this.type===ve?a+"Radial ":this.type===bl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.os)for(var b=this.os.i;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
ga.prototype.addColorStop=ga.prototype.addColorStop=function(a,b){u.I(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&u.wa(a,"0 <= loc <= 1",ga,"addColorStop:loc");u.j(b,"string",ga,"addColorStop:color");null===this.Eg&&(this.Eg=new la("number","string"));this.Eg.add(a,b);this.oa===te&&(this.type=ue);this.Fg=null};
u.defineProperty(ga,{type:"type"},function(){return this.oa},function(a){u.I(this,a);u.rb(a,ga,ga,"type");this.oa=a;this.start.ne()&&(a===ue?this.start=Db:a===ve&&(this.start=Ib));this.end.ne()&&(a===ue?this.end=Ub:a===ve&&(this.end=Ib));this.Fg=null});u.defineProperty(ga,{color:"color"},function(){return this.cn},function(a){u.I(this,a);this.cn=a;this.Fg=null});u.defineProperty(ga,{start:"start"},function(){return this.ao},function(a){u.I(this,a);u.C(a,L,ga,"start");this.ao=a.Z();this.Fg=null});
u.defineProperty(ga,{end:"end"},function(){return this.sn},function(a){u.I(this,a);u.C(a,L,ga,"end");this.sn=a.Z();this.Fg=null});u.defineProperty(ga,{ut:"startRadius"},function(){return this.hv},function(a){u.I(this,a);u.ze(a,ga,"startRadius");0>a&&u.wa(a,">= zero",ga,"startRadius");this.hv=a;this.Fg=null});u.defineProperty(ga,{us:"endRadius"},function(){return this.iu},function(a){u.I(this,a);u.ze(a,ga,"endRadius");0>a&&u.wa(a,">= zero",ga,"endRadius");this.iu=a;this.Fg=null});
u.defineProperty(ga,{os:"colorStops"},function(){return this.Eg},function(a){u.I(this,a);this.Eg=a;this.Fg=null});u.defineProperty(ga,{pattern:"pattern"},function(){return this.Wu},function(a){u.I(this,a);this.Wu=a;this.Fg=null});
ga.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+d+e+c};var cl=u.createElement("canvas").getContext("2d"),fa;
ga.isValidColor=fa=function(a){if("black"===a)return!0;if(""===a)return!1;cl.fillStyle="#000000";var b=cl.fillStyle;cl.fillStyle=a;if(cl.fillStyle!==b)return!0;cl.fillStyle="#FFFFFF";b=cl.fillStyle;cl.fillStyle=a;return cl.fillStyle!==b};
function S(){u.gc(this);this.ea=30723;this.Ic=1;this.Pg=null;this.Ub="";this.lc=this.Ib=null;this.Ma=(new w(NaN,NaN)).freeze();this.jf=(new ia(NaN,NaN)).freeze();this.nj=K.op;this.lj=K.jF;this.Sd=new ja;this.Xm=new ja;this.yk=new ja;this.$b=this.fu=1;this.Ym=0;this.Hh=dl;this.Gq=K.np;this.Pc=(new z(NaN,NaN,NaN,NaN)).freeze();this.Xb=(new z(NaN,NaN,NaN,NaN)).freeze();this.Hc=(new z(0,0,NaN,NaN)).freeze();this.Sr=this.Wp=this.Q=this.ir=this.jr=null;this.Tr=this.Xp=Infinity;this.vp=this.se=uc;this.wr=
0;this.tj=1;this.Cp=0;this.Wi=1;this.Ar=-Infinity;this.zr=0;this.Br=K.Wj;this.Cr=dh;this.Jp="";this.Gc=this.P=null;this.$m=-1;this.Wl=this.Xh=this.Bl=this.$n=null}u.Lh(S);u.fa("GraphObject",S);
S.prototype.cloneProtected=function(a){a.ea=this.ea|6144;a.Ic=this.Ic;a.Ub=this.Ub;a.Ib=this.Ib;a.lc=this.lc;a.Ma.assign(this.Ma);a.jf.assign(this.jf);a.nj=this.nj.Z();a.lj=this.lj.Z();a.yk=this.yk.copy();a.$b=this.$b;a.Ym=this.Ym;a.Hh=this.Hh;a.Gq=this.Gq.Z();a.Pc.assign(this.Pc);a.Xb.assign(this.Xb);a.Hc.assign(this.Hc);a.ir=this.ir;a.Q=null!==this.Q?this.Q.copy():null;a.Wp=this.Wp;a.Xp=this.Xp;a.Sr=this.Sr;a.Tr=this.Tr;a.se=this.se.Z();a.vp=this.vp.Z();a.wr=this.wr;a.tj=this.tj;a.Cp=this.Cp;a.Wi=
this.Wi;a.Ar=this.Ar;a.zr=this.zr;a.Br=this.Br.Z();a.Cr=this.Cr;a.Jp=this.Jp;a.P=null!==this.P?this.P.copy():null;a.Gc=this.Gc;a.$m=this.$m;if(null!==this.Bl){a.Bl=u.Pk(this.Bl);for(var b=0;b<this.Bl.length;b++){var c=this.Bl[b];a[c]=this[c]}}null!==this.Xh&&(a.Xh=this.Xh.copy())};S.prototype.Mh=function(a){a.jr=null;a.Wl=null;a.R()};S.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);return a};S.prototype.copy=function(){return this.clone()};
S.prototype.toString=function(){return u.rg(Object.getPrototypeOf(this))+"#"+u.Uc(this)};var qh;S.None=qh=u.s(S,"None",0);var dl;S.Default=dl=u.s(S,"Default",0);var el;S.Vertical=el=u.s(S,"Vertical",4);var fl;S.Horizontal=fl=u.s(S,"Horizontal",5);var cd;S.Fill=cd=u.s(S,"Fill",3);var sh;S.Uniform=sh=u.s(S,"Uniform",1);var th;S.UniformToFill=th=u.s(S,"UniformToFill",2);function gl(a){a.P=new hl}
S.prototype.Ee=function(){var a=new il;a.cj=vb;a.Ej=vb;a.aj=10;a.Cj=10;a.$i=jl;a.Bj=jl;a.bj=0;a.Dj=0;this.Q=a};function kl(a,b,c,d,e,f,h){var k=.001,l=f.length;a.moveTo(b,c);d-=b;k=e-c;0===d&&(d=.001);e=k/d;for(var m=Math.sqrt(d*d+k*k),n=0,p=!0,q=0===h?!1:!0;.1<=m;){if(q){k=f[n++%l];for(k-=h;0>k;)k+=f[n++%l],p=!p;q=!1}else k=f[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}}
S.prototype.raiseChangedEvent=S.prototype.Dc=function(a,b,c,d,e,f,h){var k=this.T;null!==k&&(k.Lm(a,b,c,d,e,f,h),0!==(this.ea&1024)&&c===this&&a===$d&&ll(this,k,b))};
function ll(a,b,c){var d=a.zo();if(null!==d)for(var e=a.Gc.i;e.next();){var f=e.value,h=null;if(null!==f.Nm){h=ef(f,d,a);if(null===h)continue;f.Mw(a,h,c,null)}else if(f.xt){var k=b.g;null!==k&&f.Mw(a,k.ga.Zs,c,k)}else{var l=d.data;if(null===l)continue;k=b.g;null!==k&&k.Iw||f.Mw(a,l,c,k)}null!==h&&(k=d.Vv(f.tl),null!==k&&f.ZE(k,h,c))}}S.prototype.Vv=function(a){return this.$m===a?this:null};S.prototype.raiseChanged=S.prototype.h=function(a,b,c){this.Dc($d,a,this,b,c)};
function ml(a,b,c,d,e){var f=a.Pc,h=a.yk;h.reset();nl(a,h,b,c,d,e);a.yk=h;f.x=b;f.y=c;f.width=d;f.height=e;h.Os()||h.WE(f)}function ol(a,b,c,d){if(!1===a.Ag)return!1;d.multiply(a.transform);return c?a.sg(b,d):a.sm(b,d)}
S.prototype.sD=function(a,b,c){if(!1===this.Ag)return!1;var d=this.Ha;b=a.Lj(b);var e=!1;c&&(e=Xa(a.x,a.y,0,0,0,d.height)<b||Xa(a.x,a.y,0,d.height,d.width,d.height)<b||Xa(a.x,a.y,d.width,d.height,d.width,0)<b||Xa(a.x,a.y,d.width,0,0,0)<b);c||(e=Xa(a.x,a.y,0,0,0,d.height)<b&&Xa(a.x,a.y,0,d.height,d.width,d.height)<b&&Xa(a.x,a.y,d.width,d.height,d.width,0)<b&&Xa(a.x,a.y,d.width,0,0,0)<b);return e};S.prototype.Tf=function(){return!0};
S.prototype.containsPoint=S.prototype.Aa=function(a){var b=u.K();b.assign(a);this.transform.ab(b);var c=this.ba;if(!c.J())return!1;var d=this.g;if(null!==d&&d.Xx){var e=d.gz("extraTouchThreshold"),f=d.gz("extraTouchArea"),h=f/2,k=this.Ha,d=this.Hi()*d.scale,l=1/d;if(k.width*d<e&&k.height*d<e)return a=qb(c.x-h*l,c.y-h*l,c.width+f*l,c.height+f*l,b.x,b.y),u.v(b),a}if(this instanceof lf||this instanceof X?qb(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Aa(b)){if(this.Xh&&!this.Xh.Aa(b))return!1;if(null!==
this.lc&&c.Aa(b)||null!==this.Ib&&this.Hc.Aa(a))return!0;u.v(b);return this.Jj(a)}u.v(b);return!1};S.prototype.Jj=function(a){var b=this.Ha;return qb(0,0,b.width,b.height,a.x,a.y)};S.prototype.containsRect=S.prototype.Kj=function(a){if(0===this.angle)return this.ba.Kj(a);var b=this.Ha,b=u.Vj(0,0,b.width,b.height),c=this.transform,d=!1,e=u.fc(a.x,a.y);b.Aa(c.Oh(e))&&(e.m(a.x,a.bottom),b.Aa(c.Oh(e))&&(e.m(a.right,a.bottom),b.Aa(c.Oh(e))&&(e.m(a.right,a.y),b.Aa(c.Oh(e))&&(d=!0))));u.v(e);u.ic(b);return d};
S.prototype.containedInRect=S.prototype.sm=function(a,b){if(void 0===b)return a.Kj(this.ba);var c=this.Ha,d=!1,e=u.fc(0,0);a.Aa(b.ab(e))&&(e.m(0,c.height),a.Aa(b.ab(e))&&(e.m(c.width,c.height),a.Aa(b.ab(e))&&(e.m(c.width,0),a.Aa(b.ab(e))&&(d=!0))));return d};
S.prototype.intersectsRect=S.prototype.sg=function(a,b){if(void 0===b&&(b=this.transform,0===this.angle))return a.sg(this.ba);var c=this.Ha,d=b,e=u.fc(0,0),f=u.fc(0,c.height),h=u.fc(c.width,c.height),k=u.fc(c.width,0),l=!1;if(a.Aa(d.ab(e))||a.Aa(d.ab(f))||a.Aa(d.ab(h))||a.Aa(d.ab(k)))l=!0;else{var c=u.Vj(0,0,c.width,c.height),m=u.fc(a.x,a.y);c.Aa(d.Oh(m))?l=!0:(m.m(a.x,a.bottom),c.Aa(d.Oh(m))?l=!0:(m.m(a.right,a.bottom),c.Aa(d.Oh(m))?l=!0:(m.m(a.right,a.y),c.Aa(d.Oh(m))&&(l=!0))));u.v(m);u.ic(c);
!l&&(K.dw(a,e,f)||K.dw(a,f,h)||K.dw(a,h,k)||K.dw(a,k,e))&&(l=!0)}u.v(e);u.v(f);u.v(h);u.v(k);return l};S.prototype.getDocumentPoint=S.prototype.lb=function(a,b){void 0===b&&(b=new w);a.ne()&&u.k("getDocumentPoint:s Spot must be real: "+a.toString());var c=this.Ha;b.m(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY);this.Ff.ab(b);return b};S.prototype.getDocumentAngle=S.prototype.Zk=function(){var a;a=this.Ff;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a};
S.prototype.getDocumentScale=S.prototype.Hi=function(){if(0!==(this.ea&4096)===!1)return this.fu;var a=this.$b;return null!==this.S?a*this.S.Hi():a};S.prototype.getLocalPoint=S.prototype.zD=function(a,b){void 0===b&&(b=new w);b.assign(a);this.Ff.Oh(b);return b};S.prototype.getNearestIntersectionPoint=S.prototype.bl=function(a,b,c){return this.Co(a.x,a.y,b.x,b.y,c)};g=S.prototype;
g.Co=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy);if(null!==this.nm)return f=this.ba,K.bl(f.left,f.top,f.right,f.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.m(0,0);d=this.Ha;c=K.bl(0,0,d.width,d.height,h,a,b,c,e);e.transform(f);return c};
function Ph(a,b,c,d,e){if(!1!==Aj(a)){var f=a.margin,h=f.right+f.left,f=f.top+f.bottom;b=Math.max(b-h,0);c=Math.max(c-f,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-f,0);var h=a.angle,f=0,f=a.xa,k=0;a.hb&&(k=a.hb);90===h||270===h?(b=isFinite(f.height)?f.height+k:b,c=isFinite(f.width)?f.width+k:c):(b=isFinite(f.width)?f.width+k:b,c=isFinite(f.height)?f.height+k:c);var f=d||0,k=e||0,l=a instanceof A;switch(pl(a,!0)){case qh:k=f=0;l&&(c=b=Infinity);break;case cd:isFinite(b)&&b>d&&(f=b);isFinite(c)&&
c>e&&(k=c);break;case fl:isFinite(b)&&b>d&&(f=b);k=0;l&&(c=Infinity);break;case el:isFinite(c)&&c>e&&(k=c),f=0,l&&(b=Infinity)}var l=a.af,m=a.vg;f>l.width&&m.width<l.width&&(f=l.width);k>l.height&&m.height<l.height&&(k=l.height);d=Math.max(f/a.scale,m.width);e=Math.max(k/a.scale,m.height);l.width<d&&(d=Math.min(m.width,d));l.height<e&&(e=Math.min(m.height,e));b=Math.min(l.width,b);c=Math.min(l.height,c);b=Math.max(d,b);c=Math.max(e,c);if(90===h||270===h)f=b,b=c,c=f,f=d,d=e,e=f;a.Pc.La();a.Oo(b,c,
d,e);a.Pc.freeze();a.Pc.J()||u.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Pc.toString());uj(a,!1)}}
g.zc=function(a,b,c,d,e){this.Jg();var f=u.Sf();f.assign(this.Xb);this.Xb.La();if(!1===Bj(this)){var h=this.Xb;h.x=a;h.y=b;h.width=c;h.height=d}else this.xi(a,b,c,d);this.Xb.freeze();this.Xh=void 0===e?null:e;c=!1;void 0!==e?c=!0:null!==this.S&&(e=this.S.Hc,d=this.Ba,null!==this.nm&&(d=this.Xb),c=b+d.height,d=a+d.width,c=!(0<=a+.05&&d<=e.width+.05&&0<=b+.05&&c<=e.height+.05),this instanceof qa&&(a=this.Hc,this.Gu>a.height||this.ej.Oe>a.width))&&(c=!0);this.ea=c?this.ea|256:this.ea&-257;this.Xb.J()||
u.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Xb.toString());this.sw(f,this.Xb);u.ic(f)};g.xi=function(){};
function ql(a,b,c,d,e){var f=a.ba;f.x=b;f.y=c;f.width=d;f.height=e;if(!a.xa.J()){f=a.Pc;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=f.width+b;f=f.height+h;d+=b;e+=h;b=pl(a,!0);c===d&&f===e&&(b=qh);switch(b){case qh:if(c>d||f>e)uj(a,!0),Ph(a,c>d?d:c,f>e?e:f);break;case cd:uj(a,!0);Ph(a,d,e,0,0);break;case fl:uj(a,!0);Ph(a,d,f,0,0);break;case el:uj(a,!0),Ph(a,c,e,0,0)}}}
g.sw=function(){rl(this,!1);var a=this.T;null!==a&&null!==a.g&&(a.dl(),this.Qu(a),this.ma(),a=this.T,null!==a&&(a.nt!==this&&a.sE!==this&&a.vE!==this||sl(a,!0)))};g.Qu=function(a){null!==this.Jd&&sl(a,!0)};
g.We=function(a,b){if(this.visible){var c=this.opacity,d=1;if(1!==c){if(0===c)return;d=a.globalAlpha;a.globalAlpha=d*c}if(a instanceof Nc)a:{if(this.visible){var e=null,f=a.kw;if(this instanceof A&&(this.type===tl||this.type===ul))vl(this,a,b);else{var h=this.Xb;if(0!==h.width&&0!==h.height&&!isNaN(h.x)&&!isNaN(h.y)){var k=this.transform,l=this.S;0!==(this.ea&4096)===!0&&wl(this);var m=0!==(this.ea&256),n=!1;this instanceof qa&&xl(this,a);if(m){n=l.Tf()?l.Ha:l.ba;if(this.Xh)var p=this.Xh,q=p.x,r=
p.y,s=p.width,p=p.height;else q=Math.max(h.x,n.x),r=Math.max(h.y,n.y),s=Math.min(h.right,n.right)-q,p=Math.min(h.bottom,n.bottom)-r;if(q>h.width+h.x||h.x>n.width+n.x||r>h.height+h.y||h.y>n.height+n.y)break a;n=!0;Uc(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}q=!1;if(this instanceof G&&(q=!0,!this.Ea()))break a;r=!1;s=b.Qg;this.T&&s.drawShadows&&(r=this.T.il);a.Ei.$e=[1,0,0,1,0,0];null!==this.lc&&(yl(this,a,this.lc,!0,!0),this.lc instanceof ga&&this.lc.type===ve?(a.beginPath(),
a.rect(h.x,h.y,h.width,h.height),zl(a,this.lc)):a.fillRect(h.x,h.y,h.width,h.height));q&&this.il&&s.drawShadows&&(Uc(a,1,0,0,1,0,0),h=this.em,a.shadowOffsetX=h.x,a.shadowOffsetY=h.y,a.shadowColor=this.dm,a.shadowBlur=this.cm/b.scale,a.$a());this instanceof A?Uc(a,k.m11,k.m12,k.m21,k.m22,k.dx,k.dy):a.Ei.$e=[k.m11,k.m12,k.m21,k.m22,k.dx,k.dy];if(null!==this.Ib){var p=this.Ha,h=k=0,s=p.width,p=p.height,t=0;this instanceof X&&(p=this.Pa.kb,k=p.x,h=p.y,s=p.width,p=p.height,t=this.Sg);yl(this,a,this.Ib,
!0,!1);this.Ib instanceof ga&&this.Ib.type===ve?(a.beginPath(),a.rect(k-t/2,h-t/2,s+t,p+t),zl(a,this.Ib)):a.fillRect(k-t/2,h-t/2,s+t,p+t)}s=h=k=0;r&&(null!==this.Ib||null!==this.lc||null!==l&&0!==(l.ea&512)||null!==l&&l.type===Yi&&l.If()!==this)?(Al(this,!0),k=a.shadowOffsetX,h=a.shadowOffsetY,s=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0):Al(this,!1);this.Mj(a,b);r&&0!==(this.ea&512)===!0&&(a.shadowOffsetX=k,a.shadowOffsetY=h,a.shadowBlur=s);q&&r&&(a.shadowOffsetX=0,a.shadowOffsetY=
0,a.shadowBlur=0);m&&(a.restore(),n&&a.rf.pop(),$i(b,a));this instanceof A&&(e=a.rf.pop());q&&r&&a.rf.pop();null!==a.nD&&(null===e&&(f===a.kw?(Uc(a,1,0,0,1,0,0),e=a.rf.pop()):e=a.kw),a.nD(this,e))}}}}else{if(this instanceof A&&(this.type===tl||this.type===ul)){vl(this,a,b);1!==c&&(a.globalAlpha=d);return}q=this.Xb;if(0!==q.width&&0!==q.height&&!isNaN(q.x)&&!isNaN(q.y)){e=this.transform;f=this.S;0!==(this.ea&4096)===!0&&wl(this);l=0!==(this.ea&256);this instanceof qa&&xl(this,a);if(l){m=f.Tf()?f.Ha:
f.ba;this.Xh?(h=this.Xh,n=h.x,r=h.y,k=h.width,h=h.height):(n=Math.max(q.x,m.x),r=Math.max(q.y,m.y),k=Math.min(q.right,m.right)-n,h=Math.min(q.bottom,m.bottom)-r);if(n>q.width+q.x||q.x>m.width+m.x||r>q.height+q.y||q.y>m.height+m.y){1!==c&&(a.globalAlpha=d);return}a.save();a.beginPath();a.rect(n,r,k,h);a.clip()}r=b.Qg;m=!1;if(this instanceof G){m=!0;if(!this.Ea()){1!==c&&(a.globalAlpha=d);return}this.il&&r.drawShadows&&(n=this.em,a.shadowOffsetX=n.x*b.scale*b.nf,a.shadowOffsetY=n.y*b.scale*b.nf,a.shadowColor=
this.dm,a.shadowBlur=this.cm)}n=!1;this.T&&r.drawShadows&&(n=this.T.il);null!==this.lc&&(yl(this,a,this.lc,!0,!0),this.lc instanceof ga&&this.lc.type===ve?(a.beginPath(),a.rect(q.x,q.y,q.width,q.height),zl(a,this.lc)):a.fillRect(q.x,q.y,q.width,q.height));e.Os()||a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);null!==this.Ib&&(h=this.Ha,r=q=0,k=h.width,h=h.height,s=0,this instanceof X&&(h=this.Pa.kb,q=h.x,r=h.y,k=h.width,h=h.height,s=this.Sg),yl(this,a,this.Ib,!0,!1),this.Ib instanceof ga&&this.Ib.type===
ve?(a.beginPath(),a.rect(q-s/2,r-s/2,k+s,h+s),zl(a,this.Ib)):a.fillRect(q-s/2,r-s/2,k+s,h+s));k=r=q=0;n&&(null!==this.Ib||null!==this.lc||null!==f&&0!==(f.ea&512)||null!==f&&(f.type===Yi||f.type===oh)&&f.If()!==this)?(Al(this,!0),q=a.shadowOffsetX,r=a.shadowOffsetY,k=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0):Al(this,!1);this.Mj(a,b);n&&0!==(this.ea&512)===!0&&(a.shadowOffsetX=q,a.shadowOffsetY=r,a.shadowBlur=k);m&&n&&(a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);l?(a.restore(),
this instanceof A?$i(b,a,!0):$i(b,a,!1)):e.Os()||(f=1/(e.m11*e.m22-e.m12*e.m21),a.transform(e.m22*f,-e.m12*f,-e.m21*f,e.m11*f,f*(e.m21*e.dy-e.m22*e.dx),f*(e.m12*e.dx-e.m11*e.dy)))}}1!==c&&(a.globalAlpha=d)}};
function vl(a,b,c){var d=a.Xb;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.lc&&(yl(a,b,a.lc,!0,!0),a.lc instanceof ga&&a.lc.type===ve?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),zl(b,a.lc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Ib&&(yl(a,b,a.Ib,!0,!1),a.Ib instanceof ga&&a.Ib.type===ve?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),zl(b,a.Ib)):b.fillRect(d.x,d.y,d.width,d.height)),a.Mj(b,c))}g.Mj=function(){};
function zl(a,b){if(b instanceof ga&&b.type===ve&&!(a instanceof Nc)){var c=b.lx,d=b.kx;d>c?(a.scale(c/d,1),a.translate((d-c)/2,0)):c>d&&(a.scale(1,d/c),a.translate(0,(c-d)/2));a.Ft?a.clip():a.fill();d>c?(a.translate(-(d-c)/2,0),a.scale(1/(c/d),1)):c>d&&(a.translate(0,-(c-d)/2),a.scale(1,1/(d/c)))}else a.Ft?a.clip():a.fill()}function Bl(a){a.Ft||a.stroke()}
function yl(a,b,c,d,e){if(null!==c){var f=1,h=1;if("string"===typeof c)d?b.Sm!==c&&(b.fillStyle=c,b.Sm=c):b.Tm!==c&&(b.strokeStyle=c,b.Tm=c);else if(c.type===te)c=c.color,d?b.Sm!==c&&(b.fillStyle=c,b.Sm=c):b.Tm!==c&&(b.strokeStyle=c,b.Tm=c);else{var k,h=a.Ha,f=h.width,h=h.height;if(e)var l=a.ba,f=l.width,h=l.height;var m=b instanceof CanvasRenderingContext2D;if(m&&(c.Fg&&c.type===bl||c.lx===f&&c.kx===h))k=c.Fg;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.ba,f=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*
f+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*f+c.end.offsetX;q=c.end.y*h+c.end.offsetY;l+=r;p+=r;n+=s;q+=s;c.type===ue?k=b.createLinearGradient(l,n,p,q):c.type===ve?(s=isNaN(c.us)?Math.max(f,h)/2:c.us,isNaN(c.ut)?(r=0,s=Math.max(f,h)/2):r=c.ut,k=b.createRadialGradient(l,n,r,p,q,s)):c.type===bl?k=b.createPattern(c.pattern,"repeat"):u.Kd(c.type,"Brush type");if(c.type!==bl&&(a=c.os,null!==a))for(a=a.i;a.next();)k.addColorStop(a.key,a.value);m&&(c.Fg=k,c.lx=f,c.kx=h)}d?b.Sm!==k&&(b.fillStyle=
k,b.Sm=k):b.Tm!==k&&(b.strokeStyle=k,b.Tm=k)}}}S.prototype.isContainedBy=S.prototype.gl=function(a){if(a instanceof A)a:{if(this!==a&&null!==a)for(var b=this.S;null!==b;){if(b===a){a=!0;break a}b=b.S}a=!1}else a=!1;return a};S.prototype.isVisibleObject=S.prototype.kl=function(){if(!this.visible)return!1;var a=this.S;return null!==a?a.kl():!0};
function wl(a){if(0!==(a.ea&2048)===!0){var b=a.Sd;b.reset();if(!a.Xb.J()||!a.Pc.J()){Cl(a,!1);return}b.translate(a.Xb.x,a.Xb.y);b.translate(-a.Ba.x,-a.Ba.y);var c=a.Ha;nl(a,b,c.x,c.y,c.width,c.height);Cl(a,!1);Dl(a,!0)}0!==(a.ea&4096)===!0&&(b=a.S,null===b?(a.Xm.set(a.Sd),a.fu=a.scale,Dl(a,!1)):null!==b.Ff&&(c=a.Xm,c.reset(),b.Tf()?c.multiply(b.Xm):null!==b.S&&c.multiply(b.S.Xm),c.multiply(a.Sd),a.fu=a.scale*b.fu,Dl(a,!1)))}
function nl(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Ib;a.Ze&&a.Ze.pd()&&(h=a.Ze);var k=u.K();if(a instanceof G&&a.ec!==a)for(c=a.ec,d=c.Ha,k.rt(d.x,d.y,d.width,d.height,h),c.yk.ab(k),k.offset(-c.Ba.x,-c.Ba.y),h=c.S;null!==h&&h!==a;)h.yk.ab(k),k.offset(-h.Ba.x,-h.Ba.y),h=h.S;else k.rt(c,d,e,f,h);b.rotate(a.angle,k.x,k.y);u.v(k)}}g=S.prototype;
g.R=function(a){void 0===a&&(a=!1);if(!0!==Aj(this)){uj(this,!0);rl(this,!0);var b=this.S;null!==b?a||b.R():(a=this.g,null!==a&&(a.Xf.add(this),this instanceof U&&(a.ha.gb||this.sf(),null!==this.ce&&El(this.ce)),a.de(!0)));if(this instanceof A){if(this.oa===Yi||this.oa===ah)a=this.If(),null!==a&&a.R(!0);a=this.ya.n;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==Aj(d)&&(d.xa.J()||(d instanceof ph||d instanceof A||d instanceof qa||pl(d,!1)!==qh)&&d.R(!0))}}}};
g.Fo=function(){!1===Aj(this)&&(uj(this,!0),rl(this,!0))};function El(a){if(!1===Bj(a)){if(null!==a.S)a.S.R();else{var b=a.g;null!==b&&(b.Xf.add(a),a instanceof U&&a.sf(),b.de())}rl(a,!0)}}g.Jg=function(){0!==(this.ea&2048)===!1&&(Cl(this,!0),Dl(this,!0))};g.mz=function(){Dl(this,!0)};g.ma=function(){var a=this.T;null!==a&&a.ma()};
function pl(a,b){var c=a.stretch,d=a.S;if(null!==d&&d.oa===Fl)return Gl(a,d.fd(a.rc),d.ed(a.column),b);if(null!==d&&d.oa===Yi&&d.If()===a)return Hl(a,cd,b);if(c===dl){if(null!==d){if(d.oa===oh&&d.If()===a)return Hl(a,cd,b);c=d.Bd;return c===dl?Hl(a,qh,b):Hl(a,c,b)}return Hl(a,qh,b)}return Hl(a,c,b)}
function Gl(a,b,c,d){var e=a.stretch;if(e!==dl)return Hl(a,e,d);var f=e=null;switch(b.stretch){case el:f=!0;break;case cd:f=!0}switch(c.stretch){case fl:e=!0;break;case cd:e=!0}b=a.S.Bd;null===e&&(e=b===fl||b===cd);null===f&&(f=b===el||b===cd);return!0===e&&!0===f?Hl(a,cd,d):!0===e?Hl(a,fl,d):!0===f?Hl(a,el,d):Hl(a,qh,d)}
function Hl(a,b,c){if(c)return b;if(b===qh)return qh;c=a.xa;if(c.J())return qh;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===fl)return qh;if(b===cd)return el}else{if(b===el)return qh;if(b===cd)return fl}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===el)return qh;if(b===cd)return fl}else{if(b===fl)return qh;if(b===cd)return el}return b}
u.defineProperty(S,{Cw:"segmentOrientation"},function(){return this.Cr},function(a){var b=this.Cr;b!==a&&(this.Cr=a,this.R(),this.h("segmentOrientation",b,a))});u.defineProperty(S,{Pf:"segmentIndex"},function(){return this.Ar},function(a){a=Math.round(a);var b=this.Ar;b!==a&&(this.Ar=a,this.R(),this.h("segmentIndex",b,a))});
u.defineProperty(S,{Bw:"segmentFraction"},function(){return this.zr},function(a){isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.zr;b!==a&&(this.zr=a,this.R(),this.h("segmentFraction",b,a))});u.defineProperty(S,{BE:"segmentOffset"},function(){return this.Br},function(a){var b=this.Br;b.L(a)||(this.Br=a=a.Z(),this.R(),this.h("segmentOffset",b,a))});u.defineProperty(S,{stretch:"stretch"},function(){return this.Hh},function(a){var b=this.Hh;b!==a&&(this.Hh=a,this.R(),this.h("stretch",b,a))});
u.defineProperty(S,{name:"name"},function(){return this.Ub},function(a){var b=this.Ub;b!==a&&(this.Ub=a,null!==this.T&&(this.T.Bk=null),this.h("name",b,a))});u.defineProperty(S,{opacity:"opacity"},function(){return this.Ic},function(a){var b=this.Ic;b!==a&&(u.j(a,"number",S,"opacity"),(0>a||1<a)&&u.wa(a,"0 <= value <= 1",S,"opacity"),this.Ic=a,this.h("opacity",b,a),a=this.g,b=this.T,null!==a&&null!==b&&a.ma(yi(b,b.ba)))});
u.defineProperty(S,{visible:"visible"},function(){return 0!==(this.ea&1)},function(a){var b=0!==(this.ea&1);b!==a&&(this.ea^=1,this.h("visible",b,a),b=this.S,null!==b?b.R():this instanceof G&&(this.dl(),this.He(a)),this.ma(),Il(this))});u.defineProperty(S,{Ag:"pickable"},function(){return 0!==(this.ea&2)},function(a){var b=0!==(this.ea&2);b!==a&&(this.ea^=2,this.h("pickable",b,a))});
u.defineProperty(S,{BG:"fromLinkableDuplicates"},function(){return 0!==(this.ea&4)},function(a){var b=0!==(this.ea&4);b!==a&&(this.ea^=4,this.h("fromLinkableDuplicates",b,a))});u.defineProperty(S,{CG:"fromLinkableSelfNode"},function(){return 0!==(this.ea&8)},function(a){var b=0!==(this.ea&8);b!==a&&(this.ea^=8,this.h("fromLinkableSelfNode",b,a))});
u.defineProperty(S,{wI:"toLinkableDuplicates"},function(){return 0!==(this.ea&16)},function(a){var b=0!==(this.ea&16);b!==a&&(this.ea^=16,this.h("toLinkableDuplicates",b,a))});u.defineProperty(S,{xI:"toLinkableSelfNode"},function(){return 0!==(this.ea&32)},function(a){var b=0!==(this.ea&32);b!==a&&(this.ea^=32,this.h("toLinkableSelfNode",b,a))});
u.defineProperty(S,{tg:"isPanelMain"},function(){return 0!==(this.ea&64)},function(a){var b=0!==(this.ea&64);b!==a&&(this.ea^=64,this.R(),this.h("isPanelMain",b,a))});u.defineProperty(S,{pz:"isActionable"},function(){return 0!==(this.ea&128)},function(a){var b=0!==(this.ea&128);b!==a&&(this.ea^=128,this.h("isActionable",b,a))});
u.defineProperty(S,{nm:"areaBackground"},function(){return this.lc},function(a){var b=this.lc;b!==a&&(a instanceof ga&&a.freeze(),this.lc=a,this.ma(),this.h("areaBackground",b,a))});u.defineProperty(S,{background:"background"},function(){return this.Ib},function(a){var b=this.Ib;b!==a&&(a instanceof ga&&a.freeze(),this.Ib=a,this.ma(),this.h("background",b,a))});function Al(a,b){a.ea=b?a.ea|512:a.ea&-513}function Jl(a,b){a.ea=b?a.ea|1024:a.ea&-1025}function Cl(a,b){a.ea=b?a.ea|2048:a.ea&-2049}
function Dl(a,b){a.ea=b?a.ea|4096:a.ea&-4097}function Aj(a){return 0!==(a.ea&8192)}function uj(a,b){a.ea=b?a.ea|8192:a.ea&-8193}function Bj(a){return 0!==(a.ea&16384)}function rl(a,b){a.ea=b?a.ea|16384:a.ea&-16385}u.u(S,{T:"part"},function(){if(this instanceof G)return this;if(this.Wl)return this.Wl;var a;for(a=this.S;a;){if(a instanceof G)return this.Wl=a;a=a.S}return null});u.u(S,{S:"panel"},function(){return this.Pg});S.prototype.ql=function(a){this.Pg=a};
u.u(S,{layer:"layer"},function(){var a=this.T;return null!==a?a.layer:null});u.u(S,{g:"diagram"},function(){var a=this.T;return null!==a?a.g:null},{configurable:!0});u.defineProperty(S,{position:"position"},function(){return this.Ma},function(a){var b=this.Ma;b.L(a)||(a=a.Z(),this.dA(a,b)&&this.h("position",b,a))});S.prototype.dA=function(a){this.Ma=a;El(this);this.Jg();return!0};S.prototype.GE=function(a,b){this.Ma.m(a,b);Kl(this,!0);this.Jg()};u.u(S,{ba:"actualBounds"},function(){return this.Xb});
u.defineProperty(S,{scale:"scale"},function(){return this.$b},function(a){var b=this.$b;b!==a&&(0>=a&&u.k("GraphObject.scale must be greater than zero"),this.$b=a,this.Jg(),this.R(),this.h("scale",b,a))});u.defineProperty(S,{angle:"angle"},function(){return this.Ym},function(a){var b=this.Ym;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.Ym=a,this.R(),this.Jg(),this.h("angle",b,a)))});
u.defineProperty(S,{xa:"desiredSize"},function(){return this.jf},function(a){var b=this.jf;b.L(a)||(this.jf=a=a.Z(),this.R(),this instanceof X&&this.le(),this.h("desiredSize",b,a),a=this.T,null!==a&&0!==(this.ea&1024)&&(ll(this,a,"width"),ll(this,a,"height")))});
u.defineProperty(S,{width:"width"},function(){return this.jf.width},function(a){if(this.jf.width!==a){var b=this.jf;this.jf=a=(new ia(a,this.jf.height)).freeze();this.R();this instanceof X&&this.le();this.h("desiredSize",b,a);b=this.T;null!==b&&0!==(this.ea&1024)&&ll(this,b,"width")}});
u.defineProperty(S,{height:"height"},function(){return this.jf.height},function(a){if(this.jf.height!==a){var b=this.jf;this.jf=a=(new ia(this.jf.width,a)).freeze();this.R();this instanceof X&&this.le();this.h("desiredSize",b,a);b=this.T;null!==b&&0!==(this.ea&1024)&&ll(this,b,"height")}});
u.defineProperty(S,{vg:"minSize"},function(){return this.nj},function(a){var b=this.nj;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.nj=a,this.R(),this.h("minSize",b,a))});u.defineProperty(S,{af:"maxSize"},function(){return this.lj},function(a){var b=this.lj;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.lj=a,this.R(),this.h("maxSize",b,a))});u.u(S,{Ba:"measuredBounds"},function(){return this.Pc});
u.u(S,{Ha:"naturalBounds"},function(){return this.Hc},{configurable:!0});u.defineProperty(S,{margin:"margin"},function(){return this.Gq},function(a){"number"===typeof a&&(a=new rb(a));var b=this.Gq;b.L(a)||(this.Gq=a=a.Z(),this.R(),this.h("margin",b,a))});u.u(S,{transform:null},function(){0!==(this.ea&2048)===!0&&wl(this);return this.Sd});u.u(S,{Ff:null},function(){0!==(this.ea&4096)===!0&&wl(this);return this.Xm});
u.defineProperty(S,{alignment:"alignment"},function(){return this.se},function(a){var b=this.se;b.L(a)||(a.ne()&&!a.Lc()&&u.k("alignment must be a real Spot or Spot.Default"),this.se=a=a.Z(),El(this),this.h("alignment",b,a))});u.defineProperty(S,{column:"column"},function(){return this.Cp},function(a){a=Math.round(a);var b=this.Cp;b!==a&&(0>a&&u.wa(a,">= 0",S,"column"),this.Cp=a,this.R(),this.h("column",b,a))});
u.defineProperty(S,{$F:"columnSpan"},function(){return this.Wi},function(a){a=Math.round(a);var b=this.Wi;b!==a&&(1>a&&u.wa(a,">= 1",S,"columnSpan"),this.Wi=a,this.R(),this.h("columnSpan",b,a))});u.defineProperty(S,{rc:"row"},function(){return this.wr},function(a){a=Math.round(a);var b=this.wr;b!==a&&(0>a&&u.wa(a,">= 0",S,"row"),this.wr=a,this.R(),this.h("row",b,a))});
u.defineProperty(S,{rowSpan:"rowSpan"},function(){return this.tj},function(a){a=Math.round(a);var b=this.tj;b!==a&&(1>a&&u.wa(a,">= 1",S,"rowSpan"),this.tj=a,this.R(),this.h("rowSpan",b,a))});u.defineProperty(S,{Hj:"alignmentFocus"},function(){return this.vp},function(a){var b=this.vp;b.L(a)||(a.ne()&&!a.Lc()&&u.k("alignmentFocus must be a real Spot or Spot.Default"),this.vp=a=a.Z(),this.R(),this.h("alignmentFocus",b,a))});
u.defineProperty(S,{Jd:"portId"},function(){return this.ir},function(a){var b=this.ir;if(b!==a){var c=this.T;null===c||c instanceof U||(u.k("portID being set on a Link: "+a),c=null);null!==b&&null!==c&&Ll(c,this);this.ir=a;if(null!==a&&c){c.xh=!0;null===c.Qd&&Ml(c);var d=this.Jd;null!==d&&c.Qd.add(d,this)}this.h("portId",b,a)}});function Nl(a){var b={value:null};Ol(a,b);return b.value}function Ol(a,b){var c=a.S;return null===c||!Ol(c,b)&&a.visible?(b.value=a,!1):!0}
function Il(a){var b=a.T;b instanceof U&&(a=a.g,null===a||a.ha.gb||b.sf())}u.defineProperty(S,{xb:"toSpot"},function(){return null!==this.Q?this.Q.Ej:vb},function(a){null===this.Q&&this.Ee();var b=this.Q.Ej;b.L(a)||(a=a.Z(),this.Q.Ej=a,this.h("toSpot",b,a),Il(this))});
u.defineProperty(S,{vl:"toEndSegmentLength"},function(){return null!==this.Q?this.Q.Cj:10},function(a){null===this.Q&&this.Ee();var b=this.Q.Cj;b!==a&&(0>a&&u.wa(a,">= 0",S,"toEndSegmentLength"),this.Q.Cj=a,this.h("toEndSegmentLength",b,a),Il(this))});u.defineProperty(S,{wt:"toEndSegmentDirection"},function(){return null!==this.Q?this.Q.Bj:jl},function(a){null===this.Q&&this.Ee();var b=this.Q.Bj;b!==a&&(this.Q.Bj=a,this.h("toEndSegmentDirection",b,a),Il(this))});
u.defineProperty(S,{yt:"toShortLength"},function(){return null!==this.Q?this.Q.Dj:0},function(a){null===this.Q&&this.Ee();var b=this.Q.Dj;b!==a&&(this.Q.Dj=a,this.h("toShortLength",b,a),Il(this))});u.defineProperty(S,{OE:"toLinkable"},function(){return this.Sr},function(a){var b=this.Sr;b!==a&&(this.Sr=a,this.h("toLinkable",b,a))});u.defineProperty(S,{yI:"toMaxLinks"},function(){return this.Tr},function(a){var b=this.Tr;b!==a&&(0>a&&u.wa(a,">= 0",S,"toMaxLinks"),this.Tr=a,this.h("toMaxLinks",b,a))});
u.defineProperty(S,{vb:"fromSpot"},function(){return null!==this.Q?this.Q.cj:vb},function(a){null===this.Q&&this.Ee();var b=this.Q.cj;b.L(a)||(a=a.Z(),this.Q.cj=a,this.h("fromSpot",b,a),Il(this))});u.defineProperty(S,{Yk:"fromEndSegmentLength"},function(){return null!==this.Q?this.Q.aj:10},function(a){null===this.Q&&this.Ee();var b=this.Q.aj;b!==a&&(0>a&&u.wa(a,">= 0",S,"fromEndSegmentLength"),this.Q.aj=a,this.h("fromEndSegmentLength",b,a),Il(this))});
u.defineProperty(S,{Es:"fromEndSegmentDirection"},function(){return null!==this.Q?this.Q.$i:jl},function(a){null===this.Q&&this.Ee();var b=this.Q.$i;b!==a&&(this.Q.$i=a,this.h("fromEndSegmentDirection",b,a),Il(this))});u.defineProperty(S,{Fs:"fromShortLength"},function(){return null!==this.Q?this.Q.bj:0},function(a){null===this.Q&&this.Ee();var b=this.Q.bj;b!==a&&(this.Q.bj=a,this.h("fromShortLength",b,a),Il(this))});
u.defineProperty(S,{vD:"fromLinkable"},function(){return this.Wp},function(a){var b=this.Wp;b!==a&&(this.Wp=a,this.h("fromLinkable",b,a))});u.defineProperty(S,{DG:"fromMaxLinks"},function(){return this.Xp},function(a){var b=this.Xp;b!==a&&(0>a&&u.wa(a,">= 0",S,"fromMaxLinks"),this.Xp=a,this.h("fromMaxLinks",b,a))});u.defineProperty(S,{cursor:"cursor"},function(){return this.Jp},function(a){var b=this.Jp;b!==a&&(u.j(a,"string",S,"cursor"),this.Jp=a,this.h("cursor",b,a))});
u.defineProperty(S,{click:"click"},function(){return null!==this.P?this.P.Wh:null},function(a){null===this.P&&gl(this);var b=this.P.Wh;b!==a&&(null!==a&&u.j(a,"function",S,"click"),this.P.Wh=a,this.h("click",b,a))});u.defineProperty(S,{ts:"doubleClick"},function(){return null!==this.P?this.P.ci:null},function(a){null===this.P&&gl(this);var b=this.P.ci;b!==a&&(null!==a&&u.j(a,"function",S,"doubleClick"),this.P.ci=a,this.h("doubleClick",b,a))});
u.defineProperty(S,{Uy:"contextClick"},function(){return null!==this.P?this.P.Yh:null},function(a){null===this.P&&gl(this);var b=this.P.Yh;b!==a&&(null!==a&&u.j(a,"function",S,"contextClick"),this.P.Yh=a,this.h("contextClick",b,a))});u.defineProperty(S,{ZD:"mouseEnter"},function(){return null!==this.P?this.P.Rq:null},function(a){null===this.P&&gl(this);var b=this.P.Rq;b!==a&&(null!==a&&u.j(a,"function",S,"mouseEnter"),this.P.Rq=a,this.h("mouseEnter",b,a))});
u.defineProperty(S,{$D:"mouseLeave"},function(){return null!==this.P?this.P.Sq:null},function(a){null===this.P&&gl(this);var b=this.P.Sq;b!==a&&(null!==a&&u.j(a,"function",S,"mouseLeave"),this.P.Sq=a,this.h("mouseLeave",b,a))});u.defineProperty(S,{Fz:"mouseOver"},function(){return null!==this.P?this.P.mi:null},function(a){null===this.P&&gl(this);var b=this.P.mi;b!==a&&(null!==a&&u.j(a,"function",S,"mouseOver"),this.P.mi=a,this.h("mouseOver",b,a))});
u.defineProperty(S,{Ez:"mouseHover"},function(){return null!==this.P?this.P.li:null},function(a){null===this.P&&gl(this);var b=this.P.li;b!==a&&(null!==a&&u.j(a,"function",S,"mouseHover"),this.P.li=a,this.h("mouseHover",b,a))});u.defineProperty(S,{Dz:"mouseHold"},function(){return null!==this.P?this.P.ki:null},function(a){null===this.P&&gl(this);var b=this.P.ki;b!==a&&(null!==a&&u.j(a,"function",S,"mouseHold"),this.P.ki=a,this.h("mouseHold",b,a))});
u.defineProperty(S,{CH:"mouseDragEnter"},function(){return null!==this.P?this.P.Pq:null},function(a){null===this.P&&gl(this);var b=this.P.Pq;b!==a&&(null!==a&&u.j(a,"function",S,"mouseDragEnter"),this.P.Pq=a,this.h("mouseDragEnter",b,a))});u.defineProperty(S,{DH:"mouseDragLeave"},function(){return null!==this.P?this.P.Qq:null},function(a){null===this.P&&gl(this);var b=this.P.Qq;b!==a&&(null!==a&&u.j(a,"function",S,"mouseDragLeave"),this.P.Qq=a,this.h("mouseDragLeave",b,a))});
u.defineProperty(S,{Cz:"mouseDrop"},function(){return null!==this.P?this.P.ji:null},function(a){null===this.P&&gl(this);var b=this.P.ji;b!==a&&(null!==a&&u.j(a,"function",S,"mouseDrop"),this.P.ji=a,this.h("mouseDrop",b,a))});u.defineProperty(S,{HC:"actionDown"},function(){return null!==this.P?this.P.qp:null},function(a){null===this.P&&gl(this);var b=this.P.qp;b!==a&&(null!==a&&u.j(a,"function",S,"actionDown"),this.P.qp=a,this.h("actionDown",b,a))});
u.defineProperty(S,{IC:"actionMove"},function(){return null!==this.P?this.P.rp:null},function(a){null===this.P&&gl(this);var b=this.P.rp;b!==a&&(null!==a&&u.j(a,"function",S,"actionMove"),this.P.rp=a,this.h("actionMove",b,a))});u.defineProperty(S,{JC:"actionUp"},function(){return null!==this.P?this.P.sp:null},function(a){null===this.P&&gl(this);var b=this.P.sp;b!==a&&(null!==a&&u.j(a,"function",S,"actionUp"),this.P.sp=a,this.h("actionUp",b,a))});
u.defineProperty(S,{GC:"actionCancel"},function(){return null!==this.P?this.P.pp:null},function(a){null===this.P&&gl(this);var b=this.P.pp;b!==a&&(null!==a&&u.j(a,"function",S,"actionCancel"),this.P.pp=a,this.h("actionCancel",b,a))});u.defineProperty(S,{lA:"toolTip"},function(){return null!==this.P?this.P.ti:null},function(a){null===this.P&&gl(this);var b=this.P.ti;b!==a&&(null!==a&&u.C(a,lf,S,"toolTip"),this.P.ti=a,this.h("toolTip",b,a))});
u.defineProperty(S,{contextMenu:"contextMenu"},function(){return null!==this.P?this.P.Zh:null},function(a){null===this.P&&gl(this);var b=this.P.Zh;b!==a&&(null!==a&&u.C(a,lf,S,"contextMenu"),this.P.Zh=a,this.h("contextMenu",b,a))});S.prototype.bind=S.prototype.bind=function(a){a.fg=this;var b=this.zo();null!==b&&Pl(b)&&u.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Gc&&(this.Gc=new E(bf));this.Gc.add(a)};
S.prototype.findTemplateBinder=S.prototype.zo=function(){for(var a=this instanceof A?this:this.S;null!==a;){if(null!==a.yl)return a;a=a.S}return null};S.fromSvg=S.fromSVG=function(a){return Ql(a)};S.prototype.setProperties=function(a){u.ot(this,a)};var Rl;
S.make=Rl=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=Sl.ta(a);"function"===typeof f?(c=u.Pk(arguments),d=f(c)):e=da[a]}null===d&&(void 0===e&&(d=window.$,void 0!==d&&void 0!==d.noop&&u.k("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"),u.k("GraphObject.make failed to complete, it may be conflicting with another var.")),null!==e&&e.constructor||u.k("GraphObject.make requires a class function or class name, not: "+
a),d=new e);f=1;if(d instanceof D&&1<c.length){var h=d,e=c[1];if("string"===typeof e||e instanceof HTMLDivElement)Wi(h,e),f++}for(;f<c.length;f++)e=c[f],void 0===e?u.k("Undefined value at argument "+f+" for object being constructed by GraphObject.make: "+d):Tl(d,e);return d};
function Tl(a,b){if("string"===typeof b)if(a instanceof qa)a.text=b;else if(a instanceof X)a.Fb=b;else if(a instanceof Ri)a.source=b;else if(a instanceof A){var c=Da(A,b);null!==c?a.type=c:u.k("Unknown Panel type as an argument to GraphObject.make: "+b)}else a instanceof ga?(c=Da(ga,b),null!==c?a.type=c:u.k("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof $c?(c=Da($c,b),null!==c?a.type=c:u.k("Unknown Geometry type as an argument to GraphObject.make: "+b)):a instanceof Jd?
(c=Da(Jd,b),null!==c?a.type=c:u.k("Unknown PathSegment type as an argument to GraphObject.make: "+b)):u.k("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof S)c=b,a instanceof A||u.k("A GraphObject can only be added to a Panel, not to: "+a),a.add(c);else if(b instanceof Se){var d=b,c=a,e;d.ae&&c.fd?e=c.fd(d.index):!d.ae&&c.ed?e=c.ed(d.index):u.k("A RowColumnDefinition can only be added to a Panel, not to: "+a);e.qs(d)}else if(b instanceof ea)a instanceof W&&b.Ae===
W?2===(b.value&2)?a.zw=b:b===kh||b===ch||b===bh?a.Ve=b:b===Ul||b===Vl||b===Wl?a.es=b:b!==Xl&&b!==dh&&u.k("Unknown Link enum value for a Link property: "+b):a instanceof A&&b.Ae===A?a.type=b:a instanceof qa&&b.Ae===qa?a.bF=b:a instanceof X&&(b===qh||b===sh||b===th||b===dl)?a.yD=b:a instanceof Ri&&(b===qh||b===sh||b===th)?a.RG=b:a instanceof S&&b.Ae===W?(c=a,0===b.name.indexOf("Orient")?c.Cw=b:u.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+b)):a instanceof S&&b.Ae===S?a.stretch=
b:a instanceof Se&&b.Ae===Se?a.st=b:a instanceof D&&b.Ae===D?a.no=b:a instanceof ga&&b.Ae===ga?a.type=b:a instanceof $c&&b.Ae===$c?a.type=b:a instanceof Jd&&b.Ae===Jd?a.type=b:a instanceof bf&&b.Ae===bf?a.mode=b:a instanceof Zd&&b.Ae===Zd?a.Ad=b:a instanceof Y&&b.Ae===Y?0===b.name.indexOf("Alignment")?a.alignment=b:0===b.name.indexOf("Arrangement")?a.Gf=b:0===b.name.indexOf("Compaction")?a.compaction=b:0===b.name.indexOf("Path")?a.path=b:0===b.name.indexOf("Sorting")?a.sorting=b:0===b.name.indexOf("Style")?
a.AI=b:u.k("Unknown enum value: "+b):a instanceof Yl&&b.Ae===Yl?0===b.name.indexOf("Aggressive")?a.NF=b:0===b.name.indexOf("Cycle")?a.kG=b:0===b.name.indexOf("Init")?a.WG=b:0===b.name.indexOf("Layer")?a.mH=b:u.k("Unknown enum value: "+b):a instanceof Xk&&b.Ae===Xk?b===Zl||b===$l||b===am||b===bm?a.sorting=b:b===cm||b===dm?a.Gf=b:b===em||b===fm?a.alignment=b:u.k("Unknown enum value: "+b):a instanceof gm&&b.Ae===gm?b===hm||b===im||b===jm||b===km||b===lm?a.sorting=b:b===mm||b===nm||b===om||b===wm?a.direction=
b:b===xm||b===ym||b===zm||b===Am?a.Gf=b:b===Bm||b===Cm?a.qw=b:u.k("Unknown enum value: "+b):u.k("No property to set for this enum value: "+b);else if(b instanceof bf)a instanceof S?a.bind(b):a instanceof Se?a.bind(b):u.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof bd)a instanceof $c?a.ub.add(b):u.k("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof Jd)a instanceof bd?a.Fa.add(b):u.k("A PathSegment can only be added to a PathFigure, not to: "+
a);else if(b instanceof Je)a instanceof D?a.Qb=b:a instanceof V?a.Qb=b:u.k("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(b))for(c=0;c<b.length;c++)Tl(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof ga){e=new pa;for(c in b)d=parseFloat(c),isNaN(d)?e[c]=b[c]:a.addColorStop(d,b[c]);u.ot(a,e)}else if(a instanceof Se){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&u.k("Must specify non-negative integer row for RowColumnDefinition "+
b),a.ae=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&u.k("Must specify non-negative integer column for RowColumnDefinition "+b),a.ae=!1,a.index=e);e=new pa;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);u.ot(a,e)}else u.ot(a,b);else u.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var Sl=new la("string","function");
S.getBuilders=function(){var a=new la("string","function"),b;for(b in Sl)if(b!==b.toLowerCase()){var c=Sl[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};var Dm;S.defineBuilder=Dm=function(a,b){u.j(a,"string",S,"defineBuilder:name");u.j(b,"function",S,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||u.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);Sl.add(a,b)};var Em;
S.takeBuilderArgument=Em=function(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};
Dm("Button",function(){var a=new ga(ue);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new ga(ue);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=Rl(A,Yi,{pz:!0},{_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue"},Rl(X,{name:"ButtonBorder",Fb:"Rectangle",A:new L(0,0,2.761423749153968,2.761423749153968),B:new L(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.ZD=function(a,b){var e=b.je("ButtonBorder");if(e instanceof
X){var f=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=f;f=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=f}};a.$D=function(a,b){var e=b.je("ButtonBorder");e instanceof X&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)};return a});
Dm("TreeExpanderButton",function(){var a=Rl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Rl(X,{name:"ButtonIcon",Fb:"MinusLine",xa:K.mp},(new bf("figure","isTreeExpanded",function(a,c){var d=c.S;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).rw()),{visible:!1},(new bf("visible","isTreeLeaf",function(a){return!a})).rw());a.click=function(a,c){var d=c.T;d instanceof lf&&(d=d.Kh);if(d instanceof U){var e=d.g;if(null!==e){e=e.Eb;if(d.Vc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
a.Tc=!0;d.Vc?e.collapseTree(d):e.expandTree(d)}}};return a});
Dm("SubGraphExpanderButton",function(){var a=Rl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Rl(X,{name:"ButtonIcon",Fb:"MinusLine",xa:K.mp},(new bf("figure","isSubGraphExpanded",function(a,c){var d=c.S;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).rw()));a.click=function(a,c){var d=c.T;d instanceof lf&&(d=d.Kh);if(d instanceof V){var e=d.g;if(null!==e){e=e.Eb;if(d.be){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Tc=
!0;d.be?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});Dm("ContextMenuButton",function(){var a=Rl("Button");a.stretch=fl;var b=a.je("ButtonBorder");b instanceof X&&(b.Fb="Rectangle",b.A=new L(0,0,2,3),b.B=new L(1,1,-2,-2));return a});
Dm("PanelExpanderButton",function(a){var b=Em(a,"COLLAPSIBLE");a=Rl("Button",Rl(X,"TriangleUp",{xa:new ia(6,4)},(new bf("figure","visible",function(a){return a?"TriangleUp":"TriangleDown"})).rw(b)));var c=a.je("ButtonBorder");c instanceof X&&(c.stroke=null,c.fill="transparent");a.click=function(a,c){var f=c.g;if(null!==f){var h=c.T.je(b);null!==h&&(f.Wb("Collapse/Expand Panel"),h.visible=!h.visible,f.Wd("Collapse/Expand Panel"))}};return a});
function hl(){this.Zh=this.ti=this.pp=this.sp=this.rp=this.qp=this.ji=this.Qq=this.Pq=this.ki=this.li=this.mi=this.Sq=this.Rq=this.Yh=this.ci=this.Wh=null}hl.prototype.copy=function(){var a=new hl;a.Wh=this.Wh;a.ci=this.ci;a.Yh=this.Yh;a.Rq=this.Rq;a.Sq=this.Sq;a.mi=this.mi;a.li=this.li;a.ki=this.ki;a.Pq=this.Pq;a.Qq=this.Qq;a.ji=this.ji;a.qp=this.qp;a.rp=this.rp;a.sp=this.sp;a.pp=this.pp;a.ti=this.ti;a.Zh=this.Zh;return a};
function A(a){S.call(this);void 0===a?0===arguments.length?this.oa=vh:u.k("invalid argument to Panel constructor: undefined"):(u.rb(a,A,A,"type"),this.oa=a);this.ya=new E(S);this.Pe=K.np;this.Kg=!1;this.oa===bj&&(this.Kg=!0);this.gq=!1;this.Mp=uc;this.bi=dl;this.oa===Fl&&Fm(this);this.jo=sh;this.aq=(new ia(10,10)).freeze();this.bq=K.Wj;this.yl=this.qh=null;this.uq=NaN;this.Zf=this.gi=null;this.Hn="category";this.Yf=null;this.vi=new z(NaN,NaN,NaN,NaN);this.hm=null;this.xh=!1;this.xr=null}u.Ga(A,S);
u.Lh(A);u.fa("Panel",A);function Fm(a){a.Xi=K.np;a.th=1;a.ai=null;a.Dl=null;a.sh=1;a.rh=null;a.Cl=null;a.yd=[];a.rd=[];a.am=Gm;a.Al=Gm;a.ui=0;a.hi=0}
A.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.oa=this.oa;a.Pe=this.Pe.Z();a.Kg=this.Kg;a.gq=this.gq;a.Mp=this.Mp.Z();a.bi=this.bi;if(a.oa===Fl){a.Xi=this.Xi.Z();a.th=this.th;a.ai=this.ai;a.Dl=this.Dl;a.sh=this.sh;a.rh=this.rh;a.Cl=this.Cl;var b=[];if(0<this.yd.length)for(var c=this.yd,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var f=c[e].copy();f.ql(a);b[e]=f}a.yd=b;b=[];if(0<this.rd.length)for(c=this.rd,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(f=c[e].copy(),f.ql(a),
b[e]=f);a.rd=b;a.am=this.am;a.Al=this.Al;a.ui=this.ui;a.hi=this.hi}a.jo=this.jo;a.aq.assign(this.aq);a.bq=this.bq.Z();a.qh=this.qh;a.yl=this.yl;a.uq=this.uq;a.gi=this.gi;a.Zf=this.Zf;a.Hn=this.Hn;a.vi.assign(this.vi);a.xh=this.xh;null!==this.xr&&(a.xr=this.xr)};A.prototype.Mh=function(a){S.prototype.Mh.call(this,a);a.ya=this.ya;for(var b=a.ya.n,c=b.length,d=0;d<c;d++)b[d].Pg=a;a.hm=null};
A.prototype.copy=function(){var a=S.prototype.copy.call(this);if(null!==a){for(var b=this.ya.n,c=b.length,d=0;d<c;d++){var e=b[d].copy(),f=a;e.ql(f);e.Wl=null;var h=f.ya,k=h.count;h.Yd(k,e);h=f.T;if(null!==h){h.Bk=null;null!==e.Jd&&h instanceof U&&(h.xh=!0);var l=f.g;null!==l&&l.ha.gb||h.Dc(be,"elements",f,null,e,null,k)}}return a}return null};A.prototype.toString=function(){return"Panel("+this.type+")#"+u.Uc(this)};var vh;A.Position=vh=u.s(A,"Position",0);A.Horizontal=u.s(A,"Horizontal",1);var Xi;
A.Vertical=Xi=u.s(A,"Vertical",2);var oh;A.Spot=oh=u.s(A,"Spot",3);var Yi;A.Auto=Yi=u.s(A,"Auto",4);var Fl;A.Table=Fl=u.s(A,"Table",5);A.Viewbox=u.s(A,"Viewbox",6);var tl;A.TableRow=tl=u.s(A,"TableRow",7);var ul;A.TableColumn=ul=u.s(A,"TableColumn",8);var ah;A.Link=ah=u.s(A,"Link",9);var bj;A.Grid=bj=u.s(A,"Grid",10);
u.defineProperty(A,{type:"type"},function(){return this.oa},function(a){var b=this.oa;b!==a&&(b!==tl&&b!==ul||u.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.oa=a,this.oa===bj?this.Kg=!0:this.oa===Fl&&Fm(this),this.R(),this.h("type",b,a))});u.u(A,{elements:"elements"},function(){return this.ya.i});u.u(A,{Ha:"naturalBounds"},function(){return this.Hc});
u.defineProperty(A,{padding:"padding"},function(){return this.Pe},function(a){"number"===typeof a?(0>a&&u.wa(a,">= 0",A,"padding"),a=new rb(a)):(u.C(a,rb,A,"padding"),0>a.left&&u.wa(a.left,">= 0",A,"padding:value.left"),0>a.right&&u.wa(a.right,">= 0",A,"padding:value.right"),0>a.top&&u.wa(a.top,">= 0",A,"padding:value.top"),0>a.bottom&&u.wa(a.bottom,">= 0",A,"padding:value.bottom"));var b=this.Pe;b.L(a)||(this.Pe=a=a.Z(),this.R(),this.h("padding",b,a))});
u.defineProperty(A,{Tk:"defaultAlignment"},function(){return this.Mp},function(a){var b=this.Mp;b.L(a)||(this.Mp=a=a.Z(),this.R(),this.h("defaultAlignment",b,a))});u.defineProperty(A,{Bd:"defaultStretch"},function(){return this.bi},function(a){var b=this.bi;b!==a&&(u.rb(a,S,A,"defaultStretch"),this.bi=a,this.R(),this.h("defaultStretch",b,a))});
u.defineProperty(A,{rJ:"defaultSeparatorPadding"},function(){return void 0===this.Xi?K.np:this.Xi},function(a){if(void 0!==this.Xi){"number"===typeof a&&(a=new rb(a));var b=this.Xi;b.L(a)||(this.Xi=a=a.Z(),this.h("defaultSeparatorPadding",b,a))}});
u.defineProperty(A,{pJ:"defaultRowSeparatorStroke"},function(){return void 0===this.ai?null:this.ai},function(a){var b=this.ai;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.ai=a,this.h("defaultRowSeparatorStroke",b,a))});u.defineProperty(A,{qJ:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.th?1:this.th},function(a){if(void 0!==this.th){var b=this.th;b!==a&&isFinite(a)&&0<=a&&(this.th=a,this.h("defaultRowSeparatorStrokeWidth",b,a))}});
u.defineProperty(A,{oJ:"defaultRowSeparatorDashArray"},function(){return void 0===this.Dl?null:this.Dl},function(a){if(void 0!==this.Dl){var b=this.Dl;if(b!==a){null===a||Array.isArray(a)||u.Kd(a,"Array",A,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||u.k("defaultRowSeparatorDashArray:value "+f+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Dl=a;this.ma();this.h("defaultRowSeparatorDashArray",
b,a)}}});u.defineProperty(A,{jJ:"defaultColumnSeparatorStroke"},function(){return void 0===this.rh?null:this.rh},function(a){if(void 0!==this.rh){var b=this.rh;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.rh=a,this.h("defaultColumnSeparatorStroke",b,a))}});
u.defineProperty(A,{kJ:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.sh?1:this.sh},function(a){if(void 0!==this.sh){var b=this.sh;b!==a&&isFinite(a)&&0<=a&&(this.sh=a,this.h("defaultColumnSeparatorStrokeWidth",b,a))}});
u.defineProperty(A,{iJ:"defaultColumnSeparatorDashArray"},function(){return void 0===this.Cl?null:this.Cl},function(a){if(void 0!==this.Cl){var b=this.Cl;if(b!==a){null===a||Array.isArray(a)||u.Kd(a,"Array",A,"defaultColumnSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||u.k("defaultColumnSeparatorDashArray:value "+f+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Cl=a;this.ma();this.h("defaultColumnSeparatorDashArray",
b,a)}}});u.defineProperty(A,{FK:"viewboxStretch"},function(){return this.jo},function(a){var b=this.jo;b!==a&&(u.rb(a,S,A,"viewboxStretch"),this.jo=a,this.h("viewboxStretch",b,a))});u.defineProperty(A,{aw:"gridCellSize"},function(){return this.aq},function(a){var b=this.aq;b.L(a)||(u.C(a,ia,A,"gridCellSize"),a.J()&&0!==a.width&&0!==a.height||u.k("Invalid Panel.gridCellSize: "+a),this.aq=a.Z(),null!==this.g&&this===this.g.Gs&&vj(this.g),this.ma(),this.h("gridCellSize",b,a))});
u.defineProperty(A,{CD:"gridOrigin"},function(){return this.bq},function(a){var b=this.bq;b.L(a)||(u.C(a,w,A,"gridOrigin"),a.J()||u.k("Invalid Panel.gridOrigin: "+a),this.bq=a.Z(),null!==this.g&&vj(this.g),this.ma(),this.h("gridOrigin",b,a))});g=A.prototype;g.Qu=function(a){S.prototype.Qu.call(this,a);for(var b=this.ya.n,c=b.length,d=0;d<c;d++)b[d].Qu(a)};
g.Mj=function(a,b){if(this.oa===bj){var c=this.Hi()*b.scale;0>=c&&(c=1);var d=this.aw,e=d.width,d=d.height,f=this.Ha,h=f.width,f=f.height,k=Math.ceil(h/e),l=Math.ceil(f/d),m=this.CD;a.save();a.beginPath();a.rect(0,0,h,f);a.clip();for(var n=[],p=this.ya.n,q=p.length,r=0;r<q;r++){var s=p[r],t=[];n.push(t);if(s.visible)for(var s=hk(s.Fb),v=r+1;v<q;v++){var x=p[v];x.visible&&hk(x.Fb)===s&&(x=x.interval,2<=x&&t.push(x))}}p=this.ya.n;q=p.length;for(r=0;r<q;r++){var B=p[r];if(B.visible){var t=n[r],s=B.interval,
v=!1,y=!0,C=B.gA;null!==C&&(v=!0,void 0!==a.setLineDash?(a.setLineDash(C),a.lineDashOffset=B.cd):void 0!==a.webkitLineDash?(a.webkitLineDash=C,a.webkitLineDashOffset=B.cd):void 0!==a.mozDash?(a.mozDash=C,a.mozDashOffset=B.cd):y=!1);if("LineV"===B.Fb){a.lineWidth=B.hb;yl(this,a,B.stroke,!1,!1);a.beginPath();for(var I=x=Math.floor(-m.x/e);I<=x+k;I++){var H=I*e+m.x;if(0<=H&&H<h&&Hm(I,s,t)&&(v&&!y?kl(a,H,0,H,f,C,B.cd):(a.moveTo(H,0),a.lineTo(H,f)),2>e*s*c))break}a.stroke()}else if("LineH"===B.Fb){a.lineWidth=
B.hb;yl(this,a,B.stroke,!1,!1);a.beginPath();for(I=x=Math.floor(-m.y/d);I<=x+l&&!(H=I*d+m.y,0<=H&&H<=f&&Hm(I,s,t)&&(v&&!y?kl(a,0,H,h,H,C,B.cd):(a.moveTo(0,H),a.lineTo(h,H)),2>d*s*c));I++);a.stroke()}else if("BarV"===B.Fb)for(yl(this,a,B.fill,!0,!1),B=B.width,isNaN(B)&&(B=e),I=x=Math.floor(-m.x/e);I<=x+k&&!(H=I*e+m.x,0<=H&&H<h&&Hm(I,s,t)&&(a.fillRect(H,0,B,f),2>e*s*c));I++);else if("BarH"===B.Fb)for(yl(this,a,B.fill,!0,!1),B=B.height,isNaN(B)&&(B=d),I=x=Math.floor(-m.y/d);I<=x+l&&!(H=I*d+m.y,0<=H&&
H<=f&&Hm(I,s,t)&&(a.fillRect(0,H,h,B),2>d*s*c));I++);v&&(void 0!==a.setLineDash?(a.setLineDash(u.mh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=u.mh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0))}}a.restore();$i(b,a,!1)}else{this.oa===Fl&&(a.lineCap="butt",Im(this,a,!0,this.yd,!0),Im(this,a,!1,this.rd,!0),Jm(this,a,!0,this.yd),Jm(this,a,!1,this.rd),Im(this,a,!0,this.yd,!1),Im(this,a,!1,this.rd,!1));(c=this.LD)&&a.save();e=this.If();d=this.ya.n;
h=d.length;for(f=0;f<h;f++)k=d[f],c&&k===e&&(a.Ft=!0),k.We(a,b),c&&k===e&&(a.Ft=!1);c&&(a.restore(),$i(b,a,!1))}};
function Jm(a,b,c,d){for(var e=d.length,f=a.ba,h=c?a.fd(0):a.ed(0),k=0;k<e;k++){var l=d[k];if(void 0!==l&&l!==h&&0!==l.Qa){var m=l.ep;isNaN(m)&&(m=c?a.th:a.sh);var n=l.dp;null===n&&(n=c?a.ai:a.rh);if(0!==m&&null!==n){yl(a,b,n,!1,!1);var n=!1,p=!0,q=l.gI;null!==q&&(n=!0,void 0!==b.setLineDash?(b.setLineDash(q),b.lineDashOffset=a.cd):void 0!==b.webkitLineDash?(b.webkitLineDash=q,b.webkitLineDashOffset=a.cd):void 0!==b.mozDash?(b.mozDash=q,b.mozDashOffset=a.cd):p=!1);b.beginPath();var r=l.position+m;
c?r>f.height&&(m-=r-f.height):r>f.width&&(m-=r-f.width);l=l.position+m/2;b.lineWidth=m;r=a.padding;c?(l+=r.top,m=r.left,r=f.width-r.right,n&&!p?kl(b,m,l,r,l,q,0):(b.moveTo(m,l),b.lineTo(r,l))):(l+=r.left,m=r.top,r=f.height-r.bottom,n&&!p?kl(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&(void 0!==b.setLineDash?(b.setLineDash(u.mh),b.lineDashOffset=0):void 0!==b.webkitLineDash?(b.webkitLineDash=u.mh,b.webkitLineDashOffset=0):void 0!==b.mozDash&&(b.mozDash=null,b.mozDashOffset=0))}}}}
function Im(a,b,c,d,e){for(var f=d.length,h=a.ba,k=0;k<f;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.Zy!==e&&0!==l.Qa){var m=c?h.height:h.width;if(!(l.position>m)){var n=l.lg(),p=l.ep;isNaN(p)&&(p=c?a.th:a.sh);var q=l.dp;null===q&&(q=c?a.ai:a.rh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Qa;p+n>m&&(n=m-p);0>=n||(m=a.padding,yl(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}}
function Hm(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;d<b;d++)if(0===a%c[d])return!1;return!0}function hk(a){return"LineV"===a||"BarV"===a}
g.Co=function(a,b,c,d,e){var f=this.Tf(),h=this.transform,k=1/(h.m11*h.m22-h.m12*h.m21),l=h.m22*k,m=-h.m12*k,n=-h.m21*k,p=h.m11*k,q=k*(h.m21*h.dy-h.m22*h.dx),r=k*(h.m12*h.dx-h.m11*h.dy);if(null!==this.nm)return h=this.ba,K.bl(h.left,h.top,h.right,h.bottom,a,b,c,d,e);if(null!==this.background)f=a*l+b*n+q,k=a*m+b*p+r,a=c*l+d*n+q,c=c*m+d*p+r,e.m(0,0),d=this.Ha,c=K.bl(0,0,d.width,d.height,f,k,a,c,e),e.transform(h);else{f||(l=1,n=m=0,p=1,r=q=0);k=a*l+b*n+q;a=a*m+b*p+r;l=c*l+d*n+q;d=c*m+d*p+r;e.m(l,d);
m=(l-k)*(l-k)+(d-a)*(d-a);c=!1;p=this.ya.n;r=p.length;n=u.K();for(q=0;q<r;q++)b=p[q],b.visible&&b.Co(k,a,l,d,n)&&(c=!0,b=(k-n.x)*(k-n.x)+(a-n.y)*(a-n.y),b<m&&(m=b,e.set(n)));u.v(n);f&&e.transform(h)}return c};g.R=function(a){S.prototype.R.call(this,a);this.oa===Yi&&(a=this.If(),null!==a&&a.R(!0));a=this.ya.n;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==Aj(d)&&(d.xa.J()||(d instanceof ph||d instanceof A||d instanceof qa||pl(d,!1)!==qh)&&d.R(!0))}};
g.Fo=function(){if(!1===Aj(this)){uj(this,!0);rl(this,!0);for(var a=this.ya.n,b=a.length,c=0;c<b;c++)a[c].Fo()}};g.Jg=function(){if(0!==(this.ea&2048)===!1){Cl(this,!0);Dl(this,!0);for(var a=this.ya.n,b=a.length,c=0;c<b;c++)a[c].mz()}};g.mz=function(){Dl(this,!0);for(var a=this.ya.n,b=a.length,c=0;c<b;c++)a[c].mz()};
g.Oo=function(a,b,c,d){var e=this.vi;e.width=0;e.height=0;var f=this.xa,h=this.vg;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.af;isNaN(f.width)||(a=Math.min(f.width,k.width));isNaN(f.height)||(b=Math.min(f.height,k.height));a=Math.max(c,a);b=Math.max(d,b);var l=this.padding;a=Math.max(a-l.left-l.right,0);b=Math.max(b-l.top-l.bottom,0);var m=this.ya.n;if(0!==m.length){var n=this.oa.Ub;switch(n){case "Position":var p=a,q=b,r=c,s=d,t=m.length;e.x=0;e.y=
0;e.width=0;for(var v=e.height=0;v<t;v++){var x=m[v];if(x.visible||x===this.ec){var B=x.margin,y=B.right+B.left,C=B.top+B.bottom;Ph(x,p,q,r,s);var I=x.Ba,H=Math.max(I.width+y,0),T=Math.max(I.height+C,0),aa=x.position.x,R=x.position.y;isFinite(aa)||(aa=0);isFinite(R)||(R=0);if(x instanceof X){var N=x;if(N.rz)var Z=N.hb/2,aa=aa-Z,R=R-Z}kb(e,aa,R,H,T)}}break;case "Vertical":for(var Ea=a,ua=c,Oa=m.length,na=u.eb(),Ca=0;Ca<Oa;Ca++){var ra=m[Ca];if(ra.visible||ra===this.ec){var dc=pl(ra,!1);if(dc!==qh&&
dc!==el)na.push(ra);else{var ed=ra.margin,Lf=ed.right+ed.left,ec=ed.top+ed.bottom;Ph(ra,Ea,Infinity,ua,0);var Ve=ra.Ba,Mf=Math.max(Ve.width+Lf,0),Ta=Math.max(Ve.height+ec,0);e.width=Math.max(e.width,Mf);e.height+=Ta}}}var db=na.length;if(0!==db){this.xa.width?Ea=Math.min(this.xa.width,this.af.width):0!==e.width&&(Ea=Math.min(e.width,this.af.width));for(Ca=0;Ca<db;Ca++)if(ra=na[Ca],ra.visible||ra===this.ec)ed=ra.margin,Lf=ed.right+ed.left,ec=ed.top+ed.bottom,Ph(ra,Ea,Infinity,ua,0),Ve=ra.Ba,Mf=Math.max(Ve.width+
Lf,0),Ta=Math.max(Ve.height+ec,0),e.width=Math.max(e.width,Mf),e.height+=Ta;u.ra(na)}break;case "Horizontal":for(var wa=b,za=d,lb=m.length,Eb=u.eb(),$a=0;$a<lb;$a++){var jc=m[$a];if(jc.visible||jc===this.ec){var ge=pl(jc,!1);if(ge!==qh&&ge!==fl)Eb.push(jc);else{var nc=jc.margin,Od=nc.right+nc.left,he=nc.top+nc.bottom;Ph(jc,Infinity,wa,0,za);var We=jc.Ba,pf=Math.max(We.width+Od,0),Pd=Math.max(We.height+he,0);e.width+=pf;e.height=Math.max(e.height,Pd)}}}var Fb=Eb.length;if(0!==Fb){this.xa.height?wa=
Math.min(this.xa.height,this.af.height):0!==e.height&&(wa=Math.min(e.height,this.af.height));for($a=0;$a<Fb;$a++)if(jc=Eb[$a],jc.visible||jc===this.ec)nc=jc.margin,Od=nc.right+nc.left,he=nc.top+nc.bottom,Ph(jc,Infinity,wa,0,za),We=jc.Ba,pf=Math.max(We.width+Od,0),Pd=Math.max(We.height+he,0),e.width+=pf,e.height=Math.max(e.height,Pd);u.ra(Eb)}break;case "Spot":a:{var Lb=a,Ec=b,Mg=c,Mb=d,yb=m.length,fc=this.If(),mb=fc.margin,ye=0,Qd=0,og=mb.right+mb.left,Nf=mb.top+mb.bottom;Ph(fc,Lb,Ec,Mg,Mb);var zb=
fc.Ba,fd=zb.width,oc=zb.height,wb=Math.max(fd+og,0),Fc=Math.max(oc+Nf,0);e.x=-mb.left;e.y=-mb.top;e.width=wb;e.height=Fc;for(var Nb=0;Nb<yb;Nb++){var Na=m[Nb];if(Na!==fc&&(Na.visible||Na===this.ec)){mb=Na.margin;ye=mb.right+mb.left;Qd=mb.top+mb.bottom;Ph(Na,Lb,Ec,0,0);var zb=Na.Ba,wb=Math.max(zb.width+ye,0),Fc=Math.max(zb.height+Qd,0),eb=Na.alignment;eb.Lc()&&(eb=this.Tk);eb.pd()||(eb=Ib);var Ab=Na.Hj;Ab.Lc()&&(Ab=Ib);kb(e,eb.x*fd+eb.offsetX-(Ab.x*zb.width-Ab.offsetX)-mb.left,eb.y*oc+eb.offsetY-(Ab.y*
zb.height-Ab.offsetY)-mb.top,wb,Fc)}}var gc=fc.stretch;gc===dl&&(gc=pl(fc,!1));switch(gc){case qh:break a;case cd:if(!isFinite(Lb)&&!isFinite(Ec))break a;break;case fl:if(!isFinite(Lb))break a;break;case el:if(!isFinite(Ec))break a}zb=fc.Ba;fd=zb.width;oc=zb.height;wb=Math.max(fd+og,0);Fc=Math.max(oc+Nf,0);mb=fc.margin;e.x=-mb.left;e.y=-mb.top;e.width=wb;e.height=Fc;for(Nb=0;Nb<yb;Nb++)Na=m[Nb],Na===fc||!Na.visible&&Na!==this.ec||(mb=Na.margin,ye=mb.right+mb.left,Qd=mb.top+mb.bottom,zb=Na.Ba,wb=Math.max(zb.width+
ye,0),Fc=Math.max(zb.height+Qd,0),eb=Na.alignment,eb.Lc()&&(eb=this.Tk),eb.pd()||(eb=Ib),Ab=Na.Hj,Ab.Lc()&&(Ab=Ib),kb(e,eb.x*fd+eb.offsetX-(Ab.x*zb.width-Ab.offsetX)-mb.left,eb.y*oc+eb.offsetY-(Ab.y*zb.height-Ab.offsetY)-mb.top,wb,Fc))}break;case "Auto":var Rd=a,Sd=b,qf=c,ze=d,rf=m.length,Rb=this.If(),cb=Rb.margin,pc=cb.right+cb.left,Pc=cb.top+cb.bottom;Ph(Rb,Rd,Sd,qf,ze);var gd=Rb.Ba,ab=Math.max(gd.width+pc,0),ub=Math.max(gd.height+Pc,0),kc=Km(Rb),hd=kc.x*ab+kc.offsetX,Ng=kc.y*ub+kc.offsetY,kc=Lm(Rb),
Og=kc.x*ab+kc.offsetX,Pg=kc.y*ub+kc.offsetY,Of=Rd,Gc=Sd;isFinite(Rd)&&(Of=Math.abs(hd-Og));isFinite(Sd)&&(Gc=Math.abs(Ng-Pg));var Qc=u.ul();Qc.m(0,0);for(var Hc=0;Hc<rf;Hc++){var nb=m[Hc];if(nb!==Rb&&(nb.visible||nb===this.ec)){var cb=nb.margin,ie=cb.right+cb.left,ob=cb.top+cb.bottom;Ph(nb,Of,Gc,0,0);gd=nb.Ba;ab=Math.max(gd.width+ie,0);ub=Math.max(gd.height+ob,0);Qc.m(Math.max(ab,Qc.width),Math.max(ub,Qc.height))}}if(1===rf)e.width=ab,e.height=ub,u.Oj(Qc);else{var yc=Km(Rb),Ae=Lm(Rb),Bb=0,Cb=0;Ae.x!==
yc.x&&Ae.y!==yc.y&&(Bb=Qc.width/Math.abs(Ae.x-yc.x),Cb=Qc.height/Math.abs(Ae.y-yc.y));u.Oj(Qc);var id=0;if(Rb instanceof X){var Rc=Rb,id=Rc.hb*Rc.scale;rh(Rc)===sh&&(Bb=Cb=Math.max(Bb,Cb))}var Bb=Bb+(Math.abs(yc.offsetX)+Math.abs(Ae.offsetX)+id),Cb=Cb+(Math.abs(yc.offsetY)+Math.abs(Ae.offsetY)+id),Td=Rb.stretch;Td===dl&&(Td=pl(Rb,!1));switch(Td){case qh:ze=qf=0;break;case cd:isFinite(Rd)&&(Bb=Rd);isFinite(Sd)&&(Cb=Sd);break;case fl:isFinite(Rd)&&(Bb=Rd);ze=0;break;case el:qf=0,isFinite(Sd)&&(Cb=Sd)}Rb instanceof
X&&!Rb.xa.J()&&(Rc=Rb,Rc.Rg?Rc.jk=null:Rc.Pa=null);Rb.Fo();Ph(Rb,Bb,Cb,qf,ze);e.width=Rb.Ba.width+pc;e.height=Rb.Ba.height+Pc}break;case "Table":for(var Ud=a,Xe=b,pm=c,zi=d,Fa=m.length,Be=u.eb(),Vd=u.eb(),ca=0;ca<Fa;ca++){var ha=m[ca],pg=ha instanceof A?ha:null;if(null===pg||pg.type!==tl&&pg.type!==ul||!ha.visible)Be.push(ha);else{Vd.push(ha);for(var Qg=pg.ya.n,yh=Qg.length,Sc=0;Sc<yh;Sc++){var zh=Qg[Sc];pg.type===tl?zh.rc=ha.rc:pg.type===ul&&(zh.column=ha.column);Be.push(zh)}}}Fa=Be.length;0===Fa&&
(this.fd(0),this.ed(0));for(var Sb=[],ca=0;ca<Fa;ca++)ha=Be[ca],uj(ha,!0),rl(ha,!0),Sb[ha.rc]||(Sb[ha.rc]=[]),Sb[ha.rc][ha.column]||(Sb[ha.rc][ha.column]=[]),Sb[ha.rc][ha.column].push(ha);u.ra(Be);for(var Rg=u.eb(),Tc=u.eb(),je=u.eb(),Ic={count:0},jd={count:0},zc=Ud,kd=Xe,Pf=this.yd,Fa=Pf.length,ca=0;ca<Fa;ca++){var ba=Pf[ca];void 0!==ba&&(ba.Qa=0)}Pf=this.rd;Fa=Pf.length;for(ca=0;ca<Fa;ca++)ba=Pf[ca],void 0!==ba&&(ba.Qa=0);for(var ke=Sb.length,Ce=0,ca=0;ca<ke;ca++)Sb[ca]&&(Ce=Math.max(Ce,Sb[ca].length));
for(var Tj=Math.min(this.ui,ke-1),Uj=Math.min(this.hi,Ce-1),Ac=0,ke=Sb.length,ca=Tj;ca<ke;ca++)if(Sb[ca]){var Ce=Sb[ca].length,fb=this.fd(ca);fb.Qa=0;for(Sc=Uj;Sc<Ce;Sc++)if(Sb[ca][Sc]){var gb=this.ed(Sc);void 0===Rg[Sc]&&(gb.Qa=0,Rg[Sc]=!0);for(var Vj=Sb[ca][Sc],Qf=Vj.length,qg=0;qg<Qf;qg++)if(ha=Vj[qg],ha.visible||ha===this.ec){var rg=1<ha.tj||1<ha.Wi;rg&&Tc.push(ha);var Ob=ha.margin,Rf=Ob.right+Ob.left,Sf=Ob.top+Ob.bottom,Wd=Gl(ha,fb,gb,!1),le=ha.xa,qm=!isNaN(le.height),Ah=!isNaN(le.width)&&qm;
rg||Wd===qh||Ah||(void 0===Ic[Sc]&&(Ic[Sc]=-1,Ic.count++),void 0===jd[ca]&&(jd[ca]=-1,jd.count++),je.push(ha));Ph(ha,Infinity,Infinity,0,0);var De=ha.Ba,Ye=Math.max(De.width+Rf,0),Cd=Math.max(De.height+Sf,0);1!==ha.tj||Wd!==qh&&Wd!==fl||(ba=this.fd(ca),Ac=Math.max(Cd-ba.Qa,0),Ac>kd&&(Ac=kd),ba.Qa+=Ac,kd=Math.max(kd-Ac,0));1!==ha.Wi||Wd!==qh&&Wd!==el||(ba=this.ed(Sc),Ac=Math.max(Ye-ba.Qa,0),Ac>zc&&(Ac=zc),ba.Qa+=Ac,zc=Math.max(zc-Ac,0));rg&&ha.Fo()}}}u.ra(Rg);for(var qc=0,Xd=0,Fa=this.ps,ca=0;ca<Fa;ca++)void 0!==
this.rd[ca]&&(qc+=this.ed(ca).yb);Fa=this.kt;for(ca=0;ca<Fa;ca++)void 0!==this.yd[ca]&&(Xd+=this.fd(ca).yb);for(var zc=Math.max(Ud-qc,0),Wj=kd=Math.max(Xe-Xd,0),Xj=zc,Fa=je.length,ca=0;ca<Fa;ca++){var ha=je[ca],fb=this.fd(ha.rc),gb=this.ed(ha.column),Ai=ha.Ba,Ob=ha.margin,Rf=Ob.right+Ob.left,Sf=Ob.top+Ob.bottom;Ic[ha.column]=0===gb.Qa?Math.max(Ai.width+Rf,Ic[ha.column]):null;jd[ha.rc]=0===fb.Qa?Math.max(Ai.height+Sf,jd[ha.rc]):null}var Sg=0,Bc=0;for(ca in jd)"count"!==ca&&(Sg+=jd[ca]);for(ca in Ic)"count"!==
ca&&(Bc+=Ic[ca]);for(var pb=u.ul(),ca=0;ca<Fa;ca++)if(ha=je[ca],ha.visible||ha===this.ec){var fb=this.fd(ha.rc),gb=this.ed(ha.column),me=0;isFinite(gb.width)?me=gb.width:(me=isFinite(zc)&&null!==Ic[ha.column]?0===Bc?gb.Qa+zc:Ic[ha.column]/Bc*Xj:null!==Ic[ha.column]?zc:gb.Qa||zc,me=Math.max(0,me-gb.lg()));var Jc=0;isFinite(fb.height)?Jc=fb.height:(Jc=isFinite(kd)&&null!==jd[ha.rc]?0===Sg?fb.Qa+kd:jd[ha.rc]/Sg*Wj:null!==jd[ha.rc]?kd:fb.Qa||kd,Jc=Math.max(0,Jc-fb.lg()));pb.m(Math.max(gb.Ki,Math.min(me,
gb.Kf)),Math.max(fb.Ki,Math.min(Jc,fb.Kf)));Wd=Gl(ha,fb,gb,!1);switch(Wd){case fl:pb.height=Infinity;break;case el:pb.width=Infinity}Ob=ha.margin;Rf=Ob.right+Ob.left;Sf=Ob.top+Ob.bottom;ha.Fo();Ph(ha,pb.width,pb.height,gb.Ki,fb.Ki);De=ha.Ba;Ye=Math.max(De.width+Rf,0);Cd=Math.max(De.height+Sf,0);isFinite(zc)&&(Ye=Math.min(Ye,pb.width));isFinite(kd)&&(Cd=Math.min(Cd,pb.height));var Tg=0,Tg=fb.Qa;fb.Qa=Math.max(fb.Qa,Cd);Ac=fb.Qa-Tg;kd=Math.max(kd-Ac,0);Tg=gb.Qa;gb.Qa=Math.max(gb.Qa,Ye);Ac=gb.Qa-Tg;
zc=Math.max(zc-Ac,0)}u.ra(je);for(var Ee=u.ul(),Fa=Tc.length,ca=0;ca<Fa;ca++)if(ha=Tc[ca],ha.visible||ha===this.ec){fb=this.fd(ha.rc);gb=this.ed(ha.column);pb.m(Math.max(gb.Ki,Math.min(Ud,gb.Kf)),Math.max(fb.Ki,Math.min(Xe,fb.Kf)));Wd=Gl(ha,fb,gb,!1);switch(Wd){case cd:0!==gb.Qa&&(pb.width=Math.min(pb.width,gb.Qa));0!==fb.Qa&&(pb.height=Math.min(pb.height,fb.Qa));break;case fl:0!==gb.Qa&&(pb.width=Math.min(pb.width,gb.Qa));break;case el:0!==fb.Qa&&(pb.height=Math.min(pb.height,fb.Qa))}isFinite(gb.width)&&
(pb.width=gb.width);isFinite(fb.height)&&(pb.height=fb.height);Ee.m(0,0);for(var Pb=1;Pb<ha.tj&&!(ha.rc+Pb>=this.kt);Pb++)ba=this.fd(ha.rc+Pb),Ee.height+=Math.max(ba.Ki,isNaN(ba.Qe)?ba.Kf:Math.min(ba.Qe,ba.Kf));for(Pb=1;Pb<ha.Wi&&!(ha.column+Pb>=this.ps);Pb++)ba=this.ed(ha.column+Pb),Ee.width+=Math.max(ba.Ki,isNaN(ba.Qe)?ba.Kf:Math.min(ba.Qe,ba.Kf));pb.width+=Ee.width;pb.height+=Ee.height;Ob=ha.margin;Rf=Ob.right+Ob.left;Sf=Ob.top+Ob.bottom;Ph(ha,pb.width,pb.height,pm,zi);for(var De=ha.Ba,Ye=Math.max(De.width+
Rf,0),Cd=Math.max(De.height+Sf,0),Bh=0,Pb=0;Pb<ha.tj&&!(ha.rc+Pb>=this.kt);Pb++)ba=this.fd(ha.rc+Pb),Bh+=ba.total||0;if(Bh<Cd)for(var Dd=Cd-Bh;0<Dd;){var Ed=ba.yb||0;isNaN(ba.height)&&ba.Kf>Ed&&(ba.Qa=Math.min(ba.Kf,Ed+Dd),ba.yb!==Ed&&(Dd-=ba.yb-Ed));if(-1===ba.index-1)break;ba=this.fd(ba.index-1)}for(var Tf=0,Pb=0;Pb<ha.Wi&&!(ha.column+Pb>=this.ps);Pb++)ba=this.ed(ha.column+Pb),Tf+=ba.total||0;if(Tf<Ye)for(Dd=Ye-Tf;0<Dd;){Ed=ba.yb||0;isNaN(ba.width)&&ba.Kf>Ed&&(ba.Qa=Math.min(ba.Kf,Ed+Dd),ba.yb!==
Ed&&(Dd-=ba.yb-Ed));if(-1===ba.index-1)break;ba=this.ed(ba.index-1)}}u.ra(Tc);u.Oj(Ee);u.Oj(pb);for(var Uf=0,Ze=0,Wd=pl(this,!0),Fd=this.xa,Vf=this.af,ne=Xd=qc=0,ld=0,Fa=this.ps,ca=0;ca<Fa;ca++)void 0!==this.rd[ca]&&(ba=this.ed(ca),isFinite(ba.width)?(ne+=ba.width,ne+=ba.lg()):Mm(ba)===Nm?(ne+=ba.yb,ne+=ba.lg()):0!==ba.yb&&(qc+=ba.yb,qc+=ba.lg()));var Uf=isFinite(Fd.width)?Math.min(Fd.width,Vf.width):Wd!==qh&&isFinite(Ud)?Ud:qc,Uf=Math.max(Uf,this.vg.width),Uf=Math.max(Uf-ne,0),Ch=Math.max(Uf/qc,
1);isFinite(Ch)||(Ch=1);for(ca=0;ca<Fa;ca++)void 0!==this.rd[ca]&&(ba=this.ed(ca),isFinite(ba.width)||Mm(ba)===Nm||(ba.Qa=ba.yb*Ch),ba.position=e.width,0!==ba.yb&&(e.width+=ba.yb,e.width+=ba.lg()));Fa=this.kt;for(ca=0;ca<Fa;ca++)void 0!==this.yd[ca]&&(ba=this.fd(ca),isFinite(ba.height)?(ld+=ba.height,ld+=ba.lg()):Mm(ba)===Nm?(ld+=ba.yb,ld+=ba.lg()):0!==ba.yb&&(Xd+=ba.yb,Xd+=ba.lg()));var Ze=isFinite(Fd.height)?Math.min(Fd.height,Vf.height):Wd!==qh&&isFinite(Xe)?Xe:Xd,Ze=Math.max(Ze,this.vg.height),
Ze=Math.max(Ze-ld,0),Wf=Math.max(Ze/Xd,1);isFinite(Wf)||(Wf=1);for(ca=0;ca<Fa;ca++)void 0!==this.yd[ca]&&(ba=this.fd(ca),isFinite(ba.height)||Mm(ba)===Nm||(ba.Qa=ba.yb*Wf),ba.position=e.height,0!==ba.yb&&(e.height+=ba.yb,e.height+=ba.lg()));Fa=Vd.length;for(ca=0;ca<Fa;ca++){var Tb=Vd[ca];Tb.type===tl?(me=e.width,ba=this.fd(Tb.rc),Jc=ba.Qa):(ba=this.ed(Tb.column),me=ba.Qa,Jc=e.height);Tb.Pc.m(0,0,me,Jc);uj(Tb,!1);Sb[Tb.rc]||(Sb[Tb.rc]=[]);Sb[Tb.rc][Tb.column]||(Sb[Tb.rc][Tb.column]=[]);Sb[Tb.rc][Tb.column].push(Tb)}u.ra(Vd);
this.xr=Sb;break;case "Viewbox":var sg=a,tg=b,sf=c,Bi=d;1<m.length&&u.k("Viewbox Panel cannot contain more than one GraphObject.");var Fe=m[0];Fe.$b=1;Fe.Fo();Ph(Fe,Infinity,Infinity,sf,Bi);var Ci=Fe.Ba,Zj=Fe.margin,Jp=Zj.right+Zj.left,Kp=Zj.top+Zj.bottom;if(isFinite(sg)||isFinite(tg)){var Rr=Fe.scale,ak=Ci.width,bk=Ci.height,Lp=Math.max(sg-Jp,0),Mp=Math.max(tg-Kp,0),Di=1;this.jo===sh?0!==ak&&0!==bk&&(Di=Math.min(Lp/ak,Mp/bk)):0!==ak&&0!==bk&&(Di=Math.max(Lp/ak,Mp/bk));0===Di&&(Di=1E-4);Fe.$b*=Di;
Rr!==Fe.scale&&(uj(Fe,!0),Ph(Fe,Infinity,Infinity,sf,Bi))}Ci=Fe.Ba;e.width=isFinite(sg)?sg:Math.max(Ci.width+Jp,0);e.height=isFinite(tg)?tg:Math.max(Ci.height+Kp,0);break;case "Link":var Np=m.length,ug=this instanceof lf?this.Kh:this;if(ug instanceof W)if(0===Np){var ck=this.Hc;bb(ck,0,0);var Yd=this.Ba;Yd.m(0,0,0,0)}else{var dk=this instanceof lf?null:ug.path,$e=ug.Mm,Ge=this.vi;Ge.assign($e);Ge.x=0;var Dh=Ge.y=0,Ei=ug.points,Dh=void 0!==this.ka?this.ka:Ei.count;this.Mg.m($e.x,$e.y);this.Vi.clear();
null!==dk&&(Om(dk,$e.width,$e.height),Yd=dk.Ba,Ge.Sh(Yd),this.Vi.add(Yd));for(var Eh=u.jh(),Fi=u.K(),Xf=u.K(),rm=0;rm<Np;rm++){var Qb=m[rm];if(Qb!==dk)if(Qb.tg&&Qb instanceof X)Om(Qb,$e.width,$e.height),Yd=Qb.Ba,Ge.Sh(Yd),this.Vi.add(Yd);else if(2>Dh)Ph(Qb,Infinity,Infinity),Yd=Qb.Ba,Ge.Sh(Yd),this.Vi.add(Yd);else{var Yf=Qb.Pf,Pp=Qb.Bw,sm=Qb.Hj;sm.ne()&&(sm=Ib);var Gi=Qb.Cw,Sr=Qb.BE,Hi=0,Ii=0,ek=0;if(Yf<-Dh||Yf>=Dh){var Qp=ug.XD,Ji=ug.WD;Gi!==dh&&(ek=ug.computeAngle(Qb,Gi,Ji),Qb.angle=ek);Hi=Qp.x-
$e.x;Ii=Qp.y-$e.y}else{var tf,Fh;if(0<=Yf)tf=Ei.ja(Yf),Fh=Yf<Dh-1?Ei.ja(Yf+1):tf;else{var tm=Dh+Yf;tf=Ei.ja(tm);Fh=0<tm?Ei.ja(tm-1):tf}Ji=0<=Yf?tf.Fi(Fh):Fh.Fi(tf);Gi!==dh&&(ek=ug.computeAngle(Qb,Gi,Ji),Qb.Ym=ek);Hi=tf.x+(Fh.x-tf.x)*Pp-$e.x;Ii=tf.y+(Fh.y-tf.y)*Pp-$e.y}Ph(Qb,Infinity,Infinity);var Yd=Qb.Ba,ck=Qb.Ha,Ki=0;Qb instanceof X&&(Ki=Qb.hb);var fk=ck.width+Ki,um=ck.height+Ki;Eh.reset();Eh.translate(-Yd.x,-Yd.y);Eh.scale(Qb.scale,Qb.scale);Eh.rotate(Gi===dh?Qb.angle:Ji,fk/2,um/2);var Gh=new z(0,
0,fk,um);Fi.pt(Gh,sm);Eh.ab(Fi);var Tr=-Fi.x+Ki/2,Ur=-Fi.y+Ki/2;Xf.assign(Sr);isNaN(Xf.x)&&(Xf.x=0<=Yf?fk/2+3:-(fk/2+3));isNaN(Xf.y)&&(Xf.y=-(um/2+3));Xf.rotate(Ji);Hi+=Xf.x;Ii+=Xf.y;Gh.set(Yd);Gh.x=Hi+Tr;Gh.y=Ii+Ur;this.Vi.add(Gh);Ge.Sh(Gh)}}if(this.ue)for(var Rp=this.ug;Rp.next();)Ph(Rp.value,Infinity,Infinity);this.vi=Ge;var vm=this.Mg;vm.m(vm.x+Ge.x,vm.y+Ge.y);bb(e,Ge.width||0,Ge.height||0);u.Ye(Eh);u.v(Fi);u.v(Xf)}break;case "Grid":break;case "TableRow":case "TableColumn":u.k(this.toString()+
" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:u.k("Unknown panel type: "+n)}}var He=e.width,Ie=e.height,gk=this.padding,Vr=gk.top+gk.bottom,He=He+(gk.left+gk.right),Ie=Ie+Vr;isFinite(f.width)&&(He=f.width);isFinite(f.height)&&(Ie=f.height);He=Math.min(k.width,He);Ie=Math.min(k.height,Ie);He=Math.max(h.width,He);Ie=Math.max(h.height,Ie);He=Math.max(c,He);Ie=Math.max(d,Ie);e.width=He;e.height=Ie;bb(this.Hc,He,Ie);ml(this,
0,0,He,Ie)};A.prototype.findMainElement=A.prototype.If=function(){if(null===this.hm){var a=this.ya.n,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.tg)return this.hm=d}this.hm=a[0]}return this.hm};
A.prototype.xi=function(a,b,c,d){var e=this.vi,f=this.ya.n,h=u.Vj(0,0,0,0);if(0===f.length){var k=this.ba;k.x=a;k.y=b;k.width=c;k.height=d}else{if(!this.xa.J()){var l=pl(this,!0),m=this.Pc,n=m.width,p=m.height,q=this.margin,r=q.left+q.right,s=q.top+q.bottom;n===c&&p===d&&(l=qh);switch(l){case qh:if(n>c||p>d)this.R(),Ph(this,n>c?c:n,p>d?d:p);break;case cd:this.R(!0);Ph(this,c+r,d+s,0,0);break;case fl:this.R(!0);Ph(this,c+r,p+s,0,0);break;case el:this.R(!0),Ph(this,n+r,d+s,0,0)}}k=this.ba;k.x=a;k.y=
b;k.width=c;k.height=d;var t=this.oa.Ub;switch(t){case "Position":for(var v=f.length,x=e.x-this.padding.left,B=e.y-this.padding.top,y=0;y<v;y++){var C=f[y],I=C.Ba,H=C.margin,T=C.position.x,aa=C.position.y;h.x=isNaN(T)?-x:T-x;h.y=isNaN(aa)?-B:aa-B;if(C instanceof X){var R=C;if(R.rz){var N=R.hb/2;h.x-=N;h.y-=N}}h.x+=H.left;h.y+=H.top;h.width=I.width;h.height=I.height;C.visible&&C.zc(h.x,h.y,h.width,h.height)}break;case "Vertical":for(var Z=f.length,Ea=this.padding.left,ua=this.padding.top,Oa=0;Oa<Z;Oa++){var na=
Ea,Ca=f[Oa];if(Ca.visible){var ra=Ca.Ba,dc=Ca.margin,ed=dc.left+dc.right,Lf=Ea+this.padding.right,ec=ra.width,Ve=pl(Ca,!1);if(isNaN(Ca.xa.width)&&Ve===cd||Ve===fl)ec=Math.max(e.width-ed-Lf,0);var Mf=ec+ed+Lf,Ta=Ca.alignment;Ta.Lc()&&(Ta=this.Tk);Ta.pd()||(Ta=Ib);Ca.zc(na+Ta.offsetX+dc.left+(e.width*Ta.x-Mf*Ta.x),ua+Ta.offsetY+dc.top,ec,ra.height);ua+=ra.height+dc.bottom+dc.top}}break;case "Horizontal":for(var db=f.length,wa=this.padding.top,za=this.padding.left,lb=0;lb<db;lb++){var Eb=wa,$a=f[lb];
if($a.visible){var jc=$a.Ba,ge=$a.margin,nc=ge.top+ge.bottom,Od=wa+this.padding.bottom,he=jc.height,We=pl($a,!1);if(isNaN($a.xa.height)&&We===cd||We===el)he=Math.max(e.height-nc-Od,0);var pf=he+nc+Od,Pd=$a.alignment;Pd.Lc()&&(Pd=this.Tk);Pd.pd()||(Pd=Ib);$a.zc(za+Pd.offsetX+ge.left,Eb+Pd.offsetY+ge.top+(e.height*Pd.y-pf*Pd.y),jc.width,he);za+=jc.width+ge.left+ge.right}}break;case "Spot":var Fb=f.length,Lb=this.If(),Ec=Lb.Ba,Mg=Ec.width,Mb=Ec.height,yb=this.padding,fc=yb.left,mb=yb.top;h.x=fc-e.x;
h.y=mb-e.y;Lb.zc(h.x,h.y,Mg,Mb);for(var ye=0;ye<Fb;ye++){var Qd=f[ye];if(Qd!==Lb){var og=Qd.Ba,Nf=og.width,zb=og.height,fd=Qd.alignment;fd.Lc()&&(fd=this.Tk);fd.pd()||(fd=Ib);var oc=Qd.Hj;oc.Lc()&&(oc=Ib);h.x=fd.x*Mg+fd.offsetX-(oc.x*Nf-oc.offsetX);h.y=fd.y*Mb+fd.offsetY-(oc.y*zb-oc.offsetY);h.x-=e.x;h.y-=e.y;Qd.visible&&Qd.zc(fc+h.x,mb+h.y,Nf,zb)}}break;case "Auto":var wb=f.length,Fc=this.If(),Nb=Fc.Ba,Na=u.Sf();Na.m(0,0,1,1);var eb=Fc.margin,Ab=eb.left,gc=eb.top,Rd=this.padding,Sd=Rd.left,qf=Rd.top;
h.x=Ab;h.y=gc;h.width=Nb.width;h.height=Nb.height;Fc.zc(Sd+h.x,qf+h.y,h.width,h.height);var ze=Km(Fc),rf=Lm(Fc),Rb=0+ze.y*Nb.height+ze.offsetY,cb=0+rf.x*Nb.width+rf.offsetX,pc=0+rf.y*Nb.height+rf.offsetY;Na.x=0+ze.x*Nb.width+ze.offsetX;Na.y=Rb;kb(Na,cb,pc,0,0);Na.x+=Ab+Sd;Na.y+=gc+qf;for(var Pc=0;Pc<wb;Pc++){var gd=f[Pc];if(gd!==Fc){var ab=gd.Ba,eb=gd.margin,ub=Math.max(ab.width+eb.right+eb.left,0),kc=Math.max(ab.height+eb.top+eb.bottom,0),hd=gd.alignment;hd.Lc()&&(hd=this.Tk);hd.pd()||(hd=Ib);h.x=
Na.width*hd.x+hd.offsetX-ub*hd.x+eb.left+Na.x;h.y=Na.height*hd.y+hd.offsetY-kc*hd.y+eb.top+Na.y;h.width=Na.width;h.height=Na.height;gd.visible&&(qb(Na.x,Na.y,Na.width,Na.height,h.x,h.y,ab.width,ab.height)?gd.zc(h.x,h.y,ab.width,ab.height):gd.zc(h.x,h.y,ab.width,ab.height,new z(Na.x,Na.y,Na.width,Na.height)))}}u.ic(Na);break;case "Table":for(var Ng=f.length,Og=this.padding,Pg=Og.left,Of=Og.top,Gc=this.xr,Qc=0,Hc=0,nb=Gc.length,ie=0,ob=0;ob<nb;ob++)Gc[ob]&&(ie=Math.max(ie,Gc[ob].length));for(var yc=
Math.min(this.ui,nb-1);yc!==nb&&(void 0===this.yd[yc]||0===this.yd[yc].yb);)yc++;for(var yc=Math.min(yc,nb-1),Ae=-this.yd[yc].Ma,Bb=Math.min(this.hi,ie-1);Bb!==ie&&(void 0===this.rd[Bb]||0===this.rd[Bb].yb);)Bb++;for(var Bb=Math.min(Bb,ie-1),Cb=-this.rd[Bb].Ma,id=u.ul(),ob=0;ob<nb;ob++)if(Gc[ob])for(var ie=Gc[ob].length,Rc=this.fd(ob),Hc=Rc.Ma+Ae+Of+Rc.$C(),Td=0;Td<ie;Td++)if(Gc[ob][Td])for(var Ud=this.ed(Td),Qc=Ud.Ma+Cb+Pg+Ud.$C(),Xe=Gc[ob][Td],pm=Xe.length,zi=0;zi<pm;zi++){var Fa=Xe[zi],Be=Fa.Ba,
Vd=Fa instanceof A?Fa:null;if(null===Vd||Vd.type!==tl&&Vd.type!==ul){id.m(0,0);for(var ca=1;ca<Fa.rowSpan&&!(ob+ca>=this.kt);ca++){var ha=this.fd(ob+ca);id.height+=ha.total}for(ca=1;ca<Fa.$F&&!(Td+ca>=this.ps);ca++){var pg=this.ed(Td+ca);id.width+=pg.total}var Qg=Ud.yb+id.width,yh=Rc.yb+id.height;h.x=Qc;h.y=Hc;h.width=Qg;h.height=yh;var Sc=Qc,zh=Hc,Sb=Qg,Rg=yh;Qc+Qg>e.width&&(Sb=Math.max(e.width-Qc,0));Hc+yh>e.height&&(Rg=Math.max(e.height-Hc,0));var Tc=Fa.alignment,je=0,Ic=0,jd=0,zc=0;if(Tc.Lc()){Tc=
this.Tk;Tc.pd()||(Tc=Ib);var je=Tc.x,Ic=Tc.y,jd=Tc.offsetX,zc=Tc.offsetY,kd=Ud.alignment,Pf=Rc.alignment;kd.pd()&&(je=kd.x,jd=kd.offsetX);Pf.pd()&&(Ic=Pf.y,zc=Pf.offsetY)}else je=Tc.x,Ic=Tc.y,jd=Tc.offsetX,zc=Tc.offsetY;if(isNaN(je)||isNaN(Ic))Ic=je=.5,zc=jd=0;var ba=Be.width,ke=Be.height,Ce=Fa.margin,Tj=Ce.left+Ce.right,Uj=Ce.top+Ce.bottom,Ac=Gl(Fa,Rc,Ud,!1);!isNaN(Fa.xa.width)||Ac!==cd&&Ac!==fl||(ba=Math.max(Qg-Tj,0));!isNaN(Fa.xa.height)||Ac!==cd&&Ac!==el||(ke=Math.max(yh-Uj,0));var fb=Fa.af,gb=
Fa.vg,ba=Math.min(fb.width,ba),ke=Math.min(fb.height,ke),ba=Math.max(gb.width,ba),ke=Math.max(gb.height,ke),Vj=ke+Uj;h.x+=h.width*je-(ba+Tj)*je+jd+Ce.left;h.y+=h.height*Ic-Vj*Ic+zc+Ce.top;Fa.visible&&(qb(Sc,zh,Sb,Rg,h.x,h.y,Be.width,Be.height)?Fa.zc(h.x,h.y,ba,ke):Fa.zc(h.x,h.y,ba,ke,new z(Sc,zh,Sb,Rg)))}else{Fa.Jg();Fa.Xb.La();var Qf=Fa.Xb;Qf.x=Vd.type===tl?Pg:Qc;Qf.y=Vd.type===ul?Of:Hc;Qf.width=Be.width;Qf.height=Be.height;Fa.Xb.freeze();rl(Fa,!1)}}u.Oj(id);for(ob=0;ob<Ng;ob++)Fa=f[ob],Vd=Fa instanceof
A?Fa:null,null===Vd||Vd.type!==tl&&Vd.type!==ul||(Qf=Fa.Xb,Fa.Hc.La(),Fa.Hc.m(0,0,Qf.width,Qf.height),Fa.Hc.freeze());break;case "Viewbox":var qg=f[0],rg=qg.Ba,Ob=qg.margin,Rf=Ob.top+Ob.bottom,Sf=Math.max(rg.width+(Ob.right+Ob.left),0),Wd=Math.max(rg.height+Rf,0),le=qg.alignment;le.Lc()&&(le=this.Tk);le.pd()||(le=Ib);h.x=e.width*le.x-Sf*le.x+le.offsetX;h.y=e.height*le.y-Wd*le.y+le.offsetY;h.width=rg.width;h.height=rg.height;qg.zc(h.x,h.y,h.width,h.height);break;case "Link":var qm=f.length,Ah=this instanceof
lf?this.Kh:this;if(Ah instanceof W){var De=this instanceof lf?null:Ah.path,Ye=this.Vi.n,Cd=0;if(null!==De&&Cd<this.Vi.count){var qc=Ye[Cd];Cd++;De.zc(qc.x-this.vi.x,qc.y-this.vi.y,qc.width,qc.height)}for(var Xd=0;Xd<qm;Xd++){var Wj=f[Xd];Wj!==De&&Cd<this.Vi.count&&(qc=Ye[Cd],Cd++,Wj.zc(qc.x-this.vi.x,qc.y-this.vi.y,qc.width,qc.height))}var Xj=Ah.points,Ai=Xj.count;if(2<=Ai&&this.ue)for(var Sg=this.ug;Sg.next();){var Bc=Sg.value,pb=Ai,me=Xj,Jc=Bc.Pf,Tg=Bc.Bw,Ee=Bc.Hj;Ee.ne()&&(Ee=Ib);var Pb=Bc.Cw,
Bh=Bc.BE,Dd=0,Ed=0,Tf=0;if(Jc<-pb||Jc>=pb){var Uf=this.XD,Ze=this.WD;Pb!==dh&&(Tf=this.computeAngle(Bc,Pb,Ze),Bc.angle=Tf);Dd=Uf.x;Ed=Uf.y}else{var Fd=void 0,Vf=void 0;if(0<=Jc)Fd=me.n[Jc],Vf=Jc<pb-1?me.n[Jc+1]:Fd;else var ne=pb+Jc,Fd=me.n[ne],Vf=0<ne?me.n[ne-1]:Fd;Ze=0<=Jc?Fd.Fi(Vf):Vf.Fi(Fd);Pb!==dh&&(Tf=this.computeAngle(Bc,Pb,Ze),Bc.angle=Tf);Dd=Fd.x+(Vf.x-Fd.x)*Tg;Ed=Fd.y+(Vf.y-Fd.y)*Tg}var ld=u.jh();ld.reset();ld.scale(Bc.scale,Bc.scale);ld.rotate(Bc.angle,0,0);var Ch=Bc.Ha,Wf=u.Vj(0,0,Ch.width,
Ch.height),Tb=u.K();Tb.pt(Wf,Ee);ld.ab(Tb);var sg=-Tb.x,tg=-Tb.y,sf=Bh.copy();isNaN(sf.x)&&(sf.x=0<=Jc?Tb.x+3:-(Tb.x+3));isNaN(sf.y)&&(sf.y=-(Tb.y+3));sf.rotate(Ze);Dd+=sf.x;Ed+=sf.y;ld.WE(Wf);var sg=sg+Wf.x,tg=tg+Wf.y,Bi=u.fc(Dd+sg,Ed+tg);Bc.move(Bi);u.v(Bi);u.v(Tb);u.ic(Wf);u.Ye(ld)}this instanceof lf?this.Xs():Ah.Xs()}break;case "Grid":break;case "TableRow":case "TableColumn":u.k(this.toString()+" is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
break;default:u.k("Unknown panel type: "+t)}u.ic(h)}};A.prototype.Jj=function(a){var b=this.Ha;if(qb(0,0,b.width,b.height,a.x,a.y)){for(var b=this.ya.n,c=b.length,d=u.fc(0,0);c--;){var e=b[c];if(e.visible||e===this.ec)if(Wa(d.set(a),e.transform),e.Aa(d))return u.v(d),!0}u.v(d);return null===this.Ib&&null===this.lc?!1:!0}return!1};A.prototype.Vv=function(a){if(this.$m===a)return this;for(var b=this.ya.n,c=b.length,d=0;d<c;d++){var e=b[d].Vv(a);if(null!==e)return e}return null};
function Pm(a,b,c){c(a,b);if(b instanceof A){b=b.ya.n;for(var d=b.length,e=0;e<d;e++)Pm(a,b[e],c)}}function Kj(a,b){Qm(a,a,b)}function Qm(a,b,c){c(b);b=b.ya.n;for(var d=b.length,e=0;e<d;e++){var f=b[e];f instanceof A&&Qm(a,f,c)}}A.prototype.walkVisualTree=function(a){Rm(this,this,a)};function Rm(a,b,c){c(b);if(b instanceof A){b=b.ya.n;for(var d=b.length,e=0;e<d;e++)Rm(a,b[e],c)}}A.prototype.findInVisualTree=A.prototype.vs=function(a){return Sm(this,this,a)};
function Sm(a,b,c){if(c(b))return b;if(b instanceof A){b=b.ya.n;for(var d=b.length,e=0;e<d;e++){var f=Sm(a,b[e],c);if(null!==f)return f}}return null}A.prototype.findObject=A.prototype.je=function(a){if(this.name===a)return this;for(var b=this.ya.n,c=b.length,d=0;d<c;d++){var e=b[d];if(e.name===a)return e;if(e instanceof A)if(null===e.gi&&null===e.Zf){if(e=e.je(a),null!==e)return e}else if(sk(e)&&(e=e.ya.first(),null!==e&&(e=e.je(a),null!==e)))return e}return null};
function Tm(a){a=a.ya.n;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof A)c=Math.max(c,Tm(e));else if(e instanceof X){a:{if(!e.Rg)switch(e.tn){case "None":case "Square":case "Ellipse":case "Circle":case "LineH":case "LineV":case "FramedRectangle":case "RoundedRectangle":case "Line1":case "Line2":case "Border":case "Cube1":case "Cube2":case "Junction":case "Cylinder1":case "Cylinder2":case "Cylinder3":case "Cylinder4":case "PlusLine":case "XLine":case "ThinCross":case "ThickCross":e=
0;break a}e=e.Sg/2*e.gm*e.Hi()}c=Math.max(c,e)}}return c}g=A.prototype;g.Tf=function(){return!(this.type===tl||this.type===ul)};
g.ke=function(a,b,c){if(!1===this.Ag)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Bj(this))return null;var d=this.Ha,e=1/this.Hi(),f=this.Tf(),h=f?a:Wa(u.fc(a.x,a.y),this.transform),k=this.g,l=10,m=5;null!==k&&(l=k.gz("extraTouchArea"),m=l/2);if(qb(-(m*e),-(m*e),d.width+l*e,d.height+l*e,h.x,h.y)){if(!this.Kg){var e=this.ya.n,n=e.length,k=u.K(),m=(l=this.LD)?this.If():null;if(l&&(m.Tf()?Wa(k.set(a),m.transform):k.set(a),!m.Aa(k)))return u.v(k),f||u.v(h),null;for(;n--;){var p=e[n];if(p.visible||
p===this.ec)if(p.Tf()?Wa(k.set(a),p.transform):k.set(a),!l||p!==m){var q=null;p instanceof A?q=p.ke(k,b,c):!0===p.Ag&&p.Aa(k)&&(q=p);if(null!==q&&(null!==b&&(q=b(q)),null!==q&&(null===c||c(q))))return u.v(k),f||u.v(h),q}}u.v(k)}if(null===this.background&&null===this.nm)return f||u.v(h),null;a=qb(0,0,d.width,d.height,h.x,h.y)?this:null;f||u.v(h);return a}f||u.v(h);return null};
g.ys=function(a,b,c,d){if(!1===this.Ag)return!1;void 0===b&&(b=null);void 0===c&&(c=null);d instanceof E||d instanceof F||(d=new E(S));var e=this.Ha,f=this.Tf(),h=f?a:Wa(u.fc(a.x,a.y),this.transform);if(qb(0,0,e.width,e.height,h.x,h.y)){if(!this.Kg){for(var e=this.ya.n,k=e.length,l=u.K();k--;){var m=e[k];if(m.visible||m===this.ec){m.Tf()?Wa(l.set(a),m.transform):l.set(a);var n=m,m=m instanceof A?m:null;(null!==m?m.ys(l,b,c,d):n.Aa(l))&&!1!==n.Ag&&(null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||d.add(n))}}u.v(l)}f||
u.v(h);return null!==this.background||null!==this.nm}f||u.v(h);return!1};
g.Nj=function(a,b,c,d,e,f){if(!1===this.Ag)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=u.jh(),h.reset());h.multiply(this.transform);if(this.sm(a,h))return Um(this,b,c,e),void 0===f&&u.Ye(h),!0;if(this.sg(a,h)){if(!this.Kg)for(var k=this.ya.n,l=k.length;l--;){var m=k[l];if(m.visible||m===this.ec){var n=m.ba,p=this.Ha;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof A?m:null;p=u.jh();p.set(h);if(null!==m?m.Nj(a,b,c,d,e,p):ol(n,a,d,p))null!==
b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);u.Ye(p)}}}void 0===f&&u.Ye(h);return d}void 0===f&&u.Ye(h);return!1};function Um(a,b,c,d){for(var e=a.ya.n,f=e.length;f--;){var h=e[f];if(h.visible){var k=h.ba,l=a.Ha;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof A&&Um(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}}
g.ym=function(a,b,c,d,e,f){if(!1===this.Ag)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ha,k=this.Tf(),l=k?a:Wa(u.fc(a.x,a.y),this.transform),m=k?b:Wa(u.fc(b.x,b.y),this.transform),n=l.Lj(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||Xa(l.x,l.y,0,0,0,h.height)<n||Xa(l.x,l.y,0,h.height,h.width,h.height)<n||Xa(l.x,l.y,h.width,h.height,h.width,0)<n||Xa(l.x,l.y,h.width,0,0,0)<n,h=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height&&Xa(l.x,l.y,0,0,0,h.height)<n&&Xa(l.x,l.y,0,h.height,h.width,h.height)<
n&&Xa(l.x,l.y,h.width,h.height,h.width,0)<n&&Xa(l.x,l.y,h.width,0,0,0)<n;k||(u.v(l),u.v(m));if(p){if(!this.Kg){k=u.K();l=u.K();m=this.ya.n;for(n=m.length;n--;){var q=m[n];if(q.visible||q===this.ec){var r=q.ba,s=this.Ha;r.x>s.width||r.y>s.height||0>r.x+r.width||0>r.y+r.height||(q.Tf()?(r=q.transform,Wa(k.set(a),r),Wa(l.set(b),r)):(k.set(a),l.set(b)),r=q,q=q instanceof A?q:null,null!==q?!q.ym(k,l,c,d,e,f):!r.sD(k,l,e))||(null!==c&&(r=c(r)),null===r||null!==d&&!d(r)||f.add(r))}}u.v(k);u.v(l)}return e?
p:h}return!1};function Km(a){var b=a.A;if(void 0===b||b===uc)b=null;null===b&&a instanceof X&&(a=a.Pa,null!==a&&(b=a.A));null===b&&(b=xb);return b}function Lm(a){var b=a.B;if(void 0===b||b===uc)b=null;null===b&&a instanceof X&&(a=a.Pa,null!==a&&(b=a.B));null===b&&(b=Vb);return b}A.prototype.add=A.prototype.add=function(a){u.C(a,S,A,"add:element");this.Yd(this.ya.count,a)};A.prototype.elt=A.prototype.ja=function(a){return this.ya.ja(a)};
A.prototype.insertAt=A.prototype.Yd=function(a,b){b instanceof G&&u.k("Cannot add a Part to a Panel: "+b);if(this===b||this.gl(b))this===b&&u.k("Cannot make a Panel contain itself: "+this.toString()),u.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.S;null!==c&&c!==this&&u.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+
this.toString());this.oa!==bj||b instanceof X||u.k("Can only add Shapes to a Grid Panel, not: "+b);b.ql(this);b.Wl=null;if(null!==this.QD){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Yf&&(this.Yf=new la(Object,A)),this.Yf.add(d,b))}var e=this.ya,d=-1;if(c===this){for(var f=-1,h=this.ya.n,k=h.length,l=0;l<k;l++)if(h[l]===b){f=l;break}if(-1!==f){if(f===a||f+1>=e.count&&a>=e.count)return;e.hd(f);d=f}else u.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>
a||a>e.count)a=e.count;e.Yd(a,b);this.R();b.R();null!==b.Jd?this.xh=!0:b instanceof A&&!0===b.xh&&(this.xh=!0);c=this.T;null!==c&&(c.Bk=null,c.kj=NaN,this.xh&&c instanceof U&&(c.xh=!0),c.xh&&(c.Qd=null),e=this.g,null!==e&&e.ha.gb||(-1!==d&&c.Dc(ce,"elements",this,b,null,d,null),c.Dc(be,"elements",this,null,b,null,a)))};A.prototype.remove=A.prototype.remove=function(a){u.C(a,S,A,"remove:element");for(var b=this.ya.n,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.Fe(d)};
A.prototype.removeAt=A.prototype.hd=function(a){0<=a&&this.Fe(a)};A.prototype.Fe=function(a){var b=this.ya,c=b.ja(a);c.Wl=null;c.ql(null);if(null!==this.Yf){var d=c.data;"object"===typeof d&&this.Yf.remove(d)}b.hd(a);uj(this,!1);this.R();this.hm===c&&(this.hm=null);b=this.T;null!==b&&(b.Bk=null,b.kj=NaN,d=this.g,null!==d&&d.ha.gb||b.Dc(ce,"elements",this,c,null,a,null))};u.u(A,{kt:"rowCount"},function(){return void 0===this.yd?0:this.yd.length});
A.prototype.getRowDefinition=A.prototype.fd=function(a){0>a&&u.wa(a,">= 0",A,"getRowDefinition:idx");a=Math.round(a);var b=this.yd;if(void 0===b[a]){var c=new Se;c.ql(this);c.ae=!0;c.index=a;b[a]=c}return b[a]};A.prototype.removeRowDefinition=A.prototype.oE=function(a){0>a&&u.wa(a,">= 0",A,"removeRowDefinition:idx");a=Math.round(a);var b=this.yd;this.Dc(ce,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.R()};u.u(A,{ps:"columnCount"},function(){return void 0===this.rd?0:this.rd.length});
A.prototype.getColumnDefinition=A.prototype.ed=function(a){0>a&&u.wa(a,">= 0",A,"getColumnDefinition:idx");a=Math.round(a);var b=this.rd;if(void 0===b[a]){var c=new Se;c.ql(this);c.ae=!1;c.index=a;b[a]=c}return b[a]};A.prototype.removeColumnDefinition=A.prototype.kE=function(a){0>a&&u.wa(a,">= 0",A,"removeColumnDefinition:idx");a=Math.round(a);var b=this.rd;this.Dc(ce,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.R()};
u.defineProperty(A,{bI:"rowSizing"},function(){return void 0===this.am?Gm:this.am},function(a){if(void 0!==this.am){var b=this.am;b!==a&&(a!==Gm&&a!==Nm&&u.k("rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"),this.am=a,this.R(),this.h("rowSizing",b,a))}});
u.defineProperty(A,{ZF:"columnSizing"},function(){return void 0===this.Al?Gm:this.Al},function(a){if(void 0!==this.Al){var b=this.Al;b!==a&&(a!==Gm&&a!==Nm&&u.k("columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"),this.Al=a,this.R(),this.h("columnSizing",b,a))}});
u.defineProperty(A,{CK:"topIndex"},function(){return void 0===this.ui?0:this.ui},function(a){if(void 0!==this.ui){var b=this.ui;b!==a&&((!isFinite(a)||0>a)&&u.k("topIndex must be greater than zero and a real number. Was "+a),this.ui=a,this.R(),this.h("topIndex",b,a))}});
u.defineProperty(A,{OJ:"leftIndex"},function(){return void 0===this.hi?0:this.hi},function(a){if(void 0!==this.hi){var b=this.hi;b!==a&&((!isFinite(a)||0>a)&&u.k("leftIndex must be greater than zero and a real number. Was "+a),this.hi=a,this.R(),this.h("leftIndex",b,a))}});A.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==Fl)return NaN;for(var b=0,c=this.yd,d=c.length,e=this.ui;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))return e}return-1};
A.prototype.findColumnForLocalX=function(a){if(0>a)return-1;if(this.type!==Fl)return NaN;for(var b=0,c=this.rd,d=c.length,e=this.hi;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))return e}return-1};
u.defineProperty(A,{data:"data"},function(){return this.qh},function(a){var b=this.qh;if(b!==a){var c=this instanceof G&&!(this instanceof lf);c&&u.j(a,"object",A,"data");nf(this);this.qh=a;var d=this.g;null!==d&&(c?this instanceof W?(null!==b&&d.lk.remove(b),null!==a&&d.lk.add(a,this)):(null!==b&&d.$h.remove(b),null!==a&&d.$h.add(a,this)):(c=this.S,null!==c&&null!==c.Yf&&(null!==b&&c.Yf.remove(b),null!==a&&c.Yf.add(a,this))));this.h("data",b,a);null!==d&&d.ha.gb||null!==a&&this.Nb()}});
u.defineProperty(A,{iH:"itemIndex"},function(){return this.uq},function(a){var b=this.uq;b!==a&&(this.uq=a,this.h("itemIndex",b,a))});function Pl(a){a=a.yl;return null!==a&&a.Ca}
function nf(a){var b=a.yl;if(null===b)null!==a.data&&u.k("Template cannot have .data be non-null: "+a),a.yl=b=new E(bf);else if(b.Ca)return;var c=new E(S);Pm(a,a,function(a,d){var e=d.Gc;if(null!==e)for(Jl(d,!1),e=e.i;e.next();){var f=e.value;f.mode===df&&Jl(d,!0);if(null!==f.Nm){var h=ef(f,a,d);null!==h&&(c.add(h),null===h.$n&&(h.$n=new E(bf)),h.$n.add(f))}b.add(f)}if(d instanceof A&&d.type===Fl){if(0<d.yd.length)for(e=d.yd,f=e.length,h=0;h<f;h++){var k=e[h];if(void 0!==k&&null!==k.Gc)for(var l=
k.Gc.i;l.next();){var v=l.value;v.fg=k;v.Ay=2;v.mv=k.index;b.add(v)}}if(0<d.rd.length)for(e=d.rd,f=e.length,h=0;h<f;h++)if(k=e[h],void 0!==k&&null!==k.Gc)for(l=k.Gc.i;l.next();)v=l.value,v.fg=k,v.Ay=1,v.mv=k.index,b.add(v)}});for(var d=c.i;d.next();){var e=d.value;if(null!==e.$n){Jl(e,!0);for(var f=e.$n.i;f.next();){var h=f.value;null===e.Gc&&(e.Gc=new E(bf));e.Gc.add(h)}}e.$n=null}for(d=b.i;d.next();)if(e=d.value,f=e.fg,null!==f){e.fg=null;var k=e.Lw,l=k.indexOf(".");0<l&&f instanceof A&&(h=k.substring(0,
l),k=k.substr(l+1),l=f.je(h),null!==l?(f=l,e.Lw=k):u.trace('Warning: unable to find GraphObject named "'+h+'" for Binding: '+e.toString()));f instanceof Se?(e.tl=u.Uc(f.S),f.S.$m=e.tl):(e.tl=u.Uc(f),f.$m=e.tl)}b.freeze();a instanceof G&&a.Fd()&&(Ph(a,Infinity,Infinity),a.zc())}
A.prototype.updateTargetBindings=A.prototype.Nb=function(a){var b=this.yl;if(null!==b)for(void 0===a&&(a=""),b=b.i;b.next();){var c=b.value,d=c.LE;if(""===a||""===d||d===a)if(d=c.Lw,null!==c.eG||""!==d){var d=this.data,e=c.Nm;if(null!==e)d=""===e?this:"."===e?this:".."===e?this:this.je(e);else{var f=this.g;null!==f&&c.xt&&(d=f.ga.Zs)}if(null!==d){var f=this,h=c.tl;if(-1!==h){if(f=this.Vv(h),null===f)continue}else null!==c.fg&&(f=c.fg);"."===e?d=f:".."===e&&(d=f.S);e=c.Ay;if(0!==e){if(!(f instanceof
A))continue;h=f;1===e?f=h.ed(c.mv):2===e&&(f=h.fd(c.mv))}void 0!==f&&c.ZE(f,d)}}}};u.defineProperty(A,{QD:"itemArray"},function(){return this.gi},function(a){var b=this.gi;if(b!==a){var c=this.g;null!==c&&null!==b&&Qj(c,this);this.gi=a;null!==c&&null!==a&&Mj(c,this);this.h("itemArray",b,a);null!==c&&c.ha.gb||this.Rz()}});function sk(a){return a.type===oh||a.type===Yi||a.type===ah||a.type===Fl&&0<a.ya.length&&(a=a.ya.ja(0),a.tg&&a instanceof A&&(a.type===tl||a.type===ul))?!0:!1}
A.prototype.rebuildItemElements=A.prototype.Rz=function(){var a=0;for(sk(this)&&(a=1);this.ya.length>a;)this.Fe(a);a=this.QD;if(null!==a)for(var b=u.qb(a),c=0;c<b;c++)rk(this,u.fb(a,c),c)};function rk(a,b,c){if(!(void 0===b||null===b||0>c)){var d=a.getCategoryForItemData(b,c),d=a.findTemplateForItemData(b,c,d);if(null!==d){nf(d);d=d.copy();"object"===typeof b&&(null===a.Yf&&(a.Yf=new la(Object,A)),a.Yf.add(b,d));var e=c;sk(a)&&e++;a.Yd(e,d);tk(a,e,c);d.data=b}}}
function tk(a,b,c){for(a=a.ya;b<a.length;){var d=a.ja(b);if(d instanceof A){var e=b,f=c;d.type===tl?d.rc=e:d.type===ul&&(d.column=e);d.iH=f}b++;c++}}function vi(a){a=a.ya.n;for(var b=a.length,c=0;c<b;c++){var d=a[c];if(d instanceof Vm||d instanceof A&&vi(d))return!0}return!1}
u.defineProperty(A,{LJ:"itemTemplate"},function(){return null===this.Zf?null:this.Zf.ta("")},function(a){if(null===this.Zf){if(null===a)return;this.Zf=new la("string",A)}var b=this.Zf.ta("");b!==a&&(u.C(a,A,A,"itemTemplate"),(a instanceof G||a.tg)&&u.k("itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.Zf.add("",a),this.h("itemTemplate",b,a),a=this.g,null!==a&&a.ha.gb||this.Rz())});
u.defineProperty(A,{jH:"itemTemplateMap"},function(){return this.Zf},function(a){var b=this.Zf;if(b!==a){u.C(a,la,A,"itemTemplateMap");for(var c=a.i;c.next();){var d=c.value;(d instanceof G||d.tg)&&u.k("Template in itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.Zf=a;this.h("itemTemplateMap",b,a);a=this.g;null!==a&&a.ha.gb||this.Rz()}});
u.defineProperty(A,{KJ:"itemCategoryProperty"},function(){return this.Hn},function(a){var b=this.Hn;b!==a&&("string"!==typeof a&&"function"!==typeof a&&u.Kd(a,"string or function",A,"itemCategoryProperty"),this.Hn=a,this.h("itemCategoryProperty",b,a))});
A.prototype.getCategoryForItemData=function(a){if(null===a)return"";var b=this.Hn,c="";if("function"===typeof b)c=b(a);else if("string"===typeof b&&"object"===typeof a){if(""===b)return"";c=u.sb(a,b)}else return"";if(void 0===c)return"";if("string"===typeof c)return c;u.k("Panel.getCategoryForItemData found a non-string category for "+a+": "+c);return""};var Wm=!1,Xm=null;
A.prototype.findTemplateForItemData=function(a,b,c){a=this.jH;b=null;null!==a&&(b=a.ta(c));null===b&&(Wm||(Wm=!0,u.trace('No item template Panel found for category "'+c+'" on '+this),u.trace("  Using default item template."),c=new A,a=new qa,a.bind(new bf("text","",de)),c.add(a),Xm=c),b=Xm);return b};u.defineProperty(A,{DJ:"isAtomic"},function(){return this.Kg},function(a){var b=this.Kg;b!==a&&(u.j(a,"boolean",A,"isAtomic"),this.Kg=a,this.h("isAtomic",b,a))});
u.defineProperty(A,{LD:"isClipping"},function(){return this.gq},function(a){var b=this.gq;b!==a&&(u.j(a,"boolean",A,"isClipping"),this.gq=a,this.h("isClipping",b,a))});function Se(){u.gc(this);this.Pg=null;this.xu=!0;this.ud=0;this.Qe=NaN;this.oj=0;this.mj=Infinity;this.se=uc;this.Ma=this.yb=0;this.Gc=null;this.Jr=Ym;this.Hh=dl;this.Gr=this.wj=null;this.Hr=NaN;this.Ib=this.Dh=null;this.Ip=!1}u.fa("RowColumnDefinition",Se);
Se.prototype.copy=function(){var a=new Se;a.xu=this.xu;a.ud=this.ud;a.Qe=this.Qe;a.oj=this.oj;a.mj=this.mj;a.se=this.se;a.yb=this.yb;a.Ma=this.Ma;a.Hh=this.Hh;a.Jr=this.Jr;a.wj=null===this.wj?null:this.wj.Z();a.Gr=this.Gr;a.Hr=this.Hr;a.Dh=null;null!==this.Dh&&(a.Dh=u.Pk(this.Dh));a.Ib=this.Ib;a.Ip=this.Ip;a.Gc=this.Gc;return a};
Se.prototype.qs=function(a){u.C(a,Se,Se,"copyFrom:pd");a.ae?this.height=a.height:this.width=a.width;this.Ki=a.Ki;this.Kf=a.Kf;this.alignment=a.alignment;this.stretch=a.stretch;this.st=a.st;this.wj=null===a.wj?null:a.wj.Z();this.dp=a.dp;this.ep=a.ep;this.Dh=null;a.Dh&&(this.Dh=u.Pk(a.Dh));this.background=a.background;this.Zy=a.Zy;this.Gc=a.Gc};Se.prototype.toString=function(){return"RowColumnDefinition "+(this.ae?"(Row ":"(Column ")+this.index+") #"+u.Uc(this)};var Ym;
Se.Default=Ym=u.s(Se,"Default",0);var Nm;Se.None=Nm=u.s(Se,"None",1);var Gm;Se.ProportionalExtra=Gm=u.s(Se,"ProportionalExtra",2);Se.prototype.ql=function(a){this.Pg=a};Se.prototype.computeEffectiveSpacingTop=Se.prototype.$C=function(){var a=0;if(0!==this.index){var b=this.Pg,c=this.dp;null===c&&null!==b&&(c=this.ae?b.ai:b.rh);null!==c&&(a=this.ep,isNaN(a)&&(a=null!==b?this.ae?b.th:b.sh:0))}b=this.DE;if(null===b)if(b=this.Pg,null!==b)b=b.Xi;else return a;return a+(this.ae?b.top:b.left)};
Se.prototype.computeEffectiveSpacing=Se.prototype.lg=function(){var a=0;if(0!==this.index){var b=this.Pg,c=this.dp;null===c&&null!==b&&(c=this.ae?b.ai:b.rh);null!==c&&(a=this.ep,isNaN(a)&&(a=null!==b?this.ae?b.th:b.sh:0))}b=this.DE;if(null===b)if(b=this.Pg,null!==b)b=b.Xi;else return a;return a+(this.ae?b.top+b.bottom:b.left+b.right)};
Se.prototype.Rc=function(a,b,c,d,e){var f=this.Pg;if(null!==f&&(f.Dc($d,a,this,b,c,d,e),null!==this.Gc&&(b=f.zo(),null!==b&&(b=b.data,null!==b))))for(c=this.Gc.i;c.next();)c.value.Mw(this,b,a,null)};u.u(Se,{S:"panel"},function(){return this.Pg});u.defineProperty(Se,{ae:"isRow"},function(){return this.xu},function(a){this.xu=a});u.defineProperty(Se,{index:"index"},function(){return this.ud},function(a){this.ud=a});
u.defineProperty(Se,{height:"height"},function(){return this.Qe},function(a){var b=this.Qe;b!==a&&(0>a&&u.wa(a,">= 0",Se,"height"),this.Qe=a,this.Qa=this.yb,null!==this.S&&this.S.R(),this.Rc("height",b,a))});u.defineProperty(Se,{width:"width"},function(){return this.Qe},function(a){var b=this.Qe;b!==a&&(0>a&&u.wa(a,">= 0",Se,"width"),this.Qe=a,this.Qa=this.yb,null!==this.S&&this.S.R(),this.Rc("width",b,a))});
u.defineProperty(Se,{Ki:"minimum"},function(){return this.oj},function(a){var b=this.oj;b!==a&&((0>a||!isFinite(a))&&u.wa(a,">= 0",Se,"minimum"),this.oj=a,this.Qa=this.yb,null!==this.S&&this.S.R(),this.Rc("minimum",b,a))});u.defineProperty(Se,{Kf:"maximum"},function(){return this.mj},function(a){var b=this.mj;b!==a&&(0>a&&u.wa(a,">= 0",Se,"maximum"),this.mj=a,this.Qa=this.yb,null!==this.S&&this.S.R(),this.Rc("maximum",b,a))});
u.defineProperty(Se,{alignment:"alignment"},function(){return this.se},function(a){var b=this.se;b.L(a)||(this.se=a.Z(),null!==this.S&&this.S.R(),this.Rc("alignment",b,a))});u.defineProperty(Se,{stretch:"stretch"},function(){return this.Hh},function(a){var b=this.Hh;b!==a&&(this.Hh=a,null!==this.S&&this.S.R(),this.Rc("stretch",b,a))});
u.defineProperty(Se,{DE:"separatorPadding"},function(){return this.wj},function(a){"number"===typeof a&&(a=new rb(a));var b=this.wj;null!==a&&null!==b&&b.L(a)||(null!==a&&(a=a.Z()),this.wj=a,null!==this.S&&this.S.R(),this.Rc("separatorPadding",b,a))});u.defineProperty(Se,{dp:"separatorStroke"},function(){return this.Gr},function(a){var b=this.Gr;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Gr=a,null!==this.S&&this.S.R(),this.Rc("separatorStroke",b,a))});
u.defineProperty(Se,{ep:"separatorStrokeWidth"},function(){return this.Hr},function(a){var b=this.Hr;b!==a&&(this.Hr=a,null!==this.S&&this.S.R(),this.Rc("separatorStrokeWidth",b,a))});
u.defineProperty(Se,{gI:"separatorDashArray"},function(){return this.Dh},function(a){var b=this.Dh;if(b!==a){null===a||Array.isArray(a)||u.Kd(a,"Array",Se,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||u.k("separatorDashArray:value "+f+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Dh=a;null!==this.S&&this.S.ma();this.Rc("separatorDashArray",b,a)}});
u.defineProperty(Se,{background:"background"},function(){return this.Ib},function(a){var b=this.Ib;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Ib=a,null!==this.S&&this.S.ma(),this.Rc("background",b,a))});u.defineProperty(Se,{Zy:"coversSeparators"},function(){return this.Ip},function(a){var b=this.Ip;b!==a&&(u.j(a,"boolean",Se,"coversSeparators"),this.Ip=a,null!==this.S&&this.S.ma(),this.Rc("coversSeparators",b,a))});
u.defineProperty(Se,{st:"sizing"},function(){return this.Jr},function(a){var b=this.Jr;b!==a&&(this.Jr=a,null!==this.S&&this.S.R(),this.Rc("sizing",b,a))});function Mm(a){if(a.st===Ym){var b=a.Pg;return a.ae?b.bI:b.ZF}return a.st}u.defineProperty(Se,{Qa:"actual"},function(){return this.yb},function(a){this.yb=isNaN(this.Qe)?Math.max(Math.min(this.mj,a),this.oj):Math.max(Math.min(this.mj,this.Qe),this.oj)});
u.defineProperty(Se,{total:"total"},function(){return this.yb+this.lg()},function(a){this.yb=isNaN(this.Qe)?Math.max(Math.min(this.mj,a),this.oj):Math.max(Math.min(this.mj,this.Qe),this.oj);this.yb=Math.max(0,this.yb-this.lg())});u.defineProperty(Se,{position:"position"},function(){return this.Ma},function(a){this.Ma=a});
Se.prototype.bind=Se.prototype.bind=function(a){a.fg=this;var b=this.S;null!==b&&(b=b.zo(),null!==b&&Pl(b)&&u.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a));null===this.Gc&&(this.Gc=new E(bf));this.Gc.add(a)};
function X(){S.call(this);this.Pa=null;this.tn="None";this.Rg=!1;this.Zp=dl;this.jk=null;this.yc=this.jd="black";this.Sg=1;this.co="butt";this.eo="miter";this.gm=10;this.fm=null;this.cd=0;this.si=this.ri=uc;this.dr=this.cr=NaN;this.hq=!1;this.nq=!0;this.gr=null;this.wn=this.fo="None";this.eq=1}u.Ga(X,S);u.fa("Shape",X);
X.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.Pa=this.Pa;a.tn=this.tn;a.Rg=this.Rg;a.Zp=this.Zp;a.jk=this.jk;a.jd=this.jd;a.yc=this.yc;a.Sg=this.Sg;a.co=this.co;a.eo=this.eo;a.gm=this.gm;a.fm=null;null!==this.fm&&(a.fm=u.Pk(this.fm));a.cd=this.cd;a.ri=this.ri.Z();a.si=this.si.Z();a.cr=this.cr;a.dr=this.dr;a.hq=this.hq;a.nq=this.nq;a.gr=this.gr;a.fo=this.fo;a.wn=this.wn;a.eq=this.eq};
X.prototype.toString=function(){return"Shape("+("None"!==this.Fb?this.Fb:"None"!==this.jp?this.jp:this.ez)+")#"+u.Uc(this)};
function Zm(a,b,c,d){var e=.001,f=d.Ba,h=f.width,f=f.height,k=0,l=0,m=0,n=0,e=c.length;if(!(4>e)){for(var k=c[0],l=c[1],p=0,q=0,r=0,s=m=0,t=q=0,v=u.eb(),x=2;x<e;x+=2)m=c[x],n=c[x+1],p=m-k,q=n-l,0===p&&(p=.001),r=q/p,s=Math.atan2(q,p),q=Math.sqrt(p*p+q*q),k=[],k[0]=p,k[1]=s,k[2]=r,k[3]=q,v.push(k),t+=q,k=m,l=n;k=c[0];l=c[1];c=0;for(var e=h,n=h/2,x=0===n?!1:!0,q=0,m=v[q],p=m[0],s=m[1],r=m[2],m=m[3],B=0;.1<=t;){0===B&&(x?(e=h,c++,e-=n,t-=n,x=!1):(e=h,c++),0===e&&(e=1));if(e>t){u.ra(v);return}e>m?(B=
e-m,e=m):B=0;var y=Math.sqrt(e*e/(1+r*r));0>p&&(y=-y);k+=y;l+=r*y;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(f/2));0===B&&d.Mj(a,b);a.translate(h/2,f/2);a.rotate(-s);a.translate(-k,-l);t-=e;m-=e;if(0!==B){q++;if(q===v.length){u.ra(v);return}m=v[q];p=m[0];s=m[1];r=m[2];m=m[3];e=B}}u.ra(v)}}
X.prototype.Mj=function(a,b){if(null!==this.yc||null!==this.jd){null!==this.jd&&yl(this,a,this.jd,!0,!1);null!==this.yc&&yl(this,a,this.yc,!1,!1);var c=this.Sg;if(0===c){var d=this.T;d instanceof lf&&d.type===ah&&d.vc instanceof X&&(c=d.vc.hb)}a.lineWidth=c;a.lineJoin=this.eo;a.lineCap=this.co;a.miterLimit=this.gm;var e=!1;this.T&&b.Qg.drawShadows&&(e=this.T.il);var f=!0;null!==this.yc&&null===this.jd&&(f=!1);var d=!1,h=!0,k=this.gA;null!==k&&(d=!0,void 0!==a.setLineDash?(a.setLineDash(k),a.lineDashOffset=
this.cd):void 0!==a.webkitLineDash?(a.webkitLineDash=k,a.webkitLineDashOffset=this.cd):void 0!==a.mozDash?(a.mozDash=k,a.mozDashOffset=this.cd):h=!1);var l=this.Pa;if(null!==l){if(l.oa===dd)a.beginPath(),d&&!h?kl(a,l.nc,l.uc,l.pb,l.Bb,k,this.cd):(a.moveTo(l.nc,l.uc),a.lineTo(l.pb,l.Bb)),null!==this.jd&&zl(a,this.jd),0!==c&&null!==this.yc&&Bl(a);else if(l.oa===md){var m=l.nc,n=l.uc,p=l.pb,q=l.Bb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.jd&&(a.beginPath(),a.rect(l,
r,m,n),zl(a,this.jd));if(null!==this.yc){var s=p=0,t=0;f&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);d&&!h?(h=u.eb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),$m(a,h,k,this.cd),Bl(a),u.ra(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),Bl(a));f&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t)}}else if(l.oa===nd)m=l.nc,n=l.uc,p=l.pb,q=l.Bb,l=Math.abs(p-m)/
2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+K.sa*l,n-r,m+l,n-K.sa*r,m+l,n),a.bezierCurveTo(m+l,n+K.sa*r,m+K.sa*l,n+r,m,n+r),a.bezierCurveTo(m-K.sa*l,n+r,m-l,n+K.sa*r,m-l,n),a.bezierCurveTo(m-l,n-K.sa*r,m-K.sa*l,n-r,m,n-r),a.closePath(),null!==this.jd&&zl(a,this.jd),d&&!h&&(h=u.eb(),K.ye(m,n-r,m+K.sa*l,n-r,m+l,n-K.sa*r,m+l,n,.5,h),K.ye(m+l,n,m+l,n+K.sa*r,m+K.sa*l,n+r,m,n+r,.5,h),K.ye(m,n+r,m-K.sa*l,n+r,m-l,n+K.sa*r,m-l,n,.5,h),K.ye(m-l,n,
m-l,n-K.sa*r,m-K.sa*l,n-r,m,n-r,.5,h),a.beginPath(),$m(a,h,k,this.cd),u.ra(h)),0!==c&&null!==this.yc&&(t=s=p=0,f&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),Bl(a),f&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t));else if(l.oa===ad){r=l.Zi;n=r.length;for(q=0;q<n;q++){m=r.n[q];a.beginPath();a.moveTo(m.ua,m.va);for(var p=m.Fa.n,s=p.length,v=null,t=0;t<s;t++){var x=p[t];switch(x.oa){case yd:a.moveTo(x.F,x.G);break;case pd:a.lineTo(x.F,
x.G);break;case zd:a.bezierCurveTo(x.bd,x.xe,x.dg,x.eg,x.pb,x.Bb);break;case Ad:a.quadraticCurveTo(x.bd,x.xe,x.pb,x.Bb);break;case Bd:if(x.radiusX===x.radiusY)v=Math.PI/180,a.arc(x.bd,x.xe,x.radiusX,x.Je*v,(x.Je+x.Qf)*v,0>x.Qf);else for(var v=Hd(x,m),B=v.length,y=0;y<B;y++){var C=v[y];0===y&&a.lineTo(C[0],C[1]);a.bezierCurveTo(C[2],C[3],C[4],C[5],C[6],C[7])}break;case Gd:y=B=0;null!==v&&v.type===Bd?(v=Hd(v,m),v=v[v.length-1]||null,null!==v&&(B=v[6],y=v[7])):(B=null!==v?v.F:m.ua,y=null!==v?v.G:m.va);
v=Id(x,m,B,y);B=v.length;for(y=0;y<B;y++)C=v[y],a.bezierCurveTo(C[2],C[3],C[4],C[5],C[6],C[7]);break;default:u.k("Segment not of valid type")}x.zh&&a.closePath();v=x}e?(t=s=p=0,m.En?(!0===m.Il&&null!==this.jd?(zl(a,this.jd),f=!0):f=!1,0!==c&&null!==this.yc&&(f&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),d&&!h||Bl(a),f&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(f&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=
0,a.shadowOffsetY=0,a.shadowBlur=0),!0===m.Il&&null!==this.jd&&zl(a,this.jd),0!==c&&null!==this.yc&&(d&&!h||Bl(a)),f&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(!0===m.Il&&null!==this.jd&&zl(a,this.jd),0===c||null===this.yc||d&&!h||Bl(a))}if(d&&!h)for(c=f,f=l.Zi,h=f.length,l=0;l<h;l++){r=f.n[l];a.beginPath();n=u.eb();n.push(r.ua);n.push(r.va);q=r.ua;m=r.va;p=q;s=m;t=r.Fa.n;x=t.length;for(v=0;v<x;v++){B=t[v];switch(B.oa){case yd:$m(a,n,k,this.cd);n.length=0;n.push(B.F);n.push(B.G);q=B.F;
m=B.G;p=q;s=m;break;case pd:n.push(B.F);n.push(B.G);q=B.F;m=B.G;break;case zd:K.ye(q,m,B.bd,B.xe,B.dg,B.eg,B.pb,B.Bb,.5,n);q=B.F;m=B.G;break;case Ad:K.Xo(q,m,B.bd,B.xe,B.pb,B.Bb,.5,n);q=B.F;m=B.G;break;case Bd:for(var y=Hd(B,r),C=y.length,I=0;I<C;I++){var H=y[I];K.ye(q,m,H[2],H[3],H[4],H[5],H[6],H[7],.5,n);q=H[6];m=H[7]}break;case Gd:y=Id(B,r,q,m);C=y.length;for(I=0;I<C;I++)H=y[I],K.ye(q,m,H[2],H[3],H[4],H[5],H[6],H[7],.5,n),q=H[6],m=H[7];break;default:u.k("Segment not of valid type")}B.zh&&(n.push(p),
n.push(s),$m(a,n,k,this.cd))}$m(a,n,k,this.cd);u.ra(n);null!==this.yc&&(q=n=r=0,c&&e&&(r=a.shadowOffsetX,n=a.shadowOffsetY,q=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),Bl(a),c&&e&&(a.shadowOffsetX=r,a.shadowOffsetY=n,a.shadowBlur=q))}}d&&(void 0!==a.setLineDash?(a.setLineDash(u.mh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=u.mh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0));if(null!==this.eE){d=this.eE;Ph(d,Infinity,Infinity);
k=d.Ba;d.zc(0,0,k.width,k.height);a.save();k=this.dd.ub.first();a.beginPath();c=u.eb();c.push(k.ua);c.push(k.va);e=k.ua;f=k.va;h=e;l=f;r=k.Fa.n;n=r.length;for(q=0;q<n;q++){m=r[q];switch(m.oa){case yd:Zm(a,b,c,d);c.length=0;c.push(m.F);c.push(m.G);e=m.F;f=m.G;h=e;l=f;break;case pd:c.push(m.F);c.push(m.G);e=m.F;f=m.G;break;case zd:K.ye(e,f,m.bd,m.xe,m.dg,m.eg,m.pb,m.Bb,.5,c);e=m.F;f=m.G;break;case Ad:K.Xo(e,f,m.bd,m.xe,m.pb,m.Bb,.5,c);e=m.F;f=m.G;break;case Bd:p=Hd(m,k);s=p.length;for(t=0;t<s;t++)x=
p[t],K.ye(e,f,x[2],x[3],x[4],x[5],x[6],x[7],.5,c),e=x[6],f=x[7];break;case Gd:p=Id(m,k,e,f);s=p.length;for(t=0;t<s;t++)x=p[t],K.ye(e,f,x[2],x[3],x[4],x[5],x[6],x[7],.5,c),e=x[6],f=x[7];break;default:u.k("Segment not of valid type")}m.zh&&(c.push(h),c.push(l),Zm(a,b,c,d))}Zm(a,b,c,d);u.ra(c);a.restore()}}}};
function $m(a,b,c,d){var e=.001,f=c.length,h=0,k=0,l=0,m=0,e=b.length;if(!(4>e))if(h=b[0],k=b[1],4===e)kl(a,h,k,b[2],b[3],c,d);else{a.moveTo(h,k);for(var n=0,p=0,q=0,r=p=l=0,s=u.eb(),t=2;t<e;t+=2)l=b[t],m=b[t+1],n=l-h,p=m-k,0===n&&(n=.001),q=p/n,p=Math.sqrt(n*n+p*p),h=[],h[0]=n,h[1]=q,h[2]=p,s.push(h),r+=p,h=l,k=m;h=b[0];k=b[1];b=0;for(var m=!0,e=c[b%f],t=0!==d,p=0,l=s[p],n=l[0],q=l[1],l=l[2],v=0;.1<=r;){0===v&&(e=c[b%f],b++,t&&(d%=e,e-=d,t=!1));e>r&&(e=r);e>l?(v=e-l,e=l):v=0;var x=Math.sqrt(e*e/
(1+q*q));0>n&&(x=-x);h+=x;k+=q*x;m?a.lineTo(h,k):a.moveTo(h,k);r-=e;l-=e;if(0!==v){p++;if(p===s.length){u.ra(s);return}l=s[p];n=l[0];q=l[1];l=l[2];e=v}else m=!m}u.ra(s)}}X.prototype.getDocumentPoint=X.prototype.lb=function(a,b){void 0===b&&(b=new w);a.ne()&&u.k("getDocumentPoint:s Spot must be real: "+a.toString());var c=this.Ha,d=this.hb;b.m(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY);this.Ff.ab(b);return b};
X.prototype.Jj=function(a,b){var c=this.Pa;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.kb,e=this.hb/2;c.type!==dd||b||(e+=2);var f=u.Sf();f.assign(d);f.Jf(e+2,e+2);if(!f.Aa(a))return u.ic(f),!1;d=e+1E-4;if(c.type===dd){if(null===this.stroke)return!1;d=(c.F-c.ua)*(a.x-c.ua)+(c.G-c.va)*(a.y-c.va);if(0>(c.ua-c.F)*(a.x-c.F)+(c.va-c.G)*(a.y-c.G)||0>d)return!1;u.ic(f);return K.Hd(c.ua,c.va,c.F,c.G,e,a.x,a.y)}if(c.type===md){var h=c.ua,k=c.va,l=c.F,m=c.G,c=Math.min(h,l),n=Math.min(k,
m),h=Math.abs(l-h),k=Math.abs(m-k);f.x=c;f.y=n;f.width=h;f.height=k;if(null===this.fill){f.Jf(-d,-d);if(f.Aa(a))return u.ic(f),!1;f.Jf(d,d)}null!==this.stroke&&f.Jf(e,e);e=f.Aa(a);u.ic(f);return e}if(c.type===nd){h=c.ua;k=c.va;l=c.F;m=c.G;c=Math.min(h,l);n=Math.min(k,m);h=Math.abs(l-h);k=Math.abs(m-k);h/=2;k/=2;c=a.x-(c+h);n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return u.ic(f),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);u.ic(f);return 0>=h||0>=k?!1:1>=c*c/
(h*h)+n*n/(k*k)}if(c.type===ad)return u.ic(f),null===this.fill?Ld(c,a.x,a.y,e):c.Aa(a,e,1<this.hb,b);u.k("Unknown Geometry type");return!1};
X.prototype.Oo=function(a,b,c,d){var e=this.xa,f=this.Sg;a=Math.max(a,0);b=Math.max(b,0);var h;if(this.Rg)h=this.Pa.kb;else{var k=this.Fb,l=K.Uw[k];if(void 0===l){var m=K.qg[k];"string"===typeof m&&(m=K.qg[m]);"function"===typeof m?(l=m(null,100,100),K.Uw[k]=l):u.k("Unsupported Figure:"+k)}h=l.kb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(pl(this,!0)){case qh:d=c=0;break;case cd:m=Math.max(a-f,0);n=Math.max(b-f,0);break;case fl:m=Math.max(a-f,0);d=0;break;case el:c=0,n=Math.max(b-f,0)}isFinite(e.width)&&
(m=e.width);isFinite(e.height)&&(n=e.height);e=this.af;h=this.vg;c=Math.max(c,h.width)-f;d=Math.max(d,h.height)-f;m=Math.min(e.width,m);n=Math.min(e.height,n);m=isFinite(m)?Math.max(c,m):Math.max(k,c);n=isFinite(n)?Math.max(d,n):Math.max(l,d);c=rh(this);switch(c){case qh:break;case cd:k=m;l=n;break;case sh:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:u.k(c+" is not a valid geometryStretch.")}if(this.Rg)h=this.dd,e=k,d=l,c=h.copy(),h=h.kb,e/=h.width,d/=h.height,isFinite(e)||(e=1),
isFinite(d)||(d=1),1===e&&1===d||c.scale(e,d),this.Pa=c;else if(null===this.Pa||this.Pa.Dn!==a-f||this.Pa.Cn!==b-f)this.Pa=K.makeGeometry(this,k,l);h=this.Pa.kb;Infinity===a||Infinity===b?ml(this,h.x-f/2,h.y-f/2,0===a&&0===k?0:h.width+f,0===b&&0===l?0:h.height+f):ml(this,-(f/2),-(f/2),m+f,n+f)};
function Om(a,b,c){if(!1!==Aj(a)){a.Pc.La();var d=a.Sg;if(0===d){var e=a.T;e instanceof lf&&e.type===ah&&e.vc instanceof X&&(d=e.vc.hb)}d*=a.$b;ml(a,-(d/2),-(d/2),b+d,c+d);b=a.Pc;c=a.af;d=a.vg;b.width=Math.min(c.width,b.width);b.height=Math.min(c.height,b.height);b.width=Math.max(d.width,b.width);b.height=Math.max(d.height,b.height);a.Pc.freeze();a.Pc.J()||u.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Pc.toString());uj(a,!1)}}
function rh(a){var b=a.yD;return a.Rg?b===dl?cd:b:b===dl?K.Uw[a.Fb].Bd:b}X.prototype.xi=function(a,b,c,d){ql(this,a,b,c,d)};X.prototype.getNearestIntersectionPoint=X.prototype.bl=function(a,b,c){return this.Co(a.x,a.y,b.x,b.y,c)};
X.prototype.Co=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy),f=a*k+b*m+p,h=a*l+b*n+q,k=c*k+d*m+p,l=c*l+d*n+q,m=this.hb/2,p=this.Pa;null===p&&(Ph(this,Infinity,Infinity),p=this.Pa);q=p.kb;n=!1;if(p.type===dd)if(1.5>=this.hb)n=K.$g(p.nc,p.uc,p.pb,p.Bb,f,h,k,l,e);else{var r=0,s=0;p.nc===p.pb?(r=m,s=0):(b=(p.Bb-p.uc)/(p.pb-p.nc),s=m/Math.sqrt(1+b*b),r=s*b);d=u.eb();b=new w;K.$g(p.nc+
r,p.uc+s,p.pb+r,p.Bb+s,f,h,k,l,b)&&d.push(b);b=new w;K.$g(p.nc-r,p.uc-s,p.pb-r,p.Bb-s,f,h,k,l,b)&&d.push(b);b=new w;K.$g(p.nc+r,p.uc+s,p.nc-r,p.uc-s,f,h,k,l,b)&&d.push(b);b=new w;K.$g(p.pb+r,p.Bb+s,p.pb-r,p.Bb-s,f,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return u.ra(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],t=(k.x-f)*(k.x-f)+(k.y-h)*(k.y-h);t<s&&(s=t,e.x=k.x,e.y=k.y)}u.ra(d)}else if(p.type===md)b=q.x-m,n=K.bl(b,q.y-m,q.x+q.width+m,q.y+q.height+m,f,h,k,l,e);else if(p.type===nd)a:if(b=q.copy().Jf(m,
m),0===b.width)n=K.$g(b.x,b.y,b.x,b.y+b.height,f,h,k,l,e);else if(0===b.height)n=K.$g(b.x,b.y,b.x+b.width,b.y,f,h,k,l,e);else{a=b.width/2;var v=b.height/2;d=b.x+a;b=b.y+v;c=9999;f!==k&&(c=(h-l)/(f-k));if(9999>Math.abs(c)){n=h-b-c*(f-d);if(0>a*a*c*c+v*v-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+v*v-n*n);k=(-(a*a*c*n)+a*v*m)/(v*v+a*a*c*c)+d;a=(-(a*a*c*n)-a*v*m)/(v*v+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((f-k)*(f-k))+Math.abs((h-l)*(h-l));h=Math.abs((f-a)*(f-a))+Math.abs((h-b)*
(h-b));d<h?(e.x=k,e.y=l):(e.x=a,e.y=b)}else{k=v*v;l=f-d;k-=k/(a*a)*l*l;if(0>k){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);d<h?(e.x=f,e.y=l):(e.x=f,e.y=b)}n=!0}else if(p.type===ad){var x=0,B=0,y=t=0,q=u.K(),r=k-f,s=l-h,s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.ub.count;r++)for(var C=p.ub.n[r],I=C.Fa,x=C.ua,B=C.va,H=x,T=B,aa=0;aa<I.count;aa++){var R=I.n[aa],N=R.type,t=R.F,y=R.G,Z=!1;switch(N){case yd:H=t;T=y;break;case pd:Z=an(x,B,t,y,f,h,k,l,q);break;case zd:var Z=
R.Rb,N=R.jc,Ea=R.df,ua=R.ef,Z=K.js(x,B,Z,N,Ea,ua,t,y,f,h,k,l,.5,q);break;case Ad:Z=(x+2*R.Rb)/3;N=(B+2*R.jc)/3;Ea=(2*R.Rb+t)/3;ua=(2*R.Rb+t)/3;Z=K.js(x,B,Z,N,Ea,ua,t,y,f,h,k,l,.5,q);break;case Bd:case Gd:y=R.type===Bd?Hd(R,C):Id(R,C,x,B);N=y.length;for(Ea=0;Ea<N;Ea++)v=y[Ea],0===Ea&&an(x,B,v[0],v[1],f,h,k,l,q)&&(t=bn(f,h,q,s,e),t<s&&(s=t,n=!0)),K.js(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],f,h,k,l,.5,q)&&(t=bn(f,h,q,s,e),t<s&&(s=t,n=!0));t=v[6];y=v[7];break;default:u.k("Unknown Segment type: "+R.type)}x=
t;B=y;Z&&(t=bn(f,h,q,s,e),t<s&&(s=t,n=!0));R.ew&&(t=H,y=T,an(x,B,t,y,f,h,k,l,q)&&(t=bn(f,h,q,s,e),t<s&&(s=t,n=!0)))}f=c-a;h=d-b;b=Math.sqrt(f*f+h*h);0!==b&&(f/=b,h/=b);e.x-=f*m;e.y-=h*m;u.v(q)}else u.k("Invalid Geometry type");if(!n)return!1;this.transform.ab(e);return!0};function bn(a,b,c,d,e){a=c.x-a;b=c.y-b;b=a*a+b*b;return b<d?(e.x=c.x,e.y=c.y,b):d}
function an(a,b,c,d,e,f,h,k,l){var m=!1,n=(e-h)*(b-d)-(f-k)*(a-c);if(0===n)return!1;l.x=((e*k-f*h)*(a-c)-(e-h)*(a*d-b*c))/n;l.y=((e*k-f*h)*(b-d)-(f-k)*(a*d-b*c))/n;(a>c?a-c:c-a)<(b>d?b-d:d-b)?(e=b<d?b:d,a=b<d?d:b,(l.y>e||K.mb(l.y,e))&&(l.y<a||K.mb(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||K.mb(l.x,e))&&(l.x<a||K.mb(l.x,a))&&(m=!0));return m}
X.prototype.containedInRect=X.prototype.sm=function(a,b){if(void 0===b)return a.Kj(this.ba);var c=this.Pa;null===c&&(Ph(this,Infinity,Infinity),c=this.Pa);var c=c.kb,d=this.hb/2,e=!1,f=u.K();f.m(c.x-d,c.y-d);a.Aa(b.ab(f))&&(f.m(c.x-d,c.bottom+d),a.Aa(b.ab(f))&&(f.m(c.right+d,c.bottom+d),a.Aa(b.ab(f))&&(f.m(c.right+d,c.y-d),a.Aa(b.ab(f))&&(e=!0))));u.v(f);return e};
X.prototype.intersectsRect=X.prototype.sg=function(a,b){if(this.sm(a,b)||void 0===b&&(b=this.transform,a.Kj(this.ba)))return!0;var c=u.jh();c.set(b);c.oz();var d=a.left,e=a.right,f=a.top,h=a.bottom,k=u.K();k.m(d,f);c.ab(k);if(this.Jj(k,!0))return u.v(k),!0;k.m(e,f);c.ab(k);if(this.Jj(k,!0))return u.v(k),!0;k.m(d,h);c.ab(k);if(this.Jj(k,!0))return u.v(k),!0;k.m(e,h);c.ab(k);if(this.Jj(k,!0))return u.v(k),!0;var l=u.K(),m=u.K();c.set(b);c.aE(this.transform);c.oz();l.x=e;l.y=f;l.transform(c);k.x=d;k.y=
f;k.transform(c);var n=!1;cn(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),cn(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),cn(this,k,l,m)?n=!0:(k.x=d,k.y=f,k.transform(c),cn(this,k,l,m)&&(n=!0))));u.v(k);u.Ye(c);u.v(l);u.v(m);return n};function cn(a,b,c,d){if(!a.bl(b,c,d))return!1;a=b.x;b=b.y;var e=c.x;c=c.y;var f=d.x;d=d.y;if(a===e){var h=0;a=0;b<c?(h=b,a=c):(h=c,a=b);return d>=h&&d<=a}a<e?(h=a,a=e):h=e;return f>=h&&f<=a}
X.prototype.sD=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.ss(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.Jj(a,!0))return!0;var e=a.Lj(b);b=e;1.5<this.hb&&(e=this.hb/2+Math.sqrt(e),e*=e);var f=this.Pa;null===f&&(Ph(this,Infinity,Infinity),f=this.Pa);if(!c){var h=f.kb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if(Ya(a.x,a.y,k,l)<=e&&Ya(a.x,a.y,m,l)<=e&&Ya(a.x,a.y,k,h)<=e&&Ya(a.x,a.y,m,h)<=e)return!0}k=f.nc;l=f.uc;m=f.pb;h=f.Bb;if(f.type===dd){if(c=Xa(a.x,a.y,
k,l,m,h),f=(k-m)*(a.x-m)+(l-h)*(a.y-h),c<=(0<=(m-k)*(a.x-k)+(h-l)*(a.y-l)&&0<=f?e:b))return!0}else{if(f.type===md)return b=!1,c&&(b=Xa(a.x,a.y,k,l,k,h)<=e||Xa(a.x,a.y,k,l,m,l)<=e||Xa(a.x,a.y,m,l,m,h)<=e||Xa(a.x,a.y,k,h,m,h)<=e),b;if(f.type===nd){b=a.x-(k+m)/2;var f=a.y-(l+h)/2,n=Math.abs(m-k)/2,p=Math.abs(h-l)/2;if(0===n||0===p)return c=Xa(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=K.sG(n,p,b,f),a*a<=e)return!0}else return Ya(b,f,-n,0)>=e||Ya(b,f,0,-p)>=e||Ya(b,f,0,p)>=e||Ya(b,f,n,0)>=e?!1:!0}else if(f.type===
ad){h=f.kb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.x<k&&a.y>h&&a.y<l&&Xa(a.x,a.y,k,l,k,h)>e&&Xa(a.x,a.y,k,l,m,l)>e&&Xa(a.x,a.y,m,h,k,h)>e&&Xa(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Ld(f,a.x,a.y,b):f.Aa(a,b,!0))return!0}else{c=f.ub;for(b=0;b<c.count;b++){k=c.n[b];n=k.ua;p=k.va;if(a.ss(n,p)>e)return!1;l=k.Fa.n;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case yd:case pd:n=q.F;p=q.G;if(a.ss(n,p)>e)return!1;break;case zd:f=u.eb();K.ye(n,p,q.Rb,q.jc,
q.df,q.ef,q.F,q.G,.8,f);n=d(f,a);u.ra(f);if(n)return!1;n=q.F;p=q.G;if(a.ss(n,p)>e)return!1;break;case Ad:f=u.eb();K.Xo(n,p,q.Rb,q.jc,q.F,q.G,.8,f);n=d(f,a);u.ra(f);if(n)return!1;n=q.F;p=q.G;if(a.ss(n,p)>e)return!1;break;case Bd:case Gd:var q=q.type===Bd?Hd(q,k):Id(q,k,n,p),r=q.length,s=null,f=u.eb();for(b=0;b<r;b++)if(s=q[b],f.length=0,K.ye(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],.8,f),d(f,a))return u.ra(f),!1;u.ra(f);null!==s&&(n=s[6],p=s[7]);break;default:u.k("Unknown Segment type: "+q.type)}}}return!0}}}return!1};
u.defineProperty(X,{dd:"geometry"},function(){return this.jk?this.jk:this.Pa},function(a){var b=this.Pa;if(b!==a){this.jk=null!==a?this.Pa=a.freeze():this.Pa=null;var c=this.T;null!==c&&(c.kj=NaN);this.Rg=!0;this.R();this.h("geometry",b,a);a=this.T;null!==a&&0!==(this.ea&1024)&&ll(this,a,"geometryString")}});
u.defineProperty(X,{EG:"geometryString"},function(){return null===this.dd?"":this.dd.toString()},function(a){var b=sd(a);a=b.normalize();this.dd=b;var b=u.K(),c=this.position;c.J()?b.m(c.x-a.x,c.y-a.y):b.m(-a.x,-a.y);this.position=b;u.v(b)});u.defineProperty(X,{rz:"isGeometryPositioned"},function(){return this.hq},function(a){var b=this.hq;b!==a&&(this.hq=a,this.R(),this.h("isGeometryPositioned",b,a))});X.prototype.le=function(){this.Rg?this.jk=null:this.Pa=null;this.R()};
u.defineProperty(X,{fill:"fill"},function(){return this.jd},function(a){var b=this.jd;b!==a&&(a instanceof ga&&a.freeze(),this.jd=a,this.ma(),this.h("fill",b,a))});u.defineProperty(X,{stroke:"stroke"},function(){return this.yc},function(a){var b=this.yc;b!==a&&(a instanceof ga&&a.freeze(),this.yc=a,this.ma(),this.h("stroke",b,a))});
u.defineProperty(X,{hb:"strokeWidth"},function(){return this.Sg},function(a){var b=this.Sg;if(b!==a)if(0<=a){this.Sg=a;this.R();var c=this.T;null!==c&&(c.kj=NaN);this.h("strokeWidth",b,a)}else u.wa(a,"value >= 0",X,"strokeWidth:value")});u.defineProperty(X,{qI:"strokeCap"},function(){return this.co},function(a){var b=this.co;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?u.wa(a,'"butt", "round", or "square"',X,"strokeCap"):(this.co=a,this.ma(),this.h("strokeCap",b,a)))});
u.defineProperty(X,{wK:"strokeJoin"},function(){return this.eo},function(a){var b=this.eo;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?u.wa(a,'"miter", "bevel", or "round"',X,"strokeJoin"):(this.eo=a,this.ma(),this.h("strokeJoin",b,a)))});u.defineProperty(X,{xK:"strokeMiterLimit"},function(){return this.gm},function(a){var b=this.gm;if(b!==a)if(0<a){this.gm=a;this.ma();var c=this.T;null!==c&&(c.kj=NaN);this.h("strokeMiterLimit",b,a)}else u.wa(a,"value > 0",X,"strokeWidth:value")});
u.defineProperty(X,{gA:"strokeDashArray"},function(){return this.fm},function(a){var b=this.fm;if(b!==a){null===a||Array.isArray(a)||u.Kd(a,"Array",X,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||u.k("strokeDashArray:value "+f+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.fm=a;this.ma();this.h("strokeDashArray",b,a)}});
u.defineProperty(X,{rI:"strokeDashOffset"},function(){return this.cd},function(a){var b=this.cd;b!==a&&0<=a&&(this.cd=a,this.ma(),this.h("strokeDashOffset",b,a))});u.defineProperty(X,{Fb:"figure"},function(){return this.tn},function(a){var b=this.tn;if(b!==a){var c=K.qg[a];"function"===typeof c?c=a:(c=K.qg[a.toLowerCase()])||u.k("Unknown Shape.figure: "+a);b!==c&&(a=this.T,null!==a&&(a.kj=NaN),this.tn=c,this.Rg=!1,this.le(),this.h("figure",b,c))}});
u.defineProperty(X,{jp:"toArrow"},function(){return this.fo},function(a){var b=this.fo;!0===a?a="Standard":!1===a&&(a="");if(b!==a){var c=K.UC(a);null===c?u.k("Unknown Shape.toArrow: "+a):b!==c&&(this.fo=c,this.Rg=!1,this.le(),dn(this),this.h("toArrow",b,c))}});
u.defineProperty(X,{ez:"fromArrow"},function(){return this.wn},function(a){var b=this.wn;!0===a?a="Standard":!1===a&&(a="");if(b!==a){var c=K.UC(a);null===c?u.k("Unknown Shape.fromArrow: "+a):b!==c&&(this.wn=c,this.Rg=!1,this.le(),dn(this),this.h("fromArrow",b,c))}});function dn(a){var b=a.g;null!==b&&b.ha.gb||(a.Cw=en,"None"!==a.fo?(a.Pf=-1,a.Hj=xc):"None"!==a.wn&&(a.Pf=0,a.Hj=new L(1-xc.x,xc.y)))}
u.defineProperty(X,{A:"spot1"},function(){return this.ri},function(a){u.C(a,L,X,"spot1");var b=this.ri;b.L(a)||(this.ri=a=a.Z(),this.R(),this.h("spot1",b,a))});u.defineProperty(X,{B:"spot2"},function(){return this.si},function(a){u.C(a,L,X,"spot2");var b=this.si;b.L(a)||(this.si=a=a.Z(),this.R(),this.h("spot2",b,a))});u.defineProperty(X,{xc:"parameter1"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(this.cr=a,this.le(),this.h("parameter1",b,a))});
u.defineProperty(X,{et:"parameter2"},function(){return this.dr},function(a){var b=this.dr;b!==a&&(this.dr=a,this.le(),this.h("parameter2",b,a))});u.u(X,{Ha:"naturalBounds"},function(){if(null!==this.Pa)return this.Hc.assign(this.Pa.kb),this.Hc;var a=this.xa;return new z(0,0,a.width,a.height)});u.defineProperty(X,{FJ:"isRectangular"},function(){return this.nq},function(a){var b=this.nq;b!==a&&(this.nq=a,this.R(),this.h("isRectangular",b,a))});
u.defineProperty(X,{eE:"pathObject"},function(){return this.gr},function(a){var b=this.gr;b!==a&&(this.gr=a,this.ma(),this.h("pathObject",b,a))});u.defineProperty(X,{yD:"geometryStretch"},function(){return this.Zp},function(a){var b=this.Zp;b!==a&&(u.rb(a,S,X,"geometryStretch"),this.Zp=a,this.h("geometryStretch",b,a))});
u.defineProperty(X,{interval:"interval"},function(){return this.eq},function(a){var b=this.eq;a=Math.floor(a);b!==a&&0<=a&&(this.eq=a,null!==this.g&&vj(this.g),this.R(),this.h("interval",b,a))});X.getFigureGenerators=function(){var a=new la("string","function"),b;for(b in K.qg)if(b!==b.toLowerCase()){var c=K.qg[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};
X.defineFigureGenerator=function(a,b){u.j(a,"string",X,"defineFigureGenerator:name");"string"===typeof b?""!==b&&K.qg[b]||u.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):u.j(b,"function",X,"defineFigureGenerator:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||u.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);var d=K.qg;d[a]=b;d[c]=a};
X.getArrowheadGeometries=function(){var a=new la("string",$c),b;for(b in K.Qi)if(b!==b.toLowerCase()){var c=K.Qi[b];c instanceof $c&&a.add(b,c)}a.freeze();return a};
X.defineArrowheadGeometry=function(a,b){u.j(a,"string",X,"defineArrowheadGeometry:name");var c=null;"string"===typeof b?(u.j(b,"string",X,"defineArrowheadGeometry:pathstr"),c=sd(b,!1)):(u.C(b,$c,X,"defineArrowheadGeometry:pathstr"),c=b);var d=a.toLowerCase();""!==a&&"none"!==d&&a!==d||u.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var e=K.Qi;e[a]=c;e[d]=a};
function qa(){S.call(this);this.ie="";this.yc="black";this.Hg="13px sans-serif";this.Rd="start";this.kq=!0;this.Kl=this.Ll=!1;this.Ek=fn;this.jm=gn;this.Gu=this.ve=0;this.vn=this.ay=this.by=null;this.ej=new hn;this.Tp=!1;this.kf=this.Hk=this.Rr=null;this.zj=this.yj=0;this.ii=Infinity}u.Ga(qa,S);u.fa("TextBlock",qa);var jn=new pa,kn=0,ln=new pa,mn=0,nn="...",on="",pn=u.createElement("canvas").getContext("2d");qa.getEllipsis=function(){return nn};qa.setEllipsis=function(a){nn=a;ln=new pa;mn=0};
qa.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.ie=this.ie;a.yc=this.yc;a.Hg=this.Hg;a.Rd=this.Rd;a.kq=this.kq;a.Ll=this.Ll;a.Kl=this.Kl;a.jm=this.jm;a.Ek=this.Ek;a.ve=this.ve;a.Gu=this.Gu;a.by=this.by;a.ay=this.ay;a.vn=this.vn;a.ej.qs(this.ej);a.Tp=this.Tp;a.Rr=this.Rr;a.Hk=this.Hk;a.kf=this.kf;a.yj=this.yj;a.zj=this.zj;a.ii=this.ii};qa.prototype.toString=function(){return 22<this.ie.length?'TextBlock("'+this.ie.substring(0,20)+'"...)':'TextBlock("'+this.ie+'")'};
var qn;qa.None=qn=u.s(qa,"None",0);var rn;qa.WrapFit=rn=u.s(qa,"WrapFit",1);var gn;qa.WrapDesiredSize=gn=u.s(qa,"WrapDesiredSize",2);var fn;qa.OverflowClip=fn=u.s(qa,"OverflowClip",0);var sn;qa.OverflowEllipsis=sn=u.s(qa,"OverflowEllipsis",1);qa.prototype.R=function(){S.prototype.R.call(this);this.ay=this.by=null};u.defineProperty(qa,{font:"font"},function(){return this.Hg},function(a){var b=this.Hg;b!==a&&(this.Hg=a,this.vn=null,this.R(),this.h("font",b,a))});
qa.isValidFont=function(a){var b=pn.font;if(a===b||"10px sans-serif"===a)return!0;pn.font="10px sans-serif";var c;pn.font=a;var d=pn.font;if("10px sans-serif"!==d)return pn.font=b,!0;pn.font="19px serif";c=pn.font;pn.font=a;d=pn.font;pn.font=b;return d!==c};u.defineProperty(qa,{text:"text"},function(){return this.ie},function(a){var b=this.ie;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.ie=a,this.R(),this.h("text",b,a))});
u.defineProperty(qa,{textAlign:"textAlign"},function(){return this.Rd},function(a){var b=this.Rd;b!==a&&("start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Rd=a,this.ma(),this.h("textAlign",b,a)):u.wa(a,'"start", "end", "left", "right", or "center"',qa,"textAlign"))});u.u(qa,{Ha:"naturalBounds"},function(){if(!this.Hc.J()){var a=tn(this,this.ie,this.ej,999999).width,b=un(this,a,this.ej),c=this.xa;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);bb(this.Hc,a,b)}return this.Hc});
u.defineProperty(qa,{iw:"isMultiline"},function(){return this.kq},function(a){var b=this.kq;b!==a&&(this.kq=a,this.R(),this.h("isMultiline",b,a))});u.defineProperty(qa,{JJ:"isUnderline"},function(){return this.Ll},function(a){var b=this.Ll;b!==a&&(this.Ll=a,this.ma(),this.h("isUnderline",b,a))});u.defineProperty(qa,{GJ:"isStrikethrough"},function(){return this.Kl},function(a){var b=this.Kl;b!==a&&(this.Kl=a,this.ma(),this.h("isStrikethrough",b,a))});
u.defineProperty(qa,{bF:"wrap"},function(){return this.jm},function(a){var b=this.jm;b!==a&&(this.jm=a,this.R(),this.h("wrap",b,a))});u.defineProperty(qa,{overflow:"overflow"},function(){return this.Ek},function(a){var b=this.Ek;b!==a&&(this.Ek=a,this.R(),this.h("overflow",b,a))});u.defineProperty(qa,{stroke:"stroke"},function(){return this.yc},function(a){var b=this.yc;b!==a&&(a instanceof ga&&a.freeze(),this.yc=a,this.ma(),this.h("stroke",b,a))});u.u(qa,{oH:"lineCount"},function(){return this.ve});
u.defineProperty(qa,{bz:"editable"},function(){return this.Tp},function(a){var b=this.Tp;b!==a&&(this.Tp=a,this.h("editable",b,a))});u.defineProperty(qa,{NE:"textEditor"},function(){return this.Rr},function(a){var b=this.Rr;b!==a&&(a instanceof HTMLElement||u.k("textEditor must be an HTMLElement"),this.Rr=a,this.h("textEditor",b,a))});
u.defineProperty(qa,{cz:"errorFunction"},function(){return this.kf},function(a){var b=this.kf;b!==a&&(null!==a&&u.j(a,"function",qa,"errorFunction"),this.kf=a,this.h("errorFunction",b,a))});function xl(a,b){var c=a.Hg;null!==c&&b.Et!==c&&(b.font=c,b.Et=c)}
qa.prototype.Mj=function(a,b){if(null!==this.yc&&0!==this.ie.length&&null!==this.Hg){var c=this.Ha.width,d=vn(this);a.textAlign=this.Rd;yl(this,a,this.yc,!0,!1);(this.Ll||this.Kl)&&yl(this,a,this.yc,!1,!1);var e=this.ej,f=0,h=!1,k=u.fc(0,0);this.Ff.ab(k);var l=u.fc(0,d);this.Ff.ab(l);var m=k.Lj(l);u.v(k);u.v(l);k=b.scale;8>m*k*k&&(h=!0);b.Gg!==a&&(h=!1);!1===b.$v("textGreeking")&&(h=!1);for(var m=this.yj,k=this.zj,l=this.ve,n=0;n<l;n++){var p=e.gf[n],q=e.te[n];p>c&&(p=c);var f=f+m,r=q,q=a,s=f,t=c,
v=d,x=0;h?("start"===this.Rd||"left"===this.Rd?x=0:"end"===this.Rd||"right"===this.Rd?x=t-p:"center"===this.Rd?x=(t-p)/2:u.k("textAlign must be start, end, left, right, or center"),q.fillRect(0+x,s+.25*v,p,1)):("start"===this.Rd||"left"===this.Rd?x=0:"end"===this.Rd||"right"===this.Rd?x=t:"center"===this.Rd?x=t/2:u.k("textAlign must be start, end, left, right, or center"),q.fillText(r,0+x,s+v-.25*v),r=v/20|0,0===r&&(r=1),"end"===this.Rd||"right"===this.Rd?x-=p:"center"===this.Rd&&(x-=p/2),this.Ll&&
(q.beginPath(),q.lineWidth=r,q.moveTo(0+x,s+v-.2*v),q.lineTo(0+x+p,s+v-.2*v),q.stroke()),this.Kl&&(q.beginPath(),q.lineWidth=r,s=s+v-v/2.2|0,0!==r%2&&(s+=.5),q.moveTo(0+x,s),q.lineTo(0+x+p,s),q.stroke()));f+=d+k}}};
qa.prototype.Oo=function(a,b,c,d){var e=this.ej;e.reset();var f=0,h=0;if(isNaN(this.xa.width)){f=this.ie.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===f.length)f=0;else if(this.iw){for(var k=h=0,l=!1;!l;){var m=f.indexOf("\n",k);-1===m&&(m=f.length,l=!0);k=wn(f.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.Hg);k>h&&(h=k);k=m+1}f=h}else h=f.indexOf("\n",0),0<=h&&(f=f.substr(0,h)),f=k=wn(f,this.Hg);f=Math.min(f,a/this.scale);f=Math.max(8,f)}else f=this.xa.width;null!==this.S&&(f=Math.min(f,this.S.af.width),
f=Math.max(f,this.S.vg.width));h=un(this,f,e);m=h=isNaN(this.xa.height)?Math.min(h,b/this.scale):this.xa.height;if(0!==e.Oe&&1!==e.te.length&&this.Ek===sn&&(b=this.Hg,l=this.Ek===sn?xn(b):0,k=this.yj+this.zj,k=Math.max(0,vn(this)+k),m=Math.max(Math.floor(m/k)-1,0),!(m+1>=e.te.length))){k=e.te[m];for(a=Math.max(1,a-l);wn(k,b)>a&&1<k.length;)k=k.substr(0,k.length-1);k+=nn;a=wn(k,b);e.te[m]=k;e.te=e.te.slice(0,m+1);e.gf[m]=a;e.gf=e.gf.slice(0,m+1);e.wi=e.te.length;e.Oe=Math.max(e.Oe,a);this.ve=e.wi}if(this.bF===
rn||isNaN(this.xa.width))f=e.Oe,isNaN(this.xa.width)&&(f=Math.max(8,f));f=Math.max(c,f);h=Math.max(d,h);bb(this.Hc,f,h);ml(this,0,0,f,h)};qa.prototype.xi=function(a,b,c,d){ql(this,a,b,c,d)};
function tn(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");var e=0,f=0,h=0,k=a.Hg,f=a.yj+a.zj,l=Math.max(0,vn(a)+f),h=a.Ek===sn?xn(k):0;if(a.ve>=a.ii)return new ia(0,l);if(a.jm===qn){c.wi=1;f=wn(b,k);if(0===h||f<=d)return c.Oe=f,c.gf.push(c.Oe),c.te.push(b),new ia(f,l);var m=yn(b);b=b.substr(m.length);for(var n=yn(b),f=wn(m+n,k);0<n.length&&f<=d;)m+=n,b=b.substr(n.length),n=yn(b),f=wn((m+n).replace(/^\s+|\s+$/g,""),k);m+=n.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-h);wn(m,k)>d&&1<m.length;)m=m.substr(0,
m.length-1);m+=nn;h=wn(m,k);c.gf.push(h);c.Oe=h;c.te.push(m);return new ia(h,l)}var p=0;0===b.length&&(p=1,c.gf.push(0),c.te.push(b));for(;0<b.length;){m=yn(b);for(b=b.substr(m.length);wn(m,k)>d;){n=1;f=wn(m.substr(0,n),k);for(h=0;f<=d;)n++,h=f,f=wn(m.substr(0,n),k);1===n?(c.gf[a.ve+p]=f,e=Math.max(e,f)):(c.gf[a.ve+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.te[a.ve+p]=m.substr(0,n);p++;m=m.substr(n);if(a.ve+p>a.ii)break}n=yn(b);for(f=wn(m+n,k);0<n.length&&f<=d;)m+=n,b=b.substr(n.length),n=yn(b),f=wn((m+
n).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");if(""!==m&&(0===n.length?(c.gf.push(f),e=Math.max(e,f)):(h=wn(m,k),c.gf.push(h),e=Math.max(e,h)),c.te.push(m),p++,a.ve+p>a.ii))break}c.wi=Math.min(a.ii,p);c.Oe=Math.max(c.Oe,e);return new ia(c.Oe,l*c.wi)}function yn(a){for(var b=a.length,c=0;c<b&&" "!==a.charAt(c);)c++;for(;c<b&&" "===a.charAt(c);)c++;return c>=b?a:a.substr(0,c)}function wn(a,b){on!==b&&(on=pn.font=b);return pn.measureText(a).width}
function vn(a){if(null!==a.vn)return a.vn;var b=a.Hg;on!==b&&(on=pn.font=b);var c=0;void 0!==jn[b]&&5E3>kn?c=jn[b]:(c=1.3*pn.measureText("M").width,jn[b]=c,kn++);return a.vn=c}function xn(a){on!==a&&(on=pn.font=a);var b=0;void 0!==ln[a]&&5E3>mn?b=ln[a]:(b=pn.measureText(nn).width,ln[a]=b,mn++);return b}
function un(a,b,c){var d=a.ie.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.yj+a.zj,e=Math.max(0,vn(a)+e);if(0===d.length)return c.Oe=0,a.ve=1,e;if(!a.iw){var f=d.indexOf("\n",0);0<=f&&(d=d.substr(0,f))}for(var f=0,h=a.ve=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.jm!==qn?(c.wi=0,h=tn(a,h,c,b),f+=h.height,a.ve+=c.wi):(tn(a,h,c,b),f+=e,a.ve++),a.ve===a.ii&&(l=!0)),h=k+1;return a.Gu=f}
u.defineProperty(qa,{jA:"textValidation"},function(){return this.Hk},function(a){var b=this.Hk;b!==a&&(null!==a&&u.j(a,"function",qa,"textValidation"),this.Hk=a,this.h("textValidation",b,a))});u.defineProperty(qa,{tK:"spacingAbove"},function(){return this.yj},function(a){var b=this.yj;b!==a&&(this.yj=a,this.h("spacingAbove",b,a))});u.defineProperty(qa,{uK:"spacingBelow"},function(){return this.zj},function(a){var b=this.zj;b!==a&&(this.zj=a,this.h("spacingBelow",b,a))});
u.defineProperty(qa,{WJ:"maxLines"},function(){return this.ii},function(a){var b=this.ii;b!==a&&(a=Math.floor(a),0>=a&&u.wa(a,"> 0",qa,"maxLines"),this.ii=a,this.h("maxLines",b,a),this.R())});u.u(qa,{XJ:"metrics"},function(){return this.ej});function hn(){this.Oe=this.wi=0;this.gf=[];this.te=[]}hn.prototype.reset=function(){this.Oe=this.wi=0;this.gf=[];this.te=[]};hn.prototype.qs=function(a){this.wi=a.wi;this.Oe=a.Oe;this.gf=u.Pk(a.gf);this.te=u.Pk(a.te)};u.u(hn,{aJ:"arrSize"},function(){return this.gf});
u.u(hn,{bJ:"arrText"},function(){return this.te});u.u(hn,{VJ:"maxLineWidth"},function(){return this.Oe});function Ri(){S.call(this);this.Me=null;this.Lr="";this.xj=(new z(NaN,NaN,NaN,NaN)).freeze();this.zn=cd;this.Qr=this.Aj=this.kf=null;this.Sx=!1;this.Zn=null;this.JB=0}u.Ga(Ri,S);u.fa("Picture",Ri);var zn=new pa,An=0,Mi=[];
function Bn(){var a=Mi;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.Y&&a.push(e.parentElement.Y)}return a}var Cn;Ri.clearCache=Cn=function(a){void 0===a&&(a="");u.j(a,"string",Ri,"clearCache:url");""!==a?zn[a]&&(delete zn[a],An--):(zn=new pa,An=0)};
Ri.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.element=this.Me;a.Lr=this.Lr;a.xj.assign(this.xj);a.zn=this.zn;a.kf=this.kf;a.Aj=this.Aj;a.Zn=this.Zn};Ri.prototype.toString=function(){return"Picture("+this.source+")#"+u.Uc(this)};
u.defineProperty(Ri,{element:"element"},function(){return this.Me},function(a){var b=this.Me;b!==a&&(a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||u.k("Picture.element must be an instance of Image, Canvas, or Video."),this.Sx=a instanceof HTMLCanvasElement,this.Me=a,!0===a.complete||void 0===a.complete?(a.ou instanceof Event&&null!==this.kf&&this.kf(this,a.ou),!0===a.Ux&&null!==this.Aj&&this.Aj(this,null),a.Ux=!0,this.xa.J()||(uj(this,!1),this.R())):
a.iB||(a.addEventListener("load",function(b){Dn(a,b)}),a.addEventListener("error",function(b){En(a,b)}),a.iB=!0),this.h("element",b,a),this.ma())});
u.defineProperty(Ri,{source:"source"},function(){return this.Lr},function(a){var b=this.Lr;if(b!==a){u.j(a,"string",Ri,"source");this.Lr=a;var c=zn,d=this.g;if(void 0!==c[a])var e=c[a].mo[0].source;else{30<An&&(Cn(),c=zn);e=u.createElement("img");e.addEventListener("load",function(a){Dn(e,a)});e.addEventListener("error",function(a){En(e,a)});e.iB=!0;e.src=a;var f=this.Zn;null!==f&&(e.crossOrigin=f(this));c[a]=new Fn(e);An++}null!==d&&vk(d,this);this.element=e;null!==d&&uk(d,this);this.ma();this.h("source",
b,a)}});function Dn(a,b){a.Ux=!0;a.ou=!1;for(var c=null,d=Bn(),e=d.length,f=0;f<e;f++){var h=d[f],k=h.Tn.ta(a.src);if(null!==k){e=k.length;for(f=0;f<e;f++)c=k[f],c.xa.J()||(h.VB.add(c),h.de()),null!==c.Aj&&c.Aj(c,b);h.ma()}}}function En(a,b){a.ou=b;for(var c=null,d=Bn(),e=d.length,f=0;f<e;f++)if(c=d[f].Tn.ta(a.src),null!==c){for(var e=c.length,h=u.eb(),f=0;f<e;f++)h.push(c[f]);for(f=0;f<e;f++)c=h[f],null!==c.kf&&c.kf(c,b);u.ra(h)}}
u.defineProperty(Ri,{sK:"sourceCrossOrigin"},function(){return this.Zn},function(a){if(this.Zn!==a&&(null!==a&&u.j(a,"function",Ri,"sourceCrossOrigin"),this.Zn=a,null!==this.element)){var b=this.element.src;null===a&&"string"===typeof b?this.element.crossOrigin=null:null!==a&&(this.element.crossOrigin=a(this))}});u.defineProperty(Ri,{Li:"sourceRect"},function(){return this.xj},function(a){var b=this.xj;b.L(a)||(u.C(a,z,Ri,"sourceRect"),this.xj=a=a.Z(),this.ma(),this.h("sourceRect",b,a))});
u.defineProperty(Ri,{RG:"imageStretch"},function(){return this.zn},function(a){var b=this.zn;b!==a&&(u.rb(a,S,Ri,"imageStretch"),this.zn=a,this.ma(),this.h("imageStretch",b,a))});u.defineProperty(Ri,{cz:"errorFunction"},function(){return this.kf},function(a){var b=this.kf;b!==a&&(null!==a&&u.j(a,"function",Ri,"errorFunction"),this.kf=a,this.h("errorFunction",b,a))});
u.defineProperty(Ri,{AK:"successFunction"},function(){return this.Aj},function(a){var b=this.Aj;b!==a&&(null!==a&&u.j(a,"function",Ri,"successFunction"),this.Aj=a,this.h("successFunction",b,a))});
Ri.prototype.Mj=function(a,b){var c=this.Me;if(null!==c){var d=c.src;null!==d&&""!==d||u.k("Element has no source attribute: "+c);if(!(c.ou instanceof Event)&&!0===c.Ux){var d=this.Ha,e=0,f=0,h=this.Sx,k=h?+c.width:c.naturalWidth,h=h?+c.height:c.naturalHeight;void 0===k&&c.videoWidth&&(k=c.videoWidth);void 0===h&&c.videoHeight&&(h=c.videoHeight);k=k||d.width;h=h||d.height;if(0!==k&&0!==h){var l=k,m=h;this.Li.J()&&(e=this.xj.x,f=this.xj.y,k=this.xj.width,h=this.xj.height);var n=k,p=h,q=this.zn;switch(q){case qh:if(this.Li.J())break;
e+=Math.max((n-d.width)/2,0);f+=Math.max((p-d.height)/2,0);k=Math.min(d.width,n);h=Math.min(d.height,p);break;case cd:n=d.width;p=d.height;break;case sh:case th:var r=0;q===sh?(r=Math.min(d.height/p,d.width/n),n*=r,p*=r):q===th&&(r=Math.max(d.height/p,d.width/n),n*=r,p*=r,e+=(n-d.width)/2,f+=(p-d.height)/2,k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}this.JB=k*h;var q=this.Hi()*b.scale,s=this.JB/(n*q*p*q),r=zn[this.source],q=null;if(void 0!==r&&16<s){2>r.mo.length&&(Gn(r,4,l,m),Gn(r,16,
l,m));for(var l=r.mo,m=l.length,q=l[0],t=0;t<m;t++)if(l[t].Yo*l[t].Yo<s)q=l[t];else break}if(!b.qn){if(null===this.Qr)if(null===this.Me)this.Qr=!1;else{l=u.createElement("canvas").getContext("2d");l.drawImage(this.Me,0,0);try{l.getImageData(0,0,1,1),this.Qr=!1}catch(v){this.Qr=!0}}if(this.Qr)return}if(b.$v("pictureRatioOptimization")&&!b.Tx&&void 0!==r&&null!==q&&1!==q.Yo){a.save();r=q.Yo;try{a.drawImage(q.source,e/r,f/r,Math.min(q.source.width,k/r),Math.min(q.source.height,h/r),Math.max((d.width-
n)/2,0),Math.max((d.height-p)/2,0),Math.min(d.width,n),Math.min(d.height,p))}catch(x){}a.restore()}else try{a.drawImage(c,e,f,k,h,Math.max((d.width-n)/2,0),Math.max((d.height-p)/2,0),Math.min(d.width,n),Math.min(d.height,p))}catch(B){}}}}};u.u(Ri,{Ha:"naturalBounds"},function(){return this.Hc});
Ri.prototype.Oo=function(a,b,c,d){var e=this.xa,f=pl(this,!0),h=this.Me,k=this.Sx;if(k||!this.$x&&h&&h.complete)this.$x=!0;null===h&&(isFinite(a)||(a=0),isFinite(b)||(b=0));isFinite(e.width)||f===cd||f===fl?(isFinite(a)||(a=this.Li.J()?this.Li.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.$x&&(a=this.Li.J()?this.Li.width:k?+h.width:h.naturalWidth);isFinite(e.height)||f===cd||f===el?(isFinite(b)||(b=this.Li.J()?this.Li.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==this.$x&&(b=
this.Li.J()?this.Li.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.af;f=this.vg;c=Math.max(c,f.width);d=Math.max(d,f.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);null===h||h.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));bb(this.Hc,a,b);ml(this,0,0,a,b)};Ri.prototype.xi=function(a,b,c,d){ql(this,a,b,c,d)};function Fn(a){this.mo=[new Hn(a,1)]}
function Gn(a,b,c,d){var e=new oa(null),f=e.getContext("2d"),h=1/b;e.width=c/b;e.height=d/b;b=new Hn(e.Dd,b);c=a.mo[a.mo.length-1];f.setTransform(h*c.Yo,0,0,h*c.Yo,0,0);f.drawImage(c.source,0,0);a.mo.push(b)}function Hn(a,b){this.source=a;this.Yo=b}function ka(){this.o=new $c;this.Tb=null}g=ka.prototype;g.reset=function(){this.o=new $c;this.Tb=null};
function M(a,b,c,d,e,f){null===a.o&&u.k("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.Tb&&u.k("Need to call beginFigure first"),d=new Jd(yd),d.F=b,d.G=c,a.Tb.Fa.add(d)):(a.Tb=new bd,a.Tb.ua=b,a.Tb.va=c,a.Tb.Ns=d,a.o.ub.add(a.Tb));void 0!==f&&(a.Tb.En=f)}function P(a){null===a.o&&u.k("StreamGeometryContext has been closed");null===a.Tb&&u.k("Need to call beginFigure first");var b=a.Tb.Fa.length;0<b&&a.Tb.Fa.ja(b-1).close()}
function vd(a){null===a.o&&u.k("StreamGeometryContext has been closed");null===a.Tb&&u.k("Need to call beginFigure first");0<a.Tb.Fa.length&&(a.Tb.Ns=!0)}g.$a=function(a){null===this.o&&u.k("StreamGeometryContext has been closed");null===this.Tb&&u.k("Need to call beginFigure first");this.Tb.il=a};g.moveTo=function(a,b,c){void 0===c&&(c=!1);null===this.o&&u.k("StreamGeometryContext has been closed");null===this.Tb&&u.k("Need to call beginFigure first");var d=new Jd(yd);d.F=a;d.G=b;c&&d.close();this.Tb.Fa.add(d)};
g.lineTo=function(a,b,c){void 0===c&&(c=!1);null===this.o&&u.k("StreamGeometryContext has been closed");null===this.Tb&&u.k("Need to call beginFigure first");var d=new Jd(pd);d.F=a;d.G=b;c&&d.close();this.Tb.Fa.add(d)};function O(a,b,c,d,e,f,h,k){void 0===k&&(k=!1);null===a.o&&u.k("StreamGeometryContext has been closed");null===a.Tb&&u.k("Need to call beginFigure first");var l=new Jd(zd);l.Rb=b;l.jc=c;l.df=d;l.ef=e;l.F=f;l.G=h;k&&l.close();a.Tb.Fa.add(l)}
function td(a,b,c,d,e){var f;void 0===f&&(f=!1);null===a.o&&u.k("StreamGeometryContext has been closed");null===a.Tb&&u.k("Need to call beginFigure first");var h=new Jd(Ad);h.Rb=b;h.jc=c;h.F=d;h.G=e;f&&h.close();a.Tb.Fa.add(h)}g.arcTo=function(a,b,c,d,e,f,h){void 0===f&&(f=0);void 0===h&&(h=!1);null===this.o&&u.k("StreamGeometryContext has been closed");null===this.Tb&&u.k("Need to call beginFigure first");var k=new Jd(Bd);k.Je=a;k.Qf=b;k.Ja=c;k.Ua=d;k.radiusX=e;k.radiusY=0!==f?f:e;h&&k.close();this.Tb.Fa.add(k)};
function ud(a,b,c,d,e,f,h,k){var l;void 0===l&&(l=!1);null===a.o&&u.k("StreamGeometryContext has been closed");null===a.Tb&&u.k("Need to call beginFigure first");b=new Jd(Gd,h,k,b,c,d,e,f);l&&b.close();a.Tb.Fa.add(b)}
K.makeGeometry=function(a,b,c){var d=a.xa,e=d.width,d=d.height;void 0!==b&&!isNaN(b)&&isFinite(b)&&(e=b);void 0!==c&&!isNaN(c)&&isFinite(c)&&(d=c);isFinite(e)||(e=100);isFinite(d)||(d=100);b=null;"None"!==a.jp?b=K.Qi[a.jp]:"None"!==a.ez?b=K.Qi[a.ez]:(c=K.qg[a.Fb],"string"===typeof c&&(c=K.qg[c]),void 0===c&&u.k("Unknown Shape.figure: "+a.Fb),b=c(a,e,d),b.Dn=e,b.Cn=d);null===b&&(c=K.qg.Rectangle,"function"===typeof c&&(b=c(a,e,d)));return b};
K.Ai=function(a,b,c,d,e,f,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+f*l;e=e*s+h*l;f=f*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+f*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=f};K.uo=function(a){a=K.wm(a);var b=u.eb();b[0]=a[0];for(var c=1,d=1;d<a.length;)b[c]=a[d],b[c+1]=a[d],b[c+2]=a[d+1],d+=2,c+=3;u.ra(a);return b};
K.wm=function(a){var b=K.Qk(a),c=u.eb(),d=Math.floor(b.length/2),e=b.length-1;a=0===a%2?2:1;for(var f=0;f<e;f++){var h=b[f],k=b[f+1],l=b[(d+f-1)%e],m=b[(d+f+a)%e];c[2*f]=h;c[2*f+1]=K.al(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new w)}c[c.length]=c[0];u.ra(b);return c};K.al=function(a,b,c,d,e,f,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(f-k)/m,h=a,n=k*h+(f-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(f-k)/m,a=b-d*a,h=(f-k*e-a)/(d-k),n=d*h+a);l.m(h,n);return l};
K.Qk=function(a){for(var b=u.eb(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new w(.5+.5*Math.cos(d),.5+.5*Math.sin(d));b.push(b[0]);return b};K.sA=(new L(.156,.156)).Ka();K.tA=(new L(.844,.844)).Ka();
K.qg={None:"Rectangle",Rectangle:function(a,b,c){a=new $c;a.type=md;a.ua=0;a.va=0;a.F=b;a.G=c;return a},Square:function(a,b,c){a=new $c;a.Bd=sh;a.type=md;a.ua=0;a.va=0;a.F=Math.min(b,c);a.G=Math.min(b,c);return a},Ellipse:function(a,b,c){a=new $c;a.type=nd;a.ua=0;a.va=0;a.F=b;a.G=c;a.A=K.sA;a.B=K.tA;return a},Circle:function(a,b,c){a=new $c;a.Bd=sh;a.type=nd;a.ua=0;a.va=0;a.F=Math.min(b,c);a.G=Math.min(b,c);a.A=K.sA;a.B=K.tA;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new $c;var d=
new bd,e=new Jd;e.F=b;e.G=.5*c;d.Fa.add(e);b=new Jd;b.F=0;b.G=c;d.Fa.add(b.close());a.ub.add(d);a.A=new L(0,.25);a.B=new L(.5,.75);return a},TriangleDown:function(a,b,c){a=new $c;var d=new bd,e=new Jd;e.F=b;e.G=0;d.Fa.add(e);e=new Jd;e.F=.5*b;e.G=c;d.Fa.add(e.close());a.ub.add(d);a.A=new L(.25,0);a.B=new L(.75,.5);return a},TriangleLeft:function(a,b,c){a=new $c;var d=new bd;d.ua=b;d.va=c;var e=new Jd;e.F=0;e.G=.5*c;d.Fa.add(e);c=new Jd;c.F=b;c.G=0;d.Fa.add(c.close());a.ub.add(d);a.A=new L(.5,.25);
a.B=new L(1,.75);return a},TriangleUp:function(a,b,c){a=new $c;var d=new bd;d.ua=b;d.va=c;var e=new Jd;e.F=0;e.G=c;d.Fa.add(e);c=new Jd;c.F=.5*b;c.G=0;d.Fa.add(c.close());a.ub.add(d);a.A=new L(.25,.5);a.B=new L(.75,1);return a},Line1:function(a,b,c){a=new $c;a.type=dd;a.ua=0;a.va=0;a.F=b;a.G=c;return a},Line2:function(a,b,c){a=new $c;a.type=dd;a.ua=b;a.va=0;a.F=0;a.G=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new $c;a.type=dd;a.ua=0;a.va=c/2;a.F=b;a.G=c/2;return a},LineV:function(a,b,c){a=
new $c;a.type=dd;a.ua=b/2;a.va=0;a.F=b/2;a.G=c;return a},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(a,b,c){var d=K.sa;a=u.p();M(a,0,0,!1);O(a,d*b,0,1*b,(1-d)*c,b,c);b=a.o;u.q(a);return b},Curve2:function(a,b,c){var d=K.sa;a=u.p();M(a,0,0,!1);O(a,0,d*c,(1-d)*b,c,b,c);b=a.o;u.q(a);return b},Curve3:function(a,b,c){var d=K.sa;a=u.p();M(a,1*b,0,!1);O(a,1*b,d*c,d*b,1*c,0,1*c);b=a.o;u.q(a);return b},Curve4:function(a,b,c){var d=K.sa;a=u.p();M(a,1*b,0,!1);O(a,(1-d)*b,0,0,(1-d)*c,0,1*c);b=a.o;u.q(a);
return b},Alternative:"Triangle",Merge:"Triangle",Triangle:function(a,b,c){a=u.p();M(a,.5*b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,1);u.q(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=u.p();M(a,.5*b,0,!0);a.lineTo(0,.5*c);a.lineTo(.5*b,1*c);a.lineTo(1*b,.5*c,!0);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);u.q(a);return b},Pentagon:function(a,b,c){var d=K.Qk(5);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;5>e;e++)a.lineTo(d[e].x*b,d[e].y*c);
u.ra(d);P(a);b=a.o;b.A=new L(.2,.22);b.B=new L(.8,.9);u.q(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=K.Qk(6);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.07,.25);b.B=new L(.93,.75);u.q(a);return b},Heptagon:function(a,b,c){var d=K.Qk(7);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.2,.15);b.B=new L(.8,.85);u.q(a);return b},Octagon:function(a,
b,c){var d=K.Qk(8);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.85);u.q(a);return b},Nonagon:function(a,b,c){var d=K.Qk(9);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.17,.13);b.B=new L(.82,.82);u.q(a);return b},Decagon:function(a,b,c){var d=K.Qk(10);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);
b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);u.q(a);return b},Dodecagon:function(a,b,c){var d=K.Qk(12);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);u.q(a);return b},FivePointedStar:function(a,b,c){var d=K.wm(5);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);u.q(a);return b},SixPointedStar:function(a,b,c){var d=
K.wm(6);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);u.q(a);return b},SevenPointedStar:function(a,b,c){var d=K.wm(7);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);u.q(a);return b},EightPointedStar:function(a,b,c){var d=K.wm(8);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*
c);u.ra(d);P(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);u.q(a);return b},NinePointedStar:function(a,b,c){var d=K.wm(9);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);u.q(a);return b},TenPointedStar:function(a,b,c){var d=K.wm(10);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);u.q(a);return b},FivePointedBurst:function(a,
b,c){var d=K.uo(5);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)O(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);u.q(a);return b},SixPointedBurst:function(a,b,c){var d=K.uo(6);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)O(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);u.q(a);return b},SevenPointedBurst:function(a,
b,c){var d=K.uo(7);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)O(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);u.q(a);return b},EightPointedBurst:function(a,b,c){var d=K.uo(8);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)O(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);u.q(a);return b},NinePointedBurst:function(a,
b,c){var d=K.uo(9);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)O(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);u.q(a);return b},TenPointedBurst:function(a,b,c){var d=K.uo(10);a=u.p();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)O(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);u.ra(d);P(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);u.q(a);return b},Cloud:function(a,b,c){a=
u.p();M(a,.08034461*b,.1944299*c,!0);O(a,-.09239631*b,.07836421*c,.1406031*b,-.0542823*c,.2008615*b,.05349299*c);O(a,.2450511*b,-.00697547*c,.3776197*b,-.01112067*c,.4338609*b,.074219*c);O(a,.4539471*b,0,.6066018*b,-.02526587*c,.6558228*b,.07004196*c);O(a,.6914277*b,-.01904177*c,.8921095*b,-.01220843*c,.8921095*b,.08370865*c);O(a,1.036446*b,.04105738*c,1.020377*b,.3022052*c,.9147671*b,.3194596*c);O(a,1.04448*b,.360238*c,.992256*b,.5219009*c,.9082935*b,.562044*c);O(a,1.032337*b,.5771781*c,1.018411*
b,.8120651*c,.9212406*b,.8217117*c);O(a,1.028411*b,.9571472*c,.8556702*b,1.052487*c,.7592566*b,.9156953*c);O(a,.7431877*b,1.009325*c,.5624123*b,1.021761*c,.5101666*b,.9310455*c);O(a,.4820677*b,1.031761*c,.3030112*b,1.002796*c,.2609328*b,.9344623*c);O(a,.2329994*b,1.01518*c,.03213784*b,1.01518*c,.08034461*b,.870098*c);O(a,-.02812061*b,.9032597*c,-.01205169*b,.6835638*c,.06829292*b,.6545475*c);O(a,-.01812061*b,.6089503*c,-.00606892*b,.4555777*c,.06427569*b,.4265613*c);O(a,-.01606892*b,.3892545*c,-.01205169*
b,.1944299*c,.08034461*b,.1944299*c);P(a);b=a.o;b.A=new L(.1,.1);b.B=new L(.9,.9);u.q(a);return b},Gate:"Crescent",Crescent:function(a,b,c){a=u.p();M(a,0,0,!0);O(a,1*b,0,1*b,1*c,0,1*c);O(a,.5*b,.75*c,.5*b,.25*c,0,0);P(a);b=a.o;b.A=new L(.511,.19);b.B=new L(.776,.76);u.q(a);return b},FramedRectangle:function(a,b,c){var d=u.p(),e=a?a.xc:NaN;a=a?a.et:NaN;isNaN(e)&&(e=.1);isNaN(a)&&(a=.1);M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,!0);M(d,e*b,a*c,!1,!0);d.lineTo(e*b,(1-a)*c);d.lineTo((1-
e)*b,(1-a)*c);d.lineTo((1-e)*b,a*c,!0);b=d.o;b.A=new L(e,a);b.B=new L(1-e,1-a);u.q(d);return b},Delay:"HalfEllipse",HalfEllipse:function(a,b,c){var d=K.sa;a=u.p();M(a,0,0,!0);O(a,d*b,0,1*b,(.5-d/2)*c,1*b,.5*c);O(a,1*b,(.5+d/2)*c,d*b,1*c,0,1*c);P(a);b=a.o;b.A=new L(0,.2);b.B=new L(.75,.8);u.q(a);return b},Heart:function(a,b,c){a=u.p();M(a,.5*b,1*c,!0);O(a,.1*b,.8*c,0,.5*c,0*b,.3*c);O(a,0*b,0,.45*b,0,.5*b,.3*c);O(a,.55*b,0,1*b,0,1*b,.3*c);O(a,b,.5*c,.9*b,.8*c,.5*b,1*c);P(a);b=a.o;b.A=new L(.15,.29);
b.B=new L(.86,.68);u.q(a);return b},Spade:function(a,b,c){a=u.p();M(a,.5*b,0,!0);a.lineTo(.51*b,.01*c);O(a,.6*b,.2*c,b,.25*c,b,.5*c);O(a,b,.8*c,.6*b,.8*c,.55*b,.7*c);O(a,.5*b,.75*c,.55*b,.95*c,.75*b,c);a.lineTo(.25*b,c);O(a,.45*b,.95*c,.5*b,.75*c,.45*b,.7*c);O(a,.4*b,.8*c,0,.8*c,0,.5*c);O(a,0,.25*c,.4*b,.2*c,.49*b,.01*c);P(a);b=a.o;b.A=new L(.19,.26);b.B=new L(.8,.68);u.q(a);return b},Club:function(a,b,c){a=u.p();M(a,.4*b,.6*c,!0);O(a,.5*b,.75*c,.45*b,.95*c,.15*b,1*c);a.lineTo(.85*b,c);O(a,.55*b,
.95*c,.5*b,.75*c,.6*b,.6*c);var d=.2,e=.3,f=0,h=4*(Math.SQRT2-1)/3*d;O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);O(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e+.05)*b,(.5-h+f-.02)*c,.65*b,.36771243*c);d=.2;e=0;f=-.3;h=4*(Math.SQRT2-1)/3*d;O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);O(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+
f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,.35*b,.36771243*c);d=.2;e=-.3;f=0;h=4*(Math.SQRT2-1)/3*d;O(a,(.5+d+e-.05)*b,(.5-h+f-.02)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,.4*b,.6*c);P(a);b=a.o;b.A=new L(.06,.39);
b.B=new L(.93,.58);u.q(a);return b},Ring:function(a,b,c){a=u.p();var d=4*(Math.SQRT2-1)/3*.5;M(a,b,.5*c,!0);O(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);O(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);O(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);O(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;M(a,.5*b,.1*c,!0,!0);O(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);O(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);O(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);O(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);b=a.o;b.A=new L(.146,.146);b.B=new L(.853,
.853);b.Bd=sh;u.q(a);return b},YinYang:function(a,b,c){var d=.5;a=u.p();d=.5;M(a,.5*b,0,!0);a.arcTo(270,180,.5*b,.5*b,.5*b);O(a,1*b,d*c,0,d*c,d*b,0,!0);var d=.1,e=.25;M(a,(.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,.5*b,c*e,d*b);P(a);M(a,.5*b,0,!1);a.arcTo(270,-180,.5*b,.5*b,.5*b);a.$a(!1);e=.75;M(a,(.5+d)*b,e*c,!0);a.arcTo(0,360,.5*b,c*e,d*b);P(a);b=a.o;b.Bd=sh;u.q(a);return b},Peace:function(a,b,c){a=u.p();var d=4*(Math.SQRT2-1)/3*.5;M(a,b,.5*c,!0);O(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);O(a,(.5-d)*b,0,0,(.5-
d)*c,0,.5*c);O(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);O(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;M(a,.5*b,.1*c,!0,!0);O(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);O(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);O(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);O(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);var d=.07,e=0,f=-.707*.11,h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0);O(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*
b,(.5+f)*c);O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);d=.07;e=-.707*.11;f=.707*.11;h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0);O(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*
c);d=.07;e=.707*.11;f=.707*.11;h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0);O(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);b=a.o;b.A=new L(.146,.146);b.B=new L(.853,.853);b.Bd=sh;u.q(a);return b},NotAllowed:function(a,b,c){var d=K.sa,e=.5*d,f=.5;a=u.p();M(a,.5*b,(.5-
f)*c,!0);O(a,(.5-e)*b,(.5-f)*c,(.5-f)*b,(.5-e)*c,(.5-f)*b,.5*c);O(a,(.5-f)*b,(.5+e)*c,(.5-e)*b,(.5+f)*c,.5*b,(.5+f)*c);O(a,(.5+e)*b,(.5+f)*c,(.5+f)*b,(.5+e)*c,(.5+f)*b,.5*c);O(a,(.5+f)*b,(.5-e)*c,(.5+e)*b,(.5-f)*c,.5*b,(.5-f)*c);var f=.4,e=.4*d,d=u.K(),h=u.K(),k=u.K(),l=u.K();K.Ai(.5,.5-f,.5+e,.5-f,.5+f,.5-e,.5+f,.5,.42,d,h,k,l,l);var m=u.K(),n=u.K(),p=u.K();K.Ai(.5,.5-f,.5+e,.5-f,.5+f,.5-e,.5+f,.5,.58,l,l,p,m,n);var q=u.K(),r=u.K(),s=u.K();K.Ai(.5,.5+f,.5-e,.5+f,.5-f,.5+e,.5-f,.5,.42,q,r,s,l,l);
var t=u.K(),v=u.K(),x=u.K();K.Ai(.5,.5+f,.5-e,.5+f,.5-f,.5+e,.5-f,.5,.58,l,l,x,t,v);M(a,x.x*b,x.y*c,!0,!0);O(a,t.x*b,t.y*c,v.x*b,v.y*c,(.5-f)*b,.5*c);O(a,(.5-f)*b,(.5-e)*c,(.5-e)*b,(.5-f)*c,.5*b,(.5-f)*c);O(a,d.x*b,d.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(x.x*b,x.y*c);P(a);M(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);O(a,m.x*b,m.y*c,n.x*b,n.y*c,(.5+f)*b,.5*c);O(a,(.5+f)*b,(.5+e)*c,(.5+e)*b,(.5+f)*c,.5*b,(.5+f)*c);O(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);P(a);u.v(d);u.v(h);u.v(k);u.v(l);u.v(m);u.v(n);
u.v(p);u.v(q);u.v(r);u.v(s);u.v(t);u.v(v);u.v(x);b=a.o;u.q(a);b.Bd=sh;return b},Fragile:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(.25*b,0);a.lineTo(.2*b,.15*c);a.lineTo(.3*b,.25*c);a.lineTo(.29*b,.33*c);a.lineTo(.35*b,.25*c);a.lineTo(.3*b,.15*c);a.lineTo(.4*b,0);a.lineTo(1*b,0);O(a,1*b,.25*c,.75*b,.5*c,.55*b,.5*c);a.lineTo(.55*b,.9*c);a.lineTo(.7*b,.9*c);a.lineTo(.7*b,1*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.9*c);a.lineTo(.45*b,.9*c);a.lineTo(.45*b,.5*c);O(a,.25*b,.5*c,0,.25*c,0,0);P(a);b=a.o;b.A=
new L(.25,0);b.B=new L(.75,.4);u.q(a);return b},HourGlass:function(a,b,c){a=u.p();M(a,.65*b,.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(.35*b,.5*c);a.lineTo(0,0);a.lineTo(1*b,0);P(a);b=a.o;u.q(a);return b},Lightning:function(a,b,c){a=u.p();M(a,0*b,.55*c,!0);a.lineTo(.75*b,0);a.lineTo(.25*b,.45*c);a.lineTo(.9*b,.48*c);a.lineTo(.4*b,1*c);a.lineTo(.65*b,.55*c);P(a);b=a.o;u.q(a);return b},Parallelogram1:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.1);var d=u.p();M(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-
a)*b,1*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);u.q(d);return b},Input:"Output",Output:function(a,b,c){a=u.p();M(a,0,1*c,!0);a.lineTo(.1*b,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);P(a);b=a.o;b.A=new L(.1,0);b.B=new L(.9,1);u.q(a);return b},Parallelogram2:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.25);var d=u.p();M(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);u.q(d);return b},ThickCross:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&
(a=.25);var d=u.p();M(d,(.5-a/2)*b,0,!0);d.lineTo((.5+a/2)*b,0);d.lineTo((.5+a/2)*b,(.5-a/2)*c);d.lineTo(1*b,(.5-a/2)*c);d.lineTo(1*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,1*c);d.lineTo((.5-a/2)*b,1*c);d.lineTo((.5-a/2)*b,(.5+a/2)*c);d.lineTo(0,(.5+a/2)*c);d.lineTo(0,(.5-a/2)*c);d.lineTo((.5-a/2)*b,(.5-a/2)*c);P(d);b=d.o;b.A=new L(.5-a/2,.5-a/2);b.B=new L(.5+a/2,.5+a/2);u.q(d);return b},ThickX:function(a,b,c){a=.25/Math.SQRT2;var d=u.p();M(d,.3*b,0,!0);d.lineTo(.5*b,.2*c);
d.lineTo(.7*b,0);d.lineTo(1*b,.3*c);d.lineTo(.8*b,.5*c);d.lineTo(1*b,.7*c);d.lineTo(.7*b,1*c);d.lineTo(.5*b,.8*c);d.lineTo(.3*b,1*c);d.lineTo(0,.7*c);d.lineTo(.2*b,.5*c);d.lineTo(0,.3*c);P(d);b=d.o;b.A=new L(.5-a,.5-a);b.B=new L(.5+a,.5+a);u.q(d);return b},ThinCross:function(a,b,c){var d=a?a.xc:NaN;isNaN(d)&&(d=.1);a=u.p();M(a,(.5-d/2)*b,0,!0);a.lineTo((.5+d/2)*b,0);a.lineTo((.5+d/2)*b,(.5-d/2)*c);a.lineTo(1*b,(.5-d/2)*c);a.lineTo(1*b,(.5+d/2)*c);a.lineTo((.5+d/2)*b,(.5+d/2)*c);a.lineTo((.5+d/2)*
b,1*c);a.lineTo((.5-d/2)*b,1*c);a.lineTo((.5-d/2)*b,(.5+d/2)*c);a.lineTo(0,(.5+d/2)*c);a.lineTo(0,(.5-d/2)*c);a.lineTo((.5-d/2)*b,(.5-d/2)*c);P(a);b=a.o;u.q(a);return b},ThinX:function(a,b,c){a=u.p();M(a,.1*b,0,!0);a.lineTo(.5*b,.4*c);a.lineTo(.9*b,0);a.lineTo(1*b,.1*c);a.lineTo(.6*b,.5*c);a.lineTo(1*b,.9*c);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.6*c);a.lineTo(.1*b,1*c);a.lineTo(0,.9*c);a.lineTo(.4*b,.5*c);a.lineTo(0,.1*c);P(a);return a.o},RightTriangle:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(1*b,
1*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=new L(0,.5);b.B=new L(.5,1);u.q(a);return b},RoundedIBeam:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(1*b,0);O(a,.5*b,.25*c,.5*b,.75*c,1*b,1*c);a.lineTo(0,1*c);O(a,.5*b,.75*c,.5*b,.25*c,0,0);P(a);b=a.o;u.q(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.xc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*K.sa;var e=u.p();M(e,d,0,!0);e.lineTo(b-d,0);O(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);O(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,c);O(e,a,c,0,c-a,0,c-d);e.lineTo(0,
d);O(e,0,a,a,0,d,0);P(e);b=e.o;1<a?(b.A=new L(0,0,a,a),b.B=new L(1,1,-a,-a)):(b.A=xb,b.B=Vb);u.q(e);return b},Border:function(a,b,c){var d=a?a.xc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=u.p();M(a,d,0,!0);a.lineTo(b-d,0);O(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);O(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);O(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);O(a,0,0,0,0,d,0);P(a);b=a.o;b.A=xb;b.B=Vb;u.q(a);return b},SquareIBeam:function(a,b,c){var d=a?a.xc:NaN;isNaN(d)&&(d=.2);a=u.p();M(a,0,0,!0);a.lineTo(1*b,0);
a.lineTo(1*b,d*c);a.lineTo((.5+d/2)*b,d*c);a.lineTo((.5+d/2)*b,(1-d)*c);a.lineTo(1*b,(1-d)*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,(1-d)*c);a.lineTo((.5-d/2)*b,(1-d)*c);a.lineTo((.5-d/2)*b,d*c);a.lineTo(0,d*c);P(a);b=a.o;u.q(a);return b},Trapezoid:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.2);var d=u.p();M(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);u.q(d);return b},ManualLoop:"ManualOperation",ManualOperation:function(a,b,c){var d=
a?a.xc:NaN;isNaN(d)&&(d=0);a=u.p();M(a,d,0,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);P(a);b=a.o;b.A=new L(.1,0);b.B=new L(.9,1);u.q(a);return b},GenderMale:function(a,b,c){a=u.p();var d=K.sa,e=.4*d,f=.4,h=u.K(),k=u.K(),l=u.K(),m=u.K();M(a,(.5-f)*b,.5*c,!0);O(a,(.5-f)*b,(.5-e)*c,(.5-e)*b,(.5-f)*c,.5*b,(.5-f)*c);K.Ai(.5,.5-f,.5+e,.5-f,.5+f,.5-e,.5+f,.5,.44,l,m,k,h,h);O(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);var n=u.fc(k.x,k.y);K.Ai(.5,.5-f,.5+e,.5-f,.5+f,.5-e,.5+f,.5,.56,
h,h,k,l,m);var p=u.fc(k.x,k.y);a.lineTo((.1*n.x+.855)*b,.1*n.y*c);a.lineTo(.85*b,.1*n.y*c);a.lineTo(.85*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.15*c);a.lineTo((.1*p.x+.9)*b,.15*c);a.lineTo((.1*p.x+.9)*b,(.1*p.y+.05*.9)*c);a.lineTo(p.x*b,p.y*c);O(a,l.x*b,l.y*c,m.x*b,m.y*c,(.5+f)*b,.5*c);O(a,(.5+f)*b,(.5+e)*c,(.5+e)*b,(.5+f)*c,.5*b,(.5+f)*c);O(a,(.5-e)*b,(.5+f)*c,(.5-f)*b,(.5+e)*c,(.5-f)*b,.5*c);f=.35;e=.35*d;M(a,.5*b,(.5-f)*c,!0,!0);O(a,(.5-e)*b,(.5-f)*c,(.5-f)*b,(.5-e)*c,(.5-f)*b,.5*c);O(a,(.5-f)*b,(.5+
e)*c,(.5-e)*b,(.5+f)*c,.5*b,(.5+f)*c);O(a,(.5+e)*b,(.5+f)*c,(.5+f)*b,(.5+e)*c,(.5+f)*b,.5*c);O(a,(.5+f)*b,(.5-e)*c,(.5+e)*b,(.5-f)*c,.5*b,(.5-f)*c);M(a,(.5-f)*b,.5*c,!0);u.v(h);u.v(k);u.v(l);u.v(m);u.v(n);u.v(p);b=a.o;b.A=new L(.202,.257);b.B=new L(.692,.839);b.Bd=sh;u.q(a);return b},GenderFemale:function(a,b,c){a=u.p();var d=.375,e=0,f=-.125,h=4*(Math.SQRT2-1)/3*d;M(a,(.525+e)*b,(.5+d+f)*c,!0);O(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);O(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*
b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);O(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.475+e)*b,(.5+d+f)*c);a.lineTo(.475*b,.85*c);a.lineTo(.425*b,.85*c);a.lineTo(.425*b,.9*c);a.lineTo(.475*b,.9*c);a.lineTo(.475*b,1*c);a.lineTo(.525*b,1*c);a.lineTo(.525*b,.9*c);a.lineTo(.575*b,.9*c);a.lineTo(.575*b,.85*c);a.lineTo(.525*b,.85*c);P(a);d=.325;e=0;f=-.125;h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0,!0);O(a,(.5+d+e)*b,(.5+h+f)*c,(.5+
h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);O(a,(.5-h+e)*b,(.5+d+f)*c,(.5-d+e)*b,(.5+h+f)*c,(.5-d+e)*b,(.5+f)*c);O(a,(.5-d+e)*b,(.5-h+f)*c,(.5-h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);O(a,(.5+h+e)*b,(.5-d+f)*c,(.5+d+e)*b,(.5-h+f)*c,(.5+d+e)*b,(.5+f)*c);M(a,(.525+e)*b,(.5+d+f)*c,!0);b=a.o;b.A=new L(.232,.136);b.B=new L(.782,.611);b.Bd=sh;u.q(a);return b},PlusLine:function(a,b,c){a=u.p();M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.o;u.q(a);return b},XLine:function(a,b,c){a=u.p();
M(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.o;u.q(a);return b},AsteriskLine:function(a,b,c){a=u.p();var d=.2/Math.SQRT2;M(a,d*b,(1-d)*c,!1);a.lineTo((1-d)*b,d*c);a.moveTo(d*b,d*c);a.lineTo((1-d)*b,(1-d)*c);a.moveTo(0*b,.5*c);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0*c);a.lineTo(.5*b,1*c);b=a.o;u.q(a);return b},CircleLine:function(a,b,c){var d=.5*K.sa;a=u.p();M(a,1*b,.5*c,!1);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);
O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(.146,.146);b.B=new L(.853,.853);b.Bd=sh;u.q(a);return b},Pie:function(a,b,c){a=u.p();var d=4*(Math.SQRT2-1)/3*.5;M(a,(.5*Math.SQRT2/2+.5)*b,(.5-.5*Math.SQRT2/2)*c,!0);O(a,.7*b,0*c,.5*b,0*c,.5*b,0*c);O(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);O(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.5*b,1*c);O(a,(.5+d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);a.lineTo(.5*b,.5*c);P(a);b=a.o;u.q(a);return b},PiePiece:function(a,b,c){var d=K.sa/Math.SQRT2*.5,e=Math.SQRT2/2,f=1-
Math.SQRT2/2;a=u.p();M(a,b,c,!0);O(a,b,(1-d)*c,(e+d)*b,(f+d)*c,e*b,f*c);a.lineTo(0,c);P(a);b=a.o;u.q(a);return b},StopSign:function(a,b,c){a=1/(Math.SQRT2+2);var d=u.p();M(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,a*c);d.lineTo(1*b,(1-a)*c);d.lineTo((1-a)*b,1*c);d.lineTo(a*b,1*c);d.lineTo(0,(1-a)*c);d.lineTo(0,a*c);P(d);b=d.o;b.A=new L(a/2,a/2);b.B=new L(1-a/2,1-a/2);u.q(d);return b},LogicImplies:function(a,b,c){var d=a?a.xc:NaN;isNaN(d)&&(d=.2);a=u.p();M(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-
d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);b=a.o;b.A=xb;b.B=new L(.8,.5);u.q(a);return b},LogicIff:function(a,b,c){var d=a?a.xc:NaN;isNaN(d)&&(d=.2);a=u.p();M(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(d*b,0);a.lineTo(0,.5*c);a.lineTo(d*b,c);b=a.o;b.A=new L(.2,0);b.B=new L(.8,.5);u.q(a);return b},LogicNot:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;u.q(a);return b},LogicAnd:function(a,b,c){a=u.p();M(a,0,1*c,!1);
a.lineTo(.5*b,0);a.lineTo(1*b,1*c);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,1);u.q(a);return b},LogicOr:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);b=a.o;b.A=new L(.219,0);b.B=new L(.78,.409);u.q(a);return b},LogicXor:function(a,b,c){a=u.p();M(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);var d=.5*K.sa;O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.o;
b.Bd=sh;u.q(a);return b},LogicTruth:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.o;u.q(a);return b},LogicFalsity:function(a,b,c){a=u.p();M(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);b=a.o;u.q(a);return b},LogicThereExists:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,.5*c);a.lineTo(0,.5*c);a.moveTo(1*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);b=a.o;u.q(a);return b},LogicForAll:function(a,b,c){a=u.p();M(a,0,0,!1);
a.lineTo(.5*b,1*c);a.lineTo(1*b,0);a.moveTo(.25*b,.5*c);a.lineTo(.75*b,.5*c);b=a.o;b.A=new L(.25,0);b.B=new L(.75,.5);u.q(a);return b},LogicIsDefinedAs:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(b,0);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(0,c);a.lineTo(b,c);b=a.o;b.A=new L(.01,.01);b.B=new L(.99,.49);u.q(a);return b},LogicIntersect:function(a,b,c){var d=.5*K.sa;a=u.p();M(a,0,1*c,!1);a.lineTo(0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);a.lineTo(1*b,1*c);b=
a.o;b.A=new L(0,.5);b.B=Vb;u.q(a);return b},LogicUnion:function(a,b,c){var d=.5*K.sa;a=u.p();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);a.lineTo(0,0);b=a.o;b.A=xb;b.B=new L(1,.5);u.q(a);return b},Arrow:function(a,b,c){var d=a?a.xc:NaN,e=a?a.et:NaN;isNaN(d)&&(d=.3);isNaN(e)&&(e=.3);a=u.p();M(a,0,(.5-e/2)*c,!0);a.lineTo((1-d)*b,(.5-e/2)*c);a.lineTo((1-d)*b,0);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,1*c);a.lineTo((1-d)*b,(.5+e/2)*c);a.lineTo(0,
(.5+e/2)*c);P(a);b=a.o;b.A=new L(0,.5-e/2);d=K.al(0,.5+e/2,1,.5+e/2,1-d,1,1,.5,u.K());b.B=new L(d.x,d.y);u.v(d);u.q(a);return b},ISOProcess:"Chevron",Chevron:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);P(a);b=a.o;u.q(a);return b},DoubleArrow:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(.3*b,.214*c);a.lineTo(.3*b,0);a.lineTo(1*b,.5*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.786*c);a.lineTo(0,1*c);P(a);M(a,.3*b,.214*c,!1);
a.lineTo(.3*b,.786*c);a.$a(!1);b=a.o;u.q(a);return b},DoubleEndArrow:function(a,b,c){a=u.p();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(.3*b,.7*c);a.lineTo(.3*b,1*c);a.lineTo(0,.5*c);a.lineTo(.3*b,0);a.lineTo(.3*b,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);P(a);b=a.o;c=K.al(0,.5,.3,0,0,.3,.3,.3,u.K());b.A=new L(c.x,c.y);c=K.al(.7,1,1,.5,.7,.7,1,.7,c);b.B=new L(c.x,c.y);u.v(c);u.q(a);return b},IBeamArrow:function(a,b,c){a=u.p();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*
b,.7*c);a.lineTo(.2*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.2*b,0);a.lineTo(.2*b,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);P(a);b=a.o;b.A=new L(0,.3);c=K.al(.7,1,1,.5,.7,.7,1,.7,u.K());b.B=new L(c.x,c.y);u.v(c);u.q(a);return b},Pointer:function(a,b,c){a=u.p();M(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(.2*b,.5*c);a.lineTo(0,0);P(a);b=a.o;b.A=new L(.2,.35);c=K.al(.2,.65,1,.65,0,1,1,.5,u.K());b.B=new L(c.x,c.y);u.v(c);u.q(a);return b},RoundedPointer:function(a,b,c){a=u.p();
M(a,1*b,.5*c,!0);a.lineTo(0,1*c);O(a,.5*b,.75*c,.5*b,.25*c,0,0);P(a);b=a.o;b.A=new L(.4,.35);c=K.al(.2,.65,1,.65,0,1,1,.5,u.K());b.B=new L(c.x,c.y);u.v(c);u.q(a);return b},SplitEndArrow:function(a,b,c){a=u.p();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(0,.7*c);a.lineTo(.2*b,.5*c);a.lineTo(0,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);P(a);b=a.o;b.A=new L(.2,.3);c=K.al(.7,1,1,.5,.7,.7,1,.7,u.K());b.B=new L(c.x,c.y);u.v(c);u.q(a);return b},MessageToUser:"SquareArrow",SquareArrow:function(a,
b,c){a=u.p();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.7*b,0);P(a);b=a.o;b.A=xb;b.B=new L(.7,1);u.q(a);return b},Cone1:function(a,b,c){var d=K.sa;a=.5*d;var e=.1*d,d=u.p();M(d,0,.9*c,!0);d.lineTo(.5*b,0);d.lineTo(1*b,.9*c);O(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);O(d,(.5-a)*b,1*c,0,(.9+e)*c,0,.9*c);P(d);b=d.o;b.A=new L(.25,.5);b.B=new L(.75,.97);u.q(d);return b},Cone2:function(a,b,c){a=u.p();M(a,0,.9*c,!0);O(a,(1-.85/.9)*b,1*c,.85/.9*b,1*c,1*b,.9*c);a.lineTo(.5*b,
0);a.lineTo(0,.9*c);P(a);M(a,0,.9*c,!1);O(a,(1-.85/.9)*b,.8*c,.85/.9*b,.8*c,1*b,.9*c);a.$a(!1);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,.82);u.q(a);return b},Cube1:function(a,b,c){a=u.p();M(a,.5*b,1*c,!0);a.lineTo(1*b,.85*c);a.lineTo(1*b,.15*c);a.lineTo(.5*b,0*c);a.lineTo(0*b,.15*c);a.lineTo(0*b,.85*c);P(a);M(a,.5*b,1*c,!1);a.lineTo(.5*b,.3*c);a.lineTo(0,.15*c);a.moveTo(.5*b,.3*c);a.lineTo(1*b,.15*c);a.$a(!1);b=a.o;b.A=new L(0,.3);b.B=new L(.5,.85);u.q(a);return b},Cube2:function(a,b,c){a=u.p();M(a,
0,.3*c,!0);a.lineTo(0*b,1*c);a.lineTo(.7*b,c);a.lineTo(1*b,.7*c);a.lineTo(1*b,0*c);a.lineTo(.3*b,0*c);P(a);M(a,0,.3*c,!1);a.lineTo(.7*b,.3*c);a.lineTo(1*b,0*c);a.moveTo(.7*b,.3*c);a.lineTo(.7*b,1*c);a.$a(!1);b=a.o;b.A=new L(0,.3);b.B=new L(.7,1);u.q(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=K.sa;a=.5*d;var e=.1*d,d=u.p();M(d,0,.1*c,!0);O(d,0,(.1-e)*c,(.5-a)*b,0,.5*b,0);O(d,(.5+a)*b,0,1*b,(.1-e)*c,1*b,.1*c);d.lineTo(b,.9*c);O(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);O(d,(.5-
a)*b,1*c,0,(.9+e)*c,0,.9*c);d.lineTo(0,.1*c);M(d,0,.1*c,!1);O(d,0,(.1+e)*c,(.5-a)*b,.2*c,.5*b,.2*c);O(d,(.5+a)*b,.2*c,1*b,(.1+e)*c,1*b,.1*c);d.$a(!1);b=d.o;b.A=new L(0,.2);b.B=new L(1,.9);u.q(d);return b},Cylinder2:function(a,b,c){var d=K.sa;a=.5*d;var e=.1*d,d=u.p();M(d,0,.9*c,!0);d.lineTo(0,.1*c);O(d,0,(.1-e)*c,(.5-a)*b,0,.5*b,0);O(d,(.5+a)*b,0,1*b,(.1-e)*c,1*b,.1*c);d.lineTo(1*b,.9*c);O(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);O(d,(.5-a)*b,1*c,0,(.9+e)*c,0,.9*c);M(d,0,.9*c,!1);O(d,0,(.9-e)*c,(.5-
a)*b,.8*c,.5*b,.8*c);O(d,(.5+a)*b,.8*c,1*b,(.9-e)*c,1*b,.9*c);d.$a(!1);b=d.o;b.A=new L(0,.1);b.B=new L(1,.8);u.q(d);return b},Cylinder3:function(a,b,c){var d=K.sa;a=.1*d;var e=.5*d,d=u.p();M(d,.1*b,0,!0);d.lineTo(.9*b,0);O(d,(.9+a)*b,0,1*b,(.5-e)*c,1*b,.5*c);O(d,1*b,(.5+e)*c,(.9+a)*b,1*c,.9*b,1*c);d.lineTo(.1*b,1*c);O(d,(.1-a)*b,1*c,0,(.5+e)*c,0,.5*c);O(d,0,(.5-e)*c,(.1-a)*b,0,.1*b,0);M(d,.1*b,0,!1);O(d,(.1+a)*b,0,.2*b,(.5-e)*c,.2*b,.5*c);O(d,.2*b,(.5+e)*c,(.1+a)*b,1*c,.1*b,1*c);d.$a(!1);b=d.o;b.A=
new L(.2,0);b.B=new L(.9,1);u.q(d);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=K.sa;a=.1*d;var e=.5*d,d=u.p();M(d,.9*b,0,!0);O(d,(.9+a)*b,0,1*b,(.5-e)*c,1*b,.5*c);O(d,1*b,(.5+e)*c,(.9+a)*b,1*c,.9*b,1*c);d.lineTo(.1*b,1*c);O(d,(.1-a)*b,1*c,0,(.5+e)*c,0,.5*c);O(d,0,(.5-e)*c,(.1-a)*b,0,.1*b,0);d.lineTo(.9*b,0);M(d,.9*b,0,!1);O(d,(.9-a)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);O(d,.8*b,(.5+e)*c,(.9-a)*b,1*c,.9*b,1*c);d.$a(!1);b=d.o;b.A=new L(.1,0);b.B=new L(.8,1);u.q(d);return b},Prism1:function(a,
b,c){a=u.p();M(a,.25*b,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(b,.5*c);a.lineTo(.5*b,c);a.lineTo(0,c);P(a);M(a,.25*b,.25*c,!1);a.lineTo(.5*b,c);a.$a(!1);b=a.o;b.A=new L(.408,.172);b.B=new L(.833,.662);u.q(a);return b},Prism2:function(a,b,c){a=u.p();M(a,0,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);P(a);M(a,0,c,!1);a.lineTo(.25*b,.5*c);a.lineTo(b,.25*c);a.moveTo(0,.25*c);a.lineTo(.25*b,.5*c);a.$a(!1);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,.75);u.q(a);return b},
Pyramid1:function(a,b,c){a=u.p();M(a,.5*b,0,!0);a.lineTo(b,.75*c);a.lineTo(.5*b,1*c);a.lineTo(0,.75*c);P(a);M(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.$a(!1);b=a.o;b.A=new L(.25,.367);b.B=new L(.75,.875);u.q(a);return b},Pyramid2:function(a,b,c){a=u.p();M(a,.5*b,0,!0);a.lineTo(b,.85*c);a.lineTo(.5*b,1*c);a.lineTo(0,.85*c);P(a);M(a,.5*b,0,!1);a.lineTo(.5*b,.7*c);a.lineTo(0,.85*c);a.moveTo(.5*b,.7*c);a.lineTo(1*b,.85*c);a.$a(!1);b=a.o;b.A=new L(.25,.367);b.B=new L(.75,.875);u.q(a);return b},Actor:function(a,
b,c){var d=K.sa,e=.2*d,f=.1*d,h=.5,k=.1;a=u.p();M(a,h*b,(k+.1)*c,!0);O(a,(h-e)*b,(k+.1)*c,(h-.2)*b,(k+f)*c,(h-.2)*b,k*c);O(a,(h-.2)*b,(k-f)*c,(h-e)*b,(k-.1)*c,h*b,(k-.1)*c);O(a,(h+e)*b,(k-.1)*c,(h+.2)*b,(k-f)*c,(h+.2)*b,k*c);O(a,(h+.2)*b,(k+f)*c,(h+e)*b,(k+.1)*c,h*b,(k+.1)*c);e=.05;f=d*e;M(a,.5*b,.2*c,!0);a.lineTo(.95*b,.2*c);h=.95;k=.25;O(a,(h+f)*b,(k-e)*c,(h+e)*b,(k-f)*c,(h+e)*b,k*c);a.lineTo(1*b,.6*c);a.lineTo(.85*b,.6*c);a.lineTo(.85*b,.35*c);e=.025;f=d*e;h=.825;k=.35;O(a,(h+e)*b,(k-f)*c,(h+f)*
b,(k-e)*c,h*b,(k-e)*c);O(a,(h-f)*b,(k-e)*c,(h-e)*b,(k-f)*c,(h-e)*b,k*c);a.lineTo(.8*b,1*c);a.lineTo(.55*b,1*c);a.lineTo(.55*b,.7*c);e=.05;f=d*e;h=.5;k=.7;O(a,(h+e)*b,(k-f)*c,(h+f)*b,(k-e)*c,h*b,(k-e)*c);O(a,(h-f)*b,(k-e)*c,(h-e)*b,(k-f)*c,(h-e)*b,k*c);a.lineTo(.45*b,1*c);a.lineTo(.2*b,1*c);a.lineTo(.2*b,.35*c);e=.025;f=d*e;h=.175;k=.35;O(a,(h+e)*b,(k-f)*c,(h+f)*b,(k-e)*c,h*b,(k-e)*c);O(a,(h-f)*b,(k-e)*c,(h-e)*b,(k-f)*c,(h-e)*b,k*c);a.lineTo(.15*b,.6*c);a.lineTo(0*b,.6*c);a.lineTo(0*b,.25*c);e=.05;
f=d*e;h=.05;k=.25;O(a,(h-e)*b,(k-f)*c,(h-f)*b,(k-e)*c,h*b,(k-e)*c);a.lineTo(.5*b,.2*c);b=a.o;b.A=new L(.2,.2);b.B=new L(.8,.65);u.q(a);return b},Card:function(a,b,c){a=u.p();M(a,1*b,0*c,!0);a.lineTo(1*b,1*c);a.lineTo(0*b,1*c);a.lineTo(0*b,.2*c);a.lineTo(.2*b,0*c);P(a);b=a.o;b.A=new L(0,.2);b.B=Vb;u.q(a);return b},Collate:function(a,b,c){a=u.p();M(a,.5*b,.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);M(a,.5*b,.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);b=a.o;b.A=new L(.25,
0);b.B=new L(.75,.25);u.q(a);return b},CreateRequest:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.1);var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.moveTo(0,(1-a)*c);d.lineTo(1*b,(1-a)*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);u.q(d);return b},Database:function(a,b,c){a=u.p();var d=K.sa,e=.5*d,d=.1*d;M(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);O(a,1*b,(.9+d)*c,(.5+e)*b,1*c,.5*b,1*c);O(a,(.5-e)*b,1*c,0,(.9+d)*c,0,.9*c);a.lineTo(0,.1*c);
O(a,0,(.1-d)*c,(.5-e)*b,0,.5*b,0);O(a,(.5+e)*b,0,1*b,(.1-d)*c,1*b,.1*c);M(a,1*b,.1*c,!1);O(a,1*b,(.1+d)*c,(.5+e)*b,.2*c,.5*b,.2*c);O(a,(.5-e)*b,.2*c,0,(.1+d)*c,0,.1*c);a.moveTo(1*b,.2*c);O(a,1*b,(.2+d)*c,(.5+e)*b,.3*c,.5*b,.3*c);O(a,(.5-e)*b,.3*c,0,(.2+d)*c,0,.2*c);a.moveTo(1*b,.3*c);O(a,1*b,(.3+d)*c,(.5+e)*b,.4*c,.5*b,.4*c);O(a,(.5-e)*b,.4*c,0,(.3+d)*c,0,.3*c);a.$a(!1);b=a.o;b.A=new L(0,.4);b.B=new L(1,.9);u.q(a);return b},StoredData:"DataStorage",DataStorage:function(a,b,c){a=u.p();M(a,0,0,!0);
a.lineTo(.75*b,0);O(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(0,1*c);O(a,.25*b,.9*c,.25*b,.1*c,0,0);P(a);b=a.o;b.A=new L(.226,0);b.B=new L(.81,1);u.q(a);return b},DiskStorage:function(a,b,c){a=u.p();var d=K.sa,e=.5*d,d=.1*d;M(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);O(a,1*b,(.9+d)*c,(.5+e)*b,1*c,.5*b,1*c);O(a,(.5-e)*b,1*c,0,(.9+d)*c,0,.9*c);a.lineTo(0,.1*c);O(a,0,(.1-d)*c,(.5-e)*b,0,.5*b,0);O(a,(.5+e)*b,0,1*b,(.1-d)*c,1*b,.1*c);M(a,1*b,.1*c,!1);O(a,1*b,(.1+d)*c,(.5+e)*b,.2*c,.5*b,.2*c);O(a,(.5-e)*b,.2*c,0,(.1+
d)*c,0,.1*c);a.moveTo(1*b,.2*c);O(a,1*b,(.2+d)*c,(.5+e)*b,.3*c,.5*b,.3*c);O(a,(.5-e)*b,.3*c,0,(.2+d)*c,0,.2*c);a.$a(!1);b=a.o;b.A=new L(0,.3);b.B=new L(1,.9);u.q(a);return b},Display:function(a,b,c){a=u.p();M(a,.25*b,0,!0);a.lineTo(.75*b,0);O(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);P(a);b=a.o;b.A=new L(.25,0);b.B=new L(.75,1);u.q(a);return b},DividedEvent:function(a,b,c){a=a?a.xc:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=u.p(),e=.2*K.sa;M(d,0,.2*c,!0);O(d,0,(.2-e)*c,(.2-e)*b,
0,.2*b,0);d.lineTo(.8*b,0);O(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);O(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);O(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);u.q(d);return b},DividedProcess:function(a,b,c){a=a?a.xc:NaN;if(isNaN(a)||.1>a)a=.1;var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.$a(!1);b=d.o;b.A=new L(0,a);b.B=
Vb;u.q(d);return b},Document:function(a,b,c){c/=.8;a=u.p();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);O(a,.5*b,.4*c,.5*b,1*c,0,.7*c);P(a);b=a.o;b.A=xb;b.B=new L(1,.6);u.q(a);return b},ExternalOrganization:function(a,b,c){a=a?a.xc:NaN;if(isNaN(a)||.2>a)a=.2;var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-
a)*c);d.$a(!1);b=d.o;b.A=new L(a/2,a/2);b.B=new L(1-a/2,1-a/2);u.q(d);return b},ExternalProcess:function(a,b,c){a=u.p();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);P(a);M(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.$a(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);u.q(a);return b},File:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);
a.lineTo(1*b,1*c);a.lineTo(0,1*c);P(a);M(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.$a(!1);b=a.o;b.A=new L(0,.25);b.B=Vb;u.q(a);return b},Interrupt:function(a,b,c){a=u.p();M(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);u.q(a);return b},InternalStorage:function(a,b,c){var d=a?a.xc:NaN;a=a?a.et:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=u.p();M(e,0,0,!0);e.lineTo(1*
b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);P(e);M(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.$a(!1);b=e.o;b.A=new L(d,a);b.B=Vb;u.q(e);return b},Junction:function(a,b,c){a=u.p();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,f=.5*K.sa;M(a,1*b,.5*c,!0);O(a,1*b,(.5+f)*c,(.5+f)*b,1*c,.5*b,1*c);O(a,(.5-f)*b,1*c,0,(.5+f)*c,0,.5*c);O(a,0,(.5-f)*c,(.5-f)*b,0,.5*b,0);O(a,(.5+f)*b,0,1*b,(.5-f)*c,1*b,.5*c);M(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.$a(!1);
b=a.o;b.Bd=sh;u.q(a);return b},LinedDocument:function(a,b,c){c/=.8;a=u.p();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);O(a,.5*b,.4*c,.5*b,1*c,0,.7*c);P(a);M(a,.1*b,0,!1);a.lineTo(.1*b,.75*c);a.$a(!1);b=a.o;b.A=new L(.1,0);b.B=new L(1,.6);u.q(a);return b},LoopLimit:function(a,b,c){a=u.p();M(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);P(a);b=a.o;b.A=new L(0,.25);b.B=Vb;u.q(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,
b,c){a=u.p();var d=.5*K.sa;M(a,.5*b,1*c,!0);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);O(a,1*b,(.5+d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.8);u.q(a);return b},ManualInput:function(a,b,c){a=u.p();M(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);P(a);b=a.o;b.A=new L(0,.25);b.B=Vb;u.q(a);return b},MessageFromUser:function(a,b,c){a=a?a.xc:
NaN;isNaN(a)&&(a=.7);var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=xb;b.B=new L(a,1);u.q(d);return b},MicroformProcessing:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.25);var d=u.p();M(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);u.q(d);return b},MicroformRecording:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*
c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=new L(0,.25);b.B=new L(1,.75);u.q(a);return b},MultiDocument:function(a,b,c){c/=.8;a=u.p();M(a,b,0,!0);a.lineTo(b,.5*c);O(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);O(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);O(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);P(a);M(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*
c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.$a(!1);b=a.o;b.A=new L(0,.25);b.B=new L(.8,.77);u.q(a);return b},MultiProcess:function(a,b,c){a=u.p();M(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);P(a);M(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*
b,.9*c);a.$a(!1);b=a.o;b.A=new L(0,.2);b.B=new L(.8,1);u.q(a);return b},OfflineStorage:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=u.p();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(.5*b,1*c);P(e);M(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.$a(!1);b=e.o;b.A=new L(d/4+.5*a,a);b.B=new L(3*d/4+.5*a,a+.5*d);u.q(e);return b},OffPageConnector:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=xb;b.B=new L(.75,1);u.q(a);return b},
Or:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,1*b,.5*c,!0);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.$a(!1);b=a.o;b.Bd=sh;u.q(a);return b},PaperTape:function(a,b,c){c/=.8;a=u.p();M(a,0,.7*c,!0);a.lineTo(0,.3*c);O(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);O(a,.5*b,.4*c,.5*b,1*c,0,.7*c);P(a);b=a.o;b.A=new L(0,.49);b.B=
new L(1,.75);u.q(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.xc:NaN;a=a?a.et:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=u.p();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1-a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);P(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);u.q(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.xc:NaN;a=a?a.et:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=u.p();M(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);P(e);b=e.o;b.A=new L(d,
0);b.B=new L(1-a,1);u.q(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.1);var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.$a(!1);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);u.q(d);return b},Process:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.1);var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,a*b,0,!1);d.lineTo(a*b,1*c);d.$a(!1);
b=d.o;b.A=new L(a,0);b.B=Vb;u.q(d);return b},Sort:function(a,b,c){a=u.p();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);P(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.$a(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.5);u.q(a);return b},Start:function(a,b,c){a=u.p();M(a,.25*b,0,!0);M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);M(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.$a(!1);b=a.o;b.A=new L(.25,0);b.B=
new L(.75,1);u.q(a);return b},Terminator:function(a,b,c){a=u.p();M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.o;b.A=new L(.23,0);b.B=new L(.77,1);u.q(a);return b},TransmittalTape:function(a,b,c){a=a?a.xc:NaN;isNaN(a)&&(a=.1);var d=u.p();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);P(d);b=d.o;b.A=xb;b.B=new L(1,1-a);u.q(d);return b},AndGate:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,0,0,!0);a.lineTo(.5*
b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=xb;b.B=new L(.55,1);u.q(a);return b},Buffer:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);u.q(a);return b},Clock:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,1*b,.5*c,!0);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);
M(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);M(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2*b,.75*c);a.$a(!1);b=a.o;b.Bd=sh;u.q(a);return b},Ground:function(a,b,c){a=u.p();M(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.o;u.q(a);return b},Inverter:function(a,b,c){a=u.p();var d=.1*K.sa;M(a,.8*
b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);M(a,1*b,.5*c,!0);O(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);O(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);O(a,.8*b,(.5-d)*c,(.9-d)*b,.4*c,.9*b,.4*c);O(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(0,.25);b.B=new L(.4,.75);u.q(a);return b},NandGate:function(a,b,c){a=u.p();var d=K.sa,e=.5*d,f=.4*d,d=.1*d;M(a,.8*b,.5*c,!0);O(a,.8*b,(.5+f)*c,(.4+e)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);O(a,(.4+e)*b,0,.8*b,(.5-f)*
c,.8*b,.5*c);M(a,1*b,.5*c,!0);O(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);O(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);O(a,.8*b,(.5-d)*c,(.9-d)*b,.4*c,.9*b,.4*c);O(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(0,.05);b.B=new L(.55,.95);u.q(a);return b},NorGate:function(a,b,c){a=u.p();var d=K.sa,e=.5,f=d*e,h=0,k=.5;M(a,.8*b,.5*c,!0);O(a,.7*b,(k+f)*c,(h+f)*b,(k+e)*c,0,1*c);O(a,.25*b,.75*c,.25*b,.25*c,0,0);O(a,(h+f)*b,(k-e)*c,.7*b,(k-f)*c,.8*b,.5*c);e=.1;f=.1*d;h=.9;k=.5;M(a,(h-e)*b,k*c,!0);O(a,
(h-e)*b,(k-f)*c,(h-f)*b,(k-e)*c,h*b,(k-e)*c);O(a,(h+f)*b,(k-e)*c,(h+e)*b,(k-f)*c,(h+e)*b,k*c);O(a,(h+e)*b,(k+f)*c,(h+f)*b,(k+e)*c,h*b,(k+e)*c);O(a,(h-f)*b,(k+e)*c,(h-e)*b,(k+f)*c,(h-e)*b,k*c);b=a.o;b.A=new L(.2,.25);b.B=new L(.6,.75);u.q(a);return b},OrGate:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,0,0,!0);O(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);O(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);O(a,.25*b,.75*c,.25*b,.25*c,0,0);P(a);b=a.o;b.A=new L(.2,.25);b.B=new L(.75,.75);u.q(a);return b},XnorGate:function(a,
b,c){a=u.p();var d=K.sa,e=.5,f=d*e,h=.2,k=.5;M(a,.1*b,0,!1);O(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.8*b,.5*c,!0);O(a,.7*b,(k+f)*c,(h+f)*b,(k+e)*c,.2*b,1*c);O(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);O(a,(h+f)*b,(k-e)*c,.7*b,(k-f)*c,.8*b,.5*c);e=.1;f=.1*d;h=.9;k=.5;M(a,(h-e)*b,k*c,!0);O(a,(h-e)*b,(k-f)*c,(h-f)*b,(k-e)*c,h*b,(k-e)*c);O(a,(h+f)*b,(k-e)*c,(h+e)*b,(k-f)*c,(h+e)*b,k*c);O(a,(h+e)*b,(k+f)*c,(h+f)*b,(k+e)*c,h*b,(k+e)*c);O(a,(h-f)*b,(k+e)*c,(h-e)*b,(k+f)*c,(h-e)*b,k*c);b=a.o;b.A=new L(.4,.25);
b.B=new L(.65,.75);u.q(a);return b},XorGate:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,.1*b,0,!1);O(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.2*b,0,!0);O(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);O(a,.9*b,(.5+d)*c,(.2+d)*b,1*c,.2*b,1*c);O(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);P(a);b=a.o;b.A=new L(.4,.25);b.B=new L(.8,.75);u.q(a);return b},Capacitor:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;u.q(a);return b},Resistor:function(a,b,c){a=u.p();M(a,0,.5*c,!1);a.lineTo(.1*
b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.o;u.q(a);return b},Inductor:function(a,b,c){a=u.p();var d=.1*K.sa,e=.1;M(a,(e-.5*d)*b,c,!1);O(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;O(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);O(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;O(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);O(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;O(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);O(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;O(a,(e+.1)*b,0,(e+d)*b,c,
(e+.5*d)*b,c);b=a.o;u.q(a);return b},ACvoltageSource:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,0*b,.5*c,!1);O(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);O(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);O(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.o;b.Bd=sh;u.q(a);return b},DCvoltageSource:function(a,b,c){a=u.p();M(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;u.q(a);return b},Diode:function(a,b,
c){a=u.p();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);u.q(a);return b},Wifi:function(a,b,c){var d=b,e=c;b*=.38;c*=.6;a=u.p();var f=K.sa,h=.8*f,k=.8,l=0,m=.5,d=(d-b)/2,e=(e-c)/2;M(a,l*b+d,(m+k)*c+e,!0);O(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);O(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);O(a,l*b+d,(m-k)*c+e,(l-k+.5*h)*b+d,(m-h)*c+e,(l-k+.5*h)*b+d,m*c+e);O(a,(l-k+.5*h)*
b+d,(m+h)*c+e,l*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);P(a);h=.4*f;k=.4;l=.2;m=.5;M(a,l*b+d,(m+k)*c+e,!0);O(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);O(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);O(a,l*b+d,(m-k)*c+e,(l-k+.5*h)*b+d,(m-h)*c+e,(l-k+.5*h)*b+d,m*c+e);O(a,(l-k+.5*h)*b+d,(m+h)*c+e,l*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);P(a);h=.2*f;k=.2;m=l=.5;M(a,(l-k)*b+d,m*c+e,!0);O(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);O(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,
(l+k)*b+d,m*c+e);O(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);O(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);h=.4*f;k=.4;l=.8;m=.5;M(a,l*b+d,(m-k)*c+e,!0);O(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);O(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);O(a,l*b+d,(m+k)*c+e,(l+k-.5*h)*b+d,(m+h)*c+e,(l+k-.5*h)*b+d,m*c+e);O(a,(l+k-.5*h)*b+d,(m-h)*c+e,l*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);P(a);h=.8*f;k=.8;l=1;m=.5;M(a,l*b+d,(m-k)*c+e,!0);O(a,(l+h)*b+d,(m-
k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);O(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);O(a,l*b+d,(m+k)*c+e,(l+k-.5*h)*b+d,(m+h)*c+e,(l+k-.5*h)*b+d,m*c+e);O(a,(l+k-.5*h)*b+d,(m-h)*c+e,l*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);P(a);b=a.o;u.q(a);return b},Email:function(a,b,c){a=u.p();M(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);P(a);M(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.$a(!1);
b=a.o;u.q(a);return b},Ethernet:function(a,b,c){a=u.p();M(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);P(a);M(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c);a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);P(a);M(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);P(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*
b,.6*c);a.$a(!1);b=a.o;u.q(a);return b},Power:function(a,b,c){a=u.p();var d=K.sa,e=.4*d,f=.4,h=u.K(),k=u.K(),l=u.K(),m=u.K();K.Ai(.5,.5-f,.5+e,.5-f,.5+f,.5-e,.5+f,.5,.5,h,h,k,l,m);var n=u.fc(k.x,k.y);M(a,k.x*b,k.y*c,!0);O(a,l.x*b,l.y*c,m.x*b,m.y*c,(.5+f)*b,.5*c);O(a,(.5+f)*b,(.5+e)*c,(.5+e)*b,(.5+f)*c,.5*b,(.5+f)*c);O(a,(.5-e)*b,(.5+f)*c,(.5-f)*b,(.5+e)*c,(.5-f)*b,.5*c);K.Ai(.5-f,.5,.5-f,.5-e,.5-e,.5-f,.5,.5-f,.5,l,m,k,h,h);O(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);e=.3*d;f=.3;K.Ai(.5-f,.5,.5-f,.5-
e,.5-e,.5-f,.5,.5-f,.5,l,m,k,h,h);a.lineTo(k.x*b,k.y*c);O(a,m.x*b,m.y*c,l.x*b,l.y*c,(.5-f)*b,.5*c);O(a,(.5-f)*b,(.5+e)*c,(.5-e)*b,(.5+f)*c,.5*b,(.5+f)*c);O(a,(.5+e)*b,(.5+f)*c,(.5+f)*b,(.5+e)*c,(.5+f)*b,.5*c);K.Ai(.5,.5-f,.5+e,.5-f,.5+f,.5-e,.5+f,.5,.5,h,h,k,l,m);O(a,m.x*b,m.y*c,l.x*b,l.y*c,k.x*b,k.y*c);P(a);M(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);P(a);u.v(h);u.v(k);u.v(l);u.v(m);u.v(n);b=a.o;b.A=new L(.25,.55);b.B=new L(.75,.8);u.q(a);return b},Fallout:function(a,
b,c){a=u.p();var d=.5*K.sa;M(a,0*b,.5*c,!0);O(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);O(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);var e=d=0;M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;P(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;P(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+
d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);P(a);b=a.o;b.Bd=sh;u.q(a);return b},IrritationHazard:function(a,b,c){a=u.p();M(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8*b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);P(a);b=a.o;b.A=new L(.3,.3);b.B=new L(.7,.7);u.q(a);return b},ElectricalHazard:function(a,b,c){a=u.p();M(a,.37*b,0*c,!0);a.lineTo(.5*
b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65*b,.56*c);a.lineTo(0*b,.68*c);P(a);b=a.o;u.q(a);return b},FireHazard:function(a,b,c){a=u.p();M(a,.1*b,1*c,!0);O(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);O(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);O(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);O(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);O(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*
c);O(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);P(a);b=a.o;b.A=new L(.05,.645);b.B=new L(.884,.908);u.q(a);return b},BpmnActivityLoop:function(a,b,c){a=u.p();var d=4*(Math.SQRT2-1)/3*.5;M(a,.65*b,1*c,!1);O(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);O(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);O(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);O(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.o;u.q(a);return b},BpmnActivityParallel:function(a,b,c){a=u.p();
M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;u.q(a);return b},BpmnActivitySequential:function(a,b,c){a=u.p();M(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.o;u.q(a);return b},BpmnActivityAdHoc:function(a,b,c){a=u.p();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,0,.5*c,!1);O(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);O(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.o;u.q(a);return b},BpmnActivityCompensation:function(a,
b,c){a=u.p();M(a,0,.5*c,!0);a.lineTo(.5*b,0);a.lineTo(.5*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);a.lineTo(.5*b,1*c);P(a);b=a.o;u.q(a);return b},BpmnTaskMessage:function(a,b,c){a=u.p();M(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8*c);a.lineTo(0,.8*c);P(a);M(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.$a(!1);b=a.o;u.q(a);return b},BpmnTaskScript:function(a,b,c){a=u.p();M(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);O(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,
0);O(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);P(a);M(a,.45*b,.73*c,!1);a.lineTo(.7*b,.73*c);a.moveTo(.38*b,.5*c);a.lineTo(.63*b,.5*c);a.moveTo(.31*b,.27*c);a.lineTo(.56*b,.27*c);a.$a(!1);b=a.o;u.q(a);return b},BpmnTaskUser:function(a,b,c){a=u.p();M(a,0,0,!1);M(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);O(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);O(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*
b,.405*c);var d=.5-.285,e=Math.PI/4,f=4*(1-Math.cos(e))/(3*Math.sin(e)),e=f*d,f=f*d;O(a,(.5-(e+d)/2)*b,(d+(d+f)/2)*c,(.5-d)*b,(d+f)*c,(.5-d)*b,d*c);O(a,(.5-d)*b,(d-f)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c);O(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-f)*c,(.5+d)*b,d*c);O(a,(.5+d)*b,(d+f)*c,(.5+(e+d)/2)*b,(d+(d+f)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);M(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);M(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.o;u.q(a);
return b},BpmnEventConditional:function(a,b,c){a=u.p();M(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);P(a);M(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.$a(!1);b=a.o;u.q(a);return b},BpmnEventError:function(a,b,c){a=u.p();M(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);P(a);b=a.o;u.q(a);return b},BpmnEventEscalation:function(a,
b,c){a=u.p();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);P(a);b=a.o;u.q(a);return b},BpmnEventTimer:function(a,b,c){a=u.p();var d=.5*K.sa;M(a,1*b,.5*c,!0);O(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);O(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);O(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);O(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*
b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.$a(!1);b=a.o;b.Bd=sh;u.q(a);return b}};for(var In in K.qg)K.qg[In.toLowerCase()]=In;
K.Hv={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
BackwardOpenTriangleLine:"m 8,0 l  -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",
BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z  m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",
OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};K.jI=function(){if(null!==K.Hv){for(var a in K.Hv){var b=sd(K.Hv[a],!1);K.Qi[a]=b;a.toLowerCase()!==a&&(K.Qi[a.toLowerCase()]=a)}K.Hv=null}};
K.UC=function(a){K.jI();var b=K.Qi[a];if(void 0===b){b=a.toLowerCase();if("none"===b)return"None";b=K.Qi[b]}return"string"===typeof b?b:b instanceof $c?a:null};
function G(a){0===arguments.length?A.call(this):A.call(this,a);this.O=311807;this.wk=this.Vh="";this.ur=this.rr=this.Dr=this.xq=null;this.Fr="";this.Th=this.Er=this.bm=null;this.tr="";this.Vn=null;this.sr=(new ia(NaN,NaN)).freeze();this.vr="";this.Wn=null;this.ie="";this.Bu=this.Gp=this.kk=null;this.Mg=(new w(NaN,NaN)).freeze();this.Eq="";this.zk=null;this.Fq=xb;this.Oq=K.fF;this.Hq=K.eF;this.Qp=null;this.yq=Jn;this.em=(new w(6,6)).freeze();this.dm="gray";this.cm=4;this.BB=-1;this.qF=new z;this.Bk=
null;this.kj=NaN}u.Ga(G,A);u.fa("Part",G);G.prototype.cloneProtected=function(a){A.prototype.cloneProtected.call(this,a);a.O=this.O&-4097|49152;a.Vh=this.Vh;a.wk=this.wk;a.xq=this.xq;a.Dr=this.Dr;a.rr=this.rr;a.ur=this.ur;a.Fr=this.Fr;a.Er=this.Er;a.Th=null;a.tr=this.tr;a.sr.assign(this.sr);a.vr=this.vr;a.ie=this.ie;a.Gp=this.Gp;a.Mg.assign(this.Mg);a.Eq=this.Eq;a.Fq=this.Fq.Z();a.Oq=this.Oq.Z();a.Hq=this.Hq.Z();a.Qp=this.Qp;a.yq=this.yq;a.em.assign(this.em);a.dm=this.dm;a.cm=this.cm};
G.prototype.Mh=function(a){A.prototype.Mh.call(this,a);a.dl();a.bm=null;a.Vn=null;a.Wn=null;a.zk=null;a.Bk=null};G.prototype.toString=function(){var a=u.rg(Object.getPrototypeOf(this))+"#"+u.Uc(this);null!==this.data&&(a+="("+de(this.data)+")");return a};G.LayoutNone=0;var Jj;G.LayoutAdded=Jj=1;var Rj;G.LayoutRemoved=Rj=2;G.LayoutShown=4;G.LayoutHidden=8;G.LayoutNodeSized=16;var Ik;G.LayoutGroupLayout=Ik=32;G.LayoutNodeReplaced=64;var Jn;G.LayoutStandard=Jn=Jj|Rj|28|Ik|64;G.LayoutAll=16777215;
G.prototype.Lm=function(a,b,c,d,e,f,h){var k=this.g;null!==k&&(a===be&&"elements"===b?e instanceof A?Kj(e,function(a){Mj(k,a);Lj(k,a)}):e instanceof Ri&&uk(k,e):a===ce&&"elements"===b&&(e instanceof A?Kj(e,function(a){Qj(k,a);Pj(k,a)}):e instanceof Ri&&vk(k,e)),k.Dc(a,b,c,d,e,f,h))};G.prototype.updateTargetBindings=G.prototype.Nb=function(a){A.prototype.Nb.call(this,a);if(null!==this.data){a=this.ya.n;for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof A&&Kj(d,function(a){null!==a.data&&a.Nb()})}}};
G.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.ga;if(c instanceof Q){var d=c.Bm(a),b=b.zG(d),e=this.Ra;b!==e&&(b=null!==e?c.wb(e.data):void 0,e=c.Vo,"function"===typeof e?e(a,b):a[e]=b,c.Fw(a,d))}}}};u.u(G,{zv:"adornments"},function(){return null===this.Th?Ia:this.Th.RD});G.prototype.findAdornment=G.prototype.xo=function(a){var b=this.Th;return null===b?null:b.ta(a)};
G.prototype.addAdornment=G.prototype.Kk=function(a,b){if(null!==b){var c=null,d=this.Th;null!==d&&(c=d.ta(a));if(c!==b){if(null!==c){var e=c.g;null!==e&&e.remove(c)}null===d&&(this.Th=d=new la("string",lf));b.Vh!==a&&(b.Kc=a);d.add(a,b);c=this.g;null!==c&&(c.add(b),b.data=this.data)}}};G.prototype.removeAdornment=G.prototype.ol=function(a){var b=this.Th;if(null!==b){var c=b.ta(a);if(null!==c){var d=c.g;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.Th=null)}};
G.prototype.clearAdornments=G.prototype.ls=function(){var a=this.Th;if(null!==a){for(var b=u.eb(),a=a.i;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.ol(b[c]);u.ra(b)}};
G.prototype.updateAdornments=function(){var a=this.g;if(null!==a){a:{if(this.Za&&this.dI){var b=this.nt;if(!(null!==b&&this.ba.J()&&this.Ea()&&b.kl()&&b.ba.J()))break a;var c=this.xo("Selection");if(null===c){c=this.eI;null===c&&(c=this instanceof W?a.sH:this instanceof V?a.MG:a.HH);if(!(c instanceof lf))break a;nf(c);c=c.copy();null!==c&&(c.Kc="Selection",c.vc=b)}if(null!==c){var d=c.placeholder;if(null!==d){var e=b.Hi(),f=0;b instanceof X&&(f=b.hb);var h=u.ul();h.m((b.Ha.width+f)*e,(b.Ha.height+
f)*e);d.xa=h;u.Oj(h)}c.angle=b.Zk();c.type!==ah&&(d=u.K(),c.location=b.lb(xb,d),u.v(d));this.Kk("Selection",c);break a}}this.ol("Selection")}Kn(this,a);for(a=this.zv;a.next();)b=a.value,b.Nb(),b.R()}};function Kn(a,b){b.tb.cf.each(function(b){b.isEnabled&&b.updateAdornments(a)})}u.u(G,{layer:"layer"},function(){return this.Bu});u.u(G,{g:"diagram"},function(){var a=this.Bu;return null!==a?a.g:null});
u.defineProperty(G,{wf:"layerName"},function(){return this.wk},function(a){var b=this.wk;if(b!==a){u.j(a,"string",G,"layerName");var c=this.g;if(null===c||null!==c.ws(a)&&!c.Vm)if(this.wk=a,null!==c&&c.pc(),this.h("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.g,null!==c&&(a=c.ws(a),null!==a&&a!==b))){var d=b.Fe(-1,this,!0);0<=d&&c.Dc(ce,"parts",b,this,null,d,!0);d=a.Eo(99999999,this,!0);0<=d&&c.Dc(be,"parts",a,null,this,!0,d);d=this.Rs;if(null!==d){var e=c.Na;c.Na=!0;d(this,b,a);c.Na=e}}}});
u.defineProperty(G,{Rs:"layerChanged"},function(){return this.xq},function(a){var b=this.xq;b!==a&&(null!==a&&u.j(a,"function",G,"layerChanged"),this.xq=a,this.h("layerChanged",b,a))});G.prototype.invalidateAdornments=G.prototype.Zd=function(){var a=this.g;null!==a&&(cj(a),0!==(this.O&16384)!==!0&&(this.O|=16384,a.de()))};function ui(a){0!==(a.O&16384)!==!1&&(a.updateAdornments(),a.O&=-16385,a=a.g,null!==a&&(a.Md=!0))}
u.defineProperty(G,{location:"location"},function(){return this.Mg},function(a){var b=this.Mg;if(!(b.L(a)||this instanceof W)){a=a.Z();var c=this.g;this.Mg=a;if(!1===Bj(this)){var d=this.Ma,e=a.x-b.x,f=a.y-b.y,h=d.copy();d.m(h.x+e,h.y+f);Kl(this,!1);!d.L(h)&&c&&this.h("position",h,d)}this.h("location",b,a)}});function Kl(a,b){if(!1===Cj(a)){var c=a.g;null!==c&&(c.Xf.add(a),a instanceof U&&!c.ha.gb&&a.sf(),b||c.de());Ln(a,!0)}}
function Mn(a){if(!1!==Cj(a)){var b=a.position,c=a.location;c.J()&&b.J()||(Nn(a,b,c),a.Jg());var b=a.Ma,c=a.Xb,d=c.copy();c.La();c.x=b.x;c.y=b.y;c.freeze();a.sw(d,c);Ln(a,!1)}}u.u(G,{ec:"locationObject"},function(){if(null===this.zk){var a=this.zz;""!==a?(a=this.je(a),this.zk=null!==a?a:this):this.zk=this instanceof lf?this.type!==ah&&null!==this.placeholder?this.placeholder:this:this}return this.zk.visible?this.zk:this});
u.defineProperty(G,{AH:"minLocation"},function(){return this.Oq},function(a){var b=this.Oq;b.L(a)||(this.Oq=a=a.Z(),this.h("minLocation",b,a))});u.defineProperty(G,{vH:"maxLocation"},function(){return this.Hq},function(a){var b=this.Hq;b.L(a)||(this.Hq=a=a.Z(),this.h("maxLocation",b,a))});u.defineProperty(G,{zz:"locationObjectName"},function(){return this.Eq},function(a){var b=this.Eq;b!==a&&(this.Eq=a,this.zk=null,El(this),this.h("locationObjectName",b,a))});
u.defineProperty(G,{Ze:"locationSpot"},function(){return this.Fq},function(a){var b=this.Fq;b.L(a)||(this.Fq=a=a.Z(),El(this),this.h("locationSpot",b,a))});G.prototype.move=G.prototype.move=function(a){this.position=a};G.prototype.moveTo=G.prototype.moveTo=function(a,b){var c=u.fc(a,b);this.move(c);u.v(c)};
G.prototype.isVisible=G.prototype.Ea=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.Ra;if(!(null===a||a.be&&a.Ea()))return!1;if(this instanceof U){a=this.zm();if(null!==a&&!a.Vc)return!1;a=this.ce;if(null!==a)return a.Ea()}else if(this instanceof W){var b=!0,c=this.g;null!==c&&(b=c.qd);c=this.W;if(null!==c){if(this.Bc&&b&&!c.Vc)return!1;if(c===a)return!0;c=c.findVisibleNode();if(null===c||c===a)return!1}c=this.ca;if(null!==c){if(this.Bc&&!b&&!c.Vc)return!1;
if(c===a)return!0;b=c.findVisibleNode();if(null===b||b===a)return!1}}return!0};G.prototype.He=function(a){var b=this.g;a?(this.H(4),this.Zd(),null!==b&&b.Xf.add(this)):(this.H(8),this.ls());null!==b&&(b.pc(),b.ma())};
G.prototype.findObject=G.prototype.je=function(a){if(this.name===a)return this;var b=this.Bk;null===b&&(this.Bk=b=new pa);if(void 0!==b[a])return b[a];for(var c=this.ya.n,d=c.length,e=0;e<d;e++){var f=c[e];if(f.name===a)return b[a]=f;if(f instanceof A)if(null===f.gi&&null===f.Zf){if(f=f.je(a),null!==f)return b[a]=f}else if(sk(f)&&(f=f.ya.first(),null!==f&&f.name===a))return b[a]=f}return b[a]=null};
function On(a,b,c,d){void 0===d&&(d=new w);c.ne()&&(c=Ib);var e=b.Ha;d.m(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.ab(d);for(b=b.S;null!==b&&b!==a;)b.transform.ab(d),b=b.S;a.yk.ab(d);d.offset(-a.Pc.x,-a.Pc.y);return d}G.prototype.ensureBounds=G.prototype.pf=function(){Ph(this,Infinity,Infinity);this.zc()};
function yi(a,b){var c;c=a.qF;var d;isNaN(a.kj)&&(a.kj=Tm(a));d=a.kj;var e=2*d;if(!a.il)return c.m(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;var e=b.y,f=b.width,h=b.height,k=a.shadowBlur,l=a.kI,f=f+k,h=h+k;d-=k/2;e-=k/2;0<l.x?f+=l.x:(d+=l.x,f-=l.x);0<l.y?h+=l.y:(e+=l.y,h-=l.y);c.m(d-1,e-1,f+2,h+2);return c}g=G.prototype;
g.zc=function(){this.Jg();if(!1===Bj(this))Mn(this);else{var a=u.Sf();a.assign(this.Xb);wl(this);this.Xb.La();var b=ti(this);this.xi(0,0,this.Pc.width,this.Pc.height);var c=this.position;Nn(this,c,this.location);var d=this.Xb;d.x=c.x;d.y=c.y;d.freeze();this.Jg();this.sw(a,d);a.L(d)?this.xf(b):!this.Fd()||K.D(a.width,d.width)&&K.D(a.height,d.height)||0<=this.BB&&this.H(16);u.ic(a);Ln(this,!1)}};
g.sw=function(a,b){rl(this,!1);var c=this.g;if(null!==c){this.dl();var d=!1,e=a.J();if(!1===c.ei){var f=c.Cd,h=c.padding,k=f.x+h.left,l=f.y+h.top,m=f.width-2*h.right,f=f.height-2*h.bottom;e&&a.x>k&&a.y>l&&a.right<m&&a.bottom<f&&b.x>k&&b.y>l&&b.right<m&&b.bottom<f&&(d=!0)}0!==(this.O&65536)!==!0&&a.L(b)||Nj(this,d,c);c.ma()}};
g.dA=function(a,b){if(!a.J()||this instanceof W)return!1;var c=this.g;if(null!==c&&!(this instanceof lf)){var d=this.g.Uh;d.ld&&ii(d,this,"position",b.copy(),a.copy())}if(null!==c&&!0===c.ha.gb)return!0;c=this.Mg;d=c.copy();c.m(c.x+(a.x-b.x),c.y+(a.y-b.y));this.Ma=a;!1===Cj(this)&&!1===Bj(this)&&(Kl(this,!1),this.Jg(),Mn(this));c.L(d)||this.h("location",d,c);return!0};
g.GE=function(a,b){var c=this.Mg;!1===Cj(this)&&!1===Bj(this)?(this.Mg.m(c.x+a-this.Ma.x,c.y+b-this.Ma.y),this.Ma.m(a,b),Kl(this,!0),this.Jg()):(c.m(NaN,NaN),this.Ma.m(a,b))};
function Nn(a,b,c){var d=NaN,e=NaN,f=u.K(),h=a.Ze,k=a.ec;h.ne()&&u.k("determineOffset: Part's locationSpot must be real: "+h.toString());var l=k.Ha,d=0;k.hb&&(d=k.Sg);f.rt(0,0,l.width+d,l.height+d,h);if(k!==a)for(k.hb&&f.offset(-d/2,-d/2),k.transform.ab(f),h=k.S;null!==h&&h!==a;)h.transform.ab(f),h=h.S;a.yk.ab(f);f.offset(-a.Pc.x,-a.Pc.y);h=a.g;c.J()?(k=b.x,l=b.y,d=c.x-f.x,e=c.y-f.y,b.m(d,e),c=!1,null!==h&&(d=h.Uh,d.dj?c=!0:!d.ld||a instanceof lf||ii(d,a,"position",new w(k,l),b),c||b.x===k&&b.y===
l||(d=h.cb,h.cb=!0,a.h("position",new w(k,l),b),h.cb=d))):b.J()&&(d=b.x,e=b.y,b=c.copy(),c.m(d+f.x,e+f.y),c.L(b)||null===h||(d=h.cb,h.cb=!0,a.h("location",b,c),h.cb=d));u.v(f)}function Nj(a,b,c){sl(a,!1);a instanceof U&&Qk(c,a);a.layer.Ac||b||c.pc();b=a.Xb;var d=c.ob;d.J()?(ti(a)?jb(b,d)||a.xf(!1):b.sg(d)&&a.xf(!0),a.updateAdornments()):c.uk=!0}g.hl=function(){return!0};
function wi(a,b){var c=a.Xb;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&a.Ea()){var d=a.transform,e=a.S,f=a.Xm;f.reset();null!==e&&(e.Tf()?f.multiply(e.Ff):null!==e.S&&f.multiply(e.S.Ff));f.multiply(a.Sd);null!==a.lc&&(yl(a,b,a.lc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.lc&&null===a.Ib&&(yl(a,b,"rgba(0,0,0,0.4)",!0,!1),b.fillRect(c.x,c.y,c.width,c.height));null!==a.Ib&&(d.Os()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),e=a.Ha,c=e.width,e=e.height,yl(a,b,a.Ib,!0,!1),
b.fillRect(0,0,c+0,e+0),d.Os()||(c=1/(d.m11*d.m22-d.m12*d.m21),b.transform(d.m22*c,-d.m12*c,-d.m21*c,d.m11*c,c*(d.m21*d.dy-d.m22*d.dx),c*(d.m12*d.dx-d.m11*d.dy))))}}g.Fd=function(){return!0};
u.defineProperty(G,{Kc:"category"},function(){return this.Vh},function(a){var b=this.Vh;if(b!==a){u.j(a,"string",G,"category");var c=this.g,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof lf)){var f=c.ga.ha;f.isEnabled&&!f.gb&&(e=this.clone(),e.ya.Td(this.ya))}this.Vh=a;this.h("category",b,a);null===c||null===d||this instanceof lf?(e=this.Kh,null!==e&&(a=e.Th,null!==a&&a.remove(b),e.Kk(this.Kc,this))):(f=c.ga,f.ha.gb||(this instanceof W?(f instanceof Q?f.EE(d,a):f instanceof qe&&f.hI(d,
a),c=Ck(c,a),null!==c&&(nf(c),c=c.copy(),null!==c&&Pn(this,c,b,a))):(null!==f&&f.Dw(d,a),c=zk(c,d,a),null!==c&&(nf(c),c=c.copy(),null===c||c instanceof W||(c.location=this.location,Pn(this,c,b,a)))),null!==e&&(b=this.clone(),b.ya.Td(this.ya),this.h("self",e,b))))}});u.defineProperty(G,{self:"self"},function(){return this},function(a){Pn(this,a,this.Kc,a.Kc)});var Qn=!1;
function Pn(a,b,c,d){b.constructor===a.constructor||Qn||(Qn=!0,u.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),u.trace("  Old class: "+u.rg(a)+", new class: "+u.rg(b)+", part: "+a.toString()));a.ls();var e=a.data;c=a.wf;var f=a.Za,h=a.Wg,k=!0,l=!0,m=!1;if(a instanceof U)var n=a,k=n.Ji,l=n.Vc,m=n.kp;b.Mh(a);b.cloneProtected(a);a.Vh=d;a.R();a.ma();b=a.g;d=!0;null!==b&&(d=b.cb,b.cb=!0);a.qh=e;null!==e&&a.Nb();null!==b&&(b.cb=d);e=a.wf;e!==c&&(a.wk=c,
a.wf=e);a instanceof U&&(n=a,n.Ji=k,n.Vc=l,n.kp=m,n.Fd()&&n.H(64));a.Za=f;a.Wg=h}G.prototype.canCopy=function(){if(!this.iG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ij)return!1;a=a.g;return null===a?!0:a.Ij?!0:!1};G.prototype.canDelete=function(){if(!this.pG)return!1;var a=this.layer;if(null===a)return!0;if(!a.lm)return!1;a=a.g;return null===a?!0:a.lm?!0:!1};
G.prototype.canEdit=function(){if(!this.uI)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ev)return!1;a=a.g;return null===a?!0:a.Ev?!0:!1};G.prototype.canGroup=function(){if(!this.NG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Bv)return!1;a=a.g;return null===a?!0:a.Bv?!0:!1};G.prototype.canMove=function(){if(!this.FH)return!1;var a=this.layer;if(null===a)return!0;if(!a.Nk)return!1;a=a.g;return null===a?!0:a.Nk?!0:!1};
G.prototype.canReshape=function(){if(!this.TH)return!1;var a=this.layer;if(null===a)return!0;if(!a.Cv)return!1;a=a.g;return null===a?!0:a.Cv?!0:!1};G.prototype.canResize=function(){if(!this.UH)return!1;var a=this.layer;if(null===a)return!0;if(!a.hs)return!1;a=a.g;return null===a?!0:a.hs?!0:!1};G.prototype.canRotate=function(){if(!this.XH)return!1;var a=this.layer;if(null===a)return!0;if(!a.Dv)return!1;a=a.g;return null===a?!0:a.Dv?!0:!1};
G.prototype.canSelect=function(){if(!this.pl)return!1;var a=this.layer;if(null===a)return!0;if(!a.of)return!1;a=a.g;return null===a?!0:a.of?!0:!1};u.defineProperty(G,{iG:"copyable"},function(){return 0!==(this.O&1)},function(a){var b=0!==(this.O&1);b!==a&&(this.O^=1,this.h("copyable",b,a))});u.defineProperty(G,{pG:"deletable"},function(){return 0!==(this.O&2)},function(a){var b=0!==(this.O&2);b!==a&&(this.O^=2,this.h("deletable",b,a))});
u.defineProperty(G,{uI:"textEditable"},function(){return 0!==(this.O&4)},function(a){var b=0!==(this.O&4);b!==a&&(this.O^=4,this.h("textEditable",b,a),this.Zd())});u.defineProperty(G,{NG:"groupable"},function(){return 0!==(this.O&8)},function(a){var b=0!==(this.O&8);b!==a&&(this.O^=8,this.h("groupable",b,a))});u.defineProperty(G,{FH:"movable"},function(){return 0!==(this.O&16)},function(a){var b=0!==(this.O&16);b!==a&&(this.O^=16,this.h("movable",b,a))});
u.defineProperty(G,{dI:"selectionAdorned"},function(){return 0!==(this.O&32)},function(a){var b=0!==(this.O&32);b!==a&&(this.O^=32,this.h("selectionAdorned",b,a),this.Zd())});u.defineProperty(G,{uz:"isInDocumentBounds"},function(){return 0!==(this.O&64)},function(a){var b=0!==(this.O&64);if(b!==a){this.O^=64;var c=this.g;null!==c&&c.pc();this.h("isInDocumentBounds",b,a)}});
u.defineProperty(G,{OD:"isLayoutPositioned"},function(){return 0!==(this.O&128)},function(a){var b=0!==(this.O&128);b!==a&&(this.O^=128,this.h("isLayoutPositioned",b,a),this.H(a?4:8))});u.defineProperty(G,{pl:"selectable"},function(){return 0!==(this.O&256)},function(a){var b=0!==(this.O&256);b!==a&&(this.O^=256,this.h("selectable",b,a),this.Zd())});
u.defineProperty(G,{TH:"reshapable"},function(){return 0!==(this.O&512)},function(a){var b=0!==(this.O&512);b!==a&&(this.O^=512,this.h("reshapable",b,a),this.Zd())});u.defineProperty(G,{UH:"resizable"},function(){return 0!==(this.O&1024)},function(a){var b=0!==(this.O&1024);b!==a&&(this.O^=1024,this.h("resizable",b,a),this.Zd())});u.defineProperty(G,{XH:"rotatable"},function(){return 0!==(this.O&2048)},function(a){var b=0!==(this.O&2048);b!==a&&(this.O^=2048,this.h("rotatable",b,a),this.Zd())});
u.defineProperty(G,{Za:"isSelected"},function(){return 0!==(this.O&4096)},function(a){var b=0!==(this.O&4096);if(b!==a){var c=this.g;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.wH)){this.O^=4096;var d=!1;if(null!==c){d=c.cb;c.cb=!0;var e=c.selection;e.La();a?e.add(this):e.remove(this);e.freeze()}this.h("isSelected",b,a);this.Zd();a=this.fI;null!==a&&a(this);null!==c&&(c.de(),c.cb=d)}}});
u.defineProperty(G,{Wg:"isHighlighted"},function(){return 0!==(this.O&524288)},function(a){var b=0!==(this.O&524288);if(b!==a){this.O^=524288;var c=this.g;null!==c&&(c=c.bw,c.La(),a?c.add(this):c.remove(this),c.freeze());this.h("isHighlighted",b,a);this.ma()}});u.defineProperty(G,{il:"isShadowed"},function(){return 0!==(this.O&8192)},function(a){var b=0!==(this.O&8192);b!==a&&(this.O^=8192,this.h("isShadowed",b,a),this.ma())});function Cj(a){return 0!==(a.O&32768)}
function Ln(a,b){a.O=b?a.O|32768:a.O&-32769}function sl(a,b){a.O=b?a.O|65536:a.O&-65537}function ti(a){return 0!==(a.O&131072)}G.prototype.xf=function(a){this.O=a?this.O|131072:this.O&-131073};function Rn(a,b){a.O=b?a.O|1048576:a.O&-1048577}u.defineProperty(G,{JD:"isAnimated"},function(){return 0!==(this.O&262144)},function(a){var b=0!==(this.O&262144);b!==a&&(this.O^=262144,this.h("isAnimated",b,a))});
u.defineProperty(G,{Zz:"selectionObjectName"},function(){return this.Fr},function(a){var b=this.Fr;b!==a&&(this.Fr=a,this.bm=null,this.h("selectionObjectName",b,a))});u.defineProperty(G,{eI:"selectionAdornmentTemplate"},function(){return this.Dr},function(a){var b=this.Dr;b!==a&&(this instanceof W&&(a.type=ah),this.Dr=a,this.h("selectionAdornmentTemplate",b,a))});
u.u(G,{nt:"selectionObject"},function(){if(null===this.bm){var a=this.Zz;null!==a&&""!==a?(a=this.je(a),this.bm=null!==a?a:this):this instanceof W?(a=this.path,this.bm=null!==a?a:this):this.bm=this}return this.bm});u.defineProperty(G,{fI:"selectionChanged"},function(){return this.Er},function(a){var b=this.Er;b!==a&&(null!==a&&u.j(a,"function",G,"selectionChanged"),this.Er=a,this.h("selectionChanged",b,a))});
u.defineProperty(G,{rE:"resizeAdornmentTemplate"},function(){return this.rr},function(a){var b=this.rr;b!==a&&(this.rr=a,this.h("resizeAdornmentTemplate",b,a))});u.defineProperty(G,{tE:"resizeObjectName"},function(){return this.tr},function(a){var b=this.tr;b!==a&&(this.tr=a,this.Vn=null,this.h("resizeObjectName",b,a))});u.u(G,{sE:"resizeObject"},function(){if(null===this.Vn){var a=this.tE;null!==a&&""!==a?(a=this.je(a),this.Vn=null!==a?a:this):this.Vn=this}return this.Vn});
u.defineProperty(G,{VH:"resizeCellSize"},function(){return this.sr},function(a){var b=this.sr;b.L(a)||(this.sr=a=a.Z(),this.h("resizeCellSize",b,a))});u.defineProperty(G,{YH:"rotateAdornmentTemplate"},function(){return this.ur},function(a){var b=this.ur;b!==a&&(this.ur=a,this.h("rotateAdornmentTemplate",b,a))});u.defineProperty(G,{ZH:"rotateObjectName"},function(){return this.vr},function(a){var b=this.vr;b!==a&&(this.vr=a,this.Wn=null,this.h("rotateObjectName",b,a))});
u.u(G,{vE:"rotateObject"},function(){if(null===this.Wn){var a=this.ZH;null!==a&&""!==a?(a=this.je(a),this.Wn=null!==a?a:this):this.Wn=this}return this.Wn});u.defineProperty(G,{text:"text"},function(){return this.ie},function(a){var b=this.ie;b!==a&&(this.ie=a,this.h("text",b,a))});
u.defineProperty(G,{Ra:"containingGroup"},function(){return this.kk},function(a){if(this.Fd()){var b=this.kk;if(b!==a){null===a||this!==a&&!a.Ph(this)||(this===a&&u.k("Cannot make a Group a member of itself: "+this.toString()),u.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.H(Rj);var c=this.g;null!==b?Sn(b,this):this instanceof V&&null!==c&&c.Ik.remove(this);this.kk=a;null!==a?Tn(a,this):this instanceof V&&null!==c&&c.Ik.add(this);this.H(Jj);
if(null!==c){var d=this.data,e=c.ga;null!==d&&e instanceof Q&&e.Fw(d,e.wb(null!==a?a.data:null))}d=this.bD;null!==d&&(e=!0,null!==c&&(e=c.Na,c.Na=!0),d(this,b,a),null!==c&&(c.Na=e));if(this instanceof V)for(c=new F(G),kf(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof U)for(d=d.oe;d.next();)xk(d.value);if(this instanceof U)for(d=this.oe;d.next();)xk(d.value);this.h("containingGroup",b,a);null!==a&&a.Jw()}}else u.k("cannot set the Part.containingGroup of a Link or Adornment")});g=G.prototype;
g.dl=function(){var a=this.Ra;null!==a&&(a.R(),null!==a.Pb&&a.Pb.R(),a.sf())};g.ma=function(){var a=this.g;null!==a&&!Bj(this)&&!Cj(this)&&this.Ea()&&this.Xb.J()&&a.ma(yi(this,this.Xb))};g.Js=function(a){var b=this.kk;null===b||a||Tn(b,this)};g.Ks=function(a){var b=this.kk;null===b||a||Sn(b,this)};g.xm=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ga,null!==b&&b.Vz(a))}};
u.defineProperty(G,{bD:"containingGroupChanged"},function(){return this.Gp},function(a){var b=this.Gp;b!==a&&(null!==a&&u.j(a,"function",G,"containingGroupChanged"),this.Gp=a,this.h("containingGroupChanged",b,a))});G.prototype.findSubGraphLevel=function(){return Un(this,this)};function Un(a,b){var c=b.Ra;return null!==c?1+Un(a,c):b instanceof U&&(c=b.ce,null!==c)?Un(a,c):0}G.prototype.findTopLevelPart=function(){return Vn(this,this)};
function Vn(a,b){var c=b.Ra;return null!==c?Vn(a,c):b instanceof U&&(c=b.ce,null!==c)?Vn(a,c):b}u.u(G,{Ho:"isTopLevel"},function(){return null!==this.Ra||this instanceof U&&this.tf?!1:!0});G.prototype.isMemberOf=G.prototype.Ph=function(a){return a instanceof V?Wn(this,this,a):!1};function Wn(a,b,c){if(b===c||null===c)return!1;var d=b.Ra;return null===d||d!==c&&!Wn(a,d,c)?b instanceof U&&(b=b.ce,null!==b)?Wn(a,b,c):!1:!0}
G.prototype.findCommonContainingGroup=G.prototype.yG=function(a){if(null===a)return null;if(this===a)return this instanceof V?this:null;for(var b=this;null!==b;)b instanceof V&&Rn(b,!0),b=b.Ra;for(var c=null,b=a;null!==b;){if(0!==(b.O&1048576)){c=b;break}b=b.Ra}for(b=this;null!==b;)b instanceof V&&Rn(b,!1),b=b.Ra;return c};u.defineProperty(G,{nH:"layoutConditions"},function(){return this.yq},function(a){var b=this.yq;b!==a&&(this.yq=a,this.h("layoutConditions",b,a))});
G.prototype.canLayout=function(){if(!this.OD||!this.Ea())return!1;var a=this.layer;return null!==a&&a.Ac||this instanceof U&&this.tf?!1:!0};G.prototype.invalidateLayout=G.prototype.H=function(a){void 0===a&&(a=16777215);var b;this.OD&&0!==(a&this.nH)?(b=this.layer,null!==b&&b.Ac||this instanceof U&&this.tf?b=!1:(b=this.g,b=null!==b&&b.ha.gb?!1:!0)):b=!1;if(b)if(b=this.kk,null!==b){var c=b.Qb;null!==c?c.H():b.H(a)}else a=this.g,null!==a&&(c=a.Qb,null!==c&&c.H())};
function Oj(a){if(!a.Ea())return!1;a=a.layer;return null!==a&&a.Ac?!1:!0}u.defineProperty(G,{mD:"dragComputation"},function(){return this.Qp},function(a){var b=this.Qp;b!==a&&(null!==a&&u.j(a,"function",G,"dragComputation"),this.Qp=a,this.h("dragComputation",b,a))});u.defineProperty(G,{kI:"shadowOffset"},function(){return this.em},function(a){var b=this.em;b.L(a)||(this.em=a=a.Z(),this.ma(),this.h("shadowOffset",b,a))});
u.defineProperty(G,{shadowColor:"shadowColor"},function(){return this.dm},function(a){var b=this.dm;b!==a&&(this.dm=a,this.ma(),this.h("shadowColor",b,a))});u.defineProperty(G,{shadowBlur:"shadowBlur"},function(){return this.cm},function(a){var b=this.cm;b!==a&&(this.cm=a,this.ma(),this.h("shadowBlur",b,a))});function lf(a){0===arguments.length?G.call(this,vh):G.call(this,a);this.wf="Adornment";this.Gb=null;this.O&=-257;this.Mg=new w(NaN,NaN);this.Vi=new E(z);this.Pb=null}u.Ga(lf,G);
u.fa("Adornment",lf);lf.prototype.toString=function(){var a=this.Kh;return"Adornment("+this.Kc+")"+(null!==a?a.toString():"")};lf.prototype.updateRelationshipsFromData=function(){};lf.prototype.Xs=function(){var a=this.vc.T,b=this.vc;if(a instanceof W&&b instanceof X){var c=a.path,b=c.Pa;a.Xs();for(var b=c.Pa,a=this.ya.n,c=a.length,d=0;d<c;d++){var e=a[d];e.tg&&e instanceof X&&(e.Pa=b)}}};u.u(lf,{placeholder:"placeholder"},function(){return this.Pb});
u.defineProperty(lf,{vc:"adornedObject"},function(){return this.Gb},function(a){var b=this.Kh,c=null;null!==a&&(c=a.T);null===b||null!==a&&b===c||b.ol(this.Kc);this.Gb=a;null!==c&&c.Kk(this.Kc,this)});u.u(lf,{Kh:"adornedPart"},function(){var a=this.Gb;return null!==a?a.T:null});lf.prototype.hl=function(){var a=this.Gb;if(null===a)return!0;a=a.T;return null===a||!Bj(a)};lf.prototype.Fd=function(){return!1};u.u(lf,{Ra:"containingGroup"},function(){return null});
lf.prototype.Lm=function(a,b,c,d,e,f,h){if(a===be&&"elements"===b)if(e instanceof ph){var k=e;null===this.Pb?this.Pb=k:this.Pb!==k&&u.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else e instanceof A&&(k=e.vs(function(a){return a instanceof ph}),k instanceof ph&&(null===this.Pb?this.Pb=k:this.Pb!==k&&u.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));else a===ce&&"elements"===b&&null!==this.Pb&&(d===this.Pb?this.Pb=null:d instanceof A&&
this.Pb.gl(d)&&(this.Pb=null));G.prototype.Lm.call(this,a,b,c,d,e,f,h)};lf.prototype.updateAdornments=function(){};lf.prototype.xm=function(){};function U(a){0===arguments.length?G.call(this,vh):G.call(this,a);this.hc=new E(W);this.Kn=this.xk=this.Bq=this.Aq=null;this.qq=!0;this.$r=!1;this.Vr=null;this.zp=this.rq=!0;this.Ap=K.iF;this.Qd=this.nh=null;this.kr=Xn;this.Fj=!1}u.Ga(U,G);u.fa("Node",U);
U.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.Aq=this.Aq;a.Bq=this.Bq;a.xk=this.xk;a.qq=this.qq;a.$r=this.$r;a.Vr=this.Vr;a.rq=this.rq;a.zp=this.zp;a.Ap=this.Ap.Z();a.kr=this.kr};U.prototype.Mh=function(a){G.prototype.Mh.call(this,a);a.sf();a.nh=this.nh;a.Qd=null};var Yn;U.DirectionDefault=Yn=u.s(U,"DirectionDefault",0);U.DirectionAbsolute=u.s(U,"DirectionAbsolute",1);var Zn;U.DirectionRotatedNode=Zn=u.s(U,"DirectionRotatedNode",2);var jl;
U.DirectionRotatedNodeOrthogonal=jl=u.s(U,"DirectionRotatedNodeOrthogonal",3);U.SpreadingNone=u.s(U,"SpreadingNone",10);var Xn;U.SpreadingEvenly=Xn=u.s(U,"SpreadingEvenly",11);var $n;U.SpreadingPacked=$n=u.s(U,"SpreadingPacked",12);function ao(a,b){null!==b&&(null===a.nh&&(a.nh=new F(bo)),a.nh.add(b))}
U.prototype.Lm=function(a,b,c,d,e,f,h){a===be&&"elements"===b?this.Qd=null:a===ce&&"elements"===b&&(null===this.g?this.Qd=null:d instanceof S&&Pm(this,d,function(a,b){Ll(a,b,!0)}));G.prototype.Lm.call(this,a,b,c,d,e,f,h)};U.prototype.invalidateConnectedLinks=U.prototype.sf=function(a){void 0===a&&(a=null);for(var b=this.oe;b.next();){var c=b.value;null!==a&&a.contains(c)||(co(this,c.od),co(this,c.fe),c.Vb())}};function co(a,b){if(null!==b){b.jr=null;var c=a.Ra;null===c||c.be||co(c,c.Xk(""))}}
U.prototype.hl=function(){return!0};u.defineProperty(U,{NH:"portSpreading"},function(){return this.kr},function(a){var b=this.kr;b!==a&&(this.kr=a,this.h("portSpreading",b,a),a=this.g,null!==a&&a.ha.gb||this.sf())});u.defineProperty(U,{TC:"avoidable"},function(){return this.zp},function(a){var b=this.zp;if(b!==a){this.zp=a;var c=this.g;null!==c&&Qk(c,this);this.h("avoidable",b,a)}});
u.defineProperty(U,{RF:"avoidableMargin"},function(){return this.Ap},function(a){"number"===typeof a?a=new rb(a):u.C(a,rb,U,"avoidableMargin");var b=this.Ap;if(!b.L(a)){this.Ap=a=a.Z();var c=this.g;null!==c&&Qk(c,this);this.h("avoidableMargin",b,a)}});U.prototype.canAvoid=function(){return this.TC&&!this.tf};U.prototype.getAvoidableRect=function(a){a.set(this.ba);a.yv(this.RF);return a};U.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.Ea();)a=a.Ra;return a};
U.prototype.He=function(a){G.prototype.He.call(this,a);for(var b=this.oe;b.next();)b.value.He(a)};u.u(U,{oe:"linksConnected"},function(){return this.hc.i});U.prototype.findLinksConnected=U.prototype.qD=function(a){void 0===a&&(a=null);if(null===a)return this.hc.i;var b=new Ka(this.hc),c=this;b.Km=function(b){return b.W===c&&b.pg===a||b.ca===c&&b.lh===a};return b};
U.prototype.findLinksOutOf=U.prototype.Wv=function(a){void 0===a&&(a=null);var b=new Ka(this.hc),c=this;b.Km=function(b){return b.W!==c?!1:null===a?!0:b.pg===a};return b};U.prototype.findLinksInto=U.prototype.og=function(a){void 0===a&&(a=null);var b=new Ka(this.hc),c=this;b.Km=function(b){return b.ca!==c?!1:null===a?!0:b.lh===a};return b};
U.prototype.findNodesConnected=U.prototype.rD=function(a){void 0===a&&(a=null);for(var b=null,c=null,d=this.hc.i;d.next();){var e=d.value;if(e.W===this){if(null===a||e.pg===a)e=e.ca,null!==b?b.add(e):null!==c&&c!==e?(b=new F(U),b.add(c),b.add(e)):c=e}else e.ca!==this||null!==a&&e.lh!==a||(e=e.W,null!==b?b.add(e):null!==c&&c!==e?(b=new F(U),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Ja(c):Ia};
U.prototype.findNodesOutOf=function(a){void 0===a&&(a=null);for(var b=null,c=null,d=this.hc.i;d.next();){var e=d.value;e.W!==this||null!==a&&e.pg!==a||(e=e.ca,null!==b?b.add(e):null!==c&&c!==e?(b=new F(U),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Ja(c):Ia};
U.prototype.findNodesInto=function(a){void 0===a&&(a=null);for(var b=null,c=null,d=this.hc.i;d.next();){var e=d.value;e.ca!==this||null!==a&&e.lh!==a||(e=e.W,null!==b?b.add(e):null!==c&&c!==e?(b=new F(U),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Ja(c):Ia};
U.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);var d=new Ka(this.hc),e=this;d.Km=function(d){return(d.W!==e||d.ca!==a||null!==b&&d.pg!==b||null!==c&&d.lh!==c)&&(d.W!==a||d.ca!==e||null!==c&&d.pg!==c||null!==b&&d.lh!==b)?!1:!0};return d};U.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);var d=new Ka(this.hc),e=this;d.Km=function(d){return d.W!==e||d.ca!==a||null!==b&&d.pg!==b||null!==c&&d.lh===c?!1:!0};return d};
u.defineProperty(U,{pH:"linkConnected"},function(){return this.Aq},function(a){var b=this.Aq;b!==a&&(null!==a&&u.j(a,"function",U,"linkConnected"),this.Aq=a,this.h("linkConnected",b,a))});u.defineProperty(U,{qH:"linkDisconnected"},function(){return this.Bq},function(a){var b=this.Bq;b!==a&&(null!==a&&u.j(a,"function",U,"linkDisconnected"),this.Bq=a,this.h("linkDisconnected",b,a))});
u.defineProperty(U,{pw:"linkValidation"},function(){return this.xk},function(a){var b=this.xk;b!==a&&(null!==a&&u.j(a,"function",U,"linkValidation"),this.xk=a,this.h("linkValidation",b,a))});
function eo(a,b,c){co(a,c);if(!a.hc.contains(b)){a.hc.add(b);var d=a.pH;if(null!==d){var e=!0,f=a.g;null!==f&&(e=f.Na,f.Na=!0);d(a,b,c);null!==f&&(f.Na=e)}b.Bc&&(c=b.W,b=b.ca,null!==c&&null!==b&&c!==b&&(d=!0,f=a.g,null!==f&&(d=f.qd),a=d?b:c,e=d?c:b,a.Fj||(a.Fj=e),!e.Ji||null!==f&&f.ha.gb||(d?c===e&&(e.Ji=!1):b===e&&(e.Ji=!1))))}}
function fo(a,b,c){co(a,c);if(a.hc.remove(b)){var d=a.qH,e=a.g;if(null!==d){var f=!0;null!==e&&(f=e.Na,e.Na=!0);d(a,b,c);null!==e&&(e.Na=f)}b.Bc&&(c=!0,null!==e&&(c=e.qd),a=c?b.ca:b.W,b=c?b.W:b.ca,null!==a&&(a.Fj=!1),null===b||b.Ji||(0===b.hc.count?(b.Fj=null,null!==e&&e.ha.gb||(b.Ji=!0)):Jk(b)))}}
function Jk(a){a.Fj=!1;if(0!==a.hc.count){var b=!0,c=a.g;if(null===c||!c.ha.gb){null!==c&&(b=c.qd);for(c=a.hc.i;c.next();){var d=c.value;if(d.Bc)if(b){if(d.W===a){a.Ji=!1;return}}else if(d.ca===a){a.Ji=!1;return}}a.Ji=!0}}}
U.prototype.updateRelationshipsFromData=function(){G.prototype.updateRelationshipsFromData.call(this);var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.ga;if(c instanceof qe){var d=c.Cm(a),b=b.Xe(d),e=this.zm();b!==e&&(b=null!==e?c.wb(e.data):void 0,e=c.Wo,"function"===typeof e?e(a,b):a[e]=b,c.ih(a,d))}}}};U.prototype.Js=function(a){G.prototype.Js.call(this,a);a||Jk(this);var b=this.Kn;null===b||a||ho(b,this)};
U.prototype.Ks=function(a){G.prototype.Ks.call(this,a);var b=this.Kn;null===b||a||null===b.ue||(b.ue.remove(this),b.R())};U.prototype.xm=function(){if(0<this.hc.count){var a=this.g;if(null===a)return;for(var b=this.hc.copy().i;b.next();)a.remove(b.value)}this.ce=null;G.prototype.xm.call(this)};u.u(U,{tf:"isLinkLabel"},function(){return null!==this.Kn});
u.defineProperty(U,{ce:"labeledLink"},function(){return this.Kn},function(a){var b=this.Kn;if(b!==a){var c=this.g,d=this.data;if(null!==b&&(null!==b.ue&&(b.ue.remove(this),b.R()),null!==c&&null!==d&&!c.ha.gb)){var e=b.data,f=c.ga;if(null!==e&&f instanceof Q){var h=f.wb(d);void 0!==h&&f.mE(e,h)}}this.Kn=a;null!==a&&(ho(a,this),null===c||null===d||c.ha.gb||(e=a.data,f=c.ga,null!==e&&f instanceof Q&&(h=f.wb(d),void 0!==h&&f.Ly(e,h))));El(this);this.h("labeledLink",b,a)}});
U.prototype.findPort=U.prototype.Xk=function(a){if(null===this.Qd){if(""===a&&!1===this.xh)return this;Ml(this)}var b=this.Qd.ta(a);return null!==b||""!==a&&(b=this.Qd.ta(""),null!==b)?b:this};u.u(U,{port:"port"},function(){return this.Xk("")});u.u(U,{ports:"ports"},function(){null===this.Qd&&Ml(this);return this.Qd.RD});function Ml(a){null===a.Qd?a.Qd=new la("string",S):a.Qd.clear();Pm(a,a,function(a,c){var d=c.Jd;null!==d&&a.Qd.add(d,c)});0===a.Qd.count&&a.Qd.add("",a)}
function Ll(a,b,c){var d=b.Jd;if(null!==d&&(null!==a.Qd&&a.Qd.remove(d),b=a.g,null!==b&&c)){c=null;for(d=a.qD(d);d.next();)a=d.value,null===c&&(c=u.eb()),c.push(a);if(null!==c){for(d=0;d<c.length;d++)a=c[d],b.remove(a);u.ra(c)}}}
U.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.g;null!==c&&(b=c.qd);c=this;if(b)for(;c!==a;){for(var b=null,d=c.hc.i;d.next();){var e=d.value;if(e.Bc&&(b=e.W,b!==c&&b!==this))break}if(b===this||null===b||b===c)return!1;c=b}else for(;c!==a;){b=null;for(d=c.hc.i;d.next()&&(e=d.value,!e.Bc||(b=e.ca,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
U.prototype.findTreeRoot=function(){var a=!0,b=this.g;null!==b&&(a=b.qd);b=this;if(a)for(;;){for(var a=null,c=b.hc.i;c.next();){var d=c.value;if(d.Bc&&(a=d.W,a!==b&&a!==this))break}if(a===this)return this;if(null===a||a===b)return b;b=a}else for(;;){a=null;for(c=b.hc.i;c.next()&&(d=c.value,!d.Bc||(a=d.ca,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
U.prototype.findCommonTreeParent=function(a){if(null===a)return null;if(this===a)return this;for(var b=this;null!==b;)Rn(b,!0),b=b.zm();for(var c=null,b=a;null!==b;){if(0!==(b.O&1048576)){c=b;break}b=b.zm()}for(b=this;null!==b;)Rn(b,!1),b=b.zm();return c};U.prototype.findTreeParentLink=U.prototype.As=function(){var a=!0,b=this.g;null!==b&&(a=b.qd);b=this.hc.i;if(a)for(;b.next();){if(a=b.value,a.Bc&&a.W!==this)return a}else for(;b.next();)if(a=b.value,a.Bc&&a.ca!==this)return a;return null};
U.prototype.findTreeParentNode=U.prototype.zm=function(){var a=this.Fj;if(null===a)return null;if(a instanceof U)return a;var b=!0,a=this.g;null!==a&&(b=a.qd);a=this.hc.i;if(b)for(;a.next();){if(b=a.value,b.Bc&&(b=b.W,b!==this))return this.Fj=b}else for(;a.next();)if(b=a.value,b.Bc&&(b=b.ca,b!==this))return this.Fj=b;return this.Fj=null};U.prototype.findTreeLevel=function(){return io(this,this)};function io(a,b){var c=b.zm();return null===c?0:1+io(a,c)}
U.prototype.findTreeChildrenLinks=U.prototype.Yv=function(){var a=!0,b=this.g;null!==b&&(a=b.qd);if(a){var a=new Ka(this.hc),c=this;a.Km=function(a){return a.Bc&&a.W===c?!0:!1}}else a=new Ka(this.hc),c=this,a.Km=function(a){return a.Bc&&a.ca===c?!0:!1};return a};
U.prototype.findTreeChildrenNodes=U.prototype.tD=function(){var a=!0,b=this.g;null!==b&&(a=b.qd);var c=b=null,d=this.hc.i;if(a)for(;d.next();)a=d.value,a.Bc&&a.W===this&&(a=a.ca,null!==b?b.add(a):null!==c&&c!==a?(b=new E(U),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.Bc&&a.ca===this&&(a=a.W,null!==b?b.add(a):null!==c&&c!==a?(b=new E(U),b.add(c),b.add(a)):c=a);return null!==b?b.i:null!==c?new Ja(c):Ia};
U.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);u.j(a,"number",U,"collapseTree:level");var b=new F(G);kf(b,this,!1,a,!0);return b};U.prototype.collapseTree=U.prototype.collapseTree=function(a){void 0===a&&(a=1);u.ze(a,U,"collapseTree:level");1>a&&(a=1);var b=this.g;if(null!==b&&!b.me){var c=b.Lb;0!==b.ha.Le&&c.ml();b.me=!0;var c=b.qd,d=new F(U);d.add(this);jo(this,d,c,a,this.Vc);b.me=!1}};
function jo(a,b,c,d,e){if(1<d)for(e=c?a.Wv():a.og();e.next();){var f=e.value;f.Bc&&(f=f.hz(a),null===f||f===a||b.contains(f)||(b.add(f),jo(f,b,c,d-1,f.Vc)))}else ko(a,b,c,e)}function ko(a,b,c,d){for(var e=c?a.Wv():a.og();e.next();){var f=e.value;f.Bc&&(f=f.hz(a),null===f||f===a||b.contains(f)||(b.add(f),d&&(f.dl(),f.He(!1)),f.Vc&&(f.kp=f.Vc,ko(f,b,c,f.kp))))}a.Vc=!1}
U.prototype.expandTree=U.prototype.expandTree=function(a){void 0===a&&(a=2);u.ze(a,U,"expandTree:level");2>a&&(a=2);var b=this.g;if(null!==b&&!b.me){var c=b.Lb;0!==b.ha.Le&&c.ml();b.me=!0;var d=b.qd,e=new F(U);e.add(this);lo(this,e,d,a,this.Vc,c,this);b.me=!1}};
function lo(a,b,c,d,e,f,h){for(var k=c?a.Wv():a.og();k.next();){var l=k.value;l.Bc&&(e||l.hg||l.Vb(),l=l.hz(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),e||(l.He(!0),l.dl(),ri(f,l,h)),2<d||l.kp))&&(l.kp=!1,lo(l,b,c,d-1,l.Vc,f,h))}a.Vc=!0}
u.defineProperty(U,{Vc:"isTreeExpanded"},function(){return this.qq},function(a){var b=this.qq;if(b!==a){this.qq=a;var c=this.g;this.h("isTreeExpanded",b,a);b=this.zI;if(null!==b){var d=!0;null!==c&&(d=c.Na,c.Na=!0);b(this);null!==c&&(c.Na=d)}a?null===c||c.me||(0!==c.ha.Le&&c.Lb.ml(),c.me=!0,a=c.qd,b=new F(U),b.add(this),lo(this,b,a,2,!1,c.Lb,this),c.me=!1):null===c||c.me||(0!==c.ha.Le&&c.Lb.ml(),c.me=!0,a=c.qd,b=new F(U),b.add(this),ko(this,b,a,!0),c.me=!1)}});
u.defineProperty(U,{kp:"wasTreeExpanded"},function(){return this.$r},function(a){var b=this.$r;b!==a&&(this.$r=a,this.h("wasTreeExpanded",b,a))});u.defineProperty(U,{zI:"treeExpandedChanged"},function(){return this.Vr},function(a){var b=this.Vr;b!==a&&(null!==a&&u.j(a,"function",U,"treeExpandedChanged"),this.Vr=a,this.h("treeExpandedChanged",b,a))});u.defineProperty(U,{Ji:"isTreeLeaf"},function(){return this.rq},function(a){var b=this.rq;b!==a&&(this.rq=a,this.h("isTreeLeaf",b,a))});
function W(){G.call(this,ah);this.Wf=null;this.wh="";this.gg=this.Yp=null;this.Ih="";this.Ur=null;this.qr=this.pr=this.or=!1;this.sq=!0;this.tp=dh;this.Hp=0;this.Kp=dh;this.Lp=NaN;this.Yl=Xl;this.Kr=.5;this.ue=null;this.Qc=(new E(w)).freeze();this.Xn=this.we=null;this.hg=!1;this.py=null;this.zy=!1;this.an=this.di=this.Pa=null;this.hf=0;this.nn=this.jn=null;this.Vi=new E(z);this.Dy=new w;this.qC=this.oC=null;this.jx=!1;this.Q=null}u.Ga(W,G);u.fa("Link",W);
W.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.wh=this.wh;a.Yp=this.Yp;a.Ih=this.Ih;a.Ur=this.Ur;a.or=this.or;a.pr=this.pr;a.qr=this.qr;a.sq=this.sq;a.tp=this.tp;a.Hp=this.Hp;a.Kp=this.Kp;a.Lp=this.Lp;a.Yl=this.Yl;a.Kr=this.Kr;a.Q=null!==this.Q?this.Q.copy():null};W.prototype.Mh=function(a){G.prototype.Mh.call(this,a);this.wh=a.wh;this.Ih=a.Ih;a.we=null;a.Vb();a.an=this.an;a.hf=this.hf};var Xl;W.Normal=Xl=u.s(W,"Normal",1);W.Orthogonal=u.s(W,"Orthogonal",2);
W.AvoidsNodes=u.s(W,"AvoidsNodes",6);var mo;W.AvoidsNodesStraight=mo=u.s(W,"AvoidsNodesStraight",7);var dh;W.None=dh=u.s(W,"None",0);var kh;W.Bezier=kh=u.s(W,"Bezier",9);var ch;W.JumpGap=ch=u.s(W,"JumpGap",10);var bh;W.JumpOver=bh=u.s(W,"JumpOver",11);var Ul;W.End=Ul=u.s(W,"End",17);var Vl;W.Scale=Vl=u.s(W,"Scale",18);var Wl;W.Stretch=Wl=u.s(W,"Stretch",19);var en;W.OrientAlong=en=u.s(W,"OrientAlong",21);var no;W.OrientPlus90=no=u.s(W,"OrientPlus90",22);var oo;
W.OrientMinus90=oo=u.s(W,"OrientMinus90",23);var po;W.OrientOpposite=po=u.s(W,"OrientOpposite",24);var qo;W.OrientUpright=qo=u.s(W,"OrientUpright",25);var ro;W.OrientPlus90Upright=ro=u.s(W,"OrientPlus90Upright",26);var so;W.OrientMinus90Upright=so=u.s(W,"OrientMinus90Upright",27);var to;W.OrientUpright45=to=u.s(W,"OrientUpright45",28);W.prototype.Ee=function(){this.Q=new il};
W.prototype.hl=function(){var a=this.W;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Bj(a)||Cj(a))return!1}a=this.ca;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Bj(a)||Cj(a))?!1:!0};W.prototype.dA=function(){return!1};W.prototype.Fd=function(){return!1};
W.prototype.computeAngle=function(a,b,c){a=0;switch(b){default:case dh:a=0;break;case en:a=c;break;case no:a=c+90;break;case oo:a=c-90;break;case po:a=c+180;break;case qo:a=K.ct(c);90<a&&270>a&&(a-=180);break;case ro:a=K.ct(c+90);90<a&&270>a&&(a-=180);break;case so:a=K.ct(c-90);90<a&&270>a&&(a-=180);break;case to:a=K.ct(c);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return K.ct(a)};
u.defineProperty(W,{W:"fromNode"},function(){return this.Wf},function(a){var b=this.Wf;if(b!==a){var c=this.od;null!==b&&(this.gg!==b&&fo(b,this,c),uo(this),this.H(Rj));this.Wf=a;this.di=null;this.Vb();var d=this.g;if(null!==d){var e=this.data,f=d.ga;if(null!==e)if(f instanceof Q){var h=null!==a?a.data:null;f.Ew(e,f.wb(h))}else f instanceof qe&&(h=null!==a?a.data:null,d.qd?f.ih(e,f.wb(h)):(null!==b&&f.ih(b.data,void 0),f.ih(h,f.wb(null!==this.gg?this.gg.data:null))))}e=this.od;f=this.wD;null!==f&&
(h=!0,null!==d&&(h=d.Na,d.Na=!0),f(this,c,e),null!==d&&(d.Na=h));null!==a&&(this.gg!==a&&eo(a,this,e),vo(this),this.H(Jj));this.h("fromNode",b,a);xk(this)}});
u.defineProperty(W,{pg:"fromPortId"},function(){return this.wh},function(a){var b=this.wh;if(b!==a){var c=this.od;null!==c&&co(this.W,c);uo(this);this.wh=a;var d=this.od;null!==d&&co(this.W,d);var e=this.g;if(null!==e){var f=this.data,h=e.ga;null!==f&&h instanceof Q&&h.aA(f,a)}c!==d&&(this.di=null,this.Vb(),f=this.wD,null!==f&&(h=!0,null!==e&&(h=e.Na,e.Na=!0),f(this,c,d),null!==e&&(e.Na=h)));vo(this);this.h("fromPortId",b,a)}});u.u(W,{od:"fromPort"},function(){var a=this.Wf;return null===a?null:a.Xk(this.wh)});
u.defineProperty(W,{wD:"fromPortChanged"},function(){return this.Yp},function(a){var b=this.Yp;b!==a&&(null!==a&&u.j(a,"function",W,"fromPortChanged"),this.Yp=a,this.h("fromPortChanged",b,a))});
u.defineProperty(W,{ca:"toNode"},function(){return this.gg},function(a){var b=this.gg;if(b!==a){var c=this.fe;null!==b&&(this.Wf!==b&&fo(b,this,c),uo(this),this.H(Rj));this.gg=a;this.di=null;this.Vb();var d=this.g;if(null!==d){var e=this.data,f=d.ga;if(null!==e)if(f instanceof Q){var h=null!==a?a.data:null;f.Gw(e,f.wb(h))}else f instanceof qe&&(h=null!==a?a.data:null,d.qd?(null!==b&&f.ih(b.data,void 0),f.ih(h,f.wb(null!==this.Wf?this.Wf.data:null))):f.ih(e,f.wb(h)))}e=this.fe;f=this.PE;null!==f&&
(h=!0,null!==d&&(h=d.Na,d.Na=!0),f(this,c,e),null!==d&&(d.Na=h));null!==a&&(this.Wf!==a&&eo(a,this,e),vo(this),this.H(Jj));this.h("toNode",b,a);xk(this)}});
u.defineProperty(W,{lh:"toPortId"},function(){return this.Ih},function(a){var b=this.Ih;if(b!==a){var c=this.fe;null!==c&&co(this.ca,c);uo(this);this.Ih=a;var d=this.fe;null!==d&&co(this.ca,d);var e=this.g;if(null!==e){var f=this.data,h=e.ga;null!==f&&h instanceof Q&&h.eA(f,a)}c!==d&&(this.di=null,this.Vb(),f=this.PE,null!==f&&(h=!0,null!==e&&(h=e.Na,e.Na=!0),f(this,c,d),null!==e&&(e.Na=h)));vo(this);this.h("toPortId",b,a)}});u.u(W,{fe:"toPort"},function(){var a=this.gg;return null===a?null:a.Xk(this.Ih)});
u.defineProperty(W,{PE:"toPortChanged"},function(){return this.Ur},function(a){var b=this.Ur;b!==a&&(null!==a&&u.j(a,"function",W,"toPortChanged"),this.Ur=a,this.h("toPortChanged",b,a))});u.defineProperty(W,{vb:"fromSpot"},function(){return null!==this.Q?this.Q.cj:uc},function(a){null===this.Q&&this.Ee();var b=this.Q.cj;b.L(a)||(a=a.Z(),this.Q.cj=a,this.h("fromSpot",b,a),this.Vb())});
u.defineProperty(W,{Yk:"fromEndSegmentLength"},function(){return null!==this.Q?this.Q.aj:NaN},function(a){null===this.Q&&this.Ee();var b=this.Q.aj;b!==a&&(0>a&&u.wa(a,">= 0",W,"fromEndSegmentLength"),this.Q.aj=a,this.h("fromEndSegmentLength",b,a),this.Vb())});u.defineProperty(W,{Es:"fromEndSegmentDirection"},function(){return null!==this.Q?this.Q.$i:Yn},function(a){null===this.Q&&this.Ee();var b=this.Q.$i;b!==a&&(this.Q.$i=a,this.h("fromEndSegmentDirection",b,a),this.Vb())});
u.defineProperty(W,{Fs:"fromShortLength"},function(){return null!==this.Q?this.Q.bj:NaN},function(a){null===this.Q&&this.Ee();var b=this.Q.bj;b!==a&&(this.Q.bj=a,this.h("fromShortLength",b,a),this.Vb())});u.defineProperty(W,{xb:"toSpot"},function(){return null!==this.Q?this.Q.Ej:uc},function(a){null===this.Q&&this.Ee();var b=this.Q.Ej;b.L(a)||(a=a.Z(),this.Q.Ej=a,this.h("toSpot",b,a),this.Vb())});
u.defineProperty(W,{vl:"toEndSegmentLength"},function(){return null!==this.Q?this.Q.Cj:NaN},function(a){null===this.Q&&this.Ee();var b=this.Q.Cj;b!==a&&(0>a&&u.wa(a,">= 0",W,"toEndSegmentLength"),this.Q.Cj=a,this.h("toEndSegmentLength",b,a),this.Vb())});u.defineProperty(W,{wt:"toEndSegmentDirection"},function(){return null!==this.Q?this.Q.Bj:Yn},function(a){null===this.Q&&this.Ee();var b=this.Q.Bj;b!==a&&(this.Q.Bj=a,this.h("toEndSegmentDirection",b,a),this.Vb())});
u.defineProperty(W,{yt:"toShortLength"},function(){return null!==this.Q?this.Q.Dj:NaN},function(a){null===this.Q&&this.Ee();var b=this.Q.Dj;b!==a&&(this.Q.Dj=a,this.h("toShortLength",b,a),this.Vb())});function xk(a){var b=a.W,c=a.ca;null!==b?null!==c?wo(a,b.yG(c)):wo(a,null):wo(a,null)}function wo(a,b){var c=a.kk;if(c!==b){null!==c&&Sn(c,a);a.kk=b;null!==b&&Tn(b,a);var d=a.bD;if(null!==d){var e=!0,f=a.g;null!==f&&(e=f.Na,f.Na=!0);d(a,c,b);null!==f&&(f.Na=e)}!a.hg||a.oC!==c&&a.qC!==c||a.Vb()}}
W.prototype.dl=function(){var a=this.Ra;null!==a&&this.W!==a&&this.ca!==a&&G.prototype.dl.call(this)};W.prototype.getOtherNode=W.prototype.hz=function(a){var b=this.W;return a===b?this.ca:b};W.prototype.getOtherPort=function(a){var b=this.od;return a===b?this.fe:b};u.u(W,{EJ:"isLabeledLink"},function(){return null===this.ue?!1:0<this.ue.count});u.u(W,{ug:"labelNodes"},function(){return null===this.ue?Ia:this.ue.i});function ho(a,b){null===a.ue&&(a.ue=new F(U));a.ue.add(b);a.R()}
W.prototype.Js=function(a){G.prototype.Js.call(this,a);xo(this)&&eh(this,this.ba);if(!a){a=this.Wf;var b=this.gg;null!==a&&(eo(a,this,this.od),vo(this));null!==b&&(eo(b,this,this.fe),vo(this))}};W.prototype.Ks=function(a){G.prototype.Ks.call(this,a);xo(this)&&eh(this,this.ba);if(!a){a=this.Wf;var b=this.gg;null!==a&&(fo(a,this,this.od),uo(this));null!==b&&(fo(b,this,this.fe),uo(this))}};
W.prototype.xm=function(){this.hg=!0;if(null!==this.ue){var a=this.g;if(null===a)return;for(var b=this.ue.copy().i;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.g,null!==a&&(a=a.ga,a instanceof Q?a.Uz(b):a instanceof qe&&a.ih(b,void 0)))};
W.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.ga;if(c instanceof Q){var d=c.$k(a),e=b.Xe(d),f=this.W;e!==f&&(e=null!==f?c.wb(f.data):void 0,f=c.Ko,"function"===typeof f?f(a,e):a[f]=e,c.Ew(a,d));d=c.cl(a);e=b.Xe(d);f=this.ca;e!==f&&(e=null!==f?c.wb(f.data):void 0,f=c.Mo,"function"===typeof f?f(a,e):a[f]=e,c.Gw(a,d));var h=c.Pj(a);if(0<h.length||0<this.ug.count){if(1===h.length&&1===this.ug.count&&(b=h[0],d=this.ug.first(),c.wb(d.data)===
b))return;var d=(new F).Td(h),k=new F;this.ug.each(function(a){null!==a.data&&(a=c.wb(a.data),void 0!==a&&k.add(a))});b=k.copy();b.jE(d);d=d.copy();d.jE(k);if(0<b.count||0<d.count)h.length=0,k.each(function(a){h.push(a)}),b.each(function(b){c.mE(a,b)}),d.each(function(b){c.Ly(a,b)})}}}}};
W.prototype.move=W.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);c=a.x-c;b=a.y-b;G.prototype.move.call(this,a);this.ll(c,b);for(a=this.ug;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};u.defineProperty(W,{QH:"relinkableFrom"},function(){return this.or},function(a){var b=this.or;b!==a&&(this.or=a,this.h("relinkableFrom",b,a),this.Zd())});
u.defineProperty(W,{RH:"relinkableTo"},function(){return this.pr},function(a){var b=this.pr;b!==a&&(this.pr=a,this.h("relinkableTo",b,a),this.Zd())});W.prototype.canRelinkFrom=function(){if(!this.QH)return!1;var a=this.layer;if(null===a)return!0;if(!a.mm)return!1;a=a.g;return null===a||a.mm?!0:!1};W.prototype.canRelinkTo=function(){if(!this.RH)return!1;var a=this.layer;if(null===a)return!0;if(!a.mm)return!1;a=a.g;return null===a||a.mm?!0:!1};
u.defineProperty(W,{it:"resegmentable"},function(){return this.qr},function(a){var b=this.qr;b!==a&&(this.qr=a,this.h("resegmentable",b,a),this.Zd())});u.defineProperty(W,{Bc:"isTreeLink"},function(){return this.sq},function(a){var b=this.sq;b!==a&&(this.sq=a,this.h("isTreeLink",b,a),null!==this.W&&Jk(this.W),null!==this.ca&&Jk(this.ca))});u.u(W,{path:"path"},function(){var a=this.If();return a instanceof X?a:null});
u.u(W,{Mm:"routeBounds"},function(){this.updateRoute();var a=new z;var b=Infinity,c=Infinity,d=this.ka;if(0===d)a.m(NaN,NaN,0,0);else{if(1===d)d=this.l(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.m(d.x,d.y,0,0);else if(2===d){var e=this.l(0),f=this.l(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y);a.m(e.x,e.y,0,0);a.Oi(f)}else if(this.computeCurve()===kh&&3<=d&&!this.dc)if(e=this.l(0),b=e.x,c=e.y,a.m(b,c,0,0),3===d)d=this.l(1),b=Math.min(d.x,b),c=Math.min(d.y,c),f=this.l(2),b=Math.min(f.x,b),c=Math.min(f.y,
c),K.oo(e.x,e.y,d.x,d.y,d.x,d.y,f.x,f.y,.5,a);else for(var h=3;h<d;h+=3){var k=this.l(h-2);h+3>=d&&(h=d-1);var l=this.l(h-1),f=this.l(h);K.oo(e.x,e.y,k.x,k.y,l.x,l.y,f.x,f.y,.5,a);b=Math.min(f.x,b);c=Math.min(f.y,c);e=f}else for(e=this.l(0),f=this.l(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.m(e.x,e.y,0,0),a.Oi(f),h=2;h<d;h++)e=this.l(h),b=Math.min(e.x,b),c=Math.min(e.y,c),a.Oi(e);this.Dy.m(b-a.x,c-a.y)}return this.py=a});u.u(W,{XD:"midPoint"},function(){this.updateRoute();return this.computeMidPoint(new w)});
W.prototype.computeMidPoint=function(a){var b=this.ka;if(0===b)return a.assign(K.gF),a;if(1===b)return a.assign(this.l(0)),a;if(2===b){var c=this.l(0),d=this.l(1);a.m((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===kh&&3<=b&&!this.dc){if(3===b)return this.l(1);var b=(b-1)/3|0,e=3*(b/2|0);1===b%2?(c=this.l(e),d=this.l(e+1),b=this.l(e+2),e=this.l(e+3),K.UF(c.x,c.y,d.x,d.y,b.x,b.y,e.x,e.y,a)):a.assign(this.l(e));return a}for(var e=0,f=u.eb(),h=0;h<b-1;h++)c=0,c=this.l(h),d=this.l(h+1),K.mb(c.x,
d.x)?(c=d.y-c.y,0>c&&(c=-c)):K.mb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Lj(d)),f.push(c),e+=c;for(d=h=c=0;c<e/2&&h<b;){d=f[h];if(c+d>e/2)break;c+=d;h++}u.ra(f);b=this.l(h);f=this.l(h+1);b.x===f.x?b.y>f.y?a.m(b.x,b.y-(e/2-c)):a.m(b.x,b.y+(e/2-c)):b.y===f.y?b.x>f.x?a.m(b.x-(e/2-c),b.y):a.m(b.x+(e/2-c),b.y):(e=(e/2-c)/d,a.m(b.x+e*(f.x-b.x),b.y+e*(f.y-b.y)));return a};u.u(W,{WD:"midAngle"},function(){this.updateRoute();return this.computeMidAngle()});
W.prototype.computeMidAngle=function(){var a=this.ka;if(2>a)return NaN;if(this.computeCurve()===kh&&4<=a&&!this.dc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),a=this.l(c),b=this.l(c+1),d=this.l(c+2),c=this.l(c+3);return K.TF(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0<c&&c+1<a)return a=this.l(c-1),b=this.l(c+1),a.Fi(b)}d=a/2|0;if(0===a%2)return a=this.l(d-1),b=this.l(d),a.Fi(b);var a=this.l(d-1),b=this.l(d),d=this.l(d+1),c=a.Lj(b),e=b.Lj(d);return c>e?a.Fi(b):b.Fi(d)};
u.defineProperty(W,{points:"points"},function(){return this.Qc},function(a){var b=this.Qc;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;e<a.length;e++)if("number"!==typeof a[e]||isNaN(a[e])){d=!1;break}if(d)for(c=new E(w),d=0;d<a.length/2;d++)e=(new w(a[2*d],a[2*d+1])).freeze(),c.add(e);else{for(var f=!0,d=0;d<a.length;d++)if(e=a[d],!u.Sa(e)||"number"!==typeof e.x||isNaN(e.x)||"number"!==typeof e.y||isNaN(e.y)){f=!1;break}if(f)for(c=new E(w),d=0;d<a.length;d++)e=
a[d],c.add((new w(e.x,e.y)).freeze());else u.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+a)}}else if(a instanceof E)for(c=a.copy(),a=c.i;a.next();)a.value.freeze();else u.k("Link.points value is not an instance of List or Array: "+a);c.freeze();this.Qc=c;this.le();yo(this);this.g&&this.g.Lb.ld&&(this.Xn=c);this.h("points",b,c)}});u.u(W,{ka:"pointsCount"},function(){return this.Qc.count});W.prototype.getPoint=W.prototype.l=function(a){return this.Qc.n[a]};
W.prototype.setPoint=W.prototype.yf=function(a,b){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.Bg(a,b)};W.prototype.setPointAt=W.prototype.V=function(a,b,c){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.Bg(a,new w(b,c))};W.prototype.insertPoint=function(a,b){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.Yd(a,b)};
W.prototype.insertPointAt=W.prototype.w=function(a,b,c){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.Yd(a,new w(b,c))};W.prototype.addPoint=W.prototype.Jh=function(a){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.add(a)};W.prototype.addPointAt=W.prototype.Lk=function(a,b){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.add(new w(a,b))};
W.prototype.removePoint=W.prototype.nE=function(a){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.hd(a)};W.prototype.clearPoints=W.prototype.so=function(){null===this.we&&u.k("Call Link.startRoute before modifying the points of the route.");this.Qc.clear()};
W.prototype.movePoints=W.prototype.ll=function(a,b){for(var c=new E(w),d=this.Qc.i;d.next();){var e=d.value;c.add((new w(e.x+a,e.y+b)).freeze())}c.freeze();d=this.Qc;this.Qc=c;this.le();yo(this);this.g&&this.g.Lb.ld&&(this.Xn=c);this.h("points",d,c)};W.prototype.startRoute=W.prototype.rl=function(){null===this.we&&(this.we=this.Qc,this.Qc=this.Qc.copy())};
W.prototype.commitRoute=W.prototype.Bi=function(){if(null!==this.we){for(var a=this.we,b=this.Qc,c=Infinity,d=Infinity,e=a.n,f=e.length,h=0;h<f;h++)var k=e[h],c=Math.min(k.x,c),d=Math.min(k.y,d);for(var l=Infinity,m=Infinity,n=b.n,p=n.length,h=0;h<p;h++)k=n[h],l=Math.min(k.x,l),m=Math.min(k.y,m),k.freeze();b.freeze();if(p===f)for(h=0;h<p;h++){if(f=e[h],k=n[h],f.x-c!==k.x-l||f.y-d!==k.y-m){this.le();break}}else this.le();this.we=null;this.g&&this.g.Lb.ld&&(this.Xn=b);yo(this);this.h("points",a,b)}};
W.prototype.rollbackRoute=W.prototype.WH=function(){null!==this.we&&(this.Qc=this.we,this.we=null)};function yo(a){0===a.Qc.count?a.hg=!1:(a.hg=!0,a.jn=a.l(0).copy(),a.nn=a.l(a.ka-1).copy(),zo(a,!1))}W.prototype.invalidateRoute=W.prototype.Vb=function(){if(!(this.zy||this.g&&this.g.ha.gb)){var a=this.path;null!==a&&(this.hg=!1,this.le(),a.R())}};u.defineProperty(W,{ip:null},function(){return this.zy},function(a){this.zy=a});
W.prototype.updateRoute=function(){if(!this.hg&&!this.jx){var a=!0;try{this.jx=!0,this.rl(),a=this.computePoints()}finally{this.jx=!1,a?this.Bi():this.WH()}}};
W.prototype.computePoints=function(){var a=this.g;if(null===a)return!1;var b=this.W,c=null;null===b?(a.Zl||(a.Xu=new X,a.Xu.xa=K.op,a.Xu.hb=0,a.Zl=new U,a.Zl.add(a.Xu),a.Zl.pf()),this.jn&&(a.Zl.position=a.Zl.location=this.jn,a.Zl.pf(),b=a.Zl,c=a.Xu)):c=this.od;if(null!==c){var d=Nl(c);d!==b&&b.Ea()?c=d:(d=b.findVisibleNode(),null!==d&&d!==b?(b=d,c=d.Xk("")):b=d)}this.oC=b;if(null===b||null===c||!b.location.J())return!1;var d=this.ca,e=null;null===d?(a.$l||(a.Yu=new X,a.Yu.xa=K.op,a.Yu.hb=0,a.$l=new U,
a.$l.add(a.Yu),a.$l.pf()),this.nn&&(a.$l.position=a.$l.location=this.nn,a.$l.pf(),d=a.$l,e=a.Yu)):e=this.fe;null!==e&&(a=Nl(e),a!==d&&d.Ea()?e=a:(a=d.findVisibleNode(),null!==a&&a!==d?(d=a,e=a.Xk("")):d=a));this.qC=d;if(null===d||null===e||!d.location.J())return!1;var a=this.ka,f=Ao(this,c),h=Bo(this,e),k=c===e&&null!==c,l=this.dc,m=this.Ve===kh;this.di=k&&!l?m=!0:!1;var n=this.es===dh||k;if(l||f!==vb||h!==vb||k){m=this.el;n&&(l&&m||k)&&this.so();var p=k?this.computeCurviness():0,q=this.getLinkPoint(b,
c,f,!0,l,d,e),r=0,s=0,t=0;if(l||f!==vb||k){var v=this.computeEndSegmentLength(b,c,f,!0),t=this.getLinkDirection(b,c,q,f,!0,l,d,e);k&&(t-=l?90:30,0>p&&(t-=180));0>t?t+=360:360<=t&&(t-=360);k&&(v+=Math.abs(p));0===t?r=v:90===t?s=v:180===t?r=-v:270===t?s=-v:(r=v*Math.cos(t*Math.PI/180),s=v*Math.sin(t*Math.PI/180));if(f.ne()&&k){var x=c.lb(Ib,u.K()),B=u.fc(x.x+1E3*r,x.y+1E3*s);this.getLinkPointFromPoint(b,c,x,B,!0,q);u.v(x);u.v(B)}}var v=this.getLinkPoint(d,e,h,!1,l,b,c),y=0,C=0,I=0;if(l||h!==vb||k)x=
this.computeEndSegmentLength(d,e,h,!1),I=this.getLinkDirection(d,e,v,h,!1,l,b,c),k&&(I+=l?0:30,0>p&&(I+=180)),0>I?I+=360:360<=I&&(I-=360),k&&(x+=Math.abs(p)),0===I?y=x:90===I?C=x:180===I?y=-x:270===I?C=-x:(y=x*Math.cos(I*Math.PI/180),C=x*Math.sin(I*Math.PI/180)),h.ne()&&k&&(x=e.lb(Ib,u.K()),B=u.fc(x.x+1E3*y,x.y+1E3*C),this.getLinkPointFromPoint(d,e,x,B,!1,v),u.v(x),u.v(B));e=q;if(l||f!==vb||k)e=new w(q.x+r,q.y+s);c=v;if(l||h!==vb||k)c=new w(v.x+y,v.y+C);!n&&!l&&f===vb&&3<a&&this.adjustPoints(0,q,
a-2,c)?this.yf(a-1,v):!n&&!l&&h===vb&&3<a&&this.adjustPoints(1,e,a-1,v)?this.yf(0,q):!n&&!l&&4<a&&this.adjustPoints(1,e,a-2,c)?(this.yf(0,q),this.yf(a-1,v)):!n&&l&&6<=a&&!m&&this.adjustPoints(1,e,a-2,c)?(this.yf(0,q),this.yf(a-1,v)):(this.so(),this.Jh(q),(l||f!==vb||k)&&this.Jh(e),l&&this.addOrthoPoints(e,t,c,I,b,d),(l||h!==vb||k)&&this.Jh(c),this.Jh(v))}else f=!1,!n&&3<=a&&(n=this.getLinkPoint(b,c,vb,!0,!1,d,e),h=this.getLinkPoint(d,e,vb,!1,!1,b,c),f=this.adjustPoints(0,n,a-1,h))&&(n=this.getLinkPoint(b,
c,vb,!0,!1,d,e),h=this.getLinkPoint(d,e,vb,!1,!1,b,c),this.adjustPoints(0,n,a-1,h)),f||(this.so(),m?(a=this.getLinkPoint(b,c,vb,!0,!1,d,e),n=this.getLinkPoint(d,e,vb,!1,!1,b,c),f=n.x-a.x,h=n.y-a.y,k=this.computeCurviness(),m=l=0,q=a.x+f/3,t=a.y+h/3,r=q,s=t,K.D(h,0)?s=0<f?s-k:s+k:(l=-f/h,m=Math.sqrt(k*k/(l*l+1)),0>k&&(m=-m),r=(0>h?-1:1)*m+q,s=l*(r-q)+t),q=a.x+2*f/3,t=a.y+2*h/3,v=q,y=t,K.D(h,0)?y=0<f?y-k:y+k:(v=(0>h?-1:1)*m+q,y=l*(v-q)+t),this.so(),this.Jh(a),this.Lk(r,s),this.Lk(v,y),this.Jh(n),this.yf(0,
this.getLinkPoint(b,c,vb,!0,!1,d,e)),this.yf(3,this.getLinkPoint(d,e,vb,!1,!1,b,c))):(a=d,d=this.getLinkPoint(b,c,vb,!0,!1,a,e),e=this.getLinkPoint(a,e,vb,!1,!1,b,c),this.hasCurviness()?(h=e.x-d.x,b=e.y-d.y,c=this.computeCurviness(),a=d.x+h/2,n=d.y+b/2,f=a,k=n,K.D(b,0)?k=0<h?k-c:k+c:(h=-h/b,f=Math.sqrt(c*c/(h*h+1)),0>c&&(f=-f),f=(0>b?-1:1)*f+a,k=h*(f-a)+n),this.Jh(d),this.Lk(f,k)):this.Jh(d),this.Jh(e)));return!0};
function Co(a,b){Math.abs(b.x-a.x)>Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b}
W.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new w);if(null===a||null===b)return f.assign(c),f;a.Ea()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.S;null===e||e.Tf()||(e=e.S);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.Ff;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Co(e,h,k,l,f);null!==
a&&f.transform(a);return f};function Do(a,b){var c=b.jr;null===c&&(c=new Eo,c.port=b,c.Cc=b.T,b.jr=c);return Fo(c,a)}
W.prototype.getLinkPoint=function(a,b,c,d,e,f,h,k){void 0===k&&(k=new w);if(c.pd())return b.lb(c,k),k;if(c.Go()&&(c=Do(this,b),null!==c)){k.assign(c.Lo);if(e&&this.zw===mo){var l=Do(this,h);if(c.vm<l.vm){c=u.K();var l=u.K(),m=new z(b.lb(xb,c),b.lb(Vb,l)),n=this.computeSpot(!d);a=this.getLinkPoint(f,h,n,!d,e,a,b,l);a.x>=m.x&&a.x<=m.x+m.width?k.x=a.x:a.y>=m.y&&a.y<=m.y+m.height&&(k.y=a.y);u.v(c);u.v(l)}}return k}f=b.lb(Ib,u.K());l=c=null;this.ka>(e?6:2)?(l=d?this.l(1):this.l(this.ka-2),e&&(l=Co(f,l.copy()))):
(c=u.K(),l=h.lb(Ib,c),e&&(l=Co(f,l)));this.getLinkPointFromPoint(a,b,f,l,d,k);u.v(f);null!==c&&u.v(c);return k};
W.prototype.getLinkDirection=function(a,b,c,d,e,f,h,k){a:if(d.pd())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x<d.y?d.x>1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5<d.x?45:0;else{if(d.Go()){var l=Do(this,b);if(null!==l)switch(l.ee){case u.Xc:c=270;break a;case u.Fc:c=180;break a;default:case u.Oc:c=0;break a;case u.Nc:c=90;break a}}var l=b.lb(Ib,u.K()),m=null,n=null;this.ka>(f?6:2)?(n=e?this.l(1):this.l(this.ka-2),n=f?Co(l,n.copy()):c):(m=u.K(),n=k.lb(Ib,m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y-l.y)?n.x>=
l.x?0:180:n.y>=l.y?90:270;u.v(l);null!==m&&u.v(m)}d.ne()&&h.Ph(a)&&(c+=180,360<=c&&(c-=360));a=Yn;a=e?this.Es:this.wt;a===Yn&&(a=e?b.Es:b.wt);switch(a){case Zn:b=b.Zk();c+=b;360<=c&&(c-=360);break;case Yn:case jl:b=b.Zk();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c};
W.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Go()&&(a=Do(this,b),null!==a))return a.Sv;a=NaN;a=d?this.Yk:this.vl;null!==b&&isNaN(a)&&(a=d?b.Yk:b.vl);isNaN(a)&&(a=10);return a};W.prototype.computeSpot=function(a){return a?Ao(this,this.od):Bo(this,this.fe)};function Ao(a,b){if(null===b)return Ib;var c=a.vb;c.Lc()&&(void 0===b&&(b=a.od),null!==b&&(c=b.vb));return c===uc?vb:c}
function Bo(a,b){if(null===b)return Ib;var c=a.xb;c.Lc()&&(void 0===b&&(b=a.fe),null!==b&&(c=b.xb));return c===uc?vb:c}W.prototype.computeOtherPoint=function(a,b){var c=b.lb(Ib),d;d=b.jr;d=null!==d?Fo(d,this):null;null!==d&&(c=d.Lo);return c};W.prototype.computeShortLength=function(a){return a?Go(this):Ho(this)};function Go(a){var b=a.Fs;isNaN(b)&&(a=a.od,null!==a&&(b=a.Fs));return isNaN(b)?0:b}function Ho(a){var b=a.yt;isNaN(b)&&(a=a.fe,null!==a&&(b=a.yt));return isNaN(b)?0:b}
W.prototype.Nj=function(a,b,c,d,e,f){if(!1===this.Ag)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=u.jh(),h.reset());h.multiply(this.transform);if(this.sm(a,h))return Um(this,b,c,e),void 0===f&&u.Ye(h),!0;if(this.sg(a,h)){var k=!1;if(!this.Kg)for(var l=this.ya.n,m=l.length;m--;){var n=l[m];if(n.visible||n===this.ec){var p=n.ba,q=this.Ha;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=u.jh();p.set(h);if(n instanceof A)k=n.Nj(a,b,c,d,e,p);else if(this.path===
n){var k=n,r=a,s=d,q=p;if(!1===k.Ag)k=!1;else if(q.multiply(k.transform),s)b:{var t=r,v=q;if(k.sm(t,v))k=!0;else{if(void 0===v&&(v=k.transform,t.Kj(k.ba))){k=!0;break b}var q=t.left,r=t.right,s=t.top,t=t.bottom,x=u.K(),B=u.K(),y=u.K(),C=u.jh();C.set(v);C.aE(k.transform);C.oz();B.x=r;B.y=s;B.transform(C);x.x=q;x.y=s;x.transform(C);v=!1;cn(k,x,B,y)?v=!0:(x.x=r,x.y=t,x.transform(C),cn(k,x,B,y)?v=!0:(B.x=q,B.y=t,B.transform(C),cn(k,x,B,y)?v=!0:(x.x=q,x.y=s,x.transform(C),cn(k,x,B,y)&&(v=!0))));u.Ye(C);
u.v(x);u.v(B);u.v(y);k=v}}else k=k.sm(r,q)}else k=ol(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&e.add(n));u.Ye(p)}}}void 0===f&&u.Ye(h);return k||null!==this.background||null!==this.nm}void 0===f&&u.Ye(h);return!1};u.u(W,{dc:"isOrthogonal"},function(){return 2===(this.Yl.value&2)});u.u(W,{el:"isAvoiding"},function(){return 4===(this.Yl.value&4)});W.prototype.computeCurve=function(){if(null===this.di){var a=this.od,b=this.dc;this.di=null!==a&&a===this.fe&&!b}return this.di?kh:this.Ve};
W.prototype.computeCorner=function(){if(this.Ve===kh)return 0;var a=this.Yy;if(isNaN(a)||0>a)a=10;return a};W.prototype.computeCurviness=function(){var a=this.Ov;if(isNaN(a)){var b=this.hf;if(0!==b){var a=10,c=this.g;null!==c&&(a=c.ow);c=Math.abs(b);a=a/2+((c-1)/2|0)*a;0===c%2&&(a=-a);0>b&&(a=-a)}else a=10}return a};W.prototype.computeThickness=function(){var a=this.path;return null!==a?Math.max(a.hb,1):1};W.prototype.hasCurviness=function(){return!isNaN(this.Ov)||0!==this.hf&&!this.dc};
W.prototype.adjustPoints=function(a,b,c,d){var e=this.es;if(this.dc){if(e===Vl)return!1;e===Wl&&(e=Ul)}switch(e){case Vl:var f=this.l(a),h=this.l(c);if(!f.L(b)||!h.L(d)){var e=f.x,f=f.y,k=h.x-e,l=h.y-f,m=Math.sqrt(k*k+l*l);if(!K.D(m,0)){var n=0;K.D(k,0)?n=0>l?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;K.D(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.yf(a,b);for(a+=
1;a<c;a++)b=this.l(a),k=b.x-e,l=b.y-f,b=Math.sqrt(k*k+l*l),K.D(b,0)||(q=0,K.D(k,0)?q=0>l?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.V(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.yf(c,d)}}return!0;case Wl:f=this.l(a);p=this.l(c);if(!f.L(b)||!p.L(d)){var e=f.x,f=f.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-f)*(p-f),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1,r=0!==l-k?(q-n)/(l-k):9E9;0!==r&&(s=Math.sqrt(1+1/(r*r)));this.yf(a,b);for(a+=1;a<c;a++){b=this.l(a);var t=b.x,v=b.y,x=.5;0!==m&&
(x=((e-t)*(e-h)+(f-v)*(f-p))/m);var B=e+x*(h-e),y=f+x*(p-f);b=Math.sqrt((t-B)*(t-B)+(v-y)*(v-y));v<r*(t-B)+y&&(b=-b);0<r&&(b=-b);t=k+x*(l-k);x=n+x*(q-n);0!==r?(b=t+b/s,this.V(a,b,x-(b-t)/r)):this.V(a,t,x+b)}this.yf(c,d)}return!0;case Ul:return this.dc&&(e=this.l(a),f=this.l(a+1),h=this.l(a+2),K.D(e.y,f.y)?K.D(f.x,h.x)?this.V(a+1,f.x,b.y):K.D(f.y,h.y)&&this.V(a+1,b.x,f.y):K.D(e.x,f.x)&&(K.D(f.y,h.y)?this.V(a+1,b.x,f.y):K.D(f.x,h.x)&&this.V(a+1,f.x,b.y)),e=this.l(c),f=this.l(c-1),h=this.l(c-2),K.D(e.y,
f.y)?K.D(f.x,h.x)?this.V(c-1,f.x,d.y):K.D(f.y,h.y)&&this.V(c-1,d.x,f.y):K.D(e.x,f.x)&&(K.D(f.y,h.y)?this.V(c-1,d.x,f.y):K.D(f.x,h.x)&&this.V(c-1,f.x,d.y))),this.yf(a,b),this.yf(c,d),!0;default:return!1}};
W.prototype.addOrthoPoints=function(a,b,c,d,e,f){b=-45<=b&&45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.ba.copy(),k=f.ba.copy();if(h.J()&&k.J()){h.Jf(8,8);k.Jf(8,8);h.Oi(a);k.Oi(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.y<a.y&&k.right>a.x||90===d&&c.y>a.y&&k.right>a.x)l=new w(c.x,a.y),m=new w(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x<k.left?this.computeMidOrthoPosition(a.x,
k.left,!1):a.x<k.right&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.x<k.left&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new w(a.x,c.y);m=new w((a.x+c.x)/2,c.y);if(180===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)180===d&&(k.Aa(a)||h.Aa(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(180===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,
k.bottom),!0):c.y>a.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x>=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new w(Math.max((a.x+c.x)/2,a.x),a.y),m=new w(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,0===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,0===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(180===b)if(c.x<a.x||270===d&&c.y<a.y&&k.left<a.x||
90===d&&c.y>a.y&&k.left<a.x)l=new w(c.x,a.y),m=new w(c.x,(a.y+c.y)/2),0===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,k.right,!1):a.x>k.left&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new w(a.x,c.y);m=new w((a.x+
c.x)/2,c.y);if(0===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)0===d&&(k.Aa(a)||h.Aa(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(0===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,k.bottom),!0):c.y>a.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x<=h.right&&c.x>=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l=new w(Math.min((a.x+c.x)/2,a.x),a.y),m=new w(l.x,c.y)}else l.y=270===
d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,180===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,180===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(90===b)if(c.y>a.y||180===d&&c.x<a.x&&k.bottom>a.y||0===d&&c.x>a.x&&k.bottom>a.y)l=new w(a.x,c.y),m=new w((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.y,c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>a.x?(l.y=a.y<k.top?this.computeMidOrthoPosition(a.y,k.top,!0):a.y<k.bottom&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?
this.computeMidOrthoPosition(a.y,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.y<k.top&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new w(c.x,a.y);m=new w(c.x,(a.y+c.y)/2);if(270===d||0===d&&c.x<h.left||180===d&&c.x>h.right)270===d&&(k.Aa(a)||h.Aa(c))?l.x=this.computeMidOrthoPosition(a.x,c.x,!1):c.x<a.x&&(270===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,
Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y>=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new w(a.x,Math.max((a.y+c.y)/2,a.y)),m=new w(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,90===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,90===d?h.right:Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}else if(c.y<a.y||180===d&&c.x<a.x&&k.top<a.y||0===d&&c.x>a.x&&k.top<a.y)l=new w(a.x,c.y),m=new w((a.x+c.x)/2,c.y),90===d?(l.y=this.computeMidOrthoPosition(a.y,
c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.y,k.bottom,!0):a.y>k.top&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new w(c.x,a.y);m=new w(c.x,(a.y+c.y)/2);if(90===d||0===d&&c.x<h.left||180===d&&c.x>h.right)90===d&&(k.Aa(a)||h.Aa(c))?l.x=this.computeMidOrthoPosition(a.x,
c.x,!1):c.x<a.x&&(90===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y<=h.bottom&&c.y>=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new w(a.x,Math.min((a.y+c.y)/2,a.y)),m=new w(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,270===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,270===d?h.right:Math.max(h.right,
k.right)),m.x=l.x,m.y=c.y}var n=l,p=m;if(this.el){var q=this.g,r;(r=null===q)||(q.Lb.Vg?r=!1:(r=q.Va,r=r instanceof uf?!r.jv||r.YG:!0),r=!r);if(r||h.Aa(c)&&!f.Ph(e)||k.Aa(a)&&!e.Ph(f)||e===f||this.layer.Ac)a=!1;else if(e=Lk(q,!0,this.Ra,null),e.Jo(Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&e.Jo(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&e.Jo(Math.min(p.x,c.x),Math.min(p.y,c.y),Math.abs(p.x-c.x),Math.abs(p.y-c.y)))a=!1;else if(h=h.copy().Sh(k),
h.Jf(2*e.ro,2*e.po),Io(e,a,b,c,d,h),k=Jo(e,c.x,c.y),e.abort||999999!==k||(Ok(e),k=e.KE,h.Jf(e.ro*k,e.po*k),Io(e,a,b,c,d,h),k=Jo(e,c.x,c.y)),e.abort||999999!==k||(Ok(e),k=e.SD,h.Jf(e.ro*k,e.po*k),Io(e,a,b,c,d,h),k=Jo(e,c.x,c.y)),!e.abort&&999999===k&&e.$E&&(Ok(e),Io(e,a,b,c,d,e.kb),k=Jo(e,c.x,c.y)),!e.abort&&999999>k&&0!==Jo(e,c.x,c.y)){Ko(this,e,c.x,c.y,d,!0);d=this.l(2);if(4>this.ka)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.V(2,d.x,d.y),this.w(3,d.x,d.y);else if(c=this.l(3),0===b||
180===b)K.D(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.V(2,b,a.y),this.V(3,b,c.y)):K.D(d.y,c.y)?(Math.abs(a.y-d.y)<=e.po/2&&(this.V(2,d.x,a.y),this.V(3,c.x,a.y)),this.w(2,d.x,a.y)):this.V(2,a.x,d.y);else if(90===b||270===b)K.D(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.V(2,a.x,b),this.V(3,c.x,b)):K.D(d.x,c.x)?(Math.abs(a.x-d.x)<=e.ro/2&&(this.V(2,a.x,d.y),this.V(3,a.x,c.y)),this.w(2,a.x,d.y)):this.V(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.Jh(l),this.Jh(m))}};
W.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function gg(a){if(!a.el)return!1;var b=a.points.n,c=b.length;if(4>c)return!1;a=Lk(a.g,!0,a.Ra,null);for(var d=1;d<c-2;d++){var e=b[d],f=b[d+1];if(!a.Jo(Math.min(e.x,f.x),Math.min(e.y,f.y),Math.abs(e.x-f.x),Math.abs(e.y-f.y)))return!0}return!1}
function Ko(a,b,c,d,e,f){var h=b.ro,k=b.po,l=Jo(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;1<l&&Jo(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,l-=1;if(f){if(1<l)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;1<l&&(f=e,m=c,n=d,0===e?(f=90,n+=k):90===e?(f=180,m-=h):180===e?(f=270,n-=k):270===e&&(f=0,m+=h),Jo(b,m,n)===l-1?Ko(a,b,m,n,f,!1):(m=c,n=d,0===e?(f=270,n-=k):90===
e?(f=0,m+=h):180===e?(f=90,n+=k):270===e&&(f=180,m-=h),Jo(b,m,n)===l-1&&Ko(a,b,m,n,f,!1)));a.Lk(c,d)}W.prototype.findClosestSegment=function(a){var b=a.x;a=a.y;for(var c=this.l(0),d=this.l(1),e=Xa(b,a,c.x,c.y,d.x,d.y),f=0,h=1;h<this.ka-1;h++){var c=this.l(h+1),k=Xa(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(f=h,e=k)}return f};W.prototype.invalidateGeometry=W.prototype.le=function(){this.Pa=null;this.R()};u.u(W,{dd:"geometry"},function(){null===this.Pa&&(this.updateRoute(),this.Pa=this.makeGeometry());return this.Pa});
W.prototype.Xs=function(){if(null===this.Pa&&!1!==this.hg){this.Pa=this.makeGeometry();var a=this.path;if(null!==a){a.Pa=this.Pa;for(var b=this.ya.n,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.tg&&e instanceof X&&(e.Pa=this.Pa)}}}};
W.prototype.makeGeometry=function(){var a=this.ka;if(2>a){var b=new $c(ad),c=new bd(0,0);b.ub.add(c);return b}var d=!1,b=this.g;null!==b&&0!==b.ha.Le&&xo(this)&&(d=!0);var c=b=0,e=this.l(0).copy(),f=e.copy(),b=this.Qc.n,h=this.computeCurve();if(h===kh&&3<=a&&!K.mb(this.gp,0))if(3===a)var k=this.l(1),b=Math.min(e.x,k.x),c=Math.min(e.y,k.y),k=this.l(2),b=Math.min(b,k.x),c=Math.min(c,k.y);else{if(this.dc)for(k=0;k<a;k++)c=b[k],f.x=Math.min(c.x,f.x),f.y=Math.min(c.y,f.y);else for(k=3;k<a;k+=3)k+3>=a&&
(k=a-1),b=this.l(k),f.x=Math.min(b.x,f.x),f.y=Math.min(b.y,f.y);b=f.x;c=f.y}else{for(k=0;k<a;k++)c=b[k],f.x=Math.min(c.x,f.x),f.y=Math.min(c.y,f.y);b=f.x;c=f.y}b-=this.Dy.x;c-=this.Dy.y;e.x-=b;e.y-=c;if(2===a){var l=this.l(1).copy();l.x-=b;l.y-=c;0!==Go(this)&&Lo(this,e,!0,f);0!==Ho(this)&&Lo(this,l,!1,f);b=new $c(dd);b.ua=e.x;b.va=e.y;b.F=l.x;b.G=l.y}else{l=u.p();0!==Go(this)&&Lo(this,e,!0,f);M(l,e.x,e.y,!1,!1);if(h===kh&&3<=a&&!K.mb(this.gp,0))if(3===a)k=this.l(1),a=k.x-b,d=k.y-c,k=this.l(2).copy(),
k.x-=b,k.y-=c,0!==Ho(this)&&Lo(this,k,!1,f),O(l,a,d,a,d,k.x,k.y);else if(this.dc){for(var f=new w(b,c),e=this.l(1).copy(),h=new w(b,c),a=new w(b,c),d=this.l(0),m=null,n=this.gp/3,k=1;k<this.ka-1;k++){var m=this.l(k),p=d,q=m,r=this.l(Mo(this,m,k,!1));if(!K.mb(p.x,q.x)||!K.mb(q.x,r.x))if(!K.mb(p.y,q.y)||!K.mb(q.y,r.y)){var s=n,t=h,v=a;isNaN(s)&&(s=this.gp/3);var x=p.x,p=p.y,B=q.x,q=q.y,y=r.x,r=r.y,C=s*No(x,p,B,q),s=s*No(B,q,y,r);K.mb(p,q)&&K.mb(B,y)&&(B>x?r>q?(t.x=B-C,t.y=q-C,v.x=B+s,v.y=q+s):(t.x=
B-C,t.y=q+C,v.x=B+s,v.y=q-s):r>q?(t.x=B+C,t.y=q-C,v.x=B-s,v.y=q+s):(t.x=B+C,t.y=q+C,v.x=B-s,v.y=q-s));K.mb(x,B)&&K.mb(q,r)&&(q>p?(y>B?(t.x=B-C,t.y=q-C,v.x=B+s):(t.x=B+C,t.y=q-C,v.x=B-s),v.y=q+s):(y>B?(t.x=B-C,t.y=q+C,v.x=B+s):(t.x=B+C,t.y=q+C,v.x=B-s),v.y=q-s));if(K.mb(x,B)&&K.mb(B,y)||K.mb(p,q)&&K.mb(q,r))x=.5*(x+y),p=.5*(p+r),t.x=x,t.y=p,v.x=x,v.y=p;1===k?(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y)):2===k&&K.mb(d.x,this.l(0).x)&&K.mb(d.y,this.l(0).y)&&(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y));O(l,e.x-b,e.y-c,
h.x-b,h.y-c,m.x-b,m.y-c);f.set(h);e.set(a);d=m}}k=d.x;d=d.y;f=this.l(this.ka-1);k=.5*(k+f.x);d=.5*(d+f.y);O(l,a.x-b,a.y-c,k-b,d-c,f.x-b,f.y-c)}else for(k=3;k<a;k+=3)d=this.l(k-2),k+3>=a&&(k=a-1),f=this.l(k-1),e=this.l(k),k===a-1&&0!==Ho(this)&&(e=e.copy(),Lo(this,e,!1,K.Wj)),O(l,d.x-b,d.y-c,f.x-b,f.y-c,e.x-b,e.y-c);else{f=u.K();f.assign(this.l(0));for(k=1;k<a;){k=Mo(this,f,k,1<k);t=this.l(k);if(k>=a-1){f!==t&&(0!==Ho(this)&&(t=t.copy(),Lo(this,t,!1,K.Wj)),Oo(this,l,-b,-c,f,t,d));break}k=Mo(this,t,
k+1,k<a-3);e=l;h=-b;m=-c;n=f;v=this.l(k);x=f;p=d;K.D(n.y,t.y)&&K.D(t.x,v.x)?(s=this.computeCorner(),s=Math.min(s,Math.abs(t.x-n.x)/2),s=B=Math.min(s,Math.abs(v.y-t.y)/2),K.D(s,0)?(Oo(this,e,h,m,n,t,p),x.assign(t)):(q=t.x,y=t.y,r=q,C=y,q=t.x>n.x?t.x-s:t.x+s,C=v.y>t.y?t.y+B:t.y-B,Oo(this,e,h,m,n,new w(q,y),p),td(e,t.x+h,t.y+m,r+h,C+m),x.m(r,C))):K.D(n.x,t.x)&&K.D(t.y,v.y)?(s=this.computeCorner(),B=Math.min(s,Math.abs(t.y-n.y)/2),B=s=Math.min(B,Math.abs(v.x-t.x)/2),K.D(s,0)?(Oo(this,e,h,m,n,t,p),x.assign(t)):
(q=t.x,C=y=t.y,y=t.y>n.y?t.y-B:t.y+B,r=v.x>t.x?t.x+s:t.x-s,Oo(this,e,h,m,n,new w(q,y),p),td(e,t.x+h,t.y+m,r+h,C+m),x.m(r,C))):(Oo(this,e,h,m,n,t,p),x.assign(t))}u.v(f)}b=l.o;u.q(l)}return b};function No(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return K.mb(a,0)?b:K.mb(b,0)?a:Math.sqrt(a*a+b*b)}
function Lo(a,b,c,d){var e=a.ka;if(!(2>e))if(c){var f=a.l(1);c=f.x-d.x;d=f.y-d.y;f=No(b.x,b.y,c,d);0!==f&&(e=2===e?.5*f:f,a=Go(a),a>e&&(a=e),c=a*(c-b.x)/f,a=a*(d-b.y)/f,b.x+=c,b.y+=a)}else f=a.l(e-2),c=f.x-d.x,d=f.y-d.y,f=No(b.x,b.y,c,d),0!==f&&(e=2===e?.5*f:f,a=Ho(a),a>e&&(a=e),c=a*(b.x-c)/f,a=a*(b.y-d)/f,b.x-=c,b.y-=a)}
function Mo(a,b,c,d){for(var e=a.ka,f=b;K.mb(b.x,f.x)&&K.mb(b.y,f.y);){if(c>=e)return e-1;f=a.l(c++)}if(!K.mb(b.x,f.x)&&!K.mb(b.y,f.y))return c-1;for(var h=f;K.mb(b.x,f.x)&&K.mb(f.x,h.x)&&(!d||(b.y>=f.y?f.y>=h.y:f.y<=h.y))||K.mb(b.y,f.y)&&K.mb(f.y,h.y)&&(!d||(b.x>=f.x?f.x>=h.x:f.x<=h.x));){if(c>=e)return e-1;h=a.l(c++)}return c-2}
function Oo(a,b,c,d,e,f,h){if(!h&&xo(a)){h=[];var k=0;a.Ea()&&(k=Po(a,e,f,h));var l=e.x,l=e.y;if(0<k)if(K.D(e.y,f.y))if(e.x<f.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h[m++]-5,f.x-10));b.lineTo(n+c,f.y+d);for(var l=n+c,p=Math.min(n+10,f.x);m<k;){var q=h[m];if(q<p+10)m++,p=Math.min(q+5,f.x);else break}q=(n+p)/2+c;q=f.y-10+d;n=p+c;p=f.y+d;a.Ve===ch?M(b,n,p,!1,!1):O(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h[m--]+5,f.x+10));b.lineTo(n+c,f.y+d);l=n+c;for(p=Math.max(n-10,f.x);0<=
m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,f.x);else break;q=f.y-10+d;n=p+c;p=f.y+d;a.Ve===ch?M(b,n,p,!1,!1):O(b,l,q,n,q,n,p)}else if(K.D(e.x,f.x))if(e.y<f.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h[m++]-5,f.y-10));b.lineTo(f.x+c,n+d);l=n+d;for(p=Math.min(n+10,f.y);m<k;)if(q=h[m],q<p+10)m++,p=Math.min(q+5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.Ve===ch?M(b,n,p,!1,!1):O(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h[m--]+5,f.y+10));b.lineTo(f.x+c,n+d);l=n+d;for(p=Math.max(n-10,f.y);0<=
m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.Ve===ch?M(b,n,p,!1,!1):O(b,q,l,q,p,n,p)}}b.lineTo(f.x+c,f.y+d)}
function Po(a,b,c,d){var e=a.g;if(null===e||b.L(c))return 0;for(e=e.mw;e.next();){var f=e.value;if(null!==f&&f.visible)for(var f=f.Db.n,h=f.length,k=0;k<h;k++){var l=f[k];if(l instanceof W){if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l.Ea()&&xo(l)){var m=l.Mm;m.J()&&a.Mm.sg(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.kl()&&Qo(b,c,d,l))}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
function Qo(a,b,c,d){for(var e=K.D(a.y,b.y),f=d.ka,h=d.l(0),k=u.K(),l=1;l<f;l++){var m=d.l(l);if(l<f-1){var n=d.l(l+1);if(h.y===m.y&&m.y===n.y){if(m.x>h.x&&n.x>m.x||m.x<h.x&&n.x<m.x)m=n,l++}else h.x===m.x&&m.x===n.x&&(m.y>h.y&&n.y>m.y||m.y<h.y&&n.y<m.y)&&(m=n,l++)}a:{var n=k,p=a.x,q=a.y,r=b.x,s=b.y,t=h.x,h=h.y,v=m.x,x=m.y;if(!K.D(p,r)){if(K.D(q,s)&&K.D(t,v)&&Math.min(p,r)<t&&Math.max(p,r)>t&&Math.min(h,x)<q&&Math.max(h,x)>q&&!K.D(h,x)){n.x=t;n.y=q;n=!0;break a}}else if(!K.D(q,s)&&K.D(h,x)&&Math.min(q,
s)<h&&Math.max(q,s)>h&&Math.min(t,v)<p&&Math.max(t,v)>p&&!K.D(t,v)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}u.v(k)}u.u(W,{Bs:"firstPickIndex"},function(){return 2>=this.ka?0:this.dc||Ao(this)!==vb?1:0});u.u(W,{lw:"lastPickIndex"},function(){var a=this.ka;return 0===a?0:2>=a?a-1:this.dc||Bo(this)!==vb?a-2:a-1});function xo(a){a=a.Ve;return a===bh||a===ch}function zo(a,b){if(b||xo(a)){var c=a.g;null===c||c.El.contains(a)||null===a.py||c.El.add(a,a.py)}}
function eh(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Ac){var d=c.g;if(null!==d)for(var e=!1,d=d.mw;d.next();){var f=d.value;if(f.visible)if(f===c)for(var e=!0,h=!1,f=f.Db.n,k=f.length,l=0;l<k;l++){var m=f[l];m instanceof W&&(m===a?h=!0:h&&Ro(a,m,b))}else if(e)for(f=f.Db.n,k=f.length,l=0;l<k;l++)m=f[l],m instanceof W&&Ro(a,m,b)}}}function Ro(a,b,c){if(null!==b&&null!==b.Pa&&xo(b)){var d=b.Mm;d.J()&&(a.Mm.sg(d)||c.sg(d))&&(a.usesSamePort(b)||b.le())}}
W.prototype.usesSamePort=function(a){var b=this.ka,c=a.ka;if(0<b&&0<c){var d=this.l(0),e=a.l(0);if(d.De(e))return!0;b=this.l(b-1);a=a.l(c-1);if(b.De(a)||d.De(a)||b.De(e))return!0}else if(this.W===a.W||this.ca===a.ca||this.W==a.ca||this.ca==a.W)return!0;return!1};W.prototype.He=function(a){G.prototype.He.call(this,a);if(null!==this.ue)for(var b=this.ue.i;b.next();)b.value.He(a)};
u.defineProperty(W,{es:"adjusting"},function(){return this.tp},function(a){var b=this.tp;b!==a&&(this.tp=a,this.h("adjusting",b,a))});u.defineProperty(W,{Yy:"corner"},function(){return this.Hp},function(a){var b=this.Hp;b!==a&&(this.Hp=a,this.le(),this.h("corner",b,a))});u.defineProperty(W,{Ve:"curve"},function(){return this.Kp},function(a){var b=this.Kp;b!==a&&(this.Kp=a,this.Vb(),zo(this,b===ch||b===bh||a===ch||a===bh),this.h("curve",b,a))});
u.defineProperty(W,{Ov:"curviness"},function(){return this.Lp},function(a){var b=this.Lp;b!==a&&(this.Lp=a,this.Vb(),this.h("curviness",b,a))});u.defineProperty(W,{zw:"routing"},function(){return this.Yl},function(a){var b=this.Yl;b!==a&&(this.Yl=a,this.di=null,this.Vb(),zo(this,2===(b.value&2)||2===(a.value&2)),this.h("routing",b,a))});u.defineProperty(W,{gp:"smoothness"},function(){return this.Kr},function(a){var b=this.Kr;b!==a&&(this.Kr=a,this.le(),this.h("smoothness",b,a))});
function vo(a){var b=a.Wf;if(null!==b){var c=a.gg;if(null!==c){var d=a.wh,e=a.Ih;a:{if(null!==c&&null!==b.nh)for(a=b.nh.i;a.next();){var f=a.value;if(f.Uo===b&&f.at===c&&f.uw===d&&f.vw===e||f.Uo===c&&f.at===b&&f.uw===e&&f.vw===d){a=f;break a}}a=null}for(var h=null,k=null,l=b.hc.n,m=l.length,f=0;f<m;f++){var n=l[f];if(n.Wf===b&&n.wh===d&&n.gg===c&&n.Ih===e||n.Wf===c&&n.wh===e&&n.gg===b&&n.Ih===d)null===k?k=n:(null===h&&(h=new E(W),h.add(k)),h.add(n))}if(null!==h)for(null===a&&(a=new bo,a.Uo=b,a.uw=
d,a.at=c,a.vw=e,ao(b,a),ao(c,a)),a.links=h,b=h.n,f=0;f<b.length;f++)if(n=b[f],0===n.hf){c=1;for(d=0;d<b.length;d++)Math.abs(b[d].hf)===c&&(c++,d=-1);n.an=a;n.hf=n.W===a.Uo?c:-c;c=n.g;(null===c||c.lf)&&n.Vb()}}}}
function uo(a){var b=a.an;if(null!==b){var c=a.hf;a.an=null;a.hf=0;b.links.remove(a);if(2>b.links.count)1===b.links.count&&(c=b.links.n[0],c.an=null,c.hf=0,c.Vb()),c=b.Uo,null!==b&&null!==c.nh&&c.nh.remove(b),c=b.at,null!==b&&null!==c.nh&&c.nh.remove(b);else for(c=Math.abs(c),a=0===c%2,b=b.links.i;b.next();){var d=b.value,e=Math.abs(d.hf),f=0===e%2;e>c&&a===f&&(d.hf=0<d.hf?d.hf-2:d.hf+2,d.Vb())}}}function bo(){u.gc(this);this.links=this.vw=this.at=this.uw=this.Uo=null}
u.Xd(bo,{Uo:!0,uw:!0,at:!0,vw:!0,links:!0,spacing:!0});function Mk(){u.gc(this);this.fA=this.group=null;this.Ls=!0;this.abort=!1;this.bg=this.ag=1;this.Jq=this.Iq=-1;this.he=this.ge=8;this.mc=null;this.$E=!1;this.KE=22;this.SD=111}u.Xd(Mk,{group:!0,fA:!0,Ls:!0,abort:!0,$E:!0,KE:!0,SD:!0});
Mk.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.ag=Math.floor((a.x-this.ge)/this.ge)*this.ge;this.bg=Math.floor((b-this.he)/this.he)*this.he;this.Iq=Math.ceil((c+2*this.ge)/this.ge)*this.ge;this.Jq=Math.ceil((d+2*this.he)/this.he)*this.he;a=1+(Math.ceil((this.Iq-this.ag)/this.ge)|0);b=1+(Math.ceil((this.Jq-this.bg)/this.he)|0);if(null===this.mc||this.ho<a-1||this.io<b-1){c=[];for(d=0;d<=a;d++){for(var e=[],f=0;f<=b;f++)e[f]=0;c[d]=e}this.mc=
c;this.ho=a-1;this.io=b-1}if(null!==this.mc)for(a=0;a<=this.ho;a++)for(b=0;b<=this.io;b++)this.mc[a][b]=999999}};u.u(Mk,{kb:null},function(){return new z(this.ag,this.bg,this.Iq-this.ag,this.Jq-this.bg)});u.defineProperty(Mk,{ro:null},function(){return this.ge},function(a){0<a&&a!==this.ge&&(this.ge=a,this.initialize(this.kb))});u.defineProperty(Mk,{po:null},function(){return this.he},function(a){0<a&&a!==this.he&&(this.he=a,this.initialize(this.kb))});
function So(a,b,c){return a.ag<=b&&b<=a.Iq&&a.bg<=c&&c<=a.Jq}function Jo(a,b,c){if(!So(a,b,c))return 0;b-=a.ag;b/=a.ge;c-=a.bg;c/=a.he;return a.mc[b|0][c|0]}function Pk(a,b,c){So(a,b,c)&&(b-=a.ag,b/=a.ge,c-=a.bg,c/=a.he,a.mc[b|0][c|0]=0)}function Ok(a){if(null!==a.mc)for(var b=0;b<=a.ho;b++)for(var c=0;c<=a.io;c++)1<=a.mc[b][c]&&(a.mc[b][c]|=999999)}
Mk.prototype.Jo=function(a,b,c,d){if(a>this.Iq||a+c<this.ag||b>this.Jq||b+d<this.bg)return!0;a=(a-this.ag)/this.ge|0;b=(b-this.bg)/this.he|0;c=Math.max(0,c)/this.ge+1|0;var e=Math.max(0,d)/this.he+1|0;0>a&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.ho)|0;for(c=Math.min(b+e-1,this.io)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.mc[a][e])return!1;return!0};
function To(a,b,c,d,e,f,h,k,l){if(!(b<f||b>h||c<k||c>l)){var m,n;m=b|0;n=c|0;var p=a.mc[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;f<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.mc[m][n]);)a.mc[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0<d)for(c+=d;c<m;c+=d)To(a,b,c,1,!e,f,h,k,l),To(a,b,c,-1,!e,f,h,k,l);else for(c+=d;c>m;c+=d)To(a,b,c,1,!e,f,h,k,l),To(a,b,c,-1,!e,f,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)To(a,b,c,1,!e,f,h,k,l),To(a,b,c,-1,!e,f,h,k,l);else for(b+=d;b>m;b+=d)To(a,b,c,1,!e,f,h,k,l),To(a,b,c,-1,!e,f,h,
k,l)}}function Uo(a,b,c,d,e,f,h,k,l,m,n){for(var p=b|0,q=c|0,r=a.mc[p][q];0===r&&p>k&&p<l&&q>m&&q<n;)if(h?q+=f:p+=f,r=a.mc[p][q],1>=Math.abs(p-d)&&1>=Math.abs(q-e))return a.abort=!0,0;p=b|0;q=c|0;r=a.mc[p][q];b=1;for(a.mc[p][q]=b;0===r&&p>k&&p<l&&q>m&&q<n;)h?q+=f:p+=f,r=a.mc[p][q],a.mc[p][q]=b,b+=1;return h?q:p}
function Io(a,b,c,d,e,f){if(null!==a.mc){a.abort=!1;var h=b.x,k=b.y;if(So(a,h,k)){var h=h-a.ag,h=h/a.ge,k=k-a.bg,k=k/a.he,l=d.x,m=d.y;if(So(a,l,m))if(l-=a.ag,l/=a.ge,m-=a.bg,m/=a.he,1>=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;b=f.y;d=f.x+f.width;var p=f.y+f.height,n=n-a.ag,n=n/a.ge;b-=a.bg;b/=a.he;d-=a.ag;d/=a.ge;p-=a.bg;p/=a.he;f=Math.max(0,Math.min(a.ho,n|0));d=Math.min(a.ho,Math.max(0,d|0));b=Math.max(0,Math.min(a.io,b|0));var p=Math.min(a.io,Math.max(0,p|0)),h=h|0,k=k|0,l=l|0,
m=m|0,n=h,q=k,r=0===c||90===c?1:-1;(c=90===c||270===c)?q=Uo(a,h,k,l,m,r,c,f,d,b,p):n=Uo(a,h,k,l,m,r,c,f,d,b,p);if(!a.abort){a:{c=0===e||90===e?1:-1;e=90===e||270===e;for(var r=l|0,s=m|0,t=a.mc[r][s];0===t&&r>f&&r<d&&s>b&&s<p;)if(e?s+=c:r+=c,t=a.mc[r][s],1>=Math.abs(r-h)&&1>=Math.abs(s-k)){a.abort=!0;break a}r=l|0;s=m|0;t=a.mc[r][s];for(a.mc[r][s]=999999;0===t&&r>f&&r<d&&s>b&&s<p;)e?s+=c:r+=c,t=a.mc[r][s],a.mc[r][s]=999999}a.abort||(To(a,n,q,1,!1,f,d,b,p),To(a,n,q,-1,!1,f,d,b,p),To(a,n,q,1,!0,f,d,
b,p),To(a,n,q,-1,!0,f,d,b,p))}}}}}function Eo(){u.gc(this);this.port=this.Cc=null;this.wg=[];this.To=!1}u.Xd(Eo,{Cc:!0,port:!0,wg:!0,To:!0});Eo.prototype.toString=function(){for(var a=this.wg,b=this.Cc.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n  "+d.toString())}return b};
function Vo(a,b,c,d){b=b.offsetY;switch(b){case u.Nc:return 90;case u.Fc:return 180;case u.Xc:return 270;case u.Oc:return 0}switch(b){case u.Nc|u.Xc:return 180<c?270:90;case u.Fc|u.Oc:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case u.Fc|u.Xc:return c>a&&c<=180+a?180:270;case u.Xc|u.Oc:return c>180-a&&c<=360-a?270:0;case u.Oc|u.Nc:return c>a&&c<=180+a?90:0;case u.Nc|u.Fc:return c>180-a&&c<=360-a?180:90;case u.Fc|u.Xc|u.Oc:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
a?270:0;case u.Xc|u.Oc|u.Nc:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case u.Oc|u.Nc|u.Fc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case u.Nc|u.Fc|u.Xc:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(u.Fc|u.Xc|u.Oc|u.Nc)&&(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}
function Fo(a,b){var c=a.wg;if(0===c.length){a:if(!a.To){c=a.To;a.To=!0;var d,e=null,f=a.Cc,f=f instanceof V?f:null;if(null===f||f.be)d=a.Cc.qD(a.port.Jd);else{if(!f.ba.J()){a.To=c;break a}e=f;d=e.pD()}var h=a.wg.length=0,k=a.port.lb(xb,u.K()),l=a.port.lb(Vb,u.K()),f=u.Vj(k.x,k.y,0,0);f.Oi(l);u.v(k);u.v(l);k=u.fc(f.x+f.width/2,f.y+f.height/2);for(d=d.i;d.next();)if(l=d.value,l.Ea()){var m=vb,n=l.od===a.port||l.W.Ph(e),m=n?Ao(l,a.port):Bo(l,a.port);if(m.Go()&&(n=n?l.fe:l.od,null!==n)){var p=n.T;if(null!==
p){var n=l.computeOtherPoint(p,n),p=k.Fi(n),m=Vo(f,m,p,l.dc),q=0;0===m?(q=u.Oc,180<p&&(p-=360)):q=90===m?u.Nc:180===m?u.Fc:u.Xc;m=a.wg[h];void 0===m?(m=new Wo(l,p,q),a.wg[h]=m):(m.link=l,m.angle=p,m.ee=q);m.tw.set(n);h++}}}u.v(k);a.wg.sort(Eo.prototype.GH);e=a.wg.length;k=-1;for(h=d=0;h<e;h++)m=a.wg[h],void 0!==m&&(m.ee!==k&&(k=m.ee,d=0),m.Do=d,d++);k=-1;d=0;for(h=e-1;0<=h;h--)m=a.wg[h],void 0!==m&&(m.ee!==k&&(k=m.ee,d=m.Do+1),m.vm=d);h=a.wg;n=a.port;e=a.Cc.NH;k=u.K();d=u.K();l=u.K();m=u.K();n.lb(xb,
k);n.lb(Gb,d);n.lb(Vb,l);n.lb(Kb,m);var r=q=p=n=0;if(e===$n)for(var s=0;s<h.length;s++){var t=h[s];if(null!==t){var v=t.link.computeThickness();switch(t.ee){case u.Nc:q+=v;break;case u.Fc:r+=v;break;case u.Xc:n+=v;break;default:case u.Oc:p+=v}}}for(var x=0,B=0,y=1,s=0;s<h.length;s++)if(t=h[s],null!==t){var C,I;if(x!=t.ee){x=t.ee;switch(x){case u.Nc:C=l;I=m;break;case u.Fc:C=m;I=k;break;case u.Xc:C=k;I=d;break;default:case u.Oc:C=d,I=l}var H=I.x-C.x;I=I.y-C.y;switch(x){case u.Nc:q>Math.abs(H)?(y=Math.abs(H)/
q,q=Math.abs(H)):y=1;break;case u.Fc:r>Math.abs(I)?(y=Math.abs(I)/r,r=Math.abs(I)):y=1;break;case u.Xc:n>Math.abs(H)?(y=Math.abs(H)/n,n=Math.abs(H)):y=1;break;default:case u.Oc:p>Math.abs(I)?(y=Math.abs(I)/p,p=Math.abs(I)):y=1}B=0}var T=t.Lo;if(e===$n){v=t.link.computeThickness();v*=y;T.set(C);switch(x){case u.Nc:T.x=C.x+H/2+q/2-B-v/2;break;case u.Fc:T.y=C.y+I/2+r/2-B-v/2;break;case u.Xc:T.x=C.x+H/2-n/2+B+v/2;break;default:case u.Oc:T.y=C.y+I/2-p/2+B+v/2}B+=v}else v=.5,e===Xn&&(v=(t.Do+1)/(t.vm+1)),
T.x=C.x+H*v,T.y=C.y+I*v}u.v(k);u.v(d);u.v(l);u.v(m);C=a.wg;for(H=0;H<C.length;H++)I=C[H],null!==I&&(I.Sv=a.computeEndSegmentLength(I));a.To=c;u.ic(f)}c=a.wg}for(f=0;f<c.length;f++)if(C=c[f],null!==C&&C.link===b)return C;return null}Eo.prototype.GH=function(a,b){return a===b?0:null===a?-1:null===b?1:a.ee<b.ee?-1:a.ee>b.ee?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
Eo.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Cc,this.port,vb,b.od===this.port),d=a.Do;if(0>d)return c;var e=a.vm;if(1>=e||!b.dc)return c;var b=a.tw,f=a.Lo;if(a.ee===u.Fc||a.ee===u.Nc)d=e-1-d;return((a=a.ee===u.Fc||a.ee===u.Oc)?b.y<f.y:b.x<f.x)?c+8*d:(a?b.y===f.y:b.x===f.x)?c:c+8*(e-1-d)};function Wo(a,b,c){this.link=a;this.angle=b;this.ee=c;this.tw=new w;this.vm=this.Do=0;this.Lo=new w;this.Sv=0}
u.Xd(Wo,{link:!0,angle:!0,ee:!0,tw:!0,Do:!0,vm:!0,Lo:!0,Sv:!0});Wo.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.ee.toString()+":"+this.Do.toString()+"/"+this.vm.toString()+" "+this.Lo.toString()+" "+this.Sv.toString()+" "+this.tw.toString()};function il(){this.Ej=this.cj=uc;this.Cj=this.aj=NaN;this.Bj=this.$i=Yn;this.Dj=this.bj=NaN}
il.prototype.copy=function(){var a=new il;a.cj=this.cj.Z();a.Ej=this.Ej.Z();a.aj=this.aj;a.Cj=this.Cj;a.$i=this.$i;a.Bj=this.Bj;a.bj=this.bj;a.Dj=this.Dj;return a};function V(a){0===arguments.length?U.call(this,vh):U.call(this,a);this.Lq=new F(G);this.Pn=new F(V);this.Ak=this.Mq=this.Kq=null;this.Yr=!1;this.pq=!0;this.Zr=!1;this.Pb=this.Nr=null;this.Dp=!1;this.Ep=!0;this.cq=this.Fp=!1;this.Nd=new Je;this.Nd.group=this;this.jy=!1}u.Ga(V,U);u.fa("Group",V);
V.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.Kq=this.Kq;a.Mq=this.Mq;a.Ak=this.Ak;a.Yr=this.Yr;a.pq=this.pq;a.Zr=this.Zr;a.Nr=this.Nr;var b=a.vs(function(a){return a instanceof ph});a.Pb=b instanceof ph?b:null;a.Dp=this.Dp;a.Ep=this.Ep;a.Fp=this.Fp;a.cq=this.cq;null!==this.Nd?(a.Nd=this.Nd.copy(),a.Nd.group=a):(null!==a.Nd&&(a.Nd.group=null),a.Nd=null)};
V.prototype.Mh=function(a){U.prototype.Mh.call(this,a);var b=a.yo();for(a=a.Mc;a.next();){var c=a.value;c.R();c.H(8);c.ls();if(c instanceof U)c.sf(b);else if(c instanceof W)for(c=c.ug;c.next();)c.value.sf(b)}};
V.prototype.Lm=function(a,b,c,d,e,f,h){if(a===be&&"elements"===b)if(e instanceof ph){var k=e;null===this.Pb?this.Pb=k:this.Pb!==k&&u.k("Cannot insert a second Placeholder into the visual tree of a Group.")}else e instanceof A&&(k=e.vs(function(a){return a instanceof ph}),k instanceof ph&&(null===this.Pb?this.Pb=k:this.Pb!==k&&u.k("Cannot insert a second Placeholder into the visual tree of a Group.")));else a===ce&&"elements"===b&&null!==this.Pb&&(d===this.Pb?this.Pb=null:d instanceof A&&this.Pb.gl(d)&&
(this.Pb=null));U.prototype.Lm.call(this,a,b,c,d,e,f,h)};V.prototype.xi=function(a,b,c,d){this.zk=this.Pb;A.prototype.xi.call(this,a,b,c,d)};V.prototype.hl=function(){if(!U.prototype.hl.call(this))return!1;for(var a=this.Mc;a.next();){var b=a.value;if(b instanceof U){if(b.Ea()&&Bj(b))return!1}else if(b instanceof W&&b.Ea()&&Bj(b)&&b.W!==this&&b.ca!==this)return!1}return!0};u.u(V,{placeholder:"placeholder"},function(){return this.Pb});
u.defineProperty(V,{aD:"computesBoundsAfterDrag"},function(){return this.Dp},function(a){var b=this.Dp;b!==a&&(u.j(a,"boolean",V,"computesBoundsAfterDrag"),this.Dp=a,this.h("computesBoundsAfterDrag",b,a))});u.defineProperty(V,{bG:"computesBoundsIncludingLinks"},function(){return this.Ep},function(a){u.j(a,"boolean",V,"computesBoundsIncludingLinks");var b=this.Ep;b!==a&&(this.Ep=a,this.h("computesBoundsIncludingLinks",b,a))});
u.defineProperty(V,{cG:"computesBoundsIncludingLocation"},function(){return this.Fp},function(a){u.j(a,"boolean",V,"computesBoundsIncludingLocation");var b=this.Fp;b!==a&&(this.Fp=a,this.h("computesBoundsIncludingLocation",b,a))});u.defineProperty(V,{OG:"handlesDragDropForMembers"},function(){return this.cq},function(a){u.j(a,"boolean",V,"handlesDragDropForMembers");var b=this.cq;b!==a&&(this.cq=a,this.h("handlesDragDropForMembers",b,a))});u.u(V,{Mc:"memberParts"},function(){return this.Lq.i});
function Tn(a,b){if(a.Lq.add(b)){b instanceof V&&a.Pn.add(b);var c=a.xH;if(null!==c){var d=!0,e=a.g;null!==e&&(d=e.Na,e.Na=!0);c(a,b);null!==e&&(e.Na=d)}a.Ea()&&a.be||b.He(!1)}c=a.Pb;null===c&&(c=a);c.R()}function Sn(a,b){if(a.Lq.remove(b)){b instanceof V&&a.Pn.remove(b);var c=a.yH;if(null!==c){var d=!0,e=a.g;null!==e&&(d=e.Na,e.Na=!0);c(a,b);null!==e&&(e.Na=d)}a.Ea()&&a.be||b.He(!0)}c=a.Pb;null===c&&(c=a);c.R()}
V.prototype.xm=function(){if(0<this.Lq.count){var a=this.g;if(null===a)return;for(var b=this.Lq.copy().i;b.next();)a.remove(b.value)}U.prototype.xm.call(this)};V.prototype.Jw=function(){var a=this.layer;null!==a&&a.Jw(this)};u.defineProperty(V,{Qb:"layout"},function(){return this.Nd},function(a){var b=this.Nd;b!==a&&(null!==a&&u.C(a,Je,V,"layout"),null!==b&&(b.g=null,b.group=null),this.Nd=a,null!==a&&(a.g=this.g,a.group=this),this.h("layout",b,a))});
u.defineProperty(V,{xH:"memberAdded"},function(){return this.Kq},function(a){var b=this.Kq;b!==a&&(null!==a&&u.j(a,"function",V,"memberAdded"),this.Kq=a,this.h("memberAdded",b,a))});u.defineProperty(V,{yH:"memberRemoved"},function(){return this.Mq},function(a){var b=this.Mq;b!==a&&(null!==a&&u.j(a,"function",V,"memberRemoved"),this.Mq=a,this.h("memberRemoved",b,a))});
u.defineProperty(V,{Bz:"memberValidation"},function(){return this.Ak},function(a){var b=this.Ak;b!==a&&(null!==a&&u.j(a,"function",V,"memberValidation"),this.Ak=a,this.h("memberValidation",b,a))});V.prototype.canAddMembers=function(a){var b=this.g;if(null===b)return!1;b=b.Eb;for(a=wf(a).i;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};
V.prototype.addMembers=function(a,b){var c=this.g;if(null===c)return!1;for(var c=c.Eb,d=!0,e=wf(a).i;e.next();){var f=e.value;!b||c.isValidMember(this,f)?f.Ra=this:d=!1}return d};u.defineProperty(V,{BI:"ungroupable"},function(){return this.Yr},function(a){var b=this.Yr;b!==a&&(u.j(a,"boolean",V,"ungroupable"),this.Yr=a,this.h("ungroupable",b,a))});V.prototype.canUngroup=function(){if(!this.BI)return!1;var a=this.layer;if(null!==a&&!a.Fv)return!1;a=a.g;return null===a||a.Fv?!0:!1};
V.prototype.invalidateConnectedLinks=V.prototype.sf=function(a){void 0===a&&(a=null);U.prototype.sf.call(this,a);for(var b=this.pD();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.W;null!==d&&d.Ph(this)&&!d.Ea()?c.Vb():(d=c.ca,null!==d&&d.Ph(this)&&!d.Ea()&&c.Vb())}}};V.prototype.findExternalLinksConnected=V.prototype.pD=function(){var a=this.yo();a.add(this);for(var b=new F(W),c=a.i;c.next();){var d=c.value;if(d instanceof U)for(d=d.oe;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.i};
V.prototype.findExternalNodesConnected=function(){var a=this.yo();a.add(this);for(var b=new F(U),c=a.i;c.next();){var d=c.value;if(d instanceof U)for(d=d.oe;d.next();){var e=d.value,f=e.W;a.contains(f)&&f!==this||b.add(f);e=e.ca;a.contains(e)&&e!==this||b.add(e)}}return b.i};V.prototype.findSubGraphParts=V.prototype.yo=function(){var a=new F(G);kf(a,this,!0,0,!0);a.remove(this);return a};V.prototype.He=function(a){U.prototype.He.call(this,a);for(var b=this.Mc;b.next();)b.value.He(a)};
V.prototype.collapseSubGraph=V.prototype.collapseSubGraph=function(){var a=this.g;if(null!==a&&!a.me){a.me=!0;var b=this.yo();Xo(this,b);a.me=!1}};function Xo(a,b){for(var c=a.Mc;c.next();){var d=c.value;d.He(!1);if(d instanceof V){var e=d;e.be&&(e.oA=e.be,Xo(e,b))}if(d instanceof U)d.sf(b);else if(d instanceof W)for(d=d.ug;d.next();)d.value.sf(b)}a.be=!1}
V.prototype.expandSubGraph=V.prototype.expandSubGraph=function(){var a=this.g;if(null!==a&&!a.me){var b=a.Lb;0!==a.ha.Le&&b.ml();a.me=!0;var c=this.yo();Yo(this,c,b,this);a.me=!1}};function Yo(a,b,c,d){for(var e=a.Mc;e.next();){var f=e.value;f.He(!0);if(f instanceof V){var h=f;h.oA&&(h.oA=!1,Yo(h,b,c,d))}if(f instanceof U)f.sf(b),ri(c,f,d);else if(f instanceof W)for(f=f.ug;f.next();)f.value.sf(b)}a.be=!0}
u.defineProperty(V,{be:"isSubGraphExpanded"},function(){return this.pq},function(a){var b=this.pq;if(b!==a){u.j(a,"boolean",V,"isSubGraphExpanded");this.pq=a;var c=this.g;this.h("isSubGraphExpanded",b,a);b=this.sI;if(null!==b){var d=!0;null!==c&&(d=c.Na,c.Na=!0);b(this);null!==c&&(c.Na=d)}null!==c&&c.ha.gb||(a?this.expandSubGraph():this.collapseSubGraph())}});
u.defineProperty(V,{oA:"wasSubGraphExpanded"},function(){return this.Zr},function(a){var b=this.Zr;b!==a&&(u.j(a,"boolean",V,"wasSubGraphExpanded"),this.Zr=a,this.h("wasSubGraphExpanded",b,a))});u.defineProperty(V,{sI:"subGraphExpandedChanged"},function(){return this.Nr},function(a){var b=this.Nr;b!==a&&(null!==a&&u.j(a,"function",V,"subGraphExpandedChanged"),this.Nr=a,this.h("subGraphExpandedChanged",b,a))});
V.prototype.move=V.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);var c=a.x-c,b=a.y-b,d=u.fc(c,b);U.prototype.move.call(this,a);for(a=this.yo().i;a.next();){var e=a.value;if(!(e instanceof W||e instanceof U&&e.tf)){var f=e.position,h=e.location;f.J()?(d.x=f.x+c,d.y=f.y+b,e.position=d):h.J()&&(d.x=h.x+c,d.y=h.y+b,e.location=d)}}for(a.reset();a.next();)e=a.value,e instanceof W&&(f=e.position,d.x=f.x+c,d.y=f.y+b,e.move(d));u.v(d)};
function ph(){S.call(this);this.Pe=K.np;this.yr=new z(NaN,NaN,NaN,NaN)}u.Ga(ph,S);u.fa("Placeholder",ph);ph.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.Pe=this.Pe.Z();a.yr=this.yr.copy()};ph.prototype.Jj=function(a){if(null===this.background&&null===this.nm)return!1;var b=this.Ha;return qb(0,0,b.width,b.height,a.x,a.y)};
ph.prototype.Oo=function(){var a=this.T;null!==a&&(a instanceof V||a instanceof lf)||u.k("Placeholder is not inside a Group or Adornment.");if(a instanceof V){var b=this.computeBorder(this.yr),c=this.Hc;bb(c,b.width||0,b.height||0);ml(this,0,0,c.width,c.height);for(var c=a.Mc,d=!1;c.next();)if(c.value.Ea()){d=!0;break}!d||isNaN(b.x)||isNaN(b.y)||(c=new w,c.pt(b,a.Ze),a.location=new w(c.x,c.y))}else{var b=this.xa,c=this.Hc,d=this.padding,e=d.left+d.right,f=d.top+d.bottom;if(b.J())bb(c,b.width+e||0,
b.height+f||0),ml(this,-d.left,-d.top,c.width,c.height);else{var h=a.vc,k=h.lb(xb,u.K()),b=u.Vj(k.x,k.y,0,0);b.Oi(h.lb(Vb,k));b.Oi(h.lb(Gb,k));b.Oi(h.lb(Kb,k));a.Mg.m(b.x,b.y);bb(c,b.width+e||0,b.height+f||0);ml(this,-d.left,-d.top,c.width,c.height);u.v(k);u.ic(b)}}};ph.prototype.xi=function(a,b,c,d){var e=this.ba;e.x=a;e.y=b;e.width=c;e.height=d};
ph.prototype.computeBorder=function(a){var b=this.T;if(b instanceof V){var c=b;if(c.aD&&this.yr.J()){var d=c.g;if(null!==d&&(d=d.Va,d instanceof uf&&!d.Rp&&null!==d.cc&&!d.cc.contains(c)))return a.assign(this.yr),a}}var c=u.Sf(),d=this.computeMemberBounds(c),e=this.padding;a.m(d.x-e.left,d.y-e.top,d.width+e.left+e.right,d.height+e.top+e.bottom);u.ic(c);b instanceof V&&(c=b,c.cG&&c.location.J()&&a.Oi(c.location));return a};
ph.prototype.computeMemberBounds=function(a){if(!(this.T instanceof V))return a.m(0,0,0,0),a;for(var b=this.T,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,h=b.Mc;h.next();){var k=h.value;if(k.Ea()){if(k instanceof W){var l=k;if(!b.bG)continue;if(Aj(l))continue;if(l.W===b||l.ca===b)continue}k=k.ba;k.left<c&&(c=k.left);k.top<d&&(d=k.top);k.right>e&&(e=k.right);k.bottom>f&&(f=k.bottom)}}isFinite(c)&&isFinite(d)?a.m(c,d,e-c,f-d):(b=b.location,c=this.padding,a.m(b.x+c.left,b.y+c.top,0,0));return a};
u.defineProperty(ph,{padding:"padding"},function(){return this.Pe},function(a){"number"===typeof a?((isNaN(a)||0>a)&&u.wa(a,">= 0",ph,"padding"),a=new rb(a)):(u.C(a,rb,ph,"padding"),(isNaN(a.left)||0>a.left)&&u.wa(a.left,">= 0",ph,"padding:value.left"),(isNaN(a.right)||0>a.right)&&u.wa(a.right,">= 0",ph,"padding:value.right"),(isNaN(a.top)||0>a.top)&&u.wa(a.top,">= 0",ph,"padding:value.top"),(isNaN(a.bottom)||0>a.bottom)&&u.wa(a.bottom,">= 0",ph,"padding:value.bottom"));var b=this.Pe;b.L(a)||(this.Pe=
a=a.Z(),this.h("padding",b,a))});function Je(){0<arguments.length&&u.Wc(Je);u.gc(this);this.Px=this.Y=null;this.jq=this.lq=!0;this.tq=!1;this.wp=(new w(0,0)).freeze();this.mq=this.oq=!0;this.YA="";this.Gn=!1;this.ky=null}u.fa("Layout",Je);Je.prototype.cloneProtected=function(a){a.lq=this.lq;a.jq=this.jq;a.tq=this.tq;a.wp.assign(this.wp);a.oq=this.oq;a.mq=this.mq;a.YA=this.YA;this.jq||(a.Gn=!0)};Je.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};
Je.prototype.toString=function(){var a=u.rg(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.g&&(a+=" for "+this.g);return a+")"};u.defineProperty(Je,{g:"diagram"},function(){return this.Y},function(a){null!==a&&u.C(a,D,Je,"diagram");this.Y=a});u.defineProperty(Je,{group:"group"},function(){return this.Px},function(a){this.Px!==a&&(null!==a&&u.C(a,V,Je,"group"),this.Px=a,null!==a&&(this.Y=a.g))});
u.defineProperty(Je,{gH:"isOngoing"},function(){return this.lq},function(a){this.lq!==a&&(u.j(a,"boolean",Je,"isOngoing"),this.lq=a)});u.defineProperty(Je,{dH:"isInitial"},function(){return this.jq},function(a){u.j(a,"boolean",Je,"isInitial");this.jq=a;a||(this.Gn=!0)});u.defineProperty(Je,{jw:"isViewportSized"},function(){return this.tq},function(a){this.tq!==a&&(u.j(a,"boolean",Je,"isViewportSized"),(this.tq=a)&&this.H())});
u.defineProperty(Je,{Qs:"isRouting"},function(){return this.oq},function(a){this.oq!==a&&(u.j(a,"boolean",Je,"isRouting"),this.oq=a)});u.defineProperty(Je,{PD:"isRealtime"},function(){return this.mq},function(a){this.mq!==a&&(u.j(a,"boolean",Je,"isRealtime"),this.mq=a)});u.defineProperty(Je,{vf:"isValidLayout"},function(){return this.Gn},function(a){this.Gn!==a&&(u.j(a,"boolean",Je,"isValidLayout"),this.Gn=a,a||(a=this.g,null!==a&&(a.Ot=!0)))});
Je.prototype.invalidateLayout=Je.prototype.H=function(){if(this.Gn){var a=this.g;if(null!==a&&!a.ha.gb){var b=a.Lb;!b.Fn&&(b.Vg&&b.Mi(),this.gH&&a.lf||this.dH&&!a.lf)&&(this.vf=!1,a.de())}}};u.defineProperty(Je,{network:"network"},function(){return this.ky},function(a){var b=this.ky;b!==a&&(null!==a&&u.C(a,xa,Je,"network"),null!==b&&(b.Qb=null),this.ky=a,null!==a&&(a.Qb=this))});Je.prototype.createNetwork=function(){return new xa};
Je.prototype.makeNetwork=function(a){var b=this.createNetwork();b.Qb=this;a instanceof D?(b.Gj(a.yg,!0),b.Gj(a.links,!0)):a instanceof V?b.Gj(a.Mc):b.Gj(a.i);return b};Je.prototype.updateParts=function(){var a=this.g;if(null===a&&null!==this.network)for(var b=this.network.vertexes.i;b.next();){var c=b.value.Cc;if(null!==c&&(a=c.g,null!==a))break}this.vf=!0;try{null!==a&&a.Wb("Layout"),this.commitLayout()}finally{null!==a&&a.Wd("Layout")}};
Je.prototype.commitLayout=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();if(this.Qs)for(a=this.network.edges.i;a.next();)a.value.commit()};
Je.prototype.doLayout=function(a){null===a&&u.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new F(G);a instanceof D?(Zo(this,b,a.yg,!0,this.Gz,!0,!1,!0),Zo(this,b,a.Sj,!0,this.Gz,!0,!1,!0)):a instanceof V?Zo(this,b,a.Mc,!1,this.Gz,!0,!1,!0):b.Td(a.i);var c=b.count;if(0<c){a=this.g;null!==a&&a.Wb("Layout");for(var c=Math.ceil(Math.sqrt(c)),d=this.Ud.x,e=d,f=this.Ud.y,h=0,k=0,b=b.i;b.next();){var l=b.value;l.pf();var m=l.Ba,n=m.width,
m=m.height;l.moveTo(e,f);l.jy=!1;e+=Math.max(n,50)+20;k=Math.max(k,Math.max(m,50));h>=c-1?(h=0,e=d,f+=k+20,k=0):h++}null!==a&&a.Wd("Layout")}this.vf=!0};Je.prototype.Gz=function(a){return!a.location.J()||a instanceof V&&a.jy?!0:!1};
function Zo(a,b,c,d,e,f,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.Ho||null!==e&&!e(l)||!l.canLayout()||(f&&l instanceof U?l.tf||(l instanceof V?null===l.Qb?Zo(a,b,l.Mc,!1,e,f,h,k):b.add(l):b.add(l)):h&&l instanceof W?b.add(l):!k||!l.Fd()||l instanceof U||b.add(l))}}
Je.prototype.collectParts=function(a){var b=new F(G);a instanceof D?(Zo(this,b,a.yg,!0,null,!0,!0,!0),Zo(this,b,a.links,!0,null,!0,!0,!0),Zo(this,b,a.Sj,!0,null,!0,!0,!0)):a instanceof V?Zo(this,b,a.Mc,!1,null,!0,!0,!0):Zo(this,b,a.i,!1,null,!0,!0,!0);return b};u.defineProperty(Je,{Ud:"arrangementOrigin"},function(){return this.wp},function(a){u.C(a,w,Je,"arrangementOrigin");this.wp.L(a)||(this.wp.assign(a),this.H())});
Je.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.lb(xb),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a};function xa(){u.gc(this);this.Nd=null;this.clear()}u.fa("LayoutNetwork",xa);
xa.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new F(ya);this.edges=new F(Aa);this.Kz=new la(U,ya);this.yz=new la(W,Aa)};
xa.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Qb?"("+this.Qb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1<a){for(var c=this.vertexes.i;c.next();)b+="\n    "+c.value.toString(a-1);for(c=this.edges.i;c.next();)b+="\n    "+c.value.toString(a-1)}return b};u.defineProperty(xa,{Qb:"layout"},function(){return this.Nd},function(a){this.Nd=a});xa.prototype.createVertex=function(){return new ya};
xa.prototype.createEdge=function(){return new Aa};
xa.prototype.addParts=xa.prototype.Gj=function(a,b,c){if(null!==a){void 0===b&&(b=!1);u.j(b,"boolean",xa,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof U)return!a.tf;if(a instanceof W){var b=a.W;if(null===b||b.tf)return!1;a=a.ca;return null===a||a.tf?!1:!0}return!1});for(a=a.i;a.next();){var d=a.value;if(d instanceof U&&(!b||d.Ho)&&d.canLayout()&&c(d))if(d instanceof V&&null===d.Qb)this.Gj(d.Mc,!1);else if(null===this.Am(d)){var e=this.createVertex();e.Cc=d;
this.Mk(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof W&&(!b||d.Ho)&&d.canLayout()&&c(d)&&null===this.Uv(d)){var f=d.W,e=d.ca;null!==f&&null!==e&&f!==e&&(f=this.findGroupVertex(f),e=this.findGroupVertex(e),null!==f&&null!==e&&this.No(f,e,d))}}};xa.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.Am(b);if(null!==a)return a;for(b=b.Ra;null!==b;){a=this.Am(b);if(null!==a)return a;b=b.Ra}return null};
xa.prototype.addVertex=xa.prototype.Mk=function(a){if(null!==a){this.vertexes.add(a);var b=a.Cc;null!==b&&this.Kz.add(b,a);a.network=this}};xa.prototype.addNode=xa.prototype.ds=function(a){if(null===a)return null;var b=this.Am(a);null===b&&(b=this.createVertex(),b.Cc=a,this.Mk(b));return b};xa.prototype.deleteVertex=xa.prototype.lD=function(a){if(null!==a&&$o(this,a)){for(var b=a.Ie,c=b.count-1;0<=c;c--){var d=b.ja(c);this.vo(d)}b=a.Ce;for(c=b.count-1;0<=c;c--)d=b.ja(c),this.vo(d)}};
function $o(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.Kz.remove(b.Cc),b.network=null);return c}xa.prototype.deleteNode=function(a){null!==a&&(a=this.Am(a),null!==a&&this.lD(a))};xa.prototype.findVertex=xa.prototype.Am=function(a){return null===a?null:this.Kz.ta(a)};xa.prototype.addEdge=xa.prototype.ko=function(a){if(null!==a){this.edges.add(a);var b=a.link;null!==b&&null===this.Uv(b)&&this.yz.add(b,a);b=a.toVertex;null!==b&&b.LC(a);b=a.fromVertex;null!==b&&b.KC(a);a.network=this}};
xa.prototype.addLink=function(a){if(null===a)return null;var b=a.W,c=a.ca,d=this.Uv(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.ds(b)),null!==c&&(d.toVertex=this.ds(c)),this.ko(d)):(d.fromVertex=null!==b?this.ds(b):null,d.toVertex=null!==c?this.ds(c):null);return d};xa.prototype.deleteEdge=xa.prototype.vo=function(a){if(null!==a){var b=a.toVertex;null!==b&&b.kD(a);b=a.fromVertex;null!==b&&b.jD(a);ap(this,a)}};
function ap(a,b){null!==b&&a.edges.remove(b)&&(a.yz.remove(b.link),b.network=null)}xa.prototype.deleteLink=function(a){null!==a&&(a=this.Uv(a),null!==a&&this.vo(a))};xa.prototype.findEdge=xa.prototype.Uv=function(a){return null===a?null:this.yz.ta(a)};xa.prototype.linkVertexes=xa.prototype.No=function(a,b,c){if(null===a||null===b)return null;if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.ko(d);return d}return null};
xa.prototype.reverseEdge=xa.prototype.yw=function(a){if(null!==a){var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.jD(a),c.kD(a),a.yw(),b.LC(a),c.KC(a))}};xa.prototype.deleteSelfEdges=xa.prototype.Qv=function(){for(var a=u.eb(),b=this.edges.i;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.vo(a[c]);u.ra(a)};
xa.prototype.deleteArtificialVertexes=function(){for(var a=u.eb(),b=this.vertexes.i;b.next();){var c=b.value;null===c.Cc&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.lD(a[b]);c=u.eb();for(b=this.edges.i;b.next();){var d=b.value;null===d.link&&c.push(d)}d=c.length;for(b=0;b<d;b++)this.vo(c[b]);u.ra(a);u.ra(c)};function bp(a){for(var b=u.eb(),c=a.edges.i;c.next();){var d=c.value;null!==d.fromVertex&&null!==d.toVertex||b.push(d)}c=b.length;for(d=0;d<c;d++)a.vo(b[d]);u.ra(b)}
xa.prototype.splitIntoSubNetworks=xa.prototype.oI=function(){this.deleteArtificialVertexes();bp(this);this.Qv();for(var a=new E(xa),b=!0;b;)for(var b=!1,c=this.vertexes.i;c.next();){var d=c.value;if(0<d.Ie.count||0<d.Ce.count){b=this.Qb.createNetwork();a.add(b);cp(this,b,d);b=!0;break}}a.sort(function(a,b){return null===a||null===b||a===b?0:b.vertexes.count-a.vertexes.count});return a};
function cp(a,b,c){if(null!==c&&c.network!==b){$o(a,c);b.Mk(c);for(var d=c.kc;d.next();){var e=d.value;e.network!==b&&(ap(a,e),b.ko(e),cp(a,b,e.fromVertex))}for(d=c.bc;d.next();)c=d.value,c.network!==b&&(ap(a,c),b.ko(c),cp(a,b,c.toVertex))}}xa.prototype.findAllParts=function(){for(var a=new F(G),b=this.vertexes.i;b.next();)a.add(b.value.Cc);for(b=this.edges.i;b.next();)a.add(b.value.link);return a};
function ya(){u.gc(this);this.network=null;this.aa=(new z(0,0,10,10)).freeze();this.M=(new w(5,5)).freeze();this.clear()}u.fa("LayoutVertex",ya);ya.prototype.clear=function(){this.kd=this.qh=null;this.Ie=new E(Aa);this.Ce=new E(Aa)};
ya.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+u.Uc(this);if(0<a&&(b+=null!==this.Cc?"("+this.Cc.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Ie.i;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Ce.i;d.next();){var f=d.value;c?c=!1:e+=",";e+=f.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};
u.defineProperty(ya,{data:"data"},function(){return this.qh},function(a){this.qh=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width,b=b.height;this.M.m(d/2,b/2);this.aa.m(a,c,d,b)}});u.defineProperty(ya,{Cc:"node"},function(){return this.kd},function(a){if(this.kd!==a){this.kd=a;a.pf();var b=a.ba,c=b.x,d=b.y,e=b.width,b=b.height;isNaN(c)&&(c=0);isNaN(d)&&(d=0);this.aa.m(c,d,e,b);if(!(a instanceof V)&&(a=a.ec.lb(Ib),a.J())){this.M.m(a.x-c,a.y-d);return}this.M.m(e/2,b/2)}});
u.defineProperty(ya,{kb:"bounds"},function(){return this.aa},function(a){this.aa.L(a)||this.aa.assign(a)});u.defineProperty(ya,{focus:"focus"},function(){return this.M},function(a){this.M.L(a)||this.M.assign(a)});u.defineProperty(ya,{Ja:"centerX"},function(){return this.aa.x+this.M.x},function(a){var b=this.aa;b.x+this.M.x!==a&&(b.La(),b.x=a-this.M.x,b.freeze())});
u.defineProperty(ya,{Ua:"centerY"},function(){return this.aa.y+this.M.y},function(a){var b=this.aa;b.y+this.M.y!==a&&(b.La(),b.y=a-this.M.y,b.freeze())});u.defineProperty(ya,{Cs:"focusX"},function(){return this.M.x},function(a){var b=this.M;b.x!==a&&(b.La(),b.x=a,b.freeze())});u.defineProperty(ya,{Ds:"focusY"},function(){return this.M.y},function(a){var b=this.M;b.y!==a&&(b.La(),b.y=a,b.freeze())});
u.defineProperty(ya,{x:"x"},function(){return this.aa.x},function(a){var b=this.aa;b.x!==a&&(b.La(),b.x=a,b.freeze())});u.defineProperty(ya,{y:"y"},function(){return this.aa.y},function(a){var b=this.aa;b.y!==a&&(b.La(),b.y=a,b.freeze())});u.defineProperty(ya,{width:"width"},function(){return this.aa.width},function(a){var b=this.aa;b.width!==a&&(b.La(),b.width=a,b.freeze())});
u.defineProperty(ya,{height:"height"},function(){return this.aa.height},function(a){var b=this.aa;b.height!==a&&(b.La(),b.height=a,b.freeze())});ya.prototype.commit=function(){var a=this.qh;if(null!==a){var b=this.kb,c=a.bounds;u.Sa(c)?(c.x=b.x,c.y=b.y,c.width=b.width,c.height=b.height):a.bounds=b.copy()}else if(a=this.Cc,null!==a){b=this.kb;if(!(a instanceof V)){var c=a.ba,d=a.ec.lb(Ib);if(c.J()&&d.J()){a.moveTo(b.x+this.Cs-(d.x-c.x),b.y+this.Ds-(d.y-c.y));return}}a.moveTo(b.x,b.y)}};
ya.prototype.addSourceEdge=ya.prototype.LC=function(a){null!==a&&(this.Ie.contains(a)||this.Ie.add(a))};ya.prototype.deleteSourceEdge=ya.prototype.kD=function(a){null!==a&&this.Ie.remove(a)};ya.prototype.addDestinationEdge=ya.prototype.KC=function(a){null!==a&&(this.Ce.contains(a)||this.Ce.add(a))};ya.prototype.deleteDestinationEdge=ya.prototype.jD=function(a){null!==a&&this.Ce.remove(a)};u.u(ya,{nI:"sourceVertexes"},function(){for(var a=new F(ya),b=this.kc;b.next();)a.add(b.value.fromVertex);return a.i});
u.u(ya,{rG:"destinationVertexes"},function(){for(var a=new F(ya),b=this.bc;b.next();)a.add(b.value.toVertex);return a.i});u.u(ya,{vertexes:"vertexes"},function(){for(var a=new F(ya),b=this.kc;b.next();)a.add(b.value.fromVertex);for(b=this.bc;b.next();)a.add(b.value.toVertex);return a.i});u.u(ya,{kc:"sourceEdges"},function(){return this.Ie.i});u.u(ya,{bc:"destinationEdges"},function(){return this.Ce.i});
u.u(ya,{edges:"edges"},function(){for(var a=new E(Aa),b=this.kc;b.next();)a.add(b.value);for(b=this.bc;b.next();)a.add(b.value);return a.i});u.u(ya,{xG:"edgesCount"},function(){return this.Ie.count+this.Ce.count});var dp;ya.standardComparer=dp=function(a,b){var c=a.kd,d=b.kd;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
ya.smartComparer=function(a,b){if(null!==a){if(null!==b){var c=a.kd,d=b.kd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var f=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(f)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;if(0!==f-h)return f-
h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==d?-1:0}return 1}return null!==b?-1:0};function Aa(){u.gc(this);this.network=null;this.clear()}u.fa("LayoutEdge",Aa);Aa.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null};
Aa.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+u.Uc(this);0<a&&(b+=null!==this.link?"("+this.link.toString()+")":"",1<a&&(b+=" "+(this.fromVertex?this.fromVertex.toString():"null")+" --\x3e "+(this.toVertex?this.toVertex.toString():"null")));return b};Aa.prototype.yw=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};Aa.prototype.commit=function(){};
Aa.prototype.getOtherVertex=Aa.prototype.GG=function(a){return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};function Xk(){0<arguments.length&&u.Wc(Xk);Je.call(this);this.jw=!0;this.as=this.bs=NaN;this.Ti=(new ia(NaN,NaN)).freeze();this.Gh=(new ia(10,10)).freeze();this.se=em;this.Yc=cm;this.Fh=Zl;this.ph=ep}u.Ga(Xk,Je);u.fa("GridLayout",Xk);
Xk.prototype.cloneProtected=function(a){Je.prototype.cloneProtected.call(this,a);a.bs=this.bs;a.as=this.as;a.Ti.assign(this.Ti);a.Gh.assign(this.Gh);a.se=this.se;a.Yc=this.Yc;a.Fh=this.Fh;a.ph=this.ph};
Xk.prototype.doLayout=function(a){null===a&&u.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.Ud=this.initialOrigin(this.Ud);var b=this.g,c=new F(G);a instanceof D?(b=a,Zo(this,c,a.yg,!0,null,!0,!0,!0),Zo(this,c,a.links,!0,null,!0,!0,!0),Zo(this,c,a.Sj,!0,null,!0,!0,!0)):a instanceof V?(b=a.g,Zo(this,c,a.Mc,!1,null,!0,!0,!0)):c.Td(a.i);for(a=c.copy().i;a.next();){var d=a.value;if(d instanceof W){var e=d;if(null!==e.W||null!==e.ca){c.remove(e);
continue}}d.pf();if(d instanceof V)for(d=d.Mc;d.next();)c.remove(d.value)}e=c.Ke();if(0!==e.length){switch(this.sorting){case bm:e.reverse();break;case Zl:e.sort(this.comparer);break;case $l:e.sort(this.comparer),e.reverse()}var f=this.EI;isNaN(f)&&(f=0);var h=this.cF,h=isNaN(h)&&null!==b?Math.max(b.ob.width-b.padding.left-b.padding.right,0):Math.max(this.cF,0);0>=f&&0>=h&&(f=1);c=this.spacing.width;isFinite(c)||(c=0);a=this.spacing.height;isFinite(a)||(a=0);null!==b&&b.Wb("Layout");d=[];switch(this.alignment){case fm:var k=
c,l=a,m=Math.max(this.qo.width,1);if(!isFinite(m))for(var n=m=0;n<e.length;n++)var p=e[n],q=p.Ba,m=Math.max(m,q.width);var m=Math.max(m+k,1),r=Math.max(this.qo.height,1);if(!isFinite(r))for(n=r=0;n<e.length;n++)p=e[n],q=p.Ba,r=Math.max(r,q.height);for(var r=Math.max(r+l,1),s=this.Gf,t=this.Ud.x,v=t,x=this.Ud.y,B=0,y=0,n=0;n<e.length;n++){var p=e[n],q=p.Ba,C=Math.ceil((q.width+k)/m)*m,I=Math.ceil((q.height+l)/r)*r,H=0;switch(s){case dm:H=Math.abs(v-q.width);break;default:H=v+q.width}if(0<f&&B>f-1||
0<h&&0<B&&H>h)d.push(new z(0,x,h+k,y)),B=0,v=t,x+=y,y=0;y=Math.max(y,I);I=0;switch(s){case dm:I=-q.width;break;default:I=0}p.moveTo(v+I,x);switch(s){case dm:v-=C;break;default:v+=C}B++}d.push(new z(0,x,h+k,y));break;case em:k=f;l=c;m=a;n=Math.max(this.qo.width,1);p=x=C=0;q=u.K();for(f=0;f<e.length;f++)r=e[f],s=r.Ba,t=On(r,r.ec,r.Ze,q),C=Math.max(C,t.x),x=Math.max(x,s.width-t.x),p=Math.max(p,t.y);v=this.Gf;switch(v){case dm:C+=l;break;default:x+=l}var n=isFinite(n)?Math.max(n+l,1):Math.max(C+x,1),
T=x=this.Ud.x,B=this.Ud.y,y=0;h>=C&&(h-=C);for(var C=I=0,H=Math.max(this.qo.height,1),aa=p=0,R=!0,N=u.K(),f=0;f<e.length;f++){r=e[f];s=r.Ba;t=On(r,r.ec,r.Ze,q);if(0<y)switch(v){case dm:T=Math.floor((T-x-(s.width-t.x))/n)*n+x;break;default:T=Math.ceil((T-x+t.x)/n)*n+x}else switch(v){case dm:I=T+t.x+s.width;break;default:I=T-t.x}var Z=0;switch(v){case dm:Z=-(T+t.x)+I;break;default:Z=T+s.width-t.x-I}if(0<k&&y>k-1||0<h&&0<y&&Z>h){d.push(new z(0,R?B-p:B,h+l,aa+p+m));for(T=0;T<y&&f!==y;T++){var Z=e[f-y+
T],Ea=On(Z,Z.ec,Z.Ze,N);Z.moveTo(Z.position.x,Z.position.y+p-Ea.y)}aa+=m;B=R?B+aa:B+(aa+p);y=aa=p=0;T=x;R=!1}T===x&&(C=v===dm?Math.max(C,s.width-t.x):Math.min(C,-t.x));p=Math.max(p,t.y);aa=Math.max(aa,s.height-t.y);isFinite(H)&&(aa=Math.max(aa,Math.max(s.height,H)-t.y));R?r.moveTo(T-t.x,B-t.y):r.moveTo(T-t.x,B);switch(v){case dm:T-=t.x+l;break;default:T+=s.width-t.x+l}y++}d.push(new z(0,B,h+l,(R?aa:aa+p)+m));for(T=0;T<y&&f!==y;T++)Z=e[f-y+T],Ea=On(Z,Z.ec,Z.Ze,q),Z.moveTo(Z.position.x,Z.position.y+
p-Ea.y);u.v(q);u.v(N);if(v===dm)for(f=0;f<d.length;f++)e=d[f],e.width+=C,e.x-=C;else for(f=0;f<d.length;f++)e=d[f],e.x>C&&(e.width+=e.x-C,e.x=C)}for(k=f=h=e=0;k<d.length;k++)l=d[k],e=Math.min(e,l.x),h=Math.min(h,l.y),f=Math.max(f,l.x+l.width);this.Gf===dm?this.commitLayers(d,new w(e+c/2-(f+e),h-a/2)):this.commitLayers(d,new w(e-c/2,h-a/2));null!==b&&b.Wd("Layout");this.vf=!0}};Xk.prototype.commitLayers=function(){};
u.defineProperty(Xk,{cF:"wrappingWidth"},function(){return this.bs},function(a){this.bs!==a&&(u.j(a,"number",Xk,"wrappingWidth"),0<a||isNaN(a))&&(this.bs=a,this.jw=isNaN(a),this.H())});u.defineProperty(Xk,{EI:"wrappingColumn"},function(){return this.as},function(a){this.as!==a&&(u.j(a,"number",Xk,"wrappingColumn"),0<a||isNaN(a))&&(this.as=a,this.H())});u.defineProperty(Xk,{qo:"cellSize"},function(){return this.Ti},function(a){u.C(a,ia,Xk,"cellSize");this.Ti.L(a)||(this.Ti.assign(a),this.H())});
u.defineProperty(Xk,{spacing:"spacing"},function(){return this.Gh},function(a){u.C(a,ia,Xk,"spacing");this.Gh.L(a)||(this.Gh.assign(a),this.H())});u.defineProperty(Xk,{alignment:"alignment"},function(){return this.se},function(a){this.se!==a&&(u.rb(a,Xk,Xk,"alignment"),a===em||a===fm)&&(this.se=a,this.H())});u.defineProperty(Xk,{Gf:"arrangement"},function(){return this.Yc},function(a){this.Yc!==a&&(u.rb(a,Xk,Xk,"arrangement"),a===cm||a===dm)&&(this.Yc=a,this.H())});
u.defineProperty(Xk,{sorting:"sorting"},function(){return this.Fh},function(a){this.Fh!==a&&(u.rb(a,Xk,Xk,"sorting"),a===am||a===bm||a===Zl||a===$l)&&(this.Fh=a,this.H())});u.defineProperty(Xk,{comparer:"comparer"},function(){return this.ph},function(a){this.ph!==a&&(u.j(a,"function",Xk,"comparer"),this.ph=a,this.H())});var ep;Xk.standardComparer=ep=function(a,b){var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
Xk.smartComparer=function(a,b){if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var f=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(f)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;if(0!==f-h)return f-h}}else if(""!==c[e])return 1;return""!==
d[e]&&void 0!==d[e]?-1:0}return 1}return null!==b?-1:0};var fm;Xk.Position=fm=u.s(Xk,"Position",0);var em;Xk.Location=em=u.s(Xk,"Location",1);var cm;Xk.LeftToRight=cm=u.s(Xk,"LeftToRight",2);var dm;Xk.RightToLeft=dm=u.s(Xk,"RightToLeft",3);var am;Xk.Forward=am=u.s(Xk,"Forward",4);var bm;Xk.Reverse=bm=u.s(Xk,"Reverse",5);var Zl;Xk.Ascending=Zl=u.s(Xk,"Ascending",6);var $l;Xk.Descending=$l=u.s(Xk,"Descending",7);
function gm(){0<arguments.length&&u.Wc(gm);Je.call(this);this.Gx=this.rn=this.td=0;this.Sp=360;this.Fx=zm;this.mk=0;this.eB=zm;this.Vt=this.jg=this.yC=0;this.uv=new fp;this.Yt=this.Vl=0;this.zF=600;this.lr=NaN;this.yp=1;this.Mr=0;this.Pr=360;this.Yc=zm;this.la=om;this.Fh=lm;this.ph=dp;this.Gh=6;this.Zq=Cm}u.Ga(gm,Je);u.fa("CircularLayout",gm);
gm.prototype.cloneProtected=function(a){Je.prototype.cloneProtected.call(this,a);a.lr=this.lr;a.yp=this.yp;a.Mr=this.Mr;a.Pr=this.Pr;a.Yc=this.Yc;a.la=this.la;a.Fh=this.Fh;a.ph=this.ph;a.Gh=this.Gh;a.Zq=this.Zq};gm.prototype.createNetwork=function(){return new gp};
gm.prototype.doLayout=function(a){null===a&&u.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));a=this.network.vertexes;if(1>=a.count)1===a.count&&(a=a.first(),a.Ja=0,a.Ua=0);else{var b=new E(hp);b.Td(a.i);a=new E(hp);var c=new E(hp),d;d=this.sort(b);var e=this.Fx,f=this.eB,h=this.td,k=this.rn,l=this.Gx,m=this.Sp,b=this.mk,n=this.yC,p=this.jg,q=this.Vt,e=this.Gf,f=this.qw,h=this.OH;if(!isFinite(h)||
0>=h)h=NaN;k=this.QF;if(!isFinite(k)||0>=k)k=1;l=this.Je;isFinite(l)||(l=0);m=this.Qf;if(!isFinite(m)||360<m||1>m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Am&&f===Bm?e=zm:e===Am&&f!==Bm&&(f=Bm,e=this.Gf);if((this.direction===mm||this.direction===nm)&&this.sorting!==lm){for(var r=0;!(r>=d.length);r+=2){a.add(d.ja(r));if(r+1>=d.length)break;c.add(d.ja(r+1))}this.direction===mm?(this.Gf===Am&&a.reverse(),d=new E(hp),d.Td(a),d.Td(c)):(this.Gf===Am&&c.reverse(),d=new E(hp),d.Td(c),d.Td(a))}for(var s=
d.length,t=n=0,r=0;r<d.length;r++){var p=l+m*t*(this.direction===om?1:-1)/s,v=d.ja(r).diameter;isNaN(v)&&(v=ip(d.ja(r),p));360>m&&(0===r||r===d.length-1)&&(v/=2);n+=v;t++}if(isNaN(h)||e===Am){isNaN(b)&&(b=6);if(e!==zm&&e!==Am){v=-Infinity;for(r=0;r<s;r++){var q=d.ja(r),x=d.ja(r===s-1?0:r+1);isNaN(q.diameter)&&ip(q,0);isNaN(x.diameter)&&ip(x,0);v=Math.max(v,(q.diameter+x.diameter)/2)}q=v+b;e===xm?(p=2*Math.PI/s,h=(v+b)/p):h=jp(this,q*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180)}else h=jp(this,n+(360<=
m?s:s-1)*(e!==Am?b:1.6*b),k,l*Math.PI/180,m*Math.PI/180);p=h*k}else if(p=h*k,t=kp(this,h,p,l*Math.PI/180,m*Math.PI/180),isNaN(b)){if(e===zm||e===Am)b=(t-n)/(360<=m?s:s-1)}else if(e===zm||e===Am)r=(t-n)/(360<=m?s:s-1),r<b?(h=jp(this,n+b*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180),p=h*k):b=r;else{v=-Infinity;for(r=0;r<s;r++)q=d.ja(r),x=d.ja(r===s-1?0:r+1),isNaN(q.diameter)&&ip(q,0),isNaN(x.diameter)&&ip(x,0),v=Math.max(v,(q.diameter+x.diameter)/2);q=v+b;r=jp(this,q*(360<=m?s:s-1),k,l*Math.PI/180,
m*Math.PI/180);r>h?(h=r,p=h*k):q=t/(360<=m?s:s-1)}this.Fx=e;this.eB=f;this.td=h;this.rn=k;this.Gx=l;this.Sp=m;this.mk=b;this.yC=n;this.jg=p;this.Vt=q;b=d;d=this.Fx;e=this.td;f=this.Gx;k=this.Sp;l=this.mk;m=this.jg;n=this.Vt;if(this.direction!==mm&&this.direction!==nm||d!==Am)if(this.direction===mm||this.direction===nm){h=0;switch(d){case ym:h=180*lp(this,e,m,f,n)/Math.PI;break;case zm:n=b=0;h=a.first();null!==h&&(b=ip(h,Math.PI/2));h=c.first();null!==h&&(n=ip(h,Math.PI/2));h=180*lp(this,e,m,f,l+(b+
n)/2)/Math.PI;break;case xm:h=k/b.length}if(this.direction===mm){switch(d){case ym:mp(this,a,f,wm);break;case zm:np(this,a,f,wm);break;case xm:op(this,a,k/2,f,wm)}switch(d){case ym:mp(this,c,f+h,om);break;case zm:np(this,c,f+h,om);break;case xm:op(this,c,k/2,f+h,om)}}else{switch(d){case ym:mp(this,c,f,wm);break;case zm:np(this,c,f,wm);break;case xm:op(this,c,k/2,f,wm)}switch(d){case ym:mp(this,a,f+h,om);break;case zm:np(this,a,f+h,om);break;case xm:op(this,a,k/2,f+h,om)}}}else switch(d){case ym:mp(this,
b,f,this.direction);break;case zm:np(this,b,f,this.direction);break;case xm:op(this,b,k,f,this.direction);break;case Am:pp(this,b,k,f,this.direction)}else pp(this,b,k,f-k/2,om)}this.updateParts();this.network=null;this.vf=!0};
function op(a,b,c,d,e){var f=a.Sp,h=a.td;a=a.jg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===om?l*c/(360<=f?k:k-1):-(l*c)/k),n=b.ja(l),p=h*Math.tan(m)/a,p=Math.sqrt((h*h+a*a*p*p)/(1+p*p));n.Ja=p*Math.cos(m);n.Ua=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
function np(a,b,c,d){var e=a.td,f=a.jg,h=a.mk;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ja(l),n=b.ja(l===k-1?0:l+1),p=f*Math.sin(c);m.Ja=e*Math.cos(c);m.Ua=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&ip(m,0);isNaN(n.diameter)&&ip(n,0);m=lp(a,e,f,d===om?c:-c,(m.diameter+n.diameter)/2+h);c+=d===om?m:-m}}
function mp(a,b,c,d){var e=a.td,f=a.jg,h=a.Vt;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ja(l);m.Ja=e*Math.cos(c);m.Ua=f*Math.sin(c);m.actualAngle=180*c/Math.PI;m=lp(a,e,f,d===om?c:-c,h);c+=d===om?m:-m}}function pp(a,b,c,d,e){var f=a.Yt,f=a.Sp;a.Vl=0;a.uv=new fp;if(360>c){for(f=d+(e===om?f:-f);0>f;)f+=360;f%=360;180<f&&(f-=360);f*=Math.PI/180;a.Yt=f;qp(a,b,c,d,e)}else rp(a,b,c,d,e);a.uv.commit(b)}
function rp(a,b,c,d,e){var f=a.td,h=a.mk,k=a.rn,l=f*Math.cos(d*Math.PI/180),m=a.jg*Math.sin(d*Math.PI/180),n=b.Ke();if(3===n.length)n[0].Ja=f,n[0].Ua=0,n[1].Ja=n[0].Ja-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].Ja=(n[0].Ja+n[1].Ja)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].Ja=f,n[0].Ua=0,n[2].Ja=-n[0].Ja,n[2].Ua=n[0].Ua,n[1].Ja=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].Ja=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(var f=u.K(),p=0;p<n.length;p++){n[p].Ja=
l;n[p].Ua=m;if(p>=n.length-1)break;sp(a,l,m,n,p,e,f)||tp(a,l,m,n,p,e,f);l=f.x;m=f.y}u.v(f);a.Vl++;if(!(23<a.Vl)){var l=n[0].Ja,m=n[0].Ua,f=n[n.length-1].Ja,p=n[n.length-1].Ua,q=Math.abs(l-f)-((n[0].width+n[n.length-1].width)/2+h),r=Math.abs(m-p)-((n[0].height+n[n.length-1].height)/2+h),h=0;1>Math.abs(r)?Math.abs(l-f)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0<r?r:1>Math.abs(q)?0:q;q=!1;q=Math.abs(f)>Math.abs(p)?0<f!==m>p:0<p!==l<f;if(q=e===om?q:!q)h=-Math.abs(h),h=Math.min(h,-n[n.length-1].width),
h=Math.min(h,-n[n.length-1].height);a.uv.compare(h,n);1<Math.abs(h)&&(a.td=8>a.Vl?a.td-h/(2*Math.PI):5>n.length&&10<h?a.td/2:a.td-(0<h?1.7:-2.3),a.jg=a.td*k,rp(a,b,c,d,e))}}}
function qp(a,b,c,d,e){for(var f=a.td,h=a.jg,k=a.rn,l=f*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=u.K(),p=b.Ke(),q=0;q<p.length;q++){p[q].Ja=l;p[q].Ua=m;if(q>=p.length-1)break;sp(a,l,m,p,q,e,n)||tp(a,l,m,p,q,e,n);l=n.x;m=n.y}u.v(n);a.Vl++;if(!(23<a.Vl)){l=Math.atan2(m,l);l=e===om?a.Yt-l:l-a.Yt;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;f=l*(f+h)/2;h=a.uv;if(Math.abs(f)<Math.abs(h.Ao))for(h.Ao=f,h.Qm=[],h.lp=[],l=0;l<p.length;l++)h.Qm[l]=p[l].kb.x,h.lp[l]=p[l].kb.y;1<Math.abs(f)&&
(a.td=8>a.Vl?a.td-f/(2*Math.PI):a.td-(0<f?1.7:-2.3),a.jg=a.td*k,qp(a,b,c,d,e))}}function sp(a,b,c,d,e,f,h){var k=a.td,l=a.jg,m=0,n=0;a=(d[e].width+d[e+1].width)/2+a.mk;var p=!1;if(0<=c!==(f===om)){if(m=b+a,m>k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0}
function tp(a,b,c,d,e,f,h){var k=a.td,l=a.jg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.mk;d=!1;if(0<=b!==(f===om)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}gm.prototype.commitLayout=function(){this.commitNodes();this.Qs&&this.commitLinks()};
gm.prototype.commitNodes=function(){for(var a=this.IF,b=this.network.vertexes.i;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};gm.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
function kp(a,b,c,d,e){var f=a.zF;if(.001>Math.abs(a.rn-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;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1)),l=0,m=0;m<=f;m++)l=void 0!==d&&void 0!==e?d+m*e/f:m*Math.PI/(2*f),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function jp(a,b,c,d,e){var f=0,f=void 0!==d&&void 0!==e?kp(a,1,c,d,e):kp(a,1,c);return b/f}
function lp(a,b,c,d,e){if(.001>Math.abs(a.rn-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-f*f*l*l)*a;if(h>=e)return k*a}}
gm.prototype.sort=function(a){switch(this.sorting){case jm:break;case km:a.reverse();break;case hm:a.sort(this.comparer);break;case im:a.sort(this.comparer);a.reverse();break;case lm:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new E(hp),c=0;c<a.length;c++){var e=-1,f=-1;if(0===c)for(var h=0;h<a.length;h++){var k=a.ja(h).xG;k>e&&(e=k,f=h)}else for(h=0;h<a.length;h++)k=b[h],k>e&&(e=k,f=h);d.add(a.ja(f));b[f]=-1;f=a.ja(f);e=0;for(h=f.kc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&&
b[e]++;for(f=f.bc;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(b=0;b<d.length;b++){h=d.ja(b);a[b]=[];for(var l=0,c=h.bc;c.next();)l=d.indexOf(c.value.toVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l);for(c=h.kc;c.next();)l=d.indexOf(c.value.fromVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l)}h=[];for(b=0;b<a.length;b++)h[b]=0;for(var c=[],k=[],m=[],e=[],f=new E(hp),n=0,b=0;b<a.length;b++){var p=a[b].length;if(1===p)e.push(b);else if(0===p)f.add(d.ja(b));else{if(0===n)c.push(b);
else{for(var q=Infinity,r=Infinity,s=-1,t=[],p=0;p<c.length;p++)0>a[c[p]].indexOf(c[p===c.length-1?0:p+1])&&t.push(p===c.length-1?0:p+1);if(0===t.length)for(p=0;p<c.length;p++)t.push(p);for(p=0;p<t.length;p++){var v=t[p],x,l=a[b];x=k;for(var B=m,y=h,C=v,I=c,H=0,T=0;T<x.length;T++){var aa=y[x[T]],R=y[B[T]],N=0,Z=0;aa<R?(N=aa,Z=R):(N=R,Z=aa);if(N<C&&C<=Z)for(aa=0;aa<l.length;aa++)R=l[aa],0>I.indexOf(R)||N<y[R]&&y[R]<Z||N===y[R]||Z===y[R]||H++;else for(aa=0;aa<l.length;aa++)R=l[aa],0>I.indexOf(R)||N<
y[R]&&y[R]<Z&&N!==y[R]&&Z!==y[R]&&H++}x=H;for(y=B=0;y<a[b].length;y++)l=c.indexOf(a[b][y]),0<=l&&(l=Math.abs(v-(l>=v?l+1:l)),B+=l<c.length+1-l?l:c.length+1-l);for(y=0;y<k.length;y++)l=h[k[y]],C=h[m[y]],l>=v&&l++,C>=v&&C++,l>C&&(I=C,C=l,l=I),C-l<(c.length+2)/2===(l<v&&v<=C)&&B++;if(x<q||x===q&&B<r)q=x,r=B,s=v}c.splice(s,0,b);for(p=0;p<c.length;p++)h[c[p]]=p;for(p=0;p<a[b].length;p++)q=a[b][p],0<=c.indexOf(q)&&(k.push(b),m.push(q))}n++}}k=!1;for(m=c.length;;){k=!0;for(h=0;h<e.length;h++)if(b=e[h],n=
a[b][0],l=c.indexOf(n),0<=l){for(r=p=0;r<a[n].length;r++)q=a[n][r],q=c.indexOf(q),0>q||q===l||(s=q>l?q-l:l-q,p+=q<l!==s>m-s?1:-1);c.splice(0>p?l:l+1,0,b);e.splice(h,1);h--}else k=!1;if(k)break;else c.push(e[0]),e.splice(0,1)}for(b=0;b<c.length;b++)l=c[b],f.add(d.ja(l));return f;default:u.k("Invalid sorting type.")}return a};u.defineProperty(gm,{OH:"radius"},function(){return this.lr},function(a){this.lr!==a&&(u.j(a,"number",gm,"radius"),0<a||isNaN(a))&&(this.lr=a,this.H())});
u.defineProperty(gm,{QF:"aspectRatio"},function(){return this.yp},function(a){this.yp!==a&&(u.j(a,"number",gm,"aspectRatio"),0<a&&(this.yp=a,this.H()))});u.defineProperty(gm,{Je:"startAngle"},function(){return this.Mr},function(a){this.Mr!==a&&(u.j(a,"number",gm,"startAngle"),this.Mr=a,this.H())});u.defineProperty(gm,{Qf:"sweepAngle"},function(){return this.Pr},function(a){this.Pr!==a&&(u.j(a,"number",gm,"sweepAngle"),this.Pr=0<a&&360>=a?a:360,this.H())});
u.defineProperty(gm,{Gf:"arrangement"},function(){return this.Yc},function(a){this.Yc!==a&&(u.rb(a,gm,gm,"arrangement"),a===Am||a===zm||a===ym||a===xm)&&(this.Yc=a,this.H())});u.defineProperty(gm,{direction:"direction"},function(){return this.la},function(a){this.la!==a&&(u.rb(a,gm,gm,"direction"),a===om||a===wm||a===mm||a===nm)&&(this.la=a,this.H())});
u.defineProperty(gm,{sorting:"sorting"},function(){return this.Fh},function(a){this.Fh!==a&&(u.rb(a,gm,gm,"sorting"),a===jm||a===km||a===hm||im||a===lm)&&(this.Fh=a,this.H())});u.defineProperty(gm,{comparer:"comparer"},function(){return this.ph},function(a){this.ph!==a&&(u.j(a,"function",gm,"comparer"),this.ph=a,this.H())});u.defineProperty(gm,{spacing:"spacing"},function(){return this.Gh},function(a){this.Gh!==a&&(u.j(a,"number",gm,"spacing"),this.Gh=a,this.H())});
u.defineProperty(gm,{qw:"nodeDiameterFormula"},function(){return this.Zq},function(a){this.Zq!==a&&(u.rb(a,gm,gm,"nodeDiameterFormula"),a===Cm||a===Bm)&&(this.Zq=a,this.H())});u.u(gm,{JF:"actualXRadius"},function(){return this.td});u.u(gm,{KF:"actualYRadius"},function(){return this.jg});u.u(gm,{FI:"actualSpacing"},function(){return this.mk});u.u(gm,{IF:"actualCenter"},function(){return isNaN(this.Ud.x)||isNaN(this.Ud.y)?new w(0,0):new w(this.Ud.x+this.JF,this.Ud.y+this.KF)});var zm;
gm.ConstantSpacing=zm=u.s(gm,"ConstantSpacing",0);var ym;gm.ConstantDistance=ym=u.s(gm,"ConstantDistance",1);var xm;gm.ConstantAngle=xm=u.s(gm,"ConstantAngle",2);var Am;gm.Packed=Am=u.s(gm,"Packed",3);var om;gm.Clockwise=om=u.s(gm,"Clockwise",4);var wm;gm.Counterclockwise=wm=u.s(gm,"Counterclockwise",5);var mm;gm.BidirectionalLeft=mm=u.s(gm,"BidirectionalLeft",6);var nm;gm.BidirectionalRight=nm=u.s(gm,"BidirectionalRight",7);var jm;gm.Forwards=jm=u.s(gm,"Forwards",8);var km;
gm.Reverse=km=u.s(gm,"Reverse",9);var hm;gm.Ascending=hm=u.s(gm,"Ascending",10);var im;gm.Descending=im=u.s(gm,"Descending",11);var lm;gm.Optimized=lm=u.s(gm,"Optimized",12);var Cm;gm.Pythagorean=Cm=u.s(gm,"Pythagorean",13);var Bm;gm.Circular=Bm=u.s(gm,"Circular",14);function fp(){this.Ao=-Infinity;this.lp=this.Qm=null}
fp.prototype.compare=function(a,b){if(0<a&&0>this.Ao||Math.abs(a)<Math.abs(this.Ao)&&!(0>a&&0<this.Ao)){this.Ao=a;this.Qm=[];this.lp=[];for(var c=0;c<b.length;c++)this.Qm[c]=b[c].kb.x,this.lp[c]=b[c].kb.y}};fp.prototype.commit=function(a){if(null!==this.Qm&&null!==this.lp)for(var b=0;b<this.Qm.length;b++){var c=a.ja(b);c.x=this.Qm[b];c.y=this.lp[b]}};function gp(){xa.call(this)}u.Ga(gp,xa);u.fa("CircularNetwork",gp);gp.prototype.createVertex=function(){return new hp};gp.prototype.createEdge=function(){return new up};
function hp(){ya.call(this);this.actualAngle=this.diameter=NaN}u.Ga(hp,ya);u.fa("CircularVertex",hp);
function ip(a,b){var c=a.network;if(null===c)return NaN;c=c.Qb;if(null===c)return NaN;if(c.Gf===Am)if(c.qw===Bm)a.diameter=Math.max(a.width,a.height);else{var c=Math.abs(Math.sin(b)),d=Math.abs(Math.cos(b));if(0===c)return a.width;if(0===d)return a.height;a.diameter=Math.min(a.height/c,a.width/d)}else a.diameter=c.qw===Bm?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function up(){Aa.call(this)}u.Ga(up,Aa);u.fa("CircularEdge",up);
function vp(){0<arguments.length&&u.Wc(vp);Je.call(this);this.ig=null;this.vq=0;this.Uf=(new ia(100,100)).freeze();this.xp=!1;this.Eh=!0;this.oh=!1;this.On=100;this.Up=1;this.yh=1E3;this.mr=Math;this.mn=.05;this.ln=50;this.hn=150;this.kn=0;this.Op=10;this.Np=5}u.Ga(vp,Je);u.fa("ForceDirectedLayout",vp);
vp.prototype.cloneProtected=function(a){Je.prototype.cloneProtected.call(this,a);a.Uf.assign(this.Uf);a.xp=this.xp;a.Eh=this.Eh;a.oh=this.oh;a.On=this.On;a.Up=this.Up;a.yh=this.yh;a.mr=this.mr;a.mn=this.mn;a.ln=this.ln;a.hn=this.hn;a.kn=this.kn;a.Op=this.Op;a.Np=this.Np};vp.prototype.createNetwork=function(){return new wp};
vp.prototype.doLayout=function(a){null===a&&u.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));a=this.Az;if(0<this.network.vertexes.count){this.network.Qv();for(var b=this.network.vertexes.i;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.i;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);
this.Ny();this.vq=0;if(this.needsClusterLayout()){b=this.network;for(c=b.oI().i;c.next();){this.network=c.value;for(var d=this.network.vertexes.i;d.next();){var e=d.value;e.Of=e.vertexes.count;e.Rj=1;e.rm=null;e.hh=null}xp(this,0,a)}this.network=b;c.reset();for(var d=this.QC,f=c.count,h=!0,k=e=0,l=u.eb(),m=0;m<f+b.vertexes.count+2;m++)l[m]=null;f=0;c.reset();for(var n=u.Sf();c.next();)if(m=c.value,this.kg(m,n),h)h=!1,e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new w(n.x+n.width+d.width,n.y),l[1]=new w(n.x,
n.y+n.height+d.height),f=2;else{var p=yp(l,f,e,k,n.width,n.height,d),q=l[p],r=new w(q.x+n.width+d.width,q.y),s=new w(q.x,q.y+n.height+d.height);p+1<f&&l.splice(p+1,0,null);l[p]=r;l[p+1]=s;f++;p=q.x-n.x;q=q.y-n.y;for(m=m.vertexes.i;m.next();)r=m.value,r.Ja+=p,r.Ua+=q}u.ic(n);for(m=b.vertexes.i;m.next();)h=m.value,n=h.kb,2>f?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new w(n.x+n.width+d.width,n.y),l[1]=new w(n.x,n.y+n.height+d.height),f=2):(p=yp(l,f,e,k,n.width,n.height,d),q=l[p],r=new w(q.x+n.width+d.width,
q.y),s=new w(q.x,q.y+n.height+d.height),p+1<f&&l.splice(p+1,0,null),l[p]=r,l[p+1]=s,f++,h.Ja=q.x+h.width/2,h.Ua=q.y+h.height/2);u.ra(l);for(c.reset();c.next();){d=c.value;for(e=d.vertexes.i;e.next();)b.Mk(e.value);for(d=d.edges.i;d.next();)b.ko(d.value)}}zp(this,a);this.updateParts()}this.On=a;this.network=null;this.vf=!0};
vp.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().kb,d=this.network.vertexes.i;d.next();){if(d.value.kb.sg(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};vp.prototype.kg=function(a,b){for(var c=!0,d=a.vertexes.i;d.next();){var e=d.value;c?(c=!1,b.set(e.kb)):b.Sh(e.kb)}return b};
function xp(a,b,c){if(Ap(a,b)){var d=a.yh;a.yh*=1+1/(b+1);var e=Bp(a,b),f=Math.max(0,Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10));a.Az+=f;xp(a,b+1,c);zp(a,f);Cp(a,e);b=a.ig;null===b?b=new E(Dp):b.clear();b.Td(e.vertexes);b.sort(function(a,b){return null===a||null===b||a===b?0:b.Of-a.Of});for(e=b.i;e.next();)Ep(a,e.value);a.yh=d}}
function Ap(a,b){if(10<b||3>a.network.vertexes.count)return!1;null===a.ig?a.ig=new E(Dp):a.ig.clear();a.ig.Td(a.network.vertexes);var c=a.ig;c.sort(function(a,b){return null===a||null===b||a===b?0:b.Of-a.Of});for(var d=c.count-1;0<=d&&1>=c.ja(d).Of;)d--;return 1<c.count-d}
function Bp(a,b){for(var c=a.network,d=new wp,e=a.ig.i;e.next();){var f=e.value;if(1<f.Of){d.Mk(f);var h=new Fp;h.Sw=f.Of;h.Vw=f.width;h.Rw=f.height;h.qA=f.M.x;h.rA=f.M.y;null===f.hh&&(f.hh=new E(Fp));f.hh.add(h);f.Yz=f.hh.count-1}else break}for(var k=c.edges.i;k.next();)if(e=k.value,e.fromVertex.network===d&&e.toVertex.network===d)d.ko(e);else if(e.fromVertex.network===d){var l=e.fromVertex.rm;null===l&&(l=new E(Dp),e.fromVertex.rm=l);l.add(e.toVertex);e.fromVertex.Of--;e.fromVertex.Rj+=e.toVertex.Rj}else e.toVertex.network===
d&&(l=e.toVertex.rm,null===l&&(l=new E(Dp),e.toVertex.rm=l),l.add(e.fromVertex),e.toVertex.Of--,e.toVertex.Rj+=e.fromVertex.Rj);for(e=d.edges.i;e.next();)f=e.value,f.length*=Math.max(1,K.sqrt((f.fromVertex.Rj+f.toVertex.Rj)/(4*b+1)));for(e=d.vertexes.i;e.next();)if(f=e.value,l=f.rm,null!==l&&0<l.count&&(h=f.hh.ja(f.hh.count-1),h=h.Sw-f.Of,!(0>=h))){for(var m=0,n=0,p=l.count-h;p<l.count;p++){for(var q=l.ja(p),r=null,k=q.edges.i;k.next();){var s=k.value;if(s.GG(q)===f){r=s;break}}null!==r&&(n+=r.length,
m+=q.width*q.height)}l=f.Ja;k=f.Ua;p=f.width;q=f.height;r=f.M;s=p*q;1>s&&(s=1);m=K.sqrt((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;f.kb=new z(l-r.x-h,k-r.y-m,p+2*h,q+2*m);f.focus=new w(r.x+h,r.y+m)}a.network=d;return c}function Cp(a,b){for(var c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.hh){var e=d.hh.ja(d.Yz);d.Of=e.Sw;var f=e.qA,h=e.rA;d.kb=new z(d.Ja-f,d.Ua-h,e.Vw,e.Rw);d.focus=new w(f,h);d.Yz--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b}
function Ep(a,b){var c=b.rm;if(null!==c&&0!==c.count){var d=b.Ja,e=b.Ua,f=b.width,h=b.height;null!==b.hh&&0<b.hh.count&&(h=b.hh.ja(0),f=h.Vw,h=h.Rw);for(var f=K.sqrt(f*f+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.i;n.next();){var p=n.value;1>=p.Of?l++:(k=!0,m++,h+=Math.atan2(b.Ua-p.Ua,b.Ja-p.Ja))}if(0!==l)for(0<m&&(h/=m),n=m=0,m=k?2*Math.PI/(l+1):2*Math.PI/l,0===l%2&&(n=m/2),1<c.count&&c.sort(function(a,b){return null===a||null===b||a===b?0:b.width*b.height-a.width*a.height}),k=0===l%2?0:1,c=c.i;c.next();)if(l=
c.value,!(1<l.Of||a.isFixed(l))){for(var p=null,q=l.edges.i;q.next();){p=q.value;break}var q=l.width,r=l.height,q=K.sqrt(q*q+r*r)/2,p=f+p.length+q,q=h+(m*(k/2>>1)+n)*(0===k%2?1:-1);l.Ja=d+p*Math.cos(q);l.Ua=e+p*Math.sin(q);k++}}}function yp(a,b,c,d,e,f,h){var k=9E19,l=-1,m=0;a:for(;m<b;m++){var n=a[m],p=n.x-c,q=n.y-d,p=p*p+q*q;if(p<k){for(q=m-1;0<=q;q--)if(a[q].y>n.y&&a[q].x-n.x<e+h.width)continue a;for(q=m+1;q<b;q++)if(a[q].x>n.x&&a[q].y-n.y<f+h.height)continue a;l=m;k=p}}return l}
vp.prototype.Ny=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
vp.prototype.addComments=function(a){var b=a.Cc;if(null!==b)for(b=b.rD();b.next();){var c=b.value;if("Comment"===c.Kc&&c.Ea()){var d=this.network.Am(c);null===d&&(d=this.network.ds(c));d.charge=this.lG;for(var c=null,e=d.bc;e.next();){var f=e.value;if(f.toVertex===a){c=f;break}}if(null===c)for(e=d.kc;e.next();)if(f=e.value,f.fromVertex===a){c=f;break}null===c&&(c=this.network.No(a,d,null));c.length=this.mG}}};
function Gp(a,b){var c=a.aa,d=c.x,e=c.y,f=c.width,c=c.height,h=b.aa,k=h.x,l=h.y,m=h.width,h=h.height;return d+f<k?e>l+h?(d=d+f-k,e=e-l-h,K.sqrt(d*d+e*e)):e+c<l?(d=d+f-k,e=e+c-l,K.sqrt(d*d+e*e)):k-(d+f):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,K.sqrt(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,K.sqrt(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):.1}function zp(a,b){a.ig=null;for(var c=a.vq+b;a.vq<c&&(a.vq++,Hp(a)););a.ig=null}
function Hp(a){null===a.ig&&(a.ig=new E(Dp),a.ig.Td(a.network.vertexes));var b=a.ig.n;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.Ja,e=d,f=c.Ua,h=f,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.Ja,k=k.Ua,d=Math.min(d,l),e=Math.max(e,l),f=Math.min(f,k),h=Math.max(h,k)}(f=e-d>h-f)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.Ja-b.Ja}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.Ua-b.Ua});for(var h=a.yh,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
b[c],l=k.aa,q=k.M,d=l.x+q.x,l=l.y+q.y,n=k.charge*a.electricalFieldX(d,l),p=k.charge*a.electricalFieldY(d,l),n=n+k.mass*a.gravitationalFieldX(d,l),p=p+k.mass*a.gravitationalFieldY(d,l);k.forceX+=n;k.forceY+=p;for(q=c+1;q<b.length;q++)if(e=b[q],e!==k){var r=e.aa,n=e.M,p=r.x+n.x,r=r.y+n.y;if(d-p>h||p-d>h){if(f)break}else if(l-r>h||r-l>h){if(!f)break}else{var s=Gp(k,e);1>s?(n=a.xw,null===n&&(a.xw=n=new Ga(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.aa.right-k.aa.x),n=(1+n)*m):d<p?(n=Math.abs(e.aa.x-
k.aa.right),n=-(1+n)*m):(n=Math.max(e.width,k.width),n=(1+n)*m-n/2),l>r?(p=Math.abs(e.aa.bottom-k.aa.y),p=(1+p)*s):d<p?(p=Math.abs(e.aa.y-k.aa.bottom),p=-(1+p)*s):(p=Math.max(e.height,k.height),p=(1+p)*s-p/2)):(m=-(k.charge*e.charge)/(s*s),n=(p-d)/s*m,p=(r-l)/s*m);k.forceX+=n;k.forceY+=p;e.forceX-=n;e.forceY-=p}}}for(c=a.network.edges.i;c.next();)f=c.value,k=f.fromVertex,e=f.toVertex,l=k.aa,q=k.M,d=l.x+q.x,l=l.y+q.y,r=e.aa,n=e.M,p=r.x+n.x,r=r.y+n.y,s=Gp(k,e),1>s?(n=a.xw,null===n&&(a.xw=n=new Ga(0)),
m=n.random(),s=n.random(),n=(d>p?1:-1)*(1+(e.width>k.width)?e.width:k.width)*m,p=(l>r?1:-1)*(1+(e.height>k.height)?e.height:k.height)*s):(m=f.stiffness*(s-f.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.yh/20,50);for(e=0;e<b.length;e++)k=b[e],a.isFixed(k)?a.moveFixedVertex(k):(f=k.forceX,h=k.forceY,f<-d?f=-d:f>d&&(f=d),h<-d?h=-d:h>d&&(h=d),k.Ja+=f,k.Ua+=h,c=Math.max(c,f*f+h*h));return c>a.oD*a.oD}vp.prototype.moveFixedVertex=function(){};
vp.prototype.commitLayout=function(){this.cA();this.commitNodes();this.Qs&&this.commitLinks()};vp.prototype.cA=function(){if(this.fp)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.vb=uc,b.xb=uc)}};vp.prototype.commitNodes=function(){var a=0,b=0;if(this.PF){var c=u.Sf();this.kg(this.network,c);b=this.Ud;a=b.x-c.x;b=b.y-c.y;u.ic(c)}for(var c=u.Sf(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.kb),c.x+=a,c.y+=b,e.kb=c;e.commit()}u.ic(c)};
vp.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};vp.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.mn:a};vp.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.ln:a};vp.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.hn:a};vp.prototype.electricalFieldX=function(){return 0};vp.prototype.electricalFieldY=function(){return 0};
vp.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.kn:a};vp.prototype.gravitationalFieldX=function(){return 0};vp.prototype.gravitationalFieldY=function(){return 0};vp.prototype.isFixed=function(a){return a.isFixed};u.u(vp,{gJ:"currentIteration"},function(){return this.vq});u.defineProperty(vp,{QC:"arrangementSpacing"},function(){return this.Uf},function(a){u.C(a,ia,vp,"arrangementSpacing");this.Uf.L(a)||(this.Uf.assign(a),this.H())});
u.defineProperty(vp,{PF:"arrangesToOrigin"},function(){return this.xp},function(a){this.xp!==a&&(u.j(a,"boolean",vp,"arrangesToOrigin"),this.xp=a,this.H())});u.defineProperty(vp,{fp:"setsPortSpots"},function(){return this.Eh},function(a){this.Eh!==a&&(u.j(a,"boolean",vp,"setsPortSpots"),this.Eh=a,this.H())});u.defineProperty(vp,{comments:"comments"},function(){return this.oh},function(a){this.oh!==a&&(u.j(a,"boolean",vp,"comments"),this.oh=a,this.H())});
u.defineProperty(vp,{Az:"maxIterations"},function(){return this.On},function(a){this.On!==a&&(u.j(a,"number",vp,"maxIterations"),0<=a&&(this.On=a,this.H()))});u.defineProperty(vp,{oD:"epsilonDistance"},function(){return this.Up},function(a){this.Up!==a&&(u.j(a,"number",vp,"epsilonDistance"),0<a&&(this.Up=a,this.H()))});u.defineProperty(vp,{AJ:"infinityDistance"},function(){return this.yh},function(a){this.yh!==a&&(u.j(a,"number",vp,"infinityDistance"),1<a&&(this.yh=a,this.H()))});
u.defineProperty(vp,{xw:"randomNumberGenerator"},function(){return this.mr},function(a){this.mr!==a&&(null!==a&&"function"!==typeof a.random&&u.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.mr=a)});u.defineProperty(vp,{tJ:"defaultSpringStiffness"},function(){return this.mn},function(a){this.mn!==a&&(u.j(a,"number",vp,"defaultSpringStiffness"),this.mn=a,this.H())});
u.defineProperty(vp,{sJ:"defaultSpringLength"},function(){return this.ln},function(a){this.ln!==a&&(u.j(a,"number",vp,"defaultSpringLength"),this.ln=a,this.H())});u.defineProperty(vp,{mJ:"defaultElectricalCharge"},function(){return this.hn},function(a){this.hn!==a&&(u.j(a,"number",vp,"defaultElectricalCharge"),this.hn=a,this.H())});u.defineProperty(vp,{nJ:"defaultGravitationalMass"},function(){return this.kn},function(a){this.kn!==a&&(u.j(a,"number",vp,"defaultGravitationalMass"),this.kn=a,this.H())});
u.defineProperty(vp,{mG:"defaultCommentSpringLength"},function(){return this.Op},function(a){this.Op!==a&&(u.j(a,"number",vp,"defaultCommentSpringLength"),this.Op=a,this.H())});u.defineProperty(vp,{lG:"defaultCommentElectricalCharge"},function(){return this.Np},function(a){this.Np!==a&&(u.j(a,"number",vp,"defaultCommentElectricalCharge"),this.Np=a,this.H())});function Fp(){this.rA=this.qA=this.Rw=this.Vw=this.Sw=0}function wp(){xa.call(this)}u.Ga(wp,xa);u.fa("ForceDirectedNetwork",wp);
wp.prototype.createVertex=function(){return new Dp};wp.prototype.createEdge=function(){return new Ip};function Dp(){ya.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.Rj=this.Of=this.forceY=this.forceX=0;this.hh=this.rm=null;this.Yz=0}u.Ga(Dp,ya);u.fa("ForceDirectedVertex",Dp);function Ip(){Aa.call(this);this.length=this.stiffness=NaN}u.Ga(Ip,Aa);u.fa("ForceDirectedEdge",Ip);
function Yl(){0<arguments.length&&u.Wc(Yl);Je.call(this);this.sd=this.Ql=25;this.la=0;this.gn=Op;this.Mn=Sp;this.Bn=Tp;this.Nl=4;this.Wm=Up;this.oi=Vp;this.Eh=!0;this.gj=4;this.Hb=this.Fu=this.jb=-1;this.Cf=this.Nq=0;this.Kb=this.Bf=this.$f=this.Lg=this.Ld=null;this.Uq=0;this.Tq=this.Sl=null;this.cg=0;this.Vq=null;this.Ng=[];this.Ng.length=100}u.Ga(Yl,Je);u.fa("LayeredDigraphLayout",Yl);
Yl.prototype.cloneProtected=function(a){Je.prototype.cloneProtected.call(this,a);a.Ql=this.Ql;a.sd=this.sd;a.la=this.la;a.gn=this.gn;a.Mn=this.Mn;a.Bn=this.Bn;a.Nl=this.Nl;a.Wm=this.Wm;a.oi=this.oi;a.Eh=this.Eh;a.gj=this.gj};Yl.prototype.createNetwork=function(){return new Wp};
Yl.prototype.doLayout=function(a){null===a&&u.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.Ud=this.initialOrigin(this.Ud);this.Fu=-1;this.Cf=this.Nq=0;this.Vq=this.Tq=this.Sl=null;for(a=0;a<this.Ng.length;a++)this.Ng[a]=null;if(0<this.network.vertexes.count){this.network.Qv();for(a=this.network.edges.i;a.next();)a.value.rev=!1;switch(this.gn){default:case Xp:var b=0,c=this.network.vertexes.count-
1;a=[];a.length=c+1;for(var d=this.network.vertexes.i;d.next();)d.value.valid=!0;for(;null!==Yp(this.network);){for(d=Zp(this.network);null!==d;)a[c]=d,c--,d.valid=!1,d=Zp(this.network);for(d=$p(this.network);null!==d;)a[b]=d,b++,d.valid=!1,d=$p(this.network);for(var d=null,e=0,f=this.network.vertexes.i;f.next();){var h=f.value;if(h.valid){for(var k=0,l=h.bc;l.next();)l.value.toVertex.valid&&k++;for(var l=0,m=h.kc;m.next();)m.value.fromVertex.valid&&l++;if(null===d||e<k-l)d=h,e=k-l}}null!==d&&(a[b]=
d,b++,d.valid=!1)}for(b=0;b<this.network.vertexes.count;b++)a[b].index=b;for(a=this.network.edges.i;a.next();)b=a.value,b.fromVertex.index>b.toVertex.index&&(this.network.yw(b),b.rev=!0);break;case Op:for(b=this.network.vertexes.i;b.next();)a=b.value,a.wo=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.Uq=0;for(b.reset();b.next();)c=b.value,0===c.kc.count&&aq(this,c);for(b.reset();b.next();)c=b.value,-1===c.wo&&aq(this,c);for(a.reset();a.next();)b=a.value,b.forest||(c=b.fromVertex,
d=c.finish,e=b.toVertex,f=e.finish,e.wo<c.wo&&d<f&&(this.network.yw(b),b.rev=!0))}for(a=this.network.vertexes.i;a.next();)a.value.layer=-1;this.jb=-1;this.assignLayers();for(a.reset();a.next();)this.jb=Math.max(this.jb,a.value.layer);a=[];for(c=this.network.edges.i;c.next();)b=c.value,b.valid=!1,a.push(b);for(c=0;c<a.length;c++)if(b=a[c],!b.valid&&(null!==b.fromVertex.kd&&null!==b.toVertex.kd||b.fromVertex.layer!==b.toVertex.layer)){l=h=k=f=0;e=b.fromVertex;d=b.toVertex;if(null!==b.link){k=b.link;
if(null===k)continue;var n=e.kd,f=d.kd;if(null===n||null===f)continue;var p=k.W,h=k.ca,q=k.od,l=k.fe;b.rev&&(k=p,m=q,p=h,q=l,h=k,l=m);var r=e.M,k=b.toVertex.M,s=b.rev?d.aa:e.aa,m=u.K();s.J()?(On(p,q,Ib,m),m.J()||m.assign(r)):m.assign(r);n!==p&&s.J()&&p.Ea()&&(n=e.aa,n.J()&&(m.x+=s.x-n.x,m.y+=s.y-n.y));p=b.rev?e.aa:d.aa;n=u.K();p.J()?(On(h,l,Ib,n),n.J()||n.assign(k)):n.assign(k);f!==h&&p.J()&&h.Ea()&&(f=d.aa,f.J()&&(n.x+=p.x-f.x,n.y+=p.y-f.y));90===this.la||270===this.la?(f=Math.round((m.x-r.x)/this.sd),
h=m.x,k=Math.round((n.x-k.x)/this.sd),l=n.x):(f=Math.round((m.y-r.y)/this.sd),h=m.y,k=Math.round((n.y-k.y)/this.sd),l=n.y);u.v(m);u.v(n);b.portFromColOffset=f;b.portFromPos=h;b.portToColOffset=k;b.portToPos=l}else b.portFromColOffset=0,b.portFromPos=0,b.portToColOffset=0,b.portToPos=0;m=e.layer;r=d.layer;n=b;p=0;s=n.link;if(null!==s){var t=s.od,v=s.fe;if(null!==t&&null!==v){var x=s.W,q=s.ca;if(null!==x&&null!==q){var B=t.vb,y=v.xb;this.fp||(s.vb.Lc()||(B=s.vb),s.xb.Lc()||(y=s.xb));if(B.Lc()||B===
vb)B=bq(this,!0);if(y.Lc()||y===vb)y=bq(this,!1);var C=s.dc,I=s.getLinkPoint(x,t,B,!0,C,q,v,u.K()),B=s.getLinkDirection(x,t,I,B,!0,C,q,v);u.v(I);B===cq(this,n,!0)?p+=1:this.fp&&null!==x&&1===x.ports.count&&n.rev&&(p+=1);I=s.getLinkPoint(q,v,y,!1,C,x,t,u.K());s=s.getLinkDirection(q,v,I,y,!1,C,x,t);u.v(I);s===cq(this,n,!1)?p+=2:this.fp&&null!==q&&1===q.ports.count&&n.rev&&(p+=2)}}}n=1===p||3===p?!0:!1;if(p=2===p||3===p?!0:!1)q=this.network.createVertex(),q.kd=null,q.om=1,q.layer=m,q.near=e,this.network.Mk(q),
e=this.network.No(e,q,b.link),e.valid=!1,e.rev=b.rev,e.portFromColOffset=f,e.portToColOffset=0,e.portFromPos=h,e.portToPos=0,e=q;s=1;n&&s--;if(m-r>s&&0<m){b.valid=!1;q=this.network.createVertex();q.kd=null;q.om=2;q.layer=m-1;this.network.Mk(q);e=this.network.No(e,q,b.link);e.valid=!0;e.rev=b.rev;e.portFromColOffset=p?0:f;e.portToColOffset=0;e.portFromPos=p?0:h;e.portToPos=0;e=q;for(m--;m-r>s&&0<m;)q=this.network.createVertex(),q.kd=null,q.om=3,q.layer=m-1,this.network.Mk(q),e=this.network.No(e,q,
b.link),e.valid=!0,e.rev=b.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,m--;e=this.network.No(q,d,b.link);e.valid=!n;n&&(q.near=d);e.rev=b.rev;e.portFromColOffset=0;e.portToColOffset=k;e.portFromPos=0;e.portToPos=l}else b.valid=!0}b=this.Ld=[];for(c=0;c<=this.jb;c++)b[c]=0;for(a=this.network.vertexes.i;a.next();)c=a.value,c.index=-1;this.initializeIndices();this.Fu=-1;for(c=this.Cf=this.Nq=0;c<=this.jb;c++)b[c]>b[this.Cf]&&(this.Fu=b[c]-1,this.Cf=c),b[c]<b[this.Nq]&&
(this.Nq=c);this.Vq=[];for(c=0;c<b.length;c++)this.Vq[c]=[];for(a.reset();a.next();)b=a.value,c=this.Vq[b.layer],c[b.index]=b;this.Hb=-1;for(a=0;a<=this.jb;a++){b=dq(this,a);c=0;d=this.Ld[a];for(e=0;e<d;e++)f=b[e],c+=this.nodeMinColumnSpace(f,!0),f.column=c,c+=1,c+=this.nodeMinColumnSpace(f,!1);this.Hb=Math.max(this.Hb,c-1);eq(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.vf=!0};
Yl.prototype.linkMinLength=function(a){var b=a.toVertex,c=0;for(a=a.fromVertex.bc;a.next();)a.value.toVertex===b&&c++;return 1<c?2:1};function fq(a){var b=a.fromVertex.kd;a=a.toVertex.kd;return null===b&&null===a?8:null===b||null===a?4:1}Yl.prototype.nodeMinLayerSpace=function(a,b){return null===a.kd?0:90===this.la||270===this.la?b?a.M.y+10:a.aa.height-a.M.y+10:b?a.M.x+10:a.aa.width-a.M.x+10};
Yl.prototype.nodeMinColumnSpace=function(a,b){if(null===a.kd)return 0;var c=b?a.Iz:a.Hz;if(null!==c)return c;c=this.la;return 90===c||270===c?b?a.Iz=a.M.x/this.sd+1|0:a.Hz=(a.aa.width-a.M.x)/this.sd+1|0:b?a.Iz=a.M.y/this.sd+1|0:a.Hz=(a.aa.height-a.M.y)/this.sd+1|0};function gq(a){null===a.Sl&&(a.Sl=[]);for(var b=0,c=a.network.vertexes.i;c.next();){var d=c.value;a.Sl[b]=d.layer;b++;a.Sl[b]=d.column;b++;a.Sl[b]=d.index;b++}return a.Sl}
function hq(a,b){for(var c=0,d=a.network.vertexes.i;d.next();){var e=d.value;e.layer=b[c];c++;e.column=b[c];c++;e.index=b[c];c++}}
function iq(a,b,c){var d=dq(a,b),e=a.Ld[b];if(null===a.Tq||a.Tq.length<e*e)a.Tq=[];for(var f=a.Tq,h=0;h<e;h++){var k=0,l=d[h],m=l.near,n=0;if(null!==m&&m.layer===l.layer)if(n=m.index,n>h)for(var p=h+1;p<n;p++)l=d[p],l.near===m&&l.om===m.om||k++;else for(p=h-1;p>n;p--)l=d[p],l.near===m&&l.om===m.om||k++;var m=0,q,r=q=p=l=0,s,t=0,v=0;s=0;var x;if(0<=c)for(n=d[h].Ie,m=0;m<n.count;m++)if(q=n.n[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=
n.n[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,v=s.portToPos,s=s.portFromPos,p<v&&(l>t||l===t&&q>s)&&k++,v<p&&(t>l||t===l&&s>q)&&k++);if(0>=c)for(n=d[h].Ce,m=0;m<n.count;m++)if(q=n.n[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=n.n[r],s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,v=s.portToPos,s=s.portFromPos,q<s&&(l>t||l===t&&p>v)&&k++,s<q&&(t>l||t===l&&v>p)&&k++);f[h*e+h]=k;for(n=h+1;n<e;n++){var B=0,y=0;if(0<=c)for(k=
d[h].Ie,x=d[n].Ie,m=0;m<k.count;m++)if(q=k.n[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,q=q.portFromPos,r=0;r<x.count;r++)s=x.n[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,s=s.portFromPos,(l<t||l===t&&q<s)&&y++,(t<l||t===l&&s<q)&&B++);if(0>=c)for(k=d[h].Ce,x=d[n].Ce,m=0;m<k.count;m++)if(q=k.n[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,r=0;r<x.count;r++)s=x.n[r],s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,v=s.portToPos,(l<t||l===t&&p<
v)&&y++,(t<l||t===l&&v<p)&&B++);f[h*e+n]=B;f[n*e+h]=y}}eq(a,b,d);return f}Yl.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.jb;b++)for(var c=iq(this,b,1),d=this.Ld[b],e=0;e<d;e++)for(var f=e;f<d;f++)a+=c[e*d+f];return a};
function jq(a){for(var b=0,c=0;c<=a.jb;c++){for(var d=a,e=c,f=dq(d,e),h=d.Ld[e],k=0,l=0;l<h;l++){var m=null,m=f[l].Ce,n,p=0,q=0;if(null!==m)for(var r=0;r<m.count;r++)n=m.n[r],n.valid&&n.toVertex.layer!==e&&(p=n.fromVertex.column+n.portFromColOffset,q=n.toVertex.column+n.portToColOffset,k+=(Math.abs(p-q)+1)*fq(n))}eq(d,e,f);b+=k}return b}
Yl.prototype.normalize=function(){var a=Infinity;this.Hb=-1;for(var b=this.network.vertexes.i;b.next();){var c=b.value,a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Hb=Math.max(this.Hb,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Hb-=a};
function kq(a,b,c){for(var d=dq(a,b),e=a.Ld[b],f=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ie);var m=null;0<=c&&(m=k.Ce);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q<l.count;q++){var k=l.n[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(n+=r.column+k.portFromColOffset,p++)}if(null!==m)for(l=0;l<m.count;l++)k=m.n[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column+k.portToColOffset,p++);f[h]=0===p?-1:n/p}eq(a,b,d);return f}
function lq(a,b,c){for(var d=dq(a,b),e=a.Ld[b],f=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ie);var m=null;0<=c&&(m=k.Ce);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q<l.count;q++){var k=l.n[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(p[n]=r.column+k.portFromColOffset,n++)}if(null!==m)for(l=0;l<m.count;l++)k=m.n[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(p[n]=q.column+k.portToColOffset,n++);0===n?f[h]=-1:(p.sort(function(a,b){return a-b}),
m=n>>1,f[h]=n&1?p[m]:p[m-1]+p[m]>>1)}eq(a,b,d);return f}function mq(a,b,c,d,e,f){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.bc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&mq(a,m,c,d,e,f)}if(f)for(l=b.kc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&mq(a,m,c,d,e,f)}}
function nq(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var h=b.bc;h.next();)nq(a,h.value.toVertex,c,d,e,f);if(f)for(b=b.kc;b.next();)nq(a,b.value.fromVertex,c,d,e,f)}}function Yp(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function Zp(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.bc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
function $p(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.kc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function aq(a,b){b.wo=a.Uq;a.Uq++;for(var c=b.bc;c.next();){var d=c.value,e=d.toVertex;-1===e.wo&&(d.forest=!0,aq(a,e))}b.finish=a.Uq;a.Uq++}
Yl.prototype.assignLayers=function(){switch(this.Mn){case oq:pq(this);break;case qq:for(var a=0,b=this.network.vertexes.i;b.next();)a=rq(this,b.value),this.jb=Math.max(a,this.jb);for(b.reset();b.next();)a=b.value,a.layer=this.jb-a.layer;break;default:case Sp:pq(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.kc.count&&sq(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.jb=-1;for(b.reset();b.next();){var c=b.value;c.layer-=
a;this.jb=Math.max(this.jb,c.layer)}}};function pq(a){for(var b=a.network.vertexes.i;b.next();){var c=tq(a,b.value);a.jb=Math.max(c,a.jb)}}function tq(a,b){var c=0;if(-1===b.layer){for(var d=b.bc;d.next();)var e=d.value,f=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,tq(a,f)+e);b.layer=c}else c=b.layer;return c}function rq(a,b){var c=0;if(-1===b.layer){for(var d=b.kc;d.next();)var e=d.value,f=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,rq(a,f)+e);b.layer=c}else c=b.layer;return c}
function sq(a,b){if(!b.valid){b.valid=!0;for(var c=b.bc;c.next();)sq(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Ie.n,e=d.length,f=0;f<e;f++){var h=d[f],k=a.linkMinLength(h);h.fromVertex.layer-h.toVertex.layer>k&&mq(a,h.fromVertex,0,-1,!0,!1)}for(mq(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.i;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Ie.n,e=s.length,f=0;f<e;f++){var h=s[f],t=h.fromVertex,
q=q+1;1!==t.component&&(k+=1,t=t.layer-p.layer,h=a.linkMinLength(h),d=Math.min(d,t-h))}h=p.Ce.n;e=h.length;for(f=0;f<e;f++)s=h[f].toVertex,q-=1,1!==s.component?k-=1:r=!0;(null===m||q<l)&&!r&&(m=p,l=q)}}if(0<k){for(c.reset();c.next();)e=c.value,1===e.component&&(e.layer+=d);b.component=0}else m.component=0}for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(mq(a,b,1,-1,!0,!1);0!==b.component;){f=0;e=Infinity;d=0;k=null;for(l=a.network.vertexes.i;l.next();)if(m=l.value,1===m.component){n=
0;p=!1;h=m.Ie.n;q=h.length;for(r=0;r<q;r++)s=h[r].fromVertex,n+=1,1!==s.component?f+=1:p=!0;h=m.Ce.n;q=h.length;for(r=0;r<q;r++)s=h[r],t=s.toVertex,n-=1,1!==t.component&&(f-=1,t=m.layer-t.layer,s=a.linkMinLength(s),e=Math.min(e,t-s));(null===k||n>d)&&!p&&(k=m,d=n)}if(0>f){for(c.reset();c.next();)f=c.value,1===f.component&&(f.layer-=e);b.component=0}else k.component=0}}}
function cq(a,b,c){return 90===a.la?c&&!b.rev||!c&&b.rev?270:90:180===a.la?c&&!b.rev||!c&&b.rev?0:180:270===a.la?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
Yl.prototype.initializeIndices=function(){switch(this.Bn){default:case uq:for(var a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;b.index=this.Ld[c];this.Ld[c]++}break;case Tp:a=this.network.vertexes.i;for(b=this.jb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&vq(this,c);break;case wq:for(a=this.network.vertexes.i,b=0;b<=this.jb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&xq(this,c)}};
function vq(a,b){var c=b.layer;b.index=a.Ld[c];a.Ld[c]++;for(var c=b.Ce.Ke(),d=!0;d;)for(var d=!1,e=0;e<c.length-1;e++){var f=c[e],h=c[e+1];f.portFromColOffset>h.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.toVertex,-1===d.index&&vq(a,d))}
function xq(a,b){var c=b.layer;b.index=a.Ld[c];a.Ld[c]++;for(var c=b.Ie.Ke(),d=!0,e=0;d;)for(d=!1,e=0;e<c.length-1;e++){var f=c[e],h=c[e+1];f.portToColOffset>h.portToColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.fromVertex,-1===d.index&&xq(a,d))}
Yl.prototype.reduceCrossings=function(){for(var a=this.countCrossings(),b=gq(this),c=0,d=0,e=0,c=0;c<this.Nl;c++){for(d=0;d<=this.jb;d++)yq(this,d,1),zq(this,d,1);e=this.countCrossings();e<a&&(a=e,b=gq(this));for(d=this.jb;0<=d;d--)yq(this,d,-1),zq(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=gq(this))}hq(this,b);for(c=0;c<this.Nl;c++){for(d=0;d<=this.jb;d++)yq(this,d,0),zq(this,d,0);e=this.countCrossings();e<a&&(a=e,b=gq(this));for(d=this.jb;0<=d;d--)yq(this,d,0),zq(this,d,0);e=this.countCrossings();
e<a&&(a=e,b=gq(this))}hq(this,b);var f=!1,h=c=0,k=0,d=0;switch(this.Wm){case Aq:break;case Bq:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.jb;0<=c;c--)for(h=0;h<=c;h++){for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=zq(this,d,-1)||f;e=this.countCrossings();e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=zq(this,d,1)||f;e=this.countCrossings();e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=zq(this,d,1)||f;e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,
d=h;d<=c;d++)f=zq(this,d,-1)||f;e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=zq(this,d,0)||f;e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=zq(this,d,0)||f;e>=a?hq(this,b):(a=e,b=gq(this))}break;default:case Up:for(c=this.jb,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=zq(this,d,-1)||f;e=this.countCrossings();e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=zq(this,d,1)||f;e=this.countCrossings();
e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=zq(this,d,1)||f;e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=zq(this,d,-1)||f;e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=zq(this,d,0)||f;e>=a?hq(this,b):(a=e,b=gq(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=zq(this,d,0)||f;e>=a?hq(this,b):(a=e,b=gq(this))}}hq(this,b)};
function yq(a,b,c){var d=0,e=dq(a,b),f=a.Ld[b],h=lq(a,b,c);c=kq(a,b,c);for(d=0;d<f;d++)-1===c[d]&&(c[d]=e[d].column),-1===h[d]&&(h[d]=e[d].column);for(var k=!0,l;k;)for(k=!1,d=0;d<f-1;d++)if(h[d+1]<h[d]||h[d+1]===h[d]&&c[d+1]<c[d])k=!0,l=h[d],h[d]=h[d+1],h[d+1]=l,l=c[d],c[d]=c[d+1],c[d+1]=l,l=e[d],e[d]=e[d+1],e[d+1]=l;for(d=h=0;d<f;d++)l=e[d],l.index=d,h+=a.nodeMinColumnSpace(l,!0),l.column=h,h+=1,h+=a.nodeMinColumnSpace(l,!1);eq(a,b,e)}
function zq(a,b,c){var d=dq(a,b),e=a.Ld[b];c=iq(a,b,c);var f=0,h;h=[];for(f=0;f<e;f++)h[f]=-1;var k;k=[];for(f=0;f<e;f++)k[f]=-1;for(var l=!1,m=!0;m;)for(m=!1,f=0;f<e-1;f++){var n=c[d[f].index*e+d[f+1].index],p=c[d[f+1].index*e+d[f].index],q=0,r=0,s=d[f].column,t=d[f+1].column,v=a.nodeMinColumnSpace(d[f],!0),x=a.nodeMinColumnSpace(d[f],!1),B=a.nodeMinColumnSpace(d[f+1],!0),y=a.nodeMinColumnSpace(d[f+1],!1),v=s-v+B,x=t-x+y,B=B=0,C=d[f].kc.i;for(C.reset();C.next();)if(y=C.value,y.valid&&y.fromVertex.layer===
b){y=y.fromVertex;for(B=0;d[B]!==y;)B++;B<f&&(q+=2*(f-B),r+=2*(f+1-B));B===f+1&&(q+=1);B>f+1&&(q+=4*(B-f),r+=4*(B-(f+1)))}C=d[f].bc.i;for(C.reset();C.next();)if(y=C.value,y.valid&&y.toVertex.layer===b){y=y.toVertex;for(B=0;d[B]!==y;)B++;B===f+1&&(r+=1)}C=d[f+1].kc.i;for(C.reset();C.next();)if(y=C.value,y.valid&&y.fromVertex.layer===b){y=y.fromVertex;for(B=0;d[B]!==y;)B++;B<f&&(q+=2*(f+1-B),r+=2*(f-B));B===f&&(r+=1);B>f+1&&(q+=4*(B-(f+1)),r+=4*(B-f))}C=d[f+1].bc.i;for(C.reset();C.next();)if(y=C.value,
y.valid&&y.toVertex.layer===b){y=y.toVertex;for(B=0;d[B]!==y;)B++;B===f&&(q+=1)}var B=y=0,C=h[d[f].index],I=k[d[f].index],H=h[d[f+1].index],T=k[d[f+1].index];-1!==C&&(y+=Math.abs(C-s),B+=Math.abs(C-x));-1!==I&&(y+=Math.abs(I-s),B+=Math.abs(I-x));-1!==H&&(y+=Math.abs(H-t),B+=Math.abs(H-v));-1!==T&&(y+=Math.abs(T-t),B+=Math.abs(T-v));if(r<q-.5||r===q&&p<n-.5||r===q&&p===n&&B<y-.5)m=l=!0,d[f].column=x,d[f+1].column=v,n=d[f],d[f]=d[f+1],d[f+1]=n}for(f=0;f<e;f++)d[f].index=f;eq(a,b,d);return l}
Yl.prototype.straightenAndPack=function(){var a=0,b=!1,c=0!==(this.oi&Cq),a=this.oi===Vp;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=a=0;a<=this.jb;a++)b[a]=0;for(var d=0,e=this.network.vertexes.i;e.next();){var f=e.value,a=f.layer,d=f.column,f=this.nodeMinColumnSpace(f,!1);b[a]=Math.max(b[a],d+f)}for(e.reset();e.next();)f=e.value,a=f.layer,d=f.column,f.column=(8*(this.Hb-b[a])>>1)+8*d;this.Hb*=8}if(0!==(this.oi&Dq))for(b=!0;b;){b=!1;for(a=this.Cf+1;a<=this.jb;a++)b=Eq(this,a,1)||b;
for(a=this.Cf-1;0<=a;a--)b=Eq(this,a,-1)||b;b=Eq(this,this.Cf,0)||b}if(0!==(this.oi&Fq)){for(a=this.Cf+1;a<=this.jb;a++)Gq(this,a,1);for(a=this.Cf-1;0<=a;a--)Gq(this,a,-1);Gq(this,this.Cf,0)}c&&(Hq(this,-1),Hq(this,1));if(0!==(this.oi&Dq))for(b=!0;b;){b=!1;b=Eq(this,this.Cf,0)||b;for(a=this.Cf+1;a<=this.jb;a++)b=Eq(this,a,0)||b;for(a=this.Cf-1;0<=a;a--)b=Eq(this,a,0)||b}};function Eq(a,b,c){for(var d=!1;Iq(a,b,c);)d=!0;return d}
function Iq(a,b,c){var d=0,e=dq(a,b),f=a.Ld[b],h=kq(a,b,-1);if(0<c)for(d=0;d<f;d++)h[d]=-1;var k=kq(a,b,1);if(0>c)for(d=0;d<f;d++)k[d]=-1;for(var l=!1,m=!0;m;)for(m=!1,d=0;d<f;d++){var n=e[d].column,p=a.nodeMinColumnSpace(e[d],!0),q=a.nodeMinColumnSpace(e[d],!1),r=0,r=0>d-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=f||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=0,t=0,v=0,x=0,B=0;if(0>=c)for(var y=e[d].kc.i;y.next();){var C=y.value;C.valid&&C.fromVertex.layer!==
b&&(v=fq(C),x=C.portFromColOffset,B=C.portToColOffset,C=C.fromVertex.column,q+=(Math.abs(n+B-(C+x))+1)*v,s+=(Math.abs(r+B-(C+x))+1)*v,t+=(Math.abs(p+B-(C+x))+1)*v)}if(0<=c)for(y=e[d].bc.i;y.next();)C=y.value,C.valid&&C.toVertex.layer!==b&&(v=fq(C),x=C.portFromColOffset,B=C.portToColOffset,C=C.toVertex.column,q+=(Math.abs(n+x-(C+B))+1)*v,s+=(Math.abs(r+x-(C+B))+1)*v,t+=(Math.abs(p+x-(C+B))+1)*v);B=x=v=0;y=h[e[d].index];C=k[e[d].index];-1!==y&&(v+=Math.abs(y-n),x+=Math.abs(y-r),B+=Math.abs(y-p));-1!==
C&&(v+=Math.abs(C-n),x+=Math.abs(C-r),B+=Math.abs(C-p));if(s<q||s===q&&x<v)m=l=!0,e[d].column=r;if(t<q||t===q&&B<v)m=l=!0,e[d].column=p}eq(a,b,e);a.normalize();return l}
function Gq(a,b,c){var d=0,e=dq(a,b),f=a.Ld[b],h=lq(a,b,c);c=[];for(d=0;d<f;d++)c[d]=h[d];for(h=!0;h;)for(h=!1,d=0;d<f;d++){var k=e[d].column,l=a.nodeMinColumnSpace(e[d],!0),m=a.nodeMinColumnSpace(e[d],!1),n=0,p=0,q=0,q=p=0;-1===c[d]?0===d&&d===f-1?n=k:0===d?(p=e[d+1].column,n=p-k===m+a.nodeMinColumnSpace(e[d+1],!0)?k-1:k):d===f-1?(q=e[d-1].column,n=k-q===l+a.nodeMinColumnSpace(e[d-1],!1)?k+1:k):(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+
1],!0)-m-1,n=(q+p)/2|0):0===d&&d===f-1?n=c[d]:0===d?(p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,n=Math.min(c[d],p)):d===f-1?(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,n=Math.max(c[d],q)):(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,q<c[d]&&c[d]<p?n=c[d]:q>=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}eq(a,b,e);a.normalize()}
function Jq(a,b){for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e}
function Kq(a,b){for(var c=b,c=b+1,d=0,e=[],f=[],d=0;d<=a.jb;d++)e[d]=!1,f[d]=!1;for(var h=a.network.vertexes.i;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(f[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.jb;d++)k=k&&!(e[d]&&f[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c}
function Hq(a,b){for(var c=0;c<=a.Hb;c++)for(;Jq(a,c););a.normalize();for(c=0;c<a.Hb;c++)for(;Kq(a,c););a.normalize();var c=0,d,e=0,f=0,h=0;if(0<b)for(c=0;c<=a.Hb;c++)for(d=gq(a),e=jq(a),f=e+1;e<f;)f=e,Lq(a,c,1),h=jq(a),h>e?hq(a,d):h<e&&(e=h,d=gq(a));if(0>b)for(c=a.Hb;0<=c;c--)for(d=gq(a),e=jq(a),f=e+1;e<f;)f=e,Lq(a,c,-1),h=jq(a),h>e?hq(a,d):h<e&&(e=h,d=gq(a));a.normalize()}
function Lq(a,b,c){a.cg=0;for(var d=a.network.vertexes.i;d.next();)d.value.component=-1;if(0<c)for(d.reset();d.next();){var e=d.value;e.column-a.nodeMinColumnSpace(e,!0)<=b&&(e.component=a.cg)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.cg);a.cg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(nq(a,b,a.cg,-1,!0,!0),a.cg++);var f=0;b=[];for(f=0;f<a.cg*a.cg;f++)b[f]=!1;e=[];for(f=0;f<(a.jb+1)*(a.Hb+1);f++)e[f]=-1;for(d.reset();d.next();)for(var f=
d.value,h=f.layer,k=Math.max(0,f.column-a.nodeMinColumnSpace(f,!0)),l=Math.min(a.Hb,f.column+a.nodeMinColumnSpace(f,!1));k<=l;k++)e[h*(a.Hb+1)+k]=f.component;for(f=0;f<=a.jb;f++){if(0<c)for(k=0;k<a.Hb;k++)-1!==e[f*(a.Hb+1)+k]&&-1!==e[f*(a.Hb+1)+k+1]&&e[f*(a.Hb+1)+k]!==e[f*(a.Hb+1)+k+1]&&(b[e[f*(a.Hb+1)+k]*a.cg+e[f*(a.Hb+1)+k+1]]=!0);if(0>c)for(k=a.Hb;0<k;k--)-1!==e[f*(a.Hb+1)+k]&&-1!==e[f*(a.Hb+1)+k-1]&&e[f*(a.Hb+1)+k]!==e[f*(a.Hb+1)+k-1]&&(b[e[f*(a.Hb+1)+k]*a.cg+e[f*(a.Hb+1)+k-1]]=!0)}e=[];for(f=
0;f<a.cg;f++)e[f]=!0;h=new E("number");h.add(0);for(l=0;0!==h.count;)if(l=h.n[h.count-1],h.hd(h.count-1),e[l])for(e[l]=!1,f=0;f<a.cg;f++)b[l*a.cg+f]&&h.Yd(0,f);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&(a.column-=1);if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)}
Yl.prototype.commitLayout=function(){if(this.fp)for(var a=bq(this,!0),b=bq(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.vb=a,d.xb=b)}this.commitNodes();this.Sy();this.Qs&&this.commitLinks()};function bq(a,b){return 270===a.la?b?vc:Cc:90===a.la?b?Cc:vc:180===a.la?b?wc:xc:b?xc:wc}
Yl.prototype.commitNodes=function(){this.Lg=[];this.$f=[];this.Bf=[];this.Kb=[];for(var a=0;a<=this.jb;a++)this.Lg[a]=0,this.$f[a]=0,this.Bf[a]=0,this.Kb[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.Lg[c]=Math.max(this.Lg[c],this.nodeMinLayerSpace(b,!0));this.$f[c]=Math.max(this.$f[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Ql,c=0;c<=this.jb;c++){var e=d;0>=this.Lg[c]+this.$f[c]&&(e=0);0<c&&(b+=e/2);90===this.la||0===this.la?(b+=this.$f[c],this.Bf[c]=b,b+=this.Lg[c]):
(b+=this.Lg[c],this.Bf[c]=b,b+=this.$f[c]);c<this.jb&&(b+=e/2);this.Kb[c]=b}d=b;b=this.Ud;for(c=0;c<=this.jb;c++)270===this.la?this.Bf[c]=b.y+this.Bf[c]:90===this.la?(this.Bf[c]=b.y+d-this.Bf[c],this.Kb[c]=d-this.Kb[c]):180===this.la?this.Bf[c]=b.x+this.Bf[c]:(this.Bf[c]=b.x+d-this.Bf[c],this.Kb[c]=d-this.Kb[c]);for(a.reset();a.next();){var c=a.value,d=c.layer,e=c.column|0,f=0,h=0;270===this.la||90===this.la?(f=b.x+this.sd*e,h=this.Bf[d]):(f=this.Bf[d],h=b.y+this.sd*e);c.Ja=f;c.Ua=h;c.commit()}};
Yl.prototype.Sy=function(){for(var a=0,b=this.Ql,c=0;c<=this.jb;c++)a+=this.Lg[c],a+=this.$f[c];for(var a=a+this.jb*b,b=[],c=this.sd*this.Hb,d=this.uH;0<=d;d--)270===this.la?0===d?b.push(new z(0,0,c,Math.abs(this.Kb[0]))):b.push(new z(0,this.Kb[d-1],c,Math.abs(this.Kb[d-1]-this.Kb[d]))):90===this.la?0===d?b.push(new z(0,this.Kb[0],c,Math.abs(this.Kb[0]-a))):b.push(new z(0,this.Kb[d],c,Math.abs(this.Kb[d-1]-this.Kb[d]))):180===this.la?0===d?b.push(new z(0,0,Math.abs(this.Kb[0]),c)):b.push(new z(this.Kb[d-
1],0,Math.abs(this.Kb[d-1]-this.Kb[d]),c)):0===d?b.push(new z(this.Kb[0],0,Math.abs(this.Kb[0]-a),c)):b.push(new z(this.Kb[d],0,Math.abs(this.Kb[d-1]-this.Kb[d]),c));this.commitLayers(b,K.Wj)};Yl.prototype.commitLayers=function(){};
Yl.prototype.commitLinks=function(){for(var a=this.network.edges.i,b;a.next();)b=a.value.link,null!==b&&(b.rl(),b.so(),b.Bi());for(a.reset();a.next();)b=a.value.link,null!==b&&b.updateRoute();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.rl();var d=b,e=d.W,f=d.ca,h=d.od,k=d.fe;if(c.valid){if(b.Ve===kh&&4===b.ka){if(c.rev)var l=e,e=f,f=l,m=h,h=k,k=m;if(c.fromVertex.column===c.toVertex.column){var n=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,f,k),p=b.getLinkPoint(f,k,b.computeSpot(!1),
!1,!1,e,h);n.J()||n.set(e.ba.Ok);p.J()||p.set(f.ba.Ok);b.so();b.Lk(n.x,n.y);b.Lk((2*n.x+p.x)/3,(2*n.y+p.y)/3);b.Lk((n.x+2*p.x)/3,(n.y+2*p.y)/3);b.Lk(p.x,p.y)}else{var q=!1,r=!1;null!==h&&b.computeSpot(!0)===vb&&(q=!0);null!==k&&b.computeSpot(!1)===vb&&(r=!0);if(q||r){var s=b.l(0).x,t=b.l(0).y,v=b.l(1).x,x=b.l(1).y,B=b.l(2).x,y=b.l(2).y,C=b.l(3).x,I=b.l(3).y;if(q){90===this.la||270===this.la?(v=s,x=(t+I)/2):(v=(s+C)/2,x=t);b.V(1,v,x);var H=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,f,k);H.J()||H.set(e.ba.Ok);
b.V(0,H.x,H.y)}r&&(90===this.la||270===this.la?(B=C,y=(t+I)/2):(B=(s+C)/2,y=I),b.V(2,B,y),H=b.getLinkPoint(f,k,b.computeSpot(!1),!1,!1,e,h),H.J()||H.set(f.ba.Ok),b.V(3,H.x,H.y))}}}b.Bi()}else if(c.fromVertex.layer===c.toVertex.layer)b.Bi();else{var T=!1,aa=!1,R=0,N=b.Bs+1;if(b.dc)aa=!0,R=b.ka,4<R&&b.points.removeRange(2,R-3);else if(b.Ve===kh)T=!0,R=b.ka,4<R&&b.points.removeRange(2,R-3),N=2;else{var R=b.ka,Z=b.computeSpot(!0)===vb,Ea=b.computeSpot(!1)===vb;2<R&&Z&&Ea?b.points.removeRange(1,R-2):3<
R&&Z&&!Ea?b.points.removeRange(1,R-3):3<R&&!Z&&Ea?b.points.removeRange(2,R-2):4<R&&!Z&&!Ea&&b.points.removeRange(2,R-3)}var ua=c.fromVertex,Oa=c.toVertex,na,Ca;if(c.rev){for(var ra=0;null!==Oa&&ua!==Oa;){Ca=na=null;for(var dc=Oa.kc.i;dc.next();){var ed=dc.value;if(ed.link===c.link&&(na=ed.fromVertex,Ca=ed.toVertex,null===na.kd))break}na!==ua&&(Ta=b.l(N-1).x,db=b.l(N-1).y,wa=na.Ja,za=na.Ua,aa?180===this.la||0===this.la?2===N?(b.w(N++,Ta,db),b.w(N++,Ta,za)):(jc=null!==Ca?Ca.Ua:db,jc!==za&&(lb=this.Kb[na.layer-
1],b.w(N++,lb,db),b.w(N++,lb,za))):2===N?(b.w(N++,Ta,db),b.w(N++,wa,db)):(ge=null!==Ca?Ca.Ja:Ta,ge!==wa&&(lb=this.Kb[na.layer-1],b.w(N++,Ta,lb),b.w(N++,wa,lb))):2===N?T?(Eb=Math.max(10,this.Lg[Oa.layer]),$a=Math.max(10,this.$f[Oa.layer]),180===this.la?(ra=Oa.aa.x,b.w(N++,ra-Eb,za),b.w(N++,ra,za),b.w(N++,ra+$a,za)):90===this.la?(ra=Oa.aa.y+Oa.aa.height,b.w(N++,wa,ra+$a),b.w(N++,wa,ra),b.w(N++,wa,ra-Eb)):270===this.la?(ra=Oa.aa.y,b.w(N++,wa,ra-Eb),b.w(N++,wa,ra),b.w(N++,wa,ra+$a)):(ra=Oa.aa.x+Oa.aa.width,
b.w(N++,ra+$a,za),b.w(N++,ra,za),b.w(N++,ra-Eb,za))):(b.w(N++,Ta,db),180===this.la||0===this.la?b.w(N++,Ta,za):b.w(N++,wa,db),b.w(N++,wa,za)):(Eb=Math.max(10,this.Lg[na.layer]),$a=Math.max(10,this.$f[na.layer]),180===this.la?(T&&b.w(N++,wa-Eb,za),b.w(N++,wa,za),T&&b.w(N++,wa+$a,za)):90===this.la?(T&&b.w(N++,wa,za+$a),b.w(N++,wa,za),T&&b.w(N++,wa,za-Eb)):270===this.la?(T&&b.w(N++,wa,za-Eb),b.w(N++,wa,za),T&&b.w(N++,wa,za+$a)):(T&&b.w(N++,wa+$a,za),b.w(N++,wa,za),T&&b.w(N++,wa-Eb,za))));Oa=na}if(null===
k||b.computeSpot(!1)!==vb)if(Ta=b.l(N-1).x,db=b.l(N-1).y,wa=b.l(N).x,za=b.l(N).y,aa){var Lf=this.$f[ua.layer],ec=0;180===this.la||0===this.la?(ec=db,ec>=ua.aa.y&&ec<=ua.aa.bottom&&(ra=ua.Ja+Lf,ec=ec<ua.aa.y+ua.aa.height/2?ua.aa.y-this.sd/2:ua.aa.bottom+this.sd/2,b.w(N++,ra,db),b.w(N++,ra,ec)),b.w(N++,wa,ec)):(ec=Ta,ec>=ua.aa.x&&ec<=ua.aa.right&&(ra=ua.Ua+Lf,ec=ec<ua.aa.x+ua.aa.width/2?ua.aa.x-this.sd/2:ua.aa.right+this.sd/2,b.w(N++,Ta,ra),b.w(N++,ec,ra)),b.w(N++,ec,za));b.w(N++,wa,za)}else T?(Eb=
Math.max(10,this.Lg[ua.layer]),$a=Math.max(10,this.$f[ua.layer]),180===this.la?(ra=ua.aa.x+ua.aa.width,b.V(N-2,ra,db),b.V(N-1,ra+$a,db)):90===this.la?(ra=ua.aa.y,b.V(N-2,Ta,ra),b.V(N-1,Ta,ra-Eb)):270===this.la?(ra=ua.aa.y+ua.aa.height,b.V(N-2,Ta,ra),b.V(N-1,Ta,ra+$a)):(ra=ua.aa.x,b.V(N-2,ra,db),b.V(N-1,ra-Eb,db))):(180===this.la||0===this.la?b.w(N++,wa,db):b.w(N++,Ta,za),b.w(N++,wa,za))}else{for(;null!==ua&&ua!==Oa;){Ca=na=null;for(var Ve=ua.bc.i;Ve.next();){var Mf=Ve.value;if(Mf.link===c.link&&(na=
Mf.toVertex,Ca=Mf.fromVertex,null!==Ca.kd&&(Ca=null),null===na.kd))break}var Ta=0,db=0,wa=0,za=0,lb=0,Eb=0,$a=0;if(na!==Oa)if(Ta=b.l(N-1).x,db=b.l(N-1).y,wa=na.Ja,za=na.Ua,aa)if(180===this.la||0===this.la){var jc=null!==Ca?Ca.Ua:db;jc!==za&&(lb=this.Kb[na.layer],2===N&&(lb=0===this.la?Math.max(lb,Ta):Math.min(lb,Ta)),b.w(N++,lb,db),b.w(N++,lb,za))}else{var ge=null!==Ca?Ca.Ja:Ta;ge!==wa&&(lb=this.Kb[na.layer],2===N&&(lb=90===this.la?Math.max(lb,db):Math.min(lb,db)),b.w(N++,Ta,lb),b.w(N++,wa,lb))}else Eb=
Math.max(10,this.Lg[na.layer]),$a=Math.max(10,this.$f[na.layer]),180===this.la?(b.w(N++,wa+$a,za),T&&b.w(N++,wa,za),b.w(N++,wa-Eb,za)):90===this.la?(b.w(N++,wa,za-Eb),T&&b.w(N++,wa,za),b.w(N++,wa,za+$a)):270===this.la?(b.w(N++,wa,za+$a),T&&b.w(N++,wa,za),b.w(N++,wa,za-Eb)):(b.w(N++,wa-Eb,za),T&&b.w(N++,wa,za),b.w(N++,wa+$a,za));ua=na}aa&&(Ta=b.l(N-1).x,db=b.l(N-1).y,wa=b.l(N).x,za=b.l(N).y,180===this.la||0===this.la?db!==za&&(lb=0===this.la?Math.min(Math.max((wa+Ta)/2,this.Kb[Oa.layer]),wa):Math.max(Math.min((wa+
Ta)/2,this.Kb[Oa.layer]),wa),b.w(N++,lb,db),b.w(N++,lb,za)):Ta!==wa&&(lb=90===this.la?Math.min(Math.max((za+db)/2,this.Kb[Oa.layer]),za):Math.max(Math.min((za+db)/2,this.Kb[Oa.layer]),za),b.w(N++,Ta,lb),b.w(N++,wa,lb)))}if(null!==d&&T){if(null!==h){if(b.computeSpot(!0)===vb){var nc=b.l(0),Od=b.l(2);nc.L(Od)||b.V(1,(nc.x+Od.x)/2,(nc.y+Od.y)/2)}H=b.getLinkPoint(e,h,vb,!0,!1,f,k);H.J()||H.set(e.ba.Ok);b.V(0,H.x,H.y)}null!==k&&(b.computeSpot(!1)===vb&&(nc=b.l(b.ka-1),Od=b.l(b.ka-3),nc.L(Od)||b.V(b.ka-
2,(nc.x+Od.x)/2,(nc.y+Od.y)/2)),H=b.getLinkPoint(f,k,vb,!1,!1,e,h),H.J()||H.set(f.ba.Ok),b.V(b.ka-1,H.x,H.y))}b.Bi();c.commit()}}}for(var he=new E(W),We=this.network.edges.i;We.next();){var pf=We.value.link;null!==pf&&pf.dc&&!he.contains(pf)&&he.add(pf)}if(0<he.count)if(90===this.la||270===this.la){for(var Pd=0,Fb=new E(Mq),Lb,Ec,Mg=he.i;Mg.next();){var Mb=Mg.value;if(null!==Mb&&Mb.dc)for(var yb=2;yb<Mb.ka-3;yb++)if(Lb=Mb.l(yb),Ec=Mb.l(yb+1),this.D(Lb.y,Ec.y)&&!this.D(Lb.x,Ec.x)){var fc=new Mq;fc.layer=
Math.floor(Lb.y/2);var mb=Mb.l(0),ye=Mb.l(Mb.ka-1);fc.first=mb.x*mb.x+mb.y;fc.Gd=ye.x*ye.x+ye.y;fc.Be=Math.min(Lb.x,Ec.x);fc.Vd=Math.max(Lb.x,Ec.x);fc.index=yb;fc.link=Mb;if(yb+2<Mb.ka){var Qd=Mb.l(yb-1),og=Mb.l(yb+2),Nf=0;Qd.y<Lb.y?Nf=og.y<Lb.y?3:Lb.x<Ec.x?2:1:Qd.y>Lb.y&&(Nf=og.y>Lb.y?0:Ec.x<Lb.x?2:1);fc.Rh=Nf}Fb.add(fc)}}if(1<Fb.count){Fb.sort(this.AE);for(var zb=0;zb<Fb.count;){for(var fd=Fb.n[zb].layer,oc=zb+1;oc<Fb.count&&Fb.n[oc].layer===fd;)oc++;if(1<oc-zb)for(var wb=zb;wb<oc;){for(var Fc=
Fb.n[wb].Vd,Nb=zb+1;Nb<oc&&Fb.n[Nb].Be<Fc;)Fc=Math.max(Fc,Fb.n[Nb].Vd),Nb++;var Na=Nb-wb;if(1<Na){Fb.hp(this.Aw,wb,wb+Na);for(var eb=1,Ab=Fb.n[wb].Gd,yb=wb;yb<Nb;yb++){var gc=Fb.n[yb];gc.Gd!==Ab&&(eb++,Ab=gc.Gd)}Fb.hp(this.zE,wb,wb+Na);for(var Rd=1,Ab=Fb.n[wb].first,yb=wb;yb<Nb;yb++)gc=Fb.n[yb],gc.first!==Ab&&(Rd++,Ab=gc.first);var Sd=!0,qf=Rd;eb<Rd?(Sd=!1,qf=eb,Ab=Fb.n[wb].Gd,Fb.hp(this.Aw,wb,wb+Na)):Ab=Fb.n[wb].first;for(var ze=0,yb=wb;yb<Nb;yb++){gc=Fb.n[yb];(Sd?gc.first:gc.Gd)!==Ab&&(ze++,Ab=
Sd?gc.first:gc.Gd);Mb=gc.link;Lb=Mb.l(gc.index);Ec=Mb.l(gc.index+1);var rf=this.ow*(ze-(qf-1)/2);Pd++;Mb.rl();Mb.V(gc.index,Lb.x,Lb.y+rf);Mb.V(gc.index+1,Ec.x,Ec.y+rf);Mb.Bi()}}wb=Nb}zb=oc}}}else{for(var Rb=0,cb=new E(Mq),pc,Pc,gd=he.i;gd.next();){var ab=gd.value;if(null!==ab&&ab.dc)for(var ub=2;ub<ab.ka-3;ub++)if(pc=ab.l(ub),Pc=ab.l(ub+1),this.D(pc.x,Pc.x)&&!this.D(pc.y,Pc.y)){var kc=new Mq;kc.layer=Math.floor(pc.x/2);var hd=ab.l(0),Ng=ab.l(ab.ka-1);kc.first=hd.x+hd.y*hd.y;kc.Gd=Ng.x+Ng.y*Ng.y;kc.Be=
Math.min(pc.y,Pc.y);kc.Vd=Math.max(pc.y,Pc.y);kc.index=ub;kc.link=ab;if(ub+2<ab.ka){var Og=ab.l(ub-1),Pg=ab.l(ub+2),Of=0;Og.x<pc.x?Of=Pg.x<pc.x?3:pc.y<Pc.y?2:1:Og.x>pc.x&&(Of=Pg.x>pc.x?0:Pc.y<pc.y?2:1);kc.Rh=Of}cb.add(kc)}}if(1<cb.count){cb.sort(this.AE);for(var Gc=0;Gc<cb.count;){for(var Qc=cb.n[Gc].layer,Hc=Gc+1;Hc<cb.count&&cb.n[Hc].layer===Qc;)Hc++;if(1<Hc-Gc)for(var nb=Gc;nb<Hc;){for(var ie=cb.n[nb].Vd,ob=Gc+1;ob<Hc&&cb.n[ob].Be<ie;)ie=Math.max(ie,cb.n[ob].Vd),ob++;var yc=ob-nb;if(1<yc){cb.hp(this.Aw,
nb,nb+yc);for(var Ae=1,Bb=cb.n[nb].Gd,ub=nb;ub<ob;ub++){var Cb=cb.n[ub];Cb.Gd!==Bb&&(Ae++,Bb=Cb.Gd)}cb.hp(this.zE,nb,nb+yc);for(var id=1,Bb=cb.n[nb].first,ub=nb;ub<ob;ub++)Cb=cb.n[ub],Cb.first!==Bb&&(id++,Bb=Cb.first);var Rc=!0,Td=id;Ae<id?(Rc=!1,Td=Ae,Bb=cb.n[nb].Gd,cb.hp(this.Aw,nb,nb+yc)):Bb=cb.n[nb].first;for(var Ud=0,ub=nb;ub<ob;ub++){Cb=cb.n[ub];(Rc?Cb.first:Cb.Gd)!==Bb&&(Ud++,Bb=Rc?Cb.first:Cb.Gd);ab=Cb.link;pc=ab.l(Cb.index);Pc=ab.l(Cb.index+1);var Xe=this.ow*(Ud-(Td-1)/2);Rb++;ab.rl();ab.V(Cb.index,
pc.x+Xe,pc.y);ab.V(Cb.index+1,Pc.x+Xe,Pc.y);ab.Bi()}}nb=ob}Gc=Hc}}}};Yl.prototype.AE=function(a,b){return a instanceof Mq&&b instanceof Mq&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Be<b.Be?-1:a.Be>b.Be?1:a.Vd<b.Vd?-1:a.Vd>b.Vd?1:0:0};Yl.prototype.zE=function(a,b){return a instanceof Mq&&b instanceof Mq&&a!==b?a.first<b.first?-1:a.first>b.first||a.Rh<b.Rh?1:a.Rh>b.Rh||a.Be<b.Be?-1:a.Be>b.Be?1:a.Vd<b.Vd?-1:a.Vd>b.Vd?1:0:0};
Yl.prototype.Aw=function(a,b){return a instanceof Mq&&b instanceof Mq&&a!==b?a.Gd<b.Gd?-1:a.Gd>b.Gd||a.Rh<b.Rh?1:a.Rh>b.Rh||a.Be<b.Be?-1:a.Be>b.Be?1:a.Vd<b.Vd?-1:a.Vd>b.Vd?1:0:0};Yl.prototype.D=function(a,b){var c=a-b;return-1<c&&1>c};function dq(a,b){var c,d=a.Ld[b];if(d>=a.Ng.length){c=[];for(var e=0;e<a.Ng.length;e++)c[e]=a.Ng[e];a.Ng=c}void 0===a.Ng[d]||null===a.Ng[d]?c=[]:(c=a.Ng[d],a.Ng[d]=null);d=a.Vq[b];for(e=0;e<d.length;e++){var f=d[e];c[f.index]=f}return c}
function eq(a,b,c){a.Ng[a.Ld[b]]=c}u.defineProperty(Yl,{layerSpacing:"layerSpacing"},function(){return this.Ql},function(a){this.Ql!==a&&(u.j(a,"number",Yl,"layerSpacing"),0<=a&&(this.Ql=a,this.H()))});u.defineProperty(Yl,{dJ:"columnSpacing"},function(){return this.sd},function(a){this.sd!==a&&(u.j(a,"number",Yl,"columnSpacing"),0<=a&&(this.sd=a,this.H()))});u.defineProperty(Yl,{direction:"direction"},function(){return this.la},function(a){this.la!==a&&(u.j(a,"number",Yl,"direction"),this.la=a,this.H())});
u.defineProperty(Yl,{kG:"cycleRemoveOption"},function(){return this.gn},function(a){this.gn!==a&&(u.rb(a,Yl,Yl,"cycleRemoveOption"),a===Xp||a===Op)&&(this.gn=a,this.H())});u.defineProperty(Yl,{mH:"layeringOption"},function(){return this.Mn},function(a){this.Mn!==a&&(u.rb(a,Yl,Yl,"layeringOption"),a===Sp||a===oq||a===qq)&&(this.Mn=a,this.H())});
u.defineProperty(Yl,{WG:"initializeOption"},function(){return this.Bn},function(a){this.Bn!==a&&(u.rb(a,Yl,Yl,"initializeOption"),a===Tp||a===wq||a===uq)&&(this.Bn=a,this.H())});u.defineProperty(Yl,{MJ:"iterations"},function(){return this.Nl},function(a){this.Nl!==a&&(u.ze(a,Wp,"iterations"),0<=a&&(this.Nl=a,this.H()))});u.defineProperty(Yl,{NF:"aggressiveOption"},function(){return this.Wm},function(a){this.Wm!==a&&(u.rb(a,Yl,Yl,"aggressiveOption"),a===Aq||a===Up||a===Bq)&&(this.Wm=a,this.H())});
u.defineProperty(Yl,{kK:"packOption"},function(){return this.oi},function(a){this.oi!==a&&(u.j(a,"number",Yl,"packOption"),0<=a&&8>a&&(this.oi=a,this.H()))});u.defineProperty(Yl,{fp:"setsPortSpots"},function(){return this.Eh},function(a){this.Eh!==a&&(u.j(a,"boolean",Yl,"setsPortSpots"),this.Eh=a,this.H())});u.defineProperty(Yl,{ow:"linkSpacing"},function(){return this.gj},function(a){this.gj!==a&&(u.j(a,"number",Yl,"linkSpacing"),0<=a&&(this.gj=a,this.H()))});u.u(Yl,{uH:"maxLayer"},function(){return this.jb});
u.u(Yl,{TJ:"maxIndex"},function(){return this.Fu});u.u(Yl,{SJ:"maxColumn"},function(){return this.Hb});u.u(Yl,{ZJ:"minIndexLayer"},function(){return this.Nq});u.u(Yl,{UJ:"maxIndexLayer"},function(){return this.Cf});var Op;Yl.CycleDepthFirst=Op=u.s(Yl,"CycleDepthFirst",0);var Xp;Yl.CycleGreedy=Xp=u.s(Yl,"CycleGreedy",1);var Sp;Yl.LayerOptimalLinkLength=Sp=u.s(Yl,"LayerOptimalLinkLength",0);var oq;Yl.LayerLongestPathSink=oq=u.s(Yl,"LayerLongestPathSink",1);var qq;
Yl.LayerLongestPathSource=qq=u.s(Yl,"LayerLongestPathSource",2);var Tp;Yl.InitDepthFirstOut=Tp=u.s(Yl,"InitDepthFirstOut",0);var wq;Yl.InitDepthFirstIn=wq=u.s(Yl,"InitDepthFirstIn",1);var uq;Yl.InitNaive=uq=u.s(Yl,"InitNaive",2);var Aq;Yl.AggressiveNone=Aq=u.s(Yl,"AggressiveNone",0);var Up;Yl.AggressiveLess=Up=u.s(Yl,"AggressiveLess",1);var Bq;Yl.AggressiveMore=Bq=u.s(Yl,"AggressiveMore",2);Yl.PackNone=0;var Cq;Yl.PackExpand=Cq=1;var Dq;Yl.PackStraighten=Dq=2;var Fq;Yl.PackMedian=Fq=4;var Vp;
Yl.PackAll=Vp=7;function Mq(){this.index=this.Vd=this.Be=this.Gd=this.first=this.layer=0;this.link=null;this.Rh=0}u.Xd(Mq,{layer:!0,first:!0,Gd:!0,Be:!0,Vd:!0,index:!0,link:!0,Rh:!0});function Wp(){xa.call(this)}u.Ga(Wp,xa);u.fa("LayeredDigraphNetwork",Wp);Wp.prototype.createVertex=function(){return new Nq};Wp.prototype.createEdge=function(){return new Oq};
function Nq(){ya.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.wo=NaN;this.om=0;this.Hz=this.Iz=null}u.Ga(Nq,ya);u.fa("LayeredDigraphVertex",Nq);function Oq(){Aa.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}u.Ga(Oq,Aa);u.fa("LayeredDigraphEdge",Oq);
function Y(){0<arguments.length&&u.Wc(Y);Je.call(this);this.nd=new F(Object);this.fr=Pq;this.Af=Qq;this.Wr=Rq;this.Cu=Sq;this.BA=null;this.oh=!0;this.Yc=Tq;this.Uf=(new ia(10,10)).freeze();this.qa=new Uq;this.pa=new Uq;this.By=[]}u.Ga(Y,Je);u.fa("TreeLayout",Y);Y.prototype.cloneProtected=function(a){Je.prototype.cloneProtected.call(this,a);a.fr=this.fr;a.Wr=this.Wr;a.Cu=this.Cu;a.oh=this.oh;a.Yc=this.Yc;a.Uf.assign(this.Uf);a.qa.copyInheritedPropertiesFrom(this.qa);a.pa.copyInheritedPropertiesFrom(this.pa)};
Y.prototype.createNetwork=function(){return new Vq};Y.prototype.makeNetwork=function(a){function b(a){if(a instanceof U)return!a.tf&&"Comment"!==a.Kc;if(a instanceof W){var b=a.W;if(null===b||b.tf||"Comment"===b.Kc)return!1;a=a.ca;return null===a||a.tf||"Comment"===a.Kc?!1:!0}return!1}var c=this.createNetwork();c.Qb=this;a instanceof D?(c.Gj(a.yg,!0,b),c.Gj(a.links,!0,b)):a instanceof V?c.Gj(a.Mc,!1,b):c.Gj(a.i,!1,b);return c};
Y.prototype.doLayout=function(a){null===a&&u.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.Gf!==Wq&&(this.Ud=this.initialOrigin(this.Ud));var b=this.g;null===b&&a instanceof D&&(b=a);this.Af=this.path===Pq&&null!==b?b.qd?Qq:Xq:this.path===Pq?Qq:this.path;if(0<this.network.vertexes.count){this.network.Qv();for(a=this.network.vertexes.i;a.next();)b=a.value,b.initialized=!1,b.level=
0,b.parent=null,b.children=[];if(0<this.nd.count){a=new F(Uq);for(b=this.nd.i;b.next();){var c=b.value;c instanceof U?(c=this.network.Am(c),null!==c&&a.add(c)):c instanceof Uq&&a.add(c)}this.nd=a}0===this.nd.count&&this.findRoots();for(a=this.nd.copy().i;a.next();)b=a.value,b.initialized||(b.initialized=!0,Yq(this,b));for(a=this.nd.i;a.next();)b=a.value,b instanceof Uq&&Zq(this,b);for(a=this.nd.i;a.next();)b=a.value,b instanceof Uq&&$q(this,b);for(a=this.nd.i;a.next();)b=a.value,b instanceof Uq&&
ar(this,b);this.Ny();if(this.wz===br){c=[];for(a=this.network.vertexes.i;a.next();){var d=a.value,b=d.parent;null==b&&(b=d);var b=0===b.angle||180===b.angle,e=c[d.level];void 0===e&&(e=0);c[d.level]=Math.max(e,b?d.width:d.height)}for(d=0;d<c.length;d++)void 0===c[d]&&(c[d]=0);this.BA=c;for(a=this.network.vertexes.i;a.next();)d=a.value,b=d.parent,null===b&&(b=d),0===b.angle||180===b.angle?(180===b.angle&&(d.Cs+=c[d.level]-d.width),d.width=c[d.level]):(270===b.angle&&(d.Ds+=c[d.level]-d.height),d.height=
c[d.level])}else if(this.wz===cr)for(a=this.network.vertexes.i;a.next();){c=a.value;b=0===c.angle||180===c.angle;e=-1;for(d=0;d<c.children.length;d++)var f=c.children[d],e=Math.max(e,b?f.width:f.height);if(0<=e)for(d=0;d<c.children.length;d++)f=c.children[d],b?(180===c.angle&&(f.Cs+=e-f.width),f.width=e):(270===c.angle&&(f.Ds+=e-f.height),f.height=e)}for(a=this.nd.i;a.next();)b=a.value,b instanceof Uq&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.nd=new F(Object);
this.vf=!0};
Y.prototype.findRoots=function(){for(var a=this.network.vertexes.i;a.next();){var b=a.value;switch(this.Af){case Qq:0===b.kc.count&&this.nd.add(b);break;case Xq:0===b.bc.count&&this.nd.add(b);break;default:u.k("Unhandled path value "+this.Af.toString())}}if(0===this.nd.count){for(var a=999999,b=null,c=this.network.vertexes.i;c.next();){var d=c.value;switch(this.Af){case Qq:d.kc.count<a&&(a=d.kc.count,b=d);break;case Xq:d.bc.count<a&&(a=d.bc.count,b=d);break;default:u.k("Unhandled path value "+this.Af.toString())}}null!==
b&&this.nd.add(b)}};
function Yq(a,b){if(null!==b){switch(a.Af){case Qq:if(0<b.bc.count){for(var c=new E(Uq),d=b.rG;d.next();){var e=d.value;dr(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.Ke())}break;case Xq:if(0<b.kc.count){c=new E(Uq);for(d=b.nI;d.next();)e=d.value,dr(a,b,e)&&c.add(e);0<c.count&&(b.children=c.Ke())}break;default:u.k("Unhandled path value"+a.Af.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var f=c[e];f.initialized=!0;f.level=b.level+1;f.parent=b;a.nd.remove(f)}for(e=0;e<d;e++)f=c[e],Yq(a,f)}}
function dr(a,b,c){if(c.initialized){var d;if(null===b)d=!1;else{for(d=b.parent;null!==d&&d!==c;)d=d.parent;d=d===c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0}Y.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]===b&&d++;if(0<d){for(var d=Array(c.length-d),f=0,e=0;e<c.length;e++)c[e]!==b&&(d[f++]=c[e]);a.children=d}}};
function Zq(a,b){if(null!==b){a.initializeTreeVertexValues(b);b.alignment===er&&a.sortTreeVertexChildren(b);for(var c=0,d=b.qm,e=0,f=b.children,h=f.length,k=0;k<h;k++){var l=f[k];Zq(a,l);c+=l.descendantCount+1;d=Math.max(d,l.maxChildrenCount);e=Math.max(e,l.maxGenerationCount)}b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}}
function fr(a,b){switch(a.Wr){default:case Rq:return null!==b.parent?b.parent:a.qa;case gr:return null===b.parent?a.qa:null===b.parent.parent?a.pa:b.parent;case hr:if(null!==b.parent)return null!==b.parent.parent?b.parent.parent:a.pa;case ir:var c=!0;if(0===b.qm)c=!1;else for(var d=b.children,e=d.length,f=0;f<e;f++)if(0<d[f].qm){c=!1;break}return c&&null!==b.parent?a.pa:null!==b.parent?b.parent:a.qa}}
Y.prototype.initializeTreeVertexValues=function(a){var b=fr(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===er){for(var b=a.angle,c=a.parent.children,d=0;d<c.length&&a!==c[d];)d++;0===d%2?d!==c.length-1&&(b=90===b?180:180===b?270:270===b?180:270):b=90===b?0:180===b?90:270===b?0:90;a.angle=b}a.initialized=!0};function $q(a,b){if(null!==b){a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)$q(a,c[e])}}Y.prototype.assignTreeVertexValues=function(){};
function ar(a,b){if(null!==b){b.alignment!==er&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)ar(a,c[e])}}Y.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case jr:break;case kr:a.children.reverse();break;case lr:a.children.sort(a.comparer);break;case mr:a.children.sort(a.comparer);a.children.reverse();break;default:u.k("Unhandled sorting value "+a.sorting.toString())}};Y.prototype.Ny=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
Y.prototype.addComments=function(a){var b=a.angle,c=a.parent,d=0,e=nr,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=or(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.qm,f=0,h=0,k=0,l=a.commentSpacing;if(null!==a.Cc)for(var m=a.Cc.rD();m.next();){var n=m.value;"Comment"===n.Kc&&n.Ea()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.pf(),n=n.Ba,b&&!c||!e&&!d&&c||e&&d&&c?(f=Math.max(f,n.width),h+=n.height+Math.abs(k)):(f+=n.width+Math.abs(k),h=Math.max(h,n.height)),k=l)}null!==a.comments&&
(b&&!c||!e&&!d&&c||e&&d&&c?(f+=Math.abs(a.commentMargin),h=Math.max(0,h-a.height)):(h+=Math.abs(a.commentMargin),f=Math.max(0,f-a.width)),e=u.Vj(0,0,a.aa.width+f,a.aa.height+h),a.kb=e,u.ic(e))};function or(a){return a===pr||a===er||a===qr||a===rr}function sr(a){return a===pr||a===er}function tr(a){var b=a.parent;if(null!==b){var c=b.alignment;if(or(c)){if(sr(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===qr)return!0}}return!1}
Y.prototype.layoutComments=function(a){if(null!==a.comments){var b=a.Cc.Ba,c=a.parent,d=a.angle,e=0,f=nr,f=!1;null!==c&&(e=c.angle,f=c.alignment,f=or(f));for(var c=90===d||270===d,d=90===e||270===e,h=0===a.qm,k=tr(a),l=0,m=a.comments,n=m.length,p=u.K(),q=0;q<n;q++){var r=m[q],s=r.Ba;if(c&&!h||!f&&!d&&h||f&&d&&h){if(135<e&&!f||d&&k)if(0<=a.commentMargin)for(p.m(a.aa.x-a.commentMargin-s.width,a.aa.y+l),r.move(p),r=r.og();r.next();){var t=r.value;t.vb=wc;t.xb=xc}else for(p.m(a.aa.x+2*a.M.x-a.commentMargin,
a.aa.y+l),r.move(p),r=r.og();r.next();)t=r.value,t.vb=xc,t.xb=wc;else if(0<=a.commentMargin)for(p.m(a.aa.x+2*a.M.x+a.commentMargin,a.aa.y+l),r.move(p),r=r.og();r.next();)t=r.value,t.vb=xc,t.xb=wc;else for(p.m(a.aa.x+a.commentMargin-s.width,a.aa.y+l),r.move(p),r=r.og();r.next();)t=r.value,t.vb=wc,t.xb=xc;l=0<=a.commentSpacing?l+(s.height+a.commentSpacing):l+(a.commentSpacing-s.height)}else{if(135<e&&!f||!d&&k)if(0<=a.commentMargin)for(p.m(a.aa.x+l,a.aa.y-a.commentMargin-s.height),r.move(p),r=r.og();r.next();)t=
r.value,t.vb=vc,t.xb=Cc;else for(p.m(a.aa.x+l,a.aa.y+2*a.M.y-a.commentMargin),r.move(p),r=r.og();r.next();)t=r.value,t.vb=Cc,t.xb=vc;else if(0<=a.commentMargin)for(p.m(a.aa.x+l,a.aa.y+2*a.M.y+a.commentMargin),r.move(p),r=r.og();r.next();)t=r.value,t.vb=Cc,t.xb=vc;else for(p.m(a.aa.x+l,a.aa.y+a.commentMargin-s.height),r.move(p),r=r.og();r.next();)t=r.value,t.vb=vc,t.xb=Cc;l=0<=a.commentSpacing?l+(s.width+a.commentSpacing):l+(a.commentSpacing-s.width)}}u.v(p);b=l-a.commentSpacing-(c?b.height:b.width);
if(this.Af===Qq)for(e=a.bc;e.next();)a=e.value.link,null===a||a.el||(a.Yk=0<b?b:NaN);else for(e=a.kc;e.next();)a=e.value.link,null===a||a.el||(a.vl=0<b?b:NaN)}};
Y.prototype.layoutTree=function(a){if(null!==a){for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case ur:vr(this,a);break;case wr:if(a.alignment===er)vr(this,a);else if(0===a.qm){var d=a.parent,b=!1,c=0,e=nr;null!==d&&(c=d.angle,e=d.alignment,b=or(e));d=tr(a);a.ia.m(0,0);a.Ya.m(a.width,a.height);null===a.parent||null===a.comments||(180!==c&&270!==c||b)&&!d?a.Ia.m(0,0):180===c&&!b||(90===c||270===c)&&d?a.Ia.m(a.width-2*a.M.x,0):a.Ia.m(0,a.height-2*a.M.y);a.Ss=
null;a.jt=null}else{for(var f=xr(a),b=90===f||270===f,h=0,k=a.children,l=k.length,m=0;m<l;m++)var n=k[m],h=Math.max(h,b?n.Ya.width:n.Ya.height);var p=a.alignment,d=p===yr,q=p===zr,r=or(p),s=Math.max(0,a.breadthLimit),c=Ar(a),t=a.nodeSpacing,v=Br(a),x=a.rowSpacing,B=0;if(d||q||a.bp||a.cp&&1===a.maxGenerationCount)B=Math.max(0,a.rowIndent);var d=a.width,e=a.height,y=0,C=0,I=0,H=null,T=null,aa=0,R=0,N=0,Z=0,Ea=0,ua=0,Oa=0,na=0,n=0;r&&!sr(p)&&135<f&&k.reverse();if(sr(p))if(1<l)for(m=0;m<l;m++)0===m%2&&
m!==l-1?na=Math.max(na,b?k[m].Ya.width:k[m].Ya.height):0!==m%2&&(n=Math.max(n,b?k[m].Ya.width:k[m].Ya.height));else 1===l&&(na=b?k[0].Ya.width:k[0].Ya.height);if(r){switch(p){case pr:R=135>f?Cr(a,k,na,y,C):Dr(a,k,na,y,C);na=R.x;y=R.width;C=R.height;break;case qr:for(m=0;m<l;m++){var n=k[m],Ca=n.Ya,H=0===ua?0:x;b?(n.ia.m(h-Ca.width,Z+H),y=Math.max(y,Ca.width),C=Math.max(C,Z+H+Ca.height),Z+=H+Ca.height):(n.ia.m(N+H,h-Ca.height),y=Math.max(y,N+H+Ca.width),C=Math.max(C,Ca.height),N+=H+Ca.width);ua++}break;
case rr:for(m=0;m<l;m++)n=k[m],Ca=n.Ya,H=0===ua?0:x,b?(n.ia.m(t/2+a.M.x,Z+H),y=Math.max(y,Ca.width),C=Math.max(C,Z+H+Ca.height),Z+=H+Ca.height):(n.ia.m(N+H,t/2+a.M.y),y=Math.max(y,N+H+Ca.width),C=Math.max(C,Ca.height),N+=H+Ca.width),ua++}H=Er(this,2);T=Er(this,2);b?(H[0].m(0,0),H[1].m(0,C),T[0].m(y,0)):(H[0].m(0,0),H[1].m(y,0),T[0].m(0,C));T[1].m(y,C)}else for(m=0;m<l;m++){n=k[m];Ca=n.Ya;if(b){0<s&&0<ua&&N+t+Ca.width>s&&(N<h&&Fr(a,p,h-N,0,Oa,m-1),Ea++,ua=0,Oa=m,I=C,N=0,Z=135<f?-C-x:C+x);Gr(this,n,
0,Z);var ra=0;if(0===ua){if(H=n.Ss,T=n.jt,aa=Ca.width,R=Ca.height,null===H||null===T||f!==xr(n))H=Er(this,2),T=Er(this,2),H[0].m(0,0),H[1].m(0,R),T[0].m(aa,0),T[1].m(aa,R)}else{var dc=u.eb(),R=Hr(this,a,n,H,T,aa,R,dc),ra=R.x,H=dc[0],T=dc[1],aa=R.width,R=R.height;u.ra(dc);N<Ca.width&&0>ra&&(Ir(a,-ra,0,Oa,m-1),Jr(H,-ra,0),Jr(T,-ra,0),ra=0)}n.ia.m(ra,Z);y=Math.max(y,aa);C=Math.max(C,I+(0===Ea?0:x)+Ca.height);N=aa}else{0<s&&0<ua&&Z+t+Ca.height>s&&(Z<h&&Fr(a,p,0,h-Z,Oa,m-1),Ea++,ua=0,Oa=m,I=y,Z=0,N=135<
f?-y-x:y+x);Gr(this,n,N,0);ra=0;if(0===ua){if(H=n.Ss,T=n.jt,aa=Ca.width,R=Ca.height,null===H||null===T||f!==xr(n))H=Er(this,2),T=Er(this,2),H[0].m(0,0),H[1].m(aa,0),T[0].m(0,R),T[1].m(aa,R)}else dc=u.eb(),R=Hr(this,a,n,H,T,aa,R,dc),ra=R.x,H=dc[0],T=dc[1],aa=R.width,R=R.height,u.ra(dc),Z<Ca.height&&0>ra&&(Ir(a,0,-ra,Oa,m-1),Jr(H,0,-ra),Jr(T,0,-ra),ra=0);n.ia.m(N,ra);C=Math.max(C,R);y=Math.max(y,I+(0===Ea?0:x)+Ca.width);Z=R}ua++}0<Ea&&(b?(C+=Math.max(0,c),N<y&&Fr(a,p,y-N,0,Oa,l-1),0<B&&(q||Ir(a,B,0,
0,l-1),y+=B)):(y+=Math.max(0,c),Z<C&&Fr(a,p,0,C-Z,Oa,l-1),0<B&&(q||Ir(a,0,B,0,l-1),C+=B)));q=h=0;switch(p){case Kr:b?h+=y/2-a.M.x-v/2:q+=C/2-a.M.y-v/2;break;case nr:0<Ea?b?h+=y/2-a.M.x-v/2:q+=C/2-a.M.y-v/2:b?(m=k[0].ia.x+k[0].Ia.x,na=k[l-1].ia.x+k[l-1].Ia.x+2*k[l-1].M.x,h+=m+(na-m)/2-a.M.x-v/2):(m=k[0].ia.y+k[0].Ia.y,na=k[l-1].ia.y+k[l-1].Ia.y+2*k[l-1].M.y,q+=m+(na-m)/2-a.M.y-v/2);break;case yr:b?(h-=v,y+=v):(q-=v,C+=v);break;case zr:b?(h+=y-a.width+v,y+=v):(q+=C-a.height+v,C+=v);break;case pr:b?
h=1<l?h+(na+t/2-a.M.x):h+(k[0].M.x-a.M.x+k[0].Ia.x):q=1<l?q+(na+t/2-a.M.y):q+(k[0].M.y-a.M.y+k[0].Ia.y);break;case qr:b?h+=y+t/2-a.M.x:q+=C+t/2-a.M.y;break;case rr:break;default:u.k("Unhandled alignment value "+p.toString())}for(m=0;m<l;m++)n=k[m],b?n.ia.m(n.ia.x+n.Ia.x-h,n.ia.y+(135<f?(r?-C:-n.Ya.height)+n.Ia.y-c:e+c+n.Ia.y)):n.ia.m(n.ia.x+(135<f?(r?-y:-n.Ya.width)+n.Ia.x-c:d+c+n.Ia.x),n.ia.y+n.Ia.y-q);l=k=0;r?b?(y=Lr(a,y,h),0>h&&(h=0),135<f&&(q+=C+c),C+=e+c,p===rr&&(k+=t/2+a.M.x),l+=e+c):(135<f&&
(h+=y+c),y+=d+c,C=Mr(a,C,q),0>q&&(q=0),p===rr&&(l+=t/2+a.M.y),k+=d+c):b?(null===a.comments?d>y&&(p=Nr(p,d-y,0),k=p.x,l=p.y,y=d,h=0):y=Lr(a,y,h),0>h&&(k-=h,h=0),135<f&&(q+=C+c),C=Math.max(Math.max(C,e),C+e+c),l+=e+c):(135<f&&(h+=y+c),y=Math.max(Math.max(y,d),y+d+c),null===a.comments?e>C&&(p=Nr(p,0,e-C),k=p.x,l=p.y,C=e,q=0):C=Mr(a,C,q),0>q&&(l-=q,q=0),k+=d+c);if(0<Ea)f=Er(this,4),p=Er(this,4),b?(f[2].m(0,e+c),f[3].m(f[2].x,C),p[2].m(y,f[2].y),p[3].m(p[2].x,f[3].y)):(f[2].m(d+c,0),f[3].m(y,f[2].y),p[2].m(f[2].x,
C),p[3].m(f[3].x,p[2].y));else{f=Er(this,H.length+2);p=Er(this,T.length+2);for(m=0;m<H.length;m++)r=H[m],f[m+2].m(r.x+k,r.y+l);for(m=0;m<T.length;m++)r=T[m],p[m+2].m(r.x+k,r.y+l)}b?(f[0].m(h,0),f[1].m(f[0].x,e),f[2].y<f[1].y&&(f[2].x>f[0].x?f[2].assign(f[1]):f[1].assign(f[2])),f[3].y<f[2].y&&(f[3].x>f[0].x?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(h+d,0),p[1].m(p[0].x,e),p[2].y<p[1].y&&(p[2].x<p[0].x?p[2].assign(p[1]):p[1].assign(p[2])),p[3].y<p[2].y&&(p[3].x<p[0].x?p[3].assign(p[2]):p[2].assign(p[3])),
f[2].y-=c/2,p[2].y-=c/2):(f[0].m(0,q),f[1].m(d,f[0].y),f[2].x<f[1].x&&(f[2].y>f[0].y?f[2].assign(f[1]):f[1].assign(f[2])),f[3].x<f[2].x&&(f[3].y>f[0].y?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(0,q+e),p[1].m(d,p[0].y),p[2].x<p[1].x&&(p[2].y<p[0].y?p[2].assign(p[1]):p[1].assign(p[2])),p[3].x<p[2].x&&(p[3].y<p[0].y?p[3].assign(p[2]):p[2].assign(p[3])),f[2].x-=c/2,p[2].x-=c/2);Or(this,H);Or(this,T);a.Ss=f;a.jt=p;a.Ia.m(h,q);a.Ya.m(y,C)}break;default:u.k("Unhandled compaction value "+a.compaction.toString())}}};
function vr(a,b){if(0===b.qm){var c=!1,d=0,e=nr;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=or(e));e=tr(b);b.ia.m(0,0);b.Ya.m(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Ia.m(0,0):180===d&&!c||(90===d||270===d)&&e?b.Ia.m(b.width-2*b.M.x,0):b.Ia.m(0,b.height-2*b.M.y)}else{for(var c=xr(b),d=90===c||270===c,f=0,e=b.children,h=e.length,k=0;k<h;k++)var l=e[k],f=Math.max(f,d?l.Ya.width:l.Ya.height);var m=b.alignment,n=m===yr,p=m===zr,q=or(m),r=Math.max(0,
b.breadthLimit),s=Ar(b),t=b.nodeSpacing,v=Br(b),x=n||p?0:v/2,B=b.rowSpacing,y=0;if(n||p||b.bp||b.cp&&1===b.maxGenerationCount)y=Math.max(0,b.rowIndent);var n=b.width,C=b.height,I=0,H=0,T=0,aa=0,R=0,N=0,Z=0,Ea=0,ua=0,Oa=0;q&&!sr(m)&&135<c&&e.reverse();if(sr(m))if(1<h)for(k=0;k<h;k++){var l=e[k],na=l.Ya;0===k%2&&k!==h-1?ua=Math.max(ua,(d?na.width:na.height)+Pr(l)-t):0!==k%2&&(Oa=Math.max(Oa,(d?na.width:na.height)+Pr(l)-t))}else 1===h&&(ua=d?e[0].Ya.width:e[0].Ya.height);if(q)switch(m){case pr:case er:H=
135>c?Cr(b,e,ua,I,H):Dr(b,e,ua,I,H);ua=H.x;I=H.width;H=H.height;break;case qr:for(k=0;k<h;k++)l=e[k],na=l.Ya,r=0===Z?0:B,d?(l.ia.m(f-na.width,R+r),I=Math.max(I,na.width),H=Math.max(H,R+r+na.height),R+=r+na.height):(l.ia.m(aa+r,f-na.height),I=Math.max(I,aa+r+na.width),H=Math.max(H,na.height),aa+=r+na.width),Z++;break;case rr:for(f=0;f<h;f++)l=e[f],na=l.Ya,r=0===Z?0:B,d?(l.ia.m(t/2+b.M.x,R+r),I=Math.max(I,na.width),H=Math.max(H,R+r+na.height),R+=r+na.height):(l.ia.m(aa+r,t/2+b.M.y),I=Math.max(I,aa+
r+na.width),H=Math.max(H,na.height),aa+=r+na.width),Z++}else for(k=0;k<h;k++)l=e[k],na=l.Ya,d?(0<r&&0<Z&&aa+t+na.width>r&&(aa<f&&Fr(b,m,f-aa,0,Ea,k-1),N++,Z=0,Ea=k,T=H,aa=0,R=135<c?-H-B:H+B),Oa=0===Z?x:t,Gr(a,l,0,R),l.ia.m(aa+Oa,R),I=Math.max(I,aa+Oa+na.width),H=Math.max(H,T+(0===N?0:B)+na.height),aa+=Oa+na.width):(0<r&&0<Z&&R+t+na.height>r&&(R<f&&Fr(b,m,0,f-R,Ea,k-1),N++,Z=0,Ea=k,T=I,R=0,aa=135<c?-I-B:I+B),Oa=0===Z?x:t,Gr(a,l,aa,0),l.ia.m(aa,R+Oa),H=Math.max(H,R+Oa+na.height),I=Math.max(I,T+(0===
N?0:B)+na.width),R+=Oa+na.height),Z++;0<N&&(d?(H+=Math.max(0,s),aa<I&&Fr(b,m,I-aa,0,Ea,h-1),0<y&&(p||Ir(b,y,0,0,h-1),I+=y)):(I+=Math.max(0,s),R<H&&Fr(b,m,0,H-R,Ea,h-1),0<y&&(p||Ir(b,0,y,0,h-1),H+=y)));y=p=0;switch(m){case Kr:d?p+=I/2-b.M.x-v/2:y+=H/2-b.M.y-v/2;break;case nr:0<N?d?p+=I/2-b.M.x-v/2:y+=H/2-b.M.y-v/2:d?(m=e[0].ia.x+e[0].Ia.x,t=e[h-1].ia.x+e[h-1].Ia.x+2*e[h-1].M.x,p+=m+(t-m)/2-b.M.x-v/2):(m=e[0].ia.y+e[0].Ia.y,t=e[h-1].ia.y+e[h-1].Ia.y+2*e[h-1].M.y,y+=m+(t-m)/2-b.M.y-v/2);break;case yr:d?
(p-=v,I+=v):(y-=v,H+=v);break;case zr:d?(p+=I-b.width+v,I+=v):(y+=H-b.height+v,H+=v);break;case pr:case er:d?p=1<h?p+(ua+t/2-b.M.x):p+(e[0].M.x-b.M.x+e[0].Ia.x):y=1<h?y+(ua+t/2-b.M.y):y+(e[0].M.y-b.M.y+e[0].Ia.y);break;case qr:d?p+=I+t/2-b.M.x:y+=H+t/2-b.M.y;break;case rr:break;default:u.k("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.ia.m(l.ia.x+l.Ia.x-p,l.ia.y+(135<c?(q?-H:-l.Ya.height)+l.Ia.y-s:C+s+l.Ia.y)):l.ia.m(l.ia.x+(135<c?(q?-I:-l.Ya.width)+l.Ia.x-s:n+s+l.Ia.x),l.ia.y+
l.Ia.y-y);d?(I=Lr(b,I,p),0>p&&(p=0),135<c&&(y+=H+s),H+=C+s):(135<c&&(p+=I+s),I+=n+s,H=Mr(b,H,y),0>y&&(y=0));b.Ia.m(p,y);b.Ya.m(I,H)}}
function Cr(a,b,c,d,e){var f=b.length;if(0===f)return new z(c,0,d,e);if(1===f){var h=b[0];d=h.Ya.width;e=h.Ya.height;return new z(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===xr(a),n=0,p=0,q=0,r=0;r<f;r++)if(!(0!==r%2||1<f&&r===f-1)){var h=b[r],s=h.Ya,t=0===n?0:l;if(m){var v=Pr(h)-k;h.ia.m(c-(s.width+v),q+t);d=Math.max(d,s.width+v);e=Math.max(e,q+t+s.height);q+=t+s.height}else v=Pr(h)-k,h.ia.m(p+t,c-(s.height+v)),e=Math.max(e,s.height+v),d=Math.max(d,p+t+s.width),p+=t+s.width;n++}var n=
0,x=p,B=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<f;r++)0!==r%2&&(h=b[r],s=h.Ya,t=0===n?0:l,m?(v=Pr(h)-k,h.ia.m(p+v,q+t),d=Math.max(d,p+s.width+v),e=Math.max(e,q+t+s.height),q+=t+s.height):(v=Pr(h)-k,h.ia.m(p+t,q+v),d=Math.max(d,p+t+s.width),e=Math.max(e,q+s.height+v),p+=t+s.width),n++);1<f&&1===f%2&&(h=b[f-1],s=h.Ya,b=Qr(h,m?Math.max(Math.abs(B),Math.abs(q)):Math.max(Math.abs(x),Math.abs(p))),m?(h.ia.m(c+k/2-h.M.x-h.Ia.x,e+b),m=c+k/2-h.M.x-h.Ia.x,d=Math.max(d,m+s.width),0>m&&(d-=m),e=Math.max(e,Math.max(B,
q)+b+s.height),0>h.ia.x&&(c=Wr(a,h.ia.x,!1,c,k))):(h.ia.m(d+b,c+k/2-h.M.y-h.Ia.y),d=Math.max(d,Math.max(x,p)+b+s.width),m=c+k/2-h.M.y-h.Ia.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.ia.y&&(c=Wr(a,h.ia.y,!0,c,k))));return new z(c,0,d,e)}
function Dr(a,b,c,d,e){var f=b.length;if(0===f)return new z(c,0,d,e);if(1===f){var h=b[0];d=h.Ya.width;e=h.Ya.height;return new z(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===xr(a),n=0,p=0,q=0,r=0;r<f;r++)if(!(0!==r%2||1<f&&r===f-1)){var h=b[r],s=h.Ya,t=0===n?0:l;if(m){var v=Pr(h)-k,q=q-(t+s.height);h.ia.m(c-(s.width+v),q);d=Math.max(d,s.width+v);e=Math.max(e,Math.abs(q))}else v=Pr(h)-k,p-=t+s.width,h.ia.m(p,c-(s.height+v)),e=Math.max(e,s.height+v),d=Math.max(d,Math.abs(p));n++}var n=0,
x=p,B=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<f;r++)0!==r%2&&(h=b[r],s=h.Ya,t=0===n?0:l,m?(v=Pr(h)-k,q-=t+s.height,h.ia.m(p+v,q),d=Math.max(d,p+s.width+v),e=Math.max(e,Math.abs(q))):(v=Pr(h)-k,p-=t+s.width,h.ia.m(p,q+v),e=Math.max(e,q+s.height+v),d=Math.max(d,Math.abs(p))),n++);1<f&&1===f%2&&(h=b[f-1],s=h.Ya,l=Qr(h,m?Math.max(Math.abs(B),Math.abs(q)):Math.max(Math.abs(x),Math.abs(p))),m?(h.ia.m(c+k/2-h.M.x-h.Ia.x,-e-s.height-l),p=c+k/2-h.M.x-h.Ia.x,d=Math.max(d,p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(B,
q))+l+s.height),0>h.ia.x&&(c=Wr(a,h.ia.x,!1,c,k))):(h.ia.m(-d-s.width-l,c+k/2-h.M.y-h.Ia.y),d=Math.max(d,Math.abs(Math.min(x,p))+l+s.width),p=c+k/2-h.M.y-h.Ia.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.ia.y&&(c=Wr(a,h.ia.y,!0,c,k))));for(r=0;r<f;r++)h=b[r],m?h.ia.m(h.ia.x,h.ia.y+e):h.ia.m(h.ia.x+d,h.ia.y);return new z(c,0,d,e)}function Pr(a){return null===a.parent?0:a.parent.nodeSpacing}function Qr(a){return null===a.parent?0:a.parent.rowSpacing}
function Wr(a,b,c,d,e){a=a.children;for(var f=a.length,h=0;h<f;h++)c?a[h].ia.m(a[h].ia.x,a[h].ia.y-b):a[h].ia.m(a[h].ia.x-b,a[h].ia.y);b=a[f-1];return Math.max(d,c?b.Ia.y+b.M.y-e/2:b.Ia.x+b.M.x-e/2)}
function Lr(a,b,c){switch(a.alignment){case nr:case Kr:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case yr:return a.width>b?a.width:b;case zr:return 2*a.M.x>b?a.width:b+a.width-2*a.M.x;case pr:case er:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case qr:return a.width-a.M.x+a.nodeSpacing/2+b;case rr:return Math.max(a.width,a.M.x+a.nodeSpacing/2+b);default:return b}}
function Mr(a,b,c){switch(a.alignment){case nr:case Kr:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case yr:return a.height>b?a.height:b;case zr:return 2*a.M.y>b?a.height:b+a.height-2*a.M.y;case pr:case er:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case qr:return a.height-a.M.y+a.nodeSpacing/2+b;case rr:return Math.max(a.height,a.M.y+a.nodeSpacing/2+b);default:return b}}
function Nr(a,b,c){switch(a){case Kr:b/=2;c/=2;break;case nr:b/=2;c/=2;break;case yr:c=b=0;break;case zr:break;default:u.k("Unhandled alignment value "+a.toString())}return new w(b,c)}function Fr(a,b,c,d,e,f){b=Nr(b,c,d);Ir(a,b.x,b.y,e,f)}function Ir(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].ia;f.x+=b;f.y+=c}}
function Gr(a,b,c,d){var e=b.parent;switch(a.Af){case Qq:for(a=b.kc;a.next();)b=a.value,b.fromVertex===e&&b.nr.m(c,d);break;case Xq:for(a=b.bc;a.next();)b=a.value,b.toVertex===e&&b.nr.m(c,d);break;default:u.k("Unhandled path value "+a.Af.toString())}}function Jr(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
function Hr(a,b,c,d,e,f,h,k){var l=xr(b),m=90===l||270===l,n=b.nodeSpacing;b=d;var p=e;d=f;e=h;var q=c.Ss,r=c.jt;h=c.Ya;var s=m?Math.max(e,h.height):Math.max(d,h.width);if(null===q||l!==xr(c))q=Er(a,2),r=Er(a,2),m?(q[0].m(0,0),q[1].m(0,h.height),r[0].m(h.width,0),r[1].m(r[0].x,q[1].y)):(q[0].m(0,0),q[1].m(h.width,0),r[0].m(0,h.height),r[1].m(q[1].x,r[0].y));if(m){c=d;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=l=0;l<p.length&&m<q.length;){e=p[l];var t=q[m];f=t.x;var v=t.y;f+=
c;var x=e;l+1<p.length&&(x=p[l+1]);var B=t,t=B.x,B=B.y;m+1<q.length&&(B=q[m+1],t=B.x,B=B.y,t+=c);var y=d;e.y===v?y=f-e.x:e.y>v&&e.y<B?y=f+(e.y-v)/(B-v)*(t-f)-e.x:v>e.y&&v<x.y&&(y=f-(e.x+(v-e.y)/(x.y-e.y)*(x.x-e.x)));y<d&&(d=y);x.y<=e.y?l++:B<=v?m++:(x.y<=B&&l++,B<=x.y&&m++)}c-=d;c+=n;l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=Er(a,b.length+l.length);for(d=f=e=0;f<l.length&&l[f].y<b[0].y;)v=l[f++],n[d++].m(v.x+m,v.y);for(;e<b.length;)v=b[e++],n[d++].m(v.x,v.y);for(e=b[b.length-
1].y;f<l.length&&l[f].y<=e;)f++;for(;f<l.length&&l[f].y>e;)v=l[f++],n[d++].m(v.x+m,v.y);l=Er(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);Or(a,n);d=l}f=r;v=c;if(null===p||2>p.length||null===f||2>f.length)e=null;else{n=Er(a,p.length+f.length);for(m=x=l=0;l<p.length&&p[l].y<f[0].y;)e=p[l++],n[m++].m(e.x,e.y);for(;x<f.length;)e=f[x++],n[m++].m(e.x+v,e.y);for(f=f[f.length-1].y;l<p.length&&p[l].y<=f;)l++;for(;l<p.length&&p[l].y>f;)e=p[l++],n[m++].m(e.x,e.y);e=Er(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);Or(a,n)}f=
Math.max(0,c)+h.width;h=s}else{c=e;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=l=0;l<p.length&&m<q.length;)e=p[l],t=q[m],f=t.x,v=t.y,v+=c,x=e,l+1<p.length&&(x=p[l+1]),B=t,t=B.x,B=B.y,m+1<q.length&&(B=q[m+1],t=B.x,B=B.y,B+=c),y=d,e.x===f?y=v-e.y:e.x>f&&e.x<t?y=v+(e.x-f)/(t-f)*(B-v)-e.y:f>e.x&&f<x.x&&(y=v-(e.y+(f-e.x)/(x.x-e.x)*(x.y-e.y))),y<d&&(d=y),x.x<=e.x?l++:t<=f?m++:(x.x<=t&&l++,t<=x.x&&m++);c-=d;c+=n;l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=Er(a,
b.length+l.length);for(d=f=e=0;f<l.length&&l[f].x<b[0].x;)v=l[f++],n[d++].m(v.x,v.y+m);for(;e<b.length;)v=b[e++],n[d++].m(v.x,v.y);for(e=b[b.length-1].x;f<l.length&&l[f].x<=e;)f++;for(;f<l.length&&l[f].x>e;)v=l[f++],n[d++].m(v.x,v.y+m);l=Er(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);Or(a,n);d=l}f=r;v=c;if(null===p||2>p.length||null===f||2>f.length)e=null;else{n=Er(a,p.length+f.length);for(m=x=l=0;l<p.length&&p[l].x<f[0].x;)e=p[l++],n[m++].m(e.x,e.y);for(;x<f.length;)e=f[x++],n[m++].m(e.x,e.y+v);for(f=
f[f.length-1].x;l<p.length&&p[l].x<=f;)l++;for(;l<p.length&&p[l].x>f;)e=p[l++],n[m++].m(e.x,e.y);e=Er(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);Or(a,n)}f=s;h=Math.max(0,c)+h.height}Or(a,b);Or(a,q);Or(a,p);Or(a,r);k[0]=d;k[1]=e;return new z(c,0,f,h)}function Er(a,b){var c=a.By[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new w;return c}function Or(a,b){var c=b.length,d=a.By[c];void 0===d&&(d=[],a.By[c]=d);d.push(b)}
Y.prototype.arrangeTrees=function(){if(this.Yc===Wq)for(var a=this.nd.i;a.next();){var b=a.value;if(b instanceof Uq){var c=b.Cc;if(null!==c){var d=c.position,c=d.x,d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);Xr(this,b,c,d)}}}else for(a=this.Ud,b=a.x,c=a.y,a=this.nd.i;a.next();)if(d=a.value,d instanceof Uq)switch(Xr(this,d,b+d.Ia.x,c+d.Ia.y),this.Yc){case Tq:c+=d.Ya.height+this.Uf.height;break;case Yr:b+=d.Ya.width+this.Uf.width;break;default:u.k("Unhandled arrangement value "+this.Yc.toString())}};
function Xr(a,b,c,d){if(null!==b){b.x=c;b.y=d;b=b.children;for(var e=b.length,f=0;f<e;f++){var h=b[f];Xr(a,h,c+h.ia.x,d+h.ia.y)}}}Y.prototype.commitLayout=function(){this.cA();this.commitNodes();this.Sy();this.Qs&&this.commitLinks()};Y.prototype.commitNodes=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
Y.prototype.Sy=function(){if(this.wz===br){for(var a=this.BA,b=[],c=null,d=this.network.vertexes.i;d.next();){var e=d.value;null===c?c=e.kb.copy():c.Sh(e.kb);var f=b[e.level],f=void 0===f?Ar(e):Math.max(f,Ar(e));b[e.level]=f}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.Jf(this.nodeSpacing/2,this.layerSpacing),e=new w(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.Jf(this.layerSpacing,this.nodeSpacing/2),e=new w(-this.layerSpacing/2,-this.nodeSpacing/2));var f=
[],c=90===this.angle||270===this.angle?c.width:c.height,h=0;if(180===this.angle||270===this.angle)for(d=0;d<a.length;d++)h+=a[d]+b[d];for(d=0;d<a.length;d++){var k=a[d]+b[d];270===this.angle?(h-=k,f.push(new z(0,h,c,k))):90===this.angle?(f.push(new z(0,h,c,k)),h+=k):180===this.angle?(h-=k,f.push(new z(h,0,k,c))):(f.push(new z(h,0,k,c)),h+=k)}this.commitLayers(f,e)}};Y.prototype.commitLayers=function(){};Y.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
Y.prototype.cA=function(){for(var a=this.nd.i;a.next();){var b=a.value;b instanceof Uq&&Zr(this,b)}};function Zr(a,b){if(null!==b){a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Zr(a,c[e])}}
Y.prototype.setPortSpots=function(a){var b=a.alignment;if(or(b)){var c=this.Af===Qq,d=xr(a),e;switch(d){case 0:e=xc;break;case 90:e=Cc;break;case 180:e=wc;break;default:e=vc}var f=a.children,h=f.length;switch(b){case pr:case er:for(b=0;b<h;b++){var k=f[b],k=(c?k.kc:k.bc).first();if(null!==k&&(k=k.link,null!==k)){var l=90===d||270===d?wc:vc;if(1===h||b===h-1&&1===h%2)switch(d){case 0:l=wc;break;case 90:l=vc;break;case 180:l=xc;break;default:l=Cc}else 0===b%2&&(l=90===d||270===d?xc:Cc);c?(a.setsPortSpot&&
(k.vb=e),a.setsChildPortSpot&&(k.xb=l)):(a.setsPortSpot&&(k.vb=l),a.setsChildPortSpot&&(k.xb=e))}}break;case qr:l=90===d||270===d?xc:Cc;for(d=c?a.bc:a.kc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.vb=e),a.setsChildPortSpot&&(k.xb=l)):(a.setsPortSpot&&(k.vb=l),a.setsChildPortSpot&&(k.xb=e)));break;case rr:for(l=90===d||270===d?wc:vc,d=c?a.bc:a.kc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.vb=e),a.setsChildPortSpot&&(k.xb=l)):(a.setsPortSpot&&(k.vb=l),a.setsChildPortSpot&&
(k.xb=e)))}}else if(c=xr(a),this.Af===Qq)for(e=a.bc;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Lc())switch(c){case 0:d.vb=xc;break;case 90:d.vb=Cc;break;case 180:d.vb=wc;break;default:d.vb=vc}else d.vb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Lc())switch(c){case 0:d.xb=wc;break;case 90:d.xb=vc;break;case 180:d.xb=xc;break;default:d.xb=Cc}else d.xb=a.childPortSpot}}else for(e=a.kc;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Lc())switch(c){case 0:d.xb=
xc;break;case 90:d.xb=Cc;break;case 180:d.xb=wc;break;default:d.xb=vc}else d.xb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Lc())switch(c){case 0:d.vb=wc;break;case 90:d.vb=vc;break;case 180:d.vb=xc;break;default:d.vb=Cc}else d.vb=a.childPortSpot}};function xr(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
function Ar(a){var b=xr(a),b=90===b||270===b,c=a.layerSpacing;if(0<a.layerSpacingParentOverlap)var d=Math.min(1,a.layerSpacingParentOverlap),c=c-(b?a.height*d:a.width*d);c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c}function Br(a){var b=xr(a),b=90===b||270===b,c=a.nodeIndent;if(0<a.nodeIndentPastParent)var d=Math.min(1,a.nodeIndentPastParent),c=c+(b?a.width*d:a.height*d);return c=Math.max(0,c)}
u.defineProperty(Y,{rK:"roots"},function(){return this.nd},function(a){this.nd!==a&&(u.C(a,F,Y,"roots"),this.nd=a,this.H())});u.defineProperty(Y,{path:"path"},function(){return this.fr},function(a){this.fr!==a&&(u.rb(a,Y,Y,"path"),this.fr=a,this.H())});u.defineProperty(Y,{AI:"treeStyle"},function(){return this.Wr},function(a){this.Yc!==a&&(u.rb(a,Y,Y,"treeStyle"),a===Rq||a===hr||a===ir||a===gr)&&(this.Wr=a,this.H())});
u.defineProperty(Y,{wz:"layerStyle"},function(){return this.Cu},function(a){this.Yc!==a&&(u.rb(a,Y,Y,"layerStyle"),a===Sq||a===cr||a===br)&&(this.Cu=a,this.H())});u.defineProperty(Y,{comments:"comments"},function(){return this.oh},function(a){this.oh!==a&&(u.j(a,"boolean",Y,"comments"),this.oh=a,this.H())});u.defineProperty(Y,{Gf:"arrangement"},function(){return this.Yc},function(a){this.Yc!==a&&(u.rb(a,Y,Y,"arrangement"),a===Tq||a===Yr||a===Wq)&&(this.Yc=a,this.H())});
u.defineProperty(Y,{QC:"arrangementSpacing"},function(){return this.Uf},function(a){u.C(a,ia,Y,"arrangementSpacing");this.Uf.L(a)||(this.Uf.assign(a),this.H())});u.defineProperty(Y,{qK:"rootDefaults"},function(){return this.qa},function(a){this.qa!==a&&(u.C(a,Uq,Y,"rootDefaults"),this.qa=a,this.H())});u.defineProperty(Y,{OI:"alternateDefaults"},function(){return this.pa},function(a){this.pa!==a&&(u.C(a,Uq,Y,"alternateDefaults"),this.pa=a,this.H())});
u.defineProperty(Y,{sorting:"sorting"},function(){return this.qa.sorting},function(a){this.qa.sorting!==a&&(u.rb(a,Y,Y,"sorting"),a===jr||a===kr||a===lr||mr)&&(this.qa.sorting=a,this.H())});u.defineProperty(Y,{comparer:"comparer"},function(){return this.qa.comparer},function(a){this.qa.comparer!==a&&(u.j(a,"function",Y,"comparer"),this.qa.comparer=a,this.H())});
u.defineProperty(Y,{angle:"angle"},function(){return this.qa.angle},function(a){this.qa.angle!==a&&(u.j(a,"number",Y,"angle"),0===a||90===a||180===a||270===a)&&(this.qa.angle=a,this.H())});u.defineProperty(Y,{alignment:"alignment"},function(){return this.qa.alignment},function(a){this.qa.alignment!==a&&(u.rb(a,Y,Y,"alignment"),this.qa.alignment=a,this.H())});
u.defineProperty(Y,{nodeIndent:"nodeIndent"},function(){return this.qa.nodeIndent},function(a){this.qa.nodeIndent!==a&&(u.j(a,"number",Y,"nodeIndent"),0<=a&&(this.qa.nodeIndent=a,this.H()))});u.defineProperty(Y,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.qa.nodeIndentPastParent},function(a){this.qa.nodeIndentPastParent!==a&&(u.j(a,"number",Y,"nodeIndentPastParent"),0<=a&&1>=a&&(this.qa.nodeIndentPastParent=a,this.H()))});
u.defineProperty(Y,{nodeSpacing:"nodeSpacing"},function(){return this.qa.nodeSpacing},function(a){this.qa.nodeSpacing!==a&&(u.j(a,"number",Y,"nodeSpacing"),this.qa.nodeSpacing=a,this.H())});u.defineProperty(Y,{layerSpacing:"layerSpacing"},function(){return this.qa.layerSpacing},function(a){this.qa.layerSpacing!==a&&(u.j(a,"number",Y,"layerSpacing"),this.qa.layerSpacing=a,this.H())});
u.defineProperty(Y,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.qa.layerSpacingParentOverlap},function(a){this.qa.layerSpacingParentOverlap!==a&&(u.j(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.qa.layerSpacingParentOverlap=a,this.H()))});u.defineProperty(Y,{compaction:"compaction"},function(){return this.qa.compaction},function(a){this.qa.compaction!==a&&(u.rb(a,Y,Y,"compaction"),a===ur||a===wr)&&(this.qa.compaction=a,this.H())});
u.defineProperty(Y,{breadthLimit:"breadthLimit"},function(){return this.qa.breadthLimit},function(a){this.qa.breadthLimit!==a&&(u.j(a,"number",Y,"breadthLimit"),0<=a&&(this.qa.breadthLimit=a,this.H()))});u.defineProperty(Y,{rowSpacing:"rowSpacing"},function(){return this.qa.rowSpacing},function(a){this.qa.rowSpacing!==a&&(u.j(a,"number",Y,"rowSpacing"),this.qa.rowSpacing=a,this.H())});
u.defineProperty(Y,{rowIndent:"rowIndent"},function(){return this.qa.rowIndent},function(a){this.qa.rowIndent!==a&&(u.j(a,"number",Y,"rowIndent"),0<=a&&(this.qa.rowIndent=a,this.H()))});u.defineProperty(Y,{commentSpacing:"commentSpacing"},function(){return this.qa.commentSpacing},function(a){this.qa.commentSpacing!==a&&(u.j(a,"number",Y,"commentSpacing"),this.qa.commentSpacing=a,this.H())});
u.defineProperty(Y,{commentMargin:"commentMargin"},function(){return this.qa.commentMargin},function(a){this.qa.commentMargin!==a&&(u.j(a,"number",Y,"commentMargin"),this.qa.commentMargin=a,this.H())});u.defineProperty(Y,{setsPortSpot:"setsPortSpot"},function(){return this.qa.setsPortSpot},function(a){this.qa.setsPortSpot!==a&&(u.j(a,"boolean",Y,"setsPortSpot"),this.qa.setsPortSpot=a,this.H())});
u.defineProperty(Y,{portSpot:"portSpot"},function(){return this.qa.portSpot},function(a){u.C(a,L,Y,"portSpot");this.qa.portSpot.L(a)||(this.qa.portSpot=a,this.H())});u.defineProperty(Y,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.qa.setsChildPortSpot},function(a){this.qa.setsChildPortSpot!==a&&(u.j(a,"boolean",Y,"setsChildPortSpot"),this.qa.setsChildPortSpot=a,this.H())});
u.defineProperty(Y,{childPortSpot:"childPortSpot"},function(){return this.qa.childPortSpot},function(a){u.C(a,L,Y,"childPortSpot");this.qa.childPortSpot.L(a)||(this.qa.childPortSpot=a,this.H())});u.defineProperty(Y,{$I:"alternateSorting"},function(){return this.pa.sorting},function(a){this.pa.sorting!==a&&(u.rb(a,Y,Y,"alternateSorting"),a===jr||a===kr||a===lr||mr)&&(this.pa.sorting=a,this.H())});
u.defineProperty(Y,{NI:"alternateComparer"},function(){return this.pa.comparer},function(a){this.pa.comparer!==a&&(u.j(a,"function",Y,"alternateComparer"),this.pa.comparer=a,this.H())});u.defineProperty(Y,{HI:"alternateAngle"},function(){return this.pa.angle},function(a){this.pa.angle!==a&&(u.j(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.pa.angle=a,this.H())});
u.defineProperty(Y,{GI:"alternateAlignment"},function(){return this.pa.alignment},function(a){this.pa.alignment!==a&&(u.rb(a,Y,Y,"alternateAlignment"),this.pa.alignment=a,this.H())});u.defineProperty(Y,{SI:"alternateNodeIndent"},function(){return this.pa.nodeIndent},function(a){this.pa.nodeIndent!==a&&(u.j(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.pa.nodeIndent=a,this.H()))});
u.defineProperty(Y,{TI:"alternateNodeIndentPastParent"},function(){return this.pa.nodeIndentPastParent},function(a){this.pa.nodeIndentPastParent!==a&&(u.j(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.pa.nodeIndentPastParent=a,this.H()))});u.defineProperty(Y,{UI:"alternateNodeSpacing"},function(){return this.pa.nodeSpacing},function(a){this.pa.nodeSpacing!==a&&(u.j(a,"number",Y,"alternateNodeSpacing"),this.pa.nodeSpacing=a,this.H())});
u.defineProperty(Y,{QI:"alternateLayerSpacing"},function(){return this.pa.layerSpacing},function(a){this.pa.layerSpacing!==a&&(u.j(a,"number",Y,"alternateLayerSpacing"),this.pa.layerSpacing=a,this.H())});u.defineProperty(Y,{RI:"alternateLayerSpacingParentOverlap"},function(){return this.pa.layerSpacingParentOverlap},function(a){this.pa.layerSpacingParentOverlap!==a&&(u.j(a,"number",Y,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.pa.layerSpacingParentOverlap=a,this.H()))});
u.defineProperty(Y,{MI:"alternateCompaction"},function(){return this.pa.compaction},function(a){this.pa.compaction!==a&&(u.rb(a,Y,Y,"alternateCompaction"),a===ur||a===wr)&&(this.pa.compaction=a,this.H())});u.defineProperty(Y,{II:"alternateBreadthLimit"},function(){return this.pa.breadthLimit},function(a){this.pa.breadthLimit!==a&&(u.j(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.pa.breadthLimit=a,this.H()))});
u.defineProperty(Y,{XI:"alternateRowSpacing"},function(){return this.pa.rowSpacing},function(a){this.pa.rowSpacing!==a&&(u.j(a,"number",Y,"alternateRowSpacing"),this.pa.rowSpacing=a,this.H())});u.defineProperty(Y,{WI:"alternateRowIndent"},function(){return this.pa.rowIndent},function(a){this.pa.rowIndent!==a&&(u.j(a,"number",Y,"alternateRowIndent"),0<=a&&(this.pa.rowIndent=a,this.H()))});
u.defineProperty(Y,{LI:"alternateCommentSpacing"},function(){return this.pa.commentSpacing},function(a){this.pa.commentSpacing!==a&&(u.j(a,"number",Y,"alternateCommentSpacing"),this.pa.commentSpacing=a,this.H())});u.defineProperty(Y,{KI:"alternateCommentMargin"},function(){return this.pa.commentMargin},function(a){this.pa.commentMargin!==a&&(u.j(a,"number",Y,"alternateCommentMargin"),this.pa.commentMargin=a,this.H())});
u.defineProperty(Y,{ZI:"alternateSetsPortSpot"},function(){return this.pa.setsPortSpot},function(a){this.pa.setsPortSpot!==a&&(u.j(a,"boolean",Y,"alternateSetsPortSpot"),this.pa.setsPortSpot=a,this.H())});u.defineProperty(Y,{VI:"alternatePortSpot"},function(){return this.pa.portSpot},function(a){u.C(a,L,Y,"alternatePortSpot");this.pa.portSpot.L(a)||(this.pa.portSpot=a,this.H())});
u.defineProperty(Y,{YI:"alternateSetsChildPortSpot"},function(){return this.pa.setsChildPortSpot},function(a){this.pa.setsChildPortSpot!==a&&(u.j(a,"boolean",Y,"alternateSetsChildPortSpot"),this.pa.setsChildPortSpot=a,this.H())});u.defineProperty(Y,{JI:"alternateChildPortSpot"},function(){return this.pa.childPortSpot},function(a){u.C(a,L,Y,"alternateChildPortSpot");this.pa.childPortSpot.L(a)||(this.pa.childPortSpot=a,this.H())});var Pq;Y.PathDefault=Pq=u.s(Y,"PathDefault",-1);var Qq;
Y.PathDestination=Qq=u.s(Y,"PathDestination",0);var Xq;Y.PathSource=Xq=u.s(Y,"PathSource",1);var jr;Y.SortingForwards=jr=u.s(Y,"SortingForwards",10);var kr;Y.SortingReverse=kr=u.s(Y,"SortingReverse",11);var lr;Y.SortingAscending=lr=u.s(Y,"SortingAscending",12);var mr;Y.SortingDescending=mr=u.s(Y,"SortingDescending",13);var Kr;Y.AlignmentCenterSubtrees=Kr=u.s(Y,"AlignmentCenterSubtrees",20);var nr;Y.AlignmentCenterChildren=nr=u.s(Y,"AlignmentCenterChildren",21);var yr;
Y.AlignmentStart=yr=u.s(Y,"AlignmentStart",22);var zr;Y.AlignmentEnd=zr=u.s(Y,"AlignmentEnd",23);var pr;Y.AlignmentBus=pr=u.s(Y,"AlignmentBus",24);var er;Y.AlignmentBusBranching=er=u.s(Y,"AlignmentBusBranching",25);var qr;Y.AlignmentTopLeftBus=qr=u.s(Y,"AlignmentTopLeftBus",26);var rr;Y.AlignmentBottomRightBus=rr=u.s(Y,"AlignmentBottomRightBus",27);var ur;Y.CompactionNone=ur=u.s(Y,"CompactionNone",30);var wr;Y.CompactionBlock=wr=u.s(Y,"CompactionBlock",31);var Rq;
Y.StyleLayered=Rq=u.s(Y,"StyleLayered",40);var ir;Y.StyleLastParents=ir=u.s(Y,"StyleLastParents",41);var hr;Y.StyleAlternating=hr=u.s(Y,"StyleAlternating",42);var gr;Y.StyleRootOnly=gr=u.s(Y,"StyleRootOnly",43);var Tq;Y.ArrangementVertical=Tq=u.s(Y,"ArrangementVertical",50);var Yr;Y.ArrangementHorizontal=Yr=u.s(Y,"ArrangementHorizontal",51);var Wq;Y.ArrangementFixedRoots=Wq=u.s(Y,"ArrangementFixedRoots",52);var Sq;Y.LayerIndividual=Sq=u.s(Y,"LayerIndividual",60);var cr;
Y.LayerSiblings=cr=u.s(Y,"LayerSiblings",61);var br;Y.LayerUniform=br=u.s(Y,"LayerUniform",62);function Vq(){xa.call(this)}u.Ga(Vq,xa);u.fa("TreeNetwork",Vq);Vq.prototype.createVertex=function(){return new Uq};Vq.prototype.createEdge=function(){return new $r};
function Uq(){ya.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.ia=new w(0,0);this.Ya=new ia(0,0);this.Ia=new w(0,0);this.cp=this.bp=this.aI=!1;this.jt=this.Ss=null;this.sorting=jr;this.comparer=dp;this.angle=0;this.alignment=nr;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=wr;this.breadthLimit=
0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=uc;this.setsChildPortSpot=!0;this.childPortSpot=uc}u.Ga(Uq,ya);u.fa("TreeVertex",Uq);
Uq.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing,
this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};u.u(Uq,{qm:"childrenCount"},function(){return this.children.length});u.defineProperty(Uq,{pK:"relativePosition"},function(){return this.ia},function(a){this.ia.set(a)});u.defineProperty(Uq,{zK:"subtreeSize"},function(){return this.Ya},function(a){this.Ya.set(a)});
u.defineProperty(Uq,{yK:"subtreeOffset"},function(){return this.Ia},function(a){this.Ia.set(a)});function $r(){Aa.call(this);this.nr=new w(0,0)}u.Ga($r,Aa);u.fa("TreeEdge",$r);
$r.prototype.commit=function(){var a=this.link;if(null!==a&&!a.el){var b=this.network.Qb,c=null,d=null;switch(b.Af){case Qq:c=this.fromVertex;d=this.toVertex;break;case Xq:c=this.toVertex;d=this.fromVertex;break;default:u.k("Unhandled path value "+b.Af.toString())}if(null!==c&&null!==d)if(b=this.nr,0!==b.x||0!==b.y||c.aI){var d=c.kb,e=xr(c),f=Ar(c),h=c.rowSpacing;a.updateRoute();var k=a.Ve===kh,l=a.dc,m=0,n,p;a.rl();if(l||k){for(m=2;4<a.ka;)a.nE(2);n=a.l(1);p=a.l(2)}else{for(m=1;3<a.ka;)a.nE(1);n=
a.l(0);p=a.l(a.ka-1)}var q=a.l(a.ka-1),r=0;0===e?(c.alignment===zr?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Br(c))))):c.alignment===yr?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+Br(c))))):r=c.bp||c.cp&&1===c.maxGenerationCount?d.top-c.Ia.y+b.y:d.y+d.height/2+b.y,k?(a.w(m,n.x,r),m++,a.w(m,d.right+f,r),m++,a.w(m,d.right+f+(b.x-h)/3,r),m++,a.w(m,d.right+f+2*(b.x-h)/3,r),m++,a.w(m,d.right+f+(b.x-h),r),m++,a.w(m,p.x,r)):(l&&(a.w(m,d.right+
f/2,n.y),m++),a.w(m,d.right+f/2,r),m++,a.w(m,d.right+f+b.x-(l?h/2:h),r),m++,l&&a.w(m,a.l(m-1).x,p.y))):90===e?(c.alignment===zr?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Br(c))))):c.alignment===yr?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+Br(c))))):r=c.bp||c.cp&&1===c.maxGenerationCount?d.left-c.Ia.x+b.x:d.x+d.width/2+b.x,k?(a.w(m,r,n.y),m++,a.w(m,r,d.bottom+f),m++,a.w(m,r,d.bottom+f+(b.y-h)/3),m++,a.w(m,r,d.bottom+f+2*(b.y-h)/3),m++,
a.w(m,r,d.bottom+f+(b.y-h)),m++,a.w(m,r,p.y)):(l&&(a.w(m,n.x,d.bottom+f/2),m++),a.w(m,r,d.bottom+f/2),m++,a.w(m,r,d.bottom+f+b.y-(l?h/2:h)),m++,l&&a.w(m,p.x,a.l(m-1).y))):180===e?(c.alignment===zr?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Br(c))))):c.alignment===yr?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+Br(c))))):r=c.bp||c.cp&&1===c.maxGenerationCount?d.top-c.Ia.y+b.y:d.y+d.height/2+b.y,k?(a.w(m,n.x,r),m++,a.w(m,d.left-f,r),m++,a.w(m,
d.left-f+(b.x+h)/3,r),m++,a.w(m,d.left-f+2*(b.x+h)/3,r),m++,a.w(m,d.left-f+(b.x+h),r),m++,a.w(m,p.x,r)):(l&&(a.w(m,d.left-f/2,n.y),m++),a.w(m,d.left-f/2,r),m++,a.w(m,d.left-f+b.x+(l?h/2:h),r),m++,l&&a.w(m,a.l(m-1).x,p.y))):270===e?(c.alignment===zr?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Br(c))))):c.alignment===yr?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+Br(c))))):r=c.bp||c.cp&&1===c.maxGenerationCount?d.left-c.Ia.x+b.x:d.x+d.width/
2+b.x,k?(a.w(m,r,n.y),m++,a.w(m,r,d.top-f),m++,a.w(m,r,d.top-f+(b.y+h)/3),m++,a.w(m,r,d.top-f+2*(b.y+h)/3),m++,a.w(m,r,d.top-f+(b.y+h)),m++,a.w(m,r,p.y)):(l&&(a.w(m,n.x,d.top-f/2),m++),a.w(m,r,d.top-f/2),m++,a.w(m,r,d.top-f+b.y+(l?h/2:h)),m++,l&&a.w(m,p.x,a.l(m-1).y))):u.k("Invalid angle "+e);a.Bi()}else e=c,f=d,a=this.link,c=xr(e),c!==xr(f)&&(b=Ar(e),d=e.kb,e=f.kb,0===c&&e.left-d.right<b+1||90===c&&e.top-d.bottom<b+1||180===c&&d.left-e.right<b+1||270===c&&d.top-e.bottom<b+1||(a.updateRoute(),e=a.Ve===
kh,f=a.dc,h=or(this.fromVertex.alignment),a.rl(),0===c?(c=d.right+b/2,e?4===a.ka&&(b=a.l(3).y,a.V(1,c-20,a.l(1).y),a.w(2,c-20,b),a.w(3,c,b),a.w(4,c+20,b),a.V(5,a.l(5).x,b)):f?h?a.V(3,a.l(2).x,a.l(4).y):6===a.ka&&(a.V(2,c,a.l(2).y),a.V(3,c,a.l(3).y)):4===a.ka?a.w(2,c,a.l(2).y):3===a.ka?a.V(1,c,a.l(2).y):2===a.ka&&a.w(1,c,a.l(1).y)):90===c?(b=d.bottom+b/2,e?4===a.ka&&(c=a.l(3).x,a.V(1,a.l(1).x,b-20),a.w(2,c,b-20),a.w(3,c,b),a.w(4,c,b+20),a.V(5,c,a.l(5).y)):f?h?a.V(3,a.l(2).x,a.l(4).y):6===a.ka&&(a.V(2,
a.l(2).x,b),a.V(3,a.l(3).x,b)):4===a.ka?a.w(2,a.l(2).x,b):3===a.ka?a.V(1,a.l(2).x,b):2===a.ka&&a.w(1,a.l(1).x,b)):180===c?(c=d.left-b/2,e?4===a.ka&&(b=a.l(3).y,a.V(1,c+20,a.l(1).y),a.w(2,c+20,b),a.w(3,c,b),a.w(4,c-20,b),a.V(5,a.l(5).x,b)):f?h?a.V(3,a.l(2).x,a.l(4).y):6===a.ka&&(a.V(2,c,a.l(2).y),a.V(3,c,a.l(3).y)):4===a.ka?a.w(2,c,a.l(2).y):3===a.ka?a.V(1,c,a.l(2).y):2===a.ka&&a.w(1,c,a.l(1).y)):270===c&&(b=d.top-b/2,e?4===a.ka&&(c=a.l(3).x,a.V(1,a.l(1).x,b+20),a.w(2,c,b+20),a.w(3,c,b),a.w(4,c,b-
20),a.V(5,c,a.l(5).y)):f?h?a.V(3,a.l(2).x,a.l(4).y):6===a.ka&&(a.V(2,a.l(2).x,b),a.V(3,a.l(3).x,b)):4===a.ka?a.w(2,a.l(2).x,b):3===a.ka?a.V(1,a.l(2).x,b):2===a.ka&&a.w(1,a.l(1).x,b)),a.Bi()))}};u.defineProperty($r,{oK:"relativePoint"},function(){return this.nr},function(a){this.nr.set(a)});function as(){this.xn=[]}
function Ql(a){var b=new as,c=null;"string"===typeof a?c=(new DOMParser).parseFromString(a,"text/xml"):a instanceof Document&&(c=a.implementation.createDocument("http://www.w3.org/2000/svg","svg",null),c.appendChild(c.importNode(a.documentElement,!0)));if(null===c)return null;a=c.getElementsByTagName("svg");if(0===a.length)return null;var d=a[0],e=c.getElementsByTagName("linearGradient"),f=c.getElementsByTagName("radialGradient");for(a=0;a<e.length;a++){for(var h=e[a],k=Rl(ga,ue,{start:Dc,end:Kc}),
l=h.childNodes,m=0;m<l.length;m++)if("stop"===l[m].tagName){var n=bs(b,l[m],"stop-color");if(null!==n&&""!==n){var p=bs(b,l[m],"offset");if(null===p||""===p)p="0";var q=parseFloat(p);isNaN(q)&&(q=0);k.addColorStop((-1!==p.indexOf("%")?.01:1)*q,n)}}h=h.getAttribute("id");"string"===typeof h&&(b["_brush"+h]=k)}for(a=0;a<f.length;a++){h=f[a];k=Rl(ga,ve,{start:Ib,end:Ib});l=h.childNodes;for(m=0;m<l.length;m++)if("stop"===l[m].tagName&&(n=bs(b,l[m],"stop-color"),null!==n&&""!==n)){p=bs(b,l[m],"offset");
if(null===p||""===p)p="0";q=parseFloat(p);isNaN(q)&&(q=0);k.addColorStop((-1!==p.indexOf("%")?.01:1)*q,n)}h=h.getAttribute("id");"string"===typeof h&&(b["_brush"+h]=k)}for(e=!0;e;)for(e=!1,f=c.getElementsByTagName("use"),a=0;a<f.length;a++)k=f[a],0===k.childNodes.length&&(h=k.href,void 0!==h&&(h=c.getElementById(h.baseVal.substring(1)),null!==h&&(h=h.cloneNode(!0),h.removeAttribute("id"),l=parseFloat(k.getAttribute("x")),isNaN(l)&&(l=0),m=parseFloat(k.getAttribute("y")),isNaN(m)&&(m=0),n=k.getAttribute("transform"),
null===n&&(n=""),k.setAttribute("transform",n+" translate("+l+","+m+")"),k.appendChild(h),"use"===h.tagName&&(e=!0))));cs(b,d,null);c=new A;if(0===b.xn.length)return c;if(1===b.xn.length)return b.xn[0];for(a=0;a<b.xn.length;a++)c.add(b.xn[a]);return c}function ds(a,b){var c=a.getAttribute(b);"string"!==typeof c&&a.style&&(c=a.style[b]);return"string"!==typeof c?null:c}
function bs(a,b,c){var d=b.getAttribute(c);"string"!==typeof d&&b.style&&(d=b.style[c]);return"string"!==typeof d||""===d||"inherit"===d?(b=b.parentNode,"g"===b.tagName||"use"===b.tagName?bs(a,b,c):null):d}
function cs(a,b,c){var d=b.tagName;if(("g"===d||"svg"===d||"use"===d||"symbol"===d)&&"none"!==bs(a,b,"display")){for(var d=b.childNodes,e=0;e<d.length;e++){var f=d[e],h=null;if(void 0!==f.getAttribute){var k=f.getAttribute("transform");switch(f.tagName){case "g":null===k?cs(a,f,null):(h=new A,cs(a,f,h));break;case "use":null===k?cs(a,f,null):(h=new A,cs(a,f,h));break;case "symbol":if("use"!==b.tagName)break;h=new A;cs(a,f,h);var l=h,m=a,n=f;bs(m,n,"preserveAspectRatio");bs(m,n,"viewBox");l.scale=
1;break;case "path":l=f;h=new X;l=l.getAttribute("d");"string"===typeof l&&(h.EG=rd(l));break;case "line":var p=f,h=new X,l=parseFloat(p.getAttribute("x1"));isNaN(l)&&(l=0);m=parseFloat(p.getAttribute("y1"));isNaN(m)&&(m=0);n=parseFloat(p.getAttribute("x2"));isNaN(n)&&(n=0);p=parseFloat(p.getAttribute("y2"));isNaN(p)&&(p=0);var q=new $c(dd);h.position=new w(Math.min(l,n),Math.min(m,p));0<(n-l)/(p-m)?(q.ua=0,q.va=0,q.F=Math.abs(n-l),q.G=Math.abs(p-m)):(q.ua=0,q.va=Math.abs(p-m),q.F=Math.abs(n-l),q.G=
0);h.dd=q;break;case "circle":n=f;h=new X;l=parseFloat(n.getAttribute("r"));isNaN(l)||0>l?h=null:(m=parseFloat(n.getAttribute("cx")),isNaN(m)&&(m=0),n=parseFloat(n.getAttribute("cy")),isNaN(n)&&(n=0),p=new $c(nd),p.ua=0,p.va=0,p.F=2*l,p.G=2*l,h.position=new w(m-l,n-l),h.dd=p);break;case "ellipse":p=f;h=new X;l=parseFloat(p.getAttribute("rx"));isNaN(l)||0>l?h=null:(m=parseFloat(p.getAttribute("ry")),isNaN(m)||0>m?h=null:(n=parseFloat(p.getAttribute("cx")),isNaN(n)&&(n=0),p=parseFloat(p.getAttribute("cy")),
isNaN(p)&&(p=0),q=new $c(nd),q.ua=0,q.va=0,q.F=2*l,q.G=2*m,h.position=new w(n-l,p-m),h.dd=q));break;case "rect":q=f;h=new X;l=parseFloat(q.getAttribute("width"));if(isNaN(l)||0>l)h=null;else if(m=parseFloat(q.getAttribute("height")),isNaN(m)||0>m)h=null;else{n=parseFloat(q.getAttribute("x"));isNaN(n)&&(n=0);p=parseFloat(q.getAttribute("y"));isNaN(p)&&(p=0);var r=q.getAttribute("rx"),s=q.getAttribute("ry"),q=parseFloat(r);if(isNaN(q)||0>q)q=0;var t=parseFloat(s);if(isNaN(t)||0>t)t=0;null!==r&&""!==
r||null===s||""===s?null===r||""===r||null!==s&&""!==s||(t=q):q=t;q=Math.min(q,l/2);t=Math.min(t,m/2);s=void 0;0===q&&0===t?(s=new $c(md),s.ua=0,s.va=0,s.F=l,s.G=m):(s=K.sa/2,r=u.p(),M(r,q,0,!0),r.lineTo(l-q,0),O(r,l-q*s,0,l,t*s,l,t),r.lineTo(l,m-t),O(r,l,m-t*s,l-q*s,m,l-q,m),r.lineTo(q,m),O(r,q*s,m,0,m-t*s,0,m-t),r.lineTo(0,t),O(r,0,t*s,q*s,0,q,0),P(r),s=r.o,u.q(r));h.position=new w(n,p);h.dd=s}break;case "polygon":h=es(f);break;case "polyline":h=es(f)}if(null!==h){if(h instanceof X){m=h;l=bs(a,
f,"fill");null!==l&&-1!==l.indexOf("url")?(l=l.substring(l.indexOf("#")+1,l.length-1),l=a["_brush"+l],m.fill=l instanceof ga?l:"black"):m.fill=null===l?"black":"none"===l?null:l;l=bs(a,f,"stroke");null!==l&&-1!==l.indexOf("url")?(l=l.substring(l.indexOf("#")+1,l.length-1),l=a["_brush"+l],m.stroke=l instanceof ga?l:"black"):m.stroke="none"===l?null:l;l=parseFloat(bs(a,f,"stroke-width"));isNaN(l)||(m.hb=l);l=bs(a,f,"stroke-linecap");null!==l&&(m.qI=l);l=bs(a,f,"stroke-dasharray");if(null!==l&&""!==
l){n=l.split(",");p=[];for(l=0;l<n.length;l++)q=parseFloat(n[l]),!isNaN(q)&&0<q&&p.push(q);m.gA=p}f=bs(a,f,"stroke-dashoffset");null!==f&&""!==f&&(f=parseFloat(f),isNaN(f)||(m.rI=f));m.rz=!0}if(null!==k){k=k.split(")");f=!0;for(l=0;l<k.length;l++)/\(.*[^0-9\.,\s-]/.test(k[l])&&(f=!1),/\(.*[0-9]-[0-9]/.test(k[l])&&(f=!1);if(f)for(l=k.length-1;0<=l;l--)if(m=k[l],""!==m)switch(n=m.indexOf("("),f=m.substring(0,n).replace(/\s*/,""),n=m.substring(n+1).split(/\s*[\s,]\s*/),f){case "rotate":fs(a,h,n);break;
case "translate":f=h;m=parseFloat(n[0]);isNaN(m)&&(m=0);n=parseFloat(n[1]);isNaN(n)&&(n=0);if(0!==m||0!==n)p=f.position.copy(),isNaN(p.x)&&(p.x=0),isNaN(p.y)&&(p.y=0),f.position=new w(m+p.x,n+p.y);break;case "scale":gs(a,h,n);break;case "skewX":hs(a,h,n);break;case "skewY":is(a,h,n);break;case "matrix":js(a,h,n)}}if(h instanceof A){k=h;l=f=0;m=k.position.copy();isNaN(m.x)&&(m.x=0);isNaN(m.y)&&(m.y=0);for(n=k.elements.i;n.next();)p=n.value.position.copy(),isNaN(p.x)&&(p.x=0),isNaN(p.y)&&(p.y=0),p.x<
f&&(f=p.x),p.y<l&&(l=p.y);m.x+=f;m.y+=l;k.position=m}null===c?a.xn.push(h):c.add(h)}}}if(null!==h){a=ds(b,"visibility");if("hidden"===a||"collapse"===a)h.visible=!1;b=ds(b,"opacity");null!==b&&""!==b&&(b=parseFloat(b),isNaN(b)||(h.opacity=b))}}}
function js(a,b,c){var d=parseFloat(c[0]),e=parseFloat(c[1]),f=parseFloat(c[2]),h=parseFloat(c[3]),k=parseFloat(c[4]),l=parseFloat(c[5]);if(!isNaN(d+e+f+h+k+l)){var m=b.position.copy();isNaN(m.x)&&(m.x=0);isNaN(m.y)&&(m.y=0);if(b instanceof X){c=b.dd.copy();if(c.type===md)c=a.Xr(c);else if(c.type===nd)c=ks(c);else if(c.type===dd){c.type=ad;a=new bd(c.ua,c.va);var n=new Jd(pd,c.F,c.G);a.Fa.add(n);c.ub.add(a)}c.offset(m.x,m.y);c.transform(d,e,f,h,k-m.x,l-m.y);a=c.normalize();b.dd=c;m.x-=a.x;m.y-=a.y;
b.position=m}else if(b instanceof A){for(b=b.elements.i;b.next();)e=b.value,d=e.position.copy(),d.x+=m.x,d.y+=m.y,e.position=d;for(b.reset();b.next();)js(a,b.value,c);for(b.reset();b.next();)a=b.value,d=a.position.copy(),d.x-=m.x,d.y-=m.y,a.position=d}}}
function fs(a,b,c){var d=parseFloat(c[0]);isNaN(d)&&(d=0);var e=parseFloat(c[1]);isNaN(e)&&(e=0);var f=parseFloat(c[2]);isNaN(f)&&(f=0);if(0!==d){var h=d*Math.PI/180,k=b.position.copy();isNaN(k.x)&&(k.x=0);isNaN(k.y)&&(k.y=0);if(b instanceof X){c=b.dd.copy();c.type===nd?c=ks(c):c.type===md&&(c=a.Xr(c));if(c.type===ad)c.rotate(d,e-k.x,f-k.y),f=c.normalize(),b.dd=c,k.x-=f.x,k.y-=f.y,b.position=k;else{var d=c.ua-e+k.x,l=c.va-f+k.y,m=c.F-e+k.x,n=c.G-f+k.y;a=d*Math.cos(h)-l*Math.sin(h)+e-k.x;d=l*Math.cos(h)+
d*Math.sin(h)+f-k.y;e=m*Math.cos(h)-n*Math.sin(h)+e-k.x;f=n*Math.cos(h)+m*Math.sin(h)+f-k.y;m=Math.min(a,e);n=Math.min(d,f);c.ua=a-m;c.va=d-n;c.F=e-m;c.G=f-n;k.x+=m;k.y+=n;b.position=k;b.dd=c}b.fill instanceof ga&&(k=b.fill.copy(),c=Math.atan((.5-k.start.y)/(.5-k.start.x)),isNaN(c)||(c+=h,k.start=new L((1-Math.cos(c))/2,(1-Math.sin(c))/2),k.end=new L((1+Math.cos(c))/2,(1+Math.sin(c))/2)),b.fill=k);b.stroke instanceof ga&&(k=b.stroke.copy(),c=Math.atan((.5-k.start.y)/(.5-k.start.x)),isNaN(c)||(c+=
h,k.start=new L((1-Math.cos(c))/2,(1-Math.sin(c))/2),k.end=new L((1+Math.cos(c))/2,(1+Math.sin(c))/2)),b.stroke=k)}else if(b instanceof A){for(b=b.elements.i;b.next();)f=b.value,h=f.position.copy(),h.x+=k.x,h.y+=k.y,f.position=h;for(b.reset();b.next();)fs(a,b.value,c);for(b.reset();b.next();)c=b.value,h=c.position.copy(),h.x-=k.x,h.y-=k.y,c.position=h}}}
function gs(a,b,c){var d=parseFloat(c[0]);isNaN(d)&&(d=1);var e=parseFloat(c[1]);isNaN(e)&&(e=d);if(1!==d||1!==e){var f=b.position.copy();isNaN(f.x)&&(f.x=0);isNaN(f.y)&&(f.y=0);if(b instanceof X)a=b.dd.copy(),f.x*=d,f.y*=e,b.position=f,a.scale(d,e),b.dd=a;else if(b instanceof A){for(b=b.elements.i;b.next();)e=b.value,d=e.position.copy(),d.x+=f.x,d.y+=f.y,e.position=d;for(b.reset();b.next();)gs(a,b.value,c);for(b.reset();b.next();)a=b.value,d=a.position.copy(),d.x-=f.x,d.y-=f.y,a.position=d}}}
function hs(a,b,c){var d=parseFloat(c[0]);if(!isNaN(d)){var d=d*Math.PI/180,e=b.position.copy();isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);if(b instanceof X){c=b.dd.copy();if(c.type===md)c=a.Xr(c);else if(c.type===nd)c=ks(c);else if(c.type===dd){c.type=ad;a=new bd(c.ua,c.va);var f=new Jd(pd,c.F,c.G);a.Fa.add(f);c.ub.add(a)}c.offset(e.x,e.y);c.transform(1,0,Math.tan(d),1,-e.x,-e.y);a=c.normalize();b.dd=c;e.x-=a.x;e.y-=a.y;b.position=e}else if(b instanceof A){for(b=b.elements.i;b.next();)d=b.value.position.copy(),
d.x+=e.x,d.y+=e.y,b.value.position=d;for(b.reset();b.next();)hs(a,b.value,c);for(b.reset();b.next();)a=b.value,d=a.position.copy(),d.x-=e.x,d.y-=e.y,a.position=d}}}
function is(a,b,c){var d=parseFloat(c[0]);if(!isNaN(d)){var d=d*Math.PI/180,e=b.position.copy();isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);if(b instanceof X){c=b.dd.copy();if(c.type===md)c=a.Xr(c);else if(c.type===nd)c=ks(c);else if(c.type===dd){c.type=ad;a=new bd(c.ua,c.va);var f=new Jd(pd,c.F,c.G);a.Fa.add(f);c.ub.add(a)}c.offset(e.x,e.y);c.transform(1,Math.tan(d),0,1,-e.x,-e.y);a=c.normalize();b.dd=c;e.x-=a.x;e.y-=a.y;b.position=e}else if(b instanceof A){for(b=b.elements.i;b.next();)f=b.value,d=f.position.copy(),
d.x+=e.x,d.y+=e.y,f.position=d;for(b.reset();b.next();)is(a,b.value,c);for(b.reset();b.next();)a=b.value,d=a.position.copy(),d.x-=e.x,d.y-=e.y,a.position=d}}}
function es(a){var b=!1;if("polygon"===a.tagName)b=!0;else if("polyline"!==a.tagName)return null;var c=new X,d=a.getAttribute("points");a=new $c;var e=new E(bd),f=d.split(/\s*[\s,]\s*/);if(4>f.length)return null;for(var d=null,h=new E(Jd),k=1;k<f.length;k+=2){var l=parseFloat(f[k-1]),m=parseFloat(f[k]);if("number"!==typeof l||isNaN(l)||"number"!==typeof m||isNaN(m))return null;1===k?d=new bd(l,m):h.add(new Jd(pd,l,m))}b&&(b=new Jd(pd,d.ua,d.va),b.close(),h.add(b));d.Fa=h;e.add(d);a.ub=e;b=a.normalize();
c.position=new w(-b.x,-b.y);c.dd=a;return c}
function ks(a){var b=a.ua,c=a.va,d=a.F,e=a.G,f=Math.abs(d-b)/2,h=Math.abs(e-c)/2,b=Math.min(b,d)+f,c=Math.min(c,e)+h,e=new bd(b,c-h),d=new Jd(zd);d.Rb=b+K.sa*f;d.jc=c-h;d.df=b+f;d.ef=c-K.sa*h;d.F=b+f;d.G=c;e.Fa.add(d);d=new Jd(zd);d.Rb=b+f;d.jc=c+K.sa*h;d.df=b+K.sa*f;d.ef=c+h;d.F=b;d.G=c+h;e.Fa.add(d);d=new Jd(zd);d.Rb=b-K.sa*f;d.jc=c+h;d.df=b-f;d.ef=c+K.sa*h;d.F=b-f;d.G=c;e.Fa.add(d);d=new Jd(zd);d.Rb=b-f;d.jc=c-K.sa*h;d.df=b-K.sa*f;d.ef=c-h;d.F=b;d.G=c-h;e.Fa.add(d);a.type=ad;a.ub.add(e);return a}
as.prototype.Xr=function(a){var b=a.ua,c=a.va,d=a.F,e=a.G,f=Math.min(b,d),h=Math.min(c,e),b=Math.abs(d-b),c=Math.abs(e-c),e=new bd(f,h);e.Fa.add(new Jd(pd,f+b,h));e.Fa.add(new Jd(pd,f+b,h+c));e.Fa.add((new Jd(pd,f,h+c)).close());a.type=ad;a.ub.add(e);return a};function Vm(){S.call(this);this.Me=null}u.Ga(Vm,S);Vm.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.element=this.Me.cloneNode(!0)};Vm.prototype.toString=function(){return"HTMLHost("+this.Me.toString()+")#"+u.Uc(this)};
Vm.prototype.Mj=function(a,b){var c=this.Me;if(null!==c){var d=this.lb(Ib);d.x-=this.ba.width/2;d.y-=this.ba.height/2;d.x-=this.ba.x;d.y-=this.ba.y;var d=b.VE(d),e=b.Vk;null===e||e.contains(c)||e.appendChild(c);e=this.transform;c.style.transform="matrix("+e.m11+","+e.m12+","+e.m21+","+e.m22+","+e.dx+","+e.dy+")";c.style.transformOrigin="0 0";e=d.y;c.style.left=d.x+"px";c.style.top=e+"px"}};
Vm.prototype.Oo=function(a,b,c,d){var e=this.xa;isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);var e=this.af,f=this.vg;c=Math.max(c,f.width);d=Math.max(d,f.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);c=this.Me;null!==c&&(b=c.getBoundingClientRect(),a=b.width,b=b.height);bb(this.Hc,a,b);ml(this,0,0,a,b)};Vm.prototype.xi=function(a,b,c,d){ql(this,a,b,c,d)};u.u(Vm,{Ha:"naturalBounds"},function(){return this.Hc});
u.defineProperty(Vm,{element:"element"},function(){return this.Me},function(a){var b=this.Me;b!==a&&(a instanceof HTMLElement||u.k("HTMLHost.element must be an instance of HTMLElement."),this.Me=a,a.className="HTMLHost",this.h("element",b,a),this.ma())});da.version="1.5.9";
window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=da:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=da,window.define(da)):window.go=da); })(window);
