gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
120 lines • 921 kB
JavaScript
/*
* GoJS v2.2.22 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.22/license.html.
* DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE.
*/
(function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ca(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function da(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var ea="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},fa;
if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:{var ia={a:!0},ja={};try{ja.__proto__=ia;ha=ja.a;break a}catch(a){}ha=!1}fa=ha?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ka=fa;
function la(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(ka)ka(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.hA=b.prototype}
var ma="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},pa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function qa(a,b){if(b){var c=ma;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&&pa(c,a,{writable:!0,value:b})}}qa("Object.assign",function(a){return a||oa});qa("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 ra(){}function sa(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=ta(function(){c=-1;a.apply(d,e)},b)}}function ta(a,b){return x.setTimeout(a,b)}
function ua(a){return x.document.createElement(a)}function C(a){throw Error(a);}function va(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);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 Ca(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 Da(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 Ea(){var a=Fa.pop();return void 0===a?[]:a}function Ga(a){a.length=0;Fa.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(za(a)&&a.constructor)return Ha(a.constructor);return typeof a}
function Ia(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 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.Uz;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
function Ka(a,b,c){Object.defineProperty(La.prototype,a,{get:b,set:c})}
function Ma(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 Na=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Pa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Qa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i),Fa=[];Object.freeze([]);ra.className="Util";ra.Dx="32ab5ff3b26f42dc0ed90f21462913b5";ra.adym="gojs.net";ra.vfo="28e644fdb164";ra.className="Util";function D(a,b,c){Ra(this);this.j=a;this.va=b;this.m=c}
D.prototype.toString=function(){return"EnumValue."+this.va};function Sa(a,b){return void 0===b||null===b||""===b?null:a[b]}ma.Object.defineProperties(D.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.va}},value:{get:function(){return this.m}}});D.className="EnumValue";function Ta(){this.zv=[]}Ta.prototype.toString=function(){return this.zv.join("")};
Ta.prototype.add=function(a){""!==a&&this.zv.push(a)};Ta.className="StringBuilder";function Wa(){}Wa.className="PropertyCollection";
var Xa={Wz:!1,aA:!1,Yz:!1,$z:!1,fA:!1,dA:!1,Hw:!1,Xz:null,trace:function(a){x.console&&x.console.log(a)},Zz: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)},Vz: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.xl=Object.getOwnPropertyNames(d.prototype);for(var e={Dj:0};e.Dj<b.xl.length;e={Dj:e.Dj},e.Dj++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.xl[e.Dj]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype,
b.xl[e.Dj],{set:function(a,b){return function(){throw Error("Property "+a.xl[b.Dj]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={xl:b.xl,x:b.x}}}};function Ya(){}Ya.prototype.reset=function(){};Ya.prototype.next=function(){return!1};Ya.prototype.rd=function(){return!1};Ya.prototype.first=function(){return null};Ya.prototype.any=function(){return!1};Ya.prototype.all=function(){return!0};Ya.prototype.each=function(){return this};Ya.prototype.map=function(){return this};Ya.prototype.filter=function(){return this};
Ya.prototype.Td=function(){};Ya.prototype.toString=function(){return"EmptyIterator"};ma.Object.defineProperties(Ya.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});Ya.prototype.first=Ya.prototype.first;Ya.prototype.hasNext=Ya.prototype.rd;Ya.prototype.next=Ya.prototype.next;Ya.prototype.reset=Ya.prototype.reset;var Za=null;Ya.className="EmptyIterator";Za=new Ya;function $a(a){this.key=-1;this.value=a}
$a.prototype.reset=function(){this.key=-1};$a.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};$a.prototype.rd=function(){return this.next()};$a.prototype.first=function(){this.key=0;return this.value};$a.prototype.any=function(a){this.key=-1;return a(this.value)};$a.prototype.all=function(a){this.key=-1;return a(this.value)};$a.prototype.each=function(a){this.key=-1;a(this.value);return this};$a.prototype.map=function(a){return new $a(a(this.value))};
$a.prototype.filter=function(a){return a(this.value)?new $a(this.value):Za};$a.prototype.Td=function(){this.value=null};$a.prototype.toString=function(){return"SingletonIterator("+this.value+")"};ma.Object.defineProperties($a.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});$a.prototype.first=$a.prototype.first;$a.prototype.hasNext=$a.prototype.rd;$a.prototype.next=$a.prototype.next;
$a.prototype.reset=$a.prototype.reset;$a.className="SingletonIterator";function ab(a){this.xb=a;this.$e=null;a.Pa=null;this.na=a.Ia;this.Xa=-1}ab.prototype.reset=function(){var a=this.xb;a.Pa=null;this.na=a.Ia;this.Xa=-1};ab.prototype.next=function(){var a=this.xb;if(a.Ia!==this.na&&0>this.key)return!1;a=a.s;var b=a.length,c=++this.Xa,d=this.$e;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Xa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Td()}return!1};
ab.prototype.rd=function(){return this.next()};ab.prototype.first=function(){var a=this.xb;this.na=a.Ia;this.Xa=0;a=a.s;var b=a.length,c=this.$e;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Xa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};ab.prototype.any=function(a){var b=this.xb;b.Pa=null;this.Xa=-1;b=b.s;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1};
ab.prototype.all=function(a){var b=this.xb;b.Pa=null;this.Xa=-1;b=b.s;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};ab.prototype.each=function(a){var b=this.xb;b.Pa=null;this.Xa=-1;b=b.s;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this};
ab.prototype.map=function(a){var b=this.xb;b.Pa=null;this.Xa=-1;var c=[];b=b.s;for(var d=b.length,e=this.$e,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.s=c;a.sb();return a.iterator};ab.prototype.filter=function(a){var b=this.xb;b.Pa=null;this.Xa=-1;var c=[];b=b.s;for(var d=b.length,e=this.$e,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&a(g)&&c.push(g)}a=new E;a.s=c;a.sb();return a.iterator};
ab.prototype.Td=function(){this.key=-1;this.value=null;this.na=-1;this.$e=null;this.xb.Pa=this};ab.prototype.toString=function(){return"ListIterator@"+this.Xa+"/"+this.xb.count};
ma.Object.defineProperties(ab.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.$e},set:function(a){this.$e=a}},count:{get:function(){var a=this.$e;if(null!==a){for(var b=0,c=this.xb.s,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.xb.s.length}}});ab.prototype.first=ab.prototype.first;ab.prototype.hasNext=ab.prototype.rd;ab.prototype.next=ab.prototype.next;
ab.prototype.reset=ab.prototype.reset;ab.className="ListIterator";function bb(a){this.xb=a;a.tg=null;this.na=a.Ia;this.Xa=a.s.length}bb.prototype.reset=function(){var a=this.xb;a.tg=null;this.na=a.Ia;this.Xa=a.s.length};bb.prototype.next=function(){var a=this.xb;if(a.Ia!==this.na&&0>this.key)return!1;var b=--this.Xa;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.Td();return!1};bb.prototype.rd=function(){return this.next()};
bb.prototype.first=function(){var a=this.xb;this.na=a.Ia;var b=a.s;this.Xa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};bb.prototype.any=function(a){var b=this.xb;b.tg=null;b=b.s;var c=b.length;this.Xa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};bb.prototype.all=function(a){var b=this.xb;b.tg=null;b=b.s;var c=b.length;this.Xa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
bb.prototype.each=function(a){var b=this.xb;b.tg=null;b=b.s;var c=b.length;this.Xa=c;for(--c;0<=c;c--)a(b[c]);return this};bb.prototype.map=function(a){var b=this.xb;b.tg=null;var c=[];b=b.s;var d=b.length;this.Xa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.s=c;a.sb();return a.iterator};bb.prototype.filter=function(a){var b=this.xb;b.tg=null;var c=[];b=b.s;var d=b.length;this.Xa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.s=c;a.sb();return a.iterator};
bb.prototype.Td=function(){this.key=-1;this.value=null;this.na=-1;this.xb.tg=this};bb.prototype.toString=function(){return"ListIteratorBackwards("+this.Xa+"/"+this.xb.count+")"};ma.Object.defineProperties(bb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.xb.s.length}}});bb.prototype.first=bb.prototype.first;bb.prototype.hasNext=bb.prototype.rd;bb.prototype.next=bb.prototype.next;bb.prototype.reset=bb.prototype.reset;
bb.className="ListIteratorBackwards";function E(a){Ra(this);this._isFrozen=!1;this.s=[];this.Ia=0;this.tg=this.Pa=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=E.prototype;t.sb=function(){var a=this.Ia;a++;999999999<a&&(a=0);this.Ia=a};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){this._isFrozen=!1;return this};t.toString=function(){return"List()#"+eb(this)};
t.add=function(a){if(null===a)return this;this._isFrozen&&va(this,a);this.s.push(a);this.sb();return this};t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this._isFrozen&&va(this);var b=this.s;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.sb();return this};t.clear=function(){this._isFrozen&&va(this);this.s.length=0;this.sb()};t.contains=function(a){return null===a?!1:-1!==this.s.indexOf(a)};t.has=function(a){return this.contains(a)};
t.indexOf=function(a){return null===a?-1:this.s.indexOf(a)};t.L=function(a){var b=this.s;(0>a||a>=b.length)&&xa(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.Tc=function(a,b){var c=this.s;(0>a||a>=c.length)&&xa(a,"0 <= i < length",E,"setElt:i");this._isFrozen&&va(this,a);c[a]=b};t.set=function(a,b){this.Tc(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]};t.ec=function(){var a=this.s,b=a.length;return 0<b?a[b-1]:null};
t.pop=function(){this._isFrozen&&va(this);var a=this.s;return 0<a.length?a.pop():null};E.prototype.any=function(a){for(var b=this.s,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.s,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.s,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.s,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.s=c;b.sb();return b};
E.prototype.filter=function(a){for(var b=new E,c=[],d=this.s,e=d.length,f=0;f<e;f++){var g=d[f];a(g)&&c.push(g)}b.s=c;b.sb();return b};t=E.prototype;t.Cb=function(a,b){0>a&&xa(a,">= 0",E,"insertAt:i");this._isFrozen&&va(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.sb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.sb();return!0};t.delete=function(a){return this.remove(a)};
t.lb=function(a){var b=this.s;(0>a||a>=b.length)&&xa(a,"0 <= i < length",E,"removeAt:i");this._isFrozen&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.sb()};t.removeRange=function(a,b){var c=this.s,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._isFrozen&&va(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.sb();return this};
E.prototype.copy=function(){var a=new E,b=this.s;0<b.length&&(a.s=Array.prototype.slice.call(b));return a};t=E.prototype;t.Da=function(){for(var a=this.s,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.cv=function(){for(var a=new G,b=this.s,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this._isFrozen&&va(this);this.s.sort(a);this.sb();return this};
t.ji=function(a,b,c){var d=this.s,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this._isFrozen&&va(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&xa(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.sb()),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.sb();return this};
t.reverse=function(){this._isFrozen&&va(this);this.s.reverse();this.sb();return this};
ma.Object.defineProperties(E.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return Za;var a=this.Pa;return null!==a?(a.reset(),a):new ab(this)}},iteratorBackwards:{
get:function(){if(0>=this.s.length)return Za;var a=this.tg;return null!==a?(a.reset(),a):new bb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.ji;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.cv;E.prototype.toArray=E.prototype.Da;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.lb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.Cb;
E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.ec;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.Tc;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.ja;
E.prototype.freeze=E.prototype.freeze;E.className="List";function hb(a){this.Tf=a;a.Pa=null;this.na=a.Ia;this.ra=null}hb.prototype.reset=function(){var a=this.Tf;a.Pa=null;this.na=a.Ia;this.ra=null};hb.prototype.next=function(){var a=this.Tf;if(a.Ia!==this.na&&null===this.key)return!1;var b=this.ra;b=null===b?a.ea:b.ta;if(null!==b)return this.ra=b,this.value=b.value,this.key=b.key,!0;this.Td();return!1};hb.prototype.rd=function(){return this.next()};
hb.prototype.first=function(){var a=this.Tf;this.na=a.Ia;a=a.ea;if(null!==a){this.ra=a;var b=a.value;this.key=a.key;return this.value=b}return null};hb.prototype.any=function(a){var b=this.Tf;this.ra=b.Pa=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.ta}return!1};hb.prototype.all=function(a){var b=this.Tf;this.ra=b.Pa=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.ta}return!0};hb.prototype.each=function(a){var b=this.Tf;this.ra=b.Pa=null;for(b=b.ea;null!==b;)a(b.value),b=b.ta;return this};
hb.prototype.map=function(a){var b=this.Tf;b.Pa=null;var c=new E;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.ta;return c.iterator};hb.prototype.filter=function(a){var b=this.Tf;b.Pa=null;var c=new E;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.ta}return c.iterator};hb.prototype.Td=function(){this.value=this.key=null;this.na=-1;this.Tf.Pa=this};hb.prototype.toString=function(){return null!==this.ra?"SetIterator@"+this.ra.value:"SetIterator"};
ma.Object.defineProperties(hb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Tf.Mb}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.rd;hb.prototype.next=hb.prototype.next;hb.prototype.reset=hb.prototype.reset;hb.className="SetIterator";
function G(a){Ra(this);this._isFrozen=!1;this.Nb={};this.Mb=0;this.Pa=null;this.Ia=0;this.Ve=this.ea=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.sb=function(){var a=this.Ia;a++;999999999<a&&(a=0);this.Ia=a};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){this._isFrozen=!1;return this};t.toString=function(){return"Set()#"+eb(this)};
t.add=function(a){if(null===a)return this;this._isFrozen&&va(this,a);var b=a;za(a)&&(b=ib(a));void 0===this.Nb[b]&&(this.Mb++,a=new jb(a,a),this.Nb[b]=a,b=this.Ve,null===b?this.ea=a:(a.Rk=b,b.ta=a),this.Ve=a,this.sb());return this};t.addAll=function(a){if(null===a)return this;this._isFrozen&&va(this);if(Aa(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this};
t.contains=function(a){if(null===a)return!1;var b=a;return za(a)&&(b=eb(a),void 0===b)?!1:void 0!==this.Nb[b]};t.has=function(a){return this.contains(a)};t.ly=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.my=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.ea;return null===a?null:a.value};
G.prototype.any=function(a){for(var b=this.ea;null!==b;){if(a(b.value))return!0;b=b.ta}return!1};G.prototype.all=function(a){for(var b=this.ea;null!==b;){if(!a(b.value))return!1;b=b.ta}return!0};G.prototype.each=function(a){for(var b=this.ea;null!==b;)a(b.value),b=b.ta;return this};G.prototype.map=function(a){for(var b=new G,c=this.ea;null!==c;)b.add(a(c.value)),c=c.ta;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ea;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.ta}return b};t=G.prototype;
t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=a;if(za(a)&&(b=eb(a),void 0===b))return!1;a=this.Nb[b];if(void 0===a)return!1;var c=a.ta,d=a.Rk;null!==c&&(c.Rk=d);null!==d&&(d.ta=c);this.ea===a&&(this.ea=c);this.Ve===a&&(this.Ve=d);delete this.Nb[b];this.Mb--;this.sb();return!0};t.delete=function(a){return this.remove(a)};
t.Bo=function(a){if(null===a)return this;this._isFrozen&&va(this);if(Aa(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};t.Hz=function(a){if(null===a||0===this.count)return this;this._isFrozen&&va(this);var b=new G;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Bo(a);return this};
t.clear=function(){this._isFrozen&&va(this);this.Nb={};this.Mb=0;null!==this.Pa&&this.Pa.reset();this.Ve=this.ea=null;this.sb()};G.prototype.copy=function(){var a=new G,b=this.Nb,c;for(c in b)a.add(b[c].value);return a};G.prototype.Da=function(){var a=Array(this.Mb),b=this.Nb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};G.prototype.bv=function(){var a=new E,b=this.Nb,c;for(c in b)a.add(b[c].value);return a};function Ra(a){a.__gohashid=kb++}
function ib(a){var b=a.__gohashid;void 0===b&&(b=kb++,a.__gohashid=b);return b}function eb(a){return a.__gohashid}ma.Object.defineProperties(G.prototype,{count:{get:function(){return this.Mb}},size:{get:function(){return this.Mb}},iterator:{get:function(){if(0>=this.Mb)return Za;var a=this.Pa;return null!==a?(a.reset(),a):new hb(this)}}});G.prototype.toList=G.prototype.bv;G.prototype.toArray=G.prototype.Da;
G.prototype.clear=G.prototype.clear;G.prototype.retainAll=G.prototype.Hz;G.prototype.removeAll=G.prototype.Bo;G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.first=G.prototype.first;G.prototype.containsAny=G.prototype.my;G.prototype.containsAll=G.prototype.ly;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.ja;G.prototype.freeze=G.prototype.freeze;
var kb=1;G.className="Set";G.uniqueHash=Ra;G.hashIdUnique=ib;G.hashId=eb;function lb(a){this.la=a;this.na=a.Ia;this.ra=null}lb.prototype.reset=function(){this.na=this.la.Ia;this.ra=null};lb.prototype.next=function(){var a=this.la;if(a.Ia!==this.na&&null===this.key)return!1;var b=this.ra;b=null===b?a.ea:b.ta;if(null!==b)return this.ra=b,this.value=this.key=a=b.key,!0;this.Td();return!1};lb.prototype.rd=function(){return this.next()};
lb.prototype.first=function(){var a=this.la;this.na=a.Ia;a=a.ea;return null!==a?(this.ra=a,this.value=this.key=a=a.key):null};lb.prototype.any=function(a){var b=this.la;this.ra=null;for(b=b.ea;null!==b;){if(a(b.key))return!0;b=b.ta}return!1};lb.prototype.all=function(a){var b=this.la;this.ra=null;for(b=b.ea;null!==b;){if(!a(b.key))return!1;b=b.ta}return!0};lb.prototype.each=function(a){var b=this.la;this.ra=null;for(b=b.ea;null!==b;)a(b.key),b=b.ta;return this};
lb.prototype.map=function(a){var b=this.la;this.ra=null;var c=new E;for(b=b.ea;null!==b;)c.add(a(b.key)),b=b.ta;return c.iterator};lb.prototype.filter=function(a){var b=this.la;this.ra=null;var c=new E;for(b=b.ea;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.ta}return c.iterator};lb.prototype.Td=function(){this.value=this.key=null;this.na=-1};lb.prototype.toString=function(){return null!==this.ra?"MapKeySetIterator@"+this.ra.value:"MapKeySetIterator"};
ma.Object.defineProperties(lb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.la.Mb}}});lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.rd;lb.prototype.next=lb.prototype.next;lb.prototype.reset=lb.prototype.reset;lb.className="MapKeySetIterator";function mb(a){G.call(this);Ra(this);this._isFrozen=!0;this.la=a}la(mb,G);t=mb.prototype;t.freeze=function(){return this};t.ja=function(){return this};
t.toString=function(){return"MapKeySet("+this.la.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.la.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.la.ea;return null!==a?a.key:null};
mb.prototype.any=function(a){for(var b=this.la.ea;null!==b;){if(a(b.key))return!0;b=b.ta}return!1};mb.prototype.all=function(a){for(var b=this.la.ea;null!==b;){if(!a(b.key))return!1;b=b.ta}return!0};mb.prototype.each=function(a){for(var b=this.la.ea;null!==b;)a(b.key),b=b.ta;return this};mb.prototype.map=function(a){for(var b=new G,c=this.la.ea;null!==c;)b.add(a(c.key)),c=c.ta;return b};mb.prototype.filter=function(a){for(var b=new G,c=this.la.ea;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.ta}return b};
mb.prototype.copy=function(){return new mb(this.la)};mb.prototype.cv=function(){var a=new G,b=this.la.Nb,c;for(c in b)a.add(b[c].key);return a};mb.prototype.Da=function(){var a=this.la.Nb,b=Array(this.la.Mb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};mb.prototype.bv=function(){var a=new E,b=this.la.Nb,c;for(c in b)a.add(b[c].key);return a};
ma.Object.defineProperties(mb.prototype,{count:{get:function(){return this.la.Mb}},size:{get:function(){return this.la.Mb}},iterator:{get:function(){return 0>=this.la.Mb?Za:new lb(this.la)}}});mb.prototype.toList=mb.prototype.bv;mb.prototype.toArray=mb.prototype.Da;mb.prototype.toSet=mb.prototype.cv;mb.prototype.first=mb.prototype.first;mb.prototype.clear=mb.prototype.clear;mb.prototype["delete"]=mb.prototype.delete;
mb.prototype.remove=mb.prototype.remove;mb.prototype.has=mb.prototype.has;mb.prototype.contains=mb.prototype.contains;mb.prototype.add=mb.prototype.add;mb.prototype.thaw=mb.prototype.ja;mb.prototype.freeze=mb.prototype.freeze;mb.className="MapKeySet";function nb(a){this.la=a;a.Ue=null;this.na=a.Ia;this.ra=null}nb.prototype.reset=function(){var a=this.la;a.Ue=null;this.na=a.Ia;this.ra=null};
nb.prototype.next=function(){var a=this.la;if(a.Ia!==this.na&&null===this.key)return!1;var b=this.ra;b=null===b?a.ea:b.ta;if(null!==b)return this.ra=b,this.value=b.value,this.key=b.key,!0;this.Td();return!1};nb.prototype.rd=function(){return this.next()};nb.prototype.first=function(){var a=this.la;this.na=a.Ia;a=a.ea;if(null!==a){this.ra=a;var b=a.value;this.key=a.key;return this.value=b}return null};
nb.prototype.any=function(a){var b=this.la;this.ra=b.Ue=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.ta}return!1};nb.prototype.all=function(a){var b=this.la;this.ra=b.Ue=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.ta}return!0};nb.prototype.each=function(a){var b=this.la;this.ra=b.Ue=null;for(b=b.ea;null!==b;)a(b.value),b=b.ta;return this};nb.prototype.map=function(a){var b=this.la;this.ra=b.Ue=null;var c=new E;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.ta;return c.iterator};
nb.prototype.filter=function(a){var b=this.la;this.ra=b.Ue=null;var c=new E;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.ta}return c.iterator};nb.prototype.Td=function(){this.value=this.key=null;this.na=-1;this.la.Ue=this};nb.prototype.toString=function(){return null!==this.ra?"MapValueSetIterator@"+this.ra.value:"MapValueSetIterator"};ma.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.la.Mb}}});
nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.rd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="MapValueSetIterator";function jb(a,b){this.key=a;this.value=b;this.Rk=this.ta=null}jb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};jb.className="KeyValuePair";function ob(a){this.la=a;a.Pa=null;this.na=a.Ia;this.ra=null}ob.prototype.reset=function(){var a=this.la;a.Pa=null;this.na=a.Ia;this.ra=null};
ob.prototype.next=function(){var a=this.la;if(a.Ia!==this.na&&null===this.key)return!1;var b=this.ra;b=null===b?a.ea:b.ta;if(null!==b)return this.ra=b,this.key=b.key,this.value=b.value,!0;this.Td();return!1};ob.prototype.rd=function(){return this.next()};ob.prototype.first=function(){var a=this.la;this.na=a.Ia;a=a.ea;return null!==a?(this.ra=a,this.key=a.key,this.value=a.value,a):null};ob.prototype.any=function(a){var b=this.la;this.ra=b.Pa=null;for(b=b.ea;null!==b;){if(a(b))return!0;b=b.ta}return!1};
ob.prototype.all=function(a){var b=this.la;this.ra=b.Pa=null;for(b=b.ea;null!==b;){if(!a(b))return!1;b=b.ta}return!0};ob.prototype.each=function(a){var b=this.la;this.ra=b.Pa=null;for(b=b.ea;null!==b;)a(b),b=b.ta;return this};ob.prototype.map=function(a){var b=this.la;this.ra=b.Pa=null;var c=new E;for(b=b.ea;null!==b;)c.add(a(b)),b=b.ta;return c.iterator};ob.prototype.filter=function(a){var b=this.la;this.ra=b.Pa=null;var c=new E;for(b=b.ea;null!==b;)a(b)&&c.add(b),b=b.ta;return c.iterator};
ob.prototype.Td=function(){this.value=this.key=null;this.na=-1;this.la.Pa=this};ob.prototype.toString=function(){return null!==this.ra?"MapIterator@"+this.ra:"MapIterator"};ma.Object.defineProperties(ob.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.la.Mb}}});ob.prototype.first=ob.prototype.first;ob.prototype.hasNext=ob.prototype.rd;ob.prototype.next=ob.prototype.next;ob.prototype.reset=ob.prototype.reset;
ob.className="MapIterator";function pb(a){Ra(this);this._isFrozen=!1;this.Nb={};this.Mb=0;this.Ue=this.Pa=null;this.Ia=0;this.Ve=this.ea=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=pb.prototype;t.sb=function(){var a=this.Ia;a++;999999999<a&&(a=0);this.Ia=a};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){this._isFrozen=!1;return this};t.toString=function(){return"Map()#"+eb(this)};
t.add=function(a,b){this._isFrozen&&va(this,a);var c=a;za(a)&&(c=ib(a));var d=this.Nb[c];void 0===d?(this.Mb++,a=new jb(a,b),this.Nb[c]=a,c=this.Ve,null===c?this.ea=a:(a.Rk=c,c.ta=a),this.Ve=a,this.sb()):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 pb)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.ea};pb.prototype.any=function(a){for(var b=this.ea;null!==b;){if(a(b))return!0;b=b.ta}return!1};pb.prototype.all=function(a){for(var b=this.ea;null!==b;){if(!a(b))return!1;b=b.ta}return!0};
pb.prototype.each=function(a){for(var b=this.ea;null!==b;)a(b),b=b.ta;return this};pb.prototype.map=function(a){for(var b=new pb,c=this.ea;null!==c;)b.add(c.key,a(c)),c=c.ta;return b};pb.prototype.filter=function(a){for(var b=new pb,c=this.ea;null!==c;)a(c)&&b.add(c.key,c.value),c=c.ta;return b};t=pb.prototype;t.contains=function(a){var b=a;return za(a)&&(b=eb(a),void 0===b)?!1:void 0!==this.Nb[b]};t.has=function(a){return this.contains(a)};
t.I=function(a){var b=a;if(za(a)&&(b=eb(a),void 0===b))return null;a=this.Nb[b];return void 0===a?null:a.value};t.get=function(a){return this.I(a)};t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=a;if(za(a)&&(b=eb(a),void 0===b))return!1;a=this.Nb[b];if(void 0===a)return!1;var c=a.ta,d=a.Rk;null!==c&&(c.Rk=d);null!==d&&(d.ta=c);this.ea===a&&(this.ea=c);this.Ve===a&&(this.Ve=d);delete this.Nb[b];this.Mb--;this.sb();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this._isFrozen&&va(this);this.Nb={};this.Mb=0;null!==this.Pa&&this.Pa.reset();null!==this.Ue&&this.Ue.reset();this.Ve=this.ea=null;this.sb()};pb.prototype.copy=function(){var a=new pb,b=this.Nb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};pb.prototype.Da=function(){var a=this.Nb,b=Array(this.Mb),c=0,d;for(d in a){var e=a[d];b[c]=new jb(e.key,e.value);c++}return b};pb.prototype.yf=function(){return new mb(this)};
ma.Object.defineProperties(pb.prototype,{count:{get:function(){return this.Mb}},size:{get:function(){return this.Mb}},iterator:{get:function(){if(0>=this.count)return Za;var a=this.Pa;return null!==a?(a.reset(),a):new ob(this)}},iteratorKeys:{get:function(){return 0>=this.count?Za:new lb(this)}},iteratorValues:{get:function(){if(0>=this.count)return Za;
var a=this.Ue;return null!==a?(a.reset(),a):new nb(this)}}});pb.prototype.toKeySet=pb.prototype.yf;pb.prototype.toArray=pb.prototype.Da;pb.prototype.clear=pb.prototype.clear;pb.prototype["delete"]=pb.prototype.delete;pb.prototype.remove=pb.prototype.remove;pb.prototype.get=pb.prototype.get;pb.prototype.getValue=pb.prototype.I;pb.prototype.has=pb.prototype.has;pb.prototype.contains=pb.prototype.contains;pb.prototype.first=pb.prototype.first;pb.prototype.addAll=pb.prototype.addAll;
pb.prototype.set=pb.prototype.set;pb.prototype.add=pb.prototype.add;pb.prototype.thaw=pb.prototype.ja;pb.prototype.freeze=pb.prototype.freeze;pb.className="Map";function I(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):C("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var qb,rb,sb,tb,ub;I.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.h=function(a,b){this.x=a;this.y=b;return this};
I.prototype.eg=function(a,b){this.x=a;this.y=b;return this};I.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.copy=function(){var a=new I;a.x=this.x;a.y=this.y;return a};t=I.prototype;t.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};
t.ja=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!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 I(c,e)}return new I}function wb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.C=function(a){return a instanceof I?this.x===a.x&&this.y===a.y:!1};
t.Vh=function(a,b){return this.x===a&&this.y===b};t.$a=function(a){return J.B(this.x,a.x)&&J.B(this.y,a.y)};t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ge=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};
I.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=I.prototype;t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.mf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.qd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};
t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};t.Za=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.ky=function(a,b){return J.il(a.x,a.y,b.x,b.y,this.x,this.y)};
t.xz=function(a,b,c,d){J.$g(a,b,c,d,this.x,this.y,this);return this};t.yz=function(a,b){J.$g(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.Mz=function(a,b,c,d){J.jo(this.x,this.y,a,b,c,d,this);return this};t.Nz=function(a,b){J.jo(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.hi=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.ii=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.Ea(this);return this};function yb(a,b){b.Gd(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 Bb(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.w=function(){return isFinite(this.x)&&isFinite(this.y)};I.alloc=function(){var a=Cb.pop();return void 0===a?new I:a};I.allocAt=function(a,b){var c=Cb.pop();if(void 0===c)return new I(a,b);c.x=a;c.y=b;return c};I.free=function(a){Cb.push(a)};I.prototype.isReal=I.prototype.w;I.prototype.setSpot=I.prototype.ii;I.prototype.setRectSpot=I.prototype.hi;I.prototype.snapToGridPoint=I.prototype.Nz;I.prototype.snapToGrid=I.prototype.Mz;I.prototype.projectOntoLineSegmentPoint=I.prototype.yz;
I.prototype.projectOntoLineSegment=I.prototype.xz;I.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return J.ql(a,b,c,d,e,f,g,h)};I.prototype.compareWithLineSegmentPoint=I.prototype.ky;I.compareWithLineSegment=function(a,b,c,d,e,f){return J.il(a,b,c,d,e,f)};I.prototype.direction=I.prototype.direction;I.prototype.directionPoint=I.prototype.Za;I.prototype.normalize=I.prototype.normalize;I.prototype.distanceSquared=I.prototype.qd;I.prototype.distanceSquaredPoint=I.prototype.mf;I.prototype.scale=I.prototype.scale;
I.prototype.rotate=I.prototype.rotate;I.prototype.offset=I.prototype.offset;I.prototype.subtract=I.prototype.ge;I.prototype.add=I.prototype.add;I.prototype.equalsApprox=I.prototype.$a;I.prototype.equalTo=I.prototype.Vh;I.prototype.equals=I.prototype.C;I.prototype.set=I.prototype.set;I.prototype.setTo=I.prototype.eg;var Cb=[];I.className="Point";I.parse=vb;I.stringify=wb;I.distanceLineSegmentSquared=zb;I.distanceSquared=Ab;I.direction=Bb;I.Origin=qb=(new I(0,0)).ha();
I.InfiniteTopLeft=rb=(new I(-Infinity,-Infinity)).ha();I.InfiniteBottomRight=sb=(new I(Infinity,Infinity)).ha();I.SixPoint=tb=(new I(6,6)).ha();I.NoPoint=ub=(new I(NaN,NaN)).ha();I.parse=vb;I.stringify=wb;I.distanceLineSegmentSquared=zb;I.distanceSquared=Ab;I.direction=Bb;
function K(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._isFrozen=!1}var Gb,Hb,Ib,Jb,Kb,Lb,Mb;K.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};K.prototype.h=function(a,b){this.width=a;this.height=b;return this};K.prototype.eg=function(a,b){this.width=a;this.height=b;return this};
K.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};K.prototype.copy=function(){var a=new K;a.width=this.width;a.height=this.height;return a};t=K.prototype;t.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!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 K(c,e)}return new K}function Ob(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.C=function(a){return a instanceof K?this.width===a.width&&this.height===a.height:!1};t.Vh=function(a,b){return this.width===a&&this.height===b};
t.$a=function(a){return J.B(this.width,a.width)&&J.B(this.height,a.height)};t.vc=function(a,b){a=this.width+a;this.width=0<=a?a:0;b=this.height+b;this.height=0<=b?b:0;return this};t.w=function(){return isFinite(this.width)&&isFinite(this.height)};K.alloc=function(){var a=Pb.pop();return void 0===a?new K:a};K.free=function(a){Pb.push(a)};K.prototype.isReal=K.prototype.w;K.prototype.inflate=K.prototype.vc;K.prototype.equalsApprox=K.prototype.$a;K.prototype.equalTo=K.prototype.Vh;
K.prototype.equals=K.prototype.C;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.eg;var Pb=[];K.className="Size";K.parse=Nb;K.stringify=Ob;K.ZeroSize=Gb=(new K(0,0)).ha();K.OneSize=Hb=(new K(1,1)).ha();K.SixSize=Ib=(new K(6,6)).ha();K.EightSize=Jb=(new K(8,8)).ha();K.TenSize=Kb=(new K(10,10)).ha();K.InfiniteSize=Lb=(new K(Infinity,Infinity)).ha();K.NoSize=Mb=(new K(NaN,NaN)).ha();K.parse=Nb;K.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 I?(c=a.x,a=a.y,b instanceof I?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof K?(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._isFrozen=!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.eg=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.Uc=function(a){this.x=a.x;this.y=a.y;return this};t.Lz=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.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};
t.ja=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!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 Ub(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.C=function(a){return a instanceof M?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Vh=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.$a=function(a){return J.B(this.x,a.x)&&J.B(this.y,a.y)&&J.B(this.width,a.width)&&J.B(this.height,a.height)};
function Vb(a,b){return J.ca(a.x,b.x)&&J.ca(a.y,b.y)&&J.ca(a.width,b.width)&&J.ca(a.height,b.height)}t.ba=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Ce=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};
t.offset=function(a,b){this.x+=a;this.y+=b;return this};t.vc=function(a,b){return Wb(this,b,a,b,a)};t.Wn=function(a){return Wb(this,a.top,a.right,a.bottom,a.left)};t.av=function(a){return Wb(this,-a.top,-a.right,-a.bottom,-a.left)};t.az=function(a,b,c,d){return Wb(this,a,b,c,d)};function Wb(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.Vw=function(a){return Xb(this,a.x,a.y,a.width,a.height)};
t.uu=function(a,b,c,d){return Xb(this,a,b,c,d)};function Xb(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.Qc=function(a){return this.vu(a.x,a.y,a.width,a.height)};
t.vu=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 Yb(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.Ke=function(a){return Zb(this,a.x,a.y,0,0)};t.Vc=function(a){return Zb(this,a.x,a.y,a.width,a.height)};
t.ev=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Zb(this,a,b,c,d)};function Zb(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.ii=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 $b(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 ac(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.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.fz=function(){return 0===this.width&&0===this.height};M.alloc=function(){var a=bc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=bc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){bc.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 I(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new K(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new I(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},
set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});M.prototype.isEmpty=M.prototype.fz;M.prototype.isReal=M.prototype.w;M.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return J.Ww(a,b,c,d,e,f,g,h)};M.prototype.setSpot=M.prototype.ii;M.prototype.union=M.prototype.ev;M.prototype.unionRect=M.prototype.Vc;M.prototype.unionPoint=M.prototype.Ke;M.prototype.intersects=M.prototype.vu;
M.prototype.intersectsRect=M.prototype.Qc;M.prototype.intersect=M.prototype.uu;M.prototype.intersectRect=M.prototype.Vw;M.prototype.grow=M.prototype.az;M.prototype.subtractMargin=M.prototype.av;M.prototype.addMargin=M.prototype.Wn;M.prototype.inflate=M.prototype.vc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains;M.prototype.containsRect=M.prototype.Ce;M.prototype.containsPoint=M.prototype.ba;M.prototype.equalsApprox=M.prototype.$a;M.prototype.equalTo=M.prototype.Vh;
M.prototype.equals=M.prototype.C;M.prototype.setSize=M.prototype.Lz;M.prototype.setPoint=M.prototype.Uc;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.eg;var cc=null,hc=null,bc=[];M.className="Rect";M.parse=Rb;M.stringify=Ub;M.contains=$b;M.intersects=ac;M.ZeroRect=cc=(new M(0,0,0,0)).ha();M.NoRect=hc=(new M(NaN,NaN,NaN,NaN)).ha();M.parse=Rb;M.stringify=Ub;M.contains=$b;M.intersects=ac;
function ic(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._isFrozen=!1}ic.pr