gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
121 lines • 915 kB
JavaScript
/*
* GoJS v2.2.6 JavaScript Library for HTML Diagrams, https://gojs.net
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com.
* Copyright (C) 1998-2022 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.2.6/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 ea(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var fa="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ha;
if("function"==typeof Object.setPrototypeOf)ha=Object.setPrototypeOf;else{var ia;a:{var ja={a:!0},ka={};try{ka.__proto__=ja;ia=ka.a;break a}catch(a){}ia=!1}ha=ia?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var la=ha;
function ma(a,b){a.prototype=fa(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.oB=b.prototype}
var na="undefined"!=typeof global&&null!=global?global:self,oa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e])}return a},qa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function ra(a,b){if(b){var c=na;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&qa(c,a,{writable:!0,value:b})}}ra("Object.assign",function(a){return a||oa});ra("Array.prototype.fill",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 sa(){}function ta(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=ua(function(){c=-1;a.apply(d,e)},b)}}function ua(a,b){return x.setTimeout(a,b)}
function va(a){return x.document.createElement(a)}function C(a){throw Error(a);}function wa(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);C(a)}function xa(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);C(c+" is not in the range "+b+": "+a)}function ya(a){x.console&&x.console.log(a)}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 Ea(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):C("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Fa(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):C("Cannot remove an object from an HTMLCollection or NodeList at "+b)}
function Ga(){var a=Ha.pop();return void 0===a?[]:a}function Ja(a){a.length=0;Ha.push(a)}function Ka(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 Ka(a.constructor);return typeof a}
function La(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 Ma(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.aB;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("Trident/7"),Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Ta=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i),Ha=[];Object.freeze([]);sa.className="Util";sa.Dx="32ab5ff3b26f42dc0ed90f21462913b5";sa.adym="gojs.net";sa.vfo="28e644fdb5";sa.className="Util";function D(a,b,c){Ua(this);this.j=a;this.na=b;this.o=c}
D.prototype.toString=function(){return"EnumValue."+this.na};function Va(a,b){return void 0===b||null===b||""===b?null:a[b]}na.Object.defineProperties(D.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.na}},value:{get:function(){return this.o}}});D.className="EnumValue";function Wa(){this.Dw=[]}Wa.prototype.toString=function(){return this.Dw.join("")};
Wa.prototype.add=function(a){""!==a&&this.Dw.push(a)};Wa.className="StringBuilder";function Xa(){}Xa.className="PropertyCollection";
var Ya={cB:!1,hB:!1,eB:!1,gB:!1,mB:!1,kB:!1,Kx:!1,dB:null,trace:function(a){x.console&&x.console.log(a)},fB: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)},bB: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.im=Object.getOwnPropertyNames(d.prototype);for(var e={$j:0};e.$j<b.im.length;e={$j:e.$j},e.$j++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.im[e.$j]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype,
b.im[e.$j],{set:function(a,b){return function(){throw Error("Property "+a.im[b.$j]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={im:b.im,x:b.x}}}};function Za(){}Za.prototype.reset=function(){};Za.prototype.next=function(){return!1};Za.prototype.qd=function(){return!1};Za.prototype.first=function(){return null};Za.prototype.any=function(){return!1};Za.prototype.all=function(){return!0};Za.prototype.each=function(){return this};Za.prototype.map=function(){return this};Za.prototype.filter=function(){return this};
Za.prototype.Td=function(){};Za.prototype.toString=function(){return"EmptyIterator"};na.Object.defineProperties(Za.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});Za.prototype.first=Za.prototype.first;Za.prototype.hasNext=Za.prototype.qd;Za.prototype.next=Za.prototype.next;Za.prototype.reset=Za.prototype.reset;var $a=null;Za.className="EmptyIterator";$a=new Za;function ab(a){this.key=-1;this.value=a}
ab.prototype.reset=function(){this.key=-1};ab.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};ab.prototype.qd=function(){return this.next()};ab.prototype.first=function(){this.key=0;return this.value};ab.prototype.any=function(a){this.key=-1;return a(this.value)};ab.prototype.all=function(a){this.key=-1;return a(this.value)};ab.prototype.each=function(a){this.key=-1;a(this.value);return this};ab.prototype.map=function(a){return new ab(a(this.value))};
ab.prototype.filter=function(a){return a(this.value)?new ab(this.value):$a};ab.prototype.Td=function(){this.value=null};ab.prototype.toString=function(){return"SingletonIterator("+this.value+")"};na.Object.defineProperties(ab.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});ab.prototype.first=ab.prototype.first;ab.prototype.hasNext=ab.prototype.qd;ab.prototype.next=ab.prototype.next;
ab.prototype.reset=ab.prototype.reset;ab.className="SingletonIterator";function bb(a){this.rb=a;this.ef=null;a.Ja=null;this.ia=a.Da;this.Ra=-1}bb.prototype.reset=function(){var a=this.rb;a.Ja=null;this.ia=a.Da;this.Ra=-1};bb.prototype.next=function(){var a=this.rb;if(a.Da!==this.ia&&0>this.key)return!1;a=a.m;var b=a.length,c=++this.Ra,d=this.ef;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.Td()}return!1};
bb.prototype.qd=function(){return this.next()};bb.prototype.first=function(){var a=this.rb;this.ia=a.Da;this.Ra=0;a=a.m;var b=a.length,c=this.ef;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};bb.prototype.any=function(a){var b=this.rb;b.Ja=null;this.Ra=-1;b=b.m;for(var c=b.length,d=this.ef,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1};
bb.prototype.all=function(a){var b=this.rb;b.Ja=null;this.Ra=-1;b=b.m;for(var c=b.length,d=this.ef,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};bb.prototype.each=function(a){var b=this.rb;b.Ja=null;this.Ra=-1;b=b.m;for(var c=b.length,d=this.ef,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this};
bb.prototype.map=function(a){var b=this.rb;b.Ja=null;this.Ra=-1;var c=[];b=b.m;for(var d=b.length,e=this.ef,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new F;a.m=c;a.lb();return a.iterator};bb.prototype.filter=function(a){var b=this.rb;b.Ja=null;this.Ra=-1;var c=[];b=b.m;for(var d=b.length,e=this.ef,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&a(g)&&c.push(g)}a=new F;a.m=c;a.lb();return a.iterator};
bb.prototype.Td=function(){this.key=-1;this.value=null;this.ia=-1;this.ef=null;this.rb.Ja=this};bb.prototype.toString=function(){return"ListIterator@"+this.Ra+"/"+this.rb.count};
na.Object.defineProperties(bb.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.ef},set:function(a){this.ef=a}},count:{get:function(){var a=this.ef;if(null!==a){for(var b=0,c=this.rb.m,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.rb.m.length}}});bb.prototype.first=bb.prototype.first;bb.prototype.hasNext=bb.prototype.qd;bb.prototype.next=bb.prototype.next;
bb.prototype.reset=bb.prototype.reset;bb.className="ListIterator";function eb(a){this.rb=a;a.Sg=null;this.ia=a.Da;this.Ra=a.m.length}eb.prototype.reset=function(){var a=this.rb;a.Sg=null;this.ia=a.Da;this.Ra=a.m.length};eb.prototype.next=function(){var a=this.rb;if(a.Da!==this.ia&&0>this.key)return!1;var b=--this.Ra;if(0<=b)return this.key=b,this.value=a.m[b],!0;this.Td();return!1};eb.prototype.qd=function(){return this.next()};
eb.prototype.first=function(){var a=this.rb;this.ia=a.Da;var b=a.m;this.Ra=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};eb.prototype.any=function(a){var b=this.rb;b.Sg=null;b=b.m;var c=b.length;this.Ra=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};eb.prototype.all=function(a){var b=this.rb;b.Sg=null;b=b.m;var c=b.length;this.Ra=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
eb.prototype.each=function(a){var b=this.rb;b.Sg=null;b=b.m;var c=b.length;this.Ra=c;for(--c;0<=c;c--)a(b[c]);return this};eb.prototype.map=function(a){var b=this.rb;b.Sg=null;var c=[];b=b.m;var d=b.length;this.Ra=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new F;a.m=c;a.lb();return a.iterator};eb.prototype.filter=function(a){var b=this.rb;b.Sg=null;var c=[];b=b.m;var d=b.length;this.Ra=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new F;a.m=c;a.lb();return a.iterator};
eb.prototype.Td=function(){this.key=-1;this.value=null;this.ia=-1;this.rb.Sg=this};eb.prototype.toString=function(){return"ListIteratorBackwards("+this.Ra+"/"+this.rb.count+")"};na.Object.defineProperties(eb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.rb.m.length}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.qd;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset;
eb.className="ListIteratorBackwards";function F(a){Ua(this);this.v=!1;this.m=[];this.Da=0;this.Sg=this.Ja=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=F.prototype;t.lb=function(){var a=this.Da;a++;999999999<a&&(a=0);this.Da=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"List()#"+fb(this)};
t.add=function(a){if(null===a)return this;this.v&&wa(this,a);this.m.push(a);this.lb();return this};t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.v&&wa(this);var b=this.m;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.v&&wa(this);this.m.length=0;this.lb()};t.contains=function(a){return null===a?!1:-1!==this.m.indexOf(a)};t.has=function(a){return this.contains(a)};
t.indexOf=function(a){return null===a?-1:this.m.indexOf(a)};t.J=function(a){var b=this.m;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"elt:i");return b[a]};t.get=function(a){return this.J(a)};t.Oc=function(a,b){var c=this.m;(0>a||a>=c.length)&&xa(a,"0 <= i < length",F,"setElt:i");this.v&&wa(this,a);c[a]=b};t.set=function(a,b){this.Oc(a,b)};t.first=function(){var a=this.m;return 0===a.length?null:a[0]};t.$b=function(){var a=this.m,b=a.length;return 0<b?a[b-1]:null};
t.pop=function(){this.v&&wa(this);var a=this.m;return 0<a.length?a.pop():null};F.prototype.any=function(a){for(var b=this.m,c=b.length,d=0;d<c;d++)if(a(b[d]))return!0;return!1};F.prototype.all=function(a){for(var b=this.m,c=b.length,d=0;d<c;d++)if(!a(b[d]))return!1;return!0};F.prototype.each=function(a){for(var b=this.m,c=b.length,d=0;d<c;d++)a(b[d]);return this};F.prototype.map=function(a){for(var b=new F,c=[],d=this.m,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.m=c;b.lb();return b};
F.prototype.filter=function(a){for(var b=new F,c=[],d=this.m,e=d.length,f=0;f<e;f++){var g=d[f];a(g)&&c.push(g)}b.m=c;b.lb();return b};t=F.prototype;t.wb=function(a,b){0>a&&xa(a,">= 0",F,"insertAt:i");this.v&&wa(this,a);var c=this.m;a>=c.length?c.push(b):c.splice(a,0,b);this.lb()};t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=this.m;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.lb();return!0};t.delete=function(a){return this.remove(a)};
t.eb=function(a){var b=this.m;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"removeAt:i");this.v&&wa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.lb()};t.removeRange=function(a,b){var c=this.m,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.v&&wa(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.lb();return this};F.prototype.copy=function(){var a=new F,b=this.m;0<b.length&&(a.m=Array.prototype.slice.call(b));return a};
t=F.prototype;t.ya=function(){for(var a=this.m,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Qv=function(){for(var a=new G,b=this.m,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.v&&wa(this);this.m.sort(a);this.lb();return this};
t.Vi=function(a,b,c){var d=this.m,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.v&&wa(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&xa(b,"0 <= from < length",F,"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.v&&wa(this);this.m.reverse();this.lb();return this};
na.Object.defineProperties(F.prototype,{_dataArray:{get:function(){return this.m}},count:{get:function(){return this.m.length}},size:{get:function(){return this.m.length}},length:{get:function(){return this.m.length}},iterator:{get:function(){if(0>=this.m.length)return $a;var a=this.Ja;return null!==a?(a.reset(),a):new bb(this)}},iteratorBackwards:{
get:function(){if(0>=this.m.length)return $a;var a=this.Sg;return null!==a?(a.reset(),a):new eb(this)}}});F.prototype.reverse=F.prototype.reverse;F.prototype.sortRange=F.prototype.Vi;F.prototype.sort=F.prototype.sort;F.prototype.toSet=F.prototype.Qv;F.prototype.toArray=F.prototype.ya;F.prototype.removeRange=F.prototype.removeRange;F.prototype.removeAt=F.prototype.eb;F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.insertAt=F.prototype.wb;
F.prototype.pop=F.prototype.pop;F.prototype.last=F.prototype.$b;F.prototype.first=F.prototype.first;F.prototype.set=F.prototype.set;F.prototype.setElt=F.prototype.Oc;F.prototype.get=F.prototype.get;F.prototype.elt=F.prototype.J;F.prototype.indexOf=F.prototype.indexOf;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.clear=F.prototype.clear;F.prototype.addAll=F.prototype.addAll;F.prototype.push=F.prototype.push;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ea;
F.prototype.freeze=F.prototype.freeze;F.className="List";function ib(a){this.fg=a;a.Ja=null;this.ia=a.Da;this.ka=null}ib.prototype.reset=function(){var a=this.fg;a.Ja=null;this.ia=a.Da;this.ka=null};ib.prototype.next=function(){var a=this.fg;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Td();return!1};ib.prototype.qd=function(){return this.next()};
ib.prototype.first=function(){var a=this.fg;this.ia=a.Da;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};ib.prototype.any=function(a){var b=this.fg;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};ib.prototype.all=function(a){var b=this.fg;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};ib.prototype.each=function(a){var b=this.fg;this.ka=b.Ja=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this};
ib.prototype.map=function(a){var b=this.fg;b.Ja=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};ib.prototype.filter=function(a){var b=this.fg;b.Ja=null;var c=new F;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};ib.prototype.Td=function(){this.value=this.key=null;this.ia=-1;this.fg.Ja=this};ib.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"};
na.Object.defineProperties(ib.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fg.Ib}}});ib.prototype.first=ib.prototype.first;ib.prototype.hasNext=ib.prototype.qd;ib.prototype.next=ib.prototype.next;ib.prototype.reset=ib.prototype.reset;ib.className="SetIterator";
function G(a){Ua(this);this.v=!1;this.Jb={};this.Ib=0;this.Ja=null;this.Da=0;this.$e=this.ba=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=G.prototype;t.lb=function(){var a=this.Da;a++;999999999<a&&(a=0);this.Da=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Set()#"+fb(this)};
t.add=function(a){if(null===a)return this;this.v&&wa(this,a);var b=a;za(a)&&(b=jb(a));void 0===this.Jb[b]&&(this.Ib++,a=new kb(a,a),this.Jb[b]=a,b=this.$e,null===b?this.ba=a:(a.vl=b,b.oa=a),this.$e=a,this.lb());return this};t.addAll=function(a){if(null===a)return this;this.v&&wa(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=fb(a),void 0===b)?!1:void 0!==this.Jb[b]};t.has=function(a){return this.contains(a)};t.oz=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.pz=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.oa}return!1};G.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};G.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.oa;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!==c;)b.add(a(c.value)),c=c.oa;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.oa}return b};t=G.prototype;
t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=a;if(za(a)&&(b=fb(a),void 0===b))return!1;a=this.Jb[b];if(void 0===a)return!1;var c=a.oa,d=a.vl;null!==c&&(c.vl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.$e===a&&(this.$e=d);delete this.Jb[b];this.Ib--;this.lb();return!0};t.delete=function(a){return this.remove(a)};
t.oq=function(a){if(null===a)return this;this.v&&wa(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.LA=function(a){if(null===a||0===this.count)return this;this.v&&wa(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.oq(a);return this};t.clear=function(){this.v&&wa(this);this.Jb={};this.Ib=0;null!==this.Ja&&this.Ja.reset();this.$e=this.ba=null;this.lb()};
G.prototype.copy=function(){var a=new G,b=this.Jb,c;for(c in b)a.add(b[c].value);return a};G.prototype.ya=function(){var a=Array(this.Ib),b=this.Jb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};G.prototype.Pv=function(){var a=new F,b=this.Jb,c;for(c in b)a.add(b[c].value);return a};function Ua(a){a.__gohashid=lb++}function jb(a){var b=a.__gohashid;void 0===b&&(b=lb++,a.__gohashid=b);return b}function fb(a){return a.__gohashid}
na.Object.defineProperties(G.prototype,{count:{get:function(){return this.Ib}},size:{get:function(){return this.Ib}},iterator:{get:function(){if(0>=this.Ib)return $a;var a=this.Ja;return null!==a?(a.reset(),a):new ib(this)}}});G.prototype.toList=G.prototype.Pv;G.prototype.toArray=G.prototype.ya;G.prototype.clear=G.prototype.clear;G.prototype.retainAll=G.prototype.LA;G.prototype.removeAll=G.prototype.oq;
G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.first=G.prototype.first;G.prototype.containsAny=G.prototype.pz;G.prototype.containsAll=G.prototype.oz;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 lb=1;G.className="Set";G.uniqueHash=Ua;G.hashIdUnique=jb;G.hashId=fb;
function mb(a){this.ga=a;this.ia=a.Da;this.ka=null}mb.prototype.reset=function(){this.ia=this.ga.Da;this.ka=null};mb.prototype.next=function(){var a=this.ga;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=this.key=a=b.key,!0;this.Td();return!1};mb.prototype.qd=function(){return this.next()};mb.prototype.first=function(){var a=this.ga;this.ia=a.Da;a=a.ba;return null!==a?(this.ka=a,this.value=this.key=a=a.key):null};
mb.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.oa}return!1};mb.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.oa}return!0};mb.prototype.each=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};mb.prototype.map=function(a){var b=this.ga;this.ka=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator};
mb.prototype.filter=function(a){var b=this.ga;this.ka=null;var c=new F;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};mb.prototype.Td=function(){this.value=this.key=null;this.ia=-1};mb.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};na.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Ib}}});
mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.qd;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="MapKeySetIterator";function nb(a){G.call(this);Ua(this);this.v=!0;this.ga=a}ma(nb,G);t=nb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.ga.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ga.contains(a)};
t.has=function(a){return this.contains(a)};t.remove=function(){C("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)};t.clear=function(){C("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ga.ba;return null!==a?a.key:null};nb.prototype.any=function(a){for(var b=this.ga.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};nb.prototype.all=function(a){for(var b=this.ga.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};
nb.prototype.each=function(a){for(var b=this.ga.ba;null!==b;)a(b.key),b=b.oa;return this};nb.prototype.map=function(a){for(var b=new G,c=this.ga.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};nb.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.oa}return b};nb.prototype.copy=function(){return new nb(this.ga)};nb.prototype.Qv=function(){var a=new G,b=this.ga.Jb,c;for(c in b)a.add(b[c].key);return a};
nb.prototype.ya=function(){var a=this.ga.Jb,b=Array(this.ga.Ib),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};nb.prototype.Pv=function(){var a=new F,b=this.ga.Jb,c;for(c in b)a.add(b[c].key);return a};na.Object.defineProperties(nb.prototype,{count:{get:function(){return this.ga.Ib}},size:{get:function(){return this.ga.Ib}},iterator:{get:function(){return 0>=this.ga.Ib?$a:new mb(this.ga)}}});
nb.prototype.toList=nb.prototype.Pv;nb.prototype.toArray=nb.prototype.ya;nb.prototype.toSet=nb.prototype.Qv;nb.prototype.first=nb.prototype.first;nb.prototype.clear=nb.prototype.clear;nb.prototype["delete"]=nb.prototype.delete;nb.prototype.remove=nb.prototype.remove;nb.prototype.has=nb.prototype.has;nb.prototype.contains=nb.prototype.contains;nb.prototype.add=nb.prototype.add;nb.prototype.thaw=nb.prototype.ea;nb.prototype.freeze=nb.prototype.freeze;nb.className="MapKeySet";
function ob(a){this.ga=a;a.Ze=null;this.ia=a.Da;this.ka=null}ob.prototype.reset=function(){var a=this.ga;a.Ze=null;this.ia=a.Da;this.ka=null};ob.prototype.next=function(){var a=this.ga;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Td();return!1};ob.prototype.qd=function(){return this.next()};
ob.prototype.first=function(){var a=this.ga;this.ia=a.Da;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};ob.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.oa}return!1};ob.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.oa}return!0};ob.prototype.each=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this};
ob.prototype.map=function(a){var b=this.ga;this.ka=b.Ze=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};ob.prototype.filter=function(a){var b=this.ga;this.ka=b.Ze=null;var c=new F;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};ob.prototype.Td=function(){this.value=this.key=null;this.ia=-1;this.ga.Ze=this};ob.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"};
na.Object.defineProperties(ob.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Ib}}});ob.prototype.first=ob.prototype.first;ob.prototype.hasNext=ob.prototype.qd;ob.prototype.next=ob.prototype.next;ob.prototype.reset=ob.prototype.reset;ob.className="MapValueSetIterator";function kb(a,b){this.key=a;this.value=b;this.vl=this.oa=null}kb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
kb.className="KeyValuePair";function pb(a){this.ga=a;a.Ja=null;this.ia=a.Da;this.ka=null}pb.prototype.reset=function(){var a=this.ga;a.Ja=null;this.ia=a.Da;this.ka=null};pb.prototype.next=function(){var a=this.ga;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.key=b.key,this.value=b.value,!0;this.Td();return!1};pb.prototype.qd=function(){return this.next()};
pb.prototype.first=function(){var a=this.ga;this.ia=a.Da;a=a.ba;return null!==a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};pb.prototype.any=function(a){var b=this.ga;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};pb.prototype.all=function(a){var b=this.ga;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};pb.prototype.each=function(a){var b=this.ga;this.ka=b.Ja=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this};
pb.prototype.map=function(a){var b=this.ga;this.ka=b.Ja=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};pb.prototype.filter=function(a){var b=this.ga;this.ka=b.Ja=null;var c=new F;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};pb.prototype.Td=function(){this.value=this.key=null;this.ia=-1;this.ga.Ja=this};pb.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"};
na.Object.defineProperties(pb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Ib}}});pb.prototype.first=pb.prototype.first;pb.prototype.hasNext=pb.prototype.qd;pb.prototype.next=pb.prototype.next;pb.prototype.reset=pb.prototype.reset;pb.className="MapIterator";
function I(a){Ua(this);this.v=!1;this.Jb={};this.Ib=0;this.Ze=this.Ja=null;this.Da=0;this.$e=this.ba=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=I.prototype;t.lb=function(){var a=this.Da;a++;999999999<a&&(a=0);this.Da=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Map()#"+fb(this)};
t.add=function(a,b){this.v&&wa(this,a);var c=a;za(a)&&(c=jb(a));var d=this.Jb[c];void 0===d?(this.Ib++,a=new kb(a,b),this.Jb[c]=a,c=this.$e,null===c?this.ba=a:(a.vl=c,c.oa=a),this.$e=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 I)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};I.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};I.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};
I.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.oa;return this};I.prototype.map=function(a){for(var b=new I,c=this.ba;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};I.prototype.filter=function(a){for(var b=new I,c=this.ba;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=I.prototype;t.contains=function(a){var b=a;return za(a)&&(b=fb(a),void 0===b)?!1:void 0!==this.Jb[b]};t.has=function(a){return this.contains(a)};
t.H=function(a){var b=a;if(za(a)&&(b=fb(a),void 0===b))return null;a=this.Jb[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.v&&wa(this,a);var b=a;if(za(a)&&(b=fb(a),void 0===b))return!1;a=this.Jb[b];if(void 0===a)return!1;var c=a.oa,d=a.vl;null!==c&&(c.vl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.$e===a&&(this.$e=d);delete this.Jb[b];this.Ib--;this.lb();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this.v&&wa(this);this.Jb={};this.Ib=0;null!==this.Ja&&this.Ja.reset();null!==this.Ze&&this.Ze.reset();this.$e=this.ba=null;this.lb()};I.prototype.copy=function(){var a=new I,b=this.Jb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};I.prototype.ya=function(){var a=this.Jb,b=Array(this.Ib),c=0,d;for(d in a){var e=a[d];b[c]=new kb(e.key,e.value);c++}return b};I.prototype.If=function(){return new nb(this)};
na.Object.defineProperties(I.prototype,{count:{get:function(){return this.Ib}},size:{get:function(){return this.Ib}},iterator:{get:function(){if(0>=this.count)return $a;var a=this.Ja;return null!==a?(a.reset(),a):new pb(this)}},iteratorKeys:{get:function(){return 0>=this.count?$a:new mb(this)}},iteratorValues:{get:function(){if(0>=this.count)return $a;
var a=this.Ze;return null!==a?(a.reset(),a):new ob(this)}}});I.prototype.toKeySet=I.prototype.If;I.prototype.toArray=I.prototype.ya;I.prototype.clear=I.prototype.clear;I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.get=I.prototype.get;I.prototype.getValue=I.prototype.H;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.first=I.prototype.first;I.prototype.addAll=I.prototype.addAll;I.prototype.set=I.prototype.set;
I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.ea;I.prototype.freeze=I.prototype.freeze;I.className="Map";function J(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):C("Invalid arguments to Point constructor: "+a+", "+b);this.v=!1}var qb,rb,sb,tb,ub;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.sg=function(a,b){this.x=a;this.y=b;return this};
J.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.copy=function(){var a=new J;a.x=this.x;a.y=this.y;return a};t=J.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};
function vb(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 wb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof J?this.x===a.x&&this.y===a.y:!1};t.Fi=function(a,b){return this.x===a&&this.y===b};t.Ua=function(a){return L.w(this.x,a.x)&&L.w(this.y,a.y)};
t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ie=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.xf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.pd=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 xb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return xb(a-this.x,b-this.y)};
function xb(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.nz=function(a,b){return L.Vl(a.x,a.y,b.x,b.y,this.x,this.y)};t.BA=function(a,b,c,d){L.Ih(a,b,c,d,this.x,this.y,this);return this};t.CA=function(a,b){L.Ih(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.QA=function(a,b,c,d){L.Wp(this.x,this.y,a,b,c,d,this);return this};
t.RA=function(a,b){L.Wp(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.Ti=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.Ui=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.Aa(this);return this};function yb(a,b){b.Hd(a);return a}
function zb(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 Ab(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.u=function(){return isFinite(this.x)&&isFinite(this.y)};
J.alloc=function(){var a=Eb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Eb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Eb.push(a)};J.prototype.isReal=J.prototype.u;J.prototype.setSpot=J.prototype.Ui;J.prototype.setRectSpot=J.prototype.Ti;J.prototype.snapToGridPoint=J.prototype.RA;J.prototype.snapToGrid=J.prototype.QA;J.prototype.projectOntoLineSegmentPoint=J.prototype.CA;J.prototype.projectOntoLineSegment=J.prototype.BA;
J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return L.bm(a,b,c,d,e,f,g,h)};J.prototype.compareWithLineSegmentPoint=J.prototype.nz;J.compareWithLineSegment=function(a,b,c,d,e,f){return L.Vl(a,b,c,d,e,f)};J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Pa;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.pd;J.prototype.distanceSquaredPoint=J.prototype.xf;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate;
J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.ie;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Ua;J.prototype.equalTo=J.prototype.Fi;J.prototype.equals=J.prototype.A;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.sg;var Eb=[];J.className="Point";J.parse=vb;J.stringify=wb;J.distanceLineSegmentSquared=zb;J.distanceSquared=Ab;J.direction=Db;J.Origin=qb=(new J(0,0)).ca();J.InfiniteTopLeft=rb=(new J(-Infinity,-Infinity)).ca();
J.InfiniteBottomRight=sb=(new J(Infinity,Infinity)).ca();J.SixPoint=tb=(new J(6,6)).ca();J.NoPoint=ub=(new J(NaN,NaN)).ca();J.parse=vb;J.stringify=wb;J.distanceLineSegmentSquared=zb;J.distanceSquared=Ab;J.direction=Db;function Fb(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):C("Invalid arguments to Size constructor: "+a+", "+b);this.v=!1}var Gb,Hb,Ib,Jb,Kb,Lb,Mb;
Fb.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};Fb.prototype.h=function(a,b){this.width=a;this.height=b;return this};Fb.prototype.sg=function(a,b){this.width=a;this.height=b;return this};Fb.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};Fb.prototype.copy=function(){var a=new Fb;a.width=this.width;a.height=this.height;return a};t=Fb.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};
t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function Nb(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 Fb(c,e)}return new Fb}function Ob(a){return a.width.toString()+" "+a.height.toString()}
t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Fb?this.width===a.width&&this.height===a.height:!1};t.Fi=function(a,b){return this.width===a&&this.height===b};t.Ua=function(a){return L.w(this.width,a.width)&&L.w(this.height,a.height)};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};Fb.alloc=function(){var a=Pb.pop();return void 0===a?new Fb:a};Fb.free=function(a){Pb.push(a)};Fb.prototype.isReal=Fb.prototype.u;
Fb.prototype.equalsApprox=Fb.prototype.Ua;Fb.prototype.equalTo=Fb.prototype.Fi;Fb.prototype.equals=Fb.prototype.A;Fb.prototype.set=Fb.prototype.set;Fb.prototype.setTo=Fb.prototype.sg;var Pb=[];Fb.className="Size";Fb.parse=Nb;Fb.stringify=Ob;Fb.ZeroSize=Gb=(new Fb(0,0)).ca();Fb.OneSize=Hb=(new Fb(1,1)).ca();Fb.SixSize=Ib=(new Fb(6,6)).ca();Fb.EightSize=Jb=(new Fb(8,8)).ca();Fb.TenSize=Kb=(new Fb(10,10)).ca();Fb.InfiniteSize=Lb=(new Fb(Infinity,Infinity)).ca();Fb.NoSize=Mb=(new Fb(NaN,NaN)).ca();
Fb.parse=Nb;Fb.stringify=Ob;
function M(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c,this.height=d):a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof Fb?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):C("Incorrect second argument supplied to Rect constructor "+b)):
C("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.v=!1}t=M.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 Qb(a,b,c){a.width=b;a.height=c}t.sg=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.Pc=function(a){this.x=a.x;this.y=a.y;return this};t.PA=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};
t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function Rb(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 M(c,e,f,g)}return new M}
function Sb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.A=function(a){return a instanceof M?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Fi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ua=function(a){return L.w(this.x,a.x)&&L.w(this.y,a.y)&&L.w(this.width,a.width)&&L.w(this.height,a.height)};
function Tb(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 Ub(this,b,a,b,a)};t.Lp=function(a){return Ub(this,a.top,a.right,a.bottom,a.left)};t.Nv=function(a){return Ub(this,-a.top,-a.right,-a.bottom,-a.left)};t.eA=function(a,b,c,d){return Ub(this,a,b,c,d)};function Ub(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.Zx=function(a){return Vb(this,a.x,a.y,a.width,a.height)};
t.$u=function(a,b,c,d){return Vb(this,a,b,c,d)};function Vb(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.Lc=function(a){return this.av(a.x,a.y,a.width,a.height)};
t.av=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function Zb(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Oe=function(a){return $b(this,a.x,a.y,0,0)};t.Qc=function(a){return $b(this,a.x,a.y,a.width,a.height)};
t.Tv=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return $b(this,a,b,c,d)};function $b(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.Ui=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function ac(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}
function bc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.kA=function(){return 0===this.width&&0===this.height};M.alloc=function(){var a=fc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=fc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){fc.push(a)};
na.Object.defineProperties(M.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 Fb(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}}});M.prototype.isEmpty=M.prototype.kA;M.prototype.isReal=M.prototype.u;M.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return L.$x(a,b,c,d,e,f,g,h)};M.prototype.setSpot=M.prototype.Ui;M.prototype.union=M.prototype.Tv;M.prototype.unionRect=M.prototype.Qc;M.prototype.unionPoint=M.prototype.Oe;M.prototype.intersects=M.prototype.av;
M.prototype.intersectsRect=M.prototype.Lc;M.prototype.intersect=M.prototype.$u;M.prototype.intersectRect=M.prototype.Zx;M.prototype.grow=M.prototype.eA;M.prototype.subtractMargin=M.prototype.Nv;M.prototype.addMargin=M.prototype.Lp;M.prototype.inflate=M.prototype.Jc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains;M.prototype.containsRect=M.prototype.Ge;M.prototype.containsPoint=M.prototype.$;M.prototype.equalsApprox=M.prototype.Ua;M.prototype.equalTo=M.prototype.Fi;
M.prototype.equals=M.prototype.A;M.prototype.setSize=M.prototype.PA;M.prototype.setPoint=M.prototype.Pc;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.sg;var gc=null,hc=null,fc=[];M.className="Rect";M.parse=Rb;M.stringify=Sb;M.contains=ac;M.intersects=bc;M.ZeroRect=gc=(new M(0,0,0,0)).ca();M.NoRect=hc=(new M(NaN,NaN,NaN,NaN)).ca();M.parse=Rb;M.stringify=Sb;M.contains=ac;M.intersects=bc;
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):C("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.sg=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}