UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

123 lines 871 kB
/* * GoJS v2.0.11 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.0.11/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},ha; if("function"==typeof Object.setPrototypeOf)ha=Object.setPrototypeOf;else{var ka;a:{var la={a:!0},ma={};try{ma.__proto__=la;ka=ma.a;break a}catch(a){}ka=!1}ha=ka?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var na=ha; function oa(a,b){a.prototype=da(b.prototype);a.prototype.constructor=a;if(na)na(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 pa="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,qa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)}; function ra(a){if(a){for(var b=pa,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&&qa(b,c,{writable:!0,value:a})}}ra(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 w="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.global===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===w.requestAnimationFrame&&(w.requestAnimationFrame=w.setImmediate);function sa(){}function ta(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&w.clearTimeout(c);c=ua(function(){c=-1;a.apply(d,e)},b)}}function ua(a,b){return w.setTimeout(a,b)}function va(a){return w.document.createElement(a)} function A(a){throw Error(a);}function wa(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);A(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);A(c+" is not in the range "+b+": "+a)}function ya(a){w.console&&w.console.log(a)} function za(){w.console&&w.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 Ca(a){return"object"===typeof a&&null!==a}function Ea(a){return Array.isArray(a)||w.NodeList&&a instanceof w.NodeList||w.HTMLCollection&&a instanceof w.HTMLCollection}function Ga(a){return Array.prototype.slice.call(a)} function Ia(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):A("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Ja(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):A("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Ka(){var a=La.pop();return void 0===a?[]:a}function Oa(a){a.length=0;La.push(a)} function Pa(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(Ca(a)&&a.constructor)return Pa(a.constructor);return typeof a} function Qa(a){var b=a;Ca(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 Sa(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.Zz;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ta(a,b,c){Object.defineProperty(Ua.prototype,a,{get:b,set:c})}function Va(){var a=Wa;if(0===a.length)for(var b=w.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.C&&a.push(e.parentElement.C)}return a} function Za(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 bb=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("MSIE 9.0"),cb=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("MSIE 10.0"),db=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("Trident/7"),gb=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("Edge/"),ib=void 0!==w.navigator&&void 0!==w.navigator.platform&&0<=w.navigator.platform.toUpperCase().indexOf("MAC"),lb=void 0!==w.navigator&&void 0!==w.navigator.platform&&null!==w.navigator.platform.match(/(iPhone|iPod|iPad)/i), La=[];Object.freeze([]);var Wa=[];sa.className="Util";sa.Dx="32ab5ff3b26f42dc0ed90f224d2913b5";sa.adym="gojs.net";sa.vfo="28e646fdb267";sa.className="Util";function D(a,b,c){mb(this);this.l=a;this.Ua=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Ua};function qb(a,b){return void 0===b||null===b||""===b?null:a[b]} pa.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.Ua}},value:{get:function(){return this.u}}});D.className="EnumValue";function sb(){this.kw=[]}sb.prototype.toString=function(){return this.kw.join("")};sb.prototype.add=function(a){""!==a&&this.kw.push(a)};sb.className="StringBuilder";function tb(){}tb.className="PropertyCollection"; function ub(){}ub.prototype.reset=function(){};ub.prototype.next=function(){return!1};ub.prototype.dd=function(){return!1};ub.prototype.first=function(){return null};ub.prototype.any=function(){return!1};ub.prototype.all=function(){return!0};ub.prototype.each=function(){return this};ub.prototype.map=function(){return this};ub.prototype.filter=function(){return this};ub.prototype.xd=function(){};ub.prototype.toString=function(){return"EmptyIterator"}; pa.Object.defineProperties(ub.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.dd;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;var xb=null;ub.className="EmptyIterator";xb=new ub;function yb(a){this.key=-1;this.value=a}yb.prototype.reset=function(){this.key=-1}; yb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};yb.prototype.dd=function(){return this.next()};yb.prototype.first=function(){this.key=0;return this.value};yb.prototype.any=function(a){this.key=-1;return a(this.value)};yb.prototype.all=function(a){this.key=-1;return a(this.value)};yb.prototype.each=function(a){this.key=-1;a(this.value);return this};yb.prototype.map=function(a){return new yb(a(this.value))}; yb.prototype.filter=function(a){return a(this.value)?new yb(this.value):xb};yb.prototype.xd=function(){this.value=null};yb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};pa.Object.defineProperties(yb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});yb.prototype.first=yb.prototype.first;yb.prototype.hasNext=yb.prototype.dd;yb.prototype.next=yb.prototype.next; yb.prototype.reset=yb.prototype.reset;yb.className="SingletonIterator";function zb(a){this.pb=a;this.Xe=null;a.Ja=null;this.la=a.Ba;this.Sa=-1}zb.prototype.reset=function(){var a=this.pb;a.Ja=null;this.la=a.Ba;this.Sa=-1};zb.prototype.next=function(){var a=this.pb;if(a.Ba!==this.la&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Sa,d=this.Xe;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Sa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.xd()}return!1}; zb.prototype.dd=function(){return this.next()};zb.prototype.first=function(){var a=this.pb;this.la=a.Ba;this.Sa=0;a=a.j;var b=a.length,c=this.Xe;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Sa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};zb.prototype.any=function(a){var b=this.pb;b.Ja=null;this.Sa=-1;b=b.j;for(var c=b.length,d=this.Xe,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1}; zb.prototype.all=function(a){var b=this.pb;b.Ja=null;this.Sa=-1;b=b.j;for(var c=b.length,d=this.Xe,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};zb.prototype.each=function(a){var b=this.pb;b.Ja=null;this.Sa=-1;b=b.j;for(var c=b.length,d=this.Xe,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this}; zb.prototype.map=function(a){var b=this.pb;b.Ja=null;this.Sa=-1;var c=[];b=b.j;for(var d=b.length,e=this.Xe,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.kb();return a.iterator};zb.prototype.filter=function(a){var b=this.pb;b.Ja=null;this.Sa=-1;var c=[];b=b.j;for(var d=b.length,e=this.Xe,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.kb();return a.iterator}; zb.prototype.xd=function(){this.key=-1;this.value=null;this.la=-1;this.Xe=null;this.pb.Ja=this};zb.prototype.toString=function(){return"ListIterator@"+this.Sa+"/"+this.pb.count}; pa.Object.defineProperties(zb.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.Xe},set:function(a){this.Xe=a}},count:{get:function(){var a=this.Xe;if(null!==a){for(var b=0,c=this.pb.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.pb.j.length}}});zb.prototype.first=zb.prototype.first;zb.prototype.hasNext=zb.prototype.dd;zb.prototype.next=zb.prototype.next; zb.prototype.reset=zb.prototype.reset;zb.className="ListIterator";function Ab(a){this.pb=a;a.Rg=null;this.la=a.Ba;this.Sa=a.j.length}Ab.prototype.reset=function(){var a=this.pb;a.Rg=null;this.la=a.Ba;this.Sa=a.j.length};Ab.prototype.next=function(){var a=this.pb;if(a.Ba!==this.la&&0>this.key)return!1;var b=--this.Sa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.xd();return!1};Ab.prototype.dd=function(){return this.next()}; Ab.prototype.first=function(){var a=this.pb;this.la=a.Ba;var b=a.j;this.Sa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Ab.prototype.any=function(a){var b=this.pb;b.Rg=null;b=b.j;var c=b.length;this.Sa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};Ab.prototype.all=function(a){var b=this.pb;b.Rg=null;b=b.j;var c=b.length;this.Sa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; Ab.prototype.each=function(a){var b=this.pb;b.Rg=null;b=b.j;var c=b.length;this.Sa=c;for(--c;0<=c;c--)a(b[c]);return this};Ab.prototype.map=function(a){var b=this.pb;b.Rg=null;var c=[];b=b.j;var d=b.length;this.Sa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.kb();return a.iterator};Ab.prototype.filter=function(a){var b=this.pb;b.Rg=null;var c=[];b=b.j;var d=b.length;this.Sa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.kb();return a.iterator}; Ab.prototype.xd=function(){this.key=-1;this.value=null;this.la=-1;this.pb.Rg=this};Ab.prototype.toString=function(){return"ListIteratorBackwards("+this.Sa+"/"+this.pb.count+")"};pa.Object.defineProperties(Ab.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.pb.j.length}}});Ab.prototype.first=Ab.prototype.first;Ab.prototype.hasNext=Ab.prototype.dd;Ab.prototype.next=Ab.prototype.next;Ab.prototype.reset=Ab.prototype.reset; Ab.className="ListIteratorBackwards";function E(a){mb(this);this.v=!1;this.j=[];this.Ba=0;this.Rg=this.Ja=null;void 0!==a&&("function"===typeof a||"string"===typeof a?za():this.addAll(a))}t=E.prototype;t.kb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ha=function(){this.v=!1;return this};t.toString=function(){return"List()#"+Bb(this)};t.add=function(a){if(null===a)return this;this.v&&wa(this,a);this.j.push(a);this.kb();return this}; t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.v&&wa(this);var b=this.j;if(Ea(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.kb();return this};t.clear=function(){this.v&&wa(this);this.j.length=0;this.kb()};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.N=function(a){var b=this.j;(0>a||a>=b.length)&&xa(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.N(a)};t.gd=function(a,b){var c=this.j;(0>a||a>=c.length)&&xa(a,"0 <= i < length",E,"setElt:i");this.v&&wa(this,a);c[a]=b};t.set=function(a,b){this.gd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Sb=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this.v&&wa(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.kb();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.kb();return b};t=E.prototype;t.Ib=function(a,b){0>a&&xa(a,">= 0",E,"insertAt:i");this.v&&wa(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.kb()};t.remove=function(a){if(null===a)return!1;this.v&&wa(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.kb();return!0};t.delete=function(a){return this.remove(a)}; t.mb=function(a){var b=this.j;(0>a||a>=b.length)&&xa(a,"0 <= i < length",E,"removeAt:i");this.v&&wa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.kb()};t.removeRange=function(a,b){var c=this.j,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.v&&wa(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.kb();return this};E.prototype.copy=function(){var a=new E,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a}; t=E.prototype;t.Na=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Qv=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.v&&wa(this);this.j.sort(a);this.kb();return this}; t.Wi=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.v&&wa(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&xa(b,"0 <= from < length",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.kb()),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.kb();return this}; t.reverse=function(){this.v&&wa(this);this.j.reverse();this.kb();return this}; pa.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 xb;var a=this.Ja;return null!==a?(a.reset(),a):new zb(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return xb;var a=this.Rg;return null!==a?(a.reset(),a):new Ab(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.Wi;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Qv;E.prototype.toArray=E.prototype.Na;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.mb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.Ib; E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Sb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.gd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.N;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.ha; E.prototype.freeze=E.prototype.freeze;E.className="List";function Cb(a){this.fg=a;a.Ja=null;this.la=a.Ba;this.na=null}Cb.prototype.reset=function(){var a=this.fg;a.Ja=null;this.la=a.Ba;this.na=null};Cb.prototype.next=function(){var a=this.fg;if(a.Ba!==this.la&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.value=b.value,this.key=b.key,!0;this.xd();return!1};Cb.prototype.dd=function(){return this.next()}; Cb.prototype.first=function(){var a=this.fg;this.la=a.Ba;a=a.fa;if(null!==a){this.na=a;var b=a.value;this.key=a.key;return this.value=b}return null};Cb.prototype.any=function(a){var b=this.fg;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};Cb.prototype.all=function(a){var b=this.fg;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};Cb.prototype.each=function(a){var b=this.fg;this.na=b.Ja=null;for(b=b.fa;null!==b;)a(b.value),b=b.oa;return this}; Cb.prototype.map=function(a){var b=this.fg;b.Ja=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};Cb.prototype.filter=function(a){var b=this.fg;b.Ja=null;var c=new E;for(b=b.fa;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};Cb.prototype.xd=function(){this.value=this.key=null;this.la=-1;this.fg.Ja=this};Cb.prototype.toString=function(){return null!==this.na?"SetIterator@"+this.na.value:"SetIterator"}; pa.Object.defineProperties(Cb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fg.Cb}}});Cb.prototype.first=Cb.prototype.first;Cb.prototype.hasNext=Cb.prototype.dd;Cb.prototype.next=Cb.prototype.next;Cb.prototype.reset=Cb.prototype.reset;Cb.className="SetIterator"; function F(a){mb(this);this.v=!1;this.Db={};this.Cb=0;this.Ja=null;this.Ba=0;this.Te=this.fa=null;void 0!==a&&("function"===typeof a||"string"===typeof a?za():this.addAll(a))}t=F.prototype;t.kb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ha=function(){this.v=!1;return this};t.toString=function(){return"Set()#"+Bb(this)}; t.add=function(a){if(null===a)return this;this.v&&wa(this,a);var b=a;Ca(a)&&(b=Db(a));void 0===this.Db[b]&&(this.Cb++,a=new Fb(a,a),this.Db[b]=a,b=this.Te,null===b?this.fa=a:(a.vl=b,b.oa=a),this.Te=a,this.kb());return this};t.addAll=function(a){if(null===a)return this;this.v&&wa(this);if(Ea(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 Ca(a)&&(b=Bb(a),void 0===b)?!1:void 0!==this.Db[b]};t.has=function(a){return this.contains(a)};t.qy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.sy=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.fa;return null===a?null:a.value}; F.prototype.any=function(a){for(var b=this.fa;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};F.prototype.all=function(a){for(var b=this.fa;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};F.prototype.each=function(a){for(var b=this.fa;null!==b;)a(b.value),b=b.oa;return this};F.prototype.map=function(a){for(var b=new F,c=this.fa;null!==c;)b.add(a(c.value)),c=c.oa;return b};F.prototype.filter=function(a){for(var b=new F,c=this.fa;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.oa}return b};t=F.prototype; t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=a;if(Ca(a)&&(b=Bb(a),void 0===b))return!1;a=this.Db[b];if(void 0===a)return!1;var c=a.oa,d=a.vl;null!==c&&(c.vl=d);null!==d&&(d.oa=c);this.fa===a&&(this.fa=c);this.Te===a&&(this.Te=d);delete this.Db[b];this.Cb--;this.kb();return!0};t.delete=function(a){return this.remove(a)}; t.oq=function(a){if(null===a)return this;this.v&&wa(this);if(Ea(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.Mz=function(a){if(null===a||0===this.count)return this;this.v&&wa(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.oq(a);return this};t.clear=function(){this.v&&wa(this);this.Db={};this.Cb=0;null!==this.Ja&&this.Ja.reset();this.Te=this.fa=null;this.kb()}; F.prototype.copy=function(){var a=new F,b=this.Db,c;for(c in b)a.add(b[c].value);return a};F.prototype.Na=function(){var a=Array(this.Cb),b=this.Db,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.Pv=function(){var a=new E,b=this.Db,c;for(c in b)a.add(b[c].value);return a};function mb(a){a.__gohashid=Gb++}function Db(a){var b=a.__gohashid;void 0===b&&(b=Gb++,a.__gohashid=b);return b}function Bb(a){return a.__gohashid} pa.Object.defineProperties(F.prototype,{count:{get:function(){return this.Cb}},size:{get:function(){return this.Cb}},iterator:{get:function(){if(0>=this.Cb)return xb;var a=this.Ja;return null!==a?(a.reset(),a):new Cb(this)}}});F.prototype.toList=F.prototype.Pv;F.prototype.toArray=F.prototype.Na;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.Mz;F.prototype.removeAll=F.prototype.oq; F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.sy;F.prototype.containsAll=F.prototype.qy;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.ha;F.prototype.freeze=F.prototype.freeze;var Gb=1;F.className="Set";F.uniqueHash=mb;F.hashIdUnique=Db;F.hashId=Bb; function Hb(a){this.ja=a;this.la=a.Ba;this.na=null}Hb.prototype.reset=function(){this.la=this.ja.Ba;this.na=null};Hb.prototype.next=function(){var a=this.ja;if(a.Ba!==this.la&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.value=this.key=a=b.key,!0;this.xd();return!1};Hb.prototype.dd=function(){return this.next()};Hb.prototype.first=function(){var a=this.ja;this.la=a.Ba;a=a.fa;return null!==a?(this.na=a,this.value=this.key=a=a.key):null}; Hb.prototype.any=function(a){var b=this.ja;this.na=null;for(b=b.fa;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};Hb.prototype.all=function(a){var b=this.ja;this.na=null;for(b=b.fa;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};Hb.prototype.each=function(a){var b=this.ja;this.na=null;for(b=b.fa;null!==b;)a(b.key),b=b.oa;return this};Hb.prototype.map=function(a){var b=this.ja;this.na=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator}; Hb.prototype.filter=function(a){var b=this.ja;this.na=null;var c=new E;for(b=b.fa;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};Hb.prototype.xd=function(){this.value=this.key=null;this.la=-1};Hb.prototype.toString=function(){return null!==this.na?"MapKeySetIterator@"+this.na.value:"MapKeySetIterator"};pa.Object.defineProperties(Hb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ja.Cb}}}); Hb.prototype.first=Hb.prototype.first;Hb.prototype.hasNext=Hb.prototype.dd;Hb.prototype.next=Hb.prototype.next;Hb.prototype.reset=Hb.prototype.reset;Hb.className="MapKeySetIterator";function Ib(a){F.call(this);mb(this);this.v=!0;this.ja=a}oa(Ib,F);t=Ib.prototype;t.freeze=function(){return this};t.ha=function(){return this};t.toString=function(){return"MapKeySet("+this.ja.toString()+")"};t.add=function(){A("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.ja.contains(a)}; t.has=function(a){return this.contains(a)};t.remove=function(){A("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){A("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ja.fa;return null!==a?a.key:null};Ib.prototype.any=function(a){for(var b=this.ja.fa;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};Ib.prototype.all=function(a){for(var b=this.ja.fa;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0}; Ib.prototype.each=function(a){for(var b=this.ja.fa;null!==b;)a(b.key),b=b.oa;return this};Ib.prototype.map=function(a){for(var b=new F,c=this.ja.fa;null!==c;)b.add(a(c.key)),c=c.oa;return b};Ib.prototype.filter=function(a){for(var b=new F,c=this.ja.fa;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};Ib.prototype.copy=function(){return new Ib(this.ja)};Ib.prototype.Qv=function(){var a=new F,b=this.ja.Db,c;for(c in b)a.add(b[c].key);return a}; Ib.prototype.Na=function(){var a=this.ja.Db,b=Array(this.ja.Cb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Ib.prototype.Pv=function(){var a=new E,b=this.ja.Db,c;for(c in b)a.add(b[c].key);return a};pa.Object.defineProperties(Ib.prototype,{count:{get:function(){return this.ja.Cb}},size:{get:function(){return this.ja.Cb}},iterator:{get:function(){return 0>=this.ja.Cb?xb:new Hb(this.ja)}}}); Ib.prototype.toList=Ib.prototype.Pv;Ib.prototype.toArray=Ib.prototype.Na;Ib.prototype.toSet=Ib.prototype.Qv;Ib.prototype.first=Ib.prototype.first;Ib.prototype.clear=Ib.prototype.clear;Ib.prototype["delete"]=Ib.prototype.delete;Ib.prototype.remove=Ib.prototype.remove;Ib.prototype.has=Ib.prototype.has;Ib.prototype.contains=Ib.prototype.contains;Ib.prototype.add=Ib.prototype.add;Ib.prototype.thaw=Ib.prototype.ha;Ib.prototype.freeze=Ib.prototype.freeze;Ib.className="MapKeySet"; function Jb(a){this.ja=a;a.Se=null;this.la=a.Ba;this.na=null}Jb.prototype.reset=function(){var a=this.ja;a.Se=null;this.la=a.Ba;this.na=null};Jb.prototype.next=function(){var a=this.ja;if(a.Ba!==this.la&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.value=b.value,this.key=b.key,!0;this.xd();return!1};Jb.prototype.dd=function(){return this.next()}; Jb.prototype.first=function(){var a=this.ja;this.la=a.Ba;a=a.fa;if(null!==a){this.na=a;var b=a.value;this.key=a.key;return this.value=b}return null};Jb.prototype.any=function(a){var b=this.ja;this.na=b.Se=null;for(b=b.fa;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};Jb.prototype.all=function(a){var b=this.ja;this.na=b.Se=null;for(b=b.fa;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};Jb.prototype.each=function(a){var b=this.ja;this.na=b.Se=null;for(b=b.fa;null!==b;)a(b.value),b=b.oa;return this}; Jb.prototype.map=function(a){var b=this.ja;this.na=b.Se=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};Jb.prototype.filter=function(a){var b=this.ja;this.na=b.Se=null;var c=new E;for(b=b.fa;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};Jb.prototype.xd=function(){this.value=this.key=null;this.la=-1;this.ja.Se=this};Jb.prototype.toString=function(){return null!==this.na?"MapValueSetIterator@"+this.na.value:"MapValueSetIterator"}; pa.Object.defineProperties(Jb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ja.Cb}}});Jb.prototype.first=Jb.prototype.first;Jb.prototype.hasNext=Jb.prototype.dd;Jb.prototype.next=Jb.prototype.next;Jb.prototype.reset=Jb.prototype.reset;Jb.className="MapValueSetIterator";function Fb(a,b){this.key=a;this.value=b;this.vl=this.oa=null}Fb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; Fb.className="KeyValuePair";function Kb(a){this.ja=a;a.Ja=null;this.la=a.Ba;this.na=null}Kb.prototype.reset=function(){var a=this.ja;a.Ja=null;this.la=a.Ba;this.na=null};Kb.prototype.next=function(){var a=this.ja;if(a.Ba!==this.la&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.key=b.key,this.value=b.value,!0;this.xd();return!1};Kb.prototype.dd=function(){return this.next()}; Kb.prototype.first=function(){var a=this.ja;this.la=a.Ba;a=a.fa;return null!==a?(this.na=a,this.key=a.key,this.value=a.value,a):null};Kb.prototype.any=function(a){var b=this.ja;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(a(b))return!0;b=b.oa}return!1};Kb.prototype.all=function(a){var b=this.ja;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(!a(b))return!1;b=b.oa}return!0};Kb.prototype.each=function(a){var b=this.ja;this.na=b.Ja=null;for(b=b.fa;null!==b;)a(b),b=b.oa;return this}; Kb.prototype.map=function(a){var b=this.ja;this.na=b.Ja=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};Kb.prototype.filter=function(a){var b=this.ja;this.na=b.Ja=null;var c=new E;for(b=b.fa;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};Kb.prototype.xd=function(){this.value=this.key=null;this.la=-1;this.ja.Ja=this};Kb.prototype.toString=function(){return null!==this.na?"MapIterator@"+this.na:"MapIterator"}; pa.Object.defineProperties(Kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ja.Cb}}});Kb.prototype.first=Kb.prototype.first;Kb.prototype.hasNext=Kb.prototype.dd;Kb.prototype.next=Kb.prototype.next;Kb.prototype.reset=Kb.prototype.reset;Kb.className="MapIterator"; function Lb(a){mb(this);this.v=!1;this.Db={};this.Cb=0;this.Se=this.Ja=null;this.Ba=0;this.Te=this.fa=null;void 0!==a&&("function"===typeof a||"string"===typeof a?za():this.addAll(a))}t=Lb.prototype;t.kb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ha=function(){this.v=!1;return this};t.toString=function(){return"Map()#"+Bb(this)}; t.add=function(a,b){this.v&&wa(this,a);var c=a;Ca(a)&&(c=Db(a));var d=this.Db[c];void 0===d?(this.Cb++,a=new Fb(a,b),this.Db[c]=a,c=this.Te,null===c?this.fa=a:(a.vl=c,c.oa=a),this.Te=a,this.kb()):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(Ea(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function(){return this.fa}; Lb.prototype.any=function(a){for(var b=this.fa;null!==b;){if(a(b))return!0;b=b.oa}return!1};Lb.prototype.all=function(a){for(var b=this.fa;null!==b;){if(!a(b))return!1;b=b.oa}return!0};Lb.prototype.each=function(a){for(var b=this.fa;null!==b;)a(b),b=b.oa;return this};Lb.prototype.map=function(a){for(var b=new Lb,c=this.fa;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};Lb.prototype.filter=function(a){for(var b=new Lb,c=this.fa;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=Lb.prototype; t.contains=function(a){var b=a;return Ca(a)&&(b=Bb(a),void 0===b)?!1:void 0!==this.Db[b]};t.has=function(a){return this.contains(a)};t.J=function(a){var b=a;if(Ca(a)&&(b=Bb(a),void 0===b))return null;a=this.Db[b];return void 0===a?null:a.value};t.get=function(a){return this.J(a)}; t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=a;if(Ca(a)&&(b=Bb(a),void 0===b))return!1;a=this.Db[b];if(void 0===a)return!1;var c=a.oa,d=a.vl;null!==c&&(c.vl=d);null!==d&&(d.oa=c);this.fa===a&&(this.fa=c);this.Te===a&&(this.Te=d);delete this.Db[b];this.Cb--;this.kb();return!0};t.delete=function(a){return this.remove(a)};t.clear=function(){this.v&&wa(this);this.Db={};this.Cb=0;null!==this.Ja&&this.Ja.reset();null!==this.Se&&this.Se.reset();this.Te=this.fa=null;this.kb()}; Lb.prototype.copy=function(){var a=new Lb,b=this.Db,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};Lb.prototype.Na=function(){var a=this.Db,b=Array(this.Cb),c=0,d;for(d in a){var e=a[d];b[c]=new Fb(e.key,e.value);c++}return b};Lb.prototype.Yd=function(){return new Ib(this)}; pa.Object.defineProperties(Lb.prototype,{count:{get:function(){return this.Cb}},size:{get:function(){return this.Cb}},iterator:{get:function(){if(0>=this.count)return xb;var a=this.Ja;return null!==a?(a.reset(),a):new Kb(this)}},iteratorKeys:{get:function(){return 0>=this.count?xb:new Hb(this)}},iteratorValues:{get:function(){if(0>=this.count)return xb; var a=this.Se;return null!==a?(a.reset(),a):new Jb(this)}}});Lb.prototype.toKeySet=Lb.prototype.Yd;Lb.prototype.toArray=Lb.prototype.Na;Lb.prototype.clear=Lb.prototype.clear;Lb.prototype["delete"]=Lb.prototype.delete;Lb.prototype.remove=Lb.prototype.remove;Lb.prototype.get=Lb.prototype.get;Lb.prototype.getValue=Lb.prototype.J;Lb.prototype.has=Lb.prototype.has;Lb.prototype.contains=Lb.prototype.contains;Lb.prototype.first=Lb.prototype.first;Lb.prototype.addAll=Lb.prototype.addAll; Lb.prototype.set=Lb.prototype.set;Lb.prototype.add=Lb.prototype.add;Lb.prototype.thaw=Lb.prototype.ha;Lb.prototype.freeze=Lb.prototype.freeze;Lb.className="Map";function G(a,b){void 0===a?this.G=this.F=0:"number"===typeof a&&"number"===typeof b?(this.F=a,this.G=b):A("Invalid arguments to Point constructor: "+a+", "+b);this.v=!1}G.prototype.assign=function(a){this.F=a.F;this.G=a.G;return this};G.prototype.h=function(a,b){this.F=a;this.G=b;return this}; G.prototype.ug=function(a,b){this.F=a;this.G=b;return this};G.prototype.set=function(a){this.F=a.F;this.G=a.G;return this};G.prototype.copy=function(){var a=new G;a.F=this.F;a.G=this.G;return a};t=G.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function Nb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new G(c,e)}return new G}function Ob(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof G?this.F===a.x&&this.G===a.y:!1};t.Ei=function(a,b){return this.F===a&&this.G===b};t.Qa=function(a){return H.w(this.F,a.x)&&H.w(this.G,a.y)}; t.add=function(a){this.F+=a.x;this.G+=a.y;return this};t.Xd=function(a){this.F-=a.x;this.G-=a.y;return this};t.offset=function(a,b){this.F+=a;this.G+=b;return this};G.prototype.rotate=function(a){if(0===a)return this;var b=this.F,c=this.G;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.F=a*b-d*c;this.G=d*b+a*c;return this};t=G.prototype; t.scale=function(a,b){this.F*=a;this.G*=b;return this};t.Be=function(a){var b=a.x-this.F;a=a.y-this.G;return b*b+a*a};t.cd=function(a,b){a-=this.F;b-=this.G;return a*a+b*b};t.normalize=function(){var a=this.F,b=this.G,c=Math.sqrt(a*a+b*b);0<c&&(this.F=a/c,this.G=b/c);return this};t.Wa=function(a){return Pb(a.x-this.F,a.y-this.G)};t.direction=function(a,b){return Pb(a-this.F,b-this.G)}; function Pb(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.Fz=function(a,b,c,d){H.Ri(a,b,c,d,this.F,this.G,this);return this};t.Gz=function(a,b){H.Ri(a.x,a.y,b.x,b.y,this.F,this.G,this);return this};t.Rz=function(a,b,c,d){H.Wp(this.F,this.G,a,b,c,d,this);return this};t.Sz=function(a,b){H.Wp(this.F,this.G,a.x,a.y,b.width,b.height,this);return this}; t.Ui=function(a,b){this.F=a.x+b.x*a.width+b.offsetX;this.G=a.y+b.y*a.height+b.offsetY;return this};t.rk=function(a,b,c,d,e){this.F=a+e.x*c+e.offsetX;this.G=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ta(this);return this};function Qb(a,b){b.Ud(a);return a}function Rb(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 Sb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b} function Tb(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}t.o=function(){return isFinite(this.x)&&isFinite(this.y)};G.alloc=function(){var a=$b.pop();return void 0===a?new G:a};G.allocAt=function(a,b){var c=$b.pop();if(void 0===c)return new G(a,b);c.x=a;c.y=b;return c};G.free=function(a){$b.push(a)}; pa.Object.defineProperties(G.prototype,{x:{get:function(){return this.F},set:function(a){this.F=a}},y:{get:function(){return this.G},set:function(a){this.G=a}}});G.prototype.isReal=G.prototype.o;G.prototype.setSpot=G.prototype.rk;G.prototype.setRectSpot=G.prototype.Ui;G.prototype.snapToGridPoint=G.prototype.Sz;G.prototype.snapToGrid=G.prototype.Rz;G.prototype.projectOntoLineSegmentPoint=G.prototype.Gz;G.prototype.projectOntoLineSegment=G.prototype.Fz; G.prototype.direction=G.prototype.direction;G.prototype.directionPoint=G.prototype.Wa;G.prototype.normalize=G.prototype.normalize;G.prototype.distanceSquared=G.prototype.cd;G.prototype.distanceSquaredPoint=G.prototype.Be;G.prototype.scale=G.prototype.scale;G.prototype.rotate=G.prototype.rotate;G.prototype.offset=G.prototype.offset;G.prototype.subtract=G.prototype.Xd;G.prototype.add=G.prototype.add;G.prototype.equalsApprox=G.prototype.Qa;G.prototype.equalTo=G.prototype.Ei;G.prototype.equals=G.prototype.A; G.prototype.set=G.prototype.set;G.prototype.setTo=G.prototype.ug;var ac=null,bc=null,cc=null,dc=null,ec=null,$b=[];G.className="Point";G.parse=Nb;G.stringify=Ob;G.distanceLineSegmentSquared=Rb;G.distanceSquared=Sb;G.direction=Tb;G.Origin=ac=(new G(0,0)).ga();G.InfiniteTopLeft=bc=(new G(-Infinity,-Infinity)).ga();G.InfiniteBottomRight=cc=(new G(Infinity,Infinity)).ga();G.SixPoint=dc=(new G(6,6)).ga();G.NoPoint=ec=(new G(NaN,NaN)).ga();G.parse=Nb;G.stringify=Ob;G.distanceLineSegmentSquared=Rb; G.distanceSquared=Sb;G.direction=Tb;function K(a,b){void 0===a?this.Z=this.$=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.$=a,this.Z=b):A("Invalid arguments to Size constructor: "+a+", "+b);this.v=!1}var fc,gc,hc,ic,kc,lc,mc;K.prototype.assign=function(a){this.$=a.$;this.Z=a.Z;return this};K.prototype.h=function(a,b){this.$=a;this.Z=b;return this};K.prototype.ug=function(a,b){this.$=a;this.Z=b;return this};K.prototype.set=function(a){this.$=a.$;this.Z=a.Z;return this}; K.prototype.copy=function(){var a=new K;a.$=this.$;a.Z=this.Z;return a};t=K.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function nc(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 oc(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof K?this.$===a.width&&this.Z===a.height:!1};t.Ei=function(a,b){return this.$===a&&this.Z===b}; t.Qa=function(a){return H.w(this.$,a.width)&&H.w(this.Z,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};K.alloc=function(){var a=pc.pop();return void 0===a?new K:a};K.free=function(a){pc.push(a)}; pa.Object.defineProperties(K.prototype,{width:{get:function(){return this.$},set:function(a){0>a&&xa(a,">= 0",K,"width");this.$=a}},height:{get:function(){return this.Z},set:function(a){0>a&&xa(a,">= 0",K,"height");this.Z=a}}});K.prototype.isReal=K.prototype.o;K.prototype.equalsApprox=K.prototype.Qa;K.prototype.equalTo=K.prototype.Ei;K.prototype.equals=K.prototype.A;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.ug; var pc=[];K.className="Size";K.parse=nc;K.stringify=oc;K.ZeroSize=fc=(new K(0,0)).ga();K.OneSize=gc=(new K(1,1)).ga();K.SixSize=hc=(new K(6,6)).ga();K.EightSize=ic=(new K(8,8)).ga();K.TenSize=kc=(new K(10,10)).ga();K.InfiniteSize=lc=(new K(Infinity,Infinity)).ga();K.NoSize=mc=(new K(NaN,NaN)).ga();K.parse=nc;K.stringify=oc; function N(a,b,c,d){void 0===a?this.Z=this.$=this.G=this.F=0:a instanceof G?(c=a.x,a=a.y,b instanceof G?(d=b.x,b=b.y,this.F=Math.min(c,d),this.G=Math.min(a,b),this.$=Math.abs(c-d),this.Z=Math.abs(a-b)):b instanceof K?(this.F=c,this.G=a,this.$=b.$,this.Z=b.Z):A("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.F=a,this.G=b,this.$=c,this.Z=d):A("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this.v=!1}t=N.prototype;t.assign=function(a){this.F=a.F;this.G=a.G;this.$=a.$;this.Z=a.Z;return this};t.h=function(a,b,c,d){this.F=a;this.G=b;this.$=c;this.Z=d;return this};function sc(a,b,c){a.$=b;a.Z=c}t.ug=function(a,b,c,d){this.F=a;this.G=b;this.$=c;this.Z=d;return this};t.set=function(a){this.F=a.F;this.G=a.G;this.$=a.$;this.Z=a.Z;return this};t.jd=function(a){this.F=a.x;this.G=a.y;return this};t.Pz=function(a){this.$=a.$;this.Z=a.Z;return this}; N.prototype.copy=function(){var a=new N;a.F=this.F;a.G=this.G;a.$=this.$;a.Z=this.Z;return a};t=N.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function tc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new N(c,e,f,g)}return new N}function uc(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 N?this.F===a.x&&this.G===a.y&&this.$===a.width&&this.Z===a.height:!1};t.Ei=function(a,b,c,d){return this.F===a&&this.G===b&&this.$===c&&this.Z===d};t.Qa=function(a){return H.w(this.F,a.x)&&H.w(this.G,a.y)&&H.w(this.$,a.width)&&H.w(this.Z,a.height)};function xc(a,b){return H.ca(a.F,b.x)&&H.ca(a.G,b.y)&&H.ca(a.$,b.width)&&H.ca(a.Z,b.height)} t.da=function(a){return this.F<=a.x&&this.F+this.$>=a.x&&this.G<=a.y&&this.G+this.Z>=a.y};t.mf=function(a){return this.F<=a.x&&a.x+a.width<=this.F+this.$&&this.G<=a.y&&a.y+a.height<=this.G+this.Z};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.F<=a&&a+c<=this.F+this.$&&this.G<=b&&b+d<=this.G+this.Z};t.reset=function(){this.Z=this.$=this.G=this.F=0};t.offset=function(a,b){this.F+=a;this.G+=b;return this};t.Uc=function(a,b){return yc(this,b,a,b,a)}; t.Np=function(a){return yc(this,a.top,a.right,a.bottom,a.left)};t.Ov=function(a){return yc(this,-a.top,-a.right,-a.bottom,-a.left)};t.hz=function(a,b,c,d){return yc(this,a,b,c,d)};function yc(a,b,c,d,e){var f=a.$;c+e<=-f?(a.F+=f/2,a.$=0):(a.F-=e,a.$+=c+e);c=a.Z;b+d<=-c?(a.G+=c/2,a.Z=0):(a.G-=b,a.Z+=b+d);return a}t.lz=function(a){return zc(this,a.x,a.y,a.width,a.height)};t.gv=function(a,b,c,d){return zc(this,a,b,c,d)}; function zc(a,b,c,d,e){var f=Math.max(a.F,b),g=Math.max(a.G,c);b=Math.min(a.F+a.$,b+d);c=Math.min(a.G+a.Z,c+e);a.F=f;a.G=g;a.$=Math.max(0,b-f);a.Z=Math.max(0,c-g);return a}t.Ic=function(a){return this.hv(a.x,a.y,a.width,a.height)};t.hv=function(a,b,c,d){var e=this.$,f=this.F;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.Z;c=this.G;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function Ac(a,b,c){var d=a.$,e=a.F,f=b.x-c;if(e>b.width+c+c+f||f>d+e)return!1;d=a.Z;a=a.G;e=b.y-c;return a>b.height+c+c+e||e>d+a?!1:!0}t.Ie=function(a){return Bc(this,a.x,a.y,0,0)};t.Jc=function(a){return Bc(this,a.F,a.G,a.$,a.Z)};t.Vv=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Bc(this,a,b,c,d)};function Bc(a,b,c,d,e){var f=Math.min(a.F,b),g=Math.min(a.G,c);b=Math.max(a.F+a.$,b+d);c=Math.max(a.G+a.Z,c+e);a.F=f;a.G=g;a.$=b-f;a.Z=c-g;return a} t.rk=function(a,b,c){this.F=a-c.offsetX-c.x*this.$;this.G=b-c.offsetY-c.y*this.Z;return this};function Cc(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}function Dc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.o=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.nz=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=Fc.pop();return void 0===a?new N:a}; N.allocAt=function(a,b,c,d){var e=Fc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){Fc.push(a)}; pa.Object.defineProperties(N.prototype,{x:{get:function(){return this.F},set:function(a){this.F=a}},y:{get:function(){return this.G},set:function(a){this.G=a}},width:{get:function(){return this.$},set:function(a){0>a&&xa(a,">= 0",N,"width");this.$=a}},height:{get:function(){return this.Z},set:function(a){0>a&&xa(a,">= 0",N,"height");this.Z=a}},left:{ get:function(){return this.F},set:function(a){this.F=a}},top:{get:function(){return this.G},set:function(a){this.G=a}},right:{get:function(){return this.F+this.$},set:function(a){this.F+=a-(this.F+this.$)}},bottom:{get:function(){return this.G+this.Z},set:function(a){this.G+=a-(this.G+this.Z)}},position:{get:function(){return new G(this.F,this.G)},set:function(a){this.F=a.x;this.G= a.y}},size:{get:function(){return new K(this.$,this.Z)},set:function(a){this.$=a.width;this.Z=a.height}},center:{get:function(){return new G(this.F+this.$/2,this.G+this.Z/2)},set:function(a){this.F=a.x-this.$/2;this.G=a.y-this.Z/2}},centerX:{get:function(){return this.F+this.$/2},set:function(a){this.F=a-this.$/2}},centerY:{get:function(){return this.G+this.Z/2},set:function(a){this.G= a-this.Z/2}}});N.prototype.isEmpty=N.prototype.nz;N.prototype.isReal=N.prototype.o;N.prototype.setSpot=N.prototype.rk;N.prototype.union=N.prototype.Vv;N.prototype.unionRect=N.prototype.Jc;N.prototype.unionPoint=N.prototype.Ie;N.prototype.intersects=N.prototype.hv;N.prototype.intersectsRect=N.prototype.Ic;N.prototype.intersect=N.prototype.gv;N.prototype.intersectRect=N.prototype.lz;N.prototype.grow=N.prototype.hz;N.prototype.subtractMargin=N.prototype.Ov;N.prototype.addMargin=N.prototype.Np; N.prototype.inflate=N.prototype.Uc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.mf;N.prototype.containsPoint=N.prototype.da;N.prototype.equalsApprox=N.prototype.Qa;N.prototype.equalTo=N.prototype.Ei;N.prototype.equals=N.prototype.A;N.prototype.setSize=N.prototype.Pz;N.prototype.setPoint=N.prototype.jd;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.ug;var Gc=null,Hc=null,Fc=[];N.className="Rect";N.parse=tc; N.stringify=uc;N.contains=Cc;N.intersects=Dc;N.ZeroRect=Gc=(new N(0,0,0,0)).ga();N.NoRect=Hc=(new N(NaN,NaN,NaN,NaN)).ga();N.parse=tc;N.stringify=uc;N.contains=Cc;N.intersects=Dc; function Ic(a,b,c,d){void 0===a?this.ke=this.ae=this.ue=this.we=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):A("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.v=!1}Ic.prototype.assign=function(a){this.we=a.we;this.ue=a.ue;this.ae=a.ae;this.ke=a.ke;return this};Ic.prototype.ug=function(a,b,c,d){this.we=a;this.ue=b;this.ae=c;this.ke=d;return this}; Ic.prototype.set=function(a){this.we=a.we;this.ue=a.ue;this.ae=a.ae;this.ke=a.ke;return this};Ic.prototype.copy=function(){var a=new Ic;a.we=this.we;a.ue=this.ue;a.ae=this.ae;a.ke=this.ke;return a};t=Ic.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function Jc(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 Ic;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new Ic(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new Ic(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new Ic(c,e):new Ic(c,e,f,g)}return new Ic} function Kc(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 Ic?this.we===a.top&&this.ue===a.right&&this.ae===a.bottom&&this.ke===a.left:!1};t.Ei=function(a,b,c,d){return this.we===a&&this.ue===b&&this.ae===c&&this.ke===d}; t.Qa=function(a){return H.w(this.we,a.top)&&H.w(this.ue,a.right)&&H.w(this.ae,a.bottom)&&H.w(this.ke,a.left)};t.o=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};Ic.alloc=function(