gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
121 lines • 924 kB
JavaScript
/*
* GoJS v2.1.56 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-2021 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.56/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 ca(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},ka={};try{ka.__proto__=ia;ha=ka.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 la=fa;
function ma(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(la)la(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.BB=b.prototype}var na="undefined"!=typeof global&&null!=global?global:self,oa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function pa(a){if(a){for(var b=na,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&&oa(b,c,{writable:!0,value:a})}}pa(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 globalThis&&globalThis||"object"===typeof global&&global.global===global&&global||"object"===typeof self&&self.self===self&&self||{};void 0===x.requestAnimationFrame&&(void 0===x.setImmediate?x.requestAnimationFrame=function(a){x.setTimeout(a,0)}:x.requestAnimationFrame=x.setImmediate);function ra(){}function sa(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=ta(function(){c=-1;a.apply(d,e)},b)}}function ta(a,b){return x.setTimeout(a,b)}
function ua(a){return x.document.createElement(a)}function B(a){throw Error(a);}function va(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 wa(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 xa(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 Ea(){var a=Fa.pop();return void 0===a?[]:a}function Ia(a){a.length=0;Fa.push(a)}
function Ja(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(za(a)&&a.constructor)return Ja(a.constructor);return typeof a}
function Ka(a){var b=a;za(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function La(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.nB;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
function Na(a,b,c){Object.defineProperty(Pa.prototype,a,{get:b,set:c})}
function Qa(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 Ra=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 9.0"),Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 10.0"),Ta=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Ua=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Va=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Wa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad)/i),
Fa=[];Object.freeze([]);ra.className="Util";ra.Dx="32ab5ff3b26f42dc0ed90f21452913b5";ra.adym="gojs.net";ra.vfo="28e647fdb660";ra.className="Util";function D(a,b,c){Xa(this);this.l=a;this.oa=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.oa};function Ya(a,b){return void 0===b||null===b||""===b?null:a[b]}
na.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.oa}},value:{get:function(){return this.u}}});D.className="EnumValue";function Za(){this.qx=[]}Za.prototype.toString=function(){return this.qx.join("")};Za.prototype.add=function(a){""!==a&&this.qx.push(a)};Za.className="StringBuilder";function $a(){}$a.className="PropertyCollection";
var ab={pB:!1,uB:!1,rB:!1,tB:!1,zB:!1,xB:!1,my:!1,qB:null,trace:function(a){x.console&&x.console.log(a)},sB:function(a,b,c,d){a.strokeStyle="red";a.fillStyle="red";a.font="8px sans-serif";a.beginPath();a.moveTo(-10,0);a.lineTo(10,0);a.moveTo(0,-10);a.lineTo(0,10);a.stroke();a.setTransform(1,0,0,1,0,0);a.scale(c,c);a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy);a.lineWidth=2;a.beginPath();a.moveTo(d.left,d.top+20);a.lineTo(d.left,d.top);a.lineTo(d.left+20,d.top);a.moveTo(d.right,d.bottom-20);a.lineTo(d.right,
d.bottom);a.lineTo(d.right-20,d.bottom);a.stroke();a.fillText("DB: "+Math.round(d.x)+", "+Math.round(d.y)+", "+Math.round(d.width)+", "+Math.round(d.height),d.left,d.top-5)},oB:function(a){var b={},c;for(c in a){b.x=c;if("licenseKey"!==b.x){var d=a[b.x];if(void 0!==d.prototype){b.Jm=Object.getOwnPropertyNames(d.prototype);for(var e={Ak:0};e.Ak<b.Jm.length;e={Ak:e.Ak},e.Ak++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.Jm[e.Ak]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype,
b.Jm[e.Ak],{set:function(a,b){return function(){throw Error("Property "+a.Jm[b.Ak]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={Jm:b.Jm,x:b.x}}}};function cb(){}cb.prototype.reset=function(){};cb.prototype.next=function(){return!1};cb.prototype.rd=function(){return!1};cb.prototype.first=function(){return null};cb.prototype.any=function(){return!1};cb.prototype.all=function(){return!0};cb.prototype.each=function(){return this};cb.prototype.map=function(){return this};cb.prototype.filter=function(){return this};
cb.prototype.Sd=function(){};cb.prototype.toString=function(){return"EmptyIterator"};na.Object.defineProperties(cb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});cb.prototype.first=cb.prototype.first;cb.prototype.hasNext=cb.prototype.rd;cb.prototype.next=cb.prototype.next;cb.prototype.reset=cb.prototype.reset;var db=null;cb.className="EmptyIterator";db=new cb;function hb(a){this.key=-1;this.value=a}
hb.prototype.reset=function(){this.key=-1};hb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};hb.prototype.rd=function(){return this.next()};hb.prototype.first=function(){this.key=0;return this.value};hb.prototype.any=function(a){this.key=-1;return a(this.value)};hb.prototype.all=function(a){this.key=-1;return a(this.value)};hb.prototype.each=function(a){this.key=-1;a(this.value);return this};hb.prototype.map=function(a){return new hb(a(this.value))};
hb.prototype.filter=function(a){return a(this.value)?new hb(this.value):db};hb.prototype.Sd=function(){this.value=null};hb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};na.Object.defineProperties(hb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.rd;hb.prototype.next=hb.prototype.next;
hb.prototype.reset=hb.prototype.reset;hb.className="SingletonIterator";function ib(a){this.ub=a;this.ff=null;a.Ha=null;this.ia=a.Ba;this.Ra=-1}ib.prototype.reset=function(){var a=this.ub;a.Ha=null;this.ia=a.Ba;this.Ra=-1};ib.prototype.next=function(){var a=this.ub;if(a.Ba!==this.ia&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Ra,d=this.ff;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Ra=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Sd()}return!1};
ib.prototype.rd=function(){return this.next()};ib.prototype.first=function(){var a=this.ub;this.ia=a.Ba;this.Ra=0;a=a.j;var b=a.length,c=this.ff;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Ra=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};ib.prototype.any=function(a){var b=this.ub;b.Ha=null;this.Ra=-1;b=b.j;for(var c=b.length,d=this.ff,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1};
ib.prototype.all=function(a){var b=this.ub;b.Ha=null;this.Ra=-1;b=b.j;for(var c=b.length,d=this.ff,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};ib.prototype.each=function(a){var b=this.ub;b.Ha=null;this.Ra=-1;b=b.j;for(var c=b.length,d=this.ff,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this};
ib.prototype.map=function(a){var b=this.ub;b.Ha=null;this.Ra=-1;var c=[];b=b.j;for(var d=b.length,e=this.ff,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.pb();return a.iterator};ib.prototype.filter=function(a){var b=this.ub;b.Ha=null;this.Ra=-1;var c=[];b=b.j;for(var d=b.length,e=this.ff,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.pb();return a.iterator};
ib.prototype.Sd=function(){this.key=-1;this.value=null;this.ia=-1;this.ff=null;this.ub.Ha=this};ib.prototype.toString=function(){return"ListIterator@"+this.Ra+"/"+this.ub.count};
na.Object.defineProperties(ib.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.ff},set:function(a){this.ff=a}},count:{get:function(){var a=this.ff;if(null!==a){for(var b=0,c=this.ub.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.ub.j.length}}});ib.prototype.first=ib.prototype.first;ib.prototype.hasNext=ib.prototype.rd;ib.prototype.next=ib.prototype.next;
ib.prototype.reset=ib.prototype.reset;ib.className="ListIterator";function jb(a){this.ub=a;a.gh=null;this.ia=a.Ba;this.Ra=a.j.length}jb.prototype.reset=function(){var a=this.ub;a.gh=null;this.ia=a.Ba;this.Ra=a.j.length};jb.prototype.next=function(){var a=this.ub;if(a.Ba!==this.ia&&0>this.key)return!1;var b=--this.Ra;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Sd();return!1};jb.prototype.rd=function(){return this.next()};
jb.prototype.first=function(){var a=this.ub;this.ia=a.Ba;var b=a.j;this.Ra=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};jb.prototype.any=function(a){var b=this.ub;b.gh=null;b=b.j;var c=b.length;this.Ra=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};jb.prototype.all=function(a){var b=this.ub;b.gh=null;b=b.j;var c=b.length;this.Ra=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
jb.prototype.each=function(a){var b=this.ub;b.gh=null;b=b.j;var c=b.length;this.Ra=c;for(--c;0<=c;c--)a(b[c]);return this};jb.prototype.map=function(a){var b=this.ub;b.gh=null;var c=[];b=b.j;var d=b.length;this.Ra=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.pb();return a.iterator};jb.prototype.filter=function(a){var b=this.ub;b.gh=null;var c=[];b=b.j;var d=b.length;this.Ra=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.pb();return a.iterator};
jb.prototype.Sd=function(){this.key=-1;this.value=null;this.ia=-1;this.ub.gh=this};jb.prototype.toString=function(){return"ListIteratorBackwards("+this.Ra+"/"+this.ub.count+")"};na.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ub.j.length}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.rd;jb.prototype.next=jb.prototype.next;jb.prototype.reset=jb.prototype.reset;
jb.className="ListIteratorBackwards";function E(a){Xa(this);this.v=!1;this.j=[];this.Ba=0;this.gh=this.Ha=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=E.prototype;t.pb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"List()#"+kb(this)};t.add=function(a){if(null===a)return this;this.v&&va(this,a);this.j.push(a);this.pb();return this};
t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.v&&va(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.pb();return this};t.clear=function(){this.v&&va(this);this.j.length=0;this.pb()};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.J=function(a){var b=this.j;(0>a||a>=b.length)&&wa(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.J(a)};t.Pc=function(a,b){var c=this.j;(0>a||a>=c.length)&&wa(a,"0 <= i < length",E,"setElt:i");this.v&&va(this,a);c[a]=b};t.set=function(a,b){this.Pc(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.v&&va(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.pb();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.pb();return b};t=E.prototype;t.wb=function(a,b){0>a&&wa(a,">= 0",E,"insertAt:i");this.v&&va(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.pb()};t.remove=function(a){if(null===a)return!1;this.v&&va(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.pb();return!0};t.delete=function(a){return this.remove(a)};
t.cb=function(a){var b=this.j;(0>a||a>=b.length)&&wa(a,"0 <= i < length",E,"removeAt:i");this.v&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.pb()};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.v&&va(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.pb();return this};E.prototype.copy=function(){var a=new E,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a};
t=E.prototype;t.ma=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Lw=function(){for(var a=new G,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.v&&va(this);this.j.sort(a);this.pb();return this};
t.uj=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.v&&va(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&wa(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.pb()),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.pb();return this};
t.reverse=function(){this.v&&va(this);this.j.reverse();this.pb();return this};
na.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 db;var a=this.Ha;return null!==a?(a.reset(),a):new ib(this)}},iteratorBackwards:{
get:function(){if(0>=this.j.length)return db;var a=this.gh;return null!==a?(a.reset(),a):new jb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.uj;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Lw;E.prototype.toArray=E.prototype.ma;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.cb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.wb;
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.Pc;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.J;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ea;
E.prototype.freeze=E.prototype.freeze;E.className="List";function lb(a){this.tg=a;a.Ha=null;this.ia=a.Ba;this.ka=null}lb.prototype.reset=function(){var a=this.tg;a.Ha=null;this.ia=a.Ba;this.ka=null};lb.prototype.next=function(){var a=this.tg;if(a.Ba!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.pa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Sd();return!1};lb.prototype.rd=function(){return this.next()};
lb.prototype.first=function(){var a=this.tg;this.ia=a.Ba;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};lb.prototype.any=function(a){var b=this.tg;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.pa}return!1};lb.prototype.all=function(a){var b=this.tg;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.pa}return!0};lb.prototype.each=function(a){var b=this.tg;this.ka=b.Ha=null;for(b=b.ba;null!==b;)a(b.value),b=b.pa;return this};
lb.prototype.map=function(a){var b=this.tg;b.Ha=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.pa;return c.iterator};lb.prototype.filter=function(a){var b=this.tg;b.Ha=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.pa}return c.iterator};lb.prototype.Sd=function(){this.value=this.key=null;this.ia=-1;this.tg.Ha=this};lb.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"};
na.Object.defineProperties(lb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.tg.Fb}}});lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.rd;lb.prototype.next=lb.prototype.next;lb.prototype.reset=lb.prototype.reset;lb.className="SetIterator";
function G(a){Xa(this);this.v=!1;this.Hb={};this.Fb=0;this.Ha=null;this.Ba=0;this.$e=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=G.prototype;t.pb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Set()#"+kb(this)};
t.add=function(a){if(null===a)return this;this.v&&va(this,a);var b=a;za(a)&&(b=mb(a));void 0===this.Hb[b]&&(this.Fb++,a=new nb(a,a),this.Hb[b]=a,b=this.$e,null===b?this.ba=a:(a.Xl=b,b.pa=a),this.$e=a,this.pb());return this};t.addAll=function(a){if(null===a)return this;this.v&&va(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=kb(a),void 0===b)?!1:void 0!==this.Hb[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};
G.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b.value))return!0;b=b.pa}return!1};G.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.pa}return!0};G.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.pa;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!==c;)b.add(a(c.value)),c=c.pa;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ba;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.pa}return b};t=G.prototype;
t.remove=function(a){if(null===a)return!1;this.v&&va(this,a);var b=a;if(za(a)&&(b=kb(a),void 0===b))return!1;a=this.Hb[b];if(void 0===a)return!1;var c=a.pa,d=a.Xl;null!==c&&(c.Xl=d);null!==d&&(d.pa=c);this.ba===a&&(this.ba=c);this.$e===a&&(this.$e=d);delete this.Hb[b];this.Fb--;this.pb();return!0};t.delete=function(a){return this.remove(a)};
t.Zq=function(a){if(null===a)return this;this.v&&va(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.YA=function(a){if(null===a||0===this.count)return this;this.v&&va(this);var b=new G;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Zq(a);return this};t.clear=function(){this.v&&va(this);this.Hb={};this.Fb=0;null!==this.Ha&&this.Ha.reset();this.$e=this.ba=null;this.pb()};
G.prototype.copy=function(){var a=new G,b=this.Hb,c;for(c in b)a.add(b[c].value);return a};G.prototype.ma=function(){var a=Array(this.Fb),b=this.Hb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};G.prototype.Kw=function(){var a=new E,b=this.Hb,c;for(c in b)a.add(b[c].value);return a};function Xa(a){a.__gohashid=ob++}function mb(a){var b=a.__gohashid;void 0===b&&(b=ob++,a.__gohashid=b);return b}function kb(a){return a.__gohashid}
na.Object.defineProperties(G.prototype,{count:{get:function(){return this.Fb}},size:{get:function(){return this.Fb}},iterator:{get:function(){if(0>=this.Fb)return db;var a=this.Ha;return null!==a?(a.reset(),a):new lb(this)}}});G.prototype.toList=G.prototype.Kw;G.prototype.toArray=G.prototype.ma;G.prototype.clear=G.prototype.clear;G.prototype.retainAll=G.prototype.YA;G.prototype.removeAll=G.prototype.Zq;
G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.first=G.prototype.first;G.prototype.containsAny=G.prototype.Fz;G.prototype.containsAll=G.prototype.Ez;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.addAll=G.prototype.addAll;G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;var ob=1;G.className="Set";G.uniqueHash=Xa;G.hashIdUnique=mb;G.hashId=kb;
function pb(a){this.ga=a;this.ia=a.Ba;this.ka=null}pb.prototype.reset=function(){this.ia=this.ga.Ba;this.ka=null};pb.prototype.next=function(){var a=this.ga;if(a.Ba!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.pa;if(null!==b)return this.ka=b,this.value=this.key=a=b.key,!0;this.Sd();return!1};pb.prototype.rd=function(){return this.next()};pb.prototype.first=function(){var a=this.ga;this.ia=a.Ba;a=a.ba;return null!==a?(this.ka=a,this.value=this.key=a=a.key):null};
pb.prototype.any=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.pa}return!1};pb.prototype.all=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.pa}return!0};pb.prototype.each=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;)a(b.key),b=b.pa;return this};pb.prototype.map=function(a){var b=this.ga;this.ka=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.pa;return c.iterator};
pb.prototype.filter=function(a){var b=this.ga;this.ka=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.pa}return c.iterator};pb.prototype.Sd=function(){this.value=this.key=null;this.ia=-1};pb.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};na.Object.defineProperties(pb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Fb}}});
pb.prototype.first=pb.prototype.first;pb.prototype.hasNext=pb.prototype.rd;pb.prototype.next=pb.prototype.next;pb.prototype.reset=pb.prototype.reset;pb.className="MapKeySetIterator";function qb(a){G.call(this);Xa(this);this.v=!0;this.ga=a}ma(qb,G);t=qb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.ga.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.ga.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.ga.ba;return null!==a?a.key:null};qb.prototype.any=function(a){for(var b=this.ga.ba;null!==b;){if(a(b.key))return!0;b=b.pa}return!1};qb.prototype.all=function(a){for(var b=this.ga.ba;null!==b;){if(!a(b.key))return!1;b=b.pa}return!0};
qb.prototype.each=function(a){for(var b=this.ga.ba;null!==b;)a(b.key),b=b.pa;return this};qb.prototype.map=function(a){for(var b=new G,c=this.ga.ba;null!==c;)b.add(a(c.key)),c=c.pa;return b};qb.prototype.filter=function(a){for(var b=new G,c=this.ga.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.pa}return b};qb.prototype.copy=function(){return new qb(this.ga)};qb.prototype.Lw=function(){var a=new G,b=this.ga.Hb,c;for(c in b)a.add(b[c].key);return a};
qb.prototype.ma=function(){var a=this.ga.Hb,b=Array(this.ga.Fb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};qb.prototype.Kw=function(){var a=new E,b=this.ga.Hb,c;for(c in b)a.add(b[c].key);return a};na.Object.defineProperties(qb.prototype,{count:{get:function(){return this.ga.Fb}},size:{get:function(){return this.ga.Fb}},iterator:{get:function(){return 0>=this.ga.Fb?db:new pb(this.ga)}}});
qb.prototype.toList=qb.prototype.Kw;qb.prototype.toArray=qb.prototype.ma;qb.prototype.toSet=qb.prototype.Lw;qb.prototype.first=qb.prototype.first;qb.prototype.clear=qb.prototype.clear;qb.prototype["delete"]=qb.prototype.delete;qb.prototype.remove=qb.prototype.remove;qb.prototype.has=qb.prototype.has;qb.prototype.contains=qb.prototype.contains;qb.prototype.add=qb.prototype.add;qb.prototype.thaw=qb.prototype.ea;qb.prototype.freeze=qb.prototype.freeze;qb.className="MapKeySet";
function rb(a){this.ga=a;a.Ze=null;this.ia=a.Ba;this.ka=null}rb.prototype.reset=function(){var a=this.ga;a.Ze=null;this.ia=a.Ba;this.ka=null};rb.prototype.next=function(){var a=this.ga;if(a.Ba!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.pa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Sd();return!1};rb.prototype.rd=function(){return this.next()};
rb.prototype.first=function(){var a=this.ga;this.ia=a.Ba;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};rb.prototype.any=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.pa}return!1};rb.prototype.all=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.pa}return!0};rb.prototype.each=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;)a(b.value),b=b.pa;return this};
rb.prototype.map=function(a){var b=this.ga;this.ka=b.Ze=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.pa;return c.iterator};rb.prototype.filter=function(a){var b=this.ga;this.ka=b.Ze=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.pa}return c.iterator};rb.prototype.Sd=function(){this.value=this.key=null;this.ia=-1;this.ga.Ze=this};rb.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"};
na.Object.defineProperties(rb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Fb}}});rb.prototype.first=rb.prototype.first;rb.prototype.hasNext=rb.prototype.rd;rb.prototype.next=rb.prototype.next;rb.prototype.reset=rb.prototype.reset;rb.className="MapValueSetIterator";function nb(a,b){this.key=a;this.value=b;this.Xl=this.pa=null}nb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
nb.className="KeyValuePair";function sb(a){this.ga=a;a.Ha=null;this.ia=a.Ba;this.ka=null}sb.prototype.reset=function(){var a=this.ga;a.Ha=null;this.ia=a.Ba;this.ka=null};sb.prototype.next=function(){var a=this.ga;if(a.Ba!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.pa;if(null!==b)return this.ka=b,this.key=b.key,this.value=b.value,!0;this.Sd();return!1};sb.prototype.rd=function(){return this.next()};
sb.prototype.first=function(){var a=this.ga;this.ia=a.Ba;a=a.ba;return null!==a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};sb.prototype.any=function(a){var b=this.ga;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.pa}return!1};sb.prototype.all=function(a){var b=this.ga;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.pa}return!0};sb.prototype.each=function(a){var b=this.ga;this.ka=b.Ha=null;for(b=b.ba;null!==b;)a(b),b=b.pa;return this};
sb.prototype.map=function(a){var b=this.ga;this.ka=b.Ha=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.pa;return c.iterator};sb.prototype.filter=function(a){var b=this.ga;this.ka=b.Ha=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.pa;return c.iterator};sb.prototype.Sd=function(){this.value=this.key=null;this.ia=-1;this.ga.Ha=this};sb.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"};
na.Object.defineProperties(sb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Fb}}});sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.rd;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapIterator";
function H(a){Xa(this);this.v=!1;this.Hb={};this.Fb=0;this.Ze=this.Ha=null;this.Ba=0;this.$e=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=H.prototype;t.pb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Map()#"+kb(this)};
t.add=function(a,b){this.v&&va(this,a);var c=a;za(a)&&(c=mb(a));var d=this.Hb[c];void 0===d?(this.Fb++,a=new nb(a,b),this.Hb[c]=a,c=this.$e,null===c?this.ba=a:(a.Xl=c,c.pa=a),this.$e=a,this.pb()):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.pa}return!1};H.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.pa}return!0};
H.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.pa;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.pa;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.pa;return b};t=H.prototype;t.contains=function(a){var b=a;return za(a)&&(b=kb(a),void 0===b)?!1:void 0!==this.Hb[b]};t.has=function(a){return this.contains(a)};
t.G=function(a){var b=a;if(za(a)&&(b=kb(a),void 0===b))return null;a=this.Hb[b];return void 0===a?null:a.value};t.get=function(a){return this.G(a)};t.remove=function(a){if(null===a)return!1;this.v&&va(this,a);var b=a;if(za(a)&&(b=kb(a),void 0===b))return!1;a=this.Hb[b];if(void 0===a)return!1;var c=a.pa,d=a.Xl;null!==c&&(c.Xl=d);null!==d&&(d.pa=c);this.ba===a&&(this.ba=c);this.$e===a&&(this.$e=d);delete this.Hb[b];this.Fb--;this.pb();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this.v&&va(this);this.Hb={};this.Fb=0;null!==this.Ha&&this.Ha.reset();null!==this.Ze&&this.Ze.reset();this.$e=this.ba=null;this.pb()};H.prototype.copy=function(){var a=new H,b=this.Hb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};H.prototype.ma=function(){var a=this.Hb,b=Array(this.Fb),c=0,d;for(d in a){var e=a[d];b[c]=new nb(e.key,e.value);c++}return b};H.prototype.Kf=function(){return new qb(this)};
na.Object.defineProperties(H.prototype,{count:{get:function(){return this.Fb}},size:{get:function(){return this.Fb}},iterator:{get:function(){if(0>=this.count)return db;var a=this.Ha;return null!==a?(a.reset(),a):new sb(this)}},iteratorKeys:{get:function(){return 0>=this.count?db:new pb(this)}},iteratorValues:{get:function(){if(0>=this.count)return db;
var a=this.Ze;return null!==a?(a.reset(),a):new rb(this)}}});H.prototype.toKeySet=H.prototype.Kf;H.prototype.toArray=H.prototype.ma;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.G;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 J(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.v=!1}J.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.h=function(a,b){this.x=a;this.y=b;return this};J.prototype.Ig=function(a,b){this.x=a;this.y=b;return this};
J.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.copy=function(){var a=new J;a.x=this.x;a.y=this.y;return a};t=J.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.v=!1;return this};
function tb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new J(c,e)}return new J}function ub(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.w=function(a){return a instanceof J?this.x===a.x&&this.y===a.y:!1};t.fj=function(a,b){return this.x===a&&this.y===b};t.Qa=function(a){return L.A(this.x,a.x)&&L.A(this.y,a.y)};
t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ge=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};J.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=J.prototype;
t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.Ie=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.qd=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.Pa=function(a){return vb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return vb(a-this.x,b-this.y)};
function vb(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.OA=function(a,b,c,d){L.Qh(a,b,c,d,this.x,this.y,this);return this};t.PA=function(a,b){L.Qh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.cB=function(a,b,c,d){L.Gq(this.x,this.y,a,b,c,d,this);return this};t.dB=function(a,b){L.Gq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};
t.tj=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.Uk=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.ta(this);return this};function wb(a,b){b.Jd(a);return a}function xb(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 yb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}
function zb(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.o=function(){return isFinite(this.x)&&isFinite(this.y)};J.alloc=function(){var a=Ab.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Ab.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Ab.push(a)};J.prototype.isReal=J.prototype.o;
J.prototype.setSpot=J.prototype.Uk;J.prototype.setRectSpot=J.prototype.tj;J.prototype.snapToGridPoint=J.prototype.dB;J.prototype.snapToGrid=J.prototype.cB;J.prototype.projectOntoLineSegmentPoint=J.prototype.PA;J.prototype.projectOntoLineSegment=J.prototype.OA;J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return L.Cm(a,b,c,d,e,f,g,h)};J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Pa;J.prototype.normalize=J.prototype.normalize;
J.prototype.distanceSquared=J.prototype.qd;J.prototype.distanceSquaredPoint=J.prototype.Ie;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.ge;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Qa;J.prototype.equalTo=J.prototype.fj;J.prototype.equals=J.prototype.w;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.Ig;var Bb=null,Cb=null,Fb=null,Gb=null,Hb=null,Ab=[];
J.className="Point";J.parse=tb;J.stringify=ub;J.distanceLineSegmentSquared=xb;J.distanceSquared=yb;J.direction=zb;J.Origin=Bb=(new J(0,0)).ca();J.InfiniteTopLeft=Cb=(new J(-Infinity,-Infinity)).ca();J.InfiniteBottomRight=Fb=(new J(Infinity,Infinity)).ca();J.SixPoint=Gb=(new J(6,6)).ca();J.NoPoint=Hb=(new J(NaN,NaN)).ca();J.parse=tb;J.stringify=ub;J.distanceLineSegmentSquared=xb;J.distanceSquared=yb;J.direction=zb;
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.v=!1}var Ib,Jb,Kb,Lb,Mb,Nb,Ob;M.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.h=function(a,b){this.width=a;this.height=b;return this};M.prototype.Ig=function(a,b){this.width=a;this.height=b;return this};
M.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.v=!1;return this};
function Pb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new M(c,e)}return new M}function Qb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.w=function(a){return a instanceof M?this.width===a.width&&this.height===a.height:!1};t.fj=function(a,b){return this.width===a&&this.height===b};
t.Qa=function(a){return L.A(this.width,a.width)&&L.A(this.height,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};M.alloc=function(){var a=Rb.pop();return void 0===a?new M:a};M.free=function(a){Rb.push(a)};M.prototype.isReal=M.prototype.o;M.prototype.equalsApprox=M.prototype.Qa;M.prototype.equalTo=M.prototype.fj;M.prototype.equals=M.prototype.w;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Ig;var Rb=[];M.className="Size";M.parse=Pb;M.stringify=Qb;
M.ZeroSize=Ib=(new M(0,0)).ca();M.OneSize=Jb=(new M(1,1)).ca();M.SixSize=Kb=(new M(6,6)).ca();M.EightSize=Lb=(new M(8,8)).ca();M.TenSize=Mb=(new M(10,10)).ca();M.InfiniteSize=Nb=(new M(Infinity,Infinity)).ca();M.NoSize=Ob=(new M(NaN,NaN)).ca();M.parse=Pb;M.stringify=Qb;
function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof M?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):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.v=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Sb(a,b,c){a.width=b;a.height=c}t.Ig=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.Qc=function(a){this.x=a.x;this.y=a.y;return this};t.bB=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};
t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.v=!1;return this};function Tb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));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 Ub(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.fj=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Qa=function(a){return L.A(this.x,a.x)&&L.A(this.y,a.y)&&L.A(this.width,a.width)&&L.A(this.height,a.height)};
function Vb(a,b){return L.aa(a.x,b.x)&&L.aa(a.y,b.y)&&L.aa(a.width,b.width)&&L.aa(a.height,b.height)}t.$=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Ge=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.Jc=function(a,b){return Wb(this,b,a,b,a)};t.uq=function(a){return Wb(this,a.top,a.right,a.bottom,a.left)};t.Jw=function(a){return Wb(this,-a.top,-a.right,-a.bottom,-a.left)};t.sA=function(a,b,c,d){return Wb(this,a,b,c,d)};function Wb(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.Dy=function(a){return $b(this,a.x,a.y,a.width,a.height)};
t.bw=function(a,b,c,d){return $b(this,a,b,c,d)};function $b(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.Mc=function(a){return this.cw(a.x,a.y,a.width,a.height)};
t.cw=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 ac(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.Oe=function(a){return bc(this,a.x,a.y,0,0)};t.Rc=function(a){return bc(this,a.x,a.y,a.width,a.height)};
t.Rw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return bc(this,a,b,c,d)};function bc(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.Uk=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 cc(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 dc(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.o=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.yA=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)};
na.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{
get:function(){return new J(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new M(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new J(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},
set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.yA;N.prototype.isReal=N.prototype.o;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return L.Ey(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.Uk;N.prototype.union=N.prototype.Rw;N.prototype.unionRect=N.prototype.Rc;N.prototype.unionPoint=N.prototype.Oe;N.prototype.intersects=N.prototype.cw;
N.prototype.intersectsRect=N.prototype.Mc;N.prototype.intersect=N.prototype.bw;N.prototype.intersectRect=N.prototype.Dy;N.prototype.grow=N.prototype.sA;N.prototype.subtractMargin=N.prototype.Jw;N.prototype.addMargin=N.prototype.uq;N.prototype.inflate=N.prototype.Jc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Ge;N.prototype.containsPoint=N.prototype.$;N.prototype.equalsApprox=N.prototype.Qa;N.prototype.equalTo=N.prototype.fj;
N.prototype.equals=N.prototype.w;N.prototype.setSize=N.prototype.bB;N.prototype.setPoint=N.prototype.Qc;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.Ig;var ic=null,jc=null,hc=[];N.className="Rect";N.parse=Tb;N.stringify=Ub;N.contains=cc;N.intersects=dc;N.ZeroRect=ic=(new N(0,0,0,0)).ca();N.NoRect=jc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Tb;N.stringify=Ub;N.contains=cc;N.intersects=dc;
function kc(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.v=!1}kc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};
kc.prototype.Ig=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};kc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};kc.prototype.copy=function(){var a=new kc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=kc.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};
t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: