(function(){var bo,cv=function(){return dc.__string_rec(this,"")};function dX(ec,ea){var eb=function(){return eb.method.apply(eb.scope,arguments)};eb.scope=ec;eb.method=ea;return eb}window.js=js={_Boot:{}};window.zpp_nape=zpp_nape={shape:{},constraint:{},geom:{},phys:{},dynamics:{},callbacks:{},util:{},space:{}};window.sandbox=sandbox={};window.nape=nape={shape:{},constraint:{},geom:{},phys:{},dynamics:{},callbacks:{},space:{},util:{}};var bm=bm=function(){};bm.__name__=["Reflect"];bm.field=function(ec,eb){try{return ec[eb]}catch(ea){return null}};bm.fields=function(ed){var ea=[];if(ed!=null){var ec=Object.prototype.hasOwnProperty;for(var eb in ed){if(eb!="__id__"&&eb!="hx__closures__"&&ec.call(ed,eb)){ea.push(eb)}}}return ea};bm.copy=function(ee){var ea={};var ed=0;var ec=bm.fields(ee);while(ed>>=4;if(!(ec>0)){break}}if(eb!=null){while(ea.length=5){return"<...>"}var ee=typeof(ei);if(ee=="function"&&(ei.__name__||ei.__ename__)){ee="object"}switch(ee){case"function":return"";case"object":if(ei instanceof Array){if(ei.__enum__){if(ei.length==2){return ei[0]}var ej=ei[0]+"(";ef+="\t";var eh=2;var ed=ei.length;while(eh0?",":"")+dc.__string_rec(ei[ek],ef)}eb+="]";return eb}var eq;try{eq=ei.toString}catch(er){return"???"}if(eq!=null&&eq!=Object.toString&&typeof(eq)=="function"){var ec=ei.toString();if(ec!="[object Object]"){return ec}}var en=null;var ea="{\n";ef+="\t";var es=ei.hasOwnProperty!=null;for(var en in ei){if(es&&!ei.hasOwnProperty(en)){continue}if(en=="prototype"||en=="__class__"||en=="__super__"||en=="__interfaces__"||en=="__properties__"){continue}if(ea.length!=2){ea+=", \n"}ea+=ef+en+" : "+dc.__string_rec(ei[en],ef)}ef=ef.substring(1);ea+="\n"+ef+"}";return ea;case"string":return ei;default:return String(ei)}};dc.__interfLoop=function(ef,eb){if(ef==null){return false}if(ef==eb){return true}var ea=ef.__interfaces__;if(ea!=null){var ed=0;var ee=ea.length;while(edec.jointMax){eb-=ec.jointMax;ec.scale=1;ea=false}else{ec.scale=0;eb=0;ea=true}}}return ea};aA.prototype.impulse=function(){var ea=new bY(1,1);ea.zpp_inner.x[0*ea.zpp_inner.n]=this.zpp_inner_zn.jAcc;return ea};aA.prototype.bodyImpulse=function(ea){if(!this.zpp_inner.active){return q.get(0,0,0)}else{return this.zpp_inner_zn.bodyImpulse(ea.zpp_inner)}};aA.prototype.visitBodies=function(ea){if((this.zpp_inner_zn.b1==null?null:this.zpp_inner_zn.b1.outer)!=null){ea(this.zpp_inner_zn.b1==null?null:this.zpp_inner_zn.b1.outer)}if((this.zpp_inner_zn.b2==null?null:this.zpp_inner_zn.b2.outer)!=null&&(this.zpp_inner_zn.b2==null?null:this.zpp_inner_zn.b2.outer)!=(this.zpp_inner_zn.b1==null?null:this.zpp_inner_zn.b1.outer)){ea(this.zpp_inner_zn.b2==null?null:this.zpp_inner_zn.b2.outer)}};Object.defineProperty(aA.prototype,"body1",{get:aA.prototype.get_body1,set:aA.prototype.set_body1});Object.defineProperty(aA.prototype,"body2",{get:aA.prototype.get_body2,set:aA.prototype.set_body2});Object.defineProperty(aA.prototype,"jointMin",{get:aA.prototype.get_jointMin,set:aA.prototype.set_jointMin});Object.defineProperty(aA.prototype,"jointMax",{get:aA.prototype.get_jointMax,set:aA.prototype.set_jointMax});Object.defineProperty(aA.prototype,"ratio",{get:aA.prototype.get_ratio,set:aA.prototype.set_ratio});aA.prototype.__class__=aA;var bO=nape.constraint.ConstraintIterator=function(){this.zpp_next=null;this.zpp_critical=false;this.zpp_i=0;this.zpp_inner=null};bO.__name__=["nape","constraint","ConstraintIterator"];bO.get=function(ec){var ea;if(bO.zpp_pool==null){aZ.internal=true;var ed=new bO();aZ.internal=false;ea=ed}else{var eb=bO.zpp_pool;bO.zpp_pool=eb.zpp_next;ea=eb}ea.zpp_i=0;ea.zpp_inner=ec;ea.zpp_critical=false;return ea};bO.prototype.zpp_inner=null;bO.prototype.zpp_i=null;bO.prototype.zpp_critical=null;bO.prototype.zpp_next=null;bO.prototype.hasNext=function(){this.zpp_inner.zpp_inner.valmod();var eb=this.zpp_inner;eb.zpp_inner.valmod();if(eb.zpp_inner.zip_length){eb.zpp_inner.zip_length=false;eb.zpp_inner.user_length=eb.zpp_inner.inner.length}var ea=eb.zpp_inner.user_length;this.zpp_critical=true;if(this.zpp_ithis.zpp_inner.ws2.id){return this.zpp_inner.ws2.outer}else{return this.zpp_inner.ws1.outer}};aD.prototype.get_shape2=function(){if(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id){return this.zpp_inner.ws1.outer}else{return this.zpp_inner.ws2.outer}};aD.prototype.get_body1=function(){if(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id){return this.zpp_inner.b2.outer}else{return this.zpp_inner.b1.outer}};aD.prototype.get_body2=function(){if(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id){return this.zpp_inner.b1.outer}else{return this.zpp_inner.b2.outer}};aD.prototype.get_state=function(){var ea=this.zpp_inner.immState;if(ea==5){if(br.PreFlag_ACCEPT==null){br.internal=true;br.PreFlag_ACCEPT=new bq();br.internal=false}return br.PreFlag_ACCEPT}else{if(ea==1){if(br.PreFlag_ACCEPT_ONCE==null){br.internal=true;br.PreFlag_ACCEPT_ONCE=new bq();br.internal=false}return br.PreFlag_ACCEPT_ONCE}else{if(ea==6){if(br.PreFlag_IGNORE==null){br.internal=true;br.PreFlag_IGNORE=new bq();br.internal=false}return br.PreFlag_IGNORE}else{if(br.PreFlag_IGNORE_ONCE==null){br.internal=true;br.PreFlag_IGNORE_ONCE=new bq();br.internal=false}return br.PreFlag_IGNORE_ONCE}}}};aD.prototype.totalImpulse=function(ea,eb){if(eb==null){eb=false}return q.get(0,0,0)};aD.prototype.toString=function(){var ea=this.zpp_inner.type==j.COL?"CollisionArbiter":this.zpp_inner.type==j.FLUID?"FluidArbiter":"SensorArbiter";if(this.zpp_inner.cleared){return ea+"(object-pooled)"}else{var eb=ea+"("+(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id?this.zpp_inner.ws2.outer:this.zpp_inner.ws1.outer).toString()+"|"+(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id?this.zpp_inner.ws1.outer:this.zpp_inner.ws2.outer).toString()+")"+(this.zpp_inner.type==j.COL?"["+["SD","DD"][this.zpp_inner.colarb.stat?0:1]+"]":"")+"<-";var ed=this.zpp_inner.immState;var ec;if(ed==5){if(br.PreFlag_ACCEPT==null){br.internal=true;br.PreFlag_ACCEPT=new bq();br.internal=false}ec=br.PreFlag_ACCEPT}else{if(ed==1){if(br.PreFlag_ACCEPT_ONCE==null){br.internal=true;br.PreFlag_ACCEPT_ONCE=new bq();br.internal=false}ec=br.PreFlag_ACCEPT_ONCE}else{if(ed==6){if(br.PreFlag_IGNORE==null){br.internal=true;br.PreFlag_IGNORE=new bq();br.internal=false}ec=br.PreFlag_IGNORE}else{if(br.PreFlag_IGNORE_ONCE==null){br.internal=true;br.PreFlag_IGNORE_ONCE=new bq();br.internal=false}ec=br.PreFlag_IGNORE_ONCE}}}return eb+ec.toString()}};Object.defineProperty(aD.prototype,"isSleeping",{get:aD.prototype.get_isSleeping});Object.defineProperty(aD.prototype,"type",{get:aD.prototype.get_type});Object.defineProperty(aD.prototype,"collisionArbiter",{get:aD.prototype.get_collisionArbiter});Object.defineProperty(aD.prototype,"fluidArbiter",{get:aD.prototype.get_fluidArbiter});Object.defineProperty(aD.prototype,"shape1",{get:aD.prototype.get_shape1});Object.defineProperty(aD.prototype,"shape2",{get:aD.prototype.get_shape2});Object.defineProperty(aD.prototype,"body1",{get:aD.prototype.get_body1});Object.defineProperty(aD.prototype,"body2",{get:aD.prototype.get_body2});Object.defineProperty(aD.prototype,"state",{get:aD.prototype.get_state});aD.prototype.__class__=aD;var d0=nape.dynamics.ArbiterIterator=function(){this.zpp_next=null;this.zpp_critical=false;this.zpp_i=0;this.zpp_inner=null};d0.__name__=["nape","dynamics","ArbiterIterator"];d0.get=function(ec){var ea;if(d0.zpp_pool==null){U.internal=true;var ed=new d0();U.internal=false;ea=ed}else{var eb=d0.zpp_pool;d0.zpp_pool=eb.zpp_next;ea=eb}ea.zpp_i=0;ea.zpp_inner=ec;ea.zpp_critical=false;return ea};d0.prototype.zpp_inner=null;d0.prototype.zpp_i=null;d0.prototype.zpp_critical=null;d0.prototype.zpp_next=null;d0.prototype.hasNext=function(){this.zpp_inner.zpp_inner.valmod();var ea=this.zpp_inner.zpp_gl();this.zpp_critical=true;if(this.zpp_ithis.zpp_inner.ws2.id?this.zpp_inner.ws2.outer:this.zpp_inner.ws1.outer).zpp_inner.type!=1||(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id?this.zpp_inner.ws2.outer:this.zpp_inner.ws1.outer).zpp_inner!=ea.polygon)){ea=this.zpp_inner.colarb.__ref_edge2}if(ea==null){return null}else{return ea.wrapper()}};ak.prototype.get_referenceEdge2=function(){var ea=this.zpp_inner.colarb.__ref_edge1;if(ea!=null&&((this.zpp_inner.ws1.id>this.zpp_inner.ws2.id?this.zpp_inner.ws1.outer:this.zpp_inner.ws2.outer).zpp_inner.type!=1||(this.zpp_inner.ws1.id>this.zpp_inner.ws2.id?this.zpp_inner.ws1.outer:this.zpp_inner.ws2.outer).zpp_inner!=ea.polygon)){ea=this.zpp_inner.colarb.__ref_edge2}if(ea==null){return null}else{return ea.wrapper()}};ak.prototype.firstVertex=function(){if(this.zpp_inner.colarb.__ref_edge1!=null!=(this.zpp_inner.colarb.__ref_edge2!=null)){return this.zpp_inner.colarb.__ref_vertex==-1}else{return false}};ak.prototype.secondVertex=function(){if(this.zpp_inner.colarb.__ref_edge1!=null!=(this.zpp_inner.colarb.__ref_edge2!=null)){return this.zpp_inner.colarb.__ref_vertex==1}else{return false}};ak.prototype.normalImpulse=function(ef,eb){if(eb==null){eb=false}var em=0;var ek=0;var ei=0;var en=this.zpp_inner.colarb;if(!eb||en.oc1.fresh){var ea=en.oc1.wrapper().normalImpulse(ef);var eh=ea.zpp_inner;if(eh._validate!=null){eh._validate()}em+=ea.zpp_inner.x;var el=ea.zpp_inner;if(el._validate!=null){el._validate()}ek+=ea.zpp_inner.y;var ej=ea.zpp_inner;if(ej._validate!=null){ej._validate()}ei+=ea.zpp_inner.z;ea.dispose()}if(en.hc2){if(!eb||en.oc2.fresh){var ec=en.oc2.wrapper().normalImpulse(ef);var eg=ec.zpp_inner;if(eg._validate!=null){eg._validate()}em+=ec.zpp_inner.x;var ee=ec.zpp_inner;if(ee._validate!=null){ee._validate()}ek+=ec.zpp_inner.y;var ed=ec.zpp_inner;if(ed._validate!=null){ed._validate()}ei+=ec.zpp_inner.z;ec.dispose()}}return q.get(em,ek,ei)};ak.prototype.tangentImpulse=function(ef,eb){if(eb==null){eb=false}var em=0;var ek=0;var ei=0;var en=this.zpp_inner.colarb;if(!eb||en.oc1.fresh){var ea=en.oc1.wrapper().tangentImpulse(ef);var eh=ea.zpp_inner;if(eh._validate!=null){eh._validate()}em+=ea.zpp_inner.x;var el=ea.zpp_inner;if(el._validate!=null){el._validate()}ek+=ea.zpp_inner.y;var ej=ea.zpp_inner;if(ej._validate!=null){ej._validate()}ei+=ea.zpp_inner.z;ea.dispose()}if(en.hc2){if(!eb||en.oc2.fresh){var ec=en.oc2.wrapper().tangentImpulse(ef);var eg=ec.zpp_inner;if(eg._validate!=null){eg._validate()}em+=ec.zpp_inner.x;var ee=ec.zpp_inner;if(ee._validate!=null){ee._validate()}ek+=ec.zpp_inner.y;var ed=ec.zpp_inner;if(ed._validate!=null){ed._validate()}ei+=ec.zpp_inner.z;ec.dispose()}}return q.get(em,ek,ei)};ak.prototype.totalImpulse=function(ef,eb){if(eb==null){eb=false}var em=0;var ek=0;var ei=0;var en=this.zpp_inner.colarb;if(!eb||en.oc1.fresh){var ea=en.oc1.wrapper().totalImpulse(ef);var eh=ea.zpp_inner;if(eh._validate!=null){eh._validate()}em+=ea.zpp_inner.x;var el=ea.zpp_inner;if(el._validate!=null){el._validate()}ek+=ea.zpp_inner.y;var ej=ea.zpp_inner;if(ej._validate!=null){ej._validate()}ei+=ea.zpp_inner.z;ea.dispose()}if(en.hc2){if(!eb||en.oc2.fresh){var ec=en.oc2.wrapper().totalImpulse(ef);var eg=ec.zpp_inner;if(eg._validate!=null){eg._validate()}em+=ec.zpp_inner.x;var ee=ec.zpp_inner;if(ee._validate!=null){ee._validate()}ek+=ec.zpp_inner.y;var ed=ec.zpp_inner;if(ed._validate!=null){ed._validate()}ei+=ec.zpp_inner.z;ec.dispose()}}return q.get(em,ek,ei)};ak.prototype.rollingImpulse=function(ea,eb){if(eb==null){eb=false}var ec=this.zpp_inner.colarb;if(!eb||ec.oc1.fresh){return ec.oc1.wrapper().rollingImpulse(ea)}else{return 0}};ak.prototype.get_elasticity=function(){var ea=this.zpp_inner.colarb;if(ea.invalidated){ea.invalidated=false;if(!ea.userdef_restitution){if(ea.s1.material.elasticity<=-Infinity||ea.s2.material.elasticity<=-Infinity){ea.restitution=0}else{if(ea.s1.material.elasticity>=Infinity||ea.s2.material.elasticity>=Infinity){ea.restitution=1}else{ea.restitution=(ea.s1.material.elasticity+ea.s2.material.elasticity)/2}}if(ea.restitution<0){ea.restitution=0}if(ea.restitution>1){ea.restitution=1}}if(!ea.userdef_dyn_fric){ea.dyn_fric=Math.sqrt(ea.s1.material.dynamicFriction*ea.s2.material.dynamicFriction)}if(!ea.userdef_stat_fric){ea.stat_fric=Math.sqrt(ea.s1.material.staticFriction*ea.s2.material.staticFriction)}if(!ea.userdef_rfric){ea.rfric=Math.sqrt(ea.s1.material.rollingFriction*ea.s2.material.rollingFriction)}}return ea.restitution};ak.prototype.set_elasticity=function(eb){var ea=this.zpp_inner.colarb;ea.restitution=eb;ea.userdef_restitution=true;var ec=this.zpp_inner.colarb;if(ec.invalidated){ec.invalidated=false;if(!ec.userdef_restitution){if(ec.s1.material.elasticity<=-Infinity||ec.s2.material.elasticity<=-Infinity){ec.restitution=0}else{if(ec.s1.material.elasticity>=Infinity||ec.s2.material.elasticity>=Infinity){ec.restitution=1}else{ec.restitution=(ec.s1.material.elasticity+ec.s2.material.elasticity)/2}}if(ec.restitution<0){ec.restitution=0}if(ec.restitution>1){ec.restitution=1}}if(!ec.userdef_dyn_fric){ec.dyn_fric=Math.sqrt(ec.s1.material.dynamicFriction*ec.s2.material.dynamicFriction)}if(!ec.userdef_stat_fric){ec.stat_fric=Math.sqrt(ec.s1.material.staticFriction*ec.s2.material.staticFriction)}if(!ec.userdef_rfric){ec.rfric=Math.sqrt(ec.s1.material.rollingFriction*ec.s2.material.rollingFriction)}}return ec.restitution};ak.prototype.get_dynamicFriction=function(){var ea=this.zpp_inner.colarb;if(ea.invalidated){ea.invalidated=false;if(!ea.userdef_restitution){if(ea.s1.material.elasticity<=-Infinity||ea.s2.material.elasticity<=-Infinity){ea.restitution=0}else{if(ea.s1.material.elasticity>=Infinity||ea.s2.material.elasticity>=Infinity){ea.restitution=1}else{ea.restitution=(ea.s1.material.elasticity+ea.s2.material.elasticity)/2}}if(ea.restitution<0){ea.restitution=0}if(ea.restitution>1){ea.restitution=1}}if(!ea.userdef_dyn_fric){ea.dyn_fric=Math.sqrt(ea.s1.material.dynamicFriction*ea.s2.material.dynamicFriction)}if(!ea.userdef_stat_fric){ea.stat_fric=Math.sqrt(ea.s1.material.staticFriction*ea.s2.material.staticFriction)}if(!ea.userdef_rfric){ea.rfric=Math.sqrt(ea.s1.material.rollingFriction*ea.s2.material.rollingFriction)}}return ea.dyn_fric};ak.prototype.set_dynamicFriction=function(ea){var eb=this.zpp_inner.colarb;eb.dyn_fric=ea;eb.userdef_dyn_fric=true;var ec=this.zpp_inner.colarb;if(ec.invalidated){ec.invalidated=false;if(!ec.userdef_restitution){if(ec.s1.material.elasticity<=-Infinity||ec.s2.material.elasticity<=-Infinity){ec.restitution=0}else{if(ec.s1.material.elasticity>=Infinity||ec.s2.material.elasticity>=Infinity){ec.restitution=1}else{ec.restitution=(ec.s1.material.elasticity+ec.s2.material.elasticity)/2}}if(ec.restitution<0){ec.restitution=0}if(ec.restitution>1){ec.restitution=1}}if(!ec.userdef_dyn_fric){ec.dyn_fric=Math.sqrt(ec.s1.material.dynamicFriction*ec.s2.material.dynamicFriction)}if(!ec.userdef_stat_fric){ec.stat_fric=Math.sqrt(ec.s1.material.staticFriction*ec.s2.material.staticFriction)}if(!ec.userdef_rfric){ec.rfric=Math.sqrt(ec.s1.material.rollingFriction*ec.s2.material.rollingFriction)}}return ec.dyn_fric};ak.prototype.get_staticFriction=function(){var ea=this.zpp_inner.colarb;if(ea.invalidated){ea.invalidated=false;if(!ea.userdef_restitution){if(ea.s1.material.elasticity<=-Infinity||ea.s2.material.elasticity<=-Infinity){ea.restitution=0}else{if(ea.s1.material.elasticity>=Infinity||ea.s2.material.elasticity>=Infinity){ea.restitution=1}else{ea.restitution=(ea.s1.material.elasticity+ea.s2.material.elasticity)/2}}if(ea.restitution<0){ea.restitution=0}if(ea.restitution>1){ea.restitution=1}}if(!ea.userdef_dyn_fric){ea.dyn_fric=Math.sqrt(ea.s1.material.dynamicFriction*ea.s2.material.dynamicFriction)}if(!ea.userdef_stat_fric){ea.stat_fric=Math.sqrt(ea.s1.material.staticFriction*ea.s2.material.staticFriction)}if(!ea.userdef_rfric){ea.rfric=Math.sqrt(ea.s1.material.rollingFriction*ea.s2.material.rollingFriction)}}return ea.stat_fric};ak.prototype.set_staticFriction=function(ec){var ea=this.zpp_inner.colarb;ea.stat_fric=ec;ea.userdef_stat_fric=true;var eb=this.zpp_inner.colarb;if(eb.invalidated){eb.invalidated=false;if(!eb.userdef_restitution){if(eb.s1.material.elasticity<=-Infinity||eb.s2.material.elasticity<=-Infinity){eb.restitution=0}else{if(eb.s1.material.elasticity>=Infinity||eb.s2.material.elasticity>=Infinity){eb.restitution=1}else{eb.restitution=(eb.s1.material.elasticity+eb.s2.material.elasticity)/2}}if(eb.restitution<0){eb.restitution=0}if(eb.restitution>1){eb.restitution=1}}if(!eb.userdef_dyn_fric){eb.dyn_fric=Math.sqrt(eb.s1.material.dynamicFriction*eb.s2.material.dynamicFriction)}if(!eb.userdef_stat_fric){eb.stat_fric=Math.sqrt(eb.s1.material.staticFriction*eb.s2.material.staticFriction)}if(!eb.userdef_rfric){eb.rfric=Math.sqrt(eb.s1.material.rollingFriction*eb.s2.material.rollingFriction)}}return eb.stat_fric};ak.prototype.get_rollingFriction=function(){var ea=this.zpp_inner.colarb;if(ea.invalidated){ea.invalidated=false;if(!ea.userdef_restitution){if(ea.s1.material.elasticity<=-Infinity||ea.s2.material.elasticity<=-Infinity){ea.restitution=0}else{if(ea.s1.material.elasticity>=Infinity||ea.s2.material.elasticity>=Infinity){ea.restitution=1}else{ea.restitution=(ea.s1.material.elasticity+ea.s2.material.elasticity)/2}}if(ea.restitution<0){ea.restitution=0}if(ea.restitution>1){ea.restitution=1}}if(!ea.userdef_dyn_fric){ea.dyn_fric=Math.sqrt(ea.s1.material.dynamicFriction*ea.s2.material.dynamicFriction)}if(!ea.userdef_stat_fric){ea.stat_fric=Math.sqrt(ea.s1.material.staticFriction*ea.s2.material.staticFriction)}if(!ea.userdef_rfric){ea.rfric=Math.sqrt(ea.s1.material.rollingFriction*ea.s2.material.rollingFriction)}}return ea.rfric};ak.prototype.set_rollingFriction=function(ec){var ea=this.zpp_inner.colarb;ea.rfric=ec;ea.userdef_rfric=true;var eb=this.zpp_inner.colarb;if(eb.invalidated){eb.invalidated=false;if(!eb.userdef_restitution){if(eb.s1.material.elasticity<=-Infinity||eb.s2.material.elasticity<=-Infinity){eb.restitution=0}else{if(eb.s1.material.elasticity>=Infinity||eb.s2.material.elasticity>=Infinity){eb.restitution=1}else{eb.restitution=(eb.s1.material.elasticity+eb.s2.material.elasticity)/2}}if(eb.restitution<0){eb.restitution=0}if(eb.restitution>1){eb.restitution=1}}if(!eb.userdef_dyn_fric){eb.dyn_fric=Math.sqrt(eb.s1.material.dynamicFriction*eb.s2.material.dynamicFriction)}if(!eb.userdef_stat_fric){eb.stat_fric=Math.sqrt(eb.s1.material.staticFriction*eb.s2.material.staticFriction)}if(!eb.userdef_rfric){eb.rfric=Math.sqrt(eb.s1.material.rollingFriction*eb.s2.material.rollingFriction)}}return eb.rfric};Object.defineProperty(ak.prototype,"contacts",{get:ak.prototype.get_contacts});Object.defineProperty(ak.prototype,"normal",{get:ak.prototype.get_normal});Object.defineProperty(ak.prototype,"radius",{get:ak.prototype.get_radius});Object.defineProperty(ak.prototype,"referenceEdge1",{get:ak.prototype.get_referenceEdge1});Object.defineProperty(ak.prototype,"referenceEdge2",{get:ak.prototype.get_referenceEdge2});Object.defineProperty(ak.prototype,"elasticity",{get:ak.prototype.get_elasticity,set:ak.prototype.set_elasticity});Object.defineProperty(ak.prototype,"dynamicFriction",{get:ak.prototype.get_dynamicFriction,set:ak.prototype.set_dynamicFriction});Object.defineProperty(ak.prototype,"staticFriction",{get:ak.prototype.get_staticFriction,set:ak.prototype.set_staticFriction});Object.defineProperty(ak.prototype,"rollingFriction",{get:ak.prototype.get_rollingFriction,set:ak.prototype.set_rollingFriction});ak.prototype.__class__=ak;var d8=nape.dynamics.Contact=function(){this.zpp_inner=null};d8.__name__=["nape","dynamics","Contact"];d8.prototype.zpp_inner=null;d8.prototype.get_arbiter=function(){if(this.zpp_inner.arbiter==null){return null}else{var ea=this.zpp_inner.arbiter.outer;if(ea.zpp_inner.type==j.COL){return ea.zpp_inner.colarb.outer_zn}else{return null}}};d8.prototype.get_penetration=function(){return -this.zpp_inner.dist};d8.prototype.get_position=function(){if(this.zpp_inner.wrap_position==null){this.zpp_inner.getposition()}return this.zpp_inner.wrap_position};d8.prototype.get_fresh=function(){return this.zpp_inner.fresh};d8.prototype.normalImpulse=function(eb){var ed=this.zpp_inner.arbiter.colarb;var ea=this.zpp_inner.inner;var ec=ea.jnAcc;if(eb==null){return q.get(ed.nx*ec,ed.ny*ec)}else{if(eb==ed.b1.outer){return q.get(ed.nx*-ec,ed.ny*-ec,-(ed.ny*ea.r1x-ed.nx*ea.r1y)*ec)}else{return q.get(ed.nx*ec,ed.ny*ec,(ed.ny*ea.r2x-ed.nx*ea.r2y)*ec)}}};d8.prototype.tangentImpulse=function(eb){var ed=this.zpp_inner.arbiter.colarb;var ea=this.zpp_inner.inner;var ec=ea.jtAcc;if(eb==null){return q.get(-ed.ny*ec,ed.nx*ec)}else{if(eb==ed.b1.outer){return q.get(ed.ny*ec,-ed.nx*ec,-(ea.r1x*ed.nx+ea.r1y*ed.ny)*ec)}else{return q.get(-ed.ny*ec,ed.nx*ec,(ea.r2x*ed.nx+ea.r2y*ed.ny)*ec)}}};d8.prototype.rollingImpulse=function(eb){var ec=this.zpp_inner.arbiter.colarb;var ea=this.zpp_inner.arbiter.colarb.jrAcc;if(eb==null){return ea}else{if(eb==ec.b1.outer){return -ea}else{return ea}}};d8.prototype.totalImpulse=function(ec){var eh=this.zpp_inner.arbiter.colarb;var eb=this.zpp_inner.inner;var ed=eb.jnAcc;var eg=eb.jtAcc;var ea=eh.jrAcc;if(ec==null){return q.get(eh.nx*ed-eh.ny*eg,eh.ny*ed+eh.nx*eg,ea)}else{var ef=eh.nx*ed-eh.ny*eg;var ee=eh.ny*ed+eh.nx*eg;if(ec==eh.b1.outer){return q.get(-ef,-ee,-(ee*eb.r1x-ef*eb.r1y)-ea)}else{return q.get(ef,ee,ee*eb.r2x-ef*eb.r2y+ea)}}};d8.prototype.get_friction=function(){return this.zpp_inner.inner.friction};d8.prototype.toString=function(){if(this.zpp_inner.arbiter==null||this.zpp_inner.arbiter.cleared){return"{object-pooled}"}else{return"{Contact}"}};Object.defineProperty(d8.prototype,"arbiter",{get:d8.prototype.get_arbiter});Object.defineProperty(d8.prototype,"penetration",{get:d8.prototype.get_penetration});Object.defineProperty(d8.prototype,"position",{get:d8.prototype.get_position});Object.defineProperty(d8.prototype,"fresh",{get:d8.prototype.get_fresh});Object.defineProperty(d8.prototype,"friction",{get:d8.prototype.get_friction});d8.prototype.__class__=d8;var d5=nape.dynamics.ContactIterator=function(){this.zpp_next=null;this.zpp_critical=false;this.zpp_i=0;this.zpp_inner=null};d5.__name__=["nape","dynamics","ContactIterator"];d5.get=function(ec){var ea;if(d5.zpp_pool==null){aB.internal=true;var ed=new d5();aB.internal=false;ea=ed}else{var eb=d5.zpp_pool;d5.zpp_pool=eb.zpp_next;ea=eb}ea.zpp_i=0;ea.zpp_inner=ec;ea.zpp_critical=false;return ea};d5.prototype.zpp_inner=null;d5.prototype.zpp_i=null;d5.prototype.zpp_critical=null;d5.prototype.zpp_next=null;d5.prototype.hasNext=function(){this.zpp_inner.zpp_inner.valmod();var ed=this.zpp_inner;ed.zpp_inner.valmod();if(ed.zpp_inner.zip_length){ed.zpp_inner.zip_length=false;ed.zpp_inner.user_length=0;var eb=ed.zpp_inner.inner.next;while(eb!=null){var ea=eb;if(ea.active&&ea.arbiter.active){ed.zpp_inner.user_length++}eb=eb.next}}var ec=ed.zpp_inner.user_length;this.zpp_critical=true;if(this.zpp_i1e+100){ez=eX;break}if(eX>0){if(eX>ez){ez=eX;ea=fz}}else{if(ez<0&&eX>ez){ez=eX;ea=fz}}f0=f0.next}if(ez<1e+100){var fR=ea.gp0;var fP=ea.gp1;var eL=fu.worldCOMy*ea.gnormx-fu.worldCOMx*ea.gnormy;if(eL<=fR.y*ea.gnormx-fR.x*ea.gnormy){var f6=0;var fZ=0;f6=fu.worldCOMx-fR.x;fZ=fu.worldCOMy-fR.y;var fG=Math.sqrt(f6*f6+fZ*fZ);ez=fG-fu.radius;if(ez<1e+100){if(fG==0){f6=1;fZ=0}else{var ge=1/fG;f6*=ge;fZ*=ge}fp.x=fR.x+f6*0;fp.y=fR.y+fZ*0;var gd=-fu.radius;fo.x=fu.worldCOMx+f6*gd;fo.y=fu.worldCOMy+fZ*gd;eq.x=f6;eq.y=fZ}}else{if(eL>=fP.y*ea.gnormx-fP.x*ea.gnormy){var f5=0;var fX=0;f5=fu.worldCOMx-fP.x;fX=fu.worldCOMy-fP.y;var fF=Math.sqrt(f5*f5+fX*fX);ez=fF-fu.radius;if(ez<1e+100){if(fF==0){f5=1;fX=0}else{var gc=1/fF;f5*=gc;fX*=gc}fp.x=fP.x+f5*0;fp.y=fP.y+fX*0;var gb=-fu.radius;fo.x=fu.worldCOMx+f5*gb;fo.y=fu.worldCOMy+fX*gb;eq.x=f5;eq.y=fX}}else{var f9=-fu.radius;fo.x=fu.worldCOMx+ea.gnormx*f9;fo.y=fu.worldCOMy+ea.gnormy*f9;var f8=-ez;fp.x=fo.x+ea.gnormx*f8;fp.y=fo.y+ea.gnormy*f8;eq.x=ea.gnormx;eq.y=ea.gnormy}}}if(eZ){eq.x=-eq.x;eq.y=-eq.y}fn=ez}else{var fK=ep.polygon;var fI=en.polygon;var fy=-1e+100;var gq=null;var gp=null;var eU=0;var fT=fK.edges.head;while(fT!=null){var go=fT.elt;var gj=1e+100;var fS=fI.gverts.next;while(fS!=null){var fe=fS;var fq=go.gnormx*fe.x+go.gnormy*fe.y;if(fq1e+100){fy=gj;break}if(gj>0){if(gj>fy){fy=gj;gq=go;eU=1}}else{if(fy<0&&gj>fy){fy=gj;gq=go;eU=1}}fT=fT.next}if(fy<1e+100){var fQ=fI.edges.head;while(fQ!=null){var gn=fQ.elt;var fs=1e+100;var fO=fK.gverts.next;while(fO!=null){var fN=fO;var fd=gn.gnormx*fN.x+gn.gnormy*fN.y;if(fd1e+100){fy=fs;break}if(fs>0){if(fs>fy){fy=fs;gp=gn;eU=2}}else{if(fy<0&&fs>fy){fy=fs;gp=gn;eU=2}}fQ=fQ.next}if(fy<1e+100){var fh;var fV;if(eU==1){fh=fI;fV=gq}else{fh=fK;fV=gp;var eM=fp;fp=fo;fo=eM;eZ=!eZ}var fU=null;var fr=1e+100;var fM=fh.edges.head;while(fM!=null){var gl=fM.elt;var fc=fV.gnormx*gl.gnormx+fV.gnormy*gl.gnormy;if(fc=0){var e5=fV.gp0;var es=fV.gp1;var fk=fU.gp0;var fj=fU.gp1;var e4=0;var e3=0;var ei=0;var eh=0;e4=es.x-e5.x;e3=es.y-e5.y;ei=fj.x-fk.x;eh=fj.y-fk.y;var e9=1/(e4*e4+e3*e3);var eW=1/(ei*ei+eh*eh);var eI=-(e4*(e5.x-fk.x)+e3*(e5.y-fk.y))*e9;var gm=-(e4*(e5.x-fj.x)+e3*(e5.y-fj.y))*e9;var eQ=-(ei*(fk.x-e5.x)+eh*(fk.y-e5.y))*eW;var ed=-(ei*(fk.x-es.x)+eh*(fk.y-es.y))*eW;if(eI<0){eI=0}else{if(eI>1){eI=1}}if(gm<0){gm=0}else{if(gm>1){gm=1}}if(eQ<0){eQ=0}else{if(eQ>1){eQ=1}}if(ed<0){ed=0}else{if(ed>1){ed=1}}var e0=0;var eY=0;var f7=eI;e0=e5.x+e4*f7;eY=e5.y+e3*f7;var el=0;var ej=0;var eK=gm;el=e5.x+e4*eK;ej=e5.y+e3*eK;var eT=0;var eP=0;var eG=eQ;eT=fk.x+ei*eG;eP=fk.y+eh*eG;var ef=0;var ec=0;var eE=ed;ef=fk.x+ei*eE;ec=fk.y+eh*eE;var fw=fk.x;var ft=fk.y;var eF=0;var eD=0;eF=e0-fw;eD=eY-ft;var fB=eF*eF+eD*eD;var eV=fj.x;var eg=fj.y;var eB=0;var gk=0;eB=el-eV;gk=ej-eg;var fA=eB*eB+gk*gk;var eS=e5.x;var ee=e5.y;var ey=0;var gi=0;ey=eT-eS;gi=eP-ee;var fb=ey*ey+gi*gi;var eO=es.x;var eb=es.y;var ew=0;var gh=0;ew=ef-eO;gh=ec-eb;var fa=ew*ew+gh*gh;var fJ=0;var fH=0;var eu=null;if(fBP.epsilon){fx+=eo*eA;fv+=em*eA}var ex=(-fV.tp0-fY)*ga;if(ex<-P.epsilon){e8+=eo*ex;e7+=em*ex}var fL=fx*fV.gnormx+fv*fV.gnormy-fV.gprojection;var fl=e8*fV.gnormx+e7*fV.gnormy-fV.gprojection;if(fL0){while(ea-->0){this.zpp_inner.vertices=this.zpp_inner.vertices.next}}else{if(ea<0){while(ea++<0){this.zpp_inner.vertices=this.zpp_inner.vertices.prev}}}}return this};a7.prototype.skipBackwards=function(ea){return this.skipForward(-ea)};a7.prototype.erase=function(ef){while(ef!=0&&this.zpp_inner.vertices!=null){var ed=this.zpp_inner.vertices;if(ef>0){var ec;if(this.zpp_inner.vertices!=null&&this.zpp_inner.vertices.prev==this.zpp_inner.vertices){this.zpp_inner.vertices.next=this.zpp_inner.vertices.prev=null;ec=this.zpp_inner.vertices=null}else{var eg=this.zpp_inner.vertices.next;this.zpp_inner.vertices.prev.next=this.zpp_inner.vertices.next;this.zpp_inner.vertices.next.prev=this.zpp_inner.vertices.prev;this.zpp_inner.vertices.next=this.zpp_inner.vertices.prev=null;this.zpp_inner.vertices=null;ec=eg}this.zpp_inner.vertices=ec;--ef}else{if(ef<0){var ee;if(this.zpp_inner.vertices!=null&&this.zpp_inner.vertices.prev==this.zpp_inner.vertices){this.zpp_inner.vertices.next=this.zpp_inner.vertices.prev=null;ee=null}else{var eb=this.zpp_inner.vertices.prev;this.zpp_inner.vertices.prev.next=this.zpp_inner.vertices.next;this.zpp_inner.vertices.next.prev=this.zpp_inner.vertices.prev;this.zpp_inner.vertices.next=this.zpp_inner.vertices.prev=null;this.zpp_inner.vertices=null;ee=eb}this.zpp_inner.vertices=ee;++ef}}if(ed.wrap!=null){ed.wrap.zpp_inner._inuse=false;var eh=ed.wrap;var ea=eh.zpp_inner;eh.zpp_inner.outer=null;eh.zpp_inner=null;eh.zpp_pool=au.poolVec2;au.poolVec2=eh;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea;ed.wrap=null}ed.prev=ed.next=null;ed.next=dr.zpp_pool;dr.zpp_pool=ed}return this};a7.prototype.clear=function(){while(this.zpp_inner.vertices!=null){var eb=this.zpp_inner.vertices;var ec;if(this.zpp_inner.vertices!=null&&this.zpp_inner.vertices.prev==this.zpp_inner.vertices){this.zpp_inner.vertices.next=this.zpp_inner.vertices.prev=null;ec=this.zpp_inner.vertices=null}else{var ed=this.zpp_inner.vertices.next;this.zpp_inner.vertices.prev.next=this.zpp_inner.vertices.next;this.zpp_inner.vertices.next.prev=this.zpp_inner.vertices.prev;this.zpp_inner.vertices.next=this.zpp_inner.vertices.prev=null;this.zpp_inner.vertices=null;ec=ed}this.zpp_inner.vertices=ec;if(eb.wrap!=null){eb.wrap.zpp_inner._inuse=false;var ee=eb.wrap;var ea=ee.zpp_inner;ee.zpp_inner.outer=null;ee.zpp_inner=null;ee.zpp_pool=au.poolVec2;au.poolVec2=ee;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea;eb.wrap=null}eb.prev=eb.next=null;eb.next=dr.zpp_pool;dr.zpp_pool=eb}return this};a7.prototype.copy=function(){var ec=a7.get();var ei=this.zpp_inner.vertices;var ed=this.zpp_inner.vertices;if(ei!=null){var ea=ei;while(true){var eh=ea;var eg=eh.x;var ee=eh.y;var ef;if(dr.zpp_pool==null){ef=new dr()}else{ef=dr.zpp_pool;dr.zpp_pool=ef.next;ef.next=null}ef.forced=false;ef.x=eg;ef.y=ee;var eb=ef;if(ec.zpp_inner.vertices==null){ec.zpp_inner.vertices=eb.prev=eb.next=eb}else{eb.prev=ec.zpp_inner.vertices;eb.next=ec.zpp_inner.vertices.next;ec.zpp_inner.vertices.next.prev=eb;ec.zpp_inner.vertices.next=eb}ec.zpp_inner.vertices=eb;ea=ea.next;if(!(ea!=ed)){break}}}return ec.skipForward(1)};a7.prototype.dispose=function(){this.clear();var ea=this;ea.zpp_pool=au.poolGeomPoly;au.poolGeomPoly=ea};a7.prototype.toString=function(){var ec="GeomPoly[";var ed=this.zpp_inner.vertices;var ea=this.zpp_inner.vertices;if(ed!=null){var ee=ed;while(true){var eb=ee;if(eb!=this.zpp_inner.vertices){ec+=","}ec+="{"+eb.x+","+eb.y+"}";ee=ee.next;if(!(ee!=ea)){break}}}return ec+"]"};a7.prototype.area=function(){if(this.zpp_inner.vertices==null||this.zpp_inner.vertices.next==null||this.zpp_inner.vertices.prev==this.zpp_inner.vertices.next){return 0}else{var ee=0;var ed=this.zpp_inner.vertices;var ea=this.zpp_inner.vertices;if(ed!=null){var ef=ed;while(true){var eb=ef;ee+=eb.x*(eb.next.y-eb.prev.y);ef=ef.next;if(!(ef!=ea)){break}}}var ec=ee*0.5;if(ec<0){return -ec}else{return ec}}};a7.prototype.winding=function(){if(this.zpp_inner.vertices==null||this.zpp_inner.vertices.next==null||this.zpp_inner.vertices.prev==this.zpp_inner.vertices.next){if(br.Winding_UNDEFINED==null){br.internal=true;br.Winding_UNDEFINED=new X();br.internal=false}return br.Winding_UNDEFINED}else{var ee=0;var ed=this.zpp_inner.vertices;var ea=this.zpp_inner.vertices;if(ed!=null){var ef=ed;while(true){var ec=ef;ee+=ec.x*(ec.next.y-ec.prev.y);ef=ef.next;if(!(ef!=ea)){break}}}var eb=ee*0.5;if(eb>0){if(br.Winding_CLOCKWISE==null){br.internal=true;br.Winding_CLOCKWISE=new X();br.internal=false}return br.Winding_CLOCKWISE}else{if(eb==0){if(br.Winding_UNDEFINED==null){br.internal=true;br.Winding_UNDEFINED=new X();br.internal=false}return br.Winding_UNDEFINED}else{if(br.Winding_ANTICLOCKWISE==null){br.internal=true;br.Winding_ANTICLOCKWISE=new X();br.internal=false}return br.Winding_ANTICLOCKWISE}}}};a7.prototype.contains=function(ek){var ed=ek.zpp_inner;if(ed._validate!=null){ed._validate()}var ej=ek.zpp_inner.x;var ef=ek.zpp_inner;if(ef._validate!=null){ef._validate()}var ei=ek.zpp_inner.y;var ee=false;var el=this.zpp_inner.vertices;var eg=this.zpp_inner.vertices;if(el!=null){var ec=el;while(true){var eb=ec;var ea=eb.prev;if((eb.y=ei||ea.y=ei)&&(eb.x<=ej||ea.x<=ej)){if(eb.x+(ei-eb.y)/(ea.y-eb.y)*(ea.x-eb.x)0){ei=true}else{if(eb<0){ec=true}}if(ei&&ec){ee=false;break}ed=ed.next;if(!(ed!=eh)){break}}}return ee}};a7.prototype.isSimple=function(){if(this.zpp_inner.vertices==null||this.zpp_inner.vertices.next==null||this.zpp_inner.vertices.prev==this.zpp_inner.vertices.next){return true}else{return bv.isSimple(this.zpp_inner.vertices)}};a7.prototype.isMonotone=function(){if(this.zpp_inner.vertices==null||this.zpp_inner.vertices.next==null||this.zpp_inner.vertices.prev==this.zpp_inner.vertices.next){return true}else{return aE.isMonotone(this.zpp_inner.vertices)}};a7.prototype.isDegenerate=function(){if(this.zpp_inner.vertices==null||this.zpp_inner.vertices.next==null||this.zpp_inner.vertices.prev==this.zpp_inner.vertices.next){return true}else{return this.area()eh){eh=ed.x}if(ed.y>eg){eg=ed.y}ef=ef.next;if(!(ef!=ea)){break}}}return new S(ec,eb,eh-ec,eg-eb)};a7.prototype.top=function(){var eb=this.zpp_inner.vertices;var em=this.zpp_inner.vertices.next;var eh=this.zpp_inner.vertices;if(em!=null){var ea=em;while(true){var el=ea;if(el.yej.y){ej=el}ea=ea.next;if(!(ea!=eg)){break}}}if(ej.wrap==null){var ek=ej.x;var ei=ej.y;var ee;if(au.poolVec2==null){ee=new r()}else{ee=au.poolVec2;au.poolVec2=ee.zpp_pool;ee.zpp_pool=null}if(ee.zpp_inner==null){var eh;if(bB.zpp_pool==null){eh=new bB()}else{eh=bB.zpp_pool;bB.zpp_pool=eh.next;eh.next=null}eh.weak=false;eh._immutable=false;eh.x=ek;eh.y=ei;ee.zpp_inner=eh;ee.zpp_inner.outer=ee}else{var eb;var ec=ee.zpp_inner;if(ec._validate!=null){ec._validate()}if(ee.zpp_inner.x==ek){var ef=ee.zpp_inner;if(ef._validate!=null){ef._validate()}eb=ee.zpp_inner.y==ei}else{eb=false}if(!eb){ee.zpp_inner.x=ek;ee.zpp_inner.y=ei;var ed=ee.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}ee.zpp_inner.weak=false;ej.wrap=ee;ej.wrap.zpp_inner._inuse=true;ej.wrap.zpp_inner._invalidate=dX(ej,ej.modwrap);ej.wrap.zpp_inner._validate=dX(ej,ej.getwrap)}return ej.wrap};a7.prototype.left=function(){var eb=this.zpp_inner.vertices;var em=this.zpp_inner.vertices.next;var eh=this.zpp_inner.vertices;if(em!=null){var ea=em;while(true){var el=ea;if(el.xej.x){ej=el}ea=ea.next;if(!(ea!=eg)){break}}}if(ej.wrap==null){var ek=ej.x;var ei=ej.y;var ee;if(au.poolVec2==null){ee=new r()}else{ee=au.poolVec2;au.poolVec2=ee.zpp_pool;ee.zpp_pool=null}if(ee.zpp_inner==null){var eh;if(bB.zpp_pool==null){eh=new bB()}else{eh=bB.zpp_pool;bB.zpp_pool=eh.next;eh.next=null}eh.weak=false;eh._immutable=false;eh.x=ek;eh.y=ei;ee.zpp_inner=eh;ee.zpp_inner.outer=ee}else{var eb;var ec=ee.zpp_inner;if(ec._validate!=null){ec._validate()}if(ee.zpp_inner.x==ek){var ef=ee.zpp_inner;if(ef._validate!=null){ef._validate()}eb=ee.zpp_inner.y==ei}else{eb=false}if(!eb){ee.zpp_inner.x=ek;ee.zpp_inner.y=ei;var ed=ee.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}ee.zpp_inner.weak=false;ej.wrap=ee;ej.wrap.zpp_inner._inuse=true;ej.wrap.zpp_inner._invalidate=dX(ej,ej.modwrap);ej.wrap.zpp_inner._validate=dX(ej,ej.getwrap)}return ej.wrap};a7.prototype.__class__=a7;var bL=nape.geom.GeomPolyIterator=function(){this.zpp_next=null;this.zpp_critical=false;this.zpp_i=0;this.zpp_inner=null};bL.__name__=["nape","geom","GeomPolyIterator"];bL.get=function(ec){var ea;if(bL.zpp_pool==null){dl.internal=true;var ed=new bL();dl.internal=false;ea=ed}else{var eb=bL.zpp_pool;bL.zpp_pool=eb.zpp_next;ea=eb}ea.zpp_i=0;ea.zpp_inner=ec;ea.zpp_critical=false;return ea};bL.prototype.zpp_inner=null;bL.prototype.zpp_i=null;bL.prototype.zpp_critical=null;bL.prototype.zpp_next=null;bL.prototype.hasNext=function(){this.zpp_inner.zpp_inner.valmod();var eb=this.zpp_inner;eb.zpp_inner.valmod();if(eb.zpp_inner.zip_length){eb.zpp_inner.zip_length=false;eb.zpp_inner.user_length=eb.zpp_inner.inner.length}var ea=eb.zpp_inner.user_length;this.zpp_critical=true;if(this.zpp_iP.illConditionedThreshold*ea};cI.prototype.inverse=function(){var ea=1/(this.zpp_inner.a*this.zpp_inner.d-this.zpp_inner.b*this.zpp_inner.c);return new cI(this.zpp_inner.d*ea,-this.zpp_inner.b*ea,-this.zpp_inner.c*ea,this.zpp_inner.a*ea,(this.zpp_inner.b*this.zpp_inner.ty-this.zpp_inner.d*this.zpp_inner.tx)*ea,(this.zpp_inner.c*this.zpp_inner.tx-this.zpp_inner.a*this.zpp_inner.ty)*ea)};cI.prototype.transpose=function(){return new cI(this.zpp_inner.a,this.zpp_inner.c,this.zpp_inner.b,this.zpp_inner.d,-this.zpp_inner.a*this.zpp_inner.tx-this.zpp_inner.c*this.zpp_inner.ty,-this.zpp_inner.b*this.zpp_inner.tx-this.zpp_inner.d*this.zpp_inner.ty)};cI.prototype.concat=function(ea){return new cI(ea.zpp_inner.a*this.zpp_inner.a+ea.zpp_inner.b*this.zpp_inner.c,ea.zpp_inner.a*this.zpp_inner.b+ea.zpp_inner.b*this.zpp_inner.d,ea.zpp_inner.c*this.zpp_inner.a+ea.zpp_inner.d*this.zpp_inner.c,ea.zpp_inner.c*this.zpp_inner.b+ea.zpp_inner.d*this.zpp_inner.d,ea.zpp_inner.a*this.zpp_inner.tx+ea.zpp_inner.b*this.zpp_inner.ty+ea.zpp_inner.tx,ea.zpp_inner.c*this.zpp_inner.tx+ea.zpp_inner.d*this.zpp_inner.ty+ea.zpp_inner.ty)};cI.prototype.transform=function(eu,el,ef){if(ef==null){ef=false}if(el==null){el=false}var eG;if(el){var ex=eu.zpp_inner;if(ex._validate!=null){ex._validate()}var eE=eu.zpp_inner.x*this.zpp_inner.a;var eD=eu.zpp_inner;if(eD._validate!=null){eD._validate()}var eh=eE+eu.zpp_inner.y*this.zpp_inner.b;var eC=eu.zpp_inner;if(eC._validate!=null){eC._validate()}var ep=eu.zpp_inner.x*this.zpp_inner.c;var eA=eu.zpp_inner;if(eA._validate!=null){eA._validate()}var eg=ep+eu.zpp_inner.y*this.zpp_inner.d;var ee;if(au.poolVec2==null){ee=new r()}else{ee=au.poolVec2;au.poolVec2=ee.zpp_pool;ee.zpp_pool=null}if(ee.zpp_inner==null){var ed;if(bB.zpp_pool==null){ed=new bB()}else{ed=bB.zpp_pool;bB.zpp_pool=ed.next;ed.next=null}ed.weak=false;ed._immutable=false;ed.x=eh;ed.y=eg;ee.zpp_inner=ed;ee.zpp_inner.outer=ee}else{var em;var ez=ee.zpp_inner;if(ez._validate!=null){ez._validate()}if(ee.zpp_inner.x==eh){var ey=ee.zpp_inner;if(ey._validate!=null){ey._validate()}em=ee.zpp_inner.y==eg}else{em=false}if(!em){ee.zpp_inner.x=eh;ee.zpp_inner.y=eg;var ew=ee.zpp_inner;if(ew._invalidate!=null){ew._invalidate(ew)}}}ee.zpp_inner.weak=ef;eG=ee}else{var et=eu.zpp_inner;if(et._validate!=null){et._validate()}var ek=eu.zpp_inner.x*this.zpp_inner.a;var er=eu.zpp_inner;if(er._validate!=null){er._validate()}var eB=ek+eu.zpp_inner.y*this.zpp_inner.b+this.zpp_inner.tx;var eo=eu.zpp_inner;if(eo._validate!=null){eo._validate()}var ej=eu.zpp_inner.x*this.zpp_inner.c;var ev=eu.zpp_inner;if(ev._validate!=null){ev._validate()}var ea=ej+eu.zpp_inner.y*this.zpp_inner.d+this.zpp_inner.ty;var ec;if(au.poolVec2==null){ec=new r()}else{ec=au.poolVec2;au.poolVec2=ec.zpp_pool;ec.zpp_pool=null}if(ec.zpp_inner==null){var eb;if(bB.zpp_pool==null){eb=new bB()}else{eb=bB.zpp_pool;bB.zpp_pool=eb.next;eb.next=null}eb.weak=false;eb._immutable=false;eb.x=eB;eb.y=ea;ec.zpp_inner=eb;ec.zpp_inner.outer=ec}else{var ei;var es=ec.zpp_inner;if(es._validate!=null){es._validate()}if(ec.zpp_inner.x==eB){var eq=ec.zpp_inner;if(eq._validate!=null){eq._validate()}ei=ec.zpp_inner.y==ea}else{ei=false}if(!ei){ec.zpp_inner.x=eB;ec.zpp_inner.y=ea;var en=ec.zpp_inner;if(en._invalidate!=null){en._invalidate(en)}}}ec.zpp_inner.weak=ef;eG=ec}if(eu.zpp_inner.weak){var eF=eu.zpp_inner;eu.zpp_inner.outer=null;eu.zpp_inner=null;eu.zpp_pool=au.poolVec2;au.poolVec2=eu;if(eF.outer!=null){eF.outer.zpp_inner=null;eF.outer=null}eF._isimmutable=null;eF._validate=null;eF._invalidate=null;eF.next=bB.zpp_pool;bB.zpp_pool=eF}return eG};cI.prototype.inverseTransform=function(es,el,ef){if(ef==null){ef=false}if(el==null){el=false}var eC=1/(this.zpp_inner.a*this.zpp_inner.d-this.zpp_inner.b*this.zpp_inner.c);var eF;if(el){var ev=es.zpp_inner;if(ev._validate!=null){ev._validate()}var eD=es.zpp_inner.x*this.zpp_inner.d;var eB=es.zpp_inner;if(eB._validate!=null){eB._validate()}var eh=(eD-es.zpp_inner.y*this.zpp_inner.b)*eC;var eA=es.zpp_inner;if(eA._validate!=null){eA._validate()}var eo=es.zpp_inner.y*this.zpp_inner.a;var ey=es.zpp_inner;if(ey._validate!=null){ey._validate()}var eg=(eo-es.zpp_inner.x*this.zpp_inner.c)*eC;var ee;if(au.poolVec2==null){ee=new r()}else{ee=au.poolVec2;au.poolVec2=ee.zpp_pool;ee.zpp_pool=null}if(ee.zpp_inner==null){var ed;if(bB.zpp_pool==null){ed=new bB()}else{ed=bB.zpp_pool;bB.zpp_pool=ed.next;ed.next=null}ed.weak=false;ed._immutable=false;ed.x=eh;ed.y=eg;ee.zpp_inner=ed;ee.zpp_inner.outer=ee}else{var em;var ex=ee.zpp_inner;if(ex._validate!=null){ex._validate()}if(ee.zpp_inner.x==eh){var ew=ee.zpp_inner;if(ew._validate!=null){ew._validate()}em=ee.zpp_inner.y==eg}else{em=false}if(!em){ee.zpp_inner.x=eh;ee.zpp_inner.y=eg;var eu=ee.zpp_inner;if(eu._invalidate!=null){eu._invalidate(eu)}}}ee.zpp_inner.weak=ef;eF=ee}else{var er=es.zpp_inner;if(er._validate!=null){er._validate()}var ej=es.zpp_inner.x-this.zpp_inner.tx;var ep=es.zpp_inner;if(ep._validate!=null){ep._validate()}var ei=es.zpp_inner.y-this.zpp_inner.ty;var ez=(ej*this.zpp_inner.d-ei*this.zpp_inner.b)*eC;var ea=(ei*this.zpp_inner.a-ej*this.zpp_inner.c)*eC;var ec;if(au.poolVec2==null){ec=new r()}else{ec=au.poolVec2;au.poolVec2=ec.zpp_pool;ec.zpp_pool=null}if(ec.zpp_inner==null){var eb;if(bB.zpp_pool==null){eb=new bB()}else{eb=bB.zpp_pool;bB.zpp_pool=eb.next;eb.next=null}eb.weak=false;eb._immutable=false;eb.x=ez;eb.y=ea;ec.zpp_inner=eb;ec.zpp_inner.outer=ec}else{var ek;var en=ec.zpp_inner;if(en._validate!=null){en._validate()}if(ec.zpp_inner.x==ez){var et=ec.zpp_inner;if(et._validate!=null){et._validate()}ek=ec.zpp_inner.y==ea}else{ek=false}if(!ek){ec.zpp_inner.x=ez;ec.zpp_inner.y=ea;var eq=ec.zpp_inner;if(eq._invalidate!=null){eq._invalidate(eq)}}}ec.zpp_inner.weak=ef;eF=ec}if(es.zpp_inner.weak){var eE=es.zpp_inner;es.zpp_inner.outer=null;es.zpp_inner=null;es.zpp_pool=au.poolVec2;au.poolVec2=es;if(eE.outer!=null){eE.outer.zpp_inner=null;eE.outer=null}eE._isimmutable=null;eE._validate=null;eE._invalidate=null;eE.next=bB.zpp_pool;bB.zpp_pool=eE}return eF};cI.prototype.toString=function(){return"{ a: "+this.zpp_inner.a+" b: "+this.zpp_inner.b+" c: "+this.zpp_inner.c+" d: "+this.zpp_inner.d+" tx: "+this.zpp_inner.tx+" ty: "+this.zpp_inner.ty+" }"};cI.prototype.equiorthogonal=function(){if(this.singular()){return false}else{var ea=this.zpp_inner.a*this.zpp_inner.b+this.zpp_inner.c*this.zpp_inner.d;if(ea*ea0){et=-et}var ea=Math.sin(et);var eb=Math.cos(et);var eu=this.zpp_inner.a*eb-this.zpp_inner.c*ea;var ed=this.zpp_inner.b*eb+this.zpp_inner.d*ea;this.zpp_inner.c=this.zpp_inner.c*eb+this.zpp_inner.a*ea;var ep=this.zpp_inner;if(ep._invalidate!=null){ep._invalidate()}this.zpp_inner.a=eu;var eo=this.zpp_inner;if(eo._invalidate!=null){eo._invalidate()}this.zpp_inner.d=this.zpp_inner.d*eb-this.zpp_inner.b*ea;var el=this.zpp_inner;if(el._invalidate!=null){el._invalidate()}this.zpp_inner.b=ed;var ek=this.zpp_inner;if(ek._invalidate!=null){ek._invalidate()}var ej=this.zpp_inner;if(ej._invalidate!=null){ej._invalidate()}}return this};cI.prototype.orthogonalise=function(){if(!this.orthogonal()){var ef=Math.sqrt(this.zpp_inner.a*this.zpp_inner.a+this.zpp_inner.c*this.zpp_inner.c);var ee=Math.sqrt(this.zpp_inner.b*this.zpp_inner.b+this.zpp_inner.d*this.zpp_inner.d);ef=1/ef;ee=1/ee;var ec=this;ec.zpp_inner.a=ec.zpp_inner.a*ef;var em=ec.zpp_inner;if(em._invalidate!=null){em._invalidate()}var ei=this;ei.zpp_inner.c=ei.zpp_inner.c*ef;var er=ei.zpp_inner;if(er._invalidate!=null){er._invalidate()}var eh=this;eh.zpp_inner.b=eh.zpp_inner.b*ee;var eq=eh.zpp_inner;if(eq._invalidate!=null){eq._invalidate()}var eg=this;eg.zpp_inner.d=eg.zpp_inner.d*ee;var ep=eg.zpp_inner;if(ep._invalidate!=null){ep._invalidate()}var es=0.25*Math.PI-0.5*Math.acos((this.zpp_inner.a*this.zpp_inner.b+this.zpp_inner.c*this.zpp_inner.d)/1);if(this.zpp_inner.a*this.zpp_inner.d-this.zpp_inner.b*this.zpp_inner.c>0){es=-es}var ea=Math.sin(es);var eb=Math.cos(es);var et=this.zpp_inner.a*eb-this.zpp_inner.c*ea;var ed=this.zpp_inner.b*eb+this.zpp_inner.d*ea;this.zpp_inner.c=this.zpp_inner.c*eb+this.zpp_inner.a*ea;var eo=this.zpp_inner;if(eo._invalidate!=null){eo._invalidate()}this.zpp_inner.a=et;var en=this.zpp_inner;if(en._invalidate!=null){en._invalidate()}this.zpp_inner.d=this.zpp_inner.d*eb-this.zpp_inner.b*ea;var el=this.zpp_inner;if(el._invalidate!=null){el._invalidate()}this.zpp_inner.b=ed;var ek=this.zpp_inner;if(ek._invalidate!=null){ek._invalidate()}var ej=this.zpp_inner;if(ej._invalidate!=null){ej._invalidate()}}return this};Object.defineProperty(cI.prototype,"a",{get:cI.prototype.get_a,set:cI.prototype.set_a});Object.defineProperty(cI.prototype,"b",{get:cI.prototype.get_b,set:cI.prototype.set_b});Object.defineProperty(cI.prototype,"c",{get:cI.prototype.get_c,set:cI.prototype.set_c});Object.defineProperty(cI.prototype,"d",{get:cI.prototype.get_d,set:cI.prototype.set_d});Object.defineProperty(cI.prototype,"tx",{get:cI.prototype.get_tx,set:cI.prototype.set_tx});Object.defineProperty(cI.prototype,"ty",{get:cI.prototype.get_ty,set:cI.prototype.set_ty});Object.defineProperty(cI.prototype,"determinant",{get:cI.prototype.get_determinant});cI.prototype.__class__=cI;var bY=nape.geom.MatMN=function(ea,eb){this.zpp_inner=null;this.zpp_inner=new bI(ea,eb);this.zpp_inner.outer=this};bY.__name__=["nape","geom","MatMN"];bY.prototype.zpp_inner=null;bY.prototype.get_rows=function(){return this.zpp_inner.m};bY.prototype.get_cols=function(){return this.zpp_inner.n};bY.prototype.x=function(eb,ea){return this.zpp_inner.x[eb*this.zpp_inner.n+ea]};bY.prototype.setx=function(ec,eb,ea){return this.zpp_inner.x[ec*this.zpp_inner.n+eb]=ea};bY.prototype.toString=function(){var eb="{ ";var ea=true;var ef=0;var eg=this.zpp_inner.m;while(ef0.0001){ek.axisx=Math.sin(ek.rot);ek.axisy=Math.cos(ek.rot)}else{var ea=ed*ed;var eb=1-0.5*ea;var ee=1-ea*ea/8;var ef=(eb*ek.axisx+ed*ek.axisy)*ee;ek.axisy=(eb*ek.axisy-ed*ek.axisx)*ee;ek.axisx=ef}}}var ec=ek.shapes.head;while(ec!=null){var el=ec.elt;if(el.type==1){el.polygon.invalidate_gverts();el.polygon.invalidate_gaxi()}el.invalidate_worldCOM();ec=ec.next}ek.zip_worldCOM=true;ek.zip_axis=true;var eh=ek.shapes.head;while(eh!=null){var ei=eh.elt;if(ei.type==1){ei.polygon.invalidate_gverts();ei.polygon.invalidate_gaxi()}ei.invalidate_worldCOM();eh=eh.next}ek.zip_worldCOM=true;ek.sweepTime=0;return this};at.prototype.isStatic=function(){return this.zpp_inner.type==1};at.prototype.isDynamic=function(){return this.zpp_inner.type==2};at.prototype.isKinematic=function(){return this.zpp_inner.type==3};at.prototype.get_shapes=function(){return this.zpp_inner.wrap_shapes};at.prototype.get_compound=function(){if(this.zpp_inner.compound==null){return null}else{return this.zpp_inner.compound.outer}};at.prototype.set_compound=function(ea){if((this.zpp_inner.compound==null?null:this.zpp_inner.compound.outer)!=ea){if((this.zpp_inner.compound==null?null:this.zpp_inner.compound.outer)!=null){(this.zpp_inner.compound==null?null:this.zpp_inner.compound.outer).zpp_inner.wrap_bodies.remove(this)}if(ea!=null){var eb=ea.zpp_inner.wrap_bodies;if(eb.zpp_inner.reverse_flag){eb.push(this)}else{eb.unshift(this)}}}if(this.zpp_inner.compound==null){return null}else{return this.zpp_inner.compound.outer}};at.prototype.get_space=function(){if(this.zpp_inner.space==null){return null}else{return this.zpp_inner.space.outer}};at.prototype.set_space=function(ea){this.zpp_inner.immutable_midstep("Body::space");if((this.zpp_inner.space==null?null:this.zpp_inner.space.outer)!=ea){if((this.zpp_inner.space==null?null:this.zpp_inner.space.outer)!=null){this.zpp_inner.component.woken=false}if((this.zpp_inner.space==null?null:this.zpp_inner.space.outer)!=null){(this.zpp_inner.space==null?null:this.zpp_inner.space.outer).zpp_inner.wrap_bodies.remove(this)}if(ea!=null){var eb=ea.zpp_inner.wrap_bodies;if(eb.zpp_inner.reverse_flag){eb.push(this)}else{eb.unshift(this)}}}if(this.zpp_inner.space==null){return null}else{return this.zpp_inner.space.outer}};at.prototype.get_arbiters=function(){if(this.zpp_inner.wrap_arbiters==null){this.zpp_inner.wrap_arbiters=U.get(this.zpp_inner.arbiters,true)}return this.zpp_inner.wrap_arbiters};at.prototype.get_isSleeping=function(){return this.zpp_inner.component.sleeping};at.prototype.get_constraints=function(){if(this.zpp_inner.wrap_constraints==null){this.zpp_inner.wrap_constraints=aZ.get(this.zpp_inner.constraints,true)}return this.zpp_inner.wrap_constraints};at.prototype.copy=function(){return this.zpp_inner.copy()};at.prototype.get_position=function(){if(this.zpp_inner.wrap_pos==null){this.zpp_inner.setupPosition()}return this.zpp_inner.wrap_pos};at.prototype.set_position=function(ec){if(this.zpp_inner.wrap_pos==null){this.zpp_inner.setupPosition()}var ee=this.zpp_inner.wrap_pos;var eh=ec.zpp_inner;if(eh._validate!=null){eh._validate()}var ej=ec.zpp_inner.x;var eg=ec.zpp_inner;if(eg._validate!=null){eg._validate()}var ei=ec.zpp_inner.y;var ea;var ef=ee.zpp_inner;if(ef._validate!=null){ef._validate()}if(ee.zpp_inner.x==ej){var ed=ee.zpp_inner;if(ed._validate!=null){ed._validate()}ea=ee.zpp_inner.y==ei}else{ea=false}if(!ea){ee.zpp_inner.x=ej;ee.zpp_inner.y=ei;var eb=ee.zpp_inner;if(eb._invalidate!=null){eb._invalidate(eb)}}if(ec.zpp_inner.weak){var ek=ec.zpp_inner;ec.zpp_inner.outer=null;ec.zpp_inner=null;ec.zpp_pool=au.poolVec2;au.poolVec2=ec;if(ek.outer!=null){ek.outer.zpp_inner=null;ek.outer=null}ek._isimmutable=null;ek._validate=null;ek._invalidate=null;ek.next=bB.zpp_pool;bB.zpp_pool=ek}if(this.zpp_inner.wrap_pos==null){this.zpp_inner.setupPosition()}return this.zpp_inner.wrap_pos};at.prototype.get_velocity=function(){if(this.zpp_inner.wrap_vel==null){this.zpp_inner.setupVelocity()}return this.zpp_inner.wrap_vel};at.prototype.set_velocity=function(ea){if(this.zpp_inner.wrap_vel==null){this.zpp_inner.setupVelocity()}var ee=this.zpp_inner.wrap_vel;var eh=ea.zpp_inner;if(eh._validate!=null){eh._validate()}var ej=ea.zpp_inner.x;var eg=ea.zpp_inner;if(eg._validate!=null){eg._validate()}var ei=ea.zpp_inner.y;var eb;var ef=ee.zpp_inner;if(ef._validate!=null){ef._validate()}if(ee.zpp_inner.x==ej){var ed=ee.zpp_inner;if(ed._validate!=null){ed._validate()}eb=ee.zpp_inner.y==ei}else{eb=false}if(!eb){ee.zpp_inner.x=ej;ee.zpp_inner.y=ei;var ec=ee.zpp_inner;if(ec._invalidate!=null){ec._invalidate(ec)}}if(ea.zpp_inner.weak){var ek=ea.zpp_inner;ea.zpp_inner.outer=null;ea.zpp_inner=null;ea.zpp_pool=au.poolVec2;au.poolVec2=ea;if(ek.outer!=null){ek.outer.zpp_inner=null;ek.outer=null}ek._isimmutable=null;ek._validate=null;ek._invalidate=null;ek.next=bB.zpp_pool;bB.zpp_pool=ek}if(this.zpp_inner.wrap_vel==null){this.zpp_inner.setupVelocity()}return this.zpp_inner.wrap_vel};at.prototype.setVelocityFromTarget=function(ee,ec,el){var eq=1/el;if(this.zpp_inner.wrap_vel==null){this.zpp_inner.setupVelocity()}var ej=this.zpp_inner.wrap_vel;if(this.zpp_inner.wrap_pos==null){this.zpp_inner.setupPosition()}var ed=ee.sub(this.zpp_inner.wrap_pos,true).muleq(eq);var em=ed.zpp_inner;if(em._validate!=null){em._validate()}var eo=ed.zpp_inner.x;var ek=ed.zpp_inner;if(ek._validate!=null){ek._validate()}var en=ed.zpp_inner.y;var ef;var ei=ej.zpp_inner;if(ei._validate!=null){ei._validate()}if(ej.zpp_inner.x==eo){var eh=ej.zpp_inner;if(eh._validate!=null){eh._validate()}ef=ej.zpp_inner.y==en}else{ef=false}if(!ef){ej.zpp_inner.x=eo;ej.zpp_inner.y=en;var eg=ej.zpp_inner;if(eg._invalidate!=null){eg._invalidate(eg)}}if(ed.zpp_inner.weak){var ep=ed.zpp_inner;ed.zpp_inner.outer=null;ed.zpp_inner=null;ed.zpp_pool=au.poolVec2;au.poolVec2=ed;if(ep.outer!=null){ep.outer.zpp_inner=null;ep.outer=null}ep._isimmutable=null;ep._validate=null;ep._invalidate=null;ep.next=bB.zpp_pool;bB.zpp_pool=ep}var eb=(ec-this.zpp_inner.rot)*eq;if(this.zpp_inner.angvel!=eb){this.zpp_inner.angvel=eb;this.zpp_inner.wake()}if(ee.zpp_inner.weak){var ea=ee.zpp_inner;ee.zpp_inner.outer=null;ee.zpp_inner=null;ee.zpp_pool=au.poolVec2;au.poolVec2=ee;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea}return this};at.prototype.get_kinematicVel=function(){if(this.zpp_inner.wrap_kinvel==null){this.zpp_inner.setupkinvel()}return this.zpp_inner.wrap_kinvel};at.prototype.set_kinematicVel=function(eh){if(this.zpp_inner.wrap_kinvel==null){this.zpp_inner.setupkinvel()}var ed=this.zpp_inner.wrap_kinvel;var eg=eh.zpp_inner;if(eg._validate!=null){eg._validate()}var ej=eh.zpp_inner.x;var ef=eh.zpp_inner;if(ef._validate!=null){ef._validate()}var ei=eh.zpp_inner.y;var ea;var ee=ed.zpp_inner;if(ee._validate!=null){ee._validate()}if(ed.zpp_inner.x==ej){var ec=ed.zpp_inner;if(ec._validate!=null){ec._validate()}ea=ed.zpp_inner.y==ei}else{ea=false}if(!ea){ed.zpp_inner.x=ej;ed.zpp_inner.y=ei;var eb=ed.zpp_inner;if(eb._invalidate!=null){eb._invalidate(eb)}}if(eh.zpp_inner.weak){var ek=eh.zpp_inner;eh.zpp_inner.outer=null;eh.zpp_inner=null;eh.zpp_pool=au.poolVec2;au.poolVec2=eh;if(ek.outer!=null){ek.outer.zpp_inner=null;ek.outer=null}ek._isimmutable=null;ek._validate=null;ek._invalidate=null;ek.next=bB.zpp_pool;bB.zpp_pool=ek}if(this.zpp_inner.wrap_kinvel==null){this.zpp_inner.setupkinvel()}return this.zpp_inner.wrap_kinvel};at.prototype.get_surfaceVel=function(){if(this.zpp_inner.wrap_svel==null){this.zpp_inner.setupsvel()}return this.zpp_inner.wrap_svel};at.prototype.set_surfaceVel=function(ed){if(this.zpp_inner.wrap_svel==null){this.zpp_inner.setupsvel()}var ee=this.zpp_inner.wrap_svel;var eh=ed.zpp_inner;if(eh._validate!=null){eh._validate()}var ej=ed.zpp_inner.x;var eg=ed.zpp_inner;if(eg._validate!=null){eg._validate()}var ei=ed.zpp_inner.y;var ea;var ef=ee.zpp_inner;if(ef._validate!=null){ef._validate()}if(ee.zpp_inner.x==ej){var ec=ee.zpp_inner;if(ec._validate!=null){ec._validate()}ea=ee.zpp_inner.y==ei}else{ea=false}if(!ea){ee.zpp_inner.x=ej;ee.zpp_inner.y=ei;var eb=ee.zpp_inner;if(eb._invalidate!=null){eb._invalidate(eb)}}if(ed.zpp_inner.weak){var ek=ed.zpp_inner;ed.zpp_inner.outer=null;ed.zpp_inner=null;ed.zpp_pool=au.poolVec2;au.poolVec2=ed;if(ek.outer!=null){ek.outer.zpp_inner=null;ek.outer=null}ek._isimmutable=null;ek._validate=null;ek._invalidate=null;ek.next=bB.zpp_pool;bB.zpp_pool=ek}if(this.zpp_inner.wrap_svel==null){this.zpp_inner.setupsvel()}return this.zpp_inner.wrap_svel};at.prototype.get_force=function(){if(this.zpp_inner.wrap_force==null){this.zpp_inner.setupForce()}return this.zpp_inner.wrap_force};at.prototype.set_force=function(ea){if(this.zpp_inner.wrap_force==null){this.zpp_inner.setupForce()}var ee=this.zpp_inner.wrap_force;var eh=ea.zpp_inner;if(eh._validate!=null){eh._validate()}var ej=ea.zpp_inner.x;var eg=ea.zpp_inner;if(eg._validate!=null){eg._validate()}var ei=ea.zpp_inner.y;var eb;var ef=ee.zpp_inner;if(ef._validate!=null){ef._validate()}if(ee.zpp_inner.x==ej){var ed=ee.zpp_inner;if(ed._validate!=null){ed._validate()}eb=ee.zpp_inner.y==ei}else{eb=false}if(!eb){ee.zpp_inner.x=ej;ee.zpp_inner.y=ei;var ec=ee.zpp_inner;if(ec._invalidate!=null){ec._invalidate(ec)}}if(ea.zpp_inner.weak){var ek=ea.zpp_inner;ea.zpp_inner.outer=null;ea.zpp_inner=null;ea.zpp_pool=au.poolVec2;au.poolVec2=ea;if(ek.outer!=null){ek.outer.zpp_inner=null;ek.outer=null}ek._isimmutable=null;ek._validate=null;ek._invalidate=null;ek.next=bB.zpp_pool;bB.zpp_pool=ek}if(this.zpp_inner.wrap_force==null){this.zpp_inner.setupForce()}return this.zpp_inner.wrap_force};at.prototype.get_constraintVelocity=function(){if(this.zpp_inner.wrapcvel==null){this.zpp_inner.setup_cvel()}return this.zpp_inner.wrapcvel};at.prototype.get_rotation=function(){return this.zpp_inner.rot};at.prototype.set_rotation=function(eb){this.zpp_inner.immutable_midstep("Body::rotation");if(this.zpp_inner.rot!=eb){this.zpp_inner.rot=eb;var ed=this.zpp_inner;ed.zip_axis=true;var ea=ed.shapes.head;while(ea!=null){var ec=ea.elt;if(ec.type==1){ec.polygon.invalidate_gverts();ec.polygon.invalidate_gaxi()}ec.invalidate_worldCOM();ea=ea.next}ed.zip_worldCOM=true;this.zpp_inner.wake()}return this.zpp_inner.rot};at.prototype.get_angularVel=function(){return this.zpp_inner.angvel};at.prototype.set_angularVel=function(ea){if(this.zpp_inner.angvel!=ea){this.zpp_inner.angvel=ea;this.zpp_inner.wake()}return this.zpp_inner.angvel};at.prototype.get_kinAngVel=function(){return this.zpp_inner.kinangvel};at.prototype.set_kinAngVel=function(ea){if(this.zpp_inner.kinangvel!=ea){this.zpp_inner.kinangvel=ea;this.zpp_inner.wake()}return this.zpp_inner.kinangvel};at.prototype.get_torque=function(){return this.zpp_inner.torque};at.prototype.set_torque=function(ea){if(this.zpp_inner.torque!=ea){this.zpp_inner.torque=ea;this.zpp_inner.wake()}return this.zpp_inner.torque};at.prototype.get_bounds=function(){return this.zpp_inner.aabb.wrapper()};at.prototype.get_allowMovement=function(){return !this.zpp_inner.nomove};at.prototype.set_allowMovement=function(ea){this.zpp_inner.immutable_midstep("Body::"+(ea==null?"null":""+ea));if(!this.zpp_inner.nomove!=ea){this.zpp_inner.nomove=!ea;this.zpp_inner.invalidate_mass()}return !this.zpp_inner.nomove};at.prototype.get_allowRotation=function(){return !this.zpp_inner.norotate};at.prototype.set_allowRotation=function(ea){this.zpp_inner.immutable_midstep("Body::"+(ea==null?"null":""+ea));if(!this.zpp_inner.norotate!=ea){this.zpp_inner.norotate=!ea;this.zpp_inner.invalidate_inertia()}return !this.zpp_inner.norotate};at.prototype.get_massMode=function(){if(br.MassMode_DEFAULT==null){br.internal=true;br.MassMode_DEFAULT=new by();br.internal=false}var ea=br.MassMode_DEFAULT;if(br.MassMode_FIXED==null){br.internal=true;br.MassMode_FIXED=new by();br.internal=false}return[ea,br.MassMode_FIXED][this.zpp_inner.massMode]};at.prototype.set_massMode=function(ea){this.zpp_inner.immutable_midstep("Body::massMode");var eb;if(br.MassMode_DEFAULT==null){br.internal=true;br.MassMode_DEFAULT=new by();br.internal=false}if(ea==br.MassMode_DEFAULT){eb=0}else{eb=1}this.zpp_inner.massMode=eb;this.zpp_inner.invalidate_mass();if(br.MassMode_DEFAULT==null){br.internal=true;br.MassMode_DEFAULT=new by();br.internal=false}var ec=br.MassMode_DEFAULT;if(br.MassMode_FIXED==null){br.internal=true;br.MassMode_FIXED=new by();br.internal=false}return[ec,br.MassMode_FIXED][this.zpp_inner.massMode]};at.prototype.get_constraintMass=function(){if(!this.zpp_inner.world){this.zpp_inner.validate_mass()}return this.zpp_inner.smass};at.prototype.get_mass=function(){this.zpp_inner.validate_mass();return this.zpp_inner.cmass};at.prototype.set_mass=function(ea){this.zpp_inner.immutable_midstep("Body::mass");this.zpp_inner.massMode=1;this.zpp_inner.cmass=ea;this.zpp_inner.invalidate_mass();this.zpp_inner.validate_mass();return this.zpp_inner.cmass};at.prototype.get_gravMassMode=function(){if(br.GravMassMode_DEFAULT==null){br.internal=true;br.GravMassMode_DEFAULT=new cw();br.internal=false}var ea=br.GravMassMode_DEFAULT;if(br.GravMassMode_FIXED==null){br.internal=true;br.GravMassMode_FIXED=new cw();br.internal=false}var eb=br.GravMassMode_FIXED;if(br.GravMassMode_SCALED==null){br.internal=true;br.GravMassMode_SCALED=new cw();br.internal=false}return[ea,eb,br.GravMassMode_SCALED][this.zpp_inner.massMode]};at.prototype.set_gravMassMode=function(ea){this.zpp_inner.immutable_midstep("Body::gravMassMode");var eb;if(br.GravMassMode_SCALED==null){br.internal=true;br.GravMassMode_SCALED=new cw();br.internal=false}if(ea==br.GravMassMode_SCALED){eb=2}else{if(br.GravMassMode_DEFAULT==null){br.internal=true;br.GravMassMode_DEFAULT=new cw();br.internal=false}if(ea==br.GravMassMode_DEFAULT){eb=0}else{eb=1}}this.zpp_inner.gravMassMode=eb;this.zpp_inner.invalidate_gravMass();if(br.GravMassMode_DEFAULT==null){br.internal=true;br.GravMassMode_DEFAULT=new cw();br.internal=false}var ed=br.GravMassMode_DEFAULT;if(br.GravMassMode_FIXED==null){br.internal=true;br.GravMassMode_FIXED=new cw();br.internal=false}var ec=br.GravMassMode_FIXED;if(br.GravMassMode_SCALED==null){br.internal=true;br.GravMassMode_SCALED=new cw();br.internal=false}return[ed,ec,br.GravMassMode_SCALED][this.zpp_inner.massMode]};at.prototype.get_gravMass=function(){this.zpp_inner.validate_gravMass();return this.zpp_inner.gravMass};at.prototype.set_gravMass=function(ea){this.zpp_inner.immutable_midstep("Body::gravMass");this.zpp_inner.gravMassMode=1;this.zpp_inner.gravMass=ea;this.zpp_inner.invalidate_gravMass();this.zpp_inner.validate_gravMass();return this.zpp_inner.gravMass};at.prototype.get_gravMassScale=function(){this.zpp_inner.validate_gravMassScale();return this.zpp_inner.gravMassScale};at.prototype.set_gravMassScale=function(ea){this.zpp_inner.immutable_midstep("Body::gravMassScale");this.zpp_inner.gravMassMode=2;this.zpp_inner.gravMassScale=ea;this.zpp_inner.invalidate_gravMassScale();this.zpp_inner.validate_gravMassScale();return this.zpp_inner.gravMassScale};at.prototype.get_inertiaMode=function(){if(br.InertiaMode_DEFAULT==null){br.internal=true;br.InertiaMode_DEFAULT=new be();br.internal=false}var ea=br.InertiaMode_DEFAULT;if(br.InertiaMode_FIXED==null){br.internal=true;br.InertiaMode_FIXED=new be();br.internal=false}return[ea,br.InertiaMode_FIXED][this.zpp_inner.inertiaMode]};at.prototype.set_inertiaMode=function(ec){this.zpp_inner.immutable_midstep("Body::inertiaMode");var ea;if(br.InertiaMode_FIXED==null){br.internal=true;br.InertiaMode_FIXED=new be();br.internal=false}if(ec==br.InertiaMode_FIXED){ea=1}else{ea=0}this.zpp_inner.inertiaMode=ea;this.zpp_inner.invalidate_inertia();if(br.InertiaMode_DEFAULT==null){br.internal=true;br.InertiaMode_DEFAULT=new be();br.internal=false}var eb=br.InertiaMode_DEFAULT;if(br.InertiaMode_FIXED==null){br.internal=true;br.InertiaMode_FIXED=new be();br.internal=false}return[eb,br.InertiaMode_FIXED][this.zpp_inner.inertiaMode]};at.prototype.get_constraintInertia=function(){if(!this.zpp_inner.world){this.zpp_inner.validate_inertia()}return this.zpp_inner.sinertia};at.prototype.get_inertia=function(){this.zpp_inner.validate_inertia();return this.zpp_inner.cinertia};at.prototype.set_inertia=function(ea){this.zpp_inner.immutable_midstep("Body::inertia");this.zpp_inner.inertiaMode=1;this.zpp_inner.cinertia=ea;this.zpp_inner.invalidate_inertia();this.zpp_inner.validate_inertia();return this.zpp_inner.cinertia};at.prototype.connectedBodies=function(eb,ea){if(eb==null){eb=-1}return this.zpp_inner.connectedBodies(eb,ea)};at.prototype.interactingBodies=function(eb,ed,ea){if(ed==null){ed=-1}var ec;if(eb==null){ec=j.COL|j.SENSOR|j.FLUID}else{if(br.InteractionType_COLLISION==null){br.internal=true;br.InteractionType_COLLISION=new b3();br.internal=false}if(eb==br.InteractionType_COLLISION){ec=j.COL}else{if(br.InteractionType_SENSOR==null){br.internal=true;br.InteractionType_SENSOR=new b3();br.internal=false}if(eb==br.InteractionType_SENSOR){ec=j.SENSOR}else{ec=j.FLUID}}}return this.zpp_inner.interactingBodies(ec,ed,ea)};at.prototype.crushFactor=function(){var ec=0;var ek;if(au.poolVec2==null){ek=new r()}else{ek=au.poolVec2;au.poolVec2=ek.zpp_pool;ek.zpp_pool=null}if(ek.zpp_inner==null){var es;if(bB.zpp_pool==null){es=new bB()}else{es=bB.zpp_pool;bB.zpp_pool=es.next;es.next=null}es.weak=false;es._immutable=false;es.x=0;es.y=0;ek.zpp_inner=es;ek.zpp_inner.outer=ek}else{var ey;var eb=ek.zpp_inner;if(eb._validate!=null){eb._validate()}if(ek.zpp_inner.x==0){var ew=ek.zpp_inner;if(ew._validate!=null){ew._validate()}ey=ek.zpp_inner.y==0}else{ey=false}if(!ey){ek.zpp_inner.x=0;ek.zpp_inner.y=0;var ev=ek.zpp_inner;if(ev._invalidate!=null){ev._invalidate(ev)}}}ek.zpp_inner.weak=false;var eE=ek;if(this.zpp_inner.wrap_arbiters==null){this.zpp_inner.wrap_arbiters=U.get(this.zpp_inner.arbiters,true)}var eQ=this.zpp_inner.wrap_arbiters.iterator();while(true){eQ.zpp_inner.zpp_inner.valmod();var ed=eQ.zpp_inner.zpp_gl();eQ.zpp_critical=true;var eT;if(eQ.zpp_i0){if(this.zpp_inner.type==0){var eg=eh.zpp_inner;if(eg._validate!=null){eg._validate()}var eb=eh.zpp_inner.x;var ef=eh.zpp_inner;if(ef._validate!=null){ef._validate()}this.zpp_inner.circle.__translate(eb,eh.zpp_inner.y)}else{var ee=eh.zpp_inner;if(ee._validate!=null){ee._validate()}var ed=eh.zpp_inner.x;var ec=eh.zpp_inner;if(ec._validate!=null){ec._validate()}this.zpp_inner.polygon.__translate(ed,eh.zpp_inner.y)}}if(eh.zpp_inner.weak){var ea=eh.zpp_inner;eh.zpp_inner.outer=null;eh.zpp_inner=null;eh.zpp_pool=au.poolVec2;au.poolVec2=eh;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea}return this};ck.prototype.scale=function(eb,ea){this.zpp_inner.immutable_midstep("Shape::scale()");if(this.zpp_inner.type==0){var ec=eb*eb-ea*ea;if(ec*ecei.id}else{ee=false}}else{ee=true}}else{ee=true}if(ee){if(ec.space==this.manager.space){var ef=this.listeners;var eg;if(aF.zpp_pool==null){eg=new aF()}else{eg=aF.zpp_pool;aF.zpp_pool=eg.next;eg.next=null}eg.elt=ec;var ej=eg;if(eh==null){ej.next=ef.head;ef.head=ej}else{ej.next=eh.next;eh.next=ej}ef.pushmod=ef.modified=true;ef.length++;eh=ej}ea=ea.next}else{eh=ed;ed=ed.next}}}eb=eb.next}};cC.prototype.bodylisteners=null;cC.prototype.zip_bodylisteners=null;cC.prototype.invalidate_bodylisteners=function(){this.zip_bodylisteners=true};cC.prototype.validate_bodylisteners=function(){if(this.zip_bodylisteners){this.zip_bodylisteners=false;this.realvalidate_bodylisteners()}};cC.prototype.realvalidate_bodylisteners=function(){this.bodylisteners.clear();var eb=this.cbTypes.head;while(eb!=null){var ei=null;var ee=this.bodylisteners.head;var ea=eb.elt.bodylisteners.head;while(ea!=null){var ed=ea.elt;if(ee!=null&&ee.elt==ed){ea=ea.next;ei=ee;ee=ee.next}else{var ef;if(ee!=null){var ek=ee.elt;if(ed.precedence<=ek.precedence){if(ed.precedence==ek.precedence){ef=ed.id>ek.id}else{ef=false}}else{ef=true}}else{ef=true}if(ef){var ec;var eg=ed.options;if(!eg.nonemptyintersection(this.cbTypes,eg.excludes)){ec=ed.space==this.manager.space}else{ec=false}if(ec){var ej=this.bodylisteners;var eh;if(aT.zpp_pool==null){eh=new aT()}else{eh=aT.zpp_pool;aT.zpp_pool=eh.next;eh.next=null}eh.elt=ed;var el=eh;if(ei==null){el.next=ej.head;ej.head=el}else{el.next=ei.next;ei.next=el}ej.pushmod=ej.modified=true;ej.length++;ei=el}ea=ea.next}else{ei=ee;ee=ee.next}}}eb=eb.next}};cC.prototype.conlisteners=null;cC.prototype.zip_conlisteners=null;cC.prototype.invalidate_conlisteners=function(){this.zip_conlisteners=true};cC.prototype.validate_conlisteners=function(){if(this.zip_conlisteners){this.zip_conlisteners=false;this.realvalidate_conlisteners()}};cC.prototype.realvalidate_conlisteners=function(){this.conlisteners.clear();var eb=this.cbTypes.head;while(eb!=null){var ei=null;var ee=this.conlisteners.head;var ea=eb.elt.conlisteners.head;while(ea!=null){var ed=ea.elt;if(ee!=null&&ee.elt==ed){ea=ea.next;ei=ee;ee=ee.next}else{var ef;if(ee!=null){var ek=ee.elt;if(ed.precedence<=ek.precedence){if(ed.precedence==ek.precedence){ef=ed.id>ek.id}else{ef=false}}else{ef=true}}else{ef=true}if(ef){var ec;var eg=ed.options;if(!eg.nonemptyintersection(this.cbTypes,eg.excludes)){ec=ed.space==this.manager.space}else{ec=false}if(ec){var ej=this.conlisteners;var eh;if(aR.zpp_pool==null){eh=new aR()}else{eh=aR.zpp_pool;aR.zpp_pool=eh.next;eh.next=null}eh.elt=ed;var el=eh;if(ei==null){el.next=ej.head;ej.head=el}else{el.next=ei.next;ei.next=el}ej.pushmod=ej.modified=true;ej.length++;ei=el}ea=ea.next}else{ei=ee;ee=ee.next}}}eb=eb.next}};cC.prototype.validate=function(){if(this.zip_listeners){this.zip_listeners=false;this.realvalidate_listeners()}if(this.zip_bodylisteners){this.zip_bodylisteners=false;this.realvalidate_bodylisteners()}if(this.zip_conlisteners){this.zip_conlisteners=false;this.realvalidate_conlisteners()}};cC.prototype.interactors=null;cC.prototype.wrap_interactors=null;cC.prototype.constraints=null;cC.prototype.wrap_constraints=null;cC.prototype.addConstraint=function(ea){this.constraints.add(ea)};cC.prototype.addInteractor=function(ea){this.interactors.add(ea)};cC.prototype.remConstraint=function(ea){this.constraints.remove(ea)};cC.prototype.remInteractor=function(ea){this.interactors.remove(ea)};cC.prototype.free=function(){this.listeners.clear();this.zip_listeners=true;this.bodylisteners.clear();this.zip_bodylisteners=true;this.conlisteners.clear();this.zip_conlisteners=true;while(this.cbTypes.head!=null){this.cbTypes.pop_unsafe().cbsets.remove(this)}};cC.prototype.alloc=function(){};cC.prototype.__class__=cC;var ar=zpp_nape.callbacks.ZPP_CbSetPair=function(){this.listeners=null;this.zip_listeners=false;this.next=null;this.b=null;this.a=null;this.listeners=new cp()};ar.__name__=["zpp_nape","callbacks","ZPP_CbSetPair"];ar.get=function(eb,ea){var ec;if(ar.zpp_pool==null){ec=new ar()}else{ec=ar.zpp_pool;ar.zpp_pool=ec.next;ec.next=null}ec.zip_listeners=true;if(cC.setlt(eb,ea)){ec.a=eb;ec.b=ea}else{ec.a=ea;ec.b=eb}return ec};ar.setlt=function(ea,eb){if(!cC.setlt(ea.a,eb.a)){if(ea.a==eb.a){return cC.setlt(ea.b,eb.b)}else{return false}}else{return true}};ar.prototype.a=null;ar.prototype.b=null;ar.prototype.next=null;ar.prototype.free=function(){this.a=this.b=null;this.listeners.clear()};ar.prototype.alloc=function(){this.zip_listeners=true};ar.prototype.compatible=function(eb){var ec;var ee=eb.options1;var ea=this.a.cbTypes;if(ee.nonemptyintersection(ea,ee.includes)&&!ee.nonemptyintersection(ea,ee.excludes)){var eg=eb.options2;var ej=this.b.cbTypes;if(eg.nonemptyintersection(ej,eg.includes)){ec=!eg.nonemptyintersection(ej,eg.excludes)}else{ec=false}}else{ec=false}if(!ec){var ef=eb.options2;var ei=this.a.cbTypes;if(ef.nonemptyintersection(ei,ef.includes)&&!ef.nonemptyintersection(ei,ef.excludes)){var ed=eb.options1;var eh=this.b.cbTypes;if(ed.nonemptyintersection(eh,ed.includes)){return !ed.nonemptyintersection(eh,ed.excludes)}else{return false}}else{return false}}else{return true}};ar.prototype.zip_listeners=null;ar.prototype.listeners=null;ar.prototype.invalidate=function(){this.zip_listeners=true};ar.prototype.validate=function(){if(this.zip_listeners){this.zip_listeners=false;this.__validate()}};ar.prototype.__validate=function(){this.listeners.clear();var ek=this.a.listeners.head;var ee=this.b.listeners.head;while(ek!=null&&ee!=null){var ea=ek.elt;var ej=ee.elt;if(ea==ej){var ed;var ec;var eg=ea.options1;var eb=this.a.cbTypes;if(eg.nonemptyintersection(eb,eg.includes)&&!eg.nonemptyintersection(eb,eg.excludes)){var ei=ea.options2;var en=this.b.cbTypes;if(ei.nonemptyintersection(en,ei.includes)){ec=!ei.nonemptyintersection(en,ei.excludes)}else{ec=false}}else{ec=false}if(!ec){var eh=ea.options2;var em=this.a.cbTypes;if(eh.nonemptyintersection(em,eh.includes)&&!eh.nonemptyintersection(em,eh.excludes)){var ef=ea.options1;var el=this.b.cbTypes;if(ef.nonemptyintersection(el,ef.includes)){ed=!ef.nonemptyintersection(el,ef.excludes)}else{ed=false}}else{ed=false}}else{ed=true}if(ed){this.listeners.add(ea)}ek=ek.next;ee=ee.next}else{if(ea.precedence>ej.precedence||ea.precedence==ej.precedence&&ea.id>ej.id){ek=ek.next}else{ee=ee.next}}}};ar.prototype.empty_intersection=function(){return this.listeners.head==null};ar.prototype.single_intersection=function(ea){var eb=this.listeners.head;if(eb!=null&&eb.elt==ea){return eb.next==null}else{return false}};ar.prototype.forall=function(ed,eb){var ec=this.listeners.head;while(ec!=null){var ea=ec.elt;if(ea.event==ed){eb(ea)}ec=ec.next}};ar.prototype.__class__=ar;var cp=zpp_nape.util.ZNPList_ZPP_InteractionListener=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};cp.__name__=["zpp_nape","util","ZNPList_ZPP_InteractionListener"];cp.prototype.head=null;cp.prototype.begin=function(){return this.head};cp.prototype.modified=null;cp.prototype.pushmod=null;cp.prototype.length=null;cp.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};cp.prototype.add=function(ec){var eb;if(aF.zpp_pool==null){eb=new aF()}else{eb=aF.zpp_pool;aF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};cp.prototype.inlined_add=function(ec){var eb;if(aF.zpp_pool==null){eb=new aF()}else{eb=aF.zpp_pool;aF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};cp.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};cp.prototype.insert=function(ed,ec){var eb;if(aF.zpp_pool==null){eb=new aF()}else{eb=aF.zpp_pool;aF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};cp.prototype.inlined_insert=function(ed,ec){var eb;if(aF.zpp_pool==null){eb=new aF()}else{eb=aF.zpp_pool;aF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};cp.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aF.zpp_pool;aF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};cp.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aF.zpp_pool;aF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};cp.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};cp.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};cp.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aF.zpp_pool;aF.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};cp.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};cp.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aF.zpp_pool;aF.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};cp.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=aF.zpp_pool;aF.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};cp.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aF.zpp_pool;aF.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};cp.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aF.zpp_pool;aF.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};cp.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};cp.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aF.zpp_pool;aF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};cp.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aF.zpp_pool;aF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};cp.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};cp.prototype.empty=function(){return this.head==null};cp.prototype.size=function(){return this.length};cp.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};cp.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};cp.prototype.front=function(){return this.head.elt};cp.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};cp.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};cp.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};cp.prototype.__class__=cp;var bh=zpp_nape.util.ZNPList_ZPP_BodyListener=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bh.__name__=["zpp_nape","util","ZNPList_ZPP_BodyListener"];bh.prototype.head=null;bh.prototype.begin=function(){return this.head};bh.prototype.modified=null;bh.prototype.pushmod=null;bh.prototype.length=null;bh.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bh.prototype.add=function(ec){var eb;if(aT.zpp_pool==null){eb=new aT()}else{eb=aT.zpp_pool;aT.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bh.prototype.inlined_add=function(ec){var eb;if(aT.zpp_pool==null){eb=new aT()}else{eb=aT.zpp_pool;aT.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bh.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bh.prototype.insert=function(ed,ec){var eb;if(aT.zpp_pool==null){eb=new aT()}else{eb=aT.zpp_pool;aT.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bh.prototype.inlined_insert=function(ed,ec){var eb;if(aT.zpp_pool==null){eb=new aT()}else{eb=aT.zpp_pool;aT.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bh.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aT.zpp_pool;aT.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bh.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aT.zpp_pool;aT.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bh.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bh.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bh.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aT.zpp_pool;aT.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bh.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bh.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aT.zpp_pool;aT.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bh.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=aT.zpp_pool;aT.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bh.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aT.zpp_pool;aT.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bh.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aT.zpp_pool;aT.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bh.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bh.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aT.zpp_pool;aT.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bh.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aT.zpp_pool;aT.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bh.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bh.prototype.empty=function(){return this.head==null};bh.prototype.size=function(){return this.length};bh.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bh.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bh.prototype.front=function(){return this.head.elt};bh.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bh.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bh.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bh.prototype.__class__=bh;var cY=zpp_nape.util.ZNPList_ZPP_ConstraintListener=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};cY.__name__=["zpp_nape","util","ZNPList_ZPP_ConstraintListener"];cY.prototype.head=null;cY.prototype.begin=function(){return this.head};cY.prototype.modified=null;cY.prototype.pushmod=null;cY.prototype.length=null;cY.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};cY.prototype.add=function(ec){var eb;if(aR.zpp_pool==null){eb=new aR()}else{eb=aR.zpp_pool;aR.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};cY.prototype.inlined_add=function(ec){var eb;if(aR.zpp_pool==null){eb=new aR()}else{eb=aR.zpp_pool;aR.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};cY.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};cY.prototype.insert=function(ed,ec){var eb;if(aR.zpp_pool==null){eb=new aR()}else{eb=aR.zpp_pool;aR.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};cY.prototype.inlined_insert=function(ed,ec){var eb;if(aR.zpp_pool==null){eb=new aR()}else{eb=aR.zpp_pool;aR.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};cY.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aR.zpp_pool;aR.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};cY.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aR.zpp_pool;aR.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};cY.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};cY.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};cY.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aR.zpp_pool;aR.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};cY.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};cY.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aR.zpp_pool;aR.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};cY.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=aR.zpp_pool;aR.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};cY.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aR.zpp_pool;aR.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};cY.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aR.zpp_pool;aR.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};cY.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};cY.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aR.zpp_pool;aR.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};cY.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aR.zpp_pool;aR.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};cY.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};cY.prototype.empty=function(){return this.head==null};cY.prototype.size=function(){return this.length};cY.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};cY.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};cY.prototype.front=function(){return this.head.elt};cY.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};cY.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};cY.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};cY.prototype.__class__=cY;var m=zpp_nape.util.ZNPList_ZPP_Constraint=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};m.__name__=["zpp_nape","util","ZNPList_ZPP_Constraint"];m.prototype.head=null;m.prototype.begin=function(){return this.head};m.prototype.modified=null;m.prototype.pushmod=null;m.prototype.length=null;m.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};m.prototype.add=function(ec){var eb;if(cx.zpp_pool==null){eb=new cx()}else{eb=cx.zpp_pool;cx.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};m.prototype.inlined_add=function(ec){var eb;if(cx.zpp_pool==null){eb=new cx()}else{eb=cx.zpp_pool;cx.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};m.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};m.prototype.insert=function(ed,ec){var eb;if(cx.zpp_pool==null){eb=new cx()}else{eb=cx.zpp_pool;cx.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};m.prototype.inlined_insert=function(ed,ec){var eb;if(cx.zpp_pool==null){eb=new cx()}else{eb=cx.zpp_pool;cx.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};m.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cx.zpp_pool;cx.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};m.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cx.zpp_pool;cx.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};m.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};m.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};m.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cx.zpp_pool;cx.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};m.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};m.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cx.zpp_pool;cx.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};m.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cx.zpp_pool;cx.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};m.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cx.zpp_pool;cx.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};m.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cx.zpp_pool;cx.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};m.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};m.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cx.zpp_pool;cx.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};m.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cx.zpp_pool;cx.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};m.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};m.prototype.empty=function(){return this.head==null};m.prototype.size=function(){return this.length};m.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};m.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};m.prototype.front=function(){return this.head.elt};m.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};m.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};m.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};m.prototype.__class__=m;var bn=zpp_nape.util.ZNPList_ZPP_Interactor=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bn.__name__=["zpp_nape","util","ZNPList_ZPP_Interactor"];bn.prototype.head=null;bn.prototype.begin=function(){return this.head};bn.prototype.modified=null;bn.prototype.pushmod=null;bn.prototype.length=null;bn.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bn.prototype.add=function(ec){var eb;if(g.zpp_pool==null){eb=new g()}else{eb=g.zpp_pool;g.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bn.prototype.inlined_add=function(ec){var eb;if(g.zpp_pool==null){eb=new g()}else{eb=g.zpp_pool;g.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bn.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bn.prototype.insert=function(ed,ec){var eb;if(g.zpp_pool==null){eb=new g()}else{eb=g.zpp_pool;g.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bn.prototype.inlined_insert=function(ed,ec){var eb;if(g.zpp_pool==null){eb=new g()}else{eb=g.zpp_pool;g.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bn.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=g.zpp_pool;g.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bn.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=g.zpp_pool;g.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bn.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bn.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bn.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=g.zpp_pool;g.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bn.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bn.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=g.zpp_pool;g.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bn.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=g.zpp_pool;g.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bn.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=g.zpp_pool;g.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bn.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=g.zpp_pool;g.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bn.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bn.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=g.zpp_pool;g.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bn.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=g.zpp_pool;g.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bn.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bn.prototype.empty=function(){return this.head==null};bn.prototype.size=function(){return this.length};bn.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bn.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bn.prototype.front=function(){return this.head.elt};bn.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bn.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bn.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bn.prototype.__class__=bn;var af=zpp_nape.util.ZNPList_ZPP_CbSet=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};af.__name__=["zpp_nape","util","ZNPList_ZPP_CbSet"];af.prototype.head=null;af.prototype.begin=function(){return this.head};af.prototype.modified=null;af.prototype.pushmod=null;af.prototype.length=null;af.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};af.prototype.add=function(ec){var eb;if(cO.zpp_pool==null){eb=new cO()}else{eb=cO.zpp_pool;cO.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};af.prototype.inlined_add=function(ec){var eb;if(cO.zpp_pool==null){eb=new cO()}else{eb=cO.zpp_pool;cO.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};af.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};af.prototype.insert=function(ed,ec){var eb;if(cO.zpp_pool==null){eb=new cO()}else{eb=cO.zpp_pool;cO.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};af.prototype.inlined_insert=function(ed,ec){var eb;if(cO.zpp_pool==null){eb=new cO()}else{eb=cO.zpp_pool;cO.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};af.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cO.zpp_pool;cO.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};af.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cO.zpp_pool;cO.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};af.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};af.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};af.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cO.zpp_pool;cO.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};af.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};af.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cO.zpp_pool;cO.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};af.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cO.zpp_pool;cO.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};af.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cO.zpp_pool;cO.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};af.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cO.zpp_pool;cO.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};af.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};af.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cO.zpp_pool;cO.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};af.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cO.zpp_pool;cO.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};af.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};af.prototype.empty=function(){return this.head==null};af.prototype.size=function(){return this.length};af.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};af.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};af.prototype.front=function(){return this.head.elt};af.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};af.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};af.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};af.prototype.__class__=af;var db=zpp_nape.callbacks.ZPP_CbType=function(){this.conlisteners=null;this.bodylisteners=null;this.listeners=null;this.cbsets=null;this.id=0;this.userData=null;this.outer=null;this.id=cr.CbType();this.listeners=new cp();this.bodylisteners=new bh();this.conlisteners=new cY();this.constraints=new m();this.interactors=new bn();this.cbsets=new af()};db.__name__=["zpp_nape","callbacks","ZPP_CbType"];db.setlt=function(eb,ea){return eb.ided.precedence||eg.precedence==ed.precedence&&eg.id>ed.id){break}ec=ea;ea=ea.next}var ee=this.listeners;var ef;if(aF.zpp_pool==null){ef=new aF()}else{ef=aF.zpp_pool;aF.zpp_pool=ef.next;ef.next=null}ef.elt=eg;var ei=ef;if(ec==null){ei.next=ee.head;ee.head=ei}else{ei.next=ec.next;ec.next=ei}ee.pushmod=ee.modified=true;ee.length++;var eh=this.cbsets.head;while(eh!=null){var eb=eh.elt;eb.zip_listeners=true;eb.invalidate_pairs();eh=eh.next}};db.prototype.removeint=function(eb){this.listeners.remove(eb);var ec=this.cbsets.head;while(ec!=null){var ea=ec.elt;ea.zip_listeners=true;ea.invalidate_pairs();ec=ec.next}};db.prototype.invalidateint=function(){var eb=this.cbsets.head;while(eb!=null){var ea=eb.elt;ea.zip_listeners=true;ea.invalidate_pairs();eb=eb.next}};db.prototype.bodylisteners=null;db.prototype.addbody=function(ea){var eg=null;var ee=this.bodylisteners.head;while(ee!=null){var ed=ee.elt;if(ea.precedence>ed.precedence||ea.precedence==ed.precedence&&ea.id>ed.id){break}eg=ee;ee=ee.next}var eh=this.bodylisteners;var ec;if(aT.zpp_pool==null){ec=new aT()}else{ec=aT.zpp_pool;aT.zpp_pool=ec.next;ec.next=null}ec.elt=ea;var eb=ec;if(eg==null){eb.next=eh.head;eh.head=eb}else{eb.next=eg.next;eg.next=eb}eh.pushmod=eh.modified=true;eh.length++;var ef=this.cbsets.head;while(ef!=null){ef.elt.zip_bodylisteners=true;ef=ef.next}};db.prototype.removebody=function(ea){this.bodylisteners.remove(ea);var eb=this.cbsets.head;while(eb!=null){eb.elt.zip_bodylisteners=true;eb=eb.next}};db.prototype.invalidatebody=function(){var ea=this.cbsets.head;while(ea!=null){ea.elt.zip_bodylisteners=true;ea=ea.next}};db.prototype.conlisteners=null;db.prototype.addconstraint=function(ea){var eg=null;var ee=this.conlisteners.head;while(ee!=null){var ed=ee.elt;if(ea.precedence>ed.precedence||ea.precedence==ed.precedence&&ea.id>ed.id){break}eg=ee;ee=ee.next}var eh=this.conlisteners;var ec;if(aR.zpp_pool==null){ec=new aR()}else{ec=aR.zpp_pool;aR.zpp_pool=ec.next;ec.next=null}ec.elt=ea;var eb=ec;if(eg==null){eb.next=eh.head;eh.head=eb}else{eb.next=eg.next;eg.next=eb}eh.pushmod=eh.modified=true;eh.length++;var ef=this.cbsets.head;while(ef!=null){ef.elt.zip_conlisteners=true;ef=ef.next}};db.prototype.removeconstraint=function(ea){this.conlisteners.remove(ea);var eb=this.cbsets.head;while(eb!=null){eb.elt.zip_conlisteners=true;eb=eb.next}};db.prototype.invalidateconstraint=function(){var ea=this.cbsets.head;while(ea!=null){ea.elt.zip_conlisteners=true;ea=ea.next}};db.prototype.__class__=db;var br=zpp_nape.util.ZPP_Flags=function(){};br.__name__=["zpp_nape","util","ZPP_Flags"];br.GravMassMode_DEFAULT=null;br.GravMassMode_FIXED=null;br.GravMassMode_SCALED=null;br.InertiaMode_DEFAULT=null;br.InertiaMode_FIXED=null;br.MassMode_DEFAULT=null;br.MassMode_FIXED=null;br.BodyType_STATIC=null;br.BodyType_DYNAMIC=null;br.BodyType_KINEMATIC=null;br.ListenerType_BODY=null;br.PreFlag_ACCEPT=null;br.ListenerType_CONSTRAINT=null;br.PreFlag_IGNORE=null;br.ListenerType_INTERACTION=null;br.PreFlag_ACCEPT_ONCE=null;br.ListenerType_PRE=null;br.PreFlag_IGNORE_ONCE=null;br.CbEvent_BEGIN=null;br.InteractionType_COLLISION=null;br.CbEvent_ONGOING=null;br.InteractionType_SENSOR=null;br.CbEvent_END=null;br.InteractionType_FLUID=null;br.CbEvent_WAKE=null;br.InteractionType_ANY=null;br.CbEvent_SLEEP=null;br.CbEvent_BREAK=null;br.CbEvent_PRE=null;br.Winding_UNDEFINED=null;br.Winding_CLOCKWISE=null;br.Winding_ANTICLOCKWISE=null;br.ValidationResult_VALID=null;br.ValidationResult_DEGENERATE=null;br.ValidationResult_CONCAVE=null;br.ValidationResult_SELF_INTERSECTING=null;br.ShapeType_CIRCLE=null;br.ShapeType_POLYGON=null;br.Broadphase_DYNAMIC_AABB_TREE=null;br.Broadphase_SWEEP_AND_PRUNE=null;br.ArbiterType_COLLISION=null;br.ArbiterType_SENSOR=null;br.ArbiterType_FLUID=null;br.prototype.__class__=br;var cc=zpp_nape.callbacks.ZPP_Listener=function(){this.space=null;this.interaction=null;this.constraint=null;this.body=null;this.precedence=0;this.event=0;this.type=0;this.id=0;this.outer=null;this.id=cr.Listener()};cc.__name__=["zpp_nape","callbacks","ZPP_Listener"];cc.setlt=function(eb,ea){if(eb.precedence<=ea.precedence){if(eb.precedence==ea.precedence){return eb.id>ea.id}else{return false}}else{return true}};cc.prototype.outer=null;cc.prototype.id=null;cc.prototype.type=null;cc.prototype.event=null;cc.prototype.precedence=null;cc.prototype.body=null;cc.prototype.constraint=null;cc.prototype.interaction=null;cc.prototype.space=null;cc.prototype.swapEvent=function(ea){};cc.prototype.invalidate_precedence=function(){};cc.prototype.addedToSpace=function(){};cc.prototype.removedFromSpace=function(){};cc.prototype.__class__=cc;var bW=zpp_nape.callbacks.ZPP_BodyListener=function(ea,ec,eb){this.handler=null;this.options=null;this.outer_zn=null;cc.call(this);this.event=ec;this.handler=eb;this.body=this;this.type=0;this.options=ea.zpp_inner};bW.__name__=["zpp_nape","callbacks","ZPP_BodyListener"];bW.__super__=cc;bW.prototype=Object.create(cc.prototype);bW.prototype.outer_zn=null;bW.prototype.options=null;bW.prototype.handler=null;bW.prototype.addedToSpace=function(){this.options.handler=dX(this,this.cbtype_change);var ea=this.options.includes.head;while(ea!=null){var ec=ea.elt;var eb=null;var eh=ec.bodylisteners.head;while(eh!=null){var ed=eh.elt;if(this.precedence>ed.precedence||this.precedence==ed.precedence&&this.id>ed.id){break}eb=eh;eh=eh.next}var ee=ec.bodylisteners;var ef;if(aT.zpp_pool==null){ef=new aT()}else{ef=aT.zpp_pool;aT.zpp_pool=ef.next;ef.next=null}ef.elt=this;var ei=ef;if(eb==null){ei.next=ee.head;ee.head=ei}else{ei.next=eb.next;eb.next=ei}ee.pushmod=ee.modified=true;ee.length++;var eg=ec.cbsets.head;while(eg!=null){eg.elt.zip_bodylisteners=true;eg=eg.next}ea=ea.next}};bW.prototype.removedFromSpace=function(){var eb=this.options.includes.head;while(eb!=null){var ea=eb.elt;ea.bodylisteners.remove(this);var ec=ea.cbsets.head;while(ec!=null){ec.elt.zip_bodylisteners=true;ec=ec.next}eb=eb.next}this.options.handler=null};bW.prototype.cbtype_change=function(ee,ei,el){this.removedFromSpace();var ef=this.options;if(ei){if(el){var ed=null;var eb=ef.includes.head;while(eb!=null){if(ee.ided.precedence||this.precedence==ed.precedence&&this.id>ed.id){break}eb=eh;eh=eh.next}var ee=ec.conlisteners;var ef;if(aR.zpp_pool==null){ef=new aR()}else{ef=aR.zpp_pool;aR.zpp_pool=ef.next;ef.next=null}ef.elt=this;var ei=ef;if(eb==null){ei.next=ee.head;ee.head=ei}else{ei.next=eb.next;eb.next=ei}ee.pushmod=ee.modified=true;ee.length++;var eg=ec.cbsets.head;while(eg!=null){eg.elt.zip_conlisteners=true;eg=eg.next}ea=ea.next}};O.prototype.removedFromSpace=function(){var eb=this.options.includes.head;while(eb!=null){var ea=eb.elt;ea.conlisteners.remove(this);var ec=ea.cbsets.head;while(ec!=null){ec.elt.zip_conlisteners=true;ec=ec.next}eb=eb.next}this.options.handler=null};O.prototype.cbtype_change=function(ee,ei,el){this.removedFromSpace();var ef=this.options;if(ei){if(el){var ed=null;var eb=ef.includes.head;while(eb!=null){if(ee.id0&&ea.next!=null){this.erase(ea)}return ea.next};x.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=b.zpp_pool;b.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};x.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=b.zpp_pool;b.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};x.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};x.prototype.empty=function(){return this.head==null};x.prototype.size=function(){return this.length};x.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};x.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};x.prototype.front=function(){return this.head.elt};x.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};x.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};x.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};x.prototype.__class__=x;var c1=zpp_nape.callbacks.ZPP_InteractionListener=function(ed,ec,eb,ea){this.handlerp=null;this.pure=false;this.allowSleepingCallbacks=false;this.handleri=null;this.options2=null;this.options1=null;this.itype=0;this.outer_znp=null;this.outer_zni=null;cc.call(this);this.type=ea;this.interaction=this;this.event=eb;this.options1=ed.zpp_inner;this.options2=ec.zpp_inner;this.allowSleepingCallbacks=false};c1.__name__=["zpp_nape","callbacks","ZPP_InteractionListener"];c1.__super__=cc;c1.prototype=Object.create(cc.prototype);c1.prototype.outer_zni=null;c1.prototype.outer_znp=null;c1.prototype.itype=null;c1.prototype.options1=null;c1.prototype.options2=null;c1.prototype.handleri=null;c1.prototype.allowSleepingCallbacks=null;c1.prototype.pure=null;c1.prototype.handlerp=null;c1.prototype.setInteractionType=function(ea){this.itype=ea};c1.prototype.wake=function(){var ee=this.options1.includes.head;var ed=this.options2.includes.head;while(ee!=null&&ed!=null){var ec=ee.elt;var eb=ed.elt;if(ec==eb){var ea=ec.interactors.head;while(ea!=null){ea.elt.wake();ea=ea.next}ee=ee.next;ed=ed.next}else{if(ec.ideS.precedence||eV.precedence==eS.precedence&&eV.id>eS.id){break}es=ej;ej=ej.next}var eh=eg.listeners;var eA;if(aF.zpp_pool==null){eA=new aF()}else{eA=aF.zpp_pool;aF.zpp_pool=eA.next;eA.next=null}eA.elt=eV;var ei=eA;if(es==null){ei.next=eh.head;eh.head=ei}else{ei.next=es.next;es.next=ei}eh.pushmod=eh.modified=true;eh.length++;var ez=eg.cbsets.head;while(ez!=null){var eB=ez.elt;eB.zip_listeners=true;eB.invalidate_pairs();ez=ez.next}if(eN){var ey=eg.interactors.head;while(ey!=null){ey.elt.wake();ey=ey.next}}el=el.next;ek=ek.next}else{if(eg.ideU.precedence||eV.precedence==eU.precedence&&eV.id>eU.id){break}eq=ex;ex=ex.next}var eP=eg.listeners;var eG;if(aF.zpp_pool==null){eG=new aF()}else{eG=aF.zpp_pool;aF.zpp_pool=eG.next;eG.next=null}eG.elt=eV;var ee=eG;if(eq==null){ee.next=eP.head;eP.head=ee}else{ee.next=eq.next;eq.next=ee}eP.pushmod=eP.modified=true;eP.length++;var ew=eg.cbsets.head;while(ew!=null){var ed=ew.elt;ed.zip_listeners=true;ed.invalidate_pairs();ew=ew.next}if(eN){var ev=eg.interactors.head;while(ev!=null){ev.elt.wake();ev=ev.next}}el=el.next}else{var eo=null;var eu=ef.listeners.head;while(eu!=null){var eT=eu.elt;if(eV.precedence>eT.precedence||eV.precedence==eT.precedence&&eV.id>eT.id){break}eo=eu;eu=eu.next}var eM=ef.listeners;var eE;if(aF.zpp_pool==null){eE=new aF()}else{eE=aF.zpp_pool;aF.zpp_pool=eE.next;eE.next=null}eE.elt=eV;var ec=eE;if(eo==null){ec.next=eM.head;eM.head=ec}else{ec.next=eo.next;eo.next=ec}eM.pushmod=eM.modified=true;eM.length++;var et=ef.cbsets.head;while(et!=null){var eb=et.elt;eb.zip_listeners=true;eb.invalidate_pairs();et=et.next}if(eN){var er=ef.interactors.head;while(er!=null){er.elt.wake();er=er.next}}ek=ek.next}}}while(el!=null){var e0=el.elt;var en=null;var ep=e0.listeners.head;while(ep!=null){var eR=ep.elt;if(eV.precedence>eR.precedence||eV.precedence==eR.precedence&&eV.id>eR.id){break}en=ep;ep=ep.next}var eK=e0.listeners;var eD;if(aF.zpp_pool==null){eD=new aF()}else{eD=aF.zpp_pool;aF.zpp_pool=eD.next;eD.next=null}eD.elt=eV;var ea=eD;if(en==null){ea.next=eK.head;eK.head=ea}else{ea.next=en.next;en.next=ea}eK.pushmod=eK.modified=true;eK.length++;var eO=e0.cbsets.head;while(eO!=null){var eY=eO.elt;eY.zip_listeners=true;eY.invalidate_pairs();eO=eO.next}if(eN){var eL=e0.interactors.head;while(eL!=null){eL.elt.wake();eL=eL.next}}el=el.next}while(ek!=null){var eX=ek.elt;var em=null;var eJ=eX.listeners.head;while(eJ!=null){var eQ=eJ.elt;if(eV.precedence>eQ.precedence||eV.precedence==eQ.precedence&&eV.id>eQ.id){break}em=eJ;eJ=eJ.next}var eI=eX.listeners;var eC;if(aF.zpp_pool==null){eC=new aF()}else{eC=aF.zpp_pool;aF.zpp_pool=eC.next;eC.next=null}eC.elt=eV;var eZ=eC;if(em==null){eZ.next=eI.head;eI.head=eZ}else{eZ.next=em.next;em.next=eZ}eI.pushmod=eI.modified=true;eI.length++;var eH=eX.cbsets.head;while(eH!=null){var eW=eH.elt;eW.zip_listeners=true;eW.invalidate_pairs();eH=eH.next}if(eN){var eF=eX.interactors.head;while(eF!=null){eF.elt.wake();eF=eF.next}}ek=ek.next}this.options1.handler=dX(this,this.cbtype_change1);this.options2.handler=dX(this,this.cbtype_change2);this.with_uniquesets(true)};c1.prototype.removedFromSpace=function(){var eg=this;this.with_uniquesets(false);var eq=this.type==3;var ef=this.options1.includes.head;var ee=this.options2.includes.head;while(ef!=null&&ee!=null){var ed=ef.elt;var ec=ee.elt;if(ed==ec){ed.listeners.remove(eg);var es=ed.cbsets.head;while(es!=null){var ep=es.elt;ep.zip_listeners=true;ep.invalidate_pairs();es=es.next}if(eq){var er=ed.interactors.head;while(er!=null){er.elt.wake();er=er.next}}ef=ef.next;ee=ee.next}else{if(ed.ide1.precedence||e4.precedence==e1.precedence&&e4.id>e1.id){break}es=ez;ez=ez.next}var eh=eg.listeners;var eA;if(aF.zpp_pool==null){eA=new aF()}else{eA=aF.zpp_pool;aF.zpp_pool=eA.next;eA.next=null}eA.elt=e4;var ei=eA;if(es==null){ei.next=eh.head;eh.head=ei}else{ei.next=es.next;es.next=ei}eh.pushmod=eh.modified=true;eh.length++;var ey=eg.cbsets.head;while(ey!=null){var ed=ey.elt;ed.zip_listeners=true;ed.invalidate_pairs();ey=ey.next}if(eT){var ex=eg.interactors.head;while(ex!=null){ex.elt.wake();ex=ex.next}}el=el.next;ek=ek.next}else{if(eg.ide3.precedence||e4.precedence==e3.precedence&&e4.id>e3.id){break}eq=ev;ev=ev.next}var eW=eg.listeners;var eL;if(aF.zpp_pool==null){eL=new aF()}else{eL=aF.zpp_pool;aF.zpp_pool=eL.next;eL.next=null}eL.elt=e4;var ee=eL;if(eq==null){ee.next=eW.head;eW.head=ee}else{ee.next=eq.next;eq.next=ee}eW.pushmod=eW.modified=true;eW.length++;var eu=eg.cbsets.head;while(eu!=null){var fa=eu.elt;fa.zip_listeners=true;fa.invalidate_pairs();eu=eu.next}if(eT){var et=eg.interactors.head;while(et!=null){et.elt.wake();et=et.next}}el=el.next}else{ef.listeners.remove(e4);var er=ef.cbsets.head;while(er!=null){var e8=er.elt;e8.zip_listeners=true;e8.invalidate_pairs();er=er.next}var eo=null;var ep=ef.listeners.head;while(ep!=null){var e2=ep.elt;if(e4.precedence>e2.precedence||e4.precedence==e2.precedence&&e4.id>e2.id){break}eo=ep;ep=ep.next}var eS=ef.listeners;var eJ;if(aF.zpp_pool==null){eJ=new aF()}else{eJ=aF.zpp_pool;aF.zpp_pool=eJ.next;eJ.next=null}eJ.elt=e4;var ec=eJ;if(eo==null){ec.next=eS.head;eS.head=ec}else{ec.next=eo.next;eo.next=ec}eS.pushmod=eS.modified=true;eS.length++;var eV=ef.cbsets.head;while(eV!=null){var e7=eV.elt;e7.zip_listeners=true;e7.invalidate_pairs();eV=eV.next}if(eT){var eR=ef.interactors.head;while(eR!=null){eR.elt.wake();eR=eR.next}}ek=ek.next}}}while(el!=null){var e6=el.elt;e6.listeners.remove(e4);var eP=e6.cbsets.head;while(eP!=null){var e5=eP.elt;e5.zip_listeners=true;e5.invalidate_pairs();eP=eP.next}var en=null;var eN=e6.listeners.head;while(eN!=null){var e0=eN.elt;if(e4.precedence>e0.precedence||e4.precedence==e0.precedence&&e4.id>e0.id){break}en=eN;eN=eN.next}var eO=e6.listeners;var eH;if(aF.zpp_pool==null){eH=new aF()}else{eH=aF.zpp_pool;aF.zpp_pool=eH.next;eH.next=null}eH.elt=e4;var ea=eH;if(en==null){ea.next=eO.head;eO.head=ea}else{ea.next=en.next;en.next=ea}eO.pushmod=eO.modified=true;eO.length++;var eK=e6.cbsets.head;while(eK!=null){var eY=eK.elt;eY.zip_listeners=true;eY.invalidate_pairs();eK=eK.next}if(eT){var eI=e6.interactors.head;while(eI!=null){eI.elt.wake();eI=eI.next}}el=el.next}while(ek!=null){var eX=ek.elt;eX.listeners.remove(e4);var eG=eX.cbsets.head;while(eG!=null){var eU=eG.elt;eU.zip_listeners=true;eU.invalidate_pairs();eG=eG.next}var em=null;var eF=eX.listeners.head;while(eF!=null){var eZ=eF.elt;if(e4.precedence>eZ.precedence||e4.precedence==eZ.precedence&&e4.id>eZ.id){break}em=eF;eF=eF.next}var eM=eX.listeners;var eE;if(aF.zpp_pool==null){eE=new aF()}else{eE=aF.zpp_pool;aF.zpp_pool=eE.next;eE.next=null}eE.elt=e4;var e9=eE;if(em==null){e9.next=eM.head;eM.head=e9}else{e9.next=em.next;em.next=e9}eM.pushmod=eM.modified=true;eM.length++;var eD=eX.cbsets.head;while(eD!=null){var eQ=eD.elt;eQ.zip_listeners=true;eQ.invalidate_pairs();eD=eD.next}if(eT){var eC=eX.interactors.head;while(eC!=null){eC.elt.wake();eC=eC.next}}ek=ek.next}}};c1.prototype.cbtype_change1=function(ea,ec,eb){this.cbtype_change(this.options1,ea,ec,eb)};c1.prototype.cbtype_change2=function(ea,ec,eb){this.cbtype_change(this.options2,ea,ec,eb)};c1.prototype.cbtype_change=function(en,ee,ei,ek){this.removedFromSpace();if(ei){if(ek){var ed=null;var eb=en.includes.head;while(eb!=null){if(ee.idthis.jointMax){eb-=this.jointMax;this.scale=1;ea=false}else{this.scale=0;eb=0;ea=true}}}return ea};dt.prototype.bodyImpulse=function(ea){if(this.stepped){if(ea==this.b1){return q.get(0,0,-this.scale*this.jAcc)}else{return q.get(0,0,this.ratio*this.scale*this.jAcc)}}else{return q.get(0,0,0)}};dt.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}};dt.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}};dt.prototype.b1=null;dt.prototype.b2=null;dt.prototype.kMass=null;dt.prototype.jAcc=null;dt.prototype.jMax=null;dt.prototype.gamma=null;dt.prototype.bias=null;dt.prototype.stepped=null;dt.prototype.copy=function(ea,eb){var ed=new aA(null,null,this.jointMin,this.jointMax,this.ratio);this.copyto(ed);if(ea!=null&&this.b1!=null){var eh=null;var ec=0;while(ecthis.jointMax){throw new cE("Error: AngleJoint must have jointMin <= jointMax")}if(this.b1.type!=2&&this.b2.type!=2){throw new cE("Error: Constraints cannot have both bodies non-dynamic")}};dt.prototype.wake_connected=function(){if(this.b1!=null&&this.b1.type==2){this.b1.wake()}if(this.b2!=null&&this.b2.type==2){this.b2.wake()}};dt.prototype.forest=function(){if(this.b1.type==2){var en;if(this.b1.component==this.b1.component.parent){en=this.b1.component}else{var eo=this.b1.component;var em=null;while(eo!=eo.parent){var ei=eo.parent;eo.parent=em;em=eo;eo=ei}while(em!=null){var eh=em.parent;em.parent=eo;em=eh}en=eo}var er;if(this.component==this.component.parent){er=this.component}else{var et=this.component;var el=null;while(et!=et.parent){var eg=et.parent;et.parent=el;el=et;et=eg}while(el!=null){var ef=el.parent;el.parent=et;el=ef}er=et}if(en!=er){if(en.ranker.rank){er.parent=en}else{er.parent=en;en.rank++}}}}if(this.b2.type==2){var ee;if(this.b2.component==this.b2.component.parent){ee=this.b2.component}else{var es=this.b2.component;var ek=null;while(es!=es.parent){var ed=es.parent;es.parent=ek;ek=es;es=ed}while(ek!=null){var ec=ek.parent;ek.parent=es;ek=ec}ee=es}var ep;if(this.component==this.component.parent){ep=this.component}else{var eq=this.component;var ej=null;while(eq!=eq.parent){var eb=eq.parent;eq.parent=ej;ej=eq;eq=eb}while(ej!=null){var ea=ej.parent;ej.parent=eq;ej=ea}ep=eq}if(ee!=ep){if(ee.rankep.rank){ep.parent=ee}else{ep.parent=ee;ee.rank++}}}}};dt.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&this.b2.id==ea)){if(this.b1.id==ea){return this.b2.id==eb}else{return false}}else{return true}};dt.prototype.clearcache=function(){this.jAcc=0;this.pre_dt=-1;this.slack=false};dt.prototype.preStep=function(eb){if(this.pre_dt==-1){this.pre_dt=eb}var ee=eb/this.pre_dt;this.pre_dt=eb;this.stepped=true;this.equal=this.jointMin==this.jointMax;var ef=this.ratio*this.b2.rot-this.b1.rot;if(this.equal){ef-=this.jointMax;this.slack=false;this.scale=1}else{if(efthis.jointMax){ef-=this.jointMax;this.scale=1;this.slack=false}else{this.scale=0;ef=0;this.slack=true}}}var ed=ef;if(!this.slack){this.kMass=this.b1.sinertia+this.ratio*this.ratio*this.b2.sinertia;if(this.kMass!=0){this.kMass=1/this.kMass}else{this.jAcc=0}if(!this.stiff){if(this.breakUnderError&&ed*ed>this.maxError*this.maxError){return true}var ea;var eg=2*Math.PI*this.frequency;this.gamma=1/(eb*eg*(2*this.damping+eg*eb));var ec=1/(1+this.gamma);ea=eb*eg*eg*this.gamma;this.gamma*=ec;this.kMass*=ec;this.bias=-ed*ea;if(this.bias<-this.maxError){this.bias=-this.maxError}else{if(this.bias>this.maxError){this.bias=this.maxError}}}else{this.bias=0;this.gamma=0}this.jAcc*=ee;this.jMax=this.maxForce*eb}return false};dt.prototype.warmStart=function(){if(!this.slack){this.b1.angvel-=this.scale*this.b1.iinertia*this.jAcc;this.b2.angvel+=this.ratio*this.scale*this.b2.iinertia*this.jAcc}};dt.prototype.applyImpulseVel=function(){if(this.slack){return false}var ea=this.kMass*(this.bias-this.scale*(this.ratio*(this.b2.angvel+this.b2.kinangvel)-this.b1.angvel-this.b1.kinangvel))-this.jAcc*this.gamma;var eb=this.jAcc;this.jAcc+=ea;if(!this.equal&&this.jAcc>0){this.jAcc=0}if(this.breakUnderForce&&(this.jAcc>this.jMax||this.jAcc<-this.jMax)){return true}if(!this.stiff){if(this.jAcc>this.jMax){this.jAcc=this.jMax}else{if(this.jAcc<-this.jMax){this.jAcc=-this.jMax}}}ea=this.jAcc-eb;this.b1.angvel-=this.scale*this.b1.iinertia*ea;this.b2.angvel+=this.ratio*this.scale*this.b2.iinertia*ea;return false};dt.prototype.applyImpulsePos=function(){var ep;var eh;var el;var ec=this.ratio*this.b2.rot-this.b1.rot;if(this.equal){ec-=this.jointMax;el=false;this.scale=1}else{if(ecthis.jointMax){ec-=this.jointMax;this.scale=1;el=false}else{this.scale=0;ec=0;el=true}}}ep=ec;if(!el){if(this.breakUnderError&&ep*ep>this.maxError*this.maxError){return true}ep*=0.5;eh=-ep*this.kMass;if(this.equal||eh<0){var ej=this.b1;var eg=-this.scale*eh*this.b1.iinertia;ej.rot+=eg;if(eg*eg>0.0001){ej.axisx=Math.sin(ej.rot);ej.axisy=Math.cos(ej.rot)}else{var eb=eg*eg;var ed=1-0.5*eb;var ef=1-eb*eb/8;var ei=(ed*ej.axisx+eg*ej.axisy)*ef;ej.axisy=(ed*ej.axisy-eg*ej.axisx)*ef;ej.axisx=ei}var ek=this.b2;var eo=this.ratio*this.scale*eh*this.b2.iinertia;ek.rot+=eo;if(eo*eo>0.0001){ek.axisx=Math.sin(ek.rot);ek.axisy=Math.cos(ek.rot)}else{var ee=eo*eo;var em=1-0.5*ee;var en=1-ee*ee/8;var ea=(em*ek.axisx+eo*ek.axisy)*en;ek.axisy=(em*ek.axisy-eo*ek.axisx)*en;ek.axisx=ea}}}return false};dt.prototype.draw=function(ea){};dt.prototype.__class__=dt;var cu=zpp_nape.constraint.ZPP_CopyHelper=function(){this.cb=null;this.bc=null;this.id=0};cu.__name__=["zpp_nape","constraint","ZPP_CopyHelper"];cu.dict=function(ec,eb){var ea=new cu();ea.id=ec;ea.bc=eb;return ea};cu.todo=function(ec,ea){var eb=new cu();eb.id=ec;eb.cb=ea;return eb};cu.prototype.id=null;cu.prototype.bc=null;cu.prototype.cb=null;cu.prototype.__class__=cu;var J=zpp_nape.constraint.ZPP_DistanceJoint=function(){this.stepped=false;this.bias=0;this.gamma=0;this.jMax=0;this.jAcc=0;this.kMass=0;this.wrap_a2=null;this.a2rely=0;this.a2relx=0;this.a2localy=0;this.a2localx=0;this.b2=null;this.wrap_a1=null;this.a1rely=0;this.a1relx=0;this.a1localy=0;this.a1localx=0;this.b1=null;this.cx2=0;this.cx1=0;this.ny=0;this.nx=0;this.equal=false;this.slack=false;this.jointMax=0;this.jointMin=0;this.outer_zn=null;b1.call(this);this.a1localx=0;this.a1localy=0;this.a1relx=0;this.a1rely=0;this.a2localx=0;this.a2localy=0;this.a2relx=0;this.a2rely=0;this.jAcc=0;this.jMax=Infinity;this.stepped=false;this.cx1=this.cx2=0};J.__name__=["zpp_nape","constraint","ZPP_DistanceJoint"];J.__super__=b1;J.prototype=Object.create(b1.prototype);J.prototype.outer_zn=null;J.prototype.jointMin=null;J.prototype.jointMax=null;J.prototype.slack=null;J.prototype.equal=null;J.prototype.is_slack=function(){var eb;this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var ea=0;var ee=0;ea=this.b2.posx+this.a2relx-(this.b1.posx+this.a1relx);ee=this.b2.posy+this.a2rely-(this.b1.posy+this.a1rely);var ed=ea*ea+ee*ee;if(edthis.jointMax){ed-=this.jointMax;eb=false}else{ea=0;ee=0;ed=0;eb=true}}}}return eb};J.prototype.nx=null;J.prototype.ny=null;J.prototype.cx1=null;J.prototype.cx2=null;J.prototype.bodyImpulse=function(ea){if(this.stepped){if(ea==this.b1){return q.get(-this.jAcc*this.nx,-this.jAcc*this.ny,-this.cx1*this.jAcc)}else{return q.get(this.jAcc*this.nx,this.jAcc*this.ny,this.cx2*this.jAcc)}}else{return q.get(0,0,0)}};J.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}};J.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}};J.prototype.b1=null;J.prototype.a1localx=null;J.prototype.a1localy=null;J.prototype.a1relx=null;J.prototype.a1rely=null;J.prototype.validate_a1=function(){this.wrap_a1.zpp_inner.x=this.a1localx;this.wrap_a1.zpp_inner.y=this.a1localy};J.prototype.invalidate_a1=function(ea){this.immutable_midstep("Constraint::a1");this.a1localx=ea.x;this.a1localy=ea.y;this.wake()};J.prototype.setup_a1=function(){var ea=this.a1localx;var eh=this.a1localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a1=eb;this.wrap_a1.zpp_inner._inuse=true;this.wrap_a1.zpp_inner._validate=dX(this,this.validate_a1);this.wrap_a1.zpp_inner._invalidate=dX(this,this.invalidate_a1)};J.prototype.wrap_a1=null;J.prototype.b2=null;J.prototype.a2localx=null;J.prototype.a2localy=null;J.prototype.a2relx=null;J.prototype.a2rely=null;J.prototype.validate_a2=function(){this.wrap_a2.zpp_inner.x=this.a2localx;this.wrap_a2.zpp_inner.y=this.a2localy};J.prototype.invalidate_a2=function(ea){this.immutable_midstep("Constraint::a2");this.a2localx=ea.x;this.a2localy=ea.y;this.wake()};J.prototype.setup_a2=function(){var ea=this.a2localx;var eh=this.a2localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a2=eb;this.wrap_a2.zpp_inner._inuse=true;this.wrap_a2.zpp_inner._validate=dX(this,this.validate_a2);this.wrap_a2.zpp_inner._invalidate=dX(this,this.invalidate_a2)};J.prototype.wrap_a2=null;J.prototype.kMass=null;J.prototype.jAcc=null;J.prototype.jMax=null;J.prototype.gamma=null;J.prototype.bias=null;J.prototype.stepped=null;J.prototype.copy=function(ea,eb){var ee=this.outer_zn;if(ee.zpp_inner_zn.wrap_a1==null){ee.zpp_inner_zn.setup_a1()}var ec=ee.zpp_inner_zn.wrap_a1;var eg=this.outer_zn;if(eg.zpp_inner_zn.wrap_a2==null){eg.zpp_inner_zn.setup_a2()}var ef=new dx(null,null,ec,eg.zpp_inner_zn.wrap_a2,this.jointMin,this.jointMax);this.copyto(ef);if(ea!=null&&this.b1!=null){var ek=null;var ed=0;while(edthis.jointMax){throw new cE("Error: DistanceJoint must have jointMin <= jointMax")}if(this.b1.type!=2&&this.b2.type!=2){throw new cE("Error: Constraints cannot have both bodies non-dynamic")}};J.prototype.wake_connected=function(){if(this.b1!=null&&this.b1.type==2){this.b1.wake()}if(this.b2!=null&&this.b2.type==2){this.b2.wake()}};J.prototype.forest=function(){if(this.b1.type==2){var en;if(this.b1.component==this.b1.component.parent){en=this.b1.component}else{var eo=this.b1.component;var em=null;while(eo!=eo.parent){var ei=eo.parent;eo.parent=em;em=eo;eo=ei}while(em!=null){var eh=em.parent;em.parent=eo;em=eh}en=eo}var er;if(this.component==this.component.parent){er=this.component}else{var et=this.component;var el=null;while(et!=et.parent){var eg=et.parent;et.parent=el;el=et;et=eg}while(el!=null){var ef=el.parent;el.parent=et;el=ef}er=et}if(en!=er){if(en.ranker.rank){er.parent=en}else{er.parent=en;en.rank++}}}}if(this.b2.type==2){var ee;if(this.b2.component==this.b2.component.parent){ee=this.b2.component}else{var es=this.b2.component;var ek=null;while(es!=es.parent){var ed=es.parent;es.parent=ek;ek=es;es=ed}while(ek!=null){var ec=ek.parent;ek.parent=es;ek=ec}ee=es}var ep;if(this.component==this.component.parent){ep=this.component}else{var eq=this.component;var ej=null;while(eq!=eq.parent){var eb=eq.parent;eq.parent=ej;ej=eq;eq=eb}while(ej!=null){var ea=ej.parent;ej.parent=eq;ej=ea}ep=eq}if(ee!=ep){if(ee.rankep.rank){ep.parent=ee}else{ep.parent=ee;ee.rank++}}}}};J.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&this.b2.id==ea)){if(this.b1.id==ea){return this.b2.id==eb}else{return false}}else{return true}};J.prototype.clearcache=function(){this.jAcc=0;this.pre_dt=-1};J.prototype.preStep=function(ec){if(this.pre_dt==-1){this.pre_dt=ec}var ef=ec/this.pre_dt;this.pre_dt=ec;this.stepped=true;this.equal=this.jointMin==this.jointMax;this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;this.nx=this.b2.posx+this.a2relx-(this.b1.posx+this.a1relx);this.ny=this.b2.posy+this.a2rely-(this.b1.posy+this.a1rely);var eg=this.nx*this.nx+this.ny*this.ny;if(egthis.jointMax){eg-=this.jointMax;this.slack=false}else{this.nx=0;this.ny=0;eg=0;this.slack=true}}}}var ee=eg;if(!this.slack){this.cx1=this.ny*this.a1relx-this.nx*this.a1rely;this.cx2=this.ny*this.a2relx-this.nx*this.a2rely;this.kMass=this.b1.smass+this.b2.smass+this.cx1*this.cx1*this.b1.sinertia+this.cx2*this.cx2*this.b2.sinertia;if(this.kMass!=0){this.kMass=1/this.kMass}else{this.jAcc=0}if(!this.stiff){if(this.breakUnderError&&ee*ee>this.maxError*this.maxError){return true}var ea;var eh=2*Math.PI*this.frequency;this.gamma=1/(ec*eh*(2*this.damping+eh*ec));var ed=1/(1+this.gamma);ea=ec*eh*eh*this.gamma;this.gamma*=ed;this.kMass*=ed;this.bias=-ee*ea;if(this.bias<-this.maxError){this.bias=-this.maxError}else{if(this.bias>this.maxError){this.bias=this.maxError}}}else{this.bias=0;this.gamma=0}this.jAcc*=ef;this.jMax=this.maxForce*ec}return false};J.prototype.warmStart=function(){if(!this.slack){var ea=this.b1.imass*this.jAcc;this.b1.velx-=this.nx*ea;this.b1.vely-=this.ny*ea;var eb=this.b2.imass*this.jAcc;this.b2.velx+=this.nx*eb;this.b2.vely+=this.ny*eb;this.b1.angvel-=this.cx1*this.b1.iinertia*this.jAcc;this.b2.angvel+=this.cx2*this.b2.iinertia*this.jAcc}};J.prototype.applyImpulseVel=function(){if(this.slack){return false}var ea=this.kMass*(this.bias-(this.nx*(this.b2.velx+this.b2.kinvelx-this.b1.velx-this.b1.kinvelx)+this.ny*(this.b2.vely+this.b2.kinvely-this.b1.vely-this.b1.kinvely)+(this.b2.angvel+this.b2.kinangvel)*this.cx2-(this.b1.angvel+this.b1.kinangvel)*this.cx1))-this.jAcc*this.gamma;var ed=this.jAcc;this.jAcc+=ea;if(!this.equal&&this.jAcc>0){this.jAcc=0}if(this.breakUnderForce&&this.jAcc<-this.jMax){return true}if(!this.stiff){if(this.jAcc<-this.jMax){this.jAcc=-this.jMax}}ea=this.jAcc-ed;var eb=this.b1.imass*ea;this.b1.velx-=this.nx*eb;this.b1.vely-=this.ny*eb;var ec=this.b2.imass*ea;this.b2.velx+=this.nx*ec;this.b2.vely+=this.ny*ec;this.b1.angvel-=this.cx1*this.b1.iinertia*ea;this.b2.angvel+=this.cx2*this.b2.iinertia*ea;return false};J.prototype.applyImpulsePos=function(){var eo;var eB;var ef=0;var ee=0;ef=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;ee=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;var eq=0;var en=0;eq=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;en=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var ed;var eF=0;var eE=0;eF=this.b2.posx+eq-(this.b1.posx+ef);eE=this.b2.posy+en-(this.b1.posy+ee);var et=eF*eF+eE*eE;if(etthis.jointMax){et-=this.jointMax;ed=false}else{eF=0;eE=0;et=0;ed=true}}}}eo=et;if(!ed){if(this.breakUnderError&&eo*eo>this.maxError*this.maxError){return true}if(eo*eo6){var eA=this.b1.smass+this.b2.smass;if(eA>P.epsilon){eA=0.75/eA;eB=-eo*eA;if(this.equal||eB<0){var em=eB*this.b1.imass;this.b1.posx-=eF*em;this.b1.posy-=eE*em;var el=eB*this.b2.imass;this.b2.posx+=eF*el;this.b2.posy+=eE*el;eF=this.b2.posx+eq-(this.b1.posx+ef);eE=this.b2.posy+en-(this.b1.posy+ee);var eC=eF*eF+eE*eE;if(eCthis.jointMax){eC-=this.jointMax}else{eF=0;eE=0;eC=0}}}}eo=eC;eo*=0.5}}}var es;var er;es=eE*ef-eF*ee;er=eE*eq-eF*en;var ej=this.b1.smass+this.b2.smass+es*es*this.b1.sinertia+er*er*this.b2.sinertia;if(ej!=0){ej=1/ej}eB=-eo*ej;if(this.equal||eB<0){var ei=this.b1.imass*eB;this.b1.posx-=eF*ei;this.b1.posy-=eE*ei;var eh=this.b2.imass*eB;this.b2.posx+=eF*eh;this.b2.posy+=eE*eh;var ez=this.b1;var ev=-es*this.b1.iinertia*eB;ez.rot+=ev;if(ev*ev>0.0001){ez.axisx=Math.sin(ez.rot);ez.axisy=Math.cos(ez.rot)}else{var eG=ev*ev;var eu=1-0.5*eG;var ey=1-eG*eG/8;var ex=(eu*ez.axisx+ev*ez.axisy)*ey;ez.axisy=(eu*ez.axisy-ev*ez.axisx)*ey;ez.axisx=ex}var eD=this.b2;var ec=er*this.b2.iinertia*eB;eD.rot+=ec;if(ec*ec>0.0001){eD.axisx=Math.sin(eD.rot);eD.axisy=Math.cos(eD.rot)}else{var eg=ec*ec;var eb=1-0.5*eg;var ea=1-eg*eg/8;var ew=(eb*eD.axisx+ec*eD.axisy)*ea;eD.axisy=(eb*eD.axisy-ec*eD.axisx)*ea;eD.axisx=ew}}}return false};J.prototype.draw=function(ea){};J.prototype.__class__=J;var bR=zpp_nape.constraint.ZPP_LineJoint=function(){this.biasy=0;this.biasx=0;this.jAccy=0;this.jAccx=0;this.kMassc=0;this.kMassb=0;this.kMassa=0;this.wrap_n=null;this.nrely=0;this.nrelx=0;this.nlocaly=0;this.nlocalx=0;this.wrap_a2=null;this.a2rely=0;this.a2relx=0;this.a2localy=0;this.a2localx=0;this.wrap_a1=null;this.a1rely=0;this.a1relx=0;this.a1localy=0;this.a1localx=0;this.cx2=0;this.cx1=0;this.dot2=0;this.dot1=0;this.equal=false;this.jointMax=0;this.jointMin=0;this.scale=0;this.outer_zn=null;b1.call(this);this.a1localx=0;this.a1localy=0;this.a1relx=0;this.a1rely=0;this.a2localx=0;this.a2localy=0;this.a2relx=0;this.a2rely=0;this.nlocalx=0;this.nlocaly=0;this.nrelx=0;this.nrely=0;this.jAccx=0;this.jAccy=0;this.jMax=Infinity;this.jointMin=-Infinity;this.jointMax=Infinity;this.stepped=false};bR.__name__=["zpp_nape","constraint","ZPP_LineJoint"];bR.__super__=b1;bR.prototype=Object.create(b1.prototype);bR.prototype.outer_zn=null;bR.prototype.scale=null;bR.prototype.jointMin=null;bR.prototype.jointMax=null;bR.prototype.equal=null;bR.prototype.dot1=null;bR.prototype.dot2=null;bR.prototype.cx1=null;bR.prototype.cx2=null;bR.prototype.bodyImpulse=function(ea){if(this.stepped){var ec=this.scale*this.nrelx*this.jAccy-this.nrely*this.jAccx;var eb=this.nrelx*this.jAccx+this.scale*this.nrely*this.jAccy;if(ea==this.b1){return q.get(-ec,-eb,this.scale*this.cx1*eb-this.dot1*ec)}else{return q.get(ec,eb,this.scale*this.cx1*eb-this.dot1*ec)}}else{return q.get(0,0,0)}};bR.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}};bR.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}};bR.prototype.b1=null;bR.prototype.a1localx=null;bR.prototype.a1localy=null;bR.prototype.a1relx=null;bR.prototype.a1rely=null;bR.prototype.validate_a1=function(){this.wrap_a1.zpp_inner.x=this.a1localx;this.wrap_a1.zpp_inner.y=this.a1localy};bR.prototype.invalidate_a1=function(ea){this.immutable_midstep("Constraint::a1");this.a1localx=ea.x;this.a1localy=ea.y;this.wake()};bR.prototype.setup_a1=function(){var ea=this.a1localx;var eh=this.a1localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a1=eb;this.wrap_a1.zpp_inner._inuse=true;this.wrap_a1.zpp_inner._validate=dX(this,this.validate_a1);this.wrap_a1.zpp_inner._invalidate=dX(this,this.invalidate_a1)};bR.prototype.wrap_a1=null;bR.prototype.b2=null;bR.prototype.a2localx=null;bR.prototype.a2localy=null;bR.prototype.a2relx=null;bR.prototype.a2rely=null;bR.prototype.validate_a2=function(){this.wrap_a2.zpp_inner.x=this.a2localx;this.wrap_a2.zpp_inner.y=this.a2localy};bR.prototype.invalidate_a2=function(ea){this.immutable_midstep("Constraint::a2");this.a2localx=ea.x;this.a2localy=ea.y;this.wake()};bR.prototype.setup_a2=function(){var ea=this.a2localx;var eh=this.a2localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a2=eb;this.wrap_a2.zpp_inner._inuse=true;this.wrap_a2.zpp_inner._validate=dX(this,this.validate_a2);this.wrap_a2.zpp_inner._invalidate=dX(this,this.invalidate_a2)};bR.prototype.wrap_a2=null;bR.prototype.zip_n=null;bR.prototype.nlocalx=null;bR.prototype.nlocaly=null;bR.prototype.nrelx=null;bR.prototype.nrely=null;bR.prototype.validate_n=function(){this.wrap_n.zpp_inner.x=this.nlocalx;this.wrap_n.zpp_inner.y=this.nlocaly};bR.prototype.invalidate_n=function(ea){this.immutable_midstep("Constraint::n");this.nlocalx=ea.x;this.nlocaly=ea.y;this.zip_n=true;this.wake()};bR.prototype.setup_n=function(){var ea=this.nlocalx;var eh=this.nlocaly;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_n=eb;this.wrap_n.zpp_inner._inuse=true;this.wrap_n.zpp_inner._validate=dX(this,this.validate_n);this.wrap_n.zpp_inner._invalidate=dX(this,this.invalidate_n)};bR.prototype.wrap_n=null;bR.prototype.validate_norm=function(){if(this.zip_n){this.zip_n=false;var ea=1/Math.sqrt(this.nlocalx*this.nlocalx+this.nlocaly*this.nlocaly);this.nlocalx*=ea;this.nlocaly*=ea}};bR.prototype.kMassa=null;bR.prototype.kMassb=null;bR.prototype.kMassc=null;bR.prototype.jAccx=null;bR.prototype.jAccy=null;bR.prototype.jMax=null;bR.prototype.gamma=null;bR.prototype.biasx=null;bR.prototype.biasy=null;bR.prototype.stepped=null;bR.prototype.copy=function(ea,eb){var ef=this.outer_zn;if(ef.zpp_inner_zn.wrap_a1==null){ef.zpp_inner_zn.setup_a1()}var ed=ef.zpp_inner_zn.wrap_a1;var ei=this.outer_zn;if(ei.zpp_inner_zn.wrap_a2==null){ei.zpp_inner_zn.setup_a2()}var ec=ei.zpp_inner_zn.wrap_a2;var eg=this.outer_zn;if(eg.zpp_inner_zn.wrap_n==null){eg.zpp_inner_zn.setup_n()}var eh=new aO(null,null,ed,ec,eg.zpp_inner_zn.wrap_n,this.jointMin,this.jointMax);this.copyto(eh);if(ea!=null&&this.b1!=null){var em=null;var ee=0;while(eethis.jointMax){throw new cE("Error: DistanceJoint must have jointMin <= jointMax")}if(this.nlocalx*this.nlocalx+this.nlocaly*this.nlocalyer.rank){er.parent=en}else{er.parent=en;en.rank++}}}}if(this.b2.type==2){var ee;if(this.b2.component==this.b2.component.parent){ee=this.b2.component}else{var es=this.b2.component;var ek=null;while(es!=es.parent){var ed=es.parent;es.parent=ek;ek=es;es=ed}while(ek!=null){var ec=ek.parent;ek.parent=es;ek=ec}ee=es}var ep;if(this.component==this.component.parent){ep=this.component}else{var eq=this.component;var ej=null;while(eq!=eq.parent){var eb=eq.parent;eq.parent=ej;ej=eq;eq=eb}while(ej!=null){var ea=ej.parent;ej.parent=eq;ej=ea}ep=eq}if(ee!=ep){if(ee.rankep.rank){ep.parent=ee}else{ep.parent=ee;ee.rank++}}}}};bR.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&this.b2.id==ea)){if(this.b1.id==ea){return this.b2.id==eb}else{return false}}else{return true}};bR.prototype.clearcache=function(){this.jAccx=0;this.jAccy=0;this.pre_dt=-1};bR.prototype.preStep=function(eo){if(this.pre_dt==-1){this.pre_dt=eo}var eq=eo/this.pre_dt;this.pre_dt=eo;this.equal=this.jointMin==this.jointMax;this.stepped=true;this.validate_norm();this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.nrelx=this.b1.axisy*this.nlocalx-this.b1.axisx*this.nlocaly;this.nrely=this.nlocalx*this.b1.axisx+this.nlocaly*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var ej=0;var ei=0;var ed=0;var ec=0;ej=this.b2.posx+this.a2relx-this.b1.posx-this.a1relx;ei=this.b2.posy+this.a2rely-this.b1.posy-this.a1rely;ed=ei*this.nrelx-ej*this.nrely;ec=this.nrelx*ej+this.nrely*ei;if(this.equal){ec-=this.jointMin;this.scale=1}else{if(ec>this.jointMax){ec-=this.jointMax;this.scale=1}else{if(ecthis.maxError*this.maxError){return true}var ea;var ep=2*Math.PI*this.frequency;this.gamma=1/(eo*ep*(2*this.damping+ep*eo));var el=1/(1+this.gamma);ea=eo*ep*ep*this.gamma;this.gamma*=el;this.kMassa*=el;this.kMassb*=el;this.kMassc*=el;this.biasx=ed;this.biasy=ec;var eh=-ea;this.biasx*=eh;this.biasy*=eh;var eg=this.maxError;var ee=this.biasx*this.biasx+this.biasy*this.biasy;if(ee>eg*eg){var ef=eg*(1/Math.sqrt(ee));this.biasx*=ef;this.biasy*=ef}}else{this.gamma=0;this.biasx=0;this.biasy=0}this.jAccx*=eq;this.jAccy*=eq;this.jMax=this.maxForce*eo;return false};bR.prototype.warmStart=function(){var eb=this.scale*this.nrelx*this.jAccy-this.nrely*this.jAccx;var ea=this.nrelx*this.jAccx+this.scale*this.nrely*this.jAccy;var ec=this.b1.imass;this.b1.velx-=eb*ec;this.b1.vely-=ea*ec;var ed=this.b2.imass;this.b2.velx+=eb*ed;this.b2.vely+=ea*ed;this.b1.angvel+=(this.scale*this.cx1*this.jAccy-this.dot1*this.jAccx)*this.b1.iinertia;this.b2.angvel+=(this.dot2*this.jAccx-this.scale*this.cx2*this.jAccy)*this.b2.iinertia};bR.prototype.applyImpulseVel=function(){var eo=0;var en=0;var ej=0;var eg=0;ej=this.b2.velx-this.b1.velx;eg=this.b2.vely-this.b1.vely;ej+=this.b2.kinvelx-this.b1.kinvelx;eg+=this.b2.kinvely-this.b1.kinvely;eo=eg*this.nrelx-ej*this.nrely+(this.b2.angvel+this.b2.kinangvel)*this.dot2-(this.b1.angvel+this.b1.kinangvel)*this.dot1;en=this.scale*(this.nrelx*ej+this.nrely*eg-(this.b2.angvel+this.b2.kinangvel)*this.cx2+(this.b1.angvel+this.b1.kinangvel)*this.cx1);var ea=0;var eq=0;ea=this.biasx-eo;eq=this.biasy-en;var ep=this.kMassa*ea+this.kMassb*eq;eq=this.kMassb*ea+this.kMassc*eq;ea=ep;var ek=this.gamma;ea-=this.jAccx*ek;eq-=this.jAccy*ek;var em=0;var el=0;em=this.jAccx;el=this.jAccy;this.jAccx+=ea;this.jAccy+=eq;if(this.jAccy>0){this.jAccy=0}if(this.breakUnderForce){if(this.jAccx*this.jAccx+this.jAccy*this.jAccy>this.jMax*this.jMax){return true}}else{if(!this.stiff){var ei=this.jMax;var ef=this.jAccx*this.jAccx+this.jAccy*this.jAccy;if(ef>ei*ei){var ee=ei*(1/Math.sqrt(ef));this.jAccx*=ee;this.jAccy*=ee}}}ea=this.jAccx-em;eq=this.jAccy-el;var eh=this.scale*this.nrelx*eq-this.nrely*ea;var ed=this.nrelx*ea+this.scale*this.nrely*eq;var ec=this.b1.imass;this.b1.velx-=eh*ec;this.b1.vely-=ed*ec;var eb=this.b2.imass;this.b2.velx+=eh*eb;this.b2.vely+=ed*eb;this.b1.angvel+=(this.scale*this.cx1*eq-this.dot1*ea)*this.b1.iinertia;this.b2.angvel+=(this.dot2*ea-this.scale*this.cx2*eq)*this.b2.iinertia;return false};bR.prototype.applyImpulsePos=function(){var eI=0;var eF=0;eI=this.b1.axisy*this.nlocalx-this.b1.axisx*this.nlocaly;eF=this.nlocalx*this.b1.axisx+this.nlocaly*this.b1.axisy;var eo=0;var en=0;eo=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;en=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;var eh=0;var ef=0;eh=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;ef=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var ec=0;var ea=0;var ex;var eg=0;var ee=0;ec=this.b2.posx+eh-this.b1.posx-eo;ea=this.b2.posy+ef-this.b1.posy-en;eg=ea*eI-ec*eF;ee=eI*ec+eF*ea;if(this.equal){ee-=this.jointMin;ex=1}else{if(ee>this.jointMax){ee-=this.jointMax;ex=1}else{if(eethis.maxError*this.maxError){return true}if(eg*eg+ee*ee6){var eO=this.b1.smass+this.b2.smass;if(eO>P.epsilon){eO=0.8/eO;var eA=eO*(eF*eg-ex*eI*ee);var ej=eO*(eI*eg*ex-eF*eg);var eC=this.b1.imass;this.b1.posx-=eA*eC;this.b1.posy-=ej*eC;var ey=this.b2.imass;this.b2.posx+=eA*ey;this.b2.posy+=ej*ey;ec=this.b2.posx+eh-this.b1.posx-eo;ea=this.b2.posy+ef-this.b1.posy-en;eg=ea*eI-ec*eF;ee=eI*ec+eF*ea;if(this.equal){ee-=this.jointMin;ex=1}else{if(ee>this.jointMax){ee-=this.jointMax;ex=1}else{if(ee0){eq=0}var eM=ex*eI*eq-eF*et;var eJ=eI*et+ex*eF*eq;var ev=this.b1.imass;this.b1.posx-=eM*ev;this.b1.posy-=eJ*ev;var eu=this.b2.imass;this.b2.posx+=eM*eu;this.b2.posy+=eJ*eu;var eb=this.b1;var ed=(ex*eN*eq-eG*et)*this.b1.iinertia;eb.rot+=ed;if(ed*ed>0.0001){eb.axisx=Math.sin(eb.rot);eb.axisy=Math.cos(eb.rot)}else{var eH=ed*ed;var eD=1-0.5*eH;var eK=1-eH*eH/8;var es=(eD*eb.axisx+ed*eb.axisy)*eK;eb.axisy=(eD*eb.axisy-ed*eb.axisx)*eK;eb.axisx=es}var eB=this.b2;var ez=(eE*et-ex*eL*eq)*this.b2.iinertia;eB.rot+=ez;if(ez*ez>0.0001){eB.axisx=Math.sin(eB.rot);eB.axisy=Math.cos(eB.rot)}else{var er=ez*ez;var eQ=1-0.5*er;var eP=1-er*er/8;var ep=(eQ*eB.axisx+ez*eB.axisy)*eP;eB.axisy=(eQ*eB.axisy-ez*eB.axisx)*eP;eB.axisx=ep}return false};bR.prototype.draw=function(ea){};bR.prototype.__class__=bR;var y=zpp_nape.constraint.ZPP_MotorJoint=function(){this.stepped=false;this.jMax=0;this.jAcc=0;this.kMass=0;this.b2=null;this.b1=null;this.rate=0;this.ratio=0;this.outer_zn=null;b1.call(this);this.jAcc=0;this.stepped=false;this.__velocity=true};y.__name__=["zpp_nape","constraint","ZPP_MotorJoint"];y.__super__=b1;y.prototype=Object.create(b1.prototype);y.prototype.outer_zn=null;y.prototype.ratio=null;y.prototype.rate=null;y.prototype.bodyImpulse=function(ea){if(this.stepped){if(ea==this.b1){return q.get(0,0,-this.jAcc)}else{return q.get(0,0,this.ratio*this.jAcc)}}else{return q.get(0,0,0)}};y.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}};y.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}};y.prototype.b1=null;y.prototype.b2=null;y.prototype.kMass=null;y.prototype.jAcc=null;y.prototype.jMax=null;y.prototype.stepped=null;y.prototype.copy=function(ea,eb){var ed=new bQ(null,null,this.rate,this.ratio);this.copyto(ed);if(ea!=null&&this.b1!=null){var eh=null;var ec=0;while(ecer.rank){er.parent=en}else{er.parent=en;en.rank++}}}}if(this.b2.type==2){var ee;if(this.b2.component==this.b2.component.parent){ee=this.b2.component}else{var es=this.b2.component;var ek=null;while(es!=es.parent){var ed=es.parent;es.parent=ek;ek=es;es=ed}while(ek!=null){var ec=ek.parent;ek.parent=es;ek=ec}ee=es}var ep;if(this.component==this.component.parent){ep=this.component}else{var eq=this.component;var ej=null;while(eq!=eq.parent){var eb=eq.parent;eq.parent=ej;ej=eq;eq=eb}while(ej!=null){var ea=ej.parent;ej.parent=eq;ej=ea}ep=eq}if(ee!=ep){if(ee.rankep.rank){ep.parent=ee}else{ep.parent=ee;ee.rank++}}}}};y.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&this.b2.id==ea)){if(this.b1.id==ea){return this.b2.id==eb}else{return false}}else{return true}};y.prototype.clearcache=function(){this.jAcc=0;this.pre_dt=-1};y.prototype.preStep=function(ea){if(this.pre_dt==-1){this.pre_dt=ea}var eb=ea/this.pre_dt;this.pre_dt=ea;this.stepped=true;this.kMass=this.b1.sinertia+this.ratio*this.ratio*this.b2.sinertia;this.kMass=1/this.kMass;this.jAcc*=eb;this.jMax=this.maxForce*ea;return false};y.prototype.warmStart=function(){this.b1.angvel-=this.b1.iinertia*this.jAcc;this.b2.angvel+=this.ratio*this.b2.iinertia*this.jAcc};y.prototype.applyImpulseVel=function(){var ea=-this.kMass*(this.ratio*(this.b2.angvel+this.b2.kinangvel)-this.b1.angvel-this.b1.kinangvel-this.rate);var eb=this.jAcc;this.jAcc+=ea;if(this.breakUnderForce){if(this.jAcc>this.jMax||this.jAcc<-this.jMax){return true}}else{if(this.jAcc<-this.jMax){this.jAcc=-this.jMax}else{if(this.jAcc>this.jMax){this.jAcc=this.jMax}}}ea=this.jAcc-eb;this.b1.angvel-=this.b1.iinertia*ea;this.b2.angvel+=this.ratio*this.b2.iinertia*ea;return false};y.prototype.applyImpulsePos=function(){return false};y.prototype.__class__=y;var D=zpp_nape.constraint.ZPP_PivotJoint=function(){this.stepped=false;this.biasy=0;this.biasx=0;this.gamma=0;this.jMax=0;this.jAccy=0;this.jAccx=0;this.kMassc=0;this.kMassb=0;this.kMassa=0;this.wrap_a2=null;this.a2rely=0;this.a2relx=0;this.a2localy=0;this.a2localx=0;this.b2=null;this.wrap_a1=null;this.a1rely=0;this.a1relx=0;this.a1localy=0;this.a1localx=0;this.b1=null;this.outer_zn=null;b1.call(this);this.stepped=false;this.jAccx=0;this.jAccy=0;this.jMax=Infinity;this.a1localx=0;this.a1localy=0;this.a1relx=0;this.a1rely=0;this.a2localx=0;this.a2localy=0;this.a2relx=0;this.a2rely=0};D.__name__=["zpp_nape","constraint","ZPP_PivotJoint"];D.__super__=b1;D.prototype=Object.create(b1.prototype);D.prototype.outer_zn=null;D.prototype.bodyImpulse=function(ea){if(this.stepped){if(ea==this.b1){return q.get(-this.jAccx,-this.jAccy,-(this.jAccy*this.a1relx-this.jAccx*this.a1rely))}else{return q.get(this.jAccx,this.jAccy,this.jAccy*this.a2relx-this.jAccx*this.a2rely)}}else{return q.get(0,0,0)}};D.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}};D.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}};D.prototype.b1=null;D.prototype.a1localx=null;D.prototype.a1localy=null;D.prototype.a1relx=null;D.prototype.a1rely=null;D.prototype.validate_a1=function(){this.wrap_a1.zpp_inner.x=this.a1localx;this.wrap_a1.zpp_inner.y=this.a1localy};D.prototype.invalidate_a1=function(ea){this.immutable_midstep("Constraint::a1");this.a1localx=ea.x;this.a1localy=ea.y;this.wake()};D.prototype.setup_a1=function(){var ea=this.a1localx;var eh=this.a1localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a1=eb;this.wrap_a1.zpp_inner._inuse=true;this.wrap_a1.zpp_inner._validate=dX(this,this.validate_a1);this.wrap_a1.zpp_inner._invalidate=dX(this,this.invalidate_a1)};D.prototype.wrap_a1=null;D.prototype.b2=null;D.prototype.a2localx=null;D.prototype.a2localy=null;D.prototype.a2relx=null;D.prototype.a2rely=null;D.prototype.validate_a2=function(){this.wrap_a2.zpp_inner.x=this.a2localx;this.wrap_a2.zpp_inner.y=this.a2localy};D.prototype.invalidate_a2=function(ea){this.immutable_midstep("Constraint::a2");this.a2localx=ea.x;this.a2localy=ea.y;this.wake()};D.prototype.setup_a2=function(){var ea=this.a2localx;var eh=this.a2localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a2=eb;this.wrap_a2.zpp_inner._inuse=true;this.wrap_a2.zpp_inner._validate=dX(this,this.validate_a2);this.wrap_a2.zpp_inner._invalidate=dX(this,this.invalidate_a2)};D.prototype.wrap_a2=null;D.prototype.kMassa=null;D.prototype.kMassb=null;D.prototype.kMassc=null;D.prototype.jAccx=null;D.prototype.jAccy=null;D.prototype.jMax=null;D.prototype.gamma=null;D.prototype.biasx=null;D.prototype.biasy=null;D.prototype.stepped=null;D.prototype.copy=function(ea,eb){var ee=this.outer_zn;if(ee.zpp_inner_zn.wrap_a1==null){ee.zpp_inner_zn.setup_a1()}var ec=ee.zpp_inner_zn.wrap_a1;var eg=this.outer_zn;if(eg.zpp_inner_zn.wrap_a2==null){eg.zpp_inner_zn.setup_a2()}var ef=new bV(null,null,ec,eg.zpp_inner_zn.wrap_a2);this.copyto(ef);if(ea!=null&&this.b1!=null){var ek=null;var ed=0;while(eder.rank){er.parent=en}else{er.parent=en;en.rank++}}}}if(this.b2.type==2){var ee;if(this.b2.component==this.b2.component.parent){ee=this.b2.component}else{var es=this.b2.component;var ek=null;while(es!=es.parent){var ed=es.parent;es.parent=ek;ek=es;es=ed}while(ek!=null){var ec=ek.parent;ek.parent=es;ek=ec}ee=es}var ep;if(this.component==this.component.parent){ep=this.component}else{var eq=this.component;var ej=null;while(eq!=eq.parent){var eb=eq.parent;eq.parent=ej;ej=eq;eq=eb}while(ej!=null){var ea=ej.parent;ej.parent=eq;ej=ea}ep=eq}if(ee!=ep){if(ee.rankep.rank){ep.parent=ee}else{ep.parent=ee;ee.rank++}}}}};D.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&this.b2.id==ea)){if(this.b1.id==ea){return this.b2.id==eb}else{return false}}else{return true}};D.prototype.clearcache=function(){this.jAccx=0;this.jAccy=0;this.pre_dt=-1};D.prototype.preStep=function(el){if(this.pre_dt==-1){this.pre_dt=el}var en=el/this.pre_dt;this.pre_dt=el;this.stepped=true;this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var eo=this.b1.smass+this.b2.smass;this.kMassa=eo;this.kMassb=0;this.kMassc=eo;if(this.b1.sinertia!=0){var ec=this.a1relx*this.b1.sinertia;var eb=this.a1rely*this.b1.sinertia;this.kMassa+=eb*this.a1rely;this.kMassb+=-eb*this.a1relx;this.kMassc+=ec*this.a1relx}if(this.b2.sinertia!=0){var er=this.a2relx*this.b2.sinertia;var ee=this.a2rely*this.b2.sinertia;this.kMassa+=ee*this.a2rely;this.kMassb+=-ee*this.a2relx;this.kMassc+=er*this.a2relx}var ed=this.kMassa*this.kMassc-this.kMassb*this.kMassb;var eq;if(ed!=ed){this.kMassa=this.kMassb=this.kMassc=0;eq=3}else{if(ed==0){var ep=0;if(this.kMassa!=0){this.kMassa=1/this.kMassa}else{this.kMassa=0;ep=1}if(this.kMassc!=0){this.kMassc=1/this.kMassc}else{this.kMassc=0;ep|=2}this.kMassb=0;eq=ep}else{ed=1/ed;var ej=this.kMassc*ed;this.kMassc=this.kMassa*ed;this.kMassa=ej;this.kMassb*=-ed;eq=0}}if((eq&1)!=0){this.jAccx=0}if((eq&2)!=0){this.jAccy=0}if(!this.stiff){var ea;var em=2*Math.PI*this.frequency;this.gamma=1/(el*em*(2*this.damping+em*el));var ek=1/(1+this.gamma);ea=el*em*em*this.gamma;this.gamma*=ek;this.kMassa*=ek;this.kMassb*=ek;this.kMassc*=ek;this.biasx=this.b2.posx+this.a2relx-(this.b1.posx+this.a1relx);this.biasy=this.b2.posy+this.a2rely-(this.b1.posy+this.a1rely);if(this.breakUnderError&&this.biasx*this.biasx+this.biasy*this.biasy>this.maxError*this.maxError){return true}var ei=-ea;this.biasx*=ei;this.biasy*=ei;var eh=this.maxError;var ef=this.biasx*this.biasx+this.biasy*this.biasy;if(ef>eh*eh){var eg=eh*(1/Math.sqrt(ef));this.biasx*=eg;this.biasy*=eg}}else{this.biasx=0;this.biasy=0;this.gamma=0}this.jAccx*=en;this.jAccy*=en;this.jMax=this.maxForce*el;return false};D.prototype.warmStart=function(){var ea=this.b1.imass;this.b1.velx-=this.jAccx*ea;this.b1.vely-=this.jAccy*ea;var eb=this.b2.imass;this.b2.velx+=this.jAccx*eb;this.b2.vely+=this.jAccy*eb;this.b1.angvel-=(this.jAccy*this.a1relx-this.jAccx*this.a1rely)*this.b1.iinertia;this.b2.angvel+=(this.jAccy*this.a2relx-this.jAccx*this.a2rely)*this.b2.iinertia};D.prototype.applyImpulseVel=function(){var ek=0;var ej=0;ek=this.b2.velx+this.b2.kinvelx-this.a2rely*(this.b2.angvel+this.b2.kinangvel)-(this.b1.velx+this.b1.kinvelx-this.a1rely*(this.b1.angvel+this.b1.kinangvel));ej=this.b2.vely+this.b2.kinvely+this.a2relx*(this.b2.angvel+this.b2.kinangvel)-(this.b1.vely+this.b1.kinvely+this.a1relx*(this.b1.angvel+this.b1.kinangvel));var ea=0;var em=0;ea=this.biasx-ek;em=this.biasy-ej;var el=this.kMassa*ea+this.kMassb*em;em=this.kMassb*ea+this.kMassc*em;ea=el;var eg=this.gamma;ea-=this.jAccx*eg;em-=this.jAccy*eg;var ei=0;var eh=0;ei=this.jAccx;eh=this.jAccy;this.jAccx+=ea;this.jAccy+=em;if(this.breakUnderForce){if(this.jAccx*this.jAccx+this.jAccy*this.jAccy>this.jMax*this.jMax){return true}}else{if(!this.stiff){var ef=this.jMax;var ee=this.jAccx*this.jAccx+this.jAccy*this.jAccy;if(ee>ef*ef){var ed=ef*(1/Math.sqrt(ee));this.jAccx*=ed;this.jAccy*=ed}}}ea=this.jAccx-ei;em=this.jAccy-eh;var ec=this.b1.imass;this.b1.velx-=ea*ec;this.b1.vely-=em*ec;var eb=this.b2.imass;this.b2.velx+=ea*eb;this.b2.vely+=em*eb;this.b1.angvel-=(em*this.a1relx-ea*this.a1rely)*this.b1.iinertia;this.b2.angvel+=(em*this.a2relx-ea*this.a2rely)*this.b2.iinertia;return false};D.prototype.applyImpulsePos=function(){var eq=0;var eo=0;eq=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;eo=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;var eh=0;var ef=0;eh=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;ef=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var eg=0;var ee=0;eg=this.b2.posx+eh-(this.b1.posx+eq);ee=this.b2.posy+ef-(this.b1.posy+eo);if(this.breakUnderError&&eg*eg+ee*ee>this.maxError*this.maxError){return true}if(eg*eg+ee*ee6){var eJ=this.b1.smass+this.b2.smass;if(eJ>P.epsilon){eJ=0.75/eJ;ev=-eg*eJ;er=-ee*eJ;var ep=ev*ev+er*er;if(ep>400){var eE=20*(1/Math.sqrt(ep));ev*=eE;er*=eE}var eA=this.b1.imass;this.b1.posx-=ev*eA;this.b1.posy-=er*eA;var ez=this.b2.imass;this.b2.posx+=ev*ez;this.b2.posy+=er*ez;eg=this.b2.posx+eh-(this.b1.posx+eq);ee=this.b2.posy+ef-(this.b1.posy+eo);eg*=0.5;ee*=0.5}}var en=0;var em=0;var el=0;var eI=this.b1.smass+this.b2.smass;en=eI;em=0;el=eI;if(this.b1.sinertia!=0){var eb=eq*this.b1.sinertia;var ea=eo*this.b1.sinertia;en=eI+ea*eo;em+=-ea*eq;el=eI+eb*eq}if(this.b2.sinertia!=0){var eC=eh*this.b2.sinertia;var ej=ef*this.b2.sinertia;en+=ej*ef;em+=-ej*eh;el+=eC*eh}ev=-eg;er=-ee;var ek=ev*ev+er*er;if(ek>36){var ey=6*(1/Math.sqrt(ek));ev*=ey;er*=ey}var ei=en*el-em*em;if(ei!=ei){er=0;ev=er}else{if(ei==0){if(en!=0){ev/=en}else{ev=0}if(el!=0){er/=el}else{er=0}}else{ei=1/ei;var ex=ei*(el*ev-em*er);er=ei*(en*er-em*ev);ev=ex}}var ew=this.b1.imass;this.b1.posx-=ev*ew;this.b1.posy-=er*ew;var es=this.b2.imass;this.b2.posx+=ev*es;this.b2.posy+=er*es;var ec=this.b1;var ed=-(er*eq-ev*eo)*this.b1.iinertia;ec.rot+=ed;if(ed*ed>0.0001){ec.axisx=Math.sin(ec.rot);ec.axisy=Math.cos(ec.rot)}else{var eG=ed*ed;var eF=1-0.5*eG;var eL=1-eG*eG/8;var eH=(eF*ec.axisx+ed*ec.axisy)*eL;ec.axisy=(eF*ec.axisy-ed*ec.axisx)*eL;ec.axisx=eH}var eD=this.b2;var eB=(er*eh-ev*ef)*this.b2.iinertia;eD.rot+=eB;if(eB*eB>0.0001){eD.axisx=Math.sin(eD.rot);eD.axisy=Math.cos(eD.rot)}else{var eu=eB*eB;var eM=1-0.5*eu;var eK=1-eu*eu/8;var et=(eM*eD.axisx+eB*eD.axisy)*eK;eD.axisy=(eM*eD.axisy-eB*eD.axisx)*eK;eD.axisx=et}return false};D.prototype.draw=function(ea){};D.prototype.__class__=D;var N=zpp_nape.constraint.ZPP_PulleyJoint=function(){this.stepped=false;this.bias=0;this.gamma=0;this.jMax=0;this.jAcc=0;this.kMass=0;this.wrap_a4=null;this.a4rely=0;this.a4relx=0;this.a4localy=0;this.a4localx=0;this.b4=null;this.wrap_a3=null;this.a3rely=0;this.a3relx=0;this.a3localy=0;this.a3localx=0;this.b3=null;this.wrap_a2=null;this.a2rely=0;this.a2relx=0;this.a2localy=0;this.a2localx=0;this.b2=null;this.wrap_a1=null;this.a1rely=0;this.a1relx=0;this.a1localy=0;this.a1localx=0;this.b1=null;this.cx4=0;this.cx3=0;this.cx2=0;this.cx1=0;this.n34y=0;this.n34x=0;this.n12y=0;this.n12x=0;this.equal=false;this.slack=false;this.jointMax=0;this.jointMin=0;this.ratio=1;this.outer_zn=null;b1.call(this);this.a1localx=0;this.a1localy=0;this.a1relx=0;this.a1rely=0;this.a2localx=0;this.a2localy=0;this.a2relx=0;this.a2rely=0;this.a3localx=0;this.a3localy=0;this.a3relx=0;this.a3rely=0;this.a4localx=0;this.a4localy=0;this.a4relx=0;this.a4rely=0;this.n12x=1;this.n12y=0;this.n34x=1;this.n34y=0;this.jAcc=0;this.jMax=Infinity;this.stepped=false;this.cx1=this.cx2=this.cx3=this.cx4=0};N.__name__=["zpp_nape","constraint","ZPP_PulleyJoint"];N.__super__=b1;N.prototype=Object.create(b1.prototype);N.prototype.outer_zn=null;N.prototype.ratio=null;N.prototype.jointMin=null;N.prototype.jointMax=null;N.prototype.slack=null;N.prototype.equal=null;N.prototype.is_slack=function(){var ec;this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;this.a3relx=this.b3.axisy*this.a3localx-this.b3.axisx*this.a3localy;this.a3rely=this.a3localx*this.b3.axisx+this.a3localy*this.b3.axisy;this.a4relx=this.b4.axisy*this.a4localx-this.b4.axisx*this.a4localy;this.a4rely=this.a4localx*this.b4.axisx+this.a4localy*this.b4.axisy;var ef=0;var ee=0;var ed=0;var eb=0;ef=this.b2.posx+this.a2relx-(this.b1.posx+this.a1relx);ee=this.b2.posy+this.a2rely-(this.b1.posy+this.a1rely);ed=this.b4.posx+this.a4relx-(this.b3.posx+this.a3relx);eb=this.b4.posy+this.a4rely-(this.b3.posy+this.a3rely);var eh=Math.sqrt(ef*ef+ee*ee);var ea=Math.sqrt(ed*ed+eb*eb);if(ea==0){Math.sqrt(0)}var eg=eh+this.ratio*ea;if(this.equal){ec=false}else{if(egthis.jointMax){eg-=this.jointMax;ec=false}else{eg=0;ec=true}}}return ec};N.prototype.n12x=null;N.prototype.n12y=null;N.prototype.n34x=null;N.prototype.n34y=null;N.prototype.cx1=null;N.prototype.cx2=null;N.prototype.cx3=null;N.prototype.cx4=null;N.prototype.bodyImpulse=function(ex){if(this.stepped){var ey=q.get();if(ex==this.b1){var ep=ey.zpp_inner;if(ep._validate!=null){ep._validate()}ey.zpp_inner.x=ey.zpp_inner.x-this.jAcc*this.n12x;var ew=ey.zpp_inner;if(ew._validate!=null){ew._validate()}var ev=ey.zpp_inner;if(ev._validate!=null){ev._validate()}ey.zpp_inner.y=ey.zpp_inner.y-this.jAcc*this.n12y;var eu=ey.zpp_inner;if(eu._validate!=null){eu._validate()}var et=ey.zpp_inner;if(et._validate!=null){et._validate()}ey.zpp_inner.z=ey.zpp_inner.z-this.cx1*this.jAcc;var es=ey.zpp_inner;if(es._validate!=null){es._validate()}}if(ex==this.b2){var er=ey.zpp_inner;if(er._validate!=null){er._validate()}ey.zpp_inner.x=ey.zpp_inner.x+this.jAcc*this.n12x;var eo=ey.zpp_inner;if(eo._validate!=null){eo._validate()}var em=ey.zpp_inner;if(em._validate!=null){em._validate()}ey.zpp_inner.y=ey.zpp_inner.y+this.jAcc*this.n12y;var ek=ey.zpp_inner;if(ek._validate!=null){ek._validate()}var eq=ey.zpp_inner;if(eq._validate!=null){eq._validate()}ey.zpp_inner.z=ey.zpp_inner.z+this.cx2*this.jAcc;var en=ey.zpp_inner;if(en._validate!=null){en._validate()}}if(ex==this.b3){var el=ey.zpp_inner;if(el._validate!=null){el._validate()}ey.zpp_inner.x=ey.zpp_inner.x-this.jAcc*this.n34x;var ej=ey.zpp_inner;if(ej._validate!=null){ej._validate()}var ei=ey.zpp_inner;if(ei._validate!=null){ei._validate()}ey.zpp_inner.y=ey.zpp_inner.y-this.jAcc*this.n34y;var eh=ey.zpp_inner;if(eh._validate!=null){eh._validate()}var eg=ey.zpp_inner;if(eg._validate!=null){eg._validate()}ey.zpp_inner.z=ey.zpp_inner.z-this.cx3*this.jAcc;var ef=ey.zpp_inner;if(ef._validate!=null){ef._validate()}}if(ex==this.b4){var ee=ey.zpp_inner;if(ee._validate!=null){ee._validate()}ey.zpp_inner.x=ey.zpp_inner.x+this.jAcc*this.n34x;var ed=ey.zpp_inner;if(ed._validate!=null){ed._validate()}var ec=ey.zpp_inner;if(ec._validate!=null){ec._validate()}ey.zpp_inner.y=ey.zpp_inner.y+this.jAcc*this.n34y;var eb=ey.zpp_inner;if(eb._validate!=null){eb._validate()}var ea=ey.zpp_inner;if(ea._validate!=null){ea._validate()}ey.zpp_inner.z=ey.zpp_inner.z+this.cx4*this.jAcc;var ez=ey.zpp_inner;if(ez._validate!=null){ez._validate()}}return ey}else{return q.get(0,0,0)}};N.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}if(this.b3!=this.b1&&this.b3!=this.b2){if(this.b3!=null){this.b3.constraints.add(this)}}if(this.b4!=this.b1&&this.b4!=this.b2&&this.b4!=this.b3){if(this.b4!=null){this.b4.constraints.add(this)}}};N.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}if(this.b3!=this.b1&&this.b3!=this.b2){if(this.b3!=null){this.b3.constraints.remove(this)}}if(this.b4!=this.b1&&this.b4!=this.b2&&this.b4!=this.b3){if(this.b4!=null){this.b4.constraints.remove(this)}}};N.prototype.b1=null;N.prototype.a1localx=null;N.prototype.a1localy=null;N.prototype.a1relx=null;N.prototype.a1rely=null;N.prototype.validate_a1=function(){this.wrap_a1.zpp_inner.x=this.a1localx;this.wrap_a1.zpp_inner.y=this.a1localy};N.prototype.invalidate_a1=function(ea){this.immutable_midstep("Constraint::a1");this.a1localx=ea.x;this.a1localy=ea.y;this.wake()};N.prototype.setup_a1=function(){var ea=this.a1localx;var eh=this.a1localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a1=eb;this.wrap_a1.zpp_inner._inuse=true;this.wrap_a1.zpp_inner._validate=dX(this,this.validate_a1);this.wrap_a1.zpp_inner._invalidate=dX(this,this.invalidate_a1)};N.prototype.wrap_a1=null;N.prototype.b2=null;N.prototype.a2localx=null;N.prototype.a2localy=null;N.prototype.a2relx=null;N.prototype.a2rely=null;N.prototype.validate_a2=function(){this.wrap_a2.zpp_inner.x=this.a2localx;this.wrap_a2.zpp_inner.y=this.a2localy};N.prototype.invalidate_a2=function(ea){this.immutable_midstep("Constraint::a2");this.a2localx=ea.x;this.a2localy=ea.y;this.wake()};N.prototype.setup_a2=function(){var ea=this.a2localx;var eh=this.a2localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a2=eb;this.wrap_a2.zpp_inner._inuse=true;this.wrap_a2.zpp_inner._validate=dX(this,this.validate_a2);this.wrap_a2.zpp_inner._invalidate=dX(this,this.invalidate_a2)};N.prototype.wrap_a2=null;N.prototype.b3=null;N.prototype.a3localx=null;N.prototype.a3localy=null;N.prototype.a3relx=null;N.prototype.a3rely=null;N.prototype.validate_a3=function(){this.wrap_a3.zpp_inner.x=this.a3localx;this.wrap_a3.zpp_inner.y=this.a3localy};N.prototype.invalidate_a3=function(ea){this.immutable_midstep("Constraint::a3");this.a3localx=ea.x;this.a3localy=ea.y;this.wake()};N.prototype.setup_a3=function(){var ea=this.a3localx;var eh=this.a3localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a3=eb;this.wrap_a3.zpp_inner._inuse=true;this.wrap_a3.zpp_inner._validate=dX(this,this.validate_a3);this.wrap_a3.zpp_inner._invalidate=dX(this,this.invalidate_a3)};N.prototype.wrap_a3=null;N.prototype.b4=null;N.prototype.a4localx=null;N.prototype.a4localy=null;N.prototype.a4relx=null;N.prototype.a4rely=null;N.prototype.validate_a4=function(){this.wrap_a4.zpp_inner.x=this.a4localx;this.wrap_a4.zpp_inner.y=this.a4localy};N.prototype.invalidate_a4=function(ea){this.immutable_midstep("Constraint::a4");this.a4localx=ea.x;this.a4localy=ea.y;this.wake()};N.prototype.setup_a4=function(){var ea=this.a4localx;var eh=this.a4localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a4=eb;this.wrap_a4.zpp_inner._inuse=true;this.wrap_a4.zpp_inner._validate=dX(this,this.validate_a4);this.wrap_a4.zpp_inner._invalidate=dX(this,this.invalidate_a4)};N.prototype.wrap_a4=null;N.prototype.kMass=null;N.prototype.jAcc=null;N.prototype.jMax=null;N.prototype.gamma=null;N.prototype.bias=null;N.prototype.stepped=null;N.prototype.copy=function(ed,eg){var ep=this.outer_zn;if(ep.zpp_inner_zn.wrap_a1==null){ep.zpp_inner_zn.setup_a1()}var et=ep.zpp_inner_zn.wrap_a1;var es=this.outer_zn;if(es.zpp_inner_zn.wrap_a2==null){es.zpp_inner_zn.setup_a2()}var eo=es.zpp_inner_zn.wrap_a2;var er=this.outer_zn;if(er.zpp_inner_zn.wrap_a3==null){er.zpp_inner_zn.setup_a3()}var en=er.zpp_inner_zn.wrap_a3;var eq=this.outer_zn;if(eq.zpp_inner_zn.wrap_a4==null){eq.zpp_inner_zn.setup_a4()}var ev=new dy(null,null,null,null,et,eo,en,eq.zpp_inner_zn.wrap_a4,this.jointMin,this.jointMax,this.ratio);this.copyto(ev);if(ed!=null&&this.b1!=null){var eu=null;var eb=0;while(ebthis.jointMax){throw new cE("Error: PulleyJoint must have jointMin <= jointMax")}if(this.b1.type!=2&&this.b2.type!=2){throw new cE("Error: PulleyJoint cannot have both bodies in a linked pair non-dynamic")}if(this.b3.type!=2&&this.b4.type!=2){throw new cE("Error: PulleyJoint cannot have both bodies in a linked pair non-dynamic")}};N.prototype.wake_connected=function(){if(this.b1!=null&&this.b1.type==2){this.b1.wake()}if(this.b2!=null&&this.b2.type==2){this.b2.wake()}if(this.b3!=null&&this.b3.type==2){this.b3.wake()}if(this.b4!=null&&this.b4.type==2){this.b4.wake()}};N.prototype.forest=function(){if(this.b1.type==2){var eD;if(this.b1.component==this.b1.component.parent){eD=this.b1.component}else{var eb=this.b1.component;var ex=null;while(eb!=eb.parent){var eL=eb.parent;eb.parent=ex;ex=eb;eb=eL}while(ex!=null){var eN=ex.parent;ex.parent=eb;ex=eN}eD=eb}var er;if(this.component==this.component.parent){er=this.component}else{var eh=this.component;var eC=null;while(eh!=eh.parent){var eM=eh.parent;eh.parent=eC;eC=eh;eh=eM}while(eC!=null){var eK=eC.parent;eC.parent=eh;eC=eK}er=eh}if(eD!=er){if(eD.ranker.rank){er.parent=eD}else{er.parent=eD;eD.rank++}}}}if(this.b2.type==2){var eu;if(this.b2.component==this.b2.component.parent){eu=this.b2.component}else{var eg=this.b2.component;var eB=null;while(eg!=eg.parent){var eJ=eg.parent;eg.parent=eB;eB=eg;eg=eJ}while(eB!=null){var eI=eB.parent;eB.parent=eg;eB=eI}eu=eg}var eq;if(this.component==this.component.parent){eq=this.component}else{var ef=this.component;var eA=null;while(ef!=ef.parent){var eH=ef.parent;ef.parent=eA;eA=ef;ef=eH}while(eA!=null){var eG=eA.parent;eA.parent=ef;eA=eG}eq=ef}if(eu!=eq){if(eu.rankeq.rank){eq.parent=eu}else{eq.parent=eu;eu.rank++}}}}if(this.b3.type==2){var et;if(this.b3.component==this.b3.component.parent){et=this.b3.component}else{var ee=this.b3.component;var ez=null;while(ee!=ee.parent){var eF=ee.parent;ee.parent=ez;ez=ee;ee=eF}while(ez!=null){var eE=ez.parent;ez.parent=ee;ez=eE}et=ee}var ep;if(this.component==this.component.parent){ep=this.component}else{var ed=this.component;var ey=null;while(ed!=ed.parent){var en=ed.parent;ed.parent=ey;ey=ed;ed=en}while(ey!=null){var em=ey.parent;ey.parent=ed;ey=em}ep=ed}if(et!=ep){if(et.rankep.rank){ep.parent=et}else{ep.parent=et;et.rank++}}}}if(this.b4.type==2){var es;if(this.b4.component==this.b4.component.parent){es=this.b4.component}else{var ec=this.b4.component;var ew=null;while(ec!=ec.parent){var el=ec.parent;ec.parent=ew;ew=ec;ec=el}while(ew!=null){var ek=ew.parent;ew.parent=ec;ew=ek}es=ec}var eo;if(this.component==this.component.parent){eo=this.component}else{var ea=this.component;var ev=null;while(ea!=ea.parent){var ej=ea.parent;ea.parent=ev;ev=ea;ea=ej}while(ev!=null){var ei=ev.parent;ev.parent=ea;ev=ei}eo=ea}if(es!=eo){if(es.rankeo.rank){eo.parent=es}else{eo.parent=es;es.rank++}}}}};N.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&(this.b2.id==ea||this.b3.id==ea||this.b4.id==ea)||this.b2.id==eb&&(this.b3.id==ea||this.b4.id==ea||this.b1.id==ea)||this.b3.id==eb&&(this.b4.id==ea||this.b1.id==ea||this.b2.id==ea))){if(this.b4.id==eb){if(!(this.b1.id==ea||this.b2.id==ea)){return this.b3.id==ea}else{return true}}else{return false}}else{return true}};N.prototype.clearcache=function(){this.jAcc=0;this.pre_dt=-1};N.prototype.preStep=function(ei){if(this.pre_dt==-1){this.pre_dt=ei}var en=ei/this.pre_dt;this.pre_dt=ei;this.stepped=true;this.equal=this.jointMin==this.jointMax;this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;this.a3relx=this.b3.axisy*this.a3localx-this.b3.axisx*this.a3localy;this.a3rely=this.a3localx*this.b3.axisx+this.a3localy*this.b3.axisy;this.a4relx=this.b4.axisy*this.a4localx-this.b4.axisx*this.a4localy;this.a4rely=this.a4localx*this.b4.axisx+this.a4localy*this.b4.axisy;var er=0;var eq=0;var em=0;var el=0;er=this.b2.posx+this.a2relx-(this.b1.posx+this.a1relx);eq=this.b2.posy+this.a2rely-(this.b1.posy+this.a1rely);em=this.b4.posx+this.a4relx-(this.b3.posx+this.a3relx);el=this.b4.posy+this.a4rely-(this.b3.posy+this.a3rely);var eo=Math.sqrt(er*er+eq*eq);var eb=Math.sqrt(em*em+el*el);if(eo!=0){var eg=1/eo;this.n12x=er*eg;this.n12y=eq*eg}if(eb!=0){var ef=1/eb;this.n34x=em*ef;this.n34y=el*ef;var ee=this.ratio;this.n34x*=ee;this.n34y*=ee}else{var ed=this.ratio/Math.sqrt(this.n34x*this.n34x+this.n34y*this.n34y);this.n34x*=ed;this.n34y*=ed}var ej=eo+this.ratio*eb;if(this.equal){ej-=this.jointMax;this.slack=false}else{if(ejthis.jointMax){ej-=this.jointMax;this.slack=false}else{this.n12x=0;this.n12y=0;this.n34x=0;this.n34y=0;ej=0;this.slack=true}}}var ep=ej;if(!this.slack){this.cx1=this.n12y*this.a1relx-this.n12x*this.a1rely;this.cx2=this.n12y*this.a2relx-this.n12x*this.a2rely;this.cx3=this.n34y*this.a3relx-this.n34x*this.a3rely;this.cx4=this.n34y*this.a4relx-this.n34x*this.a4rely;var ec=this.b1.smass+this.b2.smass+this.ratio*this.ratio*(this.b3.smass+this.b4.smass)+this.b1.sinertia*this.cx1*this.cx1+this.b2.sinertia*this.cx2*this.cx2+this.b3.sinertia*this.cx3*this.cx3+this.b4.sinertia*this.cx4*this.cx4;if(this.b1==this.b4){ec-=2*((this.n12x*this.n34x+this.n12y*this.n34y)*this.b1.smass+this.cx1*this.cx4*this.b1.sinertia)}if(this.b1==this.b3){ec+=2*((this.n12x*this.n34x+this.n12y*this.n34y)*this.b1.smass+this.cx1*this.cx3*this.b1.sinertia)}if(this.b2==this.b3){ec-=2*((this.n12x*this.n34x+this.n12y*this.n34y)*this.b2.smass+this.cx2*this.cx3*this.b2.sinertia)}if(this.b2==this.b4){ec+=2*((this.n12x*this.n34x+this.n12y*this.n34y)*this.b2.smass+this.cx2*this.cx4*this.b2.sinertia)}this.kMass=ec;if(this.kMass!=0){this.kMass=1/this.kMass}else{this.jAcc=0}if(!this.stiff){if(this.breakUnderError&&ep*ep>this.maxError*this.maxError){return true}var ea;var ek=2*Math.PI*this.frequency;this.gamma=1/(ei*ek*(2*this.damping+ek*ei));var eh=1/(1+this.gamma);ea=ei*ek*ek*this.gamma;this.gamma*=eh;this.kMass*=eh;this.bias=-ep*ea;if(this.bias<-this.maxError){this.bias=-this.maxError}else{if(this.bias>this.maxError){this.bias=this.maxError}}}else{this.bias=0;this.gamma=0}this.jAcc*=en;this.jMax=this.maxForce*ei}return false};N.prototype.warmStart=function(){if(!this.slack){var eb=this.b1.imass*this.jAcc;this.b1.velx-=this.n12x*eb;this.b1.vely-=this.n12y*eb;var ed=this.b2.imass*this.jAcc;this.b2.velx+=this.n12x*ed;this.b2.vely+=this.n12y*ed;var ec=this.b3.imass*this.jAcc;this.b3.velx-=this.n34x*ec;this.b3.vely-=this.n34y*ec;var ea=this.b4.imass*this.jAcc;this.b4.velx+=this.n34x*ea;this.b4.vely+=this.n34y*ea;this.b1.angvel-=this.cx1*this.b1.iinertia*this.jAcc;this.b2.angvel+=this.cx2*this.b2.iinertia*this.jAcc;this.b3.angvel-=this.cx3*this.b3.iinertia*this.jAcc;this.b4.angvel+=this.cx4*this.b4.iinertia*this.jAcc}};N.prototype.applyImpulseVel=function(){if(this.slack){return false}var ea=this.kMass*(this.bias-(this.n12x*(this.b2.velx+this.b2.kinvelx-this.b1.velx-this.b1.kinvelx)+this.n12y*(this.b2.vely+this.b2.kinvely-this.b1.vely-this.b1.kinvely)+this.n34x*(this.b4.velx+this.b4.kinvelx-this.b3.velx-this.b3.kinvelx)+this.n34y*(this.b4.vely+this.b4.kinvely-this.b3.vely-this.b3.kinvely)+(this.b2.angvel+this.b2.kinangvel)*this.cx2-(this.b1.angvel+this.b1.kinangvel)*this.cx1+(this.b4.angvel+this.b4.kinangvel)*this.cx4-(this.b3.angvel+this.b3.kinangvel)*this.cx3))-this.jAcc*this.gamma;var ef=this.jAcc;this.jAcc+=ea;if(!this.equal&&this.jAcc>0){this.jAcc=0}if(this.breakUnderForce&&this.jAcc<-this.jMax){return true}if(!this.stiff){if(this.jAcc<-this.jMax){this.jAcc=-this.jMax}}ea=this.jAcc-ef;var ec=this.b1.imass*ea;this.b1.velx-=this.n12x*ec;this.b1.vely-=this.n12y*ec;var ee=this.b2.imass*ea;this.b2.velx+=this.n12x*ee;this.b2.vely+=this.n12y*ee;var ed=this.b3.imass*ea;this.b3.velx-=this.n34x*ed;this.b3.vely-=this.n34y*ed;var eb=this.b4.imass*ea;this.b4.velx+=this.n34x*eb;this.b4.vely+=this.n34y*eb;this.b1.angvel-=this.cx1*this.b1.iinertia*ea;this.b2.angvel+=this.cx2*this.b2.iinertia*ea;this.b3.angvel-=this.cx3*this.b3.iinertia*ea;this.b4.angvel+=this.cx4*this.b4.iinertia*ea;return false};N.prototype.applyImpulsePos=function(){var eZ;var eI;var fa=0;var e9=0;fa=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;e9=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;var e2=0;var e1=0;e2=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;e1=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var eR=0;var eP=0;eR=this.b3.axisy*this.a3localx-this.b3.axisx*this.a3localy;eP=this.a3localx*this.b3.axisx+this.a3localy*this.b3.axisy;var ey=0;var ew=0;ey=this.b4.axisy*this.a4localx-this.b4.axisx*this.a4localy;ew=this.a4localx*this.b4.axisx+this.a4localy*this.b4.axisy;var eM;var eX=0;var eW=0;var eu=0;var et=0;eX=this.n12x;eW=this.n12y;eu=this.n34x;et=this.n34y;var e5=0;var e4=0;var eA=0;var ez=0;e5=this.b2.posx+e2-(this.b1.posx+fa);e4=this.b2.posy+e1-(this.b1.posy+e9);eA=this.b4.posx+ey-(this.b3.posx+eR);ez=this.b4.posy+ew-(this.b3.posy+eP);var e3=Math.sqrt(e5*e5+e4*e4);var ex=Math.sqrt(eA*eA+ez*ez);if(e3!=0){var eC=1/e3;eX=e5*eC;eW=e4*eC}if(ex!=0){var fl=1/ex;eu=eA*fl;et=ez*fl;var fk=this.ratio;eu*=fk;et*=fk}else{var fj=this.ratio/Math.sqrt(eu*eu+et*et);eu*=fj;et*=fj}var e0=e3+this.ratio*ex;if(this.equal){e0-=this.jointMax;eM=false}else{if(e0this.jointMax){e0-=this.jointMax;eM=false}else{eX=0;eW=0;eu=0;et=0;e0=0;eM=true}}}eZ=e0;if(!eM){if(this.breakUnderError&&eZ*eZ>this.maxError*this.maxError){return true}if(eZ*eZ6){var eG=this.b1.smass+this.b2.smass;if(eG>P.epsilon){eG=0.75/eG;eI=-eZ*eG;if(this.equal||eI<0){var fi=eI*this.b1.imass;this.b1.posx-=eX*fi;this.b1.posy-=eW*fi;var fh=eI*this.b2.imass;this.b2.posx+=eX*fh;this.b2.posy+=eW*fh;var fg=eI*this.b3.imass;this.b3.posx-=eu*fg;this.b3.posy-=et*fg;var ff=eI*this.b4.imass;this.b4.posx+=eu*ff;this.b4.posy+=et*ff;var eh=0;var fn=0;var eg=0;var fm=0;eh=this.b2.posx+e2-(this.b1.posx+fa);fn=this.b2.posy+e1-(this.b1.posy+e9);eg=this.b4.posx+ey-(this.b3.posx+eR);fm=this.b4.posy+ew-(this.b3.posy+eP);var fb=Math.sqrt(eh*eh+fn*fn);var eK=Math.sqrt(eg*eg+fm*fm);if(fb!=0){var fe=1/fb;eX=eh*fe;eW=fn*fe}if(eK!=0){var fd=1/eK;eu=eg*fd;et=fm*fd;var eq=this.ratio;eu*=eq;et*=eq}else{var eo=this.ratio/Math.sqrt(eu*eu+et*et);eu*=eo;et*=eo}var fc=fb+this.ratio*eK;if(this.equal){fc-=this.jointMax}else{if(fcthis.jointMax){fc-=this.jointMax}else{eX=0;eW=0;eu=0;et=0;fc=0}}}eZ=fc;eZ*=0.5}}}var er;var ep;var en;var el;er=eW*fa-eX*e9;ep=eW*e2-eX*e1;en=et*eR-eu*eP;el=et*ey-eu*ew;var eY=this.b1.smass+this.b2.smass+this.ratio*this.ratio*(this.b3.smass+this.b4.smass)+this.b1.sinertia*er*er+this.b2.sinertia*ep*ep+this.b3.sinertia*en*en+this.b4.sinertia*el*el;if(this.b1==this.b4){eY-=2*((eX*eu+eW*et)*this.b1.smass+er*el*this.b1.sinertia)}if(this.b1==this.b3){eY+=2*((eX*eu+eW*et)*this.b1.smass+er*en*this.b1.sinertia)}if(this.b2==this.b3){eY-=2*((eX*eu+eW*et)*this.b2.smass+ep*en*this.b2.sinertia)}if(this.b2==this.b4){eY+=2*((eX*eu+eW*et)*this.b2.smass+ep*el*this.b2.sinertia)}var eB=eY;if(eB!=0){eB=1/eB}eI=-eZ*eB;if(this.equal||eI<0){var em=this.b1.imass*eI;this.b1.posx-=eX*em;this.b1.posy-=eW*em;var ek=this.b2.imass*eI;this.b2.posx+=eX*ek;this.b2.posy+=eW*ek;var ej=this.b3.imass*eI;this.b3.posx-=eu*ej;this.b3.posy-=et*ej;var ei=this.b4.imass*eI;this.b4.posx+=eu*ei;this.b4.posy+=et*ei;var ev=this.b1;var es=-er*this.b1.iinertia*eI;ev.rot+=es;if(es*es>0.0001){ev.axisx=Math.sin(ev.rot);ev.axisy=Math.cos(ev.rot)}else{var eQ=es*es;var eD=1-0.5*eQ;var eE=1-eQ*eQ/8;var eS=(eD*ev.axisx+es*ev.axisy)*eE;ev.axisy=(eD*ev.axisy-es*ev.axisx)*eE;ev.axisx=eS}var eJ=this.b2;var ef=ep*this.b2.iinertia*eI;eJ.rot+=ef;if(ef*ef>0.0001){eJ.axisx=Math.sin(eJ.rot);eJ.axisy=Math.cos(eJ.rot)}else{var eO=ef*ef;var eV=1-0.5*eO;var ec=1-eO*eO/8;var e8=(eV*eJ.axisx+ef*eJ.axisy)*ec;eJ.axisy=(eV*eJ.axisy-ef*eJ.axisx)*ec;eJ.axisx=e8}var eH=this.b3;var ee=-en*this.b3.iinertia*eI;eH.rot+=ee;if(ee*ee>0.0001){eH.axisx=Math.sin(eH.rot);eH.axisy=Math.cos(eH.rot)}else{var eN=ee*ee;var eU=1-0.5*eN;var eb=1-eN*eN/8;var e7=(eU*eH.axisx+ee*eH.axisy)*eb;eH.axisy=(eU*eH.axisy-ee*eH.axisx)*eb;eH.axisx=e7}var eF=this.b4;var ed=el*this.b4.iinertia*eI;eF.rot+=ed;if(ed*ed>0.0001){eF.axisx=Math.sin(eF.rot);eF.axisy=Math.cos(eF.rot)}else{var eL=ed*ed;var eT=1-0.5*eL;var ea=1-eL*eL/8;var e6=(eT*eF.axisx+ed*eF.axisy)*ea;eF.axisy=(eT*eF.axisy-ed*eF.axisx)*ea;eF.axisx=e6}}}return false};N.prototype.draw=function(ea){};N.prototype.__class__=N;var b4=zpp_nape.constraint.ZPP_UserConstraint=function(ee,ec){this.jOld=null;this.J=null;this.vec3=null;this.Keff=null;this.jMax=0;this.velonly=false;this.gamma=0;this.soft=0;this.y=null;this.L=null;this.stepped=false;this.bias=null;this.jAcc=null;this.dim=0;this.bodies=null;this.outer_zn=null;b1.call(this);this.bodies=[];this.dim=ee;this.velonly=ec;this.jAcc=[];this.bias=[];this.L=[];this.J=[];this.jOld=[];this.y=[];this.Keff=[];this.vec3=q.get(0,0,0);var ed=0;while(ed0){this.bodies[ed]=this.bodies[ee-1]}this.bodies.pop();if(this.active&&this.space!=null){if(eb!=null){eb.constraints.remove(this)}}}ec=ea;break}++ed}return ec!=null};b4.prototype.bodyImpulse=function(ea){var ed=0;var ee=this.dim;while(edem.rank){em.parent=ec}else{em.parent=ec;ec.rank++}}}}}};b4.prototype.pair_exists=function(ea,ef){var ee=false;var eb=this.bodies.length|0;var eh=0;while(eheb*eb){var ef=eb/Math.sqrt(ea);var ed=0;var ee=this.dim;while(edthis.maxError*this.maxError){return true}var ei=0;var ef=this.dim;while(eithis.jMax*this.jMax){if(this.breakUnderForce){return true}else{if(!this.stiff){this._clamp(this.jAcc,this.jMax)}}}var el=0;var ed=this.dim;while(elthis.maxError*this.maxError){return true}else{if(eb0.0001){er.axisx=Math.sin(er.rot);er.axisy=Math.cos(er.rot)}else{var es=ef*ef;var eg=1-0.5*es;var eh=1-es*es/8;var ep=(eg*er.axisx+ef*er.axisy)*eh;er.axisy=(eg*er.axisy-ef*er.axisx)*eh;er.axisx=ep}}return false};b4.prototype.draw=function(ea){this.outer_zn.__draw(ea)};b4.prototype.__class__=b4;var l=zpp_nape.constraint.ZPP_UserBody=function(eb,ea){this.body=null;this.cnt=0;this.cnt=eb;this.body=ea};l.__name__=["zpp_nape","constraint","ZPP_UserBody"];l.prototype.cnt=null;l.prototype.body=null;l.prototype.__class__=l;var aC=zpp_nape.constraint.ZPP_WeldJoint=function(){this.stepped=false;this.biasz=0;this.biasy=0;this.biasx=0;this.gamma=0;this.jMax=0;this.jAccz=0;this.jAccy=0;this.jAccx=0;this.kMassf=0;this.kMasse=0;this.kMassc=0;this.kMassd=0;this.kMassb=0;this.kMassa=0;this.phase=0;this.wrap_a2=null;this.a2rely=0;this.a2relx=0;this.a2localy=0;this.a2localx=0;this.b2=null;this.wrap_a1=null;this.a1rely=0;this.a1relx=0;this.a1localy=0;this.a1localx=0;this.b1=null;this.outer_zn=null;b1.call(this);this.phase=0;this.jAccx=0;this.jAccy=0;this.jAccz=0;this.jMax=Infinity;this.stepped=false;this.a1localx=0;this.a1localy=0;this.a1relx=0;this.a1rely=0;this.a2localx=0;this.a2localy=0;this.a2relx=0;this.a2rely=0};aC.__name__=["zpp_nape","constraint","ZPP_WeldJoint"];aC.__super__=b1;aC.prototype=Object.create(b1.prototype);aC.prototype.outer_zn=null;aC.prototype.bodyImpulse=function(ea){if(this.stepped){if(ea==this.b1){return q.get(-this.jAccx,-this.jAccy,-(this.jAccy*this.a1relx-this.jAccx*this.a1rely+this.jAccz))}else{return q.get(this.jAccx,this.jAccy,this.jAccy*this.a2relx-this.jAccx*this.a2rely+this.jAccz)}}else{return q.get(0,0,0)}};aC.prototype.activeBodies=function(){if(this.b1!=null){this.b1.constraints.add(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.add(this)}}};aC.prototype.inactiveBodies=function(){if(this.b1!=null){this.b1.constraints.remove(this)}if(this.b2!=this.b1){if(this.b2!=null){this.b2.constraints.remove(this)}}};aC.prototype.b1=null;aC.prototype.a1localx=null;aC.prototype.a1localy=null;aC.prototype.a1relx=null;aC.prototype.a1rely=null;aC.prototype.validate_a1=function(){this.wrap_a1.zpp_inner.x=this.a1localx;this.wrap_a1.zpp_inner.y=this.a1localy};aC.prototype.invalidate_a1=function(ea){this.immutable_midstep("Constraint::a1");this.a1localx=ea.x;this.a1localy=ea.y;this.wake()};aC.prototype.setup_a1=function(){var ea=this.a1localx;var eh=this.a1localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a1=eb;this.wrap_a1.zpp_inner._inuse=true;this.wrap_a1.zpp_inner._validate=dX(this,this.validate_a1);this.wrap_a1.zpp_inner._invalidate=dX(this,this.invalidate_a1)};aC.prototype.wrap_a1=null;aC.prototype.b2=null;aC.prototype.a2localx=null;aC.prototype.a2localy=null;aC.prototype.a2relx=null;aC.prototype.a2rely=null;aC.prototype.validate_a2=function(){this.wrap_a2.zpp_inner.x=this.a2localx;this.wrap_a2.zpp_inner.y=this.a2localy};aC.prototype.invalidate_a2=function(ea){this.immutable_midstep("Constraint::a2");this.a2localx=ea.x;this.a2localy=ea.y;this.wake()};aC.prototype.setup_a2=function(){var ea=this.a2localx;var eh=this.a2localy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_a2=eb;this.wrap_a2.zpp_inner._inuse=true;this.wrap_a2.zpp_inner._validate=dX(this,this.validate_a2);this.wrap_a2.zpp_inner._invalidate=dX(this,this.invalidate_a2)};aC.prototype.wrap_a2=null;aC.prototype.phase=null;aC.prototype.kMassa=null;aC.prototype.kMassb=null;aC.prototype.kMassd=null;aC.prototype.kMassc=null;aC.prototype.kMasse=null;aC.prototype.kMassf=null;aC.prototype.jAccx=null;aC.prototype.jAccy=null;aC.prototype.jAccz=null;aC.prototype.jMax=null;aC.prototype.gamma=null;aC.prototype.biasx=null;aC.prototype.biasy=null;aC.prototype.biasz=null;aC.prototype.stepped=null;aC.prototype.copy=function(ea,eb){var ee=this.outer_zn;if(ee.zpp_inner_zn.wrap_a1==null){ee.zpp_inner_zn.setup_a1()}var ec=ee.zpp_inner_zn.wrap_a1;var eg=this.outer_zn;if(eg.zpp_inner_zn.wrap_a2==null){eg.zpp_inner_zn.setup_a2()}var ef=new cX(null,null,ec,eg.zpp_inner_zn.wrap_a2);this.copyto(ef);if(ea!=null&&this.b1!=null){var ek=null;var ed=0;while(eder.rank){er.parent=en}else{er.parent=en;en.rank++}}}}if(this.b2.type==2){var ee;if(this.b2.component==this.b2.component.parent){ee=this.b2.component}else{var es=this.b2.component;var ek=null;while(es!=es.parent){var ed=es.parent;es.parent=ek;ek=es;es=ed}while(ek!=null){var ec=ek.parent;ek.parent=es;ek=ec}ee=es}var ep;if(this.component==this.component.parent){ep=this.component}else{var eq=this.component;var ej=null;while(eq!=eq.parent){var eb=eq.parent;eq.parent=ej;ej=eq;eq=eb}while(ej!=null){var ea=ej.parent;ej.parent=eq;ej=ea}ep=eq}if(ee!=ep){if(ee.rankep.rank){ep.parent=ee}else{ep.parent=ee;ee.rank++}}}}};aC.prototype.pair_exists=function(eb,ea){if(!(this.b1.id==eb&&this.b2.id==ea)){if(this.b1.id==ea){return this.b2.id==eb}else{return false}}else{return true}};aC.prototype.clearcache=function(){this.jAccx=0;this.jAccy=0;this.jAccz=0;this.pre_dt=-1};aC.prototype.preStep=function(em){if(this.pre_dt==-1){this.pre_dt=em}var er=em/this.pre_dt;this.pre_dt=em;this.stepped=true;this.a1relx=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;this.a1rely=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;this.a2relx=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;this.a2rely=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var es=this.b1.smass+this.b2.smass;this.kMassa=es;this.kMassb=0;this.kMassd=es;this.kMassc=0;this.kMasse=0;this.kMassf=0;if(this.b1.sinertia!=0){var ec=this.a1relx*this.b1.sinertia;var eb=this.a1rely*this.b1.sinertia;this.kMassa+=eb*this.a1rely;this.kMassb+=-eb*this.a1relx;this.kMassd+=ec*this.a1relx;this.kMassc+=-eb;this.kMasse+=ec;this.kMassf+=this.b1.sinertia}if(this.b2.sinertia!=0){var ew=this.a2relx*this.b2.sinertia;var ee=this.a2rely*this.b2.sinertia;this.kMassa+=ee*this.a2rely;this.kMassb+=-ee*this.a2relx;this.kMassd+=ew*this.a2relx;this.kMassc+=-ee;this.kMasse+=ew;this.kMassf+=this.b2.sinertia}var ed=this.kMassa*(this.kMassd*this.kMassf-this.kMasse*this.kMasse)+this.kMassb*(this.kMassc*this.kMasse-this.kMassb*this.kMassf)+this.kMassc*(this.kMassb*this.kMasse-this.kMassc*this.kMassd);var eu;if(ed!=ed){this.kMassa=0;this.kMassb=0;this.kMassd=0;this.kMassc=0;this.kMasse=0;this.kMassf=0;eu=7}else{if(ed==0){var et=0;if(this.kMassa!=0){this.kMassa=1/this.kMassa}else{this.kMassa=0;et=1}if(this.kMassd!=0){this.kMassd=1/this.kMassd}else{this.kMassd=0;et|=2}if(this.kMassf!=0){this.kMassf=1/this.kMassf}else{this.kMassf=0;et|=4}this.kMassb=this.kMassc=this.kMasse=0;eu=et}else{ed=1/ed;var eq=ed*(this.kMassd*this.kMassf-this.kMasse*this.kMasse);var ep=ed*(this.kMasse*this.kMassc-this.kMassb*this.kMassf);var el=ed*(this.kMassa*this.kMassf-this.kMassc*this.kMassc);var en=ed*(this.kMassb*this.kMasse-this.kMassc*this.kMassd);var ej=ed*(this.kMassb*this.kMassc-this.kMassa*this.kMasse);var ev=this.kMassa*this.kMassd-this.kMassb*this.kMassb;this.kMassa=eq;this.kMassb=ep;this.kMassd=el;this.kMassc=en;this.kMasse=ej;this.kMassf=ed*ev;eu=0}}if((eu&1)!=0){this.jAccx=0}if((eu&2)!=0){this.jAccy=0}if((eu&4)!=0){this.jAccz=0}if(!this.stiff){var ea;var eo=2*Math.PI*this.frequency;this.gamma=1/(em*eo*(2*this.damping+eo*em));var ek=1/(1+this.gamma);ea=em*eo*eo*this.gamma;this.gamma*=ek;this.kMassa*=ek;this.kMassb*=ek;this.kMassd*=ek;this.kMassc*=ek;this.kMasse*=ek;this.kMassf*=ek;this.biasx=this.b2.posx+this.a2relx-(this.b1.posx+this.a1relx);this.biasy=this.b2.posy+this.a2rely-(this.b1.posy+this.a1rely);this.biasz=this.b2.rot-this.b1.rot-this.phase;if(this.breakUnderError&&this.biasx*this.biasx+this.biasy*this.biasy+this.biasz*this.biasz>this.maxError*this.maxError){return true}var ei=-ea;this.biasx*=ei;this.biasy*=ei;this.biasz*=ei;var eh=this.maxError;var ef=this.biasx*this.biasx+this.biasy*this.biasy+this.biasz*this.biasz;if(ef>eh*eh){var eg=eh*(1/Math.sqrt(ef));this.biasx*=eg;this.biasy*=eg;this.biasz*=eg}}else{this.biasx=0;this.biasy=0;this.biasz=0;this.gamma=0}this.jAccx*=er;this.jAccy*=er;this.jAccz*=er;this.jMax=this.maxForce*em;return false};aC.prototype.warmStart=function(){var ea=this.b1.imass;this.b1.velx-=this.jAccx*ea;this.b1.vely-=this.jAccy*ea;var eb=this.b2.imass;this.b2.velx+=this.jAccx*eb;this.b2.vely+=this.jAccy*eb;this.b1.angvel-=(this.jAccy*this.a1relx-this.jAccx*this.a1rely+this.jAccz)*this.b1.iinertia;this.b2.angvel+=(this.jAccy*this.a2relx-this.jAccx*this.a2rely+this.jAccz)*this.b2.iinertia};aC.prototype.applyImpulseVel=function(){var en=0;var em=0;var el=0;en=this.b2.velx+this.b2.kinvelx-this.a2rely*(this.b2.angvel+this.b2.kinangvel)-(this.b1.velx+this.b1.kinvelx-this.a1rely*(this.b1.angvel+this.b1.kinangvel));em=this.b2.vely+this.b2.kinvely+this.a2relx*(this.b2.angvel+this.b2.kinangvel)-(this.b1.vely+this.b1.kinvely+this.a1relx*(this.b1.angvel+this.b1.kinangvel));el=this.b2.angvel+this.b2.kinangvel-this.b1.angvel-this.b1.kinangvel;var ea=0;var eq=0;var ep=0;ea=this.biasx-en;eq=this.biasy-em;ep=this.biasz-el;var ec=this.kMassa*ea+this.kMassb*eq+this.kMassc*ep;var eb=this.kMassb*ea+this.kMassd*eq+this.kMasse*ep;ep=this.kMassc*ea+this.kMasse*eq+this.kMassf*ep;ea=ec;eq=eb;var eo=this.gamma;ea-=this.jAccx*eo;eq-=this.jAccy*eo;ep-=this.jAccz*eo;var ek=0;var ej=0;var ei=0;ek=this.jAccx;ej=this.jAccy;ei=this.jAccz;this.jAccx+=ea;this.jAccy+=eq;this.jAccz+=ep;if(this.breakUnderForce){if(this.jAccx*this.jAccx+this.jAccy*this.jAccy+this.jAccz*this.jAccz>this.jMax*this.jMax){return true}}else{if(!this.stiff){var eh=this.jMax;var ef=this.jAccx*this.jAccx+this.jAccy*this.jAccy+this.jAccz*this.jAccz;if(ef>eh*eh){var eg=eh*(1/Math.sqrt(ef));this.jAccx*=eg;this.jAccy*=eg;this.jAccz*=eg}}}ea=this.jAccx-ek;eq=this.jAccy-ej;ep=this.jAccz-ei;var ee=this.b1.imass;this.b1.velx-=ea*ee;this.b1.vely-=eq*ee;var ed=this.b2.imass;this.b2.velx+=ea*ed;this.b2.vely+=eq*ed;this.b1.angvel-=(eq*this.a1relx-ea*this.a1rely+ep)*this.b1.iinertia;this.b2.angvel+=(eq*this.a2relx-ea*this.a2rely+ep)*this.b2.iinertia;return false};aC.prototype.applyImpulsePos=function(){var ey=0;var ew=0;ey=this.b1.axisy*this.a1localx-this.b1.axisx*this.a1localy;ew=this.a1localx*this.b1.axisx+this.a1localy*this.b1.axisy;var ei=0;var eg=0;ei=this.b2.axisy*this.a2localx-this.b2.axisx*this.a2localy;eg=this.a2localx*this.b2.axisx+this.a2localy*this.b2.axisy;var eh=0;var ef=0;var ee=0;eh=this.b2.posx+ei-(this.b1.posx+ey);ef=this.b2.posy+eg-(this.b1.posy+ew);ee=this.b2.rot-this.b1.rot-this.phase;var eE=0;var eA=0;var ez=0;if(this.breakUnderError&&eh*eh+ef*ef+ee*ee>this.maxError*this.maxError){return true}var eJ=true;if(eh*eh+ef*ef6){var eV=this.b1.smass+this.b2.smass;if(eV>P.epsilon){eV=0.75/eV;eE=-eh*eV;eA=-ef*eV;var ex=eE*eE+eA*eA;if(ex>400){var eP=20*(1/Math.sqrt(ex));eE*=eP;eA*=eP}var eI=this.b1.imass;this.b1.posx-=eE*eI;this.b1.posy-=eA*eI;var eH=this.b2.imass;this.b2.posx+=eE*eH;this.b2.posy+=eA*eH;eh=this.b2.posx+ei-(this.b1.posx+ey);ef=this.b2.posy+eg-(this.b1.posy+ew);ee=this.b2.rot-this.b1.rot-this.phase;eh*=0.5;ef*=0.5;ee*=0.5}}var ev=0;var eu=0;var es=0;var et=0;var er=0;var eq=0;var eU=this.b1.smass+this.b2.smass;ev=eU;eu=0;es=eU;et=0;er=0;eq=0;if(this.b1.sinertia!=0){var eb=ey*this.b1.sinertia;var ea=ew*this.b1.sinertia;ev=eU+ea*ew;eu+=-ea*ey;es=eU+eb*ey;et+=-ea;er+=eb;eq+=this.b1.sinertia}if(this.b2.sinertia!=0){var eN=ei*this.b2.sinertia;var eo=eg*this.b2.sinertia;ev+=eo*eg;eu+=-eo*ei;es+=eN*ei;et+=-eo;er+=eN;eq+=this.b2.sinertia}eE=-eh;eA=-ef;ez=-ee;var ep=eE*eE+eA*eA;if(ep>36){var eG=6*(1/Math.sqrt(ep));eE*=eG;eA*=eG}var ej=ev*(es*eq-er*er)+eu*(et*er-eu*eq)+et*(eu*er-et*es);if(ej!=ej){ez=0;eA=ez;eE=eA}else{if(ej==0){if(ev!=0){eE/=ev}else{eE=0}if(es!=0){eA/=es}else{eA=0}if(eq!=0){ez/=eq}else{ez=0}}else{ej=1/ej;var em=er*et-eu*eq;var el=eu*er-et*es;var ek=eu*et-ev*er;var eM=ej*(eE*(es*eq-er*er)+eA*em+ez*el);var en=ej*(eE*em+eA*(ev*eq-et*et)+ez*ek);ez=ej*(eE*el+eA*ek+ez*(ev*es-eu*eu));eE=eM;eA=en}}var eF=this.b1.imass;this.b1.posx-=eE*eF;this.b1.posy-=eA*eF;var eD=this.b2.imass;this.b2.posx+=eE*eD;this.b2.posy+=eA*eD;var ec=this.b1;var ed=-(eA*ey-eE*ew+ez)*this.b1.iinertia;ec.rot+=ed;if(ed*ed>0.0001){ec.axisx=Math.sin(ec.rot);ec.axisy=Math.cos(ec.rot)}else{var eT=ed*ed;var eQ=1-0.5*eT;var eX=1-eT*eT/8;var eS=(eQ*ec.axisx+ed*ec.axisy)*eX;ec.axisy=(eQ*ec.axisy-ed*ec.axisx)*eX;ec.axisx=eS}var eO=this.b2;var eK=(eA*ei-eE*eg+ez)*this.b2.iinertia;eO.rot+=eK;if(eK*eK>0.0001){eO.axisx=Math.sin(eO.rot);eO.axisy=Math.cos(eO.rot)}else{var eC=eK*eK;var eY=1-0.5*eC;var eW=1-eC*eC/8;var eB=(eY*eO.axisx+eK*eO.axisy)*eW;eO.axisy=(eY*eO.axisy-eK*eO.axisx)*eW;eO.axisx=eB}return false};aC.prototype.draw=function(ea){};aC.prototype.__class__=aC;var j=zpp_nape.dynamics.ZPP_Arbiter=function(){this.sensorarb=null;this.fluidarb=null;this.colarb=null;this.type=0;this.pair=null;this.ws2=null;this.ws1=null;this.b2=null;this.b1=null;this.invalidated=false;this.immState=0;this.fresh=false;this.continuous=false;this.presentable=false;this.intchange=false;this.present=0;this.sleeping=false;this.cleared=false;this.active=false;this.endGenerated=0;this.sleep_stamp=0;this.up_stamp=0;this.stamp=0;this.di=0;this.id=0;this.hnext=null;this.outer=null};j.__name__=["zpp_nape","dynamics","ZPP_Arbiter"];j.prototype.outer=null;j.prototype.wrapper=function(){if(this.outer==null){j.internal=true;if(this.type==j.COL){this.colarb.outer_zn=new ak();this.outer=this.colarb.outer_zn}else{if(this.type==j.FLUID){this.fluidarb.outer_zn=new ab();this.outer=this.fluidarb.outer_zn}else{this.outer=new aD()}}this.outer.zpp_inner=this;j.internal=false}return this.outer};j.prototype.inactiveme=function(){return !this.active};j.prototype.hnext=null;j.prototype.id=null;j.prototype.di=null;j.prototype.stamp=null;j.prototype.up_stamp=null;j.prototype.sleep_stamp=null;j.prototype.endGenerated=null;j.prototype.active=null;j.prototype.cleared=null;j.prototype.sleeping=null;j.prototype.present=null;j.prototype.intchange=null;j.prototype.presentable=null;j.prototype.continuous=null;j.prototype.fresh=null;j.prototype.immState=null;j.prototype.acting=function(){if(this.active){return(this.immState&1)!=0}else{return false}};j.prototype.invalidated=null;j.prototype.b1=null;j.prototype.b2=null;j.prototype.ws1=null;j.prototype.ws2=null;j.prototype.pair=null;j.prototype.swap_features=function(){var ea=this.b1;this.b1=this.b2;this.b2=ea;var ec=this.ws1;this.ws1=this.ws2;this.ws2=ec;var eb=this.colarb.s1;this.colarb.s1=this.colarb.s2;this.colarb.s2=eb};j.prototype.type=null;j.prototype.colarb=null;j.prototype.fluidarb=null;j.prototype.sensorarb=null;j.prototype.lazyRetire=function(en,ek){this.cleared=true;if(ek==null||this.b2==ek){var ef=this.b1.arbiters;var ee=null;var em=ef.head;while(em!=null){if(em.elt==this){var eb;var eh;if(ee==null){eb=ef.head;eh=eb.next;ef.head=eh;if(ef.head==null){ef.pushmod=true}}else{eb=ee.next;eh=eb.next;ee.next=eh;if(eh==null){ef.pushmod=true}}var ea=eb;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;ef.modified=true;ef.length--;ef.pushmod=true;break}ee=em;em=em.next}}if(ek==null||this.b1==ek){var ei=this.b2.arbiters;var ed=null;var el=ei.head;while(el!=null){if(el.elt==this){var eg;var ej;if(ed==null){eg=ei.head;ej=eg.next;ei.head=ej;if(ei.head==null){ei.pushmod=true}}else{eg=ed.next;ej=eg.next;ed.next=ej;if(ej==null){ei.pushmod=true}}var ec=eg;ec.elt=null;ec.next=dL.zpp_pool;dL.zpp_pool=ec;ei.modified=true;ei.length--;ei.pushmod=true;break}ed=el;el=el.next}}if(this.pair!=null){this.pair.arb=null;this.pair=null}this.active=false;en.f_arbiters.modified=true};j.prototype.sup_assign=function(ei,eh,ea,ef){this.b1=ei.body;this.ws1=ei;this.b2=eh.body;this.ws2=eh;this.id=ea;this.di=ef;var ec=this.b1.arbiters;var ed;if(dL.zpp_pool==null){ed=new dL()}else{ed=dL.zpp_pool;dL.zpp_pool=ed.next;ed.next=null}ed.elt=this;var ej=ed;ej.next=ec.head;ec.head=ej;ec.modified=true;ec.length++;var ee=this.b2.arbiters;var eg;if(dL.zpp_pool==null){eg=new dL()}else{eg=dL.zpp_pool;dL.zpp_pool=eg.next;eg.next=null}eg.elt=this;var eb=eg;eb.next=ee.head;ee.head=eb;ee.modified=true;ee.length++;this.active=true;this.present=0;this.cleared=false;this.sleeping=false;this.fresh=false;this.presentable=false};j.prototype.sup_retire=function(){if(!this.cleared){var ef=this.b1.arbiters;var ee=null;var el=ef.head;while(el!=null){if(el.elt==this){var eb;var eh;if(ee==null){eb=ef.head;eh=eb.next;ef.head=eh;if(ef.head==null){ef.pushmod=true}}else{eb=ee.next;eh=eb.next;ee.next=eh;if(eh==null){ef.pushmod=true}}var ea=eb;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;ef.modified=true;ef.length--;ef.pushmod=true;break}ee=el;el=el.next}var ei=this.b2.arbiters;var ed=null;var ek=ei.head;while(ek!=null){if(ek.elt==this){var eg;var ej;if(ed==null){eg=ei.head;ej=eg.next;ei.head=ej;if(ei.head==null){ei.pushmod=true}}else{eg=ed.next;ej=eg.next;ed.next=ej;if(ej==null){ei.pushmod=true}}var ec=eg;ec.elt=null;ec.next=dL.zpp_pool;dL.zpp_pool=ec;ei.modified=true;ei.length--;ei.pushmod=true;break}ed=ek;ek=ek.next}if(this.pair!=null){this.pair.arb=null;this.pair=null}}this.b1=this.b2=null;this.active=false;this.intchange=false};j.prototype.__class__=j;var A=zpp_nape.dynamics.ZPP_SensorArbiter=function(){this.next=null;j.call(this);this.type=j.SENSOR;this.sensorarb=this};A.__name__=["zpp_nape","dynamics","ZPP_SensorArbiter"];A.__super__=j;A.prototype=Object.create(j.prototype);A.prototype.next=null;A.prototype.alloc=function(){};A.prototype.free=function(){};A.prototype.assign=function(ei,eh,ea,ef){this.b1=ei.body;this.ws1=ei;this.b2=eh.body;this.ws2=eh;this.id=ea;this.di=ef;var ec=this.b1.arbiters;var ed;if(dL.zpp_pool==null){ed=new dL()}else{ed=dL.zpp_pool;dL.zpp_pool=ed.next;ed.next=null}ed.elt=this;var ej=ed;ej.next=ec.head;ec.head=ej;ec.modified=true;ec.length++;var ee=this.b2.arbiters;var eg;if(dL.zpp_pool==null){eg=new dL()}else{eg=dL.zpp_pool;dL.zpp_pool=eg.next;eg.next=null}eg.elt=this;var eb=eg;eb.next=ee.head;ee.head=eb;ee.modified=true;ee.length++;this.active=true;this.present=0;this.cleared=false;this.sleeping=false;this.fresh=false;this.presentable=false};A.prototype.retire=function(){if(!this.cleared){var eg=this.b1.arbiters;var ef=null;var em=eg.head;while(em!=null){if(em.elt==this){var ec;var ei;if(ef==null){ec=eg.head;ei=ec.next;eg.head=ei;if(eg.head==null){eg.pushmod=true}}else{ec=ef.next;ei=ec.next;ef.next=ei;if(ei==null){eg.pushmod=true}}var ea=ec;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;eg.modified=true;eg.length--;eg.pushmod=true;break}ef=em;em=em.next}var ej=this.b2.arbiters;var ee=null;var el=ej.head;while(el!=null){if(el.elt==this){var eh;var ek;if(ee==null){eh=ej.head;ek=eh.next;ej.head=ek;if(ej.head==null){ej.pushmod=true}}else{eh=ee.next;ek=eh.next;ee.next=ek;if(ek==null){ej.pushmod=true}}var ed=eh;ed.elt=null;ed.next=dL.zpp_pool;dL.zpp_pool=ed;ej.modified=true;ej.length--;ej.pushmod=true;break}ee=el;el=el.next}if(this.pair!=null){this.pair.arb=null;this.pair=null}}this.b1=this.b2=null;this.active=false;this.intchange=false;var eb=this;eb.next=A.zpp_pool;A.zpp_pool=eb};A.prototype.makemutable=function(){};A.prototype.makeimmutable=function(){};A.prototype.__class__=A;var dK=zpp_nape.dynamics.ZPP_FluidArbiter=function(){this.pre_dt=0;this.mutable=false;this.wrap_position=null;this.buoyy=0;this.buoyx=0;this.ny=0;this.nx=0;this.lgamma=0;this.dampy=0;this.dampx=0;this.vMassc=0;this.vMassb=0;this.vMassa=0;this.agamma=0;this.adamp=0;this.wMass=0;this.nodrag=false;this.r2y=0;this.r2x=0;this.r1y=0;this.r1x=0;this.overlap=0;this.centroidy=0;this.centroidx=0;this.next=null;this.outer_zn=null;j.call(this);this.type=j.FLUID;this.fluidarb=this;this.buoyx=0;this.buoyy=0;this.pre_dt=-1};dK.__name__=["zpp_nape","dynamics","ZPP_FluidArbiter"];dK.__super__=j;dK.prototype=Object.create(j.prototype);dK.prototype.outer_zn=null;dK.prototype.next=null;dK.prototype.alloc=function(){};dK.prototype.free=function(){};dK.prototype.centroidx=null;dK.prototype.centroidy=null;dK.prototype.overlap=null;dK.prototype.r1x=null;dK.prototype.r1y=null;dK.prototype.r2x=null;dK.prototype.r2y=null;dK.prototype.nodrag=null;dK.prototype.wMass=null;dK.prototype.adamp=null;dK.prototype.agamma=null;dK.prototype.vMassa=null;dK.prototype.vMassb=null;dK.prototype.vMassc=null;dK.prototype.dampx=null;dK.prototype.dampy=null;dK.prototype.lgamma=null;dK.prototype.nx=null;dK.prototype.ny=null;dK.prototype.buoyx=null;dK.prototype.buoyy=null;dK.prototype.position_validate=function(){this.wrap_position.zpp_inner.x=this.centroidx;this.wrap_position.zpp_inner.y=this.centroidy};dK.prototype.position_invalidate=function(ea){this.centroidx=ea.x;this.centroidy=ea.y};dK.prototype.wrap_position=null;dK.prototype.getposition=function(){var ea;if(au.poolVec2==null){ea=new r()}else{ea=au.poolVec2;au.poolVec2=ea.zpp_pool;ea.zpp_pool=null}if(ea.zpp_inner==null){var ee;if(bB.zpp_pool==null){ee=new bB()}else{ee=bB.zpp_pool;bB.zpp_pool=ee.next;ee.next=null}ee.weak=false;ee._immutable=false;ee.x=0;ee.y=0;ea.zpp_inner=ee;ea.zpp_inner.outer=ea}else{var eb;var ef=ea.zpp_inner;if(ef._validate!=null){ef._validate()}if(ea.zpp_inner.x==0){var ed=ea.zpp_inner;if(ed._validate!=null){ed._validate()}eb=ea.zpp_inner.y==0}else{eb=false}if(!eb){ea.zpp_inner.x=0;ea.zpp_inner.y=0;var ec=ea.zpp_inner;if(ec._invalidate!=null){ec._invalidate(ec)}}}ea.zpp_inner.weak=false;this.wrap_position=ea;this.wrap_position.zpp_inner._inuse=true;this.wrap_position.zpp_inner._immutable=!this.mutable;this.wrap_position.zpp_inner._validate=dX(this,this.position_validate);this.wrap_position.zpp_inner._invalidate=dX(this,this.position_invalidate)};dK.prototype.assign=function(ei,eh,ea,ef){this.b1=ei.body;this.ws1=ei;this.b2=eh.body;this.ws2=eh;this.id=ea;this.di=ef;var ec=this.b1.arbiters;var ed;if(dL.zpp_pool==null){ed=new dL()}else{ed=dL.zpp_pool;dL.zpp_pool=ed.next;ed.next=null}ed.elt=this;var ej=ed;ej.next=ec.head;ec.head=ej;ec.modified=true;ec.length++;var ee=this.b2.arbiters;var eg;if(dL.zpp_pool==null){eg=new dL()}else{eg=dL.zpp_pool;dL.zpp_pool=eg.next;eg.next=null}eg.elt=this;var eb=eg;eb.next=ee.head;ee.head=eb;ee.modified=true;ee.length++;this.active=true;this.present=0;this.cleared=false;this.sleeping=false;this.fresh=false;this.presentable=false;this.nx=0;this.ny=1;this.dampx=0;this.dampy=0;this.adamp=0};dK.prototype.retire=function(){if(!this.cleared){var eg=this.b1.arbiters;var ef=null;var em=eg.head;while(em!=null){if(em.elt==this){var ec;var ei;if(ef==null){ec=eg.head;ei=ec.next;eg.head=ei;if(eg.head==null){eg.pushmod=true}}else{ec=ef.next;ei=ec.next;ef.next=ei;if(ei==null){eg.pushmod=true}}var ea=ec;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;eg.modified=true;eg.length--;eg.pushmod=true;break}ef=em;em=em.next}var ej=this.b2.arbiters;var ee=null;var el=ej.head;while(el!=null){if(el.elt==this){var eh;var ek;if(ee==null){eh=ej.head;ek=eh.next;ej.head=ek;if(ej.head==null){ej.pushmod=true}}else{eh=ee.next;ek=eh.next;ee.next=ek;if(ek==null){ej.pushmod=true}}var ed=eh;ed.elt=null;ed.next=dL.zpp_pool;dL.zpp_pool=ed;ej.modified=true;ej.length--;ej.pushmod=true;break}ee=el;el=el.next}if(this.pair!=null){this.pair.arb=null;this.pair=null}}this.b1=this.b2=null;this.active=false;this.intchange=false;var eb=this;eb.next=dK.zpp_pool;dK.zpp_pool=eb;this.pre_dt=-1};dK.prototype.mutable=null;dK.prototype.makemutable=function(){this.mutable=true;if(this.wrap_position!=null){this.wrap_position.zpp_inner._immutable=false}};dK.prototype.makeimmutable=function(){this.mutable=false;if(this.wrap_position!=null){this.wrap_position.zpp_inner._immutable=true}};dK.prototype.inject=function(eb,ea,ec){this.overlap=eb;this.centroidx=ea;this.centroidy=ec};dK.prototype.pre_dt=null;dK.prototype.preStep=function(eV,ek){if(this.pre_dt==-1){this.pre_dt=ek}var e0=ek/this.pre_dt;this.pre_dt=ek;this.r1x=this.centroidx-this.b1.posx;this.r1y=this.centroidy-this.b1.posy;this.r2x=this.centroidx-this.b2.posx;this.r2y=this.centroidy-this.b2.posy;var eY=0;var eW=0;if(this.ws1.fluidEnabled&&this.ws1.fluidProperties.wrap_gravity!=null){eY=this.ws1.fluidProperties.gravityx;eW=this.ws1.fluidProperties.gravityy}else{eY=eV.gravityx;eW=eV.gravityy}var ey=0;var ev=0;if(this.ws2.fluidEnabled&&this.ws2.fluidProperties.wrap_gravity!=null){ey=this.ws2.fluidProperties.gravityx;ev=this.ws2.fluidProperties.gravityy}else{ey=eV.gravityx;ev=eV.gravityy}var eF=0;var eD=0;if(this.ws1.fluidEnabled&&this.ws2.fluidEnabled){var eN=this.overlap*this.ws1.fluidProperties.density;var eK=this.overlap*this.ws2.fluidProperties.density;if(eN>eK){var eU=eN+eK;eF-=eY*eU;eD-=eW*eU}else{if(eNthis.ws2.worldCOMx*ej+this.ws2.worldCOMy*eh){var eJ=eN+eK;eF-=ej*eJ;eD-=eh*eJ}else{var eG=eN+eK;eF+=ej*eG;eD+=eh*eG}}}}else{if(this.ws1.fluidEnabled){var eT=this.overlap*this.ws1.fluidProperties.density;eF-=eY*eT;eD-=eW*eT}else{if(this.ws2.fluidEnabled){var eH=this.overlap*this.ws2.fluidProperties.density;eF+=ey*eH;eD+=ev*eH}}}eF*=ek;eD*=ek;this.buoyx=eF;this.buoyy=eD;if(this.b1.type==2){var eE=this.b1.imass;this.b1.velx-=eF*eE;this.b1.vely-=eD*eE;this.b1.angvel-=(eD*this.r1x-eF*this.r1y)*this.b1.iinertia}if(this.b2.type==2){var eC=this.b2.imass;this.b2.velx+=eF*eC;this.b2.vely+=eD*eC;this.b2.angvel+=(eD*this.r2x-eF*this.r2y)*this.b2.iinertia}if((!this.ws1.fluidEnabled||this.ws1.fluidProperties.viscosity==0)&&(!this.ws2.fluidEnabled||this.ws2.fluidProperties.viscosity==0)){this.nodrag=true;this.dampx=0;this.dampy=0;this.adamp=0}else{this.nodrag=false;var e1=0;if(this.ws1.fluidEnabled){this.ws2.validate_angDrag();e1=this.ws1.fluidProperties.viscosity*this.ws2.angDrag*this.overlap/this.ws2.area}if(this.ws2.fluidEnabled){this.ws1.validate_angDrag();e1+=this.ws2.fluidProperties.viscosity*this.ws1.angDrag*this.overlap/this.ws1.area}if(e1!=0){var el=this.b1.sinertia+this.b2.sinertia;if(el!=0){this.wMass=1/el}else{this.wMass=0}e1*=0.0004;var ea=2*Math.PI*e1;this.agamma=1/(ek*ea*(2+ea*ek));var eO=1/(1+this.agamma);this.agamma*=eO;this.wMass*=eO}else{this.wMass=0;this.agamma=0}var ef=this.b2.velx+this.b2.kinvelx-this.r2y*(this.b2.angvel+this.b2.kinangvel)-(this.b1.velx+this.b1.kinvelx-this.r1y*(this.b2.angvel+this.b2.kinangvel));var ee=this.b2.vely+this.b2.kinvely+this.r2x*(this.b2.angvel+this.b2.kinangvel)-(this.b1.vely+this.b1.kinvely+this.r1x*(this.b1.angvel+this.b1.kinangvel));if(!(ef*ef+ee*ee0){eg*=-P.fluidVacuumDrag;eg=eg}es-=eg*0.5*P.fluidLinearDrag;em=em.next}e3=es/ei}}if(this.ws2.fluidEnabled){var en=-this.ws2.fluidProperties.viscosity*this.overlap/this.ws1.area;if(this.ws1.type==0){e3-=en*this.ws1.circle.radius*P.fluidLinearDrag/(2*this.ws1.circle.radius*Math.PI)}else{var er=this.ws1.polygon;var eq=0;var eA=0;var ep=er.edges.head;while(ep!=null){var eL=ep.elt;eq+=eL.length;var ed=en*eL.length*(eL.gnormx*this.nx+eL.gnormy*this.ny);if(ed>0){ed*=-P.fluidVacuumDrag;ed=ed}eA-=ed*0.5*P.fluidLinearDrag;ep=ep.next}e3+=eA/eq}}if(e3!=0){var eZ=this.b1.smass+this.b2.smass;var ez=0;var ew=0;var eu=0;ez=eZ;ew=0;eu=eZ;if(this.b1.sinertia!=0){var ec=this.r1x*this.b1.sinertia;var eb=this.r1y*this.b1.sinertia;ez=eZ+eb*this.r1y;ew+=-eb*this.r1x;eu=eZ+ec*this.r1x}if(this.b2.sinertia!=0){var eR=this.r2x*this.b2.sinertia;var et=this.r2y*this.b2.sinertia;ez+=et*this.r2y;ew+=-et*this.r2x;eu+=eR*this.r2x}var eo=ez*eu-ew*ew;if(eo!=eo){eu=0;ew=eu;ez=ew}else{if(eo==0){if(ez!=0){ez=1/ez}else{ez=0}if(eu!=0){eu=1/eu}else{eu=0}ew=0}else{eo=1/eo;var eB=eu*eo;eu=ez*eo;ez=eB;ew*=-eo}}this.vMassa=ez;this.vMassb=ew;this.vMassc=eu;var eX=2*Math.PI*e3;this.lgamma=1/(ek*eX*(2+eX*ek));var eP=1/(1+this.lgamma);this.lgamma*=eP;this.vMassa*=eP;this.vMassb*=eP;this.vMassc*=eP}else{this.vMassa=0;this.vMassb=0;this.vMassc=0;this.lgamma=0}}this.dampx*=e0;this.dampy*=e0;this.adamp*=e0};dK.prototype.warmStart=function(){var ea=this.b1.imass;this.b1.velx-=this.dampx*ea;this.b1.vely-=this.dampy*ea;var eb=this.b2.imass;this.b2.velx+=this.dampx*eb;this.b2.vely+=this.dampy*eb;this.b1.angvel-=this.b1.iinertia*(this.dampy*this.r1x-this.dampx*this.r1y);this.b2.angvel+=this.b2.iinertia*(this.dampy*this.r2x-this.dampx*this.r2y);this.b1.angvel-=this.adamp*this.b1.iinertia;this.b2.angvel+=this.adamp*this.b2.iinertia};dK.prototype.applyImpulseVel=function(){if(!this.nodrag){var ee=this.b1.angvel+this.b1.kinangvel;var eb=this.b2.angvel+this.b2.kinangvel;var eh=this.b1.velx+this.b1.kinvelx-this.r1y*ee-(this.b2.velx+this.b2.kinvelx-this.r2y*eb);var eg=this.b1.vely+this.b1.kinvely+this.r1x*ee-(this.b2.vely+this.b2.kinvely+this.r2x*eb);var ei=this.vMassa*eh+this.vMassb*eg;eg=this.vMassb*eh+this.vMassc*eg;eh=ei;var ef=this.lgamma;eh-=this.dampx*ef;eg-=this.dampy*ef;this.dampx+=eh;this.dampy+=eg;var ed=this.b1.imass;this.b1.velx-=eh*ed;this.b1.vely-=eg*ed;var ea=this.b2.imass;this.b2.velx+=eh*ea;this.b2.vely+=eg*ea;this.b1.angvel-=this.b1.iinertia*(eg*this.r1x-eh*this.r1y);this.b2.angvel+=this.b2.iinertia*(eg*this.r2x-eh*this.r2y);var ec=(ee-eb)*this.wMass-this.adamp*this.agamma;this.adamp+=ec;this.b1.angvel-=ec*this.b1.iinertia;this.b2.angvel+=ec*this.b2.iinertia}};dK.prototype.__class__=dK;var d9=zpp_nape.dynamics.ZPP_ColArbiter=function(){this.pre_dt=0;this.mutable=false;this.stat=false;this.next=null;this.hpc2=false;this.hc2=false;this.oc2=null;this.c2=null;this.oc1=null;this.c1=null;this.__ref_vertex=0;this.__ref_edge2=null;this.__ref_edge1=null;this.biasCoef=0;this.rev=false;this.radius=0;this.lproj=0;this.lnormy=0;this.lnormx=0;this.surfacey=0;this.surfacex=0;this.k2y=0;this.k2x=0;this.k1y=0;this.k1x=0;this.rt2b=0;this.rn2b=0;this.rt2a=0;this.rn2a=0;this.rt1b=0;this.rn1b=0;this.rt1a=0;this.rn1a=0;this.jrAcc=0;this.rMass=0;this.Kc=0;this.Kb=0;this.Ka=0;this.kMassc=0;this.kMassb=0;this.kMassa=0;this.wrap_normal=null;this.ny=0;this.nx=0;this.innards=null;this.wrap_contacts=null;this.contacts=null;this.s2=null;this.s1=null;this.userdef_rfric=false;this.userdef_restitution=false;this.userdef_stat_fric=false;this.userdef_dyn_fric=false;this.rfric=0;this.restitution=0;this.stat_fric=0;this.dyn_fric=0;this.outer_zn=null;j.call(this);this.pre_dt=-1;this.contacts=new c2();this.innards=new I();this.type=j.COL;this.colarb=this};d9.__name__=["zpp_nape","dynamics","ZPP_ColArbiter"];d9.__super__=j;d9.prototype=Object.create(j.prototype);d9.prototype.outer_zn=null;d9.prototype.dyn_fric=null;d9.prototype.stat_fric=null;d9.prototype.restitution=null;d9.prototype.rfric=null;d9.prototype.userdef_dyn_fric=null;d9.prototype.userdef_stat_fric=null;d9.prototype.userdef_restitution=null;d9.prototype.userdef_rfric=null;d9.prototype.s1=null;d9.prototype.s2=null;d9.prototype.contacts=null;d9.prototype.wrap_contacts=null;d9.prototype.innards=null;d9.prototype.nx=null;d9.prototype.ny=null;d9.prototype.normal_validate=function(){if(this.cleared){throw new cE("Error: Arbiter not currently in use")}this.wrap_normal.zpp_inner.x=this.nx;this.wrap_normal.zpp_inner.y=this.ny;if(this.ws1.id>this.ws2.id){this.wrap_normal.zpp_inner.x=-this.wrap_normal.zpp_inner.x;this.wrap_normal.zpp_inner.y=-this.wrap_normal.zpp_inner.y}};d9.prototype.wrap_normal=null;d9.prototype.getnormal=function(){var ea;if(au.poolVec2==null){ea=new r()}else{ea=au.poolVec2;au.poolVec2=ea.zpp_pool;ea.zpp_pool=null}if(ea.zpp_inner==null){var ee;if(bB.zpp_pool==null){ee=new bB()}else{ee=bB.zpp_pool;bB.zpp_pool=ee.next;ee.next=null}ee.weak=false;ee._immutable=false;ee.x=0;ee.y=0;ea.zpp_inner=ee;ea.zpp_inner.outer=ea}else{var eb;var ef=ea.zpp_inner;if(ef._validate!=null){ef._validate()}if(ea.zpp_inner.x==0){var ed=ea.zpp_inner;if(ed._validate!=null){ed._validate()}eb=ea.zpp_inner.y==0}else{eb=false}if(!eb){ea.zpp_inner.x=0;ea.zpp_inner.y=0;var ec=ea.zpp_inner;if(ec._invalidate!=null){ec._invalidate(ec)}}}ea.zpp_inner.weak=false;this.wrap_normal=ea;this.wrap_normal.zpp_inner._immutable=true;this.wrap_normal.zpp_inner._inuse=true;this.wrap_normal.zpp_inner._validate=dX(this,this.normal_validate)};d9.prototype.kMassa=null;d9.prototype.kMassb=null;d9.prototype.kMassc=null;d9.prototype.Ka=null;d9.prototype.Kb=null;d9.prototype.Kc=null;d9.prototype.rMass=null;d9.prototype.jrAcc=null;d9.prototype.rn1a=null;d9.prototype.rt1a=null;d9.prototype.rn1b=null;d9.prototype.rt1b=null;d9.prototype.rn2a=null;d9.prototype.rt2a=null;d9.prototype.rn2b=null;d9.prototype.rt2b=null;d9.prototype.k1x=null;d9.prototype.k1y=null;d9.prototype.k2x=null;d9.prototype.k2y=null;d9.prototype.surfacex=null;d9.prototype.surfacey=null;d9.prototype.ptype=null;d9.prototype.lnormx=null;d9.prototype.lnormy=null;d9.prototype.lproj=null;d9.prototype.radius=null;d9.prototype.rev=null;d9.prototype.biasCoef=null;d9.prototype.__ref_edge1=null;d9.prototype.__ref_edge2=null;d9.prototype.__ref_vertex=null;d9.prototype.c1=null;d9.prototype.oc1=null;d9.prototype.c2=null;d9.prototype.oc2=null;d9.prototype.hc2=null;d9.prototype.hpc2=null;d9.prototype.next=null;d9.prototype.alloc=function(){};d9.prototype.free=function(){this.userdef_dyn_fric=false;this.userdef_stat_fric=false;this.userdef_restitution=false;this.userdef_rfric=false;this.__ref_edge1=this.__ref_edge2=null};d9.prototype.stat=null;d9.prototype.injectContact=function(ej,ei,ee,ed,eh,ec,ea){if(ea==null){ea=false}var eg=null;var eb=this.contacts.next;while(eb!=null){var ek=eb;if(ec==ek.hash){eg=ek;break}eb=eb.next}if(eg==null){if(c2.zpp_pool==null){eg=new c2()}else{eg=c2.zpp_pool;c2.zpp_pool=eg.next;eg.next=null}var em=eg.inner;em.jnAcc=em.jtAcc=0;eg.hash=ec;eg.fresh=true;eg.arbiter=this;this.jrAcc=0;var ef=this.contacts;eg._inuse=true;var el=eg;el.next=ef.next;ef.next=el;ef.modified=true;ef.length++;this.innards.add(em)}else{eg.fresh=false}eg.px=ej;eg.py=ei;this.nx=ee;this.ny=ed;eg.dist=eh;eg.stamp=this.stamp;eg.posOnly=ea;return eg};d9.prototype.assign=function(ei,eh,ea,ef){this.b1=ei.body;this.ws1=ei;this.b2=eh.body;this.ws2=eh;this.id=ea;this.di=ef;var ec=this.b1.arbiters;var ed;if(dL.zpp_pool==null){ed=new dL()}else{ed=dL.zpp_pool;dL.zpp_pool=ed.next;ed.next=null}ed.elt=this;var ej=ed;ej.next=ec.head;ec.head=ej;ec.modified=true;ec.length++;var ee=this.b2.arbiters;var eg;if(dL.zpp_pool==null){eg=new dL()}else{eg=dL.zpp_pool;dL.zpp_pool=eg.next;eg.next=null}eg.elt=this;var eb=eg;eb.next=ee.head;ee.head=eb;ee.modified=true;ee.length++;this.active=true;this.present=0;this.cleared=false;this.sleeping=false;this.fresh=false;this.presentable=false;this.s1=ei;this.s2=eh;if(!this.userdef_restitution){if(this.s1.material.elasticity<=-Infinity||this.s2.material.elasticity<=-Infinity){this.restitution=0}else{if(this.s1.material.elasticity>=Infinity||this.s2.material.elasticity>=Infinity){this.restitution=1}else{this.restitution=(this.s1.material.elasticity+this.s2.material.elasticity)/2}}if(this.restitution<0){this.restitution=0}if(this.restitution>1){this.restitution=1}}if(!this.userdef_dyn_fric){this.dyn_fric=Math.sqrt(this.s1.material.dynamicFriction*this.s2.material.dynamicFriction)}if(!this.userdef_stat_fric){this.stat_fric=Math.sqrt(this.s1.material.staticFriction*this.s2.material.staticFriction)}if(!this.userdef_rfric){this.rfric=Math.sqrt(this.s1.material.rollingFriction*this.s2.material.rollingFriction)}};d9.prototype.calcProperties=function(){if(!this.userdef_restitution){if(this.s1.material.elasticity<=-Infinity||this.s2.material.elasticity<=-Infinity){this.restitution=0}else{if(this.s1.material.elasticity>=Infinity||this.s2.material.elasticity>=Infinity){this.restitution=1}else{this.restitution=(this.s1.material.elasticity+this.s2.material.elasticity)/2}}if(this.restitution<0){this.restitution=0}if(this.restitution>1){this.restitution=1}}if(!this.userdef_dyn_fric){this.dyn_fric=Math.sqrt(this.s1.material.dynamicFriction*this.s2.material.dynamicFriction)}if(!this.userdef_stat_fric){this.stat_fric=Math.sqrt(this.s1.material.staticFriction*this.s2.material.staticFriction)}if(!this.userdef_rfric){this.rfric=Math.sqrt(this.s1.material.rollingFriction*this.s2.material.rollingFriction)}};d9.prototype.validate_props=function(){if(this.invalidated){this.invalidated=false;if(!this.userdef_restitution){if(this.s1.material.elasticity<=-Infinity||this.s2.material.elasticity<=-Infinity){this.restitution=0}else{if(this.s1.material.elasticity>=Infinity||this.s2.material.elasticity>=Infinity){this.restitution=1}else{this.restitution=(this.s1.material.elasticity+this.s2.material.elasticity)/2}}if(this.restitution<0){this.restitution=0}if(this.restitution>1){this.restitution=1}}if(!this.userdef_dyn_fric){this.dyn_fric=Math.sqrt(this.s1.material.dynamicFriction*this.s2.material.dynamicFriction)}if(!this.userdef_stat_fric){this.stat_fric=Math.sqrt(this.s1.material.staticFriction*this.s2.material.staticFriction)}if(!this.userdef_rfric){this.rfric=Math.sqrt(this.s1.material.rollingFriction*this.s2.material.rollingFriction)}}};d9.prototype.retire=function(){if(!this.cleared){var eh=this.b1.arbiters;var ef=null;var eq=eh.head;while(eq!=null){if(eq.elt==this){var ec;var ek;if(ef==null){ec=eh.head;ek=ec.next;eh.head=ek;if(eh.head==null){eh.pushmod=true}}else{ec=ef.next;ek=ec.next;ef.next=ek;if(ek==null){eh.pushmod=true}}var ea=ec;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;eh.modified=true;eh.length--;eh.pushmod=true;break}ef=eq;eq=eq.next}var em=this.b2.arbiters;var ee=null;var ep=em.head;while(ep!=null){if(ep.elt==this){var ej;var eo;if(ee==null){ej=em.head;eo=ej.next;em.head=eo;if(em.head==null){em.pushmod=true}}else{ej=ee.next;eo=ej.next;ee.next=eo;if(eo==null){em.pushmod=true}}var ed=ej;ed.elt=null;ed.next=dL.zpp_pool;dL.zpp_pool=ed;em.modified=true;em.length--;em.pushmod=true;break}ee=ep;ep=ep.next}if(this.pair!=null){this.pair.arb=null;this.pair=null}}this.b1=this.b2=null;this.active=false;this.intchange=false;while(this.contacts.next!=null){var ei=this.contacts;var en=ei.next;ei.pop();en.arbiter=null;en.next=c2.zpp_pool;c2.zpp_pool=en;var eg=this.innards;var el=eg.next;eg.next=el.next;el._inuse=false;if(eg.next==null){eg.pushmod=true}eg.modified=true;eg.length--}var eb=this;eb.userdef_dyn_fric=false;eb.userdef_stat_fric=false;eb.userdef_restitution=false;eb.userdef_rfric=false;eb.__ref_edge1=eb.__ref_edge2=null;eb.next=d9.zpp_pool;d9.zpp_pool=eb;this.pre_dt=-1};d9.prototype.mutable=null;d9.prototype.makemutable=function(){this.mutable=true;if(this.wrap_normal!=null){this.wrap_normal.zpp_inner._immutable=false}if(this.wrap_contacts!=null){this.wrap_contacts.zpp_inner.immutable=false}};d9.prototype.makeimmutable=function(){this.mutable=false;if(this.wrap_normal!=null){this.wrap_normal.zpp_inner._immutable=true}if(this.wrap_contacts!=null){this.wrap_contacts.zpp_inner.immutable=true}};d9.prototype.contacts_adder=function(ea){return false};d9.prototype.contacts_subber=function(ea){var ee=null;var ed=null;var ec=this.innards.next;var eb=this.contacts.next;while(eb!=null){var ef=eb;if(ef==ea.zpp_inner){this.contacts.erase(ee);this.innards.erase(ed);ef.arbiter=null;ef.next=c2.zpp_pool;c2.zpp_pool=ef;break}ee=eb;ed=ec;ec=ec.next;eb=eb.next}};d9.prototype.setupcontacts=function(){this.wrap_contacts=aB.get(this.contacts,true);this.wrap_contacts.zpp_inner.immutable=!this.mutable;this.wrap_contacts.zpp_inner.adder=dX(this,this.contacts_adder);this.wrap_contacts.zpp_inner.dontremove=true;this.wrap_contacts.zpp_inner.subber=dX(this,this.contacts_subber)};d9.prototype.cleanupContacts=function(){var ea=true;var ee=null;var eo=null;var eg=this.innards.next;this.hc2=false;var ec=this.contacts.next;while(ec!=null){var em=ec;if(em.stamp+P.arbiterExpirationDelay=Infinity||this.s2.material.elasticity>=Infinity){this.restitution=1}else{this.restitution=(this.s1.material.elasticity+this.s2.material.elasticity)/2}}if(this.restitution<0){this.restitution=0}if(this.restitution>1){this.restitution=1}}if(!this.userdef_dyn_fric){this.dyn_fric=Math.sqrt(this.s1.material.dynamicFriction*this.s2.material.dynamicFriction)}if(!this.userdef_stat_fric){this.stat_fric=Math.sqrt(this.s1.material.staticFriction*this.s2.material.staticFriction)}if(!this.userdef_rfric){this.rfric=Math.sqrt(this.s1.material.rollingFriction*this.s2.material.rollingFriction)}}if(this.pre_dt==-1){this.pre_dt=eq}var et=eq/this.pre_dt;this.pre_dt=eq;var em=this.b1.smass+this.b2.smass;this.hc2=false;var eb=true;this.biasCoef=this.b1.type!=2||this.b2.type!=2?this.continuous?P.contactContinuousStaticBiasCoef:P.contactStaticBiasCoef:this.continuous?P.contactContinuousBiasCoef:P.contactBiasCoef;this.continuous=false;var er=null;var eB=null;var ej=this.innards.next;var eu=this.contacts.next;while(eu!=null){var eC=eu;if(eC.stamp+P.arbiterExpirationDelay-P.elasticThreshold){ek.bounce=0}ed=el*this.nx-eo*this.ny;var ec=P.staticFrictionThreshold;if(ed*ed>ec*ec){ek.friction=this.dyn_fric}else{ek.friction=this.stat_fric}ek.jnAcc*=et;ek.jtAcc*=et}if(ep!=eC.active){this.contacts.modified=true}er=eu;eB=ej;ej=ej.next;eu=eu.next}if(this.hc2){this.hpc2=true;if(this.oc1.posOnly){var eA=this.c1;this.c1=this.c2;this.c2=eA;var es=this.oc1;this.oc1=this.oc2;this.oc2=es;this.hc2=false}else{if(this.oc2.posOnly){this.hc2=false}}if(this.oc1.posOnly){eb=true}}else{this.hpc2=false}this.jrAcc*=et;if(!eb){this.rn1a=this.ny*this.c1.r1x-this.nx*this.c1.r1y;this.rt1a=this.c1.r1x*this.nx+this.c1.r1y*this.ny;this.rn1b=this.ny*this.c1.r2x-this.nx*this.c1.r2y;this.rt1b=this.c1.r2x*this.nx+this.c1.r2y*this.ny;this.k1x=this.b2.kinvelx-this.c1.r2y*this.b2.kinangvel-(this.b1.kinvelx-this.c1.r1y*this.b1.kinangvel);this.k1y=this.b2.kinvely+this.c1.r2x*this.b2.kinangvel-(this.b1.kinvely+this.c1.r1x*this.b1.kinangvel)}if(this.hc2){this.rn2a=this.ny*this.c2.r1x-this.nx*this.c2.r1y;this.rt2a=this.c2.r1x*this.nx+this.c2.r1y*this.ny;this.rn2b=this.ny*this.c2.r2x-this.nx*this.c2.r2y;this.rt2b=this.c2.r2x*this.nx+this.c2.r2y*this.ny;this.k2x=this.b2.kinvelx-this.c2.r2y*this.b2.kinangvel-(this.b1.kinvelx-this.c2.r1y*this.b1.kinangvel);this.k2y=this.b2.kinvely+this.c2.r2x*this.b2.kinangvel-(this.b1.kinvely+this.c2.r1x*this.b1.kinangvel);this.kMassa=em+this.b1.sinertia*this.rn1a*this.rn1a+this.b2.sinertia*this.rn1b*this.rn1b;this.kMassb=em+this.b1.sinertia*this.rn1a*this.rn2a+this.b2.sinertia*this.rn1b*this.rn2b;this.kMassc=em+this.b1.sinertia*this.rn2a*this.rn2a+this.b2.sinertia*this.rn2b*this.rn2b;if(this.kMassa*this.kMassa+2*this.kMassb*this.kMassb+this.kMassc*this.kMassced){ee=ed}else{if(ee<-ed){ee=-ed}}eg=ee-ek;this.c1.jtAcc=ee;em=-this.ny*eg;el=this.nx*eg;this.b2.velx+=em*this.b2.imass;this.b2.vely+=el*this.b2.imass;this.b1.velx-=em*this.b1.imass;this.b1.vely-=el*this.b1.imass;this.b2.angvel+=this.rt1b*eg*this.b2.iinertia;this.b1.angvel-=this.rt1a*eg*this.b1.iinertia;if(this.hc2){var ec=this.k2x+this.b2.velx-this.c2.r2y*this.b2.angvel-(this.b1.velx-this.c2.r1y*this.b1.angvel);var ep=this.k2y+this.b2.vely+this.c2.r2x*this.b2.angvel-(this.b1.vely+this.c2.r1x*this.b1.angvel);eg=(ep*this.nx-ec*this.ny+this.surfacex)*this.c2.tMass;ed=this.c2.friction*this.c2.jnAcc;ek=this.c2.jtAcc;ee=ek-eg;if(ee>ed){ee=ed}else{if(ee<-ed){ee=-ed}}eg=ee-ek;this.c2.jtAcc=ee;em=-this.ny*eg;el=this.nx*eg;this.b2.velx+=em*this.b2.imass;this.b2.vely+=el*this.b2.imass;this.b1.velx-=em*this.b1.imass;this.b1.vely-=el*this.b1.imass;this.b2.angvel+=this.rt2b*eg*this.b2.iinertia;this.b1.angvel-=this.rt2a*eg*this.b1.iinertia;eh=this.k1x+this.b2.velx-this.c1.r2y*this.b2.angvel-(this.b1.velx-this.c1.r1y*this.b1.angvel);ef=this.k1y+this.b2.vely+this.c1.r2x*this.b2.angvel-(this.b1.vely+this.c1.r1x*this.b1.angvel);ec=this.k2x+this.b2.velx-this.c2.r2y*this.b2.angvel-(this.b1.velx-this.c2.r1y*this.b1.angvel);ep=this.k2y+this.b2.vely+this.c2.r2x*this.b2.angvel-(this.b1.vely+this.c2.r1x*this.b1.angvel);var eb=this.c1.jnAcc;var eo=this.c2.jnAcc;var ej=eh*this.nx+ef*this.ny+this.surfacey+this.c1.bounce-(this.Ka*eb+this.Kb*eo);var ei=ec*this.nx+ep*this.ny+this.surfacey+this.c2.bounce-(this.Kb*eb+this.Kc*eo);var ea=-(this.kMassa*ej+this.kMassb*ei);var en=-(this.kMassb*ej+this.kMassc*ei);if(ea>=0&&en>=0){ej=ea-eb;ei=en-eo;this.c1.jnAcc=ea;this.c2.jnAcc=en}else{ea=-this.c1.nMass*ej;if(ea>=0&&this.Kb*ea+ei>=0){ej=ea-eb;ei=-eo;this.c1.jnAcc=ea;this.c2.jnAcc=0}else{en=-this.c2.nMass*ei;if(en>=0&&this.Kb*en+ej>=0){ej=-eb;ei=en-eo;this.c1.jnAcc=0;this.c2.jnAcc=en}else{if(ej>=0&&ei>=0){ej=-eb;ei=-eo;this.c1.jnAcc=this.c2.jnAcc=0}else{ej=0;ei=0}}}}eg=ej+ei;em=this.nx*eg;el=this.ny*eg;this.b2.velx+=em*this.b2.imass;this.b2.vely+=el*this.b2.imass;this.b1.velx-=em*this.b1.imass;this.b1.vely-=el*this.b1.imass;this.b2.angvel+=(this.rn1b*ej+this.rn2b*ei)*this.b2.iinertia;this.b1.angvel-=(this.rn1a*ej+this.rn2a*ei)*this.b1.iinertia}else{if(this.radius!=0){eg=(this.b2.angvel-this.b1.angvel)*this.rMass;ed=this.rfric*this.c1.jnAcc;ek=this.jrAcc;this.jrAcc-=eg;if(this.jrAcc>ed){this.jrAcc=ed}else{if(this.jrAcc<-ed){this.jrAcc=-ed}}eg=this.jrAcc-ek;this.b2.angvel+=eg*this.b2.iinertia;this.b1.angvel-=eg*this.b1.iinertia}eh=this.k1x+this.b2.velx-this.c1.r2y*this.b2.angvel-(this.b1.velx-this.c1.r1y*this.b1.angvel);ef=this.k1y+this.b2.vely+this.c1.r2x*this.b2.angvel-(this.b1.vely+this.c1.r1x*this.b1.angvel);eg=(this.c1.bounce+(this.nx*eh+this.ny*ef)+this.surfacey)*this.c1.nMass;ek=this.c1.jnAcc;ee=ek-eg;if(ee<0){ee=0}eg=ee-ek;this.c1.jnAcc=ee;em=this.nx*eg;el=this.ny*eg;this.b2.velx+=em*this.b2.imass;this.b2.vely+=el*this.b2.imass;this.b1.velx-=em*this.b1.imass;this.b1.vely-=el*this.b1.imass;this.b2.angvel+=this.rn1b*eg*this.b2.iinertia;this.b1.angvel-=this.rn1a*eg*this.b1.iinertia}};d9.prototype.applyImpulsePos=function(){if(this.ptype==2){var fo=this.c1;var fK=0;var fJ=0;fK=this.b2.axisy*fo.lr2x-this.b2.axisx*fo.lr2y;fJ=fo.lr2x*this.b2.axisx+fo.lr2y*this.b2.axisy;fK+=this.b2.posx;fJ+=this.b2.posy;var fZ=0;var fY=0;fZ=this.b1.axisy*fo.lr1x-this.b1.axisx*fo.lr1y;fY=fo.lr1x*this.b1.axisx+fo.lr1y*this.b1.axisy;fZ+=this.b1.posx;fY+=this.b1.posy;var ew=0;var ev=0;ew=fK-fZ;ev=fJ-fY;var eF=Math.sqrt(ew*ew+ev*ev);var e1=this.radius-P.collisionSlop;var fM=eF-e1;if(ew*this.nx+ev*this.ny<0){ew=-ew;ev=-ev;fM-=this.radius}if(fM<0){if(eF0.0001){eH.axisx=Math.sin(eH.rot);eH.axisy=Math.cos(eH.rot)}else{var fs=eA*eA;var e4=1-0.5*fs;var e8=1-fs*fs/8;var fu=(e4*eH.axisx+eA*eH.axisy)*e8;eH.axisy=(e4*eH.axisy-eA*eH.axisx)*e8;eH.axisx=fu}var gc=this.b2.imass;this.b2.posx+=eX*gc;this.b2.posy+=eW*gc;var fc=this.b2;var eu=eM*this.b2.iinertia*eG;fc.rot+=eu;if(eu*eu>0.0001){fc.axisx=Math.sin(fc.rot);fc.axisy=Math.cos(fc.rot)}else{var fr=eu*eu;var fF=1-0.5*fr;var ei=1-fr*fr/8;var fX=(fF*fc.axisx+eu*fc.axisy)*ei;fc.axisy=(fF*fc.axisy-eu*fc.axisx)*ei;fc.axisx=fX}}}}}else{var eV=0;var eU=0;var eY;var fN=0;var fL=0;var fG=0;var fE=0;if(this.ptype==0){eV=this.b1.axisy*this.lnormx-this.b1.axisx*this.lnormy;eU=this.lnormx*this.b1.axisx+this.lnormy*this.b1.axisy;eY=this.lproj+(eV*this.b1.posx+eU*this.b1.posy);fN=this.b2.axisy*this.c1.lr1x-this.b2.axisx*this.c1.lr1y;fL=this.c1.lr1x*this.b2.axisx+this.c1.lr1y*this.b2.axisy;fN+=this.b2.posx;fL+=this.b2.posy;if(this.hpc2){fG=this.b2.axisy*this.c2.lr1x-this.b2.axisx*this.c2.lr1y;fE=this.c2.lr1x*this.b2.axisx+this.c2.lr1y*this.b2.axisy;fG+=this.b2.posx;fE+=this.b2.posy}}else{eV=this.b2.axisy*this.lnormx-this.b2.axisx*this.lnormy;eU=this.lnormx*this.b2.axisx+this.lnormy*this.b2.axisy;eY=this.lproj+(eV*this.b2.posx+eU*this.b2.posy);fN=this.b1.axisy*this.c1.lr1x-this.b1.axisx*this.c1.lr1y;fL=this.c1.lr1x*this.b1.axisx+this.c1.lr1y*this.b1.axisy;fN+=this.b1.posx;fL+=this.b1.posy;if(this.hpc2){fG=this.b1.axisy*this.c2.lr1x-this.b1.axisx*this.c2.lr1y;fE=this.c2.lr1x*this.b1.axisx+this.c2.lr1y*this.b1.axisy;fG+=this.b1.posx;fE+=this.b1.posy}}var eL=fN*eV+fL*eU-eY-this.radius;eL+=P.collisionSlop;var eJ=0;if(this.hpc2){eJ=fG*eV+fE*eU-eY-this.radius;eJ+=P.collisionSlop}if(eL<0||eJ<0){if(this.rev){eV=-eV;eU=-eU}var fi=0;var ff=0;fi=fN-this.b1.posx;ff=fL-this.b1.posy;var eK=0;var eI=0;eK=fN-this.b2.posx;eI=fL-this.b2.posy;var fq=0;var fn=0;var eT=0;var eR=0;if(this.hpc2){fq=fG-this.b1.posx;fn=fE-this.b1.posy;eT=fG-this.b2.posx;eR=fE-this.b2.posy;var en=eU*fi-eV*ff;var el=eU*eK-eV*eI;var ga=eU*fq-eV*fn;var f8=eU*eT-eV*eR;var et=this.b1.smass+this.b2.smass;this.kMassa=et+this.b1.sinertia*en*en+this.b2.sinertia*el*el;this.kMassb=et+this.b1.sinertia*en*ga+this.b2.sinertia*el*f8;this.kMassc=et+this.b1.sinertia*ga*ga+this.b2.sinertia*f8*f8;var eS=0;var eP=0;var eN=0;eS=this.kMassa;eP=this.kMassb;eN=this.kMassc;var fk=eL*this.biasCoef;var fh=eJ*this.biasCoef;while(true){var f7=0;var f5=0;f7=fk;f5=fh;f7=-fk;f5=-fh;var f0=this.kMassa*this.kMassc-this.kMassb*this.kMassb;if(f0!=f0){f5=0;f7=f5}else{if(f0==0){if(this.kMassa!=0){f7/=this.kMassa}else{f7=0}if(this.kMassc!=0){f5/=this.kMassc}else{f5=0}}else{f0=1/f0;var gb=f0*(this.kMassc*f7-this.kMassb*f5);f5=f0*(this.kMassa*f5-this.kMassb*f7);f7=gb}}if(f7>=0&&f5>=0){var f9=(f7+f5)*this.b1.imass;this.b1.posx-=eV*f9;this.b1.posy-=eU*f9;var fa=this.b1;var es=-this.b1.iinertia*(en*f7+ga*f5);fa.rot+=es;if(es*es>0.0001){fa.axisx=Math.sin(fa.rot);fa.axisy=Math.cos(fa.rot)}else{var fp=es*es;var fD=1-0.5*fp;var eh=1-fp*fp/8;var fW=(fD*fa.axisx+es*fa.axisy)*eh;fa.axisy=(fD*fa.axisy-es*fa.axisx)*eh;fa.axisx=fW}var f6=(f7+f5)*this.b2.imass;this.b2.posx+=eV*f6;this.b2.posy+=eU*f6;var e9=this.b2;var er=this.b2.iinertia*(el*f7+f8*f5);e9.rot+=er;if(er*er>0.0001){e9.axisx=Math.sin(e9.rot);e9.axisy=Math.cos(e9.rot)}else{var fm=er*er;var fB=1-0.5*fm;var eg=1-fm*fm/8;var fV=(fB*e9.axisx+er*e9.axisy)*eg;e9.axisy=(fB*e9.axisy-er*e9.axisx)*eg;e9.axisx=fV}break}f7=-fk/eS;f5=0;var eB=eP*f7+fh;if(f7>=0&&eB>=0){var f4=(f7+f5)*this.b1.imass;this.b1.posx-=eV*f4;this.b1.posy-=eU*f4;var e7=this.b1;var eq=-this.b1.iinertia*(en*f7+ga*f5);e7.rot+=eq;if(eq*eq>0.0001){e7.axisx=Math.sin(e7.rot);e7.axisy=Math.cos(e7.rot)}else{var fl=eq*eq;var fA=1-0.5*fl;var ef=1-fl*fl/8;var fU=(fA*e7.axisx+eq*e7.axisy)*ef;e7.axisy=(fA*e7.axisy-eq*e7.axisx)*ef;e7.axisx=fU}var f3=(f7+f5)*this.b2.imass;this.b2.posx+=eV*f3;this.b2.posy+=eU*f3;var e6=this.b2;var ep=this.b2.iinertia*(el*f7+f8*f5);e6.rot+=ep;if(ep*ep>0.0001){e6.axisx=Math.sin(e6.rot);e6.axisy=Math.cos(e6.rot)}else{var fj=ep*ep;var fz=1-0.5*fj;var ee=1-fj*fj/8;var fT=(fz*e6.axisx+ep*e6.axisy)*ee;e6.axisy=(fz*e6.axisy-ep*e6.axisx)*ee;e6.axisx=fT}break}f7=0;f5=-fh/eN;var eC=eP*f5+fk;if(f5>=0&&eC>=0){var f2=(f7+f5)*this.b1.imass;this.b1.posx-=eV*f2;this.b1.posy-=eU*f2;var e5=this.b1;var eo=-this.b1.iinertia*(en*f7+ga*f5);e5.rot+=eo;if(eo*eo>0.0001){e5.axisx=Math.sin(e5.rot);e5.axisy=Math.cos(e5.rot)}else{var fg=eo*eo;var fy=1-0.5*fg;var ed=1-fg*fg/8;var fS=(fy*e5.axisx+eo*e5.axisy)*ed;e5.axisy=(fy*e5.axisy-eo*e5.axisx)*ed;e5.axisx=fS}var f1=(f7+f5)*this.b2.imass;this.b2.posx+=eV*f1;this.b2.posy+=eU*f1;var e3=this.b2;var em=this.b2.iinertia*(el*f7+f8*f5);e3.rot+=em;if(em*em>0.0001){e3.axisx=Math.sin(e3.rot);e3.axisy=Math.cos(e3.rot)}else{var fe=em*em;var fx=1-0.5*fe;var ec=1-fe*fe/8;var fR=(fx*e3.axisx+em*e3.axisy)*ec;e3.axisy=(fx*e3.axisy-em*e3.axisx)*ec;e3.axisx=fR}break}break}}else{var eQ=eU*fi-eV*ff;var ez=eU*eK-eV*eI;var fH=this.b2.smass+ez*ez*this.b2.sinertia+this.b1.smass+eQ*eQ*this.b1.sinertia;if(fH!=0){var fC=-this.biasCoef*eL/fH;var ge=0;var fQ=0;ge=eV*fC;fQ=eU*fC;var ey=this.b1.imass;this.b1.posx-=ge*ey;this.b1.posy-=fQ*ey;var e2=this.b1;var ek=-eQ*this.b1.iinertia*fC;e2.rot+=ek;if(ek*ek>0.0001){e2.axisx=Math.sin(e2.rot);e2.axisy=Math.cos(e2.rot)}else{var fd=ek*ek;var fw=1-0.5*fd;var eb=1-fd*fd/8;var fP=(fw*e2.axisx+ek*e2.axisy)*eb;e2.axisy=(fw*e2.axisy-ek*e2.axisx)*eb;e2.axisx=fP}var ex=this.b2.imass;this.b2.posx+=ge*ex;this.b2.posy+=fQ*ex;var e0=this.b2;var ej=ez*this.b2.iinertia*fC;e0.rot+=ej;if(ej*ej>0.0001){e0.axisx=Math.sin(e0.rot);e0.axisy=Math.cos(e0.rot)}else{var fb=ej*ej;var fv=1-0.5*fb;var ea=1-fb*fb/8;var fO=(fv*e0.axisx+ej*e0.axisy)*ea;e0.axisy=(fv*e0.axisy-ej*e0.axisx)*ea;e0.axisx=fO}}}}}};d9.prototype.__class__=d9;var c2=zpp_nape.dynamics.ZPP_Contact=function(){this.length=0;this.pushmod=false;this.modified=false;this._inuse=false;this.next=null;this.elasticity=0;this.dist=0;this.fresh=false;this.hash=0;this.stamp=0;this.posOnly=false;this.active=false;this.inner=null;this.arbiter=null;this.wrap_position=null;this.py=0;this.px=0;this.outer=null;this.inner=new I()};c2.__name__=["zpp_nape","dynamics","ZPP_Contact"];c2.prototype.outer=null;c2.prototype.wrapper=function(){if(this.outer==null){c2.internal=true;this.outer=new d8();c2.internal=false;this.outer.zpp_inner=this}return this.outer};c2.prototype.px=null;c2.prototype.py=null;c2.prototype.position_validate=function(){this.wrap_position.zpp_inner.x=this.px;this.wrap_position.zpp_inner.y=this.py};c2.prototype.wrap_position=null;c2.prototype.getposition=function(){var ea;if(au.poolVec2==null){ea=new r()}else{ea=au.poolVec2;au.poolVec2=ea.zpp_pool;ea.zpp_pool=null}if(ea.zpp_inner==null){var ee;if(bB.zpp_pool==null){ee=new bB()}else{ee=bB.zpp_pool;bB.zpp_pool=ee.next;ee.next=null}ee.weak=false;ee._immutable=false;ee.x=0;ee.y=0;ea.zpp_inner=ee;ea.zpp_inner.outer=ea}else{var eb;var ef=ea.zpp_inner;if(ef._validate!=null){ef._validate()}if(ea.zpp_inner.x==0){var ed=ea.zpp_inner;if(ed._validate!=null){ed._validate()}eb=ea.zpp_inner.y==0}else{eb=false}if(!eb){ea.zpp_inner.x=0;ea.zpp_inner.y=0;var ec=ea.zpp_inner;if(ec._invalidate!=null){ec._invalidate(ec)}}}ea.zpp_inner.weak=false;this.wrap_position=ea;this.wrap_position.zpp_inner._inuse=true;this.wrap_position.zpp_inner._immutable=true;this.wrap_position.zpp_inner._validate=dX(this,this.position_validate)};c2.prototype.inactiveme=function(){return !(this.active&&this.arbiter!=null&&!(!this.arbiter.active))};c2.prototype.arbiter=null;c2.prototype.inner=null;c2.prototype.active=null;c2.prototype.posOnly=null;c2.prototype.stamp=null;c2.prototype.hash=null;c2.prototype.fresh=null;c2.prototype.dist=null;c2.prototype.elasticity=null;c2.prototype.free=function(){this.arbiter=null};c2.prototype.alloc=function(){};c2.prototype.next=null;c2.prototype.elem=function(){return this};c2.prototype.begin=function(){return this.next};c2.prototype._inuse=null;c2.prototype.modified=null;c2.prototype.pushmod=null;c2.prototype.length=null;c2.prototype.setbegin=function(ea){this.next=ea;this.modified=true;this.pushmod=true};c2.prototype.add=function(ea){ea._inuse=true;ea.next=this.next;this.next=ea;this.modified=true;this.length++;return ea};c2.prototype.inlined_add=function(ea){ea._inuse=true;ea.next=this.next;this.next=ea;this.modified=true;this.length++;return ea};c2.prototype.addAll=function(ea){var eb=ea.next;while(eb!=null){this.add(eb);eb=eb.next}};c2.prototype.insert=function(eb,ea){ea._inuse=true;if(eb==null){ea.next=this.next;this.next=ea}else{ea.next=eb.next;eb.next=ea}this.pushmod=this.modified=true;this.length++;return ea};c2.prototype.inlined_insert=function(eb,ea){ea._inuse=true;if(eb==null){ea.next=this.next;this.next=ea}else{ea.next=eb.next;eb.next=ea}this.pushmod=this.modified=true;this.length++;return ea};c2.prototype.pop=function(){var ea=this.next;this.next=ea.next;ea._inuse=false;if(this.next==null){this.pushmod=true}this.modified=true;this.length--};c2.prototype.inlined_pop=function(){var ea=this.next;this.next=ea.next;ea._inuse=false;if(this.next==null){this.pushmod=true}this.modified=true;this.length--};c2.prototype.pop_unsafe=function(){var ea=this.next;this.pop();return ea};c2.prototype.inlined_pop_unsafe=function(){var ea=this.next;this.pop();return ea};c2.prototype.remove=function(ed){var ec=null;var ee=this.next;while(ee!=null){if(ee==ed){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;break}ec=ee;ee=ee.next}};c2.prototype.try_remove=function(ec){var eb=null;var ed=this.next;var ea=false;while(ed!=null){if(ed==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};c2.prototype.inlined_remove=function(ed){var ec=null;var ee=this.next;while(ee!=null){if(ee==ed){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;break}ec=ee;ee=ee.next}};c2.prototype.inlined_try_remove=function(ee){var ed=null;var ef=this.next;var eb=false;while(ef!=null){if(ef==ee){var ea;var ec;if(ed==null){ea=this.next;ec=ea.next;this.next=ec;if(this.next==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=ef;ef=ef.next}return eb};c2.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;return eb};c2.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;return eb};c2.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};c2.prototype.clear=function(){};c2.prototype.inlined_clear=function(){};c2.prototype.reverse=function(){var ec=this.next;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.next=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};c2.prototype.empty=function(){return this.next==null};c2.prototype.size=function(){return this.length};c2.prototype.has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};c2.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};c2.prototype.front=function(){return this.next};c2.prototype.back=function(){var ea=this.next;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea};c2.prototype.iterator_at=function(eb){var ea=this.next;while(eb-->0&&ea!=null){ea=ea.next}return ea};c2.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea}else{return null}};c2.prototype.__class__=c2;var I=zpp_nape.dynamics.ZPP_IContact=function(){this.length=0;this.pushmod=false;this.modified=false;this._inuse=false;this.next=null;this.lr2y=0;this.lr2x=0;this.lr1y=0;this.lr1x=0;this.jtAcc=0;this.jnAcc=0;this.friction=0;this.bounce=0;this.tMass=0;this.nMass=0;this.r2y=0;this.r2x=0;this.r1y=0;this.r1x=0};I.__name__=["zpp_nape","dynamics","ZPP_IContact"];I.prototype.r1x=null;I.prototype.r1y=null;I.prototype.r2x=null;I.prototype.r2y=null;I.prototype.nMass=null;I.prototype.tMass=null;I.prototype.bounce=null;I.prototype.friction=null;I.prototype.jnAcc=null;I.prototype.jtAcc=null;I.prototype.lr1x=null;I.prototype.lr1y=null;I.prototype.lr2x=null;I.prototype.lr2y=null;I.prototype.next=null;I.prototype.elem=function(){return this};I.prototype.begin=function(){return this.next};I.prototype._inuse=null;I.prototype.modified=null;I.prototype.pushmod=null;I.prototype.length=null;I.prototype.setbegin=function(ea){this.next=ea;this.modified=true;this.pushmod=true};I.prototype.add=function(ea){ea._inuse=true;ea.next=this.next;this.next=ea;this.modified=true;this.length++;return ea};I.prototype.inlined_add=function(ea){ea._inuse=true;ea.next=this.next;this.next=ea;this.modified=true;this.length++;return ea};I.prototype.addAll=function(ea){var eb=ea.next;while(eb!=null){this.add(eb);eb=eb.next}};I.prototype.insert=function(eb,ea){ea._inuse=true;if(eb==null){ea.next=this.next;this.next=ea}else{ea.next=eb.next;eb.next=ea}this.pushmod=this.modified=true;this.length++;return ea};I.prototype.inlined_insert=function(eb,ea){ea._inuse=true;if(eb==null){ea.next=this.next;this.next=ea}else{ea.next=eb.next;eb.next=ea}this.pushmod=this.modified=true;this.length++;return ea};I.prototype.pop=function(){var ea=this.next;this.next=ea.next;ea._inuse=false;if(this.next==null){this.pushmod=true}this.modified=true;this.length--};I.prototype.inlined_pop=function(){var ea=this.next;this.next=ea.next;ea._inuse=false;if(this.next==null){this.pushmod=true}this.modified=true;this.length--};I.prototype.pop_unsafe=function(){var ea=this.next;this.pop();return ea};I.prototype.inlined_pop_unsafe=function(){var ea=this.next;this.pop();return ea};I.prototype.remove=function(ed){var ec=null;var ee=this.next;while(ee!=null){if(ee==ed){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;break}ec=ee;ee=ee.next}};I.prototype.try_remove=function(ec){var eb=null;var ed=this.next;var ea=false;while(ed!=null){if(ed==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};I.prototype.inlined_remove=function(ed){var ec=null;var ee=this.next;while(ee!=null){if(ee==ed){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;break}ec=ee;ee=ee.next}};I.prototype.inlined_try_remove=function(ee){var ed=null;var ef=this.next;var eb=false;while(ef!=null){if(ef==ee){var ea;var ec;if(ed==null){ea=this.next;ec=ea.next;this.next=ec;if(this.next==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=ef;ef=ef.next}return eb};I.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;return eb};I.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;return eb};I.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};I.prototype.clear=function(){};I.prototype.inlined_clear=function(){};I.prototype.reverse=function(){var ec=this.next;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.next=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};I.prototype.empty=function(){return this.next==null};I.prototype.size=function(){return this.length};I.prototype.has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};I.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};I.prototype.front=function(){return this.next};I.prototype.back=function(){var ea=this.next;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea};I.prototype.iterator_at=function(eb){var ea=this.next;while(eb-->0&&ea!=null){ea=ea.next}return ea};I.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea}else{return null}};I.prototype.__class__=I;var cA=zpp_nape.dynamics.ZPP_InteractionFilter=function(){this.fluidMask=0;this.fluidGroup=0;this.sensorMask=0;this.sensorGroup=0;this.collisionMask=0;this.collisionGroup=0;this.wrap_shapes=null;this.shapes=null;this.outer=null;this.userData=null;this.next=null;this.shapes=new s();this.collisionGroup=this.sensorGroup=this.fluidGroup=1;this.collisionMask=this.sensorMask=this.fluidMask=-1};cA.__name__=["zpp_nape","dynamics","ZPP_InteractionFilter"];cA.prototype.next=null;cA.prototype.userData=null;cA.prototype.outer=null;cA.prototype.wrapper=function(){if(this.outer==null){this.outer=new G();var ea=this.outer.zpp_inner;ea.outer=null;ea.next=cA.zpp_pool;cA.zpp_pool=ea;this.outer.zpp_inner=this}return this.outer};cA.prototype.free=function(){this.outer=null};cA.prototype.alloc=function(){};cA.prototype.shapes=null;cA.prototype.wrap_shapes=null;cA.prototype.feature_cons=function(){this.shapes=new s()};cA.prototype.addShape=function(ea){this.shapes.add(ea)};cA.prototype.remShape=function(ea){this.shapes.remove(ea)};cA.prototype.copy=function(){var ea;if(cA.zpp_pool==null){ea=new cA()}else{ea=cA.zpp_pool;cA.zpp_pool=ea.next;ea.next=null}ea.collisionGroup=this.collisionGroup;ea.collisionMask=this.collisionMask;ea.sensorGroup=this.sensorGroup;ea.sensorMask=this.sensorMask;ea.fluidGroup=this.fluidGroup;ea.fluidMask=this.fluidMask;return ea};cA.prototype.collisionGroup=null;cA.prototype.collisionMask=null;cA.prototype.shouldCollide=function(ea){if((this.collisionMask&ea.collisionGroup)!=0){return(ea.collisionMask&this.collisionGroup)!=0}else{return false}};cA.prototype.sensorGroup=null;cA.prototype.sensorMask=null;cA.prototype.shouldSense=function(ea){if((this.sensorMask&ea.sensorGroup)!=0){return(ea.sensorMask&this.sensorGroup)!=0}else{return false}};cA.prototype.fluidGroup=null;cA.prototype.fluidMask=null;cA.prototype.shouldFlow=function(ea){if((this.fluidMask&ea.fluidGroup)!=0){return(ea.fluidMask&this.fluidGroup)!=0}else{return false}};cA.prototype.invalidate=function(){var ea=this.shapes.head;while(ea!=null){ea.elt.invalidate_filter();ea=ea.next}};cA.prototype.__class__=cA;var ax=zpp_nape.dynamics.ZPP_InteractionGroup=function(){this.depth=0;this.wrap_interactors=null;this.interactors=null;this.wrap_groups=null;this.groups=null;this.group=null;this.ignore=false;this.outer=null;this.depth=0;this.groups=new da();this.interactors=new bn()};ax.__name__=["zpp_nape","dynamics","ZPP_InteractionGroup"];ax.prototype.outer=null;ax.prototype.ignore=null;ax.prototype.group=null;ax.prototype.setGroup=function(ea){if(this.group!=ea){if(this.group!=null){this.group.groups.remove(this);this.depth=0;this.group.invalidate(true)}this.group=ea;if(ea!=null){ea.groups.add(this);this.depth=ea.depth+1;ea.invalidate(true)}else{this.invalidate(true)}}};ax.prototype.groups=null;ax.prototype.wrap_groups=null;ax.prototype.interactors=null;ax.prototype.wrap_interactors=null;ax.prototype.depth=null;ax.prototype.invalidate=function(ed){if(ed==null){ed=false}if(!(ed||this.ignore)){return}var eb=this.interactors.head;while(eb!=null){var ea=eb.elt;if(ea.ibody!=null){ea.ibody.wake()}else{if(ea.ishape!=null){ea.ishape.body.wake()}else{ea.icompound.wake()}}eb=eb.next}var ec=this.groups.head;while(ec!=null){ec.elt.invalidate(ed);ec=ec.next}};ax.prototype.addGroup=function(ea){this.groups.add(ea);ea.depth=this.depth+1};ax.prototype.remGroup=function(ea){this.groups.remove(ea);ea.depth=0};ax.prototype.addInteractor=function(ea){this.interactors.add(ea)};ax.prototype.remInteractor=function(eb,ea){if(ea==null){ea=-1}this.interactors.remove(eb)};ax.prototype.__class__=ax;var aP=zpp_nape.dynamics.ZPP_SpaceArbiterList=function(){this.at_index_3=0;this.at_index_2=0;this.at_index_1=0;this.at_index_0=0;this.ite_3=null;this.ite_2=null;this.ite_1=null;this.ite_0=null;this.lengths=null;this.zip_length=false;this._length=0;this.space=null;dD.call(this);this.at_index_0=0;this.at_index_1=0;this.at_index_2=0;this.at_index_3=0;this.zip_length=true;this._length=0;this.lengths=[];var ea=0;while(ea<4){++ea;this.lengths.push(0)}};aP.__name__=["zpp_nape","dynamics","ZPP_SpaceArbiterList"];aP.__super__=dD;aP.prototype=Object.create(dD.prototype);aP.prototype.space=null;aP.prototype._length=null;aP.prototype.zip_length=null;aP.prototype.zpp_gl=function(){this.zpp_vm();if(this.zip_length){this._length=0;var ea=0;var ef=this.space.c_arbiters_true.head;while(ef!=null){if(ef.elt.active){++ea}ef=ef.next}this.lengths[0]=ea;this._length+=ea;var ed=0;var eh=this.space.c_arbiters_false.head;while(eh!=null){if(eh.elt.active){++ed}eh=eh.next}this.lengths[1]=ed;this._length+=ed;var ec=0;var eg=this.space.f_arbiters.head;while(eg!=null){if(eg.elt.active){++ec}eg=eg.next}this.lengths[2]=ec;this._length+=ec;var eb=0;var ee=this.space.s_arbiters.head;while(ee!=null){if(ee.elt.active){++eb}ee=ee.next}this.lengths[3]=eb;this._length+=eb;this.zip_length=false}return this._length};aP.prototype.lengths=null;aP.prototype.ite_0=null;aP.prototype.ite_1=null;aP.prototype.ite_2=null;aP.prototype.ite_3=null;aP.prototype.at_index_0=null;aP.prototype.at_index_1=null;aP.prototype.at_index_2=null;aP.prototype.at_index_3=null;aP.prototype.zpp_vm=function(){var ea=false;if(this.space.c_arbiters_true.modified){ea=true;this.space.c_arbiters_true.modified=false}if(this.space.c_arbiters_false.modified){ea=true;this.space.c_arbiters_false.modified=false}if(this.space.f_arbiters.modified){ea=true;this.space.f_arbiters.modified=false}if(this.space.s_arbiters.modified){ea=true;this.space.s_arbiters.modified=false}if(ea){this.zip_length=true;this._length=0;this.ite_0=null;this.ite_1=null;this.ite_2=null;this.ite_3=null}};aP.prototype.push=function(ea){return false};aP.prototype.pop=function(){return null};aP.prototype.unshift=function(ea){return false};aP.prototype.shift=function(){return null};aP.prototype.remove=function(ea){return false};aP.prototype.clear=function(){};aP.prototype.at=function(eb){this.zpp_vm();var ea=null;var ef=0;if(ea==null){if(ebthis.maxx||this.minx>ea.maxx)};bT.prototype.intersectY=function(ea){return !(ea.miny>this.maxy||this.miny>ea.maxy)};bT.prototype.intersect=function(ea){if(ea.miny<=this.maxy&&this.miny<=ea.maxy&&ea.minx<=this.maxx){return this.minx<=ea.maxx}else{return false}};bT.prototype.combine=function(ea){if(ea.minxthis.maxx){this.maxx=ea.maxx}if(ea.minythis.maxy){this.maxy=ea.maxy}};bT.prototype.contains=function(ea){if(ea.minx>=this.minx&&ea.miny>=this.miny&&ea.maxx<=this.maxx){return ea.maxy<=this.maxy}else{return false}};bT.prototype.containsPoint=function(ea){if(ea.x>=this.minx&&ea.x<=this.maxx&&ea.y>=this.miny){return ea.y<=this.maxy}else{return false}};bT.prototype.setCombine=function(eb,ea){this.minx=eb.minxea.maxx?eb.maxx:ea.maxx;this.maxy=eb.maxy>ea.maxy?eb.maxy:ea.maxy};bT.prototype.setExpand=function(ea,eb){this.minx=ea.minx-eb;this.miny=ea.miny-eb;this.maxx=ea.maxx+eb;this.maxy=ea.maxy+eb};bT.prototype.setExpandPoint=function(ea,eb){if(eathis.maxx){this.maxx=ea}if(ebthis.maxy){this.maxy=eb}};bT.prototype.toString=function(){return"{ x: "+this.minx+" y: "+this.miny+" w: "+(this.maxx-this.minx)+" h: "+(this.maxy-this.miny)+" }"};bT.prototype.__class__=bT;var aG=zpp_nape.util.ZNPList_ZPP_Vec2=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};aG.__name__=["zpp_nape","util","ZNPList_ZPP_Vec2"];aG.prototype.head=null;aG.prototype.begin=function(){return this.head};aG.prototype.modified=null;aG.prototype.pushmod=null;aG.prototype.length=null;aG.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};aG.prototype.add=function(ec){var eb;if(aV.zpp_pool==null){eb=new aV()}else{eb=aV.zpp_pool;aV.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};aG.prototype.inlined_add=function(ec){var eb;if(aV.zpp_pool==null){eb=new aV()}else{eb=aV.zpp_pool;aV.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};aG.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};aG.prototype.insert=function(ed,ec){var eb;if(aV.zpp_pool==null){eb=new aV()}else{eb=aV.zpp_pool;aV.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};aG.prototype.inlined_insert=function(ed,ec){var eb;if(aV.zpp_pool==null){eb=new aV()}else{eb=aV.zpp_pool;aV.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};aG.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aV.zpp_pool;aV.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};aG.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aV.zpp_pool;aV.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};aG.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};aG.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};aG.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aV.zpp_pool;aV.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};aG.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};aG.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=aV.zpp_pool;aV.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};aG.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=aV.zpp_pool;aV.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};aG.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aV.zpp_pool;aV.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};aG.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=aV.zpp_pool;aV.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};aG.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};aG.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aV.zpp_pool;aV.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};aG.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=aV.zpp_pool;aV.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};aG.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};aG.prototype.empty=function(){return this.head==null};aG.prototype.size=function(){return this.length};aG.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};aG.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};aG.prototype.front=function(){return this.head.elt};aG.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};aG.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};aG.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};aG.prototype.__class__=aG;var b7=zpp_nape.geom.ZPP_Collide=function(){};b7.__name__=["zpp_nape","geom","ZPP_Collide"];b7.circleContains=function(ed,ec){var eb=0;var ea=0;eb=ec.x-ed.worldCOMx;ea=ec.y-ed.worldCOMy;return eb*eb+ea*ea=es.minx&&eh.miny>=es.miny&&eh.maxx<=es.maxx&&eh.maxy<=es.maxy){if(ee.type==0){if(ed.type==0){var ec=ee.circle.radius+-ed.circle.radius;var el=0;var ek=0;el=ed.circle.worldCOMx-ee.circle.worldCOMx;ek=ed.circle.worldCOMy-ee.circle.worldCOMy;return el*el+ek*ek<=ec*ec}else{var ei;ei=true;var eq=ed.polygon.gverts.next;while(eq!=null){var eo=eq;var eg=ee.circle.radius;var eu=0;var ef=0;eu=eo.x-ee.circle.worldCOMx;ef=eo.y-ee.circle.worldCOMy;if(eu*eu+ef*ef<=eg*eg){eq=eq.next;continue}else{ei=false;break}}return ei}}else{if(ed.type==0){var eb;eb=true;var ep=ee.polygon.edges.head;while(ep!=null){var ev=ep.elt;if(ev.gnormx*ed.circle.worldCOMx+ev.gnormy*ed.circle.worldCOMy+ed.circle.radius<=ev.gprojection){ep=ep.next;continue}else{eb=false;break}}return eb}else{var ea;ea=true;var en=ee.polygon.edges.head;while(en!=null){var ew=en.elt;var et=-1e+100;var em=ed.polygon.gverts.next;while(em!=null){var ej=em;var er=ew.gnormx*ej.x+ew.gnormy*ej.y;if(er>et){et=er}em=em.next}if(et<=ew.gprojection){en=en.next;continue}else{ea=false;break}}return ea}}}else{return false}};b7.contactCollide=function(gd,ga,eD,fz){if(ga.type==1){if(gd.type==1){var gF=true;var fe=-1e+100;var eT=-1;var gJ=null;var gI=null;var eK=gd.polygon.edges.head;while(eK!=null){var gT=eK.elt;var gC=1e+100;var e5=ga.polygon.gverts.next;while(e5!=null){var gu=e5;var gD=gT.gnormx*gu.x+gT.gnormy*gu.y;if(gD=0){gF=false;break}if(gC>fe){fe=gC;gJ=gT;eT=1}eK=eK.next}if(gF){var e4=ga.polygon.edges.head;while(e4!=null){var gL=e4.elt;var eF=1e+100;var e3=gd.polygon.gverts.next;while(e3!=null){var fb=e3;var eQ=gL.gnormx*fb.x+gL.gnormy*fb.y;if(eQ=0){gF=false;break}if(eF>fe){fe=eF;gI=gL;eT=2}e4=e4.next}if(!gF){return false}else{var gE;var gK;var gs;if(eT==1){gE=ga.polygon;gK=gJ;gs=1}else{gE=gd.polygon;gK=gI;gs=-1}var gS=null;var eC=1e+100;var e2=gE.edges.head;while(e2!=null){var eA=e2.elt;var eP=gK.gnormx*eA.gnormx+gK.gnormy*eA.gnormy;if(ePP.epsilon){fo+=eS*gv;fl+=eR*gv}var fG=(-gK.tp0-gM)*gr;if(fG<-P.epsilon){fa+=eS*fG;e9+=eR*fG}var gP=0;var gO=0;var fD=gs;gP=gK.gnormx*fD;gO=gK.gnormy*fD;eD.lnormx=gK.lnormx;eD.lnormy=gK.lnormy;eD.lproj=gK.lprojection;eD.radius=0;eD.rev=fz!=(gs==-1);eD.ptype=eD.rev?1:0;var ft=fo*gK.gnormx+fl*gK.gnormy-gK.gprojection;var ff=fa*gK.gnormx+e9*gK.gnormy-gK.gprojection;if(ft>0&&ff>0){return false}else{if(fz){gP=-gP;gO=-gO}var gq=fo-gK.gnormx*ft*0.5;var gp=fl-gK.gnormy*ft*0.5;var gh=eD.rev?1:0;var gG=null;var e1=eD.contacts.next;while(e1!=null){var gQ=e1;if(gh==gQ.hash){gG=gQ;break}e1=e1.next}if(gG==null){if(c2.zpp_pool==null){gG=new c2()}else{gG=c2.zpp_pool;c2.zpp_pool=gG.next;gG.next=null}var gB=gG.inner;gB.jnAcc=gB.jtAcc=0;gG.hash=gh;gG.fresh=true;gG.arbiter=eD;eD.jrAcc=0;var gl=eD.contacts;gG._inuse=true;var gk=gG;gk.next=gl.next;gl.next=gk;gl.modified=true;gl.length++;eD.innards.add(gB)}else{gG.fresh=false}gG.px=gq;gG.py=gp;eD.nx=gP;eD.ny=gO;gG.dist=ft;gG.stamp=eD.stamp;gG.posOnly=ft>0;var fd=gG;fo-=gE.body.posx;fl-=gE.body.posy;fd.inner.lr1x=fo*gE.body.axisy+fl*gE.body.axisx;fd.inner.lr1y=fl*gE.body.axisy-fo*gE.body.axisx;var eI=fa-gK.gnormx*ff*0.5;var el=e9-gK.gnormy*ff*0.5;var gj=eD.rev?0:1;var g3=null;var e0=eD.contacts.next;while(e0!=null){var fY=e0;if(gj==fY.hash){g3=fY;break}e0=e0.next}if(g3==null){if(c2.zpp_pool==null){g3=new c2()}else{g3=c2.zpp_pool;c2.zpp_pool=g3.next;g3.next=null}var hm=g3.inner;hm.jnAcc=hm.jtAcc=0;g3.hash=gj;g3.fresh=true;g3.arbiter=eD;eD.jrAcc=0;var fr=eD.contacts;g3._inuse=true;var fL=g3;fL.next=fr.next;fr.next=fL;fr.modified=true;fr.length++;eD.innards.add(hm)}else{g3.fresh=false}g3.px=eI;g3.py=el;eD.nx=gP;eD.ny=gO;g3.dist=ff;g3.stamp=eD.stamp;g3.posOnly=ff>0;fd=g3;fa-=gE.body.posx;e9-=gE.body.posy;fd.inner.lr1x=fa*gE.body.axisy+e9*gE.body.axisx;fd.inner.lr1y=e9*gE.body.axisy-fa*gE.body.axisx;if(eT==1){eD.__ref_edge1=gK;eD.__ref_edge2=gS}else{eD.__ref_edge2=gK;eD.__ref_edge1=gS}return true}}}else{return false}}else{var fn=-1e+100;var go=true;var ec=null;var eO=null;var fu=ga.polygon.gverts.next;var eZ=ga.polygon.edges.head;while(eZ!=null){var gH=eZ.elt;var gm=gH.gnormx*gd.circle.worldCOMx+gH.gnormy*gd.circle.worldCOMy-gH.gprojection-gd.circle.radius;if(gm>0){go=false;break}if(gm>fn){fn=gm;ec=gH;eO=fu}fu=fu.next;eZ=eZ.next}if(go){var fc=eO;var gR=eO.next==null?ga.polygon.gverts.next:eO.next;var gn=gd.circle.worldCOMy*ec.gnormx-gd.circle.worldCOMx*ec.gnormy;if(gn<=fc.y*ec.gnormx-fc.x*ec.gnormy){var eU=gd.circle.radius;var eG=0;var ek=0;eG=fc.x-gd.circle.worldCOMx;ek=fc.y-gd.circle.worldCOMy;var gU=eG*eG+ek*ek;var gw;if(gU>eU*eU){gw=null}else{if(gU=gR.y*ec.gnormx-gR.x*ec.gnormy){var eW=gd.circle.radius;var ey=0;var eg=0;ey=gR.x-gd.circle.worldCOMx;eg=gR.y-gd.circle.worldCOMy;var gA=ey*ey+eg*eg;var fI;if(gA>eW*eW){fI=null}else{if(gAeV*eV){fC=null}else{if(gy0){ef=false;break}ex=ex.next}if(ef){var et=ec.polygon.edges.head;while(et!=null){var el=et.elt;var ey=1e+100;var es=ee.polygon.gverts.next;while(es!=null){var eg=es;var ek=el.gnormx*eg.x+el.gnormy*eg.y;if(ek0){ef=false;break}et=et.next}return ef}else{return false}}else{var eI=null;var eG=null;var eE=true;var eC=-1e+100;var eH=ec.polygon.gverts.next;var er=ec.polygon.edges.head;while(er!=null){var eF=er.elt;var ev=eF.gnormx*ee.circle.worldCOMx+eF.gnormy*ee.circle.worldCOMy-eF.gprojection-ee.circle.radius;if(ev>0){eE=false;break}if(ev>eC){eC=ev;eI=eF;eG=eH}eH=eH.next;er=er.next}if(eE){var eh=eG;var eD=eG.next==null?ec.polygon.gverts.next:eG.next;var eq=ee.circle.worldCOMy*eI.gnormx-ee.circle.worldCOMx*eI.gnormy;if(eq<=eh.y*eI.gnormx-eh.x*eI.gnormy){var eb=ee.circle.radius;var ep=0;var eo=0;ep=eh.x-ee.circle.worldCOMx;eo=eh.y-ee.circle.worldCOMy;return ep*ep+eo*eo<=eb*eb}else{if(eq>=eD.y*eI.gnormx-eD.x*eI.gnormy){var ej=ee.circle.radius;var eB=0;var ed=0;eB=eD.x-ee.circle.worldCOMx;ed=eD.y-ee.circle.worldCOMy;return eB*eB+ed*ed<=ej*ej}else{return true}}}else{return false}}}else{var ei=ee.circle.radius+ec.circle.radius;var eA=0;var ea=0;eA=ec.circle.worldCOMx-ee.circle.worldCOMx;ea=ec.circle.worldCOMy-ee.circle.worldCOMy;return eA*eA+ea*ea<=ei*ei}};b7.flowCollide=function(hw,hu,ke){if(hu.type==1){if(hw.type==1){var hR=[];var hO=[];var fb=true;var gW=true;var j5=hw.polygon.edges.head;while(j5!=null){var mb=j5.elt;var eI=1e+100;var lC=0;var gd=hu.polygon.gverts.next;while(gd!=null){var lj=gd;var lz=mb.gnormx*lj.x+mb.gnormy*lj.y;if(lz=mb.gprojection+P.epsilon){hO[lC]=true;gW=false}++lC;gd=gd.next}eI-=mb.gprojection;if(eI>0){fb=false;break}j5=j5.next}if(gW){var gz=hu.polygon;if(gz.zip_worldCOM){if(gz.body!=null){gz.zip_worldCOM=false;if(gz.zip_localCOM){gz.zip_localCOM=false;if(gz.type==1){var eY=gz.polygon;if(eY.lverts.next.next==null){eY.localCOMx=eY.lverts.next.x;eY.localCOMy=eY.lverts.next.y}else{if(eY.lverts.next.next.next==null){eY.localCOMx=eY.lverts.next.x;eY.localCOMy=eY.lverts.next.y;eY.localCOMx+=eY.lverts.next.next.x;eY.localCOMy+=eY.lverts.next.next.y;eY.localCOMx*=0.5;eY.localCOMy*=0.5}else{eY.localCOMx=0;eY.localCOMy=0;var iu=0;var gb=eY.lverts.next;var lm=gb;gb=gb.next;var gl=gb;gb=gb.next;while(gb!=null){var lg=gb;iu+=gl.x*(lg.y-lm.y);var lB=lg.y*gl.x-lg.x*gl.y;eY.localCOMx+=(gl.x+lg.x)*lB;eY.localCOMy+=(gl.y+lg.y)*lB;lm=gl;gl=lg;gb=gb.next}gb=eY.lverts.next;var fZ=gb;iu+=gl.x*(fZ.y-lm.y);var kG=fZ.y*gl.x-fZ.x*gl.y;eY.localCOMx+=(gl.x+fZ.x)*kG;eY.localCOMy+=(gl.y+fZ.y)*kG;lm=gl;gb=gb.next;var fX=gb;iu+=fZ.x*(fX.y-lm.y);var kE=fX.y*fZ.x-fX.x*fZ.y;eY.localCOMx+=(fZ.x+fX.x)*kE;eY.localCOMy+=(fZ.y+fX.y)*kE;iu=1/(3*iu);var lo=iu;eY.localCOMx*=lo;eY.localCOMy*=lo}}}if(gz.wrap_localCOM!=null){gz.wrap_localCOM.zpp_inner.x=gz.localCOMx;gz.wrap_localCOM.zpp_inner.y=gz.localCOMy}}var eW=gz.body;if(eW.zip_axis){eW.zip_axis=false;eW.axisx=Math.sin(eW.rot);eW.axisy=Math.cos(eW.rot)}gz.worldCOMx=gz.body.posx+(gz.body.axisy*gz.localCOMx-gz.body.axisx*gz.localCOMy);gz.worldCOMy=gz.body.posy+(gz.localCOMx*gz.body.axisx+gz.localCOMy*gz.body.axisy)}}var lZ=hu.polygon.area;var lc=hu.polygon.worldCOMx;var lb=hu.polygon.worldCOMy;ke.overlap=lZ;ke.centroidx=lc;ke.centroidy=lb;return true}else{if(fb){gW=true;var f9=hu.polygon.edges.head;while(f9!=null){var jp=f9.elt;var hm=1e+100;var kF=0;var f7=hw.polygon.gverts.next;while(f7!=null){var gj=f7;var jJ=jp.gnormx*gj.x+jp.gnormy*gj.y;if(jJ=jp.gprojection+P.epsilon){hR[kF]=true;gW=false}++kF;f7=f7.next}hm-=jp.gprojection;if(hm>0){fb=false;break}f9=f9.next}if(gW){var eU=hw.polygon;if(eU.zip_worldCOM){if(eU.body!=null){eU.zip_worldCOM=false;if(eU.zip_localCOM){eU.zip_localCOM=false;if(eU.type==1){var eT=eU.polygon;if(eT.lverts.next.next==null){eT.localCOMx=eT.lverts.next.x;eT.localCOMy=eT.lverts.next.y}else{if(eT.lverts.next.next.next==null){eT.localCOMx=eT.lverts.next.x;eT.localCOMy=eT.lverts.next.y;eT.localCOMx+=eT.lverts.next.next.x;eT.localCOMy+=eT.lverts.next.next.y;eT.localCOMx*=0.5;eT.localCOMy*=0.5}else{eT.localCOMx=0;eT.localCOMy=0;var lX=0;var f6=eT.lverts.next;var gM=f6;f6=f6.next;var gh=f6;f6=f6.next;while(f6!=null){var fV=f6;lX+=gh.x*(fV.y-gM.y);var kC=fV.y*gh.x-fV.x*gh.y;eT.localCOMx+=(gh.x+fV.x)*kC;eT.localCOMy+=(gh.y+fV.y)*kC;gM=gh;gh=fV;f6=f6.next}f6=eT.lverts.next;var fT=f6;lX+=gh.x*(fT.y-gM.y);var kA=fT.y*gh.x-fT.x*gh.y;eT.localCOMx+=(gh.x+fT.x)*kA;eT.localCOMy+=(gh.y+fT.y)*kA;gM=gh;f6=f6.next;var fR=f6;lX+=fT.x*(fR.y-gM.y);var ky=fR.y*fT.x-fR.x*fT.y;eT.localCOMx+=(fT.x+fR.x)*ky;eT.localCOMy+=(fT.y+fR.y)*ky;lX=1/(3*lX);var g6=lX;eT.localCOMx*=g6;eT.localCOMy*=g6}}}if(eU.wrap_localCOM!=null){eU.wrap_localCOM.zpp_inner.x=eU.localCOMx;eU.wrap_localCOM.zpp_inner.y=eU.localCOMy}}var eS=eU.body;if(eS.zip_axis){eS.zip_axis=false;eS.axisx=Math.sin(eS.rot);eS.axisy=Math.cos(eS.rot)}eU.worldCOMx=eU.body.posx+(eU.body.axisy*eU.localCOMx-eU.body.axisx*eU.localCOMy);eU.worldCOMy=eU.body.posy+(eU.localCOMx*eU.body.axisx+eU.localCOMy*eU.body.axisy)}}var lW=hw.polygon.area;var eO=hw.polygon.worldCOMx;var ee=hw.polygon.worldCOMy;ke.overlap=lW;ke.centroidx=eO;ke.centroidy=ee;return true}else{if(fb){while(b7.flowpoly.head!=null){var lv=b7.flowpoly.pop_unsafe();if(!lv._inuse){if(lv.outer!=null){lv.outer.zpp_inner=null;lv.outer=null}lv._isimmutable=null;lv._validate=null;lv._invalidate=null;lv.next=bB.zpp_pool;bB.zpp_pool=lv}}var i0=null;var jY=false;var gO=hw.polygon.gverts.next;var l3=0;var gN=hu.polygon.gverts.next;var kD=0;var kj=0;var ez=hu.polygon.edgeCnt;while(kjP.epsilon*P.epsilon){iJ=1/iJ;var j0=(g5*gm-g7*gk)*iJ;if(j0>P.epsilon&&j0<1-P.epsilon){var l5=(eK*gm-eN*gk)*iJ;if(l5>P.epsilon&&l5<1-P.epsilon){g4=j0;fH=true}else{fH=false}}else{fH=false}}else{fH=false}if(fH){if(g4P.epsilon*P.epsilon){lr=1/lr;var gw=(jx*fL-jQ*e7)*lr;if(gw>P.epsilon&&gw<1-P.epsilon){var ey=(hS*fL-ie*e7)*lr;if(ey>P.epsilon&&ey<1-P.epsilon){g3=gw;hz=true}else{hz=false}}else{hz=false}}else{hz=false}if(hz){if(g3P.epsilon*P.epsilon){lp=1/lp;var gu=(jw*fJ-jO*e6)*lp;if(gu>P.epsilon&&gu<1-P.epsilon){var ew=(hP*fJ-ib*e6)*lp;if(ew>P.epsilon&&ew<1-P.epsilon){g2=gu;hy=true}else{hy=false}}else{hy=false}}else{hy=false}if(hy){if(g2P.epsilon*P.epsilon){ln=1/ln;var gs=(jv*fG-jM*e5)*ln;if(gs>P.epsilon&&gs<1-P.epsilon){var ev=(hM*fG-h8*e5)*ln;if(ev>P.epsilon&&ev<1-P.epsilon){g1=gs;hx=true}else{hx=false}}else{hx=false}}else{hx=false}if(hx){if(g1P.epsilon*P.epsilon){ll=1/ll;var gr=(ju*fE-jK*e4)*ll;if(gr>P.epsilon&&gr<1-P.epsilon){var eu=(hK*fE-h6*e4)*ll;if(eu>P.epsilon&&eu<1-P.epsilon){g0=gr;ht=true}else{ht=false}}else{ht=false}}else{ht=false}if(ht){if(g0>=-1){kY=gN;j7=kD;e2=1;if(1==ik){ih=g0;f5=mc;break}else{ih=g0}}}gK=ge;gN=f5;++kD;if(kD>=hu.polygon.edgeCnt){kD=0}f5=f5.next;if(f5==null){f5=hu.polygon.gverts.next}break}while(f5!=mc){var gc=f5;var gZ=0;var fC=0;var e3=0;fC=gK.x-em.x;e3=gK.y-em.y;var h4=0;var hI=0;h4=gc.x-gK.x;hI=gc.y-gK.y;var jG=0;var jt=0;jG=mp.x-em.x;jt=mp.y-em.y;var lh=hI*jG-h4*jt;var hs;if(lh*lh>P.epsilon*P.epsilon){lh=1/lh;var gq=(jt*fC-jG*e3)*lh;if(gq>P.epsilon&&gq<1-P.epsilon){var et=(hI*fC-h4*e3)*lh;if(et>P.epsilon&&et<1-P.epsilon){gZ=gq;hs=true}else{hs=false}}else{hs=false}}else{hs=false}if(hs){if(gZ>=ih){kY=gN;j7=kD;if(++e2==ik){ih=gZ;break}else{ih=gZ}}}gK=gc;gN=f5;++kD;if(kD>=hu.polygon.edgeCnt){kD=0}f5=f5.next;if(f5==null){f5=hu.polygon.gverts.next}}if(kY==null){break}var gJ=kY;var lQ=kY.next;if(lQ==null){lQ=hu.polygon.gverts.next}var ga=lQ;var eG=0;var ea=0;var ja=ih;eG=gJ.x+(ga.x-gJ.x)*ja;ea=gJ.y+(ga.y-gJ.y)*ja;var hr;if(i0!=null){var hE=i0.x;var hf=i0.y;var kR=0;var kr=0;kR=eG-hE;kr=ea-hf;hr=kR*kR+kr*krP.epsilon*P.epsilon){le=1/le;var gp=(jr*fA-jE*e1)*le;if(gp>P.epsilon&&gp<1-P.epsilon){var es=(hG*fA-h2*e1)*le;if(es>P.epsilon&&es<1-P.epsilon){gV=gp;hp=true}else{hp=false}}else{hp=false}}else{hp=false}if(hp){if(gV>=-1){fc=gO;iz=l3;l9=1;if(1==ik){lN=gV;f4=la;break}else{lN=gV}}}gI=f8;gO=f4;++l3;if(l3>=hw.polygon.edgeCnt){l3=0}f4=f4.next;if(f4==null){f4=hw.polygon.gverts.next}break}while(f4!=la){var fM=f4;var gT=0;var fy=0;var e0=0;fy=gI.x-ek.x;e0=gI.y-ek.y;var h0=0;var hF=0;h0=fM.x-gI.x;hF=fM.y-gI.y;var jC=0;var jq=0;jC=mo.x-ek.x;jq=mo.y-ek.y;var ld=hF*jC-h0*jq;var mk;if(ld*ld>P.epsilon*P.epsilon){ld=1/ld;var go=(jq*fy-jC*e0)*ld;if(go>P.epsilon&&go<1-P.epsilon){var ep=(hF*fy-h0*e0)*ld;if(ep>P.epsilon&&ep<1-P.epsilon){gT=go;mk=true}else{mk=false}}else{mk=false}}else{mk=false}if(mk){if(gT>=lN){fc=gO;iz=l3;if(++l9==ik){lN=gT;break}else{lN=gT}}}gI=fM;gO=f4;++l3;if(l3>=hw.polygon.edgeCnt){l3=0}f4=f4.next;if(f4==null){f4=hw.polygon.gverts.next}}if(fc==null){break}var gH=fc;var jc=fc.next;if(jc==null){jc=hw.polygon.gverts.next}var fK=jc;var eF=0;var my=0;var i8=lN;eF=gH.x+(fK.x-gH.x)*i8;my=gH.y+(fK.y-gH.y)*i8;var mj;if(i0!=null){var hC=i0.x;var hb=i0.y;var kP=0;var kp=0;kP=eF-hC;kp=my-hb;mj=kP*kP+kp*kpej.gprojection+hw.circle.radius){gY=false;break}else{if(jn+hw.circle.radius>ej.gprojection+P.epsilon){jX=false;eZ[kB]=true}}jn-=ej.gprojection+hw.circle.radius;if(jn>lL){lL=jn;eo=ej;fq=iv}iv=iv.next;++kB;f1=f1.next}if(gY){if(jX){var lU=hw.circle.area;var eE=hw.circle.worldCOMx;var mx=hw.circle.worldCOMy;ke.overlap=lU;ke.centroidx=eE;ke.centroidy=mx;return true}else{var gn=fq;var fF=fq.next==null?hu.polygon.gverts.next:fq.next;var kW=hw.circle.worldCOMy*eo.gnormx-hw.circle.worldCOMx*eo.gnormy;var mi;if(kW<=gn.y*eo.gnormx-gn.x*eo.gnormy){var j1=hw.circle.radius;var hV=0;var hU=0;hV=gn.x-hw.circle.worldCOMx;hU=gn.y-hw.circle.worldCOMy;mi=hV*hV+hU*hU<=j1*j1}else{if(kW>=fF.y*eo.gnormx-fF.x*eo.gnormy){var kd=hw.circle.radius;var ks=0;var kc=0;ks=fF.x-hw.circle.worldCOMx;kc=fF.y-hw.circle.worldCOMy;mi=ks*ks+kc*kc<=kd*kd}else{mi=true}}if(mi){var lk=[];var kz=0;var jV=true;var li=null;var jW=0;var ei=hu.polygon.gverts.next;while(ei!=null){var fD=ei;var jl=fD.x;var iW=fD.y;var hB=hw.circle.worldCOMx;var ha=hw.circle.worldCOMy;var kN=0;var ko=0;kN=jl-hB;ko=iW-ha;if(!(lk[kz]=kN*kN+ko*ko<=hw.circle.radius*hw.circle.radius)){jV=false}else{jW=kz;li=ei}++kz;ei=ei.next}if(jV){var eR=hu.polygon;if(eR.zip_worldCOM){if(eR.body!=null){eR.zip_worldCOM=false;if(eR.zip_localCOM){eR.zip_localCOM=false;if(eR.type==1){var eQ=eR.polygon;if(eQ.lverts.next.next==null){eQ.localCOMx=eQ.lverts.next.x;eQ.localCOMy=eQ.lverts.next.y}else{if(eQ.lverts.next.next.next==null){eQ.localCOMx=eQ.lverts.next.x;eQ.localCOMy=eQ.lverts.next.y;eQ.localCOMx+=eQ.lverts.next.next.x;eQ.localCOMy+=eQ.lverts.next.next.y;eQ.localCOMx*=0.5;eQ.localCOMy*=0.5}else{eQ.localCOMx=0;eQ.localCOMy=0;var lT=0;var eh=eQ.lverts.next;var gE=eh;eh=eh.next;var fB=eh;eh=eh.next;while(eh!=null){var fN=eh;lT+=fB.x*(fN.y-gE.y);var ku=fN.y*fB.x-fN.x*fB.y;eQ.localCOMx+=(fB.x+fN.x)*ku;eQ.localCOMy+=(fB.y+fN.y)*ku;gE=fB;fB=fN;eh=eh.next}eh=eQ.lverts.next;var ly=eh;lT+=fB.x*(ly.y-gE.y);var l4=ly.y*fB.x-ly.x*fB.y;eQ.localCOMx+=(fB.x+ly.x)*l4;eQ.localCOMy+=(fB.y+ly.y)*l4;gE=fB;eh=eh.next;var lx=eh;lT+=ly.x*(lx.y-gE.y);var l2=lx.y*ly.x-lx.x*ly.y;eQ.localCOMx+=(ly.x+lx.x)*l2;eQ.localCOMy+=(ly.y+lx.y)*l2;lT=1/(3*lT);var jR=lT;eQ.localCOMx*=jR;eQ.localCOMy*=jR}}}if(eR.wrap_localCOM!=null){eR.wrap_localCOM.zpp_inner.x=eR.localCOMx;eR.wrap_localCOM.zpp_inner.y=eR.localCOMy}}var eP=eR.body;if(eP.zip_axis){eP.zip_axis=false;eP.axisx=Math.sin(eP.rot);eP.axisy=Math.cos(eP.rot)}eR.worldCOMx=eR.body.posx+(eR.body.axisy*eR.localCOMx-eR.body.axisx*eR.localCOMy);eR.worldCOMy=eR.body.posy+(eR.localCOMx*eR.body.axisx+eR.localCOMy*eR.body.axisy)}}var lR=hu.polygon.area;var eD=hu.polygon.worldCOMx;var mw=hu.polygon.worldCOMy;ke.overlap=lR;ke.centroidx=eD;ke.centroidy=mw;return true}else{while(b7.flowpoly.head!=null){var iC=b7.flowpoly.pop_unsafe();if(!iC._inuse){if(iC.outer!=null){iC.outer.zpp_inner=null;iC.outer=null}iC._isimmutable=null;iC._validate=null;iC._invalidate=null;iC.next=bB.zpp_pool;bB.zpp_pool=iC}}b7.flowsegs.clear();var iD=null;var f2=1;if(li==null){li=hu.polygon.gverts.next;f2=2}else{iD=li;b7.flowpoly.add(iD)}while(f2!=0){if(f2==1){li=li.next;if(li==null){li=hu.polygon.gverts.next}++jW;if(jW>=hu.polygon.edgeCnt){jW=0}if(lk[jW]){var jk=iD.x;var iU=iD.y;var hA=li.x;var g9=li.y;var kL=0;var kn=0;kL=jk-hA;kn=iU-g9;if(kL*kL+kn*knP.epsilon){var ig=0;var fv=0;var i5=g8;ig=il.x+(fx.x-il.x)*i5;fv=il.y+(fx.y-il.y)*i5;var mh;if(iD!=null){var je=iD.x;var iP=iD.y;var kI=0;var kg=0;kI=je-ig;kg=iP-fv;mh=kI*kI+kg*kgP.epsilon){var h7=0;var fr=0;var i2=j2;h7=il.x+(fw.x-il.x)*i2;fr=il.y+(fw.y-il.y)*i2;var mg;if(iD!=null){var eA=iD.x;var iL=iD.y;var iX=0;var he=0;iX=eA-h7;he=iL-fr;mg=iX*iX+he*helD.gprojection){mn=false;break}ef=ef.next}if(mn){var lO=hw.circle.area;var h3=hw.circle.worldCOMx;var fo=hw.circle.worldCOMy;ke.overlap=lO;ke.centroidx=h3;ke.centroidy=fo;return true}else{return false}}else{var jj=0;var iR=0;var lM=0;if(b7.flowpoly.head.next.next!=null){var jZ=0;var j4=0;var j3=0;j4=0;j3=0;jZ=0;var ed=b7.flowpoly.head;var ij=ed.elt;ed=ed.next;var fu=ed.elt;ed=ed.next;while(ed!=null){var lw=ed.elt;jZ+=fu.x*(lw.y-ij.y);var l1=lw.y*fu.x-lw.x*fu.y;j4+=(fu.x+lw.x)*l1;j3+=(fu.y+lw.y)*l1;ij=fu;fu=lw;ed=ed.next}ed=b7.flowpoly.head;var lu=ed.elt;jZ+=fu.x*(lu.y-ij.y);var l0=lu.y*fu.x-lu.x*fu.y;j4+=(fu.x+lu.x)*l0;j3+=(fu.y+lu.y)*l0;ij=fu;ed=ed.next;var ls=ed.elt;jZ+=lu.x*(ls.y-ij.y);var lY=ls.y*lu.x-ls.x*lu.y;j4+=(lu.x+ls.x)*lY;j3+=(lu.y+ls.y)*lY;jZ*=0.5;var iE=1/(6*jZ);j4*=iE;j3*=iE;var jD=-jZ;jj+=j4*jD;iR+=j3*jD;lM=0-jZ}else{b7.flowsegs.add(b7.flowpoly.head.elt);b7.flowsegs.add(b7.flowpoly.head.next.elt)}while(b7.flowsegs.head!=null){var ii=b7.flowsegs.pop_unsafe();var e8=b7.flowsegs.pop_unsafe();var iV=0;var hc=0;iV=e8.x-ii.x;hc=e8.y-ii.y;var iy=0;var iw=0;iy=iV;iw=hc;var fd=1/Math.sqrt(iy*iy+iw*iw);iy*=fd;iw*=fd;var jB=iy;iy=-iw;iw=jB;var h1=0;var fn=0;h1=ii.x+e8.x;fn=ii.y+e8.y;h1*=0.5;fn*=0.5;h1-=hw.circle.worldCOMx;fn-=hw.circle.worldCOMy;var er=iy*h1+iw*fn;var jh=0;var fe=0;var hW=er/hw.circle.radius;var iZ=Math.sqrt(1-hW*hW);var gi=Math.acos(hW);jh=hw.circle.radius*(hw.circle.radius*gi-er*iZ);fe=0.6666666666666666*hw.circle.radius*iZ*iZ*iZ/(gi-hW*iZ);h1=hw.circle.worldCOMx;fn=hw.circle.worldCOMy;var jA=fe;h1+=iy*jA;fn+=iw*jA;var jz=jh;jj+=h1*jz;iR+=fn*jz;lM+=jh}var jy=1/lM;jj*=jy;iR*=jy;ke.overlap=lM;ke.centroidx=jj;ke.centroidy=iR;return true}}}}else{return false}}}else{return false}}}else{var mf=hw.circle;var me=hu.circle;var lH=0;var lF=0;lH=me.worldCOMx-mf.worldCOMx;lF=me.worldCOMy-mf.worldCOMy;var lq=mf.radius+me.radius;var kX=lH*lH+lF*lF;if(kX>lq*lq){return false}else{if(kX=0};an.optimise=function(ei){var ep=ei.vertices;var el=ei.vertices;if(ep!=null){var ef=ep;while(true){ef.sort();ef=ef.next;if(!(ef!=el)){break}}}var ej=ei.vertices;var eg=ei.vertices;if(ej!=null){var eq=ej;while(true){var ec=eq;var ed=ec.prev;var ea=null;var ee=ec.diagonals.head;while(ee!=null){var em=ee.elt;if(!an.isinner(ee.next==null?ec.next:ee.next.elt,ec,ed)){ea=ee;ed=em;ee=ee.next;continue}var eb=true;var eh=em.prev;var eo=null;var en=em.diagonals.head;while(en!=null){var ek=en.elt;if(ek==ec){eb=an.isinner(en.next==null?em.next:en.next.elt,em,eh);break}eh=ek;eo=en;en=en.next}if(eb){ee=ec.diagonals.erase(ea);em.diagonals.erase(eo);continue}ed=em;ea=ee;ee=ee.next}eq=eq.next;if(!(eq!=eg)){break}}}};an.prototype.__class__=an;var a4=zpp_nape.geom.ZPP_ConvexRayResult=function(){this.toiDistance=0;this.next=null;this.inner=false;this.ray=null;this.position=null;this.convex=null;this.shape=null;this.normal=null};a4.__name__=["zpp_nape","geom","ZPP_ConvexRayResult"];a4.getRay=function(ef,ee,eb,ea){var ed;if(a4.rayPool==null){a4.internal=true;ed=new df();ed.zpp_inner=new a4();ed.zpp_inner.ray=ed;a4.internal=false}else{ed=a4.rayPool.ray;a4.rayPool=a4.rayPool.next;ed.zpp_inner.next=null}var ec=ed.zpp_inner;ec.normal=ef;ef.zpp_inner._immutable=true;ec.toiDistance=ee;ec.inner=eb;ec.shape=ea;return ed};a4.getConvex=function(ef,ea,ee,ec){var ed;if(a4.convexPool==null){a4.internal=true;ed=new bJ();ed.zpp_inner=new a4();ed.zpp_inner.convex=ed;a4.internal=false}else{ed=a4.convexPool.convex;a4.convexPool=a4.convexPool.next;ed.zpp_inner.next=null}var eb=ed.zpp_inner;eb.normal=ef;eb.position=ea;ef.zpp_inner._immutable=true;ea.zpp_inner._immutable=true;eb.toiDistance=ee;eb.shape=ec;return ed};a4.prototype.normal=null;a4.prototype.shape=null;a4.prototype.convex=null;a4.prototype.position=null;a4.prototype.ray=null;a4.prototype.inner=null;a4.prototype.next=null;a4.prototype.toiDistance=null;a4.prototype.disposed=function(){};a4.prototype.free=function(){this.normal.zpp_inner._immutable=false;var ed=this.normal;var eb=ed.zpp_inner;ed.zpp_inner.outer=null;ed.zpp_inner=null;ed.zpp_pool=au.poolVec2;au.poolVec2=ed;if(eb.outer!=null){eb.outer.zpp_inner=null;eb.outer=null}eb._isimmutable=null;eb._validate=null;eb._invalidate=null;eb.next=bB.zpp_pool;bB.zpp_pool=eb;if(this.position!=null){this.position.zpp_inner._immutable=false;var ec=this.position;var ea=ec.zpp_inner;ec.zpp_inner.outer=null;ec.zpp_inner=null;ec.zpp_pool=au.poolVec2;au.poolVec2=ec;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea}this.shape=null;this.toiDistance=0;if(this.convex!=null){this.next=a4.convexPool;a4.convexPool=this}else{this.next=a4.rayPool;a4.rayPool=this}};a4.prototype.__class__=a4;var E=zpp_nape.geom.ZPP_CutVert=function(){this.used=false;this.rank=0;this.parent=null;this.positive=false;this.value=0;this.vert=null;this.posy=0;this.posx=0;this.next=null;this.prev=null};E.__name__=["zpp_nape","geom","ZPP_CutVert"];E.path=function(eb){var ea;if(E.zpp_pool==null){ea=new E()}else{ea=E.zpp_pool;E.zpp_pool=ea.next;ea.next=null}ea.vert=eb;ea.parent=ea;ea.rank=0;ea.used=false;return ea};E.prototype.prev=null;E.prototype.next=null;E.prototype.posx=null;E.prototype.posy=null;E.prototype.vert=null;E.prototype.value=null;E.prototype.positive=null;E.prototype.parent=null;E.prototype.rank=null;E.prototype.used=null;E.prototype.alloc=function(){};E.prototype.free=function(){this.vert=null;this.parent=null};E.prototype.__class__=E;var c3=zpp_nape.geom.ZPP_CutInt=function(){this.path1=null;this.start=null;this.end=null;this.path0=null;this.vertex=false;this.virtualint=false;this.time=0;this.next=null};c3.__name__=["zpp_nape","geom","ZPP_CutInt"];c3.get=function(ee,ea,eh,eg,ef,ec,ed){if(ed==null){ed=false}if(ec==null){ec=false}var eb;if(c3.zpp_pool==null){eb=new c3()}else{eb=c3.zpp_pool;c3.zpp_pool=eb.next;eb.next=null}eb.virtualint=ec;eb.end=ea;eb.start=eh;eb.path0=eg;eb.path1=ef;eb.time=ee;eb.vertex=ed;return eb};c3.prototype.next=null;c3.prototype.time=null;c3.prototype.virtualint=null;c3.prototype.vertex=null;c3.prototype.path0=null;c3.prototype.end=null;c3.prototype.start=null;c3.prototype.path1=null;c3.prototype.alloc=function(){};c3.prototype.free=function(){this.end=this.start=null;this.path0=this.path1=null};c3.prototype.__class__=c3;var az=zpp_nape.geom.ZPP_Cutter=function(){};az.__name__=["zpp_nape","geom","ZPP_Cutter"];az.run=function(g9,eX,h0,eh,f9,hR){var f7=0;var f6=0;var f5=eX.zpp_inner;if(f5._validate!=null){f5._validate()}f7=eX.zpp_inner.x;var fn=eX.zpp_inner;if(fn._validate!=null){fn._validate()}f6=eX.zpp_inner.y;var f4=0;var f3=0;var fm=h0.zpp_inner;if(fm._validate!=null){fm._validate()}f4=h0.zpp_inner.x-f7;var fl=h0.zpp_inner;if(fl._validate!=null){fl._validate()}f3=h0.zpp_inner.y-f6;var gl=eh?0:-Infinity;var e1=f9?1:Infinity;var el=-(f6*f4-f7*f3);var hM=null;var gt=false;var gi=g9;while(true){var gy;if(E.zpp_pool==null){gy=new E()}else{gy=E.zpp_pool;E.zpp_pool=gy.next;gy.next=null}gy.vert=gi;gy.posx=gy.vert.x;gy.posy=gy.vert.y;gy.value=gy.posy*f4-gy.posx*f3+el;gy.positive=gy.value>0;if(gy.value==0){gt=true}var eY=gy;if(hM==null){hM=eY.prev=eY.next=eY}else{eY.prev=hM;eY.next=hM.next;hM.next.prev=eY;hM.next=eY}hM=eY;gi=gi.next;if(!(gi!=g9)){break}}if(gt){var hb=null;var ho=hM;var hf=hM;if(ho!=null){var gs=ho;while(true){var hi=gs;if(hi.value!=0){hb=hi;break}gs=gs.next;if(!(gs!=hf)){break}}}var g7=0;var g6=0;g7=f4;g6=f3;var eB=1/Math.sqrt(g7*g7+g6*g6);g7*=eB;g6*=eB;var ge=g7;g7=-g6;g6=ge;var fI=null;var hh=hb;while(true){if(hh.value!=0&&(fI==null||hh==fI.next)){fI=hh;hh=hh.next;if(!(hh!=hb)){break}else{continue}}var hX=fI.value*hh.value;if(hX==0){hh=hh.next;if(!(hh!=hb)){break}else{continue}}var gF=fI.next;var em;if(hX>0){em=fI.positive}else{var gB=gF.next;var gU=0;var gP=0;gU=gF.posx+gB.posx;gP=gF.posy+gB.posy;gU*=0.5;gP*=0.5;var gd=gU+g7*1e-8;var gc=gP+g6*1e-8;var fG=false;if(g9!=null){var e7=g9;while(true){var hg=e7;var gh=hg.prev;if((hg.y=gc||gh.y=gc)&&(hg.x<=gd||gh.x<=gd)){if(hg.x+(gc-hg.y)/(gh.y-hg.y)*(gh.x-hg.x)0){ef=fI.positive}else{var hQ=eb.next;var eW=0;var eI=0;eW=eb.posx+hQ.posx;eI=eb.posy+hQ.posy;eW*=0.5;eI*=0.5;var eH=eW+g7*1e-8;var et=eI+g6*1e-8;var g2=false;if(g9!=null){var e4=g9;while(true){var he=e4;var gr=he.prev;if((he.y=et||gr.y=et)&&(he.x<=eH||gr.x<=eH)){if(he.x+(et-he.y)/(gr.y-he.y)*(gr.x-he.x)e1){var gT;if(c3.zpp_pool==null){gT=new c3()}else{gT=c3.zpp_pool;c3.zpp_pool=gT.next;gT.next=null}gT.virtualint=true;gT.end=null;gT.start=null;gT.path0=null;gT.path1=null;gT.time=gg;gT.vertex=false;az.ints.add(gT);if(fi==null){fi=gb.prev=gb.next=gb}else{gb.next=fi;gb.prev=fi.prev;fi.prev.next=gb;fi.prev=gb}}else{if(gq.value==0){var eJ=fi.prev;fi=null;var eE=eJ.x;var eo=eJ.y;var gO;if(dr.zpp_pool==null){gO=new dr()}else{gO=dr.zpp_pool;dr.zpp_pool=gO.next;gO.next=null}gO.forced=false;gO.x=eE;gO.y=eo;var fE=gO;if(fi==null){fi=fE.prev=fE.next=fE}else{fE.next=fi;fE.prev=fi.prev;fi.prev.next=fE;fi.prev=fE}if(fi==null){fi=gb.prev=gb.next=gb}else{gb.next=fi;gb.prev=fi.prev;fi.prev.next=gb;fi.prev=gb}var f8=az.paths.head.elt;var gJ;if(E.zpp_pool==null){gJ=new E()}else{gJ=E.zpp_pool;E.zpp_pool=gJ.next;gJ.next=null}gJ.vert=fi;gJ.parent=gJ;gJ.rank=0;gJ.used=false;az.paths.add(gJ);var e0=az.paths.head.elt;var gE;if(c3.zpp_pool==null){gE=new c3()}else{gE=c3.zpp_pool;c3.zpp_pool=gE.next;gE.next=null}gE.virtualint=true;gE.end=eJ;gE.start=fi;gE.path0=f8;gE.path1=e0;gE.time=gg;gE.vertex=false;az.ints.add(gE)}else{if(go.value==0){if(fi==null){fi=gb.prev=gb.next=gb}else{gb.next=fi;gb.prev=fi.prev;fi.prev.next=gb;fi.prev=gb}var g5=fi.prev;fi=null;var eD=go.posx;var en=go.posy;var gA;if(dr.zpp_pool==null){gA=new dr()}else{gA=dr.zpp_pool;dr.zpp_pool=gA.next;gA.next=null}gA.forced=false;gA.x=eD;gA.y=en;var fC=gA;if(fi==null){fi=fC.prev=fC.next=fC}else{fC.next=fi;fC.prev=fi.prev;fi.prev.next=fC;fi.prev=fC}var hV=az.paths.head.elt;var f2;if(E.zpp_pool==null){f2=new E()}else{f2=E.zpp_pool;E.zpp_pool=f2.next;f2.next=null}f2.vert=fi;f2.parent=f2;f2.rank=0;f2.used=false;az.paths.add(f2);var ek=az.paths.head.elt;var f1;if(c3.zpp_pool==null){f1=new c3()}else{f1=c3.zpp_pool;c3.zpp_pool=f1.next;f1.next=null}f1.virtualint=true;f1.end=g5;f1.start=fi;f1.path0=hV;f1.path1=ek;f1.time=gg;f1.vertex=false;az.ints.add(f1)}else{var fH=(f3*hl-f4*hj)*fo;var fL=0;var fJ=0;fL=gq.posx;fJ=gq.posy;fL+=eR*fH;fJ+=eP*fH;var f0;if(dr.zpp_pool==null){f0=new dr()}else{f0=dr.zpp_pool;dr.zpp_pool=f0.next;f0.next=null}f0.forced=false;f0.x=fL;f0.y=fJ;var fy=f0;if(fi==null){fi=fy.prev=fy.next=fy}else{fy.next=fi;fy.prev=fi.prev;fi.prev.next=fy;fi.prev=fy}var g4=fi.prev;fi=null;var fY;if(dr.zpp_pool==null){fY=new dr()}else{fY=dr.zpp_pool;dr.zpp_pool=fY.next;fY.next=null}fY.forced=false;fY.x=fL;fY.y=fJ;var fw=fY;if(fi==null){fi=fw.prev=fw.next=fw}else{fw.next=fi;fw.prev=fi.prev;fi.prev.next=fw;fi.prev=fw}if(fi==null){fi=gb.prev=gb.next=gb}else{gb.next=fi;gb.prev=fi.prev;fi.prev.next=gb;fi.prev=gb}var hU=az.paths.head.elt;var fX;if(E.zpp_pool==null){fX=new E()}else{fX=E.zpp_pool;E.zpp_pool=fX.next;fX.next=null}fX.vert=fi;fX.parent=fX;fX.rank=0;fX.used=false;az.paths.add(fX);var ej=az.paths.head.elt;var fW;if(c3.zpp_pool==null){fW=new c3()}else{fW=c3.zpp_pool;c3.zpp_pool=fW.next;fW.next=null}fW.virtualint=false;fW.end=g4;fW.start=fi;fW.path0=hU;fW.path1=ej;fW.time=gg;fW.vertex=false;az.ints.add(fW)}}}}gq=gq.next;if(!(gq!=hM)){break}}var g3=fi.prev;g3.next.prev=hY.prev;hY.prev.next=g3.next;g3.next=hY;hY.prev=g3;var fs=az.paths.head.elt;var hZ;if(e2==e2.parent){hZ=e2}else{var fv=e2;var ed=null;while(fv!=fv.parent){var hW=fv.parent;fv.parent=ed;ed=fv;fv=hW}while(ed!=null){var eV=ed.parent;ed.parent=fv;ed=eV}hZ=fv}var hP;if(fs==fs.parent){hP=fs}else{var fu=fs;var gW=null;while(fu!=fu.parent){var eU=fu.parent;fu.parent=gW;gW=fu;fu=eU}while(gW!=null){var eT=gW.parent;gW.parent=fu;gW=eT}hP=fu}if(hZ!=hP){if(hZ.rankhP.rank){hP.parent=hZ}else{hP.parent=hZ;hZ.rank++}}}var fq=az.ints;if(fq.head!=null&&fq.head.next!=null){var ea=fq.head;var hT=null;var fp=null;var fB=null;var eS=null;var fz=1;var gv;var eL;var hz;while(true){gv=0;fp=ea;ea=null;hT=ea;while(fp!=null){++gv;fB=fp;eL=0;hz=fz;while(fB!=null&&eL0||hz>0&&fB!=null){if(eL==0){eS=fB;fB=fB.next;--hz}else{if(hz==0||fB==null){eS=fp;fp=fp.next;--eL}else{if(fp.elt.time1)){break}}fq.head=ea;fq.modified=true;fq.pushmod=true}while(az.ints.head!=null){var e8=az.ints.pop_unsafe();var eZ=az.ints.pop_unsafe();if(!e8.virtualint&&!eZ.virtualint){e8.end.next.prev=eZ.start.prev;eZ.start.prev.next=e8.end.next;e8.end.next=eZ.start;eZ.start.prev=e8.end;eZ.end.next.prev=e8.start.prev;e8.start.prev.next=eZ.end.next;eZ.end.next=e8.start;e8.start.prev=eZ.end;var fO;if(e8.path0==e8.path0.parent){fO=e8.path0}else{var ft=e8.path0;var gS=null;while(ft!=ft.parent){var eQ=ft.parent;ft.parent=gS;gS=ft;ft=eQ}while(gS!=null){var eO=gS.parent;gS.parent=ft;gS=eO}fO=ft}var ei;if(eZ.path1==eZ.path1.parent){ei=eZ.path1}else{var fr=eZ.path1;var gN=null;while(fr!=fr.parent){var eN=fr.parent;fr.parent=gN;gN=fr;fr=eN}while(gN!=null){var eM=gN.parent;gN.parent=fr;gN=eM}ei=fr}if(fO!=ei){if(fO.rankei.rank){ei.parent=fO}else{ei.parent=fO;fO.rank++}}}var fN;if(e8.path1==e8.path1.parent){fN=e8.path1}else{var hJ=e8.path1;var gI=null;while(hJ!=hJ.parent){var eK=hJ.parent;hJ.parent=gI;gI=hJ;hJ=eK}while(gI!=null){var hw=gI.parent;gI.parent=hJ;gI=hw}fN=hJ}var eg;if(eZ.path0==eZ.path0.parent){eg=eZ.path0}else{var hH=eZ.path0;var gD=null;while(hH!=hH.parent){var hv=hH.parent;hH.parent=gD;gD=hH;hH=hv}while(gD!=null){var hu=gD.parent;gD.parent=hH;gD=hu}eg=hH}if(fN!=eg){if(fN.rankeg.rank){eg.parent=fN}else{eg.parent=fN;fN.rank++}}}}else{if(e8.virtualint&&!eZ.virtualint){var hs;if(eZ.end!=null&&eZ.end.prev==eZ.end){eZ.end.next=eZ.end.prev=null;var gj=eZ.end;if(gj.wrap!=null){gj.wrap.zpp_inner._inuse=false;var fk=gj.wrap;var gM=fk.zpp_inner;fk.zpp_inner.outer=null;fk.zpp_inner=null;fk.zpp_pool=au.poolVec2;au.poolVec2=fk;if(gM.outer!=null){gM.outer.zpp_inner=null;gM.outer=null}gM._isimmutable=null;gM._validate=null;gM._invalidate=null;gM.next=bB.zpp_pool;bB.zpp_pool=gM;gj.wrap=null}gj.prev=gj.next=null;gj.next=dr.zpp_pool;dr.zpp_pool=gj;hs=null}else{var fZ=eZ.end.prev;eZ.end.prev.next=eZ.end.next;eZ.end.next.prev=eZ.end.prev;eZ.end.next=eZ.end.prev=null;var hO=eZ.end;if(hO.wrap!=null){hO.wrap.zpp_inner._inuse=false;var fh=hO.wrap;var eA=fh.zpp_inner;fh.zpp_inner.outer=null;fh.zpp_inner=null;fh.zpp_pool=au.poolVec2;au.poolVec2=fh;if(eA.outer!=null){eA.outer.zpp_inner=null;eA.outer=null}eA._isimmutable=null;eA._validate=null;eA._invalidate=null;eA.next=bB.zpp_pool;bB.zpp_pool=eA;hO.wrap=null}hO.prev=hO.next=null;hO.next=dr.zpp_pool;dr.zpp_pool=hO;eZ.end=null;hs=fZ}eZ.end=hs;if(!eZ.vertex){if(eZ.end!=eZ.path0.vert){eZ.start.x=eZ.end.x;eZ.start.y=eZ.end.y;var fD;if(eZ.end!=null&&eZ.end.prev==eZ.end){eZ.end.next=eZ.end.prev=null;var hN=eZ.end;if(hN.wrap!=null){hN.wrap.zpp_inner._inuse=false;var ff=hN.wrap;var ez=ff.zpp_inner;ff.zpp_inner.outer=null;ff.zpp_inner=null;ff.zpp_pool=au.poolVec2;au.poolVec2=ff;if(ez.outer!=null){ez.outer.zpp_inner=null;ez.outer=null}ez._isimmutable=null;ez._validate=null;ez._invalidate=null;ez.next=bB.zpp_pool;bB.zpp_pool=ez;hN.wrap=null}hN.prev=hN.next=null;hN.next=dr.zpp_pool;dr.zpp_pool=hN;fD=null}else{var g0=eZ.end.prev;eZ.end.prev.next=eZ.end.next;eZ.end.next.prev=eZ.end.prev;eZ.end.next=eZ.end.prev=null;var hL=eZ.end;if(hL.wrap!=null){hL.wrap.zpp_inner._inuse=false;var fc=hL.wrap;var ey=fc.zpp_inner;fc.zpp_inner.outer=null;fc.zpp_inner=null;fc.zpp_pool=au.poolVec2;au.poolVec2=fc;if(ey.outer!=null){ey.outer.zpp_inner=null;ey.outer=null}ey._isimmutable=null;ey._validate=null;ey._invalidate=null;ey.next=bB.zpp_pool;bB.zpp_pool=ey;hL.wrap=null}hL.prev=hL.next=null;hL.next=dr.zpp_pool;dr.zpp_pool=hL;eZ.end=null;fD=g0}eZ.end=fD}else{var gk=eZ.start.next;eZ.start.x=gk.x;eZ.start.y=gk.y;if(gk!=null&&gk.prev==gk){gk.next=gk.prev=null;var hK=gk;if(hK.wrap!=null){hK.wrap.zpp_inner._inuse=false;var fa=hK.wrap;var ex=fa.zpp_inner;fa.zpp_inner.outer=null;fa.zpp_inner=null;fa.zpp_pool=au.poolVec2;au.poolVec2=fa;if(ex.outer!=null){ex.outer.zpp_inner=null;ex.outer=null}ex._isimmutable=null;ex._validate=null;ex._invalidate=null;ex.next=bB.zpp_pool;bB.zpp_pool=ex;hK.wrap=null}hK.prev=hK.next=null;hK.next=dr.zpp_pool;dr.zpp_pool=hK;gk=null}else{gk.prev.next=gk.next;gk.next.prev=gk.prev;gk.next=gk.prev=null;var hI=gk;if(hI.wrap!=null){hI.wrap.zpp_inner._inuse=false;var e9=hI.wrap;var ew=e9.zpp_inner;e9.zpp_inner.outer=null;e9.zpp_inner=null;e9.zpp_pool=au.poolVec2;au.poolVec2=e9;if(ew.outer!=null){ew.outer.zpp_inner=null;ew.outer=null}ew._isimmutable=null;ew._validate=null;ew._invalidate=null;ew.next=bB.zpp_pool;bB.zpp_pool=ew;hI.wrap=null}hI.prev=hI.next=null;hI.next=dr.zpp_pool;dr.zpp_pool=hI}}}eZ.end.next.prev=eZ.start.prev;eZ.start.prev.next=eZ.end.next;eZ.end.next=eZ.start;eZ.start.prev=eZ.end;var fM;if(eZ.path0==eZ.path0.parent){fM=eZ.path0}else{var hF=eZ.path0;var gz=null;while(hF!=hF.parent){var ht=hF.parent;hF.parent=gz;gz=hF;hF=ht}while(gz!=null){var hr=gz.parent;gz.parent=hF;gz=hr}fM=hF}var ee;if(eZ.path1==eZ.path1.parent){ee=eZ.path1}else{var hD=eZ.path1;var gx=null;while(hD!=hD.parent){var hq=hD.parent;hD.parent=gx;gx=hD;hD=hq}while(gx!=null){var hp=gx.parent;gx.parent=hD;gx=hp}ee=hD}if(fM!=ee){if(fM.rankee.rank){ee.parent=fM}else{ee.parent=fM;fM.rank++}}}}else{if(eZ.virtualint&&!e8.virtualint){var fA;if(e8.end!=null&&e8.end.prev==e8.end){e8.end.next=e8.end.prev=null;var hG=e8.end;if(hG.wrap!=null){hG.wrap.zpp_inner._inuse=false;var fU=hG.wrap;var ev=fU.zpp_inner;fU.zpp_inner.outer=null;fU.zpp_inner=null;fU.zpp_pool=au.poolVec2;au.poolVec2=fU;if(ev.outer!=null){ev.outer.zpp_inner=null;ev.outer=null}ev._isimmutable=null;ev._validate=null;ev._invalidate=null;ev.next=bB.zpp_pool;bB.zpp_pool=ev;hG.wrap=null}hG.prev=hG.next=null;hG.next=dr.zpp_pool;dr.zpp_pool=hG;fA=null}else{var gY=e8.end.prev;e8.end.prev.next=e8.end.next;e8.end.next.prev=e8.end.prev;e8.end.next=e8.end.prev=null;var hE=e8.end;if(hE.wrap!=null){hE.wrap.zpp_inner._inuse=false;var fT=hE.wrap;var eu=fT.zpp_inner;fT.zpp_inner.outer=null;fT.zpp_inner=null;fT.zpp_pool=au.poolVec2;au.poolVec2=fT;if(eu.outer!=null){eu.outer.zpp_inner=null;eu.outer=null}eu._isimmutable=null;eu._validate=null;eu._invalidate=null;eu.next=bB.zpp_pool;bB.zpp_pool=eu;hE.wrap=null}hE.prev=hE.next=null;hE.next=dr.zpp_pool;dr.zpp_pool=hE;e8.end=null;fA=gY}e8.end=fA;if(!e8.vertex){if(e8.end!=e8.path0.vert){e8.start.x=e8.end.x;e8.start.y=e8.end.y;var fx;if(e8.end!=null&&e8.end.prev==e8.end){e8.end.next=e8.end.prev=null;var hC=e8.end;if(hC.wrap!=null){hC.wrap.zpp_inner._inuse=false;var fS=hC.wrap;var es=fS.zpp_inner;fS.zpp_inner.outer=null;fS.zpp_inner=null;fS.zpp_pool=au.poolVec2;au.poolVec2=fS;if(es.outer!=null){es.outer.zpp_inner=null;es.outer=null}es._isimmutable=null;es._validate=null;es._invalidate=null;es.next=bB.zpp_pool;bB.zpp_pool=es;hC.wrap=null}hC.prev=hC.next=null;hC.next=dr.zpp_pool;dr.zpp_pool=hC;fx=null}else{var gV=e8.end.prev;e8.end.prev.next=e8.end.next;e8.end.next.prev=e8.end.prev;e8.end.next=e8.end.prev=null;var hB=e8.end;if(hB.wrap!=null){hB.wrap.zpp_inner._inuse=false;var fR=hB.wrap;var eq=fR.zpp_inner;fR.zpp_inner.outer=null;fR.zpp_inner=null;fR.zpp_pool=au.poolVec2;au.poolVec2=fR;if(eq.outer!=null){eq.outer.zpp_inner=null;eq.outer=null}eq._isimmutable=null;eq._validate=null;eq._invalidate=null;eq.next=bB.zpp_pool;bB.zpp_pool=eq;hB.wrap=null}hB.prev=hB.next=null;hB.next=dr.zpp_pool;dr.zpp_pool=hB;e8.end=null;fx=gV}e8.end=fx}else{var hS=e8.start.next;e8.start.x=hS.x;e8.start.y=hS.y;if(hS!=null&&hS.prev==hS){hS.next=hS.prev=null;var fj=hS;if(fj.wrap!=null){fj.wrap.zpp_inner._inuse=false;var fQ=fj.wrap;var gH=fQ.zpp_inner;fQ.zpp_inner.outer=null;fQ.zpp_inner=null;fQ.zpp_pool=au.poolVec2;au.poolVec2=fQ;if(gH.outer!=null){gH.outer.zpp_inner=null;gH.outer=null}gH._isimmutable=null;gH._validate=null;gH._invalidate=null;gH.next=bB.zpp_pool;bB.zpp_pool=gH;fj.wrap=null}fj.prev=fj.next=null;fj.next=dr.zpp_pool;dr.zpp_pool=fj;hS=null}else{hS.prev.next=hS.next;hS.next.prev=hS.prev;hS.next=hS.prev=null;var fg=hS;if(fg.wrap!=null){fg.wrap.zpp_inner._inuse=false;var fP=fg.wrap;var gC=fP.zpp_inner;fP.zpp_inner.outer=null;fP.zpp_inner=null;fP.zpp_pool=au.poolVec2;au.poolVec2=fP;if(gC.outer!=null){gC.outer.zpp_inner=null;gC.outer=null}gC._isimmutable=null;gC._validate=null;gC._invalidate=null;gC.next=bB.zpp_pool;bB.zpp_pool=gC;fg.wrap=null}fg.prev=fg.next=null;fg.next=dr.zpp_pool;dr.zpp_pool=fg}}}e8.end.next.prev=e8.start.prev;e8.start.prev.next=e8.end.next;e8.end.next=e8.start;e8.start.prev=e8.end;var fK;if(e8.path0==e8.path0.parent){fK=e8.path0}else{var hA=e8.path0;var gw=null;while(hA!=hA.parent){var hn=hA.parent;hA.parent=gw;gw=hA;hA=hn}while(gw!=null){var hm=gw.parent;gw.parent=hA;gw=hm}fK=hA}var ec;if(e8.path1==e8.path1.parent){ec=e8.path1}else{var hy=e8.path1;var gu=null;while(hy!=hy.parent){var hk=hy.parent;hy.parent=gu;gu=hy;hy=hk}while(gu!=null){var gR=gu.parent;gu.parent=hy;gu=gR}ec=hy}if(fK!=ec){if(fK.rankec.rank){ec.parent=fK}else{ec.parent=fK;fK.rank++}}}}}}e8.end=e8.start=null;e8.path0=e8.path1=null;e8.next=c3.zpp_pool;c3.zpp_pool=e8;eZ.end=eZ.start=null;eZ.path0=eZ.path1=null;eZ.next=c3.zpp_pool;c3.zpp_pool=eZ}var fV=hR==null?new u():hR;var eC=az.paths.head;while(eC!=null){var hd=eC.elt;var gf;if(hd==hd.parent){gf=hd}else{var hx=hd;var hc=null;while(hx!=hx.parent){var gL=hx.parent;hx.parent=hc;hc=hx;hx=gL}while(hc!=null){var gG=hc.parent;hc.parent=hx;hc=gG}gf=hx}if(gf.used){eC=eC.next;continue}gf.used=true;var ha=gf.vert;var ga=true;while(gf.vert!=null&&(ga||ha!=gf.vert)){ga=false;if(ha.x==ha.next.x&&ha.y==ha.next.y){if(ha==gf.vert){gf.vert=ha.next==ha?null:ha.next;ga=true}if(ha!=null&&ha.prev==ha){ha.next=ha.prev=null;ha=null;ha=ha}else{var gQ=ha.next;ha.prev.next=ha.next;ha.next.prev=ha.prev;ha.next=ha.prev=null;ha=null;ha=gQ}}else{ha=ha.next}}if(gf.vert!=null){var e5=a7.get();e5.zpp_inner.vertices=gf.vert;if(fV.zpp_inner.reverse_flag){fV.push(e5)}else{fV.unshift(e5)}}eC=eC.next}while(az.paths.head!=null){var g8=az.paths.pop_unsafe();g8.vert=null;g8.parent=null;g8.next=E.zpp_pool;E.zpp_pool=g8}while(hM!=null){if(hM!=null&&hM.prev==hM){hM.next=hM.prev=null;var fe=hM;fe.vert=null;fe.parent=null;fe.next=E.zpp_pool;E.zpp_pool=fe;hM=null;hM=hM}else{var gK=hM.next;hM.prev.next=hM.next;hM.next.prev=hM.prev;hM.next=hM.prev=null;var fb=hM;fb.vert=null;fb.parent=null;fb.next=E.zpp_pool;E.zpp_pool=fb;hM=null;hM=gK}}return fV};az.prototype.__class__=az;var bM=zpp_nape.geom.ZPP_Geom=function(){};bM.__name__=["zpp_nape","geom","ZPP_Geom"];bM.validateShape=function(eQ){if(eQ.type==1){var ea=eQ.polygon;if(ea.zip_gaxi){if(ea.body!=null){ea.zip_gaxi=false;ea.validate_laxi();var eO=ea.body;if(eO.zip_axis){eO.zip_axis=false;eO.axisx=Math.sin(eO.rot);eO.axisy=Math.cos(eO.rot)}if(ea.zip_gverts){if(ea.body!=null){ea.zip_gverts=false;ea.validate_lverts();var eM=ea.body;if(eM.zip_axis){eM.zip_axis=false;eM.axisx=Math.sin(eM.rot);eM.axisy=Math.cos(eM.rot)}var ev=ea.lverts.next;var eb=ea.gverts.next;while(eb!=null){var eU=eb;var eS=ev;ev=ev.next;eU.x=ea.body.posx+(ea.body.axisy*eS.x-ea.body.axisx*eS.y);eU.y=ea.body.posy+(eS.x*ea.body.axisx+eS.y*ea.body.axisy);eb=eb.next}}}var eV=ea.edges.head;var ej=ea.gverts.next;var eN=ej;ej=ej.next;while(ej!=null){var eL=ej;var eW=eV.elt;eV=eV.next;eW.gp0=eN;eW.gp1=eL;eW.gnormx=ea.body.axisy*eW.lnormx-ea.body.axisx*eW.lnormy;eW.gnormy=eW.lnormx*ea.body.axisx+eW.lnormy*ea.body.axisy;eW.gprojection=ea.body.posx*eW.gnormx+ea.body.posy*eW.gnormy+eW.lprojection;if(eW.wrap_gnorm!=null){eW.wrap_gnorm.zpp_inner.x=eW.gnormx;eW.wrap_gnorm.zpp_inner.y=eW.gnormy}eW.tp0=eW.gp0.y*eW.gnormx-eW.gp0.x*eW.gnormy;eW.tp1=eW.gp1.y*eW.gnormx-eW.gp1.x*eW.gnormy;eN=eL;ej=ej.next}var el=eV.elt;el.gp0=eN;el.gp1=ea.gverts.next;el.gnormx=ea.body.axisy*el.lnormx-ea.body.axisx*el.lnormy;el.gnormy=el.lnormx*ea.body.axisx+el.lnormy*ea.body.axisy;el.gprojection=ea.body.posx*el.gnormx+ea.body.posy*el.gnormy+el.lprojection;if(el.wrap_gnorm!=null){el.wrap_gnorm.zpp_inner.x=el.gnormx;el.wrap_gnorm.zpp_inner.y=el.gnormy}el.tp0=el.gp0.y*el.gnormx-el.gp0.x*el.gnormy;el.tp1=el.gp1.y*el.gnormx-el.gp1.x*el.gnormy}}}if(eQ.zip_aabb){if(eQ.body!=null){eQ.zip_aabb=false;if(eQ.type==0){var eK=eQ.circle;if(eK.zip_worldCOM){if(eK.body!=null){eK.zip_worldCOM=false;if(eK.zip_localCOM){eK.zip_localCOM=false;if(eK.type==1){var eI=eK.polygon;if(eI.lverts.next.next==null){eI.localCOMx=eI.lverts.next.x;eI.localCOMy=eI.lverts.next.y}else{if(eI.lverts.next.next.next==null){eI.localCOMx=eI.lverts.next.x;eI.localCOMy=eI.lverts.next.y;eI.localCOMx+=eI.lverts.next.next.x;eI.localCOMy+=eI.lverts.next.next.y;eI.localCOMx*=0.5;eI.localCOMy*=0.5}else{eI.localCOMx=0;eI.localCOMy=0;var et=0;var ei=eI.lverts.next;var ee=ei;ei=ei.next;var eZ=ei;ei=ei.next;while(ei!=null){var eJ=ei;et+=eZ.x*(eJ.y-ee.y);var eq=eJ.y*eZ.x-eJ.x*eZ.y;eI.localCOMx+=(eZ.x+eJ.x)*eq;eI.localCOMy+=(eZ.y+eJ.y)*eq;ee=eZ;eZ=eJ;ei=ei.next}ei=eI.lverts.next;var ew=ei;et+=eZ.x*(ew.y-ee.y);var eH=ew.y*eZ.x-ew.x*eZ.y;eI.localCOMx+=(eZ.x+ew.x)*eH;eI.localCOMy+=(eZ.y+ew.y)*eH;ee=eZ;ei=ei.next;var eu=ei;et+=ew.x*(eu.y-ee.y);var eF=eu.y*ew.x-eu.x*ew.y;eI.localCOMx+=(ew.x+eu.x)*eF;eI.localCOMy+=(ew.y+eu.y)*eF;et=1/(3*et);var eP=et;eI.localCOMx*=eP;eI.localCOMy*=eP}}}if(eK.wrap_localCOM!=null){eK.wrap_localCOM.zpp_inner.x=eK.localCOMx;eK.wrap_localCOM.zpp_inner.y=eK.localCOMy}}var eG=eK.body;if(eG.zip_axis){eG.zip_axis=false;eG.axisx=Math.sin(eG.rot);eG.axisy=Math.cos(eG.rot)}eK.worldCOMx=eK.body.posx+(eK.body.axisy*eK.localCOMx-eK.body.axisx*eK.localCOMy);eK.worldCOMy=eK.body.posy+(eK.localCOMx*eK.body.axisx+eK.localCOMy*eK.body.axisy)}}var en=eK.radius;var em=eK.radius;eK.aabb.minx=eK.worldCOMx-en;eK.aabb.miny=eK.worldCOMy-em;eK.aabb.maxx=eK.worldCOMx+en;eK.aabb.maxy=eK.worldCOMy+em}else{var eE=eQ.polygon;if(eE.zip_gverts){if(eE.body!=null){eE.zip_gverts=false;eE.validate_lverts();var eC=eE.body;if(eC.zip_axis){eC.zip_axis=false;eC.axisx=Math.sin(eC.rot);eC.axisy=Math.cos(eC.rot)}var eD=eE.lverts.next;var eh=eE.gverts.next;while(eh!=null){var eT=eh;var ec=eD;eD=eD.next;eT.x=eE.body.posx+(eE.body.axisy*ec.x-eE.body.axisx*ec.y);eT.y=eE.body.posy+(ec.x*eE.body.axisx+ec.y*eE.body.axisy);eh=eh.next}}}var eX=eE.gverts.next;eE.aabb.minx=eX.x;eE.aabb.miny=eX.y;eE.aabb.maxx=eX.x;eE.aabb.maxy=eX.y;var eg=eE.gverts.next.next;while(eg!=null){var eR=eg;if(eR.xeE.aabb.maxx){eE.aabb.maxx=eR.x}if(eR.yeE.aabb.maxy){eE.aabb.maxy=eR.y}eg=eg.next}}}}if(eQ.zip_worldCOM){if(eQ.body!=null){eQ.zip_worldCOM=false;if(eQ.zip_localCOM){eQ.zip_localCOM=false;if(eQ.type==1){var eA=eQ.polygon;if(eA.lverts.next.next==null){eA.localCOMx=eA.lverts.next.x;eA.localCOMy=eA.lverts.next.y}else{if(eA.lverts.next.next.next==null){eA.localCOMx=eA.lverts.next.x;eA.localCOMy=eA.lverts.next.y;eA.localCOMx+=eA.lverts.next.next.x;eA.localCOMy+=eA.lverts.next.next.y;eA.localCOMx*=0.5;eA.localCOMy*=0.5}else{eA.localCOMx=0;eA.localCOMy=0;var ek=0;var ef=eA.lverts.next;var ed=ef;ef=ef.next;var eY=ef;ef=ef.next;while(ef!=null){var es=ef;ek+=eY.x*(es.y-ed.y);var eB=es.y*eY.x-es.x*eY.y;eA.localCOMx+=(eY.x+es.x)*eB;eA.localCOMy+=(eY.y+es.y)*eB;ed=eY;eY=es;ef=ef.next}ef=eA.lverts.next;var ep=ef;ek+=eY.x*(ep.y-ed.y);var ez=ep.y*eY.x-ep.x*eY.y;eA.localCOMx+=(eY.x+ep.x)*ez;eA.localCOMy+=(eY.y+ep.y)*ez;ed=eY;ef=ef.next;var eo=ef;ek+=ep.x*(eo.y-ed.y);var ey=eo.y*ep.x-eo.x*ep.y;eA.localCOMx+=(ep.x+eo.x)*ey;eA.localCOMy+=(ep.y+eo.y)*ey;ek=1/(3*ek);var er=ek;eA.localCOMx*=er;eA.localCOMy*=er}}}if(eQ.wrap_localCOM!=null){eQ.wrap_localCOM.zpp_inner.x=eQ.localCOMx;eQ.wrap_localCOM.zpp_inner.y=eQ.localCOMy}}var ex=eQ.body;if(ex.zip_axis){ex.zip_axis=false;ex.axisx=Math.sin(ex.rot);ex.axisy=Math.cos(ex.rot)}eQ.worldCOMx=eQ.body.posx+(eQ.body.axisy*eQ.localCOMx-eQ.body.axisx*eQ.localCOMy);eQ.worldCOMy=eQ.body.posy+(eQ.localCOMx*eQ.body.axisx+eQ.localCOMy*eQ.body.axisy)}}};bM.prototype.__class__=bM;var dr=zpp_nape.geom.ZPP_GeomVert=function(){this.forced=false;this.wrap=null;this.next=null;this.prev=null;this.y=0;this.x=0};dr.__name__=["zpp_nape","geom","ZPP_GeomVert"];dr.get=function(ea,ec){var eb;if(dr.zpp_pool==null){eb=new dr()}else{eb=dr.zpp_pool;dr.zpp_pool=eb.next;eb.next=null}eb.forced=false;eb.x=ea;eb.y=ec;return eb};dr.prototype.x=null;dr.prototype.y=null;dr.prototype.prev=null;dr.prototype.next=null;dr.prototype.wrap=null;dr.prototype.forced=null;dr.prototype.free=function(){if(this.wrap!=null){this.wrap.zpp_inner._inuse=false;var eb=this.wrap;var ea=eb.zpp_inner;eb.zpp_inner.outer=null;eb.zpp_inner=null;eb.zpp_pool=au.poolVec2;au.poolVec2=eb;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea;this.wrap=null}this.prev=this.next=null};dr.prototype.alloc=function(){this.forced=false};dr.prototype.wrapper=function(){if(this.wrap==null){var ea=this.x;var eh=this.y;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap=eb;this.wrap.zpp_inner._inuse=true;this.wrap.zpp_inner._invalidate=dX(this,this.modwrap);this.wrap.zpp_inner._validate=dX(this,this.getwrap)}return this.wrap};dr.prototype.modwrap=function(ea){this.x=ea.x;this.y=ea.y};dr.prototype.getwrap=function(){this.wrap.zpp_inner.x=this.x;this.wrap.zpp_inner.y=this.y};dr.prototype.__class__=dr;var b5=zpp_nape.geom.ZPP_GeomPoly=function(ea){this.vertices=null;this.outer=null;this.outer=ea};b5.__name__=["zpp_nape","geom","ZPP_GeomPoly"];b5.prototype.outer=null;b5.prototype.vertices=null;b5.prototype.__class__=b5;var dn=zpp_nape.geom.ZPP_GeomVertexIterator=function(){this.next=null;this.outer=null;this.forward=false;this.first=false;this.start=null;this.ptr=null;this.outer=new cz()};dn.__name__=["zpp_nape","geom","ZPP_GeomVertexIterator"];dn.get=function(ec,eb){var ea;if(dn.zpp_pool==null){ea=new dn()}else{ea=dn.zpp_pool;dn.zpp_pool=ea.next;ea.next=null}ea.outer.zpp_inner=ea;ea.ptr=ec;ea.forward=eb;ea.start=ec;ea.first=ec!=null;return ea.outer};dn.prototype.ptr=null;dn.prototype.start=null;dn.prototype.first=null;dn.prototype.forward=null;dn.prototype.outer=null;dn.prototype.next=null;dn.prototype.free=function(){this.outer.zpp_inner=null;this.ptr=this.start=null};dn.prototype.alloc=function(){};dn.prototype.__class__=dn;var W=zpp_nape.geom.ZPP_MarchSpan=function(){this.next=null;this.out=false;this.rank=0;this.parent=null;this.parent=this};W.__name__=["zpp_nape","geom","ZPP_MarchSpan"];W.prototype.parent=null;W.prototype.rank=null;W.prototype.out=null;W.prototype.next=null;W.prototype.free=function(){this.parent=this};W.prototype.alloc=function(){this.out=false;this.rank=0};W.prototype.__class__=W;var T=zpp_nape.geom.ZPP_MarchPair=function(){this.next=null;this.spanr=null;this.span2=null;this.span1=null;this.pd=null;this.okeyr=0;this.keyr=0;this.pr=null;this.okey2=0;this.key2=0;this.p2=null;this.okey1=0;this.key1=0;this.p1=null};T.__name__=["zpp_nape","geom","ZPP_MarchPair"];T.prototype.p1=null;T.prototype.key1=null;T.prototype.okey1=null;T.prototype.p2=null;T.prototype.key2=null;T.prototype.okey2=null;T.prototype.pr=null;T.prototype.keyr=null;T.prototype.okeyr=null;T.prototype.pd=null;T.prototype.span1=null;T.prototype.span2=null;T.prototype.spanr=null;T.prototype.next=null;T.prototype.free=function(){this.p1=this.p2=this.pr=this.pd=null;this.span1=this.span2=this.spanr=null};T.prototype.alloc=function(){};T.prototype.__class__=T;var bc=zpp_nape.geom.ZPP_MarchingSquares=function(){};bc.__name__=["zpp_nape","geom","ZPP_MarchingSquares"];bc.isos=null;bc.ints=null;bc.map=null;bc.run=function(fe,eI,en,eG,ek,eR,fE,fR,e6){var ex=eG-eI;var eK=eR.zpp_inner;if(eK._validate!=null){eK._validate()}var fP=ex/eR.zpp_inner.x;var fQ=fP|0;var eF=ek-en;var fc=eR.zpp_inner;if(fc._validate!=null){fc._validate()}var fB=eF/eR.zpp_inner.y;var fC=fB|0;if(fP!=fQ){++fQ}if(fB!=fC){++fC}if(fR){if(bc.map==null){bc.map=new ae(fQ,fC)}else{bc.map.resize(fQ,fC,null)}}if(bc.isos==null){bc.isos=new cb(fQ+1,fC+1)}else{bc.isos.resize(fQ+1,fC+1,0)}var er=0;var eq=fC+1;while(er>5;var e9=0;if((fW&1)!=0){e9=1}if((fW&2)!=0){++e9}if((fW&4)!=0){++e9}eE=e9>=2}else{eE=false}if(eE){bc.me.combLR(fd,eL);eL.span1=fd.spanr}else{if(W.zpp_pool==null){eL.span1=new W()}else{eL.span1=W.zpp_pool;W.zpp_pool=eL.span1.next;eL.span1.next=null}var e2=eL.span1;e2.out=false;e2.rank=0;eL.span1.next=fz;fz=eL.span1}if(eL.p2!=null){if(W.zpp_pool==null){eL.span2=new W()}else{eL.span2=W.zpp_pool;W.zpp_pool=eL.span2.next;eL.span2.next=null}var e1=eL.span2;e1.out=false;e1.rank=0;eL.span2.next=fz;fz=eL.span2;eL.spanr=eL.span2}else{eL.spanr=eL.span1}var fr=(eL.keyr&28)>>2;var ev=0;if((fr&1)!=0){ev=1}if((fr&2)!=0){++ev}if((fr&4)!=0){++ev}if(ev>=2){fd=eL}else{fd=null}}else{bc.me.output(e6,eL.p1);if(eL.p2!=null){bc.me.output(e6,eL.p2)}eL.p1=eL.p2=eL.pr=eL.pd=null;eL.span1=eL.span2=eL.spanr=null;eL.next=T.zpp_pool;T.zpp_pool=eL}}}if(!fR){return}var ep=1;var eg=fC;while(ep>4;var et=0;if((fp&1)!=0){et=1}if((fp&2)!=0){++et}if((fp&4)!=0){++et}if(et<2){fu=null;continue}var fy=fj.p2!=null&&fj.okey2==56?fj.span2:fj.span1;var fg=fh.p2!=null&&fh.okey2==14?fh.span2:fh.span1;var eD;if(fy==fy.parent){eD=fy}else{var eX=fy;var ft=null;while(eX!=eX.parent){var ff=eX.parent;eX.parent=ft;ft=eX;eX=ff}while(ft!=null){var ei=ft.parent;ft.parent=eX;ft=ei}eD=eX}var eC;if(fg==fg.parent){eC=fg}else{var eW=fg;var fN=null;while(eW!=eW.parent){var ef=eW.parent;eW.parent=fN;fN=eW;eW=ef}while(fN!=null){var ee=fN.parent;fN.parent=eW;fN=ee}eC=eW}if(eD==eC){if(fu!=fg){bc.me.combUD_virtual(fj,fh)}}else{var fO;if(fy==fy.parent){fO=fy}else{var eV=fy;var fM=null;while(eV!=eV.parent){var ec=eV.parent;eV.parent=fM;fM=eV;eV=ec}while(fM!=null){var ea=fM.parent;fM.parent=eV;fM=ea}fO=eV}var fA;if(fg==fg.parent){fA=fg}else{var eU=fg;var fK=null;while(eU!=eU.parent){var fX=eU.parent;eU.parent=fK;fK=eU;eU=fX}while(fK!=null){var fV=fK.parent;fK.parent=eU;fK=fV}fA=eU}if(fO!=fA){if(fO.rankfA.rank){fA.parent=fO}else{fA.parent=fO;fO.rank++}}}bc.me.combUD(fj,fh)}if(((fg==fh.span2?fh.okey2:fh.okey1)&4)!=0){fu=fg}else{fu=null}}}var el=0;var ed=fC;while(el>5;var eb=0;if((ea&1)!=0){eb=1}if((ea&2)!=0){++eb}if((ea&4)!=0){++eb}return eb>=2};bc.prototype.combRight=function(ec){var ea=(ec&28)>>2;var eb=0;if((ea&1)!=0){eb=1}if((ea&2)!=0){++eb}if((ea&4)!=0){++eb}return eb>=2};bc.prototype.combUp=function(ec){var ea=ec&7;var eb=0;if((ea&1)!=0){eb=1}if((ea&2)!=0){++eb}if((ea&4)!=0){++eb}return eb>=2};bc.prototype.combDown=function(ec){var ea=(ec&112)>>4;var eb=0;if((ea&1)!=0){eb=1}if((ea&2)!=0){++eb}if((ea&4)!=0){++eb}return eb>=2};bc.prototype.comb=function(ea){var eb=0;if((ea&1)!=0){eb=1}if((ea&2)!=0){++eb}if((ea&4)!=0){++eb}return eb>=2};bc.prototype.marchSquare=function(iD,it,ex,fo,eP,fl,eM,iK,ir,ip,io,g9,g7,gS){var ej=0;var gi=it.list[ir*it.width+iK];if(gi<0){ej=8}var gg=it.list[ir*it.width+(iK+1)];if(gg<0){ej|=4}var gf=it.list[(ir+1)*it.width+(iK+1)];if(gf<0){ej|=2}var gd=it.list[(ir+1)*it.width+iK];if(gd<0){ej|=1}if(ej==0){return null}else{var gV;if(T.zpp_pool==null){gV=new T()}else{gV=T.zpp_pool;T.zpp_pool=gV.next;gV.next=null}if(ej!=10&&ej!=5){var h4=bc.look_march[ej];gV.okey1=h4;var en=0;while(en<8){var hQ=en++;if((h4&1<1){ec=1}}return ee+ec*(eb-ee)}}};bc.prototype.xlerp=function(ec,eb,eh,ek,ei,em,ej){var ef;if(ek==0){ef=ec}else{if(ei==0){ef=eb}else{var ea=ek-ei;var el=ea*ea1){el=1}}ef=ec+el*(eb-ec)}}while(ej--!=0&&ec1){ee=1}}ef=ec+ee*(eb-ec)}}}return ef};bc.prototype.ylerp=function(ei,ef,eg,ek,eh,em,ej){var eb;if(ek==0){eb=ei}else{if(eh==0){eb=ef}else{var ea=ek-eh;var el=ea*ea1){el=1}}eb=ei+el*(ef-ei)}}while(ej--!=0&&ei1){ed=1}}eb=ei+ed*(ef-ei)}}}return eb};bc.prototype.__class__=bc;var cm=zpp_nape.geom.ZPP_Mat23=function(){this.next=null;this._invalidate=null;this.ty=0;this.tx=0;this.d=0;this.c=0;this.b=0;this.a=0;this.outer=null};cm.__name__=["zpp_nape","geom","ZPP_Mat23"];cm.get=function(){var ea;if(cm.zpp_pool==null){ea=new cm()}else{ea=cm.zpp_pool;cm.zpp_pool=ea.next;ea.next=null}return ea};cm.identity=function(){var ea=cm.get();ea.setas(1,0,0,1,0,0);return ea};cm.prototype.outer=null;cm.prototype.wrapper=function(){if(this.outer==null){this.outer=new cI();var ea=this.outer.zpp_inner;ea.next=cm.zpp_pool;cm.zpp_pool=ea;this.outer.zpp_inner=this}return this.outer};cm.prototype.a=null;cm.prototype.b=null;cm.prototype.c=null;cm.prototype.d=null;cm.prototype.tx=null;cm.prototype.ty=null;cm.prototype._invalidate=null;cm.prototype.invalidate=function(){if(this._invalidate!=null){this._invalidate()}};cm.prototype.set=function(ea){this.setas(ea.a,ea.b,ea.c,ea.d,ea.tx,ea.ty)};cm.prototype.setas=function(ed,eb,ef,ee,ec,ea){this.tx=ec;this.ty=ea;this.a=ed;this.b=eb;this.c=ef;this.d=ee};cm.prototype.next=null;cm.prototype.free=function(){};cm.prototype.alloc=function(){};cm.prototype.__class__=cm;var bI=zpp_nape.geom.ZPP_MatMN=function(ea,ed){this.x=null;this.n=0;this.m=0;this.outer=null;this.m=ea;this.n=ed;this.x=[];var eb=0;var ec=ea*ed;while(ebed.y){return false}else{if(ee.xed.x){return false}else{var ea=aE.bisector(ee);var ec=aE.bisector(ed);ea.x+=ee.x;ea.y+=ee.y;ec.x+=ed.x;ec.y+=ed.y;var eb=ea.xeb.y)){if(ea.y==eb.y){return eb.next.yek.y){ek=ea}ec=ec.next;if(!(ec!=eh)){break}}}var ei=true;var eb=ed;if(ek!=ed.next){var eg=ed.next;var ej=ek;if(eg!=null){var ep=eg;while(true){var em=ep;if(em.y0;eG.type=aE.below(eG.prev,eG)?aE.below(eG.next,eG)?en?0:3:4:aE.below(eG,eG.next)?en?1:2:4;eb=eb.next;if(!(eb!=ef)){break}}}var eq=aE.queue;if(eq.head!=null&&eq.head.next!=null){var ej=eq.head;var eK=null;var ed=null;var eF=null;var eI=null;var em=1;var ec;var eA;var ea;while(true){ec=0;ed=ej;ej=null;eK=ej;while(ed!=null){++ec;eF=ed;eA=0;ea=em;while(eF!=null&&eA0||ea>0&&eF!=null){if(eA==0){eI=eF;eF=eF.next;--ea}else{if(ea==0||eF==null){eI=ed;ed=ed.next;--eA}else{if(aE.above(ed.elt,eF.elt)){eI=ed;ed=ed.next;--eA}else{eI=eF;eF=eF.next;--ea}}}if(eK!=null){eK.next=eI}else{ej=eI}eK=eI}ed=eF}eK.next=null;em<<=1;if(!(ec>1)){break}}eq.head=ej;eq.modified=true;eq.pushmod=true}if(aE.edges==null){if(b8.zpp_pool==null){aE.edges=new b8()}else{aE.edges=b8.zpp_pool;b8.zpp_pool=aE.edges.next;aE.edges.next=null}aE.edges.lt=ah.edge_lt;aE.edges.swapped=ah.edge_swap}while(aE.queue.head!=null){var eD=aE.queue.pop_unsafe();switch(eD.type){case 0:eD.helper=eD;eD.node=aE.edges.insert(eD);break;case 1:var eJ=eD.prev;if(eJ.helper.type==2){ey.add_diagonal(eD,eJ.helper)}aE.edges.remove_node(eJ.node);break;case 2:var es=eD.prev;if(es.helper.type==2){ey.add_diagonal(eD,es.helper)}aE.edges.remove_node(es.node);var ez=null;if(!aE.edges.empty()){var ew=aE.edges.parent;while(ew.prev!=null){ew=ew.prev}while(ew!=null){var eH=ew.data;if(!ah.vert_lt(eH,eD)){ez=eH;break}if(ew.next!=null){ew=ew.next;while(ew.prev!=null){ew=ew.prev}}else{while(ew.parent!=null&&ew==ew.parent.next){ew=ew.parent}ew=ew.parent}}}var er=ez;if(er!=null){if(er.helper.type==2){ey.add_diagonal(eD,er.helper)}er.helper=eD}break;case 3:var eC=null;if(!aE.edges.empty()){var el=aE.edges.parent;while(el.prev!=null){el=el.prev}while(el!=null){var ex=el.data;if(!ah.vert_lt(ex,eD)){eC=ex;break}if(el.next!=null){el=el.next;while(el.prev!=null){el=el.prev}}else{while(el.parent!=null&&el==el.parent.next){el=el.parent}el=el.parent}}}var ep=eC;if(ep!=null){ey.add_diagonal(eD,ep.helper);ep.helper=eD}eD.node=aE.edges.insert(eD);eD.helper=eD;break;case 4:var eE=eD.prev;if(aE.left_vertex(eD)){if(eE.helper.type==2){ey.add_diagonal(eD,eE.helper)}aE.edges.remove_node(eE.node);eD.node=aE.edges.insert(eD);eD.helper=eD}else{var eB=null;if(!aE.edges.empty()){var ek=aE.edges.parent;while(ek.prev!=null){ek=ek.prev}while(ek!=null){var ev=ek.data;if(!ah.vert_lt(ev,eD)){eB=ev;break}if(ek.next!=null){ek=ek.next;while(ek.prev!=null){ek=ek.prev}}else{while(ek.parent!=null&&ek==ek.parent.next){ek=ek.parent}ek=ek.parent}}}var eo=eB;if(eo.helper.type==2){ey.add_diagonal(eD,eo.helper)}eo.helper=eD}break}}return ey};aE.prototype.__class__=aE;var ah=zpp_nape.geom.ZPP_PartitionVertex=function(){this.node=null;this.prev=null;this.next=null;this.rightchain=false;this.helper=null;this.type=0;this.diagonals=null;this.forced=false;this.y=0;this.x=0;this.mag=0;this.id=0;this.id=ah.nextId++;this.diagonals=new dO()};ah.__name__=["zpp_nape","geom","ZPP_PartitionVertex"];ah.get=function(ea){var eb;if(ah.zpp_pool==null){eb=new ah()}else{eb=ah.zpp_pool;ah.zpp_pool=eb.next;eb.next=null}eb.x=ea.x;eb.y=ea.y;return eb};ah.rightdistance=function(ef,eb){var eg=ef.next.y>ef.y;var ec=0;var ea=0;ec=ef.next.x-ef.x;ea=ef.next.y-ef.y;var ee=0;var ed=0;ee=eb.x-ef.x;ed=eb.y-ef.y;return(eg?-1:1)*(ed*ec-ee*ea)};ah.vert_lt=function(ec,eb){if(eb==ec||eb==ec.next){return true}else{if(ec.y==ec.next.y){var ea=ec.x;var ed=ec.next.x;return(eaem?eo:em;var ef=ed.x;var en=ed.next.x;return ei>(ef>en?ef:en)}else{if(!(ah.rightdistance(ed,ee)>0)){return ah.rightdistance(ed,ee.next)>0}else{return true}}}else{var eg=ah.rightdistance(ee,ed);var ej=ah.rightdistance(ee,ed.next);if(eg==0&&ej==0){var ec=ee.x;var el=ee.next.x;var eh=ec>el?ec:el;var eb=ed.x;var ek=ed.next.x;return eh>(eb>ek?eb:ek)}if(eg*ej>=0){if(!(eg<0)){return ej<0}else{return true}}var ep=ah.rightdistance(ed,ee);var ea=ah.rightdistance(ed,ee.next);if(ep*ea>=0){if(!(ep>0)){return ea>0}else{return true}}return false}}}};ah.prototype.id=null;ah.prototype.mag=null;ah.prototype.x=null;ah.prototype.y=null;ah.prototype.forced=null;ah.prototype.diagonals=null;ah.prototype.type=null;ah.prototype.helper=null;ah.prototype.rightchain=null;ah.prototype.next=null;ah.prototype.prev=null;ah.prototype.alloc=function(){};ah.prototype.free=function(){this.helper=null};ah.prototype.copy=function(){var ea;if(ah.zpp_pool==null){ea=new ah()}else{ea=ah.zpp_pool;ah.zpp_pool=ea.next;ea.next=null}ea.x=this.x;ea.y=this.y;ea.forced=this.forced;return ea};ah.prototype.sort=function(){var ej=0;var eh=0;var ep=0;var eo=0;ej=this.prev.x-this.x;eh=this.prev.y-this.y;ep=this.next.x-this.x;eo=this.next.y-this.y;var ex=eo*ej-ep*eh;var em=ex>0?-1:ex==0?0:1;var eq=this.diagonals;if(eq.head!=null&&eq.head.next!=null){var eg=eq.head;var en=null;var eb=null;var et=null;var ee=null;var ea=1;var es;var er;var ed;while(true){es=0;eb=eg;eg=null;en=eg;while(eb!=null){++es;et=eb;er=0;ed=ea;while(et!=null&&er0||ed>0&&et!=null){if(er==0){ee=et;et=et.next;--ed}else{if(ed==0||et==null){ee=eb;eb=eb.next;--er}else{var eu;if(em==1){ej=eb.elt.x-this.x;eh=eb.elt.y-this.y;ep=et.elt.x-this.x;eo=et.elt.y-this.y;var el=eo*ej-ep*eh;eu=(el>0?-1:el==0?0:1)==1}else{ej=this.prev.x-this.x;eh=this.prev.y-this.y;ep=eb.elt.x-this.x;eo=eb.elt.y-this.y;var ei=eo*ej-ep*eh;var ey=ei>0?-1:ei==0?0:1;ej=this.prev.x-this.x;eh=this.prev.y-this.y;ep=et.elt.x-this.x;eo=et.elt.y-this.y;var ef=eo*ej-ep*eh;var ew=ef>0?-1:ef==0?0:1;if(ey*ew==1||ey*ew==0&&(ey==1||ew==1)){ej=eb.elt.x-this.x;eh=eb.elt.y-this.y;ep=et.elt.x-this.x;eo=et.elt.y-this.y;var ec=eo*ej-ep*eh;eu=(ec>0?-1:ec==0?0:1)==1}else{if(ey==-1||ew==-1){eu=ew==-1}else{if(ey==0&&ew==0){ej=this.x-this.prev.x;eh=this.y-this.prev.y;ep=eb.elt.x-this.x;eo=eb.elt.y-this.y;var ev=ej*ep+eh*eo;ep=et.elt.x-this.x;eo=et.elt.y-this.y;var ek=ej*ep+eh*eo;if(ev<0&&ek>0){eu=true}else{if(ek<0&&ev>0){eu=false}else{eu=true}}}else{eu=true}}}}if(eu){ee=eb;eb=eb.next;--er}else{ee=et;et=et.next;--ed}}}if(en!=null){en.next=ee}else{eg=ee}en=ee}eb=et}en.next=null;ea<<=1;if(!(es>1)){break}}eq.head=eg;eq.modified=true;eq.pushmod=true}};ah.prototype.node=null;ah.prototype.__class__=ah;var a=zpp_nape.geom.ZPP_PartitionedPoly=function(ea){this.next=null;this.vertices=null;this.init(ea)};a.__name__=["zpp_nape","geom","ZPP_PartitionedPoly"];a.sharedPPList=null;a.getSharedPP=function(){if(a.sharedPPList==null){a.sharedPPList=new bu()}return a.sharedPPList};a.sharedGVList=null;a.getShared=function(){if(a.sharedGVList==null){a.sharedGVList=new dA()}return a.sharedGVList};a.prototype.vertices=null;a.prototype.eq=function(ec,ea){var ef=ec.x;var ee=ec.y;var eh=ea.x;var eg=ea.y;var ed=0;var eb=0;ed=ef-eh;eb=ee-eg;return ed*ed+eb*eb0;var ea=eh;while(true){var eg;if(ee){var ei;if(ah.zpp_pool==null){ei=new ah()}else{ei=ah.zpp_pool;ah.zpp_pool=ei.next;ei.next=null}ei.x=ea.x;ei.y=ea.y;var ef=ei;if(this.vertices==null){this.vertices=ef.prev=ef.next=ef}else{ef.prev=this.vertices;ef.next=this.vertices.next;this.vertices.next.prev=ef;this.vertices.next=ef}eg=ef}else{var ej;if(ah.zpp_pool==null){ej=new ah()}else{ej=ah.zpp_pool;ah.zpp_pool=ej.next;ej.next=null}ej.x=ea.x;ej.y=ea.y;var ec=ej;if(this.vertices==null){this.vertices=ec.prev=ec.next=ec}else{ec.next=this.vertices;ec.prev=this.vertices.prev;this.vertices.prev.next=ec;this.vertices.prev=ec}eg=ec}this.vertices=eg;this.vertices.forced=ea.forced;ea=ea.next;if(!(ea!=eh)){break}}this.remove_collinear_vertices()};a.prototype.remove_collinear_vertices=function(){var ec=this.vertices;var em=true;while(em||ec!=this.vertices){em=false;if(this.eq(ec,ec.next)){if(ec==this.vertices){this.vertices=ec.next;em=true}if(ec.forced){ec.next.forced=true}if(ec!=null&&ec.prev==ec){ec.next=ec.prev=null;var ee=ec;ee.helper=null;ee.next=ah.zpp_pool;ah.zpp_pool=ee;ec=null;ec=ec}else{var en=ec.next;ec.prev.next=ec.next;ec.next.prev=ec.prev;ec.next=ec.prev=null;var eg=ec;eg.helper=null;eg.next=ah.zpp_pool;ah.zpp_pool=eg;ec=null;ec=en}if(ec==null){this.vertices=null;break}}else{ec=ec.next}}if(this.vertices==null){return true}var ei;while(true){ei=false;ec=this.vertices;em=true;while(em||ec!=this.vertices){em=false;var eh=ec.prev;var eb=0;var ea=0;eb=ec.x-eh.x;ea=ec.y-eh.y;var ek=0;var ej=0;ek=ec.next.x-ec.x;ej=ec.next.y-ec.y;var el=ej*eb-ek*ea;if(el*el>=P.epsilon*P.epsilon){ec=ec.next}else{if(ec==this.vertices){this.vertices=ec.next;em=true}if(ec!=null&&ec.prev==ec){ec.next=ec.prev=null;var ef=ec;ef.helper=null;ef.next=ah.zpp_pool;ah.zpp_pool=ef;ec=null;ec=ec}else{var eo=ec.next;ec.prev.next=ec.next;ec.next.prev=ec.prev;ec.next=ec.prev=null;var ed=ec;ed.helper=null;ed.next=ah.zpp_pool;ah.zpp_pool=ed;ec=null;ec=eo}ei=true;if(ec==null){ei=false;this.vertices=null;break}}}if(!ei){break}}return this.vertices==null};a.prototype.add_diagonal=function(eb,ea){eb.diagonals.add(ea);ea.diagonals.add(eb);eb.forced=ea.forced=true};a.prototype.extract_partitions=function(eg){if(eg==null){eg=new bu()}if(this.vertices!=null){var ej=this.vertices;var eh=this.vertices;if(ej!=null){var ee=ej;while(true){ee.sort();ee=ee.next;if(!(ee!=eh)){break}}}this.pull_partitions(this.vertices,eg);while(this.vertices!=null){var ef;if(this.vertices!=null&&this.vertices.prev==this.vertices){this.vertices.next=this.vertices.prev=null;var ea=this.vertices;ea.helper=null;ea.next=ah.zpp_pool;ah.zpp_pool=ea;ef=this.vertices=null}else{var ei=this.vertices.next;this.vertices.prev.next=this.vertices.next;this.vertices.next.prev=this.vertices.prev;this.vertices.next=this.vertices.prev=null;var ec=this.vertices;ec.helper=null;ec.next=ah.zpp_pool;ah.zpp_pool=ec;this.vertices=null;ef=ei}this.vertices=ef}var ed=null;var eb=eg.head;while(eb!=null){if(eb.elt.remove_collinear_vertices()){eg.erase(ed);continue}ed=eb;eb=eb.next}}return eg};a.prototype.pull_partitions=function(ec,eh){var ea;if(a.zpp_pool==null){ea=new a()}else{ea=a.zpp_pool;a.zpp_pool=ea.next;ea.next=null}var ef=ec;while(true){var ek;if(ah.zpp_pool==null){ek=new ah()}else{ek=ah.zpp_pool;ah.zpp_pool=ek.next;ek.next=null}ek.x=ef.x;ek.y=ef.y;ek.forced=ef.forced;var ee=ek;if(ea.vertices==null){ea.vertices=ee.prev=ee.next=ee}else{ee.prev=ea.vertices;ee.next=ea.vertices.next;ea.vertices.next.prev=ee;ea.vertices.next=ee}ea.vertices=ee;ea.vertices.forced=ef.forced;if(ef.diagonals.head!=null){var eg=ef.diagonals;var ej=eg.head.elt;eg.pop();if(ej==ec){break}else{ef=this.pull_partitions(ef,eh)}}else{ef=ef.next}if(!(ef!=ec)){break}}var eb=0;var em=ea.vertices;var ei=ea.vertices;if(em!=null){var ed=em;while(true){var el=ed;eb+=el.x*(el.next.y-el.prev.y);ed=ed.next;if(!(ed!=ei)){break}}}if(eb*0.5!=0){eh.add(ea)}return ef};a.prototype.extract=function(eb){if(eb==null){eb=new dA()}if(this.vertices!=null){var ed=this.vertices;var ea=this.vertices;if(ed!=null){var ef=ed;while(true){ef.sort();ef=ef.next;if(!(ef!=ea)){break}}}this.pull(this.vertices,eb);while(this.vertices!=null){var ec;if(this.vertices!=null&&this.vertices.prev==this.vertices){this.vertices.next=this.vertices.prev=null;var eh=this.vertices;eh.helper=null;eh.next=ah.zpp_pool;ah.zpp_pool=eh;ec=this.vertices=null}else{var eg=this.vertices.next;this.vertices.prev.next=this.vertices.next;this.vertices.next.prev=this.vertices.prev;this.vertices.next=this.vertices.prev=null;var ee=this.vertices;ee.helper=null;ee.next=ah.zpp_pool;ah.zpp_pool=ee;this.vertices=null;ec=eg}this.vertices=ec}}return eb};a.prototype.pull=function(ec,eG){var eg=null;var ex=ec;while(true){var em=ex.x;var ek=ex.y;var eh;if(dr.zpp_pool==null){eh=new dr()}else{eh=dr.zpp_pool;dr.zpp_pool=eh.next;eh.next=null}eh.forced=false;eh.x=em;eh.y=ek;var es=eh;if(eg==null){eg=es.prev=es.next=es}else{es.prev=eg;es.next=eg.next;eg.next.prev=es;eg.next=es}eg=es;es.forced=ex.forced;if(ex.diagonals.head!=null){var eA=ex.diagonals;var ef=eA.head.elt;eA.pop();if(ef==ec){break}else{ex=this.pull(ex,eG)}}else{ex=ex.next}if(!(ex!=ec)){break}}var eF=0;var er=eg;var ej=eg;if(er!=null){var eE=er;while(true){var eq=eE;eF+=eq.x*(eq.next.y-eq.prev.y);eE=eE.next;if(!(eE!=ej)){break}}}var ez=eF*0.5;if(ez*ez>=P.epsilon*P.epsilon){var ew=eg;var ey=true;while(ey||ew!=eg){ey=false;var eo=ew.x;var el=ew.y;var eD=ew.next.x;var eB=ew.next.y;var ep=0;var en=0;ep=eo-eD;en=el-eB;if(ep*ep+en*en=P.epsilon*P.epsilon){ew=ew.next}else{if(ew==eg){eg=ew.next;ey=true}if(ew!=null&&ew.prev==ew){ew.next=ew.prev=null;ew=null;ew=ew}else{var ea=ew.next;ew.prev.next=ew.next;ew.next.prev=ew.prev;ew.next=ew.prev=null;ew=null;ew=ea}eC=true;if(ew==null){eC=false;eg=null;break}}}if(!eC){break}}}if(eg!=null){eG.add(eg)}}return ex};a.prototype.__class__=a;var bf=zpp_nape.geom.ZPP_Ray=function(){this.zip_dir=false;this.absnormaly=0;this.absnormalx=0;this.normaly=0;this.normalx=0;this.idiry=0;this.idirx=0;this.diry=0;this.dirx=0;this.originy=0;this.originx=0;this.userData=null;this.maxdist=0;this.direction=null;this.origin=null;var eh;if(au.poolVec2==null){eh=new r()}else{eh=au.poolVec2;au.poolVec2=eh.zpp_pool;eh.zpp_pool=null}if(eh.zpp_inner==null){var el;if(bB.zpp_pool==null){el=new bB()}else{el=bB.zpp_pool;bB.zpp_pool=el.next;el.next=null}el.weak=false;el._immutable=false;el.x=0;el.y=0;eh.zpp_inner=el;eh.zpp_inner.outer=eh}else{var eb;var ef=eh.zpp_inner;if(ef._validate!=null){ef._validate()}if(eh.zpp_inner.x==0){var ei=eh.zpp_inner;if(ei._validate!=null){ei._validate()}eb=eh.zpp_inner.y==0}else{eb=false}if(!eb){eh.zpp_inner.x=0;eh.zpp_inner.y=0;var eg=eh.zpp_inner;if(eg._invalidate!=null){eg._invalidate(eg)}}}eh.zpp_inner.weak=false;this.origin=eh;this.origin.zpp_inner._invalidate=dX(this,this.origin_invalidate);var ek;if(au.poolVec2==null){ek=new r()}else{ek=au.poolVec2;au.poolVec2=ek.zpp_pool;ek.zpp_pool=null}if(ek.zpp_inner==null){var ej;if(bB.zpp_pool==null){ej=new bB()}else{ej=bB.zpp_pool;bB.zpp_pool=ej.next;ej.next=null}ej.weak=false;ej._immutable=false;ej.x=0;ej.y=0;ek.zpp_inner=ej;ek.zpp_inner.outer=ek}else{var ea;var ee=ek.zpp_inner;if(ee._validate!=null){ee._validate()}if(ek.zpp_inner.x==0){var ed=ek.zpp_inner;if(ed._validate!=null){ed._validate()}ea=ek.zpp_inner.y==0}else{ea=false}if(!ea){ek.zpp_inner.x=0;ek.zpp_inner.y=0;var ec=ek.zpp_inner;if(ec._invalidate!=null){ec._invalidate(ec)}}}ek.zpp_inner.weak=false;this.direction=ek;this.direction.zpp_inner._invalidate=dX(this,this.direction_invalidate);this.originx=0;this.originy=0;this.dirx=0;this.diry=0;this.zip_dir=false};bf.__name__=["zpp_nape","geom","ZPP_Ray"];bf.prototype.origin=null;bf.prototype.direction=null;bf.prototype.maxdist=null;bf.prototype.userData=null;bf.prototype.originx=null;bf.prototype.originy=null;bf.prototype.dirx=null;bf.prototype.diry=null;bf.prototype.idirx=null;bf.prototype.idiry=null;bf.prototype.normalx=null;bf.prototype.normaly=null;bf.prototype.absnormalx=null;bf.prototype.absnormaly=null;bf.prototype.origin_invalidate=function(ea){this.originx=ea.x;this.originy=ea.y};bf.prototype.direction_invalidate=function(ea){this.dirx=ea.x;this.diry=ea.y;this.zip_dir=true};bf.prototype.zip_dir=null;bf.prototype.invalidate_dir=function(){this.zip_dir=true};bf.prototype.validate_dir=function(){if(this.zip_dir){this.zip_dir=false;var ec=1/Math.sqrt(this.dirx*this.dirx+this.diry*this.diry);this.dirx*=ec;this.diry*=ec;this.idirx=1/this.dirx;this.idiry=1/this.diry;this.normalx=-this.diry;this.normaly=this.dirx;var ea=this.normalx;this.absnormalx=ea<0?-ea:ea;var eb=this.normaly;this.absnormaly=eb<0?-eb:eb}};bf.prototype.rayAABB=function(){var ed=this.originx;var eb=ed;var eg=this.originy;var ee=eg;if(this.maxdist>=Infinity){if(this.dirx>0){eb=Infinity}else{if(this.dirx<0){eb=-Infinity}}if(this.diry>0){ee=Infinity}else{if(this.diry<0){ee=-Infinity}}}else{eb+=this.maxdist*this.dirx;ee+=this.maxdist*this.diry}if(eb=ek.minx&&this.originx<=ek.maxx;var eb=this.originy>=ek.miny&&this.originy<=ek.maxy;if(ec&&eb){return 0}else{var eg=-1;while(!(this.dirx>=0&&this.originx>=ek.maxx)){if(this.dirx<=0&&this.originx<=ek.minx){break}if(this.diry>=0&&this.originy>=ek.maxy){break}if(this.diry<=0&&this.originy<=ek.miny){break}if(this.dirx>0){var el=(ek.minx-this.originx)*this.idirx;if(el>=0&&el<=this.maxdist){var eh=this.originy+el*this.diry;if(eh>=ek.miny&&eh<=ek.maxy){eg=el;break}}}else{if(this.dirx<0){var ef=(ek.maxx-this.originx)*this.idirx;if(ef>=0&&ef<=this.maxdist){var ej=this.originy+ef*this.diry;if(ej>=ek.miny&&ej<=ek.maxy){eg=ef;break}}}}if(this.diry>0){var ee=(ek.miny-this.originy)*this.idiry;if(ee>=0&&ee<=this.maxdist){var ei=this.originx+ee*this.dirx;if(ei>=ek.minx&&ei<=ek.maxx){eg=ee;break}}}else{if(this.diry<0){var ed=(ek.maxy-this.originy)*this.idiry;if(ed>=0&&ed<=this.maxdist){var ea=this.originx+ed*this.dirx;if(ea>=ek.minx&&ea<=ek.maxx){eg=ed;break}}}}break}return eg}};bf.prototype.circlesect=function(eZ,em,el){if(eZ.zip_worldCOM){if(eZ.body!=null){eZ.zip_worldCOM=false;if(eZ.zip_localCOM){eZ.zip_localCOM=false;if(eZ.type==1){var eb=eZ.polygon;if(eb.lverts.next.next==null){eb.localCOMx=eb.lverts.next.x;eb.localCOMy=eb.lverts.next.y}else{if(eb.lverts.next.next.next==null){eb.localCOMx=eb.lverts.next.x;eb.localCOMy=eb.lverts.next.y;eb.localCOMx+=eb.lverts.next.next.x;eb.localCOMy+=eb.lverts.next.next.y;eb.localCOMx*=0.5;eb.localCOMy*=0.5}else{eb.localCOMx=0;eb.localCOMy=0;var et=0;var ec=eb.lverts.next;var eQ=ec;ec=ec.next;var eO=ec;ec=ec.next;while(ec!=null){var eM=ec;et+=eO.x*(eM.y-eQ.y);var eq=eM.y*eO.x-eM.x*eO.y;eb.localCOMx+=(eO.x+eM.x)*eq;eb.localCOMy+=(eO.y+eM.y)*eq;eQ=eO;eO=eM;ec=ec.next}ec=eb.lverts.next;var ex=ec;et+=eO.x*(ex.y-eQ.y);var eI=ex.y*eO.x-ex.x*eO.y;eb.localCOMx+=(eO.x+ex.x)*eI;eb.localCOMy+=(eO.y+ex.y)*eI;eQ=eO;ec=ec.next;var ev=ec;et+=ex.x*(ev.y-eQ.y);var eG=ev.y*ex.x-ev.x*ex.y;eb.localCOMx+=(ex.x+ev.x)*eG;eb.localCOMy+=(ex.y+ev.y)*eG;et=1/(3*et);var eS=et;eb.localCOMx*=eS;eb.localCOMy*=eS}}}if(eZ.wrap_localCOM!=null){eZ.wrap_localCOM.zpp_inner.x=eZ.localCOMx;eZ.wrap_localCOM.zpp_inner.y=eZ.localCOMy}}var eR=eZ.body;if(eR.zip_axis){eR.zip_axis=false;eR.axisx=Math.sin(eR.rot);eR.axisy=Math.cos(eR.rot)}eZ.worldCOMx=eZ.body.posx+(eZ.body.axisy*eZ.localCOMx-eZ.body.axisx*eZ.localCOMy);eZ.worldCOMy=eZ.body.posy+(eZ.localCOMx*eZ.body.axisx+eZ.localCOMy*eZ.body.axisy)}}var ee=0;var ed=0;ee=this.originx-eZ.worldCOMx;ed=this.originy-eZ.worldCOMy;var ek=this.dirx*this.dirx+this.diry*this.diry;var ej=2*(ee*this.dirx+ed*this.diry);var ei=ee*ee+ed*ed-eZ.radius*eZ.radius;var ef=ej*ej-4*ek*ei;if(ef==0){var er=-ej/2*ek;if((!em||ei>0)&&er>0&&er0){if(eu0&&em){if(ea0)&&eC>0&&eC<=this.maxdist){var fa=0;var e9=0;fa=this.originx;e9=this.originy;fa+=this.dirx*eC;e9+=this.diry*eC;fa-=fh.worldCOMx;e9-=fh.worldCOMy;var eY=1/Math.sqrt(fa*fa+e9*e9);fa*=eY;e9*=eY;if(eo<=0){fa=-fa;e9=-e9}var ez;if(au.poolVec2==null){ez=new r()}else{ez=au.poolVec2;au.poolVec2=ez.zpp_pool;ez.zpp_pool=null}if(ez.zpp_inner==null){var eX;if(bB.zpp_pool==null){eX=new bB()}else{eX=bB.zpp_pool;bB.zpp_pool=eX.next;eX.next=null}eX.weak=false;eX._immutable=false;eX.x=fa;eX.y=e9;ez.zpp_inner=eX;ez.zpp_inner.outer=ez}else{var e8;var e3=ez.zpp_inner;if(e3._validate!=null){e3._validate()}if(ez.zpp_inner.x==fa){var e1=ez.zpp_inner;if(e1._validate!=null){e1._validate()}e8=ez.zpp_inner.y==e9}else{e8=false}if(!e8){ez.zpp_inner.x=fa;ez.zpp_inner.y=e9;var eZ=ez.zpp_inner;if(eZ._invalidate!=null){eZ._invalidate(eZ)}}}ez.zpp_inner.weak=false;var eB=a4.getRay(ez,eC,eo<=0,fh.outer);var e4=null;var eu=ev.zpp_inner.inner.head;while(eu!=null){if(eB.zpp_inner.toiDistance0&&eE<=this.maxdist){var ey=0;var em=0;ey=this.originx;em=this.originy;ey+=this.dirx*eE;em+=this.diry*eE;ey-=fh.worldCOMx;em-=fh.worldCOMy;var eH=1/Math.sqrt(ey*ey+em*em);ey*=eH;em*=eH;var eR;if(au.poolVec2==null){eR=new r()}else{eR=au.poolVec2;au.poolVec2=eR.zpp_pool;eR.zpp_pool=null}if(eR.zpp_inner==null){var eP;if(bB.zpp_pool==null){eP=new bB()}else{eP=bB.zpp_pool;bB.zpp_pool=eP.next;eP.next=null}eP.weak=false;eP._immutable=false;eP.x=ey;eP.y=em;eR.zpp_inner=eP;eR.zpp_inner.outer=eR}else{var fg;var eS=eR.zpp_inner;if(eS._validate!=null){eS._validate()}if(eR.zpp_inner.x==ey){var eQ=eR.zpp_inner;if(eQ._validate!=null){eQ._validate()}fg=eR.zpp_inner.y==em}else{fg=false}if(!fg){eR.zpp_inner.x=ey;eR.zpp_inner.y=em;var eO=eR.zpp_inner;if(eO._invalidate!=null){eO._invalidate(eO)}}}eR.zpp_inner.weak=false;var ed=a4.getRay(eR,eE,false,fh.outer);var ep=null;var et=ev.zpp_inner.inner.head;while(et!=null){if(ed.zpp_inner.toiDistance0&&ee<=this.maxdist&&ew){var ex=0;var el=0;ex=this.originx;el=this.originy;ex+=this.dirx*ee;el+=this.diry*ee;ex-=fh.worldCOMx;el-=fh.worldCOMy;var eD=1/Math.sqrt(ex*ex+el*el);ex*=eD;el*=eD;ex=-ex;el=-el;var eL;if(au.poolVec2==null){eL=new r()}else{eL=au.poolVec2;au.poolVec2=eL.zpp_pool;eL.zpp_pool=null}if(eL.zpp_inner==null){var eK;if(bB.zpp_pool==null){eK=new bB()}else{eK=bB.zpp_pool;bB.zpp_pool=eK.next;eK.next=null}eK.weak=false;eK._immutable=false;eK.x=ex;eK.y=el;eL.zpp_inner=eK;eL.zpp_inner.outer=eL}else{var ff;var fe=eL.zpp_inner;if(fe._validate!=null){fe._validate()}if(eL.zpp_inner.x==ex){var fd=eL.zpp_inner;if(fd._validate!=null){fd._validate()}ff=eL.zpp_inner.y==el}else{ff=false}if(!ff){eL.zpp_inner.x=ex;eL.zpp_inner.y=el;var fc=eL.zpp_inner;if(fc._invalidate!=null){fc._invalidate(fc)}}}eL.zpp_inner.weak=false;var ec=a4.getRay(eL,ee,true,fh.outer);var en=null;var es=ev.zpp_inner.inner.head;while(es!=null){if(ec.zpp_inner.toiDistanceP.epsilon){el=1/el;var ek=(eh*eg-ej*ee)*el;if(ek>0&&ek-P.epsilon&&ed<1+P.epsilon){eJ=ek;ef=eH.elt}}}}eH=eH.next;eA=ez;ex=ev;ez=ez.next}while(true){ez=eC.gverts.next;var eK=ez;var ep=eH.elt;if(eo||ep.gnormx*this.dirx+ep.gnormy*this.diry<0){var es=0;var em=0;es=eK.x-ex.x;em=eK.y-ex.y;var ea=0;var et=0;ea=ex.x-this.originx;et=ex.y-this.originy;var eI=em*this.dirx-es*this.diry;if(eI*eI>P.epsilon){eI=1/eI;var er=(em*ea-es*et)*eI;if(er>0&&er-P.epsilon&&eb<1+P.epsilon){eJ=er;ef=eH.elt}}}}eH=eH.next;break}if(ef!=null){var eF=0;var eD=0;eF=ef.gnormx;eD=ef.gnormy;var eE=eF*this.dirx+eD*this.diry>0;if(eE){eF=-eF;eD=-eD}var eq;if(au.poolVec2==null){eq=new r()}else{eq=au.poolVec2;au.poolVec2=eq.zpp_pool;eq.zpp_pool=null}if(eq.zpp_inner==null){var eu;if(bB.zpp_pool==null){eu=new bB()}else{eu=bB.zpp_pool;bB.zpp_pool=eu.next;eu.next=null}eu.weak=false;eu._immutable=false;eu.x=eF;eu.y=eD;eq.zpp_inner=eu;eq.zpp_inner.outer=eq}else{var eB;var ec=eq.zpp_inner;if(ec._validate!=null){ec._validate()}if(eq.zpp_inner.x==eF){var ey=eq.zpp_inner;if(ey._validate!=null){ey._validate()}eB=eq.zpp_inner.y==eD}else{eB=false}if(!eB){eq.zpp_inner.x=eF;eq.zpp_inner.y=eD;var ew=eq.zpp_inner;if(ew._invalidate!=null){ew._invalidate(ew)}}}eq.zpp_inner.weak=false;return a4.getRay(eq,eJ,eE,eC.outer)}else{return null}};bf.prototype.polysect2=function(eY,ev,et){var e7=Infinity;var eu=-1;var ej=null;var ey=null;var e5=eY.edges.head;var eV=eY.gverts.next;var eS=eV;var eU=eV.next;while(eU!=null){var eP=eU;var e4=e5.elt;if(ev||e4.gnormx*this.dirx+e4.gnormy*this.diry<0){var em=0;var el=0;em=eP.x-eS.x;el=eP.y-eS.y;var ek=0;var eh=0;ek=eS.x-this.originx;eh=eS.y-this.originy;var eq=el*this.dirx-em*this.diry;if(eq*eq>P.epsilon){eq=1/eq;var eo=(el*ek-em*eh)*eq;if(eo>0&&eo<=this.maxdist&&(eoeu)){var ee=(this.diry*ek-this.dirx*eh)*eq;if(ee>-P.epsilon&&ee<1+P.epsilon){if(eoeu){eu=eo;ey=e5.elt}}}}}e5=e5.next;eV=eU;eS=eP;eU=eU.next}while(true){eU=eY.gverts.next;var e8=eU;var ew=e5.elt;if(ev||ew.gnormx*this.dirx+ew.gnormy*this.diry<0){var eB=0;var er=0;eB=e8.x-eS.x;er=e8.y-eS.y;var ea=0;var eE=0;ea=eS.x-this.originx;eE=eS.y-this.originy;var e6=er*this.dirx-eB*this.diry;if(e6*e6>P.epsilon){e6=1/e6;var eA=(er*ea-eB*eE)*e6;if(eA>0&&eA<=this.maxdist&&(eAeu)){var ec=(this.diry*ea-this.dirx*eE)*e6;if(ec>-P.epsilon&&ec<1+P.epsilon){if(eAeu){eu=eA;ey=e5.elt}}}}}e5=e5.next;break}if(ej!=null){var e2=0;var eZ=0;e2=ej.gnormx;eZ=ej.gnormy;var e0=e2*this.dirx+eZ*this.diry>0;if(e0){e2=-e2;eZ=-eZ}var ez;if(au.poolVec2==null){ez=new r()}else{ez=au.poolVec2;au.poolVec2=ez.zpp_pool;ez.zpp_pool=null}if(ez.zpp_inner==null){var eM;if(bB.zpp_pool==null){eM=new bB()}else{eM=bB.zpp_pool;bB.zpp_pool=eM.next;eM.next=null}eM.weak=false;eM._immutable=false;eM.x=e2;eM.y=eZ;ez.zpp_inner=eM;ez.zpp_inner.outer=ez}else{var eX;var ed=ez.zpp_inner;if(ed._validate!=null){ed._validate()}if(ez.zpp_inner.x==e2){var eT=ez.zpp_inner;if(eT._validate!=null){eT._validate()}eX=ez.zpp_inner.y==eZ}else{eX=false}if(!eX){ez.zpp_inner.x=e2;ez.zpp_inner.y=eZ;var eR=ez.zpp_inner;if(eR._invalidate!=null){eR._invalidate(eR)}}}ez.zpp_inner.weak=false;var eK=a4.getRay(ez,e7,e0,eY.outer);var eQ=null;var eg=et.zpp_inner.inner.head;while(eg!=null){if(eK.zpp_inner.toiDistance0;if(eW){ex=-ex;en=-en}var eG;if(au.poolVec2==null){eG=new r()}else{eG=au.poolVec2;au.poolVec2=eG.zpp_pool;eG.zpp_pool=null}if(eG.zpp_inner==null){var eF;if(bB.zpp_pool==null){eF=new bB()}else{eF=bB.zpp_pool;bB.zpp_pool=eF.next;eF.next=null}eF.weak=false;eF._immutable=false;eF.x=ex;eF.y=en;eG.zpp_inner=eF;eG.zpp_inner.outer=eG}else{var e3;var eN=eG.zpp_inner;if(eN._validate!=null){eN._validate()}if(eG.zpp_inner.x==ex){var eL=eG.zpp_inner;if(eL._validate!=null){eL._validate()}e3=eG.zpp_inner.y==en}else{e3=false}if(!e3){eG.zpp_inner.x=ex;eG.zpp_inner.y=en;var eJ=eG.zpp_inner;if(eJ._invalidate!=null){eJ._invalidate(eJ)}}}eG.zpp_inner.weak=false;var eD=a4.getRay(eG,eu,eW,eY.outer);var ep=null;var es=et.zpp_inner.inner.head;while(es!=null){if(eD.zpp_inner.toiDistanceea.vertex.x){return false}else{if(eb.vertex.yea.vertex.y){return false}else{return eb.typeeb.left.y}else{return ee.right.y>eb.left.y}}else{eg=ee.right.xee.left.y}else{ef=eb.right.y>ee.left.y}}else{eg=eb.right.xeb.right.y}else{return ee.right.y>eb.right.y}}else{eg=ee.right.xeb.left.y}else{return ee.right.y>eb.left.y}}else{eg=ee.right.x(eb.left.y=0){return ed>=0}else{return this.sweepx>=ee.left.x}}}else{if(eb.left.x==eb.right.x){eg=ee.right.x=0){return ek<0}else{return this.sweepx=0;eg=eb.right.x=0){return el}return(this.sweepx-ee.left.x)/(ee.right.x-ee.left.x)*(ee.right.y-ee.left.y)+ee.left.y>(this.sweepx-eb.left.x)/(eb.right.x-eb.left.x)*(eb.right.y-eb.left.y)+eb.left.y}}}};bz.prototype.clear=function(){this.tree.clear()};bz.prototype.add=function(ec){ec.node=this.tree.insert(ec);var ea=this.tree.successor_node(ec.node);var eb=this.tree.predecessor_node(ec.node);if(ea!=null){ec.next=ea.data;ea.data.prev=ec}if(eb!=null){ec.prev=eb.data;eb.data.next=ec}return ec};bz.prototype.remove=function(ec){var ea=this.tree.successor_node(ec.node);var eb=this.tree.predecessor_node(ec.node);if(ea!=null){ea.data.prev=ec.prev}if(eb!=null){eb.data.next=ec.next}this.tree.remove_node(ec.node);ec.node=null};bz.prototype.intersect=function(ee,ed){if(ee==null||ed==null){return false}else{if(ee.left==ed.left||ee.left==ed.right||ee.right==ed.left||ee.right==ed.right){return false}else{var ea=(ed.left.x-ee.left.x)*(ee.right.y-ee.left.y)-(ee.right.x-ee.left.x)*(ed.left.y-ee.left.y);var eb=(ed.right.x-ee.left.x)*(ee.right.y-ee.left.y)-(ee.right.x-ee.left.x)*(ed.right.y-ee.left.y);if(ea*eb>0){return false}else{var ec=(ee.left.x-ed.left.x)*(ed.right.y-ed.left.y)-(ed.right.x-ed.left.x)*(ee.left.y-ed.left.y);var ef=(ee.right.x-ed.left.x)*(ed.right.y-ed.left.y)-(ed.right.x-ed.left.x)*(ee.right.y-ed.left.y);if(ec*ef>0){return false}else{if(ea*eb>=0&&ec*ef>=0){return true}else{return true}}}}}};bz.prototype.intersection=function(ed,eb){if(ed==null||eb==null){return null}else{if(ed.left==eb.left||ed.left==eb.right||ed.right==eb.left||ed.right==eb.right){return null}else{var ec=0;var ea=0;ec=ed.right.x-ed.left.x;ea=ed.right.y-ed.left.y;var en=0;var ek=0;en=eb.right.x-eb.left.x;ek=eb.right.y-eb.left.y;var eh=ek*ec-en*ea;if(eh==0){return null}eh=1/eh;var ef=0;var ee=0;ef=eb.left.x-ed.left.x;ee=eb.left.y-ed.left.y;var ep=(ek*ef-en*ee)*eh;if(ep<0||ep>1){return null}var eq=(ea*ef-ec*ee)*eh;if(eq<0||eq>1){return null}var eg;if(eq==0||eq==1||ep==0||ep==1){if(eq==0){eg=eb.left}else{if(eq==1){eg=eb.right}else{if(ep==0){eg=ed.left}else{eg=ed.right}}}}else{var eo=0.5*(ed.left.x+ec*ep+eb.left.x+en*eq);var em=0.5*(ed.left.y+ea*ep+eb.left.y+ek*eq);var ei;if(dG.zpp_pool==null){ei=new dG()}else{ei=dG.zpp_pool;dG.zpp_pool=ei.next;ei.next=null}ei.x=eo;ei.y=em;eg=ei}var el;if(dI.zpp_pool==null){el=new dI()}else{el=dI.zpp_pool;dI.zpp_pool=el.next;el.next=null}el.vertex=eg;var ej=el;ej.type=0;ej.segment=ed;ej.segment2=eb;return ej}}};bz.prototype.__class__=bz;var bv=zpp_nape.geom.ZPP_Simple=function(){};bv.__name__=["zpp_nape","geom","ZPP_Simple"];bv.decompose=function(eO,e9){if(bv.sweep==null){bv.sweep=new bz();bv.inthash=new bK()}if(bv.vertices==null){if(bX.zpp_pool==null){bv.vertices=new bX()}else{bv.vertices=bX.zpp_pool;bX.zpp_pool=bv.vertices.next;bv.vertices.next=null}bv.vertices.lt=dG.less_xy;bv.vertices.swapped=dG.swap_nodes}if(bv.queue==null){if(bl.zpp_pool==null){bv.queue=new bl()}else{bv.queue=bl.zpp_pool;bl.zpp_pool=bv.queue.next;bv.queue.next=null}bv.queue.lt=dI.less_xy;bv.queue.swapped=dI.swap_nodes}var fr=null;var fh=null;if(eO!=null){var eG=eO;while(true){var e8=eG;var e7=e8.x;var e5=e8.y;var fd;if(dG.zpp_pool==null){fd=new dG()}else{fd=dG.zpp_pool;dG.zpp_pool=fd.next;fd.next=null}fd.x=e7;fd.y=e5;var f9=fd;var eY=bv.vertices.parent;while(eY!=null){if(bv.vertices.lt(f9,eY.data)){eY=eY.prev}else{if(bv.vertices.lt(eY.data,f9)){eY=eY.next}else{break}}}var eF=eY;if(eF!=null){var fc=f9;fc.links.clear();fc.node=null;fc.forced=false;fc.next=dG.zpp_pool;dG.zpp_pool=fc;f9=eF.data}else{f9.node=bv.vertices.insert(f9)}if(fh!=null){var f5;if(dI.zpp_pool==null){f5=new dI()}else{f5=dI.zpp_pool;dI.zpp_pool=f5.next;f5.next=null}f5.vertex=fh;var e4=f5;var f3;if(dI.zpp_pool==null){f3=new dI()}else{f3=dI.zpp_pool;dI.zpp_pool=f3.next;f3.next=null}f3.vertex=f9;var e3=f3;var fi;if(dI.less_xy(e4,e3)){e4.type=1;e3.type=2;fi=co.get(fh,f9)}else{e4.type=2;e3.type=1;fi=co.get(f9,fh)}e4.segment=e3.segment=fi;bv.queue.insert(e4);bv.queue.insert(e3);fh.links.insert(f9);f9.links.insert(fh)}fh=f9;if(fr==null){fr=f9}eG=eG.next;if(!(eG!=eO)){break}}}var f1;if(dI.zpp_pool==null){f1=new dI()}else{f1=dI.zpp_pool;dI.zpp_pool=f1.next;f1.next=null}f1.vertex=fh;var fH=f1;var fY;if(dI.zpp_pool==null){fY=new dI()}else{fY=dI.zpp_pool;dI.zpp_pool=fY.next;fY.next=null}fY.vertex=fr;var fj=fY;var gb;if(dI.less_xy(fH,fj)){fH.type=1;fj.type=2;gb=co.get(fh,fr)}else{fH.type=2;fj.type=1;gb=co.get(fr,fh)}fH.segment=fj.segment=gb;bv.queue.insert(fH);bv.queue.insert(fj);fh.links.insert(fr);fr.links.insert(fh);if(bv.ints==null){if(bl.zpp_pool==null){bv.ints=new bl()}else{bv.ints=bl.zpp_pool;bl.zpp_pool=bv.ints.next;bv.ints.next=null}bv.ints.lt=dI.less_xy}while(!bv.queue.empty()){var fl=bv.queue.pop_front();bv.sweep.sweepx=fl.vertex.x;if(fl.type==1){var fb=fl.segment;bv.sweep.add(fb);if(fb.next!=null&&fb!=null&&!(fb.next.id=bv.sweep.sweepx){var et=bv.queue.parent;while(et!=null){if(bv.queue.lt(ga,et.data)){et=et.prev}else{if(bv.queue.lt(et.data,ga)){et=et.next}else{break}}}if(et==null){var es=bv.ints.parent;while(es!=null){if(bv.ints.lt(ga,es.data)){es=es.prev}else{if(bv.ints.lt(es.data,ga)){es=es.next}else{break}}}var fC=es;if(fC!=null){var f6=ga.vertex;f6.links.clear();f6.node=null;f6.forced=false;f6.next=dG.zpp_pool;dG.zpp_pool=f6;ga.vertex=fC.data.vertex;fC.data=ga;bv.queue.insert(ga)}else{bv.queue.insert(ga);bv.ints.insert(ga)}if(fb.next.id=bv.sweep.sweepx){var er=bv.queue.parent;while(er!=null){if(bv.queue.lt(fZ,er.data)){er=er.prev}else{if(bv.queue.lt(er.data,fZ)){er=er.next}else{break}}}if(er==null){var ep=bv.ints.parent;while(ep!=null){if(bv.ints.lt(fZ,ep.data)){ep=ep.prev}else{if(bv.ints.lt(ep.data,fZ)){ep=ep.next}else{break}}}var fA=ep;if(fA!=null){var f0=fZ.vertex;f0.links.clear();f0.node=null;f0.forced=false;f0.next=dG.zpp_pool;dG.zpp_pool=f0;fZ.vertex=fA.data.vertex;fA.data=fZ;bv.queue.insert(fZ)}else{bv.queue.insert(fZ);bv.ints.insert(fZ)}if(fb.id=bv.sweep.sweepx){var en=bv.queue.parent;while(en!=null){if(bv.queue.lt(fW,en.data)){en=en.prev}else{if(bv.queue.lt(en.data,fW)){en=en.next}else{break}}}if(en==null){var el=bv.ints.parent;while(el!=null){if(bv.ints.lt(fW,el.data)){el=el.prev}else{if(bv.ints.lt(el.data,fW)){el=el.next}else{break}}}var fy=el;if(fy!=null){var fQ=fW.vertex;fQ.links.clear();fQ.node=null;fQ.forced=false;fQ.next=dG.zpp_pool;dG.zpp_pool=fQ;fW.vertex=fy.data.vertex;fy.data=fW;bv.queue.insert(fW)}else{bv.queue.insert(fW);bv.ints.insert(fW)}if(fk.id=bv.sweep.sweepx){var eg=bv.queue.parent;while(eg!=null){if(bv.queue.lt(fO,eg.data)){eg=eg.prev}else{if(bv.queue.lt(eg.data,fO)){eg=eg.next}else{break}}}if(eg==null){var fG=bv.ints.parent;while(fG!=null){if(bv.ints.lt(fO,fG.data)){fG=fG.prev}else{if(bv.ints.lt(fG.data,fO)){fG=fG.next}else{break}}}var fw=fG;if(fw!=null){var eZ=fO.vertex;eZ.links.clear();eZ.node=null;eZ.forced=false;eZ.next=dG.zpp_pool;dG.zpp_pool=eZ;fO.vertex=fw.data.vertex;fw.data=fO;bv.queue.insert(fO)}else{bv.queue.insert(fO);bv.ints.insert(fO)}if(fm.next.id=bv.sweep.sweepx){var fF=bv.queue.parent;while(fF!=null){if(bv.queue.lt(fL,fF.data)){fF=fF.prev}else{if(bv.queue.lt(fF.data,fL)){fF=fF.next}else{break}}}if(fF==null){var fE=bv.ints.parent;while(fE!=null){if(bv.ints.lt(fL,fE.data)){fE=fE.prev}else{if(bv.ints.lt(fE.data,fL)){fE=fE.next}else{break}}}var fu=fE;if(fu!=null){var eS=fL.vertex;eS.links.clear();eS.node=null;eS.forced=false;eS.next=dG.zpp_pool;dG.zpp_pool=eS;fL.vertex=fu.data.vertex;fu.data=fL;bv.queue.insert(fL)}else{bv.queue.insert(fL);bv.ints.insert(fL)}if(fn.id0&&eu<=0){eN=eK;eu=ea}else{if(eu*ea>=0){var eG=0;var ep=0;eG=eM.x-eK.x;ep=eM.y-eK.y;var ey=0;var el=0;ey=eN.x-eM.x;el=eN.y-eM.y;if(el*eG-ey*ep>0){eN=eK;eu=ea}}}}if(ew.next!=null){ew=ew.next;while(ew.prev!=null){ew=ew.prev}}else{while(ew.parent!=null&&ew==ew.parent.next){ew=ew.parent}ew=ew.parent}}}if(ef.links.empty()){ed.remove(ef);var ei=ef;ei.links.clear();ei.node=null;ei.forced=false;ei.next=dG.zpp_pool;dG.zpp_pool=ei}ef=eM;eM=eN}}ed.remove(er);er.links.clear();er.node=null;er.forced=false;er.next=dG.zpp_pool;dG.zpp_pool=er;eb.add(ex)};bv.isSimple=function(ep){if(bv.sweep==null){bv.sweep=new bz();bv.inthash=new bK()}var eb=bv.list_vertices;if(eb==null){eb=bv.list_vertices=new a8()}if(ep!=null){var ec=ep;while(true){var eA=ec;var ey=eA.x;var ew=eA.y;var eq;if(dG.zpp_pool==null){eq=new dG()}else{eq=dG.zpp_pool;dG.zpp_pool=eq.next;eq.next=null}eq.x=ey;eq.y=ew;eb.add(eq);ec=ec.next;if(!(ec!=ep)){break}}}var ef=bv.list_queue;if(ef==null){ef=bv.list_queue=new dC()}var eg=eb.head;var eB=eg.elt;eg=eg.next;while(eg!=null){var eK=eg.elt;var ez;if(dI.zpp_pool==null){ez=new dI()}else{ez=dI.zpp_pool;dI.zpp_pool=ez.next;ez.next=null}ez.vertex=eB;var eo=ef.add(ez);var ex;if(dI.zpp_pool==null){ex=new dI()}else{ex=dI.zpp_pool;dI.zpp_pool=ex.next;ex.next=null}ex.vertex=eK;var en=ef.add(ex);var eD;if(dI.less_xy(eo,en)){eo.type=1;en.type=2;eD=co.get(eB,eK)}else{eo.type=2;en.type=1;eD=co.get(eK,eB)}eo.segment=en.segment=eD;eB=eK;eg=eg.next}var eJ=eb.head.elt;var ev;if(dI.zpp_pool==null){ev=new dI()}else{ev=dI.zpp_pool;dI.zpp_pool=ev.next;ev.next=null}ev.vertex=eB;var eC=ef.add(ev);var eu;if(dI.zpp_pool==null){eu=new dI()}else{eu=dI.zpp_pool;dI.zpp_pool=eu.next;eu.next=null}eu.vertex=eJ;var ek=ef.add(eu);var eI;if(dI.less_xy(eC,ek)){eC.type=1;ek.type=2;eI=co.get(eB,eJ)}else{eC.type=2;ek.type=1;eI=co.get(eJ,eB)}eC.segment=ek.segment=eI;var em=ef;if(em.head!=null&&em.head.next!=null){var ei=em.head;var eL=null;var ee=null;var eE=null;var eG=null;var ej=1;var ed;var er;var ea;while(true){ed=0;ee=ei;ei=null;eL=ei;while(ee!=null){++ed;eE=ee;er=0;ea=ej;while(eE!=null&&er0||ea>0&&eE!=null){if(er==0){eG=eE;eE=eE.next;--ea}else{if(ea==0||eE==null){eG=ee;ee=ee.next;--er}else{if(dI.less_xy(ee.elt,eE.elt)){eG=ee;ee=ee.next;--er}else{eG=eE;eE=eE.next;--ea}}}if(eL!=null){eL.next=eG}else{ei=eG}eL=eG}ee=eE}eL.next=null;ej<<=1;if(!(ed>1)){break}}em.head=ei;em.modified=true;em.pushmod=true}var et=true;while(ef.head!=null){var eH=ef.pop_unsafe();var es=eH.segment;if(eH.type==1){bv.sweep.add(es);if(bv.sweep.intersect(es,es.next)||bv.sweep.intersect(es,es.prev)){et=false;break}}else{if(eH.type==2){if(bv.sweep.intersect(es.prev,es.next)){et=false;break}bv.sweep.remove(es);es.left=es.right=null;es.prev=null;es.node=null;es.vertices.clear();es.next=co.zpp_pool;co.zpp_pool=es}}eH.vertex=null;eH.segment=eH.segment2=null;eH.node=null;eH.next=dI.zpp_pool;dI.zpp_pool=eH}while(ef.head!=null){var el=ef.pop_unsafe();if(el.type==2){var eF=el.segment;eF.left=eF.right=null;eF.prev=null;eF.node=null;eF.vertices.clear();eF.next=co.zpp_pool;co.zpp_pool=eF}el.vertex=null;el.segment=el.segment2=null;el.node=null;el.next=dI.zpp_pool;dI.zpp_pool=el}bv.sweep.clear();while(eb.head!=null){var eh=eb.pop_unsafe();eh.links.clear();eh.node=null;eh.forced=false;eh.next=dG.zpp_pool;dG.zpp_pool=eh}return et};bv.prototype.__class__=bv;var cD=zpp_nape.geom.ZPP_SimplifyV=function(){this.forced=false;this.flag=false;this.prev=null;this.next=null;this.y=0;this.x=0};cD.__name__=["zpp_nape","geom","ZPP_SimplifyV"];cD.get=function(ea){var eb;if(cD.zpp_pool==null){eb=new cD()}else{eb=cD.zpp_pool;cD.zpp_pool=eb.next;eb.next=null}eb.x=ea.x;eb.y=ea.y;eb.flag=false;return eb};cD.prototype.x=null;cD.prototype.y=null;cD.prototype.next=null;cD.prototype.prev=null;cD.prototype.flag=null;cD.prototype.forced=null;cD.prototype.free=function(){};cD.prototype.alloc=function(){};cD.prototype.__class__=cD;var cG=zpp_nape.geom.ZPP_SimplifyP=function(){this.max=null;this.min=null;this.next=null};cG.__name__=["zpp_nape","geom","ZPP_SimplifyP"];cG.get=function(ec,ea){var eb;if(cG.zpp_pool==null){eb=new cG()}else{eb=cG.zpp_pool;cG.zpp_pool=eb.next;eb.next=null}eb.min=ec;eb.max=ea;return eb};cG.prototype.next=null;cG.prototype.min=null;cG.prototype.max=null;cG.prototype.free=function(){this.min=this.max=null};cG.prototype.alloc=function(){};cG.prototype.__class__=cG;var aL=zpp_nape.geom.ZPP_Simplify=function(){};aL.__name__=["zpp_nape","geom","ZPP_Simplify"];aL.lessval=function(eb,ea){return eb.x-ea.x+(eb.y-ea.y)};aL.less=function(eb,ea){return eb.x-ea.x+(eb.y-ea.y)<0};aL.distance=function(ej,ei,eh){var ee=0;var ed=0;ee=eh.x-ei.x;ed=eh.y-ei.y;var ec=0;var eb=0;ec=ej.x-ei.x;eb=ej.y-ei.y;if(ee*ee+ed*ed==0){return ec*ec+eb*eb}else{var el=(ec*ee+eb*ed)/(ee*ee+ed*ed);if(el<=0){return ec*ec+eb*eb}else{if(el>=1){var ea=ej.x;var en=ej.y;var eg=eh.x;var ef=eh.y;var em=0;var ek=0;em=ea-eg;ek=en-ef;return em*em+ek*ek}else{ec-=ee*el;eb-=ed*el;return ec*ec+eb*eb}}}};aL.simplify=function(ee,eE){var ep=null;var eK=null;var en=null;eE*=eE;if(aL.stack==null){aL.stack=new c0()}var eD=null;var em=null;var ef=ee;while(true){var eA;if(cD.zpp_pool==null){eA=new cD()}else{eA=cD.zpp_pool;cD.zpp_pool=eA.next;eA.next=null}eA.x=ef.x;eA.y=ef.y;eA.flag=false;var eC=eA;eC.forced=ef.forced;if(eC.forced){eC.flag=true;if(eD!=null){var ey;if(cG.zpp_pool==null){ey=new cG()}else{ey=cG.zpp_pool;cG.zpp_pool=ey.next;ey.next=null}ey.min=eD;ey.max=eC;aL.stack.add(ey)}else{em=eC}eD=eC}if(ep==null){ep=eC.prev=eC.next=eC}else{eC.prev=ep;eC.next=ep.next;ep.next.prev=eC;ep.next=eC}ep=eC;if(eK==null){eK=eC;en=eC}else{if(eC.x-eK.x+(eC.y-eK.y)<0){eK=eC}if(en.x-eC.x+(en.y-eC.y)<0){en=eC}}ef=ef.next;if(!(ef!=ee)){break}}if(aL.stack.head==null){if(em==null){eK.flag=en.flag=true;var ew;if(cG.zpp_pool==null){ew=new cG()}else{ew=cG.zpp_pool;cG.zpp_pool=ew.next;ew.next=null}ew.min=eK;ew.max=en;aL.stack.add(ew);var ev;if(cG.zpp_pool==null){ev=new cG()}else{ev=cG.zpp_pool;cG.zpp_pool=ev.next;ev.next=null}ev.min=en;ev.max=eK;aL.stack.add(ev)}else{var eI=eK.x-em.x+(eK.y-em.y);if(eI<0){eI=-eI}var eG=en.x-em.x+(en.y-em.y);if(eG<0){eG=-eG}if(eI>eG){eK.flag=em.flag=true;var eu;if(cG.zpp_pool==null){eu=new cG()}else{eu=cG.zpp_pool;cG.zpp_pool=eu.next;eu.next=null}eu.min=eK;eu.max=em;aL.stack.add(eu);var et;if(cG.zpp_pool==null){et=new cG()}else{et=cG.zpp_pool;cG.zpp_pool=et.next;et.next=null}et.min=em;et.max=eK;aL.stack.add(et)}else{en.flag=em.flag=true;var es;if(cG.zpp_pool==null){es=new cG()}else{es=cG.zpp_pool;cG.zpp_pool=es.next;es.next=null}es.min=en;es.max=em;aL.stack.add(es);var er;if(cG.zpp_pool==null){er=new cG()}else{er=cG.zpp_pool;cG.zpp_pool=er.next;er.next=null}er.min=em;er.max=en;aL.stack.add(er)}}}else{var eq;if(cG.zpp_pool==null){eq=new cG()}else{eq=cG.zpp_pool;cG.zpp_pool=eq.next;eq.next=null}eq.min=eD;eq.max=em;aL.stack.add(eq)}while(aL.stack.head!=null){var el=aL.stack.pop_unsafe();var eg=el.min;var eH=el.max;el.min=el.max=null;el.next=cG.zpp_pool;cG.zpp_pool=el;var eo=eE;var ec=null;var eJ=eg.next;while(eJ!=eH){var ed=aL.distance(eJ,eg,eH);if(ed>eo){eo=ed;ec=eJ}eJ=eJ.next}if(ec!=null){ec.flag=true;var ek;if(cG.zpp_pool==null){ek=new cG()}else{ek=cG.zpp_pool;cG.zpp_pool=ek.next;ek.next=null}ek.min=eg;ek.max=ec;aL.stack.add(ek);var ej;if(cG.zpp_pool==null){ej=new cG()}else{ej=cG.zpp_pool;cG.zpp_pool=ej.next;ej.next=null}ej.min=ec;ej.max=eH;aL.stack.add(ej)}}var eb=null;while(ep!=null){if(ep.flag){var ez=ep.x;var ex=ep.y;var ei;if(dr.zpp_pool==null){ei=new dr()}else{ei=dr.zpp_pool;dr.zpp_pool=ei.next;ei.next=null}ei.forced=false;ei.x=ez;ei.y=ex;var ea=ei;if(eb==null){eb=ea.prev=ea.next=ea}else{ea.prev=eb;ea.next=eb.next;eb.next.prev=ea;eb.next=ea}eb=ea;ea.forced=ep.forced}if(ep!=null&&ep.prev==ep){ep.next=ep.prev=null;var eF=ep;eF.next=cD.zpp_pool;cD.zpp_pool=eF;ep=null;ep=ep}else{var eB=ep.next;ep.prev.next=ep.next;ep.next.prev=ep.prev;ep.next=ep.prev=null;var eh=ep;eh.next=cD.zpp_pool;cD.zpp_pool=eh;ep=null;ep=eB}}return eb};aL.prototype.__class__=aL;var ct=zpp_nape.geom.ZPP_ToiEvent=function(){this.kinematic=false;this.failed=false;this.slipped=false;this.axis=null;this.c2=null;this.c1=null;this.frozen2=false;this.frozen1=false;this.arbiter=null;this.s2=null;this.s1=null;this.toi=0;this.next=null;this.c1=new bB();this.c2=new bB();this.axis=new bB()};ct.__name__=["zpp_nape","geom","ZPP_ToiEvent"];ct.prototype.next=null;ct.prototype.alloc=function(){this.failed=false;this.s1=this.s2=null;this.arbiter=null};ct.prototype.free=function(){};ct.prototype.toi=null;ct.prototype.s1=null;ct.prototype.s2=null;ct.prototype.arbiter=null;ct.prototype.frozen1=null;ct.prototype.frozen2=null;ct.prototype.c1=null;ct.prototype.c2=null;ct.prototype.axis=null;ct.prototype.slipped=null;ct.prototype.failed=null;ct.prototype.kinematic=null;ct.prototype.__class__=ct;var de=zpp_nape.geom.ZPP_SweepDistance=function(){};de.__name__=["zpp_nape","geom","ZPP_SweepDistance"];de.dynamicSweep=function(eC,h7,gR,kq,hj){if(hj==null){hj=false}var gx=eC.s1;var gv=eC.s2;var kp=gx.body;var ko=gv.body;var jS=0;var jQ=0;jS=ko.velx-kp.velx;jQ=ko.vely-kp.vely;var gZ=kp.angvel;if(gZ<0){gZ=-gZ}var gY=ko.angvel;if(gY<0){gY=-gY}var fF=gx.sweepCoef*gZ+gv.sweepCoef*gY;if(!hj&&!eC.kinematic&&jS*jS+jQ*jQ0.0001){kp.axisx=Math.sin(kp.rot);kp.axisy=Math.cos(kp.rot)}else{var jZ=jd*jd;var jC=1-0.5*jZ;var jF=1-jZ*jZ/8;var g6=(jC*kp.axisx+jd*kp.axisy)*jF;kp.axisy=(jC*kp.axisy-jd*kp.axisx)*jF;kp.axisx=g6}}}if(gx.type==0){gx.worldCOMx=kp.posx+(kp.axisy*gx.localCOMx-kp.axisx*gx.localCOMy);gx.worldCOMy=kp.posy+(gx.localCOMx*kp.axisx+gx.localCOMy*kp.axisy)}else{var hf=gx.polygon;var hs=hf.lverts.next;var iG=hf.gverts.next;while(iG!=null){var jL=iG;var jG=hs;hs=hs.next;jL.x=kp.posx+(kp.axisy*jG.x-kp.axisx*jG.y);jL.y=kp.posy+(jG.x*kp.axisx+jG.y*kp.axisy);iG=iG.next}var iw=hf.edges.head;var fv=hf.gverts.next;var jr=fv;fv=fv.next;while(fv!=null){var jp=fv;var jO=iw.elt;iw=iw.next;jO.gnormx=kp.axisy*jO.lnormx-kp.axisx*jO.lnormy;jO.gnormy=jO.lnormx*kp.axisx+jO.lnormy*kp.axisy;jO.gprojection=kp.posx*jO.gnormx+kp.posy*jO.gnormy+jO.lprojection;jO.tp0=jr.y*jO.gnormx-jr.x*jO.gnormy;jO.tp1=jp.y*jO.gnormx-jp.x*jO.gnormy;jr=jp;fv=fv.next}var fB=hf.gverts.next;var jD=iw.elt;jD.gnormx=kp.axisy*jD.lnormx-kp.axisx*jD.lnormy;jD.gnormy=jD.lnormx*kp.axisx+jD.lnormy*kp.axisy;jD.gprojection=kp.posx*jD.gnormx+kp.posy*jD.gnormy+jD.lprojection;jD.tp0=jr.y*jD.gnormx-jr.x*jD.gnormy;jD.tp1=fB.y*jD.gnormx-fB.x*jD.gnormy}var ki=iQ*h7;var km=ki-ko.sweepTime;if(km!=0){ko.sweepTime=ki;ko.posx+=ko.velx*km;ko.posy+=ko.vely*km;if(ko.angvel!=0){var eB=ko.sweep_angvel*km;ko.rot+=eB;if(eB*eB>0.0001){ko.axisx=Math.sin(ko.rot);ko.axisy=Math.cos(ko.rot)}else{var iv=eB*eB;var he=1-0.5*iv;var hG=1-iv*iv/8;var gk=(he*ko.axisx+eB*ko.axisy)*hG;ko.axisy=(he*ko.axisy-eB*ko.axisx)*hG;ko.axisx=gk}}}if(gv.type==0){gv.worldCOMx=ko.posx+(ko.axisy*gv.localCOMx-ko.axisx*gv.localCOMy);gv.worldCOMy=ko.posy+(gv.localCOMx*ko.axisx+gv.localCOMy*ko.axisy)}else{var hc=gv.polygon;var gX=hc.lverts.next;var ft=hc.gverts.next;while(ft!=null){var iZ=ft;var hZ=gX;gX=gX.next;iZ.x=ko.posx+(ko.axisy*hZ.x-ko.axisx*hZ.y);iZ.y=ko.posy+(hZ.x*ko.axisx+hZ.y*ko.axisy);ft=ft.next}var fM=hc.edges.head;var fr=hc.gverts.next;var fJ=fr;fr=fr.next;while(fr!=null){var fA=fr;var jB=fM.elt;fM=fM.next;jB.gnormx=ko.axisy*jB.lnormx-ko.axisx*jB.lnormy;jB.gnormy=jB.lnormx*ko.axisx+jB.lnormy*ko.axisy;jB.gprojection=ko.posx*jB.gnormx+ko.posy*jB.gnormy+jB.lprojection;jB.tp0=fJ.y*jB.gnormx-fJ.x*jB.gnormy;jB.tp1=fA.y*jB.gnormx-fA.x*jB.gnormy;fJ=fA;fr=fr.next}var fz=hc.gverts.next;var jz=fM.elt;jz.gnormx=ko.axisy*jz.lnormx-ko.axisx*jz.lnormy;jz.gnormy=jz.lnormx*ko.axisx+jz.lnormy*ko.axisy;jz.gprojection=ko.posx*jz.gnormx+ko.posy*jz.gnormy+jz.lprojection;jz.tp0=fJ.y*jz.gnormx-fJ.x*jz.gnormy;jz.tp1=fz.y*jz.gnormx-fz.x*jz.gnormy}var jP=gx;var jn=gv;var fe=ka;var fd=j9;var eY;if(gx.type==0&&gv.type==0){var j4=gx.circle;var jU=gv.circle;var hM;var gj=0;var g5=0;gj=jU.worldCOMx-j4.worldCOMx;g5=jU.worldCOMy-j4.worldCOMy;var ho=Math.sqrt(gj*gj+g5*g5);hM=ho-(j4.radius+jU.radius);if(hM<1e+100){if(ho==0){gj=1;g5=0}else{var ju=1/ho;gj*=ju;g5*=ju}var f4=j4.radius;ka.x=j4.worldCOMx+gj*f4;ka.y=j4.worldCOMy+g5*f4;var f2=-jU.radius;j9.x=jU.worldCOMx+gj*f2;j9.y=jU.worldCOMy+g5*f2;iH.x=gj;iH.y=g5}eY=hM}else{var jA=false;if(gx.type==0&&gv.type==1){var gB=gx;jP=gv;jn=gB;var gz=ka;fe=j9;fd=gz;jA=true}if(jP.type==1&&jn.type==0){var fN=jP.polygon;var h2=jn.circle;var fZ=-1e+100;var es=null;var fp=fN.edges.head;while(fp!=null){var jR=fp.elt;var kg=jR.gnormx*h2.worldCOMx+jR.gnormy*h2.worldCOMy-jR.gprojection-h2.radius;if(kg>1e+100){fZ=kg;break}if(kg>0){if(kg>fZ){fZ=kg;es=jR}}else{if(fZ<0&&kg>fZ){fZ=kg;es=jR}}fp=fp.next}if(fZ<1e+100){var fC=es.gp0;var eZ=es.gp1;var kh=h2.worldCOMy*es.gnormx-h2.worldCOMx*es.gnormy;if(kh<=fC.y*es.gnormx-fC.x*es.gnormy){var gi=0;var fS=0;gi=h2.worldCOMx-fC.x;fS=h2.worldCOMy-fC.y;var fc=Math.sqrt(gi*gi+fS*fS);fZ=fc-h2.radius;if(fZ<1e+100){if(fc==0){gi=1;fS=0}else{var f1=1/fc;gi*=f1;fS*=f1}fe.x=fC.x+gi*0;fe.y=fC.y+fS*0;var f0=-h2.radius;fd.x=h2.worldCOMx+gi*f0;fd.y=h2.worldCOMy+fS*f0;iH.x=gi;iH.y=fS}}else{if(kh>=eZ.y*es.gnormx-eZ.x*es.gnormy){var gh=0;var fR=0;gh=h2.worldCOMx-eZ.x;fR=h2.worldCOMy-eZ.y;var fb=Math.sqrt(gh*gh+fR*fR);fZ=fb-h2.radius;if(fZ<1e+100){if(fb==0){gh=1;fR=0}else{var fY=1/fb;gh*=fY;fR*=fY}fe.x=eZ.x+gh*0;fe.y=eZ.y+fR*0;var fX=-h2.radius;fd.x=h2.worldCOMx+gh*fX;fd.y=h2.worldCOMy+fR*fX;iH.x=gh;iH.y=fR}}else{var fW=-h2.radius;fd.x=h2.worldCOMx+es.gnormx*fW;fd.y=h2.worldCOMy+es.gnormy*fW;var fU=-fZ;fe.x=fd.x+es.gnormx*fU;fe.y=fd.y+es.gnormy*fU;iH.x=es.gnormx;iH.y=es.gnormy}}}if(jA){iH.x=-iH.x;iH.y=-iH.y}eY=fZ}else{var iz=jP.polygon;var h6=jn.polygon;var hn=-1e+100;var er=null;var eq=null;var g4=0;var fn=iz.edges.head;while(fn!=null){var eo=fn.elt;var eE=1e+100;var fm=h6.gverts.next;while(fm!=null){var fy=fm;var jH=eo.gnormx*fy.x+eo.gnormy*fy.y;if(jH1e+100){hn=eE;break}if(eE>0){if(eE>hn){hn=eE;er=eo;g4=1}}else{if(hn<0&&eE>hn){hn=eE;er=eo;g4=1}}fn=fn.next}if(hn<1e+100){var fl=h6.edges.head;while(fl!=null){var en=fl.elt;var gq=1e+100;var fk=iz.gverts.next;while(fk!=null){var fx=fk;var ik=en.gnormx*fx.x+en.gnormy*fx.y;if(ik1e+100){hn=gq;break}if(gq>0){if(gq>hn){hn=gq;eq=en;g4=2}}else{if(hn<0&&gq>hn){hn=gq;eq=en;g4=2}}fl=fl.next}if(hn<1e+100){var gP;var j7;if(g4==1){gP=h6;j7=er}else{gP=iz;j7=eq;var gy=fe;fe=fd;fd=gy;jA=!jA}var j6=null;var go=1e+100;var fi=gP.edges.head;while(fi!=null){var em=fi.elt;var ii=j7.gnormx*em.gnormx+j7.gnormy*em.gnormy;if(ii=0){var fj=j7.gp0;var eX=j7.gp1;var gT=j6.gp0;var gQ=j6.gp1;var eO=0;var eN=0;var gs=0;var gr=0;eO=eX.x-fj.x;eN=eX.y-fj.y;gs=gQ.x-gT.x;gr=gQ.y-gT.y;var jo=1/(eO*eO+eN*eN);var eF=1/(gs*gs+gr*gr);var io=-(eO*(fj.x-gT.x)+eN*(fj.y-gT.y))*jo;var h3=-(eO*(fj.x-gQ.x)+eN*(fj.y-gQ.y))*jo;var jN=-(gs*(gT.x-fj.x)+gr*(gT.y-fj.y))*eF;var jm=-(gs*(gT.x-eX.x)+gr*(gT.y-eX.y))*eF;if(io<0){io=0}else{if(io>1){io=1}}if(h3<0){h3=0}else{if(h3>1){h3=1}}if(jN<0){jN=0}else{if(jN>1){jN=1}}if(jm<0){jm=0}else{if(jm>1){jm=1}}var eJ=0;var eI=0;var fT=io;eJ=fj.x+eO*fT;eI=fj.y+eN*fT;var eu=0;var et=0;var iq=h3;eu=fj.x+eO*iq;et=fj.y+eN*iq;var jf=0;var je=0;var im=jN;jf=gT.x+gs*im;je=gT.y+gr*im;var iX=0;var iV=0;var il=jm;iX=gT.x+gs*il;iV=gT.y+gr*il;var jX=gT.x;var jW=gT.y;var jb=0;var ja=0;jb=eJ-jX;ja=eI-jW;var j0=jb*jb+ja*ja;var gH=gQ.x;var gf=gQ.y;var i9=0;var iU=0;i9=eu-gH;iU=et-gf;var iu=i9*i9+iU*iU;var gG=fj.x;var gd=fj.y;var i8=0;var iT=0;i8=jf-gG;iT=je-gd;var hg=i8*i8+iT*iT;var gF=eX.x;var gb=eX.y;var i7=0;var iS=0;i7=iX-gF;iS=iV-gb;var gS=i7*i7+iS*iS;var eL=0;var eK=0;var fE=null;if(j0P.epsilon){jJ+=i1*ih;jI+=i0*ih}var ig=(-j7.tp0-iE)*hr;if(ig<-P.epsilon){jj+=i1*ig;jh+=i0*ig}var jY=jJ*j7.gnormx+jI*j7.gnormy-j7.gprojection;var jw=jj*j7.gnormx+jh*j7.gnormy-j7.gprojection;if(jY0){eC.slipped=true}if(gN<=0||iI=1){iQ=1;var kf=iQ*h7;var kk=kf-kp.sweepTime;if(kk!=0){kp.sweepTime=kf;kp.posx+=kp.velx*kk;kp.posy+=kp.vely*kk;if(kp.angvel!=0){var ez=kp.sweep_angvel*kk;kp.rot+=ez;if(ez*ez>0.0001){kp.axisx=Math.sin(kp.rot);kp.axisy=Math.cos(kp.rot)}else{var it=ez*ez;var hb=1-0.5*it;var hE=1-it*it/8;var gg=(hb*kp.axisx+ez*kp.axisy)*hE;kp.axisy=(hb*kp.axisy-ez*kp.axisx)*hE;kp.axisx=gg}}}if(gx.type==0){gx.worldCOMx=kp.posx+(kp.axisy*gx.localCOMx-kp.axisx*gx.localCOMy);gx.worldCOMy=kp.posy+(gx.localCOMx*kp.axisx+gx.localCOMy*kp.axisy)}else{var ha=gx.polygon;var gW=ha.lverts.next;var el=ha.gverts.next;while(el!=null){var iY=el;var hX=gW;gW=gW.next;iY.x=kp.posx+(kp.axisy*hX.x-kp.axisx*hX.y);iY.y=kp.posy+(hX.x*kp.axisx+hX.y*kp.axisy);el=el.next}var fL=ha.edges.head;var ej=ha.gverts.next;var fI=ej;ej=ej.next;while(ej!=null){var fw=ej;var jy=fL.elt;fL=fL.next;jy.gnormx=kp.axisy*jy.lnormx-kp.axisx*jy.lnormy;jy.gnormy=jy.lnormx*kp.axisx+jy.lnormy*kp.axisy;jy.gprojection=kp.posx*jy.gnormx+kp.posy*jy.gnormy+jy.lprojection;jy.tp0=fI.y*jy.gnormx-fI.x*jy.gnormy;jy.tp1=fw.y*jy.gnormx-fw.x*jy.gnormy;fI=fw;ej=ej.next}var fu=ha.gverts.next;var jv=fL.elt;jv.gnormx=kp.axisy*jv.lnormx-kp.axisx*jv.lnormy;jv.gnormy=jv.lnormx*kp.axisx+jv.lnormy*kp.axisy;jv.gprojection=kp.posx*jv.gnormx+kp.posy*jv.gnormy+jv.lprojection;jv.tp0=fI.y*jv.gnormx-fI.x*jv.gnormy;jv.tp1=fu.y*jv.gnormx-fu.x*jv.gnormy}var kd=iQ*h7;var kj=kd-ko.sweepTime;if(kj!=0){ko.sweepTime=kd;ko.posx+=ko.velx*kj;ko.posy+=ko.vely*kj;if(ko.angvel!=0){var ey=ko.sweep_angvel*kj;ko.rot+=ey;if(ey*ey>0.0001){ko.axisx=Math.sin(ko.rot);ko.axisy=Math.cos(ko.rot)}else{var ir=ey*ey;var g9=1-0.5*ir;var hB=1-ir*ir/8;var ge=(g9*ko.axisx+ey*ko.axisy)*hB;ko.axisy=(g9*ko.axisy-ey*ko.axisx)*hB;ko.axisx=ge}}}if(gv.type==0){gv.worldCOMx=ko.posx+(ko.axisy*gv.localCOMx-ko.axisx*gv.localCOMy);gv.worldCOMy=ko.posy+(gv.localCOMx*ko.axisx+gv.localCOMy*ko.axisy)}else{var g8=gv.polygon;var gU=g8.lverts.next;var eh=g8.gverts.next;while(eh!=null){var iW=eh;var hU=gU;gU=gU.next;iW.x=ko.posx+(ko.axisy*hU.x-ko.axisx*hU.y);iW.y=ko.posy+(hU.x*ko.axisx+hU.y*ko.axisy);eh=eh.next}var fK=g8.edges.head;var eg=g8.gverts.next;var fH=eg;eg=eg.next;while(eg!=null){var fs=eg;var jt=fK.elt;fK=fK.next;jt.gnormx=ko.axisy*jt.lnormx-ko.axisx*jt.lnormy;jt.gnormy=jt.lnormx*ko.axisx+jt.lnormy*ko.axisy;jt.gprojection=ko.posx*jt.gnormx+ko.posy*jt.gnormy+jt.lprojection;jt.tp0=fH.y*jt.gnormx-fH.x*jt.gnormy;jt.tp1=fs.y*jt.gnormx-fs.x*jt.gnormy;fH=fs;eg=eg.next}var fq=g8.gverts.next;var jq=fK.elt;jq.gnormx=ko.axisy*jq.lnormx-ko.axisx*jq.lnormy;jq.gnormy=jq.lnormx*ko.axisx+jq.lnormy*ko.axisy;jq.gprojection=ko.posx*jq.gnormx+ko.posy*jq.gnormy+jq.lprojection;jq.tp0=fH.y*jq.gnormx-fH.x*jq.gnormy;jq.tp1=fq.y*jq.gnormx-fq.x*jq.gnormy}var jM=gx;var jl=gv;var jE=ka;var jg=j9;var gw;if(gx.type==0&&gv.type==0){var j3=gx.circle;var jT=gv.circle;var ke;var gc=0;var fQ=0;gc=jT.worldCOMx-j3.worldCOMx;fQ=jT.worldCOMy-j3.worldCOMy;var fa=Math.sqrt(gc*gc+fQ*fQ);ke=fa-(j3.radius+jT.radius);if(ke<1e+100){if(fa==0){gc=1;fQ=0}else{var h9=1/fa;gc*=h9;fQ*=h9}var h4=j3.radius;ka.x=j3.worldCOMx+gc*h4;ka.y=j3.worldCOMy+fQ*h4;var h1=-jT.radius;j9.x=jT.worldCOMx+gc*h1;j9.y=jT.worldCOMy+fQ*h1;iH.x=gc;iH.y=fQ}gw=ke}else{var hL=false;if(gx.type==0&&gv.type==1){var gu=gx;jM=gv;jl=gu;var j2=ka;jE=j9;jg=j2;hL=true}if(jM.type==1&&jl.type==0){var iA=jM.polygon;var eH=jl.circle;var hm=-1e+100;var hp=null;var ee=iA.edges.head;while(ee!=null){var ek=ee.elt;var kc=ek.gnormx*eH.worldCOMx+ek.gnormy*eH.worldCOMy-ek.gprojection-eH.radius;if(kc>1e+100){hm=kc;break}if(kc>0){if(kc>hm){hm=kc;hp=ek}}else{if(hm<0&&kc>hm){hm=kc;hp=ek}}ee=ee.next}if(hm<1e+100){var fh=hp.gp0;var eW=hp.gp1;var kb=eH.worldCOMy*hp.gnormx-eH.worldCOMx*hp.gnormy;if(kb<=fh.y*hp.gnormx-fh.x*hp.gnormy){var ga=0;var fP=0;ga=eH.worldCOMx-fh.x;fP=eH.worldCOMy-fh.y;var e9=Math.sqrt(ga*ga+fP*fP);hm=e9-eH.radius;if(hm<1e+100){if(e9==0){ga=1;fP=0}else{var h0=1/e9;ga*=h0;fP*=h0}jE.x=fh.x+ga*0;jE.y=fh.y+fP*0;var hY=-eH.radius;jg.x=eH.worldCOMx+ga*hY;jg.y=eH.worldCOMy+fP*hY;iH.x=ga;iH.y=fP}}else{if(kb>=eW.y*hp.gnormx-eW.x*hp.gnormy){var f8=0;var fO=0;f8=eH.worldCOMx-eW.x;fO=eH.worldCOMy-eW.y;var e8=Math.sqrt(f8*f8+fO*fO);hm=e8-eH.radius;if(hm<1e+100){if(e8==0){f8=1;fO=0}else{var hW=1/e8;f8*=hW;fO*=hW}jE.x=eW.x+f8*0;jE.y=eW.y+fO*0;var hT=-eH.radius;jg.x=eH.worldCOMx+f8*hT;jg.y=eH.worldCOMy+fO*hT;iH.x=f8;iH.y=fO}}else{var hR=-eH.radius;jg.x=eH.worldCOMx+hp.gnormx*hR;jg.y=eH.worldCOMy+hp.gnormy*hR;var hQ=-hm;jE.x=jg.x+hp.gnormx*hQ;jE.y=jg.y+hp.gnormy*hQ;iH.x=hp.gnormx;iH.y=hp.gnormy}}}if(hL){iH.x=-iH.x;iH.y=-iH.y}gw=hm}else{var iy=jM.polygon;var h5=jl.polygon;var hl=-1e+100;var hi=null;var g0=null;var eD=0;var ec=iy.edges.head;while(ec!=null){var ei=ec.elt;var gn=1e+100;var eb=h5.gverts.next;while(eb!=null){var e0=eb;var ie=ei.gnormx*e0.x+ei.gnormy*e0.y;if(ie1e+100){hl=gn;break}if(gn>0){if(gn>hl){hl=gn;hi=ei;eD=1}}else{if(hl<0&&gn>hl){hl=gn;hi=ei;eD=1}}ec=ec.next}if(hl<1e+100){var ea=h5.edges.head;while(ea!=null){var ef=ea.elt;var gm=1e+100;var ks=iy.gverts.next;while(ks!=null){var eV=ks;var ic=ef.gnormx*eV.x+ef.gnormy*eV.y;if(ic1e+100){hl=gm;break}if(gm>0){if(gm>hl){hl=gm;g0=ef;eD=2}}else{if(hl<0&&gm>hl){hl=gm;g0=ef;eD=2}}ea=ea.next}if(hl<1e+100){var gK;var hN;if(eD==1){gK=h5;hN=hi}else{gK=iy;hN=g0;var gt=jE;jE=jg;jg=gt;hL=!hL}var hv=null;var gl=1e+100;var kr=gK.edges.head;while(kr!=null){var ed=kr.elt;var ia=hN.gnormx*ed.gnormx+hN.gnormy*ed.gnormy;if(ia=0){var fg=hN.gp0;var eT=hN.gp1;var hh=hv.gp0;var gV=hv.gp1;var fV=0;var fG=0;var hu=0;var hq=0;fV=eT.x-fg.x;fG=eT.y-fg.y;hu=gV.x-hh.x;hq=gV.y-hh.y;var j8=1/(fV*fV+fG*fG);var gp=1/(hu*hu+hq*hq);var ep=-(fV*(fg.x-hh.x)+fG*(fg.y-hh.y))*j8;var hP=-(fV*(fg.x-gV.x)+fG*(fg.y-gV.y))*j8;var jK=-(hu*(hh.x-fg.x)+hq*(hh.y-fg.y))*gp;var jk=-(hu*(hh.x-eT.x)+hq*(hh.y-eT.y))*gp;if(ep<0){ep=0}else{if(ep>1){ep=1}}if(hP<0){hP=0}else{if(hP>1){hP=1}}if(jK<0){jK=0}else{if(jK>1){jK=1}}if(jk<0){jk=0}else{if(jk>1){jk=1}}var j5=0;var jV=0;var hK=ep;j5=fg.x+fV*hK;jV=fg.y+fG*hK;var iF=0;var ix=0;var hJ=hP;iF=fg.x+fV*hJ;ix=fg.y+fG*hJ;var eP=0;var eA=0;var hI=jK;eP=hh.x+hu*hI;eA=hh.y+hq*hI;var ji=0;var i2=0;var hH=jk;ji=hh.x+hu*hH;i2=hh.y+hq*hH;var gE=hh.x;var f9=hh.y;var i6=0;var iR=0;i6=j5-gE;iR=jV-f9;var iD=i6*i6+iR*iR;var gD=gV.x;var f7=gV.y;var i5=0;var iP=0;i5=iF-gD;iP=ix-f7;var ip=i5*i5+iP*iP;var gC=fg.x;var f6=fg.y;var i4=0;var iO=0;i4=eP-gC;iO=eA-f6;var hd=i4*i4+iO*iO;var gA=eT.x;var f5=eT.y;var i3=0;var iN=0;i3=ji-gA;iN=i2-f5;var gO=i3*i3+iN*iN;var gL=0;var gI=0;var iM=null;if(iDP.epsilon){iJ+=ff*hC;iB+=eU*hC}var hz=(-hN.tp0-iC)*jx;if(hz<-P.epsilon){hk+=ff*hz;g7+=eU*hz}var ht=iJ*hN.gnormx+iB*hN.gnormy-hN.gprojection;var f3=hk*hN.gnormx+g7*hN.gnormy-hN.gprojection;if(ht0){eC.slipped=true}if(kn<=0||fo=40){if(iI>kq){eC.failed=true}break}}eC.toi=iQ};de.staticSweep=function(ey,hx,gy,jE){var gg=ey.s1;var ge=ey.s2;var jD=gg.body;var ja=0;var i8=0;ja=-jD.velx;i8=-jD.vely;var gC=jD.sweep_angvel;if(gC<0){gC=-gC}var fu=gg.sweepCoef*gC;var jt=ey.c1;var jr=ey.c2;var h2=ey.axis;var ib=gy;var eO=0;while(true){var iy=ib*hx;var et=iy-jD.sweepTime;if(et!=0){jD.sweepTime=iy;jD.posx+=jD.velx*et;jD.posy+=jD.vely*et;if(jD.angvel!=0){var iz=jD.sweep_angvel*et;jD.rot+=iz;if(iz*iz>0.0001){jD.axisx=Math.sin(jD.rot);jD.axisy=Math.cos(jD.rot)}else{var jh=iz*iz;var iU=1-0.5*jh;var iX=1-jh*jh/8;var gG=(iU*jD.axisx+iz*jD.axisy)*iX;jD.axisy=(iU*jD.axisy-iz*jD.axisx)*iX;jD.axisx=gG}}}if(gg.type==0){gg.worldCOMx=jD.posx+(jD.axisy*gg.localCOMx-jD.axisx*gg.localCOMy);gg.worldCOMy=jD.posy+(gg.localCOMx*jD.axisx+gg.localCOMy*jD.axisy)}else{var gM=gg.polygon;var gY=gM.lverts.next;var h1=gM.gverts.next;while(h1!=null){var i3=h1;var iY=gY;gY=gY.next;i3.x=jD.posx+(jD.axisy*iY.x-jD.axisx*iY.y);i3.y=jD.posy+(iY.x*jD.axisx+iY.y*jD.axisy);h1=h1.next}var hR=gM.edges.head;var fk=gM.gverts.next;var iM=fk;fk=fk.next;while(fk!=null){var iL=fk;var i6=hR.elt;hR=hR.next;i6.gnormx=jD.axisy*i6.lnormx-jD.axisx*i6.lnormy;i6.gnormy=i6.lnormx*jD.axisx+i6.lnormy*jD.axisy;i6.gprojection=jD.posx*i6.gnormx+jD.posy*i6.gnormy+i6.lprojection;i6.tp0=iM.y*i6.gnormx-iM.x*i6.gnormy;i6.tp1=iL.y*i6.gnormx-iL.x*i6.gnormy;iM=iL;fk=fk.next}var fq=gM.gverts.next;var iV=hR.elt;iV.gnormx=jD.axisy*iV.lnormx-jD.axisx*iV.lnormy;iV.gnormy=iV.lnormx*jD.axisx+iV.lnormy*jD.axisy;iV.gprojection=jD.posx*iV.gnormx+jD.posy*iV.gnormy+iV.lprojection;iV.tp0=iM.y*iV.gnormx-iM.x*iV.gnormy;iV.tp1=fq.y*iV.gnormx-fq.x*iV.gnormy}var i7=gg;var iJ=ge;var e5=jt;var e0=jr;var eT;if(gg.type==0&&ge.type==0){var jm=gg.circle;var jc=ge.circle;var hf;var f3=0;var gF=0;f3=jc.worldCOMx-jm.worldCOMx;gF=jc.worldCOMy-jm.worldCOMy;var gU=Math.sqrt(f3*f3+gF*gF);hf=gU-(jm.radius+jc.radius);if(hf<1e+100){if(gU==0){f3=1;gF=0}else{var iN=1/gU;f3*=iN;gF*=iN}var fP=jm.radius;jt.x=jm.worldCOMx+f3*fP;jt.y=jm.worldCOMy+gF*fP;var fN=-jc.radius;jr.x=jc.worldCOMx+f3*fN;jr.y=jc.worldCOMy+gF*fN;h2.x=f3;h2.y=gF}eT=hf}else{var iS=false;if(gg.type==0&&ge.type==1){var gk=gg;i7=ge;iJ=gk;var gi=jt;e5=jr;e0=gi;iS=true}if(i7.type==1&&iJ.type==0){var fy=i7.polygon;var ht=iJ.circle;var fK=-1e+100;var eq=null;var fi=fy.edges.head;while(fi!=null){var i9=fi.elt;var jx=i9.gnormx*ht.worldCOMx+i9.gnormy*ht.worldCOMy-i9.gprojection-ht.radius;if(jx>1e+100){fK=jx;break}if(jx>0){if(jx>fK){fK=jx;eq=i9}}else{if(fK<0&&jx>fK){fK=jx;eq=i9}}fi=fi.next}if(fK<1e+100){var fr=eq.gp0;var eU=eq.gp1;var jz=ht.worldCOMy*eq.gnormx-ht.worldCOMx*eq.gnormy;if(jz<=fr.y*eq.gnormx-fr.x*eq.gnormy){var f2=0;var fD=0;f2=ht.worldCOMx-fr.x;fD=ht.worldCOMy-fr.y;var eZ=Math.sqrt(f2*f2+fD*fD);fK=eZ-ht.radius;if(fK<1e+100){if(eZ==0){f2=1;fD=0}else{var fM=1/eZ;f2*=fM;fD*=fM}e5.x=fr.x+f2*0;e5.y=fr.y+fD*0;var fL=-ht.radius;e0.x=ht.worldCOMx+f2*fL;e0.y=ht.worldCOMy+fD*fL;h2.x=f2;h2.y=fD}}else{if(jz>=eU.y*eq.gnormx-eU.x*eq.gnormy){var f1=0;var fC=0;f1=ht.worldCOMx-eU.x;fC=ht.worldCOMy-eU.y;var eY=Math.sqrt(f1*f1+fC*fC);fK=eY-ht.radius;if(fK<1e+100){if(eY==0){f1=1;fC=0}else{var fJ=1/eY;f1*=fJ;fC*=fJ}e5.x=eU.x+f1*0;e5.y=eU.y+fC*0;var fI=-ht.radius;e0.x=ht.worldCOMx+f1*fI;e0.y=ht.worldCOMy+fC*fI;h2.x=f1;h2.y=fC}}else{var fG=-ht.radius;e0.x=ht.worldCOMx+eq.gnormx*fG;e0.y=ht.worldCOMy+eq.gnormy*fG;var fF=-fK;e5.x=e0.x+eq.gnormx*fF;e5.y=e0.y+eq.gnormy*fF;h2.x=eq.gnormx;h2.y=eq.gnormy}}}if(iS){h2.x=-h2.x;h2.y=-h2.y}eT=fK}else{var hU=i7.polygon;var gL=iJ.polygon;var gT=-1e+100;var ep=null;var eo=null;var gE=0;var fh=hU.edges.head;while(fh!=null){var em=fh.elt;var eA=1e+100;var fg=gL.gverts.next;while(fg!=null){var fp=fg;var iZ=em.gnormx*fp.x+em.gnormy*fp.y;if(iZ1e+100){gT=eA;break}if(eA>0){if(eA>gT){gT=eA;ep=em;gE=1}}else{if(gT<0&&eA>gT){gT=eA;ep=em;gE=1}}fh=fh.next}if(gT<1e+100){var fe=gL.edges.head;while(fe!=null){var el=fe.elt;var f9=1e+100;var fd=hU.gverts.next;while(fd!=null){var fo=fd;var hJ=el.gnormx*fo.x+el.gnormy*fo.y;if(hJ1e+100){gT=f9;break}if(f9>0){if(f9>gT){gT=f9;eo=el;gE=2}}else{if(gT<0&&f9>gT){gT=f9;eo=el;gE=2}}fe=fe.next}if(gT<1e+100){var gv;var jp;if(gE==1){gv=gL;jp=ep}else{gv=hU;jp=eo;var gh=e5;e5=e0;e0=gh;iS=!iS}var jo=null;var f7=1e+100;var fc=gv.edges.head;while(fc!=null){var ek=fc.elt;var hH=jp.gnormx*ek.gnormx+jp.gnormy*ek.gnormy;if(hH=0){var fa=jp.gp0;var eS=jp.gp1;var gz=jo.gp0;var gx=jo.gp1;var eK=0;var eJ=0;var gb=0;var ga=0;eK=eS.x-fa.x;eJ=eS.y-fa.y;gb=gx.x-gz.x;ga=gx.y-gz.y;var iK=1/(eK*eK+eJ*eJ);var eB=1/(gb*gb+ga*ga);var hM=-(eK*(fa.x-gz.x)+eJ*(fa.y-gz.y))*iK;var hu=-(eK*(fa.x-gx.x)+eJ*(fa.y-gx.y))*iK;var i5=-(gb*(gz.x-fa.x)+ga*(gz.y-fa.y))*eB;var iI=-(gb*(gz.x-eS.x)+ga*(gz.y-eS.y))*eB;if(hM<0){hM=0}else{if(hM>1){hM=1}}if(hu<0){hu=0}else{if(hu>1){hu=1}}if(i5<0){i5=0}else{if(i5>1){i5=1}}if(iI<0){iI=0}else{if(iI>1){iI=1}}var eF=0;var eE=0;var fE=hM;eF=fa.x+eK*fE;eE=fa.y+eJ*fE;var es=0;var er=0;var hN=hu;es=fa.x+eK*hN;er=fa.y+eJ*hN;var iB=0;var iA=0;var hL=i5;iB=gz.x+gb*hL;iA=gz.y+ga*hL;var ii=0;var ih=0;var hK=iI;ii=gz.x+gb*hK;ih=gz.y+ga*hK;var jf=gz.x;var je=gz.y;var ix=0;var iw=0;ix=eF-jf;iw=eE-je;var ji=ix*ix+iw*iw;var gq=gx.x;var fY=gx.y;var iv=0;var ig=0;iv=es-gq;ig=er-fY;var hQ=iv*iv+ig*ig;var gp=fa.x;var fW=fa.y;var iu=0;var ie=0;iu=iB-gp;ie=iA-fW;var gN=iu*iu+ie*ie;var go=eS.x;var fU=eS.y;var it=0;var id=0;it=ii-go;id=ih-fU;var iT=it*it+id*id;var eH=0;var eG=0;var ft=null;if(jiP.epsilon){i1+=il*hG;i0+=ik*hG}var hE=(-jp.tp0-hZ)*gX;if(hE<-P.epsilon){iE+=il*hE;iD+=ik*hE}var jg=i1*jp.gnormx+i0*jp.gnormy-jp.gprojection;var iO=iE*jp.gnormx+iD*jp.gnormy-jp.gprojection;if(jg0){ey.slipped=true}if(gu<=0||h3=1){ib=1;var jy=ib*hx;var jA=jy-jD.sweepTime;if(jA!=0){jD.sweepTime=jy;jD.posx+=jD.velx*jA;jD.posy+=jD.vely*jA;if(jD.angvel!=0){var ew=jD.sweep_angvel*jA;jD.rot+=ew;if(ew*ew>0.0001){jD.axisx=Math.sin(jD.rot);jD.axisy=Math.cos(jD.rot)}else{var hP=ew*ew;var gJ=1-0.5*hP;var g9=1-hP*hP/8;var f0=(gJ*jD.axisx+ew*jD.axisy)*g9;jD.axisy=(gJ*jD.axisy-ew*jD.axisx)*g9;jD.axisx=f0}}}if(gg.type==0){gg.worldCOMx=jD.posx+(jD.axisy*gg.localCOMx-jD.axisx*gg.localCOMy);gg.worldCOMy=jD.posy+(gg.localCOMx*jD.axisx+gg.localCOMy*jD.axisy)}else{var gI=gg.polygon;var gB=gI.lverts.next;var fb=gI.gverts.next;while(fb!=null){var ij=fb;var hq=gB;gB=gB.next;ij.x=jD.posx+(jD.axisy*hq.x-jD.axisx*hq.y);ij.y=jD.posy+(hq.x*jD.axisx+hq.y*jD.axisy);fb=fb.next}var fx=gI.edges.head;var e9=gI.gverts.next;var fw=e9;e9=e9.next;while(e9!=null){var fn=e9;var iR=fx.elt;fx=fx.next;iR.gnormx=jD.axisy*iR.lnormx-jD.axisx*iR.lnormy;iR.gnormy=iR.lnormx*jD.axisx+iR.lnormy*jD.axisy;iR.gprojection=jD.posx*iR.gnormx+jD.posy*iR.gnormy+iR.lprojection;iR.tp0=fw.y*iR.gnormx-fw.x*iR.gnormy;iR.tp1=fn.y*iR.gnormx-fn.x*iR.gnormy;fw=fn;e9=e9.next}var fm=gI.gverts.next;var iQ=fx.elt;iQ.gnormx=jD.axisy*iQ.lnormx-jD.axisx*iQ.lnormy;iQ.gnormy=iQ.lnormx*jD.axisx+iQ.lnormy*jD.axisy;iQ.gprojection=jD.posx*iQ.gnormx+jD.posy*iQ.gnormy+iQ.lprojection;iQ.tp0=fw.y*iQ.gnormx-fw.x*iQ.gnormy;iQ.tp1=fm.y*iQ.gnormx-fm.x*iQ.gnormy}var i4=gg;var iH=ge;var iW=jt;var iC=jr;var gf;if(gg.type==0&&ge.type==0){var jl=gg.circle;var jb=ge.circle;var jv;var fZ=0;var fB=0;fZ=jb.worldCOMx-jl.worldCOMx;fB=jb.worldCOMy-jl.worldCOMy;var eX=Math.sqrt(fZ*fZ+fB*fB);jv=eX-(jl.radius+jb.radius);if(jv<1e+100){if(eX==0){fZ=1;fB=0}else{var hz=1/eX;fZ*=hz;fB*=hz}var hv=jl.radius;jt.x=jl.worldCOMx+fZ*hv;jt.y=jl.worldCOMy+fB*hv;var hs=-jb.radius;jr.x=jb.worldCOMx+fZ*hs;jr.y=jb.worldCOMy+fB*hs;h2.x=fZ;h2.y=fB}gf=jv}else{var he=false;if(gg.type==0&&ge.type==1){var gd=gg;i4=ge;iH=gd;var jk=jt;iW=jr;iC=jk;he=true}if(i4.type==1&&iH.type==0){var hV=i4.polygon;var eD=iH.circle;var gS=-1e+100;var gV=null;var ej=hV.edges.head;while(ej!=null){var ei=ej.elt;var ju=ei.gnormx*eD.worldCOMx+ei.gnormy*eD.worldCOMy-ei.gprojection-eD.radius;if(ju>1e+100){gS=ju;break}if(ju>0){if(ju>gS){gS=ju;gV=ei}}else{if(gS<0&&ju>gS){gS=ju;gV=ei}}ej=ej.next}if(gS<1e+100){var e8=gV.gp0;var eR=gV.gp1;var jw=eD.worldCOMy*gV.gnormx-eD.worldCOMx*gV.gnormy;if(jw<=e8.y*gV.gnormx-e8.x*gV.gnormy){var fX=0;var fA=0;fX=eD.worldCOMx-e8.x;fA=eD.worldCOMy-e8.y;var eW=Math.sqrt(fX*fX+fA*fA);gS=eW-eD.radius;if(gS<1e+100){if(eW==0){fX=1;fA=0}else{var hr=1/eW;fX*=hr;fA*=hr}iW.x=e8.x+fX*0;iW.y=e8.y+fA*0;var hp=-eD.radius;iC.x=eD.worldCOMx+fX*hp;iC.y=eD.worldCOMy+fA*hp;h2.x=fX;h2.y=fA}}else{if(jw>=eR.y*gV.gnormx-eR.x*gV.gnormy){var fV=0;var fz=0;fV=eD.worldCOMx-eR.x;fz=eD.worldCOMy-eR.y;var eV=Math.sqrt(fV*fV+fz*fz);gS=eV-eD.radius;if(gS<1e+100){if(eV==0){fV=1;fz=0}else{var ho=1/eV;fV*=ho;fz*=ho}iW.x=eR.x+fV*0;iW.y=eR.y+fz*0;var hm=-eD.radius;iC.x=eD.worldCOMx+fV*hm;iC.y=eD.worldCOMy+fz*hm;h2.x=fV;h2.y=fz}}else{var hk=-eD.radius;iC.x=eD.worldCOMx+gV.gnormx*hk;iC.y=eD.worldCOMy+gV.gnormy*hk;var hj=-gS;iW.x=iC.x+gV.gnormx*hj;iW.y=iC.y+gV.gnormy*hj;h2.x=gV.gnormx;h2.y=gV.gnormy}}}if(he){h2.x=-h2.x;h2.y=-h2.y}gf=gS}else{var hT=i4.polygon;var hw=iH.polygon;var gR=-1e+100;var gP=null;var gD=null;var ez=0;var eh=hT.edges.head;while(eh!=null){var eg=eh.elt;var f6=1e+100;var ef=hw.gverts.next;while(ef!=null){var fl=ef;var hF=eg.gnormx*fl.x+eg.gnormy*fl.y;if(hF1e+100){gR=f6;break}if(f6>0){if(f6>gR){gR=f6;gP=eg;ez=1}}else{if(gR<0&&f6>gR){gR=f6;gP=eg;ez=1}}eh=eh.next}if(gR<1e+100){var ed=hw.edges.head;while(ed!=null){var ee=ed.elt;var f5=1e+100;var ec=hT.gverts.next;while(ec!=null){var fj=ec;var hD=ee.gnormx*fj.x+ee.gnormy*fj.y;if(hD1e+100){gR=f5;break}if(f5>0){if(f5>gR){gR=f5;gD=ee;ez=2}}else{if(gR<0&&f5>gR){gR=f5;gD=ee;ez=2}}ed=ed.next}if(gR<1e+100){var gs;var hg;if(ez==1){gs=hw;hg=gP}else{gs=hT;hg=gD;var gc=iW;iW=iC;iC=gc;he=!he}var g2=null;var f4=1e+100;var ea=gs.edges.head;while(ea!=null){var eb=ea.elt;var hB=hg.gnormx*eb.gnormx+hg.gnormy*eb.gnormy;if(hB=0){var e7=hg.gp0;var eQ=hg.gp1;var gO=g2.gp0;var gA=g2.gp1;var fH=0;var fv=0;var g0=0;var gW=0;fH=eQ.x-e7.x;fv=eQ.y-e7.y;g0=gA.x-gO.x;gW=gA.y-gO.y;var jq=1/(fH*fH+fv*fv);var f8=1/(g0*g0+gW*gW);var en=-(fH*(e7.x-gO.x)+fv*(e7.y-gO.y))*jq;var hi=-(fH*(e7.x-gA.x)+fv*(e7.y-gA.y))*jq;var i2=-(g0*(gO.x-e7.x)+gW*(gO.y-e7.y))*f8;var iG=-(g0*(gO.x-eQ.x)+gW*(gO.y-eQ.y))*f8;if(en<0){en=0}else{if(en>1){en=1}}if(hi<0){hi=0}else{if(hi>1){hi=1}}if(i2<0){i2=0}else{if(i2>1){i2=1}}if(iG<0){iG=0}else{if(iG>1){iG=1}}var jn=0;var jd=0;var hd=en;jn=e7.x+fH*hd;jd=e7.y+fv*hd;var h0=0;var hS=0;var hc=hi;h0=e7.x+fH*hc;hS=e7.y+fv*hc;var eL=0;var ex=0;var hb=i2;eL=gO.x+g0*hb;ex=gO.y+gW*hb;var iF=0;var im=0;var ha=iG;iF=gO.x+g0*ha;im=gO.y+gW*ha;var gn=gO.x;var fT=gO.y;var ir=0;var ic=0;ir=jn-gn;ic=jd-fT;var hY=ir*ir+ic*ic;var gm=gA.x;var fS=gA.y;var iq=0;var ia=0;iq=h0-gm;ia=hS-fS;var hO=iq*iq+ia*ia;var gl=e7.x;var fR=e7.y;var ip=0;var h9=0;ip=eL-gl;h9=ex-fR;var gK=ip*ip+h9*h9;var gj=eQ.x;var fQ=eQ.y;var io=0;var h8=0;io=iF-gj;h8=im-fQ;var gw=io*io+h8*h8;var gt=0;var gr=0;var h7=null;if(hYP.epsilon){h4+=e6*g7;hW+=eP*g7}var g6=(-hg.tp0-hX)*iP;if(g6<-P.epsilon){gQ+=e6*g6;gH+=eP*g6}var gZ=h4*hg.gnormx+hW*hg.gnormy-hg.gprojection;var fO=gQ*hg.gnormx+gH*hg.gnormy-hg.gprojection;if(gZ0){ey.slipped=true}if(jC<=0||ff=40){if(h3>jE){ey.failed=true}break}}ey.toi=ib};de.distanceBody=function(gu,gt,eI,eH){var fu;if(bB.zpp_pool==null){fu=new bB()}else{fu=bB.zpp_pool;bB.zpp_pool=fu.next;fu.next=null}fu.weak=false;var ft;if(bB.zpp_pool==null){ft=new bB()}else{ft=bB.zpp_pool;bB.zpp_pool=ft.next;ft.next=null}ft.weak=false;var gh;if(bB.zpp_pool==null){gh=new bB()}else{gh=bB.zpp_pool;bB.zpp_pool=gh.next;gh.next=null}gh.weak=false;var fQ=1e+100;var eo=gu.shapes.head;while(eo!=null){var fC=eo.elt;var e0=gt.shapes.head;while(e0!=null){var fB=e0.elt;var fa=fC;var eQ=fB;var e6=fu;var eG=ft;var fF;if(fC.type==0&&fB.type==0){var gp=fC.circle;var go=fB.circle;var fw;var f5=0;var f4=0;f5=go.worldCOMx-gp.worldCOMx;f4=go.worldCOMy-gp.worldCOMy;var fA=Math.sqrt(f5*f5+f4*f4);fw=fA-(gp.radius+go.radius);if(fwfQ){eB=fv;break}if(fv>0){if(fv>eB){eB=fv;ef=fV}}else{if(eB<0&&fv>eB){eB=fv;ef=fV}}eZ=eZ.next}if(eB=e7.y*ef.gnormx-e7.x*ef.gnormy){var ep=0;var eh=0;ep=ey.worldCOMx-e7.x;eh=ey.worldCOMy-e7.y;var gv=Math.sqrt(ep*ep+eh*eh);eB=gv-ey.radius;if(eBfQ){ex=el;break}if(el>0){if(el>ex){ex=el;ee=ec;eg=1}}else{if(ex<0&&el>ex){ex=el;ee=ec;eg=1}}eY=eY.next}if(exfQ){ex=ek;break}if(ek>0){if(ek>ex){ex=ek;ed=eb;eg=2}}else{if(ex<0&&ek>ex){ex=ek;ed=eb;eg=2}}eV=eV.next}if(ex=0){var gs=f0.gp0;var gd=f0.gp1;var fU=gf.gp0;var fT=gf.gp1;var en=0;var em=0;var fz=0;var fy=0;en=gd.x-gs.x;em=gd.y-gs.y;fz=fT.x-fU.x;fy=fT.y-fU.y;var fe=1/(en*en+em*em);var eX=1/(fz*fz+fy*fy);var gm=-(en*(gs.x-fU.x)+em*(gs.y-fU.y))*fe;var fY=-(en*(gs.x-fT.x)+em*(gs.y-fT.y))*fe;var e9=-(fz*(fU.x-gs.x)+fy*(fU.y-gs.y))*eX;var eP=-(fz*(fU.x-gd.x)+fy*(fU.y-gd.y))*eX;if(gm<0){gm=0}else{if(gm>1){gm=1}}if(fY<0){fY=0}else{if(fY>1){fY=1}}if(e9<0){e9=0}else{if(e9>1){e9=1}}if(eP<0){eP=0}else{if(eP>1){eP=1}}var f7=0;var f6=0;var gl=gm;f7=gs.x+en*gl;f6=gs.y+em*gl;var fO=0;var fN=0;var gk=fY;fO=gs.x+en*gk;fN=gs.y+em*gk;var eT=0;var eR=0;var gj=e9;eT=fU.x+fz*gj;eR=fU.y+fy*gj;var eA=0;var ez=0;var gi=eP;eA=fU.x+fz*gi;ez=fU.y+fy*gi;var fX=fU.x;var fW=fU.y;var fE=0;var fD=0;fE=f7-fX;fD=f6-fW;var f2=fE*fE+fD*fD;var eO=fT.x;var ew=fT.y;var eL=0;var et=0;eL=fO-eO;et=fN-ew;var f1=eL*eL+et*et;var eN=gs.x;var ev=gs.y;var eK=0;var es=0;eK=eT-eN;es=eR-ev;var fL=eK*eK+es*es;var eM=gd.x;var eu=gd.y;var eJ=0;var er=0;eJ=eA-eM;er=ez-eu;var fJ=eJ*eJ+er*er;var fi=0;var fh=0;var gy=null;if(f2P.epsilon){fg+=eF*ge;ff+=eE*ge}var gc=(-f0.tp0-gz)*fH;if(gc<-P.epsilon){e4+=eF*gc;e3+=eE*gc}var fk=fg*f0.gnormx+ff*f0.gnormy-f0.gprojection;var fd=e4*f0.gnormx+e3*f0.gnormy-f0.gprojection;if(fkfZ){ez=eV;break}if(eV>0){if(eV>ez){ez=eV;ea=fv}}else{if(ez<0&&eV>ez){ez=eV;ea=fv}}fW=fW.next}if(ez=fL.y*ea.gnormx-fL.x*ea.gnormy){var f0=0;var fT=0;f0=fq.worldCOMx-fL.x;fT=fq.worldCOMy-fL.y;var fB=Math.sqrt(f0*f0+fT*fT);ez=fB-fq.radius;if(ezfZ){fu=ge;break}if(ge>0){if(ge>fu){fu=ge;gl=gj;eS=1}}else{if(fu<0&&ge>fu){fu=ge;gl=gj;eS=1}}fP=fP.next}if(fufZ){fu=fo;break}if(fo>0){if(fo>fu){fu=fo;gk=gi;eS=2}}else{if(fu<0&&fo>fu){fu=fo;gk=gi;eS=2}}fM=fM.next}if(fu=0){var e3=fR.gp0;var es=fR.gp1;var fi=fQ.gp0;var fh=fQ.gp1;var e0=0;var eZ=0;var ei=0;var eh=0;e0=es.x-e3.x;eZ=es.y-e3.y;ei=fh.x-fi.x;eh=fh.y-fi.y;var e7=1/(e0*e0+eZ*eZ);var eU=1/(ei*ei+eh*eh);var eI=-(e0*(e3.x-fi.x)+eZ*(e3.y-fi.y))*e7;var gh=-(e0*(e3.x-fh.x)+eZ*(e3.y-fh.y))*e7;var eO=-(ei*(fi.x-e3.x)+eh*(fi.y-e3.y))*eU;var ed=-(ei*(fi.x-es.x)+eh*(fi.y-es.y))*eU;if(eI<0){eI=0}else{if(eI>1){eI=1}}if(gh<0){gh=0}else{if(gh>1){gh=1}}if(eO<0){eO=0}else{if(eO>1){eO=1}}if(ed<0){ed=0}else{if(ed>1){ed=1}}var eY=0;var eW=0;var f2=eI;eY=e3.x+e0*f2;eW=e3.y+eZ*f2;var el=0;var ej=0;var eJ=gh;el=e3.x+e0*eJ;ej=e3.y+eZ*eJ;var eR=0;var eN=0;var eH=eO;eR=fi.x+ei*eH;eN=fi.y+eh*eH;var ef=0;var ec=0;var eF=ed;ef=fi.x+ei*eF;ec=fi.y+eh*eF;var fs=fi.x;var fp=fi.y;var eG=0;var eE=0;eG=eY-fs;eE=eW-fp;var fx=eG*eG+eE*eE;var eT=fh.x;var eg=fh.y;var eB=0;var gf=0;eB=el-eT;gf=ej-eg;var fw=eB*eB+gf*gf;var eQ=e3.x;var ee=e3.y;var ey=0;var gd=0;ey=eR-eQ;gd=eN-ee;var e9=ey*ey+gd*gd;var eM=es.x;var eb=es.y;var ew=0;var gc=0;ew=ef-eM;gc=ec-eb;var e8=ew*ew+gc*gc;var fF=0;var fD=0;var eu=null;if(fxP.epsilon){ft+=eo*eA;fr+=em*eA}var ex=(-fR.tp0-fU)*f5;if(ex<-P.epsilon){e6+=eo*ex;e5+=em*ex}var fH=ft*fR.gnormx+fr*fR.gnormy-fR.gprojection;var fj=e6*fR.gnormx+e5*fR.gnormy-fR.gprojection;if(fH=ea.id){if(eb.id==ea.id){return eb.di0&&ea.next!=null){this.erase(ea)}return ea.next};k.prototype.clear=function(){};k.prototype.inlined_clear=function(){};k.prototype.reverse=function(){var ec=this.next;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.next=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};k.prototype.empty=function(){return this.next==null};k.prototype.size=function(){return this.length};k.prototype.has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};k.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};k.prototype.front=function(){return this.next};k.prototype.back=function(){var ea=this.next;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea};k.prototype.iterator_at=function(eb){var ea=this.next;while(eb-->0&&ea!=null){ea=ea.next}return ea};k.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea}else{return null}};k.prototype.free=function(){this.a=this.b=null;this.node=null};k.prototype.alloc=function(){};k.prototype.a=null;k.prototype.b=null;k.prototype.id=null;k.prototype.di=null;k.prototype.node=null;k.prototype.__class__=k;var z=zpp_nape.geom.ZPP_Triangular=function(){};z.__name__=["zpp_nape","geom","ZPP_Triangular"];z.lt=function(eb,ea){if(!(eb.y=0)){ed=ea.x-ec.x;eb=ea.y-ec.y;ek=ec.x-ee.x;ej=ec.y-ee.y;eg=ej*ed-ek*eb>=0}else{eg=true}if(!eg){ed=ef.x-ea.x;eb=ef.y-ea.y;ek=ea.x-ec.x;ej=ea.y-ec.y;eh=ej*ed-ek*eb>=0}else{eh=true}if(!eh){ed=ee.x-ef.x;eb=ee.y-ef.y;ek=ef.x-ea.x;ej=ef.y-ea.y;ei=ej*ed-ek*eb>=0}else{ei=true}if(ei){return true}return ee.x*(ec.y*ea.mag-ec.mag*ea.y)-ec.x*(ee.y*ea.mag-ee.mag*ea.y)+ea.x*(ee.y*ec.mag-ee.mag*ec.y)-(ef.x*(ec.y*ea.mag-ec.mag*ea.y)-ec.x*(ef.y*ea.mag-ef.mag*ea.y)+ea.x*(ef.y*ec.mag-ef.mag*ec.y))+(ef.x*(ee.y*ea.mag-ee.mag*ea.y)-ee.x*(ef.y*ea.mag-ef.mag*ea.y)+ea.x*(ef.y*ee.mag-ef.mag*ee.y))-(ef.x*(ee.y*ec.mag-ee.mag*ec.y)-ee.x*(ef.y*ec.mag-ef.mag*ec.y)+ec.x*(ef.y*ee.mag-ef.mag*ee.y))>0};z.optimise=function(ee){var eh=ee.vertices;var ef=ee.vertices;if(eh!=null){var ew=eh;while(true){var eq=ew;eq.sort();eq.mag=eq.x*eq.x+eq.y*eq.y;ew=ew.next;if(!(ew!=ef)){break}}}if(z.edgeSet==null){if(am.zpp_pool==null){z.edgeSet=new am()}else{z.edgeSet=am.zpp_pool;am.zpp_pool=z.edgeSet.next;z.edgeSet.next=null}z.edgeSet.lt=k.edge_lt;z.edgeSet.swapped=k.edge_swap}var eu;if(k.zpp_pool==null){eu=new k()}else{eu=k.zpp_pool;k.zpp_pool=eu.next;eu.next=null}var ev=ee.vertices;var ex=ee.vertices;if(ev!=null){var ea=ev;while(true){var ec=ea;var eg=ec.next;ec.diagonals.reverse();var et=ec.diagonals.head;while(et!=null){var en=et.elt;if(en.id=0||!eb.rightchain&&et<=0){break}ef.add_diagonal(ec,eb);em=ec;z.stack.pop()}z.stack.add(em)}z.stack.add(eb);eo=eb}if(z.stack.head!=null){z.stack.pop();while(z.stack.head!=null){var ea=z.stack.pop_unsafe();if(z.stack.head==null){break}ef.add_diagonal(er,ea)}}return ef};z.prototype.__class__=z;var bB=zpp_nape.geom.ZPP_Vec2=function(){this.y=0;this.x=0;this.length=0;this.pushmod=false;this.modified=false;this._inuse=false;this.next=null;this.weak=false;this.outer=null;this._isimmutable=null;this._immutable=false;this._validate=null;this._invalidate=null};bB.__name__=["zpp_nape","geom","ZPP_Vec2"];bB.get=function(ea,ed,ec){if(ec==null){ec=false}var eb;if(bB.zpp_pool==null){eb=new bB()}else{eb=bB.zpp_pool;bB.zpp_pool=eb.next;eb.next=null}eb.weak=false;eb._immutable=ec;eb.x=ea;eb.y=ed;return eb};bB.prototype._invalidate=null;bB.prototype._validate=null;bB.prototype.validate=function(){if(this._validate!=null){this._validate()}};bB.prototype.invalidate=function(){if(this._invalidate!=null){this._invalidate(this)}};bB.prototype._immutable=null;bB.prototype._isimmutable=null;bB.prototype.immutable=function(){};bB.prototype.outer=null;bB.prototype.wrapper=function(){if(this.outer==null){this.outer=new r();var ea=this.outer.zpp_inner;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea._isimmutable=null;ea._validate=null;ea._invalidate=null;ea.next=bB.zpp_pool;bB.zpp_pool=ea;this.outer.zpp_inner=this}return this.outer};bB.prototype.weak=null;bB.prototype.free=function(){if(this.outer!=null){this.outer.zpp_inner=null;this.outer=null}this._isimmutable=null;this._validate=null;this._invalidate=null};bB.prototype.alloc=function(){this.weak=false};bB.prototype.next=null;bB.prototype.elem=function(){return this};bB.prototype.begin=function(){return this.next};bB.prototype._inuse=null;bB.prototype.modified=null;bB.prototype.pushmod=null;bB.prototype.length=null;bB.prototype.setbegin=function(ea){this.next=ea;this.modified=true;this.pushmod=true};bB.prototype.add=function(ea){ea._inuse=true;ea.next=this.next;this.next=ea;this.modified=true;this.length++;return ea};bB.prototype.inlined_add=function(ea){ea._inuse=true;ea.next=this.next;this.next=ea;this.modified=true;this.length++;return ea};bB.prototype.addAll=function(ea){var eb=ea.next;while(eb!=null){this.add(eb);eb=eb.next}};bB.prototype.insert=function(eb,ea){ea._inuse=true;if(eb==null){ea.next=this.next;this.next=ea}else{ea.next=eb.next;eb.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bB.prototype.inlined_insert=function(eb,ea){ea._inuse=true;if(eb==null){ea.next=this.next;this.next=ea}else{ea.next=eb.next;eb.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bB.prototype.pop=function(){var ea=this.next;this.next=ea.next;ea._inuse=false;if(this.next==null){this.pushmod=true}this.modified=true;this.length--};bB.prototype.inlined_pop=function(){var ea=this.next;this.next=ea.next;ea._inuse=false;if(this.next==null){this.pushmod=true}this.modified=true;this.length--};bB.prototype.pop_unsafe=function(){var ea=this.next;this.pop();return ea};bB.prototype.inlined_pop_unsafe=function(){var ea=this.next;this.pop();return ea};bB.prototype.remove=function(ed){var ec=null;var ee=this.next;while(ee!=null){if(ee==ed){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;break}ec=ee;ee=ee.next}};bB.prototype.try_remove=function(ec){var eb=null;var ed=this.next;var ea=false;while(ed!=null){if(ed==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bB.prototype.inlined_remove=function(ed){var ec=null;var ee=this.next;while(ee!=null){if(ee==ed){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;break}ec=ee;ee=ee.next}};bB.prototype.inlined_try_remove=function(ee){var ed=null;var ef=this.next;var eb=false;while(ef!=null){if(ef==ee){var ea;var ec;if(ed==null){ea=this.next;ec=ea.next;this.next=ec;if(this.next==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=ef;ef=ef.next}return eb};bB.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;return eb};bB.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.next;eb=ea.next;this.next=eb;if(this.next==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}ea._inuse=false;this.modified=true;this.length--;this.pushmod=true;return eb};bB.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bB.prototype.clear=function(){};bB.prototype.inlined_clear=function(){};bB.prototype.reverse=function(){var ec=this.next;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.next=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bB.prototype.empty=function(){return this.next==null};bB.prototype.size=function(){return this.length};bB.prototype.has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};bB.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};bB.prototype.front=function(){return this.next};bB.prototype.back=function(){var ea=this.next;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea};bB.prototype.iterator_at=function(eb){var ea=this.next;while(eb-->0&&ea!=null){ea=ea.next}return ea};bB.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea}else{return null}};bB.prototype.x=null;bB.prototype.y=null;bB.prototype.copy=function(){var ea=this.x;var ec=this.y;var eb;if(bB.zpp_pool==null){eb=new bB()}else{eb=bB.zpp_pool;bB.zpp_pool=eb.next;eb.next=null}eb.weak=false;eb._immutable=false;eb.x=ea;eb.y=ec;return eb};bB.prototype.toString=function(){return"{ x: "+this.x+" y: "+this.y+" }"};bB.prototype.__class__=bB;var bA=zpp_nape.geom.ZPP_Vec3=function(){this._validate=null;this.immutable=false;this.z=0;this.y=0;this.x=0;this.outer=null;this.immutable=false;this._validate=null};bA.__name__=["zpp_nape","geom","ZPP_Vec3"];bA.prototype.outer=null;bA.prototype.x=null;bA.prototype.y=null;bA.prototype.z=null;bA.prototype.immutable=null;bA.prototype._validate=null;bA.prototype.validate=function(){if(this._validate!=null){this._validate()}};bA.prototype.__class__=bA;var c9=zpp_nape.geom.ZPP_VecMath=function(){};c9.__name__=["zpp_nape","geom","ZPP_VecMath"];c9.vec_dsq=function(ed,ec,ef,ee){var eb=0;var ea=0;eb=ed-ef;ea=ec-ee;return eb*eb+ea*ea};c9.vec_distance=function(ed,ec,ef,ee){var eb=0;var ea=0;eb=ed-ef;ea=ec-ee;return Math.sqrt(eb*eb+ea*ea)};c9.prototype.__class__=c9;var dM=zpp_nape.phys.ZPP_Interactor=function(){this.wrap_cbTypes=null;this.cbSet=null;this.cbTypes=null;this.group=null;this.cbsets=null;this.icompound=null;this.ibody=null;this.ishape=null;this.userData=null;this.id=0;this.outer_i=null;this.id=cr.Interactor();this.cbsets=new dF();this.cbTypes=new x()};dM.__name__=["zpp_nape","phys","ZPP_Interactor"];dM.get=function(eg,ee){var eh=eg.idef){ed=false}else{var ea=this.posx;var em=this.posy;var ej=this.pre_posx;var ei=this.pre_posy;var en=0;var el=0;en=ea-ej;el=em-ei;if(en*en+el*el>0.25*ef*eb*eb){ed=false}else{var ek=0;var eh=0;ek=this.aabb.maxx-this.aabb.minx;eh=this.aabb.maxy-this.aabb.miny;var ee=ek*ek+eh*eh;var eg=P.angularSleepThreshold;eg*=eg;if(4*this.angvel*this.angvel*ee>eg){ed=false}else{var ec=this.rot-this.pre_rot;if(ec*ec*ee>eg*eb*eb){ed=false}else{ed=true}}}}if(!ed){this.component.waket=this.space.stamp}return this.component.waket+P.sleepDelay0.0001){this.axisx=Math.sin(this.rot);this.axisy=Math.cos(this.rot)}else{var ec=ef*ef;var ee=1-0.5*ec;var eb=1-ec*ec/8;var ea=(ee*this.axisx+ef*this.axisy)*eb;this.axisy=(ee*this.axisy-ef*this.axisx)*eb;this.axisx=ea}}}};cj.prototype.sweepValidate=function(em){if(em.type==0){em.worldCOMx=this.posx+(this.axisy*em.localCOMx-this.axisx*em.localCOMy);em.worldCOMy=this.posy+(em.localCOMx*this.axisx+em.localCOMy*this.axisy)}else{var eb=em.polygon;var ek=eb.lverts.next;var ec=eb.gverts.next;while(ec!=null){var ee=ec;var ed=ek;ek=ek.next;ee.x=this.posx+(this.axisy*ed.x-this.axisx*ed.y);ee.y=this.posy+(ed.x*this.axisx+ed.y*this.axisy);ec=ec.next}var ea=eb.edges.head;var ei=eb.gverts.next;var el=ei;ei=ei.next;while(ei!=null){var ej=ei;var ef=ea.elt;ea=ea.next;ef.gnormx=this.axisy*ef.lnormx-this.axisx*ef.lnormy;ef.gnormy=ef.lnormx*this.axisx+ef.lnormy*this.axisy;ef.gprojection=this.posx*ef.gnormx+this.posy*ef.gnormy+ef.lprojection;ef.tp0=el.y*ef.gnormx-el.x*ef.gnormy;ef.tp1=ej.y*ef.gnormx-ej.x*ef.gnormy;el=ej;ei=ei.next}var eh=eb.gverts.next;var eg=ea.elt;eg.gnormx=this.axisy*eg.lnormx-this.axisx*eg.lnormy;eg.gnormy=eg.lnormx*this.axisx+eg.lnormy*this.axisy;eg.gprojection=this.posx*eg.gnormx+this.posy*eg.gnormy+eg.lprojection;eg.tp0=el.y*eg.gnormx-el.x*eg.gnormy;eg.tp1=eh.y*eg.gnormx-eh.x*eg.gnormy}};cj.prototype.pre_posx=null;cj.prototype.pre_posy=null;cj.prototype.posx=null;cj.prototype.posy=null;cj.prototype.wrap_pos=null;cj.prototype.velx=null;cj.prototype.vely=null;cj.prototype.wrap_vel=null;cj.prototype.forcex=null;cj.prototype.forcey=null;cj.prototype.wrap_force=null;cj.prototype.kinvelx=null;cj.prototype.kinvely=null;cj.prototype.wrap_kinvel=null;cj.prototype.svelx=null;cj.prototype.svely=null;cj.prototype.wrap_svel=null;cj.prototype.invalidate_pos=function(){var ea=this.shapes.head;while(ea!=null){var eb=ea.elt;if(eb.type==1){eb.polygon.invalidate_gverts();eb.polygon.invalidate_gaxi()}eb.invalidate_worldCOM();ea=ea.next}this.zip_worldCOM=true};cj.prototype.pos_invalidate=function(ec){this.immutable_midstep("Body::position");if(!(this.posx==ec.x&&this.posy==ec.y)){this.posx=ec.x;this.posy=ec.y;var ea=this.shapes.head;while(ea!=null){var eb=ea.elt;if(eb.type==1){eb.polygon.invalidate_gverts();eb.polygon.invalidate_gaxi()}eb.invalidate_worldCOM();ea=ea.next}this.zip_worldCOM=true;this.wake()}};cj.prototype.pos_validate=function(){this.wrap_pos.zpp_inner.x=this.posx;this.wrap_pos.zpp_inner.y=this.posy};cj.prototype.vel_invalidate=function(ea){this.velx=ea.x;this.vely=ea.y;this.wake()};cj.prototype.vel_validate=function(){this.wrap_vel.zpp_inner.x=this.velx;this.wrap_vel.zpp_inner.y=this.vely};cj.prototype.kinvel_invalidate=function(ea){this.kinvelx=ea.x;this.kinvely=ea.y;this.wake()};cj.prototype.kinvel_validate=function(){this.wrap_kinvel.zpp_inner.x=this.kinvelx;this.wrap_kinvel.zpp_inner.y=this.kinvely};cj.prototype.svel_invalidate=function(ea){this.svelx=ea.x;this.svely=ea.y;this.wake()};cj.prototype.svel_validate=function(){this.wrap_svel.zpp_inner.x=this.svelx;this.wrap_svel.zpp_inner.y=this.svely};cj.prototype.force_invalidate=function(ea){this.forcex=ea.x;this.forcey=ea.y;this.wake()};cj.prototype.force_validate=function(){this.wrap_force.zpp_inner.x=this.forcex;this.wrap_force.zpp_inner.y=this.forcey};cj.prototype.setupPosition=function(){var ea=this.posx;var eh=this.posy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_pos=eb;this.wrap_pos.zpp_inner._inuse=true;if(this.world){this.wrap_pos.zpp_inner._immutable=true}else{this.wrap_pos.zpp_inner._invalidate=dX(this,this.pos_invalidate);this.wrap_pos.zpp_inner._validate=dX(this,this.pos_validate)}};cj.prototype.setupVelocity=function(){var ea=this.velx;var eh=this.vely;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_vel=eb;this.wrap_vel.zpp_inner._inuse=true;if(this.world){this.wrap_vel.zpp_inner._immutable=true}else{this.wrap_vel.zpp_inner._invalidate=dX(this,this.vel_invalidate);this.wrap_vel.zpp_inner._validate=dX(this,this.vel_validate)}};cj.prototype.setupkinvel=function(){var ea=this.kinvelx;var eh=this.kinvely;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_kinvel=eb;this.wrap_kinvel.zpp_inner._inuse=true;if(this.world){this.wrap_kinvel.zpp_inner._immutable=true}else{this.wrap_kinvel.zpp_inner._invalidate=dX(this,this.kinvel_invalidate);this.wrap_kinvel.zpp_inner._validate=dX(this,this.kinvel_validate)}};cj.prototype.setupsvel=function(){var ea=this.svelx;var eh=this.svely;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_svel=eb;this.wrap_svel.zpp_inner._inuse=true;if(this.world){this.wrap_svel.zpp_inner._immutable=true}else{this.wrap_svel.zpp_inner._invalidate=dX(this,this.svel_invalidate);this.wrap_svel.zpp_inner._validate=dX(this,this.svel_validate)}};cj.prototype.setupForce=function(){var ea=this.forcex;var eh=this.forcey;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_force=eb;this.wrap_force.zpp_inner._inuse=true;if(this.world){this.wrap_force.zpp_inner._immutable=true}else{this.wrap_force.zpp_inner._invalidate=dX(this,this.force_invalidate);this.wrap_force.zpp_inner._validate=dX(this,this.force_validate)}};cj.prototype.cvel_validate=function(){this.wrapcvel.zpp_inner.x=this.velx+this.kinvelx;this.wrapcvel.zpp_inner.y=this.vely+this.kinvely;this.wrapcvel.zpp_inner.z=this.angvel+this.kinangvel};cj.prototype.wrapcvel=null;cj.prototype.setup_cvel=function(){this.wrapcvel=q.get();this.wrapcvel.zpp_inner.immutable=true;this.wrapcvel.zpp_inner._validate=dX(this,this.cvel_validate)};cj.prototype.angvel=null;cj.prototype.torque=null;cj.prototype.kinangvel=null;cj.prototype.pre_rot=null;cj.prototype.rot=null;cj.prototype.invalidate_rot=function(){this.zip_axis=true;var ea=this.shapes.head;while(ea!=null){var eb=ea.elt;if(eb.type==1){eb.polygon.invalidate_gverts();eb.polygon.invalidate_gaxi()}eb.invalidate_worldCOM();ea=ea.next}this.zip_worldCOM=true};cj.prototype.axisx=null;cj.prototype.axisy=null;cj.prototype.zip_axis=null;cj.prototype.validate_axis=function(){if(this.zip_axis){this.zip_axis=false;this.axisx=Math.sin(this.rot);this.axisy=Math.cos(this.rot)}};cj.prototype.quick_validate_axis=function(){this.axisx=Math.sin(this.rot);this.axisy=Math.cos(this.rot)};cj.prototype.delta_rot=function(ee){this.rot+=ee;if(ee*ee>0.0001){this.axisx=Math.sin(this.rot);this.axisy=Math.cos(this.rot)}else{var ec=ee*ee;var ed=1-0.5*ec;var eb=1-ec*ec/8;var ea=(ed*this.axisx+ee*this.axisy)*eb;this.axisy=(ed*this.axisy-ee*this.axisx)*eb;this.axisx=ea}};cj.prototype.kinematicDelaySleep=null;cj.prototype.mass=null;cj.prototype.zip_mass=null;cj.prototype.massMode=null;cj.prototype.imass=null;cj.prototype.smass=null;cj.prototype.cmass=null;cj.prototype.nomove=null;cj.prototype.invalidate_mass=function(){this.zip_mass=true;this.invalidate_gravMass()};cj.prototype.validate_mass=function(){if(this.zip_mass||this.massMode==0&&false){this.zip_mass=false;if(this.massMode==0){this.cmass=0;var ea=this.shapes.head;while(ea!=null){var eb=ea.elt;eb.refmaterial.density=eb.material.density;eb.validate_area_inertia();this.cmass+=eb.area*eb.material.density;ea=ea.next}}if(this.type==2&&!this.nomove){this.mass=this.cmass;this.imass=this.smass=1/this.mass}else{this.mass=Infinity;this.imass=this.smass=0}}};cj.prototype.gravMass=null;cj.prototype.zip_gravMass=null;cj.prototype.gravMassMode=null;cj.prototype.gravMassScale=null;cj.prototype.zip_gravMassScale=null;cj.prototype.invalidate_gravMass=function(){if(this.gravMassMode!=1){this.zip_gravMass=true}if(this.gravMassMode!=2){this.zip_gravMassScale=true}this.wake()};cj.prototype.validate_gravMass=function(){if(this.zip_gravMass){this.zip_gravMass=false;this.validate_mass();if(this.gravMassMode==0){this.validate_mass();this.gravMass=this.cmass}else{if(this.gravMassMode==2){this.validate_mass();this.gravMass=this.cmass*this.gravMassScale}}}};cj.prototype.invalidate_gravMassScale=function(){if(this.gravMassMode!=2){this.zip_gravMassScale=true}else{this.invalidate_gravMass()}};cj.prototype.validate_gravMassScale=function(){if(this.zip_gravMassScale){this.zip_gravMassScale=false;if(this.gravMassMode==0){this.gravMassScale=1}else{if(this.gravMassMode==1){this.validate_mass();this.gravMassScale=this.gravMass/this.cmass}}}};cj.prototype.inertiaMode=null;cj.prototype.inertia=null;cj.prototype.zip_inertia=null;cj.prototype.cinertia=null;cj.prototype.iinertia=null;cj.prototype.sinertia=null;cj.prototype.norotate=null;cj.prototype.invalidate_inertia=function(){this.zip_inertia=true;this.wake()};cj.prototype.validate_inertia=function(){if(this.zip_inertia||this.inertiaMode==0&&false){this.zip_inertia=false;if(this.inertiaMode==0){this.cinertia=0;var ea=this.shapes.head;while(ea!=null){var eb=ea.elt;eb.refmaterial.density=eb.material.density;eb.validate_area_inertia();this.cinertia+=eb.inertia*eb.area*eb.material.density;ea=ea.next}}if(this.type==2&&!this.norotate){this.inertia=this.cinertia;this.sinertia=this.iinertia=1/this.inertia}else{this.inertia=Infinity;this.sinertia=this.iinertia=0}}};cj.prototype.invalidate_wake=function(){this.wake()};cj.prototype.aabb=null;cj.prototype.zip_aabb=null;cj.prototype.validate_aabb=function(){if(this.zip_aabb){this.zip_aabb=false;this.aabb.minx=Infinity;this.aabb.miny=Infinity;this.aabb.maxx=-Infinity;this.aabb.maxy=-Infinity;var eu=this.shapes.head;while(eu!=null){var eo=eu.elt;if(eo.zip_aabb){if(eo.body!=null){eo.zip_aabb=false;if(eo.type==0){var ev=eo.circle;if(ev.zip_worldCOM){if(ev.body!=null){ev.zip_worldCOM=false;if(ev.zip_localCOM){ev.zip_localCOM=false;if(ev.type==1){var eB=ev.polygon;if(eB.lverts.next.next==null){eB.localCOMx=eB.lverts.next.x;eB.localCOMy=eB.lverts.next.y}else{if(eB.lverts.next.next.next==null){eB.localCOMx=eB.lverts.next.x;eB.localCOMy=eB.lverts.next.y;eB.localCOMx+=eB.lverts.next.next.x;eB.localCOMy+=eB.lverts.next.next.y;eB.localCOMx*=0.5;eB.localCOMy*=0.5}else{eB.localCOMx=0;eB.localCOMy=0;var eC=0;var es=eB.lverts.next;var ek=es;es=es.next;var ej=es;es=es.next;while(es!=null){var eh=es;eC+=ej.x*(eh.y-ek.y);var en=eh.y*ej.x-eh.x*ej.y;eB.localCOMx+=(ej.x+eh.x)*en;eB.localCOMy+=(ej.y+eh.y)*en;ek=ej;ej=eh;es=es.next}es=eB.lverts.next;var ei=es;eC+=ej.x*(ei.y-ek.y);var ef=ei.y*ej.x-ei.x*ej.y;eB.localCOMx+=(ej.x+ei.x)*ef;eB.localCOMy+=(ej.y+ei.y)*ef;ek=ej;es=es.next;var eg=es;eC+=ei.x*(eg.y-ek.y);var ed=eg.y*ei.x-eg.x*ei.y;eB.localCOMx+=(ei.x+eg.x)*ed;eB.localCOMy+=(ei.y+eg.y)*ed;eC=1/(3*eC);var em=eC;eB.localCOMx*=em;eB.localCOMy*=em}}}if(ev.wrap_localCOM!=null){ev.wrap_localCOM.zpp_inner.x=ev.localCOMx;ev.wrap_localCOM.zpp_inner.y=ev.localCOMy}}var eA=ev.body;if(eA.zip_axis){eA.zip_axis=false;eA.axisx=Math.sin(eA.rot);eA.axisy=Math.cos(eA.rot)}ev.worldCOMx=ev.body.posx+(ev.body.axisy*ev.localCOMx-ev.body.axisx*ev.localCOMy);ev.worldCOMy=ev.body.posy+(ev.localCOMx*ev.body.axisx+ev.localCOMy*ev.body.axisy)}}var ec=ev.radius;var eb=ev.radius;ev.aabb.minx=ev.worldCOMx-ec;ev.aabb.miny=ev.worldCOMy-eb;ev.aabb.maxx=ev.worldCOMx+ec;ev.aabb.maxy=ev.worldCOMy+eb}else{var ey=eo.polygon;if(ey.zip_gverts){if(ey.body!=null){ey.zip_gverts=false;ey.validate_lverts();var ex=ey.body;if(ex.zip_axis){ex.zip_axis=false;ex.axisx=Math.sin(ex.rot);ex.axisy=Math.cos(ex.rot)}var el=ey.lverts.next;var er=ey.gverts.next;while(er!=null){var ez=er;var et=el;el=el.next;ez.x=ey.body.posx+(ey.body.axisy*et.x-ey.body.axisx*et.y);ez.y=ey.body.posy+(et.x*ey.body.axisx+et.y*ey.body.axisy);er=er.next}}}var ea=ey.gverts.next;ey.aabb.minx=ea.x;ey.aabb.miny=ea.y;ey.aabb.maxx=ea.x;ey.aabb.maxy=ea.y;var ep=ey.gverts.next.next;while(ep!=null){var eq=ep;if(eq.xey.aabb.maxx){ey.aabb.maxx=eq.x}if(eq.yey.aabb.maxy){ey.aabb.maxy=eq.y}ep=ep.next}}}}var ew=this.aabb;var ee=eo.aabb;if(ee.minxew.maxx){ew.maxx=ee.maxx}if(ee.minyew.maxy){ew.maxy=ee.maxy}eu=eu.next}}};cj.prototype.invalidate_aabb=function(){this.zip_aabb=true};cj.prototype.localCOMx=null;cj.prototype.localCOMy=null;cj.prototype.zip_localCOM=null;cj.prototype.worldCOMx=null;cj.prototype.worldCOMy=null;cj.prototype.zip_worldCOM=null;cj.prototype.wrap_localCOM=null;cj.prototype.wrap_worldCOM=null;cj.prototype.invalidate_localCOM=function(){this.zip_localCOM=true;this.zip_worldCOM=true};cj.prototype.invalidate_worldCOM=function(){this.zip_worldCOM=true};cj.prototype.validate_localCOM=function(){if(this.zip_localCOM){this.zip_localCOM=false;var ek=0;var ei=0;var ea=0;var eq=this.shapes.head;while(eq!=null){var eo=eq.elt;if(eo.zip_localCOM){eo.zip_localCOM=false;if(eo.type==1){var er=eo.polygon;if(er.lverts.next.next==null){er.localCOMx=er.lverts.next.x;er.localCOMy=er.lverts.next.y}else{if(er.lverts.next.next.next==null){er.localCOMx=er.lverts.next.x;er.localCOMy=er.lverts.next.y;er.localCOMx+=er.lverts.next.next.x;er.localCOMy+=er.lverts.next.next.y;er.localCOMx*=0.5;er.localCOMy*=0.5}else{er.localCOMx=0;er.localCOMy=0;var es=0;var ep=er.lverts.next;var el=ep;ep=ep.next;var ej=ep;ep=ep.next;while(ep!=null){var eg=ep;es+=ej.x*(eg.y-el.y);var en=eg.y*ej.x-eg.x*ej.y;er.localCOMx+=(ej.x+eg.x)*en;er.localCOMy+=(ej.y+eg.y)*en;el=ej;ej=eg;ep=ep.next}ep=er.lverts.next;var eh=ep;es+=ej.x*(eh.y-el.y);var ee=eh.y*ej.x-eh.x*ej.y;er.localCOMx+=(ej.x+eh.x)*ee;er.localCOMy+=(ej.y+eh.y)*ee;el=ej;ep=ep.next;var ef=ep;es+=eh.x*(ef.y-el.y);var ec=ef.y*eh.x-ef.x*eh.y;er.localCOMx+=(eh.x+ef.x)*ec;er.localCOMy+=(eh.y+ef.y)*ec;es=1/(3*es);var em=es;er.localCOMx*=em;er.localCOMy*=em}}}if(eo.wrap_localCOM!=null){eo.wrap_localCOM.zpp_inner.x=eo.localCOMx;eo.wrap_localCOM.zpp_inner.y=eo.localCOMy}}eo.validate_area_inertia();var ed=eo.area*eo.material.density;ek+=eo.localCOMx*ed;ei+=eo.localCOMy*ed;ea+=eo.area*eo.material.density;eq=eq.next}if(ea!=0){var eb=1/ea;this.localCOMx=ek*eb;this.localCOMy=ei*eb}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}if(this.zip_mass&&this.massMode==0){this.zip_mass=false;this.cmass=ea;if(this.type==2){this.mass=this.cmass;this.imass=this.smass=1/this.mass}else{this.mass=Infinity;this.imass=this.smass=0}}}};cj.prototype.validate_worldCOM=function(){if(this.zip_worldCOM){this.zip_worldCOM=false;this.validate_localCOM();if(this.zip_axis){this.zip_axis=false;this.axisx=Math.sin(this.rot);this.axisy=Math.cos(this.rot)}this.worldCOMx=this.posx+(this.axisy*this.localCOMx-this.axisx*this.localCOMy);this.worldCOMy=this.posy+(this.localCOMx*this.axisx+this.localCOMy*this.axisy);if(this.wrap_worldCOM!=null){this.wrap_worldCOM.zpp_inner.x=this.worldCOMx;this.wrap_worldCOM.zpp_inner.y=this.worldCOMy}}};cj.prototype.getlocalCOM=function(){this.validate_localCOM()};cj.prototype.getworldCOM=function(){this.validate_worldCOM()};cj.prototype.__immutable_midstep=function(ea){};cj.prototype.clear=function(){while(this.shapes.head!=null){var ed=this.shapes.pop_unsafe();ed.removedFromBody();ed.body=null}this.invalidate_shapes();this.pre_posx=0;this.pre_posy=0;this.posx=0;this.posy=0;this.velx=0;this.vely=0;this.forcex=0;this.forcey=0;this.kinvelx=0;this.kinvely=0;this.svelx=0;this.svely=0;this.angvel=this.torque=this.kinangvel=this.pre_rot=this.rot=0;var ec=this.shapes.head;while(ec!=null){var eb=ec.elt;if(eb.type==1){eb.polygon.invalidate_gverts();eb.polygon.invalidate_gaxi()}eb.invalidate_worldCOM();ec=ec.next}this.zip_worldCOM=true;this.zip_axis=true;var ee=this.shapes.head;while(ee!=null){var ea=ee.elt;if(ea.type==1){ea.polygon.invalidate_gverts();ea.polygon.invalidate_gaxi()}ea.invalidate_worldCOM();ee=ee.next}this.zip_worldCOM=true;this.axisx=0;this.axisy=1;this.zip_axis=false;this.massMode=0;this.gravMassMode=0;this.gravMassScale=1;this.inertiaMode=0;this.norotate=false;this.nomove=false};cj.prototype.aabb_validate=function(){if(this.zip_aabb){this.zip_aabb=false;this.aabb.minx=Infinity;this.aabb.miny=Infinity;this.aabb.maxx=-Infinity;this.aabb.maxy=-Infinity;var eu=this.shapes.head;while(eu!=null){var eo=eu.elt;if(eo.zip_aabb){if(eo.body!=null){eo.zip_aabb=false;if(eo.type==0){var ev=eo.circle;if(ev.zip_worldCOM){if(ev.body!=null){ev.zip_worldCOM=false;if(ev.zip_localCOM){ev.zip_localCOM=false;if(ev.type==1){var eB=ev.polygon;if(eB.lverts.next.next==null){eB.localCOMx=eB.lverts.next.x;eB.localCOMy=eB.lverts.next.y}else{if(eB.lverts.next.next.next==null){eB.localCOMx=eB.lverts.next.x;eB.localCOMy=eB.lverts.next.y;eB.localCOMx+=eB.lverts.next.next.x;eB.localCOMy+=eB.lverts.next.next.y;eB.localCOMx*=0.5;eB.localCOMy*=0.5}else{eB.localCOMx=0;eB.localCOMy=0;var eC=0;var es=eB.lverts.next;var ek=es;es=es.next;var ej=es;es=es.next;while(es!=null){var eh=es;eC+=ej.x*(eh.y-ek.y);var en=eh.y*ej.x-eh.x*ej.y;eB.localCOMx+=(ej.x+eh.x)*en;eB.localCOMy+=(ej.y+eh.y)*en;ek=ej;ej=eh;es=es.next}es=eB.lverts.next;var ei=es;eC+=ej.x*(ei.y-ek.y);var ef=ei.y*ej.x-ei.x*ej.y;eB.localCOMx+=(ej.x+ei.x)*ef;eB.localCOMy+=(ej.y+ei.y)*ef;ek=ej;es=es.next;var eg=es;eC+=ei.x*(eg.y-ek.y);var ed=eg.y*ei.x-eg.x*ei.y;eB.localCOMx+=(ei.x+eg.x)*ed;eB.localCOMy+=(ei.y+eg.y)*ed;eC=1/(3*eC);var em=eC;eB.localCOMx*=em;eB.localCOMy*=em}}}if(ev.wrap_localCOM!=null){ev.wrap_localCOM.zpp_inner.x=ev.localCOMx;ev.wrap_localCOM.zpp_inner.y=ev.localCOMy}}var eA=ev.body;if(eA.zip_axis){eA.zip_axis=false;eA.axisx=Math.sin(eA.rot);eA.axisy=Math.cos(eA.rot)}ev.worldCOMx=ev.body.posx+(ev.body.axisy*ev.localCOMx-ev.body.axisx*ev.localCOMy);ev.worldCOMy=ev.body.posy+(ev.localCOMx*ev.body.axisx+ev.localCOMy*ev.body.axisy)}}var ec=ev.radius;var eb=ev.radius;ev.aabb.minx=ev.worldCOMx-ec;ev.aabb.miny=ev.worldCOMy-eb;ev.aabb.maxx=ev.worldCOMx+ec;ev.aabb.maxy=ev.worldCOMy+eb}else{var ey=eo.polygon;if(ey.zip_gverts){if(ey.body!=null){ey.zip_gverts=false;ey.validate_lverts();var ex=ey.body;if(ex.zip_axis){ex.zip_axis=false;ex.axisx=Math.sin(ex.rot);ex.axisy=Math.cos(ex.rot)}var el=ey.lverts.next;var er=ey.gverts.next;while(er!=null){var ez=er;var et=el;el=el.next;ez.x=ey.body.posx+(ey.body.axisy*et.x-ey.body.axisx*et.y);ez.y=ey.body.posy+(et.x*ey.body.axisx+et.y*ey.body.axisy);er=er.next}}}var ea=ey.gverts.next;ey.aabb.minx=ea.x;ey.aabb.miny=ea.y;ey.aabb.maxx=ea.x;ey.aabb.maxy=ea.y;var ep=ey.gverts.next.next;while(ep!=null){var eq=ep;if(eq.xey.aabb.maxx){ey.aabb.maxx=eq.x}if(eq.yey.aabb.maxy){ey.aabb.maxy=eq.y}ep=ep.next}}}}var ew=this.aabb;var ee=eo.aabb;if(ee.minxew.maxx){ew.maxx=ee.maxx}if(ee.minyew.maxy){ew.maxy=ee.maxy}eu=eu.next}}};cj.prototype.shapes_adder=function(eb){if(eb.zpp_inner.body!=this){if(eb.zpp_inner.body!=null){eb.zpp_inner.body.wrap_shapes.remove(eb)}eb.zpp_inner.body=this;eb.zpp_inner.addedToBody();if(this.space!=null){var ed=this.space;var ea=eb.zpp_inner;var ec=ea.body;if(!ec.world){ec.component.waket=ed.stamp+(ed.midstep?0:1);if(ec.type==3){ec.kinematicDelaySleep=true}if(ec.component.sleeping){ed.really_wake(ec,false)}}ed.bphase.insert(ea);ea.addedToSpace()}if(eb.zpp_inner.type==1){eb.zpp_inner.polygon.invalidate_gaxi();eb.zpp_inner.polygon.invalidate_gverts()}return true}else{return false}};cj.prototype.shapes_subber=function(ea){if(this.space!=null){this.space.removed_shape(ea.zpp_inner)}ea.zpp_inner.body=null;ea.zpp_inner.removedFromBody()};cj.prototype.shapes_invalidate=function(ea){this.invalidate_shapes()};cj.prototype.addedToSpace=function(){if(bx.zpp_pool==null){this.component=new bx()}else{this.component=bx.zpp_pool;bx.zpp_pool=this.component.next;this.component.next=null}this.component.isBody=true;this.component.body=this;this.__iaddedToSpace()};cj.prototype.removedFromSpace=function(){while(this.arbiters.head!=null){var eb=this.arbiters.pop_unsafe();eb.cleared=true;if(eb.b2==this){var eh=eb.b1.arbiters;var eg=null;var en=eh.head;while(en!=null){if(en.elt==eb){var ed;var ej;if(eg==null){ed=eh.head;ej=ed.next;eh.head=ej;if(eh.head==null){eh.pushmod=true}}else{ed=eg.next;ej=ed.next;eg.next=ej;if(ej==null){eh.pushmod=true}}var ea=ed;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;eh.modified=true;eh.length--;eh.pushmod=true;break}eg=en;en=en.next}}if(eb.b1==this){var ek=eb.b2.arbiters;var ef=null;var em=ek.head;while(em!=null){if(em.elt==eb){var ei;var el;if(ef==null){ei=ek.head;el=ei.next;ek.head=el;if(ek.head==null){ek.pushmod=true}}else{ei=ef.next;el=ei.next;ef.next=el;if(el==null){ek.pushmod=true}}var ee=ei;ee.elt=null;ee.next=dL.zpp_pool;dL.zpp_pool=ee;ek.modified=true;ek.length--;ek.pushmod=true;break}ef=em;em=em.next}}if(eb.pair!=null){eb.pair.arb=null;eb.pair=null}eb.active=false;this.space.f_arbiters.modified=true}var ec=this.component;ec.body=null;ec.constraint=null;ec.next=bx.zpp_pool;bx.zpp_pool=ec;this.component=null;this.__iremovedFromSpace()};cj.prototype.copy=function(){var ea=new at().zpp_inner;ea.type=this.type;ea.bulletEnabled=this.bulletEnabled;ea.disableCCD=this.disableCCD;var eb=this.shapes.head;while(eb!=null){var ef=ea.outer.zpp_inner.wrap_shapes;var ee=eb.elt.outer.copy();if(ef.zpp_inner.reverse_flag){ef.push(ee)}else{ef.unshift(ee)}eb=eb.next}ea.posx=this.posx;ea.posy=this.posy;ea.velx=this.velx;ea.vely=this.vely;ea.forcex=this.forcex;ea.forcey=this.forcey;ea.rot=this.rot;ea.angvel=this.angvel;ea.torque=this.torque;ea.kinvelx=this.kinvelx;ea.kinvely=this.kinvely;ea.kinangvel=this.kinangvel;ea.svelx=this.svelx;ea.svely=this.svely;if(!this.zip_axis){ea.axisx=this.axisx;ea.axisy=this.axisy}else{ea.zip_axis=true;var ed=ea.shapes.head;while(ed!=null){var ec=ed.elt;if(ec.type==1){ec.polygon.invalidate_gverts();ec.polygon.invalidate_gaxi()}ec.invalidate_worldCOM();ed=ed.next}ea.zip_worldCOM=true}ea.rot=this.rot;ea.massMode=this.massMode;ea.gravMassMode=this.gravMassMode;ea.inertiaMode=this.inertiaMode;ea.norotate=this.norotate;ea.nomove=this.nomove;ea.cmass=this.cmass;ea.cinertia=this.cinertia;if(!this.zip_mass){ea.mass=this.mass}else{ea.invalidate_mass()}if(!this.zip_gravMass){ea.gravMass=this.gravMass}else{ea.invalidate_gravMass()}if(!this.zip_gravMassScale){ea.gravMassScale=this.gravMassScale}else{ea.invalidate_gravMassScale()}if(!this.zip_inertia){ea.inertia=this.inertia}else{ea.invalidate_inertia()}if(!this.zip_aabb){ea.aabb.minx=this.aabb.minx;ea.aabb.miny=this.aabb.miny;ea.aabb.maxx=this.aabb.maxx;ea.aabb.maxy=this.aabb.maxy}else{ea.zip_aabb=true}if(!this.zip_localCOM){ea.localCOMx=this.localCOMx;ea.localCOMy=this.localCOMy}else{ea.zip_localCOM=true;ea.zip_worldCOM=true}if(!this.zip_worldCOM){ea.worldCOMx=this.worldCOMx;ea.worldCOMy=this.worldCOMy}else{ea.zip_worldCOM=true}this.copyto(ea.outer);return ea.outer};cj.prototype.__class__=cj;var cQ=zpp_nape.phys.ZPP_Compound=function(){this.space=null;this.compound=null;this.depth=0;this.wrap_compounds=null;this.wrap_constraints=null;this.wrap_bodies=null;this.compounds=null;this.constraints=null;this.bodies=null;this.outer=null;dM.call(this);this.icompound=this;this.depth=1;this.bodies=new bs();this.wrap_bodies=b0.get(this.bodies);this.wrap_bodies.zpp_inner.adder=dX(this,this.bodies_adder);this.wrap_bodies.zpp_inner.subber=dX(this,this.bodies_subber);this.constraints=new m();this.wrap_constraints=aZ.get(this.constraints);this.wrap_constraints.zpp_inner.adder=dX(this,this.constraints_adder);this.wrap_constraints.zpp_inner.subber=dX(this,this.constraints_subber);this.compounds=new n();this.wrap_compounds=bj.get(this.compounds);this.wrap_compounds.zpp_inner.adder=dX(this,this.compounds_adder);this.wrap_compounds.zpp_inner.subber=dX(this,this.compounds_subber)};cQ.__name__=["zpp_nape","phys","ZPP_Compound"];cQ.__super__=dM;cQ.prototype=Object.create(dM.prototype);cQ.prototype.outer=null;cQ.prototype.bodies=null;cQ.prototype.constraints=null;cQ.prototype.compounds=null;cQ.prototype.wrap_bodies=null;cQ.prototype.wrap_constraints=null;cQ.prototype.wrap_compounds=null;cQ.prototype.depth=null;cQ.prototype.compound=null;cQ.prototype.space=null;cQ.prototype.__imutable_midstep=function(ea){};cQ.prototype.addedToSpace=function(){this.__iaddedToSpace()};cQ.prototype.removedFromSpace=function(){this.__iremovedFromSpace()};cQ.prototype.breakApart=function(){if(this.space!=null){this.__iremovedFromSpace();this.space.nullInteractorType(this)}if(this.compound!=null){this.compound.compounds.remove(this)}else{if(this.space!=null){this.space.compounds.remove(this)}}while(this.bodies.head!=null){var ea=this.bodies.pop_unsafe();if((ea.compound=this.compound)!=null){this.compound.bodies.add(ea)}else{if(this.space!=null){this.space.bodies.add(ea)}}if(this.space!=null){this.space.freshInteractorType(ea)}}while(this.constraints.head!=null){var ec=this.constraints.pop_unsafe();if((ec.compound=this.compound)!=null){this.compound.constraints.add(ec)}else{if(this.space!=null){this.space.constraints.add(ec)}}}while(this.compounds.head!=null){var eb=this.compounds.pop_unsafe();if((eb.compound=this.compound)!=null){this.compound.compounds.add(eb)}else{if(this.space!=null){this.space.compounds.add(eb)}}if(this.space!=null){this.space.freshInteractorType(eb)}}this.compound=null;this.space=null};cQ.prototype.bodies_adder=function(ea){if(ea.zpp_inner.compound!=this){if(ea.zpp_inner.compound!=null){ea.zpp_inner.compound.wrap_bodies.remove(ea)}else{if(ea.zpp_inner.space!=null){ea.zpp_inner.space.wrap_bodies.remove(ea)}}ea.zpp_inner.compound=this;if(this.space!=null){this.space.addBody(ea.zpp_inner)}return true}else{return false}};cQ.prototype.bodies_subber=function(ea){ea.zpp_inner.compound=null;if(this.space!=null){this.space.remBody(ea.zpp_inner)}};cQ.prototype.constraints_adder=function(ea){if(ea.zpp_inner.compound!=this){if(ea.zpp_inner.compound!=null){ea.zpp_inner.compound.wrap_constraints.remove(ea)}else{if(ea.zpp_inner.space!=null){ea.zpp_inner.space.wrap_constraints.remove(ea)}}ea.zpp_inner.compound=this;if(this.space!=null){this.space.addConstraint(ea.zpp_inner)}return true}else{return false}};cQ.prototype.constraints_subber=function(ea){ea.zpp_inner.compound=null;if(this.space!=null){this.space.remConstraint(ea.zpp_inner)}};cQ.prototype.compounds_adder=function(ea){if(ea.zpp_inner.compound!=this){if(ea.zpp_inner.compound!=null){ea.zpp_inner.compound.wrap_compounds.remove(ea)}else{if(ea.zpp_inner.space!=null){ea.zpp_inner.space.wrap_compounds.remove(ea)}}ea.zpp_inner.compound=this;ea.zpp_inner.depth=this.depth+1;if(this.space!=null){this.space.addCompound(ea.zpp_inner)}return true}else{return false}};cQ.prototype.compounds_subber=function(ea){ea.zpp_inner.compound=null;ea.zpp_inner.depth=1;if(this.space!=null){this.space.remCompound(ea.zpp_inner)}};cQ.prototype.copy=function(ea,ed){var en=ea==null;if(ea==null){ea=[]}if(ed==null){ed=[]}var ej=new dq();var ec=this.compounds.head;while(ec!=null){var eb=ec.elt.copy(ea,ed);eb.zpp_inner.immutable_midstep("Compound::compound");if((eb.zpp_inner.compound==null?null:eb.zpp_inner.compound.outer)!=ej){if((eb.zpp_inner.compound==null?null:eb.zpp_inner.compound.outer)!=null){(eb.zpp_inner.compound==null?null:eb.zpp_inner.compound.outer).zpp_inner.wrap_compounds.remove(eb)}if(ej!=null){var eg=ej.zpp_inner.wrap_compounds;if(eg.zpp_inner.reverse_flag){eg.push(eb)}else{eg.unshift(eb)}}}ec=ec.next}var ep=this.bodies.head;while(ep!=null){var em=ep.elt;var ei=em.outer.copy();ea.push(cu.dict(em.id,ei));if((ei.zpp_inner.compound==null?null:ei.zpp_inner.compound.outer)!=ej){if((ei.zpp_inner.compound==null?null:ei.zpp_inner.compound.outer)!=null){(ei.zpp_inner.compound==null?null:ei.zpp_inner.compound.outer).zpp_inner.wrap_bodies.remove(ei)}if(ej!=null){var ek=ej.zpp_inner.wrap_bodies;if(ek.zpp_inner.reverse_flag){ek.push(ei)}else{ek.unshift(ei)}}}ep=ep.next}var eo=this.constraints.head;while(eo!=null){var eq=eo.elt.copy(ea,ed);if((eq.zpp_inner.compound==null?null:eq.zpp_inner.compound.outer)!=ej){if((eq.zpp_inner.compound==null?null:eq.zpp_inner.compound.outer)!=null){(eq.zpp_inner.compound==null?null:eq.zpp_inner.compound.outer).zpp_inner.wrap_constraints.remove(eq)}if(ej!=null){var eh=ej.zpp_inner.wrap_constraints;if(eh.zpp_inner.reverse_flag){eh.push(eq)}else{eh.unshift(eq)}}}eo=eo.next}if(en){while(ed.length>0){var ee=ed.pop();var ef=0;while(efeu.aabb.maxx){eu.aabb.maxx=en.x}if(en.yeu.aabb.maxy){eu.aabb.maxy=en.y}eo=eo.next}}}}};bZ.prototype.force_validate_aabb=function(){if(this.type==0){var eh=this.circle;eh.worldCOMx=eh.body.posx+(eh.body.axisy*eh.localCOMx-eh.body.axisx*eh.localCOMy);eh.worldCOMy=eh.body.posy+(eh.localCOMx*eh.body.axisx+eh.localCOMy*eh.body.axisy);eh.aabb.minx=eh.worldCOMx-eh.radius;eh.aabb.miny=eh.worldCOMy-eh.radius;eh.aabb.maxx=eh.worldCOMx+eh.radius;eh.aabb.maxy=eh.worldCOMy+eh.radius}else{var ee=this.polygon;var ea=ee.lverts.next;var eg=ee.gverts.next;var ec=ea;ea=ea.next;eg.x=ee.body.posx+(ee.body.axisy*ec.x-ee.body.axisx*ec.y);eg.y=ee.body.posy+(ec.x*ee.body.axisx+ec.y*ee.body.axisy);ee.aabb.minx=eg.x;ee.aabb.miny=eg.y;ee.aabb.maxx=eg.x;ee.aabb.maxy=eg.y;var ed=ee.gverts.next.next;while(ed!=null){var ef=ed;var eb=ea;ea=ea.next;ef.x=ee.body.posx+(ee.body.axisy*eb.x-ee.body.axisx*eb.y);ef.y=ee.body.posy+(eb.x*ee.body.axisx+eb.y*ee.body.axisy);if(ef.xee.aabb.maxx){ee.aabb.maxx=ef.x}if(ef.yee.aabb.maxy){ee.aabb.maxy=ef.y}ed=ed.next}}};bZ.prototype.invalidate_aabb=function(){this.zip_aabb=true;if(this.body!=null){this.body.zip_aabb=true}};bZ.prototype.validate_area_inertia=function(){if(this.zip_area_inertia){this.zip_area_inertia=false;if(this.type==0){this.circle.__validate_area_inertia()}else{this.polygon.__validate_area_inertia()}}};bZ.prototype.validate_angDrag=function(){if(this.zip_angDrag||this.refmaterial.dynamicFriction!=this.material.dynamicFriction){this.zip_angDrag=false;this.refmaterial.dynamicFriction=this.material.dynamicFriction;if(this.type==0){this.circle.__validate_angDrag()}else{this.polygon.__validate_angDrag()}}};bZ.prototype.validate_localCOM=function(){if(this.zip_localCOM){this.zip_localCOM=false;if(this.type==1){var ef=this.polygon;if(ef.lverts.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y}else{if(ef.lverts.next.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y;ef.localCOMx+=ef.lverts.next.next.x;ef.localCOMy+=ef.lverts.next.next.y;ef.localCOMx*=0.5;ef.localCOMy*=0.5}else{ef.localCOMx=0;ef.localCOMy=0;var eb=0;var ec=ef.lverts.next;var ek=ec;ec=ec.next;var ei=ec;ec=ec.next;while(ec!=null){var eg=ec;eb+=ei.x*(eg.y-ek.y);var ea=eg.y*ei.x-eg.x*ei.y;ef.localCOMx+=(ei.x+eg.x)*ea;ef.localCOMy+=(ei.y+eg.y)*ea;ek=ei;ei=eg;ec=ec.next}ec=ef.lverts.next;var ee=ec;eb+=ei.x*(ee.y-ek.y);var ej=ee.y*ei.x-ee.x*ei.y;ef.localCOMx+=(ei.x+ee.x)*ej;ef.localCOMy+=(ei.y+ee.y)*ej;ek=ei;ec=ec.next;var ed=ec;eb+=ee.x*(ed.y-ek.y);var eh=ed.y*ee.x-ed.x*ee.y;ef.localCOMx+=(ee.x+ed.x)*eh;ef.localCOMy+=(ee.y+ed.y)*eh;eb=1/(3*eb);var el=eb;ef.localCOMx*=el;ef.localCOMy*=el}}}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}}};bZ.prototype.validate_worldCOM=function(){if(this.zip_worldCOM){if(this.body!=null){this.zip_worldCOM=false;if(this.zip_localCOM){this.zip_localCOM=false;if(this.type==1){var ef=this.polygon;if(ef.lverts.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y}else{if(ef.lverts.next.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y;ef.localCOMx+=ef.lverts.next.next.x;ef.localCOMy+=ef.lverts.next.next.y;ef.localCOMx*=0.5;ef.localCOMy*=0.5}else{ef.localCOMx=0;ef.localCOMy=0;var eb=0;var ec=ef.lverts.next;var el=ec;ec=ec.next;var ej=ec;ec=ec.next;while(ec!=null){var eh=ec;eb+=ej.x*(eh.y-el.y);var ea=eh.y*ej.x-eh.x*ej.y;ef.localCOMx+=(ej.x+eh.x)*ea;ef.localCOMy+=(ej.y+eh.y)*ea;el=ej;ej=eh;ec=ec.next}ec=ef.lverts.next;var ee=ec;eb+=ej.x*(ee.y-el.y);var ek=ee.y*ej.x-ee.x*ej.y;ef.localCOMx+=(ej.x+ee.x)*ek;ef.localCOMy+=(ej.y+ee.y)*ek;el=ej;ec=ec.next;var ed=ec;eb+=ee.x*(ed.y-el.y);var ei=ed.y*ee.x-ed.x*ee.y;ef.localCOMx+=(ee.x+ed.x)*ei;ef.localCOMy+=(ee.y+ed.y)*ei;eb=1/(3*eb);var em=eb;ef.localCOMx*=em;ef.localCOMy*=em}}}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}}var eg=this.body;if(eg.zip_axis){eg.zip_axis=false;eg.axisx=Math.sin(eg.rot);eg.axisy=Math.cos(eg.rot)}this.worldCOMx=this.body.posx+(this.body.axisy*this.localCOMx-this.body.axisx*this.localCOMy);this.worldCOMy=this.body.posy+(this.localCOMx*this.body.axisx+this.localCOMy*this.body.axisy)}}};bZ.prototype.getworldCOM=function(){if(this.zip_worldCOM){if(this.body!=null){this.zip_worldCOM=false;if(this.zip_localCOM){this.zip_localCOM=false;if(this.type==1){var ef=this.polygon;if(ef.lverts.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y}else{if(ef.lverts.next.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y;ef.localCOMx+=ef.lverts.next.next.x;ef.localCOMy+=ef.lverts.next.next.y;ef.localCOMx*=0.5;ef.localCOMy*=0.5}else{ef.localCOMx=0;ef.localCOMy=0;var eb=0;var ec=ef.lverts.next;var el=ec;ec=ec.next;var ej=ec;ec=ec.next;while(ec!=null){var eh=ec;eb+=ej.x*(eh.y-el.y);var ea=eh.y*ej.x-eh.x*ej.y;ef.localCOMx+=(ej.x+eh.x)*ea;ef.localCOMy+=(ej.y+eh.y)*ea;el=ej;ej=eh;ec=ec.next}ec=ef.lverts.next;var ee=ec;eb+=ej.x*(ee.y-el.y);var ek=ee.y*ej.x-ee.x*ej.y;ef.localCOMx+=(ej.x+ee.x)*ek;ef.localCOMy+=(ej.y+ee.y)*ek;el=ej;ec=ec.next;var ed=ec;eb+=ee.x*(ed.y-el.y);var ei=ed.y*ee.x-ed.x*ee.y;ef.localCOMx+=(ee.x+ed.x)*ei;ef.localCOMy+=(ee.y+ed.y)*ei;eb=1/(3*eb);var em=eb;ef.localCOMx*=em;ef.localCOMy*=em}}}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}}var eg=this.body;if(eg.zip_axis){eg.zip_axis=false;eg.axisx=Math.sin(eg.rot);eg.axisy=Math.cos(eg.rot)}this.worldCOMx=this.body.posx+(this.body.axisy*this.localCOMx-this.body.axisx*this.localCOMy);this.worldCOMy=this.body.posy+(this.localCOMx*this.body.axisx+this.localCOMy*this.body.axisy)}}this.wrap_worldCOM.zpp_inner.x=this.worldCOMx;this.wrap_worldCOM.zpp_inner.y=this.worldCOMy};bZ.prototype.invalidate_area_inertia=function(){this.zip_area_inertia=true;if(this.body!=null){var ea=this.body;ea.zip_localCOM=true;ea.zip_worldCOM=true;this.body.invalidate_mass();this.body.invalidate_inertia()}};bZ.prototype.invalidate_angDrag=function(){this.zip_angDrag=true};bZ.prototype.invalidate_localCOM=function(){this.zip_localCOM=true;this.invalidate_area_inertia();if(this.type==0){this.zip_sweepRadius=true}this.invalidate_angDrag();this.invalidate_worldCOM();if(this.body!=null){var ea=this.body;ea.zip_localCOM=true;ea.zip_worldCOM=true}};bZ.prototype.invalidate_worldCOM=function(){this.zip_worldCOM=true;this.zip_aabb=true;if(this.body!=null){this.body.zip_aabb=true}};bZ.prototype.invalidate_material=function(ea){if((ea&cJ.WAKE)!=0){this.wake()}if((ea&cJ.ARBITERS)!=0){if(this.body!=null){this.body.refreshArbiters()}}if((ea&cJ.PROPS)!=0){if(this.body!=null){var eb=this.body;eb.zip_localCOM=true;eb.zip_worldCOM=true;this.body.invalidate_mass();this.body.invalidate_inertia()}}if((ea&cJ.ANGDRAG)!=0){this.invalidate_angDrag()}this.refmaterial.set(this.material)};bZ.prototype.invalidate_filter=function(){this.wake()};bZ.prototype.invalidate_fluidprops=function(){if(this.fluidEnabled){this.wake()}};bZ.prototype.aabb_validate=function(){if(this.zip_aabb){if(this.body!=null){this.zip_aabb=false;if(this.type==0){var es=this.circle;if(es.zip_worldCOM){if(es.body!=null){es.zip_worldCOM=false;if(es.zip_localCOM){es.zip_localCOM=false;if(es.type==1){var ex=es.polygon;if(ex.lverts.next.next==null){ex.localCOMx=ex.lverts.next.x;ex.localCOMy=ex.lverts.next.y}else{if(ex.lverts.next.next.next==null){ex.localCOMx=ex.lverts.next.x;ex.localCOMy=ex.lverts.next.y;ex.localCOMx+=ex.lverts.next.next.x;ex.localCOMy+=ex.lverts.next.next.y;ex.localCOMx*=0.5;ex.localCOMy*=0.5}else{ex.localCOMx=0;ex.localCOMy=0;var ey=0;var er=ex.lverts.next;var ej=er;er=er.next;var ei=er;er=er.next;while(er!=null){var eg=er;ey+=ei.x*(eg.y-ej.y);var em=eg.y*ei.x-eg.x*ei.y;ex.localCOMx+=(ei.x+eg.x)*em;ex.localCOMy+=(ei.y+eg.y)*em;ej=ei;ei=eg;er=er.next}er=ex.lverts.next;var eh=er;ey+=ei.x*(eh.y-ej.y);var ee=eh.y*ei.x-eh.x*ei.y;ex.localCOMx+=(ei.x+eh.x)*ee;ex.localCOMy+=(ei.y+eh.y)*ee;ej=ei;er=er.next;var ef=er;ey+=eh.x*(ef.y-ej.y);var ed=ef.y*eh.x-ef.x*eh.y;ex.localCOMx+=(eh.x+ef.x)*ed;ex.localCOMy+=(eh.y+ef.y)*ed;ey=1/(3*ey);var el=ey;ex.localCOMx*=el;ex.localCOMy*=el}}}if(es.wrap_localCOM!=null){es.wrap_localCOM.zpp_inner.x=es.localCOMx;es.wrap_localCOM.zpp_inner.y=es.localCOMy}}var ew=es.body;if(ew.zip_axis){ew.zip_axis=false;ew.axisx=Math.sin(ew.rot);ew.axisy=Math.cos(ew.rot)}es.worldCOMx=es.body.posx+(es.body.axisy*es.localCOMx-es.body.axisx*es.localCOMy);es.worldCOMy=es.body.posy+(es.localCOMx*es.body.axisx+es.localCOMy*es.body.axisy)}}var ec=es.radius;var eb=es.radius;es.aabb.minx=es.worldCOMx-ec;es.aabb.miny=es.worldCOMy-eb;es.aabb.maxx=es.worldCOMx+ec;es.aabb.maxy=es.worldCOMy+eb}else{var eu=this.polygon;if(eu.zip_gverts){if(eu.body!=null){eu.zip_gverts=false;eu.validate_lverts();var et=eu.body;if(et.zip_axis){et.zip_axis=false;et.axisx=Math.sin(et.rot);et.axisy=Math.cos(et.rot)}var ek=eu.lverts.next;var ep=eu.gverts.next;while(ep!=null){var ev=ep;var eq=ek;ek=ek.next;ev.x=eu.body.posx+(eu.body.axisy*eq.x-eu.body.axisx*eq.y);ev.y=eu.body.posy+(eq.x*eu.body.axisx+eq.y*eu.body.axisy);ep=ep.next}}}var ea=eu.gverts.next;eu.aabb.minx=ea.x;eu.aabb.miny=ea.y;eu.aabb.maxx=ea.x;eu.aabb.maxy=ea.y;var eo=eu.gverts.next.next;while(eo!=null){var en=eo;if(en.xeu.aabb.maxx){eu.aabb.maxx=en.x}if(en.yeu.aabb.maxy){eu.aabb.maxy=en.y}eo=eo.next}}}}};bZ.prototype.setMaterial=function(ea){if(this.material!=ea){if(this.body!=null&&this.body.space!=null){if(this.material!=null){this.material.shapes.remove(this)}}this.material=ea;if(this.body!=null&&this.body.space!=null){ea.shapes.add(this)}this.wake();if(this.body!=null){this.body.refreshArbiters()}}};bZ.prototype.setFilter=function(ea){if(this.filter!=ea){if(this.body!=null&&this.body.space!=null){if(this.filter!=null){this.filter.shapes.remove(this)}}this.filter=ea;if(this.body!=null&&this.body.space!=null){ea.shapes.add(this)}this.wake()}};bZ.prototype.setFluid=function(ea){if(this.fluidProperties!=ea){if(this.body!=null&&this.body.space!=null){if(this.fluidProperties!=null){this.fluidProperties.shapes.remove(this)}}this.fluidProperties=ea;if(this.body!=null&&this.body.space!=null){ea.shapes.add(this)}if(this.fluidEnabled){this.wake()}}};bZ.prototype.__immutable_midstep=function(ea){};bZ.prototype.addedToBody=function(){this.invalidate_worldCOM();this.zip_aabb=true;if(this.body!=null){this.body.zip_aabb=true}};bZ.prototype.removedFromBody=function(){};bZ.prototype.addedToSpace=function(){this.__iaddedToSpace();this.material.shapes.add(this);this.filter.shapes.add(this);if(this.fluidProperties!=null){this.fluidProperties.shapes.add(this)}};bZ.prototype.removedFromSpace=function(){this.__iremovedFromSpace();this.material.shapes.remove(this);this.filter.shapes.remove(this);if(this.fluidProperties!=null){this.fluidProperties.shapes.remove(this)}};bZ.prototype.copy=function(){var ea=null;if(this.type==0){ea=this.circle.__copy()}else{ea=this.polygon.__copy()}if(!this.zip_area_inertia){ea.area=this.area;ea.inertia=this.inertia}else{ea.invalidate_area_inertia()}if(!this.zip_sweepRadius){ea.sweepRadius=this.sweepRadius;ea.sweepCoef=this.sweepCoef}else{ea.zip_sweepRadius=true}if(!this.zip_angDrag){ea.angDrag=this.angDrag}else{ea.invalidate_angDrag()}if(!this.zip_aabb){ea.aabb.minx=this.aabb.minx;ea.aabb.miny=this.aabb.miny;ea.aabb.maxx=this.aabb.maxx;ea.aabb.maxy=this.aabb.maxy}else{ea.zip_aabb=true;if(ea.body!=null){ea.body.zip_aabb=true}}var ec=ea.material;ec.outer=null;ec.next=cJ.zpp_pool;cJ.zpp_pool=ec;var eb=ea.filter;eb.outer=null;eb.next=cA.zpp_pool;cA.zpp_pool=eb;ea.material=this.material;ea.filter=this.filter;if(this.fluidProperties!=null){ea.fluidProperties=this.fluidProperties}ea.fluidEnabled=this.fluidEnabled;ea.sensorEnabled=this.sensorEnabled;if(this.userData!=null){ea.userData=bm.copy(this.userData)}this.copyto(ea.outer);return ea.outer};bZ.prototype.__class__=bZ;var di=zpp_nape.shape.ZPP_Circle=function(){this.radius=0;this.outer_zn=null;bZ.call(this,0);this.circle=this;this.zip_localCOM=false};di.__name__=["zpp_nape","shape","ZPP_Circle"];di.__super__=bZ;di.prototype=Object.create(bZ.prototype);di.prototype.outer_zn=null;di.prototype.radius=null;di.prototype.__clear=function(){};di.prototype.invalidate_radius=function(){this.invalidate_area_inertia();this.invalidate_angDrag();this.zip_aabb=true;if(this.body!=null){this.body.zip_aabb=true}if(this.body!=null){this.body.wake()}};di.prototype.localCOM_validate=function(){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy};di.prototype.localCOM_invalidate=function(ea){this.localCOMx=ea.x;this.localCOMy=ea.y;this.invalidate_localCOM();if(this.body!=null){this.body.wake()}};di.prototype.setupLocalCOM=function(){var ea=this.localCOMx;var eh=this.localCOMy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_localCOM=eb;this.wrap_localCOM.zpp_inner._inuse=true;this.wrap_localCOM.zpp_inner._validate=dX(this,this.localCOM_validate);this.wrap_localCOM.zpp_inner._invalidate=dX(this,this.localCOM_invalidate)};di.prototype.__validate_aabb=function(){if(this.zip_worldCOM){if(this.body!=null){this.zip_worldCOM=false;if(this.zip_localCOM){this.zip_localCOM=false;if(this.type==1){var eh=this.polygon;if(eh.lverts.next.next==null){eh.localCOMx=eh.lverts.next.x;eh.localCOMy=eh.lverts.next.y}else{if(eh.lverts.next.next.next==null){eh.localCOMx=eh.lverts.next.x;eh.localCOMy=eh.lverts.next.y;eh.localCOMx+=eh.lverts.next.next.x;eh.localCOMy+=eh.lverts.next.next.y;eh.localCOMx*=0.5;eh.localCOMy*=0.5}else{eh.localCOMx=0;eh.localCOMy=0;var ed=0;var ee=eh.lverts.next;var en=ee;ee=ee.next;var el=ee;ee=ee.next;while(ee!=null){var ej=ee;ed+=el.x*(ej.y-en.y);var ec=ej.y*el.x-ej.x*el.y;eh.localCOMx+=(el.x+ej.x)*ec;eh.localCOMy+=(el.y+ej.y)*ec;en=el;el=ej;ee=ee.next}ee=eh.lverts.next;var eg=ee;ed+=el.x*(eg.y-en.y);var em=eg.y*el.x-eg.x*el.y;eh.localCOMx+=(el.x+eg.x)*em;eh.localCOMy+=(el.y+eg.y)*em;en=el;ee=ee.next;var ef=ee;ed+=eg.x*(ef.y-en.y);var ek=ef.y*eg.x-ef.x*eg.y;eh.localCOMx+=(eg.x+ef.x)*ek;eh.localCOMy+=(eg.y+ef.y)*ek;ed=1/(3*ed);var eo=ed;eh.localCOMx*=eo;eh.localCOMy*=eo}}}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}}var ei=this.body;if(ei.zip_axis){ei.zip_axis=false;ei.axisx=Math.sin(ei.rot);ei.axisy=Math.cos(ei.rot)}this.worldCOMx=this.body.posx+(this.body.axisy*this.localCOMx-this.body.axisx*this.localCOMy);this.worldCOMy=this.body.posy+(this.localCOMx*this.body.axisx+this.localCOMy*this.body.axisy)}}var eb=this.radius;var ea=this.radius;this.aabb.minx=this.worldCOMx-eb;this.aabb.miny=this.worldCOMy-ea;this.aabb.maxx=this.worldCOMx+eb;this.aabb.maxy=this.worldCOMy+ea};di.prototype._force_validate_aabb=function(){this.worldCOMx=this.body.posx+(this.body.axisy*this.localCOMx-this.body.axisx*this.localCOMy);this.worldCOMy=this.body.posy+(this.localCOMx*this.body.axisx+this.localCOMy*this.body.axisy);this.aabb.minx=this.worldCOMx-this.radius;this.aabb.miny=this.worldCOMy-this.radius;this.aabb.maxx=this.worldCOMx+this.radius;this.aabb.maxy=this.worldCOMy+this.radius};di.prototype.__validate_sweepRadius=function(){this.sweepCoef=Math.sqrt(this.localCOMx*this.localCOMx+this.localCOMy*this.localCOMy);this.sweepRadius=this.sweepCoef+this.radius};di.prototype.__validate_area_inertia=function(){var ea=this.radius*this.radius;this.area=ea*Math.PI;this.inertia=ea*0.5+(this.localCOMx*this.localCOMx+this.localCOMy*this.localCOMy)};di.prototype.__validate_angDrag=function(){var eb=this.localCOMx*this.localCOMx+this.localCOMy*this.localCOMy;var ea=this.radius*this.radius;this.angDrag=(eb+2*ea)*(this.material.dynamicFriction*P.fluidAngularDragFriction)+0.5*P.fluidAngularDrag*(1+P.fluidVacuumDrag)*eb;this.angDrag/=2*(eb+0.5*ea)};di.prototype.__scale=function(ec,eb){var ea=((ec<0?-ec:ec)+(eb<0?-eb:eb))/2;this.radius*=ea<0?-ea:ea;this.invalidate_radius();if(this.localCOMx*this.localCOMx+this.localCOMy*this.localCOMy>0){this.localCOMx*=ec;this.localCOMy*=eb;this.invalidate_localCOM()}};di.prototype.__translate=function(ea,eb){this.localCOMx+=ea;this.localCOMy+=eb;this.invalidate_localCOM()};di.prototype.__rotate=function(eb,ed){if(this.localCOMx*this.localCOMx+this.localCOMy*this.localCOMy>0){var ec=0;var ea=0;ec=ed*this.localCOMx-eb*this.localCOMy;ea=this.localCOMx*eb+this.localCOMy*ed;this.localCOMx=ec;this.localCOMy=ea;this.invalidate_localCOM()}};di.prototype.__transform=function(ea){var ec=ea.zpp_inner.a*ea.zpp_inner.d-ea.zpp_inner.b*ea.zpp_inner.c;if(ec<0){ec=-ec}this.radius*=Math.sqrt(ec);var eb=ea.zpp_inner.a*this.localCOMx+ea.zpp_inner.b*this.localCOMy+ea.zpp_inner.tx;this.localCOMy=ea.zpp_inner.c*this.localCOMx+ea.zpp_inner.d*this.localCOMy+ea.zpp_inner.ty;this.localCOMx=eb;this.invalidate_radius();this.invalidate_localCOM()};di.prototype.__copy=function(){var ea=new ds(this.radius).zpp_inner_zn;ea.localCOMx=this.localCOMx;ea.localCOMy=this.localCOMy;ea.zip_localCOM=false;return ea};di.prototype.__class__=di;var c8=zpp_nape.shape.ZPP_Edge=function(){this.tp1=0;this.tp0=0;this.gp1=null;this.lp1=null;this.gp0=null;this.lp0=null;this.gprojection=0;this.lprojection=0;this.length=0;this.wrap_gnorm=null;this.gnormy=0;this.gnormx=0;this.wrap_lnorm=null;this.lnormy=0;this.lnormx=0;this.outer=null;this.polygon=null;this.next=null;this.lnormx=0;this.lnormy=0;this.gnormx=0;this.gnormy=0;this.length=0;this.lprojection=0;this.gprojection=0};c8.__name__=["zpp_nape","shape","ZPP_Edge"];c8.prototype.next=null;c8.prototype.free=function(){this.polygon=null};c8.prototype.alloc=function(){};c8.prototype.polygon=null;c8.prototype.outer=null;c8.prototype.wrapper=function(){if(this.outer==null){c8.internal=true;this.outer=new ba();c8.internal=false;this.outer.zpp_inner=this}return this.outer};c8.prototype.lnormx=null;c8.prototype.lnormy=null;c8.prototype.wrap_lnorm=null;c8.prototype.gnormx=null;c8.prototype.gnormy=null;c8.prototype.wrap_gnorm=null;c8.prototype.length=null;c8.prototype.lprojection=null;c8.prototype.gprojection=null;c8.prototype.lp0=null;c8.prototype.gp0=null;c8.prototype.lp1=null;c8.prototype.gp1=null;c8.prototype.tp0=null;c8.prototype.tp1=null;c8.prototype.lnorm_validate=function(){this.polygon.validate_laxi();this.wrap_lnorm.zpp_inner.x=this.lnormx;this.wrap_lnorm.zpp_inner.y=this.lnormy};c8.prototype.gnorm_validate=function(){var ee=this.polygon;if(ee.zip_gaxi){if(ee.body!=null){ee.zip_gaxi=false;ee.validate_laxi();var eh=ee.body;if(eh.zip_axis){eh.zip_axis=false;eh.axisx=Math.sin(eh.rot);eh.axisy=Math.cos(eh.rot)}if(ee.zip_gverts){if(ee.body!=null){ee.zip_gverts=false;ee.validate_lverts();var eg=ee.body;if(eg.zip_axis){eg.zip_axis=false;eg.axisx=Math.sin(eg.rot);eg.axisy=Math.cos(eg.rot)}var el=ee.lverts.next;var eb=ee.gverts.next;while(eb!=null){var ed=eb;var ec=el;el=el.next;ed.x=ee.body.posx+(ee.body.axisy*ec.x-ee.body.axisx*ec.y);ed.y=ee.body.posy+(ec.x*ee.body.axisx+ec.y*ee.body.axisy);eb=eb.next}}}var ea=ee.edges.head;var ej=ee.gverts.next;var em=ej;ej=ej.next;while(ej!=null){var ek=ej;var ef=ea.elt;ea=ea.next;ef.gp0=em;ef.gp1=ek;ef.gnormx=ee.body.axisy*ef.lnormx-ee.body.axisx*ef.lnormy;ef.gnormy=ef.lnormx*ee.body.axisx+ef.lnormy*ee.body.axisy;ef.gprojection=ee.body.posx*ef.gnormx+ee.body.posy*ef.gnormy+ef.lprojection;if(ef.wrap_gnorm!=null){ef.wrap_gnorm.zpp_inner.x=ef.gnormx;ef.wrap_gnorm.zpp_inner.y=ef.gnormy}ef.tp0=ef.gp0.y*ef.gnormx-ef.gp0.x*ef.gnormy;ef.tp1=ef.gp1.y*ef.gnormx-ef.gp1.x*ef.gnormy;em=ek;ej=ej.next}var ei=ea.elt;ei.gp0=em;ei.gp1=ee.gverts.next;ei.gnormx=ee.body.axisy*ei.lnormx-ee.body.axisx*ei.lnormy;ei.gnormy=ei.lnormx*ee.body.axisx+ei.lnormy*ee.body.axisy;ei.gprojection=ee.body.posx*ei.gnormx+ee.body.posy*ei.gnormy+ei.lprojection;if(ei.wrap_gnorm!=null){ei.wrap_gnorm.zpp_inner.x=ei.gnormx;ei.wrap_gnorm.zpp_inner.y=ei.gnormy}ei.tp0=ei.gp0.y*ei.gnormx-ei.gp0.x*ei.gnormy;ei.tp1=ei.gp1.y*ei.gnormx-ei.gp1.x*ei.gnormy}}this.wrap_gnorm.zpp_inner.x=this.gnormx;this.wrap_gnorm.zpp_inner.y=this.gnormy};c8.prototype.getlnorm=function(){var ea=this.lnormx;var eh=this.lnormy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_lnorm=eb;this.wrap_lnorm.zpp_inner._immutable=true;this.wrap_lnorm.zpp_inner._validate=dX(this,this.lnorm_validate)};c8.prototype.getgnorm=function(){var ea=this.gnormx;var eh=this.gnormy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_gnorm=eb;this.wrap_gnorm.zpp_inner._immutable=true;this.wrap_gnorm.zpp_inner._validate=dX(this,this.gnorm_validate)};c8.prototype.__class__=c8;var dQ=zpp_nape.shape.ZPP_Polygon=function(){this.zip_sanitation=false;this.zip_valid=false;this.zip_gaxi=false;this.zip_gverts=false;this.zip_laxi=false;this.zip_lverts=false;this.reverse_flag=false;this.edgeCnt=0;this.wrap_edges=null;this.edges=null;this.wrap_gverts=null;this.gverts=null;this.wrap_lverts=null;this.lverts=null;this.outer_zn=null;bZ.call(this,1);this.polygon=this;this.lverts=new bB();this.gverts=new bB();this.edges=new ce();this.edgeCnt=0};dQ.__name__=["zpp_nape","shape","ZPP_Polygon"];dQ.__super__=bZ;dQ.prototype=Object.create(bZ.prototype);dQ.prototype.outer_zn=null;dQ.prototype.lverts=null;dQ.prototype.wrap_lverts=null;dQ.prototype.gverts=null;dQ.prototype.wrap_gverts=null;dQ.prototype.edges=null;dQ.prototype.wrap_edges=null;dQ.prototype.edgeCnt=null;dQ.prototype.reverse_flag=null;dQ.prototype.__clear=function(){};dQ.prototype.lverts_pa_invalidate=function(ea){this.invalidate_lverts()};dQ.prototype.gverts_pa_validate=function(){if(this.zip_gverts){if(this.body!=null){this.zip_gverts=false;this.validate_lverts();var ee=this.body;if(ee.zip_axis){ee.zip_axis=false;ee.axisx=Math.sin(ee.rot);ee.axisy=Math.cos(ee.rot)}var ea=this.lverts.next;var ec=this.gverts.next;while(ec!=null){var ed=ec;var eb=ea;ea=ea.next;ed.x=this.body.posx+(this.body.axisy*eb.x-this.body.axisx*eb.y);ed.y=this.body.posy+(eb.x*this.body.axisx+eb.y*this.body.axisy);ec=ec.next}}}};dQ.prototype.lverts_post_adder=function(ei){ei.zpp_inner._invalidate=dX(this,this.lverts_pa_invalidate);var eb=null;var ef=null;var ee=this.lverts.next;while(ee!=null){if(ee==ei.zpp_inner){break}else{if(eb==null){eb=this.gverts.next}else{eb=eb.next}if(ef==null){ef=this.edges.head}else{ef=ef.next}}ee=ee.next}var eh;if(bB.zpp_pool==null){eh=new bB()}else{eh=bB.zpp_pool;bB.zpp_pool=eh.next;eh.next=null}eh.weak=false;eh._immutable=true;eh.x=0;eh.y=0;var ec=eh;this.gverts.insert(eb,ec);if(this.lverts.next.next!=null){if(this.lverts.next.next.next==null){var eg;if(c8.zpp_pool==null){eg=new c8()}else{eg=c8.zpp_pool;c8.zpp_pool=eg.next;eg.next=null}eg.polygon=this;this.edges.add(eg);var ea;if(c8.zpp_pool==null){ea=new c8()}else{ea=c8.zpp_pool;c8.zpp_pool=ea.next;ea.next=null}ea.polygon=this;this.edges.add(ea);this.edgeCnt+=2}else{var ej;if(c8.zpp_pool==null){ej=new c8()}else{ej=c8.zpp_pool;c8.zpp_pool=ej.next;ej.next=null}ej.polygon=this;this.edges.insert(ef,ej);this.edgeCnt++}}ec._validate=dX(this,this.gverts_pa_validate)};dQ.prototype.lverts_subber=function(ea){this.cleanup_lvert(ea.zpp_inner)};dQ.prototype.lverts_invalidate=function(ea){this.invalidate_lverts()};dQ.prototype.lverts_validate=function(){this.validate_lverts()};dQ.prototype.gverts_validate=function(){if(this.zip_gverts){if(this.body!=null){this.zip_gverts=false;this.validate_lverts();var ee=this.body;if(ee.zip_axis){ee.zip_axis=false;ee.axisx=Math.sin(ee.rot);ee.axisy=Math.cos(ee.rot)}var ea=this.lverts.next;var ec=this.gverts.next;while(ec!=null){var ed=ec;var eb=ea;ea=ea.next;ed.x=this.body.posx+(this.body.axisy*eb.x-this.body.axisx*eb.y);ed.y=this.body.posy+(eb.x*this.body.axisx+eb.y*this.body.axisy);ec=ec.next}}}};dQ.prototype.edges_validate=function(){this.validate_lverts()};dQ.prototype.getlverts=function(){this.wrap_lverts=ao.get(this.lverts);this.wrap_lverts.zpp_inner.post_adder=dX(this,this.lverts_post_adder);this.wrap_lverts.zpp_inner.subber=dX(this,this.lverts_subber);this.wrap_lverts.zpp_inner._invalidate=dX(this,this.lverts_invalidate);this.wrap_lverts.zpp_inner._validate=dX(this,this.lverts_validate);this.wrap_lverts.zpp_inner.reverse_flag=this.reverse_flag};dQ.prototype.getgverts=function(){this.wrap_gverts=ao.get(this.gverts,true);this.wrap_gverts.zpp_inner.reverse_flag=this.reverse_flag;this.wrap_gverts.zpp_inner._validate=dX(this,this.gverts_validate)};dQ.prototype.getedges=function(){this.wrap_edges=aw.get(this.edges,true);this.wrap_edges.zpp_inner.reverse_flag=this.reverse_flag;this.wrap_edges.zpp_inner._validate=dX(this,this.edges_validate)};dQ.prototype.zip_lverts=null;dQ.prototype.invalidate_lverts=function(){this.invalidate_laxi();this.invalidate_area_inertia();this.invalidate_angDrag();this.invalidate_localCOM();this.invalidate_gverts();this.zip_lverts=true;this.zip_valid=true;this.zip_sanitation=true;if(this.body!=null){this.body.wake()}};dQ.prototype.zip_laxi=null;dQ.prototype.invalidate_laxi=function(){this.invalidate_gaxi();this.zip_sweepRadius=true;this.zip_laxi=true};dQ.prototype.zip_gverts=null;dQ.prototype.invalidate_gverts=function(){this.zip_aabb=true;if(this.body!=null){this.body.zip_aabb=true}this.zip_gverts=true};dQ.prototype.zip_gaxi=null;dQ.prototype.invalidate_gaxi=function(){this.zip_gaxi=true};dQ.prototype.zip_valid=null;dQ.prototype.validation=null;dQ.prototype.valid=function(){if(this.zip_valid){this.zip_valid=false;if(this.zip_sanitation){this.zip_sanitation=false;this.splice_collinear_real()}if(this.lverts.length<3){if(br.ValidationResult_DEGENERATE==null){br.internal=true;br.ValidationResult_DEGENERATE=new al();br.internal=false}return this.validation=br.ValidationResult_DEGENERATE}else{this.validate_lverts();this.validate_area_inertia();if(this.areaP.epsilon){fi=true}else{if(er<-P.epsilon){e0=true}}if(fi&&e0){fe=false;break}eA=ez;ez=ey;e6=e6.next}if(fe){e6=this.lverts.next;var eH=e6;while(true){var eq=0;var eh=0;eq=eH.x-ez.x;eh=eH.y-ez.y;var em=0;var ec=0;em=ez.x-eA.x;ec=ez.y-eA.y;var ef=ec*eq-em*eh;if(ef>P.epsilon){fi=true}else{if(ef<-P.epsilon){e0=true}}if(fi&&e0){fe=false;break}break}if(fe){eA=ez;ez=eH;e6=e6.next;var eG=e6;while(true){var eo=0;var eg=0;eo=eG.x-eH.x;eg=eG.y-eH.y;var el=0;var ea=0;el=eH.x-eA.x;ea=eH.y-eA.y;var ee=ea*eo-el*eg;if(ee>P.epsilon){fi=true}else{if(ee<-P.epsilon){e0=true}}if(fi&&e0){break}break}}}if(fi&&e0){if(br.ValidationResult_CONCAVE==null){br.internal=true;br.ValidationResult_CONCAVE=new al();br.internal=false}return this.validation=br.ValidationResult_CONCAVE}else{var e4=true;var eu=true;var eZ=this.lverts.next;var fd=eZ;eZ=eZ.next;while(eZ!=null){var eW=eZ;if(!e4){eu=false;break}var et=true;var eY=this.lverts.next;var eN=eY;eY=eY.next;while(eY!=null){var eL=eY;if(fd==eN||fd==eL||eW==eN||eW==eL){eN=eL;eY=eY.next;continue}var fa=0;var e8=0;fa=fd.x-eN.x;e8=fd.y-eN.y;var ep=0;var en=0;ep=eW.x-fd.x;en=eW.y-fd.y;var ed=0;var eb=0;ed=eL.x-eN.x;eb=eL.y-eN.y;var fj=en*ed-ep*eb;if(fj*fj>P.epsilon){fj=1/fj;var eC=(eb*fa-ed*e8)*fj;if(eC>P.epsilon&&eC<1-P.epsilon){var eE=(en*fa-ep*e8)*fj;if(eE>P.epsilon&&eE<1-P.epsilon){e4=false;et=false;break}}}eN=eL;eY=eY.next}if(et){while(true){var fh=this.lverts.next;if(fd==eN||fd==fh||eW==eN||eW==fh){break}var e7=0;var eO=0;e7=fd.x-eN.x;eO=fd.y-eN.y;var eU=0;var eF=0;eU=eW.x-fd.x;eF=eW.y-fd.y;var fc=0;var eS=0;fc=fh.x-eN.x;eS=fh.y-eN.y;var ex=eF*fc-eU*eS;if(ex*ex>P.epsilon){ex=1/ex;var fm=(eS*e7-fc*eO)*ex;if(fm>P.epsilon&&fm<1-P.epsilon){var ek=(eF*e7-eU*eO)*ex;if(ek>P.epsilon&&ek<1-P.epsilon){e4=false;break}}}break}}fd=eW;eZ=eZ.next}if(eu){while(true){var eV=this.lverts.next;if(!e4){break}var es=true;var eX=this.lverts.next;var fn=eX;eX=eX.next;while(eX!=null){var fg=eX;if(fd==fn||fd==fg||eV==fn||eV==fg){fn=fg;eX=eX.next;continue}var e5=0;var eM=0;e5=fd.x-fn.x;eM=fd.y-fn.y;var eT=0;var eD=0;eT=eV.x-fd.x;eD=eV.y-fd.y;var fb=0;var eQ=0;fb=fg.x-fn.x;eQ=fg.y-fn.y;var ew=eD*fb-eT*eQ;if(ew*ew>P.epsilon){ew=1/ew;var fl=(eQ*e5-fb*eM)*ew;if(fl>P.epsilon&&fl<1-P.epsilon){var ej=(eD*e5-eT*eM)*ew;if(ej>P.epsilon&&ej<1-P.epsilon){e4=false;es=false;break}}}fn=fg;eX=eX.next}if(es){while(true){var ff=this.lverts.next;if(fd==fn||fd==ff||eV==fn||eV==ff){break}var e3=0;var eK=0;e3=fd.x-fn.x;eK=fd.y-fn.y;var eR=0;var eB=0;eR=eV.x-fd.x;eB=eV.y-fd.y;var e9=0;var eP=0;e9=ff.x-fn.x;eP=ff.y-fn.y;var ev=eB*e9-eR*eP;if(ev*ev>P.epsilon){ev=1/ev;var fk=(eP*e3-e9*eK)*ev;if(fk>P.epsilon&&fk<1-P.epsilon){var ei=(eB*e3-eR*eK)*ev;if(ei>P.epsilon&&ei<1-P.epsilon){e4=false;break}}}break}}break}}if(!e4){if(br.ValidationResult_SELF_INTERSECTING==null){br.internal=true;br.ValidationResult_SELF_INTERSECTING=new al();br.internal=false}return this.validation=br.ValidationResult_SELF_INTERSECTING}else{if(br.ValidationResult_VALID==null){br.internal=true;br.ValidationResult_VALID=new al();br.internal=false}return this.validation=br.ValidationResult_VALID}}}}}else{return this.validation}};dQ.prototype.validate_lverts=function(){if(this.zip_lverts){this.zip_lverts=false;if(this.lverts.length>2){this.validate_area_inertia();if(this.area<0){this.reverse_vertices();this.area=-this.area}}}};dQ.prototype.cleanup_lvert=function(ej){var ea=null;var ei=null;var eh=this.lverts.next;while(eh!=null){if(eh==ej){break}else{if(ea==null){ea=this.gverts.next}else{ea=ea.next}if(ei==null){ei=this.edges.head}else{ei=ei.next}}eh=eh.next}var ek=ea==null?this.gverts.next:ea.next;this.gverts.erase(ea);var ed=ek;if(ed.outer!=null){ed.outer.zpp_inner=null;ed.outer=null}ed._isimmutable=null;ed._validate=null;ed._invalidate=null;ed.next=bB.zpp_pool;bB.zpp_pool=ed;if(this.edgeCnt==2){var ee=this.edges.pop_unsafe();var eg=ee;eg.polygon=null;eg.next=c8.zpp_pool;c8.zpp_pool=eg;ee=this.edges.pop_unsafe();var ef=ee;ef.polygon=null;ef.next=c8.zpp_pool;c8.zpp_pool=ef;this.edgeCnt=0}else{if(this.edgeCnt!=0){var eb=ei==null?this.edges.head.elt:ei.next.elt;this.edges.erase(ei);var ec=eb;ec.polygon=null;ec.next=c8.zpp_pool;c8.zpp_pool=ec;this.edgeCnt--}}};dQ.prototype.zip_sanitation=null;dQ.prototype.splice_collinear=function(){if(this.zip_sanitation){this.zip_sanitation=false;this.splice_collinear_real()}};dQ.prototype.splice_collinear_real=function(){if(this.lverts.next==null){return}if(this.lverts.next.next==null){return}if(this.lverts.next.next.next==null){return}var er=null;var ee=this.lverts.next;while(ee!=null){var eh=ee.next==null?this.lverts.next:ee.next;var eq=ee;var ep=eh;var en=eq.x;var ej=eq.y;var ev=ep.x;var es=ep.y;var eo=0;var em=0;eo=en-ev;em=ej-es;if(eo*eo+em*em=P.epsilon*P.epsilon){eb=eb.next}else{this.cleanup_lvert(eg);this.lverts.erase(eb.next==null?null:eb);ew=true;eb=eb.next}}if(!ew){break}}};dQ.prototype.reverse_vertices=function(){this.lverts.reverse();this.gverts.reverse();this.edges.reverse();this.edges.insert(this.edges.iterator_at(this.edgeCnt-1),this.edges.pop_unsafe());this.reverse_flag=!this.reverse_flag;if(this.wrap_lverts!=null){this.wrap_lverts.zpp_inner.reverse_flag=this.reverse_flag}if(this.wrap_gverts!=null){this.wrap_gverts.zpp_inner.reverse_flag=this.reverse_flag}if(this.wrap_edges!=null){this.wrap_edges.zpp_inner.reverse_flag=this.reverse_flag}};dQ.prototype.validate_laxi=function(){if(this.zip_laxi){this.zip_laxi=false;this.validate_lverts();var ea=this.edges.head;var ed=this.lverts.next;var en=ed;ed=ed.next;while(ed!=null){var em=ed;var eb=ea.elt;ea=ea.next;eb.lp0=en;eb.lp1=em;var eq=0;var ep=0;eq=en.x-em.x;ep=en.y-em.y;var ef=Math.sqrt(eq*eq+ep*ep);eb.length=ef;var eo=1/ef;eq*=eo;ep*=eo;var ej=eq;eq=-ep;ep=ej;eb.lprojection=eq*en.x+ep*en.y;eb.lnormx=eq;eb.lnormy=ep;if(eb.wrap_lnorm!=null){eb.wrap_lnorm.zpp_inner.x=eq;eb.wrap_lnorm.zpp_inner.y=ep}en=em;ed=ed.next}var ek=this.lverts.next;var ec=ea.elt;ec.lp0=en;ec.lp1=ek;var el=0;var ei=0;el=en.x-ek.x;ei=en.y-ek.y;var ee=Math.sqrt(el*el+ei*ei);ec.length=ee;var eh=1/ee;el*=eh;ei*=eh;var eg=el;el=-ei;ei=eg;ec.lprojection=el*en.x+ei*en.y;ec.lnormx=el;ec.lnormy=ei;if(ec.wrap_lnorm!=null){ec.wrap_lnorm.zpp_inner.x=el;ec.wrap_lnorm.zpp_inner.y=ei}}};dQ.prototype.validate_gverts=function(){if(this.zip_gverts){if(this.body!=null){this.zip_gverts=false;this.validate_lverts();var ee=this.body;if(ee.zip_axis){ee.zip_axis=false;ee.axisx=Math.sin(ee.rot);ee.axisy=Math.cos(ee.rot)}var ea=this.lverts.next;var ec=this.gverts.next;while(ec!=null){var ed=ec;var eb=ea;ea=ea.next;ed.x=this.body.posx+(this.body.axisy*eb.x-this.body.axisx*eb.y);ed.y=this.body.posy+(eb.x*this.body.axisx+eb.y*this.body.axisy);ec=ec.next}}}};dQ.prototype.validate_gaxi=function(){if(this.zip_gaxi){if(this.body!=null){this.zip_gaxi=false;this.validate_laxi();var ee=this.body;if(ee.zip_axis){ee.zip_axis=false;ee.axisx=Math.sin(ee.rot);ee.axisy=Math.cos(ee.rot)}if(this.zip_gverts){if(this.body!=null){this.zip_gverts=false;this.validate_lverts();var eg=this.body;if(eg.zip_axis){eg.zip_axis=false;eg.axisx=Math.sin(eg.rot);eg.axisy=Math.cos(eg.rot)}var ek=this.lverts.next;var eb=this.gverts.next;while(eb!=null){var ed=eb;var ec=ek;ek=ek.next;ed.x=this.body.posx+(this.body.axisy*ec.x-this.body.axisx*ec.y);ed.y=this.body.posy+(ec.x*this.body.axisx+ec.y*this.body.axisy);eb=eb.next}}}var ea=this.edges.head;var ei=this.gverts.next;var el=ei;ei=ei.next;while(ei!=null){var ej=ei;var ef=ea.elt;ea=ea.next;ef.gp0=el;ef.gp1=ej;ef.gnormx=this.body.axisy*ef.lnormx-this.body.axisx*ef.lnormy;ef.gnormy=ef.lnormx*this.body.axisx+ef.lnormy*this.body.axisy;ef.gprojection=this.body.posx*ef.gnormx+this.body.posy*ef.gnormy+ef.lprojection;if(ef.wrap_gnorm!=null){ef.wrap_gnorm.zpp_inner.x=ef.gnormx;ef.wrap_gnorm.zpp_inner.y=ef.gnormy}ef.tp0=ef.gp0.y*ef.gnormx-ef.gp0.x*ef.gnormy;ef.tp1=ef.gp1.y*ef.gnormx-ef.gp1.x*ef.gnormy;el=ej;ei=ei.next}var eh=ea.elt;eh.gp0=el;eh.gp1=this.gverts.next;eh.gnormx=this.body.axisy*eh.lnormx-this.body.axisx*eh.lnormy;eh.gnormy=eh.lnormx*this.body.axisx+eh.lnormy*this.body.axisy;eh.gprojection=this.body.posx*eh.gnormx+this.body.posy*eh.gnormy+eh.lprojection;if(eh.wrap_gnorm!=null){eh.wrap_gnorm.zpp_inner.x=eh.gnormx;eh.wrap_gnorm.zpp_inner.y=eh.gnormy}eh.tp0=eh.gp0.y*eh.gnormx-eh.gp0.x*eh.gnormy;eh.tp1=eh.gp1.y*eh.gnormx-eh.gp1.x*eh.gnormy}}};dQ.prototype.__validate_aabb=function(){if(this.zip_gverts){if(this.body!=null){this.zip_gverts=false;this.validate_lverts();var eh=this.body;if(eh.zip_axis){eh.zip_axis=false;eh.axisx=Math.sin(eh.rot);eh.axisy=Math.cos(eh.rot)}var ea=this.lverts.next;var ec=this.gverts.next;while(ec!=null){var ee=ec;var eb=ea;ea=ea.next;ee.x=this.body.posx+(this.body.axisy*eb.x-this.body.axisx*eb.y);ee.y=this.body.posy+(eb.x*this.body.axisx+eb.y*this.body.axisy);ec=ec.next}}}var eg=this.gverts.next;this.aabb.minx=eg.x;this.aabb.miny=eg.y;this.aabb.maxx=eg.x;this.aabb.maxy=eg.y;var ed=this.gverts.next.next;while(ed!=null){var ef=ed;if(ef.xthis.aabb.maxx){this.aabb.maxx=ef.x}if(ef.ythis.aabb.maxy){this.aabb.maxy=ef.y}ed=ed.next}};dQ.prototype._force_validate_aabb=function(){var ea=this.lverts.next;var ef=this.gverts.next;var ec=ea;ea=ea.next;ef.x=this.body.posx+(this.body.axisy*ec.x-this.body.axisx*ec.y);ef.y=this.body.posy+(ec.x*this.body.axisx+ec.y*this.body.axisy);this.aabb.minx=ef.x;this.aabb.miny=ef.y;this.aabb.maxx=ef.x;this.aabb.maxy=ef.y;var ed=this.gverts.next.next;while(ed!=null){var ee=ed;var eb=ea;ea=ea.next;ee.x=this.body.posx+(this.body.axisy*eb.x-this.body.axisx*eb.y);ee.y=this.body.posy+(eb.x*this.body.axisx+eb.y*this.body.axisy);if(ee.xthis.aabb.maxx){this.aabb.maxx=ee.x}if(ee.ythis.aabb.maxy){this.aabb.maxy=ee.y}ed=ed.next}};dQ.prototype.__validate_sweepRadius=function(){var ee=0;var eg=0;this.validate_laxi();var eb=this.lverts.next;while(eb!=null){var ea=eb;var ed=ea.x*ea.x+ea.y*ea.y;if(ed>ee){ee=ed}eb=eb.next}var ec=this.edges.head;while(ec!=null){var ef=ec.elt;if(ef.lprojection0){var ef=eH>1?1:eH;var es=0;var er=0;es=eG.x;er=eG.y;var eD=ef;es+=ed*eD;er+=ec*eD;var eo=eh.lnormy*eG.x-eh.lnormx*eG.y;var en=eh.lnormy*es-eh.lnormx*er;em+=(en*en*en-eo*eo*eo)/(3*(en-eo))*ef*eh.length*P.fluidAngularDrag}if(eH<1){var ee=eH<0?0:eH;var eM=0;var ev=0;eM=eG.x;ev=eG.y;var eC=ee;eM+=ed*eC;ev+=ec*eC;var ez=eh.lnormy*eM-eh.lnormx*ev;var el=eh.lnormy*eF.x-eh.lnormx*eF.y;em+=(el*el*el-ez*ez*ez)/(3*(el-ez))*P.fluidVacuumDrag*(1-ee)*eh.length*P.fluidAngularDrag}eJ=eI;eG=eF;eI=eI.next}while(true){eI=this.lverts.next;var eO=eI;var ea=eN.elt;eN=eN.next;eg+=ea.length;var eE=0;var eq=0;eE=eO.x-eG.x;eq=eO.y-eG.y;em+=ea.length*P.fluidAngularDragFriction*this.material.dynamicFriction*ea.lprojection*ea.lprojection;var eB=-(eG.y*ea.lnormx-eG.x*ea.lnormy)/(eq*ea.lnormx-eE*ea.lnormy);if(eB>0){var ep=eB>1?1:eB;var eL=0;var eu=0;eL=eG.x;eu=eG.y;var eA=ep;eL+=eE*eA;eu+=eq*eA;var ey=ea.lnormy*eG.x-ea.lnormx*eG.y;var ek=ea.lnormy*eL-ea.lnormx*eu;em+=(ek*ek*ek-ey*ey*ey)/(3*(ek-ey))*ep*ea.length*P.fluidAngularDrag}if(eB<1){var eb=eB<0?0:eB;var eK=0;var et=0;eK=eG.x;et=eG.y;var ex=eb;eK+=eE*ex;et+=eq*ex;var ew=ea.lnormy*eK-ea.lnormx*et;var ej=ea.lnormy*eO.x-ea.lnormx*eO.y;em+=(ej*ej*ej-ew*ew*ew)/(3*(ej-ew))*P.fluidVacuumDrag*(1-eb)*ea.length*P.fluidAngularDrag}break}this.angDrag=em/(this.inertia*eg)};dQ.prototype.__validate_localCOM=function(){if(this.lverts.next.next==null){this.localCOMx=this.lverts.next.x;this.localCOMy=this.lverts.next.y}else{if(this.lverts.next.next.next==null){this.localCOMx=this.lverts.next.x;this.localCOMy=this.lverts.next.y;this.localCOMx+=this.lverts.next.next.x;this.localCOMy+=this.lverts.next.next.y;this.localCOMx*=0.5;this.localCOMy*=0.5}else{this.localCOMx=0;this.localCOMy=0;var eb=0;var ec=this.lverts.next;var ei=ec;ec=ec.next;var eh=ec;ec=ec.next;while(ec!=null){var ef=ec;eb+=eh.x*(ef.y-ei.y);var ea=ef.y*eh.x-ef.x*eh.y;this.localCOMx+=(eh.x+ef.x)*ea;this.localCOMy+=(eh.y+ef.y)*ea;ei=eh;eh=ef;ec=ec.next}ec=this.lverts.next;var ee=ec;eb+=eh.x*(ee.y-ei.y);var ej=ee.y*eh.x-ee.x*eh.y;this.localCOMx+=(eh.x+ee.x)*ej;this.localCOMy+=(eh.y+ee.y)*ej;ei=eh;ec=ec.next;var ed=ec;eb+=ee.x*(ed.y-ei.y);var eg=ed.y*ee.x-ed.x*ee.y;this.localCOMx+=(ee.x+ed.x)*eg;this.localCOMy+=(ee.y+ed.y)*eg;eb=1/(3*eb);var ek=eb;this.localCOMx*=ek;this.localCOMy*=ek}}};dQ.prototype.localCOM_validate=function(){if(this.zip_localCOM){this.zip_localCOM=false;if(this.type==1){var ef=this.polygon;if(ef.lverts.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y}else{if(ef.lverts.next.next.next==null){ef.localCOMx=ef.lverts.next.x;ef.localCOMy=ef.lverts.next.y;ef.localCOMx+=ef.lverts.next.next.x;ef.localCOMy+=ef.lverts.next.next.y;ef.localCOMx*=0.5;ef.localCOMy*=0.5}else{ef.localCOMx=0;ef.localCOMy=0;var eb=0;var ec=ef.lverts.next;var ek=ec;ec=ec.next;var ei=ec;ec=ec.next;while(ec!=null){var eg=ec;eb+=ei.x*(eg.y-ek.y);var ea=eg.y*ei.x-eg.x*ei.y;ef.localCOMx+=(ei.x+eg.x)*ea;ef.localCOMy+=(ei.y+eg.y)*ea;ek=ei;ei=eg;ec=ec.next}ec=ef.lverts.next;var ee=ec;eb+=ei.x*(ee.y-ek.y);var ej=ee.y*ei.x-ee.x*ei.y;ef.localCOMx+=(ei.x+ee.x)*ej;ef.localCOMy+=(ei.y+ee.y)*ej;ek=ei;ec=ec.next;var ed=ec;eb+=ee.x*(ed.y-ek.y);var eh=ed.y*ee.x-ed.x*ee.y;ef.localCOMx+=(ee.x+ed.x)*eh;ef.localCOMy+=(ee.y+ed.y)*eh;eb=1/(3*eb);var el=eb;ef.localCOMx*=el;ef.localCOMy*=el}}}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}}};dQ.prototype.localCOM_invalidate=function(ej){if(this.zip_localCOM){this.zip_localCOM=false;if(this.type==1){var ei=this.polygon;if(ei.lverts.next.next==null){ei.localCOMx=ei.lverts.next.x;ei.localCOMy=ei.lverts.next.y}else{if(ei.lverts.next.next.next==null){ei.localCOMx=ei.lverts.next.x;ei.localCOMy=ei.lverts.next.y;ei.localCOMx+=ei.lverts.next.next.x;ei.localCOMy+=ei.lverts.next.next.y;ei.localCOMx*=0.5;ei.localCOMy*=0.5}else{ei.localCOMx=0;ei.localCOMy=0;var ee=0;var ef=ei.lverts.next;var ep=ef;ef=ef.next;var en=ef;ef=ef.next;while(ef!=null){var el=ef;ee+=en.x*(el.y-ep.y);var ed=el.y*en.x-el.x*en.y;ei.localCOMx+=(en.x+el.x)*ed;ei.localCOMy+=(en.y+el.y)*ed;ep=en;en=el;ef=ef.next}ef=ei.lverts.next;var eh=ef;ee+=en.x*(eh.y-ep.y);var eo=eh.y*en.x-eh.x*en.y;ei.localCOMx+=(en.x+eh.x)*eo;ei.localCOMy+=(en.y+eh.y)*eo;ep=en;ef=ef.next;var eg=ef;ee+=eh.x*(eg.y-ep.y);var em=eg.y*eh.x-eg.x*eh.y;ei.localCOMx+=(eh.x+eg.x)*em;ei.localCOMy+=(eh.y+eg.y)*em;ee=1/(3*ee);var eq=ee;ei.localCOMx*=eq;ei.localCOMy*=eq}}}if(this.wrap_localCOM!=null){this.wrap_localCOM.zpp_inner.x=this.localCOMx;this.wrap_localCOM.zpp_inner.y=this.localCOMy}}var eb=0;var ea=0;eb=ej.x-this.localCOMx;ea=ej.y-this.localCOMy;var ek=this.lverts.next;while(ek!=null){var ec=ek;ec.x+=eb;ec.y+=ea;ek=ek.next}this.invalidate_lverts()};dQ.prototype.setupLocalCOM=function(){var ea=this.localCOMx;var eh=this.localCOMy;var eb;if(au.poolVec2==null){eb=new r()}else{eb=au.poolVec2;au.poolVec2=eb.zpp_pool;eb.zpp_pool=null}if(eb.zpp_inner==null){var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ea;ef.y=eh;eb.zpp_inner=ef;eb.zpp_inner.outer=eb}else{var ec;var eg=eb.zpp_inner;if(eg._validate!=null){eg._validate()}if(eb.zpp_inner.x==ea){var ee=eb.zpp_inner;if(ee._validate!=null){ee._validate()}ec=eb.zpp_inner.y==eh}else{ec=false}if(!ec){eb.zpp_inner.x=ea;eb.zpp_inner.y=eh;var ed=eb.zpp_inner;if(ed._invalidate!=null){ed._invalidate(ed)}}}eb.zpp_inner.weak=false;this.wrap_localCOM=eb;this.wrap_localCOM.zpp_inner._inuse=true;this.wrap_localCOM.zpp_inner._validate=dX(this,this.localCOM_validate);this.wrap_localCOM.zpp_inner._invalidate=dX(this,this.localCOM_invalidate)};dQ.prototype.__translate=function(eb,ea){var ec=this.lverts.next;while(ec!=null){var ed=ec;ed.x+=eb;ed.y+=ea;ec=ec.next}this.invalidate_lverts()};dQ.prototype.__scale=function(ed,ec){var ea=this.lverts.next;while(ea!=null){var eb=ea;eb.x*=ed;eb.y*=ec;ea=ea.next}this.invalidate_lverts()};dQ.prototype.__rotate=function(ee,ed){var eb=this.lverts.next;while(eb!=null){var ef=eb;var ec=0;var ea=0;ec=ed*ef.x-ee*ef.y;ea=ef.x*ee+ef.y*ed;ef.x=ec;ef.y=ea;eb=eb.next}this.invalidate_lverts()};dQ.prototype.__transform=function(ec){var eb=this.lverts.next;while(eb!=null){var ed=eb;var ea=ec.zpp_inner.a*ed.x+ec.zpp_inner.b*ed.y+ec.zpp_inner.tx;ed.y=ec.zpp_inner.c*ed.x+ec.zpp_inner.d*ed.y+ec.zpp_inner.ty;ed.x=ea;eb=eb.next}this.invalidate_lverts()};dQ.prototype.__copy=function(){var ea=this.outer_zn;if(ea.zpp_inner_zn.wrap_lverts==null){ea.zpp_inner_zn.getlverts()}return new Z(ea.zpp_inner_zn.wrap_lverts).zpp_inner_zn};dQ.prototype.__class__=dQ;var dB=zpp_nape.space.ZPP_Broadphase=function(){this.circShape=null;this.matrix=null;this.aabbShape=null;this.dynab=null;this.sweep=null;this.is_sweep=false;this.space=null};dB.__name__=["zpp_nape","space","ZPP_Broadphase"];dB.prototype.space=null;dB.prototype.is_sweep=null;dB.prototype.sweep=null;dB.prototype.dynab=null;dB.prototype.insert=function(ea){if(this.is_sweep){this.sweep.__insert(ea)}else{this.dynab.__insert(ea)}};dB.prototype.remove=function(ea){if(this.is_sweep){this.sweep.__remove(ea)}else{this.dynab.__remove(ea)}};dB.prototype.sync=function(el){if(this.is_sweep){if(!this.sweep.space.continuous){if(el.zip_aabb){if(el.body!=null){el.zip_aabb=false;if(el.type==0){var ea=el.circle;if(ea.zip_worldCOM){if(ea.body!=null){ea.zip_worldCOM=false;if(ea.zip_localCOM){ea.zip_localCOM=false;if(ea.type==1){var eR=ea.polygon;if(eR.lverts.next.next==null){eR.localCOMx=eR.lverts.next.x;eR.localCOMy=eR.lverts.next.y}else{if(eR.lverts.next.next.next==null){eR.localCOMx=eR.lverts.next.x;eR.localCOMy=eR.lverts.next.y;eR.localCOMx+=eR.lverts.next.next.x;eR.localCOMy+=eR.lverts.next.next.y;eR.localCOMx*=0.5;eR.localCOMy*=0.5}else{eR.localCOMx=0;eR.localCOMy=0;var ev=0;var ec=eR.lverts.next;var eQ=ec;ec=ec.next;var eO=ec;ec=ec.next;while(ec!=null){var eM=ec;ev+=eO.x*(eM.y-eQ.y);var es=eM.y*eO.x-eM.x*eO.y;eR.localCOMx+=(eO.x+eM.x)*es;eR.localCOMy+=(eO.y+eM.y)*es;eQ=eO;eO=eM;ec=ec.next}ec=eR.lverts.next;var ey=ec;ev+=eO.x*(ey.y-eQ.y);var eK=ey.y*eO.x-ey.x*eO.y;eR.localCOMx+=(eO.x+ey.x)*eK;eR.localCOMy+=(eO.y+ey.y)*eK;eQ=eO;ec=ec.next;var ew=ec;ev+=ey.x*(ew.y-eQ.y);var eH=ew.y*ey.x-ew.x*ey.y;eR.localCOMx+=(ey.x+ew.x)*eH;eR.localCOMy+=(ey.y+ew.y)*eH;ev=1/(3*ev);var eS=ev;eR.localCOMx*=eS;eR.localCOMy*=eS}}}if(ea.wrap_localCOM!=null){ea.wrap_localCOM.zpp_inner.x=ea.localCOMx;ea.wrap_localCOM.zpp_inner.y=ea.localCOMy}}var eP=ea.body;if(eP.zip_axis){eP.zip_axis=false;eP.axisx=Math.sin(eP.rot);eP.axisy=Math.cos(eP.rot)}ea.worldCOMx=ea.body.posx+(ea.body.axisy*ea.localCOMx-ea.body.axisx*ea.localCOMy);ea.worldCOMy=ea.body.posy+(ea.localCOMx*ea.body.axisx+ea.localCOMy*ea.body.axisy)}}var eo=ea.radius;var en=ea.radius;ea.aabb.minx=ea.worldCOMx-eo;ea.aabb.miny=ea.worldCOMy-en;ea.aabb.maxx=ea.worldCOMx+eo;ea.aabb.maxy=ea.worldCOMy+en}else{var eN=el.polygon;if(eN.zip_gverts){if(eN.body!=null){eN.zip_gverts=false;eN.validate_lverts();var eL=eN.body;if(eL.zip_axis){eL.zip_axis=false;eL.axisx=Math.sin(eL.rot);eL.axisy=Math.cos(eL.rot)}var ex=eN.lverts.next;var ek=eN.gverts.next;while(ek!=null){var eZ=ek;var eW=ex;ex=ex.next;eZ.x=eN.body.posx+(eN.body.axisy*eW.x-eN.body.axisx*eW.y);eZ.y=eN.body.posy+(eW.x*eN.body.axisx+eW.y*eN.body.axisy);ek=ek.next}}}var e2=eN.gverts.next;eN.aabb.minx=e2.x;eN.aabb.miny=e2.y;eN.aabb.maxx=e2.x;eN.aabb.maxy=e2.y;var ej=eN.gverts.next.next;while(ej!=null){var eU=ej;if(eU.xeN.aabb.maxx){eN.aabb.maxx=eU.x}if(eU.yeN.aabb.maxy){eN.aabb.maxy=eU.y}ej=ej.next}}}}}}else{var eJ=this.dynab;var eq=el.node;if(!eq.synced){if(!eJ.space.continuous){if(el.zip_aabb){if(el.body!=null){el.zip_aabb=false;if(el.type==0){var eG=el.circle;if(eG.zip_worldCOM){if(eG.body!=null){eG.zip_worldCOM=false;if(eG.zip_localCOM){eG.zip_localCOM=false;if(eG.type==1){var eF=eG.polygon;if(eF.lverts.next.next==null){eF.localCOMx=eF.lverts.next.x;eF.localCOMy=eF.lverts.next.y}else{if(eF.lverts.next.next.next==null){eF.localCOMx=eF.lverts.next.x;eF.localCOMy=eF.lverts.next.y;eF.localCOMx+=eF.lverts.next.next.x;eF.localCOMy+=eF.lverts.next.next.y;eF.localCOMx*=0.5;eF.localCOMy*=0.5}else{eF.localCOMx=0;eF.localCOMy=0;var em=0;var ei=eF.lverts.next;var ef=ei;ei=ei.next;var e3=ei;ei=ei.next;while(ei!=null){var eu=ei;em+=e3.x*(eu.y-ef.y);var eE=eu.y*e3.x-eu.x*e3.y;eF.localCOMx+=(e3.x+eu.x)*eE;eF.localCOMy+=(e3.y+eu.y)*eE;ef=e3;e3=eu;ei=ei.next}ei=eF.lverts.next;var er=ei;em+=e3.x*(er.y-ef.y);var eC=er.y*e3.x-er.x*e3.y;eF.localCOMx+=(e3.x+er.x)*eC;eF.localCOMy+=(e3.y+er.y)*eC;ef=e3;ei=ei.next;var ep=ei;em+=er.x*(ep.y-ef.y);var eA=ep.y*er.x-ep.x*er.y;eF.localCOMx+=(er.x+ep.x)*eA;eF.localCOMy+=(er.y+ep.y)*eA;em=1/(3*em);var et=em;eF.localCOMx*=et;eF.localCOMy*=et}}}if(eG.wrap_localCOM!=null){eG.wrap_localCOM.zpp_inner.x=eG.localCOMx;eG.wrap_localCOM.zpp_inner.y=eG.localCOMy}}var eB=eG.body;if(eB.zip_axis){eB.zip_axis=false;eB.axisx=Math.sin(eB.rot);eB.axisy=Math.cos(eB.rot)}eG.worldCOMx=eG.body.posx+(eG.body.axisy*eG.localCOMx-eG.body.axisx*eG.localCOMy);eG.worldCOMy=eG.body.posy+(eG.localCOMx*eG.body.axisx+eG.localCOMy*eG.body.axisy)}}var eb=eG.radius;var eT=eG.radius;eG.aabb.minx=eG.worldCOMx-eb;eG.aabb.miny=eG.worldCOMy-eT;eG.aabb.maxx=eG.worldCOMx+eb;eG.aabb.maxy=eG.worldCOMy+eT}else{var ez=el.polygon;if(ez.zip_gverts){if(ez.body!=null){ez.zip_gverts=false;ez.validate_lverts();var e0=ez.body;if(e0.zip_axis){e0.zip_axis=false;e0.axisx=Math.sin(e0.rot);e0.axisy=Math.cos(e0.rot)}var eD=ez.lverts.next;var eh=ez.gverts.next;while(eh!=null){var eX=eh;var ed=eD;eD=eD.next;eX.x=ez.body.posx+(ez.body.axisy*ed.x-ez.body.axisx*ed.y);eX.y=ez.body.posy+(ed.x*ez.body.axisx+ed.y*ez.body.axisy);eh=eh.next}}}var eV=ez.gverts.next;ez.aabb.minx=eV.x;ez.aabb.miny=eV.y;ez.aabb.maxx=eV.x;ez.aabb.maxy=eV.y;var eg=ez.gverts.next.next;while(eg!=null){var e1=eg;if(e1.xez.aabb.maxx){ez.aabb.maxx=e1.x}if(e1.yez.aabb.maxy){ez.aabb.maxy=e1.y}eg=eg.next}}}}}var ee;if(eq.dyn==(el.body.type==1?false:!el.body.component.sleeping)){var eY=eq.aabb;var eI=el.aabb;ee=!(eI.minx>=eY.minx&&eI.miny>=eY.miny&&eI.maxx<=eY.maxx&&eI.maxy<=eY.maxy)}else{ee=true}if(ee){eq.synced=true;eq.snext=eJ.syncs;eJ.syncs=eq}}}};dB.prototype.broadphase=function(eb,ea){};dB.prototype.clear=function(){};dB.prototype.shapesUnderPoint=function(ea,ed,ec,eb){return null};dB.prototype.bodiesUnderPoint=function(ea,ed,ec,eb){return null};dB.prototype.aabbShape=null;dB.prototype.matrix=null;dB.prototype.updateAABBShape=function(ep){if(this.aabbShape==null){if(br.BodyType_STATIC==null){br.internal=true;br.BodyType_STATIC=new cU();br.internal=false}var eb=new at(br.BodyType_STATIC).zpp_inner.wrap_shapes;var ea=this.aabbShape=new Z(Z.rect(ep.minx,ep.miny,ep.maxx-ep.minx,ep.maxy-ep.miny));if(eb.zpp_inner.reverse_flag){eb.push(ea)}else{eb.unshift(ea)}}else{var eh=this.aabbShape.zpp_inner.aabb;var ee=(ep.maxx-ep.minx)/(eh.maxx-eh.minx);var ed=(ep.maxy-ep.miny)/(eh.maxy-eh.miny);if(this.matrix==null){this.matrix=new cI()}var eL=this.matrix;eL.zpp_inner.a=ee;var eJ=eL.zpp_inner;if(eJ._invalidate!=null){eJ._invalidate()}var eH=this.matrix;var eF=this.matrix;eF.zpp_inner.c=0;var eD=eF.zpp_inner;if(eD._invalidate!=null){eD._invalidate()}eH.zpp_inner.b=eF.zpp_inner.c;var eB=eH.zpp_inner;if(eB._invalidate!=null){eB._invalidate()}var eA=this.matrix;eA.zpp_inner.d=ed;var ey=eA.zpp_inner;if(ey._invalidate!=null){ey._invalidate()}var ex=this.matrix;ex.zpp_inner.tx=ep.minx-ee*eh.minx;var e2=ex.zpp_inner;if(e2._invalidate!=null){e2._invalidate()}var eZ=this.matrix;eZ.zpp_inner.ty=ep.miny-ed*eh.miny;var eX=eZ.zpp_inner;if(eX._invalidate!=null){eX._invalidate()}this.aabbShape.transform(this.matrix)}var eW=this.aabbShape.zpp_inner;if(eW.zip_aabb){if(eW.body!=null){eW.zip_aabb=false;if(eW.type==0){var eV=eW.circle;if(eV.zip_worldCOM){if(eV.body!=null){eV.zip_worldCOM=false;if(eV.zip_localCOM){eV.zip_localCOM=false;if(eV.type==1){var eU=eV.polygon;if(eU.lverts.next.next==null){eU.localCOMx=eU.lverts.next.x;eU.localCOMy=eU.lverts.next.y}else{if(eU.lverts.next.next.next==null){eU.localCOMx=eU.lverts.next.x;eU.localCOMy=eU.lverts.next.y;eU.localCOMx+=eU.lverts.next.next.x;eU.localCOMy+=eU.lverts.next.next.y;eU.localCOMx*=0.5;eU.localCOMy*=0.5}else{eU.localCOMx=0;eU.localCOMy=0;var et=0;var ec=eU.lverts.next;var eK=ec;ec=ec.next;var eI=ec;ec=ec.next;while(ec!=null){var eG=ec;et+=eI.x*(eG.y-eK.y);var es=eG.y*eI.x-eG.x*eI.y;eU.localCOMx+=(eI.x+eG.x)*es;eU.localCOMy+=(eI.y+eG.y)*es;eK=eI;eI=eG;ec=ec.next}ec=eU.lverts.next;var ew=ec;et+=eI.x*(ew.y-eK.y);var eE=ew.y*eI.x-ew.x*eI.y;eU.localCOMx+=(eI.x+ew.x)*eE;eU.localCOMy+=(eI.y+ew.y)*eE;eK=eI;ec=ec.next;var eu=ec;et+=ew.x*(eu.y-eK.y);var eC=eu.y*ew.x-eu.x*ew.y;eU.localCOMx+=(ew.x+eu.x)*eC;eU.localCOMy+=(ew.y+eu.y)*eC;et=1/(3*et);var eM=et;eU.localCOMx*=eM;eU.localCOMy*=eM}}}if(eV.wrap_localCOM!=null){eV.wrap_localCOM.zpp_inner.x=eV.localCOMx;eV.wrap_localCOM.zpp_inner.y=eV.localCOMy}}var eS=eV.body;if(eS.zip_axis){eS.zip_axis=false;eS.axisx=Math.sin(eS.rot);eS.axisy=Math.cos(eS.rot)}eV.worldCOMx=eV.body.posx+(eV.body.axisy*eV.localCOMx-eV.body.axisx*eV.localCOMy);eV.worldCOMy=eV.body.posy+(eV.localCOMx*eV.body.axisx+eV.localCOMy*eV.body.axisy)}}var eo=eV.radius;var en=eV.radius;eV.aabb.minx=eV.worldCOMx-eo;eV.aabb.miny=eV.worldCOMy-en;eV.aabb.maxx=eV.worldCOMx+eo;eV.aabb.maxy=eV.worldCOMy+en}else{var eQ=eW.polygon;if(eQ.zip_gverts){if(eQ.body!=null){eQ.zip_gverts=false;eQ.validate_lverts();var eP=eQ.body;if(eP.zip_axis){eP.zip_axis=false;eP.axisx=Math.sin(eP.rot);eP.axisy=Math.cos(eP.rot)}var ev=eQ.lverts.next;var el=eQ.gverts.next;while(el!=null){var eY=el;var eR=ev;ev=ev.next;eY.x=eQ.body.posx+(eQ.body.axisy*eR.x-eQ.body.axisx*eR.y);eY.y=eQ.body.posy+(eR.x*eQ.body.axisx+eR.y*eQ.body.axisy);el=el.next}}}var e4=eQ.gverts.next;eQ.aabb.minx=e4.x;eQ.aabb.miny=e4.y;eQ.aabb.maxx=e4.x;eQ.aabb.maxy=e4.y;var ek=eQ.gverts.next.next;while(ek!=null){var eN=ek;if(eN.xeQ.aabb.maxx){eQ.aabb.maxx=eN.x}if(eN.yeQ.aabb.maxy){eQ.aabb.maxy=eN.y}ek=ek.next}}}}var eO=this.aabbShape.zpp_inner.polygon;if(eO.zip_gaxi){if(eO.body!=null){eO.zip_gaxi=false;eO.validate_laxi();var er=eO.body;if(er.zip_axis){er.zip_axis=false;er.axisx=Math.sin(er.rot);er.axisy=Math.cos(er.rot)}if(eO.zip_gverts){if(eO.body!=null){eO.zip_gverts=false;eO.validate_lverts();var eq=eO.body;if(eq.zip_axis){eq.zip_axis=false;eq.axisx=Math.sin(eq.rot);eq.axisy=Math.cos(eq.rot)}var ez=eO.lverts.next;var ej=eO.gverts.next;while(ej!=null){var eT=ej;var ef=ez;ez=ez.next;eT.x=eO.body.posx+(eO.body.axisy*ef.x-eO.body.axisx*ef.y);eT.y=eO.body.posy+(ef.x*eO.body.axisx+ef.y*eO.body.axisy);ej=ej.next}}}var e0=eO.edges.head;var ei=eO.gverts.next;var eg=ei;ei=ei.next;while(ei!=null){var e5=ei;var e3=e0.elt;e0=e0.next;e3.gp0=eg;e3.gp1=e5;e3.gnormx=eO.body.axisy*e3.lnormx-eO.body.axisx*e3.lnormy;e3.gnormy=e3.lnormx*eO.body.axisx+e3.lnormy*eO.body.axisy;e3.gprojection=eO.body.posx*e3.gnormx+eO.body.posy*e3.gnormy+e3.lprojection;if(e3.wrap_gnorm!=null){e3.wrap_gnorm.zpp_inner.x=e3.gnormx;e3.wrap_gnorm.zpp_inner.y=e3.gnormy}e3.tp0=e3.gp0.y*e3.gnormx-e3.gp0.x*e3.gnormy;e3.tp1=e3.gp1.y*e3.gnormx-e3.gp1.x*e3.gnormy;eg=e5;ei=ei.next}var em=e0.elt;em.gp0=eg;em.gp1=eO.gverts.next;em.gnormx=eO.body.axisy*em.lnormx-eO.body.axisx*em.lnormy;em.gnormy=em.lnormx*eO.body.axisx+em.lnormy*eO.body.axisy;em.gprojection=eO.body.posx*em.gnormx+eO.body.posy*em.gnormy+em.lprojection;if(em.wrap_gnorm!=null){em.wrap_gnorm.zpp_inner.x=em.gnormx;em.wrap_gnorm.zpp_inner.y=em.gnormy}em.tp0=em.gp0.y*em.gnormx-em.gp0.x*em.gnormy;em.tp1=em.gp1.y*em.gnormx-em.gp1.x*em.gnormy}}};dB.prototype.shapesInAABB=function(eb,ea,ee,ed,ec){return null};dB.prototype.bodiesInAABB=function(eb,ea,ee,ed,ec){return null};dB.prototype.circShape=null;dB.prototype.updateCircShape=function(ez,ew,eJ){if(this.circShape==null){if(br.BodyType_STATIC==null){br.internal=true;br.BodyType_STATIC=new cU();br.internal=false}var eb=new at(br.BodyType_STATIC).zpp_inner.wrap_shapes;var el;if(au.poolVec2==null){el=new r()}else{el=au.poolVec2;au.poolVec2=el.zpp_pool;el.zpp_pool=null}if(el.zpp_inner==null){var eA;if(bB.zpp_pool==null){eA=new bB()}else{eA=bB.zpp_pool;bB.zpp_pool=eA.next;eA.next=null}eA.weak=false;eA._immutable=false;eA.x=ez;eA.y=ew;el.zpp_inner=eA;el.zpp_inner.outer=el}else{var eL;var eI=el.zpp_inner;if(eI._validate!=null){eI._validate()}if(el.zpp_inner.x==ez){var eF=el.zpp_inner;if(eF._validate!=null){eF._validate()}eL=el.zpp_inner.y==ew}else{eL=false}if(!eL){el.zpp_inner.x=ez;el.zpp_inner.y=ew;var eD=el.zpp_inner;if(eD._invalidate!=null){eD._invalidate(eD)}}}el.zpp_inner.weak=false;var ea=this.circShape=new ds(eJ,el);if(eb.zpp_inner.reverse_flag){eb.push(ea)}else{eb.unshift(ea)}}else{var ej=this.circShape.zpp_inner.circle;var ed=eJ/ej.radius;if(this.matrix==null){this.matrix=new cI()}var eB=this.matrix;var ey=this.matrix;ey.zpp_inner.d=ed;var ev=ey.zpp_inner;if(ev._invalidate!=null){ev._invalidate()}eB.zpp_inner.a=ey.zpp_inner.d;var et=eB.zpp_inner;if(et._invalidate!=null){et._invalidate()}var es=this.matrix;var er=this.matrix;er.zpp_inner.c=0;var eX=er.zpp_inner;if(eX._invalidate!=null){eX._invalidate()}es.zpp_inner.b=er.zpp_inner.c;var eW=es.zpp_inner;if(eW._invalidate!=null){eW._invalidate()}var eU=this.matrix;eU.zpp_inner.tx=ez-ed*ej.localCOMx;var eT=eU.zpp_inner;if(eT._invalidate!=null){eT._invalidate()}var eS=this.matrix;eS.zpp_inner.ty=ew-ed*ej.localCOMy;var eR=eS.zpp_inner;if(eR._invalidate!=null){eR._invalidate()}this.circShape.transform(this.matrix)}var eQ=this.circShape.zpp_inner;if(eQ.zip_aabb){if(eQ.body!=null){eQ.zip_aabb=false;if(eQ.type==0){var eO=eQ.circle;if(eO.zip_worldCOM){if(eO.body!=null){eO.zip_worldCOM=false;if(eO.zip_localCOM){eO.zip_localCOM=false;if(eO.type==1){var eN=eO.polygon;if(eN.lverts.next.next==null){eN.localCOMx=eN.lverts.next.x;eN.localCOMy=eN.lverts.next.y}else{if(eN.lverts.next.next.next==null){eN.localCOMx=eN.lverts.next.x;eN.localCOMy=eN.lverts.next.y;eN.localCOMx+=eN.lverts.next.next.x;eN.localCOMy+=eN.lverts.next.next.y;eN.localCOMx*=0.5;eN.localCOMy*=0.5}else{eN.localCOMx=0;eN.localCOMy=0;var eo=0;var ec=eN.lverts.next;var eG=ec;ec=ec.next;var eE=ec;ec=ec.next;while(ec!=null){var eC=ec;eo+=eE.x*(eC.y-eG.y);var em=eC.y*eE.x-eC.x*eE.y;eN.localCOMx+=(eE.x+eC.x)*em;eN.localCOMy+=(eE.y+eC.y)*em;eG=eE;eE=eC;ec=ec.next}ec=eN.lverts.next;var eq=ec;eo+=eE.x*(eq.y-eG.y);var ex=eq.y*eE.x-eq.x*eE.y;eN.localCOMx+=(eE.x+eq.x)*ex;eN.localCOMy+=(eE.y+eq.y)*ex;eG=eE;ec=ec.next;var en=ec;eo+=eq.x*(en.y-eG.y);var eu=en.y*eq.x-en.x*eq.y;eN.localCOMx+=(eq.x+en.x)*eu;eN.localCOMy+=(eq.y+en.y)*eu;eo=1/(3*eo);var eH=eo;eN.localCOMx*=eH;eN.localCOMy*=eH}}}if(eO.wrap_localCOM!=null){eO.wrap_localCOM.zpp_inner.x=eO.localCOMx;eO.wrap_localCOM.zpp_inner.y=eO.localCOMy}}var eM=eO.body;if(eM.zip_axis){eM.zip_axis=false;eM.axisx=Math.sin(eM.rot);eM.axisy=Math.cos(eM.rot)}eO.worldCOMx=eO.body.posx+(eO.body.axisy*eO.localCOMx-eO.body.axisx*eO.localCOMy);eO.worldCOMy=eO.body.posy+(eO.localCOMx*eO.body.axisx+eO.localCOMy*eO.body.axisy)}}var eh=eO.radius;var eg=eO.radius;eO.aabb.minx=eO.worldCOMx-eh;eO.aabb.miny=eO.worldCOMy-eg;eO.aabb.maxx=eO.worldCOMx+eh;eO.aabb.maxy=eO.worldCOMy+eg}else{var ek=eQ.polygon;if(ek.zip_gverts){if(ek.body!=null){ek.zip_gverts=false;ek.validate_lverts();var ei=ek.body;if(ei.zip_axis){ei.zip_axis=false;ei.axisx=Math.sin(ei.rot);ei.axisy=Math.cos(ei.rot)}var ep=ek.lverts.next;var ef=ek.gverts.next;while(ef!=null){var eV=ef;var eP=ep;ep=ep.next;eV.x=ek.body.posx+(ek.body.axisy*eP.x-ek.body.axisx*eP.y);eV.y=ek.body.posy+(eP.x*ek.body.axisx+eP.y*ek.body.axisy);ef=ef.next}}}var eY=ek.gverts.next;ek.aabb.minx=eY.x;ek.aabb.miny=eY.y;ek.aabb.maxx=eY.x;ek.aabb.maxy=eY.y;var ee=ek.gverts.next.next;while(ee!=null){var eK=ee;if(eK.xek.aabb.maxx){ek.aabb.maxx=eK.x}if(eK.yek.aabb.maxy){ek.aabb.maxy=eK.y}ee=ee.next}}}}};dB.prototype.shapesInCircle=function(ea,ef,ed,ee,ec,eb){return null};dB.prototype.bodiesInCircle=function(ea,ef,ed,ee,ec,eb){return null};dB.prototype.validateShape=function(eQ){if(eQ.type==1){var ea=eQ.polygon;if(ea.zip_gaxi){if(ea.body!=null){ea.zip_gaxi=false;ea.validate_laxi();var eO=ea.body;if(eO.zip_axis){eO.zip_axis=false;eO.axisx=Math.sin(eO.rot);eO.axisy=Math.cos(eO.rot)}if(ea.zip_gverts){if(ea.body!=null){ea.zip_gverts=false;ea.validate_lverts();var eM=ea.body;if(eM.zip_axis){eM.zip_axis=false;eM.axisx=Math.sin(eM.rot);eM.axisy=Math.cos(eM.rot)}var ev=ea.lverts.next;var eb=ea.gverts.next;while(eb!=null){var eU=eb;var eS=ev;ev=ev.next;eU.x=ea.body.posx+(ea.body.axisy*eS.x-ea.body.axisx*eS.y);eU.y=ea.body.posy+(eS.x*ea.body.axisx+eS.y*ea.body.axisy);eb=eb.next}}}var eV=ea.edges.head;var ej=ea.gverts.next;var eN=ej;ej=ej.next;while(ej!=null){var eL=ej;var eW=eV.elt;eV=eV.next;eW.gp0=eN;eW.gp1=eL;eW.gnormx=ea.body.axisy*eW.lnormx-ea.body.axisx*eW.lnormy;eW.gnormy=eW.lnormx*ea.body.axisx+eW.lnormy*ea.body.axisy;eW.gprojection=ea.body.posx*eW.gnormx+ea.body.posy*eW.gnormy+eW.lprojection;if(eW.wrap_gnorm!=null){eW.wrap_gnorm.zpp_inner.x=eW.gnormx;eW.wrap_gnorm.zpp_inner.y=eW.gnormy}eW.tp0=eW.gp0.y*eW.gnormx-eW.gp0.x*eW.gnormy;eW.tp1=eW.gp1.y*eW.gnormx-eW.gp1.x*eW.gnormy;eN=eL;ej=ej.next}var el=eV.elt;el.gp0=eN;el.gp1=ea.gverts.next;el.gnormx=ea.body.axisy*el.lnormx-ea.body.axisx*el.lnormy;el.gnormy=el.lnormx*ea.body.axisx+el.lnormy*ea.body.axisy;el.gprojection=ea.body.posx*el.gnormx+ea.body.posy*el.gnormy+el.lprojection;if(el.wrap_gnorm!=null){el.wrap_gnorm.zpp_inner.x=el.gnormx;el.wrap_gnorm.zpp_inner.y=el.gnormy}el.tp0=el.gp0.y*el.gnormx-el.gp0.x*el.gnormy;el.tp1=el.gp1.y*el.gnormx-el.gp1.x*el.gnormy}}}if(eQ.zip_aabb){if(eQ.body!=null){eQ.zip_aabb=false;if(eQ.type==0){var eK=eQ.circle;if(eK.zip_worldCOM){if(eK.body!=null){eK.zip_worldCOM=false;if(eK.zip_localCOM){eK.zip_localCOM=false;if(eK.type==1){var eI=eK.polygon;if(eI.lverts.next.next==null){eI.localCOMx=eI.lverts.next.x;eI.localCOMy=eI.lverts.next.y}else{if(eI.lverts.next.next.next==null){eI.localCOMx=eI.lverts.next.x;eI.localCOMy=eI.lverts.next.y;eI.localCOMx+=eI.lverts.next.next.x;eI.localCOMy+=eI.lverts.next.next.y;eI.localCOMx*=0.5;eI.localCOMy*=0.5}else{eI.localCOMx=0;eI.localCOMy=0;var et=0;var ei=eI.lverts.next;var ee=ei;ei=ei.next;var eZ=ei;ei=ei.next;while(ei!=null){var eJ=ei;et+=eZ.x*(eJ.y-ee.y);var eq=eJ.y*eZ.x-eJ.x*eZ.y;eI.localCOMx+=(eZ.x+eJ.x)*eq;eI.localCOMy+=(eZ.y+eJ.y)*eq;ee=eZ;eZ=eJ;ei=ei.next}ei=eI.lverts.next;var ew=ei;et+=eZ.x*(ew.y-ee.y);var eH=ew.y*eZ.x-ew.x*eZ.y;eI.localCOMx+=(eZ.x+ew.x)*eH;eI.localCOMy+=(eZ.y+ew.y)*eH;ee=eZ;ei=ei.next;var eu=ei;et+=ew.x*(eu.y-ee.y);var eF=eu.y*ew.x-eu.x*ew.y;eI.localCOMx+=(ew.x+eu.x)*eF;eI.localCOMy+=(ew.y+eu.y)*eF;et=1/(3*et);var eP=et;eI.localCOMx*=eP;eI.localCOMy*=eP}}}if(eK.wrap_localCOM!=null){eK.wrap_localCOM.zpp_inner.x=eK.localCOMx;eK.wrap_localCOM.zpp_inner.y=eK.localCOMy}}var eG=eK.body;if(eG.zip_axis){eG.zip_axis=false;eG.axisx=Math.sin(eG.rot);eG.axisy=Math.cos(eG.rot)}eK.worldCOMx=eK.body.posx+(eK.body.axisy*eK.localCOMx-eK.body.axisx*eK.localCOMy);eK.worldCOMy=eK.body.posy+(eK.localCOMx*eK.body.axisx+eK.localCOMy*eK.body.axisy)}}var en=eK.radius;var em=eK.radius;eK.aabb.minx=eK.worldCOMx-en;eK.aabb.miny=eK.worldCOMy-em;eK.aabb.maxx=eK.worldCOMx+en;eK.aabb.maxy=eK.worldCOMy+em}else{var eE=eQ.polygon;if(eE.zip_gverts){if(eE.body!=null){eE.zip_gverts=false;eE.validate_lverts();var eC=eE.body;if(eC.zip_axis){eC.zip_axis=false;eC.axisx=Math.sin(eC.rot);eC.axisy=Math.cos(eC.rot)}var eD=eE.lverts.next;var eh=eE.gverts.next;while(eh!=null){var eT=eh;var ec=eD;eD=eD.next;eT.x=eE.body.posx+(eE.body.axisy*ec.x-eE.body.axisx*ec.y);eT.y=eE.body.posy+(ec.x*eE.body.axisx+ec.y*eE.body.axisy);eh=eh.next}}}var eX=eE.gverts.next;eE.aabb.minx=eX.x;eE.aabb.miny=eX.y;eE.aabb.maxx=eX.x;eE.aabb.maxy=eX.y;var eg=eE.gverts.next.next;while(eg!=null){var eR=eg;if(eR.xeE.aabb.maxx){eE.aabb.maxx=eR.x}if(eR.yeE.aabb.maxy){eE.aabb.maxy=eR.y}eg=eg.next}}}}if(eQ.zip_worldCOM){if(eQ.body!=null){eQ.zip_worldCOM=false;if(eQ.zip_localCOM){eQ.zip_localCOM=false;if(eQ.type==1){var eA=eQ.polygon;if(eA.lverts.next.next==null){eA.localCOMx=eA.lverts.next.x;eA.localCOMy=eA.lverts.next.y}else{if(eA.lverts.next.next.next==null){eA.localCOMx=eA.lverts.next.x;eA.localCOMy=eA.lverts.next.y;eA.localCOMx+=eA.lverts.next.next.x;eA.localCOMy+=eA.lverts.next.next.y;eA.localCOMx*=0.5;eA.localCOMy*=0.5}else{eA.localCOMx=0;eA.localCOMy=0;var ek=0;var ef=eA.lverts.next;var ed=ef;ef=ef.next;var eY=ef;ef=ef.next;while(ef!=null){var es=ef;ek+=eY.x*(es.y-ed.y);var eB=es.y*eY.x-es.x*eY.y;eA.localCOMx+=(eY.x+es.x)*eB;eA.localCOMy+=(eY.y+es.y)*eB;ed=eY;eY=es;ef=ef.next}ef=eA.lverts.next;var ep=ef;ek+=eY.x*(ep.y-ed.y);var ez=ep.y*eY.x-ep.x*eY.y;eA.localCOMx+=(eY.x+ep.x)*ez;eA.localCOMy+=(eY.y+ep.y)*ez;ed=eY;ef=ef.next;var eo=ef;ek+=ep.x*(eo.y-ed.y);var ey=eo.y*ep.x-eo.x*ep.y;eA.localCOMx+=(ep.x+eo.x)*ey;eA.localCOMy+=(ep.y+eo.y)*ey;ek=1/(3*ek);var er=ek;eA.localCOMx*=er;eA.localCOMy*=er}}}if(eQ.wrap_localCOM!=null){eQ.wrap_localCOM.zpp_inner.x=eQ.localCOMx;eQ.wrap_localCOM.zpp_inner.y=eQ.localCOMy}}var ex=eQ.body;if(ex.zip_axis){ex.zip_axis=false;ex.axisx=Math.sin(ex.rot);ex.axisy=Math.cos(ex.rot)}eQ.worldCOMx=eQ.body.posx+(eQ.body.axisy*eQ.localCOMx-eQ.body.axisx*eQ.localCOMy);eQ.worldCOMy=eQ.body.posy+(eQ.localCOMx*eQ.body.axisx+eQ.localCOMy*eQ.body.axisy)}}};dB.prototype.shapesInShape=function(eb,ed,ec,ea){return null};dB.prototype.bodiesInShape=function(eb,ed,ec,ea){return null};dB.prototype.rayCast=function(ea,eb,ec){return null};dB.prototype.rayMultiCast=function(ea,ec,ed,eb){return null};dB.prototype.__class__=dB;var dz=zpp_nape.space.ZPP_AABBNode=function(){this.first_sync=false;this.synced=false;this.snext=null;this.moved=false;this.mnext=null;this.next=null;this.rayt=0;this.height=0;this.child2=null;this.child1=null;this.parent=null;this.dyn=false;this.shape=null;this.aabb=null;this.height=-1};dz.__name__=["zpp_nape","space","ZPP_AABBNode"];dz.prototype.aabb=null;dz.prototype.shape=null;dz.prototype.dyn=null;dz.prototype.parent=null;dz.prototype.child1=null;dz.prototype.child2=null;dz.prototype.height=null;dz.prototype.rayt=null;dz.prototype.next=null;dz.prototype.alloc=function(){if(bT.zpp_pool==null){this.aabb=new bT()}else{this.aabb=bT.zpp_pool;bT.zpp_pool=this.aabb.next;this.aabb.next=null}this.moved=false;this.synced=false;this.first_sync=false};dz.prototype.free=function(){this.height=-1;var ea=this.aabb;if(ea.outer!=null){ea.outer.zpp_inner=null;ea.outer=null}ea.wrap_min=ea.wrap_max=null;ea._invalidate=null;ea._validate=null;ea.next=bT.zpp_pool;bT.zpp_pool=ea;this.child1=this.child2=this.parent=null;this.next=null;this.snext=null;this.mnext=null};dz.prototype.mnext=null;dz.prototype.moved=null;dz.prototype.snext=null;dz.prototype.synced=null;dz.prototype.first_sync=null;dz.prototype.isLeaf=function(){return this.child1==null};dz.prototype.__class__=dz;var bG=zpp_nape.space.ZPP_AABBPair=function(){this.next=null;this.arb=null;this.di=0;this.id=0;this.sleeping=false;this.first=false;this.n2=null;this.n1=null};bG.__name__=["zpp_nape","space","ZPP_AABBPair"];bG.prototype.n1=null;bG.prototype.n2=null;bG.prototype.first=null;bG.prototype.sleeping=null;bG.prototype.id=null;bG.prototype.di=null;bG.prototype.arb=null;bG.prototype.next=null;bG.prototype.alloc=function(){};bG.prototype.free=function(){this.n1=this.n2=null;this.sleeping=false};bG.prototype.__class__=bG;var d=zpp_nape.space.ZPP_AABBTree=function(){this.root=null};d.__name__=["zpp_nape","space","ZPP_AABBTree"];d.prototype.root=null;d.prototype.clear=function(){if(this.root==null){return}var ea=null;this.root.next=ea;ea=this.root;while(ea!=null){var eb=ea;ea=eb.next;eb.next=null;if(eb.child1==null){eb.shape.node=null;eb.shape.removedFromSpace();eb.shape=null}else{if(eb.child1!=null){eb.child1.next=ea;ea=eb.child1}if(eb.child2!=null){eb.child2.next=ea;ea=eb.child2}}eb.height=-1;var ec=eb.aabb;if(ec.outer!=null){ec.outer.zpp_inner=null;ec.outer=null}ec.wrap_min=ec.wrap_max=null;ec._invalidate=null;ec._validate=null;ec.next=bT.zpp_pool;bT.zpp_pool=ec;eb.child1=eb.child2=eb.parent=null;eb.next=null;eb.snext=null;eb.mnext=null;eb.next=dz.zpp_pool;dz.zpp_pool=eb}this.root=null};d.prototype.insertLeaf=function(eB){if(this.root==null){this.root=eB;this.root.parent=null}else{var eC=eB.aabb;var e5=this.root;while(e5.child1!=null){var e7=e5.child1;var e6=e5.child2;var eo=e5.aabb;var ec=(eo.maxx-eo.minx+(eo.maxy-eo.miny))*2;var eM=d.tmpaabb;var eX=e5.aabb;eM.minx=eX.minxeC.maxx?eX.maxx:eC.maxx;eM.maxy=eX.maxy>eC.maxy?eX.maxy:eC.maxy;var eL=d.tmpaabb;var eD=(eL.maxx-eL.minx+(eL.maxy-eL.miny))*2;var fl=2*eD;var eb=2*(eD-ec);var eK=d.tmpaabb;var eV=e7.aabb;eK.minx=eC.minxeV.maxx?eC.maxx:eV.maxx;eK.maxy=eC.maxy>eV.maxy?eC.maxy:eV.maxy;var e3;if(e7.child1==null){var eJ=d.tmpaabb;e3=(eJ.maxx-eJ.minx+(eJ.maxy-eJ.miny))*2+eb}else{var eI=e7.aabb;var em=(eI.maxx-eI.minx+(eI.maxy-eI.miny))*2;var eH=d.tmpaabb;e3=(eH.maxx-eH.minx+(eH.maxy-eH.miny))*2-em+eb}var eG=d.tmpaabb;var fm=e6.aabb;eG.minx=eC.minxfm.maxx?eC.maxx:fm.maxx;eG.maxy=eC.maxy>fm.maxy?eC.maxy:fm.maxy;var e2;if(e6.child1==null){var eF=d.tmpaabb;e2=(eF.maxx-eF.minx+(eF.maxy-eF.miny))*2+eb}else{var eE=e6.aabb;var fn=(eE.maxx-eE.minx+(eE.maxy-eE.miny))*2;var e1=d.tmpaabb;e2=(e1.maxx-e1.minx+(e1.maxy-e1.miny))*2-fn+eb}if(flfk.maxx?eC.maxx:fk.maxx;e0.maxy=eC.maxy>fk.maxy?eC.maxy:fk.maxy;fq.height=e4.height+1;if(fb!=null){if(fb.child1==e4){fb.child1=fq}else{fb.child2=fq}fq.child1=e4;fq.child2=eB;e4.parent=fq;eB.parent=fq}else{fq.child1=e4;fq.child2=eB;e4.parent=fq;eB.parent=fq;this.root=fq}e5=eB.parent;while(e5!=null){if(e5.child1==null||e5.height<2){e5=e5}else{var fj=e5.child1;var eT=e5.child2;var fh=eT.height-fj.height;if(fh>1){var eP=eT.child1;var eO=eT.child2;eT.child1=e5;eT.parent=e5.parent;e5.parent=eT;if(eT.parent!=null){if(eT.parent.child1==e5){eT.parent.child1=eT}else{eT.parent.child2=eT}}else{this.root=eT}if(eP.height>eO.height){eT.child2=eP;e5.child2=eO;eO.parent=e5;var eZ=e5.aabb;var fx=fj.aabb;var fi=eO.aabb;eZ.minx=fx.minxfi.maxx?fx.maxx:fi.maxx;eZ.maxy=fx.maxy>fi.maxy?fx.maxy:fi.maxy;var eY=eT.aabb;var fw=e5.aabb;var fg=eP.aabb;eY.minx=fw.minxfg.maxx?fw.maxx:fg.maxx;eY.maxy=fw.maxy>fg.maxy?fw.maxy:fg.maxy;var eA=fj.height;var ez=eO.height;e5.height=1+(eA>ez?eA:ez);var ex=e5.height;var el=eP.height;eT.height=1+(ex>el?ex:el)}else{eT.child2=eO;e5.child2=eP;eP.parent=e5;var eW=e5.aabb;var fv=fj.aabb;var ff=eP.aabb;eW.minx=fv.minxff.maxx?fv.maxx:ff.maxx;eW.maxy=fv.maxy>ff.maxy?fv.maxy:ff.maxy;var eU=eT.aabb;var fu=e5.aabb;var fe=eO.aabb;eU.minx=fu.minxfe.maxx?fu.maxx:fe.maxx;eU.maxy=fu.maxy>fe.maxy?fu.maxy:fe.maxy;var ew=fj.height;var ek=eP.height;e5.height=1+(ew>ek?ew:ek);var ev=e5.height;var ej=eO.height;eT.height=1+(ev>ej?ev:ej)}e5=eT}else{if(fh<-1){var en=fj.child1;var ea=fj.child2;fj.child1=e5;fj.parent=e5.parent;e5.parent=fj;if(fj.parent!=null){if(fj.parent.child1==e5){fj.parent.child1=fj}else{fj.parent.child2=fj}}else{this.root=fj}if(en.height>ea.height){fj.child2=en;e5.child1=ea;ea.parent=e5;var eS=e5.aabb;var ft=eT.aabb;var fd=ea.aabb;eS.minx=ft.minxfd.maxx?ft.maxx:fd.maxx;eS.maxy=ft.maxy>fd.maxy?ft.maxy:fd.maxy;var eR=fj.aabb;var fs=e5.aabb;var fc=en.aabb;eR.minx=fs.minxfc.maxx?fs.maxx:fc.maxx;eR.maxy=fs.maxy>fc.maxy?fs.maxy:fc.maxy;var eu=eT.height;var ei=ea.height;e5.height=1+(eu>ei?eu:ei);var et=e5.height;var eh=en.height;fj.height=1+(et>eh?et:eh)}else{fj.child2=ea;e5.child1=en;en.parent=e5;var eQ=e5.aabb;var fr=eT.aabb;var fa=en.aabb;eQ.minx=fr.minxfa.maxx?fr.maxx:fa.maxx;eQ.maxy=fr.maxy>fa.maxy?fr.maxy:fa.maxy;var eN=fj.aabb;var fp=e5.aabb;var e9=ea.aabb;eN.minx=fp.minxe9.maxx?fp.maxx:e9.maxx;eN.maxy=fp.maxy>e9.maxy?fp.maxy:e9.maxy;var es=eT.height;var eg=en.height;e5.height=1+(es>eg?es:eg);var er=e5.height;var ef=ea.height;fj.height=1+(er>ef?er:ef)}e5=fj}else{e5=e5}}}var ep=e5.child1;var ed=e5.child2;var eq=ep.height;var ee=ed.height;e5.height=1+(eq>ee?eq:ee);var ey=e5.aabb;var fo=ep.aabb;var e8=ed.aabb;ey.minx=fo.minxe8.maxx?fo.maxx:e8.maxx;ey.maxy=fo.maxy>e8.maxy?fo.maxy:e8.maxy;e5=e5.parent}}};d.prototype.inlined_insertLeaf=function(eB){if(this.root==null){this.root=eB;this.root.parent=null}else{var eC=eB.aabb;var e5=this.root;while(e5.child1!=null){var e7=e5.child1;var e6=e5.child2;var eo=e5.aabb;var ec=(eo.maxx-eo.minx+(eo.maxy-eo.miny))*2;var eM=d.tmpaabb;var eX=e5.aabb;eM.minx=eX.minxeC.maxx?eX.maxx:eC.maxx;eM.maxy=eX.maxy>eC.maxy?eX.maxy:eC.maxy;var eL=d.tmpaabb;var eD=(eL.maxx-eL.minx+(eL.maxy-eL.miny))*2;var fl=2*eD;var eb=2*(eD-ec);var eK=d.tmpaabb;var eV=e7.aabb;eK.minx=eC.minxeV.maxx?eC.maxx:eV.maxx;eK.maxy=eC.maxy>eV.maxy?eC.maxy:eV.maxy;var e3;if(e7.child1==null){var eJ=d.tmpaabb;e3=(eJ.maxx-eJ.minx+(eJ.maxy-eJ.miny))*2+eb}else{var eI=e7.aabb;var em=(eI.maxx-eI.minx+(eI.maxy-eI.miny))*2;var eH=d.tmpaabb;e3=(eH.maxx-eH.minx+(eH.maxy-eH.miny))*2-em+eb}var eG=d.tmpaabb;var fm=e6.aabb;eG.minx=eC.minxfm.maxx?eC.maxx:fm.maxx;eG.maxy=eC.maxy>fm.maxy?eC.maxy:fm.maxy;var e2;if(e6.child1==null){var eF=d.tmpaabb;e2=(eF.maxx-eF.minx+(eF.maxy-eF.miny))*2+eb}else{var eE=e6.aabb;var fn=(eE.maxx-eE.minx+(eE.maxy-eE.miny))*2;var e1=d.tmpaabb;e2=(e1.maxx-e1.minx+(e1.maxy-e1.miny))*2-fn+eb}if(flfk.maxx?eC.maxx:fk.maxx;e0.maxy=eC.maxy>fk.maxy?eC.maxy:fk.maxy;fq.height=e4.height+1;if(fb!=null){if(fb.child1==e4){fb.child1=fq}else{fb.child2=fq}fq.child1=e4;fq.child2=eB;e4.parent=fq;eB.parent=fq}else{fq.child1=e4;fq.child2=eB;e4.parent=fq;eB.parent=fq;this.root=fq}e5=eB.parent;while(e5!=null){if(e5.child1==null||e5.height<2){e5=e5}else{var fj=e5.child1;var eT=e5.child2;var fh=eT.height-fj.height;if(fh>1){var eP=eT.child1;var eO=eT.child2;eT.child1=e5;eT.parent=e5.parent;e5.parent=eT;if(eT.parent!=null){if(eT.parent.child1==e5){eT.parent.child1=eT}else{eT.parent.child2=eT}}else{this.root=eT}if(eP.height>eO.height){eT.child2=eP;e5.child2=eO;eO.parent=e5;var eZ=e5.aabb;var fx=fj.aabb;var fi=eO.aabb;eZ.minx=fx.minxfi.maxx?fx.maxx:fi.maxx;eZ.maxy=fx.maxy>fi.maxy?fx.maxy:fi.maxy;var eY=eT.aabb;var fw=e5.aabb;var fg=eP.aabb;eY.minx=fw.minxfg.maxx?fw.maxx:fg.maxx;eY.maxy=fw.maxy>fg.maxy?fw.maxy:fg.maxy;var eA=fj.height;var ez=eO.height;e5.height=1+(eA>ez?eA:ez);var ex=e5.height;var el=eP.height;eT.height=1+(ex>el?ex:el)}else{eT.child2=eO;e5.child2=eP;eP.parent=e5;var eW=e5.aabb;var fv=fj.aabb;var ff=eP.aabb;eW.minx=fv.minxff.maxx?fv.maxx:ff.maxx;eW.maxy=fv.maxy>ff.maxy?fv.maxy:ff.maxy;var eU=eT.aabb;var fu=e5.aabb;var fe=eO.aabb;eU.minx=fu.minxfe.maxx?fu.maxx:fe.maxx;eU.maxy=fu.maxy>fe.maxy?fu.maxy:fe.maxy;var ew=fj.height;var ek=eP.height;e5.height=1+(ew>ek?ew:ek);var ev=e5.height;var ej=eO.height;eT.height=1+(ev>ej?ev:ej)}e5=eT}else{if(fh<-1){var en=fj.child1;var ea=fj.child2;fj.child1=e5;fj.parent=e5.parent;e5.parent=fj;if(fj.parent!=null){if(fj.parent.child1==e5){fj.parent.child1=fj}else{fj.parent.child2=fj}}else{this.root=fj}if(en.height>ea.height){fj.child2=en;e5.child1=ea;ea.parent=e5;var eS=e5.aabb;var ft=eT.aabb;var fd=ea.aabb;eS.minx=ft.minxfd.maxx?ft.maxx:fd.maxx;eS.maxy=ft.maxy>fd.maxy?ft.maxy:fd.maxy;var eR=fj.aabb;var fs=e5.aabb;var fc=en.aabb;eR.minx=fs.minxfc.maxx?fs.maxx:fc.maxx;eR.maxy=fs.maxy>fc.maxy?fs.maxy:fc.maxy;var eu=eT.height;var ei=ea.height;e5.height=1+(eu>ei?eu:ei);var et=e5.height;var eh=en.height;fj.height=1+(et>eh?et:eh)}else{fj.child2=ea;e5.child1=en;en.parent=e5;var eQ=e5.aabb;var fr=eT.aabb;var fa=en.aabb;eQ.minx=fr.minxfa.maxx?fr.maxx:fa.maxx;eQ.maxy=fr.maxy>fa.maxy?fr.maxy:fa.maxy;var eN=fj.aabb;var fp=e5.aabb;var e9=ea.aabb;eN.minx=fp.minxe9.maxx?fp.maxx:e9.maxx;eN.maxy=fp.maxy>e9.maxy?fp.maxy:e9.maxy;var es=eT.height;var eg=en.height;e5.height=1+(es>eg?es:eg);var er=e5.height;var ef=ea.height;fj.height=1+(er>ef?er:ef)}e5=fj}else{e5=e5}}}var ep=e5.child1;var ed=e5.child2;var eq=ep.height;var ee=ed.height;e5.height=1+(eq>ee?eq:ee);var ey=e5.aabb;var fo=ep.aabb;var e8=ed.aabb;ey.minx=fo.minxe8.maxx?fo.maxx:e8.maxx;ey.maxy=fo.maxy>e8.maxy?fo.maxy:e8.maxy;e5=e5.parent}}};d.prototype.removeLeaf=function(eW){if(eW==this.root){this.root=null}else{var ee=eW.parent;var ey=ee.parent;var eT=ee.child1==eW?ee.child2:ee.child1;if(ey!=null){if(ey.child1==ee){ey.child1=eT}else{ey.child2=eT}eT.parent=ey;ee.height=-1;var eS=ee.aabb;if(eS.outer!=null){eS.outer.zpp_inner=null;eS.outer=null}eS.wrap_min=eS.wrap_max=null;eS._invalidate=null;eS._validate=null;eS.next=bT.zpp_pool;bT.zpp_pool=eS;ee.child1=ee.child2=ee.parent=null;ee.next=null;ee.snext=null;ee.mnext=null;ee.next=dz.zpp_pool;dz.zpp_pool=ee;var ez=ey;while(ez!=null){if(ez.child1==null||ez.height<2){ez=ez}else{var e4=ez.child1;var e2=ez.child2;var es=e2.height-e4.height;if(es>1){var eY=e2.child1;var eV=e2.child2;e2.child1=ez;e2.parent=ez.parent;ez.parent=e2;if(e2.parent!=null){if(e2.parent.child1==ez){e2.parent.child1=e2}else{e2.parent.child2=e2}}else{this.root=e2}if(eY.height>eV.height){e2.child2=eY;ez.child2=eV;eV.parent=ez;var ec=ez.aabb;var e5=e4.aabb;var ex=eV.aabb;ec.minx=e5.minxex.maxx?e5.maxx:ex.maxx;ec.maxy=e5.maxy>ex.maxy?e5.maxy:ex.maxy;var eM=e2.aabb;var eR=ez.aabb;var ew=eY.aabb;eM.minx=eR.minxew.maxx?eR.maxx:ew.maxx;eM.maxy=eR.maxy>ew.maxy?eR.maxy:ew.maxy;var eF=e4.height;var eD=eV.height;ez.height=1+(eF>eD?eF:eD);var en=ez.height;var e8=eY.height;e2.height=1+(en>e8?en:e8)}else{e2.child2=eV;ez.child2=eY;eY.parent=ez;var eK=ez.aabb;var eQ=e4.aabb;var ev=eY.aabb;eK.minx=eQ.minxev.maxx?eQ.maxx:ev.maxx;eK.maxy=eQ.maxy>ev.maxy?eQ.maxy:ev.maxy;var eI=e2.aabb;var eP=ez.aabb;var eu=eV.aabb;eI.minx=eP.minxeu.maxx?eP.maxx:eu.maxx;eI.maxy=eP.maxy>eu.maxy?eP.maxy:eu.maxy;var em=e4.height;var e7=eY.height;ez.height=1+(em>e7?em:e7);var el=ez.height;var e6=eV.height;e2.height=1+(el>e6?el:e6)}ez=e2}else{if(es<-1){var ed=e4.child1;var eU=e4.child2;e4.child1=ez;e4.parent=ez.parent;ez.parent=e4;if(e4.parent!=null){if(e4.parent.child1==ez){e4.parent.child1=e4}else{e4.parent.child2=e4}}else{this.root=e4}if(ed.height>eU.height){e4.child2=ed;ez.child1=eU;eU.parent=ez;var eG=ez.aabb;var eO=e2.aabb;var et=eU.aabb;eG.minx=eO.minxet.maxx?eO.maxx:et.maxx;eG.maxy=eO.maxy>et.maxy?eO.maxy:et.maxy;var eE=e4.aabb;var eN=ez.aabb;var er=ed.aabb;eE.minx=eN.minxer.maxx?eN.maxx:er.maxx;eE.maxy=eN.maxy>er.maxy?eN.maxy:er.maxy;var ek=e2.height;var e3=eU.height;ez.height=1+(ek>e3?ek:e3);var ej=ez.height;var e1=ed.height;e4.height=1+(ej>e1?ej:e1)}else{e4.child2=eU;ez.child1=ed;ed.parent=ez;var eC=ez.aabb;var eL=e2.aabb;var eq=ed.aabb;eC.minx=eL.minxeq.maxx?eL.maxx:eq.maxx;eC.maxy=eL.maxy>eq.maxy?eL.maxy:eq.maxy;var eB=e4.aabb;var eJ=ez.aabb;var ep=eU.aabb;eB.minx=eJ.minxep.maxx?eJ.maxx:ep.maxx;eB.maxy=eJ.maxy>ep.maxy?eJ.maxy:ep.maxy;var ei=e2.height;var e0=ed.height;ez.height=1+(ei>e0?ei:e0);var eh=ez.height;var eZ=eU.height;e4.height=1+(eh>eZ?eh:eZ)}ez=e4}else{ez=ez}}}var eb=ez.child1;var ea=ez.child2;var eA=ez.aabb;var eH=eb.aabb;var eo=ea.aabb;eA.minx=eH.minxeo.maxx?eH.maxx:eo.maxx;eA.maxy=eH.maxy>eo.maxy?eH.maxy:eo.maxy;var ef=eb.height;var eX=ea.height;ez.height=1+(ef>eX?ef:eX);ez=ez.parent}}else{this.root=eT;eT.parent=null;ee.height=-1;var eg=ee.aabb;if(eg.outer!=null){eg.outer.zpp_inner=null;eg.outer=null}eg.wrap_min=eg.wrap_max=null;eg._invalidate=null;eg._validate=null;eg.next=bT.zpp_pool;bT.zpp_pool=eg;ee.child1=ee.child2=ee.parent=null;ee.next=null;ee.snext=null;ee.mnext=null;ee.next=dz.zpp_pool;dz.zpp_pool=ee}}};d.prototype.inlined_removeLeaf=function(eW){if(eW==this.root){this.root=null;return}else{var ee=eW.parent;var ey=ee.parent;var eT=ee.child1==eW?ee.child2:ee.child1;if(ey!=null){if(ey.child1==ee){ey.child1=eT}else{ey.child2=eT}eT.parent=ey;ee.height=-1;var eS=ee.aabb;if(eS.outer!=null){eS.outer.zpp_inner=null;eS.outer=null}eS.wrap_min=eS.wrap_max=null;eS._invalidate=null;eS._validate=null;eS.next=bT.zpp_pool;bT.zpp_pool=eS;ee.child1=ee.child2=ee.parent=null;ee.next=null;ee.snext=null;ee.mnext=null;ee.next=dz.zpp_pool;dz.zpp_pool=ee;var ez=ey;while(ez!=null){if(ez.child1==null||ez.height<2){ez=ez}else{var e4=ez.child1;var e2=ez.child2;var es=e2.height-e4.height;if(es>1){var eY=e2.child1;var eV=e2.child2;e2.child1=ez;e2.parent=ez.parent;ez.parent=e2;if(e2.parent!=null){if(e2.parent.child1==ez){e2.parent.child1=e2}else{e2.parent.child2=e2}}else{this.root=e2}if(eY.height>eV.height){e2.child2=eY;ez.child2=eV;eV.parent=ez;var ec=ez.aabb;var e5=e4.aabb;var ex=eV.aabb;ec.minx=e5.minxex.maxx?e5.maxx:ex.maxx;ec.maxy=e5.maxy>ex.maxy?e5.maxy:ex.maxy;var eM=e2.aabb;var eR=ez.aabb;var ew=eY.aabb;eM.minx=eR.minxew.maxx?eR.maxx:ew.maxx;eM.maxy=eR.maxy>ew.maxy?eR.maxy:ew.maxy;var eF=e4.height;var eD=eV.height;ez.height=1+(eF>eD?eF:eD);var en=ez.height;var e8=eY.height;e2.height=1+(en>e8?en:e8)}else{e2.child2=eV;ez.child2=eY;eY.parent=ez;var eK=ez.aabb;var eQ=e4.aabb;var ev=eY.aabb;eK.minx=eQ.minxev.maxx?eQ.maxx:ev.maxx;eK.maxy=eQ.maxy>ev.maxy?eQ.maxy:ev.maxy;var eI=e2.aabb;var eP=ez.aabb;var eu=eV.aabb;eI.minx=eP.minxeu.maxx?eP.maxx:eu.maxx;eI.maxy=eP.maxy>eu.maxy?eP.maxy:eu.maxy;var em=e4.height;var e7=eY.height;ez.height=1+(em>e7?em:e7);var el=ez.height;var e6=eV.height;e2.height=1+(el>e6?el:e6)}ez=e2}else{if(es<-1){var ed=e4.child1;var eU=e4.child2;e4.child1=ez;e4.parent=ez.parent;ez.parent=e4;if(e4.parent!=null){if(e4.parent.child1==ez){e4.parent.child1=e4}else{e4.parent.child2=e4}}else{this.root=e4}if(ed.height>eU.height){e4.child2=ed;ez.child1=eU;eU.parent=ez;var eG=ez.aabb;var eO=e2.aabb;var et=eU.aabb;eG.minx=eO.minxet.maxx?eO.maxx:et.maxx;eG.maxy=eO.maxy>et.maxy?eO.maxy:et.maxy;var eE=e4.aabb;var eN=ez.aabb;var er=ed.aabb;eE.minx=eN.minxer.maxx?eN.maxx:er.maxx;eE.maxy=eN.maxy>er.maxy?eN.maxy:er.maxy;var ek=e2.height;var e3=eU.height;ez.height=1+(ek>e3?ek:e3);var ej=ez.height;var e1=ed.height;e4.height=1+(ej>e1?ej:e1)}else{e4.child2=eU;ez.child1=ed;ed.parent=ez;var eC=ez.aabb;var eL=e2.aabb;var eq=ed.aabb;eC.minx=eL.minxeq.maxx?eL.maxx:eq.maxx;eC.maxy=eL.maxy>eq.maxy?eL.maxy:eq.maxy;var eB=e4.aabb;var eJ=ez.aabb;var ep=eU.aabb;eB.minx=eJ.minxep.maxx?eJ.maxx:ep.maxx;eB.maxy=eJ.maxy>ep.maxy?eJ.maxy:ep.maxy;var ei=e2.height;var e0=ed.height;ez.height=1+(ei>e0?ei:e0);var eh=ez.height;var eZ=eU.height;e4.height=1+(eh>eZ?eh:eZ)}ez=e4}else{ez=ez}}}var eb=ez.child1;var ea=ez.child2;var eA=ez.aabb;var eH=eb.aabb;var eo=ea.aabb;eA.minx=eH.minxeo.maxx?eH.maxx:eo.maxx;eA.maxy=eH.maxy>eo.maxy?eH.maxy:eo.maxy;var ef=eb.height;var eX=ea.height;ez.height=1+(ef>eX?ef:eX);ez=ez.parent}}else{this.root=eT;eT.parent=null;ee.height=-1;var eg=ee.aabb;if(eg.outer!=null){eg.outer.zpp_inner=null;eg.outer=null}eg.wrap_min=eg.wrap_max=null;eg._invalidate=null;eg._validate=null;eg.next=bT.zpp_pool;bT.zpp_pool=eg;ee.child1=ee.child2=ee.parent=null;ee.next=null;ee.snext=null;ee.mnext=null;ee.next=dz.zpp_pool;dz.zpp_pool=ee}}};d.prototype.balance=function(eS){if(eS.child1==null||eS.height<2){return eS}else{var eR=eS.child1;var eP=eS.child2;var em=eP.height-eR.height;if(em>1){var eL=eP.child1;var eK=eP.child2;eP.child1=eS;eP.parent=eS.parent;eS.parent=eP;if(eP.parent!=null){if(eP.parent.child1==eS){eP.parent.child1=eP}else{eP.parent.child2=eP}}else{this.root=eP}if(eL.height>eK.height){eP.child2=eL;eS.child2=eK;eK.parent=eS;var ea=eS.aabb;var eI=eR.aabb;var er=eK.aabb;ea.minx=eI.minxer.maxx?eI.maxx:er.maxx;ea.maxy=eI.maxy>er.maxy?eI.maxy:er.maxy;var eD=eP.aabb;var eH=eS.aabb;var eq=eL.aabb;eD.minx=eH.minxeq.maxx?eH.maxx:eq.maxx;eD.maxy=eH.maxy>eq.maxy?eH.maxy:eq.maxy;var ew=eR.height;var eu=eK.height;eS.height=1+(ew>eu?ew:eu);var ei=eS.height;var eV=eL.height;eP.height=1+(ei>eV?ei:eV)}else{eP.child2=eK;eS.child2=eL;eL.parent=eS;var eB=eS.aabb;var eG=eR.aabb;var ep=eL.aabb;eB.minx=eG.minxep.maxx?eG.maxx:ep.maxx;eB.maxy=eG.maxy>ep.maxy?eG.maxy:ep.maxy;var ez=eP.aabb;var eF=eS.aabb;var eo=eK.aabb;ez.minx=eF.minxeo.maxx?eF.maxx:eo.maxx;ez.maxy=eF.maxy>eo.maxy?eF.maxy:eo.maxy;var eh=eR.height;var eU=eL.height;eS.height=1+(eh>eU?eh:eU);var eg=eS.height;var eT=eK.height;eP.height=1+(eg>eT?eg:eT)}return eP}else{if(em<-1){var eb=eR.child1;var eJ=eR.child2;eR.child1=eS;eR.parent=eS.parent;eS.parent=eR;if(eR.parent!=null){if(eR.parent.child1==eS){eR.parent.child1=eR}else{eR.parent.child2=eR}}else{this.root=eR}if(eb.height>eJ.height){eR.child2=eb;eS.child1=eJ;eJ.parent=eS;var ex=eS.aabb;var eE=eP.aabb;var en=eJ.aabb;ex.minx=eE.minxen.maxx?eE.maxx:en.maxx;ex.maxy=eE.maxy>en.maxy?eE.maxy:en.maxy;var ev=eR.aabb;var eC=eS.aabb;var el=eb.aabb;ev.minx=eC.minxel.maxx?eC.maxx:el.maxx;ev.maxy=eC.maxy>el.maxy?eC.maxy:el.maxy;var ef=eP.height;var eQ=eJ.height;eS.height=1+(ef>eQ?ef:eQ);var ee=eS.height;var eO=eb.height;eR.height=1+(ee>eO?ee:eO)}else{eR.child2=eJ;eS.child1=eb;eb.parent=eS;var et=eS.aabb;var eA=eP.aabb;var ek=eb.aabb;et.minx=eA.minxek.maxx?eA.maxx:ek.maxx;et.maxy=eA.maxy>ek.maxy?eA.maxy:ek.maxy;var es=eR.aabb;var ey=eS.aabb;var ej=eJ.aabb;es.minx=ey.minxej.maxx?ey.maxx:ej.maxx;es.maxy=ey.maxy>ej.maxy?ey.maxy:ej.maxy;var ed=eP.height;var eN=eb.height;eS.height=1+(ed>eN?ed:eN);var ec=eS.height;var eM=eJ.height;eR.height=1+(ec>eM?ec:eM)}return eR}else{return eS}}}};d.prototype.__class__=d;var cT=zpp_nape.space.ZPP_DynAABBPhase=function(ea){this.openlist=null;this.failed=null;this.treeStack2=null;this.treeStack=null;this.moves=null;this.syncs=null;this.pairs=null;this.dtree=null;this.stree=null;dB.call(this);this.space=ea;this.is_sweep=false;this.dynab=this;this.stree=new d();this.dtree=new d()};cT.__name__=["zpp_nape","space","ZPP_DynAABBPhase"];cT.__super__=dB;cT.prototype=Object.create(dB.prototype);cT.prototype.stree=null;cT.prototype.dtree=null;cT.prototype.pairs=null;cT.prototype.syncs=null;cT.prototype.moves=null;cT.prototype.dyn=function(ea){if(ea.body.type==1){return false}else{return !ea.body.component.sleeping}};cT.prototype.__insert=function(ea){var eb;if(dz.zpp_pool==null){eb=new dz()}else{eb=dz.zpp_pool;dz.zpp_pool=eb.next;eb.next=null}if(bT.zpp_pool==null){eb.aabb=new bT()}else{eb.aabb=bT.zpp_pool;bT.zpp_pool=eb.aabb.next;eb.aabb.next=null}eb.moved=false;eb.synced=false;eb.first_sync=false;eb.shape=ea;ea.node=eb;eb.synced=true;eb.first_sync=true;eb.snext=this.syncs;this.syncs=eb};cT.prototype.__remove=function(eh){var ee=eh.node;if(!ee.first_sync){if(ee.dyn){this.dtree.removeLeaf(ee)}else{this.stree.removeLeaf(ee)}}eh.node=null;if(ee.synced){var eg=null;var el=this.syncs;while(el!=null){if(el==ee){break}eg=el;el=el.snext}if(eg==null){this.syncs=el.snext}else{eg.snext=el.snext}el.snext=null;ee.synced=false}if(ee.moved){var ef=null;var ek=this.moves;while(ek!=null){if(ek==ee){break}ef=ek;ek=ek.mnext}if(ef==null){this.moves=ek.mnext}else{ef.mnext=ek.mnext}ek.mnext=null;ee.moved=false}var ed=null;var ej=this.pairs;while(ej!=null){var ea=ej.next;if(ej.n1==ee||ej.n2==ee){if(ed==null){this.pairs=ea}else{ed.next=ea}if(ej.arb!=null){ej.arb.pair=null}ej.arb=null;ej.n1.shape.pairs.remove(ej);ej.n2.shape.pairs.remove(ej);var eb=ej;eb.n1=eb.n2=null;eb.sleeping=false;eb.next=bG.zpp_pool;bG.zpp_pool=eb;ej=ea;continue}ed=ej;ej=ea}while(eh.pairs.head!=null){var ei=eh.pairs.pop_unsafe();if(ei.n1==ee){ei.n2.shape.pairs.remove(ei)}else{ei.n1.shape.pairs.remove(ei)}if(ei.arb!=null){ei.arb.pair=null}ei.arb=null;ei.n1=ei.n2=null;ei.sleeping=false;ei.next=bG.zpp_pool;bG.zpp_pool=ei}ee.height=-1;var ec=ee.aabb;if(ec.outer!=null){ec.outer.zpp_inner=null;ec.outer=null}ec.wrap_min=ec.wrap_max=null;ec._invalidate=null;ec._validate=null;ec.next=bT.zpp_pool;bT.zpp_pool=ec;ee.child1=ee.child2=ee.parent=null;ee.next=null;ee.snext=null;ee.mnext=null;ee.next=dz.zpp_pool;dz.zpp_pool=ee};cT.prototype.__sync=function(ea){var et=ea.node;if(!et.synced){if(!this.space.continuous){if(ea.zip_aabb){if(ea.body!=null){ea.zip_aabb=false;if(ea.type==0){var ew=ea.circle;if(ew.zip_worldCOM){if(ew.body!=null){ew.zip_worldCOM=false;if(ew.zip_localCOM){ew.zip_localCOM=false;if(ew.type==1){var eC=ew.polygon;if(eC.lverts.next.next==null){eC.localCOMx=eC.lverts.next.x;eC.localCOMy=eC.lverts.next.y}else{if(eC.lverts.next.next.next==null){eC.localCOMx=eC.lverts.next.x;eC.localCOMy=eC.lverts.next.y;eC.localCOMx+=eC.lverts.next.next.x;eC.localCOMy+=eC.lverts.next.next.y;eC.localCOMx*=0.5;eC.localCOMy*=0.5}else{eC.localCOMx=0;eC.localCOMy=0;var eD=0;var ev=eC.lverts.next;var em=ev;ev=ev.next;var el=ev;ev=ev.next;while(ev!=null){var ej=ev;eD+=el.x*(ej.y-em.y);var ep=ej.y*el.x-ej.x*el.y;eC.localCOMx+=(el.x+ej.x)*ep;eC.localCOMy+=(el.y+ej.y)*ep;em=el;el=ej;ev=ev.next}ev=eC.lverts.next;var ek=ev;eD+=el.x*(ek.y-em.y);var eh=ek.y*el.x-ek.x*el.y;eC.localCOMx+=(el.x+ek.x)*eh;eC.localCOMy+=(el.y+ek.y)*eh;em=el;ev=ev.next;var ei=ev;eD+=ek.x*(ei.y-em.y);var ef=ei.y*ek.x-ei.x*ek.y;eC.localCOMx+=(ek.x+ei.x)*ef;eC.localCOMy+=(ek.y+ei.y)*ef;eD=1/(3*eD);var eo=eD;eC.localCOMx*=eo;eC.localCOMy*=eo}}}if(ew.wrap_localCOM!=null){ew.wrap_localCOM.zpp_inner.x=ew.localCOMx;ew.wrap_localCOM.zpp_inner.y=ew.localCOMy}}var eB=ew.body;if(eB.zip_axis){eB.zip_axis=false;eB.axisx=Math.sin(eB.rot);eB.axisy=Math.cos(eB.rot)}ew.worldCOMx=ew.body.posx+(ew.body.axisy*ew.localCOMx-ew.body.axisx*ew.localCOMy);ew.worldCOMy=ew.body.posy+(ew.localCOMx*ew.body.axisx+ew.localCOMy*ew.body.axisy)}}var ed=ew.radius;var ec=ew.radius;ew.aabb.minx=ew.worldCOMx-ed;ew.aabb.miny=ew.worldCOMy-ec;ew.aabb.maxx=ew.worldCOMx+ed;ew.aabb.maxy=ew.worldCOMy+ec}else{var ez=ea.polygon;if(ez.zip_gverts){if(ez.body!=null){ez.zip_gverts=false;ez.validate_lverts();var ey=ez.body;if(ey.zip_axis){ey.zip_axis=false;ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}var en=ez.lverts.next;var es=ez.gverts.next;while(es!=null){var eA=es;var eu=en;en=en.next;eA.x=ez.body.posx+(ez.body.axisy*eu.x-ez.body.axisx*eu.y);eA.y=ez.body.posy+(eu.x*ez.body.axisx+eu.y*ez.body.axisy);es=es.next}}}var eb=ez.gverts.next;ez.aabb.minx=eb.x;ez.aabb.miny=eb.y;ez.aabb.maxx=eb.x;ez.aabb.maxy=eb.y;var er=ez.gverts.next.next;while(er!=null){var eq=er;if(eq.xez.aabb.maxx){ez.aabb.maxx=eq.x}if(eq.yez.aabb.maxy){ez.aabb.maxy=eq.y}er=er.next}}}}}var ee;if(et.dyn==(ea.body.type==1?false:!ea.body.component.sleeping)){var ex=et.aabb;var eg=ea.aabb;ee=!(eg.minx>=ex.minx&&eg.miny>=ex.miny&&eg.maxx<=ex.maxx&&eg.maxy<=ex.maxy)}else{ee=true}if(ee){et.synced=true;et.snext=this.syncs;this.syncs=et}}};cT.prototype.sync_broadphase=function(){this.space.validation();if(this.syncs!=null){if(this.moves==null){var fF=this.syncs;while(fF!=null){var hG=fF.shape;if(!fF.first_sync){var hF=fF.dyn?this.dtree:this.stree;if(fF==hF.root){hF.root=null}else{var i5=fF.parent;var jT=i5.parent;var fC=i5.child1==fF?i5.child2:i5.child1;if(jT!=null){if(jT.child1==i5){jT.child1=fC}else{jT.child2=fC}fC.parent=jT;i5.height=-1;var jF=i5.aabb;if(jF.outer!=null){jF.outer.zpp_inner=null;jF.outer=null}jF.wrap_min=jF.wrap_max=null;jF._invalidate=null;jF._validate=null;jF.next=bT.zpp_pool;bT.zpp_pool=jF;i5.child1=i5.child2=i5.parent=null;i5.next=null;i5.snext=null;i5.mnext=null;i5.next=dz.zpp_pool;dz.zpp_pool=i5;var i1=jT;while(i1!=null){if(i1.child1==null||i1.height<2){i1=i1}else{var jL=i1.child1;var jK=i1.child2;var jO=jK.height-jL.height;if(jO>1){var jJ=jK.child1;var jH=jK.child2;jK.child1=i1;jK.parent=i1.parent;i1.parent=jK;if(jK.parent!=null){if(jK.parent.child1==i1){jK.parent.child1=jK}else{jK.parent.child2=jK}}else{hF.root=jK}if(jJ.height>jH.height){jK.child2=jJ;i1.child2=jH;jH.parent=i1;var fx=i1.aabb;var jN=jL.aabb;var j9=jH.aabb;fx.minx=jN.minxj9.maxx?jN.maxx:j9.maxx;fx.maxy=jN.maxy>j9.maxy?jN.maxy:j9.maxy;var eG=jK.aabb;var ei=i1.aabb;var j7=jJ.aabb;eG.minx=ei.minxj7.maxx?ei.maxx:j7.maxx;eG.maxy=ei.maxy>j7.maxy?ei.maxy:j7.maxy;var jz=jL.height;var jy=jH.height;i1.height=1+(jz>jy?jz:jy);var eX=i1.height;var ev=jJ.height;jK.height=1+(eX>ev?eX:ev)}else{jK.child2=jH;i1.child2=jJ;jJ.parent=i1;var eF=i1.aabb;var eh=jL.aabb;var j4=jJ.aabb;eF.minx=eh.minxj4.maxx?eh.maxx:j4.maxx;eF.maxy=eh.maxy>j4.maxy?eh.maxy:j4.maxy;var eE=jK.aabb;var eg=i1.aabb;var j3=jH.aabb;eE.minx=eg.minxj3.maxx?eg.maxx:j3.maxx;eE.maxy=eg.maxy>j3.maxy?eg.maxy:j3.maxy;var eV=jL.height;var et=jJ.height;i1.height=1+(eV>et?eV:et);var eT=i1.height;var er=jH.height;jK.height=1+(eT>er?eT:er)}i1=jK}else{if(jO<-1){var jw=jL.child1;var jm=jL.child2;jL.child1=i1;jL.parent=i1.parent;i1.parent=jL;if(jL.parent!=null){if(jL.parent.child1==i1){jL.parent.child1=jL}else{jL.parent.child2=jL}}else{hF.root=jL}if(jw.height>jm.height){jL.child2=jw;i1.child1=jm;jm.parent=i1;var eD=i1.aabb;var ef=jK.aabb;var j2=jm.aabb;eD.minx=ef.minxj2.maxx?ef.maxx:j2.maxx;eD.maxy=ef.maxy>j2.maxy?ef.maxy:j2.maxy;var eC=jL.aabb;var ee=i1.aabb;var j1=jw.aabb;eC.minx=ee.minxj1.maxx?ee.maxx:j1.maxx;eC.maxy=ee.maxy>j1.maxy?ee.maxy:j1.maxy;var eR=jK.height;var ep=jm.height;i1.height=1+(eR>ep?eR:ep);var eP=i1.height;var en=jw.height;jL.height=1+(eP>en?eP:en)}else{jL.child2=jm;i1.child1=jw;jw.parent=i1;var eB=i1.aabb;var ed=jK.aabb;var j0=jw.aabb;eB.minx=ed.minxj0.maxx?ed.maxx:j0.maxx;eB.maxy=ed.maxy>j0.maxy?ed.maxy:j0.maxy;var eA=jL.aabb;var ec=i1.aabb;var jZ=jm.aabb;eA.minx=ec.minxjZ.maxx?ec.maxx:jZ.maxx;eA.maxy=ec.maxy>jZ.maxy?ec.maxy:jZ.maxy;var eN=jK.height;var em=jw.height;i1.height=1+(eN>em?eN:em);var eL=i1.height;var el=jm.height;jL.height=1+(eL>el?eL:el)}i1=jL}else{i1=i1}}}var gv=i1.child1;var gs=i1.child2;var ez=i1.aabb;var eb=gv.aabb;var jY=gs.aabb;ez.minx=eb.minxjY.maxx?eb.maxx:jY.maxx;ez.maxy=eb.maxy>jY.maxy?eb.maxy:jY.maxy;var eJ=gv.height;var ek=gs.height;i1.height=1+(eJ>ek?eJ:ek);i1=i1.parent}}else{hF.root=fC;fC.parent=null;i5.height=-1;var ie=i5.aabb;if(ie.outer!=null){ie.outer.zpp_inner=null;ie.outer=null}ie.wrap_min=ie.wrap_max=null;ie._invalidate=null;ie._validate=null;ie.next=bT.zpp_pool;bT.zpp_pool=ie;i5.child1=i5.child2=i5.parent=null;i5.next=null;i5.snext=null;i5.mnext=null;i5.next=dz.zpp_pool;dz.zpp_pool=i5}}}else{fF.first_sync=false}var jp=fF.aabb;if(!this.space.continuous){if(hG.zip_aabb){if(hG.body!=null){hG.zip_aabb=false;if(hG.type==0){var ey=hG.circle;if(ey.zip_worldCOM){if(ey.body!=null){ey.zip_worldCOM=false;if(ey.zip_localCOM){ey.zip_localCOM=false;if(ey.type==1){var ir=ey.polygon;if(ir.lverts.next.next==null){ir.localCOMx=ir.lverts.next.x;ir.localCOMy=ir.lverts.next.y}else{if(ir.lverts.next.next.next==null){ir.localCOMx=ir.lverts.next.x;ir.localCOMy=ir.lverts.next.y;ir.localCOMx+=ir.lverts.next.next.x;ir.localCOMy+=ir.lverts.next.next.y;ir.localCOMx*=0.5;ir.localCOMy*=0.5}else{ir.localCOMx=0;ir.localCOMy=0;var ht=0;var i6=ir.lverts.next;var jC=i6;i6=i6.next;var jB=i6;i6=i6.next;while(i6!=null){var jA=i6;ht+=jB.x*(jA.y-jC.y);var jI=jA.y*jB.x-jA.x*jB.y;ir.localCOMx+=(jB.x+jA.x)*jI;ir.localCOMy+=(jB.y+jA.y)*jI;jC=jB;jB=jA;i6=i6.next}i6=ir.lverts.next;var fc=i6;ht+=jB.x*(fc.y-jC.y);var jn=fc.y*jB.x-fc.x*jB.y;ir.localCOMx+=(jB.x+fc.x)*jn;ir.localCOMy+=(jB.y+fc.y)*jn;jC=jB;i6=i6.next;var fa=i6;ht+=fc.x*(fa.y-jC.y);var jl=fa.y*fc.x-fa.x*fc.y;ir.localCOMx+=(fc.x+fa.x)*jl;ir.localCOMy+=(fc.y+fa.y)*jl;ht=1/(3*ht);var jD=ht;ir.localCOMx*=jD;ir.localCOMy*=jD}}}if(ey.wrap_localCOM!=null){ey.wrap_localCOM.zpp_inner.x=ey.localCOMx;ey.wrap_localCOM.zpp_inner.y=ey.localCOMy}}var iq=ey.body;if(iq.zip_axis){iq.zip_axis=false;iq.axisx=Math.sin(iq.rot);iq.axisy=Math.cos(iq.rot)}ey.worldCOMx=ey.body.posx+(ey.body.axisy*ey.localCOMx-ey.body.axisx*ey.localCOMy);ey.worldCOMy=ey.body.posy+(ey.localCOMx*ey.body.axisx+ey.localCOMy*ey.body.axisy)}}var fD=ey.radius;var fB=ey.radius;ey.aabb.minx=ey.worldCOMx-fD;ey.aabb.miny=ey.worldCOMy-fB;ey.aabb.maxx=ey.worldCOMx+fD;ey.aabb.maxy=ey.worldCOMy+fB}else{var ip=hG.polygon;if(ip.zip_gverts){if(ip.body!=null){ip.zip_gverts=false;ip.validate_lverts();var io=ip.body;if(io.zip_axis){io.zip_axis=false;io.axisx=Math.sin(io.rot);io.axisy=Math.cos(io.rot)}var it=ip.lverts.next;var fn=ip.gverts.next;while(fn!=null){var jk=fn;var jG=it;it=it.next;jk.x=ip.body.posx+(ip.body.axisy*jG.x-ip.body.axisx*jG.y);jk.y=ip.body.posy+(jG.x*ip.body.axisx+jG.y*ip.body.axisy);fn=fn.next}}}var hK=ip.gverts.next;ip.aabb.minx=hK.x;ip.aabb.miny=hK.y;ip.aabb.maxx=hK.x;ip.aabb.maxy=hK.y;var fl=ip.gverts.next.next;while(fl!=null){var jE=fl;if(jE.xip.aabb.maxx){ip.aabb.maxx=jE.x}if(jE.yip.aabb.maxy){ip.aabb.maxy=jE.y}fl=fl.next}}}}}var ea=hG.aabb;jp.minx=ea.minx-3;jp.miny=ea.miny-3;jp.maxx=ea.maxx+3;jp.maxy=ea.maxy+3;var hY=(fF.dyn=hG.body.type==1?false:!hG.body.component.sleeping)?this.dtree:this.stree;if(hY.root==null){hY.root=fF;hY.root.parent=null}else{var jx=fF.aabb;var i0=hY.root;while(i0.child1!=null){var hh=i0.child1;var gy=i0.child2;var im=i0.aabb;var jR=(im.maxx-im.minx+(im.maxy-im.miny))*2;var il=d.tmpaabb;var hU=i0.aabb;il.minx=hU.minxjx.maxx?hU.maxx:jx.maxx;il.maxy=hU.maxy>jx.maxy?hU.maxy:jx.maxy;var ik=d.tmpaabb;var iB=(ik.maxx-ik.minx+(ik.maxy-ik.miny))*2;var jM=2*iB;var i2=2*(iB-jR);var ii=d.tmpaabb;var fw=hh.aabb;ii.minx=jx.minxfw.maxx?jx.maxx:fw.maxx;ii.maxy=jx.maxy>fw.maxy?jx.maxy:fw.maxy;var ka;if(hh.child1==null){var ih=d.tmpaabb;ka=(ih.maxx-ih.minx+(ih.maxy-ih.miny))*2+i2}else{var ig=hh.aabb;var i8=(ig.maxx-ig.minx+(ig.maxy-ig.miny))*2;var ib=d.tmpaabb;ka=(ib.maxx-ib.minx+(ib.maxy-ib.miny))*2-i8+i2}var ia=d.tmpaabb;var fv=gy.aabb;ia.minx=jx.minxfv.maxx?jx.maxx:fv.maxx;ia.maxy=jx.maxy>fv.maxy?jx.maxy:fv.maxy;var j8;if(gy.child1==null){var h9=d.tmpaabb;j8=(h9.maxx-h9.minx+(h9.maxy-h9.miny))*2+i2}else{var h8=gy.aabb;var h1=(h8.maxx-h8.minx+(h8.maxy-h8.miny))*2;var h7=d.tmpaabb;j8=(h7.maxx-h7.minx+(h7.maxy-h7.miny))*2-h1+i2}if(jMfu.maxx?jx.maxx:fu.maxx;h6.maxy=jx.maxy>fu.maxy?jx.maxy:fu.maxy;i7.height=gw.height+1;if(iN!=null){if(iN.child1==gw){iN.child1=i7}else{iN.child2=i7}i7.child1=gw;i7.child2=fF;gw.parent=i7;fF.parent=i7}else{i7.child1=gw;i7.child2=fF;gw.parent=i7;fF.parent=i7;hY.root=i7}i0=fF.parent;while(i0!=null){if(i0.child1==null||i0.height<2){i0=i0}else{var fs=i0.child1;var jX=i0.child2;var hI=jX.height-fs.height;if(hI>1){var jv=jX.child1;var ji=jX.child2;jX.child1=i0;jX.parent=i0.parent;i0.parent=jX;if(jX.parent!=null){if(jX.parent.child1==i0){jX.parent.child1=jX}else{jX.parent.child2=jX}}else{hY.root=jX}if(jv.height>ji.height){jX.child2=jv;i0.child2=ji;ji.parent=i0;var h5=i0.aabb;var hT=fs.aabb;var fr=ji.aabb;h5.minx=hT.minxfr.maxx?hT.maxx:fr.maxx;h5.maxy=hT.maxy>fr.maxy?hT.maxy:fr.maxy;var h3=jX.aabb;var hS=i0.aabb;var fq=jv.aabb;h3.minx=hS.minxfq.maxx?hS.maxx:fq.maxx;h3.maxy=hS.maxy>fq.maxy?hS.maxy:fq.maxy;var eH=fs.height;var ej=ji.height;i0.height=1+(eH>ej?eH:ej);var iX=i0.height;var gY=jv.height;jX.height=1+(iX>gY?iX:gY)}else{jX.child2=ji;i0.child2=jv;jv.parent=i0;var h2=i0.aabb;var hR=fs.aabb;var fp=jv.aabb;h2.minx=hR.minxfp.maxx?hR.maxx:fp.maxx;h2.maxy=hR.maxy>fp.maxy?hR.maxy:fp.maxy;var h0=jX.aabb;var hQ=i0.aabb;var fo=ji.aabb;h0.minx=hQ.minxfo.maxx?hQ.maxx:fo.maxx;h0.maxy=hQ.maxy>fo.maxy?hQ.maxy:fo.maxy;var iW=fs.height;var gW=jv.height;i0.height=1+(iW>gW?iW:gW);var iV=i0.height;var gU=ji.height;jX.height=1+(iV>gU?iV:gU)}i0=jX}else{if(hI<-1){var ju=fs.child1;var jg=fs.child2;fs.child1=i0;fs.parent=i0.parent;i0.parent=fs;if(fs.parent!=null){if(fs.parent.child1==i0){fs.parent.child1=fs}else{fs.parent.child2=fs}}else{hY.root=fs}if(ju.height>jg.height){fs.child2=ju;i0.child1=jg;jg.parent=i0;var hD=i0.aabb;var hP=jX.aabb;var fm=jg.aabb;hD.minx=hP.minxfm.maxx?hP.maxx:fm.maxx;hD.maxy=hP.maxy>fm.maxy?hP.maxy:fm.maxy;var hC=fs.aabb;var hO=i0.aabb;var fk=ju.aabb;hC.minx=hO.minxfk.maxx?hO.maxx:fk.maxx;hC.maxy=hO.maxy>fk.maxy?hO.maxy:fk.maxy;var iU=jX.height;var gS=jg.height;i0.height=1+(iU>gS?iU:gS);var iT=i0.height;var gQ=ju.height;fs.height=1+(iT>gQ?iT:gQ)}else{fs.child2=jg;i0.child1=ju;ju.parent=i0;var hB=i0.aabb;var hN=jX.aabb;var fe=ju.aabb;hB.minx=hN.minxfe.maxx?hN.maxx:fe.maxx;hB.maxy=hN.maxy>fe.maxy?hN.maxy:fe.maxy;var hA=fs.aabb;var hM=i0.aabb;var fd=jg.aabb;hA.minx=hM.minxfd.maxx?hM.maxx:fd.maxx;hA.maxy=hM.maxy>fd.maxy?hM.maxy:fd.maxy;var iS=jX.height;var gO=ju.height;i0.height=1+(iS>gO?iS:gO);var iR=i0.height;var gM=jg.height;fs.height=1+(iR>gM?iR:gM)}i0=fs}else{i0=i0}}}var hg=i0.child1;var gx=i0.child2;var iQ=hg.height;var gL=gx.height;i0.height=1+(iQ>gL?iQ:gL);var hz=i0.aabb;var hL=hg.aabb;var fb=gx.aabb;hz.minx=hL.minxfb.maxx?hL.maxx:fb.maxx;hz.maxy=hL.maxy>fb.maxy?hL.maxy:fb.maxy;i0=i0.parent}}fF.synced=false;fF.moved=true;fF.mnext=fF.snext;fF.snext=null;fF=fF.mnext}var fG=this.syncs;this.syncs=this.moves;this.moves=fG}else{while(this.syncs!=null){var jV=this.syncs;this.syncs=jV.snext;jV.snext=null;var i9=jV.shape;if(!jV.first_sync){var hW=jV.dyn?this.dtree:this.stree;if(jV==hW.root){hW.root=null}else{var i3=jV.parent;var fA=i3.parent;var gt=i3.child1==jV?i3.child2:i3.child1;if(fA!=null){if(fA.child1==i3){fA.child1=gt}else{fA.child2=gt}gt.parent=fA;i3.height=-1;var id=i3.aabb;if(id.outer!=null){id.outer.zpp_inner=null;id.outer=null}id.wrap_min=id.wrap_max=null;id._invalidate=null;id._validate=null;id.next=bT.zpp_pool;bT.zpp_pool=id;i3.child1=i3.child2=i3.parent=null;i3.next=null;i3.snext=null;i3.mnext=null;i3.next=dz.zpp_pool;dz.zpp_pool=i3;var iZ=fA;while(iZ!=null){if(iZ.child1==null||iZ.height<2){iZ=iZ}else{var e9=iZ.child1;var jW=iZ.child2;var hH=jW.height-e9.height;if(hH>1){var jt=jW.child1;var je=jW.child2;jW.child1=iZ;jW.parent=iZ.parent;iZ.parent=jW;if(jW.parent!=null){if(jW.parent.child1==iZ){jW.parent.child1=jW}else{jW.parent.child2=jW}}else{hW.root=jW}if(jt.height>je.height){jW.child2=jt;iZ.child2=je;je.parent=iZ;var hy=iZ.aabb;var hs=e9.aabb;var e7=je.aabb;hy.minx=hs.minxe7.maxx?hs.maxx:e7.maxx;hy.maxy=hs.maxy>e7.maxy?hs.maxy:e7.maxy;var hx=jW.aabb;var hr=iZ.aabb;var e5=jt.aabb;hx.minx=hr.minxe5.maxx?hr.maxx:e5.maxx;hx.maxy=hr.maxy>e5.maxy?hr.maxy:e5.maxy;var iP=e9.height;var gK=je.height;iZ.height=1+(iP>gK?iP:gK);var iO=iZ.height;var gI=jt.height;jW.height=1+(iO>gI?iO:gI)}else{jW.child2=je;iZ.child2=jt;jt.parent=iZ;var hw=iZ.aabb;var hq=e9.aabb;var e3=jt.aabb;hw.minx=hq.minxe3.maxx?hq.maxx:e3.maxx;hw.maxy=hq.maxy>e3.maxy?hq.maxy:e3.maxy;var hv=jW.aabb;var hp=iZ.aabb;var e2=je.aabb;hv.minx=hp.minxe2.maxx?hp.maxx:e2.maxx;hv.maxy=hp.maxy>e2.maxy?hp.maxy:e2.maxy;var iL=e9.height;var gk=jt.height;iZ.height=1+(iL>gk?iL:gk);var iK=iZ.height;var gi=je.height;jW.height=1+(iK>gi?iK:gi)}iZ=jW}else{if(hH<-1){var jr=e9.child1;var jd=e9.child2;e9.child1=iZ;e9.parent=iZ.parent;iZ.parent=e9;if(e9.parent!=null){if(e9.parent.child1==iZ){e9.parent.child1=e9}else{e9.parent.child2=e9}}else{hW.root=e9}if(jr.height>jd.height){e9.child2=jr;iZ.child1=jd;jd.parent=iZ;var hu=iZ.aabb;var ho=jW.aabb;var e1=jd.aabb;hu.minx=ho.minxe1.maxx?ho.maxx:e1.maxx;hu.maxy=ho.maxy>e1.maxy?ho.maxy:e1.maxy;var hc=e9.aabb;var hm=iZ.aabb;var e0=jr.aabb;hc.minx=hm.minxe0.maxx?hm.maxx:e0.maxx;hc.maxy=hm.maxy>e0.maxy?hm.maxy:e0.maxy;var iJ=jW.height;var gg=jd.height;iZ.height=1+(iJ>gg?iJ:gg);var iI=iZ.height;var ge=jr.height;e9.height=1+(iI>ge?iI:ge)}else{e9.child2=jd;iZ.child1=jr;jr.parent=iZ;var ha=iZ.aabb;var hl=jW.aabb;var eZ=jr.aabb;ha.minx=hl.minxeZ.maxx?hl.maxx:eZ.maxx;ha.maxy=hl.maxy>eZ.maxy?hl.maxy:eZ.maxy;var g0=e9.aabb;var hk=iZ.aabb;var eY=jd.aabb;g0.minx=hk.minxeY.maxx?hk.maxx:eY.maxx;g0.maxy=hk.maxy>eY.maxy?hk.maxy:eY.maxy;var iH=jW.height;var gc=jr.height;iZ.height=1+(iH>gc?iH:gc);var iG=iZ.height;var ga=jd.height;e9.height=1+(iG>ga?iG:ga)}iZ=e9}else{iZ=iZ}}}var hf=iZ.child1;var gu=iZ.child2;var gZ=iZ.aabb;var hj=hf.aabb;var eW=gu.aabb;gZ.minx=hj.minxeW.maxx?hj.maxx:eW.maxx;gZ.maxy=hj.maxy>eW.maxy?hj.maxy:eW.maxy;var iF=hf.height;var f8=gu.height;iZ.height=1+(iF>f8?iF:f8);iZ=iZ.parent}}else{hW.root=gt;gt.parent=null;i3.height=-1;var ic=i3.aabb;if(ic.outer!=null){ic.outer.zpp_inner=null;ic.outer=null}ic.wrap_min=ic.wrap_max=null;ic._invalidate=null;ic._validate=null;ic.next=bT.zpp_pool;bT.zpp_pool=ic;i3.child1=i3.child2=i3.parent=null;i3.next=null;i3.snext=null;i3.mnext=null;i3.next=dz.zpp_pool;dz.zpp_pool=i3}}}else{jV.first_sync=false}var jS=jV.aabb;if(!this.space.continuous){if(i9.zip_aabb){if(i9.body!=null){i9.zip_aabb=false;if(i9.type==0){var gX=i9.circle;if(gX.zip_worldCOM){if(gX.body!=null){gX.zip_worldCOM=false;if(gX.zip_localCOM){gX.zip_localCOM=false;if(gX.type==1){var gV=gX.polygon;if(gV.lverts.next.next==null){gV.localCOMx=gV.lverts.next.x;gV.localCOMy=gV.lverts.next.y}else{if(gV.lverts.next.next.next==null){gV.localCOMx=gV.lverts.next.x;gV.localCOMy=gV.lverts.next.y;gV.localCOMx+=gV.lverts.next.next.x;gV.localCOMy+=gV.lverts.next.next.y;gV.localCOMx*=0.5;gV.localCOMy*=0.5}else{gV.localCOMx=0;gV.localCOMy=0;var jQ=0;var fj=gV.lverts.next;var fy=fj;fj=fj.next;var ft=fj;fj=fj.next;while(fj!=null){var e8=fj;jQ+=ft.x*(e8.y-fy.y);var jj=e8.y*ft.x-e8.x*ft.y;gV.localCOMx+=(ft.x+e8.x)*jj;gV.localCOMy+=(ft.y+e8.y)*jj;fy=ft;ft=e8;fj=fj.next}fj=gV.lverts.next;var e6=fj;jQ+=ft.x*(e6.y-fy.y);var jh=e6.y*ft.x-e6.x*ft.y;gV.localCOMx+=(ft.x+e6.x)*jh;gV.localCOMy+=(ft.y+e6.y)*jh;fy=ft;fj=fj.next;var e4=fj;jQ+=e6.x*(e4.y-fy.y);var jf=e4.y*e6.x-e4.x*e6.y;gV.localCOMx+=(e6.x+e4.x)*jf;gV.localCOMy+=(e6.y+e4.y)*jf;jQ=1/(3*jQ);var fE=jQ;gV.localCOMx*=fE;gV.localCOMy*=fE}}}if(gX.wrap_localCOM!=null){gX.wrap_localCOM.zpp_inner.x=gX.localCOMx;gX.wrap_localCOM.zpp_inner.y=gX.localCOMy}}var gT=gX.body;if(gT.zip_axis){gT.zip_axis=false;gT.axisx=Math.sin(gT.rot);gT.axisy=Math.cos(gT.rot)}gX.worldCOMx=gX.body.posx+(gX.body.axisy*gX.localCOMx-gX.body.axisx*gX.localCOMy);gX.worldCOMy=gX.body.posy+(gX.localCOMx*gX.body.axisx+gX.localCOMy*gX.body.axisy)}}var fH=gX.radius;var fz=gX.radius;gX.aabb.minx=gX.worldCOMx-fH;gX.aabb.miny=gX.worldCOMy-fz;gX.aabb.maxx=gX.worldCOMx+fH;gX.aabb.maxy=gX.worldCOMy+fz}else{var gR=i9.polygon;if(gR.zip_gverts){if(gR.body!=null){gR.zip_gverts=false;gR.validate_lverts();var gP=gR.body;if(gP.zip_axis){gP.zip_axis=false;gP.axisx=Math.sin(gP.rot);gP.axisy=Math.cos(gP.rot)}var hn=gR.lverts.next;var fi=gR.gverts.next;while(fi!=null){var jc=fi;var iM=hn;hn=hn.next;jc.x=gR.body.posx+(gR.body.axisy*iM.x-gR.body.axisx*iM.y);jc.y=gR.body.posy+(iM.x*gR.body.axisx+iM.y*gR.body.axisy);fi=fi.next}}}var i4=gR.gverts.next;gR.aabb.minx=i4.x;gR.aabb.miny=i4.y;gR.aabb.maxx=i4.x;gR.aabb.maxy=i4.y;var fh=gR.gverts.next.next;while(fh!=null){var hJ=fh;if(hJ.xgR.aabb.maxx){gR.aabb.maxx=hJ.x}if(hJ.ygR.aabb.maxy){gR.aabb.maxy=hJ.y}fh=fh.next}}}}}var hi=i9.aabb;jS.minx=hi.minx-3;jS.miny=hi.miny-3;jS.maxx=hi.maxx+3;jS.maxy=hi.maxy+3;var hV=(jV.dyn=i9.body.type==1?false:!i9.body.component.sleeping)?this.dtree:this.stree;if(hV.root==null){hV.root=jV;hV.root.parent=null}else{var j5=jV.aabb;var iY=hV.root;while(iY.child1!=null){var he=iY.child1;var gr=iY.child2;var gN=iY.aabb;var jP=(gN.maxx-gN.minx+(gN.maxy-gN.miny))*2;var go=d.tmpaabb;var gJ=iY.aabb;go.minx=gJ.minxj5.maxx?gJ.maxx:j5.maxx;go.maxy=gJ.maxy>j5.maxy?gJ.maxy:j5.maxy;var gn=d.tmpaabb;var ff=(gn.maxx-gn.minx+(gn.maxy-gn.miny))*2;var j6=2*ff;var hb=2*(ff-jP);var gm=d.tmpaabb;var eU=he.aabb;gm.minx=j5.minxeU.maxx?j5.maxx:eU.maxx;gm.maxy=j5.maxy>eU.maxy?j5.maxy:eU.maxy;var ij;if(he.child1==null){var gl=d.tmpaabb;ij=(gl.maxx-gl.minx+(gl.maxy-gl.miny))*2+hb}else{var gj=he.aabb;var hZ=(gj.maxx-gj.minx+(gj.maxy-gj.miny))*2;var gh=d.tmpaabb;ij=(gh.maxx-gh.minx+(gh.maxy-gh.miny))*2-hZ+hb}var gf=d.tmpaabb;var eS=gr.aabb;gf.minx=j5.minxeS.maxx?j5.maxx:eS.maxx;gf.maxy=j5.maxy>eS.maxy?j5.maxy:eS.maxy;var h4;if(gr.child1==null){var gd=d.tmpaabb;h4=(gd.maxx-gd.minx+(gd.maxy-gd.miny))*2+hb}else{var gb=gr.aabb;var hX=(gb.maxx-gb.minx+(gb.maxy-gb.miny))*2;var f9=d.tmpaabb;h4=(f9.maxx-f9.minx+(f9.maxy-f9.miny))*2-hX+hb}if(j6eQ.maxx?j5.maxx:eQ.maxx;fX.maxy=j5.maxy>eQ.maxy?j5.maxy:eQ.maxy;fg.height=gq.height+1;if(iu!=null){if(iu.child1==gq){iu.child1=fg}else{iu.child2=fg}fg.child1=gq;fg.child2=jV;gq.parent=fg;jV.parent=fg}else{fg.child1=gq;fg.child2=jV;gq.parent=fg;jV.parent=fg;hV.root=fg}iY=jV.parent;while(iY!=null){if(iY.child1==null||iY.height<2){iY=iY}else{var eO=iY.child1;var jU=iY.child2;var hE=jU.height-eO.height;if(hE>1){var jq=jU.child1;var jb=jU.child2;jU.child1=iY;jU.parent=iY.parent;iY.parent=jU;if(jU.parent!=null){if(jU.parent.child1==iY){jU.parent.child1=jU}else{jU.parent.child2=jU}}else{hV.root=jU}if(jq.height>jb.height){jU.child2=jq;iY.child2=jb;jb.parent=iY;var fW=iY.aabb;var gH=eO.aabb;var eM=jb.aabb;fW.minx=gH.minxeM.maxx?gH.maxx:eM.maxx;fW.maxy=gH.maxy>eM.maxy?gH.maxy:eM.maxy;var fV=jU.aabb;var gG=iY.aabb;var eK=jq.aabb;fV.minx=gG.minxeK.maxx?gG.maxx:eK.maxx;fV.maxy=gG.maxy>eK.maxy?gG.maxy:eK.maxy;var iE=eO.height;var f0=jb.height;iY.height=1+(iE>f0?iE:f0);var iD=iY.height;var fZ=jq.height;jU.height=1+(iD>fZ?iD:fZ)}else{jU.child2=jb;iY.child2=jq;jq.parent=iY;var fU=iY.aabb;var gF=eO.aabb;var eI=jq.aabb;fU.minx=gF.minxeI.maxx?gF.maxx:eI.maxx;fU.maxy=gF.maxy>eI.maxy?gF.maxy:eI.maxy;var fT=jU.aabb;var gE=iY.aabb;var ex=jb.aabb;fT.minx=gE.minxex.maxx?gE.maxx:ex.maxx;fT.maxy=gE.maxy>ex.maxy?gE.maxy:ex.maxy;var iC=eO.height;var fY=jq.height;iY.height=1+(iC>fY?iC:fY);var iA=iY.height;var fS=jb.height;jU.height=1+(iA>fS?iA:fS)}iY=jU}else{if(hE<-1){var jo=eO.child1;var ja=eO.child2;eO.child1=iY;eO.parent=iY.parent;iY.parent=eO;if(eO.parent!=null){if(eO.parent.child1==iY){eO.parent.child1=eO}else{eO.parent.child2=eO}}else{hV.root=eO}if(jo.height>ja.height){eO.child2=jo;iY.child1=ja;ja.parent=iY;var fR=iY.aabb;var gD=jU.aabb;var ew=ja.aabb;fR.minx=gD.minxew.maxx?gD.maxx:ew.maxx;fR.maxy=gD.maxy>ew.maxy?gD.maxy:ew.maxy;var fP=eO.aabb;var gC=iY.aabb;var eu=jo.aabb;fP.minx=gC.minxeu.maxx?gC.maxx:eu.maxx;fP.maxy=gC.maxy>eu.maxy?gC.maxy:eu.maxy;var iz=jU.height;var fQ=ja.height;iY.height=1+(iz>fQ?iz:fQ);var iy=iY.height;var fO=jo.height;eO.height=1+(iy>fO?iy:fO)}else{eO.child2=ja;iY.child1=jo;jo.parent=iY;var fN=iY.aabb;var gB=jU.aabb;var es=jo.aabb;fN.minx=gB.minxes.maxx?gB.maxx:es.maxx;fN.maxy=gB.maxy>es.maxy?gB.maxy:es.maxy;var fL=eO.aabb;var gA=iY.aabb;var eq=ja.aabb;fL.minx=gA.minxeq.maxx?gA.maxx:eq.maxx;fL.maxy=gA.maxy>eq.maxy?gA.maxy:eq.maxy;var ix=jU.height;var fM=jo.height;iY.height=1+(ix>fM?ix:fM);var iw=iY.height;var fK=ja.height;eO.height=1+(iw>fK?iw:fK)}iY=eO}else{iY=iY}}}var hd=iY.child1;var gp=iY.child2;var iv=hd.height;var fJ=gp.height;iY.height=1+(iv>fJ?iv:fJ);var fI=iY.aabb;var gz=hd.aabb;var eo=gp.aabb;fI.minx=gz.minxeo.maxx?gz.maxx:eo.maxx;fI.maxy=gz.maxy>eo.maxy?gz.maxy:eo.maxy;iY=iY.parent}}jV.synced=false;if(!jV.moved){jV.moved=true;jV.mnext=this.moves;this.moves=jV}}}}};cT.prototype.broadphase=function(eT,eq){var iD=this.syncs;while(iD!=null){var fO=iD.shape;if(!iD.first_sync){var hf=iD.dyn?this.dtree:this.stree;if(iD==hf.root){hf.root=null}else{var g0=iD.parent;var eZ=g0.parent;var he=g0.child1==iD?g0.child2:g0.child1;if(eZ!=null){if(eZ.child1==g0){eZ.child1=he}else{eZ.child2=he}he.parent=eZ;g0.height=-1;var ho=g0.aabb;if(ho.outer!=null){ho.outer.zpp_inner=null;ho.outer=null}ho.wrap_min=ho.wrap_max=null;ho._invalidate=null;ho._validate=null;ho.next=bT.zpp_pool;bT.zpp_pool=ho;g0.child1=g0.child2=g0.parent=null;g0.next=null;g0.snext=null;g0.mnext=null;g0.next=dz.zpp_pool;dz.zpp_pool=g0;var h7=eZ;while(h7!=null){if(h7.child1==null||h7.height<2){h7=h7}else{var hG=h7.child1;var hE=h7.child2;var eE=hE.height-hG.height;if(eE>1){var hD=hE.child1;var hC=hE.child2;hE.child1=h7;hE.parent=h7.parent;h7.parent=hE;if(hE.parent!=null){if(hE.parent.child1==h7){hE.parent.child1=hE}else{hE.parent.child2=hE}}else{hf.root=hE}if(hD.height>hC.height){hE.child2=hD;h7.child2=hC;hC.parent=h7;var g7=h7.aabb;var hI=hG.aabb;var iB=hC.aabb;g7.minx=hI.minxiB.maxx?hI.maxx:iB.maxx;g7.maxy=hI.maxy>iB.maxy?hI.maxy:iB.maxy;var fU=hE.aabb;var ep=h7.aabb;var iA=hD.aabb;fU.minx=ep.minxiA.maxx?ep.maxx:iA.maxx;fU.maxy=ep.maxy>iA.maxy?ep.maxy:iA.maxy;var hh=hG.height;var hg=hC.height;h7.height=1+(hh>hg?hh:hg);var eS=h7.height;var eD=hD.height;hE.height=1+(eS>eD?eS:eD)}else{hE.child2=hC;h7.child2=hD;hD.parent=h7;var fS=h7.aabb;var eo=hG.aabb;var iz=hD.aabb;fS.minx=eo.minxiz.maxx?eo.maxx:iz.maxx;fS.maxy=eo.maxy>iz.maxy?eo.maxy:iz.maxy;var fQ=hE.aabb;var en=h7.aabb;var iy=hC.aabb;fQ.minx=en.minxiy.maxx?en.maxx:iy.maxx;fQ.maxy=en.maxy>iy.maxy?en.maxy:iy.maxy;var eR=hG.height;var eC=hD.height;h7.height=1+(eR>eC?eR:eC);var eQ=h7.height;var eB=hC.height;hE.height=1+(eQ>eB?eQ:eB)}h7=hE}else{if(eE<-1){var ha=hG.child1;var gD=hG.child2;hG.child1=h7;hG.parent=h7.parent;h7.parent=hG;if(hG.parent!=null){if(hG.parent.child1==h7){hG.parent.child1=hG}else{hG.parent.child2=hG}}else{hf.root=hG}if(ha.height>gD.height){hG.child2=ha;h7.child1=gD;gD.parent=h7;var fN=h7.aabb;var el=hE.aabb;var iw=gD.aabb;fN.minx=el.minxiw.maxx?el.maxx:iw.maxx;fN.maxy=el.maxy>iw.maxy?el.maxy:iw.maxy;var fL=hG.aabb;var ej=h7.aabb;var iu=ha.aabb;fL.minx=ej.minxiu.maxx?ej.maxx:iu.maxx;fL.maxy=ej.maxy>iu.maxy?ej.maxy:iu.maxy;var eP=hE.height;var ez=gD.height;h7.height=1+(eP>ez?eP:ez);var eO=h7.height;var ex=ha.height;hG.height=1+(eO>ex?eO:ex)}else{hG.child2=gD;h7.child1=ha;ha.parent=h7;var fJ=h7.aabb;var eh=hE.aabb;var iq=ha.aabb;fJ.minx=eh.minxiq.maxx?eh.maxx:iq.maxx;fJ.maxy=eh.maxy>iq.maxy?eh.maxy:iq.maxy;var fH=hG.aabb;var ee=h7.aabb;var im=gD.aabb;fH.minx=ee.minxim.maxx?ee.maxx:im.maxx;fH.maxy=ee.maxy>im.maxy?ee.maxy:im.maxy;var eN=hE.height;var ev=ha.height;h7.height=1+(eN>ev?eN:ev);var eL=h7.height;var eu=gD.height;hG.height=1+(eL>eu?eL:eu)}h7=hG}else{h7=h7}}}var hy=h7.child1;var hu=h7.child2;var fF=h7.aabb;var eb=hy.aabb;var il=hu.aabb;fF.minx=eb.minxil.maxx?eb.maxx:il.maxx;fF.maxy=eb.maxy>il.maxy?eb.maxy:il.maxy;var eK=hy.height;var et=hu.height;h7.height=1+(eK>et?eK:et);h7=h7.parent}}else{hf.root=he;he.parent=null;g0.height=-1;var ii=g0.aabb;if(ii.outer!=null){ii.outer.zpp_inner=null;ii.outer=null}ii.wrap_min=ii.wrap_max=null;ii._invalidate=null;ii._validate=null;ii.next=bT.zpp_pool;bT.zpp_pool=ii;g0.child1=g0.child2=g0.parent=null;g0.next=null;g0.snext=null;g0.mnext=null;g0.next=dz.zpp_pool;dz.zpp_pool=g0}}}else{iD.first_sync=false}var fV=iD.aabb;if(!eT.continuous){if(fO.zip_aabb){if(fO.body!=null){fO.zip_aabb=false;if(fO.type==0){var fD=fO.circle;if(fD.zip_worldCOM){if(fD.body!=null){fD.zip_worldCOM=false;if(fD.zip_localCOM){fD.zip_localCOM=false;if(fD.type==1){var gU=fD.polygon;if(gU.lverts.next.next==null){gU.localCOMx=gU.lverts.next.x;gU.localCOMy=gU.lverts.next.y}else{if(gU.lverts.next.next.next==null){gU.localCOMx=gU.lverts.next.x;gU.localCOMy=gU.lverts.next.y;gU.localCOMx+=gU.lverts.next.next.x;gU.localCOMy+=gU.lverts.next.next.y;gU.localCOMx*=0.5;gU.localCOMy*=0.5}else{gU.localCOMx=0;gU.localCOMy=0;var gK=0;var eJ=gU.lverts.next;var hk=eJ;eJ=eJ.next;var hj=eJ;eJ=eJ.next;while(eJ!=null){var hi=eJ;gK+=hj.x*(hi.y-hk.y);var hv=hi.y*hj.x-hi.x*hj.y;gU.localCOMx+=(hj.x+hi.x)*hv;gU.localCOMy+=(hj.y+hi.y)*hv;hk=hj;hj=hi;eJ=eJ.next}eJ=gU.lverts.next;var e2=eJ;gK+=hj.x*(e2.y-hk.y);var eX=e2.y*hj.x-e2.x*hj.y;gU.localCOMx+=(hj.x+e2.x)*eX;gU.localCOMy+=(hj.y+e2.y)*eX;hk=hj;eJ=eJ.next;var e0=eJ;gK+=e2.x*(e0.y-hk.y);var eW=e0.y*e2.x-e0.x*e2.y;gU.localCOMx+=(e2.x+e0.x)*eW;gU.localCOMy+=(e2.y+e0.y)*eW;gK=1/(3*gK);var hl=gK;gU.localCOMx*=hl;gU.localCOMy*=hl}}}if(fD.wrap_localCOM!=null){fD.wrap_localCOM.zpp_inner.x=fD.localCOMx;fD.wrap_localCOM.zpp_inner.y=fD.localCOMy}}var gS=fD.body;if(gS.zip_axis){gS.zip_axis=false;gS.axisx=Math.sin(gS.rot);gS.axisy=Math.cos(gS.rot)}fD.worldCOMx=fD.body.posx+(fD.body.axisy*fD.localCOMx-fD.body.axisx*fD.localCOMy);fD.worldCOMy=fD.body.posy+(fD.localCOMx*fD.body.axisx+fD.localCOMy*fD.body.axisy)}}var f0=fD.radius;var fY=fD.radius;fD.aabb.minx=fD.worldCOMx-f0;fD.aabb.miny=fD.worldCOMy-fY;fD.aabb.maxx=fD.worldCOMx+f0;fD.aabb.maxy=fD.worldCOMy+fY}else{var gQ=fO.polygon;if(gQ.zip_gverts){if(gQ.body!=null){gQ.zip_gverts=false;gQ.validate_lverts();var gO=gQ.body;if(gO.zip_axis){gO.zip_axis=false;gO.axisx=Math.sin(gO.rot);gO.axisy=Math.cos(gO.rot)}var iF=gQ.lverts.next;var fj=gQ.gverts.next;while(fj!=null){var gC=fj;var hs=iF;iF=iF.next;gC.x=gQ.body.posx+(gQ.body.axisy*hs.x-gQ.body.axisx*hs.y);gC.y=gQ.body.posy+(hs.x*gQ.body.axisx+hs.y*gQ.body.axisy);fj=fj.next}}}var h4=gQ.gverts.next;gQ.aabb.minx=h4.x;gQ.aabb.miny=h4.y;gQ.aabb.maxx=h4.x;gQ.aabb.maxy=h4.y;var fh=gQ.gverts.next.next;while(fh!=null){var hn=fh;if(hn.xgQ.aabb.maxx){gQ.aabb.maxx=hn.x}if(hn.ygQ.aabb.maxy){gQ.aabb.maxy=hn.y}fh=fh.next}}}}}var iL=fO.aabb;fV.minx=iL.minx-3;fV.miny=iL.miny-3;fV.maxx=iL.maxx+3;fV.maxy=iL.maxy+3;var e6=(iD.dyn=fO.body.type==1?false:!fO.body.component.sleeping)?this.dtree:this.stree;if(e6.root==null){e6.root=iD;e6.root.parent=null}else{var ik=iD.aabb;var h6=e6.root;while(h6.child1!=null){var fz=h6.child1;var e5=h6.child2;var gM=h6.aabb;var iC=(gM.maxx-gM.minx+(gM.maxy-gM.miny))*2;var gJ=d.tmpaabb;var gx=h6.aabb;gJ.minx=gx.minxik.maxx?gx.maxx:ik.maxx;gJ.maxy=gx.maxy>ik.maxy?gx.maxy:ik.maxy;var gI=d.tmpaabb;var hd=(gI.maxx-gI.minx+(gI.maxy-gI.miny))*2;var fx=2*hd;var hw=2*(hd-iC);var gH=d.tmpaabb;var em=fz.aabb;gH.minx=ik.minxem.maxx?ik.maxx:em.maxx;gH.maxy=ik.maxy>em.maxy?ik.maxy:em.maxy;var ey;if(fz.child1==null){var gG=d.tmpaabb;ey=(gG.maxx-gG.minx+(gG.maxy-gG.miny))*2+hw}else{var gF=fz.aabb;var e3=(gF.maxx-gF.minx+(gF.maxy-gF.miny))*2;var gk=d.tmpaabb;ey=(gk.maxx-gk.minx+(gk.maxy-gk.miny))*2-e3+hw}var gh=d.tmpaabb;var ek=e5.aabb;gh.minx=ik.minxek.maxx?ik.maxx:ek.maxx;gh.maxy=ik.maxy>ek.maxy?ik.maxy:ek.maxy;var ew;if(e5.child1==null){var ge=d.tmpaabb;ew=(ge.maxx-ge.minx+(ge.maxy-ge.miny))*2+hw}else{var gc=e5.aabb;var gN=(gc.maxx-gc.minx+(gc.maxy-gc.miny))*2;var ga=d.tmpaabb;ew=(ga.maxx-ga.minx+(ga.maxy-ga.miny))*2-gN+hw}if(fxei.maxx?ik.maxx:ei.maxx;f8.maxy=ik.maxy>ei.maxy?ik.maxy:ei.maxy;eM.height=e8.height+1;if(eA!=null){if(eA.child1==e8){eA.child1=eM}else{eA.child2=eM}eM.child1=e8;eM.child2=iD;e8.parent=eM;iD.parent=eM}else{eM.child1=e8;eM.child2=iD;e8.parent=eM;iD.parent=eM;e6.root=eM}h6=iD.parent;while(h6!=null){if(h6.child1==null||h6.height<2){h6=h6}else{var ef=h6.child1;var ib=h6.child2;var ic=ib.height-ef.height;if(ic>1){var g9=ib.child1;var gB=ib.child2;ib.child1=h6;ib.parent=h6.parent;h6.parent=ib;if(ib.parent!=null){if(ib.parent.child1==h6){ib.parent.child1=ib}else{ib.parent.child2=ib}}else{e6.root=ib}if(g9.height>gB.height){ib.child2=g9;h6.child2=gB;gB.parent=h6;var f7=h6.aabb;var gw=ef.aabb;var ec=gB.aabb;f7.minx=gw.minxec.maxx?gw.maxx:ec.maxx;f7.maxy=gw.maxy>ec.maxy?gw.maxy:ec.maxy;var f6=ib.aabb;var gv=h6.aabb;var iM=g9.aabb;f6.minx=gv.minxiM.maxx?gv.maxx:iM.maxx;f6.maxy=gv.maxy>iM.maxy?gv.maxy:iM.maxy;var eI=ef.height;var es=gB.height;h6.height=1+(eI>es?eI:es);var h5=h6.height;var fm=g9.height;ib.height=1+(h5>fm?h5:fm)}else{ib.child2=gB;h6.child2=g9;g9.parent=h6;var f5=h6.aabb;var gu=ef.aabb;var iJ=g9.aabb;f5.minx=gu.minxiJ.maxx?gu.maxx:iJ.maxx;f5.maxy=gu.maxy>iJ.maxy?gu.maxy:iJ.maxy;var f4=ib.aabb;var gt=h6.aabb;var iI=gB.aabb;f4.minx=gt.minxiI.maxx?gt.maxx:iI.maxx;f4.maxy=gt.maxy>iI.maxy?gt.maxy:iI.maxy;var h3=ef.height;var fl=g9.height;h6.height=1+(h3>fl?h3:fl);var h2=h6.height;var fk=gB.height;ib.height=1+(h2>fk?h2:fk)}h6=ib}else{if(ic<-1){var g8=ef.child1;var gz=ef.child2;ef.child1=h6;ef.parent=h6.parent;h6.parent=ef;if(ef.parent!=null){if(ef.parent.child1==h6){ef.parent.child1=ef}else{ef.parent.child2=ef}}else{e6.root=ef}if(g8.height>gz.height){ef.child2=g8;h6.child1=gz;gz.parent=h6;var fT=h6.aabb;var gs=ib.aabb;var iH=gz.aabb;fT.minx=gs.minxiH.maxx?gs.maxx:iH.maxx;fT.maxy=gs.maxy>iH.maxy?gs.maxy:iH.maxy;var fR=ef.aabb;var gr=h6.aabb;var iG=g8.aabb;fR.minx=gr.minxiG.maxx?gr.maxx:iG.maxx;fR.maxy=gr.maxy>iG.maxy?gr.maxy:iG.maxy;var h0=ib.height;var fi=gz.height;h6.height=1+(h0>fi?h0:fi);var hY=h6.height;var fg=g8.height;ef.height=1+(hY>fg?hY:fg)}else{ef.child2=gz;h6.child1=g8;g8.parent=h6;var fP=h6.aabb;var gq=ib.aabb;var ix=g8.aabb;fP.minx=gq.minxix.maxx?gq.maxx:ix.maxx;fP.maxy=gq.maxy>ix.maxy?gq.maxy:ix.maxy;var fM=ef.aabb;var gp=h6.aabb;var iv=gz.aabb;fM.minx=gp.minxiv.maxx?gp.maxx:iv.maxx;fM.maxy=gp.maxy>iv.maxy?gp.maxy:iv.maxy;var hW=ib.height;var ff=g8.height;h6.height=1+(hW>ff?hW:ff);var hU=h6.height;var fd=gz.height;ef.height=1+(hU>fd?hU:fd)}h6=ef}else{h6=h6}}}var fy=h6.child1;var e4=h6.child2;var hT=fy.height;var fb=e4.height;h6.height=1+(hT>fb?hT:fb);var fK=h6.aabb;var go=fy.aabb;var it=e4.aabb;fK.minx=go.minxit.maxx?go.maxx:it.maxx;fK.maxy=go.maxy>it.maxy?go.maxy:it.maxy;h6=h6.parent}}iD.synced=false;iD=iD.snext}while(this.syncs!=null){var gg=this.syncs;this.syncs=gg.snext;gg.snext=null;if(gg.moved){continue}gg.moved=false;var eY=gg.shape;if(eY.body.component.sleeping){continue}var ij=gg.aabb;var er=null;if(this.dtree.root!=null){this.dtree.root.next=er;er=this.dtree.root}while(er!=null){var hQ=er;er=hQ.next;hQ.next=null;if(hQ==gg){continue}if(hQ.child1==null){var eg=hQ.shape;if(eg.body!=eY.body&&!(eg.body.type==1&&eY.body.type==1)){var hS=hQ.aabb;if(hS.miny<=ij.maxy&&ij.miny<=hS.maxy&&hS.minx<=ij.maxx&&ij.minx<=hS.maxx){var e1;var hc;if(eY.id=eg.minx&&en.x<=eg.maxx&&en.y>=eg.miny&&en.y<=eg.maxy){if(ec.child1==null){var ee;if(ea!=null){var ej=ec.shape.filter;if((ej.collisionMask&ea.collisionGroup)!=0){ee=(ea.collisionMask&ej.collisionGroup)!=0}else{ee=false}}else{ee=true}if(ee){if(ec.shape.type==0){if(b7.circleContains(ec.shape.circle,en)){el.push(ec.shape.outer)}}else{if(b7.polyContains(ec.shape.polygon,en)){el.push(ec.shape.outer)}}}}else{if(ec.child1!=null){this.treeStack.add(ec.child1)}if(ec.child2!=null){this.treeStack.add(ec.child2)}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var eo=this.treeStack.pop_unsafe();var eh=eo.aabb;if(en.x>=eh.minx&&en.x<=eh.maxx&&en.y>=eh.miny&&en.y<=eh.maxy){if(eo.child1==null){var ed;if(ea!=null){var ef=eo.shape.filter;if((ef.collisionMask&ea.collisionGroup)!=0){ed=(ea.collisionMask&ef.collisionGroup)!=0}else{ed=false}}else{ed=true}if(ed){if(eo.shape.type==0){if(b7.circleContains(eo.shape.circle,en)){el.push(eo.shape.outer)}}else{if(b7.polyContains(eo.shape.polygon,en)){el.push(eo.shape.outer)}}}}else{if(eo.child1!=null){this.treeStack.add(eo.child1)}if(eo.child2!=null){this.treeStack.add(eo.child2)}}}}}if(en.outer!=null){en.outer.zpp_inner=null;en.outer=null}en._isimmutable=null;en._validate=null;en._invalidate=null;en.next=bB.zpp_pool;bB.zpp_pool=en;return el};cT.prototype.bodiesUnderPoint=function(eo,em,eb,ec){this.sync_broadphase();var ek;if(bB.zpp_pool==null){ek=new bB()}else{ek=bB.zpp_pool;bB.zpp_pool=ek.next;ek.next=null}ek.weak=false;ek._immutable=false;ek.x=eo;ek.y=em;var ep=ek;var en=ec==null?new a5():ec;if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var ed=this.treeStack.pop_unsafe();var ei=ed.aabb;if(ep.x>=ei.minx&&ep.x<=ei.maxx&&ep.y>=ei.miny&&ep.y<=ei.maxy){if(ed.child1==null){var eg=ed.shape.body.outer;if(!en.has(eg)){var ef;if(eb!=null){var el=ed.shape.filter;if((el.collisionMask&eb.collisionGroup)!=0){ef=(eb.collisionMask&el.collisionGroup)!=0}else{ef=false}}else{ef=true}if(ef){if(ed.shape.type==0){if(b7.circleContains(ed.shape.circle,ep)){en.push(eg)}}else{if(b7.polyContains(ed.shape.polygon,ep)){en.push(eg)}}}}}else{if(ed.child1!=null){this.treeStack.add(ed.child1)}if(ed.child2!=null){this.treeStack.add(ed.child2)}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var eq=this.treeStack.pop_unsafe();var ej=eq.aabb;if(ep.x>=ej.minx&&ep.x<=ej.maxx&&ep.y>=ej.miny&&ep.y<=ej.maxy){if(eq.child1==null){var ea=eq.shape.body.outer;if(!en.has(ea)){var ee;if(eb!=null){var eh=eq.shape.filter;if((eh.collisionMask&eb.collisionGroup)!=0){ee=(eb.collisionMask&eh.collisionGroup)!=0}else{ee=false}}else{ee=true}if(ee){if(eq.shape.type==0){if(b7.circleContains(eq.shape.circle,ep)){en.push(ea)}}else{if(b7.polyContains(eq.shape.polygon,ep)){en.push(ea)}}}}}else{if(eq.child1!=null){this.treeStack.add(eq.child1)}if(eq.child2!=null){this.treeStack.add(eq.child2)}}}}}if(ep.outer!=null){ep.outer.zpp_inner=null;ep.outer=null}ep._isimmutable=null;ep._validate=null;ep._invalidate=null;ep.next=bB.zpp_pool;bB.zpp_pool=ep;return en};cT.prototype.treeStack2=null;cT.prototype.shapesInAABB=function(ed,eG,eC,eg,ee){this.sync_broadphase();this.updateAABBShape(ed);var eE=this.aabbShape.zpp_inner.aabb;var eF=ee==null?new cZ():ee;if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var eo=this.treeStack.pop_unsafe();var ef=eo.aabb;if(ef.minx>=eE.minx&&ef.miny>=eE.miny&&ef.maxx<=eE.maxx&&ef.maxy<=eE.maxy){if(eo.child1==null){var eD;if(eg!=null){var es=eo.shape.filter;if((es.collisionMask&eg.collisionGroup)!=0){eD=(eg.collisionMask&es.collisionGroup)!=0}else{eD=false}}else{eD=true}if(eD){eF.push(eo.shape.outer)}}else{if(this.treeStack2==null){this.treeStack2=new ai()}this.treeStack2.add(eo);while(this.treeStack2.head!=null){var ec=this.treeStack2.pop_unsafe();if(ec.child1==null){var en;if(eg!=null){var eB=ec.shape.filter;if((eB.collisionMask&eg.collisionGroup)!=0){en=(eg.collisionMask&eB.collisionGroup)!=0}else{en=false}}else{en=true}if(en){eF.push(ec.shape.outer)}}else{if(ec.child1!=null){this.treeStack2.add(ec.child1)}if(ec.child2!=null){this.treeStack2.add(ec.child2)}}}}}else{var eA=eo.aabb;if(eE.miny<=eA.maxy&&eA.miny<=eE.maxy&&eE.minx<=eA.maxx&&eA.minx<=eE.maxx){if(eo.child1==null){var em;if(eg!=null){var ey=eo.shape.filter;if((ey.collisionMask&eg.collisionGroup)!=0){em=(eg.collisionMask&ey.collisionGroup)!=0}else{em=false}}else{em=true}if(em){if(eG){if(eC){if(b7.containTest(this.aabbShape.zpp_inner,eo.shape)){eF.push(eo.shape.outer)}}else{var ez=eo.shape.aabb;if(ez.minx>=eE.minx&&ez.miny>=eE.miny&&ez.maxx<=eE.maxx&&ez.maxy<=eE.maxy){eF.push(eo.shape.outer)}else{if(b7.testCollide_safe(eo.shape,this.aabbShape.zpp_inner)){eF.push(eo.shape.outer)}}}}else{var el;if(!(!eC)){var ex=eo.shape.aabb;if(ex.minx>=eE.minx&&ex.miny>=eE.miny&&ex.maxx<=eE.maxx){el=ex.maxy<=eE.maxy}else{el=false}}else{el=true}if(el){eF.push(eo.shape.outer)}}}}else{if(eo.child1!=null){this.treeStack.add(eo.child1)}if(eo.child2!=null){this.treeStack.add(eo.child2)}}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var eb=this.treeStack.pop_unsafe();var ew=eb.aabb;if(ew.minx>=eE.minx&&ew.miny>=eE.miny&&ew.maxx<=eE.maxx&&ew.maxy<=eE.maxy){if(eb.child1==null){var ek;if(eg!=null){var ev=eb.shape.filter;if((ev.collisionMask&eg.collisionGroup)!=0){ek=(eg.collisionMask&ev.collisionGroup)!=0}else{ek=false}}else{ek=true}if(ek){eF.push(eb.shape.outer)}}else{if(this.treeStack2==null){this.treeStack2=new ai()}this.treeStack2.add(eb);while(this.treeStack2.head!=null){var ea=this.treeStack2.pop_unsafe();if(ea.child1==null){var ej;if(eg!=null){var eu=ea.shape.filter;if((eu.collisionMask&eg.collisionGroup)!=0){ej=(eg.collisionMask&eu.collisionGroup)!=0}else{ej=false}}else{ej=true}if(ej){eF.push(ea.shape.outer)}}else{if(ea.child1!=null){this.treeStack2.add(ea.child1)}if(ea.child2!=null){this.treeStack2.add(ea.child2)}}}}}else{var er=eb.aabb;if(eE.miny<=er.maxy&&er.miny<=eE.maxy&&eE.minx<=er.maxx&&er.minx<=eE.maxx){if(eb.child1==null){var ei;if(eg!=null){var ep=eb.shape.filter;if((ep.collisionMask&eg.collisionGroup)!=0){ei=(eg.collisionMask&ep.collisionGroup)!=0}else{ei=false}}else{ei=true}if(ei){if(eG){if(eC){if(b7.containTest(this.aabbShape.zpp_inner,eb.shape)){eF.push(eb.shape.outer)}}else{var et=eb.shape.aabb;if(et.minx>=eE.minx&&et.miny>=eE.miny&&et.maxx<=eE.maxx&&et.maxy<=eE.maxy){eF.push(eb.shape.outer)}else{if(b7.testCollide_safe(eb.shape,this.aabbShape.zpp_inner)){eF.push(eb.shape.outer)}}}}else{var eh;if(!(!eC)){var eq=eb.shape.aabb;if(eq.minx>=eE.minx&&eq.miny>=eE.miny&&eq.maxx<=eE.maxx){eh=eq.maxy<=eE.maxy}else{eh=false}}else{eh=true}if(eh){eF.push(eb.shape.outer)}}}}else{if(eb.child1!=null){this.treeStack.add(eb.child1)}if(eb.child2!=null){this.treeStack.add(eb.child2)}}}}}}return eF};cT.prototype.failed=null;cT.prototype.bodiesInAABB=function(ew,eB,eu,ez,ev){this.sync_broadphase();this.updateAABBShape(ew);var en=this.aabbShape.zpp_inner.aabb;var ey=ev==null?new a5():ev;if(this.failed==null){this.failed=new a5()}if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var ex=this.treeStack.pop_unsafe();var eE=ex.aabb;if(eE.minx>=en.minx&&eE.miny>=en.miny&&eE.maxx<=en.maxx&&eE.maxy<=en.maxy){if(ex.child1==null){var eJ;if(ez!=null){var ed=ex.shape.filter;if((ed.collisionMask&ez.collisionGroup)!=0){eJ=(ez.collisionMask&ed.collisionGroup)!=0}else{eJ=false}}else{eJ=true}if(eJ){var et=ex.shape.body.outer;if(!ey.has(et)){ey.push(et)}}}else{if(this.treeStack2==null){this.treeStack2=new ai()}this.treeStack2.add(ex);while(this.treeStack2.head!=null){var es=this.treeStack2.pop_unsafe();if(es.child1==null){var eQ;if(ez!=null){var eI=es.shape.filter;if((eI.collisionMask&ez.collisionGroup)!=0){eQ=(ez.collisionMask&eI.collisionGroup)!=0}else{eQ=false}}else{eQ=true}if(eQ){var ei=es.shape.body.outer;if(!ey.has(ei)){ey.push(ei)}}}else{if(es.child1!=null){this.treeStack2.add(es.child1)}if(es.child2!=null){this.treeStack2.add(es.child2)}}}}}else{var eH=ex.aabb;if(en.miny<=eH.maxy&&eH.miny<=en.maxy&&en.minx<=eH.maxx&&eH.minx<=en.maxx){if(ex.child1==null){var eh=ex.shape.body.outer;var eP;if(ez!=null){var eG=ex.shape.filter;if((eG.collisionMask&ez.collisionGroup)!=0){eP=(ez.collisionMask&eG.collisionGroup)!=0}else{eP=false}}else{eP=true}if(eP){if(eB){if(eu){if(!this.failed.has(eh)){var ej=b7.containTest(this.aabbShape.zpp_inner,ex.shape);if(!ey.has(eh)&&ej){ey.push(eh)}else{if(!ej){ey.remove(eh);this.failed.push(eh)}}}}else{if(!ey.has(eh)&&b7.testCollide_safe(ex.shape,this.aabbShape.zpp_inner)){ey.push(eh)}}}else{if(eu){if(!this.failed.has(eh)){var ep=ex.shape.aabb;var ec=ep.minx>=en.minx&&ep.miny>=en.miny&&ep.maxx<=en.maxx&&ep.maxy<=en.maxy;if(!ey.has(eh)&&ec){ey.push(eh)}else{if(!ec){ey.remove(eh);this.failed.push(eh)}}}}else{var eO;if(!ey.has(eh)){var eo=ex.shape.aabb;if(eo.minx>=en.minx&&eo.miny>=en.miny&&eo.maxx<=en.maxx){eO=eo.maxy<=en.maxy}else{eO=false}}else{eO=false}if(eO){ey.push(eh)}}}}}else{if(ex.child1!=null){this.treeStack.add(ex.child1)}if(ex.child2!=null){this.treeStack.add(ex.child2)}}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var er=this.treeStack.pop_unsafe();var em=er.aabb;if(em.minx>=en.minx&&em.miny>=en.miny&&em.maxx<=en.maxx&&em.maxy<=en.maxy){if(er.child1==null){var eN;if(ez!=null){var eF=er.shape.filter;if((eF.collisionMask&ez.collisionGroup)!=0){eN=(ez.collisionMask&eF.collisionGroup)!=0}else{eN=false}}else{eN=true}if(eN){var eg=er.shape.body.outer;if(!ey.has(eg)){ey.push(eg)}}}else{if(this.treeStack2==null){this.treeStack2=new ai()}this.treeStack2.add(er);while(this.treeStack2.head!=null){var eq=this.treeStack2.pop_unsafe();if(eq.child1==null){var eM;if(ez!=null){var eD=eq.shape.filter;if((eD.collisionMask&ez.collisionGroup)!=0){eM=(ez.collisionMask&eD.collisionGroup)!=0}else{eM=false}}else{eM=true}if(eM){var ef=eq.shape.body.outer;if(!ey.has(ef)){ey.push(ef)}}}else{if(eq.child1!=null){this.treeStack2.add(eq.child1)}if(eq.child2!=null){this.treeStack2.add(eq.child2)}}}}}else{var eC=er.aabb;if(en.miny<=eC.maxy&&eC.miny<=en.maxy&&en.minx<=eC.maxx&&eC.minx<=en.maxx){if(er.child1==null){var ee=er.shape.body.outer;var eL;if(ez!=null){var eA=er.shape.filter;if((eA.collisionMask&ez.collisionGroup)!=0){eL=(ez.collisionMask&eA.collisionGroup)!=0}else{eL=false}}else{eL=true}if(eL){if(eB){if(eu){if(!this.failed.has(ee)){var eb=b7.containTest(this.aabbShape.zpp_inner,er.shape);if(!ey.has(ee)&&eb){ey.push(ee)}else{if(!eb){ey.remove(ee);this.failed.push(ee)}}}}else{if(!ey.has(ee)&&b7.testCollide_safe(er.shape,this.aabbShape.zpp_inner)){ey.push(ee)}}}else{if(eu){if(!this.failed.has(ee)){var el=er.shape.aabb;var ea=el.minx>=en.minx&&el.miny>=en.miny&&el.maxx<=en.maxx&&el.maxy<=en.maxy;if(!ey.has(ee)&&ea){ey.push(ee)}else{if(!ea){ey.remove(ee);this.failed.push(ee)}}}}else{var eK;if(!ey.has(ee)){var ek=er.shape.aabb;if(ek.minx>=en.minx&&ek.miny>=en.miny&&ek.maxx<=en.maxx){eK=ek.maxy<=en.maxy}else{eK=false}}else{eK=false}if(eK){ey.push(ee)}}}}}else{if(er.child1!=null){this.treeStack.add(er.child1)}if(er.child2!=null){this.treeStack.add(er.child2)}}}}}}this.failed.clear();return ey};cT.prototype.shapesInCircle=function(en,em,eb,ea,ec,ed){this.sync_broadphase();this.updateCircShape(en,em,eb);var ep=this.circShape.zpp_inner.aabb;var ek=ed==null?new cZ():ed;if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var ee=this.treeStack.pop_unsafe();var ei=ee.aabb;if(ep.miny<=ei.maxy&&ei.miny<=ep.maxy&&ep.minx<=ei.maxx&&ei.minx<=ep.maxx){if(ee.child1==null){var eg;if(ec!=null){var el=ee.shape.filter;if((el.collisionMask&ec.collisionGroup)!=0){eg=(ec.collisionMask&el.collisionGroup)!=0}else{eg=false}}else{eg=true}if(eg){if(ea){if(b7.containTest(this.circShape.zpp_inner,ee.shape)){ek.push(ee.shape.outer)}}else{if(b7.testCollide_safe(ee.shape,this.circShape.zpp_inner)){ek.push(ee.shape.outer)}}}}else{if(ee.child1!=null){this.treeStack.add(ee.child1)}if(ee.child2!=null){this.treeStack.add(ee.child2)}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var eo=this.treeStack.pop_unsafe();var ej=eo.aabb;if(ep.miny<=ej.maxy&&ej.miny<=ep.maxy&&ep.minx<=ej.maxx&&ej.minx<=ep.maxx){if(eo.child1==null){var ef;if(ec!=null){var eh=eo.shape.filter;if((eh.collisionMask&ec.collisionGroup)!=0){ef=(ec.collisionMask&eh.collisionGroup)!=0}else{ef=false}}else{ef=true}if(ef){if(ea){if(b7.containTest(this.circShape.zpp_inner,eo.shape)){ek.push(eo.shape.outer)}}else{if(b7.testCollide_safe(eo.shape,this.circShape.zpp_inner)){ek.push(eo.shape.outer)}}}}else{if(eo.child1!=null){this.treeStack.add(eo.child1)}if(eo.child2!=null){this.treeStack.add(eo.child2)}}}}}return ek};cT.prototype.bodiesInCircle=function(ee,ed,ei,eq,eg,ec){this.sync_broadphase();this.updateCircShape(ee,ed,ei);var es=this.circShape.zpp_inner.aabb;var et=ec==null?new a5():ec;if(this.failed==null){this.failed=new a5()}if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var ek=this.treeStack.pop_unsafe();var el=ek.aabb;if(es.miny<=el.maxy&&el.miny<=es.maxy&&es.minx<=el.maxx&&el.minx<=es.maxx){if(ek.child1==null){var ef=ek.shape.body.outer;var er;if(eg!=null){var eo=ek.shape.filter;if((eo.collisionMask&eg.collisionGroup)!=0){er=(eg.collisionMask&eo.collisionGroup)!=0}else{er=false}}else{er=true}if(er){if(eq){if(!this.failed.has(ef)){var eb=b7.containTest(this.circShape.zpp_inner,ek.shape);if(!et.has(ef)&&eb){et.push(ef)}else{if(!eb){et.remove(ef);this.failed.push(ef)}}}}else{if(!et.has(ef)&&b7.testCollide_safe(ek.shape,this.circShape.zpp_inner)){et.push(ef)}}}}else{if(ek.child1!=null){this.treeStack.add(ek.child1)}if(ek.child2!=null){this.treeStack.add(ek.child2)}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var ea=this.treeStack.pop_unsafe();var en=ea.aabb;if(es.miny<=en.maxy&&en.miny<=es.maxy&&es.minx<=en.maxx&&en.minx<=es.maxx){if(ea.child1==null){var eh=ea.shape.body.outer;var ej;if(eg!=null){var em=ea.shape.filter;if((em.collisionMask&eg.collisionGroup)!=0){ej=(eg.collisionMask&em.collisionGroup)!=0}else{ej=false}}else{ej=true}if(ej){if(eq){if(!this.failed.has(eh)){var ep=b7.containTest(this.circShape.zpp_inner,ea.shape);if(!et.has(eh)&&ep){et.push(eh)}else{if(!ep){et.remove(eh);this.failed.push(eh)}}}}else{if(!et.has(eh)&&b7.testCollide_safe(ea.shape,this.circShape.zpp_inner)){et.push(eh)}}}}else{if(ea.child1!=null){this.treeStack.add(ea.child1)}if(ea.child2!=null){this.treeStack.add(ea.child2)}}}}}this.failed.clear();return et};cT.prototype.shapesInShape=function(em,ea,eb,ec){this.sync_broadphase();this.validateShape(em);var en=em.aabb;var ej=ec==null?new cZ():ec;if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var ed=this.treeStack.pop_unsafe();var eh=ed.aabb;if(en.miny<=eh.maxy&&eh.miny<=en.maxy&&en.minx<=eh.maxx&&eh.minx<=en.maxx){if(ed.child1==null){var ef;if(eb!=null){var ek=ed.shape.filter;if((ek.collisionMask&eb.collisionGroup)!=0){ef=(eb.collisionMask&ek.collisionGroup)!=0}else{ef=false}}else{ef=true}if(ef){if(ea){if(b7.containTest(em,ed.shape)){ej.push(ed.shape.outer)}}else{if(b7.testCollide_safe(ed.shape,em)){ej.push(ed.shape.outer)}}}}else{if(ed.child1!=null){this.treeStack.add(ed.child1)}if(ed.child2!=null){this.treeStack.add(ed.child2)}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var el=this.treeStack.pop_unsafe();var ei=el.aabb;if(en.miny<=ei.maxy&&ei.miny<=en.maxy&&en.minx<=ei.maxx&&ei.minx<=en.maxx){if(el.child1==null){var ee;if(eb!=null){var eg=el.shape.filter;if((eg.collisionMask&eb.collisionGroup)!=0){ee=(eb.collisionMask&eg.collisionGroup)!=0}else{ee=false}}else{ee=true}if(ee){if(ea){if(b7.containTest(em,el.shape)){ej.push(el.shape.outer)}}else{if(b7.testCollide_safe(el.shape,em)){ej.push(el.shape.outer)}}}}else{if(el.child1!=null){this.treeStack.add(el.child1)}if(el.child2!=null){this.treeStack.add(el.child2)}}}}}return ej};cT.prototype.bodiesInShape=function(eg,eo,ee,ec){this.sync_broadphase();this.validateShape(eg);var eq=eg.aabb;var er=ec==null?new a5():ec;if(this.failed==null){this.failed=new a5()}if(this.stree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.stree.root);while(this.treeStack.head!=null){var ei=this.treeStack.pop_unsafe();var ej=ei.aabb;if(eq.miny<=ej.maxy&&ej.miny<=eq.maxy&&eq.minx<=ej.maxx&&ej.minx<=eq.maxx){if(ei.child1==null){var ed=ei.shape.body.outer;var ep;if(ee!=null){var em=ei.shape.filter;if((em.collisionMask&ee.collisionGroup)!=0){ep=(ee.collisionMask&em.collisionGroup)!=0}else{ep=false}}else{ep=true}if(ep){if(eo){if(!this.failed.has(ed)){var eb=b7.containTest(eg,ei.shape);if(!er.has(ed)&&eb){er.push(ed)}else{if(!eb){er.remove(ed);this.failed.push(ed)}}}}else{if(!er.has(ed)&&b7.testCollide_safe(ei.shape,eg)){er.push(ed)}}}}else{if(ei.child1!=null){this.treeStack.add(ei.child1)}if(ei.child2!=null){this.treeStack.add(ei.child2)}}}}}if(this.dtree.root!=null){if(this.treeStack==null){this.treeStack=new ai()}this.treeStack.add(this.dtree.root);while(this.treeStack.head!=null){var ea=this.treeStack.pop_unsafe();var el=ea.aabb;if(eq.miny<=el.maxy&&el.miny<=eq.maxy&&eq.minx<=el.maxx&&el.minx<=eq.maxx){if(ea.child1==null){var ef=ea.shape.body.outer;var eh;if(ee!=null){var ek=ea.shape.filter;if((ek.collisionMask&ee.collisionGroup)!=0){eh=(ee.collisionMask&ek.collisionGroup)!=0}else{eh=false}}else{eh=true}if(eh){if(eo){if(!this.failed.has(ef)){var en=b7.containTest(eg,ea.shape);if(!er.has(ef)&&en){er.push(ef)}else{if(!en){er.remove(ef);this.failed.push(ef)}}}}else{if(!er.has(ef)&&b7.testCollide_safe(ea.shape,eg)){er.push(ef)}}}}else{if(ea.child1!=null){this.treeStack.add(ea.child1)}if(ea.child2!=null){this.treeStack.add(ea.child2)}}}}}this.failed.clear();return er};cT.prototype.openlist=null;cT.prototype.rayCast=function(en,eF,em){if(this.openlist==null){this.openlist=new ai()}this.sync_broadphase();en.validate_dir();var eh=en.maxdist;if(this.dtree.root!=null){if(en.aabbtest(this.dtree.root.aabb)){var eo=en.aabbsect(this.dtree.root.aabb);if(eo>=0&&eo=0&&ek=eh){break}if(ex.child1==null){var ec=ex.shape;var eC;if(em!=null){var ez=ec.filter;if((ez.collisionMask&em.collisionGroup)!=0){eC=(em.collisionMask&ez.collisionGroup)!=0}else{eC=false}}else{eC=true}if(eC){var el=ec.type==0?en.circlesect(ec.circle,eF,eh):en.aabbtest(ec.aabb)?en.polysect(ec.polygon,eF,eh):null;if(el!=null){eh=el.zpp_inner.toiDistance;if(ep!=null){ep.zpp_inner.free()}ep=el}}}else{if(ex.child1!=null){if(en.aabbtest(ex.child1.aabb)){var ej=en.aabbsect(ex.child1.aabb);if(ej>=0&&ej=0&&ei=Infinity;var ej=ec==null?new aa():ec;if(this.dtree.root!=null){if(el.aabbtest(this.dtree.root.aabb)){if(eb){this.openlist.add(this.dtree.root)}else{var em=el.aabbsect(this.dtree.root.aabb);if(em>=0&&em=0&&eg=0&&ef=0&&ed0&&ea.next!=null){this.erase(ea)}return ea.next};cW.prototype.clear=function(){};cW.prototype.inlined_clear=function(){};cW.prototype.reverse=function(){var ec=this.next;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.next=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};cW.prototype.empty=function(){return this.next==null};cW.prototype.size=function(){return this.length};cW.prototype.has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};cW.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};cW.prototype.front=function(){return this.next};cW.prototype.back=function(){var ea=this.next;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea};cW.prototype.iterator_at=function(eb){var ea=this.next;while(eb-->0&&ea!=null){ea=ea.next}return ea};cW.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea}else{return null}};cW.prototype.comps=null;cW.prototype.sleep=null;cW.prototype.waket=null;cW.prototype.free=function(){};cW.prototype.alloc=function(){this.waket=0};cW.prototype.__class__=cW;var bx=zpp_nape.space.ZPP_Component=function(){this.woken=false;this.waket=0;this.sleeping=false;this.island=null;this.constraint=null;this.body=null;this.isBody=false;this.rank=0;this.parent=null;this.next=null;this.sleeping=false;this.island=null;this.parent=this;this.rank=0;this.woken=false};bx.__name__=["zpp_nape","space","ZPP_Component"];bx.prototype.next=null;bx.prototype.parent=null;bx.prototype.rank=null;bx.prototype.isBody=null;bx.prototype.body=null;bx.prototype.constraint=null;bx.prototype.island=null;bx.prototype.sleeping=null;bx.prototype.waket=null;bx.prototype.woken=null;bx.prototype.free=function(){this.body=null;this.constraint=null};bx.prototype.alloc=function(){};bx.prototype.reset=function(){this.sleeping=false;this.island=null;this.parent=this;this.rank=0};bx.prototype.__class__=bx;var cg=zpp_nape.space.ZPP_CallbackSet=function(){this.lazydel=false;this.freed=false;this.length=0;this.pushmod=false;this.modified=false;this._inuse=false;this.next=null;this.int2=null;this.int1=null;this.di=0;this.id=0;this.arbiters=new h()};cg.__name__=["zpp_nape","space","ZPP_CallbackSet"];cg.get=function(ec,eb){var ea;if(cg.zpp_pool==null){ea=new cg()}else{ea=cg.zpp_pool;cg.zpp_pool=ea.next;ea.next=null}ea.freed=false;ea.lazydel=false;ea.COLLISIONstate=1;ea.COLLISIONstamp=0;ea.SENSORstate=1;ea.SENSORstamp=0;ea.FLUIDstate=1;ea.FLUIDstamp=0;if(ec.id0&&ea.next!=null){this.erase(ea)}return ea.next};cg.prototype.clear=function(){};cg.prototype.inlined_clear=function(){};cg.prototype.reverse=function(){var ec=this.next;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.next=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};cg.prototype.empty=function(){return this.next==null};cg.prototype.size=function(){return this.length};cg.prototype.has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};cg.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.next;while(eb!=null){if(eb==ec){ea=true;break}eb=eb.next}return ea};cg.prototype.front=function(){return this.next};cg.prototype.back=function(){var ea=this.next;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea};cg.prototype.iterator_at=function(eb){var ea=this.next;while(eb-->0&&ea!=null){ea=ea.next}return ea};cg.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea}else{return null}};cg.prototype.freed=null;cg.prototype.lazydel=null;cg.prototype.free=function(){this.int1=this.int2=null;this.id=this.di=-1;this.freed=true};cg.prototype.alloc=function(){this.freed=false;this.lazydel=false;this.COLLISIONstate=1;this.COLLISIONstamp=0;this.SENSORstate=1;this.SENSORstamp=0;this.FLUIDstate=1;this.FLUIDstamp=0};cg.prototype.add_arb=function(ea){var ec;ec=false;var ed=this.arbiters.head;while(ed!=null){if(ed.elt==ea){ec=true;break}ed=ed.next}if(!ec){var ef=this.arbiters;var ee;if(dL.zpp_pool==null){ee=new dL()}else{ee=dL.zpp_pool;dL.zpp_pool=ee.next;ee.next=null}ee.elt=ea;var eb=ee;eb.next=ef.head;ef.head=eb;ef.modified=true;ef.length++;return true}else{return false}};cg.prototype.try_remove_arb=function(ea){var eh=this.arbiters;var ee=null;var eg=eh.head;var ec=false;while(eg!=null){if(eg.elt==ea){var eb;var ed;if(ee==null){eb=eh.head;ed=eb.next;eh.head=ed;if(eh.head==null){eh.pushmod=true}}else{eb=ee.next;ed=eb.next;ee.next=ed;if(ed==null){eh.pushmod=true}}var ef=eb;ef.elt=null;ef.next=dL.zpp_pool;dL.zpp_pool=ef;eh.modified=true;eh.length--;eh.pushmod=true;ec=true;break}ee=eg;eg=eg.next}return ec};cg.prototype.remove_arb=function(ea){var eg=this.arbiters;var ed=null;var ef=eg.head;while(ef!=null){if(ef.elt==ea){var eb;var ec;if(ed==null){eb=eg.head;ec=eb.next;eg.head=ec;if(eg.head==null){eg.pushmod=true}}else{eb=ed.next;ec=eb.next;ed.next=ec;if(ec==null){eg.pushmod=true}}var ee=eb;ee.elt=null;ee.next=dL.zpp_pool;dL.zpp_pool=ee;eg.modified=true;eg.length--;eg.pushmod=true;break}ed=ef;ef=ef.next}};cg.prototype.empty_arb=function(eb){var ec;ec=true;var ea=this.arbiters.head;while(ea!=null){if((ea.elt.type&eb)==0){ea=ea.next;continue}else{ec=false;break}}return ec};cg.prototype.really_empty=function(){return this.arbiters.head==null};cg.prototype.sleeping=function(){var ea;ea=true;var eb=this.arbiters.head;while(eb!=null){if(eb.elt.sleeping){eb=eb.next;continue}else{ea=false;break}}return ea};cg.prototype.__class__=cg;var M=zpp_nape.space.ZPP_CbSetManager=function(ea){this.space=null;this.cbsets=null;if(dT.zpp_pool==null){this.cbsets=new dT()}else{this.cbsets=dT.zpp_pool;dT.zpp_pool=this.cbsets.next;this.cbsets.next=null}this.cbsets.lt=cC.setlt;this.space=ea};M.__name__=["zpp_nape","space","ZPP_CbSetManager"];M.prototype.cbsets=null;M.prototype.space=null;M.prototype.get=function(ee){if(ee.head==null){return null}var ea;if(cC.zpp_pool==null){ea=new cC()}else{ea=cC.zpp_pool;cC.zpp_pool=ea.next;ea.next=null}var eb=ea.cbTypes;ea.cbTypes=ee;var ed=this.cbsets.find_weak(ea);var ec;if(ed!=null){ec=ed.data}else{var eg=cC.get(ee);this.cbsets.insert(eg);eg.manager=this;ec=eg}ea.cbTypes=eb;var ef=ea;ef.listeners.clear();ef.zip_listeners=true;ef.bodylisteners.clear();ef.zip_bodylisteners=true;ef.conlisteners.clear();ef.zip_conlisteners=true;while(ef.cbTypes.head!=null){ef.cbTypes.pop_unsafe().cbsets.remove(ef)}ef.next=cC.zpp_pool;cC.zpp_pool=ef;return ec};M.prototype.remove=function(eb){this.cbsets.remove(eb);while(eb.cbpairs.head!=null){var ea=eb.cbpairs.pop_unsafe();if(ea.a!=ea.b){if(eb==ea.a){ea.b.cbpairs.remove(ea)}else{ea.a.cbpairs.remove(ea)}}ea.a=ea.b=null;ea.listeners.clear();ea.next=ar.zpp_pool;ar.zpp_pool=ea}eb.manager=null};M.prototype.clear=function(){};M.prototype.validate=function(){if(!this.cbsets.empty()){var ea=this.cbsets.parent;while(ea.prev!=null){ea=ea.prev}while(ea!=null){ea.data.validate();if(ea.next!=null){ea=ea.next;while(ea.prev!=null){ea=ea.prev}}else{while(ea.parent!=null&&ea==ea.parent.next){ea=ea.parent}ea=ea.parent}}}};M.prototype.pair=function(eb,ea){var ec=null;var ed=(eb.cbpairs.length0.0001){ez.axisx=Math.sin(ez.rot);ez.axisy=Math.cos(ez.rot)}else{var ft=ev*ev;var eY=1-0.5*ft;var fa=1-ft*ft/8;var fv=(eY*ez.axisx+ev*ez.axisy)*fa;ez.axisy=(eY*ez.axisy-ev*ez.axisx)*fa;ez.axisx=fv}}}var fT=ez.posx;var fQ=ez.posy;eC.validate_sweepRadius();var er=eC.sweepRadius;var ei;if(bT.zpp_pool==null){ei=new bT()}else{ei=bT.zpp_pool;bT.zpp_pool=ei.next;ei.next=null}ei.minx=(eIfT?eI:fT)+er;ei.miny=(eGfQ?eG:fQ)+er;var eB=this.convexShapeList=this.bphase.shapesInAABB(ei,false,false,eF==null?null:eF.zpp_inner,this.convexShapeList);var e6=ei;if(e6.outer!=null){e6.outer.zpp_inner=null;e6.outer=null}e6.wrap_min=e6.wrap_max=null;e6._invalidate=null;e6._validate=null;e6.next=bT.zpp_pool;bT.zpp_pool=e6;var fE=0;var fB=0;fE=0;fB=0;var fu=0;var fr=0;fu=0;fr=0;var eq=null;var eo=et+1;eB.zpp_inner.valmod();var ec=bC.get(eB);while(true){ec.zpp_inner.zpp_inner.valmod();var e7=ec.zpp_inner;e7.zpp_inner.valmod();if(e7.zpp_inner.zip_length){e7.zpp_inner.zip_length=false;e7.zpp_inner.user_length=e7.zpp_inner.inner.length}var em=e7.zpp_inner.user_length;ec.zpp_critical=true;var ek;if(ec.zpp_i0.0001){eZ.axisx=Math.sin(eZ.rot);eZ.axisy=Math.cos(eZ.rot)}else{var fn=ep*ep;var fz=1-0.5*fn;var ee=1-fn*fn/8;var f1=(fz*eZ.axisx+ep*eZ.axisy)*ee;eZ.axisy=(fz*eZ.axisy-ep*eZ.axisx)*ee;eZ.axisx=f1}}}var eX=(eU.zpp_inner.body!=null?eU.zpp_inner.body.outer:null).zpp_inner;var ej=eU.zpp_inner;if(ej.type==0){ej.worldCOMx=eX.posx+(eX.axisy*ej.localCOMx-eX.axisx*ej.localCOMy);ej.worldCOMy=eX.posy+(ej.localCOMx*eX.axisx+ej.localCOMy*eX.axisy)}else{var fy=ej.polygon;var eE=fy.lverts.next;var fK=fy.gverts.next;while(fK!=null){var eb=fK;var ey=eE;eE=eE.next;eb.x=eX.posx+(eX.axisy*ey.x-eX.axisx*ey.y);eb.y=eX.posy+(ey.x*eX.axisx+ey.y*eX.axisy);fK=fK.next}var fi=fy.edges.head;var fI=fy.gverts.next;var fX=fI;fI=fI.next;while(fI!=null){var fH=fI;var eL=fi.elt;fi=fi.next;eL.gnormx=eX.axisy*eL.lnormx-eX.axisx*eL.lnormy;eL.gnormy=eL.lnormx*eX.axisx+eL.lnormy*eX.axisy;eL.gprojection=eX.posx*eL.gnormx+eX.posy*eL.gnormy+eL.lprojection;eL.tp0=fX.y*eL.gnormx-fX.x*eL.gnormy;eL.tp1=fH.y*eL.gnormx-fH.x*eL.gnormy;fX=fH;fI=fI.next}var fG=fy.gverts.next;var eK=fi.elt;eK.gnormx=eX.axisy*eK.lnormx-eX.axisx*eK.lnormy;eK.gnormy=eK.lnormx*eX.axisx+eK.lnormy*eX.axisy;eK.gprojection=eX.posx*eK.gnormx+eX.posy*eK.gnormy+eK.lprojection;eK.tp0=fX.y*eK.gnormx-fX.x*eK.gnormy;eK.tp1=fG.y*eK.gnormx-fG.x*eK.gnormy}}else{de.staticSweep(fZ,et,0,0)}fZ.toi*=et;if(fZ.toi>0&&fZ.toi0.0001){ez.axisx=Math.sin(ez.rot);ez.axisy=Math.cos(ez.rot)}else{var fl=en*en;var fx=1-0.5*fl;var ed=1-fl*fl/8;var f0=(fx*ez.axisx+en*ez.axisy)*ed;ez.axisy=(fx*ez.axisy-en*ez.axisx)*ed;ez.axisx=f0}}}if(eC.type==0){eC.worldCOMx=ez.posx+(ez.axisy*eC.localCOMx-ez.axisx*eC.localCOMy);eC.worldCOMy=ez.posy+(eC.localCOMx*ez.axisx+eC.localCOMy*ez.axisy)}else{var fw=eC.polygon;var eD=fw.lverts.next;var fF=fw.gverts.next;while(fF!=null){var ea=fF;var ex=eD;eD=eD.next;ea.x=ez.posx+(ez.axisy*ex.x-ez.axisx*ex.y);ea.y=ez.posy+(ex.x*ez.axisx+ex.y*ez.axisy);fF=fF.next}var fh=fw.edges.head;var fD=fw.gverts.next;var fW=fD;fD=fD.next;while(fD!=null){var fC=fD;var eJ=fh.elt;fh=fh.next;eJ.gnormx=ez.axisy*eJ.lnormx-ez.axisx*eJ.lnormy;eJ.gnormy=eJ.lnormx*ez.axisx+eJ.lnormy*ez.axisy;eJ.gprojection=ez.posx*eJ.gnormx+ez.posy*eJ.gnormy+eJ.lprojection;eJ.tp0=fW.y*eJ.gnormx-fW.x*eJ.gnormy;eJ.tp1=fC.y*eJ.gnormx-fC.x*eJ.gnormy;fW=fC;fD=fD.next}var fA=fw.gverts.next;var eH=fh.elt;eH.gnormx=ez.axisy*eH.lnormx-ez.axisx*eH.lnormy;eH.gnormy=eH.lnormx*ez.axisx+eH.lnormy*ez.axisy;eH.gprojection=ez.posx*eH.gnormx+ez.posy*eH.gnormy+eH.lprojection;eH.tp0=fW.y*eH.gnormx-fW.x*eH.gnormy;eH.tp1=fA.y*eH.gnormx-fA.x*eH.gnormy}if(eo<=et){var eP=-fE;var eO=-fB;var e0;if(au.poolVec2==null){e0=new r()}else{e0=au.poolVec2;au.poolVec2=e0.zpp_pool;e0.zpp_pool=null}if(e0.zpp_inner==null){var fR;if(bB.zpp_pool==null){fR=new bB()}else{fR=bB.zpp_pool;bB.zpp_pool=fR.next;fR.next=null}fR.weak=false;fR._immutable=false;fR.x=eP;fR.y=eO;e0.zpp_inner=fR;e0.zpp_inner.outer=e0}else{var ew;var eW=e0.zpp_inner;if(eW._validate!=null){eW._validate()}if(e0.zpp_inner.x==eP){var fs=e0.zpp_inner;if(fs._validate!=null){fs._validate()}ew=e0.zpp_inner.y==eO}else{ew=false}if(!ew){e0.zpp_inner.x=eP;e0.zpp_inner.y=eO;var fq=e0.zpp_inner;if(fq._invalidate!=null){fq._invalidate(fq)}}}e0.zpp_inner.weak=false;var eu=e0;var fP;if(au.poolVec2==null){fP=new r()}else{fP=au.poolVec2;au.poolVec2=fP.zpp_pool;fP.zpp_pool=null}if(fP.zpp_inner==null){var fO;if(bB.zpp_pool==null){fO=new bB()}else{fO=bB.zpp_pool;bB.zpp_pool=fO.next;fO.next=null}fO.weak=false;fO._immutable=false;fO.x=fu;fO.y=fr;fP.zpp_inner=fO;fP.zpp_inner.outer=fP}else{var es;var fp=fP.zpp_inner;if(fp._validate!=null){fp._validate()}if(fP.zpp_inner.x==fu){var fo=fP.zpp_inner;if(fo._validate!=null){fo._validate()}es=fP.zpp_inner.y==fr}else{es=false}if(!es){fP.zpp_inner.x=fu;fP.zpp_inner.y=fr;var fm=fP.zpp_inner;if(fm._invalidate!=null){fm._invalidate(fm)}}}fP.zpp_inner.weak=false;return a4.getConvex(eu,fP,eo,eq)}else{return null}};a3.prototype.prepareCast=function(en){if(en.type==0){var es=en.circle;if(es.zip_worldCOM){if(es.body!=null){es.zip_worldCOM=false;if(es.zip_localCOM){es.zip_localCOM=false;if(es.type==1){var ez=es.polygon;if(ez.lverts.next.next==null){ez.localCOMx=ez.lverts.next.x;ez.localCOMy=ez.lverts.next.y}else{if(ez.lverts.next.next.next==null){ez.localCOMx=ez.lverts.next.x;ez.localCOMy=ez.lverts.next.y;ez.localCOMx+=ez.lverts.next.next.x;ez.localCOMy+=ez.lverts.next.next.y;ez.localCOMx*=0.5;ez.localCOMy*=0.5}else{ez.localCOMx=0;ez.localCOMy=0;var eA=0;var er=ez.lverts.next;var ej=er;er=er.next;var ei=er;er=er.next;while(er!=null){var eg=er;eA+=ei.x*(eg.y-ej.y);var em=eg.y*ei.x-eg.x*ei.y;ez.localCOMx+=(ei.x+eg.x)*em;ez.localCOMy+=(ei.y+eg.y)*em;ej=ei;ei=eg;er=er.next}er=ez.lverts.next;var eh=er;eA+=ei.x*(eh.y-ej.y);var ee=eh.y*ei.x-eh.x*ei.y;ez.localCOMx+=(ei.x+eh.x)*ee;ez.localCOMy+=(ei.y+eh.y)*ee;ej=ei;er=er.next;var ef=er;eA+=eh.x*(ef.y-ej.y);var ed=ef.y*eh.x-ef.x*eh.y;ez.localCOMx+=(eh.x+ef.x)*ed;ez.localCOMy+=(eh.y+ef.y)*ed;eA=1/(3*eA);var el=eA;ez.localCOMx*=el;ez.localCOMy*=el}}}if(es.wrap_localCOM!=null){es.wrap_localCOM.zpp_inner.x=es.localCOMx;es.wrap_localCOM.zpp_inner.y=es.localCOMy}}var ey=es.body;if(ey.zip_axis){ey.zip_axis=false;ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}es.worldCOMx=es.body.posx+(es.body.axisy*es.localCOMx-es.body.axisx*es.localCOMy);es.worldCOMy=es.body.posy+(es.localCOMx*es.body.axisx+es.localCOMy*es.body.axisy)}}}else{var ew=en.polygon;if(ew.zip_gaxi){if(ew.body!=null){ew.zip_gaxi=false;ew.validate_laxi();var eu=ew.body;if(eu.zip_axis){eu.zip_axis=false;eu.axisx=Math.sin(eu.rot);eu.axisy=Math.cos(eu.rot)}if(ew.zip_gverts){if(ew.body!=null){ew.zip_gverts=false;ew.validate_lverts();var et=ew.body;if(et.zip_axis){et.zip_axis=false;et.axisx=Math.sin(et.rot);et.axisy=Math.cos(et.rot)}var ek=ew.lverts.next;var ep=ew.gverts.next;while(ep!=null){var ex=ep;var eq=ek;ek=ek.next;ex.x=ew.body.posx+(ew.body.axisy*eq.x-ew.body.axisx*eq.y);ex.y=ew.body.posy+(eq.x*ew.body.axisx+eq.y*ew.body.axisy);ep=ep.next}}}var ec=ew.edges.head;var eo=ew.gverts.next;var ev=eo;eo=eo.next;while(eo!=null){var ea=eo;var eB=ec.elt;ec=ec.next;eB.gp0=ev;eB.gp1=ea;eB.gnormx=ew.body.axisy*eB.lnormx-ew.body.axisx*eB.lnormy;eB.gnormy=eB.lnormx*ew.body.axisx+eB.lnormy*ew.body.axisy;eB.gprojection=ew.body.posx*eB.gnormx+ew.body.posy*eB.gnormy+eB.lprojection;if(eB.wrap_gnorm!=null){eB.wrap_gnorm.zpp_inner.x=eB.gnormx;eB.wrap_gnorm.zpp_inner.y=eB.gnormy}eB.tp0=eB.gp0.y*eB.gnormx-eB.gp0.x*eB.gnormy;eB.tp1=eB.gp1.y*eB.gnormx-eB.gp1.x*eB.gnormy;ev=ea;eo=eo.next}var eb=ec.elt;eb.gp0=ev;eb.gp1=ew.gverts.next;eb.gnormx=ew.body.axisy*eb.lnormx-ew.body.axisx*eb.lnormy;eb.gnormy=eb.lnormx*ew.body.axisx+eb.lnormy*ew.body.axisy;eb.gprojection=ew.body.posx*eb.gnormx+ew.body.posy*eb.gnormy+eb.lprojection;if(eb.wrap_gnorm!=null){eb.wrap_gnorm.zpp_inner.x=eb.gnormx;eb.wrap_gnorm.zpp_inner.y=eb.gnormy}eb.tp0=eb.gp0.y*eb.gnormx-eb.gp0.x*eb.gnormy;eb.tp1=eb.gp1.y*eb.gnormx-eb.gp1.x*eb.gnormy}}}};a3.prototype.convexMultiCast=function(eD,es,eG,f6,ew){var f3;if(ct.zpp_pool==null){f3=new ct()}else{f3=ct.zpp_pool;ct.zpp_pool=f3.next;f3.next=null}f3.failed=false;f3.s1=f3.s2=null;f3.arbiter=null;if(eD.type==0){var eA=eD.circle;if(eA.zip_worldCOM){if(eA.body!=null){eA.zip_worldCOM=false;if(eA.zip_localCOM){eA.zip_localCOM=false;if(eA.type==1){var fi=eA.polygon;if(fi.lverts.next.next==null){fi.localCOMx=fi.lverts.next.x;fi.localCOMy=fi.lverts.next.y}else{if(fi.lverts.next.next.next==null){fi.localCOMx=fi.lverts.next.x;fi.localCOMy=fi.lverts.next.y;fi.localCOMx+=fi.lverts.next.next.x;fi.localCOMy+=fi.lverts.next.next.y;fi.localCOMx*=0.5;fi.localCOMy*=0.5}else{fi.localCOMx=0;fi.localCOMy=0;var ef=0;var fP=fi.lverts.next;var eT=fP;fP=fP.next;var eS=fP;fP=fP.next;while(fP!=null){var eR=fP;ef+=eS.x*(eR.y-eT.y);var eW=eR.y*eS.x-eR.x*eS.y;fi.localCOMx+=(eS.x+eR.x)*eW;fi.localCOMy+=(eS.y+eR.y)*eW;eT=eS;eS=eR;fP=fP.next}fP=fi.lverts.next;var fe=fP;ef+=eS.x*(fe.y-eT.y);var el=fe.y*eS.x-fe.x*eS.y;fi.localCOMx+=(eS.x+fe.x)*el;fi.localCOMy+=(eS.y+fe.y)*el;eT=eS;fP=fP.next;var fb=fP;ef+=fe.x*(fb.y-eT.y);var eh=fb.y*fe.x-fb.x*fe.y;fi.localCOMx+=(fe.x+fb.x)*eh;fi.localCOMy+=(fe.y+fb.y)*eh;ef=1/(3*ef);var eU=ef;fi.localCOMx*=eU;fi.localCOMy*=eU}}}if(eA.wrap_localCOM!=null){eA.wrap_localCOM.zpp_inner.x=eA.localCOMx;eA.wrap_localCOM.zpp_inner.y=eA.localCOMy}}var fh=eA.body;if(fh.zip_axis){fh.zip_axis=false;fh.axisx=Math.sin(fh.rot);fh.axisy=Math.cos(fh.rot)}eA.worldCOMx=eA.body.posx+(eA.body.axisy*eA.localCOMx-eA.body.axisx*eA.localCOMy);eA.worldCOMy=eA.body.posy+(eA.localCOMx*eA.body.axisx+eA.localCOMy*eA.body.axisy)}}}else{var fg=eD.polygon;if(fg.zip_gaxi){if(fg.body!=null){fg.zip_gaxi=false;fg.validate_laxi();var fd=fg.body;if(fd.zip_axis){fd.zip_axis=false;fd.axisx=Math.sin(fd.rot);fd.axisy=Math.cos(fd.rot)}if(fg.zip_gverts){if(fg.body!=null){fg.zip_gverts=false;fg.validate_lverts();var fa=fg.body;if(fa.zip_axis){fa.zip_axis=false;fa.axisx=Math.sin(fa.rot);fa.axisy=Math.cos(fa.rot)}var f7=fg.lverts.next;var fO=fg.gverts.next;while(fO!=null){var fm=fO;var ff=f7;f7=f7.next;fm.x=fg.body.posx+(fg.body.axisy*ff.x-fg.body.axisx*ff.y);fm.y=fg.body.posy+(ff.x*fg.body.axisx+ff.y*fg.body.axisy);fO=fO.next}}}var eN=fg.edges.head;var fN=fg.gverts.next;var f2=fN;fN=fN.next;while(fN!=null){var fL=fN;var fn=eN.elt;eN=eN.next;fn.gp0=f2;fn.gp1=fL;fn.gnormx=fg.body.axisy*fn.lnormx-fg.body.axisx*fn.lnormy;fn.gnormy=fn.lnormx*fg.body.axisx+fn.lnormy*fg.body.axisy;fn.gprojection=fg.body.posx*fn.gnormx+fg.body.posy*fn.gnormy+fn.lprojection;if(fn.wrap_gnorm!=null){fn.wrap_gnorm.zpp_inner.x=fn.gnormx;fn.wrap_gnorm.zpp_inner.y=fn.gnormy}fn.tp0=fn.gp0.y*fn.gnormx-fn.gp0.x*fn.gnormy;fn.tp1=fn.gp1.y*fn.gnormx-fn.gp1.x*fn.gnormy;f2=fL;fN=fN.next}var eO=eN.elt;eO.gp0=f2;eO.gp1=fg.gverts.next;eO.gnormx=fg.body.axisy*eO.lnormx-fg.body.axisx*eO.lnormy;eO.gnormy=eO.lnormx*fg.body.axisx+eO.lnormy*fg.body.axisy;eO.gprojection=fg.body.posx*eO.gnormx+fg.body.posy*eO.gnormy+eO.lprojection;if(eO.wrap_gnorm!=null){eO.wrap_gnorm.zpp_inner.x=eO.gnormx;eO.wrap_gnorm.zpp_inner.y=eO.gnormy}eO.tp0=eO.gp0.y*eO.gnormx-eO.gp0.x*eO.gnormy;eO.tp1=eO.gp1.y*eO.gnormx-eO.gp1.x*eO.gnormy}}}var ey=eD.body;var eJ=ey.posx;var eH=ey.posy;ey.sweepTime=0;ey.sweep_angvel=ey.angvel;var eg=es-ey.sweepTime;if(eg!=0){ey.sweepTime=es;ey.posx+=ey.velx*eg;ey.posy+=ey.vely*eg;if(ey.angvel!=0){var eu=ey.sweep_angvel*eg;ey.rot+=eu;if(eu*eu>0.0001){ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}else{var fw=eu*eu;var eZ=1-0.5*fw;var fc=1-fw*fw/8;var fx=(eZ*ey.axisx+eu*ey.axisy)*fc;ey.axisy=(eZ*ey.axisy-eu*ey.axisx)*fc;ey.axisx=fx}}}var fX=ey.posx;var fU=ey.posy;eD.validate_sweepRadius();var eq=eD.sweepRadius;var ei;if(bT.zpp_pool==null){ei=new bT()}else{ei=bT.zpp_pool;bT.zpp_pool=ei.next;ei.next=null}ei.minx=(eJfX?eJ:fX)+eq;ei.miny=(eHfU?eH:fU)+eq;var eB=this.convexShapeList=this.bphase.shapesInAABB(ei,false,false,eG==null?null:eG.zpp_inner,this.convexShapeList);var e6=ei;if(e6.outer!=null){e6.outer.zpp_inner=null;e6.outer=null}e6.wrap_min=e6.wrap_max=null;e6._invalidate=null;e6._validate=null;e6.next=bT.zpp_pool;bT.zpp_pool=e6;var e8=ew==null?new cs():ew;eB.zpp_inner.valmod();var ec=bC.get(eB);while(true){ec.zpp_inner.zpp_inner.valmod();var e7=ec.zpp_inner;e7.zpp_inner.valmod();if(e7.zpp_inner.zip_length){e7.zpp_inner.zip_length=false;e7.zpp_inner.user_length=e7.zpp_inner.inner.length}var em=e7.zpp_inner.user_length;ec.zpp_critical=true;var ek;if(ec.zpp_i0.0001){e0.axisx=Math.sin(e0.rot);e0.axisy=Math.cos(e0.rot)}else{var fr=eo*eo;var fB=1-0.5*fr;var ee=1-fr*fr/8;var f5=(fB*e0.axisx+eo*e0.axisy)*ee;e0.axisy=(fB*e0.axisy-eo*e0.axisx)*ee;e0.axisx=f5}}}var eY=(eV.zpp_inner.body!=null?eV.zpp_inner.body.outer:null).zpp_inner;var ej=eV.zpp_inner;if(ej.type==0){ej.worldCOMx=eY.posx+(eY.axisy*ej.localCOMx-eY.axisx*ej.localCOMy);ej.worldCOMy=eY.posy+(ej.localCOMx*eY.axisx+ej.localCOMy*eY.axisy)}else{var fA=ej.polygon;var eF=fA.lverts.next;var fM=fA.gverts.next;while(fM!=null){var eb=fM;var ez=eF;eF=eF.next;eb.x=eY.posx+(eY.axisy*ez.x-eY.axisx*ez.y);eb.y=eY.posy+(ez.x*eY.axisx+ez.y*eY.axisy);fM=fM.next}var fl=fA.edges.head;var fK=fA.gverts.next;var f1=fK;fK=fK.next;while(fK!=null){var fJ=fK;var eM=fl.elt;fl=fl.next;eM.gnormx=eY.axisy*eM.lnormx-eY.axisx*eM.lnormy;eM.gnormy=eM.lnormx*eY.axisx+eM.lnormy*eY.axisy;eM.gprojection=eY.posx*eM.gnormx+eY.posy*eM.gnormy+eM.lprojection;eM.tp0=f1.y*eM.gnormx-f1.x*eM.gnormy;eM.tp1=fJ.y*eM.gnormx-fJ.x*eM.gnormy;f1=fJ;fK=fK.next}var fH=fA.gverts.next;var eL=fl.elt;eL.gnormx=eY.axisy*eL.lnormx-eY.axisx*eL.lnormy;eL.gnormy=eL.lnormx*eY.axisx+eL.lnormy*eY.axisy;eL.gprojection=eY.posx*eL.gnormx+eY.posy*eL.gnormy+eL.lprojection;eL.tp0=f1.y*eL.gnormx-f1.x*eL.gnormy;eL.tp1=fH.y*eL.gnormx-fH.x*eL.gnormy}}else{de.staticSweep(f3,es,0,0)}f3.toi*=es;if(f3.toi>0){var eQ=-f3.axis.x;var eP=-f3.axis.y;var fW;if(au.poolVec2==null){fW=new r()}else{fW=au.poolVec2;au.poolVec2=fW.zpp_pool;fW.zpp_pool=null}if(fW.zpp_inner==null){var fT;if(bB.zpp_pool==null){fT=new bB()}else{fT=bB.zpp_pool;bB.zpp_pool=fT.next;fT.next=null}fT.weak=false;fT._immutable=false;fT.x=eQ;fT.y=eP;fW.zpp_inner=fT;fW.zpp_inner.outer=fW}else{var ev;var eX=fW.zpp_inner;if(eX._validate!=null){eX._validate()}if(fW.zpp_inner.x==eQ){var fv=fW.zpp_inner;if(fv._validate!=null){fv._validate()}ev=fW.zpp_inner.y==eP}else{ev=false}if(!ev){fW.zpp_inner.x=eQ;fW.zpp_inner.y=eP;var fu=fW.zpp_inner;if(fu._invalidate!=null){fu._invalidate(fu)}}}fW.zpp_inner.weak=false;var et=fW;var eC=f3.c2.x;var ep=f3.c2.y;var fS;if(au.poolVec2==null){fS=new r()}else{fS=au.poolVec2;au.poolVec2=fS.zpp_pool;fS.zpp_pool=null}if(fS.zpp_inner==null){var fR;if(bB.zpp_pool==null){fR=new bB()}else{fR=bB.zpp_pool;bB.zpp_pool=fR.next;fR.next=null}fR.weak=false;fR._immutable=false;fR.x=eC;fR.y=ep;fS.zpp_inner=fR;fS.zpp_inner.outer=fS}else{var er;var ft=fS.zpp_inner;if(ft._validate!=null){ft._validate()}if(fS.zpp_inner.x==eC){var fs=fS.zpp_inner;if(fs._validate!=null){fs._validate()}er=fS.zpp_inner.y==ep}else{er=false}if(!er){fS.zpp_inner.x=eC;fS.zpp_inner.y=ep;var fq=fS.zpp_inner;if(fq._invalidate!=null){fq._invalidate(fq)}}}fS.zpp_inner.weak=false;var e9=a4.getConvex(et,fS,f3.toi,eV);var fk=null;var fG=e8.zpp_inner.inner.head;while(fG!=null){if(e9.zpp_inner.toiDistance0.0001){ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}else{var fo=en*en;var fz=1-0.5*fo;var ed=1-fo*fo/8;var f4=(fz*ey.axisx+en*ey.axisy)*ed;ey.axisy=(fz*ey.axisy-en*ey.axisx)*ed;ey.axisx=f4}}}if(eD.type==0){eD.worldCOMx=ey.posx+(ey.axisy*eD.localCOMx-ey.axisx*eD.localCOMy);eD.worldCOMy=ey.posy+(eD.localCOMx*ey.axisx+eD.localCOMy*ey.axisy)}else{var fy=eD.polygon;var eE=fy.lverts.next;var fF=fy.gverts.next;while(fF!=null){var ea=fF;var ex=eE;eE=eE.next;ea.x=ey.posx+(ey.axisy*ex.x-ey.axisx*ex.y);ea.y=ey.posy+(ex.x*ey.axisx+ex.y*ey.axisy);fF=fF.next}var fj=fy.edges.head;var fD=fy.gverts.next;var f0=fD;fD=fD.next;while(fD!=null){var fE=fD;var eK=fj.elt;fj=fj.next;eK.gnormx=ey.axisy*eK.lnormx-ey.axisx*eK.lnormy;eK.gnormy=eK.lnormx*ey.axisx+eK.lnormy*ey.axisy;eK.gprojection=ey.posx*eK.gnormx+ey.posy*eK.gnormy+eK.lprojection;eK.tp0=f0.y*eK.gnormx-f0.x*eK.gnormy;eK.tp1=fE.y*eK.gnormx-fE.x*eK.gnormy;f0=fE;fD=fD.next}var fC=fy.gverts.next;var eI=fj.elt;eI.gnormx=ey.axisy*eI.lnormx-ey.axisx*eI.lnormy;eI.gnormy=eI.lnormx*ey.axisx+eI.lnormy*ey.axisy;eI.gprojection=ey.posx*eI.gnormx+ey.posy*eI.gnormy+eI.lprojection;eI.tp0=f0.y*eI.gnormx-f0.x*eI.gnormy;eI.tp1=fC.y*eI.gnormx-fC.x*eI.gnormy}return e8};a3.prototype.push_callback=function(eb){var ea;if(cS.zpp_pool==null){ea=new cS()}else{ea=cS.zpp_pool;cS.zpp_pool=ea.next;ea.next=null}this.callbacks.push(ea);ea.listener=eb;return ea};a3.prototype.pre_dt=null;a3.prototype.step=function(e0,et,eG){var e9=this;this.time+=e0;this.pre_dt=e0;this.midstep=true;this.stamp++;this.validation();this.bphase.broadphase(this,true);this.prestep(e0);if(this.sortcontacts){var eE=this.c_arbiters_false;if(eE.head!=null&&eE.head.next!=null){var em=eE.head;var fe=null;var eg=null;var e3=null;var e6=null;var ev=1;var ee;var eK;var ea;while(true){ee=0;eg=em;em=null;fe=em;while(eg!=null){++ee;e3=eg;eK=0;ea=ev;while(e3!=null&&eK0||ea>0&&e3!=null){if(eK==0){e6=e3;e3=e3.next;--ea}else{if(ea==0||e3==null){e6=eg;eg=eg.next;--eK}else{if(eg.elt.active&&e3.elt.active?eg.elt.oc1.dist1)){break}}eE.head=em;eE.modified=true;eE.pushmod=true}}this.updateVel(e0);this.warmStart();this.iterateVel(et);var ei=this.kinematics.head;while(ei!=null){var eh=ei.elt;eh.pre_posx=eh.posx;eh.pre_posy=eh.posy;eh.pre_rot=eh.rot;ei=ei.next}var ez=this.live.head;while(ez!=null){var eA=ez.elt;eA.pre_posx=eA.posx;eA.pre_posy=eA.posy;eA.pre_rot=eA.rot;ez=ez.next}this.updatePos(e0);this.continuous=true;this.continuousCollisions(e0);this.continuous=false;this.iteratePos(eG);var ex=this.kinematics.head;while(ex!=null){var ey=ex.elt;var eL=!(ey.posx==ey.pre_posx&&ey.posy==ey.pre_posy);var eB=ey.pre_rot!=ey.rot;if(eL){var eu=ey.shapes.head;while(eu!=null){var eZ=eu.elt;if(eZ.type==1){eZ.polygon.invalidate_gverts();eZ.polygon.invalidate_gaxi()}eZ.invalidate_worldCOM();eu=eu.next}ey.zip_worldCOM=true}if(eB){ey.zip_axis=true;var es=ey.shapes.head;while(es!=null){var fb=es.elt;if(fb.type==1){fb.polygon.invalidate_gverts();fb.polygon.invalidate_gaxi()}fb.invalidate_worldCOM();es=es.next}ey.zip_worldCOM=true}ex=ex.next}var er=this.live.head;while(er!=null){var ew=er.elt;var ed=!(ew.posx==ew.pre_posx&&ew.posy==ew.pre_posy);var eF=ew.pre_rot!=ew.rot;if(ed){var eq=ew.shapes.head;while(eq!=null){var fa=eq.elt;if(fa.type==1){fa.polygon.invalidate_gverts();fa.polygon.invalidate_gaxi()}fa.invalidate_worldCOM();eq=eq.next}ew.zip_worldCOM=true}if(eF){ew.zip_axis=true;var ep=ew.shapes.head;while(ep!=null){var e8=ep.elt;if(e8.type==1){e8.polygon.invalidate_gverts();e8.polygon.invalidate_gaxi()}e8.invalidate_worldCOM();ep=ep.next}ew.zip_worldCOM=true}er=er.next}var eW=null;var eo=this.staticsleep.head;while(eo!=null){var fc=eo.elt;if(fc.type!=3||fc.velx==0&&fc.vely==0&&fc.angvel==0){if(fc.kinematicDelaySleep){fc.kinematicDelaySleep=false;eo=eo.next;continue}fc.component.sleeping=true;var ef=this.staticsleep;var e5;var eI;if(eW==null){e5=ef.head;eI=e5.next;ef.head=eI;if(ef.head==null){ef.pushmod=true}}else{e5=eW.next;eI=e5.next;eW.next=eI;if(eI==null){ef.pushmod=true}}var e4=e5;e4.elt=null;e4.next=bE.zpp_pool;bE.zpp_pool=e4;ef.modified=true;ef.length--;ef.pushmod=true;eo=eI;continue}eW=eo;eo=eo.next}this.doForests(e0);this.sleepArbiters();this.midstep=false;var en=null;var el=this.callbackset_list.next;while(el!=null){var eD=el;if(eD.arbiters.head==null){var eY=this.callbackset_list;var e7;var eR;if(en==null){e7=eY.next;eR=e7.next;eY.next=eR;if(eY.next==null){eY.pushmod=true}}else{e7=en.next;eR=e7.next;en.next=eR;if(eR==null){eY.pushmod=true}}e7._inuse=false;eY.modified=true;eY.length--;eY.pushmod=true;el=eR;eD.int1=eD.int2=null;eD.id=eD.di=-1;eD.freed=true;eD.next=cg.zpp_pool;cg.zpp_pool=eD;continue}var eP;eP=true;var eX=eD.arbiters.head;while(eX!=null){if(eX.elt.sleeping){eX=eX.next;continue}else{eP=false;break}}var eH=eP;var fd=eD.int1.cbSet;var eC=eD.int2.cbSet;var eO=null;var eV=(fd.cbpairs.length=0&&(fF.toi0.0001){ea.axisx=Math.sin(ea.rot);ea.axisy=Math.cos(ea.rot)}else{var f9=fy*fy;var fV=1-0.5*f9;var fX=1-f9*f9/8;var gd=(fV*ea.axisx+fy*ea.axisy)*fX;ea.axisy=(fV*ea.axisy-fy*ea.axisx)*fX;ea.axisx=gd}}}var fT=gw.s1;if(fT.type==0){fT.worldCOMx=ea.posx+(ea.axisy*fT.localCOMx-ea.axisx*fT.localCOMy);fT.worldCOMy=ea.posy+(fT.localCOMx*ea.axisx+fT.localCOMy*ea.axisy)}else{var gi=fT.polygon;var gC=gi.lverts.next;var e5=gi.gverts.next;while(e5!=null){var f2=e5;var fY=gC;gC=gC.next;f2.x=ea.posx+(ea.axisy*fY.x-ea.axisx*fY.y);f2.y=ea.posy+(fY.x*ea.axisx+fY.y*ea.axisy);e5=e5.next}var gp=gi.edges.head;var e0=gi.gverts.next;var fN=e0;e0=e0.next;while(e0!=null){var fK=e0;var f4=gp.elt;gp=gp.next;f4.gnormx=ea.axisy*f4.lnormx-ea.axisx*f4.lnormy;f4.gnormy=f4.lnormx*ea.axisx+f4.lnormy*ea.axisy;f4.gprojection=ea.posx*f4.gnormx+ea.posy*f4.gnormy+f4.lprojection;f4.tp0=fN.y*f4.gnormx-fN.x*f4.gnormy;f4.tp1=fK.y*f4.gnormx-fK.x*f4.gnormy;fN=fK;e0=e0.next}var e8=gi.gverts.next;var fR=gp.elt;fR.gnormx=ea.axisy*fR.lnormx-ea.axisx*fR.lnormy;fR.gnormy=fR.lnormx*ea.axisx+fR.lnormy*ea.axisy;fR.gprojection=ea.posx*fR.gnormx+ea.posy*fR.gnormy+fR.lprojection;fR.tp0=fN.y*fR.gnormx-fN.x*fR.gnormy;fR.tp1=e8.y*fR.gnormx-e8.x*fR.gnormy}}if(!gt.sweepFrozen){var fs=ft*fG;var fE=fs-gt.sweepTime;if(fE!=0){gt.sweepTime=fs;gt.posx+=gt.velx*fE;gt.posy+=gt.vely*fE;if(gt.angvel!=0){var f3=gt.sweep_angvel*fE;gt.rot+=f3;if(f3*f3>0.0001){gt.axisx=Math.sin(gt.rot);gt.axisy=Math.cos(gt.rot)}else{var gs=f3*f3;var gh=1-0.5*gs;var ej=1-gs*gs/8;var eF=(gh*gt.axisx+f3*gt.axisy)*ej;gt.axisy=(gh*gt.axisy-f3*gt.axisx)*ej;gt.axisx=eF}}}var fq=gw.s2;if(fq.type==0){fq.worldCOMx=gt.posx+(gt.axisy*fq.localCOMx-gt.axisx*fq.localCOMy);fq.worldCOMy=gt.posy+(fq.localCOMx*gt.axisx+fq.localCOMy*gt.axisy)}else{var gg=fq.polygon;var fa=gg.lverts.next;var eY=gg.gverts.next;while(eY!=null){var fm=eY;var ez=fa;fa=fa.next;fm.x=gt.posx+(gt.axisy*ez.x-gt.axisx*ez.y);fm.y=gt.posy+(ez.x*gt.axisx+ez.y*gt.axisy);eY=eY.next}var fb=gg.edges.head;var eW=gg.gverts.next;var ff=eW;eW=eW.next;while(eW!=null){var e7=eW;var fO=fb.elt;fb=fb.next;fO.gnormx=gt.axisy*fO.lnormx-gt.axisx*fO.lnormy;fO.gnormy=fO.lnormx*gt.axisx+fO.lnormy*gt.axisy;fO.gprojection=gt.posx*fO.gnormx+gt.posy*fO.gnormy+fO.lprojection;fO.tp0=ff.y*fO.gnormx-ff.x*fO.gnormy;fO.tp1=e7.y*fO.gnormx-e7.x*fO.gnormy;ff=e7;eW=eW.next}var e6=gg.gverts.next;var fL=fb.elt;fL.gnormx=gt.axisy*fL.lnormx-gt.axisx*fL.lnormy;fL.gnormy=fL.lnormx*gt.axisx+fL.lnormy*gt.axisy;fL.gprojection=gt.posx*fL.gnormx+gt.posy*fL.gnormy+fL.lprojection;fL.tp0=ff.y*fL.gnormx-ff.x*fL.gnormy;fL.tp1=e6.y*fL.gnormx-e6.x*fL.gnormy}}var ey=this.narrowPhase(gw.s1,gw.s2,true,gw.arbiter,true);if(ey==null){if(gw.arbiter!=null&&gw.arbiter.pair!=null){gw.arbiter.pair.arb=null;gw.arbiter.pair=null}}else{if(!this.presteparb(ey,fG,true)){if(ey.type==j.COL&&(ey.active&&(ey.immState&1)!=0)){var fv=ey.colarb;var et=fv.nx*fv.c1.jnAcc-fv.ny*fv.c1.jtAcc;var er=fv.ny*fv.c1.jnAcc+fv.nx*fv.c1.jtAcc;var fQ=fv.b1.imass;fv.b1.velx-=et*fQ;fv.b1.vely-=er*fQ;fv.b1.angvel-=fv.b1.iinertia*(er*fv.c1.r1x-et*fv.c1.r1y);var fj=fv.b2.imass;fv.b2.velx+=et*fj;fv.b2.vely+=er*fj;fv.b2.angvel+=fv.b2.iinertia*(er*fv.c1.r2x-et*fv.c1.r2y);if(fv.hc2){var eM=fv.nx*fv.c2.jnAcc-fv.ny*fv.c2.jtAcc;var eu=fv.ny*fv.c2.jnAcc+fv.nx*fv.c2.jtAcc;var fi=fv.b1.imass;fv.b1.velx-=eM*fi;fv.b1.vely-=eu*fi;fv.b1.angvel-=fv.b1.iinertia*(eu*fv.c2.r1x-eM*fv.c2.r1y);var fh=fv.b2.imass;fv.b2.velx+=eM*fh;fv.b2.vely+=eu*fh;fv.b2.angvel+=fv.b2.iinertia*(eu*fv.c2.r2x-eM*fv.c2.r2y)}fv.b2.angvel+=fv.jrAcc*fv.b2.iinertia;fv.b1.angvel-=fv.jrAcc*fv.b1.iinertia;var fg=ey.colarb;var eK;var es;var fZ;var fw;var f5;var fI;var fC=fg.k1x+fg.b2.velx-fg.c1.r2y*fg.b2.angvel-(fg.b1.velx-fg.c1.r1y*fg.b1.angvel);var fA=fg.k1y+fg.b2.vely+fg.c1.r2x*fg.b2.angvel-(fg.b1.vely+fg.c1.r1x*fg.b1.angvel);fZ=(fA*fg.nx-fC*fg.ny+fg.surfacex)*fg.c1.tMass;fw=fg.c1.friction*fg.c1.jnAcc;f5=fg.c1.jtAcc;fI=f5-fZ;if(fI>fw){fI=fw}else{if(fI<-fw){fI=-fw}}fZ=fI-f5;fg.c1.jtAcc=fI;eK=-fg.ny*fZ;es=fg.nx*fZ;fg.b2.velx+=eK*fg.b2.imass;fg.b2.vely+=es*fg.b2.imass;fg.b1.velx-=eK*fg.b1.imass;fg.b1.vely-=es*fg.b1.imass;fg.b2.angvel+=fg.rt1b*fZ*fg.b2.iinertia;fg.b1.angvel-=fg.rt1a*fZ*fg.b1.iinertia;if(fg.hc2){var fo=fg.k2x+fg.b2.velx-fg.c2.r2y*fg.b2.angvel-(fg.b1.velx-fg.c2.r1y*fg.b1.angvel);var fn=fg.k2y+fg.b2.vely+fg.c2.r2x*fg.b2.angvel-(fg.b1.vely+fg.c2.r1x*fg.b1.angvel);fZ=(fn*fg.nx-fo*fg.ny+fg.surfacex)*fg.c2.tMass;fw=fg.c2.friction*fg.c2.jnAcc;f5=fg.c2.jtAcc;fI=f5-fZ;if(fI>fw){fI=fw}else{if(fI<-fw){fI=-fw}}fZ=fI-f5;fg.c2.jtAcc=fI;eK=-fg.ny*fZ;es=fg.nx*fZ;fg.b2.velx+=eK*fg.b2.imass;fg.b2.vely+=es*fg.b2.imass;fg.b1.velx-=eK*fg.b1.imass;fg.b1.vely-=es*fg.b1.imass;fg.b2.angvel+=fg.rt2b*fZ*fg.b2.iinertia;fg.b1.angvel-=fg.rt2a*fZ*fg.b1.iinertia;fC=fg.k1x+fg.b2.velx-fg.c1.r2y*fg.b2.angvel-(fg.b1.velx-fg.c1.r1y*fg.b1.angvel);fA=fg.k1y+fg.b2.vely+fg.c1.r2x*fg.b2.angvel-(fg.b1.vely+fg.c1.r1x*fg.b1.angvel);fo=fg.k2x+fg.b2.velx-fg.c2.r2y*fg.b2.angvel-(fg.b1.velx-fg.c2.r1y*fg.b1.angvel);fn=fg.k2y+fg.b2.vely+fg.c2.r2x*fg.b2.angvel-(fg.b1.vely+fg.c2.r1x*fg.b1.angvel);var go=fg.c1.jnAcc;var gn=fg.c2.jnAcc;var gk=fC*fg.nx+fA*fg.ny+fg.surfacey+fg.c1.bounce-(fg.Ka*go+fg.Kb*gn);var gj=fo*fg.nx+fn*fg.ny+fg.surfacey+fg.c2.bounce-(fg.Kb*go+fg.Kc*gn);var gy=-(fg.kMassa*gk+fg.kMassb*gj);var gx=-(fg.kMassb*gk+fg.kMassc*gj);if(gy>=0&&gx>=0){gk=gy-go;gj=gx-gn;fg.c1.jnAcc=gy;fg.c2.jnAcc=gx}else{gy=-fg.c1.nMass*gk;if(gy>=0&&fg.Kb*gy+gj>=0){gk=gy-go;gj=-gn;fg.c1.jnAcc=gy;fg.c2.jnAcc=0}else{gx=-fg.c2.nMass*gj;if(gx>=0&&fg.Kb*gx+gk>=0){gk=-go;gj=gx-gn;fg.c1.jnAcc=0;fg.c2.jnAcc=gx}else{if(gk>=0&&gj>=0){gk=-go;gj=-gn;fg.c1.jnAcc=fg.c2.jnAcc=0}else{gk=0;gj=0}}}}fZ=gk+gj;eK=fg.nx*fZ;es=fg.ny*fZ;fg.b2.velx+=eK*fg.b2.imass;fg.b2.vely+=es*fg.b2.imass;fg.b1.velx-=eK*fg.b1.imass;fg.b1.vely-=es*fg.b1.imass;fg.b2.angvel+=(fg.rn1b*gk+fg.rn2b*gj)*fg.b2.iinertia;fg.b1.angvel-=(fg.rn1a*gk+fg.rn2a*gj)*fg.b1.iinertia}else{if(fg.radius!=0){fZ=(fg.b2.angvel-fg.b1.angvel)*fg.rMass;fw=fg.rfric*fg.c1.jnAcc;f5=fg.jrAcc;fg.jrAcc-=fZ;if(fg.jrAcc>fw){fg.jrAcc=fw}else{if(fg.jrAcc<-fw){fg.jrAcc=-fw}}fZ=fg.jrAcc-f5;fg.b2.angvel+=fZ*fg.b2.iinertia;fg.b1.angvel-=fZ*fg.b1.iinertia}fC=fg.k1x+fg.b2.velx-fg.c1.r2y*fg.b2.angvel-(fg.b1.velx-fg.c1.r1y*fg.b1.angvel);fA=fg.k1y+fg.b2.vely+fg.c1.r2x*fg.b2.angvel-(fg.b1.vely+fg.c1.r1x*fg.b1.angvel);fZ=(fg.c1.bounce+(fg.nx*fC+fg.ny*fA)+fg.surfacey)*fg.c1.nMass;f5=fg.c1.jnAcc;fI=f5-fZ;if(fI<0){fI=0}fZ=fI-f5;fg.c1.jnAcc=fI;eK=fg.nx*fZ;es=fg.ny*fZ;fg.b2.velx+=eK*fg.b2.imass;fg.b2.vely+=es*fg.b2.imass;fg.b1.velx-=eK*fg.b1.imass;fg.b1.vely-=es*fg.b1.imass;fg.b2.angvel+=fg.rn1b*fZ*fg.b2.iinertia;fg.b1.angvel-=fg.rn1a*fZ*fg.b1.iinertia}var fe=ey.colarb;var eJ;var eq;var e4;var fu;var ed;var eG;var gc=fe.k1x+fe.b2.velx-fe.c1.r2y*fe.b2.angvel-(fe.b1.velx-fe.c1.r1y*fe.b1.angvel);var fU=fe.k1y+fe.b2.vely+fe.c1.r2x*fe.b2.angvel-(fe.b1.vely+fe.c1.r1x*fe.b1.angvel);e4=(fU*fe.nx-gc*fe.ny+fe.surfacex)*fe.c1.tMass;fu=fe.c1.friction*fe.c1.jnAcc;ed=fe.c1.jtAcc;eG=ed-e4;if(eG>fu){eG=fu}else{if(eG<-fu){eG=-fu}}e4=eG-ed;fe.c1.jtAcc=eG;eJ=-fe.ny*e4;eq=fe.nx*e4;fe.b2.velx+=eJ*fe.b2.imass;fe.b2.vely+=eq*fe.b2.imass;fe.b1.velx-=eJ*fe.b1.imass;fe.b1.vely-=eq*fe.b1.imass;fe.b2.angvel+=fe.rt1b*e4*fe.b2.iinertia;fe.b1.angvel-=fe.rt1a*e4*fe.b1.iinertia;if(fe.hc2){var eT=fe.k2x+fe.b2.velx-fe.c2.r2y*fe.b2.angvel-(fe.b1.velx-fe.c2.r1y*fe.b1.angvel);var eO=fe.k2y+fe.b2.vely+fe.c2.r2x*fe.b2.angvel-(fe.b1.vely+fe.c2.r1x*fe.b1.angvel);e4=(eO*fe.nx-eT*fe.ny+fe.surfacex)*fe.c2.tMass;fu=fe.c2.friction*fe.c2.jnAcc;ed=fe.c2.jtAcc;eG=ed-e4;if(eG>fu){eG=fu}else{if(eG<-fu){eG=-fu}}e4=eG-ed;fe.c2.jtAcc=eG;eJ=-fe.ny*e4;eq=fe.nx*e4;fe.b2.velx+=eJ*fe.b2.imass;fe.b2.vely+=eq*fe.b2.imass;fe.b1.velx-=eJ*fe.b1.imass;fe.b1.vely-=eq*fe.b1.imass;fe.b2.angvel+=fe.rt2b*e4*fe.b2.iinertia;fe.b1.angvel-=fe.rt2a*e4*fe.b1.iinertia;gc=fe.k1x+fe.b2.velx-fe.c1.r2y*fe.b2.angvel-(fe.b1.velx-fe.c1.r1y*fe.b1.angvel);fU=fe.k1y+fe.b2.vely+fe.c1.r2x*fe.b2.angvel-(fe.b1.vely+fe.c1.r1x*fe.b1.angvel);eT=fe.k2x+fe.b2.velx-fe.c2.r2y*fe.b2.angvel-(fe.b1.velx-fe.c2.r1y*fe.b1.angvel);eO=fe.k2y+fe.b2.vely+fe.c2.r2x*fe.b2.angvel-(fe.b1.vely+fe.c2.r1x*fe.b1.angvel);var f8=fe.c1.jnAcc;var fM=fe.c2.jnAcc;var ex=gc*fe.nx+fU*fe.ny+fe.surfacey+fe.c1.bounce-(fe.Ka*f8+fe.Kb*fM);var eh=eT*fe.nx+eO*fe.ny+fe.surfacey+fe.c2.bounce-(fe.Kb*f8+fe.Kc*fM);var en=-(fe.kMassa*ex+fe.kMassb*eh);var gB=-(fe.kMassb*ex+fe.kMassc*eh);if(en>=0&&gB>=0){ex=en-f8;eh=gB-fM;fe.c1.jnAcc=en;fe.c2.jnAcc=gB}else{en=-fe.c1.nMass*ex;if(en>=0&&fe.Kb*en+eh>=0){ex=en-f8;eh=-fM;fe.c1.jnAcc=en;fe.c2.jnAcc=0}else{gB=-fe.c2.nMass*eh;if(gB>=0&&fe.Kb*gB+ex>=0){ex=-f8;eh=gB-fM;fe.c1.jnAcc=0;fe.c2.jnAcc=gB}else{if(ex>=0&&eh>=0){ex=-f8;eh=-fM;fe.c1.jnAcc=fe.c2.jnAcc=0}else{ex=0;eh=0}}}}e4=ex+eh;eJ=fe.nx*e4;eq=fe.ny*e4;fe.b2.velx+=eJ*fe.b2.imass;fe.b2.vely+=eq*fe.b2.imass;fe.b1.velx-=eJ*fe.b1.imass;fe.b1.vely-=eq*fe.b1.imass;fe.b2.angvel+=(fe.rn1b*ex+fe.rn2b*eh)*fe.b2.iinertia;fe.b1.angvel-=(fe.rn1a*ex+fe.rn2a*eh)*fe.b1.iinertia}else{if(fe.radius!=0){e4=(fe.b2.angvel-fe.b1.angvel)*fe.rMass;fu=fe.rfric*fe.c1.jnAcc;ed=fe.jrAcc;fe.jrAcc-=e4;if(fe.jrAcc>fu){fe.jrAcc=fu}else{if(fe.jrAcc<-fu){fe.jrAcc=-fu}}e4=fe.jrAcc-ed;fe.b2.angvel+=e4*fe.b2.iinertia;fe.b1.angvel-=e4*fe.b1.iinertia}gc=fe.k1x+fe.b2.velx-fe.c1.r2y*fe.b2.angvel-(fe.b1.velx-fe.c1.r1y*fe.b1.angvel);fU=fe.k1y+fe.b2.vely+fe.c1.r2x*fe.b2.angvel-(fe.b1.vely+fe.c1.r1x*fe.b1.angvel);e4=(fe.c1.bounce+(fe.nx*gc+fe.ny*fU)+fe.surfacey)*fe.c1.nMass;ed=fe.c1.jnAcc;eG=ed-e4;if(eG<0){eG=0}e4=eG-ed;fe.c1.jnAcc=eG;eJ=fe.nx*e4;eq=fe.ny*e4;fe.b2.velx+=eJ*fe.b2.imass;fe.b2.vely+=eq*fe.b2.imass;fe.b1.velx-=eJ*fe.b1.imass;fe.b1.vely-=eq*fe.b1.imass;fe.b2.angvel+=fe.rn1b*e4*fe.b2.iinertia;fe.b1.angvel-=fe.rn1a*e4*fe.b1.iinertia}var fd=ey.colarb;var eI;var ep;var eZ;var fr;var ec;var eE;var gb=fd.k1x+fd.b2.velx-fd.c1.r2y*fd.b2.angvel-(fd.b1.velx-fd.c1.r1y*fd.b1.angvel);var fS=fd.k1y+fd.b2.vely+fd.c1.r2x*fd.b2.angvel-(fd.b1.vely+fd.c1.r1x*fd.b1.angvel);eZ=(fS*fd.nx-gb*fd.ny+fd.surfacex)*fd.c1.tMass;fr=fd.c1.friction*fd.c1.jnAcc;ec=fd.c1.jtAcc;eE=ec-eZ;if(eE>fr){eE=fr}else{if(eE<-fr){eE=-fr}}eZ=eE-ec;fd.c1.jtAcc=eE;eI=-fd.ny*eZ;ep=fd.nx*eZ;fd.b2.velx+=eI*fd.b2.imass;fd.b2.vely+=ep*fd.b2.imass;fd.b1.velx-=eI*fd.b1.imass;fd.b1.vely-=ep*fd.b1.imass;fd.b2.angvel+=fd.rt1b*eZ*fd.b2.iinertia;fd.b1.angvel-=fd.rt1a*eZ*fd.b1.iinertia;if(fd.hc2){var eS=fd.k2x+fd.b2.velx-fd.c2.r2y*fd.b2.angvel-(fd.b1.velx-fd.c2.r1y*fd.b1.angvel);var eN=fd.k2y+fd.b2.vely+fd.c2.r2x*fd.b2.angvel-(fd.b1.vely+fd.c2.r1x*fd.b1.angvel);eZ=(eN*fd.nx-eS*fd.ny+fd.surfacex)*fd.c2.tMass;fr=fd.c2.friction*fd.c2.jnAcc;ec=fd.c2.jtAcc;eE=ec-eZ;if(eE>fr){eE=fr}else{if(eE<-fr){eE=-fr}}eZ=eE-ec;fd.c2.jtAcc=eE;eI=-fd.ny*eZ;ep=fd.nx*eZ;fd.b2.velx+=eI*fd.b2.imass;fd.b2.vely+=ep*fd.b2.imass;fd.b1.velx-=eI*fd.b1.imass;fd.b1.vely-=ep*fd.b1.imass;fd.b2.angvel+=fd.rt2b*eZ*fd.b2.iinertia;fd.b1.angvel-=fd.rt2a*eZ*fd.b1.iinertia;gb=fd.k1x+fd.b2.velx-fd.c1.r2y*fd.b2.angvel-(fd.b1.velx-fd.c1.r1y*fd.b1.angvel);fS=fd.k1y+fd.b2.vely+fd.c1.r2x*fd.b2.angvel-(fd.b1.vely+fd.c1.r1x*fd.b1.angvel);eS=fd.k2x+fd.b2.velx-fd.c2.r2y*fd.b2.angvel-(fd.b1.velx-fd.c2.r1y*fd.b1.angvel);eN=fd.k2y+fd.b2.vely+fd.c2.r2x*fd.b2.angvel-(fd.b1.vely+fd.c2.r1x*fd.b1.angvel);var f7=fd.c1.jnAcc;var fJ=fd.c2.jnAcc;var ew=gb*fd.nx+fS*fd.ny+fd.surfacey+fd.c1.bounce-(fd.Ka*f7+fd.Kb*fJ);var ef=eS*fd.nx+eN*fd.ny+fd.surfacey+fd.c2.bounce-(fd.Kb*f7+fd.Kc*fJ);var el=-(fd.kMassa*ew+fd.kMassb*ef);var gA=-(fd.kMassb*ew+fd.kMassc*ef);if(el>=0&&gA>=0){ew=el-f7;ef=gA-fJ;fd.c1.jnAcc=el;fd.c2.jnAcc=gA}else{el=-fd.c1.nMass*ew;if(el>=0&&fd.Kb*el+ef>=0){ew=el-f7;ef=-fJ;fd.c1.jnAcc=el;fd.c2.jnAcc=0}else{gA=-fd.c2.nMass*ef;if(gA>=0&&fd.Kb*gA+ew>=0){ew=-f7;ef=gA-fJ;fd.c1.jnAcc=0;fd.c2.jnAcc=gA}else{if(ew>=0&&ef>=0){ew=-f7;ef=-fJ;fd.c1.jnAcc=fd.c2.jnAcc=0}else{ew=0;ef=0}}}}eZ=ew+ef;eI=fd.nx*eZ;ep=fd.ny*eZ;fd.b2.velx+=eI*fd.b2.imass;fd.b2.vely+=ep*fd.b2.imass;fd.b1.velx-=eI*fd.b1.imass;fd.b1.vely-=ep*fd.b1.imass;fd.b2.angvel+=(fd.rn1b*ew+fd.rn2b*ef)*fd.b2.iinertia;fd.b1.angvel-=(fd.rn1a*ew+fd.rn2a*ef)*fd.b1.iinertia}else{if(fd.radius!=0){eZ=(fd.b2.angvel-fd.b1.angvel)*fd.rMass;fr=fd.rfric*fd.c1.jnAcc;ec=fd.jrAcc;fd.jrAcc-=eZ;if(fd.jrAcc>fr){fd.jrAcc=fr}else{if(fd.jrAcc<-fr){fd.jrAcc=-fr}}eZ=fd.jrAcc-ec;fd.b2.angvel+=eZ*fd.b2.iinertia;fd.b1.angvel-=eZ*fd.b1.iinertia}gb=fd.k1x+fd.b2.velx-fd.c1.r2y*fd.b2.angvel-(fd.b1.velx-fd.c1.r1y*fd.b1.angvel);fS=fd.k1y+fd.b2.vely+fd.c1.r2x*fd.b2.angvel-(fd.b1.vely+fd.c1.r1x*fd.b1.angvel);eZ=(fd.c1.bounce+(fd.nx*gb+fd.ny*fS)+fd.surfacey)*fd.c1.nMass;ec=fd.c1.jnAcc;eE=ec-eZ;if(eE<0){eE=0}eZ=eE-ec;fd.c1.jnAcc=eE;eI=fd.nx*eZ;ep=fd.ny*eZ;fd.b2.velx+=eI*fd.b2.imass;fd.b2.vely+=ep*fd.b2.imass;fd.b1.velx-=eI*fd.b1.imass;fd.b1.vely-=ep*fd.b1.imass;fd.b2.angvel+=fd.rn1b*eZ*fd.b2.iinertia;fd.b1.angvel-=fd.rn1a*eZ*fd.b1.iinertia}var fc=ey.colarb;var eH;var eo;var eX;var fp;var eb;var eC;var ga=fc.k1x+fc.b2.velx-fc.c1.r2y*fc.b2.angvel-(fc.b1.velx-fc.c1.r1y*fc.b1.angvel);var fP=fc.k1y+fc.b2.vely+fc.c1.r2x*fc.b2.angvel-(fc.b1.vely+fc.c1.r1x*fc.b1.angvel);eX=(fP*fc.nx-ga*fc.ny+fc.surfacex)*fc.c1.tMass;fp=fc.c1.friction*fc.c1.jnAcc;eb=fc.c1.jtAcc;eC=eb-eX;if(eC>fp){eC=fp}else{if(eC<-fp){eC=-fp}}eX=eC-eb;fc.c1.jtAcc=eC;eH=-fc.ny*eX;eo=fc.nx*eX;fc.b2.velx+=eH*fc.b2.imass;fc.b2.vely+=eo*fc.b2.imass;fc.b1.velx-=eH*fc.b1.imass;fc.b1.vely-=eo*fc.b1.imass;fc.b2.angvel+=fc.rt1b*eX*fc.b2.iinertia;fc.b1.angvel-=fc.rt1a*eX*fc.b1.iinertia;if(fc.hc2){var eR=fc.k2x+fc.b2.velx-fc.c2.r2y*fc.b2.angvel-(fc.b1.velx-fc.c2.r1y*fc.b1.angvel);var eL=fc.k2y+fc.b2.vely+fc.c2.r2x*fc.b2.angvel-(fc.b1.vely+fc.c2.r1x*fc.b1.angvel);eX=(eL*fc.nx-eR*fc.ny+fc.surfacex)*fc.c2.tMass;fp=fc.c2.friction*fc.c2.jnAcc;eb=fc.c2.jtAcc;eC=eb-eX;if(eC>fp){eC=fp}else{if(eC<-fp){eC=-fp}}eX=eC-eb;fc.c2.jtAcc=eC;eH=-fc.ny*eX;eo=fc.nx*eX;fc.b2.velx+=eH*fc.b2.imass;fc.b2.vely+=eo*fc.b2.imass;fc.b1.velx-=eH*fc.b1.imass;fc.b1.vely-=eo*fc.b1.imass;fc.b2.angvel+=fc.rt2b*eX*fc.b2.iinertia;fc.b1.angvel-=fc.rt2a*eX*fc.b1.iinertia;ga=fc.k1x+fc.b2.velx-fc.c1.r2y*fc.b2.angvel-(fc.b1.velx-fc.c1.r1y*fc.b1.angvel);fP=fc.k1y+fc.b2.vely+fc.c1.r2x*fc.b2.angvel-(fc.b1.vely+fc.c1.r1x*fc.b1.angvel);eR=fc.k2x+fc.b2.velx-fc.c2.r2y*fc.b2.angvel-(fc.b1.velx-fc.c2.r1y*fc.b1.angvel);eL=fc.k2y+fc.b2.vely+fc.c2.r2x*fc.b2.angvel-(fc.b1.vely+fc.c2.r1x*fc.b1.angvel);var f6=fc.c1.jnAcc;var fH=fc.c2.jnAcc;var ev=ga*fc.nx+fP*fc.ny+fc.surfacey+fc.c1.bounce-(fc.Ka*f6+fc.Kb*fH);var ee=eR*fc.nx+eL*fc.ny+fc.surfacey+fc.c2.bounce-(fc.Kb*f6+fc.Kc*fH);var ek=-(fc.kMassa*ev+fc.kMassb*ee);var gz=-(fc.kMassb*ev+fc.kMassc*ee);if(ek>=0&&gz>=0){ev=ek-f6;ee=gz-fH;fc.c1.jnAcc=ek;fc.c2.jnAcc=gz}else{ek=-fc.c1.nMass*ev;if(ek>=0&&fc.Kb*ek+ee>=0){ev=ek-f6;ee=-fH;fc.c1.jnAcc=ek;fc.c2.jnAcc=0}else{gz=-fc.c2.nMass*ee;if(gz>=0&&fc.Kb*gz+ev>=0){ev=-f6;ee=gz-fH;fc.c1.jnAcc=0;fc.c2.jnAcc=gz}else{if(ev>=0&&ee>=0){ev=-f6;ee=-fH;fc.c1.jnAcc=fc.c2.jnAcc=0}else{ev=0;ee=0}}}}eX=ev+ee;eH=fc.nx*eX;eo=fc.ny*eX;fc.b2.velx+=eH*fc.b2.imass;fc.b2.vely+=eo*fc.b2.imass;fc.b1.velx-=eH*fc.b1.imass;fc.b1.vely-=eo*fc.b1.imass;fc.b2.angvel+=(fc.rn1b*ev+fc.rn2b*ee)*fc.b2.iinertia;fc.b1.angvel-=(fc.rn1a*ev+fc.rn2a*ee)*fc.b1.iinertia}else{if(fc.radius!=0){eX=(fc.b2.angvel-fc.b1.angvel)*fc.rMass;fp=fc.rfric*fc.c1.jnAcc;eb=fc.jrAcc;fc.jrAcc-=eX;if(fc.jrAcc>fp){fc.jrAcc=fp}else{if(fc.jrAcc<-fp){fc.jrAcc=-fp}}eX=fc.jrAcc-eb;fc.b2.angvel+=eX*fc.b2.iinertia;fc.b1.angvel-=eX*fc.b1.iinertia}ga=fc.k1x+fc.b2.velx-fc.c1.r2y*fc.b2.angvel-(fc.b1.velx-fc.c1.r1y*fc.b1.angvel);fP=fc.k1y+fc.b2.vely+fc.c1.r2x*fc.b2.angvel-(fc.b1.vely+fc.c1.r1x*fc.b1.angvel);eX=(fc.c1.bounce+(fc.nx*ga+fc.ny*fP)+fc.surfacey)*fc.c1.nMass;eb=fc.c1.jnAcc;eC=eb-eX;if(eC<0){eC=0}eX=eC-eb;fc.c1.jnAcc=eC;eH=fc.nx*eX;eo=fc.ny*eX;fc.b2.velx+=eH*fc.b2.imass;fc.b2.vely+=eo*fc.b2.imass;fc.b1.velx-=eH*fc.b1.imass;fc.b1.vely-=eo*fc.b1.imass;fc.b2.angvel+=fc.rn1b*eX*fc.b2.iinertia;fc.b1.angvel-=fc.rn1a*eX*fc.b1.iinertia}ea.sweep_angvel=ea.angvel%eQ;gt.sweep_angvel=gt.angvel%eQ}}}if(ey!=null&&(ey.active&&(ey.immState&1)!=0)&&ey.type==j.COL){if(!ea.sweepFrozen&&ea.type!=3){ea.sweepFrozen=true;if(gw.failed){ea.angvel=ea.sweep_angvel=0}else{if(gw.slipped){ea.angvel=ea.sweep_angvel*=P.angularCCDSlipScale}else{ea.angvel=ea.sweep_angvel}}}if(!gt.sweepFrozen&>.type!=3){gt.sweepFrozen=true;if(gw.failed){gt.angvel=gt.sweep_angvel=0}else{if(gw.slipped){gt.angvel=gt.sweep_angvel*=P.angularCCDSlipScale}else{gt.angvel=gt.sweep_angvel}}}}var fW=gw;fW.next=ct.zpp_pool;ct.zpp_pool=fW}while(this.toiEvents.head!=null){var gD=this.toiEvents.pop_unsafe();gD.next=ct.zpp_pool;ct.zpp_pool=gD}var eV=this.kinematics.head;while(eV!=null){var gm=eV.elt;var fD=fG-gm.sweepTime;if(fD!=0){gm.sweepTime=fG;gm.posx+=gm.velx*fD;gm.posy+=gm.vely*fD;if(gm.angvel!=0){var f1=gm.sweep_angvel*fD;gm.rot+=f1;if(f1*f1>0.0001){gm.axisx=Math.sin(gm.rot);gm.axisy=Math.cos(gm.rot)}else{var gr=f1*f1;var gf=1-0.5*gr;var ei=1-gr*gr/8;var eD=(gf*gm.axisx+f1*gm.axisy)*ei;gm.axisy=(gf*gm.axisy-f1*gm.axisx)*ei;gm.axisx=eD}}}gm.sweepTime=0;eV=eV.next}var eU=this.live.head;while(eU!=null){var fl=eU.elt;if(!fl.sweepFrozen){var fB=fG-fl.sweepTime;if(fB!=0){fl.sweepTime=fG;fl.posx+=fl.velx*fB;fl.posy+=fl.vely*fB;if(fl.angvel!=0){var f0=fl.sweep_angvel*fB;fl.rot+=f0;if(f0*f0>0.0001){fl.axisx=Math.sin(fl.rot);fl.axisy=Math.cos(fl.rot)}else{var gq=f0*f0;var ge=1-0.5*gq;var eg=1-gq*gq/8;var eB=(ge*fl.axisx+f0*fl.axisy)*eg;fl.axisy=(ge*fl.axisy-f0*fl.axisx)*eg;fl.axisx=eB}}}}fl.sweepTime=0;eU=eU.next}};a3.prototype.continuousEvent=function(ed,ec,eE,ei,eH){if(ed.body.sweepFrozen&&ec.body.sweepFrozen){return ei}if(ed.body.disableCCD||ec.body.disableCCD){return ei}var eF;if(!(ei!=null&&ei.colarb==null)){var ek=ed.body;var ej=ec.body;var eb;eb=false;var ew=ek.constraints.head;while(ew!=null){var eg=ew.elt;if(eg.ignore&&eg.pair_exists(ek.id,ej.id)){eb=true;break}ew=ew.next}var ev;var eu;if(!eb){var ee=ed;while(ee!=null&&ee.group==null){if(ee.ishape!=null){ee=ee.ishape.body}else{if(ee.icompound!=null){ee=ee.icompound.compound}else{ee=ee.ibody.compound}}}var ea=ee==null?null:ee.group;var es;if(ea==null){es=false}else{var eh=ec;while(eh!=null&&eh.group==null){if(eh.ishape!=null){eh=eh.ishape.body}else{if(eh.icompound!=null){eh=eh.icompound.compound}else{eh=eh.ibody.compound}}}var eI=eh==null?null:eh.group;if(eI==null){es=false}else{var eG=false;while(ea!=null&&eI!=null){if(ea==eI){eG=ea.ignore;break}if(ea.depth=this.stamp&&(ej.immState&1)!=0){if(ej.b1.type==2&&ej.b1.component.sleeping){var eo=ej.b1;if(!eo.world){eo.component.waket=this.stamp+(this.midstep?0:1);if(eo.type==3){eo.kinematicDelaySleep=true}if(eo.component.sleeping){this.really_wake(eo,false)}}}if(ej.b2.type==2&&ej.b2.component.sleeping){var en=ej.b2;if(!en.world){en.component.waket=this.stamp+(this.midstep?0:1);if(en.type==3){en.kinematicDelaySleep=true}if(en.component.sleeping){this.really_wake(en,false)}}}}el=el.next}if(!eb&&em.type==2){this.bodyCbWake(em)}if(!eb&&!this.bphase.is_sweep&&em.type!=1){var ek=em.shapes.head;while(ek!=null){var ea=ek.elt;if(ea.node!=null){this.bphase.sync(ea)}ek=ek.next}}}else{this.wakeIsland(em.component.island)}};a3.prototype.wake_constraint=function(ea,ec){if(ec==null){ec=false}if(ea.active){ea.component.waket=this.stamp+(this.midstep?0:1);if(ea.component.sleeping){if(ea.component.island==null){ea.component.sleeping=false;var ee=this.live_constraints;var ed;if(cx.zpp_pool==null){ed=new cx()}else{ed=cx.zpp_pool;cx.zpp_pool=ed.next;ed.next=null}ed.elt=ea;var eb=ed;eb.next=ee.head;ee.head=eb;ee.modified=true;ee.length++;ea.wake_connected();if(!ec){this.constraintCbWake(ea)}}else{this.wakeIsland(ea.component.island)}return true}else{return false}}else{return false}};a3.prototype.doForests=function(em){var eo=this.c_arbiters_false.head;while(eo!=null){var eJ=eo.elt;if(!eJ.cleared&&eJ.up_stamp==this.stamp&&(eJ.immState&1)!=0){if(eJ.b1.type==2&&eJ.b2.type==2){var eL;if(eJ.b1.component==eJ.b1.component.parent){eL=eJ.b1.component}else{var ed=eJ.b1.component;var eD=null;while(ed!=ed.parent){var fa=ed.parent;ed.parent=eD;eD=ed;ed=fa}while(eD!=null){var fc=eD.parent;eD.parent=ed;eD=fc}eL=ed}var eu;if(eJ.b2.component==eJ.b2.component.parent){eu=eJ.b2.component}else{var ej=eJ.b2.component;var eI=null;while(ej!=ej.parent){var fb=ej.parent;ej.parent=eI;eI=ej;ej=fb}while(eI!=null){var e9=eI.parent;eI.parent=ej;eI=e9}eu=ej}if(eL!=eu){if(eL.rankeu.rank){eu.parent=eL}else{eu.parent=eL;eL.rank++}}}}}eo=eo.next}var eA=this.f_arbiters.head;while(eA!=null){var ek=eA.elt;if(!ek.cleared&&ek.up_stamp==this.stamp&&(ek.immState&1)!=0){if(ek.b1.type==2&&ek.b2.type==2){var eB;if(ek.b1.component==ek.b1.component.parent){eB=ek.b1.component}else{var eh=ek.b1.component;var eH=null;while(eh!=eh.parent){var e8=eh.parent;eh.parent=eH;eH=eh;eh=e8}while(eH!=null){var e7=eH.parent;eH.parent=eh;eH=e7}eB=eh}var et;if(ek.b2.component==ek.b2.component.parent){et=ek.b2.component}else{var eg=ek.b2.component;var eG=null;while(eg!=eg.parent){var e6=eg.parent;eg.parent=eG;eG=eg;eg=e6}while(eG!=null){var e5=eG.parent;eG.parent=eg;eG=e5}et=eg}if(eB!=et){if(eB.ranket.rank){et.parent=eB}else{et.parent=eB;eB.rank++}}}}}eA=eA.next}var ez=this.live_constraints.head;while(ez!=null){ez.elt.forest();ez=ez.next}while(this.live.head!=null){var ei=this.live;var eK=ei.head.elt;ei.pop();var eX=eK.component;var eF;if(eX==eX.parent){eF=eX}else{var ef=eX;var eE=null;while(ef!=ef.parent){var e3=ef.parent;ef.parent=eE;eE=ef;ef=e3}while(eE!=null){var e2=eE.parent;eE.parent=ef;eE=e2}eF=ef}if(eF.island==null){if(cW.zpp_pool==null){eF.island=new cW()}else{eF.island=cW.zpp_pool;cW.zpp_pool=eF.island.next;eF.island.next=null}eF.island.waket=0;var e1=this.islands;var e4=eF.island;e4._inuse=true;e4.next=e1.next;e1.next=e4;e1.modified=true;e1.length++;eF.island.sleep=true}eX.island=eF.island;var e0=eX.island.comps;var eW;if(dv.zpp_pool==null){eW=new dv()}else{eW=dv.zpp_pool;dv.zpp_pool=eW.next;eW.next=null}eW.elt=eX;var en=eW;en.next=e0.head;e0.head=en;e0.modified=true;e0.length++;var ey=eK.atRest(em);eX.island.sleep=eX.island.sleep&&ey;if(eX.waket>eX.island.waket){eX.island.waket=eX.waket}}while(this.live_constraints.head!=null){var eZ=this.live_constraints;var eU=eZ.head.elt;eZ.pop();var ev=eU.component;var el;if(ev==ev.parent){el=ev}else{var ee=ev;var eC=null;while(ee!=ee.parent){var eq=ee.parent;ee.parent=eC;eC=ee;ee=eq}while(eC!=null){var ep=eC.parent;eC.parent=ee;eC=ep}el=ee}ev.island=el.island;var eY=ev.island.comps;var eS;if(dv.zpp_pool==null){eS=new dv()}else{eS=dv.zpp_pool;dv.zpp_pool=eS.next;eS.next=null}eS.elt=ev;var ec=eS;ec.next=eY.head;eY.head=ec;eY.modified=true;eY.length++;if(ev.waket>ev.island.waket){ev.island.waket=ev.waket}}while(this.islands.next!=null){var eV=this.islands;var eQ=eV.next;eV.pop();if(eQ.sleep){var ex=eQ.comps.head;while(ex!=null){var fd=ex.elt;if(fd.isBody){var fe=fd.body;fe.velx=0;fe.vely=0;fe.angvel=0;fd.sleeping=true;var ew=fe.shapes.head;while(ew!=null){this.bphase.sync(ew.elt);ew=ew.next}this.bodyCbSleep(fe)}else{this.constraintCbSleep(fd.constraint);fd.sleeping=true}ex=ex.next}}else{while(eQ.comps.head!=null){var eT=eQ.comps;var eO=eT.head.elt;eT.pop();eO.waket=eQ.waket;if(eO.isBody){var eR=this.live;var es=eO.body;var eN;if(bE.zpp_pool==null){eN=new bE()}else{eN=bE.zpp_pool;bE.zpp_pool=eN.next;eN.next=null}eN.elt=es;var eb=eN;eb.next=eR.head;eR.head=eb;eR.modified=true;eR.length++}else{var eP=this.live_constraints;var er=eO.constraint;var eM;if(cx.zpp_pool==null){eM=new cx()}else{eM=cx.zpp_pool;cx.zpp_pool=eM.next;eM.next=null}eM.elt=er;var ea=eM;ea.next=eP.head;eP.head=ea;eP.modified=true;eP.length++}eO.sleeping=false;eO.island=null;eO.parent=eO;eO.rank=0}eQ.next=cW.zpp_pool;cW.zpp_pool=eQ}}};a3.prototype.sleepArbiters=function(){var ep=null;var eo=this.c_arbiters_true;var eg=eo.head;var ed=this.c_arbiters_false!=null;if(ed&&eg==null){ed=false;eg=this.c_arbiters_false.head;eo=this.c_arbiters_false;ep=null}while(eg!=null){var en=eg.elt;if(en.b1.component.sleeping&&en.b2.component.sleeping){en.sleep_stamp=this.stamp;en.sleeping=true;var ea;var ev;if(ep==null){ea=eo.head;ev=ea.next;eo.head=ev;if(eo.head==null){eo.pushmod=true}}else{ea=ep.next;ev=ea.next;ep.next=ev;if(ev==null){eo.pushmod=true}}var eq=ea;eq.elt=null;eq.next=bi.zpp_pool;bi.zpp_pool=eq;eo.modified=true;eo.length--;eo.pushmod=true;eg=ev;if(ed&&eg==null){ed=false;eg=this.c_arbiters_false.head;eo=this.c_arbiters_false;ep=null}continue}ep=eg;eg=eg.next;if(ed&&eg==null){ed=false;eg=this.c_arbiters_false.head;eo=this.c_arbiters_false;ep=null}}var ec=null;var ef=this.f_arbiters;var em=ef.head;while(em!=null){var eu=em.elt;if(eu.b1.component.sleeping&&eu.b2.component.sleeping){eu.sleep_stamp=this.stamp;eu.sleeping=true;var ej;var ek;if(ec==null){ej=ef.head;ek=ej.next;ef.head=ek;if(ef.head==null){ef.pushmod=true}}else{ej=ec.next;ek=ej.next;ec.next=ek;if(ek==null){ef.pushmod=true}}var es=ej;es.elt=null;es.next=bb.zpp_pool;bb.zpp_pool=es;ef.modified=true;ef.length--;ef.pushmod=true;em=ek;continue}ec=em;em=em.next}var eb=null;var ee=this.s_arbiters;var el=ee.head;while(el!=null){var et=el.elt;if(et.b1.component.sleeping&&et.b2.component.sleeping){et.sleep_stamp=this.stamp;et.sleeping=true;var eh;var ei;if(eb==null){eh=ee.head;ei=eh.next;ee.head=ei;if(ee.head==null){ee.pushmod=true}}else{eh=eb.next;ei=eh.next;eb.next=ei;if(ei==null){ee.pushmod=true}}var er=eh;er.elt=null;er.next=L.zpp_pool;L.zpp_pool=er;ee.modified=true;ee.length--;ee.pushmod=true;el=ei;continue}eb=el;el=el.next}};a3.prototype.static_validation=function(ek){if(ek.shapes.head!=null){if(ek.zip_aabb){ek.zip_aabb=false;ek.aabb.minx=Infinity;ek.aabb.miny=Infinity;ek.aabb.maxx=-Infinity;ek.aabb.maxy=-Infinity;var eb=ek.shapes.head;while(eb!=null){var eK=eb.elt;if(eK.zip_aabb){if(eK.body!=null){eK.zip_aabb=false;if(eK.type==0){var ea=eK.circle;if(ea.zip_worldCOM){if(ea.body!=null){ea.zip_worldCOM=false;if(ea.zip_localCOM){ea.zip_localCOM=false;if(ea.type==1){var eI=ea.polygon;if(eI.lverts.next.next==null){eI.localCOMx=eI.lverts.next.x;eI.localCOMy=eI.lverts.next.y}else{if(eI.lverts.next.next.next==null){eI.localCOMx=eI.lverts.next.x;eI.localCOMy=eI.lverts.next.y;eI.localCOMx+=eI.lverts.next.next.x;eI.localCOMy+=eI.lverts.next.next.y;eI.localCOMx*=0.5;eI.localCOMy*=0.5}else{eI.localCOMx=0;eI.localCOMy=0;var ep=0;var ej=eI.lverts.next;var eH=ej;ej=ej.next;var eF=ej;ej=ej.next;while(ej!=null){var eD=ej;ep+=eF.x*(eD.y-eH.y);var eo=eD.y*eF.x-eD.x*eF.y;eI.localCOMx+=(eF.x+eD.x)*eo;eI.localCOMy+=(eF.y+eD.y)*eo;eH=eF;eF=eD;ej=ej.next}ej=eI.lverts.next;var es=ej;ep+=eF.x*(es.y-eH.y);var eA=es.y*eF.x-es.x*eF.y;eI.localCOMx+=(eF.x+es.x)*eA;eI.localCOMy+=(eF.y+es.y)*eA;eH=eF;ej=ej.next;var eq=ej;ep+=es.x*(eq.y-eH.y);var ey=eq.y*es.x-eq.x*es.y;eI.localCOMx+=(es.x+eq.x)*ey;eI.localCOMy+=(es.y+eq.y)*ey;ep=1/(3*ep);var eJ=ep;eI.localCOMx*=eJ;eI.localCOMy*=eJ}}}if(ea.wrap_localCOM!=null){ea.wrap_localCOM.zpp_inner.x=ea.localCOMx;ea.wrap_localCOM.zpp_inner.y=ea.localCOMy}}var eG=ea.body;if(eG.zip_axis){eG.zip_axis=false;eG.axisx=Math.sin(eG.rot);eG.axisy=Math.cos(eG.rot)}ea.worldCOMx=ea.body.posx+(ea.body.axisy*ea.localCOMx-ea.body.axisx*ea.localCOMy);ea.worldCOMy=ea.body.posy+(ea.localCOMx*ea.body.axisx+ea.localCOMy*ea.body.axisy)}}var en=ea.radius;var em=ea.radius;ea.aabb.minx=ea.worldCOMx-en;ea.aabb.miny=ea.worldCOMy-em;ea.aabb.maxx=ea.worldCOMx+en;ea.aabb.maxy=ea.worldCOMy+em}else{var eE=eK.polygon;if(eE.zip_gverts){if(eE.body!=null){eE.zip_gverts=false;eE.validate_lverts();var eC=eE.body;if(eC.zip_axis){eC.zip_axis=false;eC.axisx=Math.sin(eC.rot);eC.axisy=Math.cos(eC.rot)}var er=eE.lverts.next;var ei=eE.gverts.next;while(ei!=null){var eO=ei;var eM=er;er=er.next;eO.x=eE.body.posx+(eE.body.axisy*eM.x-eE.body.axisx*eM.y);eO.y=eE.body.posy+(eM.x*eE.body.axisx+eM.y*eE.body.axisy);ei=ei.next}}}var eR=eE.gverts.next;eE.aabb.minx=eR.x;eE.aabb.miny=eR.y;eE.aabb.maxx=eR.x;eE.aabb.maxy=eR.y;var eh=eE.gverts.next.next;while(eh!=null){var eL=eh;if(eL.xeE.aabb.maxx){eE.aabb.maxx=eL.x}if(eL.yeE.aabb.maxy){eE.aabb.maxy=eL.y}eh=eh.next}}}}var ez=ek.aabb;var eB=eK.aabb;if(eB.minxez.maxx){ez.maxx=eB.maxx}if(eB.minyez.maxy){ez.maxy=eB.maxy}eb=eb.next}}}ek.validate_mass();ek.validate_inertia();var eg=ek.shapes.head;while(eg!=null){var eS=eg.elt;if(eS.type==1){var ex=eS.polygon;if(ex.zip_sanitation){ex.zip_sanitation=false;ex.splice_collinear_real()}var ew=eS.polygon;if(ew.zip_gaxi){if(ew.body!=null){ew.zip_gaxi=false;ew.validate_laxi();var eu=ew.body;if(eu.zip_axis){eu.zip_axis=false;eu.axisx=Math.sin(eu.rot);eu.axisy=Math.cos(eu.rot)}if(ew.zip_gverts){if(ew.body!=null){ew.zip_gverts=false;ew.validate_lverts();var et=ew.body;if(et.zip_axis){et.zip_axis=false;et.axisx=Math.sin(et.rot);et.axisy=Math.cos(et.rot)}var ev=ew.lverts.next;var ef=ew.gverts.next;while(ef!=null){var eN=ef;var ec=ev;ev=ev.next;eN.x=ew.body.posx+(ew.body.axisy*ec.x-ew.body.axisx*ec.y);eN.y=ew.body.posy+(ec.x*ew.body.axisx+ec.y*ew.body.axisy);ef=ef.next}}}var eP=ew.edges.head;var ee=ew.gverts.next;var ed=ee;ee=ee.next;while(ee!=null){var eT=ee;var eQ=eP.elt;eP=eP.next;eQ.gp0=ed;eQ.gp1=eT;eQ.gnormx=ew.body.axisy*eQ.lnormx-ew.body.axisx*eQ.lnormy;eQ.gnormy=eQ.lnormx*ew.body.axisx+eQ.lnormy*ew.body.axisy;eQ.gprojection=ew.body.posx*eQ.gnormx+ew.body.posy*eQ.gnormy+eQ.lprojection;if(eQ.wrap_gnorm!=null){eQ.wrap_gnorm.zpp_inner.x=eQ.gnormx;eQ.wrap_gnorm.zpp_inner.y=eQ.gnormy}eQ.tp0=eQ.gp0.y*eQ.gnormx-eQ.gp0.x*eQ.gnormy;eQ.tp1=eQ.gp1.y*eQ.gnormx-eQ.gp1.x*eQ.gnormy;ed=eT;ee=ee.next}var el=eP.elt;el.gp0=ed;el.gp1=ew.gverts.next;el.gnormx=ew.body.axisy*el.lnormx-ew.body.axisx*el.lnormy;el.gnormy=el.lnormx*ew.body.axisx+el.lnormy*ew.body.axisy;el.gprojection=ew.body.posx*el.gnormx+ew.body.posy*el.gnormy+el.lprojection;if(el.wrap_gnorm!=null){el.wrap_gnorm.zpp_inner.x=el.gnormx;el.wrap_gnorm.zpp_inner.y=el.gnormy}el.tp0=el.gp0.y*el.gnormx-el.gp0.x*el.gnormy;el.tp1=el.gp1.y*el.gnormx-el.gp1.x*el.gnormy}}}eg=eg.next}ek.sweepFrozen=true};a3.prototype.validation=function(){var eq=this.cbsets;if(!eq.cbsets.empty()){var er=eq.cbsets.parent;while(er.prev!=null){er=er.prev}while(er!=null){er.data.validate();if(er.next!=null){er=er.next;while(er.prev!=null){er=er.prev}}else{while(er.parent!=null&&er==er.parent.next){er=er.parent}er=er.parent}}}var fK=this.live.head;while(fK!=null){var ex=fK.elt;ex.sweepRadius=0;var fJ=ex.shapes.head;while(fJ!=null){var eJ=fJ.elt;if(eJ.type==1){var fc=eJ.polygon;if(fc.zip_sanitation){fc.zip_sanitation=false;fc.splice_collinear_real()}var fa=eJ.polygon;if(fa.zip_gaxi){if(fa.body!=null){fa.zip_gaxi=false;fa.validate_laxi();var e9=fa.body;if(e9.zip_axis){e9.zip_axis=false;e9.axisx=Math.sin(e9.rot);e9.axisy=Math.cos(e9.rot)}if(fa.zip_gverts){if(fa.body!=null){fa.zip_gverts=false;fa.validate_lverts();var e4=fa.body;if(e4.zip_axis){e4.zip_axis=false;e4.axisx=Math.sin(e4.rot);e4.axisy=Math.cos(e4.rot)}var fU=fa.lverts.next;var fI=fa.gverts.next;while(fI!=null){var fj=fI;var e8=fU;fU=fU.next;fj.x=fa.body.posx+(fa.body.axisy*e8.x-fa.body.axisx*e8.y);fj.y=fa.body.posy+(e8.x*fa.body.axisx+e8.y*fa.body.axisy);fI=fI.next}}}var eB=fa.edges.head;var fH=fa.gverts.next;var eH=fH;fH=fH.next;while(fH!=null){var eG=fH;var fm=eB.elt;eB=eB.next;fm.gp0=eH;fm.gp1=eG;fm.gnormx=fa.body.axisy*fm.lnormx-fa.body.axisx*fm.lnormy;fm.gnormy=fm.lnormx*fa.body.axisx+fm.lnormy*fa.body.axisy;fm.gprojection=fa.body.posx*fm.gnormx+fa.body.posy*fm.gnormy+fm.lprojection;if(fm.wrap_gnorm!=null){fm.wrap_gnorm.zpp_inner.x=fm.gnormx;fm.wrap_gnorm.zpp_inner.y=fm.gnormy}fm.tp0=fm.gp0.y*fm.gnormx-fm.gp0.x*fm.gnormy;fm.tp1=fm.gp1.y*fm.gnormx-fm.gp1.x*fm.gnormy;eH=eG;fH=fH.next}var eD=eB.elt;eD.gp0=eH;eD.gp1=fa.gverts.next;eD.gnormx=fa.body.axisy*eD.lnormx-fa.body.axisx*eD.lnormy;eD.gnormy=eD.lnormx*fa.body.axisx+eD.lnormy*fa.body.axisy;eD.gprojection=fa.body.posx*eD.gnormx+fa.body.posy*eD.gnormy+eD.lprojection;if(eD.wrap_gnorm!=null){eD.wrap_gnorm.zpp_inner.x=eD.gnormx;eD.wrap_gnorm.zpp_inner.y=eD.gnormy}eD.tp0=eD.gp0.y*eD.gnormx-eD.gp0.x*eD.gnormy;eD.tp1=eD.gp1.y*eD.gnormx-eD.gp1.x*eD.gnormy}}}eJ.validate_sweepRadius();if(eJ.sweepRadius>ex.sweepRadius){ex.sweepRadius=eJ.sweepRadius}fJ=fJ.next}ex.validate_mass();ex.validate_inertia();if(ex.shapes.head!=null){if(ex.zip_aabb){ex.zip_aabb=false;ex.aabb.minx=Infinity;ex.aabb.miny=Infinity;ex.aabb.maxx=-Infinity;ex.aabb.maxy=-Infinity;var fF=ex.shapes.head;while(fF!=null){var ek=fF.elt;if(ek.zip_aabb){if(ek.body!=null){ek.zip_aabb=false;if(ek.type==0){var eY=ek.circle;if(eY.zip_worldCOM){if(eY.body!=null){eY.zip_worldCOM=false;if(eY.zip_localCOM){eY.zip_localCOM=false;if(eY.type==1){var eV=eY.polygon;if(eV.lverts.next.next==null){eV.localCOMx=eV.lverts.next.x;eV.localCOMy=eV.lverts.next.y}else{if(eV.lverts.next.next.next==null){eV.localCOMx=eV.lverts.next.x;eV.localCOMy=eV.lverts.next.y;eV.localCOMx+=eV.lverts.next.next.x;eV.localCOMy+=eV.lverts.next.next.y;eV.localCOMx*=0.5;eV.localCOMy*=0.5}else{eV.localCOMx=0;eV.localCOMy=0;var ee=0;var fD=eV.lverts.next;var fQ=fD;fD=fD.next;var fG=fD;fD=fD.next;while(fD!=null){var eF=fD;ee+=fG.x*(eF.y-fQ.y);var eK=eF.y*fG.x-eF.x*fG.y;eV.localCOMx+=(fG.x+eF.x)*eK;eV.localCOMy+=(fG.y+eF.y)*eK;fQ=fG;fG=eF;fD=fD.next}fD=eV.lverts.next;var e5=fD;ee+=fG.x*(e5.y-fQ.y);var el=e5.y*fG.x-e5.x*fG.y;eV.localCOMx+=(fG.x+e5.x)*el;eV.localCOMy+=(fG.y+e5.y)*el;fQ=fG;fD=fD.next;var eZ=fD;ee+=e5.x*(eZ.y-fQ.y);var ej=eZ.y*e5.x-eZ.x*e5.y;eV.localCOMx+=(e5.x+eZ.x)*ej;eV.localCOMy+=(e5.y+eZ.y)*ej;ee=1/(3*ee);var eI=ee;eV.localCOMx*=eI;eV.localCOMy*=eI}}}if(eY.wrap_localCOM!=null){eY.wrap_localCOM.zpp_inner.x=eY.localCOMx;eY.wrap_localCOM.zpp_inner.y=eY.localCOMy}}var eS=eY.body;if(eS.zip_axis){eS.zip_axis=false;eS.axisx=Math.sin(eS.rot);eS.axisy=Math.cos(eS.rot)}eY.worldCOMx=eY.body.posx+(eY.body.axisy*eY.localCOMx-eY.body.axisx*eY.localCOMy);eY.worldCOMy=eY.body.posy+(eY.localCOMx*eY.body.axisx+eY.localCOMy*eY.body.axisy)}}var fS=eY.radius;var fR=eY.radius;eY.aabb.minx=eY.worldCOMx-fS;eY.aabb.miny=eY.worldCOMy-fR;eY.aabb.maxx=eY.worldCOMx+fS;eY.aabb.maxy=eY.worldCOMy+fR}else{var eO=ek.polygon;if(eO.zip_gverts){if(eO.body!=null){eO.zip_gverts=false;eO.validate_lverts();var eL=eO.body;if(eL.zip_axis){eL.zip_axis=false;eL.axisx=Math.sin(eL.rot);eL.axisy=Math.cos(eL.rot)}var ey=eO.lverts.next;var fB=eO.gverts.next;while(fB!=null){var ec=fB;var ep=ey;ey=ey.next;ec.x=eO.body.posx+(eO.body.axisy*ep.x-eO.body.axisx*ep.y);ec.y=eO.body.posy+(ep.x*eO.body.axisx+ep.y*eO.body.axisy);fB=fB.next}}}var fz=eO.gverts.next;eO.aabb.minx=fz.x;eO.aabb.miny=fz.y;eO.aabb.maxx=fz.x;eO.aabb.maxy=fz.y;var fA=eO.gverts.next.next;while(fA!=null){var eR=fA;if(eR.xeO.aabb.maxx){eO.aabb.maxx=eR.x}if(eR.yeO.aabb.maxy){eO.aabb.maxy=eR.y}fA=fA.next}}}}var ft=ex.aabb;var eE=ek.aabb;if(eE.minxft.maxx){ft.maxx=eE.maxx}if(eE.minyft.maxy){ft.maxy=eE.maxy}fF=fF.next}}ex.validate_worldCOM()}ex.validate_gravMass();if(ex.zip_axis){ex.zip_axis=false;ex.axisx=Math.sin(ex.rot);ex.axisy=Math.cos(ex.rot)}if(ex.component.woken&&ex.cbSet!=null){var fy=ex.cbSet.bodylisteners.head;while(fy!=null){var fe=fy.elt;if(fe.event!=2){fy=fy.next;continue}var eW=this.push_callback(fe);eW.event=2;eW.body=ex;fy=fy.next}}ex.component.woken=false;var fw=ex.shapes.head;while(fw!=null){this.bphase.sync(fw.elt);fw=fw.next}fK=fK.next}var fg=this.kinematics.head;while(fg!=null){var em=fg.elt;em.sweepRadius=0;var ff=em.shapes.head;while(ff!=null){var ei=ff.elt;if(ei.type==1){var fs=ei.polygon;if(fs.zip_sanitation){fs.zip_sanitation=false;fs.splice_collinear_real()}var fr=ei.polygon;if(fr.zip_gaxi){if(fr.body!=null){fr.zip_gaxi=false;fr.validate_laxi();var fq=fr.body;if(fq.zip_axis){fq.zip_axis=false;fq.axisx=Math.sin(fq.rot);fq.axisy=Math.cos(fq.rot)}if(fr.zip_gverts){if(fr.body!=null){fr.zip_gverts=false;fr.validate_lverts();var fp=fr.body;if(fp.zip_axis){fp.zip_axis=false;fp.axisx=Math.sin(fp.rot);fp.axisy=Math.cos(fp.rot)}var ew=fr.lverts.next;var fd=fr.gverts.next;while(fd!=null){var eb=fd;var eo=ew;ew=ew.next;eb.x=fr.body.posx+(fr.body.axisy*eo.x-fr.body.axisx*eo.y);eb.y=fr.body.posy+(eo.x*fr.body.axisx+eo.y*fr.body.axisy);fd=fd.next}}}var fh=fr.edges.head;var fb=fr.gverts.next;var fP=fb;fb=fb.next;while(fb!=null){var fE=fb;var eC=fh.elt;fh=fh.next;eC.gp0=fP;eC.gp1=fE;eC.gnormx=fr.body.axisy*eC.lnormx-fr.body.axisx*eC.lnormy;eC.gnormy=eC.lnormx*fr.body.axisx+eC.lnormy*fr.body.axisy;eC.gprojection=fr.body.posx*eC.gnormx+fr.body.posy*eC.gnormy+eC.lprojection;if(eC.wrap_gnorm!=null){eC.wrap_gnorm.zpp_inner.x=eC.gnormx;eC.wrap_gnorm.zpp_inner.y=eC.gnormy}eC.tp0=eC.gp0.y*eC.gnormx-eC.gp0.x*eC.gnormy;eC.tp1=eC.gp1.y*eC.gnormx-eC.gp1.x*eC.gnormy;fP=fE;fb=fb.next}var ez=fh.elt;ez.gp0=fP;ez.gp1=fr.gverts.next;ez.gnormx=fr.body.axisy*ez.lnormx-fr.body.axisx*ez.lnormy;ez.gnormy=ez.lnormx*fr.body.axisx+ez.lnormy*fr.body.axisy;ez.gprojection=fr.body.posx*ez.gnormx+fr.body.posy*ez.gnormy+ez.lprojection;if(ez.wrap_gnorm!=null){ez.wrap_gnorm.zpp_inner.x=ez.gnormx;ez.wrap_gnorm.zpp_inner.y=ez.gnormy}ez.tp0=ez.gp0.y*ez.gnormx-ez.gp0.x*ez.gnormy;ez.tp1=ez.gp1.y*ez.gnormx-ez.gp1.x*ez.gnormy}}}ei.validate_sweepRadius();if(ei.sweepRadius>em.sweepRadius){em.sweepRadius=ei.sweepRadius}ff=ff.next}em.validate_mass();em.validate_inertia();if(em.shapes.head!=null){if(em.zip_aabb){em.zip_aabb=false;em.aabb.minx=Infinity;em.aabb.miny=Infinity;em.aabb.maxx=-Infinity;em.aabb.maxy=-Infinity;var e7=em.shapes.head;while(e7!=null){var eh=e7.elt;if(eh.zip_aabb){if(eh.body!=null){eh.zip_aabb=false;if(eh.type==0){var fo=eh.circle;if(fo.zip_worldCOM){if(fo.body!=null){fo.zip_worldCOM=false;if(fo.zip_localCOM){fo.zip_localCOM=false;if(fo.type==1){var fn=fo.polygon;if(fn.lverts.next.next==null){fn.localCOMx=fn.lverts.next.x;fn.localCOMy=fn.lverts.next.y}else{if(fn.lverts.next.next.next==null){fn.localCOMx=fn.lverts.next.x;fn.localCOMy=fn.lverts.next.y;fn.localCOMx+=fn.lverts.next.next.x;fn.localCOMy+=fn.lverts.next.next.y;fn.localCOMx*=0.5;fn.localCOMy*=0.5}else{fn.localCOMx=0;fn.localCOMy=0;var fv=0;var e0=fn.lverts.next;var fO=e0;e0=e0.next;var fC=e0;e0=e0.next;while(e0!=null){var eU=e0;fv+=fC.x*(eU.y-fO.y);var eg=eU.y*fC.x-eU.x*fC.y;fn.localCOMx+=(fC.x+eU.x)*eg;fn.localCOMy+=(fC.y+eU.y)*eg;fO=fC;fC=eU;e0=e0.next}e0=fn.lverts.next;var eQ=e0;fv+=fC.x*(eQ.y-fO.y);var ef=eQ.y*fC.x-eQ.x*fC.y;fn.localCOMx+=(fC.x+eQ.x)*ef;fn.localCOMy+=(fC.y+eQ.y)*ef;fO=fC;e0=e0.next;var eN=e0;fv+=eQ.x*(eN.y-fO.y);var ed=eN.y*eQ.x-eN.x*eQ.y;fn.localCOMx+=(eQ.x+eN.x)*ed;fn.localCOMy+=(eQ.y+eN.y)*ed;fv=1/(3*fv);var fT=fv;fn.localCOMx*=fT;fn.localCOMy*=fT}}}if(fo.wrap_localCOM!=null){fo.wrap_localCOM.zpp_inner.x=fo.localCOMx;fo.wrap_localCOM.zpp_inner.y=fo.localCOMy}}var fl=fo.body;if(fl.zip_axis){fl.zip_axis=false;fl.axisx=Math.sin(fl.rot);fl.axisy=Math.cos(fl.rot)}fo.worldCOMx=fo.body.posx+(fo.body.axisy*fo.localCOMx-fo.body.axisx*fo.localCOMy);fo.worldCOMy=fo.body.posy+(fo.localCOMx*fo.body.axisx+fo.localCOMy*fo.body.axisy)}}var fL=fo.radius;var fu=fo.radius;fo.aabb.minx=fo.worldCOMx-fL;fo.aabb.miny=fo.worldCOMy-fu;fo.aabb.maxx=fo.worldCOMx+fL;fo.aabb.maxy=fo.worldCOMy+fu}else{var fk=eh.polygon;if(fk.zip_gverts){if(fk.body!=null){fk.zip_gverts=false;fk.validate_lverts();var fi=fk.body;if(fi.zip_axis){fi.zip_axis=false;fi.axisx=Math.sin(fi.rot);fi.axisy=Math.cos(fi.rot)}var ev=fk.lverts.next;var eX=fk.gverts.next;while(eX!=null){var ea=eX;var en=ev;ev=ev.next;ea.x=fk.body.posx+(fk.body.axisy*en.x-fk.body.axisx*en.y);ea.y=fk.body.posy+(en.x*fk.body.axisx+en.y*fk.body.axisy);eX=eX.next}}}var e6=fk.gverts.next;fk.aabb.minx=e6.x;fk.aabb.miny=e6.y;fk.aabb.maxx=e6.x;fk.aabb.maxy=e6.y;var eT=fk.gverts.next.next;while(eT!=null){var fx=eT;if(fx.xfk.aabb.maxx){fk.aabb.maxx=fx.x}if(fx.yfk.aabb.maxy){fk.aabb.maxy=fx.y}eT=eT.next}}}}var eA=em.aabb;var es=eh.aabb;if(es.minxeA.maxx){eA.maxx=es.maxx}if(es.minyeA.maxy){eA.maxy=es.maxy}e7=e7.next}}em.validate_worldCOM()}em.validate_gravMass();if(em.zip_axis){em.zip_axis=false;em.axisx=Math.sin(em.rot);em.axisy=Math.cos(em.rot)}var eP=em.shapes.head;while(eP!=null){this.bphase.sync(eP.elt);eP=eP.next}fg=fg.next}var eM=this.live_constraints.head;while(eM!=null){var eu=eM.elt;if(eu.active){if(eu.component.woken&&eu.cbSet!=null){var et=eu.cbSet.conlisteners.head;while(et!=null){var fM=et.elt;if(fM.event!=2){et=et.next;continue}var fN=this.push_callback(fM);fN.event=2;fN.constraint=eu;et=et.next}}eu.component.woken=false}eM=eM.next}};a3.prototype.updateVel=function(ed){var ee=1-ed*this.global_lin_drag;var ec=1-ed*this.global_ang_drag;var eb=this.live.head;while(eb!=null){var eg=eb.elt;if(eg.smass!=0){var ef=ed*eg.imass;eg.velx=ee*eg.velx+(eg.forcex+this.gravityx*eg.gravMass)*ef;eg.vely=ee*eg.vely+(eg.forcey+this.gravityy*eg.gravMass)*ef}if(eg.sinertia!=0){var ea=0;var eh=0;ea=eg.worldCOMx-eg.posx;eh=eg.worldCOMy-eg.posy;eg.angvel=ec*eg.angvel+(eg.torque+(this.gravityy*ea-this.gravityx*eh)*eg.gravMass)*ed*eg.iinertia}eb=eb.next}};a3.prototype.updatePos=function(ez){var el=2*Math.PI/ez;var fy=this.live.head;while(fy!=null){var eL=fy.elt;eL.pre_posx=eL.posx;eL.pre_posy=eL.posy;eL.pre_rot=eL.rot;eL.sweepTime=0;eL.sweep_angvel=eL.angvel%el;var en=ez-eL.sweepTime;if(en!=0){eL.sweepTime=ez;eL.posx+=eL.velx*en;eL.posy+=eL.vely*en;if(eL.angvel!=0){var eA=eL.sweep_angvel*en;eL.rot+=eA;if(eA*eA>0.0001){eL.axisx=Math.sin(eL.rot);eL.axisy=Math.cos(eL.rot)}else{var fd=eA*eA;var eT=1-0.5*fd;var e1=1-fd*fd/8;var fe=(eT*eL.axisx+eA*eL.axisy)*e1;eL.axisy=(eT*eL.axisy-eA*eL.axisx)*e1;eL.axisx=fe}}}if(!eL.disableCCD){var eN=P.staticCCDLinearThreshold*eL.sweepRadius;var fV=P.staticCCDAngularThreshold;if((eL.velx*eL.velx+eL.vely*eL.vely)*ez*ez>eN*eN||eL.angvel*eL.angvel*ez*ez>fV*fV||eL.type==3){var eW=eL.sweep_angvel;if(eW<0){eW=-eW}var fD=1/eW;var fw=eL.shapes.head;while(fw!=null){var eQ=fw.elt;var ep=eQ.aabb;var eq=ep.minx;var eo=ep.miny;var fA=ep.maxx;var fz=ep.maxy;var ex=eW*ez*eQ.sweepCoef*0.008333333333333333|0;if(ex>8){ex=8}var eU=eW*ez/ex;var fG=ez-eL.sweepTime;if(fG!=0){eL.sweepTime=ez;eL.posx+=eL.velx*fG;eL.posy+=eL.vely*fG;if(eL.angvel!=0){var ew=eL.sweep_angvel*fG;eL.rot+=ew;if(ew*ew>0.0001){eL.axisx=Math.sin(eL.rot);eL.axisy=Math.cos(eL.rot)}else{var fb=ew*ew;var fn=1-0.5*fb;var em=1-fb*fb/8;var fO=(fn*eL.axisx+ew*eL.axisy)*em;eL.axisy=(fn*eL.axisy-ew*eL.axisx)*em;eL.axisx=fO}}}if(eQ.type==0){var eI=eQ.circle;eI.worldCOMx=eI.body.posx+(eI.body.axisy*eI.localCOMx-eI.body.axisx*eI.localCOMy);eI.worldCOMy=eI.body.posy+(eI.localCOMx*eI.body.axisx+eI.localCOMy*eI.body.axisy);eI.aabb.minx=eI.worldCOMx-eI.radius;eI.aabb.miny=eI.worldCOMy-eI.radius;eI.aabb.maxx=eI.worldCOMx+eI.radius;eI.aabb.maxy=eI.worldCOMy+eI.radius}else{var e6=eQ.polygon;var fU=e6.lverts.next;var fp=e6.gverts.next;var e2=fU;fU=fU.next;fp.x=e6.body.posx+(e6.body.axisy*e2.x-e6.body.axisx*e2.y);fp.y=e6.body.posy+(e2.x*e6.body.axisx+e2.y*e6.body.axisy);e6.aabb.minx=fp.x;e6.aabb.miny=fp.y;e6.aabb.maxx=fp.x;e6.aabb.maxy=fp.y;var fv=e6.gverts.next.next;while(fv!=null){var fm=fv;var eH=fU;fU=fU.next;fm.x=e6.body.posx+(e6.body.axisy*eH.x-e6.body.axisx*eH.y);fm.y=e6.body.posy+(eH.x*e6.body.axisx+eH.y*e6.body.axisy);if(fm.xe6.aabb.maxx){e6.aabb.maxx=fm.x}if(fm.ye6.aabb.maxy){e6.aabb.maxy=fm.y}fv=fv.next}}if(eqep.maxx){ep.maxx=fA}else{fA=ep.maxx}if(fz>ep.maxy){ep.maxy=fz}else{fz=ep.maxy}var ej=1;var eh=ex;while(ej0.0001){eL.axisx=Math.sin(eL.rot);eL.axisy=Math.cos(eL.rot)}else{var fa=ev*ev;var fl=1-0.5*fa;var ek=1-fa*fa/8;var fN=(fl*eL.axisx+ev*eL.axisy)*ek;eL.axisy=(fl*eL.axisy-ev*eL.axisx)*ek;eL.axisx=fN}}}if(eQ.type==0){var e5=eQ.circle;e5.worldCOMx=e5.body.posx+(e5.body.axisy*e5.localCOMx-e5.body.axisx*e5.localCOMy);e5.worldCOMy=e5.body.posy+(e5.localCOMx*e5.body.axisx+e5.localCOMy*e5.body.axisy);e5.aabb.minx=e5.worldCOMx-e5.radius;e5.aabb.miny=e5.worldCOMy-e5.radius;e5.aabb.maxx=e5.worldCOMx+e5.radius;e5.aabb.maxy=e5.worldCOMy+e5.radius}else{var e4=eQ.polygon;var eM=e4.lverts.next;var e3=e4.gverts.next;var eG=eM;eM=eM.next;e3.x=e4.body.posx+(e4.body.axisy*eG.x-e4.body.axisx*eG.y);e3.y=e4.body.posy+(eG.x*e4.body.axisx+eG.y*e4.body.axisy);e4.aabb.minx=e3.x;e4.aabb.miny=e3.y;e4.aabb.maxx=e3.x;e4.aabb.maxy=e3.y;var fu=e4.gverts.next.next;while(fu!=null){var fk=fu;var eF=eM;eM=eM.next;fk.x=e4.body.posx+(e4.body.axisy*eF.x-e4.body.axisx*eF.y);fk.y=e4.body.posy+(eF.x*e4.body.axisx+eF.y*e4.body.axisy);if(fk.xe4.aabb.maxx){e4.aabb.maxx=fk.x}if(fk.ye4.aabb.maxy){e4.aabb.maxy=fk.y}fu=fu.next}}if(eqep.maxx){ep.maxx=fA}else{fA=ep.maxx}if(fz>ep.maxy){ep.maxy=fz}else{fz=ep.maxy}}this.bphase.sync(eQ);fw=fw.next}eL.sweepFrozen=false;if(eL.type==2&&eL.bulletEnabled){var fS=P.bulletCCDLinearThreshold*eL.sweepRadius;var fP=P.bulletCCDAngularThreshold;if((eL.velx*eL.velx+eL.vely*eL.vely)*ez*ez>fS*fS||eL.angvel*eL.angvel*ez*ez>fP*fP){eL.bullet=true}}}else{eL.sweepFrozen=true;eL.bullet=false}}else{eL.sweepFrozen=true;eL.bullet=false}fy=fy.next}var ft=this.kinematics.head;while(ft!=null){var ey=ft.elt;ey.pre_posx=ey.posx;ey.pre_posy=ey.posy;ey.pre_rot=ey.rot;ey.sweepTime=0;ey.sweep_angvel=ey.angvel%el;var fE=ez-ey.sweepTime;if(fE!=0){ey.sweepTime=ez;ey.posx+=ey.velx*fE;ey.posy+=ey.vely*fE;if(ey.angvel!=0){var eu=ey.sweep_angvel*fE;ey.rot+=eu;if(eu*eu>0.0001){ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}else{var e9=eu*eu;var fj=1-0.5*e9;var ei=1-e9*e9/8;var fM=(fj*ey.axisx+eu*ey.axisy)*ei;ey.axisy=(fj*ey.axisy-eu*ey.axisx)*ei;ey.axisx=fM}}}if(!ey.disableCCD){var fT=P.staticCCDLinearThreshold*ey.sweepRadius;var fQ=P.staticCCDAngularThreshold;if((ey.velx*ey.velx+ey.vely*ey.vely)*ez*ez>fT*fT||ey.angvel*ey.angvel*ez*ez>fQ*fQ||ey.type==3){var fr=ey.sweep_angvel;if(fr<0){fr=-fr}var fx=1/fr;var fs=ey.shapes.head;while(fs!=null){var es=fs.elt;var eb=es.aabb;var ea=eb.minx;var fR=eb.miny;var fc=eb.maxx;var eO=eb.maxy;var ef=fr*ez*es.sweepCoef*0.008333333333333333|0;if(ef>8){ef=8}var eS=fr*ez/ef;var fC=ez-ey.sweepTime;if(fC!=0){ey.sweepTime=ez;ey.posx+=ey.velx*fC;ey.posy+=ey.vely*fC;if(ey.angvel!=0){var et=ey.sweep_angvel*fC;ey.rot+=et;if(et*et>0.0001){ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}else{var e8=et*et;var fi=1-0.5*e8;var ee=1-e8*e8/8;var fL=(fi*ey.axisx+et*ey.axisy)*ee;ey.axisy=(fi*ey.axisy-et*ey.axisx)*ee;ey.axisx=fL}}}if(es.type==0){var e0=es.circle;e0.worldCOMx=e0.body.posx+(e0.body.axisy*e0.localCOMx-e0.body.axisx*e0.localCOMy);e0.worldCOMy=e0.body.posy+(e0.localCOMx*e0.body.axisx+e0.localCOMy*e0.body.axisy);e0.aabb.minx=e0.worldCOMx-e0.radius;e0.aabb.miny=e0.worldCOMy-e0.radius;e0.aabb.maxx=e0.worldCOMx+e0.radius;e0.aabb.maxy=e0.worldCOMy+e0.radius}else{var eY=es.polygon;var eK=eY.lverts.next;var eZ=eY.gverts.next;var eE=eK;eK=eK.next;eZ.x=eY.body.posx+(eY.body.axisy*eE.x-eY.body.axisx*eE.y);eZ.y=eY.body.posy+(eE.x*eY.body.axisx+eE.y*eY.body.axisy);eY.aabb.minx=eZ.x;eY.aabb.miny=eZ.y;eY.aabb.maxx=eZ.x;eY.aabb.maxy=eZ.y;var fq=eY.gverts.next.next;while(fq!=null){var fh=fq;var eD=eK;eK=eK.next;fh.x=eY.body.posx+(eY.body.axisy*eD.x-eY.body.axisx*eD.y);fh.y=eY.body.posy+(eD.x*eY.body.axisx+eD.y*eY.body.axisy);if(fh.xeY.aabb.maxx){eY.aabb.maxx=fh.x}if(fh.yeY.aabb.maxy){eY.aabb.maxy=fh.y}fq=fq.next}}if(eaeb.maxx){eb.maxx=fc}else{fc=eb.maxx}if(eO>eb.maxy){eb.maxy=eO}else{eO=eb.maxy}var eg=1;var ed=ef;while(eg0.0001){ey.axisx=Math.sin(ey.rot);ey.axisy=Math.cos(ey.rot)}else{var e7=er*er;var fg=1-0.5*e7;var ec=1-e7*e7/8;var fK=(fg*ey.axisx+er*ey.axisy)*ec;ey.axisy=(fg*ey.axisy-er*ey.axisx)*ec;ey.axisx=fK}}}if(es.type==0){var eV=es.circle;eV.worldCOMx=eV.body.posx+(eV.body.axisy*eV.localCOMx-eV.body.axisx*eV.localCOMy);eV.worldCOMy=eV.body.posy+(eV.localCOMx*eV.body.axisx+eV.localCOMy*eV.body.axisy);eV.aabb.minx=eV.worldCOMx-eV.radius;eV.aabb.miny=eV.worldCOMy-eV.radius;eV.aabb.maxx=eV.worldCOMx+eV.radius;eV.aabb.maxy=eV.worldCOMy+eV.radius}else{var eR=es.polygon;var eJ=eR.lverts.next;var eX=eR.gverts.next;var eC=eJ;eJ=eJ.next;eX.x=eR.body.posx+(eR.body.axisy*eC.x-eR.body.axisx*eC.y);eX.y=eR.body.posy+(eC.x*eR.body.axisx+eC.y*eR.body.axisy);eR.aabb.minx=eX.x;eR.aabb.miny=eX.y;eR.aabb.maxx=eX.x;eR.aabb.maxy=eX.y;var fo=eR.gverts.next.next;while(fo!=null){var ff=fo;var eB=eJ;eJ=eJ.next;ff.x=eR.body.posx+(eR.body.axisy*eB.x-eR.body.axisx*eB.y);ff.y=eR.body.posy+(eB.x*eR.body.axisx+eB.y*eR.body.axisy);if(ff.xeR.aabb.maxx){eR.aabb.maxx=ff.x}if(ff.yeR.aabb.maxy){eR.aabb.maxy=ff.y}fo=fo.next}}if(eaeb.maxx){eb.maxx=fc}else{fc=eb.maxx}if(eO>eb.maxy){eb.maxy=eO}else{eO=eb.maxy}}this.bphase.sync(es);fs=fs.next}ey.sweepFrozen=false;if(ey.type==2&&ey.bulletEnabled){var eP=P.bulletCCDLinearThreshold*ey.sweepRadius;var fJ=P.bulletCCDAngularThreshold;if((ey.velx*ey.velx+ey.vely*ey.vely)*ez*ez>eP*eP||ey.angvel*ey.angvel*ez*ez>fJ*fJ){ey.bullet=true}}}else{ey.sweepFrozen=true;ey.bullet=false}}else{ey.sweepFrozen=true;ey.bullet=false}ft=ft.next}};a3.prototype.continuous=null;a3.prototype.presteparb=function(el,gI,g3){if(g3==null){g3=false}var hn=this;if(!el.cleared&&(el.b1.component.sleeping&&el.b2.component.sleeping)){el.sleep_stamp=this.stamp;el.sleeping=true;return true}if(!el.cleared||el.present!=0||el.intchange){var ev=!g3&&el.up_stamp==this.stamp-1&&!el.cleared&&!el.intchange;var gf=el.fresh&&!el.cleared&&!el.intchange;if(ev){el.endGenerated=this.stamp}if(gf||ev||el.cleared||el.intchange){var gs=el.ws1;var gp=el.ws2;var gH=this.mrca1;while(gH.head!=null){var fK=gH.head;gH.head=fK.next;fK.elt=null;fK.next=g.zpp_pool;g.zpp_pool=fK;if(gH.head==null){gH.pushmod=true}gH.modified=true;gH.length--}gH.pushmod=true;var fg=this.mrca2;while(fg.head!=null){var hg=fg.head;fg.head=hg.next;hg.elt=null;hg.next=g.zpp_pool;g.zpp_pool=hg;if(fg.head==null){fg.pushmod=true}fg.modified=true;fg.length--}fg.pushmod=true;if(gs.cbSet!=null){var fd=this.mrca1;var hf;if(g.zpp_pool==null){hf=new g()}else{hf=g.zpp_pool;g.zpp_pool=hf.next;hf.next=null}hf.elt=gs;var gG=hf;gG.next=fd.head;fd.head=gG;fd.modified=true;fd.length++}if(gs.body.cbSet!=null){var fc=this.mrca1;var gW=gs.body;var he;if(g.zpp_pool==null){he=new g()}else{he=g.zpp_pool;g.zpp_pool=he.next;he.next=null}he.elt=gW;var fS=he;fS.next=fc.head;fc.head=fS;fc.modified=true;fc.length++}if(gp.cbSet!=null){var fb=this.mrca2;var hd;if(g.zpp_pool==null){hd=new g()}else{hd=g.zpp_pool;g.zpp_pool=hd.next;hd.next=null}hd.elt=gp;var fQ=hd;fQ.next=fb.head;fb.head=fQ;fb.modified=true;fb.length++}if(gp.body.cbSet!=null){var e9=this.mrca2;var hJ=gp.body;var hc;if(g.zpp_pool==null){hc=new g()}else{hc=g.zpp_pool;g.zpp_pool=hc.next;hc.next=null}hc.elt=hJ;var fN=hc;fN.next=e9.head;e9.head=fN;e9.modified=true;e9.length++}var hB=gs.body.compound;var hA=gp.body.compound;while(hB!=hA){if((hB==null?0:hB.depth)<(hA==null?0:hA.depth)){if(hA.cbSet!=null){var e7=this.mrca2;var hb;if(g.zpp_pool==null){hb=new g()}else{hb=g.zpp_pool;g.zpp_pool=hb.next;hb.next=null}hb.elt=hA;var fJ=hb;fJ.next=e7.head;e7.head=fJ;e7.modified=true;e7.length++}hA=hA.compound}else{if(hB.cbSet!=null){var e6=this.mrca1;var ha;if(g.zpp_pool==null){ha=new g()}else{ha=g.zpp_pool;g.zpp_pool=ha.next;ha.next=null}ha.elt=hB;var fG=ha;fG.next=e6.head;e6.head=fG;e6.modified=true;e6.length++}hB=hB.compound}}var en=this.mrca1.head;while(en!=null){var e1=en.elt;var eO=this.mrca2.head;while(eO!=null){var e0=eO.elt;var gc=e1.cbSet;var gb=e0.cbSet;var g8=null;var eM=(gc.cbpairs.length=Infinity||fA.s2.material.elasticity>=Infinity){fA.restitution=1}else{fA.restitution=(fA.s1.material.elasticity+fA.s2.material.elasticity)/2}}if(fA.restitution<0){fA.restitution=0}if(fA.restitution>1){fA.restitution=1}}if(!fA.userdef_dyn_fric){fA.dyn_fric=Math.sqrt(fA.s1.material.dynamicFriction*fA.s2.material.dynamicFriction)}if(!fA.userdef_stat_fric){fA.stat_fric=Math.sqrt(fA.s1.material.staticFriction*fA.s2.material.staticFriction)}if(!fA.userdef_rfric){fA.rfric=Math.sqrt(fA.s1.material.rollingFriction*fA.s2.material.rollingFriction)}}if(fA.pre_dt==-1){fA.pre_dt=gI}var gS=gI/fA.pre_dt;fA.pre_dt=gI;var ef=fA.b1.smass+fA.b2.smass;fA.hc2=false;var fm=true;fA.biasCoef=fA.b1.type!=2||fA.b2.type!=2?fA.continuous?P.contactContinuousStaticBiasCoef:P.contactStaticBiasCoef:fA.continuous?P.contactContinuousBiasCoef:P.contactBiasCoef;fA.continuous=false;var hL=null;var hj=null;var ep=fA.innards.next;var eE=fA.contacts.next;while(eE!=null){var g6=eE;if(g6.stamp+P.arbiterExpirationDelay-P.elasticThreshold){gY.bounce=0}eZ=e2*fA.nx-e3*fA.ny;var ez=P.staticFrictionThreshold;if(eZ*eZ>ez*ez){gY.friction=fA.dyn_fric}else{gY.friction=fA.stat_fric}gY.jnAcc*=gS;gY.jtAcc*=gS}if(f4!=g6.active){fA.contacts.modified=true}hL=eE;hj=ep;ep=ep.next;eE=eE.next}if(fA.hc2){fA.hpc2=true;if(fA.oc1.posOnly){var fj=fA.c1;fA.c1=fA.c2;fA.c2=fj;var gX=fA.oc1;fA.oc1=fA.oc2;fA.oc2=gX;fA.hc2=false}else{if(fA.oc2.posOnly){fA.hc2=false}}if(fA.oc1.posOnly){fm=true}}else{fA.hpc2=false}fA.jrAcc*=gS;if(!fm){fA.rn1a=fA.ny*fA.c1.r1x-fA.nx*fA.c1.r1y;fA.rt1a=fA.c1.r1x*fA.nx+fA.c1.r1y*fA.ny;fA.rn1b=fA.ny*fA.c1.r2x-fA.nx*fA.c1.r2y;fA.rt1b=fA.c1.r2x*fA.nx+fA.c1.r2y*fA.ny;fA.k1x=fA.b2.kinvelx-fA.c1.r2y*fA.b2.kinangvel-(fA.b1.kinvelx-fA.c1.r1y*fA.b1.kinangvel);fA.k1y=fA.b2.kinvely+fA.c1.r2x*fA.b2.kinangvel-(fA.b1.kinvely+fA.c1.r1x*fA.b1.kinangvel)}if(fA.hc2){fA.rn2a=fA.ny*fA.c2.r1x-fA.nx*fA.c2.r1y;fA.rt2a=fA.c2.r1x*fA.nx+fA.c2.r1y*fA.ny;fA.rn2b=fA.ny*fA.c2.r2x-fA.nx*fA.c2.r2y;fA.rt2b=fA.c2.r2x*fA.nx+fA.c2.r2y*fA.ny;fA.k2x=fA.b2.kinvelx-fA.c2.r2y*fA.b2.kinangvel-(fA.b1.kinvelx-fA.c2.r1y*fA.b1.kinangvel);fA.k2y=fA.b2.kinvely+fA.c2.r2x*fA.b2.kinangvel-(fA.b1.kinvely+fA.c2.r1x*fA.b1.kinangvel);fA.kMassa=ef+fA.b1.sinertia*fA.rn1a*fA.rn1a+fA.b2.sinertia*fA.rn1b*fA.rn1b;fA.kMassb=ef+fA.b1.sinertia*fA.rn1a*fA.rn2a+fA.b2.sinertia*fA.rn1b*fA.rn2b;fA.kMassc=ef+fA.b1.sinertia*fA.rn2a*fA.rn2a+fA.b2.sinertia*fA.rn2b*fA.rn2b;if(fA.kMassa*fA.kMassa+2*fA.kMassb*fA.kMassb+fA.kMassc*fA.kMassceN){var fI=eP+eN;ek-=eF*fI;ej-=eD*fI}else{if(ePfs.ws2.worldCOMx*eY+fs.ws2.worldCOMy*eX){var fC=eP+eN;ek-=eY*fC;ej-=eX*fC}else{var fz=eP+eN;ek+=eY*fz;ej+=eX*fz}}}}else{if(fs.ws1.fluidEnabled){var gL=fs.overlap*fs.ws1.fluidProperties.density;ek-=eF*gL;ej-=eD*gL}else{if(fs.ws2.fluidEnabled){var eL=fs.overlap*fs.ws2.fluidProperties.density;ek+=ey*eL;ej+=ew*eL}}}ek*=gI;ej*=gI;fs.buoyx=ek;fs.buoyy=ej;if(fs.b1.type==2){var fx=fs.b1.imass;fs.b1.velx-=ek*fx;fs.b1.vely-=ej*fx;fs.b1.angvel-=(ej*fs.r1x-ek*fs.r1y)*fs.b1.iinertia}if(fs.b2.type==2){var fu=fs.b2.imass;fs.b2.velx+=ek*fu;fs.b2.vely+=ej*fu;fs.b2.angvel+=(ej*fs.r2x-ek*fs.r2y)*fs.b2.iinertia}if((!fs.ws1.fluidEnabled||fs.ws1.fluidProperties.viscosity==0)&&(!fs.ws2.fluidEnabled||fs.ws2.fluidProperties.viscosity==0)){fs.nodrag=true;fs.dampx=0;fs.dampy=0;fs.adamp=0}else{fs.nodrag=false;var fr=0;if(fs.ws1.fluidEnabled){fs.ws2.validate_angDrag();fr=fs.ws1.fluidProperties.viscosity*fs.ws2.angDrag*fs.overlap/fs.ws2.area}if(fs.ws2.fluidEnabled){fs.ws1.validate_angDrag();fr+=fs.ws2.fluidProperties.viscosity*fs.ws1.angDrag*fs.overlap/fs.ws1.area}if(fr!=0){var g5=fs.b1.sinertia+fs.b2.sinertia;if(g5!=0){fs.wMass=1/g5}else{fs.wMass=0}fr*=0.0004;var eQ=2*Math.PI*fr;fs.agamma=1/(gI*eQ*(2+eQ*gI));var eA=1/(1+fs.agamma);fs.agamma*=eA;fs.wMass*=eA}else{fs.wMass=0;fs.agamma=0}var eT=fs.b2.velx+fs.b2.kinvelx-fs.r2y*(fs.b2.angvel+fs.b2.kinangvel)-(fs.b1.velx+fs.b1.kinvelx-fs.r1y*(fs.b2.angvel+fs.b2.kinangvel));var eR=fs.b2.vely+fs.b2.kinvely+fs.r2x*(fs.b2.angvel+fs.b2.kinangvel)-(fs.b1.vely+fs.b1.kinvely+fs.r1x*(fs.b1.angvel+fs.b1.kinangvel));if(!(eT*eT+eR*eR0){ff*=-P.fluidVacuumDrag;ff=ff}eW-=ff*0.5*P.fluidLinearDrag;eC=eC.next}eb=eW/eB}}if(fs.ws2.fluidEnabled){var gK=-fs.ws2.fluidProperties.viscosity*fs.overlap/fs.ws1.area;if(fs.ws1.type==0){eb-=gK*fs.ws1.circle.radius*P.fluidLinearDrag/(2*fs.ws1.circle.radius*Math.PI)}else{var gq=fs.ws1.polygon;var es=0;var fB=0;var gl=gq.edges.head;while(gl!=null){var g4=gl.elt;es+=g4.length;var eV=gK*g4.length*(g4.gnormx*fs.nx+g4.gnormy*fs.ny);if(eV>0){eV*=-P.fluidVacuumDrag;eV=eV}fB-=eV*0.5*P.fluidLinearDrag;gl=gl.next}eb+=fB/es}}if(eb!=0){var gZ=fs.b1.smass+fs.b2.smass;var gP=0;var gO=0;var gN=0;gP=gZ;gO=0;gN=gZ;if(fs.b1.sinertia!=0){var hi=fs.r1x*fs.b1.sinertia;var hh=fs.r1y*fs.b1.sinertia;gP=gZ+hh*fs.r1y;gO+=-hh*fs.r1x;gN=gZ+hi*fs.r1x}if(fs.b2.sinertia!=0){var g9=fs.r2x*fs.b2.sinertia;var gM=fs.r2y*fs.b2.sinertia;gP+=gM*fs.r2y;gO+=-gM*fs.r2x;gN+=g9*fs.r2x}var g0=gP*gN-gO*gO;if(g0!=g0){gN=0;gO=gN;gP=gO}else{if(g0==0){if(gP!=0){gP=1/gP}else{gP=0}if(gN!=0){gN=1/gN}else{gN=0}gO=0}else{g0=1/g0;var fq=gN*g0;gN=gP*g0;gP=fq;gO*=-g0}}fs.vMassa=gP;fs.vMassb=gO;fs.vMassc=gN;var eU=2*Math.PI*eb;fs.lgamma=1/(gI*eU*(2+eU*gI));var ei=1/(1+fs.lgamma);fs.lgamma*=ei;fs.vMassa*=ei;fs.vMassb*=ei;fs.vMassc*=ei}else{fs.vMassa=0;fs.vMassb=0;fs.vMassc=0;fs.lgamma=0}}fs.dampx*=eg;fs.dampy*=eg;fs.adamp*=eg}}}else{if(el.colarb!=null){var fo=el.colarb;var ed=true;var hK=null;var eh=null;var ea=fo.innards.next;fo.hc2=false;var gj=fo.contacts.next;while(gj!=null){var hz=gj;if(hz.stamp+P.arbiterExpirationDelayeH){ej=eH}else{if(ej<-eH){ej=-eH}}eE=ej-eb;eG.c1.jtAcc=ej;em=-eG.ny*eE;eF=eG.nx*eE;eG.b2.velx+=em*eG.b2.imass;eG.b2.vely+=eF*eG.b2.imass;eG.b1.velx-=em*eG.b1.imass;eG.b1.vely-=eF*eG.b1.imass;eG.b2.angvel+=eG.rt1b*eE*eG.b2.iinertia;eG.b1.angvel-=eG.rt1a*eE*eG.b1.iinertia;if(eG.hc2){var eD=eG.k2x+eG.b2.velx-eG.c2.r2y*eG.b2.angvel-(eG.b1.velx-eG.c2.r1y*eG.b1.angvel);var eC=eG.k2y+eG.b2.vely+eG.c2.r2x*eG.b2.angvel-(eG.b1.vely+eG.c2.r1x*eG.b1.angvel);eE=(eC*eG.nx-eD*eG.ny+eG.surfacex)*eG.c2.tMass;eH=eG.c2.friction*eG.c2.jnAcc;eb=eG.c2.jtAcc;ej=eb-eE;if(ej>eH){ej=eH}else{if(ej<-eH){ej=-eH}}eE=ej-eb;eG.c2.jtAcc=ej;em=-eG.ny*eE;eF=eG.nx*eE;eG.b2.velx+=em*eG.b2.imass;eG.b2.vely+=eF*eG.b2.imass;eG.b1.velx-=em*eG.b1.imass;eG.b1.vely-=eF*eG.b1.imass;eG.b2.angvel+=eG.rt2b*eE*eG.b2.iinertia;eG.b1.angvel-=eG.rt2a*eE*eG.b1.iinertia;eh=eG.k1x+eG.b2.velx-eG.c1.r2y*eG.b2.angvel-(eG.b1.velx-eG.c1.r1y*eG.b1.angvel);ef=eG.k1y+eG.b2.vely+eG.c1.r2x*eG.b2.angvel-(eG.b1.vely+eG.c1.r1x*eG.b1.angvel);eD=eG.k2x+eG.b2.velx-eG.c2.r2y*eG.b2.angvel-(eG.b1.velx-eG.c2.r1y*eG.b1.angvel);eC=eG.k2y+eG.b2.vely+eG.c2.r2x*eG.b2.angvel-(eG.b1.vely+eG.c2.r1x*eG.b1.angvel);var eq=eG.c1.jnAcc;var el=eG.c2.jnAcc;var eu=eh*eG.nx+ef*eG.ny+eG.surfacey+eG.c1.bounce-(eG.Ka*eq+eG.Kb*el);var es=eD*eG.nx+eC*eG.ny+eG.surfacey+eG.c2.bounce-(eG.Kb*eq+eG.Kc*el);var ee=-(eG.kMassa*eu+eG.kMassb*es);var ed=-(eG.kMassb*eu+eG.kMassc*es);if(ee>=0&&ed>=0){eu=ee-eq;es=ed-el;eG.c1.jnAcc=ee;eG.c2.jnAcc=ed}else{ee=-eG.c1.nMass*eu;if(ee>=0&&eG.Kb*ee+es>=0){eu=ee-eq;es=-el;eG.c1.jnAcc=ee;eG.c2.jnAcc=0}else{ed=-eG.c2.nMass*es;if(ed>=0&&eG.Kb*ed+eu>=0){eu=-eq;es=ed-el;eG.c1.jnAcc=0;eG.c2.jnAcc=ed}else{if(eu>=0&&es>=0){eu=-eq;es=-el;eG.c1.jnAcc=eG.c2.jnAcc=0}else{eu=0;es=0}}}}eE=eu+es;em=eG.nx*eE;eF=eG.ny*eE;eG.b2.velx+=em*eG.b2.imass;eG.b2.vely+=eF*eG.b2.imass;eG.b1.velx-=em*eG.b1.imass;eG.b1.vely-=eF*eG.b1.imass;eG.b2.angvel+=(eG.rn1b*eu+eG.rn2b*es)*eG.b2.iinertia;eG.b1.angvel-=(eG.rn1a*eu+eG.rn2a*es)*eG.b1.iinertia}else{if(eG.radius!=0){eE=(eG.b2.angvel-eG.b1.angvel)*eG.rMass;eH=eG.rfric*eG.c1.jnAcc;eb=eG.jrAcc;eG.jrAcc-=eE;if(eG.jrAcc>eH){eG.jrAcc=eH}else{if(eG.jrAcc<-eH){eG.jrAcc=-eH}}eE=eG.jrAcc-eb;eG.b2.angvel+=eE*eG.b2.iinertia;eG.b1.angvel-=eE*eG.b1.iinertia}eh=eG.k1x+eG.b2.velx-eG.c1.r2y*eG.b2.angvel-(eG.b1.velx-eG.c1.r1y*eG.b1.angvel);ef=eG.k1y+eG.b2.vely+eG.c1.r2x*eG.b2.angvel-(eG.b1.vely+eG.c1.r1x*eG.b1.angvel);eE=(eG.c1.bounce+(eG.nx*eh+eG.ny*ef)+eG.surfacey)*eG.c1.nMass;eb=eG.c1.jnAcc;ej=eb-eE;if(ej<0){ej=0}eE=ej-eb;eG.c1.jnAcc=ej;em=eG.nx*eE;eF=eG.ny*eE;eG.b2.velx+=em*eG.b2.imass;eG.b2.vely+=eF*eG.b2.imass;eG.b1.velx-=em*eG.b1.imass;eG.b1.vely-=eF*eG.b1.imass;eG.b2.angvel+=eG.rn1b*eE*eG.b2.iinertia;eG.b1.angvel-=eG.rn1a*eE*eG.b1.iinertia}}eA=eA.next;if(ea&&eA==null){eA=this.c_arbiters_true.head;ea=false}}}};a3.prototype.iteratePos=function(fo){var eh=0;while(eh0.0001){eI.axisx=Math.sin(eI.rot);eI.axisy=Math.cos(eI.rot)}else{var fx=eB*eB;var e6=1-0.5*fx;var fa=1-fx*fx/8;var fz=(e6*eI.axisx+eB*eI.axisy)*fa;eI.axisy=(e6*eI.axisy-eB*eI.axisx)*fa;eI.axisx=fz}var gj=gl.b2.imass;gl.b2.posx+=eZ*gj;gl.b2.posy+=eY*gj;var fe=gl.b2;var ev=eO*gl.b2.iinertia*eH;fe.rot+=ev;if(ev*ev>0.0001){fe.axisx=Math.sin(fe.rot);fe.axisy=Math.cos(fe.rot)}else{var fv=ev*ev;var fL=1-0.5*fv;var ej=1-fv*fv/8;var f4=(fL*fe.axisx+ev*fe.axisy)*ej;fe.axisy=(fL*fe.axisy-ev*fe.axisx)*ej;fe.axisx=f4}}}}}else{var eX=0;var eW=0;var e0;var fU=0;var fS=0;var fM=0;var fK=0;if(gl.ptype==0){eX=gl.b1.axisy*gl.lnormx-gl.b1.axisx*gl.lnormy;eW=gl.lnormx*gl.b1.axisx+gl.lnormy*gl.b1.axisy;e0=gl.lproj+(eX*gl.b1.posx+eW*gl.b1.posy);fU=gl.b2.axisy*gl.c1.lr1x-gl.b2.axisx*gl.c1.lr1y;fS=gl.c1.lr1x*gl.b2.axisx+gl.c1.lr1y*gl.b2.axisy;fU+=gl.b2.posx;fS+=gl.b2.posy;if(gl.hpc2){fM=gl.b2.axisy*gl.c2.lr1x-gl.b2.axisx*gl.c2.lr1y;fK=gl.c2.lr1x*gl.b2.axisx+gl.c2.lr1y*gl.b2.axisy;fM+=gl.b2.posx;fK+=gl.b2.posy}}else{eX=gl.b2.axisy*gl.lnormx-gl.b2.axisx*gl.lnormy;eW=gl.lnormx*gl.b2.axisx+gl.lnormy*gl.b2.axisy;e0=gl.lproj+(eX*gl.b2.posx+eW*gl.b2.posy);fU=gl.b1.axisy*gl.c1.lr1x-gl.b1.axisx*gl.c1.lr1y;fS=gl.c1.lr1x*gl.b1.axisx+gl.c1.lr1y*gl.b1.axisy;fU+=gl.b1.posx;fS+=gl.b1.posy;if(gl.hpc2){fM=gl.b1.axisy*gl.c2.lr1x-gl.b1.axisx*gl.c2.lr1y;fK=gl.c2.lr1x*gl.b1.axisx+gl.c2.lr1y*gl.b1.axisy;fM+=gl.b1.posx;fK+=gl.b1.posy}}var eN=fU*eX+fS*eW-e0-gl.radius;eN+=P.collisionSlop;var eK=0;if(gl.hpc2){eK=fM*eX+fK*eW-e0-gl.radius;eK+=P.collisionSlop}if(eN<0||eK<0){if(gl.rev){eX=-eX;eW=-eW}var fl=0;var fi=0;fl=fU-gl.b1.posx;fi=fS-gl.b1.posy;var eL=0;var eJ=0;eL=fU-gl.b2.posx;eJ=fS-gl.b2.posy;var fu=0;var fs=0;var eV=0;var eT=0;if(gl.hpc2){fu=fM-gl.b1.posx;fs=fK-gl.b1.posy;eV=fM-gl.b2.posx;eT=fK-gl.b2.posy;var eo=eW*fl-eX*fi;var em=eW*eL-eX*eJ;var gi=eW*fu-eX*fs;var gg=eW*eV-eX*eT;var eu=gl.b1.smass+gl.b2.smass;gl.kMassa=eu+gl.b1.sinertia*eo*eo+gl.b2.sinertia*em*em;gl.kMassb=eu+gl.b1.sinertia*eo*gi+gl.b2.sinertia*em*gg;gl.kMassc=eu+gl.b1.sinertia*gi*gi+gl.b2.sinertia*gg*gg;var eU=0;var eR=0;var eP=0;eU=gl.kMassa;eR=gl.kMassb;eP=gl.kMassc;var fn=eN*gl.biasCoef;var fk=eK*gl.biasCoef;while(true){var ge=0;var gc=0;ge=fn;gc=fk;ge=-fn;gc=-fk;var f7=gl.kMassa*gl.kMassc-gl.kMassb*gl.kMassb;if(f7!=f7){gc=0;ge=gc}else{if(f7==0){if(gl.kMassa!=0){ge/=gl.kMassa}else{ge=0}if(gl.kMassc!=0){gc/=gl.kMassc}else{gc=0}}else{f7=1/f7;var gh=f7*(gl.kMassc*ge-gl.kMassb*gc);gc=f7*(gl.kMassa*gc-gl.kMassb*ge);ge=gh}}if(ge>=0&&gc>=0){var gf=(ge+gc)*gl.b1.imass;gl.b1.posx-=eX*gf;gl.b1.posy-=eW*gf;var fc=gl.b1;var et=-gl.b1.iinertia*(eo*ge+gi*gc);fc.rot+=et;if(et*et>0.0001){fc.axisx=Math.sin(fc.rot);fc.axisy=Math.cos(fc.rot)}else{var fr=et*et;var fJ=1-0.5*fr;var ei=1-fr*fr/8;var f3=(fJ*fc.axisx+et*fc.axisy)*ei;fc.axisy=(fJ*fc.axisy-et*fc.axisx)*ei;fc.axisx=f3}var gd=(ge+gc)*gl.b2.imass;gl.b2.posx+=eX*gd;gl.b2.posy+=eW*gd;var fb=gl.b2;var es=gl.b2.iinertia*(em*ge+gg*gc);fb.rot+=es;if(es*es>0.0001){fb.axisx=Math.sin(fb.rot);fb.axisy=Math.cos(fb.rot)}else{var fq=es*es;var fH=1-0.5*fq;var eg=1-fq*fq/8;var f2=(fH*fb.axisx+es*fb.axisy)*eg;fb.axisy=(fH*fb.axisy-es*fb.axisx)*eg;fb.axisx=f2}break}ge=-fn/eU;gc=0;var eC=eR*ge+fk;if(ge>=0&&eC>=0){var gb=(ge+gc)*gl.b1.imass;gl.b1.posx-=eX*gb;gl.b1.posy-=eW*gb;var e9=gl.b1;var er=-gl.b1.iinertia*(eo*ge+gi*gc);e9.rot+=er;if(er*er>0.0001){e9.axisx=Math.sin(e9.rot);e9.axisy=Math.cos(e9.rot)}else{var fp=er*er;var fG=1-0.5*fp;var ef=1-fp*fp/8;var f1=(fG*e9.axisx+er*e9.axisy)*ef;e9.axisy=(fG*e9.axisy-er*e9.axisx)*ef;e9.axisx=f1}var ga=(ge+gc)*gl.b2.imass;gl.b2.posx+=eX*ga;gl.b2.posy+=eW*ga;var e8=gl.b2;var eq=gl.b2.iinertia*(em*ge+gg*gc);e8.rot+=eq;if(eq*eq>0.0001){e8.axisx=Math.sin(e8.rot);e8.axisy=Math.cos(e8.rot)}else{var fm=eq*eq;var fF=1-0.5*fm;var ee=1-fm*fm/8;var f0=(fF*e8.axisx+eq*e8.axisy)*ee;e8.axisy=(fF*e8.axisy-eq*e8.axisx)*ee;e8.axisx=f0}break}ge=0;gc=-fk/eP;var eD=eR*gc+fn;if(gc>=0&&eD>=0){var f9=(ge+gc)*gl.b1.imass;gl.b1.posx-=eX*f9;gl.b1.posy-=eW*f9;var e7=gl.b1;var ep=-gl.b1.iinertia*(eo*ge+gi*gc);e7.rot+=ep;if(ep*ep>0.0001){e7.axisx=Math.sin(e7.rot);e7.axisy=Math.cos(e7.rot)}else{var fj=ep*ep;var fE=1-0.5*fj;var ed=1-fj*fj/8;var fZ=(fE*e7.axisx+ep*e7.axisy)*ed;e7.axisy=(fE*e7.axisy-ep*e7.axisx)*ed;e7.axisx=fZ}var f8=(ge+gc)*gl.b2.imass;gl.b2.posx+=eX*f8;gl.b2.posy+=eW*f8;var e5=gl.b2;var en=gl.b2.iinertia*(em*ge+gg*gc);e5.rot+=en;if(en*en>0.0001){e5.axisx=Math.sin(e5.rot);e5.axisy=Math.cos(e5.rot)}else{var fh=en*en;var fD=1-0.5*fh;var ec=1-fh*fh/8;var fY=(fD*e5.axisx+en*e5.axisy)*ec;e5.axisy=(fD*e5.axisy-en*e5.axisx)*ec;e5.axisx=fY}break}break}}else{var eS=eW*fl-eX*fi;var eA=eW*eL-eX*eJ;var fN=gl.b2.smass+eA*eA*gl.b2.sinertia+gl.b1.smass+eS*eS*gl.b1.sinertia;if(fN!=0){var fI=-gl.biasCoef*eN/fN;var gm=0;var fX=0;gm=eX*fI;fX=eW*fI;var ez=gl.b1.imass;gl.b1.posx-=gm*ez;gl.b1.posy-=fX*ez;var e4=gl.b1;var el=-eS*gl.b1.iinertia*fI;e4.rot+=el;if(el*el>0.0001){e4.axisx=Math.sin(e4.rot);e4.axisy=Math.cos(e4.rot)}else{var ff=el*el;var fC=1-0.5*ff;var eb=1-ff*ff/8;var fW=(fC*e4.axisx+el*e4.axisy)*eb;e4.axisy=(fC*e4.axisy-el*e4.axisx)*eb;e4.axisx=fW}var ey=gl.b2.imass;gl.b2.posx+=gm*ey;gl.b2.posy+=fX*ey;var e2=gl.b2;var ek=eA*gl.b2.iinertia*fI;e2.rot+=ek;if(ek*ek>0.0001){e2.axisx=Math.sin(e2.rot);e2.axisy=Math.cos(e2.rot)}else{var fd=ek*ek;var fA=1-0.5*fd;var ea=1-fd*fd/8;var fV=(fA*e2.axisx+ek*e2.axisy)*ea;e2.axisy=(fA*e2.axisy-ek*e2.axisx)*ea;e2.axisx=fV}}}}}}fw=fw.next;if(fB&&fw==null){fw=this.c_arbiters_true.head;fB=false}}}};a3.prototype.group_ignore=function(ee,ed){var eg=ee;while(eg!=null&&eg.group==null){if(eg.ishape!=null){eg=eg.ishape.body}else{if(eg.icompound!=null){eg=eg.icompound.compound}else{eg=eg.ibody.compound}}}var eb=eg==null?null:eg.group;if(eb==null){return false}else{var ef=ed;while(ef!=null&&ef.group==null){if(ef.ishape!=null){ef=ef.ishape.body}else{if(ef.icompound!=null){ef=ef.icompound.compound}else{ef=ef.ibody.compound}}}var ea=ef==null?null:ef.group;if(ea==null){return false}else{var ec=false;while(eb!=null&&ea!=null){if(eb==ea){ec=eb.ignore;break}if(eb.depthfc.type){eV=fc;eT=fe}else{if(fe.type==fc.type){if(fe.idgL.ws2.id?gL.ws2:gL.ws1;var jE=gL.ws1.id>gL.ws2.id?gL.ws1:gL.ws2;var ek=this.mrca1;while(ek.head!=null){var iy=ek.head;ek.head=iy.next;iy.elt=null;iy.next=g.zpp_pool;g.zpp_pool=iy;if(ek.head==null){ek.pushmod=true}ek.modified=true;ek.length--}ek.pushmod=true;var ej=this.mrca2;while(ej.head!=null){var ix=ej.head;ej.head=ix.next;ix.elt=null;ix.next=g.zpp_pool;g.zpp_pool=ix;if(ej.head==null){ej.pushmod=true}ej.modified=true;ej.length--}ej.pushmod=true;if(jH.cbSet!=null){var gz=this.mrca1;var iu;if(g.zpp_pool==null){iu=new g()}else{iu=g.zpp_pool;g.zpp_pool=iu.next;iu.next=null}iu.elt=jH;var jt=iu;jt.next=gz.head;gz.head=jt;gz.modified=true;gz.length++}if(jH.body.cbSet!=null){var gx=this.mrca1;var gl=jH.body;var ir;if(g.zpp_pool==null){ir=new g()}else{ir=g.zpp_pool;g.zpp_pool=ir.next;ir.next=null}ir.elt=gl;var jr=ir;jr.next=gx.head;gx.head=jr;gx.modified=true;gx.length++}if(jE.cbSet!=null){var gv=this.mrca2;var ip;if(g.zpp_pool==null){ip=new g()}else{ip=g.zpp_pool;g.zpp_pool=ip.next;ip.next=null}ip.elt=jE;var jq=ip;jq.next=gv.head;gv.head=jq;gv.modified=true;gv.length++}if(jE.body.cbSet!=null){var gt=this.mrca2;var gk=jE.body;var il;if(g.zpp_pool==null){il=new g()}else{il=g.zpp_pool;g.zpp_pool=il.next;il.next=null}il.elt=gk;var jp=il;jp.next=gt.head;gt.head=jp;gt.modified=true;gt.length++}var jQ=jH.body.compound;var jN=jE.body.compound;while(jQ!=jN){if((jQ==null?0:jQ.depth)<(jN==null?0:jN.depth)){if(jN.cbSet!=null){var gs=this.mrca2;var ij;if(g.zpp_pool==null){ij=new g()}else{ij=g.zpp_pool;g.zpp_pool=ij.next;ij.next=null}ij.elt=jN;var jn=ij;jn.next=gs.head;gs.head=jn;gs.modified=true;gs.length++}jN=jN.compound}else{if(jQ.cbSet!=null){var gr=this.mrca1;var ih;if(g.zpp_pool==null){ih=new g()}else{ih=g.zpp_pool;g.zpp_pool=ih.next;ih.next=null}ih.elt=jQ;var jl=ih;jl.next=gr.head;gr.head=jl;gr.modified=true;gr.length++}jQ=jQ.compound}}var eP=this.mrca1.head;while(eP!=null){var hs=eP.elt;var eO=this.mrca2.head;while(eO!=null){var hr=eO.elt;var jR=hs.cbSet;var jO=hr.cbSet;var ie=null;var eN=(jR.cbpairs.length=Infinity||gJ.s2.material.elasticity>=Infinity){gJ.restitution=1}else{gJ.restitution=(gJ.s1.material.elasticity+gJ.s2.material.elasticity)/2}}if(gJ.restitution<0){gJ.restitution=0}if(gJ.restitution>1){gJ.restitution=1}}if(!gJ.userdef_dyn_fric){gJ.dyn_fric=Math.sqrt(gJ.s1.material.dynamicFriction*gJ.s2.material.dynamicFriction)}if(!gJ.userdef_stat_fric){gJ.stat_fric=Math.sqrt(gJ.s1.material.staticFriction*gJ.s2.material.staticFriction)}if(!gJ.userdef_rfric){gJ.rfric=Math.sqrt(gJ.s1.material.rollingFriction*gJ.s2.material.rollingFriction)}var hK;if(bi.zpp_pool==null){hK=new bi()}else{hK=bi.zpp_pool;bi.zpp_pool=hK.next;hK.next=null}hK.elt=gJ;var ik=hK;ik.next=hc.head;hc.head=ik;hc.modified=true;hc.length++;gJ.fresh=!gG}else{gJ.fresh=gJ.up_stampgJ.ws2.id?gJ.ws2:gJ.ws1;var es=gJ.ws1.id>gJ.ws2.id?gJ.ws1:gJ.ws2;var f7=this.mrca1;while(f7.head!=null){var hF=f7.head;f7.head=hF.next;hF.elt=null;hF.next=g.zpp_pool;g.zpp_pool=hF;if(f7.head==null){f7.pushmod=true}f7.modified=true;f7.length--}f7.pushmod=true;var f6=this.mrca2;while(f6.head!=null){var hD=f6.head;f6.head=hD.next;hD.elt=null;hD.next=g.zpp_pool;g.zpp_pool=hD;if(f6.head==null){f6.pushmod=true}f6.modified=true;f6.length--}f6.pushmod=true;if(eF.cbSet!=null){var f5=this.mrca1;var hB;if(g.zpp_pool==null){hB=new g()}else{hB=g.zpp_pool;g.zpp_pool=hB.next;hB.next=null}hB.elt=eF;var ii=hB;ii.next=f5.head;f5.head=ii;f5.modified=true;f5.length++}if(eF.body.cbSet!=null){var f3=this.mrca1;var jj=eF.body;var hz;if(g.zpp_pool==null){hz=new g()}else{hz=g.zpp_pool;g.zpp_pool=hz.next;hz.next=null}hz.elt=jj;var ig=hz;ig.next=f3.head;f3.head=ig;f3.modified=true;f3.length++}if(es.cbSet!=null){var f2=this.mrca2;var hy;if(g.zpp_pool==null){hy=new g()}else{hy=g.zpp_pool;g.zpp_pool=hy.next;hy.next=null}hy.elt=es;var ic=hy;ic.next=f2.head;f2.head=ic;f2.modified=true;f2.length++}if(es.body.cbSet!=null){var fU=this.mrca2;var jh=es.body;var hx;if(g.zpp_pool==null){hx=new g()}else{hx=g.zpp_pool;g.zpp_pool=hx.next;hx.next=null}hx.elt=jh;var ia=hx;ia.next=fU.head;fU.head=ia;fU.modified=true;fU.length++}var jC=eF.body.compound;var jd=es.body.compound;while(jC!=jd){if((jC==null?0:jC.depth)<(jd==null?0:jd.depth)){if(jd.cbSet!=null){var fR=this.mrca2;var hw;if(g.zpp_pool==null){hw=new g()}else{hw=g.zpp_pool;g.zpp_pool=hw.next;hw.next=null}hw.elt=jd;var h8=hw;h8.next=fR.head;fR.head=h8;fR.modified=true;fR.length++}jd=jd.compound}else{if(jC.cbSet!=null){var fP=this.mrca1;var hv;if(g.zpp_pool==null){hv=new g()}else{hv=g.zpp_pool;g.zpp_pool=hv.next;hv.next=null}hv.elt=jC;var h6=hv;h6.next=fP.head;fP.head=h6;fP.modified=true;fP.length++}jC=jC.compound}}var eg=this.mrca1.head;while(eg!=null){var fT=eg.elt;var ef=this.mrca2.head;while(ef!=null){var fG=ef.elt;var jD=fT.cbSet;var je=fG.cbSet;var hu=null;var ee=(jD.cbpairs.lengthgH.ws2.id?gH.ws2:gH.ws1;var ep=gH.ws1.id>gH.ws2.id?gH.ws1:gH.ws2;var fz=this.mrca1;while(fz.head!=null){var g7=fz.head;fz.head=g7.next;g7.elt=null;g7.next=g.zpp_pool;g.zpp_pool=g7;if(fz.head==null){fz.pushmod=true}fz.modified=true;fz.length--}fz.pushmod=true;var fy=this.mrca2;while(fy.head!=null){var g6=fy.head;fy.head=g6.next;g6.elt=null;g6.next=g.zpp_pool;g.zpp_pool=g6;if(fy.head==null){fy.pushmod=true}fy.modified=true;fy.length--}fy.pushmod=true;if(eE.cbSet!=null){var fx=this.mrca1;var g4;if(g.zpp_pool==null){g4=new g()}else{g4=g.zpp_pool;g.zpp_pool=g4.next;g4.next=null}g4.elt=eE;var hR=g4;hR.next=fx.head;fx.head=hR;fx.modified=true;fx.length++}if(eE.body.cbSet!=null){var fw=this.mrca1;var iR=eE.body;var g3;if(g.zpp_pool==null){g3=new g()}else{g3=g.zpp_pool;g.zpp_pool=g3.next;g3.next=null}g3.elt=iR;var hP=g3;hP.next=fw.head;fw.head=hP;fw.modified=true;fw.length++}if(ep.cbSet!=null){var fv=this.mrca2;var g0;if(g.zpp_pool==null){g0=new g()}else{g0=g.zpp_pool;g.zpp_pool=g0.next;g0.next=null}g0.elt=ep;var hN=g0;hN.next=fv.head;fv.head=hN;fv.modified=true;fv.length++}if(ep.body.cbSet!=null){var fu=this.mrca2;var iO=ep.body;var gZ;if(g.zpp_pool==null){gZ=new g()}else{gZ=g.zpp_pool;g.zpp_pool=gZ.next;gZ.next=null}gZ.elt=iO;var hL=gZ;hL.next=fu.head;fu.head=hL;fu.modified=true;fu.length++}var jB=eE.body.compound;var jb=ep.body.compound;while(jB!=jb){if((jB==null?0:jB.depth)<(jb==null?0:jb.depth)){if(jb.cbSet!=null){var fo=this.mrca2;var gW;if(g.zpp_pool==null){gW=new g()}else{gW=g.zpp_pool;g.zpp_pool=gW.next;gW.next=null}gW.elt=jb;var hI=gW;hI.next=fo.head;fo.head=hI;fo.modified=true;fo.length++}jb=jb.compound}else{if(jB.cbSet!=null){var fn=this.mrca1;var gV;if(g.zpp_pool==null){gV=new g()}else{gV=g.zpp_pool;g.zpp_pool=gV.next;gV.next=null}gV.elt=jB;var hE=gV;hE.next=fn.head;fn.head=hE;fn.modified=true;fn.length++}jB=jB.compound}}var j4=this.mrca1.head;while(j4!=null){var fQ=j4.elt;var j3=this.mrca2.head;while(j3!=null){var fE=j3.elt;var jA=fQ.cbSet;var ja=fE.cbSet;var gU=null;var j2=(jA.cbpairs.lengthea.aabb.minx};f.prototype.__class__=f;var c6=zpp_nape.space.ZPP_SweepPhase=function(ea){this.failed=null;this.list=null;dB.call(this);this.space=ea;this.is_sweep=true;this.sweep=this};c6.__name__=["zpp_nape","space","ZPP_SweepPhase"];c6.__super__=dB;c6.prototype=Object.create(dB.prototype);c6.prototype.list=null;c6.prototype.__insert=function(ea){var eb;if(f.zpp_pool==null){eb=new f()}else{eb=f.zpp_pool;f.zpp_pool=eb.next;eb.next=null}ea.sweep=eb;eb.shape=ea;eb.aabb=ea.aabb;eb.next=this.list;if(this.list!=null){this.list.prev=eb}this.list=eb};c6.prototype.__remove=function(ea){var eb=ea.sweep;if(eb.prev==null){this.list=eb.next}else{eb.prev.next=eb.next}if(eb.next!=null){eb.next.prev=eb.prev}ea.sweep=null;eb.prev=null;eb.shape=null;eb.aabb=null;eb.next=f.zpp_pool;f.zpp_pool=eb};c6.prototype.__sync=function(ea){if(!this.space.continuous){if(ea.zip_aabb){if(ea.body!=null){ea.zip_aabb=false;if(ea.type==0){var et=ea.circle;if(et.zip_worldCOM){if(et.body!=null){et.zip_worldCOM=false;if(et.zip_localCOM){et.zip_localCOM=false;if(et.type==1){var ey=et.polygon;if(ey.lverts.next.next==null){ey.localCOMx=ey.lverts.next.x;ey.localCOMy=ey.lverts.next.y}else{if(ey.lverts.next.next.next==null){ey.localCOMx=ey.lverts.next.x;ey.localCOMy=ey.lverts.next.y;ey.localCOMx+=ey.lverts.next.next.x;ey.localCOMy+=ey.lverts.next.next.y;ey.localCOMx*=0.5;ey.localCOMy*=0.5}else{ey.localCOMx=0;ey.localCOMy=0;var ez=0;var es=ey.lverts.next;var ek=es;es=es.next;var ej=es;es=es.next;while(es!=null){var eh=es;ez+=ej.x*(eh.y-ek.y);var en=eh.y*ej.x-eh.x*ej.y;ey.localCOMx+=(ej.x+eh.x)*en;ey.localCOMy+=(ej.y+eh.y)*en;ek=ej;ej=eh;es=es.next}es=ey.lverts.next;var ei=es;ez+=ej.x*(ei.y-ek.y);var ef=ei.y*ej.x-ei.x*ej.y;ey.localCOMx+=(ej.x+ei.x)*ef;ey.localCOMy+=(ej.y+ei.y)*ef;ek=ej;es=es.next;var eg=es;ez+=ei.x*(eg.y-ek.y);var ee=eg.y*ei.x-eg.x*ei.y;ey.localCOMx+=(ei.x+eg.x)*ee;ey.localCOMy+=(ei.y+eg.y)*ee;ez=1/(3*ez);var em=ez;ey.localCOMx*=em;ey.localCOMy*=em}}}if(et.wrap_localCOM!=null){et.wrap_localCOM.zpp_inner.x=et.localCOMx;et.wrap_localCOM.zpp_inner.y=et.localCOMy}}var ex=et.body;if(ex.zip_axis){ex.zip_axis=false;ex.axisx=Math.sin(ex.rot);ex.axisy=Math.cos(ex.rot)}et.worldCOMx=et.body.posx+(et.body.axisy*et.localCOMx-et.body.axisx*et.localCOMy);et.worldCOMy=et.body.posy+(et.localCOMx*et.body.axisx+et.localCOMy*et.body.axisy)}}var ed=et.radius;var ec=et.radius;et.aabb.minx=et.worldCOMx-ed;et.aabb.miny=et.worldCOMy-ec;et.aabb.maxx=et.worldCOMx+ed;et.aabb.maxy=et.worldCOMy+ec}else{var ev=ea.polygon;if(ev.zip_gverts){if(ev.body!=null){ev.zip_gverts=false;ev.validate_lverts();var eu=ev.body;if(eu.zip_axis){eu.zip_axis=false;eu.axisx=Math.sin(eu.rot);eu.axisy=Math.cos(eu.rot)}var el=ev.lverts.next;var eq=ev.gverts.next;while(eq!=null){var ew=eq;var er=el;el=el.next;ew.x=ev.body.posx+(ev.body.axisy*er.x-ev.body.axisx*er.y);ew.y=ev.body.posy+(er.x*ev.body.axisx+er.y*ev.body.axisy);eq=eq.next}}}var eb=ev.gverts.next;ev.aabb.minx=eb.x;ev.aabb.miny=eb.y;ev.aabb.maxx=eb.x;ev.aabb.maxy=eb.y;var ep=ev.gverts.next.next;while(ep!=null){var eo=ep;if(eo.xev.aabb.maxx){ev.aabb.maxx=eo.x}if(eo.yev.aabb.maxy){ev.aabb.maxy=eo.y}ep=ep.next}}}}}};c6.prototype.sync_broadphase=function(){this.space.validation();if(this.list!=null){var eb=this.list.next;while(eb!=null){var ed=eb.next;var ea=eb.prev;if(eb.aabb.minx>ea.aabb.minx){eb=ed;continue}while(ea.prev!=null&&ea.prev.aabb.minx>eb.aabb.minx){ea=ea.prev}var ec=eb.prev;ec.next=eb.next;if(eb.next!=null){eb.next.prev=ec}if(ea.prev==null){eb.prev=null;this.list=eb;eb.next=ea;ea.prev=eb}else{eb.prev=ea.prev;ea.prev=eb;eb.prev.next=eb;eb.next=ea}eb=ed}}};c6.prototype.sync_broadphase_fast=function(){var eb=this.list.next;while(eb!=null){var ed=eb.next;var ea=eb.prev;if(eb.aabb.minx>ea.aabb.minx){eb=ed;continue}while(ea.prev!=null&&ea.prev.aabb.minx>eb.aabb.minx){ea=ea.prev}var ec=eb.prev;ec.next=eb.next;if(eb.next!=null){eb.next.prev=ec}if(ea.prev==null){eb.prev=null;this.list=eb;eb.next=ea;ea.prev=eb}else{eb.prev=ea.prev;ea.prev=eb;eb.prev.next=eb;eb.next=ea}eb=ed}};c6.prototype.broadphase=function(eb,ef){if(this.list!=null){var em=this.list.next;while(em!=null){var ee=em.next;var ej=em.prev;if(em.aabb.minx>ej.aabb.minx){em=ee;continue}while(ej.prev!=null&&ej.prev.aabb.minx>em.aabb.minx){ej=ej.prev}var eg=em.prev;eg.next=em.next;if(em.next!=null){em.next.prev=eg}if(ej.prev==null){em.prev=null;this.list=em;em.next=ej;ej.prev=em}else{em.prev=ej.prev;ej.prev=em;em.prev.next=em;em.next=ej}em=ee}var ed=this.list;while(ed!=null){var ec=ed.next;var eo=ed.shape;var el=eo.body;var ea=ed.aabb.maxx;while(ec!=null){if(ec.aabb.minx>ea){break}var en=ec.shape;var ei=en.body;if(ei==el){ec=ec.next;continue}if(el.type==1&&ei.type==1){ec=ec.next;continue}if(el.component.sleeping&&ei.component.sleeping){ec=ec.next;continue}var eh=eo.aabb;var ek=en.aabb;if(!(ek.miny>eh.maxy||eh.miny>ek.maxy)){if(ef){eb.narrowPhase(eo,en,el.type!=2||ei.type!=2,null,false)}else{eb.continuousEvent(eo,en,el.type!=2||ei.type!=2,null,false)}}ec=ec.next}ed=ed.next}}};c6.prototype.clear=function(){while(this.list!=null){this.list.shape.removedFromSpace();this.__remove(this.list.shape)}};c6.prototype.shapesUnderPoint=function(ej,eg,ea,eb){this.sync_broadphase();var ef;if(bB.zpp_pool==null){ef=new bB()}else{ef=bB.zpp_pool;bB.zpp_pool=ef.next;ef.next=null}ef.weak=false;ef._immutable=false;ef.x=ej;ef.y=eg;var ek=ef;var eh=eb==null?new cZ():eb;var ei=this.list;while(ei!=null&&ei.aabb.minx>ej){ei=ei.next}while(ei!=null&&ei.aabb.minx<=ej){if(ei.aabb.maxx>=ej&&ei.aabb.miny<=eg&&ei.aabb.maxy>=eg){var ee=ei.shape;var ec;if(ea!=null){var ed=ee.filter;if((ed.collisionMask&ea.collisionGroup)!=0){ec=(ea.collisionMask&ed.collisionGroup)!=0}else{ec=false}}else{ec=true}if(ec){if(ee.type==0){if(b7.circleContains(ee.circle,ek)){eh.push(ee.outer)}}else{if(b7.polyContains(ee.polygon,ek)){eh.push(ee.outer)}}}}ei=ei.next}if(ek.outer!=null){ek.outer.zpp_inner=null;ek.outer=null}ek._isimmutable=null;ek._validate=null;ek._invalidate=null;ek.next=bB.zpp_pool;bB.zpp_pool=ek;return eh};c6.prototype.bodiesUnderPoint=function(ek,eh,ea,eb){this.sync_broadphase();var eg;if(bB.zpp_pool==null){eg=new bB()}else{eg=bB.zpp_pool;bB.zpp_pool=eg.next;eg.next=null}eg.weak=false;eg._immutable=false;eg.x=ek;eg.y=eh;var el=eg;var ei=eb==null?new a5():eb;var ej=this.list;while(ej!=null&&ej.aabb.minx>ek){ej=ej.next}while(ej!=null&&ej.aabb.minx<=ek){if(ej.aabb.maxx>=ek&&ej.aabb.miny<=eh&&ej.aabb.maxy>=eh){var ef=ej.shape;var ed=ef.body.outer;if(!ei.has(ed)){var ec;if(ea!=null){var ee=ef.filter;if((ee.collisionMask&ea.collisionGroup)!=0){ec=(ea.collisionMask&ee.collisionGroup)!=0}else{ec=false}}else{ec=true}if(ec){if(ef.type==0){if(b7.circleContains(ef.circle,el)){ei.push(ed)}}else{if(b7.polyContains(ef.polygon,el)){ei.push(ed)}}}}}ej=ej.next}if(el.outer!=null){el.outer.zpp_inner=null;el.outer=null}el._isimmutable=null;el._validate=null;el._invalidate=null;el.next=bB.zpp_pool;bB.zpp_pool=el;return ei};c6.prototype.shapesInAABB=function(eg,en,ea,ec,ed){this.sync_broadphase();this.updateAABBShape(eg);var ep=this.aabbShape.zpp_inner.aabb;var ek=ed==null?new cZ():ed;var eo=this.list;while(eo!=null&&eo.aabb.maxx=ep.minx&&em.miny>=ep.miny&&em.maxx<=ep.maxx&&em.maxy<=ep.maxy){ek.push(ej.outer)}else{var el=eo.aabb;if(ep.miny<=el.maxy&&el.miny<=ep.maxy&&ep.minx<=el.maxx&&el.minx<=ep.maxx){if(b7.testCollide_safe(ej,this.aabbShape.zpp_inner)){ek.push(ej.outer)}}}}}else{var ee;if(ea){var eb=eo.aabb;if(eb.minx>=ep.minx&&eb.miny>=ep.miny&&eb.maxx<=ep.maxx){ee=eb.maxy<=ep.maxy}else{ee=false}}else{var ei=eo.aabb;if(ep.miny<=ei.maxy&&ei.miny<=ep.maxy&&ep.minx<=ei.maxx){ee=ei.minx<=ep.maxx}else{ee=false}}if(ee){ek.push(ej.outer)}}}eo=eo.next}return ek};c6.prototype.failed=null;c6.prototype.bodiesInAABB=function(ec,er,em,eg,ed){this.sync_broadphase();this.updateAABBShape(ec);var eo=this.aabbShape.zpp_inner.aabb;var eq=ed==null?new a5():ed;if(this.failed==null){this.failed=new a5()}var ep=this.list;while(ep!=null&&ep.aabb.maxx=eo.minx&&ee.miny>=eo.miny&&ee.maxx<=eo.maxx&&ee.maxy<=eo.maxy;if(!eq.has(ef)&&el){eq.push(ef)}else{if(!el){eq.remove(ef);this.failed.push(ef)}}}}else{var eh;if(!eq.has(ef)){var ej=ea.aabb;if(ej.minx>=eo.minx&&ej.miny>=eo.miny&&ej.maxx<=eo.maxx){eh=ej.maxy<=eo.maxy}else{eh=false}}else{eh=false}if(eh){eq.push(ef)}}}}}ep=ep.next}this.failed.clear();return eq};c6.prototype.shapesInCircle=function(el,ej,eb,ea,ec,ed){this.sync_broadphase();this.updateCircShape(el,ej,eb);var em=this.circShape.zpp_inner.aabb;var eh=ed==null?new cZ():ed;var ek=this.list;while(ek!=null&&ek.aabb.maxx=0&&ei=0&&ee=0&&ed=0){if(eo.shape.type==0){ec.circlesect2(eo.shape.circle,eq,er)}else{ec.polysect2(eo.shape.polygon,eq,er)}}}eo=eo.next}}else{if(ec.dirx<0){var es=this.list;var en=null;while(es!=null&&es.aabb.minx<=ef.maxx){en=es;es=es.next}es=en;while(es!=null){var ee;var ek=es.aabb;if(ef.miny<=ek.maxy&&ek.miny<=ef.maxy&&ef.minx<=ek.maxx&&ek.minx<=ef.maxx){if(eb!=null){var ej=es.shape.filter;if((ej.collisionMask&eb.collisionGroup)!=0){ee=(eb.collisionMask&ej.collisionGroup)!=0}else{ee=false}}else{ee=true}}else{ee=false}if(ee){if(ec.aabbsect(es.aabb)>=0){if(es.shape.type==0){ec.circlesect2(es.shape.circle,eq,er)}else{ec.polysect2(es.shape.polygon,eq,er)}}}es=es.prev}}else{var ep=this.list;while(ep!=null&&ep.aabb.minx<=ef.maxx){var ed;var ei=ep.aabb;if(ef.miny<=ei.maxy&&ei.miny<=ef.maxy&&ef.minx<=ei.maxx&&ei.minx<=ef.maxx){if(eb!=null){var eh=ep.shape.filter;if((eh.collisionMask&eb.collisionGroup)!=0){ed=(eb.collisionMask&eh.collisionGroup)!=0}else{ed=false}}else{ed=true}}else{ed=false}if(ed){if(ec.aabbsect(ep.aabb)>=0){if(ep.shape.type==0){ec.circlesect2(ep.shape.circle,eq,er)}else{ec.polysect2(ep.shape.polygon,eq,er)}}}ep=ep.next}}}if(ef.outer!=null){ef.outer.zpp_inner=null;ef.outer=null}ef.wrap_min=ef.wrap_max=null;ef._invalidate=null;ef._validate=null;ef.next=bT.zpp_pool;bT.zpp_pool=ef;return er};c6.prototype.__class__=c6;var cb=zpp_nape.util.ZNPArray2_Float=function(eb,ea){this.width=0;this.list=null;this.width=eb;this.list=[]};cb.__name__=["zpp_nape","util","ZNPArray2_Float"];cb.prototype.list=null;cb.prototype.width=null;cb.prototype.resize=function(eb,ea,ed){this.width=eb;var ec=0;var ee=eb*ea;while(eceb){var ea=ed;ed=eb;eb=ea}var ec=this.table[ed*106039+eb&1048575];if(ec==null){return null}else{if(ec.id==ed&&ec.di==eb){return ec}else{while(true){ec=ec.hnext;if(!(ec!=null&&(ec.id!=ed||ec.di!=eb))){break}}return ec}}};bK.prototype.has=function(ec,ea){var eb=this.table[ec*106039+ea&1048575];if(eb==null){return false}else{if(eb.id==ec&&eb.di==ea){return true}else{while(true){eb=eb.hnext;if(!(eb!=null&&(eb.id!=ec||eb.di!=ea))){break}}return eb!=null}}};bK.prototype.maybeAdd=function(eb){var ea=eb.id*106039+eb.di&1048575;var ec=this.table[ea];if(ec==null){this.table[ea]=eb;eb.hnext=null}else{eb.hnext=ec.hnext;ec.hnext=eb}this.cnt++};bK.prototype.add=function(eb){var ea=eb.id*106039+eb.di&1048575;var ec=this.table[ea];if(ec==null){this.table[ea]=eb;eb.hnext=null}else{eb.hnext=ec.hnext;ec.hnext=eb}this.cnt++};bK.prototype.remove=function(eb){var ea=eb.id*106039+eb.di&1048575;var ed=this.table[ea];if(ed==eb){this.table[ea]=ed.hnext}else{if(ed!=null){var ec;while(true){ec=ed;ed=ed.hnext;if(!(ed!=null&&ed!=eb)){break}}ec.hnext=ed.hnext}}eb.hnext=null;this.cnt--};bK.prototype.hash=function(eb,ea){return eb*106039+ea&1048575};bK.prototype.__class__=bK;var dF=zpp_nape.util.ZNPList_ZPP_CallbackSet=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};dF.__name__=["zpp_nape","util","ZNPList_ZPP_CallbackSet"];dF.prototype.head=null;dF.prototype.begin=function(){return this.head};dF.prototype.modified=null;dF.prototype.pushmod=null;dF.prototype.length=null;dF.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};dF.prototype.add=function(ec){var eb;if(cF.zpp_pool==null){eb=new cF()}else{eb=cF.zpp_pool;cF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dF.prototype.inlined_add=function(ec){var eb;if(cF.zpp_pool==null){eb=new cF()}else{eb=cF.zpp_pool;cF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dF.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};dF.prototype.insert=function(ed,ec){var eb;if(cF.zpp_pool==null){eb=new cF()}else{eb=cF.zpp_pool;cF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dF.prototype.inlined_insert=function(ed,ec){var eb;if(cF.zpp_pool==null){eb=new cF()}else{eb=cF.zpp_pool;cF.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dF.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cF.zpp_pool;cF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dF.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cF.zpp_pool;cF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dF.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dF.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dF.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cF.zpp_pool;cF.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dF.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};dF.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cF.zpp_pool;cF.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dF.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cF.zpp_pool;cF.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};dF.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cF.zpp_pool;cF.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dF.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cF.zpp_pool;cF.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dF.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};dF.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cF.zpp_pool;cF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dF.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cF.zpp_pool;cF.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dF.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};dF.prototype.empty=function(){return this.head==null};dF.prototype.size=function(){return this.length};dF.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dF.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dF.prototype.front=function(){return this.head.elt};dF.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};dF.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};dF.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};dF.prototype.__class__=dF;var s=zpp_nape.util.ZNPList_ZPP_Shape=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};s.__name__=["zpp_nape","util","ZNPList_ZPP_Shape"];s.prototype.head=null;s.prototype.begin=function(){return this.head};s.prototype.modified=null;s.prototype.pushmod=null;s.prototype.length=null;s.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};s.prototype.add=function(ec){var eb;if(b9.zpp_pool==null){eb=new b9()}else{eb=b9.zpp_pool;b9.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};s.prototype.inlined_add=function(ec){var eb;if(b9.zpp_pool==null){eb=new b9()}else{eb=b9.zpp_pool;b9.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};s.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};s.prototype.insert=function(ed,ec){var eb;if(b9.zpp_pool==null){eb=new b9()}else{eb=b9.zpp_pool;b9.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};s.prototype.inlined_insert=function(ed,ec){var eb;if(b9.zpp_pool==null){eb=new b9()}else{eb=b9.zpp_pool;b9.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};s.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=b9.zpp_pool;b9.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};s.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=b9.zpp_pool;b9.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};s.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};s.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};s.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=b9.zpp_pool;b9.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};s.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};s.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=b9.zpp_pool;b9.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};s.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=b9.zpp_pool;b9.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};s.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=b9.zpp_pool;b9.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};s.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=b9.zpp_pool;b9.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};s.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};s.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=b9.zpp_pool;b9.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};s.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=b9.zpp_pool;b9.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};s.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};s.prototype.empty=function(){return this.head==null};s.prototype.size=function(){return this.length};s.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};s.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};s.prototype.front=function(){return this.head.elt};s.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};s.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};s.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};s.prototype.__class__=s;var bs=zpp_nape.util.ZNPList_ZPP_Body=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bs.__name__=["zpp_nape","util","ZNPList_ZPP_Body"];bs.prototype.head=null;bs.prototype.begin=function(){return this.head};bs.prototype.modified=null;bs.prototype.pushmod=null;bs.prototype.length=null;bs.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bs.prototype.add=function(ec){var eb;if(bE.zpp_pool==null){eb=new bE()}else{eb=bE.zpp_pool;bE.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bs.prototype.inlined_add=function(ec){var eb;if(bE.zpp_pool==null){eb=new bE()}else{eb=bE.zpp_pool;bE.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bs.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bs.prototype.insert=function(ed,ec){var eb;if(bE.zpp_pool==null){eb=new bE()}else{eb=bE.zpp_pool;bE.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bs.prototype.inlined_insert=function(ed,ec){var eb;if(bE.zpp_pool==null){eb=new bE()}else{eb=bE.zpp_pool;bE.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bs.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bE.zpp_pool;bE.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bs.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bE.zpp_pool;bE.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bs.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bs.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bs.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=bE.zpp_pool;bE.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bs.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bs.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=bE.zpp_pool;bE.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bs.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=bE.zpp_pool;bE.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bs.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=bE.zpp_pool;bE.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bs.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=bE.zpp_pool;bE.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bs.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bs.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bE.zpp_pool;bE.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bs.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bE.zpp_pool;bE.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bs.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bs.prototype.empty=function(){return this.head==null};bs.prototype.size=function(){return this.length};bs.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bs.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bs.prototype.front=function(){return this.head.elt};bs.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bs.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bs.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bs.prototype.__class__=bs;var n=zpp_nape.util.ZNPList_ZPP_Compound=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};n.__name__=["zpp_nape","util","ZNPList_ZPP_Compound"];n.prototype.head=null;n.prototype.begin=function(){return this.head};n.prototype.modified=null;n.prototype.pushmod=null;n.prototype.length=null;n.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};n.prototype.add=function(ec){var eb;if(Q.zpp_pool==null){eb=new Q()}else{eb=Q.zpp_pool;Q.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};n.prototype.inlined_add=function(ec){var eb;if(Q.zpp_pool==null){eb=new Q()}else{eb=Q.zpp_pool;Q.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};n.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};n.prototype.insert=function(ed,ec){var eb;if(Q.zpp_pool==null){eb=new Q()}else{eb=Q.zpp_pool;Q.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};n.prototype.inlined_insert=function(ed,ec){var eb;if(Q.zpp_pool==null){eb=new Q()}else{eb=Q.zpp_pool;Q.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};n.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=Q.zpp_pool;Q.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};n.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=Q.zpp_pool;Q.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};n.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};n.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};n.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=Q.zpp_pool;Q.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};n.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};n.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=Q.zpp_pool;Q.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};n.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=Q.zpp_pool;Q.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};n.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=Q.zpp_pool;Q.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};n.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=Q.zpp_pool;Q.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};n.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};n.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=Q.zpp_pool;Q.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};n.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=Q.zpp_pool;Q.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};n.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};n.prototype.empty=function(){return this.head==null};n.prototype.size=function(){return this.length};n.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};n.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};n.prototype.front=function(){return this.head.elt};n.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};n.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};n.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};n.prototype.__class__=n;var h=zpp_nape.util.ZNPList_ZPP_Arbiter=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};h.__name__=["zpp_nape","util","ZNPList_ZPP_Arbiter"];h.prototype.head=null;h.prototype.begin=function(){return this.head};h.prototype.modified=null;h.prototype.pushmod=null;h.prototype.length=null;h.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};h.prototype.add=function(ec){var eb;if(dL.zpp_pool==null){eb=new dL()}else{eb=dL.zpp_pool;dL.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};h.prototype.inlined_add=function(ec){var eb;if(dL.zpp_pool==null){eb=new dL()}else{eb=dL.zpp_pool;dL.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};h.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};h.prototype.insert=function(ed,ec){var eb;if(dL.zpp_pool==null){eb=new dL()}else{eb=dL.zpp_pool;dL.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};h.prototype.inlined_insert=function(ed,ec){var eb;if(dL.zpp_pool==null){eb=new dL()}else{eb=dL.zpp_pool;dL.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};h.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};h.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};h.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};h.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};h.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dL.zpp_pool;dL.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};h.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};h.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dL.zpp_pool;dL.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};h.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=dL.zpp_pool;dL.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};h.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dL.zpp_pool;dL.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};h.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dL.zpp_pool;dL.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};h.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};h.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};h.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dL.zpp_pool;dL.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};h.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};h.prototype.empty=function(){return this.head==null};h.prototype.size=function(){return this.length};h.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};h.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};h.prototype.front=function(){return this.head.elt};h.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};h.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};h.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};h.prototype.__class__=h;var aK=zpp_nape.util.ZNPList_ZPP_CbSetPair=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};aK.__name__=["zpp_nape","util","ZNPList_ZPP_CbSetPair"];aK.prototype.head=null;aK.prototype.begin=function(){return this.head};aK.prototype.modified=null;aK.prototype.pushmod=null;aK.prototype.length=null;aK.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};aK.prototype.add=function(ec){var eb;if(cd.zpp_pool==null){eb=new cd()}else{eb=cd.zpp_pool;cd.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};aK.prototype.inlined_add=function(ec){var eb;if(cd.zpp_pool==null){eb=new cd()}else{eb=cd.zpp_pool;cd.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};aK.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};aK.prototype.insert=function(ed,ec){var eb;if(cd.zpp_pool==null){eb=new cd()}else{eb=cd.zpp_pool;cd.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};aK.prototype.inlined_insert=function(ed,ec){var eb;if(cd.zpp_pool==null){eb=new cd()}else{eb=cd.zpp_pool;cd.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};aK.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cd.zpp_pool;cd.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};aK.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cd.zpp_pool;cd.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};aK.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};aK.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};aK.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cd.zpp_pool;cd.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};aK.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};aK.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cd.zpp_pool;cd.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};aK.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cd.zpp_pool;cd.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};aK.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cd.zpp_pool;cd.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};aK.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cd.zpp_pool;cd.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};aK.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};aK.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cd.zpp_pool;cd.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};aK.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cd.zpp_pool;cd.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};aK.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};aK.prototype.empty=function(){return this.head==null};aK.prototype.size=function(){return this.length};aK.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};aK.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};aK.prototype.front=function(){return this.head.elt};aK.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};aK.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};aK.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};aK.prototype.__class__=aK;var t=zpp_nape.util.ZNPList_ZPP_CutInt=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};t.__name__=["zpp_nape","util","ZNPList_ZPP_CutInt"];t.prototype.head=null;t.prototype.begin=function(){return this.head};t.prototype.modified=null;t.prototype.pushmod=null;t.prototype.length=null;t.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};t.prototype.add=function(ec){var eb;if(d3.zpp_pool==null){eb=new d3()}else{eb=d3.zpp_pool;d3.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};t.prototype.inlined_add=function(ec){var eb;if(d3.zpp_pool==null){eb=new d3()}else{eb=d3.zpp_pool;d3.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};t.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};t.prototype.insert=function(ed,ec){var eb;if(d3.zpp_pool==null){eb=new d3()}else{eb=d3.zpp_pool;d3.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};t.prototype.inlined_insert=function(ed,ec){var eb;if(d3.zpp_pool==null){eb=new d3()}else{eb=d3.zpp_pool;d3.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};t.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d3.zpp_pool;d3.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};t.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d3.zpp_pool;d3.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};t.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};t.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};t.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=d3.zpp_pool;d3.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};t.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};t.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=d3.zpp_pool;d3.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};t.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=d3.zpp_pool;d3.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};t.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=d3.zpp_pool;d3.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};t.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=d3.zpp_pool;d3.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};t.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};t.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d3.zpp_pool;d3.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};t.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d3.zpp_pool;d3.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};t.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};t.prototype.empty=function(){return this.head==null};t.prototype.size=function(){return this.length};t.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};t.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};t.prototype.front=function(){return this.head.elt};t.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};t.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};t.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};t.prototype.__class__=t;var B=zpp_nape.util.ZNPList_ZPP_CutVert=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};B.__name__=["zpp_nape","util","ZNPList_ZPP_CutVert"];B.prototype.head=null;B.prototype.begin=function(){return this.head};B.prototype.modified=null;B.prototype.pushmod=null;B.prototype.length=null;B.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};B.prototype.add=function(ec){var eb;if(cH.zpp_pool==null){eb=new cH()}else{eb=cH.zpp_pool;cH.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};B.prototype.inlined_add=function(ec){var eb;if(cH.zpp_pool==null){eb=new cH()}else{eb=cH.zpp_pool;cH.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};B.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};B.prototype.insert=function(ed,ec){var eb;if(cH.zpp_pool==null){eb=new cH()}else{eb=cH.zpp_pool;cH.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};B.prototype.inlined_insert=function(ed,ec){var eb;if(cH.zpp_pool==null){eb=new cH()}else{eb=cH.zpp_pool;cH.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};B.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cH.zpp_pool;cH.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};B.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cH.zpp_pool;cH.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};B.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};B.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};B.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cH.zpp_pool;cH.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};B.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};B.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cH.zpp_pool;cH.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};B.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cH.zpp_pool;cH.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};B.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cH.zpp_pool;cH.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};B.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cH.zpp_pool;cH.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};B.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};B.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cH.zpp_pool;cH.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};B.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cH.zpp_pool;cH.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};B.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};B.prototype.empty=function(){return this.head==null};B.prototype.size=function(){return this.length};B.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};B.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};B.prototype.front=function(){return this.head.elt};B.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};B.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};B.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};B.prototype.__class__=B;var dO=zpp_nape.util.ZNPList_ZPP_PartitionVertex=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};dO.__name__=["zpp_nape","util","ZNPList_ZPP_PartitionVertex"];dO.prototype.head=null;dO.prototype.begin=function(){return this.head};dO.prototype.modified=null;dO.prototype.pushmod=null;dO.prototype.length=null;dO.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};dO.prototype.add=function(ec){var eb;if(V.zpp_pool==null){eb=new V()}else{eb=V.zpp_pool;V.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dO.prototype.inlined_add=function(ec){var eb;if(V.zpp_pool==null){eb=new V()}else{eb=V.zpp_pool;V.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dO.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};dO.prototype.insert=function(ed,ec){var eb;if(V.zpp_pool==null){eb=new V()}else{eb=V.zpp_pool;V.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dO.prototype.inlined_insert=function(ed,ec){var eb;if(V.zpp_pool==null){eb=new V()}else{eb=V.zpp_pool;V.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dO.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=V.zpp_pool;V.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dO.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=V.zpp_pool;V.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dO.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dO.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dO.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=V.zpp_pool;V.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dO.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};dO.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=V.zpp_pool;V.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dO.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=V.zpp_pool;V.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};dO.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=V.zpp_pool;V.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dO.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=V.zpp_pool;V.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dO.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};dO.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=V.zpp_pool;V.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dO.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=V.zpp_pool;V.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dO.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};dO.prototype.empty=function(){return this.head==null};dO.prototype.size=function(){return this.length};dO.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dO.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dO.prototype.front=function(){return this.head.elt};dO.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};dO.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};dO.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};dO.prototype.__class__=dO;var c0=zpp_nape.util.ZNPList_ZPP_SimplifyP=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};c0.__name__=["zpp_nape","util","ZNPList_ZPP_SimplifyP"];c0.prototype.head=null;c0.prototype.begin=function(){return this.head};c0.prototype.modified=null;c0.prototype.pushmod=null;c0.prototype.length=null;c0.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};c0.prototype.add=function(ec){var eb;if(o.zpp_pool==null){eb=new o()}else{eb=o.zpp_pool;o.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};c0.prototype.inlined_add=function(ec){var eb;if(o.zpp_pool==null){eb=new o()}else{eb=o.zpp_pool;o.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};c0.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};c0.prototype.insert=function(ed,ec){var eb;if(o.zpp_pool==null){eb=new o()}else{eb=o.zpp_pool;o.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};c0.prototype.inlined_insert=function(ed,ec){var eb;if(o.zpp_pool==null){eb=new o()}else{eb=o.zpp_pool;o.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};c0.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=o.zpp_pool;o.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};c0.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=o.zpp_pool;o.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};c0.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};c0.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};c0.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=o.zpp_pool;o.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};c0.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};c0.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=o.zpp_pool;o.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};c0.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=o.zpp_pool;o.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};c0.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=o.zpp_pool;o.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};c0.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=o.zpp_pool;o.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};c0.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};c0.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=o.zpp_pool;o.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};c0.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=o.zpp_pool;o.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};c0.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};c0.prototype.empty=function(){return this.head==null};c0.prototype.size=function(){return this.length};c0.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};c0.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};c0.prototype.front=function(){return this.head.elt};c0.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};c0.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};c0.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};c0.prototype.__class__=c0;var bu=zpp_nape.util.ZNPList_ZPP_PartitionedPoly=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bu.__name__=["zpp_nape","util","ZNPList_ZPP_PartitionedPoly"];bu.prototype.head=null;bu.prototype.begin=function(){return this.head};bu.prototype.modified=null;bu.prototype.pushmod=null;bu.prototype.length=null;bu.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bu.prototype.add=function(ec){var eb;if(dU.zpp_pool==null){eb=new dU()}else{eb=dU.zpp_pool;dU.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bu.prototype.inlined_add=function(ec){var eb;if(dU.zpp_pool==null){eb=new dU()}else{eb=dU.zpp_pool;dU.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bu.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bu.prototype.insert=function(ed,ec){var eb;if(dU.zpp_pool==null){eb=new dU()}else{eb=dU.zpp_pool;dU.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bu.prototype.inlined_insert=function(ed,ec){var eb;if(dU.zpp_pool==null){eb=new dU()}else{eb=dU.zpp_pool;dU.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bu.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dU.zpp_pool;dU.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bu.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dU.zpp_pool;dU.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bu.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bu.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bu.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dU.zpp_pool;dU.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bu.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bu.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dU.zpp_pool;dU.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bu.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=dU.zpp_pool;dU.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bu.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dU.zpp_pool;dU.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bu.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dU.zpp_pool;dU.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bu.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bu.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dU.zpp_pool;dU.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bu.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dU.zpp_pool;dU.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bu.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bu.prototype.empty=function(){return this.head==null};bu.prototype.size=function(){return this.length};bu.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bu.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bu.prototype.front=function(){return this.head.elt};bu.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bu.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bu.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bu.prototype.__class__=bu;var dA=zpp_nape.util.ZNPList_ZPP_GeomVert=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};dA.__name__=["zpp_nape","util","ZNPList_ZPP_GeomVert"];dA.prototype.head=null;dA.prototype.begin=function(){return this.head};dA.prototype.modified=null;dA.prototype.pushmod=null;dA.prototype.length=null;dA.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};dA.prototype.add=function(ec){var eb;if(dS.zpp_pool==null){eb=new dS()}else{eb=dS.zpp_pool;dS.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dA.prototype.inlined_add=function(ec){var eb;if(dS.zpp_pool==null){eb=new dS()}else{eb=dS.zpp_pool;dS.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dA.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};dA.prototype.insert=function(ed,ec){var eb;if(dS.zpp_pool==null){eb=new dS()}else{eb=dS.zpp_pool;dS.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dA.prototype.inlined_insert=function(ed,ec){var eb;if(dS.zpp_pool==null){eb=new dS()}else{eb=dS.zpp_pool;dS.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dA.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dS.zpp_pool;dS.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dA.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dS.zpp_pool;dS.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dA.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dA.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dA.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dS.zpp_pool;dS.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dA.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};dA.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dS.zpp_pool;dS.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dA.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=dS.zpp_pool;dS.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};dA.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dS.zpp_pool;dS.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dA.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dS.zpp_pool;dS.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dA.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};dA.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dS.zpp_pool;dS.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dA.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dS.zpp_pool;dS.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dA.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};dA.prototype.empty=function(){return this.head==null};dA.prototype.size=function(){return this.length};dA.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dA.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dA.prototype.front=function(){return this.head.elt};dA.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};dA.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};dA.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};dA.prototype.__class__=dA;var a8=zpp_nape.util.ZNPList_ZPP_SimpleVert=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};a8.__name__=["zpp_nape","util","ZNPList_ZPP_SimpleVert"];a8.prototype.head=null;a8.prototype.begin=function(){return this.head};a8.prototype.modified=null;a8.prototype.pushmod=null;a8.prototype.length=null;a8.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};a8.prototype.add=function(ec){var eb;if(d6.zpp_pool==null){eb=new d6()}else{eb=d6.zpp_pool;d6.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};a8.prototype.inlined_add=function(ec){var eb;if(d6.zpp_pool==null){eb=new d6()}else{eb=d6.zpp_pool;d6.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};a8.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};a8.prototype.insert=function(ed,ec){var eb;if(d6.zpp_pool==null){eb=new d6()}else{eb=d6.zpp_pool;d6.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};a8.prototype.inlined_insert=function(ed,ec){var eb;if(d6.zpp_pool==null){eb=new d6()}else{eb=d6.zpp_pool;d6.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};a8.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d6.zpp_pool;d6.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};a8.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d6.zpp_pool;d6.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};a8.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};a8.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};a8.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=d6.zpp_pool;d6.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};a8.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};a8.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=d6.zpp_pool;d6.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};a8.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=d6.zpp_pool;d6.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};a8.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=d6.zpp_pool;d6.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};a8.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=d6.zpp_pool;d6.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};a8.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};a8.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d6.zpp_pool;d6.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};a8.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d6.zpp_pool;d6.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};a8.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};a8.prototype.empty=function(){return this.head==null};a8.prototype.size=function(){return this.length};a8.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};a8.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};a8.prototype.front=function(){return this.head.elt};a8.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};a8.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};a8.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};a8.prototype.__class__=a8;var dC=zpp_nape.util.ZNPList_ZPP_SimpleEvent=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};dC.__name__=["zpp_nape","util","ZNPList_ZPP_SimpleEvent"];dC.prototype.head=null;dC.prototype.begin=function(){return this.head};dC.prototype.modified=null;dC.prototype.pushmod=null;dC.prototype.length=null;dC.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};dC.prototype.add=function(ec){var eb;if(dY.zpp_pool==null){eb=new dY()}else{eb=dY.zpp_pool;dY.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dC.prototype.inlined_add=function(ec){var eb;if(dY.zpp_pool==null){eb=new dY()}else{eb=dY.zpp_pool;dY.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dC.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};dC.prototype.insert=function(ed,ec){var eb;if(dY.zpp_pool==null){eb=new dY()}else{eb=dY.zpp_pool;dY.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dC.prototype.inlined_insert=function(ed,ec){var eb;if(dY.zpp_pool==null){eb=new dY()}else{eb=dY.zpp_pool;dY.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dC.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dY.zpp_pool;dY.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dC.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dY.zpp_pool;dY.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dC.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dC.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dC.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dY.zpp_pool;dY.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dC.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};dC.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dY.zpp_pool;dY.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dC.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=dY.zpp_pool;dY.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};dC.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dY.zpp_pool;dY.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dC.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dY.zpp_pool;dY.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dC.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};dC.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dY.zpp_pool;dY.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dC.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dY.zpp_pool;dY.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dC.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};dC.prototype.empty=function(){return this.head==null};dC.prototype.size=function(){return this.length};dC.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dC.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dC.prototype.front=function(){return this.head.elt};dC.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};dC.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};dC.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};dC.prototype.__class__=dC;var dw=zpp_nape.util.ZNPList_ZPP_AABBPair=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};dw.__name__=["zpp_nape","util","ZNPList_ZPP_AABBPair"];dw.prototype.head=null;dw.prototype.begin=function(){return this.head};dw.prototype.modified=null;dw.prototype.pushmod=null;dw.prototype.length=null;dw.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};dw.prototype.add=function(ec){var eb;if(cl.zpp_pool==null){eb=new cl()}else{eb=cl.zpp_pool;cl.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dw.prototype.inlined_add=function(ec){var eb;if(cl.zpp_pool==null){eb=new cl()}else{eb=cl.zpp_pool;cl.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dw.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};dw.prototype.insert=function(ed,ec){var eb;if(cl.zpp_pool==null){eb=new cl()}else{eb=cl.zpp_pool;cl.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dw.prototype.inlined_insert=function(ed,ec){var eb;if(cl.zpp_pool==null){eb=new cl()}else{eb=cl.zpp_pool;cl.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dw.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cl.zpp_pool;cl.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dw.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cl.zpp_pool;cl.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dw.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dw.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dw.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cl.zpp_pool;cl.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dw.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};dw.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cl.zpp_pool;cl.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dw.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cl.zpp_pool;cl.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};dw.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cl.zpp_pool;cl.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dw.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cl.zpp_pool;cl.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dw.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};dw.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cl.zpp_pool;cl.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dw.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cl.zpp_pool;cl.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dw.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};dw.prototype.empty=function(){return this.head==null};dw.prototype.size=function(){return this.length};dw.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dw.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dw.prototype.front=function(){return this.head.elt};dw.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};dw.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};dw.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};dw.prototype.__class__=dw;var ce=zpp_nape.util.ZNPList_ZPP_Edge=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};ce.__name__=["zpp_nape","util","ZNPList_ZPP_Edge"];ce.prototype.head=null;ce.prototype.begin=function(){return this.head};ce.prototype.modified=null;ce.prototype.pushmod=null;ce.prototype.length=null;ce.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};ce.prototype.add=function(ec){var eb;if(cq.zpp_pool==null){eb=new cq()}else{eb=cq.zpp_pool;cq.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};ce.prototype.inlined_add=function(ec){var eb;if(cq.zpp_pool==null){eb=new cq()}else{eb=cq.zpp_pool;cq.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};ce.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};ce.prototype.insert=function(ed,ec){var eb;if(cq.zpp_pool==null){eb=new cq()}else{eb=cq.zpp_pool;cq.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};ce.prototype.inlined_insert=function(ed,ec){var eb;if(cq.zpp_pool==null){eb=new cq()}else{eb=cq.zpp_pool;cq.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};ce.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cq.zpp_pool;cq.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};ce.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cq.zpp_pool;cq.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};ce.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};ce.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};ce.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cq.zpp_pool;cq.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};ce.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};ce.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cq.zpp_pool;cq.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};ce.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cq.zpp_pool;cq.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};ce.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cq.zpp_pool;cq.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};ce.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cq.zpp_pool;cq.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};ce.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};ce.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cq.zpp_pool;cq.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};ce.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cq.zpp_pool;cq.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};ce.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};ce.prototype.empty=function(){return this.head==null};ce.prototype.size=function(){return this.length};ce.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};ce.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};ce.prototype.front=function(){return this.head.elt};ce.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};ce.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};ce.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};ce.prototype.__class__=ce;var ai=zpp_nape.util.ZNPList_ZPP_AABBNode=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};ai.__name__=["zpp_nape","util","ZNPList_ZPP_AABBNode"];ai.prototype.head=null;ai.prototype.begin=function(){return this.head};ai.prototype.modified=null;ai.prototype.pushmod=null;ai.prototype.length=null;ai.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};ai.prototype.add=function(ec){var eb;if(d2.zpp_pool==null){eb=new d2()}else{eb=d2.zpp_pool;d2.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};ai.prototype.inlined_add=function(ec){var eb;if(d2.zpp_pool==null){eb=new d2()}else{eb=d2.zpp_pool;d2.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};ai.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};ai.prototype.insert=function(ed,ec){var eb;if(d2.zpp_pool==null){eb=new d2()}else{eb=d2.zpp_pool;d2.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};ai.prototype.inlined_insert=function(ed,ec){var eb;if(d2.zpp_pool==null){eb=new d2()}else{eb=d2.zpp_pool;d2.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};ai.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d2.zpp_pool;d2.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};ai.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d2.zpp_pool;d2.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};ai.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};ai.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};ai.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=d2.zpp_pool;d2.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};ai.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};ai.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=d2.zpp_pool;d2.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};ai.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=d2.zpp_pool;d2.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};ai.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=d2.zpp_pool;d2.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};ai.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=d2.zpp_pool;d2.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};ai.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};ai.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d2.zpp_pool;d2.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};ai.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=d2.zpp_pool;d2.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};ai.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};ai.prototype.empty=function(){return this.head==null};ai.prototype.size=function(){return this.length};ai.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};ai.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};ai.prototype.front=function(){return this.head.elt};ai.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};ai.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};ai.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};ai.prototype.__class__=ai;var bN=zpp_nape.util.ZNPList_ZPP_Component=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bN.__name__=["zpp_nape","util","ZNPList_ZPP_Component"];bN.prototype.head=null;bN.prototype.begin=function(){return this.head};bN.prototype.modified=null;bN.prototype.pushmod=null;bN.prototype.length=null;bN.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bN.prototype.add=function(ec){var eb;if(dv.zpp_pool==null){eb=new dv()}else{eb=dv.zpp_pool;dv.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bN.prototype.inlined_add=function(ec){var eb;if(dv.zpp_pool==null){eb=new dv()}else{eb=dv.zpp_pool;dv.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bN.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bN.prototype.insert=function(ed,ec){var eb;if(dv.zpp_pool==null){eb=new dv()}else{eb=dv.zpp_pool;dv.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bN.prototype.inlined_insert=function(ed,ec){var eb;if(dv.zpp_pool==null){eb=new dv()}else{eb=dv.zpp_pool;dv.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bN.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dv.zpp_pool;dv.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bN.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dv.zpp_pool;dv.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bN.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bN.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bN.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dv.zpp_pool;dv.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bN.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bN.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dv.zpp_pool;dv.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bN.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=dv.zpp_pool;dv.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bN.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dv.zpp_pool;dv.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bN.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dv.zpp_pool;dv.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bN.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bN.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dv.zpp_pool;dv.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bN.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dv.zpp_pool;dv.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bN.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bN.prototype.empty=function(){return this.head==null};bN.prototype.size=function(){return this.length};bN.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bN.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bN.prototype.front=function(){return this.head.elt};bN.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bN.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bN.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bN.prototype.__class__=bN;var c7=zpp_nape.util.ZNPList_ZPP_FluidArbiter=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};c7.__name__=["zpp_nape","util","ZNPList_ZPP_FluidArbiter"];c7.prototype.head=null;c7.prototype.begin=function(){return this.head};c7.prototype.modified=null;c7.prototype.pushmod=null;c7.prototype.length=null;c7.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};c7.prototype.add=function(ec){var eb;if(bb.zpp_pool==null){eb=new bb()}else{eb=bb.zpp_pool;bb.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};c7.prototype.inlined_add=function(ec){var eb;if(bb.zpp_pool==null){eb=new bb()}else{eb=bb.zpp_pool;bb.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};c7.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};c7.prototype.insert=function(ed,ec){var eb;if(bb.zpp_pool==null){eb=new bb()}else{eb=bb.zpp_pool;bb.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};c7.prototype.inlined_insert=function(ed,ec){var eb;if(bb.zpp_pool==null){eb=new bb()}else{eb=bb.zpp_pool;bb.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};c7.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bb.zpp_pool;bb.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};c7.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bb.zpp_pool;bb.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};c7.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};c7.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};c7.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=bb.zpp_pool;bb.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};c7.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};c7.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=bb.zpp_pool;bb.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};c7.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=bb.zpp_pool;bb.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};c7.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=bb.zpp_pool;bb.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};c7.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=bb.zpp_pool;bb.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};c7.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};c7.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bb.zpp_pool;bb.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};c7.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bb.zpp_pool;bb.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};c7.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};c7.prototype.empty=function(){return this.head==null};c7.prototype.size=function(){return this.length};c7.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};c7.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};c7.prototype.front=function(){return this.head.elt};c7.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};c7.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};c7.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};c7.prototype.__class__=c7;var bd=zpp_nape.util.ZNPList_ZPP_SensorArbiter=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bd.__name__=["zpp_nape","util","ZNPList_ZPP_SensorArbiter"];bd.prototype.head=null;bd.prototype.begin=function(){return this.head};bd.prototype.modified=null;bd.prototype.pushmod=null;bd.prototype.length=null;bd.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bd.prototype.add=function(ec){var eb;if(L.zpp_pool==null){eb=new L()}else{eb=L.zpp_pool;L.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bd.prototype.inlined_add=function(ec){var eb;if(L.zpp_pool==null){eb=new L()}else{eb=L.zpp_pool;L.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bd.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bd.prototype.insert=function(ed,ec){var eb;if(L.zpp_pool==null){eb=new L()}else{eb=L.zpp_pool;L.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bd.prototype.inlined_insert=function(ed,ec){var eb;if(L.zpp_pool==null){eb=new L()}else{eb=L.zpp_pool;L.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bd.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=L.zpp_pool;L.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bd.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=L.zpp_pool;L.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bd.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bd.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bd.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=L.zpp_pool;L.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bd.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bd.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=L.zpp_pool;L.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bd.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=L.zpp_pool;L.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bd.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=L.zpp_pool;L.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bd.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=L.zpp_pool;L.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bd.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bd.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=L.zpp_pool;L.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bd.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=L.zpp_pool;L.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bd.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bd.prototype.empty=function(){return this.head==null};bd.prototype.size=function(){return this.length};bd.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bd.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bd.prototype.front=function(){return this.head.elt};bd.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bd.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bd.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bd.prototype.__class__=bd;var dP=zpp_nape.util.ZNPList_ZPP_Listener=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};dP.__name__=["zpp_nape","util","ZNPList_ZPP_Listener"];dP.prototype.head=null;dP.prototype.begin=function(){return this.head};dP.prototype.modified=null;dP.prototype.pushmod=null;dP.prototype.length=null;dP.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};dP.prototype.add=function(ec){var eb;if(e.zpp_pool==null){eb=new e()}else{eb=e.zpp_pool;e.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dP.prototype.inlined_add=function(ec){var eb;if(e.zpp_pool==null){eb=new e()}else{eb=e.zpp_pool;e.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};dP.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};dP.prototype.insert=function(ed,ec){var eb;if(e.zpp_pool==null){eb=new e()}else{eb=e.zpp_pool;e.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dP.prototype.inlined_insert=function(ed,ec){var eb;if(e.zpp_pool==null){eb=new e()}else{eb=e.zpp_pool;e.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};dP.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=e.zpp_pool;e.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dP.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=e.zpp_pool;e.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};dP.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dP.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};dP.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=e.zpp_pool;e.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dP.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};dP.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=e.zpp_pool;e.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};dP.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=e.zpp_pool;e.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};dP.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=e.zpp_pool;e.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dP.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=e.zpp_pool;e.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};dP.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};dP.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=e.zpp_pool;e.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dP.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=e.zpp_pool;e.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};dP.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};dP.prototype.empty=function(){return this.head==null};dP.prototype.size=function(){return this.length};dP.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dP.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};dP.prototype.front=function(){return this.head.elt};dP.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};dP.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};dP.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};dP.prototype.__class__=dP;var bH=zpp_nape.util.ZNPList_ZPP_ColArbiter=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bH.__name__=["zpp_nape","util","ZNPList_ZPP_ColArbiter"];bH.prototype.head=null;bH.prototype.begin=function(){return this.head};bH.prototype.modified=null;bH.prototype.pushmod=null;bH.prototype.length=null;bH.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bH.prototype.add=function(ec){var eb;if(bi.zpp_pool==null){eb=new bi()}else{eb=bi.zpp_pool;bi.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bH.prototype.inlined_add=function(ec){var eb;if(bi.zpp_pool==null){eb=new bi()}else{eb=bi.zpp_pool;bi.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bH.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bH.prototype.insert=function(ed,ec){var eb;if(bi.zpp_pool==null){eb=new bi()}else{eb=bi.zpp_pool;bi.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bH.prototype.inlined_insert=function(ed,ec){var eb;if(bi.zpp_pool==null){eb=new bi()}else{eb=bi.zpp_pool;bi.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bH.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bi.zpp_pool;bi.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bH.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bi.zpp_pool;bi.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bH.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bH.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bH.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=bi.zpp_pool;bi.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bH.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bH.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=bi.zpp_pool;bi.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bH.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=bi.zpp_pool;bi.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bH.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=bi.zpp_pool;bi.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bH.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=bi.zpp_pool;bi.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bH.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bH.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bi.zpp_pool;bi.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bH.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=bi.zpp_pool;bi.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bH.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bH.prototype.empty=function(){return this.head==null};bH.prototype.size=function(){return this.length};bH.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bH.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bH.prototype.front=function(){return this.head.elt};bH.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bH.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bH.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bH.prototype.__class__=bH;var da=zpp_nape.util.ZNPList_ZPP_InteractionGroup=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};da.__name__=["zpp_nape","util","ZNPList_ZPP_InteractionGroup"];da.prototype.head=null;da.prototype.begin=function(){return this.head};da.prototype.modified=null;da.prototype.pushmod=null;da.prototype.length=null;da.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};da.prototype.add=function(ec){var eb;if(w.zpp_pool==null){eb=new w()}else{eb=w.zpp_pool;w.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};da.prototype.inlined_add=function(ec){var eb;if(w.zpp_pool==null){eb=new w()}else{eb=w.zpp_pool;w.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};da.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};da.prototype.insert=function(ed,ec){var eb;if(w.zpp_pool==null){eb=new w()}else{eb=w.zpp_pool;w.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};da.prototype.inlined_insert=function(ed,ec){var eb;if(w.zpp_pool==null){eb=new w()}else{eb=w.zpp_pool;w.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};da.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=w.zpp_pool;w.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};da.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=w.zpp_pool;w.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};da.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};da.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};da.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=w.zpp_pool;w.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};da.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};da.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=w.zpp_pool;w.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};da.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=w.zpp_pool;w.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};da.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=w.zpp_pool;w.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};da.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=w.zpp_pool;w.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};da.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};da.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=w.zpp_pool;w.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};da.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=w.zpp_pool;w.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};da.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};da.prototype.empty=function(){return this.head==null};da.prototype.size=function(){return this.length};da.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};da.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};da.prototype.front=function(){return this.head.elt};da.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};da.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};da.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};da.prototype.__class__=da;var d4=zpp_nape.util.ZNPList_ZPP_ToiEvent=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};d4.__name__=["zpp_nape","util","ZNPList_ZPP_ToiEvent"];d4.prototype.head=null;d4.prototype.begin=function(){return this.head};d4.prototype.modified=null;d4.prototype.pushmod=null;d4.prototype.length=null;d4.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};d4.prototype.add=function(ec){var eb;if(c5.zpp_pool==null){eb=new c5()}else{eb=c5.zpp_pool;c5.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};d4.prototype.inlined_add=function(ec){var eb;if(c5.zpp_pool==null){eb=new c5()}else{eb=c5.zpp_pool;c5.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};d4.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};d4.prototype.insert=function(ed,ec){var eb;if(c5.zpp_pool==null){eb=new c5()}else{eb=c5.zpp_pool;c5.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};d4.prototype.inlined_insert=function(ed,ec){var eb;if(c5.zpp_pool==null){eb=new c5()}else{eb=c5.zpp_pool;c5.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};d4.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=c5.zpp_pool;c5.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};d4.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=c5.zpp_pool;c5.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};d4.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};d4.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};d4.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=c5.zpp_pool;c5.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};d4.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};d4.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=c5.zpp_pool;c5.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};d4.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=c5.zpp_pool;c5.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};d4.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=c5.zpp_pool;c5.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};d4.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=c5.zpp_pool;c5.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};d4.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};d4.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=c5.zpp_pool;c5.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};d4.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=c5.zpp_pool;c5.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};d4.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};d4.prototype.empty=function(){return this.head==null};d4.prototype.size=function(){return this.length};d4.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};d4.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};d4.prototype.front=function(){return this.head.elt};d4.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};d4.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};d4.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};d4.prototype.__class__=d4;var bS=zpp_nape.util.ZNPList_ConvexResult=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};bS.__name__=["zpp_nape","util","ZNPList_ConvexResult"];bS.prototype.head=null;bS.prototype.begin=function(){return this.head};bS.prototype.modified=null;bS.prototype.pushmod=null;bS.prototype.length=null;bS.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};bS.prototype.add=function(ec){var eb;if(cn.zpp_pool==null){eb=new cn()}else{eb=cn.zpp_pool;cn.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bS.prototype.inlined_add=function(ec){var eb;if(cn.zpp_pool==null){eb=new cn()}else{eb=cn.zpp_pool;cn.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};bS.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};bS.prototype.insert=function(ed,ec){var eb;if(cn.zpp_pool==null){eb=new cn()}else{eb=cn.zpp_pool;cn.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bS.prototype.inlined_insert=function(ed,ec){var eb;if(cn.zpp_pool==null){eb=new cn()}else{eb=cn.zpp_pool;cn.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};bS.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cn.zpp_pool;cn.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bS.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cn.zpp_pool;cn.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};bS.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bS.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};bS.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cn.zpp_pool;cn.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bS.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};bS.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cn.zpp_pool;cn.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};bS.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cn.zpp_pool;cn.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};bS.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cn.zpp_pool;cn.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bS.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cn.zpp_pool;cn.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};bS.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};bS.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cn.zpp_pool;cn.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bS.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cn.zpp_pool;cn.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};bS.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};bS.prototype.empty=function(){return this.head==null};bS.prototype.size=function(){return this.length};bS.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bS.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};bS.prototype.front=function(){return this.head.elt};bS.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};bS.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};bS.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};bS.prototype.__class__=bS;var ch=zpp_nape.util.ZNPList_ZPP_GeomPoly=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};ch.__name__=["zpp_nape","util","ZNPList_ZPP_GeomPoly"];ch.prototype.head=null;ch.prototype.begin=function(){return this.head};ch.prototype.modified=null;ch.prototype.pushmod=null;ch.prototype.length=null;ch.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};ch.prototype.add=function(ec){var eb;if(cM.zpp_pool==null){eb=new cM()}else{eb=cM.zpp_pool;cM.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};ch.prototype.inlined_add=function(ec){var eb;if(cM.zpp_pool==null){eb=new cM()}else{eb=cM.zpp_pool;cM.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};ch.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};ch.prototype.insert=function(ed,ec){var eb;if(cM.zpp_pool==null){eb=new cM()}else{eb=cM.zpp_pool;cM.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};ch.prototype.inlined_insert=function(ed,ec){var eb;if(cM.zpp_pool==null){eb=new cM()}else{eb=cM.zpp_pool;cM.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};ch.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cM.zpp_pool;cM.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};ch.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cM.zpp_pool;cM.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};ch.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};ch.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};ch.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cM.zpp_pool;cM.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};ch.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};ch.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=cM.zpp_pool;cM.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};ch.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=cM.zpp_pool;cM.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};ch.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cM.zpp_pool;cM.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};ch.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=cM.zpp_pool;cM.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};ch.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};ch.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cM.zpp_pool;cM.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};ch.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=cM.zpp_pool;cM.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};ch.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};ch.prototype.empty=function(){return this.head==null};ch.prototype.size=function(){return this.length};ch.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};ch.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};ch.prototype.front=function(){return this.head.elt};ch.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};ch.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};ch.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};ch.prototype.__class__=ch;var cf=zpp_nape.util.ZNPList_RayResult=function(){this.length=0;this.pushmod=false;this.modified=false;this.head=null};cf.__name__=["zpp_nape","util","ZNPList_RayResult"];cf.prototype.head=null;cf.prototype.begin=function(){return this.head};cf.prototype.modified=null;cf.prototype.pushmod=null;cf.prototype.length=null;cf.prototype.setbegin=function(ea){this.head=ea;this.modified=true;this.pushmod=true};cf.prototype.add=function(ec){var eb;if(dp.zpp_pool==null){eb=new dp()}else{eb=dp.zpp_pool;dp.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};cf.prototype.inlined_add=function(ec){var eb;if(dp.zpp_pool==null){eb=new dp()}else{eb=dp.zpp_pool;dp.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;ea.next=this.head;this.head=ea;this.modified=true;this.length++;return ec};cf.prototype.addAll=function(ea){var eb=ea.head;while(eb!=null){this.add(eb.elt);eb=eb.next}};cf.prototype.insert=function(ed,ec){var eb;if(dp.zpp_pool==null){eb=new dp()}else{eb=dp.zpp_pool;dp.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};cf.prototype.inlined_insert=function(ed,ec){var eb;if(dp.zpp_pool==null){eb=new dp()}else{eb=dp.zpp_pool;dp.zpp_pool=eb.next;eb.next=null}eb.elt=ec;var ea=eb;if(ed==null){ea.next=this.head;this.head=ea}else{ea.next=ed.next;ed.next=ea}this.pushmod=this.modified=true;this.length++;return ea};cf.prototype.pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dp.zpp_pool;dp.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};cf.prototype.inlined_pop=function(){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dp.zpp_pool;dp.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--};cf.prototype.pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};cf.prototype.inlined_pop_unsafe=function(){var ea=this.head.elt;this.pop();return ea};cf.prototype.remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dp.zpp_pool;dp.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};cf.prototype.try_remove=function(ec){var eb=null;var ed=this.head;var ea=false;while(ed!=null){if(ed.elt==ec){this.erase(eb);ea=true;break}eb=ed;ed=ed.next}return ea};cf.prototype.inlined_remove=function(ed){var ec=null;var ef=this.head;while(ef!=null){if(ef.elt==ed){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ee=ea;ee.elt=null;ee.next=dp.zpp_pool;dp.zpp_pool=ee;this.modified=true;this.length--;this.pushmod=true;break}ec=ef;ef=ef.next}};cf.prototype.inlined_try_remove=function(ee){var ed=null;var eg=this.head;var eb=false;while(eg!=null){if(eg.elt==ee){var ea;var ec;if(ed==null){ea=this.head;ec=ea.next;this.head=ec;if(this.head==null){this.pushmod=true}}else{ea=ed.next;ec=ea.next;ed.next=ec;if(ec==null){this.pushmod=true}}var ef=ea;ef.elt=null;ef.next=dp.zpp_pool;dp.zpp_pool=ef;this.modified=true;this.length--;this.pushmod=true;eb=true;break}ed=eg;eg=eg.next}return eb};cf.prototype.erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dp.zpp_pool;dp.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};cf.prototype.inlined_erase=function(ec){var ea;var eb;if(ec==null){ea=this.head;eb=ea.next;this.head=eb;if(this.head==null){this.pushmod=true}}else{ea=ec.next;eb=ea.next;ec.next=eb;if(eb==null){this.pushmod=true}}var ed=ea;ed.elt=null;ed.next=dp.zpp_pool;dp.zpp_pool=ed;this.modified=true;this.length--;this.pushmod=true;return eb};cf.prototype.splice=function(ea,eb){while(eb-->0&&ea.next!=null){this.erase(ea)}return ea.next};cf.prototype.clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dp.zpp_pool;dp.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};cf.prototype.inlined_clear=function(){while(this.head!=null){var ea=this.head;this.head=ea.next;ea.elt=null;ea.next=dp.zpp_pool;dp.zpp_pool=ea;if(this.head==null){this.pushmod=true}this.modified=true;this.length--}this.pushmod=true};cf.prototype.reverse=function(){var ec=this.head;var eb=null;while(ec!=null){var ea=ec.next;ec.next=eb;this.head=ec;eb=ec;ec=ea}this.modified=true;this.pushmod=true};cf.prototype.empty=function(){return this.head==null};cf.prototype.size=function(){return this.length};cf.prototype.has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};cf.prototype.inlined_has=function(ec){var ea;ea=false;var eb=this.head;while(eb!=null){if(eb.elt==ec){ea=true;break}eb=eb.next}return ea};cf.prototype.front=function(){return this.head.elt};cf.prototype.back=function(){var ea=this.head;var eb=ea;while(eb!=null){ea=eb;eb=eb.next}return ea.elt};cf.prototype.iterator_at=function(eb){var ea=this.head;while(eb-->0&&ea!=null){ea=ea.next}return ea};cf.prototype.at=function(eb){var ea=this.iterator_at(eb);if(ea!=null){return ea.elt}else{return null}};cf.prototype.__class__=cf;var b=zpp_nape.util.ZNPNode_ZPP_CbType=function(){this.elt=null;this.next=null};b.__name__=["zpp_nape","util","ZNPNode_ZPP_CbType"];b.prototype.next=null;b.prototype.alloc=function(){};b.prototype.free=function(){this.elt=null};b.prototype.elt=null;b.prototype.elem=function(){return this.elt};b.prototype.__class__=b;var cF=zpp_nape.util.ZNPNode_ZPP_CallbackSet=function(){this.elt=null;this.next=null};cF.__name__=["zpp_nape","util","ZNPNode_ZPP_CallbackSet"];cF.prototype.next=null;cF.prototype.alloc=function(){};cF.prototype.free=function(){this.elt=null};cF.prototype.elt=null;cF.prototype.elem=function(){return this.elt};cF.prototype.__class__=cF;var b9=zpp_nape.util.ZNPNode_ZPP_Shape=function(){this.elt=null;this.next=null};b9.__name__=["zpp_nape","util","ZNPNode_ZPP_Shape"];b9.prototype.next=null;b9.prototype.alloc=function(){};b9.prototype.free=function(){this.elt=null};b9.prototype.elt=null;b9.prototype.elem=function(){return this.elt};b9.prototype.__class__=b9;var bE=zpp_nape.util.ZNPNode_ZPP_Body=function(){this.elt=null;this.next=null};bE.__name__=["zpp_nape","util","ZNPNode_ZPP_Body"];bE.prototype.next=null;bE.prototype.alloc=function(){};bE.prototype.free=function(){this.elt=null};bE.prototype.elt=null;bE.prototype.elem=function(){return this.elt};bE.prototype.__class__=bE;var cx=zpp_nape.util.ZNPNode_ZPP_Constraint=function(){this.elt=null;this.next=null};cx.__name__=["zpp_nape","util","ZNPNode_ZPP_Constraint"];cx.prototype.next=null;cx.prototype.alloc=function(){};cx.prototype.free=function(){this.elt=null};cx.prototype.elt=null;cx.prototype.elem=function(){return this.elt};cx.prototype.__class__=cx;var Q=zpp_nape.util.ZNPNode_ZPP_Compound=function(){this.elt=null;this.next=null};Q.__name__=["zpp_nape","util","ZNPNode_ZPP_Compound"];Q.prototype.next=null;Q.prototype.alloc=function(){};Q.prototype.free=function(){this.elt=null};Q.prototype.elt=null;Q.prototype.elem=function(){return this.elt};Q.prototype.__class__=Q;var dL=zpp_nape.util.ZNPNode_ZPP_Arbiter=function(){this.elt=null;this.next=null};dL.__name__=["zpp_nape","util","ZNPNode_ZPP_Arbiter"];dL.prototype.next=null;dL.prototype.alloc=function(){};dL.prototype.free=function(){this.elt=null};dL.prototype.elt=null;dL.prototype.elem=function(){return this.elt};dL.prototype.__class__=dL;var aF=zpp_nape.util.ZNPNode_ZPP_InteractionListener=function(){this.elt=null;this.next=null};aF.__name__=["zpp_nape","util","ZNPNode_ZPP_InteractionListener"];aF.prototype.next=null;aF.prototype.alloc=function(){};aF.prototype.free=function(){this.elt=null};aF.prototype.elt=null;aF.prototype.elem=function(){return this.elt};aF.prototype.__class__=aF;var cO=zpp_nape.util.ZNPNode_ZPP_CbSet=function(){this.elt=null;this.next=null};cO.__name__=["zpp_nape","util","ZNPNode_ZPP_CbSet"];cO.prototype.next=null;cO.prototype.alloc=function(){};cO.prototype.free=function(){this.elt=null};cO.prototype.elt=null;cO.prototype.elem=function(){return this.elt};cO.prototype.__class__=cO;var g=zpp_nape.util.ZNPNode_ZPP_Interactor=function(){this.elt=null;this.next=null};g.__name__=["zpp_nape","util","ZNPNode_ZPP_Interactor"];g.prototype.next=null;g.prototype.alloc=function(){};g.prototype.free=function(){this.elt=null};g.prototype.elt=null;g.prototype.elem=function(){return this.elt};g.prototype.__class__=g;var aT=zpp_nape.util.ZNPNode_ZPP_BodyListener=function(){this.elt=null;this.next=null};aT.__name__=["zpp_nape","util","ZNPNode_ZPP_BodyListener"];aT.prototype.next=null;aT.prototype.alloc=function(){};aT.prototype.free=function(){this.elt=null};aT.prototype.elt=null;aT.prototype.elem=function(){return this.elt};aT.prototype.__class__=aT;var cd=zpp_nape.util.ZNPNode_ZPP_CbSetPair=function(){this.elt=null;this.next=null};cd.__name__=["zpp_nape","util","ZNPNode_ZPP_CbSetPair"];cd.prototype.next=null;cd.prototype.alloc=function(){};cd.prototype.free=function(){this.elt=null};cd.prototype.elt=null;cd.prototype.elem=function(){return this.elt};cd.prototype.__class__=cd;var aR=zpp_nape.util.ZNPNode_ZPP_ConstraintListener=function(){this.elt=null;this.next=null};aR.__name__=["zpp_nape","util","ZNPNode_ZPP_ConstraintListener"];aR.prototype.next=null;aR.prototype.alloc=function(){};aR.prototype.free=function(){this.elt=null};aR.prototype.elt=null;aR.prototype.elem=function(){return this.elt};aR.prototype.__class__=aR;var d3=zpp_nape.util.ZNPNode_ZPP_CutInt=function(){this.elt=null;this.next=null};d3.__name__=["zpp_nape","util","ZNPNode_ZPP_CutInt"];d3.prototype.next=null;d3.prototype.alloc=function(){};d3.prototype.free=function(){this.elt=null};d3.prototype.elt=null;d3.prototype.elem=function(){return this.elt};d3.prototype.__class__=d3;var cH=zpp_nape.util.ZNPNode_ZPP_CutVert=function(){this.elt=null;this.next=null};cH.__name__=["zpp_nape","util","ZNPNode_ZPP_CutVert"];cH.prototype.next=null;cH.prototype.alloc=function(){};cH.prototype.free=function(){this.elt=null};cH.prototype.elt=null;cH.prototype.elem=function(){return this.elt};cH.prototype.__class__=cH;var V=zpp_nape.util.ZNPNode_ZPP_PartitionVertex=function(){this.elt=null;this.next=null};V.__name__=["zpp_nape","util","ZNPNode_ZPP_PartitionVertex"];V.prototype.next=null;V.prototype.alloc=function(){};V.prototype.free=function(){this.elt=null};V.prototype.elt=null;V.prototype.elem=function(){return this.elt};V.prototype.__class__=V;var o=zpp_nape.util.ZNPNode_ZPP_SimplifyP=function(){this.elt=null;this.next=null};o.__name__=["zpp_nape","util","ZNPNode_ZPP_SimplifyP"];o.prototype.next=null;o.prototype.alloc=function(){};o.prototype.free=function(){this.elt=null};o.prototype.elt=null;o.prototype.elem=function(){return this.elt};o.prototype.__class__=o;var dU=zpp_nape.util.ZNPNode_ZPP_PartitionedPoly=function(){this.elt=null;this.next=null};dU.__name__=["zpp_nape","util","ZNPNode_ZPP_PartitionedPoly"];dU.prototype.next=null;dU.prototype.alloc=function(){};dU.prototype.free=function(){this.elt=null};dU.prototype.elt=null;dU.prototype.elem=function(){return this.elt};dU.prototype.__class__=dU;var dS=zpp_nape.util.ZNPNode_ZPP_GeomVert=function(){this.elt=null;this.next=null};dS.__name__=["zpp_nape","util","ZNPNode_ZPP_GeomVert"];dS.prototype.next=null;dS.prototype.alloc=function(){};dS.prototype.free=function(){this.elt=null};dS.prototype.elt=null;dS.prototype.elem=function(){return this.elt};dS.prototype.__class__=dS;var d6=zpp_nape.util.ZNPNode_ZPP_SimpleVert=function(){this.elt=null;this.next=null};d6.__name__=["zpp_nape","util","ZNPNode_ZPP_SimpleVert"];d6.prototype.next=null;d6.prototype.alloc=function(){};d6.prototype.free=function(){this.elt=null};d6.prototype.elt=null;d6.prototype.elem=function(){return this.elt};d6.prototype.__class__=d6;var dY=zpp_nape.util.ZNPNode_ZPP_SimpleEvent=function(){this.elt=null;this.next=null};dY.__name__=["zpp_nape","util","ZNPNode_ZPP_SimpleEvent"];dY.prototype.next=null;dY.prototype.alloc=function(){};dY.prototype.free=function(){this.elt=null};dY.prototype.elt=null;dY.prototype.elem=function(){return this.elt};dY.prototype.__class__=dY;var aV=zpp_nape.util.ZNPNode_ZPP_Vec2=function(){this.elt=null;this.next=null};aV.__name__=["zpp_nape","util","ZNPNode_ZPP_Vec2"];aV.prototype.next=null;aV.prototype.alloc=function(){};aV.prototype.free=function(){this.elt=null};aV.prototype.elt=null;aV.prototype.elem=function(){return this.elt};aV.prototype.__class__=aV;var cl=zpp_nape.util.ZNPNode_ZPP_AABBPair=function(){this.elt=null;this.next=null};cl.__name__=["zpp_nape","util","ZNPNode_ZPP_AABBPair"];cl.prototype.next=null;cl.prototype.alloc=function(){};cl.prototype.free=function(){this.elt=null};cl.prototype.elt=null;cl.prototype.elem=function(){return this.elt};cl.prototype.__class__=cl;var cq=zpp_nape.util.ZNPNode_ZPP_Edge=function(){this.elt=null;this.next=null};cq.__name__=["zpp_nape","util","ZNPNode_ZPP_Edge"];cq.prototype.next=null;cq.prototype.alloc=function(){};cq.prototype.free=function(){this.elt=null};cq.prototype.elt=null;cq.prototype.elem=function(){return this.elt};cq.prototype.__class__=cq;var d2=zpp_nape.util.ZNPNode_ZPP_AABBNode=function(){this.elt=null;this.next=null};d2.__name__=["zpp_nape","util","ZNPNode_ZPP_AABBNode"];d2.prototype.next=null;d2.prototype.alloc=function(){};d2.prototype.free=function(){this.elt=null};d2.prototype.elt=null;d2.prototype.elem=function(){return this.elt};d2.prototype.__class__=d2;var dv=zpp_nape.util.ZNPNode_ZPP_Component=function(){this.elt=null;this.next=null};dv.__name__=["zpp_nape","util","ZNPNode_ZPP_Component"];dv.prototype.next=null;dv.prototype.alloc=function(){};dv.prototype.free=function(){this.elt=null};dv.prototype.elt=null;dv.prototype.elem=function(){return this.elt};dv.prototype.__class__=dv;var bb=zpp_nape.util.ZNPNode_ZPP_FluidArbiter=function(){this.elt=null;this.next=null};bb.__name__=["zpp_nape","util","ZNPNode_ZPP_FluidArbiter"];bb.prototype.next=null;bb.prototype.alloc=function(){};bb.prototype.free=function(){this.elt=null};bb.prototype.elt=null;bb.prototype.elem=function(){return this.elt};bb.prototype.__class__=bb;var L=zpp_nape.util.ZNPNode_ZPP_SensorArbiter=function(){this.elt=null;this.next=null};L.__name__=["zpp_nape","util","ZNPNode_ZPP_SensorArbiter"];L.prototype.next=null;L.prototype.alloc=function(){};L.prototype.free=function(){this.elt=null};L.prototype.elt=null;L.prototype.elem=function(){return this.elt};L.prototype.__class__=L;var e=zpp_nape.util.ZNPNode_ZPP_Listener=function(){this.elt=null;this.next=null};e.__name__=["zpp_nape","util","ZNPNode_ZPP_Listener"];e.prototype.next=null;e.prototype.alloc=function(){};e.prototype.free=function(){this.elt=null};e.prototype.elt=null;e.prototype.elem=function(){return this.elt};e.prototype.__class__=e;var bi=zpp_nape.util.ZNPNode_ZPP_ColArbiter=function(){this.elt=null;this.next=null};bi.__name__=["zpp_nape","util","ZNPNode_ZPP_ColArbiter"];bi.prototype.next=null;bi.prototype.alloc=function(){};bi.prototype.free=function(){this.elt=null};bi.prototype.elt=null;bi.prototype.elem=function(){return this.elt};bi.prototype.__class__=bi;var w=zpp_nape.util.ZNPNode_ZPP_InteractionGroup=function(){this.elt=null;this.next=null};w.__name__=["zpp_nape","util","ZNPNode_ZPP_InteractionGroup"];w.prototype.next=null;w.prototype.alloc=function(){};w.prototype.free=function(){this.elt=null};w.prototype.elt=null;w.prototype.elem=function(){return this.elt};w.prototype.__class__=w;var c5=zpp_nape.util.ZNPNode_ZPP_ToiEvent=function(){this.elt=null;this.next=null};c5.__name__=["zpp_nape","util","ZNPNode_ZPP_ToiEvent"];c5.prototype.next=null;c5.prototype.alloc=function(){};c5.prototype.free=function(){this.elt=null};c5.prototype.elt=null;c5.prototype.elem=function(){return this.elt};c5.prototype.__class__=c5;var cn=zpp_nape.util.ZNPNode_ConvexResult=function(){this.elt=null;this.next=null};cn.__name__=["zpp_nape","util","ZNPNode_ConvexResult"];cn.prototype.next=null;cn.prototype.alloc=function(){};cn.prototype.free=function(){this.elt=null};cn.prototype.elt=null;cn.prototype.elem=function(){return this.elt};cn.prototype.__class__=cn;var cM=zpp_nape.util.ZNPNode_ZPP_GeomPoly=function(){this.elt=null;this.next=null};cM.__name__=["zpp_nape","util","ZNPNode_ZPP_GeomPoly"];cM.prototype.next=null;cM.prototype.alloc=function(){};cM.prototype.free=function(){this.elt=null};cM.prototype.elt=null;cM.prototype.elem=function(){return this.elt};cM.prototype.__class__=cM;var dp=zpp_nape.util.ZNPNode_RayResult=function(){this.elt=null;this.next=null};dp.__name__=["zpp_nape","util","ZNPNode_RayResult"];dp.prototype.next=null;dp.prototype.alloc=function(){};dp.prototype.free=function(){this.elt=null};dp.prototype.elt=null;dp.prototype.elem=function(){return this.elt};dp.prototype.__class__=dp;var ao=zpp_nape.util.ZPP_MixVec2List=function(){this.at_index=0;this.at_ite=null;this.zip_length=false;this._length=0;this.inner=null;aN.call(this);this.at_ite=null;this.at_index=0;this.zip_length=true;this._length=0};ao.__name__=["zpp_nape","util","ZPP_MixVec2List"];ao.__super__=aN;ao.prototype=Object.create(aN.prototype);ao.get=function(eb,ec){if(ec==null){ec=false}var ea=new ao();ea.inner=eb;ea.zpp_inner.immutable=ec;return ea};ao.prototype.inner=null;ao.prototype._length=null;ao.prototype.zip_length=null;ao.prototype.at_ite=null;ao.prototype.at_index=null;ao.prototype.zpp_gl=function(){this.zpp_vm();if(this.zip_length){this._length=0;var ea=this.inner.next;while(ea!=null){this._length++;ea=ea.next}this.zip_length=false}return this._length};ao.prototype.zpp_vm=function(){this.zpp_inner.validate();if(this.inner.modified){this.zip_length=true;this._length=0;this.at_ite=null}};ao.prototype.at=function(ea){this.zpp_vm();if(this.zpp_inner.reverse_flag){ea=this.zpp_gl()-1-ea}if(eaec){return ec}else{return ea}}};aH.clamp=function(eb,ec,ea){if(ebea){return ea}else{return eb}}};aH.prototype.__class__=aH;var au=zpp_nape.util.ZPP_PubPool=function(){};au.__name__=["zpp_nape","util","ZPP_PubPool"];au.prototype.__class__=au;var dV=zpp_nape.util.ZPP_Set_ZPP_Body=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};dV.__name__=["zpp_nape","util","ZPP_Set_ZPP_Body"];dV.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};dV.prototype.alloc=function(){};dV.prototype.lt=null;dV.prototype.swapped=null;dV.prototype.data=null;dV.prototype.prev=null;dV.prototype.next=null;dV.prototype.parent=null;dV.prototype.colour=null;dV.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};dV.prototype.empty=function(){return this.parent==null};dV.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};dV.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};dV.prototype.has=function(ea){return this.find(ea)!=null};dV.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};dV.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};dV.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};dV.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};dV.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};dV.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};dV.prototype.remove=function(ea){this.remove_node(this.find(ea))};dV.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};dV.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};dV.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};dV.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};dV.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=dV.zpp_pool;dV.zpp_pool=ea};dV.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=dV.zpp_pool;dV.zpp_pool=eb;ec=ea}}}this.parent=null}};dV.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=dV.zpp_pool;dV.zpp_pool=ec;ed=eb}}}this.parent=null}};dV.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=dV.zpp_pool;dV.zpp_pool=ec;return eb};dV.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};dV.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};dV.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};dV.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};dV.prototype.insert=function(eb){var ea;if(dV.zpp_pool==null){ea=new dV()}else{ea=dV.zpp_pool;dV.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};dV.prototype.__class__=dV;var p=zpp_nape.util.ZPP_Set_ZPP_CbSetPair=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};p.__name__=["zpp_nape","util","ZPP_Set_ZPP_CbSetPair"];p.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};p.prototype.alloc=function(){};p.prototype.lt=null;p.prototype.swapped=null;p.prototype.data=null;p.prototype.prev=null;p.prototype.next=null;p.prototype.parent=null;p.prototype.colour=null;p.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};p.prototype.empty=function(){return this.parent==null};p.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};p.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};p.prototype.has=function(ea){return this.find(ea)!=null};p.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};p.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};p.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};p.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};p.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};p.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};p.prototype.remove=function(ea){this.remove_node(this.find(ea))};p.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};p.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};p.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};p.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};p.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=p.zpp_pool;p.zpp_pool=ea};p.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=p.zpp_pool;p.zpp_pool=eb;ec=ea}}}this.parent=null}};p.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=p.zpp_pool;p.zpp_pool=ec;ed=eb}}}this.parent=null}};p.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=p.zpp_pool;p.zpp_pool=ec;return eb};p.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};p.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};p.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};p.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};p.prototype.insert=function(eb){var ea;if(p.zpp_pool==null){ea=new p()}else{ea=p.zpp_pool;p.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};p.prototype.__class__=p;var b8=zpp_nape.util.ZPP_Set_ZPP_PartitionVertex=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};b8.__name__=["zpp_nape","util","ZPP_Set_ZPP_PartitionVertex"];b8.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};b8.prototype.alloc=function(){};b8.prototype.lt=null;b8.prototype.swapped=null;b8.prototype.data=null;b8.prototype.prev=null;b8.prototype.next=null;b8.prototype.parent=null;b8.prototype.colour=null;b8.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};b8.prototype.empty=function(){return this.parent==null};b8.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};b8.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};b8.prototype.has=function(ea){return this.find(ea)!=null};b8.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};b8.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};b8.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};b8.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};b8.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};b8.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};b8.prototype.remove=function(ea){this.remove_node(this.find(ea))};b8.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};b8.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};b8.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};b8.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};b8.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=b8.zpp_pool;b8.zpp_pool=ea};b8.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=b8.zpp_pool;b8.zpp_pool=eb;ec=ea}}}this.parent=null}};b8.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=b8.zpp_pool;b8.zpp_pool=ec;ed=eb}}}this.parent=null}};b8.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=b8.zpp_pool;b8.zpp_pool=ec;return eb};b8.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};b8.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};b8.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};b8.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};b8.prototype.insert=function(eb){var ea;if(b8.zpp_pool==null){ea=new b8()}else{ea=b8.zpp_pool;b8.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};b8.prototype.__class__=b8;var am=zpp_nape.util.ZPP_Set_ZPP_PartitionPair=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};am.__name__=["zpp_nape","util","ZPP_Set_ZPP_PartitionPair"];am.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};am.prototype.alloc=function(){};am.prototype.lt=null;am.prototype.swapped=null;am.prototype.data=null;am.prototype.prev=null;am.prototype.next=null;am.prototype.parent=null;am.prototype.colour=null;am.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};am.prototype.empty=function(){return this.parent==null};am.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};am.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};am.prototype.has=function(ea){return this.find(ea)!=null};am.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};am.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};am.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};am.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};am.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};am.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};am.prototype.remove=function(ea){this.remove_node(this.find(ea))};am.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};am.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};am.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};am.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};am.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=am.zpp_pool;am.zpp_pool=ea};am.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=am.zpp_pool;am.zpp_pool=eb;ec=ea}}}this.parent=null}};am.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=am.zpp_pool;am.zpp_pool=ec;ed=eb}}}this.parent=null}};am.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=am.zpp_pool;am.zpp_pool=ec;return eb};am.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};am.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};am.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};am.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};am.prototype.insert=function(eb){var ea;if(am.zpp_pool==null){ea=new am()}else{ea=am.zpp_pool;am.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};am.prototype.__class__=am;var bX=zpp_nape.util.ZPP_Set_ZPP_SimpleVert=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};bX.__name__=["zpp_nape","util","ZPP_Set_ZPP_SimpleVert"];bX.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};bX.prototype.alloc=function(){};bX.prototype.lt=null;bX.prototype.swapped=null;bX.prototype.data=null;bX.prototype.prev=null;bX.prototype.next=null;bX.prototype.parent=null;bX.prototype.colour=null;bX.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};bX.prototype.empty=function(){return this.parent==null};bX.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};bX.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};bX.prototype.has=function(ea){return this.find(ea)!=null};bX.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};bX.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};bX.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};bX.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};bX.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};bX.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};bX.prototype.remove=function(ea){this.remove_node(this.find(ea))};bX.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};bX.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};bX.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};bX.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};bX.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=bX.zpp_pool;bX.zpp_pool=ea};bX.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=bX.zpp_pool;bX.zpp_pool=eb;ec=ea}}}this.parent=null}};bX.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=bX.zpp_pool;bX.zpp_pool=ec;ed=eb}}}this.parent=null}};bX.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=bX.zpp_pool;bX.zpp_pool=ec;return eb};bX.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};bX.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};bX.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};bX.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};bX.prototype.insert=function(eb){var ea;if(bX.zpp_pool==null){ea=new bX()}else{ea=bX.zpp_pool;bX.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};bX.prototype.__class__=bX;var bD=zpp_nape.util.ZPP_Set_ZPP_SimpleSeg=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};bD.__name__=["zpp_nape","util","ZPP_Set_ZPP_SimpleSeg"];bD.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};bD.prototype.alloc=function(){};bD.prototype.lt=null;bD.prototype.swapped=null;bD.prototype.data=null;bD.prototype.prev=null;bD.prototype.next=null;bD.prototype.parent=null;bD.prototype.colour=null;bD.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};bD.prototype.empty=function(){return this.parent==null};bD.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};bD.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};bD.prototype.has=function(ea){return this.find(ea)!=null};bD.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};bD.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};bD.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};bD.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};bD.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};bD.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};bD.prototype.remove=function(ea){this.remove_node(this.find(ea))};bD.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};bD.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};bD.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};bD.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};bD.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=bD.zpp_pool;bD.zpp_pool=ea};bD.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=bD.zpp_pool;bD.zpp_pool=eb;ec=ea}}}this.parent=null}};bD.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=bD.zpp_pool;bD.zpp_pool=ec;ed=eb}}}this.parent=null}};bD.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=bD.zpp_pool;bD.zpp_pool=ec;return eb};bD.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};bD.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};bD.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};bD.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};bD.prototype.insert=function(eb){var ea;if(bD.zpp_pool==null){ea=new bD()}else{ea=bD.zpp_pool;bD.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};bD.prototype.__class__=bD;var bl=zpp_nape.util.ZPP_Set_ZPP_SimpleEvent=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};bl.__name__=["zpp_nape","util","ZPP_Set_ZPP_SimpleEvent"];bl.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};bl.prototype.alloc=function(){};bl.prototype.lt=null;bl.prototype.swapped=null;bl.prototype.data=null;bl.prototype.prev=null;bl.prototype.next=null;bl.prototype.parent=null;bl.prototype.colour=null;bl.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};bl.prototype.empty=function(){return this.parent==null};bl.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};bl.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};bl.prototype.has=function(ea){return this.find(ea)!=null};bl.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};bl.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};bl.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};bl.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};bl.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};bl.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};bl.prototype.remove=function(ea){this.remove_node(this.find(ea))};bl.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};bl.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};bl.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};bl.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};bl.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=bl.zpp_pool;bl.zpp_pool=ea};bl.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=bl.zpp_pool;bl.zpp_pool=eb;ec=ea}}}this.parent=null}};bl.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=bl.zpp_pool;bl.zpp_pool=ec;ed=eb}}}this.parent=null}};bl.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=bl.zpp_pool;bl.zpp_pool=ec;return eb};bl.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};bl.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};bl.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};bl.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};bl.prototype.insert=function(eb){var ea;if(bl.zpp_pool==null){ea=new bl()}else{ea=bl.zpp_pool;bl.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};bl.prototype.__class__=bl;var dT=zpp_nape.util.ZPP_Set_ZPP_CbSet=function(){this.colour=0;this.parent=null;this.next=null;this.prev=null;this.data=null;this.swapped=null;this.lt=null};dT.__name__=["zpp_nape","util","ZPP_Set_ZPP_CbSet"];dT.prototype.free=function(){this.data=null;this.lt=null;this.swapped=null};dT.prototype.alloc=function(){};dT.prototype.lt=null;dT.prototype.swapped=null;dT.prototype.data=null;dT.prototype.prev=null;dT.prototype.next=null;dT.prototype.parent=null;dT.prototype.colour=null;dT.prototype.verify=function(){if(!this.empty()){var ed=this.parent;while(ed.prev!=null){ed=ed.prev}while(ed!=null){var eb=ed.data;var ee=true;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!ee){if(!this.lt(eb,ea)&&this.lt(ea,eb)){return false}}else{if(eb==ea){ee=false}else{if(!this.lt(ea,eb)&&this.lt(eb,ea)){return false}}}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}if(ed.next!=null){ed=ed.next;while(ed.prev!=null){ed=ed.prev}}else{while(ed.parent!=null&&ed==ed.parent.next){ed=ed.parent}ed=ed.parent}}}return true};dT.prototype.empty=function(){return this.parent==null};dT.prototype.singular=function(){if(this.parent!=null&&this.parent.prev==null){return this.parent.next==null}else{return false}};dT.prototype.size=function(){var ea=0;if(!this.empty()){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}while(eb!=null){++ea;if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{while(eb.parent!=null&&eb==eb.parent.next){eb=eb.parent}eb=eb.parent}}}return ea};dT.prototype.has=function(ea){return this.find(ea)!=null};dT.prototype.find=function(ea){var eb=this.parent;while(eb!=null&&eb.data!=ea){if(this.lt(ea,eb.data)){eb=eb.prev}else{eb=eb.next}}return eb};dT.prototype.has_weak=function(ea){return this.find_weak(ea)!=null};dT.prototype.find_weak=function(ea){var eb=this.parent;while(eb!=null){if(this.lt(ea,eb.data)){eb=eb.prev}else{if(this.lt(eb.data,ea)){eb=eb.next}else{break}}}return eb};dT.prototype.lower_bound=function(ed){var eb=null;if(!this.empty()){var ec=this.parent;while(ec.prev!=null){ec=ec.prev}while(ec!=null){var ea=ec.data;if(!this.lt(ea,ed)){eb=ea;break}if(ec.next!=null){ec=ec.next;while(ec.prev!=null){ec=ec.prev}}else{while(ec.parent!=null&&ec==ec.parent.next){ec=ec.parent}ec=ec.parent}}}return eb};dT.prototype.first=function(){var ea=this.parent;while(ea.prev!=null){ea=ea.prev}return ea.data};dT.prototype.pop_front=function(){var eb=this.parent;while(eb.prev!=null){eb=eb.prev}var ea=eb.data;this.remove_node(eb);return ea};dT.prototype.remove=function(ea){this.remove_node(this.find(ea))};dT.prototype.successor_node=function(eb){if(eb.next!=null){eb=eb.next;while(eb.prev!=null){eb=eb.prev}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.prev!=ea){ea=eb;eb=eb.parent}}return eb};dT.prototype.predecessor_node=function(eb){if(eb.prev!=null){eb=eb.prev;while(eb.next!=null){eb=eb.next}}else{var ea=eb;eb=eb.parent;while(eb!=null&&eb.next!=ea){ea=eb;eb=eb.parent}}return eb};dT.prototype.successor=function(eb){var ea=this.successor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};dT.prototype.predecessor=function(eb){var ea=this.predecessor_node(this.find(eb));if(ea==null){return null}else{return ea.data}};dT.prototype.remove_node=function(eh){if(eh.next!=null&&eh.prev!=null){var ec=eh.next;while(ec.prev!=null){ec=ec.prev}var ei=eh.data;eh.data=ec.data;ec.data=ei;if(this.swapped!=null){this.swapped(eh.data,ec.data)}eh=ec}var eb=eh.prev==null?eh.next:eh.prev;if(eh.colour==1){if(eh.prev!=null||eh.next!=null){eb.colour=1}else{if(eh.parent!=null){var eg=eh.parent;while(true){eg.colour++;eg.prev.colour--;eg.next.colour--;var ee=eg.prev;if(ee.colour==-1){this.__fix_neg_red(ee);break}else{if(ee.colour==0){if(ee.prev!=null&&ee.prev.colour==0){this.__fix_dbl_red(ee.prev);break}if(ee.next!=null&&ee.next.colour==0){this.__fix_dbl_red(ee.next);break}}}var ed=eg.next;if(ed.colour==-1){this.__fix_neg_red(ed);break}else{if(ed.colour==0){if(ed.prev!=null&&ed.prev.colour==0){this.__fix_dbl_red(ed.prev);break}if(ed.next!=null&&ed.next.colour==0){this.__fix_dbl_red(ed.next);break}}}if(eg.colour==2){if(eg.parent==null){eg.colour=1}else{eg=eg.parent;continue}}break}}}}var ef=eh.parent;if(ef==null){this.parent=eb}else{if(ef.prev==eh){ef.prev=eb}else{ef.next=eb}}if(eb!=null){eb.parent=ef}eh.parent=eh.prev=eh.next=null;var ea=eh;ea.data=null;ea.lt=null;ea.swapped=null;ea.next=dT.zpp_pool;dT.zpp_pool=ea};dT.prototype.clear=function(){if(this.parent!=null){var ec=this.parent;while(ec!=null){if(ec.prev!=null){ec=ec.prev}else{if(ec.next!=null){ec=ec.next}else{var ea=ec.parent;if(ea!=null){if(ec==ea.prev){ea.prev=null}else{ea.next=null}ec.parent=null}var eb=ec;eb.data=null;eb.lt=null;eb.swapped=null;eb.next=dT.zpp_pool;dT.zpp_pool=eb;ec=ea}}}this.parent=null}};dT.prototype.clear_with=function(ea){if(this.parent==null){return}else{var ed=this.parent;while(ed!=null){if(ed.prev!=null){ed=ed.prev}else{if(ed.next!=null){ed=ed.next}else{ea(ed.data);var eb=ed.parent;if(eb!=null){if(ed==eb.prev){eb.prev=null}else{eb.next=null}ed.parent=null}var ec=ed;ec.data=null;ec.lt=null;ec.swapped=null;ec.next=dT.zpp_pool;dT.zpp_pool=ec;ed=eb}}}this.parent=null}};dT.prototype.clear_node=function(ec,ea){ea(ec.data);var eb=ec.parent;if(eb!=null){if(ec==eb.prev){eb.prev=null}else{eb.next=null}ec.parent=null}ec.data=null;ec.lt=null;ec.swapped=null;ec.next=dT.zpp_pool;dT.zpp_pool=ec;return eb};dT.prototype.__fix_neg_red=function(ee){var ek=ee.parent;var ec;if(ek.prev==ee){var ea=ee.prev;var ei=ee.next;var el=ei.prev;var eg=ei.next;ea.colour=0;ee.colour=ek.colour=1;ee.next=el;if(el!=null){el.parent=ee}var em=ek.data;ek.data=ei.data;ei.data=em;if(this.swapped!=null){this.swapped(ek.data,ei.data)}ei.prev=eg;if(eg!=null){eg.parent=ei}ei.next=ek.next;if(ek.next!=null){ek.next.parent=ei}ek.next=ei;if(ei!=null){ei.parent=ek}ec=ea}else{var ed=ee.next;var eb=ee.prev;var ej=eb.next;var eh=eb.prev;ed.colour=0;ee.colour=ek.colour=1;ee.prev=ej;if(ej!=null){ej.parent=ee}var ef=ek.data;ek.data=eb.data;eb.data=ef;if(this.swapped!=null){this.swapped(ek.data,eb.data)}eb.next=eh;if(eh!=null){eh.parent=eb}eb.prev=ek.prev;if(ek.prev!=null){ek.prev.parent=eb}ek.prev=eb;if(eb!=null){eb.parent=ek}ec=ed}if(ec.prev!=null&&ec.prev.colour==0){this.__fix_dbl_red(ec.prev)}else{if(ec.next!=null&&ec.next.colour==0){this.__fix_dbl_red(ec.next)}}};dT.prototype.__fix_dbl_red=function(ek){while(true){var ej=ek.parent;var ee=ej.parent;if(ee==null){ej.colour=1;break}var ei;var eh;var eg;var ef;var ed;var ec;var eb;if(ej==ee.prev){eg=ee;eb=ee.next;if(ek==ej.prev){ei=ek;eh=ej;ef=ek.prev;ed=ek.next;ec=ej.next}else{ei=ej;eh=ek;ef=ej.prev;ed=ek.prev;ec=ek.next}}else{ei=ee;ef=ee.prev;if(ek==ej.prev){eh=ek;eg=ej;ed=ek.prev;ec=ek.next;eb=ej.next}else{eh=ej;eg=ek;ed=ej.prev;ec=ek.prev;eb=ek.next}}var ea=ee.parent;if(ea==null){this.parent=eh}else{if(ea.prev==ee){ea.prev=eh}else{ea.next=eh}}if(eh!=null){eh.parent=ea}ei.prev=ef;if(ef!=null){ef.parent=ei}ei.next=ed;if(ed!=null){ed.parent=ei}eh.prev=ei;if(ei!=null){ei.parent=eh}eh.next=eg;if(eg!=null){eg.parent=eh}eg.prev=ec;if(ec!=null){ec.parent=eg}eg.next=eb;if(eb!=null){eb.parent=eg}eh.colour=ee.colour-1;ei.colour=1;eg.colour=1;if(eh==this.parent){this.parent.colour=1}else{if(eh.colour==0&&eh.parent.colour==0){ek=eh;continue}}break}};dT.prototype.try_insert_bool=function(eb){var ea=null;var ec=null;if(this.parent==null){if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return false}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return true}};dT.prototype.try_insert=function(eb){var ea=null;var ec=null;if(this.parent==null){if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;this.parent=ea}else{ec=this.parent;while(true){if(this.lt(eb,ec.data)){if(ec.prev==null){if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(this.lt(ec.data,eb)){if(ec.next==null){if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}else{break}}}}if(ea==null){return ec}else{if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea}};dT.prototype.insert=function(eb){var ea;if(dT.zpp_pool==null){ea=new dT()}else{ea=dT.zpp_pool;dT.zpp_pool=ea.next;ea.next=null}ea.data=eb;if(this.parent==null){this.parent=ea}else{var ec=this.parent;while(true){if(this.lt(ea.data,ec.data)){if(ec.prev==null){ec.prev=ea;ea.parent=ec;break}else{ec=ec.prev}}else{if(ec.next==null){ec.next=ea;ea.parent=ec;break}else{ec=ec.next}}}}if(ea.parent==null){ea.colour=1}else{ea.colour=0;if(ea.parent.colour==0){this.__fix_dbl_red(ea)}}return ea};dT.prototype.__class__=dT;String.prototype.__class__=String;String.__name__=true;Array.__name__=true;var dR={__name__:["Int"]};var dH={__name__:["Dynamic"]};var aj=Number;aj.__name__=["Float"];var dh=Boolean;dh.__ename__=["Bool"];var aq={__name__:["Class"]};var aJ={};dc.__toStr={}.toString;P.epsilon=1e-8;P.fluidAngularDragFriction=2.5;P.fluidAngularDrag=100;P.fluidVacuumDrag=0.5;P.fluidLinearDrag=0.5;P.collisionSlop=0.2;P.collisionSlopCCD=0.5;P.distanceThresholdCCD=0.05;P.staticCCDLinearThreshold=0.05;P.staticCCDAngularThreshold=0.005;P.bulletCCDLinearThreshold=0.125;P.bulletCCDAngularThreshold=0.0125;P.dynamicSweepLinearThreshold=17;P.dynamicSweepAngularThreshold=0.6;P.angularCCDSlipScale=0.75;P.arbiterExpirationDelay=6;P.staticFrictionThreshold=2;P.elasticThreshold=20;P.sleepDelay=60;P.linearSleepThreshold=0.2;P.angularSleepThreshold=0.4;P.contactBiasCoef=0.3;P.contactStaticBiasCoef=0.6;P.contactContinuousBiasCoef=0.4;P.contactContinuousStaticBiasCoef=0.5;P.constraintLinearSlop=0.1;P.constraintAngularSlop=0.001;P.illConditionedThreshold=200000000;Y.zpp_pool=null;cV.zpp_pool=null;bO.zpp_pool=null;d0.zpp_pool=null;d5.zpp_pool=null;cL.zpp_pool=null;v.zpp_pool=null;bL.zpp_pool=null;du.zpp_pool=null;dW.zpp_pool=null;aX.zpp_pool=null;c4.zpp_pool=null;ap.zpp_pool=null;dJ.zpp_pool=null;bC.zpp_pool=null;a0.FMAX=1e+100;cr._Constraint=0;cr._Interactor=0;cr._CbType=0;cr._CbSet=0;cr._Listener=0;cr._ZPP_SimpleVert=0;cr._ZPP_SimpleSeg=0;cr._Space=0;cr._InteractionGroup=0;cS.zpp_pool=null;cC.zpp_pool=null;ar.zpp_pool=null;db.ANY_SHAPE=new dk();db.ANY_BODY=new dk();db.ANY_COMPOUND=new dk();db.ANY_CONSTRAINT=new dk();br.internal=false;br.id_ImmState_ACCEPT=1;br.id_ImmState_IGNORE=2;br.id_ImmState_ALWAYS=4;br.id_GravMassMode_DEFAULT=0;br.id_GravMassMode_FIXED=1;br.id_GravMassMode_SCALED=2;br.id_InertiaMode_DEFAULT=0;br.id_InertiaMode_FIXED=1;br.id_MassMode_DEFAULT=0;br.id_MassMode_FIXED=1;br.id_BodyType_STATIC=1;br.id_BodyType_DYNAMIC=2;br.id_BodyType_KINEMATIC=3;br.id_ListenerType_BODY=0;br.id_PreFlag_ACCEPT=1;br.id_ListenerType_CONSTRAINT=1;br.id_PreFlag_IGNORE=2;br.id_ListenerType_INTERACTION=2;br.id_PreFlag_ACCEPT_ONCE=3;br.id_ListenerType_PRE=3;br.id_PreFlag_IGNORE_ONCE=4;br.id_CbEvent_BEGIN=0;br.id_InteractionType_COLLISION=1;br.id_CbEvent_ONGOING=6;br.id_InteractionType_SENSOR=2;br.id_CbEvent_END=1;br.id_InteractionType_FLUID=4;br.id_CbEvent_WAKE=2;br.id_InteractionType_ANY=7;br.id_CbEvent_SLEEP=3;br.id_CbEvent_BREAK=4;br.id_CbEvent_PRE=5;br.id_Winding_UNDEFINED=0;br.id_Winding_CLOCKWISE=1;br.id_Winding_ANTICLOCKWISE=2;br.id_ValidationResult_VALID=0;br.id_ValidationResult_DEGENERATE=1;br.id_ValidationResult_CONCAVE=2;br.id_ValidationResult_SELF_INTERSECTING=3;br.id_ShapeType_CIRCLE=0;br.id_ShapeType_POLYGON=1;br.id_Broadphase_DYNAMIC_AABB_TREE=0;br.id_Broadphase_SWEEP_AND_PRUNE=1;br.id_ArbiterType_COLLISION=1;br.id_ArbiterType_SENSOR=2;br.id_ArbiterType_FLUID=4;cc.types=(function(ee){var ea;if(br.ListenerType_BODY==null){br.internal=true;br.ListenerType_BODY=new dZ();br.internal=false}var eb=br.ListenerType_BODY;if(br.ListenerType_CONSTRAINT==null){br.internal=true;br.ListenerType_CONSTRAINT=new dZ();br.internal=false}var ed=br.ListenerType_CONSTRAINT;if(br.ListenerType_INTERACTION==null){br.internal=true;br.ListenerType_INTERACTION=new dZ();br.internal=false}var ec=br.ListenerType_INTERACTION;if(br.ListenerType_PRE==null){br.internal=true;br.ListenerType_PRE=new dZ();br.internal=false}ea=[eb,ed,ec,br.ListenerType_PRE];return ea}(this));cc.events=(function(eh){var ea;if(br.CbEvent_BEGIN==null){br.internal=true;br.CbEvent_BEGIN=new bU();br.internal=false}var ee=br.CbEvent_BEGIN;if(br.CbEvent_END==null){br.internal=true;br.CbEvent_END=new bU();br.internal=false}var eg=br.CbEvent_END;if(br.CbEvent_WAKE==null){br.internal=true;br.CbEvent_WAKE=new bU();br.internal=false}var ef=br.CbEvent_WAKE;if(br.CbEvent_SLEEP==null){br.internal=true;br.CbEvent_SLEEP=new bU();br.internal=false}var ed=br.CbEvent_SLEEP;if(br.CbEvent_BREAK==null){br.internal=true;br.CbEvent_BREAK=new bU();br.internal=false}var ec=br.CbEvent_BREAK;if(br.CbEvent_PRE==null){br.internal=true;br.CbEvent_PRE=new bU();br.internal=false}var eb=br.CbEvent_PRE;if(br.CbEvent_ONGOING==null){br.internal=true;br.CbEvent_ONGOING=new bU();br.internal=false}ea=[ee,eg,ef,ed,ec,eb,br.CbEvent_ONGOING];return ea}(this));c1.UCbSet=new af();c1.VCbSet=new af();c1.WCbSet=new af();c1.UCbType=new x();c1.VCbType=new x();c1.WCbType=new x();j.internal=false;j.COL=1;j.FLUID=4;j.SENSOR=2;j.types=(function(ed){var ea;if(br.ArbiterType_COLLISION==null){br.internal=true;br.ArbiterType_COLLISION=new av();br.internal=false}var eb=br.ArbiterType_COLLISION;if(br.ArbiterType_SENSOR==null){br.internal=true;br.ArbiterType_SENSOR=new av();br.internal=false}var ec=br.ArbiterType_SENSOR;if(br.ArbiterType_FLUID==null){br.internal=true;br.ArbiterType_FLUID=new av();br.internal=false}ea=[null,eb,ec,null,br.ArbiterType_FLUID];return ea}(this));A.zpp_pool=null;dK.zpp_pool=null;d9.FACE1=0;d9.FACE2=1;d9.CIRCLE=2;d9.zpp_pool=null;c2.internal=false;c2.zpp_pool=null;cA.zpp_pool=null;ax.SHAPE=1;ax.BODY=2;bT.zpp_pool=null;b7.flowpoly=new aG();b7.flowsegs=new aG();a4.convexPool=null;a4.rayPool=null;a4.internal=false;E.zpp_pool=null;c3.zpp_pool=null;az.ints=null;az.paths=null;dr.zpp_pool=null;dn.zpp_pool=null;W.zpp_pool=null;T.zpp_pool=null;bc.me=new bc();bc.look_march=[-1,224,56,216,14,-1,54,214,131,99,-1,91,141,109,181,85];cm.zpp_pool=null;aE.queue=null;aE.edges=null;ah.nextId=0;ah.zpp_pool=null;a.zpp_pool=null;dG.zpp_pool=null;co.zpp_pool=null;dI.zpp_pool=null;bv.sweep=null;bv.inthash=null;bv.vertices=null;bv.queue=null;bv.ints=null;bv.list_vertices=null;bv.list_queue=null;cD.zpp_pool=null;cG.zpp_pool=null;aL.stack=null;ct.zpp_pool=null;k.zpp_pool=null;z.queue=null;z.stack=null;z.edgeSet=null;bB.zpp_pool=null;cj.types=(function(ed){var ea;if(br.BodyType_STATIC==null){br.internal=true;br.BodyType_STATIC=new cU();br.internal=false}var eb=br.BodyType_STATIC;if(br.BodyType_DYNAMIC==null){br.internal=true;br.BodyType_DYNAMIC=new cU();br.internal=false}var ec=br.BodyType_DYNAMIC;if(br.BodyType_KINEMATIC==null){br.internal=true;br.BodyType_KINEMATIC=new cU();br.internal=false}ea=[null,eb,ec,br.BodyType_KINEMATIC];return ea}(this));cj.bodystack=null;cj.bodyset=null;cj.cur_graph_depth=0;b6.zpp_pool=null;cJ.zpp_pool=null;cJ.WAKE=1;cJ.PROPS=2;cJ.ANGDRAG=4;cJ.ARBITERS=8;bZ.types=(function(ec){var ea;if(br.ShapeType_CIRCLE==null){br.internal=true;br.ShapeType_CIRCLE=new H();br.internal=false}var eb=br.ShapeType_CIRCLE;if(br.ShapeType_POLYGON==null){br.internal=true;br.ShapeType_POLYGON=new H();br.internal=false}ea=[eb,br.ShapeType_POLYGON];return ea}(this));c8.zpp_pool=null;c8.internal=false;dz.zpp_pool=null;bG.zpp_pool=null;d.tmpaabb=new bT();cT.FATTEN=3;cT.VEL_STEPS=2;cW.zpp_pool=null;bx.zpp_pool=null;cg.zpp_pool=null;f.zpp_pool=null;ca.zpp_pool=null;b.zpp_pool=null;cF.zpp_pool=null;b9.zpp_pool=null;bE.zpp_pool=null;cx.zpp_pool=null;Q.zpp_pool=null;dL.zpp_pool=null;aF.zpp_pool=null;cO.zpp_pool=null;g.zpp_pool=null;aT.zpp_pool=null;cd.zpp_pool=null;aR.zpp_pool=null;d3.zpp_pool=null;cH.zpp_pool=null;V.zpp_pool=null;o.zpp_pool=null;dU.zpp_pool=null;dS.zpp_pool=null;d6.zpp_pool=null;dY.zpp_pool=null;aV.zpp_pool=null;cl.zpp_pool=null;cq.zpp_pool=null;d2.zpp_pool=null;dv.zpp_pool=null;bb.zpp_pool=null;L.zpp_pool=null;e.zpp_pool=null;bi.zpp_pool=null;w.zpp_pool=null;c5.zpp_pool=null;cn.zpp_pool=null;cM.zpp_pool=null;dp.zpp_pool=null;aZ.internal=false;b0.internal=false;i.internal=false;bj.internal=false;a1.internal=false;cy.internal=false;bF.internal=false;dl.internal=false;bw.internal=false;dE.internal=false;aw.internal=false;aI.internal=false;bt.internal=false;U.internal=false;aB.internal=false;au.poolGeomPoly=null;au.poolVec2=null;au.poolVec3=null;dV.zpp_pool=null;p.zpp_pool=null;b8.zpp_pool=null;am.zpp_pool=null;bX.zpp_pool=null;bD.zpp_pool=null;bl.zpp_pool=null;dT.zpp_pool=null;aW.main()})();