gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
122 lines • 887 kB
JavaScript
/*
* GoJS v2.1.2 JavaScript Library for HTML Diagrams
* Northwoods Software, https://www.nwoods.com/
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
* Copyright (C) 1998-2019 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.2/license.html.
*/
(function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ca(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var da="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},fa;
if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:{var ia={a:!0},ja={};try{ja.__proto__=ia;ha=ja.a;break a}catch(a){}ha=!1}fa=ha?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ka=fa;
function la(a,b){a.prototype=da(b.prototype);a.prototype.constructor=a;if(ka)ka(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.AA=b.prototype}var ma="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,na="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function oa(a){if(a){for(var b=ma,c=["Array","prototype","fill"],d=0;d<c.length-1;d++){var e=c[d];e in b||(b[e]={});b=b[e]}c=c[c.length-1];d=b[c];a=a(d);a!=d&&null!=a&&na(b,c,{writable:!0,value:a})}}oa(function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}});var x="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.global===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===x.requestAnimationFrame&&(x.requestAnimationFrame=x.setImmediate);function qa(){}function ra(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=sa(function(){c=-1;a.apply(d,e)},b)}}function sa(a,b){return x.setTimeout(a,b)}function ta(a){return x.document.createElement(a)}
function B(a){throw Error(a);}function ua(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);B(a)}function va(a,b,c,d){c=null===c?"*":"string"===typeof c?c:"function"===typeof c&&"string"===typeof c.className?c.className:"";void 0!==d&&(c+="."+d);B(c+" is not in the range "+b+": "+a)}function wa(a){x.console&&x.console.log(a)}
function xa(){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 ya(a){return"object"===typeof a&&null!==a}function za(a){return Array.isArray(a)||x.NodeList&&a instanceof x.NodeList||x.HTMLCollection&&a instanceof x.HTMLCollection}function Aa(a){return Array.prototype.slice.call(a)}
function Ba(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 Ca(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 Da(){var a=Ea.pop();return void 0===a?[]:a}function Fa(a){a.length=0;Ea.push(a)}
function Ha(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(ya(a)&&a.constructor)return Ha(a.constructor);return typeof a}
function Ia(a){var b=a;ya(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 Ja(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.uA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
function La(a,b,c){Object.defineProperty(Na.prototype,a,{get:b,set:c})}function Oa(){var a=Qa;if(0===a.length)for(var b=x.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.B&&a.push(e.parentElement.B)}return a}
function Ra(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join("");a=""===a?"0":a;b=[];for(c=0;256>c;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f}
var Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 9.0"),Ta=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 10.0"),Ua=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Va=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Wa=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Xa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad)/i),
Ea=[];Object.freeze([]);var Qa=[];qa.className="Util";qa.Dx="32ab5ff3b26f42dc0ed90f224d2913b5";qa.adym="gojs.net";qa.vfo="28e647fdb1";qa.className="Util";function D(a,b,c){Za(this);this.l=a;this.Qa=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Qa};function $a(a,b){return void 0===b||null===b||""===b?null:a[b]}
ma.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.Qa}},value:{get:function(){return this.u}}});D.className="EnumValue";function cb(){this.vw=[]}cb.prototype.toString=function(){return this.vw.join("")};cb.prototype.add=function(a){""!==a&&this.vw.push(a)};cb.className="StringBuilder";function db(){}db.className="PropertyCollection";
function eb(){}eb.prototype.reset=function(){};eb.prototype.next=function(){return!1};eb.prototype.fd=function(){return!1};eb.prototype.first=function(){return null};eb.prototype.any=function(){return!1};eb.prototype.all=function(){return!0};eb.prototype.each=function(){return this};eb.prototype.map=function(){return this};eb.prototype.filter=function(){return this};eb.prototype.Ad=function(){};eb.prototype.toString=function(){return"EmptyIterator"};
ma.Object.defineProperties(eb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.fd;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset;var fb=null;eb.className="EmptyIterator";fb=new eb;function gb(a){this.key=-1;this.value=a}gb.prototype.reset=function(){this.key=-1};
gb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};gb.prototype.fd=function(){return this.next()};gb.prototype.first=function(){this.key=0;return this.value};gb.prototype.any=function(a){this.key=-1;return a(this.value)};gb.prototype.all=function(a){this.key=-1;return a(this.value)};gb.prototype.each=function(a){this.key=-1;a(this.value);return this};gb.prototype.map=function(a){return new gb(a(this.value))};
gb.prototype.filter=function(a){return a(this.value)?new gb(this.value):fb};gb.prototype.Ad=function(){this.value=null};gb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};ma.Object.defineProperties(gb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});gb.prototype.first=gb.prototype.first;gb.prototype.hasNext=gb.prototype.fd;gb.prototype.next=gb.prototype.next;
gb.prototype.reset=gb.prototype.reset;gb.className="SingletonIterator";function ib(a){this.lb=a;this.We=null;a.Ga=null;this.ia=a.xa;this.Oa=-1}ib.prototype.reset=function(){var a=this.lb;a.Ga=null;this.ia=a.xa;this.Oa=-1};ib.prototype.next=function(){var a=this.lb;if(a.xa!==this.ia&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Oa,d=this.We;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Oa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Ad()}return!1};
ib.prototype.fd=function(){return this.next()};ib.prototype.first=function(){var a=this.lb;this.ia=a.xa;this.Oa=0;a=a.j;var b=a.length,c=this.We;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Oa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};ib.prototype.any=function(a){var b=this.lb;b.Ga=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.We,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.lb;b.Ga=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.We,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.lb;b.Ga=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.We,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.lb;b.Ga=null;this.Oa=-1;var c=[];b=b.j;for(var d=b.length,e=this.We,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.ib();return a.iterator};ib.prototype.filter=function(a){var b=this.lb;b.Ga=null;this.Oa=-1;var c=[];b=b.j;for(var d=b.length,e=this.We,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.ib();return a.iterator};
ib.prototype.Ad=function(){this.key=-1;this.value=null;this.ia=-1;this.We=null;this.lb.Ga=this};ib.prototype.toString=function(){return"ListIterator@"+this.Oa+"/"+this.lb.count};
ma.Object.defineProperties(ib.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.We},set:function(a){this.We=a}},count:{get:function(){var a=this.We;if(null!==a){for(var b=0,c=this.lb.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.lb.j.length}}});ib.prototype.first=ib.prototype.first;ib.prototype.hasNext=ib.prototype.fd;ib.prototype.next=ib.prototype.next;
ib.prototype.reset=ib.prototype.reset;ib.className="ListIterator";function jb(a){this.lb=a;a.Zg=null;this.ia=a.xa;this.Oa=a.j.length}jb.prototype.reset=function(){var a=this.lb;a.Zg=null;this.ia=a.xa;this.Oa=a.j.length};jb.prototype.next=function(){var a=this.lb;if(a.xa!==this.ia&&0>this.key)return!1;var b=--this.Oa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Ad();return!1};jb.prototype.fd=function(){return this.next()};
jb.prototype.first=function(){var a=this.lb;this.ia=a.xa;var b=a.j;this.Oa=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.lb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};jb.prototype.all=function(a){var b=this.lb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
jb.prototype.each=function(a){var b=this.lb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)a(b[c]);return this};jb.prototype.map=function(a){var b=this.lb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.ib();return a.iterator};jb.prototype.filter=function(a){var b=this.lb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.ib();return a.iterator};
jb.prototype.Ad=function(){this.key=-1;this.value=null;this.ia=-1;this.lb.Zg=this};jb.prototype.toString=function(){return"ListIteratorBackwards("+this.Oa+"/"+this.lb.count+")"};ma.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.lb.j.length}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.fd;jb.prototype.next=jb.prototype.next;jb.prototype.reset=jb.prototype.reset;
jb.className="ListIteratorBackwards";function E(a){Za(this);this.s=!1;this.j=[];this.xa=0;this.Zg=this.Ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?xa():this.addAll(a))}t=E.prototype;t.ib=function(){var a=this.xa;a++;999999999<a&&(a=0);this.xa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"List()#"+lb(this)};t.add=function(a){if(null===a)return this;this.s&&ua(this,a);this.j.push(a);this.ib();return this};
t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.s&&ua(this);var b=this.j;if(za(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.ib();return this};t.clear=function(){this.s&&ua(this);this.j.length=0;this.ib()};t.contains=function(a){return null===a?!1:-1!==this.j.indexOf(a)};t.has=function(a){return this.contains(a)};t.indexOf=function(a){return null===a?-1:this.j.indexOf(a)};
t.L=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.hd=function(a,b){var c=this.j;(0>a||a>=c.length)&&va(a,"0 <= i < length",E,"setElt:i");this.s&&ua(this,a);c[a]=b};t.set=function(a,b){this.hd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Vb=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this.s&&ua(this);var a=this.j;return 0<a.length?a.pop():null};
E.prototype.any=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(a(b[d]))return!0;return!1};E.prototype.all=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(!a(b[d]))return!1;return!0};E.prototype.each=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)a(b[d]);return this};E.prototype.map=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.j=c;b.ib();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.ib();return b};t=E.prototype;t.Kb=function(a,b){0>a&&va(a,">= 0",E,"insertAt:i");this.s&&ua(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.ib()};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=this.j;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.ib();return!0};t.delete=function(a){return this.remove(a)};
t.jb=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"removeAt:i");this.s&&ua(this,a);a===b.length-1?b.pop():b.splice(a,1);this.ib()};t.removeRange=function(a,b){var c=this.j,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.s&&ua(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.ib();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.Yv=function(){for(var a=new F,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.s&&ua(this);this.j.sort(a);this.ib();return this};
t.$i=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.s&&ua(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&va(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.ib()),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.ib();return this};
t.reverse=function(){this.s&&ua(this);this.j.reverse();this.ib();return this};
ma.Object.defineProperties(E.prototype,{_dataArray:{get:function(){return this.j}},count:{get:function(){return this.j.length}},size:{get:function(){return this.j.length}},length:{get:function(){return this.j.length}},iterator:{get:function(){if(0>=this.j.length)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new ib(this)}},iteratorBackwards:{
get:function(){if(0>=this.j.length)return fb;var a=this.Zg;return null!==a?(a.reset(),a):new jb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.$i;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Yv;E.prototype.toArray=E.prototype.ma;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.jb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.Kb;
E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Vb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.hd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.L;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ea;
E.prototype.freeze=E.prototype.freeze;E.className="List";function nb(a){this.og=a;a.Ga=null;this.ia=a.xa;this.ka=null}nb.prototype.reset=function(){var a=this.og;a.Ga=null;this.ia=a.xa;this.ka=null};nb.prototype.next=function(){var a=this.og;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Ad();return!1};nb.prototype.fd=function(){return this.next()};
nb.prototype.first=function(){var a=this.og;this.ia=a.xa;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};nb.prototype.any=function(a){var b=this.og;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.na}return!1};nb.prototype.all=function(a){var b=this.og;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.na}return!0};nb.prototype.each=function(a){var b=this.og;this.ka=b.Ga=null;for(b=b.ba;null!==b;)a(b.value),b=b.na;return this};
nb.prototype.map=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.na;return c.iterator};nb.prototype.filter=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.na}return c.iterator};nb.prototype.Ad=function(){this.value=this.key=null;this.ia=-1;this.og.Ga=this};nb.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"};
ma.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.og.Db}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.fd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="SetIterator";
function F(a){Za(this);this.s=!1;this.Eb={};this.Db=0;this.Ga=null;this.xa=0;this.Re=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?xa():this.addAll(a))}t=F.prototype;t.ib=function(){var a=this.xa;a++;999999999<a&&(a=0);this.xa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"Set()#"+lb(this)};
t.add=function(a){if(null===a)return this;this.s&&ua(this,a);var b=a;ya(a)&&(b=ob(a));void 0===this.Eb[b]&&(this.Db++,a=new pb(a,a),this.Eb[b]=a,b=this.Re,null===b?this.ba=a:(a.Bl=b,b.na=a),this.Re=a,this.ib());return this};t.addAll=function(a){if(null===a)return this;this.s&&ua(this);if(za(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 ya(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Eb[b]};t.has=function(a){return this.contains(a)};t.Jy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Ky=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(){var a=this.ba;return null===a?null:a.value};
F.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b.value))return!0;b=b.na}return!1};F.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.na}return!0};F.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.na;return this};F.prototype.map=function(a){for(var b=new F,c=this.ba;null!==c;)b.add(a(c.value)),c=c.na;return b};F.prototype.filter=function(a){for(var b=new F,c=this.ba;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.na}return b};t=F.prototype;
t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=a;if(ya(a)&&(b=lb(a),void 0===b))return!1;a=this.Eb[b];if(void 0===a)return!1;var c=a.na,d=a.Bl;null!==c&&(c.Bl=d);null!==d&&(d.na=c);this.ba===a&&(this.ba=c);this.Re===a&&(this.Re=d);delete this.Eb[b];this.Db--;this.ib();return!0};t.delete=function(a){return this.remove(a)};
t.uq=function(a){if(null===a)return this;this.s&&ua(this);if(za(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.fA=function(a){if(null===a||0===this.count)return this;this.s&&ua(this);var b=new F;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.uq(a);return this};t.clear=function(){this.s&&ua(this);this.Eb={};this.Db=0;null!==this.Ga&&this.Ga.reset();this.Re=this.ba=null;this.ib()};
F.prototype.copy=function(){var a=new F,b=this.Eb,c;for(c in b)a.add(b[c].value);return a};F.prototype.ma=function(){var a=Array(this.Db),b=this.Eb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.Xv=function(){var a=new E,b=this.Eb,c;for(c in b)a.add(b[c].value);return a};function Za(a){a.__gohashid=rb++}function ob(a){var b=a.__gohashid;void 0===b&&(b=rb++,a.__gohashid=b);return b}function lb(a){return a.__gohashid}
ma.Object.defineProperties(F.prototype,{count:{get:function(){return this.Db}},size:{get:function(){return this.Db}},iterator:{get:function(){if(0>=this.Db)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new nb(this)}}});F.prototype.toList=F.prototype.Xv;F.prototype.toArray=F.prototype.ma;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.fA;F.prototype.removeAll=F.prototype.uq;
F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.Ky;F.prototype.containsAll=F.prototype.Jy;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.addAll=F.prototype.addAll;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ea;F.prototype.freeze=F.prototype.freeze;var rb=1;F.className="Set";F.uniqueHash=Za;F.hashIdUnique=ob;F.hashId=lb;
function sb(a){this.fa=a;this.ia=a.xa;this.ka=null}sb.prototype.reset=function(){this.ia=this.fa.xa;this.ka=null};sb.prototype.next=function(){var a=this.fa;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.value=this.key=a=b.key,!0;this.Ad();return!1};sb.prototype.fd=function(){return this.next()};sb.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;return null!==a?(this.ka=a,this.value=this.key=a=a.key):null};
sb.prototype.any=function(a){var b=this.fa;this.ka=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.na}return!1};sb.prototype.all=function(a){var b=this.fa;this.ka=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.na}return!0};sb.prototype.each=function(a){var b=this.fa;this.ka=null;for(b=b.ba;null!==b;)a(b.key),b=b.na;return this};sb.prototype.map=function(a){var b=this.fa;this.ka=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.na;return c.iterator};
sb.prototype.filter=function(a){var b=this.fa;this.ka=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.na}return c.iterator};sb.prototype.Ad=function(){this.value=this.key=null;this.ia=-1};sb.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};ma.Object.defineProperties(sb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});
sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.fd;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapKeySetIterator";function tb(a){F.call(this);Za(this);this.s=!0;this.fa=a}la(tb,F);t=tb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.fa.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.fa.contains(a)};
t.has=function(a){return this.contains(a)};t.remove=function(){B("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){B("This Set is read-only: "+this.toString())};t.first=function(){var a=this.fa.ba;return null!==a?a.key:null};tb.prototype.any=function(a){for(var b=this.fa.ba;null!==b;){if(a(b.key))return!0;b=b.na}return!1};tb.prototype.all=function(a){for(var b=this.fa.ba;null!==b;){if(!a(b.key))return!1;b=b.na}return!0};
tb.prototype.each=function(a){for(var b=this.fa.ba;null!==b;)a(b.key),b=b.na;return this};tb.prototype.map=function(a){for(var b=new F,c=this.fa.ba;null!==c;)b.add(a(c.key)),c=c.na;return b};tb.prototype.filter=function(a){for(var b=new F,c=this.fa.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.na}return b};tb.prototype.copy=function(){return new tb(this.fa)};tb.prototype.Yv=function(){var a=new F,b=this.fa.Eb,c;for(c in b)a.add(b[c].key);return a};
tb.prototype.ma=function(){var a=this.fa.Eb,b=Array(this.fa.Db),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};tb.prototype.Xv=function(){var a=new E,b=this.fa.Eb,c;for(c in b)a.add(b[c].key);return a};ma.Object.defineProperties(tb.prototype,{count:{get:function(){return this.fa.Db}},size:{get:function(){return this.fa.Db}},iterator:{get:function(){return 0>=this.fa.Db?fb:new sb(this.fa)}}});
tb.prototype.toList=tb.prototype.Xv;tb.prototype.toArray=tb.prototype.ma;tb.prototype.toSet=tb.prototype.Yv;tb.prototype.first=tb.prototype.first;tb.prototype.clear=tb.prototype.clear;tb.prototype["delete"]=tb.prototype.delete;tb.prototype.remove=tb.prototype.remove;tb.prototype.has=tb.prototype.has;tb.prototype.contains=tb.prototype.contains;tb.prototype.add=tb.prototype.add;tb.prototype.thaw=tb.prototype.ea;tb.prototype.freeze=tb.prototype.freeze;tb.className="MapKeySet";
function ub(a){this.fa=a;a.Qe=null;this.ia=a.xa;this.ka=null}ub.prototype.reset=function(){var a=this.fa;a.Qe=null;this.ia=a.xa;this.ka=null};ub.prototype.next=function(){var a=this.fa;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Ad();return!1};ub.prototype.fd=function(){return this.next()};
ub.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};ub.prototype.any=function(a){var b=this.fa;this.ka=b.Qe=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.na}return!1};ub.prototype.all=function(a){var b=this.fa;this.ka=b.Qe=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.na}return!0};ub.prototype.each=function(a){var b=this.fa;this.ka=b.Qe=null;for(b=b.ba;null!==b;)a(b.value),b=b.na;return this};
ub.prototype.map=function(a){var b=this.fa;this.ka=b.Qe=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.na;return c.iterator};ub.prototype.filter=function(a){var b=this.fa;this.ka=b.Qe=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.na}return c.iterator};ub.prototype.Ad=function(){this.value=this.key=null;this.ia=-1;this.fa.Qe=this};ub.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"};
ma.Object.defineProperties(ub.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.fd;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapValueSetIterator";function pb(a,b){this.key=a;this.value=b;this.Bl=this.na=null}pb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
pb.className="KeyValuePair";function vb(a){this.fa=a;a.Ga=null;this.ia=a.xa;this.ka=null}vb.prototype.reset=function(){var a=this.fa;a.Ga=null;this.ia=a.xa;this.ka=null};vb.prototype.next=function(){var a=this.fa;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.key=b.key,this.value=b.value,!0;this.Ad();return!1};vb.prototype.fd=function(){return this.next()};
vb.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;return null!==a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};vb.prototype.any=function(a){var b=this.fa;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.na}return!1};vb.prototype.all=function(a){var b=this.fa;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.na}return!0};vb.prototype.each=function(a){var b=this.fa;this.ka=b.Ga=null;for(b=b.ba;null!==b;)a(b),b=b.na;return this};
vb.prototype.map=function(a){var b=this.fa;this.ka=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.na;return c.iterator};vb.prototype.filter=function(a){var b=this.fa;this.ka=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.na;return c.iterator};vb.prototype.Ad=function(){this.value=this.key=null;this.ia=-1;this.fa.Ga=this};vb.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"};
ma.Object.defineProperties(vb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});vb.prototype.first=vb.prototype.first;vb.prototype.hasNext=vb.prototype.fd;vb.prototype.next=vb.prototype.next;vb.prototype.reset=vb.prototype.reset;vb.className="MapIterator";
function G(a){Za(this);this.s=!1;this.Eb={};this.Db=0;this.Qe=this.Ga=null;this.xa=0;this.Re=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?xa():this.addAll(a))}t=G.prototype;t.ib=function(){var a=this.xa;a++;999999999<a&&(a=0);this.xa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"Map()#"+lb(this)};
t.add=function(a,b){this.s&&ua(this,a);var c=a;ya(a)&&(c=ob(a));var d=this.Eb[c];void 0===d?(this.Db++,a=new pb(a,b),this.Eb[c]=a,c=this.Re,null===c?this.ba=a:(a.Bl=c,c.na=a),this.Re=a,this.ib()):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(za(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 G)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};G.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b))return!0;b=b.na}return!1};G.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.na}return!0};
G.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.na;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!==c;)b.add(c.key,a(c)),c=c.na;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ba;null!==c;)a(c)&&b.add(c.key,c.value),c=c.na;return b};t=G.prototype;t.contains=function(a){var b=a;return ya(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Eb[b]};t.has=function(a){return this.contains(a)};
t.H=function(a){var b=a;if(ya(a)&&(b=lb(a),void 0===b))return null;a=this.Eb[b];return void 0===a?null:a.value};t.get=function(a){return this.H(a)};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=a;if(ya(a)&&(b=lb(a),void 0===b))return!1;a=this.Eb[b];if(void 0===a)return!1;var c=a.na,d=a.Bl;null!==c&&(c.Bl=d);null!==d&&(d.na=c);this.ba===a&&(this.ba=c);this.Re===a&&(this.Re=d);delete this.Eb[b];this.Db--;this.ib();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this.s&&ua(this);this.Eb={};this.Db=0;null!==this.Ga&&this.Ga.reset();null!==this.Qe&&this.Qe.reset();this.Re=this.ba=null;this.ib()};G.prototype.copy=function(){var a=new G,b=this.Eb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};G.prototype.ma=function(){var a=this.Eb,b=Array(this.Db),c=0,d;for(d in a){var e=a[d];b[c]=new pb(e.key,e.value);c++}return b};G.prototype.Af=function(){return new tb(this)};
ma.Object.defineProperties(G.prototype,{count:{get:function(){return this.Db}},size:{get:function(){return this.Db}},iterator:{get:function(){if(0>=this.count)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new vb(this)}},iteratorKeys:{get:function(){return 0>=this.count?fb:new sb(this)}},iteratorValues:{get:function(){if(0>=this.count)return fb;
var a=this.Qe;return null!==a?(a.reset(),a):new ub(this)}}});G.prototype.toKeySet=G.prototype.Af;G.prototype.toArray=G.prototype.ma;G.prototype.clear=G.prototype.clear;G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.get=G.prototype.get;G.prototype.getValue=G.prototype.H;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.first=G.prototype.first;G.prototype.addAll=G.prototype.addAll;G.prototype.set=G.prototype.set;
G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;G.className="Map";function H(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}H.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};H.prototype.h=function(a,b){this.x=a;this.y=b;return this};H.prototype.Cg=function(a,b){this.x=a;this.y=b;return this};
H.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};H.prototype.copy=function(){var a=new H;a.x=this.x;a.y=this.y;return a};t=H.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};
function wb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new H(c,e)}return new H}function xb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof H?this.x===a.x&&this.y===a.y:!1};t.Li=function(a,b){return this.x===a&&this.y===b};t.Ma=function(a){return I.w(this.x,a.x)&&I.w(this.y,a.y)};
t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.Xd=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};H.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=H.prototype;
t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.we=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.ed=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};t.Sa=function(a){return yb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return yb(a-this.x,b-this.y)};
function yb(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.$z=function(a,b,c,d){I.Xi(a,b,c,d,this.x,this.y,this);return this};t.aA=function(a,b){I.Xi(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.lA=function(a,b,c,d){I.aq(this.x,this.y,a,b,c,d,this);return this};t.mA=function(a,b){I.aq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};
t.Zi=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.sk=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ra(this);return this};function zb(a,b){b.Td(a);return a}function Ab(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 Bb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}
function Cb(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}t.v=function(){return isFinite(this.x)&&isFinite(this.y)};H.alloc=function(){var a=Eb.pop();return void 0===a?new H:a};H.allocAt=function(a,b){var c=Eb.pop();if(void 0===c)return new H(a,b);c.x=a;c.y=b;return c};H.free=function(a){Eb.push(a)};H.prototype.isReal=H.prototype.v;
H.prototype.setSpot=H.prototype.sk;H.prototype.setRectSpot=H.prototype.Zi;H.prototype.snapToGridPoint=H.prototype.mA;H.prototype.snapToGrid=H.prototype.lA;H.prototype.projectOntoLineSegmentPoint=H.prototype.aA;H.prototype.projectOntoLineSegment=H.prototype.$z;H.prototype.direction=H.prototype.direction;H.prototype.directionPoint=H.prototype.Sa;H.prototype.normalize=H.prototype.normalize;H.prototype.distanceSquared=H.prototype.ed;H.prototype.distanceSquaredPoint=H.prototype.we;H.prototype.scale=H.prototype.scale;
H.prototype.rotate=H.prototype.rotate;H.prototype.offset=H.prototype.offset;H.prototype.subtract=H.prototype.Xd;H.prototype.add=H.prototype.add;H.prototype.equalsApprox=H.prototype.Ma;H.prototype.equalTo=H.prototype.Li;H.prototype.equals=H.prototype.A;H.prototype.set=H.prototype.set;H.prototype.setTo=H.prototype.Cg;var Fb=null,Gb=null,Hb=null,Ib=null,Jb=null,Eb=[];H.className="Point";H.parse=wb;H.stringify=xb;H.distanceLineSegmentSquared=Ab;H.distanceSquared=Bb;H.direction=Cb;
H.Origin=Fb=(new H(0,0)).ca();H.InfiniteTopLeft=Gb=(new H(-Infinity,-Infinity)).ca();H.InfiniteBottomRight=Hb=(new H(Infinity,Infinity)).ca();H.SixPoint=Ib=(new H(6,6)).ca();H.NoPoint=Jb=(new H(NaN,NaN)).ca();H.parse=wb;H.stringify=xb;H.distanceLineSegmentSquared=Ab;H.distanceSquared=Bb;H.direction=Cb;
function Kb(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Lb,Mb,Nb,Ob,Qb,Rb,Sb;Kb.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};Kb.prototype.h=function(a,b){this.width=a;this.height=b;return this};Kb.prototype.Cg=function(a,b){this.width=a;this.height=b;return this};
Kb.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};Kb.prototype.copy=function(){var a=new Kb;a.width=this.width;a.height=this.height;return a};t=Kb.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};
function 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 Kb(c,e)}return new Kb}function Ub(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Kb?this.width===a.width&&this.height===a.height:!1};t.Li=function(a,b){return this.width===a&&this.height===b};
t.Ma=function(a){return I.w(this.width,a.width)&&I.w(this.height,a.height)};t.v=function(){return isFinite(this.width)&&isFinite(this.height)};Kb.alloc=function(){var a=Vb.pop();return void 0===a?new Kb:a};Kb.free=function(a){Vb.push(a)};Kb.prototype.isReal=Kb.prototype.v;Kb.prototype.equalsApprox=Kb.prototype.Ma;Kb.prototype.equalTo=Kb.prototype.Li;Kb.prototype.equals=Kb.prototype.A;Kb.prototype.set=Kb.prototype.set;Kb.prototype.setTo=Kb.prototype.Cg;var Vb=[];Kb.className="Size";Kb.parse=Tb;
Kb.stringify=Ub;Kb.ZeroSize=Lb=(new Kb(0,0)).ca();Kb.OneSize=Mb=(new Kb(1,1)).ca();Kb.SixSize=Nb=(new Kb(6,6)).ca();Kb.EightSize=Ob=(new Kb(8,8)).ca();Kb.TenSize=Qb=(new Kb(10,10)).ca();Kb.InfiniteSize=Rb=(new Kb(Infinity,Infinity)).ca();Kb.NoSize=Sb=(new Kb(NaN,NaN)).ca();Kb.parse=Tb;Kb.stringify=Ub;
function M(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof H?(c=a.x,a=a.y,b instanceof H?(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 Kb?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):B("Incorrect arguments supplied to Rect constructor")):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c,
this.height=d):B("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}t=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 Xb(a,b,c){a.width=b;a.height=c}t.Cg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};
t.jd=function(a){this.x=a.x;this.y=a.y;return this};t.jA=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.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};
t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function Yb(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 Zb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.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.Li=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ma=function(a){return I.w(this.x,a.x)&&I.w(this.y,a.y)&&I.w(this.width,a.width)&&I.w(this.height,a.height)};
function bc(a,b){return I.Z(a.x,b.x)&&I.Z(a.y,b.y)&&I.Z(a.width,b.width)&&I.Z(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.nf=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.reset=function(){this.height=this.width=this.y=this.x=0};t.offset=function(a,b){this.x+=a;this.y+=b;return this};t.Tc=function(a,b){return cc(this,b,a,b,a)};t.Tp=function(a){return cc(this,a.top,a.right,a.bottom,a.left)};t.Wv=function(a){return cc(this,-a.top,-a.right,-a.bottom,-a.left)};t.Dz=function(a,b,c,d){return cc(this,a,b,c,d)};function cc(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.Hz=function(a){return dc(this,a.x,a.y,a.width,a.height)};t.pv=function(a,b,c,d){return dc(this,a,b,c,d)};function dc(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.Gc=function(a){return this.qv(a.x,a.y,a.width,a.height)};
t.qv=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 ec(a,b,c){var d=a.width,e=a.x,f=b.x-c;if(e>b.width+c+c+f||f>d+e)return!1;d=a.height;a=a.y;e=b.y-c;return a>b.height+c+c+e||e>d+a?!1:!0}t.Ce=function(a){return fc(this,a.x,a.y,0,0)};t.Hc=function(a){return fc(this,a.x,a.y,a.width,a.height)};
t.cw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return fc(this,a,b,c,d)};function fc(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.sk=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 kc(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 lc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.v=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Jz=function(){return 0===this.width&&0===this.height};M.alloc=function(){var a=mc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=mc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){mc.push(a)};
ma.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 H(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new Kb(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new H(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.Jz;M.prototype.isReal=M.prototype.v;M.prototype.setSpot=M.prototype.sk;M.prototype.union=M.prototype.cw;M.prototype.unionRect=M.prototype.Hc;M.prototype.unionPoint=M.prototype.Ce;M.prototype.intersects=M.prototype.qv;M.prototype.intersectsRect=M.prototype.Gc;M.prototype.intersect=M.prototype.pv;
M.prototype.intersectRect=M.prototype.Hz;M.prototype.grow=M.prototype.Dz;M.prototype.subtractMargin=M.prototype.Wv;M.prototype.addMargin=M.prototype.Tp;M.prototype.inflate=M.prototype.Tc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains;M.prototype.containsRect=M.prototype.nf;M.prototype.containsPoint=M.prototype.$;M.prototype.equalsApprox=M.prototype.Ma;M.prototype.equalTo=M.prototype.Li;M.prototype.equals=M.prototype.A;M.prototype.setSize=M.prototype.jA;
M.prototype.setPoint=M.prototype.jd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Cg;var nc=null,oc=null,mc=[];M.className="Rect";M.parse=Yb;M.stringify=Zb;M.contains=kc;M.intersects=lc;M.ZeroRect=nc=(new M(0,0,0,0)).ca();M.NoRect=oc=(new M(NaN,NaN,NaN,NaN)).ca();M.parse=Yb;M.stringify=Zb;M.contains=kc;M.intersects=lc;
function pc(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):B("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}pc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};
pc.prototype.Cg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};pc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};pc.prototype.copy=function(){var a=new pc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=pc.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};
t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};
function qc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new pc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new pc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new pc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new pc(c,e):new pc(c,e,f,g)}return new pc}
function rc(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.A=function(a){return a instanceof pc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.Li=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};
t.Ma=function(a){return I.w(this.top,a.top)&&I.w(this.right,a.right)&&I.w(this.bottom,a.bottom)&&I.w(this.left,a.left)};t.v=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};pc.a