/*!@license
* Infragistics.Web.ClientUI infragistics.dv_geometry.js 21.2.20212.99
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*     infragistics.ext_core.js
*     infragistics.ext_collections.js
*     infragistics.dv_core.js
*     infragistics.ext_ui.js
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.util","./infragistics.ext_core","./infragistics.ext_collections","./infragistics.dv_core","./infragistics.ext_ui"],factory)}else{factory(igRoot)}})(function($){$.ig=$.ig||{};var $$t={};$.ig.globalDefs=$.ig.globalDefs||{};$.ig.globalDefs.$$r=$$t;var $$0=$.ig.globalDefs.$$0;var $$4=$.ig.globalDefs.$$4;var $$1=$.ig.globalDefs.$$1;var $$w=$.ig.globalDefs.$$w;var $$6=$.ig.globalDefs.$$6;var $$a=$.ig.globalDefs.$$a;$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["CollisionManagerLabelsMovedEventHandler:e","QuadTree:f","QuadTreeNode:i","ISmartPlaceable:ab"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.defEnum,$e=$.ig.util.getBoxIfEnum,$f=$.ig.util.getDefaultValue,$g=$.ig.util.getEnumValue,$h=$.ig.util.getValue,$i=$.ig.util.intSToU,$j=$.ig.util.nullableEquals,$k=$.ig.util.nullableIsNull,$l=$.ig.util.nullableNotEquals,$m=$.ig.util.toNullable,$n=$.ig.util.toString$1,$o=$.ig.util.u32BitwiseAnd,$p=$.ig.util.u32BitwiseOr,$q=$.ig.util.u32BitwiseXor,$r=$.ig.util.u32LS,$s=$.ig.util.unwrapNullable,$t=$.ig.util.wrapNullable,$u=String.fromCharCode,$v=$.ig.util.castObjTo$t,$w=$.ig.util.compareSimple,$x=$.ig.util.tryParseNumber,$y=$.ig.util.tryParseNumber1,$z=$.ig.util.numberToString,$0=$.ig.util.numberToString1,$1=$.ig.util.parseNumber;$d("SmartPosition:aa",false,false,{LeftTop:0,CenterTop:1,RightTop:2,LeftCenter:3,CenterCenter:4,RightCenter:5,LeftBottom:6,CenterBottom:7,RightBottom:8});$d("LabelCollisionManagerCollisionMode:b",false,false,{SimulatedAnnealing:0,Greedy:1,GreedyCenterOfMass:2});$d("LabelCollisionPlacementPositions:a",false,false,{Top:0,Left:1,Right:2,Bottom:3,TopLeft:4,TopRight:5,BottomLeft:6,BottomRight:7});$c("LabelCollisionManager:c","Object",{l:false,a:null,init:function(a,b,c,d,e,f,g,h,i,j,k){this.l=false;this.a=new Array(8);this.v=new $$4.v($$t.$d.$type);this.ag=0;this.w=new $$4.x($$t.$d.$type,0);this.n=false;this.m=false;this.ah=0;this.o=false;this.k=false;$.ig.$op.init.call(this);this.l=k!=null;this._a5=c;this._ae=a;this._ac=b;this._h=new $$t.f(a,b,8,8);this._g=f;this._e=d;this._x=new $$4.x($$t.$a.$type,0);this._x.add(0);this._x.add(5);this._x.add(7);this._x.add(2);this._x.add(3);this._x.add(6);this._x.add(1);this._x.add(4);var l=0;for(var m=0;m<g.length;m++){if(this._x.contains(g[m])){this._x.remove(g[m]);this._x.insert(l,g[m]);l++}}if(k!=null){this._y=new $$4.x($$t.$a.$type,0);for(var n=0;n<this.a.length;n++){this.a[n]=false}for(var o=0;o<k.length;o++){this.a[k[o]]=true;this._y.add(k[o])}this.b=k}else{this._y=new $$4.x($$t.$a.$type,0);this._y.add(0);this._y.add(5);this._y.add(7);this._y.add(2);this._y.add(3);this._y.add(6);this._y.add(1);this._y.add(4);var p=0;for(var q=0;q<g.length;q++){if(this._y.contains(g[q])){this._y.remove(g[q]);this._y.insert(p,g[q]);p++}}}this._ad=e;this._ak=h;this._aj=i;this.k=j},i:function(a,b,c,d,e){var f=0;var g=0;switch(b){case 0:f=a._o;g=a._p-a._m-a._k-this._ad-d;break;case 4:f=a._o-a._n-a._l-this._ad-c;g=a._p-a._m-a._k-this._ad-d;break;case 5:f=a._o+a._n+a._l+this._ad+c;g=a._p-a._m-a._k-this._ad-d;break;case 1:f=a._o-a._n-a._l-this._ad-c;g=a._p;break;case 2:f=a._o+a._n+a._l+this._ad+c;g=a._p;break;case 3:f=a._o;g=a._p+a._m+a._k+this._ad+d;break;case 6:f=a._o-a._n-a._l-this._ad-c;g=a._p+a._m+a._k+this._ad+d;break;case 7:f=a._o+a._n+a._l+this._ad+c;g=a._p+a._m+a._k+this._ad-d;break}var h=new $$t.h;h.b=f;h.c=g;h.e=a._l;h.d=a._k;h.g=a;if(this.s(h)&&!e){return null}return h},s:function(a){var b=a.b-a.e;var c=a.b+a.e;var d=a.c-a.d;var e=a.c+a.d;var f=this._a5;if(b<f.left()||c>f.right()||d<f.top()||e>f.bottom()){return true}return false},_y:null,labelsMoved:null,_j:null,_h:null,_g:0,_e:null,_x:null,_ad:0,_ak:0,_aj:0,_a5:null,_ae:0,_ac:0,ax:function(a,b,c,d,e){this.aw(a,b,c,d,e)},aw:function(a,b,c,d,e){this._h.d(a);a.b=b;a.c=c;a.e=d;a.d=e;this._h.c(a)},a1:function(a){this._h.d(a)},v:null,ag:0,aq:function(a){this.ag++;this.v.f(a);a._e=this.v.d();if(a._c==null){a._c=new $$t.h;a._c.b=a._o;a._c.c=a._p;a._c.e=a._n;a._c.d=a._m;a._c.g=a;this._h.c(a._c)}},a2:function(a){if(a._c!=null){this._h.d(a._c);a._c=null}if(a._b!=null){this._h.d(a._b);a._b=null}if(a._e!=null){this.v.h(a._e);a._e=null}this.ag--},az:function(a){if(a._c!=null&&a._c.b==a._o&&a._c.c==a._p){return}if(a._c!=null){this._h.d(a._c)}var b=NaN;var c=NaN;if(a._c==null){a._c=new $$t.h;a._c.g=a}else{if(a._b!=null){b=a._b.b-a._c.b;c=a._b.c-a._c.c}}a._c.b=a._o;a._c.c=a._p;a._c.e=a._n;a._c.d=a._m;this._h.c(a._c);if(a._b!=null){this._h.d(a._b);if(!$.ig.util.isNaN(b)){a._b=new $$t.h;a._b.b=a._c.b+b;a._b.c=a._c.c+c;a._b.g=a;a._b.e=a._l;a._b.d=a._k;a._g=a._b.b;a._h=a._b.c;this._h.c(a._b)}else{a._b=this.i(a,a._a,0,0,true);a._g=a._b.b;a._h=a._b.c;this._h.c(a._b)}}},ay:function(a){this._h.d(a._b);a._b.b=a._g;a._b.c=a._h;a._b.e=a._l;a._b.d=a._k;this._h.c(a._b)},a4:function(){this.m=false;{var a=this.v.c();while(a!=null){if(a._c._b!=null){this._h.d(a._c._b);a._c._b=null;if(a._c._f!=null){a._c._f.clear()}}a=a.a}this.ah=0}this.af=0;this.z=.4;this.aa=.4;var b=$.ig.truncate(Math.ceil(this._aj/150*this._ak));this.ai=b;this.at()},w:null,n:false,m:false,as:function(){this.w.clear()},ar:function(){this.m=true},av:function(){this.n=false;if(this.m){return}this.at()},at:function(){this.w.clear();this.a0(false);if(this._g==0){for(var a=0;a<this._ak;a++){this.aa=this.z*(this.ai-this.af)/this.ai;this.au();this.af++;if(this.af>this.ai){if(this._j!=null){this._j()}return}}if(this.labelsMoved!=null){this.labelsMoved(this.w)}if(this.ah>0){if(!this.n){this.n=true;this._e.executeDelayed(this.av.runOn(this),150)}}else{if(this._j!=null){this._j()}}}else{if(this._g==2){var b=this.v.c();this._h.k();while(b!=null){var c=b._c;if(c._b!=null){this._h.d(c._b);c._b=null;c._d=false;c._f=null}b=b.a}this.ah=0;this.a0(true)}if(this.labelsMoved!=null){this.labelsMoved(this.w)}}},ai:0,af:0,z:0,aa:0,au:function(){var a=$.ig.truncate(Math.round((this.ag-1)*$$t.$c.ao.nextDouble()));var b=0;var c=this.v.c();var d=this.ab(null);var e=30;var f=60;while(c!=null){var g=c._c;var h=0;var i=0;if(this.k){h=$$t.$c.ao.nextDouble()*g._l*2;i=$$t.$c.ao.nextDouble()*g._k*2}if(b==a){var j=$.ig.truncate(Math.round((this._y.count()-1)*$$t.$c.ao.nextDouble()));while(this._y.__inner[j]==g._a){j=$.ig.truncate(Math.round((this._y.count()-1)*$$t.$c.ao.nextDouble()))}var k=g._b;var l=this.i(g,this._y.__inner[j],h,i,false);var m=0;while(l==null){if(m>=e){h=0;i=0}if(m>=f){break}j=$.ig.truncate(Math.round((this._y.count()-1)*$$t.$c.ao.nextDouble()));l=this.i(g,this._y.__inner[j],h,i,false);m++}g._b=l;if(k!=null){this._h.d(k)}if(l!=null){this._h.c(l);var n=this.ab(g);var o=d>n;if(!o){var p=Math.exp(-(n-d)/this.aa);if($$t.$c.ao.nextDouble()<p){o=true}}if(!o&&k!=null){this._h.d(l);this._h.c(k);g._b=k;if(!this.o){this.ab(g)}}else{g._a=this._y.__inner[j];g._g=g._b.b;g._h=g._b.c;this.w.add(g)}}else{if(!this.o){this.ab(g)}g._d=false;this.w.add(g)}break}b++;c=c.a}},ah:0,o:false,k:false,b:null,ab:function(a){if(this.o){var b=0;var c=this.v.c();while(c!=null){var d=c._c;var e=d._d;d._d=false;if(d._b!=null){var f=this._h.e(d._b);for(var g=0;g<f.count();g++){var h=f.__inner[g].l.c();while(h!=null){var i=h._c;if(i.g==d){h=h.a;continue}if(d._b.a(i)){d._d=true;b+=d._b.f(i)}h=h.a}}if(d._d!=e){this.w.add(d)}}c=c.a}return b}else{if(a!=null){var j=new $$4.q($$t.$d.$type,0);var k=new $$4.q($$t.$d.$type,0);var l=new $$4.q($$t.$d.$type,0);var m=new $$4.x($$t.$d.$type,0);if(a._f!=null){for(var n=0;n<a._f.count();n++){j.add(a._f.__inner[n]);k.add(a._f.__inner[n])}}var o=a._d;a._d=false;if(a._b!=null){var p=this._h.e(a._b);for(var q=0;q<p.count();q++){var r=p.__inner[q].l.c();while(r!=null){var s=r._c;if(s.g==a){r=r.a;continue}if(a._b.a(s)&&!l.contains(s.g)){a._d=true;l.add(s.g);m.add(s.g)}r=r.a}}p=this._h.e(a._c);for(var t=0;t<p.count();t++){var u=p.__inner[t].l.c();while(u!=null){var v=u._c;if(v.g==a){u=u.a;continue}if(this.p(a._c,v)){u=u.a;continue}if(a._c.a(v)&&!l.contains(v.g)){a._d=true;l.add(v.g);m.add(v.g)}u=u.a}}if(a._d!=o){this.w.add(a)}if(a._f!=null){for(var w=a._f.count()-1;w>=0;w--){if(!l.contains(a._f.__inner[w])){var x=a._f.__inner[w];var y=x._f.remove(a);a._f.removeAt(w);if(x._f.count()==0&&y){this.ah--}var z=j.remove(x);if(j.count()==0&&z){this.ah--}}}}for(var aa=0;aa<m.count();aa++){var ab=m.__inner[aa];if(!j.contains(ab)){if(a._f==null){a._f=new $$4.x($$t.$d.$type,0)}a._f.add(ab);if(j.count()==0){this.ah++}j.add(ab);if(ab._f==null){ab._f=new $$4.x($$t.$d.$type,0)}if(ab._f.count()==0){this.ah++}ab._f.add(a)}}}}return this.ah}},p:function(a,b){if(a.g._c==a&&b.g._c==b){return true}return false},al:function(){return this.ah},_ap:null,_an:null,a3:function(a,b,c){this._a5=c;var d=new $$t.f(a,b,this._h.i,this._h.f);var e=this.v.c();while(e!=null){d.c(e._c._c);if(e._c._b!=null){d.c(e._c._b)}e=e.a}this._h=d;this._ae=a;this._ac=b},u:function(){var a=this.v.c();while(a!=null){a._c._d=false;if(a._c._b!=null){if(this.s(a._c._b)){return true}}a=a.a}return false},q:function(){var a=this.v.c();var b=this._y;while(a!=null){if(a._c._b!=null){if(this.s(a._c._b)){var c=a._c;for(var d=0;d<b.count();d++){var e=this.i(c,b.__inner[d],0,0,false);if(e!=null){return true}}}}a=a.a}return false},am:function(){var a=this.v.c();while(a!=null){a._c._d=false;a=a.a}a=this.v.c();while(a!=null){var b=a._c._b;var c=a._c._c;var d=this._h.e(c);for(var e=0;e<d.count();e++){var f=d.__inner[e].l.c();while(f!=null){var g=f._c;if(this.p(c,g)){f=f.a;continue}if(c.a(g)){var h=f._c.g;if(h!=a._c){h._d=true;a._c._d=true}}f=f.a}}if(b==null){return-1}d=this._h.e(b);for(var i=0;i<d.count();i++){var j=d.__inner[i].l.c();while(j!=null){var k=j._c;if(b.a(k)){var l=j._c.g;if(l!=a._c){l._d=true;a._c._d=true}}j=j.a}}a=a.a}var m=0;a=this.v.c();while(a!=null){if(a._c._d){m++}a=a.a}return m},a0:function(a){var b=this.v.c();while(b!=null){var c=b._c;if(c._b==null||a){var d=false;if(a){var e=this._h.a(c._o,c._p,1.5);var f=this.c(e);if(f!=null){for(var g=0;g<f.length;g++){var h=f[g];var i=this.i(c,h,0,0,false);if(i==null){continue}var j=this._h.e(i);d=true;for(var k=0;k<j.count();k++){var l=j.__inner[k].l.c();while(l!=null){var m=l._c;if(i.a(m)){d=false;break}l=l.a}}if(d){c._b=i;c._a=h;c._g=c._b.b;c._h=c._b.c;this._h.c(c._b);this.w.add(c);break}}}}if(!d){d=this.t(c,false)}if(!d){if(c._b==null){this.t(c,true)}}}b=b.a}},t:function(a,b){var c=this._y;var d=false;if(!d){for(var e=0;e<c.count();e++){var f=this.i(a,c.__inner[e],0,0,b);if(f==null){continue}d=!this.r(f,a);var g=a._c;if(g==null){g=new $$t.h;g.g=a;g.b=a._o;g.c=a._p;g.e=a._n;g.d=a._m;this._h.c(g);a._c=g}var h=this.r(g,a);d=d&&!h;if(d){a._b=f;a._a=c.__inner[e];a._g=a._b.b;a._h=a._b.c;this._h.c(a._b);this.w.add(a);break}}}if(!d){var i=Number.POSITIVE_INFINITY;var j=0;var k=null;for(var l=0;l<c.count();l++){var m=0;var n=null;var o=new $$4.q($$t.$d.$type,0);if(!this.o){n=new $$4.x($$t.$d.$type,0)}var p=this.i(a,c.__inner[l],0,0,b);if(p==null){continue}var q=this._h.e(p);for(var r=0;r<q.count();r++){var s=q.__inner[r].l.c();while(s!=null){var t=s._c;if(p.a(t)){m+=p.f(t);if(!this.o){if(!o.contains(t.g)){n.add(t.g);o.add(t.g)}}}s=s.a}}var u=a._c;if(u==null){u=new $$t.h;u.g=a;u.b=a._o;u.c=a._p;u.e=a._n;u.d=a._m}q=this._h.e(u);for(var v=0;v<q.count();v++){var w=q.__inner[v].l.c();while(w!=null){var x=w._c;if(w._c.g==a){w=w.a;continue}if(this.p(u,x)){w=w.a;continue}if(u.a(x)){if(!this.o){if(!o.contains(x.g)){n.add(x.g);o.add(x.g)}}}w=w.a}}if(m<i){var y=this.i(a,c.__inner[l],0,0,b);if(y!=null){i=m;j=l;if(!this.o){k=n}}}}var z=this.i(a,c.__inner[j],0,0,b);a._d=true;if(!this.o){if(a._f!=null&&a._f.count()>0){this.ah--;for(var aa=a._f.count()-1;aa>=0;aa--){var ab=a._f.__inner[aa];if(ab._f!=null){ab._f.remove(a);if(ab._f.count()==0){this.ah--}}}}if(k==null){a._d=false;this.w.add(a);return false}a._f=k;if(k.count()>0){this.ah++}for(var ac=0;ac<k.count();ac++){var ad=k.__inner[ac];if(ad._f==null){ad._f=new $$4.x($$t.$d.$type,0)}if(!ad._f.contains(a)){if(ad._f.count()==0){this.ah++}ad._f.add(a)}}}a._b=z;a._a=c.__inner[j];a._g=a._b.b;a._h=a._b.c;this._h.c(a._b);this.w.add(a)}return d},r:function(a,b){var c=false;var d=this._h.e(a);for(var e=0;e<d.count();e++){var f=d.__inner[e].l.c();while(f!=null){if(f._c.g==b){f=f.a;continue}var g=f._c;if(this.p(a,g)){f=f.a;continue}if(a.a(g)){c=true;break}f=f.a}}return c},c:function(a){var b=new Array(3);var c=$$t.$u.f({__x:0,__y:0,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName},{__x:a.a,__y:a.b,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName});c=c*180/Math.PI;c=$$t.$u.i(c);if(c>=0&&c<=22.5||c>=337.5&&c<=360){b[0]=2;b[1]=5;b[2]=7}if(c>=22.5&&c<=67.5){b[0]=2;b[1]=7;b[2]=3}if(c>=67.5&&c<=112.5){b[0]=7;b[1]=3;b[2]=6}if(c>=112.5&&c<=157.5){b[0]=3;b[1]=6;b[2]=1}if(c>=157.5&&c<=202.5){b[0]=6;b[1]=1;b[2]=4}if(c>=202.5&&c<=247.5){b[0]=1;b[1]=4;b[2]=0}if(c>=247.5&&c<=292.5){b[0]=4;b[1]=0;b[2]=5}if(c>=292.5&&c<=337.5){b[0]=0;b[1]=5;b[2]=2}if(this.l){var d=0;for(var e=0;e<b.length;e++){if(this.a[b[e]]){d++}}if(d==0){return null}var f=0;var g=new Array(d);for(var h=0;h<b.length;h++){if(this.a[b[h]]){g[f]=b[h];f++}}b=g}return b},f:function(a,b){var c=false;var d=null;var e=new $$t.h;e.b=a.__x;e.c=a.__y;e.e=5;e.d=5;var f=this._h.e(e);for(var g=0;g<f.count();g++){var h=f.__inner[g].l.c();while(h!=null){var i=h._c;if(i.g._c==i){h=h.a;continue}if(e.a(i)){d=i;c=true;break}h=h.a}}if(c){return d.g}else{return null}},$type:new $.ig.Type("LabelCollisionManager",$.ig.$ot)},true);$c("LabelCollisionInfo:d","Object",{init:function(){$.ig.$op.init.call(this)},_e:null,_o:0,_p:0,_n:0,_m:0,_c:null,_l:0,_k:0,_i:0,_j:0,_s:0,_t:0,_g:0,_h:0,_q:0,_r:0,_a:0,_b:null,_u:null,_d:false,_f:null,$type:new $.ig.Type("LabelCollisionInfo",$.ig.$ot)},true);$c("QuadTree:f","Object",{init:function(a,b,c,d){$.ig.$op.init.call(this);this._b=new $$t.i;this._b.b=this;this._b.c=new $$t.h;var e=Math.max(a,b);this._b.c.b=e/2;this._b.c.c=e/2;this._b.c.e=e/2;this._b.c.d=e/2;this.f=d;this.i=c},_b:null,f:0,i:0,c:function(a){return this._b.i(a)},d:function(a){return this._b.k(a)},e:function(a){var b=new $$4.x($$t.$i.$type,0);this._b.x(a,b);return b},j:function(){this._b.w()},k:function(){this._b.z()},g:function(){return this.h(this._b,new $$4.q($$t.$h.$type,0))},h:function(a,b){if(a.j()){var c=0;var d=a.l.c();while(d!=null){if(!b.contains(d._c)){c+=1;b.add(d._c)}d=d.a}return c}var e=this.h(a.f(),b);e+=this.h(a.e(),b);e+=this.h(a.h(),b);e+=this.h(a.g(),b);return e},a:function(a,b,c){return this._b.d(a,b,c)},$type:new $.ig.Type("QuadTree",$.ig.$ot)},true);$c("QuadTreeForceVector:g","Object",{init:function(){$.ig.$op.init.call(this)},a:0,b:0,$type:new $.ig.Type("QuadTreeForceVector",$.ig.$ot)},true);$c("QuadTreeBoundingBox:h","Object",{init:function(){$.ig.$op.init.call(this)},b:0,c:0,e:0,d:0,a:function(a){if(this.b+this.e<a.b-a.e||this.c+this.d<a.c-a.d||this.b-this.e>a.b+a.e||this.c-this.d>a.c+a.d){return false}return true},g:null,f:function(a){var b=this.b-this.e;var c=this.c-this.d;var d=this.b+this.e;var e=this.c+this.d;var f=a.b-a.e;var g=a.c-a.d;var h=a.b+a.e;var i=a.c+a.d;var j=Math.max(b,f);var k=Math.min(d,h);var l=Math.max(c,g);var m=Math.min(e,i);return(k-j)*(m-l)},$type:new $.ig.Type("QuadTreeBoundingBox",$.ig.$ot)},true);$c("QuadTreeNode:i","Object",{init:function(){this.t=0;this.q=0;$.ig.$op.init.call(this);this.m=0;this.n=0;this.o=0;this.l=new $$4.v($$t.$h.$type);this.a=new Array(4);this.c=new $$t.h;for(var a=0;a<4;a++){this.a[a]=null}},k:function(a){if(!this.c.a(a)){return false}var b=this.f()==null&&this.e()==null&&this.h()==null&&this.g()==null;if(b){var c=this.l.c();while(c!=null){if(c._c==a){this.l.h(c);this.t--;return true}c=c.a}return false}this.f().k(a);this.e().k(a);this.h().k(a);this.g().k(a);return false},j:function(){return this.f()==null&&this.e()==null&&this.h()==null&&this.g()==null},x:function(a,b){if(!this.c.a(a)){return}if(this.j()){b.add(this);return}this.f().x(a,b);this.e().x(a,b);this.h().x(a,b);this.g().x(a,b)},w:function(){if(this.f()!=null){this.f().w()}if(this.e()!=null){this.e().w()}if(this.h()!=null){this.h().w()}if(this.g()!=null){this.h().w()}if(this.f().j()&&this.f().t==0&&this.e().j()&&this.e().t==0&&this.h().j()&&this.h().t==0&&this.g().j()&&this.g().t==0){this.f(null);this.e(null);this.h(null);this.g(null);return}},i:function(a){if(!this.c.a(a)){return false}var b=this.f()==null&&this.e()==null&&this.h()==null&&this.g()==null;if(b&&this.t<this.b.f){this.l.f(a);this.t++;return true}else if(b&&this.q<this.b.i){this.y()}else if(b){this.l.f(a);this.t++;return true}var c=this.f().i(a);c=this.e().i(a)||c;c=this.h().i(a)||c;c=this.g().i(a)||c;return c},y:function(){this.f(new $$t.i);this.e(new $$t.i);this.h(new $$t.i);this.g(new $$t.i);var a=this.c.e/2;this.f().c.b=this.c.b-a;this.f().c.c=this.c.c-a;this.e().c.b=this.c.b+a;this.e().c.c=this.c.c-a;this.h().c.b=this.c.b-a;this.h().c.c=this.c.c+a;this.g().c.b=this.c.b+a;this.g().c.c=this.c.c+a;for(var b=0;b<4;b++){this.a[b].q=this.q+1;this.a[b].c.e=a;this.a[b].c.d=a;this.a[b].b=this.b}var c=this.l.c();while(c!=null){var d=c._c;this.f().i(d);this.e().i(d);this.h().i(d);this.g().i(d);c=c.a}this.l.g();this.t=0},z:function(){if(this.j()){var a=0;var b=0;var c=this.l.c();while(c!=null){var d=c._c;a+=d.b;b+=d.c;c=c.a}if(this.t==0){this.m=0;this.n=0;this.o=0}else{this.m=a/this.t;this.n=b/this.t;this.o=this.t}}else{this.f().z();this.h().z();this.e().z();this.g().z();var e=0;var f=0;var g=0;for(var h=0;h<4;h++){g+=this.a[h].o;e+=this.a[h].m*this.a[h].o;f+=this.a[h].n*this.a[h].o}if(this.o>0){this.m=e/g;this.n=f/g}this.o=g}},d:function(a,b,c){var d=Math.sqrt((a-this.m)*(a-this.m)+(b-this.n)*(b-this.n));var e=this.c.e*2;if(e/d<c||this.j()){var f=(a-this.m)*this.o/(d*d);var g=(b-this.n)*this.o/(d*d);return function(){var $ret=new $$t.g;$ret.a=f;$ret.b=g;return $ret}()}else{var h=0;var i=0;for(var j=0;j<4;j++){var k=this.a[j].d(a,b,c);h+=k.a;i+=k.b}return function(){var $ret=new $$t.g;$ret.a=h;$ret.b=i;return $ret}()}},b:null,l:null,t:0,c:null,q:0,a:null,f:function(a){if(arguments.length===1){this.a[0]=a;return a}else{return this.a[0]}},e:function(a){if(arguments.length===1){this.a[1]=a;return a}else{return this.a[1]}},h:function(a){if(arguments.length===1){this.a[2]=a;return a}else{return this.a[2]}},g:function(a){if(arguments.length===1){this.a[3]=a;return a}else{return this.a[3]}},m:0,n:0,o:0,$type:new $.ig.Type("QuadTreeNode",$.ig.$ot)},true);$c("Clipper:j","Object",{i:function(a){if(arguments.length===1){if(this.b!=null){this.b.clear()}this.b=null;this.h=a;var b=this.h;if(this.c!=null){this.c.dst(b);b=this.c;this.b=this.c}if(this.a!=null){this.a.dst(b);b=this.a;this.a.__nextClipper=this.b;this.b=this.a}if(this.d!=null){this.d.dst(b);b=this.d;this.d.__nextClipper=this.b;this.b=this.d}if(this.e!=null){this.e.dst(b);b=this.e;this.e.__nextClipper=this.b;this.b=this.e}this.g=b;return a}else{return this.h}},g:null,b:null,h:null,c:null,a:null,d:null,e:null,init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.$op.init.call(this);this.c=function(){var $ret=new $$t.l;$ret._edge=b.left();$ret._isClosed=c;return $ret}();this.a=function(){var $ret=new $$t.m;$ret._edge=b.bottom();$ret._isClosed=c;return $ret}();this.d=function(){var $ret=new $$t.n;$ret._edge=b.right();$ret._isClosed=c;return $ret}();this.e=function(){var $ret=new $$t.o;$ret._edge=b.top();$ret._isClosed=c;return $ret}()},init1:function(a,b,c,d,e,f){$.ig.$op.init.call(this);this.c=!$.ig.util.isNaN(b)?function(){var $ret=new $$t.l;$ret._edge=b;$ret._isClosed=f;return $ret}():null;this.a=!$.ig.util.isNaN(c)?function(){var $ret=new $$t.m;$ret._edge=c;$ret._isClosed=f;return $ret}():null;this.d=!$.ig.util.isNaN(d)?function(){var $ret=new $$t.n;$ret._edge=d;$ret._isClosed=f;return $ret}():null;this.e=!$.ig.util.isNaN(e)?function(){var $ret=new $$t.o;$ret._edge=e;$ret._isClosed=f;return $ret}():null},j:function(a){this.g.add(a)},k:function(a,b){var c=a;var d=a.count();var e=new Array(4);e[0]=this.e;e[1]=this.d;e[2]=this.a;e[3]=this.c;var f=0;var g=0;var h=0;var i=0;if(this.e!=null){f=this.e._edge}if(this.d!=null){g=this.d._edge}if(this.a!=null){h=this.a._edge}if(this.c!=null){i=this.c._edge}var j=false;var k;var l=e.length;var m=l+1;var n=null;var o;var p;var q=0;var r=new Array(16);var s=0;var t=new Array(16);var u=0;var v=1;var w;var x;if(b){u=d-1;v=-1}for(var y=u;y<d&&y>=0;y+=v){o=c.item(y);r[q]=o;q++;for(k=0;k<m;k++){if(k<l){n=e[k];if(n==null){continue}}for(p=0;p<q;p++){o=r[p];x=o.__x;w=o.__y;if(k>=l){this.h.add(o);continue}j=k==0&&w>=f||k==1&&x<=g||k==2&&w<=h||k==3&&x>=i;if(n.c){n.c=false;n.j=o}else{if(true){if(j){if(!n.g){t[s]=n.k(n.l,o);s++}else{if(!n._isClosed&&!n.f){t[s]=n.l;s++;n.f=true}}t[s]=o;s++}else{if(n.g){if(!n._isClosed&&!n.f){t[s]=n.l;s++;n.f=true}t[s]=n.k(n.l,o);s++}}}}n.l=o;n.g=j}var z=r;r=t;t=z;q=s;s=0}}},f:function(a){if(arguments.length===1){if(this.c!=null){this.c._isClosed=a}if(this.a!=null){this.a._isClosed=a}if(this.d!=null){this.d._isClosed=a}if(this.e!=null){this.e._isClosed=a}return a}else{return(this.c==null||this.c._isClosed)&&(this.a==null||this.a._isClosed)&&(this.d==null||this.d._isClosed)&&(this.e==null||this.e._isClosed)}},$type:new $.ig.Type("Clipper",$.ig.$ot)},true);$c("EdgeClipper:k","Object",{init:function(){this.c=true;this.f=false;$.ig.$op.init.call(this)},dst:function(a){if(arguments.length===1){if(this._dst!=a){this.c=true;this._dst=a}return a}else{return this._dst}},_dst:null,__nextClipper:null,nextClipper:function(a){if(arguments.length===1){this.__nextClipper=a;return a}else{return this.__nextClipper}},c:false,j:null,l:null,g:false,_isClosed:false,f:false,add:function(a){var b=this.e(a);if(this.c){this.c=false;this.j=a}else{if(true){if(b){if(!this.g){this._dst.add(this.k(this.l,a))}else{if(!this._isClosed&&!this.f){this._dst.add(this.l);this.f=true}}this._dst.add(a)}else{if(this.g){if(!this._isClosed&&!this.f){this._dst.add(this.l);this.f=true}this._dst.add(this.k(this.l,a))}}}}this.l=a;this.g=b},clear:function(){if(this._isClosed&&!this.c){this.add(this.j)}if(this.__nextClipper!=null){this.__nextClipper.clear()}this.c=true;this.f=false},e:function(a){},k:function(a,b){},getEnumerator:function(){return null},isReadOnly:function(){return false},count:function(){return 0},remove:function(a){return false},removeAt:function(a){},copyTo:function(a,b){},contains:function(a){return false},item:function(a,b){if(arguments.length===2){return b}else{return{__x:0,__y:0,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}}},insert:function(a,b){},indexOf:function(a){return-1},$type:new $.ig.Type("EdgeClipper",$.ig.$ot,[$$0.$bz.$type.specialize($$a.$y.$type)])},true);$c("LeftClipper:l","EdgeClipper",{init:function(){$$t.$k.init.call(this)},_edge:0,e:function(a){return a.__x>=this._edge},k:function(a,b){return{__x:this._edge,__y:a.__y+(b.__y-a.__y)*(this._edge-a.__x)/(b.__x-a.__x),$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},$type:new $.ig.Type("LeftClipper",$$t.$k.$type)},true);$c("BottomClipper:m","EdgeClipper",{init:function(){$$t.$k.init.call(this)},_edge:0,e:function(a){return a.__y<=this._edge},k:function(a,b){return{__x:a.__x+(b.__x-a.__x)*(this._edge-a.__y)/(b.__y-a.__y),__y:this._edge,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},$type:new $.ig.Type("BottomClipper",$$t.$k.$type)},true);$c("RightClipper:n","EdgeClipper",{init:function(){$$t.$k.init.call(this)},_edge:0,e:function(a){return a.__x<=this._edge},k:function(a,b){return{__x:this._edge,__y:a.__y+(b.__y-a.__y)*(this._edge-a.__x)/(b.__x-a.__x),$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},$type:new $.ig.Type("RightClipper",$$t.$k.$type)},true);$c("TopClipper:o","EdgeClipper",{init:function(){$$t.$k.init.call(this)},_edge:0,e:function(a){return a.__y>=this._edge},k:function(a,b){return{__x:a.__x+(b.__x-a.__x)*(this._edge-a.__y)/(b.__y-a.__y),__y:this._edge,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},$type:new $.ig.Type("TopClipper",$$t.$k.$type)},true);$c("Flattener:p","Object",{init:function(){$.ig.$op.init.call(this)},d:function(a,b,c,d){var e=new $$4.x($$0.$aw.$type,0);$$t.$p.c(e,b,c,0,a-1,d);return e},c:function(a,b,c,d,e,f){return $$t.$p.b(a,function(g){return g},b,c,d,e,f)},a:function(a,b,c,d,e,f,g){return $$t.$p.b(a,function(h){return b.item(h)},c,d,e,f,g)},b:function(a,b,c,d,e,f,g){if(e>f){return a}var h=c(b(e));var i=d(b(e));while(($.ig.util.isNaN(h)||$.ig.util.isNaN(i))&&e<f){++e;h=c(b(e));i=d(b(e))}var j=c(b(f));var k=d(b(f));while(($.ig.util.isNaN(j)||$.ig.util.isNaN(k))&&e<f){--f;j=c(b(f));k=d(b(f))}if(e==f){a.add(b(e));return a}a.add(b(e));$$t.$p.e(a,b,c,d,e,f,g);a.add(b(f));return a},e:function(a,b,c,d,e,f,g){var h=c(b(e));var i=d(b(e));while(($.ig.util.isNaN(h)||$.ig.util.isNaN(i))&&e<f){++e;h=c(b(e));i=d(b(e))}var j=c(b(f));var k=d(b(f));while(($.ig.util.isNaN(j)||$.ig.util.isNaN(k))&&e<f){--f;j=c(b(f));k=d(b(f))}if(e+1>=f){return}var l=-1;var m=g;var n=$.ig.MathUtil.prototype.e(j-h,k-i);if(n==0){for(var o=e+1;o<f;++o){var p=c(b(o));var q=d(b(o));if($.ig.util.isNaN(p)||$.ig.util.isNaN(q)){continue}var r=$.ig.MathUtil.prototype.e(j-p,k-q);if(r>=m){m=r;l=o}}}else{var s=j-h;var t=k-i;for(var u=e+1;u<f;++u){var v=c(b(u));var w=d(b(u));if($.ig.util.isNaN(v)||$.ig.util.isNaN(w)){continue}var x=NaN;var y=c(b(u))-h;var z=d(b(u))-i;var aa=s*y+t*z;if(aa<=0){x=$.ig.MathUtil.prototype.e(h-v,i-w)}else{var ab=s*s+t*t;if(ab<=aa){x=$.ig.MathUtil.prototype.e(j-v,k-w)}else{var ac=aa/ab;x=$.ig.MathUtil.prototype.e(h+ac*s-v,i+ac*t-w)}}if(x>=m){m=x;l=u}}}if(l!=-1){$$t.$p.e(a,b,c,d,e,l,g);a.add(b(l));$$t.$p.e(a,b,c,d,l,f,g)}return},$type:new $.ig.Type("Flattener",$.ig.$ot)},true);$c("FastFlattener:q","Object",{init:function(){$.ig.$op.init.call(this)},e:function(a,b,c,d,e,f){if(d>e){return a}var g=b[d];var h=c[d];while(($.ig.util.isNaN(g)||$.ig.util.isNaN(h))&&d<e){++d;g=b[d];h=c[d]}var i=b[e];var j=c[e];while(($.ig.util.isNaN(i)||$.ig.util.isNaN(j))&&d<e){--e;i=b[e];j=c[e]}if(d==e){a.add(d);return a}a.add(d);$$t.$q.h(a,b,c,d,e,f);a.add(e);return a},c:function(a,b,c,d,e){var f;var g;if(c){f=0;g=1}else if(d){f=0;g=2}else{f=2;g=3}return $$t.$q.d(a,b,f,g,e)},b:function(a,b,c,d,e){var f=new $$4.x($$0.$aw.$type,0);var g=$$t.$q.a(f,b,c,d,0,a-1,e);return g},d:function(a,b,c,d,e){var f=new $$4.x($$0.$aw.$type,0);$$t.$q.g(f,b,c,d,0,a-1,e);return f},a:function(a,b,c,d,e,f,g){var h=$$t.$t.instance().chunkingAmount();if(f-e+1<=h){return $$t.$q.f(a,b,c,d,e,f,g)}var i=a;if(h<0){for(var j=e;j<=f;j++){i.add(j)}return i}var k=e;var l=f;var m=l-k+1;while(m>0){if(m<=h){$$t.$q.f(i,b,c,d,k,l,g);k=l+1}else{var n=k+h-1;$$t.$q.f(i,b,c,d,k,n,g);k=n+1}m=l-k+1}return i},f:function(a,b,c,d,e,f,g){var h;var i;if(c){h=0;i=1}else if(d){h=0;i=2}else{h=2;i=3}return $$t.$q.g(a,b,h,i,e,f,g)},g:function(a,b,c,d,e,f,g){if(e>f){return a}var h=b.__inner[e];var i,j;i=h[c];j=h[d];while(($.ig.util.isNaN(i)||$.ig.util.isNaN(j))&&e<f){++e;h=b.__inner[e];i=h[c];j=h[d]}var k=b.__inner[f];var l,m;l=k[c];m=k[d];while(($.ig.util.isNaN(l)||$.ig.util.isNaN(m))&&e<f){--f;k=b.__inner[f];l=k[c];m=k[d]}if(e==f){a.add(e);return a}a.add(e);$$t.$q.i(a,b,c,d,e,f,g);a.add(f);return a},h:function(a,b,c,d,e,f){var g=b[d];var h=c[d];while(($.ig.util.isNaN(g)||$.ig.util.isNaN(h))&&d<e){++d;g=b[d];h=c[d]}var i=b[e];var j=c[e];while(($.ig.util.isNaN(i)||$.ig.util.isNaN(j))&&d<e){--e;i=b[e];j=c[e]}if(d+1>=e){return}var k=-1;var l=f*f;var m;var n;m=i-g;n=j-h;var o=m*m+n*n;if(o==0){for(var p=d+1;p<e;++p){var q=b[p];var r=c[p];if($.ig.util.isNaN(q)||$.ig.util.isNaN(r)){continue}m=i-q;n=j-r;var s=m*m+n*n;if(s>=l){l=s;k=p}}}else{var t=i-g;var u=j-h;for(var v=d+1;v<e;++v){var w=b[v];var x=c[v];if($.ig.util.isNaN(w)||$.ig.util.isNaN(x)){continue}var y=NaN;var z=b[v]-g;var aa=c[v]-h;var ab=t*z+u*aa;if(ab<=0){m=g-w;n=h-x;y=m*m+n*n}else{var ac=t*t+u*u;if(ac<=ab){m=i-w;n=j-x;y=m*m+n*n}else{var ad=ab/ac;m=g+ad*t-w;n=h+ad*u-x;y=m*m+n*n}}if(y>=l){l=y;k=v}}}if(k!=-1){$$t.$q.h(a,b,c,d,k,f);a.add(k);$$t.$q.h(a,b,c,k,e,f)}return},i:function(a,b,c,d,e,f,g){var h=b.__inner[e];var i,j;i=h[c];j=h[d];while(i!=i||j!=j&&e<f){++e;h=b.__inner[e];i=h[c];j=h[d]}var k=b.__inner[f];var l,m;l=k[c];m=k[d];while(l!=l||m!=m&&e<f){--f;k=b.__inner[f];l=k[c];m=k[d]}if(e+1>=f){return}var n=-1;var o=g*g;var p;var q;p=l-i;q=m-j;var r=p*p+q*q;if(r==0){for(var s=e+1;s<f;++s){var t=b.__inner[s];var u,v;u=t[c];v=t[d];if(u!=u||v!=v){continue}p=l-u;q=m-v;var w=p*p+q*q;if(w>=o){o=w;n=s}}}else{var x=l-i;var y=m-j;for(var z=e+1;z<f;++z){var aa=b.__inner[z];var ab,ac;ab=aa[c];ac=aa[d];if(ab!=ab||ac!=ac){continue}var ad=NaN;var ae=ab-i;var af=ac-j;var ag=x*ae+y*af;if(ag<=0){p=i-ab;q=j-ac;ad=p*p+q*q}else{var ah=x*x+y*y;if(ah<=ag){p=l-ab;q=m-ac;ad=p*p+q*q}else{var ai=ag/ah;p=i+ai*x-ab;q=j+ai*y-ac;ad=p*p+q*q}}if(ad>=o){o=ad;n=z}}}if(n!=-1){$$t.$q.i(a,b,c,d,e,n,g);a.add(n);$$t.$q.i(a,b,c,d,n,f,g)}return},$type:new $.ig.Type("FastFlattener",$.ig.$ot)},true);$c("SpiralFlattener:r","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a,b,c,d,e){if($.ig.util.isNaN(e)||e<=0){e=1}var f=new $$4.x(Number,0);var g=new $$4.aa($$t.$s.$type);var h=(d-b)/(c-a);var i=b-h*a;var j=h*h;var k=i*i;var l=i*h;g.push(function(){var $ret=new $$t.s;$ret.a=0;$ret.b=1;return $ret}());while(g.count()!=0){var m=g.pop();var n=b+m.a*(d-b);var o=a+m.a*(c-a);var p=o*o;var q=p*o;var r=b+m.b*(d-b);var s=a+m.b*(c-a);var t=s*s;var u=t*s;var v;if(h==0){v=k*(s-o)/2+l*(t-p)/2+j*(u-q)/6}else{v=(Math.pow(i+h*s,3)-Math.pow(i+h*o,3))/(6*h)}var w=.5*n*r*Math.sin(s-o);if(v-w>e){var x=.5*(m.a+m.b);g.push(function(){var $ret=new $$t.s;$ret.a=x;$ret.b=m.b;return $ret}());g.push(function(){var $ret=new $$t.s;$ret.a=m.a;$ret.b=x;return $ret}())}else{f.add(m.a)}}f.add(1);return f},$type:new $.ig.Type("SpiralFlattener",$.ig.$ot)},true);$c("SpiralTodo:s","Object",{init:function(){$.ig.$op.init.call(this)},a:0,b:0,$type:new $.ig.Type("SpiralTodo",$.ig.$ot)},true);$c("FlattenerSettings:t","Object",{init:function(){$.ig.$op.init.call(this);this.chunkingAmount(3e3)},instance:function(){if($$t.$t.a==null){$$t.$t.a=new $$t.t}return $$t.$t.a},_chunkingAmount:0,chunkingAmount:function(a){if(arguments.length===1){this._chunkingAmount=a;return a}else{return this._chunkingAmount}},$type:new $.ig.Type("FlattenerSettings",$.ig.$ot)},true);$c("GeometryUtil:u","Object",{init:function(){$.ig.$op.init.call(this)},i:function(a){if($.ig.util.isNaN(a)||Number.isInfinity(a)){return a}while(a>360){a-=360}while(a<0){a+=360}return a},c:function(a){return Math.atan(a)},j:function(a,b){return(b.__y-a.__y)/(b.__x-a.__x)},e:function(a){return 1-Math.pow(a.height()/2,2)/Math.pow(a.width()/2,2)},p:function(a,b,c,d,e){var f=Math.cos(a);var g=Math.sin(a);var h=Math.sqrt(d*d/(1-b*Math.pow(f,2)));h*=e;return{__x:h*f+c.__x,__y:h*g+c.__y,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},l:function(a,b,c,d,e){var f;if(c){f=$$t.$u.m({__x:a/2,__y:b/2,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName},d,e)}else{f={__x:a/2,__y:b/2,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}}return f},m:function(a,b,c){b=b/180*Math.PI;var d=a.__y+c*Math.sin(b);var e=a.__x+c*Math.cos(b);return{__x:e,__y:d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},o:function(a,b,c){var d=b.__x-a.__x;var e=b.__y-a.__y;var f=Math.sqrt(d*d+e*e);d=d/f*c;e=e/f*c;return{__x:a.__x+d,__y:a.__y+e,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},g:function(a,b){var c=Math.abs(b.__x-a.__x);var d=Math.abs(b.__y-a.__y);return Math.sqrt(c*c+d*d)},n:function(a,b,c,d,e){return $.ig.CoreGeometryUtil.prototype.b(a,b,c,d,e)},f:function(a,b){var c=Math.sqrt(Math.pow(b.__x-a.__x,2)+Math.pow(b.__y-a.__y,2));
var d=Math.acos((b.__x-a.__x)/c);if(b.__y-a.__y<0){d=2*Math.PI-d}return d},k:function(a,b,c,d){var e=a.__x-c.__x;var f=a.__y-c.__y;var g=b.__x-c.__x;var h=b.__y-c.__y;var i=g-e;var j=h-f;var k=Math.sqrt(i*i+j*j);var l=e*h-g*f;var m=d*d;var n=k*k;var o=l*l;var p=m*n-o;if(p<0){return new $$6.u($$a.$y.$type,$$a.$y.$type,{__x:NaN,__y:NaN,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName},{__x:NaN,__y:NaN,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName})}var q=1;if(j<0){q=-1}var r=(l*j+q*i*Math.sqrt(p))/n;var s=(l*j-q*i*Math.sqrt(p))/n;var t=(-1*l*i+Math.abs(j)*Math.sqrt(p))/n;var u=(-1*l*i-Math.abs(j)*Math.sqrt(p))/n;return new $$6.u($$a.$y.$type,$$a.$y.$type,{__x:r+c.__x,__y:t+c.__y,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName},{__x:s+c.__x,__y:u+c.__y,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName})},a:function(a,b,c,d){var e=d*d;var f=b.__x;var g=b.__y;var h=c.__x;var i=c.__y;var j=a.__x;var k=a.__y;if(g==i){var l=Math.abs(g-k)<d;var m=j>=Math.min(f,h)-d&&j<=Math.max(f,h)+d;if(l&&m){return true}else{return false}}if(f==h){var n=Math.abs(f-j)<d;var o=k>=Math.min(g,i)-d&&k<=Math.max(g,i)+d;if(n&&o){return true}else{return false}}var p=h-f;var q=i-g;var r=p*p+q*q;if(r==0){return(j-f)*(j-f)+(k-g)*(k-g)<e}var s=((j-f)*p+(k-g)*q)/r;s=s<0?0:s>1?1:s;var t=f+p*s;var u=g+q*s;var v=(t-j)*(t-j)+(u-k)*(u-k);if(v<e){return true}return false},d:function(a,b,c){var d=b.__x;var e=b.__y;var f=c.__x;var g=c.__y;var h=a.__x;var i=a.__y;var j=f-d;var k=g-e;var l=j*j+k*k;if(l==0){return(h-d)*(h-d)+(i-e)*(i-e)}var m=((h-d)*j+(i-e)*k)/l;m=m<0?0:m>1?1:m;var n=d+j*m;var o=e+k*m;var p=(n-h)*(n-h)+(o-i)*(o-i);return p},h:function(a,b,c){var d=b.__x;var e=b.__y;var f=c.__x;var g=c.__y;var h=a.__x;var i=a.__y;var j=f-d;var k=g-e;var l=j*j+k*k;if(l==0){return 0}var m=((h-d)*j+(i-e)*k)/l;m=m<0?0:m>1?1:m;return m},b:function(a,b,c,d){var e;var f;var g=d*d;var h=c.count();if(h==0){return(a.__x-b.__x)*(a.__x-b.__x)+(a.__y-b.__y)*(a.__y-b.__y)<g}var i=a.__x;var j=a.__y;for(var k=0;k<h;k++){if(k==0){f=c.item(k);e=b}else{f=c.item(k);e=c.item(k-1)}var l=e.__x;var m=e.__y;var n=f.__x;var o=f.__y;if(m==o){var p=Math.abs(m-j)<d;var q=i>=Math.min(l,n)-d&&i<=Math.max(l,n)+d;if(p&&q){return true}else{continue}}if(l==n){var r=Math.abs(l-i)<d;var s=j>=Math.min(m,o)-d&&j<=Math.max(m,o)+d;if(r&&s){return true}else{continue}}var t=n-l;var u=o-m;var v=t*t+u*u;if(v==0){return(i-l)*(i-l)+(j-m)*(j-m)<g}var w=((i-l)*t+(j-m)*u)/v;w=w<0?0:w>1?1:w;var x=l+t*w;var y=m+u*w;var z=(x-i)*(x-i)+(y-j)*(y-j);if(z<g){return true}}return false},$type:new $.ig.Type("GeometryUtil",$.ig.$ot)},true);$c("AngleSimplifier:v","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a){if($.ig.util.isNaN(a)||Number.isInfinity(a)){return a}while(a>360){a-=360}while(a<0){a+=360}return a},$type:new $.ig.Type("AngleSimplifier",$.ig.$ot)},true);$c("PathFigureUtil:w","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a){var b=new $$a.a9;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add($$t.$w.a(c))}return b},a:function(a){if(a==null){return null}var b=new $$a.bc;var d=a.__segments.getEnumerator();while(d.moveNext()){var c=d.current();switch(c.a()){case 4:var e=c;var f=new $$a.bh;f._b=e._b;f._e=e._e;f._c=e._c;f._f=e._f;f._d=e._d;b.add(f);break;case 0:var g=c;var h=new $$a.bd(1);h.c(g.c());b.add(h);break;case 3:var i=c;var j=new $$a.bg;var l=i.__points.getEnumerator();while(l.moveNext()){var k=l.current();j.__points.add(k)}b.add(j);break}}return function(){var $ret=new $$a.a8;$ret.isClosed(a.__isClosed);$ret.isFilled(a.__isFilled);$ret.startPoint(a.__startPoint);$ret.segments(b);return $ret}()},$type:new $.ig.Type("PathFigureUtil",$.ig.$ot)},true);$c("PolygonUtil:x","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a,b){if(a==null){return false}var c=a.count();if(c<4){return false}var d=false;for(var e=0,f=c-1;e<c;f=e++){if(a.item(e).__y>b.__y!=a.item(f).__y>b.__y&&b.__x<(a.item(f).__x-a.item(e).__x)*(b.__y-a.item(e).__y)/(a.item(f).__y-a.item(e).__y)+a.item(e).__x){d=!d}}return d},a:function(a,b){if(a==null){return false}var c=a.length;if(c<4){return false}var d=false;for(var e=0,f=c-1;e<c;f=e++){if(a[e].__y>b.__y!=a[f].__y>b.__y&&b.__x<(a[f].__x-a[e].__x)*(b.__y-a[e].__y)/(a[f].__y-a[e].__y)+a[e].__x){d=!d}}return d},$type:new $.ig.Type("PolygonUtil",$.ig.$ot)},true);$c("PolySimplification:y","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a,b){var c=a._c;var d=a._d;if(c.length==0){return 0}var e=0;var f=0;var g=b*b;e++;var h;var i;var j;for(var k=0;k<c.length;k++){h=c[k]-c[f];i=d[k]-d[f];j=h*h+i*i;if(j>g){c[e]=c[k];d[e]=d[k];e++;f=k}}return e},a:function(a,b){var c=b.__x-a.__x;var d=b.__y-a.__y;return c*c+d*d},$type:new $.ig.Type("PolySimplification",$.ig.$ot)},true);$c("ISmartPlaceable:ab","Object",{$type:new $.ig.Type("ISmartPlaceable",null)},true);$c("SmartPlaceableWrapper$1:z","Object",{$t:null,init:function($t){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}this._elementDesiredSize=new $$a.af;$.ig.$op.init.call(this);this.noWiggle(false)},_noWiggle:false,noWiggle:function(a){if(arguments.length===1){this._noWiggle=a;return a}else{return this._noWiggle}},c:null,element:function(a){if(arguments.length===1){this.c=a;return a}else{return this.c}},_elementLocationResult:null,elementLocationResult:function(a){if(arguments.length===1){this._elementLocationResult=a;return a}else{return this._elementLocationResult}},_originalLocation:null,originalLocation:function(a){if(arguments.length===1){this._originalLocation=a;return a}else{return this._originalLocation}},getSmartPositions:function(){if(this.noWiggle()){return this.$type.getStaticFields($$t.$z.$type).a}else{return this.$type.getStaticFields($$t.$z.$type).b}},_elementDesiredSize:null,elementDesiredSize:function(a){if(arguments.length===1){this._elementDesiredSize=a;return a}else{return this._elementDesiredSize}},k:function(){return this.elementDesiredSize()},getSmartBounds:function(a){var b=this.k();var c=b.width();var d=b.height();var e;{e=this.h(a,c,d)}return new $$a.ae(0,this.originalLocation().__x+e.__x,this.originalLocation().__y+e.__y,c,d)},opacity:function(a){if(arguments.length===1){this.element().__opacity=a;return a}else{return this.element().__opacity}},smartPosition:function(a){if(arguments.length===1){this.e=a;var b=this.k();var c=b.height();var d=b.width();var e;{e=this.h(this.e,d,c)}this.elementLocationResult({__x:this.originalLocation().__x+e.__x,__y:this.originalLocation().__y+e.__y,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName});return a}else{return this.e}},e:0,h:function(a,b,c){var d=.25;switch(a){case 0:return{__x:-b*d,__y:-c*d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 1:return{__x:0,__y:-c*d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 2:return{__x:b*d,__y:-c*d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 3:return{__x:-b*d,__y:0,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 4:return{__x:0,__y:0,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 5:return{__x:b*d,__y:0,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 6:return{__x:-b*d,__y:c*d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};case 7:return{__x:0,__y:c*d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName};default:return{__x:b*d,__y:c*d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}}},$type:new $.ig.Type("SmartPlaceableWrapper$1",$.ig.$ot,[$$t.$ab.$type],function(){this.a=[4];this.b=[4,5,2,1,8,7,0,3,6]})},true);$c("SmartPlacer:ac","Object",{init:function(){this.a=new $$4.x($$a.$ae.$type,0);$.ig.$op.init.call(this);this._e=$$a.$ae.empty();this._c=.3;this._b=2},_e:null,_c:0,_b:0,d:function(a){if(a==null){return}var b=1.7976931348623157e308;var c=$$a.$ae.empty();var d=7;var e=false;var h=a.getSmartPositions();for(var g=0;g<h.length;g++){var f=h[g];var i=a.getSmartBounds(f);if(this._e.isEmpty()||this._e.containsRect(i)){var j=0;var l=this.a.getEnumerator();while(l.moveNext()){var k=l.current();j+=$.ig.RectUtil.prototype.i(i,k)}if(j==0){b=j;d=f;c=i;e=true;break}if(j<b){b=j;d=f;c=i;e=true}}}var m=0;if(e){m=b/$.ig.RectUtil.prototype.e(c)}if(!e||m>this._c){a.opacity(0)}else{if(b>0){a.opacity(Math.pow(1-$.ig.MathUtil.prototype.b(0,m,1),this._b))}else{a.opacity(1)}a.smartPosition(d);this.a.add(c)}},a:null,$type:new $.ig.Type("SmartPlacer",$.ig.$ot)},true);$c("PointCollectionUtil:ad","Object",{init:function(){$.ig.$op.init.call(this)},d:function(a,b,c){if(b==null){return}b.clear();if(a.count()>=2){var d=$$t.$p.d(a.count(),function(e){return a.item(e).__x},function(e){return a.item(e).__y},c);var f=d.getEnumerator();while(f.moveNext()){var e=f.current();b.add(a.item(e))}}},g:function(a){var b=Number.POSITIVE_INFINITY;var c=Number.POSITIVE_INFINITY;var d=Number.NEGATIVE_INFINITY;var e=Number.NEGATIVE_INFINITY;var g=a.getEnumerator();while(g.moveNext()){var f=g.current();b=Math.min(b,f.__x);c=Math.min(c,f.__y);d=Math.max(d,f.__x);e=Math.max(e,f.__y)}if(Number.isInfinity(b)||Number.isInfinity(c)||Number.isInfinity(c)||Number.isInfinity(e)){return $$a.$ae.empty()}return new $$a.ae(0,b,c,d-b,e-c)},h:function(a){var b=$$a.$ae.empty();var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.union($$t.$ad.g(c))}return b},i:function(a){var b=Number.POSITIVE_INFINITY;var c=Number.POSITIVE_INFINITY;var d=Number.NEGATIVE_INFINITY;var e=Number.NEGATIVE_INFINITY;var f;for(var g=0;g<a.count();g++){f=a.item(g);b=Math.min(b,f.__x);c=Math.min(c,f.__y);d=Math.max(d,f.__x);e=Math.max(e,f.__y)}if(Number.isInfinity(b)||Number.isInfinity(c)||Number.isInfinity(c)||Number.isInfinity(e)){return $$a.$ae.empty()}return new $$a.ae(0,b,c,d-b,e-c)},j:function(a){if(a==null){return $$a.$ae.empty()}var b=$$a.$ae.empty();var c;for(var d=0;d<a.count();d++){c=a.__inner[d];b.union($$t.$ad.i(c))}return b},k:function(a){var b=$$a.$ae.empty();var c;for(var d=0;d<a.count();d++){c=a.__inner[d];b.union($$t.$ad.i(c))}return b},c:function(a,b,c){var d=a.count();for(var e=0;e<d;e++){c.j(a.item(e))}c.i(null)},e:function(a){var b=0;var c=0;var d=0;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();b+=e.__x;c+=e.__y;d+=1}return{__x:b/d,__y:c/d,$type:$$a.$y.$type,getType:$.ig.$op.getType,getGetHashCode:$.ig.$op.getGetHashCode,typeName:$.ig.$op.typeName}},f:function(a){var b=new $$a.z(0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},b:function(a){var b=new $$4.x($$a.$y.$type,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},a:function(a){var b=new $$4.x($$a.$z.$type,0);var c;var d=a.count();for(var e=0;e<d;e++){c=a.__inner[e];var f=new $$a.z(1,c);b.add(f)}return b},$type:new $.ig.Type("PointCollectionUtil",$.ig.$ot)},true);$$t.$c.ao=new $$6.s(0);$$t.$t.a=null});