text: /*
   * GoJS v1.5.2 JavaScript Library for HTML Canvas 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.2/doc/license.html.
   */
  (function(window) { var f,aa={};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(),g=Math.max(8,16-(c-a)),h=window.setTimeout(function(){b(c+g)},g);a=c+g;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
  function(a){window.clearTimeout(a)})})();var t={Rz:!1,zK:!1,MF:!1,WE:!1,cI:!1,assert:!1,lK:null,pK:function(){},rK:function(){},qK:function(){},oK:function(){},wK:function(){},sK:function(){},uK:function(){},tK:function(){},mK:!1,TK:!1,QK:!1,RK:!1,FI:!1,vK:function(){}},t=null;aa.Debug=null;
  var w={ad:1,Jc:2,Tc:4,Sc:8,Wm:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),uA:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),vA:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),Xm:0<=navigator.platform.toUpperCase().indexOf("MAC"),ZI:null!==navigator.platform.match(/(iPhone|iPod|iPad)/i),rE:function(a,b,c){var d=-1;return function(){var e=this,g=arguments;-1!==d&&
  w.clearTimeout(d);d=w.setTimeout(function(){d=-1;c||a.apply(e,g)},b);c&&!d&&a.apply(e,g)}},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)},m:function(a){t&&t.cI&&window.alert&&window.alert(a);throw Error(a);},N:function(a,b){if(a.Qa){var c="The object is frozen, so its properties cannot be set: "+
  a.toString();void 0!==b&&(c+="  to value: "+b);w.m(c)}},l:function(a,b,c,d){a instanceof b||(c=w.getTypeName(c),void 0!==d&&(c+="."+d),w.sc(a,b,c))},i:function(a,b,c,d){typeof a!==b&&(c=w.getTypeName(c),void 0!==d&&(c+="."+d),w.sc(a,b,c))},p:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=w.getTypeName(b),void 0!==c&&(b+="."+c),w.m(b+" must be a real number type, and not NaN or Infinity: "+a))},za:function(a,b,c,d){a instanceof ba&&a.Ie===b||(c=w.getTypeName(c),void 0!==d&&(c+="."+d),w.sc(a,
  "a constant of class "+w.yg(b),c))},at:function(a,b){"string"===typeof a?da(a)||w.m('Color "'+a+'" is not a valid color string for '+b):a instanceof ea||w.m("Value for "+b+" must be a color string or a Brush, not "+a)},sc:function(a,b,c,d){b=w.getTypeName(b);c=w.getTypeName(c);void 0!==d&&(c+="."+d);"string"===typeof a?w.m(c+" value is not an instance of "+b+': "'+a+'"'):w.m(c+" value is not an instance of "+b+": "+a)},la:function(a,b,c,d){c=w.getTypeName(c);void 0!==d&&(c+="."+d);w.m(c+" is not in the range "+
  b+": "+a)},$c:function(a){w.m(w.yg(a)+" constructor cannot take any arguments.")},Qb:function(a){w.m("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)},Xa:function(a){return"object"===typeof a&&null!==a},isArray:function(a){return Array.isArray(a)||a instanceof NodeList||a instanceof HTMLCollection},
  $I:function(a){return Array.isArray(a)},$s:function(a,b,c){w.isArray(a)||w.sc(a,"Array or NodeList or HTMLCollection",b,c)},vb:function(a){return a.length},il:function(a){return Array.prototype.slice.call(a)},jb:function(a,b){Array.isArray(a);return a[b]},SD:function(a,b,c){Array.isArray(a)?a[b]=c:w.m("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Pz: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},Ii:function(a,
  b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):w.m("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Ji:function(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):w.m("Cannot remove an object from an HTMLCollection or NodeList at "+b)},Ux:[],M:function(){var a=w.Ux.pop();return void 0===a?new x:a},ic:function(a,b){var c=w.Ux.pop();if(void 0===c)return new x(a,b);c.x=a;c.y=b;return c},B:function(a){w.Ux.push(a)},FB:[],Hl:function(){var a=w.FB.pop();return void 0===
  a?new fa:a},dk:function(a){w.FB.push(a)},Vx:[],$f:function(){var a=w.Vx.pop();return void 0===a?new y:a},lk:function(a,b,c,d){var e=w.Vx.pop();if(void 0===e)return new y(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},nc:function(a){w.Vx.push(a)},GB:[],mh:function(){var a=w.GB.pop();return void 0===a?new ga:a},df:function(a){w.GB.push(a)},Wx:null,u:function(){var a=w.Wx;return null!==a?(w.Wx=null,a):new ha},v:function(a){a.reset();w.Wx=a},EB:[],lb:function(){var a=w.EB.pop();return void 0===a?
  []:a},xa:function(a){a.length=0;w.EB.push(a)},nh:Object.freeze([]),HB:1,jc:function(a){a.__gohashid=w.HB++},tt:function(a){var b=a.__gohashid;void 0===b&&(b=w.HB++,a.__gohashid=b);return b},Yc:function(a){return a.__gohashid},g:function(a,b,c){"name"!==b&&"length"!==b&&(a[b]=c)},ja:function(a,b){b.gy=a;aa[a]=b},Ia:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Ph:function(a){a.xH=!0},defineProperty:function(a,b,c,d,e){w.i(a,"function","Util.defineProperty:classfunc");
  w.i(b,"object","Util.defineProperty:propobj");w.i(c,"function","Util.defineProperty:getter");w.i(d,"function","Util.defineProperty:setter");for(var g in b){var h=b[g];b={get:c,set:d};if(void 0!==e)for(var k in e)b[k]=e[k];Object.defineProperty(a.prototype,g,b);e=Object.getOwnPropertyDescriptor(a.prototype,g);h&&e&&Object.defineProperty(a.prototype,h,e);if(t&&h){var l=h.charAt(0).toUpperCase()+h.slice(1);h===l&&w.m('Defining capitalized property "'+l+'"!?');Object.defineProperty(a.prototype,l,{get:function(){w.uA||
  w.vA||w.trace('Getting the property "'+l+'" is probably not what you intended: it is capitalized but should be spelled "'+h+'"')},set:function(){w.m('Setting the property "'+l+'" is probably not what you intended: it is capitalized but should be spelled "'+h+'"')}})}break}},A:function(a,b,c,d){w.i(a,"function","Util.defineReadOnlyProperty:classfunc");w.i(b,"object","Util.defineReadOnlyProperty:propobj");w.i(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var g=b[e];b={get:c,set:function(a){w.m('The property "'+
  g+'" 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);g&&d&&Object.defineProperty(a.prototype,g,d);if(t&&g){var k=g.charAt(0).toUpperCase()+g.slice(1);Object.defineProperty(a.prototype,k,{get:function(){w.uA||w.vA||w.trace('Getting the property "'+k+'" is probably not what you intended: it is capitalized but should be spelled "'+g+'"')},set:function(){w.m('Setting the read-only property "'+
  k+'" is probably not what you intended: it is capitalized but should be spelled "'+g+'", and cannot be set anyway')}})}break}},be:function(a,b){for(var c in b)b[c]=!0;a.prototype.$C=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?w.yg(a):null===a?"*":""},yg:function(a){if("function"===typeof a){if(a.gy)return a.gy;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,c).trim();if(""!==b)return a.gy=b}else if("object"===typeof a&&a.constructor)return w.yg(a.constructor);
  return typeof a},w:function(a,b,c){w.i(a,"function","Util.defineEnumValue:classfunc");w.i(b,"string","Util.defineEnumValue:name");w.i(c,"number","Util.defineEnumValue:num");c=new ba(a,b,c);Object.freeze(c);a[b]=c;var d=a.mu;d instanceof ia||(d=new ia("string",ba),a.mu=d);d.add(b,c);return c},xb: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){t&&w.trace("property get error: "+
  d.toString())}return c},Sa: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){t&&w.trace("property set error: "+d.toString())}},au:function(a,b){w.i(a,"object","Setting properties requires Objects as arguments");w.i(b,"object","Setting properties requires Objects as arguments");var c=t;null===c&&(t=w);var d=a instanceof z,e=a instanceof C,g;for(g in b){""===g&&w.m("Setting properties requires non-empty property names");var h=
  a,k=g;if(d||e){var l=g.indexOf(".");if(0<l){var m=g.substring(0,l);if(d)h=a.qe(m);else if(h=a[m],void 0===h||null===h)h=a.tb[m];w.Xa(h)?k=g.substr(l+1):w.m("Unable to find object named: "+m+" in "+a.toString()+" when trying to set property: "+g)}}if("_"!==k[0]&&!w.Ow(h,k))if(e&&w.Ow(a.tb,k))h=a.tb;else if(e&&la(a,k)){a.Iz(k,b[k]);continue}else w.m('Trying to set undefined property "'+k+'" on object: '+h.toString());h[k]=b[g];"_"===k[0]&&(l=h.Ql,w.isArray(l)||(l=[],h.Ql=l),l.push(k))}t=c},Ow: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.$C;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},YD:function(a,b){if(!w.Xa(b)||b instanceof Element||b instanceof CanvasRenderingContext2D||b instanceof ma||b instanceof na)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=w.xb(b,d);null===e||"function"===
  typeof e||w.Ow(b,d)||(""===c&&(c=b+"\n"),c+='  unknown property "'+d+'" has value: '+e+" at "+a+"\n")}return c},ow:function(a,b){if(null!==b&&"number"!==typeof b&&"string"!==typeof b&&"boolean"!==typeof b&&"function"!==typeof b)if(void 0!==w.Yc(b)){if(!w.Mv.contains(b))if(w.Mv.add(b),w.tv.add(w.YD(a,b)),b instanceof D||b instanceof F||b instanceof ia)for(var c=b.k;c.next();)w.ow(a+"["+c.key+"]",c.value);else for(c in b){var d=w.xb(b,c);if(void 0!==d&&null!==d&&w.Xa(d)&&d!==b.$C){if(b instanceof oa){if(d===
  b.oj)continue}else if(b instanceof z){if("data"===c||d===b.rh)continue;if("itemArray"===c||d===b.oi)continue;if(b instanceof H&&d===b.Tk)continue}else if(!(b instanceof C))if(b instanceof qa){if("archetypeGroupData"===c||d===b.Zx)continue}else if(b instanceof ra){if("archetypeLinkData"===c||d===b.ay)continue;if("archetypeLabelNodeData"===c||d===b.$x)continue}else if(b instanceof sa){if("archetypeNodeData"===c||d===b.Ak)continue}else if(b instanceof I){if("nodeDataArray"===c||d===b.sf)continue;if("linkDataArray"===
  c||d===b.Dh||d===b.fm)continue;if(d===b.zc)continue;if(d===b.vh)continue}else if(b instanceof ta||b instanceof ua||b instanceof va)continue;w.ow(a+"."+c,d)}}}else if(Array.isArray(b))for(c=0;c<b.length;c++)w.ow(a+"["+c+"]",b[c]);else w.tv.add(w.YD(a,b))},check:function(a){void 0===w.Mv?w.Mv=new F(Object):w.Mv.clear();w.tv=new xa;w.ow("",a);a=w.tv.toString();w.tv=null;return a},IJ: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,g="",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,g+=String.fromCharCode(a.charCodeAt(h)^b[(b[c]+b[d])%256]);return g},TI: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},Ha:function(a){return w.IJ(w.TI(a))},Kl:null,iw:"73bb02a6e22402ca408452",fI:"28fb4f",gI:"28fa44"};
  w.Kl=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[w.Ha("7ca11abfd022028846")]=w.Ha("398c3597c01238");for(var c=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22412913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[w.Ha("7ca11abfd7330390")](w.Ha(c[d-1]),10,15*d+0);b[w.Ha("7ca11abfd022028846")]=w.Ha("39f046ebb36e4b");for(d=1;5>d;d++)b[w.Ha("7ca11abfd7330390")](w.Ha(c[d-
  1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])w.w=function(a,b){var c=new ba(a,b,2);Object.freeze(c);a[b]=c;var d=a.mu;d instanceof ia||(d=new ia("string",ba),a.mu=d);d.add(b,c);return c};return a}();function ba(a,b,c){w.jc(this);this.OB=a;this.Xb=b;this.CH=c}ba.prototype.toString=function(){return w.yg(this.OB)+"."+this.Xb};w.A(ba,{Ie:"classType"},function(){return this.OB});w.A(ba,{name:"name"},function(){return this.Xb});w.A(ba,{value:"value"},function(){return this.CH});var ya;
  ba.findName=ya=function(a,b){if(null===b||""===b)return null;w.i(a,"function","findName:classfunc");w.i(b,"string","EnumValue.findName:name");var c=a.mu;return c instanceof ia?c.Aa(b):null};function xa(){this.NB=[]}xa.prototype.toString=function(){return this.NB.join("")};xa.prototype.add=function(a){""!==a&&this.NB.push(a)};function na(){}
  function za(a){void 0===a&&(a=42);this.seed=a;this.Nx=48271;this.lu=2147483647;this.BB=this.lu/this.Nx;this.fH=this.lu%this.Nx;this.bH=1/this.lu;this.random()}za.prototype.random=function(){var a=this.seed%this.BB*this.Nx-this.seed/this.BB*this.fH;this.seed=0<a?a:a+this.lu;return this.seed*this.bH};function Ba(){}w.A(Ba,{k:"iterator"},function(){return this});Ba.prototype.reset=Ba.prototype.reset=function(){};Ba.prototype.next=Ba.prototype.hasNext=Ba.prototype.next=function(){return!1};
  Ba.prototype.first=Ba.prototype.first=function(){return null};Ba.prototype.any=function(){return!1};Ba.prototype.all=function(){return!0};Ba.prototype.each=function(){};w.A(Ba,{count:"count"},function(){return 0});Ba.prototype.dg=function(){};Ba.prototype.toString=function(){return"EmptyIterator"};var Ca=new Ba;function Ea(a){this.key=-1;this.value=a}w.be(Ea,{key:!0,value:!0});w.A(Ea,{k:"iterator"},function(){return this});Ea.prototype.reset=Ea.prototype.reset=function(){this.key=-1};
  Ea.prototype.next=Ea.prototype.hasNext=Ea.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Ea.prototype.first=Ea.prototype.first=function(){this.key=0;return this.value};Ea.prototype.any=function(a){this.key=-1;return a(this.value)};Ea.prototype.all=function(a){this.key=-1;return a(this.value)};Ea.prototype.each=function(a){this.key=-1;a(this.value)};w.A(Ea,{count:"count"},function(){return 1});Ea.prototype.dg=function(){this.value=null};
  Ea.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function Fa(a){this.Dd=a;this.Cj=null;this.reset()}w.be(Fa,{key:!0,value:!0});w.A(Fa,{k:"iterator"},function(){return this});w.g(Fa,"predicate",Fa.prototype.yl);w.defineProperty(Fa,{yl:"predicate"},function(){return this.Cj},function(a){this.Cj=a});Fa.prototype.reset=Fa.prototype.reset=function(){var a=this.Dd;a.Cd=null;this.bb=a.W;this.Ad=-1};
  Fa.prototype.next=Fa.prototype.hasNext=Fa.prototype.next=function(){var a=this.Dd;a.W!==this.bb&&w.Qb(a);var a=a.q,b=a.length,c=++this.Ad,d=this.Cj;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Ad=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.dg()}return!1};
  Fa.prototype.first=Fa.prototype.first=function(){var a=this.Dd;this.bb=a.W;this.Ad=0;var a=a.q,b=a.length,c=this.Cj;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Ad=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};Fa.prototype.any=function(a){var b=this.Dd;b.Cd=null;var c=b.W;this.Ad=-1;for(var d=b.q,e=d.length,g=this.Cj,h=0;h<e;h++){var k=d[h];if(null===g||g(k)){if(a(k))return!0;b.W!==c&&w.Qb(b)}}return!1};
  Fa.prototype.all=function(a){var b=this.Dd;b.Cd=null;var c=b.W;this.Ad=-1;for(var d=b.q,e=d.length,g=this.Cj,h=0;h<e;h++){var k=d[h];if(null===g||g(k)){if(!a(k))return!1;b.W!==c&&w.Qb(b)}}return!0};Fa.prototype.each=function(a){var b=this.Dd;b.Cd=null;var c=b.W;this.Ad=-1;for(var d=b.q,e=d.length,g=this.Cj,h=0;h<e;h++){var k=d[h];if(null===g||g(k))a(k),b.W!==c&&w.Qb(b)}};w.A(Fa,{count:"count"},function(){var a=this.Cj;if(null!==a){for(var b=0,c=this.Dd.q,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.Dd.q.length});
  Fa.prototype.dg=function(){this.key=-1;this.value=null;this.bb=-1;this.Cj=null;this.Dd.Cd=this};Fa.prototype.toString=function(){return"ListIterator@"+this.Ad+"/"+this.Dd.count};function Ga(a){this.Dd=a;this.reset()}w.be(Ga,{key:!0,value:!0});w.A(Ga,{k:"iterator"},function(){return this});Ga.prototype.reset=Ga.prototype.reset=function(){var a=this.Dd;a.eo=null;this.bb=a.W;this.Ad=a.q.length};
  Ga.prototype.next=Ga.prototype.hasNext=Ga.prototype.next=function(){var a=this.Dd;a.W!==this.bb&&w.Qb(a);var b=--this.Ad;if(0<=b)return this.key=b,this.value=a.q[b],!0;this.dg();return!1};Ga.prototype.first=Ga.prototype.first=function(){var a=this.Dd;this.bb=a.W;var b=a.q;this.Ad=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Ga.prototype.any=function(a){var b=this.Dd;b.eo=null;var c=b.W,d=b.q,e=d.length;this.Ad=e;for(e-=1;0<=e;e++){if(a(d[e]))return!0;b.W!==c&&w.Qb(b)}return!1};
  Ga.prototype.all=function(a){var b=this.Dd;b.eo=null;var c=b.W,d=b.q,e=d.length;this.Ad=e;for(e-=1;0<=e;e++){if(!a(d[e]))return!1;b.W!==c&&w.Qb(b)}return!0};Ga.prototype.each=function(a){var b=this.Dd;b.eo=null;var c=b.W,d=b.q,e=d.length;this.Ad=e;for(e-=1;0<=e;e++)a(d[e]),b.W!==c&&w.Qb(b)};w.A(Ga,{count:"count"},function(){return this.Dd.q.length});Ga.prototype.dg=function(){this.key=-1;this.value=null;this.bb=-1;this.Dd.eo=this};
  Ga.prototype.toString=function(){return"ListIteratorBackwards("+this.Ad+"/"+this.Dd.count+")"};
  function D(a){w.jc(this);this.Qa=!1;this.q=[];this.W=0;this.eo=this.Cd=null;void 0===a||null===a?this.ha=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ha=a:w.la(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ha=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:w.la(a,"null, a primitive type name, or a class type",
  "List constructor: type")}w.ja("List",D);D.prototype.Pg=function(a){null!==this.ha&&("string"===typeof this.ha?typeof a===this.ha&&null!==a||w.sc(a,this.ha):a instanceof this.ha||w.sc(a,this.ha))};D.prototype.Vd=function(){var a=this.W;a++;999999999<a&&(a=0);this.W=a};D.prototype.freeze=D.prototype.freeze=function(){this.Qa=!0;return this};D.prototype.thaw=D.prototype.Na=function(){this.Qa=!1;return this};D.prototype.toString=function(){return"List("+w.getTypeName(this.ha)+")#"+w.Yc(this)};
  D.prototype.add=D.prototype.push=D.prototype.add=function(a){null!==a&&(t&&this.Pg(a),w.N(this,a),this.q.push(a),this.Vd())};D.prototype.addAll=D.prototype.Zd=function(a){if(null===a)return this;w.N(this);var b=this.q;if(w.isArray(a))for(var c=w.vb(a),d=0;d<c;d++){var e=w.jb(a,d);t&&this.Pg(e);b.push(e)}else for(a=a.k;a.next();)e=a.value,t&&this.Pg(e),b.push(e);this.Vd();return this};D.prototype.clear=D.prototype.clear=function(){w.N(this);this.q.length=0;this.Vd()};
  D.prototype.contains=D.prototype.has=D.prototype.contains=function(a){if(null===a)return!1;t&&this.Pg(a);return-1!==this.q.indexOf(a)};D.prototype.indexOf=D.prototype.indexOf=function(a){if(null===a)return-1;t&&this.Pg(a);return this.q.indexOf(a)};D.prototype.elt=D.prototype.get=D.prototype.na=function(a){t&&w.p(a,D,"elt:i");var b=this.q;(0>a||a>=b.length)&&w.la(a,"0 <= i < length",D,"elt:i");return b[a]};
  D.prototype.setElt=D.prototype.set=D.prototype.Mg=function(a,b){t&&(this.Pg(b),w.p(a,D,"setElt:i"));var c=this.q;(0>a||a>=c.length)&&w.la(a,"0 <= i < length",D,"setElt:i");w.N(this,a);c[a]=b};D.prototype.first=D.prototype.first=function(){var a=this.q;return 0===a.length?null:a[0]};D.prototype.last=D.prototype.Nd=function(){var a=this.q,b=a.length;return 0<b?a[b-1]:null};D.prototype.pop=D.prototype.pop=function(){w.N(this);var a=this.q;return 0<a.length?a.pop():null};
  D.prototype.any=function(a){for(var b=this.q,c=this.W,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.W!==c&&w.Qb(this)}return!1};D.prototype.all=function(a){for(var b=this.q,c=this.W,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.W!==c&&w.Qb(this)}return!0};D.prototype.each=function(a){for(var b=this.q,c=this.W,d=b.length,e=0;e<d;e++)a(b[e]),this.W!==c&&w.Qb(this)};
  D.prototype.insertAt=D.prototype.ce=function(a,b){t&&(this.Pg(b),w.p(a,D,"insertAt:i"));0>a&&w.la(a,">= 0",D,"insertAt:i");w.N(this,a);var c=this.q;a>=c.length?c.push(b):c.splice(a,0,b);this.Vd();return!0};D.prototype.remove=D.prototype["delete"]=D.prototype.remove=function(a){if(null===a)return!1;t&&this.Pg(a);w.N(this,a);var b=this.q;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Vd();return!0};
  D.prototype.removeAt=D.prototype.md=function(a){t&&w.p(a,D,"removeAt:i");var b=this.q;(0>a||a>=b.length)&&w.la(a,"0 <= i < length",D,"removeAt:i");w.N(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Vd()};
  D.prototype.removeRange=D.prototype.removeRange=function(a,b){t&&(w.p(a,D,"removeRange:from"),w.p(b,D,"removeRange:to"));var c=this.q;(0>a||a>=c.length)&&w.la(a,"0 <= from < length",D,"elt:from");(0>b||b>=c.length)&&w.la(b,"0 <= to < length",D,"elt:to");w.N(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.Vd()};D.prototype.copy=function(){for(var a=new D(this.ha),b=this.q,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};
  D.prototype.toArray=D.prototype.Ue=function(){for(var a=this.q,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};D.prototype.toSet=function(){for(var a=new F(this.ha),b=this.q,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};D.prototype.sort=D.prototype.sort=function(a){t&&w.i(a,"function",D,"sort:sortfunc");w.N(this);this.q.sort(a);this.Vd();return this};
  D.prototype.sortRange=D.prototype.Sp=function(a,b,c){var d=this.q,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);t&&(w.i(a,"function",D,"sortRange:sortfunc"),w.p(b,D,"sortRange:from"),w.p(c,D,"sortRange:to"));w.N(this);var g=c-b;if(1>=g)return this;(0>b||b>=e-1)&&w.la(b,"0 <= from < length",D,"sortRange:from");if(2===g)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.Vd()),this;if(0===b)if(c>=e)d.sort(a);else for(g=d.slice(0,c),g.sort(a),a=0;a<c;a++)d[a]=g[a];else if(c>=e)for(g=d.slice(b),g.sort(a),
  a=b;a<e;a++)d[a]=g[a-b];else for(g=d.slice(b,c),g.sort(a),a=b;a<c;a++)d[a]=g[a-b];this.Vd();return this};D.prototype.reverse=D.prototype.reverse=function(){w.N(this);this.q.reverse();this.Vd();return this};w.A(D,{count:"count"},function(){return this.q.length});w.A(D,{size:"size"},function(){return this.q.length});w.A(D,{length:"length"},function(){return this.q.length});w.A(D,{k:"iterator"},function(){if(0>=this.q.length)return Ca;var a=this.Cd;return null!==a?(a.reset(),a):new Fa(this)});
  w.A(D,{Zm:"iteratorBackwards"},function(){if(0>=this.q.length)return Ca;var a=this.eo;return null!==a?(a.reset(),a):new Ga(this)});function Ia(a){this.Yk=a;this.reset()}w.be(Ia,{key:!0,value:!0});w.A(Ia,{k:"iterator"},function(){return this});Ia.prototype.reset=Ia.prototype.reset=function(){var a=this.Yk;a.Cd=null;this.bb=a.W;this.Gb=null};
  Ia.prototype.next=Ia.prototype.hasNext=Ia.prototype.next=function(){var a=this.Yk;a.W!==this.bb&&w.Qb(a);var b=this.Gb,b=null===b?a.gb:b.Vb;if(null!==b)return this.Gb=b,this.value=b.value,this.key=b.key,!0;this.dg();return!1};Ia.prototype.first=Ia.prototype.first=function(){var a=this.Yk;this.bb=a.W;a=a.gb;if(null!==a){this.Gb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
  Ia.prototype.any=function(a){var b=this.Yk;b.Cd=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(a(d.value))return!0;b.W!==c&&w.Qb(b);d=d.Vb}return!1};Ia.prototype.all=function(a){var b=this.Yk;b.Cd=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(!a(d.value))return!1;b.W!==c&&w.Qb(b);d=d.Vb}return!0};Ia.prototype.each=function(a){var b=this.Yk;b.Cd=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;)a(d.value),b.W!==c&&w.Qb(b),d=d.Vb};w.A(Ia,{count:"count"},function(){return this.Yk.cd});
  Ia.prototype.dg=function(){this.value=this.key=null;this.bb=-1;this.Yk.Cd=this};Ia.prototype.toString=function(){return null!==this.Gb?"SetIterator@"+this.Gb.value:"SetIterator"};
  function F(a){w.jc(this);this.Qa=!1;void 0===a||null===a?this.ha=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ha=a:w.la(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ha=a===Object?"object":a===String?"string":a===Number?"number":a:w.la(a,"null, a primitive type name, or a class type","Set constructor: type");this.dd={};this.cd=0;this.Cd=null;this.W=0;this.Ch=this.gb=null}w.ja("Set",F);
  F.prototype.Pg=function(a){null!==this.ha&&("string"===typeof this.ha?typeof a===this.ha&&null!==a||w.sc(a,this.ha):a instanceof this.ha||w.sc(a,this.ha))};F.prototype.Vd=function(){var a=this.W;a++;999999999<a&&(a=0);this.W=a};F.prototype.freeze=F.prototype.freeze=function(){this.Qa=!0;return this};F.prototype.thaw=F.prototype.Na=function(){this.Qa=!1;return this};F.prototype.toString=function(){return"Set("+w.getTypeName(this.ha)+")#"+w.Yc(this)};
  F.prototype.add=F.prototype.add=function(a){if(null===a)return!1;t&&this.Pg(a);w.N(this,a);var b=a;w.Xa(a)&&(b=w.tt(a));return void 0===this.dd[b]?(this.cd++,a=new La(a,a),this.dd[b]=a,b=this.Ch,null===b?this.gb=a:(a.oo=b,b.Vb=a),this.Ch=a,this.Vd(),!0):!1};F.prototype.addAll=F.prototype.Zd=function(a){if(null===a)return this;w.N(this);if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++)this.add(w.jb(a,c));else for(a=a.k;a.next();)this.add(a.value);return this};
  F.prototype.contains=F.prototype.has=F.prototype.contains=function(a){if(null===a)return!1;t&&this.Pg(a);var b=a;return w.Xa(a)&&(b=w.Yc(a),void 0===b)?!1:void 0!==this.dd[b]};F.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.k;a.next();)if(!this.contains(a.value))return!1;return!0};F.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.k;a.next();)if(this.contains(a.value))return!0;return!1};
  F.prototype.first=F.prototype.first=function(){var a=this.gb;return null===a?null:a.value};F.prototype.any=function(a){for(var b=this.W,c=this.gb;null!==c;){if(a(c.value))return!0;this.W!==b&&w.Qb(this);c=c.Vb}return!1};F.prototype.all=function(a){for(var b=this.W,c=this.gb;null!==c;){if(!a(c.value))return!1;this.W!==b&&w.Qb(this);c=c.Vb}return!0};F.prototype.each=function(a){for(var b=this.W,c=this.gb;null!==c;)a(c.value),this.W!==b&&w.Qb(this),c=c.Vb};
  F.prototype.remove=F.prototype["delete"]=F.prototype.remove=function(a){if(null===a)return!1;t&&this.Pg(a);w.N(this,a);var b=a;if(w.Xa(a)&&(b=w.Yc(a),void 0===b))return!1;a=this.dd[b];if(void 0===a)return!1;var c=a.Vb,d=a.oo;null!==c&&(c.oo=d);null!==d&&(d.Vb=c);this.gb===a&&(this.gb=c);this.Ch===a&&(this.Ch=d);delete this.dd[b];this.cd--;this.Vd();return!0};
  F.prototype.removeAll=F.prototype.VF=function(a){if(null===a)return this;w.N(this);if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++)this.remove(w.jb(a,c));else for(a=a.k;a.next();)this.remove(a.value);return this};F.prototype.retainAll=function(a){if(null===a||0===this.count)return this;w.N(this);var b=new F(this.ha);b.Zd(a);a=new D(this.ha);for(var c=this.k;c.next();)b.contains(c.value)||a.add(c.value);for(b=a.k;b.next();)this.remove(b.value);return this};
  F.prototype.clear=F.prototype.clear=function(){w.N(this);this.dd={};this.cd=0;this.Ch=this.gb=null;this.Vd()};F.prototype.copy=function(){var a=new F(this.ha),b=this.dd,c;for(c in b)a.add(b[c].value);return a};F.prototype.toArray=F.prototype.Ue=function(){var a=Array(this.cd),b=this.dd,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.toList=function(){var a=new D(this.ha),b=this.dd,c;for(c in b)a.add(b[c].value);return a};w.A(F,{count:"count"},function(){return this.cd});
  w.A(F,{size:"size"},function(){return this.cd});w.A(F,{k:"iterator"},function(){if(0>=this.cd)return Ca;var a=this.Cd;return null!==a?(a.reset(),a):new Ia(this)});function Na(a){this.ab=a;this.reset()}w.be(Na,{key:!0,value:!0});w.A(Na,{k:"iterator"},function(){return this});Na.prototype.reset=Na.prototype.reset=function(){this.bb=this.ab.W;this.Gb=null};
  Na.prototype.next=Na.prototype.hasNext=Na.prototype.next=function(){var a=this.ab;a.W!==this.bb&&w.Qb(a);var b=this.Gb,b=null===b?a.gb:b.Vb;if(null!==b)return this.Gb=b,this.value=this.key=a=b.key,!0;this.dg();return!1};Na.prototype.first=Na.prototype.first=function(){var a=this.ab;this.bb=a.W;a=a.gb;return null!==a?(this.Gb=a,this.value=this.key=a=a.key):null};Na.prototype.any=function(a){var b=this.ab,c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(a(d.key))return!0;b.W!==c&&w.Qb(b);d=d.Vb}return!1};
  Na.prototype.all=function(a){var b=this.ab,c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(!a(d.key))return!1;b.W!==c&&w.Qb(b);d=d.Vb}return!0};Na.prototype.each=function(a){var b=this.ab,c=b.W;this.Gb=null;for(var d=b.gb;null!==d;)a(d.key),b.W!==c&&w.Qb(b),d=d.Vb};w.A(Na,{count:"count"},function(){return this.ab.cd});Na.prototype.dg=function(){this.value=this.key=null;this.bb=-1};Na.prototype.toString=function(){return null!==this.Gb?"MapKeySetIterator@"+this.Gb.value:"MapKeySetIterator"};
  function Oa(a){w.jc(this);this.Qa=!0;this.ab=a}w.Ia(Oa,F);Oa.prototype.freeze=function(){return this};Oa.prototype.Na=function(){return this};Oa.prototype.toString=function(){return"MapKeySet("+this.ab.toString()+")"};Oa.prototype.add=Oa.prototype.set=Oa.prototype.add=function(){w.m("This Set is read-only: "+this.toString());return!1};Oa.prototype.contains=Oa.prototype.has=Oa.prototype.contains=function(a){return this.ab.contains(a)};
  Oa.prototype.remove=Oa.prototype["delete"]=Oa.prototype.remove=function(){w.m("This Set is read-only: "+this.toString());return!1};Oa.prototype.clear=Oa.prototype.clear=function(){w.m("This Set is read-only: "+this.toString())};Oa.prototype.first=Oa.prototype.first=function(){var a=this.ab.gb;return null!==a?a.key:null};Oa.prototype.any=function(a){for(var b=this.ab.gb;null!==b;){if(a(b.key))return!0;b=b.Vb}return!1};
  Oa.prototype.all=function(a){for(var b=this.ab.gb;null!==b;){if(!a(b.key))return!1;b=b.Vb}return!0};Oa.prototype.each=function(a){for(var b=this.ab.gb;null!==b;)a(b.key),b=b.Vb};Oa.prototype.copy=function(){return new Oa(this.ab)};Oa.prototype.toSet=function(){var a=new F(this.ab.Bh),b=this.ab.dd,c;for(c in b)a.add(b[c].key);return a};Oa.prototype.toArray=Oa.prototype.Ue=function(){var a=this.ab.dd,b=Array(this.ab.cd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};
  Oa.prototype.toList=function(){var a=new D(this.ha),b=this.ab.dd,c;for(c in b)a.add(b[c].key);return a};w.A(Oa,{count:"count"},function(){return this.ab.cd});w.A(Oa,{size:"size"},function(){return this.ab.cd});w.A(Oa,{k:"iterator"},function(){return 0>=this.ab.cd?Ca:new Na(this.ab)});function Ra(a){this.ab=a;this.reset()}w.be(Ra,{key:!0,value:!0});w.A(Ra,{k:"iterator"},function(){return this});Ra.prototype.reset=Ra.prototype.reset=function(){var a=this.ab;a.fo=null;this.bb=a.W;this.Gb=null};
  Ra.prototype.next=Ra.prototype.hasNext=Ra.prototype.next=function(){var a=this.ab;a.W!==this.bb&&w.Qb(a);var b=this.Gb,b=null===b?a.gb:b.Vb;if(null!==b)return this.Gb=b,this.value=b.value,this.key=b.key,!0;this.dg();return!1};Ra.prototype.first=Ra.prototype.first=function(){var a=this.ab;this.bb=a.W;a=a.gb;if(null!==a){this.Gb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
  Ra.prototype.any=function(a){var b=this.ab;b.fo=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(a(d.value))return!0;b.W!==c&&w.Qb(b);d=d.Vb}return!1};Ra.prototype.all=function(a){var b=this.ab;b.fo=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(!a(d.value))return!1;b.W!==c&&w.Qb(b);d=d.Vb}return!0};Ra.prototype.each=function(a){var b=this.ab;b.fo=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;)a(d.value),b.W!==c&&w.Qb(b),d=d.Vb};w.A(Ra,{count:"count"},function(){return this.ab.cd});
  Ra.prototype.dg=function(){this.value=this.key=null;this.bb=-1;this.ab.fo=this};Ra.prototype.toString=function(){return null!==this.Gb?"MapValueSetIterator@"+this.Gb.value:"MapValueSetIterator"};function La(a,b){this.key=a;this.value=b;this.oo=this.Vb=null}w.be(La,{key:!0,value:!0});La.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};function Sa(a){this.ab=a;this.reset()}w.be(Sa,{key:!0,value:!0});w.A(Sa,{k:"iterator"},function(){return this});
  Sa.prototype.reset=Sa.prototype.reset=function(){var a=this.ab;a.Cd=null;this.bb=a.W;this.Gb=null};Sa.prototype.next=Sa.prototype.hasNext=Sa.prototype.next=function(){var a=this.ab;a.W!==this.bb&&w.Qb(a);var b=this.Gb,b=null===b?a.gb:b.Vb;if(null!==b)return this.Gb=b,this.key=b.key,this.value=b.value,!0;this.dg();return!1};Sa.prototype.first=Sa.prototype.first=function(){var a=this.ab;this.bb=a.W;a=a.gb;return null!==a?(this.Gb=a,this.key=a.key,this.value=a.value,a):null};
  Sa.prototype.any=function(a){var b=this.ab;b.Cd=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(a(d))return!0;b.W!==c&&w.Qb(b);d=d.Vb}return!1};Sa.prototype.all=function(a){var b=this.ab;b.Cd=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;){if(!a(d))return!1;b.W!==c&&w.Qb(b);d=d.Vb}return!0};Sa.prototype.each=function(a){var b=this.ab;b.Cd=null;var c=b.W;this.Gb=null;for(var d=b.gb;null!==d;)a(d),b.W!==c&&w.Qb(b),d=d.Vb};w.A(Sa,{count:"count"},function(){return this.ab.cd});
  Sa.prototype.dg=function(){this.value=this.key=null;this.bb=-1;this.ab.Cd=this};Sa.prototype.toString=function(){return null!==this.Gb?"MapIterator@"+this.Gb:"MapIterator"};
  function ia(a,b){w.jc(this);this.Qa=!1;void 0===a||null===a?this.Bh=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.Bh=a:w.la(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.Bh=a===Object?"object":a===String?"string":a===Number?"number":a:w.la(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.Ei=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
  b||"function"===b?this.Ei=b:w.la(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.Ei=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:w.la(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.dd={};this.cd=0;this.fo=this.Cd=null;this.W=0;this.Ch=this.gb=null}w.ja("Map",ia);
  function Ta(a,b){null!==a.Bh&&("string"===typeof a.Bh?typeof b===a.Bh&&null!==b||w.sc(b,a.Bh):b instanceof a.Bh||w.sc(b,a.Bh))}ia.prototype.Vd=function(){var a=this.W;a++;999999999<a&&(a=0);this.W=a};ia.prototype.freeze=ia.prototype.freeze=function(){this.Qa=!0;return this};ia.prototype.thaw=ia.prototype.Na=function(){this.Qa=!1;return this};ia.prototype.toString=function(){return"Map("+w.getTypeName(this.Bh)+","+w.getTypeName(this.Ei)+")#"+w.Yc(this)};
  ia.prototype.add=ia.prototype.set=ia.prototype.add=function(a,b){t&&(Ta(this,a),null!==this.Ei&&("string"===typeof this.Ei?typeof b===this.Ei&&null!==b||w.sc(b,this.Ei):b instanceof this.Ei||w.sc(b,this.Ei)));w.N(this,a);var c=a;w.Xa(a)&&(c=w.tt(a));var d=this.dd[c];if(void 0===d)return this.cd++,d=new La(a,b),this.dd[c]=d,c=this.Ch,null===c?this.gb=d:(d.oo=c,c.Vb=d),this.Ch=d,this.Vd(),!0;d.value=b;return!1};
  ia.prototype.addAll=ia.prototype.Zd=function(a){if(null===a)return this;if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++){var d=w.jb(a,c);this.add(d.key,d.value)}else for(t&&w.l(a,ia,ia,"addAll:map"),a=a.k;a.next();)this.add(a.key,a.value);return this};ia.prototype.first=ia.prototype.first=function(){return this.gb};ia.prototype.any=function(a){for(var b=this.W,c=this.gb;null!==c;){if(a(c))return!0;this.W!==b&&w.Qb(this);c=c.Vb}return!1};
  ia.prototype.all=function(a){for(var b=this.W,c=this.gb;null!==c;){if(!a(c))return!1;this.W!==b&&w.Qb(this);c=c.Vb}return!0};ia.prototype.each=function(a){for(var b=this.W,c=this.gb;null!==c;)a(c),this.W!==b&&w.Qb(this),c=c.Vb};ia.prototype.contains=ia.prototype.has=ia.prototype.contains=function(a){t&&Ta(this,a);var b=a;return w.Xa(a)&&(b=w.Yc(a),void 0===b)?!1:void 0!==this.dd[b]};
  ia.prototype.getValue=ia.prototype.get=ia.prototype.Aa=function(a){t&&Ta(this,a);var b=a;if(w.Xa(a)&&(b=w.Yc(a),void 0===b))return null;a=this.dd[b];return void 0===a?null:a.value};
  ia.prototype.remove=ia.prototype["delete"]=ia.prototype.remove=function(a){if(null===a)return!1;t&&Ta(this,a);w.N(this,a);var b=a;if(w.Xa(a)&&(b=w.Yc(a),void 0===b))return!1;a=this.dd[b];if(void 0===a)return!1;var c=a.Vb,d=a.oo;null!==c&&(c.oo=d);null!==d&&(d.Vb=c);this.gb===a&&(this.gb=c);this.Ch===a&&(this.Ch=d);delete this.dd[b];this.cd--;this.Vd();return!0};ia.prototype.clear=ia.prototype.clear=function(){w.N(this);this.dd={};this.cd=0;this.Ch=this.gb=null;this.Vd()};
  ia.prototype.copy=function(){var a=new ia(this.Bh,this.Ei),b=this.dd,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ia.prototype.toArray=ia.prototype.Ue=function(){var a=this.dd,b=Array(this.cd),c=0,d;for(d in a){var e=a[d];b[c]=new La(e.key,e.value);c++}return b};ia.prototype.toKeySet=ia.prototype.Yi=function(){return new Oa(this)};w.A(ia,{count:"count"},function(){return this.cd});w.A(ia,{size:"size"},function(){return this.cd});
  w.A(ia,{k:"iterator"},function(){if(0>=this.count)return Ca;var a=this.Cd;return null!==a?(a.reset(),a):new Sa(this)});w.A(ia,{EK:"iteratorKeys"},function(){return 0>=this.count?Ca:new Na(this)});w.A(ia,{qF:"iteratorValues"},function(){if(0>=this.count)return Ca;var a=this.fo;return null!==a?(a.reset(),a):new Ra(this)});function x(a,b){void 0===a||void 0===b?this.y=this.x=0:!t||"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):w.m("Invalid arguments to Point constructor");this.Qa=!1}
  w.ja("Point",x);w.Ph(x);w.be(x,{x:!0,y:!0});x.prototype.assign=function(a){this.x=a.x;this.y=a.y};x.prototype.setTo=x.prototype.o=function(a,b){t&&(w.i(a,"number",x,"setTo:x"),w.i(b,"number",x,"setTo:y"));this.x=a;this.y=b;return this};x.prototype.set=x.prototype.set=function(a){t&&w.l(a,x,x,"set:p");w.N(this);this.x=a.x;this.y=a.y;return this};x.prototype.copy=function(){var a=new x;a.x=this.x;a.y=this.y;return a};x.prototype.Ma=function(){this.Qa=!0;Object.freeze(this);return this};
  x.prototype.ba=function(){return Object.isFrozen(this)?this:this.copy().freeze()};x.prototype.freeze=function(){this.Qa=!0;return this};x.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;return this};x.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 x(c,e)}return new x};
  x.stringify=function(a){return a instanceof x?a.x.toString()+" "+a.y.toString():a.toString()};x.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};x.prototype.equals=x.prototype.L=function(a){return a instanceof x?this.x===a.x&&this.y===a.y:!1};x.prototype.equalTo=x.prototype.Fw=function(a,b){return this.x===a&&this.y===b};x.prototype.equalsApprox=x.prototype.Ne=function(a){return J.I(this.x,a.x)&&J.I(this.y,a.y)};
  x.prototype.add=x.prototype.add=function(a){t&&w.l(a,x,x,"add:p");w.N(this);this.x+=a.x;this.y+=a.y;return this};x.prototype.subtract=x.prototype.eu=function(a){t&&w.l(a,x,x,"subtract:p");w.N(this);this.x-=a.x;this.y-=a.y;return this};x.prototype.offset=x.prototype.offset=function(a,b){t&&(w.p(a,x,"offset:dx"),w.p(b,x,"offset:dy"));w.N(this);this.x+=a;this.y+=b;return this};
  x.prototype.rotate=x.prototype.rotate=function(a){t&&w.p(a,x,"rotate:angle");w.N(this);if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;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};x.prototype.scale=x.prototype.scale=function(a,b){t&&(w.p(a,x,"scale:sx"),w.p(b,x,"scale:sy"));this.x*=a;this.y*=b;return this};
  x.prototype.distanceSquaredPoint=x.prototype.Zj=function(a){t&&w.l(a,x,x,"distanceSquaredPoint:p");var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};x.prototype.distanceSquared=x.prototype.jt=function(a,b){t&&(w.p(a,x,"distanceSquared:px"),w.p(b,x,"distanceSquared:py"));var c=a-this.x,d=b-this.y;return c*c+d*d};x.prototype.normalize=x.prototype.normalize=function(){w.N(this);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};
  x.prototype.directionPoint=x.prototype.Pi=function(a){t&&w.l(a,x,x,"directionPoint:p");return Ua(a.x-this.x,a.y-this.y)};x.prototype.direction=x.prototype.direction=function(a,b){t&&(w.p(a,x,"direction:px"),w.p(b,x,"direction:py"));return Ua(a-this.x,b-this.y)};function Ua(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}
  x.prototype.projectOntoLineSegment=function(a,b,c,d){t&&(w.p(a,x,"projectOntoLineSegment:px"),w.p(b,x,"projectOntoLineSegment:py"),w.p(c,x,"projectOntoLineSegment:qx"),w.p(d,x,"projectOntoLineSegment:qy"));J.cn(a,b,c,d,this.x,this.y,this);return this};x.prototype.projectOntoLineSegmentPoint=function(a,b){t&&(w.l(a,x,x,"projectOntoLineSegmentPoint:p"),w.l(b,x,x,"projectOntoLineSegmentPoint:q"));J.cn(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};
  x.prototype.snapToGrid=function(a,b,c,d){t&&(w.p(a,x,"snapToGrid:originx"),w.p(b,x,"snapToGrid:originy"),w.p(c,x,"snapToGrid:cellwidth"),w.p(d,x,"snapToGrid:cellheight"));J.nt(this.x,this.y,a,b,c,d,this);return this};x.prototype.snapToGridPoint=function(a,b){t&&(w.l(a,x,x,"snapToGridPoint:p"),w.l(b,fa,x,"snapToGridPoint:q"));J.nt(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};
  x.prototype.setRectSpot=x.prototype.bu=function(a,b){t&&(w.l(a,y,x,"setRectSpot:r"),w.l(b,K,x,"setRectSpot:spot"));w.N(this);this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};
  x.prototype.setSpot=x.prototype.cu=function(a,b,c,d,e){t&&(w.p(a,x,"setSpot:x"),w.p(b,x,"setSpot:y"),w.p(c,x,"setSpot:w"),w.p(d,x,"setSpot:h"),(0>c||0>d)&&w.m("Point.setSpot:Width and height cannot be negative"),w.l(e,K,x,"setSpot:spot"));w.N(this);this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};x.prototype.transform=function(a){t&&w.l(a,ga,x,"transform:t");a.fb(this);return this};function Xa(a,b){t&&w.l(b,ga,x,"transformInverted:t");b.Th(a);return a}var Ya;
  x.distanceLineSegmentSquared=Ya=function(a,b,c,d,e,g){t&&(w.p(a,x,"distanceLineSegmentSquared:px"),w.p(b,x,"distanceLineSegmentSquared:py"),w.p(c,x,"distanceLineSegmentSquared:ax"),w.p(d,x,"distanceLineSegmentSquared:ay"),w.p(e,x,"distanceLineSegmentSquared:bx"),w.p(g,x,"distanceLineSegmentSquared:by"));var h=e-c,k=g-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=g-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var $a;
  x.distanceSquared=$a=function(a,b,c,d){t&&(w.p(a,x,"distanceSquared:px"),w.p(b,x,"distanceSquared:py"),w.p(c,x,"distanceSquared:qx"),w.p(d,x,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b};var ab;
  x.direction=ab=function(a,b,c,d){t&&(w.p(a,x,"direction:px"),w.p(b,x,"direction:py"),w.p(c,x,"direction:qx"),w.p(d,x,"direction:qy"));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};x.prototype.isReal=x.prototype.J=function(){return isFinite(this.x)&&isFinite(this.y)};
  function fa(a,b){void 0===a||void 0===b?this.height=this.width=0:!t||"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):w.m("Invalid arguments to Size constructor");this.Qa=!1}w.ja("Size",fa);w.Ph(fa);w.be(fa,{width:!0,height:!0});fa.prototype.assign=function(a){this.width=a.width;this.height=a.height};
  fa.prototype.setTo=fa.prototype.o=function(a,b){t&&(w.i(a,"number",fa,"setTo:w"),w.i(b,"number",fa,"setTo:h"),0>a&&w.la(a,">= 0",fa,"setTo:w"),0>b&&w.la(b,">= 0",fa,"setTo:h"));this.width=a;this.height=b;return this};fa.prototype.set=fa.prototype.set=function(a){t&&w.l(a,fa,fa,"set:s");w.N(this);this.width=a.width;this.height=a.height;return this};fa.prototype.copy=function(){var a=new fa;a.width=this.width;a.height=this.height;return a};fa.prototype.Ma=function(){this.Qa=!0;Object.freeze(this);return this};
  fa.prototype.ba=function(){return Object.isFrozen(this)?this:this.copy().freeze()};fa.prototype.freeze=function(){this.Qa=!0;return this};fa.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;return this};fa.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 fa(c,e)}return new fa};
  fa.stringify=function(a){return a instanceof fa?a.width.toString()+" "+a.height.toString():a.toString()};fa.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};fa.prototype.equals=fa.prototype.L=function(a){return a instanceof fa?this.width===a.width&&this.height===a.height:!1};fa.prototype.equalTo=fa.prototype.Fw=function(a,b){return this.width===a&&this.height===b};fa.prototype.equalsApprox=fa.prototype.Ne=function(a){return J.I(this.width,a.width)&&J.I(this.height,a.height)};
  fa.prototype.isReal=fa.prototype.J=function(){return isFinite(this.width)&&isFinite(this.height)};
  function y(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof x?b instanceof x?(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 fa?(this.x=a.x,this.y=a.y,this.width=b.width,this.height=b.height):w.m("Incorrect arguments supplied"):!t||"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c,this.height=d):w.m("Invalid arguments to Rect constructor");
  this.Qa=!1}w.ja("Rect",y);w.Ph(y);w.be(y,{x:!0,y:!0,width:!0,height:!0});y.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}y.prototype.setTo=y.prototype.o=function(a,b,c,d){t&&(w.i(a,"number",y,"setTo:x"),w.i(b,"number",y,"setTo:y"),w.i(c,"number",y,"setTo:w"),w.i(d,"number",y,"setTo:h"),0>c&&w.la(c,">= 0",y,"setTo:w"),0>d&&w.la(d,">= 0",y,"setTo:h"));this.x=a;this.y=b;this.width=c;this.height=d;return this};
  y.prototype.set=y.prototype.set=function(a){t&&w.l(a,y,y,"set:r");w.N(this);this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};y.prototype.setPoint=y.prototype.Ff=function(a){t&&w.l(a,x,y,"setPoint:p");w.N(this);this.x=a.x;this.y=a.y;return this};y.prototype.setSize=function(a){t&&w.l(a,fa,y,"setSize:s");w.N(this);this.width=a.width;this.height=a.height;return this};y.prototype.copy=function(){var a=new y;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};
  y.prototype.Ma=function(){this.Qa=!0;Object.freeze(this);return this};y.prototype.ba=function(){return Object.isFrozen(this)?this:this.copy().freeze()};y.prototype.freeze=function(){this.Qa=!0;return this};y.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;return this};
  y.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 g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new y(c,e,g,h)}return new y};y.stringify=function(a){return a instanceof y?a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString():a.toString()};
  y.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};y.prototype.equals=y.prototype.L=function(a){return a instanceof y?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};y.prototype.equalTo=y.prototype.Fw=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};y.prototype.equalsApprox=y.prototype.Ne=function(a){return J.I(this.x,a.x)&&J.I(this.y,a.y)&&J.I(this.width,a.width)&&J.I(this.height,a.height)};
  y.prototype.containsPoint=y.prototype.Ea=function(a){t&&w.l(a,x,y,"containsPoint:p");return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};y.prototype.containsRect=y.prototype.Vj=function(a){t&&w.l(a,y,y,"containsRect:r");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};
  y.prototype.contains=y.prototype.contains=function(a,b,c,d){t?(w.p(a,y,"contains:x"),w.p(b,y,"contains:y"),void 0===c?c=0:w.p(c,y,"contains:w"),void 0===d?d=0:w.p(d,y,"contains:h"),(0>c||0>d)&&w.m("Rect.contains:Width and height cannot be negative")):(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};y.prototype.reset=function(){w.N(this);this.height=this.width=this.y=this.x=0};
  y.prototype.offset=y.prototype.offset=function(a,b){t&&(w.p(a,y,"offset:dx"),w.p(b,y,"offset:dy"));w.N(this);this.x+=a;this.y+=b;return this};y.prototype.inflate=y.prototype.Sf=function(a,b){t&&(w.p(a,y,"inflate:w"),w.p(b,y,"inflate:h"));return cb(this,b,a,b,a)};y.prototype.addMargin=y.prototype.gw=function(a){t&&w.l(a,eb,y,"addMargin:m");return cb(this,a.top,a.right,a.bottom,a.left)};
  y.prototype.subtractMargin=y.prototype.aK=function(a){t&&w.l(a,eb,y,"subtractMargin:m");return cb(this,-a.top,-a.right,-a.bottom,-a.left)};y.prototype.grow=function(a,b,c,d){t&&(w.p(a,y,"grow:t"),w.p(b,y,"grow:r"),w.p(c,y,"grow:b"),w.p(d,y,"grow:l"));return cb(this,a,b,c,d)};function cb(a,b,c,d,e){w.N(a);var g=a.width;c+e<=-g?(a.x+=g/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}
  y.prototype.intersectRect=function(a){t&&w.l(a,y,y,"intersectRect:r");return hb(this,a.x,a.y,a.width,a.height)};y.prototype.intersect=function(a,b,c,d){t&&(w.p(a,y,"intersect:x"),w.p(b,y,"intersect:y"),w.p(c,y,"intersect:w"),w.p(d,y,"intersect:h"),(0>c||0>d)&&w.m("Rect.intersect:Width and height cannot be negative"));return hb(this,a,b,c,d)};
  function hb(a,b,c,d,e){w.N(a);var g=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=g;a.y=h;a.width=Math.max(0,b-g);a.height=Math.max(0,c-h);return a}y.prototype.intersectsRect=y.prototype.zg=function(a){t&&w.l(a,y,y,"intersectsRect:r");return this.fF(a.x,a.y,a.width,a.height)};
  y.prototype.intersects=y.prototype.fF=function(a,b,c,d){t&&(w.p(a,y,"intersects:x"),w.p(b,y,"intersects:y"),w.p(a,y,"intersects:w"),w.p(b,y,"intersects:h"),(0>c||0>d)&&w.m("Rect.intersects:Width and height cannot be negative"));var e=this.width,g=this.x;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>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 ib(a,b){var c=a.width,d=b.width+10+10,e=a.x,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;g=b.y-10;return e>d+g||g>c+e?!1:!0}y.prototype.unionPoint=y.prototype.Zi=function(a){t&&w.l(a,x,y,"unionPoint:p");return nb(this,a.x,a.y,0,0)};y.prototype.unionRect=y.prototype.$h=function(a){t&&w.l(a,y,y,"unionRect:r");return nb(this,a.x,a.y,a.width,a.height)};
  y.prototype.union=y.prototype.WG=function(a,b,c,d){w.N(this);t?(w.p(a,y,"union:x"),w.p(b,y,"union:y"),void 0===c?c=0:w.p(c,y,"union:w"),void 0===d?d=0:w.p(d,y,"union:h"),(0>c||0>d)&&w.m("Rect.union:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return nb(this,a,b,c,d)};function nb(a,b,c,d,e){var g=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=g;a.y=h;a.width=b-g;a.height=c-h;return a}
  y.prototype.setSpot=y.prototype.cu=function(a,b,c){t&&(w.p(a,y,"setSpot:x"),w.p(b,y,"setSpot:y"),w.l(c,K,y,"setSpot:spot"));w.N(this);this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};var ob;
  y.contains=ob=function(a,b,c,d,e,g,h,k){t?(w.p(a,y,"contains:rx"),w.p(b,y,"contains:ry"),w.p(c,y,"contains:rw"),w.p(d,y,"contains:rh"),w.p(e,y,"contains:x"),w.p(g,y,"contains:y"),void 0===h?h=0:w.p(h,y,"contains:w"),void 0===k?k=0:w.p(k,y,"contains:h"),(0>c||0>d||0>h||0>k)&&w.m("Rect.contains:Width and height cannot be negative")):(void 0===h&&(h=0),void 0===k&&(k=0));return a<=e&&e+h<=a+c&&b<=g&&g+k<=b+d};
  y.intersects=function(a,b,c,d,e,g,h,k){t&&(w.p(a,y,"intersects:rx"),w.p(b,y,"intersects:ry"),w.p(c,y,"intersects:rw"),w.p(d,y,"intersects:rh"),w.p(e,y,"intersects:x"),w.p(g,y,"intersects:y"),w.p(h,y,"intersects:w"),w.p(k,y,"intersects:h"),(0>c||0>d||0>h||0>k)&&w.m("Rect.intersects:Width and height cannot be negative"));c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=g;return b>k||g>a?!1:!0};w.g(y,"left",y.prototype.left);
  w.defineProperty(y,{left:"left"},function(){return this.x},function(a){w.N(this,a);t&&w.i(a,"number",y,"left");this.x=a});w.g(y,"top",y.prototype.top);w.defineProperty(y,{top:"top"},function(){return this.y},function(a){w.N(this,a);t&&w.i(a,"number",y,"top");this.y=a});w.g(y,"right",y.prototype.right);w.defineProperty(y,{right:"right"},function(){return this.x+this.width},function(a){w.N(this,a);t&&w.p(a,y,"right");this.x+=a-(this.x+this.width)});w.g(y,"bottom",y.prototype.bottom);
  w.defineProperty(y,{bottom:"bottom"},function(){return this.y+this.height},function(a){w.N(this,a);t&&w.p(a,y,"top");this.y+=a-(this.y+this.height)});w.g(y,"position",y.prototype.position);w.defineProperty(y,{position:"position"},function(){return new x(this.x,this.y)},function(a){w.N(this,a);t&&w.l(a,x,y,"position");this.x=a.x;this.y=a.y});w.g(y,"size",y.prototype.size);
  w.defineProperty(y,{size:"size"},function(){return new fa(this.width,this.height)},function(a){w.N(this,a);t&&w.l(a,fa,y,"size");this.width=a.width;this.height=a.height});w.g(y,"center",y.prototype.Tj);w.defineProperty(y,{Tj:"center"},function(){return new x(this.x+this.width/2,this.y+this.height/2)},function(a){w.N(this,a);t&&w.l(a,x,y,"center");this.x=a.x-this.width/2;this.y=a.y-this.height/2});w.g(y,"centerX",y.prototype.Da);
  w.defineProperty(y,{Da:"centerX"},function(){return this.x+this.width/2},function(a){w.N(this,a);t&&w.p(a,y,"centerX");this.x=a-this.width/2});w.g(y,"centerY",y.prototype.Ra);w.defineProperty(y,{Ra:"centerY"},function(){return this.y+this.height/2},function(a){w.N(this,a);t&&w.p(a,y,"centerY");this.y=a-this.height/2});y.prototype.isReal=y.prototype.J=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};
  y.prototype.isEmpty=function(){return 0===this.width&&0===this.height};function eb(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):w.m("Invalid arguments to Margin constructor");this.Qa=!1}w.ja("Margin",eb);w.Ph(eb);w.be(eb,{top:!0,right:!0,bottom:!0,left:!0});
  eb.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};eb.prototype.setTo=eb.prototype.o=function(a,b,c,d){t&&(w.i(a,"number",eb,"setTo:t"),w.i(b,"number",eb,"setTo:r"),w.i(c,"number",eb,"setTo:b"),w.i(d,"number",eb,"setTo:l"));w.N(this);this.top=a;this.right=b;this.bottom=c;this.left=d;return this};
  eb.prototype.set=eb.prototype.set=function(a){t&&w.l(a,eb,eb,"assign:m");w.N(this);this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};eb.prototype.copy=function(){var a=new eb;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};eb.prototype.Ma=function(){this.Qa=!0;Object.freeze(this);return this};eb.prototype.ba=function(){return Object.isFrozen(this)?this:this.copy().freeze()};eb.prototype.freeze=function(){this.Qa=!0;return this};
  eb.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;return this};
  eb.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 eb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new eb(c);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));if(isNaN(g))return new eb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new eb(c,e):new eb(c,e,g,h)}return new eb};
  eb.stringify=function(a){return a instanceof eb?a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString():a.toString()};eb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};eb.prototype.equals=eb.prototype.L=function(a){return a instanceof eb?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};
  eb.prototype.equalTo=eb.prototype.Fw=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};eb.prototype.equalsApprox=eb.prototype.Ne=function(a){return J.I(this.top,a.top)&&J.I(this.right,a.right)&&J.I(this.bottom,a.bottom)&&J.I(this.left,a.left)};eb.prototype.isReal=eb.prototype.J=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ga(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}w.Ph(ga);
  w.be(ga,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});ga.prototype.set=ga.prototype.set=function(a){t&&w.l(a,ga,ga,"set:t");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};ga.prototype.copy=function(){var a=new ga;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};ga.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
  ga.prototype.equals=ga.prototype.L=function(a){return a instanceof ga?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};ga.prototype.reset=ga.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0};
  ga.prototype.multiply=ga.prototype.multiply=function(a){t&&w.l(a,ga,ga,"multiply:matrix");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,g=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=g;return this};
  ga.prototype.multiplyInverted=ga.prototype.KF=function(a){t&&w.l(a,ga,ga,"multiplyInverted:matrix");var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,g=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*g;e=this.m12*e+this.m22*g;g=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=g;this.dy=h;return this};
  ga.prototype.invert=ga.prototype.nA=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),g=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=g};
  ga.prototype.rotate=ga.prototype.rotate=function(a,b,c){t&&(w.p(a,ga,"rotate:angle"),w.p(b,ga,"rotate:rx"),w.p(c,ga,"rotate:ry"));this.translate(b,c);var d=0,e=0;0===a?(d=1,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 g=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=g;this.m22=h;this.translate(-b,-c)};
  ga.prototype.translate=ga.prototype.translate=function(a,b){t&&(w.p(a,ga,"translate:x"),w.p(b,ga,"translate:y"));this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b};ga.prototype.scale=ga.prototype.scale=function(a,b){void 0===b&&(b=a);t&&(w.p(a,ga,"translate:sx"),w.p(b,ga,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b};
  ga.prototype.transformPoint=ga.prototype.fb=function(a){t&&w.l(a,x,ga,"transformPoint:p");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};ga.prototype.invertedTransformPoint=ga.prototype.Th=function(a){t&&w.l(a,x,ga,"invertedTransformPoint:p");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),g=a.x,h=a.y;a.x=g*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.y=g*c+h*d+e;return a};
  ga.prototype.transformRect=ga.prototype.RG=function(a){t&&w.l(a,y,ga,"transformRect:rect");var b=a.x,c=a.y,d=b+a.width,e=c+a.height,g=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*g+c*k+m,q=b*h+c*l+n,r=d*g+c*k+m,c=d*h+c*l+n,s=b*g+e*k+m,b=b*h+e*l+n,g=d*g+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,g),e=Math.max(e,g),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=
  h;a.width=e-p;a.height=q-h};ga.prototype.isIdentity=ga.prototype.zt=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};function K(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.Qa=!1}w.ja("Spot",K);w.Ph(K);w.be(K,{x:!0,y:!0,offsetX:!0,offsetY:!0});
  K.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};K.prototype.setTo=K.prototype.o=function(a,b,c,d){t&&(pb(a,"setTo:x"),pb(b,"setTo:y"),vb(c,"setTo:offx"),vb(d,"setTo:offy"));w.N(this);this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};K.prototype.set=K.prototype.set=function(a){t&&w.l(a,K,K,"set:s");w.N(this);this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};
  K.prototype.copy=function(){var a=new K;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};K.prototype.Ma=function(){this.Qa=!0;Object.freeze(this);return this};K.prototype.ba=function(){return Object.isFrozen(this)?this:this.copy().freeze()};K.prototype.freeze=function(){this.Qa=!0;return this};K.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;return this};function wb(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}
  function pb(a,b){(isNaN(a)||1<a||0>a)&&w.la(a,"0 <= "+b+" <= 1",K,b)}function vb(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&w.la(a,"real number, not NaN or Infinity",K,b)}var xb;
  K.parse=xb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return yb;if("TopLeft"===a)return Ab;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Cb;if("TopRight"===a)return Db;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Kb;if("Center"===a)return Ob;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Pb;if("BottomLeft"===a)return Ub;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Vb;if("BottomRight"===a)return Wb;if("TopSide"===a)return Xb;if("LeftSide"===
  a)return ac;if("RightSide"===a)return bc;if("BottomSide"===a)return cc;if("TopBottomSides"===a)return dc;if("LeftRightSides"===a)return ec;if("TopLeftSides"===a)return fc;if("TopRightSides"===a)return gc;if("BottomLeftSides"===a)return mc;if("BottomRightSides"===a)return nc;if("NotTopSide"===a)return qc;if("NotLeftSide"===a)return rc;if("NotRightSide"===a)return sc;if("NotBottomSide"===a)return xc;if("AllSides"===a)return yc;if("Default"===a)return zc;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 g=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(h=parseFloat(d));return new K(c,e,g,h)}return new K};K.stringify=function(a){return a instanceof K?a.kd()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString():a.toString()};
  K.prototype.toString=function(){return this.kd()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.L(yb)?"None":this.L(Ab)?"TopLeft":this.L(Cb)?"Top":this.L(Db)?"TopRight":this.L(Kb)?"Left":this.L(Ob)?"Center":this.L(Pb)?"Right":this.L(Ub)?"BottomLeft":this.L(Vb)?"Bottom":this.L(Wb)?"BottomRight":this.L(Xb)?"TopSide":this.L(ac)?"LeftSide":this.L(bc)?"RightSide":this.L(cc)?"BottomSide":this.L(dc)?"TopBottomSides":this.L(ec)?
  "LeftRightSides":this.L(fc)?"TopLeftSides":this.L(gc)?"TopRightSides":this.L(mc)?"BottomLeftSides":this.L(nc)?"BottomRightSides":this.L(qc)?"NotTopSide":this.L(rc)?"NotLeftSide":this.L(sc)?"NotRightSide":this.L(xc)?"NotBottomSide":this.L(yc)?"AllSides":this.L(zc)?"Default":"None"};K.prototype.equals=K.prototype.L=function(a){return a instanceof K?(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};
  K.prototype.opposite=function(){return new K(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};K.prototype.includesSide=function(a){if(!this.kp()||!a.kp())return!1;a=a.offsetY;return(this.offsetY&a)===a};K.prototype.isSpot=K.prototype.kd=function(){return!isNaN(this.x)&&!isNaN(this.y)};K.prototype.isNoSpot=K.prototype.ue=function(){return isNaN(this.x)||isNaN(this.y)};K.prototype.isSide=K.prototype.kp=function(){return this.ue()&&1===this.offsetX&&0!==this.offsetY};
  K.prototype.isDefault=K.prototype.Pc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var yb;K.None=yb=wb(new K(0,0,0,0),0).Ma();var zc;K.Default=zc=wb(new K(0,0,-1,0),-1).Ma();var Ab;K.TopLeft=Ab=(new K(0,0,0,0)).Ma();var Cb;K.TopCenter=Cb=(new K(.5,0,0,0)).Ma();var Db;K.TopRight=Db=(new K(1,0,0,0)).Ma();var Kb;K.LeftCenter=Kb=(new K(0,.5,0,0)).Ma();var Ob;K.Center=Ob=(new K(.5,.5,0,0)).Ma();var Pb;K.RightCenter=Pb=(new K(1,.5,0,0)).Ma();var Ub;
  K.BottomLeft=Ub=(new K(0,1,0,0)).Ma();var Vb;K.BottomCenter=Vb=(new K(.5,1,0,0)).Ma();var Wb;K.BottomRight=Wb=(new K(1,1,0,0)).Ma();var Ac;K.MiddleTop=Ac=Cb;var Bc;K.MiddleLeft=Bc=Kb;var Cc;K.MiddleRight=Cc=Pb;var Dc;K.MiddleBottom=Dc=Vb;K.Top=Cb;var Jc;K.Left=Jc=Kb;var Kc;K.Right=Kc=Pb;K.Bottom=Vb;var Xb;K.TopSide=Xb=wb(new K(0,0,1,w.ad),1).Ma();var ac;K.LeftSide=ac=wb(new K(0,0,1,w.Jc),1).Ma();var bc;K.RightSide=bc=wb(new K(0,0,1,w.Tc),1).Ma();var cc;K.BottomSide=cc=wb(new K(0,0,1,w.Sc),1).Ma();
  var dc;K.TopBottomSides=dc=wb(new K(0,0,1,w.ad|w.Sc),1).Ma();var ec;K.LeftRightSides=ec=wb(new K(0,0,1,w.Jc|w.Tc),1).Ma();var fc;K.TopLeftSides=fc=wb(new K(0,0,1,w.ad|w.Jc),1).Ma();var gc;K.TopRightSides=gc=wb(new K(0,0,1,w.ad|w.Tc),1).Ma();var mc;K.BottomLeftSides=mc=wb(new K(0,0,1,w.Sc|w.Jc),1).Ma();var nc;K.BottomRightSides=nc=wb(new K(0,0,1,w.Sc|w.Tc),1).Ma();var qc;K.NotTopSide=qc=wb(new K(0,0,1,w.Jc|w.Tc|w.Sc),1).Ma();var rc;K.NotLeftSide=rc=wb(new K(0,0,1,w.ad|w.Tc|w.Sc),1).Ma();var sc;
  K.NotRightSide=sc=wb(new K(0,0,1,w.ad|w.Jc|w.Sc),1).Ma();var xc;K.NotBottomSide=xc=wb(new K(0,0,1,w.ad|w.Jc|w.Tc),1).Ma();var yc;K.AllSides=yc=wb(new K(0,0,1,w.ad|w.Jc|w.Tc|w.Sc),1).Ma();function Lc(){this.jf=[1,0,0,1,0,0]}Lc.prototype.copy=function(){var a=new Lc;a.jf[0]=this.jf[0];a.jf[1]=this.jf[1];a.jf[2]=this.jf[2];a.jf[3]=this.jf[3];a.jf[4]=this.jf[4];a.jf[5]=this.jf[5];return a};function Rc(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.cE=[]}
  Rc.prototype.addColorStop=function(a,b){this.cE.push({offset:a,color:b})};
  function Sc(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.ix=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.EE=c;this.bx=null;this.path=[];this.Oi=new Lc;this.stack=[];this.xf=[];this.xG=this.QE=this.qw=0;this.Dw=a;this.vJ="http://www.w3.org/2000/svg";this.width=
  this.Dw.width;this.height=this.Dw.height;this.Gl=Tc(this,"svg",{width:this.width+"px",height:this.height+"px",YK:"0 0 "+this.Dw.width+" "+this.Dw.height});this.Gl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.Gl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");Uc(this,1,0,0,1,0,0);a=Tc(this,"clipPath",{id:"mainClip"});a.appendChild(Tc(this,"rect",{x:0,y:0,width:this.width,height:this.height}));this.Gl.appendChild(a);
  this.xf[0].setAttributeNS(null,"clip-path","url(#mainClip)")}f=Sc.prototype;f.arc=function(a,b,c,d,e,g){Vc(this,a,b,c,d,e,g)};f.beginPath=function(){this.path=[]};f.bezierCurveTo=function(a,b,c,d,e,g){this.path.push(["C",a,b,c,d,e,g])};f.clearRect=function(){};f.clip=function(){ad(this,"clipPath",this.path,new Lc)};f.closePath=function(){this.path.push(["z"])};f.createLinearGradient=function(a,b,c,d){var e=new Rc("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};f.createPattern=function(){};
  f.createRadialGradient=function(a,b,c,d,e,g){var h=new Rc("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=g;return h};
  f.drawImage=function(a,b,c,d,e,g,h,k,l){a=[b,c,d,e,g,h,k,l,a];b=this.Oi;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="";g=a[6]/a[2];h=a[7]/a[3];if(0!==a[4]||0!==a[5])d+=" translate("+a[4]+", "+a[5]+")";if(1!==g||1!==h)d+=" scale("+g+", "+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.qw,this.qw++,
  g=Tc(this,"clipPath",{id:e}),g.appendChild(Tc(this,"rect",{x:a[0],y:a[1],width:a[2],height:a[3]})),this.Gl.appendChild(g),c["clip-path"]="url(#"+e+")";bd(this,"image",c,b,d);this.addElement("image",c)};f.fill=function(){ad(this,"fill",this.path,this.Oi)};f.fillRect=function(a,b,c,d){cd(this,"fill",[a,b,c,d],this.Oi)};
  f.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};bd(this,"fill",b,this.Oi);this.addElement("text",b,a[0])};f.lineTo=function(a,b){this.path.push(["L",a,b])};f.moveTo=function(a,b){this.path.push(["M",a,b])};f.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};f.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"])};
  f.restore=function(){this.Oi=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.ix=a.ix;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};
  f.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,ix:this.ix,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.Oi.copy())};
  f.setTransform=function(a,b,c,d,e,g){1===a&&0===b&&0===c&&1===d&&0===e&&0===g||Uc(this,a,b,c,d,e,g)};f.scale=function(){};f.stroke=function(){ad(this,"stroke",this.path,this.Oi)};f.strokeRect=function(a,b,c,d){cd(this,"stroke",[a,b,c,d],this.Oi)};function Tc(a,b,c,d){a=a.document.createElementNS(a.vJ,b);if(w.Xa(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}
  f.addElement=function(a,b,c){a=Tc(this,a,b,c);0<this.xf.length?this.xf[this.xf.length-1].appendChild(a):this.Gl.appendChild(a);return this.bx=a};
  function bd(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 Rc?dd(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 Rc?dd(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.jf;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
  function dd(a,b){var c="GRAD"+a.QE;a.QE++;var d;if("linear"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"},d=Tc(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=Tc(a,"radialGradient",d);else throw Error("invalid gradient");for(var e=b.cE,g=e.length,h=[],k=0;k<g;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<g;k++)d.appendChild(Tc(a,"stop",h[k]));a.Gl.appendChild(d);return"url(#"+c+")"}function cd(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};bd(a,b,c,d);a.addElement("rect",c)}
  function ad(a,b,c,d){for(var e=[],g=0;g<c.length;g++){var h=w.il(c[g]),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(" ")};bd(a,b,c,d);"clipPath"===b?(b="CLIP"+a.qw,a.qw++,d=Tc(a,"clipPath",{id:b}),d.appendChild(Tc(a,"path",c)),a.Gl.appendChild(d),0<a.xf.length&&a.xf[a.xf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
  c)}function Vc(a,b,c,d,e,g,h){var k=Math.abs(e-g);if(e!=g){var l=b+d*Math.cos(g);g=c+d*Math.sin(g);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,g])):(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,g]))}}function Uc(a,b,c,d,e,g,h){var k=new Lc;k.jf=[b,c,d,e,g,h];b={};bd(a,"g",b,k);k=a.addElement("g",b);a.xf.push(k)}
  f.eb=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+this.xG;this.xG++;var b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,g,h;c=Tc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",VK:this.shadowBlur/2});d=Tc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=Tc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});g=Tc(this,"feOffset",{"in":"comp",result:"offsetBlur",
  dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=Tc(this,"feMerge",{});h.appendChild(Tc(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(Tc(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(g);b.appendChild(h);0<this.xf.length&&this.xf[this.xf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};
  function ma(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.Jd=c;c.getContext&&c.getContext("2d")||w.m("Browser does not support HTML Canvas Element");this.jI=c.getContext("2d");c.Y=a;Object.seal(this)}f=ma.prototype;f.getContext=function(){return this.jI};f.toDataURL=function(a,b){return this.Jd.toDataURL(a,b)};f.getBoundingClientRect=function(){return this.Jd.getBoundingClientRect()};f.focus=function(){return this.Jd.focus()};
  f.addEventListener=function(a,b,c){this.Jd.addEventListener(a,b,c)};f.removeEventListener=function(a,b,c){this.Jd.removeEventListener(a,b,c)};w.g(ma,"width",ma.prototype.width);w.defineProperty(ma,{width:"width"},function(){return this.Jd.width},function(a){this.Jd.width=a});w.g(ma,"height",ma.prototype.height);w.defineProperty(ma,{height:"height"},function(){return this.Jd.height},function(a){this.Jd.height=a});w.g(ma,"style",ma.prototype.style);
  w.defineProperty(ma,{style:"style"},function(){return this.Jd.style},function(a){this.Jd.style=a});
  var J={wa:4*((Math.sqrt(2)-1)/3),nk:(new x(0,0)).Ma(),hH:(new y(0,0,0,0)).Ma(),aq:(new eb(0,0,0,0)).Ma(),gH:(new eb(2,2,2,2)).Ma(),DB:(new fa(Infinity,Infinity)).Ma(),dH:(new x(-Infinity,-Infinity)).Ma(),cH:(new x(Infinity,Infinity)).Ma(),on:(new fa(0,0)).Ma(),Rx:(new fa(1,1)).Ma(),$p:(new fa(6,6)).Ma(),Ox:(new fa(8,8)).Ma(),eH:(new x(NaN,NaN)).Ma(),Sx:new na,$i:new na,CB:null,sqrt:function(a){if(0>=a)return 0;var b=J.CB;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);J.CB=b}return 1>a?
  (c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},I:function(a,b){var c=a-b;return.5>c&&-.5<c},rb:function(a,b){var c=a-b;return 5E-8>c&&-5E-8<c},Od:function(a,b,c,d,e,g,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<=g&&g<=a+e;if(b===d)return l<=g&&g<=k&&b-e<=h&&h<=b+e;k+=e;l-=e;if(l<=g&&g<=k&&(m+=e,n-=e,n<=h&&h<=m))if(k-l>m-n)if(a-c>e||c-a>e){if(g=(d-b)/(c-a)*(g-a)+b,g-e<=h&&h<=g+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<=g&&g<=h+e)return!0}else return!0;return!1},mw:function(a,b,c,d,e,g,h,k,l,m,n,p){if(J.Od(a,b,h,k,p,c,d)&&J.Od(a,b,h,k,p,e,g))return J.Od(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+g)/2,v=(d+s)/2,A=(c+u)/2;return J.mw(a,b,q,r,d,c,v,A,l,m,n,p)||J.mw(v,A,s,u,e,g,h,k,l,m,n,p)},eI:function(a,b,c,d,e,g,h,k,l){var m=(c+e)/2,n=(d+g)/2;l.x=(((a+c)/2+m)/2+(m+(e+h)/2)/2)/2;l.y=(((b+d)/2+n)/2+(n+
  (g+k)/2)/2)/2;return l},dI:function(a,b,c,d,e,g,h,k){var l=(c+e)/2,m=(d+g)/2;return ab(((a+c)/2+l)/2,((b+d)/2+m)/2,(l+(e+h)/2)/2,(m+(g+k)/2)/2)},Lo:function(a,b,c,d,e,g,h,k,l,m){if(J.Od(a,b,h,k,l,c,d)&&J.Od(a,b,h,k,l,e,g))nb(m,a,b,0,0),nb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,u=(c+r)/2;J.Lo(a,b,n,p,d,c,s,u,l,m);J.Lo(s,u,q,r,e,g,h,k,l,m)}return m},He:function(a,b,c,d,e,g,h,k,l,m){if(J.Od(a,b,h,k,l,c,d)&&
  J.Od(a,b,h,k,l,e,g))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+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,u=(c+r)/2;J.He(a,b,n,p,d,c,s,u,l,m);J.He(s,u,q,r,e,g,h,k,l,m)}return m},NA:function(a,b,c,d,e,g,h,k,l,m){if(J.Od(a,b,e,g,m,c,d))return J.Od(a,b,e,g,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var q=(n+c)/2,r=(p+d)/2;return J.NA(a,b,n,p,q,r,h,k,l,m)||J.NA(q,r,c,d,e,g,h,k,l,m)},UK:function(a,b,c,
  d,e,g,h){h.x=((a+c)/2+(c+e)/2)/2;h.y=((b+d)/2+(d+g)/2)/2;return h},MA:function(a,b,c,d,e,g,h,k){if(J.Od(a,b,e,g,h,c,d))nb(k,a,b,0,0),nb(k,e,g,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;J.MA(a,b,l,m,n,p,h,k);J.MA(n,p,c,d,e,g,h,k)}return k},Hp:function(a,b,c,d,e,g,h,k){if(J.Od(a,b,e,g,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(g);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;J.Hp(a,b,l,m,n,p,h,k);J.Hp(n,p,c,d,e,g,h,k)}return k},
  Ys:function(a,b,c,d,e,g,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(J.Od(a,b,h,k,q,c,d)&&J.Od(a,b,h,k,q,e,g)){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,u=(b+d)/2;c=(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var v=(s+c)/2,A=(u+d)/2;c=(c+e)/2;d=(d+g)/2;var E=(v+c)/2,B=(A+d)/
  2,G=(n-l)*(n-l)+(p-m)*(p-m),O=!1;J.Ys(a,b,s,u,v,A,E,B,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<G&&(G=b,O=!0));a=r.x;s=r.y;J.Ys(E,B,c,d,e,g,h,k,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<G?O=!0:(r.x=a,r.y=s));return O},Zs:function(a,b,c,d,e,g,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(J.Od(a,b,h,k,q,c,d)&&J.Od(a,b,h,k,q,e,g)){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,u=((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),u<l||u>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,u=(b+d)/2,v=(c+e)/2,A=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+v)/2;c=(u+A)/2;var v=(v+e)/2,A=(A+g)/2,E=(d+v)/2,B=(c+A)/2,r=r+J.Zs(a,b,s,u,d,c,E,B,l,m,n,p,q),r=r+J.Zs(E,B,v,A,e,g,h,k,l,m,n,p,q)}return r},cn:function(a,b,c,d,e,g,h){if(J.rb(a,c)){var k=0;c=0;b<d?(k=b,c=d):(k=d,c=b);d=g;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(J.rb(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-g)*(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},ih:function(a,b,c,d,e,g,h,k,l){if(J.I(a,c)&&J.I(b,d))return l.x=a,l.y=b,!1;if(J.rb(e,h)){if(J.rb(a,c))return J.cn(a,b,c,d,e,g,l),!1;g=(d-b)/(c-a)*(e-a)+b;return J.cn(a,b,c,d,e,g,l)}k=(k-g)/(h-e);if(J.rb(a,c)){g=k*(a-e)+g;c=h=0;b<d?(h=b,
  c=d):(h=d,c=b);if(g<h)return l.x=a,l.y=h,!1;if(g>c)return l.x=a,l.y=c,!1;l.x=a;l.y=g;return!0}h=(d-b)/(c-a);if(J.rb(k,h))return J.cn(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(J.rb(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}g=h*(e-a)+b;return J.cn(a,b,c,d,e,g,l)},FK:function(a,b,c,d,e){return J.ih(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},BK:function(a,b,c,d,e,g,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,u=0;e<h?(q=e,r=h):(q=h,r=e);g<k?(s=e,u=h):(s=h,u=e);q=(r-q)/2+m;m=(u-s)/2+m;e=(e+h)/2;g=(g+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+g;n(c,m*q+g);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*g/(m*m)-2*e/(q*q);q=k*k-4*d*(2*c*a*g/(m*m)-2*b*g/(m*m)+g*g/(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},pl:function(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(J.ih(a,b,a,d,e,g,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g);q<m&&(m=q,n=l.x,p=l.y)}J.ih(c,b,c,d,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));J.ih(a,b,c,b,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));J.ih(a,d,c,d,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));l.x=n;l.y=p;return 1E21>m},Tw:function(a,b,c){var d=b.x,e=b.y,g=c.x,h=c.y,k=a.left,l=a.right,
  m=a.top,n=a.bottom;return d===g?(g=a=0,e<h?(a=e,g=h):(a=h,g=e),k<=d&&d<=l&&a<=n&&g>=m):e===h?(d<g?a=d:(a=g,g=d),m<=e&&e<=n&&a<=l&&g>=k):a.Ea(b)||a.Ea(c)||J.Sw(k,m,l,m,d,e,g,h)||J.Sw(l,m,l,n,d,e,g,h)||J.Sw(l,n,k,n,d,e,g,h)||J.Sw(k,n,k,m,d,e,g,h)?!0:!1},Sw:function(a,b,c,d,e,g,h,k){return 0>=J.rw(a,b,c,d,e,g)*J.rw(a,b,c,d,h,k)&&0>=J.rw(e,g,h,k,a,b)*J.rw(e,g,h,k,c,d)},rw:function(a,b,c,d,e,g){c-=a;d-=b;a=e-a;b=g-b;g=a*d-b*c;0===g&&(g=a*c+b*d,0<g&&(g=(a-c)*c+(b-d)*d,0>g&&(g=0)));return 0>g?-1:0<g?1:0},
  Mt:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},pE:function(a,b,c,d,e,g){void 0===g&&(g=!1);var h=Math.PI;g||(d*=h/180,e*=h/180);g=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+g*Math.min(d,l),k.push(J.mI(c,m,e,a,b)),d-=Math.abs(e-m),m=e;return k},mI:function(a,b,c,d,e){var g=(c-b)/2,h=a*Math.cos(g),k=a*Math.sin(g),l=.5522847498*Math.tan(g),m=h+l*k,h=-k+l*h,k=-h,l=g+b,g=Math.cos(l),l=Math.sin(l);return[d+a*Math.cos(b),e+a*Math.sin(b),d+m*g-h*l,e+m*l+h*g,d+
  m*g-k*l,e+m*l+k*g,d+a*Math.cos(c),e+a*Math.sin(c)]},nt:function(a,b,c,d,e,g,h){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/g)*g+d;var k=c;c+e-a<e/2&&(k=c+e);a=d;d+g-b<g/2&&(a=d+g);h.o(k,a);return h},NE:function(a,b){var c=Math.max(a,b),d=Math.min(a,b),e=1,g=1;do e=c%d,c=g=d,d=e;while(0<e);return g},CI:function(a,b,c,d){var e=0>c,g=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:g)m=-m;h=k;n=0===h?c:d;if(0===h?e:g)n=-n;return J.DI(l,0===h?a:b,m,n,0,0)},DI:function(a,
  b,c,d,e,g){e=0;if(0<d)if(0<c){g=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+g),p=h/(b+e),n=n*n+p*p-1;if(0<n)k=b;else if(0>n)l=b;else break}c=g*c/(b+g)-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,g=b*Math.sqrt(Math.abs(1-d*d)),c=e-c,e=Math.sqrt(c*c+g*g)):e=Math.abs(c-a);return e}};
  function ed(a){1<arguments.length&&w.m("Geometry constructor can take at most one optional argument, the Geometry type.");w.jc(this);this.Qa=!1;void 0===a?a=fd:t&&w.za(a,ed,ed,"constructor:type");this.ha=a;this.zb=this.nb=this.vc=this.lc=0;this.ij=new D(gd);this.Tu=this.ij.W;this.Du=(new y).freeze();this.Ya=!0;this.zi=Ab;this.Ai=Wb;this.Zn=this.$n=NaN;this.ji=hd}w.ja("Geometry",ed);w.Ph(ed);
  ed.prototype.copy=function(){var a=new ed;a.ha=this.ha;a.lc=this.lc;a.vc=this.vc;a.nb=this.nb;a.zb=this.zb;for(var b=this.ij.q,c=b.length,d=a.ij,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.Tu=this.Tu;a.Du.assign(this.Du);a.Ya=this.Ya;a.zi=this.zi.ba();a.Ai=this.Ai.ba();a.$n=this.$n;a.Zn=this.Zn;a.ji=this.ji;return a};var id;ed.Line=id=w.w(ed,"Line",0);var jd;ed.Rectangle=jd=w.w(ed,"Rectangle",1);var kd;ed.Ellipse=kd=w.w(ed,"Ellipse",2);var fd;ed.Path=fd=w.w(ed,"Path",3);
  ed.prototype.Ma=function(){this.freeze();Object.freeze(this);return this};ed.prototype.freeze=function(){this.Qa=!0;var a=this.pb;a.freeze();for(var a=a.q,b=a.length,c=0;c<b;c++)a[c].freeze();return this};ed.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;var a=this.pb;a.Na();for(var a=a.q,b=a.length,c=0;c<b;c++)a[c].Na();return this};
  ed.prototype.equalsApprox=ed.prototype.Ne=function(a){if(!(a instanceof ed))return!1;if(this.type!==a.type)return this.type===id&&a.type===fd?ld(this,a):a.type===id&&this.type===fd?ld(a,this):!1;if(this.type===fd){var b=this.pb.q;a=a.pb.q;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Ne(a[d]))return!1;return!0}return J.I(this.ra,a.ra)&&J.I(this.sa,a.sa)&&J.I(this.D,a.D)&&J.I(this.F,a.F)};
  function ld(a,b){if(a.type!==id||b.type!==fd)return!1;if(1===b.pb.count){var c=b.pb.na(0);if(1===c.Fa.count&&J.I(a.ra,c.ra)&&J.I(a.sa,c.sa)&&(c=c.Fa.na(0),c.type===md&&J.I(a.D,c.D)&&J.I(a.F,c.F)))return!0}return!1}var nd;ed.stringify=nd=function(a){return a.toString()};
  ed.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case id:return 0>a?"M"+this.ra.toString()+" "+this.sa.toString()+"L"+this.D.toString()+" "+this.F.toString():"M"+this.ra.toFixed(a)+" "+this.sa.toFixed(a)+"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);case jd:var b=new y(this.ra,this.sa,0,0);b.WG(this.D,this.F,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 kd:b=new y(this.ra,this.sa,0,0);b.WG(this.D,this.F,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 fd:for(var b="",c=this.pb.q,d=c.length,e=0;e<d;e++){var g=c[e];0<e&&(b+=" x ");g.ip&&(b+="F ");b+=g.toString(a)}return b;default:return this.type.toString()}};var wd;
  ed.fillPath=wd=function(a){"string"!==typeof a&&w.sc(a,"string",ed,"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 xd;
  ed.parse=xd=function(a,b){function c(){return m>=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new x(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function g(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new x(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&w.sc(a,"string",ed,"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 x(0,0),r=new x(0,0),s=new x(0,
  0),u=l.length,v=w.u(),A=!1,E=!1,B=!0;!(m>=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":B=!0;E=A=!1;break;case "M":var G=g();null===v.Wb||!0===B?(L(v,G.x,G.y,A,!1,!E),B=!1):v.moveTo(G.x,G.y);for(q=s;!c();)G=g(),v.lineTo(G.x,G.y);break;case "L":for(;!c();)G=g(),v.lineTo(G.x,G.y);break;case "H":for(;!c();)s=G=new x((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),v.lineTo(s.x,s.y);break;case "V":for(;!c();)s=G=new x(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),v.lineTo(s.x,s.y);break;
  case "C":for(;!c();){var O=e(),M=h(),G=g();N(v,O.x,O.y,M.x,M.y,G.x,G.y)}break;case "S":for(;!c();)O=k(),M=h(),G=g(),N(v,O.x,O.y,M.x,M.y,G.x,G.y);break;case "Q":for(;!c();)M=h(),G=g(),yd(v,M.x,M.y,G.x,G.y);break;case "T":for(;!c();)r=M=k(),G=g(),yd(v,M.x,M.y,G.x,G.y);break;case "B":for(;!c();){var G=parseFloat(d()),O=parseFloat(d()),M=parseFloat(d()),X=parseFloat(d()),ja=parseFloat(d()),V=ja,Q=!1;c()||(V=parseFloat(d()),c()||(Q=0!==parseFloat(d())));n===n.toLowerCase()&&(M+=s.x,X+=s.y);v.arcTo(G,O,
  M,X,ja,V,Q)}break;case "A":for(;!c();)O=Math.abs(parseFloat(d())),M=Math.abs(parseFloat(d())),X=parseFloat(d()),ja=!!parseFloat(d()),V=!!parseFloat(d()),G=g(),zd(v,O,M,X,ja,V,G.x,G.y);break;case "Z":G=v.s.pb.q[v.s.pb.length-1];Ad(v);s=q;break;case "F":G="";for(O=1;l[m+O];)if(null!==l[m+O].match(/[Uu]/))O++;else if(null===l[m+O].match(/[A-Za-z]/))O++;else{G=l[m+O];break}G.match(/[Mm]/)?A=!0:Bd(v);break;case "U":G="";for(O=1;l[m+O];)if(null!==l[m+O].match(/[Ff]/))O++;else if(null===l[m+O].match(/[A-Za-z]/))O++;
  else{G=l[m+O];break}G.match(/[Mm]/)?E=!0:v.eb(!1)}q=v.s;w.v(v);if(b)for(v=q.pb.k;v.next();)G=v.value,G.ip=!0;return q};function Cd(a,b){for(var c=a.length,d=w.M(),e=0;e<c;e++){var g=a[e];d.x=g[0];d.y=g[1];b.fb(d);g[0]=d.x;g[1]=d.y;d.x=g[2];d.y=g[3];b.fb(d);g[2]=d.x;g[3]=d.y;d.x=g[4];d.y=g[5];b.fb(d);g[4]=d.x;g[5]=d.y;d.x=g[6];d.y=g[7];b.fb(d);g[6]=d.x;g[7]=d.y}w.B(d)}
  ed.prototype.wA=function(){if(this.Ya||this.Tu!==this.pb.W)return!0;for(var a=this.pb.q,b=a.length,c=0;c<b;c++)if(a[c].wA())return!0;return!1};ed.prototype.tB=function(){this.Ya=!1;this.Tu=this.pb.W;for(var a=this.pb.q,b=a.length,c=0;c<b;c++)a[c].tB()};ed.prototype.tg=function(){var a=this.Du;a.Na();isNaN(this.$n)||isNaN(this.Zn)?a.o(0,0,0,0):a.o(0,0,this.$n,this.Zn);Dd(this,a,!1);nb(a,0,0,0,0);a.freeze()};
  ed.prototype.computeBoundsWithoutOrigin=ed.prototype.iI=function(){var a=new y;Dd(this,a,!0);return a};
  function Dd(a,b,c){switch(a.type){case id:case jd:case kd:c?b.o(a.lc,a.vc,0,0):nb(b,a.lc,a.vc,0,0);nb(b,a.nb,a.zb,0,0);break;case fd:var d=a.pb;a=d.q;for(var d=d.length,e=0;e<d;e++){var g=a[e];c&&0===e?b.o(g.ra,g.sa,0,0):nb(b,g.ra,g.sa,0,0);for(var h=g.Fa.q,k=h.length,l=g.ra,m=g.sa,n=0;n<k;n++){var p=h[n];switch(p.type){case md:case Ed:l=p.D;m=p.F;nb(b,l,m,0,0);break;case Fd:J.Lo(l,m,p.Ib,p.Ub,p.we,p.xe,p.D,p.F,.5,b);l=p.D;m=p.F;break;case Gd:J.MA(l,m,p.Ib,p.Ub,p.D,p.F,.5,b);l=p.D;m=p.F;break;case Hd:case Id:for(var p=
  p.type===Hd?Jd(p,g):Od(p,g,l,m),q=p.length,r=null,s=0;s<q;s++)r=p[s],J.Lo(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:w.m("Unknown Segment type: "+p.type)}}}break;default:w.m("Unknown Geometry type: "+a.type)}}ed.prototype.normalize=ed.prototype.normalize=function(){w.N(this);var a=this.iI();this.offset(-a.x,-a.y);return new x(-a.x,-a.y)};
  ed.prototype.offset=ed.prototype.offset=function(a,b){w.N(this);t&&(w.p(a,ed,"offset"),w.p(b,ed,"offset"));this.transform(1,0,0,1,a,b);return this};ed.prototype.scale=ed.prototype.scale=function(a,b){w.N(this);t&&(w.p(a,ed,"scale:x"),w.p(b,ed,"scale:y"),0===a&&w.la(a,"scale must be non-zero",ed,"scale:x"),0===b&&w.la(b,"scale must be non-zero",ed,"scale:y"));this.transform(a,0,0,b,0,0);return this};
  ed.prototype.rotate=ed.prototype.rotate=function(a,b,c){w.N(this);void 0===b&&(b=0);void 0===c&&(c=0);t&&(w.p(a,ed,"rotate:angle"),w.p(b,ed,"rotate:x"),w.p(c,ed,"rotate:y"));var d=w.mh();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);w.df(d);return this};
  ed.prototype.transform=ed.prototype.transform=function(a,b,c,d,e,g){var h=0,k=0;switch(this.type){case id:case jd:case kd:h=this.lc;k=this.vc;this.lc=h*a+k*c+e;this.vc=h*b+k*d+g;h=this.nb;k=this.zb;this.nb=h*a+k*c+e;this.zb=h*b+k*d+g;break;case fd:for(var l=this.pb.q,m=l.length,n=0;n<m;n++){var p=l[n],h=p.ra,k=p.sa;p.ra=h*a+k*c+e;p.sa=h*b+k*d+g;for(var p=p.Fa.q,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case md:case Ed:h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;break;case Fd:h=s.Ib;k=s.Ub;s.Ib=
  h*a+k*c+e;s.Ub=h*b+k*d+g;h=s.we;k=s.xe;s.we=h*a+k*c+e;s.xe=h*b+k*d+g;h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;break;case Gd:h=s.Ib;k=s.Ub;s.Ib=h*a+k*c+e;s.Ub=h*b+k*d+g;h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;break;case Hd:h=s.Da;k=s.Ra;s.Da=h*a+k*c+e;s.Ra=h*b+k*d+g;s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Id:h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:w.m("Unknown Segment type: "+
  s.type)}}}}this.Ya=!0;return this};ed.prototype.Ms=function(a,b){var c=this.lc,d=this.vc,e=this.nb,g=this.zb,h=Math.min(c,e),k=Math.min(d,g),c=Math.abs(e-c),d=Math.abs(g-d),g=w.M();g.x=h;g.y=k;b.fb(g);e=new gd(g.x,g.y);g.x=h+c;g.y=k;b.fb(g);e.Fa.add(new Pd(md,g.x,g.y));g.x=h+c;g.y=k+d;b.fb(g);e.Fa.add(new Pd(md,g.x,g.y));g.x=h;g.y=k+d;b.fb(g);e.Fa.add((new Pd(md,g.x,g.y)).close());w.B(g);a.type=fd;a.pb.add(e);return a};
  ed.prototype.Ea=function(a,b,c,d){var e=a.x,g=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.pb.q,s=r.length,u=0;u<s;u++){var v=r[u];if(v.ip){if(c&&v.Ea(e,g,b))return!0;for(var A=v.Fa,l=v.ra,m=v.sa,E=l,B=m,G=A.q,O=0;O<=A.length;O++){var M,X;O!==A.length?(M=G[O],X=M.type,p=M.D,q=M.F):(X=md,p=E,q=B);switch(X){case Ed:n=Qd(e,g,h,a,l,m,E,B);if(isNaN(n))return!0;k+=n;E=p;B=q;break;case md:n=Qd(e,g,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case Fd:n=J.Zs(l,m,M.Ib,M.Ub,M.we,M.xe,p,q,
  h,a,e,g,.5);k+=n;break;case Gd:n=J.Zs(l,m,(l+2*M.Ib)/3,(m+2*M.Ub)/3,(M.Ib+2*p)/3,(M.Ib+2*p)/3,p,q,h,a,e,g,.5);k+=n;break;case Hd:case Id:X=M.type===Hd?Jd(M,v):Od(M,v,l,m);for(var ja=X.length,V=null,Q=0;Q<ja;Q++){V=X[Q];if(0===Q){n=Qd(e,g,h,a,l,m,V[0],V[1]);if(isNaN(n))return!0;k+=n}n=J.Zs(V[0],V[1],V[2],V[3],V[4],V[5],V[6],V[7],h,a,e,g,.5);k+=n}null!==V&&(p=V[6],q=V[7]);break;default:w.m("Unknown Segment type: "+M.type)}l=p;m=q}if(0!==k)return!0;k=0}else if(v.Ea(e,g,d?b:b+2))return!0}return 0!==k};
  function Qd(a,b,c,d,e,g,h,k){if(J.Od(e,g,h,k,.05,a,b))return NaN;var l=(a-c)*(g-k);if(0===l)return 0;var m=((a*d-b*c)*(e-h)-(a-c)*(e*k-g*h))/l;b=(a*d-b*c)*(g-k)/l;if(m>=a)return 0;if((e>h?e-h:h-e)<(g>k?g-k:k-g)){if(e=a=0,g<k?(a=g,e=k):(a=k,e=g),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 Rd(a,b,c,d){a=a.pb.q;for(var e=a.length,g=0;g<e;g++)if(a[g].Ea(b,c,d))return!0;return!1}
  ed.prototype.getPointAlongPath=function(a){(0>a||1<a)&&w.la(a,"0 <= fraction <= 1",ed,"getPointAlongPath:fraction");var b=this.pb.first(),c=w.lb(),d=[];d.push(b.ra);d.push(b.sa);for(var e=b.ra,g=b.sa,h=e,k=g,l=b.Fa.q,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.ha){case Ed:c.push(d);d=[];d.push(p.D);d.push(p.F);e=p.D;g=p.F;h=e;k=g;break;case md:d.push(p.D);d.push(p.F);e=p.D;g=p.F;break;case Fd:J.He(e,g,p.fd,p.Ce,p.mg,p.ng,p.nb,p.zb,.5,d);e=p.D;g=p.F;break;case Gd:J.Hp(e,g,p.fd,p.Ce,p.nb,p.zb,.5,d);
  e=p.D;g=p.F;break;case Hd:for(var q=Jd(p,b),r=q.length,s=0;s<r;s++){var u=q[s];J.He(e,g,u[2],u[3],u[4],u[5],u[6],u[7],.5,d);e=u[6];g=u[7]}break;case Id:q=Od(p,b,e,g);r=q.length;for(s=0;s<r;s++)u=q[s],J.He(e,g,u[2],u[3],u[4],u[5],u[6],u[7],.5,d),e=u[6],g=u[7];break;default:w.m("Segment not of valid type")}p.Ah&&(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],g=l[n+1],0!==n&&(p=Math.sqrt($a(b,d,e,g)),q+=p),b=e,d=g;a*=q;for(k=q=0;k<h;k++)for(l=
  c[k],m=l.length,n=0;n<m;n++){e=l[n];g=l[n+1];if(0!==n){p=Math.sqrt($a(b,d,e,g));if(q+p>a)return n=(a-q)/p,w.xa(c),new x(b+(e-b)*n,d+(g-d)*n);q+=p}b=e;d=g}w.xa(c);return null};w.g(ed,"type",ed.prototype.type);w.defineProperty(ed,{type:"type"},function(){return this.ha},function(a){this.ha!==a&&(t&&w.za(a,ed,ed,"type"),w.N(this,a),this.ha=a,this.Ya=!0)});w.g(ed,"startX",ed.prototype.ra);
  w.defineProperty(ed,{ra:"startX"},function(){return this.lc},function(a){this.lc!==a&&(t&&w.p(a,ed,"startX"),w.N(this,a),this.lc=a,this.Ya=!0)});w.g(ed,"startY",ed.prototype.sa);w.defineProperty(ed,{sa:"startY"},function(){return this.vc},function(a){this.vc!==a&&(t&&w.p(a,ed,"startY"),w.N(this,a),this.vc=a,this.Ya=!0)});w.g(ed,"endX",ed.prototype.D);w.defineProperty(ed,{D:"endX"},function(){return this.nb},function(a){this.nb!==a&&(t&&w.p(a,ed,"endX"),w.N(this,a),this.nb=a,this.Ya=!0)});
  w.g(ed,"endY",ed.prototype.F);w.defineProperty(ed,{F:"endY"},function(){return this.zb},function(a){this.zb!==a&&(t&&w.p(a,ed,"endY"),w.N(this,a),this.zb=a,this.Ya=!0)});w.g(ed,"figures",ed.prototype.pb);w.defineProperty(ed,{pb:"figures"},function(){return this.ij},function(a){this.ij!==a&&(t&&w.l(a,D,ed,"figures"),w.N(this,a),this.ij=a,this.Ya=!0)});ed.prototype.add=ed.prototype.add=function(a){this.ij.add(a);return this};
  w.defineProperty(ed,{G:"spot1"},function(){return this.zi},function(a){t&&w.l(a,K,ed,"spot1");w.N(this,a);this.zi=a.ba()});w.defineProperty(ed,{H:"spot2"},function(){return this.Ai},function(a){t&&w.l(a,K,ed,"spot2");w.N(this,a);this.Ai=a.ba()});w.defineProperty(ed,{td:"defaultStretch"},function(){return this.ji},function(a){t&&w.za(a,P,ed,"stretch");w.N(this,a);this.ji=a});w.A(ed,{kb:"bounds"},function(){this.wA()&&(this.tB(),this.tg());return this.Du});
  function gd(a,b,c,d){w.jc(this);this.Qa=!1;void 0===c&&(c=!0);this.Xl=c;void 0===d&&(d=!0);this.ao=d;void 0!==a?(t&&w.p(a,gd,"sx"),this.lc=a):this.lc=0;void 0!==b?(t&&w.p(b,gd,"sy"),this.vc=b):this.vc=0;this.so=new D(Pd);this.Nv=this.so.W;this.Ya=!0}w.ja("PathFigure",gd);w.Ph(gd);gd.prototype.copy=function(){var a=new gd;a.Xl=this.Xl;a.ao=this.ao;a.lc=this.lc;a.vc=this.vc;for(var b=this.so.q,c=b.length,d=a.so,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.Nv=this.Nv;a.Ya=this.Ya;return a};
  gd.prototype.equalsApprox=gd.prototype.Ne=function(a){if(!(a instanceof gd&&J.I(this.ra,a.ra)&&J.I(this.sa,a.sa)))return!1;var b=this.Fa.q;a=a.Fa.q;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Ne(a[d]))return!1;return!0};f=gd.prototype;f.toString=function(a){void 0===a&&(a=-1);for(var b=0>a?"M"+this.ra.toString()+" "+this.sa.toString():"M"+this.ra.toFixed(a)+" "+this.sa.toFixed(a),c=this.Fa.q,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};
  f.freeze=function(){this.Qa=!0;var a=this.Fa;a.freeze();for(var b=a.q,a=a.length,c=0;c<a;c++)b[c].freeze();return this};f.Na=function(){this.Qa=!1;var a=this.Fa;a.Na();for(var a=a.q,b=a.length,c=0;c<b;c++)a[c].Na();return this};f.wA=function(){if(this.Ya)return!0;var a=this.Fa;if(this.Nv!==a.W)return!0;for(var a=a.q,b=a.length,c=0;c<b;c++)if(a[c].Ya)return!0;return!1};f.tB=function(){this.Ya=!1;var a=this.Fa;this.Nv=a.W;for(var a=a.q,b=a.length,c=0;c<b;c++){var d=a[c];d.Ya=!1;d.aj=null}};
  w.g(gd,"isFilled",gd.prototype.ip);w.defineProperty(gd,{ip:"isFilled"},function(){return this.Xl},function(a){t&&w.i(a,"boolean",gd,"isFilled");w.N(this,a);this.Xl=a});w.g(gd,"isShadowed",gd.prototype.Ti);w.defineProperty(gd,{Ti:"isShadowed"},function(){return this.ao},function(a){t&&w.i(a,"boolean",gd,"isShadowed");w.N(this,a);this.ao=a});w.g(gd,"startX",gd.prototype.ra);w.defineProperty(gd,{ra:"startX"},function(){return this.lc},function(a){t&&w.p(a,gd,"startX");w.N(this,a);this.lc=a;this.Ya=!0});
  w.g(gd,"startY",gd.prototype.sa);w.defineProperty(gd,{sa:"startY"},function(){return this.vc},function(a){t&&w.p(a,gd,"startY");w.N(this,a);this.vc=a;this.Ya=!0});w.g(gd,"segments",gd.prototype.Fa);w.defineProperty(gd,{Fa:"segments"},function(){return this.so},function(a){t&&w.l(a,D,gd,"segments");w.N(this,a);this.so=a;this.Ya=!0});gd.prototype.add=gd.prototype.add=function(a){this.so.add(a);return this};
  gd.prototype.Ea=function(a,b,c){for(var d=this.ra,e=this.sa,g=d,h=e,k=this.Fa.q,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case Ed:g=n.D;h=n.F;d=n.D;e=n.F;break;case md:if(J.Od(d,e,n.D,n.F,c,a,b))return!0;d=n.D;e=n.F;break;case Fd:if(J.mw(d,e,n.Ib,n.Ub,n.we,n.xe,n.D,n.F,.5,a,b,c))return!0;d=n.D;e=n.F;break;case Gd:if(J.NA(d,e,n.Ib,n.Ub,n.D,n.F,.5,a,b,c))return!0;d=n.D;e=n.F;break;case Hd:case Id:for(var p=n.type===Hd?Jd(n,this):Od(n,this,d,e),q=p.length,r=null,s=0;s<q;s++)if(r=p[s],0===s&&
  J.Od(d,e,r[0],r[1],c,a,b)||J.mw(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:w.m("Unknown Segment type: "+n.type)}if(n.xt&&(d!==g||e!==h)&&J.Od(d,e,g,h,c,a,b))return!0}return!1};
  function Pd(a,b,c,d,e,g,h,k){w.jc(this);this.Qa=!1;void 0===a?a=md:t&&w.za(a,Pd,Pd,"constructor:type");this.ha=a;void 0!==b?(t&&w.p(b,Pd,"ex"),this.nb=b):this.nb=0;void 0!==c?(t&&w.p(c,Pd,"ey"),this.zb=c):this.zb=0;a===Id?(void 0!==g&&(a=g%360,0>a&&(a+=360),this.fd=a),void 0!==d&&(t&&w.p(d,Pd,"x1"),this.mg=Math.max(d,0)),void 0!==e&&(t&&w.p(e,Pd,"y1"),this.ng=Math.max(e,0)),this.io=!!h,this.zn=!!k):(void 0!==d&&(t&&w.p(d,Pd,"x1"),this.fd=d),void 0!==e&&(t&&w.p(e,Pd,"y1"),this.Ce=e),void 0!==g&&(t&&
  w.p(g,Pd,"x2"),a===Hd&&(g=Math.max(g,0)),this.mg=g),void 0!==h&&"number"===typeof h&&(t&&w.p(h,Pd,"y2"),a===Hd&&(h=Math.max(h,0)),this.ng=h));this.Ah=!1;this.Ya=!0;this.aj=null}w.ja("PathSegment",Pd);w.Ph(Pd);
  Pd.prototype.copy=function(){var a=new Pd;a.ha=this.ha;a.nb=this.nb;a.zb=this.zb;void 0!==this.fd&&(a.fd=this.fd);void 0!==this.Ce&&(a.Ce=this.Ce);void 0!==this.mg&&(a.mg=this.mg);void 0!==this.ng&&(a.ng=this.ng);void 0!==this.io&&(a.io=this.io);void 0!==this.zn&&(a.zn=this.zn);a.Ah=this.Ah;a.Ya=this.Ya;return a};
  Pd.prototype.equalsApprox=Pd.prototype.Ne=function(a){if(!(a instanceof Pd)||this.type!==a.type||this.xt!==a.xt)return!1;switch(this.type){case Ed:case md:return J.I(this.D,a.D)&&J.I(this.F,a.F);case Fd:return J.I(this.D,a.D)&&J.I(this.F,a.F)&&J.I(this.Ib,a.Ib)&&J.I(this.Ub,a.Ub)&&J.I(this.we,a.we)&&J.I(this.xe,a.xe);case Gd:return J.I(this.D,a.D)&&J.I(this.F,a.F)&&J.I(this.Ib,a.Ib)&&J.I(this.Ub,a.Ub);case Hd:return J.I(this.lh,a.lh)&&J.I(this.Yh,a.Yh)&&J.I(this.Da,a.Da)&&J.I(this.Ra,a.Ra)&&J.I(this.radiusX,
  a.radiusX)&&J.I(this.radiusY,a.radiusY);case Id:return this.Ww===a.Ww&&this.Yw===a.Yw&&J.I(this.Mx,a.Mx)&&J.I(this.D,a.D)&&J.I(this.F,a.F)&&J.I(this.radiusX,a.radiusX)&&J.I(this.radiusY,a.radiusY);default:return!1}};
  Pd.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Ed:b=0>a?"M"+this.D.toString()+" "+this.F.toString():"M"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case md:b=0>a?"L"+this.D.toString()+" "+this.F.toString():"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case Fd:b=0>a?"C"+this.Ib.toString()+" "+this.Ub.toString()+" "+this.we.toString()+" "+this.xe.toString()+" "+this.D.toString()+" "+this.F.toString():"C"+this.Ib.toFixed(a)+" "+this.Ub.toFixed(a)+" "+this.we.toFixed(a)+
  " "+this.xe.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case Gd:b=0>a?"Q"+this.Ib.toString()+" "+this.Ub.toString()+" "+this.D.toString()+" "+this.F.toString():"Q"+this.Ib.toFixed(a)+" "+this.Ub.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case Hd:b=0>a?"B"+this.lh.toString()+" "+this.Yh.toString()+" "+this.Da.toString()+" "+this.Ra.toString()+" "+this.radiusX:"B"+this.lh.toFixed(a)+" "+this.Yh.toFixed(a)+" "+this.Da.toFixed(a)+" "+this.Ra.toFixed(a)+" "+this.radiusX;
  break;case Id:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Mx.toString()+" "+(this.Yw?1:0)+" "+(this.Ww?1:0)+" "+this.D.toString()+" "+this.F.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Mx.toFixed(a)+" "+(this.Yw?1:0)+" "+(this.Ww?1:0)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;default:b=this.type.toString()}return b+(this.Ah?"z":"")};var Ed;Pd.Move=Ed=w.w(Pd,"Move",0);var md;Pd.Line=md=w.w(Pd,"Line",1);var Fd;
  Pd.Bezier=Fd=w.w(Pd,"Bezier",2);var Gd;Pd.QuadraticBezier=Gd=w.w(Pd,"QuadraticBezier",3);var Hd;Pd.Arc=Hd=w.w(Pd,"Arc",4);var Id;Pd.SvgArc=Id=w.w(Pd,"SvgArc",4);Pd.prototype.freeze=function(){this.Qa=!0;return this};Pd.prototype.Na=function(){this.Qa=!1;return this};Pd.prototype.close=Pd.prototype.close=function(){this.Ah=!0;return this};
  function Jd(a,b){if(null!==a.aj&&!1===b.Ya)return a.aj;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);var e=a.fd,g=a.Ce,h=J.pE(0,0,c<d?c:d,a.lh,a.lh+a.Yh,!1);if(c!==d){var k=w.mh();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);Cd(h,k);w.df(k)}c=h.length;for(d=0;d<c;d++)k=h[d],k[0]+=e,k[1]+=g,k[2]+=e,k[3]+=g,k[4]+=e,k[5]+=g,k[6]+=e,k[7]+=g;a.aj=h;return a.aj}
  function Od(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos(g(a,b,c,d))}function g(a,b,c,d){return(a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d))}if(null!==a.aj&&!1===b.Ya)return a.aj;b=a.mg;var h=a.ng,k=Math.PI/180*a.fd,l=a.io,m=a.zn,n=a.nb,p=a.zb,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,u=s*s/(b*b)+k*k/(h*h);1<u&&(b*=Math.sqrt(u),h*=Math.sqrt(u));u=(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(u)&&(u=0);l=u*b*k/h;u=u*-h*s/
  b;isNaN(l)&&(l=0);isNaN(u)&&(u=0);c=(c+n)/2+q*l-r*u;d=(d+p)/2+r*l+q*u;p=e(1,0,(s-l)/b,(k-u)/h);q=(s-l)/b;n=(k-u)/h;s=(-s-l)/b;l=(-k-u)/h;k=e(q,n,s,l);s=g(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=J.pE(0,0,b>h?b:h,p,p+k,!0);h=w.mh();h.reset();h.translate(c,d);h.rotate(a.fd,0,0);h.scale(m,s);Cd(b,h);w.df(h);a.aj=b;return a.aj}w.g(Pd,"isClosed",Pd.prototype.xt);
  w.defineProperty(Pd,{xt:"isClosed"},function(){return this.Ah},function(a){this.Ah!==a&&(this.Ah=a,this.Ya=!0)});w.g(Pd,"type",Pd.prototype.type);w.defineProperty(Pd,{type:"type"},function(){return this.ha},function(a){t&&w.za(a,Pd,Pd,"type");w.N(this,a);this.ha=a;this.Ya=!0});w.g(Pd,"endX",Pd.prototype.D);w.defineProperty(Pd,{D:"endX"},function(){return this.nb},function(a){t&&w.p(a,Pd,"endX");w.N(this,a);this.nb=a;this.Ya=!0});w.g(Pd,"endY",Pd.prototype.F);
  w.defineProperty(Pd,{F:"endY"},function(){return this.zb},function(a){t&&w.p(a,Pd,"endY");w.N(this,a);this.zb=a;this.Ya=!0});w.defineProperty(Pd,{Ib:"point1X"},function(){return this.fd},function(a){t&&w.p(a,Pd,"point1X");w.N(this,a);this.fd=a;this.Ya=!0});w.defineProperty(Pd,{Ub:"point1Y"},function(){return this.Ce},function(a){t&&w.p(a,Pd,"point1Y");w.N(this,a);this.Ce=a;this.Ya=!0});
  w.defineProperty(Pd,{we:"point2X"},function(){return this.mg},function(a){t&&w.p(a,Pd,"point2X");w.N(this,a);this.mg=a;this.Ya=!0});w.defineProperty(Pd,{xe:"point2Y"},function(){return this.ng},function(a){t&&w.p(a,Pd,"point2Y");w.N(this,a);this.ng=a;this.Ya=!0});w.defineProperty(Pd,{Da:"centerX"},function(){return this.fd},function(a){t&&w.p(a,Pd,"centerX");w.N(this,a);this.fd=a;this.Ya=!0});
  w.defineProperty(Pd,{Ra:"centerY"},function(){return this.Ce},function(a){t&&w.p(a,Pd,"centerY");w.N(this,a);this.Ce=a;this.Ya=!0});w.defineProperty(Pd,{radiusX:"radiusX"},function(){return this.mg},function(a){t&&w.p(a,Pd,"radiusX");0>a&&w.la(a,">= zero",Pd,"radiusX");w.N(this,a);this.mg=a;this.Ya=!0});w.defineProperty(Pd,{radiusY:"radiusY"},function(){return this.ng},function(a){t&&w.p(a,Pd,"radiusY");0>a&&w.la(a,">= zero",Pd,"radiusY");w.N(this,a);this.ng=a;this.Ya=!0});
  w.defineProperty(Pd,{lh:"startAngle"},function(){return this.nb},function(a){this.nb!==a&&(w.N(this,a),t&&w.p(a,Pd,"startAngle"),a%=360,0>a&&(a+=360),this.nb=a,this.Ya=!0)});w.defineProperty(Pd,{Yh:"sweepAngle"},function(){return this.zb},function(a){t&&w.p(a,Pd,"sweepAngle");w.N(this,a);360<a&&(a=360);-360>a&&(a=-360);this.zb=a;this.Ya=!0});w.defineProperty(Pd,{Ww:"isClockwiseArc"},function(){return this.zn},function(a){w.N(this,a);this.zn=a;this.Ya=!0});
  w.defineProperty(Pd,{Yw:"isLargeArc"},function(){return this.io},function(a){w.N(this,a);this.io=a;this.Ya=!0});w.defineProperty(Pd,{Mx:"xAxisRotation"},function(){return this.fd},function(a){t&&w.p(a,Pd,"xAxisRotation");a%=360;0>a&&(a+=360);w.N(this,a);this.fd=a;this.Ya=!0});function Sd(){this.Y=null;this.Bz=(new x(0,0)).freeze();this.By=(new x(0,0)).freeze();this.Au=this.wv=0;this.kv="";this.aw=this.Qu=!1;this.Mu=this.Cu=0;this.bj=this.Yu=this.gv=!1;this.Gq=null;this.$v=0;this.og=this.Yv=null}
  w.ja("InputEvent",Sd);Sd.prototype.copy=function(){var a=new Sd;a.Y=this.Y;a.Bz.assign(this.We);a.By.assign(this.ga);a.wv=this.wv;a.Au=this.Au;a.kv=this.kv;a.Qu=this.Qu;a.aw=this.aw;a.Cu=this.Cu;a.Mu=this.Mu;a.gv=this.gv;a.Yu=this.Yu;a.bj=this.bj;a.Gq=this.Gq;a.$v=this.$v;a.Yv=this.Yv;a.og=this.og;return a};
  Sd.prototype.toString=function(){var a="^";0!==this.Zc&&(a+="M:"+this.Zc);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Je&&(a+="C:"+this.Je);0!==this.Yj&&(a+="D:"+this.Yj);this.Oc&&(a+="h");this.bubbles&&(a+="b");null!==this.ga&&(a+="@"+this.ga.toString());return a};w.g(Sd,"diagram",Sd.prototype.h);w.defineProperty(Sd,{h:"diagram"},function(){return this.Y},function(a){this.Y=a});w.g(Sd,"viewPoint",Sd.prototype.We);
  w.defineProperty(Sd,{We:"viewPoint"},function(){return this.Bz},function(a){w.l(a,x,Sd,"viewPoint");this.Bz.assign(a)});w.g(Sd,"documentPoint",Sd.prototype.ga);w.defineProperty(Sd,{ga:"documentPoint"},function(){return this.By},function(a){w.l(a,x,Sd,"documentPoint");this.By.assign(a)});w.g(Sd,"modifiers",Sd.prototype.Zc);w.defineProperty(Sd,{Zc:"modifiers"},function(){return this.wv},function(a){this.wv=a});w.g(Sd,"button",Sd.prototype.button);
  w.defineProperty(Sd,{button:"button"},function(){return this.Au},function(a){this.Au=a});w.g(Sd,"key",Sd.prototype.key);w.defineProperty(Sd,{key:"key"},function(){return this.kv},function(a){this.kv=a});w.g(Sd,"down",Sd.prototype.ak);w.defineProperty(Sd,{ak:"down"},function(){return this.Qu},function(a){this.Qu=a});w.g(Sd,"up",Sd.prototype.up);w.defineProperty(Sd,{up:"up"},function(){return this.aw},function(a){this.aw=a});w.g(Sd,"clickCount",Sd.prototype.Je);
  w.defineProperty(Sd,{Je:"clickCount"},function(){return this.Cu},function(a){this.Cu=a});w.g(Sd,"delta",Sd.prototype.Yj);w.defineProperty(Sd,{Yj:"delta"},function(){return this.Mu},function(a){this.Mu=a});w.defineProperty(Sd,{At:"isMultiTouch"},function(){return this.gv},function(a){this.gv=a});w.g(Sd,"handled",Sd.prototype.Oc);w.defineProperty(Sd,{Oc:"handled"},function(){return this.Yu},function(a){this.Yu=a});w.g(Sd,"bubbles",Sd.prototype.bubbles);
  w.defineProperty(Sd,{bubbles:"bubbles"},function(){return this.bj},function(a){this.bj=a});w.g(Sd,"event",Sd.prototype.event);w.defineProperty(Sd,{event:"event"},function(){return this.Gq},function(a){this.Gq=a});w.A(Sd,{ul:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});w.g(Sd,"timestamp",Sd.prototype.timestamp);
  w.defineProperty(Sd,{timestamp:"timestamp"},function(){return this.$v},function(a){this.$v=a});w.g(Sd,"targetDiagram",Sd.prototype.Zf);w.defineProperty(Sd,{Zf:"targetDiagram"},function(){return this.Yv},function(a){this.Yv=a});w.g(Sd,"targetObject",Sd.prototype.ie);w.defineProperty(Sd,{ie:"targetObject"},function(){return this.og},function(a){this.og=a});w.g(Sd,"control",Sd.prototype.control);
  w.defineProperty(Sd,{control:"control"},function(){return 0!==(this.Zc&1)},function(a){this.Zc=a?this.Zc|1:this.Zc&-2});w.g(Sd,"shift",Sd.prototype.shift);w.defineProperty(Sd,{shift:"shift"},function(){return 0!==(this.Zc&4)},function(a){this.Zc=a?this.Zc|4:this.Zc&-5});w.g(Sd,"alt",Sd.prototype.alt);w.defineProperty(Sd,{alt:"alt"},function(){return 0!==(this.Zc&2)},function(a){this.Zc=a?this.Zc|2:this.Zc&-3});w.g(Sd,"meta",Sd.prototype.xp);
  w.defineProperty(Sd,{xp:"meta"},function(){return 0!==(this.Zc&8)},function(a){this.Zc=a?this.Zc|8:this.Zc&-9});w.g(Sd,"left",Sd.prototype.left);w.defineProperty(Sd,{left:"left"},function(){return 0===this.button},function(a){this.button=a?0:2});w.g(Sd,"middle",Sd.prototype.rJ);w.defineProperty(Sd,{rJ:"middle"},function(){return 1===this.button},function(a){this.button=a?1:0});w.g(Sd,"right",Sd.prototype.right);
  w.defineProperty(Sd,{right:"right"},function(){return 2===this.button},function(a){this.button=a?2:0});function Td(){this.Y=null;this.Xb="";this.Fv=this.Tv=null;this.Bu=!1}w.ja("DiagramEvent",Td);Td.prototype.copy=function(){var a=new Td;a.Y=this.Y;a.Xb=this.Xb;a.Tv=this.Tv;a.Fv=this.Fv;a.Bu=this.Bu;return a};Td.prototype.toString=function(){var a="*"+this.name;this.cancel&&(a+="x");null!==this.Hx&&(a+=":"+this.Hx.toString());null!==this.ux&&(a+="("+this.ux.toString()+")");return a};
  w.g(Td,"diagram",Td.prototype.h);w.defineProperty(Td,{h:"diagram"},function(){return this.Y},function(a){this.Y=a});w.g(Td,"name",Td.prototype.name);w.defineProperty(Td,{name:"name"},function(){return this.Xb},function(a){this.Xb=a});w.g(Td,"subject",Td.prototype.Hx);w.defineProperty(Td,{Hx:"subject"},function(){return this.Tv},function(a){this.Tv=a});w.g(Td,"parameter",Td.prototype.ux);w.defineProperty(Td,{ux:"parameter"},function(){return this.Fv},function(a){this.Fv=a});w.g(Td,"cancel",Td.prototype.cancel);
  w.defineProperty(Td,{cancel:"cancel"},function(){return this.Bu},function(a){this.Bu=a});function Ud(){this.mq=fe;this.mm=this.vv="";this.Jr=this.Kr=this.Qr=this.Rr=this.Pr=this.Y=this.Ud=null}w.ja("ChangedEvent",Ud);var ge;Ud.Transaction=ge=w.w(Ud,"Transaction",-1);var fe;Ud.Property=fe=w.w(Ud,"Property",0);var he;Ud.Insert=he=w.w(Ud,"Insert",1);var ie;Ud.Remove=ie=w.w(Ud,"Remove",2);Ud.prototype.clear=Ud.prototype.clear=function(){this.Jr=this.Kr=this.Qr=this.Rr=this.Pr=this.Y=this.Ud=null};
  Ud.prototype.copy=function(){var a=new Ud;a.Ud=this.Ud;a.Y=this.Y;a.mq=this.mq;a.vv=this.vv;a.mm=this.mm;a.Pr=this.Pr;var b=this.Rr;a.Rr=w.Xa(b)&&"function"===typeof b.ba?b.ba():b;b=this.Qr;a.Qr=w.Xa(b)&&"function"===typeof b.ba?b.ba():b;b=this.Kr;a.Kr=w.Xa(b)&&"function"===typeof b.ba?b.ba():b;b=this.Jr;a.Jr=w.Xa(b)&&"function"===typeof b.ba?b.ba():b;return a};
  Ud.prototype.toString=function(){var a="",a=this.sd===ge?a+"* ":this.sd===fe?a+(null!==this.fa?"!m":"!d"):a+((null!==this.fa?"!m":"!d")+this.sd);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.Bf&&this.Bf!==this.propertyName&&(a+=" "+this.Bf);a+=": ";this.sd===ge?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=je(this.object)),null!==this.oldValue&&(a+="  old: "+je(this.oldValue)),null!==this.Yf&&(a+=" "+this.Yf),null!==this.newValue&&
  (a+="  new: "+je(this.newValue)),null!==this.Wf&&(a+=" "+this.Wf));return a};Ud.prototype.getValue=Ud.prototype.Aa=function(a){return a?this.oldValue:this.newValue};Ud.prototype.getParam=function(a){return a?this.Yf:this.Wf};Ud.prototype.canUndo=Ud.prototype.canUndo=function(){return null!==this.fa||null!==this.h?!0:!1};Ud.prototype.undo=Ud.prototype.undo=function(){this.canUndo()&&(null!==this.fa?this.fa.Im(this,!0):null!==this.h&&this.h.Im(this,!0))};
  Ud.prototype.canRedo=Ud.prototype.canRedo=function(){return null!==this.fa||null!==this.h?!0:!1};Ud.prototype.redo=Ud.prototype.redo=function(){this.canRedo()&&(null!==this.fa?this.fa.Im(this,!1):null!==this.h&&this.h.Im(this,!1))};w.g(Ud,"model",Ud.prototype.fa);w.defineProperty(Ud,{fa:"model"},function(){return this.Ud},function(a){this.Ud=a});w.g(Ud,"diagram",Ud.prototype.h);w.defineProperty(Ud,{h:"diagram"},function(){return this.Y},function(a){this.Y=a});w.g(Ud,"change",Ud.prototype.sd);
  w.defineProperty(Ud,{sd:"change"},function(){return this.mq},function(a){t&&w.za(a,Ud,Ud,"change");this.mq=a});w.g(Ud,"modelChange",Ud.prototype.Bf);w.defineProperty(Ud,{Bf:"modelChange"},function(){return this.vv},function(a){t&&w.i(a,"string",Ud,"modelChange");this.vv=a});w.g(Ud,"propertyName",Ud.prototype.propertyName);w.defineProperty(Ud,{propertyName:"propertyName"},function(){return this.mm},function(a){t&&"string"!==typeof a&&w.i(a,"function",Ud,"propertyName");this.mm=a});
  w.g(Ud,"isTransactionFinished",Ud.prototype.cJ);w.A(Ud,{cJ:"isTransactionFinished"},function(){return this.mq===ge&&("CommittedTransaction"===this.mm||"FinishedUndo"===this.mm||"FinishedRedo"===this.mm)});w.g(Ud,"object",Ud.prototype.object);w.defineProperty(Ud,{object:"object"},function(){return this.Pr},function(a){this.Pr=a});w.g(Ud,"oldValue",Ud.prototype.oldValue);w.defineProperty(Ud,{oldValue:"oldValue"},function(){return this.Rr},function(a){this.Rr=a});w.g(Ud,"oldParam",Ud.prototype.Yf);
  w.defineProperty(Ud,{Yf:"oldParam"},function(){return this.Qr},function(a){this.Qr=a});w.g(Ud,"newValue",Ud.prototype.newValue);w.defineProperty(Ud,{newValue:"newValue"},function(){return this.Kr},function(a){this.Kr=a});w.g(Ud,"newParam",Ud.prototype.Wf);w.defineProperty(Ud,{Wf:"newParam"},function(){return this.Jr},function(a){this.Jr=a});
  function I(a){1<arguments.length&&w.m("Model constructor can only take one optional argument, the Array of node data.");w.jc(this);this.vy=this.Xb="";this.Nk=!1;this.$y={};this.sf=[];this.zc=new ia(null,Object);this.im="key";this.Gu=this.ov=null;this.my=this.ny=!1;this.Lr="category";this.vh=new ia(null,F);this.tj=null;this.yi=!1;this.Az=null;this.ka=new ke;void 0!==a&&(this.Fg=a)}w.ja("Model",I);I.prototype.clear=I.prototype.clear=function(){this.sf=[];this.zc.clear();this.vh.clear();this.ka.clear()};
  f=I.prototype;f.iu=function(){var a="";""!==this.name&&(a+=',\n  "name": '+this.quote(this.name));""!==this.Wj&&(a+=',\n  "dataFormat": '+this.quote(this.Wj));this.hb&&(a+=',\n  "isReadOnly": '+this.hb);"key"!==this.Vi&&"string"===typeof this.Vi&&(a+=',\n  "nodeKeyProperty": '+this.quote(this.Vi));this.vw&&(a+=',\n  "copiesArrays": true');this.uw&&(a+=',\n  "copiesArrayObjects": true');"category"!==this.xl&&"string"===typeof this.xl&&(a+=',\n  "nodeCategoryProperty": '+this.quote(this.xl));return a};
  f.wB=function(){var a="",b=this.yp,c=!1,d;for(d in b)if(!le(d,b[d])){c=!0;break}c&&(a=',\n  "modelData": '+ve(this,b));return a+',\n  "nodeDataArray": '+we(this,this.Fg,!0)};f.St=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Wj=a.dataFormat);a.isReadOnly&&(this.hb=a.isReadOnly);a.nodeKeyProperty&&(this.Vi=a.nodeKeyProperty);a.copiesArrays&&(this.vw=a.copiesArrays);a.copiesArrayObjects&&(this.uw=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.xl=a.nodeCategoryProperty)};
  f.PA=function(a){var b=a.modelData;w.Xa(b)&&(this.Ut(b),this.yp=b);a=a.nodeDataArray;w.isArray(a)&&(this.Ut(a),this.Fg=a)};f.toString=function(a){void 0===a&&(a=0);if(1<a)return this.pB();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.Fg;for(var c=w.vb(a),d=0;d<c;d++)var e=w.jb(a,d),b=b+(" "+this.Cb(e)+":"+je(e))}return b};
  I.prototype.toJson=I.prototype.toJSON=I.prototype.pB=function(a){void 0===a&&(a=this.constructor===I?"go.Model":this.constructor===R?"go.GraphLinksModel":this.constructor===xe?"go.TreeModel":w.yg(this));return'{ "class": '+this.quote(a)+this.iu()+this.wB()+"}"};
  I.fromJson=I.fromJSON=function(a,b){void 0===b&&(b=null);null!==b&&w.l(b,I,I,"fromJson:model");var c=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){t&&w.trace("JSON.parse error: "+d.toString())}else w.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:w.m("Unable to construct a Model from: "+a);if(null===b){var e;e=null;var g=c["class"];if("string"===typeof g)try{var h=null;0===g.indexOf("go.")?(g=g.substr(3),h=aa[g]):(h=aa[g],
  void 0===h&&(h=window[g]));"function"===typeof h&&(e=new h)}catch(k){}null===e||e instanceof I?b=e:w.m("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new R);b.St(c);b.PA(c);return b};
  I.prototype.replaceJsonObjects=I.prototype.Ut=function(a){if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++){var d=w.jb(a,c);w.Xa(d)&&w.SD(a,c,this.Ut(d))}else if(w.Xa(a)){for(c in a)if(d=a[c],w.Xa(d)&&(d=this.Ut(d),a[c]=d,"points"===c&&Array.isArray(d))){for(var e=0===d.length%2,g=0;g<d.length;g++)if("number"!==typeof d[g]){e=!1;break}if(e){e=new D(x);for(g=0;g<d.length/2;g++){var h=new x(d[2*g],d[2*g+1]);e.add(h)}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 x(ye(a.x),ye(a.y));else if("go.Size"===d)c=new fa(ye(a.width),ye(a.height));else if("go.Rect"===d)c=new y(ye(a.x),ye(a.y),ye(a.width),ye(a.height));else if("go.Margin"===d)c=new eb(ye(a.top),ye(a.right),ye(a.bottom),ye(a.left));else if("go.Spot"===d)c="string"===typeof a["enum"]?xb(a["enum"]):new K(ye(a.x),ye(a.y),ye(a.offsetX),ye(a.offsetY));else if("go.Brush"===d){if(c=new ea,c.type=ya(ea,a.type),a.start instanceof K&&(c.start=a.start),a.end instanceof
  K&&(c.end=a.end),"number"===typeof a.startRadius&&(c.Tp=ye(a.startRadius)),"number"===typeof a.endRadius&&(c.To=ye(a.endRadius)),a=a.colorStops,w.Xa(a))for(b in a)c.addColorStop(parseFloat(b),a[b])}else"go.Geometry"===d&&(b=null,b="string"===typeof a.path?xd(a.path):new ed,b.type=ya(ed,a.type),"number"===typeof a.startX&&(b.ra=ye(a.startX)),"number"===typeof a.startY&&(b.sa=ye(a.startY)),"number"===typeof a.endX&&(b.D=ye(a.endX)),"number"===typeof a.endY&&(b.F=ye(a.endY)),a.spot1 instanceof K&&(b.G=
  a.spot1),a.spot2 instanceof K&&(b.H=a.spot2),c=b);a=c}}return a};I.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+'"'};
  I.prototype.writeJsonValue=I.prototype.ju=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.ju(a.valueOf()):w.isArray(a)?we(this,a):w.Xa(a)?ve(this,a):"function"===typeof a?"null":a.toString()};
  function we(a,b,c){void 0===c&&(c=!1);var d=w.vb(b);if(0>=d)return"[]";var e=new xa;e.add("[ ");c&&1<d&&e.add("\n");for(var g=0;g<d;g++){var h=w.jb(b,g);void 0!==h&&(0<g&&(e.add(","),c&&e.add("\n")),e.add(a.ju(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function le(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function ze(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
  function ve(a,b){var c=b;if(c instanceof x){var d=c;b={"class":"go.Point",x:ze(d.x),y:ze(d.y)}}else if(c instanceof fa){var e=c;b={"class":"go.Size",width:ze(e.width),height:ze(e.height)}}else if(c instanceof y)b={"class":"go.Rect",x:ze(c.x),y:ze(c.y),width:ze(c.width),height:ze(c.height)};else if(c instanceof eb)b={"class":"go.Margin",top:ze(c.top),right:ze(c.right),bottom:ze(c.bottom),left:ze(c.left)};else if(c instanceof K)e=c,b=e.kd()?{"class":"go.Spot",x:ze(e.x),y:ze(e.y),offsetX:ze(e.offsetX),
  offsetY:ze(e.offsetY)}:{"class":"go.Spot","enum":e.toString()};else if(c instanceof ea){b={"class":"go.Brush",type:c.type.name};if(c.type===Ae)b.color=c.color;else if(c.type===Be||c.type===Ce)b.start=c.start,b.end=c.end,c.type===Ce&&(0!==c.Tp&&(b.startRadius=ze(c.Tp)),isNaN(c.To)||(b.endRadius=ze(c.To)));if(null!==c.No){for(var g={},h=c.No.k;h.next();)g[h.key]=h.value;b.colorStops=g}}else if(c instanceof ed)b={"class":"go.Geometry",type:c.type.name},0!==c.ra&&(b.startX=ze(c.ra)),0!==c.sa&&(b.startY=
  ze(c.sa)),0!==c.D&&(b.endX=ze(c.D)),0!==c.F&&(b.endY=ze(c.F)),c.G.L(Ab)||(b.spot1=c.G),c.H.L(Wb)||(b.spot2=c.H),c.type===fd&&(b.path=nd(c));else if(c instanceof P||c instanceof C||c instanceof De||c instanceof I||c instanceof Qe||c instanceof qa||c instanceof Re||c instanceof ta||c instanceof ke||c instanceof Se)return w.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+c.toString()),"{}";g="{";c=!0;for(d in b)if(e=w.xb(b,d),!le(d,
  e))if(c?c=!1:g+=", ",g+='"'+d+'":',"points"===d&&e instanceof D&&e.ha===x){h=e;e="[";for(h=h.k;h.next();){var k=h.value;1<e.length&&(e+=",");e+=a.ju(k.x);e+=",";e+=a.ju(k.y)}e+="]";g+=e}else g+=a.ju(e);return g+"}"}function ye(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}w.g(I,"name",I.prototype.name);
  w.defineProperty(I,{name:"name"},function(){return this.Xb},function(a){var b=this.Xb;b!==a&&(w.i(a,"string",I,"name"),this.Xb=a,this.j("name",b,a))});w.g(I,"dataFormat",I.prototype.Wj);w.defineProperty(I,{Wj:"dataFormat"},function(){return this.vy},function(a){var b=this.vy;b!==a&&(w.i(a,"string",I,"dataFormat"),this.vy=a,this.j("dataFormat",b,a))});w.g(I,"isReadOnly",I.prototype.hb);
  w.defineProperty(I,{hb:"isReadOnly"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(w.i(a,"boolean",I,"isReadOnly"),this.Nk=a,this.j("isReadOnly",b,a))});w.g(I,"modelData",I.prototype.yp);w.defineProperty(I,{yp:"modelData"},function(){return this.$y},function(a){var b=this.$y;b!==a&&(w.i(a,"object",I,"modelData"),this.$y=a,this.j("modelData",b,a),this.Rb(a))});
  I.prototype.addChangedListener=I.prototype.Hz=function(a){w.i(a,"function",I,"addChangedListener:listener");null===this.tj&&(this.tj=new D("function"));this.tj.add(a)};I.prototype.removeChangedListener=I.prototype.TA=function(a){w.i(a,"function",I,"removeChangedListener:listener");null!==this.tj&&(this.tj.remove(a),0===this.tj.count&&(this.tj=null))};
  I.prototype.nw=function(a){this.$a||this.ka.VE(a);if(null!==this.tj){var b=this.tj,c=b.length;if(1===c)b=b.na(0),b(a);else if(0!==c)for(var d=b.Ue(),e=0;e<c;e++)b=d[e],b(a)}};I.prototype.raiseChangedEvent=I.prototype.Hc=function(a,b,c,d,e,g,h){Te(this,"",a,b,c,d,e,g,h)};I.prototype.raiseChanged=I.prototype.j=function(a,b,c,d,e){Te(this,"",fe,a,this,b,c,d,e)};I.prototype.raiseDataChanged=I.prototype.OA=function(a,b,c,d,e,g){Te(this,"",fe,b,a,c,d,e,g)};
  function Te(a,b,c,d,e,g,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new Ud;m.fa=a;m.sd=c;m.Bf=b;m.propertyName=d;m.object=e;m.oldValue=g;m.Yf=k;m.newValue=h;m.Wf=l;a.nw(m)}w.g(I,"undoManager",I.prototype.ka);w.defineProperty(I,{ka:"undoManager"},function(){return this.Az},function(a){var b=this.Az;b!==a&&(w.l(a,ke,I,"undoManager"),null!==b&&b.LJ(this),this.Az=a,null!==a&&a.IH(this))});w.g(I,"skipsUndoManager",I.prototype.$a);
  w.defineProperty(I,{$a:"skipsUndoManager"},function(){return this.yi},function(a){w.i(a,"boolean",I,"skipsUndoManager");this.yi=a});
  I.prototype.Im=function(a,b){if(null!==a&&a.fa===this)if(a.sd===fe){var c=a.object,d=a.propertyName,e=a.Aa(b);w.Sa(c,d,e)}else a.sd===he?"nodeDataArray"===a.Bf?(c=a.newValue,w.Xa(c)&&(d=this.Cb(c),void 0!==d&&(b?(w.Ji(this.sf,a.Wf),this.zc.remove(d)):(w.Ii(this.sf,a.Wf,c),this.zc.add(d,c))))):""===a.Bf?(c=a.object,!w.isArray(c)&&a.propertyName&&(c=w.xb(a.object,a.propertyName)),w.isArray(c)&&(d=a.newValue,e=a.Wf,b?w.Ji(c,e):w.Ii(c,e,d))):w.m("unknown ChangedEvent.Insert object: "+a.toString()):a.sd===
  ie?"nodeDataArray"===a.Bf?(c=a.oldValue,w.Xa(c)&&(d=this.Cb(c),void 0!==d&&(b?(w.Ii(this.sf,a.Yf,c),this.zc.add(d,c)):(w.Ji(this.sf,a.Yf),this.zc.remove(d))))):""===a.Bf?(c=a.object,!w.isArray(c)&&a.propertyName&&(c=w.xb(a.object,a.propertyName)),w.isArray(c)&&(d=a.oldValue,e=a.Yf,b?w.Ii(c,e,d):w.Ji(c,e))):w.m("unknown ChangedEvent.Remove object: "+a.toString()):a.sd!==ge&&w.m("unknown ChangedEvent: "+a.toString())};I.prototype.startTransaction=I.prototype.ac=function(a){return this.ka.ac(a)};
  I.prototype.commitTransaction=I.prototype.ae=function(a){return this.ka.ae(a)};I.prototype.rollbackTransaction=I.prototype.Lp=function(){return this.ka.Lp()};I.prototype.updateTargetBindings=I.prototype.Rb=function(a,b){void 0===b&&(b="");Te(this,"SourceChanged",ge,b,a,null,null)};w.g(I,"nodeKeyProperty",I.prototype.Vi);
  w.defineProperty(I,{Vi:"nodeKeyProperty"},function(){return this.im},function(a){var b=this.im;b!==a&&(Ue(a,I,"nodeKeyProperty"),0<this.zc.count&&w.m("Cannot set Model.nodeKeyProperty when there is existing node data"),this.im=a,this.j("nodeKeyProperty",b,a))});function Ue(a,b,c){"string"!==typeof a&&"function"!==typeof a&&w.sc(a,"string or function",b,c)}
  I.prototype.getKeyForNodeData=I.prototype.Cb=function(a){if(null!==a){var b=this.im;if(""!==b&&(b=w.xb(a,b),void 0!==b)){if(Ve(b))return b;w.m("Key value for node data "+a+" is not a number or a string: "+b)}}};
  I.prototype.setKeyForNodeData=I.prototype.hB=function(a,b){void 0!==b&&null!==b&&Ve(b)||w.sc(b,"number or string",I,"setKeyForNodeData:key");if(null!==a){var c=this.im;if(""!==c)if(this.pe(a)){var d=w.xb(a,c);d!==b&&null===this.wf(b)&&(w.Sa(a,c,b),this.zc.remove(d),this.zc.add(b,a),Te(this,"nodeKey",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c),this.Tt(d,b))}else w.Sa(a,c,b)}};w.g(I,"makeUniqueKeyFunction",I.prototype.nJ);
  w.defineProperty(I,{nJ:"makeUniqueKeyFunction"},function(){return this.ov},function(a){var b=this.ov;b!==a&&(null!==a&&w.i(a,"function",I,"makeUniqueKeyFunction"),this.ov=a,this.j("makeUniqueKeyFunction",b,a))});function Ve(a){return"number"===typeof a||"string"===typeof a}I.prototype.containsNodeData=I.prototype.pe=function(a){a=this.Cb(a);return void 0===a?!1:this.zc.contains(a)};
  I.prototype.findNodeDataForKey=I.prototype.wf=function(a){null===a&&w.m("Model.findNodeDataForKey:key must not be null");return void 0!==a&&Ve(a)?this.zc.Aa(a):null};w.g(I,"nodeDataArray",I.prototype.Fg);
  w.defineProperty(I,{Fg:"nodeDataArray"},function(){return this.sf},function(a){var b=this.sf;if(b!==a){w.$s(a,I,"nodeDataArray");this.zc.clear();this.sB();for(var c=w.vb(a),d=0;d<c;d++){var e=w.jb(a,d);if(!w.Xa(e)){w.m("Model.nodeDataArray must only contain Objects, not: "+e);return}w.tt(e)}this.sf=a;for(var g=new D(Object),d=0;d<c;d++){var e=w.jb(a,d),h=this.Cb(e);void 0===h?g.add(e):null!==this.zc.Aa(h)?g.add(e):this.zc.add(h,e)}for(d=g.k;d.next();)e=d.value,this.yF(e),g=this.Cb(e),void 0!==g&&
  this.zc.add(g,e);Te(this,"nodeDataArray",fe,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=w.jb(a,d),this.Kp(e),this.Jp(e);this.$D();w.$I(a)||(this.hb=!0)}});
  I.prototype.makeNodeDataKeyUnique=I.prototype.yF=function(a){if(null!==a){var b=this.im;if(""!==b){var c=this.Cb(a);if(void 0===c||this.zc.contains(c)){var d=this.ov;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.zc.contains(c))){w.Sa(a,b,c);return}if("string"===typeof c){for(d=2;this.zc.contains(c+d);)d++;w.Sa(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.zc.count-1;this.zc.contains(d);)d--;w.Sa(a,b,d)}else w.m("Model.getKeyForNodeData returned something other than a string or a number: "+
  c)}}}};I.prototype.addNodeData=I.prototype.Am=function(a){if(null!==a){w.tt(a);var b=this.Cb(a);if(void 0===b||this.zc.Aa(b)!==a)this.yF(a),b=this.Cb(a),void 0===b?w.m("Model.makeNodeDataKeyUnique failed on "+a+".  Data not added to Model."):(this.zc.add(b,a),b=w.vb(this.sf),w.Ii(this.sf,b,a),Te(this,"nodeDataArray",he,"nodeDataArray",this,null,a,null,b),this.Kp(a),this.Jp(a))}};
  I.prototype.addNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++)this.Am(w.jb(a,c));else for(a=a.k;a.next();)this.Am(a.value)};I.prototype.removeNodeData=I.prototype.VA=function(a){if(null!==a){var b=this.Cb(a);void 0!==b&&this.zc.contains(b)&&(this.zc.remove(b),b=w.Pz(this.sf,a),0>b||(w.Ji(this.sf,b),Te(this,"nodeDataArray",ie,"nodeDataArray",this,a,null,b,null),this.hu(a)))}};
  I.prototype.removeNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++)this.VA(w.jb(a,c));else for(a=a.k;a.next();)this.VA(a.value)};f=I.prototype;f.Tt=function(a,b){var c=We(this,a);c instanceof F&&this.vh.add(b,c)};f.sB=function(){};f.Kp=function(){};f.Jp=function(){};f.hu=function(){};function Xe(a,b,c){if(void 0!==b){var d=a.vh.Aa(b);null===d&&(d=new F(Object),a.vh.add(b,d));d.add(c)}}
  function Ye(a,b,c){if(void 0!==b){var d=a.vh.Aa(b);d instanceof F&&(void 0===c||null===c?a.vh.remove(b):(d.remove(c),0===d.count&&a.vh.remove(b)))}}function We(a,b){if(void 0===b)return null;var c=a.vh.Aa(b);return c instanceof F?c:null}I.prototype.clearUnresolvedReferences=I.prototype.$D=function(a){void 0===a?this.vh.clear():this.vh.remove(a)};w.g(I,"copyNodeDataFunction",I.prototype.lI);
  w.defineProperty(I,{lI:"copyNodeDataFunction"},function(){return this.Gu},function(a){var b=this.Gu;b!==a&&(null!==a&&w.i(a,"function",I,"copyNodeDataFunction"),this.Gu=a,this.j("copyNodeDataFunction",b,a))});w.g(I,"copiesArrays",I.prototype.vw);w.defineProperty(I,{vw:"copiesArrays"},function(){return this.ny},function(a){var b=this.ny;b!==a&&(null!==a&&w.i(a,"boolean",I,"copiesArrays"),this.ny=a,this.j("copiesArrays",b,a))});w.g(I,"copiesArrayObjects",I.prototype.uw);
  w.defineProperty(I,{uw:"copiesArrayObjects"},function(){return this.my},function(a){var b=this.my;b!==a&&(null!==a&&w.i(a,"boolean",I,"copiesArrayObjects"),this.my=a,this.j("copiesArrayObjects",b,a))});I.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.Gu,b=null!==b?b(a,this):Ze(this,a,!0);w.Xa(b)&&w.jc(b);return b};
  function Ze(a,b,c){if(a.vw&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Ze(a,b[c],a.uw);d.push(e)}w.jc(d);return d}if(c&&w.Xa(b)){c=(c=b.constructor)?new c:{};for(d in b)"__gohashid"!==d&&(e=w.xb(b,d),$e(b,d,e)||(e=Ze(a,e,!1)),w.Sa(c,d,e));w.jc(c);return c}return b}
  function $e(a,b,c){return c instanceof P||c instanceof C||c instanceof De||c instanceof af||c instanceof gf||c instanceof Qe||c instanceof qa||c instanceof Re||c instanceof Sd||c instanceof Td?("_"!==b[0]&&w.trace('Warning: found GraphObject or Diagram reference when copying model data on property "'+b+'" of data object: '+a.toString()+"  \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+c.toString()),!0):c instanceof I||c instanceof ke||c instanceof Se||
  c instanceof Ud?!0:!1}var hf=!1;
  I.prototype.setDataProperty=function(a,b,c){t&&(w.i(a,"object",I,"setDataProperty:data"),w.i(b,"string",I,"setDataProperty:propname"),""===b&&w.m("Model.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.pe(a))if(b===this.Vi)this.hB(a,c);else{if(b===this.xl){this.zx(a,c);return}}else!hf&&a instanceof P&&(hf=!0,w.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),w.trace("  Is that really your intent?"));var d=w.xb(a,b);d!==c&&
  (w.Sa(a,b,c),this.OA(a,b,d,c))};I.prototype.addArrayItem=function(a,b){this.XI(a,-1,b)};I.prototype.insertArrayItem=I.prototype.XI=function(a,b,c){t&&(w.$s(a,I,"insertArrayItem:arr"),w.p(b,I,"insertArrayItem:idx"));a===this.sf&&w.m("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=w.vb(a));w.Ii(a,b,c);Te(this,"",he,"",a,null,c,null,b)};
  I.prototype.removeArrayItem=function(a,b){void 0===b&&(b=-1);t&&(w.$s(a,I,"removeArrayItem:arr"),w.p(b,I,"removeArrayItem:idx"));a===this.sf&&w.m("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=w.vb(a)-1);var c=w.jb(a,b);w.Ji(a,b);Te(this,"",ie,"",a,c,null,b,null)};w.g(I,"nodeCategoryProperty",I.prototype.xl);
  w.defineProperty(I,{xl:"nodeCategoryProperty"},function(){return this.Lr},function(a){var b=this.Lr;b!==a&&(Ue(a,I,"nodeCategoryProperty"),this.Lr=a,this.j("nodeCategoryProperty",b,a))});I.prototype.getCategoryForNodeData=I.prototype.eA=function(a){if(null===a)return"";var b=this.Lr;if(""===b)return"";b=w.xb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.m("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
  I.prototype.setCategoryForNodeData=I.prototype.zx=function(a,b){w.i(b,"string",I,"setCategoryForNodeData:cat");if(null!==a){var c=this.Lr;if(""!==c)if(this.pe(a)){var d=w.xb(a,c);void 0===d&&(d="");d!==b&&(w.Sa(a,c,b),Te(this,"nodeCategory",fe,c,a,d,b))}else w.Sa(a,c,b)}};
  function R(a,b){2<arguments.length&&w.m("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");I.call(this);this.Dh=[];this.fm=new F(Object);this.Ak=this.Fu=null;this.pj="from";this.sj="to";this.pr=this.or="";this.lr="category";this.Eh="";this.yv="isGroup";this.zj="group";this.oy=!1;void 0!==a&&(this.Fg=a);void 0!==b&&(this.Ui=b)}w.Ia(R,I);w.ja("GraphLinksModel",R);
  R.prototype.clear=R.prototype.clear=function(){I.prototype.clear.call(this);this.Dh=[];this.fm.clear()};f=R.prototype;f.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.pB();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.Fg;for(var c=w.vb(a),d=0,d=0;d<c;d++)var e=w.jb(a,d),b=b+(" "+this.Cb(e)+":"+je(e));b+="\n link data:";a=this.Ui;c=w.vb(a);for(d=0;d<c;d++)e=w.jb(a,d),b+=" "+this.nl(e)+"--\x3e"+this.ql(e)}return b};
  f.iu=function(){var a=I.prototype.iu.call(this),b="";"category"!==this.np&&"string"===typeof this.np&&(b+=',\n  "linkCategoryProperty": '+this.quote(this.np));"from"!==this.$m&&"string"===typeof this.$m&&(b+=',\n  "linkFromKeyProperty": '+this.quote(this.$m));"to"!==this.an&&"string"===typeof this.an&&(b+=',\n  "linkToKeyProperty": '+this.quote(this.an));""!==this.op&&"string"===typeof this.op&&(b+=',\n  "linkFromPortIdProperty": '+this.quote(this.op));""!==this.sp&&"string"===typeof this.sp&&(b+=
  ',\n  "linkToPortIdProperty": '+this.quote(this.sp));""!==this.pp&&"string"===typeof this.pp&&(b+=',\n  "linkLabelKeysProperty": '+this.quote(this.pp));"isGroup"!==this.Gp&&"string"===typeof this.Gp&&(b+=',\n  "nodeIsGroupProperty": '+this.quote(this.Gp));"group"!==this.dn&&"string"===typeof this.dn&&(b+=',\n  "nodeGroupKeyProperty": '+this.quote(this.dn));return a+b};f.wB=function(){var a=I.prototype.wB.call(this),b=',\n  "linkDataArray": '+we(this,this.Ui,!0);return a+b};
  f.St=function(a){I.prototype.St.call(this,a);a.linkFromKeyProperty&&(this.$m=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.an=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.op=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.sp=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.np=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.pp=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.Gp=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&(this.dn=a.nodeGroupKeyProperty)};
  f.PA=function(a){I.prototype.PA.call(this,a);a=a.linkDataArray;w.isArray(a)&&(this.Ut(a),this.Ui=a)};f.Im=function(a,b){var c=null;if(a.sd===he){if("linkDataArray"===a.Bf?c=this.Dh:"linkLabelKeys"===a.Bf&&(c=this.fk(a.object)),w.isArray(c)){b?w.Ji(c,a.Wf):w.Ii(c,a.Wf,a.newValue);return}}else if(a.sd===ie&&("linkDataArray"===a.Bf?c=this.Dh:"linkLabelKeys"===a.Bf&&(c=this.fk(a.object)),w.isArray(c))){b?w.Ii(c,a.Yf,a.oldValue):w.Ji(c,a.Yf);return}I.prototype.Im.call(this,a,b)};
  w.g(R,"archetypeNodeData",R.prototype.Xs);w.defineProperty(R,{Xs:"archetypeNodeData"},function(){return this.Ak},function(a){var b=this.Ak;b!==a&&(null!==a&&w.l(a,Object,R,"archetypeNodeData"),this.Ak=a,this.j("archetypeNodeData",b,a))});R.prototype.bn=function(a){if(void 0!==a){var b=this.Ak;if(null!==b){var c=this.wf(a);null===c&&(c=this.copyNodeData(b),w.Sa(c,this.im,a),this.Am(c))}return a}};w.g(R,"linkFromKeyProperty",R.prototype.$m);
  w.defineProperty(R,{$m:"linkFromKeyProperty"},function(){return this.pj},function(a){var b=this.pj;b!==a&&(Ue(a,R,"linkFromKeyProperty"),this.pj=a,this.j("linkFromKeyProperty",b,a))});R.prototype.getFromKeyForLinkData=R.prototype.nl=function(a){if(null!==a){var b=this.pj;if(""!==b&&(b=w.xb(a,b),void 0!==b)){if(Ve(b))return b;w.m("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
  R.prototype.setFromKeyForLinkData=R.prototype.Ax=function(a,b){null===b&&(b=void 0);void 0===b||Ve(b)||w.sc(b,"number or string",R,"setFromKeyForLinkData:key");if(null!==a){var c=this.pj;if(""!==c)if(b=this.bn(b),this.Mi(a)){var d=w.xb(a,c);d!==b&&(Ye(this,d,a),w.Sa(a,c,b),null===this.wf(b)&&Xe(this,b,a),Te(this,"linkFromKey",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};w.g(R,"linkToKeyProperty",R.prototype.an);
  w.defineProperty(R,{an:"linkToKeyProperty"},function(){return this.sj},function(a){var b=this.sj;b!==a&&(Ue(a,R,"linkToKeyProperty"),this.sj=a,this.j("linkToKeyProperty",b,a))});R.prototype.getToKeyForLinkData=R.prototype.ql=function(a){if(null!==a){var b=this.sj;if(""!==b&&(b=w.xb(a,b),void 0!==b)){if(Ve(b))return b;w.m("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
  R.prototype.setToKeyForLinkData=R.prototype.Cx=function(a,b){null===b&&(b=void 0);void 0===b||Ve(b)||w.sc(b,"number or string",R,"setToKeyForLinkData:key");if(null!==a){var c=this.sj;if(""!==c)if(b=this.bn(b),this.Mi(a)){var d=w.xb(a,c);d!==b&&(Ye(this,d,a),w.Sa(a,c,b),null===this.wf(b)&&Xe(this,b,a),Te(this,"linkToKey",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};w.g(R,"linkFromPortIdProperty",R.prototype.op);
  w.defineProperty(R,{op:"linkFromPortIdProperty"},function(){return this.or},function(a){var b=this.or;b!==a&&(Ue(a,R,"linkFromPortIdProperty"),this.or=a,this.j("linkFromPortIdProperty",b,a))});R.prototype.getFromPortIdForLinkData=R.prototype.LI=function(a){if(null===a)return"";var b=this.or;if(""===b)return"";a=w.xb(a,b);return void 0===a?"":a};
  R.prototype.setFromPortIdForLinkData=R.prototype.gB=function(a,b){w.i(b,"string",R,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.or;if(""!==c)if(this.Mi(a)){var d=w.xb(a,c);void 0===d&&(d="");d!==b&&(w.Sa(a,c,b),Te(this,"linkFromPortId",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};w.g(R,"linkToPortIdProperty",R.prototype.sp);
  w.defineProperty(R,{sp:"linkToPortIdProperty"},function(){return this.pr},function(a){var b=this.pr;b!==a&&(Ue(a,R,"linkToPortIdProperty"),this.pr=a,this.j("linkToPortIdProperty",b,a))});R.prototype.getToPortIdForLinkData=R.prototype.OI=function(a){if(null===a)return"";var b=this.pr;if(""===b)return"";a=w.xb(a,b);return void 0===a?"":a};
  R.prototype.setToPortIdForLinkData=R.prototype.kB=function(a,b){w.i(b,"string",R,"setToPortIdForLinkData:portname");if(null!==a){var c=this.pr;if(""!==c)if(this.Mi(a)){var d=w.xb(a,c);void 0===d&&(d="");d!==b&&(w.Sa(a,c,b),Te(this,"linkToPortId",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};w.g(R,"linkLabelKeysProperty",R.prototype.pp);
  w.defineProperty(R,{pp:"linkLabelKeysProperty"},function(){return this.Eh},function(a){var b=this.Eh;b!==a&&(Ue(a,R,"linkLabelKeysProperty"),this.Eh=a,this.j("linkLabelKeysProperty",b,a))});R.prototype.getLabelKeysForLinkData=R.prototype.fk=function(a){if(null===a)return w.nh;var b=this.Eh;if(""===b)return w.nh;a=w.xb(a,b);return void 0===a?w.nh:a};
  R.prototype.setLabelKeysForLinkData=R.prototype.uG=function(a,b){w.$s(b,R,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Eh;if(""!==c)if(this.Mi(a)){var d=w.xb(a,c);void 0===d&&(d=w.nh);if(d!==b){for(var e=w.vb(d),g=0;g<e;g++){var h=w.jb(d,g);Ye(this,h,a)}w.Sa(a,c,b);e=w.vb(b);for(g=0;g<e;g++)h=w.jb(b,g),null===this.wf(h)&&Xe(this,h,a);Te(this,"linkLabelKeys",fe,c,a,d,b);"string"===typeof c&&this.Rb(a,c)}}else w.Sa(a,c,b)}};
  R.prototype.addLabelKeyForLinkData=R.prototype.Jz=function(a,b){if(null!==b&&void 0!==b&&(Ve(b)||w.sc(b,"number or string",R,"addLabelKeyForLinkData:key"),null!==a)){var c=this.Eh;if(""!==c){var d=w.xb(a,c);void 0===d?(c=[],c.push(b),this.uG(a,c)):w.isArray(d)?0<=w.Pz(d,b)||(w.Ii(d,Infinity,b),this.Mi(a)&&(null===this.wf(b)&&Xe(this,b,a),Te(this,"linkLabelKeys",he,c,a,null,b))):w.m(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
  R.prototype.removeLabelKeyForLinkData=R.prototype.YF=function(a,b){if(null!==b&&void 0!==b&&(Ve(b)||w.sc(b,"number or string",R,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.Eh;if(""!==c){var d=w.xb(a,c);if(w.isArray(d)){var e=w.Pz(d,b);0>e||(w.Ji(d,e),this.Mi(a)&&(Ye(this,b,a),Te(this,"linkLabelKeys",ie,c,a,b,null)))}else void 0!==d&&w.m(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};w.g(R,"linkDataArray",R.prototype.Ui);
  w.defineProperty(R,{Ui:"linkDataArray"},function(){return this.Dh},function(a){var b=this.Dh;if(b!==a){w.$s(a,R,"linkDataArray");for(var c=w.vb(a),d=0;d<c;d++){var e=w.jb(a,d);if(!w.Xa(e)){w.m("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}w.tt(e)}this.Dh=a;for(var g=new F(Object),d=0;d<c;d++)e=w.jb(a,d),g.add(e);this.fm=g;Te(this,"linkDataArray",fe,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=w.jb(a,d),jf(this,e)}});
  R.prototype.containsLinkData=R.prototype.Mi=function(a){return null===a?!1:this.fm.contains(a)};R.prototype.addLinkData=R.prototype.fw=function(a){if(null!==a){if(void 0===w.Yc(a))w.jc(a);else if(this.Mi(a))return;this.fm.add(a);var b=w.vb(this.Dh);w.Ii(this.Dh,b,a);Te(this,"linkDataArray",he,"linkDataArray",this,null,a,null,b);jf(this,a)}};R.prototype.addLinkDataCollection=function(a){if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++)this.fw(w.jb(a,c));else for(a=a.k;a.next();)this.fw(a.value)};
  R.prototype.removeLinkData=R.prototype.UA=function(a){if(null!==a){this.fm.remove(a);var b=this.Dh.indexOf(a);if(!(0>b)){w.Ji(this.Dh,b);Te(this,"linkDataArray",ie,"linkDataArray",this,a,null,b,null);b=this.nl(a);Ye(this,b,a);b=this.ql(a);Ye(this,b,a);var c=this.fk(a);if(w.isArray(c))for(var d=w.vb(c),e=0;e<d;e++)b=w.jb(c,e),Ye(this,b,a)}}};R.prototype.removeLinkDataCollection=function(a){if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++)this.UA(w.jb(a,c));else for(a=a.k;a.next();)this.UA(a.value)};
  function jf(a,b){var c=a.nl(b),c=a.bn(c);null===a.wf(c)&&Xe(a,c,b);c=a.ql(b);c=a.bn(c);null===a.wf(c)&&Xe(a,c,b);var d=a.fk(b);if(w.isArray(d))for(var e=w.vb(d),g=0;g<e;g++)c=w.jb(d,g),null===a.wf(c)&&Xe(a,c,b)}w.g(R,"copyLinkDataFunction",R.prototype.kI);w.defineProperty(R,{kI:"copyLinkDataFunction"},function(){return this.Fu},function(a){var b=this.Fu;b!==a&&(null!==a&&w.i(a,"function",R,"copyLinkDataFunction"),this.Fu=a,this.j("copyLinkDataFunction",b,a))});
  R.prototype.copyLinkData=R.prototype.nE=function(a){if(null===a)return null;var b=null,b=this.Fu;if(null!==b)b=b(a,this);else{var b=new a.constructor,c;for(c in a)if("__gohashid"!==c){var d=w.xb(a,c);t&&$e(a,c,d);w.Sa(b,c,d)}}null!==b&&(w.jc(b),""!==this.pj&&w.Sa(b,this.pj,void 0),""!==this.sj&&w.Sa(b,this.sj,void 0),""!==this.Eh&&w.Sa(b,this.Eh,[]));return b};w.g(R,"nodeIsGroupProperty",R.prototype.Gp);
  w.defineProperty(R,{Gp:"nodeIsGroupProperty"},function(){return this.yv},function(a){var b=this.yv;b!==a&&(Ue(a,R,"nodeIsGroupProperty"),this.yv=a,this.j("nodeIsGroupProperty",b,a))});R.prototype.isGroupForNodeData=R.prototype.tA=function(a){if(null===a)return!1;var b=this.yv;return""===b?!1:w.xb(a,b)?!0:!1};w.g(R,"nodeGroupKeyProperty",R.prototype.dn);
  w.defineProperty(R,{dn:"nodeGroupKeyProperty"},function(){return this.zj},function(a){var b=this.zj;b!==a&&(Ue(a,R,"nodeGroupKeyProperty"),this.zj=a,this.j("nodeGroupKeyProperty",b,a))});w.g(R,"copiesGroupKeyOfNodeData",R.prototype.gl);w.defineProperty(R,{gl:"copiesGroupKeyOfNodeData"},function(){return this.oy},function(a){this.oy!==a&&(w.i(a,"boolean",R,"copiesGroupKeyOfNodeData"),this.oy=a)});
  R.prototype.getGroupKeyForNodeData=R.prototype.Um=function(a){if(null!==a){var b=this.zj;if(""!==b&&(b=w.xb(a,b),void 0!==b)){if(Ve(b))return b;w.m("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
  R.prototype.setGroupKeyForNodeData=R.prototype.Bx=function(a,b){null===b&&(b=void 0);void 0===b||Ve(b)||w.sc(b,"number or string",R,"setGroupKeyForNodeData:key");if(null!==a){var c=this.zj;if(""!==c)if(this.pe(a)){var d=w.xb(a,c);d!==b&&(Ye(this,d,a),w.Sa(a,c,b),null===this.wf(b)&&Xe(this,b,a),Te(this,"nodeGroupKey",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};
  R.prototype.copyNodeData=function(a){if(null===a)return null;a=I.prototype.copyNodeData.call(this,a);this.gl||""===this.zj||w.Sa(a,this.zj,void 0);return a};
  R.prototype.setDataProperty=function(a,b,c){t&&(w.i(a,"object",R,"setDataProperty:data"),w.i(b,"string",R,"setDataProperty:propname"),""===b&&w.m("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.pe(a))if(b===this.Vi)this.hB(a,c);else{if(b===this.xl){this.zx(a,c);return}if(b===this.dn){this.Bx(a,c);return}b===this.Gp&&w.m("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.Mi(a)){if(b===
  this.$m){this.Ax(a,c);return}if(b===this.an){this.Cx(a,c);return}if(b===this.op){this.gB(a,c);return}if(b===this.sp){this.kB(a,c);return}if(b===this.np){this.tG(a,c);return}if(b===this.pp){this.uG(a,c);return}}else!hf&&a instanceof P&&(hf=!0,w.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),w.trace("  Is that really your intent?"));var d=w.xb(a,b);d!==c&&(w.Sa(a,b,c),this.OA(a,b,d,c))};f=R.prototype;
  f.Tt=function(a,b){I.prototype.Tt.call(this,a,b);for(var c=this.zc.k;c.next();)this.XA(c.value,a,b);for(var d=this.fm.k;d.next();){var e=c.value,g=a,h=b;if(this.nl(e)===g){var k=this.pj;w.Sa(e,k,h);Te(this,"linkFromKey",fe,k,e,g,h);"string"===typeof k&&this.Rb(e,k)}this.ql(e)===g&&(k=this.sj,w.Sa(e,k,h),Te(this,"linkToKey",fe,k,e,g,h),"string"===typeof k&&this.Rb(e,k));var l=this.fk(e);if(w.isArray(l))for(var m=w.vb(l),k=this.Eh,n=0;n<m;n++)w.jb(l,n)===g&&(w.SD(l,n,h),Te(this,"linkLabelKeys",he,k,
  e,g,h))}};f.XA=function(a,b,c){if(this.Um(a)===b){var d=this.zj;w.Sa(a,d,c);Te(this,"nodeGroupKey",fe,d,a,b,c);"string"===typeof d&&this.Rb(a,d)}};f.sB=function(){I.prototype.sB.call(this);for(var a=this.Ui,b=w.vb(a),c=0;c<b;c++){var d=w.jb(a,c);jf(this,d)}};
  f.Kp=function(a){I.prototype.Kp.call(this,a);a=this.Cb(a);var b=We(this,a);if(null!==b){for(var c=new D(Object),b=b.k;b.next();){var d=b.value;if(this.pe(d)){if(this.Um(d)===a){var e=this.zj;Te(this,"nodeGroupKey",fe,e,d,a,a);"string"===typeof e&&this.Rb(d,e);c.add(d)}}else{this.nl(d)===a&&(e=this.pj,Te(this,"linkFromKey",fe,e,d,a,a),"string"===typeof e&&this.Rb(d,e),c.add(d));this.ql(d)===a&&(e=this.sj,Te(this,"linkToKey",fe,e,d,a,a),"string"===typeof e&&this.Rb(d,e),c.add(d));var g=this.fk(d);if(w.isArray(g))for(var h=
  w.vb(g),e=this.Eh,k=0;k<h;k++)w.jb(g,k)===a&&(Te(this,"linkLabelKeys",he,e,d,a,a),c.add(d))}}for(c=c.k;c.next();)Ye(this,a,c.value)}};f.Jp=function(a){I.prototype.Jp.call(this,a);var b=this.Um(a);null===this.wf(b)&&Xe(this,b,a)};f.hu=function(a){I.prototype.hu.call(this,a);var b=this.Um(a);Ye(this,b,a)};w.g(R,"linkCategoryProperty",R.prototype.np);
  w.defineProperty(R,{np:"linkCategoryProperty"},function(){return this.lr},function(a){var b=this.lr;b!==a&&(Ue(a,R,"linkCategoryProperty"),this.lr=a,this.j("linkCategoryProperty",b,a))});R.prototype.getCategoryForLinkData=R.prototype.Mw=function(a){if(null===a)return"";var b=this.lr;if(""===b)return"";b=w.xb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.m("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
  R.prototype.setCategoryForLinkData=R.prototype.tG=function(a,b){w.i(b,"string",R,"setCategoryForLinkData:cat");if(null!==a){var c=this.lr;if(""===c)return"";if(this.Mi(a)){var d=w.xb(a,c);void 0===d&&(d="");d!==b&&(w.Sa(a,c,b),Te(this,"linkCategory",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};
  function xe(a){1<arguments.length&&w.m("TreeModel constructor can only take one optional argument, the Array of node data.");I.call(this);this.Aj="parent";this.py=!1;this.Ur="parentLinkCategory";void 0!==a&&(this.Fg=a)}w.Ia(xe,I);w.ja("TreeModel",xe);xe.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.pB();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.Fg;for(var c=w.vb(a),d=0;d<c;d++)var e=w.jb(a,d),b=b+(" "+this.Cb(e)+":"+je(e))}return b};
  xe.prototype.iu=function(){var a=I.prototype.iu.call(this),b="";"parent"!==this.en&&"string"===typeof this.en&&(b+=',\n  "nodeParentKeyProperty": '+this.quote(this.en));return a+b};xe.prototype.St=function(a){I.prototype.St.call(this,a);a.nodeParentKeyProperty&&(this.en=a.nodeParentKeyProperty)};xe.prototype.bn=function(a){return a};w.g(xe,"nodeParentKeyProperty",xe.prototype.en);
  w.defineProperty(xe,{en:"nodeParentKeyProperty"},function(){return this.Aj},function(a){var b=this.Aj;b!==a&&(Ue(a,xe,"nodeParentKeyProperty"),this.Aj=a,this.j("nodeParentKeyProperty",b,a))});w.g(xe,"copiesParentKeyOfNodeData",xe.prototype.hl);w.defineProperty(xe,{hl:"copiesParentKeyOfNodeData"},function(){return this.py},function(a){this.py!==a&&(w.i(a,"boolean",xe,"copiesParentKeyOfNodeData"),this.py=a)});
  xe.prototype.getParentKeyForNodeData=xe.prototype.Vm=function(a){if(null!==a){var b=this.Aj;if(""!==b&&(b=w.xb(a,b),void 0!==b)){if(Ve(b))return b;w.m("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
  xe.prototype.setParentKeyForNodeData=xe.prototype.kh=function(a,b){null===b&&(b=void 0);void 0===b||Ve(b)||w.sc(b,"number or string",xe,"setParentKeyForNodeData:key");if(null!==a){var c=this.Aj;if(""!==c)if(b=this.bn(b),this.pe(a)){var d=w.xb(a,c);d!==b&&(Ye(this,d,a),w.Sa(a,c,b),null===this.wf(b)&&Xe(this,b,a),Te(this,"nodeParentKey",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};w.g(xe,"parentLinkCategoryProperty",xe.prototype.DJ);
  w.defineProperty(xe,{DJ:"parentLinkCategoryProperty"},function(){return this.Ur},function(a){var b=this.Ur;b!==a&&(Ue(a,xe,"parentLinkCategoryProperty"),this.Ur=a,this.j("parentLinkCategoryProperty",b,a))});xe.prototype.getParentLinkCategoryForNodeData=xe.prototype.NI=function(a){if(null===a)return"";var b=this.Ur;if(""===b)return"";b=w.xb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.m("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
  xe.prototype.setParentLinkCategoryForNodeData=xe.prototype.RJ=function(a,b){w.i(b,"string",xe,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.Ur;if(""===c)return"";if(this.pe(a)){var d=w.xb(a,c);void 0===d&&(d="");d!==b&&(w.Sa(a,c,b),Te(this,"parentLinkCategory",fe,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else w.Sa(a,c,b)}};xe.prototype.copyNodeData=function(a){if(null===a)return null;a=I.prototype.copyNodeData.call(this,a);this.hl||""===this.Aj||w.Sa(a,this.Aj,void 0);return a};
  xe.prototype.setDataProperty=function(a,b,c){t&&(w.i(a,"object",xe,"setDataProperty:data"),w.i(b,"string",xe,"setDataProperty:propname"),""===b&&w.m("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.pe(a))if(b===this.Vi)this.hB(a,c);else{if(b===this.xl){this.zx(a,c);return}if(b===this.en){this.kh(a,c);return}}else!hf&&a instanceof P&&(hf=!0,w.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),w.trace("  Is that really your intent?"));
  var d=w.xb(a,b);d!==c&&(w.Sa(a,b,c),this.OA(a,b,d,c))};f=xe.prototype;f.Tt=function(a,b){I.prototype.Tt.call(this,a,b);for(var c=this.zc.k;c.next();)this.XA(c.value,a,b)};f.XA=function(a,b,c){if(this.Vm(a)===b){var d=this.Aj;w.Sa(a,d,c);Te(this,"nodeParentKey",fe,d,a,b,c);"string"===typeof d&&this.Rb(a,d)}};
  f.Kp=function(a){I.prototype.Kp.call(this,a);a=this.Cb(a);var b=We(this,a);if(null!==b){for(var c=new D(Object),b=b.k;b.next();){var d=b.value;if(this.pe(d)&&this.Vm(d)===a){var e=this.Aj;Te(this,"nodeParentKey",fe,e,d,a,a);"string"===typeof e&&this.Rb(d,e);c.add(d)}}for(c=c.k;c.next();)Ye(this,a,c.value)}};f.Jp=function(a){I.prototype.Jp.call(this,a);var b=this.Vm(a),b=this.bn(b);null===this.wf(b)&&Xe(this,b,a)};f.hu=function(a){I.prototype.hu.call(this,a);var b=this.Vm(a);Ye(this,b,a)};
  function kf(a,b,c){w.jc(this);this.Qa=!1;void 0===a?a="":w.i(a,"string",kf,"constructor:targetprop");void 0===b?b=a:w.i(b,"string",kf,"constructor:sourceprop");void 0===c?c=null:null!==c&&w.i(c,"function",kf,"constructor:conv");this.rD=-1;this.og=null;this.Zv=a;this.Xv=this.sz=0;this.mD=null;this.yz=!1;this.Qv=b;this.ly=c;this.Zy=lf;this.by=null}w.ja("Binding",kf);var lf;kf.OneWay=lf=w.w(kf,"OneWay",1);var mf;kf.TwoWay=mf=w.w(kf,"TwoWay",2);
  kf.parseEnum=function(a,b){w.i(a,"function",kf,"parseEnum:ctor");w.za(b,a,kf,"parseEnum:defval");return function(c){c=ya(a,c);return null===c?b:c}};var je;kf.toString=je=function(a){var b=a;w.Xa(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()};
  kf.prototype.toString=function(){return"Binding("+this.Vp+":"+this.mB+(-1!==this.kk?" "+this.kk:"")+" "+this.mode.name+")"};kf.prototype.freeze=function(){this.Qa=!0;return this};kf.prototype.Na=function(){this.Qa=!1;return this};w.g(kf,"targetId",kf.prototype.kk);w.defineProperty(kf,{kk:null},function(){return this.rD},function(a){w.N(this);w.i(a,"number",kf,"targetId");this.rD=a});w.g(kf,"targetProperty",kf.prototype.Vp);
  w.defineProperty(kf,{Vp:"targetProperty"},function(){return this.Zv},function(a){w.N(this);w.i(a,"string",kf,"targetProperty");this.Zv=a});w.g(kf,"sourceName",kf.prototype.El);w.defineProperty(kf,{El:"sourceName"},function(){return this.mD},function(a){w.N(this);null!==a&&w.i(a,"string",kf,"sourceName");this.mD=a;null!==a&&(this.yz=!1)});w.g(kf,"toModel",kf.prototype.Xp);w.defineProperty(kf,{Xp:"toModel"},function(){return this.yz},function(a){w.N(this);w.i(a,"boolean",kf,"toModel");this.yz=a});
  w.g(kf,"sourceProperty",kf.prototype.mB);w.defineProperty(kf,{mB:"sourceProperty"},function(){return this.Qv},function(a){w.N(this);w.i(a,"string",kf,"sourceProperty");this.Qv=a});w.g(kf,"converter",kf.prototype.jE);w.defineProperty(kf,{jE:"converter"},function(){return this.ly},function(a){w.N(this);null!==a&&w.i(a,"function",kf,"converter");this.ly=a});w.g(kf,"backConverter",kf.prototype.WD);
  w.defineProperty(kf,{WD:"backConverter"},function(){return this.by},function(a){w.N(this);null!==a&&w.i(a,"function",kf,"backConverter");this.by=a});w.g(kf,"mode",kf.prototype.mode);w.defineProperty(kf,{mode:"mode"},function(){return this.Zy},function(a){w.N(this);w.za(a,kf,kf,"mode");this.Zy=a});kf.prototype.makeTwoWay=function(a){void 0===a&&(a=null);null!==a&&w.i(a,"function",kf,"makeTwoWay");this.mode=mf;this.WD=a;return this};
  kf.prototype.ofObject=kf.prototype.ox=function(a){void 0===a&&(a="");t&&w.i(a,"string",kf,"ofObject:srcname");this.El=a;this.Xp=!1;return this};kf.prototype.ofModel=function(){this.El=null;this.Xp=!0;return this};kf.prototype.ofData=function(){this.El=null;this.Xp=!1;return this};function nf(a,b,c){a=a.El;var d=null;return d=null===a||""===a?b:"."===a?c:".."===a?c.U:b.qe(a)}
  kf.prototype.updateTarget=kf.prototype.XG=function(a,b,c){var d=this.Qv;if(void 0===c||d===c){c=this.Zv;var e=this.ly;if(null===e&&""===c)w.trace("Binding error: target property is the empty string: "+this.toString());else{t&&"string"===typeof c&&("function"!==typeof a.setAttribute&&0<c.length&&"_"!==c[0]&&!w.Ow(a,c)?w.trace("Binding error: undefined target property: "+c+" on "+a.toString()):"name"===c&&a instanceof P&&w.trace("Binding error: cannot modify GraphObject.name on "+a.toString()));var g=
  b;""!==d&&(g=w.xb(b,d));if(void 0!==g)if(null===e)""!==c&&w.Sa(a,c,g);else try{if(""!==c){var h=e(g,a);t&&void 0===h&&w.trace('Binding warning: conversion function returned undefined when setting target property "'+c+'" on '+a.toString()+", function is: "+e);w.Sa(a,c,h)}else e(g,a)}catch(k){t&&w.trace("Binding error: "+k.toString()+' setting target property "'+c+'" on '+a.toString()+" with conversion function: "+e)}}}};
  kf.prototype.updateSource=kf.prototype.Jx=function(a,b,c,d){void 0===d&&(d=null);if(this.Zy===mf){var e=this.Zv;if(void 0===c||e===c){c=this.Qv;var g=this.by;if(null!==g||""!==c){var h=a;""!==e&&(h=w.xb(a,e));if(void 0!==h)if(null===g)null!==d&&d.fa?(t&&d.fa.Vi===c&&d.fa.pe(b)&&w.trace("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),d.fa.setDataProperty(b,c,h)):w.Sa(b,c,h);else try{if(""!==c){var k=g(h,b);null!==d&&d.fa?(t&&(d.fa.Vi===c&&d.fa.pe(b)&&w.trace("Binding error: cannot have TwoWay Binding on node data key property: "+
  this.toString()),void 0===k&&w.trace('Binding warning: conversion function returned undefined when setting source property "'+c+'" on '+b.toString()+", function is: "+g)),d.fa.setDataProperty(b,c,k)):w.Sa(b,c,k)}else g(h,b)}catch(l){t&&w.trace("Binding error: "+l.toString()+' setting source property "'+c+'" on '+b.toString()+" with conversion function: "+g)}}}}};function Se(){this.jH=(new D(Ud)).freeze();this.Xb="";this.tC=!1}w.ja("Transaction",Se);
  Se.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.eh.count.toString()+(this.hp?"":", incomplete");if(void 0!==a&&0<a){a=this.eh.count;for(var c=0;c<a;c++){var d=this.eh.na(c);null!==d&&(b+="\n  "+d.toString())}}return b};Se.prototype.clear=Se.prototype.clear=function(){var a=this.eh;a.Na();for(var b=a.count-1;0<=b;b--){var c=a.na(b);null!==c&&c.clear()}a.clear();a.freeze()};Se.prototype.canUndo=Se.prototype.canUndo=function(){return this.hp};
  Se.prototype.undo=Se.prototype.undo=function(){if(this.canUndo())for(var a=this.eh.count-1;0<=a;a--){var b=this.eh.na(a);null!==b&&b.undo()}};Se.prototype.canRedo=Se.prototype.canRedo=function(){return this.hp};Se.prototype.redo=Se.prototype.redo=function(){if(this.canRedo())for(var a=this.eh.count,b=0;b<a;b++){var c=this.eh.na(b);null!==c&&c.redo()}};w.A(Se,{eh:"changes"},function(){return this.jH});w.g(Se,"name",Se.prototype.name);
  w.defineProperty(Se,{name:"name"},function(){return this.Xb},function(a){this.Xb=a});w.g(Se,"isComplete",Se.prototype.hp);w.defineProperty(Se,{hp:"isComplete"},function(){return this.tC},function(a){this.tC=a});function ke(){this.az=new F(I);this.Xe=!1;this.qH=(new D(Se)).freeze();this.Ug=-1;this.IC=999;this.ni=!1;this.Lu=null;this.al=0;this.ey=!1;t&&(this.ey=!0);this.$g=(new D("string")).freeze();this.mo=new D("number");this.Jy=!0;this.Vy=!1}w.ja("UndoManager",ke);
  ke.prototype.toString=function(a){for(var b="UndoManager "+this.Ri+"<"+this.history.count+"<="+this.BA,b=b+"[",c=this.LF.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.LF.na(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.na(d).toString(a-1);return b};
  ke.prototype.clear=ke.prototype.clear=function(){var a=this.history;a.Na();for(var b=a.count-1;0<=b;b--){var c=a.na(b);null!==c&&c.clear()}a.clear();this.Ug=-1;a.freeze();this.ni=!1;this.Lu=null;this.al=0;this.$g.Na();this.$g.clear();this.$g.freeze();this.mo.clear()};ke.prototype.addModel=ke.prototype.IH=function(a){this.az.add(a)};ke.prototype.removeModel=ke.prototype.LJ=function(a){this.az.remove(a)};
  ke.prototype.startTransaction=ke.prototype.ac=function(a){void 0===a&&(a="");null===a&&(a="");if(this.sb)return!1;!0===this.Jy&&(this.Jy=!1,this.al++,this.Wc("StartingFirstTransaction",a,this.Ni),0<this.al&&this.al--);this.isEnabled&&(this.$g.Na(),this.$g.add(a),this.$g.freeze(),null===this.Ni?this.mo.add(0):this.mo.add(this.Ni.eh.count));this.al++;var b=1===this.Ve;b&&this.Wc("StartedTransaction",a,this.Ni);return b};ke.prototype.commitTransaction=ke.prototype.ae=function(a){return of(this,!0,a)};
  ke.prototype.rollbackTransaction=ke.prototype.Lp=function(){return of(this,!1,"")};
  function of(a,b,c){if(a.sb)return!1;a.Sz&&1>a.Ve&&w.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Ve;d&&b&&a.isEnabled&&a.Wc("CommittingTransaction",c,a.Ni);var e=0;if(0<a.Ve&&(a.al--,a.isEnabled)){var g=a.$g.count;0<g&&(""===c&&(c=a.$g.na(0)),a.$g.Na(),a.$g.md(g-1),a.$g.freeze());g=a.mo.count;0<g&&(e=a.mo.na(g-1),a.mo.md(g-1))}g=a.Ni;if(d){if(b){a.Vy=!1;if(a.isEnabled&&null!==g){b=g;b.hp=!0;b.name=c;d=a.history;d.Na();for(e=d.count-1;e>a.Ri;e--)g=d.na(e),null!==
  g&&g.clear(),d.md(e),a.Vy=!0;e=a.BA;0===e&&(e=1);0<e&&d.count>=e&&(g=d.na(0),null!==g&&g.clear(),d.md(0),a.Ug--);d.add(b);a.Ug++;d.freeze();g=b}a.Wc("CommittedTransaction",c,g)}else{a.ni=!0;try{a.isEnabled&&null!==g&&(g.hp=!0,g.undo())}finally{a.Wc("RolledBackTransaction",c,g),a.ni=!1}null!==g&&g.clear()}a.Lu=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.eh;for(b=c.count-1;b>=a;b--)d=c.na(b),null!==d&&d.undo(),c.Na(),c.md(b);c.freeze()}return!1}
  ke.prototype.canUndo=ke.prototype.canUndo=function(){if(!this.isEnabled||0<this.Ve||this.sb)return!1;var a=this.PG;return null!==a&&a.canUndo()?!0:!1};ke.prototype.undo=ke.prototype.undo=function(){if(this.canUndo()){var a=this.PG;try{this.Wc("StartingUndo","Undo",a),this.ni=!0,this.Ug--,a.undo()}catch(b){w.trace("undo error: "+b.toString())}finally{this.ni=!1,this.Wc("FinishedUndo","Undo",a)}}};
  ke.prototype.canRedo=ke.prototype.canRedo=function(){if(!this.isEnabled||0<this.Ve||this.sb)return!1;var a=this.OG;return null!==a&&a.canRedo()?!0:!1};ke.prototype.redo=ke.prototype.redo=function(){if(this.canRedo()){var a=this.OG;try{this.Wc("StartingRedo","Redo",a),this.ni=!0,this.Ug++,a.redo()}catch(b){w.trace("redo error: "+b.toString())}finally{this.ni=!1,this.Wc("FinishedRedo","Redo",a)}}};
  ke.prototype.Wc=function(a,b,c){void 0===c&&(c=null);var d=new Ud;d.sd=ge;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.sJ;a.next();)b=a.value,d.fa=b,b.nw(d)};ke.prototype.handleChanged=ke.prototype.VE=function(a){if(this.isEnabled&&!this.sb&&!this.skipsEvent(a)){var b=this.Ni;null===b&&(this.Lu=b=new Se);var c=a.copy(),b=b.eh;b.Na();b.add(c);b.freeze();this.Sz&&0>=this.Ve&&!this.Jy&&(a=a.h,null!==a&&!1===a.rf||w.trace("Change not within a transaction: "+c.toString()))}};
  ke.prototype.skipsEvent=function(a){if(null===a||0>a.sd.value)return!0;a=a.object;if(a instanceof P){if(a=a.layer,null!==a&&a.Ac)return!0}else if(a instanceof De&&a.Ac)return!0;return!1};w.A(ke,{sJ:"models"},function(){return this.az.k});w.g(ke,"isEnabled",ke.prototype.isEnabled);w.defineProperty(ke,{isEnabled:"isEnabled"},function(){return this.Xe},function(a){this.Xe=a});w.A(ke,{PG:"transactionToUndo"},function(){return 0<=this.Ri&&this.Ri<=this.history.count-1?this.history.na(this.Ri):null});
  w.A(ke,{OG:"transactionToRedo"},function(){return this.Ri<this.history.count-1?this.history.na(this.Ri+1):null});w.A(ke,{sb:"isUndoingRedoing"},function(){return this.ni});w.A(ke,{history:"history"},function(){return this.qH});w.g(ke,"maxHistoryLength",ke.prototype.BA);w.defineProperty(ke,{BA:"maxHistoryLength"},function(){return this.IC},function(a){this.IC=a});w.A(ke,{Ri:"historyIndex"},function(){return this.Ug});w.A(ke,{Ni:"currentTransaction"},function(){return this.Lu});
  w.A(ke,{Ve:"transactionLevel"},function(){return this.al});w.A(ke,{jF:"isInTransaction"},function(){return 0<this.al});w.defineProperty(ke,{Sz:"checksTransactionLevel"},function(){return this.ey},function(a){this.ey=a});w.A(ke,{LF:"nestedTransactionNames"},function(){return this.$g});function qa(){0<arguments.length&&w.$c(qa);w.jc(this);this.Y=null;this.QB=!0;this.SB=this.TB=this.dC=this.UB=!1;this.Sk=this.Zx=null;this.KD=1.05;this.bC=1;this.Wy=NaN;this.FC=null;this.LD=NaN}w.ja("CommandHandler",qa);
  var pf=null,qf="";qa.prototype.toString=function(){return"CommandHandler"};w.A(qa,{h:"diagram"},function(){return this.Y});qa.prototype.Ic=function(a){t&&null!==a&&w.l(a,C,qa,"setDiagram");this.Y=a};
  qa.prototype.doKeyDown=function(){var a=this.h;if(null!==a){var b=a.P,c=w.Xm?b.xp:b.control,d=b.shift,e=b.alt,g=b.key;!c||"C"!==g&&"Insert"!==g?c&&"X"===g||d&&"Del"===g?this.canCutSelection()&&this.cutSelection():"Del"===g?this.canDeleteSelection()&&this.deleteSelection():c&&"V"===g||d&&"Insert"===g?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===g||e&&d&&"Backspace"===g?this.canRedo()&&this.redo():c&&"Z"===g||e&&"Backspace"===g?this.canUndo()&&this.undo():c&&"A"===g?this.canSelectAll()&&
  this.selectAll():"Esc"===g?this.canStopCommand()&&this.stopCommand():"Up"===g?a.Fe&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===g?a.Fe&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===g?a.De&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===g?a.De&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===g?d&&a.De?a.scroll("page","left"):a.Fe&&a.scroll("page","up"):"PageDown"===g?d&&a.De?a.scroll("page","right"):a.Fe&&a.scroll("page","down"):"Home"===
  g?(b=a.Hd,c&&a.Fe?a.position=new x(a.position.x,b.y):!c&&a.De&&(a.position=new x(b.x,a.position.y))):"End"===g?(b=a.Hd,d=a.ub,c&&a.Fe?a.position=new x(d.x,b.bottom-d.height):!c&&a.De&&(a.position=new x(b.right-d.width,d.y))):"Subtract"===g?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===g?this.canIncreaseZoom()&&this.increaseZoom():c&&"0"===g?this.canResetZoom()&&this.resetZoom():d&&"Z"===g?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===g?this.canGroupSelection()&&this.groupSelection():c&&
  d&&"G"===g?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()}};qa.prototype.doKeyUp=function(){var a=this.h;null!==a&&(a.P.bubbles=!0)};qa.prototype.stopCommand=function(){var a=this.h;if(null!==a){var b=a.Wa;b instanceof rf&&a.Ee&&a.pw();null!==b&&b.doCancel()}};
  qa.prototype.canStopCommand=function(){return!0};qa.prototype.selectAll=function(){var a=this.h;if(null!==a){a.pa();try{a.Yb="wait";a.Ba("ChangingSelection");for(var b=a.hk;b.next();)b.value.Za=!0;for(var c=a.Gg;c.next();)c.value.Za=!0;for(var d=a.links;d.next();)d.value.Za=!0}finally{a.Ba("ChangedSelection"),a.Yb=""}}};qa.prototype.canSelectAll=function(){var a=this.h;return null!==a&&a.Ee};
  qa.prototype.deleteSelection=function(){var a=this.h;if(null!==a&&!a.Ba("SelectionDeleting",a.selection))try{a.Yb="wait";a.ac("Delete");a.Ba("ChangingSelection");for(var b=new F(H),c=a.selection.k;c.next();)sf(b,c.value,!0,this.AE?Infinity:0,!0,function(a){return a.canDelete()});a.WA(b,!0);a.Ba("SelectionDeleted",b)}finally{a.Ba("ChangedSelection"),a.ae("Delete"),a.Yb=""}};qa.prototype.canDeleteSelection=function(){var a=this.h;return null===a||a.hb||a.ff||!a.Rj||0===a.selection.count?!1:!0};
  function sf(a,b,c,d,e,g){void 0===g&&(g=null);if(!(a.contains(b)||null!==g&&!g(b)||b instanceof tf))if(a.add(b),b instanceof S){if(c&&b instanceof T)for(var h=b.Rc;h.next();)sf(a,h.value,c,d,e,g);if(e)for(h=b.ve;h.next();){var k=h.value;if(!a.contains(k)){var l=k.Z,m=k.da;null!==l&&a.contains(l)&&null!==m&&a.contains(m)?sf(a,k,c,d,e,g):null!==l&&null!==m||sf(a,k,c,d,e,g)}}if(1<d)for(b=b.JE();b.next();)sf(a,b.value,c,d-1,e,g)}else if(b instanceof U)for(h=b.Bg;h.next();)sf(a,h.value,c,d,e,g)}
  qa.prototype.Oo=function(a,b,c){var d=new ia(H,H);for(a=a.k;a.next();)uf(this,a.value,b,d,c);if(null!==b){c=b.fa;a=!1;null!==b.tb.ud&&(a=b.tb.ud.Rh);for(var e=new F(U),g=new ia(U,U),h=d.k;h.next();){var k=h.value;if(k instanceof U){var l=k;a||null!==l.Z&&null!==l.da||e.add(l)}else if(c instanceof xe&&k instanceof S&&null!==k.data){var l=c,m=k,k=h.key,n=k.Rm();null!==n&&(n=d.Aa(n),null!==n?(l.kh(m.data,l.Cb(n.data)),l=b.vg(m.data),k=k.pt(),null!==k&&null!==l&&g.add(k,l)):l.kh(m.data,void 0))}}0<e.count&&
  b.WA(e,!1);if(0<g.count)for(b=g.k;b.next();)d.add(b.key,b.value)}for(b=d.k;b.next();)b.value.Rb();return d};
  function uf(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.Aa(b);var g=null,h=b.data;if(null!==h&&null!==c){var k=c.fa;b instanceof U?k instanceof R&&(h=k.nE(h),w.Xa(h)&&(k.fw(h),g=c.vg(h))):(h=k.copyNodeData(h),w.Xa(h)&&(k.Am(h),g=c.Sh(h)))}else vf(b),g=b.copy(),null!==c&&null!==g&&c.add(g);if(!(g instanceof H))return null;g.Za=!1;g.Ag=!1;d.add(b,g);if(b instanceof S){for(k=b.ve;k.next();){h=k.value;if(h.Z===b){var l=d.Aa(h);null!==l&&(l.Z=g)}h.da===b&&(l=d.Aa(h),null!==
  l&&(l.da=g))}if(b instanceof T&&g instanceof T)for(k=g,b=b.Rc;b.next();)h=uf(a,b.value,c,d,e),h instanceof U||null===h||(h.Va=k)}else if(b instanceof U)for(k=b.Z,null!==k&&(k=d.Aa(k),null!==k&&(g.Z=k)),k=b.da,null!==k&&(k=d.Aa(k),null!==k&&(g.da=k)),b=b.Bg;b.next();)k=uf(a,b.value,c,d,e),null!==k&&(k.Md=g);return g}
  qa.prototype.copySelection=function(){var a=this.h;if(null!==a){for(var b=new F(H),a=a.selection.k;a.next();)sf(b,a.value,!0,this.mE?Infinity:0,this.kE,function(a){return a.canCopy()});this.copyToClipboard(b)}};qa.prototype.canCopySelection=function(){var a=this.h;return null!==a&&a.Oh&&a.jw&&0!==a.selection.count?!0:!1};qa.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
  qa.prototype.canCutSelection=function(){var a=this.h;return null!==a&&!a.hb&&!a.ff&&a.Oh&&a.Rj&&a.jw&&0!==a.selection.count?!0:!1};qa.prototype.copyToClipboard=function(a){var b=this.h;if(null!==b){var c=null;if(null===a)pf=null,qf="";else{var c=b.fa,d=!1,e=!1,g=null;try{if(c instanceof xe){var h=c,d=h.hl;h.hl=this.Xz}c instanceof R&&(h=c,e=h.gl,h.gl=this.Wz);g=b.Oo(a,null,!0)}finally{c instanceof xe&&(c.hl=d),c instanceof R&&(c.gl=e),c=new D(H),c.Zd(g),pf=c,qf=b.fa.Wj}}b.Ba("ClipboardChanged",c)}};
  qa.prototype.pasteFromClipboard=function(){var a=new F(H),b=pf;if(null===b)return a;var c=this.h;if(null===c||qf!==c.fa.Wj)return a;var d=c.fa,e=!1,g=!1,h=null;try{if(d instanceof xe){var k=d,e=k.hl;k.hl=this.Xz}d instanceof R&&(k=d,g=k.gl,k.gl=this.Wz);h=c.Oo(b,c,!1)}finally{for(d instanceof xe&&(d.hl=e),d instanceof R&&(d.gl=g),b=h.k;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};
  qa.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.Yb="wait";b.ac("Paste");b.Ba("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&Af(b);for(var d=c.k;d.next();)d.value.Za=!0;b.Ba("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e){var g=b.tb.ud;null===g&&(g=new Bf,g.Ic(b));var h=g.computeEffectiveCollection(b.selection);g.moveParts(h,new x(a.x-e.Da,a.y-e.Ra),!1)}}b.Ba("ClipboardPasted",c)}finally{b.ae("Paste"),b.Yb=
  ""}};qa.prototype.canPasteSelection=function(){var a=this.h;return null===a||a.hb||a.ff||!a.Bm||!a.jw||null===pf||qf!==a.fa.Wj?!1:!0};qa.prototype.undo=function(){var a=this.h;null!==a&&a.ka.undo()};qa.prototype.canUndo=function(){var a=this.h;return null===a||a.hb||a.ff?!1:a.Lz&&a.ka.canUndo()};qa.prototype.redo=function(){var a=this.h;null!==a&&a.ka.redo()};qa.prototype.canRedo=function(){var a=this.h;return null===a||a.hb||a.ff?!1:a.Lz&&a.ka.canRedo()};
  qa.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.ku);w.p(a,qa,"decreaseZoom:factor");var b=this.h;null!==b&&b.Fm===Cf&&(a*=b.scale,a<b.Dg||a>b.Cg||(b.scale=a))};qa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.ku);w.p(a,qa,"canDecreaseZoom:factor");var b=this.h;if(null===b||b.Fm!==Cf)return!1;a*=b.scale;return a<b.Dg||a>b.Cg?!1:b.Ws};
  qa.prototype.increaseZoom=function(a){void 0===a&&(a=this.ku);w.p(a,qa,"increaseZoom:factor");var b=this.h;null!==b&&b.Fm===Cf&&(a*=b.scale,a<b.Dg||a>b.Cg||(b.scale=a))};qa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.ku);w.p(a,qa,"canIncreaseZoom:factor");var b=this.h;if(null===b||b.Fm!==Cf)return!1;a*=b.scale;return a<b.Dg||a>b.Cg?!1:b.Ws};qa.prototype.resetZoom=function(a){void 0===a&&(a=this.it);w.p(a,qa,"resetZoom:newscale");var b=this.h;null===b||a<b.Dg||a>b.Cg||(b.scale=a)};
  qa.prototype.canResetZoom=function(a){void 0===a&&(a=this.it);w.p(a,qa,"canResetZoom:newscale");var b=this.h;return null===b||a<b.Dg||a>b.Cg?!1:b.Ws};qa.prototype.zoomToFit=function(){var a=this.h;if(null!==a){var b=a.scale,c=a.position;b!==this.LD||isNaN(this.Wy)?(this.Wy=b,this.FC=c.copy(),a.zoomToFit(),a.kf(),this.LD=a.scale):(a.scale=this.Wy,a.position=this.FC)}};qa.prototype.canZoomToFit=function(){var a=this.h;return null===a?!1:a.Ws};
  qa.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.ac("Collapse Tree");var c=new D(S);if(null!==a&&a.Qc)a.collapseTree(),c.add(a);else for(var d=b.selection.k;d.next();){var e=d.value;e instanceof S&&(a=e,a.Qc&&(a.collapseTree(),c.add(a)))}b.Ba("TreeCollapsed",c)}finally{b.ae("Collapse Tree")}};
  qa.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.hb)return!1;if(null!==a){if(!a.Qc)return!1;if(0<a.Kw().count)return!0}else for(a=b.selection.k;a.next();)if(b=a.value,b instanceof S&&b.Qc&&0<b.Kw().count)return!0;return!1};
  qa.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.ac("Expand Tree");var c=new D(S);if(null===a||a.Qc)for(var d=b.selection.k;d.next();){var e=d.value;e instanceof S&&(a=e,a.Qc||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.Ba("TreeExpanded",c)}finally{b.ae("Expand Tree")}};
  qa.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.hb)return!1;if(null!==a){if(a.Qc)return!1;if(0<a.Kw().count)return!0}else for(a=b.selection.k;a.next();)if(b=a.value,b instanceof S&&!b.Qc&&0<b.Kw().count)return!0;return!1};
  qa.prototype.groupSelection=function(){var a=this.h;if(null!==a){var b=a.fa;if(b instanceof R){var c=this.Nz;if(null!==c){var d=null;try{a.Yb="wait";a.ac("Group");a.Ba("ChangingSelection");for(var e=new D(H),g=a.selection.k;g.next();){var h=g.value;h.Kd()&&h.canGroup()&&e.add(h)}for(var k=new D(H),l=e.k;l.next();){for(var m=l.value,g=!1,n=e.k;n.next();)if(m.Uh(n.value)){g=!0;break}g||k.add(m)}if(0<k.count){var p=k.first().Va;if(null!==p)for(;null!==p;){for(var e=!1,q=k.k;q.next();)if(!q.value.Uh(p)){e=
  !0;break}if(e)p=p.Va;else break}if(c instanceof T)vf(c),d=c.copy(),null!==d&&a.add(d);else if(b.tA(c)){var r=b.copyNodeData(c);w.Xa(r)&&(b.Am(r),d=a.Jw(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.Va=p);for(var s=k.k;s.next();){var u=s.value;this.isValidMember(d,u)&&(u.Va=d)}a.select(d)}}a.Ba("ChangedSelection");a.Ba("SelectionGrouped",d)}finally{a.ae("Group"),a.Yb=""}}}}};
  qa.prototype.canGroupSelection=function(){var a=this.h;if(null===a||a.hb||a.ff||!a.Bm||!a.Fo||!(a.fa instanceof R)||null===this.Nz)return!1;for(a=a.selection.k;a.next();){var b=a.value;if(b.Kd()&&b.canGroup())return!0}return!1};function Df(a){var b=w.lb();for(a=a.k;a.next();){var c=a.value;c instanceof U||b.push(c)}a=new F(H);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],g=!0,h=0;h<c;h++)if(e.Uh(b[h])){g=!1;break}g&&a.add(e)}w.xa(b);return a}
  qa.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof U)return!1;if(null!==a){if(a===b||a.Uh(b))return!1;var c=a.Ft;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.Ft;return null!==c?c(a,b):!0};
  qa.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b){var c=b.fa;if(c instanceof R)try{b.Yb="wait";b.ac("Ungroup");b.Ba("ChangingSelection");var d=new D(T);if(null!==a)d.add(a);else for(var e=b.selection.k;e.next();){var g=e.value;g instanceof T&&(a=g,a.canUngroup()&&d.add(a))}if(0<d.count){b.pw();for(var h=d.k;h.next();){var k=h.value;k.expandSubGraph();var l=k.Va,m=null!==l&&null!==l.data?c.Cb(l.data):void 0,n=new D(H);n.Zd(k.Rc);for(var p=n.k;p.next();){var q=
  p.value;q.Za=!0;if(!(q instanceof U)){var r=q.data;null!==r?c.Bx(r,m):q.Va=l}}b.remove(k)}}b.Ba("ChangedSelection");b.Ba("SelectionUngrouped",d,n)}finally{b.ae("Ungroup"),b.Yb=""}}};qa.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.hb||b.ff||!b.Rj||!b.Jo||!(b.fa instanceof R))return!1;if(null!==a){if(a.canUngroup())return!0}else for(a=b.selection.k;a.next();)if(b=a.value,b instanceof T&&b.canUngroup())return!0;return!1};
  qa.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=Df(a).k;d.next();){var e=d.value;null!==e.Va&&(!b||this.isValidMember(null,e)?e.Va=null:c=!1)}return c};qa.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.ac("Collapse SubGraph");var c=new D(T);if(null!==a&&a.Ld)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.k;d.next();){var e=d.value;e instanceof T&&(a=e,a.Ld&&(a.collapseSubGraph(),c.add(a)))}b.Ba("SubGraphCollapsed",c)}finally{b.ae("Collapse SubGraph")}};
  qa.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.hb)return!1;if(null!==a)return a.Ld?!0:!1;for(a=b.selection.k;a.next();)if(b=a.value,b instanceof T&&b.Ld)return!0;return!1};
  qa.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.ac("Expand SubGraph");var c=new D(T);if(null===a||a.Ld)for(var d=b.selection.k;d.next();){var e=d.value;e instanceof T&&(a=e,a.Ld||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.Ba("SubGraphExpanded",c)}finally{b.ae("Expand SubGraph")}};
  qa.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.hb)return!1;if(null!==a)return a.Ld?!1:!0;for(a=b.selection.k;a.next();)if(b=a.value,b instanceof T&&!b.Ld)return!0;return!1};
  qa.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&w.l(a,oa,qa,"editTextBlock");var b=this.h;if(null!==b){var c=b.tb.Ix;if(null!==c){if(null===a){a=null;for(var d=b.selection.k;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.lt(function(a){return a instanceof oa&&a.Cw})}null!==a&&(c.Ng=a,b.Wa=c)}}};
  qa.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);null!==a&&w.l(a,oa,qa,"canEditTextBlock");var b=this.h;if(null===b||b.hb||b.ff||!b.Io||null===b.tb.Ix)return!1;if(null!==a){if(a=a.V,null!==a&&a.canEdit())return!0}else for(b=b.selection.k;b.next();)if(a=b.value,a.canEdit()&&(a=a.lt(function(a){return a instanceof oa&&a.Cw}),null!==a))return!0;return!1};
  qa.prototype.showContextMenu=function(a){var b=this.h;if(null!==b){var c=b.tb.tw;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new Sd,e=null;a instanceof P?e=a.qb(Ob):b.lF||(e=b.ub,e=new x(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.We=b.QG(e),d.ga=e,b.P=d);b.Wa=c;Ef(c,!1,a)}}};
  qa.prototype.canShowContextMenu=function(a){var b=this.h;if(null===b)return!1;var c=b.tb.tw;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};w.g(qa,"copiesConnectedLinks",qa.prototype.kE);w.defineProperty(qa,{kE:"copiesConnectedLinks"},function(){return this.QB},function(a){w.i(a,"boolean",qa,"copiesConnectedLinks");this.QB=a});w.g(qa,"copiesTree",qa.prototype.mE);
  w.defineProperty(qa,{mE:"copiesTree"},function(){return this.UB},function(a){w.i(a,"boolean",qa,"copiesTree");this.UB=a});w.g(qa,"deletesTree",qa.prototype.AE);w.defineProperty(qa,{AE:"deletesTree"},function(){return this.dC},function(a){w.i(a,"boolean",qa,"deletesTree");this.dC=a});w.g(qa,"copiesParentKey",qa.prototype.Xz);w.defineProperty(qa,{Xz:"copiesParentKey"},function(){return this.TB},function(a){w.i(a,"boolean",qa,"copiesParentKey");this.TB=a});w.g(qa,"copiesGroupKey",qa.prototype.Wz);
  w.defineProperty(qa,{Wz:"copiesGroupKey"},function(){return this.SB},function(a){w.i(a,"boolean",qa,"copiesGroupKey");this.SB=a});w.g(qa,"archetypeGroupData",qa.prototype.Nz);
  w.defineProperty(qa,{Nz:"archetypeGroupData"},function(){return this.Zx},function(a){null!==a&&w.l(a,Object,qa,"archetypeGroupData");var b=this.h;null!==b&&(b=b.fa,b instanceof R&&(a instanceof T||b.tA(a)||w.m("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.Zx=a});w.g(qa,"memberValidation",qa.prototype.Ft);
  w.defineProperty(qa,{Ft:"memberValidation"},function(){return this.Sk},function(a){null!==a&&w.i(a,"function",qa,"memberValidation");this.Sk=a});w.g(qa,"defaultScale",qa.prototype.it);w.defineProperty(qa,{it:"defaultScale"},function(){return this.bC},function(a){w.p(a,qa,"defaultScale");0<a||w.m("defaultScale must be larger than zero, not: "+a);this.bC=a});w.g(qa,"zoomFactor",qa.prototype.ku);
  w.defineProperty(qa,{ku:"zoomFactor"},function(){return this.KD},function(a){w.p(a,qa,"zoomFactor");1<a||w.m("zoomFactor must be larger than 1.0, not: "+a);this.KD=a});function Qe(){0<arguments.length&&w.$c(Qe);w.jc(this);this.Y=null;this.Xb="";this.Xe=!0;this.rC=!1;this.FD=null;this.dw=-1}w.ja("Tool",Qe);Qe.prototype.Ic=function(a){t&&null!==a&&w.l(a,C,Qe,"setDiagram");this.Y=a};Qe.prototype.toString=function(){return""!==this.name?this.name+" Tool":w.yg(Object.getPrototypeOf(this))};
  Qe.prototype.updateAdornments=function(){};Qe.prototype.canStart=function(){return this.isEnabled};Qe.prototype.doStart=function(){};Qe.prototype.doActivate=function(){this.qa=!0};Qe.prototype.doDeactivate=function(){this.qa=!1};Qe.prototype.doStop=function(){};Qe.prototype.doCancel=function(){this.stopTool()};Qe.prototype.stopTool=function(){var a=this.h;null!==a&&a.Wa===this&&(a.Wa=null,a.Yb="")};Qe.prototype.doMouseDown=function(){!this.qa&&this.canStart()&&this.doActivate()};
  Qe.prototype.doMouseMove=function(){};Qe.prototype.doMouseUp=function(){this.stopTool()};Qe.prototype.doMouseWheel=function(){};Qe.prototype.canStartMultiTouch=function(){return!0};
  Qe.prototype.standardPinchZoomStart=function(){var a=this.h;if(null!==a){var b=a.P.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.Lf[0])c=a.Lf[0],d=a.Lf[1];else return;this.doCancel();if(a.Vn){a.Ky=!0;a.SC=a.scale;var e=a.Fb,g=a.Eb,h=a.mb.getBoundingClientRect(),k=c.clientX-e/h.width*h.left,l=c.clientY-g/h.height*h.top,c=d,d=c.clientX-e/h.width*h.left-k,g=c.clientY-g/h.height*h.top-l,g=Math.sqrt(d*d+g*
  g);a.nD=g;b.preventDefault();b.cancelBubble=!0}else Ff(a)}};
  Qe.prototype.standardPinchZoomMove=function(){var a=this.h;if(null!==a){var b=a.P.event;this.doCancel();Ff(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.Lf[0])c=a.Lf[0],d=a.Lf[1];else return;if(a.Vn&&a.Ky){var e=a.Fb,g=a.Eb,h=a.mb.getBoundingClientRect(),k=c,c=k.clientX-e/h.width*h.left,l=k.clientY-g/h.height*h.top,k=d,d=k.clientX-e/h.width*h.left,g=k.clientY-g/h.height*h.top,h=d-c,e=g-l,h=Math.sqrt(h*
  h+e*e)/a.nD,c=new x((Math.min(d,c)+Math.max(d,c))/2,(Math.min(g,l)+Math.max(g,l))/2),l=a.SC*h,d=a.Ab;l!==a.scale&&d.canResetZoom(l)&&(g=a.Ll,a.Ll=c,d.resetZoom(l),a.Ll=g);b.preventDefault();b.cancelBubble=!0}}};Qe.prototype.doKeyDown=function(){var a=this.h;null!==a&&"Esc"===a.P.key&&this.doCancel()};Qe.prototype.doKeyUp=function(){};Qe.prototype.startTransaction=Qe.prototype.ac=function(a){this.mf=null;var b=this.h;return null===b?!1:b.ac(a)};
  Qe.prototype.stopTransaction=Qe.prototype.jk=function(){var a=this.h;return null===a?!1:null===this.mf?a.Lp():a.ae(this.mf)};
  Qe.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.Ee){var b=a.P,c=a.ot(b.ga,!1);if(null!==c)if(w.Xm?b.xp:b.control){a.Ba("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Va;null!==b&&(b.Za=!b.Za);a.Ba("ChangedSelection")}else if(b.shift){if(!c.Za){a.Ba("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Va;null!==b&&(b.Za=!0);a.Ba("ChangedSelection")}}else{if(!c.Za){for(b=c;null!==b&&!b.canSelect();)b=b.Va;null!==b&&a.select(b)}}else!b.left||(w.Xm?b.xp:b.control)||
  b.shift||a.pw()}};Qe.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Ac});var c=this.h;if(null!==c){var d=c.P,e=c.re(d.ga,a,b);d.ie=e;Gf(e,d,c)}};
  function Gf(a,b,c){var d=0;b.left?d=1===b.Je?1:2===b.Je?2:1:b.right&&1===b.Je&&(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.Ba(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.Ba(e)}if(null!==a)for(b.Oc=!1;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.Pm?a.Pm:a.click;break;case 3:c=
  a.ft}if(null!==c&&(c(b,a),b.Oc))break;a=a.U}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.Pm?c.Pm:c.click;break;case 3:a=c.ft}null!==a&&a(b)}}
  Qe.prototype.standardMouseOver=function(){var a=this.h;if(null!==a){var b=a.P;if(null!==b.h&&!0!==a.Pb.pd){var c=a.$a;a.$a=!0;var d=a.re(b.ga,null,null);b.ie=d;var e=!1;if(d!==a.Cn){var g=a.Cn,h=g;a.Cn=d;this.doCurrentObjectChanged(g,d);for(b.Oc=!1;null!==g;){var k=g.EA;if(null!==k){if(d===g)break;if(null!==d&&d.sl(g))break;k(b,g,d);e=!0;if(b.Oc)break}g=g.U}g=h;for(b.Oc=!1;null!==d;){k=d.DA;if(null!==k){if(g===d)break;if(null!==g&&g.sl(d))break;k(b,d,g);e=!0;if(b.Oc)break}d=d.U}d=a.Cn}if(null!==d){g=
  d;for(k="";null!==g;){k=g.cursor;if(""!==k)break;g=g.U}a.Yb=k;b.Oc=!1;for(g=d;null!==g;){k=g.Jt;if(null!==k&&(k(b,g),e=!0,b.Oc))break;g=g.U}}else a.Yb="",k=a.Jt,null!==k&&(k(b),e=!0);e&&a.Se();a.$a=c}}};Qe.prototype.doCurrentObjectChanged=function(){};
  Qe.prototype.standardMouseWheel=function(){var a=this.h;if(null!==a){var b=a.P,c=b.Yj;if(0!==c&&a.Hd.J()){var d=a.Ab,e=a.tb.Dp;if((e===Hf&&!b.shift||e===If&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.Ll,a.Ll=b.We,0<c?d.increaseZoom():d.decreaseZoom(),a.Ll=e,b.bubbles=!1;else if(e===Hf&&b.shift||e===If&&!b.control){d=a.position.copy();e=0<c?c:-c;if(!b.shift&&a.Fe){var g=a.Pp,e=e/40*g;0<c?a.scroll("pixel","up",e):a.scroll("pixel","down",e)}else b.shift&&a.De&&(g=a.Op,e=e/40*g,0<c?
  a.scroll("pixel","left",e):a.scroll("pixel","right",e));a.position.L(d)||(b.bubbles=!1)}}}};Qe.prototype.standardWaitAfter=function(a){w.i(a,"number",Qe,"standardWaitAfter:delay");this.cancelWaitAfter();var b=this;this.dw=w.setTimeout(function(){b.doWaitAfter()},a)};Qe.prototype.cancelWaitAfter=function(){-1!==this.dw&&w.clearTimeout(this.dw);this.dw=-1};Qe.prototype.doWaitAfter=function(){};
  Qe.prototype.findToolHandleAt=function(a,b){var c=this.h;if(null===c)return null;c=c.re(a,null,function(a){a=a.V;return null===a?!1:null!==a.wc});if(null===c)return null;var d=c.V;return null===d||d.Gc!==b?null:c};Qe.prototype.isBeyondDragSize=function(a,b){var c=this.h;if(null===c)return!1;void 0===a&&(a=c.xc.We);void 0===b&&(b=c.P.We);var d=c.tb.CE,e=d.width,d=d.height;c.xc.ul&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};w.A(Qe,{h:"diagram"},function(){return this.Y});
  w.g(Qe,"name",Qe.prototype.name);w.defineProperty(Qe,{name:"name"},function(){return this.Xb},function(a){w.i(a,"string",Qe,"name");this.Xb=a});w.g(Qe,"isEnabled",Qe.prototype.isEnabled);w.defineProperty(Qe,{isEnabled:"isEnabled"},function(){return this.Xe},function(a){w.i(a,"boolean",Qe,"isEnabled");this.Xe=a});w.g(Qe,"isActive",Qe.prototype.qa);w.defineProperty(Qe,{qa:"isActive"},function(){return this.rC},function(a){w.i(a,"boolean",Qe,"isActive");this.rC=a});w.g(Qe,"transactionResult",Qe.prototype.mf);
  w.defineProperty(Qe,{mf:"transactionResult"},function(){return this.FD},function(a){null!==a&&w.i(a,"string",Qe,"transactionResult");this.FD=a});
  function Bf(){0<arguments.length&&w.$c(Bf);Qe.call(this);this.name="Dragging";this.RB=this.vC=!0;this.Vq=this.jC=!1;this.zC=!0;this.Ly=(new fa(NaN,NaN)).freeze();this.My=Ab;this.Ny=(new x(NaN,NaN)).freeze();this.iC=!1;this.gC=this.PB=this.hC=this.XB=this.xi=null;this.Cq=this.xC=!1;this.wo=new x(NaN,NaN);this.Rv=new x;this.Uv=!1;this.Pv=this.uC=!0;this.Mn=100;this.hj=[];this.pH=(new F(H)).freeze()}w.Ia(Bf,Qe);w.ja("DraggingTool",Bf);w.g(Bf,"isCopyEnabled",Bf.prototype.rA);
  w.defineProperty(Bf,{rA:"isCopyEnabled"},function(){return this.vC},function(a){w.i(a,"boolean",Bf,"isCopyEnabled");this.vC=a});w.g(Bf,"copiesEffectiveCollection",Bf.prototype.lE);w.defineProperty(Bf,{lE:"copiesEffectiveCollection"},function(){return this.RB},function(a){w.i(a,"boolean",Bf,"copiesEffectiveCollection");this.RB=a});w.g(Bf,"dragsTree",Bf.prototype.DE);w.defineProperty(Bf,{DE:"dragsTree"},function(){return this.jC},function(a){w.i(a,"boolean",Bf,"dragsTree");this.jC=a});
  w.g(Bf,"isGridSnapEnabled",Bf.prototype.jp);w.defineProperty(Bf,{jp:"isGridSnapEnabled"},function(){return this.Vq},function(a){w.i(a,"boolean",Bf,"isGridSnapEnabled");this.Vq=a});w.g(Bf,"isComplexRoutingRealtime",Bf.prototype.gF);w.defineProperty(Bf,{gF:"isComplexRoutingRealtime"},function(){return this.uC},function(a){w.i(a,"boolean",Bf,"isComplexRoutingRealtime");this.uC=a});w.g(Bf,"isGridSnapRealtime",Bf.prototype.iF);
  w.defineProperty(Bf,{iF:"isGridSnapRealtime"},function(){return this.zC},function(a){w.i(a,"boolean",Bf,"isGridSnapRealtime");this.zC=a});w.g(Bf,"gridSnapCellSize",Bf.prototype.jA);w.defineProperty(Bf,{jA:"gridSnapCellSize"},function(){return this.Ly},function(a){w.l(a,fa,Bf,"gridSnapCellSize");this.Ly.L(a)||(this.Ly=a=a.ba())});w.g(Bf,"gridSnapCellSpot",Bf.prototype.RE);
  w.defineProperty(Bf,{RE:"gridSnapCellSpot"},function(){return this.My},function(a){w.l(a,K,Bf,"gridSnapCellSpot");this.My.L(a)||(this.My=a=a.ba())});w.g(Bf,"gridSnapOrigin",Bf.prototype.SE);w.defineProperty(Bf,{SE:"gridSnapOrigin"},function(){return this.Ny},function(a){w.l(a,x,Bf,"gridSnapOrigin");this.Ny.L(a)||(this.Ny=a=a.ba())});w.g(Bf,"dragsLink",Bf.prototype.Rh);w.defineProperty(Bf,{Rh:"dragsLink"},function(){return this.iC},function(a){w.i(a,"boolean",Bf,"dragsLink");this.iC=a});
  w.g(Bf,"currentPart",Bf.prototype.Qo);w.defineProperty(Bf,{Qo:"currentPart"},function(){return this.XB},function(a){null!==a&&w.l(a,H,Bf,"currentPart");this.XB=a});w.g(Bf,"copiedParts",Bf.prototype.mc);w.defineProperty(Bf,{mc:"copiedParts"},function(){return this.PB},function(a){this.PB=a});w.g(Bf,"draggedParts",Bf.prototype.Zb);w.defineProperty(Bf,{Zb:"draggedParts"},function(){return this.hC},function(a){this.hC=a});
  w.A(Bf,{nK:"draggingParts"},function(){return null!==this.mc?this.mc.Yi():null!==this.Zb?this.Zb.Yi():this.pH});w.g(Bf,"draggedLink",Bf.prototype.Nc);w.defineProperty(Bf,{Nc:"draggedLink"},function(){return this.gC},function(a){null!==a&&w.l(a,U,Bf,"draggedLink");this.gC=a});w.g(Bf,"isDragOutStarted",Bf.prototype.yt);w.defineProperty(Bf,{yt:"isDragOutStarted"},function(){return this.xC},function(a){this.xC=a});w.g(Bf,"startPoint",Bf.prototype.Wi);
  w.defineProperty(Bf,{Wi:"startPoint"},function(){return this.Rv},function(a){w.l(a,x,Bf,"startPoint");this.Rv.L(a)||(this.Rv=a=a.ba())});w.g(Bf,"delay",Bf.prototype.zw);w.defineProperty(Bf,{zw:"delay"},function(){return this.Mn},function(a){w.i(a,"number",Bf,"delay");this.Mn=a});
  Bf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.Gi&&!a.Oh&&!a.Vs||!a.Ee)return!1;var b=a.P;return!b.left||a.Wa!==this&&(!this.isBeyondDragSize()||b.ul&&b.timestamp-a.xc.timestamp<this.Mn)?!1:null!==this.findDraggablePart()};Bf.prototype.findDraggablePart=function(){var a=this.h;if(null===a)return null;a=a.ot(a.xc.ga,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.Va;return null!==a&&(a.canMove()||a.canCopy())?a:null};
  Bf.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.Ee){var b=a.ot(a.xc.ga,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.Va;this.Qo=b;this.Qo.Za||(a.Ba("ChangingSelection"),b=a.P,(w.Xm?b.xp:b.control)||b.shift||Af(a),this.Qo.Za=!0,a.Ba("ChangedSelection"))}}};
  Bf.prototype.doActivate=function(){var a=this.h;if(null!==a){this.standardMouseSelect();var b=this.Qo;null!==b&&(b.canMove()||b.canCopy())&&(this.qa=!0,this.wo.set(a.position),Jf(this,a.selection),this.hj.length=0,this.Zb=this.computeEffectiveCollection(a.selection),a.Rp=!0,Kf(this,this.Zb),this.ac("Drag"),this.Wi=a.xc.ga,a.te=!0,a.Vs&&(this.yt=!0,this.Cq=!1,Lf=this,Mf=this.h,this.doSimulatedDragOut()))}};
  function Jf(a,b){if(a.Rh){var c=a.h;null!==c&&c.Sj&&(c.fa instanceof R&&1===b.count&&b.first()instanceof U?(a.Nc=b.first(),a.Nc.canRelinkFrom()&&a.Nc.canRelinkTo()&&a.Nc.bt(),a.xi=c.tb.SA,null===a.xi&&(a.xi=new Nf,a.xi.Ic(c))):(a.Nc=null,a.xi=null))}}
  Bf.prototype.computeEffectiveCollection=function(a){var b=null!==this.h&&this.h.Wa===this,c=new ia(H);if(null===a)return c;for(var d=a.k;d.next();)Of(this,c,d.value,b);if(null!==this.Nc&&this.Rh)return c;for(d=a.k;d.next();)a=d.value,a instanceof U&&(b=a.Z,null===b||c.contains(b)?(b=a.da,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function Pf(a){return void 0===a?new dg(J.nk):new dg(a.copy())}
  function Of(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof S){b.add(c,Pf(c.location));if(c instanceof T)for(var e=c.Rc;e.next();)Of(a,b,e.value,d);for(e=c.ve;e.next();){var g=e.value;if(!b.contains(g)){var h=g.Z,k=g.da;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&Of(a,b,g,d)}}if(a.DE)for(c=c.JE();c.next();)Of(a,b,c.value,d)}else if(c instanceof U)for(g=c,b.add(g,Pf()),e=g.Bg;e.next();)Of(a,b,e.value,d);else c instanceof tf||b.add(c,Pf(c.location))}
  Bf.prototype.doDeactivate=function(){this.qa=!1;var a=this.h;null!==a&&eg(a);fg(this);gg(this,this.Zb);this.Zb=null;this.Cq=this.yt=!1;if(0<hg.count){for(var b=hg.length,c=0;c<b;c++){var d=hg.na(c);ig(d);jg(d);fg(d);null!==d.h&&eg(d.h)}hg.clear()}ig(this);this.wo.o(NaN,NaN);Lf=Mf=null;jg(this);a.te=!1;a.Yb="";a.Rp=!1;this.jk()};function fg(a){var b=a.h;if(null!==b){var c=b.$a;b.$a=!0;kg(a,b.P,null);b.$a=c}a.hj.length=0}
  function lg(){var a=Lf;jg(a);mg(a);var b=a.h;null!==b&&a.wo.J()&&(b.position=a.wo);null!==b&&eg(b)}Bf.prototype.doCancel=function(){jg(this);mg(this);var a=this.h;null!==a&&this.wo.J()&&(a.position=this.wo);this.stopTool()};function Kf(a,b){if(null!==b){a.Uv=!0;for(var c=b.k;c.next();){var d=c.key;d instanceof U&&(d.Up=!0)}}}function gg(a,b){if(null!==b){for(var c=b.k;c.next();){var d=c.key;d instanceof U&&(d.Up=!1,d.Si&&ng(d)&&d.$b())}a.Uv=!1}}
  Bf.prototype.doKeyDown=function(){var a=this.h;null!==a&&(a=a.P,null!==a&&this.qa&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};Bf.prototype.doKeyUp=function(){var a=this.h;null!==a&&null!==a.P&&this.qa&&this.doMouseMove()};function og(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=a.k;h.next();){var k=h.value;if(k.Kd()&&k.Ja()){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>g&&(g=l))}}Infinity===c?b.o(0,0,0,0):b.o(c,d,e-c,g-d)}
  function pg(a,b){if(null===a.mc){var c=a.h;if(!(null===c||b&&(c.hb||c.ff))&&null!==a.Zb){var d=c.ka;d.isEnabled&&d.jF?null!==d.Ni&&0<d.Ni.eh.count&&(c.ka.Lp(),c.ac("Drag")):mg(a);c.$a=!b;c.sn=!b;a.Wi=c.xc.ga;d=a.lE?a.Zb.Yi():c.selection;d=c.Oo(d,c,!0);for(c=d.k;c.next();)c.value.location=c.key.location;c=w.$f();og(d,c);w.nc(c);for(var c=new ia(H),e=a.Zb.k;e.next();){var g=e.key;g.Kd()&&g.canCopy()&&(g=d.Aa(g),null!==g&&(g.vf(),c.add(g,Pf(g.location))))}for(d=d.k;d.next();)e=d.value,e instanceof U&&
  e.canCopy()&&c.add(e,Pf());a.mc=c;Jf(a,c.Yi());null!==a.Nc&&(c=a.Nc,d=c.gn,c.wl(a.Wi.x-(d.x+d.width/2),a.Wi.y-(d.y+d.height/2)))}}}function jg(a){var b=a.h;if(null!==b){if(null!==a.mc&&(b.WA(a.mc.Yi(),!1),a.mc=null,null!==a.Zb))for(var c=a.Zb.k;c.next();)c.key instanceof U&&(c.value.point=new x(0,0));b.$a=!1;b.sn=!1;a.Wi=b.xc.ga}}function ig(a){if(null!==a.Nc){if(a.Rh&&null!==a.xi){var b=a.xi;b.h.remove(b.je);b.h.remove(b.ke)}a.Nc=null;a.xi=null}}
  function qg(a,b,c){var d=a.h;if(null!==d){var e=a.Wi,g=w.M();g.assign(d.P.ga);a.moveParts(b,g.eu(e),c);w.B(g)}}
  Bf.prototype.moveParts=function(a,b,c){if(null!==a&&(w.l(a,ia,Bf,"moveParts:parts"),0!==a.count)){var d=w.M(),e=w.M();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);var g=this.Uv;g||Kf(this,a);for(var h=new D(rg),k=new D(La),l=a.k;l.next();){var m=l.key;if(m.Kd()){var n=sg(this,m,a);if(null!==n)h.add(new rg(m,l.value,n));else if(!c||m.canMove()){n=l.value.point;d.assign(n);var p=w.M(),q=this.computeMove(m,d.add(e),a,p);m.location=q;w.B(p);l.value.yG=p.eu(n)}}else l.key instanceof U&&k.add(l.Gb)}for(c=
  h.k;c.next();)h=c.value,n=h.info.point,d.assign(n),h.Cc.location=d.add(h.QI.yG);n=w.M();c=w.M();for(k=k.k;k.next();)if(p=k.value,h=p.key,h instanceof U)if(h.Up)l=h.Z,m=h.da,null!==this.Nc&&this.Rh?(p=p.value.point,a.add(h,Pf(e)),l=b.x-p.x,m=b.y-p.y,h.wl(l,m)):(null!==l&&(n.assign(l.location),q=a.Aa(l),null!==q&&n.eu(q.point)),null!==m&&(c.assign(m.location),q=a.Aa(m),null!==q&&c.eu(q.point)),null!==l&&null!==m?n.Ne(c)?(p=p.value.point,l=d,l.assign(n),l.eu(p),a.add(h,Pf(n)),h.wl(l.x,l.y)):(h.Up=!1,
  h.$b()):(p=p.value.point,a.add(h,Pf(null!==l?n:null!==m?c:b)),l=e.x-p.x,m=e.y-p.y,h.wl(l,m)));else if(null===h.Z||null===h.da)p=p.value.point,a.add(h,Pf(b)),l=e.x-p.x,m=e.y-p.y,h.wl(l,m);w.B(d);w.B(e);w.B(n);w.B(c);g||gg(this,a)}};function sg(a,b,c){b=b.Va;if(null!==b){a=sg(a,b,c);if(null!==a)return a;a=c.Aa(b);if(null!==a)return a}return null}
  function mg(a){if(null!==a.Zb){for(var b=a.h,c=a.Zb.k;c.next();){var d=c.key;d.Kd()&&(d.location=c.value.point)}for(c=a.Zb.k;c.next();)if(d=c.key,d instanceof U&&d.Up){var e=c.value.point;a.Zb.add(d,Pf());d.wl(-e.x,-e.y)}b.kf()}}
  Bf.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new x);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.jp&&(this.iF||null===c||this.h.P.up)&&(e=w.M(),c=e,c.assign(b),null!==a)){var g=this.h;if(null!==g){var h=g.dp,k=this.jA,g=k.width,k=k.height,l=this.SE,m=l.x,l=l.y,n=this.RE;if(null!==h){var p=h.rt;isNaN(g)&&(g=p.width);isNaN(k)&&(k=p.height);h=h.iA;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=w.ic(0,0);h.cu(0,0,g,k,n);J.nt(b.x,b.y,m+h.x,l+h.y,g,k,c);w.B(h)}}c=null!==a.Yz?
  a.Yz(a,b,e):e;k=a.FF;g=k.x;isNaN(g)&&(g=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.zF;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.o(Math.max(g,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&w.B(e);return d};function zg(a,b){if(null===b)return!0;var c=b.V;return null===c||c instanceof tf||c.layer.Ac||a.Zb&&a.Zb.contains(c)||a.mc&&a.mc.contains(c)?!0:!1}
  function Ag(a,b,c,d){var e=a.h;if(null!==e){a.Rh&&(null!==a.Nc&&(a.Nc.Z=null,a.Nc.da=null),Bg(a,!1));var g=!1;!1===a.Pv&&(g=e.$a,e.$a=!0);var h=Cg(e,b,null,function(b){return!zg(a,b)}),k=e.P;k.ie=h;var l=e.$a;e.$a=!0;var m=kg(a,k,h);if(a.qa||null!==Lf){if(null===h){var n=e.IF;null!==n&&(n(k),m=!0)}if(a.qa||null!==Lf)if(a.doDragOver(b,h),a.qa||null!==Lf)e.$a=l,m&&e.kf(),!1===a.Pv&&(e.$a=g),(e.De||e.Fe)&&(c||d)&&Dg(e,k.We)}}}
  function kg(a,b,c){var d=!1,e=a.hj.length,g=0<e?a.hj[0]:null;if(c===g)return!1;b.Oc=!1;for(var h=0;h<e;h++){var k=a.hj[h],l=k.HF;if(null!==l&&(l(b,k,c),d=!0,b.Oc))break}a.hj.length=0;if(!a.qa&&null===Lf||null===c)return d;for(b.Oc=!1;null!==c;)a.hj.push(c),c=Eg(c);e=a.hj.length;for(h=0;h<e&&(k=a.hj[h],l=k.GF,null===l||(l(b,k,g),d=!0,!b.Oc));h++);return d}function Eg(a){var b=a.U;return null!==b?b:a instanceof H&&!(a instanceof T)&&(a=a.Va,null!==a&&a.XE)?a:null}
  function Fg(a,b,c){var d=a.xi;if(null===d)return null;var e=a.h.Qm(b,d.KA,function(a){return d.findValidLinkablePort(a,c)});a=w.M();for(var g=Infinity,h=null,e=e.k;e.next();){var k=e.value;if(null!==k.V){var l=k.qb(Ob,a),l=b.Zj(l);l<g&&(h=k,g=l)}}w.B(a);return h}
  function Bg(a,b){var c=a.Nc;if(null!==c&&!(2>c.oa)){var d=a.h;if(null!==d&&!d.hb&&(d=a.xi,null!==d)){var e=null,g=null;null===c.Z&&(e=Fg(a,c.n(0),!1),null!==e&&(g=e.V));var h=null,k=null;null===c.da&&(h=Fg(a,c.n(c.oa-1),!0),null!==h&&(k=h.V));var l=d.isValidLink(g,e,k,h);b?(c.Gn=c.n(0).copy(),c.Kn=c.n(c.oa-1).copy(),c.Up=!1,c.Z=g,null!==e&&(c.Rf=e.wd),c.da=k,null!==h&&(c.Og=h.wd)):l?Gg(d,g,e,k,h):Gg(d,null,null,null,null)}}}Bf.prototype.doDragOver=function(){};
  function Hg(a,b){var c=a.h;if(null!==c){a.Rh&&Bg(a,!0);fg(a);var d=Cg(c,b,null,function(b){return!zg(a,b)}),e=c.P;e.ie=d;if(null!==d){e.Oc=!1;for(var g=d;null!==g;){var h=g.Gt;if(null!==h&&(h(e,g),e.Oc))break;g=Eg(g)}}else h=c.Gt,null!==h&&h(e);if(a.qa||null!==Lf)if(a.doDropOnto(b,d),a.qa||null!==Lf)for(d=c.selection.k;d.next();)e=d.value,e instanceof S&&Ig(c,e.ea)}}Bf.prototype.doDropOnto=function(){};
  Bf.prototype.doMouseMove=function(){if(this.qa){var a=this.h;if(null!==a&&null!==this.Qo&&null!==this.Zb){var b=!1,c=!1;this.mayCopy()?(b=!0,a.Yb="copy",pg(this,!1),Kf(this,this.mc),qg(this,this.mc,!1),gg(this,this.mc)):this.mayMove()?(c=!0,a.Yb="default",jg(this),qg(this,this.Zb,!0)):this.mayDragOut()?(a.Yb="no-drop",pg(this,!1),qg(this,this.mc,!1)):jg(this);Ag(this,a.P.ga,c,b)}}};
  Bf.prototype.doMouseUp=function(){if(this.qa){var a=this.h;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.mc?(jg(this),pg(this,!0),Kf(this,this.mc),qg(this,this.mc,!1),gg(this,this.mc),null!==this.mc&&a.oG(this.mc.Yi())):(b=!0,jg(this),this.mayMove()&&(qg(this,this.Zb,!0),this.Pv=!1,Ag(this,a.P.ga,!0,!1),this.Pv=!0));this.Cq=!0;Hg(this,a.P.ga);if(this.qa){this.mc=null;if(b&&null!==this.Zb)for(b=this.Zb.k;b.next();){var d=b.key;d instanceof S&&(d=d.Va,null===d||null===d.placeholder||this.Zb.contains(d)||
  d.Uz&&d.T())}a.oc();gg(this,this.Zb);this.mf=c?"Copy":"Move";a.Ba(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};Bf.prototype.mayCopy=function(){if(!this.rA)return!1;var a=this.h;if(null===a||a.hb||a.ff||!a.Bm||!a.Oh||(w.Xm?!a.P.alt:!a.P.control))return!1;for(a=a.selection.k;a.next();){var b=a.value;if(b.Kd()&&b.canCopy())return!0}return null!==this.Nc&&this.Rh&&this.Nc.canCopy()?!0:!1};
  Bf.prototype.mayDragOut=function(){if(!this.rA)return!1;var a=this.h;if(null===a||!a.Vs||!a.Oh||a.Gi)return!1;for(a=a.selection.k;a.next();){var b=a.value;if(b.Kd()&&b.canCopy())return!0}return null!==this.Nc&&this.Rh&&this.Nc.canCopy()?!0:!1};Bf.prototype.mayMove=function(){var a=this.h;if(null===a||a.hb||!a.Gi)return!1;for(a=a.selection.k;a.next();){var b=a.value;if(b.Kd()&&b.canMove())return!0}return null!==this.Nc&&this.Rh&&this.Nc.canMove()?!0:!1};var hg=new D(Bf),Lf=null,Mf=null;
  Bf.prototype.mayDragIn=function(){var a=this.h;if(null===a||!a.Kz||a.hb||a.ff||!a.Bm)return!1;var b=Lf;return null===b||b.h.fa.Wj!==a.fa.Wj?!1:!0};Bf.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.h;a.Pb.Xi();Jg(a);a=Lf;null!==a&&(a.h.Yb="copy")}};Bf.prototype.doSimulatedDragLeave=function(){var a=Lf;null!==a&&a.doSimulatedDragOut();this.doCancel()};
  Bf.prototype.doSimulatedDragOver=function(){var a=this.h;if(null!==a){var b=Lf;null!==b&&null!==b.Zb&&this.mayDragIn()&&(a.Yb="copy",Kg(this,b.Zb.Yi(),!1),qg(this,this.mc,!1),Ag(this,a.P.ga,!1,!0))}};
  Bf.prototype.doSimulatedDrop=function(){var a=this.h;if(null!==a){var b=Lf;null!==b&&(b.Cq=!0,jg(this),this.mayDragIn()&&(this.ac("Drop"),Kg(this,b.Zb.Yi(),!0),qg(this,this.mc,!1),null!==this.mc&&a.oG(this.mc.Yi()),this.mf="ExternalCopy",Hg(this,a.P.ga),a.oc(),this.mc=null,a.focus(),a.Ba("ExternalObjectsDropped",a.selection),this.jk()))}};
  function Kg(a,b,c){if(null===a.mc){var d=a.h;if(null!==d&&!d.hb&&!d.ff){d.$a=!c;d.sn=!c;a.Wi=d.P.ga;d=d.Oo(b,d,!0);c=w.$f();og(b,c);var e=c.x+c.width/2,g=c.y+c.height/2;w.nc(c);var h=a.Rv;c=new ia(H);var k=w.M();for(b=b.k;b.next();){var l=b.value;if(l.Kd()&&l.canCopy()){var m=l.location,l=d.Aa(l);k.o(h.x-(e-m.x),h.y-(g-m.y));l.location=k;l.vf();c.add(l,Pf(k))}}w.B(k);for(d=d.k;d.next();)e=d.value,e instanceof U&&e.canCopy()&&c.add(e,Pf());a.mc=c;Jf(a,c.Yi());null!==a.Nc&&(c=a.Nc,d=c.gn,c.wl(a.Wi.x-
  (d.x+d.width/2),a.Wi.y-(d.y+d.height/2)))}}}Bf.prototype.doSimulatedDragOut=function(){var a=this.h;null!==a&&(this.mayCopy()||this.mayMove()?a.Yb="":a.Yb="no-drop")};function dg(a){this.point=a;this.yG=J.nk}w.ja("DraggingInfo",dg);function rg(a,b,c){this.Cc=a;this.info=b;this.QI=c}
  function Lg(){0<arguments.length&&w.$c(Lg);Qe.call(this);this.bD=100;this.DC=!1;var a=new U,b=new W;b.Tf=!0;b.stroke="blue";a.add(b);b=new W;b.ln="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.hf="Tool";this.yD=a;a=new S;b=new W;b.wd="";b.Bb="Rectangle";b.fill=null;b.stroke="magenta";b.ib=2;b.ya=J.Rx;a.add(b);a.ik=!1;a.hf="Tool";this.wD=a;this.xD=b;a=new S;b=new W;b.wd="";b.Bb="Rectangle";b.fill=null;b.stroke="magenta";b.ib=2;b.ya=J.Rx;a.add(b);a.ik=!1;a.hf="Tool";this.zD=a;this.AD=b;this.ZC=
  this.YC=this.UC=this.TC=this.VC=null;this.yC=!0;this.BH=new ia(P,"boolean");this.cD=this.Pk=this.sD=null}w.Ia(Lg,Qe);w.ja("LinkingBaseTool",Lg);Lg.prototype.doStop=function(){var a=this.h;null!==a&&eg(a);this.Kg=this.Jg=this.Ig=this.Hg=this.pc=null;this.Kx.clear();this.Gf=null};w.g(Lg,"portGravity",Lg.prototype.KA);w.defineProperty(Lg,{KA:"portGravity"},function(){return this.bD},function(a){w.i(a,"number",Lg,"portGravity");0<=a&&(this.bD=a)});w.g(Lg,"isUnconnectedLinkValid",Lg.prototype.Ym);
  w.defineProperty(Lg,{Ym:"isUnconnectedLinkValid"},function(){return this.DC},function(a){w.i(a,"boolean",Lg,"isUnconnectedLinkValid");this.DC=a});w.g(Lg,"temporaryLink",Lg.prototype.ag);w.defineProperty(Lg,{ag:"temporaryLink"},function(){return this.yD},function(a){w.l(a,U,Lg,"temporaryLink");this.yD=a});w.g(Lg,"temporaryFromNode",Lg.prototype.je);w.defineProperty(Lg,{je:"temporaryFromNode"},function(){return this.wD},function(a){w.l(a,S,Lg,"temporaryFromNode");this.wD=a});
  w.g(Lg,"temporaryFromPort",Lg.prototype.Il);w.defineProperty(Lg,{Il:"temporaryFromPort"},function(){return this.xD},function(a){w.l(a,P,Lg,"temporaryFromPort");this.xD=a});w.g(Lg,"temporaryToNode",Lg.prototype.ke);w.defineProperty(Lg,{ke:"temporaryToNode"},function(){return this.zD},function(a){w.l(a,S,Lg,"temporaryToNode");this.zD=a});w.g(Lg,"temporaryToPort",Lg.prototype.Jl);w.defineProperty(Lg,{Jl:"temporaryToPort"},function(){return this.AD},function(a){w.l(a,P,Lg,"temporaryToPort");this.AD=a});
  w.g(Lg,"originalLink",Lg.prototype.pc);w.defineProperty(Lg,{pc:"originalLink"},function(){return this.VC},function(a){null!==a&&w.l(a,U,Lg,"originalLink");this.VC=a});w.g(Lg,"originalFromNode",Lg.prototype.Hg);w.defineProperty(Lg,{Hg:"originalFromNode"},function(){return this.TC},function(a){null!==a&&w.l(a,S,Lg,"originalFromNode");this.TC=a});w.g(Lg,"originalFromPort",Lg.prototype.Ig);
  w.defineProperty(Lg,{Ig:"originalFromPort"},function(){return this.UC},function(a){null!==a&&w.l(a,P,Lg,"originalFromPort");this.UC=a});w.g(Lg,"originalToNode",Lg.prototype.Jg);w.defineProperty(Lg,{Jg:"originalToNode"},function(){return this.YC},function(a){null!==a&&w.l(a,S,Lg,"originalToNode");this.YC=a});w.g(Lg,"originalToPort",Lg.prototype.Kg);w.defineProperty(Lg,{Kg:"originalToPort"},function(){return this.ZC},function(a){null!==a&&w.l(a,P,Lg,"originalToPort");this.ZC=a});
  w.defineProperty(Lg,{fe:"isForwards"},function(){return this.yC},function(a){w.i(a,"boolean",Lg,"isForwards");this.yC=a});w.A(Lg,{Kx:"validPortsCache"},function(){return this.BH});w.g(Lg,"targetPort",Lg.prototype.Gf);w.defineProperty(Lg,{Gf:"targetPort"},function(){return this.sD},function(a){null!==a&&w.l(a,P,Lg,"targetPort");this.sD=a});
  Lg.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.ya=b.ea.size;e?(d.yb=b.yb,d.mk=b.mk):(d.wb=b.wb,d.ek=b.ek);c.Pe=Ob;var g=w.M();c.location=b.qb(Ob,g);w.B(g);d.angle=b.ml();null!==this.Pt&&this.Pt(a,b,c,d,e)}};Lg.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.ya=J.Rx,b.wb=yb,b.yb=yb);null!==a&&(a.location=this.h.P.ga);null!==this.Pt&&this.Pt(null,null,a,b,c)};Lg.prototype.doMouseDown=function(){this.qa&&this.doMouseMove()};
  Lg.prototype.doMouseMove=function(){if(this.qa){var a=this.h;if(null!==a){this.Gf=this.findTargetPort(this.fe);if(null!==this.Gf){var b=this.Gf.V;if(b instanceof S){this.fe?this.copyPortProperties(b,this.Gf,this.ke,this.Jl,!0):this.copyPortProperties(b,this.Gf,this.je,this.Il,!1);return}}this.fe?this.setNoTargetPortProperties(this.ke,this.Jl,!0):this.setNoTargetPortProperties(this.je,this.Il,!1);(a.De||a.Fe)&&Dg(a,a.P.We)}}};
  Lg.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.V;if(!(c instanceof S))return null;for(;null!==a;){var d=b?a.qB:a.bA;if(!0===d&&(null!==a.wd||a instanceof S)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.U}return null};
  Lg.prototype.findTargetPort=function(a){var b=this.h,c=b.P.ga,d=this.KA;0>=d&&(d=.1);for(var e=this,g=b.Qm(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.k;g.next();){var h=g.value,k=h.V;if(k instanceof S){var l=h.qb(Ob,w.M()),m=c.x-l.x,n=c.y-l.y;w.B(l);l=m*m+n*n;l<d&&(m=this.Kx.Aa(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.Hg,this.Ig,k,h)||!a&&this.isValidLink(k,h,this.Jg,this.Kg)?(this.Kx.add(h,!0),b=h,d=l):this.Kx.add(h,!1))}}return null!==b&&(c=b.V,
  c instanceof S&&(null===c.layer||c.layer.Cm))?b:null};Lg.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.Ym;if(this.h.Wa===this&&(null!==a.layer&&!a.layer.Cm||!0!==b.bA))return!1;var c=b.ME;if(Infinity>c){if(null!==this.pc&&a===this.Hg&&b===this.Ig)return!0;var d=b.wd;null===d&&(d="");if(a.Iw(d).count>=c)return!1}return!0};
  Lg.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Ym;if(this.h.Wa===this&&(null!==a.layer&&!a.layer.Cm||!0!==b.qB))return!1;var c=b.KG;if(Infinity>c){if(null!==this.pc&&a===this.Jg&&b===this.Kg)return!0;var d=b.wd;null===d&&(d="");if(a.wg(d).count>=c)return!1}return!0};Lg.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.V,d=b.V;return null!==c&&c===d};
  Lg.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.V;if(!(c instanceof S))return!1;var d=a.wd;null===d&&(d="");var e=b.V;if(!(e instanceof S))return!1;var g=b.wd;null===g&&(g="");for(e=e.wg(g);e.next();)if(g=e.value,g.Z===c&&g.Rf===d)return!0;return!1};
  Lg.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.LE&&d.JG||!this.isInSameNode(b,d))&&(b.KE&&d.IG||!this.isLinked(b,d)))||null!==this.pc&&(null!==a&&this.isLabelDependentOnLink(a,this.pc)||null!==c&&this.isLabelDependentOnLink(c,this.pc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.pc))return!1;if(null!==a){var e=a.tp;if(null!==e&&!e(a,b,c,d,this.pc))return!1}if(null!==
  c&&(e=c.tp,null!==e&&!e(a,b,c,d,this.pc)))return!1;e=this.tp;return null!==e?e(a,b,c,d,this.pc):!0};Lg.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Md;if(null===c)return!1;if(c===b)return!0;var d=new F(S);d.add(a);return Mg(this,c,b,d)};function Mg(a,b,c,d){if(b===c)return!0;var e=b.Z;if(null!==e&&e.zf&&(d.add(e),Mg(a,e.Md,c,d)))return!0;b=b.da;return null!==b&&b.zf&&(d.add(b),Mg(a,b.Md,c,d))?!0:!1}
  Lg.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Ym;var d=this.h.YG;if(d!==Ng){if(d===Og){if(null!==c&&!c.Bc)return!0;for(d=b.ve;d.next();){var e=d.value;if(e!==c&&e.Bc&&e.da===b)return!1}return!Xg(this,a,b,c,!0)}if(d===Yg){if(null!==c&&!c.Bc)return!0;for(d=a.ve;d.next();)if(e=d.value,e!==c&&e.Bc&&e.Z===a)return!1;return!Xg(this,a,b,c,!0)}if(d===Zg)return a===b?a=!0:(d=new F(S),d.add(b),a=$g(this,d,a,b,c)),!a;if(d===ah)return!Xg(this,a,b,c,!1);if(d===
  bh)return a===b?a=!0:(d=new F(S),d.add(b),a=ch(this,d,a,b,c)),!a}return!0};function Xg(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.ve;g.next();){var h=g.value;if(h!==d&&(!e||h.Bc)&&h.da===b&&(h=h.Z,h!==b&&Xg(a,h,c,d,e)))return!0}return!1}function $g(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 g=c.ve;g.next();){var h=g.value;if(h!==e&&h.da===c&&(h=h.Z,h!==c&&$g(a,b,h,d,e)))return!0}return!1}
  function ch(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 g=c.ve;g.next();){var h=g.value;if(h!==e){var k=h.Z,h=h.da,k=k===c?h:k;if(k!==c&&ch(a,b,k,d,e))return!0}}return!1}w.g(Lg,"linkValidation",Lg.prototype.tp);w.defineProperty(Lg,{tp:"linkValidation"},function(){return this.Pk},function(a){null!==a&&w.i(a,"function",Lg,"linkValidation");this.Pk=a});w.g(Lg,"portTargeted",Lg.prototype.Pt);
  w.defineProperty(Lg,{Pt:"portTargeted"},function(){return this.cD},function(a){null!==a&&w.i(a,"function",Lg,"portTargeted");this.cD=a});function ra(){0<arguments.length&&w.$c(ra);Lg.call(this);this.name="Linking";this.ay={};this.$x=null;this.ta=dh;this.qz=this.oD=null}w.Ia(ra,Lg);w.ja("LinkingTool",ra);var dh;ra.Either=dh=w.w(ra,"Either",0);var eh;ra.ForwardsOnly=eh=w.w(ra,"ForwardsOnly",0);var fh;ra.BackwardsOnly=fh=w.w(ra,"BackwardsOnly",0);w.g(ra,"archetypeLinkData",ra.prototype.QD);
  w.defineProperty(ra,{QD:"archetypeLinkData"},function(){return this.ay},function(a){null!==a&&w.l(a,Object,ra,"archetypeLinkData");a instanceof P&&w.l(a,U,ra,"archetypeLinkData");this.ay=a});w.g(ra,"archetypeLabelNodeData",ra.prototype.Oz);w.defineProperty(ra,{Oz:"archetypeLabelNodeData"},function(){return this.$x},function(a){null!==a&&w.l(a,Object,ra,"archetypeLabelNodeData");a instanceof P&&w.l(a,S,ra,"archetypeLabelNodeData");this.$x=a});w.g(ra,"direction",ra.prototype.direction);
  w.defineProperty(ra,{direction:"direction"},function(){return this.ta},function(a){w.za(a,ra,ra,"direction");this.ta=a});w.g(ra,"startObject",ra.prototype.nB);w.defineProperty(ra,{nB:"startObject"},function(){return this.oD},function(a){null!==a&&w.l(a,P,ra,"startObject");this.oD=a});w.A(ra,{Fx:"startPort"},function(){return this.qz});
  ra.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.hb||a.ff||!a.Cm)return!1;var b=a.fa;return(b instanceof R||b instanceof xe)&&a.P.left&&(a.Wa===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
  ra.prototype.findLinkablePort=function(){var a=this.h;if(null===a)return null;var b=this.nB;null===b&&(b=a.re(a.xc.ga,null,null));if(null===b||!(b.V instanceof S))return null;a=this.direction;if(a===dh||a===eh){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.fe=!0,c}if(a===dh||a===fh)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.fe=!1,c;return null};
  ra.prototype.doActivate=function(){var a=this.h;if(null!==a&&(null===this.Fx&&(this.qz=this.findLinkablePort()),null!==this.Fx)){this.ac(this.name);a.te=!0;a.Yb="pointer";if(this.fe){this.Ig=this.Fx;var b=this.Ig.V;b instanceof S&&(this.Hg=b);this.copyPortProperties(this.Hg,this.Ig,this.je,this.Il,!1)}else this.Kg=this.Fx,b=this.Kg.V,b instanceof S&&(this.Jg=b),this.copyPortProperties(this.Jg,this.Kg,this.ke,this.Jl,!0);a.add(this.je);a.add(this.ke);null!==this.ag&&(null!==this.je&&(this.ag.Z=this.je),
  null!==this.ke&&(this.ag.da=this.ke),this.ag.$b(),a.add(this.ag));this.qa=!0}};ra.prototype.doDeactivate=function(){this.qa=!1;var a=this.h;null!==a&&(a.remove(this.ag),a.remove(this.je),a.remove(this.ke),a.te=!1,a.Yb="",this.jk())};ra.prototype.doStop=function(){Lg.prototype.doStop.call(this);this.nB=this.qz=null};
  ra.prototype.doMouseUp=function(){if(this.qa){var a=this.h;if(null===a)return;var b=this.mf=null,c=null,d=null,e=null,g=this.Gf=this.findTargetPort(this.fe);if(null!==g){var h=g.V;h instanceof S&&(this.fe?(null!==this.Hg&&(b=this.Hg,c=this.Ig),d=h,e=g):(b=h,c=g,null!==this.Jg&&(d=this.Jg,e=this.Kg)))}else this.fe?null!==this.Hg&&this.Ym&&(b=this.Hg,c=this.Ig):null!==this.Jg&&this.Ym&&(d=this.Jg,e=this.Kg);if(null!==b||null!==d)b=this.insertLink(b,c,d,e),null!==b?(null===g&&(this.fe?b.Kn=a.P.ga.copy():
  b.Gn=a.P.ga.copy()),a.Ee&&a.select(b),this.mf=this.name,a.Ba("LinkDrawn",b)):a.fa.$D()}this.stopTool()};
  ra.prototype.insertLink=function(a,b,c,d){var e=this.h;if(null===e)return null;var g=e.fa;if(g instanceof xe){var h=a;b=c;e.ld||(h=c,b=a);if(null!==h&&null!==b)return g.kh(b.data,g.Cb(h.data)),b.pt()}else if(g instanceof R)if(h="",null!==a&&(null===b&&(b=a),h=b.wd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.wd,null===b&&(b="")),d=this.QD,d instanceof U){if(vf(d),g=d.copy(),null!==g)return g.Z=a,g.Rf=h,g.da=c,g.Og=b,e.add(g),a=this.Oz,a instanceof S&&(vf(a),a=a.copy(),null!==a&&(a.Md=g,e.add(a))),
  g}else if(null!==d&&(d=g.nE(d),w.Xa(d)))return null!==a&&g.Ax(d,g.Cb(a.data)),g.gB(d,h),null!==c&&g.Cx(d,g.Cb(c.data)),g.kB(d,b),g.fw(d),a=this.Oz,null===a||a instanceof S||(a=g.copyNodeData(a),w.Xa(a)&&(g.Am(a),a=g.Cb(a),void 0!==a&&g.Jz(d,a))),g=e.vg(d);return null};
  function Nf(){0<arguments.length&&w.$c(Nf);Lg.call(this);this.name="Relinking";var a=new W;a.Bb="Diamond";a.ya=J.Ox;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Df=0;this.nC=a;a=new W;a.Bb="Diamond";a.ya=J.Ox;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Df=-1;this.BD=a;this.cc=null;this.WC=new y}w.Ia(Nf,Lg);w.ja("RelinkingTool",Nf);
  Nf.prototype.updateAdornments=function(a){if(null!==a&&a instanceof U){var b="RelinkFrom",c=null;if(a.Za&&!this.h.hb){var d=a.$t;null!==d&&a.canRelinkFrom()&&a.ea.J()&&a.Ja()&&d.ea.J()&&d.vl()&&(c=a.Uo(b),null===c&&(c=this.makeAdornment(d,!1),null!==c&&(c.Gc=b),a.bl(b,c)))}null===c&&a.Bl(b);b="RelinkTo";c=null;a.Za&&!this.h.hb&&(d=a.$t,null!==d&&a.canRelinkTo()&&a.ea.J()&&a.Ja()&&d.ea.J()&&d.vl()&&(c=a.Uo(b),null===c&&(c=this.makeAdornment(d,!0),null!==c&&(c.Gc=b),a.bl(b,c))));null===c&&a.Bl(b)}};
  Nf.prototype.makeAdornment=function(a,b){var c=new tf;c.type=gh;var d=b?this.dK:this.KI;null!==d&&c.add(d.copy());c.wc=a;return c};w.defineProperty(Nf,{KI:"fromHandleArchetype"},function(){return this.nC},function(a){null!==a&&w.l(a,P,Nf,"fromHandleArchetype");this.nC=a});w.defineProperty(Nf,{dK:"toHandleArchetype"},function(){return this.BD},function(a){null!==a&&w.l(a,P,Nf,"toHandleArchetype");this.BD=a});w.A(Nf,{handle:"handle"},function(){return this.cc});
  Nf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.hb||a.ff||!a.Sj)return!1;var b=a.fa;if(!(b instanceof R||b instanceof xe)||!a.P.left)return!1;b=this.findToolHandleAt(a.xc.ga,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.xc.ga,"RelinkTo"));return null!==b};
  Nf.prototype.doActivate=function(){var a=this.h;if(null!==a){if(null===this.pc){var b=this.findToolHandleAt(a.xc.ga,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.xc.ga,"RelinkTo"));if(null===b)return;var c=b.V;if(!(c instanceof tf&&c.Nh instanceof U))return;this.cc=b;this.fe=null===c||"RelinkTo"===c.Gc;this.pc=c.Nh}this.ac(this.name);a.te=!0;a.Yb="pointer";this.Ig=this.pc.vd;this.Hg=this.pc.Z;this.Kg=this.pc.le;this.Jg=this.pc.da;this.WC.set(this.pc.ea);null!==this.pc&&0<this.pc.oa&&(null===
  this.pc.Z&&(null!==this.Il&&(this.Il.ya=J.on),null!==this.je&&(this.je.location=this.pc.n(0))),null===this.pc.da&&(null!==this.Jl&&(this.Jl.ya=J.on),null!==this.ke&&(this.ke.location=this.pc.n(this.pc.oa-1))));this.copyPortProperties(this.Hg,this.Ig,this.je,this.Il,!1);this.copyPortProperties(this.Jg,this.Kg,this.ke,this.Jl,!0);a.add(this.je);a.add(this.ke);null!==this.ag&&(null!==this.je&&(this.ag.Z=this.je),null!==this.ke&&(this.ag.da=this.ke),this.copyLinkProperties(this.pc,this.ag),this.ag.$b(),
  a.add(this.ag));this.qa=!0}};Nf.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.Eo=a.Eo;b.ww=a.ww;var c=a.Le;if(c===hh||c===ih)c=jh;b.Le=c;b.ht=a.ht;b.Wt=a.Wt;b.kn=a.kn;b.wb=a.wb;b.ek=a.ek;b.$o=a.$o;b.ap=a.ap;b.yb=a.yb;b.mk=a.mk;b.Wp=a.Wp;b.Yp=a.Yp}};Nf.prototype.doDeactivate=function(){this.qa=!1;var a=this.h;null!==a&&(a.remove(this.ag),a.remove(this.je),a.remove(this.ke),a.te=!1,a.Yb="",this.jk())};Nf.prototype.doStop=function(){Lg.prototype.doStop.call(this);this.cc=null};
  Nf.prototype.doMouseUp=function(){if(this.qa){var a=this.h;if(null===a)return;this.mf=null;var b=this.Hg,c=this.Ig,d=this.Jg,e=this.Kg,g=this.pc;this.Gf=this.findTargetPort(this.fe);if(null!==this.Gf){var h=this.Gf.V;h instanceof S&&(this.fe?(d=h,e=this.Gf):(b=h,c=this.Gf))}else this.Ym?this.fe?e=d=null:c=b=null:g=null;null!==g&&(this.reconnectLink(g,this.fe?d:b,this.fe?e:c,this.fe),null===this.Gf&&(this.fe?g.Kn=a.P.ga.copy():g.Gn=a.P.ga.copy(),g.$b()),a.Ee&&(g.Za=!0),this.mf=this.name,a.Ba("LinkRelinked",
  g,this.fe?this.Kg:this.Ig));kh(this.pc,this.WC)}this.stopTool()};Nf.prototype.reconnectLink=function(a,b,c,d){if(null===this.h)return!1;c=null!==c&&null!==c.wd?c.wd:"";d?(a.da=b,a.Og=c):(a.Z=b,a.Rf=c);return!0};function Gg(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.je,a.Il,!1),a.h.add(a.je)):a.h.remove(a.je);null!==d?(a.copyPortProperties(d,e,a.ke,a.Jl,!0),a.h.add(a.ke)):a.h.remove(a.ke)}
  function lh(){0<arguments.length&&w.$c(lh);Qe.call(this);this.name="LinkReshaping";var a=new W;a.Bb="Rectangle";a.ya=J.$p;a.fill="lightblue";a.stroke="dodgerblue";this.Hk=a;a=new W;a.Bb="Diamond";a.ya=J.$p;a.fill="lightblue";a.stroke="dodgerblue";this.JC=a;this.dD=3;this.Yx=this.cc=null;this.XC=new x;this.fz=null}w.Ia(lh,Qe);w.ja("LinkReshapingTool",lh);var mh;lh.None=mh=w.w(lh,"None",0);var nh;lh.Horizontal=nh=w.w(lh,"Horizontal",1);var oh;lh.Vertical=oh=w.w(lh,"Vertical",2);var ph;
  lh.All=ph=w.w(lh,"All",3);function qh(a){return a&&a.eD?a.eD:mh}function rh(a,b){w.l(a,P,lh,"setReshapingBehavior:obj");w.za(b,lh,lh,"setReshapingBehavior:behavior");a.eD=b}
  lh.prototype.updateAdornments=function(a){if(null!==a&&a instanceof U){if(a.Za&&!this.h.hb){var b=a.path;if(null!==b&&a.canReshape()&&a.ea.J()&&a.Ja()&&b.ea.J()&&b.vl()){var c=a.Uo(this.name);if(null===c||c.uH!==a.oa||c.DH!==a.Ip)c=this.makeAdornment(b),null!==c&&(c.uH=a.oa,c.DH=a.Ip,a.bl(this.name,c));if(null!==c){c.location=a.position;return}}}a.Bl(this.name)}};
  lh.prototype.makeAdornment=function(a){var b=a.V,c=b.oa,d=b.gc,e=null;if(null!==b.points&&1<c){e=new tf;e.type=gh;var c=b.qt,g=b.ex,h=d?1:0;if(b.Ip&&b.Le!==sh)for(var k=c+h;k<g-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.Df=k,l.Yt=.5,e.add(l))}for(k=c+1;k<g;k++)if(l=this.makeHandle(a,k),null!==l){l.Df=k;if(k!==c)if(k===c+1&&d){var h=b.n(c),m=b.n(c+1);J.I(h.x,m.x)&&J.I(h.y,m.y)&&(m=b.n(c-1));J.I(h.x,m.x)?(rh(l,oh),l.cursor="n-resize"):J.I(h.y,m.y)&&(rh(l,nh),l.cursor="w-resize")}else k===
  g-1&&d?(h=b.n(g-1),m=b.n(g),J.I(h.x,m.x)&&J.I(h.y,m.y)&&(h=b.n(g+1)),J.I(h.x,m.x)?(rh(l,oh),l.cursor="n-resize"):J.I(h.y,m.y)&&(rh(l,nh),l.cursor="w-resize")):k!==g&&(rh(l,ph),l.cursor="move");e.add(l)}e.Gc=this.name;e.wc=a}return e};lh.prototype.makeHandle=function(){var a=this.st;return null===a?null:a.copy()};w.defineProperty(lh,{st:"handleArchetype"},function(){return this.Hk},function(a){null!==a&&w.l(a,P,lh,"handleArchetype");this.Hk=a});
  lh.prototype.makeResegmentHandle=function(){var a=this.qJ;return null===a?null:a.copy()};w.defineProperty(lh,{qJ:"midHandleArchetype"},function(){return this.JC},function(a){null!==a&&w.l(a,P,lh,"midHandleArchetype");this.JC=a});w.A(lh,{handle:"handle"},function(){return this.cc});w.A(lh,{Us:"adornedLink"},function(){return this.Yx});lh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.hb&&a.Go&&a.P.left?null!==this.findToolHandleAt(a.xc.ga,this.name):!1};
  lh.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.cc=this.findToolHandleAt(a.xc.ga,this.name),null!==this.cc)){var b=this.cc.V.Nh;if(b instanceof U){this.Yx=b;a.te=!0;this.ac(this.name);if(b.Ip&&.5===this.cc.Yt){var c=b.points.copy(),d=this.cc.qb(Ob);c.ce(this.cc.Df+1,d);b.gc&&c.ce(this.cc.Df+1,d);b.points=c;b.de();this.cc=this.findToolHandleAt(a.xc.ga,this.name)}this.XC=b.n(this.cc.Df);this.fz=b.points.copy();this.qa=!0}}};
  lh.prototype.doDeactivate=function(){this.jk();this.Yx=this.cc=null;var a=this.h;null!==a&&(a.te=!1);this.qa=!1};lh.prototype.doCancel=function(){var a=this.Us;null!==a&&(a.points=this.fz);this.stopTool()};lh.prototype.doMouseMove=function(){var a=this.h;this.qa&&null!==a&&(a=this.computeReshape(a.P.ga),this.reshape(a))};
  lh.prototype.doMouseUp=function(){var a=this.h;if(this.qa&&null!==a){var b=this.computeReshape(a.P.ga);this.reshape(b);b=this.Us;if(null!==b&&b.Ip){var c=this.handle.Df,d=b.n(c-1),e=b.n(c),g=b.n(c+1);if(b.gc){if(c>b.qt+1&&c<b.ex-1){var h=b.n(c-2);if(Math.abs(d.x-e.x)<this.Lg&&Math.abs(d.y-e.y)<this.Lg&&(th(this,h,d,e,g,!0)||th(this,h,d,e,g,!1))){var k=b.points.copy();th(this,h,d,e,g,!0)?(k.Mg(c-2,new x(h.x,(g.y+h.y)/2)),k.Mg(c+1,new x(g.x,(g.y+h.y)/2))):(k.Mg(c-2,new x((g.x+h.x)/2,h.y)),k.Mg(c+1,
  new x((g.x+h.x)/2,g.y)));k.md(c);k.md(c-1);b.points=k;b.de()}else h=b.n(c+2),Math.abs(e.x-g.x)<this.Lg&&Math.abs(e.y-g.y)<this.Lg&&(th(this,d,e,g,h,!0)||th(this,d,e,g,h,!1))&&(k=b.points.copy(),th(this,d,e,g,h,!0)?(k.Mg(c-1,new x(d.x,(d.y+h.y)/2)),k.Mg(c+2,new x(h.x,(d.y+h.y)/2))):(k.Mg(c-1,new x((d.x+h.x)/2,d.y)),k.Mg(c+2,new x((d.x+h.x)/2,h.y))),k.md(c+1),k.md(c),b.points=k,b.de())}}else h=w.M(),J.cn(d.x,d.y,g.x,g.y,e.x,e.y,h)&&h.Zj(e)<this.Lg*this.Lg&&(k=b.points.copy(),k.md(c),b.points=k,b.de()),
  w.B(h)}a.oc();this.mf=this.name;a.Ba("LinkReshaped",this.Us)}this.stopTool()};function th(a,b,c,d,e,g){return g?Math.abs(b.y-c.y)<a.Lg&&Math.abs(c.y-d.y)<a.Lg&&Math.abs(d.y-e.y)<a.Lg:Math.abs(b.x-c.x)<a.Lg&&Math.abs(c.x-d.x)<a.Lg&&Math.abs(d.x-e.x)<a.Lg}w.g(lh,"resegmentingDistance",lh.prototype.Lg);w.defineProperty(lh,{Lg:"resegmentingDistance"},function(){return this.dD},function(a){w.i(a,"number",lh,"resegmentingDistance");this.dD=a});
  lh.prototype.reshape=function(a){var b=this.Us;b.Fl();var c=this.handle.Df,d=qh(this.handle);if(b.gc)if(c===b.qt+1)c=b.qt+1,d===oh?(b.aa(c,b.n(c-1).x,a.y),b.aa(c+1,b.n(c+2).x,a.y)):d===nh&&(b.aa(c,a.x,b.n(c-1).y),b.aa(c+1,a.x,b.n(c+2).y));else if(c===b.ex-1)c=b.ex-1,d===oh?(b.aa(c-1,b.n(c-2).x,a.y),b.aa(c,b.n(c+1).x,a.y)):d===nh&&(b.aa(c-1,a.x,b.n(c-2).y),b.aa(c,a.x,b.n(c+1).y));else{var d=c,e=b.n(d),g=b.n(d-1),h=b.n(d+1);J.I(g.x,e.x)&&J.I(e.y,h.y)?(J.I(g.x,b.n(d-2).x)&&!J.I(g.y,b.n(d-2).y)?(b.C(d,
  a.x,g.y),c++,d++):b.aa(d-1,a.x,g.y),J.I(h.y,b.n(d+2).y)&&!J.I(h.x,b.n(d+2).x)?b.C(d+1,h.x,a.y):b.aa(d+1,h.x,a.y)):J.I(g.y,e.y)&&J.I(e.x,h.x)?(J.I(g.y,b.n(d-2).y)&&!J.I(g.x,b.n(d-2).x)?(b.C(d,g.x,a.y),c++,d++):b.aa(d-1,g.x,a.y),J.I(h.x,b.n(d+2).x)&&!J.I(h.y,b.n(d+2).y)?b.C(d+1,a.x,h.y):b.aa(d+1,a.x,h.y)):J.I(g.x,e.x)&&J.I(e.x,h.x)?(J.I(g.x,b.n(d-2).x)&&!J.I(g.y,b.n(d-2).y)?(b.C(d,a.x,g.y),c++,d++):b.aa(d-1,a.x,g.y),J.I(h.x,b.n(d+2).x)&&!J.I(h.y,b.n(d+2).y)?b.C(d+1,a.x,h.y):b.aa(d+1,a.x,h.y)):J.I(g.y,
  e.y)&&J.I(e.y,h.y)&&(J.I(g.y,b.n(d-2).y)&&!J.I(g.x,b.n(d-2).x)?(b.C(d,g.x,a.y),c++,d++):b.aa(d-1,g.x,a.y),J.I(h.y,b.n(d+2).y)&&!J.I(h.x,b.n(d+2).x)?b.C(d+1,h.x,a.y):b.aa(d+1,h.x,a.y));b.aa(c,a.x,a.y)}else b.aa(c,a.x,a.y),1===c&&b.computeSpot(!0).ue()&&(e=b.Z,g=b.vd,null===e||e.Ja()||(e=e.findVisibleNode(),e!==b.Z&&(g=e.ll(""))),d=g.qb(Ob,w.M()),e=b.getLinkPointFromPoint(e,g,d,a,!0,w.M()),b.aa(0,e.x,e.y),w.B(d),w.B(e)),c===b.oa-2&&b.computeSpot(!1).ue()&&(c=b.da,e=b.le,null===c||c.Ja()||(c=c.findVisibleNode(),
  c!==b.da&&(e=c.ll(""))),d=e.qb(Ob,w.M()),e=b.getLinkPointFromPoint(c,e,d,a,!1,w.M()),b.aa(b.oa-1,e.x,e.y),w.B(d),w.B(e));b.Li()};lh.prototype.computeReshape=function(a){var b=this.Us,c=this.handle.Df;switch(qh(this.handle)){case ph:return a;case oh:return b=b.n(c),new x(b.x,a.y);case nh:return b=b.n(c),new x(a.x,b.y);default:case mh:return b.n(c)}};w.g(lh,"originalPoint",lh.prototype.zJ);w.A(lh,{zJ:"originalPoint"},function(){return this.XC});w.g(lh,"originalPoints",lh.prototype.AJ);
  w.A(lh,{AJ:"originalPoints"},function(){return this.fz});
  function uh(){0<arguments.length&&w.$c(uh);Qe.call(this);this.name="Resizing";this.xj=(new fa(1,1)).freeze();this.vj=(new fa(9999,9999)).freeze();this.cj=(new fa(NaN,NaN)).freeze();this.Vq=!1;this.Jb=null;var a=new W;a.Fi=Ob;a.Bb="Rectangle";a.ya=J.$p;a.fill="lightblue";a.stroke="dodgerblue";a.ib=1;a.cursor="pointer";this.Hk=a;this.cc=null;this.Dv=new fa;this.ez=new x;this.Iy=new fa(0,0);this.Hy=new fa(Infinity,Infinity);this.Gy=new fa(1,1);this.QC=!0}w.Ia(uh,Qe);w.ja("ResizingTool",uh);
  uh.prototype.updateAdornments=function(a){if(!(null===a||a instanceof U)){if(a.Za&&!this.h.hb){var b=a.fG;if(null!==b&&a.canResize()&&a.ea.J()&&a.Ja()&&b.ea.J()&&b.vl()){var c=a.Uo(this.name);null===c&&(c=this.makeAdornment(b));if(null!==c){var d=b.ml();c.angle=d;var e=b.qb(c.Pe,w.M()),g=b.Qi();c.location=e;w.B(e);e=c.placeholder;if(null!==e){var b=b.Ka,h=w.Hl();h.o(b.width*g,b.height*g);e.ya=h;w.dk(h)}vh(this,c,d);a.bl(this.name,c);return}}}a.Bl(this.name)}};
  uh.prototype.makeAdornment=function(a){var b=null,b=a.V.YA;if(null===b){b=new tf;b.type=wh;b.Pe=Ob;var c=new xh;c.Tf=!0;b.add(c);b.add(this.makeHandle(a,Ab));b.add(this.makeHandle(a,Db));b.add(this.makeHandle(a,Wb));b.add(this.makeHandle(a,Ub));b.add(this.makeHandle(a,Ac));b.add(this.makeHandle(a,Cc));b.add(this.makeHandle(a,Dc));b.add(this.makeHandle(a,Bc))}else if(vf(b),b=b.copy(),null===b)return null;b.Gc=this.name;b.wc=a;return b};
  uh.prototype.makeHandle=function(a,b){var c=this.st;if(null===c)return null;c=c.copy();c.alignment=b;return c};
  function vh(a,b,c){if(null!==b)if(!b.alignment.Pc()&&""!==b.cursor)a:{a=b.alignment;a.ue()&&(a=Ob);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 z)for(b=b.elements;b.next();)vh(a,
  b.value,c)}w.defineProperty(uh,{st:"handleArchetype"},function(){return this.Hk},function(a){null!==a&&w.l(a,P,uh,"handleArchetype");this.Hk=a});w.A(uh,{handle:"handle"},function(){return this.cc});w.defineProperty(uh,{wc:"adornedObject"},function(){return this.Jb},function(a){null!==a&&w.l(a,P,uh,"adornedObject");this.Jb=a});uh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.hb&&a.Dm&&a.P.left?null!==this.findToolHandleAt(a.xc.ga,this.name)?!0:!1:!1};
  uh.prototype.doActivate=function(){var a=this.h;null!==a&&(this.cc=this.findToolHandleAt(a.xc.ga,this.name),null!==this.cc&&(this.Jb=this.cc.V.wc,this.ez.set(this.Jb.V.location),this.Dv.set(this.Jb.ya),this.Gy=this.computeCellSize(),this.Iy=this.computeMinSize(),this.Hy=this.computeMaxSize(),a.te=!0,this.QC=a.Pb.isEnabled,a.Pb.isEnabled=!1,this.ac(this.name),this.qa=!0))};uh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.jk(),this.Jb=this.cc=null,this.qa=a.te=!1,a.Pb.isEnabled=this.QC)};
  uh.prototype.doCancel=function(){this.Jb.ya=this.Dv;this.Jb.V.location=this.ez;this.stopTool()};uh.prototype.doMouseMove=function(){var a=this.h;if(this.qa&&null!==a){var b=this.Iy,c=this.Hy,d=this.Gy,e=this.Jb.PE(a.P.ga,w.M()),g=yh;this.Jb instanceof W&&(g=zh(this.Jb));b=this.computeResize(e,this.cc.alignment,b,c,d,!(g===Jh||g===Kh||a.P.shift));this.resize(b);a.kf();w.B(e)}};
  uh.prototype.doMouseUp=function(){var a=this.h;if(this.qa&&null!==a){var b=this.Iy,c=this.Hy,d=this.Gy,e=this.Jb.PE(a.P.ga,w.M()),g=yh;this.Jb instanceof W&&(g=zh(this.Jb));b=this.computeResize(e,this.cc.alignment,b,c,d,!(g===Jh||g===Kh||a.P.shift));this.resize(b);w.B(e);a.oc();this.mf=this.name;a.Ba("PartResized",this.Jb,this.Dv)}this.stopTool()};
  uh.prototype.resize=function(a){if(null!==this.h){var b=this.wc,c=b.V,d=b.ml(),e=b.Qi(),g=Math.PI*d/180,h=Math.cos(g),g=Math.sin(g),k=0<d&&180>d?1:0,l=90<d&&270>d?1:0,d=180<d&&360>d?1:0,m=b.Ka.width,n=b.Ka.height;b.ya=a.size;var p=c.position.copy();c.vf();m=b.Ka.width-m;n=b.Ka.height-n;if(0!==m||0!==n)0!==m&&(p.x+=e*((a.x+m*l)*h-(a.y+n*k)*g)),0!==n&&(p.y+=e*((a.x+m*d)*g+(a.y+n*l)*h)),c.move(p)}};
  uh.prototype.computeResize=function(a,b,c,d,e,g){b.ue()&&(b=Ob);var h=this.wc.Ka,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!g){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=w.M();J.nt(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),g||(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),g||(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,g||(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),g||(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),g||(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),g||(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,g||(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),g||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));w.B(q);return a};uh.prototype.computeMinSize=function(){var a=this.wc.Re.copy(),b=this.Re;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
  uh.prototype.computeMaxSize=function(){var a=this.wc.Pd.copy(),b=this.Pd;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
  uh.prototype.computeCellSize=function(){var a=new fa(NaN,NaN),b=this.wc.V;if(null!==b){var c=b.eG;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.fl;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.h;(isNaN(a.width)||isNaN(a.height))&&b&&(c=b.tb.ud,null!==c&&c.jp&&(c=c.jA,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.dp,null!==b&&b.visible&&this.jp&&(c=b.rt,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};w.g(uh,"minSize",uh.prototype.Re);
  w.defineProperty(uh,{Re:"minSize"},function(){return this.xj},function(a){w.l(a,fa,uh,"minSize");if(!this.xj.L(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.xj.o(b,a)}});w.g(uh,"maxSize",uh.prototype.Pd);w.defineProperty(uh,{Pd:"maxSize"},function(){return this.vj},function(a){w.l(a,fa,uh,"maxSize");if(!this.vj.L(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.vj.o(b,a)}});w.g(uh,"cellSize",uh.prototype.fl);
  w.defineProperty(uh,{fl:"cellSize"},function(){return this.cj},function(a){w.l(a,fa,uh,"cellSize");this.cj.L(a)||this.cj.assign(a)});w.g(uh,"isGridSnapEnabled",uh.prototype.jp);w.defineProperty(uh,{jp:"isGridSnapEnabled"},function(){return this.Vq},function(a){w.i(a,"boolean",uh,"isGridSnapEnabled");this.Vq=a});w.g(uh,"originalDesiredSize",uh.prototype.xJ);w.A(uh,{xJ:"originalDesiredSize"},function(){return this.Dv});w.g(uh,"originalLocation",uh.prototype.yJ);w.A(uh,{yJ:"originalLocation"},function(){return this.ez});
  function Lh(){0<arguments.length&&w.$c(Lh);Qe.call(this);this.name="Rotating";this.lD=45;this.kD=2;this.Jb=null;var a=new W;a.Bb="Ellipse";a.ya=J.Ox;a.fill="lightblue";a.stroke="dodgerblue";a.ib=1;a.cursor="pointer";this.Hk=a;this.cc=null;this.Cv=0;this.fD=new x}w.Ia(Lh,Qe);w.ja("RotatingTool",Lh);
  Lh.prototype.updateAdornments=function(a){if(!(null===a||a instanceof U)){if(a.Za&&!this.h.hb){var b=a.iG;if(null!==b&&a.canRotate()&&a.ea.J()&&a.Ja()&&b.ea.J()&&b.vl()){var c=a.Uo(this.name);null===c&&(c=this.makeAdornment(b));if(null!==c){c.angle=b.ml();var d=null,e=null;b===a||b===a.hc?(d=a.hc,e=a.Pe):(d=b,e=Ob);for(var g=d.Ka,e=w.ic(g.width*e.x+e.offsetX,g.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.fb(e),d=d.U;var d=e.y,g=Math.max(e.x-b.Ka.width,0),h=w.M();c.location=b.qb(new K(1,0,50+
  g,d),h);w.B(h);w.B(e);a.bl(this.name,c);return}}}a.Bl(this.name)}};Lh.prototype.makeAdornment=function(a){var b=null,b=a.V.hG;if(null===b){b=new tf;b.type=Mh;b.Pe=Ob;var c=this.st;null!==c&&b.add(c.copy())}else if(vf(b),b=b.copy(),null===b)return null;b.Gc=this.name;b.wc=a;return b};w.defineProperty(Lh,{st:"handleArchetype"},function(){return this.Hk},function(a){null!==a&&w.l(a,P,Lh,"handleArchetype");this.Hk=a});w.A(Lh,{handle:"handle"},function(){return this.cc});
  w.defineProperty(Lh,{wc:"adornedObject"},function(){return this.Jb},function(a){null!==a&&w.l(a,P,Lh,"adornedObject");this.Jb=a});Lh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.hb&&a.Ho&&a.P.left?null!==this.findToolHandleAt(a.xc.ga,this.name)?!0:!1:!1};
  Lh.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.cc=this.findToolHandleAt(a.xc.ga,this.name),null!==this.cc)){this.Jb=this.cc.V.wc;var b=this.Jb.V,c=b.hc;this.fD=this.Jb===b||this.Jb===c?c.qb(b.Pe):this.Jb.qb(Ob);this.Cv=this.Jb.angle;a.te=!0;a.Aw=!0;this.ac(this.name);this.qa=!0}};Lh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.jk(),this.Jb=this.cc=null,this.qa=a.te=!1)};Lh.prototype.doCancel=function(){var a=this.h;null!==a&&(a.Aw=!1);this.rotate(this.Cv);this.stopTool()};
  Lh.prototype.doMouseMove=function(){var a=this.h;this.qa&&null!==a&&(a=this.computeRotate(a.P.ga),this.rotate(a))};Lh.prototype.doMouseUp=function(){var a=this.h;if(this.qa&&null!==a){a.Aw=!1;var b=this.computeRotate(a.P.ga);this.rotate(b);a.oc();this.mf=this.name;a.Ba("PartRotated",this.Jb,this.Cv)}this.stopTool()};Lh.prototype.rotate=function(a){t&&w.p(a,Lh,"rotate:newangle");null!==this.Jb&&(this.Jb.angle=a)};
  Lh.prototype.computeRotate=function(a){a=this.fD.Pi(a);var b=this.Jb.U;null!==b&&(a-=b.ml(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.CG),180),c=Math.min(Math.abs(this.BG),b/2);!this.h.P.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};w.g(Lh,"snapAngleMultiple",Lh.prototype.CG);w.defineProperty(Lh,{CG:"snapAngleMultiple"},function(){return this.lD},function(a){w.i(a,"number",Lh,"snapAngleMultiple");this.lD=a});
  w.g(Lh,"snapAngleEpsilon",Lh.prototype.BG);w.defineProperty(Lh,{BG:"snapAngleEpsilon"},function(){return this.kD},function(a){w.i(a,"number",Lh,"snapAngleEpsilon");this.kD=a});w.g(Lh,"originalAngle",Lh.prototype.wJ);w.A(Lh,{wJ:"originalAngle"},function(){return this.Cv});function Nh(){0<arguments.length&&w.$c(Nh);Qe.call(this);this.name="ClickSelecting"}w.Ia(Nh,Qe);w.ja("ClickSelectingTool",Nh);Nh.prototype.canStart=function(){return!this.isEnabled||null===this.h||this.isBeyondDragSize()?!1:!0};
  Nh.prototype.doMouseUp=function(){this.qa&&(this.standardMouseSelect(),this.standardMouseClick());this.stopTool()};function Oh(){0<arguments.length&&w.$c(Oh);Qe.call(this);this.name="Action";this.rn=null}w.Ia(Oh,Qe);w.ja("ActionTool",Oh);Oh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a)return!1;var b=a.P,c=a.re(b.ga,function(a){for(;null!==a.U&&!a.Uw;)a=a.U;return a},function(a){return a.Uw});return null!==c?(this.rn=c,a.Cn=a.re(b.ga,null,null),!0):!1};
  Oh.prototype.doMouseDown=function(){if(this.qa){var a=this.h.P,b=this.rn;null!==b&&(a.ie=b,null!==b.Ez&&b.Ez(a,b))}else this.canStart()&&this.doActivate()};Oh.prototype.doMouseMove=function(){if(this.qa){var a=this.h.P,b=this.rn;null!==b&&(a.ie=b,null!==b.Fz&&b.Fz(a,b))}};Oh.prototype.doMouseUp=function(){if(this.qa){var a=this.h,b=a.P,c=this.rn;if(null===c)return;b.ie=c;null!==c.Gz&&c.Gz(b,c);this.isBeyondDragSize()||Gf(c,b,a)}this.stopTool()};
  Oh.prototype.doCancel=function(){var a=this.h;if(null!==a){var a=a.P,b=this.rn;if(null===b)return;a.ie=b;null!==b.Dz&&b.Dz(a,b)}this.stopTool()};Oh.prototype.doStop=function(){this.rn=null};function sa(){0<arguments.length&&w.$c(sa);Qe.call(this);this.name="ClickCreating";this.Ak=null;this.wC=!0;this.mC=new x(0,0)}w.Ia(sa,Qe);w.ja("ClickCreatingTool",sa);
  sa.prototype.canStart=function(){if(!this.isEnabled||null===this.Xs)return!1;var a=this.h;if(null===a||a.hb||a.ff||!a.Bm||!a.P.left||this.isBeyondDragSize())return!1;if(this.hF){if(1===a.P.Je&&(this.mC=a.P.We.copy()),2!==a.P.Je||this.isBeyondDragSize(this.mC))return!1}else if(1!==a.P.Je)return!1;return a.Wa!==this&&null!==a.ot(a.P.ga,!0)?!1:!0};sa.prototype.doMouseUp=function(){var a=this.h;this.qa&&null!==a&&this.insertPart(a.P.ga);this.stopTool()};
  sa.prototype.insertPart=function(a){var b=this.h;if(null===b)return null;var c=this.Xs;if(null===c)return null;this.ac(this.name);var d=null;c instanceof H?c.Kd()&&(vf(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.fa.copyNodeData(c),w.Xa(c)&&(b.fa.Am(c),d=b.Sh(c)));null!==d&&(d.location=a,b.Ee&&b.select(d));b.oc();this.mf=this.name;b.Ba("PartCreated",d);this.jk();return d};w.g(sa,"archetypeNodeData",sa.prototype.Xs);
  w.defineProperty(sa,{Xs:"archetypeNodeData"},function(){return this.Ak},function(a){null!==a&&w.l(a,Object,sa,"archetypeNodeData");this.Ak=a});w.g(sa,"isDoubleClick",sa.prototype.hF);w.defineProperty(sa,{hF:"isDoubleClick"},function(){return this.wC},function(a){w.i(a,"boolean",sa,"isDoubleClick");this.wC=a});function Ph(a,b,c){this.text=a;this.fE=b;this.visible=c}
  function Qh(){0<arguments.length&&w.$c(Qh);Qe.call(this);this.name="ContextMenu";this.Dn=this.VB=null;this.NC=new x;this.wy=this.Ln=null;Rh(this)}w.Ia(Qh,Qe);w.ja("ContextMenuTool",Qh);w.uE=!1;w.ct=null;w.dt=null;
  function Rh(a){a.Ln=new tf;a.CD=function(){a.stopTool()};if(!1===w.uE){var b=w.createElement("div"),c=w.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=w.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));w.dt=b;w.ct=c;w.uE=!0}}Qh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||this.isBeyondDragSize()||!a.P.right?!1:null!==this.Ln&&a.P.ul||null!==this.findObjectWithContextMenu()?!0:!1};
  Qh.prototype.doStart=function(){var a=this.h;null!==a&&this.NC.set(a.xc.ga)};Qh.prototype.doStop=function(){this.hideDefaultContextMenu();this.hideContextMenu();this.Dn=null};
  Qh.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return null;var c=b.P,d=null;a instanceof C||(d=a instanceof P?a:b.re(c.ga,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.U}if(null!==this.Ln&&b.P.ul)return d.V}else if(c=b.contextMenu,null!==c)return b;return null};Qh.prototype.doActivate=function(){};
  Qh.prototype.doMouseDown=function(){if(this.qa){var a=this.h;if(null!==a&&null!==this.uf){var b=a.re(a.P.ga,null,null);null!==b&&b.sl(this.uf)?(this.standardMouseClick(null,null),this.stopTool()):(this.stopTool(),a.Wa.doMouseDown())}}};Qh.prototype.doMouseUp=function(){this.qa||this.canStart()&&Ef(this,!0)};
  function Ef(a,b,c){void 0===c&&(c=null);a.qa=!0;b&&a.standardMouseSelect();a.standardMouseClick();a.Dn=null;null===c&&(c=a.findObjectWithContextMenu());null!==c?(b=c.contextMenu,null!==b?(a.Dn=c instanceof P?c:null,a.showContextMenu(b,a.Dn)):a.showDefaultContextMenu()):a.showDefaultContextMenu()}Qh.prototype.doMouseMove=function(){this.qa&&this.standardMouseOver()};
  Qh.prototype.showContextMenu=function(a,b){w.l(a,tf,Qh,"showContextMenu:contextmenu");null!==b&&w.l(b,P,Qh,"showContextMenu:obj");var c=this.h;if(null!==c){a!==this.uf&&this.hideContextMenu();a.hf="Tool";a.ik=!1;a.scale=1/c.scale;a.Gc=this.name;c.add(a);if(null!==b){var c=null,d=b.Xo();null!==d&&(c=d.data);a.wc=b;a.data=c}else a.data=c.fa;a.vf();this.positionContextMenu(a,b);this.uf=a}};
  Qh.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.h;if(null!==b){var c=b.P.ga.copy(),d=a.Ga,e=b.ub;b.P.ul&&(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}}};Qh.prototype.hideContextMenu=function(){var a=this.h;null!==a&&null!==this.uf&&(this.uf.data=null,this.uf.wc=null,a.remove(this.uf),this.uf=null,this.standardMouseOver())};
  Qh.prototype.initializeDefaultButtons=function(){if(null===this.h)return null;var a=new D(Ph);a.add(new Ph("Copy",function(a){a.Ab.copySelection()},function(a){return a.Ab.canCopySelection()}));a.add(new Ph("Cut",function(a){a.Ab.cutSelection()},function(a){return a.Ab.canCutSelection()}));a.add(new Ph("Delete",function(a){a.Ab.deleteSelection()},function(a){return a.Ab.canDeleteSelection()}));a.add(new Ph("Paste",function(a){a.Ab.pasteSelection(a.P.ga)},function(a){return a.Ab.canPasteSelection()}));
  a.add(new Ph("Select All",function(a){a.Ab.selectAll()},function(a){return a.Ab.canSelectAll()}));a.add(new Ph("Undo",function(a){a.Ab.undo()},function(a){return a.Ab.canUndo()}));a.add(new Ph("Redo",function(a){a.Ab.redo()},function(a){return a.Ab.canRedo()}));a.add(new Ph("Zoom To Fit",function(a){a.Ab.zoomToFit()},function(a){return a.Ab.canZoomToFit()}));a.add(new Ph("Reset Zoom",function(a){a.Ab.resetZoom()},function(a){return a.Ab.canResetZoom()}));a.add(new Ph("Group Selection",function(a){a.Ab.groupSelection()},
  function(a){return a.Ab.canGroupSelection()}));a.add(new Ph("Ungroup Selection",function(a){a.Ab.ungroupSelection()},function(a){return a.Ab.canUngroupSelection()}));a.add(new Ph("Edit Text",function(a){a.Ab.editTextBlock()},function(a){return a.Ab.canEditTextBlock()}));return a};
  Qh.prototype.showDefaultContextMenu=function(){var a=this.h;if(null!==a){null===this.wy&&(this.wy=this.initializeDefaultButtons());this.Ln!==this.uf&&this.hideContextMenu();w.dt.innerHTML="";w.ct.addEventListener("click",this.CD,!1);var b=this,c=w.createElement("ul");c.className="defaultCXul";w.dt.appendChild(c);c.innerHTML="";for(var d=this.wy.k;d.next();){var e=d.value,g=e.text,h=e.visible;if("function"===typeof e.fE&&("function"!==typeof h||h(a))){h=w.createElement("li");h.className="defaultCXli";
  var k=w.createElement("a");k.className="defaultCXa";k.href="#";k.kH=e.fE;k.addEventListener("click",function(c){this.kH(a);b.stopTool();c.preventDefault();return!1},!1);k.textContent=g;h.appendChild(k);c.appendChild(h)}}w.dt.style.display="block";w.ct.style.display="block";this.uf=this.Ln}};Qh.prototype.hideDefaultContextMenu=function(){null!==this.uf&&this.uf===this.Ln&&(w.dt.style.display="none",w.ct.style.display="none",w.ct.removeEventListener("click",this.CD,!1),this.uf=null)};
  w.g(Qh,"currentContextMenu",Qh.prototype.uf);w.defineProperty(Qh,{uf:"currentContextMenu"},function(){return this.VB},function(a){null!==a&&w.l(a,tf,Qh,"currentContextMenu");this.VB=a});w.g(Qh,"currentObject",Qh.prototype.nI);w.defineProperty(Qh,{nI:"currentObject"},function(){return this.Dn},function(a){null!==a&&w.l(a,P,Qh,"currentObject");this.Dn=a});w.A(Qh,{MK:"mouseDownPoint"},function(){return this.NC});
  function Sh(){0<arguments.length&&w.$c(Sh);Qe.call(this);this.name="DragSelecting";this.Mn=175;this.BC=!1;var a=new H;a.hf="Tool";a.ik=!1;var b=new W;b.name="SHAPE";b.Bb="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.Ol=a}w.Ia(Sh,Qe);w.ja("DragSelectingTool",Sh);
  Sh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.Ee)return!1;var b=a.P;return!b.left||a.Wa!==this&&(!this.isBeyondDragSize()||b.timestamp-a.xc.timestamp<this.zw||null!==a.ot(b.ga,!0))?!1:!0};Sh.prototype.doActivate=function(){var a=this.h;null!==a&&(this.qa=!0,a.te=!0,a.$a=!0,a.add(this.Of),this.doMouseMove())};Sh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.remove(this.Of),a.$a=!1,this.qa=a.te=!1)};
  Sh.prototype.doMouseMove=function(){if(null!==this.h&&this.qa&&null!==this.Of){var a=this.computeBoxBounds(),b=this.Of.qe("SHAPE");null===b&&(b=this.Of.Qf());b.ya=a.size;this.Of.position=a.position}};Sh.prototype.doMouseUp=function(){if(this.qa){var a=this.h;a.remove(this.Of);try{a.Yb="wait",this.selectInRect(this.computeBoxBounds())}finally{a.Yb=""}}this.stopTool()};Sh.prototype.computeBoxBounds=function(){var a=this.h;return null===a?new y(0,0,0,0):new y(a.xc.ga,a.P.ga)};
  Sh.prototype.selectInRect=function(a){var b=this.h;if(null!==b){var c=b.P;b.Ba("ChangingSelection");a=b.ck(a,null,function(a){return a instanceof H?a.canSelect():!1},this.nF);if(w.Xm?c.xp:c.control)if(c.shift)for(a=a.k;a.next();)c=a.value,c.Za&&(c.Za=!1);else for(a=a.k;a.next();)c=a.value,c.Za=!c.Za;else{if(!c.shift){for(var c=new D(H),d=b.selection.k;d.next();){var e=d.value;a.contains(e)||c.add(e)}for(c=c.k;c.next();)c.value.Za=!1}for(a=a.k;a.next();)c=a.value,c.Za||(c.Za=!0)}b.Ba("ChangedSelection")}};
  w.g(Sh,"delay",Sh.prototype.zw);w.defineProperty(Sh,{zw:"delay"},function(){return this.Mn},function(a){w.i(a,"number",Sh,"delay");this.Mn=a});w.g(Sh,"isPartialInclusion",Sh.prototype.nF);w.defineProperty(Sh,{nF:"isPartialInclusion"},function(){return this.BC},function(a){w.i(a,"boolean",Sh,"isPartialInclusion");this.BC=a});w.g(Sh,"box",Sh.prototype.Of);w.defineProperty(Sh,{Of:"box"},function(){return this.Ol},function(a){null!==a&&w.l(a,H,Sh,"box");this.Ol=a});
  function Th(){0<arguments.length&&w.$c(Th);Qe.call(this);this.name="Panning";this.gz=new x;this.bj=!1;var a=this;this.qD=function(){window.document.removeEventListener("scroll",a.qD,!1);a.stopTool()}}w.Ia(Th,Qe);w.ja("PanningTool",Th);Th.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||!a.De&&!a.Fe||!a.P.left||a.Wa!==this&&!this.isBeyondDragSize()?!1:!0};
  Th.prototype.doActivate=function(){var a=this.h;null!==a&&(this.bj?(a.P.bubbles=!0,window.document.addEventListener("scroll",this.qD,!1)):(a.Yb="move",a.te=!0,this.gz=a.position.copy()),this.qa=!0)};Th.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.Yb="",this.qa=a.te=!1)};Th.prototype.doCancel=function(){var a=this.h;null!==a&&(a.position=this.gz,a.te=!1);this.stopTool()};Th.prototype.doMouseMove=function(){this.move()};Th.prototype.doMouseUp=function(){this.move();this.stopTool()};
  Th.prototype.move=function(){var a=this.h;if(this.qa&&a)if(this.bj)a.P.bubbles=!0;else{var b=a.position,c=a.xc.ga,d=a.P.ga,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.De||(e=b.x);a.Fe||(c=b.y);a.position=new x(e,c)}};w.g(Th,"bubbles",Th.prototype.bubbles);w.defineProperty(Th,{bubbles:"bubbles"},function(){return this.bj},function(a){w.i(a,"boolean",Th,"bubbles");this.bj=a});w.g(Th,"originalPosition",Th.prototype.BJ);w.A(Th,{BJ:"originalPosition"},function(){return this.gz});
  function Uh(){0<arguments.length&&w.$c(Uh);Qe.call(this);this.name="TextEditing";this.uD=null;this.Py=0;this.YB=this.xz=null;this.pD=Vh;this.Zk=null;this.bb=Wh;this.Vk=null;this.KC=1;this.iD=!0;var a=w.createElement("textarea");a.IB=!0;this.cC=a;a.addEventListener("input",function(){var a=this.textEditingTool,c=a.uD;c.text=this.value;Xh(c,a.Py,Infinity);this.rows=c.kJ},!1);a.addEventListener("keydown",function(a){var c=a.which,d=this.textEditingTool;if(null!==d)if(13===c)d.acceptText(Yh);else{if(9===
  c)return d.acceptText(Zh),a.preventDefault(),!1;27===c&&(d.doCancel(),null!==d.h&&d.h.focus())}},!1);a.addEventListener("focus",function(){var a=this.textEditingTool;a.bb===$h?a.bb=ai:a.bb===bi?a.bb=ci:a.bb===ci&&(a.bb=ai);"function"===typeof this.select&&a.yx&&this.select()},!1);a.addEventListener("blur",function(){"function"===typeof this.focus&&this.focus();var a=this.textEditingTool;"function"===typeof this.select&&a.yx&&this.select()},!1)}w.ja("TextEditingTool",Uh);w.Ia(Uh,Qe);var di;
  Uh.LostFocus=di=w.w(Uh,"LostFocus",0);var ei;Uh.MouseDown=ei=w.w(Uh,"MouseDown",1);var Zh;Uh.Tab=Zh=w.w(Uh,"Tab",2);var Yh;Uh.Enter=Yh=w.w(Uh,"Enter",3);Uh.SingleClick=w.w(Uh,"SingleClick",0);var Vh;Uh.SingleClickSelected=Vh=w.w(Uh,"SingleClickSelected",1);var Wh=w.w(Uh,"StateNone",0),$h=w.w(Uh,"StateActive",1),ai=w.w(Uh,"StateEditing",2),ci=w.w(Uh,"StateEditing2",3),fi=w.w(Uh,"StateValidating",4),bi=w.w(Uh,"StateValidated",5);w.g(Uh,"textBlock",Uh.prototype.Ng);
  w.defineProperty(Uh,{Ng:"textBlock"},function(){return this.xz},function(a){null!==a&&w.l(a,oa,Uh,"textBlock");this.xz=a});w.g(Uh,"currentTextEditor",Uh.prototype.Pf);w.defineProperty(Uh,{Pf:"currentTextEditor"},function(){return this.YB},function(a){this.YB=a});w.g(Uh,"defaultTextEditor",Uh.prototype.vE);w.defineProperty(Uh,{vE:"defaultTextEditor"},function(){return this.cC},function(a){w.l(a,Element,Uh,"defaultTextEditor");this.cC=a});w.g(Uh,"starting",Uh.prototype.DG);
  w.defineProperty(Uh,{DG:"starting"},function(){return this.pD},function(a){w.za(a,Uh,Uh,"starting");this.pD=a});Uh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.hb||!a.P.left||this.isBeyondDragSize())return!1;a=a.re(a.P.ga,null,function(a){return a instanceof oa});if(null===a||!a.Cw||!a.V.canEdit())return!1;a=a.V;return null===a||this.DG===Vh&&!a.Za?!1:!0};Uh.prototype.doStart=function(){this.qa||null===this.Ng||this.doActivate()};
  Uh.prototype.doActivate=function(){if(!this.qa){var a=this.h;if(null!==a){var b=this.Ng;null===b&&(b=a.re(a.P.ga,function(a){return a instanceof oa?a:null}));if(null!==b){this.Ng=b;var c=b.V;if(null!==c){this.qa=!0;this.bb=$h;var d=this.vE,e=!1;null!==b.oB&&(d=b.oB);null===d||d.IB||(e=!0);this.uD=this.Ng.copy();a.QJ(c.ea);if(d.IB){var g=b.qb(Ob),h=a.position,k=a.scale,l=b.Qi()*k;l<this.CA&&(l=this.CA);this.Py=b.Ka.width;var c=this.Py*l,m=b.Ka.height*l,n=(g.x-h.x)*k,g=(g.y-h.y)*k;d.value=b.text;a.$j.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=(g-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.$j.appendChild(d);d.style.position="absolute";d.style.zIndex=100;d.className="start";d.textEditingTool=this;d.WK=l;if(e&&"function"===typeof d.onActivate)d.onActivate();
  this.Pf=d;"function"===typeof d.focus&&d.focus();"function"===typeof d.select&&this.yx&&d.select()}}}}};Uh.prototype.doCancel=function(){null!==this.Vk&&(this.Pf.style.border=this.Vk,this.Vk=null);this.stopTool()};Uh.prototype.doMouseUp=function(){!this.qa&&this.canStart()&&this.doActivate()};Uh.prototype.doMouseDown=function(){this.qa&&this.acceptText(ei)};
  Uh.prototype.acceptText=function(a){switch(a){case ei:if(this.bb===bi||this.bb===ci)"function"===typeof this.Pf.focus&&this.Pf.focus();else if(this.bb===$h||this.bb===ai)this.bb=fi,gi(this);break;case di:case Yh:case Zh:if(Yh===a&&!0===this.xz.Zw)break;if(this.bb===$h||this.bb===ai)this.bb=fi,gi(this)}};
  function gi(a){if(null!==a.Ng&&null!==a.Pf){var b=a.Ng,c=a.Ng.text,d=a.Pf.value,e="",e="function"===typeof d?d():d;if(!a.isValidText(a.Ng,c,e)){a.bb=ai;null!==b.kt&&b.kt(a,c,e);null===a.Vk&&(a.Vk=a.Pf.style.border,a.Pf.style.border="3px solid red");"function"===typeof a.Pf.focus&&a.Pf.focus();return}a.ac(a.name);a.bb=bi;c!==e&&(a.Ng.text=e);a.mf=a.name;b=a.h;null!==b&&b.Ba("TextEdited",a.Ng,c);a.jk();a.stopTool();null!==b&&b.focus()}null!==a.Vk&&(a.Pf.style.border=a.Vk,a.Vk=null)}
  Uh.prototype.doDeactivate=function(){var a=this.h;if(null!==a){this.bb=Wh;this.Ng=null;if(null!==this.Pf){var b=this.Pf;if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.$j.removeChild(b)}this.qa=!1}};Uh.prototype.isValidText=function(a,b,c){w.l(a,oa,Uh,"isValidText:textblock");var d=this.fu;if(null!==d&&!d(a,b,c))return!1;d=a.fu;return null===d||d(a,b,c)?!0:!1};w.g(Uh,"textValidation",Uh.prototype.fu);
  w.defineProperty(Uh,{fu:"textValidation"},function(){return this.Zk},function(a){null!==a&&w.i(a,"function",Uh,"textValidation");this.Zk=a});w.g(Uh,"minimumEditorScale",Uh.prototype.CA);w.defineProperty(Uh,{CA:"minimumEditorScale"},function(){return this.KC},function(a){null!==a&&w.i(a,"number",Uh,"minimumEditorScale");this.KC=a});w.g(Uh,"selectsTextOnActivate",Uh.prototype.yx);
  w.defineProperty(Uh,{yx:"selectsTextOnActivate"},function(){return this.iD},function(a){null!==a&&w.i(a,"boolean",Uh,"selectsTextOnActivate");this.iD=a});function rf(){Qe.call(this);this.name="ToolManager";this.rH=new D(Qe);this.sH=new D(Qe);this.tH=new D(Qe);this.pC=this.qC=1E3;this.fC=(new fa(2,2)).Ma();this.Ku=this.uy=null;this.OC=If;this.oC=hi}w.Ia(rf,Qe);w.ja("ToolManager",rf);var If;rf.WheelScroll=If=w.w(rf,"WheelScroll",0);var Hf;rf.WheelZoom=Hf=w.w(rf,"WheelZoom",1);
  rf.WheelNone=w.w(rf,"WheelNone",2);var hi;rf.GestureZoom=hi=w.w(rf,"GestureZoom",3);var ii;rf.GestureCancel=ii=w.w(rf,"GestureCancel",4);var ji;rf.GestureNone=ji=w.w(rf,"GestureNone",5);w.g(rf,"mouseWheelBehavior",rf.prototype.Dp);w.defineProperty(rf,{Dp:"mouseWheelBehavior"},function(){return this.OC},function(a){w.za(a,rf,rf,"mouseWheelBehavior");this.OC=a});w.g(rf,"gestureBehavior",rf.prototype.Tm);
  w.defineProperty(rf,{Tm:"gestureBehavior"},function(){return this.oC},function(a){w.za(a,rf,rf,"gestureBehavior");this.oC=a});rf.prototype.initializeStandardTools=function(){this.MD=new Oh;this.SA=new Nf;this.wF=new lh;this.$A=new uh;this.kG=new Lh;this.AA=new ra;this.ud=new Bf;this.BE=new Sh;this.QF=new Th;this.tw=new Qh;this.Ix=new Uh;this.aE=new sa;this.bE=new Nh};
  rf.prototype.doMouseDown=function(){var a=this.h;if(null!==a){var b=a.P;b.ul&&this.Tm===ii&&(b.bubbles=!1);if(b.At){if(this.Tm===ji){b.bubbles=!0;return}if(this.Tm===ii)return;if(a.Wa.canStartMultiTouch()){a.Wa.standardPinchZoomStart();return}}b=a.ka;b.Sz&&0!==b.Ve&&w.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var b=this.lf.length,c=0;c<b;c++){var d=this.lf.na(c);null===d.h&&d.Ic(this.h);if(d.canStart()){a.Wa=d;a.Wa===d&&(d.qa||d.doActivate(),d.doMouseDown());
  return}}1===a.P.button&&(this.Dp===If?this.Dp=Hf:this.Dp===Hf&&(this.Dp=If));this.doActivate();this.standardWaitAfter(this.kA)}};
  rf.prototype.doMouseMove=function(){var a=this.h;if(null!==a){var b=a.P;if(b.At){if(this.Tm===ji){b.bubbles=!0;return}if(this.Tm===ii)return;if(a.Wa.canStartMultiTouch()){a.Wa.standardPinchZoomMove();return}}if(this.qa)for(var b=this.Uf.length,c=0;c<b;c++){var d=this.Uf.na(c);null===d.h&&d.Ic(this.h);if(d.canStart()){a.Wa=d;a.Wa===d&&(d.qa||d.doActivate(),d.doMouseMove());return}}this.standardMouseOver();this.isBeyondDragSize()&&this.standardWaitAfter(this.qa?this.kA:this.YE)}};
  rf.prototype.doCurrentObjectChanged=function(a,b){var c=this.kl;null===c||null!==b&&(b===c||b.sl(c))||this.hideToolTip()};rf.prototype.doWaitAfter=function(){this.h&&this.h.mb&&(this.doMouseHover(),this.qa||this.doToolTip())};rf.prototype.doMouseHover=function(){var a=this.h;if(null!==a){var b=a.P;null===b.ie&&(b.ie=a.re(b.ga,null,null));var c=b.ie;if(null!==c)for(b.Oc=!1;null!==c;){a=this.qa?c.Ht:c.It;if(null!==a&&(a(b,c),b.Oc))break;c=c.U}else a=this.qa?a.Ht:a.It,null!==a&&a(b)}};
  rf.prototype.doToolTip=function(){var a=this.h;if(null!==a){var b=a.P;null===b.ie&&(b.ie=a.re(b.ga,null,null));b=b.ie;if(null!==b){if(b!==this.kl&&!b.sl(this.kl)){for(;null!==b;){a=b.gu;if(null!==a){this.showToolTip(a,b);return}b=b.U}this.hideToolTip()}}else a=a.gu,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
  rf.prototype.showToolTip=function(a,b){w.l(a,tf,rf,"showToolTip:tooltip");null!==b&&w.l(b,P,rf,"showToolTip:obj");var c=this.h;if(null!==c){a!==this.kl&&this.hideToolTip();a.hf="Tool";a.ik=!1;a.scale=1/c.scale;c.add(a);if(null!==b&&b!==this.Ku){var c=null,d=b.Xo();null!==d&&(c=d.data);a.wc=b;a.data=c}else null===b&&(a.data=c.fa);if(null===b||b!==this.Ku)a.vf(),this.positionToolTip(a,b);this.uy=a;this.Ku=b}};
  rf.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.h;if(null!==b){var c=b.P.ga.copy(),d=a.Ga,e=b.ub;b.P.ul&&(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}}};rf.prototype.hideToolTip=function(){if(null!==this.kl){var a=this.h;null!==a&&(this.kl.data=null,this.kl.wc=null,a.remove(this.kl),this.Ku=this.uy=null)}};w.A(rf,{kl:"currentToolTip"},function(){return this.uy});
  rf.prototype.doMouseUp=function(){this.cancelWaitAfter();if(this.qa){var a=this.h;if(null===a)return;for(var b=this.Vf.length,c=0;c<b;c++){var d=this.Vf.na(c);null===d.h&&d.Ic(this.h);if(d.canStart()){a.Wa=d;a.Wa===d&&(d.qa||d.doActivate(),d.doMouseUp());return}}}this.doDeactivate()};rf.prototype.doMouseWheel=function(){this.standardMouseWheel()};rf.prototype.doKeyDown=function(){var a=this.h;null!==a&&a.Ab.doKeyDown()};rf.prototype.doKeyUp=function(){var a=this.h;null!==a&&a.Ab.doKeyUp()};
  rf.prototype.doCancel=function(){null!==Lf&&Lf.doCancel();Qe.prototype.doCancel.call(this)};rf.prototype.findTool=function(a){w.i(a,"string",rf,"findTool:name");for(var b=this.lf.length,c=0;c<b;c++){var d=this.lf.na(c);if(d.name===a)return d}b=this.Uf.length;for(c=0;c<b;c++)if(d=this.Uf.na(c),d.name===a)return d;b=this.Vf.length;for(c=0;c<b;c++)if(d=this.Vf.na(c),d.name===a)return d;return null};
  rf.prototype.replaceTool=function(a,b){w.i(a,"string",rf,"replaceTool:name");null!==b&&(w.l(b,Qe,rf,"replaceTool:newtool"),b.h&&b.h!==this.h&&w.m("Cannot share tools between Diagrams: "+b.toString()),b.Ic(this.h));for(var c=this.lf.length,d=0;d<c;d++){var e=this.lf.na(d);if(e.name===a)return null!==b?this.lf.Mg(d,b):this.lf.md(d),e}c=this.Uf.length;for(d=0;d<c;d++)if(e=this.Uf.na(d),e.name===a)return null!==b?this.Uf.Mg(d,b):this.Uf.md(d),e;c=this.Vf.length;for(d=0;d<c;d++)if(e=this.Vf.na(d),e.name===
  a)return null!==b?this.Vf.Mg(d,b):this.Vf.md(d),e;return null};function ki(a,b,c,d){w.i(b,"string",rf,"replaceStandardTool:name");w.l(d,D,rf,"replaceStandardTool:list");null!==c&&(w.l(c,Qe,rf,"replaceStandardTool:newtool"),c.h&&c.h!==a.h&&w.m("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.Ic(a.h));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}w.A(rf,{lf:"mouseDownTools"},function(){return this.rH});w.A(rf,{Uf:"mouseMoveTools"},function(){return this.sH});
  w.A(rf,{Vf:"mouseUpTools"},function(){return this.tH});w.g(rf,"hoverDelay",rf.prototype.YE);w.defineProperty(rf,{YE:"hoverDelay"},function(){return this.qC},function(a){w.i(a,"number",rf,"hoverDelay");this.qC=a});w.g(rf,"holdDelay",rf.prototype.kA);w.defineProperty(rf,{kA:"holdDelay"},function(){return this.pC},function(a){w.i(a,"number",rf,"holdDelay");this.pC=a});w.g(rf,"dragSize",rf.prototype.CE);
  w.defineProperty(rf,{CE:"dragSize"},function(){return this.fC},function(a){w.l(a,fa,rf,"dragSize");this.fC=a.ba()});w.g(rf,"actionTool",rf.prototype.MD);w.defineProperty(rf,{MD:"actionTool"},function(){return this.findTool("Action")},function(a){ki(this,"Action",a,this.lf)});w.g(rf,"relinkingTool",rf.prototype.SA);w.defineProperty(rf,{SA:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){ki(this,"Relinking",a,this.lf)});w.g(rf,"linkReshapingTool",rf.prototype.wF);
  w.defineProperty(rf,{wF:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){ki(this,"LinkReshaping",a,this.lf)});w.g(rf,"resizingTool",rf.prototype.$A);w.defineProperty(rf,{$A:"resizingTool"},function(){return this.findTool("Resizing")},function(a){ki(this,"Resizing",a,this.lf)});w.g(rf,"rotatingTool",rf.prototype.kG);w.defineProperty(rf,{kG:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){ki(this,"Rotating",a,this.lf)});
  w.g(rf,"linkingTool",rf.prototype.AA);w.defineProperty(rf,{AA:"linkingTool"},function(){return this.findTool("Linking")},function(a){ki(this,"Linking",a,this.Uf)});w.g(rf,"draggingTool",rf.prototype.ud);w.defineProperty(rf,{ud:"draggingTool"},function(){return this.findTool("Dragging")},function(a){ki(this,"Dragging",a,this.Uf)});w.g(rf,"dragSelectingTool",rf.prototype.BE);
  w.defineProperty(rf,{BE:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){ki(this,"DragSelecting",a,this.Uf)});w.g(rf,"panningTool",rf.prototype.QF);w.defineProperty(rf,{QF:"panningTool"},function(){return this.findTool("Panning")},function(a){ki(this,"Panning",a,this.Uf)});w.g(rf,"contextMenuTool",rf.prototype.tw);w.defineProperty(rf,{tw:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){ki(this,"ContextMenu",a,this.Vf)});
  w.g(rf,"textEditingTool",rf.prototype.Ix);w.defineProperty(rf,{Ix:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){ki(this,"TextEditing",a,this.Vf)});w.g(rf,"clickCreatingTool",rf.prototype.aE);w.defineProperty(rf,{aE:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){ki(this,"ClickCreating",a,this.Vf)});w.g(rf,"clickSelectingTool",rf.prototype.bE);
  w.defineProperty(rf,{bE:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){ki(this,"ClickSelecting",a,this.Vf)});function gf(){this.mH=li;this.Ul=this.Vl=this.Y=null;this.KB=this.pd=this.cr=this.nj=!1;this.Xe=!0;this.Ju=this.Iu=this.WB=null;this.sy=0;this.Dy=600;this.vH=new x(0,0);this.MB=this.LB=this.GD=!1;this.no=new ia(P,mi)}w.ja("AnimationManager",gf);gf.prototype.Ic=function(a){this.Y=a};function li(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}
  gf.prototype.prepareAnimation=gf.prototype.zl=function(){this.Xe&&(this.nj&&this.Xi(),this.pd=!0,this.KB=!1)};function ni(a){a.Xe&&requestAnimationFrame(function(){!1===a.pd||a.nj||(a.Y.ym=1,oi(a.Y),a.pd=!1,a.Y.Ba("AnimationStarting"),pi(a))})}
  function qi(a,b,c,d,e){if(a.pd&&(t&&w.l(b,P,gf,"addPropToAnimation:obj"),!(b instanceof H)||b.oA)){var g=a.no;if(g.contains(b)){b=g.Aa(b);a=b.start;var h=b.end;void 0===a[c]&&(a[c]=ri(d));h[c]=ri(e)}else a=new na,h=new na,a[c]=ri(d),h[c]=ri(e),g.add(b,new mi(a,h))}}function ri(a){return a instanceof x?a.copy():a instanceof fa?a.copy():a}
  function pi(a){var b;void 0===b&&(b=new na);var c=a.Y;if(null!==c)if(0===a.no.count)a.nj=!1,si(c,!1),c.kf();else{a.nj=!0;var d=b.AK||a.mH,e=b.OK||null,g=b.PK||null,h=b.duration||a.Dy;b=a.vH;for(var k=a.no.k;k.next();){var l=k.value.start.position;l instanceof x&&(l.J()||l.assign(b))}a.WB=d;a.Iu=e;a.Ju=g;a.sy=h;var m=a.lH=a.no;ti(a);ui(a,c,m,d,0,h,null!==a.Vl&&null!==a.Ul);Jg(a.Y);vi(a);requestAnimationFrame(function(b){var e=b||+new Date,g=e+h;(function s(b){if(!1!==a.nj){b=b||+new Date;var k=b>g?
  h:b-e;ti(a);ui(a,c,m,d,k,h,null!==a.Vl&&null!==a.Ul);a.Iu&&a.Iu();Jg(c);vi(a);b>g?wi(a):requestAnimationFrame(s)}})(e)})}}var xi={opacity:function(a,b,c,d,e,g){a.opacity=d(e,b,c-b,g)},position:function(a,b,c,d,e,g){e!==g?a.vG(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):a.position=new x(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},scale:function(a,b,c,d,e,g){a.scale=d(e,b,c-b,g)},visible:function(a,b,c,d,e,g){a.visible=e!==g?b:c}};
  function ti(a){if(!a.cr){var b=a.Y;a.GD=b.$a;a.LB=b.du;a.MB=b.Rp;b.$a=!0;b.du=!0;b.Rp=!0;a.cr=!0}}function vi(a){var b=a.Y;b.$a=a.GD;b.du=a.LB;b.Rp=a.MB;a.cr=!1}function ui(a,b,c,d,e,g,h){for(c=c.k;c.next();){var k=c.key,l=c.value,m=l.start,l=l.end,n;for(n in l)if(void 0!==xi[n])xi[n](k,m[n],l[n],d,e,g)}h&&(h=a.Vl,a=a.Ul,n=a.y-h.y,a=d(e,h.x,a.x-h.x,g),d=d(e,h.y,n,g),e=b.Vw,b.Vw=!0,b.position=new x(a,d),b.Vw=e)}
  gf.prototype.stopAnimation=gf.prototype.Xi=function(){!0===this.pd&&(this.pd=!1,this.KB&&this.Y.Se());this.nj&&this.Xe&&(ti(this),ui(this,this.Y,this.lH,this.WB,this.sy,this.sy,null!==this.Vl&&null!==this.Ul),vi(this),wi(this))};function wi(a){a.nj=!1;a.Vl=null;a.Ul=null;a.no=new ia(P,mi);ti(a);for(var b=a.Y.links;b.next();){var c=b.value;null!==c.ro&&(c.points=c.ro,c.ro=null)}b=a.Y;si(b,!1);b.oc();b.kf();yi(b);vi(a);a.Ju&&a.Ju();a.Ju=null;a.Iu=null;b.Ba("AnimationFinished")}
  function zi(a,b,c){var d=b.ea,e=c.ea,g=null;c instanceof T&&(g=c.placeholder);null!==g?(c=g.qb(Ab),c.x+=g.padding.left,c.y+=g.padding.top,qi(a,b,"position",c,b.position)):qi(a,b,"position",new x(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position);qi(a,b,"opacity",.01,b.opacity)}function Ai(a,b,c){a.pd&&(null===a.Vl&&b.J()&&null===a.Ul&&(a.Vl=b.copy()),a.Ul=c.copy())}w.g(gf,"isEnabled",gf.prototype.isEnabled);
  w.defineProperty(gf,{isEnabled:"isEnabled"},function(){return this.Xe},function(a){w.i(a,"boolean",gf,"isEnabled");this.Xe=a});w.g(gf,"duration",gf.prototype.duration);w.defineProperty(gf,{duration:"duration"},function(){return this.Dy},function(a){w.i(a,"number",gf,"duration");1>a&&w.la(a,">= 1",gf,"duration");this.Dy=a});w.A(gf,{fh:"isAnimating"},function(){return this.nj});w.A(gf,{DK:"isTicking"},function(){return this.cr});function mi(a,b){this.start=a;this.end=b}
  function De(){0<arguments.length&&w.$c(De);w.jc(this);this.Y=null;this.Hb=new D(H);this.Xb="";this.Kf=1;this.Ty=!1;this.Xk=this.Cz=this.xk=this.wk=this.vk=this.uk=this.sk=this.tk=this.rk=this.zk=this.qk=this.yk=this.pk=this.ok=!0;this.Qy=!1;this.Ev=[]}w.ja("Layer",De);De.prototype.Ic=function(a){this.Y=a};
  De.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,g=0,h=0,k=this.Hb.k;k.next();){var l=k.value;l instanceof T?e++:l instanceof S?d++:l instanceof U?g++:l instanceof tf?h++:c++}k="";0<c&&(k+=c+" Parts ");0<d&&(k+=d+" Nodes ");0<e&&(k+=e+" Groups ");0<g&&(k+=g+" Links ");0<h&&(k+=h+" Adornments ");if(1<a)for(a=this.Hb.k;a.next();)c=a.value,k+="\n    "+c.toString(),d=c.data,null!==d&&w.Yc(d)&&(k+=" #"+w.Yc(d)),c instanceof S?k+=" "+
  je(d):c instanceof U&&(k+=" "+je(c.Z)+" "+je(c.da));return b+" "+this.Hb.count+": "+k};
  De.prototype.findObjectAt=De.prototype.re=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.Xk)return null;t&&!a.J()&&w.m("findObjectAt: Point must have a real value.");var d=!1;this.h.ub.Ea(a)&&(d=!0);for(var e=w.M(),g=this.Hb.q,h=g.length;h--;){var k=g[h];if((!0!==d||!1!==Bi(k))&&k.Ja()&&(e.assign(a),Xa(e,k.Nf),k=k.re(e,b,c),null!==k&&(null!==b&&(k=b(k)),null!==k&&(null===c||c(k)))))return w.B(e),k}w.B(e);return null};
  De.prototype.findObjectsAt=De.prototype.Vo=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof D||d instanceof F||(d=new F(P));if(!1===this.Xk)return d;t&&!a.J()&&w.m("findObjectsAt: Point must have a real value.");var e=!1;this.h.ub.Ea(a)&&(e=!0);for(var g=w.M(),h=this.Hb.q,k=h.length;k--;){var l=h[k];!0===e&&!1===Bi(l)||!l.Ja()||(g.assign(a),Xa(g,l.Nf),l.Vo(g,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l)))}w.B(g);return d};
  De.prototype.findObjectsIn=De.prototype.ck=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof D||e instanceof F||(e=new F(P));if(!1===this.Xk)return e;t&&!a.J()&&w.m("findObjectsIn: Rect must have a real value.");var g=!1;this.h.ub.Vj(a)&&(g=!0);for(var h=this.Hb.q,k=h.length;k--;){var l=h[k];(!0!==g||!1!==Bi(l))&&l.Ja()&&l.ck(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}return e};
  De.prototype.$z=function(a,b,c,d,e,g,h){if(!1===this.Xk)return e;for(var k=this.Hb.q,l=k.length;l--;){var m=k[l];(!0!==h||!1!==Bi(m))&&g(m)&&m.Ja()&&m.ck(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}return e};
  De.prototype.findObjectsNear=De.prototype.Qm=function(a,b,c,d,e,g){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof D||e instanceof F)g=e;e=!0}g instanceof D||g instanceof F||(g=new F(P));if(!1===this.Xk)return g;t&&!a.J()&&w.m("findObjectsNear: Point must have a real value.");var h=!1;this.h.ub.Ea(a)&&(h=!0);for(var k=w.M(),l=w.M(),m=this.Hb.q,n=m.length;n--;){var p=m[n];!0===h&&!1===Bi(p)||!p.Ja()||(k.assign(a),Xa(k,p.Nf),l.o(a.x+b,a.y),Xa(l,p.Nf),
  p.Qm(k,l,c,d,e,g)&&(null!==c&&(p=c(p)),null===p||null!==d&&!d(p)||g.add(p)))}w.B(k);w.B(l);return g};f=De.prototype;f.Ef=function(a,b){if(this.visible){var c;c=void 0===b?a.ub:b;for(var d=this.Hb.q,e=d.length,g=0;g<e;g++){var h=d[g];h.HC=g;if(!(h instanceof U&&!1===h.qg)){if(h instanceof tf){var k=h;if(null!==k.Nh)continue}if(ib(h.ea,c))for(h.Ef(!0),Ci(h),h=h.hw;h.next();)k=h.value,Xh(k,Infinity,Infinity),k.Fc(),k.Ef(!0);else h.Ef(!1),null!==h.hw&&0<h.hw.count&&Ci(h)}}}};
  f.bf=function(a,b,c,d){if(this.visible&&(void 0===d&&(d=!0),d||!this.Ac)){1!==this.Kf&&(a.globalAlpha=this.Kf);c=this.Ev;c.length=0;d=b.scale;for(var e=this.Hb.q,g=e.length,h=0;h<g;h++){var k=e[h];if(Bi(k)||Pi(k)){if(k instanceof U){var l=k;l.gc&&c.push(l);if(!1===l.qg)continue}l=k.ea;1<l.width*d||1<l.height*d?k.bf(a,b):Qi(k,a)}}a.globalAlpha=1}};
  function Ri(a,b,c,d){if(a.visible){b.globalAlpha=a.Kf;var e=a.Ev;e.length=0;var g=c.scale;a=a.Hb.q;for(var h=a.length,k=d.length,l=0;l<h;l++){var m=a[l];if(Bi(m)||Pi(m)){if(m instanceof U){var n=m;n.gc&&e.push(n);if(!1===n.qg)continue}var n=Si(m,m.ea),p;a:{p=n;for(var q=d,r=k,s=2/g,u=4/g,v=0;v<r;v++){var A=q[v];if(0!==A.width&&0!==A.height&&p.fF(A.x-s,A.y-s,A.width+u,A.height+u)){p=!0;break a}}p=!1}p&&(1<n.width*g||1<n.height*g?m.bf(b,c):Qi(m,b))}}b.globalAlpha=1}}
  f.j=function(a,b,c,d,e){var g=this.h;null!==g&&g.Hc(fe,a,this,b,c,d,e)};f.fp=function(a,b,c){var d=this.Hb;b.lv=this;if(a>=d.count)a=d.count;else if(d.na(a)===b)return-1;d.ce(a,b);b.ut(c);d=this.h;null!==d&&(c?d.pa():d.fp(b));b instanceof T&&this.Ex(b);return a};f.ef=function(a,b,c){var d=this.Hb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.na(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.vt(c);d.md(a);d=this.h;null!==d&&(c?d.pa():d.ef(b));b.lv=null;return a};
  f.Ex=function(a){for(;null!==a;){if(a.layer===this){var b=a;if(0!==b.Rc.count){for(var c=-1,d=-1,e=this.Hb.q,g=e.length,h=0;h<g;h++){var k=e[h];if(k===b&&(c=h,0<=d))break;if(0>d&&k.Va===b&&(d=h,0<=c))break}!(0>d)&&d<c&&(e=this.Hb,e.md(c),e.ce(d,b))}}a=a.Va}};f.clear=function(){for(var a=this.Hb.Ue(),b=a.length,c=0;c<b;c++)a[c].Ef(!1),this.ef(-1,a[c],!1)};w.A(De,{hk:"parts"},function(){return this.Hb.k});w.A(De,{SK:"partsBackwards"},function(){return this.Hb.Zm});w.A(De,{h:"diagram"},function(){return this.Y});
  w.g(De,"name",De.prototype.name);w.defineProperty(De,{name:"name"},function(){return this.Xb},function(a){w.i(a,"string",De,"name");var b=this.Xb;if(b!==a){var c=this.h;if(null!==c)for(""===b&&w.m("Cannot rename default Layer to: "+a),c=c.hx;c.next();)c.value.name===a&&w.m("Layer.name is already present in this diagram: "+a);this.Xb=a;this.j("name",b,a);for(a=this.Hb.k;a.next();)a.value.hf=this.Xb}});w.g(De,"opacity",De.prototype.opacity);
  w.defineProperty(De,{opacity:"opacity"},function(){return this.Kf},function(a){var b=this.Kf;b!==a&&(w.i(a,"number",De,"opacity"),(0>a||1<a)&&w.la(a,"0 <= value <= 1",De,"opacity"),this.Kf=a,this.j("opacity",b,a),a=this.h,null!==a&&a.pa())});w.g(De,"isTemporary",De.prototype.Ac);w.defineProperty(De,{Ac:"isTemporary"},function(){return this.Ty},function(a){var b=this.Ty;b!==a&&(w.i(a,"boolean",De,"isTemporary"),this.Ty=a,this.j("isTemporary",b,a))});w.g(De,"visible",De.prototype.visible);
  w.defineProperty(De,{visible:"visible"},function(){return this.Cz},function(a){var b=this.Cz;if(b!==a){w.i(a,"boolean",De,"visible");this.Cz=a;this.j("visible",b,a);for(b=this.Hb.k;b.next();)b.value.Qe(a);a=this.h;null!==a&&a.pa()}});w.g(De,"pickable",De.prototype.Cf);w.defineProperty(De,{Cf:"pickable"},function(){return this.Xk},function(a){var b=this.Xk;b!==a&&(w.i(a,"boolean",De,"pickable"),this.Xk=a,this.j("pickable",b,a))});w.g(De,"isBoundsIncluded",De.prototype.pA);
  w.defineProperty(De,{pA:"isBoundsIncluded"},function(){return this.Qy},function(a){this.Qy!==a&&(this.Qy=a,null!==this.h&&this.h.oc())});w.g(De,"allowCopy",De.prototype.Oh);w.defineProperty(De,{Oh:"allowCopy"},function(){return this.ok},function(a){var b=this.ok;b!==a&&(w.i(a,"boolean",De,"allowCopy"),this.ok=a,this.j("allowCopy",b,a))});w.g(De,"allowDelete",De.prototype.Rj);
  w.defineProperty(De,{Rj:"allowDelete"},function(){return this.pk},function(a){var b=this.pk;b!==a&&(w.i(a,"boolean",De,"allowDelete"),this.pk=a,this.j("allowDelete",b,a))});w.g(De,"allowTextEdit",De.prototype.Io);w.defineProperty(De,{Io:"allowTextEdit"},function(){return this.yk},function(a){var b=this.yk;b!==a&&(w.i(a,"boolean",De,"allowTextEdit"),this.yk=a,this.j("allowTextEdit",b,a))});w.g(De,"allowGroup",De.prototype.Fo);
  w.defineProperty(De,{Fo:"allowGroup"},function(){return this.qk},function(a){var b=this.qk;b!==a&&(w.i(a,"boolean",De,"allowGroup"),this.qk=a,this.j("allowGroup",b,a))});w.g(De,"allowUngroup",De.prototype.Jo);w.defineProperty(De,{Jo:"allowUngroup"},function(){return this.zk},function(a){var b=this.zk;b!==a&&(w.i(a,"boolean",De,"allowUngroup"),this.zk=a,this.j("allowUngroup",b,a))});w.g(De,"allowLink",De.prototype.Cm);
  w.defineProperty(De,{Cm:"allowLink"},function(){return this.rk},function(a){var b=this.rk;b!==a&&(w.i(a,"boolean",De,"allowLink"),this.rk=a,this.j("allowLink",b,a))});w.g(De,"allowRelink",De.prototype.Sj);w.defineProperty(De,{Sj:"allowRelink"},function(){return this.tk},function(a){var b=this.tk;b!==a&&(w.i(a,"boolean",De,"allowRelink"),this.tk=a,this.j("allowRelink",b,a))});w.g(De,"allowMove",De.prototype.Gi);
  w.defineProperty(De,{Gi:"allowMove"},function(){return this.sk},function(a){var b=this.sk;b!==a&&(w.i(a,"boolean",De,"allowMove"),this.sk=a,this.j("allowMove",b,a))});w.g(De,"allowReshape",De.prototype.Go);w.defineProperty(De,{Go:"allowReshape"},function(){return this.uk},function(a){var b=this.uk;b!==a&&(w.i(a,"boolean",De,"allowReshape"),this.uk=a,this.j("allowReshape",b,a))});w.g(De,"allowResize",De.prototype.Dm);
  w.defineProperty(De,{Dm:"allowResize"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(w.i(a,"boolean",De,"allowResize"),this.vk=a,this.j("allowResize",b,a))});w.g(De,"allowRotate",De.prototype.Ho);w.defineProperty(De,{Ho:"allowRotate"},function(){return this.wk},function(a){var b=this.wk;b!==a&&(w.i(a,"boolean",De,"allowRotate"),this.wk=a,this.j("allowRotate",b,a))});w.g(De,"allowSelect",De.prototype.Ee);
  w.defineProperty(De,{Ee:"allowSelect"},function(){return this.xk},function(a){var b=this.xk;b!==a&&(w.i(a,"boolean",De,"allowSelect"),this.xk=a,this.j("allowSelect",b,a))});
  function C(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);Ti(c)}1<arguments.length&&w.m("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");w.jc(this);Ui=[];this.yc=!0;this.bi=new gf;this.bi.Ic(this);this.Fd=17;var c=this;null!==window.document.body?Ti(this):window.document.addEventListener("DOMContentLoaded",b,!1);this.CC=!1;this.dc=new D(De);this.Eb=this.Fb=0;this.Fh=this.Nb=this.Sg=this.mb=null;this.bG();this.Qq=null;this.aG();
  this.Oa=(new x(NaN,NaN)).freeze();this.ec=1;this.cv=(new x(NaN,NaN)).freeze();this.dv=NaN;this.uv=1E-4;this.rv=100;this.Yd=new ga;this.ew=(new x(NaN,NaN)).freeze();this.Vu=(new y(NaN,NaN,NaN,NaN)).freeze();this.nz=(new eb(0,0,0,0)).freeze();this.oz=Vi;this.jz=this.hz=null;this.Ml=Cf;this.Bn=zc;this.Lk=Cf;this.Xn=zc;this.ev=this.bv=Ab;this.fg=new F(P);this.Sd=!0;this.Sq=!1;this.Tl=new ia(U,y);this.Nn=!0;this.iH=250;this.wn=-1;this.zu=(new eb(16,16,16,16)).freeze();this.Nu=this.Mf=!1;this.Rn=!0;this.Fk=
  new Sd;this.Mc=new Sd;this.Sb=new Sd;this.dj=null;this.Wv=-1;this.Vv=!1;this.zy=this.Ay=null;Wi(this);this.Nr=new F(S);this.$k=new F(T);this.qr=new F(U);this.Hb=new F(H);this.iv=!0;this.sC=!1;this.bw=Ng;this.qj=10;this.ty=this.xy=this.zz=null;this.qy="";this.Aq="auto";this.gi=this.Bi=this.ri=this.xv=this.si=this.ti=this.ui=this.fi=this.ki=this.di=null;this.Vn=!0;this.bz=!1;this.aD={};this.Xr=0;this.Lf=[null,null];this.hy=null;this.jv=this.sn=this.yy=this.pz=this.jD=this.yi=!1;this.EC=!0;this.Ry=this.Bd=
  !1;this.Ud=null;var d=this;this.LC=function(a){if(a.fa===d.fa&&d.Pa){d.Pa=!1;try{var b=a.sd;""===a.Bf&&b===fe&&Xi(d,a.object,a.propertyName)}finally{d.Pa=!0}}};this.MC=function(a){Yi(d,a)};this.JD=!0;this.Ug=-2;this.hi=new ia(Object,H);this.Dk=new ia(Object,U);this.am=new ia(Object,Array);this.Nk=!1;this.pk=this.ok=this.pu=this.Xe=!0;this.ru=this.qu=!1;this.wu=this.uu=this.xk=this.wk=this.vk=this.uk=this.sk=this.tk=this.rk=this.tu=this.zk=this.qk=this.yk=!0;this.Yl=this.AC=!1;this.vu=this.su=this.$u=
  this.Zu=!0;this.Lv=this.Kv=16;this.kz=this.Jv=!1;this.mz=this.lz=this.Fj=this.Ej=null;this.$e=(new eb(5)).freeze();this.Ov=(new F(H)).freeze();this.sv=999999999;this.av=(new F(H)).freeze();this.Mk=this.Wl=this.mi=!0;this.Jk=this.Ik=!1;this.Td=null;this.xu=!0;this.rf=!1;this.qd=null;this.SC=1;this.Ky=!1;this.nD=0;this.HD=(new y(NaN,NaN,NaN,NaN)).freeze();this.Ou=(new y(NaN,NaN,NaN,NaN)).freeze();this.jm=new F(Zi);$i(this);this.nv=this.Xu=this.zv=this.$B=this.ZB=this.aC=this.rj=this.Gk=this.vi=null;
  aj(this);this.ed=null;this.Wu=!1;this.Cn=null;this.tb=new rf;this.tb.initializeStandardTools();this.Wa=this.yw=this.tb;this.Ab=new qa;this.fa=new R;this.yi=!0;this.Lb=new Re;this.yi=!1;this.kC=this.Cy=null;this.tf=1;this.ym=null;this.Kk=new bj;void 0!==a&&cj(this,a);this.cm=1;this.dm=0;this.GC=new x;this.ED=500;this.yu=new x;this.ys=null;this.yc=this.Uy=!1}w.ja("Diagram",C);
  function aj(a){a.vi=new ia("string",H);var b=new S,c=new oa;c.bind(new kf("text","",je));b.add(c);a.aC=b;a.vi.add("",b);b=new S;c=new oa;c.stroke="brown";c.bind(new kf("text","",je));b.add(c);a.vi.add("Comment",b);b=new S;b.ik=!1;b.Qz=!1;c=new W;c.Bb="Ellipse";c.fill="black";c.stroke=null;c.ya=(new fa(3,3)).Ma();b.add(c);a.vi.add("LinkLabel",b);a.Gk=new ia("string",T);b=new T;b.xx="GROUPPANEL";b.type=dj;c=new oa;c.font="bold 12pt sans-serif";c.bind(new kf("text","",je));b.add(c);c=new z(ej);c.name=
  "GROUPPANEL";var d=new W;d.Bb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new xh;d.padding=(new eb(5,5,5,5)).Ma();c.add(d);b.add(c);a.ZB=b;a.Gk.add("",b);a.rj=new ia("string",U);b=new U;c=new W;c.Tf=!0;b.add(c);c=new W;c.ln="Standard";c.fill="black";c.stroke=null;c.ib=0;b.add(c);a.$B=b;a.rj.add("",b);b=new U;c=new W;c.Tf=!0;c.stroke="brown";b.add(c);a.rj.add("Comment",b);b=new tf;b.type=ej;c=new W;c.fill=null;c.stroke="dodgerblue";c.ib=3;b.add(c);c=new xh;c.margin=(new eb(1.5,
  1.5,1.5,1.5)).Ma();b.add(c);a.zv=b;a.Xu=b;b=new tf;b.type=gh;c=new W;c.Tf=!0;c.fill=null;c.stroke="dodgerblue";c.ib=3;b.add(c);a.nv=b}
  function Ti(a){var b=w.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=w.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.Fd=d-b}
  C.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.id&&(b=this.id);this.$j&&this.$j.id&&(b=this.$j.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.dc.k;c.next();)b+="\n  "+c.value.toString(a-1);return b};C.prototype.checkProperties=function(){return w.check(this)};C.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Y instanceof C?b.Y:null};w.g(C,"div",C.prototype.$j);
  w.defineProperty(C,{$j:"div"},function(){return this.Nb},function(a){null!==a&&w.l(a,HTMLDivElement,C,"div");if(this.Nb!==a){Ui=[];var b=this.Nb;null!==b?(b.Y=void 0,b.innerHTML="",null!==this.mb&&(this.mb.removeEventListener("touchstart",this.NG,!1),this.mb.removeEventListener("touchmove",this.MG,!1),this.mb.removeEventListener("touchend",this.LG,!1),this.mb.Jd.Y=null),b=this.tb,null!==b&&(b.lf.each(function(a){a.cancelWaitAfter()}),b.Uf.each(function(a){a.cancelWaitAfter()}),b.Vf.each(function(a){a.cancelWaitAfter()})),
  b.cancelWaitAfter(),this.Wa.doCancel(),this.Sg=this.mb=null,window.removeEventListener("resize",this.$G,!1),window.removeEventListener("mousemove",this.Ap,!0),window.removeEventListener("mousedown",this.zp,!0),window.removeEventListener("mouseup",this.Cp,!0),window.removeEventListener("mousewheel",this.hh,!0),window.removeEventListener("DOMMouseScroll",this.hh,!0),window.removeEventListener("mouseout",this.Bp,!0)):this.rf=!1;this.Nb=null;if(null!==a){if(b=a.Y)b.$j=null;cj(this,a);this.RA()}}});
  function fj(a){var b=a.mb;b.addEventListener("touchstart",a.NG,!1);b.addEventListener("touchmove",a.MG,!1);b.addEventListener("touchend",a.LG,!1);b.addEventListener("mousemove",a.Ap,!1);b.addEventListener("mousedown",a.zp,!1);b.addEventListener("mouseup",a.Cp,!1);b.addEventListener("mousewheel",a.hh,!1);b.addEventListener("DOMMouseScroll",a.hh,!1);b.addEventListener("mouseout",a.Bp,!1);b.addEventListener("keydown",a.hJ,!1);b.addEventListener("keyup",a.iJ,!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.Tm===ii&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.EJ,!1);b.addEventListener("pointermove",a.GJ,!1);b.addEventListener("pointerleave",a.FJ,!1);window.addEventListener("resize",a.$G,!1)}function si(a,b){a.ym=null;b&&a.SF()}
  C.prototype.computePixelRatio=function(){if(null!==this.ym)return this.ym;var a=this.Sg;return(window.devicePixelRatio||1)/(a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1)};C.prototype.doMouseMove=function(){this.Wa.doMouseMove()};C.prototype.doMouseDown=function(){this.Wa.doMouseDown()};C.prototype.doMouseUp=function(){this.Wa.doMouseUp()};C.prototype.doMouseWheel=function(){this.Wa.doMouseWheel()};
  C.prototype.doKeyDown=function(){this.Wa.doKeyDown()};C.prototype.doKeyUp=function(){this.Wa.doKeyUp()};function oi(a){if(null!==a.mb){var b=a.Nb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.Jk?a.Fd:0,d=a.Ik?a.Fd:0,e=a.tf;a.tf=a.computePixelRatio();a.tf!==e&&(a.Sq=!0,a.Se());if(b.clientWidth!==a.Fb+c||b.clientHeight!==a.Eb+d)a.Wl=!0,a.Sd=!0,b=a.Lb,null!==b&&b.Ct&&b.K(),a.Bd||a.Se()}}}C.prototype.focus=C.prototype.focus=function(){this.mb&&this.mb.focus()};
  function gj(a,b,c){void 0===b&&(b=a.Sg);void 0===c&&(c=!0);c&&(b.nu="");b.qn="";b.pn=""}function $i(a){var b=new De;b.name="Background";a.Ss(b);b=new De;b.name="";a.Ss(b);b=new De;b.name="Foreground";a.Ss(b);b=new De;b.name="Adornment";b.Ac=!0;a.Ss(b);b=new De;b.name="Tool";b.Ac=!0;b.pA=!0;a.Ss(b);b=new De;b.name="Grid";b.Ee=!1;b.Cf=!1;b.Ac=!0;a.HH(b,a.mt("Background"))}
  function hj(a){a.ed=new z(ij);a.ed.name="GRID";var b=new W;b.Bb="LineH";b.stroke="lightgray";b.ib=.5;b.interval=1;a.ed.add(b);b=new W;b.Bb="LineH";b.stroke="gray";b.ib=.5;b.interval=5;a.ed.add(b);b=new W;b.Bb="LineH";b.stroke="gray";b.ib=1;b.interval=10;a.ed.add(b);b=new W;b.Bb="LineV";b.stroke="lightgray";b.ib=.5;b.interval=1;a.ed.add(b);b=new W;b.Bb="LineV";b.stroke="gray";b.ib=.5;b.interval=5;a.ed.add(b);b=new W;b.Bb="LineV";b.stroke="gray";b.ib=1;b.interval=10;a.ed.add(b);b=new H;b.add(a.ed);
  b.hf="Grid";b.Xw=!1;b.oA=!1;b.Cf=!1;b.kx="GRID";a.add(b);a.Hb.remove(b);a.ed.visible=!1}
  C.prototype.RC=function(){if(this.Y.isEnabled){var a=this.Y;if(a.kz&&null!==a.mb){a.Jv=!0;var b=a.Hd,c=a.ub,d=b.width,e=c.width,g=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<g){var s=w.M();this.gD&&a.De?(s.o(this.scrollLeft/r+p,a.position.y),a.position=s):this.hD&&a.Fe&&(s.o(a.position.x,this.scrollTop/r+b),a.position=s);w.B(s);a.Jv=!1;a.Wl=!1}else s=w.M(),this.gD&&a.De&&(p<q&&(a.position=new x(this.scrollLeft+p,a.position.y)),k>l&&(a.position=
  new x(-(a.Ej.scrollWidth-a.Fb)+this.scrollLeft-a.Fb/r+a.Hd.right,a.position.y))),this.hD&&a.Fe&&(b<c&&(a.position=new x(a.position.x,this.scrollTop+b)),m>n&&(a.position=new x(a.position.x,-(a.Fj.scrollHeight-a.Eb)+this.scrollTop-a.Eb/r+a.Hd.bottom))),w.B(s),jj(a),a.Jv=!1,a.Wl=!1,b=a.Hd,c=a.ub,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.lz.style.width="1px"),h>=g&&b>=c&&m<=n&&(a.mz.style.height="1px")}}else kj(this.Y)};
  C.prototype.Bv=function(){this.Y.isEnabled?this.Y.kz=!0:kj(this.Y)};C.prototype.computeBounds=C.prototype.tg=function(){0<this.fg.count&&lj(this);return mj(this)};function mj(a){if(a.aA.J()){var b=a.aA.copy();b.gw(a.padding);return b}for(var c=!0,d=a.dc.q,e=d.length,g=0;g<e;g++){var h=d[g];if(h.visible&&(!h.Ac||h.pA))for(var h=h.Hb.q,k=h.length,l=0;l<k;l++){var m=h[l];m.Xw&&m.Ja()&&(m=m.ea,m.J()&&(c?(c=!1,b=m.copy()):b.$h(m)))}}c&&(b=new y(0,0,0,0));b.gw(a.padding);return b}
  C.prototype.computePartsBounds=function(a){var b=null;for(a=a.k;a.next();){var c=a.value;c instanceof U||(c.vf(),null===b?b=c.ea.copy():b.$h(c.ea))}return null===b?new y(NaN,NaN,0,0):b};
  function nj(a,b){if((b||a.rf)&&!a.yc&&null!==a.mb&&!a.Pb.fh&&a.Hd.J()){a.yc=!0;var c=a.Ml;b&&a.Lk!==Cf&&(c=a.Lk);var d=c!==Cf?oj(a,c):a.scale,c=a.ub.copy(),e=a.Fb/d,g=a.Eb/d,h=null,k=a.Pb;k.pd&&(h=a.Oa.copy());a.position.Na();var l=a.Bn;b&&!l.kd()&&a.Xn.kd()&&(l=a.Xn);pj(a,a.Oa,a.Hd,e,g,l,b);a.position.freeze();null!==h&&Ai(k,h,a.Oa);a.scale=d;a.yc=!1;d=a.ub;d.Ne(c)||a.Nt(c,d)}}
  function oj(a,b){var c=a.Ab.it;if(null===a.mb)return c;a.mi&&qj(a,a.tg());var d=a.Hd;if(!d.J())return c;var e=d.width,d=d.height,g=a.Fb,h=a.Eb,k=g/e,l=h/d;return b===rj?(e=Math.min(l,k),e>c&&(e=c),e<a.Dg&&(e=a.Dg),e>a.Cg&&(e=a.Cg),e):b===sj?(e=l>k?(h-a.Fd)/d:(g-a.Fd)/e,e>c&&(e=c),e<a.Dg&&(e=a.Dg),e>a.Cg&&(e=a.Cg),e):a.scale}C.prototype.zoomToFit=C.prototype.zoomToFit=function(){this.scale=oj(this,rj)};
  C.prototype.zoomToRect=function(a,b){void 0===b&&(b=rj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===rj||b===sj)if(isNaN(c))e=this.ub.height*this.scale/d;else if(isNaN(d))e=this.ub.width*this.scale/c;else var e=this.Fb,g=this.Eb,e=b===sj?g/d>e/c?(g-(this.Ik?this.Fd:0))/d:(e-(this.Jk?this.Fd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new x(a.x,a.y)}};w.g(C,"isAligning",C.prototype.Vw);
  w.defineProperty(C,{Vw:null},function(){return this.yc},function(a){this.yc=a});C.prototype.alignDocument=function(a,b){this.mi&&qj(this,this.tg());var c=this.Hd,d=this.ub,e=this.yc;this.yc=!0;this.position=new x(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.yc=e;this.pa()};
  function pj(a,b,c,d,e,g,h){var k=b.x,l=b.y;if(h||a.dB===Vi)g.kd()&&(d>c.width&&(k=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(l=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY))),g=a.cB,h=d-c.width,d<c.width+g.left+g.right?(k=Math.min(k+d/2,c.right+Math.max(h,g.right)-d/2),k=Math.max(k,c.left-Math.max(h,g.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+g.top+g.bottom?(l=Math.min(l+e/2,c.bottom+Math.max(d,g.bottom)-e/2),l=Math.max(l,c.top-Math.max(d,
  g.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.LA&&(a=a.LA(a,b),b.x=a.x,b.y=a.y)}C.prototype.findPartAt=C.prototype.ot=function(a,b){var c=b?Cg(this,a,function(a){return a.V},function(a){return a.canSelect()}):Cg(this,a,function(a){return a.V});return c instanceof H?c:null};
  C.prototype.findObjectAt=C.prototype.re=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);lj(this);for(var d=this.dc.Zm;d.next();){var e=d.value;if(e.visible&&(e=e.re(a,b,c),null!==e))return e}return null};function Cg(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);lj(a);for(a=a.dc.Zm;a.next();){var e=a.value;if(e.visible&&!e.Ac&&(e=e.re(b,c,d),null!==e))return e}return null}
  C.prototype.findObjectsAt=C.prototype.Vo=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof D||d instanceof F||(d=new F(P));lj(this);for(var e=this.dc.Zm;e.next();){var g=e.value;g.visible&&g.Vo(a,b,c,d)}return d};C.prototype.findObjectsIn=C.prototype.ck=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof D||e instanceof F||(e=new F(P));lj(this);for(var g=this.dc.Zm;g.next();){var h=g.value;h.visible&&h.ck(a,b,c,d,e)}return e};
  C.prototype.$z=function(a,b,c,d,e,g){var h=new F(P);lj(this);for(var k=this.dc.Zm;k.next();){var l=k.value;l.visible&&l.$z(a,b,c,d,h,e,g)}return h};C.prototype.findObjectsNear=C.prototype.Qm=function(a,b,c,d,e,g){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof D||e instanceof F)g=e;e=!0}g instanceof D||g instanceof F||(g=new F(P));lj(this);for(var h=this.dc.Zm;h.next();){var k=h.value;k.visible&&k.Qm(a,b,c,d,e,g)}return g};
  function Ff(a){-1!==a.Wv&&(w.clearTimeout(a.Wv),a.Wv=-1)}function tj(a,b){var c=b.copy();a.Wv=w.setTimeout(function(){c.button=2;a.P=c;a.Vv=!0;a.doMouseUp()},850)}C.prototype.acceptEvent=function(a){var b=this.Mc;this.Mc=this.Sb;this.Sb=b;uj(this,this,a,b,a instanceof MouseEvent);return b};
  function uj(a,b,c,d,e){d.h=b;e?vj(a,c,d):(d.We=b.Sb.We,d.ga=b.Sb.ga);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.Zc=a;d.button=c.button;w.Xm&&0===c.button&&c.ctrlKey&&(d.button=2);d.ak=!1;d.up=!1;d.Je=1;d.Yj=0;d.Oc=!1;d.bubbles=!1;d.event=c;d.timestamp=Date.now();d.At=!1;d.Zf=c.target.Y?c.target.Y:null;d.ie=null}
  function wj(a,b,c,d,e){d.h=a;vj(a,c,d);d.Zc=0;d.button=0;d.ak=!0;d.up=!1;d.Je=1;d.Yj=0;d.Oc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.At=e;d.Zf=b.target.Y?b.target.Y:null;d.ie=null;a.Fk=d.copy();Lf=null}
  function xj(a,b,c,d,e){var g=null;d.h=a;if(null!==c){var g=window.document.elementFromPoint(c.clientX,c.clientY),h;g&&g.Y?h=g.Y:(c=b.changedTouches[0],h=a);vj(a,c,d)}else null!==a.Mc?(d.ga=a.Mc.ga,d.We=a.Mc.We,d.Zf=a.Mc.Zf):null!==a.Fk&&(d.ga=a.Fk.ga,d.We=a.Fk.We,d.Zf=a.Fk.Zf);d.Zc=0;d.button=0;d.ak=!1;d.up=!1;d.Je=1;d.Yj=0;d.Oc=!1;d.bubbles=!1;d.event=b;d.timestamp=Date.now();d.At=e;d.Zf=h;d.ie=null}
  function yj(a,b,c){if(b.bubbles)return t&&t.WE&&w.trace("NOT handled "+c.type+" "+b.toString()),!0;t&&t.WE&&w.trace("handled "+c.type+" "+a.Wa.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();(void 0===c.touches||2>c.touches.length)&&c.preventDefault();c.cancelBubble=!0;return!1}
  C.prototype.hJ=function(a){if(!this.Y.isEnabled)return!1;var b=this.Y.Sb;uj(this.Y,this.Y,a,b,!1);b.key=String.fromCharCode(a.which);b.ak=!0;switch(a.which){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?yj(this.Y,b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)};
  C.prototype.iJ=function(a){if(!this.Y.isEnabled)return!1;var b=this.Y.Sb;uj(this.Y,this.Y,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){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 yj(this.Y,b,a)};
  C.prototype.Lq=function(a){var b=this.mb;if(null===b)return new x(0,0);var c=this.Fb,d=this.Eb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Yd?(a=new x(c,a),Xa(a,this.Yd),a):new x(c,a)};function vj(a,b,c){var d=a.mb,e=a.Fb,g=a.Eb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-g/d.height*d.top);c.We.o(h,k);null!==a.Yd?(b=w.ic(h,k),a.Yd.Th(b),c.ga.assign(b),w.B(b)):c.ga.o(h,k)}
  C.prototype.invalidateDocumentBounds=C.prototype.oc=function(){this.mi||(this.mi=!0,this.Se())};function yi(a){a.Bd||lj(a);a.mi&&qj(a,a.tg());for(a=a.jm.k;a.next();)yi(a.value)}C.prototype.redraw=C.prototype.RA=function(){this.yc||this.Bd||(this.pa(),zj(this),jj(this),this.oc(),this.kf())};C.prototype.isUpdateRequested=function(){return this.Mf};
  C.prototype.delayInitialization=C.prototype.AI=function(a){void 0===a&&(a=null);var b=this.Pb,c=b.isEnabled;b.Xi();b.isEnabled=!1;Jg(this);this.rf=!1;b.isEnabled=c;null!==a&&w.setTimeout(a,1)};C.prototype.requestUpdate=C.prototype.Se=function(a){void 0===a&&(a=!1);if(!0!==this.Mf&&!(this.yc||!1===a&&this.Bd)){this.Mf=!0;var b=this;requestAnimationFrame(function(){b.Mf&&b.kf()})}};C.prototype.maybeUpdate=C.prototype.kf=function(){if(!this.Rn||this.Mf)this.Rn&&(this.Rn=!1),Jg(this)};
  function Aj(a,b){a.yc||!a.Wl||kj(a)||(b&&lj(a),nj(a,!1))}
  function Jg(a){if(!a.Bd&&(a.Mf=!1,null!==a.Nb)){a.Bd=!0;var b=a.bi,c=!1,d=!1;b.fh&&(d=!0,c=a.$a,a.$a=!0);b.pd||oi(a);Aj(a,!1);null!==a.ed&&(a.ed.visible&&!a.Wu&&(Bj(a),a.Wu=!0),!a.ed.visible&&a.Wu&&(a.Wu=!1));lj(a);0!==a.Tl.count&&(Cj(a),lj(a));var e=!1;if(!a.rf||a.xu)a.rf?Dj(a,!a.Nu):(a.ac("Initial Layout"),!1===b.isEnabled&&b.Xi(),Dj(a,!1)),e=!0;a.Nu=!1;lj(a);a.pz||b.fh||yi(a);e&&(a.rf||(b=a.dc.q,a.Ef(b,b.length,a),Ej(a),Bj(a)),a.Ba("LayoutCompleted"));lj(a);Aj(a,!0);e&&!a.rf&&(a.rf=!0,a.ae("Initial Layout"),
  a.$a||a.ka.clear(),w.setTimeout(function(){a.gh=!1},1));a.bf();d&&(a.$a=c);a.Bd=!1}}function Ej(a){if(a.Lk!==Cf)a.scale=oj(a,a.Lk);else if(a.Ml!==Cf)a.scale=oj(a,a.Ml);else{var b=a.cF;isFinite(b)&&0<b&&(a.scale=b)}a.mi&&qj(a,a.tg());b=a.bF;if(b.J())a.position=b;else{b=w.M();b.bu(a.Hd,a.aF);var c=a.ub,c=w.lk(0,0,c.width,c.height),d=w.M();d.bu(c,a.dF);a.position=new x(b.x-d.x,b.y-d.y);w.nc(c);w.B(d);w.B(b);nj(a,!0)}a.Ba("InitialLayoutCompleted")}
  function lj(a){if((a.Bd||!a.Pb.fh)&&0!==a.fg.count)for(var b=0;23>b;b++){var c=a.fg.k;if(null===c||0===a.fg.count)break;a.fg=new F(P);var d=a,e=a.fg;for(c.reset();c.next();){var g=c.value;!g.Kd()||g instanceof T||!g.Ja()||(g.tl()?(Xh(g,Infinity,Infinity),g.Fc()):e.add(g))}for(c.reset();c.next();)g=c.value,g instanceof T&&g.Ja()&&Fj(d,g);for(c.reset();c.next();)g=c.value,g instanceof U&&(d=g,d.Ja()&&(d.tl()?(Xh(d,Infinity,Infinity),d.Fc(),d.Et()):e.add(d)));for(c.reset();c.next();)d=c.value,d instanceof
  tf&&d.Ja()&&(d.tl()?(Xh(d,Infinity,Infinity),d.Fc()):e.add(d));t&&22===b&&w.trace("failure to validate parts")}}
  function Fj(a,b){for(var c=w.lb(),d=w.lb(),e=b.Rc;e.next();){var g=e.value;g.Ja()&&(g instanceof T?(Gj(g)||Hj(g)||Ij(g))&&Fj(a,g):g instanceof U?g.Z==b||g.da==b?d.push(g):c.push(g):(Xh(g,Infinity,Infinity),g.Fc()))}for(var e=c.length,h=0;h<e;h++)g=c[h],Xh(g,Infinity,Infinity),g.Fc();w.xa(c);Xh(b,Infinity,Infinity);b.Fc();e=d.length;for(h=0;h<e;h++)g=d[h],Xh(g,Infinity,Infinity),g.Fc();w.xa(d)}C.prototype.Ef=function(a,b,c,d){var e=this.bi;if(this.Mk||e.fh)for(e=0;e<b;e++)a[e].Ef(c,d)};
  C.prototype.bf=function(a,b){void 0===a&&(a=this.Sg);void 0===b&&(b=null);null===this.Nb&&w.m("No div specified");var c=this.mb;null===c&&w.m("No canvas specified");if(this.bi.pd)0===this.ka.Ve&&this.Se(!0);else{Jj(this);var d=a!==this.Sg,e=this.dc.q,g=e.length,h=this;this.Ef(e,g,h);if(d)gj(this,a),jj(this);else if(!this.Sd&&null===b)return;var k=this.Oa,l=this.ec,m=Math.round(k.x*l)/l,n=Math.round(k.y*l)/l,g=this.Yd;g.reset();1!==l&&g.scale(l);0===k.x&&0===k.y||g.translate(-m,-n);k=this.tf;w.Wm?
  (c.width=c.width,gj(this,a),a.scale(k,k)):(a.setTransform(1,0,0,1,0,0),a.scale(k,k),a.clearRect(0,0,this.Fb,this.Eb));a.miterLimit=9;a.setTransform(1,0,0,1,0,0);a.scale(k,k);a.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);t&&t.Rz&&t.EI(this,a);c=null!==b?function(c){var d=a,e=b;if(c.visible){d.globalAlpha=c.Kf;var g=c.Ev;g.length=0;var k=h.scale;c=c.Hb.q;for(var l=c.length,m=0;m<l;m++){var n=c[m];if((Bi(n)||Pi(n))&&!e.contains(n)){if(n instanceof U){var B=n;B.gc&&g.push(B);if(!1===B.qg)continue}B=
  n.ea;1<B.width*k||1<B.height*k?n.bf(d,h):Qi(n,d)}}d.globalAlpha=1}}:function(b){b.bf(a,h)};Kj(this,a);g=e.length;for(k=0;k<g;k++)c(e[k]);this.Kk?this.Kk.Kl(this)&&this.Xx():this.Lq=function(){return new x(0,0)};d?(gj(this),jj(this)):this.Sd=this.Mk=!1}};
  function Lj(a,b,c,d,e){null===a.Nb&&w.m("No div specified");var g=a.mb;null===g&&w.m("No canvas specified");var h=a.Sg;if(a.Sd){Jj(a);var k=a.tf;w.Wm?(g.width=g.width,gj(a,h)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Fb*k,a.Eb*k));h.ZE=!1;h.drawImage(a.Cy.Jd,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.Oa;var g=a.ec,l=Math.round(e.x*g)/g,m=Math.round(e.y*g)/g;d=a.Yd;d.reset();1!==g&&d.scale(g);0===e.x&&0===e.y||d.translate(-l,-m);h.save();h.beginPath();e=c.length;for(g=0;g<e;g++)l=c[g],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);t&&t.Rz&&t.EI(a,h);c=a.dc.q;e=c.length;a.Ef(c,e,a);Kj(a,h);for(g=0;g<e;g++)Ri(c[g],h,a,b);h.restore();gj(a);a.Kk?a.Kk.Kl(a)&&a.Xx():a.Lq=function(){return new x(0,0)};a.Mk=!1;a.Sd=!1;a.SF()}}
  function Mj(a,b,c,d,e,g,h,k,l,m){null===a.Nb&&w.m("No div specified");null===a.mb&&w.m("No canvas specified");void 0===h&&(h=null);void 0===k&&(k=null);void 0===l&&(l=!1);void 0===m&&(m=!1);Jj(a);gj(a);jj(a);a.Ry=!0;var n=new y(g.x,g.y,d.width/e,d.height/e),p=n.copy();p.gw(c);Bj(a,p);lj(a);var p=a.dc.q,q=p.length;a.Ef(p,q,a,n);var r=a.tf;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=w.mh();d.reset();
  d.translate(c.left,c.top);d.scale(e);0===g.x&&0===g.y||d.translate(-g.x,-g.y);b.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);w.df(d);Kj(a,b);if(null!==h){var s=new F(P);c=h.k;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&&(void 0===d&&(d=!0),d||!c.Ac)){b.globalAlpha=c.Kf;d=c.Ev;d.length=0;var e=a.scale;c=c.Hb.q;for(var g=c.length,h=0;h<g;h++){var k=c[h];if((Bi(k)||Pi(k))&&s.contains(k)){if(k instanceof U){var m=k;m.gc&&d.push(m);
  if(!1===m.qg)continue}m=k.ea;1<m.width*e||1<m.height*e?k.bf(b,a):Qi(k,b)}}b.globalAlpha=1}}}else if(!l&&m){var u=a.dp.V,v=u.layer;c=function(c){c===v?u.bf(b,a):c.bf(b,a,n,l,m)}}else c=function(c){c.bf(b,a,n,l,m)};for(e=0;e<q;e++)c(p[e]);a.Ry=!1;a.Kk?a.Kk.Kl(a)&&a.Xx():a.Lq=function(){return new x(0,0)};gj(a);jj(a);a.Ef(p,q,a);Bj(a)}C.prototype.getRenderingHint=C.prototype.hA=function(a){return this.Fh[a]};C.prototype.setRenderingHint=C.prototype.SJ=function(a,b){this.Fh[a]=b;this.RA()};
  C.prototype.resetRenderingHints=C.prototype.bG=function(){this.Fh=new na;this.Fh.drawShadows=!0;this.Fh.textGreeking=!0;this.Fh.viewportOptimizations=w.ZI?!1:!0;this.Fh.temporaryPixelRatio=!0};function Kj(a,b){var c=a.Fh;if(null!==c){if(void 0!==c.imageSmoothingEnabled){var d=!!c.imageSmoothingEnabled;b.ZE=d;b.NK=d}c=c.defaultFont;void 0!==c&&null!==c&&(b.font=c,b.nu=c)}}C.prototype.getInputOption=C.prototype.fA=function(a){return this.Qq[a]};C.prototype.setInputOption=function(a,b){this.Qq[a]=b};
  C.prototype.resetInputOptions=C.prototype.aG=function(){this.Qq=new na;this.Qq.extraTouchArea=10;this.Qq.extraTouchThreshold=10};C.prototype.setProperties=function(a){w.au(this,a)};function Cj(a){if(0===a.ka.Ve){for(var b=a.Tl.k;b.next();){var c=b.key,d=b.value;c.se();kh(c,d)}a.Tl.clear()}}C.prototype.pa=function(a){void 0===a&&(a=null);if(null===a)this.Sd=!0,this.Se();else{var b=this.ub;null!==a&&a.J()&&b.zg(a)&&(this.Sd=!0,this.Se())}for(b=this.jm.k;b.next();)b.value.pa(a)};
  C.prototype.mA=function(a,b){if(!0!==this.Sd){this.Sd=!0;var c=!0===this.hA("temporaryPixelRatio");if(!0===this.hA("viewportOptimizations")&&this.dB!==Nj&&this.cB.Fw(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=w.$f(),g=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=g;e.y=h;e.width=Math.max(0,k-g)*d;e.height=Math.max(0,l-h)*d;if(0<e.width&&0<e.height){if(!this.Bd&&(this.Mf=!1,null!==this.Nb)){this.Bd=!0;lj(this);
  0!==this.Tl.count&&(Cj(this),lj(this));this.Hd.J()||qj(this,this.tg());var m=this.mb;if(null!==m){var n=this.tf,h=this.Fb*n,k=this.Eb*n,g=this.scale*n,d=Math.round(Math.round(b.x*g)-Math.round(a.x*g)),g=Math.round(Math.round(b.y*g)-Math.round(a.y*g)),l=this.Cy,p=this.kC;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.tf,q=70*this.tf,r=Math.max(d,0),s=Math.max(g,0),u=Math.floor(h-r),v=Math.floor(k-s);p.ZE=!1;p.drawImage(m.Jd,r,s,u,v,0,0,u,v);this.Kk.Kl(this)&&
  p.clearRect(0,0,l,q);var m=w.lb(),p=w.lb(),v=Math.abs(d),u=Math.abs(g),A=0===r?0:h-v,r=w.ic(A,0),v=w.ic(v+A,k);p.push(new y(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 E=this.Yd;E.reset();E.scale(n,n);1!==this.ec&&E.scale(this.ec);n=this.Oa;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&E.translate(-n.x,-n.y);Xa(r,E);Xa(v,E);m.push(new y(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));A=0===s?0:k-u;r.o(0,A);v.o(h,u+A);p.push(new y(Math.min(r.x,
  v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));Xa(r,E);Xa(v,E);m.push(new y(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.Kk.Kl(this)&&(h=0<d?0:-d,k=0<g?0:-g,r.o(h,k),v.o(l+h,q+k),p.push(new y(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))),Xa(r,E),Xa(v,E),m.push(new y(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))));w.B(r);w.B(v);Aj(this,!1);Lj(this,m,p,d,g);w.xa(m);w.xa(p);this.Bd=!1}}}else this.kf();
  w.nc(e);c&&(this.ym=1,this.kf(),si(this,!0))}else c?(this.ym=1,this.kf(),si(this,!0)):this.kf();for(c=this.jm.k;c.next();)c.value.mA()}};function zj(a){!1===a.Wl&&(a.Wl=!0)}function jj(a){!1===a.Mk&&(a.Mk=!0)}function Jj(a){!1!==a.Sq&&(a.Sq=!1,Oj(a,a.Fb,a.Eb))}function Oj(a,b,c){var d=a.mb,e=a.tf,g=b*e,e=c*e;if(d.width!==g||d.height!==e)d.width=g,d.height=e,d.style.width=b+"px",d.style.height=c+"px",a.Sd=!0,gj(a)}
  function kj(a){var b=a.mb;if(null===b)return!0;var c=a.Nb,d=a.Fb,e=a.Eb,g=a.HD.copy(),h=!1,k=a.Jk?a.Fd:0,l=a.Ik?a.Fd:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.Jk=!1,a.Ik=!1,l=k=0,a.Fb=m,a.Eb=c,h=a.Sq=!0;a.Wl=!1;if(a.Pb.fh)return h?(a.Pb.Xi(),a.AI(),!1):!0;var n=a.ub,p=a.Hd,m=p.width,c=p.height,q=n.width,r=n.height,s=p.x,u=n.x,v=p.right,k=n.right+k,A=p.y,E=n.y,p=p.bottom,l=n.bottom+l,B=n="1px",G=a.scale;a.Pw&&a.De&&(n=1,s+1<u&&(n=Math.max((u-s)*G+a.Fb,n)),v>k+1&&(n=Math.max((v-
  k)*G+a.Fb,n)),q+1<m&&(n=Math.max((m-q)*G+a.Fb,n)),n+="px");a.Qw&&a.Fe&&(B=1,A+1<E&&(B=Math.max((E-A)*G+a.Eb,B)),p>l+1&&(B=Math.max((p-l)*G+a.Eb,B)),r+1<c&&(B=Math.max((c-r)*G+a.Eb,B)),B+="px");var O="1px"!==n,M="1px"!==B;if((!O||!M)&&O||M)M&&(k-=a.Fd),O&&(l-=a.Fd),a.Pw&&a.De&&(n=1,s+1<u&&(n=Math.max((u-s)*G+a.Fb,n)),v>k+1&&(n=Math.max((v-k)*G+a.Fb,n)),q+1<m&&(n=Math.max((m-q)*G+a.Fb,n)),n+="px"),a.Qw&&a.Fe&&(B=1,A+1<E&&(B=Math.max((E-A)*G+a.Eb,B)),p>l+1&&(B=Math.max((p-l)*G+a.Eb,B)),r+1<c&&(B=Math.max((c-
  r)*G+a.Eb,B)),B+="px"),O="1px"!==n,M="1px"!==B;if(a.Jv&&O===a.Ik&&M===a.Jk)return d===a.Fb&&e===a.Eb||a.kf(),!1;O!==a.Ik&&(a.Eb="1px"===n?a.Eb+a.Fd:Math.max(a.Eb-a.Fd,1),h=!0);a.Ik=O;a.lz.style.width=n;M!==a.Jk&&(a.Fb="1px"===B?a.Fb+a.Fd:Math.max(a.Fb-a.Fd,1),h=!0,a.CC&&(M?(b.style.left=a.Fd+"px",a.position=new x(a.Oa.x+a.Fd/a.scale,a.Oa.y)):(b.style.left="0px",a.position=new x(a.Oa.x-a.Fd/a.scale,a.Oa.y))));a.Jk=M;a.mz.style.height=B;a.Pw&&a.De&&(q+1<m?a.Ej.scrollLeft=(a.position.x-s)*G:s+1<u?a.Ej.scrollLeft=
  a.Ej.scrollWidth-a.Ej.clientWidth:v>k+1&&(a.Ej.scrollLeft=a.position.x*G));a.Qw&&a.Fe&&(r+1<c?a.Fj.scrollTop=(a.position.y-A)*G:A+1<E?a.Fj.scrollTop=a.Fj.scrollHeight-a.Fj.clientHeight:p>l+1&&(a.Fj.scrollTop=a.position.y*G));h&&(a.Sq=!0);m=a.Fb;c=a.Eb;a.Fj.style.height=c+"px";a.Fj.style.width=m+(a.Jk?a.Fd:0)+"px";a.Ej.style.width=m+"px";a.Ej.style.height=c+(a.Ik?a.Fd:0)+"px";a.kz=!1;return d!==m||e!==c||a.Pb.pd?(n=a.ub,a.Nt(g,n,h),!1):!0}
  C.prototype.add=C.prototype.add=function(a){w.l(a,H,C,"add:part");var b=a.h;if(b!==this){null!==b&&w.m("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.sn&&(a.Ok="Tool");var c=a.hf,b=this.mt(c);null===b&&(b=this.mt(""));null===b&&w.m('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.fp(99999999,a,a.h===this),0<=c&&this.Hc(he,"parts",b,null,a,null,c),b.Ac||this.oc(),a.K(Pj),c=a.mp,null!==
  c&&c(a,null,b))}};
  C.prototype.fp=function(a){if(a instanceof S){if(this.Nr.add(a),a instanceof T){var b=a.Va;null===b?this.$k.add(a):b.lo.add(a);b=a.Lb;null!==b&&(b.h=this)}}else a instanceof U?this.qr.add(a):a instanceof tf||this.Hb.add(a);a.Tb&&a.T();b=a.data;if(null!==b){a instanceof tf||(a instanceof U?this.Dk.add(b,a):this.hi.add(b,a));var c=this;Qj(a,function(a){Rj(c,a)})}!0!==Hj(a)&&!0!==Ij(a)||this.fg.add(a);Sj(a,!0,this);Tj(a)?(a.ea.J()&&this.pa(Si(a,a.ea)),this.oc()):a.Ja()&&a.ea.J()&&this.pa(Si(a,a.ea));
  this.Se()};C.prototype.ef=function(a){a.bt();if(a instanceof S){if(this.Nr.remove(a),a instanceof T){var b=a.Va;null===b?this.$k.remove(a):b.lo.remove(a);b=a.Lb;null!==b&&(b.h=null)}}else a instanceof U?this.qr.remove(a):a instanceof tf||this.Hb.remove(a);b=a.data;if(null!==b){a instanceof tf||(a instanceof U?this.Dk.remove(b):this.hi.remove(b));var c=this;Qj(a,function(a){Uj(c,a)})}this.fg.remove(a);Tj(a)?(a.ea.J()&&this.pa(Si(a,a.ea)),this.oc()):a.Ja()&&a.ea.J()&&this.pa(Si(a,a.ea));this.Se()};
  C.prototype.remove=C.prototype.remove=function(a){w.l(a,H,C,"remove:part");a.Za=!1;a.Ag=!1;var b=a.layer;if(null!==b&&b.h===this){a.K(Vj);a.Om();var c=b.ef(-1,a,!1);0<=c&&this.Hc(ie,"parts",b,a,null,c,null);c=a.mp;null!==c&&c(a,b,null)}};C.prototype.removeParts=C.prototype.WA=function(a,b){if(w.isArray(a))for(var c=w.vb(a),d=0;d<c;d++){var e=w.jb(a,d);b&&!e.canDelete()||this.remove(e)}else for(e=new F(H),e.Zd(a),c=e.k;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};
  C.prototype.copyParts=C.prototype.Oo=function(a,b,c){return this.Ab.Oo(a,b,c)};C.prototype.moveParts=C.prototype.moveParts=function(a,b,c){w.l(b,x,C,"moveParts:offset");var d=this.tb;if(null!==d){d=d.ud;null===d&&(d=new Bf,d.Ic(this));var e=new ia(H,Object);if(null!==a)a=a.k;else{for(a=this.hk;a.next();)Of(d,e,a.value,c);for(a=this.Gg;a.next();)Of(d,e,a.value,c);a=this.links}for(;a.next();)Of(d,e,a.value,c);d.moveParts(e,b,c)}};
  function Wj(a,b,c){w.l(b,De,C,"addLayer:layer");null!==b.h&&b.h!==a&&w.m("Cannot share a Layer with another Diagram: "+b+" of "+b.h);null===c?null!==b.h&&w.m("Cannot add an existing Layer to this Diagram again: "+b):(w.l(c,De,C,"addLayer:existingLayer"),c.h!==a&&w.m("Existing Layer must be in this Diagram: "+c+" not in "+c.h),b===c&&w.m("Cannot move a Layer before or after itself: "+b));if(b.h!==a){b=b.name;a=a.dc;c=a.count;for(var d=0;d<c;d++)a.na(d).name===b&&w.m("Cannot add Layer with the name '"+
  b+"'; a Layer with the same name is already present in this Diagram.")}}C.prototype.addLayer=C.prototype.Ss=function(a){Wj(this,a,null);a.Ic(this);var b=this.dc,c=b.count-1;if(!a.Ac)for(;0<=c&&b.na(c).Ac;)c--;b.ce(c+1,a);null!==this.Ud&&this.Hc(he,"layers",this,null,a,null,c+1);this.pa();this.oc()};
  C.prototype.addLayerBefore=C.prototype.HH=function(a,b){Wj(this,a,b);a.Ic(this);var c=this.dc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Ud&&this.Hc(ie,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.na(g)===b){c.ce(g,a);break}null!==this.Ud&&this.Hc(he,"layers",this,null,a,null,g);this.pa();0>d&&this.oc()};
  C.prototype.addLayerAfter=function(a,b){Wj(this,a,b);a.Ic(this);var c=this.dc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Ud&&this.Hc(ie,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.na(g)===b){c.ce(g+1,a);break}null!==this.Ud&&this.Hc(he,"layers",this,null,a,null,g+1);this.pa();0>d&&this.oc()};
  C.prototype.removeLayer=function(a){w.l(a,De,C,"removeLayer:layer");a.h!==this&&w.m("Cannot remove a Layer from another Diagram: "+a+" of "+a.h);if(""!==a.name){var b=this.dc,c=b.indexOf(a);if(b.remove(a)){for(b=a.Hb.copy().k;b.next();){var d=b.value,e=d.hf;d.hf=e!==a.name?e:""}null!==this.Ud&&this.Hc(ie,"layers",this,a,null,c,null);this.pa();this.oc()}}};C.prototype.findLayer=C.prototype.mt=function(a){for(var b=this.hx;b.next();){var c=b.value;if(c.name===a)return c}return null};
  C.prototype.addChangedListener=C.prototype.Hz=function(a){w.i(a,"function",C,"addChangedListener:listener");null===this.dj&&(this.dj=new D("function"));this.dj.add(a)};C.prototype.removeChangedListener=C.prototype.TA=function(a){w.i(a,"function",C,"removeChangedListener:listener");null!==this.dj&&(this.dj.remove(a),0===this.dj.count&&(this.dj=null))};
  C.prototype.nw=function(a){this.$a||this.ka.VE(a);a.sd!==ge&&(this.gh=!0);if(null!==this.dj){var b=this.dj,c=b.length;if(1===c)b=b.na(0),b(a);else if(0!==c)for(var d=b.Ue(),e=0;e<c;e++)b=d[e],b(a)}};C.prototype.raiseChangedEvent=C.prototype.Hc=function(a,b,c,d,e,g,h){void 0===g&&(g=null);void 0===h&&(h=null);var k=new Ud;k.h=this;k.sd=a;k.propertyName=b;k.object=c;k.oldValue=d;k.Yf=g;k.newValue=e;k.Wf=h;this.nw(k)};
  C.prototype.raiseChanged=C.prototype.j=function(a,b,c,d,e){this.Hc(fe,a,this,b,c,d,e)};w.A(C,{Pb:"animationManager"},function(){return this.bi});w.A(C,{ka:"undoManager"},function(){return this.Ud.ka});w.g(C,"skipsUndoManager",C.prototype.$a);w.defineProperty(C,{$a:"skipsUndoManager"},function(){return this.yi},function(a){w.i(a,"boolean",C,"skipsUndoManager");this.yi=a;this.Ud.yi=a});w.g(C,"delaysLayout",C.prototype.Aw);
  w.defineProperty(C,{Aw:"delaysLayout"},function(){return this.yy},function(a){this.yy=a});
  C.prototype.Im=function(a,b){if(null!==a&&a.h===this){var c=a.sd;if(c===fe){var d=a.object,c=a.propertyName,e=a.Aa(b);w.Sa(d,c,e);d instanceof P&&(d=d.V,null!==d&&d.de());this.gh=!0}else if(c===he){e=a.object;c=a.Wf;d=a.newValue;if(e instanceof z)if("number"===typeof c&&d instanceof P){var g=e;b?g.ef(c):g.ce(c,d);d=e.V;null!==d&&d.de()}else"number"===typeof c&&d instanceof af&&(g=e,b?d.ge?g.$F(c):g.WF(c):(c=d.ge?g.jd(d.index):g.hd(d.index),c.gt(d)));else e instanceof De?(g=!0===a.Yf,"number"===typeof c&&
  d instanceof H&&(b?(d.de(),e.ef(g?c:-1,d,g)):e.fp(c,d,g))):e instanceof C?"number"===typeof c&&d instanceof De&&(e=d,b?this.dc.md(c):(e.Ic(this),this.dc.ce(c,e))):w.m("unknown ChangedEvent.Insert object: "+a.toString());this.gh=!0}else c===ie?(e=a.object,c=a.Yf,d=a.oldValue,e instanceof z?"number"===typeof c&&d instanceof P?(g=e,b?g.ce(c,d):g.ef(c)):"number"===typeof c&&d instanceof af&&(g=e,b?(c=d.ge?g.jd(d.index):g.hd(d.index),c.gt(d)):d.ge?g.$F(c):g.WF(c)):e instanceof De?(g=!0===a.Wf,"number"===
  typeof c&&d instanceof H&&(b?e.fp(c,d,g):(d.de(),e.ef(g?c:-1,d,g)))):e instanceof C?"number"===typeof c&&d instanceof De&&(e=d,b?(e.Ic(this),this.dc.ce(c,e)):this.dc.md(c)):w.m("unknown ChangedEvent.Remove object: "+a.toString()),this.gh=!0):c!==ge&&w.m("unknown ChangedEvent: "+a.toString())}};C.prototype.startTransaction=C.prototype.ac=function(a){return this.ka.ac(a)};C.prototype.commitTransaction=C.prototype.ae=function(a){return this.ka.ae(a)};C.prototype.rollbackTransaction=C.prototype.Lp=function(){return this.ka.Lp()};
  C.prototype.updateAllTargetBindings=C.prototype.fK=function(a){void 0===a&&(a="");for(var b=this.hk;b.next();)b.value.Rb(a);for(b=this.Gg;b.next();)b.value.Rb(a);for(b=this.links;b.next();)b.value.Rb(a)};C.prototype.updateAllRelationshipsFromData=function(){for(var a=this.hk;a.next();)a.value.updateRelationshipsFromData();for(a=this.Gg;a.next();)a.value.updateRelationshipsFromData();for(a=this.links;a.next();)a.value.updateRelationshipsFromData()};
  function ck(a,b,c){if(a.yc||a.Bd)a.ec=c;else if(a.yc=!0,null===a.mb)a.ec=c;else{var d=a.ub.copy(),e=a.Fb,g=a.Eb;d.width=a.Fb/b;d.height=a.Eb/b;var h=a.Ll.copy();if(isNaN(h.x))switch(a.sw){case ac:h.x=0;break;case bc:h.x=e-1;break;case Ob:h.x=e/2;break;case zc:case yc:h.x=e/2}if(isNaN(h.y))switch(a.sw){case Xb:h.y=0;break;case cc:h.y=g-1;break;case Ob:h.y=g/2;break;case zc:case yc:h.y=g/2}null!==a.bB&&(c=a.bB(a,c));c<a.Dg&&(c=a.Dg);c>a.Cg&&(c=a.Cg);a.position=new x(a.Oa.x+h.x/b-h.x/c,a.Oa.y+h.y/b-
  h.y/c);a.yc=!1;a.ec=c;a.Nt(d,a.ub);nj(a,!1);a.pa();zj(a)}}C.prototype.Nt=function(a,b,c){void 0===c&&(c=!1);c||zj(this);jj(this);var d=this.Lb;null===d||!d.Ct||c||a.width===b.width&&a.height===b.height||d.K();d=this.Wa;!0===this.Yl&&d instanceof rf&&(this.P.ga=this.SG(this.P.We),d.doMouseMove());this.mA(a,b);Bj(this);this.Ba("ViewportBoundsChanged",c?w.nh:null,a)};
  function Bj(a,b){void 0===b&&(b=null);var c=a.ed;if(null!==c&&c.visible){for(var d=w.Hl(),e=1,g=1,h=c.Ca.q,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(lk(m.Bb)?g=g*n/J.NE(g,n):e=e*n/J.NE(e,n))}h=c.rt;d.o(g*h.width,e*h.height);h=g=l=k=0;if(null!==b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=w.$f();g=a.ub;e.o(g.x,g.y,g.width,g.height);for(h=a.jm.k;h.next();)g=h.value.ub,g.J()&&nb(e,g.x,g.y,g.width,g.height);k=e.width;l=e.height;g=e.x;h=e.y;if(!e.J())return}c.width=k+2*d.width;c.height=l+2*d.height;
  e=w.M();J.nt(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);w.dk(d);c.V.location=e;w.B(e)}}C.prototype.clearSelection=C.prototype.pw=function(){var a=0<this.selection.count;a&&this.Ba("ChangingSelection");Af(this);a&&this.Ba("ChangedSelection")};function Af(a){a=a.selection;if(0<a.count){for(var b=a.Ue(),c=b.length,d=0;d<c;d++)b[d].Za=!1;a.Na();a.clear();a.freeze()}}
  C.prototype.select=C.prototype.select=function(a){null!==a&&(w.l(a,H,C,"select:part"),a.layer.h===this&&(!a.Za||1<this.selection.count)&&(this.Ba("ChangingSelection"),Af(this),a.Za=!0,this.Ba("ChangedSelection")))};
  C.prototype.selectCollection=C.prototype.oG=function(a){this.Ba("ChangingSelection");Af(this);if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++){var d=w.jb(a,c);d instanceof H||w.m("Diagram.selectCollection given something that is not a Part: "+d);d.Za=!0}else for(a=a.k;a.next();)d=a.value,d instanceof H||w.m("Diagram.selectCollection given something that is not a Part: "+d),d.Za=!0;this.Ba("ChangedSelection")};
  C.prototype.clearHighlighteds=C.prototype.ZD=function(){var a=this.Rw;if(0<a.count){for(var b=a.Ue(),c=b.length,d=0;d<c;d++)b[d].Ag=!1;a.Na();a.clear();a.freeze()}};C.prototype.highlight=function(a){null!==a&&a.layer.h===this&&(w.l(a,H,C,"highlight:part"),!a.Ag||1<this.Rw.count)&&(this.ZD(),a.Ag=!0)};
  C.prototype.highlightCollection=function(a){this.ZD();if(w.isArray(a))for(var b=w.vb(a),c=0;c<b;c++){var d=w.jb(a,c);d instanceof H||w.m("Diagram.highlightCollection given something that is not a Part: "+d);d.Ag=!0}else for(a=a.k;a.next();)d=a.value,d instanceof H||w.m("Diagram.highlightCollection given something that is not a Part: "+d),d.Ag=!0};
  C.prototype.scroll=C.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.Pp:this.Op):"page"===a?(a=d?this.ub.height:this.ub.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.Pp:this.Op),0),e*=c)):w.m("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:w.m("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+
  b);this.position=c};C.prototype.scrollToRect=C.prototype.QJ=function(a){var b=this.ub;b.Vj(a)||(a=a.Tj,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};C.prototype.centerRect=function(a){var b=this.ub;a=a.Tj;a.x-=b.width/2;a.y-=b.height/2;this.position=a};C.prototype.transformDocToView=C.prototype.QG=function(a){var b=this.Yd;b.reset();1!==this.ec&&b.scale(this.ec);var c=this.Oa;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.Yd)};
  C.prototype.transformViewToDoc=C.prototype.SG=function(a){var b=this.Yd;b.reset();1!==this.ec&&b.scale(this.ec);var c=this.Oa;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return Xa(a.copy(),this.Yd)};var Cf;C.None=Cf=w.w(C,"None",0);var rj;C.Uniform=rj=w.w(C,"Uniform",1);var sj;C.UniformToFill=sj=w.w(C,"UniformToFill",2);var Ng;C.CycleAll=Ng=w.w(C,"CycleAll",10);var Zg;C.CycleNotDirected=Zg=w.w(C,"CycleNotDirected",11);var ah;
  C.CycleNotDirectedFast=ah=w.w(C,"CycleNotDirectedFast",12);var bh;C.CycleNotUndirected=bh=w.w(C,"CycleNotUndirected",13);var Og;C.CycleDestinationTree=Og=w.w(C,"CycleDestinationTree",14);var Yg;C.CycleSourceTree=Yg=w.w(C,"CycleSourceTree",15);var Vi;C.DocumentScroll=Vi=w.w(C,"DocumentScroll",1);var Nj;C.InfiniteScroll=Nj=w.w(C,"InfiniteScroll",2);w.g(C,"validCycle",C.prototype.YG);
  w.defineProperty(C,{YG:"validCycle"},function(){return this.bw},function(a){var b=this.bw;b!==a&&(w.za(a,C,C,"validCycle"),this.bw=a,this.j("validCycle",b,a))});w.g(C,"linkSpacing",C.prototype.rp);w.defineProperty(C,{rp:"linkSpacing"},function(){return this.qj},function(a){var b=this.qj;b!==a&&(w.p(a,C,"linkSpacing"),0>a&&w.la(a,">= zero",C,"linkSpacing"),this.qj=a,this.j("linkSpacing",b,a))});w.A(C,{hx:"layers"},function(){return this.dc.k});w.g(C,"isModelReadOnly",C.prototype.ff);
  w.defineProperty(C,{ff:"isModelReadOnly"},function(){var a=this.Ud;return null===a?!1:a.hb},function(a){var b=this.Ud;null!==b&&(b.hb=a)});w.g(C,"isReadOnly",C.prototype.hb);w.defineProperty(C,{hb:"isReadOnly"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(w.i(a,"boolean",C,"isReadOnly"),this.Nk=a,this.j("isReadOnly",b,a))});w.g(C,"isEnabled",C.prototype.isEnabled);
  w.defineProperty(C,{isEnabled:"isEnabled"},function(){return this.Xe},function(a){var b=this.Xe;b!==a&&(w.i(a,"boolean",C,"isEnabled"),this.Xe=a,this.j("isEnabled",b,a))});w.g(C,"allowClipboard",C.prototype.jw);w.defineProperty(C,{jw:"allowClipboard"},function(){return this.pu},function(a){var b=this.pu;b!==a&&(w.i(a,"boolean",C,"allowClipboard"),this.pu=a,this.j("allowClipboard",b,a))});w.g(C,"allowCopy",C.prototype.Oh);
  w.defineProperty(C,{Oh:"allowCopy"},function(){return this.ok},function(a){var b=this.ok;b!==a&&(w.i(a,"boolean",C,"allowCopy"),this.ok=a,this.j("allowCopy",b,a))});w.g(C,"allowDelete",C.prototype.Rj);w.defineProperty(C,{Rj:"allowDelete"},function(){return this.pk},function(a){var b=this.pk;b!==a&&(w.i(a,"boolean",C,"allowDelete"),this.pk=a,this.j("allowDelete",b,a))});w.g(C,"allowDragOut",C.prototype.Vs);
  w.defineProperty(C,{Vs:"allowDragOut"},function(){return this.qu},function(a){var b=this.qu;b!==a&&(w.i(a,"boolean",C,"allowDragOut"),this.qu=a,this.j("allowDragOut",b,a))});w.g(C,"allowDrop",C.prototype.Kz);w.defineProperty(C,{Kz:"allowDrop"},function(){return this.ru},function(a){var b=this.ru;b!==a&&(w.i(a,"boolean",C,"allowDrop"),this.ru=a,this.j("allowDrop",b,a))});w.g(C,"allowTextEdit",C.prototype.Io);
  w.defineProperty(C,{Io:"allowTextEdit"},function(){return this.yk},function(a){var b=this.yk;b!==a&&(w.i(a,"boolean",C,"allowTextEdit"),this.yk=a,this.j("allowTextEdit",b,a))});w.g(C,"allowGroup",C.prototype.Fo);w.defineProperty(C,{Fo:"allowGroup"},function(){return this.qk},function(a){var b=this.qk;b!==a&&(w.i(a,"boolean",C,"allowGroup"),this.qk=a,this.j("allowGroup",b,a))});w.g(C,"allowUngroup",C.prototype.Jo);
  w.defineProperty(C,{Jo:"allowUngroup"},function(){return this.zk},function(a){var b=this.zk;b!==a&&(w.i(a,"boolean",C,"allowUngroup"),this.zk=a,this.j("allowUngroup",b,a))});w.g(C,"allowInsert",C.prototype.Bm);w.defineProperty(C,{Bm:"allowInsert"},function(){return this.tu},function(a){var b=this.tu;b!==a&&(w.i(a,"boolean",C,"allowInsert"),this.tu=a,this.j("allowInsert",b,a))});w.g(C,"allowLink",C.prototype.Cm);
  w.defineProperty(C,{Cm:"allowLink"},function(){return this.rk},function(a){var b=this.rk;b!==a&&(w.i(a,"boolean",C,"allowLink"),this.rk=a,this.j("allowLink",b,a))});w.g(C,"allowRelink",C.prototype.Sj);w.defineProperty(C,{Sj:"allowRelink"},function(){return this.tk},function(a){var b=this.tk;b!==a&&(w.i(a,"boolean",C,"allowRelink"),this.tk=a,this.j("allowRelink",b,a))});w.g(C,"allowMove",C.prototype.Gi);
  w.defineProperty(C,{Gi:"allowMove"},function(){return this.sk},function(a){var b=this.sk;b!==a&&(w.i(a,"boolean",C,"allowMove"),this.sk=a,this.j("allowMove",b,a))});w.g(C,"allowReshape",C.prototype.Go);w.defineProperty(C,{Go:"allowReshape"},function(){return this.uk},function(a){var b=this.uk;b!==a&&(w.i(a,"boolean",C,"allowReshape"),this.uk=a,this.j("allowReshape",b,a))});w.g(C,"allowResize",C.prototype.Dm);
  w.defineProperty(C,{Dm:"allowResize"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(w.i(a,"boolean",C,"allowResize"),this.vk=a,this.j("allowResize",b,a))});w.g(C,"allowRotate",C.prototype.Ho);w.defineProperty(C,{Ho:"allowRotate"},function(){return this.wk},function(a){var b=this.wk;b!==a&&(w.i(a,"boolean",C,"allowRotate"),this.wk=a,this.j("allowRotate",b,a))});w.g(C,"allowSelect",C.prototype.Ee);
  w.defineProperty(C,{Ee:"allowSelect"},function(){return this.xk},function(a){var b=this.xk;b!==a&&(w.i(a,"boolean",C,"allowSelect"),this.xk=a,this.j("allowSelect",b,a))});w.g(C,"allowUndo",C.prototype.Lz);w.defineProperty(C,{Lz:"allowUndo"},function(){return this.uu},function(a){var b=this.uu;b!==a&&(w.i(a,"boolean",C,"allowUndo"),this.uu=a,this.j("allowUndo",b,a))});w.g(C,"allowZoom",C.prototype.Ws);
  w.defineProperty(C,{Ws:"allowZoom"},function(){return this.wu},function(a){var b=this.wu;b!==a&&(w.i(a,"boolean",C,"allowZoom"),this.wu=a,this.j("allowZoom",b,a))});w.g(C,"hasVerticalScrollbar",C.prototype.Qw);w.defineProperty(C,{Qw:"hasVerticalScrollbar"},function(){return this.$u},function(a){var b=this.$u;b!==a&&(w.i(a,"boolean",C,"hasVerticalScrollbar"),this.$u=a,zj(this),this.pa(),this.j("hasVerticalScrollbar",b,a),nj(this,!1))});w.g(C,"hasHorizontalScrollbar",C.prototype.Pw);
  w.defineProperty(C,{Pw:"hasHorizontalScrollbar"},function(){return this.Zu},function(a){var b=this.Zu;b!==a&&(w.i(a,"boolean",C,"hasHorizontalScrollbar"),this.Zu=a,zj(this),this.pa(),this.j("hasHorizontalScrollbar",b,a),nj(this,!1))});w.g(C,"allowHorizontalScroll",C.prototype.De);w.defineProperty(C,{De:"allowHorizontalScroll"},function(){return this.su},function(a){var b=this.su;b!==a&&(w.i(a,"boolean",C,"allowHorizontalScroll"),this.su=a,this.j("allowHorizontalScroll",b,a),nj(this,!1))});
  w.g(C,"allowVerticalScroll",C.prototype.Fe);w.defineProperty(C,{Fe:"allowVerticalScroll"},function(){return this.vu},function(a){var b=this.vu;b!==a&&(w.i(a,"boolean",C,"allowVerticalScroll"),this.vu=a,this.j("allowVerticalScroll",b,a),nj(this,!1))});w.g(C,"scrollHorizontalLineChange",C.prototype.Op);
  w.defineProperty(C,{Op:"scrollHorizontalLineChange"},function(){return this.Kv},function(a){var b=this.Kv;b!==a&&(w.i(a,"number",C,"scrollHorizontalLineChange"),0>a&&w.la(a,">= 0",C,"scrollHorizontalLineChange"),this.Kv=a,this.j("scrollHorizontalLineChange",b,a))});w.g(C,"scrollVerticalLineChange",C.prototype.Pp);
  w.defineProperty(C,{Pp:"scrollVerticalLineChange"},function(){return this.Lv},function(a){var b=this.Lv;b!==a&&(w.i(a,"number",C,"scrollVerticalLineChange"),0>a&&w.la(a,">= 0",C,"scrollVerticalLineChange"),this.Lv=a,this.j("scrollVerticalLineChange",b,a))});w.g(C,"lastInput",C.prototype.P);w.defineProperty(C,{P:"lastInput"},function(){return this.Sb},function(a){t&&w.l(a,Sd,C,"lastInput");this.Sb=a});w.g(C,"firstInput",C.prototype.xc);
  w.defineProperty(C,{xc:"firstInput"},function(){return this.Fk},function(a){t&&w.l(a,Sd,C,"firstInput");this.Fk=a});w.g(C,"currentCursor",C.prototype.Yb);w.defineProperty(C,{Yb:"currentCursor"},function(){return this.qy},function(a){""===a&&(a=this.Aq);this.qy!==a&&(w.i(a,"string",C,"currentCursor"),null!==this.mb&&(this.qy=a,this.mb.style.cursor=a,this.Nb.style.cursor=a))});w.g(C,"defaultCursor",C.prototype.rI);
  w.defineProperty(C,{rI:"defaultCursor"},function(){return this.Aq},function(a){""===a&&(a="auto");var b=this.Aq;b!==a&&(w.i(a,"string",C,"defaultCursor"),this.Aq=a,this.j("defaultCursor",b,a))});w.g(C,"hasGestureZoom",C.prototype.SI);w.defineProperty(C,{SI:"hasGestureZoom"},function(){return this.Vn},function(a){var b=this.Vn;b!==a&&(w.i(a,"boolean",C,"hasGestureZoom"),this.Vn=a,this.j("hasGestureZoom",b,a))});w.g(C,"click",C.prototype.click);
  w.defineProperty(C,{click:"click"},function(){return this.di},function(a){var b=this.di;b!==a&&(null!==a&&w.i(a,"function",C,"click"),this.di=a,this.j("click",b,a))});w.g(C,"doubleClick",C.prototype.Pm);w.defineProperty(C,{Pm:"doubleClick"},function(){return this.ki},function(a){var b=this.ki;b!==a&&(null!==a&&w.i(a,"function",C,"doubleClick"),this.ki=a,this.j("doubleClick",b,a))});w.g(C,"contextClick",C.prototype.ft);
  w.defineProperty(C,{ft:"contextClick"},function(){return this.fi},function(a){var b=this.fi;b!==a&&(null!==a&&w.i(a,"function",C,"contextClick"),this.fi=a,this.j("contextClick",b,a))});w.g(C,"mouseOver",C.prototype.Jt);w.defineProperty(C,{Jt:"mouseOver"},function(){return this.ui},function(a){var b=this.ui;b!==a&&(null!==a&&w.i(a,"function",C,"mouseOver"),this.ui=a,this.j("mouseOver",b,a))});w.g(C,"mouseHover",C.prototype.It);
  w.defineProperty(C,{It:"mouseHover"},function(){return this.ti},function(a){var b=this.ti;b!==a&&(null!==a&&w.i(a,"function",C,"mouseHover"),this.ti=a,this.j("mouseHover",b,a))});w.g(C,"mouseHold",C.prototype.Ht);w.defineProperty(C,{Ht:"mouseHold"},function(){return this.si},function(a){var b=this.si;b!==a&&(null!==a&&w.i(a,"function",C,"mouseHold"),this.si=a,this.j("mouseHold",b,a))});w.g(C,"mouseDragOver",C.prototype.IF);
  w.defineProperty(C,{IF:"mouseDragOver"},function(){return this.xv},function(a){var b=this.xv;b!==a&&(null!==a&&w.i(a,"function",C,"mouseDragOver"),this.xv=a,this.j("mouseDragOver",b,a))});w.g(C,"mouseDrop",C.prototype.Gt);w.defineProperty(C,{Gt:"mouseDrop"},function(){return this.ri},function(a){var b=this.ri;b!==a&&(null!==a&&w.i(a,"function",C,"mouseDrop"),this.ri=a,this.j("mouseDrop",b,a))});w.g(C,"toolTip",C.prototype.gu);
  w.defineProperty(C,{gu:"toolTip"},function(){return this.Bi},function(a){var b=this.Bi;b!==a&&(null!==a&&w.l(a,tf,C,"toolTip"),this.Bi=a,this.j("toolTip",b,a))});w.g(C,"contextMenu",C.prototype.contextMenu);w.defineProperty(C,{contextMenu:"contextMenu"},function(){return this.gi},function(a){var b=this.gi;b!==a&&(null!==a&&w.l(a,tf,C,"contextMenu"),this.gi=a,this.j("contextMenu",b,a))});w.g(C,"commandHandler",C.prototype.Ab);
  w.defineProperty(C,{Ab:"commandHandler"},function(){return this.hy},function(a){var b=this.hy;b!==a&&(w.l(a,qa,C,"commandHandler"),null!==a.h&&w.m("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Ic(null),this.hy=a,a.Ic(this))});w.g(C,"toolManager",C.prototype.tb);
  w.defineProperty(C,{tb:"toolManager"},function(){return this.zz},function(a){var b=this.zz;b!==a&&(w.l(a,rf,C,"toolManager"),null!==a.h&&w.m("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Ic(null),this.zz=a,a.Ic(this))});w.g(C,"defaultTool",C.prototype.yw);w.defineProperty(C,{yw:"defaultTool"},function(){return this.xy},function(a){var b=this.xy;b!==a&&(w.l(a,Qe,C,"defaultTool"),this.xy=a,this.Wa===b&&(this.Wa=a))});w.g(C,"currentTool",C.prototype.Wa);
  w.defineProperty(C,{Wa:"currentTool"},function(){return this.ty},function(a){var b=this.ty;if(null!==b)for(b.qa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop(),b=this.jm.k;b.next();)b.value.pa();null===a&&(a=this.yw);null!==a&&(w.l(a,Qe,C,"currentTool"),this.ty=a,a.Ic(this),a.doStart())});w.A(C,{selection:"selection"},function(){return this.Ov});w.g(C,"maxSelectionCount",C.prototype.AF);
  w.defineProperty(C,{AF:"maxSelectionCount"},function(){return this.sv},function(a){var b=this.sv;if(b!==a)if(w.i(a,"number",C,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.sv=a,this.j("maxSelectionCount",b,a),!this.ka.sb&&(a=this.selection.count-a,0<a)){this.Ba("ChangingSelection");for(var b=this.selection.Ue(),c=0;c<a;c++)b[c].Za=!1;this.Ba("ChangedSelection")}}else w.la(a,">= 0",C,"maxSelectionCount")});w.g(C,"nodeSelectionAdornmentTemplate",C.prototype.NF);
  w.defineProperty(C,{NF:"nodeSelectionAdornmentTemplate"},function(){return this.zv},function(a){var b=this.zv;b!==a&&(w.l(a,tf,C,"nodeSelectionAdornmentTemplate"),this.zv=a,this.j("nodeSelectionAdornmentTemplate",b,a))});w.g(C,"groupSelectionAdornmentTemplate",C.prototype.TE);w.defineProperty(C,{TE:"groupSelectionAdornmentTemplate"},function(){return this.Xu},function(a){var b=this.Xu;b!==a&&(w.l(a,tf,C,"groupSelectionAdornmentTemplate"),this.Xu=a,this.j("groupSelectionAdornmentTemplate",b,a))});
  w.g(C,"linkSelectionAdornmentTemplate",C.prototype.xF);w.defineProperty(C,{xF:"linkSelectionAdornmentTemplate"},function(){return this.nv},function(a){var b=this.nv;b!==a&&(w.l(a,tf,C,"linkSelectionAdornmentTemplate"),this.nv=a,this.j("linkSelectionAdornmentTemplate",b,a))});w.A(C,{Rw:"highlighteds"},function(){return this.av});w.g(C,"isModified",C.prototype.gh);
  w.defineProperty(C,{gh:"isModified"},function(){var a=this.ka;return a.isEnabled?null!==a.Ni?!0:this.Sy&&this.Ug!==a.Ri:this.Sy},function(a){if(this.Sy!==a){w.i(a,"boolean",C,"isModified");this.Sy=a;var b=this.ka;!a&&b.isEnabled&&(this.Ug=b.Ri);a||mk(this)}});function mk(a){var b=a.gh;a.JD!==b&&(a.JD=b,a.Ba("Modified"))}w.g(C,"model",C.prototype.fa);
  w.defineProperty(C,{fa:"model"},function(){return this.Ud},function(a){var b=this.Ud;if(b!==a){w.l(a,I,C,"model");this.Wa.doCancel();null!==b&&b.ka!==a.ka&&b.ka.jF&&w.m("Do not replace a Diagram.model while a transaction is in progress.");this.Pb.Xi();this.pw();this.rf=!1;this.Rn=!0;this.Ug=-2;this.Mf=!1;var c=this.Bd;this.Bd=!0;this.Pb.zl();null!==b&&(b.TA(this.MC),b instanceof R&&nk(this,b.Ui),nk(this,b.Fg));this.Ud=a;a.Hz(this.LC);ok(this,a.Fg);a instanceof R&&pk(this,a.Ui);a.TA(this.LC);a.Hz(this.MC);
  this.Bd=c;this.yc||this.pa();null!==b&&(a.ka.isEnabled=b.ka.isEnabled)}});w.defineProperty(C,{Pa:null},function(){return this.EC},function(a){this.EC=a});
  function Yi(a,b){if(b.fa===a.fa){var c=b.sd,d=b.propertyName;if(c===ge&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.tb,c.lf.each(function(b){b.Ic(a)}),c.Uf.each(function(b){b.Ic(a)}),c.Vf.each(function(b){b.Ic(a)}),a.Bd||a.rf||(a.Nu=!0,a.Rn&&(a.Mf=!0),a.bi.zl());else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Pb;e.fh&&!a.$a&&e.Xi();a.Ba("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Pb,e.fh&&!a.$a&&e.Xi(),a.jv&&e.zl());else if(a.Pa){a.Pa=!1;try{var g=b.Bf;if(""!==g)if(c===fe){if("linkFromKey"===
  g){var h=b.object,k=a.vg(h);if(null!==k){var l=b.newValue,m=a.cf(l);k.Z=m}}else if("linkToKey"===g)h=b.object,k=a.vg(h),null!==k&&(l=b.newValue,m=a.cf(l),k.da=m);else if("linkFromPortId"===g){if(h=b.object,k=a.vg(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.Rf=n)}}else if("linkToPortId"===g)h=b.object,k=a.vg(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Og=n));else if("nodeGroupKey"===g){var h=b.object,p=a.Sh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.cf(q);p.Va=r instanceof
  T?r:null}else p.Va=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.vg(h),null!==k){var s=b.oldValue,u=b.newValue;if(w.isArray(s))for(var v=w.vb(s),A=0;A<v;A++){var E=w.jb(s,A),m=a.cf(E);null!==m&&(m.Md=null)}if(w.isArray(u))for(v=w.vb(u),A=0;A<v;A++)E=w.jb(u,A),m=a.cf(E),null!==m&&(m.Md=k)}}else if("nodeParentKey"===g){var B=b.object,G=a.cf(b.newValue),O=a.Jw(B);if(null!==O){var M=O.pt();null!==M?null===G?a.remove(M):a.ld?M.Z=G:M.da=G:qk(a,G,O)}}else if("parentLinkCategory"===g){var B=b.object,
  O=a.Jw(B),X=b.newValue;null!==O&&"string"===typeof X&&(M=O.pt(),null!==M&&(M.Gc=X))}else if("nodeCategory"===g){var h=b.object,ja=a.Sh(h),X=b.newValue;null!==ja&&"string"===typeof X&&(ja.Gc=X)}else if("linkCategory"===g){var h=b.object,V=a.vg(h),X=b.newValue;null!==V&&"string"===typeof X&&(V.Gc=X)}else if("nodeDataArray"===g){var Q=b.oldValue;nk(a,Q);var ca=b.newValue;ok(a,ca)}else"linkDataArray"===g&&(Q=b.oldValue,nk(a,Q),ca=b.newValue,pk(a,ca));a.gh=!0}else c===he?(ca=b.newValue,"nodeDataArray"===
  g&&w.Xa(ca)?rk(a,ca):"linkDataArray"===g&&w.Xa(ca)?sk(a,ca):"linkLabelKeys"===g&&Ve(ca)&&(k=a.vg(b.object),m=a.cf(ca),null!==k&&null!==m&&(m.Md=k)),a.gh=!0):c===ie?(Q=b.oldValue,"nodeDataArray"===g&&w.Xa(Q)?tk(a,Q):"linkDataArray"===g&&w.Xa(Q)?tk(a,Q):"linkLabelKeys"===g&&Ve(Q)&&(m=a.cf(Q),null!==m&&(m.Md=null)),a.gh=!0):c===ge&&("SourceChanged"===g?Xi(a,b.object,b.propertyName):"ModelDisplaced"===g&&a.Al());else if(c===fe){var Pa=b.propertyName,h=b.object;if(h===a.fa){if("nodeKeyProperty"===Pa||
  "nodeCategoryProperty"===Pa||"linkFromKeyProperty"===Pa||"linkToKeyProperty"===Pa||"linkFromPortIdProperty"===Pa||"linkToPortIdProperty"===Pa||"linkLabelKeysProperty"===Pa||"nodeIsGroupProperty"===Pa||"nodeGroupKeyProperty"===Pa||"nodeParentKeyProperty"===Pa||"linkCategoryProperty"===Pa)a.ka.sb||a.Al()}else Xi(a,h,Pa);a.gh=!0}else if(c===he||c===ie)uk(a,b),a.gh=!0;else if(c===ge){if("FinishedUndo"===d||"FinishedRedo"===d)a.ka.ni=!0,a.Ba("ChangedSelection"),lj(a),a.ka.ni=!1;a.Nu=!0;a.kf();e=a.bi;e.pd&&
  0===a.ka.Ve&&ni(e);"CommittedTransaction"===d&&a.ka.Vy&&(a.Ug=Math.min(a.Ug,a.ka.Ri-1));mk(a);a.bz||"CommittedTransaction"!==d&&"FinishedUndo"!==d&&"FinishedRedo"!==d||(a.bz=!0,w.setTimeout(function(){a.Wa.standardMouseOver();a.bz=!1},10))}}finally{a.Pa=!0}}}}
  function Xi(a,b,c){if("string"===typeof c){var d=a.Sh(b);if(null!==d)d.Rb(c),a.fa instanceof xe&&(d=a.vg(b),null!==d&&d.Rb(c));else{for(var d=null,e=a.am.k;e.next();){for(var g=e.value,h=0;h<g.length;h++){var k=g[h];null!==k.gg&&(k=k.gg.Aa(b),null!==k&&(null===d&&(d=w.lb()),d.push(k)))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Rb(c);w.xa(d)}}b===a.fa.yp&&a.fK(c)}}w.g(C,"skipsModelSourceBindings",C.prototype.du);
  w.defineProperty(C,{du:"skipsModelSourceBindings"},function(){return this.jD},function(a){this.jD=a});w.g(C,"skipsBoundsUpdates",C.prototype.Rp);w.defineProperty(C,{Rp:null},function(){return this.pz},function(a){this.pz=a});function uk(a,b){var c=b.sd===he,d=c?b.Wf:b.Yf,e=c?b.newValue:b.oldValue,g=a.am.Aa(b.object);if(Array.isArray(g))for(var h=0;h<g.length;h++){var k=g[h];if(c)vk(k,e,d);else{var l=d;if(!(0>l)){var m=l;wk(k)&&m++;k.ef(m);xk(k,m,l)}}}}
  function Rj(a,b){var c=b.oi;if(w.isArray(c)){var d=a.am.Aa(c);if(null===d)d=[],d.push(b),a.am.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}function Uj(a,b){var c=b.oi;if(w.isArray(c)){var d=a.am.Aa(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.am.remove(c);break}}}
  C.prototype.clear=C.prototype.clear=function(){var a=null;null!==this.ed&&(a=this.ed.V);this.fa.clear();for(var b=this.dc.length,c=0;c<b;c++)this.dc.q[c].clear();this.fg.clear();this.Tl.clear();this.Nr.clear();this.$k.clear();this.qr.clear();this.Hb.clear();this.hi.clear();this.Dk.clear();this.am.clear();this.Ov.Na();this.Ov.clear();this.Ov.freeze();this.av.Na();this.av.clear();this.av.freeze();pf=this.Cn=null;qf="";this.Ou=(new y(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.Hb.remove(a));
  this.pa()};
  C.prototype.reset=C.prototype.reset=function(){this.yc=!0;this.clear();this.dc=new D(De);this.bG();this.aG();this.Oa=(new x(NaN,NaN)).freeze();this.ec=1;this.cv=(new x(NaN,NaN)).freeze();this.dv=NaN;this.uv=1E-4;this.rv=100;this.ew=(new x(NaN,NaN)).freeze();this.Vu=(new y(NaN,NaN,NaN,NaN)).freeze();this.Ml=Cf;this.Bn=zc;this.Lk=Cf;this.Xn=zc;this.ev=this.bv=Ab;this.zu=(new eb(16,16,16,16)).freeze();this.iv=!0;this.bw=Ng;this.Aq="auto";this.gi=this.Bi=this.ri=this.xv=this.si=this.ti=this.ui=this.fi=
  this.ki=this.di=null;this.Nk=!1;this.pk=this.ok=this.pu=this.Xe=!0;this.ru=this.qu=!1;this.vu=this.su=this.$u=this.Zu=this.wu=this.uu=this.xk=this.wk=this.vk=this.uk=this.sk=this.tk=this.rk=this.tu=this.zk=this.qk=this.yk=!0;this.Lv=this.Kv=16;this.$e=(new eb(5)).freeze();this.sv=999999999;this.Td=null;aj(this);this.ed=null;this.yi=!0;$i(this);this.Lb=new Re;this.yi=!1;this.fa=new R;this.rf=!1;this.Rn=!0;this.yc=this.Mf=!1;this.pa()};
  C.prototype.rebuildParts=C.prototype.Al=function(){for(var a=this.mx.k;a.next();){var b=a.value,c=a.key;(!b.Kd()||b instanceof T)&&w.m('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.Nw.k;a.next();)b=a.value,c=a.key,b instanceof T||w.m('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.jx.k;a.next();)b=a.value,c=a.key,b instanceof
  U||w.m('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=w.lb();for(b=this.selection.k;b.next();)(c=b.value.data)&&a.push(c);for(var b=w.lb(),d=this.Rw.k;d.next();)(c=d.value.data)&&b.push(c);c=w.lb();for(d=this.Gg.k;d.next();){var e=d.value;null!==e.data&&(c.push(e.data),c.push(e.location))}for(d=this.links.k;d.next();)e=d.value,null!==e.data&&(c.push(e.data),c.push(e.location));for(d=this.hk.k;d.next();)e=d.value,null!==
  e.data&&(c.push(e.data),c.push(e.location));d=this.fa;d instanceof R&&nk(this,d.Ui);nk(this,d.Fg);ok(this,d.Fg);d instanceof R&&pk(this,d.Ui);for(d=0;d<a.length;d++)e=this.Sh(a[d]),null!==e&&(e.Za=!0);for(d=0;d<b.length;d++)e=this.Sh(b[d]),null!==e&&(e.Ag=!0);for(d=0;d<c.length;d+=2)e=this.Sh(c[d]),null!==e&&(e.location=c[d+1]);w.xa(a);w.xa(b);w.xa(c)};
  function ok(a,b){if(null!==b){for(var c=a.fa,d=w.vb(b),e=0;e<d;e++){var g=w.jb(b,e);c.pe(g)?rk(a,g,!1):c instanceof R&&sk(a,g)}if(c instanceof R||c instanceof xe){for(e=0;e<d;e++)g=w.jb(b,e),c.pe(g)&&yk(a,g);if(c instanceof R)for(c=a.links;c.next();)zk(c.value)}Ak(a,!1)}}function rk(a,b,c){if(void 0!==b&&null!==b&&!a.ka.sb&&!a.hi.contains(b)){void 0===c&&(c=!0);var d=a.eA(b),e=Bk(a,b,d);null!==e&&(vf(e),e=e.copy(),null!==e&&(e.ci=d,a.sn&&(e.Ok="Tool"),a.add(e),e.data=b,c&&yk(a,b)))}}
  C.prototype.eA=function(a){return this.fa.eA(a)};var Ck=!1,Dk=!1;function Bk(a,b,c){var d=!1,e=a.fa;e instanceof R&&(d=e.tA(b));d?(b=a.Nw.Aa(c),null===b&&(b=a.Nw.Aa(""),null===b&&(Dk||(Dk=!0,w.trace('No Group template found for category "'+c+'"'),w.trace("  Using default group template")),b=a.ZB))):(b=a.mx.Aa(c),null===b&&(b=a.mx.Aa(""),null===b&&(Ck||(Ck=!0,w.trace('No Node template found for category "'+c+'"'),w.trace("  Using default node template")),b=a.aC)));return b}
  function yk(a,b){var c=a.fa;if(c instanceof R||c instanceof xe){var d=c.Cb(b);if(void 0!==d){var e=We(c,d),g=a.Sh(b);if(null!==e&&null!==g){for(e=e.k;e.next();){var h=e.value;if(c instanceof R){var k=c;if(k.pe(h)){if(g instanceof T&&k.Um(h)===d){var l=g,h=a.Sh(h);null!==h&&(h.Va=l)}}else{var m=a.vg(h);if(null!==m&&g instanceof S&&(l=g,k.nl(h)===d&&(m.Z=l),k.ql(h)===d&&(m.da=l),h=k.fk(h),w.isArray(h)))for(k=0;k<w.vb(h);k++)if(w.jb(h,k)===d){l.Md=m;break}}}else c instanceof xe&&(m=c,m.pe(h)&&g instanceof
  S&&(l=g,m.Vm(h)===d&&(h=a.Jw(h),qk(a,l,h))))}Ye(c,d)}c instanceof R?(c=c.Um(b),void 0!==c&&(c=a.cf(c),c instanceof T&&(g.Va=c))):c instanceof xe&&(c=c.Vm(b),void 0!==c&&g instanceof S&&(l=g,g=a.cf(c),qk(a,g,l)))}}}
  function qk(a,b,c){if(null!==b&&null!==c){var d=a.tb.AA,e=b,g=c;if(a.ld)for(b=g.ve;b.next();){if(b.value.da===g)return}else for(e=c,g=b,b=e.ve;b.next();)if(b.value.Z===e)return;null!==d&&Xg(d,e,g,null,!0)||(d=a.Mw(c.data),b=Ek(a,d),null!==b&&(vf(b),b=b.copy(),null!==b&&(b.ci=d,b.Z=e,b.da=g,a.add(b),b.data=c.data)))}}function pk(a,b){if(null!==b){for(var c=w.vb(b),d=0;d<c;d++){var e=w.jb(b,d);sk(a,e)}Ak(a,!1)}}
  function sk(a,b){if(void 0!==b&&null!==b&&!a.ka.sb&&!a.Dk.contains(b)){var c=a.Mw(b),d=Ek(a,c);if(null!==d&&(vf(d),d=d.copy(),null!==d)){d.ci=c;var c=a.fa,e=c.LI(b);""!==e&&(d.Rf=e);e=c.nl(b);void 0!==e&&(e=a.cf(e),e instanceof S&&(d.Z=e));e=c.OI(b);""!==e&&(d.Og=e);e=c.ql(b);void 0!==e&&(e=a.cf(e),e instanceof S&&(d.da=e));c=c.fk(b);if(w.isArray(c))for(var e=w.vb(c),g=0;g<e;g++){var h=w.jb(c,g),h=a.cf(h);null!==h&&(h.Md=d)}a.add(d);d.data=b}}}
  C.prototype.Mw=function(a){var b=this.fa,c="";b instanceof R?c=b.Mw(a):b instanceof xe&&(c=b.NI(a));return c};var Fk=!1;function Ek(a,b){var c=a.jx.Aa(b);null===c&&(c=a.jx.Aa(""),null===c&&(Fk||(Fk=!0,w.trace('No Link template found for category "'+b+'"'),w.trace("  Using default link template")),c=a.$B));return c}function nk(a,b){for(var c=w.vb(b),d=0;d<c;d++){var e=w.jb(b,d);tk(a,e)}}
  function tk(a,b){if(void 0!==b&&null!==b){var c=a.Sh(b);if(null!==c){c.Za=!1;c.Ag=!1;var d=c.layer;if(null!==d&&d.h===a){var e=a.fa;if(e instanceof R&&c instanceof S){var g=c,h=e.Cb(g.data);if(void 0!==h){for(var k=g.ve;k.next();)Xe(e,h,k.value.data);g.zf&&(k=g.Md,null!==k&&Xe(e,h,k.data));if(g instanceof T)for(g=g.Rc;g.next();)k=g.value.data,e.pe(k)&&Xe(e,h,k)}}else if(e instanceof xe&&c instanceof S){g=c;k=a.vg(g.data);if(null!==k){k.Za=!1;k.Ag=!1;var l=k.layer;if(null!==l){var m=l.ef(-1,k,!1);
  0<=m&&a.Hc(ie,"parts",l,k,null,m,null);m=k.mp;null!==m&&m(k,l,null)}}k=a.ld;for(g=g.ve;g.next();)l=g.value,l=(k?l.da:l.Z).data,e.pe(l)&&Xe(e,h,l)}e=d.ef(-1,c,!1);0<=e&&a.Hc(ie,"parts",d,c,null,e,null);e=c.mp;null!==e&&e(c,d,null)}}}}C.prototype.findPartForKey=C.prototype.JI=function(a){if(null===a||void 0===a)return null;a=this.fa.wf(a);return null===a?null:this.hi.Aa(a)};
  C.prototype.findNodeForKey=C.prototype.cf=function(a){if(null===a||void 0===a)return null;a=this.fa.wf(a);if(null===a)return null;a=this.hi.Aa(a);return a instanceof S?a:null};C.prototype.findPartForData=C.prototype.Sh=function(a){if(null===a)return null;var b=this.hi.Aa(a);return null!==b?b:b=this.Dk.Aa(a)};C.prototype.findNodeForData=C.prototype.Jw=function(a){if(null===a)return null;a=this.hi.Aa(a);return a instanceof S?a:null};
  C.prototype.findLinkForData=C.prototype.vg=function(a){return null===a?null:this.Dk.Aa(a)};C.prototype.findNodesByExample=function(a){for(var b=new F,c=this.Nr.k;c.next();){var d=c.value,e=d.data;if(null!==e)for(var g=0;g<arguments.length;g++){var h=arguments[g];if(w.Xa(h)&&Gk(this,e,h)){b.add(d);break}}}return b.k};
  C.prototype.findLinksByExample=function(a){for(var b=new F,c=this.qr.k;c.next();){var d=c.value,e=d.data;if(null!==e)for(var g=0;g<arguments.length;g++){var h=arguments[g];if(w.Xa(h)&&Gk(this,e,h)){b.add(d);break}}}return b.k};function Gk(a,b,c){for(var d in c){var e=b[d],g=c[d];if(w.isArray(g)){if(!w.isArray(e)||e.length>=g.length)return!1;for(var h=0;h<e.length;h++){var k=e[h],l=g[h];if(void 0!==l&&!Hk(a,k,l))return!1}}else if(!Hk(a,e,g))return!1}return!0}
  function Hk(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(w.Xa(b)&&w.Xa(c)){if(!Gk(a,b,c))return!1}else if(b!==c)return!1;return!0}w.g(C,"nodeTemplate",C.prototype.uJ);w.defineProperty(C,{uJ:"nodeTemplate"},function(){return this.vi.Aa("")},function(a){var b=this.vi.Aa("");b!==a&&(w.l(a,H,C,"nodeTemplate"),this.vi.add("",a),this.j("nodeTemplate",b,a),this.ka.sb||this.Al())});w.g(C,"nodeTemplateMap",C.prototype.mx);
  w.defineProperty(C,{mx:"nodeTemplateMap"},function(){return this.vi},function(a){var b=this.vi;b!==a&&(w.l(a,ia,C,"nodeTemplateMap"),this.vi=a,this.j("nodeTemplateMap",b,a),this.ka.sb||this.Al())});w.g(C,"groupTemplate",C.prototype.RI);w.defineProperty(C,{RI:"groupTemplate"},function(){return this.Gk.Aa("")},function(a){var b=this.Gk.Aa("");b!==a&&(w.l(a,T,C,"groupTemplate"),this.Gk.add("",a),this.j("groupTemplate",b,a),this.ka.sb||this.Al())});w.g(C,"groupTemplateMap",C.prototype.Nw);
  w.defineProperty(C,{Nw:"groupTemplateMap"},function(){return this.Gk},function(a){var b=this.Gk;b!==a&&(w.l(a,ia,C,"groupTemplateMap"),this.Gk=a,this.j("groupTemplateMap",b,a),this.ka.sb||this.Al())});w.g(C,"linkTemplate",C.prototype.lJ);w.defineProperty(C,{lJ:"linkTemplate"},function(){return this.rj.Aa("")},function(a){var b=this.rj.Aa("");b!==a&&(w.l(a,U,C,"linkTemplate"),this.rj.add("",a),this.j("linkTemplate",b,a),this.ka.sb||this.Al())});w.g(C,"linkTemplateMap",C.prototype.jx);
  w.defineProperty(C,{jx:"linkTemplateMap"},function(){return this.rj},function(a){var b=this.rj;b!==a&&(w.l(a,ia,C,"linkTemplateMap"),this.rj=a,this.j("linkTemplateMap",b,a),this.ka.sb||this.Al())});w.g(C,"isMouseOverDiagram",C.prototype.lF);w.defineProperty(C,{lF:null},function(){return this.Yl},function(a){this.Yl=a});w.g(C,"isMouseCaptured",C.prototype.te);
  w.defineProperty(C,{te:"isMouseCaptured"},function(){return this.AC},function(a){var b=this.mb;null!==b&&(a?(this.P.bubbles=!1,b.removeEventListener("mousemove",this.Ap,!1),b.removeEventListener("mousedown",this.zp,!1),b.removeEventListener("mouseup",this.Cp,!1),b.removeEventListener("mousewheel",this.hh,!1),b.removeEventListener("DOMMouseScroll",this.hh,!1),b.removeEventListener("mouseout",this.Bp,!1),window.addEventListener("mousemove",this.Ap,!0),window.addEventListener("mousedown",this.zp,!0),
  window.addEventListener("mouseup",this.Cp,!0),window.addEventListener("mousewheel",this.hh,!0),window.addEventListener("DOMMouseScroll",this.hh,!0),window.addEventListener("mouseout",this.Bp,!0),window.addEventListener("selectstart",this.preventDefault,!1)):(window.removeEventListener("mousemove",this.Ap,!0),window.removeEventListener("mousedown",this.zp,!0),window.removeEventListener("mouseup",this.Cp,!0),window.removeEventListener("mousewheel",this.hh,!0),window.removeEventListener("DOMMouseScroll",
  this.hh,!0),window.removeEventListener("mouseout",this.Bp,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("mousemove",this.Ap,!1),b.addEventListener("mousedown",this.zp,!1),b.addEventListener("mouseup",this.Cp,!1),b.addEventListener("mousewheel",this.hh,!1),b.addEventListener("DOMMouseScroll",this.hh,!1),b.addEventListener("mouseout",this.Bp,!1)),this.AC=a)});w.g(C,"position",C.prototype.position);
  w.defineProperty(C,{position:"position"},function(){return this.Oa},function(a){var b=this.Oa;if(!b.L(a)){w.l(a,x,C,"position");var c=this.ub.copy();a=a.copy();if(!this.yc&&null!==this.mb){this.yc=!0;var d=this.scale;pj(this,a,this.Hd,this.Fb/d,this.Eb/d,this.Bn,!1);this.yc=!1}this.Oa=a.ba();a=this.Pb;a.pd&&Ai(a,b,this.Oa);this.yc||this.Nt(c,this.ub)}});w.g(C,"initialPosition",C.prototype.bF);
  w.defineProperty(C,{bF:"initialPosition"},function(){return this.cv},function(a){this.cv.L(a)||(w.l(a,x,C,"initialPosition"),this.cv=a.ba())});w.g(C,"initialScale",C.prototype.cF);w.defineProperty(C,{cF:"initialScale"},function(){return this.dv},function(a){this.dv!==a&&(w.i(a,"number",C,"initialScale"),this.dv=a)});w.g(C,"grid",C.prototype.dp);
  w.defineProperty(C,{dp:"grid"},function(){null===this.ed&&hj(this);return this.ed},function(a){var b=this.ed;if(b!==a){null===b&&(hj(this),b=this.ed);w.l(a,z,C,"grid");a.type!==ij&&w.m("Diagram.grid must be a Panel of type Panel.Grid");var c=b.U;null!==c&&c.remove(b);this.ed=a;a.name="GRID";null!==c&&c.add(a);Bj(this);this.pa();this.j("grid",b,a)}});
  w.A(C,{ub:"viewportBounds"},function(){var a=this.HD;if(null===this.mb)return a;var b=this.Oa,c=this.ec;a.o(b.x,b.y,Math.max(this.Fb,0)/c,Math.max(this.Eb,0)/c);return a});w.g(C,"fixedBounds",C.prototype.aA);
  w.defineProperty(C,{aA:"fixedBounds"},function(){return this.Vu},function(a){var b=this.Vu;b.L(a)||(w.l(a,y,C,"fixedBounds"),(t&&Infinity===a.width||-Infinity===a.width||Infinity===a.height||-Infinity===a.height)&&w.m("fixedBounds width/height must not be Infinity"),this.Vu=a=a.ba(),this.oc(),this.j("fixedBounds",b,a))});w.g(C,"scrollMargin",C.prototype.cB);
  w.defineProperty(C,{cB:"scrollMargin"},function(){return this.nz},function(a){"number"===typeof a?a=new eb(a):w.l(a,eb,C,"scrollMargin");var b=this.nz;b.L(a)||(this.nz=a=a.ba(),this.oc(),this.j("scrollMargin",b,a))});w.g(C,"scrollMode",C.prototype.dB);w.defineProperty(C,{dB:"scrollMode"},function(){return this.oz},function(a){var b=this.oz;b!==a&&(w.za(a,C,C,"scrollMode"),this.oz=a,a===Vi&&nj(this,!1),this.j("scrollMode",b,a))});w.g(C,"positionComputation",C.prototype.LA);
  w.defineProperty(C,{LA:"positionComputation"},function(){return this.hz},function(a){var b=this.hz;b!==a&&(null!==a&&w.i(a,"function",C,"positionComputation"),this.hz=a,nj(this,!1),this.j("positionComputation",b,a))});w.g(C,"scaleComputation",C.prototype.bB);w.defineProperty(C,{bB:"scaleComputation"},function(){return this.jz},function(a){var b=this.jz;b!==a&&(null!==a&&w.i(a,"function",C,"scaleComputation"),this.jz=a,ck(this,this.scale,this.scale),this.j("scaleComputation",b,a))});
  w.A(C,{Hd:"documentBounds"},function(){return this.Ou});function qj(a,b){a.mi=!1;var c=a.Ou;c.L(b)||(b=b.ba(),a.Ou=b,nj(a,!1),a.Ba("DocumentBoundsChanged",null,c.copy()),zj(a))}w.g(C,"scale",C.prototype.scale);w.defineProperty(C,{scale:"scale"},function(){return this.ec},function(a){var b=this.ec;w.p(a,C,"scale");b!==a&&ck(this,b,a)});w.g(C,"autoScale",C.prototype.Fm);
  w.defineProperty(C,{Fm:"autoScale"},function(){return this.Ml},function(a){var b=this.Ml;b!==a&&(w.za(a,C,C,"autoScale"),this.Ml=a,this.j("autoScale",b,a),a!==Cf&&nj(this,!1))});w.g(C,"initialAutoScale",C.prototype.VI);w.defineProperty(C,{VI:"initialAutoScale"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(w.za(a,C,C,"initialAutoScale"),this.Lk=a,this.j("initialAutoScale",b,a))});w.g(C,"initialViewportSpot",C.prototype.dF);
  w.defineProperty(C,{dF:"initialViewportSpot"},function(){return this.ev},function(a){var b=this.ev;b!==a&&(w.l(a,K,C,"initialViewportSpot"),a.kd()||w.m("initialViewportSpot must be a real Spot: "+a),this.ev=a,this.j("initialViewportSpot",b,a))});w.g(C,"initialDocumentSpot",C.prototype.aF);
  w.defineProperty(C,{aF:"initialDocumentSpot"},function(){return this.bv},function(a){var b=this.bv;b!==a&&(w.l(a,K,C,"initialDocumentSpot"),a.kd()||w.m("initialViewportSpot must be a real Spot: "+a),this.bv=a,this.j("initialDocumentSpot",b,a))});w.g(C,"minScale",C.prototype.Dg);w.defineProperty(C,{Dg:"minScale"},function(){return this.uv},function(a){w.p(a,C,"minScale");var b=this.uv;b!==a&&(0<a?(this.uv=a,this.j("minScale",b,a),a>this.scale&&(this.scale=a)):w.la(a,"> 0",C,"minScale"))});
  w.g(C,"maxScale",C.prototype.Cg);w.defineProperty(C,{Cg:"maxScale"},function(){return this.rv},function(a){w.p(a,C,"maxScale");var b=this.rv;b!==a&&(0<a?(this.rv=a,this.j("maxScale",b,a),a<this.scale&&(this.scale=a)):w.la(a,"> 0",C,"maxScale"))});w.g(C,"zoomPoint",C.prototype.Ll);w.defineProperty(C,{Ll:"zoomPoint"},function(){return this.ew},function(a){this.ew.L(a)||(w.l(a,x,C,"zoomPoint"),this.ew=a=a.ba())});w.g(C,"contentAlignment",C.prototype.sw);
  w.defineProperty(C,{sw:"contentAlignment"},function(){return this.Bn},function(a){var b=this.Bn;b.L(a)||(w.l(a,K,C,"contentAlignment"),this.Bn=a=a.ba(),this.j("contentAlignment",b,a),nj(this,!1))});w.g(C,"initialContentAlignment",C.prototype.WI);w.defineProperty(C,{WI:"initialContentAlignment"},function(){return this.Xn},function(a){var b=this.Xn;b.L(a)||(w.l(a,K,C,"initialContentAlignment"),this.Xn=a=a.ba(),this.j("initialContentAlignment",b,a))});w.g(C,"padding",C.prototype.padding);
  w.defineProperty(C,{padding:"padding"},function(){return this.$e},function(a){"number"===typeof a?a=new eb(a):w.l(a,eb,C,"padding");var b=this.$e;b.L(a)||(this.$e=a=a.ba(),this.oc(),this.j("padding",b,a))});w.A(C,{Gg:"nodes"},function(){return this.Nr.k});w.A(C,{links:"links"},function(){return this.qr.k});w.A(C,{hk:"parts"},function(){return this.Hb.k});C.prototype.findTopLevelGroups=function(){return this.$k.k};w.g(C,"layout",C.prototype.Lb);
  w.defineProperty(C,{Lb:"layout"},function(){return this.Td},function(a){var b=this.Td;b!==a&&(w.l(a,Re,C,"layout"),null!==b&&(b.h=null,b.group=null),this.Td=a,a.h=this,a.group=null,this.xu=!0,this.j("layout",b,a),this.Se())});C.prototype.layoutDiagram=function(a){lj(this);a&&Ak(this,!0);Dj(this,!1)};function Ak(a,b){for(var c=a.$k.k;c.next();)Ik(a,c.value,b);null!==a.Lb&&(b?a.Lb.gf=!1:a.Lb.K())}
  function Ik(a,b,c){if(null!==b){for(var d=b.lo.k;d.next();)Ik(a,d.value,c);null!==b.Lb&&(c?b.Lb.gf=!1:b.Lb.K())}}function Dj(a,b){if(!a.yy){var c=a.Lb,d=a.jv;a.jv=!0;var e=a.Pa;a.Pa=!0;try{a.ac("Layout");for(var g=a.$k.k;g.next();)Jk(a,g.value,b);c.gf||b&&!c.yA||(c.doLayout(a),lj(a),c.gf=!0)}finally{a.ae("Layout"),a.xu=!c.gf,a.jv=d,a.Pa=e}}}
  function Jk(a,b,c){if(null!==b){for(var d=b.lo.k;d.next();)Jk(a,d.value,c);d=b.Lb;null===d||d.gf||c&&!d.yA||(b.cz=!b.location.J(),d.doLayout(b),b.K(Kk),d.gf=!0,Fj(a,b))}}w.g(C,"isTreePathToChildren",C.prototype.ld);w.defineProperty(C,{ld:"isTreePathToChildren"},function(){return this.iv},function(a){var b=this.iv;if(b!==a&&(w.i(a,"boolean",C,"isTreePathToChildren"),this.iv=a,this.j("isTreePathToChildren",b,a),!this.ka.sb))for(a=this.Gg;a.next();)Lk(a.value)});
  C.prototype.findTreeRoots=function(){for(var a=new D(S),b=this.Gg;b.next();){var c=b.value;c.$w&&null===c.pt()&&a.add(c)}return a.k};w.g(C,"isCollapsingExpanding",C.prototype.ee);w.defineProperty(C,{ee:null},function(){return this.sC},function(a){this.sC=a});
  function Wi(a){function b(a){var b=a.toLowerCase(),h=new D("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ia("string",D),d=new ia("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.Ay=c;a.zy=d}
  function la(a,b){var c=a.zy.Aa(b);return null!==c?c:a.zy.Aa(b.toLowerCase())}function Mk(a,b){var c=a.Ay.Aa(b);if(null!==c)return c;c=a.Ay.Aa(b.toLowerCase());if(null!==c)return c;w.m("Unknown DiagramEvent name: "+b);return null}C.prototype.addDiagramListener=C.prototype.Iz=function(a,b){w.i(a,"string",C,"addDiagramListener:name");w.i(b,"function",C,"addDiagramListener:listener");var c=Mk(this,a);null!==c&&c.add(b)};
  C.prototype.removeDiagramListener=C.prototype.XF=function(a,b){w.i(a,"string",C,"removeDiagramListener:name");w.i(b,"function",C,"addDiagramListener:listener");var c=Mk(this,a);null!==c&&c.remove(b)};C.prototype.raiseDiagramEvent=C.prototype.Ba=function(a,b,c){t&&w.i(a,"string",C,"raiseDiagramEvent:name");var d=Mk(this,a),e=new Td;e.h=this;e.name=la(this,a);void 0!==b&&(e.Hx=b);void 0!==c&&(e.ux=c);a=d.length;if(1===a)d=d.na(0),d(e);else if(0!==a)for(b=d.Ue(),c=0;c<a;c++)d=b[c],d(e);return e.cancel};
  function Ig(a,b){var c=!1;a.ub.Vj(b)&&(c=!0);c=a.$z(b,function(a){return a.V},function(a){return a instanceof U},!0,function(a){return a instanceof U},c);if(0!==c.count)for(c=c.k;c.next();){var d=c.value;d.Si&&d.$b()}}C.prototype.isUnoccupied=C.prototype.lp=function(a,b){void 0===b&&(b=null);return Nk(this,!1,null,b).lp(a.x,a.y,a.width,a.height)};
  function Nk(a,b,c,d){null===a.qd&&(a.qd=new Ok);if(a.qd.wt||a.qd.group!==c||a.qd.lB!==d){if(null===c){b=a.mi?mj(a):a.Hd.copy();b.Sf(100,100);a.qd.initialize(b);b=w.$f();for(var e=a.Gg;e.next();){var g=e.value,h=g.layer;null!==h&&h.visible&&!h.Ac&&Pk(a,g,d,b)}}else for(c.ea.J()||c.vf(),b=c.ea.copy(),b.Sf(20,20),a.qd.initialize(b),b=w.$f(),e=c.Rc;e.next();)g=e.value,g instanceof S&&Pk(a,g,d,b);w.nc(b);a.qd.group=c;a.qd.lB=d;a.qd.wt=!1}else b&&Qk(a.qd);return a.qd}
  function Pk(a,b,c,d){if(b!==c)if(b.Ja()&&b.canAvoid()){c=b.getAvoidableRect(d);d=a.qd.Hm;b=a.qd.Gm;for(var e=c.x+c.width,g=c.y+c.height,h=c.x;h<e;h+=d){for(var k=c.y;k<g;k+=b)Rk(a.qd,h,k);Rk(a.qd,h,g)}for(k=c.y;k<g;k+=b)Rk(a.qd,e,k);Rk(a.qd,e,g)}else if(b instanceof T)for(b=b.Rc;b.next();)e=b.value,e instanceof S&&Pk(a,e,c,d)}function Sk(a,b){null===a.qd||a.qd.wt||null!==b&&!b.canAvoid()||(a.qd.wt=!0)}
  C.prototype.simulatedMouseMove=C.prototype.Dx=function(a,b,c){if(null!==Lf){var d=Lf.h;c instanceof C||(c=null);var e=Mf;c!==e&&(null!==e&&e!==d&&null!==e.tb.ud&&(eg(e),Lf.yt=!1,e.tb.ud.doSimulatedDragLeave()),Mf=c,null!==c&&c!==d&&null!==c.tb.ud&&(lg(),e=c.tb.ud,hg.contains(e)||hg.add(e),c.tb.ud.doSimulatedDragEnter()));if(null===c||c===d||!c.Kz||c.hb||!c.Bm)return!1;d=c.tb.ud;null!==d&&(null!==a?b=c.Lq(a):null===b&&(b=new x),c.Sb.ga=b,c.Sb.ak=!1,c.Sb.up=!1,d.doSimulatedDragOver());return!0}return!1};
  C.prototype.simulatedMouseUp=C.prototype.zG=function(a,b,c,d){if(null!==Lf){null===d&&(d=b);b=Mf;var e=Lf.h;if(d!==b){if(null!==b&&b!==e&&null!==b.tb.ud)return eg(b),Lf.yt=!1,b.tb.ud.doSimulatedDragLeave(),!1;Mf=d;null!==d&&null!==d.tb.ud&&(lg(),b=d.tb.ud,hg.contains(b)||hg.add(b),d.tb.ud.doSimulatedDragEnter())}if(null===d)return Lf.doCancel(),!0;if(d!==this)return null!==a&&(c=d.Lq(a)),d.Sb.ga=c,d.Sb.ak=!1,d.Sb.up=!0,a=d.tb.ud,null!==a&&a.doSimulatedDrop(),a=Lf,null!==a&&(d=a.mayCopy(),a.mf=d?"Copy":
  "Move",a.stopTool()),!0}return!1};w.g(C,"autoScrollRegion",C.prototype.UD);w.defineProperty(C,{UD:"autoScrollRegion"},function(){return this.zu},function(a){"number"===typeof a?a=new eb(a):w.l(a,eb,C,"autoScrollRegion");var b=this.zu;b.L(a)||(this.zu=a=a.ba(),this.oc(),this.j("autoScrollRegion",b,a))});function Dg(a,b){a.yu.assign(b);Tk(a,a.yu).Ne(a.position)?eg(a):Uk(a)}
  function Uk(a){-1===a.wn&&(a.wn=w.setInterval(function(){if(-1!==a.wn){eg(a);var b=a.P.event;if(null!==b){var c=Tk(a,a.yu);c.Ne(a.position)||(a.position=c,a.P.ga=a.SG(a.yu),a.Dx(b,null,b.target.Y)||a.doMouseMove(),a.mi=!0,qj(a,a.tg()),a.Sd=!0,a.kf(),Uk(a))}}},a.iH))}function eg(a){-1!==a.wn&&(w.clearInterval(a.wn),a.wn=-1)}
  function Tk(a,b){var c=a.position,d=a.UD;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.ub,g=a.scale,e=w.lk(0,0,e.width*g,e.height*g),h=w.ic(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.Op,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.Op,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.Pp,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.Pp,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.Ne(J.nk)||(c=new x(c.x+h.x/g,c.y+h.y/g));w.nc(e);w.B(h);return c}C.prototype.makeSVG=C.prototype.makeSvg=function(a){void 0===a&&(a=new na);a.context="svg";a=Vk(this,a);return null!==a?a.Gl:null};
  C.prototype.makeImage=function(a){void 0===a&&(a=new na);var b=(a.document||document).createElement("img");b.src=this.mJ(a);return b};C.prototype.makeImageData=C.prototype.mJ=function(a){void 0===a&&(a=new na);var b=Vk(this,a);return null!==b?b.toDataURL(a.type,a.details):""};var Wk=!1;
  function Vk(a,b){a.Pb.Xi();a.kf();if(null===a.mb)return null;"object"!==typeof b&&w.m("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 g=b.maxSize;void 0===b.maxSize&&(c=!0,g="svg"===b.context?new fa(Infinity,Infinity):new fa(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 eb(l):l instanceof eb||(l=new eb(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.Nn=!1;gj(a);var s=new ma(null,p),u=s.getContext("2d"),v=s;if(!(d||e||k||h))return s.width=a.Fb+Math.ceil(l.left+l.right),s.height=a.Eb+Math.ceil(l.top+l.bottom),"svg"===b.context&&(u=v=new Sc(s.Jd,p,q),u instanceof
  Sc&&(a.Nn=!0)),Mj(a,u,l,new fa(s.width,s.height),a.ec,a.Oa,k,m,r,n),a.Nn=!0,v;var A=a.Ab.it,E=new x(0,0),B=a.Hd.copy();B.aK(a.padding);if(r)for(var G=!0,G=a.dc.q,O=G.length,M=0;M<O;M++){var X=G[M];if(X.visible&&X.Ac)for(var ja=X.Hb.q,X=ja.length,V=0;V<X;V++){var Q=ja[V];Q.Xw&&Q.Ja()&&(Q=Q.ea,Q.J()&&B.$h(Q))}}E.x=B.x;E.y=B.y;if(null!==k){var ca,G=!0,ja=k.k;for(ja.reset();ja.next();)O=ja.value,O instanceof H&&(Q=O,X=Q.layer,null!==X&&!X.visible||null!==X&&!r&&X.Ac||!Q.Ja()||(Q=Q.ea,Q.J()&&(G?(G=!1,
  ca=Q.copy()):ca.$h(Q))));G&&(ca=new y(0,0,0,0));B.width=ca.width;B.height=ca.height;E.x=ca.x;E.y=ca.y}null!==h&&h.J()&&(E=h,e||(e=A));G=ja=0;null!==l&&(ja=l.left+l.right,G=l.top+l.bottom);M=O=0;null!==d&&(O=d.width,M=d.height,isFinite(O)&&(O=Math.max(0,O-ja)),isFinite(M)&&(M=Math.max(0,M-G)));ca=h=0;null!==d&&null!==e?("NaN"===e&&(e=A),d.J()?(h=O,ca=M):isNaN(M)?(h=O,ca=B.height*e):(h=B.width*e,ca=M)):null!==d?d.J()?(e=Math.min(O/B.width,M/B.height),h=O,ca=M):isNaN(M)?(e=O/B.width,h=O,ca=B.height*
  e):(e=M/B.height,h=B.width*e,ca=M):null!==e?"NaN"===e&&g.J()?(e=Math.min((g.width-ja)/B.width,(g.height-G)/B.height),e>A?(e=A,h=B.width,ca=B.height):(h=g.width,ca=g.height)):(h=B.width*e,ca=B.height*e):(e=A,h=B.width,ca=B.height);null!==l?(h+=ja,ca+=G):l=new eb(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!Wk&&(h>d||ca>g)&&(w.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ca)+" vs 2000x2000) Consider increasing the max size."),
  Wk=!0),isNaN(d)&&(d=2E3),isNaN(g)&&(g=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(g)&&(ca=Math.min(ca,g)));s.width=Math.ceil(h);s.height=Math.ceil(ca);"svg"===b.context&&(u=v=new Sc(s.Jd,p,q),u instanceof Sc&&(a.Nn=!0));Mj(a,u,l,new fa(Math.ceil(h),Math.ceil(ca)),e,E,k,m,r,n);a.Nn=!0;return v}C.inherit=function(a,b){w.i(a,"function",C,"inherit");w.i(b,"function",C,"inherit");b.xH&&w.m("Cannot inherit from "+w.yg(b));w.Ia(a,b)};
  function bj(){this.AH="63ad05bbe23a1786468a4c741b6d2";this.AH===this._tk?this.wh=!0:Xk(this,!1)}
  function Xk(a,b){var c="p",d=window[w.Ha("76a715b2f73f148a")][w.Ha("72ba13b5")];if(w.Ha("77bb5bb2f32603de")===window[w.Ha("76a715b2f73f148a")][w.Ha("6aba19a7ec351488")])try{a.wh=!window[w.Ha("4da118b7ec2108")]([w.Ha("5bb806bfea351a904a84515e1b6d38b6")])([w.Ha("49bc19a1e6")])([w.Ha("59bd04a1e6380fa5539b")])([w.Ha("7bb8069ae7")]===w.Ha(w.iw));if(!1===a.wh)return;a.wh=!window[w.Ha("4da118b7ec2108")]([w.Ha("5bb806bfea351a904a84515e1b6d38b6")])([w.Ha("49bc19a1e6")])([w.Ha("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([w.Ha("7bb8069ae7")]===w.Ha(w.iw));
  if(!1===a.wh)return}catch(e){}for(var g=d[w.Ha("76ad18b4f73e")],h=d[w.Ha("73a612b6fb191d")](w.Ha("35e7"))+2;h<g;h++)c+=d[h];d=c[w.Ha("73a612b6fb191d")](w.Ha(w.iw));0>=d&&w.Ha(w.iw)!==w.Ha("7da71ca0ad381e90")&&(d=c[w.Ha("73a612b6fb191d")](w.Ha("76a715b2ef3e149757")));a.wh=!(0<d&&d<c[w.Ha("73a612b6fb191d")](w.Ha("35")));a.wh&&(c=window.document[w.Ha("79ba13b2f7333e8846865a7d00")]("div"),d=w.Ha("34af05bbcb331a804699"),"."===d[0]&&(d=d[w.Ha("69bd14a0f724128a44")](1)),c[w.Ha("79a417a0f0181a8946")]=d,window.document[w.Ha("78a712aa")]?
  (window.document[w.Ha("78a712aa")][w.Ha("7bb806b6ed32388c4a875b")](c),d=window[w.Ha("7dad0290ec3b0b91578e5b40007031bf")](c)[w.Ha("7dad0283f1390b81519f4645156528bf")](w.Ha("78a704b7e62456904c9b12701b6532a8")),window.document[w.Ha("78a712aa")][w.Ha("68ad1bbcf533388c4a875b")](c),d&&-1!==d.indexOf(w.Ha(w.fI))&&-1!==d.indexOf(w.Ha(w.gI))&&(a.wh=!1)):(a.wh=null,b&&(a.wh=!1)))}
  bj.prototype.Kl=function(a){a.Sg.setTransform(a.tf,0,0,a.tf,0,0);null===this.wh&&Xk(this,!0);return 0<this.wh&&this!==this.yH?!0:!1};bj.prototype.t=function(){this.yH=null};
  function cj(a,b){void 0!==b&&null!==b||w.m("Diagram setup requires an argument DIV.");null!==a.Nb&&w.m("Diagram has already completed setup.");"string"===typeof b?a.Nb=window.document.getElementById(b):b instanceof HTMLDivElement?a.Nb=b:w.m("No DIV or DIV id supplied: "+b);null===a.Nb&&w.m("Invalid DIV id; could not get element with id: "+b);void 0!==a.Nb.Y&&w.m("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Nb,null).position&&(a.Nb.style.position=
  "relative");a.Nb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Nb.style["-ms-touch-action"]="none";a.Nb.innerHTML="";a.Nb.Y=a;var c=new ma(a);c.Jd.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.Nb,null).getPropertyValue("direction")&&(a.CC=!0),c.style.zIndex="2",c.style.XK="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
  "none");a.Fb=a.Nb.clientWidth||1;a.Eb=a.Nb.clientHeight||1;a.mb=c;a.Sg=c.getContext("2d");var d=a.Sg;a.tf=a.computePixelRatio();Oj(a,a.Fb,a.Eb);a.Xx=d[w.Ha("7eba17a4ca3b1a8346")][w.Ha("78a118b7")](d,w.Kl,4,4);a.Nb.insertBefore(c.Jd,a.Nb.firstChild);c=new ma(null);c.width=1;c.height=1;a.Cy=c;a.kC=c.getContext("2d");var c=w.createElement("div"),d=w.createElement("div"),e=w.createElement("div"),g=w.createElement("div");c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Fb+"px";c.style.height=
  a.Eb+"px";c.style.zIndex="1";d.style.position="absolute";d.style.overflow="auto";d.style.width=a.Fb+"px";d.style.height=a.Eb+"px";d.style.zIndex="1";e.style.position="absolute";e.style.width="1px";e.style.height="1px";g.style.position="absolute";g.style.width="1px";g.style.height="1px";a.Nb.appendChild(c);a.Nb.appendChild(d);c.appendChild(e);d.appendChild(g);c.onscroll=a.RC;c.onmousedown=a.Bv;c.ontouchstart=a.Bv;c.Y=a;c.gD=!0;d.onscroll=a.RC;d.onmousedown=a.Bv;d.ontouchstart=a.Bv;d.Y=a;d.hD=!0;a.Ej=
  c;a.Fj=d;a.lz=e;a.mz=g;a.SF=w.rE(function(){a.ym=null;a.pa()},300,!1);a.$G=w.rE(function(){oi(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.Ap=function(b){if(a.isEnabled){a.Yl=!0;var c=a.Mc;w.Wm&&c.ul?(b.preventDefault(),b.simulated=!0,a.ys=b):(a.Mc=a.Sb,a.Sb=c,uj(a,a,b,c,!0),a.Dx(b,null,b.target.Y)||(a.doMouseMove(),a.Wa.isBeyondDragSize()&&(Ff(a),a.cm=0)))}};a.zp=function(b){if(a.isEnabled){a.Yl=!0;var c=a.Mc;if(w.Wm&&null!==a.ys)a.ys=b,b.preventDefault();else if(w.Wm&&
  400>b.timeStamp-a.dm)b.preventDefault();else if(a.Mc=a.Sb,a.Sb=c,uj(a,a,b,c,!0),c.ak=!0,c.Je=b.detail,a.Fk=c.copy(),!0===c.Gq.simulated)b.preventDefault(),b.simulated=!0;else if(t&&t.MF&&(window.MF=a.Vo(c.ga)),Lf=null,a.doMouseDown(),1===b.button)return b.preventDefault(),!1}};a.Cp=function(b){if(a.isEnabled){a.Yl=!0;var c=a.Mc;if(w.Wm){if(400>b.timeStamp-a.dm){b.preventDefault();return}a.dm=b.timeStamp}if(w.Wm&&null!==a.ys)a.ys=null,b.preventDefault();else{a.Mc=a.Sb;a.Sb=c;uj(a,a,b,c,!0);c.up=!0;
  c.Je=b.detail;if(w.uA||w.vA)b.timeStamp-a.dm<a.ED&&!a.Wa.isBeyondDragSize()?a.cm++:a.cm=1,a.dm=b.timeStamp,c.Je=a.cm;c.bubbles=b.bubbles;b.target.Y&&(c.Zf=b.target.Y);a.zG(b,null,new x,c.Zf)||(a.doMouseUp(),eg(a),yj(a,c,b))}}};a.hh=function(b){if(a.isEnabled){var c=a.Mc;a.Mc=a.Sb;a.Sb=c;uj(a,a,b,c,!0);c.bubbles=!0;c.Yj=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();yj(a,c,b)}};a.Bp=function(){if(a.isEnabled){a.Yl=!1;var b=a.Wa;b.cancelWaitAfter();b instanceof rf&&b.hideToolTip()}};
  a.NG=function(b){if(a.isEnabled){a.Vv=!1;a.Uy=!0;var c=a.Mc;a.Mc=a.Sb;a.Sb=c;wj(a,b,b.targetTouches[0],c,1<b.touches.length);a.doMouseDown();2>b.touches.length&&tj(a,c);yj(a,c,b)}};a.MG=function(b){if(a.isEnabled){var c=a.Mc;a.Mc=a.Sb;a.Sb=c;var d=null;0<b.changedTouches.length?d=b.changedTouches[0]:0<b.targetTouches.length&&(d=b.targetTouches[0]);xj(a,b,d,c,1<b.touches.length);(a.Wa.isBeyondDragSize()||1<b.touches.length)&&Ff(a);a.Dx(d?d:b,null,c.Zf)||(a.doMouseMove(),yj(a,c,b))}};a.LG=function(b){if(a.isEnabled){Ff(a);
  if(a.Vv)return b.preventDefault(),!1;var c=a.Mc;a.Mc=a.Sb;a.Sb=c;if(1<b.touches.length)a.Vn&&(a.Ky=!1);else{var d=null,e=null;0<b.changedTouches.length?e=b.changedTouches[0]:0<b.targetTouches.length&&(e=b.targetTouches[0]);c.h=a;c.Je=1;if(null!==e){var d=window.document.elementFromPoint(e.clientX,e.clientY),g,p;d&&d.Y?(p=e,g=d.Y):(p=b.changedTouches[0],g=a);vj(g,p,c);g=e.screenX;p=e.screenY;var q=a.GC;b.timeStamp-a.dm<a.ED&&!(25<Math.abs(q.x-g)||25<Math.abs(q.y-p))?a.cm++:a.cm=1;c.Je=a.cm;a.dm=b.timeStamp;
  a.GC.o(g,p)}c.Zc=0;c.button=0;c.ak=!1;c.up=!0;c.Yj=0;c.Oc=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.Zf=null===d?b.target.Y:d.Y?d.Y:null;c.ie=null;a.zG(e?e:b,null,new x,c.Zf)||(a.doMouseUp(),yj(a,c,b),a.Uy=!1)}}};a.EJ=function(b){if("touch"===b.pointerType){var c=a.aD;void 0===c[b.pointerId]&&(a.Xr++,c[b.pointerId]=b);a.Lf[0]=null;a.Lf[1]=null;for(var d in c)if(null===a.Lf[0])a.Lf[0]=c[d];else if(null===a.Lf[1]){a.Lf[1]=c[d];break}a.isEnabled&&(a.Vv=!1,c=a.Mc,a.Mc=a.Sb,a.Sb=c,wj(a,b,b,c,1<
  a.Xr),a.doMouseDown(),2>a.Xr&&tj(a,c),yj(a,c,b))}};a.GJ=function(b){if("touch"===b.pointerType&&!(2>a.Xr)){var c=a.Lf;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Mc,a.Mc=a.Sb,a.Sb=c,xj(a,b,b,c,!0),Ff(a),a.Dx(b,null,c.Zf)||(a.doMouseMove(),yj(a,c,b)))}};a.FJ=function(b){if("touch"===b.pointerType){var c=a.aD;void 0!==c[b.pointerId]&&(a.Xr--,delete c[b.pointerId],c=a.Lf,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===
  b.pointerId&&(c[1]=null))}};gj(a);fj(a)}function Yk(a){1<arguments.length&&w.m("Palette constructor can only take one optional argument, the DIV HTML element or its id.");C.call(this,a);this.Vs=!0;this.Gi=!1;this.hb=!0;this.sw=Cb;this.Lb=new Zk}w.Ia(Yk,C);w.ja("Palette",Yk);
  function Zi(a){1<arguments.length&&w.m("Overview constructor can only take one optional argument, the DIV HTML element or its id.");C.call(this,a);this.bi.isEnabled=!1;this.yc=!0;this.Bj=null;this.oH=this.Ru=!0;this.SJ("drawShadows",!1);var b=new H,c=new W;c.stroke="magenta";c.ib=2;c.fill="transparent";c.name="BOXSHAPE";b.ik=!0;b.xx="BOXSHAPE";b.kx="BOXSHAPE";b.ZA="BOXSHAPE";b.cursor="move";b.add(c);this.Ol=b;c=new tf;c.type=wh;c.Pe=Ob;var d=new xh;d.Tf=!0;c.add(d);d=new W;d.Fi=Ob;d.Bb="Rectangle";
  d.ya=new fa(64,64);d.cursor="se-resize";d.alignment=Wb;c.add(d);b.YA=c;this.Rj=this.Oh=!1;this.Ee=this.Dm=!0;this.vz=w.createElement("canvas");this.zH=this.vz.getContext("2d");this.tb.ud=new $k;this.tb.$A=new al;var e=this;this.click=function(){var a=e.Bj;if(null!==a){var b=a.ub,c=e.P.ga;a.position=new x(c.x-b.width/2,c.y-b.height/2)}};this.PF=function(){bl(e)};this.OF=function(){null!==e.Bj&&(e.oc(),e.pa())};this.Fm=rj;this.yc=!1}w.Ia(Zi,C);w.ja("Overview",Zi);
  function cl(a){a.yc||a.Bd||!1!==a.Mf||(a.Mf=!0,requestAnimationFrame(function(){if(a.Mf&&!a.Bd&&(a.Mf=!1,null!==a.Nb)){a.Bd=!0;lj(a);a.Hd.J()||qj(a,a.tg());null===a.Nb&&w.m("No div specified");null===a.mb&&w.m("No canvas specified");if(a.Sd){var b=a.Bj;if(null!==b&&!b.Pb.fh&&!b.Pb.pd){var b=a.Sg,c=a.vz;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.mb.width,a.mb.height);b.drawImage(c,0,0);c=a.Yd;c.reset();1!==a.ec&&c.scale(a.scale);0===a.position.x&&0===a.position.y||c.translate(-a.Oa.x,-a.Oa.y);b.setTransform(c.m11,
  c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.dc.q,d=c.length,e=0;e<d;e++)c[e].bf(b,a);a.Mk=!1;a.Sd=!1}}a.Bd=!1}}))}Zi.prototype.computePixelRatio=function(){return 1};
  Zi.prototype.bf=function(){null===this.Nb&&w.m("No div specified");null===this.mb&&w.m("No canvas specified");if(this.Sd){var a=this.Bj;if(null!==a&&!a.Pb.fh&&!a.Pb.pd){if(!this.oH){var b=a.tb.ud;if(null!==b&&b.qa)return}b=a.dp;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&Bj(a);var c=this.mb,b=this.Sg,d=this.vz,e=this.zH;d.width=c.width;d.height=c.height;b.nu="";b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,this.mb.width,this.mb.height);var g=this.Yd;g.reset();1!==this.ec&&g.scale(this.scale);
  0===this.position.x&&0===this.position.y||g.translate(-this.Oa.x,-this.Oa.y);b.setTransform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);for(var g=this.Ru,h=this.ub,k=a.dc.q,l=k.length,a=0;a<l;a++){var m=k[a],n=b,p=h,q=g;void 0===q&&(q=!0);if(q||!m.Ac)for(var q=this.scale,m=m.Hb.q,r=m.length,s=0;s<r;s++){var u=m[s],v=u.ea;v.zg(p)&&(1<v.width*q||1<v.height*q?u.bf(n,this):Qi(u,n))}}e.drawImage(c.Jd,0,0);t&&t.Rz&&(e.fillStyle="red",e.fillRect(0,d.height/2,d.width,4));c=this.dc.q;d=c.length;for(a=0;a<d;a++)c[a].bf(b,
  this);this.Sd=this.Mk=!1}}};w.g(Zi,"observed",Zi.prototype.nx);
  w.defineProperty(Zi,{nx:"observed"},function(){return this.Bj},function(a){var b=this.Bj;null!==a&&w.l(a,C,Zi,"observed");a instanceof Zi&&w.m("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.Of),b.XF("ViewportBoundsChanged",this.PF),b.XF("DocumentBoundsChanged",this.OF),b.jm.remove(this)),this.Bj=a,null!==a&&(a.Iz("ViewportBoundsChanged",this.PF),a.Iz("DocumentBoundsChanged",this.OF),a.jm.add(this),this.add(this.Of),bl(this)),this.oc(),this.j("observed",
  b,a))});w.g(Zi,"box",Zi.prototype.Of);w.defineProperty(Zi,{Of:"box"},function(){return this.Ol},function(a){var b=this.Ol;b!==a&&(this.Ol=a,this.remove(b),this.add(this.Ol),bl(this),this.j("box",b,a))});w.g(Zi,"drawsTemporaryLayers",Zi.prototype.GI);w.defineProperty(Zi,{GI:"drawsTemporaryLayers"},function(){return this.Ru},function(a){this.Ru!==a&&(this.Ru=a,this.RA())});
  function bl(a){var b=a.Of;if(null!==b){var c=a.Bj;if(null!==c){a.Sd=!0;var c=c.ub,d=b.$t,e=w.Hl();e.o(c.width,c.height);d.ya=e;w.dk(e);a=2/a.scale;d instanceof W&&(d.ib=a);b.location=new x(c.x-a/2,c.y-a/2)}}}Zi.prototype.tg=function(){var a=this.Bj;return null===a?J.hH:a.Hd};Zi.prototype.mA=function(){!0!==this.Sd&&(this.Sd=!0,cl(this))};Zi.prototype.Nt=function(a){this.yc||(jj(this),this.pa(),zj(this),this.oc(),bl(this),this.Ba("ViewportBoundsChanged",null,a))};
  function $k(){Bf.call(this);this.Uk=null}w.Ia($k,Bf);$k.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.Gi||!a.Ee)return!1;var b=a.nx;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.ub;this.Uk=new x(c.width/2,c.height/2);a=a.xc.ga;b.position=new x(a.x-this.Uk.x,a.y-this.Uk.y)}return!0};$k.prototype.doActivate=function(){this.Uk=null;Bf.prototype.doActivate.call(this)};
  $k.prototype.moveParts=function(){var a=this.h,b=a.nx;if(null!==b){var c=a.Of;if(null!==c){if(null===this.Uk){var d=a.xc.ga,c=c.location;this.Uk=new x(d.x-c.x,d.y-c.y)}a=a.P.ga;b.position=new x(a.x-this.Uk.x,a.y-this.Uk.y)}}};function al(){uh.call(this)}w.Ia(al,uh);al.prototype.resize=function(a){var b=this.h.nx;if(null!==b){var c=b.ub.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 ea(a){1<arguments.length&&w.m("Brush constructor can take at most one optional argument, the Brush type.");w.jc(this);this.Qa=!1;void 0===a?(this.ha=Ae,this.An="black"):"string"===typeof a?(this.ha=Ae,t&&!da(a)&&w.m('Color "'+a+'" is not a valid color string for Brush constructor'),this.An=a):(t&&w.za(a,ea,ea,"constructor:type"),this.ha=a,this.An="black");var b=this.ha;b===Be?(this.vo=Cb,this.Pn=Vb):this.Pn=b===Ce?this.vo=Ob:this.vo=yb;this.Sv=0;this.Su=NaN;this.Rg=this.Gv=this.Qg=null;this.jy=
  this.ky=0}w.ja("Brush",ea);var Ae;ea.Solid=Ae=w.w(ea,"Solid",0);var Be;ea.Linear=Be=w.w(ea,"Linear",1);var Ce;ea.Radial=Ce=w.w(ea,"Radial",2);var dl;ea.Pattern=dl=w.w(ea,"Pattern",4);ea.prototype.copy=function(){var a=new ea;a.ha=this.ha;a.An=this.An;a.vo=this.vo.ba();a.Pn=this.Pn.ba();a.Sv=this.Sv;a.Su=this.Su;null!==this.Qg&&(a.Qg=this.Qg.copy());a.Gv=this.Gv;return a};ea.prototype.Ma=function(){this.freeze();Object.freeze(this);return this};
  ea.prototype.freeze=function(){this.Qa=!0;null!==this.Qg&&this.Qg.freeze();return this};ea.prototype.Na=function(){Object.isFrozen(this)&&w.m("cannot thaw constant: "+this);this.Qa=!1;null!==this.Qg&&this.Qg.Na();return this};
  ea.prototype.toString=function(){var a="Brush(";if(this.type===Ae)a+=this.color;else if(a=this.type===Be?a+"Linear ":this.type===Ce?a+"Radial ":this.type===dl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.No)for(var b=this.No.k;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
  ea.prototype.addColorStop=ea.prototype.addColorStop=function(a,b){w.N(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&w.la(a,"0 <= loc <= 1",ea,"addColorStop:loc");w.i(b,"string",ea,"addColorStop:color");t&&!da(b)&&w.m('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.Qg&&(this.Qg=new ia("number","string"));this.Qg.add(a,b);this.ha===Ae&&(this.type=Be);this.Rg=null};w.g(ea,"type",ea.prototype.type);
  w.defineProperty(ea,{type:"type"},function(){return this.ha},function(a){w.N(this,a);w.za(a,ea,ea,"type");this.ha=a;this.start.ue()&&(a===Be?this.start=Cb:a===Ce&&(this.start=Ob));this.end.ue()&&(a===Be?this.end=Vb:a===Ce&&(this.end=Ob));this.Rg=null});w.g(ea,"color",ea.prototype.color);w.defineProperty(ea,{color:"color"},function(){return this.An},function(a){w.N(this,a);t&&!da(a)&&w.m('Color "'+a+'" is not a valid color string for Brush.color');this.An=a;this.Rg=null});w.g(ea,"start",ea.prototype.start);
  w.defineProperty(ea,{start:"start"},function(){return this.vo},function(a){w.N(this,a);w.l(a,K,ea,"start");this.vo=a.ba();this.Rg=null});w.g(ea,"end",ea.prototype.end);w.defineProperty(ea,{end:"end"},function(){return this.Pn},function(a){w.N(this,a);w.l(a,K,ea,"end");this.Pn=a.ba();this.Rg=null});w.g(ea,"startRadius",ea.prototype.Tp);
  w.defineProperty(ea,{Tp:"startRadius"},function(){return this.Sv},function(a){w.N(this,a);w.p(a,ea,"startRadius");0>a&&w.la(a,">= zero",ea,"startRadius");this.Sv=a;this.Rg=null});w.g(ea,"endRadius",ea.prototype.To);w.defineProperty(ea,{To:"endRadius"},function(){return this.Su},function(a){w.N(this,a);w.p(a,ea,"endRadius");0>a&&w.la(a,">= zero",ea,"endRadius");this.Su=a;this.Rg=null});w.g(ea,"colorStops",ea.prototype.No);
  w.defineProperty(ea,{No:"colorStops"},function(){return this.Qg},function(a){w.N(this,a);t&&w.l(a,ia,ea,"colorStops");this.Qg=a;this.Rg=null});w.g(ea,"pattern",ea.prototype.pattern);w.defineProperty(ea,{pattern:"pattern"},function(){return this.Gv},function(a){w.N(this,a);this.Gv=a;this.Rg=null});
  ea.randomColor=function(a,b){void 0===a&&(a=128);t&&(w.p(a,ea,"randomColor:min"),(0>a||255<a)&&w.la(a,"0 <= min <= 255",ea,"randomColor:min"));void 0===b&&(b=Math.max(a,255));t&&(w.p(b,ea,"randomColor:max"),(b<a||255<b)&&w.la(b,"min <= max <= 255",ea,"randomColor:max"));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 el=w.createElement("canvas").getContext("2d"),da;ea.isValidColor=da=function(a){if("black"===a)return!0;if(""===a)return!1;t&&w.i(a,"string",ea,"isValidColor");el.fillStyle="#000000";var b=el.fillStyle;el.fillStyle=a;if(el.fillStyle!==b)return!0;el.fillStyle="#FFFFFF";b=el.fillStyle;el.fillStyle=a;return el.fillStyle!==b};
  function P(){w.jc(this);this.ia=30723;this.Kf=1;this.ah=null;this.Xb="";this.tc=this.Mb=null;this.Oa=(new x(NaN,NaN)).freeze();this.pf=(new fa(NaN,NaN)).freeze();this.xj=J.on;this.vj=J.DB;this.Yd=new ga;this.un=new ga;this.Qk=new ga;this.ec=this.Pu=1;this.vn=0;this.Kh=fl;this.tr=J.aq;this.Uc=(new y(NaN,NaN,NaN,NaN)).freeze();this.bc=(new y(NaN,NaN,NaN,NaN)).freeze();this.Lc=(new y(0,0,NaN,NaN)).freeze();this.Hs=this.Hq=this.S=this.Yr=this.Zr=null;this.Is=this.Iq=Infinity;this.gq=this.ye=zc;this.ms=
  0;this.Dj=1;this.nq=0;this.fj=1;this.qs=-Infinity;this.ps=0;this.rs=J.nk;this.ss=jh;this.uq="";this.Kc=this.R=null;this.xn=-1;this.lm=this.ei=this.Ql=this.uo=null}w.Ph(P);w.ja("GraphObject",P);
  P.prototype.cloneProtected=function(a){a.ia=this.ia|6144;a.Kf=this.Kf;a.Xb=this.Xb;a.Mb=this.Mb;a.tc=this.tc;a.Oa.assign(this.Oa);a.pf.assign(this.pf);a.xj=this.xj.ba();a.vj=this.vj.ba();a.Qk=this.Qk.copy();a.ec=this.ec;a.vn=this.vn;a.Kh=this.Kh;a.tr=this.tr.ba();a.Uc.assign(this.Uc);a.bc.assign(this.bc);a.Lc.assign(this.Lc);a.Yr=this.Yr;a.S=null!==this.S?this.S.copy():null;a.Hq=this.Hq;a.Iq=this.Iq;a.Hs=this.Hs;a.Is=this.Is;a.ye=this.ye.ba();a.gq=this.gq.ba();a.ms=this.ms;a.Dj=this.Dj;a.nq=this.nq;
  a.fj=this.fj;a.qs=this.qs;a.ps=this.ps;a.rs=this.rs.ba();a.ss=this.ss;a.uq=this.uq;a.R=null!==this.R?this.R.copy():null;a.Kc=this.Kc;a.xn=this.xn;if(null!==this.Ql){a.Ql=w.il(this.Ql);for(var b=0;b<this.Ql.length;b++){var c=this.Ql[b];a[c]=this[c]}}null!==this.ei&&(a.ei=this.ei.copy())};P.prototype.Qh=function(a){a.Zr=null;a.lm=null;a.T()};P.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);return a};P.prototype.copy=function(){return this.clone()};
  P.prototype.toString=function(){return w.yg(Object.getPrototypeOf(this))+"#"+w.Yc(this)};var yh;P.None=yh=w.w(P,"None",0);var fl;P.Default=fl=w.w(P,"Default",0);var gl;P.Vertical=gl=w.w(P,"Vertical",4);var hl;P.Horizontal=hl=w.w(P,"Horizontal",5);var hd;P.Fill=hd=w.w(P,"Fill",3);var Jh;P.Uniform=Jh=w.w(P,"Uniform",1);var Kh;P.UniformToFill=Kh=w.w(P,"UniformToFill",2);function il(a){a.R=new jl}
  P.prototype.Oe=function(){var a=new kl;a.mj=yb;a.Nj=yb;a.kj=10;a.Lj=10;a.jj=ll;a.Kj=ll;a.lj=0;a.Mj=0;this.S=a};function ml(a,b,c,d,e,g,h){var k=.001,l=g.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=g[n++%l];for(k-=h;0>k;)k+=g[n++%l],p=!p;q=!1}else k=g[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}}
  P.prototype.raiseChangedEvent=P.prototype.Hc=function(a,b,c,d,e,g,h){var k=this.V;null!==k&&(k.fn(a,b,c,d,e,g,h),0!==(this.ia&1024)&&c===this&&a===fe&&nl(this,k,b))};
  function nl(a,b,c){var d=a.Xo();if(null!==d)for(var e=a.Kc.k;e.next();){var g=e.value,h=null;if(null!==g.El){h=nf(g,d,a);if(null===h)continue;g.Jx(a,h,c,null)}else if(g.Xp){var k=b.h;null!==k&&g.Jx(a,k.fa.yp,c,k)}else{var l=d.data;if(null===l)continue;k=b.h;null!==k&&k.du||g.Jx(a,l,c,k)}null!==h&&(k=d.Hw(g.kk),null!==k&&g.XG(k,h,c))}}P.prototype.Hw=function(a){return this.xn===a?this:null};P.prototype.raiseChanged=P.prototype.j=function(a,b,c){this.Hc(fe,a,this,b,c)};
  function ol(a,b,c,d,e){var g=a.Uc,h=a.Qk;h.reset();pl(a,h,b,c,d,e);a.Qk=h;g.x=b;g.y=c;g.width=d;g.height=e;h.zt()||h.RG(g)}function ql(a,b,c,d){if(!1===a.Cf)return!1;d.multiply(a.transform);return c?a.zg(b,d):a.Lm(b,d)}
  P.prototype.IE=function(a,b,c){if(!1===this.Cf)return!1;var d=this.Ka;b=a.Zj(b);var e=!1;c&&(e=Ya(a.x,a.y,0,0,0,d.height)<b||Ya(a.x,a.y,0,d.height,d.width,d.height)<b||Ya(a.x,a.y,d.width,d.height,d.width,0)<b||Ya(a.x,a.y,d.width,0,0,0)<b);c||(e=Ya(a.x,a.y,0,0,0,d.height)<b&&Ya(a.x,a.y,0,d.height,d.width,d.height)<b&&Ya(a.x,a.y,d.width,d.height,d.width,0)<b&&Ya(a.x,a.y,d.width,0,0,0)<b);return e};P.prototype.bg=function(){return!0};
  P.prototype.containsPoint=P.prototype.Ea=function(a){t&&w.l(a,x,P,"containsPoint:p");var b=w.M();b.assign(a);this.transform.fb(b);var c=this.ea;if(!c.J())return!1;var d=this.h;if(null!==d&&d.Uy){var e=d.fA("extraTouchThreshold"),g=d.fA("extraTouchArea"),h=g/2,k=this.Ka,d=this.Qi()*d.scale,l=1/d;if(k.width*d<e&&k.height*d<e)return a=ob(c.x-h*l,c.y-h*l,c.width+g*l,c.height+g*l,b.x,b.y),w.B(b),a}if(this instanceof tf||this instanceof W?ob(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Ea(b)){if(this.ei&&
  !this.ei.Ea(b))return!1;if(null!==this.tc&&c.Ea(b)||null!==this.Mb&&this.Lc.Ea(a))return!0;w.B(b);return this.Uj(a)}w.B(b);return!1};P.prototype.Uj=function(a){var b=this.Ka;return ob(0,0,b.width,b.height,a.x,a.y)};
  P.prototype.containsRect=P.prototype.Vj=function(a){t&&w.l(a,y,P,"containsRect:r");if(0===this.angle)return this.ea.Vj(a);var b=this.Ka,b=w.lk(0,0,b.width,b.height),c=this.transform,d=!1,e=w.ic(a.x,a.y);b.Ea(c.Th(e))&&(e.o(a.x,a.bottom),b.Ea(c.Th(e))&&(e.o(a.right,a.bottom),b.Ea(c.Th(e))&&(e.o(a.right,a.y),b.Ea(c.Th(e))&&(d=!0))));w.B(e);w.nc(b);return d};
  P.prototype.containedInRect=P.prototype.Lm=function(a,b){t&&w.l(a,y,P,"containedInRect:r");if(void 0===b)return a.Vj(this.ea);var c=this.Ka,d=!1,e=w.ic(0,0);a.Ea(b.fb(e))&&(e.o(0,c.height),a.Ea(b.fb(e))&&(e.o(c.width,c.height),a.Ea(b.fb(e))&&(e.o(c.width,0),a.Ea(b.fb(e))&&(d=!0))));return d};
  P.prototype.intersectsRect=P.prototype.zg=function(a,b){t&&w.l(a,y,P,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.zg(this.ea);var c=this.Ka,d=b,e=w.ic(0,0),g=w.ic(0,c.height),h=w.ic(c.width,c.height),k=w.ic(c.width,0),l=!1;if(a.Ea(d.fb(e))||a.Ea(d.fb(g))||a.Ea(d.fb(h))||a.Ea(d.fb(k)))l=!0;else{var c=w.lk(0,0,c.width,c.height),m=w.ic(a.x,a.y);c.Ea(d.Th(m))?l=!0:(m.o(a.x,a.bottom),c.Ea(d.Th(m))?l=!0:(m.o(a.right,a.bottom),c.Ea(d.Th(m))?l=!0:(m.o(a.right,a.y),c.Ea(d.Th(m))&&
  (l=!0))));w.B(m);w.nc(c);!l&&(J.Tw(a,e,g)||J.Tw(a,g,h)||J.Tw(a,h,k)||J.Tw(a,k,e))&&(l=!0)}w.B(e);w.B(g);w.B(h);w.B(k);return l};P.prototype.getDocumentPoint=P.prototype.qb=function(a,b){void 0===b&&(b=new x);a.ue()&&w.m("getDocumentPoint:s Spot must be real: "+a.toString());var c=this.Ka;b.o(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY);this.Nf.fb(b);return b};P.prototype.getDocumentAngle=P.prototype.ml=function(){var a=this.Nf,a=180/Math.PI*Math.atan2(a.m12,a.m11);0>a&&(a+=360);return a};
  P.prototype.getDocumentScale=P.prototype.Qi=function(){if(0!==(this.ia&4096)===!1)return this.Pu;var a=this.ec;return null!==this.U?a*this.U.Qi():a};P.prototype.getLocalPoint=P.prototype.PE=function(a,b){void 0===b&&(b=new x);b.assign(a);this.Nf.Th(b);return b};P.prototype.getNearestIntersectionPoint=P.prototype.pl=function(a,b,c){return this.cp(a.x,a.y,b.x,b.y,c)};f=P.prototype;
  f.cp=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.el)return g=this.ea,J.pl(g.left,g.top,g.right,g.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.o(0,0);d=this.Ka;c=J.pl(0,0,d.width,d.height,h,a,b,c,e);e.transform(g);return c};
  function Xh(a,b,c,d,e){if(!1!==Gj(a)){var g=a.margin,h=g.right+g.left,g=g.top+g.bottom;b=Math.max(b-h,0);c=Math.max(c-g,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-g,0);var h=a.angle,g=0,g=a.ya,k=0;a.ib&&(k=a.ib);90===h||270===h?(b=isFinite(g.height)?g.height+k:b,c=isFinite(g.width)?g.width+k:c):(b=isFinite(g.width)?g.width+k:b,c=isFinite(g.height)?g.height+k:c);var g=d||0,k=e||0,l=a instanceof z;switch(rl(a,!0)){case yh:k=g=0;l&&(c=b=Infinity);break;case hd:isFinite(b)&&b>d&&(g=b);isFinite(c)&&
  c>e&&(k=c);break;case hl:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case gl:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.Pd,m=a.Re;g>l.width&&m.width<l.width&&(g=l.width);k>l.height&&m.height<l.height&&(k=l.height);d=Math.max(g/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)g=b,b=c,c=g,g=d,d=e,e=g;a.Uc.Na();a.wp(b,c,
  d,e);a.Uc.freeze();a.Uc.J()||w.m("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Uc.toString());sl(a,!1)}}
  f.Fc=function(a,b,c,d,e){this.Vg();var g=w.$f();g.assign(this.bc);this.bc.Na();if(!1===Hj(this)){var h=this.bc;h.x=a;h.y=b;h.width=c;h.height=d}else this.Hi(a,b,c,d);this.bc.freeze();this.ei=void 0===e?null:e;c=!1;void 0!==e?c=!0:null!==this.U&&(e=this.U.Lc,d=this.Ga,null!==this.el&&(d=this.bc),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 oa&&(a=this.Lc,this.qv>a.height||this.oj.Ze>a.width))&&(c=!0);this.ia=c?this.ia|256:this.ia&-257;this.bc.J()||
  w.m("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.bc.toString());this.px(g,this.bc);w.nc(g)};f.Hi=function(){};
  function tl(a,b,c,d,e){var g=a.ea;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.ya.J()){g=a.Uc;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=g.width+b;g=g.height+h;d+=b;e+=h;b=rl(a,!0);c===d&&g===e&&(b=yh);switch(b){case yh:if(c>d||g>e)sl(a,!0),Xh(a,c>d?d:c,g>e?e:g);break;case hd:sl(a,!0);Xh(a,d,e,0,0);break;case hl:sl(a,!0);Xh(a,d,g,0,0);break;case gl:sl(a,!0),Xh(a,c,e,0,0)}}}
  f.px=function(){ul(this,!1);var a=this.V;null!==a&&null!==a.h&&(a.rl(),this.Av(a),this.pa(),a=this.V,null!==a&&(a.$t!==this&&a.fG!==this&&a.iG!==this||vl(a,!0)))};f.Av=function(a){null!==this.wd&&vl(a,!0)};
  f.bf=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 Sc)a:{if(this.visible){var e=null,g=a.bx;if(this instanceof z&&(this.type===wl||this.type===xl))yl(this,a,b);else{var h=this.bc;if(0!==h.width&&0!==h.height&&!isNaN(h.x)&&!isNaN(h.y)){var k=this.transform,l=this.U;0!==(this.ia&4096)===!0&&zl(this);var m=0!==(this.ia&256),n=!1;this instanceof oa&&Al(this,a);if(m){n=l.bg()?l.Ka:l.ea;if(this.ei)var p=this.ei,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 H&&(q=!0,!this.Ja()))break a;r=!1;s=b.Fh;this.V&&s.drawShadows&&(r=this.V.Ti);a.Oi.jf=[1,0,0,1,0,0];null!==this.tc&&(Bl(this,a,this.tc,!0,!0),this.tc instanceof ea&&this.tc.type===Ce?(a.beginPath(),
  a.rect(h.x,h.y,h.width,h.height),Cl(a,this.tc)):a.fillRect(h.x,h.y,h.width,h.height));q&&this.Ti&&s.drawShadows&&(Uc(a,1,0,0,1,0,0),h=this.um,a.shadowOffsetX=h.x,a.shadowOffsetY=h.y,a.shadowColor=this.tm,a.shadowBlur=this.sm/b.scale,a.eb());this instanceof z?Uc(a,k.m11,k.m12,k.m21,k.m22,k.dx,k.dy):a.Oi.jf=[k.m11,k.m12,k.m21,k.m22,k.dx,k.dy];if(null!==this.Mb){var p=this.Ka,h=k=0,s=p.width,p=p.height,u=0;this instanceof W&&(p=this.Ta.kb,k=p.x,h=p.y,s=p.width,p=p.height,u=this.dh);Bl(this,a,this.Mb,
  !0,!1);this.Mb instanceof ea&&this.Mb.type===Ce?(a.beginPath(),a.rect(k-u/2,h-u/2,s+u,p+u),Cl(a,this.Mb)):a.fillRect(k-u/2,h-u/2,s+u,p+u)}s=h=k=0;r&&(null!==this.Mb||null!==this.tc||null!==l&&0!==(l.ia&512)||null!==l&&l.type===ej&&l.Qf()!==this)?(Dl(this,!0),k=a.shadowOffsetX,h=a.shadowOffsetY,s=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0):Dl(this,!1);this.bk(a,b);r&&0!==(this.ia&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.xf.pop(),gj(b,a));this instanceof z&&(e=a.xf.pop());q&&r&&a.xf.pop();null!==a.EE&&(null===e&&(g===a.bx?(Uc(a,1,0,0,1,0,0),e=a.xf.pop()):e=a.bx),a.EE(this,e))}}}}else{if(this instanceof z&&(this.type===wl||this.type===xl)){yl(this,a,b);1!==c&&(a.globalAlpha=d);return}q=this.bc;if(0!==q.width&&0!==q.height&&!isNaN(q.x)&&!isNaN(q.y)){e=this.transform;g=this.U;0!==(this.ia&4096)===!0&&zl(this);l=0!==(this.ia&256);this instanceof oa&&Al(this,a);if(l){t&&t.FI&&w.trace("clip"+
  this.toString());m=g.bg()?g.Ka:g.ea;this.ei?(h=this.ei,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.Fh;m=!1;if(this instanceof H){m=!0;if(!this.Ja()){1!==c&&(a.globalAlpha=d);return}this.Ti&&r.drawShadows&&(n=this.um,a.shadowOffsetX=n.x*b.scale*b.tf,a.shadowOffsetY=
  n.y*b.scale*b.tf,a.shadowColor=this.tm,a.shadowBlur=this.sm)}n=!1;this.V&&r.drawShadows&&(n=this.V.Ti);null!==this.tc&&(Bl(this,a,this.tc,!0,!0),this.tc instanceof ea&&this.tc.type===Ce?(a.beginPath(),a.rect(q.x,q.y,q.width,q.height),Cl(a,this.tc)):a.fillRect(q.x,q.y,q.width,q.height));e.zt()||a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);null!==this.Mb&&(h=this.Ka,r=q=0,k=h.width,h=h.height,s=0,this instanceof W&&(h=this.Ta.kb,q=h.x,r=h.y,k=h.width,h=h.height,s=this.dh),Bl(this,a,this.Mb,!0,!1),
  this.Mb instanceof ea&&this.Mb.type===Ce?(a.beginPath(),a.rect(q-s/2,r-s/2,k+s,h+s),Cl(a,this.Mb)):a.fillRect(q-s/2,r-s/2,k+s,h+s));k=r=q=0;n&&(null!==this.Mb||null!==this.tc||null!==g&&0!==(g.ia&512)||null!==g&&(g.type===ej||g.type===wh)&&g.Qf()!==this)?(Dl(this,!0),q=a.shadowOffsetX,r=a.shadowOffsetY,k=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0):Dl(this,!1);this.bk(a,b);n&&0!==(this.ia&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 z?gj(b,a,!0):gj(b,a,!1)):e.zt()||(g=1/(e.m11*e.m22-e.m12*e.m21),a.transform(e.m22*g,-e.m12*g,-e.m21*g,e.m11*g,g*(e.m21*e.dy-e.m22*e.dx),g*(e.m12*e.dx-e.m11*e.dy)))}}1!==c&&(a.globalAlpha=d)}};
  function yl(a,b,c){var d=a.bc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.tc&&(Bl(a,b,a.tc,!0,!0),a.tc instanceof ea&&a.tc.type===Ce?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),Cl(b,a.tc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Mb&&(Bl(a,b,a.Mb,!0,!1),a.Mb instanceof ea&&a.Mb.type===Ce?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),Cl(b,a.Mb)):b.fillRect(d.x,d.y,d.width,d.height)),a.bk(b,c))}f.bk=function(){};
  function Cl(a,b){if(b instanceof ea&&b.type===Ce&&!(a instanceof Sc)){var c=b.ky,d=b.jy;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.ou?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.ou?a.clip():a.fill()}function El(a){a.ou||a.stroke()}
  function Bl(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.pn!==c&&(b.fillStyle=c,b.pn=c):b.qn!==c&&(b.strokeStyle=c,b.qn=c);else if(c.type===Ae)c=c.color,d?b.pn!==c&&(b.fillStyle=c,b.pn=c):b.qn!==c&&(b.strokeStyle=c,b.qn=c);else{var k,h=a.Ka,g=h.width,h=h.height;if(e)var l=a.ea,g=l.width,h=l.height;var m=b instanceof CanvasRenderingContext2D;if(m&&(c.Rg&&c.type===dl||c.ky===g&&c.jy===h))k=c.Rg;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.ea,g=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*
  g+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*g+c.end.offsetX;q=c.end.y*h+c.end.offsetY;l+=r;p+=r;n+=s;q+=s;c.type===Be?k=b.createLinearGradient(l,n,p,q):c.type===Ce?(s=isNaN(c.To)?Math.max(g,h)/2:c.To,isNaN(c.Tp)?(r=0,s=Math.max(g,h)/2):r=c.Tp,k=b.createRadialGradient(l,n,r,p,q,s)):c.type===dl?k=b.createPattern(c.pattern,"repeat"):w.sc(c.type,"Brush type");if(c.type!==dl&&(a=c.No,null!==a))for(a=a.k;a.next();)k.addColorStop(a.key,a.value);m&&(c.Rg=k,c.ky=g,c.jy=h)}d?b.pn!==k&&(b.fillStyle=
  k,b.pn=k):b.qn!==k&&(b.strokeStyle=k,b.qn=k)}}}P.prototype.isContainedBy=P.prototype.sl=function(a){if(a instanceof z)a:{if(this!==a&&null!==a)for(var b=this.U;null!==b;){if(b===a){a=!0;break a}b=b.U}a=!1}else a=!1;return a};P.prototype.isVisibleObject=P.prototype.vl=function(){if(!this.visible)return!1;var a=this.U;return null!==a?a.vl():!0};
  function zl(a){if(0!==(a.ia&2048)===!0){var b=a.Yd;b.reset();if(!a.bc.J()||!a.Uc.J()){Fl(a,!1);return}b.translate(a.bc.x,a.bc.y);b.translate(-a.Ga.x,-a.Ga.y);var c=a.Ka;pl(a,b,c.x,c.y,c.width,c.height);Fl(a,!1);Gl(a,!0)}0!==(a.ia&4096)===!0&&(b=a.U,null===b?(a.un.set(a.Yd),a.Pu=a.scale,Gl(a,!1)):null!==b.Nf&&(c=a.un,c.reset(),b.bg()?c.multiply(b.un):null!==b.U&&c.multiply(b.U.un),c.multiply(a.Yd),a.Pu=a.scale*b.Pu,Gl(a,!1)))}
  function pl(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Ob;a.Pe&&a.Pe.kd()&&(h=a.Pe);var k=w.M();if(a instanceof H&&a.hc!==a)for(c=a.hc,d=c.Ka,k.cu(d.x,d.y,d.width,d.height,h),c.Qk.fb(k),k.offset(-c.Ga.x,-c.Ga.y),h=c.U;null!==h&&h!==a;)h.Qk.fb(k),k.offset(-h.Ga.x,-h.Ga.y),h=h.U;else k.cu(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);w.B(k)}}f=P.prototype;
  f.T=function(a){void 0===a&&(a=!1);if(!0!==Gj(this)){sl(this,!0);ul(this,!0);var b=this.U;null!==b?a||b.T():(a=this.h,null!==a&&(a.fg.add(this),this instanceof S&&(a.ka.sb||this.yf(),null!==this.Md&&Hl(this.Md)),a.Se()));if(this instanceof z){if(this.ha===ej||this.ha===gh)a=this.Qf(),null!==a&&a.T(!0);a=this.Ca.q;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==Gj(d)&&(d.ya.J()||(d instanceof xh||d instanceof z||d instanceof oa||rl(d,!1)!==yh)&&d.T(!0))}}}};
  f.gp=function(){!1===Gj(this)&&(sl(this,!0),ul(this,!0))};function Hl(a){if(!1===Hj(a)){if(null!==a.U)a.U.T();else{var b=a.h;null!==b&&(b.fg.add(a),a instanceof S&&a.yf(),b.Se())}ul(a,!0)}}f.Vg=function(){0!==(this.ia&2048)===!1&&(Fl(this,!0),Gl(this,!0))};f.lA=function(){Gl(this,!0)};f.pa=function(){var a=this.V;null!==a&&a.pa()};
  function rl(a,b){var c=a.stretch,d=a.U;if(null!==d&&d.ha===Il)return Jl(a,d.jd(a.qc),d.hd(a.column),b);if(null!==d&&d.ha===ej&&d.Qf()===a)return Kl(a,hd,b);if(c===fl){if(null!==d){if(d.ha===wh&&d.Qf()===a)return Kl(a,hd,b);c=d.td;return c===fl?Kl(a,yh,b):Kl(a,c,b)}return Kl(a,yh,b)}return Kl(a,c,b)}
  function Jl(a,b,c,d){var e=a.stretch;if(e!==fl)return Kl(a,e,d);var g=e=null;switch(b.stretch){case gl:g=!0;break;case hd:g=!0}switch(c.stretch){case hl:e=!0;break;case hd:e=!0}b=a.U.td;null===e&&(e=b===hl||b===hd);null===g&&(g=b===gl||b===hd);return!0===e&&!0===g?Kl(a,hd,d):!0===e?Kl(a,hl,d):!0===g?Kl(a,gl,d):Kl(a,yh,d)}
  function Kl(a,b,c){if(c)return b;if(b===yh)return yh;c=a.ya;if(c.J())return yh;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===hl)return yh;if(b===hd)return gl}else{if(b===gl)return yh;if(b===hd)return hl}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===gl)return yh;if(b===hd)return hl}else{if(b===hl)return yh;if(b===hd)return gl}return b}w.g(P,"segmentOrientation",P.prototype.Zt);
  w.defineProperty(P,{Zt:"segmentOrientation"},function(){return this.ss},function(a){var b=this.ss;b!==a&&(t&&w.za(a,U,P,"segmentOrientation"),this.ss=a,this.T(),this.j("segmentOrientation",b,a))});w.g(P,"segmentIndex",P.prototype.Df);w.defineProperty(P,{Df:"segmentIndex"},function(){return this.qs},function(a){t&&w.i(a,"number",P,"segmentIndex");a=Math.round(a);var b=this.qs;b!==a&&(this.qs=a,this.T(),this.j("segmentIndex",b,a))});w.g(P,"segmentFraction",P.prototype.Yt);
  w.defineProperty(P,{Yt:"segmentFraction"},function(){return this.ps},function(a){t&&w.i(a,"number",P,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.ps;b!==a&&(this.ps=a,this.T(),this.j("segmentFraction",b,a))});w.g(P,"segmentOffset",P.prototype.eB);w.defineProperty(P,{eB:"segmentOffset"},function(){return this.rs},function(a){var b=this.rs;b.L(a)||(t&&w.l(a,x,P,"segmentOffset"),this.rs=a=a.ba(),this.T(),this.j("segmentOffset",b,a))});w.g(P,"stretch",P.prototype.stretch);
  w.defineProperty(P,{stretch:"stretch"},function(){return this.Kh},function(a){var b=this.Kh;b!==a&&(t&&w.za(a,P,P,"stretch"),this.Kh=a,this.T(),this.j("stretch",b,a))});w.g(P,"name",P.prototype.name);w.defineProperty(P,{name:"name"},function(){return this.Xb},function(a){var b=this.Xb;b!==a&&(t&&w.i(a,"string",P,"name"),this.Xb=a,null!==this.V&&(this.V.Tk=null),this.j("name",b,a))});w.g(P,"opacity",P.prototype.opacity);
  w.defineProperty(P,{opacity:"opacity"},function(){return this.Kf},function(a){var b=this.Kf;b!==a&&(w.i(a,"number",P,"opacity"),(0>a||1<a)&&w.la(a,"0 <= value <= 1",P,"opacity"),this.Kf=a,this.j("opacity",b,a),a=this.h,b=this.V,null!==a&&null!==b&&a.pa(Si(b,b.ea)))});w.g(P,"visible",P.prototype.visible);
  w.defineProperty(P,{visible:"visible"},function(){return 0!==(this.ia&1)},function(a){var b=0!==(this.ia&1);b!==a&&(t&&w.i(a,"boolean",P,"visible"),this.ia^=1,this.j("visible",b,a),b=this.U,null!==b?b.T():this instanceof H&&(this.rl(),this.Qe(a)),this.pa(),Ll(this))});w.g(P,"pickable",P.prototype.Cf);w.defineProperty(P,{Cf:"pickable"},function(){return 0!==(this.ia&2)},function(a){var b=0!==(this.ia&2);b!==a&&(t&&w.i(a,"boolean",P,"pickable"),this.ia^=2,this.j("pickable",b,a))});
  w.g(P,"fromLinkableDuplicates",P.prototype.KE);w.defineProperty(P,{KE:"fromLinkableDuplicates"},function(){return 0!==(this.ia&4)},function(a){var b=0!==(this.ia&4);b!==a&&(t&&w.i(a,"boolean",P,"fromLinkableDuplicates"),this.ia^=4,this.j("fromLinkableDuplicates",b,a))});w.g(P,"fromLinkableSelfNode",P.prototype.LE);
  w.defineProperty(P,{LE:"fromLinkableSelfNode"},function(){return 0!==(this.ia&8)},function(a){var b=0!==(this.ia&8);b!==a&&(t&&w.i(a,"boolean",P,"fromLinkableSelfNode"),this.ia^=8,this.j("fromLinkableSelfNode",b,a))});w.g(P,"toLinkableDuplicates",P.prototype.IG);w.defineProperty(P,{IG:"toLinkableDuplicates"},function(){return 0!==(this.ia&16)},function(a){var b=0!==(this.ia&16);b!==a&&(t&&w.i(a,"boolean",P,"toLinkableDuplicates"),this.ia^=16,this.j("toLinkableDuplicates",b,a))});
  w.g(P,"toLinkableSelfNode",P.prototype.JG);w.defineProperty(P,{JG:"toLinkableSelfNode"},function(){return 0!==(this.ia&32)},function(a){var b=0!==(this.ia&32);b!==a&&(t&&w.i(a,"boolean",P,"toLinkableSelfNode"),this.ia^=32,this.j("toLinkableSelfNode",b,a))});w.g(P,"isPanelMain",P.prototype.Tf);w.defineProperty(P,{Tf:"isPanelMain"},function(){return 0!==(this.ia&64)},function(a){var b=0!==(this.ia&64);b!==a&&(t&&w.i(a,"boolean",P,"isPanelMain"),this.ia^=64,this.T(),this.j("isPanelMain",b,a))});
  w.g(P,"isActionable",P.prototype.Uw);w.defineProperty(P,{Uw:"isActionable"},function(){return 0!==(this.ia&128)},function(a){var b=0!==(this.ia&128);b!==a&&(t&&w.i(a,"boolean",P,"isActionable"),this.ia^=128,this.j("isActionable",b,a))});w.g(P,"areaBackground",P.prototype.el);
  w.defineProperty(P,{el:"areaBackground"},function(){return this.tc},function(a){var b=this.tc;b!==a&&(t&&null!==a&&w.at(a,"GraphObject.areaBackground"),a instanceof ea&&a.freeze(),this.tc=a,this.pa(),this.j("areaBackground",b,a))});w.g(P,"background",P.prototype.background);w.defineProperty(P,{background:"background"},function(){return this.Mb},function(a){var b=this.Mb;b!==a&&(t&&null!==a&&w.at(a,"GraphObject.background"),a instanceof ea&&a.freeze(),this.Mb=a,this.pa(),this.j("background",b,a))});
  function Dl(a,b){a.ia=b?a.ia|512:a.ia&-513}function Ml(a,b){a.ia=b?a.ia|1024:a.ia&-1025}function Fl(a,b){a.ia=b?a.ia|2048:a.ia&-2049}function Gl(a,b){a.ia=b?a.ia|4096:a.ia&-4097}function Gj(a){return 0!==(a.ia&8192)}function sl(a,b){a.ia=b?a.ia|8192:a.ia&-8193}function Hj(a){return 0!==(a.ia&16384)}function ul(a,b){a.ia=b?a.ia|16384:a.ia&-16385}w.A(P,{V:"part"},function(){if(this instanceof H)return this;if(this.lm)return this.lm;var a;for(a=this.U;a;){if(a instanceof H)return this.lm=a;a=a.U}return null});
  w.A(P,{U:"panel"},function(){return this.ah});P.prototype.Cl=function(a){this.ah=a};w.A(P,{layer:"layer"},function(){var a=this.V;return null!==a?a.layer:null});w.A(P,{h:"diagram"},function(){var a=this.V;return null!==a?a.h:null},{configurable:!0});w.g(P,"position",P.prototype.position);w.defineProperty(P,{position:"position"},function(){return this.Oa},function(a){var b=this.Oa;b.L(a)||(t&&w.l(a,x,P,"position"),a=a.ba(),this.jB(a,b)&&this.j("position",b,a))});
  P.prototype.jB=function(a){this.Oa=a;Hl(this);this.Vg();return!0};P.prototype.vG=function(a,b){this.Oa.o(a,b);Nl(this,!0);this.Vg()};w.A(P,{ea:"actualBounds"},function(){return this.bc});w.g(P,"scale",P.prototype.scale);w.defineProperty(P,{scale:"scale"},function(){return this.ec},function(a){var b=this.ec;b!==a&&(t&&w.p(a,P,"scale"),0>=a&&w.m("GraphObject.scale must be greater than zero"),this.ec=a,this.Vg(),this.T(),this.j("scale",b,a))});w.g(P,"angle",P.prototype.angle);
  w.defineProperty(P,{angle:"angle"},function(){return this.vn},function(a){var b=this.vn;b!==a&&(t&&w.p(a,P,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.vn=a,this.T(),this.Vg(),this.j("angle",b,a)))});w.g(P,"desiredSize",P.prototype.ya);
  w.defineProperty(P,{ya:"desiredSize"},function(){return this.pf},function(a){var b=this.pf;b.L(a)||(t&&w.l(a,fa,P,"desiredSize"),this.pf=a=a.ba(),this.T(),this instanceof W&&this.se(),this.j("desiredSize",b,a),a=this.V,null!==a&&0!==(this.ia&1024)&&(nl(this,a,"width"),nl(this,a,"height")))});w.g(P,"width",P.prototype.width);
  w.defineProperty(P,{width:"width"},function(){return this.pf.width},function(a){if(this.pf.width!==a){t&&w.i(a,"number",P,"width");var b=this.pf;this.pf=a=(new fa(a,this.pf.height)).freeze();this.T();this instanceof W&&this.se();this.j("desiredSize",b,a);b=this.V;null!==b&&0!==(this.ia&1024)&&nl(this,b,"width")}});w.g(P,"height",P.prototype.height);
  w.defineProperty(P,{height:"height"},function(){return this.pf.height},function(a){if(this.pf.height!==a){t&&w.i(a,"number",P,"height");var b=this.pf;this.pf=a=(new fa(this.pf.width,a)).freeze();this.T();this instanceof W&&this.se();this.j("desiredSize",b,a);b=this.V;null!==b&&0!==(this.ia&1024)&&nl(this,b,"height")}});w.g(P,"minSize",P.prototype.Re);
  w.defineProperty(P,{Re:"minSize"},function(){return this.xj},function(a){var b=this.xj;b.L(a)||(t&&w.l(a,fa,P,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.xj=a,this.T(),this.j("minSize",b,a))});w.g(P,"maxSize",P.prototype.Pd);
  w.defineProperty(P,{Pd:"maxSize"},function(){return this.vj},function(a){var b=this.vj;b.L(a)||(t&&w.l(a,fa,P,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.vj=a,this.T(),this.j("maxSize",b,a))});w.A(P,{Ga:"measuredBounds"},function(){return this.Uc});w.A(P,{Ka:"naturalBounds"},function(){return this.Lc},{configurable:!0});w.g(P,"margin",P.prototype.margin);
  w.defineProperty(P,{margin:"margin"},function(){return this.tr},function(a){"number"===typeof a?a=new eb(a):t&&w.l(a,eb,P,"margin");var b=this.tr;b.L(a)||(this.tr=a=a.ba(),this.T(),this.j("margin",b,a))});w.A(P,{transform:null},function(){0!==(this.ia&2048)===!0&&zl(this);return this.Yd});w.A(P,{Nf:null},function(){0!==(this.ia&4096)===!0&&zl(this);return this.un});w.g(P,"alignment",P.prototype.alignment);
  w.defineProperty(P,{alignment:"alignment"},function(){return this.ye},function(a){var b=this.ye;b.L(a)||(t?w.l(a,K,P,"alignment"):a.ue()&&!a.Pc()&&w.m("alignment must be a real Spot or Spot.Default"),this.ye=a=a.ba(),Hl(this),this.j("alignment",b,a))});w.g(P,"column",P.prototype.column);w.defineProperty(P,{column:"column"},function(){return this.nq},function(a){t&&w.p(a,P,"column");a=Math.round(a);var b=this.nq;b!==a&&(0>a&&w.la(a,">= 0",P,"column"),this.nq=a,this.T(),this.j("column",b,a))});
  w.g(P,"columnSpan",P.prototype.eE);w.defineProperty(P,{eE:"columnSpan"},function(){return this.fj},function(a){t&&w.i(a,"number",P,"columnSpan");a=Math.round(a);var b=this.fj;b!==a&&(1>a&&w.la(a,">= 1",P,"columnSpan"),this.fj=a,this.T(),this.j("columnSpan",b,a))});w.g(P,"row",P.prototype.qc);w.defineProperty(P,{qc:"row"},function(){return this.ms},function(a){t&&w.p(a,P,"row");a=Math.round(a);var b=this.ms;b!==a&&(0>a&&w.la(a,">= 0",P,"row"),this.ms=a,this.T(),this.j("row",b,a))});
  w.g(P,"rowSpan",P.prototype.rowSpan);w.defineProperty(P,{rowSpan:"rowSpan"},function(){return this.Dj},function(a){t&&w.i(a,"number",P,"rowSpan");a=Math.round(a);var b=this.Dj;b!==a&&(1>a&&w.la(a,">= 1",P,"rowSpan"),this.Dj=a,this.T(),this.j("rowSpan",b,a))});w.g(P,"alignmentFocus",P.prototype.Fi);
  w.defineProperty(P,{Fi:"alignmentFocus"},function(){return this.gq},function(a){var b=this.gq;b.L(a)||(t?w.l(a,K,P,"alignmentFocus"):a.ue()&&!a.Pc()&&w.m("alignmentFocus must be a real Spot or Spot.Default"),this.gq=a=a.ba(),this.T(),this.j("alignmentFocus",b,a))});w.g(P,"portId",P.prototype.wd);
  w.defineProperty(P,{wd:"portId"},function(){return this.Yr},function(a){var b=this.Yr;if(b!==a){t&&null!==a&&w.i(a,"string",P,"portId");var c=this.V;null===c||c instanceof S||(w.m("portID being set on a Link: "+a),c=null);null!==b&&null!==c&&Ol(c,this);this.Yr=a;if(null!==a&&c){c.yh=!0;null===c.Wd&&Pl(c);var d=this.wd;null!==d&&c.Wd.add(d,this)}this.j("portId",b,a)}});function Ql(a){var b={value:null};Rl(a,b);return b.value}
  function Rl(a,b){var c=a.U;return null===c||!Rl(c,b)&&a.visible?(b.value=a,!1):!0}function Ll(a){var b=a.V;b instanceof S&&(a=a.h,null===a||a.ka.sb||b.yf())}w.g(P,"toSpot",P.prototype.yb);w.defineProperty(P,{yb:"toSpot"},function(){return null!==this.S?this.S.Nj:yb},function(a){null===this.S&&this.Oe();var b=this.S.Nj;b.L(a)||(t&&w.l(a,K,P,"toSpot"),a=a.ba(),this.S.Nj=a,this.j("toSpot",b,a),Ll(this))});w.g(P,"toEndSegmentLength",P.prototype.mk);
  w.defineProperty(P,{mk:"toEndSegmentLength"},function(){return null!==this.S?this.S.Lj:10},function(a){null===this.S&&this.Oe();var b=this.S.Lj;b!==a&&(t&&w.i(a,"number",P,"toEndSegmentLength"),0>a&&w.la(a,">= 0",P,"toEndSegmentLength"),this.S.Lj=a,this.j("toEndSegmentLength",b,a),Ll(this))});w.g(P,"toEndSegmentDirection",P.prototype.Wp);
  w.defineProperty(P,{Wp:"toEndSegmentDirection"},function(){return null!==this.S?this.S.Kj:ll},function(a){null===this.S&&this.Oe();var b=this.S.Kj;b!==a&&(t&&w.za(a,S,P,"toEndSegmentDirection"),this.S.Kj=a,this.j("toEndSegmentDirection",b,a),Ll(this))});w.g(P,"toShortLength",P.prototype.Yp);
  w.defineProperty(P,{Yp:"toShortLength"},function(){return null!==this.S?this.S.Mj:0},function(a){null===this.S&&this.Oe();var b=this.S.Mj;b!==a&&(t&&w.i(a,"number",P,"toShortLength"),this.S.Mj=a,this.j("toShortLength",b,a),Ll(this))});w.g(P,"toLinkable",P.prototype.qB);w.defineProperty(P,{qB:"toLinkable"},function(){return this.Hs},function(a){var b=this.Hs;b!==a&&(t&&null!==a&&w.i(a,"boolean",P,"toLinkable"),this.Hs=a,this.j("toLinkable",b,a))});w.g(P,"toMaxLinks",P.prototype.KG);
  w.defineProperty(P,{KG:"toMaxLinks"},function(){return this.Is},function(a){var b=this.Is;b!==a&&(t&&w.i(a,"number",P,"toMaxLinks"),0>a&&w.la(a,">= 0",P,"toMaxLinks"),this.Is=a,this.j("toMaxLinks",b,a))});w.g(P,"fromSpot",P.prototype.wb);w.defineProperty(P,{wb:"fromSpot"},function(){return null!==this.S?this.S.mj:yb},function(a){null===this.S&&this.Oe();var b=this.S.mj;b.L(a)||(t&&w.l(a,K,P,"fromSpot"),a=a.ba(),this.S.mj=a,this.j("fromSpot",b,a),Ll(this))});w.g(P,"fromEndSegmentLength",P.prototype.ek);
  w.defineProperty(P,{ek:"fromEndSegmentLength"},function(){return null!==this.S?this.S.kj:10},function(a){null===this.S&&this.Oe();var b=this.S.kj;b!==a&&(t&&w.i(a,"number",P,"fromEndSegmentLength"),0>a&&w.la(a,">= 0",P,"fromEndSegmentLength"),this.S.kj=a,this.j("fromEndSegmentLength",b,a),Ll(this))});w.g(P,"fromEndSegmentDirection",P.prototype.$o);
  w.defineProperty(P,{$o:"fromEndSegmentDirection"},function(){return null!==this.S?this.S.jj:ll},function(a){null===this.S&&this.Oe();var b=this.S.jj;b!==a&&(t&&w.za(a,S,P,"fromEndSegmentDirection"),this.S.jj=a,this.j("fromEndSegmentDirection",b,a),Ll(this))});w.g(P,"fromShortLength",P.prototype.ap);
  w.defineProperty(P,{ap:"fromShortLength"},function(){return null!==this.S?this.S.lj:0},function(a){null===this.S&&this.Oe();var b=this.S.lj;b!==a&&(t&&w.i(a,"number",P,"fromShortLength"),this.S.lj=a,this.j("fromShortLength",b,a),Ll(this))});w.g(P,"fromLinkable",P.prototype.bA);w.defineProperty(P,{bA:"fromLinkable"},function(){return this.Hq},function(a){var b=this.Hq;b!==a&&(t&&null!==a&&w.i(a,"boolean",P,"fromLinkable"),this.Hq=a,this.j("fromLinkable",b,a))});w.g(P,"fromMaxLinks",P.prototype.ME);
  w.defineProperty(P,{ME:"fromMaxLinks"},function(){return this.Iq},function(a){var b=this.Iq;b!==a&&(t&&w.i(a,"number",P,"fromMaxLinks"),0>a&&w.la(a,">= 0",P,"fromMaxLinks"),this.Iq=a,this.j("fromMaxLinks",b,a))});w.g(P,"cursor",P.prototype.cursor);w.defineProperty(P,{cursor:"cursor"},function(){return this.uq},function(a){var b=this.uq;b!==a&&(w.i(a,"string",P,"cursor"),this.uq=a,this.j("cursor",b,a))});w.g(P,"click",P.prototype.click);
  w.defineProperty(P,{click:"click"},function(){return null!==this.R?this.R.di:null},function(a){null===this.R&&il(this);var b=this.R.di;b!==a&&(null!==a&&w.i(a,"function",P,"click"),this.R.di=a,this.j("click",b,a))});w.g(P,"doubleClick",P.prototype.Pm);w.defineProperty(P,{Pm:"doubleClick"},function(){return null!==this.R?this.R.ki:null},function(a){null===this.R&&il(this);var b=this.R.ki;b!==a&&(null!==a&&w.i(a,"function",P,"doubleClick"),this.R.ki=a,this.j("doubleClick",b,a))});
  w.g(P,"contextClick",P.prototype.ft);w.defineProperty(P,{ft:"contextClick"},function(){return null!==this.R?this.R.fi:null},function(a){null===this.R&&il(this);var b=this.R.fi;b!==a&&(null!==a&&w.i(a,"function",P,"contextClick"),this.R.fi=a,this.j("contextClick",b,a))});w.g(P,"mouseEnter",P.prototype.DA);
  w.defineProperty(P,{DA:"mouseEnter"},function(){return null!==this.R?this.R.Er:null},function(a){null===this.R&&il(this);var b=this.R.Er;b!==a&&(null!==a&&w.i(a,"function",P,"mouseEnter"),this.R.Er=a,this.j("mouseEnter",b,a))});w.g(P,"mouseLeave",P.prototype.EA);w.defineProperty(P,{EA:"mouseLeave"},function(){return null!==this.R?this.R.Fr:null},function(a){null===this.R&&il(this);var b=this.R.Fr;b!==a&&(null!==a&&w.i(a,"function",P,"mouseLeave"),this.R.Fr=a,this.j("mouseLeave",b,a))});
  w.g(P,"mouseOver",P.prototype.Jt);w.defineProperty(P,{Jt:"mouseOver"},function(){return null!==this.R?this.R.ui:null},function(a){null===this.R&&il(this);var b=this.R.ui;b!==a&&(null!==a&&w.i(a,"function",P,"mouseOver"),this.R.ui=a,this.j("mouseOver",b,a))});w.g(P,"mouseHover",P.prototype.It);
  w.defineProperty(P,{It:"mouseHover"},function(){return null!==this.R?this.R.ti:null},function(a){null===this.R&&il(this);var b=this.R.ti;b!==a&&(null!==a&&w.i(a,"function",P,"mouseHover"),this.R.ti=a,this.j("mouseHover",b,a))});w.g(P,"mouseHold",P.prototype.Ht);w.defineProperty(P,{Ht:"mouseHold"},function(){return null!==this.R?this.R.si:null},function(a){null===this.R&&il(this);var b=this.R.si;b!==a&&(null!==a&&w.i(a,"function",P,"mouseHold"),this.R.si=a,this.j("mouseHold",b,a))});
  w.g(P,"mouseDragEnter",P.prototype.GF);w.defineProperty(P,{GF:"mouseDragEnter"},function(){return null!==this.R?this.R.Cr:null},function(a){null===this.R&&il(this);var b=this.R.Cr;b!==a&&(null!==a&&w.i(a,"function",P,"mouseDragEnter"),this.R.Cr=a,this.j("mouseDragEnter",b,a))});w.g(P,"mouseDragLeave",P.prototype.HF);
  w.defineProperty(P,{HF:"mouseDragLeave"},function(){return null!==this.R?this.R.Dr:null},function(a){null===this.R&&il(this);var b=this.R.Dr;b!==a&&(null!==a&&w.i(a,"function",P,"mouseDragLeave"),this.R.Dr=a,this.j("mouseDragLeave",b,a))});w.g(P,"mouseDrop",P.prototype.Gt);w.defineProperty(P,{Gt:"mouseDrop"},function(){return null!==this.R?this.R.ri:null},function(a){null===this.R&&il(this);var b=this.R.ri;b!==a&&(null!==a&&w.i(a,"function",P,"mouseDrop"),this.R.ri=a,this.j("mouseDrop",b,a))});
  w.g(P,"actionDown",P.prototype.Ez);w.defineProperty(P,{Ez:"actionDown"},function(){return null!==this.R?this.R.cq:null},function(a){null===this.R&&il(this);var b=this.R.cq;b!==a&&(null!==a&&w.i(a,"function",P,"actionDown"),this.R.cq=a,this.j("actionDown",b,a))});w.g(P,"actionMove",P.prototype.Fz);
  w.defineProperty(P,{Fz:"actionMove"},function(){return null!==this.R?this.R.dq:null},function(a){null===this.R&&il(this);var b=this.R.dq;b!==a&&(null!==a&&w.i(a,"function",P,"actionMove"),this.R.dq=a,this.j("actionMove",b,a))});w.g(P,"actionUp",P.prototype.Gz);w.defineProperty(P,{Gz:"actionUp"},function(){return null!==this.R?this.R.eq:null},function(a){null===this.R&&il(this);var b=this.R.eq;b!==a&&(null!==a&&w.i(a,"function",P,"actionUp"),this.R.eq=a,this.j("actionUp",b,a))});
  w.g(P,"actionCancel",P.prototype.Dz);w.defineProperty(P,{Dz:"actionCancel"},function(){return null!==this.R?this.R.bq:null},function(a){null===this.R&&il(this);var b=this.R.bq;b!==a&&(null!==a&&w.i(a,"function",P,"actionCancel"),this.R.bq=a,this.j("actionCancel",b,a))});w.g(P,"toolTip",P.prototype.gu);
  w.defineProperty(P,{gu:"toolTip"},function(){return null!==this.R?this.R.Bi:null},function(a){null===this.R&&il(this);var b=this.R.Bi;b!==a&&(null!==a&&w.l(a,tf,P,"toolTip"),this.R.Bi=a,this.j("toolTip",b,a))});w.g(P,"contextMenu",P.prototype.contextMenu);w.defineProperty(P,{contextMenu:"contextMenu"},function(){return null!==this.R?this.R.gi:null},function(a){null===this.R&&il(this);var b=this.R.gi;b!==a&&(null!==a&&w.l(a,tf,P,"contextMenu"),this.R.gi=a,this.j("contextMenu",b,a))});
  P.prototype.bind=P.prototype.bind=function(a){a.og=this;var b=this.Xo();null!==b&&Sl(b)&&w.m("Cannot add a Binding to a template that has already been copied: "+a);null===this.Kc&&(this.Kc=new D(kf));this.Kc.add(a)};P.prototype.findTemplateBinder=P.prototype.Xo=function(){for(var a=this instanceof z?this:this.U;null!==a;){if(null!==a.Nl)return a;a=a.U}return null};P.fromSvg=P.fromSVG=function(a){return Tl(a)};P.prototype.setProperties=function(a){w.au(this,a)};var Ul;
  P.make=Ul=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=Vl.Aa(a);"function"===typeof g?(c=w.il(arguments),d=g(c)):e=aa[a]}null===d&&(void 0===e&&(d=window.$,void 0!==d&&void 0!==d.noop&&w.m("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"),w.m("GraphObject.make failed to complete, it may be conflicting with another var.")),null!==e&&e.constructor||w.m("GraphObject.make requires a class function or class name, not: "+
  a),d=new e);g=1;if(d instanceof C&&1<c.length){var h=d,e=c[1];if("string"===typeof e||e instanceof HTMLDivElement)cj(h,e),g++}for(;g<c.length;g++)e=c[g],void 0===e?w.m("Undefined value at argument "+g+" for object being constructed by GraphObject.make: "+d):Wl(d,e);return d};
  function Wl(a,b){if("string"===typeof b)if(a instanceof oa)a.text=b;else if(a instanceof W)a.Bb=b;else if(a instanceof Xl)a.source=b;else if(a instanceof z){var c=ya(z,b);null!==c?a.type=c:w.m("Unknown Panel type as an argument to GraphObject.make: "+b)}else a instanceof ea?(c=ya(ea,b),null!==c?a.type=c:w.m("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof ed?(c=ya(ed,b),null!==c?a.type=c:w.m("Unknown Geometry type as an argument to GraphObject.make: "+b)):a instanceof Pd?
  (c=ya(Pd,b),null!==c?a.type=c:w.m("Unknown PathSegment type as an argument to GraphObject.make: "+b)):w.m("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof P)c=b,a instanceof z||w.m("A GraphObject can only be added to a Panel, not to: "+a),a.add(c);else if(b instanceof af){var d=b,c=a,e;d.ge&&c.jd?e=c.jd(d.index):!d.ge&&c.hd?e=c.hd(d.index):w.m("A RowColumnDefinition can only be added to a Panel, not to: "+a);e.gt(d)}else if(b instanceof ba)a instanceof U&&b.Ie===
  U?2===(b.value&2)?a.Wt=b:b===sh||b===ih||b===hh?a.Le=b:b===Yl||b===Zl||b===$l?a.Eo=b:b!==am&&b!==jh&&w.m("Unknown Link enum value for a Link property: "+b):a instanceof z&&b.Ie===z?a.type=b:a instanceof oa&&b.Ie===oa?a.uB=b:a instanceof W&&(b===yh||b===Jh||b===Kh||b===fl)?a.dA=b:a instanceof Xl&&(b===yh||b===Jh||b===Kh)?a.$E=b:a instanceof P&&b.Ie===U?(c=a,0===b.name.indexOf("Orient")?c.Zt=b:w.m("Unknown Link enum value for GraphObject.segmentOrientation property: "+b)):a instanceof P&&b.Ie===P?a.stretch=
  b:a instanceof af&&b.Ie===af?a.Qp=b:a instanceof C&&b.Ie===C?a.Fm=b:a instanceof ea&&b.Ie===ea?a.type=b:a instanceof ed&&b.Ie===ed?a.type=b:a instanceof Pd&&b.Ie===Pd?a.type=b:a instanceof kf&&b.Ie===kf?a.mode=b:a instanceof Ud&&b.Ie===Ud?a.sd=b:a instanceof Y&&b.Ie===Y?0===b.name.indexOf("Alignment")?a.alignment=b:0===b.name.indexOf("Arrangement")?a.Ge=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.UG=b:w.m("Unknown enum value: "+b):a instanceof Z&&b.Ie===Z?0===b.name.indexOf("Aggressive")?a.PD=b:0===b.name.indexOf("Cycle")?a.qE=b:0===b.name.indexOf("Init")?a.eF=b:0===b.name.indexOf("Layer")?a.sF=b:w.m("Unknown enum value: "+b):a instanceof Zk&&b.Ie===Zk?b===bm||b===cm||b===dm||b===em?a.sorting=b:b===fm||b===gm?a.Ge=b:b===hm||b===im?a.alignment=b:w.m("Unknown enum value: "+b):a instanceof jm&&b.Ie===jm?b===km||b===lm||b===mm||b===nm||b===om?a.sorting=b:b===pm||b===qm||b===rm||b===zm?a.direction=
  b:b===Am||b===Bm||b===Cm||b===Dm?a.Ge=b:b===Em||b===Fm?a.Lt=b:w.m("Unknown enum value: "+b):w.m("No property to set for this enum value: "+b);else if(b instanceof kf)a instanceof P?a.bind(b):a instanceof af?a.bind(b):w.m("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof gd)a instanceof ed?a.pb.add(b):w.m("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof Pd)a instanceof gd?a.Fa.add(b):w.m("A PathSegment can only be added to a PathFigure, not to: "+
  a);else if(b instanceof Re)a instanceof C?a.Lb=b:a instanceof T?a.Lb=b:w.m("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++)Wl(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof ea){e=new na;for(c in b)d=parseFloat(c),isNaN(d)?e[c]=b[c]:a.addColorStop(d,b[c]);w.au(a,e)}else if(a instanceof af){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.m("Must specify non-negative integer row for RowColumnDefinition "+
  b),a.ge=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.m("Must specify non-negative integer column for RowColumnDefinition "+b),a.ge=!1,a.index=e);e=new na;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);w.au(a,e)}else w.au(a,b);else w.m('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var Vl=new ia("string","function");
  P.getBuilders=function(){var a=new ia("string","function"),b;for(b in Vl)if(b!==b.toLowerCase()){var c=Vl[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};var Gm;P.defineBuilder=Gm=function(a,b){w.i(a,"string",P,"defineBuilder:name");w.i(b,"function",P,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.m("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);Vl.add(a,b)};
  Gm("Button",function(){var a=new ea(Be);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new ea(Be);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=Ul(z,ej,{Uw:!0},{_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue"},Ul(W,{name:"ButtonBorder",Bb:"Rectangle",G:new K(0,0,2.761423749153968,2.761423749153968),H:new K(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.DA=function(a,b){var e=b.qe("ButtonBorder");if(e instanceof
  W){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}};a.EA=function(a,b){var e=b.qe("ButtonBorder");e instanceof W&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)};return a});
  Gm("TreeExpanderButton",function(){var a=Ul("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ul(W,{name:"ButtonIcon",Bb:"MinusLine",ya:J.$p},(new kf("figure","isTreeExpanded",function(a,c){var d=c.U;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).ox()),{visible:!1},(new kf("visible","isTreeLeaf",function(a){return!a})).ox());a.click=function(a,c){var d=c.V;d instanceof tf&&(d=d.Nh);if(d instanceof S){var e=d.h;if(null!==e){e=e.Ab;if(d.Qc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
  a.Oc=!0;d.Qc?e.collapseTree(d):e.expandTree(d)}}};return a});
  Gm("SubGraphExpanderButton",function(){var a=Ul("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ul(W,{name:"ButtonIcon",Bb:"MinusLine",ya:J.$p},(new kf("figure","isSubGraphExpanded",function(a,c){var d=c.U;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).ox()));a.click=function(a,c){var d=c.V;d instanceof tf&&(d=d.Nh);if(d instanceof T){var e=d.h;if(null!==e){e=e.Ab;if(d.Ld){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Oc=
  !0;d.Ld?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});Gm("ContextMenuButton",function(){var a=Ul("Button");a.stretch=hl;var b=a.qe("ButtonBorder");b instanceof W&&(b.Bb="Rectangle",b.G=new K(0,0,2,3),b.H=new K(1,1,-2,-2));return a});
  Gm("PanelExpanderButton",function(a){var b="COLLAPSIBLE";"string"===typeof a[1]&&(b=a[1],a.splice(1,1));a=Ul("Button",Ul(W,"TriangleUp",{ya:new fa(6,4)},(new kf("figure","visible",function(a){return a?"TriangleUp":"TriangleDown"})).ox(b)));var c=a.qe("ButtonBorder");c instanceof W&&(c.stroke=null,c.fill="transparent");a.click=function(a,c){var g=c.h;if(null!==g){var h=c.V.qe(b);null!==h&&(g.ac("Collapse/Expand Panel"),h.visible=!h.visible,g.ae("Collapse/Expand Panel"))}};return a});
  function jl(){this.gi=this.Bi=this.bq=this.eq=this.dq=this.cq=this.ri=this.Dr=this.Cr=this.si=this.ti=this.ui=this.Fr=this.Er=this.fi=this.ki=this.di=null}jl.prototype.copy=function(){var a=new jl;a.di=this.di;a.ki=this.ki;a.fi=this.fi;a.Er=this.Er;a.Fr=this.Fr;a.ui=this.ui;a.ti=this.ti;a.si=this.si;a.Cr=this.Cr;a.Dr=this.Dr;a.ri=this.ri;a.cq=this.cq;a.dq=this.dq;a.eq=this.eq;a.bq=this.bq;a.Bi=this.Bi;a.gi=this.gi;return a};
  function z(a){P.call(this);void 0===a?0===arguments.length?this.ha=Mh:w.m("invalid argument to Panel constructor: undefined"):(w.za(a,z,z,"type"),this.ha=a);this.Ca=new D(P);this.$e=J.aq;this.Wg=!1;this.ha===ij&&(this.Wg=!0);this.Tq=!1;this.xq=zc;this.ji=fl;this.ha===Il&&Hm(this);this.Co=Jh;this.Mq=(new fa(10,10)).freeze();this.Nq=J.nk;this.Nl=this.rh=null;this.hr=NaN;this.hg=this.oi=null;this.co="category";this.gg=null;this.Di=new y(NaN,NaN,NaN,NaN);this.xm=null;this.yh=!1;this.ns=null}w.Ia(z,P);
  w.Ph(z);w.ja("Panel",z);function Hm(a){a.gj=J.aq;a.uh=1;a.ii=null;a.Sl=null;a.th=1;a.sh=null;a.Rl=null;a.Ed=[];a.xd=[];a.qm=Im;a.Pl=Im;a.Ci=0;a.pi=0}
  z.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.ha=this.ha;a.$e=this.$e.ba();a.Wg=this.Wg;a.Tq=this.Tq;a.xq=this.xq.ba();a.ji=this.ji;if(a.ha===Il){a.gj=this.gj.ba();a.uh=this.uh;a.ii=this.ii;a.Sl=this.Sl;a.th=this.th;a.sh=this.sh;a.Rl=this.Rl;var b=[];if(0<this.Ed.length)for(var c=this.Ed,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var g=c[e].copy();g.Cl(a);b[e]=g}a.Ed=b;b=[];if(0<this.xd.length)for(c=this.xd,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(g=c[e].copy(),g.Cl(a),
  b[e]=g);a.xd=b;a.qm=this.qm;a.Pl=this.Pl;a.Ci=this.Ci;a.pi=this.pi}a.Co=this.Co;a.Mq.assign(this.Mq);a.Nq=this.Nq.ba();a.rh=this.rh;a.Nl=this.Nl;a.hr=this.hr;a.oi=this.oi;a.hg=this.hg;a.co=this.co;a.Di.assign(this.Di);a.yh=this.yh;null!==this.ns&&(a.ns=this.ns)};z.prototype.Qh=function(a){P.prototype.Qh.call(this,a);a.Ca=this.Ca;for(var b=a.Ca.q,c=b.length,d=0;d<c;d++)b[d].ah=a;a.xm=null};
  z.prototype.copy=function(){var a=P.prototype.copy.call(this);if(null!==a){for(var b=this.Ca.q,c=b.length,d=0;d<c;d++){var e=b[d].copy(),g=a;e.Cl(g);e.lm=null;var h=g.Ca,k=h.count;h.ce(k,e);h=g.V;if(null!==h){h.Tk=null;null!==e.wd&&h instanceof S&&(h.yh=!0);var l=g.h;null!==l&&l.ka.sb||h.Hc(he,"elements",g,null,e,null,k)}}return a}return null};z.prototype.toString=function(){return"Panel("+this.type+")#"+w.Yc(this)};var Mh;z.Position=Mh=w.w(z,"Position",0);z.Horizontal=w.w(z,"Horizontal",1);var dj;
  z.Vertical=dj=w.w(z,"Vertical",2);var wh;z.Spot=wh=w.w(z,"Spot",3);var ej;z.Auto=ej=w.w(z,"Auto",4);var Il;z.Table=Il=w.w(z,"Table",5);z.Viewbox=w.w(z,"Viewbox",6);var wl;z.TableRow=wl=w.w(z,"TableRow",7);var xl;z.TableColumn=xl=w.w(z,"TableColumn",8);var gh;z.Link=gh=w.w(z,"Link",9);var ij;z.Grid=ij=w.w(z,"Grid",10);w.g(z,"type",z.prototype.type);
  w.defineProperty(z,{type:"type"},function(){return this.ha},function(a){var b=this.ha;b!==a&&(t&&w.za(a,z,z,"type"),b!==wl&&b!==xl||w.m("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.ha=a,this.ha===ij?this.Wg=!0:this.ha===Il&&Hm(this),this.T(),this.j("type",b,a))});w.A(z,{elements:"elements"},function(){return this.Ca.k});w.A(z,{Ka:"naturalBounds"},function(){return this.Lc});w.g(z,"padding",z.prototype.padding);
  w.defineProperty(z,{padding:"padding"},function(){return this.$e},function(a){"number"===typeof a?(0>a&&w.la(a,">= 0",z,"padding"),a=new eb(a)):(w.l(a,eb,z,"padding"),0>a.left&&w.la(a.left,">= 0",z,"padding:value.left"),0>a.right&&w.la(a.right,">= 0",z,"padding:value.right"),0>a.top&&w.la(a.top,">= 0",z,"padding:value.top"),0>a.bottom&&w.la(a.bottom,">= 0",z,"padding:value.bottom"));var b=this.$e;b.L(a)||(this.$e=a=a.ba(),this.T(),this.j("padding",b,a))});w.g(z,"defaultAlignment",z.prototype.Xj);
  w.defineProperty(z,{Xj:"defaultAlignment"},function(){return this.xq},function(a){var b=this.xq;b.L(a)||(t&&w.l(a,K,z,"defaultAlignment"),this.xq=a=a.ba(),this.T(),this.j("defaultAlignment",b,a))});w.g(z,"defaultStretch",z.prototype.td);w.defineProperty(z,{td:"defaultStretch"},function(){return this.ji},function(a){var b=this.ji;b!==a&&(w.za(a,P,z,"defaultStretch"),this.ji=a,this.T(),this.j("defaultStretch",b,a))});w.g(z,"defaultSeparatorPadding",z.prototype.xI);
  w.defineProperty(z,{xI:"defaultSeparatorPadding"},function(){return void 0===this.gj?J.aq:this.gj},function(a){if(void 0!==this.gj){"number"===typeof a?a=new eb(a):t&&w.l(a,eb,z,"defaultSeparatorPadding");var b=this.gj;b.L(a)||(this.gj=a=a.ba(),this.j("defaultSeparatorPadding",b,a))}});w.g(z,"defaultRowSeparatorStroke",z.prototype.vI);
  w.defineProperty(z,{vI:"defaultRowSeparatorStroke"},function(){return void 0===this.ii?null:this.ii},function(a){var b=this.ii;b!==a&&(null===a||"string"===typeof a||a instanceof ea)&&(a instanceof ea&&a.freeze(),this.ii=a,this.j("defaultRowSeparatorStroke",b,a))});w.g(z,"defaultRowSeparatorStrokeWidth",z.prototype.wI);
  w.defineProperty(z,{wI:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.uh?1:this.uh},function(a){if(void 0!==this.uh){var b=this.uh;b!==a&&isFinite(a)&&0<=a&&(this.uh=a,this.j("defaultRowSeparatorStrokeWidth",b,a))}});w.g(z,"defaultRowSeparatorDashArray",z.prototype.uI);
  w.defineProperty(z,{uI:"defaultRowSeparatorDashArray"},function(){return void 0===this.Sl?null:this.Sl},function(a){if(void 0!==this.Sl){var b=this.Sl;if(b!==a){null===a||Array.isArray(a)||w.sc(a,"Array",z,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||w.m("defaultRowSeparatorDashArray:value "+g+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.Sl=a;this.pa();this.j("defaultRowSeparatorDashArray",
  b,a)}}});w.g(z,"defaultColumnSeparatorStroke",z.prototype.pI);w.defineProperty(z,{pI:"defaultColumnSeparatorStroke"},function(){return void 0===this.sh?null:this.sh},function(a){if(void 0!==this.sh){var b=this.sh;b!==a&&(null===a||"string"===typeof a||a instanceof ea)&&(a instanceof ea&&a.freeze(),this.sh=a,this.j("defaultColumnSeparatorStroke",b,a))}});w.g(z,"defaultColumnSeparatorStrokeWidth",z.prototype.qI);
  w.defineProperty(z,{qI:"defaultColumnSeparatorStrokeWidth"},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.j("defaultColumnSeparatorStrokeWidth",b,a))}});w.g(z,"defaultColumnSeparatorDashArray",z.prototype.oI);
  w.defineProperty(z,{oI:"defaultColumnSeparatorDashArray"},function(){return void 0===this.Rl?null:this.Rl},function(a){if(void 0!==this.Rl){var b=this.Rl;if(b!==a){null===a||Array.isArray(a)||w.sc(a,"Array",z,"defaultColumnSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||w.m("defaultColumnSeparatorDashArray:value "+g+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.Rl=a;this.pa();this.j("defaultColumnSeparatorDashArray",
  b,a)}}});w.g(z,"viewboxStretch",z.prototype.gK);w.defineProperty(z,{gK:"viewboxStretch"},function(){return this.Co},function(a){var b=this.Co;b!==a&&(w.za(a,P,z,"viewboxStretch"),this.Co=a,this.j("viewboxStretch",b,a))});w.g(z,"gridCellSize",z.prototype.rt);
  w.defineProperty(z,{rt:"gridCellSize"},function(){return this.Mq},function(a){var b=this.Mq;b.L(a)||(w.l(a,fa,z,"gridCellSize"),a.J()&&0!==a.width&&0!==a.height||w.m("Invalid Panel.gridCellSize: "+a),this.Mq=a.ba(),null!==this.h&&this===this.h.dp&&Bj(this.h),this.pa(),this.j("gridCellSize",b,a))});w.g(z,"gridOrigin",z.prototype.iA);
  w.defineProperty(z,{iA:"gridOrigin"},function(){return this.Nq},function(a){var b=this.Nq;b.L(a)||(w.l(a,x,z,"gridOrigin"),a.J()||w.m("Invalid Panel.gridOrigin: "+a),this.Nq=a.ba(),null!==this.h&&Bj(this.h),this.pa(),this.j("gridOrigin",b,a))});f=z.prototype;f.Av=function(a){P.prototype.Av.call(this,a);for(var b=this.Ca.q,c=b.length,d=0;d<c;d++)b[d].Av(a)};
  f.bk=function(a,b){if(this.ha===ij){var c=this.Qi()*b.scale;0>=c&&(c=1);var d=this.rt,e=d.width,d=d.height,g=this.Ka,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.iA;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.Ca.q,q=p.length,r=0;r<q;r++){var s=p[r],u=[];n.push(u);if(s.visible)for(var s=lk(s.Bb),v=r+1;v<q;v++){var A=p[v];A.visible&&lk(A.Bb)===s&&(A=A.interval,2<=A&&u.push(A))}}p=this.Ca.q;q=p.length;for(r=0;r<q;r++){var E=p[r];if(E.visible){var u=n[r],s=E.interval,
  v=!1,B=!0,G=E.Gx;null!==G&&(v=!0,void 0!==a.setLineDash?(a.setLineDash(G),a.lineDashOffset=E.gd):void 0!==a.webkitLineDash?(a.webkitLineDash=G,a.webkitLineDashOffset=E.gd):void 0!==a.mozDash?(a.mozDash=G,a.mozDashOffset=E.gd):B=!1);if("LineV"===E.Bb){a.lineWidth=E.ib;Bl(this,a,E.stroke,!1,!1);a.beginPath();for(var O=A=Math.floor(-m.x/e);O<=A+k;O++){var M=O*e+m.x;if(0<=M&&M<h&&Jm(O,s,u)&&(v&&!B?ml(a,M,0,M,g,G,E.gd):(a.moveTo(M,0),a.lineTo(M,g)),2>e*s*c))break}a.stroke()}else if("LineH"===E.Bb){a.lineWidth=
  E.ib;Bl(this,a,E.stroke,!1,!1);a.beginPath();for(O=A=Math.floor(-m.y/d);O<=A+l&&!(M=O*d+m.y,0<=M&&M<=g&&Jm(O,s,u)&&(v&&!B?ml(a,0,M,h,M,G,E.gd):(a.moveTo(0,M),a.lineTo(h,M)),2>d*s*c));O++);a.stroke()}else if("BarV"===E.Bb)for(Bl(this,a,E.fill,!0,!1),E=E.width,isNaN(E)&&(E=e),O=A=Math.floor(-m.x/e);O<=A+k&&!(M=O*e+m.x,0<=M&&M<h&&Jm(O,s,u)&&(a.fillRect(M,0,E,g),2>e*s*c));O++);else if("BarH"===E.Bb)for(Bl(this,a,E.fill,!0,!1),E=E.height,isNaN(E)&&(E=d),O=A=Math.floor(-m.y/d);O<=A+l&&!(M=O*d+m.y,0<=M&&
  M<=g&&Jm(O,s,u)&&(a.fillRect(0,M,h,E),2>d*s*c));O++);v&&(void 0!==a.setLineDash?(a.setLineDash(w.nh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=w.nh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0))}}a.restore();gj(b,a,!1)}else{this.ha===Il&&(a.lineCap="butt",Km(this,a,!0,this.Ed,!0),Km(this,a,!1,this.xd,!0),Lm(this,a,!0,this.Ed),Lm(this,a,!1,this.xd),Km(this,a,!0,this.Ed,!1),Km(this,a,!1,this.xd,!1));(c=this.qA)&&a.save();e=this.Qf();d=this.Ca.q;
  h=d.length;for(g=0;g<h;g++)k=d[g],c&&k===e&&(a.ou=!0),k.bf(a,b),c&&k===e&&(a.ou=!1);c&&(a.restore(),gj(b,a,!1));t&&t.yK&&this instanceof U&&t.xK(a,b,this)}};
  function Lm(a,b,c,d){for(var e=d.length,g=a.ea,h=c?a.jd(0):a.hd(0),k=0;k<e;k++){var l=d[k];if(void 0!==l&&l!==h&&0!==l.Ua){var m=l.jn;isNaN(m)&&(m=c?a.uh:a.th);var n=l.hn;null===n&&(n=c?a.ii:a.sh);if(0!==m&&null!==n){Bl(a,b,n,!1,!1);var n=!1,p=!0,q=l.sG;null!==q&&(n=!0,void 0!==b.setLineDash?(b.setLineDash(q),b.lineDashOffset=a.gd):void 0!==b.webkitLineDash?(b.webkitLineDash=q,b.webkitLineDashOffset=a.gd):void 0!==b.mozDash?(b.mozDash=q,b.mozDashOffset=a.gd):p=!1);b.beginPath();var r=l.position+m;
  c?r>g.height&&(m-=r-g.height):r>g.width&&(m-=r-g.width);l=l.position+m/2;b.lineWidth=m;r=a.padding;c?(l+=r.top,m=r.left,r=g.width-r.right,n&&!p?ml(b,m,l,r,l,q,0):(b.moveTo(m,l),b.lineTo(r,l))):(l+=r.left,m=r.top,r=g.height-r.bottom,n&&!p?ml(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&(void 0!==b.setLineDash?(b.setLineDash(w.nh),b.lineDashOffset=0):void 0!==b.webkitLineDash?(b.webkitLineDash=w.nh,b.webkitLineDashOffset=0):void 0!==b.mozDash&&(b.mozDash=null,b.mozDashOffset=0))}}}}
  function Km(a,b,c,d,e){for(var g=d.length,h=a.ea,k=0;k<g;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.xw!==e&&0!==l.Ua){var m=c?h.height:h.width;if(!(l.position>m)){var n=l.ug(),p=l.jn;isNaN(p)&&(p=c?a.uh:a.th);var q=l.hn;null===q&&(q=c?a.ii:a.sh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Ua;p+n>m&&(n=m-p);0>=n||(m=a.padding,Bl(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 Jm(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 lk(a){return"LineV"===a||"BarV"===a}
  f.cp=function(a,b,c,d,e){var g=this.bg(),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.el)return h=this.ea,J.pl(h.left,h.top,h.right,h.bottom,a,b,c,d,e);if(null!==this.background)g=a*l+b*n+q,k=a*m+b*p+r,a=c*l+d*n+q,c=c*m+d*p+r,e.o(0,0),d=this.Ka,c=J.pl(0,0,d.width,d.height,g,k,a,c,e),e.transform(h);else{g||(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.o(l,d);
  m=(l-k)*(l-k)+(d-a)*(d-a);c=!1;p=this.Ca.q;r=p.length;n=w.M();for(q=0;q<r;q++)b=p[q],b.visible&&b.cp(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)));w.B(n);g&&e.transform(h)}return c};f.T=function(a){P.prototype.T.call(this,a);this.ha===ej&&(a=this.Qf(),null!==a&&a.T(!0));a=this.Ca.q;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==Gj(d)&&(d.ya.J()||(d instanceof xh||d instanceof z||d instanceof oa||rl(d,!1)!==yh)&&d.T(!0))}};
  f.gp=function(){if(!1===Gj(this)){sl(this,!0);ul(this,!0);for(var a=this.Ca.q,b=a.length,c=0;c<b;c++)a[c].gp()}};f.Vg=function(){if(0!==(this.ia&2048)===!1){Fl(this,!0);Gl(this,!0);for(var a=this.Ca.q,b=a.length,c=0;c<b;c++)a[c].lA()}};f.lA=function(){Gl(this,!0);for(var a=this.Ca.q,b=a.length,c=0;c<b;c++)a[c].lA()};
  f.wp=function(a,b,c,d){var e=this.Di;e.width=0;e.height=0;var g=this.ya,h=this.Re;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.Pd;isNaN(g.width)||(a=Math.min(g.width,k.width));isNaN(g.height)||(b=Math.min(g.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.Ca.q;if(0!==m.length){var n=this.ha.Xb;switch(n){case "Position":var p=a,q=b,r=c,s=d,u=m.length;e.x=0;e.y=
  0;e.width=0;for(var v=e.height=0;v<u;v++){var A=m[v];if(A.visible||A===this.hc){var E=A.margin,B=E.right+E.left,G=E.top+E.bottom;Xh(A,p,q,r,s);var O=A.Ga,M=Math.max(O.width+B,0),X=Math.max(O.height+G,0),ja=A.position.x,V=A.position.y;isFinite(ja)||(ja=0);isFinite(V)||(V=0);if(A instanceof W){var Q=A;if(Q.sA)var ca=Q.ib/2,ja=ja-ca,V=V-ca}nb(e,ja,V,M,X)}}break;case "Vertical":for(var Pa=a,Ha=c,Wa=m.length,Aa=w.lb(),Ma=0;Ma<Wa;Ma++){var Da=m[Ma];if(Da.visible||Da===this.hc){var hc=rl(Da,!1);if(hc!==
  yh&&hc!==gl)Aa.push(Da);else{var od=Da.margin,Qf=od.right+od.left,ic=od.top+od.bottom;Xh(Da,Pa,Infinity,Ha,0);var bf=Da.Ga,Rf=Math.max(bf.width+Qf,0),Za=Math.max(bf.height+ic,0);e.width=Math.max(e.width,Rf);e.height+=Za}}}var jb=Aa.length;if(0!==jb){this.ya.width?Pa=Math.min(this.ya.width,this.Pd.width):0!==e.width&&(Pa=Math.min(e.width,this.Pd.width));for(Ma=0;Ma<jb;Ma++)if(Da=Aa[Ma],Da.visible||Da===this.hc)od=Da.margin,Qf=od.right+od.left,ic=od.top+od.bottom,Xh(Da,Pa,Infinity,Ha,0),bf=Da.Ga,Rf=
  Math.max(bf.width+Qf,0),Za=Math.max(bf.height+ic,0),e.width=Math.max(e.width,Rf),e.height+=Za;w.xa(Aa)}break;case "Horizontal":for(var Ja=b,Ka=d,qb=m.length,Lb=w.lb(),fb=0;fb<qb;fb++){var oc=m[fb];if(oc.visible||oc===this.hc){var me=rl(oc,!1);if(me!==yh&&me!==hl)Lb.push(oc);else{var tc=oc.margin,Vd=tc.right+tc.left,ne=tc.top+tc.bottom;Xh(oc,Infinity,Ja,0,Ka);var cf=oc.Ga,wf=Math.max(cf.width+Vd,0),Wd=Math.max(cf.height+ne,0);e.width+=wf;e.height=Math.max(e.height,Wd)}}}var Mb=Lb.length;if(0!==Mb){this.ya.height?
  Ja=Math.min(this.ya.height,this.Pd.height):0!==e.height&&(Ja=Math.min(e.height,this.Pd.height));for(fb=0;fb<Mb;fb++)if(oc=Lb[fb],oc.visible||oc===this.hc)tc=oc.margin,Vd=tc.right+tc.left,ne=tc.top+tc.bottom,Xh(oc,Infinity,Ja,0,Ka),cf=oc.Ga,wf=Math.max(cf.width+Vd,0),Wd=Math.max(cf.height+ne,0),e.width+=wf,e.height=Math.max(e.height,Wd);w.xa(Lb)}break;case "Spot":a:{var Eb=a,uc=b,Pg=c,Nb=d,Fb=m.length,jc=this.Qf(),rb=jc.margin,Ee=0,Xd=0,tg=rb.right+rb.left,Sf=rb.top+rb.bottom;Xh(jc,Eb,uc,Pg,Nb);var Gb=
  jc.Ga,pd=Gb.width,vc=Gb.height,Bb=Math.max(pd+tg,0),Mc=Math.max(vc+Sf,0);e.x=-rb.left;e.y=-rb.top;e.width=Bb;e.height=Mc;for(var Qb=0;Qb<Fb;Qb++){var Va=m[Qb];if(Va!==jc&&(Va.visible||Va===this.hc)){rb=Va.margin;Ee=rb.right+rb.left;Xd=rb.top+rb.bottom;Xh(Va,Eb,uc,0,0);var Gb=Va.Ga,Bb=Math.max(Gb.width+Ee,0),Mc=Math.max(Gb.height+Xd,0),kb=Va.alignment;kb.Pc()&&(kb=this.Xj);kb.kd()||(kb=Ob);var Hb=Va.Fi;Hb.Pc()&&(Hb=Ob);nb(e,kb.x*pd+kb.offsetX-(Hb.x*Gb.width-Hb.offsetX)-rb.left,kb.y*vc+kb.offsetY-(Hb.y*
  Gb.height-Hb.offsetY)-rb.top,Bb,Mc)}}var kc=jc.stretch;kc===fl&&(kc=rl(jc,!1));switch(kc){case yh:break a;case hd:if(!isFinite(Eb)&&!isFinite(uc))break a;break;case hl:if(!isFinite(Eb))break a;break;case gl:if(!isFinite(uc))break a}Gb=jc.Ga;pd=Gb.width;vc=Gb.height;Bb=Math.max(pd+tg,0);Mc=Math.max(vc+Sf,0);rb=jc.margin;e.x=-rb.left;e.y=-rb.top;e.width=Bb;e.height=Mc;for(Qb=0;Qb<Fb;Qb++)Va=m[Qb],Va===jc||!Va.visible&&Va!==this.hc||(rb=Va.margin,Ee=rb.right+rb.left,Xd=rb.top+rb.bottom,Gb=Va.Ga,Bb=Math.max(Gb.width+
  Ee,0),Mc=Math.max(Gb.height+Xd,0),kb=Va.alignment,kb.Pc()&&(kb=this.Xj),kb.kd()||(kb=Ob),Hb=Va.Fi,Hb.Pc()&&(Hb=Ob),nb(e,kb.x*pd+kb.offsetX-(Hb.x*Gb.width-Hb.offsetX)-rb.left,kb.y*vc+kb.offsetY-(Hb.y*Gb.height-Hb.offsetY)-rb.top,Bb,Mc))}break;case "Auto":var Yd=a,Zd=b,xf=c,Fe=d,Ge=m.length,Yb=this.Qf(),gb=Yb.margin,lc=gb.right+gb.left,Ec=gb.top+gb.bottom;Xh(Yb,Yd,Zd,xf,Fe);var qd=Yb.Ga,db=Math.max(qd.width+lc,0),zb=Math.max(qd.height+Ec,0),pc=Mm(Yb),rd=pc.x*db+pc.offsetX,Qg=pc.y*zb+pc.offsetY,pc=Nm(Yb),
  Rg=pc.x*db+pc.offsetX,Sg=pc.y*zb+pc.offsetY,Tf=Yd,Nc=Zd;isFinite(Yd)&&(Tf=Math.abs(rd-Rg));isFinite(Zd)&&(Nc=Math.abs(Qg-Sg));var Wc=w.Hl();Wc.o(0,0);for(var Oc=0;Oc<Ge;Oc++){var sb=m[Oc];if(sb!==Yb&&(sb.visible||sb===this.hc)){var gb=sb.margin,oe=gb.right+gb.left,tb=gb.top+gb.bottom;Xh(sb,Tf,Nc,0,0);qd=sb.Ga;db=Math.max(qd.width+oe,0);zb=Math.max(qd.height+tb,0);Wc.o(Math.max(db,Wc.width),Math.max(zb,Wc.height))}}if(1===Ge)e.width=db,e.height=zb,w.dk(Wc);else{var Fc=Mm(Yb),He=Nm(Yb),Ib=0,Jb=0;He.x!==
  Fc.x&&He.y!==Fc.y&&(Ib=Wc.width/Math.abs(He.x-Fc.x),Jb=Wc.height/Math.abs(He.y-Fc.y));w.dk(Wc);var sd=0;if(Yb instanceof W){var Xc=Yb,sd=Xc.ib*Xc.scale;zh(Xc)===Jh&&(Ib=Jb=Math.max(Ib,Jb))}var Ib=Ib+(Math.abs(Fc.offsetX)+Math.abs(He.offsetX)+sd),Jb=Jb+(Math.abs(Fc.offsetY)+Math.abs(He.offsetY)+sd),$d=Yb.stretch;$d===fl&&($d=rl(Yb,!1));switch($d){case yh:Fe=xf=0;break;case hd:isFinite(Yd)&&(Ib=Yd);isFinite(Zd)&&(Jb=Zd);break;case hl:isFinite(Yd)&&(Ib=Yd);Fe=0;break;case gl:xf=0,isFinite(Zd)&&(Jb=Zd)}Yb instanceof
  W&&!Yb.ya.J()&&(Xc=Yb,Xc.bh?Xc.Bk=null:Xc.Ta=null);Yb.gp();Xh(Yb,Ib,Jb,xf,Fe);e.width=Yb.Ga.width+lc;e.height=Yb.Ga.height+Ec}break;case "Table":for(var ae=a,pe=b,sm=c,Di=d,Qa=m.length,Ie=w.lb(),be=w.lb(),pa=0;pa<Qa;pa++){var wa=m[pa],Yc=wa instanceof z?wa:null;if(null===Yc||Yc.type!==wl&&Yc.type!==xl||!wa.visible)Ie.push(wa);else{t&&(Yc.ya.J()&&w.m(Yc.toString()+" TableRow/TableColumn Panels cannot have a desiredSize set: "+Yc.ya.toString()),Yc.Re.L(J.on)||w.m(Yc.toString()+" TableRow/TableColumn Panels cannot have a minSize set: "+
  Yc.Re.toString()),Yc.Pd.L(J.DB)||w.m(Yc.toString()+" TableRow/TableColumn Panels cannot have a maxSize set: "+Yc.Pd.toString()));be.push(wa);for(var Tg=Yc.Ca.q,Ah=Tg.length,Zc=0;Zc<Ah;Zc++){var Bh=Tg[Zc];Yc.type===wl?Bh.qc=wa.qc:Yc.type===xl&&(Bh.column=wa.column);Ie.push(Bh)}}}Qa=Ie.length;0===Qa&&(this.jd(0),this.hd(0));for(var Zb=[],pa=0;pa<Qa;pa++)wa=Ie[pa],sl(wa,!0),ul(wa,!0),Zb[wa.qc]||(Zb[wa.qc]=[]),Zb[wa.qc][wa.column]||(Zb[wa.qc][wa.column]=[]),Zb[wa.qc][wa.column].push(wa);w.xa(Ie);for(var Ug=
  w.lb(),$c=w.lb(),qe=w.lb(),Pc={count:0},td={count:0},Gc=ae,ud=pe,Uf=this.Ed,Qa=Uf.length,pa=0;pa<Qa;pa++){var ka=Uf[pa];void 0!==ka&&(ka.Ua=0)}Uf=this.xd;Qa=Uf.length;for(pa=0;pa<Qa;pa++)ka=Uf[pa],void 0!==ka&&(ka.Ua=0);for(var re=Zb.length,Je=0,pa=0;pa<re;pa++)Zb[pa]&&(Je=Math.max(Je,Zb[pa].length));for(var Xj=Math.min(this.Ci,re-1),Yj=Math.min(this.pi,Je-1),Hc=0,re=Zb.length,pa=Xj;pa<re;pa++)if(Zb[pa]){var Je=Zb[pa].length,lb=this.jd(pa);lb.Ua=0;for(Zc=Yj;Zc<Je;Zc++)if(Zb[pa][Zc]){var mb=this.hd(Zc);
  void 0===Ug[Zc]&&(mb.Ua=0,Ug[Zc]=!0);for(var Zj=Zb[pa][Zc],Vf=Zj.length,ug=0;ug<Vf;ug++)if(wa=Zj[ug],wa.visible||wa===this.hc){var vg=1<wa.Dj||1<wa.fj;vg&&$c.push(wa);var Rb=wa.margin,Wf=Rb.right+Rb.left,Xf=Rb.top+Rb.bottom,ce=Jl(wa,lb,mb,!1),se=wa.ya,tm=!isNaN(se.height),Ch=!isNaN(se.width)&&tm;vg||ce===yh||Ch||(void 0===Pc[Zc]&&(Pc[Zc]=-1,Pc.count++),void 0===td[pa]&&(td[pa]=-1,td.count++),qe.push(wa));Xh(wa,Infinity,Infinity,0,0);var Ke=wa.Ga,df=Math.max(Ke.width+Wf,0),Kd=Math.max(Ke.height+Xf,
  0);1!==wa.Dj||ce!==yh&&ce!==hl||(ka=this.jd(pa),Hc=Math.max(Kd-ka.Ua,0),Hc>ud&&(Hc=ud),ka.Ua+=Hc,ud=Math.max(ud-Hc,0));1!==wa.fj||ce!==yh&&ce!==gl||(ka=this.hd(Zc),Hc=Math.max(df-ka.Ua,0),Hc>Gc&&(Hc=Gc),ka.Ua+=Hc,Gc=Math.max(Gc-Hc,0));vg&&wa.gp()}}}w.xa(Ug);for(var wc=0,de=0,Qa=this.et,pa=0;pa<Qa;pa++)void 0!==this.xd[pa]&&(wc+=this.hd(pa).Db);Qa=this.Xt;for(pa=0;pa<Qa;pa++)void 0!==this.Ed[pa]&&(de+=this.jd(pa).Db);for(var Gc=Math.max(ae-wc,0),ak=ud=Math.max(pe-de,0),bk=Gc,Qa=qe.length,pa=0;pa<Qa;pa++){var wa=
  qe[pa],lb=this.jd(wa.qc),mb=this.hd(wa.column),Ei=wa.Ga,Rb=wa.margin,Wf=Rb.right+Rb.left,Xf=Rb.top+Rb.bottom;Pc[wa.column]=0===mb.Ua?Math.max(Ei.width+Wf,Pc[wa.column]):null;td[wa.qc]=0===lb.Ua?Math.max(Ei.height+Xf,td[wa.qc]):null}var Vg=0,Ic=0;for(pa in td)"count"!==pa&&(Vg+=td[pa]);for(pa in Pc)"count"!==pa&&(Ic+=Pc[pa]);for(var ub=w.Hl(),pa=0;pa<Qa;pa++)if(wa=qe[pa],wa.visible||wa===this.hc){var lb=this.jd(wa.qc),mb=this.hd(wa.column),te=0;isFinite(mb.width)?te=mb.width:(te=isFinite(Gc)&&null!==
  Pc[wa.column]?0===Ic?mb.Ua+Gc:Pc[wa.column]/Ic*bk:null!==Pc[wa.column]?Gc:mb.Ua||Gc,te=Math.max(0,te-mb.ug()));var Qc=0;isFinite(lb.height)?Qc=lb.height:(Qc=isFinite(ud)&&null!==td[wa.qc]?0===Vg?lb.Ua+ud:td[wa.qc]/Vg*ak:null!==td[wa.qc]?ud:lb.Ua||ud,Qc=Math.max(0,Qc-lb.ug()));ub.o(Math.max(mb.Wh,Math.min(te,mb.Af)),Math.max(lb.Wh,Math.min(Qc,lb.Af)));ce=Jl(wa,lb,mb,!1);switch(ce){case hl:ub.height=Infinity;break;case gl:ub.width=Infinity}Rb=wa.margin;Wf=Rb.right+Rb.left;Xf=Rb.top+Rb.bottom;wa.gp();
  Xh(wa,ub.width,ub.height,mb.Wh,lb.Wh);Ke=wa.Ga;df=Math.max(Ke.width+Wf,0);Kd=Math.max(Ke.height+Xf,0);isFinite(Gc)&&(df=Math.min(df,ub.width));isFinite(ud)&&(Kd=Math.min(Kd,ub.height));var Wg=0,Wg=lb.Ua;lb.Ua=Math.max(lb.Ua,Kd);Hc=lb.Ua-Wg;ud=Math.max(ud-Hc,0);Wg=mb.Ua;mb.Ua=Math.max(mb.Ua,df);Hc=mb.Ua-Wg;Gc=Math.max(Gc-Hc,0)}w.xa(qe);for(var Le=w.Hl(),Qa=$c.length,pa=0;pa<Qa;pa++)if(wa=$c[pa],wa.visible||wa===this.hc){lb=this.jd(wa.qc);mb=this.hd(wa.column);ub.o(Math.max(mb.Wh,Math.min(ae,mb.Af)),
  Math.max(lb.Wh,Math.min(pe,lb.Af)));ce=Jl(wa,lb,mb,!1);switch(ce){case hd:0!==mb.Ua&&(ub.width=Math.min(ub.width,mb.Ua));0!==lb.Ua&&(ub.height=Math.min(ub.height,lb.Ua));break;case hl:0!==mb.Ua&&(ub.width=Math.min(ub.width,mb.Ua));break;case gl:0!==lb.Ua&&(ub.height=Math.min(ub.height,lb.Ua))}isFinite(mb.width)&&(ub.width=mb.width);isFinite(lb.height)&&(ub.height=lb.height);Le.o(0,0);for(var Sb=1;Sb<wa.Dj&&!(wa.qc+Sb>=this.Xt);Sb++)ka=this.jd(wa.qc+Sb),Le.height+=Math.max(ka.Wh,isNaN(ka.af)?ka.Af:
  Math.min(ka.af,ka.Af));for(Sb=1;Sb<wa.fj&&!(wa.column+Sb>=this.et);Sb++)ka=this.hd(wa.column+Sb),Le.width+=Math.max(ka.Wh,isNaN(ka.af)?ka.Af:Math.min(ka.af,ka.Af));ub.width+=Le.width;ub.height+=Le.height;Rb=wa.margin;Wf=Rb.right+Rb.left;Xf=Rb.top+Rb.bottom;Xh(wa,ub.width,ub.height,sm,Di);for(var Ke=wa.Ga,df=Math.max(Ke.width+Wf,0),Kd=Math.max(Ke.height+Xf,0),Dh=0,Sb=0;Sb<wa.Dj&&!(wa.qc+Sb>=this.Xt);Sb++)ka=this.jd(wa.qc+Sb),Dh+=ka.total||0;if(Dh<Kd)for(var Ld=Kd-Dh;0<Ld;){var Md=ka.Db||0;isNaN(ka.height)&&
  ka.Af>Md&&(ka.Ua=Math.min(ka.Af,Md+Ld),ka.Db!==Md&&(Ld-=ka.Db-Md));if(-1===ka.index-1)break;ka=this.jd(ka.index-1)}for(var Yf=0,Sb=0;Sb<wa.fj&&!(wa.column+Sb>=this.et);Sb++)ka=this.hd(wa.column+Sb),Yf+=ka.total||0;if(Yf<df)for(Ld=df-Yf;0<Ld;){Md=ka.Db||0;isNaN(ka.width)&&ka.Af>Md&&(ka.Ua=Math.min(ka.Af,Md+Ld),ka.Db!==Md&&(Ld-=ka.Db-Md));if(-1===ka.index-1)break;ka=this.hd(ka.index-1)}}w.xa($c);w.dk(Le);w.dk(ub);for(var Zf=0,ef=0,ce=rl(this,!0),Nd=this.ya,$f=this.Pd,ue=de=wc=0,vd=0,Qa=this.et,pa=0;pa<
  Qa;pa++)void 0!==this.xd[pa]&&(ka=this.hd(pa),isFinite(ka.width)?(ue+=ka.width,ue+=ka.ug()):Om(ka)===Pm?(ue+=ka.Db,ue+=ka.ug()):0!==ka.Db&&(wc+=ka.Db,wc+=ka.ug()));var Zf=isFinite(Nd.width)?Math.min(Nd.width,$f.width):ce!==yh&&isFinite(ae)?ae:wc,Zf=Math.max(Zf,this.Re.width),Zf=Math.max(Zf-ue,0),Eh=Math.max(Zf/wc,1);isFinite(Eh)||(Eh=1);for(pa=0;pa<Qa;pa++)void 0!==this.xd[pa]&&(ka=this.hd(pa),isFinite(ka.width)||Om(ka)===Pm||(ka.Ua=ka.Db*Eh),ka.position=e.width,0!==ka.Db&&(e.width+=ka.Db,e.width+=
  ka.ug()));Qa=this.Xt;for(pa=0;pa<Qa;pa++)void 0!==this.Ed[pa]&&(ka=this.jd(pa),isFinite(ka.height)?(vd+=ka.height,vd+=ka.ug()):Om(ka)===Pm?(vd+=ka.Db,vd+=ka.ug()):0!==ka.Db&&(de+=ka.Db,de+=ka.ug()));var ef=isFinite(Nd.height)?Math.min(Nd.height,$f.height):ce!==yh&&isFinite(pe)?pe:de,ef=Math.max(ef,this.Re.height),ef=Math.max(ef-vd,0),ag=Math.max(ef/de,1);isFinite(ag)||(ag=1);for(pa=0;pa<Qa;pa++)void 0!==this.Ed[pa]&&(ka=this.jd(pa),isFinite(ka.height)||Om(ka)===Pm||(ka.Ua=ka.Db*ag),ka.position=e.height,
  0!==ka.Db&&(e.height+=ka.Db,e.height+=ka.ug()));Qa=be.length;for(pa=0;pa<Qa;pa++){var $b=be[pa];$b.type===wl?(te=e.width,ka=this.jd($b.qc),Qc=ka.Ua):(ka=this.hd($b.column),te=ka.Ua,Qc=e.height);$b.Uc.o(0,0,te,Qc);sl($b,!1);Zb[$b.qc]||(Zb[$b.qc]=[]);Zb[$b.qc][$b.column]||(Zb[$b.qc][$b.column]=[]);Zb[$b.qc][$b.column].push($b)}w.xa(be);this.ns=Zb;break;case "Viewbox":var wg=a,xg=b,yf=c,Fi=d;1<m.length&&w.m("Viewbox Panel cannot contain more than one GraphObject.");var Me=m[0];Me.ec=1;Me.gp();Xh(Me,
  Infinity,Infinity,yf,Fi);var Gi=Me.Ga,dk=Me.margin,Np=dk.right+dk.left,Op=dk.top+dk.bottom;if(isFinite(wg)||isFinite(xg)){var Vr=Me.scale,ek=Gi.width,fk=Gi.height,Pp=Math.max(wg-Np,0),Qp=Math.max(xg-Op,0),Hi=1;this.Co===Jh?0!==ek&&0!==fk&&(Hi=Math.min(Pp/ek,Qp/fk)):0!==ek&&0!==fk&&(Hi=Math.max(Pp/ek,Qp/fk));0===Hi&&(Hi=1E-4);Me.ec*=Hi;Vr!==Me.scale&&(sl(Me,!0),Xh(Me,Infinity,Infinity,yf,Fi))}Gi=Me.Ga;e.width=isFinite(wg)?wg:Math.max(Gi.width+Np,0);e.height=isFinite(xg)?xg:Math.max(Gi.height+Op,0);
  break;case "Link":var Rp=m.length,yg=this instanceof tf?this.Nh:this;if(yg instanceof U)if(0===Rp){var gk=this.Lc;bb(gk,0,0);var ee=this.Ga;ee.o(0,0,0,0)}else{var hk=this instanceof tf?null:yg.path,ff=yg.gn,Ne=this.Di;Ne.assign(ff);Ne.x=0;var Fh=Ne.y=0,Ii=yg.points,Fh=void 0!==this.oa?this.oa:Ii.count;this.Yg.o(ff.x,ff.y);this.ej.clear();null!==hk&&(Qm(hk,ff.width,ff.height),ee=hk.Ga,Ne.$h(ee),this.ej.add(ee));for(var Gh=w.mh(),Ji=w.M(),bg=w.M(),um=0;um<Rp;um++){var Tb=m[um];if(Tb!==hk)if(Tb.Tf&&
  Tb instanceof W)Qm(Tb,ff.width,ff.height),ee=Tb.Ga,Ne.$h(ee),this.ej.add(ee);else if(2>Fh)Xh(Tb,Infinity,Infinity),ee=Tb.Ga,Ne.$h(ee),this.ej.add(ee);else{var cg=Tb.Df,Tp=Tb.Yt,vm=Tb.Fi;vm.ue()&&(vm=Ob);var Ki=Tb.Zt,Wr=Tb.eB,Li=0,Mi=0,ik=0;if(cg<-Fh||cg>=Fh){var Up=yg.EF,Ni=yg.DF;Ki!==jh&&(ik=yg.computeAngle(Tb,Ki,Ni),Tb.angle=ik);Li=Up.x-ff.x;Mi=Up.y-ff.y}else{var zf,Hh;if(0<=cg)zf=Ii.na(cg),Hh=cg<Fh-1?Ii.na(cg+1):zf;else{var wm=Fh+cg;zf=Ii.na(wm);Hh=0<wm?Ii.na(wm-1):zf}Ni=0<=cg?zf.Pi(Hh):Hh.Pi(zf);
  Ki!==jh&&(ik=yg.computeAngle(Tb,Ki,Ni),Tb.vn=ik);Li=zf.x+(Hh.x-zf.x)*Tp-ff.x;Mi=zf.y+(Hh.y-zf.y)*Tp-ff.y}Xh(Tb,Infinity,Infinity);var ee=Tb.Ga,gk=Tb.Ka,Oi=0;Tb instanceof W&&(Oi=Tb.ib);var jk=gk.width+Oi,xm=gk.height+Oi;Gh.reset();Gh.translate(-ee.x,-ee.y);Gh.scale(Tb.scale,Tb.scale);Gh.rotate(Ki===jh?Tb.angle:Ni,jk/2,xm/2);var Ih=new y(0,0,jk,xm);Ji.bu(Ih,vm);Gh.fb(Ji);var Xr=-Ji.x+Oi/2,Yr=-Ji.y+Oi/2;bg.assign(Wr);isNaN(bg.x)&&(bg.x=0<=cg?jk/2+3:-(jk/2+3));isNaN(bg.y)&&(bg.y=-(xm/2+3));bg.rotate(Ni);
  Li+=bg.x;Mi+=bg.y;Ih.set(ee);Ih.x=Li+Xr;Ih.y=Mi+Yr;this.ej.add(Ih);Ne.$h(Ih)}}if(this.Ae)for(var Vp=this.Bg;Vp.next();)Xh(Vp.value,Infinity,Infinity);this.Di=Ne;var ym=this.Yg;ym.o(ym.x+Ne.x,ym.y+Ne.y);bb(e,Ne.width||0,Ne.height||0);w.df(Gh);w.B(Ji);w.B(bg)}break;case "Grid":break;case "TableRow":case "TableColumn":w.m(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:w.m("Unknown panel type: "+n)}}var Oe=e.width,
  Pe=e.height,kk=this.padding,Zr=kk.top+kk.bottom,Oe=Oe+(kk.left+kk.right),Pe=Pe+Zr;isFinite(g.width)&&(Oe=g.width);isFinite(g.height)&&(Pe=g.height);Oe=Math.min(k.width,Oe);Pe=Math.min(k.height,Pe);Oe=Math.max(h.width,Oe);Pe=Math.max(h.height,Pe);Oe=Math.max(c,Oe);Pe=Math.max(d,Pe);e.width=Oe;e.height=Pe;bb(this.Lc,Oe,Pe);ol(this,0,0,Oe,Pe)};
  z.prototype.findMainElement=z.prototype.Qf=function(){if(null===this.xm){var a=this.Ca.q,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.Tf)return this.xm=d}this.xm=a[0]}return this.xm};
  z.prototype.Hi=function(a,b,c,d){var e=this.Di,g=this.Ca.q,h=w.lk(0,0,0,0);if(0===g.length){var k=this.ea;k.x=a;k.y=b;k.width=c;k.height=d}else{if(!this.ya.J()){var l=rl(this,!0),m=this.Uc,n=m.width,p=m.height,q=this.margin,r=q.left+q.right,s=q.top+q.bottom;n===c&&p===d&&(l=yh);switch(l){case yh:if(n>c||p>d)this.T(),Xh(this,n>c?c:n,p>d?d:p);break;case hd:this.T(!0);Xh(this,c+r,d+s,0,0);break;case hl:this.T(!0);Xh(this,c+r,p+s,0,0);break;case gl:this.T(!0),Xh(this,n+r,d+s,0,0)}}k=this.ea;k.x=a;k.y=
  b;k.width=c;k.height=d;var u=this.ha.Xb;switch(u){case "Position":for(var v=g.length,A=e.x-this.padding.left,E=e.y-this.padding.top,B=0;B<v;B++){var G=g[B],O=G.Ga,M=G.margin,X=G.position.x,ja=G.position.y;h.x=isNaN(X)?-A:X-A;h.y=isNaN(ja)?-E:ja-E;if(G instanceof W){var V=G;if(V.sA){var Q=V.ib/2;h.x-=Q;h.y-=Q}}h.x+=M.left;h.y+=M.top;h.width=O.width;h.height=O.height;G.visible&&G.Fc(h.x,h.y,h.width,h.height)}break;case "Vertical":for(var ca=g.length,Pa=this.padding.left,Ha=this.padding.top,Wa=0;Wa<
  ca;Wa++){var Aa=Pa,Ma=g[Wa];if(Ma.visible){var Da=Ma.Ga,hc=Ma.margin,od=hc.left+hc.right,Qf=Pa+this.padding.right,ic=Da.width,bf=rl(Ma,!1);if(isNaN(Ma.ya.width)&&bf===hd||bf===hl)ic=Math.max(e.width-od-Qf,0);var Rf=ic+od+Qf,Za=Ma.alignment;Za.Pc()&&(Za=this.Xj);Za.kd()||(Za=Ob);Ma.Fc(Aa+Za.offsetX+hc.left+(e.width*Za.x-Rf*Za.x),Ha+Za.offsetY+hc.top,ic,Da.height);Ha+=Da.height+hc.bottom+hc.top}}break;case "Horizontal":for(var jb=g.length,Ja=this.padding.top,Ka=this.padding.left,qb=0;qb<jb;qb++){var Lb=
  Ja,fb=g[qb];if(fb.visible){var oc=fb.Ga,me=fb.margin,tc=me.top+me.bottom,Vd=Ja+this.padding.bottom,ne=oc.height,cf=rl(fb,!1);if(isNaN(fb.ya.height)&&cf===hd||cf===gl)ne=Math.max(e.height-tc-Vd,0);var wf=ne+tc+Vd,Wd=fb.alignment;Wd.Pc()&&(Wd=this.Xj);Wd.kd()||(Wd=Ob);fb.Fc(Ka+Wd.offsetX+me.left,Lb+Wd.offsetY+me.top+(e.height*Wd.y-wf*Wd.y),oc.width,ne);Ka+=oc.width+me.left+me.right}}break;case "Spot":var Mb=g.length,Eb=this.Qf(),uc=Eb.Ga,Pg=uc.width,Nb=uc.height,Fb=this.padding,jc=Fb.left,rb=Fb.top;
  h.x=jc-e.x;h.y=rb-e.y;Eb.Fc(h.x,h.y,Pg,Nb);for(var Ee=0;Ee<Mb;Ee++){var Xd=g[Ee];if(Xd!==Eb){var tg=Xd.Ga,Sf=tg.width,Gb=tg.height,pd=Xd.alignment;pd.Pc()&&(pd=this.Xj);pd.kd()||(pd=Ob);var vc=Xd.Fi;vc.Pc()&&(vc=Ob);h.x=pd.x*Pg+pd.offsetX-(vc.x*Sf-vc.offsetX);h.y=pd.y*Nb+pd.offsetY-(vc.y*Gb-vc.offsetY);h.x-=e.x;h.y-=e.y;Xd.visible&&Xd.Fc(jc+h.x,rb+h.y,Sf,Gb)}}break;case "Auto":var Bb=g.length,Mc=this.Qf(),Qb=Mc.Ga,Va=w.$f();Va.o(0,0,1,1);var kb=Mc.margin,Hb=kb.left,kc=kb.top,Yd=this.padding,Zd=Yd.left,
  xf=Yd.top;h.x=Hb;h.y=kc;h.width=Qb.width;h.height=Qb.height;Mc.Fc(Zd+h.x,xf+h.y,h.width,h.height);var Fe=Mm(Mc),Ge=Nm(Mc),Yb=0+Fe.y*Qb.height+Fe.offsetY,gb=0+Ge.x*Qb.width+Ge.offsetX,lc=0+Ge.y*Qb.height+Ge.offsetY;Va.x=0+Fe.x*Qb.width+Fe.offsetX;Va.y=Yb;nb(Va,gb,lc,0,0);Va.x+=Hb+Zd;Va.y+=kc+xf;for(var Ec=0;Ec<Bb;Ec++){var qd=g[Ec];if(qd!==Mc){var db=qd.Ga,kb=qd.margin,zb=Math.max(db.width+kb.right+kb.left,0),pc=Math.max(db.height+kb.top+kb.bottom,0),rd=qd.alignment;rd.Pc()&&(rd=this.Xj);rd.kd()||
  (rd=Ob);h.x=Va.width*rd.x+rd.offsetX-zb*rd.x+kb.left+Va.x;h.y=Va.height*rd.y+rd.offsetY-pc*rd.y+kb.top+Va.y;h.width=Va.width;h.height=Va.height;qd.visible&&(ob(Va.x,Va.y,Va.width,Va.height,h.x,h.y,db.width,db.height)?qd.Fc(h.x,h.y,db.width,db.height):qd.Fc(h.x,h.y,db.width,db.height,new y(Va.x,Va.y,Va.width,Va.height)))}}w.nc(Va);break;case "Table":for(var Qg=g.length,Rg=this.padding,Sg=Rg.left,Tf=Rg.top,Nc=this.ns,Wc=0,Oc=0,sb=Nc.length,oe=0,tb=0;tb<sb;tb++)Nc[tb]&&(oe=Math.max(oe,Nc[tb].length));
  for(var Fc=Math.min(this.Ci,sb-1);Fc!==sb&&(void 0===this.Ed[Fc]||0===this.Ed[Fc].Db);)Fc++;for(var Fc=Math.min(Fc,sb-1),He=-this.Ed[Fc].Oa,Ib=Math.min(this.pi,oe-1);Ib!==oe&&(void 0===this.xd[Ib]||0===this.xd[Ib].Db);)Ib++;for(var Ib=Math.min(Ib,oe-1),Jb=-this.xd[Ib].Oa,sd=w.Hl(),tb=0;tb<sb;tb++)if(Nc[tb])for(var oe=Nc[tb].length,Xc=this.jd(tb),Oc=Xc.Oa+He+Tf+Xc.gE(),$d=0;$d<oe;$d++)if(Nc[tb][$d])for(var ae=this.hd($d),Wc=ae.Oa+Jb+Sg+ae.gE(),pe=Nc[tb][$d],sm=pe.length,Di=0;Di<sm;Di++){var Qa=pe[Di],
  Ie=Qa.Ga,be=Qa instanceof z?Qa:null;if(null===be||be.type!==wl&&be.type!==xl){sd.o(0,0);for(var pa=1;pa<Qa.rowSpan&&!(tb+pa>=this.Xt);pa++){var wa=this.jd(tb+pa);sd.height+=wa.total}for(pa=1;pa<Qa.eE&&!($d+pa>=this.et);pa++){var Yc=this.hd($d+pa);sd.width+=Yc.total}var Tg=ae.Db+sd.width,Ah=Xc.Db+sd.height;h.x=Wc;h.y=Oc;h.width=Tg;h.height=Ah;var Zc=Wc,Bh=Oc,Zb=Tg,Ug=Ah;Wc+Tg>e.width&&(Zb=Math.max(e.width-Wc,0));Oc+Ah>e.height&&(Ug=Math.max(e.height-Oc,0));var $c=Qa.alignment,qe=0,Pc=0,td=0,Gc=0;if($c.Pc()){$c=
  this.Xj;$c.kd()||($c=Ob);var qe=$c.x,Pc=$c.y,td=$c.offsetX,Gc=$c.offsetY,ud=ae.alignment,Uf=Xc.alignment;ud.kd()&&(qe=ud.x,td=ud.offsetX);Uf.kd()&&(Pc=Uf.y,Gc=Uf.offsetY)}else qe=$c.x,Pc=$c.y,td=$c.offsetX,Gc=$c.offsetY;if(isNaN(qe)||isNaN(Pc))Pc=qe=.5,Gc=td=0;var ka=Ie.width,re=Ie.height,Je=Qa.margin,Xj=Je.left+Je.right,Yj=Je.top+Je.bottom,Hc=Jl(Qa,Xc,ae,!1);!isNaN(Qa.ya.width)||Hc!==hd&&Hc!==hl||(ka=Math.max(Tg-Xj,0));!isNaN(Qa.ya.height)||Hc!==hd&&Hc!==gl||(re=Math.max(Ah-Yj,0));var lb=Qa.Pd,mb=
  Qa.Re,ka=Math.min(lb.width,ka),re=Math.min(lb.height,re),ka=Math.max(mb.width,ka),re=Math.max(mb.height,re),Zj=re+Yj;h.x+=h.width*qe-(ka+Xj)*qe+td+Je.left;h.y+=h.height*Pc-Zj*Pc+Gc+Je.top;Qa.visible&&(ob(Zc,Bh,Zb,Ug,h.x,h.y,Ie.width,Ie.height)?Qa.Fc(h.x,h.y,ka,re):Qa.Fc(h.x,h.y,ka,re,new y(Zc,Bh,Zb,Ug)))}else{Qa.Vg();Qa.bc.Na();var Vf=Qa.bc;Vf.x=be.type===wl?Sg:Wc;Vf.y=be.type===xl?Tf:Oc;Vf.width=Ie.width;Vf.height=Ie.height;Qa.bc.freeze();ul(Qa,!1)}}w.dk(sd);for(tb=0;tb<Qg;tb++)Qa=g[tb],be=Qa instanceof
  z?Qa:null,null===be||be.type!==wl&&be.type!==xl||(Vf=Qa.bc,Qa.Lc.Na(),Qa.Lc.o(0,0,Vf.width,Vf.height),Qa.Lc.freeze());break;case "Viewbox":var ug=g[0],vg=ug.Ga,Rb=ug.margin,Wf=Rb.top+Rb.bottom,Xf=Math.max(vg.width+(Rb.right+Rb.left),0),ce=Math.max(vg.height+Wf,0),se=ug.alignment;se.Pc()&&(se=this.Xj);se.kd()||(se=Ob);h.x=e.width*se.x-Xf*se.x+se.offsetX;h.y=e.height*se.y-ce*se.y+se.offsetY;h.width=vg.width;h.height=vg.height;ug.Fc(h.x,h.y,h.width,h.height);break;case "Link":var tm=g.length,Ch=this instanceof
  tf?this.Nh:this;if(Ch instanceof U){var Ke=this instanceof tf?null:Ch.path,df=this.ej.q,Kd=0;if(null!==Ke&&Kd<this.ej.count){var wc=df[Kd];Kd++;Ke.Fc(wc.x-this.Di.x,wc.y-this.Di.y,wc.width,wc.height)}for(var de=0;de<tm;de++){var ak=g[de];ak!==Ke&&Kd<this.ej.count&&(wc=df[Kd],Kd++,ak.Fc(wc.x-this.Di.x,wc.y-this.Di.y,wc.width,wc.height))}var bk=Ch.points,Ei=bk.count;if(2<=Ei&&this.Ae)for(var Vg=this.Bg;Vg.next();){var Ic=Vg.value,ub=Ei,te=bk,Qc=Ic.Df,Wg=Ic.Yt,Le=Ic.Fi;Le.ue()&&(Le=Ob);var Sb=Ic.Zt,
  Dh=Ic.eB,Ld=0,Md=0,Yf=0;if(Qc<-ub||Qc>=ub){var Zf=this.EF,ef=this.DF;Sb!==jh&&(Yf=this.computeAngle(Ic,Sb,ef),Ic.angle=Yf);Ld=Zf.x;Md=Zf.y}else{var Nd=void 0,$f=void 0;if(0<=Qc)Nd=te.q[Qc],$f=Qc<ub-1?te.q[Qc+1]:Nd;else var ue=ub+Qc,Nd=te.q[ue],$f=0<ue?te.q[ue-1]:Nd;ef=0<=Qc?Nd.Pi($f):$f.Pi(Nd);Sb!==jh&&(Yf=this.computeAngle(Ic,Sb,ef),Ic.angle=Yf);Ld=Nd.x+($f.x-Nd.x)*Wg;Md=Nd.y+($f.y-Nd.y)*Wg}var vd=w.mh();vd.reset();vd.scale(Ic.scale,Ic.scale);vd.rotate(Ic.angle,0,0);var Eh=Ic.Ka,ag=w.lk(0,0,Eh.width,
  Eh.height),$b=w.M();$b.bu(ag,Le);vd.fb($b);var wg=-$b.x,xg=-$b.y,yf=Dh.copy();isNaN(yf.x)&&(yf.x=0<=Qc?$b.x+3:-($b.x+3));isNaN(yf.y)&&(yf.y=-($b.y+3));yf.rotate(ef);Ld+=yf.x;Md+=yf.y;vd.RG(ag);var wg=wg+ag.x,xg=xg+ag.y,Fi=w.ic(Ld+wg,Md+xg);Ic.move(Fi);w.B(Fi);w.B($b);w.nc(ag);w.df(vd)}this instanceof tf?this.Et():Ch.Et()}break;case "Grid":break;case "TableRow":case "TableColumn":w.m(this.toString()+" is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
  break;default:w.m("Unknown panel type: "+u)}w.nc(h)}};z.prototype.Uj=function(a){var b=this.Ka;if(ob(0,0,b.width,b.height,a.x,a.y)){for(var b=this.Ca.q,c=b.length,d=w.ic(0,0);c--;){var e=b[c];if(e.visible||e===this.hc)if(Xa(d.set(a),e.transform),e.Ea(d))return w.B(d),!0}w.B(d);return null===this.Mb&&null===this.tc?!1:!0}return!1};z.prototype.Hw=function(a){if(this.xn===a)return this;for(var b=this.Ca.q,c=b.length,d=0;d<c;d++){var e=b[d].Hw(a);if(null!==e)return e}return null};
  function Rm(a,b,c){c(a,b);if(b instanceof z){b=b.Ca.q;for(var d=b.length,e=0;e<d;e++)Rm(a,b[e],c)}}function Qj(a,b){Sm(a,a,b)}function Sm(a,b,c){c(b);b=b.Ca.q;for(var d=b.length,e=0;e<d;e++){var g=b[e];g instanceof z&&Sm(a,g,c)}}z.prototype.walkVisualTree=function(a){Tm(this,this,a)};function Tm(a,b,c){c(b);if(b instanceof z){b=b.Ca.q;for(var d=b.length,e=0;e<d;e++)Tm(a,b[e],c)}}z.prototype.findInVisualTree=z.prototype.lt=function(a){return Um(this,this,a)};
  function Um(a,b,c){if(c(b))return b;if(b instanceof z){b=b.Ca.q;for(var d=b.length,e=0;e<d;e++){var g=Um(a,b[e],c);if(null!==g)return g}}return null}z.prototype.findObject=z.prototype.qe=function(a){if(this.name===a)return this;for(var b=this.Ca.q,c=b.length,d=0;d<c;d++){var e=b[d];if(e.name===a)return e;if(e instanceof z)if(null===e.oi&&null===e.hg){if(e=e.qe(a),null!==e)return e}else if(wk(e)&&(e=e.Ca.first(),null!==e&&(e=e.qe(a),null!==e)))return e}return null};
  function Vm(a){a=a.Ca.q;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof z)c=Math.max(c,Vm(e));else if(e instanceof W){a:{if(!e.bh)switch(e.Qn){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.dh/2*e.wm*e.Qi()}c=Math.max(c,e)}}return c}f=z.prototype;f.bg=function(){return!(this.type===wl||this.type===xl)};
  f.re=function(a,b,c){if(!1===this.Cf)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Hj(this))return null;var d=this.Ka,e=1/this.Qi(),g=this.bg(),h=g?a:Xa(w.ic(a.x,a.y),this.transform),k=this.h,l=10,m=5;null!==k&&(l=k.fA("extraTouchArea"),m=l/2);if(ob(-(m*e),-(m*e),d.width+l*e,d.height+l*e,h.x,h.y)){if(!this.Wg){var e=this.Ca.q,n=e.length,k=w.M(),m=(l=this.qA)?this.Qf():null;if(l&&(m.bg()?Xa(k.set(a),m.transform):k.set(a),!m.Ea(k)))return w.B(k),g||w.B(h),null;for(;n--;){var p=e[n];if(p.visible||
  p===this.hc)if(p.bg()?Xa(k.set(a),p.transform):k.set(a),!l||p!==m){var q=null;p instanceof z?q=p.re(k,b,c):!0===p.Cf&&p.Ea(k)&&(q=p);if(null!==q&&(null!==b&&(q=b(q)),null!==q&&(null===c||c(q))))return w.B(k),g||w.B(h),q}}w.B(k)}if(null===this.background&&null===this.el)return g||w.B(h),null;a=ob(0,0,d.width,d.height,h.x,h.y)?this:null;g||w.B(h);return a}g||w.B(h);return null};
  f.Vo=function(a,b,c,d){if(!1===this.Cf)return!1;void 0===b&&(b=null);void 0===c&&(c=null);d instanceof D||d instanceof F||(d=new D(P));var e=this.Ka,g=this.bg(),h=g?a:Xa(w.ic(a.x,a.y),this.transform);if(ob(0,0,e.width,e.height,h.x,h.y)){if(!this.Wg){for(var e=this.Ca.q,k=e.length,l=w.M();k--;){var m=e[k];if(m.visible||m===this.hc){m.bg()?Xa(l.set(a),m.transform):l.set(a);var n=m,m=m instanceof z?m:null;(null!==m?m.Vo(l,b,c,d):n.Ea(l))&&!1!==n.Cf&&(null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||d.add(n))}}w.B(l)}g||
  w.B(h);return null!==this.background||null!==this.el}g||w.B(h);return!1};
  f.ck=function(a,b,c,d,e,g){if(!1===this.Cf)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=w.mh(),h.reset());h.multiply(this.transform);if(this.Lm(a,h))return Wm(this,b,c,e),void 0===g&&w.df(h),!0;if(this.zg(a,h)){if(!this.Wg)for(var k=this.Ca.q,l=k.length;l--;){var m=k[l];if(m.visible||m===this.hc){var n=m.ea,p=this.Ka;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof z?m:null;p=w.mh();p.set(h);if(null!==m?m.ck(a,b,c,d,e,p):ql(n,a,d,p))null!==
  b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);w.df(p)}}}void 0===g&&w.df(h);return d}void 0===g&&w.df(h);return!1};function Wm(a,b,c,d){for(var e=a.Ca.q,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.ea,l=a.Ka;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof z&&Wm(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}}
  f.Qm=function(a,b,c,d,e,g){if(!1===this.Cf)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ka,k=this.bg(),l=k?a:Xa(w.ic(a.x,a.y),this.transform),m=k?b:Xa(w.ic(b.x,b.y),this.transform),n=l.Zj(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||Ya(l.x,l.y,0,0,0,h.height)<n||Ya(l.x,l.y,0,h.height,h.width,h.height)<n||Ya(l.x,l.y,h.width,h.height,h.width,0)<n||Ya(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&&Ya(l.x,l.y,0,0,0,h.height)<n&&Ya(l.x,l.y,0,h.height,h.width,h.height)<
  n&&Ya(l.x,l.y,h.width,h.height,h.width,0)<n&&Ya(l.x,l.y,h.width,0,0,0)<n;k||(w.B(l),w.B(m));if(p){if(!this.Wg){k=w.M();l=w.M();m=this.Ca.q;for(n=m.length;n--;){var q=m[n];if(q.visible||q===this.hc){var r=q.ea,s=this.Ka;r.x>s.width||r.y>s.height||0>r.x+r.width||0>r.y+r.height||(q.bg()?(r=q.transform,Xa(k.set(a),r),Xa(l.set(b),r)):(k.set(a),l.set(b)),r=q,q=q instanceof z?q:null,null!==q?!q.Qm(k,l,c,d,e,g):!r.IE(k,l,e))||(null!==c&&(r=c(r)),null===r||null!==d&&!d(r)||g.add(r))}}w.B(k);w.B(l)}return e?
  p:h}return!1};function Mm(a){var b=a.G;if(void 0===b||b===zc)b=null;null===b&&a instanceof W&&(a=a.Ta,null!==a&&(b=a.G));null===b&&(b=Ab);return b}function Nm(a){var b=a.H;if(void 0===b||b===zc)b=null;null===b&&a instanceof W&&(a=a.Ta,null!==a&&(b=a.H));null===b&&(b=Wb);return b}z.prototype.add=z.prototype.add=function(a){w.l(a,P,z,"add:element");this.ce(this.Ca.count,a)};z.prototype.elt=z.prototype.na=function(a){return this.Ca.na(a)};
  z.prototype.insertAt=z.prototype.ce=function(a,b){b instanceof H&&w.m("Cannot add a Part to a Panel: "+b);if(this===b||this.sl(b))this===b&&w.m("Cannot make a Panel contain itself: "+this.toString()),w.m("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.U;null!==c&&c!==this&&w.m("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.ha!==ij||b instanceof W||w.m("Can only add Shapes to a Grid Panel, not: "+b);b.Cl(this);b.lm=null;if(null!==this.ax){var d=b.data;null!==d&&"object"===typeof d&&(null===this.gg&&(this.gg=new ia(Object,z)),this.gg.add(d,b))}var e=this.Ca,d=-1;if(c===this){for(var g=-1,h=this.Ca.q,k=h.length,l=0;l<k;l++)if(h[l]===b){g=l;break}if(-1!==g){if(g===a||g+1>=e.count&&a>=e.count)return;e.md(g);d=g}else w.m("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>
  a||a>e.count)a=e.count;e.ce(a,b);this.T();b.T();null!==b.wd?this.yh=!0:b instanceof z&&!0===b.yh&&(this.yh=!0);c=this.V;null!==c&&(c.Tk=null,c.uj=NaN,this.yh&&c instanceof S&&(c.yh=!0),c.yh&&(c.Wd=null),e=this.h,null!==e&&e.ka.sb||(-1!==d&&c.Hc(ie,"elements",this,b,null,d,null),c.Hc(he,"elements",this,null,b,null,a)))};z.prototype.remove=z.prototype.remove=function(a){w.l(a,P,z,"remove:element");for(var b=this.Ca.q,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.ef(d)};
  z.prototype.removeAt=z.prototype.md=function(a){t&&w.p(a,z,"removeAt:idx");0<=a&&this.ef(a)};z.prototype.ef=function(a){var b=this.Ca,c=b.na(a);c.lm=null;c.Cl(null);if(null!==this.gg){var d=c.data;"object"===typeof d&&this.gg.remove(d)}b.md(a);sl(this,!1);this.T();this.xm===c&&(this.xm=null);b=this.V;null!==b&&(b.Tk=null,b.uj=NaN,d=this.h,null!==d&&d.ka.sb||b.Hc(ie,"elements",this,c,null,a,null))};w.A(z,{Xt:"rowCount"},function(){return void 0===this.Ed?0:this.Ed.length});
  z.prototype.getRowDefinition=z.prototype.jd=function(a){t&&w.p(a,z,"getRowDefinition:idx");0>a&&w.la(a,">= 0",z,"getRowDefinition:idx");a=Math.round(a);var b=this.Ed;if(void 0===b[a]){var c=new af;c.Cl(this);c.ge=!0;c.index=a;b[a]=c}return b[a]};z.prototype.removeRowDefinition=z.prototype.$F=function(a){t&&w.p(a,z,"removeRowDefinition:idx");0>a&&w.la(a,">= 0",z,"removeRowDefinition:idx");a=Math.round(a);var b=this.Ed;this.Hc(ie,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.T()};
  w.A(z,{et:"columnCount"},function(){return void 0===this.xd?0:this.xd.length});z.prototype.getColumnDefinition=z.prototype.hd=function(a){t&&w.p(a,z,"getColumnDefinition:idx");0>a&&w.la(a,">= 0",z,"getColumnDefinition:idx");a=Math.round(a);var b=this.xd;if(void 0===b[a]){var c=new af;c.Cl(this);c.ge=!1;c.index=a;b[a]=c}return b[a]};
  z.prototype.removeColumnDefinition=z.prototype.WF=function(a){t&&w.p(a,z,"removeColumnDefinition:idx");0>a&&w.la(a,">= 0",z,"removeColumnDefinition:idx");a=Math.round(a);var b=this.xd;this.Hc(ie,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.T()};w.g(z,"rowSizing",z.prototype.lG);
  w.defineProperty(z,{lG:"rowSizing"},function(){return void 0===this.qm?Im:this.qm},function(a){if(void 0!==this.qm){var b=this.qm;b!==a&&(a!==Im&&a!==Pm&&w.m("rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"),this.qm=a,this.T(),this.j("rowSizing",b,a))}});w.g(z,"columnSizing",z.prototype.dE);
  w.defineProperty(z,{dE:"columnSizing"},function(){return void 0===this.Pl?Im:this.Pl},function(a){if(void 0!==this.Pl){var b=this.Pl;b!==a&&(a!==Im&&a!==Pm&&w.m("columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"),this.Pl=a,this.T(),this.j("columnSizing",b,a))}});w.g(z,"topIndex",z.prototype.eK);
  w.defineProperty(z,{eK:"topIndex"},function(){return void 0===this.Ci?0:this.Ci},function(a){if(void 0!==this.Ci){var b=this.Ci;b!==a&&((!isFinite(a)||0>a)&&w.m("topIndex must be greater than zero and a real number. Was "+a),this.Ci=a,this.T(),this.j("topIndex",b,a))}});w.g(z,"leftIndex",z.prototype.jJ);
  w.defineProperty(z,{jJ:"leftIndex"},function(){return void 0===this.pi?0:this.pi},function(a){if(void 0!==this.pi){var b=this.pi;b!==a&&((!isFinite(a)||0>a)&&w.m("leftIndex must be greater than zero and a real number. Was "+a),this.pi=a,this.T(),this.j("leftIndex",b,a))}});z.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==Il)return NaN;for(var b=0,c=this.Ed,d=c.length,e=this.Ci;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};
  z.prototype.findColumnForLocalX=function(a){if(0>a)return-1;if(this.type!==Il)return NaN;for(var b=0,c=this.xd,d=c.length,e=this.pi;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};w.g(z,"data",z.prototype.data);
  w.defineProperty(z,{data:"data"},function(){return this.rh},function(a){var b=this.rh;if(b!==a){var c=this instanceof H&&!(this instanceof tf);c&&w.i(a,"object",z,"data");vf(this);this.rh=a;var d=this.h;null!==d&&(c?this instanceof U?(null!==b&&d.Dk.remove(b),null!==a&&d.Dk.add(a,this)):(null!==b&&d.hi.remove(b),null!==a&&d.hi.add(a,this)):(c=this.U,null!==c&&null!==c.gg&&(null!==b&&c.gg.remove(b),null!==a&&c.gg.add(a,this))));this.j("data",b,a);null!==d&&d.ka.sb||null!==a&&this.Rb()}});
  w.g(z,"itemIndex",z.prototype.oF);w.defineProperty(z,{oF:"itemIndex"},function(){return this.hr},function(a){var b=this.hr;b!==a&&(this.hr=a,this.j("itemIndex",b,a))});function Sl(a){a=a.Nl;return null!==a&&a.Qa}
  function vf(a){var b=a.Nl;if(null===b)null!==a.data&&w.m("Template cannot have .data be non-null: "+a),a.Nl=b=new D(kf);else if(b.Qa)return;var c=new D(P);Rm(a,a,function(a,d){var e=d.Kc;if(null!==e)for(Ml(d,!1),e=e.k;e.next();){var g=e.value;g.mode===mf&&Ml(d,!0);if(null!==g.El){var h=nf(g,a,d);null!==h&&(c.add(h),null===h.uo&&(h.uo=new D(kf)),h.uo.add(g))}b.add(g)}if(d instanceof z&&d.type===Il){if(0<d.Ed.length)for(e=d.Ed,g=e.length,h=0;h<g;h++){var k=e[h];if(void 0!==k&&null!==k.Kc)for(var l=
  k.Kc.k;l.next();){var v=l.value;v.og=k;v.sz=2;v.Xv=k.index;b.add(v)}}if(0<d.xd.length)for(e=d.xd,g=e.length,h=0;h<g;h++)if(k=e[h],void 0!==k&&null!==k.Kc)for(l=k.Kc.k;l.next();)v=l.value,v.og=k,v.sz=1,v.Xv=k.index,b.add(v)}});for(var d=c.k;d.next();){var e=d.value;if(null!==e.uo){Ml(e,!0);for(var g=e.uo.k;g.next();){var h=g.value;null===e.Kc&&(e.Kc=new D(kf));e.Kc.add(h)}}e.uo=null}for(d=b.k;d.next();)if(e=d.value,g=e.og,null!==g){e.og=null;var k=e.Vp,l=k.indexOf(".");0<l&&g instanceof z&&(h=k.substring(0,
  l),k=k.substr(l+1),l=g.qe(h),null!==l?(g=l,e.Vp=k):w.trace('Warning: unable to find GraphObject named "'+h+'" for Binding: '+e.toString()));g instanceof af?(e.kk=w.Yc(g.U),g.U.xn=e.kk):(e.kk=w.Yc(g),g.xn=e.kk)}b.freeze();a instanceof H&&(a.Kd()&&(Xh(a,Infinity,Infinity),a.Fc()),t&&!Xm&&Rm(a,a,function(a,c){if(c instanceof z&&(c.type===ej||c.type===wh)&&1>=c.elements.count&&!(c instanceof H)){if(1===c.elements.count){var d=null!==c.ax;if(!d)for(var e=b.k;e.next();)if("itemArray"===e.value.Vp){d=!0;
  break}}d||(w.trace("Auto or Spot Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),Xm=!0)}}))}var Xm=!1;
  z.prototype.updateTargetBindings=z.prototype.Rb=function(a){var b=this.Nl;if(null!==b)for(void 0===a&&(a=""),b=b.k;b.next();){var c=b.value,d=c.mB;if(""===a||""===d||d===a)if(d=c.Vp,null!==c.jE||""!==d){var d=this.data,e=c.El;if(null!==e)d=""===e?this:"."===e?this:".."===e?this:this.qe(e);else{var g=this.h;null!==g&&c.Xp&&(d=g.fa.yp)}if(null===d)t&&w.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.kk;if(-1!==h){if(g=this.Hw(h),null===g)continue}else null!==
  c.og&&(g=c.og);"."===e?d=g:".."===e&&(d=g.U);e=c.sz;if(0!==e){if(!(g instanceof z))continue;h=g;1===e?g=h.hd(c.Xv):2===e&&(g=h.jd(c.Xv))}void 0!==g&&c.XG(g,d)}}}};w.g(z,"itemArray",z.prototype.ax);
  w.defineProperty(z,{ax:"itemArray"},function(){return this.oi},function(a){var b=this.oi;if(b!==a){t&&null!==a&&!w.isArray(a)&&w.m("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.h;null!==c&&null!==b&&Uj(c,this);this.oi=a;null!==c&&null!==a&&Rj(c,this);this.j("itemArray",b,a);null!==c&&c.ka.sb||this.QA()}});function wk(a){return a.type===wh||a.type===ej||a.type===gh||a.type===Il&&0<a.Ca.length&&(a=a.Ca.na(0),a.Tf&&a instanceof z&&(a.type===wl||a.type===xl))?!0:!1}
  z.prototype.rebuildItemElements=z.prototype.QA=function(){var a=0;for(wk(this)&&(a=1);this.Ca.length>a;)this.ef(a);a=this.ax;if(null!==a)for(var b=w.vb(a),c=0;c<b;c++)vk(this,w.jb(a,c),c)};function vk(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){vf(d);d=d.copy();"object"===typeof b&&(null===a.gg&&(a.gg=new ia(Object,z)),a.gg.add(b,d));var e=c;wk(a)&&e++;a.ce(e,d);xk(a,e,c);d.data=b}}}
  function xk(a,b,c){for(a=a.Ca;b<a.length;){var d=a.na(b);if(d instanceof z){var e=b,g=c;d.type===wl?d.qc=e:d.type===xl&&(d.column=e);d.oF=g}b++;c++}}function Pi(a){a=a.Ca.q;for(var b=a.length,c=0;c<b;c++){var d=a[c];if(d instanceof Ym||d instanceof z&&Pi(d))return!0}return!1}w.g(z,"itemTemplate",z.prototype.fJ);
  w.defineProperty(z,{fJ:"itemTemplate"},function(){return null===this.hg?null:this.hg.Aa("")},function(a){if(null===this.hg){if(null===a)return;this.hg=new ia("string",z)}var b=this.hg.Aa("");b!==a&&(w.l(a,z,z,"itemTemplate"),(a instanceof H||a.Tf)&&w.m("itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.hg.add("",a),this.j("itemTemplate",b,a),a=this.h,null!==a&&a.ka.sb||this.QA())});w.g(z,"itemTemplateMap",z.prototype.pF);
  w.defineProperty(z,{pF:"itemTemplateMap"},function(){return this.hg},function(a){var b=this.hg;if(b!==a){w.l(a,ia,z,"itemTemplateMap");for(var c=a.k;c.next();){var d=c.value;(d instanceof H||d.Tf)&&w.m("Template in itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.hg=a;this.j("itemTemplateMap",b,a);a=this.h;null!==a&&a.ka.sb||this.QA()}});w.g(z,"itemCategoryProperty",z.prototype.eJ);
  w.defineProperty(z,{eJ:"itemCategoryProperty"},function(){return this.co},function(a){var b=this.co;b!==a&&("string"!==typeof a&&"function"!==typeof a&&w.sc(a,"string or function",z,"itemCategoryProperty"),this.co=a,this.j("itemCategoryProperty",b,a))});
  z.prototype.getCategoryForItemData=function(a){if(null===a)return"";var b=this.co,c="";if("function"===typeof b)c=b(a);else if("string"===typeof b&&"object"===typeof a){if(""===b)return"";c=w.xb(a,b)}else return"";if(void 0===c)return"";if("string"===typeof c)return c;w.m("Panel.getCategoryForItemData found a non-string category for "+a+": "+c);return""};var Zm=!1,$m=null;
  z.prototype.findTemplateForItemData=function(a,b,c){a=this.pF;b=null;null!==a&&(b=a.Aa(c));null===b&&(Zm||(Zm=!0,w.trace('No item template Panel found for category "'+c+'" on '+this),w.trace("  Using default item template."),c=new z,a=new oa,a.bind(new kf("text","",je)),c.add(a),$m=c),b=$m);return b};w.g(z,"isAtomic",z.prototype.YI);w.defineProperty(z,{YI:"isAtomic"},function(){return this.Wg},function(a){var b=this.Wg;b!==a&&(w.i(a,"boolean",z,"isAtomic"),this.Wg=a,this.j("isAtomic",b,a))});
  w.g(z,"isClipping",z.prototype.qA);w.defineProperty(z,{qA:"isClipping"},function(){return this.Tq},function(a){var b=this.Tq;b!==a&&(w.i(a,"boolean",z,"isClipping"),this.Tq=a,this.j("isClipping",b,a))});function af(){w.jc(this);this.ah=null;this.hv=!0;this.Ad=0;this.af=NaN;this.yj=0;this.wj=Infinity;this.ye=zc;this.Oa=this.Db=0;this.Kc=null;this.zs=an;this.Kh=fl;this.ws=this.Gj=null;this.xs=NaN;this.Mb=this.Gh=null;this.tq=!1}w.ja("RowColumnDefinition",af);
  af.prototype.copy=function(){var a=new af;a.hv=this.hv;a.Ad=this.Ad;a.af=this.af;a.yj=this.yj;a.wj=this.wj;a.ye=this.ye;a.Db=this.Db;a.Oa=this.Oa;a.Kh=this.Kh;a.zs=this.zs;a.Gj=null===this.Gj?null:this.Gj.ba();a.ws=this.ws;a.xs=this.xs;a.Gh=null;null!==this.Gh&&(a.Gh=w.il(this.Gh));a.Mb=this.Mb;a.tq=this.tq;a.Kc=this.Kc;return a};
  af.prototype.gt=function(a){w.l(a,af,af,"copyFrom:pd");a.ge?this.height=a.height:this.width=a.width;this.Wh=a.Wh;this.Af=a.Af;this.alignment=a.alignment;this.stretch=a.stretch;this.Qp=a.Qp;this.Gj=null===a.Gj?null:a.Gj.ba();this.hn=a.hn;this.jn=a.jn;this.Gh=null;a.Gh&&(this.Gh=w.il(a.Gh));this.background=a.background;this.xw=a.xw;this.Kc=a.Kc};af.prototype.toString=function(){return"RowColumnDefinition "+(this.ge?"(Row ":"(Column ")+this.index+") #"+w.Yc(this)};var an;
  af.Default=an=w.w(af,"Default",0);var Pm;af.None=Pm=w.w(af,"None",1);var Im;af.ProportionalExtra=Im=w.w(af,"ProportionalExtra",2);af.prototype.Cl=function(a){this.ah=a};af.prototype.computeEffectiveSpacingTop=af.prototype.gE=function(){var a=0;if(0!==this.index){var b=this.ah,c=this.hn;null===c&&null!==b&&(c=this.ge?b.ii:b.sh);null!==c&&(a=this.jn,isNaN(a)&&(a=null!==b?this.ge?b.uh:b.th:0))}b=this.fB;if(null===b)if(b=this.ah,null!==b)b=b.gj;else return a;return a+(this.ge?b.top:b.left)};
  af.prototype.computeEffectiveSpacing=af.prototype.ug=function(){var a=0;if(0!==this.index){var b=this.ah,c=this.hn;null===c&&null!==b&&(c=this.ge?b.ii:b.sh);null!==c&&(a=this.jn,isNaN(a)&&(a=null!==b?this.ge?b.uh:b.th:0))}b=this.fB;if(null===b)if(b=this.ah,null!==b)b=b.gj;else return a;return a+(this.ge?b.top+b.bottom:b.left+b.right)};
  af.prototype.Wc=function(a,b,c,d,e){var g=this.ah;if(null!==g&&(g.Hc(fe,a,this,b,c,d,e),null!==this.Kc&&(b=g.Xo(),null!==b&&(b=b.data,null!==b))))for(c=this.Kc.k;c.next();)c.value.Jx(this,b,a,null)};w.A(af,{U:"panel"},function(){return this.ah});w.defineProperty(af,{ge:"isRow"},function(){return this.hv},function(a){this.hv=a});w.defineProperty(af,{index:"index"},function(){return this.Ad},function(a){this.Ad=a});w.g(af,"height",af.prototype.height);
  w.defineProperty(af,{height:"height"},function(){return this.af},function(a){var b=this.af;b!==a&&(t&&w.i(a,"number",af,"height"),0>a&&w.la(a,">= 0",af,"height"),this.af=a,this.Ua=this.Db,null!==this.U&&this.U.T(),this.Wc("height",b,a))});w.g(af,"width",af.prototype.width);
  w.defineProperty(af,{width:"width"},function(){return this.af},function(a){var b=this.af;b!==a&&(t&&w.i(a,"number",af,"width"),0>a&&w.la(a,">= 0",af,"width"),this.af=a,this.Ua=this.Db,null!==this.U&&this.U.T(),this.Wc("width",b,a))});w.g(af,"minimum",af.prototype.Wh);
  w.defineProperty(af,{Wh:"minimum"},function(){return this.yj},function(a){var b=this.yj;b!==a&&(t&&w.i(a,"number",af,"minimum"),(0>a||!isFinite(a))&&w.la(a,">= 0",af,"minimum"),this.yj=a,this.Ua=this.Db,null!==this.U&&this.U.T(),this.Wc("minimum",b,a))});w.g(af,"maximum",af.prototype.Af);
  w.defineProperty(af,{Af:"maximum"},function(){return this.wj},function(a){var b=this.wj;b!==a&&(t&&w.i(a,"number",af,"maximum"),0>a&&w.la(a,">= 0",af,"maximum"),this.wj=a,this.Ua=this.Db,null!==this.U&&this.U.T(),this.Wc("maximum",b,a))});w.g(af,"alignment",af.prototype.alignment);w.defineProperty(af,{alignment:"alignment"},function(){return this.ye},function(a){var b=this.ye;b.L(a)||(t&&w.l(a,K,af,"alignment"),this.ye=a.ba(),null!==this.U&&this.U.T(),this.Wc("alignment",b,a))});
  w.g(af,"stretch",af.prototype.stretch);w.defineProperty(af,{stretch:"stretch"},function(){return this.Kh},function(a){var b=this.Kh;b!==a&&(t&&w.za(a,P,af,"stretch"),this.Kh=a,null!==this.U&&this.U.T(),this.Wc("stretch",b,a))});w.g(af,"separatorPadding",af.prototype.fB);
  w.defineProperty(af,{fB:"separatorPadding"},function(){return this.Gj},function(a){"number"===typeof a?a=new eb(a):null!==a&&t&&w.l(a,eb,af,"separatorPadding");var b=this.Gj;null!==a&&null!==b&&b.L(a)||(null!==a&&(a=a.ba()),this.Gj=a,null!==this.U&&this.U.T(),this.Wc("separatorPadding",b,a))});w.g(af,"separatorStroke",af.prototype.hn);
  w.defineProperty(af,{hn:"separatorStroke"},function(){return this.ws},function(a){var b=this.ws;b!==a&&(null===a||"string"===typeof a||a instanceof ea)&&(a instanceof ea&&a.freeze(),this.ws=a,null!==this.U&&this.U.T(),this.Wc("separatorStroke",b,a))});w.g(af,"separatorStrokeWidth",af.prototype.jn);w.defineProperty(af,{jn:"separatorStrokeWidth"},function(){return this.xs},function(a){var b=this.xs;b!==a&&(this.xs=a,null!==this.U&&this.U.T(),this.Wc("separatorStrokeWidth",b,a))});
  w.g(af,"separatorDashArray",af.prototype.sG);
  w.defineProperty(af,{sG:"separatorDashArray"},function(){return this.Gh},function(a){var b=this.Gh;if(b!==a){null===a||Array.isArray(a)||w.sc(a,"Array",af,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||w.m("separatorDashArray:value "+g+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.Gh=a;null!==this.U&&this.U.pa();this.Wc("separatorDashArray",b,a)}});w.g(af,"background",af.prototype.background);
  w.defineProperty(af,{background:"background"},function(){return this.Mb},function(a){var b=this.Mb;b!==a&&(null===a||"string"===typeof a||a instanceof ea)&&(a instanceof ea&&a.freeze(),this.Mb=a,null!==this.U&&this.U.pa(),this.Wc("background",b,a))});w.g(af,"coversSeparators",af.prototype.xw);
  w.defineProperty(af,{xw:"coversSeparators"},function(){return this.tq},function(a){var b=this.tq;b!==a&&(w.i(a,"boolean",af,"coversSeparators"),this.tq=a,null!==this.U&&this.U.pa(),this.Wc("coversSeparators",b,a))});w.g(af,"sizing",af.prototype.Qp);w.defineProperty(af,{Qp:"sizing"},function(){return this.zs},function(a){var b=this.zs;b!==a&&(t&&w.za(a,af,af,"sizing"),this.zs=a,null!==this.U&&this.U.T(),this.Wc("sizing",b,a))});
  function Om(a){if(a.Qp===an){var b=a.ah;return a.ge?b.lG:b.dE}return a.Qp}w.defineProperty(af,{Ua:"actual"},function(){return this.Db},function(a){this.Db=isNaN(this.af)?Math.max(Math.min(this.wj,a),this.yj):Math.max(Math.min(this.wj,this.af),this.yj)});w.defineProperty(af,{total:"total"},function(){return this.Db+this.ug()},function(a){this.Db=isNaN(this.af)?Math.max(Math.min(this.wj,a),this.yj):Math.max(Math.min(this.wj,this.af),this.yj);this.Db=Math.max(0,this.Db-this.ug())});
  w.defineProperty(af,{position:"position"},function(){return this.Oa},function(a){this.Oa=a});af.prototype.bind=af.prototype.bind=function(a){a.og=this;var b=this.U;null!==b&&(b=b.Xo(),null!==b&&Sl(b)&&w.m("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a));null===this.Kc&&(this.Kc=new D(kf));this.Kc.add(a)};
  function W(){P.call(this);this.Ta=null;this.Qn="None";this.bh=!1;this.Kq=fl;this.Bk=null;this.Ec=this.nd="black";this.dh=1;this.xo="butt";this.yo="miter";this.wm=10;this.vm=null;this.gd=0;this.Ai=this.zi=zc;this.Tr=this.Sr=NaN;this.Uq=!1;this.$q=!0;this.Wr=null;this.Tn=this.zo="None";this.Rq=1}w.Ia(W,P);w.ja("Shape",W);
  W.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.Ta=this.Ta;a.Qn=this.Qn;a.bh=this.bh;a.Kq=this.Kq;a.Bk=this.Bk;a.nd=this.nd;a.Ec=this.Ec;a.dh=this.dh;a.xo=this.xo;a.yo=this.yo;a.wm=this.wm;a.vm=null;null!==this.vm&&(a.vm=w.il(this.vm));a.gd=this.gd;a.zi=this.zi.ba();a.Ai=this.Ai.ba();a.Sr=this.Sr;a.Tr=this.Tr;a.Uq=this.Uq;a.$q=this.$q;a.Wr=this.Wr;a.zo=this.zo;a.Tn=this.Tn;a.Rq=this.Rq};
  W.prototype.toString=function(){return"Shape("+("None"!==this.Bb?this.Bb:"None"!==this.ln?this.ln:this.Lw)+")#"+w.Yc(this)};
  function bn(a,b,c,d){var e=.001,g=d.Ga,h=g.width,g=g.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,u=q=0,v=w.lb(),A=2;A<e;A+=2)m=c[A],n=c[A+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),u+=q,k=m,l=n;k=c[0];l=c[1];c=0;for(var e=h,n=h/2,A=0===n?!1:!0,q=0,m=v[q],p=m[0],s=m[1],r=m[2],m=m[3],E=0;.1<=u;){0===E&&(A?(e=h,c++,e-=n,u-=n,A=!1):(e=h,c++),0===e&&(e=1));if(e>u){w.xa(v);return}e>m?(E=
  e-m,e=m):E=0;var B=Math.sqrt(e*e/(1+r*r));0>p&&(B=-B);k+=B;l+=r*B;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(g/2));0===E&&d.bk(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);u-=e;m-=e;if(0!==E){q++;if(q===v.length){w.xa(v);return}m=v[q];p=m[0];s=m[1];r=m[2];m=m[3];e=E}}w.xa(v)}}
  W.prototype.bk=function(a,b){if(null!==this.Ec||null!==this.nd){null!==this.nd&&Bl(this,a,this.nd,!0,!1);null!==this.Ec&&Bl(this,a,this.Ec,!1,!1);var c=this.dh;if(0===c){var d=this.V;d instanceof tf&&d.type===gh&&d.wc instanceof W&&(c=d.wc.ib)}a.lineWidth=c;a.lineJoin=this.yo;a.lineCap=this.xo;a.miterLimit=this.wm;var e=!1;this.V&&b.Fh.drawShadows&&(e=this.V.Ti);var g=!0;null!==this.Ec&&null===this.nd&&(g=!1);var d=!1,h=!0,k=this.Gx;null!==k&&(d=!0,void 0!==a.setLineDash?(a.setLineDash(k),a.lineDashOffset=
  this.gd):void 0!==a.webkitLineDash?(a.webkitLineDash=k,a.webkitLineDashOffset=this.gd):void 0!==a.mozDash?(a.mozDash=k,a.mozDashOffset=this.gd):h=!1);var l=this.Ta;if(null!==l){if(l.ha===id)a.beginPath(),d&&!h?ml(a,l.lc,l.vc,l.nb,l.zb,k,this.gd):(a.moveTo(l.lc,l.vc),a.lineTo(l.nb,l.zb)),null!==this.nd&&Cl(a,this.nd),0!==c&&null!==this.Ec&&El(a);else if(l.ha===jd){var m=l.lc,n=l.vc,p=l.nb,q=l.zb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.nd&&(a.beginPath(),a.rect(l,
  r,m,n),Cl(a,this.nd));if(null!==this.Ec){var s=p=0,u=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);d&&!h?(h=w.lb(),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(),cn(a,h,k,this.gd),El(a),w.xa(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),El(a));g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.ha===kd)m=l.lc,n=l.vc,p=l.nb,q=l.zb,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+J.wa*l,n-r,m+l,n-J.wa*r,m+l,n),a.bezierCurveTo(m+l,n+J.wa*r,m+J.wa*l,n+r,m,n+r),a.bezierCurveTo(m-J.wa*l,n+r,m-l,n+J.wa*r,m-l,n),a.bezierCurveTo(m-l,n-J.wa*r,m-J.wa*l,n-r,m,n-r),a.closePath(),null!==this.nd&&Cl(a,this.nd),d&&!h&&(h=w.lb(),J.He(m,n-r,m+J.wa*l,n-r,m+l,n-J.wa*r,m+l,n,.5,h),J.He(m+l,n,m+l,n+J.wa*r,m+J.wa*l,n+r,m,n+r,.5,h),J.He(m,n+r,m-J.wa*l,n+r,m-l,n+J.wa*r,m-l,n,.5,h),J.He(m-l,n,
  m-l,n-J.wa*r,m-J.wa*l,n-r,m,n-r,.5,h),a.beginPath(),cn(a,h,k,this.gd),w.xa(h)),0!==c&&null!==this.Ec&&(u=s=p=0,g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),El(a),g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u));else if(l.ha===fd){r=l.ij;n=r.length;for(q=0;q<n;q++){m=r.q[q];a.beginPath();a.moveTo(m.ra,m.sa);for(var p=m.Fa.q,s=p.length,v=null,u=0;u<s;u++){var A=p[u];switch(A.ha){case Ed:a.moveTo(A.D,A.F);break;case md:a.lineTo(A.D,
  A.F);break;case Fd:a.bezierCurveTo(A.fd,A.Ce,A.mg,A.ng,A.nb,A.zb);break;case Gd:a.quadraticCurveTo(A.fd,A.Ce,A.nb,A.zb);break;case Hd:if(A.radiusX===A.radiusY)v=Math.PI/180,a.arc(A.fd,A.Ce,A.radiusX,A.lh*v,(A.lh+A.Yh)*v,0>A.Yh);else for(var v=Jd(A,m),E=v.length,B=0;B<E;B++){var G=v[B];0===B&&a.lineTo(G[0],G[1]);a.bezierCurveTo(G[2],G[3],G[4],G[5],G[6],G[7])}break;case Id:B=E=0;null!==v&&v.type===Hd?(v=Jd(v,m),v=v[v.length-1]||null,null!==v&&(E=v[6],B=v[7])):(E=null!==v?v.D:m.ra,B=null!==v?v.F:m.sa);
  v=Od(A,m,E,B);E=v.length;for(B=0;B<E;B++)G=v[B],a.bezierCurveTo(G[2],G[3],G[4],G[5],G[6],G[7]);break;default:w.m("Segment not of valid type")}A.Ah&&a.closePath();v=A}e?(u=s=p=0,m.ao?(!0===m.Xl&&null!==this.nd?(Cl(a,this.nd),g=!0):g=!1,0!==c&&null!==this.Ec&&(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),d&&!h||El(a),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u))):(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=
  0,a.shadowOffsetY=0,a.shadowBlur=0),!0===m.Xl&&null!==this.nd&&Cl(a,this.nd),0!==c&&null!==this.Ec&&(d&&!h||El(a)),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u))):(!0===m.Xl&&null!==this.nd&&Cl(a,this.nd),0===c||null===this.Ec||d&&!h||El(a))}if(d&&!h)for(c=g,g=l.ij,h=g.length,l=0;l<h;l++){r=g.q[l];a.beginPath();n=w.lb();n.push(r.ra);n.push(r.sa);q=r.ra;m=r.sa;p=q;s=m;u=r.Fa.q;A=u.length;for(v=0;v<A;v++){E=u[v];switch(E.ha){case Ed:cn(a,n,k,this.gd);n.length=0;n.push(E.D);n.push(E.F);q=E.D;
  m=E.F;p=q;s=m;break;case md:n.push(E.D);n.push(E.F);q=E.D;m=E.F;break;case Fd:J.He(q,m,E.fd,E.Ce,E.mg,E.ng,E.nb,E.zb,.5,n);q=E.D;m=E.F;break;case Gd:J.Hp(q,m,E.fd,E.Ce,E.nb,E.zb,.5,n);q=E.D;m=E.F;break;case Hd:for(var B=Jd(E,r),G=B.length,O=0;O<G;O++){var M=B[O];J.He(q,m,M[2],M[3],M[4],M[5],M[6],M[7],.5,n);q=M[6];m=M[7]}break;case Id:B=Od(E,r,q,m);G=B.length;for(O=0;O<G;O++)M=B[O],J.He(q,m,M[2],M[3],M[4],M[5],M[6],M[7],.5,n),q=M[6],m=M[7];break;default:w.m("Segment not of valid type")}E.Ah&&(n.push(p),
  n.push(s),cn(a,n,k,this.gd))}cn(a,n,k,this.gd);w.xa(n);null!==this.Ec&&(q=n=r=0,c&&e&&(r=a.shadowOffsetX,n=a.shadowOffsetY,q=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),El(a),c&&e&&(a.shadowOffsetX=r,a.shadowOffsetY=n,a.shadowBlur=q))}}d&&(void 0!==a.setLineDash?(a.setLineDash(w.nh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=w.nh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0));if(null!==this.JA){d=this.JA;Xh(d,Infinity,Infinity);
  k=d.Ga;d.Fc(0,0,k.width,k.height);a.save();k=this.Xc.pb.first();a.beginPath();c=w.lb();c.push(k.ra);c.push(k.sa);e=k.ra;g=k.sa;h=e;l=g;r=k.Fa.q;n=r.length;for(q=0;q<n;q++){m=r[q];switch(m.ha){case Ed:bn(a,b,c,d);c.length=0;c.push(m.D);c.push(m.F);e=m.D;g=m.F;h=e;l=g;break;case md:c.push(m.D);c.push(m.F);e=m.D;g=m.F;break;case Fd:J.He(e,g,m.fd,m.Ce,m.mg,m.ng,m.nb,m.zb,.5,c);e=m.D;g=m.F;break;case Gd:J.Hp(e,g,m.fd,m.Ce,m.nb,m.zb,.5,c);e=m.D;g=m.F;break;case Hd:p=Jd(m,k);s=p.length;for(u=0;u<s;u++)A=
  p[u],J.He(e,g,A[2],A[3],A[4],A[5],A[6],A[7],.5,c),e=A[6],g=A[7];break;case Id:p=Od(m,k,e,g);s=p.length;for(u=0;u<s;u++)A=p[u],J.He(e,g,A[2],A[3],A[4],A[5],A[6],A[7],.5,c),e=A[6],g=A[7];break;default:w.m("Segment not of valid type")}m.Ah&&(c.push(h),c.push(l),bn(a,b,c,d))}bn(a,b,c,d);w.xa(c);a.restore()}}}};
  function cn(a,b,c,d){var e=.001,g=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)ml(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=w.lb(),u=2;u<e;u+=2)l=b[u],m=b[u+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%g],u=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%g],b++,u&&(d%=e,e-=d,u=!1));e>r&&(e=r);e>l?(v=e-l,e=l):v=0;var A=Math.sqrt(e*e/
  (1+q*q));0>n&&(A=-A);h+=A;k+=q*A;m?a.lineTo(h,k):a.moveTo(h,k);r-=e;l-=e;if(0!==v){p++;if(p===s.length){w.xa(s);return}l=s[p];n=l[0];q=l[1];l=l[2];e=v}else m=!m}w.xa(s)}}W.prototype.getDocumentPoint=W.prototype.qb=function(a,b){void 0===b&&(b=new x);a.ue()&&w.m("getDocumentPoint:s Spot must be real: "+a.toString());var c=this.Ka,d=this.ib;b.o(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY);this.Nf.fb(b);return b};
  W.prototype.Uj=function(a,b){var c=this.Ta;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.kb,e=this.ib/2;c.type!==id||b||(e+=2);var g=w.$f();g.assign(d);g.Sf(e+2,e+2);if(!g.Ea(a))return w.nc(g),!1;d=e+1E-4;if(c.type===id){if(null===this.stroke)return!1;d=(c.D-c.ra)*(a.x-c.ra)+(c.F-c.sa)*(a.y-c.sa);if(0>(c.ra-c.D)*(a.x-c.D)+(c.sa-c.F)*(a.y-c.F)||0>d)return!1;w.nc(g);return J.Od(c.ra,c.sa,c.D,c.F,e,a.x,a.y)}if(c.type===jd){var h=c.ra,k=c.sa,l=c.D,m=c.F,c=Math.min(h,l),n=Math.min(k,
  m),h=Math.abs(l-h),k=Math.abs(m-k);g.x=c;g.y=n;g.width=h;g.height=k;if(null===this.fill){g.Sf(-d,-d);if(g.Ea(a))return w.nc(g),!1;g.Sf(d,d)}null!==this.stroke&&g.Sf(e,e);e=g.Ea(a);w.nc(g);return e}if(c.type===kd){h=c.ra;k=c.sa;l=c.D;m=c.F;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 w.nc(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);w.nc(g);return 0>=h||0>=k?!1:1>=c*c/
  (h*h)+n*n/(k*k)}if(c.type===fd)return w.nc(g),null===this.fill?Rd(c,a.x,a.y,e):c.Ea(a,e,1<this.ib,b);w.m("Unknown Geometry type");return!1};
  W.prototype.wp=function(a,b,c,d){var e=this.ya,g=this.dh;a=Math.max(a,0);b=Math.max(b,0);var h;if(this.bh)h=this.Ta.kb;else{var k=this.Bb,l=J.Sx[k];if(void 0===l){var m=J.xg[k];"string"===typeof m&&(m=J.xg[m]);"function"===typeof m?(l=m(null,100,100),J.Sx[k]=l):w.m("Unsupported Figure:"+k)}h=l.kb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(rl(this,!0)){case yh:d=c=0;break;case hd:m=Math.max(a-g,0);n=Math.max(b-g,0);break;case hl:m=Math.max(a-g,0);d=0;break;case gl:c=0,n=Math.max(b-g,0)}isFinite(e.width)&&
  (m=e.width);isFinite(e.height)&&(n=e.height);e=this.Pd;h=this.Re;c=Math.max(c,h.width)-g;d=Math.max(d,h.height)-g;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=zh(this);switch(c){case yh:break;case hd:k=m;l=n;break;case Jh:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:w.m(c+" is not a valid geometryStretch.")}if(this.bh){h=this.Xc;d=k;e=l;c=h.copy();h=h.kb;d/=h.width;e/=h.height;isFinite(d)||(d=1);
  isFinite(e)||(e=1);if(1!==d||1!==e)switch(c.type){case id:case jd:case kd:c.ra*=d;c.sa*=e;c.D*=d;c.F*=e;break;case fd:h=c.pb.q;for(var p=h.length,q=0;q<p;q++){var r=h[q];r.ra*=d;r.sa*=e;for(var r=r.Fa.q,s=r.length,u=0;u<s;u++){var v=r[u];switch(v.type){case md:case Ed:v.D*=d;v.F*=e;break;case Fd:v.Ib*=d;v.Ub*=e;v.we*=d;v.xe*=e;v.D*=d;v.F*=e;break;case Gd:v.Ib*=d;v.Ub*=e;v.D*=d;v.F*=e;break;case Hd:v.Da*=d;v.Ra*=e;v.radiusX*=d;void 0!==v.radiusY&&(v.radiusY*=e);break;case Id:v.D*=d;v.F*=e;v.radiusX*=
  d;v.radiusY*=e;break;default:w.m("Unknown Segment type: "+v.type)}}}}this.Ta=c}else if(null===this.Ta||this.Ta.$n!==a-g||this.Ta.Zn!==b-g)this.Ta=J.makeGeometry(this,k,l);h=this.Ta.kb;Infinity===a||Infinity===b?ol(this,h.x-g/2,h.y-g/2,0===a&&0===k?0:h.width+g,0===b&&0===l?0:h.height+g):ol(this,-(g/2),-(g/2),m+g,n+g)};
  function Qm(a,b,c){if(!1!==Gj(a)){a.Uc.Na();var d=a.dh;if(0===d){var e=a.V;e instanceof tf&&e.type===gh&&e.wc instanceof W&&(d=e.wc.ib)}d*=a.ec;ol(a,-(d/2),-(d/2),b+d,c+d);b=a.Uc;c=a.Pd;d=a.Re;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.Uc.freeze();a.Uc.J()||w.m("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Uc.toString());sl(a,!1)}}
  function zh(a){var b=a.dA;return a.bh?b===fl?hd:b:b===fl?J.Sx[a.Bb].td:b}W.prototype.Hi=function(a,b,c,d){tl(this,a,b,c,d)};W.prototype.getNearestIntersectionPoint=W.prototype.pl=function(a,b,c){return this.cp(a.x,a.y,b.x,b.y,c)};
  W.prototype.cp=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy),g=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.ib/2,p=this.Ta;null===p&&(Xh(this,Infinity,Infinity),p=this.Ta);q=p.kb;n=!1;if(p.type===id)if(1.5>=this.ib)n=J.ih(p.lc,p.vc,p.nb,p.zb,g,h,k,l,e);else{var r=0,s=0;p.lc===p.nb?(r=m,s=0):(b=(p.zb-p.vc)/(p.nb-p.lc),s=m/Math.sqrt(1+b*b),r=s*b);d=w.lb();b=new x;J.ih(p.lc+
  r,p.vc+s,p.nb+r,p.zb+s,g,h,k,l,b)&&d.push(b);b=new x;J.ih(p.lc-r,p.vc-s,p.nb-r,p.zb-s,g,h,k,l,b)&&d.push(b);b=new x;J.ih(p.lc+r,p.vc+s,p.lc-r,p.vc-s,g,h,k,l,b)&&d.push(b);b=new x;J.ih(p.nb+r,p.zb+s,p.nb-r,p.zb-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return w.xa(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],u=(k.x-g)*(k.x-g)+(k.y-h)*(k.y-h);u<s&&(s=u,e.x=k.x,e.y=k.y)}w.xa(d)}else if(p.type===jd)b=q.x-m,n=J.pl(b,q.y-m,q.x+q.width+m,q.y+q.height+m,g,h,k,l,e);else if(p.type===kd)a:if(b=q.copy().Sf(m,
  m),0===b.width)n=J.ih(b.x,b.y,b.x,b.y+b.height,g,h,k,l,e);else if(0===b.height)n=J.ih(b.x,b.y,b.x+b.width,b.y,g,h,k,l,e);else{a=b.width/2;var v=b.height/2;d=b.x+a;b=b.y+v;c=9999;g!==k&&(c=(h-l)/(g-k));if(9999>Math.abs(c)){n=h-b-c*(g-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((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-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=g-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=g,e.y=l):(e.x=g,e.y=b)}n=!0}else if(p.type===fd){var A=0,E=0,B=u=0,q=w.M(),r=k-g,s=l-h,s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.pb.count;r++)for(var G=p.pb.q[r],O=G.Fa,A=G.ra,E=G.sa,M=A,X=E,ja=0;ja<O.count;ja++){var V=O.q[ja],Q=V.type,u=V.D,B=V.F,ca=!1;switch(Q){case Ed:M=u;X=B;break;case md:ca=dn(A,E,u,B,g,h,k,l,q);break;case Fd:var ca=
  V.Ib,Q=V.Ub,Pa=V.we,Ha=V.xe,ca=J.Ys(A,E,ca,Q,Pa,Ha,u,B,g,h,k,l,.5,q);break;case Gd:ca=(A+2*V.Ib)/3;Q=(E+2*V.Ub)/3;Pa=(2*V.Ib+u)/3;Ha=(2*V.Ib+u)/3;ca=J.Ys(A,E,ca,Q,Pa,Ha,u,B,g,h,k,l,.5,q);break;case Hd:case Id:B=V.type===Hd?Jd(V,G):Od(V,G,A,E);Q=B.length;for(Pa=0;Pa<Q;Pa++)v=B[Pa],0===Pa&&dn(A,E,v[0],v[1],g,h,k,l,q)&&(u=en(g,h,q,s,e),u<s&&(s=u,n=!0)),J.Ys(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],g,h,k,l,.5,q)&&(u=en(g,h,q,s,e),u<s&&(s=u,n=!0));u=v[6];B=v[7];break;default:w.m("Unknown Segment type: "+
  V.type)}A=u;E=B;ca&&(u=en(g,h,q,s,e),u<s&&(s=u,n=!0));V.xt&&(u=M,B=X,dn(A,E,u,B,g,h,k,l,q)&&(u=en(g,h,q,s,e),u<s&&(s=u,n=!0)))}g=c-a;h=d-b;b=Math.sqrt(g*g+h*h);0!==b&&(g/=b,h/=b);e.x-=g*m;e.y-=h*m;w.B(q)}else w.m("Invalid Geometry type");if(!n)return!1;this.transform.fb(e);return!0};function en(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 dn(a,b,c,d,e,g,h,k,l){var m=!1,n=(e-h)*(b-d)-(g-k)*(a-c);if(0===n)return!1;l.x=((e*k-g*h)*(a-c)-(e-h)*(a*d-b*c))/n;l.y=((e*k-g*h)*(b-d)-(g-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||J.rb(l.y,e))&&(l.y<a||J.rb(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||J.rb(l.x,e))&&(l.x<a||J.rb(l.x,a))&&(m=!0));return m}
  W.prototype.containedInRect=W.prototype.Lm=function(a,b){if(void 0===b)return a.Vj(this.ea);var c=this.Ta;null===c&&(Xh(this,Infinity,Infinity),c=this.Ta);var c=c.kb,d=this.ib/2,e=!1,g=w.M();g.o(c.x-d,c.y-d);a.Ea(b.fb(g))&&(g.o(c.x-d,c.bottom+d),a.Ea(b.fb(g))&&(g.o(c.right+d,c.bottom+d),a.Ea(b.fb(g))&&(g.o(c.right+d,c.y-d),a.Ea(b.fb(g))&&(e=!0))));w.B(g);return e};
  W.prototype.intersectsRect=W.prototype.zg=function(a,b){if(this.Lm(a,b)||void 0===b&&(b=this.transform,a.Vj(this.ea)))return!0;var c=w.mh();c.set(b);c.nA();var d=a.left,e=a.right,g=a.top,h=a.bottom,k=w.M();k.o(d,g);c.fb(k);if(this.Uj(k,!0))return w.B(k),!0;k.o(e,g);c.fb(k);if(this.Uj(k,!0))return w.B(k),!0;k.o(d,h);c.fb(k);if(this.Uj(k,!0))return w.B(k),!0;k.o(e,h);c.fb(k);if(this.Uj(k,!0))return w.B(k),!0;var l=w.M(),m=w.M();c.set(b);c.KF(this.transform);c.nA();l.x=e;l.y=g;l.transform(c);k.x=d;k.y=
  g;k.transform(c);var n=!1;fn(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),fn(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),fn(this,k,l,m)?n=!0:(k.x=d,k.y=g,k.transform(c),fn(this,k,l,m)&&(n=!0))));w.B(k);w.df(c);w.B(l);w.B(m);return n};function fn(a,b,c,d){if(!a.pl(b,c,d))return!1;a=b.x;b=b.y;var e=c.x;c=c.y;var g=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 g>=h&&g<=a}
  W.prototype.IE=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.jt(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.Uj(a,!0))return!0;var e=a.Zj(b);b=e;1.5<this.ib&&(e=this.ib/2+Math.sqrt(e),e*=e);var g=this.Ta;null===g&&(Xh(this,Infinity,Infinity),g=this.Ta);if(!c){var h=g.kb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if($a(a.x,a.y,k,l)<=e&&$a(a.x,a.y,m,l)<=e&&$a(a.x,a.y,k,h)<=e&&$a(a.x,a.y,m,h)<=e)return!0}k=g.lc;l=g.vc;m=g.nb;h=g.zb;if(g.type===id){if(c=Ya(a.x,a.y,
  k,l,m,h),g=(k-m)*(a.x-m)+(l-h)*(a.y-h),c<=(0<=(m-k)*(a.x-k)+(h-l)*(a.y-l)&&0<=g?e:b))return!0}else{if(g.type===jd)return b=!1,c&&(b=Ya(a.x,a.y,k,l,k,h)<=e||Ya(a.x,a.y,k,l,m,l)<=e||Ya(a.x,a.y,m,l,m,h)<=e||Ya(a.x,a.y,k,h,m,h)<=e),b;if(g.type===kd){b=a.x-(k+m)/2;var g=a.y-(l+h)/2,n=Math.abs(m-k)/2,p=Math.abs(h-l)/2;if(0===n||0===p)return c=Ya(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=J.CI(n,p,b,g),a*a<=e)return!0}else return $a(b,g,-n,0)>=e||$a(b,g,0,-p)>=e||$a(b,g,0,p)>=e||$a(b,g,n,0)>=e?!1:!0}else if(g.type===
  fd){h=g.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&&Ya(a.x,a.y,k,l,k,h)>e&&Ya(a.x,a.y,k,l,m,l)>e&&Ya(a.x,a.y,m,h,k,h)>e&&Ya(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Rd(g,a.x,a.y,b):g.Ea(a,b,!0))return!0}else{c=g.pb;for(b=0;b<c.count;b++){k=c.q[b];n=k.ra;p=k.sa;if(a.jt(n,p)>e)return!1;l=k.Fa.q;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case Ed:case md:n=q.D;p=q.F;if(a.jt(n,p)>e)return!1;break;case Fd:g=w.lb();J.He(n,p,q.Ib,q.Ub,
  q.we,q.xe,q.D,q.F,.8,g);n=d(g,a);w.xa(g);if(n)return!1;n=q.D;p=q.F;if(a.jt(n,p)>e)return!1;break;case Gd:g=w.lb();J.Hp(n,p,q.Ib,q.Ub,q.D,q.F,.8,g);n=d(g,a);w.xa(g);if(n)return!1;n=q.D;p=q.F;if(a.jt(n,p)>e)return!1;break;case Hd:case Id:var q=q.type===Hd?Jd(q,k):Od(q,k,n,p),r=q.length,s=null,g=w.lb();for(b=0;b<r;b++)if(s=q[b],g.length=0,J.He(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],.8,g),d(g,a))return w.xa(g),!1;w.xa(g);null!==s&&(n=s[6],p=s[7]);break;default:w.m("Unknown Segment type: "+q.type)}}}return!0}}}return!1};
  w.g(W,"geometry",W.prototype.Xc);w.defineProperty(W,{Xc:"geometry"},function(){return this.Bk?this.Bk:this.Ta},function(a){var b=this.Ta;if(b!==a){null!==a?(t&&w.l(a,ed,W,"geometry"),this.Bk=this.Ta=a.freeze()):this.Bk=this.Ta=null;var c=this.V;null!==c&&(c.uj=NaN);this.bh=!0;this.T();this.j("geometry",b,a);a=this.V;null!==a&&0!==(this.ia&1024)&&nl(this,a,"geometryString")}});w.g(W,"geometryString",W.prototype.OE);
  w.defineProperty(W,{OE:"geometryString"},function(){return null===this.Xc?"":this.Xc.toString()},function(a){var b=xd(a);a=b.normalize();this.Xc=b;var b=w.M(),c=this.position;c.J()?b.o(c.x-a.x,c.y-a.y):b.o(-a.x,-a.y);this.position=b;w.B(b)});w.defineProperty(W,{sA:"isGeometryPositioned"},function(){return this.Uq},function(a){t&&w.i(a,"boolean",W,"isGeometryPositioned");var b=this.Uq;b!==a&&(this.Uq=a,this.T(),this.j("isGeometryPositioned",b,a))});
  W.prototype.se=function(){this.bh?this.Bk=null:this.Ta=null;this.T()};w.g(W,"fill",W.prototype.fill);w.defineProperty(W,{fill:"fill"},function(){return this.nd},function(a){var b=this.nd;b!==a&&(t&&null!==a&&w.at(a,"Shape.fill"),a instanceof ea&&a.freeze(),this.nd=a,this.pa(),this.j("fill",b,a))});w.g(W,"stroke",W.prototype.stroke);
  w.defineProperty(W,{stroke:"stroke"},function(){return this.Ec},function(a){var b=this.Ec;b!==a&&(t&&null!==a&&w.at(a,"Shape.stroke"),a instanceof ea&&a.freeze(),this.Ec=a,this.pa(),this.j("stroke",b,a))});w.g(W,"strokeWidth",W.prototype.ib);w.defineProperty(W,{ib:"strokeWidth"},function(){return this.dh},function(a){var b=this.dh;if(b!==a)if(t&&w.p(a,W,"strokeWidth"),0<=a){this.dh=a;this.T();var c=this.V;null!==c&&(c.uj=NaN);this.j("strokeWidth",b,a)}else w.la(a,"value >= 0",W,"strokeWidth:value")});
  w.g(W,"strokeCap",W.prototype.EG);w.defineProperty(W,{EG:"strokeCap"},function(){return this.xo},function(a){var b=this.xo;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?w.la(a,'"butt", "round", or "square"',W,"strokeCap"):(this.xo=a,this.pa(),this.j("strokeCap",b,a)))});w.g(W,"strokeJoin",W.prototype.ZJ);
  w.defineProperty(W,{ZJ:"strokeJoin"},function(){return this.yo},function(a){var b=this.yo;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?w.la(a,'"miter", "bevel", or "round"',W,"strokeJoin"):(this.yo=a,this.pa(),this.j("strokeJoin",b,a)))});w.g(W,"strokeMiterLimit",W.prototype.$J);
  w.defineProperty(W,{$J:"strokeMiterLimit"},function(){return this.wm},function(a){var b=this.wm;if(b!==a)if(t&&w.p(a,W,"strokeMiterLimit"),0<a){this.wm=a;this.pa();var c=this.V;null!==c&&(c.uj=NaN);this.j("strokeMiterLimit",b,a)}else w.la(a,"value > 0",W,"strokeWidth:value")});w.g(W,"strokeDashArray",W.prototype.Gx);
  w.defineProperty(W,{Gx:"strokeDashArray"},function(){return this.vm},function(a){var b=this.vm;if(b!==a){null===a||Array.isArray(a)||w.sc(a,"Array",W,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||w.m("strokeDashArray:value "+g+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.vm=a;this.pa();this.j("strokeDashArray",b,a)}});w.g(W,"strokeDashOffset",W.prototype.FG);
  w.defineProperty(W,{FG:"strokeDashOffset"},function(){return this.gd},function(a){var b=this.gd;b!==a&&(t&&w.p(a,W,"strokeDashOffset"),0<=a&&(this.gd=a,this.pa(),this.j("strokeDashOffset",b,a)))});w.g(W,"figure",W.prototype.Bb);
  w.defineProperty(W,{Bb:"figure"},function(){return this.Qn},function(a){var b=this.Qn;if(b!==a){t&&w.i(a,"string",W,"figure");var c=J.xg[a];"function"===typeof c?c=a:(c=J.xg[a.toLowerCase()])||w.m("Unknown Shape.figure: "+a);b!==c&&(a=this.V,null!==a&&(a.uj=NaN),this.Qn=c,this.bh=!1,this.se(),this.j("figure",b,c))}});w.g(W,"toArrow",W.prototype.ln);
  w.defineProperty(W,{ln:"toArrow"},function(){return this.zo},function(a){var b=this.zo;!0===a?a="Standard":!1===a&&(a="");if(b!==a){t&&w.i(a,"string",W,"toArrow");var c=J.XD(a);null===c?w.m("Unknown Shape.toArrow: "+a):b!==c&&(this.zo=c,this.bh=!1,this.se(),gn(this),this.j("toArrow",b,c))}});w.g(W,"fromArrow",W.prototype.Lw);
  w.defineProperty(W,{Lw:"fromArrow"},function(){return this.Tn},function(a){var b=this.Tn;!0===a?a="Standard":!1===a&&(a="");if(b!==a){t&&w.i(a,"string",W,"fromArrow");var c=J.XD(a);null===c?w.m("Unknown Shape.fromArrow: "+a):b!==c&&(this.Tn=c,this.bh=!1,this.se(),gn(this),this.j("fromArrow",b,c))}});function gn(a){var b=a.h;null!==b&&b.ka.sb||(a.Zt=hn,"None"!==a.zo?(a.Df=-1,a.Fi=Cc):"None"!==a.Tn&&(a.Df=0,a.Fi=new K(1-Cc.x,Cc.y)))}
  w.defineProperty(W,{G:"spot1"},function(){return this.zi},function(a){w.l(a,K,W,"spot1");var b=this.zi;b.L(a)||(this.zi=a=a.ba(),this.T(),this.j("spot1",b,a))});w.defineProperty(W,{H:"spot2"},function(){return this.Ai},function(a){w.l(a,K,W,"spot2");var b=this.Ai;b.L(a)||(this.Ai=a=a.ba(),this.T(),this.j("spot2",b,a))});w.defineProperty(W,{Dc:"parameter1"},function(){return this.Sr},function(a){var b=this.Sr;b!==a&&(this.Sr=a,this.se(),this.j("parameter1",b,a))});
  w.defineProperty(W,{Ot:"parameter2"},function(){return this.Tr},function(a){var b=this.Tr;b!==a&&(this.Tr=a,this.se(),this.j("parameter2",b,a))});w.A(W,{Ka:"naturalBounds"},function(){if(null!==this.Ta)return this.Lc.assign(this.Ta.kb),this.Lc;var a=this.ya;return new y(0,0,a.width,a.height)});w.g(W,"isRectangular",W.prototype.aJ);
  w.defineProperty(W,{aJ:"isRectangular"},function(){return this.$q},function(a){var b=this.$q;b!==a&&(t&&w.i(a,"boolean",W,"isRectangular"),this.$q=a,this.T(),this.j("isRectangular",b,a))});w.g(W,"pathObject",W.prototype.JA);w.defineProperty(W,{JA:"pathObject"},function(){return this.Wr},function(a){var b=this.Wr;b!==a&&(t&&w.l(a,P,W,"pathObject"),this.Wr=a,this.pa(),this.j("pathObject",b,a))});w.g(W,"geometryStretch",W.prototype.dA);
  w.defineProperty(W,{dA:"geometryStretch"},function(){return this.Kq},function(a){var b=this.Kq;b!==a&&(w.za(a,P,W,"geometryStretch"),this.Kq=a,this.j("geometryStretch",b,a))});w.g(W,"interval",W.prototype.interval);w.defineProperty(W,{interval:"interval"},function(){return this.Rq},function(a){var b=this.Rq;t&&w.p(a,W,"interval");a=Math.floor(a);b!==a&&0<=a&&(this.Rq=a,null!==this.h&&Bj(this.h),this.T(),this.j("interval",b,a))});
  W.getFigureGenerators=function(){var a=new ia("string","function"),b;for(b in J.xg)if(b!==b.toLowerCase()){var c=J.xg[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};
  W.defineFigureGenerator=function(a,b){w.i(a,"string",W,"defineFigureGenerator:name");"string"===typeof b?""!==b&&J.xg[b]||w.m("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):w.i(b,"function",W,"defineFigureGenerator:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.m("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);var d=J.xg;d[a]=b;d[c]=a};
  W.getArrowheadGeometries=function(){var a=new ia("string",ed),b;for(b in J.$i)if(b!==b.toLowerCase()){var c=J.$i[b];c instanceof ed&&a.add(b,c)}a.freeze();return a};
  W.defineArrowheadGeometry=function(a,b){w.i(a,"string",W,"defineArrowheadGeometry:name");var c=null;"string"===typeof b?(w.i(b,"string",W,"defineArrowheadGeometry:pathstr"),c=xd(b,!1)):(w.l(b,ed,W,"defineArrowheadGeometry:pathstr"),c=b);var d=a.toLowerCase();""!==a&&"none"!==d&&a!==d||w.m("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var e=J.$i;e[a]=c;e[d]=a};
  function oa(){P.call(this);this.oe="";this.Ec="black";this.Tg="13px sans-serif";this.Xd="start";this.Xq=!0;this.Zl=this.$l=!1;this.Wk=jn;this.zm=kn;this.qv=this.Ye=0;this.Sn=this.Xy=this.Yy=null;this.oj=new ln;this.Eq=!1;this.qf=this.Zk=this.Gs=null;this.Jj=this.Ij=0;this.qi=Infinity}w.Ia(oa,P);w.ja("TextBlock",oa);var mn=new na,nn=0,on=new na,pn=0,qn="...",rn="",sn=w.createElement("canvas").getContext("2d");oa.getEllipsis=function(){return qn};oa.setEllipsis=function(a){qn=a;on=new na;pn=0};
  oa.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.oe=this.oe;a.Ec=this.Ec;a.Tg=this.Tg;a.Xd=this.Xd;a.Xq=this.Xq;a.$l=this.$l;a.Zl=this.Zl;a.zm=this.zm;a.Wk=this.Wk;a.Ye=this.Ye;a.qv=this.qv;a.Yy=this.Yy;a.Xy=this.Xy;a.Sn=this.Sn;a.oj.gt(this.oj);a.Eq=this.Eq;a.Gs=this.Gs;a.Zk=this.Zk;a.qf=this.qf;a.Ij=this.Ij;a.Jj=this.Jj;a.qi=this.qi};oa.prototype.toString=function(){return 22<this.oe.length?'TextBlock("'+this.oe.substring(0,20)+'"...)':'TextBlock("'+this.oe+'")'};
  var tn;oa.None=tn=w.w(oa,"None",0);var un;oa.WrapFit=un=w.w(oa,"WrapFit",1);var kn;oa.WrapDesiredSize=kn=w.w(oa,"WrapDesiredSize",2);var jn;oa.OverflowClip=jn=w.w(oa,"OverflowClip",0);var vn;oa.OverflowEllipsis=vn=w.w(oa,"OverflowEllipsis",1);oa.prototype.T=function(){P.prototype.T.call(this);this.Xy=this.Yy=null};w.g(oa,"font",oa.prototype.font);
  w.defineProperty(oa,{font:"font"},function(){return this.Tg},function(a){var b=this.Tg;b!==a&&(t&&(w.i(a,"string",oa,"font"),wn(a)||w.m('Not a valid font: "'+a+'"')),this.Tg=a,this.Sn=null,this.T(),this.j("font",b,a))});var wn;oa.isValidFont=wn=function(a){var b=sn.font;if(a===b||"10px sans-serif"===a)return!0;sn.font="10px sans-serif";var c;sn.font=a;var d=sn.font;if("10px sans-serif"!==d)return sn.font=b,!0;sn.font="19px serif";c=sn.font;sn.font=a;d=sn.font;sn.font=b;return d!==c};
  w.g(oa,"text",oa.prototype.text);w.defineProperty(oa,{text:"text"},function(){return this.oe},function(a){var b=this.oe;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.oe=a,this.T(),this.j("text",b,a))});w.g(oa,"textAlign",oa.prototype.textAlign);
  w.defineProperty(oa,{textAlign:"textAlign"},function(){return this.Xd},function(a){var b=this.Xd;b!==a&&(t&&w.i(a,"string",oa,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Xd=a,this.pa(),this.j("textAlign",b,a)):w.la(a,'"start", "end", "left", "right", or "center"',oa,"textAlign"))});
  w.A(oa,{Ka:"naturalBounds"},function(){if(!this.Lc.J()){var a=xn(this,this.oe,this.oj,999999).width,b=yn(this,a,this.oj),c=this.ya;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);bb(this.Lc,a,b)}return this.Lc});w.g(oa,"isMultiline",oa.prototype.Zw);w.defineProperty(oa,{Zw:"isMultiline"},function(){return this.Xq},function(a){var b=this.Xq;b!==a&&(t&&w.i(a,"boolean",oa,"isMultiline"),this.Xq=a,this.T(),this.j("isMultiline",b,a))});w.g(oa,"isUnderline",oa.prototype.dJ);
  w.defineProperty(oa,{dJ:"isUnderline"},function(){return this.$l},function(a){var b=this.$l;b!==a&&(t&&w.i(a,"boolean",oa,"isUnderline"),this.$l=a,this.pa(),this.j("isUnderline",b,a))});w.g(oa,"isStrikethrough",oa.prototype.bJ);w.defineProperty(oa,{bJ:"isStrikethrough"},function(){return this.Zl},function(a){var b=this.Zl;b!==a&&(t&&w.i(a,"boolean",oa,"isStrikethrough"),this.Zl=a,this.pa(),this.j("isStrikethrough",b,a))});w.g(oa,"wrap",oa.prototype.uB);
  w.defineProperty(oa,{uB:"wrap"},function(){return this.zm},function(a){var b=this.zm;b!==a&&(t&&w.za(a,oa,oa,"wrap"),this.zm=a,this.T(),this.j("wrap",b,a))});w.g(oa,"overflow",oa.prototype.overflow);w.defineProperty(oa,{overflow:"overflow"},function(){return this.Wk},function(a){var b=this.Wk;b!==a&&(t&&w.za(a,oa,oa,"overflow"),this.Wk=a,this.T(),this.j("overflow",b,a))});w.g(oa,"stroke",oa.prototype.stroke);
  w.defineProperty(oa,{stroke:"stroke"},function(){return this.Ec},function(a){var b=this.Ec;b!==a&&(t&&null!==a&&w.at(a,"TextBlock.stroke"),a instanceof ea&&a.freeze(),this.Ec=a,this.pa(),this.j("stroke",b,a))});w.A(oa,{kJ:"lineCount"},function(){return this.Ye});w.g(oa,"editable",oa.prototype.Cw);w.defineProperty(oa,{Cw:"editable"},function(){return this.Eq},function(a){var b=this.Eq;b!==a&&(t&&w.i(a,"boolean",oa,"editable"),this.Eq=a,this.j("editable",b,a))});w.g(oa,"textEditor",oa.prototype.oB);
  w.defineProperty(oa,{oB:"textEditor"},function(){return this.Gs},function(a){var b=this.Gs;b!==a&&(a instanceof HTMLElement||w.m("textEditor must be an HTMLElement"),this.Gs=a,this.j("textEditor",b,a))});w.g(oa,"errorFunction",oa.prototype.kt);w.defineProperty(oa,{kt:"errorFunction"},function(){return this.qf},function(a){var b=this.qf;b!==a&&(null!==a&&w.i(a,"function",oa,"errorFunction"),this.qf=a,this.j("errorFunction",b,a))});function Al(a,b){var c=a.Tg;null!==c&&b.nu!==c&&(b.font=c,b.nu=c)}
  oa.prototype.bk=function(a,b){if(null!==this.Ec&&0!==this.oe.length&&null!==this.Tg){var c=this.Ka.width,d=zn(this);a.textAlign=this.Xd;Bl(this,a,this.Ec,!0,!1);(this.$l||this.Zl)&&Bl(this,a,this.Ec,!1,!1);var e=this.oj,g=0,h=!1,k=w.ic(0,0);this.Nf.fb(k);var l=w.ic(0,d);this.Nf.fb(l);var m=k.Zj(l);w.B(k);w.B(l);k=b.scale;8>m*k*k&&(h=!0);b.Sg!==a&&(h=!1);!1===b.hA("textGreeking")&&(h=!1);for(var m=this.Ij,k=this.Jj,l=this.Ye,n=0;n<l;n++){var p=e.nf[n],q=e.ze[n];p>c&&(p=c);var g=g+m,r=q,q=a,s=g,u=c,
  v=d,A=0;h?("start"===this.Xd||"left"===this.Xd?A=0:"end"===this.Xd||"right"===this.Xd?A=u-p:"center"===this.Xd?A=(u-p)/2:w.m("textAlign must be start, end, left, right, or center"),q.fillRect(0+A,s+.25*v,p,1)):("start"===this.Xd||"left"===this.Xd?A=0:"end"===this.Xd||"right"===this.Xd?A=u:"center"===this.Xd?A=u/2:w.m("textAlign must be start, end, left, right, or center"),q.fillText(r,0+A,s+v-.25*v),r=v/20|0,0===r&&(r=1),this.$l&&("end"===this.Xd||"right"===this.Xd?A-=p:"center"===this.Xd&&(A-=p/
  2),q.beginPath(),q.lineWidth=r,q.moveTo(0+A,s+v-.2*v),q.lineTo(0+A+p,s+v-.2*v),q.stroke()),this.Zl&&(q.beginPath(),q.lineWidth=r,s=s+v-v/2.2|0,0!==r%2&&(s+=.5),q.moveTo(0,s),q.lineTo(0+p,s),q.stroke()));g+=d+k}}};
  oa.prototype.wp=function(a,b,c,d){var e=this.oj;e.reset();var g=0,h=0;if(isNaN(this.ya.width)){g=this.oe.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.Zw){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=An(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.Tg);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=An(g,this.Tg);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.ya.width;null!==this.U&&(g=Math.min(g,this.U.Pd.width),
  g=Math.max(g,this.U.Re.width));h=yn(this,g,e);m=h=isNaN(this.ya.height)?Math.min(h,b/this.scale):this.ya.height;if(0!==e.Ze&&1!==e.ze.length&&this.Wk===vn&&(b=this.Tg,l=this.Wk===vn?Bn(b):0,k=this.Ij+this.Jj,k=Math.max(0,zn(this)+k),m=Math.max(Math.floor(m/k)-1,0),!(m+1>=e.ze.length))){k=e.ze[m];for(a=Math.max(1,a-l);An(k,b)>a&&1<k.length;)k=k.substr(0,k.length-1);k+=qn;a=An(k,b);e.ze[m]=k;e.ze=e.ze.slice(0,m+1);e.nf[m]=a;e.nf=e.nf.slice(0,m+1);e.Pj=e.ze.length;e.Ze=Math.max(e.Ze,a)}if(this.uB===
  un||isNaN(this.ya.width))g=e.Ze,isNaN(this.ya.width)&&(g=Math.max(8,g));g=Math.max(c,g);h=Math.max(d,h);bb(this.Lc,g,h);ol(this,0,0,g,h)};oa.prototype.Hi=function(a,b,c,d){tl(this,a,b,c,d)};
  function xn(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");var e=0,g=0,h=0,k=a.Tg,g=a.Ij+a.Jj,l=Math.max(0,zn(a)+g),h=a.Wk===vn?Bn(k):0;if(a.Ye>=a.qi)return new fa(0,l);if(a.zm===tn){c.Pj=1;g=An(b,k);if(0===h||g<=d)return c.Ze=g,c.nf.push(c.Ze),c.ze.push(b),new fa(g,l);var m=Cn(b);b=b.substr(m.length);for(var n=Cn(b),g=An(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Cn(b),g=An((m+n).replace(/^\s+|\s+$/g,""),k);m+=n.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-h);An(m,k)>d&&1<m.length;)m=m.substr(0,
  m.length-1);m+=qn;h=An(m,k);c.nf.push(h);c.Ze=h;c.ze.push(m);return new fa(h,l)}var p=0;0===b.length&&(p=1,c.nf.push(0),c.ze.push(b));for(;0<b.length;){m=Cn(b);for(b=b.substr(m.length);An(m,k)>d;){n=1;g=An(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=An(m.substr(0,n),k);1===n?(c.nf[a.Ye+p]=g,e=Math.max(e,g)):(c.nf[a.Ye+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.ze[a.Ye+p]=m.substr(0,n);p++;m=m.substr(n);if(a.Ye+p>a.qi)break}n=Cn(b);for(g=An(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Cn(b),g=An((m+
  n).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");if(""!==m&&(0===n.length?(c.nf.push(g),e=Math.max(e,g)):(h=An(m,k),c.nf.push(h),e=Math.max(e,h)),c.ze.push(m),p++,a.Ye+p>a.qi))break}c.Pj=Math.min(a.qi,p);c.Ze=Math.max(c.Ze,e);return new fa(c.Ze,l*c.Pj)}function Cn(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 An(a,b){rn!==b&&(rn=sn.font=b);return sn.measureText(a).width}
  function zn(a){if(null!==a.Sn)return a.Sn;var b=a.Tg;rn!==b&&(rn=sn.font=b);var c=0;void 0!==mn[b]&&5E3>nn?c=mn[b]:(c=1.3*sn.measureText("M").width,mn[b]=c,nn++);return a.Sn=c}function Bn(a){rn!==a&&(rn=sn.font=a);var b=0;void 0!==on[a]&&5E3>pn?b=on[a]:(b=sn.measureText(qn).width,on[a]=b,pn++);return b}
  function yn(a,b,c){var d=a.oe.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.Ij+a.Jj,e=Math.max(0,zn(a)+e);if(0===d.length)return c.Ze=0,a.Ye=1,e;if(!a.Zw){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=0,h=a.Ye=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.zm!==tn?(c.Pj=0,h=xn(a,h,c,b),g+=h.height,a.Ye+=c.Pj):(xn(a,h,c,b),g+=e,a.Ye++),a.Ye===a.qi&&(l=!0)),h=k+1;return a.qv=g}w.g(oa,"textValidation",oa.prototype.fu);
  w.defineProperty(oa,{fu:"textValidation"},function(){return this.Zk},function(a){var b=this.Zk;b!==a&&(null!==a&&w.i(a,"function",oa,"textValidation"),this.Zk=a,this.j("textValidation",b,a))});w.g(oa,"spacingAbove",oa.prototype.WJ);w.defineProperty(oa,{WJ:"spacingAbove"},function(){return this.Ij},function(a){var b=this.Ij;b!==a&&(t&&w.i(a,"number",oa,"spacingAbove"),this.Ij=a,this.j("spacingAbove",b,a))});w.g(oa,"spacingBelow",oa.prototype.XJ);
  w.defineProperty(oa,{XJ:"spacingBelow"},function(){return this.Jj},function(a){var b=this.Jj;b!==a&&(t&&w.i(a,"number",oa,"spacingBelow"),this.Jj=a,this.j("spacingBelow",b,a))});w.g(oa,"maxLines",oa.prototype.pJ);w.defineProperty(oa,{pJ:"maxLines"},function(){return this.qi},function(a){var b=this.qi;b!==a&&(t&&w.i(a,"number",oa,"maxLines"),a=Math.floor(a),0>=a&&w.la(a,"> 0",oa,"maxLines"),this.qi=a,this.j("maxLines",b,a),this.T())});w.A(oa,{KK:"metrics"},function(){return this.oj});
  function ln(){this.Ze=this.Pj=0;this.nf=[];this.ze=[]}ln.prototype.reset=function(){this.Ze=this.Pj=0;this.nf=[];this.ze=[]};ln.prototype.gt=function(a){this.Pj=a.Pj;this.Ze=a.Ze;this.nf=w.il(a.nf);this.ze=w.il(a.ze)};w.A(ln,{iK:"arrSize"},function(){return this.nf});w.A(ln,{jK:"arrText"},function(){return this.ze});w.A(ln,{JK:"maxLineWidth"},function(){return this.Ze});
  function Xl(){P.call(this);this.Qd=null;this.Bs="";this.Hj=(new y(NaN,NaN,NaN,NaN)).freeze();this.Wn=hd;this.Fs=this.qf=null;this.fv=this.Oq=this.gm=!1;this.Uu=!0;this.to=null;this.PC=0}w.Ia(Xl,P);w.ja("Picture",Xl);var Dn=new na,En=0,Fn=[],Gn=-1,Ui=[],Hn;Xl.clearCache=Hn=function(a){void 0===a&&(a="");w.i(a,"string",Xl,"clearCache:url");""!==a?Dn[a]&&(delete Dn[a],En--):(Dn=new na,En=0)};
  Xl.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.element=this.Qd;a.Bs=this.Bs;a.Hj.assign(this.Hj);a.Wn=this.Wn;a.qf=this.qf;a.to=this.to};Xl.prototype.toString=function(){return"Picture("+this.source+")#"+w.Yc(this)};w.g(Xl,"element",Xl.prototype.element);
  w.defineProperty(Xl,{element:"element"},function(){return this.Qd},function(a){var b=this.Qd;if(b!==a){a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||w.m("Picture.element must be an instance of Image, Canvas, or Video.");this.Oq=!1;var c=this;a instanceof HTMLCanvasElement?this.fv=!0:(this.fv=!1,a.onerror=function(a){c.Oq=!0;null!==c.qf&&c.qf(c,a)});this.Qd=a;!0===a.complete||void 0===a.complete?(this.gm=!0,this.ya.J()||(sl(this,!1),this.T())):(Fn.push(this),
  -1===Gn&&(Gn=w.setInterval(function(){for(var a=[],b=Fn,c=b.length,h=0;h<c;h++){var k=b[h],l;l=k;var m=l.Qd;if(null===m)l=!0;else if(m.complete){l.gm=!0;l.ya.J()||(sl(l,!1),l.T());if(null!==l.h)l.ya.J()||l.h.oc(),l.h.pa();else{l=Ui;var n=l.length;if(0===n)for(var n=window.document.getElementsByTagName("canvas"),p=n.length,m=0;m<p;m++){var q=n[m];q.parentElement&&q.parentElement.Y&&l.push(q.parentElement.Y)}n=l.length;for(m=0;m<n;m++)l[m].pa()}l=!0}else l=!1;l||a.push(k)}0===a.length&&(w.clearInterval(Gn),
  Gn=-1);Fn=a},200)));this.j("element",b,a);this.pa()}});w.g(Xl,"source",Xl.prototype.source);
  w.defineProperty(Xl,{source:"source"},function(){return this.Bs},function(a){var b=this.Bs;if(b!==a){w.i(a,"string",Xl,"source");this.Bs=a;this.Oq=!1;var c=Dn;if(void 0!==c[a])this.element=c[a].Ko[0].source;else{30<En&&(Hn(),c=Dn);var d=w.createElement("img");d.src=a;var e=this.to;null!==e&&(d.crossOrigin=e(this));c[a]=new In(d);En++;d instanceof HTMLImageElement&&(this.element=d)}this.pa();this.j("source",b,a)}});w.g(Xl,"sourceCrossOrigin",Xl.prototype.UJ);
  w.defineProperty(Xl,{UJ:"sourceCrossOrigin"},function(){return this.to},function(a){if(this.to!==a&&(null!==a&&w.i(a,"function",Xl,"sourceCrossOrigin"),this.to=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))}});w.g(Xl,"sourceRect",Xl.prototype.Xh);
  w.defineProperty(Xl,{Xh:"sourceRect"},function(){return this.Hj},function(a){var b=this.Hj;b.L(a)||(w.l(a,y,Xl,"sourceRect"),this.Hj=a=a.ba(),this.pa(),this.j("sourceRect",b,a))});w.g(Xl,"imageStretch",Xl.prototype.$E);w.defineProperty(Xl,{$E:"imageStretch"},function(){return this.Wn},function(a){var b=this.Wn;b!==a&&(w.za(a,P,Xl,"imageStretch"),this.Wn=a,this.pa(),this.j("imageStretch",b,a))});w.g(Xl,"errorFunction",Xl.prototype.kt);
  w.defineProperty(Xl,{kt:"errorFunction"},function(){return this.qf},function(a){var b=this.qf;if(b!==a){null!==a&&w.i(a,"function",Xl,"errorFunction");this.qf=a;if(null!==this.Qd){var c=this;this.Qd.onerror=function(a){null!==c.qf&&c.qf(c,a)}}this.j("errorFunction",b,a)}});
  Xl.prototype.bk=function(a,b){if(this.gm){var c=this.Qd;if(null!==c){var d=c.src;null!==d&&""!==d||w.m("Element has no source attribute: "+c);if(this.Oq){if(!c.complete)return;this.Oq=!1}var d=this.Ka,e=0,g=0,h=this.fv,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){this.Xh.J()&&(e=this.Hj.x,g=this.Hj.y,k=this.Hj.width,h=this.Hj.height);var l=k,m=h,n=this.Wn;
  switch(n){case yh:if(this.Xh.J())break;e+=Math.max((l-d.width)/2,0);g+=Math.max((m-d.height)/2,0);k=Math.min(d.width,l);h=Math.min(d.height,m);break;case hd:l=d.width;m=d.height;break;case Jh:case Kh:var p=0;n===Jh?(p=Math.min(d.height/m,d.width/l),l*=p,m*=p):n===Kh&&(p=Math.max(d.height/m,d.width/l),l*=p,m*=p,e+=(l-d.width)/2,g+=(m-d.height)/2,k*=1/(l/d.width),h*=1/(m/d.height),l=d.width,m=d.height)}this.PC=k*h;var n=this.Qi()*b.scale,q=this.PC/(l*n*m*n),n=Dn[this.source],p=null;if(void 0!==n&&16<
  q){2>n.Ko.length&&(Jn(n,4,k,h),Jn(n,16,k,h));for(var r=n.Ko,s=r.length,p=r[0],u=0;u<s;u++)if(r[u].Rt*r[u].Rt<q)p=r[u];else break}if(!b.Nn){if(null===this.Fs)if(null===this.Qd)this.Fs=!1;else{q=w.createElement("canvas").getContext("2d");q.drawImage(this.Qd,0,0);try{q.getImageData(0,0,1,1),this.Fs=!1}catch(v){this.Fs=!0}}if(this.Fs)return}if(b.Ry||void 0===n||null===p||1===p.Rt)try{a.drawImage(c,e,g,k,h,Math.max((d.width-l)/2,0),Math.max((d.height-m)/2,0),Math.min(d.width,l),Math.min(d.height,m))}catch(A){t&&
  this.Uu&&w.trace(A.toString()),this.Uu=!1}else{a.save();try{a.drawImage(p.source,Math.max((d.width-l)/2,0),Math.max((d.height-m)/2,0),Math.min(d.width,l),Math.min(d.height,m))}catch(E){t&&this.Uu&&w.trace(E.toString()),this.Uu=!1}a.restore()}}}}};w.A(Xl,{Ka:"naturalBounds"},function(){return this.Lc});
  Xl.prototype.wp=function(a,b,c,d){var e=this.ya,g=rl(this,!0),h=this.Qd,k=this.fv;if(k||!this.gm&&h&&h.complete)this.gm=!0;null===h&&(isFinite(a)||(a=0),isFinite(b)||(b=0));isFinite(e.width)||g===hd||g===hl?(isFinite(a)||(a=this.Xh.J()?this.Xh.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.gm&&(a=this.Xh.J()?this.Xh.width:k?+h.width:h.naturalWidth);isFinite(e.height)||g===hd||g===gl?(isFinite(b)||(b=this.Xh.J()?this.Xh.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==this.gm&&(b=
  this.Xh.J()?this.Xh.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.Pd;g=this.Re;c=Math.max(c,g.width);d=Math.max(d,g.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.Lc,a,b);ol(this,0,0,a,b)};Xl.prototype.Hi=function(a,b,c,d){tl(this,a,b,c,d)};function In(a){this.Ko=[new Kn(a,1)]}
  function Jn(a,b,c,d){var e=new ma(null),g=e.getContext("2d"),h=1/b;e.width=c/b;e.height=d/b;b=new Kn(e.Jd,b);c=a.Ko[a.Ko.length-1];g.setTransform(h*c.Rt,0,0,h*c.Rt,0,0);g.drawImage(c.source,0,0);a.Ko.push(b)}function Kn(a,b){this.source=a;this.Rt=b}function ha(){this.s=new ed;this.Wb=null}f=ha.prototype;f.reset=function(){this.s=new ed;this.Wb=null};
  function L(a,b,c,d,e,g){null===a.s&&w.m("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.Wb&&w.m("Need to call beginFigure first"),d=new Pd(Ed),d.D=b,d.F=c,a.Wb.Fa.add(d)):(a.Wb=new gd,a.Wb.ra=b,a.Wb.sa=c,a.Wb.ip=d,a.s.pb.add(a.Wb));void 0!==g&&(a.Wb.ao=g)}function Ad(a){null===a.s&&w.m("StreamGeometryContext has been closed");null===a.Wb&&w.m("Need to call beginFigure first");var b=a.Wb.Fa.length;0<b&&a.Wb.Fa.na(b-1).close()}
  function Bd(a){null===a.s&&w.m("StreamGeometryContext has been closed");null===a.Wb&&w.m("Need to call beginFigure first");0<a.Wb.Fa.length&&(a.Wb.ip=!0)}f.eb=function(a){null===this.s&&w.m("StreamGeometryContext has been closed");null===this.Wb&&w.m("Need to call beginFigure first");this.Wb.Ti=a};f.moveTo=function(a,b,c){void 0===c&&(c=!1);null===this.s&&w.m("StreamGeometryContext has been closed");null===this.Wb&&w.m("Need to call beginFigure first");var d=new Pd(Ed);d.D=a;d.F=b;c&&d.close();this.Wb.Fa.add(d)};
  f.lineTo=function(a,b,c){void 0===c&&(c=!1);null===this.s&&w.m("StreamGeometryContext has been closed");null===this.Wb&&w.m("Need to call beginFigure first");var d=new Pd(md);d.D=a;d.F=b;c&&d.close();this.Wb.Fa.add(d)};function N(a,b,c,d,e,g,h,k){void 0===k&&(k=!1);null===a.s&&w.m("StreamGeometryContext has been closed");null===a.Wb&&w.m("Need to call beginFigure first");var l=new Pd(Fd);l.Ib=b;l.Ub=c;l.we=d;l.xe=e;l.D=g;l.F=h;k&&l.close();a.Wb.Fa.add(l)}
  function yd(a,b,c,d,e){var g;void 0===g&&(g=!1);null===a.s&&w.m("StreamGeometryContext has been closed");null===a.Wb&&w.m("Need to call beginFigure first");var h=new Pd(Gd);h.Ib=b;h.Ub=c;h.D=d;h.F=e;g&&h.close();a.Wb.Fa.add(h)}f.arcTo=function(a,b,c,d,e,g,h){void 0===g&&(g=0);void 0===h&&(h=!1);null===this.s&&w.m("StreamGeometryContext has been closed");null===this.Wb&&w.m("Need to call beginFigure first");var k=new Pd(Hd);k.lh=a;k.Yh=b;k.Da=c;k.Ra=d;k.radiusX=e;k.radiusY=0!==g?g:e;h&&k.close();this.Wb.Fa.add(k)};
  function zd(a,b,c,d,e,g,h,k){var l;void 0===l&&(l=!1);null===a.s&&w.m("StreamGeometryContext has been closed");null===a.Wb&&w.m("Need to call beginFigure first");b=new Pd(Id,h,k,b,c,d,e,g);l&&b.close();a.Wb.Fa.add(b)}
  J.makeGeometry=function(a,b,c){var d=a.ya,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.ln?b=J.$i[a.ln]:"None"!==a.Lw?b=J.$i[a.Lw]:(c=J.xg[a.Bb],"string"===typeof c&&(c=J.xg[c]),void 0===c&&w.m("Unknown Shape.figure: "+a.Bb),b=c(a,e,d),b.$n=e,b.Zn=d);null===b&&(c=J.xg.Rectangle,"function"===typeof c&&(b=c(a,e,d)));return b};
  J.Ki=function(a,b,c,d,e,g,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+g*l;e=e*s+h*l;g=g*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+g*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=g};J.Po=function(a){a=J.Nm(a);var b=w.lb();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;w.xa(a);return b};
  J.Nm=function(a){var b=J.jl(a),c=w.lb(),d=Math.floor(b.length/2),e=b.length-1;a=0===a%2?2:1;for(var g=0;g<e;g++){var h=b[g],k=b[g+1],l=b[(d+g-1)%e],m=b[(d+g+a)%e];c[2*g]=h;c[2*g+1]=J.ol(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new x)}c[c.length]=c[0];w.xa(b);return c};J.ol=function(a,b,c,d,e,g,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(g-k)/m,h=a,n=k*h+(g-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(g-k)/m,a=b-d*a,h=(g-k*e-a)/(d-k),n=d*h+a);l.o(h,n);return l};
  J.jl=function(a){for(var b=w.lb(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new x(.5+.5*Math.cos(d),.5+.5*Math.sin(d));b.push(b[0]);return b};J.zB=(new K(.156,.156)).Ma();J.AB=(new K(.844,.844)).Ma();
  J.xg={None:"Rectangle",Rectangle:function(a,b,c){a=new ed;a.type=jd;a.ra=0;a.sa=0;a.D=b;a.F=c;return a},Square:function(a,b,c){a=new ed;a.td=Jh;a.type=jd;a.ra=0;a.sa=0;a.D=Math.min(b,c);a.F=Math.min(b,c);return a},Ellipse:function(a,b,c){a=new ed;a.type=kd;a.ra=0;a.sa=0;a.D=b;a.F=c;a.G=J.zB;a.H=J.AB;return a},Circle:function(a,b,c){a=new ed;a.td=Jh;a.type=kd;a.ra=0;a.sa=0;a.D=Math.min(b,c);a.F=Math.min(b,c);a.G=J.zB;a.H=J.AB;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new ed;var d=
  new gd,e=new Pd;e.D=b;e.F=.5*c;d.Fa.add(e);b=new Pd;b.D=0;b.F=c;d.Fa.add(b.close());a.pb.add(d);a.G=new K(0,.25);a.H=new K(.5,.75);return a},TriangleDown:function(a,b,c){a=new ed;var d=new gd,e=new Pd;e.D=b;e.F=0;d.Fa.add(e);e=new Pd;e.D=.5*b;e.F=c;d.Fa.add(e.close());a.pb.add(d);a.G=new K(.25,0);a.H=new K(.75,.5);return a},TriangleLeft:function(a,b,c){a=new ed;var d=new gd;d.ra=b;d.sa=c;var e=new Pd;e.D=0;e.F=.5*c;d.Fa.add(e);c=new Pd;c.D=b;c.F=0;d.Fa.add(c.close());a.pb.add(d);a.G=new K(.5,.25);
  a.H=new K(1,.75);return a},TriangleUp:function(a,b,c){a=new ed;var d=new gd;d.ra=b;d.sa=c;var e=new Pd;e.D=0;e.F=c;d.Fa.add(e);c=new Pd;c.D=.5*b;c.F=0;d.Fa.add(c.close());a.pb.add(d);a.G=new K(.25,.5);a.H=new K(.75,1);return a},Line1:function(a,b,c){a=new ed;a.type=id;a.ra=0;a.sa=0;a.D=b;a.F=c;return a},Line2:function(a,b,c){a=new ed;a.type=id;a.ra=b;a.sa=0;a.D=0;a.F=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new ed;a.type=id;a.ra=0;a.sa=c/2;a.D=b;a.F=c/2;return a},LineV:function(a,b,c){a=
  new ed;a.type=id;a.ra=b/2;a.sa=0;a.D=b/2;a.F=c;return a},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(a,b,c){var d=J.wa;a=w.u();L(a,0,0,!1);N(a,d*b,0,1*b,(1-d)*c,b,c);b=a.s;w.v(a);return b},Curve2:function(a,b,c){var d=J.wa;a=w.u();L(a,0,0,!1);N(a,0,d*c,(1-d)*b,c,b,c);b=a.s;w.v(a);return b},Curve3:function(a,b,c){var d=J.wa;a=w.u();L(a,1*b,0,!1);N(a,1*b,d*c,d*b,1*c,0,1*c);b=a.s;w.v(a);return b},Curve4:function(a,b,c){var d=J.wa;a=w.u();L(a,1*b,0,!1);N(a,(1-d)*b,0,0,(1-d)*c,0,1*c);b=a.s;w.v(a);
  return b},Alternative:"Triangle",Merge:"Triangle",Triangle:function(a,b,c){a=w.u();L(a,.5*b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.s;b.G=new K(.25,.5);b.H=new K(.75,1);w.v(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=w.u();L(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.s;b.G=new K(.25,.25);b.H=new K(.75,.75);w.v(a);return b},Pentagon:function(a,b,c){var d=J.jl(5);a=w.u();L(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);
  w.xa(d);Ad(a);b=a.s;b.G=new K(.2,.22);b.H=new K(.8,.9);w.v(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=J.jl(6);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.07,.25);b.H=new K(.93,.75);w.v(a);return b},Heptagon:function(a,b,c){var d=J.jl(7);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.2,.15);b.H=new K(.8,.85);w.v(a);return b},Octagon:function(a,
  b,c){var d=J.jl(8);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.15,.15);b.H=new K(.85,.85);w.v(a);return b},Nonagon:function(a,b,c){var d=J.jl(9);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.17,.13);b.H=new K(.82,.82);w.v(a);return b},Decagon:function(a,b,c){var d=J.jl(10);a=w.u();L(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);w.xa(d);
  Ad(a);b=a.s;b.G=new K(.16,.16);b.H=new K(.84,.84);w.v(a);return b},Dodecagon:function(a,b,c){var d=J.jl(12);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.16,.16);b.H=new K(.84,.84);w.v(a);return b},FivePointedStar:function(a,b,c){var d=J.Nm(5);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.312,.383);b.H=new K(.693,.765);w.v(a);return b},SixPointedStar:function(a,b,
  c){var d=J.Nm(6);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.17,.251);b.H=new K(.833,.755);w.v(a);return b},SevenPointedStar:function(a,b,c){var d=J.Nm(7);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.363,.361);b.H=new K(.641,.709);w.v(a);return b},EightPointedStar:function(a,b,c){var d=J.Nm(8);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.252,.255);b.H=new K(.75,.75);w.v(a);return b},NinePointedStar:function(a,b,c){var d=J.Nm(9);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.355,.361);b.H=new K(.645,.651);w.v(a);return b},TenPointedStar:function(a,b,c){var d=J.Nm(10);a=w.u();L(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.281,.261);b.H=new K(.723,.748);w.v(a);return b},
  FivePointedBurst:function(a,b,c){var d=J.Po(5);a=w.u();L(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.312,.383);b.H=new K(.693,.765);w.v(a);return b},SixPointedBurst:function(a,b,c){var d=J.Po(6);a=w.u();L(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.17,.251);b.H=new K(.833,.755);w.v(a);return b},
  SevenPointedBurst:function(a,b,c){var d=J.Po(7);a=w.u();L(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.363,.361);b.H=new K(.641,.709);w.v(a);return b},EightPointedBurst:function(a,b,c){var d=J.Po(8);a=w.u();L(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.252,.255);b.H=new K(.75,.75);w.v(a);return b},
  NinePointedBurst:function(a,b,c){var d=J.Po(9);a=w.u();L(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.355,.361);b.H=new K(.645,.651);w.v(a);return b},TenPointedBurst:function(a,b,c){var d=J.Po(10);a=w.u();L(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(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);w.xa(d);Ad(a);b=a.s;b.G=new K(.281,.261);b.H=new K(.723,.748);w.v(a);return b},
  Cloud:function(a,b,c){a=w.u();L(a,.08034461*b,.1944299*c,!0);N(a,-.09239631*b,.07836421*c,.1406031*b,-.0542823*c,.2008615*b,.05349299*c);N(a,.2450511*b,-.00697547*c,.3776197*b,-.01112067*c,.4338609*b,.074219*c);N(a,.4539471*b,0,.6066018*b,-.02526587*c,.6558228*b,.07004196*c);N(a,.6914277*b,-.01904177*c,.8921095*b,-.01220843*c,.8921095*b,.08370865*c);N(a,1.036446*b,.04105738*c,1.020377*b,.3022052*c,.9147671*b,.3194596*c);N(a,1.04448*b,.360238*c,.992256*b,.5219009*c,.9082935*b,.562044*c);N(a,1.032337*
  b,.5771781*c,1.018411*b,.8120651*c,.9212406*b,.8217117*c);N(a,1.028411*b,.9571472*c,.8556702*b,1.052487*c,.7592566*b,.9156953*c);N(a,.7431877*b,1.009325*c,.5624123*b,1.021761*c,.5101666*b,.9310455*c);N(a,.4820677*b,1.031761*c,.3030112*b,1.002796*c,.2609328*b,.9344623*c);N(a,.2329994*b,1.01518*c,.03213784*b,1.01518*c,.08034461*b,.870098*c);N(a,-.02812061*b,.9032597*c,-.01205169*b,.6835638*c,.06829292*b,.6545475*c);N(a,-.01812061*b,.6089503*c,-.00606892*b,.4555777*c,.06427569*b,.4265613*c);N(a,-.01606892*
  b,.3892545*c,-.01205169*b,.1944299*c,.08034461*b,.1944299*c);Ad(a);b=a.s;b.G=new K(.1,.1);b.H=new K(.9,.9);w.v(a);return b},Gate:"Crescent",Crescent:function(a,b,c){a=w.u();L(a,0,0,!0);N(a,1*b,0,1*b,1*c,0,1*c);N(a,.5*b,.75*c,.5*b,.25*c,0,0);Ad(a);b=a.s;b.G=new K(.511,.19);b.H=new K(.776,.76);w.v(a);return b},FramedRectangle:function(a,b,c){var d=w.u(),e=a?a.Dc:NaN;a=a?a.Ot:NaN;isNaN(e)&&(e=.1);isNaN(a)&&(a=.1);L(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,!0);L(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.s;b.G=new K(e,a);b.H=new K(1-e,1-a);w.v(d);return b},Delay:"HalfEllipse",HalfEllipse:function(a,b,c){var d=J.wa;a=w.u();L(a,0,0,!0);N(a,d*b,0,1*b,(.5-d/2)*c,1*b,.5*c);N(a,1*b,(.5+d/2)*c,d*b,1*c,0,1*c);Ad(a);b=a.s;b.G=new K(0,.2);b.H=new K(.75,.8);w.v(a);return b},Heart:function(a,b,c){a=w.u();L(a,.5*b,1*c,!0);N(a,.1*b,.8*c,0,.5*c,0*b,.3*c);N(a,0*b,0,.45*b,0,.5*b,.3*c);N(a,.55*b,0,1*b,0,1*b,.3*c);N(a,b,.5*c,.9*b,.8*c,.5*b,1*c);Ad(a);
  b=a.s;b.G=new K(.15,.29);b.H=new K(.86,.68);w.v(a);return b},Spade:function(a,b,c){a=w.u();L(a,.5*b,0,!0);a.lineTo(.51*b,.01*c);N(a,.6*b,.2*c,b,.25*c,b,.5*c);N(a,b,.8*c,.6*b,.8*c,.55*b,.7*c);N(a,.5*b,.75*c,.55*b,.95*c,.75*b,c);a.lineTo(.25*b,c);N(a,.45*b,.95*c,.5*b,.75*c,.45*b,.7*c);N(a,.4*b,.8*c,0,.8*c,0,.5*c);N(a,0,.25*c,.4*b,.2*c,.49*b,.01*c);Ad(a);b=a.s;b.G=new K(.19,.26);b.H=new K(.8,.68);w.v(a);return b},Club:function(a,b,c){a=w.u();L(a,.4*b,.6*c,!0);N(a,.5*b,.75*c,.45*b,.95*c,.15*b,1*c);a.lineTo(.85*
  b,c);N(a,.55*b,.95*c,.5*b,.75*c,.6*b,.6*c);var d=.2,e=.3,g=0,h=4*(Math.SQRT2-1)/3*d;N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);N(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e+.05)*b,(.5-h+g-.02)*c,.65*b,.36771243*c);d=.2;e=0;g=-.3;h=4*(Math.SQRT2-1)/3*d;N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);N(a,(.5+d+e)*b,(.5-h+g)*c,(.5+
  h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,.35*b,.36771243*c);d=.2;e=-.3;g=0;h=4*(Math.SQRT2-1)/3*d;N(a,(.5+d+e-.05)*b,(.5-h+g-.02)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,.4*b,.6*c);Ad(a);b=a.s;b.G=
  new K(.06,.39);b.H=new K(.93,.58);w.v(a);return b},Ring:function(a,b,c){a=w.u();var d=4*(Math.SQRT2-1)/3*.5;L(a,b,.5*c,!0);N(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);N(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);N(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);N(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;L(a,.5*b,.1*c,!0,!0);N(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);N(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);N(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);N(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);b=a.s;b.G=new K(.146,.146);
  b.H=new K(.853,.853);b.td=Jh;w.v(a);return b},YinYang:function(a,b,c){var d=.5;a=w.u();d=.5;L(a,.5*b,0,!0);a.arcTo(270,180,.5*b,.5*b,.5*b);N(a,1*b,d*c,0,d*c,d*b,0,!0);var d=.1,e=.25;L(a,(.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,.5*b,c*e,d*b);Ad(a);L(a,.5*b,0,!1);a.arcTo(270,-180,.5*b,.5*b,.5*b);a.eb(!1);e=.75;L(a,(.5+d)*b,e*c,!0);a.arcTo(0,360,.5*b,c*e,d*b);Ad(a);b=a.s;b.td=Jh;w.v(a);return b},Peace:function(a,b,c){a=w.u();var d=4*(Math.SQRT2-1)/3*.5;L(a,b,.5*c,!0);N(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);N(a,
  (.5-d)*b,0,0,(.5-d)*c,0,.5*c);N(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);N(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;L(a,.5*b,.1*c,!0,!0);N(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);N(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);N(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);N(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);var d=.07,e=0,g=-.707*.11,h=4*(Math.SQRT2-1)/3*d;L(a,(.5+d+e)*b,(.5+g)*c,!0);N(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-
  h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);d=.07;e=-.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;L(a,(.5+d+e)*b,(.5+g)*c,!0);N(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,
  (.5+d+e)*b,(.5+g)*c);d=.07;e=.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;L(a,(.5+d+e)*b,(.5+g)*c,!0);N(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);b=a.s;b.G=new K(.146,.146);b.H=new K(.853,.853);b.td=Jh;w.v(a);return b},NotAllowed:function(a,b,c){var d=J.wa,e=.5*d,g=.5;a=
  w.u();L(a,.5*b,(.5-g)*c,!0);N(a,(.5-e)*b,(.5-g)*c,(.5-g)*b,(.5-e)*c,(.5-g)*b,.5*c);N(a,(.5-g)*b,(.5+e)*c,(.5-e)*b,(.5+g)*c,.5*b,(.5+g)*c);N(a,(.5+e)*b,(.5+g)*c,(.5+g)*b,(.5+e)*c,(.5+g)*b,.5*c);N(a,(.5+g)*b,(.5-e)*c,(.5+e)*b,(.5-g)*c,.5*b,(.5-g)*c);var g=.4,e=.4*d,d=w.M(),h=w.M(),k=w.M(),l=w.M();J.Ki(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.42,d,h,k,l,l);var m=w.M(),n=w.M(),p=w.M();J.Ki(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.58,l,l,p,m,n);var q=w.M(),r=w.M(),s=w.M();J.Ki(.5,.5+g,.5-e,.5+g,.5-g,.5+e,.5-g,
  .5,.42,q,r,s,l,l);var u=w.M(),v=w.M(),A=w.M();J.Ki(.5,.5+g,.5-e,.5+g,.5-g,.5+e,.5-g,.5,.58,l,l,A,u,v);L(a,A.x*b,A.y*c,!0,!0);N(a,u.x*b,u.y*c,v.x*b,v.y*c,(.5-g)*b,.5*c);N(a,(.5-g)*b,(.5-e)*c,(.5-e)*b,(.5-g)*c,.5*b,(.5-g)*c);N(a,d.x*b,d.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(A.x*b,A.y*c);Ad(a);L(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);N(a,m.x*b,m.y*c,n.x*b,n.y*c,(.5+g)*b,.5*c);N(a,(.5+g)*b,(.5+e)*c,(.5+e)*b,(.5+g)*c,.5*b,(.5+g)*c);N(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);Ad(a);w.B(d);w.B(h);w.B(k);
  w.B(l);w.B(m);w.B(n);w.B(p);w.B(q);w.B(r);w.B(s);w.B(u);w.B(v);w.B(A);b=a.s;w.v(a);b.td=Jh;return b},Fragile:function(a,b,c){a=w.u();L(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);N(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);N(a,.25*b,.5*c,0,.25*
  c,0,0);Ad(a);b=a.s;b.G=new K(.25,0);b.H=new K(.75,.4);w.v(a);return b},HourGlass:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},Lightning:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},Parallelogram1:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.1);var d=w.u();L(d,a*b,
  0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);Ad(d);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);w.v(d);return b},Input:"Output",Output:function(a,b,c){a=w.u();L(a,0,1*c,!0);a.lineTo(.1*b,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);Ad(a);b=a.s;b.G=new K(.1,0);b.H=new K(.9,1);w.v(a);return b},Parallelogram2:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.25);var d=w.u();L(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);Ad(d);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);w.v(d);return b},ThickCross:function(a,
  b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.25);var d=w.u();L(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);Ad(d);b=d.s;b.G=new K(.5-a/2,.5-a/2);b.H=new K(.5+a/2,.5+a/2);w.v(d);return b},ThickX:function(a,b,c){a=.25/Math.SQRT2;var d=w.u();L(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);Ad(d);b=d.s;b.G=new K(.5-a,.5-a);b.H=new K(.5+a,.5+a);w.v(d);return b},ThinCross:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=.1);a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},ThinX:function(a,b,c){a=w.u();L(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);Ad(a);return a.s},RightTriangle:function(a,b,c){a=
  w.u();L(a,0,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);Ad(a);b=a.s;b.G=new K(0,.5);b.H=new K(.5,1);w.v(a);return b},RoundedIBeam:function(a,b,c){a=w.u();L(a,0,0,!0);a.lineTo(1*b,0);N(a,.5*b,.25*c,.5*b,.75*c,1*b,1*c);a.lineTo(0,1*c);N(a,.5*b,.75*c,.5*b,.25*c,0,0);Ad(a);b=a.s;w.v(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*J.wa;var e=w.u();L(e,d,0,!0);e.lineTo(b-d,0);N(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);N(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,
  c);N(e,a,c,0,c-a,0,c-d);e.lineTo(0,d);N(e,0,a,a,0,d,0);Ad(e);b=e.s;1<a?(b.G=new K(0,0,a,a),b.H=new K(1,1,-a,-a)):(b.G=Ab,b.H=Wb);w.v(e);return b},Border:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=w.u();L(a,d,0,!0);a.lineTo(b-d,0);N(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);N(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);N(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);N(a,0,0,0,0,d,0);Ad(a);b=a.s;b.G=Ab;b.H=Wb;w.v(a);return b},SquareIBeam:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=.2);
  a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},Trapezoid:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.2);var d=w.u();L(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Ad(d);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);w.v(d);return b},ManualLoop:"ManualOperation",
  ManualOperation:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=0);a=w.u();L(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);Ad(a);b=a.s;b.G=new K(.1,0);b.H=new K(.9,1);w.v(a);return b},GenderMale:function(a,b,c){a=w.u();var d=J.wa,e=.4*d,g=.4,h=w.M(),k=w.M(),l=w.M(),m=w.M();L(a,(.5-g)*b,.5*c,!0);N(a,(.5-g)*b,(.5-e)*c,(.5-e)*b,(.5-g)*c,.5*b,(.5-g)*c);J.Ki(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.44,l,m,k,h,h);N(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);var n=w.ic(k.x,k.y);J.Ki(.5,
  .5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.56,h,h,k,l,m);var p=w.ic(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);N(a,l.x*b,l.y*c,m.x*b,m.y*c,(.5+g)*b,.5*c);N(a,(.5+g)*b,(.5+e)*c,(.5+e)*b,(.5+g)*c,.5*b,(.5+g)*c);N(a,(.5-e)*b,(.5+g)*c,(.5-g)*b,(.5+e)*c,(.5-g)*b,.5*c);g=.35;e=.35*d;L(a,.5*b,(.5-g)*c,!0,!0);N(a,(.5-e)*b,(.5-g)*c,(.5-g)*b,(.5-
  e)*c,(.5-g)*b,.5*c);N(a,(.5-g)*b,(.5+e)*c,(.5-e)*b,(.5+g)*c,.5*b,(.5+g)*c);N(a,(.5+e)*b,(.5+g)*c,(.5+g)*b,(.5+e)*c,(.5+g)*b,.5*c);N(a,(.5+g)*b,(.5-e)*c,(.5+e)*b,(.5-g)*c,.5*b,(.5-g)*c);L(a,(.5-g)*b,.5*c,!0);w.B(h);w.B(k);w.B(l);w.B(m);w.B(n);w.B(p);b=a.s;b.G=new K(.202,.257);b.H=new K(.692,.839);b.td=Jh;w.v(a);return b},GenderFemale:function(a,b,c){a=w.u();var d=.375,e=0,g=-.125,h=4*(Math.SQRT2-1)/3*d;L(a,(.525+e)*b,(.5+d+g)*c,!0);N(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*
  c);N(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.475+e)*b,(.5+d+g)*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);Ad(a);d=.325;e=0;g=-.125;h=4*(Math.SQRT2-1)/3*d;L(a,(.5+d+e)*b,(.5+
  g)*c,!0,!0);N(a,(.5+d+e)*b,(.5+h+g)*c,(.5+h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);N(a,(.5-h+e)*b,(.5+d+g)*c,(.5-d+e)*b,(.5+h+g)*c,(.5-d+e)*b,(.5+g)*c);N(a,(.5-d+e)*b,(.5-h+g)*c,(.5-h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);N(a,(.5+h+e)*b,(.5-d+g)*c,(.5+d+e)*b,(.5-h+g)*c,(.5+d+e)*b,(.5+g)*c);L(a,(.525+e)*b,(.5+d+g)*c,!0);b=a.s;b.G=new K(.232,.136);b.H=new K(.782,.611);b.td=Jh;w.v(a);return b},PlusLine:function(a,b,c){a=w.u();L(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.s;w.v(a);
  return b},XLine:function(a,b,c){a=w.u();L(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.s;w.v(a);return b},AsteriskLine:function(a,b,c){a=w.u();var d=.2/Math.SQRT2;L(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.s;w.v(a);return b},CircleLine:function(a,b,c){var d=.5*J.wa;a=w.u();L(a,1*b,.5*c,!1);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,
  0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.s;b.G=new K(.146,.146);b.H=new K(.853,.853);b.td=Jh;w.v(a);return b},Pie:function(a,b,c){a=w.u();var d=4*(Math.SQRT2-1)/3*.5;L(a,(.5*Math.SQRT2/2+.5)*b,(.5-.5*Math.SQRT2/2)*c,!0);N(a,.7*b,0*c,.5*b,0*c,.5*b,0*c);N(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);N(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.5*b,1*c);N(a,(.5+d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);a.lineTo(.5*b,.5*c);Ad(a);b=a.s;w.v(a);return b},PiePiece:function(a,b,c){var d=
  J.wa/Math.SQRT2*.5,e=Math.SQRT2/2,g=1-Math.SQRT2/2;a=w.u();L(a,b,c,!0);N(a,b,(1-d)*c,(e+d)*b,(g+d)*c,e*b,g*c);a.lineTo(0,c);Ad(a);b=a.s;w.v(a);return b},StopSign:function(a,b,c){a=1/(Math.SQRT2+2);var d=w.u();L(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);Ad(d);b=d.s;b.G=new K(a/2,a/2);b.H=new K(1-a/2,1-a/2);w.v(d);return b},LogicImplies:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=.2);a=w.u();
  L(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.s;b.G=Ab;b.H=new K(.8,.5);w.v(a);return b},LogicIff:function(a,b,c){var d=a?a.Dc:NaN;isNaN(d)&&(d=.2);a=w.u();L(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.s;b.G=new K(.2,0);b.H=new K(.8,.5);w.v(a);return b},LogicNot:function(a,b,c){a=w.u();L(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.s;w.v(a);return b},
  LogicAnd:function(a,b,c){a=w.u();L(a,0,1*c,!1);a.lineTo(.5*b,0);a.lineTo(1*b,1*c);b=a.s;b.G=new K(.25,.5);b.H=new K(.75,1);w.v(a);return b},LogicOr:function(a,b,c){a=w.u();L(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);b=a.s;b.G=new K(.219,0);b.H=new K(.78,.409);w.v(a);return b},LogicXor:function(a,b,c){a=w.u();L(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*J.wa;N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*
  b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.s;b.td=Jh;w.v(a);return b},LogicTruth:function(a,b,c){a=w.u();L(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.s;w.v(a);return b},LogicFalsity:function(a,b,c){a=w.u();L(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);b=a.s;w.v(a);return b},LogicThereExists:function(a,b,c){a=w.u();L(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.s;w.v(a);return b},
  LogicForAll:function(a,b,c){a=w.u();L(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.s;b.G=new K(.25,0);b.H=new K(.75,.5);w.v(a);return b},LogicIsDefinedAs:function(a,b,c){a=w.u();L(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.s;b.G=new K(.01,.01);b.H=new K(.99,.49);w.v(a);return b},LogicIntersect:function(a,b,c){var d=.5*J.wa;a=w.u();L(a,0,1*c,!1);a.lineTo(0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*
  b,0,1*b,(.5-d)*c,1*b,.5*c);a.lineTo(1*b,1*c);b=a.s;b.G=new K(0,.5);b.H=Wb;w.v(a);return b},LogicUnion:function(a,b,c){var d=.5*J.wa;a=w.u();L(a,1*b,0,!1);a.lineTo(1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);a.lineTo(0,0);b=a.s;b.G=Ab;b.H=new K(1,.5);w.v(a);return b},Arrow:function(a,b,c){var d=a?a.Dc:NaN,e=a?a.Ot:NaN;isNaN(d)&&(d=.3);isNaN(e)&&(e=.3);a=w.u();L(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);Ad(a);b=a.s;b.G=new K(0,.5-e/2);d=J.ol(0,.5+e/2,1,.5+e/2,1-d,1,1,.5,w.M());b.H=new K(d.x,d.y);w.B(d);w.v(a);return b},ISOProcess:"Chevron",Chevron:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},DoubleArrow:function(a,b,c){a=w.u();L(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);Ad(a);L(a,.3*b,.214*c,!1);a.lineTo(.3*b,.786*c);a.eb(!1);b=a.s;w.v(a);return b},DoubleEndArrow:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;c=J.ol(0,.5,.3,0,0,.3,.3,.3,w.M());b.G=new K(c.x,c.y);c=J.ol(.7,1,1,.5,.7,.7,1,.7,c);b.H=new K(c.x,c.y);w.B(c);w.v(a);return b},IBeamArrow:function(a,b,c){a=w.u();
  L(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);Ad(a);b=a.s;b.G=new K(0,.3);c=J.ol(.7,1,1,.5,.7,.7,1,.7,w.M());b.H=new K(c.x,c.y);w.B(c);w.v(a);return b},Pointer:function(a,b,c){a=w.u();L(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(.2*b,.5*c);a.lineTo(0,0);Ad(a);b=a.s;b.G=new K(.2,.35);c=J.ol(.2,.65,1,.65,0,1,1,.5,w.M());b.H=new K(c.x,c.y);w.B(c);w.v(a);
  return b},RoundedPointer:function(a,b,c){a=w.u();L(a,1*b,.5*c,!0);a.lineTo(0,1*c);N(a,.5*b,.75*c,.5*b,.25*c,0,0);Ad(a);b=a.s;b.G=new K(.4,.35);c=J.ol(.2,.65,1,.65,0,1,1,.5,w.M());b.H=new K(c.x,c.y);w.B(c);w.v(a);return b},SplitEndArrow:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=new K(.2,.3);c=J.ol(.7,1,1,.5,.7,.7,1,.7,w.M());b.H=new K(c.x,c.y);w.B(c);w.v(a);
  return b},MessageToUser:"SquareArrow",SquareArrow:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=Ab;b.H=new K(.7,1);w.v(a);return b},Cone1:function(a,b,c){var d=J.wa;a=.5*d;var e=.1*d,d=w.u();L(d,0,.9*c,!0);d.lineTo(.5*b,0);d.lineTo(1*b,.9*c);N(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);N(d,(.5-a)*b,1*c,0,(.9+e)*c,0,.9*c);Ad(d);b=d.s;b.G=new K(.25,.5);b.H=new K(.75,.97);w.v(d);return b},Cone2:function(a,b,c){a=w.u();L(a,0,.9*c,
  !0);N(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);Ad(a);L(a,0,.9*c,!1);N(a,(1-.85/.9)*b,.8*c,.85/.9*b,.8*c,1*b,.9*c);a.eb(!1);b=a.s;b.G=new K(.25,.5);b.H=new K(.75,.82);w.v(a);return b},Cube1:function(a,b,c){a=w.u();L(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);Ad(a);L(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.eb(!1);b=a.s;b.G=new K(0,.3);b.H=new K(.5,
  .85);w.v(a);return b},Cube2:function(a,b,c){a=w.u();L(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);Ad(a);L(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.eb(!1);b=a.s;b.G=new K(0,.3);b.H=new K(.7,1);w.v(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=J.wa;a=.5*d;var e=.1*d,d=w.u();L(d,0,.1*c,!0);N(d,0,(.1-e)*c,(.5-a)*b,0,.5*b,0);N(d,(.5+a)*b,0,1*b,(.1-e)*c,1*b,.1*c);d.lineTo(b,
  .9*c);N(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);N(d,(.5-a)*b,1*c,0,(.9+e)*c,0,.9*c);d.lineTo(0,.1*c);L(d,0,.1*c,!1);N(d,0,(.1+e)*c,(.5-a)*b,.2*c,.5*b,.2*c);N(d,(.5+a)*b,.2*c,1*b,(.1+e)*c,1*b,.1*c);d.eb(!1);b=d.s;b.G=new K(0,.2);b.H=new K(1,.9);w.v(d);return b},Cylinder2:function(a,b,c){var d=J.wa;a=.5*d;var e=.1*d,d=w.u();L(d,0,.9*c,!0);d.lineTo(0,.1*c);N(d,0,(.1-e)*c,(.5-a)*b,0,.5*b,0);N(d,(.5+a)*b,0,1*b,(.1-e)*c,1*b,.1*c);d.lineTo(1*b,.9*c);N(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);N(d,(.5-a)*b,1*c,
  0,(.9+e)*c,0,.9*c);L(d,0,.9*c,!1);N(d,0,(.9-e)*c,(.5-a)*b,.8*c,.5*b,.8*c);N(d,(.5+a)*b,.8*c,1*b,(.9-e)*c,1*b,.9*c);d.eb(!1);b=d.s;b.G=new K(0,.1);b.H=new K(1,.8);w.v(d);return b},Cylinder3:function(a,b,c){var d=J.wa;a=.1*d;var e=.5*d,d=w.u();L(d,.1*b,0,!0);d.lineTo(.9*b,0);N(d,(.9+a)*b,0,1*b,(.5-e)*c,1*b,.5*c);N(d,1*b,(.5+e)*c,(.9+a)*b,1*c,.9*b,1*c);d.lineTo(.1*b,1*c);N(d,(.1-a)*b,1*c,0,(.5+e)*c,0,.5*c);N(d,0,(.5-e)*c,(.1-a)*b,0,.1*b,0);L(d,.1*b,0,!1);N(d,(.1+a)*b,0,.2*b,(.5-e)*c,.2*b,.5*c);N(d,.2*
  b,(.5+e)*c,(.1+a)*b,1*c,.1*b,1*c);d.eb(!1);b=d.s;b.G=new K(.2,0);b.H=new K(.9,1);w.v(d);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=J.wa;a=.1*d;var e=.5*d,d=w.u();L(d,.9*b,0,!0);N(d,(.9+a)*b,0,1*b,(.5-e)*c,1*b,.5*c);N(d,1*b,(.5+e)*c,(.9+a)*b,1*c,.9*b,1*c);d.lineTo(.1*b,1*c);N(d,(.1-a)*b,1*c,0,(.5+e)*c,0,.5*c);N(d,0,(.5-e)*c,(.1-a)*b,0,.1*b,0);d.lineTo(.9*b,0);L(d,.9*b,0,!1);N(d,(.9-a)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);N(d,.8*b,(.5+e)*c,(.9-a)*b,1*c,.9*b,1*c);d.eb(!1);b=d.s;b.G=new K(.1,
  0);b.H=new K(.8,1);w.v(d);return b},Prism1:function(a,b,c){a=w.u();L(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);Ad(a);L(a,.25*b,.25*c,!1);a.lineTo(.5*b,c);a.eb(!1);b=a.s;b.G=new K(.408,.172);b.H=new K(.833,.662);w.v(a);return b},Prism2:function(a,b,c){a=w.u();L(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);Ad(a);L(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.eb(!1);b=a.s;
  b.G=new K(.25,.5);b.H=new K(.75,.75);w.v(a);return b},Pyramid1:function(a,b,c){a=w.u();L(a,.5*b,0,!0);a.lineTo(b,.75*c);a.lineTo(.5*b,1*c);a.lineTo(0,.75*c);Ad(a);L(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.eb(!1);b=a.s;b.G=new K(.25,.367);b.H=new K(.75,.875);w.v(a);return b},Pyramid2:function(a,b,c){a=w.u();L(a,.5*b,0,!0);a.lineTo(b,.85*c);a.lineTo(.5*b,1*c);a.lineTo(0,.85*c);Ad(a);L(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.eb(!1);b=a.s;b.G=new K(.25,.367);
  b.H=new K(.75,.875);w.v(a);return b},Actor:function(a,b,c){var d=J.wa,e=.2*d,g=.1*d,h=.5,k=.1;a=w.u();L(a,h*b,(k+.1)*c,!0);N(a,(h-e)*b,(k+.1)*c,(h-.2)*b,(k+g)*c,(h-.2)*b,k*c);N(a,(h-.2)*b,(k-g)*c,(h-e)*b,(k-.1)*c,h*b,(k-.1)*c);N(a,(h+e)*b,(k-.1)*c,(h+.2)*b,(k-g)*c,(h+.2)*b,k*c);N(a,(h+.2)*b,(k+g)*c,(h+e)*b,(k+.1)*c,h*b,(k+.1)*c);e=.05;g=d*e;L(a,.5*b,.2*c,!0);a.lineTo(.95*b,.2*c);h=.95;k=.25;N(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*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;g=d*e;h=.825;k=.35;N(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);N(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*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;g=d*e;h=.5;k=.7;N(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);N(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*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;g=d*e;h=.175;k=.35;N(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);N(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*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;g=d*e;h=.05;k=.25;N(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);a.lineTo(.5*b,.2*c);b=a.s;b.G=new K(.2,.2);b.H=new K(.8,.65);w.v(a);return b},Card:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=new K(0,.2);b.H=Wb;w.v(a);return b},Collate:function(a,b,c){a=w.u();L(a,.5*b,.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);L(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.s;b.G=new K(.25,0);b.H=new K(.75,.25);w.v(a);return b},CreateRequest:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.1);var d=w.u();L(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Ad(d);L(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.eb(!1);b=d.s;b.G=new K(0,a);b.H=new K(1,1-a);w.v(d);return b},Database:function(a,b,c){a=w.u();var d=J.wa,e=.5*d,d=.1*d;L(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);N(a,1*b,(.9+d)*c,(.5+e)*b,1*c,.5*
  b,1*c);N(a,(.5-e)*b,1*c,0,(.9+d)*c,0,.9*c);a.lineTo(0,.1*c);N(a,0,(.1-d)*c,(.5-e)*b,0,.5*b,0);N(a,(.5+e)*b,0,1*b,(.1-d)*c,1*b,.1*c);L(a,1*b,.1*c,!1);N(a,1*b,(.1+d)*c,(.5+e)*b,.2*c,.5*b,.2*c);N(a,(.5-e)*b,.2*c,0,(.1+d)*c,0,.1*c);a.moveTo(1*b,.2*c);N(a,1*b,(.2+d)*c,(.5+e)*b,.3*c,.5*b,.3*c);N(a,(.5-e)*b,.3*c,0,(.2+d)*c,0,.2*c);a.moveTo(1*b,.3*c);N(a,1*b,(.3+d)*c,(.5+e)*b,.4*c,.5*b,.4*c);N(a,(.5-e)*b,.4*c,0,(.3+d)*c,0,.3*c);a.eb(!1);b=a.s;b.G=new K(0,.4);b.H=new K(1,.9);w.v(a);return b},StoredData:"DataStorage",
  DataStorage:function(a,b,c){a=w.u();L(a,0,0,!0);a.lineTo(.75*b,0);N(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(0,1*c);N(a,.25*b,.9*c,.25*b,.1*c,0,0);Ad(a);b=a.s;b.G=new K(.226,0);b.H=new K(.81,1);w.v(a);return b},DiskStorage:function(a,b,c){a=w.u();var d=J.wa,e=.5*d,d=.1*d;L(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);N(a,1*b,(.9+d)*c,(.5+e)*b,1*c,.5*b,1*c);N(a,(.5-e)*b,1*c,0,(.9+d)*c,0,.9*c);a.lineTo(0,.1*c);N(a,0,(.1-d)*c,(.5-e)*b,0,.5*b,0);N(a,(.5+e)*b,0,1*b,(.1-d)*c,1*b,.1*c);L(a,1*b,.1*c,!1);N(a,1*b,(.1+d)*c,
  (.5+e)*b,.2*c,.5*b,.2*c);N(a,(.5-e)*b,.2*c,0,(.1+d)*c,0,.1*c);a.moveTo(1*b,.2*c);N(a,1*b,(.2+d)*c,(.5+e)*b,.3*c,.5*b,.3*c);N(a,(.5-e)*b,.3*c,0,(.2+d)*c,0,.2*c);a.eb(!1);b=a.s;b.G=new K(0,.3);b.H=new K(1,.9);w.v(a);return b},Display:function(a,b,c){a=w.u();L(a,.25*b,0,!0);a.lineTo(.75*b,0);N(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);Ad(a);b=a.s;b.G=new K(.25,0);b.H=new K(.75,1);w.v(a);return b},DividedEvent:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=w.u(),
  e=.2*J.wa;L(d,0,.2*c,!0);N(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);N(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);N(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);N(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c);L(d,0,a*c,!1);d.lineTo(1*b,a*c);d.eb(!1);b=d.s;b.G=new K(0,a);b.H=new K(1,1-a);w.v(d);return b},DividedProcess:function(a,b,c){a=a?a.Dc:NaN;if(isNaN(a)||.1>a)a=.1;var d=w.u();L(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Ad(d);L(d,0,a*c,!1);
  d.lineTo(1*b,a*c);d.eb(!1);b=d.s;b.G=new K(0,a);b.H=Wb;w.v(d);return b},Document:function(a,b,c){c/=.8;a=w.u();L(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);Ad(a);b=a.s;b.G=Ab;b.H=new K(1,.6);w.v(a);return b},ExternalOrganization:function(a,b,c){a=a?a.Dc:NaN;if(isNaN(a)||.2>a)a=.2;var d=w.u();L(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Ad(d);L(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.eb(!1);b=d.s;b.G=new K(a/2,a/2);b.H=new K(1-a/2,1-a/2);w.v(d);return b},ExternalProcess:function(a,b,c){a=w.u();L(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);Ad(a);L(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.eb(!1);b=a.s;b.G=new K(.25,.25);b.H=new K(.75,.75);w.v(a);return b},File:function(a,b,c){a=w.u();L(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);Ad(a);L(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.eb(!1);b=a.s;b.G=new K(0,.25);b.H=Wb;w.v(a);return b},Interrupt:function(a,b,c){a=w.u();L(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);L(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);L(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.s;b.G=new K(0,.25);b.H=new K(.5,.75);w.v(a);return b},InternalStorage:function(a,b,c){var d=a?a.Dc:NaN;a=a?a.Ot:NaN;isNaN(d)&&(d=
  .1);isNaN(a)&&(a=.1);var e=w.u();L(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);Ad(e);L(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.eb(!1);b=e.s;b.G=new K(d,a);b.H=Wb;w.v(e);return b},Junction:function(a,b,c){a=w.u();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*J.wa;L(a,1*b,.5*c,!0);N(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);N(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);N(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);N(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);L(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.eb(!1);b=a.s;b.td=Jh;w.v(a);return b},LinedDocument:function(a,b,c){c/=.8;a=w.u();L(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);Ad(a);L(a,.1*b,0,!1);a.lineTo(.1*b,.75*c);a.eb(!1);b=a.s;b.G=new K(.1,0);b.H=new K(1,.6);w.v(a);return b},LoopLimit:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=new K(0,.25);
  b.H=Wb;w.v(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,.5*b,1*c,!0);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(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.s;b.G=new K(.15,.15);b.H=new K(.85,.8);w.v(a);return b},ManualInput:function(a,b,c){a=w.u();L(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);Ad(a);b=a.s;
  b.G=new K(0,.25);b.H=Wb;w.v(a);return b},MessageFromUser:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.7);var d=w.u();L(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);Ad(d);b=d.s;b.G=Ab;b.H=new K(a,1);w.v(d);return b},MicroformProcessing:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.25);var d=w.u();L(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);Ad(d);b=d.s;b.G=new K(0,a);b.H=new K(1,1-a);w.v(d);return b},MicroformRecording:function(a,
  b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=new K(0,.25);b.H=new K(1,.75);w.v(a);return b},MultiDocument:function(a,b,c){c/=.8;a=w.u();L(a,b,0,!0);a.lineTo(b,.5*c);N(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);N(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);N(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);Ad(a);L(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.eb(!1);b=a.s;b.G=new K(0,.25);b.H=new K(.8,.77);w.v(a);return b},MultiProcess:function(a,b,c){a=w.u();L(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);Ad(a);L(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.eb(!1);b=a.s;b.G=new K(0,.2);b.H=new K(.8,1);w.v(a);return b},OfflineStorage:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=w.u();L(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(.5*b,1*c);Ad(e);L(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.eb(!1);b=e.s;b.G=new K(d/4+.5*a,a);b.H=new K(3*d/4+.5*a,a+.5*d);w.v(e);return b},OffPageConnector:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=Ab;b.H=new K(.75,1);w.v(a);return b},Or:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);L(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.eb(!1);b=a.s;b.td=Jh;w.v(a);return b},PaperTape:function(a,b,c){c/=.8;a=w.u();L(a,0,.7*c,!0);a.lineTo(0,.3*c);N(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*
  b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);Ad(a);b=a.s;b.G=new K(0,.49);b.H=new K(1,.75);w.v(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Dc:NaN;a=a?a.Ot:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.u();L(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);Ad(e);b=e.s;b.G=new K(d,0);b.H=new K(1-a,1);w.v(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Dc:NaN;a=a?a.Ot:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.u();L(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);Ad(e);b=e.s;b.G=new K(d,0);b.H=new K(1-a,1);w.v(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.1);var d=w.u();L(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Ad(d);L(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.eb(!1);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);w.v(d);return b},Process:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.1);var d=w.u();L(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*
  b,1*c);d.lineTo(0,1*c);Ad(d);L(d,a*b,0,!1);d.lineTo(a*b,1*c);d.eb(!1);b=d.s;b.G=new K(a,0);b.H=Wb;w.v(d);return b},Sort:function(a,b,c){a=w.u();L(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);Ad(a);L(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.eb(!1);b=a.s;b.G=new K(.25,.25);b.H=new K(.75,.5);w.v(a);return b},Start:function(a,b,c){a=w.u();L(a,.25*b,0,!0);L(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);L(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*
  b,0);a.lineTo(.75*b,1*c);a.eb(!1);b=a.s;b.G=new K(.25,0);b.H=new K(.75,1);w.v(a);return b},Terminator:function(a,b,c){a=w.u();L(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.s;b.G=new K(.23,0);b.H=new K(.77,1);w.v(a);return b},TransmittalTape:function(a,b,c){a=a?a.Dc:NaN;isNaN(a)&&(a=.1);var d=w.u();L(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);Ad(d);b=d.s;b.G=Ab;b.H=new K(1,1-a);w.v(d);return b},AndGate:function(a,
  b,c){a=w.u();var d=.5*J.wa;L(a,0,0,!0);a.lineTo(.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);Ad(a);b=a.s;b.G=Ab;b.H=new K(.55,1);w.v(a);return b},Buffer:function(a,b,c){a=w.u();L(a,0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);Ad(a);b=a.s;b.G=new K(0,.25);b.H=new K(.5,.75);w.v(a);return b},Clock:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-
  d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);L(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);L(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.eb(!1);b=a.s;b.td=Jh;w.v(a);return b},Ground:function(a,b,c){a=w.u();L(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.s;w.v(a);return b},
  Inverter:function(a,b,c){a=w.u();var d=.1*J.wa;L(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);L(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);N(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);N(a,.8*b,(.5-d)*c,(.9-d)*b,.4*c,.9*b,.4*c);N(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.s;b.G=new K(0,.25);b.H=new K(.4,.75);w.v(a);return b},NandGate:function(a,b,c){a=w.u();var d=J.wa,e=.5*d,g=.4*d,d=.1*d;L(a,.8*b,.5*c,!0);N(a,.8*b,(.5+g)*c,(.4+e)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,
  0);a.lineTo(.4*b,0);N(a,(.4+e)*b,0,.8*b,(.5-g)*c,.8*b,.5*c);L(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);N(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);N(a,.8*b,(.5-d)*c,(.9-d)*b,.4*c,.9*b,.4*c);N(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.s;b.G=new K(0,.05);b.H=new K(.55,.95);w.v(a);return b},NorGate:function(a,b,c){a=w.u();var d=J.wa,e=.5,g=d*e,h=0,k=.5;L(a,.8*b,.5*c,!0);N(a,.7*b,(k+g)*c,(h+g)*b,(k+e)*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);N(a,(h+g)*b,(k-e)*c,.7*b,(k-g)*c,.8*b,.5*c);
  e=.1;g=.1*d;h=.9;k=.5;L(a,(h-e)*b,k*c,!0);N(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);N(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);N(a,(h+e)*b,(k+g)*c,(h+g)*b,(k+e)*c,h*b,(k+e)*c);N(a,(h-g)*b,(k+e)*c,(h-e)*b,(k+g)*c,(h-e)*b,k*c);b=a.s;b.G=new K(.2,.25);b.H=new K(.6,.75);w.v(a);return b},OrGate:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,0,0,!0);N(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);N(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);Ad(a);b=a.s;b.G=new K(.2,.25);b.H=
  new K(.75,.75);w.v(a);return b},XnorGate:function(a,b,c){a=w.u();var d=J.wa,e=.5,g=d*e,h=.2,k=.5;L(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);L(a,.8*b,.5*c,!0);N(a,.7*b,(k+g)*c,(h+g)*b,(k+e)*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);N(a,(h+g)*b,(k-e)*c,.7*b,(k-g)*c,.8*b,.5*c);e=.1;g=.1*d;h=.9;k=.5;L(a,(h-e)*b,k*c,!0);N(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);N(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);N(a,(h+e)*b,(k+g)*c,(h+g)*b,(k+e)*c,h*b,(k+e)*c);N(a,(h-g)*b,(k+e)*c,(h-
  e)*b,(k+g)*c,(h-e)*b,k*c);b=a.s;b.G=new K(.4,.25);b.H=new K(.65,.75);w.v(a);return b},XorGate:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);L(a,.2*b,0,!0);N(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);N(a,.9*b,(.5+d)*c,(.2+d)*b,1*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);Ad(a);b=a.s;b.G=new K(.4,.25);b.H=new K(.8,.75);w.v(a);return b},Capacitor:function(a,b,c){a=w.u();L(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.s;w.v(a);return b},
  Resistor:function(a,b,c){a=w.u();L(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.s;w.v(a);return b},Inductor:function(a,b,c){a=w.u();var d=.1*J.wa,e=.1;L(a,(e-.5*d)*b,c,!1);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-
  d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;N(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.s;w.v(a);return b},ACvoltageSource:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,0*b,.5*c,!1);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);N(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.s;b.td=Jh;w.v(a);return b},DCvoltageSource:function(a,b,c){a=w.u();L(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);
  a.lineTo(1*b,1*c);b=a.s;w.v(a);return b},Diode:function(a,b,c){a=w.u();L(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.s;b.G=new K(0,.25);b.H=new K(.5,.75);w.v(a);return b},Wifi:function(a,b,c){var d=b,e=c;b*=.38;c*=.6;a=w.u();var g=J.wa,h=.8*g,k=.8,l=0,m=.5,d=(d-b)/2,e=(e-c)/2;L(a,l*b+d,(m+k)*c+e,!0);N(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);N(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);N(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);N(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);Ad(a);h=.4*g;k=.4;l=.2;m=.5;L(a,l*b+d,(m+k)*c+e,!0);N(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);N(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);N(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);N(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);Ad(a);h=.2*g;k=.2;m=l=.5;L(a,(l-k)*b+d,m*c+e,!0);N(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*
  c+e,l*b+d,(m-k)*c+e);N(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);N(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);N(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*g;k=.4;l=.8;m=.5;L(a,l*b+d,(m-k)*c+e,!0);N(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);N(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);N(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);N(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);
  Ad(a);h=.8*g;k=.8;l=1;m=.5;L(a,l*b+d,(m-k)*c+e,!0);N(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);N(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);N(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);N(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);Ad(a);b=a.s;w.v(a);return b},Email:function(a,b,c){a=w.u();L(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);Ad(a);L(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.eb(!1);b=a.s;w.v(a);return b},Ethernet:function(a,b,c){a=w.u();L(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);Ad(a);L(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);Ad(a);L(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);Ad(a);L(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.eb(!1);b=a.s;w.v(a);return b},Power:function(a,b,c){a=w.u();var d=J.wa,e=.4*d,g=.4,h=w.M(),k=w.M(),l=w.M(),m=w.M();J.Ki(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.5,h,h,k,l,m);var n=w.ic(k.x,k.y);L(a,k.x*b,k.y*c,!0);N(a,l.x*b,l.y*c,m.x*b,m.y*c,(.5+g)*b,.5*c);N(a,(.5+g)*b,(.5+e)*c,(.5+e)*b,(.5+g)*c,.5*b,(.5+g)*c);N(a,(.5-e)*b,(.5+g)*c,(.5-g)*b,(.5+e)*c,(.5-g)*b,.5*c);J.Ki(.5-g,.5,.5-g,.5-e,.5-e,.5-g,.5,.5-g,.5,
  l,m,k,h,h);N(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);e=.3*d;g=.3;J.Ki(.5-g,.5,.5-g,.5-e,.5-e,.5-g,.5,.5-g,.5,l,m,k,h,h);a.lineTo(k.x*b,k.y*c);N(a,m.x*b,m.y*c,l.x*b,l.y*c,(.5-g)*b,.5*c);N(a,(.5-g)*b,(.5+e)*c,(.5-e)*b,(.5+g)*c,.5*b,(.5+g)*c);N(a,(.5+e)*b,(.5+g)*c,(.5+g)*b,(.5+e)*c,(.5+g)*b,.5*c);J.Ki(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.5,h,h,k,l,m);N(a,m.x*b,m.y*c,l.x*b,l.y*c,k.x*b,k.y*c);Ad(a);L(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);Ad(a);w.B(h);w.B(k);w.B(l);w.B(m);
  w.B(n);b=a.s;b.G=new K(.25,.55);b.H=new K(.75,.8);w.v(a);return b},Fallout:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,0*b,.5*c,!0);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);var e=d=0;L(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;Ad(a);L(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;Ad(a);L(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);Ad(a);b=a.s;b.td=Jh;w.v(a);return b},IrritationHazard:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;b.G=new K(.3,
  .3);b.H=new K(.7,.7);w.v(a);return b},ElectricalHazard:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},FireHazard:function(a,b,c){a=w.u();L(a,.1*b,1*c,!0);N(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);N(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);N(a,.59*
  b,.29*c,.58*b,.28*c,.59*b,.18*c);N(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);N(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);N(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);Ad(a);b=a.s;b.G=new K(.05,.645);b.H=new K(.884,.908);w.v(a);return b},BpmnActivityLoop:function(a,b,c){a=w.u();var d=4*(Math.SQRT2-1)/3*.5;L(a,.65*b,1*c,!1);N(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);N(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);N(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);N(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.s;w.v(a);return b},BpmnActivityParallel:function(a,b,c){a=w.u();L(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.s;w.v(a);return b},BpmnActivitySequential:function(a,b,c){a=w.u();L(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.s;w.v(a);return b},BpmnActivityAdHoc:function(a,b,c){a=w.u();L(a,0,0,!1);L(a,1*b,1*c,!1);L(a,0,.5*c,!1);N(a,.2*b,.35*c,
  .3*b,.35*c,.5*b,.5*c);N(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.s;w.v(a);return b},BpmnActivityCompensation:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},BpmnTaskMessage:function(a,b,c){a=w.u();L(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);Ad(a);L(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.eb(!1);b=a.s;w.v(a);return b},
  BpmnTaskScript:function(a,b,c){a=w.u();L(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);N(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,0);N(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);Ad(a);L(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.eb(!1);b=a.s;w.v(a);return b},BpmnTaskUser:function(a,b,c){a=w.u();L(a,0,0,!1);L(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);N(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);N(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,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;N(a,(.5-(e+d)/2)*b,(d+(d+g)/2)*c,(.5-d)*b,(d+g)*c,(.5-d)*b,d*c);N(a,(.5-d)*b,(d-g)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c);N(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-g)*c,(.5+d)*b,d*c);N(a,(.5+d)*b,(d+g)*c,(.5+(e+d)/2)*b,(d+(d+g)/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);L(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);L(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.s;w.v(a);return b},BpmnEventConditional:function(a,b,c){a=w.u();L(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);Ad(a);L(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.eb(!1);b=a.s;w.v(a);return b},BpmnEventError:function(a,b,c){a=w.u();L(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);Ad(a);b=a.s;w.v(a);return b},BpmnEventEscalation:function(a,b,c){a=w.u();L(a,0,0,!1);L(a,1*b,1*c,!1);L(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);Ad(a);b=a.s;w.v(a);return b},BpmnEventTimer:function(a,b,c){a=w.u();var d=.5*J.wa;L(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*
  c);L(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.eb(!1);b=a.s;b.td=Jh;w.v(a);return b}};for(var Ln in J.xg)J.xg[Ln.toLowerCase()]=Ln;
  J.lw={"":"",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"};J.TJ=function(){if(null!==J.lw){for(var a in J.lw){var b=xd(J.lw[a],!1);J.$i[a]=b;a.toLowerCase()!==a&&(J.$i[a.toLowerCase()]=a)}J.lw=null}};
  J.XD=function(a){J.TJ();var b=J.$i[a];if(void 0===b){b=a.toLowerCase();if("none"===b)return"None";b=J.$i[b]}return"string"===typeof b?b:b instanceof ed?a:null};
  function H(a){0===arguments.length?z.call(this):z.call(this,a);this.Q=311807;this.Ok=this.ci="";this.ks=this.gs=this.ts=this.jr=null;this.vs="";this.ai=this.us=this.rm=null;this.js="";this.po=null;this.hs=(new fa(NaN,NaN)).freeze();this.ls="";this.qo=null;this.oe="";this.lv=this.rq=this.Ck=null;this.Yg=(new x(NaN,NaN)).freeze();this.rr="";this.Rk=null;this.sr=Ab;this.Br=J.dH;this.ur=J.cH;this.Bq=null;this.kr=Mn;this.um=(new x(6,6)).freeze();this.tm="gray";this.sm=4;this.HC=-1;this.nH=new y;this.Tk=
  null;this.uj=NaN}w.Ia(H,z);w.ja("Part",H);H.prototype.cloneProtected=function(a){z.prototype.cloneProtected.call(this,a);a.Q=this.Q&-4097|49152;a.ci=this.ci;a.Ok=this.Ok;a.jr=this.jr;a.ts=this.ts;a.gs=this.gs;a.ks=this.ks;a.vs=this.vs;a.us=this.us;a.ai=null;a.js=this.js;a.hs.assign(this.hs);a.ls=this.ls;a.oe=this.oe;a.rq=this.rq;a.Yg.assign(this.Yg);a.rr=this.rr;a.sr=this.sr.ba();a.Br=this.Br.ba();a.ur=this.ur.ba();a.Bq=this.Bq;a.kr=this.kr;a.um.assign(this.um);a.tm=this.tm;a.sm=this.sm};
  H.prototype.Qh=function(a){z.prototype.Qh.call(this,a);a.rl();a.rm=null;a.po=null;a.qo=null;a.Rk=null;a.Tk=null};H.prototype.toString=function(){var a=w.yg(Object.getPrototypeOf(this))+"#"+w.Yc(this);null!==this.data&&(a+="("+je(this.data)+")");return a};H.LayoutNone=0;var Pj;H.LayoutAdded=Pj=1;var Vj;H.LayoutRemoved=Vj=2;H.LayoutShown=4;H.LayoutHidden=8;H.LayoutNodeSized=16;var Kk;H.LayoutGroupLayout=Kk=32;H.LayoutNodeReplaced=64;var Mn;H.LayoutStandard=Mn=Pj|Vj|28|Kk|64;H.LayoutAll=16777215;
  H.prototype.fn=function(a,b,c,d,e,g,h){var k=this.h;null!==k&&(a===he&&"elements"===b?e instanceof z&&Qj(e,function(a){Rj(k,a)}):a===ie&&"elements"===b&&e instanceof z&&Qj(e,function(a){Uj(k,a)}),k.Hc(a,b,c,d,e,g,h))};H.prototype.updateTargetBindings=H.prototype.Rb=function(a){z.prototype.Rb.call(this,a);if(null!==this.data){a=this.Ca.q;for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof z&&Qj(d,function(a){null!==a.data&&a.Rb()})}}};
  H.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.fa;if(c instanceof R){var d=c.Um(a),b=b.JI(d),e=this.Va;b!==e&&(b=null!==e?c.Cb(e.data):void 0,e=c.dn,"function"===typeof e?e(a,b):a[e]=b,c.Bx(a,d))}}}};w.A(H,{hw:"adornments"},function(){return null===this.ai?Ca:this.ai.qF});H.prototype.findAdornment=H.prototype.Uo=function(a){t&&w.i(a,"string",H,"findAdornment:category");var b=this.ai;return null===b?null:b.Aa(a)};
  H.prototype.addAdornment=H.prototype.bl=function(a,b){if(null!==b){t&&(w.i(a,"string",H,"addAdornment:category"),w.l(b,tf,H,"addAdornment:ad"));var c=null,d=this.ai;null!==d&&(c=d.Aa(a));if(c!==b){if(null!==c){var e=c.h;null!==e&&e.remove(c)}null===d&&(this.ai=d=new ia("string",tf));b.ci!==a&&(b.Gc=a);d.add(a,b);c=this.h;null!==c&&(c.add(b),b.data=this.data)}}};
  H.prototype.removeAdornment=H.prototype.Bl=function(a){t&&w.i(a,"string",H,"removeAdornment:category");var b=this.ai;if(null!==b){var c=b.Aa(a);if(null!==c){var d=c.h;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.ai=null)}};H.prototype.clearAdornments=H.prototype.bt=function(){var a=this.ai;if(null!==a){for(var b=w.lb(),a=a.k;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.Bl(b[c]);w.xa(b)}};
  H.prototype.updateAdornments=function(){var a=this.h;if(null!==a){a:{if(this.Za&&this.pG){var b=this.$t;if(!(null!==b&&this.ea.J()&&this.Ja()&&b.vl()&&b.ea.J()))break a;var c=this.Uo("Selection");if(null===c){c=this.qG;null===c&&(c=this instanceof U?a.xF:this instanceof T?a.TE:a.NF);if(!(c instanceof tf))break a;vf(c);c=c.copy();null!==c&&(c.Gc="Selection",c.wc=b)}if(null!==c){var d=c.placeholder;if(null!==d){var e=b.Qi(),g=0;b instanceof W&&(g=b.ib);var h=w.Hl();h.o((b.Ka.width+g)*e,(b.Ka.height+
  g)*e);d.ya=h;w.dk(h)}c.angle=b.ml();c.type!==gh&&(d=w.M(),c.location=b.qb(Ab,d),w.B(d));this.bl("Selection",c);break a}}this.Bl("Selection")}Nn(this,a);for(a=this.hw;a.next();)b=a.value,b.Rb(),b.T()}};function Nn(a,b){b.tb.lf.each(function(b){b.isEnabled&&b.updateAdornments(a)})}w.A(H,{layer:"layer"},function(){return this.lv});w.A(H,{h:"diagram"},function(){var a=this.lv;return null!==a?a.h:null});w.g(H,"layerName",H.prototype.hf);
  w.defineProperty(H,{hf:"layerName"},function(){return this.Ok},function(a){var b=this.Ok;if(b!==a){w.i(a,"string",H,"layerName");var c=this.h;if(null===c||null!==c.mt(a)&&!c.sn)if(this.Ok=a,null!==c&&c.oc(),this.j("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.h,null!==c&&(a=c.mt(a),null!==a&&a!==b))){var d=b.ef(-1,this,!0);0<=d&&c.Hc(ie,"parts",b,this,null,d,!0);d=a.fp(99999999,this,!0);0<=d&&c.Hc(he,"parts",a,null,this,!0,d);d=this.mp;if(null!==d){var e=c.Pa;c.Pa=!0;d(this,b,a);c.Pa=e}}}});
  w.g(H,"layerChanged",H.prototype.mp);w.defineProperty(H,{mp:"layerChanged"},function(){return this.jr},function(a){var b=this.jr;b!==a&&(null!==a&&w.i(a,"function",H,"layerChanged"),this.jr=a,this.j("layerChanged",b,a))});H.prototype.invalidateAdornments=H.prototype.de=function(){var a=this.h;null!==a&&(jj(a),0!==(this.Q&16384)!==!0&&(this.Q|=16384,a.Se()))};function Ci(a){0!==(a.Q&16384)!==!1&&(a.updateAdornments(),a.Q&=-16385,a=a.h,null!==a&&(a.Sd=!0))}w.g(H,"location",H.prototype.location);
  w.defineProperty(H,{location:"location"},function(){return this.Yg},function(a){var b=this.Yg;if(!(b.L(a)||this instanceof U)){t&&w.l(a,x,H,"location");a=a.ba();var c=this.h;this.Yg=a;if(!1===Hj(this)){var d=this.Oa,e=a.x-b.x,g=a.y-b.y,h=d.copy();d.o(h.x+e,h.y+g);Nl(this,!1);!d.L(h)&&c&&this.j("position",h,d)}this.j("location",b,a)}});function Nl(a,b){if(!1===Ij(a)){var c=a.h;null!==c&&(c.fg.add(a),a instanceof S&&!c.ka.sb&&a.yf(),b||c.Se());On(a,!0)}}
  function Pn(a){if(!1!==Ij(a)){var b=a.position,c=a.location;c.J()&&b.J()||(Qn(a,b,c),a.Vg());var b=a.Oa,c=a.bc,d=c.copy();c.Na();c.x=b.x;c.y=b.y;c.freeze();a.px(d,c);On(a,!1)}}w.A(H,{hc:"locationObject"},function(){if(null===this.Rk){var a=this.kx;""!==a?(a=this.qe(a),this.Rk=null!==a?a:this):this.Rk=this instanceof tf?this.type!==gh&&null!==this.placeholder?this.placeholder:this:this}return this.Rk.visible?this.Rk:this});w.g(H,"minLocation",H.prototype.FF);
  w.defineProperty(H,{FF:"minLocation"},function(){return this.Br},function(a){var b=this.Br;b.L(a)||(t&&w.l(a,x,H,"minLocation"),this.Br=a=a.ba(),this.j("minLocation",b,a))});w.g(H,"maxLocation",H.prototype.zF);w.defineProperty(H,{zF:"maxLocation"},function(){return this.ur},function(a){var b=this.ur;b.L(a)||(t&&w.l(a,x,H,"maxLocation"),this.ur=a=a.ba(),this.j("maxLocation",b,a))});w.g(H,"locationObjectName",H.prototype.kx);
  w.defineProperty(H,{kx:"locationObjectName"},function(){return this.rr},function(a){var b=this.rr;b!==a&&(t&&w.i(a,"string",H,"locationObjectName"),this.rr=a,this.Rk=null,Hl(this),this.j("locationObjectName",b,a))});w.g(H,"locationSpot",H.prototype.Pe);
  w.defineProperty(H,{Pe:"locationSpot"},function(){return this.sr},function(a){var b=this.sr;b.L(a)||(t&&(w.l(a,K,H,"locationSpot"),a.kd()||w.m("Part.locationSpot must be a specific Spot value, not: "+a)),this.sr=a=a.ba(),Hl(this),this.j("locationSpot",b,a))});H.prototype.move=H.prototype.move=function(a){this.position=a};H.prototype.moveTo=H.prototype.moveTo=function(a,b){var c=w.ic(a,b);this.move(c);w.B(c)};
  H.prototype.isVisible=H.prototype.Ja=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.Va;if(!(null===a||a.Ld&&a.Ja()))return!1;if(this instanceof S){a=this.Rm();if(null!==a&&!a.Qc)return!1;a=this.Md;if(null!==a)return a.Ja()}else if(this instanceof U){var b=!0,c=this.h;null!==c&&(b=c.ld);c=this.Z;if(null!==c){if(this.Bc&&b&&!c.Qc)return!1;if(c===a)return!0;c=c.findVisibleNode();if(null===c||c===a)return!1}c=this.da;if(null!==c){if(this.Bc&&!b&&!c.Qc)return!1;
  if(c===a)return!0;b=c.findVisibleNode();if(null===b||b===a)return!1}}return!0};H.prototype.Qe=function(a){var b=this.h;a?(this.K(4),this.de(),null!==b&&b.fg.add(this)):(this.K(8),this.bt());null!==b&&(b.oc(),b.pa())};
  H.prototype.findObject=H.prototype.qe=function(a){if(this.name===a)return this;var b=this.Tk;null===b&&(this.Tk=b=new na);if(void 0!==b[a])return b[a];for(var c=this.Ca.q,d=c.length,e=0;e<d;e++){var g=c[e];if(g.name===a)return b[a]=g;if(g instanceof z)if(null===g.oi&&null===g.hg){if(g=g.qe(a),null!==g)return b[a]=g}else if(wk(g)&&(g=g.Ca.first(),null!==g&&g.name===a))return b[a]=g}return b[a]=null};
  function Rn(a,b,c,d){void 0===d&&(d=new x);c.ue()&&(c=Ob);var e=b.Ka;d.o(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.fb(d);for(b=b.U;null!==b&&b!==a;)b.transform.fb(d),b=b.U;a.Qk.fb(d);d.offset(-a.Uc.x,-a.Uc.y);return d}H.prototype.ensureBounds=H.prototype.vf=function(){Xh(this,Infinity,Infinity);this.Fc()};
  function Si(a,b){var c;c=a.nH;var d;isNaN(a.uj)&&(a.uj=Vm(a));d=a.uj;var e=2*d;if(!a.Ti)return c.o(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;var e=b.y,g=b.width,h=b.height,k=a.shadowBlur,l=a.wG,g=g+k,h=h+k;d-=k/2;e-=k/2;0<l.x?g+=l.x:(d+=l.x,g-=l.x);0<l.y?h+=l.y:(e+=l.y,h-=l.y);c.o(d-1,e-1,g+2,h+2);return c}f=H.prototype;
  f.Fc=function(){this.Vg();if(!1===Hj(this))Pn(this);else{var a=w.$f();a.assign(this.bc);zl(this);this.bc.Na();var b=Bi(this);this.Hi(0,0,this.Uc.width,this.Uc.height);var c=this.position;Qn(this,c,this.location);var d=this.bc;d.x=c.x;d.y=c.y;d.freeze();this.Vg();this.px(a,d);a.L(d)?this.Ef(b):!this.Kd()||J.I(a.width,d.width)&&J.I(a.height,d.height)||0<=this.HC&&this.K(16);w.nc(a);On(this,!1)}};
  f.px=function(a,b){ul(this,!1);var c=this.h;if(null!==c){this.rl();var d=!1,e=a.J();if(!1===c.mi){var g=c.Hd,h=c.padding,k=g.x+h.left,l=g.y+h.top,m=g.width-2*h.right,g=g.height-2*h.bottom;e&&a.x>k&&a.y>l&&a.right<m&&a.bottom<g&&b.x>k&&b.y>l&&b.right<m&&b.bottom<g&&(d=!0)}0!==(this.Q&65536)!==!0&&a.L(b)||Sj(this,d,c);c.pa()}};
  f.jB=function(a,b){if(!a.J()||this instanceof U)return!1;if(this.h&&!(this instanceof tf)){var c=this.h.bi;c.pd&&qi(c,this,"position",b.copy(),a.copy())}var c=this.Yg,d=c.copy();c.o(c.x+(a.x-b.x),c.y+(a.y-b.y));this.Oa=a;!1===Ij(this)&&!1===Hj(this)&&(Nl(this,!1),this.Vg(),Pn(this));c.L(d)||this.j("location",d,c);return!0};f.vG=function(a,b){var c=this.Yg;!1===Ij(this)&&!1===Hj(this)?(this.Yg.o(c.x+a-this.Oa.x,c.y+b-this.Oa.y),this.Oa.o(a,b),Nl(this,!0),this.Vg()):(c.o(NaN,NaN),this.Oa.o(a,b))};
  function Qn(a,b,c){var d=NaN,e=NaN,g=w.M(),h=a.Pe,k=a.hc;h.ue()&&w.m("determineOffset: Part's locationSpot must be real: "+h.toString());var l=k.Ka,d=0;k.ib&&(d=k.dh);g.cu(0,0,l.width+d,l.height+d,h);if(k!==a)for(k.ib&&g.offset(-d/2,-d/2),k.transform.fb(g),h=k.U;null!==h&&h!==a;)h.transform.fb(g),h=h.U;a.Qk.fb(g);g.offset(-a.Uc.x,-a.Uc.y);h=a.h;c.J()?(k=b.x,l=b.y,d=c.x-g.x,e=c.y-g.y,b.o(d,e),c=!1,null!==h&&(d=h.bi,d.nj?c=!0:!d.pd||a instanceof tf||qi(d,a,"position",new x(k,l),b),c||b.x===k&&b.y===
  l||(d=h.$a,h.$a=!0,a.j("position",new x(k,l),b),h.$a=d))):b.J()&&(d=b.x,e=b.y,b=c.copy(),c.o(d+g.x,e+g.y),c.L(b)||null===h||(d=h.$a,h.$a=!0,a.j("location",b,c),h.$a=d));w.B(g)}function Sj(a,b,c){vl(a,!1);a instanceof S&&Sk(c,a);a.layer.Ac||b||c.oc();b=a.bc;var d=c.ub;d.J()?(Bi(a)?ib(b,d)||a.Ef(!1):b.zg(d)&&a.Ef(!0),a.updateAdornments()):c.Mk=!0}f.tl=function(){return!0};
  function Qi(a,b){if(a.visible){var c=a.bc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=a.transform,e=a.U,g=a.un;g.reset();null!==e&&(e.bg()?g.multiply(e.Nf):null!==e.U&&g.multiply(e.U.Nf));g.multiply(a.Yd);null!==a.tc&&(Bl(a,b,a.tc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.tc&&null===a.Mb&&(b.fillStyle="rgba(0,0,0,0.4)",b.fillRect(c.x,c.y,c.width,c.height));null!==a.Mb&&(d.zt()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),e=a.Ka,c=e.width,e=e.height,Bl(a,b,a.Mb,!0,
  !1),b.fillRect(0,0,c+0,e+0),d.zt()||(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))))}}}f.Kd=function(){return!0};w.g(H,"category",H.prototype.Gc);
  w.defineProperty(H,{Gc:"category"},function(){return this.ci},function(a){var b=this.ci;if(b!==a){w.i(a,"string",H,"category");var c=this.h,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof tf)){var g=c.fa.ka;g.isEnabled&&!g.sb&&(e=this.clone(),e.Ca.Zd(this.Ca))}this.ci=a;this.j("category",b,a);null===c||null===d||this instanceof tf?(e=this.Nh,null!==e&&(a=e.ai,null!==a&&a.remove(b),e.bl(this.Gc,this))):(g=c.fa,g.ka.sb||(this instanceof U?(g instanceof R?g.tG(d,a):g instanceof xe&&g.RJ(d,
  a),c=Ek(c,a),null!==c&&(vf(c),c=c.copy(),null!==c&&Sn(this,c,b,a))):(null!==g&&g.zx(d,a),c=Bk(c,d,a),null!==c&&(vf(c),c=c.copy(),null===c||c instanceof U||(c.location=this.location,Sn(this,c,b,a)))),null!==e&&(b=this.clone(),b.Ca.Zd(this.Ca),this.j("self",e,b))))}});w.defineProperty(H,{self:"self"},function(){return this},function(a){Sn(this,a,this.Gc,a.Gc)});var Tn=!1;
  function Sn(a,b,c,d){b.constructor===a.constructor||Tn||(Tn=!0,w.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),w.trace("  Old class: "+w.yg(a)+", new class: "+w.yg(b)+", part: "+a.toString()));a.bt();var e=a.data;c=a.hf;var g=a.Za,h=a.Ag,k=!0,l=!0,m=!1;if(a instanceof S)var n=a,k=n.Vh,l=n.Qc,m=n.mn;b.Qh(a);b.cloneProtected(a);a.ci=d;a.T();a.pa();b=a.h;d=!0;null!==b&&(d=b.$a,b.$a=!0);a.rh=e;null!==e&&a.Rb();null!==b&&(b.$a=d);e=a.hf;e!==c&&(a.Ok=c,
  a.hf=e);a instanceof S&&(n=a,n.Vh=k,n.Qc=l,n.mn=m,n.Kd()&&n.K(64));a.Za=g;a.Ag=h}H.prototype.canCopy=function(){if(!this.oE)return!1;var a=this.layer;if(null===a)return!0;if(!a.Oh)return!1;a=a.h;return null===a?!0:a.Oh?!0:!1};H.prototype.canDelete=function(){if(!this.wE)return!1;var a=this.layer;if(null===a)return!0;if(!a.Rj)return!1;a=a.h;return null===a?!0:a.Rj?!0:!1};
  H.prototype.canEdit=function(){if(!this.HG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Io)return!1;a=a.h;return null===a?!0:a.Io?!0:!1};H.prototype.canGroup=function(){if(!this.UE)return!1;var a=this.layer;if(null===a)return!0;if(!a.Fo)return!1;a=a.h;return null===a?!0:a.Fo?!0:!1};H.prototype.canMove=function(){if(!this.JF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Gi)return!1;a=a.h;return null===a?!0:a.Gi?!0:!1};
  H.prototype.canReshape=function(){if(!this.cG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Go)return!1;a=a.h;return null===a?!0:a.Go?!0:!1};H.prototype.canResize=function(){if(!this.dG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Dm)return!1;a=a.h;return null===a?!0:a.Dm?!0:!1};H.prototype.canRotate=function(){if(!this.gG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ho)return!1;a=a.h;return null===a?!0:a.Ho?!0:!1};
  H.prototype.canSelect=function(){if(!this.ik)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ee)return!1;a=a.h;return null===a?!0:a.Ee?!0:!1};w.g(H,"copyable",H.prototype.oE);w.defineProperty(H,{oE:"copyable"},function(){return 0!==(this.Q&1)},function(a){var b=0!==(this.Q&1);b!==a&&(t&&w.i(a,"boolean",H,"copyable"),this.Q^=1,this.j("copyable",b,a))});w.g(H,"deletable",H.prototype.wE);
  w.defineProperty(H,{wE:"deletable"},function(){return 0!==(this.Q&2)},function(a){var b=0!==(this.Q&2);b!==a&&(t&&w.i(a,"boolean",H,"deletable"),this.Q^=2,this.j("deletable",b,a))});w.g(H,"textEditable",H.prototype.HG);w.defineProperty(H,{HG:"textEditable"},function(){return 0!==(this.Q&4)},function(a){var b=0!==(this.Q&4);b!==a&&(t&&w.i(a,"boolean",H,"textEditable"),this.Q^=4,this.j("textEditable",b,a),this.de())});w.g(H,"groupable",H.prototype.UE);
  w.defineProperty(H,{UE:"groupable"},function(){return 0!==(this.Q&8)},function(a){var b=0!==(this.Q&8);b!==a&&(t&&w.i(a,"boolean",H,"groupable"),this.Q^=8,this.j("groupable",b,a))});w.g(H,"movable",H.prototype.JF);w.defineProperty(H,{JF:"movable"},function(){return 0!==(this.Q&16)},function(a){var b=0!==(this.Q&16);b!==a&&(t&&w.i(a,"boolean",H,"movable"),this.Q^=16,this.j("movable",b,a))});w.g(H,"selectionAdorned",H.prototype.pG);
  w.defineProperty(H,{pG:"selectionAdorned"},function(){return 0!==(this.Q&32)},function(a){var b=0!==(this.Q&32);b!==a&&(t&&w.i(a,"boolean",H,"selectionAdorned"),this.Q^=32,this.j("selectionAdorned",b,a),this.de())});w.g(H,"isInDocumentBounds",H.prototype.Xw);w.defineProperty(H,{Xw:"isInDocumentBounds"},function(){return 0!==(this.Q&64)},function(a){var b=0!==(this.Q&64);if(b!==a){t&&w.i(a,"boolean",H,"isInDocumentBounds");this.Q^=64;var c=this.h;null!==c&&c.oc();this.j("isInDocumentBounds",b,a)}});
  w.g(H,"isLayoutPositioned",H.prototype.xA);w.defineProperty(H,{xA:"isLayoutPositioned"},function(){return 0!==(this.Q&128)},function(a){var b=0!==(this.Q&128);b!==a&&(t&&w.i(a,"boolean",H,"isLayoutPositioned"),this.Q^=128,this.j("isLayoutPositioned",b,a),this.K(a?4:8))});w.g(H,"selectable",H.prototype.ik);w.defineProperty(H,{ik:"selectable"},function(){return 0!==(this.Q&256)},function(a){var b=0!==(this.Q&256);b!==a&&(t&&w.i(a,"boolean",H,"selectable"),this.Q^=256,this.j("selectable",b,a),this.de())});
  w.g(H,"reshapable",H.prototype.cG);w.defineProperty(H,{cG:"reshapable"},function(){return 0!==(this.Q&512)},function(a){var b=0!==(this.Q&512);b!==a&&(t&&w.i(a,"boolean",H,"reshapable"),this.Q^=512,this.j("reshapable",b,a),this.de())});w.g(H,"resizable",H.prototype.dG);w.defineProperty(H,{dG:"resizable"},function(){return 0!==(this.Q&1024)},function(a){var b=0!==(this.Q&1024);b!==a&&(t&&w.i(a,"boolean",H,"resizable"),this.Q^=1024,this.j("resizable",b,a),this.de())});w.g(H,"rotatable",H.prototype.gG);
  w.defineProperty(H,{gG:"rotatable"},function(){return 0!==(this.Q&2048)},function(a){var b=0!==(this.Q&2048);b!==a&&(t&&w.i(a,"boolean",H,"rotatable"),this.Q^=2048,this.j("rotatable",b,a),this.de())});w.g(H,"isSelected",H.prototype.Za);
  w.defineProperty(H,{Za:"isSelected"},function(){return 0!==(this.Q&4096)},function(a){var b=0!==(this.Q&4096);if(b!==a){t&&w.i(a,"boolean",H,"isSelected");var c=this.h;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.AF)){this.Q^=4096;var d=!1;if(null!==c){d=c.$a;c.$a=!0;var e=c.selection;e.Na();a?e.add(this):e.remove(this);e.freeze()}this.j("isSelected",b,a);this.de();a=this.rG;null!==a&&a(this);null!==c&&(c.Se(),c.$a=d)}}});w.g(H,"isHighlighted",H.prototype.Ag);
  w.defineProperty(H,{Ag:"isHighlighted"},function(){return 0!==(this.Q&524288)},function(a){var b=0!==(this.Q&524288);if(b!==a){t&&w.i(a,"boolean",H,"isHighlighted");this.Q^=524288;var c=this.h;null!==c&&(c=c.Rw,c.Na(),a?c.add(this):c.remove(this),c.freeze());this.j("isHighlighted",b,a);this.pa()}});w.g(H,"isShadowed",H.prototype.Ti);
  w.defineProperty(H,{Ti:"isShadowed"},function(){return 0!==(this.Q&8192)},function(a){var b=0!==(this.Q&8192);b!==a&&(t&&w.i(a,"boolean",H,"isShadowed"),this.Q^=8192,this.j("isShadowed",b,a),this.pa())});function Ij(a){return 0!==(a.Q&32768)}function On(a,b){a.Q=b?a.Q|32768:a.Q&-32769}function vl(a,b){a.Q=b?a.Q|65536:a.Q&-65537}function Bi(a){return 0!==(a.Q&131072)}H.prototype.Ef=function(a){this.Q=a?this.Q|131072:this.Q&-131073};function Un(a,b){a.Q=b?a.Q|1048576:a.Q&-1048577}
  w.g(H,"isAnimated",H.prototype.oA);w.defineProperty(H,{oA:"isAnimated"},function(){return 0!==(this.Q&262144)},function(a){var b=0!==(this.Q&262144);b!==a&&(t&&w.i(a,"boolean",H,"isAnimated"),this.Q^=262144,this.j("isAnimated",b,a))});w.g(H,"selectionObjectName",H.prototype.xx);w.defineProperty(H,{xx:"selectionObjectName"},function(){return this.vs},function(a){var b=this.vs;b!==a&&(t&&w.i(a,"string",H,"selectionObjectName"),this.vs=a,this.rm=null,this.j("selectionObjectName",b,a))});
  w.g(H,"selectionAdornmentTemplate",H.prototype.qG);w.defineProperty(H,{qG:"selectionAdornmentTemplate"},function(){return this.ts},function(a){var b=this.ts;b!==a&&(t&&w.l(a,tf,H,"selectionAdornmentTemplate"),this instanceof U&&(a.type=gh),this.ts=a,this.j("selectionAdornmentTemplate",b,a))});w.A(H,{$t:"selectionObject"},function(){if(null===this.rm){var a=this.xx;null!==a&&""!==a?(a=this.qe(a),this.rm=null!==a?a:this):this instanceof U?(a=this.path,this.rm=null!==a?a:this):this.rm=this}return this.rm});
  w.g(H,"selectionChanged",H.prototype.rG);w.defineProperty(H,{rG:"selectionChanged"},function(){return this.us},function(a){var b=this.us;b!==a&&(null!==a&&w.i(a,"function",H,"selectionChanged"),this.us=a,this.j("selectionChanged",b,a))});w.g(H,"resizeAdornmentTemplate",H.prototype.YA);w.defineProperty(H,{YA:"resizeAdornmentTemplate"},function(){return this.gs},function(a){var b=this.gs;b!==a&&(t&&w.l(a,tf,H,"resizeAdornmentTemplate"),this.gs=a,this.j("resizeAdornmentTemplate",b,a))});
  w.g(H,"resizeObjectName",H.prototype.ZA);w.defineProperty(H,{ZA:"resizeObjectName"},function(){return this.js},function(a){var b=this.js;b!==a&&(t&&w.i(a,"string",H,"resizeObjectName"),this.js=a,this.po=null,this.j("resizeObjectName",b,a))});w.A(H,{fG:"resizeObject"},function(){if(null===this.po){var a=this.ZA;null!==a&&""!==a?(a=this.qe(a),this.po=null!==a?a:this):this.po=this}return this.po});w.g(H,"resizeCellSize",H.prototype.eG);
  w.defineProperty(H,{eG:"resizeCellSize"},function(){return this.hs},function(a){var b=this.hs;b.L(a)||(t&&w.l(a,fa,H,"resizeCellSize"),this.hs=a=a.ba(),this.j("resizeCellSize",b,a))});w.g(H,"rotateAdornmentTemplate",H.prototype.hG);w.defineProperty(H,{hG:"rotateAdornmentTemplate"},function(){return this.ks},function(a){var b=this.ks;b!==a&&(t&&w.l(a,tf,H,"rotateAdornmentTemplate"),this.ks=a,this.j("rotateAdornmentTemplate",b,a))});w.g(H,"rotateObjectName",H.prototype.jG);
  w.defineProperty(H,{jG:"rotateObjectName"},function(){return this.ls},function(a){var b=this.ls;b!==a&&(t&&w.i(a,"string",H,"rotateObjectName"),this.ls=a,this.qo=null,this.j("rotateObjectName",b,a))});w.A(H,{iG:"rotateObject"},function(){if(null===this.qo){var a=this.jG;null!==a&&""!==a?(a=this.qe(a),this.qo=null!==a?a:this):this.qo=this}return this.qo});w.g(H,"text",H.prototype.text);
  w.defineProperty(H,{text:"text"},function(){return this.oe},function(a){var b=this.oe;b!==a&&(t&&w.i(a,"string",H,"text"),this.oe=a,this.j("text",b,a))});w.g(H,"containingGroup",H.prototype.Va);
  w.defineProperty(H,{Va:"containingGroup"},function(){return this.Ck},function(a){if(this.Kd()){var b=this.Ck;if(b!==a){t&&null!==a&&w.l(a,T,H,"containingGroup");null===a||this!==a&&!a.Uh(this)||(this===a&&w.m("Cannot make a Group a member of itself: "+this.toString()),w.m("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.K(Vj);var c=this.h;null!==b?Vn(b,this):this instanceof T&&null!==c&&c.$k.remove(this);this.Ck=a;null!==a?Wn(a,this):this instanceof
  T&&null!==c&&c.$k.add(this);this.K(Pj);if(null!==c){var d=this.data,e=c.fa;null!==d&&e instanceof R&&e.Bx(d,e.Cb(null!==a?a.data:null))}d=this.Vz;null!==d&&(e=!0,null!==c&&(e=c.Pa,c.Pa=!0),d(this,b,a),null!==c&&(c.Pa=e));if(this instanceof T)for(c=new F(H),sf(c,this,!0,0,!0),c=c.k;c.next();)if(d=c.value,d instanceof S)for(d=d.ve;d.next();)zk(d.value);if(this instanceof S)for(d=this.ve;d.next();)zk(d.value);this.j("containingGroup",b,a);null!==a&&a.Ex()}}else w.m("cannot set the Part.containingGroup of a Link or Adornment")});
  f=H.prototype;f.rl=function(){var a=this.Va;null!==a&&(a.T(),null!==a.Tb&&a.Tb.T(),a.yf())};f.pa=function(){var a=this.h;null!==a&&!Hj(this)&&!Ij(this)&&this.Ja()&&this.bc.J()&&a.pa(Si(this,this.bc))};f.ut=function(a){var b=this.Ck;null===b||a||Wn(b,this)};f.vt=function(a){var b=this.Ck;null===b||a||Vn(b,this)};f.Om=function(){var a=this.data;if(null!==a){var b=this.h;null!==b&&(b=b.fa,null!==b&&b.VA(a))}};w.g(H,"containingGroupChanged",H.prototype.Vz);
  w.defineProperty(H,{Vz:"containingGroupChanged"},function(){return this.rq},function(a){var b=this.rq;b!==a&&(null!==a&&w.i(a,"function",H,"containingGroupChanged"),this.rq=a,this.j("containingGroupChanged",b,a))});H.prototype.findSubGraphLevel=function(){return Xn(this,this)};function Xn(a,b){var c=b.Va;return null!==c?1+Xn(a,c):b instanceof S&&(c=b.Md,null!==c)?Xn(a,c):0}H.prototype.findTopLevelPart=function(){return Yn(this,this)};
  function Yn(a,b){var c=b.Va;return null!==c?Yn(a,c):b instanceof S&&(c=b.Md,null!==c)?Yn(a,c):b}w.A(H,{$w:"isTopLevel"},function(){return null!==this.Va||this instanceof S&&this.zf?!1:!0});H.prototype.isMemberOf=H.prototype.Uh=function(a){return a instanceof T?Zn(this,this,a):!1};function Zn(a,b,c){if(b===c||null===c)return!1;var d=b.Va;return null===d||d!==c&&!Zn(a,d,c)?b instanceof S&&(b=b.Md,null!==b)?Zn(a,b,c):!1:!0}
  H.prototype.findCommonContainingGroup=H.prototype.II=function(a){if(null===a)return null;t&&w.l(a,H,H,"findCommonContainingGroup:other");if(this===a)return this instanceof T?this:null;for(var b=this;null!==b;)b instanceof T&&Un(b,!0),b=b.Va;for(var c=null,b=a;null!==b;){if(0!==(b.Q&1048576)){c=b;break}b=b.Va}for(b=this;null!==b;)b instanceof T&&Un(b,!1),b=b.Va;return c};w.g(H,"layoutConditions",H.prototype.tF);
  w.defineProperty(H,{tF:"layoutConditions"},function(){return this.kr},function(a){var b=this.kr;b!==a&&(t&&w.i(a,"number",H,"layoutConditions"),this.kr=a,this.j("layoutConditions",b,a))});H.prototype.canLayout=function(){if(!this.xA||!this.Ja())return!1;var a=this.layer;return null!==a&&a.Ac||this instanceof S&&this.zf?!1:!0};
  H.prototype.invalidateLayout=H.prototype.K=function(a){void 0===a&&(a=16777215);var b;this.xA&&0!==(a&this.tF)?(b=this.layer,null!==b&&b.Ac||this instanceof S&&this.zf?b=!1:(b=this.h,b=null!==b&&b.ka.sb?!1:!0)):b=!1;if(b)if(b=this.Ck,null!==b){var c=b.Lb;null!==c?c.K():b.K(a)}else a=this.h,null!==a&&(c=a.Lb,null!==c&&c.K())};function Tj(a){if(!a.Ja())return!1;a=a.layer;return null!==a&&a.Ac?!1:!0}w.g(H,"dragComputation",H.prototype.Yz);
  w.defineProperty(H,{Yz:"dragComputation"},function(){return this.Bq},function(a){var b=this.Bq;b!==a&&(null!==a&&w.i(a,"function",H,"dragComputation"),this.Bq=a,this.j("dragComputation",b,a))});w.g(H,"shadowOffset",H.prototype.wG);w.defineProperty(H,{wG:"shadowOffset"},function(){return this.um},function(a){var b=this.um;b.L(a)||(t&&w.l(a,x,H,"shadowOffset"),this.um=a=a.ba(),this.pa(),this.j("shadowOffset",b,a))});w.g(H,"shadowColor",H.prototype.shadowColor);
  w.defineProperty(H,{shadowColor:"shadowColor"},function(){return this.tm},function(a){var b=this.tm;b!==a&&(t&&w.i(a,"string",H,"shadowColor"),this.tm=a,this.pa(),this.j("shadowColor",b,a))});w.g(H,"shadowBlur",H.prototype.shadowBlur);w.defineProperty(H,{shadowBlur:"shadowBlur"},function(){return this.sm},function(a){var b=this.sm;b!==a&&(t&&w.i(a,"number",H,"shadowBlur"),this.sm=a,this.pa(),this.j("shadowBlur",b,a))});
  function tf(a){0===arguments.length?H.call(this,Mh):H.call(this,a);this.hf="Adornment";this.Jb=null;this.Q&=-257;this.Yg=new x(NaN,NaN);this.ej=new D(y);this.Tb=null}w.Ia(tf,H);w.ja("Adornment",tf);tf.prototype.toString=function(){var a=this.Nh;return"Adornment("+this.Gc+")"+(null!==a?a.toString():"")};tf.prototype.updateRelationshipsFromData=function(){};
  tf.prototype.Et=function(){var a=this.wc.V,b=this.wc;if(a instanceof U&&b instanceof W){var c=a.path,b=c.Ta;a.Et();for(var b=c.Ta,a=this.Ca.q,c=a.length,d=0;d<c;d++){var e=a[d];e.Tf&&e instanceof W&&(e.Ta=b)}}};w.A(tf,{placeholder:"placeholder"},function(){return this.Tb});w.g(tf,"adornedObject",tf.prototype.wc);
  w.defineProperty(tf,{wc:"adornedObject"},function(){return this.Jb},function(a){t&&null!==a&&w.l(a,P,H,"adornedObject:value");var b=this.Nh,c=null;null!==a&&(c=a.V);null===b||null!==a&&b===c||b.Bl(this.Gc);this.Jb=a;null!==c&&c.bl(this.Gc,this)});w.A(tf,{Nh:"adornedPart"},function(){var a=this.Jb;return null!==a?a.V:null});tf.prototype.tl=function(){var a=this.Jb;if(null===a)return!0;a=a.V;return null===a||!Hj(a)};tf.prototype.Kd=function(){return!1};w.A(tf,{Va:"containingGroup"},function(){return null});
  tf.prototype.fn=function(a,b,c,d,e,g,h){if(a===he&&"elements"===b)if(e instanceof xh){var k=e;null===this.Tb?this.Tb=k:this.Tb!==k&&w.m("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else e instanceof z&&(k=e.lt(function(a){return a instanceof xh}),k instanceof xh&&(null===this.Tb?this.Tb=k:this.Tb!==k&&w.m("Cannot insert a second Placeholder into the visual tree of an Adornment.")));else a===ie&&"elements"===b&&null!==this.Tb&&(d===this.Tb?this.Tb=null:d instanceof z&&
  this.Tb.sl(d)&&(this.Tb=null));H.prototype.fn.call(this,a,b,c,d,e,g,h)};tf.prototype.updateAdornments=function(){};tf.prototype.Om=function(){};function S(a){0===arguments.length?H.call(this,Mh):H.call(this,a);this.kc=new D(U);this.ho=this.Pk=this.nr=this.mr=null;this.dr=!0;this.Ps=!1;this.Ks=null;this.kq=this.er=!0;this.lq=J.gH;this.Wd=this.oh=null;this.$r=$n;this.Oj=!1}w.Ia(S,H);w.ja("Node",S);
  S.prototype.cloneProtected=function(a){H.prototype.cloneProtected.call(this,a);a.mr=this.mr;a.nr=this.nr;a.Pk=this.Pk;a.dr=this.dr;a.Ps=this.Ps;a.Ks=this.Ks;a.er=this.er;a.kq=this.kq;a.lq=this.lq.ba();a.$r=this.$r};S.prototype.Qh=function(a){H.prototype.Qh.call(this,a);a.yf();a.oh=this.oh;a.Wd=null};var ao;S.DirectionDefault=ao=w.w(S,"DirectionDefault",0);S.DirectionAbsolute=w.w(S,"DirectionAbsolute",1);var bo;S.DirectionRotatedNode=bo=w.w(S,"DirectionRotatedNode",2);var ll;
  S.DirectionRotatedNodeOrthogonal=ll=w.w(S,"DirectionRotatedNodeOrthogonal",3);S.SpreadingNone=w.w(S,"SpreadingNone",10);var $n;S.SpreadingEvenly=$n=w.w(S,"SpreadingEvenly",11);var co;S.SpreadingPacked=co=w.w(S,"SpreadingPacked",12);function eo(a,b){null!==b&&(null===a.oh&&(a.oh=new F(fo)),a.oh.add(b))}
  S.prototype.fn=function(a,b,c,d,e,g,h){a===he&&"elements"===b?this.Wd=null:a===ie&&"elements"===b&&(null===this.h?this.Wd=null:d instanceof P&&Rm(this,d,function(a,b){Ol(a,b,!0)}));H.prototype.fn.call(this,a,b,c,d,e,g,h)};S.prototype.invalidateConnectedLinks=S.prototype.yf=function(a){void 0===a&&(a=null);for(var b=this.ve;b.next();){var c=b.value;null!==a&&a.contains(c)||(ho(this,c.vd),ho(this,c.le),c.$b())}};function ho(a,b){if(null!==b){b.Zr=null;var c=a.Va;null===c||c.Ld||ho(c,c.ll(""))}}
  S.prototype.tl=function(){return!0};w.defineProperty(S,{HJ:"portSpreading"},function(){return this.$r},function(a){var b=this.$r;b!==a&&(t&&w.za(a,S,S,"portSpreading"),this.$r=a,this.j("portSpreading",b,a),a=this.h,null!==a&&a.ka.sb||this.yf())});w.g(S,"avoidable",S.prototype.Qz);w.defineProperty(S,{Qz:"avoidable"},function(){return this.kq},function(a){var b=this.kq;if(b!==a){t&&w.i(a,"boolean",S,"avoidable");this.kq=a;var c=this.h;null!==c&&Sk(c,this);this.j("avoidable",b,a)}});
  w.g(S,"avoidableMargin",S.prototype.VD);w.defineProperty(S,{VD:"avoidableMargin"},function(){return this.lq},function(a){"number"===typeof a?a=new eb(a):w.l(a,eb,S,"avoidableMargin");var b=this.lq;if(!b.L(a)){this.lq=a=a.ba();var c=this.h;null!==c&&Sk(c,this);this.j("avoidableMargin",b,a)}});S.prototype.canAvoid=function(){return this.Qz&&!this.zf};S.prototype.getAvoidableRect=function(a){a.set(this.ea);a.gw(this.VD);return a};
  S.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.Ja();)a=a.Va;return a};S.prototype.Qe=function(a){H.prototype.Qe.call(this,a);for(var b=this.ve;b.next();)b.value.Qe(a)};w.A(S,{ve:"linksConnected"},function(){return this.kc.k});S.prototype.findLinksConnected=S.prototype.GE=function(a){void 0===a&&(a=null);if(null===a)return this.kc.k;t&&w.i(a,"string",S,"findLinksConnected:pid");var b=new Fa(this.kc),c=this;b.yl=function(b){return b.Z===c&&b.Rf===a||b.da===c&&b.Og===a};return b};
  S.prototype.findLinksOutOf=S.prototype.Iw=function(a){void 0===a&&(a=null);t&&null!==a&&w.i(a,"string",S,"findLinksOutOf:pid");var b=new Fa(this.kc),c=this;b.yl=function(b){return b.Z!==c?!1:null===a?!0:b.Rf===a};return b};S.prototype.findLinksInto=S.prototype.wg=function(a){void 0===a&&(a=null);t&&null!==a&&w.i(a,"string",S,"findLinksInto:pid");var b=new Fa(this.kc),c=this;b.yl=function(b){return b.da!==c?!1:null===a?!0:b.Og===a};return b};
  S.prototype.findNodesConnected=S.prototype.HE=function(a){void 0===a&&(a=null);t&&null!==a&&w.i(a,"string",S,"findNodesConnected:pid");for(var b=null,c=null,d=this.kc.k;d.next();){var e=d.value;if(e.Z===this){if(null===a||e.Rf===a)e=e.da,null!==b?b.add(e):null!==c&&c!==e?(b=new F(S),b.add(c),b.add(e)):c=e}else e.da!==this||null!==a&&e.Og!==a||(e=e.Z,null!==b?b.add(e):null!==c&&c!==e?(b=new F(S),b.add(c),b.add(e)):c=e)}return null!==b?b.k:null!==c?new Ea(c):Ca};
  S.prototype.findNodesOutOf=function(a){void 0===a&&(a=null);t&&null!==a&&w.i(a,"string",S,"findNodesOutOf:pid");for(var b=null,c=null,d=this.kc.k;d.next();){var e=d.value;e.Z!==this||null!==a&&e.Rf!==a||(e=e.da,null!==b?b.add(e):null!==c&&c!==e?(b=new F(S),b.add(c),b.add(e)):c=e)}return null!==b?b.k:null!==c?new Ea(c):Ca};
  S.prototype.findNodesInto=function(a){void 0===a&&(a=null);t&&null!==a&&w.i(a,"string",S,"findNodesInto:pid");for(var b=null,c=null,d=this.kc.k;d.next();){var e=d.value;e.da!==this||null!==a&&e.Og!==a||(e=e.Z,null!==b?b.add(e):null!==c&&c!==e?(b=new F(S),b.add(c),b.add(e)):c=e)}return null!==b?b.k:null!==c?new Ea(c):Ca};
  S.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);t&&(w.l(a,S,S,"findLinksBetween:othernode"),null!==b&&w.i(b,"string",S,"findLinksBetween:pid"),null!==c&&w.i(c,"string",S,"findLinksBetween:otherpid"));var d=new Fa(this.kc),e=this;d.yl=function(d){return(d.Z!==e||d.da!==a||null!==b&&d.Rf!==b||null!==c&&d.Og!==c)&&(d.Z!==a||d.da!==e||null!==c&&d.Rf!==c||null!==b&&d.Og!==b)?!1:!0};return d};
  S.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);t&&(w.l(a,S,S,"findLinksTo:othernode"),null!==b&&w.i(b,"string",S,"findLinksTo:pid"),null!==c&&w.i(c,"string",S,"findLinksTo:otherpid"));var d=new Fa(this.kc),e=this;d.yl=function(d){return d.Z!==e||d.da!==a||null!==b&&d.Rf!==b||null!==c&&d.Og===c?!1:!0};return d};w.g(S,"linkConnected",S.prototype.uF);
  w.defineProperty(S,{uF:"linkConnected"},function(){return this.mr},function(a){var b=this.mr;b!==a&&(null!==a&&w.i(a,"function",S,"linkConnected"),this.mr=a,this.j("linkConnected",b,a))});w.g(S,"linkDisconnected",S.prototype.vF);w.defineProperty(S,{vF:"linkDisconnected"},function(){return this.nr},function(a){var b=this.nr;b!==a&&(null!==a&&w.i(a,"function",S,"linkDisconnected"),this.nr=a,this.j("linkDisconnected",b,a))});w.g(S,"linkValidation",S.prototype.tp);
  w.defineProperty(S,{tp:"linkValidation"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(null!==a&&w.i(a,"function",S,"linkValidation"),this.Pk=a,this.j("linkValidation",b,a))});
  function io(a,b,c){ho(a,c);if(!a.kc.contains(b)){a.kc.add(b);var d=a.uF;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.Pa,g.Pa=!0);d(a,b,c);null!==g&&(g.Pa=e)}b.Bc&&(c=b.Z,b=b.da,null!==c&&null!==b&&c!==b&&(d=!0,g=a.h,null!==g&&(d=g.ld),a=d?b:c,e=d?c:b,a.Oj||(a.Oj=e),!e.Vh||null!==g&&g.ka.sb||(d?c===e&&(e.Vh=!1):b===e&&(e.Vh=!1))))}}
  function jo(a,b,c){ho(a,c);if(a.kc.remove(b)){var d=a.vF,e=a.h;if(null!==d){var g=!0;null!==e&&(g=e.Pa,e.Pa=!0);d(a,b,c);null!==e&&(e.Pa=g)}b.Bc&&(c=!0,null!==e&&(c=e.ld),a=c?b.da:b.Z,b=c?b.Z:b.da,null!==a&&(a.Oj=!1),null===b||b.Vh||(0===b.kc.count?(b.Oj=null,null!==e&&e.ka.sb||(b.Vh=!0)):Lk(b)))}}
  function Lk(a){a.Oj=!1;if(0!==a.kc.count){var b=!0,c=a.h;if(null===c||!c.ka.sb){null!==c&&(b=c.ld);for(c=a.kc.k;c.next();){var d=c.value;if(d.Bc)if(b){if(d.Z===a){a.Vh=!1;return}}else if(d.da===a){a.Vh=!1;return}}a.Vh=!0}}}
  S.prototype.updateRelationshipsFromData=function(){H.prototype.updateRelationshipsFromData.call(this);var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.fa;if(c instanceof xe){var d=c.Vm(a),b=b.cf(d),e=this.Rm();b!==e&&(b=null!==e?c.Cb(e.data):void 0,e=c.en,"function"===typeof e?e(a,b):a[e]=b,c.kh(a,d))}}}};S.prototype.ut=function(a){H.prototype.ut.call(this,a);a||Lk(this);var b=this.ho;null===b||a||ko(b,this)};
  S.prototype.vt=function(a){H.prototype.vt.call(this,a);var b=this.ho;null===b||a||null===b.Ae||(b.Ae.remove(this),b.T())};S.prototype.Om=function(){if(0<this.kc.count){var a=this.h;if(null===a)return;for(var b=this.kc.copy().k;b.next();)a.remove(b.value)}this.Md=null;H.prototype.Om.call(this)};w.A(S,{zf:"isLinkLabel"},function(){return null!==this.ho});w.g(S,"labeledLink",S.prototype.Md);
  w.defineProperty(S,{Md:"labeledLink"},function(){return this.ho},function(a){var b=this.ho;if(b!==a){t&&null!==a&&w.l(a,U,S,"labeledLink");var c=this.h,d=this.data;if(null!==b&&(null!==b.Ae&&(b.Ae.remove(this),b.T()),null!==c&&null!==d&&!c.ka.sb)){var e=b.data,g=c.fa;if(null!==e&&g instanceof R){var h=g.Cb(d);void 0!==h&&g.YF(e,h)}}this.ho=a;null!==a&&(ko(a,this),null===c||null===d||c.ka.sb||(e=a.data,g=c.fa,null!==e&&g instanceof R&&(h=g.Cb(d),void 0!==h&&g.Jz(e,h))));Hl(this);this.j("labeledLink",
  b,a)}});S.prototype.findPort=S.prototype.ll=function(a){t&&w.i(a,"string",S,"findPort:pid");if(null===this.Wd){if(""===a&&!1===this.yh)return this;Pl(this)}var b=this.Wd.Aa(a);return null!==b||""!==a&&(b=this.Wd.Aa(""),null!==b)?b:this};w.A(S,{port:"port"},function(){return this.ll("")});w.A(S,{ports:"ports"},function(){null===this.Wd&&Pl(this);return this.Wd.qF});
  function Pl(a){null===a.Wd?a.Wd=new ia("string",P):a.Wd.clear();Rm(a,a,function(a,c){var d=c.wd;null!==d&&a.Wd.add(d,c)});0===a.Wd.count&&a.Wd.add("",a)}function Ol(a,b,c){var d=b.wd;if(null!==d&&(null!==a.Wd&&a.Wd.remove(d),b=a.h,null!==b&&c)){c=null;for(d=a.GE(d);d.next();)a=d.value,null===c&&(c=w.lb()),c.push(a);if(null!==c){for(d=0;d<c.length;d++)a=c[d],b.remove(a);w.xa(c)}}}
  S.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.h;null!==c&&(b=c.ld);c=this;if(b)for(;c!==a;){for(var b=null,d=c.kc.k;d.next();){var e=d.value;if(e.Bc&&(b=e.Z,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.kc.k;d.next()&&(e=d.value,!e.Bc||(b=e.da,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
  S.prototype.findTreeRoot=function(){var a=!0,b=this.h;null!==b&&(a=b.ld);b=this;if(a)for(;;){for(var a=null,c=b.kc.k;c.next();){var d=c.value;if(d.Bc&&(a=d.Z,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.kc.k;c.next()&&(d=c.value,!d.Bc||(a=d.da,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
  S.prototype.findCommonTreeParent=function(a){if(null===a)return null;t&&w.l(a,S,S,"findCommonTreeParent:other");if(this===a)return this;for(var b=this;null!==b;)Un(b,!0),b=b.Rm();for(var c=null,b=a;null!==b;){if(0!==(b.Q&1048576)){c=b;break}b=b.Rm()}for(b=this;null!==b;)Un(b,!1),b=b.Rm();return c};
  S.prototype.findTreeParentLink=S.prototype.pt=function(){var a=!0,b=this.h;null!==b&&(a=b.ld);b=this.kc.k;if(a)for(;b.next();){if(a=b.value,a.Bc&&a.Z!==this)return a}else for(;b.next();)if(a=b.value,a.Bc&&a.da!==this)return a;return null};
  S.prototype.findTreeParentNode=S.prototype.Rm=function(){var a=this.Oj;if(null===a)return null;if(a instanceof S)return a;var b=!0,a=this.h;null!==a&&(b=a.ld);a=this.kc.k;if(b)for(;a.next();){if(b=a.value,b.Bc&&(b=b.Z,b!==this))return this.Oj=b}else for(;a.next();)if(b=a.value,b.Bc&&(b=b.da,b!==this))return this.Oj=b;return this.Oj=null};S.prototype.findTreeLevel=function(){return lo(this,this)};function lo(a,b){var c=b.Rm();return null===c?0:1+lo(a,c)}
  S.prototype.findTreeChildrenLinks=S.prototype.Kw=function(){var a=!0,b=this.h;null!==b&&(a=b.ld);if(a){var a=new Fa(this.kc),c=this;a.yl=function(a){return a.Bc&&a.Z===c?!0:!1}}else a=new Fa(this.kc),c=this,a.yl=function(a){return a.Bc&&a.da===c?!0:!1};return a};
  S.prototype.findTreeChildrenNodes=S.prototype.JE=function(){var a=!0,b=this.h;null!==b&&(a=b.ld);var c=b=null,d=this.kc.k;if(a)for(;d.next();)a=d.value,a.Bc&&a.Z===this&&(a=a.da,null!==b?b.add(a):null!==c&&c!==a?(b=new D(S),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.Bc&&a.da===this&&(a=a.Z,null!==b?b.add(a):null!==c&&c!==a?(b=new D(S),b.add(c),b.add(a)):c=a);return null!==b?b.k:null!==c?new Ea(c):Ca};
  S.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);w.i(a,"number",S,"collapseTree:level");var b=new F(H);sf(b,this,!1,a,!0);return b};S.prototype.collapseTree=S.prototype.collapseTree=function(a){void 0===a&&(a=1);w.p(a,S,"collapseTree:level");1>a&&(a=1);var b=this.h;if(null!==b&&!b.ee){var c=b.Pb;0!==b.ka.Ve&&c.zl();b.ee=!0;var c=b.ld,d=new F(S);d.add(this);mo(this,d,c,a,this.Qc);b.ee=!1}};
  function mo(a,b,c,d,e){if(1<d)for(e=c?a.Iw():a.wg();e.next();){var g=e.value;g.Bc&&(g=g.gA(a),null===g||g===a||b.contains(g)||(b.add(g),mo(g,b,c,d-1,g.Qc)))}else no(a,b,c,e)}function no(a,b,c,d){for(var e=c?a.Iw():a.wg();e.next();){var g=e.value;g.Bc&&(g=g.gA(a),null===g||g===a||b.contains(g)||(b.add(g),d&&(g.rl(),g.Qe(!1)),g.Qc&&(g.mn=g.Qc,no(g,b,c,g.mn))))}a.Qc=!1}
  S.prototype.expandTree=S.prototype.expandTree=function(a){void 0===a&&(a=2);w.p(a,S,"expandTree:level");2>a&&(a=2);var b=this.h;if(null!==b&&!b.ee){var c=b.Pb;0!==b.ka.Ve&&c.zl();b.ee=!0;var d=b.ld,e=new F(S);e.add(this);oo(this,e,d,a,this.Qc,c,this);b.ee=!1}};function oo(a,b,c,d,e,g,h){for(var k=c?a.Iw():a.wg();k.next();){var l=k.value;l.Bc&&(e||l.qg||l.$b(),l=l.gA(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),e||(l.Qe(!0),l.rl(),zi(g,l,h)),2<d||l.mn))&&(l.mn=!1,oo(l,b,c,d-1,l.Qc,g,h))}a.Qc=!0}
  w.g(S,"isTreeExpanded",S.prototype.Qc);
  w.defineProperty(S,{Qc:"isTreeExpanded"},function(){return this.dr},function(a){var b=this.dr;if(b!==a){t&&w.i(a,"boolean",S,"isTreeExpanded");this.dr=a;var c=this.h;this.j("isTreeExpanded",b,a);b=this.TG;if(null!==b){var d=!0;null!==c&&(d=c.Pa,c.Pa=!0);b(this);null!==c&&(c.Pa=d)}a?null===c||c.ee||(0!==c.ka.Ve&&c.Pb.zl(),c.ee=!0,a=c.ld,b=new F(S),b.add(this),oo(this,b,a,2,!1,c.Pb,this),c.ee=!1):null===c||c.ee||(0!==c.ka.Ve&&c.Pb.zl(),c.ee=!0,a=c.ld,b=new F(S),b.add(this),no(this,b,a,!0),c.ee=!1)}});
  w.g(S,"wasTreeExpanded",S.prototype.mn);w.defineProperty(S,{mn:"wasTreeExpanded"},function(){return this.Ps},function(a){var b=this.Ps;b!==a&&(t&&w.i(a,"boolean",S,"wasTreeExpanded"),this.Ps=a,this.j("wasTreeExpanded",b,a))});w.g(S,"treeExpandedChanged",S.prototype.TG);w.defineProperty(S,{TG:"treeExpandedChanged"},function(){return this.Ks},function(a){var b=this.Ks;b!==a&&(null!==a&&w.i(a,"function",S,"treeExpandedChanged"),this.Ks=a,this.j("treeExpandedChanged",b,a))});w.g(S,"isTreeLeaf",S.prototype.Vh);
  w.defineProperty(S,{Vh:"isTreeLeaf"},function(){return this.er},function(a){var b=this.er;b!==a&&(t&&w.i(a,"boolean",S,"isTreeLeaf"),this.er=a,this.j("isTreeLeaf",b,a))});
  function U(){H.call(this,gh);this.eg=null;this.xh="";this.pg=this.Jq=null;this.Lh="";this.Js=null;this.fs=this.es=this.ds=!1;this.fr=!0;this.fq=jh;this.sq=0;this.vq=jh;this.wq=NaN;this.nm=am;this.As=.5;this.Ae=null;this.Vc=(new D(x)).freeze();this.ro=this.Be=null;this.qg=!1;this.iz=null;this.rz=!1;this.yn=this.li=this.Ta=null;this.of=0;this.Kn=this.Gn=null;this.ej=new D(y);this.wz=new x;this.vD=this.tD=null;this.iy=!1;this.S=null}w.Ia(U,H);w.ja("Link",U);
  U.prototype.cloneProtected=function(a){H.prototype.cloneProtected.call(this,a);a.xh=this.xh;a.Jq=this.Jq;a.Lh=this.Lh;a.Js=this.Js;a.ds=this.ds;a.es=this.es;a.fs=this.fs;a.fr=this.fr;a.fq=this.fq;a.sq=this.sq;a.vq=this.vq;a.wq=this.wq;a.nm=this.nm;a.As=this.As;a.S=null!==this.S?this.S.copy():null};U.prototype.Qh=function(a){H.prototype.Qh.call(this,a);this.xh=a.xh;this.Lh=a.Lh;a.Be=null;a.$b();a.yn=this.yn;a.of=this.of};var am;U.Normal=am=w.w(U,"Normal",1);U.Orthogonal=w.w(U,"Orthogonal",2);
  U.AvoidsNodes=w.w(U,"AvoidsNodes",6);var po;U.AvoidsNodesStraight=po=w.w(U,"AvoidsNodesStraight",7);var jh;U.None=jh=w.w(U,"None",0);var sh;U.Bezier=sh=w.w(U,"Bezier",9);var ih;U.JumpGap=ih=w.w(U,"JumpGap",10);var hh;U.JumpOver=hh=w.w(U,"JumpOver",11);var Yl;U.End=Yl=w.w(U,"End",17);var Zl;U.Scale=Zl=w.w(U,"Scale",18);var $l;U.Stretch=$l=w.w(U,"Stretch",19);var hn;U.OrientAlong=hn=w.w(U,"OrientAlong",21);var qo;U.OrientPlus90=qo=w.w(U,"OrientPlus90",22);var ro;
  U.OrientMinus90=ro=w.w(U,"OrientMinus90",23);var so;U.OrientOpposite=so=w.w(U,"OrientOpposite",24);var to;U.OrientUpright=to=w.w(U,"OrientUpright",25);var uo;U.OrientPlus90Upright=uo=w.w(U,"OrientPlus90Upright",26);var vo;U.OrientMinus90Upright=vo=w.w(U,"OrientMinus90Upright",27);var wo;U.OrientUpright45=wo=w.w(U,"OrientUpright45",28);U.prototype.Oe=function(){this.S=new kl};
  U.prototype.tl=function(){var a=this.Z;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Hj(a)||Ij(a))return!1}a=this.da;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Hj(a)||Ij(a))?!1:!0};U.prototype.jB=function(){return!1};U.prototype.Kd=function(){return!1};
  U.prototype.computeAngle=function(a,b,c){a=0;switch(b){default:case jh:a=0;break;case hn:a=c;break;case qo:a=c+90;break;case ro:a=c-90;break;case so:a=c+180;break;case to:a=J.Mt(c);90<a&&270>a&&(a-=180);break;case uo:a=J.Mt(c+90);90<a&&270>a&&(a-=180);break;case vo:a=J.Mt(c-90);90<a&&270>a&&(a-=180);break;case wo:a=J.Mt(c);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return J.Mt(a)};w.g(U,"fromNode",U.prototype.Z);
  w.defineProperty(U,{Z:"fromNode"},function(){return this.eg},function(a){var b=this.eg;if(b!==a){t&&null!==a&&w.l(a,S,U,"fromNode");var c=this.vd;null!==b&&(this.pg!==b&&jo(b,this,c),xo(this),this.K(Vj));this.eg=a;this.li=null;this.$b();var d=this.h;if(null!==d){var e=this.data,g=d.fa;if(null!==e)if(g instanceof R){var h=null!==a?a.data:null;g.Ax(e,g.Cb(h))}else g instanceof xe&&(h=null!==a?a.data:null,d.ld?g.kh(e,g.Cb(h)):(null!==b&&g.kh(b.data,void 0),g.kh(h,g.Cb(null!==this.pg?this.pg.data:null))))}e=
  this.vd;g=this.cA;null!==g&&(h=!0,null!==d&&(h=d.Pa,d.Pa=!0),g(this,c,e),null!==d&&(d.Pa=h));null!==a&&(this.pg!==a&&io(a,this,e),yo(this),this.K(Pj));this.j("fromNode",b,a);zk(this)}});w.g(U,"fromPortId",U.prototype.Rf);
  w.defineProperty(U,{Rf:"fromPortId"},function(){return this.xh},function(a){var b=this.xh;if(b!==a){t&&w.i(a,"string",U,"fromPortId");var c=this.vd;null!==c&&ho(this.Z,c);xo(this);this.xh=a;var d=this.vd;null!==d&&ho(this.Z,d);var e=this.h;if(null!==e){var g=this.data,h=e.fa;null!==g&&h instanceof R&&h.gB(g,a)}c!==d&&(this.li=null,this.$b(),g=this.cA,null!==g&&(h=!0,null!==e&&(h=e.Pa,e.Pa=!0),g(this,c,d),null!==e&&(e.Pa=h)));yo(this);this.j("fromPortId",b,a)}});
  w.A(U,{vd:"fromPort"},function(){var a=this.eg;return null===a?null:a.ll(this.xh)});w.g(U,"fromPortChanged",U.prototype.cA);w.defineProperty(U,{cA:"fromPortChanged"},function(){return this.Jq},function(a){var b=this.Jq;b!==a&&(null!==a&&w.i(a,"function",U,"fromPortChanged"),this.Jq=a,this.j("fromPortChanged",b,a))});w.g(U,"toNode",U.prototype.da);
  w.defineProperty(U,{da:"toNode"},function(){return this.pg},function(a){var b=this.pg;if(b!==a){t&&null!==a&&w.l(a,S,U,"toNode");var c=this.le;null!==b&&(this.eg!==b&&jo(b,this,c),xo(this),this.K(Vj));this.pg=a;this.li=null;this.$b();var d=this.h;if(null!==d){var e=this.data,g=d.fa;if(null!==e)if(g instanceof R){var h=null!==a?a.data:null;g.Cx(e,g.Cb(h))}else g instanceof xe&&(h=null!==a?a.data:null,d.ld?(null!==b&&g.kh(b.data,void 0),g.kh(h,g.Cb(null!==this.eg?this.eg.data:null))):g.kh(e,g.Cb(h)))}e=
  this.le;g=this.rB;null!==g&&(h=!0,null!==d&&(h=d.Pa,d.Pa=!0),g(this,c,e),null!==d&&(d.Pa=h));null!==a&&(this.eg!==a&&io(a,this,e),yo(this),this.K(Pj));this.j("toNode",b,a);zk(this)}});w.g(U,"toPortId",U.prototype.Og);
  w.defineProperty(U,{Og:"toPortId"},function(){return this.Lh},function(a){var b=this.Lh;if(b!==a){t&&w.i(a,"string",U,"toPortId");var c=this.le;null!==c&&ho(this.da,c);xo(this);this.Lh=a;var d=this.le;null!==d&&ho(this.da,d);var e=this.h;if(null!==e){var g=this.data,h=e.fa;null!==g&&h instanceof R&&h.kB(g,a)}c!==d&&(this.li=null,this.$b(),g=this.rB,null!==g&&(h=!0,null!==e&&(h=e.Pa,e.Pa=!0),g(this,c,d),null!==e&&(e.Pa=h)));yo(this);this.j("toPortId",b,a)}});
  w.A(U,{le:"toPort"},function(){var a=this.pg;return null===a?null:a.ll(this.Lh)});w.g(U,"toPortChanged",U.prototype.rB);w.defineProperty(U,{rB:"toPortChanged"},function(){return this.Js},function(a){var b=this.Js;b!==a&&(null!==a&&w.i(a,"function",U,"toPortChanged"),this.Js=a,this.j("toPortChanged",b,a))});
  w.defineProperty(U,{wb:"fromSpot"},function(){return null!==this.S?this.S.mj:zc},function(a){null===this.S&&this.Oe();var b=this.S.mj;b.L(a)||(t&&w.l(a,K,U,"fromSpot"),a=a.ba(),this.S.mj=a,this.j("fromSpot",b,a),this.$b())});
  w.defineProperty(U,{ek:"fromEndSegmentLength"},function(){return null!==this.S?this.S.kj:NaN},function(a){null===this.S&&this.Oe();var b=this.S.kj;b!==a&&(t&&w.i(a,"number",U,"fromEndSegmentLength"),0>a&&w.la(a,">= 0",U,"fromEndSegmentLength"),this.S.kj=a,this.j("fromEndSegmentLength",b,a),this.$b())});
  w.defineProperty(U,{$o:"fromEndSegmentDirection"},function(){return null!==this.S?this.S.jj:ao},function(a){null===this.S&&this.Oe();var b=this.S.jj;b!==a&&(t&&w.za(a,S,U,"fromEndSegmentDirection"),this.S.jj=a,this.j("fromEndSegmentDirection",b,a),this.$b())});w.defineProperty(U,{ap:"fromShortLength"},function(){return null!==this.S?this.S.lj:NaN},function(a){null===this.S&&this.Oe();var b=this.S.lj;b!==a&&(t&&w.i(a,"number",U,"fromShortLength"),this.S.lj=a,this.j("fromShortLength",b,a),this.$b())});
  w.defineProperty(U,{yb:"toSpot"},function(){return null!==this.S?this.S.Nj:zc},function(a){null===this.S&&this.Oe();var b=this.S.Nj;b.L(a)||(t&&w.l(a,K,U,"toSpot"),a=a.ba(),this.S.Nj=a,this.j("toSpot",b,a),this.$b())});
  w.defineProperty(U,{mk:"toEndSegmentLength"},function(){return null!==this.S?this.S.Lj:NaN},function(a){null===this.S&&this.Oe();var b=this.S.Lj;b!==a&&(t&&w.i(a,"number",U,"toEndSegmentLength"),0>a&&w.la(a,">= 0",U,"toEndSegmentLength"),this.S.Lj=a,this.j("toEndSegmentLength",b,a),this.$b())});
  w.defineProperty(U,{Wp:"toEndSegmentDirection"},function(){return null!==this.S?this.S.Kj:ao},function(a){null===this.S&&this.Oe();var b=this.S.Kj;b!==a&&(t&&w.za(a,S,U,"toEndSegmentDirection"),this.S.Kj=a,this.j("toEndSegmentDirection",b,a),this.$b())});w.defineProperty(U,{Yp:"toShortLength"},function(){return null!==this.S?this.S.Mj:NaN},function(a){null===this.S&&this.Oe();var b=this.S.Mj;b!==a&&(t&&w.i(a,"number",U,"toShortLength"),this.S.Mj=a,this.j("toShortLength",b,a),this.$b())});
  function zk(a){var b=a.Z,c=a.da;null!==b?null!==c?zo(a,b.II(c)):zo(a,null):zo(a,null)}function zo(a,b){var c=a.Ck;if(c!==b){null!==c&&Vn(c,a);a.Ck=b;null!==b&&Wn(b,a);var d=a.Vz;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.Pa,g.Pa=!0);d(a,c,b);null!==g&&(g.Pa=e)}!a.qg||a.tD!==c&&a.vD!==c||a.$b()}}U.prototype.rl=function(){var a=this.Va;null!==a&&this.Z!==a&&this.da!==a&&H.prototype.rl.call(this)};
  U.prototype.getOtherNode=U.prototype.gA=function(a){t&&w.l(a,S,U,"getOtherNode:node");var b=this.Z;return a===b?this.da:b};U.prototype.getOtherPort=function(a){t&&w.l(a,P,U,"getOtherPort:port");var b=this.vd;return a===b?this.le:b};w.A(U,{CK:"isLabeledLink"},function(){return null===this.Ae?!1:0<this.Ae.count});w.A(U,{Bg:"labelNodes"},function(){return null===this.Ae?Ca:this.Ae.k});function ko(a,b){null===a.Ae&&(a.Ae=new F(S));a.Ae.add(b);a.T()}
  U.prototype.ut=function(a){H.prototype.ut.call(this,a);Ao(this)&&kh(this,this.ea);if(!a){a=this.eg;var b=this.pg;null!==a&&(io(a,this,this.vd),yo(this));null!==b&&(io(b,this,this.le),yo(this))}};U.prototype.vt=function(a){H.prototype.vt.call(this,a);Ao(this)&&kh(this,this.ea);if(!a){a=this.eg;var b=this.pg;null!==a&&(jo(a,this,this.vd),xo(this));null!==b&&(jo(b,this,this.le),xo(this))}};
  U.prototype.Om=function(){this.qg=!0;if(null!==this.Ae){var a=this.h;if(null===a)return;for(var b=this.Ae.copy().k;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.h,null!==a&&(a=a.fa,a instanceof R?a.UA(b):a instanceof xe&&a.kh(b,void 0)))};
  U.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.fa;if(c instanceof R){var d=c.nl(a),e=b.cf(d),g=this.Z;e!==g&&(e=null!==g?c.Cb(g.data):void 0,g=c.$m,"function"===typeof g?g(a,e):a[g]=e,c.Ax(a,d));d=c.ql(a);e=b.cf(d);g=this.da;e!==g&&(e=null!==g?c.Cb(g.data):void 0,g=c.an,"function"===typeof g?g(a,e):a[g]=e,c.Cx(a,d));var h=c.fk(a);if(0<h.length||0<this.Bg.count){if(1===h.length&&1===this.Bg.count&&(b=h[0],d=this.Bg.first(),c.Cb(d.data)===
  b))return;var d=(new F).Zd(h),k=new F;this.Bg.each(function(a){null!==a.data&&(a=c.Cb(a.data),void 0!==a&&k.add(a))});b=k.copy();b.VF(d);d=d.copy();d.VF(k);if(0<b.count||0<d.count)h.length=0,k.each(function(a){h.push(a)}),b.each(function(b){c.YF(a,b)}),d.each(function(b){c.Jz(a,b)})}}}}};
  U.prototype.move=U.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;H.prototype.move.call(this,a);this.wl(c,b);for(a=this.Bg;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};w.g(U,"relinkableFrom",U.prototype.TF);w.defineProperty(U,{TF:"relinkableFrom"},function(){return this.ds},function(a){var b=this.ds;b!==a&&(t&&w.i(a,"boolean",U,"relinkableFrom"),this.ds=a,this.j("relinkableFrom",b,a),this.de())});w.g(U,"relinkableTo",U.prototype.UF);
  w.defineProperty(U,{UF:"relinkableTo"},function(){return this.es},function(a){var b=this.es;b!==a&&(t&&w.i(a,"boolean",U,"relinkableTo"),this.es=a,this.j("relinkableTo",b,a),this.de())});U.prototype.canRelinkFrom=function(){if(!this.TF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Sj)return!1;a=a.h;return null===a||a.Sj?!0:!1};U.prototype.canRelinkTo=function(){if(!this.UF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Sj)return!1;a=a.h;return null===a||a.Sj?!0:!1};
  w.g(U,"resegmentable",U.prototype.Ip);w.defineProperty(U,{Ip:"resegmentable"},function(){return this.fs},function(a){var b=this.fs;b!==a&&(t&&w.i(a,"boolean",U,"resegmentable"),this.fs=a,this.j("resegmentable",b,a),this.de())});w.g(U,"isTreeLink",U.prototype.Bc);w.defineProperty(U,{Bc:"isTreeLink"},function(){return this.fr},function(a){var b=this.fr;b!==a&&(t&&w.i(a,"boolean",U,"isTreeLink"),this.fr=a,this.j("isTreeLink",b,a),null!==this.Z&&Lk(this.Z),null!==this.da&&Lk(this.da))});
  w.A(U,{path:"path"},function(){var a=this.Qf();return a instanceof W?a:null});
  w.A(U,{gn:"routeBounds"},function(){this.updateRoute();var a=new y;var b=Infinity,c=Infinity,d=this.oa;if(0===d)a.o(NaN,NaN,0,0);else{if(1===d)d=this.n(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.o(d.x,d.y,0,0);else if(2===d){var e=this.n(0),g=this.n(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y);a.o(e.x,e.y,0,0);a.Zi(g)}else if(this.computeCurve()===sh&&3<=d&&!this.gc)if(e=this.n(0),b=e.x,c=e.y,a.o(b,c,0,0),3===d)d=this.n(1),b=Math.min(d.x,b),c=Math.min(d.y,c),g=this.n(2),b=Math.min(g.x,b),c=Math.min(g.y,
  c),J.Lo(e.x,e.y,d.x,d.y,d.x,d.y,g.x,g.y,.5,a);else for(var h=3;h<d;h+=3){var k=this.n(h-2);h+3>=d&&(h=d-1);var l=this.n(h-1),g=this.n(h);J.Lo(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.n(0),g=this.n(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.o(e.x,e.y,0,0),a.Zi(g),h=2;h<d;h++)e=this.n(h),b=Math.min(e.x,b),c=Math.min(e.y,c),a.Zi(e);this.wz.o(b-a.x,c-a.y)}return this.iz=a});w.A(U,{EF:"midPoint"},function(){this.updateRoute();return this.computeMidPoint(new x)});
  U.prototype.computeMidPoint=function(a){var b=this.oa;if(0===b)return a.assign(J.eH),a;if(1===b)return a.assign(this.n(0)),a;if(2===b){var c=this.n(0),d=this.n(1);a.o((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===sh&&3<=b&&!this.gc){if(3===b)return this.n(1);var b=(b-1)/3|0,e=3*(b/2|0);1===b%2?(c=this.n(e),d=this.n(e+1),b=this.n(e+2),e=this.n(e+3),J.eI(c.x,c.y,d.x,d.y,b.x,b.y,e.x,e.y,a)):a.assign(this.n(e));return a}for(var e=0,g=w.lb(),h=0;h<b-1;h++)c=0,c=this.n(h),d=this.n(h+1),J.rb(c.x,
  d.x)?(c=d.y-c.y,0>c&&(c=-c)):J.rb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Zj(d)),g.push(c),e+=c;for(d=h=c=0;c<e/2&&h<b;){d=g[h];if(c+d>e/2)break;c+=d;h++}w.xa(g);b=this.n(h);g=this.n(h+1);b.x===g.x?b.y>g.y?a.o(b.x,b.y-(e/2-c)):a.o(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.o(b.x-(e/2-c),b.y):a.o(b.x+(e/2-c),b.y):(e=(e/2-c)/d,a.o(b.x+e*(g.x-b.x),b.y+e*(g.y-b.y)));return a};w.A(U,{DF:"midAngle"},function(){this.updateRoute();return this.computeMidAngle()});
  U.prototype.computeMidAngle=function(){var a=this.oa;if(2>a)return NaN;if(this.computeCurve()===sh&&4<=a&&!this.gc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),a=this.n(c),b=this.n(c+1),d=this.n(c+2),c=this.n(c+3);return J.dI(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.n(c-1),b=this.n(c+1),a.Pi(b)}d=a/2|0;if(0===a%2)return a=this.n(d-1),b=this.n(d),a.Pi(b);var a=this.n(d-1),b=this.n(d),d=this.n(d+1),c=a.Zj(b),e=b.Zj(d);return c>e?a.Pi(b):b.Pi(d)};w.g(U,"points",U.prototype.points);
  w.defineProperty(U,{points:"points"},function(){return this.Vc},function(a){var b=this.Vc;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 D(x),d=0;d<a.length/2;d++)e=(new x(a[2*d],a[2*d+1])).freeze(),c.add(e);else{for(var g=!0,d=0;d<a.length;d++)if(e=a[d],!w.Xa(e)||"number"!==typeof e.x||isNaN(e.x)||"number"!==typeof e.y||isNaN(e.y)){g=!1;break}if(g)for(c=new D(x),d=0;d<a.length;d++)e=
  a[d],c.add((new x(e.x,e.y)).freeze());else w.m("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+a)}}else if(a instanceof D)for(c=a.copy(),a=c.k;a.next();)a.value.freeze();else w.m("Link.points value is not an instance of List or Array: "+a);c.freeze();this.Vc=c;this.se();Bo(this);this.h&&this.h.Pb.pd&&(this.ro=c);this.j("points",b,c)}});w.A(U,{oa:"pointsCount"},function(){return this.Vc.count});U.prototype.getPoint=U.prototype.n=function(a){return this.Vc.q[a]};
  U.prototype.setPoint=U.prototype.Ff=function(a,b){t&&(w.l(b,x,U,"setPoint"),b.J()||w.m("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.Mg(a,b)};U.prototype.setPointAt=U.prototype.aa=function(a,b,c){t&&(w.p(b,U,"setPointAt:x"),w.p(c,U,"setPointAt:y"));null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.Mg(a,new x(b,c))};
  U.prototype.insertPoint=function(a,b){t&&(w.l(b,x,U,"insertPoint"),b.J()||w.m("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.ce(a,b)};U.prototype.insertPointAt=U.prototype.C=function(a,b,c){t&&(w.p(b,U,"insertPointAt:x"),w.p(c,U,"insertPointAt:y"));null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.ce(a,new x(b,c))};
  U.prototype.addPoint=U.prototype.Mh=function(a){t&&(w.l(a,x,U,"addPoint"),a.J()||w.m("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.add(a)};U.prototype.addPointAt=U.prototype.cl=function(a,b){t&&(w.p(a,U,"insertPointAt:x"),w.p(b,U,"insertPointAt:y"));null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.add(new x(a,b))};
  U.prototype.removePoint=U.prototype.ZF=function(a){null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.md(a)};U.prototype.clearPoints=U.prototype.Mo=function(){null===this.Be&&w.m("Call Link.startRoute before modifying the points of the route.");this.Vc.clear()};
  U.prototype.movePoints=U.prototype.wl=function(a,b){for(var c=new D(x),d=this.Vc.k;d.next();){var e=d.value;c.add((new x(e.x+a,e.y+b)).freeze())}c.freeze();d=this.Vc;this.Vc=c;this.se();Bo(this);this.h&&this.h.Pb.pd&&(this.ro=c);this.j("points",d,c)};U.prototype.startRoute=U.prototype.Fl=function(){null===this.Be&&(this.Be=this.Vc,this.Vc=this.Vc.copy())};
  U.prototype.commitRoute=U.prototype.Li=function(){if(null!==this.Be){for(var a=this.Be,b=this.Vc,c=Infinity,d=Infinity,e=a.q,g=e.length,h=0;h<g;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.q,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===g)for(h=0;h<p;h++){if(g=e[h],k=n[h],g.x-c!==k.x-l||g.y-d!==k.y-m){this.se();break}}else this.se();this.Be=null;this.h&&this.h.Pb.pd&&(this.ro=b);Bo(this);this.j("points",a,b)}};
  U.prototype.rollbackRoute=U.prototype.MJ=function(){null!==this.Be&&(this.Vc=this.Be,this.Be=null)};function Bo(a){0===a.Vc.count?a.qg=!1:(a.qg=!0,a.Gn=a.n(0).copy(),a.Kn=a.n(a.oa-1).copy(),Co(a,!1))}U.prototype.invalidateRoute=U.prototype.$b=function(){if(!(this.rz||this.h&&this.h.ka.sb)){var a=this.path;null!==a&&(this.qg=!1,this.se(),a.T())}};w.defineProperty(U,{Up:null},function(){return this.rz},function(a){this.rz=a});
  U.prototype.updateRoute=function(){if(!this.qg&&!this.iy){var a=!0;try{this.iy=!0,this.Fl(),a=this.computePoints()}finally{this.iy=!1,a?this.Li():this.MJ()}}};
  U.prototype.computePoints=function(){var a=this.h;if(null===a)return!1;var b=this.Z,c=null;null===b?(a.om||(a.Hv=new W,a.Hv.ya=J.on,a.Hv.ib=0,a.om=new S,a.om.add(a.Hv),a.om.vf()),this.Gn&&(a.om.position=a.om.location=this.Gn,a.om.vf(),b=a.om,c=a.Hv)):c=this.vd;if(null!==c){var d=Ql(c);d!==b&&b.Ja()?c=d:(d=b.findVisibleNode(),null!==d&&d!==b?(b=d,c=d.ll("")):b=d)}this.tD=b;if(null===b||null===c||!b.location.J())return!1;var d=this.da,e=null;null===d?(a.pm||(a.Iv=new W,a.Iv.ya=J.on,a.Iv.ib=0,a.pm=new S,
  a.pm.add(a.Iv),a.pm.vf()),this.Kn&&(a.pm.position=a.pm.location=this.Kn,a.pm.vf(),d=a.pm,e=a.Iv)):e=this.le;null!==e&&(a=Ql(e),a!==d&&d.Ja()?e=a:(a=d.findVisibleNode(),null!==a&&a!==d?(d=a,e=a.ll("")):d=a));this.vD=d;if(null===d||null===e||!d.location.J())return!1;var a=this.oa,g=Do(this,c),h=Eo(this,e),k=c===e&&null!==c,l=this.gc,m=this.Le===sh;this.li=k&&!l?m=!0:!1;var n=this.Eo===jh||k;if(l||g!==yb||h!==yb||k){m=this.Si;n&&(l&&m||k)&&this.Mo();var p=k?this.computeCurviness():0,q=this.getLinkPoint(b,
  c,g,!0,l,d,e),r=0,s=0,u=0;if(l||g!==yb||k){var v=this.computeEndSegmentLength(b,c,g,!0),u=this.getLinkDirection(b,c,q,g,!0,l,d,e);k&&(u-=l?90:30,0>p&&(u-=180));0>u?u+=360:360<=u&&(u-=360);k&&(v+=Math.abs(p));0===u?r=v:90===u?s=v:180===u?r=-v:270===u?s=-v:(r=v*Math.cos(u*Math.PI/180),s=v*Math.sin(u*Math.PI/180));if(g.ue()&&k){var A=c.qb(Ob,w.M()),E=w.ic(A.x+1E3*r,A.y+1E3*s);this.getLinkPointFromPoint(b,c,A,E,!0,q);w.B(A);w.B(E)}}var v=this.getLinkPoint(d,e,h,!1,l,b,c),B=0,G=0,O=0;if(l||h!==yb||k)A=
  this.computeEndSegmentLength(d,e,h,!1),O=this.getLinkDirection(d,e,v,h,!1,l,b,c),k&&(O+=l?0:30,0>p&&(O+=180)),0>O?O+=360:360<=O&&(O-=360),k&&(A+=Math.abs(p)),0===O?B=A:90===O?G=A:180===O?B=-A:270===O?G=-A:(B=A*Math.cos(O*Math.PI/180),G=A*Math.sin(O*Math.PI/180)),h.ue()&&k&&(A=e.qb(Ob,w.M()),E=w.ic(A.x+1E3*B,A.y+1E3*G),this.getLinkPointFromPoint(d,e,A,E,!1,v),w.B(A),w.B(E));e=q;if(l||g!==yb||k)e=new x(q.x+r,q.y+s);c=v;if(l||h!==yb||k)c=new x(v.x+B,v.y+G);!n&&!l&&g===yb&&3<a&&this.adjustPoints(0,q,
  a-2,c)?this.Ff(a-1,v):!n&&!l&&h===yb&&3<a&&this.adjustPoints(1,e,a-1,v)?this.Ff(0,q):!n&&!l&&4<a&&this.adjustPoints(1,e,a-2,c)?(this.Ff(0,q),this.Ff(a-1,v)):!n&&l&&6<=a&&!m&&this.adjustPoints(1,e,a-2,c)?(this.Ff(0,q),this.Ff(a-1,v)):(this.Mo(),this.Mh(q),(l||g!==yb||k)&&this.Mh(e),l&&this.addOrthoPoints(e,u,c,O,b,d),(l||h!==yb||k)&&this.Mh(c),this.Mh(v))}else g=!1,!n&&3<=a&&(n=this.getLinkPoint(b,c,yb,!0,!1,d,e),h=this.getLinkPoint(d,e,yb,!1,!1,b,c),g=this.adjustPoints(0,n,a-1,h))&&(n=this.getLinkPoint(b,
  c,yb,!0,!1,d,e),h=this.getLinkPoint(d,e,yb,!1,!1,b,c),this.adjustPoints(0,n,a-1,h)),g||(this.Mo(),m?(a=this.getLinkPoint(b,c,yb,!0,!1,d,e),n=this.getLinkPoint(d,e,yb,!1,!1,b,c),g=n.x-a.x,h=n.y-a.y,k=this.computeCurviness(),m=l=0,q=a.x+g/3,u=a.y+h/3,r=q,s=u,J.I(h,0)?s=0<g?s-k:s+k:(l=-g/h,m=Math.sqrt(k*k/(l*l+1)),0>k&&(m=-m),r=(0>h?-1:1)*m+q,s=l*(r-q)+u),q=a.x+2*g/3,u=a.y+2*h/3,v=q,B=u,J.I(h,0)?B=0<g?B-k:B+k:(v=(0>h?-1:1)*m+q,B=l*(v-q)+u),this.Mo(),this.Mh(a),this.cl(r,s),this.cl(v,B),this.Mh(n),this.Ff(0,
  this.getLinkPoint(b,c,yb,!0,!1,d,e)),this.Ff(3,this.getLinkPoint(d,e,yb,!1,!1,b,c))):(a=d,d=this.getLinkPoint(b,c,yb,!0,!1,a,e),e=this.getLinkPoint(a,e,yb,!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,g=a,k=n,J.I(b,0)?k=0<h?k-c:k+c:(h=-h/b,g=Math.sqrt(c*c/(h*h+1)),0>c&&(g=-g),g=(0>b?-1:1)*g+a,k=h*(g-a)+n),this.Mh(d),this.cl(g,k)):this.Mh(d),this.Mh(e)));return!0};
  function Fo(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}
  U.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new x);if(null===a||null===b)return g.assign(c),g;a.Ja()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.U;null===e||e.bg()||(e=e.U);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.Nf;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.cp(e,h,k,l,g);null!==
  a&&g.transform(a);return g};function Go(a,b){var c=b.Zr;null===c&&(c=new Ho,c.port=b,c.Cc=b.V,b.Zr=c);return Io(c,a)}
  U.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new x);if(c.kd())return b.qb(c,k),k;if(c.kp()&&(c=Go(this,b),null!==c)){k.assign(c.qp);if(e&&this.Wt===po){var l=Go(this,h);if(c.Mm<l.Mm){c=w.M();var l=w.M(),m=new y(b.qb(Ab,c),b.qb(Wb,l)),n=this.computeSpot(!d);a=this.getLinkPoint(g,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);w.B(c);w.B(l)}}return k}g=b.qb(Ob,w.M());l=c=null;this.oa>(e?6:2)?(l=d?this.n(1):this.n(this.oa-2),e&&(l=Fo(g,l.copy()))):
  (c=w.M(),l=h.qb(Ob,c),e&&(l=Fo(g,l)));this.getLinkPointFromPoint(a,b,g,l,d,k);w.B(g);null!==c&&w.B(c);return k};
  U.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.kd())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.kp()){var l=Go(this,b);if(null!==l)switch(l.he){case w.ad:c=270;break a;case w.Jc:c=180;break a;default:case w.Tc:c=0;break a;case w.Sc:c=90;break a}}var l=b.qb(Ob,w.M()),m=null,n=null;this.oa>(g?6:2)?(n=e?this.n(1):this.n(this.oa-2),n=g?Fo(l,n.copy()):c):(m=w.M(),n=k.qb(Ob,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;w.B(l);null!==m&&w.B(m)}d.ue()&&h.Uh(a)&&(c+=180,360<=c&&(c-=360));a=ao;a=e?this.$o:this.Wp;a===ao&&(a=e?b.$o:b.Wp);switch(a){case bo:b=b.ml();c+=b;360<=c&&(c-=360);break;case ao:case ll:b=b.ml();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};
  U.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.kp()&&(a=Go(this,b),null!==a))return a.Ew;a=NaN;a=d?this.ek:this.mk;null!==b&&isNaN(a)&&(a=d?b.ek:b.mk);isNaN(a)&&(a=10);return a};U.prototype.computeSpot=function(a){return a?Do(this,this.vd):Eo(this,this.le)};function Do(a,b){if(null===b)return Ob;var c=a.wb;c.Pc()&&(void 0===b&&(b=a.vd),null!==b&&(c=b.wb));return c===zc?yb:c}
  function Eo(a,b){if(null===b)return Ob;var c=a.yb;c.Pc()&&(void 0===b&&(b=a.le),null!==b&&(c=b.yb));return c===zc?yb:c}U.prototype.computeOtherPoint=function(a,b){var c=b.qb(Ob),d;d=b.Zr;d=null!==d?Io(d,this):null;null!==d&&(c=d.qp);return c};U.prototype.computeShortLength=function(a){return a?Jo(this):Ko(this)};function Jo(a){var b=a.ap;isNaN(b)&&(a=a.vd,null!==a&&(b=a.ap));return isNaN(b)?0:b}function Ko(a){var b=a.Yp;isNaN(b)&&(a=a.le,null!==a&&(b=a.Yp));return isNaN(b)?0:b}
  U.prototype.ck=function(a,b,c,d,e,g){if(!1===this.Cf)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=w.mh(),h.reset());h.multiply(this.transform);if(this.Lm(a,h))return Wm(this,b,c,e),void 0===g&&w.df(h),!0;if(this.zg(a,h)){var k=!1;if(!this.Wg)for(var l=this.Ca.q,m=l.length;m--;){var n=l[m];if(n.visible||n===this.hc){var p=n.ea,q=this.Ka;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=w.mh();p.set(h);if(n instanceof z)k=n.ck(a,b,c,d,e,p);else if(this.path===
  n){var k=n,r=a,s=d,q=p;if(!1===k.Cf)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,v=q;if(k.Lm(u,v))k=!0;else{if(void 0===v&&(v=k.transform,u.Vj(k.ea))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,A=w.M(),E=w.M(),B=w.M(),G=w.mh();G.set(v);G.KF(k.transform);G.nA();E.x=r;E.y=s;E.transform(G);A.x=q;A.y=s;A.transform(G);v=!1;fn(k,A,E,B)?v=!0:(A.x=r,A.y=u,A.transform(G),fn(k,A,E,B)?v=!0:(E.x=q,E.y=u,E.transform(G),fn(k,A,E,B)?v=!0:(A.x=q,A.y=s,A.transform(G),fn(k,A,E,B)&&(v=!0))));w.df(G);
  w.B(A);w.B(E);w.B(B);k=v}}else k=k.Lm(r,q)}else k=ql(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&e.add(n));w.df(p)}}}void 0===g&&w.df(h);return k||null!==this.background||null!==this.el}void 0===g&&w.df(h);return!1};w.A(U,{gc:"isOrthogonal"},function(){return 2===(this.nm.value&2)});w.A(U,{Si:"isAvoiding"},function(){return 4===(this.nm.value&4)});U.prototype.computeCurve=function(){if(null===this.li){var a=this.vd,b=this.gc;this.li=null!==a&&a===this.le&&!b}return this.li?sh:this.Le};
  U.prototype.computeCorner=function(){if(this.Le===sh)return 0;var a=this.ww;if(isNaN(a)||0>a)a=10;return a};U.prototype.computeCurviness=function(){var a=this.ht;if(isNaN(a)){var b=this.of;if(0!==b){var a=10,c=this.h;null!==c&&(a=c.rp);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};U.prototype.computeThickness=function(){var a=this.path;return null!==a?Math.max(a.ib,1):1};U.prototype.hasCurviness=function(){return!isNaN(this.ht)||0!==this.of&&!this.gc};
  U.prototype.adjustPoints=function(a,b,c,d){var e=this.Eo;if(this.gc){if(e===Zl)return!1;e===$l&&(e=Yl)}switch(e){case Zl:var g=this.n(a),h=this.n(c);if(!g.L(b)||!h.L(d)){var e=g.x,g=g.y,k=h.x-e,l=h.y-g,m=Math.sqrt(k*k+l*l);if(!J.I(m,0)){var n=0;J.I(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;J.I(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.Ff(a,b);for(a+=
  1;a<c;a++)b=this.n(a),k=b.x-e,l=b.y-g,b=Math.sqrt(k*k+l*l),J.I(b,0)||(q=0,J.I(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.aa(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Ff(c,d)}}return!0;case $l:g=this.n(a);p=this.n(c);if(!g.L(b)||!p.L(d)){var e=g.x,g=g.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-g)*(p-g),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.Ff(a,b);for(a+=1;a<c;a++){b=this.n(a);var u=b.x,v=b.y,A=.5;0!==
  m&&(A=((e-u)*(e-h)+(g-v)*(g-p))/m);var E=e+A*(h-e),B=g+A*(p-g);b=Math.sqrt((u-E)*(u-E)+(v-B)*(v-B));v<r*(u-E)+B&&(b=-b);0<r&&(b=-b);u=k+A*(l-k);A=n+A*(q-n);0!==r?(b=u+b/s,this.aa(a,b,A-(b-u)/r)):this.aa(a,u,A+b)}this.Ff(c,d)}return!0;case Yl:return this.gc&&(e=this.n(a),g=this.n(a+1),h=this.n(a+2),J.I(e.y,g.y)?J.I(g.x,h.x)?this.aa(a+1,g.x,b.y):J.I(g.y,h.y)&&this.aa(a+1,b.x,g.y):J.I(e.x,g.x)&&(J.I(g.y,h.y)?this.aa(a+1,b.x,g.y):J.I(g.x,h.x)&&this.aa(a+1,g.x,b.y)),e=this.n(c),g=this.n(c-1),h=this.n(c-
  2),J.I(e.y,g.y)?J.I(g.x,h.x)?this.aa(c-1,g.x,d.y):J.I(g.y,h.y)&&this.aa(c-1,d.x,g.y):J.I(e.x,g.x)&&(J.I(g.y,h.y)?this.aa(c-1,d.x,g.y):J.I(g.x,h.x)&&this.aa(c-1,g.x,d.y))),this.Ff(a,b),this.Ff(c,d),!0;default:return!1}};
  U.prototype.addOrthoPoints=function(a,b,c,d,e,g){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.ea.copy(),k=g.ea.copy();if(h.J()&&k.J()){h.Sf(8,8);k.Sf(8,8);h.Zi(a);k.Zi(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 x(c.x,a.y),m=new x(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 x(a.x,c.y);m=new x((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.Ea(a)||h.Ea(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 x(Math.max((a.x+c.x)/2,a.x),a.y),m=new x(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 x(c.x,a.y),m=new x(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 x(a.x,c.y);m=new x((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.Ea(a)||h.Ea(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 x(Math.min((a.x+c.x)/2,a.x),a.y),m=new x(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 x(a.x,c.y),m=new x((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 x(c.x,a.y);m=new x(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.Ea(a)||h.Ea(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 x(a.x,Math.max((a.y+c.y)/2,a.y)),m=new x(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 x(a.x,c.y),m=new x((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 x(c.x,a.y);m=new x(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.Ea(a)||h.Ea(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 x(a.x,Math.min((a.y+c.y)/2,a.y)),m=new x(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.Si){var q=this.h,r;(r=null===q)||(q.Pb.fh?r=!1:(r=q.Wa,r=r instanceof Bf?!r.Uv||r.gF:!0),r=!r);if(r||h.Ea(c)&&!g.Uh(e)||k.Ea(a)&&!e.Uh(g)||e===g||this.layer.Ac)a=!1;else if(e=Nk(q,!0,this.Va,null),e.lp(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.lp(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.lp(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().$h(k),
  h.Sf(2*e.Hm,2*e.Gm),Lo(e,a,b,c,d,h),k=Mo(e,c.x,c.y),e.abort||999999!==k||(Qk(e),k=e.AG,h.Sf(e.Hm*k,e.Gm*k),Lo(e,a,b,c,d,h),k=Mo(e,c.x,c.y)),e.abort||999999!==k||(Qk(e),k=e.rF,h.Sf(e.Hm*k,e.Gm*k),Lo(e,a,b,c,d,h),k=Mo(e,c.x,c.y)),!e.abort&&999999===k&&e.ZG&&(Qk(e),Lo(e,a,b,c,d,e.kb),k=Mo(e,c.x,c.y)),!e.abort&&999999>k&&0!==Mo(e,c.x,c.y)){No(this,e,c.x,c.y,d,!0);d=this.n(2);if(4>this.oa)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.aa(2,d.x,d.y),this.C(3,d.x,d.y);else if(c=this.n(3),0===b||
  180===b)J.I(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.aa(2,b,a.y),this.aa(3,b,c.y)):J.I(d.y,c.y)?(Math.abs(a.y-d.y)<=e.Gm/2&&(this.aa(2,d.x,a.y),this.aa(3,c.x,a.y)),this.C(2,d.x,a.y)):this.aa(2,a.x,d.y);else if(90===b||270===b)J.I(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.aa(2,a.x,b),this.aa(3,c.x,b)):J.I(d.x,c.x)?(Math.abs(a.x-d.x)<=e.Hm/2&&(this.aa(2,a.x,d.y),this.aa(3,a.x,c.y)),this.C(2,a.x,d.y)):this.aa(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.Mh(l),this.Mh(m))}};
  U.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function ng(a){if(!a.Si)return!1;var b=a.points.q,c=b.length;if(4>c)return!1;a=Nk(a.h,!0,a.Va,null);for(var d=1;d<c-2;d++){var e=b[d],g=b[d+1];if(!a.lp(Math.min(e.x,g.x),Math.min(e.y,g.y),Math.abs(e.x-g.x),Math.abs(e.y-g.y)))return!0}return!1}
  function No(a,b,c,d,e,g){var h=b.Hm,k=b.Gm,l=Mo(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;1<l&&Mo(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(g){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&&(g=e,m=c,n=d,0===e?(g=90,n+=k):90===e?(g=180,m-=h):180===e?(g=270,n-=k):270===e&&(g=0,m+=h),Mo(b,m,n)===l-1?No(a,b,m,n,g,!1):(m=c,n=d,0===e?(g=270,n-=k):90===
  e?(g=0,m+=h):180===e?(g=90,n+=k):270===e&&(g=180,m-=h),Mo(b,m,n)===l-1&&No(a,b,m,n,g,!1)));a.cl(c,d)}U.prototype.findClosestSegment=function(a){t&&w.l(a,x,U,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.n(0),d=this.n(1),e=Ya(b,a,c.x,c.y,d.x,d.y),g=0,h=1;h<this.oa-1;h++){var c=this.n(h+1),k=Ya(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(g=h,e=k)}return g};U.prototype.invalidateGeometry=U.prototype.se=function(){this.Ta=null;this.T()};
  w.A(U,{Xc:"geometry"},function(){null===this.Ta&&(this.updateRoute(),this.Ta=this.makeGeometry());return this.Ta});U.prototype.Et=function(){if(null===this.Ta&&!1!==this.qg){this.Ta=this.makeGeometry();var a=this.path;if(null!==a){a.Ta=this.Ta;for(var b=this.Ca.q,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.Tf&&e instanceof W&&(e.Ta=this.Ta)}}}};
  U.prototype.makeGeometry=function(){var a=this.oa;if(2>a){var b=new ed(fd),c=new gd(0,0);b.pb.add(c);return b}var d=!1,b=this.h;null!==b&&0!==b.ka.Ve&&Ao(this)&&(d=!0);var c=b=0,e=this.n(0).copy(),g=e.copy(),b=this.Vc.q,h=this.computeCurve();if(h===sh&&3<=a&&!J.rb(this.kn,0))if(3===a)var k=this.n(1),b=Math.min(e.x,k.x),c=Math.min(e.y,k.y),k=this.n(2),b=Math.min(b,k.x),c=Math.min(c,k.y);else{if(this.gc)for(k=0;k<a;k++)c=b[k],g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);else for(k=3;k<a;k+=3)k+3>=a&&
  (k=a-1),b=this.n(k),g.x=Math.min(b.x,g.x),g.y=Math.min(b.y,g.y);b=g.x;c=g.y}else{for(k=0;k<a;k++)c=b[k],g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);b=g.x;c=g.y}b-=this.wz.x;c-=this.wz.y;e.x-=b;e.y-=c;if(2===a){var l=this.n(1).copy();l.x-=b;l.y-=c;0!==Jo(this)&&Oo(this,e,!0,g);0!==Ko(this)&&Oo(this,l,!1,g);b=new ed(id);b.ra=e.x;b.sa=e.y;b.D=l.x;b.F=l.y}else{l=w.u();0!==Jo(this)&&Oo(this,e,!0,g);L(l,e.x,e.y,!1,!1);if(h===sh&&3<=a&&!J.rb(this.kn,0))if(3===a)k=this.n(1),a=k.x-b,d=k.y-c,k=this.n(2).copy(),
  k.x-=b,k.y-=c,0!==Ko(this)&&Oo(this,k,!1,g),N(l,a,d,a,d,k.x,k.y);else if(this.gc){for(var g=new x(b,c),e=this.n(1).copy(),h=new x(b,c),a=new x(b,c),d=this.n(0),m=null,n=this.kn/3,k=1;k<this.oa-1;k++){var m=this.n(k),p=d,q=m,r=this.n(Po(this,m,k,!1));if(!J.rb(p.x,q.x)||!J.rb(q.x,r.x))if(!J.rb(p.y,q.y)||!J.rb(q.y,r.y)){var s=n,u=h,v=a;isNaN(s)&&(s=this.kn/3);var A=p.x,p=p.y,E=q.x,q=q.y,B=r.x,r=r.y,G=s*Qo(A,p,E,q),s=s*Qo(E,q,B,r);J.rb(p,q)&&J.rb(E,B)&&(E>A?r>q?(u.x=E-G,u.y=q-G,v.x=E+s,v.y=q+s):(u.x=
  E-G,u.y=q+G,v.x=E+s,v.y=q-s):r>q?(u.x=E+G,u.y=q-G,v.x=E-s,v.y=q+s):(u.x=E+G,u.y=q+G,v.x=E-s,v.y=q-s));J.rb(A,E)&&J.rb(q,r)&&(q>p?(B>E?(u.x=E-G,u.y=q-G,v.x=E+s):(u.x=E+G,u.y=q-G,v.x=E-s),v.y=q+s):(B>E?(u.x=E-G,u.y=q+G,v.x=E+s):(u.x=E+G,u.y=q+G,v.x=E-s),v.y=q-s));if(J.rb(A,E)&&J.rb(E,B)||J.rb(p,q)&&J.rb(q,r))A=.5*(A+B),p=.5*(p+r),u.x=A,u.y=p,v.x=A,v.y=p;1===k?(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y)):2===k&&J.rb(d.x,this.n(0).x)&&J.rb(d.y,this.n(0).y)&&(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y));N(l,e.x-b,e.y-c,
  h.x-b,h.y-c,m.x-b,m.y-c);g.set(h);e.set(a);d=m}}k=d.x;d=d.y;g=this.n(this.oa-1);k=.5*(k+g.x);d=.5*(d+g.y);N(l,a.x-b,a.y-c,k-b,d-c,g.x-b,g.y-c)}else for(k=3;k<a;k+=3)d=this.n(k-2),k+3>=a&&(k=a-1),g=this.n(k-1),e=this.n(k),k===a-1&&0!==Ko(this)&&(e=e.copy(),Oo(this,e,!1,J.nk)),N(l,d.x-b,d.y-c,g.x-b,g.y-c,e.x-b,e.y-c);else{g=w.M();g.assign(this.n(0));for(k=1;k<a;){k=Po(this,g,k,1<k);u=this.n(k);if(k>=a-1){g!==u&&(0!==Ko(this)&&(u=u.copy(),Oo(this,u,!1,J.nk)),Ro(this,l,-b,-c,g,u,d));break}k=Po(this,u,
  k+1,k<a-3);e=l;h=-b;m=-c;n=g;v=this.n(k);A=g;p=d;J.I(n.y,u.y)&&J.I(u.x,v.x)?(s=this.computeCorner(),s=Math.min(s,Math.abs(u.x-n.x)/2),s=E=Math.min(s,Math.abs(v.y-u.y)/2),J.I(s,0)?(Ro(this,e,h,m,n,u,p),A.assign(u)):(q=u.x,B=u.y,r=q,G=B,q=u.x>n.x?u.x-s:u.x+s,G=v.y>u.y?u.y+E:u.y-E,Ro(this,e,h,m,n,new x(q,B),p),yd(e,u.x+h,u.y+m,r+h,G+m),A.o(r,G))):J.I(n.x,u.x)&&J.I(u.y,v.y)?(s=this.computeCorner(),E=Math.min(s,Math.abs(u.y-n.y)/2),E=s=Math.min(E,Math.abs(v.x-u.x)/2),J.I(s,0)?(Ro(this,e,h,m,n,u,p),A.assign(u)):
  (q=u.x,G=B=u.y,B=u.y>n.y?u.y-E:u.y+E,r=v.x>u.x?u.x+s:u.x-s,Ro(this,e,h,m,n,new x(q,B),p),yd(e,u.x+h,u.y+m,r+h,G+m),A.o(r,G))):(Ro(this,e,h,m,n,u,p),A.assign(u))}w.B(g)}b=l.s;w.v(l)}return b};function Qo(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 J.rb(a,0)?b:J.rb(b,0)?a:Math.sqrt(a*a+b*b)}
  function Oo(a,b,c,d){var e=a.oa;if(!(2>e))if(c){var g=a.n(1);c=g.x-d.x;d=g.y-d.y;g=Qo(b.x,b.y,c,d);0!==g&&(e=2===e?.5*g:g,a=Jo(a),a>e&&(a=e),c=a*(c-b.x)/g,a=a*(d-b.y)/g,b.x+=c,b.y+=a)}else g=a.n(e-2),c=g.x-d.x,d=g.y-d.y,g=Qo(b.x,b.y,c,d),0!==g&&(e=2===e?.5*g:g,a=Ko(a),a>e&&(a=e),c=a*(b.x-c)/g,a=a*(b.y-d)/g,b.x-=c,b.y-=a)}
  function Po(a,b,c,d){for(var e=a.oa,g=b;J.rb(b.x,g.x)&&J.rb(b.y,g.y);){if(c>=e)return e-1;g=a.n(c++)}if(!J.rb(b.x,g.x)&&!J.rb(b.y,g.y))return c-1;for(var h=g;J.rb(b.x,g.x)&&J.rb(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||J.rb(b.y,g.y)&&J.rb(g.y,h.y)&&(!d||(b.x>=g.x?g.x>=h.x:g.x<=h.x));){if(c>=e)return e-1;h=a.n(c++)}return c-2}
  function Ro(a,b,c,d,e,g,h){if(!h&&Ao(a)){h=[];var k=0;a.Ja()&&(k=So(a,e,g,h));var l=e.x,l=e.y;if(0<k)if(J.I(e.y,g.y))if(e.x<g.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h[m++]-5,g.x-10));b.lineTo(n+c,g.y+d);for(var l=n+c,p=Math.min(n+10,g.x);m<k;){var q=h[m];if(q<p+10)m++,p=Math.min(q+5,g.x);else break}q=(n+p)/2+c;q=g.y-10+d;n=p+c;p=g.y+d;a.Le===ih?L(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h[m--]+5,g.x+10));b.lineTo(n+c,g.y+d);l=n+c;for(p=Math.max(n-10,g.x);0<=
  m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,g.x);else break;q=g.y-10+d;n=p+c;p=g.y+d;a.Le===ih?L(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else if(J.I(e.x,g.x))if(e.y<g.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h[m++]-5,g.y-10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.min(n+10,g.y);m<k;)if(q=h[m],q<p+10)m++,p=Math.min(q+5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.Le===ih?L(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h[m--]+5,g.y+10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.max(n-10,g.y);0<=
  m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.Le===ih?L(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)}
  function So(a,b,c,d){var e=a.h;if(null===e||b.L(c))return 0;for(e=e.hx;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.Hb.q,h=g.length,k=0;k<h;k++){var l=g[k];if(l instanceof U){if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l.Ja()&&Ao(l)){var m=l.gn;m.J()&&a.gn.zg(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.vl()&&To(b,c,d,l))}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
  function To(a,b,c,d){for(var e=J.I(a.y,b.y),g=d.oa,h=d.n(0),k=w.M(),l=1;l<g;l++){var m=d.n(l);if(l<g-1){var n=d.n(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,u=h.x,h=h.y,v=m.x,A=m.y;if(!J.I(p,r)){if(J.I(q,s)&&J.I(u,v)&&Math.min(p,r)<u&&Math.max(p,r)>u&&Math.min(h,A)<q&&Math.max(h,A)>q&&!J.I(h,A)){n.x=u;n.y=q;n=!0;break a}}else if(!J.I(q,s)&&J.I(h,A)&&Math.min(q,
  s)<h&&Math.max(q,s)>h&&Math.min(u,v)<p&&Math.max(u,v)>p&&!J.I(u,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}w.B(k)}w.A(U,{qt:"firstPickIndex"},function(){return 2>=this.oa?0:this.gc||Do(this)!==yb?1:0});w.A(U,{ex:"lastPickIndex"},function(){var a=this.oa;return 0===a?0:2>=a?a-1:this.gc||Eo(this)!==yb?a-2:a-1});function Ao(a){a=a.Le;return a===hh||a===ih}function Co(a,b){if(b||Ao(a)){var c=a.h;null===c||c.Tl.contains(a)||null===a.iz||c.Tl.add(a,a.iz)}}
  function kh(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Ac){var d=c.h;if(null!==d)for(var e=!1,d=d.hx;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.Hb.q,k=g.length,l=0;l<k;l++){var m=g[l];m instanceof U&&(m===a?h=!0:h&&Uo(a,m,b))}else if(e)for(g=g.Hb.q,k=g.length,l=0;l<k;l++)m=g[l],m instanceof U&&Uo(a,m,b)}}}function Uo(a,b,c){if(null!==b&&null!==b.Ta&&Ao(b)){var d=b.gn;d.J()&&(a.gn.zg(d)||c.zg(d))&&(a.usesSamePort(b)||b.se())}}
  U.prototype.usesSamePort=function(a){var b=this.oa,c=a.oa;if(0<b&&0<c){var d=this.n(0),e=a.n(0);if(d.Ne(e))return!0;b=this.n(b-1);a=a.n(c-1);if(b.Ne(a)||d.Ne(a)||b.Ne(e))return!0}else if(this.Z===a.Z||this.da===a.da||this.Z==a.da||this.da==a.Z)return!0;return!1};U.prototype.Qe=function(a){H.prototype.Qe.call(this,a);if(null!==this.Ae)for(var b=this.Ae.k;b.next();)b.value.Qe(a)};w.g(U,"adjusting",U.prototype.Eo);
  w.defineProperty(U,{Eo:"adjusting"},function(){return this.fq},function(a){var b=this.fq;b!==a&&(t&&w.za(a,U,U,"adjusting"),this.fq=a,this.j("adjusting",b,a))});w.g(U,"corner",U.prototype.ww);w.defineProperty(U,{ww:"corner"},function(){return this.sq},function(a){var b=this.sq;b!==a&&(t&&w.i(a,"number",U,"corner"),this.sq=a,this.se(),this.j("corner",b,a))});w.g(U,"curve",U.prototype.Le);
  w.defineProperty(U,{Le:"curve"},function(){return this.vq},function(a){var b=this.vq;b!==a&&(t&&w.za(a,U,U,"curve"),this.vq=a,this.$b(),Co(this,b===ih||b===hh||a===ih||a===hh),this.j("curve",b,a))});w.g(U,"curviness",U.prototype.ht);w.defineProperty(U,{ht:"curviness"},function(){return this.wq},function(a){var b=this.wq;b!==a&&(t&&w.i(a,"number",U,"curviness"),this.wq=a,this.$b(),this.j("curviness",b,a))});w.g(U,"routing",U.prototype.Wt);
  w.defineProperty(U,{Wt:"routing"},function(){return this.nm},function(a){var b=this.nm;b!==a&&(t&&w.za(a,U,U,"routing"),this.nm=a,this.li=null,this.$b(),Co(this,2===(b.value&2)||2===(a.value&2)),this.j("routing",b,a))});w.g(U,"smoothness",U.prototype.kn);w.defineProperty(U,{kn:"smoothness"},function(){return this.As},function(a){var b=this.As;b!==a&&(t&&w.i(a,"number",U,"smoothness"),this.As=a,this.se(),this.j("smoothness",b,a))});
  function yo(a){var b=a.eg;if(null!==b){var c=a.pg;if(null!==c){var d=a.xh,e=a.Lh;a:{if(null!==c&&null!==b.oh)for(a=b.oh.k;a.next();){var g=a.value;if(g.Fp===b&&g.Kt===c&&g.sx===d&&g.tx===e||g.Fp===c&&g.Kt===b&&g.sx===e&&g.tx===d){a=g;break a}}a=null}for(var h=null,k=null,l=b.kc.q,m=l.length,g=0;g<m;g++){var n=l[g];if(n.eg===b&&n.xh===d&&n.pg===c&&n.Lh===e||n.eg===c&&n.xh===e&&n.pg===b&&n.Lh===d)null===k?k=n:(null===h&&(h=new D(U),h.add(k)),h.add(n))}if(null!==h)for(null===a&&(a=new fo,a.Fp=b,a.sx=
  d,a.Kt=c,a.tx=e,eo(b,a),eo(c,a)),a.links=h,b=h.q,g=0;g<b.length;g++)if(n=b[g],0===n.of){c=1;for(d=0;d<b.length;d++)Math.abs(b[d].of)===c&&(c++,d=-1);n.yn=a;n.of=n.Z===a.Fp?c:-c;c=n.h;(null===c||c.rf)&&n.$b()}}}}
  function xo(a){var b=a.yn;if(null!==b){var c=a.of;a.yn=null;a.of=0;b.links.remove(a);if(2>b.links.count)1===b.links.count&&(c=b.links.q[0],c.yn=null,c.of=0,c.$b()),c=b.Fp,null!==b&&null!==c.oh&&c.oh.remove(b),c=b.Kt,null!==b&&null!==c.oh&&c.oh.remove(b);else for(c=Math.abs(c),a=0===c%2,b=b.links.k;b.next();){var d=b.value,e=Math.abs(d.of),g=0===e%2;e>c&&a===g&&(d.of=0<d.of?d.of-2:d.of+2,d.$b())}}}function fo(){w.jc(this);this.links=this.tx=this.Kt=this.sx=this.Fp=null}
  w.be(fo,{Fp:!0,sx:!0,Kt:!0,tx:!0,links:!0,spacing:!0});function Ok(){w.jc(this);this.lB=this.group=null;this.wt=!0;this.abort=!1;this.kg=this.jg=1;this.wr=this.vr=-1;this.ne=this.me=8;this.uc=null;this.ZG=!1;this.AG=22;this.rF=111}w.be(Ok,{group:!0,lB:!0,wt:!0,abort:!0,ZG:!0,AG:!0,rF:!0});
  Ok.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.jg=Math.floor((a.x-this.me)/this.me)*this.me;this.kg=Math.floor((b-this.ne)/this.ne)*this.ne;this.vr=Math.ceil((c+2*this.me)/this.me)*this.me;this.wr=Math.ceil((d+2*this.ne)/this.ne)*this.ne;a=1+(Math.ceil((this.vr-this.jg)/this.me)|0);b=1+(Math.ceil((this.wr-this.kg)/this.ne)|0);if(null===this.uc||this.Ao<a-1||this.Bo<b-1){c=[];for(d=0;d<=a;d++){for(var e=[],g=0;g<=b;g++)e[g]=0;c[d]=e}this.uc=
  c;this.Ao=a-1;this.Bo=b-1}if(null!==this.uc)for(a=0;a<=this.Ao;a++)for(b=0;b<=this.Bo;b++)this.uc[a][b]=999999}};w.A(Ok,{kb:null},function(){return new y(this.jg,this.kg,this.vr-this.jg,this.wr-this.kg)});w.g(Ok,"cellWidth",Ok.prototype.Hm);w.defineProperty(Ok,{Hm:null},function(){return this.me},function(a){0<a&&a!==this.me&&(this.me=a,this.initialize(this.kb))});w.g(Ok,"cellHeight",Ok.prototype.Gm);
  w.defineProperty(Ok,{Gm:null},function(){return this.ne},function(a){0<a&&a!==this.ne&&(this.ne=a,this.initialize(this.kb))});function Vo(a,b,c){return a.jg<=b&&b<=a.vr&&a.kg<=c&&c<=a.wr}function Mo(a,b,c){if(!Vo(a,b,c))return 0;b-=a.jg;b/=a.me;c-=a.kg;c/=a.ne;return a.uc[b|0][c|0]}function Rk(a,b,c){Vo(a,b,c)&&(b-=a.jg,b/=a.me,c-=a.kg,c/=a.ne,a.uc[b|0][c|0]=0)}function Qk(a){if(null!==a.uc)for(var b=0;b<=a.Ao;b++)for(var c=0;c<=a.Bo;c++)1<=a.uc[b][c]&&(a.uc[b][c]|=999999)}
  Ok.prototype.lp=function(a,b,c,d){if(a>this.vr||a+c<this.jg||b>this.wr||b+d<this.kg)return!0;a=(a-this.jg)/this.me|0;b=(b-this.kg)/this.ne|0;c=Math.max(0,c)/this.me+1|0;var e=Math.max(0,d)/this.ne+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.Ao)|0;for(c=Math.min(b+e-1,this.Bo)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.uc[a][e])return!1;return!0};
  function Wo(a,b,c,d,e,g,h,k,l){if(!(b<g||b>h||c<k||c>l)){var m,n;m=b|0;n=c|0;var p=a.uc[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.uc[m][n]);)a.uc[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)Wo(a,b,c,1,!e,g,h,k,l),Wo(a,b,c,-1,!e,g,h,k,l);else for(c+=d;c>m;c+=d)Wo(a,b,c,1,!e,g,h,k,l),Wo(a,b,c,-1,!e,g,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)Wo(a,b,c,1,!e,g,h,k,l),Wo(a,b,c,-1,!e,g,h,k,l);else for(b+=d;b>m;b+=d)Wo(a,b,c,1,!e,g,h,k,l),Wo(a,b,c,-1,!e,g,h,
  k,l)}}function Xo(a,b,c,d,e,g,h,k,l,m,n){for(var p=b|0,q=c|0,r=a.uc[p][q];0===r&&p>k&&p<l&&q>m&&q<n;)if(h?q+=g:p+=g,r=a.uc[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.uc[p][q];b=1;for(a.uc[p][q]=b;0===r&&p>k&&p<l&&q>m&&q<n;)h?q+=g:p+=g,r=a.uc[p][q],a.uc[p][q]=b,b+=1;return h?q:p}
  function Lo(a,b,c,d,e,g){if(null!==a.uc){a.abort=!1;var h=b.x,k=b.y;if(Vo(a,h,k)){var h=h-a.jg,h=h/a.me,k=k-a.kg,k=k/a.ne,l=d.x,m=d.y;if(Vo(a,l,m))if(l-=a.jg,l/=a.me,m-=a.kg,m/=a.ne,1>=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=g.x;b=g.y;d=g.x+g.width;var p=g.y+g.height,n=n-a.jg,n=n/a.me;b-=a.kg;b/=a.ne;d-=a.jg;d/=a.me;p-=a.kg;p/=a.ne;g=Math.max(0,Math.min(a.Ao,n|0));d=Math.min(a.Ao,Math.max(0,d|0));b=Math.max(0,Math.min(a.Bo,b|0));var p=Math.min(a.Bo,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=Xo(a,h,k,l,m,r,c,g,d,b,p):n=Xo(a,h,k,l,m,r,c,g,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,u=a.uc[r][s];0===u&&r>g&&r<d&&s>b&&s<p;)if(e?s+=c:r+=c,u=a.uc[r][s],1>=Math.abs(r-h)&&1>=Math.abs(s-k)){a.abort=!0;break a}r=l|0;s=m|0;u=a.uc[r][s];for(a.uc[r][s]=999999;0===u&&r>g&&r<d&&s>b&&s<p;)e?s+=c:r+=c,u=a.uc[r][s],a.uc[r][s]=999999}a.abort||(Wo(a,n,q,1,!1,g,d,b,p),Wo(a,n,q,-1,!1,g,d,b,p),Wo(a,n,q,1,!0,g,d,
  b,p),Wo(a,n,q,-1,!0,g,d,b,p))}}}}}function Ho(){w.jc(this);this.port=this.Cc=null;this.Eg=[];this.Ep=!1}w.be(Ho,{Cc:!0,port:!0,Eg:!0,Ep:!0});Ho.prototype.toString=function(){for(var a=this.Eg,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 Yo(a,b,c,d){b=b.offsetY;switch(b){case w.Sc:return 90;case w.Jc:return 180;case w.ad:return 270;case w.Tc:return 0}switch(b){case w.Sc|w.ad:return 180<c?270:90;case w.Jc|w.Tc:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case w.Jc|w.ad:return c>a&&c<=180+a?180:270;case w.ad|w.Tc:return c>180-a&&c<=360-a?270:0;case w.Tc|w.Sc:return c>a&&c<=180+a?90:0;case w.Sc|w.Jc:return c>180-a&&c<=360-a?180:90;case w.Jc|w.ad|w.Tc:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
  a?270:0;case w.ad|w.Tc|w.Sc:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case w.Tc|w.Sc|w.Jc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case w.Sc|w.Jc|w.ad:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(w.Jc|w.ad|w.Tc|w.Sc)&&(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 Io(a,b){var c=a.Eg;if(0===c.length){a:if(!a.Ep){c=a.Ep;a.Ep=!0;var d,e=null,g=a.Cc,g=g instanceof T?g:null;if(null===g||g.Ld)d=a.Cc.GE(a.port.wd);else{if(!g.ea.J()){a.Ep=c;break a}e=g;d=e.FE()}var h=a.Eg.length=0,k=a.port.qb(Ab,w.M()),l=a.port.qb(Wb,w.M()),g=w.lk(k.x,k.y,0,0);g.Zi(l);w.B(k);w.B(l);k=w.ic(g.x+g.width/2,g.y+g.height/2);for(d=d.k;d.next();)if(l=d.value,l.Ja()){var m=yb,n=l.vd===a.port||l.Z.Uh(e),m=n?Do(l,a.port):Eo(l,a.port);if(m.kp()&&(n=n?l.le:l.vd,null!==n)){var p=n.V;if(null!==
  p){var n=l.computeOtherPoint(p,n),p=k.Pi(n),m=Yo(g,m,p,l.gc),q=0;0===m?(q=w.Tc,180<p&&(p-=360)):q=90===m?w.Sc:180===m?w.Jc:w.ad;m=a.Eg[h];void 0===m?(m=new Zo(l,p,q),a.Eg[h]=m):(m.link=l,m.angle=p,m.he=q);m.qx.set(n);h++}}}w.B(k);a.Eg.sort(Ho.prototype.tJ);e=a.Eg.length;k=-1;for(h=d=0;h<e;h++)m=a.Eg[h],void 0!==m&&(m.he!==k&&(k=m.he,d=0),m.ep=d,d++);k=-1;d=0;for(h=e-1;0<=h;h--)m=a.Eg[h],void 0!==m&&(m.he!==k&&(k=m.he,d=m.ep+1),m.Mm=d);h=a.Eg;n=a.port;e=a.Cc.HJ;k=w.M();d=w.M();l=w.M();m=w.M();n.qb(Ab,
  k);n.qb(Db,d);n.qb(Wb,l);n.qb(Ub,m);var r=q=p=n=0;if(e===co)for(var s=0;s<h.length;s++){var u=h[s];if(null!==u){var v=u.link.computeThickness();switch(u.he){case w.Sc:q+=v;break;case w.Jc:r+=v;break;case w.ad:n+=v;break;default:case w.Tc:p+=v}}}for(var A=0,E=0,B=1,s=0;s<h.length;s++)if(u=h[s],null!==u){var G,O;if(A!=u.he){A=u.he;switch(A){case w.Sc:G=l;O=m;break;case w.Jc:G=m;O=k;break;case w.ad:G=k;O=d;break;default:case w.Tc:G=d,O=l}var M=O.x-G.x;O=O.y-G.y;switch(A){case w.Sc:q>Math.abs(M)?(B=Math.abs(M)/
  q,q=Math.abs(M)):B=1;break;case w.Jc:r>Math.abs(O)?(B=Math.abs(O)/r,r=Math.abs(O)):B=1;break;case w.ad:n>Math.abs(M)?(B=Math.abs(M)/n,n=Math.abs(M)):B=1;break;default:case w.Tc:p>Math.abs(O)?(B=Math.abs(O)/p,p=Math.abs(O)):B=1}E=0}var X=u.qp;if(e===co){v=u.link.computeThickness();v*=B;X.set(G);switch(A){case w.Sc:X.x=G.x+M/2+q/2-E-v/2;break;case w.Jc:X.y=G.y+O/2+r/2-E-v/2;break;case w.ad:X.x=G.x+M/2-n/2+E+v/2;break;default:case w.Tc:X.y=G.y+O/2-p/2+E+v/2}E+=v}else v=.5,e===$n&&(v=(u.ep+1)/(u.Mm+1)),
  X.x=G.x+M*v,X.y=G.y+O*v}w.B(k);w.B(d);w.B(l);w.B(m);G=a.Eg;for(M=0;M<G.length;M++)O=G[M],null!==O&&(O.Ew=a.computeEndSegmentLength(O));a.Ep=c;w.nc(g)}c=a.Eg}for(g=0;g<c.length;g++)if(G=c[g],null!==G&&G.link===b)return G;return null}Ho.prototype.tJ=function(a,b){return a===b?0:null===a?-1:null===b?1:a.he<b.he?-1:a.he>b.he?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
  Ho.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Cc,this.port,yb,b.vd===this.port),d=a.ep;if(0>d)return c;var e=a.Mm;if(1>=e||!b.gc)return c;var b=a.qx,g=a.qp;if(a.he===w.Jc||a.he===w.Sc)d=e-1-d;return((a=a.he===w.Jc||a.he===w.Tc)?b.y<g.y:b.x<g.x)?c+8*d:(a?b.y===g.y:b.x===g.x)?c:c+8*(e-1-d)};function Zo(a,b,c){this.link=a;this.angle=b;this.he=c;this.qx=new x;this.Mm=this.ep=0;this.qp=new x;this.Ew=0}
  w.be(Zo,{link:!0,angle:!0,he:!0,qx:!0,ep:!0,Mm:!0,qp:!0,Ew:!0});Zo.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.he.toString()+":"+this.ep.toString()+"/"+this.Mm.toString()+" "+this.qp.toString()+" "+this.Ew.toString()+" "+this.qx.toString()};function kl(){this.Nj=this.mj=zc;this.Lj=this.kj=NaN;this.Kj=this.jj=ao;this.Mj=this.lj=NaN}
  kl.prototype.copy=function(){var a=new kl;a.mj=this.mj.ba();a.Nj=this.Nj.ba();a.kj=this.kj;a.Lj=this.Lj;a.jj=this.jj;a.Kj=this.Kj;a.lj=this.lj;a.Mj=this.Mj;return a};function T(a){0===arguments.length?S.call(this,Mh):S.call(this,a);this.yr=new F(H);this.lo=new F(T);this.Sk=this.zr=this.xr=null;this.Ns=!1;this.br=!0;this.Os=!1;this.Tb=this.Ds=null;this.oq=!1;this.pq=!0;this.Pq=this.qq=!1;this.Td=new Re;this.Td.group=this;this.cz=!1}w.Ia(T,S);w.ja("Group",T);
  T.prototype.cloneProtected=function(a){S.prototype.cloneProtected.call(this,a);a.xr=this.xr;a.zr=this.zr;a.Sk=this.Sk;a.Ns=this.Ns;a.br=this.br;a.Os=this.Os;a.Ds=this.Ds;var b=a.lt(function(a){return a instanceof xh});a.Tb=b instanceof xh?b:null;a.oq=this.oq;a.pq=this.pq;a.qq=this.qq;a.Pq=this.Pq;null!==this.Td?(a.Td=this.Td.copy(),a.Td.group=a):(null!==a.Td&&(a.Td.group=null),a.Td=null)};
  T.prototype.Qh=function(a){S.prototype.Qh.call(this,a);var b=a.Wo();for(a=a.Rc;a.next();){var c=a.value;c.T();c.K(8);c.bt();if(c instanceof S)c.yf(b);else if(c instanceof U)for(c=c.Bg;c.next();)c.value.yf(b)}};
  T.prototype.fn=function(a,b,c,d,e,g,h){if(a===he&&"elements"===b)if(e instanceof xh){var k=e;null===this.Tb?this.Tb=k:this.Tb!==k&&w.m("Cannot insert a second Placeholder into the visual tree of a Group.")}else e instanceof z&&(k=e.lt(function(a){return a instanceof xh}),k instanceof xh&&(null===this.Tb?this.Tb=k:this.Tb!==k&&w.m("Cannot insert a second Placeholder into the visual tree of a Group.")));else a===ie&&"elements"===b&&null!==this.Tb&&(d===this.Tb?this.Tb=null:d instanceof z&&this.Tb.sl(d)&&
  (this.Tb=null));S.prototype.fn.call(this,a,b,c,d,e,g,h)};T.prototype.Hi=function(a,b,c,d){this.Rk=this.Tb;z.prototype.Hi.call(this,a,b,c,d)};T.prototype.tl=function(){if(!S.prototype.tl.call(this))return!1;for(var a=this.Rc;a.next();){var b=a.value;if(b instanceof S){if(b.Ja()&&Hj(b))return!1}else if(b instanceof U&&b.Ja()&&Hj(b)&&b.Z!==this&&b.da!==this)return!1}return!0};w.A(T,{placeholder:"placeholder"},function(){return this.Tb});w.g(T,"computesBoundsAfterDrag",T.prototype.Uz);
  w.defineProperty(T,{Uz:"computesBoundsAfterDrag"},function(){return this.oq},function(a){var b=this.oq;b!==a&&(w.i(a,"boolean",T,"computesBoundsAfterDrag"),this.oq=a,this.j("computesBoundsAfterDrag",b,a))});w.g(T,"computesBoundsIncludingLinks",T.prototype.hE);w.defineProperty(T,{hE:"computesBoundsIncludingLinks"},function(){return this.pq},function(a){w.i(a,"boolean",T,"computesBoundsIncludingLinks");var b=this.pq;b!==a&&(this.pq=a,this.j("computesBoundsIncludingLinks",b,a))});
  w.g(T,"computesBoundsIncludingLocation",T.prototype.iE);w.defineProperty(T,{iE:"computesBoundsIncludingLocation"},function(){return this.qq},function(a){w.i(a,"boolean",T,"computesBoundsIncludingLocation");var b=this.qq;b!==a&&(this.qq=a,this.j("computesBoundsIncludingLocation",b,a))});w.g(T,"handlesDragDropForMembers",T.prototype.XE);
  w.defineProperty(T,{XE:"handlesDragDropForMembers"},function(){return this.Pq},function(a){w.i(a,"boolean",T,"handlesDragDropForMembers");var b=this.Pq;b!==a&&(this.Pq=a,this.j("handlesDragDropForMembers",b,a))});w.A(T,{Rc:"memberParts"},function(){return this.yr.k});function Wn(a,b){if(a.yr.add(b)){b instanceof T&&a.lo.add(b);var c=a.BF;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.Pa,e.Pa=!0);c(a,b);null!==e&&(e.Pa=d)}a.Ja()&&a.Ld||b.Qe(!1)}c=a.Tb;null===c&&(c=a);c.T()}
  function Vn(a,b){if(a.yr.remove(b)){b instanceof T&&a.lo.remove(b);var c=a.CF;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.Pa,e.Pa=!0);c(a,b);null!==e&&(e.Pa=d)}a.Ja()&&a.Ld||b.Qe(!0)}c=a.Tb;null===c&&(c=a);c.T()}T.prototype.Om=function(){if(0<this.yr.count){var a=this.h;if(null===a)return;for(var b=this.yr.copy().k;b.next();)a.remove(b.value)}S.prototype.Om.call(this)};T.prototype.Ex=function(){var a=this.layer;null!==a&&a.Ex(this)};w.g(T,"layout",T.prototype.Lb);
  w.defineProperty(T,{Lb:"layout"},function(){return this.Td},function(a){var b=this.Td;b!==a&&(null!==a&&w.l(a,Re,T,"layout"),null!==b&&(b.h=null,b.group=null),this.Td=a,null!==a&&(a.h=this.h,a.group=this),this.j("layout",b,a))});w.g(T,"memberAdded",T.prototype.BF);w.defineProperty(T,{BF:"memberAdded"},function(){return this.xr},function(a){var b=this.xr;b!==a&&(null!==a&&w.i(a,"function",T,"memberAdded"),this.xr=a,this.j("memberAdded",b,a))});w.g(T,"memberRemoved",T.prototype.CF);
  w.defineProperty(T,{CF:"memberRemoved"},function(){return this.zr},function(a){var b=this.zr;b!==a&&(null!==a&&w.i(a,"function",T,"memberRemoved"),this.zr=a,this.j("memberRemoved",b,a))});w.g(T,"memberValidation",T.prototype.Ft);w.defineProperty(T,{Ft:"memberValidation"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(null!==a&&w.i(a,"function",T,"memberValidation"),this.Sk=a,this.j("memberValidation",b,a))});
  T.prototype.canAddMembers=function(a){var b=this.h;if(null===b)return!1;b=b.Ab;for(a=Df(a).k;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};T.prototype.addMembers=function(a,b){var c=this.h;if(null===c)return!1;for(var c=c.Ab,d=!0,e=Df(a).k;e.next();){var g=e.value;!b||c.isValidMember(this,g)?g.Va=this:d=!1}return d};w.g(T,"ungroupable",T.prototype.VG);
  w.defineProperty(T,{VG:"ungroupable"},function(){return this.Ns},function(a){var b=this.Ns;b!==a&&(w.i(a,"boolean",T,"ungroupable"),this.Ns=a,this.j("ungroupable",b,a))});T.prototype.canUngroup=function(){if(!this.VG)return!1;var a=this.layer;if(null!==a&&!a.Jo)return!1;a=a.h;return null===a||a.Jo?!0:!1};
  T.prototype.invalidateConnectedLinks=T.prototype.yf=function(a){void 0===a&&(a=null);S.prototype.yf.call(this,a);for(var b=this.FE();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.Z;null!==d&&d.Uh(this)&&!d.Ja()?c.$b():(d=c.da,null!==d&&d.Uh(this)&&!d.Ja()&&c.$b())}}};T.prototype.findExternalLinksConnected=T.prototype.FE=function(){var a=this.Wo();a.add(this);for(var b=new F(U),c=a.k;c.next();){var d=c.value;if(d instanceof S)for(d=d.ve;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.k};
  T.prototype.findExternalNodesConnected=function(){var a=this.Wo();a.add(this);for(var b=new F(S),c=a.k;c.next();){var d=c.value;if(d instanceof S)for(d=d.ve;d.next();){var e=d.value,g=e.Z;a.contains(g)&&g!==this||b.add(g);e=e.da;a.contains(e)&&e!==this||b.add(e)}}return b.k};T.prototype.findSubGraphParts=T.prototype.Wo=function(){var a=new F(H);sf(a,this,!0,0,!0);a.remove(this);return a};T.prototype.Qe=function(a){S.prototype.Qe.call(this,a);for(var b=this.Rc;b.next();)b.value.Qe(a)};
  T.prototype.collapseSubGraph=T.prototype.collapseSubGraph=function(){var a=this.h;if(null!==a&&!a.ee){a.ee=!0;var b=this.Wo();$o(this,b);a.ee=!1}};function $o(a,b){for(var c=a.Rc;c.next();){var d=c.value;d.Qe(!1);if(d instanceof T){var e=d;e.Ld&&(e.Lx=e.Ld,$o(e,b))}if(d instanceof S)d.yf(b);else if(d instanceof U)for(d=d.Bg;d.next();)d.value.yf(b)}a.Ld=!1}
  T.prototype.expandSubGraph=T.prototype.expandSubGraph=function(){var a=this.h;if(null!==a&&!a.ee){var b=a.Pb;0!==a.ka.Ve&&b.zl();a.ee=!0;var c=this.Wo();ap(this,c,b,this);a.ee=!1}};function ap(a,b,c,d){for(var e=a.Rc;e.next();){var g=e.value;g.Qe(!0);if(g instanceof T){var h=g;h.Lx&&(h.Lx=!1,ap(h,b,c,d))}if(g instanceof S)g.yf(b),zi(c,g,d);else if(g instanceof U)for(g=g.Bg;g.next();)g.value.yf(b)}a.Ld=!0}w.g(T,"isSubGraphExpanded",T.prototype.Ld);
  w.defineProperty(T,{Ld:"isSubGraphExpanded"},function(){return this.br},function(a){var b=this.br;if(b!==a){w.i(a,"boolean",T,"isSubGraphExpanded");this.br=a;var c=this.h;this.j("isSubGraphExpanded",b,a);b=this.GG;if(null!==b){var d=!0;null!==c&&(d=c.Pa,c.Pa=!0);b(this);null!==c&&(c.Pa=d)}null!==c&&c.ka.sb||(a?this.expandSubGraph():this.collapseSubGraph())}});w.g(T,"wasSubGraphExpanded",T.prototype.Lx);
  w.defineProperty(T,{Lx:"wasSubGraphExpanded"},function(){return this.Os},function(a){var b=this.Os;b!==a&&(w.i(a,"boolean",T,"wasSubGraphExpanded"),this.Os=a,this.j("wasSubGraphExpanded",b,a))});w.g(T,"subGraphExpandedChanged",T.prototype.GG);w.defineProperty(T,{GG:"subGraphExpandedChanged"},function(){return this.Ds},function(a){var b=this.Ds;b!==a&&(null!==a&&w.i(a,"function",T,"subGraphExpandedChanged"),this.Ds=a,this.j("subGraphExpandedChanged",b,a))});
  T.prototype.move=T.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=w.ic(c,b);S.prototype.move.call(this,a);for(a=this.Wo().k;a.next();){var e=a.value;if(!(e instanceof U||e instanceof S&&e.zf)){var g=e.position,h=e.location;g.J()?(d.x=g.x+c,d.y=g.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 U&&(g=e.position,d.x=g.x+c,d.y=g.y+b,e.move(d));w.B(d)};
  function xh(){P.call(this);this.$e=J.aq;this.os=new y(NaN,NaN,NaN,NaN)}w.Ia(xh,P);w.ja("Placeholder",xh);xh.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.$e=this.$e.ba();a.os=this.os.copy()};xh.prototype.Uj=function(a){if(null===this.background&&null===this.el)return!1;var b=this.Ka;return ob(0,0,b.width,b.height,a.x,a.y)};
  xh.prototype.wp=function(){var a=this.V;null!==a&&(a instanceof T||a instanceof tf)||w.m("Placeholder is not inside a Group or Adornment.");if(a instanceof T){var b=this.computeBorder(this.os),c=this.Lc;bb(c,b.width||0,b.height||0);ol(this,0,0,c.width,c.height);for(var c=a.Rc,d=!1;c.next();)if(c.value.Ja()){d=!0;break}!d||isNaN(b.x)||isNaN(b.y)||(c=new x,c.bu(b,a.Pe),a.location=new x(c.x,c.y))}else{var b=this.ya,c=this.Lc,d=this.padding,e=d.left+d.right,g=d.top+d.bottom;if(b.J())bb(c,b.width+e||0,
  b.height+g||0),ol(this,-d.left,-d.top,c.width,c.height);else{var h=a.wc,k=h.qb(Ab,w.M()),b=w.lk(k.x,k.y,0,0);b.Zi(h.qb(Wb,k));b.Zi(h.qb(Db,k));b.Zi(h.qb(Ub,k));a.Yg.o(b.x,b.y);bb(c,b.width+e||0,b.height+g||0);ol(this,-d.left,-d.top,c.width,c.height);w.B(k);w.nc(b)}}};xh.prototype.Hi=function(a,b,c,d){var e=this.ea;e.x=a;e.y=b;e.width=c;e.height=d};
  xh.prototype.computeBorder=function(a){var b=this.V;if(b instanceof T){var c=b;if(c.Uz&&this.os.J()){var d=c.h;if(null!==d&&(d=d.Wa,d instanceof Bf&&!d.Cq&&null!==d.Zb&&!d.Zb.contains(c)))return a.assign(this.os),a}}var c=w.$f(),d=this.computeMemberBounds(c),e=this.padding;a.o(d.x-e.left,d.y-e.top,d.width+e.left+e.right,d.height+e.top+e.bottom);w.nc(c);b instanceof T&&(c=b,c.iE&&c.location.J()&&a.Zi(c.location));return a};
  xh.prototype.computeMemberBounds=function(a){if(!(this.V instanceof T))return a.o(0,0,0,0),a;for(var b=this.V,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=b.Rc;h.next();){var k=h.value;if(k.Ja()){if(k instanceof U){var l=k;if(!b.hE)continue;if(Gj(l))continue;if(l.Z===b||l.da===b)continue}k=k.ea;k.left<c&&(c=k.left);k.top<d&&(d=k.top);k.right>e&&(e=k.right);k.bottom>g&&(g=k.bottom)}}isFinite(c)&&isFinite(d)?a.o(c,d,e-c,g-d):(b=b.location,c=this.padding,a.o(b.x+c.left,b.y+c.top,0,0));return a};
  w.g(xh,"padding",xh.prototype.padding);
  w.defineProperty(xh,{padding:"padding"},function(){return this.$e},function(a){"number"===typeof a?((isNaN(a)||0>a)&&w.la(a,">= 0",xh,"padding"),a=new eb(a)):(w.l(a,eb,xh,"padding"),(isNaN(a.left)||0>a.left)&&w.la(a.left,">= 0",xh,"padding:value.left"),(isNaN(a.right)||0>a.right)&&w.la(a.right,">= 0",xh,"padding:value.right"),(isNaN(a.top)||0>a.top)&&w.la(a.top,">= 0",xh,"padding:value.top"),(isNaN(a.bottom)||0>a.bottom)&&w.la(a.bottom,">= 0",xh,"padding:value.bottom"));var b=this.$e;b.L(a)||(this.$e=
  a=a.ba(),this.j("padding",b,a))});function Re(){0<arguments.length&&w.$c(Re);w.jc(this);this.Oy=this.Y=null;this.Wq=this.Yq=!0;this.gr=!1;this.hq=(new x(0,0)).freeze();this.Zq=this.ar=!0;this.eC="";this.bo=!1;this.dz=null}w.ja("Layout",Re);Re.prototype.cloneProtected=function(a){a.Yq=this.Yq;a.Wq=this.Wq;a.gr=this.gr;a.hq.assign(this.hq);a.ar=this.ar;a.Zq=this.Zq;a.eC=this.eC;this.Wq||(a.bo=!0)};Re.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};
  Re.prototype.toString=function(){var a=w.yg(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.h&&(a+=" for "+this.h);return a+")"};w.g(Re,"diagram",Re.prototype.h);w.defineProperty(Re,{h:"diagram"},function(){return this.Y},function(a){null!==a&&w.l(a,C,Re,"diagram");this.Y=a});w.g(Re,"group",Re.prototype.group);
  w.defineProperty(Re,{group:"group"},function(){return this.Oy},function(a){this.Oy!==a&&(null!==a&&w.l(a,T,Re,"group"),this.Oy=a,null!==a&&(this.Y=a.h))});w.g(Re,"isOngoing",Re.prototype.mF);w.defineProperty(Re,{mF:"isOngoing"},function(){return this.Yq},function(a){this.Yq!==a&&(w.i(a,"boolean",Re,"isOngoing"),this.Yq=a)});w.g(Re,"isInitial",Re.prototype.kF);w.defineProperty(Re,{kF:"isInitial"},function(){return this.Wq},function(a){w.i(a,"boolean",Re,"isInitial");this.Wq=a;a||(this.bo=!0)});
  w.g(Re,"isViewportSized",Re.prototype.Ct);w.defineProperty(Re,{Ct:"isViewportSized"},function(){return this.gr},function(a){this.gr!==a&&(w.i(a,"boolean",Re,"isViewportSized"),(this.gr=a)&&this.K())});w.g(Re,"isRouting",Re.prototype.Bt);w.defineProperty(Re,{Bt:"isRouting"},function(){return this.ar},function(a){this.ar!==a&&(w.i(a,"boolean",Re,"isRouting"),this.ar=a)});w.g(Re,"isRealtime",Re.prototype.yA);
  w.defineProperty(Re,{yA:"isRealtime"},function(){return this.Zq},function(a){this.Zq!==a&&(w.i(a,"boolean",Re,"isRealtime"),this.Zq=a)});w.g(Re,"isValidLayout",Re.prototype.gf);w.defineProperty(Re,{gf:"isValidLayout"},function(){return this.bo},function(a){this.bo!==a&&(w.i(a,"boolean",Re,"isValidLayout"),this.bo=a,a||(a=this.h,null!==a&&(a.xu=!0)))});
  Re.prototype.invalidateLayout=Re.prototype.K=function(){if(this.bo){var a=this.h;if(null!==a&&!a.ka.sb){var b=a.Pb;!b.cr&&(b.fh&&b.Xi(),this.mF&&a.rf||this.kF&&!a.rf)&&(this.gf=!1,a.Se())}}};w.g(Re,"network",Re.prototype.network);w.defineProperty(Re,{network:"network"},function(){return this.dz},function(a){var b=this.dz;b!==a&&(null!==a&&w.l(a,ta,Re,"network"),null!==b&&(b.Lb=null),this.dz=a,null!==a&&(a.Lb=this))});Re.prototype.createNetwork=function(){return new ta};
  Re.prototype.makeNetwork=function(a){var b=this.createNetwork();b.Lb=this;a instanceof C?(b.Qj(a.Gg,!0),b.Qj(a.links,!0)):a instanceof T?b.Qj(a.Rc):b.Qj(a.k);return b};Re.prototype.updateParts=function(){var a=this.h;if(null===a&&null!==this.network)for(var b=this.network.vertexes.k;b.next();){var c=b.value.Cc;if(null!==c&&(a=c.h,null!==a))break}this.gf=!0;try{null!==a&&a.ac("Layout"),this.commitLayout()}finally{null!==a&&a.ae("Layout")}};Re.prototype.commitLayout=function(){};
  Re.prototype.doLayout=function(a){null===a&&w.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new F(H);a instanceof C?(bp(this,b,a.Gg,!0,this.FA,!0,!1,!0),bp(this,b,a.hk,!0,this.FA,!0,!1,!0)):a instanceof T?bp(this,b,a.Rc,!1,this.FA,!0,!1,!0):b.Zd(a.k);var c=b.count;if(0<c){a=this.h;null!==a&&a.ac("Layout");for(var c=Math.ceil(Math.sqrt(c)),d=this.Gd.x,e=d,g=this.Gd.y,h=0,k=0,b=b.k;b.next();){var l=b.value;l.vf();var m=l.Ga,n=m.width,
  m=m.height;l.moveTo(e,g);l.cz=!1;e+=Math.max(n,50)+20;k=Math.max(k,Math.max(m,50));h>=c-1?(h=0,e=d,g+=k+20,k=0):h++}null!==a&&a.ae("Layout")}this.gf=!0};Re.prototype.FA=function(a){return!a.location.J()||a instanceof T&&a.cz?!0:!1};
  function bp(a,b,c,d,e,g,h,k){for(c=c.k;c.next();){var l=c.value;d&&!l.$w||null!==e&&!e(l)||!l.canLayout()||(g&&l instanceof S?l.zf||(l instanceof T?null===l.Lb?bp(a,b,l.Rc,!1,e,g,h,k):b.add(l):b.add(l)):h&&l instanceof U?b.add(l):!k||!l.Kd()||l instanceof S||b.add(l))}}
  Re.prototype.collectParts=function(a){var b=new F(H);a instanceof C?(bp(this,b,a.Gg,!0,null,!0,!0,!0),bp(this,b,a.links,!0,null,!0,!0,!0),bp(this,b,a.hk,!0,null,!0,!0,!0)):a instanceof T?bp(this,b,a.Rc,!1,null,!0,!0,!0):bp(this,b,a.k,!1,null,!0,!0,!0);return b};w.g(Re,"arrangementOrigin",Re.prototype.Gd);w.defineProperty(Re,{Gd:"arrangementOrigin"},function(){return this.hq},function(a){w.l(a,x,Re,"arrangementOrigin");this.hq.L(a)||(this.hq.assign(a),this.K())});
  Re.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.qb(Ab),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a};function ta(){w.jc(this);this.Td=null;this.clear()}w.ja("LayoutNetwork",ta);
  ta.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.k;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.k;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new F(ua);this.edges=new F(va);this.IA=new ia(S,ua);this.zA=new ia(U,va)};
  ta.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Lb?"("+this.Lb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1<a){for(var c=this.vertexes.k;c.next();)b+="\n    "+c.value.toString(a-1);for(c=this.edges.k;c.next();)b+="\n    "+c.value.toString(a-1)}return b};w.defineProperty(ta,{Lb:"layout"},function(){return this.Td},function(a){t&&null!==a&&w.l(a,Re,ta,"layout");this.Td=a});ta.prototype.createVertex=function(){return new ua};
  ta.prototype.createEdge=function(){return new va};
  ta.prototype.addParts=ta.prototype.Qj=function(a,b,c){if(null!==a){void 0===b&&(b=!1);w.i(b,"boolean",ta,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof S)return!a.zf;if(a instanceof U){var b=a.Z;if(null===b||b.zf)return!1;a=a.da;return null===a||a.zf?!1:!0}return!1});for(a=a.k;a.next();){var d=a.value;if(d instanceof S&&(!b||d.$w)&&d.canLayout()&&c(d))if(d instanceof T&&null===d.Lb)this.Qj(d.Rc,!1);else if(null===this.Sm(d)){var e=this.createVertex();e.Cc=d;
  this.dl(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof U&&(!b||d.$w)&&d.canLayout()&&c(d)&&null===this.Gw(d)){var g=d.Z,e=d.da;null!==g&&null!==e&&g!==e&&(g=this.findGroupVertex(g),e=this.findGroupVertex(e),null!==g&&null!==e&&this.vp(g,e,d))}}};ta.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.Sm(b);if(null!==a)return a;for(b=b.Va;null!==b;){a=this.Sm(b);if(null!==a)return a;b=b.Va}return null};
  ta.prototype.addVertex=ta.prototype.dl=function(a){if(null!==a){t&&w.l(a,ua,ta,"addVertex:vertex");this.vertexes.add(a);var b=a.Cc;null!==b&&this.IA.add(b,a);a.network=this}};ta.prototype.addNode=ta.prototype.Ts=function(a){if(null===a)return null;t&&w.l(a,S,ta,"addNode:node");var b=this.Sm(a);null===b&&(b=this.createVertex(),b.Cc=a,this.dl(b));return b};
  ta.prototype.deleteVertex=ta.prototype.zE=function(a){if(null!==a&&(t&&w.l(a,ua,ta,"deleteVertex:vertex"),cp(this,a))){for(var b=a.Te,c=b.count-1;0<=c;c--){var d=b.na(c);this.Ro(d)}b=a.Me;for(c=b.count-1;0<=c;c--)d=b.na(c),this.Ro(d)}};function cp(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.IA.remove(b.Cc),b.network=null);return c}ta.prototype.deleteNode=function(a){null!==a&&(t&&w.l(a,S,ta,"deleteNode:node"),a=this.Sm(a),null!==a&&this.zE(a))};
  ta.prototype.findVertex=ta.prototype.Sm=function(a){if(null===a)return null;t&&w.l(a,S,ta,"findVertex:node");return this.IA.Aa(a)};ta.prototype.addEdge=ta.prototype.Do=function(a){if(null!==a){t&&w.l(a,va,ta,"addEdge:edge");this.edges.add(a);var b=a.link;null!==b&&null===this.Gw(b)&&this.zA.add(b,a);b=a.toVertex;null!==b&&b.OD(a);b=a.fromVertex;null!==b&&b.ND(a);a.network=this}};
  ta.prototype.addLink=function(a){if(null===a)return null;t&&w.l(a,U,ta,"addLink:link");var b=a.Z,c=a.da,d=this.Gw(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.Ts(b)),null!==c&&(d.toVertex=this.Ts(c)),this.Do(d)):(d.fromVertex=null!==b?this.Ts(b):null,d.toVertex=null!==c?this.Ts(c):null);return d};ta.prototype.deleteEdge=ta.prototype.Ro=function(a){if(null!==a){t&&w.l(a,va,ta,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.yE(a);b=a.fromVertex;null!==b&&b.xE(a);dp(this,a)}};
  function dp(a,b){null!==b&&a.edges.remove(b)&&(a.zA.remove(b.link),b.network=null)}ta.prototype.deleteLink=function(a){null!==a&&(t&&w.l(a,U,ta,"deleteLink:link"),a=this.Gw(a),null!==a&&this.Ro(a))};ta.prototype.findEdge=ta.prototype.Gw=function(a){if(null===a)return null;t&&w.l(a,U,ta,"findEdge:link");return this.zA.Aa(a)};
  ta.prototype.linkVertexes=ta.prototype.vp=function(a,b,c){if(null===a||null===b)return null;t&&(w.l(a,ua,ta,"linkVertexes:fromVertex"),w.l(b,ua,ta,"linkVertexes:toVertex"),null!==c&&w.l(c,U,ta,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.Do(d);return d}return null};
  ta.prototype.reverseEdge=ta.prototype.vx=function(a){if(null!==a){t&&w.l(a,va,ta,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.xE(a),c.yE(a),a.vx(),b.OD(a),c.ND(a))}};ta.prototype.deleteSelfEdges=ta.prototype.Bw=function(){for(var a=w.lb(),b=this.edges.k;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.Ro(a[c]);w.xa(a)};
  ta.prototype.deleteArtificialVertexes=function(){for(var a=w.lb(),b=this.vertexes.k;b.next();){var c=b.value;null===c.Cc&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.zE(a[b]);c=w.lb();for(b=this.edges.k;b.next();){var d=b.value;null===d.link&&c.push(d)}d=c.length;for(b=0;b<d;b++)this.Ro(c[b]);w.xa(a);w.xa(c)};function ep(a){for(var b=w.lb(),c=a.edges.k;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.Ro(b[d]);w.xa(b)}
  ta.prototype.splitIntoSubNetworks=ta.prototype.YJ=function(){this.deleteArtificialVertexes();ep(this);this.Bw();for(var a=new D(ta),b=!0;b;)for(var b=!1,c=this.vertexes.k;c.next();){var d=c.value;if(0<d.Te.count||0<d.Me.count){b=this.Lb.createNetwork();a.add(b);fp(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 fp(a,b,c){if(null!==c&&c.network!==b){cp(a,c);b.dl(c);for(var d=c.rc;d.next();){var e=d.value;e.network!==b&&(dp(a,e),b.Do(e),fp(a,b,e.fromVertex))}for(d=c.fc;d.next();)c=d.value,c.network!==b&&(dp(a,c),b.Do(c),fp(a,b,c.toVertex))}}ta.prototype.findAllParts=function(){for(var a=new F(H),b=this.vertexes.k;b.next();)a.add(b.value.Cc);for(b=this.edges.k;b.next();)a.add(b.value.link);return a};
  function ua(){w.jc(this);this.network=null;this.ca=(new y(0,0,10,10)).freeze();this.O=(new x(5,5)).freeze();this.clear()}w.ja("LayoutVertex",ua);ua.prototype.clear=function(){this.od=this.rh=null;this.Te=new D(va);this.Me=new D(va)};
  ua.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+w.Yc(this);if(0<a&&(b+=null!==this.Cc?"("+this.Cc.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Te.k;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Me.k;d.next();){var g=d.value;c?c=!1:e+=",";e+=g.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};w.g(ua,"data",ua.prototype.data);
  w.defineProperty(ua,{data:"data"},function(){return this.rh},function(a){this.rh=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width,b=b.height;this.O.o(d/2,b/2);this.ca.o(a,c,d,b)}});w.g(ua,"node",ua.prototype.Cc);
  w.defineProperty(ua,{Cc:"node"},function(){return this.od},function(a){if(this.od!==a){t&&null!==a&&w.l(a,S,ua,"node");this.od=a;a.vf();var b=a.ea,c=b.x,d=b.y,e=b.width,b=b.height;isNaN(c)&&(c=0);isNaN(d)&&(d=0);this.ca.o(c,d,e,b);if(!(a instanceof T)&&(a=a.hc.qb(Ob),a.J())){this.O.o(a.x-c,a.y-d);return}this.O.o(e/2,b/2)}});w.g(ua,"bounds",ua.prototype.kb);w.defineProperty(ua,{kb:"bounds"},function(){return this.ca},function(a){this.ca.L(a)||(t&&w.l(a,y,ua,"bounds"),this.ca.assign(a))});
  w.g(ua,"focus",ua.prototype.focus);w.defineProperty(ua,{focus:"focus"},function(){return this.O},function(a){this.O.L(a)||(t&&w.l(a,x,ua,"focus"),this.O.assign(a))});w.g(ua,"centerX",ua.prototype.Da);w.defineProperty(ua,{Da:"centerX"},function(){return this.ca.x+this.O.x},function(a){var b=this.ca;b.x+this.O.x!==a&&(t&&w.p(a,ua,"centerX"),b.Na(),b.x=a-this.O.x,b.freeze())});w.g(ua,"centerY",ua.prototype.Ra);
  w.defineProperty(ua,{Ra:"centerY"},function(){return this.ca.y+this.O.y},function(a){var b=this.ca;b.y+this.O.y!==a&&(t&&w.p(a,ua,"centerY"),b.Na(),b.y=a-this.O.y,b.freeze())});w.g(ua,"focusX",ua.prototype.Yo);w.defineProperty(ua,{Yo:"focusX"},function(){return this.O.x},function(a){var b=this.O;b.x!==a&&(b.Na(),b.x=a,b.freeze())});w.g(ua,"focusY",ua.prototype.Zo);w.defineProperty(ua,{Zo:"focusY"},function(){return this.O.y},function(a){var b=this.O;b.y!==a&&(b.Na(),b.y=a,b.freeze())});
  w.g(ua,"x",ua.prototype.x);w.defineProperty(ua,{x:"x"},function(){return this.ca.x},function(a){var b=this.ca;b.x!==a&&(b.Na(),b.x=a,b.freeze())});w.g(ua,"y",ua.prototype.y);w.defineProperty(ua,{y:"y"},function(){return this.ca.y},function(a){var b=this.ca;b.y!==a&&(b.Na(),b.y=a,b.freeze())});w.g(ua,"width",ua.prototype.width);w.defineProperty(ua,{width:"width"},function(){return this.ca.width},function(a){var b=this.ca;b.width!==a&&(b.Na(),b.width=a,b.freeze())});w.g(ua,"height",ua.prototype.height);
  w.defineProperty(ua,{height:"height"},function(){return this.ca.height},function(a){var b=this.ca;b.height!==a&&(b.Na(),b.height=a,b.freeze())});ua.prototype.commit=function(){var a=this.rh;if(null!==a){var b=this.kb,c=a.bounds;w.Xa(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 T)){var c=a.ea,d=a.hc.qb(Ob);if(c.J()&&d.J()){a.moveTo(b.x+this.Yo-(d.x-c.x),b.y+this.Zo-(d.y-c.y));return}}a.moveTo(b.x,b.y)}};
  ua.prototype.addSourceEdge=ua.prototype.OD=function(a){null!==a&&(t&&w.l(a,va,ua,"addSourceEdge:edge"),this.Te.contains(a)||this.Te.add(a))};ua.prototype.deleteSourceEdge=ua.prototype.yE=function(a){null!==a&&(t&&w.l(a,va,ua,"deleteSourceEdge:edge"),this.Te.remove(a))};ua.prototype.addDestinationEdge=ua.prototype.ND=function(a){null!==a&&(t&&w.l(a,va,ua,"addDestinationEdge:edge"),this.Me.contains(a)||this.Me.add(a))};
  ua.prototype.deleteDestinationEdge=ua.prototype.xE=function(a){null!==a&&(t&&w.l(a,va,ua,"deleteDestinationEdge:edge"),this.Me.remove(a))};w.A(ua,{VJ:"sourceVertexes"},function(){for(var a=new F(ua),b=this.rc;b.next();)a.add(b.value.fromVertex);return a.k});w.A(ua,{BI:"destinationVertexes"},function(){for(var a=new F(ua),b=this.fc;b.next();)a.add(b.value.toVertex);return a.k});
  w.A(ua,{vertexes:"vertexes"},function(){for(var a=new F(ua),b=this.rc;b.next();)a.add(b.value.fromVertex);for(b=this.fc;b.next();)a.add(b.value.toVertex);return a.k});w.A(ua,{rc:"sourceEdges"},function(){return this.Te.k});w.A(ua,{fc:"destinationEdges"},function(){return this.Me.k});w.A(ua,{edges:"edges"},function(){for(var a=new D(va),b=this.rc;b.next();)a.add(b.value);for(b=this.fc;b.next();)a.add(b.value);return a.k});w.A(ua,{HI:"edgesCount"},function(){return this.Te.count+this.Me.count});var gp;
  ua.standardComparer=gp=function(a,b){t&&w.l(a,ua,ua,"standardComparer:m");t&&w.l(b,ua,ua,"standardComparer:n");var c=a.od,d=b.od;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
  ua.smartComparer=function(a,b){t&&w.l(a,ua,ua,"smartComparer:m");t&&w.l(b,ua,ua,"smartComparer:n");if(null!==a){if(null!==b){var c=a.od,d=b.od;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 g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){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!==g-h)return g-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 va(){w.jc(this);this.network=null;this.clear()}w.ja("LayoutEdge",va);va.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null};
  va.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+w.Yc(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};va.prototype.vx=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};va.prototype.commit=function(){};
  va.prototype.getOtherVertex=va.prototype.MI=function(a){t&&w.l(a,ua,va,"getOtherVertex:v");return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};function Zk(){0<arguments.length&&w.$c(Zk);Re.call(this);this.Ct=!0;this.Qs=this.Rs=NaN;this.cj=(new fa(NaN,NaN)).freeze();this.Jh=(new fa(10,10)).freeze();this.ye=hm;this.bd=fm;this.Ih=bm;this.qh=hp}w.Ia(Zk,Re);w.ja("GridLayout",Zk);
  Zk.prototype.cloneProtected=function(a){Re.prototype.cloneProtected.call(this,a);a.Rs=this.Rs;a.Qs=this.Qs;a.cj.assign(this.cj);a.Jh.assign(this.Jh);a.ye=this.ye;a.bd=this.bd;a.Ih=this.Ih;a.qh=this.qh};
  Zk.prototype.doLayout=function(a){null===a&&w.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.Gd=this.initialOrigin(this.Gd);var b=this.h,c=new F(H);a instanceof C?(b=a,bp(this,c,a.Gg,!0,null,!0,!0,!0),bp(this,c,a.links,!0,null,!0,!0,!0),bp(this,c,a.hk,!0,null,!0,!0,!0)):a instanceof T?(b=a.h,bp(this,c,a.Rc,!1,null,!0,!0,!0)):c.Zd(a.k);for(a=c.copy().k;a.next();){var d=a.value;if(d instanceof U){var e=d;if(null!==e.Z||null!==e.da){c.remove(e);
  continue}}d.vf();if(d instanceof T)for(d=d.Rc;d.next();)c.remove(d.value)}e=c.Ue();if(0!==e.length){switch(this.sorting){case em:e.reverse();break;case bm:e.sort(this.comparer);break;case cm:e.sort(this.comparer),e.reverse()}var g=this.aH;isNaN(g)&&(g=0);var h=this.vB,h=isNaN(h)&&null!==b?Math.max(b.ub.width-b.padding.left-b.padding.right,0):Math.max(this.vB,0);0>=g&&0>=h&&(g=1);c=this.spacing.width;isFinite(c)||(c=0);a=this.spacing.height;isFinite(a)||(a=0);null!==b&&b.ac("Layout");d=[];switch(this.alignment){case im:var k=
  c,l=a,m=Math.max(this.fl.width,1);if(!isFinite(m))for(var n=m=0;n<e.length;n++)var p=e[n],q=p.Ga,m=Math.max(m,q.width);var m=Math.max(m+k,1),r=Math.max(this.fl.height,1);if(!isFinite(r))for(n=r=0;n<e.length;n++)p=e[n],q=p.Ga,r=Math.max(r,q.height);for(var r=Math.max(r+l,1),s=this.Ge,u=this.Gd.x,v=u,A=this.Gd.y,E=0,B=0,n=0;n<e.length;n++){var p=e[n],q=p.Ga,G=Math.ceil((q.width+k)/m)*m,O=Math.ceil((q.height+l)/r)*r,M=0;switch(s){case gm:M=Math.abs(v-q.width);break;default:M=v+q.width}if(0<g&&E>g-1||
  0<h&&0<E&&M>h)d.push(new y(0,A,h+k,B)),E=0,v=u,A+=B,B=0;B=Math.max(B,O);O=0;switch(s){case gm:O=-q.width;break;default:O=0}p.moveTo(v+O,A);switch(s){case gm:v-=G;break;default:v+=G}E++}d.push(new y(0,A,h+k,B));break;case hm:k=g;l=c;m=a;n=Math.max(this.fl.width,1);p=A=G=0;q=w.M();for(g=0;g<e.length;g++)r=e[g],s=r.Ga,u=Rn(r,r.hc,r.Pe,q),G=Math.max(G,u.x),A=Math.max(A,s.width-u.x),p=Math.max(p,u.y);v=this.Ge;switch(v){case gm:G+=l;break;default:A+=l}var n=isFinite(n)?Math.max(n+l,1):Math.max(G+A,1),
  X=A=this.Gd.x,E=this.Gd.y,B=0;h>=G&&(h-=G);for(var G=O=0,M=Math.max(this.fl.height,1),ja=p=0,V=!0,Q=w.M(),g=0;g<e.length;g++){r=e[g];s=r.Ga;u=Rn(r,r.hc,r.Pe,q);if(0<B)switch(v){case gm:X=Math.floor((X-A-(s.width-u.x))/n)*n+A;break;default:X=Math.ceil((X-A+u.x)/n)*n+A}else switch(v){case gm:O=X+u.x+s.width;break;default:O=X-u.x}var ca=0;switch(v){case gm:ca=-(X+u.x)+O;break;default:ca=X+s.width-u.x-O}if(0<k&&B>k-1||0<h&&0<B&&ca>h){d.push(new y(0,V?E-p:E,h+l,ja+p+m));for(X=0;X<B&&g!==B;X++){var ca=
  e[g-B+X],Pa=Rn(ca,ca.hc,ca.Pe,Q);ca.moveTo(ca.position.x,ca.position.y+p-Pa.y)}ja+=m;E=V?E+ja:E+(ja+p);B=ja=p=0;X=A;V=!1}X===A&&(G=v===gm?Math.max(G,s.width-u.x):Math.min(G,-u.x));p=Math.max(p,u.y);ja=Math.max(ja,s.height-u.y);isFinite(M)&&(ja=Math.max(ja,Math.max(s.height,M)-u.y));V?r.moveTo(X-u.x,E-u.y):r.moveTo(X-u.x,E);switch(v){case gm:X-=u.x+l;break;default:X+=s.width-u.x+l}B++}d.push(new y(0,E,h+l,(V?ja:ja+p)+m));for(X=0;X<B&&g!==B;X++)ca=e[g-B+X],Pa=Rn(ca,ca.hc,ca.Pe,q),ca.moveTo(ca.position.x,
  ca.position.y+p-Pa.y);w.B(q);w.B(Q);if(v===gm)for(g=0;g<d.length;g++)e=d[g],e.width+=G,e.x-=G;else for(g=0;g<d.length;g++)e=d[g],e.x>G&&(e.width+=e.x-G,e.x=G)}for(k=g=h=e=0;k<d.length;k++)l=d[k],e=Math.min(e,l.x),h=Math.min(h,l.y),g=Math.max(g,l.x+l.width);this.Ge===gm?this.commitLayers(d,new x(e+c/2-(g+e),h-a/2)):this.commitLayers(d,new x(e-c/2,h-a/2));null!==b&&b.ae("Layout");this.gf=!0}};Zk.prototype.commitLayers=function(){};w.g(Zk,"wrappingWidth",Zk.prototype.vB);
  w.defineProperty(Zk,{vB:"wrappingWidth"},function(){return this.Rs},function(a){this.Rs!==a&&(w.i(a,"number",Zk,"wrappingWidth"),0<a||isNaN(a))&&(this.Rs=a,this.Ct=isNaN(a),this.K())});w.g(Zk,"wrappingColumn",Zk.prototype.aH);w.defineProperty(Zk,{aH:"wrappingColumn"},function(){return this.Qs},function(a){this.Qs!==a&&(w.i(a,"number",Zk,"wrappingColumn"),0<a||isNaN(a))&&(this.Qs=a,this.K())});w.g(Zk,"cellSize",Zk.prototype.fl);
  w.defineProperty(Zk,{fl:"cellSize"},function(){return this.cj},function(a){w.l(a,fa,Zk,"cellSize");this.cj.L(a)||(this.cj.assign(a),this.K())});w.g(Zk,"spacing",Zk.prototype.spacing);w.defineProperty(Zk,{spacing:"spacing"},function(){return this.Jh},function(a){w.l(a,fa,Zk,"spacing");this.Jh.L(a)||(this.Jh.assign(a),this.K())});w.g(Zk,"alignment",Zk.prototype.alignment);
  w.defineProperty(Zk,{alignment:"alignment"},function(){return this.ye},function(a){this.ye!==a&&(w.za(a,Zk,Zk,"alignment"),a===hm||a===im)&&(this.ye=a,this.K())});w.g(Zk,"arrangement",Zk.prototype.Ge);w.defineProperty(Zk,{Ge:"arrangement"},function(){return this.bd},function(a){this.bd!==a&&(w.za(a,Zk,Zk,"arrangement"),a===fm||a===gm)&&(this.bd=a,this.K())});w.g(Zk,"sorting",Zk.prototype.sorting);
  w.defineProperty(Zk,{sorting:"sorting"},function(){return this.Ih},function(a){this.Ih!==a&&(w.za(a,Zk,Zk,"sorting"),a===dm||a===em||a===bm||a===cm)&&(this.Ih=a,this.K())});w.g(Zk,"comparer",Zk.prototype.comparer);w.defineProperty(Zk,{comparer:"comparer"},function(){return this.qh},function(a){this.qh!==a&&(w.i(a,"function",Zk,"comparer"),this.qh=a,this.K())});var hp;
  Zk.standardComparer=hp=function(a,b){t&&w.l(a,H,Zk,"standardComparer:a");t&&w.l(b,H,Zk,"standardComparer:b");var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
  Zk.smartComparer=function(a,b){t&&w.l(a,H,Zk,"standardComparer:a");t&&w.l(b,H,Zk,"standardComparer: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 g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){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!==g-h)return g-h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==b?-1:0};var im;Zk.Position=im=w.w(Zk,"Position",0);var hm;Zk.Location=hm=w.w(Zk,"Location",1);var fm;Zk.LeftToRight=fm=w.w(Zk,"LeftToRight",2);var gm;Zk.RightToLeft=gm=w.w(Zk,"RightToLeft",3);var dm;Zk.Forward=dm=w.w(Zk,"Forward",4);var em;Zk.Reverse=em=w.w(Zk,"Reverse",5);var bm;Zk.Ascending=bm=w.w(Zk,"Ascending",6);var cm;Zk.Descending=cm=w.w(Zk,"Descending",7);
  function jm(){0<arguments.length&&w.$c(jm);Re.call(this);this.Fy=this.On=this.zd=0;this.Dq=360;this.Ey=Cm;this.Ek=0;this.lC=Cm;this.Eu=this.sg=this.DD=0;this.cw=new ip;this.Hu=this.km=0;this.wH=600;this.as=NaN;this.jq=1;this.Cs=0;this.Es=360;this.bd=Cm;this.ta=rm;this.Ih=om;this.qh=gp;this.Jh=6;this.Mr=Fm}w.Ia(jm,Re);w.ja("CircularLayout",jm);
  jm.prototype.cloneProtected=function(a){Re.prototype.cloneProtected.call(this,a);a.as=this.as;a.jq=this.jq;a.Cs=this.Cs;a.Es=this.Es;a.bd=this.bd;a.ta=this.ta;a.Ih=this.Ih;a.qh=this.qh;a.Jh=this.Jh;a.Mr=this.Mr};jm.prototype.createNetwork=function(){return new jp};
  jm.prototype.doLayout=function(a){null===a&&w.m("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.Da=0,a.Ra=0);else{var b=new D(kp);b.Zd(a.k);a=new D(kp);var c=new D(kp),d;d=this.sort(b);var e=this.Ey,g=this.lC,h=this.zd,k=this.On,l=this.Fy,m=this.Dq,b=this.Ek,n=this.DD,p=this.sg,q=this.Eu,e=this.Ge,g=this.Lt,h=this.RF;if(!isFinite(h)||
  0>=h)h=NaN;k=this.TD;if(!isFinite(k)||0>=k)k=1;l=this.lh;isFinite(l)||(l=0);m=this.Yh;if(!isFinite(m)||360<m||1>m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Dm&&g===Em?e=Cm:e===Dm&&g!==Em&&(g=Em,e=this.Ge);if((this.direction===pm||this.direction===qm)&&this.sorting!==om){for(var r=0;!(r>=d.length);r+=2){a.add(d.na(r));if(r+1>=d.length)break;c.add(d.na(r+1))}this.direction===pm?(this.Ge===Dm&&a.reverse(),d=new D(kp),d.Zd(a),d.Zd(c)):(this.Ge===Dm&&c.reverse(),d=new D(kp),d.Zd(c),d.Zd(a))}for(var s=
  d.length,u=n=0,r=0;r<d.length;r++){var p=l+m*u*(this.direction===rm?1:-1)/s,v=d.na(r).diameter;isNaN(v)&&(v=lp(d.na(r),p));360>m&&(0===r||r===d.length-1)&&(v/=2);n+=v;u++}if(isNaN(h)||e===Dm){isNaN(b)&&(b=6);if(e!==Cm&&e!==Dm){v=-Infinity;for(r=0;r<s;r++){var q=d.na(r),A=d.na(r===s-1?0:r+1);isNaN(q.diameter)&&lp(q,0);isNaN(A.diameter)&&lp(A,0);v=Math.max(v,(q.diameter+A.diameter)/2)}q=v+b;e===Am?(p=2*Math.PI/s,h=(v+b)/p):h=mp(this,q*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180)}else h=mp(this,n+(360<=
  m?s:s-1)*(e!==Dm?b:1.6*b),k,l*Math.PI/180,m*Math.PI/180);p=h*k}else if(p=h*k,u=np(this,h,p,l*Math.PI/180,m*Math.PI/180),isNaN(b)){if(e===Cm||e===Dm)b=(u-n)/(360<=m?s:s-1)}else if(e===Cm||e===Dm)r=(u-n)/(360<=m?s:s-1),r<b?(h=mp(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.na(r),A=d.na(r===s-1?0:r+1),isNaN(q.diameter)&&lp(q,0),isNaN(A.diameter)&&lp(A,0),v=Math.max(v,(q.diameter+A.diameter)/2);q=v+b;r=mp(this,q*(360<=m?s:s-1),k,l*Math.PI/180,
  m*Math.PI/180);r>h?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.Ey=e;this.lC=g;this.zd=h;this.On=k;this.Fy=l;this.Dq=m;this.Ek=b;this.DD=n;this.sg=p;this.Eu=q;b=d;d=this.Ey;e=this.zd;g=this.Fy;k=this.Dq;l=this.Ek;m=this.sg;n=this.Eu;if(this.direction!==pm&&this.direction!==qm||d!==Dm)if(this.direction===pm||this.direction===qm){h=0;switch(d){case Bm:h=180*op(this,e,m,g,n)/Math.PI;break;case Cm:n=b=0;h=a.first();null!==h&&(b=lp(h,Math.PI/2));h=c.first();null!==h&&(n=lp(h,Math.PI/2));h=180*op(this,e,m,g,l+(b+
  n)/2)/Math.PI;break;case Am:h=k/b.length}if(this.direction===pm){switch(d){case Bm:pp(this,a,g,zm);break;case Cm:qp(this,a,g,zm);break;case Am:rp(this,a,k/2,g,zm)}switch(d){case Bm:pp(this,c,g+h,rm);break;case Cm:qp(this,c,g+h,rm);break;case Am:rp(this,c,k/2,g+h,rm)}}else{switch(d){case Bm:pp(this,c,g,zm);break;case Cm:qp(this,c,g,zm);break;case Am:rp(this,c,k/2,g,zm)}switch(d){case Bm:pp(this,a,g+h,rm);break;case Cm:qp(this,a,g+h,rm);break;case Am:rp(this,a,k/2,g+h,rm)}}}else switch(d){case Bm:pp(this,
  b,g,this.direction);break;case Cm:qp(this,b,g,this.direction);break;case Am:rp(this,b,k,g,this.direction);break;case Dm:sp(this,b,k,g,this.direction)}else sp(this,b,k,g-k/2,rm)}this.updateParts();this.network=null;this.gf=!0};
  function rp(a,b,c,d,e){var g=a.Dq,h=a.zd;a=a.sg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===rm?l*c/(360<=g?k:k-1):-(l*c)/k),n=b.na(l),p=h*Math.tan(m)/a,p=Math.sqrt((h*h+a*a*p*p)/(1+p*p));n.Da=p*Math.cos(m);n.Ra=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
  function qp(a,b,c,d){var e=a.zd,g=a.sg,h=a.Ek;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.na(l),n=b.na(l===k-1?0:l+1),p=g*Math.sin(c);m.Da=e*Math.cos(c);m.Ra=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&lp(m,0);isNaN(n.diameter)&&lp(n,0);m=op(a,e,g,d===rm?c:-c,(m.diameter+n.diameter)/2+h);c+=d===rm?m:-m}}
  function pp(a,b,c,d){var e=a.zd,g=a.sg,h=a.Eu;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.na(l);m.Da=e*Math.cos(c);m.Ra=g*Math.sin(c);m.actualAngle=180*c/Math.PI;m=op(a,e,g,d===rm?c:-c,h);c+=d===rm?m:-m}}function sp(a,b,c,d,e){var g=a.Hu,g=a.Dq;a.km=0;a.cw=new ip;if(360>c){for(g=d+(e===rm?g:-g);0>g;)g+=360;g%=360;180<g&&(g-=360);g*=Math.PI/180;a.Hu=g;tp(a,b,c,d,e)}else up(a,b,c,d,e);a.cw.commit(b)}
  function up(a,b,c,d,e){var g=a.zd,h=a.Ek,k=a.On,l=g*Math.cos(d*Math.PI/180),m=a.sg*Math.sin(d*Math.PI/180),n=b.Ue();if(3===n.length)n[0].Da=g,n[0].Ra=0,n[1].Da=n[0].Da-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].Da=(n[0].Da+n[1].Da)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].Da=g,n[0].Ra=0,n[2].Da=-n[0].Da,n[2].Ra=n[0].Ra,n[1].Da=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].Da=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(var g=w.M(),p=0;p<n.length;p++){n[p].Da=
  l;n[p].Ra=m;if(p>=n.length-1)break;vp(a,l,m,n,p,e,g)||wp(a,l,m,n,p,e,g);l=g.x;m=g.y}w.B(g);a.km++;if(!(23<a.km)){var l=n[0].Da,m=n[0].Ra,g=n[n.length-1].Da,p=n[n.length-1].Ra,q=Math.abs(l-g)-((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-g)<(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(g)>Math.abs(p)?0<g!==m>p:0<p!==l<g;if(q=e===rm?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.cw.compare(h,n);1<Math.abs(h)&&(a.zd=8>a.km?a.zd-h/(2*Math.PI):5>n.length&&10<h?a.zd/2:a.zd-(0<h?1.7:-2.3),a.sg=a.zd*k,up(a,b,c,d,e))}}}
  function tp(a,b,c,d,e){for(var g=a.zd,h=a.sg,k=a.On,l=g*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=w.M(),p=b.Ue(),q=0;q<p.length;q++){p[q].Da=l;p[q].Ra=m;if(q>=p.length-1)break;vp(a,l,m,p,q,e,n)||wp(a,l,m,p,q,e,n);l=n.x;m=n.y}w.B(n);a.km++;if(!(23<a.km)){l=Math.atan2(m,l);l=e===rm?a.Hu-l:l-a.Hu;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;g=l*(g+h)/2;h=a.cw;if(Math.abs(g)<Math.abs(h.bp))for(h.bp=g,h.nn=[],h.Zp=[],l=0;l<p.length;l++)h.nn[l]=p[l].kb.x,h.Zp[l]=p[l].kb.y;1<Math.abs(g)&&
  (a.zd=8>a.km?a.zd-g/(2*Math.PI):a.zd-(0<g?1.7:-2.3),a.sg=a.zd*k,tp(a,b,c,d,e))}}function vp(a,b,c,d,e,g,h){var k=a.zd,l=a.sg,m=0,n=0;a=(d[e].width+d[e+1].width)/2+a.Ek;var p=!1;if(0<=c!==(g===rm)){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 wp(a,b,c,d,e,g,h){var k=a.zd,l=a.sg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.Ek;d=!1;if(0<=b!==(g===rm)){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}jm.prototype.commitLayout=function(){this.commitNodes();this.Bt&&this.commitLinks()};
  jm.prototype.commitNodes=function(){for(var a=this.EH,b=this.network.vertexes.k;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};jm.prototype.commitLinks=function(){for(var a=this.network.edges.k;a.next();)a.value.commit()};
  function np(a,b,c,d,e){var g=a.wH;if(.001>Math.abs(a.On-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/(g+1):Math.PI/(2*(g+1)),l=0,m=0;m<=g;m++)l=void 0!==d&&void 0!==e?d+m*e/g:m*Math.PI/(2*g),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 mp(a,b,c,d,e){var g=0,g=void 0!==d&&void 0!==e?np(a,1,c,d,e):np(a,1,c);return b/g}
  function op(a,b,c,d,e){if(.001>Math.abs(a.On-1))return e/b;var g=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-g*g*l*l)*a;if(h>=e)return k*a}}
  jm.prototype.sort=function(a){switch(this.sorting){case mm:break;case nm:a.reverse();break;case km:a.sort(this.comparer);break;case lm:a.sort(this.comparer);a.reverse();break;case om:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new D(kp),c=0;c<a.length;c++){var e=-1,g=-1;if(0===c)for(var h=0;h<a.length;h++){var k=a.na(h).HI;k>e&&(e=k,g=h)}else for(h=0;h<a.length;h++)k=b[h],k>e&&(e=k,g=h);d.add(a.na(g));b[g]=-1;g=a.na(g);e=0;for(h=g.rc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&&
  b[e]++;for(g=g.fc;g.next();)e=a.indexOf(g.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(b=0;b<d.length;b++){h=d.na(b);a[b]=[];for(var l=0,c=h.fc;c.next();)l=d.indexOf(c.value.toVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l);for(c=h.rc;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=[],g=new D(kp),n=0,b=0;b<a.length;b++){var p=a[b].length;if(1===p)e.push(b);else if(0===p)g.add(d.na(b));else{if(0===n)c.push(b);
  else{for(var q=Infinity,r=Infinity,s=-1,u=[],p=0;p<c.length;p++)0>a[c[p]].indexOf(c[p===c.length-1?0:p+1])&&u.push(p===c.length-1?0:p+1);if(0===u.length)for(p=0;p<c.length;p++)u.push(p);for(p=0;p<u.length;p++){var v=u[p],A,l=a[b];A=k;for(var E=m,B=h,G=v,O=c,M=0,X=0;X<A.length;X++){var ja=B[A[X]],V=B[E[X]],Q=0,ca=0;ja<V?(Q=ja,ca=V):(Q=V,ca=ja);if(Q<G&&G<=ca)for(ja=0;ja<l.length;ja++)V=l[ja],0>O.indexOf(V)||Q<B[V]&&B[V]<ca||Q===B[V]||ca===B[V]||M++;else for(ja=0;ja<l.length;ja++)V=l[ja],0>O.indexOf(V)||
  Q<B[V]&&B[V]<ca&&Q!==B[V]&&ca!==B[V]&&M++}A=M;for(B=E=0;B<a[b].length;B++)l=c.indexOf(a[b][B]),0<=l&&(l=Math.abs(v-(l>=v?l+1:l)),E+=l<c.length+1-l?l:c.length+1-l);for(B=0;B<k.length;B++)l=h[k[B]],G=h[m[B]],l>=v&&l++,G>=v&&G++,l>G&&(O=G,G=l,l=O),G-l<(c.length+2)/2===(l<v&&v<=G)&&E++;if(A<q||A===q&&E<r)q=A,r=E,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],g.add(d.na(l));return g;default:w.m("Invalid sorting type.")}return a};w.g(jm,"radius",jm.prototype.RF);
  w.defineProperty(jm,{RF:"radius"},function(){return this.as},function(a){this.as!==a&&(w.i(a,"number",jm,"radius"),0<a||isNaN(a))&&(this.as=a,this.K())});w.g(jm,"aspectRatio",jm.prototype.TD);w.defineProperty(jm,{TD:"aspectRatio"},function(){return this.jq},function(a){this.jq!==a&&(w.i(a,"number",jm,"aspectRatio"),0<a&&(this.jq=a,this.K()))});w.g(jm,"startAngle",jm.prototype.lh);
  w.defineProperty(jm,{lh:"startAngle"},function(){return this.Cs},function(a){this.Cs!==a&&(w.i(a,"number",jm,"startAngle"),this.Cs=a,this.K())});w.g(jm,"sweepAngle",jm.prototype.Yh);w.defineProperty(jm,{Yh:"sweepAngle"},function(){return this.Es},function(a){this.Es!==a&&(w.i(a,"number",jm,"sweepAngle"),this.Es=0<a&&360>=a?a:360,this.K())});w.g(jm,"arrangement",jm.prototype.Ge);
  w.defineProperty(jm,{Ge:"arrangement"},function(){return this.bd},function(a){this.bd!==a&&(w.za(a,jm,jm,"arrangement"),a===Dm||a===Cm||a===Bm||a===Am)&&(this.bd=a,this.K())});w.g(jm,"direction",jm.prototype.direction);w.defineProperty(jm,{direction:"direction"},function(){return this.ta},function(a){this.ta!==a&&(w.za(a,jm,jm,"direction"),a===rm||a===zm||a===pm||a===qm)&&(this.ta=a,this.K())});w.g(jm,"sorting",jm.prototype.sorting);
  w.defineProperty(jm,{sorting:"sorting"},function(){return this.Ih},function(a){this.Ih!==a&&(w.za(a,jm,jm,"sorting"),a===mm||a===nm||a===km||lm||a===om)&&(this.Ih=a,this.K())});w.g(jm,"comparer",jm.prototype.comparer);w.defineProperty(jm,{comparer:"comparer"},function(){return this.qh},function(a){this.qh!==a&&(w.i(a,"function",jm,"comparer"),this.qh=a,this.K())});w.g(jm,"spacing",jm.prototype.spacing);
  w.defineProperty(jm,{spacing:"spacing"},function(){return this.Jh},function(a){this.Jh!==a&&(w.i(a,"number",jm,"spacing"),this.Jh=a,this.K())});w.g(jm,"nodeDiameterFormula",jm.prototype.Lt);w.defineProperty(jm,{Lt:"nodeDiameterFormula"},function(){return this.Mr},function(a){this.Mr!==a&&(w.za(a,jm,jm,"nodeDiameterFormula"),a===Fm||a===Em)&&(this.Mr=a,this.K())});w.A(jm,{FH:"actualXRadius"},function(){return this.zd});w.A(jm,{GH:"actualYRadius"},function(){return this.sg});
  w.A(jm,{hK:"actualSpacing"},function(){return this.Ek});w.A(jm,{EH:"actualCenter"},function(){return isNaN(this.Gd.x)||isNaN(this.Gd.y)?new x(0,0):new x(this.Gd.x+this.FH,this.Gd.y+this.GH)});var Cm;jm.ConstantSpacing=Cm=w.w(jm,"ConstantSpacing",0);var Bm;jm.ConstantDistance=Bm=w.w(jm,"ConstantDistance",1);var Am;jm.ConstantAngle=Am=w.w(jm,"ConstantAngle",2);var Dm;jm.Packed=Dm=w.w(jm,"Packed",3);var rm;jm.Clockwise=rm=w.w(jm,"Clockwise",4);var zm;
  jm.Counterclockwise=zm=w.w(jm,"Counterclockwise",5);var pm;jm.BidirectionalLeft=pm=w.w(jm,"BidirectionalLeft",6);var qm;jm.BidirectionalRight=qm=w.w(jm,"BidirectionalRight",7);var mm;jm.Forwards=mm=w.w(jm,"Forwards",8);var nm;jm.Reverse=nm=w.w(jm,"Reverse",9);var km;jm.Ascending=km=w.w(jm,"Ascending",10);var lm;jm.Descending=lm=w.w(jm,"Descending",11);var om;jm.Optimized=om=w.w(jm,"Optimized",12);var Fm;jm.Pythagorean=Fm=w.w(jm,"Pythagorean",13);var Em;jm.Circular=Em=w.w(jm,"Circular",14);
  function ip(){this.bp=-Infinity;this.Zp=this.nn=null}ip.prototype.compare=function(a,b){if(0<a&&0>this.bp||Math.abs(a)<Math.abs(this.bp)&&!(0>a&&0<this.bp)){this.bp=a;this.nn=[];this.Zp=[];for(var c=0;c<b.length;c++)this.nn[c]=b[c].kb.x,this.Zp[c]=b[c].kb.y}};ip.prototype.commit=function(a){if(null!==this.nn&&null!==this.Zp)for(var b=0;b<this.nn.length;b++){var c=a.na(b);c.x=this.nn[b];c.y=this.Zp[b]}};function jp(){ta.call(this)}w.Ia(jp,ta);w.ja("CircularNetwork",jp);jp.prototype.createVertex=function(){return new kp};
  jp.prototype.createEdge=function(){return new xp};function kp(){ua.call(this);this.actualAngle=this.diameter=NaN}w.Ia(kp,ua);w.ja("CircularVertex",kp);
  function lp(a,b){var c=a.network;if(null===c)return NaN;c=c.Lb;if(null===c)return NaN;if(c.Ge===Dm)if(c.Lt===Em)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.Lt===Em?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function xp(){va.call(this)}w.Ia(xp,va);w.ja("CircularEdge",xp);
  function yp(){0<arguments.length&&w.$c(yp);Re.call(this);this.rg=null;this.ir=0;this.cg=(new fa(100,100)).freeze();this.iq=!1;this.Hh=!0;this.ph=!1;this.ko=100;this.Fq=1;this.zh=1E3;this.bs=Math;this.Jn=.05;this.In=50;this.Fn=150;this.Hn=0;this.zq=10;this.yq=5}w.Ia(yp,Re);w.ja("ForceDirectedLayout",yp);
  yp.prototype.cloneProtected=function(a){Re.prototype.cloneProtected.call(this,a);a.cg.assign(this.cg);a.iq=this.iq;a.Hh=this.Hh;a.ph=this.ph;a.ko=this.ko;a.Fq=this.Fq;a.zh=this.zh;a.bs=this.bs;a.Jn=this.Jn;a.In=this.In;a.Fn=this.Fn;a.Hn=this.Hn;a.zq=this.zq;a.yq=this.yq};yp.prototype.createNetwork=function(){return new zp};
  yp.prototype.doLayout=function(a){null===a&&w.m("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.lx;if(0<this.network.vertexes.count){this.network.Bw();for(var b=this.network.vertexes.k;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.k;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);
  this.Mz();this.ir=0;if(this.needsClusterLayout()){b=this.network;for(c=b.YJ().k;c.next();){this.network=c.value;for(var d=this.network.vertexes.k;d.next();){var e=d.value;e.Xf=e.vertexes.count;e.gk=1;e.Km=null;e.jh=null}Ap(this,0,a)}this.network=b;c.reset();t&&w.l(b,zp,yp,"arrangeConnectedGraphs:singletons");for(var d=this.kw,g=c.count,h=!0,k=e=0,l=w.lb(),m=0;m<g+b.vertexes.count+2;m++)l[m]=null;g=0;c.reset();for(var n=w.$f();c.next();)if(m=c.value,this.tg(m,n),h)h=!1,e=n.x+n.width/2,k=n.y+n.height/
  2,l[0]=new x(n.x+n.width+d.width,n.y),l[1]=new x(n.x,n.y+n.height+d.height),g=2;else{var p=Bp(l,g,e,k,n.width,n.height,d),q=l[p],r=new x(q.x+n.width+d.width,q.y),s=new x(q.x,q.y+n.height+d.height);p+1<g&&l.splice(p+1,0,null);l[p]=r;l[p+1]=s;g++;p=q.x-n.x;q=q.y-n.y;for(m=m.vertexes.k;m.next();)r=m.value,r.Da+=p,r.Ra+=q}w.nc(n);for(m=b.vertexes.k;m.next();)h=m.value,n=h.kb,2>g?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new x(n.x+n.width+d.width,n.y),l[1]=new x(n.x,n.y+n.height+d.height),g=2):(p=Bp(l,g,
  e,k,n.width,n.height,d),q=l[p],r=new x(q.x+n.width+d.width,q.y),s=new x(q.x,q.y+n.height+d.height),p+1<g&&l.splice(p+1,0,null),l[p]=r,l[p+1]=s,g++,h.Da=q.x+h.width/2,h.Ra=q.y+h.height/2);w.xa(l);for(c.reset();c.next();){d=c.value;for(e=d.vertexes.k;e.next();)b.dl(e.value);for(d=d.edges.k;d.next();)b.Do(d.value)}}Cp(this,a);this.updateParts()}this.ko=a;this.network=null;this.gf=!0};
  yp.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.k;d.next();){if(d.value.kb.zg(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};yp.prototype.tg=function(a,b){for(var c=!0,d=a.vertexes.k;d.next();){var e=d.value;c?(c=!1,b.set(e.kb)):b.$h(e.kb)}return b};
  function Dp(a,b,c){t&&(w.p(b,yp,"computeClusterLayoutIterations:level"),w.p(c,yp,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)}
  function Ap(a,b,c){t&&(w.p(b,yp,"layoutClusters:level"),w.p(c,yp,"layoutClusters:maxiter"));if(Ep(a,b)){var d=a.zh;a.zh*=1+1/(b+1);var e=Fp(a,b),g=Math.max(0,Dp(a,b,c));a.lx+=g;Ap(a,b+1,c);Cp(a,g);Gp(a,e,b);c=a.rg;null===c?c=new D(Hp):c.clear();c.Zd(e.vertexes);c.sort(function(a,b){return null===a||null===b||a===b?0:b.Xf-a.Xf});for(e=c.k;e.next();)Ip(a,e.value,b);a.zh=d}}
  function Ep(a,b){t&&w.p(b,yp,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;null===a.rg?a.rg=new D(Hp):a.rg.clear();a.rg.Zd(a.network.vertexes);var c=a.rg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.Xf-a.Xf});for(var d=c.count-1;0<=d&&1>=c.na(d).Xf;)d--;return 1<c.count-d}
  function Fp(a,b){t&&w.p(b,yp,"pushSubNetwork:level");for(var c=a.network,d=new zp,e=a.rg.k;e.next();){var g=e.value;if(1<g.Xf){d.dl(g);var h=new Jp;h.Qx=g.Xf;h.Tx=g.width;h.Px=g.height;h.xB=g.O.x;h.yB=g.O.y;null===g.jh&&(g.jh=new D(Jp));g.jh.add(h);g.aB=g.jh.count-1}else break}for(var k=c.edges.k;k.next();)if(e=k.value,e.fromVertex.network===d&&e.toVertex.network===d)d.Do(e);else if(e.fromVertex.network===d){var l=e.fromVertex.Km;null===l&&(l=new D(Hp),e.fromVertex.Km=l);l.add(e.toVertex);e.fromVertex.Xf--;
  e.fromVertex.gk+=e.toVertex.gk}else e.toVertex.network===d&&(l=e.toVertex.Km,null===l&&(l=new D(Hp),e.toVertex.Km=l),l.add(e.fromVertex),e.toVertex.Xf--,e.toVertex.gk+=e.fromVertex.gk);for(e=d.edges.k;e.next();)g=e.value,g.length*=Math.max(1,J.sqrt((g.fromVertex.gk+g.toVertex.gk)/(4*b+1)));for(e=d.vertexes.k;e.next();)if(g=e.value,l=g.Km,null!==l&&0<l.count&&(h=g.jh.na(g.jh.count-1),h=h.Qx-g.Xf,!(0>=h))){for(var m=0,n=0,p=l.count-h;p<l.count;p++){for(var q=l.na(p),r=null,k=q.edges.k;k.next();){var s=
  k.value;if(s.MI(q)===g){r=s;break}}null!==r&&(n+=r.length,m+=q.width*q.height)}l=g.Da;k=g.Ra;p=g.width;q=g.height;r=g.O;s=p*q;1>s&&(s=1);m=J.sqrt((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;g.kb=new y(l-r.x-h,k-r.y-m,p+2*h,q+2*m);g.focus=new x(r.x+h,r.y+m)}a.network=d;return c}
  function Gp(a,b,c){t&&(w.l(b,zp,yp,"popNetwork:oldnet"),w.p(c,yp,"popNetwork:level"));for(c=a.network.vertexes.k;c.next();){var d=c.value;d.network=b;if(null!==d.jh){var e=d.jh.na(d.aB);d.Xf=e.Qx;var g=e.xB,h=e.yB;d.kb=new y(d.Da-g,d.Ra-h,e.Tx,e.Px);d.focus=new x(g,h);d.aB--}}for(c=a.network.edges.k;c.next();)c.value.network=b;a.network=b}
  function Ip(a,b,c){t&&(w.l(b,Hp,yp,"surroundNode:oldnet"),w.p(c,yp,"surroundNode:level"));var d=b.Km;if(null!==d&&0!==d.count){c=b.Da;var e=b.Ra,g=b.width,h=b.height;null!==b.jh&&0<b.jh.count&&(h=b.jh.na(0),g=h.Tx,h=h.Px);for(var g=J.sqrt(g*g+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.k;n.next();){var p=n.value;1>=p.Xf?l++:(k=!0,m++,h+=Math.atan2(b.Ra-p.Ra,b.Da-p.Da))}if(0!==l)for(0<m&&(h/=m),m=b=0,b=k?2*Math.PI/(l+1):2*Math.PI/l,0===l%2&&(m=b/2),1<d.count&&d.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,d=d.k;d.next();)if(l=d.value,!(1<l.Xf||a.isFixed(l))){n=null;for(p=l.edges.k;p.next();){n=p.value;break}var p=l.width,q=l.height,p=J.sqrt(p*p+q*q)/2,n=g+n.length+p,p=h+(b*(k/2>>1)+m)*(0===k%2?1:-1);l.Da=c+n*Math.cos(p);l.Ra=e+n*Math.sin(p);k++}}}
  function Bp(a,b,c,d,e,g,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<g+h.height)continue a;l=m;k=p}}return l}yp.prototype.Mz=function(){if(this.comments)for(var a=this.network.vertexes.k;a.next();)this.addComments(a.value)};
  yp.prototype.addComments=function(a){var b=a.Cc;if(null!==b)for(b=b.HE();b.next();){var c=b.value;if("Comment"===c.Gc&&c.Ja()){var d=this.network.Sm(c);null===d&&(d=this.network.Ts(c));d.charge=this.sE;for(var c=null,e=d.fc;e.next();){var g=e.value;if(g.toVertex===a){c=g;break}}if(null===c)for(e=d.rc;e.next();)if(g=e.value,g.fromVertex===a){c=g;break}null===c&&(c=this.network.vp(a,d,null));c.length=this.tE}}};
  function Kp(a,b){t&&(w.l(a,Hp,yp,"getNodeDistance:vertexA"),w.l(b,Hp,yp,"getNodeDistance:vertexB"));var c=a.ca,d=c.x,e=c.y,g=c.width,c=c.height,h=b.ca,k=h.x,l=h.y,m=h.width,h=h.height;return d+g<k?e>l+h?(d=d+g-k,e=e-l-h,J.sqrt(d*d+e*e)):e+c<l?(d=d+g-k,e=e+c-l,J.sqrt(d*d+e*e)):k-(d+g):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,J.sqrt(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,J.sqrt(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):.1}
  function Cp(a,b){t&&w.p(b,yp,"performIterations:num");a.rg=null;for(var c=a.ir+b;a.ir<c&&(a.ir++,Lp(a)););a.rg=null}
  function Lp(a){null===a.rg&&(a.rg=new D(Hp),a.rg.Zd(a.network.vertexes));var b=a.rg.q;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.Da,e=d,g=c.Ra,h=g,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.Da,k=k.Ra,d=Math.min(d,l),e=Math.max(e,l),g=Math.min(g,k),h=Math.max(h,k)}(g=e-d>h-g)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.Da-b.Da}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.Ra-b.Ra});for(var h=a.zh,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
  b[c],l=k.ca,q=k.O,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.ca,n=e.O,p=r.x+n.x,r=r.y+n.y;if(d-p>h||p-d>h){if(g)break}else if(l-r>h||r-l>h){if(!g)break}else{var s=Kp(k,e);1>s?(n=a.Qt,null===n&&(a.Qt=n=new za(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.ca.right-k.ca.x),n=(1+n)*m):d<p?(n=Math.abs(e.ca.x-
  k.ca.right),n=-(1+n)*m):(n=Math.max(e.width,k.width),n=(1+n)*m-n/2),l>r?(p=Math.abs(e.ca.bottom-k.ca.y),p=(1+p)*s):d<p?(p=Math.abs(e.ca.y-k.ca.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.k;c.next();)g=c.value,k=g.fromVertex,e=g.toVertex,l=k.ca,q=k.O,d=l.x+q.x,l=l.y+q.y,r=e.ca,n=e.O,p=r.x+n.x,r=r.y+n.y,s=Kp(k,e),1>s?(n=a.Qt,null===n&&(a.Qt=n=new za(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=g.stiffness*(s-g.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.zh/20,50);for(e=0;e<b.length;e++)k=b[e],a.isFixed(k)?a.moveFixedVertex(k):(g=k.forceX,h=k.forceY,g<-d?g=-d:g>d&&(g=d),h<-d?h=-d:h>d&&(h=d),k.Da+=g,k.Ra+=h,c=Math.max(c,g*g+h*h));return c>a.Zz*a.Zz}yp.prototype.moveFixedVertex=function(){};
  yp.prototype.commitLayout=function(){this.iB();this.commitNodes();this.Bt&&this.commitLinks()};yp.prototype.iB=function(){if(this.Dl)for(var a=this.network.edges.k;a.next();){var b=a.value.link;null!==b&&(b.wb=zc,b.yb=zc)}};yp.prototype.commitNodes=function(){var a=0,b=0;if(this.RD){var c=w.$f();this.tg(this.network,c);b=this.Gd;a=b.x-c.x;b=b.y-c.y;w.nc(c)}for(var c=w.$f(),d=this.network.vertexes.k;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()}w.nc(c)};
  yp.prototype.commitLinks=function(){for(var a=this.network.edges.k;a.next();)a.value.commit()};yp.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Jn:a};yp.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.In:a};yp.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Fn:a};yp.prototype.electricalFieldX=function(){return 0};yp.prototype.electricalFieldY=function(){return 0};
  yp.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Hn:a};yp.prototype.gravitationalFieldX=function(){return 0};yp.prototype.gravitationalFieldY=function(){return 0};yp.prototype.isFixed=function(a){return a.isFixed};w.A(yp,{kK:"currentIteration"},function(){return this.ir});w.g(yp,"arrangementSpacing",yp.prototype.kw);w.defineProperty(yp,{kw:"arrangementSpacing"},function(){return this.cg},function(a){w.l(a,fa,yp,"arrangementSpacing");this.cg.L(a)||(this.cg.assign(a),this.K())});
  w.g(yp,"arrangesToOrigin",yp.prototype.RD);w.defineProperty(yp,{RD:"arrangesToOrigin"},function(){return this.iq},function(a){this.iq!==a&&(w.i(a,"boolean",yp,"arrangesToOrigin"),this.iq=a,this.K())});w.g(yp,"setsPortSpots",yp.prototype.Dl);w.defineProperty(yp,{Dl:"setsPortSpots"},function(){return this.Hh},function(a){this.Hh!==a&&(w.i(a,"boolean",yp,"setsPortSpots"),this.Hh=a,this.K())});w.g(yp,"comments",yp.prototype.comments);
  w.defineProperty(yp,{comments:"comments"},function(){return this.ph},function(a){this.ph!==a&&(w.i(a,"boolean",yp,"comments"),this.ph=a,this.K())});w.g(yp,"maxIterations",yp.prototype.lx);w.defineProperty(yp,{lx:"maxIterations"},function(){return this.ko},function(a){this.ko!==a&&(w.i(a,"number",yp,"maxIterations"),0<=a&&(this.ko=a,this.K()))});w.g(yp,"epsilonDistance",yp.prototype.Zz);
  w.defineProperty(yp,{Zz:"epsilonDistance"},function(){return this.Fq},function(a){this.Fq!==a&&(w.i(a,"number",yp,"epsilonDistance"),0<a&&(this.Fq=a,this.K()))});w.g(yp,"infinityDistance",yp.prototype.UI);w.defineProperty(yp,{UI:"infinityDistance"},function(){return this.zh},function(a){this.zh!==a&&(w.i(a,"number",yp,"infinityDistance"),1<a&&(this.zh=a,this.K()))});w.g(yp,"randomNumberGenerator",yp.prototype.Qt);
  w.defineProperty(yp,{Qt:"randomNumberGenerator"},function(){return this.bs},function(a){this.bs!==a&&(null!==a&&"function"!==typeof a.random&&w.m('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.bs=a)});w.g(yp,"defaultSpringStiffness",yp.prototype.zI);w.defineProperty(yp,{zI:"defaultSpringStiffness"},function(){return this.Jn},function(a){this.Jn!==a&&(w.i(a,"number",yp,"defaultSpringStiffness"),this.Jn=a,this.K())});w.g(yp,"defaultSpringLength",yp.prototype.yI);
  w.defineProperty(yp,{yI:"defaultSpringLength"},function(){return this.In},function(a){this.In!==a&&(w.i(a,"number",yp,"defaultSpringLength"),this.In=a,this.K())});w.g(yp,"defaultElectricalCharge",yp.prototype.sI);w.defineProperty(yp,{sI:"defaultElectricalCharge"},function(){return this.Fn},function(a){this.Fn!==a&&(w.i(a,"number",yp,"defaultElectricalCharge"),this.Fn=a,this.K())});w.g(yp,"defaultGravitationalMass",yp.prototype.tI);
  w.defineProperty(yp,{tI:"defaultGravitationalMass"},function(){return this.Hn},function(a){this.Hn!==a&&(w.i(a,"number",yp,"defaultGravitationalMass"),this.Hn=a,this.K())});w.g(yp,"defaultCommentSpringLength",yp.prototype.tE);w.defineProperty(yp,{tE:"defaultCommentSpringLength"},function(){return this.zq},function(a){this.zq!==a&&(w.i(a,"number",yp,"defaultCommentSpringLength"),this.zq=a,this.K())});w.g(yp,"defaultCommentElectricalCharge",yp.prototype.sE);
  w.defineProperty(yp,{sE:"defaultCommentElectricalCharge"},function(){return this.yq},function(a){this.yq!==a&&(w.i(a,"number",yp,"defaultCommentElectricalCharge"),this.yq=a,this.K())});function Jp(){this.yB=this.xB=this.Px=this.Tx=this.Qx=0}function zp(){ta.call(this)}w.Ia(zp,ta);w.ja("ForceDirectedNetwork",zp);zp.prototype.createVertex=function(){return new Hp};zp.prototype.createEdge=function(){return new Mp};
  function Hp(){ua.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.gk=this.Xf=this.forceY=this.forceX=0;this.jh=this.Km=null;this.aB=0}w.Ia(Hp,ua);w.ja("ForceDirectedVertex",Hp);function Mp(){va.call(this);this.length=this.stiffness=NaN}w.Ia(Mp,va);w.ja("ForceDirectedEdge",Mp);
  function Z(){0<arguments.length&&w.$c(Z);Re.call(this);this.yd=this.em=25;this.ta=0;this.En=Sp;this.jo=Wp;this.Yn=Xp;this.bm=4;this.tn=Yp;this.wi=Zp;this.Hh=!0;this.qj=4;this.Kb=this.pv=this.ob=-1;this.Jf=this.Ar=0;this.Ob=this.If=this.ig=this.Xg=this.Rd=null;this.Hr=0;this.Gr=this.hm=null;this.lg=0;this.Ir=null;this.Zg=[];this.Zg.length=100}w.Ia(Z,Re);w.ja("LayeredDigraphLayout",Z);
  Z.prototype.cloneProtected=function(a){Re.prototype.cloneProtected.call(this,a);a.em=this.em;a.yd=this.yd;a.ta=this.ta;a.En=this.En;a.jo=this.jo;a.Yn=this.Yn;a.bm=this.bm;a.tn=this.tn;a.wi=this.wi;a.Hh=this.Hh;a.qj=this.qj};Z.prototype.createNetwork=function(){return new $p};
  Z.prototype.doLayout=function(a){null===a&&w.m("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.Gd=this.initialOrigin(this.Gd);this.pv=-1;this.Jf=this.Ar=0;this.Ir=this.Gr=this.hm=null;for(a=0;a<this.Zg.length;a++)this.Zg[a]=null;if(0<this.network.vertexes.count){this.network.Bw();for(a=this.network.edges.k;a.next();)a.value.rev=!1;switch(this.En){default:case aq:var b=0,c=this.network.vertexes.count-
  1;a=[];a.length=c+1;for(var d=this.network.vertexes.k;d.next();)d.value.valid=!0;for(;null!==bq(this.network);){for(d=cq(this.network);null!==d;)a[c]=d,c--,d.valid=!1,d=cq(this.network);for(d=dq(this.network);null!==d;)a[b]=d,b++,d.valid=!1,d=dq(this.network);for(var d=null,e=0,g=this.network.vertexes.k;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.fc;l.next();)l.value.toVertex.valid&&k++;for(var l=0,m=h.rc;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.k;a.next();)b=a.value,b.fromVertex.index>b.toVertex.index&&(this.network.vx(b),b.rev=!0);break;case Sp:for(b=this.network.vertexes.k;b.next();)a=b.value,a.So=-1,a.finish=-1;for(a=this.network.edges.k;a.next();)a.value.forest=!1;this.Hr=0;for(b.reset();b.next();)c=b.value,0===c.rc.count&&eq(this,c);for(b.reset();b.next();)c=b.value,-1===c.So&&eq(this,c);for(a.reset();a.next();)b=a.value,b.forest||(c=b.fromVertex,
  d=c.finish,e=b.toVertex,g=e.finish,e.So<c.So&&d<g&&(this.network.vx(b),b.rev=!0))}for(a=this.network.vertexes.k;a.next();)a.value.layer=-1;this.ob=-1;this.assignLayers();for(a.reset();a.next();)this.ob=Math.max(this.ob,a.value.layer);a=[];for(c=this.network.edges.k;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.od&&null!==b.toVertex.od||b.fromVertex.layer!==b.toVertex.layer)){l=h=k=g=0;e=b.fromVertex;d=b.toVertex;if(null!==b.link){k=b.link;
  if(null===k)continue;var n=e.od,g=d.od;if(null===n||null===g)continue;var p=k.Z,h=k.da,q=k.vd,l=k.le;b.rev&&(k=p,m=q,p=h,q=l,h=k,l=m);var r=e.O,k=b.toVertex.O,s=b.rev?d.ca:e.ca,m=w.M();s.J()?(Rn(p,q,Ob,m),m.J()||m.assign(r)):m.assign(r);n!==p&&s.J()&&p.Ja()&&(n=e.ca,n.J()&&(m.x+=s.x-n.x,m.y+=s.y-n.y));p=b.rev?e.ca:d.ca;n=w.M();p.J()?(Rn(h,l,Ob,n),n.J()||n.assign(k)):n.assign(k);g!==h&&p.J()&&h.Ja()&&(g=d.ca,g.J()&&(n.x+=p.x-g.x,n.y+=p.y-g.y));90===this.ta||270===this.ta?(g=Math.round((m.x-r.x)/this.yd),
  h=m.x,k=Math.round((n.x-k.x)/this.yd),l=n.x):(g=Math.round((m.y-r.y)/this.yd),h=m.y,k=Math.round((n.y-k.y)/this.yd),l=n.y);w.B(m);w.B(n);b.portFromColOffset=g;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 u=s.vd,v=s.le;if(null!==u&&null!==v){var A=s.Z,q=s.da;if(null!==A&&null!==q){var E=u.wb,B=v.yb;this.Dl||(s.wb.Pc()||(E=s.wb),s.yb.Pc()||(B=s.yb));if(E.Pc()||E===
  yb)E=fq(this,!0);if(B.Pc()||B===yb)B=fq(this,!1);var G=s.gc,O=s.getLinkPoint(A,u,E,!0,G,q,v,w.M()),E=s.getLinkDirection(A,u,O,E,!0,G,q,v);w.B(O);E===gq(this,n,!0)?p+=1:this.Dl&&null!==A&&1===A.ports.count&&n.rev&&(p+=1);O=s.getLinkPoint(q,v,B,!1,G,A,u,w.M());s=s.getLinkDirection(q,v,O,B,!1,G,A,u);w.B(O);s===gq(this,n,!1)?p+=2:this.Dl&&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.od=null,q.Em=1,q.layer=m,q.near=e,this.network.dl(q),
  e=this.network.vp(e,q,b.link),e.valid=!1,e.rev=b.rev,e.portFromColOffset=g,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.od=null;q.Em=2;q.layer=m-1;this.network.dl(q);e=this.network.vp(e,q,b.link);e.valid=!0;e.rev=b.rev;e.portFromColOffset=p?0:g;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.od=null,q.Em=3,q.layer=m-1,this.network.dl(q),e=this.network.vp(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.vp(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.Rd=[];for(c=0;c<=this.ob;c++)b[c]=0;for(a=this.network.vertexes.k;a.next();)c=a.value,c.index=-1;this.initializeIndices();this.pv=-1;for(c=this.Jf=this.Ar=0;c<=this.ob;c++)b[c]>b[this.Jf]&&(this.pv=b[c]-1,this.Jf=c),b[c]<b[this.Ar]&&
  (this.Ar=c);this.Ir=[];for(c=0;c<b.length;c++)this.Ir[c]=[];for(a.reset();a.next();)b=a.value,c=this.Ir[b.layer],c[b.index]=b;this.Kb=-1;for(a=0;a<=this.ob;a++){b=hq(this,a);c=0;d=this.Rd[a];for(e=0;e<d;e++)g=b[e],c+=this.nodeMinColumnSpace(g,!0),g.column=c,c+=1,c+=this.nodeMinColumnSpace(g,!1);this.Kb=Math.max(this.Kb,c-1);iq(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.gf=!0};
  Z.prototype.linkMinLength=function(a){var b=a.toVertex,c=0;for(a=a.fromVertex.fc;a.next();)a.value.toVertex===b&&c++;return 1<c?2:1};function jq(a){var b=a.fromVertex.od;a=a.toVertex.od;return null===b&&null===a?8:null===b||null===a?4:1}Z.prototype.nodeMinLayerSpace=function(a,b){return null===a.od?0:90===this.ta||270===this.ta?b?a.O.y+10:a.ca.height-a.O.y+10:b?a.O.x+10:a.ca.width-a.O.x+10};
  Z.prototype.nodeMinColumnSpace=function(a,b){if(null===a.od)return 0;var c=b?a.HA:a.GA;if(null!==c)return c;c=this.ta;return 90===c||270===c?b?a.HA=a.O.x/this.yd+1|0:a.GA=(a.ca.width-a.O.x)/this.yd+1|0:b?a.HA=a.O.y/this.yd+1|0:a.GA=(a.ca.height-a.O.y)/this.yd+1|0};function kq(a){null===a.hm&&(a.hm=[]);for(var b=0,c=a.network.vertexes.k;c.next();){var d=c.value;a.hm[b]=d.layer;b++;a.hm[b]=d.column;b++;a.hm[b]=d.index;b++}return a.hm}
  function lq(a,b){for(var c=0,d=a.network.vertexes.k;d.next();){var e=d.value;e.layer=b[c];c++;e.column=b[c];c++;e.index=b[c];c++}}
  function mq(a,b,c){t&&(w.p(b,Z,"crossingMatrix:unfixedLayer"),w.p(c,Z,"crossingMatrix:direction"));var d=hq(a,b),e=a.Rd[b];if(null===a.Gr||a.Gr.length<e*e)a.Gr=[];for(var g=a.Gr,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.Em===m.Em||k++;else for(p=h-1;p>n;p--)l=d[p],l.near===m&&l.Em===m.Em||k++;var m=0,q,r=q=p=l=0,s,u=0,v=0;s=0;var A;if(0<=c)for(n=d[h].Te,m=0;m<n.count;m++)if(q=n.q[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.q[r],s.valid&&s.fromVertex.layer!==b&&(u=s.fromVertex.index,v=s.portToPos,s=s.portFromPos,p<v&&(l>u||l===u&&q>s)&&k++,v<p&&(u>l||u===l&&s>q)&&k++);if(0>=c)for(n=d[h].Me,m=0;m<n.count;m++)if(q=n.q[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.q[r],s.valid&&s.toVertex.layer!==b&&(u=s.toVertex.index,v=s.portToPos,s=s.portFromPos,q<s&&(l>u||l===u&&p>v)&&k++,
  s<q&&(u>l||u===l&&v>p)&&k++);g[h*e+h]=k;for(n=h+1;n<e;n++){var E=0,B=0;if(0<=c)for(k=d[h].Te,A=d[n].Te,m=0;m<k.count;m++)if(q=k.q[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,q=q.portFromPos,r=0;r<A.count;r++)s=A.q[r],s.valid&&s.fromVertex.layer!==b&&(u=s.fromVertex.index,s=s.portFromPos,(l<u||l===u&&q<s)&&B++,(u<l||u===l&&s<q)&&E++);if(0>=c)for(k=d[h].Me,A=d[n].Me,m=0;m<k.count;m++)if(q=k.q[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,r=0;r<A.count;r++)s=A.q[r],
  s.valid&&s.toVertex.layer!==b&&(u=s.toVertex.index,v=s.portToPos,(l<u||l===u&&p<v)&&B++,(u<l||u===l&&v<p)&&E++);g[h*e+n]=E;g[n*e+h]=B}}iq(a,b,d);return g}Z.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.ob;b++)for(var c=mq(this,b,1),d=this.Rd[b],e=0;e<d;e++)for(var g=e;g<d;g++)a+=c[e*d+g];return a};
  function nq(a){for(var b=0,c=0;c<=a.ob;c++){for(var d=a,e=c,g=hq(d,e),h=d.Rd[e],k=0,l=0;l<h;l++){var m=null,m=g[l].Me,n,p=0,q=0;if(null!==m)for(var r=0;r<m.count;r++)n=m.q[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)*jq(n))}iq(d,e,g);b+=k}return b}
  Z.prototype.normalize=function(){var a=Infinity;this.Kb=-1;for(var b=this.network.vertexes.k;b.next();){var c=b.value,a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Kb=Math.max(this.Kb,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Kb-=a};
  function oq(a,b,c){t&&(w.p(b,Z,"barycenters:unfixedLayer"),w.p(c,Z,"barycenters:direction"));for(var d=hq(a,b),e=a.Rd[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Te);var m=null;0<=c&&(m=k.Me);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.q[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.q[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column+k.portToColOffset,
  p++);g[h]=0===p?-1:n/p}iq(a,b,d);return g}
  function pq(a,b,c){t&&(w.p(b,Z,"medians:unfixedLayer"),w.p(c,Z,"medians:direction"));for(var d=hq(a,b),e=a.Rd[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Te);var m=null;0<=c&&(m=k.Me);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.q[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.q[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(p[n]=q.column+k.portToColOffset,
  n++);0===n?g[h]=-1:(p.sort(function(a,b){return a-b}),m=n>>1,g[h]=n&1?p[m]:p[m-1]+p[m]>>1)}iq(a,b,d);return g}function qq(a,b,c,d,e,g){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.fc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&qq(a,m,c,d,e,g)}if(g)for(l=b.rc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&qq(a,m,c,d,e,g)}}
  function rq(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.fc;h.next();)rq(a,h.value.toVertex,c,d,e,g);if(g)for(b=b.rc;b.next();)rq(a,b.value.fromVertex,c,d,e,g)}}function bq(a){for(a=a.vertexes.k;a.next();){var b=a.value;if(b.valid)return b}return null}function cq(a){for(a=a.vertexes.k;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.fc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
  function dq(a){for(a=a.vertexes.k;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.rc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function eq(a,b){b.So=a.Hr;a.Hr++;for(var c=b.fc;c.next();){var d=c.value,e=d.toVertex;-1===e.So&&(d.forest=!0,eq(a,e))}b.finish=a.Hr;a.Hr++}
  Z.prototype.assignLayers=function(){switch(this.jo){case sq:tq(this);break;case uq:for(var a=0,b=this.network.vertexes.k;b.next();)a=vq(this,b.value),this.ob=Math.max(a,this.ob);for(b.reset();b.next();)a=b.value,a.layer=this.ob-a.layer;break;default:case Wp:tq(this);for(b=this.network.vertexes.k;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.rc.count&&wq(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.ob=-1;for(b.reset();b.next();){var c=b.value;c.layer-=
  a;this.ob=Math.max(this.ob,c.layer)}}};function tq(a){for(var b=a.network.vertexes.k;b.next();){var c=xq(a,b.value);a.ob=Math.max(c,a.ob)}}function xq(a,b){var c=0;if(-1===b.layer){for(var d=b.fc;d.next();)var e=d.value,g=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,xq(a,g)+e);b.layer=c}else c=b.layer;return c}function vq(a,b){var c=0;if(-1===b.layer){for(var d=b.rc;d.next();)var e=d.value,g=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,vq(a,g)+e);b.layer=c}else c=b.layer;return c}
  function wq(a,b){if(!b.valid){b.valid=!0;for(var c=b.fc;c.next();)wq(a,c.value.toVertex);for(c=a.network.vertexes.k;c.next();)c.value.component=-1;for(var d=b.Te.q,e=d.length,g=0;g<e;g++){var h=d[g],k=a.linkMinLength(h);h.fromVertex.layer-h.toVertex.layer>k&&qq(a,h.fromVertex,0,-1,!0,!1)}for(qq(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.k;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Te.q,e=s.length,g=0;g<e;g++){var h=s[g],u=h.fromVertex,
  q=q+1;1!==u.component&&(k+=1,u=u.layer-p.layer,h=a.linkMinLength(h),d=Math.min(d,u-h))}h=p.Me.q;e=h.length;for(g=0;g<e;g++)s=h[g].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.k;c.next();)c.value.component=-1;for(qq(a,b,1,-1,!0,!1);0!==b.component;){g=0;e=Infinity;d=0;k=null;for(l=a.network.vertexes.k;l.next();)if(m=l.value,1===m.component){n=
  0;p=!1;h=m.Te.q;q=h.length;for(r=0;r<q;r++)s=h[r].fromVertex,n+=1,1!==s.component?g+=1:p=!0;h=m.Me.q;q=h.length;for(r=0;r<q;r++)s=h[r],u=s.toVertex,n-=1,1!==u.component&&(g-=1,u=m.layer-u.layer,s=a.linkMinLength(s),e=Math.min(e,u-s));(null===k||n>d)&&!p&&(k=m,d=n)}if(0>g){for(c.reset();c.next();)g=c.value,1===g.component&&(g.layer-=e);b.component=0}else k.component=0}}}
  function gq(a,b,c){return 90===a.ta?c&&!b.rev||!c&&b.rev?270:90:180===a.ta?c&&!b.rev||!c&&b.rev?0:180:270===a.ta?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
  Z.prototype.initializeIndices=function(){switch(this.Yn){default:case yq:for(var a=this.network.vertexes.k;a.next();){var b=a.value,c=b.layer;b.index=this.Rd[c];this.Rd[c]++}break;case Xp:a=this.network.vertexes.k;for(b=this.ob;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&zq(this,c);break;case Aq:for(a=this.network.vertexes.k,b=0;b<=this.ob;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Bq(this,c)}};
  function zq(a,b){var c=b.layer;b.index=a.Rd[c];a.Rd[c]++;for(var c=b.Me.Ue(),d=!0;d;)for(var d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portFromColOffset>h.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.toVertex,-1===d.index&&zq(a,d))}
  function Bq(a,b){var c=b.layer;b.index=a.Rd[c];a.Rd[c]++;for(var c=b.Te.Ue(),d=!0,e=0;d;)for(d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portToColOffset>h.portToColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.fromVertex,-1===d.index&&Bq(a,d))}
  Z.prototype.reduceCrossings=function(){for(var a=this.countCrossings(),b=kq(this),c=0,d=0,e=0,c=0;c<this.bm;c++){for(d=0;d<=this.ob;d++)Cq(this,d,1),Dq(this,d,1);e=this.countCrossings();e<a&&(a=e,b=kq(this));for(d=this.ob;0<=d;d--)Cq(this,d,-1),Dq(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=kq(this))}lq(this,b);for(c=0;c<this.bm;c++){for(d=0;d<=this.ob;d++)Cq(this,d,0),Dq(this,d,0);e=this.countCrossings();e<a&&(a=e,b=kq(this));for(d=this.ob;0<=d;d--)Cq(this,d,0),Dq(this,d,0);e=this.countCrossings();
  e<a&&(a=e,b=kq(this))}lq(this,b);var g=!1,h=c=0,k=0,d=0;switch(this.tn){case Eq:break;case Fq:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.ob;0<=c;c--)for(h=0;h<=c;h++){for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Dq(this,d,-1)||g;e=this.countCrossings();e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Dq(this,d,1)||g;e=this.countCrossings();e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Dq(this,d,1)||g;e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,
  d=h;d<=c;d++)g=Dq(this,d,-1)||g;e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Dq(this,d,0)||g;e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Dq(this,d,0)||g;e>=a?lq(this,b):(a=e,b=kq(this))}break;default:case Yp:for(c=this.ob,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Dq(this,d,-1)||g;e=this.countCrossings();e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Dq(this,d,1)||g;e=this.countCrossings();
  e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Dq(this,d,1)||g;e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Dq(this,d,-1)||g;e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Dq(this,d,0)||g;e>=a?lq(this,b):(a=e,b=kq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Dq(this,d,0)||g;e>=a?lq(this,b):(a=e,b=kq(this))}}lq(this,b)};
  function Cq(a,b,c){t&&(w.p(b,Z,"medianBarycenterCrossingReduction:unfixedLayer"),w.p(c,Z,"medianBarycenterCrossingReduction:direction"));var d=0,e=hq(a,b),g=a.Rd[b],h=pq(a,b,c);c=oq(a,b,c);for(d=0;d<g;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<g-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<g;d++)l=e[d],l.index=d,h+=a.nodeMinColumnSpace(l,!0),
  l.column=h,h+=1,h+=a.nodeMinColumnSpace(l,!1);iq(a,b,e)}
  function Dq(a,b,c){var d=hq(a,b),e=a.Rd[b];c=mq(a,b,c);var g=0,h;h=[];for(g=0;g<e;g++)h[g]=-1;var k;k=[];for(g=0;g<e;g++)k[g]=-1;for(var l=!1,m=!0;m;)for(m=!1,g=0;g<e-1;g++){var n=c[d[g].index*e+d[g+1].index],p=c[d[g+1].index*e+d[g].index],q=0,r=0,s=d[g].column,u=d[g+1].column,v=a.nodeMinColumnSpace(d[g],!0),A=a.nodeMinColumnSpace(d[g],!1),E=a.nodeMinColumnSpace(d[g+1],!0),B=a.nodeMinColumnSpace(d[g+1],!1),v=s-v+E,A=u-A+B,E=E=0,G=d[g].rc.k;for(G.reset();G.next();)if(B=G.value,B.valid&&B.fromVertex.layer===
  b){B=B.fromVertex;for(E=0;d[E]!==B;)E++;E<g&&(q+=2*(g-E),r+=2*(g+1-E));E===g+1&&(q+=1);E>g+1&&(q+=4*(E-g),r+=4*(E-(g+1)))}G=d[g].fc.k;for(G.reset();G.next();)if(B=G.value,B.valid&&B.toVertex.layer===b){B=B.toVertex;for(E=0;d[E]!==B;)E++;E===g+1&&(r+=1)}G=d[g+1].rc.k;for(G.reset();G.next();)if(B=G.value,B.valid&&B.fromVertex.layer===b){B=B.fromVertex;for(E=0;d[E]!==B;)E++;E<g&&(q+=2*(g+1-E),r+=2*(g-E));E===g&&(r+=1);E>g+1&&(q+=4*(E-(g+1)),r+=4*(E-g))}G=d[g+1].fc.k;for(G.reset();G.next();)if(B=G.value,
  B.valid&&B.toVertex.layer===b){B=B.toVertex;for(E=0;d[E]!==B;)E++;E===g&&(q+=1)}var E=B=0,G=h[d[g].index],O=k[d[g].index],M=h[d[g+1].index],X=k[d[g+1].index];-1!==G&&(B+=Math.abs(G-s),E+=Math.abs(G-A));-1!==O&&(B+=Math.abs(O-s),E+=Math.abs(O-A));-1!==M&&(B+=Math.abs(M-u),E+=Math.abs(M-v));-1!==X&&(B+=Math.abs(X-u),E+=Math.abs(X-v));if(r<q-.5||r===q&&p<n-.5||r===q&&p===n&&E<B-.5)m=l=!0,d[g].column=A,d[g+1].column=v,n=d[g],d[g]=d[g+1],d[g+1]=n}for(g=0;g<e;g++)d[g].index=g;iq(a,b,d);return l}
  Z.prototype.straightenAndPack=function(){var a=0,b=!1,c=0!==(this.wi&Gq),a=this.wi===Zp;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=a=0;a<=this.ob;a++)b[a]=0;for(var d=0,e=this.network.vertexes.k;e.next();){var g=e.value,a=g.layer,d=g.column,g=this.nodeMinColumnSpace(g,!1);b[a]=Math.max(b[a],d+g)}for(e.reset();e.next();)g=e.value,a=g.layer,d=g.column,g.column=(8*(this.Kb-b[a])>>1)+8*d;this.Kb*=8}if(0!==(this.wi&Hq))for(b=!0;b;){b=!1;for(a=this.Jf+1;a<=this.ob;a++)b=Iq(this,a,1)||b;for(a=
  this.Jf-1;0<=a;a--)b=Iq(this,a,-1)||b;b=Iq(this,this.Jf,0)||b}if(0!==(this.wi&Jq)){for(a=this.Jf+1;a<=this.ob;a++)Kq(this,a,1);for(a=this.Jf-1;0<=a;a--)Kq(this,a,-1);Kq(this,this.Jf,0)}c&&(Lq(this,-1),Lq(this,1));if(0!==(this.wi&Hq))for(b=!0;b;){b=!1;b=Iq(this,this.Jf,0)||b;for(a=this.Jf+1;a<=this.ob;a++)b=Iq(this,a,0)||b;for(a=this.Jf-1;0<=a;a--)b=Iq(this,a,0)||b}};
  function Iq(a,b,c){t&&(w.p(b,Z,"bendStraighten:unfixedLayer"),w.p(c,Z,"bendStraighten:direction"));for(var d=!1;Mq(a,b,c);)d=!0;return d}
  function Mq(a,b,c){t&&(w.p(b,Z,"shiftbendStraighten:unfixedLayer"),w.p(c,Z,"shiftbendStraighten:direction"));var d=0,e=hq(a,b),g=a.Rd[b],h=oq(a,b,-1);if(0<c)for(d=0;d<g;d++)h[d]=-1;var k=oq(a,b,1);if(0>c)for(d=0;d<g;d++)k[d]=-1;for(var l=!1,m=!0;m;)for(m=!1,d=0;d<g;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>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=0,
  u=0,v=0,A=0,E=0;if(0>=c)for(var B=e[d].rc.k;B.next();){var G=B.value;G.valid&&G.fromVertex.layer!==b&&(v=jq(G),A=G.portFromColOffset,E=G.portToColOffset,G=G.fromVertex.column,q+=(Math.abs(n+E-(G+A))+1)*v,s+=(Math.abs(r+E-(G+A))+1)*v,u+=(Math.abs(p+E-(G+A))+1)*v)}if(0<=c)for(B=e[d].fc.k;B.next();)G=B.value,G.valid&&G.toVertex.layer!==b&&(v=jq(G),A=G.portFromColOffset,E=G.portToColOffset,G=G.toVertex.column,q+=(Math.abs(n+A-(G+E))+1)*v,s+=(Math.abs(r+A-(G+E))+1)*v,u+=(Math.abs(p+A-(G+E))+1)*v);E=A=
  v=0;B=h[e[d].index];G=k[e[d].index];-1!==B&&(v+=Math.abs(B-n),A+=Math.abs(B-r),E+=Math.abs(B-p));-1!==G&&(v+=Math.abs(G-n),A+=Math.abs(G-r),E+=Math.abs(G-p));if(s<q||s===q&&A<v)m=l=!0,e[d].column=r;if(u<q||u===q&&E<v)m=l=!0,e[d].column=p}iq(a,b,e);a.normalize();return l}
  function Kq(a,b,c){t&&(w.p(b,Z,"medianStraighten:unfixedLayer"),w.p(c,Z,"medianStraighten:direction"));var d=0,e=hq(a,b),g=a.Rd[b],h=pq(a,b,c);c=[];for(d=0;d<g;d++)c[d]=h[d];for(h=!0;h;)for(h=!1,d=0;d<g;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===g-1?n=k:0===d?(p=e[d+1].column,n=p-k===m+a.nodeMinColumnSpace(e[d+1],!0)?k-1:k):d===g-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===g-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===g-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)}iq(a,b,e);a.normalize()}
  function Nq(a,b){t&&(w.p(b,Z,"packAux:column"),w.p(1,Z,"packAux:direction"));for(var c=!0,d=a.network.vertexes.k;d.next();){var e=d.value,g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=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 Oq(a,b){t&&(w.p(b,Z,"tightPackAux:column"),w.p(1,Z,"tightPackAux:direction"));for(var c=b,c=b+1,d=0,e=[],g=[],d=0;d<=a.ob;d++)e[d]=!1,g[d]=!1;for(var h=a.network.vertexes.k;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&&(g[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.ob;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c}
  function Lq(a,b){t&&w.p(b,Z,"componentPack:direction");for(var c=0;c<=a.Kb;c++)for(;Nq(a,c););a.normalize();for(c=0;c<a.Kb;c++)for(;Oq(a,c););a.normalize();var c=0,d,e=0,g=0,h=0;if(0<b)for(c=0;c<=a.Kb;c++)for(d=kq(a),e=nq(a),g=e+1;e<g;)g=e,Pq(a,c,1),h=nq(a),h>e?lq(a,d):h<e&&(e=h,d=kq(a));if(0>b)for(c=a.Kb;0<=c;c--)for(d=kq(a),e=nq(a),g=e+1;e<g;)g=e,Pq(a,c,-1),h=nq(a),h>e?lq(a,d):h<e&&(e=h,d=kq(a));a.normalize()}
  function Pq(a,b,c){a.lg=0;for(var d=a.network.vertexes.k;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.lg)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.lg);a.lg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(rq(a,b,a.lg,-1,!0,!0),a.lg++);var g=0;b=[];for(g=0;g<a.lg*a.lg;g++)b[g]=!1;e=[];for(g=0;g<(a.ob+1)*(a.Kb+1);g++)e[g]=-1;for(d.reset();d.next();)for(var g=
  d.value,h=g.layer,k=Math.max(0,g.column-a.nodeMinColumnSpace(g,!0)),l=Math.min(a.Kb,g.column+a.nodeMinColumnSpace(g,!1));k<=l;k++)e[h*(a.Kb+1)+k]=g.component;for(g=0;g<=a.ob;g++){if(0<c)for(k=0;k<a.Kb;k++)-1!==e[g*(a.Kb+1)+k]&&-1!==e[g*(a.Kb+1)+k+1]&&e[g*(a.Kb+1)+k]!==e[g*(a.Kb+1)+k+1]&&(b[e[g*(a.Kb+1)+k]*a.lg+e[g*(a.Kb+1)+k+1]]=!0);if(0>c)for(k=a.Kb;0<k;k--)-1!==e[g*(a.Kb+1)+k]&&-1!==e[g*(a.Kb+1)+k-1]&&e[g*(a.Kb+1)+k]!==e[g*(a.Kb+1)+k-1]&&(b[e[g*(a.Kb+1)+k]*a.lg+e[g*(a.Kb+1)+k-1]]=!0)}e=[];for(g=
  0;g<a.lg;g++)e[g]=!0;h=new D("number");h.add(0);for(l=0;0!==h.count;)if(l=h.q[h.count-1],h.md(h.count-1),e[l])for(e[l]=!1,g=0;g<a.lg;g++)b[l*a.lg+g]&&h.ce(0,g);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)}
  Z.prototype.commitLayout=function(){if(this.Dl)for(var a=fq(this,!0),b=fq(this,!1),c=this.network.edges.k;c.next();){var d=c.value.link;null!==d&&(d.wb=a,d.yb=b)}this.commitNodes();this.Tz();this.Bt&&this.commitLinks()};function fq(a,b){return 270===a.ta?b?Ac:Dc:90===a.ta?b?Dc:Ac:180===a.ta?b?Bc:Cc:b?Cc:Bc}
  Z.prototype.commitNodes=function(){this.Xg=[];this.ig=[];this.If=[];this.Ob=[];for(var a=0;a<=this.ob;a++)this.Xg[a]=0,this.ig[a]=0,this.If[a]=0,this.Ob[a]=0;for(a=this.network.vertexes.k;a.next();){var b=a.value,c=b.layer;this.Xg[c]=Math.max(this.Xg[c],this.nodeMinLayerSpace(b,!0));this.ig[c]=Math.max(this.ig[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.em,c=0;c<=this.ob;c++){var e=d;0>=this.Xg[c]+this.ig[c]&&(e=0);0<c&&(b+=e/2);90===this.ta||0===this.ta?(b+=this.ig[c],this.If[c]=b,b+=this.Xg[c]):
  (b+=this.Xg[c],this.If[c]=b,b+=this.ig[c]);c<this.ob&&(b+=e/2);this.Ob[c]=b}d=b;b=this.Gd;for(c=0;c<=this.ob;c++)270===this.ta?this.If[c]=b.y+this.If[c]:90===this.ta?(this.If[c]=b.y+d-this.If[c],this.Ob[c]=d-this.Ob[c]):180===this.ta?this.If[c]=b.x+this.If[c]:(this.If[c]=b.x+d-this.If[c],this.Ob[c]=d-this.Ob[c]);for(a.reset();a.next();){var c=a.value,d=c.layer,e=c.column|0,g=0,h=0;270===this.ta||90===this.ta?(g=b.x+this.yd*e,h=this.If[d]):(g=this.If[d],h=b.y+this.yd*e);c.Da=g;c.Ra=h;c.commit()}};
  Z.prototype.Tz=function(){for(var a=0,b=this.em,c=0;c<=this.ob;c++)a+=this.Xg[c],a+=this.ig[c];for(var a=a+this.ob*b,b=[],c=this.yd*this.Kb,d=this.oJ;0<=d;d--)270===this.ta?0===d?b.push(new y(0,0,c,Math.abs(this.Ob[0]))):b.push(new y(0,this.Ob[d-1],c,Math.abs(this.Ob[d-1]-this.Ob[d]))):90===this.ta?0===d?b.push(new y(0,this.Ob[0],c,Math.abs(this.Ob[0]-a))):b.push(new y(0,this.Ob[d],c,Math.abs(this.Ob[d-1]-this.Ob[d]))):180===this.ta?0===d?b.push(new y(0,0,Math.abs(this.Ob[0]),c)):b.push(new y(this.Ob[d-
  1],0,Math.abs(this.Ob[d-1]-this.Ob[d]),c)):0===d?b.push(new y(this.Ob[0],0,Math.abs(this.Ob[0]-a),c)):b.push(new y(this.Ob[d],0,Math.abs(this.Ob[d-1]-this.Ob[d]),c));this.commitLayers(b,J.nk)};Z.prototype.commitLayers=function(){};
  Z.prototype.commitLinks=function(){for(var a=this.network.edges.k,b;a.next();)b=a.value.link,null!==b&&(b.Fl(),b.Mo(),b.Li());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.Fl();var d=b,e=d.Z,g=d.da,h=d.vd,k=d.le;if(c.valid){if(b.Le===sh&&4===b.oa){if(c.rev)var l=e,e=g,g=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,g,k),p=b.getLinkPoint(g,k,b.computeSpot(!1),
  !1,!1,e,h);n.J()||n.set(e.ea.Tj);p.J()||p.set(g.ea.Tj);b.Mo();b.cl(n.x,n.y);b.cl((2*n.x+p.x)/3,(2*n.y+p.y)/3);b.cl((n.x+2*p.x)/3,(n.y+2*p.y)/3);b.cl(p.x,p.y)}else{var q=!1,r=!1;null!==h&&b.computeSpot(!0)===yb&&(q=!0);null!==k&&b.computeSpot(!1)===yb&&(r=!0);if(q||r){var s=b.n(0).x,u=b.n(0).y,v=b.n(1).x,A=b.n(1).y,E=b.n(2).x,B=b.n(2).y,G=b.n(3).x,O=b.n(3).y;if(q){90===this.ta||270===this.ta?(v=s,A=(u+O)/2):(v=(s+G)/2,A=u);b.aa(1,v,A);var M=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,g,k);M.J()||M.set(e.ea.Tj);
  b.aa(0,M.x,M.y)}r&&(90===this.ta||270===this.ta?(E=G,B=(u+O)/2):(E=(s+G)/2,B=O),b.aa(2,E,B),M=b.getLinkPoint(g,k,b.computeSpot(!1),!1,!1,e,h),M.J()||M.set(g.ea.Tj),b.aa(3,M.x,M.y))}}}b.Li()}else if(c.fromVertex.layer===c.toVertex.layer)b.Li();else{var X=!1,ja=!1,V=0,Q=b.qt+1;if(b.gc)ja=!0,V=b.oa,4<V&&b.points.removeRange(2,V-3);else if(b.Le===sh)X=!0,V=b.oa,4<V&&b.points.removeRange(2,V-3),Q=2;else{var V=b.oa,ca=b.computeSpot(!0)===yb,Pa=b.computeSpot(!1)===yb;2<V&&ca&&Pa?b.points.removeRange(1,V-
  2):3<V&&ca&&!Pa?b.points.removeRange(1,V-3):3<V&&!ca&&Pa?b.points.removeRange(2,V-2):4<V&&!ca&&!Pa&&b.points.removeRange(2,V-3)}var Ha=c.fromVertex,Wa=c.toVertex,Aa,Ma;if(c.rev){for(var Da=0;null!==Wa&&Ha!==Wa;){Ma=Aa=null;for(var hc=Wa.rc.k;hc.next();){var od=hc.value;if(od.link===c.link&&(Aa=od.fromVertex,Ma=od.toVertex,null===Aa.od))break}Aa!==Ha&&(Za=b.n(Q-1).x,jb=b.n(Q-1).y,Ja=Aa.Da,Ka=Aa.Ra,ja?180===this.ta||0===this.ta?2===Q?(b.C(Q++,Za,jb),b.C(Q++,Za,Ka)):(oc=null!==Ma?Ma.Ra:jb,oc!==Ka&&(qb=
  this.Ob[Aa.layer-1],b.C(Q++,qb,jb),b.C(Q++,qb,Ka))):2===Q?(b.C(Q++,Za,jb),b.C(Q++,Ja,jb)):(me=null!==Ma?Ma.Da:Za,me!==Ja&&(qb=this.Ob[Aa.layer-1],b.C(Q++,Za,qb),b.C(Q++,Ja,qb))):2===Q?X?(Lb=Math.max(10,this.Xg[Wa.layer]),fb=Math.max(10,this.ig[Wa.layer]),180===this.ta?(Da=Wa.ca.x,b.C(Q++,Da-Lb,Ka),b.C(Q++,Da,Ka),b.C(Q++,Da+fb,Ka)):90===this.ta?(Da=Wa.ca.y+Wa.ca.height,b.C(Q++,Ja,Da+fb),b.C(Q++,Ja,Da),b.C(Q++,Ja,Da-Lb)):270===this.ta?(Da=Wa.ca.y,b.C(Q++,Ja,Da-Lb),b.C(Q++,Ja,Da),b.C(Q++,Ja,Da+fb)):
  (Da=Wa.ca.x+Wa.ca.width,b.C(Q++,Da+fb,Ka),b.C(Q++,Da,Ka),b.C(Q++,Da-Lb,Ka))):(b.C(Q++,Za,jb),180===this.ta||0===this.ta?b.C(Q++,Za,Ka):b.C(Q++,Ja,jb),b.C(Q++,Ja,Ka)):(Lb=Math.max(10,this.Xg[Aa.layer]),fb=Math.max(10,this.ig[Aa.layer]),180===this.ta?(X&&b.C(Q++,Ja-Lb,Ka),b.C(Q++,Ja,Ka),X&&b.C(Q++,Ja+fb,Ka)):90===this.ta?(X&&b.C(Q++,Ja,Ka+fb),b.C(Q++,Ja,Ka),X&&b.C(Q++,Ja,Ka-Lb)):270===this.ta?(X&&b.C(Q++,Ja,Ka-Lb),b.C(Q++,Ja,Ka),X&&b.C(Q++,Ja,Ka+fb)):(X&&b.C(Q++,Ja+fb,Ka),b.C(Q++,Ja,Ka),X&&b.C(Q++,
  Ja-Lb,Ka))));Wa=Aa}if(null===k||b.computeSpot(!1)!==yb)if(Za=b.n(Q-1).x,jb=b.n(Q-1).y,Ja=b.n(Q).x,Ka=b.n(Q).y,ja){var Qf=this.ig[Ha.layer],ic=0;180===this.ta||0===this.ta?(ic=jb,ic>=Ha.ca.y&&ic<=Ha.ca.bottom&&(Da=Ha.Da+Qf,ic=ic<Ha.ca.y+Ha.ca.height/2?Ha.ca.y-this.yd/2:Ha.ca.bottom+this.yd/2,b.C(Q++,Da,jb),b.C(Q++,Da,ic)),b.C(Q++,Ja,ic)):(ic=Za,ic>=Ha.ca.x&&ic<=Ha.ca.right&&(Da=Ha.Ra+Qf,ic=ic<Ha.ca.x+Ha.ca.width/2?Ha.ca.x-this.yd/2:Ha.ca.right+this.yd/2,b.C(Q++,Za,Da),b.C(Q++,ic,Da)),b.C(Q++,ic,Ka));
  b.C(Q++,Ja,Ka)}else X?(Lb=Math.max(10,this.Xg[Ha.layer]),fb=Math.max(10,this.ig[Ha.layer]),180===this.ta?(Da=Ha.ca.x+Ha.ca.width,b.aa(Q-2,Da,jb),b.aa(Q-1,Da+fb,jb)):90===this.ta?(Da=Ha.ca.y,b.aa(Q-2,Za,Da),b.aa(Q-1,Za,Da-Lb)):270===this.ta?(Da=Ha.ca.y+Ha.ca.height,b.aa(Q-2,Za,Da),b.aa(Q-1,Za,Da+fb)):(Da=Ha.ca.x,b.aa(Q-2,Da,jb),b.aa(Q-1,Da-Lb,jb))):(180===this.ta||0===this.ta?b.C(Q++,Ja,jb):b.C(Q++,Za,Ka),b.C(Q++,Ja,Ka))}else{for(;null!==Ha&&Ha!==Wa;){Ma=Aa=null;for(var bf=Ha.fc.k;bf.next();){var Rf=
  bf.value;if(Rf.link===c.link&&(Aa=Rf.toVertex,Ma=Rf.fromVertex,null!==Ma.od&&(Ma=null),null===Aa.od))break}var Za=0,jb=0,Ja=0,Ka=0,qb=0,Lb=0,fb=0;if(Aa!==Wa)if(Za=b.n(Q-1).x,jb=b.n(Q-1).y,Ja=Aa.Da,Ka=Aa.Ra,ja)if(180===this.ta||0===this.ta){var oc=null!==Ma?Ma.Ra:jb;oc!==Ka&&(qb=this.Ob[Aa.layer],2===Q&&(qb=0===this.ta?Math.max(qb,Za):Math.min(qb,Za)),b.C(Q++,qb,jb),b.C(Q++,qb,Ka))}else{var me=null!==Ma?Ma.Da:Za;me!==Ja&&(qb=this.Ob[Aa.layer],2===Q&&(qb=90===this.ta?Math.max(qb,jb):Math.min(qb,jb)),
  b.C(Q++,Za,qb),b.C(Q++,Ja,qb))}else Lb=Math.max(10,this.Xg[Aa.layer]),fb=Math.max(10,this.ig[Aa.layer]),180===this.ta?(b.C(Q++,Ja+fb,Ka),X&&b.C(Q++,Ja,Ka),b.C(Q++,Ja-Lb,Ka)):90===this.ta?(b.C(Q++,Ja,Ka-Lb),X&&b.C(Q++,Ja,Ka),b.C(Q++,Ja,Ka+fb)):270===this.ta?(b.C(Q++,Ja,Ka+fb),X&&b.C(Q++,Ja,Ka),b.C(Q++,Ja,Ka-Lb)):(b.C(Q++,Ja-Lb,Ka),X&&b.C(Q++,Ja,Ka),b.C(Q++,Ja+fb,Ka));Ha=Aa}ja&&(Za=b.n(Q-1).x,jb=b.n(Q-1).y,Ja=b.n(Q).x,Ka=b.n(Q).y,180===this.ta||0===this.ta?jb!==Ka&&(qb=0===this.ta?Math.min(Math.max((Ja+
  Za)/2,this.Ob[Wa.layer]),Ja):Math.max(Math.min((Ja+Za)/2,this.Ob[Wa.layer]),Ja),b.C(Q++,qb,jb),b.C(Q++,qb,Ka)):Za!==Ja&&(qb=90===this.ta?Math.min(Math.max((Ka+jb)/2,this.Ob[Wa.layer]),Ka):Math.max(Math.min((Ka+jb)/2,this.Ob[Wa.layer]),Ka),b.C(Q++,Za,qb),b.C(Q++,Ja,qb)))}if(null!==d&&X){if(null!==h){if(b.computeSpot(!0)===yb){var tc=b.n(0),Vd=b.n(2);tc.L(Vd)||b.aa(1,(tc.x+Vd.x)/2,(tc.y+Vd.y)/2)}M=b.getLinkPoint(e,h,yb,!0,!1,g,k);M.J()||M.set(e.ea.Tj);b.aa(0,M.x,M.y)}null!==k&&(b.computeSpot(!1)===
  yb&&(tc=b.n(b.oa-1),Vd=b.n(b.oa-3),tc.L(Vd)||b.aa(b.oa-2,(tc.x+Vd.x)/2,(tc.y+Vd.y)/2)),M=b.getLinkPoint(g,k,yb,!1,!1,e,h),M.J()||M.set(g.ea.Tj),b.aa(b.oa-1,M.x,M.y))}b.Li();c.commit()}}}for(var ne=new D(U),cf=this.network.edges.k;cf.next();){var wf=cf.value.link;null!==wf&&wf.gc&&!ne.contains(wf)&&ne.add(wf)}if(0<ne.count)if(90===this.ta||270===this.ta){for(var Wd=0,Mb=new D(Qq),Eb,uc,Pg=ne.k;Pg.next();){var Nb=Pg.value;if(null!==Nb&&Nb.gc)for(var Fb=2;Fb<Nb.oa-3;Fb++)if(Eb=Nb.n(Fb),uc=Nb.n(Fb+1),
  this.I(Eb.y,uc.y)&&!this.I(Eb.x,uc.x)){var jc=new Qq;jc.layer=Math.floor(Eb.y/2);var rb=Nb.n(0),Ee=Nb.n(Nb.oa-1);jc.first=rb.x*rb.x+rb.y;jc.Nd=Ee.x*Ee.x+Ee.y;jc.Ke=Math.min(Eb.x,uc.x);jc.$d=Math.max(Eb.x,uc.x);jc.index=Fb;jc.link=Nb;if(Fb+2<Nb.oa){var Xd=Nb.n(Fb-1),tg=Nb.n(Fb+2),Sf=0;Xd.y<Eb.y?Sf=tg.y<Eb.y?3:Eb.x<uc.x?2:1:Xd.y>Eb.y&&(Sf=tg.y>Eb.y?0:uc.x<Eb.x?2:1);jc.Zh=Sf}Mb.add(jc)}}if(1<Mb.count){Mb.sort(this.nG);for(var Gb=0;Gb<Mb.count;){for(var pd=Mb.q[Gb].layer,vc=Gb+1;vc<Mb.count&&Mb.q[vc].layer===
  pd;)vc++;if(1<vc-Gb)for(var Bb=Gb;Bb<vc;){for(var Mc=Mb.q[Bb].$d,Qb=Gb+1;Qb<vc&&Mb.q[Qb].Ke<Mc;)Mc=Math.max(Mc,Mb.q[Qb].$d),Qb++;var Va=Qb-Bb;if(1<Va){Mb.Sp(this.wx,Bb,Bb+Va);for(var kb=1,Hb=Mb.q[Bb].Nd,Fb=Bb;Fb<Qb;Fb++){var kc=Mb.q[Fb];kc.Nd!==Hb&&(kb++,Hb=kc.Nd)}Mb.Sp(this.mG,Bb,Bb+Va);for(var Yd=1,Hb=Mb.q[Bb].first,Fb=Bb;Fb<Qb;Fb++)kc=Mb.q[Fb],kc.first!==Hb&&(Yd++,Hb=kc.first);var Zd=!0,xf=Yd;kb<Yd?(Zd=!1,xf=kb,Hb=Mb.q[Bb].Nd,Mb.Sp(this.wx,Bb,Bb+Va)):Hb=Mb.q[Bb].first;for(var Fe=0,Fb=Bb;Fb<Qb;Fb++){kc=
  Mb.q[Fb];(Zd?kc.first:kc.Nd)!==Hb&&(Fe++,Hb=Zd?kc.first:kc.Nd);Nb=kc.link;Eb=Nb.n(kc.index);uc=Nb.n(kc.index+1);var Ge=this.rp*(Fe-(xf-1)/2);if(!Nb.Si||Rq(Eb.x,Eb.y+Ge,uc.x,uc.y+Ge))Wd++,Nb.Fl(),Nb.aa(kc.index,Eb.x,Eb.y+Ge),Nb.aa(kc.index+1,uc.x,uc.y+Ge),Nb.Li()}}Bb=Qb}Gb=vc}}}else{for(var Yb=0,gb=new D(Qq),lc,Ec,qd=ne.k;qd.next();){var db=qd.value;if(null!==db&&db.gc)for(var zb=2;zb<db.oa-3;zb++)if(lc=db.n(zb),Ec=db.n(zb+1),this.I(lc.x,Ec.x)&&!this.I(lc.y,Ec.y)){var pc=new Qq;pc.layer=Math.floor(lc.x/
  2);var rd=db.n(0),Qg=db.n(db.oa-1);pc.first=rd.x+rd.y*rd.y;pc.Nd=Qg.x+Qg.y*Qg.y;pc.Ke=Math.min(lc.y,Ec.y);pc.$d=Math.max(lc.y,Ec.y);pc.index=zb;pc.link=db;if(zb+2<db.oa){var Rg=db.n(zb-1),Sg=db.n(zb+2),Tf=0;Rg.x<lc.x?Tf=Sg.x<lc.x?3:lc.y<Ec.y?2:1:Rg.x>lc.x&&(Tf=Sg.x>lc.x?0:Ec.y<lc.y?2:1);pc.Zh=Tf}gb.add(pc)}}if(1<gb.count){gb.sort(this.nG);for(var Nc=0;Nc<gb.count;){for(var Wc=gb.q[Nc].layer,Oc=Nc+1;Oc<gb.count&&gb.q[Oc].layer===Wc;)Oc++;if(1<Oc-Nc)for(var sb=Nc;sb<Oc;){for(var oe=gb.q[sb].$d,tb=Nc+
  1;tb<Oc&&gb.q[tb].Ke<oe;)oe=Math.max(oe,gb.q[tb].$d),tb++;var Fc=tb-sb;if(1<Fc){gb.Sp(this.wx,sb,sb+Fc);for(var He=1,Ib=gb.q[sb].Nd,zb=sb;zb<tb;zb++){var Jb=gb.q[zb];Jb.Nd!==Ib&&(He++,Ib=Jb.Nd)}gb.Sp(this.mG,sb,sb+Fc);for(var sd=1,Ib=gb.q[sb].first,zb=sb;zb<tb;zb++)Jb=gb.q[zb],Jb.first!==Ib&&(sd++,Ib=Jb.first);var Xc=!0,$d=sd;He<sd?(Xc=!1,$d=He,Ib=gb.q[sb].Nd,gb.Sp(this.wx,sb,sb+Fc)):Ib=gb.q[sb].first;for(var ae=0,zb=sb;zb<tb;zb++){Jb=gb.q[zb];(Xc?Jb.first:Jb.Nd)!==Ib&&(ae++,Ib=Xc?Jb.first:Jb.Nd);
  db=Jb.link;lc=db.n(Jb.index);Ec=db.n(Jb.index+1);var pe=this.rp*(ae-($d-1)/2);if(!db.Si||Rq(lc.x+pe,lc.y,Ec.x+pe,Ec.y))Yb++,db.Fl(),db.aa(Jb.index,lc.x+pe,lc.y),db.aa(Jb.index+1,Ec.x+pe,Ec.y),db.Li()}}sb=tb}Nc=Oc}}}};Z.prototype.nG=function(a,b){return a instanceof Qq&&b instanceof Qq&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Ke<b.Ke?-1:a.Ke>b.Ke?1:a.$d<b.$d?-1:a.$d>b.$d?1:0:0};
  Z.prototype.mG=function(a,b){return a instanceof Qq&&b instanceof Qq&&a!==b?a.first<b.first?-1:a.first>b.first||a.Zh<b.Zh?1:a.Zh>b.Zh||a.Ke<b.Ke?-1:a.Ke>b.Ke?1:a.$d<b.$d?-1:a.$d>b.$d?1:0:0};Z.prototype.wx=function(a,b){return a instanceof Qq&&b instanceof Qq&&a!==b?a.Nd<b.Nd?-1:a.Nd>b.Nd||a.Zh<b.Zh?1:a.Zh>b.Zh||a.Ke<b.Ke?-1:a.Ke>b.Ke?1:a.$d<b.$d?-1:a.$d>b.$d?1:0:0};Z.prototype.I=function(a,b){t&&(w.p(a,Z,"isApprox:a"),w.p(b,Z,"isApprox:b"));var c=a-b;return-1<c&&1>c};
  function Rq(a,b,c,d){t&&(w.p(a,Z,"isUnoccupied2:px"),w.p(b,Z,"isUnoccupied2:py"),w.p(c,Z,"isUnoccupied2:qx"),w.p(d,Z,"isUnoccupied2:qy"));return!0}function hq(a,b){var c,d=a.Rd[b];if(d>=a.Zg.length){c=[];for(var e=0;e<a.Zg.length;e++)c[e]=a.Zg[e];a.Zg=c}void 0===a.Zg[d]||null===a.Zg[d]?c=[]:(c=a.Zg[d],a.Zg[d]=null);d=a.Ir[b];for(e=0;e<d.length;e++){var g=d[e];c[g.index]=g}return c}function iq(a,b,c){a.Zg[a.Rd[b]]=c}w.g(Z,"layerSpacing",Z.prototype.layerSpacing);
  w.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.em},function(a){this.em!==a&&(w.i(a,"number",Z,"layerSpacing"),0<=a&&(this.em=a,this.K()))});w.g(Z,"columnSpacing",Z.prototype.hI);w.defineProperty(Z,{hI:"columnSpacing"},function(){return this.yd},function(a){this.yd!==a&&(w.i(a,"number",Z,"columnSpacing"),0<=a&&(this.yd=a,this.K()))});w.g(Z,"direction",Z.prototype.direction);
  w.defineProperty(Z,{direction:"direction"},function(){return this.ta},function(a){this.ta!==a&&(w.i(a,"number",Z,"direction"),this.ta=a,this.K())});w.g(Z,"cycleRemoveOption",Z.prototype.qE);w.defineProperty(Z,{qE:"cycleRemoveOption"},function(){return this.En},function(a){this.En!==a&&(w.za(a,Z,Z,"cycleRemoveOption"),a===aq||a===Sp)&&(this.En=a,this.K())});w.g(Z,"layeringOption",Z.prototype.sF);
  w.defineProperty(Z,{sF:"layeringOption"},function(){return this.jo},function(a){this.jo!==a&&(w.za(a,Z,Z,"layeringOption"),a===Wp||a===sq||a===uq)&&(this.jo=a,this.K())});w.g(Z,"initializeOption",Z.prototype.eF);w.defineProperty(Z,{eF:"initializeOption"},function(){return this.Yn},function(a){this.Yn!==a&&(w.za(a,Z,Z,"initializeOption"),a===Xp||a===Aq||a===yq)&&(this.Yn=a,this.K())});w.g(Z,"iterations",Z.prototype.gJ);
  w.defineProperty(Z,{gJ:"iterations"},function(){return this.bm},function(a){this.bm!==a&&(w.p(a,$p,"iterations"),0<=a&&(this.bm=a,this.K()))});w.g(Z,"aggressiveOption",Z.prototype.PD);w.defineProperty(Z,{PD:"aggressiveOption"},function(){return this.tn},function(a){this.tn!==a&&(w.za(a,Z,Z,"aggressiveOption"),a===Eq||a===Yp||a===Fq)&&(this.tn=a,this.K())});w.g(Z,"packOption",Z.prototype.CJ);
  w.defineProperty(Z,{CJ:"packOption"},function(){return this.wi},function(a){this.wi!==a&&(w.i(a,"number",Z,"packOption"),0<=a&&8>a&&(this.wi=a,this.K()))});w.g(Z,"setsPortSpots",Z.prototype.Dl);w.defineProperty(Z,{Dl:"setsPortSpots"},function(){return this.Hh},function(a){this.Hh!==a&&(w.i(a,"boolean",Z,"setsPortSpots"),this.Hh=a,this.K())});w.g(Z,"linkSpacing",Z.prototype.rp);
  w.defineProperty(Z,{rp:"linkSpacing"},function(){return this.qj},function(a){this.qj!==a&&(w.i(a,"number",Z,"linkSpacing"),0<=a&&(this.qj=a,this.K()))});w.A(Z,{oJ:"maxLayer"},function(){return this.ob});w.A(Z,{HK:"maxIndex"},function(){return this.pv});w.A(Z,{GK:"maxColumn"},function(){return this.Kb});w.A(Z,{LK:"minIndexLayer"},function(){return this.Ar});w.A(Z,{IK:"maxIndexLayer"},function(){return this.Jf});var Sp;Z.CycleDepthFirst=Sp=w.w(Z,"CycleDepthFirst",0);var aq;
  Z.CycleGreedy=aq=w.w(Z,"CycleGreedy",1);var Wp;Z.LayerOptimalLinkLength=Wp=w.w(Z,"LayerOptimalLinkLength",0);var sq;Z.LayerLongestPathSink=sq=w.w(Z,"LayerLongestPathSink",1);var uq;Z.LayerLongestPathSource=uq=w.w(Z,"LayerLongestPathSource",2);var Xp;Z.InitDepthFirstOut=Xp=w.w(Z,"InitDepthFirstOut",0);var Aq;Z.InitDepthFirstIn=Aq=w.w(Z,"InitDepthFirstIn",1);var yq;Z.InitNaive=yq=w.w(Z,"InitNaive",2);var Eq;Z.AggressiveNone=Eq=w.w(Z,"AggressiveNone",0);var Yp;
  Z.AggressiveLess=Yp=w.w(Z,"AggressiveLess",1);var Fq;Z.AggressiveMore=Fq=w.w(Z,"AggressiveMore",2);Z.PackNone=0;var Gq;Z.PackExpand=Gq=1;var Hq;Z.PackStraighten=Hq=2;var Jq;Z.PackMedian=Jq=4;var Zp;Z.PackAll=Zp=7;function Qq(){this.index=this.$d=this.Ke=this.Nd=this.first=this.layer=0;this.link=null;this.Zh=0}w.be(Qq,{layer:!0,first:!0,Nd:!0,Ke:!0,$d:!0,index:!0,link:!0,Zh:!0});function $p(){ta.call(this)}w.Ia($p,ta);w.ja("LayeredDigraphNetwork",$p);$p.prototype.createVertex=function(){return new Sq};
  $p.prototype.createEdge=function(){return new Tq};function Sq(){ua.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.So=NaN;this.Em=0;this.GA=this.HA=null}w.Ia(Sq,ua);w.ja("LayeredDigraphVertex",Sq);function Tq(){va.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}w.Ia(Tq,va);w.ja("LayeredDigraphEdge",Tq);
  function Y(){0<arguments.length&&w.$c(Y);Re.call(this);this.rd=new F(Object);this.Vr=Uq;this.Hf=Vq;this.Ls=Wq;this.mv=Xq;this.JB=null;this.ph=!0;this.bd=Yq;this.cg=(new fa(10,10)).freeze();this.va=new Zq;this.ua=new Zq;this.uz=[]}w.Ia(Y,Re);w.ja("TreeLayout",Y);Y.prototype.cloneProtected=function(a){Re.prototype.cloneProtected.call(this,a);a.Vr=this.Vr;a.Ls=this.Ls;a.mv=this.mv;a.ph=this.ph;a.bd=this.bd;a.cg.assign(this.cg);a.va.copyInheritedPropertiesFrom(this.va);a.ua.copyInheritedPropertiesFrom(this.ua)};
  Y.prototype.createNetwork=function(){return new $q};Y.prototype.makeNetwork=function(a){function b(a){if(a instanceof S)return!a.zf&&"Comment"!==a.Gc;if(a instanceof U){var b=a.Z;if(null===b||b.zf||"Comment"===b.Gc)return!1;a=a.da;return null===a||a.zf||"Comment"===a.Gc?!1:!0}return!1}var c=this.createNetwork();c.Lb=this;a instanceof C?(c.Qj(a.Gg,!0,b),c.Qj(a.links,!0,b)):a instanceof T?c.Qj(a.Rc,!1,b):c.Qj(a.k,!1,b);return c};
  Y.prototype.doLayout=function(a){null===a&&w.m("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.Ge!==ar&&(this.Gd=this.initialOrigin(this.Gd));var b=this.h;null===b&&a instanceof C&&(b=a);this.Hf=this.path===Uq&&null!==b?b.ld?Vq:br:this.path===Uq?Vq:this.path;if(0<this.network.vertexes.count){this.network.Bw();for(a=this.network.vertexes.k;a.next();)b=a.value,b.initialized=!1,b.level=
  0,b.parent=null,b.children=[];if(0<this.rd.count){a=new F(Zq);for(b=this.rd.k;b.next();){var c=b.value;c instanceof S?(c=this.network.Sm(c),null!==c&&a.add(c)):c instanceof Zq&&a.add(c)}this.rd=a}0===this.rd.count&&this.findRoots();for(a=this.rd.copy().k;a.next();)b=a.value,b.initialized||(b.initialized=!0,cr(this,b));for(a=this.rd.k;a.next();)b=a.value,b instanceof Zq&&dr(this,b);for(a=this.rd.k;a.next();)b=a.value,b instanceof Zq&&er(this,b);for(a=this.rd.k;a.next();)b=a.value,b instanceof Zq&&
  fr(this,b);this.Mz();if(this.gx===gr){c=[];for(a=this.network.vertexes.k;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.JB=c;for(a=this.network.vertexes.k;a.next();)d=a.value,b=d.parent,null===b&&(b=d),0===b.angle||180===b.angle?(180===b.angle&&(d.Yo+=c[d.level]-d.width),d.width=c[d.level]):(270===b.angle&&(d.Zo+=c[d.level]-d.height),d.height=
  c[d.level])}else if(this.gx===hr)for(a=this.network.vertexes.k;a.next();){c=a.value;b=0===c.angle||180===c.angle;e=-1;for(d=0;d<c.children.length;d++)var g=c.children[d],e=Math.max(e,b?g.width:g.height);if(0<=e)for(d=0;d<c.children.length;d++)g=c.children[d],b?(180===c.angle&&(g.Yo+=e-g.width),g.width=e):(270===c.angle&&(g.Zo+=e-g.height),g.height=e)}for(a=this.rd.k;a.next();)b=a.value,b instanceof Zq&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.rd=new F(Object);
  this.gf=!0};
  Y.prototype.findRoots=function(){for(var a=this.network.vertexes.k;a.next();){var b=a.value;switch(this.Hf){case Vq:0===b.rc.count&&this.rd.add(b);break;case br:0===b.fc.count&&this.rd.add(b);break;default:w.m("Unhandled path value "+this.Hf.toString())}}if(0===this.rd.count){for(var a=999999,b=null,c=this.network.vertexes.k;c.next();){var d=c.value;switch(this.Hf){case Vq:d.rc.count<a&&(a=d.rc.count,b=d);break;case br:d.fc.count<a&&(a=d.fc.count,b=d);break;default:w.m("Unhandled path value "+this.Hf.toString())}}null!==
  b&&this.rd.add(b)}};
  function cr(a,b){if(null!==b){t&&w.l(b,Zq,Y,"walkTree:v");switch(a.Hf){case Vq:if(0<b.fc.count){for(var c=new D(Zq),d=b.BI;d.next();){var e=d.value;ir(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.Ue())}break;case br:if(0<b.rc.count){c=new D(Zq);for(d=b.VJ;d.next();)e=d.value,ir(a,b,e)&&c.add(e);0<c.count&&(b.children=c.Ue())}break;default:w.m("Unhandled path value"+a.Hf.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var g=c[e];g.initialized=!0;g.level=b.level+1;g.parent=b;a.rd.remove(g)}for(e=0;e<
  d;e++)g=c[e],cr(a,g)}}function ir(a,b,c){t&&w.l(b,Zq,Y,"walkOK:v");t&&w.l(c,Zq,Y,"walkOK:c");if(c.initialized){var d;if(null===b)d=!1;else{t&&w.l(c,Zq,Y,"isAncestor:a");t&&w.l(b,Zq,Y,"isAncestor:b");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){t&&w.l(a,Zq,Y,"removeChild:p");t&&w.l(b,Zq,Y,"removeChild:c");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),g=0,e=0;e<c.length;e++)c[e]!==b&&(d[g++]=c[e]);a.children=d}}};
  function dr(a,b){if(null!==b){t&&w.l(b,Zq,Y,"initializeTree:v");a.initializeTreeVertexValues(b);b.alignment===jr&&a.sortTreeVertexChildren(b);for(var c=0,d=b.Jm,e=0,g=b.children,h=g.length,k=0;k<h;k++){var l=g[k];dr(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 kr(a,b){t&&w.l(b,Zq,Y,"mom:v");switch(a.Ls){default:case Wq:return null!==b.parent?b.parent:a.va;case lr:return null===b.parent?a.va:null===b.parent.parent?a.ua:b.parent;case mr:if(null!==b.parent)return null!==b.parent.parent?b.parent.parent:a.ua;case nr:var c=!0;if(0===b.Jm)c=!1;else for(var d=b.children,e=d.length,g=0;g<e;g++)if(0<d[g].Jm){c=!1;break}return c&&null!==b.parent?a.ua:null!==b.parent?b.parent:a.va}}
  Y.prototype.initializeTreeVertexValues=function(a){t&&w.l(a,Zq,Y,"initializeTreeVertexValues:v");var b=kr(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===jr){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 er(a,b){if(null!==b){t&&w.l(b,Zq,Y,"assignTree:v");a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)er(a,c[e])}}Y.prototype.assignTreeVertexValues=function(){};function fr(a,b){if(null!==b){t&&w.l(b,Zq,Y,"sortTree:v");b.alignment!==jr&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)fr(a,c[e])}}
  Y.prototype.sortTreeVertexChildren=function(a){t&&w.l(a,Zq,Y,"sortTreeVertexChildren:v");switch(a.sorting){case or:break;case pr:a.children.reverse();break;case qr:a.children.sort(a.comparer);break;case rr:a.children.sort(a.comparer);a.children.reverse();break;default:w.m("Unhandled sorting value "+a.sorting.toString())}};Y.prototype.Mz=function(){if(this.comments)for(var a=this.network.vertexes.k;a.next();)this.addComments(a.value)};
  Y.prototype.addComments=function(a){t&&w.l(a,Zq,Y,"addComments:v");var b=a.angle,c=a.parent,d=0,e=sr,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=tr(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.Jm,g=0,h=0,k=0,l=a.commentSpacing;if(null!==a.Cc)for(var m=a.Cc.HE();m.next();){var n=m.value;"Comment"===n.Gc&&n.Ja()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.vf(),n=n.Ga,b&&!c||!e&&!d&&c||e&&d&&c?(g=Math.max(g,n.width),h+=n.height+Math.abs(k)):(g+=n.width+Math.abs(k),h=Math.max(h,n.height)),
  k=l)}null!==a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(g+=Math.abs(a.commentMargin),h=Math.max(0,h-a.height)):(h+=Math.abs(a.commentMargin),g=Math.max(0,g-a.width)),e=w.lk(0,0,a.ca.width+g,a.ca.height+h),a.kb=e,w.nc(e))};function tr(a){return a===ur||a===jr||a===vr||a===wr}function xr(a){return a===ur||a===jr}
  function yr(a){t&&w.l(a,Zq,Y,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(tr(c)){if(xr(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===vr)return!0}}return!1}
  Y.prototype.layoutComments=function(a){t&&w.l(a,Zq,Y,"layoutComments:v");if(null!==a.comments){var b=a.Cc.Ga,c=a.parent,d=a.angle,e=0,g=sr,g=!1;null!==c&&(e=c.angle,g=c.alignment,g=tr(g));for(var c=90===d||270===d,d=90===e||270===e,h=0===a.Jm,k=yr(a),l=0,m=a.comments,n=m.length,p=w.M(),q=0;q<n;q++){var r=m[q],s=r.Ga;if(c&&!h||!g&&!d&&h||g&&d&&h){if(135<e&&!g||d&&k)if(0<=a.commentMargin)for(p.o(a.ca.x-a.commentMargin-s.width,a.ca.y+l),r.move(p),r=r.wg();r.next();){var u=r.value;u.wb=Bc;u.yb=Cc}else for(p.o(a.ca.x+
  2*a.O.x-a.commentMargin,a.ca.y+l),r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Cc,u.yb=Bc;else if(0<=a.commentMargin)for(p.o(a.ca.x+2*a.O.x+a.commentMargin,a.ca.y+l),r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Cc,u.yb=Bc;else for(p.o(a.ca.x+a.commentMargin-s.width,a.ca.y+l),r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Bc,u.yb=Cc;l=0<=a.commentSpacing?l+(s.height+a.commentSpacing):l+(a.commentSpacing-s.height)}else{if(135<e&&!g||!d&&k)if(0<=a.commentMargin)for(p.o(a.ca.x+l,a.ca.y-a.commentMargin-s.height),
  r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Ac,u.yb=Dc;else for(p.o(a.ca.x+l,a.ca.y+2*a.O.y-a.commentMargin),r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Dc,u.yb=Ac;else if(0<=a.commentMargin)for(p.o(a.ca.x+l,a.ca.y+2*a.O.y+a.commentMargin),r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Dc,u.yb=Ac;else for(p.o(a.ca.x+l,a.ca.y+a.commentMargin-s.height),r.move(p),r=r.wg();r.next();)u=r.value,u.wb=Ac,u.yb=Dc;l=0<=a.commentSpacing?l+(s.width+a.commentSpacing):l+(a.commentSpacing-s.width)}}w.B(p);b=l-a.commentSpacing-
  (c?b.height:b.width);if(this.Hf===Vq)for(e=a.fc;e.next();)a=e.value.link,null===a||a.Si||(a.ek=0<b?b:NaN);else for(e=a.rc;e.next();)a=e.value.link,null===a||a.Si||(a.mk=0<b?b:NaN)}};
  Y.prototype.layoutTree=function(a){if(null!==a){t&&w.l(a,Zq,Y,"layoutTree:v");for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case zr:Ar(this,a);break;case Br:if(a.alignment===jr)Ar(this,a);else if(t&&w.l(a,Zq,Y,"layoutTreeBlock:v"),0===a.Jm){var d=a.parent,b=!1,c=0,e=sr;null!==d&&(c=d.angle,e=d.alignment,b=tr(e));d=yr(a);a.ma.o(0,0);a.cb.o(a.width,a.height);null===a.parent||null===a.comments||(180!==c&&270!==c||b)&&!d?a.La.o(0,0):180===c&&!b||(90===c||270===
  c)&&d?a.La.o(a.width-2*a.O.x,0):a.La.o(0,a.height-2*a.O.y);a.Dt=null;a.Vt=null}else{for(var g=Cr(a),b=90===g||270===g,h=0,k=a.children,l=k.length,m=0;m<l;m++)var n=k[m],h=Math.max(h,b?n.cb.width:n.cb.height);var p=a.alignment,d=p===Dr,q=p===Er,r=tr(p),s=Math.max(0,a.breadthLimit),c=Fr(a),u=a.nodeSpacing,v=Gr(a),A=a.rowSpacing,E=0;if(d||q||a.Mp||a.Np&&1===a.maxGenerationCount)E=Math.max(0,a.rowIndent);var d=a.width,e=a.height,B=0,G=0,O=0,M=null,X=null,ja=0,V=0,Q=0,ca=0,Pa=0,Ha=0,Wa=0,Aa=0,n=0;r&&!xr(p)&&
  135<g&&k.reverse();if(xr(p))if(1<l)for(m=0;m<l;m++)0===m%2&&m!==l-1?Aa=Math.max(Aa,b?k[m].cb.width:k[m].cb.height):0!==m%2&&(n=Math.max(n,b?k[m].cb.width:k[m].cb.height));else 1===l&&(Aa=b?k[0].cb.width:k[0].cb.height);if(r){switch(p){case ur:V=135>g?Hr(a,k,Aa,B,G):Ir(a,k,Aa,B,G);Aa=V.x;B=V.width;G=V.height;break;case vr:for(m=0;m<l;m++){var n=k[m],Ma=n.cb,M=0===Ha?0:A;b?(n.ma.o(h-Ma.width,ca+M),B=Math.max(B,Ma.width),G=Math.max(G,ca+M+Ma.height),ca+=M+Ma.height):(n.ma.o(Q+M,h-Ma.height),B=Math.max(B,
  Q+M+Ma.width),G=Math.max(G,Ma.height),Q+=M+Ma.width);Ha++}break;case wr:for(m=0;m<l;m++)n=k[m],Ma=n.cb,M=0===Ha?0:A,b?(n.ma.o(u/2+a.O.x,ca+M),B=Math.max(B,Ma.width),G=Math.max(G,ca+M+Ma.height),ca+=M+Ma.height):(n.ma.o(Q+M,u/2+a.O.y),B=Math.max(B,Q+M+Ma.width),G=Math.max(G,Ma.height),Q+=M+Ma.width),Ha++}M=Jr(this,2);X=Jr(this,2);b?(M[0].o(0,0),M[1].o(0,G),X[0].o(B,0)):(M[0].o(0,0),M[1].o(B,0),X[0].o(0,G));X[1].o(B,G)}else for(m=0;m<l;m++){n=k[m];Ma=n.cb;if(b){0<s&&0<Ha&&Q+u+Ma.width>s&&(Q<h&&Kr(a,
  p,h-Q,0,Wa,m-1),Pa++,Ha=0,Wa=m,O=G,Q=0,ca=135<g?-G-A:G+A);Lr(this,n,0,ca);var Da=0;if(0===Ha){if(M=n.Dt,X=n.Vt,ja=Ma.width,V=Ma.height,null===M||null===X||g!==Cr(n))M=Jr(this,2),X=Jr(this,2),M[0].o(0,0),M[1].o(0,V),X[0].o(ja,0),X[1].o(ja,V)}else{var hc=w.lb(),V=Mr(this,a,n,M,X,ja,V,hc),Da=V.x,M=hc[0],X=hc[1],ja=V.width,V=V.height;w.xa(hc);Q<Ma.width&&0>Da&&(Nr(a,-Da,0,Wa,m-1),Or(M,-Da,0),Or(X,-Da,0),Da=0)}n.ma.o(Da,ca);B=Math.max(B,ja);G=Math.max(G,O+(0===Pa?0:A)+Ma.height);Q=ja}else{0<s&&0<Ha&&ca+
  u+Ma.height>s&&(ca<h&&Kr(a,p,0,h-ca,Wa,m-1),Pa++,Ha=0,Wa=m,O=B,ca=0,Q=135<g?-B-A:B+A);Lr(this,n,Q,0);Da=0;if(0===Ha){if(M=n.Dt,X=n.Vt,ja=Ma.width,V=Ma.height,null===M||null===X||g!==Cr(n))M=Jr(this,2),X=Jr(this,2),M[0].o(0,0),M[1].o(ja,0),X[0].o(0,V),X[1].o(ja,V)}else hc=w.lb(),V=Mr(this,a,n,M,X,ja,V,hc),Da=V.x,M=hc[0],X=hc[1],ja=V.width,V=V.height,w.xa(hc),ca<Ma.height&&0>Da&&(Nr(a,0,-Da,Wa,m-1),Or(M,0,-Da),Or(X,0,-Da),Da=0);n.ma.o(Q,Da);G=Math.max(G,V);B=Math.max(B,O+(0===Pa?0:A)+Ma.width);ca=V}Ha++}0<
  Pa&&(b?(G+=Math.max(0,c),Q<B&&Kr(a,p,B-Q,0,Wa,l-1),0<E&&(q||Nr(a,E,0,0,l-1),B+=E)):(B+=Math.max(0,c),ca<G&&Kr(a,p,0,G-ca,Wa,l-1),0<E&&(q||Nr(a,0,E,0,l-1),G+=E)));q=h=0;switch(p){case Pr:b?h+=B/2-a.O.x-v/2:q+=G/2-a.O.y-v/2;break;case sr:0<Pa?b?h+=B/2-a.O.x-v/2:q+=G/2-a.O.y-v/2:b?(m=k[0].ma.x+k[0].La.x,Aa=k[l-1].ma.x+k[l-1].La.x+2*k[l-1].O.x,h+=m+(Aa-m)/2-a.O.x-v/2):(m=k[0].ma.y+k[0].La.y,Aa=k[l-1].ma.y+k[l-1].La.y+2*k[l-1].O.y,q+=m+(Aa-m)/2-a.O.y-v/2);break;case Dr:b?(h-=v,B+=v):(q-=v,G+=v);break;
  case Er:b?(h+=B-a.width+v,B+=v):(q+=G-a.height+v,G+=v);break;case ur:b?h=1<l?h+(Aa+u/2-a.O.x):h+(k[0].O.x-a.O.x+k[0].La.x):q=1<l?q+(Aa+u/2-a.O.y):q+(k[0].O.y-a.O.y+k[0].La.y);break;case vr:b?h+=B+u/2-a.O.x:q+=G+u/2-a.O.y;break;case wr:break;default:w.m("Unhandled alignment value "+p.toString())}for(m=0;m<l;m++)n=k[m],b?n.ma.o(n.ma.x+n.La.x-h,n.ma.y+(135<g?(r?-G:-n.cb.height)+n.La.y-c:e+c+n.La.y)):n.ma.o(n.ma.x+(135<g?(r?-B:-n.cb.width)+n.La.x-c:d+c+n.La.x),n.ma.y+n.La.y-q);l=k=0;r?b?(B=Qr(a,B,h),
  0>h&&(h=0),135<g&&(q+=G+c),G+=e+c,p===wr&&(k+=u/2+a.O.x),l+=e+c):(135<g&&(h+=B+c),B+=d+c,G=Rr(a,G,q),0>q&&(q=0),p===wr&&(l+=u/2+a.O.y),k+=d+c):b?(null===a.comments?d>B&&(p=Sr(p,d-B,0),k=p.x,l=p.y,B=d,h=0):B=Qr(a,B,h),0>h&&(k-=h,h=0),135<g&&(q+=G+c),G=Math.max(Math.max(G,e),G+e+c),l+=e+c):(135<g&&(h+=B+c),B=Math.max(Math.max(B,d),B+d+c),null===a.comments?e>G&&(p=Sr(p,0,e-G),k=p.x,l=p.y,G=e,q=0):G=Rr(a,G,q),0>q&&(l-=q,q=0),k+=d+c);if(0<Pa)g=Jr(this,4),p=Jr(this,4),b?(g[2].o(0,e+c),g[3].o(g[2].x,G),
  p[2].o(B,g[2].y),p[3].o(p[2].x,g[3].y)):(g[2].o(d+c,0),g[3].o(B,g[2].y),p[2].o(g[2].x,G),p[3].o(g[3].x,p[2].y));else{g=Jr(this,M.length+2);p=Jr(this,X.length+2);for(m=0;m<M.length;m++)r=M[m],g[m+2].o(r.x+k,r.y+l);for(m=0;m<X.length;m++)r=X[m],p[m+2].o(r.x+k,r.y+l)}b?(g[0].o(h,0),g[1].o(g[0].x,e),g[2].y<g[1].y&&(g[2].x>g[0].x?g[2].assign(g[1]):g[1].assign(g[2])),g[3].y<g[2].y&&(g[3].x>g[0].x?g[3].assign(g[2]):g[2].assign(g[3])),p[0].o(h+d,0),p[1].o(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])),g[2].y-=c/2,p[2].y-=c/2):(g[0].o(0,q),g[1].o(d,g[0].y),g[2].x<g[1].x&&(g[2].y>g[0].y?g[2].assign(g[1]):g[1].assign(g[2])),g[3].x<g[2].x&&(g[3].y>g[0].y?g[3].assign(g[2]):g[2].assign(g[3])),p[0].o(0,q+e),p[1].o(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])),g[2].x-=c/2,p[2].x-=c/2);Tr(this,M);Tr(this,X);a.Dt=g;a.Vt=p;
  a.La.o(h,q);a.cb.o(B,G)}break;default:w.m("Unhandled compaction value "+a.compaction.toString())}}};
  function Ar(a,b){t&&w.l(b,Zq,Y,"layoutTreeNone:v");if(0===b.Jm){var c=!1,d=0,e=sr;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=tr(e));e=yr(b);b.ma.o(0,0);b.cb.o(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.La.o(0,0):180===d&&!c||(90===d||270===d)&&e?b.La.o(b.width-2*b.O.x,0):b.La.o(0,b.height-2*b.O.y)}else{for(var c=Cr(b),d=90===c||270===c,g=0,e=b.children,h=e.length,k=0;k<h;k++)var l=e[k],g=Math.max(g,d?l.cb.width:l.cb.height);var m=b.alignment,n=
  m===Dr,p=m===Er,q=tr(m),r=Math.max(0,b.breadthLimit),s=Fr(b),u=b.nodeSpacing,v=Gr(b),A=n||p?0:v/2,E=b.rowSpacing,B=0;if(n||p||b.Mp||b.Np&&1===b.maxGenerationCount)B=Math.max(0,b.rowIndent);var n=b.width,G=b.height,O=0,M=0,X=0,ja=0,V=0,Q=0,ca=0,Pa=0,Ha=0,Wa=0;q&&!xr(m)&&135<c&&e.reverse();if(xr(m))if(1<h)for(k=0;k<h;k++){var l=e[k],Aa=l.cb;0===k%2&&k!==h-1?Ha=Math.max(Ha,(d?Aa.width:Aa.height)+Ur(l)-u):0!==k%2&&(Wa=Math.max(Wa,(d?Aa.width:Aa.height)+Ur(l)-u))}else 1===h&&(Ha=d?e[0].cb.width:e[0].cb.height);
  if(q)switch(m){case ur:case jr:M=135>c?Hr(b,e,Ha,O,M):Ir(b,e,Ha,O,M);Ha=M.x;O=M.width;M=M.height;break;case vr:for(k=0;k<h;k++)l=e[k],Aa=l.cb,r=0===ca?0:E,d?(l.ma.o(g-Aa.width,V+r),O=Math.max(O,Aa.width),M=Math.max(M,V+r+Aa.height),V+=r+Aa.height):(l.ma.o(ja+r,g-Aa.height),O=Math.max(O,ja+r+Aa.width),M=Math.max(M,Aa.height),ja+=r+Aa.width),ca++;break;case wr:for(g=0;g<h;g++)l=e[g],Aa=l.cb,r=0===ca?0:E,d?(l.ma.o(u/2+b.O.x,V+r),O=Math.max(O,Aa.width),M=Math.max(M,V+r+Aa.height),V+=r+Aa.height):(l.ma.o(ja+
  r,u/2+b.O.y),O=Math.max(O,ja+r+Aa.width),M=Math.max(M,Aa.height),ja+=r+Aa.width),ca++}else for(k=0;k<h;k++)l=e[k],Aa=l.cb,d?(0<r&&0<ca&&ja+u+Aa.width>r&&(ja<g&&Kr(b,m,g-ja,0,Pa,k-1),Q++,ca=0,Pa=k,X=M,ja=0,V=135<c?-M-E:M+E),Wa=0===ca?A:u,Lr(a,l,0,V),l.ma.o(ja+Wa,V),O=Math.max(O,ja+Wa+Aa.width),M=Math.max(M,X+(0===Q?0:E)+Aa.height),ja+=Wa+Aa.width):(0<r&&0<ca&&V+u+Aa.height>r&&(V<g&&Kr(b,m,0,g-V,Pa,k-1),Q++,ca=0,Pa=k,X=O,V=0,ja=135<c?-O-E:O+E),Wa=0===ca?A:u,Lr(a,l,ja,0),l.ma.o(ja,V+Wa),M=Math.max(M,
  V+Wa+Aa.height),O=Math.max(O,X+(0===Q?0:E)+Aa.width),V+=Wa+Aa.height),ca++;0<Q&&(d?(M+=Math.max(0,s),ja<O&&Kr(b,m,O-ja,0,Pa,h-1),0<B&&(p||Nr(b,B,0,0,h-1),O+=B)):(O+=Math.max(0,s),V<M&&Kr(b,m,0,M-V,Pa,h-1),0<B&&(p||Nr(b,0,B,0,h-1),M+=B)));B=p=0;switch(m){case Pr:d?p+=O/2-b.O.x-v/2:B+=M/2-b.O.y-v/2;break;case sr:0<Q?d?p+=O/2-b.O.x-v/2:B+=M/2-b.O.y-v/2:d?(m=e[0].ma.x+e[0].La.x,u=e[h-1].ma.x+e[h-1].La.x+2*e[h-1].O.x,p+=m+(u-m)/2-b.O.x-v/2):(m=e[0].ma.y+e[0].La.y,u=e[h-1].ma.y+e[h-1].La.y+2*e[h-1].O.y,
  B+=m+(u-m)/2-b.O.y-v/2);break;case Dr:d?(p-=v,O+=v):(B-=v,M+=v);break;case Er:d?(p+=O-b.width+v,O+=v):(B+=M-b.height+v,M+=v);break;case ur:case jr:d?p=1<h?p+(Ha+u/2-b.O.x):p+(e[0].O.x-b.O.x+e[0].La.x):B=1<h?B+(Ha+u/2-b.O.y):B+(e[0].O.y-b.O.y+e[0].La.y);break;case vr:d?p+=O+u/2-b.O.x:B+=M+u/2-b.O.y;break;case wr:break;default:w.m("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.ma.o(l.ma.x+l.La.x-p,l.ma.y+(135<c?(q?-M:-l.cb.height)+l.La.y-s:G+s+l.La.y)):l.ma.o(l.ma.x+(135<c?(q?
  -O:-l.cb.width)+l.La.x-s:n+s+l.La.x),l.ma.y+l.La.y-B);d?(O=Qr(b,O,p),0>p&&(p=0),135<c&&(B+=M+s),M+=G+s):(135<c&&(p+=O+s),O+=n+s,M=Rr(b,M,B),0>B&&(B=0));b.La.o(p,B);b.cb.o(O,M)}}
  function Hr(a,b,c,d,e){t&&w.l(a,Zq,Y,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return new y(c,0,d,e);if(1===g){var h=b[0];d=h.cb.width;e=h.cb.height;return new y(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Cr(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.cb,u=0===n?0:l;if(m){var v=Ur(h)-k;h.ma.o(c-(s.width+v),q+u);d=Math.max(d,s.width+v);e=Math.max(e,q+u+s.height);q+=u+s.height}else v=Ur(h)-k,h.ma.o(p+u,c-(s.height+v)),e=Math.max(e,s.height+v),d=Math.max(d,
  p+u+s.width),p+=u+s.width;n++}var n=0,A=p,E=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.cb,u=0===n?0:l,m?(v=Ur(h)-k,h.ma.o(p+v,q+u),d=Math.max(d,p+s.width+v),e=Math.max(e,q+u+s.height),q+=u+s.height):(v=Ur(h)-k,h.ma.o(p+u,q+v),d=Math.max(d,p+u+s.width),e=Math.max(e,q+s.height+v),p+=u+s.width),n++);1<g&&1===g%2&&(h=b[g-1],s=h.cb,b=$r(h,m?Math.max(Math.abs(E),Math.abs(q)):Math.max(Math.abs(A),Math.abs(p))),m?(h.ma.o(c+k/2-h.O.x-h.La.x,e+b),m=c+k/2-h.O.x-h.La.x,d=Math.max(d,m+s.width),
  0>m&&(d-=m),e=Math.max(e,Math.max(E,q)+b+s.height),0>h.ma.x&&(c=as(a,h.ma.x,!1,c,k))):(h.ma.o(d+b,c+k/2-h.O.y-h.La.y),d=Math.max(d,Math.max(A,p)+b+s.width),m=c+k/2-h.O.y-h.La.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.ma.y&&(c=as(a,h.ma.y,!0,c,k))));return new y(c,0,d,e)}
  function Ir(a,b,c,d,e){t&&w.l(a,Zq,Y,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return new y(c,0,d,e);if(1===g){var h=b[0];d=h.cb.width;e=h.cb.height;return new y(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Cr(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.cb,u=0===n?0:l;if(m){var v=Ur(h)-k,q=q-(u+s.height);h.ma.o(c-(s.width+v),q);d=Math.max(d,s.width+v);e=Math.max(e,Math.abs(q))}else v=Ur(h)-k,p-=u+s.width,h.ma.o(p,c-(s.height+v)),e=Math.max(e,s.height+
  v),d=Math.max(d,Math.abs(p));n++}var n=0,A=p,E=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.cb,u=0===n?0:l,m?(v=Ur(h)-k,q-=u+s.height,h.ma.o(p+v,q),d=Math.max(d,p+s.width+v),e=Math.max(e,Math.abs(q))):(v=Ur(h)-k,p-=u+s.width,h.ma.o(p,q+v),e=Math.max(e,q+s.height+v),d=Math.max(d,Math.abs(p))),n++);1<g&&1===g%2&&(h=b[g-1],s=h.cb,l=$r(h,m?Math.max(Math.abs(E),Math.abs(q)):Math.max(Math.abs(A),Math.abs(p))),m?(h.ma.o(c+k/2-h.O.x-h.La.x,-e-s.height-l),p=c+k/2-h.O.x-h.La.x,d=Math.max(d,
  p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(E,q))+l+s.height),0>h.ma.x&&(c=as(a,h.ma.x,!1,c,k))):(h.ma.o(-d-s.width-l,c+k/2-h.O.y-h.La.y),d=Math.max(d,Math.abs(Math.min(A,p))+l+s.width),p=c+k/2-h.O.y-h.La.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.ma.y&&(c=as(a,h.ma.y,!0,c,k))));for(r=0;r<g;r++)h=b[r],m?h.ma.o(h.ma.x,h.ma.y+e):h.ma.o(h.ma.x+d,h.ma.y);return new y(c,0,d,e)}function Ur(a){t&&w.l(a,Zq,Y,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing}
  function $r(a){t&&w.l(a,Zq,Y,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function as(a,b,c,d,e){t&&w.l(a,Zq,Y,"fixRelativePostions:v");a=a.children;for(var g=a.length,h=0;h<g;h++)c?a[h].ma.o(a[h].ma.x,a[h].ma.y-b):a[h].ma.o(a[h].ma.x-b,a[h].ma.y);b=a[g-1];return Math.max(d,c?b.La.y+b.O.y-e/2:b.La.x+b.O.x-e/2)}
  function Qr(a,b,c){t&&w.l(a,Zq,Y,"calculateSubwidth:v");switch(a.alignment){case sr:case Pr:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case Dr:return a.width>b?a.width:b;case Er:return 2*a.O.x>b?a.width:b+a.width-2*a.O.x;case ur:case jr:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case vr:return a.width-a.O.x+a.nodeSpacing/2+b;case wr:return Math.max(a.width,a.O.x+a.nodeSpacing/2+b);default:return b}}
  function Rr(a,b,c){t&&w.l(a,Zq,Y,"calculateSubheight:v");switch(a.alignment){case sr:case Pr:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case Dr:return a.height>b?a.height:b;case Er:return 2*a.O.y>b?a.height:b+a.height-2*a.O.y;case ur:case jr:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case vr:return a.height-a.O.y+a.nodeSpacing/2+b;case wr:return Math.max(a.height,a.O.y+a.nodeSpacing/2+b);default:return b}}
  function Sr(a,b,c){t&&w.l(a,ba,Y,"alignOffset:align");switch(a){case Pr:b/=2;c/=2;break;case sr:b/=2;c/=2;break;case Dr:c=b=0;break;case Er:break;default:w.m("Unhandled alignment value "+a.toString())}return new x(b,c)}function Kr(a,b,c,d,e,g){t&&w.l(a,Zq,Y,"shiftRelPosAlign:v");t&&w.l(b,ba,Y,"shiftRelPosAlign:align");b=Sr(b,c,d);Nr(a,b.x,b.y,e,g)}function Nr(a,b,c,d,e){t&&w.l(a,Zq,Y,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].ma;g.x+=b;g.y+=c}}
  function Lr(a,b,c,d){t&&(w.l(b,Zq,Y,"recordMidPoints:v"),w.i(c,"number",Y,"recordMidPoints:x"),w.i(d,"number",Y,"recordMidPoints:y"));var e=b.parent;switch(a.Hf){case Vq:for(a=b.rc;a.next();)b=a.value,b.fromVertex===e&&b.cs.o(c,d);break;case br:for(a=b.fc;a.next();)b=a.value,b.toVertex===e&&b.cs.o(c,d);break;default:w.m("Unhandled path value "+a.Hf.toString())}}function Or(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
  function Mr(a,b,c,d,e,g,h,k){t&&w.l(b,Zq,Y,"mergeFringes:parent");t&&w.l(c,Zq,Y,"mergeFringes:child");var l=Cr(b),m=90===l||270===l,n=b.nodeSpacing;b=d;var p=e;d=g;e=h;var q=c.Dt,r=c.Vt;h=c.cb;var s=m?Math.max(e,h.height):Math.max(d,h.width);if(null===q||l!==Cr(c))q=Jr(a,2),r=Jr(a,2),m?(q[0].o(0,0),q[1].o(0,h.height),r[0].o(h.width,0),r[1].o(r[0].x,q[1].y)):(q[0].o(0,0),q[1].o(h.width,0),r[0].o(0,h.height),r[1].o(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 u=q[m];g=u.x;var v=u.y;g+=c;var A=e;l+1<p.length&&(A=p[l+1]);var E=u,u=E.x,E=E.y;m+1<q.length&&(E=q[m+1],u=E.x,E=E.y,u+=c);var B=d;e.y===v?B=g-e.x:e.y>v&&e.y<E?B=g+(e.y-v)/(E-v)*(u-g)-e.x:v>e.y&&v<A.y&&(B=g-(e.x+(v-e.y)/(A.y-e.y)*(A.x-e.x)));B<d&&(d=B);A.y<=e.y?l++:E<=v?m++:(A.y<=E&&l++,E<=A.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=Jr(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].y<b[0].y;)v=l[g++],n[d++].o(v.x+
  m,v.y);for(;e<b.length;)v=b[e++],n[d++].o(v.x,v.y);for(e=b[b.length-1].y;g<l.length&&l[g].y<=e;)g++;for(;g<l.length&&l[g].y>e;)v=l[g++],n[d++].o(v.x+m,v.y);l=Jr(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);Tr(a,n);d=l}g=r;v=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=Jr(a,p.length+g.length);for(m=A=l=0;l<p.length&&p[l].y<g[0].y;)e=p[l++],n[m++].o(e.x,e.y);for(;A<g.length;)e=g[A++],n[m++].o(e.x+v,e.y);for(g=g[g.length-1].y;l<p.length&&p[l].y<=g;)l++;for(;l<p.length&&p[l].y>g;)e=p[l++],
  n[m++].o(e.x,e.y);e=Jr(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);Tr(a,n)}g=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],u=q[m],g=u.x,v=u.y,v+=c,A=e,l+1<p.length&&(A=p[l+1]),E=u,u=E.x,E=E.y,m+1<q.length&&(E=q[m+1],u=E.x,E=E.y,E+=c),B=d,e.x===g?B=v-e.y:e.x>g&&e.x<u?B=v+(e.x-g)/(u-g)*(E-v)-e.y:g>e.x&&g<A.x&&(B=v-(e.y+(g-e.x)/(A.x-e.x)*(A.y-e.y))),B<d&&(d=B),A.x<=e.x?l++:u<=g?m++:(A.x<=u&&l++,u<=A.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=Jr(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].x<b[0].x;)v=l[g++],n[d++].o(v.x,v.y+m);for(;e<b.length;)v=b[e++],n[d++].o(v.x,v.y);for(e=b[b.length-1].x;g<l.length&&l[g].x<=e;)g++;for(;g<l.length&&l[g].x>e;)v=l[g++],n[d++].o(v.x,v.y+m);l=Jr(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);Tr(a,n);d=l}g=r;v=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=Jr(a,p.length+g.length);for(m=A=l=0;l<p.length&&p[l].x<g[0].x;)e=p[l++],
  n[m++].o(e.x,e.y);for(;A<g.length;)e=g[A++],n[m++].o(e.x,e.y+v);for(g=g[g.length-1].x;l<p.length&&p[l].x<=g;)l++;for(;l<p.length&&p[l].x>g;)e=p[l++],n[m++].o(e.x,e.y);e=Jr(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);Tr(a,n)}g=s;h=Math.max(0,c)+h.height}Tr(a,b);Tr(a,q);Tr(a,p);Tr(a,r);k[0]=d;k[1]=e;return new y(c,0,g,h)}function Jr(a,b){var c=a.uz[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new x;return c}
  function Tr(a,b){var c=b.length,d=a.uz[c];void 0===d&&(d=[],a.uz[c]=d);d.push(b)}
  Y.prototype.arrangeTrees=function(){if(this.bd===ar)for(var a=this.rd.k;a.next();){var b=a.value;if(b instanceof Zq){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);bs(this,b,c,d)}}}else for(a=this.Gd,b=a.x,c=a.y,a=this.rd.k;a.next();)if(d=a.value,d instanceof Zq)switch(bs(this,d,b+d.La.x,c+d.La.y),this.bd){case Yq:c+=d.cb.height+this.cg.height;break;case cs:b+=d.cb.width+this.cg.width;break;default:w.m("Unhandled arrangement value "+this.bd.toString())}};
  function bs(a,b,c,d){if(null!==b){t&&w.l(b,Zq,Y,"assignAbsolutePositions:v");b.x=c;b.y=d;b=b.children;for(var e=b.length,g=0;g<e;g++){var h=b[g];bs(a,h,c+h.ma.x,d+h.ma.y)}}}Y.prototype.commitLayout=function(){this.iB();this.commitNodes();this.Tz();this.Bt&&this.commitLinks()};Y.prototype.commitNodes=function(){for(var a=this.network.vertexes.k;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
  Y.prototype.Tz=function(){if(this.gx===gr){for(var a=this.JB,b=[],c=null,d=this.network.vertexes.k;d.next();){var e=d.value;null===c?c=e.kb.copy():c.$h(e.kb);var g=b[e.level],g=void 0===g?Fr(e):Math.max(g,Fr(e));b[e.level]=g}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.Sf(this.nodeSpacing/2,this.layerSpacing),e=new x(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.Sf(this.layerSpacing,this.nodeSpacing/2),e=new x(-this.layerSpacing/2,-this.nodeSpacing/2));var g=
  [],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,g.push(new y(0,h,c,k))):90===this.angle?(g.push(new y(0,h,c,k)),h+=k):180===this.angle?(h-=k,g.push(new y(h,0,k,c))):(g.push(new y(h,0,k,c)),h+=k)}this.commitLayers(g,e)}};Y.prototype.commitLayers=function(){};Y.prototype.commitLinks=function(){for(var a=this.network.edges.k;a.next();)a.value.commit()};
  Y.prototype.iB=function(){for(var a=this.rd.k;a.next();){var b=a.value;b instanceof Zq&&ds(this,b)}};function ds(a,b){if(null!==b){t&&w.l(b,Zq,Y,"setPortSpotsTree:v");a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)ds(a,c[e])}}
  Y.prototype.setPortSpots=function(a){t&&w.l(a,Zq,Y,"setPortSpots:v");var b=a.alignment;if(tr(b)){t&&w.l(a,Zq,Y,"setPortSpotsBus:v");t&&w.l(b,ba,Y,"setPortSpots:align");var c=this.Hf===Vq,d=Cr(a),e;switch(d){case 0:e=Cc;break;case 90:e=Dc;break;case 180:e=Bc;break;default:e=Ac}var g=a.children,h=g.length;switch(b){case ur:case jr:for(b=0;b<h;b++){var k=g[b],k=(c?k.rc:k.fc).first();if(null!==k&&(k=k.link,null!==k)){var l=90===d||270===d?Bc:Ac;if(1===h||b===h-1&&1===h%2)switch(d){case 0:l=Bc;break;case 90:l=
  Ac;break;case 180:l=Cc;break;default:l=Dc}else 0===b%2&&(l=90===d||270===d?Cc:Dc);c?(a.setsPortSpot&&(k.wb=e),a.setsChildPortSpot&&(k.yb=l)):(a.setsPortSpot&&(k.wb=l),a.setsChildPortSpot&&(k.yb=e))}}break;case vr:l=90===d||270===d?Cc:Dc;for(d=c?a.fc:a.rc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.wb=e),a.setsChildPortSpot&&(k.yb=l)):(a.setsPortSpot&&(k.wb=l),a.setsChildPortSpot&&(k.yb=e)));break;case wr:for(l=90===d||270===d?Bc:Ac,d=c?a.fc:a.rc;d.next();)k=d.value.link,null!==k&&(c?
  (a.setsPortSpot&&(k.wb=e),a.setsChildPortSpot&&(k.yb=l)):(a.setsPortSpot&&(k.wb=l),a.setsChildPortSpot&&(k.yb=e)))}}else if(c=Cr(a),this.Hf===Vq)for(e=a.fc;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Pc())switch(c){case 0:d.wb=Cc;break;case 90:d.wb=Dc;break;case 180:d.wb=Bc;break;default:d.wb=Ac}else d.wb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Pc())switch(c){case 0:d.yb=Bc;break;case 90:d.yb=Ac;break;case 180:d.yb=Cc;break;default:d.yb=Dc}else d.yb=a.childPortSpot}}else for(e=
  a.rc;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Pc())switch(c){case 0:d.yb=Cc;break;case 90:d.yb=Dc;break;case 180:d.yb=Bc;break;default:d.yb=Ac}else d.yb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Pc())switch(c){case 0:d.wb=Bc;break;case 90:d.wb=Ac;break;case 180:d.wb=Cc;break;default:d.wb=Dc}else d.wb=a.childPortSpot}};function Cr(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
  function Fr(a){t&&w.l(a,Zq,Y,"computeLayerSpacing:v");var b=Cr(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 Gr(a){t&&w.l(a,Zq,Y,"computeNodeIndent:v");var b=Cr(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)}
  w.g(Y,"roots",Y.prototype.OJ);w.defineProperty(Y,{OJ:"roots"},function(){return this.rd},function(a){this.rd!==a&&(w.l(a,F,Y,"roots"),this.rd=a,this.K())});w.g(Y,"path",Y.prototype.path);w.defineProperty(Y,{path:"path"},function(){return this.Vr},function(a){this.Vr!==a&&(w.za(a,Y,Y,"path"),this.Vr=a,this.K())});w.g(Y,"treeStyle",Y.prototype.UG);
  w.defineProperty(Y,{UG:"treeStyle"},function(){return this.Ls},function(a){this.bd!==a&&(w.za(a,Y,Y,"treeStyle"),a===Wq||a===mr||a===nr||a===lr)&&(this.Ls=a,this.K())});w.g(Y,"layerStyle",Y.prototype.gx);w.defineProperty(Y,{gx:"layerStyle"},function(){return this.mv},function(a){this.bd!==a&&(w.za(a,Y,Y,"layerStyle"),a===Xq||a===hr||a===gr)&&(this.mv=a,this.K())});w.g(Y,"comments",Y.prototype.comments);
  w.defineProperty(Y,{comments:"comments"},function(){return this.ph},function(a){this.ph!==a&&(w.i(a,"boolean",Y,"comments"),this.ph=a,this.K())});w.g(Y,"arrangement",Y.prototype.Ge);w.defineProperty(Y,{Ge:"arrangement"},function(){return this.bd},function(a){this.bd!==a&&(w.za(a,Y,Y,"arrangement"),a===Yq||a===cs||a===ar)&&(this.bd=a,this.K())});w.g(Y,"arrangementSpacing",Y.prototype.kw);
  w.defineProperty(Y,{kw:"arrangementSpacing"},function(){return this.cg},function(a){w.l(a,fa,Y,"arrangementSpacing");this.cg.L(a)||(this.cg.assign(a),this.K())});w.g(Y,"rootDefaults",Y.prototype.NJ);w.defineProperty(Y,{NJ:"rootDefaults"},function(){return this.va},function(a){this.va!==a&&(w.l(a,Zq,Y,"rootDefaults"),this.va=a,this.K())});w.g(Y,"alternateDefaults",Y.prototype.RH);
  w.defineProperty(Y,{RH:"alternateDefaults"},function(){return this.ua},function(a){this.ua!==a&&(w.l(a,Zq,Y,"alternateDefaults"),this.ua=a,this.K())});w.g(Y,"sorting",Y.prototype.sorting);w.defineProperty(Y,{sorting:"sorting"},function(){return this.va.sorting},function(a){this.va.sorting!==a&&(w.za(a,Y,Y,"sorting"),a===or||a===pr||a===qr||rr)&&(this.va.sorting=a,this.K())});w.g(Y,"comparer",Y.prototype.comparer);
  w.defineProperty(Y,{comparer:"comparer"},function(){return this.va.comparer},function(a){this.va.comparer!==a&&(w.i(a,"function",Y,"comparer"),this.va.comparer=a,this.K())});w.g(Y,"angle",Y.prototype.angle);w.defineProperty(Y,{angle:"angle"},function(){return this.va.angle},function(a){this.va.angle!==a&&(w.i(a,"number",Y,"angle"),0===a||90===a||180===a||270===a)&&(this.va.angle=a,this.K())});w.g(Y,"alignment",Y.prototype.alignment);
  w.defineProperty(Y,{alignment:"alignment"},function(){return this.va.alignment},function(a){this.va.alignment!==a&&(w.za(a,Y,Y,"alignment"),this.va.alignment=a,this.K())});w.g(Y,"nodeIndent",Y.prototype.nodeIndent);w.defineProperty(Y,{nodeIndent:"nodeIndent"},function(){return this.va.nodeIndent},function(a){this.va.nodeIndent!==a&&(w.i(a,"number",Y,"nodeIndent"),0<=a&&(this.va.nodeIndent=a,this.K()))});w.g(Y,"nodeIndentPastParent",Y.prototype.nodeIndentPastParent);
  w.defineProperty(Y,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.va.nodeIndentPastParent},function(a){this.va.nodeIndentPastParent!==a&&(w.i(a,"number",Y,"nodeIndentPastParent"),0<=a&&1>=a&&(this.va.nodeIndentPastParent=a,this.K()))});w.g(Y,"nodeSpacing",Y.prototype.nodeSpacing);w.defineProperty(Y,{nodeSpacing:"nodeSpacing"},function(){return this.va.nodeSpacing},function(a){this.va.nodeSpacing!==a&&(w.i(a,"number",Y,"nodeSpacing"),this.va.nodeSpacing=a,this.K())});
  w.g(Y,"layerSpacing",Y.prototype.layerSpacing);w.defineProperty(Y,{layerSpacing:"layerSpacing"},function(){return this.va.layerSpacing},function(a){this.va.layerSpacing!==a&&(w.i(a,"number",Y,"layerSpacing"),this.va.layerSpacing=a,this.K())});w.g(Y,"layerSpacingParentOverlap",Y.prototype.layerSpacingParentOverlap);
  w.defineProperty(Y,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.va.layerSpacingParentOverlap},function(a){this.va.layerSpacingParentOverlap!==a&&(w.i(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.va.layerSpacingParentOverlap=a,this.K()))});w.g(Y,"compaction",Y.prototype.compaction);
  w.defineProperty(Y,{compaction:"compaction"},function(){return this.va.compaction},function(a){this.va.compaction!==a&&(w.za(a,Y,Y,"compaction"),a===zr||a===Br)&&(this.va.compaction=a,this.K())});w.g(Y,"breadthLimit",Y.prototype.breadthLimit);w.defineProperty(Y,{breadthLimit:"breadthLimit"},function(){return this.va.breadthLimit},function(a){this.va.breadthLimit!==a&&(w.i(a,"number",Y,"breadthLimit"),0<=a&&(this.va.breadthLimit=a,this.K()))});w.g(Y,"rowSpacing",Y.prototype.rowSpacing);
  w.defineProperty(Y,{rowSpacing:"rowSpacing"},function(){return this.va.rowSpacing},function(a){this.va.rowSpacing!==a&&(w.i(a,"number",Y,"rowSpacing"),this.va.rowSpacing=a,this.K())});w.g(Y,"rowIndent",Y.prototype.rowIndent);w.defineProperty(Y,{rowIndent:"rowIndent"},function(){return this.va.rowIndent},function(a){this.va.rowIndent!==a&&(w.i(a,"number",Y,"rowIndent"),0<=a&&(this.va.rowIndent=a,this.K()))});w.g(Y,"commentSpacing",Y.prototype.commentSpacing);
  w.defineProperty(Y,{commentSpacing:"commentSpacing"},function(){return this.va.commentSpacing},function(a){this.va.commentSpacing!==a&&(w.i(a,"number",Y,"commentSpacing"),this.va.commentSpacing=a,this.K())});w.g(Y,"commentMargin",Y.prototype.commentMargin);w.defineProperty(Y,{commentMargin:"commentMargin"},function(){return this.va.commentMargin},function(a){this.va.commentMargin!==a&&(w.i(a,"number",Y,"commentMargin"),this.va.commentMargin=a,this.K())});w.g(Y,"setsPortSpot",Y.prototype.setsPortSpot);
  w.defineProperty(Y,{setsPortSpot:"setsPortSpot"},function(){return this.va.setsPortSpot},function(a){this.va.setsPortSpot!==a&&(w.i(a,"boolean",Y,"setsPortSpot"),this.va.setsPortSpot=a,this.K())});w.g(Y,"portSpot",Y.prototype.portSpot);w.defineProperty(Y,{portSpot:"portSpot"},function(){return this.va.portSpot},function(a){w.l(a,K,Y,"portSpot");this.va.portSpot.L(a)||(this.va.portSpot=a,this.K())});w.g(Y,"setsChildPortSpot",Y.prototype.setsChildPortSpot);
  w.defineProperty(Y,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.va.setsChildPortSpot},function(a){this.va.setsChildPortSpot!==a&&(w.i(a,"boolean",Y,"setsChildPortSpot"),this.va.setsChildPortSpot=a,this.K())});w.g(Y,"childPortSpot",Y.prototype.childPortSpot);w.defineProperty(Y,{childPortSpot:"childPortSpot"},function(){return this.va.childPortSpot},function(a){w.l(a,K,Y,"childPortSpot");this.va.childPortSpot.L(a)||(this.va.childPortSpot=a,this.K())});w.g(Y,"alternateSorting",Y.prototype.bI);
  w.defineProperty(Y,{bI:"alternateSorting"},function(){return this.ua.sorting},function(a){this.ua.sorting!==a&&(w.za(a,Y,Y,"alternateSorting"),a===or||a===pr||a===qr||rr)&&(this.ua.sorting=a,this.K())});w.g(Y,"alternateComparer",Y.prototype.QH);w.defineProperty(Y,{QH:"alternateComparer"},function(){return this.ua.comparer},function(a){this.ua.comparer!==a&&(w.i(a,"function",Y,"alternateComparer"),this.ua.comparer=a,this.K())});w.g(Y,"alternateAngle",Y.prototype.KH);
  w.defineProperty(Y,{KH:"alternateAngle"},function(){return this.ua.angle},function(a){this.ua.angle!==a&&(w.i(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.ua.angle=a,this.K())});w.g(Y,"alternateAlignment",Y.prototype.JH);w.defineProperty(Y,{JH:"alternateAlignment"},function(){return this.ua.alignment},function(a){this.ua.alignment!==a&&(w.za(a,Y,Y,"alternateAlignment"),this.ua.alignment=a,this.K())});w.g(Y,"alternateNodeIndent",Y.prototype.UH);
  w.defineProperty(Y,{UH:"alternateNodeIndent"},function(){return this.ua.nodeIndent},function(a){this.ua.nodeIndent!==a&&(w.i(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.ua.nodeIndent=a,this.K()))});w.g(Y,"alternateNodeIndentPastParent",Y.prototype.VH);
  w.defineProperty(Y,{VH:"alternateNodeIndentPastParent"},function(){return this.ua.nodeIndentPastParent},function(a){this.ua.nodeIndentPastParent!==a&&(w.i(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.ua.nodeIndentPastParent=a,this.K()))});w.g(Y,"alternateNodeSpacing",Y.prototype.WH);w.defineProperty(Y,{WH:"alternateNodeSpacing"},function(){return this.ua.nodeSpacing},function(a){this.ua.nodeSpacing!==a&&(w.i(a,"number",Y,"alternateNodeSpacing"),this.ua.nodeSpacing=a,this.K())});
  w.g(Y,"alternateLayerSpacing",Y.prototype.SH);w.defineProperty(Y,{SH:"alternateLayerSpacing"},function(){return this.ua.layerSpacing},function(a){this.ua.layerSpacing!==a&&(w.i(a,"number",Y,"alternateLayerSpacing"),this.ua.layerSpacing=a,this.K())});w.g(Y,"alternateLayerSpacingParentOverlap",Y.prototype.TH);
  w.defineProperty(Y,{TH:"alternateLayerSpacingParentOverlap"},function(){return this.ua.layerSpacingParentOverlap},function(a){this.ua.layerSpacingParentOverlap!==a&&(w.i(a,"number",Y,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.ua.layerSpacingParentOverlap=a,this.K()))});w.g(Y,"alternateCompaction",Y.prototype.PH);
  w.defineProperty(Y,{PH:"alternateCompaction"},function(){return this.ua.compaction},function(a){this.ua.compaction!==a&&(w.za(a,Y,Y,"alternateCompaction"),a===zr||a===Br)&&(this.ua.compaction=a,this.K())});w.g(Y,"alternateBreadthLimit",Y.prototype.LH);w.defineProperty(Y,{LH:"alternateBreadthLimit"},function(){return this.ua.breadthLimit},function(a){this.ua.breadthLimit!==a&&(w.i(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.ua.breadthLimit=a,this.K()))});w.g(Y,"alternateRowSpacing",Y.prototype.ZH);
  w.defineProperty(Y,{ZH:"alternateRowSpacing"},function(){return this.ua.rowSpacing},function(a){this.ua.rowSpacing!==a&&(w.i(a,"number",Y,"alternateRowSpacing"),this.ua.rowSpacing=a,this.K())});w.g(Y,"alternateRowIndent",Y.prototype.YH);w.defineProperty(Y,{YH:"alternateRowIndent"},function(){return this.ua.rowIndent},function(a){this.ua.rowIndent!==a&&(w.i(a,"number",Y,"alternateRowIndent"),0<=a&&(this.ua.rowIndent=a,this.K()))});w.g(Y,"alternateCommentSpacing",Y.prototype.OH);
  w.defineProperty(Y,{OH:"alternateCommentSpacing"},function(){return this.ua.commentSpacing},function(a){this.ua.commentSpacing!==a&&(w.i(a,"number",Y,"alternateCommentSpacing"),this.ua.commentSpacing=a,this.K())});w.g(Y,"alternateCommentMargin",Y.prototype.NH);w.defineProperty(Y,{NH:"alternateCommentMargin"},function(){return this.ua.commentMargin},function(a){this.ua.commentMargin!==a&&(w.i(a,"number",Y,"alternateCommentMargin"),this.ua.commentMargin=a,this.K())});w.g(Y,"alternateSetsPortSpot",Y.prototype.aI);
  w.defineProperty(Y,{aI:"alternateSetsPortSpot"},function(){return this.ua.setsPortSpot},function(a){this.ua.setsPortSpot!==a&&(w.i(a,"boolean",Y,"alternateSetsPortSpot"),this.ua.setsPortSpot=a,this.K())});w.g(Y,"alternatePortSpot",Y.prototype.XH);w.defineProperty(Y,{XH:"alternatePortSpot"},function(){return this.ua.portSpot},function(a){w.l(a,K,Y,"alternatePortSpot");this.ua.portSpot.L(a)||(this.ua.portSpot=a,this.K())});w.g(Y,"alternateSetsChildPortSpot",Y.prototype.$H);
  w.defineProperty(Y,{$H:"alternateSetsChildPortSpot"},function(){return this.ua.setsChildPortSpot},function(a){this.ua.setsChildPortSpot!==a&&(w.i(a,"boolean",Y,"alternateSetsChildPortSpot"),this.ua.setsChildPortSpot=a,this.K())});w.g(Y,"alternateChildPortSpot",Y.prototype.MH);w.defineProperty(Y,{MH:"alternateChildPortSpot"},function(){return this.ua.childPortSpot},function(a){w.l(a,K,Y,"alternateChildPortSpot");this.ua.childPortSpot.L(a)||(this.ua.childPortSpot=a,this.K())});var Uq;
  Y.PathDefault=Uq=w.w(Y,"PathDefault",-1);var Vq;Y.PathDestination=Vq=w.w(Y,"PathDestination",0);var br;Y.PathSource=br=w.w(Y,"PathSource",1);var or;Y.SortingForwards=or=w.w(Y,"SortingForwards",10);var pr;Y.SortingReverse=pr=w.w(Y,"SortingReverse",11);var qr;Y.SortingAscending=qr=w.w(Y,"SortingAscending",12);var rr;Y.SortingDescending=rr=w.w(Y,"SortingDescending",13);var Pr;Y.AlignmentCenterSubtrees=Pr=w.w(Y,"AlignmentCenterSubtrees",20);var sr;
  Y.AlignmentCenterChildren=sr=w.w(Y,"AlignmentCenterChildren",21);var Dr;Y.AlignmentStart=Dr=w.w(Y,"AlignmentStart",22);var Er;Y.AlignmentEnd=Er=w.w(Y,"AlignmentEnd",23);var ur;Y.AlignmentBus=ur=w.w(Y,"AlignmentBus",24);var jr;Y.AlignmentBusBranching=jr=w.w(Y,"AlignmentBusBranching",25);var vr;Y.AlignmentTopLeftBus=vr=w.w(Y,"AlignmentTopLeftBus",26);var wr;Y.AlignmentBottomRightBus=wr=w.w(Y,"AlignmentBottomRightBus",27);var zr;Y.CompactionNone=zr=w.w(Y,"CompactionNone",30);var Br;
  Y.CompactionBlock=Br=w.w(Y,"CompactionBlock",31);var Wq;Y.StyleLayered=Wq=w.w(Y,"StyleLayered",40);var nr;Y.StyleLastParents=nr=w.w(Y,"StyleLastParents",41);var mr;Y.StyleAlternating=mr=w.w(Y,"StyleAlternating",42);var lr;Y.StyleRootOnly=lr=w.w(Y,"StyleRootOnly",43);var Yq;Y.ArrangementVertical=Yq=w.w(Y,"ArrangementVertical",50);var cs;Y.ArrangementHorizontal=cs=w.w(Y,"ArrangementHorizontal",51);var ar;Y.ArrangementFixedRoots=ar=w.w(Y,"ArrangementFixedRoots",52);var Xq;
  Y.LayerIndividual=Xq=w.w(Y,"LayerIndividual",60);var hr;Y.LayerSiblings=hr=w.w(Y,"LayerSiblings",61);var gr;Y.LayerUniform=gr=w.w(Y,"LayerUniform",62);function $q(){ta.call(this)}w.Ia($q,ta);w.ja("TreeNetwork",$q);$q.prototype.createVertex=function(){return new Zq};$q.prototype.createEdge=function(){return new es};
  function Zq(){ua.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.ma=new x(0,0);this.cb=new fa(0,0);this.La=new x(0,0);this.Np=this.Mp=this.PJ=!1;this.Vt=this.Dt=null;this.sorting=or;this.comparer=gp;this.angle=0;this.alignment=sr;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Br;this.breadthLimit=
  0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=zc;this.setsChildPortSpot=!0;this.childPortSpot=zc}w.Ia(Zq,ua);w.ja("TreeVertex",Zq);
  Zq.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)};w.A(Zq,{Jm:"childrenCount"},function(){return this.children.length});w.g(Zq,"relativePosition",Zq.prototype.KJ);w.defineProperty(Zq,{KJ:"relativePosition"},function(){return this.ma},function(a){this.ma.set(a)});w.g(Zq,"subtreeSize",Zq.prototype.cK);w.defineProperty(Zq,{cK:"subtreeSize"},function(){return this.cb},function(a){this.cb.set(a)});
  w.g(Zq,"subtreeOffset",Zq.prototype.bK);w.defineProperty(Zq,{bK:"subtreeOffset"},function(){return this.La},function(a){this.La.set(a)});function es(){va.call(this);this.cs=new x(0,0)}w.Ia(es,va);w.ja("TreeEdge",es);
  es.prototype.commit=function(){var a=this.link;if(null!==a&&!a.Si){var b=this.network.Lb,c=null,d=null;switch(b.Hf){case Vq:c=this.fromVertex;d=this.toVertex;break;case br:c=this.toVertex;d=this.fromVertex;break;default:w.m("Unhandled path value "+b.Hf.toString())}if(null!==c&&null!==d)if(b=this.cs,0!==b.x||0!==b.y||c.PJ){var d=c.kb,e=Cr(c),g=Fr(c),h=c.rowSpacing;a.updateRoute();var k=a.Le===sh,l=a.gc,m=0,n,p;a.Fl();if(l||k){for(m=2;4<a.oa;)a.ZF(2);n=a.n(1);p=a.n(2)}else{for(m=1;3<a.oa;)a.ZF(1);n=
  a.n(0);p=a.n(a.oa-1)}var q=a.n(a.oa-1),r=0;0===e?(c.alignment===Er?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Gr(c))))):c.alignment===Dr?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+Gr(c))))):r=c.Mp||c.Np&&1===c.maxGenerationCount?d.top-c.La.y+b.y:d.y+d.height/2+b.y,k?(a.C(m,n.x,r),m++,a.C(m,d.right+g,r),m++,a.C(m,d.right+g+(b.x-h)/3,r),m++,a.C(m,d.right+g+2*(b.x-h)/3,r),m++,a.C(m,d.right+g+(b.x-h),r),m++,a.C(m,p.x,r)):(l&&(a.C(m,d.right+
  g/2,n.y),m++),a.C(m,d.right+g/2,r),m++,a.C(m,d.right+g+b.x-(l?h/2:h),r),m++,l&&a.C(m,a.n(m-1).x,p.y))):90===e?(c.alignment===Er?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Gr(c))))):c.alignment===Dr?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+Gr(c))))):r=c.Mp||c.Np&&1===c.maxGenerationCount?d.left-c.La.x+b.x:d.x+d.width/2+b.x,k?(a.C(m,r,n.y),m++,a.C(m,r,d.bottom+g),m++,a.C(m,r,d.bottom+g+(b.y-h)/3),m++,a.C(m,r,d.bottom+g+2*(b.y-h)/3),m++,
  a.C(m,r,d.bottom+g+(b.y-h)),m++,a.C(m,r,p.y)):(l&&(a.C(m,n.x,d.bottom+g/2),m++),a.C(m,r,d.bottom+g/2),m++,a.C(m,r,d.bottom+g+b.y-(l?h/2:h)),m++,l&&a.C(m,p.x,a.n(m-1).y))):180===e?(c.alignment===Er?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Gr(c))))):c.alignment===Dr?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+Gr(c))))):r=c.Mp||c.Np&&1===c.maxGenerationCount?d.top-c.La.y+b.y:d.y+d.height/2+b.y,k?(a.C(m,n.x,r),m++,a.C(m,d.left-g,r),m++,a.C(m,
  d.left-g+(b.x+h)/3,r),m++,a.C(m,d.left-g+2*(b.x+h)/3,r),m++,a.C(m,d.left-g+(b.x+h),r),m++,a.C(m,p.x,r)):(l&&(a.C(m,d.left-g/2,n.y),m++),a.C(m,d.left-g/2,r),m++,a.C(m,d.left-g+b.x+(l?h/2:h),r),m++,l&&a.C(m,a.n(m-1).x,p.y))):270===e?(c.alignment===Er?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Gr(c))))):c.alignment===Dr?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+Gr(c))))):r=c.Mp||c.Np&&1===c.maxGenerationCount?d.left-c.La.x+b.x:d.x+d.width/
  2+b.x,k?(a.C(m,r,n.y),m++,a.C(m,r,d.top-g),m++,a.C(m,r,d.top-g+(b.y+h)/3),m++,a.C(m,r,d.top-g+2*(b.y+h)/3),m++,a.C(m,r,d.top-g+(b.y+h)),m++,a.C(m,r,p.y)):(l&&(a.C(m,n.x,d.top-g/2),m++),a.C(m,r,d.top-g/2),m++,a.C(m,r,d.top-g+b.y+(l?h/2:h)),m++,l&&a.C(m,p.x,a.n(m-1).y))):w.m("Invalid angle "+e);a.Li()}else e=c,g=d,t&&w.l(e,Zq,es,"adjustRouteForAngleChange:parent"),t&&w.l(g,Zq,es,"adjustRouteForAngleChange:child"),a=this.link,c=Cr(e),c!==Cr(g)&&(b=Fr(e),d=e.kb,e=g.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.Le===sh,g=a.gc,h=tr(this.fromVertex.alignment),a.Fl(),0===c?(c=d.right+b/2,e?4===a.oa&&(b=a.n(3).y,a.aa(1,c-20,a.n(1).y),a.C(2,c-20,b),a.C(3,c,b),a.C(4,c+20,b),a.aa(5,a.n(5).x,b)):g?h?a.aa(3,a.n(2).x,a.n(4).y):6===a.oa&&(a.aa(2,c,a.n(2).y),a.aa(3,c,a.n(3).y)):4===a.oa?a.C(2,c,a.n(2).y):3===a.oa?a.aa(1,c,a.n(2).y):2===a.oa&&a.C(1,c,a.n(1).y)):90===c?(b=d.bottom+b/2,e?4===a.oa&&(c=a.n(3).x,a.aa(1,a.n(1).x,
  b-20),a.C(2,c,b-20),a.C(3,c,b),a.C(4,c,b+20),a.aa(5,c,a.n(5).y)):g?h?a.aa(3,a.n(2).x,a.n(4).y):6===a.oa&&(a.aa(2,a.n(2).x,b),a.aa(3,a.n(3).x,b)):4===a.oa?a.C(2,a.n(2).x,b):3===a.oa?a.aa(1,a.n(2).x,b):2===a.oa&&a.C(1,a.n(1).x,b)):180===c?(c=d.left-b/2,e?4===a.oa&&(b=a.n(3).y,a.aa(1,c+20,a.n(1).y),a.C(2,c+20,b),a.C(3,c,b),a.C(4,c-20,b),a.aa(5,a.n(5).x,b)):g?h?a.aa(3,a.n(2).x,a.n(4).y):6===a.oa&&(a.aa(2,c,a.n(2).y),a.aa(3,c,a.n(3).y)):4===a.oa?a.C(2,c,a.n(2).y):3===a.oa?a.aa(1,c,a.n(2).y):2===a.oa&&
  a.C(1,c,a.n(1).y)):270===c&&(b=d.top-b/2,e?4===a.oa&&(c=a.n(3).x,a.aa(1,a.n(1).x,b+20),a.C(2,c,b+20),a.C(3,c,b),a.C(4,c,b-20),a.aa(5,c,a.n(5).y)):g?h?a.aa(3,a.n(2).x,a.n(4).y):6===a.oa&&(a.aa(2,a.n(2).x,b),a.aa(3,a.n(3).x,b)):4===a.oa?a.C(2,a.n(2).x,b):3===a.oa?a.aa(1,a.n(2).x,b):2===a.oa&&a.C(1,a.n(1).x,b)),a.Li()))}};w.g(es,"relativePoint",es.prototype.JJ);w.defineProperty(es,{JJ:"relativePoint"},function(){return this.cs},function(a){this.cs.set(a)});function fs(){this.Un=[]}
  function Tl(a){var b=new fs,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"),g=c.getElementsByTagName("radialGradient");for(a=0;a<e.length;a++){for(var h=e[a],k=Ul(ea,Be,{start:Jc,end:Kc}),
  l=h.childNodes,m=0;m<l.length;m++)if("stop"===l[m].tagName){var n=gs(b,l[m],"stop-color");if(null!==n&&""!==n){var p=gs(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<g.length;a++){h=g[a];k=Ul(ea,Ce,{start:Ob,end:Ob});l=h.childNodes;for(m=0;m<l.length;m++)if("stop"===l[m].tagName&&(n=gs(b,l[m],"stop-color"),null!==n&&""!==n)){p=gs(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,g=c.getElementsByTagName("use"),a=0;a<g.length;a++)k=g[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))));hs(b,d,null);c=new z;if(0===b.Un.length)return c;if(1===b.Un.length)return b.Un[0];for(a=0;a<b.Un.length;a++)c.add(b.Un[a]);return c}function is(a,b){var c=a.getAttribute(b);"string"!==typeof c&&a.style&&(c=a.style[b]);return"string"!==typeof c?null:c}
  function gs(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?gs(a,b,c):null):d}
  function hs(a,b,c){var d=b.tagName;if(("g"===d||"svg"===d||"use"===d||"symbol"===d)&&"none"!==gs(a,b,"display")){for(var d=b.childNodes,e=0;e<d.length;e++){var g=d[e],h=null;if(void 0!==g.getAttribute){var k=g.getAttribute("transform");switch(g.tagName){case "g":null===k?hs(a,g,null):(h=new z,hs(a,g,h));break;case "use":null===k?hs(a,g,null):(h=new z,hs(a,g,h));break;case "symbol":if("use"!==b.tagName)break;h=new z;hs(a,g,h);var l=h,m=a,n=g;gs(m,n,"preserveAspectRatio");gs(m,n,"viewBox");l.scale=
  1;break;case "path":l=g;h=new W;l=l.getAttribute("d");"string"===typeof l&&(h.OE=wd(l));break;case "line":var p=g,h=new W,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 ed(id);h.position=new x(Math.min(l,n),Math.min(m,p));0<(n-l)/(p-m)?(q.ra=0,q.sa=0,q.D=Math.abs(n-l),q.F=Math.abs(p-m)):(q.ra=0,q.sa=Math.abs(p-m),q.D=Math.abs(n-l),q.F=
  0);h.Xc=q;break;case "circle":n=g;h=new W;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 ed(kd),p.ra=0,p.sa=0,p.D=2*l,p.F=2*l,h.position=new x(m-l,n-l),h.Xc=p);break;case "ellipse":p=g;h=new W;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 ed(kd),q.ra=0,q.sa=0,q.D=2*l,q.F=2*m,h.position=new x(n-l,p-m),h.Xc=q));break;case "rect":q=g;h=new W;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 u=parseFloat(s);if(isNaN(u)||0>u)u=0;null!==r&&""!==
  r||null===s||""===s?null===r||""===r||null!==s&&""!==s||(u=q):q=u;q=Math.min(q,l/2);u=Math.min(u,m/2);s=void 0;0===q&&0===u?(s=new ed(jd),s.ra=0,s.sa=0,s.D=l,s.F=m):(s=J.wa/2,r=w.u(),L(r,q,0,!0),r.lineTo(l-q,0),N(r,l-q*s,0,l,u*s,l,u),r.lineTo(l,m-u),N(r,l,m-u*s,l-q*s,m,l-q,m),r.lineTo(q,m),N(r,q*s,m,0,m-u*s,0,m-u),r.lineTo(0,u),N(r,0,u*s,q*s,0,q,0),Ad(r),s=r.s,w.v(r));h.position=new x(n,p);h.Xc=s}break;case "polygon":h=js(g);break;case "polyline":h=js(g)}if(null!==h){if(h instanceof W){m=h;l=gs(a,
  g,"fill");null!==l&&-1!==l.indexOf("url")?(l=l.substring(l.indexOf("#")+1,l.length-1),l=a["_brush"+l],m.fill=l instanceof ea?l:"black"):m.fill=null===l?"black":"none"===l?null:l;l=gs(a,g,"stroke");null!==l&&-1!==l.indexOf("url")?(l=l.substring(l.indexOf("#")+1,l.length-1),l=a["_brush"+l],m.stroke=l instanceof ea?l:"black"):m.stroke="none"===l?null:l;l=parseFloat(gs(a,g,"stroke-width"));isNaN(l)||(m.ib=l);l=gs(a,g,"stroke-linecap");null!==l&&(m.EG=l);l=gs(a,g,"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.Gx=p}g=gs(a,g,"stroke-dashoffset");null!==g&&""!==g&&(g=parseFloat(g),isNaN(g)||(m.FG=g));m.sA=!0}if(null!==k){k=k.split(")");g=!0;for(l=0;l<k.length;l++)/\(.*[^0-9\.,\s-]/.test(k[l])&&(g=!1),/\(.*[0-9]-[0-9]/.test(k[l])&&(g=!1);if(g)for(l=k.length-1;0<=l;l--)if(m=k[l],""!==m)switch(n=m.indexOf("("),g=m.substring(0,n).replace(/\s*/,""),n=m.substring(n+1).split(/\s*[\s,]\s*/),g){case "rotate":ks(a,h,n);break;
  case "translate":g=h;m=parseFloat(n[0]);isNaN(m)&&(m=0);n=parseFloat(n[1]);isNaN(n)&&(n=0);if(0!==m||0!==n)p=g.position.copy(),isNaN(p.x)&&(p.x=0),isNaN(p.y)&&(p.y=0),g.position=new x(m+p.x,n+p.y);break;case "scale":ls(a,h,n);break;case "skewX":ms(a,h,n);break;case "skewY":ns(a,h,n);break;case "matrix":os(a,h,n)}}if(h instanceof z){k=h;l=g=0;m=k.position.copy();isNaN(m.x)&&(m.x=0);isNaN(m.y)&&(m.y=0);for(n=k.elements.k;n.next();)p=n.value.position.copy(),isNaN(p.x)&&(p.x=0),isNaN(p.y)&&(p.y=0),p.x<
  g&&(g=p.x),p.y<l&&(l=p.y);m.x+=g;m.y+=l;k.position=m}null===c?a.Un.push(h):c.add(h)}}}if(null!==h){a=is(b,"visibility");if("hidden"===a||"collapse"===a)h.visible=!1;b=is(b,"opacity");null!==b&&""!==b&&(b=parseFloat(b),isNaN(b)||(h.opacity=b))}}}
  function os(a,b,c){var d=parseFloat(c[0]),e=parseFloat(c[1]),g=parseFloat(c[2]),h=parseFloat(c[3]),k=parseFloat(c[4]),l=parseFloat(c[5]);if(!isNaN(d+e+g+h+k+l)){var m=b.position.copy();isNaN(m.x)&&(m.x=0);isNaN(m.y)&&(m.y=0);if(b instanceof W){c=b.Xc.copy();if(c.type===jd)c=a.Ms(c);else if(c.type===kd)c=ps(c);else if(c.type===id){c.type=fd;a=new gd(c.ra,c.sa);var n=new Pd(md,c.D,c.F);a.Fa.add(n);c.pb.add(a)}c.offset(m.x,m.y);c.transform(d,e,g,h,k-m.x,l-m.y);a=c.normalize();b.Xc=c;m.x-=a.x;m.y-=a.y;
  b.position=m}else if(b instanceof z){for(b=b.elements.k;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();)os(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 ks(a,b,c){var d=parseFloat(c[0]);isNaN(d)&&(d=0);var e=parseFloat(c[1]);isNaN(e)&&(e=0);var g=parseFloat(c[2]);isNaN(g)&&(g=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 W){c=b.Xc.copy();c.type===kd?c=ps(c):c.type===jd&&(c=a.Ms(c));if(c.type===fd)c.rotate(d,e-k.x,g-k.y),g=c.normalize(),b.Xc=c,k.x-=g.x,k.y-=g.y,b.position=k;else{var d=c.ra-e+k.x,l=c.sa-g+k.y,m=c.D-e+k.x,n=c.F-g+k.y;a=d*Math.cos(h)-l*Math.sin(h)+e-k.x;d=l*Math.cos(h)+
  d*Math.sin(h)+g-k.y;e=m*Math.cos(h)-n*Math.sin(h)+e-k.x;g=n*Math.cos(h)+m*Math.sin(h)+g-k.y;m=Math.min(a,e);n=Math.min(d,g);c.ra=a-m;c.sa=d-n;c.D=e-m;c.F=g-n;k.x+=m;k.y+=n;b.position=k;b.Xc=c}b.fill instanceof ea&&(k=b.fill.copy(),c=Math.atan((.5-k.start.y)/(.5-k.start.x)),isNaN(c)||(c+=h,k.start=new K((1-Math.cos(c))/2,(1-Math.sin(c))/2),k.end=new K((1+Math.cos(c))/2,(1+Math.sin(c))/2)),b.fill=k);b.stroke instanceof ea&&(k=b.stroke.copy(),c=Math.atan((.5-k.start.y)/(.5-k.start.x)),isNaN(c)||(c+=
  h,k.start=new K((1-Math.cos(c))/2,(1-Math.sin(c))/2),k.end=new K((1+Math.cos(c))/2,(1+Math.sin(c))/2)),b.stroke=k)}else if(b instanceof z){for(b=b.elements.k;b.next();)g=b.value,h=g.position.copy(),h.x+=k.x,h.y+=k.y,g.position=h;for(b.reset();b.next();)ks(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 ls(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 g=b.position.copy();isNaN(g.x)&&(g.x=0);isNaN(g.y)&&(g.y=0);if(b instanceof W)a=b.Xc.copy(),g.x*=d,g.y*=e,b.position=g,a.scale(d,e),b.Xc=a;else if(b instanceof z){for(b=b.elements.k;b.next();)e=b.value,d=e.position.copy(),d.x+=g.x,d.y+=g.y,e.position=d;for(b.reset();b.next();)ls(a,b.value,c);for(b.reset();b.next();)a=b.value,d=a.position.copy(),d.x-=g.x,d.y-=g.y,a.position=d}}}
  function ms(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 W){c=b.Xc.copy();if(c.type===jd)c=a.Ms(c);else if(c.type===kd)c=ps(c);else if(c.type===id){c.type=fd;a=new gd(c.ra,c.sa);var g=new Pd(md,c.D,c.F);a.Fa.add(g);c.pb.add(a)}c.offset(e.x,e.y);c.transform(1,0,Math.tan(d),1,-e.x,-e.y);a=c.normalize();b.Xc=c;e.x-=a.x;e.y-=a.y;b.position=e}else if(b instanceof z){for(b=b.elements.k;b.next();)d=b.value.position.copy(),
  d.x+=e.x,d.y+=e.y,b.value.position=d;for(b.reset();b.next();)ms(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 ns(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 W){c=b.Xc.copy();if(c.type===jd)c=a.Ms(c);else if(c.type===kd)c=ps(c);else if(c.type===id){c.type=fd;a=new gd(c.ra,c.sa);var g=new Pd(md,c.D,c.F);a.Fa.add(g);c.pb.add(a)}c.offset(e.x,e.y);c.transform(1,Math.tan(d),0,1,-e.x,-e.y);a=c.normalize();b.Xc=c;e.x-=a.x;e.y-=a.y;b.position=e}else if(b instanceof z){for(b=b.elements.k;b.next();)g=b.value,d=g.position.copy(),
  d.x+=e.x,d.y+=e.y,g.position=d;for(b.reset();b.next();)ns(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 js(a){var b=!1;if("polygon"===a.tagName)b=!0;else if("polyline"!==a.tagName)return null;var c=new W,d=a.getAttribute("points");a=new ed;var e=new D(gd),g=d.split(/\s*[\s,]\s*/);if(4>g.length)return null;for(var d=null,h=new D(Pd),k=1;k<g.length;k+=2){var l=parseFloat(g[k-1]),m=parseFloat(g[k]);if("number"!==typeof l||isNaN(l)||"number"!==typeof m||isNaN(m))return null;1===k?d=new gd(l,m):h.add(new Pd(md,l,m))}b&&(b=new Pd(md,d.ra,d.sa),b.close(),h.add(b));d.Fa=h;e.add(d);a.pb=e;b=a.normalize();
  c.position=new x(-b.x,-b.y);c.Xc=a;return c}
  function ps(a){var b=a.ra,c=a.sa,d=a.D,e=a.F,g=Math.abs(d-b)/2,h=Math.abs(e-c)/2,b=Math.min(b,d)+g,c=Math.min(c,e)+h;new x;e=new gd(b,c-h);d=new Pd(Fd);d.Ib=b+J.wa*g;d.Ub=c-h;d.we=b+g;d.xe=c-J.wa*h;d.D=b+g;d.F=c;e.Fa.add(d);d=new Pd(Fd);d.Ib=b+g;d.Ub=c+J.wa*h;d.we=b+J.wa*g;d.xe=c+h;d.D=b;d.F=c+h;e.Fa.add(d);d=new Pd(Fd);d.Ib=b-J.wa*g;d.Ub=c+h;d.we=b-g;d.xe=c+J.wa*h;d.D=b-g;d.F=c;e.Fa.add(d);d=new Pd(Fd);d.Ib=b-g;d.Ub=c-J.wa*h;d.we=b-J.wa*g;d.xe=c-h;d.D=b;d.F=c-h;e.Fa.add(d);a.type=fd;a.pb.add(e);
  return a}fs.prototype.Ms=function(a){var b=a.ra,c=a.sa,d=a.D,e=a.F,g=Math.min(b,d),h=Math.min(c,e),b=Math.abs(d-b),c=Math.abs(e-c),e=new gd(g,h);e.Fa.add(new Pd(md,g+b,h));e.Fa.add(new Pd(md,g+b,h+c));e.Fa.add((new Pd(md,g,h+c)).close());a.type=fd;a.pb.add(e);return a};function Ym(){P.call(this);this.Qd=null}w.Ia(Ym,P);Ym.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.element=this.Qd.cloneNode(!0)};
  Ym.prototype.toString=function(){return"HTMLHost("+this.Qd.toString()+")#"+w.Yc(this)};Ym.prototype.bk=function(a,b){var c=this.Qd;if(null!==c){var d=this.qb(Ob);d.x-=this.ea.width/2;d.y-=this.ea.height/2;d.x-=this.ea.x;d.y-=this.ea.y;var d=b.QG(d),e=b.$j;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"}};
  Ym.prototype.wp=function(a,b,c,d){var e=this.ya;isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);var e=this.Pd,g=this.Re;c=Math.max(c,g.width);d=Math.max(d,g.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.Qd;null!==c&&(b=c.getBoundingClientRect(),a=b.width,b=b.height);bb(this.Lc,a,b);ol(this,0,0,a,b)};Ym.prototype.Hi=function(a,b,c,d){tl(this,a,b,c,d)};w.A(Ym,{Ka:"naturalBounds"},function(){return this.Lc});w.g(Ym,"element",Ym.prototype.element);
  w.defineProperty(Ym,{element:"element"},function(){return this.Qd},function(a){var b=this.Qd;b!==a&&(a instanceof HTMLElement||w.m("HTMLHost.element must be an instance of HTMLElement."),this.Qd=a,a.className="HTMLHost",this.j("element",b,a),this.pa())});aa.version="1.5.2";
  window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=aa:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=aa,window.define(aa)):window.go=aa); })(window);