{"size": 67749, "ext": "js", "max_stars_repo_path": "files/frozen/0.2.1/frozen.js", "max_stars_repo_name": "isaackwan/jsdelivr", "max_stars_repo_stars_event_min_datetime": "2015-01-25T09:21:56.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-29T16:52:35.000Z", "max_issues_repo_path": "files/frozen/0.2.1/frozen.js", "max_issues_repo_name": "isaackwan/jsdelivr", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "files/frozen/0.2.1/frozen.js", "max_forks_repo_name": "isaackwan/jsdelivr", "max_forks_repo_forks_event_min_datetime": "2015-01-23T17:09:43.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-22T11:48:20.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 5, "avg_line_length": 505.5895522388, "max_line_length": 576, "alphanum_fraction": 0.6981357658}
//>>built
(function(b,d){var h,g,i,k=function(){},c=function(a){for(var e in a)return 0;return 1},f={}.toString,l=function(a){return"[object Function]"==f.call(a)},a=function(a){return"[object String]"==f.call(a)},e=function(a){return"[object Array]"==f.call(a)},j=function(a,e){if(a)for(var c=0;c<a.length;)e(a[c++])},m=function(a,e){for(var c in e)a[c]=e[c];return a},u=function(a,e){return m(Error(a),{src:"dojoLoader",info:e})},p=1,o=function(){return"_"+p++},n=function(a,e,c){return ha(a,e,c,0,n)},A=this,
B=A.document,ya=B&&B.createElement("DiV"),s=n.has=function(a){return l(q[a])?q[a]=q[a](A,B,ya):q[a]},q=s.cache=d.hasCache;s.add=function(a,e,c,b){(void 0===q[a]||b)&&(q[a]=e);return c&&s(a)};for(var r in b.has)s.add(r,b.has[r],0,1);n.async=1;var w=new Function("return eval(arguments[0]);");n.eval=function(a,e){return w(a+"\r\n////@ sourceURL="+e)};var v={},t=n.signal=function(a,c){var b=v[a];j(b&&b.slice(0),function(a){a.apply(null,e(c)?c:[c])})},H=n.on=function(a,e){var c=v[a]||(v[a]=[]);c.push(e);
return{remove:function(){for(var a=0;a<c.length;a++)if(c[a]===e){c.splice(a,1);break}}}},ia=[],za={},ja=[],T={},ka=n.map={},I=[],x={},U="",D={},J={};r={};var L=function(a){var e,c,b,j;for(e in J)c=J[e],(b=e.match(/^url\:(.+)/))?D["url:"+la(b[1],a)]=c:"*now"==e?j=c:"*noref"!=e&&(b=K(e,a),D[b.mid]=D["url:"+b.url]=c);j&&j(V(a));J={}},ma=function(a){return a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(a){return"\\"+a})},W=function(a,e){e.splice(0,e.length);for(var c in a)e.push([c,a[c],RegExp("^"+
ma(c)+"(/|$)"),c.length]);e.sort(function(a,e){return e[3]-a[3]});return e},na=function(a){var e=a.name;e||(e=a,a={name:e});a=m({main:"main"},a);a.location=a.location?a.location:e;if(a.packageMap)ka[e]=a.packageMap;if(!a.main.indexOf("./"))a.main=a.main.substring(2);T[e]=a},oa=[],F=function(e,c,b){for(var f in e){if("waitSeconds"==f)n.waitms=1E3*(e[f]||0);"cacheBust"==f&&(U=e[f]?a(e[f])?e[f]:(new Date).getTime()+"":"");if("baseUrl"==f||"combo"==f)n[f]=e[f];e[f]!==q&&(n.rawConfig[f]=e[f],"has"!=f&&
s.add("config-"+f,e[f],0,c))}if(!n.baseUrl)n.baseUrl="./";/\/$/.test(n.baseUrl)||(n.baseUrl+="/");for(f in e.has)s.add(f,e.has[f],0,c);j(e.packages,na);for(i in e.packagePaths)j(e.packagePaths[i],function(e){var c=i+"/"+e;a(e)&&(e={name:e});e.location=c;na(e)});W(m(ka,e.map),I);j(I,function(a){a[1]=W(a[1],[]);if("*"==a[0])I.star=a});W(m(za,e.paths),ja);j(e.aliases,function(e){a(e[0])&&(e[0]=RegExp("^"+ma(e[0])+"$"));ia.push(e)});if(c)oa.push({config:e.config});else for(f in e.config)c=C(f,b),c.config=
m(c.config||{},e.config[f]);if(e.cache)L(),J=e.cache,e.cache["*noref"]&&L();t("config",[e,n.rawConfig])};n.rawConfig={};F(d,1);F(b,1);F(r,1);var M=function(a){X(function(){j(a.deps,pa)})},ha=function(c,b,j,f,d){var h;if(a(c)){if((h=C(c,f,!0))&&h.executed)return h.result;throw u("undefinedModule",c);}e(c)||(F(c,0,f),c=b,b=j);if(e(c))if(c.length){for(var j="require*"+o(),g,l=[],i=0;i<c.length;)g=c[i++],l.push(C(g,f));h=m(N("",j,0,""),{injected:2,deps:l,def:b||k,require:f?f.require:n,gc:1});x[h.mid]=
h;M(h);var p=G&&0!="sync";X(function(){Y(h,p)});h.executed||z.push(h);O()}else b&&b();return d},V=function(a){if(!a)return n;var e=a.require;if(!e)e=function(c,b,j){return ha(c,b,j,a,e)},a.require=m(e,n),e.module=a,e.toUrl=function(e){return la(e,a)},e.toAbsMid=function(e){return Z(e,a)};return e},z=[],P=[],y={},Ba=function(a){a.injected=1;y[a.mid]=1;a.url&&(y[a.url]=a.pack||1);Aa()},Q=function(a){a.injected=2;delete y[a.mid];a.url&&delete y[a.url];c(y)&&Ca()},Da=n.idle=function(){return!P.length&&
c(y)&&!z.length&&!G},$=function(a,e){if(e)for(var c=0;c<e.length;c++)if(e[c][2].test(a))return e[c];return 0},qa=function(a){for(var e=[],c,b,a=a.replace(/\\/g,"/").split("/");a.length;)c=a.shift(),".."==c&&e.length&&".."!=b?(e.pop(),b=e[e.length-1]):"."!=c&&e.push(b=c);return e.join("/")},N=function(a,e,c,b){return{pid:a,mid:e,pack:c,url:b,executed:0,def:0}},ra=function(a,e,c,b,f,d,g,k){var m,i,p,n;n=/^\./.test(a);if(/(^\/)|(\:)|(\.js$)/.test(a)||n&&!e)return N(0,a,0,a);a=qa(n?e.mid+"/../"+a:a);
if(/^\./.test(a))throw u("irrationalPath",a);e&&(p=$(e.mid,d));(p=(p=p||d.star)&&$(a,p[1]))&&(a=p[1]+a.substring(p[3]));e=(h=a.match(/^([^\/]+)(\/(.+))?$/))?h[1]:"";(m=c[e])?a=e+"/"+(i=h[3]||m.main):e="";var o=0;j(ia,function(e){var c=a.match(e[0]);c&&0<c.length&&(o=l(e[1])?a.replace(e[0],e[1]):e[1])});if(o)return ra(o,0,c,b,f,d,g,k);if(c=b[a])return k?N(c.pid,c.mid,c.pack,c.url):b[a];b=(p=$(a,g))?p[1]+a.substring(p[3]):e?m.location+"/"+i:a;/(^\/)|(\:)/.test(b)||(b=f+b);return N(e,a,m,qa(b+".js"))},
K=function(a,e){return ra(a,e,T,x,n.baseUrl,I,ja)},sa=function(a,e,c){return a.normalize?a.normalize(e,function(a){return Z(a,c)}):Z(e,c)},ta=0,C=function(a,e,c){var b,j;(b=a.match(/^(.+?)\!(.*)$/))?(j=C(b[1],e,c),5===j.executed&&!j.load&&aa(j),j.load?(b=sa(j,b[2],e),a=j.mid+"!"+(j.dynamic?++ta+"!":"")+b):(b=b[2],a=j.mid+"!"+ ++ta+"!waitingForPlugin"),a={plugin:j,mid:a,req:V(e),prid:b}):a=K(a,e);return x[a.mid]||!c&&(x[a.mid]=a)},Z=n.toAbsMid=function(a,e){return K(a,e).mid},la=n.toUrl=function(a,
e){var c=K(a+"/x",e),b=c.url;return ua(0===c.pid?a:b.substring(0,b.length-5))},va={injected:2,executed:5,def:3,result:3},E=function(a){return x[a]=m({mid:a},va)},Ea=E("require"),Fa=E("exports"),Ga=E("module"),R={},ba=0,aa=function(a){var e=a.result;a.dynamic=e.dynamic;a.normalize=e.normalize;a.load=e.load;return a},Ha=function(a){var e={};j(a.loadQ,function(c){var b=sa(a,c.prid,c.req.module),j=a.dynamic?c.mid.replace(/waitingForPlugin$/,b):a.mid+"!"+b,b=m(m({},c),{mid:j,prid:b,injected:0});x[j]||
wa(x[j]=b);e[c.mid]=x[j];Q(c);delete x[c.mid]});a.loadQ=0;var c=function(a){for(var c=a.deps||[],b=0;b<c.length;b++)(a=e[c[b].mid])&&(c[b]=a)},b;for(b in x)c(x[b]);j(z,c)},ca=function(a){n.trace("loader-finish-exec",[a.mid]);a.executed=5;a.defOrder=ba++;a.loadQ&&(aa(a),Ha(a));for(g=0;g<z.length;)z[g]===a?z.splice(g,1):g++;/^require\*/.test(a.mid)&&delete x[a.mid]},Ia=[],Y=function(a,e){if(4===a.executed)return n.trace("loader-circular-dependency",[Ia.concat(a.mid).join("->")]),!a.def||e?R:a.cjs&&
a.cjs.exports;if(!a.executed){if(!a.def)return R;var c=a.mid,b=a.deps||[],j,f=[],d=0;for(a.executed=4;d<b.length;){j=b[d++];j=j===Ea?V(a):j===Fa?a.cjs.exports:j===Ga?a.cjs:Y(j,e);if(j===R)return a.executed=0,n.trace("loader-exec-module",["abort",c]),R;f.push(j)}n.trace("loader-run-factory",[a.mid]);c=a.def;f=l(c)?c.apply(null,f):c;a.result=void 0===f&&a.cjs?a.cjs.exports:f;ca(a)}return a.result},G=0,X=function(a){try{G++,a()}finally{G--}Da()&&t("idle",[])},O=function(){G||X(function(){for(var a,e,
c=0;c<z.length;)a=ba,e=z[c],Y(e),a!=ba?c=0:c++})};void 0===s("dojo-loader-eval-hint-url")&&s.add("dojo-loader-eval-hint-url",1);var ua=function(a){a+="";return a+(U?(/\?/.test(a)?"&":"?")+U:"")},wa=function(a){var e=a.plugin;5===e.executed&&!e.load&&aa(e);var c=function(e){a.result=e;Q(a);ca(a);O()};e.load?e.load(a.prid,a.req,c):e.loadQ?e.loadQ.push(a):(e.loadQ=[a],z.unshift(e),pa(e))},S=0,da=0,ea=0,Ja=function(a,e){s("config-stripStrict")&&(a=a.replace(/"use strict"/g,""));ea=1;a===S?S.call(null):
n.eval(a,s("dojo-loader-eval-hint-url")?e.url:e.mid);ea=0},pa=function(a){var e=a.mid,c=a.url;if(!a.executed&&!a.injected&&!(y[e]||a.url&&(a.pack&&y[a.url]===a.pack||1==y[a.url])))if(Ba(a),a.plugin)wa(a);else{var b=function(){Ka(a);2!==a.injected&&(Q(a),m(a,va),n.trace("loader-define-nonmodule",[a.url]));O()};(S=D[e]||D["url:"+a.url])?(n.trace("loader-inject",["cache",a.mid,c]),Ja(S,a),b()):(n.trace("loader-inject",["script",a.mid,c]),da=a,n.injectUrl(ua(c),b,a),da=0)}},fa=function(a,e,c){n.trace("loader-define-module",
[a.mid,e]);if(2===a.injected)return t("error",u("multipleDefine",a)),a;m(a,{deps:e,def:c,cjs:{id:a.mid,uri:a.url,exports:a.result={},setExports:function(e){a.cjs.exports=e},config:function(){return a.config}}});for(var b=0;b<e.length;b++)e[b]=C(e[b],a);Q(a);if(!l(c)&&!e.length)a.result=c,ca(a);return a},Ka=function(a,e){for(var c=[],b,f;P.length;)f=P.shift(),e&&(f[0]=e.shift()),b=f[0]&&C(f[0])||a,c.push([b,f[1],f[2]]);L(a);j(c,function(a){M(fa.apply(null,a))})},Ca=k,Aa=k;s.add("ie-event-behavior",
!!B.attachEvent&&("undefined"===typeof opera||"[object Opera]"!=opera.toString()));var ga=function(a,e,c,b){if(s("ie-event-behavior"))return a.attachEvent(c,b),function(){a.detachEvent(c,b)};a.addEventListener(e,b,!1);return function(){a.removeEventListener(e,b,!1)}},La=ga(window,"load","onload",function(){n.pageLoaded=1;"complete"!=B.readyState&&(B.readyState="complete");La()}),xa=B.getElementsByTagName("script")[0],Ma=xa.parentNode;n.injectUrl=function(a,e,c){var c=c.node=B.createElement("script"),
b=ga(c,"load","onreadystatechange",function(a){var a=a||window.event,c=a.target||a.srcElement;if("load"===a.type||/complete|loaded/.test(c.readyState))b(),j(),e&&e()}),j=ga(c,"error","onerror",function(e){b();j();t("error",u("scriptError",[a,e]))});c.type="text/javascript";c.charset="utf-8";c.src=a;Ma.insertBefore(c,xa);return c};n.log=k;n.trace=k;E=function(e,c,b){var j=arguments.length,f=["require","exports","module"],d=[0,e,c];1==j?d=[0,l(e)?f:[],e]:2==j&&a(e)?d=[e,l(c)?f:[],c]:3==j&&(d=[e,c,b]);
n.trace("loader-define",d.slice(0,2));if((j=d[0]&&C(d[0]))&&!y[j.mid])M(fa(j,d[1],d[2]));else if(!s("ie-event-behavior")||ea)P.push(d);else{j=j||da;if(!j)for(e in y)if((f=x[e])&&f.node&&"interactive"===f.node.readyState){j=f;break}j?(L(j),M(fa(j,d[1],d[2]))):t("error",u("ieDefineFailed",d[0]));O()}};E.amd={vendor:"dojotoolkit.org"};m(m(n,d.loaderPatch),b.loaderPatch);H("error",function(a){try{if(console.error(a),a instanceof Error)for(var e in a);}catch(c){}});m(n,{uid:o,cache:D,packs:T});if(!A.define)A.define=
E,A.require=n,j(oa,function(a){F(a)}),H=r.deps||b.deps||d.deps,r=r.callback||b.callback||d.callback,n.boot=H||r?[H||[],r]:0})(this.dojoConfig||this.djConfig||this.require||{},{async:1,baseUrl:"./",hasCache:{"config-selectorEngine":"acme","config-tlmSiblingOfDojo":1,"dojo-built":1,"dojo-loader":1,dom:1,"host-browser":1},packages:[{location:"../frozen",main:"GameCore",name:"frozen"},{location:".",name:"dojo"},{location:"../dcl",main:"dcl",name:"dcl"}]});
require({cache:{"dist/frozen":function(){define([],1)},"frozen/box2d/Box":function(){define("frozen/box2d/Box",["dcl","dcl/bases/Mixer","dojo/_base/lang"],function(b,d){var h=Box2D.Common.Math.b2Vec2,g=Box2D.Dynamics.b2BodyDef,i=Box2D.Dynamics.b2Body,k=Box2D.Dynamics.b2FixtureDef,c=Box2D.Dynamics.b2World,f=Box2D.Collision.Shapes.b2PolygonShape,l=Box2D.Collision.Shapes.b2CircleShape;return b(d,{intervalRate:60,adaptive:!1,bodiesMap:null,fixturesMap:null,jointsMap:null,b2World:null,gravityX:0,gravityY:9.8,
allowSleep:!0,resolveCollisions:!1,contactListener:null,collisions:null,scale:30,constructor:function(a){if(a&&a.intervalRate)this.intervalRate=parseInt(a.intervalRate,10);this.bodiesMap={};this.fixturesMap={};this.jointsMap={};this.b2World=new c(new h(this.gravityX,this.gravityY),this.allowSleep);this.resolveCollisions&&this.addContactListener(this.contactListener||this)},update:function(a){if(this.resolveCollisions)this.collisions={};var e=Date.now();a?this.b2World.Step(a/1E3,10,10):this.b2World.Step(this.adaptive?
(e-this.lastTimestamp)/1E3:1/this.intervalRate,10,10);this.b2World.ClearForces();return Date.now()-e},getState:function(){for(var a={},e=this.b2World.GetBodyList();e;e=e.m_next)if(e.IsActive()&&"undefined"!==typeof e.GetUserData()&&null!==e.GetUserData()&&(a[e.GetUserData()]={x:e.GetPosition().x,y:e.GetPosition().y,angle:e.GetAngle(),center:{x:e.GetWorldCenter().x,y:e.GetWorldCenter().y},linearVelocity:e.m_linearVelocity,angularVelocity:e.m_angularVelocity},this.resolveCollisions))a[e.GetUserData()].collisions=
this.collisions[e.GetUserData()]||null;return a},updateExternalState:function(a){var e=this.getState(),c;for(c in e){var b=a[c];b&&!b.staticBody&&b.update(e[c])}},setBodies:function(a){for(var e in a)this.addBody(a[e]);this.ready=!0},addBody:function(a){if(!a.alreadyScaled)a.scaleShape(1/this.scale),a.scale=this.scale;var e=new g,c=new k,b,d,p,o;c.restitution=a.restitution;c.density=a.density;c.friction=a.friction;if(null!=a.maskBits)c.filter.maskBits=a.maskBits;if(null!=a.categoryBits)c.filter.categoryBits=
a.categoryBits;if(null!=a.groupIndex)c.filter.groupIndex=a.groupIndex;e.type=a.staticBody?i.b2_staticBody:i.b2_dynamicBody;e.position.x=a.x;e.position.y=a.y;e.userData=a.id;e.angle=a.angle;e.linearDamping=a.linearDamping;e.angularDamping=a.angularDamping;var n=this.b2World.CreateBody(e);if(a.radius)c.shape=new l(a.radius),n.CreateFixture(c);else if(a.points){d=[];for(e=0;e<a.points.length;e++)p=new h,p.Set(a.points[e].x,a.points[e].y),d[e]=p;c.shape=new f;c.shape.SetAsArray(d,d.length);n.CreateFixture(c)}else if(a.polys)for(b=
0;b<a.polys.length;b++){d=a.polys[b];o=[];for(e=0;e<d.length;e++)p=new h,p.Set(d[e].x,d[e].y),o[e]=p;c.shape=new f;c.shape.SetAsArray(o,o.length);n.CreateFixture(c)}else c.shape=new f,c.shape.SetAsBox(a.halfWidth,a.halfHeight),n.CreateFixture(c);this.bodiesMap[a.id]=n},setPosition:function(a,e,c){this.bodiesMap[a].SetPosition(new h(e,c))},setAngle:function(a,e){this.bodiesMap[a].SetAngle(e)},setLinearVelocity:function(a,e,c){this.bodiesMap[a].SetLinearVelocity(new h(e,c))},applyImpulseDegrees:function(a,
e,c){a=this.bodiesMap[a];a.ApplyImpulse(new h(Math.sin(e*(Math.PI/180))*c,-1*Math.cos(e*(Math.PI/180))*c),a.GetWorldCenter())},applyForceDegrees:function(a,e,c){a=this.bodiesMap[a];a.ApplyForce(new h(Math.sin(e*(Math.PI/180))*c,-1*Math.cos(e*(Math.PI/180))*c),a.GetWorldCenter())},applyImpulse:function(a,e,c){a=this.bodiesMap[a];a.ApplyImpulse(new h(Math.sin(e)*c,-1*Math.cos(e)*c),a.GetWorldCenter())},applyForce:function(a,e,c){a=this.bodiesMap[a];a.ApplyForce(new h(Math.sin(e)*c,-1*Math.cos(e)*c),
a.GetWorldCenter())},applyTorque:function(a,e){this.bodiesMap[a].ApplyTorque(e)},setGravity:function(a){this.b2World.SetGravity(new h(a.x,a.y))},removeBody:function(a){this.bodiesMap[a]&&(this.fixturesMap[a]&&this.bodiesMap[a].DestroyFixture(this.fixturesMap[a]),this.b2World.DestroyBody(this.bodiesMap[a]),delete this.bodiesMap[a])},wakeUpBody:function(a){this.bodiesMap[a]&&this.bodiesMap[a].SetAwake(!0)},addContactListener:function(a){var e=new Box2D.Dynamics.b2ContactListener;if(a.beginContact)e.BeginContact=
function(e){a.beginContact(e.GetFixtureA().GetBody().GetUserData(),e.GetFixtureB().GetBody().GetUserData())};if(a.endContact)e.endContact=function(e){a.endContact(e.GetFixtureA().GetBody().GetUserData(),e.GetFixtureB().GetBody().GetUserData())};if(a.postSolve)e.PostSolve=function(e,c){a.postSolve(e.GetFixtureA().GetBody().GetUserData(),e.GetFixtureB().GetBody().GetUserData(),c.normalImpulses[0])};this.b2World.SetContactListener(e)},destroyJoint:function(a){this.jointsMap[a]&&(this.b2World.DestroyJoint(this.jointsMap[a]),
delete this.jointsMap[a])},addJoint:function(a){if(a&&a.id&&!this.jointsMap[a.id]){if(!a.alreadyScaled&&a.scaleJointLocation)a.scaleJointLocation(1/this.scale),a.scale=this.scale;var e=a.createB2Joint(this);e&&(this.jointsMap[a.id]=e)}},beginContact:function(){},endContact:function(){},postSolve:function(a,e,c){this.collisions[a]=this.collisions[a]||[];this.collisions[a].push({id:e,impulse:c});this.collisions[e]=this.collisions[e]||[];this.collisions[e].push({id:a,impulse:c})}})})},"dcl/dcl":function(){(function(b){"undefined"!=
typeof define?define(["./mini"],b):"undefined"!=typeof module?module.exports=b(require("./mini")):dcl=b(dcl)})(function(b){function d(){}function h(b,c,f){var h=b||d,a=c||d,e=f||d,j=function(){var c;h.apply(this,arguments);try{c=e.apply(this,arguments)}catch(b){c=b}a.call(this,arguments,c);if(c instanceof Error)throw c;return c};j.advices={b:b,a:c,f:f};return j}function g(d){return function(c,f){var h=c._m,a;h&&((a=+h.w[f]||0)&&a!=d&&b._e("set chaining",f,c,d,a),h.w[f]=d)}}var i=b(b.Super,{constructor:function(){this.b=
this.f.before;this.a=this.f.after;this.f=this.f.around}});b.mix(b,{Advice:i,advise:function(b){return new i(b)},before:function(b){return new i({before:b})},after:function(b){return new i({after:b})},around:b.superCall,chainBefore:g(1),chainAfter:g(2),isInstanceOf:function(b,c){if(b instanceof c)return!0;var f=b.constructor._m,d;if(f)for(f=f.b,d=f.length-1;0<=d;--d)if(f[d]===c)return!0;return!1},_sb:function(d,c,f,g){var g=g[f]=b._ec(c,f,"f"),a=b._ec(c,f,"b").reverse(),c=b._ec(c,f,"a"),g=d?b._st(g,
1==d?function(a){return b._sc(a.reverse())}:b._sc,f):b._ss(g,f);return!a.length&&!c.length?g||function(){}:h(b._sc(a),b._sc(c),g)}});return b})},"dcl/mini":function(){(function(b){"undefined"!=typeof define?define([],b):"undefined"!=typeof module?module.exports=b():dcl=b()})(function(){function b(a,e){var c=[0],f,d,j,m,s,q,r,w,v=0,t;if(a)if(a instanceof Array){m={};r=a.slice(0).reverse();for(w=r.length-1;0<=w;--w)if(d=r[w],d._u=d._u||g++,f=d._m){for(q=f.b,v=q.length-1;0<v;--v)t=q[v]._u,m[t]=(m[t]||
0)+1;r[w]=q.slice(0)}else r[w]=[d];s={};a:for(;r.length;){for(w=0;w<r.length;++w)if(q=r[w],d=q[0],t=d._u,!m[t]){s[t]||(c.push(d),s[t]=1);q.shift();q.length?--m[q[0]._u]:r.splice(w,1);continue a}b._e("cycle",e,r)}a=a[0];v=c.length-((m=a._m)&&a===c[c.length-(v=m.b.length)]?v:1)-1}else a._u=a._u||g++,c=c.concat((m=a._m)?m.b:a);f=a?b.delegate(a[k]):{};for(q=a&&(m=a._m)?b.delegate(m.w):{constructor:2};0<v;--v)if(d=c[v],m=d._m,l(f,m&&m.h||d[k]),m)for(t in r=m.w)q[t]=(+q[t]||0)|r[t];for(t in e)h(m=e[t])?
q[t]=+q[t]||0:f[t]=m;s={b:c,h:e,w:q,c:{}};c[0]={_m:s,prototype:f};d=f;m=s.w;q=s.b;r=s.c;for(j in m)d[j]=b._sb(m[j],q,j,r);j=f[i];j._m=s;j[k]=f;c[0]=j;return b._p(j)}function d(a){this.f=a}function h(a){return a instanceof d}var g=0,i="constructor",k="prototype",c=function(){},f={},l,a,e,j,m;(l=function(a,e){for(var c in e)a[c]=e[c]})(b,{mix:l,delegate:function(a){c[k]=a;a=new c;c[k]=null;return a},Super:d,superCall:function(a){return new d(a)},_p:function(a){return a},_e:function(a){throw Error("dcl: "+
a);},_f:function(a,e){var c=a.f(e);c.ctr=a.ctr;return c},_ec:a=function(a,e,c){for(var b=a.length-1,d=[],j,g,m="f"==c;j=a[b];--b)if((g=j._m)?(g=g.h).hasOwnProperty(e)&&(h(g=g[e])?m?g.f:g=g[c]:m):m&&(g=j[k][e])&&g!==f[e])g.ctr=j,d.push(g);return d},_sc:j=function(a){var e=a.length,c;return!e?0:1==e?(c=a[0],function(){c.apply(this,arguments)}):function(){for(var c=0;c<e;++c)a[c].apply(this,arguments)}},_ss:e=function(a,e){for(var c=0,d,j=f[e];d=a[c];++c)j=h(d)?a[c]=b._f(d,j,e):d;return e!=i?j:function(){j.apply(this,
arguments)}},_st:m=function(a,e,c){for(var f=0,d,j,g=0;d=a[f];++f)h(d)&&(j=f-g,a[f]=b._f(d,!j?0:1==j?a[g]:e(a.slice(g,f)),c),g=f);j=f-g;return!j?0:1==j&&c!=i?a[g]:e(g?a.slice(g):a)},_sb:function(c,b,f,d){b=d[f]=a(b,f,"f");return(c?m(b,j,f):e(b,f))||function(){}}});return b})},"dcl/bases/Mixer":function(){(function(b){"undefined"!=typeof define?define(["../mini"],b):"undefined"!=typeof module?module.exports=b(require("../mini")):dclBasesMixer=b(dcl)})(function(b){return b(null,{declaredClass:"dcl/bases/Mixer",
constructor:function(d){b.mix(this,d)}})})},"dojo/_base/lang":function(){define(["./kernel","../has","../sniff"],function(b,d){d.add("bug-for-in-skips-shadowed",function(){for(var a in{toString:1})return 0;return 1});var h=d("bug-for-in-skips-shadowed")?"hasOwnProperty.valueOf.isPrototypeOf.propertyIsEnumerable.toLocaleString.toString.constructor".split("."):[],g=h.length,i=function(a,e,c){var f,d=0,g=b.global;if(!c)if(a.length){f=a[d++];try{c=b.scopeMap[f]&&b.scopeMap[f][1]}catch(h){}c=c||(f in g?
g[f]:e?g[f]={}:void 0)}else return g;for(;c&&(f=a[d++]);)c=f in c?c[f]:e?c[f]={}:void 0;return c},k=Object.prototype.toString,c=function(a,e,c){return(c||[]).concat(Array.prototype.slice.call(a,e||0))},f=/\{([^\}]+)\}/g,l={_extraNames:h,_mixin:function(a,e,c){var b,f,k,i={};for(b in e)if(f=e[b],!(b in a)||a[b]!==f&&(!(b in i)||i[b]!==f))a[b]=c?c(f):f;if(d("bug-for-in-skips-shadowed")&&e)for(k=0;k<g;++k)if(b=h[k],f=e[b],!(b in a)||a[b]!==f&&(!(b in i)||i[b]!==f))a[b]=c?c(f):f;return a},mixin:function(a,
e){a||(a={});for(var c=1,b=arguments.length;c<b;c++)l._mixin(a,arguments[c]);return a},setObject:function(a,e,c){var b=a.split("."),a=b.pop();return(c=i(b,!0,c))&&a?c[a]=e:void 0},getObject:function(a,c,b){return i(a.split("."),c,b)},exists:function(a,c){return void 0!==l.getObject(a,!1,c)},isString:function(a){return"string"==typeof a||a instanceof String},isArray:function(a){return a&&(a instanceof Array||"array"==typeof a)},isFunction:function(a){return"[object Function]"===k.call(a)},isObject:function(a){return void 0!==
a&&(null===a||"object"==typeof a||l.isArray(a)||l.isFunction(a))},isArrayLike:function(a){return a&&void 0!==a&&!l.isString(a)&&!l.isFunction(a)&&!(a.tagName&&"form"==a.tagName.toLowerCase())&&(l.isArray(a)||isFinite(a.length))},isAlien:function(a){return a&&!l.isFunction(a)&&/\{\s*\[native code\]\s*\}/.test(""+a)},extend:function(a,c){for(var b=1,f=arguments.length;b<f;b++)l._mixin(a.prototype,arguments[b]);return a},_hitchArgs:function(a,c){var f=l._toArray(arguments,2),d=l.isString(c);return function(){var g=
l._toArray(arguments),h=d?(a||b.global)[c]:c;return h&&h.apply(a||this,f.concat(g))}},hitch:function(a,c){if(2<arguments.length)return l._hitchArgs.apply(b,arguments);c||(c=a,a=null);if(l.isString(c)){a=a||b.global;if(!a[c])throw['lang.hitch: scope["',c,'"] is null (scope="',a,'")'].join("");return function(){return a[c].apply(a,arguments||[])}}return!a?c:function(){return c.apply(a,arguments||[])}},delegate:function(){function a(){}return function(c,b){a.prototype=c;var f=new a;a.prototype=null;
b&&l._mixin(f,b);return f}}(),_toArray:d("ie")?function(){function a(a,c,b){b=b||[];for(c=c||0;c<a.length;c++)b.push(a[c]);return b}return function(e){return(e.item?a:c).apply(this,arguments)}}():c,partial:function(a){return l.hitch.apply(b,[null].concat(l._toArray(arguments)))},clone:function(a){if(!a||"object"!=typeof a||l.isFunction(a))return a;if(a.nodeType&&"cloneNode"in a)return a.cloneNode(!0);if(a instanceof Date)return new Date(a.getTime());if(a instanceof RegExp)return RegExp(a);var c,b,
f;if(l.isArray(a)){c=[];for(b=0,f=a.length;b<f;++b)b in a&&c.push(l.clone(a[b]))}else c=a.constructor?new a.constructor:{};return l._mixin(c,a,l.clone)},trim:String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},replace:function(a,c,b){return a.replace(b||f,l.isFunction(c)?c:function(a,b){return l.getObject(b,!1,c)})}};l.mixin(b,l);return l})},"dojo/_base/kernel":function(){define(["../has","./config","require","module"],function(b,d,h,
g){var i,b={},k={},c={config:d,global:this,dijit:b,dojox:k},b={dojo:["dojo",c],dijit:["dijit",b],dojox:["dojox",k]},g=h.map&&h.map[g.id.match(/[^\/]+/)[0]];for(i in g)b[i]?b[i][0]=g[i]:b[i]=[g[i],{}];for(i in b)g=b[i],g[1]._scopeName=g[0],d.noGlobals||(this[g[0]]=g[1]);c.scopeMap=b;c.baseUrl=c.config.baseUrl=h.baseUrl;c.isAsync=h.async;c.locale=d.locale;d="$Rev: 30226 $".match(/\d+/);c.version={major:1,minor:8,patch:3,flag:"",revision:d?+d[0]:NaN,toString:function(){var b=c.version;return b.major+
"."+b.minor+"."+b.patch+b.flag+" ("+b.revision+")"}};Function("d","d.eval = function(){return d.global.eval ? d.global.eval(arguments[0]) : eval(arguments[0]);}")(c);c.exit=function(){};c.deprecated=c.experimental=function(){};c._hasResource={};return c})},"dojo/has":function(){define("dojo/has",["require","module"],function(b){var d=b.has||function(){};d.add("touch","ontouchstart"in document);d.add("device-width",screen.availWidth||innerWidth);b=document.createElement("form");d.add("dom-attributes-explicit",
0==b.attributes.length);d.add("dom-attributes-specified-flag",0<b.attributes.length&&40>b.attributes.length);d.clearElement=function(b){b.innerHTML="";return b};d.normalize=function(b,g){var i=b.match(/[\?:]|[^:\?]*/g),k=0,c=function(b){var g=i[k++];if(":"==g)return 0;if("?"==i[k++]){if(!b&&d(g))return c();c(!0);return c(b)}return g||0};return(b=c())&&g(b)};d.load=function(b,d,i){b?d([b],i):i()};return d})},"dojo/_base/config":function(){define(["../has","require"],function(b,d){var h={},g=d.rawConfig,
i;for(i in g)h[i]=g[i];return h})},"dojo/sniff":function(){define(["./has"],function(b){var d=navigator,h=d.userAgent,d=d.appVersion,g=parseFloat(d);b.add("air",0<=h.indexOf("AdobeAIR"));b.add("khtml",0<=d.indexOf("Konqueror")?g:void 0);b.add("webkit",parseFloat(h.split("WebKit/")[1])||void 0);b.add("chrome",parseFloat(h.split("Chrome/")[1])||void 0);b.add("safari",0<=d.indexOf("Safari")&&!b("chrome")?parseFloat(d.split("Version/")[1]):void 0);b.add("mac",0<=d.indexOf("Macintosh"));b.add("quirks",
"BackCompat"==document.compatMode);b.add("ios",/iPhone|iPod|iPad/.test(h));b.add("android",parseFloat(h.split("Android ")[1])||void 0);if(!b("webkit")){0<=h.indexOf("Opera")&&b.add("opera",9.8<=g?parseFloat(h.split("Version/")[1])||g:g);0<=h.indexOf("Gecko")&&!b("khtml")&&!b("webkit")&&b.add("mozilla",g);b("mozilla")&&b.add("ff",parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0);if(document.all&&!b("opera"))h=parseFloat(d.split("MSIE ")[1])||void 0,(d=document.documentMode)&&5!=
d&&Math.floor(h)!=d&&(h=d),b.add("ie",h);b.add("wii","undefined"!=typeof opera&&opera.wiiremote)}return b})},"frozen/box2d/BoxGame":function(){define("frozen/box2d/BoxGame",["../GameCore","./Box","dcl","dcl/bases/Mixer"],function(b,d,h,g){return h([b,g],{box:null,boxUpdating:!0,entities:null,constructor:function(){if(!this.box)this.box=new d;if(!this.entities)this.entities={}},preUpdate:function(b){this.boxUpdating&&(this.box.update(b),this.box.updateExternalState(this.entities))}})})},"frozen/GameCore":function(){define("frozen/GameCore",
"dcl,dcl/bases/Mixer,dojo/_base/lang,dojo/dom,./InputManager,./ResourceManager,./shims/RAF".split(","),function(b,d,h,g,i,k){return b(d,{statics:{FONT_SIZE:24},isRunning:!1,canvasId:null,maxStep:40,contextType:"2d",height:0,width:0,resourceManager:null,inputManager:null,loadingForeground:"#00F",loadingBackground:"#FFF",gameAreaId:null,canvasPercentage:0,setHeight:function(c){this.height=c;this.canvas.height=c},setWidth:function(c){this.width=c;this.canvas.width=c},stop:function(){this.isRunning=!1},
run:function(){this.isRunning||(this.init(),this.loadResources(this.resourceManager),this.initInput(this.inputManager),this.launchLoop())},loadResources:function(){},init:function(){if(!this.canvas)this.canvas=g.byId(this.canvasId);if(this.canvas){if(!this.context)this.context=this.canvas.getContext(this.contextType);if(this.context){this.setHeight(this.height||this.canvas.height);this.setWidth(this.width||this.canvas.width);if(!this.inputManager)this.inputManager=this.gameAreaId&&this.canvasPercentage?
new i({canvas:this.canvas,gameArea:g.byId(this.gameAreaId),canvasPercentage:this.canvasPercentage}):new i({canvas:this.canvas});this.inputManager.resize();if(!this.resourceManager)this.resourceManager=new k;this.loadResources(this.resourceManager);this.isRunning=!0}else alert("Sorry, your browser does not support a "+this.contextType+" drawing surface on canvas.  I recommend any browser but Internet Explorer")}else alert("Sorry, your browser does not support canvas.  I recommend any browser but Internet Explorer")},
initInput:function(){},handleInput:function(){},gameLoop:function(){this.currTime=(new Date).getTime();this.elapsedTime=Math.min(this.currTime-this.prevTime,this.maxStep);this.prevTime=this.currTime;this.resourceManager&&!this.resourceManager.resourcesReady()?(this.updateLoadingScreen(this.elapsedTime),this.drawLoadingScreen(this.context)):(this.handleInput(this.inputManager,this.elapsedTime),this.paused||(this.preUpdate(this.elapsedTime),this.update(this.elapsedTime)),this.context.save(),this.draw(this.context),
this.context.restore())},launchLoop:function(){this.elapsedTime=0;var c=Date.now();this.prevTime=this.currTime=c;this.loopRunner=h.hitch(this,this.loopRunner);window.requestAnimationFrame(this.loopRunner)},loopRunner:function(){this.gameLoop();window.requestAnimationFrame(this.loopRunner)},preUpdate:function(){},update:function(){},updateLoadingScreen:function(){},draw:function(c){if("2d"===this.contextType)c.font="14px sans-serif",c.fillText("This game does not have its own draw function!",10,50)},
drawLoadingScreen:function(c){if(this.resourceManager&&"2d"===this.contextType)c.fillStyle=this.loadingBackground,c.fillRect(0,0,this.width,this.height),c.fillStyle=this.loadingForeground,c.strokeStyle=this.loadingForeground,c.font="bold "+Math.floor(this.height/12)+"px sans-serif",c.fillText("Loading... "+this.resourceManager.getPercentComplete()+"%",0.1*this.width,0.55*this.height),c.strokeRect(0.1*this.width,0.7*this.height,0.8*this.width,0.1*this.height),c.fillRect(0.1*this.width,0.7*this.height,
0.8*this.width*this.resourceManager.getPercentComplete()/100,0.1*this.height),c.lineWidth=4}})})},"dojo/dom":function(){define(["./sniff","./_base/window"],function(b,d){if(7>=b("ie"))try{document.execCommand("BackgroundImageCache",!1,!0)}catch(h){}var g={};g.byId=b("ie")?function(b,c){if("string"!=typeof b)return b;var f=c||d.doc,g=b&&f.getElementById(b);if(g&&(g.attributes.id.value==b||g.id==b))return g;f=f.all[b];if(!f||f.nodeName)f=[f];for(var a=0;g=f[a++];)if(g.attributes&&g.attributes.id&&g.attributes.id.value==
b||g.id==b)return g}:function(b,c){return("string"==typeof b?(c||d.doc).getElementById(b):b)||null};g.isDescendant=function(b,c){try{b=g.byId(b);for(c=g.byId(c);b;){if(b==c)return!0;b=b.parentNode}}catch(f){}return!1};b.add("css-user-select",function(b,c,f){if(!f)return!1;var b=f.style,c=["Khtml","O","ms","Moz","Webkit"],f=c.length,d="userSelect";do if("undefined"!==typeof b[d])return d;while(f--&&(d=c[f]+"UserSelect"));return!1});var i=b("css-user-select");g.setSelectable=i?function(b,c){g.byId(b).style[i]=
c?"":"none"}:function(b,c){var b=g.byId(b),f=b.getElementsByTagName("*"),d=f.length;if(c)for(b.removeAttribute("unselectable");d--;)f[d].removeAttribute("unselectable");else for(b.setAttribute("unselectable","on");d--;)f[d].setAttribute("unselectable","on")};return g})},"dojo/_base/window":function(){define(["./kernel","./lang","../sniff"],function(b,d,h){var g={global:b.global,doc:this.document||null,body:function(d){d=d||b.doc;return d.body||d.getElementsByTagName("body")[0]},setContext:function(d,
h){b.global=g.global=d;b.doc=g.doc=h},withGlobal:function(d,h,c,f){var l=b.global;try{return b.global=g.global=d,g.withDoc.call(null,d.document,h,c,f)}finally{b.global=g.global=l}},withDoc:function(d,k,c,f){var l=g.doc,a=h("quirks"),e=h("ie"),j,m,u;try{b.doc=g.doc=d;b.isQuirks=h.add("quirks","BackCompat"==b.doc.compatMode,!0,!0);if(h("ie")&&(u=d.parentWindow)&&u.navigator)j=parseFloat(u.navigator.appVersion.split("MSIE ")[1])||void 0,(m=d.documentMode)&&5!=m&&Math.floor(j)!=m&&(j=m),b.isIE=h.add("ie",
j,!0,!0);c&&"string"==typeof k&&(k=c[k]);return k.apply(c,f||[])}finally{b.doc=g.doc=l,b.isQuirks=h.add("quirks",a,!0,!0),b.isIE=h.add("ie",e,!0,!0)}}};d.mixin(b,g);return g})},"frozen/InputManager":function(){define("frozen/InputManager","./GameAction,./MouseAction,./utils/insideCanvas,dcl,dcl/bases/Mixer,dojo/has,dojo/on,dojo/dom-style,dojo/dom-geometry,dojo/_base/lang,dojo/domReady!".split(","),function(b,d,h,g,i,k,c,f,l,a){return g(i,{keyActions:[],mouseAction:null,touchAction:null,canvas:null,
handleMouse:!0,handleTouch:!0,handleKeys:!0,gameArea:null,canvasPercentage:null,constructor:function(){this.handleKeys&&(c(document,"keydown",a.hitch(this,"keyDown")),c(document,"keyup",a.hitch(this,"keyReleased")));this.handleMouse&&!k("touch")&&(c(document,"mousedown",a.hitch(this,"mouseDown")),c(document,"mousemove",a.hitch(this,"mouseMove")),c(document,"mouseup",a.hitch(this,"mouseUp")));this.handleTouch&&k("touch")&&(c(document,"touchstart",a.hitch(this,"touchStart")),c(document,"touchmove",
a.hitch(this,"touchMove")),c(document,"touchend",a.hitch(this,"touchEnd")));if(!this.mouseAction)this.mouseAction=new d;if(!this.touchAction)this.touchAction=new d;this.gameArea&&this.canvasPercentage&&(c(window,"resize",a.hitch(this,"resize")),c(window,"orientationchange",a.hitch(this,"resize")))},mapToKey:function(a,c){if(!this.keyActions)this.keyActions=[];this.keyActions[c]=a},addKeyAction:function(a,c){var f=new b;if(c)f.behavior=f.statics.DETECT_INITAL_PRESS_ONLY;this.mapToKey(f,a);return f},
setMouseAction:function(a){this.mouseAction=a},setTouchAction:function(a){this.touchAction=a},mouseUp:function(a){this.mouseAction.release();this.mouseAction.endPosition=this.getMouseLoc(a)},mouseDown:function(a){a=this.getMouseLoc(a);this.mouseAction.endPosition=null;this.mouseAction.insideCanvas=h(a,this.canvas);this.mouseAction.insideCanvas?(this.mouseAction.press(),this.mouseAction.startPosition=a,this.mouseAction.position=a):this.mouseAction.startPosition=null},mouseMove:function(a){this.mouseAction.position=
this.getMouseLoc(a)},touchStart:function(a){a=this.getMouseLoc(a.changedTouches[0]);this.touchAction.endPosition=null;this.touchAction.insideCanvas=h(a,this.canvas);this.touchAction.insideCanvas?(this.touchAction.press(),this.touchAction.startPosition=a,this.touchAction.position=a):this.touchAction.startPosition=null},touchEnd:function(a){this.touchAction.release();this.touchAction.endPosition=this.getMouseLoc(a.changedTouches[0])},touchMove:function(a){this.touchAction.position=this.getMouseLoc(a.changedTouches[0]);
this.touchAction.startPosition&&a.preventDefault()},getKeyAction:function(a){return this.keyActions.length?this.keyActions[a.keyCode]||this.keyActions[String.fromCharCode(a.keyCode)]:null},keyPressed:function(a){(a=this.getKeyAction(a))&&!a.isPressed()&&a.press()},keyDown:function(a){(a=this.getKeyAction(a))&&!a.isPressed()&&a.press()},keyReleased:function(a){(a=this.getKeyAction(a))&&a.release()},getMouseLoc:function(a){var c=l.position(this.canvas);return this.zoomRatio?{x:Math.round((a.clientX-
c.x)/this.zoomRatio),y:Math.round((a.clientY-c.y)/this.zoomRatio)}:{x:Math.round(a.clientX-c.x),y:Math.round(a.clientY-c.y)}},resize:function(){if(this.gameArea&&this.canvasPercentage&&this.canvas){var a=this.canvas.width,c=this.canvas.height,b=l.getMarginExtents(document.body),d=window.innerWidth-b.w,b=window.innerHeight-b.h,c=a/c,g="",h="";d/b>c?(d=b*c,g=d+"px",h=b+"px"):(g=d+"px",h=Math.round(d/c)+"px");this.zoomRatio=d/a*this.canvasPercentage;f.set(this.gameArea,{width:g,height:h});a=Math.floor(100*
this.canvasPercentage)+"%";f.set(this.canvas,{width:a,height:a,display:"block",marginLeft:"auto",marginRight:"auto"})}}})})},"frozen/GameAction":function(){define("frozen/GameAction",["dcl","dcl/bases/Mixer"],function(b,d){return b(d,{name:null,behavior:0,amount:0,state:0,statics:{NORMAL:0,DETECT_INITAL_PRESS_ONLY:1,STATE_RELEASED:0,STATE_PRESSED:1,STATE_WAITING_FOR_RELEASE:2,STATE_MOVED:3},constructor:function(){this.reset()},getName:function(){return this.name},reset:function(){this.state=this.statics.STATE_RELEASED;
this.amount=0},tap:function(){this.press();this.release()},press:function(){this.state=this.statics.STATE_PRESSED;this.behavior===this.statics.DETECT_INITAL_PRESS_ONLY&&this.pressAmt(1)},pressAmt:function(b){if(this.state!==this.statics.STATE_WAITING_FOR_RELEASE)this.amount+=b,this.state=this.statics.STATE_WAITING_FOR_RELEASE},release:function(){this.state=this.statics.STATE_RELEASED},isPressed:function(){return this.state===this.statics.STATE_PRESSED?!0:!1},getAmount:function(){var b=this.amount;
if(0!==b)if(this.state===this.statics.STATE_RELEASED)this.amount=0;else if(this.behavior===this.statics.DETECT_INITAL_PRESS_ONLY)this.state=this.statics.STATE_WAITING_FOR_RELEASE,this.amount=0;return b}})})},"frozen/MouseAction":function(){define("frozen/MouseAction",["dcl","dcl/bases/Mixer","./GameAction"],function(b,d,h){return b([d,h],{startPosition:null,endPosition:null,position:null})})},"frozen/utils/insideCanvas":function(){define("frozen/utils/insideCanvas",function(){return function(b,d){return 0>
b.x||b.x>d.width||0>b.y||b.y>d.height?!1:!0}})},"dojo/on":function(){define("dojo/on",["require","./_base/kernel","./has"],function(b,d,h){function g(a,b,d,g,j){if(g=b.match(/(.*):(.*)/))return b=g[2],g=g[1],c.selector(g,b).call(j,a,d);h("touch")&&(f.test(b)&&(d=o(d)),!h("event-orientationchange")&&"orientationchange"==b&&(b="resize",a=window,d=o(d)));m&&(d=m(d));if(a.addEventListener){var i=b in e,k=i?e[b]:b;a.addEventListener(k,d,i);return{remove:function(){a.removeEventListener(k,d,i)}}}b="on"+
b;throw Error("Target must be an event emitter");}function i(){this.cancelable=!1}function k(){this.bubbles=!1}b=window.ScriptEngineMajorVersion;h.add("jscript",b&&b()+ScriptEngineMinorVersion()/10);h.add("event-orientationchange",h("touch")&&!h("android"));h.add("event-stopimmediatepropagation",window.Event&&!!window.Event.prototype&&!!window.Event.prototype.stopImmediatePropagation);var c=function(a,b,e,d){return"function"==typeof a.on&&"function"!=typeof b?a.on(b,e):c.parse(a,b,e,g,d,this)};c.pausable=
function(a,b,e,d){var f,a=c(a,b,function(){if(!f)return e.apply(this,arguments)},d);a.pause=function(){f=!0};a.resume=function(){f=!1};return a};c.once=function(a,b,e){var d=c(a,b,function(){d.remove();return e.apply(this,arguments)});return d};c.parse=function(a,c,b,e,d,f){if(c.call)return c.call(f,a,b);if(-1<c.indexOf(",")){for(var c=c.split(/\s*,\s*/),g=[],h=0,j;j=c[h++];)g.push(e(a,j,b,d,f));g.remove=function(){for(var a=0;a<g.length;a++)g[a].remove()};return g}return e(a,c,b,d,f)};var f=/^touch/;
c.selector=function(a,b,e){return function(f,g){function h(c){for(j=j&&j.matches?j:d.query;!j.matches(c,a,f);)if(c==f||!1===e||!(c=c.parentNode)||1!=c.nodeType)return;return c}var j="function"==typeof a?{matches:a}:this,i=b.bubble;return i?c(f,i(h),g):c(f,b,function(a){var c=h(a.target);return c&&g.call(c,a)})}};var l=[].slice,a=c.emit=function(a,c,b){var e=l.call(arguments,2),d="on"+c;if("parentNode"in a){var f=e[0]={},g;for(g in b)f[g]=b[g];f.preventDefault=i;f.stopPropagation=k;f.target=a;f.type=
c;b=f}do a[d]&&a[d].apply(a,e);while(b&&b.bubbles&&(a=a.parentNode));return b&&b.cancelable&&b},e={};if(!h("event-stopimmediatepropagation"))var j=function(){this.modified=this.immediatelyStopped=!0},m=function(a){return function(c){if(!c.immediatelyStopped)return c.stopImmediatePropagation=j,a.apply(this,arguments)}};e={focusin:"focus",focusout:"blur"};c.emit=function(b,e,d){if(b.dispatchEvent&&document.createEvent){var f=b.ownerDocument.createEvent("HTMLEvents");f.initEvent(e,!!d.bubbles,!!d.cancelable);
for(var g in d)g in f||(f[g]=d[g]);return b.dispatchEvent(f)&&f}return a.apply(c,arguments)};if(h("touch"))var u=function(){},p=window.orientation,o=function(a){return function(c){var b=c.corrected;if(!b){var e=c.type;try{delete c.type}catch(d){}c.type?(u.prototype=c,b=new u,b.preventDefault=function(){c.preventDefault()},b.stopPropagation=function(){c.stopPropagation()}):(b=c,b.type=e);c.corrected=b;if("resize"==e){if(p==window.orientation)return null;p=window.orientation;b.type="orientationchange";
return a.call(this,b)}if(!("rotation"in b))b.rotation=0,b.scale=1;var e=b.changedTouches[0],f;for(f in e)delete b[f],b[f]=e[f]}return a.call(this,b)}};return c})},"dojo/dom-style":function(){define(["./sniff","./dom"],function(b,d){function h(c,f,d){f=f.toLowerCase();if(b("ie")){if("auto"==d){if("height"==f)return c.offsetHeight;if("width"==f)return c.offsetWidth}if("fontweight"==f)switch(d){case 700:return"bold";default:return"normal"}}f in a||(a[f]=e.test(f));return a[f]?k(c,d):d}var g,i={};g=b("webkit")?
function(a){var c;if(1==a.nodeType){var b=a.ownerDocument.defaultView;c=b.getComputedStyle(a,null);if(!c&&a.style)a.style.display="",c=b.getComputedStyle(a,null)}return c||{}}:b("ie")&&(9>b("ie")||b("quirks"))?function(a){return 1==a.nodeType&&a.currentStyle?a.currentStyle:{}}:function(a){return 1==a.nodeType?a.ownerDocument.defaultView.getComputedStyle(a,null):{}};i.getComputedStyle=g;var k;k=b("ie")?function(a,c){if(!c)return 0;if("medium"==c)return 4;if(c.slice&&"px"==c.slice(-2))return parseFloat(c);
var b=a.style,e=a.runtimeStyle,f=b.left,d=e.left;e.left=a.currentStyle.left;try{b.left=c,c=b.pixelLeft}catch(g){c=0}b.left=f;e.left=d;return c}:function(a,c){return parseFloat(c)||0};i.toPixelValue=k;var c=function(a,c){try{return a.filters.item("DXImageTransform.Microsoft.Alpha")}catch(b){return c?{}:null}},f=9>b("ie")||10>b("ie")&&b("quirks")?function(a){try{return c(a).Opacity/100}catch(b){return 1}}:function(a){return g(a).opacity},l=9>b("ie")||10>b("ie")&&b("quirks")?function(a,b){var e=100*
b,f=1==b;a.style.zoom=f?"":1;if(c(a))c(a,1).Opacity=e;else{if(f)return b;a.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+e+")"}c(a,1).Enabled=!f;if("tr"==a.tagName.toLowerCase())for(e=a.firstChild;e;e=e.nextSibling)"td"==e.tagName.toLowerCase()&&l(e,b);return b}:function(a,c){return a.style.opacity=c},a={left:!0,top:!0},e=/margin|padding|width|height|max|min|offset/,j=b("ie")?"styleFloat":"cssFloat",m={cssFloat:j,styleFloat:j,"float":j};i.get=function(a,c){var b=d.byId(a),e=arguments.length;
if(2==e&&"opacity"==c)return f(b);var c=m[c]||c,g=i.getComputedStyle(b);return 1==e?g:h(b,c,g[c]||b.style[c])};i.set=function(a,c,b){var e=d.byId(a),f=arguments.length,g="opacity"==c,c=m[c]||c;if(3==f)return g?l(e,b):e.style[c]=b;for(var j in c)i.set(a,j,c[j]);return i.getComputedStyle(e)};return i})},"dojo/dom-geometry":function(){define(["./sniff","./_base/window","./dom","./dom-style"],function(b,d,h,g){function i(a,c,b,f,d,g){g=g||"px";a=a.style;if(!isNaN(c))a.left=c+g;if(!isNaN(b))a.top=b+g;
if(0<=f)a.width=f+g;if(0<=d)a.height=d+g}function k(a){return"button"==a.tagName.toLowerCase()||"input"==a.tagName.toLowerCase()&&"button"==(a.getAttribute("type")||"").toLowerCase()}function c(a){return"border-box"==f.boxModel||"table"==a.tagName.toLowerCase()||k(a)}var f={boxModel:"content-box"};if(b("ie"))f.boxModel="BackCompat"==document.compatMode?"border-box":"content-box";f.getPadExtents=function(a,c){var a=h.byId(a),b=c||g.getComputedStyle(a),f=g.toPixelValue,d=f(a,b.paddingLeft),i=f(a,b.paddingTop),
k=f(a,b.paddingRight),b=f(a,b.paddingBottom);return{l:d,t:i,r:k,b:b,w:d+k,h:i+b}};f.getBorderExtents=function(a,c){var a=h.byId(a),b=g.toPixelValue,f=c||g.getComputedStyle(a),d="none"!=f.borderLeftStyle?b(a,f.borderLeftWidth):0,i="none"!=f.borderTopStyle?b(a,f.borderTopWidth):0,k="none"!=f.borderRightStyle?b(a,f.borderRightWidth):0,b="none"!=f.borderBottomStyle?b(a,f.borderBottomWidth):0;return{l:d,t:i,r:k,b:b,w:d+k,h:i+b}};f.getPadBorderExtents=function(a,c){var a=h.byId(a),b=c||g.getComputedStyle(a),
d=f.getPadExtents(a,b),b=f.getBorderExtents(a,b);return{l:d.l+b.l,t:d.t+b.t,r:d.r+b.r,b:d.b+b.b,w:d.w+b.w,h:d.h+b.h}};f.getMarginExtents=function(a,c){var a=h.byId(a),b=c||g.getComputedStyle(a),f=g.toPixelValue,d=f(a,b.marginLeft),i=f(a,b.marginTop),k=f(a,b.marginRight),b=f(a,b.marginBottom);return{l:d,t:i,r:k,b:b,w:d+k,h:i+b}};f.getMarginBox=function(a,c){var a=h.byId(a),d=c||g.getComputedStyle(a),i=f.getMarginExtents(a,d),k=a.offsetLeft-i.l,l=a.offsetTop-i.t,o=a.parentNode,n=g.toPixelValue;if(b("mozilla")){var A=
parseFloat(d.left),d=parseFloat(d.top);!isNaN(A)&&!isNaN(d)?(k=A,l=d):o&&o.style&&(o=g.getComputedStyle(o),"visible"!=o.overflow&&(k+="none"!=o.borderLeftStyle?n(a,o.borderLeftWidth):0,l+="none"!=o.borderTopStyle?n(a,o.borderTopWidth):0))}else if((b("opera")||8==b("ie")&&!b("quirks"))&&o)o=g.getComputedStyle(o),k-="none"!=o.borderLeftStyle?n(a,o.borderLeftWidth):0,l-="none"!=o.borderTopStyle?n(a,o.borderTopWidth):0;return{l:k,t:l,w:a.offsetWidth+i.w,h:a.offsetHeight+i.h}};f.getContentBox=function(a,
c){var a=h.byId(a),d=c||g.getComputedStyle(a),i=a.clientWidth,k=f.getPadExtents(a,d),l=f.getBorderExtents(a,d);i?(d=a.clientHeight,l.w=l.h=0):(i=a.offsetWidth,d=a.offsetHeight);b("opera")&&(k.l+=l.l,k.t+=l.t);return{l:k.l,t:k.t,w:i-k.w-l.w,h:d-k.h-l.h}};f.setContentSize=function(a,b,d){var a=h.byId(a),g=b.w,b=b.h;c(a)&&(d=f.getPadBorderExtents(a,d),0<=g&&(g+=d.w),0<=b&&(b+=d.h));i(a,NaN,NaN,g,b)};var l={l:0,t:0,w:0,h:0};f.setMarginBox=function(a,e,d){var a=h.byId(a),m=d||g.getComputedStyle(a),d=e.w,
u=e.h,p=c(a)?l:f.getPadBorderExtents(a,m),m=f.getMarginExtents(a,m);if(b("webkit")&&k(a)){var o=a.style;if(0<=d&&!o.width)o.width="4px";if(0<=u&&!o.height)o.height="4px"}0<=d&&(d=Math.max(d-p.w-m.w,0));0<=u&&(u=Math.max(u-p.h-m.h,0));i(a,e.l,e.t,d,u)};f.isBodyLtr=function(a){a=a||d.doc;return"ltr"==(d.body(a).dir||a.documentElement.dir||"ltr").toLowerCase()};f.docScroll=function(a){var a=a||d.doc,c=d.doc.parentWindow||d.doc.defaultView;return"pageXOffset"in c?{x:c.pageXOffset,y:c.pageYOffset}:(c=
b("quirks")?d.body(a):a.documentElement)&&{x:f.fixIeBiDiScrollLeft(c.scrollLeft||0,a),y:c.scrollTop||0}};if(b("ie"))f.getIeDocumentElementOffset=function(a){a=a||d.doc;a=a.documentElement;if(8>b("ie")){var c=a.getBoundingClientRect(),f=c.left,c=c.top;7>b("ie")&&(f+=a.clientLeft,c+=a.clientTop);return{x:0>f?0:f,y:0>c?0:c}}return{x:0,y:0}};f.fixIeBiDiScrollLeft=function(a,c){var c=c||d.doc,g=b("ie");if(g&&!f.isBodyLtr(c)){var h=b("quirks"),i=h?d.body(c):c.documentElement,k=d.global;6==g&&!h&&k.frameElement&&
i.scrollHeight>i.clientHeight&&(a+=i.clientLeft);return 8>g||h?a+i.clientWidth-i.scrollWidth:-a}return a};f.position=function(a,c){var a=h.byId(a),g=d.body(a.ownerDocument),i=a.getBoundingClientRect(),i={x:i.left,y:i.top,w:i.right-i.left,h:i.bottom-i.top};if(9>b("ie")){var k=f.getIeDocumentElementOffset(a.ownerDocument);i.x-=k.x+(b("quirks")?g.clientLeft+g.offsetLeft:0);i.y-=k.y+(b("quirks")?g.clientTop+g.offsetTop:0)}c&&(g=f.docScroll(a.ownerDocument),i.x+=g.x,i.y+=g.y);return i};f.getMarginSize=
function(a,c){var a=h.byId(a),b=f.getMarginExtents(a,c||g.getComputedStyle(a)),d=a.getBoundingClientRect();return{w:d.right-d.left+b.w,h:d.bottom-d.top+b.h}};f.normalizeEvent=function(a){if(!("layerX"in a))a.layerX=a.offsetX,a.layerY=a.offsetY};return f})},"dojo/domReady":function(){define("dojo/domReady",["./has"],function(){function b(a){k?a(h):c.push(a)}var d=this,h=document,g={loaded:1,complete:1},i="string"!=typeof h.readyState,k=!!g[h.readyState];if(i)h.readyState="loading";if(!k){var c=[],
f=[],l=function(a){a=a||d.event;if(!(k||"readystatechange"==a.type&&!g[h.readyState])){k=1;if(i)h.readyState="complete";for(;c.length;)c.shift()(h)}},a=function(a,b){a.addEventListener(b,l,!1);c.push(function(){a.removeEventListener(b,l,!1)})};a(h,"DOMContentLoaded");a(d,"load");"onreadystatechange"in h?a(h,"readystatechange"):i||f.push(function(){return g[h.readyState]});if(f.length){var e=function(){if(!k){for(var a=f.length;a--;)if(f[a]()){l("poller");return}setTimeout(e,30)}};e()}}b.load=function(a,
c,e){b(e)};return b})},"frozen/ResourceManager":function(){define("frozen/ResourceManager",["./sounds/Sound!","dcl","dcl/bases/Mixer","dojo/_base/lang","dojo/on"],function(b,d,h,g,i){function k(c,b){var d=b;c&&(d=[c,b].join("/"));return d.replace(/\/{2,}/g,"/")}return d(h,{imageCount:0,loadedImages:0,allLoaded:!1,imageDir:null,soundDir:null,resourceList:{},loadImage:function(c){var b=!1;if(!Array.isArray(c))if("string"===typeof c)b=!0,c=[c];else if("object"!==typeof c)return;for(var d in c)if(c.hasOwnProperty(d)){var a=
k(this.imageDir,c[d]);if(this.resourceList[a])c[d]=this.resourceList[a].img;else{this.allLoaded=!1;var e=new Image,h={name:a,img:e,complete:!1},m=g.partial(function(a){a.complete=!0},h);i(e,"load",m);e.src=a;this.resourceList[a]=h;c[d]=e}}return b?c[0]:c},loadSound:function(c){var d=!1;if(!Array.isArray(c))if("string"===typeof c)d=!0,c=[c];else if("object"!==typeof c)return;for(var g in c)if(c.hasOwnProperty(g)){var a=k(this.soundDir,c[g]);if(this.resourceList[a])c[g]=this.resourceList[a];else{this.allLoaded=
!1;var e=new b(a);this.resourceList[a]=e;c[g]=e}}return d?c[0]:c},playSound:function(c,b,d,a){c&&(b?c.loop(a):c.play(a,d||0))},resourcesReady:function(){if(!this.allLoaded){for(var c in this.resourceList)if(!this.resourceList[c].complete)return!1;this.allLoaded=!0}return!0},getPercentComplete:function(){var c=0,b=0,d;for(d in this.resourceList){var a=this.resourceList[d];b++;a.complete&&(c+=1)}return 0===b?0:Math.round(100*(c/b))}})})},"frozen/sounds/Sound":function(){define(["./AudioBase","./WebAudio",
"./HTML5Audio","dojo/has"],function(b,d,h,g){return{load:function(i,k,c){return g("WebAudio")?c(d):g("HTML5Audio")?c(h):c(b)}}})},"frozen/sounds/AudioBase":function(){define("frozen/sounds/AudioBase",["dcl"],function(b){return b(null,{declaredClass:"frozen/sounds/AudioBase",name:null,complete:!1,constructor:function(b){"string"===typeof b&&this.load(b)},load:function(b){this.name=b;this.complete=!0},loop:function(){},play:function(){},_initAudio:function(){}})})},"frozen/sounds/WebAudio":function(){define("frozen/sounds/WebAudio",
"./AudioBase,dcl,dojo/on,dojo/has,dojo/_base/lang,../shims/AudioContext".split(","),function(b,d,h,g,i){g.add("WebAudio",function(c){return!!c.AudioContext});var k=null;g("WebAudio")&&(k=new window.AudioContext);return d(b,{declaredClass:"frozen/sounds/WebAudio",audioContext:k,buffer:null,load:function(c){this.name=c;var b=i.partial(function(a){a.audioContext.decodeAudioData(this.response,function(c){a.buffer=c;a.complete=!0},function(){})},this),d=new XMLHttpRequest;d.open("GET",c,!0);d.responseType=
"arraybuffer";h(d,"load",b);d.send()},loop:function(c){this._initAudio(c,!0).noteOn(0)},play:function(c,b){this._initAudio(c,!1).noteOn(b||0)},_initAudio:function(c,b){var b="boolean"===typeof b?b:!1,d=this.audioContext.createBufferSource();d.buffer=this.buffer;d.loop=b;if(c){var a=this.audioContext.createGainNode();a.gain.value=c;d.connect(a);a.connect(this.audioContext.destination)}else d.connect(this.audioContext.destination);return d}})})},"frozen/shims/AudioContext":function(){define("frozen/shims/AudioContext",
function(){for(var b=["ms","moz","webkit","o"],d=0;d<b.length&&!window.AudioContext;++d)window.AudioContext=window[b[d]+"AudioContext"]})},"frozen/sounds/HTML5Audio":function(){define("frozen/sounds/HTML5Audio",["./AudioBase","dcl","dojo/on","dojo/has","dojo/_base/lang"],function(b,d,h,g,i){g.add("HTML5Audio",function(b){return!!b.Audio});g.add("shittySound",(g("ios")||g("android"))&&g("webkit"));return d(b,{declaredClass:"frozen/sounds/HTML5Audio",audio:null,load:function(b){this.name=b;this.audio=
new Audio;if(g("shittySound"))h.once(document,"touchstart",i.hitch(this,function(){this.audio.load()})),this._updateCurrentTime=null,h.once(this.audio,"progress",i.hitch(this,function(){null!==this._updateCurrentTime&&this._updateCurrentTime()}));this.audio.pause();this.audio.preload="auto";h.once(this.audio,"loadeddata, error",i.hitch(this,function(){this.complete=!0}));this.audio.src=b},loop:function(b){var c=this._initAudio(b,!0);h(c,"loadeddata",function(){c.play()})},play:function(b,c){c=c||
0;if(g("shittySound"))try{return this.audio.currentTime=c/1E3,this.audio.play()}catch(d){return this._updateCurrentTime=function(){this._updateCurrentTime=null;this.audio.currentTime=c/1E3;return this.audio.play()},this.audio.play()}var i=this._initAudio(b,!1);h(i,"loadeddata",function(){i.currentTime=c/1E3;i.play()})},_initAudio:function(b,c){var c="boolean"===typeof c?c:!1,d=new Audio;d.pause();d.volume=b||1;d.loop=c;d.preload="auto";d.mozLoadFrom?d.mozLoadFrom(this.audio):d.src=this.name;return d}})})},
"frozen/shims/RAF":function(){define("frozen/shims/RAF",function(){for(var b=0,d=["ms","moz","webkit","o"],h=0;h<d.length&&!window.requestAnimationFrame;++h)window.requestAnimationFrame=window[d[h]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[d[h]+"CancelAnimationFrame"]||window[d[h]+"CancelRequestAnimationFrame"];if(!window.requestAnimationFrame)window.requestAnimationFrame=function(d){var h=(new Date).getTime(),k=Math.max(0,16-(h-b)),c=window.setTimeout(function(){d(h+k)},k);b=h+
k;return c};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=function(b){clearTimeout(b)}})},"frozen/box2d/CircleEntity":function(){define("frozen/box2d/CircleEntity",["dcl","dcl/bases/Mixer","./Entity","../utils/distance"],function(b,d,h,g){return b([d,h],{radius:1,draw:b.superCall(function(b){return function(d,c){var c=c||this.scale||1,f=d.lineWidth;d.lineWidth=this.lineWidth;d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;d.beginPath();d.arc(this.x*c,this.y*c,this.radius*c,
0,2*Math.PI,!0);d.closePath();d.fill();d.stroke();this.staticBody||(d.save(),d.translate(this.x*c,this.y*c),d.rotate(this.angle),d.translate(-this.x*c,-this.y*c),d.beginPath(),d.moveTo(this.x*c,this.y*c),d.lineTo(this.x*c,this.y*c-this.radius*c),d.closePath(),d.stroke(),d.restore());d.lineWidth=f;b.apply(this,[d,c])}}),scaleShape:b.superCall(function(b){return function(d){this.radius*=d;b.apply(this,[d])}}),pointInShape:function(b){return g(b,this)<=this.radius}})})},"frozen/box2d/Entity":function(){define("frozen/box2d/Entity",
["dcl","dcl/bases/Mixer","dojo/_base/lang"],function(b,d,h){return b(d,{id:0,x:0,y:0,scale:null,angle:0,center:null,restitution:0.3,density:1,friction:0.9,linearDamping:0,linearVelocity:null,angularVelocity:0,angularDamping:0,staticBody:!1,fillStyle:"rgba(128,128,128,0.5)",strokeStyle:"#000",lineWidth:1,hidden:!1,maskBits:null,categoryBits:null,groupIndex:null,update:function(b){h.mixin(this,b)},draw:function(b,d){var d=d||this.scale||1,h=b.lineWidth;b.lineWidth=this.lineWidth;b.fillStyle=this.strokeStyle;
b.beginPath();b.arc(this.x*d,this.y*d,4,0,2*Math.PI,!0);b.closePath();b.fill();if(this.center)b.fillStyle="yellow",b.beginPath(),b.arc(this.center.x*d,this.center.y*d,2,0,2*Math.PI,!0),b.closePath(),b.fill();b.lineWidth=h},scaleShape:function(b){this.x*=b;this.y*=b;this.alreadyScaled=!0}})})},"frozen/utils/distance":function(){define("frozen/utils/distance",function(){return function(b,d){return Math.sqrt((d.x-b.x)*(d.x-b.x)+(d.y-b.y)*(d.y-b.y))}})},"frozen/box2d/PolygonEntity":function(){define("frozen/box2d/PolygonEntity",
"dcl,dcl/bases/Mixer,./Entity,../utils/scalePoints,../utils/pointInPolygon,../utils/translatePoints".split(","),function(b,d,h,g,i,k){return b([d,h],{points:[],draw:b.superCall(function(c){return function(b,d){var d=d||this.scale||1,a=b.lineWidth;b.lineWidth=this.lineWidth;b.save();b.translate(this.x*d,this.y*d);b.rotate(this.angle);b.translate(-this.x*d,-this.y*d);b.fillStyle=this.fillStyle;b.strokeStyle=this.strokeStyle;b.beginPath();b.moveTo((this.x+this.points[0].x)*d,(this.y+this.points[0].y)*
d);for(var e=1;e<this.points.length;e++)b.lineTo((this.points[e].x+this.x)*d,(this.points[e].y+this.y)*d);b.lineTo((this.x+this.points[0].x)*d,(this.y+this.points[0].y)*d);b.closePath();b.fill();b.stroke();b.restore();b.lineWidth=a;c.apply(this,[b,d])}}),scaleShape:b.superCall(function(b){return function(d){this.points=g(this.points,d);b.apply(this,[d])}}),pointInShape:function(b){return i(b,k(this.points,this))}})})},"frozen/utils/scalePoints":function(){define("frozen/utils/scalePoints",function(){function b(d,
h){if(Array.isArray(d)){var g=[];d.forEach(function(d){g.push(b(d,h))});d=g}else d="object"===typeof h?{x:d.x*h.x,y:d.y*h.y}:{x:d.x*h,y:d.y*h};return d}return b})},"frozen/utils/pointInPolygon":function(){define("frozen/utils/pointInPolygon",function(){return function(b,d){if(!b||!d)return!1;for(var h=d.points||d,g=!1,i=h.length-1,k=0;k<h.length;i=k++){var c=h[k].x,f=h[k].y,l=h[i].x,i=h[i].y;f>b.y!==i>b.y&&b.x<(l-c)*(b.y-f)/(i-f)+c&&(g=!g)}return g}})},"frozen/utils/translatePoints":function(){define("frozen/utils/translatePoints",
function(){function b(d,h){if(Array.isArray(d)){var g=[];d.forEach(function(d){g.push(b(d,h))});d=g}else d={x:d.x,y:d.y},null!=h.x&&(d.x+=h.x),null!=h.y&&(d.y+=h.y);return d}return b})},"frozen/box2d/MultiPolygonEntity":function(){define("frozen/box2d/MultiPolygonEntity","dcl,dcl/bases/Mixer,./Entity,../utils/scalePoints,../utils/pointInPolygon,../utils/translatePoints".split(","),function(b,d,h,g,i,k){return b([d,h],{polys:[],draw:b.superCall(function(b){return function(d,g){var g=g||this.scale||
1,a=d.lineWidth;d.lineWidth=this.lineWidth;d.save();d.translate(this.x*g,this.y*g);d.rotate(this.angle);d.translate(-this.x*g,-this.y*g);d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;for(var e=0;e<this.polys.length;e++){d.beginPath();d.moveTo((this.x+this.polys[e][0].x)*g,(this.y+this.polys[e][0].y)*g);for(var h=1;h<this.polys[e].length;h++)d.lineTo((this.polys[e][h].x+this.x)*g,(this.polys[e][h].y+this.y)*g);d.lineTo((this.x+this.polys[e][0].x)*g,(this.y+this.polys[e][0].y)*g);d.closePath();
d.fill();d.stroke()}d.restore();d.lineWidth=a;b.apply(this,[d,g])}}),scaleShape:b.superCall(function(b){return function(d){this.polys=g(this.polys,d);b.apply(this,[d])}}),pointInShape:function(b){for(var d=0;d<this.polys.length;d++)if(i(b,k(this.polys[d],this)))return!0;return!1}})})},"frozen/box2d/RectangleEntity":function(){define("frozen/box2d/RectangleEntity",["dcl","dcl/bases/Mixer","./Entity"],function(b,d,h){return b([d,h],{halfWidth:1,halfHeight:1,draw:b.superCall(function(b){return function(d,
h){var h=h||this.scale||1,c=d.lineWidth;d.lineWidth=this.lineWidth;d.save();d.translate(this.x*h,this.y*h);d.rotate(this.angle);d.translate(-this.x*h,-this.y*h);d.fillStyle=this.fillStyle;d.strokeStyle=this.strokeStyle;d.fillRect((this.x-this.halfWidth)*h,(this.y-this.halfHeight)*h,2*this.halfWidth*h,2*this.halfHeight*h);d.strokeRect((this.x-this.halfWidth)*h,(this.y-this.halfHeight)*h,2*this.halfWidth*h,2*this.halfHeight*h);d.restore();d.lineWidth=c;b.apply(this,[d,h])}}),scaleShape:b.superCall(function(b){return function(d){this.halfHeight*=
d;this.halfWidth*=d;b.apply(this,[d])}}),pointInShape:function(b){return b.x>=this.x-this.halfWidth&&b.x<=this.x+this.halfWidth&&b.y>=this.y-this.halfHeight&&b.y<=this.y+this.halfHeight}})})},"frozen/box2d/joints/Joint":function(){define("frozen/box2d/joints/Joint",["dcl","dcl/bases/Mixer"],function(b,d){return b(d,{bodyId1:null,bodyId2:null,bodyPoint1:null,jointAttributes:null,scaleJointLocation:function(b){if(b&&this.bodyPoint1)this.bodyPoint1.x*=b,this.bodyPoint1.y*=b,this.alreadyScaled=!0}})})},
"frozen/box2d/joints/Revolute":function(){define("frozen/box2d/joints/Revolute",["dcl","dcl/bases/Mixer","dojo/_base/lang","./Joint"],function(b,d,h,g){var i=Box2D.Common.Math.b2Vec2,k=Box2D.Dynamics.Joints.b2RevoluteJointDef;return b([d,g],{createB2Joint:function(b){if(b&&b.bodiesMap&&b.b2World&&b.jointsMap&&!b.jointsMap[this.id]){var d=b.bodiesMap[this.bodyId1],g=b.bodiesMap[this.bodyId2];if(d&&g){var a;this.bodyPoint1&&(a=new i(this.bodyPoint1.x,this.bodyPoint1.y));a=a||d.GetWorldCenter();var e=
new k;e.Initialize(d,g,a,void 0);this.jointAttributes&&h.mixin(e,this.jointAttributes);return b.b2World.CreateJoint(e)}}}})})},"frozen/box2d/joints/Distance":function(){define("frozen/box2d/joints/Distance",["dcl","dcl/bases/Mixer","dojo/_base/lang","./Joint"],function(b,d,h,g){var i=Box2D.Common.Math.b2Vec2,k=Box2D.Dynamics.Joints.b2DistanceJointDef;return b([d,g],{bodyPoint2:null,scaleJointLocation:b.superCall(function(b){return function(d){if(d&&this.bodyPoint2)this.bodyPoint2.x*=d,this.bodyPoint2.y*=
d,this.alreadyScaled=!0;b.apply(this,[d])}}),createB2Joint:function(b){if(b&&b.bodiesMap&&b.b2World&&b.jointsMap&&!b.jointsMap[this.id]){var d=b.bodiesMap[this.bodyId1],g=b.bodiesMap[this.bodyId2];if(d&&g){var a,e;this.bodyPoint1&&(a=new i(this.bodyPoint1.x,this.bodyPoint1.y));this.bodyPoint2&&(e=new i(this.bodyPoint2.x,this.bodyPoint2.y));a=a||d.GetWorldCenter();e=e||g.GetWorldCenter();var j=new k;j.Initialize(d,g,a,e);this.jointAttributes&&h.mixin(j,this.jointAttributes);return b.b2World.CreateJoint(j)}}}})})},
"frozen/box2d/joints/Prismatic":function(){define("frozen/box2d/joints/Prismatic",["dcl","dcl/bases/Mixer","dojo/_base/lang","./Joint"],function(b,d,h,g){var i=Box2D.Common.Math.b2Vec2,k=Box2D.Dynamics.Joints.b2PrismaticJointDef;return b([d,g],{axisScale:null,createB2Joint:function(b){if(b&&b.bodiesMap&&b.b2World&&b.jointsMap&&!b.jointsMap[this.id]){var d=b.bodiesMap[this.bodyId1],g=b.bodiesMap[this.bodyId2];if(d&&g){var a;this.bodyPoint1&&(a=new i(this.bodyPoint1.x,this.bodyPoint1.y));a=a||d.GetWorldCenter();
var e=new k,j;j=this.axisScale?new i(this.axisScale.x,this.axisScale.y):new i(1,0);e.Initialize(d,g,a,j);this.jointAttributes&&h.mixin(e,this.jointAttributes);return b.b2World.CreateJoint(e)}}}})})},"frozen/reiner/Creature":function(){define("frozen/reiner/Creature",["dcl","dcl/bases/Mixer","dojo/_base/lang","../Sprite","../Animation"],function(b,d,h,g,i){return b([d,g],{statics:{EAST:0,NORTH:1,NORTHEAST:2,NORTHWEST:3,SOUTH:4,SOUTHEAST:5,SOUTHWEST:6,WEST:7,STATE_WALKING:0,STATE_DYING:1,STATE_IDLE:2},
state:0,walkingAnims:[],dyingAnims:[],idleAnims:[],direction:0,constructor:function(){this.state=this.statics.STATE_IDLE;this.direction=this.statics.EAST},update:function(b){this.x+=this.dx*b;this.y+=this.dy*b;if(this.state!==this.statics.STATE_DYING){if(0<this.dx&&0===this.dy)this.direction=this.statics.EAST;else if(0===this.dx&&0>this.dy)this.direction=this.statics.NORTH;else if(0<this.dx&&0>this.dy)this.direction=this.statics.NORTHEAST;else if(0>this.dx&&0>this.dy)this.direction=this.statics.NORTHWEST;
else if(0===this.dx&&0<this.dy)this.direction=this.statics.SOUTH;else if(0<this.dx&&0<this.dy)this.direction=this.statics.SOUTHEAST;else if(0>this.dx&&0<this.dy)this.direction=this.statics.SOUTHWEST;else if(0>this.dx&&0===this.dy)this.direction=this.statics.WEST;this.state=0===this.dx&&0===this.dy?this.statics.STATE_IDLE:this.statics.STATE_WALKING}this.anim=this.state===this.statics.STATE_WALKING?this.walkingAnims[this.direction]:this.state===this.statics.STATE_DYING?this.dyingAnims[this.direction]:
this.idleAnims[this.direction];this.anim.update(b)},createAnimations:function(b,c,d,g,a,e){var j=[],m=h.isArray(c),u=1;e||(e=0);for(var p=0;8>p;p++){j[p]=new i({height:g,width:a,image:d});for(var o=0;o<b;o++)u=m?c[o]:c,j[p].addFrame(u,o+b*p,e)}return j}})})},"frozen/Sprite":function(){define("frozen/Sprite",["dcl","dcl/bases/Mixer"],function(b,d){var h=b(d,{x:0,y:0,dx:0,dy:0,name:null,collisionRadius:40,update:function(b){this.x+=this.dx*b;this.y+=this.dy*b;this.anim.update(b)},getX:function(){return this.x},
getY:function(){return this.y},setX:function(b){this.x=b},setY:function(b){this.y=b},getWidth:function(){return this.anim.width},getHeight:function(){return this.anim.height},getVelocityX:function(){return this.dx},getVelocityY:function(){return this.dy},setVelocityX:function(b){this.dx=this.limitSpeed(b)},setVelocityY:function(b){this.dy=this.limitSpeed(b)},limitSpeed:function(b){return this.getMaxSpeed()?Math.abs(b)>this.getMaxSpeed()?0<b?this.getMaxSpeed():0>b?this.getMaxSpeed():0:b:b},getMaxSpeed:function(){return this.maxSpeed},
getCurrentFrame:function(){if(this.anim)return this.anim.getCurrentFrame()},drawCurrentFrame:function(b){var d=this.anim.getCurrentFrame();b.drawImage(this.anim.image,d.imgSlotX*this.anim.width,d.imgSlotY*this.anim.height,this.anim.width,this.anim.height,this.x,this.y,this.anim.width,this.anim.height)},draw:function(b){this.anim&&this.anim.draw(b,this.x,this.y)},clone:function(){return new h({anim:this.anim.clone()})}});return h})},"frozen/Animation":function(){define("frozen/Animation",["./AnimFrame",
"dcl","dcl/bases/Mixer"],function(b,d,h){var g=d(h,{currFrameIndex:0,animTime:0,totalDuration:0,height:64,width:64,image:null,offsetX:0,offsetY:0,constructor:function(){this.start()},createFromTile:function(b,d,c,f,g,a){return this.createFromSheet(b,d,c,g,f,a)},createFromSheet:function(b,d,c,f,h,a){c=new g({image:c,height:h,width:f});f=Array.isArray(d);h=1;a||(a=0);for(var e=0;e<b;e++)h=f?d[e]:d,c.addFrame(h,e,a);return c},clone:function(){return new g({image:this.image,frames:this.frames,totalDuration:this.totalDuration})},
addFrame:function(d,g,c){if(!this.frames)this.frames=[];this.totalDuration+=d;this.frames.push(new b({endTime:this.totalDuration,image:this.image,imgSlotX:g,imgSlotY:c}))},start:function(){this.currFrameIndex=this.animTime=0},update:function(b){if(1<this.frames.length){this.animTime+=b;if(this.animTime>=this.totalDuration)this.animTime%=this.totalDuration,this.currFrameIndex=0;for(;this.animTime>this.getFrame(this.currFrameIndex).endTime;)this.currFrameIndex++}},getImage:function(){return this.image},
getFrame:function(b){return this.frames[b]},getCurrentFrame:function(){return 0===this.frames.length?null:this.getFrame(this.currFrameIndex)},draw:function(b,d,c){var f=this.getCurrentFrame();b.drawImage(this.image,f.imgSlotX*this.width+this.offsetX,f.imgSlotY*this.height+this.offsetY,this.width,this.height,d,c,this.width,this.height)}});return g})},"frozen/AnimFrame":function(){define("frozen/AnimFrame",["dcl","dcl/bases/Mixer"],function(b,d){return b(d,{endTime:0,imgSlotX:0,imgSlotY:0,image:null})})},
"frozen/utils":function(){define("frozen/utils","./utils/averagePoints,./utils/degreesToRadians,./utils/radiansToDegrees,./utils/pointInPolygon,./utils/distance,./utils/degreesFromCenter,./utils/radiansFromCenter,./utils/scalePoints,./utils/translatePoints,./utils/insideCanvas".split(","),function(b,d,h,g,i,k,c,f,l,a){return{averagePoints:b,degreesToRadians:d,radiansToDegrees:h,pointInPolygon:g,distance:i,degreesFromCenter:k,radiansFromCenter:c,scalePoints:f,translatePoints:l,insideCanvas:a}})},"frozen/utils/averagePoints":function(){define("frozen/utils/averagePoints",
function(){return function(b){var d={x:0,y:0};b.forEach(function(b){d.x+=b.x;d.y+=b.y});d.x/=b.length;d.y/=b.length;return d}})},"frozen/utils/degreesToRadians":function(){define("frozen/utils/degreesToRadians",function(){var b=Math.PI/180;return function(d){return d*b}})},"frozen/utils/radiansToDegrees":function(){define("frozen/utils/radiansToDegrees",function(){var b=180/Math.PI;return function(d){return d*b}})},"frozen/utils/degreesFromCenter":function(){define("frozen/utils/degreesFromCenter",
["./radiansToDegrees","./radiansFromCenter"],function(b,d){return function(h,g){return b(d(h,g))}})},"frozen/utils/radiansFromCenter":function(){define("frozen/utils/radiansFromCenter",function(){var b={x:0,y:0};return function(d,h){d=d||b;return d.x===h.x&&d.y===h.y?0:d.x===h.x?d.y>h.y?0:Math.PI:d.y===h.y?d.x>h.x?1.5*Math.PI:Math.PI/2:d.x<h.x&&d.y>h.y?Math.atan((h.x-d.x)/(d.y-h.y)):d.x<h.x&&d.y<h.y?Math.PI/2+Math.atan((h.y-d.y)/(h.x-d.x)):d.x>h.x&&d.y<h.y?Math.PI+Math.atan((d.x-h.x)/(h.y-d.y)):1.5*
Math.PI+Math.atan((d.y-h.y)/(d.x-h.x))}})},"frozen/utils/parseString":function(){define("frozen/utils/parseString",function(){return function(b){0===b.indexOf("{")&&b.lastIndexOf("}")===b.length-1?b=JSON.parse(b.replace(/,/g,'","').replace(/:(?!\/\/)/g,'":"').replace(/\{/,'{"').replace(/\}/,'"}')):0===b.indexOf("[")&&b.lastIndexOf("]")===b.length-1&&(b=JSON.parse(b.replace(/,/g,'","').replace(/\[/g,'["').replace(/\]/g,'"]')));return b}})},"frozen/plugins/loadImage":function(){define(["../ResourceManager",
"../utils/parseString"],function(b,d){var h=new b;return{load:function(b,i,k){b=d(b);b=h.loadImage(b);k(b)}}})},"frozen/plugins/loadSound":function(){define(["../ResourceManager","../utils/parseString"],function(b,d){var h=new b;return{load:function(b,i,k){b=d(b);b=h.loadSound(b);k(b)}}})},"dojo/keys":function(){define(["./_base/kernel","./sniff"],function(b,d){return b.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:d("webkit")?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,
PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,
NUM_LOCK:144,SCROLL_LOCK:145,UP_DPAD:175,DOWN_DPAD:176,LEFT_DPAD:177,RIGHT_DPAD:178,copyKey:d("mac")&&!d("air")?d("safari")?91:224:17}})}}});(function(){require({cache:{}});require.boot&&require.apply(null,require.boot)})();