/* * GoJS v2.1.26 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. * Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.26/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function da(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var ea="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},fa; if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:{var ia={a:!0},ja={};try{ja.__proto__=ia;ha=ja.a;break a}catch(a){}ha=!1}fa=ha?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ka=fa; function la(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(ka)ka(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.RA=b.prototype}var ma="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,na="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)}; function oa(a){if(a){for(var b=ma,c=["Array","prototype","fill"],d=0;d<c.length-1;d++){var e=c[d];e in b||(b[e]={});b=b[e]}c=c[c.length-1];d=b[c];a=a(d);a!=d&&null!=a&&na(b,c,{writable:!0,value:a})}}oa(function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}});var x="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.global===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===x.requestAnimationFrame&&(x.requestAnimationFrame=x.setImmediate);function qa(){}function ra(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=sa(function(){c=-1;a.apply(d,e)},b)}}function sa(a,b){return x.setTimeout(a,b)}function ta(a){return x.document.createElement(a)} function B(a){throw Error(a);}function ua(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);B(a)}function va(a,b,c,d){c=null===c?"*":"string"===typeof c?c:"function"===typeof c&&"string"===typeof c.className?c.className:"";void 0!==d&&(c+="."+d);B(c+" is not in the range "+b+": "+a)}function wa(a){x.console&&x.console.log(a)} function ya(){x.console&&x.console.log("Warning: List/Map/Set constructors no longer take an argument that enforces type.Instead they take an optional collection of Values to add to the collection. See 2.0 changelog for details.")}function za(a){return"object"===typeof a&&null!==a}function Aa(a){return Array.isArray(a)||x.NodeList&&a instanceof x.NodeList||x.HTMLCollection&&a instanceof x.HTMLCollection}function Ba(a){return Array.prototype.slice.call(a)} function Ca(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):B("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Da(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):B("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Fa(){var a=Ga.pop();return void 0===a?[]:a}function Ha(a){a.length=0;Ga.push(a)} function Ia(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(za(a)&&a.constructor)return Ia(a.constructor);return typeof a} function Ja(a){var b=a;za(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function Ka(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.LA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function La(a,b,c){Object.defineProperty(Oa.prototype,a,{get:b,set:c})}function Pa(){var a=Qa;if(0===a.length)for(var b=x.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.B&&a.push(e.parentElement.B)}return a} function Ra(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join("");a=""===a?"0":a;b=[];for(c=0;256>c;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f} var Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 9.0"),Ta=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 10.0"),Ua=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Va=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Wa=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Xa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad)/i), Ga=[];Object.freeze([]);var Qa=[];qa.className="Util";qa.Dx="32ab5ff3b26f42dc0ed90f21442913b5";qa.adym="gojs.net";qa.vfo="28e647fdb160";qa.className="Util";function D(a,b,c){Ya(this);this.l=a;this.Qa=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Qa};function Za(a,b){return void 0===b||null===b||""===b?null:a[b]} ma.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.Qa}},value:{get:function(){return this.u}}});D.className="EnumValue";function cb(){this.Yw=[]}cb.prototype.toString=function(){return this.Yw.join("")};cb.prototype.add=function(a){""!==a&&this.Yw.push(a)};cb.className="StringBuilder";function db(){}db.className="PropertyCollection"; function eb(){}eb.prototype.reset=function(){};eb.prototype.next=function(){return!1};eb.prototype.ed=function(){return!1};eb.prototype.first=function(){return null};eb.prototype.any=function(){return!1};eb.prototype.all=function(){return!0};eb.prototype.each=function(){return this};eb.prototype.map=function(){return this};eb.prototype.filter=function(){return this};eb.prototype.Ed=function(){};eb.prototype.toString=function(){return"EmptyIterator"}; ma.Object.defineProperties(eb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.ed;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset;var fb=null;eb.className="EmptyIterator";fb=new eb;function gb(a){this.key=-1;this.value=a}gb.prototype.reset=function(){this.key=-1}; gb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};gb.prototype.ed=function(){return this.next()};gb.prototype.first=function(){this.key=0;return this.value};gb.prototype.any=function(a){this.key=-1;return a(this.value)};gb.prototype.all=function(a){this.key=-1;return a(this.value)};gb.prototype.each=function(a){this.key=-1;a(this.value);return this};gb.prototype.map=function(a){return new gb(a(this.value))}; gb.prototype.filter=function(a){return a(this.value)?new gb(this.value):fb};gb.prototype.Ed=function(){this.value=null};gb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};ma.Object.defineProperties(gb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});gb.prototype.first=gb.prototype.first;gb.prototype.hasNext=gb.prototype.ed;gb.prototype.next=gb.prototype.next; gb.prototype.reset=gb.prototype.reset;gb.className="SingletonIterator";function jb(a){this.pb=a;this.$e=null;a.Ga=null;this.ia=a.Aa;this.Oa=-1}jb.prototype.reset=function(){var a=this.pb;a.Ga=null;this.ia=a.Aa;this.Oa=-1};jb.prototype.next=function(){var a=this.pb;if(a.Aa!==this.ia&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Oa,d=this.$e;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Oa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Ed()}return!1}; jb.prototype.ed=function(){return this.next()};jb.prototype.first=function(){var a=this.pb;this.ia=a.Aa;this.Oa=0;a=a.j;var b=a.length,c=this.$e;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Oa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};jb.prototype.any=function(a){var b=this.pb;b.Ga=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1}; jb.prototype.all=function(a){var b=this.pb;b.Ga=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};jb.prototype.each=function(a){var b=this.pb;b.Ga=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this}; jb.prototype.map=function(a){var b=this.pb;b.Ga=null;this.Oa=-1;var c=[];b=b.j;for(var d=b.length,e=this.$e,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.lb();return a.iterator};jb.prototype.filter=function(a){var b=this.pb;b.Ga=null;this.Oa=-1;var c=[];b=b.j;for(var d=b.length,e=this.$e,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&a(g)&&c.push(g)}a=new E;a.j=c;a.lb();return a.iterator}; jb.prototype.Ed=function(){this.key=-1;this.value=null;this.ia=-1;this.$e=null;this.pb.Ga=this};jb.prototype.toString=function(){return"ListIterator@"+this.Oa+"/"+this.pb.count}; ma.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.$e},set:function(a){this.$e=a}},count:{get:function(){var a=this.$e;if(null!==a){for(var b=0,c=this.pb.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.pb.j.length}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.ed;jb.prototype.next=jb.prototype.next; jb.prototype.reset=jb.prototype.reset;jb.className="ListIterator";function kb(a){this.pb=a;a.Zg=null;this.ia=a.Aa;this.Oa=a.j.length}kb.prototype.reset=function(){var a=this.pb;a.Zg=null;this.ia=a.Aa;this.Oa=a.j.length};kb.prototype.next=function(){var a=this.pb;if(a.Aa!==this.ia&&0>this.key)return!1;var b=--this.Oa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Ed();return!1};kb.prototype.ed=function(){return this.next()}; kb.prototype.first=function(){var a=this.pb;this.ia=a.Aa;var b=a.j;this.Oa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};kb.prototype.any=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};kb.prototype.all=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; kb.prototype.each=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)a(b[c]);return this};kb.prototype.map=function(a){var b=this.pb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.lb();return a.iterator};kb.prototype.filter=function(a){var b=this.pb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.lb();return a.iterator}; kb.prototype.Ed=function(){this.key=-1;this.value=null;this.ia=-1;this.pb.Zg=this};kb.prototype.toString=function(){return"ListIteratorBackwards("+this.Oa+"/"+this.pb.count+")"};ma.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.pb.j.length}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.ed;kb.prototype.next=kb.prototype.next;kb.prototype.reset=kb.prototype.reset; kb.className="ListIteratorBackwards";function E(a){Ya(this);this.s=!1;this.j=[];this.Aa=0;this.Zg=this.Ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=E.prototype;t.lb=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"List()#"+lb(this)};t.add=function(a){if(null===a)return this;this.s&&ua(this,a);this.j.push(a);this.lb();return this}; t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.s&&ua(this);var b=this.j;if(Aa(a))for(var c=a.length,d=0;d<c;d++)b.push(a[d]);else for(a=a.iterator;a.next();)b.push(a.value);this.lb();return this};t.clear=function(){this.s&&ua(this);this.j.length=0;this.lb()};t.contains=function(a){return null===a?!1:-1!==this.j.indexOf(a)};t.has=function(a){return this.contains(a)};t.indexOf=function(a){return null===a?-1:this.j.indexOf(a)}; t.L=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.hd=function(a,b){var c=this.j;(0>a||a>=c.length)&&va(a,"0 <= i < length",E,"setElt:i");this.s&&ua(this,a);c[a]=b};t.set=function(a,b){this.hd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Xb=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this.s&&ua(this);var a=this.j;return 0<a.length?a.pop():null}; E.prototype.any=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(a(b[d]))return!0;return!1};E.prototype.all=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(!a(b[d]))return!1;return!0};E.prototype.each=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)a(b[d]);return this};E.prototype.map=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.j=c;b.lb();return b}; E.prototype.filter=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++){var g=d[f];a(g)&&c.push(g)}b.j=c;b.lb();return b};t=E.prototype;t.ub=function(a,b){0>a&&va(a,">= 0",E,"insertAt:i");this.s&&ua(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.lb()};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=this.j;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.ab=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"removeAt:i");this.s&&ua(this,a);a===b.length-1?b.pop():b.splice(a,1);this.lb()};t.removeRange=function(a,b){var c=this.j,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.s&&ua(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.lb();return this};E.prototype.copy=function(){var a=new E,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a}; t=E.prototype;t.na=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.xw=function(){for(var a=new F,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.s&&ua(this);this.j.sort(a);this.lb();return this}; t.hj=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.s&&ua(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&va(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.lb()),this;if(0===b)if(c>=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a<c;a++)d[a]=b[a];else if(c>=e)for(c=d.slice(b),c.sort(a),a=b;a<e;a++)d[a]=c[a-b];else for(e=d.slice(b,c),e.sort(a),a=b;a<c;a++)d[a]=e[a-b];this.lb();return this}; t.reverse=function(){this.s&&ua(this);this.j.reverse();this.lb();return this}; ma.Object.defineProperties(E.prototype,{_dataArray:{get:function(){return this.j}},count:{get:function(){return this.j.length}},size:{get:function(){return this.j.length}},length:{get:function(){return this.j.length}},iterator:{get:function(){if(0>=this.j.length)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new jb(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return fb;var a=this.Zg;return null!==a?(a.reset(),a):new kb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.hj;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.xw;E.prototype.toArray=E.prototype.na;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.ab;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.ub; E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Xb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.hd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.L;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ea; E.prototype.freeze=E.prototype.freeze;E.className="List";function mb(a){this.og=a;a.Ga=null;this.ia=a.Aa;this.la=null}mb.prototype.reset=function(){var a=this.og;a.Ga=null;this.ia=a.Aa;this.la=null};mb.prototype.next=function(){var a=this.og;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Ed();return!1};mb.prototype.ed=function(){return this.next()}; mb.prototype.first=function(){var a=this.og;this.ia=a.Aa;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};mb.prototype.any=function(a){var b=this.og;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};mb.prototype.all=function(a){var b=this.og;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};mb.prototype.each=function(a){var b=this.og;this.la=b.Ga=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; mb.prototype.map=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};mb.prototype.filter=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};mb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1;this.og.Ga=this};mb.prototype.toString=function(){return null!==this.la?"SetIterator@"+this.la.value:"SetIterator"}; ma.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.og.Eb}}});mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.ed;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="SetIterator"; function F(a){Ya(this);this.s=!1;this.Gb={};this.Eb=0;this.Ga=null;this.Aa=0;this.Ue=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=F.prototype;t.lb=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"Set()#"+lb(this)}; t.add=function(a){if(null===a)return this;this.s&&ua(this,a);var b=a;za(a)&&(b=nb(a));void 0===this.Gb[b]&&(this.Eb++,a=new ob(a,a),this.Gb[b]=a,b=this.Ue,null===b?this.ba=a:(a.El=b,b.oa=a),this.Ue=a,this.lb());return this};t.addAll=function(a){if(null===a)return this;this.s&&ua(this);if(Aa(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this}; t.contains=function(a){if(null===a)return!1;var b=a;return za(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Gb[b]};t.has=function(a){return this.contains(a)};t.ez=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.fz=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(){var a=this.ba;return null===a?null:a.value}; F.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};F.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};F.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.oa;return this};F.prototype.map=function(a){for(var b=new F,c=this.ba;null!==c;)b.add(a(c.value)),c=c.oa;return b};F.prototype.filter=function(a){for(var b=new F,c=this.ba;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.oa}return b};t=F.prototype; t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=a;if(za(a)&&(b=lb(a),void 0===b))return!1;a=this.Gb[b];if(void 0===a)return!1;var c=a.oa,d=a.El;null!==c&&(c.El=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.Ue===a&&(this.Ue=d);delete this.Gb[b];this.Eb--;this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.Nq=function(a){if(null===a)return this;this.s&&ua(this);if(Aa(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};t.wA=function(a){if(null===a||0===this.count)return this;this.s&&ua(this);var b=new F;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Nq(a);return this};t.clear=function(){this.s&&ua(this);this.Gb={};this.Eb=0;null!==this.Ga&&this.Ga.reset();this.Ue=this.ba=null;this.lb()}; F.prototype.copy=function(){var a=new F,b=this.Gb,c;for(c in b)a.add(b[c].value);return a};F.prototype.na=function(){var a=Array(this.Eb),b=this.Gb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.ww=function(){var a=new E,b=this.Gb,c;for(c in b)a.add(b[c].value);return a};function Ya(a){a.__gohashid=pb++}function nb(a){var b=a.__gohashid;void 0===b&&(b=pb++,a.__gohashid=b);return b}function lb(a){return a.__gohashid} ma.Object.defineProperties(F.prototype,{count:{get:function(){return this.Eb}},size:{get:function(){return this.Eb}},iterator:{get:function(){if(0>=this.Eb)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new mb(this)}}});F.prototype.toList=F.prototype.ww;F.prototype.toArray=F.prototype.na;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.wA;F.prototype.removeAll=F.prototype.Nq; F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.fz;F.prototype.containsAll=F.prototype.ez;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.addAll=F.prototype.addAll;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ea;F.prototype.freeze=F.prototype.freeze;var pb=1;F.className="Set";F.uniqueHash=Ya;F.hashIdUnique=nb;F.hashId=lb; function qb(a){this.fa=a;this.ia=a.Aa;this.la=null}qb.prototype.reset=function(){this.ia=this.fa.Aa;this.la=null};qb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=this.key=a=b.key,!0;this.Ed();return!1};qb.prototype.ed=function(){return this.next()};qb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;return null!==a?(this.la=a,this.value=this.key=a=a.key):null}; qb.prototype.any=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};qb.prototype.all=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};qb.prototype.each=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};qb.prototype.map=function(a){var b=this.fa;this.la=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator}; qb.prototype.filter=function(a){var b=this.fa;this.la=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};qb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1};qb.prototype.toString=function(){return null!==this.la?"MapKeySetIterator@"+this.la.value:"MapKeySetIterator"};ma.Object.defineProperties(qb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Eb}}}); qb.prototype.first=qb.prototype.first;qb.prototype.hasNext=qb.prototype.ed;qb.prototype.next=qb.prototype.next;qb.prototype.reset=qb.prototype.reset;qb.className="MapKeySetIterator";function rb(a){F.call(this);Ya(this);this.s=!0;this.fa=a}la(rb,F);t=rb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.fa.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.fa.contains(a)}; t.has=function(a){return this.contains(a)};t.remove=function(){B("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){B("This Set is read-only: "+this.toString())};t.first=function(){var a=this.fa.ba;return null!==a?a.key:null};rb.prototype.any=function(a){for(var b=this.fa.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};rb.prototype.all=function(a){for(var b=this.fa.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0}; rb.prototype.each=function(a){for(var b=this.fa.ba;null!==b;)a(b.key),b=b.oa;return this};rb.prototype.map=function(a){for(var b=new F,c=this.fa.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};rb.prototype.filter=function(a){for(var b=new F,c=this.fa.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};rb.prototype.copy=function(){return new rb(this.fa)};rb.prototype.xw=function(){var a=new F,b=this.fa.Gb,c;for(c in b)a.add(b[c].key);return a}; rb.prototype.na=function(){var a=this.fa.Gb,b=Array(this.fa.Eb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};rb.prototype.ww=function(){var a=new E,b=this.fa.Gb,c;for(c in b)a.add(b[c].key);return a};ma.Object.defineProperties(rb.prototype,{count:{get:function(){return this.fa.Eb}},size:{get:function(){return this.fa.Eb}},iterator:{get:function(){return 0>=this.fa.Eb?fb:new qb(this.fa)}}}); rb.prototype.toList=rb.prototype.ww;rb.prototype.toArray=rb.prototype.na;rb.prototype.toSet=rb.prototype.xw;rb.prototype.first=rb.prototype.first;rb.prototype.clear=rb.prototype.clear;rb.prototype["delete"]=rb.prototype.delete;rb.prototype.remove=rb.prototype.remove;rb.prototype.has=rb.prototype.has;rb.prototype.contains=rb.prototype.contains;rb.prototype.add=rb.prototype.add;rb.prototype.thaw=rb.prototype.ea;rb.prototype.freeze=rb.prototype.freeze;rb.className="MapKeySet"; function sb(a){this.fa=a;a.Te=null;this.ia=a.Aa;this.la=null}sb.prototype.reset=function(){var a=this.fa;a.Te=null;this.ia=a.Aa;this.la=null};sb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Ed();return!1};sb.prototype.ed=function(){return this.next()}; sb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};sb.prototype.any=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};sb.prototype.all=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};sb.prototype.each=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; sb.prototype.map=function(a){var b=this.fa;this.la=b.Te=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};sb.prototype.filter=function(a){var b=this.fa;this.la=b.Te=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};sb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1;this.fa.Te=this};sb.prototype.toString=function(){return null!==this.la?"MapValueSetIterator@"+this.la.value:"MapValueSetIterator"}; ma.Object.defineProperties(sb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Eb}}});sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.ed;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapValueSetIterator";function ob(a,b){this.key=a;this.value=b;this.El=this.oa=null}ob.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; ob.className="KeyValuePair";function tb(a){this.fa=a;a.Ga=null;this.ia=a.Aa;this.la=null}tb.prototype.reset=function(){var a=this.fa;a.Ga=null;this.ia=a.Aa;this.la=null};tb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.key=b.key,this.value=b.value,!0;this.Ed();return!1};tb.prototype.ed=function(){return this.next()}; tb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;return null!==a?(this.la=a,this.key=a.key,this.value=a.value,a):null};tb.prototype.any=function(a){var b=this.fa;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};tb.prototype.all=function(a){var b=this.fa;this.la=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};tb.prototype.each=function(a){var b=this.fa;this.la=b.Ga=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this}; tb.prototype.map=function(a){var b=this.fa;this.la=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};tb.prototype.filter=function(a){var b=this.fa;this.la=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};tb.prototype.Ed=function(){this.value=this.key=null;this.ia=-1;this.fa.Ga=this};tb.prototype.toString=function(){return null!==this.la?"MapIterator@"+this.la:"MapIterator"}; ma.Object.defineProperties(tb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Eb}}});tb.prototype.first=tb.prototype.first;tb.prototype.hasNext=tb.prototype.ed;tb.prototype.next=tb.prototype.next;tb.prototype.reset=tb.prototype.reset;tb.className="MapIterator"; function H(a){Ya(this);this.s=!1;this.Gb={};this.Eb=0;this.Te=this.Ga=null;this.Aa=0;this.Ue=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=H.prototype;t.lb=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"Map()#"+lb(this)}; t.add=function(a,b){this.s&&ua(this,a);var c=a;za(a)&&(c=nb(a));var d=this.Gb[c];void 0===d?(this.Eb++,a=new ob(a,b),this.Gb[c]=a,c=this.Ue,null===c?this.ba=a:(a.El=c,c.oa=a),this.Ue=a,this.lb()):d.value=b;return this};t.set=function(a,b){return this.add(a,b)}; t.addAll=function(a){if(null===a)return this;if(Aa(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else if(a instanceof H)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function(){return this.ba};H.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};H.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0}; H.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.oa;return this};H.prototype.map=function(a){for(var b=new H,c=this.ba;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};H.prototype.filter=function(a){for(var b=new H,c=this.ba;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=H.prototype;t.contains=function(a){var b=a;return za(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Gb[b]};t.has=function(a){return this.contains(a)}; t.H=function(a){var b=a;if(za(a)&&(b=lb(a),void 0===b))return null;a=this.Gb[b];return void 0===a?null:a.value};t.get=function(a){return this.H(a)};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=a;if(za(a)&&(b=lb(a),void 0===b))return!1;a=this.Gb[b];if(void 0===a)return!1;var c=a.oa,d=a.El;null!==c&&(c.El=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.Ue===a&&(this.Ue=d);delete this.Gb[b];this.Eb--;this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.clear=function(){this.s&&ua(this);this.Gb={};this.Eb=0;null!==this.Ga&&this.Ga.reset();null!==this.Te&&this.Te.reset();this.Ue=this.ba=null;this.lb()};H.prototype.copy=function(){var a=new H,b=this.Gb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};H.prototype.na=function(){var a=this.Gb,b=Array(this.Eb),c=0,d;for(d in a){var e=a[d];b[c]=new ob(e.key,e.value);c++}return b};H.prototype.Df=function(){return new rb(this)}; ma.Object.defineProperties(H.prototype,{count:{get:function(){return this.Eb}},size:{get:function(){return this.Eb}},iterator:{get:function(){if(0>=this.count)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new tb(this)}},iteratorKeys:{get:function(){return 0>=this.count?fb:new qb(this)}},iteratorValues:{get:function(){if(0>=this.count)return fb; var a=this.Te;return null!==a?(a.reset(),a):new sb(this)}}});H.prototype.toKeySet=H.prototype.Df;H.prototype.toArray=H.prototype.na;H.prototype.clear=H.prototype.clear;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.get=H.prototype.get;H.prototype.getValue=H.prototype.H;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.first=H.prototype.first;H.prototype.addAll=H.prototype.addAll;H.prototype.set=H.prototype.set; H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ea;H.prototype.freeze=H.prototype.freeze;H.className="Map";function I(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}I.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.h=function(a,b){this.x=a;this.y=b;return this};I.prototype.Bg=function(a,b){this.x=a;this.y=b;return this}; I.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.copy=function(){var a=new I;a.x=this.x;a.y=this.y;return a};t=I.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function ub(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new I(c,e)}return new I}function vb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.w=function(a){return a instanceof I?this.x===a.x&&this.y===a.y:!1};t.Vi=function(a,b){return this.x===a&&this.y===b};t.Ma=function(a){return K.A(this.x,a.x)&&K.A(this.y,a.y)}; t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.be=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};I.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=I.prototype; t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.De=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.dd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};t.Sa=function(a){return zb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return zb(a-this.x,b-this.y)}; function zb(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}t.pA=function(a,b,c,d){K.Kh(a,b,c,d,this.x,this.y,this);return this};t.qA=function(a,b){K.Kh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.CA=function(a,b,c,d){K.sq(this.x,this.y,a,b,c,d,this);return this};t.DA=function(a,b){K.sq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this}; t.gj=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};t.zk=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ra(this);return this};function Ab(a,b){b.Xd(a);return a}function Bb(a,b,c,d,e,f){var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k}function Cb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b} function Db(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}t.v=function(){return isFinite(this.x)&&isFinite(this.y)};I.alloc=function(){var a=Fb.pop();return void 0===a?new I:a};I.allocAt=function(a,b){var c=Fb.pop();if(void 0===c)return new I(a,b);c.x=a;c.y=b;return c};I.free=function(a){Fb.push(a)};I.prototype.isReal=I.prototype.v; I.prototype.setSpot=I.prototype.zk;I.prototype.setRectSpot=I.prototype.gj;I.prototype.snapToGridPoint=I.prototype.DA;I.prototype.snapToGrid=I.prototype.CA;I.prototype.projectOntoLineSegmentPoint=I.prototype.qA;I.prototype.projectOntoLineSegment=I.prototype.pA;I.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return K.Aq(a,b,c,d,e,f,g,h)};I.prototype.direction=I.prototype.direction;I.prototype.directionPoint=I.prototype.Sa;I.prototype.normalize=I.prototype.normalize; I.prototype.distanceSquared=I.prototype.dd;I.prototype.distanceSquaredPoint=I.prototype.De;I.prototype.scale=I.prototype.scale;I.prototype.rotate=I.prototype.rotate;I.prototype.offset=I.prototype.offset;I.prototype.subtract=I.prototype.be;I.prototype.add=I.prototype.add;I.prototype.equalsApprox=I.prototype.Ma;I.prototype.equalTo=I.prototype.Vi;I.prototype.equals=I.prototype.w;I.prototype.set=I.prototype.set;I.prototype.setTo=I.prototype.Bg;var Gb=null,Hb=null,Ib=null,Jb=null,Kb=null,Fb=[]; I.className="Point";I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=Bb;I.distanceSquared=Cb;I.direction=Db;I.Origin=Gb=(new I(0,0)).ca();I.InfiniteTopLeft=Hb=(new I(-Infinity,-Infinity)).ca();I.InfiniteBottomRight=Ib=(new I(Infinity,Infinity)).ca();I.SixPoint=Jb=(new I(6,6)).ca();I.NoPoint=Kb=(new I(NaN,NaN)).ca();I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=Bb;I.distanceSquared=Cb;I.direction=Db; function M(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Lb,Mb,Nb,Ob,Pb,Qb,Rb;M.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.h=function(a,b){this.width=a;this.height=b;return this};M.prototype.Bg=function(a,b){this.width=a;this.height=b;return this}; M.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function Sb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new M(c,e)}return new M}function Tb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.w=function(a){return a instanceof M?this.width===a.width&&this.height===a.height:!1};t.Vi=function(a,b){return this.width===a&&this.height===b}; t.Ma=function(a){return K.A(this.width,a.width)&&K.A(this.height,a.height)};t.v=function(){return isFinite(this.width)&&isFinite(this.height)};M.alloc=function(){var a=Ub.pop();return void 0===a?new M:a};M.free=function(a){Ub.push(a)};M.prototype.isReal=M.prototype.v;M.prototype.equalsApprox=M.prototype.Ma;M.prototype.equalTo=M.prototype.Vi;M.prototype.equals=M.prototype.w;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Bg;var Ub=[];M.className="Size";M.parse=Sb;M.stringify=Tb; M.ZeroSize=Lb=(new M(0,0)).ca();M.OneSize=Mb=(new M(1,1)).ca();M.SixSize=Nb=(new M(6,6)).ca();M.EightSize=Ob=(new M(8,8)).ca();M.TenSize=Pb=(new M(10,10)).ca();M.InfiniteSize=Qb=(new M(Infinity,Infinity)).ca();M.NoSize=Rb=(new M(NaN,NaN)).ca();M.parse=Sb;M.stringify=Tb; function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof I?(c=a.x,a=a.y,b instanceof I?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof M?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):B("Incorrect arguments supplied to Rect constructor")):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c, this.height=d):B("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Vb(a,b,c){a.width=b;a.height=c}t.Bg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this}; t.jd=function(a){this.x=a.x;this.y=a.y;return this};t.AA=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this}; t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function Wb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new N(c,e,f,g)}return new N} function Zb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.w=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Vi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ma=function(a){return K.A(this.x,a.x)&&K.A(this.y,a.y)&&K.A(this.width,a.width)&&K.A(this.height,a.height)}; function $b(a,b){return K.$(a.x,b.x)&&K.$(a.y,b.y)&&K.$(a.width,b.width)&&K.$(a.height,b.height)}t.aa=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Ce=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};t.offset=function(a,b){this.x+=a;this.y+=b;return this}; t.Fc=function(a,b){return ac(this,b,a,b,a)};t.iq=function(a){return ac(this,a.top,a.right,a.bottom,a.left)};t.vw=function(a){return ac(this,-a.top,-a.right,-a.bottom,-a.left)};t.Tz=function(a,b,c,d){return ac(this,a,b,c,d)};function ac(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.Xz=function(a){return bc(this,a.x,a.y,a.width,a.height)};t.Nv=function(a,b,c,d){return bc(this,a,b,c,d)}; function bc(a,b,c,d,e){var f=Math.max(a.x,b),g=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Ic=function(a){return this.Ov(a.x,a.y,a.width,a.height)};t.Ov=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function dc(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ie=function(a){return ec(this,a.x,a.y,0,0)};t.Jc=function(a){return ec(this,a.x,a.y,a.width,a.height)};t.Cw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ec(this,a,b,c,d)}; function ec(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.zk=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function fc(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}function gc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0} t.v=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Zz=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=hc.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=hc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){hc.push(a)}; ma.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{ get:function(){return new I(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new M(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new I(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2}, set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.Zz;N.prototype.isReal=N.prototype.v;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return K.iy(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.zk;N.prototype.union=N.prototype.Cw;N.prototype.unionRect=N.prototype.Jc;N.prototype.unionPoint=N.prototype.Ie;N.prototype.intersects=N.prototype.Ov; N.prototype.intersectsRect=N.prototype.Ic;N.prototype.intersect=N.prototype.Nv;N.prototype.intersectRect=N.prototype.Xz;N.prototype.grow=N.prototype.Tz;N.prototype.subtractMargin=N.prototype.vw;N.prototype.addMargin=N.prototype.iq;N.prototype.inflate=N.prototype.Fc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Ce;N.prototype.containsPoint=N.prototype.aa;N.prototype.equalsApprox=N.prototype.Ma;N.prototype.equalTo=N.prototype.Vi; N.prototype.equals=N.prototype.w;N.prototype.setSize=N.prototype.AA;N.prototype.setPoint=N.prototype.jd;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.Bg;var ic=null,jc=null,hc=[];N.className="Rect";N.parse=Wb;N.stringify=Zb;N.contains=fc;N.intersects=gc;N.ZeroRect=ic=(new N(0,0,0,0)).ca();N.NoRect=jc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Wb;N.stringify=Zb;N.contains=fc;N.intersects=gc; function oc(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):B("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}oc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; oc.prototype.Bg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};oc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};oc.prototype.copy=function(){var a=new oc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=oc.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()}; t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function pc(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 oc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new oc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new oc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new oc(c,e):new oc(c,e,f,g)}return new oc} function qc(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.w=function(a){return a instanceof oc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.Vi=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d}; t.Ma=function(a){return K.A(this.top,a.top)&&K.A(this.right,a.right)&&K.A(this.bottom,a.bottom)&&K.A(this.left,a.left)};t.v=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};oc.alloc=function(){var a=rc.pop();return void 0===a?new oc:a};oc.free=function(a){rc.push(a)};oc.prototype.isReal=oc.prototype.v;oc.prototype.equalsApprox=oc.prototype.Ma;oc.prototype.equalTo=oc.prototype.Vi;oc.prototype.equals=oc.prototype.w;oc.prototype.set=oc.prototype.set; oc.prototype.setTo=oc.prototype.Bg;var sc=null,tc=null,rc=[];oc.className="Margin";oc.parse=pc;oc.stringify=qc;oc.ZeroMargin=sc=(new oc(0,0,0,0)).ca();oc.TwoMargin=tc=(new oc(2,2,2,2)).ca();oc.parse=pc;oc.stringify=qc;function P(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.s=!1} var uc,vc,wc,yc,zc,Ac,Bc,Cc,Dc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Pc,Qc,Rc,Sc,Tc,Uc,Vc,Zc,$c,ad,bd,cd,dd,ed,fd,gd,hd,id,jd;P.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};P.prototype.Bg=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};P.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this}; P.prototype.copy=function(){var a=new P;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};t=P.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function kd(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a} function ld(a){if("string"===typeof a){a=a.trim();if("None"===a)return uc;if("TopLeft"===a)return vc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return wc;if("TopRight"===a)return yc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return zc;if("Center"===a)return Ac;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Bc;if("BottomLeft"===a)return Cc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Dc;if("BottomRight"===a)return Gc;if("TopSide"===a)return Hc;if("LeftSide"=== a)return Ic;if("RightSide"===a)return Jc;if("BottomSide"===a)return Kc;if("TopBottomSides"===a)return Lc;if("LeftRightSides"===a)return Mc;if("TopLeftSides"===a)return Nc;if("TopRightSides"===a)return Pc;if("BottomLeftSides"===a)return Qc;if("BottomRightSides"===a)return Rc;if("NotTopSide"===a)return Sc;if("NotLeftSide"===a)return Tc;if("NotRightSide"===a)return Uc;if("NotBottomSide"===a)return Vc;if("AllSides"===a)return Zc;if("Default"===a)return $c;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(g=parseFloat(d));return new P(c,e,f,g)}return new P}function md(a){return a.hb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()} t.toString=function(){return this.hb()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.w(uc)?"None":this.w(vc)?"TopLeft":this.w(wc)?"Top":this.w(yc)?"TopRight":this.w(zc)?"Left":this.w(Ac)?"Center":this.w(Bc)?"Right":this.w(Cc)?"BottomLeft":this.w(Dc)?"Bottom":this.w(Gc)?"BottomRight":this.w(Hc)?"TopSide":this.w(Ic)?"LeftSide":this.w(Jc)?"RightSide":this.w(Kc)?"BottomSide":this.w(Lc)?"TopBottomSides":this.w(Mc)? "LeftRightSides":this.w(Nc)?"TopLeftSides":this.w(Pc)?"TopRightSides":this.w(Qc)?"BottomLeftSides":this.w(Rc)?"BottomRightSides":this.w(Sc)?"NotTopSide":this.w(Tc)?"NotLeftSide":this.w(Uc)?"NotRightSide":this.w(Vc)?"NotBottomSide":this.w(Zc)?"AllSides":this.w($c)?"Default":"None"};t.w=function(a){return a instanceof P?(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}; t.Zv=function(){return new P(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};t.xf=function(a){if(!this.gd())return!1;if(!a.gd())if(a.w(ad))a=Ic;else if(a.w(bd))a=Jc;else if(a.w(cd))a=Hc;else if(a.w(dd))a=Kc;else return!1;a=a.offsetY;return(this.offsetY&a)===a};t.hb=function(){return!isNaN(this.x)&&!isNaN(this.y)};t.kc=function(){return isNaN(this.x)||isNaN(this.y)};t.gd=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY}; t.Ht=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};t.Nb=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};P.alloc=function(){var a=nd.pop();return void 0===a?new P:a};P.free=function(a){nd.push(a)};P.prototype.isDefault=P.prototype.Nb;P.prototype.isNone=P.prototype.Ht;P.prototype.isSide=P.prototype.gd;P.prototype.isNoSpot=P.prototype.kc;P.prototype.isSpot=P.prototype.hb;P.prototype.includesSide=P.prototype.xf; P.prototype.opposite=P.prototype.Zv;P.prototype.equals=P.prototype.w;P.prototype.set=P.prototype.set;P.prototype.setTo=P.prototype.Bg;var nd=[];P.className="Spot";P.parse=ld;P.stringify=md;P.None=uc=kd(new P(0,0,0,0),0).ca();P.Default=$c=kd(new P(0,0,-1,0),-1).ca();P.TopLeft=vc=(new P(0,0,0,0)).ca();P.TopCenter=wc=(new P(.5,0,0,0)).ca();P.TopRight=yc=(new P(1,0,0,0)).ca();P.LeftCenter=zc=(new P(0,.5,0,0)).ca();P.Center=Ac=(new P(.5,.5,0,0)).ca();P.RightCenter=Bc=(new P(1,.5,0,0)).ca(); P.BottomLeft=Cc=(new P(0,1,0,0)).ca();P.BottomCenter=Dc=(new P(.5,1,0,0)).ca();P.BottomRight=Gc=(new P(1,1,0,0)).ca();P.MiddleTop=ed=wc;P.MiddleLeft=fd=zc;P.MiddleRight=gd=Bc;P.MiddleBottom=hd=Dc;P.Top=cd=wc;P.Left=ad=zc;P.Right=bd=Bc;P.Bottom=dd=Dc;P.TopSide=Hc=kd(new P(0,0,1,1),1).ca();P.LeftSide=Ic=kd(new P(0,0,1,2),1).ca();P.RightSide=Jc=kd(new P(0,0,1,4),1).ca();P.BottomSide=Kc=kd(new P(0,0,1,8),1).ca();P.TopBottomSides=Lc=kd(new P(0,0,1,9),1).ca();P.LeftRightSides=Mc=kd(new P(0,0,1,6),1).ca(); P.TopLeftSides=Nc=kd(new P(0,0,1,3),1).ca();P.TopRightSides=Pc=kd(new P(0,0,1,5),1).ca();P.BottomLeftSides=Qc=kd(new P(0,0,1,10),1).ca();P.BottomRightSides=Rc=kd(new P(0,0,1,12),1).ca();P.NotTopSide=Sc=kd(new P(0,0,1,14),1).ca();P.NotLeftSide=Tc=kd(new P(0,0,1,13),1).ca();P.NotRightSide=Uc=kd(new P(0,0,1,11),1).ca();P.NotBottomSide=Vc=kd(new P(0,0,1,7),1).ca();P.AllSides=Zc=kd(new P(0,0,1,15),1).ca();id=(new P(.156,.156)).ca();jd=(new P(.844,.844)).ca();P.parse=ld;P.stringify=md; function qd(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}qd.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};qd.prototype.copy=function(){var a=new qd;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};t=qd.prototype;t.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}; t.w=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy};t.Ft=function(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22};t.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; t.multiply=function(a){var b=this.m11*a.m11+this.m21*a.m12,c=this.m12*a.m11+this.m22*a.m12,d=this.m11*a.m21+this.m21*a.m22,e=this.m12*a.m21+this.m22*a.m22;this.dx=this.m11*a.dx+this.m21*a.dy+this.dx;this.dy=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this}; t.Vv=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,g=b*(a.m21*a.dy-a.m22*a.dx);a=b*(a.m12*a.dx-a.m11*a.dy);b=this.m11*c+this.m21*d;c=this.m12*c+this.m22*d;d=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;this.dx=this.m11*g+this.m21*a+this.dx;this.dy=this.m12*g+this.m22*a+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this}; t.Et=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; qd.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=qd.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.ra=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Xd=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.Bw=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};qd.alloc=function(){var a=rd.pop();return void 0===a?new qd:a}; qd.free=function(a){rd.push(a)};qd.prototype.transformRect=qd.prototype.Bw;qd.prototype.invertedTransformPoint=qd.prototype.Xd;qd.prototype.transformPoint=qd.prototype.ra;qd.prototype.scale=qd.prototype.scale;qd.prototype.translate=qd.prototype.translate;qd.prototype.rotate=qd.prototype.rotate;qd.prototype.invert=qd.prototype.Et;qd.prototype.multiplyInverted=qd.prototype.Vv;qd.prototype.multiply=qd.prototype.multiply;qd.prototype.reset=qd.prototype.reset;qd.prototype.isIdentity=qd.prototype.Ft; qd.prototype.equals=qd.prototype.w;qd.prototype.set=qd.prototype.set;var rd=[];qd.className="Transform";qd.xF="54a702f3e53909c447824c6706603faf4c"; var K={JA:"7da71ca0ad381e90",Eg:(Math.sqrt(2)-1)/3*4,Rw:null,sqrt:function(a){if(0>=a)return 0;var b=K.Rw;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.Rw=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},A:function(a,b){a-=b;return.5>a&&-.5<a},$:function(a,b){a-=b;return 5E-8>a&&-5E-8<a},Ob:function(a,b,c,d,e,f,g){0>=e&&(e=1E-6);if(a<c){var h=a;var k=c}else h=c,k=a;if(b<d){var l=b;var m=d}else l=d,m=b;if(a===c)return l<=g&&g<=m&&a-e<=f&&f<=a+e;if(b===d)return h<= f&&f<=k&&b-e<=g&&g<=b+e;k+=e;h-=e;if(h<=f&&f<=k&&(m+=e,l-=e,l<=g&&g<=m))if(k-h>m-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},lt:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Ob(a,b,g,h,n,c,d)&&K.Ob(a,b,g,h,n,e,f))return K.Ob(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var v=(d+q)/2,w=(c+u)/2;return K.lt(a, b,p,r,d,c,v,w,k,l,m,n)||K.lt(v,w,q,u,e,f,g,h,k,l,m,n)},az:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},$y:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Db(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},dm:function(a,b,c,d,e,f,g,h,k,l){if(K.Ob(a,b,g,h,k,c,d)&&K.Ob(a,b,g,h,k,e,f))ec(l,a,b,0,0),ec(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/ 2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;K.dm(a,b,m,n,d,c,q,u,k,l);K.dm(q,u,p,r,e,f,g,h,k,l)}return l},Be:function(a,b,c,d,e,f,g,h,k,l){if(K.Ob(a,b,g,h,k,c,d)&&K.Ob(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;K.Be(a,b,m,n,d,c,q,u,k,l);K.Be(q,u,p,r,e,f,g,h,k,l)}return l},bw:function(a,b,c,d,e,f,g,h,k,l){if(K.Ob(a,b,e,f,l,c,d))return K.Ob(a, b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return K.bw(a,b,m,n,p,r,g,h,k,l)||K.bw(p,r,c,d,e,f,g,h,k,l)},PA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},aw:function(a,b,c,d,e,f,g,h){if(K.Ob(a,b,e,f,g,c,d))ec(h,a,b,0,0),ec(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.aw(a,b,k,l,m,n,g,h);K.aw(m,n,c,d,e,f,g,h)}return h},Kq:function(a,b,c,d,e,f,g,h){if(K.Ob(a,b,e,f,g,c,d))0===h.length&&(h.push(a), h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.Kq(a,b,k,l,m,n,g,h);K.Kq(m,n,c,d,e,f,g,h)}return h},kq:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(K.Ob(a,b,g,h,p,c,d)&&K.Ob(a,b,g,h,p,e,f)){if(a<k&&g<k&&a<m&&g<m||a>k&&g>k&&a>m&&g>m||b<l&&h<l&&b<n&&h<n||b>l&&h>l&&b>n&&h>n)return!1;var q=(a-g)*(l-n)-(b-h)*(k-m);if(0===q)return!1;p=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/q;q=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/q;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(b<h?g=b: (g=h,h=b),q<g||q>h)return!1}else if(a<g?h=a:(h=g,g=a),p<h||p>g)return!1;r.h(p,q);return!0}q=(a+c)/2;var u=(b+d)/2,v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/2;w=(w+f)/2;var y=(d+v)/2,z=(c+w)/2,A=(m-k)*(m-k)+(n-l)*(n-l),C=!1,G=0,L=0;K.kq(a,b,q,u,d,c,y,z,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a<A&&(A=a,C=!0,G=r.x,L=r.y));K.kq(y,z,v,w,e,f,g,h,k,l,m,n,p,r)&&(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l)<A&&(C=!0,G=r.x,L=r.y);C&&(r.x=G,r.y=L);return C},lq:function(a,b,c,d,e,f,g,h,k, l,m,n,p){var r=0;if(K.Ob(a,b,g,h,p,c,d)&&K.Ob(a,b,g,h,p,e,f)){p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return r;var q=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,u=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p;if(q>=m)return r;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(b<h?(a=b,b=h):a=h,u<a||u>b)return r}else if(a<g?(b=a,a=g):b=g,q<b||q>a)return r;0<p?r++:0>p&&r--}else{q=(a+c)/2;u=(b+d)/2;var v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/2;w=(w+f)/2;var y=(d+v)/2,z=(c+w)/2;r+=K.lq(a,b,q,u,d,c,y,z,k,l,m,n,p); r+=K.lq(y,z,v,w,e,f,g,h,k,l,m,n,p)}return r},Kh:function(a,b,c,d,e,f,g){if(K.$(a,c)){b<d?(c=b,b=d):c=d;if(f<c)return g.h(a,c),!1;if(f>b)return g.h(a,b),!1;g.h(a,f);return!0}if(K.$(b,d)){a<c?(d=a,a=c):d=c;if(e<d)return g.h(d,b),!1;if(e>a)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005<e)return g.h(c,d),!1;g.h(a+e*(c-a),b+e*(d-b));return!0},Ge:function(a,b,c,d,e,f,g,h,k){if(K.A(a,c)&&K.A(b,d))return k.h(a,b),!1;if(K.$(e, g))return K.$(a,c)?(K.Kh(a,b,c,d,e,f,k),!1):K.Kh(a,b,c,d,e,(d-b)/(c-a)*(e-a)+b,k);h=(h-f)/(g-e);if(K.$(a,c)){c=h*(a-e)+f;b<d?(e=b,b=d):e=d;if(c<e)return k.h(a,e),!1;if(c>b)return k.h(a,b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(K.$(h,g))return K.Kh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.$(g,0)){a<c?(d=a,a=c):d=c;if(e<d)return k.h(d,b),!1;if(e>a)return k.h(a,b),!1;k.h(e,b);return!0}return K.Kh(a,b,c,d,e,g*(e-a)+b,k)},OA:function(a,b,c,d,e){return K.Ge(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},NA:function(a, b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e<n&&(n=e,k.h(c,d))}var n=Infinity;m(k.x,k.y);var p=0,r=0,q=0,u=0;e<g?(p=e,r=g):(p=g,r=e);f<h?(q=e,u=g):(q=g,u=e);p=(r-p)/2+l;l=(u-q)/2+l;e=(e+g)/2;f=(f+h)/2;if(0===p||0===l)return k;if(.5>(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c* a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k},Vc:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Ge(a,b,a,d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);p<l&&(l=p,m=k.x,n=k.y)}K.Ge(c,b,c,d,e,f,g,h,k)&&(p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),p<l&&(l=p,m=k.x,n=k.y));K.Ge(a,b,c,b,e,f,g,h,k)&&(b=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),b<l&&(l=b,m=k.x,n=k.y));K.Ge(a,d,c,d,e,f,g,h,k)&&(a=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),a<l&&(l=a,m=k.x,n=k.y)); k.h(m,n);return 1E21>l},MA:function(a,b,c,d,e,f,g,h,k){c=a-c;g=e-g;0===c||0===g?0===c?(b=(f-h)/g,h=a,e=b*h+(f-b*e)):(f=(b-d)/c,h=e,e=f*h+(b-f*a)):(d=(b-d)/c,h=(f-h)/g,a=b-d*a,h=(f-h*e-a)/(d-h),e=d*h+a);k.h(h,e);return k},Ct:function(a,b,c){return K.iy(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},iy:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f<h?(g=f,f=h):g=h,a<=e&&e<=k&&g<=l&&f>=b):f===h?(e<g?(h=e,e=g):h=g,b<=f&&f<=l&&h<=k&&e>=a):fc(a,b,c,d,e,f)||fc(a,b,c,d,g,h)||K.Aq(a,b,k,b,e,f,g,h)|| K.Aq(k,b,k,l,e,f,g,h)||K.Aq(k,l,a,l,e,f,g,h)||K.Aq(a,l,a,b,e,f,g,h)?!0:!1},Aq:function(a,b,c,d,e,f,g,h){return 0>=K.ot(a,b,c,d,e,f)*K.ot(a,b,c,d,g,h)&&0>=K.ot(e,f,g,h,a,b)*K.ot(e,f,g,h,c,d)},ot:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0<f&&(f=(a-c)*c+(b-d)*d,0>f&&(f=0)));return 0>f?-1:0<f?1:0},Hq:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},Ox:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e- d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f;for(;1E-5<d;)e=l+h*Math.min(d,k),f.push(K.hz(c,l,e,a,b)),d-=Math.abs(e-l),l=e;return f},hz:function(a,b,c,d,e){var f=(c-b)/2,g=a*Math.cos(f),h=a*Math.sin(f),k=-h,l=g*g+k*k,m=l+g*g+k*h;l=4/3*(Math.sqrt(2*l*m)-m)/(g*h-k*g);h=g-l*k;g=k+l*g;k=-g;l=f+b;f=Math.cos(l);l=Math.sin(l);return[d+a*Math.cos(b),e+a*Math.sin(b),d+h*f-g*l,e+h*l+g*f,d+h*f-k* l,e+h*l+k*f,d+a*Math.cos(c),e+a*Math.sin(c)]},sq:function(a,b,c,d,e,f,g){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/f)*f+d;var h=c;c+e-a<e/2&&(h=c+e);a=d;d+f-b<f/2&&(a=d+f);g.h(h,a);return g},Yx:function(a,b){var c=Math.max(a,b);a=Math.min(a,b);var d;do b=c%a,c=d=a,a=b;while(0<b);return d},mz:function(a,b,c,d){var e=0>c,f=0>d;if(a<b){var g=1;var h=0}else g=0,h=1;var k=0===g?a:b;var l=0===g?c:d;if(0===g?e:f)l=-l;g=h;c=0===g?c:d;if(0===g?e:f)c=-c;return K.nz(k,0===g?a:b,l,c,0,0)},nz:function(a,b, c,d,e,f){if(0<d)if(0<c){e=a*a;f=b*b;a*=c;var g=b*d,h=-f+g,k=-f+Math.sqrt(a*a+g*g);b=h;for(var l=0;9999999999>l;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=m*m+n*n-1;if(0<m)h=b;else if(0>m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,f<d?(d=f/d,f=b*Math.sqrt(Math.abs(1-d*d)),c=a*d-c,c=Math.sqrt(c*c+f*f)):c=Math.abs(c-a);return c},Je:new db,Qm:new db,Oh:new db,Ph:0};K.za=K.JA; function sd(a){Ya(this);this.s=!1;void 0===a&&(a=td);this.pa=a;this.nc=this.ec=this.Tc=this.Sc=0;this.uj=new E;this.Mr=this.uj.Aa;this.ur=(new N).freeze();this.qa=!0;this.Xm=this.Ik=null;this.Ym=NaN;this.hf=vc;this.jf=Gc;this.kl=this.ll=NaN;this.Nf=ud} sd.prototype.copy=function(){var a=new sd;a.pa=this.pa;a.Sc=this.Sc;a.Tc=this.Tc;a.ec=this.ec;a.nc=this.nc;for(var b=this.uj.j,c=b.length,d=a.uj,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.Mr=this.Mr;a.ur.assign(this.ur);a.qa=this.qa;a.Ik=this.Ik;a.Xm=this.Xm;a.Ym=this.Ym;a.hf=this.hf.G();a.jf=this.jf.G();a.ll=this.ll;a.kl=this.kl;a.Nf=this.Nf;return a};t=sd.prototype;t.ca=function(){this.freeze();Object.freeze(this);return this}; t.freeze=function(){this.s=!0;var a=this.figures;a.freeze();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].freeze();return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;var a=this.figures;a.ea();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].ea();return this}; t.Ma=function(a){if(!(a instanceof sd))return!1;if(this.type!==a.type)return this.type===vd&&a.type===td?wd(this,a):a.type===vd&&this.type===td?wd(a,this):!1;if(this.type===td){var b=this.figures.j;a=a.figures.j;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Ma(a[d]))return!1;return!0}return K.A(this.startX,a.startX)&&K.A(this.startY,a.startY)&&K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)}; function wd(a,b){return a.type!==vd||b.type!==td?!1:1===b.figures.count&&(b=b.figures.L(0),1===b.segments.count&&K.A(a.startX,b.startX)&&K.A(a.startY,b.startY)&&(b=b.segments.L(0),b.type===xd&&K.A(a.endX,b.endX)&&K.A(a.endY,b.endY)))?!0:!1}function yd(a){return a.toString()}t.gb=function(a){a.classType===sd&&(this.type=a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case vd:return 0>a?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case zd:var b=new N(this.startX,this.startY,0,0);b.Cw(this.endX,this.endY,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+ " "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Hd:b=new N(this.startX,this.startY,0,0);b.Cw(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ 2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case td:b="";c=this.figures.j;for(var d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.isFilled&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}}; function Id(a,b){function c(){return u>=A-1?!0:null!==k[u+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){u++;return k[u]}function e(){var a=new I(parseFloat(d()),parseFloat(d()));v===v.toLowerCase()&&(a.x=z.x+a.x,a.y=z.y+a.y);return a}function f(){return z=e()}function g(){return y=e()}function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?z:new I(2*z.x-y.x,2*z.y-y.y)}void 0===b&&(b=!1);a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/([Aa](\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,"");var k=a.split(" ");for(a=0;a<k.length;a++){var l=k[a];if(null!==l.match(/(\.[0-9]*)(\.)/gm)){for(var m= Fa(),n="",p=!1,r=0;r<l.length;r++){var q=l[r];"."!==q||p?"."===q?(m.push(n),n="."):n+=q:(p=!0,n+=q)}m.push(n);k.splice(a,1);for(l=0;l<m.length;l++)k.splice(a+l,0,m[l]);a+=m.length-1;Ha(m)}}var u=-1,v="",w="";m=new I(0,0);var y=new I(0,0),z=new I(0,0),A=k.length;a=Jd(null);n=l=!1;p=!0;for(r=null;!(u>=A-1);)if(w=v,v=d(),""!==v)switch(v.toUpperCase()){case "X":p=!0;n=l=!1;break;case "M":r=f();null===a.fc||!0===p?(Kd(a,r.x,r.y,l,!n),p=!1):a.moveTo(r.x,r.y);for(m=z;!c();)r=f(),a.lineTo(r.x,r.y);break; case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)z=new I((v===v.toLowerCase()?z.x:0)+parseFloat(d()),z.y),a.lineTo(z.x,z.y);break;case "V":for(;!c();)z=new I(z.x,(v===v.toLowerCase()?z.y:0)+parseFloat(d())),a.lineTo(z.x,z.y);break;case "C":for(;!c();){r=e();q=g();var C=f();Ld(a,r.x,r.y,q.x,q.y,C.x,C.y)}break;case "S":for(;!c();)r=h(),q=g(),C=f(),Ld(a,r.x,r.y,q.x,q.y,C.x,C.y);break;case "Q":for(;!c();)r=g(),q=f(),Md(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)y=r=h(),q=f(),Md(a, r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d());q=parseFloat(d());C=parseFloat(d());var G=parseFloat(d()),L=parseFloat(d()),J=L,U=!1;c()||(J=parseFloat(d()),c()||(U=0!==parseFloat(d())));v===v.toLowerCase()&&(C+=z.x,G+=z.y);a.arcTo(r,q,C,G,L,J,U)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),C=parseFloat(d()),G=!!parseFloat(d()),L=!!parseFloat(d()),J=f(),Rd(a,r,q,C,G,L,J.x,J.y);break;case "Z":Sd(a);z=m;break;case "F":r="";for(q=1;k[u+q];)if(null!== k[u+q].match(/[Uu]/))q++;else if(null===k[u+q].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))q++;else{r=k[u+q];break}r.match(/[Mm]/)?l=!0:0<a.fc.segments.length&&(a.fc.isFilled=!0);break;case "U":r="";for(q=1;k[u+q];)if(null!==k[u+q].match(/[Ff]/))q++;else if(null===k[u+q].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))q++;else{r=k[u+q];break}r.match(/[Mm]/)?n=!0:a.Uq(!1)}m=a.xt;Td=a;if(b)for(b=m.figures.iterator;b.next();)b.value.isFilled=!0;return m} function Ud(a,b){for(var c=a.length,d=I.alloc(),e=0;e<c;e++){var f=a[e];d.x=f[0];d.y=f[1];b.ra(d);f[0]=d.x;f[1]=d.y;d.x=f[2];d.y=f[3];b.ra(d);f[2]=d.x;f[3]=d.y;d.x=f[4];d.y=f[5];b.ra(d);f[4]=d.x;f[5]=d.y;d.x=f[6];d.y=f[7];b.ra(d);f[6]=d.x;f[7]=d.y}I.free(d)}t.Sv=function(){if(this.qa||this.Mr!==this.figures.Aa)return!0;for(var a=this.figures.j,b=a.length,c=0;c<b;c++)if(a[c].Sv())return!0;return!1}; sd.prototype.computeBounds=function(){this.qa=!1;this.Xm=this.Ik=null;this.Ym=NaN;this.Mr=this.figures.Aa;for(var a=this.figures.j,b=a.length,c=0;c<b;c++){var d=a[c];d.qa=!1;var e=d.segments;d.Ts=e.Aa;d=e.j;e=d.length;for(var f=0;f<e;f++){var g=d[f];g.qa=!1;g.Le=null}}a=this.ur;a.ea();isNaN(this.ll)||isNaN(this.kl)?a.h(0,0,0,0):a.h(0,0,this.ll,this.kl);Vd(this,a,!1);ec(a,0,0,0,0);a.freeze()};sd.prototype.Nx=function(){var a=new N;Vd(this,a,!0);return a}; function Vd(a,b,c){switch(a.type){case vd:case zd:case Hd:c?b.h(a.Sc,a.Tc,0,0):ec(b,a.Sc,a.Tc,0,0);ec(b,a.ec,a.nc,0,0);break;case td:var d=a.figures;a=d.j;d=d.length;for(var e=0;e<d;e++){var f=a[e];c&&0===e?b.h(f.startX,f.startY,0,0):ec(b,f.startX,f.startY,0,0);for(var g=f.segments.j,h=g.length,k=f.startX,l=f.startY,m=0;m<h;m++){var n=g[m];switch(n.type){case xd:case Wd:k=n.endX;l=n.endY;ec(b,k,l,0,0);break;case Xd:K.dm(k,l,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY; break;case Yd:K.aw(k,l,n.point1X,n.point1Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY;break;case Zd:case $d:var p=n.type===Zd?ae(n,f):be(n,f,k,l),r=p.length;if(0===r){k=n.centerX;l=n.centerY;ec(b,k,l,0,0);break}n=null;for(var q=0;q<r;q++)n=p[q],K.dm(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.5,b);null!==n&&(k=n[6],l=n[7]);break;default:B("Unknown Segment type: "+n.type)}}}break;default:B("Unknown Geometry type: "+a.type)}} sd.prototype.normalize=function(){this.s&&ua(this);var a=this.Nx();this.offset(-a.x,-a.y);return new I(-a.x,-a.y)};sd.prototype.offset=function(a,b){this.s&&ua(this);this.transform(1,0,0,1,a,b);return this};sd.prototype.scale=function(a,b){this.s&&ua(this);this.transform(a,0,0,b,0,0);return this};sd.prototype.rotate=function(a,b,c){this.s&&ua(this);void 0===b&&(b=0);void 0===c&&(c=0);var d=qd.alloc();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);qd.free(d);return this}; t=sd.prototype; t.transform=function(a,b,c,d,e,f){switch(this.type){case vd:case zd:case Hd:var g=this.Sc;var h=this.Tc;this.Sc=g*a+h*c+e;this.Tc=g*b+h*d+f;g=this.ec;h=this.nc;this.ec=g*a+h*c+e;this.nc=g*b+h*d+f;break;case td:for(var k=this.figures.j,l=k.length,m=0;m<l;m++){var n=k[m];g=n.startX;h=n.startY;n.startX=g*a+h*c+e;n.startY=g*b+h*d+f;n=n.segments.j;for(var p=n.length,r=0;r<p;r++){var q=n[r];switch(q.type){case xd:case Wd:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case Xd:g=q.point1X;h=q.point1Y; q.point1X=g*a+h*c+e;q.point1Y=g*b+h*d+f;g=q.point2X;h=q.point2Y;q.point2X=g*a+h*c+e;q.point2Y=g*b+h*d+f;g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case Yd:g=q.point1X;h=q.point1Y;q.point1X=g*a+h*c+e;q.point1Y=g*b+h*d+f;g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case Zd:g=q.centerX;h=q.centerY;q.centerX=g*a+h*c+e;q.centerY=g*b+h*d+f;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle);0>d&& (q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case $d:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c);q.radiusY*=Math.sqrt(b*b+d*d);break;default:B("Unknown Segment type: "+ q.type)}}}}this.qa=!0;return this}; t.aa=function(a,b){void 0===b&&(b=0);var c=this.Sc,d=this.Tc,e=this.ec,f=this.nc;switch(this.type){case vd:return K.Ob(c,d,e,f,b,a.x,a.y);case zd:var g=N.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.aa(a);N.free(g);return a;case Hd:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case td:return ce(this,a,b,!0,!1);default:return!1}}; function ce(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.j,r=p.length,q=0;q<r;q++){var u=p[q];if(u.isFilled){if(d&&u.aa(f,b,c))return!0;var v=u.segments;k=u.startX;l=u.startY;for(var w=k,y=l,z=v.j,A=0;A<=v.length;A++){var C=void 0;if(A!==v.length){C=z[A];var G=C.type;a=C.endX;n=C.endY}else G=xd,a=w,n=y;switch(G){case Wd:w=de(f,b,g,b,k,l,w,y);if(isNaN(w))return!0;h+=w;w=a;y=n;break;case xd:k=de(f,b,g,b,k,l,a,n);if(isNaN(k))return!0;h+=k;break;case Xd:m=K.lq(k,l,C.point1X, C.point1Y,C.point2X,C.point2Y,a,n,g,b,f,b,.5);h+=m;break;case Yd:m=K.lq(k,l,(k+2*C.point1X)/3,(l+2*C.point1Y)/3,(2*C.point1X+a)/3,(2*C.point1Y+n)/3,a,n,g,b,f,b,.5);h+=m;break;case Zd:case $d:G=C.type===Zd?ae(C,u):be(C,u,k,l);var L=G.length;if(0===L){k=de(f,b,g,b,k,l,C.centerX,C.centerY);if(isNaN(k))return!0;h+=k;break}C=null;for(var J=0;J<L;J++){C=G[J];if(0===J){m=de(f,b,g,b,k,l,C[0],C[1]);if(isNaN(m))return!0;h+=m}m=K.lq(C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],g,b,f,b,.5);h+=m}null!==C&&(a=C[6], n=C[7]);break;default:B("Unknown Segment type: "+C.type)}k=a;l=n}if(0!==h)return!0;h=0}else if(u.aa(f,b,e?c:c+2))return!0}return 0!==h}function de(a,b,c,d,e,f,g,h){if(K.Ob(e,f,g,h,.05,a,b))return NaN;var k=(a-c)*(f-h);if(0===k)return 0;var l=((a*d-b*c)*(e-g)-(a-c)*(e*h-f*g))/k;b=(a*d-b*c)*(f-h)/k;if(l>=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(f<h){if(b<f||b>h)return 0}else{if(b<h||b>f)return 0}else if(e<g){if(l<e||l>g)return 0}else if(l<g||l>e)return 0;return 0<k?1:-1} function ee(a,b,c,d){a=a.figures.j;for(var e=a.length,f=0;f<e;f++)if(a[f].aa(b,c,d))return!0;return!1} t.Iv=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=new I);if(this.type===vd)return b.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++){var k=d[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(g+m>=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; t.Zx=function(a){0>a?a=0:1<a&&(a=1);if(this.type===vd)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var b=this.flattenedSegments,c=this.flattenedLengths,d=b.length,e=this.flattenedTotalLength*a,f=0,g=0;g<d;g++){var h=c[g],k=h.length;for(a=0;a<k;a++){var l=h[a];if(f+l>=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; t.Jv=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=[]);b.length=3;if(this.type===vd)return b[0]=this.startX+a*(this.endX-this.startX),b[1]=this.startY+a*(this.endY-this.startY),b[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++){var k=d[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(g+m>=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2*a+ 3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; t.$x=function(a){if(this.type===vd){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c<e){var g=c;d=e}else g=e,d=c;return a<=g?g===c?0:1:a>=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b<d?g=b:(g=d,d=b),f<=g?g===b?0:1:f>=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=I.alloc();K.Kh(b,c,d,e,f,a,h);a=h.x;f=h.y;I.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===zd){g=this.startX;h=this.startY;var k=this.endX; e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=I.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;n<k;n++)for(var p=b[n],r=c[n],q=p.length,u=0;u<q;u+=2){var v= p[u],w=p[u+1];if(0!==u){K.Kh(l,m,v,w,a.x,a.y,d);var y=(d.x-a.x)*(d.x-a.x)+(d.y-a.y)*(d.y-a.y);y<e&&(e=y,g=h,g+=Math.sqrt((d.x-l)*(d.x-l)+(d.y-m)*(d.y-m)));h+=r[(u-2)/2]}l=v;m=w}I.free(d);a=g/f;return 0>a?0:1<a?1:a}return 0}; function fe(a){if(null===a.Ik){var b=a.Ik=[],c=a.Xm=[],d=[],e=[];if(a.type===vd)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.endY),b.push(d),e.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),c.push(e);else if(a.type===zd)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.startY),d.push(a.endX),d.push(a.endY),d.push(a.startX),d.push(a.endY),d.push(a.startX),d.push(a.startY),b.push(d),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY- a.endY)),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY-a.endY)),c.push(e);else if(a.type===Hd){var f=new ge;f.startX=a.endX;f.startY=(a.startY+a.endY)/2;var g=new oe(Zd);g.startAngle=0;g.sweepAngle=360;g.centerX=(a.startX+a.endX)/2;g.centerY=(a.startY+a.endY)/2;g.radiusX=Math.abs(a.startX-a.endX)/2;g.radiusY=Math.abs(a.startY-a.endY)/2;f.add(g);a=ae(g,f);e=a.length;if(0===e)d.push(g.centerX),d.push(g.centerY);else{g=f.startX;f=f.startY;for(var h=0;h<e;h++){var k=a[h];K.Be(g,f,k[2],k[3], k[4],k[5],k[6],k[7],.5,d);g=k[6];f=k[7]}}b.push(d);c.push(pe(d))}else for(a=a.figures.iterator;a.next();){e=a.value;d=[];d.push(e.startX);d.push(e.startY);g=e.startX;f=e.startY;h=g;k=f;for(var l=e.segments.j,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.type){case Wd:4<=d.length&&(b.push(d),c.push(pe(d)));d=[];d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;h=g;k=f;break;case xd:d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;break;case Xd:K.Be(g,f,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY, .5,d);g=p.endX;f=p.endY;break;case Yd:K.Kq(g,f,p.point1X,p.point1Y,p.endX,p.endY,.5,d);g=p.endX;f=p.endY;break;case Zd:var r=ae(p,e),q=r.length;if(0===q){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(var u=0;u<q;u++){var v=r[u];K.Be(g,f,v[2],v[3],v[4],v[5],v[6],v[7],.5,d);g=v[6];f=v[7]}break;case $d:r=be(p,e,g,f);q=r.length;if(0===q){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(u=0;u<q;u++)v=r[u],K.Be(g,f,v[2],v[3],v[4],v[5],v[6],v[7],.5,d),g=v[6], f=v[7];break;default:B("Segment not of valid type: "+p.type)}p.isClosed&&(d.push(h),d.push(k))}4<=d.length&&(b.push(d),c.push(pe(d)))}}}function pe(a){for(var b=[],c=0,d=0,e=a.length,f=0;f<e;f+=2){var g=a[f],h=a[f+1];0!==f&&b.push(Math.sqrt(Cb(c,d,g,h)));c=g;d=h}return b}t.add=function(a){this.uj.add(a);return this};t.Mm=function(a,b,c,d,e,f,g,h){this.s&&ua(this);this.hf=(new P(a,b,e,f)).freeze();this.jf=(new P(c,d,g,h)).freeze();return this}; ma.Object.defineProperties(sd.prototype,{flattenedSegments:{get:function(){fe(this);return this.Ik}},flattenedLengths:{get:function(){fe(this);return this.Xm}},flattenedTotalLength:{get:function(){var a=this.Ym;if(isNaN(a)){if(this.type===vd){a=Math.abs(this.endX-this.startX);var b=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+b*b)}else if(this.type===zd)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY- this.startY);else{b=this.flattenedLengths;for(var c=b.length,d=a=0;d<c;d++)for(var e=b[d],f=e.length,g=0;g<f;g++)a+=e[g]}this.Ym=a}return a}},type:{get:function(){return this.pa},set:function(a){this.pa!==a&&(this.s&&ua(this,a),this.pa=a,this.qa=!0)}},startX:{get:function(){return this.Sc},set:function(a){this.Sc!==a&&(this.s&&ua(this,a),this.Sc=a,this.qa=!0)}},startY:{get:function(){return this.Tc},set:function(a){this.Tc!== a&&(this.s&&ua(this,a),this.Tc=a,this.qa=!0)}},endX:{get:function(){return this.ec},set:function(a){this.ec!==a&&(this.s&&ua(this,a),this.ec=a,this.qa=!0)}},endY:{get:function(){return this.nc},set:function(a){this.nc!==a&&(this.s&&ua(this,a),this.nc=a,this.qa=!0)}},figures:{get:function(){return this.uj},set:function(a){this.uj!==a&&(this.s&&ua(this,a),this.uj=a,this.qa=!0)}},spot1:{ get:function(){return this.hf},set:function(a){this.s&&ua(this,a);this.hf=a.G()}},spot2:{get:function(){return this.jf},set:function(a){this.s&&ua(this,a);this.jf=a.G()}},defaultStretch:{get:function(){return this.Nf},set:function(a){this.s&&ua(this,a);this.Nf=a}},bounds:{get:function(){this.Sv()&&this.computeBounds();return this.ur}}});sd.prototype.setSpots=sd.prototype.Mm;sd.prototype.add=sd.prototype.add; sd.prototype.getFractionForPoint=sd.prototype.$x;sd.prototype.getPointAndAngleAlongPath=sd.prototype.Jv;sd.prototype.getAngleAlongPath=sd.prototype.Zx;sd.prototype.getPointAlongPath=sd.prototype.Iv;sd.prototype.containsPoint=sd.prototype.aa;sd.prototype.transform=sd.prototype.transform;sd.prototype.rotate=sd.prototype.rotate;sd.prototype.scale=sd.prototype.scale;sd.prototype.offset=sd.prototype.offset;sd.prototype.normalize=sd.prototype.normalize;sd.prototype.computeBoundsWithoutOrigin=sd.prototype.Nx; sd.prototype.equalsApprox=sd.prototype.Ma;var vd=new D(sd,"Line",0),zd=new D(sd,"Rectangle",1),Hd=new D(sd,"Ellipse",2),td=new D(sd,"Path",3);sd.className="Geometry";sd.stringify=yd;sd.fillPath=function(a){a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++){var e=a[d];c=null!==e.match(/[Ff]/)?0===d?c+e:c+("X"+(" "===e[0]?"":" ")+e):c+((0===d?"":"X ")+"F"+(" "===e[0]?"":" ")+e)}return c};sd.parse=Id;sd.Line=vd;sd.Rectangle=zd;sd.Ellipse=Hd;sd.Path=td; function ge(a,b,c,d){Ya(this);this.s=!1;void 0===c&&(c=!0);this.Xr=c;void 0===d&&(d=!0);this.cs=d;void 0!==a?this.Sc=a:this.Sc=0;void 0!==b?this.Tc=b:this.Tc=0;this.Ml=new E;this.Ts=this.Ml.Aa;this.qa=!0}ge.prototype.copy=function(){var a=new ge;a.Xr=this.Xr;a.cs=this.cs;a.Sc=this.Sc;a.Tc=this.Tc;for(var b=this.Ml.j,c=b.length,d=a.Ml,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.Ts=this.Ts;a.qa=this.qa;return a};t=ge.prototype; t.Ma=function(a){if(!(a instanceof ge&&K.A(this.startX,a.startX)&&K.A(this.startY,a.startY)))return!1;var b=this.segments.j;a=a.segments.j;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Ma(a[d]))return!1;return!0};t.toString=function(a){void 0===a&&(a=-1);var b=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.j,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b}; t.freeze=function(){this.s=!0;var a=this.segments;a.freeze();var b=a.j;a=a.length;for(var c=0;c<a;c++)b[c].freeze();return this};t.ea=function(){this.s=!1;var a=this.segments;a.ea();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].ea();return this};t.Sv=function(){if(this.qa)return!0;var a=this.segments;if(this.Ts!==a.Aa)return!0;a=a.j;for(var b=a.length,c=0;c<b;c++)if(a[c].qa)return!0;return!1};t.add=function(a){this.Ml.add(a);return this}; t.aa=function(a,b,c){for(var d=this.startX,e=this.startY,f=d,g=e,h=this.segments.j,k=h.length,l=0;l<k;l++){var m=h[l];switch(m.type){case Wd:f=m.endX;g=m.endY;d=m.endX;e=m.endY;break;case xd:if(K.Ob(d,e,m.endX,m.endY,c,a,b))return!0;d=m.endX;e=m.endY;break;case Xd:if(K.lt(d,e,m.point1X,m.point1Y,m.point2X,m.point2Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case Yd:if(K.bw(d,e,m.point1X,m.point1Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case Zd:case $d:var n=m.type=== Zd?ae(m,this):be(m,this,d,e),p=n.length;if(0===p){if(K.Ob(d,e,m.centerX,m.centerY,c,a,b))return!0;d=m.centerX;e=m.centerY;break}for(var r=null,q=0;q<p;q++)if(r=n[q],0===q&&K.Ob(d,e,r[0],r[1],c,a,b)||K.lt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:B("Unknown Segment type: "+m.type)}if(m.isClosed&&(d!==f||e!==g)&&K.Ob(d,e,f,g,c,a,b))return!0}return!1}; ma.Object.defineProperties(ge.prototype,{isFilled:{get:function(){return this.Xr},set:function(a){this.s&&ua(this,a);this.Xr=a}},isShadowed:{get:function(){return this.cs},set:function(a){this.s&&ua(this,a);this.cs=a}},startX:{get:function(){return this.Sc},set:function(a){this.s&&ua(this,a);this.Sc=a;this.qa=!0}},startY:{get:function(){return this.Tc},set:function(a){this.s&&ua(this, a);this.Tc=a;this.qa=!0}},segments:{get:function(){return this.Ml},set:function(a){this.s&&ua(this,a);this.Ml=a;this.qa=!0}}});ge.prototype.add=ge.prototype.add;ge.prototype.equalsApprox=ge.prototype.Ma;ge.className="PathFigure"; function oe(a,b,c,d,e,f,g,h){Ya(this);this.s=!1;void 0===a&&(a=xd);this.pa=a;void 0!==b?this.ec=b:this.ec=0;void 0!==c?this.nc=c:this.nc=0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===f&&(f=0);void 0===g&&(g=0);a===$d?(a=f%360,0>a&&(a+=360),this.xe=a,this.Hi=0,this.Ii=Math.max(d,0),this.hh=Math.max(e,0),this.tl="boolean"===typeof g?g:"number"===typeof g?!!g:!1,this.Mk=!!h):(this.xe=d,this.Hi=e,a===Zd&&(f=Math.max(f,0)),this.Ii=f,"number"===typeof g?(a===Zd&&(g=Math.max(g,0)),this.hh=g):this.hh=0, this.Mk=this.tl=!1);this.zj=!1;this.qa=!0;this.Le=null}oe.prototype.copy=function(){var a=new oe;a.pa=this.pa;a.ec=this.ec;a.nc=this.nc;a.xe=this.xe;a.Hi=this.Hi;a.Ii=this.Ii;a.hh=this.hh;a.tl=this.tl;a.Mk=this.Mk;a.zj=this.zj;a.qa=this.qa;return a};t=oe.prototype; t.Ma=function(a){if(!(a instanceof oe)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Wd:case xd:return K.A(this.endX,a.endX)&&K.A(this.endY,a.endY);case Xd:return K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)&&K.A(this.point1X,a.point1X)&&K.A(this.point1Y,a.point1Y)&&K.A(this.point2X,a.point2X)&&K.A(this.point2Y,a.point2Y);case Yd:return K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)&&K.A(this.point1X,a.point1X)&&K.A(this.point1Y,a.point1Y);case Zd:return K.A(this.startAngle, a.startAngle)&&K.A(this.sweepAngle,a.sweepAngle)&&K.A(this.centerX,a.centerX)&&K.A(this.centerY,a.centerY)&&K.A(this.radiusX,a.radiusX)&&K.A(this.radiusY,a.radiusY);case $d:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.A(this.xAxisRotation,a.xAxisRotation)&&K.A(this.endX,a.endX)&&K.A(this.endY,a.endY)&&K.A(this.radiusX,a.radiusX)&&K.A(this.radiusY,a.radiusY);default:return!1}};t.gb=function(a){a.classType===oe&&(this.type=a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Wd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case xd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Xd:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Yd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Zd:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ " "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case $d:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ " "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.zj?"z":"")};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.close=function(){this.zj=!0;return this}; function ae(a,b){if(null!==a.Le&&!1===b.qa)return a.Le;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Le=[],a.Le;b=a.xe;var e=a.Hi,f=K.Ox(0,0,c<d?c:d,a.startAngle,a.startAngle+a.sweepAngle,!1);if(c!==d){var g=qd.alloc();g.reset();c<d?g.scale(1,d/c):g.scale(c/d,1);Ud(f,g);qd.free(g)}c=f.length;for(d=0;d<c;d++)g=f[d],g[0]+=b,g[1]+=e,g[2]+=b,g[3]+=e,g[4]+=b,g[5]+=e,g[6]+=b,g[7]+=e;a.Le=f;return a.Le} function be(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos((a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d)))}if(null!==a.Le&&!1===b.qa)return a.Le;b=a.Ii;var f=a.hh;0===b&&(b=1E-4);0===f&&(f=1E-4);var g=Math.PI/180*a.xe,h=a.tl,k=a.Mk,l=a.ec,m=a.nc,n=Math.cos(g),p=Math.sin(g),r=n*(c-l)/2+p*(d-m)/2;g=-p*(c-l)/2+n*(d-m)/2;var q=r*r/(b*b)+g*g/(f*f);1<q&&(b*=Math.sqrt(q),f*=Math.sqrt(q));q=(h===k?-1:1)*Math.sqrt((b*b*f*f-b*b*g*g-f*f*r*r)/(b*b*g*g+f*f*r*r));isNaN(q)&&(q=0);h=q*b*g/f;q=q*-f* r/b;isNaN(h)&&(h=0);isNaN(q)&&(q=0);c=(c+l)/2+n*h-p*q;d=(d+m)/2+p*h+n*q;m=e(1,0,(r-h)/b,(g-q)/f);n=(r-h)/b;l=(g-q)/f;r=(-r-h)/b;h=(-g-q)/f;g=e(n,l,r,h);r=(n*r+l*h)/(Math.sqrt(n*n+l*l)*Math.sqrt(r*r+h*h));-1>=r?g=Math.PI:1<=r&&(g=0);!k&&0<g&&(g-=2*Math.PI);k&&0>g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=K.Ox(0,0,b>f?b:f,m,m+g,!0);f=qd.alloc();f.reset();f.translate(c,d);f.rotate(a.xe,0,0);f.scale(k,r);Ud(b,f);qd.free(f);a.Le=b;return a.Le} ma.Object.defineProperties(oe.prototype,{isClosed:{get:function(){return this.zj},set:function(a){this.zj!==a&&(this.zj=a,this.qa=!0)}},type:{get:function(){return this.pa},set:function(a){this.s&&ua(this,a);this.pa=a;this.qa=!0}},endX:{get:function(){return this.ec},set:function(a){this.s&&ua(this,a);this.ec=a;this.qa=!0}},endY:{get:function(){return this.nc},set:function(a){this.s&& ua(this,a);this.nc=a;this.qa=!0}},point1X:{get:function(){return this.xe},set:function(a){this.s&&ua(this,a);this.xe=a;this.qa=!0}},point1Y:{get:function(){return this.Hi},set:function(a){this.s&&ua(this,a);this.Hi=a;this.qa=!0}},point2X:{get:function(){return this.Ii},set:function(a){this.s&&ua(this,a);this.Ii=a;this.qa=!0}},point2Y:{get:function(){return this.hh},set:function(a){this.s&& ua(this,a);this.hh=a;this.qa=!0}},centerX:{get:function(){return this.xe},set:function(a){this.s&&ua(this,a);this.xe=a;this.qa=!0}},centerY:{get:function(){return this.Hi},set:function(a){this.s&&ua(this,a);this.Hi=a;this.qa=!0}},radiusX:{get:function(){return this.Ii},set:function(a){0>a&&va(a,">= zero",oe,"radiusX");this.s&&ua(this,a);this.Ii=a;this.qa=!0}},radiusY:{get:function(){return this.hh}, set:function(a){0>a&&va(a,">= zero",oe,"radiusY");this.s&&ua(this,a);this.hh=a;this.qa=!0}},startAngle:{get:function(){return this.ec},set:function(a){this.ec!==a&&(this.s&&ua(this,a),a%=360,0>a&&(a+=360),this.ec=a,this.qa=!0)}},sweepAngle:{get:function(){return this.nc},set:function(a){this.s&&ua(this,a);360<a&&(a=360);-360>a&&(a=-360);this.nc=a;this.qa=!0}},isClockwiseArc:{get:function(){return this.Mk},set:function(a){this.s&& ua(this,a);this.Mk=a;this.qa=!0}},isLargeArc:{get:function(){return this.tl},set:function(a){this.s&&ua(this,a);this.tl=a;this.qa=!0}},xAxisRotation:{get:function(){return this.xe},set:function(a){a%=360;0>a&&(a+=360);this.s&&ua(this,a);this.xe=a;this.qa=!0}}});oe.prototype.equalsApprox=oe.prototype.Ma; var Wd=new D(oe,"Move",0),xd=new D(oe,"Line",1),Xd=new D(oe,"Bezier",2),Yd=new D(oe,"QuadraticBezier",3),Zd=new D(oe,"Arc",4),$d=new D(oe,"SvgArc",4);oe.className="PathSegment";oe.Move=Wd;oe.Line=xd;oe.Bezier=Xd;oe.QuadraticBezier=Yd;oe.Arc=Zd;oe.SvgArc=$d;function qe(){this.B=null;this.kv=(new I(0,0)).freeze();this.uu=(new I(0,0)).freeze();this.lr=this.qs=0;this.mr=1;this.gs="";this.gt=this.Gr=!1;this.Dr=this.pr=0;this.Jg=this.Qr=this.$r=!1;this.Lr=null;this.bt=0;this.cd=this.at=null} qe.prototype.copy=function(){var a=new qe;return this.clone(a)};qe.prototype.clone=function(a){a.B=this.B;a.kv.assign(this.viewPoint);a.uu.assign(this.documentPoint);a.qs=this.qs;a.lr=this.lr;a.mr=this.mr;a.gs=this.gs;a.Gr=this.Gr;a.gt=this.gt;a.pr=this.pr;a.Dr=this.Dr;a.$r=this.$r;a.Qr=this.Qr;a.Jg=this.Jg;a.Lr=this.Lr;a.bt=this.bt;a.at=this.at;a.cd=this.cd;return a}; qe.prototype.toString=function(){var a="^";0!==this.modifiers&&(a+="M:"+this.modifiers);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.clickCount&&(a+="C:"+this.clickCount);0!==this.delta&&(a+="D:"+this.delta);this.handled&&(a+="h");this.bubbles&&(a+="b");null!==this.documentPoint&&(a+="@"+this.documentPoint.toString());return a};qe.prototype.vq=function(a,b){var c=this.diagram;if(null===c)return b;re(c,this.event,a,b);return b}; qe.prototype.Nz=function(a,b){var c=this.diagram;if(null===c)return b;re(c,this.event,a,b);b.assign(c.au(b));return b}; ma.Object.defineProperties(qe.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},viewPoint:{get:function(){return this.kv},set:function(a){this.kv.assign(a)}},documentPoint:{get:function(){return this.uu},set:function(a){this.uu.assign(a)}},modifiers:{get:function(){return this.qs},set:function(a){this.qs=a}},button:{get:function(){return this.lr}, set:function(a){this.lr=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.mr},set:function(a){this.mr=a}},key:{get:function(){return this.gs},set:function(a){this.gs=a}},down:{get:function(){return this.Gr},set:function(a){this.Gr=a}},up:{get:function(){return this.gt},set:function(a){this.gt= a}},clickCount:{get:function(){return this.pr},set:function(a){this.pr=a}},delta:{get:function(){return this.Dr},set:function(a){this.Dr=a}},isMultiTouch:{get:function(){return this.$r},set:function(a){this.$r=a}},handled:{get:function(){return this.Qr},set:function(a){this.Qr=a}},bubbles:{get:function(){return this.Jg},set:function(a){this.Jg=a}},event:{ get:function(){return this.Lr},set:function(a){this.Lr=a}},isTouchEvent:{get:function(){var a=x.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=x.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{get:function(){return this.bt},set:function(a){this.bt=a}},targetDiagram:{get:function(){return this.at},set:function(a){this.at=a}},targetObject:{ get:function(){return this.cd},set:function(a){this.cd=a}},control:{get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers| 2:this.modifiers&-3}},meta:{get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a= this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&4):1===this.button},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}); qe.prototype.getMultiTouchDocumentPoint=qe.prototype.Nz;qe.prototype.getMultiTouchViewPoint=qe.prototype.vq;qe.className="InputEvent";function se(){this.B=null;this.Qa="";this.As=this.$s=null}se.prototype.copy=function(){var a=new se;a.B=this.B;a.Qa=this.Qa;a.$s=this.$s;a.As=this.As;return a};se.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; ma.Object.defineProperties(se.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},subject:{get:function(){return this.$s},set:function(a){this.$s=a}},parameter:{get:function(){return this.As},set:function(a){this.As=a}}});se.className="DiagramEvent"; function te(){this.hn=ue;this.af=this.ps="";this.To=this.Uo=this.$o=this.ap=this.Zo=this.B=this.ac=null}te.prototype.clear=function(){this.To=this.Uo=this.$o=this.ap=this.Zo=this.B=this.ac=null}; te.prototype.copy=function(){var a=new te;a.hn=this.hn;a.ps=this.ps;a.af=this.af;a.ac=this.ac;a.B=this.B;a.Zo=this.Zo;var b=this.ap;a.ap=za(b)&&"function"===typeof b.G?b.G():b;b=this.$o;a.$o=za(b)&&"function"===typeof b.G?b.G():b;b=this.Uo;a.Uo=za(b)&&"function"===typeof b.G?b.G():b;b=this.To;a.To=za(b)&&"function"===typeof b.G?b.G():b;return a};te.prototype.gb=function(a){a.classType===te&&(this.change=a)}; te.prototype.toString=function(){var a="";a=this.change===ve?a+"* ":this.change===ue?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===ve?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ja(this.object)),null!==this.oldValue&&(a+=" old: "+Ja(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ja(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};te.prototype.H=function(a){return a?this.oldValue:this.newValue};te.prototype.Pz=function(a){return a?this.oldParam:this.newParam};te.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; te.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};te.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};te.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; ma.Object.defineProperties(te.prototype,{model:{get:function(){return this.ac},set:function(a){this.ac=a}},diagram:{get:function(){return this.B},set:function(a){this.B=a}},change:{get:function(){return this.hn},set:function(a){this.hn=a}},modelChange:{get:function(){return this.ps},set:function(a){this.ps=a}},propertyName:{get:function(){return this.af}, set:function(a){this.af=a}},isTransactionFinished:{get:function(){return this.hn===ve&&("CommittedTransaction"===this.af||"FinishedUndo"===this.af||"FinishedRedo"===this.af)}},object:{get:function(){return this.Zo},set:function(a){this.Zo=a}},oldValue:{get:function(){return this.ap},set:function(a){this.ap=a}},oldParam:{get:function(){return this.$o},set:function(a){this.$o=a}}, newValue:{get:function(){return this.Uo},set:function(a){this.Uo=a}},newParam:{get:function(){return this.To},set:function(a){this.To=a}}});te.prototype.redo=te.prototype.redo;te.prototype.canRedo=te.prototype.canRedo;te.prototype.undo=te.prototype.undo;te.prototype.canUndo=te.prototype.canUndo;te.prototype.getParam=te.prototype.Pz;te.prototype.getValue=te.prototype.H;te.prototype.clear=te.prototype.clear; var ve=new D(te,"Transaction",-1),ue=new D(te,"Property",0),we=new D(te,"Insert",1),xe=new D(te,"Remove",2);te.className="ChangedEvent";te.Transaction=ve;te.Property=ue;te.Insert=we;te.Remove=xe;function ye(){this.u=(new E).freeze();this.Qa="";this.l=!1}ye.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0<a){a=this.changes.count;for(var c=0;c<a;c++){var d=this.changes.L(c);null!==d&&(b+="\n "+d.toString())}}return b}; ye.prototype.clear=function(){var a=this.changes;a.ea();for(var b=a.count-1;0<=b;b--){var c=a.L(b);null!==c&&c.clear()}a.clear();a.freeze()};ye.prototype.canUndo=function(){return this.isComplete};ye.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var b=this.changes.L(a);null!==b&&b.undo()}};ye.prototype.canRedo=function(){return this.isComplete}; ye.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,b=0;b<a;b++){var c=this.changes.L(b);null!==c&&c.redo()}};ma.Object.defineProperties(ye.prototype,{changes:{get:function(){return this.u}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},isComplete:{get:function(){return this.l},set:function(a){this.l=a}}});ye.prototype.redo=ye.prototype.redo;ye.prototype.canRedo=ye.prototype.canRedo; ye.prototype.undo=ye.prototype.undo;ye.prototype.canUndo=ye.prototype.canUndo;ye.prototype.clear=ye.prototype.clear;ye.className="Transaction";function ze(){this.Tu=new F;this.ad=!1;this.I=(new E).freeze();this.Kd=-1;this.u=999;this.ne=!1;this.Ar=null;this.Pi=0;this.l=!1;this.te=(new E).freeze();this.Bl=new E;this.Bu=!0;this.Iu=this.Yr=this.Mu=this.Lu=!1} ze.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.nestedTransactionNames.L(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.L(d).toString(a-1);return b}; ze.prototype.clear=function(){var a=this.history;a.ea();for(var b=a.count-1;0<=b;b--){var c=a.L(b);null!==c&&c.clear()}a.clear();this.Kd=-1;a.freeze();this.ne=!1;this.Ar=null;this.Pi=0;this.te.ea();this.te.clear();this.te.freeze();this.Bl.clear();this.Iu=this.Yr=this.Mu=this.Lu=!1};ze.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled;this.maxHistoryLength=a.maxHistoryLength;this.checksTransactionLevel=a.checksTransactionLevel};t=ze.prototype;t.Gx=function(a){this.Tu.add(a)};t.uy=function(a){this.Tu.remove(a)}; t.ua=function(a){void 0===a&&(a="");null===a&&(a="");if(this.isUndoingRedoing)return!1;!0===this.Bu&&(this.Bu=!1,this.Pi++,this.isInternalTransaction||this.zb("StartingFirstTransaction",a,this.currentTransaction),0<this.Pi&&this.Pi--);this.isEnabled&&(this.te.ea(),this.te.add(a),this.te.freeze(),null===this.currentTransaction?this.Bl.add(0):this.Bl.add(this.currentTransaction.changes.count));this.Pi++;var b=1===this.transactionLevel;b&&(this.isInternalTransaction||this.zb("StartedTransaction",a,this.currentTransaction)); return b};t.Va=function(a){void 0===a&&(a="");return Ae(this,!0,a)};t.Bf=function(){return Ae(this,!1,"")}; function Ae(a,b,c){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&wa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.zb("CommittingTransaction",c,e));var f=0;if(0<a.transactionLevel&&(a.Pi--,a.isEnabled)){var g=a.te.count;0<g&&(""===c&&(c=a.te.L(0)),a.te.ea(),a.te.ab(g-1),a.te.freeze());g=a.Bl.count;0<g&&(f=a.Bl.L(g-1),a.Bl.ab(g-1))}if(d){if(b){a.Yr=!1;null===e&&""!== c&&(e=a.currentTransaction);if(a.isEnabled&&null!==e){e.isComplete||(e.isComplete=!0,e.name=c);b=a.history;b.ea();for(d=b.count-1;d>a.historyIndex;d--)f=b.L(d),null!==f&&f.clear(),b.ab(d),a.Yr=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.L(0),null!==f&&f.clear(),b.ab(0),a.Kd--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Kd++);b.freeze()}a.isInternalTransaction||a.zb("CommittedTransaction",c,e)}else{a.ne=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| a.zb("RolledBackTransaction",c,e),a.ne=!1}null!==e&&e.clear()}a.Ar=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.L(e),null!==b&&b.undo(),c.ea(),c.ab(e);c.freeze()}return!1}ze.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return null!==a&&a.canUndo()?!0:!1}; ze.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.ne=!0,this.zb("StartingUndo","Undo",a),this.Kd--,a.undo()}catch(b){wa("undo error: "+b.toString())}finally{this.zb("FinishedUndo","Undo",a),this.ne=!1}}};ze.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return null!==a&&a.canRedo()?!0:!1}; ze.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.ne=!0,this.zb("StartingRedo","Redo",a),this.Kd++,a.redo()}catch(b){wa("redo error: "+b.toString())}finally{this.zb("FinishedRedo","Redo",a),this.ne=!1}}};ze.prototype.zb=function(a,b,c){void 0===c&&(c=null);var d=new te;d.change=ve;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.models;a.next();)b=a.value,d.model=b,b.mt(d)}; ze.prototype.Mv=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var b=this.currentTransaction;null===b&&(this.Ar=b=new ye);var c=a.copy();b=b.changes;b.ea();b.add(c);b.freeze();this.checksTransactionLevel&&0>=this.transactionLevel&&!this.Bu&&(a=a.diagram,null!==a&&!1===a.mk||wa("Change not within a transaction: "+c.toString()))}}; ze.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; ma.Object.defineProperties(ze.prototype,{models:{get:function(){return this.Tu.iterator}},isEnabled:{get:function(){return this.ad},set:function(a){this.ad=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.L(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count- 1?this.history.L(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.ne}},history:{get:function(){return this.I}},maxHistoryLength:{get:function(){return this.u},set:function(a){this.u=a}},historyIndex:{get:function(){return this.Kd}},currentTransaction:{get:function(){return this.Ar}},transactionLevel:{ get:function(){return this.Pi}},isInTransaction:{get:function(){return 0<this.Pi}},checksTransactionLevel:{get:function(){return this.l},set:function(a){this.l=a}},nestedTransactionNames:{get:function(){return this.te}},isPendingClear:{get:function(){return this.Lu},set:function(a){this.Lu=a}},isPendingUnmodified:{get:function(){return this.Mu},set:function(a){this.Mu= a}},isInternalTransaction:{get:function(){return this.Iu},set:function(a){this.Iu=a}},isJustDiscarded:{get:function(){return this.Yr}}});ze.prototype.handleChanged=ze.prototype.Mv;ze.prototype.redo=ze.prototype.redo;ze.prototype.undo=ze.prototype.undo;ze.prototype.canUndo=ze.prototype.canUndo;ze.prototype.rollbackTransaction=ze.prototype.Bf;ze.prototype.commitTransaction=ze.prototype.Va;ze.prototype.startTransaction=ze.prototype.ua; ze.prototype.removeModel=ze.prototype.uy;ze.prototype.addModel=ze.prototype.Gx;ze.prototype.clear=ze.prototype.clear;ze.className="UndoManager";function Be(){Ya(this);this.B=Ce;this.Qa="";this.ad=!0;this.kd=!1;this.Qw=null;this.Py=new qe;this.jt=-1}Be.prototype.toString=function(){return""!==this.name?this.name+" Tool":Ia(this.constructor)};Be.prototype.updateAdornments=function(){};Be.prototype.canStart=function(){return this.isEnabled};Be.prototype.doStart=function(){}; Be.prototype.doActivate=function(){this.isActive=!0};Be.prototype.doDeactivate=function(){this.isActive=!1};Be.prototype.doStop=function(){};Be.prototype.doCancel=function(){this.transactionResult=null;this.stopTool()};Be.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")};Be.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()};Be.prototype.doMouseMove=function(){};Be.prototype.doMouseUp=function(){this.stopTool()}; Be.prototype.doMouseWheel=function(){};Be.prototype.canStartMultiTouch=function(){return!0};Be.prototype.standardPinchZoomStart=function(){var a=this.diagram,b=a.lastInput,c=b.vq(0,I.allocAt(NaN,NaN)),d=b.vq(1,I.allocAt(NaN,NaN));if(c.v()&&d.v()&&(this.doCancel(),a.om("hasGestureZoom"))){a.Dl=a.scale;var e=d.x-c.x,f=d.y-c.y;a.ev=Math.sqrt(e*e+f*f);b.bubbles=!1}I.free(c);I.free(d)}; Be.prototype.standardPinchZoomMove=function(){var a=this.diagram,b=a.lastInput,c=b.vq(0,I.allocAt(NaN,NaN)),d=b.vq(1,I.allocAt(NaN,NaN));if(c.v()&&d.v()&&(this.doCancel(),a.om("hasGestureZoom"))){var e=d.x-c.x,f=d.y-c.y;f=Math.sqrt(e*e+f*f)/a.ev;e=new I((Math.min(d.x,c.x)+Math.max(d.x,c.x))/2,(Math.min(d.y,c.y)+Math.max(d.y,c.y))/2);f*=a.Dl;var g=a.commandHandler;if(f!==a.scale&&g.canResetZoom(f)){var h=a.zoomPoint;a.zoomPoint=e;g.resetZoom(f);a.zoomPoint=h}b.bubbles=!1}I.free(c);I.free(d)}; Be.prototype.doKeyDown=function(){"Esc"===this.diagram.lastInput.key&&this.doCancel()};Be.prototype.doKeyUp=function(){};Be.prototype.ua=function(a){void 0===a&&(a=this.name);this.transactionResult=null;return this.diagram.ua(a)};Be.prototype.Dg=function(){var a=this.diagram;return null===this.transactionResult?a.Bf():a.Va(this.transactionResult)}; Be.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var b=a.lastInput,c=a.lm(b.documentPoint,!1);if(null!==c)if(Wa?b.meta:b.control){a.R("ChangingSelection",a.selection);for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&(b.isSelected=!b.isSelected);a.R("ChangedSelection",a.selection)}else if(b.shift){if(!c.isSelected){a.R("ChangingSelection",a.selection);for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&(b.isSelected=!0);a.R("ChangedSelection", a.selection)}}else{if(!c.isSelected){for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&a.select(b)}}else!b.left||(Wa?b.meta:b.control)||b.shift||a.clearSelection()}};Be.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.isTemporary});var c=this.diagram,d=c.lastInput;a=c.Ub(d.documentPoint,a,b);d.targetObject=a;De(a,d,c);return d.handled}; function De(a,b,c){b.handled=!1;if(null===a||a.Ag()){var d=0;b.left?d=1===b.clickCount?1:2===b.clickCount?2:1:b.right&&1===b.clickCount&&(d=3);var e="ObjectSingleClicked";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.R(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.R(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c= a.click;break;case 2:c=a.doubleClick?a.doubleClick:a.click;break;case 3:c=a.contextClick}if(null!==c&&(c(b,a),b.handled))break;a=a.panel}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.doubleClick?c.doubleClick:c.click;break;case 3:a=c.contextClick}null!==a&&a(b)}}} Be.prototype.standardMouseOver=function(){var a=this.diagram,b=a.lastInput;if(!0!==a.animationManager.qc){var c=a.skipsUndoManager;a.skipsUndoManager=!0;var d=a.viewportBounds.aa(b.documentPoint)?a.Ub(b.documentPoint,null,null):null;b.targetObject=d;var e=!1;if(d!==a.pj){var f=a.pj,g=f;a.pj=d;this.doCurrentObjectChanged(f,d);for(b.handled=!1;null!==f;){var h=f.mouseLeave;if(null!==h){if(d===f)break;if(null!==d&&d.zg(f))break;h(b,f,d);e=!0;if(b.handled)break}f=f.panel}f=g;for(b.handled=!1;null!==d;){g= d.mouseEnter;if(null!==g){if(f===d)break;if(null!==f&&f.zg(d))break;g(b,d,f);e=!0;if(b.handled)break}d=d.panel}d=a.pj}if(null!==d){f=d;for(g="";null!==f;){g=f.cursor;if(""!==g)break;f=f.panel}a.currentCursor=g;b.handled=!1;for(f=d;null!==f;){d=f.mouseOver;if(null!==d&&(d(b,f),e=!0,b.handled))break;f=f.panel}}else a.currentCursor="",d=a.mouseOver,null!==d&&(d(b),e=!0);e&&a.Bb();a.skipsUndoManager=c}};Be.prototype.doCurrentObjectChanged=function(){}; Be.prototype.standardMouseWheel=function(){var a=this.diagram,b=a.lastInput,c=b.delta;if(0!==c&&a.documentBounds.v()){var d=a.commandHandler,e=a.toolManager.mouseWheelBehavior;if(null!==d&&(e===Ee&&!b.shift||e===Fe&&b.control)){if(0<c?d.canIncreaseZoom():d.canDecreaseZoom())e=a.zoomPoint,a.zoomPoint=b.viewPoint,0<c?d.increaseZoom():d.decreaseZoom(),a.zoomPoint=e;b.bubbles=!1}else if(e===Ee&&b.shift||e===Fe&&!b.control){d=a.position.copy();var f=0<c?c:-c,g=b.event,h=g.deltaMode;e=g.deltaX;g=g.deltaY; if(Ta||Ua||Va)h=1,0<e&&(e=3),0>e&&(e=-3),0<g&&(g=3),0>g&&(g=-3);if(void 0===h||void 0===e||void 0===g||0===e&&0===g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3*f*a.scrollVerticalLineChange,0<c?a.scroll("pixel","up",f):a.scroll("pixel","down",f)):b.shift&&a.allowHorizontalScroll&&(f=3*f*a.scrollHorizontalLineChange,0<c?a.scroll("pixel","left",f):a.scroll("pixel","right",f));else{switch(h){case 0:c="pixel";break;case 1:c="line";break;case 2:c="page";break;default:c="pixel"}0!==e&&a.allowHorizontalScroll&& (e*=a.scrollHorizontalLineChange/16,0<e?a.scroll(c,"left",-e):a.scroll(c,"right",e));0!==g&&a.allowVerticalScroll&&(g*=a.scrollVerticalLineChange/16,0<g?a.scroll(c,"up",-g):a.scroll(c,"down",g))}a.position.w(d)||(b.bubbles=!1)}}};Be.prototype.standardWaitAfter=function(a,b){void 0===b&&(b=this.diagram.lastInput);this.cancelWaitAfter();var c=this,d=b.clone(this.Py);this.jt=sa(function(){c.doWaitAfter(d)},a)};Be.prototype.cancelWaitAfter=function(){-1!==this.jt&&x.clearTimeout(this.jt);this.jt=-1}; Be.prototype.doWaitAfter=function(){};Be.prototype.findToolHandleAt=function(a,b){a=this.diagram.Ub(a,function(a){for(;null!==a&&!(a.panel instanceof Ke);)a=a.panel;return a});return null===a?null:a.part.category===b?a:null};Be.prototype.isBeyondDragSize=function(a,b){var c=this.diagram;void 0===a&&(a=c.firstInput.viewPoint);void 0===b&&(b=c.lastInput.viewPoint);var d=c.toolManager.dragSize,e=d.width;d=d.height;c.firstInput.isTouchEvent&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d}; ma.Object.defineProperties(Be.prototype,{diagram:{get:function(){return this.B},set:function(a){a instanceof Q&&(this.B=a)}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},isEnabled:{get:function(){return this.ad},set:function(a){this.ad=a}},isActive:{get:function(){return this.kd},set:function(a){this.kd=a}},transactionResult:{get:function(){return this.Qw}, set:function(a){this.Qw=a}}});Be.prototype.stopTransaction=Be.prototype.Dg;Be.prototype.startTransaction=Be.prototype.ua;Be.className="Tool";function Oa(){Be.call(this);this.name="ToolManager";this.Kc=new E;this.Yc=new E;this.Ef=new E;this.T=this.Ia=850;this.u=(new M(2,2)).ca();this.bb=5E3;this.Ja=Fe;this.I=Le;this.zr=this.l=null;this.Tj=-1}la(Oa,Be);Oa.prototype.initializeStandardTools=function(){}; Oa.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Ke&&this.zr===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Oa.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Me&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Ne){b.bubbles=!0;return}if(this.gestureBehavior===Me)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var c=this.mouseDownTools.length,d=0;d<c;d++){var e=this.mouseDownTools.L(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool=== e&&(e.isActive||e.doActivate(),e.doMouseDown());return}}1===a.lastInput.button&&(this.mouseWheelBehavior===Fe?this.mouseWheelBehavior=Ee:this.mouseWheelBehavior===Ee&&(this.mouseWheelBehavior=Fe));this.doActivate();this.standardWaitAfter(this.holdDelay,b)}; Oa.prototype.doMouseMove=function(){var a=this.diagram,b=a.lastInput;if(b.isMultiTouch){if(this.gestureBehavior===Ne){b.bubbles=!0;return}if(this.gestureBehavior===Me)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var c=this.mouseMoveTools.length,d=0;d<c;d++){var e=this.mouseMoveTools.L(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool===e&&(e.isActive||e.doActivate(),e.doMouseMove());return}}Oe(this, a);a=b.event;null===a||"mousemove"!==a.type&&"pointermove"!==a.type&&a.cancelable||(b.bubbles=!0)};function Oe(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,b.lastInput)}Oa.prototype.doCurrentObjectChanged=function(a,b){a=this.currentToolTip;null===a||null!==b&&a instanceof Ke&&(b===a||b.zg(a))||this.hideToolTip()}; Oa.prototype.doWaitAfter=function(a){var b=this.diagram;b.sa&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!b.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,b.lastInput=a,b.Sj=!0,b.doMouseUp()))}; Oa.prototype.doMouseHover=function(){var a=this.diagram,b=a.lastInput;null===b.targetObject&&(b.targetObject=a.Ub(b.documentPoint,null,null));var c=b.targetObject;if(null!==c)for(b.handled=!1;null!==c;){a=this.isActive?c.mouseHold:c.mouseHover;if(null!==a&&(a(b,c),b.handled))break;c=c.panel}else c=this.isActive?a.mouseHold:a.mouseHover,null!==c&&c(b)}; Oa.prototype.doToolTip=function(){var a=this.diagram,b=a.lastInput;null===b.targetObject&&(b.targetObject=a.Ub(b.documentPoint,null,null));b=b.targetObject;if(null!==b){if(a=this.currentToolTip,!(a instanceof Ke)||b!==a&&!b.zg(a)){for(;null!==b;){a=b.toolTip;if(null!==a){this.showToolTip(a,b);return}b=b.panel}this.hideToolTip()}}else b=a.toolTip,null!==b?this.showToolTip(b,null):this.hideToolTip()}; Oa.prototype.showToolTip=function(a,b){var c=this.diagram;a!==this.currentToolTip&&this.hideToolTip();if(a instanceof Ke){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?a.adornedObject=b:a.data=c.model;a.Ab();this.positionToolTip(a,b)}else a instanceof Pe&&a!==this.currentToolTip&&a.show(b,c,this);this.currentToolTip=a;-1!==this.Tj&&(x.clearTimeout(this.Tj), this.Tj=-1);a=this.toolTipDuration;if(0<a&&Infinity!==a){var e=this;this.Tj=sa(function(){e.hideToolTip()},a)}};Oa.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.diagram,c=b.lastInput.documentPoint.copy(),d=a.measuredBounds,e=b.viewportBounds;b.lastInput.isTouchEvent&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y=c.y+20/b.scale+d.height>e.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.y<e.y&&(c.y=e.y);a.position=c}}; Oa.prototype.hideToolTip=function(){-1!==this.Tj&&(x.clearTimeout(this.Tj),this.Tj=-1);var a=this.diagram,b=this.currentToolTip;null!==b&&(b instanceof Ke?(a.remove(b),null!==this.zr&&this.zr.Af(b.category),b.data=null,b.adornedObject=null):b instanceof Pe&&null!==b.hide&&b.hide(a,this),this.currentToolTip=null)}; Oa.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var b=this.mouseUpTools.length,c=0;c<b;c++){var d=this.mouseUpTools.L(c);d.diagram=this.diagram;if(d.canStart()){a.doFocus();a.currentTool=d;a.currentTool===d&&(d.isActive||d.doActivate(),d.doMouseUp());return}}a.doFocus();this.doDeactivate()};Oa.prototype.doMouseWheel=function(){this.standardMouseWheel()};Oa.prototype.doKeyDown=function(){var a=this.diagram;null!==a.commandHandler&&a.commandHandler.doKeyDown()}; Oa.prototype.doKeyUp=function(){var a=this.diagram;null!==a.commandHandler&&a.commandHandler.doKeyUp()};Oa.prototype.findTool=function(a){for(var b=this.mouseDownTools.length,c=0;c<b;c++){var d=this.mouseDownTools.L(c);if(d.name===a)return d}b=this.mouseMoveTools.length;for(c=0;c<b;c++)if(d=this.mouseMoveTools.L(c),d.name===a)return d;b=this.mouseUpTools.length;for(c=0;c<b;c++)if(d=this.mouseUpTools.L(c),d.name===a)return d;return null}; Oa.prototype.replaceTool=function(a,b){null!==b&&(b.diagram=this.diagram);for(var c=this.mouseDownTools.length,d=0;d<c;d++){var e=this.mouseDownTools.L(d);if(e.name===a)return null!==b?this.mouseDownTools.hd(d,b):this.mouseDownTools.ab(d),e}c=this.mouseMoveTools.length;for(d=0;d<c;d++)if(e=this.mouseMoveTools.L(d),e.name===a)return null!==b?this.mouseMoveTools.hd(d,b):this.mouseMoveTools.ab(d),e;c=this.mouseUpTools.length;for(d=0;d<c;d++)if(e=this.mouseUpTools.L(d),e.name===a)return null!==b?this.mouseUpTools.hd(d, b):this.mouseUpTools.ab(d),e;return null};Oa.prototype.Wa=function(a,b,c){null!==b&&(b.name=a,b.diagram=this.diagram);this.findTool(a)?this.replaceTool(a,b):null!==b&&c.add(b)}; ma.Object.defineProperties(Oa.prototype,{mouseWheelBehavior:{get:function(){return this.Ja},set:function(a){this.Ja=a}},gestureBehavior:{get:function(){return this.I},set:function(a){this.I=a}},currentToolTip:{get:function(){return this.l},set:function(a){this.l=a;this.zr=null!==a&&a instanceof Ke?a.adornedPart:null}},mouseDownTools:{get:function(){return this.Kc}},mouseMoveTools:{ get:function(){return this.Yc}},mouseUpTools:{get:function(){return this.Ef}},hoverDelay:{get:function(){return this.Ia},set:function(a){this.Ia=a}},holdDelay:{get:function(){return this.T},set:function(a){this.T=a}},dragSize:{get:function(){return this.u},set:function(a){this.u=a.G()}},toolTipDuration:{get:function(){return this.bb},set:function(a){this.bb= a}}});Oa.prototype.replaceStandardTool=Oa.prototype.Wa;var Fe=new D(Oa,"WheelScroll",0),Ee=new D(Oa,"WheelZoom",1),Qe=new D(Oa,"WheelNone",2),Le=new D(Oa,"GestureZoom",3),Me=new D(Oa,"GestureCancel",4),Ne=new D(Oa,"GestureNone",5);Oa.className="ToolManager";Oa.WheelScroll=Fe;Oa.WheelZoom=Ee;Oa.WheelNone=Qe;Oa.GestureZoom=Le;Oa.GestureCancel=Me;Oa.GestureNone=Ne; function Re(){Be.call(this);this.name="Dragging";this.I=this.Yc=!0;this.u=this.bb=this.Ia=this.lg=null;this.Fn=this.Ef=!1;this.Sl=new I(NaN,NaN);this.Ys=new I;this.Kc=!0;this.Xk=100;this.Qg=[];this.ar=(new F).freeze();this.Ja=new Se;this.po=null;this.T="copy";this.Nh="";this.Qh="no-drop"}la(Re,Be); Re.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.isTouchEvent&&b.timestamp-a.firstInput.timestamp<this.Xk)?!1:null!==this.findDraggablePart()}; Re.prototype.findDraggablePart=function(){var a=this.diagram;a=a.lm(a.firstInput.documentPoint,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.containingGroup;return null!==a&&(a.canMove()||a.canCopy())?a:null}; Re.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var b=a.lm(a.firstInput.documentPoint,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.containingGroup;this.currentPart=b;null===this.currentPart||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),b=a.lastInput,(Wa?b.meta:b.control)||b.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}}; Re.prototype.doActivate=function(){var a=this.diagram;this.po=null;null===this.currentPart&&this.standardMouseSelect();var b=this.currentPart;null!==b&&(b.canMove()||b.canCopy())&&(Te=null,this.isActive=!0,this.Sl.set(a.position),Ue(this,a.selection),this.Qg.length=0,this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),a.$t=!0,!0===a.Ee("temporaryPixelRatio")&&30<a.Jx&&Ve(a),We(a,this.draggedParts),this.ua("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured= !0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Fn=!1,Te=this,Xe=this.diagram,this.doSimulatedDragOut()))};function Ue(a,b){if(a.dragsLink){var c=a.diagram;c.allowRelink&&(c.model.kk()&&1===b.count&&b.first()instanceof S?(a.draggedLink=b.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.$j(),a.lg=c.toolManager.findTool("Relinking"),null===a.lg&&(a.lg=new bf,a.lg.diagram=c)):(a.draggedLink=null,a.lg=null))}} Re.prototype.computeEffectiveCollection=function(a,b){return this.diagram.commandHandler.computeEffectiveCollection(a,b)};Re.prototype.td=function(a){return void 0===a?new cf(Gb):this.isGridSnapEnabled?new cf(new I(Math.round(a.x),Math.round(a.y))):new cf(a.copy())}; Re.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.Cf();df(this);ef(a,this.draggedParts);this.draggedParts=this.currentPart=this.po=null;this.Fn=this.isDragOutStarted=!1;if(0<ff.count){for(var b=ff,c=b.length,d=0;d<c;d++){var e=b.L(d);gf(e);hf(e);df(e);e.diagram.Cf()}b.clear()}gf(this);this.Sl.h(NaN,NaN);Te=Xe=null;hf(this);a.isMouseCaptured=!1;a.currentCursor="";a.$t=!1;this.Dg();jf(a,!0)}; function df(a){var b=a.diagram,c=b.skipsUndoManager;b.skipsUndoManager=!0;kf(a,b.lastInput,null);b.skipsUndoManager=c;a.Qg.length=0}function lf(){var a=Te;hf(a);mf(a);var b=a.diagram;a.Sl.v()&&(b.position=a.Sl);b.Cf()}Re.prototype.doCancel=function(){hf(this);mf(this);var a=this.diagram;this.Sl.v()&&(a.position=this.Sl);this.stopTool()};Re.prototype.doKeyDown=function(){this.isActive&&("Esc"===this.diagram.lastInput.key?this.doCancel():this.doMouseMove())}; Re.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function nf(a,b){var c=Infinity,d=Infinity,e=-Infinity,f=-Infinity;for(a=a.iterator;a.next();){var g=a.value;if(g.Wb()&&g.isVisible()){var h=g.location;g=h.x;h=h.y;isNaN(g)||isNaN(h)||(g<c&&(c=g),h<d&&(d=h),g>e&&(e=g),h>f&&(f=h))}}Infinity===c?b.h(0,0,0,0):b.h(c,d,e-c,f-d)} function of(a,b){if(null===a.copiedParts){var c=a.diagram;if((!b||!c.isReadOnly&&!c.isModelReadOnly)&&null!==a.draggedParts){var d=c.undoManager;d.isEnabled&&d.isInTransaction?null!==d.currentTransaction&&0<d.currentTransaction.changes.count&&(c.undoManager.Bf(),c.ua("Drag")):mf(a);c.skipsUndoManager=!b;c.partManager.addsToTemporaryLayer=!b;a.startPoint=c.firstInput.documentPoint;b=a.copiesEffectiveCollection?a.draggedParts.Df():c.selection;c=c.ek(b,c,!0);for(b=c.iterator;b.next();)b.value.location= b.key.location;b=N.alloc();nf(c,b);N.free(b);b=new H;for(d=a.draggedParts.iterator;d.next();){var e=d.key;e.Wb()&&e.canCopy()&&(e=c.H(e),null!==e&&(e.Ab(),b.add(e,a.td(e.location))))}for(c=c.iterator;c.next();)d=c.value,d instanceof S&&d.canCopy()&&b.add(d,a.td());a.copiedParts=b;Ue(a,b.Df());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,pf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/2)))}}} function hf(a){var b=a.diagram;if(null!==a.copiedParts&&(b.Ut(a.copiedParts.Df(),!1),a.copiedParts=null,null!==a.draggedParts))for(var c=a.draggedParts.iterator;c.next();)c.key instanceof S&&(c.value.point=new I(0,0));b.skipsUndoManager=!1;b.partManager.addsToTemporaryLayer=!1;a.startPoint=b.firstInput.documentPoint} function gf(a){if(null!==a.draggedLink){if(a.dragsLink&&null!==a.lg){var b=a.lg;b.diagram.remove(b.temporaryFromNode);b.diagram.remove(b.temporaryToNode)}a.draggedLink=null;a.lg=null}}function qf(a,b,c){var d=a.diagram,e=a.startPoint,f=I.alloc();f.assign(d.lastInput.documentPoint);a.moveParts(b,f.be(e),c);I.free(f);!0===d.Ee("temporaryPixelRatio")&&null===d.rh&&30<d.Jx&&(Ve(d),d.St())}Re.prototype.moveParts=function(a,b,c){var d=this.diagram;null!==d&&rf(d,a,b,this.dragOptions,c)}; function mf(a){if(null!==a.draggedParts){for(var b=a.diagram,c=a.draggedParts.iterator;c.next();){var d=c.key;d.Wb()&&(d.location=c.value.point)}for(c=a.draggedParts.iterator;c.next();)if(d=c.key,d instanceof S&&d.suspendsRouting){var e=c.value.point;a.draggedParts.add(d,a.td());pf(d,-e.x,-e.y)}b.Wc()}} function sf(a,b){var c=a.diagram;a.dragsLink&&(null!==a.draggedLink&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),tf(a,!1));var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;a.doUpdateCursor(d);var f=c.skipsUndoManager,g=!1;try{c.skipsUndoManager=!0;g=kf(a,e,d);if(!a.isActive&&null===Te)return;var h=null!==d?d.part:null;if(null===h||c.handlesDragDropForTopLevelParts&&h.isTopLevel&&!(h instanceof uf)){var k=c.mouseDragOver;null!==k&&(k(e),g=!0)}if(!a.isActive&&null===Te)return; a.doDragOver(b,d);if(!a.isActive&&null===Te)return}finally{c.skipsUndoManager=f,g&&c.Wc()}a.po=d;c.isReadOnly||!c.allowMove&&!c.allowCopy||!c.allowHorizontalScroll&&!c.allowVerticalScroll||c.rt(e.viewPoint)}Re.prototype.findDragOverObject=function(a){var b=this;return vf(this.diagram,a,null,function(a){null===a?a=!0:(a=a.part,a=null===a||a instanceof Ke||a.layer.isTemporary||b.draggedParts&&b.draggedParts.contains(a)||b.copiedParts&&b.copiedParts.contains(a)?!0:!1);return!a})}; Re.prototype.doUpdateCursor=function(a){var b=this.diagram;this.po!==a&&(!this.diagram.currentTool.isActive||this.mayCopy()?b.currentCursor=this.copyCursor:this.mayMove()?b.currentCursor=this.moveCursor:this.mayDragOut()&&(b.currentCursor=this.nodropCursor))}; function kf(a,b,c){var d=!1,e=a.Qg.length,f=0<e?a.Qg[0]:null;if(c===f)return!1;b.handled=!1;for(var g=0;g<e;g++){var h=a.Qg[g],k=h.mouseDragLeave;if(null!==k&&(k(b,h,c),d=!0,b.handled))break}a.Qg.length=0;if(!a.isActive&&null===Te||null===c)return d;b.handled=!1;for(e=c;null!==e;)a.Qg.push(e),e=wf(e);e=a.Qg.length;for(c=0;c<e&&(g=a.Qg[c],h=g.mouseDragEnter,null===h||(h(b,g,f),d=!0,!b.handled));c++);return d} function wf(a){var b=a.panel;return null!==b?b:a instanceof T&&!(a instanceof uf)&&(a=a.containingGroup,null!==a&&a.handlesDragDropForMembers)?a:null}function xf(a,b,c){var d=a.lg;if(null===d)return null;var e=a.diagram.xg(b,d.portGravity,function(a){return d.findValidLinkablePort(a,c)});a=I.alloc();var f=Infinity,g=null;for(e=e.iterator;e.next();){var h=e.value;if(null!==h.part){var k=h.ga(Ac,a);k=b.De(k);k<f&&(g=h,f=k)}}I.free(a);return g} function tf(a,b){var c=a.draggedLink;if(null!==c&&!(2>c.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.lg;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=xf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=xf(a,c.i(c.pointsCount-1),!0),null!==h&&(k=h.part));e.isValidLink(g,f,k,h)?b?(c.defaultFromPoint=c.i(0),c.defaultToPoint=c.i(c.pointsCount-1),c.suspendsRouting=!1,c.fromNode=g,null!==f&&(c.fromPortId=f.portId),c.toNode=k,null!==h&&(c.toPortId=h.portId),c.fromPort!== d.oy&&d.R("LinkRelinked",c,d.oy),c.toPort!==d.py&&d.R("LinkRelinked",c,d.py)):Df(e,g,f,k,h):Df(e,null,null,null,null)}}}}Re.prototype.doDragOver=function(){}; function Ef(a,b){var c=a.diagram;a.dragsLink&&tf(a,!0);df(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;Ff(a,e,f);f=wf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Te){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof V&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==Te){a=N.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof V&&Gf(c,d,a);N.free(a)}}}function Ff(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof uf||(c=a.mouseDrop,null!==c&&c(b))}function Gf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Ce(c)&&(d=!0);a=a.Gv(c,function(a){return a.part},function(a){return a instanceof S},!0,function(a){return a instanceof S},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.yd(b)&&c.isAvoiding&&c.Ta()} Re.prototype.doDropOnto=function(){};Re.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(of(this,!1),We(a,this.copiedParts),qf(this,this.copiedParts,!1),ef(a,this.copiedParts)):this.mayMove()?(hf(this),qf(this,this.draggedParts,!0)):this.mayDragOut()?(of(this,!1),qf(this,this.copiedParts,!1)):hf(this),sf(this,a.lastInput.documentPoint))}}; Re.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(hf(this),of(this,!0),We(a,this.copiedParts),qf(this,this.copiedParts,!1),ef(a,this.copiedParts),null!==this.copiedParts&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,hf(this),this.mayMove()&&(qf(this,this.draggedParts, !0),sf(this,a.lastInput.documentPoint)));this.Fn=!0;Ef(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Df():this.draggedParts.Df();this.copiedParts=null;b&&Hf(this);a.Na();ef(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.R(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.R("ChangedSelection",a.selection)}}}; Re.prototype.simulatedMouseMove=function(a,b,c){if(null===Te)return!1;var d=Te.diagram;c instanceof Q||(c=null);var e=Xe;c!==e&&(null!==e&&e!==d&&(e.Cf(),Te.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Xe=c,null!==c&&c!==d&&(lf(),e=c.toolManager.findTool("Dragging"),null!==e&&(ff.contains(e)||ff.add(e),e.doSimulatedDragEnter())));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging");null!==d&&(null!== a&&(void 0!==a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),b=c.getMouse(a)),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.Wq(b),c.lastInput.down=!1,c.lastInput.up=!1,d.doSimulatedDragOver());return!0}; Re.prototype.simulatedMouseUp=function(a,b,c){if(null===Te)return!1;var d=Xe,e=Te.diagram;if(null===c)return Te.doCancel(),!0;if(c!==d){var f=d.toolManager.findTool("Dragging");if(null!==d&&d!==e&&null!==f)return d.Cf(),Te.isDragOutStarted=!1,f.doSimulatedDragLeave(),!1;Xe=c;d=c.toolManager.findTool("Dragging");null!==d&&(lf(),ff.contains(d)||ff.add(d),d.doSimulatedDragEnter())}return c!==this.diagram?(null!==a?(void 0!==a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&& (a=a.changedTouches[0])),b=c.getMouse(a)):null===b&&(b=new I),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.Wq(b),c.lastInput.down=!1,c.lastInput.up=!0,a=c.toolManager.findTool("Dragging"),null!==a&&a.doSimulatedDrop(),a=Te,null!==a&&(c=a.mayCopy(),a.transactionResult=c?"Copy":"Move",a.stopTool()),!0):!1}; function Hf(a){if(null!==a.draggedParts)for(var b=a.draggedParts.iterator;b.next();){var c=b.key;c instanceof V&&(c=c.containingGroup,null===c||null===c.placeholder||a.draggedParts.contains(c)||c.placeholder.o())}} Re.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Wa?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();){var b=a.value;if(b.Wb()&&b.canCopy())return!0}return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1}; Re.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();){var b=a.value;if(b.Wb()&&b.canCopy())return!0}return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1}; Re.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();){var b=a.value;if(b.Wb()&&b.canMove())return!0}return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canMove()?!0:!1};Re.prototype.computeBorder=function(a,b,c){return this.Fn||null===this.draggedParts||this.draggedParts.contains(a)?null:c.assign(b)};Re.prototype.Mz=function(){return Te}; Re.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var b=Te;return null===b||b.diagram.model.dataFormat!==a.model.dataFormat?!1:!0};Re.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Xc();If(a);a.animationManager.Xc();var b=Te;null!==b&&(b.diagram.$t=!1);this.doUpdateCursor(a.grid)}}; Re.prototype.doSimulatedDragLeave=function(){var a=Te;null!==a&&a.doSimulatedDragOut();this.doCancel()};Re.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.fn=!0;var b=Te;if(null!==b&&null!==b.draggedParts){if(!this.mayDragIn())return;Jf(this,b.draggedParts.Df(),!1,a.firstInput);qf(this,this.copiedParts,!1);sf(this,a.lastInput.documentPoint)}a.animationManager.fn=!1}; Re.prototype.doSimulatedDrop=function(){var a=this.diagram,b=Te;if(null!==b){var c=b.diagram;b.Fn=!0;hf(this);if(!this.mayDragIn())return;a.animationManager.fn=!0;a.R("ChangingSelection",a.selection);this.ua("Drop");Jf(this,b.draggedParts.Df(),!0,a.lastInput);qf(this,this.copiedParts,!1);null!==this.copiedParts&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}));Ef(this,a.lastInput.documentPoint);a.Na();b=a.selection;null!==this.copiedParts?this.transactionResult= "ExternalCopy":b=new F;this.copiedParts=null;a.doFocus();a.R("ExternalObjectsDropped",b,c);this.Dg();a.R("ChangedSelection",a.selection)}a.animationManager.fn=!1}; function Jf(a,b,c,d){if(null===a.copiedParts){var e=a.diagram;if(!e.isReadOnly&&!e.isModelReadOnly){e.skipsUndoManager=!c;e.partManager.addsToTemporaryLayer=!c;a.startPoint=d.documentPoint;c=e.ek(b,e,!0);var f=N.alloc();nf(b,f);d=f.x+f.width/2;e=f.y+f.height/2;N.free(f);f=a.Ys;var g=new H,h=I.alloc();for(b=b.iterator;b.next();){var k=b.value,l=c.H(k);k.Wb()&&k.canCopy()?(k=k.location,h.h(f.x-(d-k.x),f.y-(e-k.y)),l.location=h,l.Ab(),g.add(l,a.td(h))):l instanceof S&&k.canCopy()&&(pf(l,f.x-d,f.y-e), g.add(l,a.td()))}I.free(h);a.copiedParts=g;Ue(a,g.Df());null!==a.draggedLink&&(c=a.draggedLink,d=c.routeBounds,pf(c,a.startPoint.x-(d.x+d.width/2),a.startPoint.y-(d.y+d.height/2)))}}}Re.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.$t=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.po=null};Re.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new I}; ma.Object.defineProperties(Re.prototype,{isCopyEnabled:{get:function(){return this.Yc},set:function(a){this.Yc=a}},copiesEffectiveCollection:{get:function(){return this.I},set:function(a){this.I=a}},dragOptions:{get:function(){return this.Ja},set:function(a){this.Ja=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled= a}},isComplexRoutingRealtime:{get:function(){return this.Kc},set:function(a){this.Kc=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.w(a)||(a=a.G(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{ get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.w(a)||(a=a.G(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.w(a)||(a=a.G(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink= a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.T},set:function(a){this.T=a}},moveCursor:{get:function(){return this.Nh},set:function(a){this.Nh=a}},nodropCursor:{get:function(){return this.Qh},set:function(a){this.Qh=a}},currentPart:{get:function(){return this.Ia}, set:function(a){this.Ia=a}},copiedParts:{get:function(){return this.u},set:function(a){this.u=a}},draggedParts:{get:function(){return this.bb},set:function(a){this.bb=a}},draggingParts:{get:function(){return null!==this.copiedParts?this.copiedParts.Df():null!==this.draggedParts?this.draggedParts.Df():this.ar}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink= a}},isDragOutStarted:{get:function(){return this.Ef},set:function(a){this.Ef=a}},startPoint:{get:function(){return this.Ys},set:function(a){this.Ys.w(a)||this.Ys.assign(a)}},delay:{get:function(){return this.Xk},set:function(a){this.Xk=a}}});Re.prototype.getDraggingSource=Re.prototype.Mz;var ff=null,Te=null,Xe=null;Re.className="DraggingTool";ff=new E; La("draggingTool",function(){return this.findTool("Dragging")},function(a){this.Wa("Dragging",a,this.mouseMoveTools)});Oa.prototype.doCancel=function(){null!==Te&&Te.doCancel();Be.prototype.doCancel.call(this)}; function Kf(){Be.call(this);this.Qh=100;this.Ja=!1;this.hi="pointer";var a=new S,b=new W;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new W;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.Ow=a;a=new V;b=new W;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Mb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Nw=a;this.l=b;a=new V;b=new W;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize= Mb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Pw=a;this.u=b;this.Nh=this.Ef=this.Kc=this.bb=this.Yc=null;this.Ia=!0;this.Gy=new H;this.ar=this.zi=this.Mw=null}la(Kf,Be);Kf.prototype.doStop=function(){this.diagram.Cf();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null}; Kf.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){var f=b.uf(),g=M.alloc();g.width=b.naturalBounds.width*f;g.height=b.naturalBounds.height*f;d.desiredSize=g;M.free(g);e?(d.toSpot=b.toSpot,d.toEndSegmentLength=b.toEndSegmentLength):(d.fromSpot=b.fromSpot,d.fromEndSegmentLength=b.fromEndSegmentLength);c.locationSpot=Ac;f=I.alloc();c.location=b.ga(Ac,f);I.free(f);d.angle=b.aj();null!==this.portTargeted&&this.portTargeted(a,b,c,d,e)}}; Kf.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.desiredSize=Mb,b.fromSpot=uc,b.toSpot=uc);null!==a&&(a.location=this.diagram.lastInput.documentPoint);null!==this.portTargeted&&this.portTargeted(null,null,a,b,c)};Kf.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()}; Kf.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort&&this.targetPort.part instanceof V){var b=this.targetPort.part;this.isForwards?this.copyPortProperties(b,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(b,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort, !0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.rt(a.lastInput.viewPoint)}};Kf.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.part;if(!(c instanceof V))return null;for(;null!==a;){var d=b?a.toLinkable:a.fromLinkable;if(!0===d&&(null!==a.portId||a instanceof V)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.panel}return null}; Kf.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.xg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof V){var k=g.ga(Ac,I.alloc()),l=c.x-k.x,m=c.y-k.y;I.free(k);k=l*l+m*m;k<d&&(l=this.validPortsCache.H(g),null!==l?l&&(b=g,d=k):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,h,g)||!a&&this.isValidLink(h, g,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(g,!0),b=g,d=k):this.validPortsCache.add(g,!1))}}return null!==b&&(c=b.part,c instanceof V&&(null===c.layer||c.layer.allowLink))?b:null}; Kf.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.fromLinkable))return!1;var c=b.fromMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.rq(b).count>=c)return!1}return!0}; Kf.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.xd(b).count>=c)return!1}return!0}; Kf.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;a=a.part;b=b.part;return null!==a&&a===b};Kf.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof V))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof V))return!1;b=b.portId;null===b&&(b="");for(b=d.xd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Kf.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};Kf.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.labeledLink;if(null===c)return!1;if(c===b)return!0;var d=new F;d.add(a);return Lf(this,c,b,d)}; function Lf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Lf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Lf(a,b.labeledLink,c,d))?!0:!1} Kf.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.isUnconnectedLinkValid;var d=this.diagram.validCycle;if(d!==Mf){if(d===Nf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!Of(this,a,b,c,!0)}if(d===Pf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=a.linksConnected;d.next();)if(e=d.value,e!==c&&e.isTreeLink&&e.fromNode=== a)return!1;return!Of(this,a,b,c,!0)}if(d===Qf)return a===b?a=!0:(d=new F,d.add(b),a=Rf(this,d,a,b,c)),!a;if(d===Sf)return!Of(this,a,b,c,!1);if(d===Tf)return a===b?a=!0:(d=new F,d.add(b),a=Uf(this,d,a,b,c)),!a}return!0};function Of(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&Of(a,g,c,d,e)))return!0}return!1} function Rf(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&Rf(a,b,g,d,e)))return!0}return!1}function Uf(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&Uf(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties(Kf.prototype,{portGravity:{get:function(){return this.Qh},set:function(a){0<=a&&(this.Qh=a)}},isUnconnectedLinkValid:{get:function(){return this.Ja},set:function(a){this.Ja=a}},linkingCursor:{get:function(){return this.hi},set:function(a){this.hi=a}},temporaryLink:{get:function(){return this.Ow},set:function(a){this.Ow=a}},temporaryFromNode:{ get:function(){return this.Nw},set:function(a){if(this.Nw=a)this.l=a.port}},temporaryFromPort:{get:function(){return this.l},set:function(a){if(null!==this.l){var b=this.l.panel;if(null!==b){var c=b.W.indexOf(this.l);b.ab(c);b.ub(c,a)}}this.l=a}},temporaryToNode:{get:function(){return this.Pw},set:function(a){if(this.Pw=a)this.u=a.port}},temporaryToPort:{get:function(){return this.u},set:function(a){if(null!== this.u){var b=this.u.panel;if(null!==b){var c=b.W.indexOf(this.u);b.ab(c);b.ub(c,a)}}this.u=a}},originalLink:{get:function(){return this.Yc},set:function(a){this.Yc=a}},originalFromNode:{get:function(){return this.bb},set:function(a){this.bb=a}},originalFromPort:{get:function(){return this.Kc},set:function(a){this.Kc=a}},originalToNode:{get:function(){return this.Ef},set:function(a){this.Ef= a}},originalToPort:{get:function(){return this.Nh},set:function(a){this.Nh=a}},isForwards:{get:function(){return this.Ia},set:function(a){this.Ia=a}},validPortsCache:{get:function(){return this.Gy}},targetPort:{get:function(){return this.Mw},set:function(a){this.Mw=a}},linkValidation:{get:function(){return this.zi},set:function(a){this.zi=a}},portTargeted:{ get:function(){return this.ar},set:function(a){this.ar=a}}});Kf.className="LinkingBaseTool";function Vf(){Kf.call(this);this.name="Linking";this.T={};this.I=null;this.J=Wf;this.Rm=null}la(Vf,Kf);Vf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.Gt()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; Vf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.Ub(a.firstInput.documentPoint,null,null));if(null===b||!(b.part instanceof V))return null;a=this.direction;if(a===Wf||a===Xf){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.isForwards=!0,c}if(a===Wf||a===Yf)if(b=this.findValidLinkablePort(b,!0),null!==b)return this.isForwards=!1,b;return null}; Vf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null!==b&&(this.ua(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.v()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof V&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort, !1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.v()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof V&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode), null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.Ta(),a.add(this.temporaryLink)),this.isActive=!0)};Vf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.Dg()};Vf.prototype.doStop=function(){Kf.prototype.doStop.call(this);this.startObject=null}; Vf.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!==g){var h=g.part;h instanceof V&&(this.isForwards?(null!==this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!==this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&& (b=this.originalFromNode,c=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!==b||null!==d?(f=this.insertLink(b,c,d,e),null!==f?(null===g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",f)):(a.model.mq(),this.doNoLink(b,c, d,e))):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}}; Vf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof S)return a.isTreeLink;var b=this.diagram;if(null===b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!==b?b.isTreeLink:!0};Vf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Vf.prototype.doNoLink=function(){}; ma.Object.defineProperties(Vf.prototype,{archetypeLinkData:{get:function(){return this.T},set:function(a){this.T=a}},archetypeLabelNodeData:{get:function(){return this.I},set:function(a){this.I=a}},direction:{get:function(){return this.J},set:function(a){this.J=a}},startObject:{get:function(){return this.Rm},set:function(a){this.Rm=a}}}); var Wf=new D(Vf,"Either",0),Xf=new D(Vf,"ForwardsOnly",0),Yf=new D(Vf,"BackwardsOnly",0);Vf.className="LinkingTool";Vf.Either=Wf;Vf.ForwardsOnly=Xf;Vf.BackwardsOnly=Yf; function bf(){Kf.call(this);this.name="Relinking";var a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.T=a;a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.Rm=a;this.I=null;this.qx=new N}la(bf,Kf); bf.prototype.updateAdornments=function(a){if(null!==a&&a instanceof S){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.zf()&&(c=a.hk(b),null===c&&(c=this.makeAdornment(d,!1),a.zh(b,c)))}null===c&&a.Af(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.zf()&& (c=a.hk(b),null===c?(c=this.makeAdornment(d,!0),a.zh(b,c)):c.o()));null===c&&a.Af(b)}};bf.prototype.makeAdornment=function(a,b){var c=new Ke;c.type=X.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; bf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.Gt()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!==b}; bf.prototype.doActivate=function(){var a=this.diagram;if(null===this.originalLink){var b=this.handle;null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null===b)return;var c=b.part;if(!(c instanceof Ke&&c.adornedPart instanceof S))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.ua(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor; this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.qx.set(this.originalLink.actualBounds);null!==this.originalLink&&0<this.originalLink.pointsCount&&(null===this.originalLink.fromNode&&(null!==this.temporaryFromPort&&(this.temporaryFromPort.desiredSize=Lb),null!==this.temporaryFromNode&&(this.temporaryFromNode.location=this.originalLink.i(0))),null===this.originalLink.toNode&& (null!==this.temporaryToPort&&(this.temporaryToPort.desiredSize=Lb),null!==this.temporaryToNode&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1))));this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1);this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0);a.add(this.temporaryFromNode);a.add(this.temporaryToNode);null!==this.temporaryLink&&(null!== this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.Ta(),a.add(this.temporaryLink));this.isActive=!0}; bf.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.adjusting=a.adjusting;b.corner=a.corner;var c=a.curve;if(c===Zf||c===$f)c=ag;b.curve=c;b.curviness=a.curviness;b.isTreeLink=a.isTreeLink;b.points=a.points;b.routing=a.routing;b.smoothness=a.smoothness;b.fromSpot=a.fromSpot;b.fromEndSegmentLength=a.fromEndSegmentLength;b.fromShortLength=a.fromShortLength;b.toSpot=a.toSpot;b.toEndSegmentLength=a.toEndSegmentLength;b.toShortLength=a.toShortLength}}; bf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.Dg()};bf.prototype.doStop=function(){Kf.prototype.doStop.call(this);this.handle=null}; bf.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var b=this.originalFromNode,c=this.originalFromPort,d=this.originalToNode,e=this.originalToPort,f=this.originalLink;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort){var g=this.targetPort.part;g instanceof V&&(this.isForwards?(d=g,e=this.targetPort):(b=g,c=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?e=d=null:c=b=null:f=null;null!==f?(this.reconnectLink(f, this.isForwards?d:b,this.isForwards?e:c,this.isForwards),null===this.targetPort&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint,f.Ta()),a.allowSelect&&(f.isSelected=!0),this.transactionResult=this.name,a.R("LinkRelinked",f,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards);this.originalLink.Bq(this.qx)}this.stopTool()}; bf.prototype.reconnectLink=function(a,b,c,d){c=null!==c&&null!==c.portId?c.portId:"";d?(a.toNode=b,a.toPortId=c):(a.fromNode=b,a.fromPortId=c);return!0};bf.prototype.doNoRelink=function(){}; function Df(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode);null!==d?(a.copyPortProperties(d,e,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)} ma.Object.defineProperties(bf.prototype,{fromHandleArchetype:{get:function(){return this.T},set:function(a){this.T=a}},toHandleArchetype:{get:function(){return this.Rm},set:function(a){this.Rm=a}},handle:{get:function(){return this.I},set:function(a){if(null!==a&&!(a.part instanceof Ke))throw Error("new handle is not in an Adornment: "+a);this.I=a}}});bf.className="RelinkingTool"; La("linkingTool",function(){return this.findTool("Linking")},function(a){this.Wa("Linking",a,this.mouseMoveTools)});La("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.Wa("Relinking",a,this.mouseDownTools)}); function bg(){Be.call(this);this.name="LinkReshaping";var a=new W;a.figure="Rectangle";a.desiredSize=Nb;a.fill="lightblue";a.stroke="dodgerblue";this.u=a;a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="move";this.I=a;this.T=3;this.iu=this.l=null;this.sx=new I;this.zs=new E}la(bg,Be);bg.prototype.Kv=function(a){return a&&a.Gs&&0!==a.Gs.value?a.Gs:cg};bg.prototype.Lm=function(a,b){a.Gs=b}; bg.prototype.updateAdornments=function(a){if(null!==a&&a instanceof S){var b=null;if(a.isSelected&&!this.diagram.isReadOnly){var c=a.path;null!==c&&a.canReshape()&&a.actualBounds.v()&&a.isVisible()&&c.actualBounds.v()&&c.zf()&&(b=a.hk(this.name),null===b||b.nx!==a.pointsCount||b.Cx!==a.resegmentable)&&(b=this.makeAdornment(c),null!==b&&(b.nx=a.pointsCount,b.Cx=a.resegmentable,a.zh(this.name,b)))}null===b&&a.Af(this.name)}}; bg.prototype.makeAdornment=function(a){var b=a.part,c=b.pointsCount,d=b.isOrthogonal,e=null;if(null!==b.points&&1<c){e=new Ke;e.type=X.Link;c=b.firstPickIndex;var f=b.lastPickIndex,g=d?1:0;if(b.resegmentable&&b.computeCurve()!==dg)for(var h=c+g;h<f-g;h++){var k=this.makeResegmentHandle(a,h);null!==k&&(k.segmentIndex=h,k.segmentFraction=.5,k.fromMaxLinks=999,e.add(k))}for(g=c+1;g<f;g++)if(h=this.makeHandle(a,g),null!==h){h.segmentIndex=g;if(g!==c)if(g===c+1&&d){k=b.i(c);var l=b.i(c+1);K.A(k.x,l.x)&& K.A(k.y,l.y)&&(l=b.i(c-1));K.A(k.x,l.x)?(this.Lm(h,pg),h.cursor="n-resize"):K.A(k.y,l.y)&&(this.Lm(h,qg),h.cursor="w-resize")}else g===f-1&&d?(k=b.i(f-1),l=b.i(f),K.A(k.x,l.x)&&K.A(k.y,l.y)&&(k=b.i(f+1)),K.A(k.x,l.x)?(this.Lm(h,pg),h.cursor="n-resize"):K.A(k.y,l.y)&&(this.Lm(h,qg),h.cursor="w-resize")):g!==f&&(this.Lm(h,rg),h.cursor="move");e.add(h)}e.adornedObject=a}return e};bg.prototype.makeHandle=function(){var a=this.handleArchetype;return null===a?null:a.copy()}; bg.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return null===a?null:a.copy()};bg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; bg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null!==this.handle){var b=this.handle.part.adornedPart;if(b instanceof S){this.iu=b;a.isMouseCaptured=!0;this.ua(this.name);if(b.resegmentable&&999===this.handle.fromMaxLinks){var c=b.points.copy(),d=this.getResegmentingPoint();c.ub(this.handle.segmentIndex+1,d);b.isOrthogonal&&c.ub(this.handle.segmentIndex+1,d);b.points=c;b.Mb();b.updateAdornments(); this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name);if(null===this.handle){this.doDeactivate();return}}this.sx=b.i(this.handle.segmentIndex);this.zs=b.points.copy();this.isActive=!0}}};bg.prototype.doDeactivate=function(){this.Dg();this.iu=this.handle=null;this.isActive=this.diagram.isMouseCaptured=!1};bg.prototype.doCancel=function(){var a=this.adornedLink;null!==a&&(a.points=this.zs);this.stopTool()};bg.prototype.getResegmentingPoint=function(){return this.handle.ga(Ac)}; bg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))}; bg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.computeReshape(a.lastInput.documentPoint);this.reshape(b);b=this.adornedLink;if(null!==b&&b.resegmentable){var c=this.handle.segmentIndex,d=b.i(c-1),e=b.i(c),f=b.i(c+1);if(b.isOrthogonal){if(c>b.firstPickIndex+1&&c<b.lastPickIndex-1){var g=b.i(c-2);if(Math.abs(d.x-e.x)<this.resegmentingDistance&&Math.abs(d.y-e.y)<this.resegmentingDistance&&(sg(this,g,d,e,f,!0)||sg(this,g,d,e,f,!1))){var h=b.points.copy();sg(this,g,d, e,f,!0)?(h.hd(c-2,new I(g.x,(f.y+g.y)/2)),h.hd(c+1,new I(f.x,(f.y+g.y)/2))):(h.hd(c-2,new I((f.x+g.x)/2,g.y)),h.hd(c+1,new I((f.x+g.x)/2,f.y)));h.ab(c);h.ab(c-1);b.points=h;b.Mb()}else g=b.i(c+2),Math.abs(e.x-f.x)<this.resegmentingDistance&&Math.abs(e.y-f.y)<this.resegmentingDistance&&(sg(this,d,e,f,g,!0)||sg(this,d,e,f,g,!1))&&(h=b.points.copy(),sg(this,d,e,f,g,!0)?(h.hd(c-1,new I(d.x,(d.y+g.y)/2)),h.hd(c+2,new I(g.x,(d.y+g.y)/2))):(h.hd(c-1,new I((d.x+g.x)/2,d.y)),h.hd(c+2,new I((d.x+g.x)/2,g.y))), h.ab(c+1),h.ab(c),b.points=h,b.Mb())}}else g=I.alloc(),K.Kh(d.x,d.y,f.x,f.y,e.x,e.y,g)&&g.De(e)<this.resegmentingDistance*this.resegmentingDistance&&(d=b.points.copy(),d.ab(c),b.points=d,b.Mb()),I.free(g)}a.Na();this.transactionResult=this.name;a.R("LinkReshaped",this.adornedLink,this.zs)}this.stopTool()}; function sg(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.resegmentingDistance&&Math.abs(c.y-d.y)<a.resegmentingDistance&&Math.abs(d.y-e.y)<a.resegmentingDistance:Math.abs(b.x-c.x)<a.resegmentingDistance&&Math.abs(c.x-d.x)<a.resegmentingDistance&&Math.abs(d.x-e.x)<a.resegmentingDistance} bg.prototype.reshape=function(a){var b=this.adornedLink;b.Mh();var c=this.handle.segmentIndex,d=this.Kv(this.handle);if(b.isOrthogonal)if(c===b.firstPickIndex+1)c=b.firstPickIndex+1,d===pg?(b.K(c,b.i(c-1).x,a.y),b.K(c+1,b.i(c+2).x,a.y)):d===qg&&(b.K(c,a.x,b.i(c-1).y),b.K(c+1,a.x,b.i(c+2).y));else if(c===b.lastPickIndex-1)c=b.lastPickIndex-1,d===pg?(b.K(c-1,b.i(c-2).x,a.y),b.K(c,b.i(c+1).x,a.y)):d===qg&&(b.K(c-1,a.x,b.i(c-2).y),b.K(c,a.x,b.i(c+1).y));else{d=c;var e=b.i(d),f=b.i(d-1),g=b.i(d+1);K.A(f.x, e.x)&&K.A(e.y,g.y)?(K.A(f.x,b.i(d-2).x)&&!K.A(f.y,b.i(d-2).y)?(b.m(d,a.x,f.y),c++,d++):b.K(d-1,a.x,f.y),K.A(g.y,b.i(d+2).y)&&!K.A(g.x,b.i(d+2).x)?b.m(d+1,g.x,a.y):b.K(d+1,g.x,a.y)):K.A(f.y,e.y)&&K.A(e.x,g.x)?(K.A(f.y,b.i(d-2).y)&&!K.A(f.x,b.i(d-2).x)?(b.m(d,f.x,a.y),c++,d++):b.K(d-1,f.x,a.y),K.A(g.x,b.i(d+2).x)&&!K.A(g.y,b.i(d+2).y)?b.m(d+1,a.x,g.y):b.K(d+1,a.x,g.y)):K.A(f.x,e.x)&&K.A(e.x,g.x)?(K.A(f.x,b.i(d-2).x)&&!K.A(f.y,b.i(d-2).y)?(b.m(d,a.x,f.y),c++,d++):b.K(d-1,a.x,f.y),K.A(g.x,b.i(d+2).x)&& !K.A(g.y,b.i(d+2).y)?b.m(d+1,a.x,g.y):b.K(d+1,a.x,g.y)):K.A(f.y,e.y)&&K.A(e.y,g.y)&&(K.A(f.y,b.i(d-2).y)&&!K.A(f.x,b.i(d-2).x)?(b.m(d,f.x,a.y),c++,d++):b.K(d-1,f.x,a.y),K.A(g.y,b.i(d+2).y)&&!K.A(g.x,b.i(d+2).x)?b.m(d+1,g.x,a.y):b.K(d+1,g.x,a.y));b.K(c,a.x,a.y)}else b.K(c,a.x,a.y),d=b.fromNode,e=b.fromPort,null!==d&&(f=d.findVisibleNode(),null!==f&&f!==d&&(d=f,e=d.port)),1===c&&b.computeSpot(!0,e).kc()&&(f=e.ga(Ac,I.alloc()),d=b.getLinkPointFromPoint(d,e,f,a,!0,I.alloc()),b.K(0,d.x,d.y),I.free(f), I.free(d)),d=b.toNode,e=b.toPort,null!==d&&(f=d.findVisibleNode(),null!==f&&f!==d&&(d=f,e=d.port)),c===b.pointsCount-2&&b.computeSpot(!1,e).kc()&&(c=e.ga(Ac,I.alloc()),a=b.getLinkPointFromPoint(d,e,c,a,!1,I.alloc()),b.K(b.pointsCount-1,a.x,a.y),I.free(c),I.free(a));b.rf()};bg.prototype.computeReshape=function(a){var b=this.adornedLink,c=this.handle.segmentIndex;switch(this.Kv(this.handle)){case rg:return a;case pg:return new I(b.i(c).x,a.y);case qg:return new I(a.x,b.i(c).y);default:case cg:return b.i(c)}}; ma.Object.defineProperties(bg.prototype,{handleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},midHandleArchetype:{get:function(){return this.I},set:function(a){this.I=a}},handle:{get:function(){return this.l},set:function(a){if(null!==a&&!(a.part instanceof Ke))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedLink:{get:function(){return this.iu}}, resegmentingDistance:{get:function(){return this.T},set:function(a){this.T=a}},originalPoint:{get:function(){return this.sx}},originalPoints:{get:function(){return this.zs}}});bg.prototype.setReshapingBehavior=bg.prototype.Lm;bg.prototype.getReshapingBehavior=bg.prototype.Kv;var cg=new D(bg,"None",0),qg=new D(bg,"Horizontal",1),pg=new D(bg,"Vertical",2),rg=new D(bg,"All",3);bg.className="LinkReshapingTool"; bg.None=cg;bg.Horizontal=qg;bg.Vertical=pg;bg.All=rg;La("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.Wa("LinkReshaping",a,this.mouseDownTools)}); function tg(){Be.call(this);this.name="Resizing";this.bg=(new M(1,1)).freeze();this.ag=(new M(9999,9999)).freeze();this.Kg=(new M(NaN,NaN)).freeze();this.I=!1;this.T=!0;this.de=null;var a=new W;a.alignmentFocus=Ac;a.figure="Rectangle";a.desiredSize=Nb;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.u=a;this.l=null;this.ys=new I;this.px=new M;this.bp=new I;this.zu=new M(0,0);this.yu=new M(Infinity,Infinity);this.xu=new M(1,1);this.mx=!0}la(tg,Be); tg.prototype.updateAdornments=function(a){if(!(null===a||a instanceof S)){if(a.isSelected&&!this.diagram.isReadOnly){var b=a.resizeObject,c=a.hk(this.name);if(null!==b&&a.canResize()&&a.actualBounds.v()&&a.isVisible()&&b.actualBounds.v()&&b.zf()){if(null===c||c.adornedObject!==b)c=this.makeAdornment(b);if(null!==c){b=b.aj();ug(a)&&this.updateResizeHandles(c,b);a.zh(this.name,c);return}}}a.Af(this.name)}}; tg.prototype.makeAdornment=function(a){var b=a.part.resizeAdornmentTemplate;if(null===b){b=new Ke;b.type=X.Spot;b.locationSpot=Ac;var c=new vg;c.isPanelMain=!0;b.add(c);b.add(this.makeHandle(a,vc));b.add(this.makeHandle(a,yc));b.add(this.makeHandle(a,Gc));b.add(this.makeHandle(a,Cc));b.add(this.makeHandle(a,ed));b.add(this.makeHandle(a,gd));b.add(this.makeHandle(a,hd));b.add(this.makeHandle(a,fd))}else if(wg(b),b=b.copy(),null===b)return null;b.adornedObject=a;return b}; tg.prototype.makeHandle=function(a,b){a=this.handleArchetype;if(null===a)return null;a=a.copy();a.alignment=b;return a}; tg.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.Nb()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.kc()&&(c=Ac);if(0>=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": "e-resize"}else if(a instanceof X)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};tg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; tg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(this.ys.set(this.adornedObject.ga(this.handle.alignment.Zv())),this.bp.set(this.adornedObject.part.location),this.px.set(this.adornedObject.desiredSize),this.xu=this.computeCellSize(),this.zu=this.computeMinSize(),this.yu=this.computeMaxSize(),a.isMouseCaptured= !0,this.mx=a.animationManager.isEnabled,a.animationManager.isEnabled=!1,this.ua(this.name),this.isActive=!0))};tg.prototype.doDeactivate=function(){var a=this.diagram;this.Dg();this.de=this.handle=null;this.isActive=a.isMouseCaptured=!1;a.animationManager.isEnabled=this.mx};tg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; tg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.zu,c=this.yu,d=this.xu,e=this.adornedObject.zt(a.lastInput.documentPoint,I.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.Wc();I.free(e)}}; tg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.zu,c=this.yu,d=this.xu,e=this.adornedObject.zt(a.lastInput.documentPoint,I.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);I.free(e);a.Na();this.transactionResult=this.name;a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; tg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Ab();c=c.ga(this.handle.alignment.Zv());if(a instanceof uf){var d=new E;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Se;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().be(c),!0,e)}else a.location=a.location.copy().be(c).add(this.oppositePoint);b.Wc()}}; tg.prototype.computeResize=function(a,b,c,d,e,f){b.kc()&&(b=Ac);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=I.alloc();K.sq(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));I.free(p);return a};tg.prototype.computeReshape=function(){var a=xg;this.adornedObject instanceof W&&(a=yg(this.adornedObject));return!(a===zg||this.diagram.lastInput.shift)}; tg.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};tg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a}; tg.prototype.computeCellSize=function(){var a=new M(NaN,NaN),b=this.adornedObject.part;null!==b&&(b=b.resizeCellSize,!isNaN(b.width)&&0<b.width&&(a.width=b.width),!isNaN(b.height)&&0<b.height&&(a.height=b.height));b=this.cellSize;isNaN(a.width)&&!isNaN(b.width)&&0<b.width&&(a.width=b.width);isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height);b=this.diagram;(isNaN(a.width)||isNaN(a.height))&&b&&(b=b.grid,null!==b&&b.visible&&this.isGridSnapEnabled&&(b=b.gridCellSize,isNaN(a.width)&& !isNaN(b.width)&&0<b.width&&(a.width=b.width),isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height)));if(isNaN(a.width)||0===a.width||Infinity===a.width)a.width=1;if(isNaN(a.height)||0===a.height||Infinity===a.height)a.height=1;return a}; ma.Object.defineProperties(tg.prototype,{handleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.l},set:function(a){if(null!==a&&!(a.part instanceof Ke))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{get:function(){return this.de},set:function(a){if(null!==a&&a.part instanceof Ke)throw Error("new handle must not be in an Adornment: "+ a);this.de=a}},minSize:{get:function(){return this.bg},set:function(a){if(!this.bg.w(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.bg.h(b,a)}}},maxSize:{get:function(){return this.ag},set:function(a){if(!this.ag.w(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.ag.h(b,a)}}},cellSize:{get:function(){return this.Kg},set:function(a){this.Kg.w(a)||this.Kg.assign(a)}}, isGridSnapEnabled:{get:function(){return this.I},set:function(a){this.I=a}},dragsMembers:{get:function(){return this.T},set:function(a){this.T=a}},oppositePoint:{get:function(){return this.ys},set:function(a){this.ys.w(a)||this.ys.assign(a)}},originalDesiredSize:{get:function(){return this.px}},originalLocation:{get:function(){return this.bp}}}); tg.className="ResizingTool";La("resizingTool",function(){return this.findTool("Resizing")},function(a){this.Wa("Resizing",a,this.mouseDownTools)});function Ag(){Be.call(this);this.name="Rotating";this.Ja=45;this.Ia=2;this.bp=new I;this.de=null;var a=new W;a.figure="Ellipse";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.u=a;this.l=null;this.ox=0;this.Zu=new I(NaN,NaN);this.I=0;this.T=50}la(Ag,Be); Ag.prototype.updateAdornments=function(a){if(null!==a){if(a.Jh()){var b=a.rotateObject;if(b===a||b===a.path||b.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(b=a.rotateObject,null!==b&&a.canRotate()&&a.actualBounds.v()&&a.isVisible()&&b.actualBounds.v()&&b.zf())){var c=a.hk(this.name);if(null===c||c.adornedObject!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.aj();null===c.placeholder&&(c.location=this.computeAdornmentLocation(b));a.zh(this.name,c);return}}a.Af(this.name)}}; Ag.prototype.makeAdornment=function(a){var b=a.part.rotateAdornmentTemplate;if(null===b){b=new Ke;b.type=X.Position;b.locationSpot=Ac;var c=this.handleArchetype;null!==c&&b.add(c.copy())}else if(wg(b),b=b.copy(),null===b)return null;b.adornedObject=a;return b};Ag.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; Ag.prototype.doActivate=function(){var a=this.diagram;if(null===this.adornedObject){null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null===this.handle)return;this.adornedObject=this.handle.part.adornedObject}null!==this.adornedObject&&(this.ox=this.adornedObject.angle,this.Zu=this.computeRotationPoint(this.adornedObject),this.bp=this.adornedObject.part.location.copy(),a.isMouseCaptured=!0,a.delaysLayout=!0,this.ua(this.name),this.isActive=!0)}; Ag.prototype.computeRotationPoint=function(a){var b=a.part,c=b.locationObject;return b.rotationSpot.hb()?a.ga(b.rotationSpot):a===b||a===c?c.ga(b.locationSpot):a.ga(Ac)}; Ag.prototype.computeAdornmentLocation=function(a){var b=this.rotationPoint;b.v()||(b=this.computeRotationPoint(a));b=a.zt(b);var c=this.handleAngle;0>c?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.ga(b)};Ag.prototype.doDeactivate=function(){var a=this.diagram;this.Dg();this.de=this.handle=null;this.Zu=new I(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Ag.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};Ag.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))}; Ag.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Na();this.transactionResult=this.name;a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Ag.prototype.rotate=function(a){var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Ab();var c=b.locationObject,d=b.rotateObject;if(c===d||c.zg(d))c=this.bp.copy(),b.location=c.be(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.Wc()}}; Ag.prototype.computeRotate=function(a){a=this.rotationPoint.Sa(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.aj());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&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}; ma.Object.defineProperties(Ag.prototype,{handleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.l},set:function(a){if(null!==a&&!(a.part instanceof Ke))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{get:function(){return this.de},set:function(a){if(null!==a&&a.part instanceof Ke)throw Error("new handle must not be in an Adornment: "+ a);this.de=a}},snapAngleMultiple:{get:function(){return this.Ja},set:function(a){this.Ja=a}},snapAngleEpsilon:{get:function(){return this.Ia},set:function(a){this.Ia=a}},originalAngle:{get:function(){return this.ox}},rotationPoint:{get:function(){return this.Zu}},handleAngle:{get:function(){return this.I},set:function(a){this.I=a}},handleDistance:{ get:function(){return this.T},set:function(a){this.T=a}}});Ag.className="RotatingTool";La("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.Wa("Rotating",a,this.mouseDownTools)});function Bg(){Be.call(this);this.name="ClickSelecting"}la(Bg,Be);Bg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; Bg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};Bg.className="ClickSelectingTool";function Cg(){Be.call(this);this.name="Action";this.Dk=null}la(Cg,Be); Cg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.Ub(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.Dk=c;a.pj=a.Ub(b.documentPoint,null,null);return!0}return!1};Cg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; Cg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};Cg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.Dk;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()}; Cg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.Dk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};Cg.prototype.doStop=function(){this.Dk=null};Cg.className="ActionTool";function Dg(){Be.call(this);this.name="ClickCreating";this.lj=null;this.u=!0;this.l=!1;this.gx=new I(0,0)}la(Dg,Be); Dg.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===a.lastInput.clickCount&&(this.gx=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.gx))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.lm(a.lastInput.documentPoint,!0)?!1:!0}; Dg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; Dg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.R("ChangingSelection",b.selection);this.ua(this.name);if(c instanceof T)c.Wb()&&(wg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);za(e)&&(b.model.pf(e),d=b.xc(e))}if(null!==d){var f=I.allocAt(a.x,a.y);this.isGridSnapEnabled&&Eg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);I.free(f)}b.Na();this.transactionResult= this.name;b.R("PartCreated",d)}finally{this.Dg(),b.R("ChangedSelection",b.selection)}return d};ma.Object.defineProperties(Dg.prototype,{archetypeNodeData:{get:function(){return this.lj},set:function(a){this.lj=a}},isDoubleClick:{get:function(){return this.u},set:function(a){this.u=a}},isGridSnapEnabled:{get:function(){return this.l},set:function(a){this.l=a}}});Dg.className="ClickCreatingTool"; function Fg(){Be.call(this);this.name="DragSelecting";this.Xk=175;this.u=!1;var a=new T;a.layerName="Tool";a.selectable=!1;var b=new W;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.l=a}la(Fg,Be); Fg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestamp<this.delay||null!==a.lm(b.documentPoint,!0))?!1:!0};Fg.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0;a.isMouseCaptured=!0;a.skipsUndoManager=!0;a.add(this.box);this.doMouseMove()}; Fg.prototype.doDeactivate=function(){var a=this.diagram;a.Cf();a.remove(this.box);a.skipsUndoManager=!1;this.isActive=a.isMouseCaptured=!1};Fg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&null!==this.box){var b=this.computeBoxBounds(),c=this.box.Za("SHAPE");null===c&&(c=this.box.tb());var d=M.alloc().h(b.width,b.height);b=I.allocAt(b.x,b.y);c.desiredSize=d;this.box.position=b;M.free(d);I.free(b);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.rt(a.lastInput.viewPoint)}}; Fg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.R("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()};Fg.prototype.computeBoxBounds=function(){var a=this.diagram;return new N(a.firstInput.documentPoint,a.lastInput.documentPoint)}; Fg.prototype.selectInRect=function(a){var b=this.diagram,c=b.lastInput;a=b.Xx(a,this.isPartialInclusion);if(Wa?c.meta:c.control)if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected&&(b.isSelected=!1);else for(a=a.iterator;a.next();)b=a.value,b.isSelected=!b.isSelected;else if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0);else{c=new E;for(b=b.selection.iterator;b.next();){var d=b.value;a.contains(d)||c.add(d)}for(b=c.iterator;b.next();)b.value.isSelected=!1;for(a= a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0)}};ma.Object.defineProperties(Fg.prototype,{delay:{get:function(){return this.Xk},set:function(a){this.Xk=a}},isPartialInclusion:{get:function(){return this.u},set:function(a){this.u=a}},box:{get:function(){return this.l},set:function(a){this.l=a}}});Fg.className="DragSelectingTool"; function Gg(){Be.call(this);this.name="Panning";this.Wu=new I;this.Oy=new I;this.Jg=!1;var a=this;this.vx=function(){var b=a.diagram;null!==b&&b.removeEventListener(x.document,"scroll",a.vx,!1);a.stopTool()}}la(Gg,Be);Gg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:!0}; Gg.prototype.doActivate=function(){var a=this.diagram;this.Jg?(a.lastInput.bubbles=!0,a.addEventListener(x.document,"scroll",this.vx,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Wu.assign(a.position));this.isActive=!0};Gg.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="";this.isActive=a.isMouseCaptured=!1};Gg.prototype.doCancel=function(){var a=this.diagram;a.position=this.Wu;a.isMouseCaptured=!1;this.stopTool()};Gg.prototype.doMouseMove=function(){this.move()}; Gg.prototype.doMouseUp=function(){this.move();this.stopTool()};Gg.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.Jg)a.lastInput.bubbles=!0;else{var b=a.position,c=a.firstInput.documentPoint,d=a.lastInput.documentPoint,e=b.x+c.x-d.x;c=b.y+c.y-d.y;a.allowHorizontalScroll||(e=b.x);a.allowVerticalScroll||(c=b.y);a.position=this.Oy.h(e,c)}}; ma.Object.defineProperties(Gg.prototype,{bubbles:{get:function(){return this.Jg},set:function(a){this.Jg=a}},originalPosition:{get:function(){return this.Wu}}});Gg.className="PanningTool";La("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.Wa("ClickCreating",a,this.mouseUpTools)});La("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.Wa("ClickSelecting",a,this.mouseUpTools)}); La("panningTool",function(){return this.findTool("Panning")},function(a){this.Wa("Panning",a,this.mouseMoveTools)});La("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.Wa("DragSelecting",a,this.mouseMoveTools)});La("actionTool",function(){return this.findTool("Action")},function(a){this.Wa("Action",a,this.mouseDownTools)});function Pe(){this.T=this.I=this.l=this.u=null} ma.Object.defineProperties(Pe.prototype,{mainElement:{get:function(){return this.I},set:function(a){this.I=a}},show:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},hide:{get:function(){return this.l},set:function(a){this.l!==a&&(this.l=a)}},valueFunction:{get:function(){return this.T},set:function(a){this.T=a}}});Pe.className="HTMLInfo"; function Hg(a,b,c){this.text=a;this.Mx=b;this.visible=c}Hg.className="ContextMenuButtonInfo";function Ig(){Be.call(this);this.name="ContextMenu";this.u=this.ou=this.l=null;this.lx=new I;this.pu=null;this.Ku=!1;var a=this;this.iv=function(){a.stopTool()}}la(Ig,Be); function Jg(a){var b=new Pe;b.show=function(a,b,c){c.showDefaultContextMenu()};b.hide=function(a,b){b.hideDefaultContextMenu()};Kg=b;a.iv=function(){a.stopTool()};b=ta("div");var c=ta("div");b.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";c.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;"; var d=ta("style");x.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".goCXul { list-style: none; }",0);d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);d=a.diagram;null!==d&&(d.addEventListener(b,"contextmenu",Lg,!1),d.addEventListener(b,"selectstart", Lg,!1),d.addEventListener(c,"contextmenu",Lg,!1));b.className="goCXforeground";c.className="goCXbackground";x.document.body&&(x.document.body.appendChild(b),x.document.body.appendChild(c));Mg=b;Ng=c;Og=!0}function Lg(a){a.preventDefault();return!1}Ig.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right?!1:a.lastInput.isTou [...]
Began life as a copy of #1029880
full source download show line numbers
Snippet is not live.
Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #2000596 |
Snippet name: | go.js [immutable] |
Eternal ID of this version: | #2000596/1 |
Text MD5: | 1e1bf07444c4671aaf7b079c88a555ed |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-09-26 12:16:42 |
Source code size: | 900293 bytes / 2147 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 207 / 75 |
Referenced in: | [show references] |