/** Cooked with Flambe, https://getflambe.com */
'use strict';(function(){function o(a,b){function c(){}c.prototype=a;var d=new c,f;for(f in b)d[f]=b[f];b.toString!==Object.prototype.toString&&(d.toString=b.toString);return d}function Rb(a){return a instanceof Array?function(){return A.iter(a)}:"function"==typeof a.iterator?la(a,a.iterator):a.iterator}function la(a,b){if(null==b)return null;null==b.__id__&&(b.__id__=ec++);var c;null==a.hx__closures__?a.hx__closures__={}:c=a.hx__closures__[b.__id__];null==c&&(c=function(){return c.method.apply(c.scope,
arguments)},c.scope=a,c.method=b,a.hx__closures__[b.__id__]=c);return c}var e={},ma=function(a,b){b=b.split("u").join("");this.r=RegExp(a,b)};e.EReg=ma;ma.__name__=["EReg"];ma.prototype={match:function(a){this.r.global&&(this.r.lastIndex=0);this.r.m=this.r.exec(a);this.r.s=a;return null!=this.r.m},__class__:ma};var A=function(){};e.HxOverrides=A;A.__name__=["HxOverrides"];A.cca=function(a,b){var c=a.charCodeAt(b);return c!=c?void 0:c};A.substr=function(a,b,c){if(null!=b&&0!=b&&null!=c&&0>c)return"";
null==c&&(c=a.length);0>b?(b=a.length+b,0>b&&(b=0)):0>c&&(c=a.length+c-b);return a.substr(b,c)};A.remove=function(a,b){var c=a.indexOf(b);if(-1==c)return!1;a.splice(c,1);return!0};A.iter=function(a){return{cur:0,arr:a,hasNext:function(){return this.cur<this.arr.length},next:function(){return this.arr[this.cur++]}}};var Oa=function(){};e.Lambda=Oa;Oa.__name__=["Lambda"];Oa.array=function(a){for(var b=[],a=Rb(a)();a.hasNext();){var c=a.next();b.push(c)}return b};Oa.count=function(a,b){var c=0;if(null==
b)for(var d=Rb(a)();d.hasNext();)d.next(),c++;else for(d=Rb(a)();d.hasNext();){var f=d.next();b(f)&&c++}return c};var wa=function(){};e.IMap=wa;wa.__name__=["IMap"];wa.prototype={__class__:wa};Math.__name__=["Math"];var S=function(){};e.Reflect=S;S.__name__=["Reflect"];S.field=function(a,b){try{return a[b]}catch(c){return null}};S.setField=function(a,b,c){a[b]=c};var T=function(){};e.Std=T;T.__name__=["Std"];T.is=function(a,b){return x.__instanceof(a,b)};T.string=function(a){return x.__string_rec(a,
"")};var fa=function(){};e.StringTools=fa;fa.__name__=["StringTools"];fa.startsWith=function(a,b){return a.length>=b.length&&A.substr(a,0,b.length)==b};fa.lpad=function(a,b,c){if(0>=b.length)return a;for(;a.length<c;)a=b+a;return a};var p=e.ValueType={__ename__:["ValueType"],__constructs__:"TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(",")};p.TNull=["TNull",0];p.TNull.__enum__=p;p.TInt=["TInt",1];p.TInt.__enum__=p;p.TFloat=["TFloat",2];p.TFloat.__enum__=p;p.TBool=["TBool",
3];p.TBool.__enum__=p;p.TObject=["TObject",4];p.TObject.__enum__=p;p.TFunction=["TFunction",5];p.TFunction.__enum__=p;p.TClass=function(a){a=["TClass",6,a];a.__enum__=p;return a};p.TEnum=function(a){a=["TEnum",7,a];a.__enum__=p;return a};p.TUnknown=["TUnknown",8];p.TUnknown.__enum__=p;var E=function(){};e.Type=E;E.__name__=["Type"];E.getClass=function(a){return null==a?null:a instanceof Array&&null==a.__enum__?Array:a.__class__};E.getClassName=function(a){return a.__name__.join(".")};E.getEnumName=
function(a){return a.__ename__.join(".")};E.resolveClass=function(a){a=e[a];return null==a||!a.__name__?null:a};E.resolveEnum=function(a){a=e[a];return null==a||!a.__ename__?null:a};E.createInstance=function(a,b){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3]);case 5:return new a(b[0],b[1],b[2],b[3],b[4]);case 6:return new a(b[0],b[1],b[2],b[3],b[4],b[5]);case 7:return new a(b[0],
b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7]);default:throw"Too many arguments";}};E["typeof"]=function(a){switch(typeof a){case "boolean":return p.TBool;case "string":return p.TClass(String);case "number":return Math.ceil(a)==a%2147483648?p.TInt:p.TFloat;case "object":if(null==a)return p.TNull;var b=a.__enum__;if(null!=b)return p.TEnum(b);a=a instanceof Array&&null==a.__enum__?Array:a.__class__;return null!=a?p.TClass(a):p.TObject;case "function":return a.__name__||
a.__ename__?p.TObject:p.TFunction;case "undefined":return p.TNull;default:return p.TUnknown}};E.enumConstructor=function(a){return a[0]};E.enumParameters=function(a){return a.slice(2)};e.XmlType={__ename__:["XmlType"],__constructs__:[]};var ba=function(){};e.Xml=ba;ba.__name__=["Xml"];var Z=function(){};e["flambe.util.Disposable"]=Z;Z.__name__=["flambe","util","Disposable"];Z.prototype={__class__:Z};var u=function(){this._flags=0;this.owner=this.next=null};e["flambe.Component"]=u;u.__name__=["flambe",
"Component"];u.__interfaces__=[Z];u.prototype={onAdded:function(){},onRemoved:function(){},onStart:function(){},onStop:function(){},onUpdate:function(){},dispose:function(){null!=this.owner&&this.owner.remove(this)},get_name:function(){return null},__class__:u};var G=function(){this.parent=this.firstChild=this.next=this.firstComponent=null;this._compMap={}};e["flambe.Entity"]=G;G.__name__=["flambe","Entity"];G.__interfaces__=[Z];G.prototype={add:function(a){null!=a.owner&&a.owner.remove(a);var b=
a.get_name(),c=this._compMap[b];null!=c&&this.remove(c);this._compMap[b]=a;b=null;for(c=this.firstComponent;null!=c;)b=c,c=c.next;null!=b?b.next=a:this.firstComponent=a;a.owner=this;a.next=null;a.onAdded();return this},remove:function(a){for(var b=null,c=this.firstComponent;null!=c;){var d=c.next;if(c==a)return null==b?this.firstComponent=d:(b.owner=this,b.next=d),delete this._compMap[c.get_name()],0!=(c._flags&1)&&(c.onStop(),c._flags&=-2),c.onRemoved(),c.owner=null,c.next=null,!0;b=c;c=d}return!1},
addChild:function(a,b){null==b&&(b=!0);null!=a.parent&&a.parent.removeChild(a);a.parent=this;if(b){for(var c=null,d=this.firstChild;null!=d;)c=d,d=d.next;null!=c?c.next=a:this.firstChild=a}else a.next=this.firstChild,this.firstChild=a;return this},removeChild:function(a){for(var b=null,c=this.firstChild;null!=c;){var d=c.next;if(c==a){null==b?this.firstChild=d:b.next=d;c.parent=null;c.next=null;break}b=c;c=d}},disposeChildren:function(){for(;null!=this.firstChild;)this.firstChild.dispose()},dispose:function(){for(null!=
this.parent&&this.parent.removeChild(this);null!=this.firstComponent;)this.firstComponent.dispose();this.disposeChildren()},__class__:G};var Sb=function(){};e["flambe.util.PackageLog"]=Sb;Sb.__name__=["flambe","util","PackageLog"];var vb=function(){};e["flambe.platform.Platform"]=vb;vb.__name__=["flambe","platform","Platform"];vb.prototype={__class__:vb};var ca=function(){};e["flambe.platform.html.HtmlPlatform"]=ca;ca.__name__=["flambe","platform","html","HtmlPlatform"];ca.__interfaces__=[vb];ca.prototype=
{init:function(){var a=this;m.fixAndroidMath();var b=null;try{b=window.flambe.canvas}catch(c){}b.setAttribute("tabindex","0");b.style.outlineStyle="none";b.style.webkitTapHighlightColor="transparent";b.setAttribute("moz-opaque","true");this._stage=new na(b);this._pointer=new F;this._mouse=new Pa(this._pointer,b);this._renderer=this.createRenderer(b);this.mainLoop=new oa;this.musicPlaying=!1;this._canvas=b;this._container=b.parentElement;this._container.style.overflow="hidden";this._container.style.position=
"relative";this._container.style.msTouchAction="none";var d=0,f=function(c){if(!(1E3>c.timeStamp-d)){var f=b.getBoundingClientRect(),h=a.getX(c,f),f=a.getY(c,f);switch(c.type){case "mousedown":c.target==b&&(c.preventDefault(),a._mouse.submitDown(h,f,c.button),b.focus());break;case "mousemove":a._mouse.submitMove(h,f);break;case "mouseup":a._mouse.submitUp(h,f,c.button);break;case "mousewheel":case "DOMMouseScroll":a._mouse.submitScroll(h,f,"mousewheel"==c.type?c.wheelDelta/40:-c.detail)&&c.preventDefault()}}};
window.addEventListener("mousedown",f,!1);window.addEventListener("mousemove",f,!1);window.addEventListener("mouseup",f,!1);b.addEventListener("mousewheel",f,!1);b.addEventListener("DOMMouseScroll",f,!1);b.addEventListener("contextmenu",function(a){a.preventDefault()},!1);var h="undefined"!=typeof window.ontouchstart,f="msMaxTouchPoints"in window.navigator&&1<window.navigator.msMaxTouchPoints;if(h||f){var e=new Qa(this._pointer,h?4:window.navigator.msMaxTouchPoints);this._touch=e;f=function(b){var c;
c=h?b.changedTouches:[b];var f=b.target.getBoundingClientRect();d=b.timeStamp;switch(b.type){case "touchstart":case "MSPointerDown":case "pointerdown":b.preventDefault();m.SHOULD_HIDE_MOBILE_BROWSER&&m.hideMobileBrowser();for(b=0;b<c.length;){var g=c[b];++b;var i=a.getX(g,f),wb=a.getY(g,f);e.submitDown((h?g.identifier:g.pointerId)|0,i,wb)}break;case "touchmove":case "MSPointerMove":case "pointermove":b.preventDefault();for(b=0;b<c.length;)g=c[b],++b,i=a.getX(g,f),wb=a.getY(g,f),e.submitMove((h?g.identifier:
g.pointerId)|0,i,wb);break;case "touchend":case "touchcancel":case "MSPointerUp":case "pointerup":for(b=0;b<c.length;)g=c[b],++b,i=a.getX(g,f),wb=a.getY(g,f),e.submitUp((h?g.identifier:g.pointerId)|0,i,wb)}};h?(b.addEventListener("touchstart",f,!1),b.addEventListener("touchmove",f,!1),b.addEventListener("touchend",f,!1),b.addEventListener("touchcancel",f,!1)):(b.addEventListener("MSPointerDown",f,!1),b.addEventListener("MSPointerMove",f,!1),b.addEventListener("MSPointerUp",f,!1))}else this._touch=
new Ra;var g=window.onerror;window.onerror=function(a,b,c){j.uncaughtError.emit(a);return null!=g?g(a,b,c):!1};var i=m.loadExtension("hidden",window.document);null!=i.value?(f=function(){j.hidden.set__(S.field(window.document,i.field))},f(null),window.document.addEventListener(i.prefix+"visibilitychange",f,!1)):(f=function(a){j.hidden.set__("pagehide"==a.type)},window.addEventListener("pageshow",f,!1),window.addEventListener("pagehide",f,!1));j.hidden.get_changed().connect(function(b){b||(a._skipFrame=
!0)});this._skipFrame=!1;this._lastUpdate=Date.now();var k=m.loadExtension("requestAnimationFrame").value;if(null!=k){var l=window.performance,n=null!=l&&m.polyfill("now",l);n?this._lastUpdate=l.now():null;var o=null,o=function(c){a.update(n?l.now():c);k(o,b)};k(o,b)}else window.setInterval(function(){a.update(Date.now())},16);xa.info("Initialized HTML platform",["renderer",this._renderer.get_type()])},loadAssetPack:function(a){return(new r(this,a)).promise},getStage:function(){return this._stage},
update:function(a){var b=(a-this._lastUpdate)/1E3;this._lastUpdate=a;j.hidden._value||(this._skipFrame?this._skipFrame=!1:(this.mainLoop.update(b),this.mainLoop.render(this._renderer)))},getPointer:function(){return this._pointer},getMouse:function(){return this._mouse},getRenderer:function(){return this._renderer},getX:function(a,b){return(a.clientX-b.left)*this._stage.get_width()/b.width},getY:function(a,b){return(a.clientY-b.top)*this._stage.get_height()/b.height},createRenderer:function(a){try{var b=
Tb.getContextWebGL(a,{alpha:!1,depth:!1,failIfMajorPerformanceCaveat:!0});if(null!=b)if(m.detectSlowDriver(b))null;else return new Sa(this._stage,b)}catch(c){}return new pa(a)},__class__:ca};var H=function(a,b){this._value=a;this._changed=null!=b?new ya(b):null};e["flambe.util.Value"]=H;H.__name__=["flambe","util","Value"];H.prototype={watch:function(a){a(this._value,this._value);return this.get_changed().connect(a)},set__:function(a){var b=this._value;a!=b&&(this._value=a,null!=this._changed&&this._changed.emit(a,
b));return a},get_changed:function(){null==this._changed&&(this._changed=new ya);return this._changed},__class__:H};var qa=function(a,b){this._next=null;this._signal=a;this._listener=b;this.stayInList=!0};e["flambe.util.SignalConnection"]=qa;qa.__name__=["flambe","util","SignalConnection"];qa.__interfaces__=[Z];qa.prototype={once:function(){this.stayInList=!1;return this},dispose:function(){null!=this._signal&&(this._signal.disconnect(this),this._signal=null)},__class__:qa};var y=function(a){this._head=
null!=a?new qa(this,a):null;this._deferredTasks=null};e["flambe.util.SignalBase"]=y;y.__name__=["flambe","util","SignalBase"];y.prototype={connectImpl:function(a,b){var c=this,d=new qa(this,a);this._head==y.DISPATCHING_SENTINEL?this.defer(function(){c.listAdd(d,b)}):this.listAdd(d,b);return d},disconnect:function(a){var b=this;this._head==y.DISPATCHING_SENTINEL?this.defer(function(){b.listRemove(a)}):this.listRemove(a)},defer:function(a){for(var b=null,c=this._deferredTasks;null!=c;)b=c,c=c.next;
a=new xb(a);null!=b?b.next=a:this._deferredTasks=a},willEmit:function(){var a=this._head;this._head=y.DISPATCHING_SENTINEL;return a},didEmit:function(a){this._head=a;a=this._deferredTasks;for(this._deferredTasks=null;null!=a;)a.fn(),a=a.next},listAdd:function(a,b){if(b)a._next=this._head,this._head=a;else{for(var c=null,d=this._head;null!=d;)c=d,d=d._next;null!=c?c._next=a:this._head=a}},listRemove:function(a){for(var b=null,c=this._head;null!=c;){if(c==a){a=c._next;null==b?this._head=a:b._next=a;
break}b=c;c=c._next}},__class__:y};var ya=function(a){y.call(this,a)};e["flambe.util.Signal2"]=ya;ya.__name__=["flambe","util","Signal2"];ya.__super__=y;ya.prototype=o(y.prototype,{connect:function(a,b){null==b&&(b=!1);return this.connectImpl(a,b)},emit:function(a,b){var c=this;this._head==y.DISPATCHING_SENTINEL?this.defer(function(){c.emitImpl(a,b)}):this.emitImpl(a,b)},emitImpl:function(a,b){for(var c=this.willEmit(),d=c;null!=d;)d._listener(a,b),d.stayInList||d.dispose(),d=d._next;this.didEmit(c)},
__class__:ya});var l=function(a){y.call(this,a)};e["flambe.util.Signal1"]=l;l.__name__=["flambe","util","Signal1"];l.__super__=y;l.prototype=o(y.prototype,{connect:function(a,b){null==b&&(b=!1);return this.connectImpl(a,b)},emit:function(a){var b=this;this._head==y.DISPATCHING_SENTINEL?this.defer(function(){b.emitImpl(a)}):this.emitImpl(a)},emitImpl:function(a){for(var b=this.willEmit(),c=b;null!=c;)c._listener(a),c.stayInList||c.dispose(),c=c._next;this.didEmit(b)},__class__:l});var B=function(a,
b){this._behavior=null;H.call(this,a,b)};e["flambe.animation.AnimatedFloat"]=B;B.__name__=["flambe","animation","AnimatedFloat"];B.__super__=H;B.prototype=o(H.prototype,{set__:function(a){this._behavior=null;return H.prototype.set__.call(this,a)},update:function(a){null!=this._behavior&&(H.prototype.set__.call(this,this._behavior.update(a)),this._behavior.isComplete()&&(this._behavior=null))},animateTo:function(a,b,c){this.set_behavior(new Ta(this._value,a,b,c))},set_behavior:function(a){this._behavior=
a;this.update(0);return a},__class__:B});var j=function(){};e["flambe.System"]=j;j.__name__=["flambe","System"];j.init=function(){j._calledInit||(j._platform.init(),j._calledInit=!0)};j.loadAssetPack=function(a){return j._platform.loadAssetPack(a)};var xa=function(){};e["flambe.Log"]=xa;xa.__name__=["flambe","Log"];xa.info=function(){null};xa.__super__=Sb;xa.prototype=o(Sb.prototype,{__class__:xa});var yb=function(){this._realDt=0};e["flambe.SpeedAdjuster"]=yb;yb.__name__=["flambe","SpeedAdjuster"];
yb.__super__=u;yb.prototype=o(u.prototype,{get_name:function(){return"SpeedAdjuster_6"},onUpdate:function(a){0<this._realDt&&(a=this._realDt,this._realDt=0);this.scale.update(a)},__class__:yb});var zb=function(){};e["flambe.animation.Behavior"]=zb;zb.__name__=["flambe","animation","Behavior"];zb.prototype={__class__:zb};var v=function(){};e["flambe.animation.Ease"]=v;v.__name__=["flambe","animation","Ease"];v.linear=function(a){return a};v.quintOut=function(a){return(a-=1)*a*a*a*a+1};v.quintInOut=
function(a){return 1>(a*=2)?a*a*a*a*a/2:((a-=2)*a*a*a*a+2)/2};var Ta=function(a,b,c,d){this._from=a;this._to=b;this._duration=c;this.elapsed=0;this._easing=null!=d?d:v.linear};e["flambe.animation.Tween"]=Ta;Ta.__name__=["flambe","animation","Tween"];Ta.__interfaces__=[zb];Ta.prototype={update:function(a){this.elapsed+=a;return this.elapsed>=this._duration?this._to:this._from+(this._to-this._from)*this._easing(this.elapsed/this._duration)},isComplete:function(){return this.elapsed>=this._duration},
__class__:Ta};var ga=function(){};e["flambe.asset.Asset"]=ga;ga.__name__=["flambe","asset","Asset"];ga.__interfaces__=[Z];ga.prototype={__class__:ga};var i=e["flambe.asset.AssetFormat"]={__ename__:["flambe","asset","AssetFormat"],__constructs__:"WEBP,JXR,PNG,JPG,GIF,DDS,PVR,PKM,MP3,M4A,OPUS,OGG,WAV,Data".split(",")};i.WEBP=["WEBP",0];i.WEBP.__enum__=i;i.JXR=["JXR",1];i.JXR.__enum__=i;i.PNG=["PNG",2];i.PNG.__enum__=i;i.JPG=["JPG",3];i.JPG.__enum__=i;i.GIF=["GIF",4];i.GIF.__enum__=i;i.DDS=["DDS",5];
i.DDS.__enum__=i;i.PVR=["PVR",6];i.PVR.__enum__=i;i.PKM=["PKM",7];i.PKM.__enum__=i;i.MP3=["MP3",8];i.MP3.__enum__=i;i.M4A=["M4A",9];i.M4A.__enum__=i;i.OPUS=["OPUS",10];i.OPUS.__enum__=i;i.OGG=["OGG",11];i.OGG.__enum__=i;i.WAV=["WAV",12];i.WAV.__enum__=i;i.Data=["Data",13];i.Data.__enum__=i;var Ab=function(a,b,c,d){this.name=a;this.url=b;this.format=c;this.bytes=d};e["flambe.asset.AssetEntry"]=Ab;Ab.__name__=["flambe","asset","AssetEntry"];Ab.prototype={__class__:Ab};var Ua=function(){};e["flambe.asset.AssetPack"]=
Ua;Ua.__name__=["flambe","asset","AssetPack"];Ua.__interfaces__=[Z];Ua.prototype={__class__:Ua};var Va=function(){};e["flambe.asset.File"]=Va;Va.__name__=["flambe","asset","File"];Va.__interfaces__=[ga];Va.prototype={__class__:Va};var J=function(){this._localBase=this._remoteBase=null;this._entries=[]};e["flambe.asset.Manifest"]=J;J.__name__=["flambe","asset","Manifest"];J.fromAssets=function(a,b){null==b&&(b=!0);var c=S.field(Ub.getType(J).assets[0],a);if(null==c){if(b)throw K.withFields("Missing asset pack",
["name",a]);return null}var d=new J;d.set_localBase("assets");for(var f=0;f<c.length;){var h=c[f];++f;var e=h.name,g=a+"/"+e+"?v="+T.string(h.md5),j=J.inferFormat(e);j!=i.Data&&(e=K.removeFileExtension(e));d.add(e,g,h.bytes,j)}return d};J.inferFormat=function(a){a=K.getUrlExtension(a);if(null!=a)switch(a.toLowerCase()){case "gif":return i.GIF;case "jpg":case "jpeg":return i.JPG;case "jxr":case "wdp":return i.JXR;case "png":return i.PNG;case "webp":return i.WEBP;case "dds":return i.DDS;case "pvr":return i.PVR;
case "pkm":return i.PKM;case "m4a":return i.M4A;case "mp3":return i.MP3;case "ogg":return i.OGG;case "opus":return i.OPUS;case "wav":return i.WAV}else null;return i.Data};J.prototype={add:function(a,b,c,d){null==c&&(c=0);null==d&&(d=J.inferFormat(b));a=new Ab(a,b,d,c);this._entries.push(a);return a},iterator:function(){return A.iter(this._entries)},getFullURL:function(a){var b;b=null!=this.get_remoteBase()&&J._supportsCrossOrigin?this.get_remoteBase():this.get_localBase();return null!=b?K.joinPath(b,
a.url):a.url},get_localBase:function(){return this._localBase},set_localBase:function(a){null!=a&&Vb.that(!fa.startsWith(a,"http://")&&!fa.startsWith(a,"https://"),"localBase must be a path on the same domain, NOT starting with http(s)://",null);return this._localBase=a},get_remoteBase:function(){return this._remoteBase},__class__:J};var C=e["flambe.display.BlendMode"]={__ename__:["flambe","display","BlendMode"],__constructs__:"Normal,Add,Multiply,Screen,Mask,Copy".split(",")};C.Normal=["Normal",
0];C.Normal.__enum__=C;C.Add=["Add",1];C.Add.__enum__=C;C.Multiply=["Multiply",2];C.Multiply.__enum__=C;C.Screen=["Screen",3];C.Screen.__enum__=C;C.Mask=["Mask",4];C.Mask.__enum__=C;C.Copy=["Copy",5];C.Copy.__enum__=C;var za=function(a,b){null==b&&(b=0);null==a&&(a=0);this.x=a;this.y=b};e["flambe.math.Point"]=za;za.__name__=["flambe","math","Point"];za.prototype={__class__:za};var k=function(){this.blendMode=this.scissor=null;var a=this;u.call(this);this._flags|=54;this._localMatrix=new U;var b=function(){a._flags|=
24};this.x=new B(0,b);this.y=new B(0,b);this.rotation=new B(0,b);this.scaleX=new B(1,b);this.scaleY=new B(1,b);this.anchorX=new B(0,b);this.anchorY=new B(0,b);this.alpha=new B(1)};e["flambe.display.Sprite"]=k;k.__name__=["flambe","display","Sprite"];k.hitTest=function(a,b,c){var d=a._compMap.Sprite_4;if(null!=d){if(6!=(d._flags&6))return null;d.getLocalMatrix().inverseTransform(b,c,k._scratchPoint)&&(b=k._scratchPoint.x,c=k._scratchPoint.y);var f=d.scissor;if(null!=f&&!f.contains(b,c))return null}a=
k.hitTestBackwards(a.firstChild,b,c);return null!=a?a:null!=d&&d.containsLocal(b,c)?d:null};k.getBounds=function(a,b){null==b&&(b=new Aa);b.set(1.79769313486231E308,1.79769313486231E308,-1.79769313486231E308,-1.79769313486231E308);k.getBoundsImpl(a,null,b);b.width-=b.x;b.height-=b.y;return b};k.render=function(a,b){var c=a._compMap.Sprite_4;if(null!=c){var d=c.alpha._value;if(0==(c._flags&2)||0>=d)return;b.save();1>d&&b.multiplyAlpha(d);null!=c.blendMode&&b.setBlendMode(c.blendMode);var d=c.getLocalMatrix(),
f=d.m02,h=d.m12;0!=(c._flags&32)&&(f=Math.round(f),h=Math.round(h));b.transform(d.m00,d.m10,d.m01,d.m11,f,h);d=c.scissor;null!=d&&b.applyScissor(d.x,d.y,d.width,d.height);c.draw(b)}d=a._compMap.Director_5;if(null!=d){d=d.occludedScenes;for(f=0;f<d.length;)h=d[f],++f,k.render(h,b)}for(d=a.firstChild;null!=d;)f=d.next,k.render(d,b),d=f;null!=c&&b.restore()};k.hitTestBackwards=function(a,b,c){if(null!=a){var d=k.hitTestBackwards(a.next,b,c);return null!=d?d:k.hitTest(a,b,c)}return null};k.getBoundsImpl=
function(a,b,c){var d=a._compMap.Sprite_4;if(null!=d){var b=null!=b?U.multiply(b,d.getLocalMatrix()):d.getLocalMatrix(),f=d.getNaturalWidth(),d=d.getNaturalHeight();0<f&&0<d&&(k.extendRect(b,0,0,c),k.extendRect(b,f,0,c),k.extendRect(b,f,d,c),k.extendRect(b,0,d,c))}f=a._compMap.Director_5;if(null!=f)for(var f=f.occludedScenes,d=0,h=f.length;d<h;)k.getBoundsImpl(f[d],b,c),++d;for(a=a.firstChild;null!=a;)f=a.next,k.getBoundsImpl(a,b,c),a=f};k.extendRect=function(a,b,c,d){a=a.transform(b,c,k._scratchPoint);
b=a.x;c=a.y;b<d.x&&(d.x=b);c<d.y&&(d.y=c);b>d.width&&(d.width=b);c>d.height&&(d.height=c)};k.__super__=u;k.prototype=o(u.prototype,{get_name:function(){return"Sprite_4"},getNaturalWidth:function(){return 0},getNaturalHeight:function(){return 0},containsLocal:function(a,b){return 0<=a&&a<this.getNaturalWidth()&&0<=b&&b<this.getNaturalHeight()},getLocalMatrix:function(){0!=(this._flags&8)&&(this._flags&=-9,this._localMatrix.compose(this.x._value,this.y._value,this.scaleX._value,this.scaleY._value,3.141592653589793*
this.rotation._value/180),this._localMatrix.translate(-this.anchorX._value,-this.anchorY._value));return this._localMatrix},setXY:function(a,b){this.x.set__(a);this.y.set__(b);return this},setScaleXY:function(a,b){this.scaleX.set__(a);this.scaleY.set__(b);return this},onAdded:function(){0!=(this._flags&64)&&this.connectHover()},onRemoved:function(){null!=this._hoverConnection&&(this._hoverConnection.dispose(),this._hoverConnection=null)},onUpdate:function(a){this.x.update(a);this.y.update(a);this.rotation.update(a);
this.scaleX.update(a);this.scaleY.update(a);this.alpha.update(a);this.anchorX.update(a);this.anchorY.update(a)},draw:function(){},getParentSprite:function(){if(null==this.owner)return null;for(var a=this.owner.parent;null!=a;){var b=a._compMap.Sprite_4;if(null!=b)return b;a=a.parent}return null},get_pointerDown:function(){null==this._pointerDown&&(this._pointerDown=new l);return this._pointerDown},get_pointerMove:function(){null==this._pointerMove&&(this._pointerMove=new l);return this._pointerMove},
get_pointerIn:function(){null==this._pointerIn&&(this._pointerIn=new l);return this._pointerIn},get_pointerOut:function(){null==this._pointerOut&&(this._pointerOut=new l);return this._pointerOut},connectHover:function(){var a=this;null==this._hoverConnection&&(this._hoverConnection=j._platform.getPointer().move.connect(function(b){for(var c=b.hit;null!=c;){if(c==a)return;c=c.getParentSprite()}null!=a._pointerOut&&0!=(a._flags&64)&&a._pointerOut.emit(b);a._flags&=-65;a._hoverConnection.dispose();a._hoverConnection=
null}))},onPointerDown:function(a){this.onHover(a);null!=this._pointerDown&&this._pointerDown.emit(a)},onPointerMove:function(a){this.onHover(a);null!=this._pointerMove&&this._pointerMove.emit(a)},onHover:function(a){if(0==(this._flags&64)&&(this._flags|=64,null!=this._pointerIn||null!=this._pointerOut))null!=this._pointerIn&&this._pointerIn.emit(a),this.connectHover()},onPointerUp:function(a){switch(a.source[1]){case 1:null!=this._pointerOut&&0!=(this._flags&64)&&this._pointerOut.emit(a),this._flags&=
-65,null!=this._hoverConnection&&(this._hoverConnection.dispose(),this._hoverConnection=null)}null!=this._pointerUp&&this._pointerUp.emit(a)},__class__:k});var Wa=function(a,b,c){k.call(this);this.color=a;this.width=new B(b);this.height=new B(c)};e["flambe.display.FillSprite"]=Wa;Wa.__name__=["flambe","display","FillSprite"];Wa.__super__=k;Wa.prototype=o(k.prototype,{draw:function(a){a.fillRect(this.color,0,0,this.width._value,this.height._value)},getNaturalWidth:function(){return this.width._value},
getNaturalHeight:function(){return this.height._value},onUpdate:function(a){k.prototype.onUpdate.call(this,a);this.width.update(a);this.height.update(a)},__class__:Wa});var Bb=function(){};e["flambe.display.Graphics"]=Bb;Bb.__name__=["flambe","display","Graphics"];Bb.prototype={__class__:Bb};var X=function(a){k.call(this);this.texture=a};e["flambe.display.ImageSprite"]=X;X.__name__=["flambe","display","ImageSprite"];X.__super__=k;X.prototype=o(k.prototype,{draw:function(a){null!=this.texture&&a.drawTexture(this.texture,
0,0)},getNaturalWidth:function(){return null!=this.texture?this.texture.get_width():0},getNaturalHeight:function(){return null!=this.texture?this.texture.get_height():0},__class__:X});var ra=e["flambe.display.Orientation"]={__ename__:["flambe","display","Orientation"],__constructs__:["Portrait","Landscape"]};ra.Portrait=["Portrait",0];ra.Portrait.__enum__=ra;ra.Landscape=["Landscape",1];ra.Landscape.__enum__=ra;var Xa=function(){};e["flambe.display.Texture"]=Xa;Xa.__name__=["flambe","display","Texture"];
Xa.__interfaces__=[ga];Xa.prototype={__class__:Xa};var Wb=function(){};e["flambe.display.SubTexture"]=Wb;Wb.__name__=["flambe","display","SubTexture"];Wb.__interfaces__=[Xa];var N=e["flambe.input.MouseButton"]={__ename__:["flambe","input","MouseButton"],__constructs__:["Left","Middle","Right","Unknown"]};N.Left=["Left",0];N.Left.__enum__=N;N.Middle=["Middle",1];N.Middle.__enum__=N;N.Right=["Right",2];N.Right.__enum__=N;N.Unknown=function(a){a=["Unknown",3,a];a.__enum__=N;return a};var O=e["flambe.input.MouseCursor"]=
{__ename__:["flambe","input","MouseCursor"],__constructs__:["Default","Button","None"]};O.Default=["Default",0];O.Default.__enum__=O;O.Button=["Button",1];O.Button.__enum__=O;O.None=["None",2];O.None.__enum__=O;var Cb=function(){this.init(0,0,0,null)};e["flambe.input.MouseEvent"]=Cb;Cb.__name__=["flambe","input","MouseEvent"];Cb.prototype={init:function(a,b,c,d){this.id=a;this.viewX=b;this.viewY=c;this.button=d},__class__:Cb};var Ya=e["flambe.input.EventSource"]={__ename__:["flambe","input","EventSource"],
__constructs__:["Mouse","Touch"]};Ya.Mouse=function(a){a=["Mouse",0,a];a.__enum__=Ya;return a};Ya.Touch=function(a){a=["Touch",1,a];a.__enum__=Ya;return a};var Db=function(){this.init(0,0,0,null,null)};e["flambe.input.PointerEvent"]=Db;Db.__name__=["flambe","input","PointerEvent"];Db.prototype={init:function(a,b,c,d,f){this.id=a;this.viewX=b;this.viewY=c;this.hit=d;this.source=f;this._stopped=!1},__class__:Db};var Eb=function(a){this.id=a;this._source=Ya.Touch(this)};e["flambe.input.TouchPoint"]=
Eb;Eb.__name__=["flambe","input","TouchPoint"];Eb.prototype={init:function(a,b){this.viewX=a;this.viewY=b},__class__:Eb};var da=function(){};e["flambe.math.FMath"]=da;da.__name__=["flambe","math","FMath"];da.max=function(a,b){return a>b?a:b};da.min=function(a,b){return a<b?a:b};var U=function(){this.identity()};e["flambe.math.Matrix"]=U;U.__name__=["flambe","math","Matrix"];U.multiply=function(a,b,c){null==c&&(c=new U);var d=a.m00*b.m00+a.m01*b.m10,f=a.m00*b.m01+a.m01*b.m11,h=a.m00*b.m02+a.m01*b.m12+
a.m02;c.m00=d;c.m01=f;c.m02=h;d=a.m10*b.m00+a.m11*b.m10;f=a.m10*b.m01+a.m11*b.m11;h=a.m10*b.m02+a.m11*b.m12+a.m12;c.m10=d;c.m11=f;c.m12=h;return c};U.prototype={set:function(a,b,c,d,f,h){this.m00=a;this.m01=c;this.m02=f;this.m10=b;this.m11=d;this.m12=h},identity:function(){this.set(1,0,0,1,0,0)},compose:function(a,b,c,d,f){var h=Math.sin(f),f=Math.cos(f);this.set(f*c,h*c,-h*d,f*d,a,b)},translate:function(a,b){this.m02+=this.m00*a+this.m01*b;this.m12+=this.m11*b+this.m10*a},invert:function(){var a=
this.determinant();if(0==a)return!1;this.set(this.m11/a,-this.m01/a,-this.m10/a,this.m00/a,(this.m01*this.m12-this.m11*this.m02)/a,(this.m10*this.m02-this.m00*this.m12)/a);return!0},transform:function(a,b,c){null==c&&(c=new za);c.x=a*this.m00+b*this.m01+this.m02;c.y=a*this.m10+b*this.m11+this.m12;return c},transformArray:function(a,b,c){for(var d=0;d<b;){var f=a[d],h=a[d+1];c[d++]=f*this.m00+h*this.m01+this.m02;c[d++]=f*this.m10+h*this.m11+this.m12}},determinant:function(){return this.m00*this.m11-
this.m01*this.m10},inverseTransform:function(a,b,c){var d=this.determinant();if(0==d)return!1;a-=this.m02;b-=this.m12;c.x=(a*this.m11-b*this.m01)/d;c.y=(b*this.m00-a*this.m10)/d;return!0},clone:function(a){null==a&&(a=new U);a.set(this.m00,this.m10,this.m01,this.m11,this.m02,this.m12);return a},__class__:U};var Aa=function(a,b,c,d){null==d&&(d=0);null==c&&(c=0);null==b&&(b=0);null==a&&(a=0);this.set(a,b,c,d)};e["flambe.math.Rectangle"]=Aa;Aa.__name__=["flambe","math","Rectangle"];Aa.prototype={set:function(a,
b,c,d){this.x=a;this.y=b;this.width=c;this.height=d},contains:function(a,b){a-=this.x;if(0<=this.width){if(0>a||a>this.width)return!1}else if(0<a||a<this.width)return!1;b-=this.y;if(0<=this.height){if(0>b||b>this.height)return!1}else if(0<b||b<this.height)return!1;return!0},clone:function(a){null==a&&(a=new Aa);a.set(this.x,this.y,this.width,this.height);return a},equals:function(a){return this.x==a.x&&this.y==a.y&&this.width==a.width&&this.height==a.height},__class__:Aa};var D=function(){this._disposed=
!1};e["flambe.platform.BasicAsset"]=D;D.__name__=["flambe","platform","BasicAsset"];D.__interfaces__=[ga];D.prototype={dispose:function(){this._disposed||(this._disposed=!0,this.onDisposed())},onDisposed:function(){null},__class__:D};var ha=function(a,b){var c=this;this.manifest=b;this._platform=a;this.promise=new Za;this._bytesLoaded=new V;this._pack=new $a(b,this);var d=Oa.array(b);if(0==d.length)this.handleSuccess();else{for(var f=new V,h=0;h<d.length;){var e=d[h];++h;var g=f.get(e.name);null==
g&&(g=[],f.set(e.name,g));g.push(e)}this._assetsRemaining=Oa.count(f);for(d=f.iterator();d.hasNext();)f=[d.next()],this.pickBestEntry(f[0],function(a){return function(d){if(null!=d){var f=b.getFullURL(d);try{c.loadEntry(f,d)}catch(h){c.handleError(d,"Unexpected error: "+T.string(h))}f=c.promise;f.set_total(f._total+d.bytes)}else d=a[0][0],ha.isAudio(d.format)?c.handleLoad(d,P.getInstance()):c.handleError(d,"Could not find a supported format to load")}}(f))}};e["flambe.platform.BasicAssetPackLoader"]=
ha;ha.__name__=["flambe","platform","BasicAssetPackLoader"];ha.isAudio=function(a){switch(a[1]){case 8:case 9:case 10:case 11:case 12:return!0;default:return!1}};ha.prototype={onDisposed:function(){},pickBestEntry:function(a,b){this.getAssetFormats(function(c){for(var d=0;d<c.length;){var f=c[d];++d;for(var h=0;h<a.length;){var e=a[h];++h;if(e.format==f){b(e);return}}}b(null)})},loadEntry:function(){null},getAssetFormats:function(){null},handleLoad:function(a,b){if(!this._pack.disposed){this.handleProgress(a,
a.bytes);var c;switch(a.format[1]){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c=this._pack.textures;break;case 8:case 9:case 10:case 11:case 12:c=this._pack.sounds;break;case 13:c=this._pack.files}c.set(a.name,b);this._assetsRemaining-=1;0==this._assetsRemaining&&this.handleSuccess()}},handleProgress:function(a,b){this._bytesLoaded.set(a.name,b);for(var c=0,d=this._bytesLoaded.iterator();d.hasNext();)var f=d.next(),c=c+f;this.promise.set_progress(c)},handleSuccess:function(){this.promise.set_result(this._pack)},
handleError:function(a,b){this.promise.error.emit(K.withFields(b,["url",a.url]))},handleTextureError:function(a){this.handleError(a,"Failed to create texture. Is the GPU context unavailable?")},__class__:ha};var $a=function(a,b){this.disposed=!1;this._manifest=a;this.loader=b;this.textures=new V;this.sounds=new V;this.files=new V};e["flambe.platform._BasicAssetPackLoader.BasicAssetPack"]=$a;$a.__name__=["flambe","platform","_BasicAssetPackLoader","BasicAssetPack"];$a.__interfaces__=[Ua];$a.prototype=
{getTexture:function(a,b){null==b&&(b=!0);var c=this.textures.get(a);if(null==c&&b)throw K.withFields("Missing texture",["name",a]);return c},getSound:function(a,b){null==b&&(b=!0);var c=this.sounds.get(a);if(null==c&&b)throw K.withFields("Missing sound",["name",a]);return c},getFile:function(a,b){null==b&&(b=!0);var c=this.files.get(a);if(null==c&&b)throw K.withFields("Missing file",["name",a]);return c},dispose:function(){if(!this.disposed){this.disposed=!0;for(var a=this.textures.iterator();a.hasNext();)a.next().dispose();
this.textures=null;for(a=this.sounds.iterator();a.hasNext();)a.next().dispose();this.sounds=null;for(a=this.files.iterator();a.hasNext();)a.next().dispose();this.files=null;this.loader.onDisposed()}},__class__:$a};var Ba=function(a){this._disposed=!1;this._content=a};e["flambe.platform.BasicFile"]=Ba;Ba.__name__=["flambe","platform","BasicFile"];Ba.__interfaces__=[Va];Ba.__super__=D;Ba.prototype=o(D.prototype,{toString:function(){return this._content},onDisposed:function(){this._content=null},__class__:Ba});
var Fb=function(){};e["flambe.subsystem.MouseSystem"]=Fb;Fb.__name__=["flambe","subsystem","MouseSystem"];Fb.prototype={__class__:Fb};var L=function(a){this._pointer=a;this._source=Ya.Mouse(L._sharedEvent);this.down=new l;this.move=new l;this.up=new l;this.scroll=new l;this._y=this._x=0;this._cursor=O.Default;this._buttonStates=new sa};e["flambe.platform.BasicMouse"]=L;L.__name__=["flambe","platform","BasicMouse"];L.__interfaces__=[Fb];L.prototype={set_cursor:function(a){return this._cursor=a},submitDown:function(a,
b,c){this._buttonStates.exists(c)||(this._buttonStates.set(c,!0),this.prepare(a,b,Gb.toButton(c)),this._pointer.submitDown(a,b,this._source),this.down.emit(L._sharedEvent))},submitMove:function(a,b){this.prepare(a,b,null);this._pointer.submitMove(a,b,this._source);this.move.emit(L._sharedEvent)},submitUp:function(a,b,c){this._buttonStates.exists(c)&&(this._buttonStates.remove(c),this.prepare(a,b,Gb.toButton(c)),this._pointer.submitUp(a,b,this._source),this.up.emit(L._sharedEvent))},submitScroll:function(a,
b,c){this._x=a;this._y=b;if(null==this.scroll._head)return!1;this.scroll.emit(c);return!0},prepare:function(a,b,c){this._x=a;this._y=b;L._sharedEvent.init(L._sharedEvent.id+1,a,b,c)},__class__:L};var Hb=function(){};e["flambe.subsystem.PointerSystem"]=Hb;Hb.__name__=["flambe","subsystem","PointerSystem"];Hb.prototype={__class__:Hb};var F=function(a,b,c){null==c&&(c=!1);null==b&&(b=0);null==a&&(a=0);this.down=new l;this.move=new l;this.up=new l;this._x=a;this._y=b;this._isDown=c};e["flambe.platform.BasicPointer"]=
F;F.__name__=["flambe","platform","BasicPointer"];F.__interfaces__=[Hb];F.prototype={get_x:function(){return this._x},get_y:function(){return this._y},isDown:function(){return this._isDown},submitDown:function(a,b,c){if(!this._isDown){this.submitMove(a,b,c);this._isDown=!0;var d=[],f=k.hitTest(j.root,a,b);if(null!=f){var h=f.owner;do{var e=h._compMap.Sprite_4;null!=e&&d.push(e);h=h.parent}while(null!=h)}this.prepare(a,b,f,c);for(a=0;a<d.length;)if(b=d[a],++a,b.onPointerDown(F._sharedEvent),F._sharedEvent._stopped)return;
this.down.emit(F._sharedEvent)}},submitMove:function(a,b,c){if(!(a==this._x&&b==this._y)){var d=[],f=k.hitTest(j.root,a,b);if(null!=f){var h=f.owner;do{var e=h._compMap.Sprite_4;null!=e&&d.push(e);h=h.parent}while(null!=h)}this.prepare(a,b,f,c);for(a=0;a<d.length;)if(b=d[a],++a,b.onPointerMove(F._sharedEvent),F._sharedEvent._stopped)return;this.move.emit(F._sharedEvent)}},submitUp:function(a,b,c){if(this._isDown){this.submitMove(a,b,c);this._isDown=!1;var d=[],f=k.hitTest(j.root,a,b);if(null!=f){var h=
f.owner;do{var e=h._compMap.Sprite_4;null!=e&&d.push(e);h=h.parent}while(null!=h)}this.prepare(a,b,f,c);for(a=0;a<d.length;)if(b=d[a],++a,b.onPointerUp(F._sharedEvent),F._sharedEvent._stopped)return;this.up.emit(F._sharedEvent)}},prepare:function(a,b,c,d){this._x=a;this._y=b;F._sharedEvent.init(F._sharedEvent.id+1,a,b,c,d)},__class__:F};var Y=function(a,b,c){this._parent=null;this.rootX=this.rootY=0;this._disposed=!1;this.root=a;this._width=b;this._height=c};e["flambe.platform.BasicTexture"]=Y;Y.__name__=
["flambe","platform","BasicTexture"];Y.__interfaces__=[Wb];Y.__super__=D;Y.prototype=o(D.prototype,{onDisposed:function(){null==this._parent&&this.root.dispose()},get_width:function(){return this._width},get_height:function(){return this._height},__class__:Y});var Xb=function(){};e["flambe.subsystem.TouchSystem"]=Xb;Xb.__name__=["flambe","subsystem","TouchSystem"];var Qa=function(a,b){null==b&&(b=4);this._pointer=a;this._maxPoints=b;this._pointMap=new sa;this._points=[];this.down=new l;this.move=
new l;this.up=new l};e["flambe.platform.BasicTouch"]=Qa;Qa.__name__=["flambe","platform","BasicTouch"];Qa.__interfaces__=[Xb];Qa.prototype={submitDown:function(a,b,c){if(!this._pointMap.exists(a)){var d=new Eb(a);d.init(b,c);this._pointMap.set(a,d);this._points.push(d);null==this._pointerTouch&&(this._pointerTouch=d,this._pointer.submitDown(b,c,d._source));this.down.emit(d)}},submitMove:function(a,b,c){a=this._pointMap.get(a);null!=a&&(a.init(b,c),this._pointerTouch==a&&this._pointer.submitMove(b,
c,a._source),this.move.emit(a))},submitUp:function(a,b,c){var d=this._pointMap.get(a);null!=d&&(d.init(b,c),this._pointMap.remove(a),A.remove(this._points,d),this._pointerTouch==d&&(this._pointerTouch=null,this._pointer.submitUp(b,c,d._source)),this.up.emit(d))},__class__:Qa};var ta=function(){};e["flambe.sound.Sound"]=ta;ta.__name__=["flambe","sound","Sound"];ta.__interfaces__=[ga];ta.prototype={__class__:ta};var P=function(){this._disposed=!1;this._playback=new ab(this)};e["flambe.platform.DummySound"]=
P;P.__name__=["flambe","platform","DummySound"];P.__interfaces__=[ta];P.getInstance=function(){null==P._instance&&(P._instance=new P);return P._instance};P.__super__=D;P.prototype=o(D.prototype,{play:function(){return this._playback},loop:function(){return this._playback},onDisposed:function(){},__class__:P});var ua=function(){};e["flambe.sound.Playback"]=ua;ua.__name__=["flambe","sound","Playback"];ua.__interfaces__=[Z];ua.prototype={__class__:ua};var ab=function(a){this._sound=a;this.volume=new B(0);
this._complete=new H(!0)};e["flambe.platform.DummyPlayback"]=ab;ab.__name__=["flambe","platform","DummyPlayback"];ab.__interfaces__=[ua];ab.prototype={set_paused:function(){return!0},dispose:function(){},__class__:ab};var Ra=function(){this.down=new l;this.move=new l;this.up=new l};e["flambe.platform.DummyTouch"]=Ra;Ra.__name__=["flambe","platform","DummyTouch"];Ra.__interfaces__=[Xb];Ra.prototype={__class__:Ra};var Ca=function(){this._entries=[]};e["flambe.platform.EventGroup"]=Ca;Ca.__name__=["flambe",
"platform","EventGroup"];Ca.__interfaces__=[Z];Ca.prototype={addListener:function(a,b,c){a.addEventListener(b,c,!1);this._entries.push(new Ib(a,b,c))},addDisposingListener:function(a,b,c){var d=this;this.addListener(a,b,function(a){d.dispose();c(a)})},dispose:function(){for(var a=0,b=this._entries;a<b.length;){var c=b[a];++a;c.dispatcher.removeEventListener(c.type,c.listener,!1)}this._entries=[]},__class__:Ca};var Ib=function(a,b,c){this.dispatcher=a;this.type=b;this.listener=c};e["flambe.platform._EventGroup.Entry"]=
Ib;Ib.__name__=["flambe","platform","_EventGroup","Entry"];Ib.prototype={__class__:Ib};var Da=function(){};e["flambe.platform.InternalGraphics"]=Da;Da.__name__=["flambe","platform","InternalGraphics"];Da.__interfaces__=[Bb];Da.prototype={__class__:Da};var Jb=function(){};e["flambe.subsystem.RendererSystem"]=Jb;Jb.__name__=["flambe","subsystem","RendererSystem"];Jb.prototype={__class__:Jb};var Ea=function(){};e["flambe.platform.InternalRenderer"]=Ea;Ea.__name__=["flambe","platform","InternalRenderer"];
Ea.__interfaces__=[Jb];Ea.prototype={__class__:Ea};var oa=function(){this._tickables=[]};e["flambe.platform.MainLoop"]=oa;oa.__name__=["flambe","platform","MainLoop"];oa.updateEntity=function(a,b){var c=a._compMap.SpeedAdjuster_6;if(null!=c&&(c._realDt=b,b*=c.scale._value,0>=b)){c.onUpdate(b);return}for(c=a.firstComponent;null!=c;){var d=c.next;0==(c._flags&1)&&(c._flags|=1,c.onStart());c.onUpdate(b);c=d}for(c=a.firstChild;null!=c;)d=c.next,oa.updateEntity(c,b),c=d};oa.prototype={update:function(a){if(!(0>=
a)){1<a&&(a=1);for(var b=0;b<this._tickables.length;){var c=this._tickables[b];null==c||c.update(a)?this._tickables.splice(b,1):++b}j.volume.update(a);oa.updateEntity(j.root,a)}},render:function(a){var b=a.graphics;null!=b&&(a.willRender(),k.render(j.root,b),a.didRender())},addTickable:function(a){this._tickables.push(a)},__class__:oa};var Kb=function(){};e["flambe.platform.MathUtil"]=Kb;Kb.__name__=["flambe","platform","MathUtil"];Kb.nextPowerOfTwo=function(a){for(var b=1;b<a;)b<<=1;return b};var Gb=
function(){};e["flambe.platform.MouseCodes"]=Gb;Gb.__name__=["flambe","platform","MouseCodes"];Gb.toButton=function(a){switch(a){case 0:return N.Left;case 1:return N.Middle;case 2:return N.Right}return N.Unknown(a)};var Yb=function(){};e["flambe.platform.TextureRoot"]=Yb;Yb.__name__=["flambe","platform","TextureRoot"];var bb=function(){};e["flambe.platform.Tickable"]=bb;bb.__name__=["flambe","platform","Tickable"];bb.prototype={__class__:bb};var cb=function(a,b){this._firstDraw=!1;this._canvasCtx=
a.getContext("2d",{alpha:b})};e["flambe.platform.html.CanvasGraphics"]=cb;cb.__name__=["flambe","platform","html","CanvasGraphics"];cb.__interfaces__=[Da];cb.prototype={save:function(){this._canvasCtx.save()},transform:function(a,b,c,d,f,h){this._canvasCtx.transform(a,b,c,d,f,h)},restore:function(){this._canvasCtx.restore()},drawTexture:function(a,b,c){this.drawSubTexture(a,b,c,0,0,a.get_width(),a.get_height())},drawSubTexture:function(a,b,c,d,f,h,e){this._firstDraw?(this._firstDraw=!1,this._canvasCtx.globalCompositeOperation=
"copy",this.drawSubTexture(a,b,c,d,f,h,e),this._canvasCtx.globalCompositeOperation="source-over"):this._canvasCtx.drawImage(a.root.image,a.rootX+d|0,a.rootY+f|0,h|0,e|0,b|0,c|0,h|0,e|0)},fillRect:function(a,b,c,d,f){if(this._firstDraw)this._firstDraw=!1,this._canvasCtx.globalCompositeOperation="copy",this.fillRect(a,b,c,d,f),this._canvasCtx.globalCompositeOperation="source-over";else{for(a=(16777215&a).toString(16);6>a.length;)a="0"+T.string(a);this._canvasCtx.fillStyle="#"+T.string(a);this._canvasCtx.fillRect(b|
0,c|0,d|0,f|0)}},multiplyAlpha:function(a){this._canvasCtx.globalAlpha*=a},setBlendMode:function(a){var b;switch(a[1]){case 0:b="source-over";break;case 1:b="lighter";break;case 2:b="multiply";break;case 3:b="screen";break;case 4:b="destination-in";break;case 5:b="copy"}this._canvasCtx.globalCompositeOperation=b},applyScissor:function(a,b,c,d){this._canvasCtx.beginPath();this._canvasCtx.rect(a|0,b|0,c|0,d|0);this._canvasCtx.clip()},willRender:function(){this._firstDraw=!0},didRender:function(){},
onResize:function(){},__class__:cb};var pa=function(a){this.graphics=new cb(a,!1);this._hasGPU=new H(!0)};e["flambe.platform.html.CanvasRenderer"]=pa;pa.__name__=["flambe","platform","html","CanvasRenderer"];pa.__interfaces__=[Ea];pa.prototype={get_type:function(){return $.Canvas},createTextureFromImage:function(a){a=new Fa(pa.CANVAS_TEXTURES?m.createCanvas(a):a);return a.createTexture(a.width,a.height)},getCompressedTextureFormats:function(){return[]},createCompressedTexture:function(){return null},
willRender:function(){this.graphics.willRender()},didRender:function(){this.graphics.didRender()},__class__:pa};var db=function(a,b,c){Y.call(this,a,b,c)};e["flambe.platform.html.CanvasTexture"]=db;db.__name__=["flambe","platform","html","CanvasTexture"];db.__super__=Y;db.prototype=o(Y.prototype,{__class__:db});var Fa=function(a){this._graphics=null;this._disposed=!1;this.image=a;this.width=a.width;this.height=a.height};e["flambe.platform.html.CanvasTextureRoot"]=Fa;Fa.__name__=["flambe","platform",
"html","CanvasTextureRoot"];Fa.__interfaces__=[Yb];Fa.__super__=D;Fa.prototype=o(D.prototype,{createTexture:function(a,b){return new db(this,a,b)},onDisposed:function(){this._graphics=this.image=null},__class__:Fa});var r=function(a,b){ha.call(this,a,b)};e["flambe.platform.html.HtmlAssetPackLoader"]=r;r.__name__=["flambe","platform","html","HtmlAssetPackLoader"];r.detectImageFormats=function(a){var b=[i.PNG,i.JPG,i.GIF],c=2,d;d=window.document.createElement("img");d.onload=d.onerror=function(){1==
d.width&&b.unshift(i.WEBP);--c;0==c&&a(b)};d.src="data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==";var f;f=window.document.createElement("img");f.onload=f.onerror=function(){1==f.width&&b.unshift(i.JXR);--c;0==c&&a(b)};f.src="data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA=="};r.detectAudioFormats=function(){var a;a=window.document.createElement("audio");
if(null==a||null==la(a,a.canPlayType))return[];var b=new ma("\\b(iPhone|iPod|iPad|Android|Windows Phone)\\b",""),c=window.navigator.userAgent;if(!s.get_supported()&&b.match(c))return[];for(var b=[{format:i.M4A,mimeType:"audio/mp4; codecs=mp4a"},{format:i.MP3,mimeType:"audio/mpeg"},{format:i.OPUS,mimeType:"audio/ogg; codecs=opus"},{format:i.OGG,mimeType:"audio/ogg; codecs=vorbis"},{format:i.WAV,mimeType:"audio/wav"}],c=[],d=0;d<b.length;){var f=b[d];++d;var h="";try{h=a.canPlayType(f.mimeType)}catch(e){}""!=
h&&c.push(f.format)}return c};r.supportsBlob=function(){if(r._detectBlobSupport){r._detectBlobSupport=!1;if((new ma("\\bSilk\\b","")).match(window.navigator.userAgent)||null==window.Blob)return!1;var a=new XMLHttpRequest;a.open("GET",".",!0);if(""!=a.responseType)return!1;a.responseType="blob";if("blob"!=a.responseType)return!1;r._URL=m.loadExtension("URL").value}return null!=r._URL&&null!=r._URL.createObjectURL};r.__super__=ha;r.prototype=o(ha.prototype,{loadEntry:function(a,b){var c=this;switch(b.format[1]){case 0:case 1:case 2:case 3:case 4:var d;
d=window.document.createElement("img");var f=new Ca;f.addDisposingListener(d,"load",function(){r.supportsBlob()&&r._URL.revokeObjectURL(d.src);var a=c._platform.getRenderer().createTextureFromImage(d);null!=a?c.handleLoad(b,a):c.handleTextureError(b)});f.addDisposingListener(d,"error",function(){c.handleError(b,"Failed to load image")});r.supportsBlob()?this.download(a,b,"blob",function(a){d.src=r._URL.createObjectURL(a)}):d.src=a;break;case 5:case 6:case 7:this.download(a,b,"arraybuffer",function(){var a=
c._platform.getRenderer().createCompressedTexture(b.format,null);null!=a?c.handleLoad(b,a):c.handleTextureError(b)});break;case 8:case 9:case 10:case 11:case 12:if(s.get_supported())this.download(a,b,"arraybuffer",function(a){s.ctx.decodeAudioData(a,function(a){c.handleLoad(b,new s(a))},function(){c.handleLoad(b,P.getInstance())})});else{var h;h=window.document.createElement("audio");h.preload="auto";var e=++r._mediaRefCount;null==r._mediaElements&&(r._mediaElements=new sa);r._mediaElements.set(e,
h);f=new Ca;f.addDisposingListener(h,"canplaythrough",function(){r._mediaElements.remove(e);c.handleLoad(b,new Ga(h))});f.addDisposingListener(h,"error",function(){r._mediaElements.remove(e);var a=h.error.code;3==a||4==a?c.handleLoad(b,P.getInstance()):c.handleError(b,"Failed to load audio: "+h.error.code)});f.addListener(h,"progress",function(){if(0<h.buffered.length&&0<h.duration){var a=h.buffered.end(0)/h.duration;c.handleProgress(b,a*b.bytes|0)}});h.src=a;h.load()}break;case 13:this.download(a,
b,"text",function(a){c.handleLoad(b,new Ba(a))})}},getAssetFormats:function(a){var b=this;null==r._supportedFormats&&(r._supportedFormats=new Za,r.detectImageFormats(function(a){r._supportedFormats.set_result(b._platform.getRenderer().getCompressedTextureFormats().concat(a).concat(r.detectAudioFormats()).concat([i.Data]))}));r._supportedFormats.get(a)},download:function(a,b,c,d){var f=this,h=null,e=null,g=0,i=!1,j=function(){i&&(i=!1,window.clearInterval(g))},k=3,l=function(){--k;return 0<=k?(e(),
!0):!1},e=function(){j();null!=h&&h.abort();h=new XMLHttpRequest;h.open("GET",a,!0);h.responseType=c;var e=0;h.onprogress=function(a){i||(i=!0,g=window.setInterval(function(){4!=h.readyState&&5E3<Date.now()-e&&!l()&&(j(),f.handleError(b,"Download stalled"))},1E3));e=Date.now();f.handleProgress(b,a.loaded)};h.onerror=function(){if(0!=h.status||!l())j(),f.handleError(b,"HTTP error "+h.status)};h.onload=function(){var a=h.response;null==a&&(a=h.responseText);j();d(a)};h.send()};e()},__class__:r});var Pa=
function(a,b){L.call(this,a);this._canvas=b};e["flambe.platform.html.HtmlMouse"]=Pa;Pa.__name__=["flambe","platform","html","HtmlMouse"];Pa.__super__=L;Pa.prototype=o(L.prototype,{set_cursor:function(a){var b;switch(a[1]){case 0:b="";break;case 1:b="pointer";break;case 2:b="none"}this._canvas.style.cursor=b;return L.prototype.set_cursor.call(this,a)},__class__:Pa});var Ga=function(a){this._disposed=!1;this.audioElement=a};e["flambe.platform.html.HtmlSound"]=Ga;Ga.__name__=["flambe","platform","html",
"HtmlSound"];Ga.__interfaces__=[ta];Ga.__super__=D;Ga.prototype=o(D.prototype,{play:function(a){null==a&&(a=1);return new Ha(this,a,!1)},loop:function(a){null==a&&(a=1);return new Ha(this,a,!0)},onDisposed:function(){this.audioElement=null},__class__:Ga});var Ha=function(a,b,c){var d=this;this._sound=a;this._tickableAdded=!1;this._clonedElement=window.document.createElement("audio");this._clonedElement.loop=c;this._clonedElement.src=a.audioElement.src;this.volume=new B(b,function(){d.updateVolume()});
this.updateVolume();this._complete=new H(!1);this.playAudio();j.hidden._value&&this.set_paused(!0)};e["flambe.platform.html._HtmlSound.HtmlPlayback"]=Ha;Ha.__name__=["flambe","platform","html","_HtmlSound","HtmlPlayback"];Ha.__interfaces__=[bb,ua];Ha.prototype={set_paused:function(a){this._clonedElement.paused!=a&&(a?this._clonedElement.pause():this.playAudio());return a},update:function(a){this.volume.update(a);this._complete.set__(this._clonedElement.ended);return this._complete._value||this._clonedElement.paused?
(this._tickableAdded=!1,this._volumeBinding.dispose(),this._hideBinding.dispose(),!0):!1},dispose:function(){this.set_paused(!0);this._complete.set__(!0)},playAudio:function(){var a=this;this._clonedElement.play();this._tickableAdded||(ca.instance.mainLoop.addTickable(this),this._tickableAdded=!0,this._volumeBinding=j.volume.get_changed().connect(function(){a.updateVolume()}),this._hideBinding=j.hidden.get_changed().connect(function(b){b?(a._wasPaused=a._clonedElement.paused,a.set_paused(!0)):a.set_paused(a._wasPaused)}))},
updateVolume:function(){this._clonedElement.volume=j.volume._value*this.volume._value},__class__:Ha};var Lb=function(){};e["flambe.subsystem.StageSystem"]=Lb;Lb.__name__=["flambe","subsystem","StageSystem"];Lb.prototype={__class__:Lb};var na=function(a){var b=this;this._canvas=a;this.resize=new ia;this.scaleFactor=na.computeScaleFactor();1!=this.scaleFactor&&(m.setVendorStyle(this._canvas,"transform-origin","top left"),m.setVendorStyle(this._canvas,"transform","scale("+1/this.scaleFactor+")"));m.SHOULD_HIDE_MOBILE_BROWSER&&
(window.addEventListener("orientationchange",function(){m.callLater(la(b,b.hideMobileBrowser),200)},!1),this.hideMobileBrowser());window.addEventListener("resize",la(this,this.onWindowResize),!1);this.onWindowResize(null);this.orientation=new H(null);null!=window.orientation&&(window.addEventListener("orientationchange",la(this,this.onOrientationChange),!1),this.onOrientationChange(null));this.fullscreen=new H(!1);m.addVendorListener(window.document,"fullscreenchange",function(){b.updateFullscreen()},
!1);this.updateFullscreen()};e["flambe.platform.html.HtmlStage"]=na;na.__name__=["flambe","platform","html","HtmlStage"];na.__interfaces__=[Lb];na.computeScaleFactor=function(){var a=window.devicePixelRatio;null==a&&(a=1);var b=window.document.createElement("canvas").getContext("2d"),b=m.loadExtension("backingStorePixelRatio",b).value;null==b&&(b=1);a/=b;b=window.screen.height;return 1136<a*window.screen.width||1136<a*b?1:a};na.prototype={get_width:function(){return this._canvas.width},get_height:function(){return this._canvas.height},
onWindowResize:function(){var a=this._canvas.parentElement.getBoundingClientRect();this.resizeCanvas(a.width,a.height)},resizeCanvas:function(a,b){var c=this.scaleFactor*a,d=this.scaleFactor*b;if(this._canvas.width==c&&this._canvas.height==d)return!1;this._canvas.width=c|0;this._canvas.height=d|0;this.resize.emit();return!0},hideMobileBrowser:function(){var a=this,b=window.document.documentElement.style;b.height=window.innerHeight+100+"px";b.width=window.innerWidth+"px";b.overflow="visible";m.callLater(function(){m.hideMobileBrowser();
m.callLater(function(){b.height=window.innerHeight+"px";a.onWindowResize(null)},100)})},onOrientationChange:function(){this.orientation.set__(m.orientation(window.orientation))},updateFullscreen:function(){this.fullscreen.set__(!0==m.loadFirstExtension(["fullscreen","fullScreen","isFullScreen"],window.document).value)},__class__:na};var m=function(){};e["flambe.platform.html.HtmlUtil"]=m;m.__name__=["flambe","platform","html","HtmlUtil"];m.callLater=function(a,b){null==b&&(b=0);window.setTimeout(a,
b)};m.hideMobileBrowser=function(){window.scrollTo(1,0)};m.loadExtension=function(a,b){null==b&&(b=window);var c=S.field(b,a);if(null!=c)return{prefix:"",field:a,value:c};for(var c=a.charAt(0).toUpperCase()+A.substr(a,1,null),d=0,f=m.VENDOR_PREFIXES;d<f.length;){var h=f[d];++d;var e=h+c,g=S.field(b,e);if(null!=g)return{prefix:h,field:e,value:g}}return{prefix:null,field:null,value:null}};m.loadFirstExtension=function(a,b){for(var c=0;c<a.length;){var d=a[c];++c;d=m.loadExtension(d,b);if(null!=d.field)return d}return{prefix:null,
field:null,value:null}};m.polyfill=function(a,b){null==b&&(b=window);var c=m.loadExtension(a,b).value;if(null==c)return!1;b[a]=c;return!0};m.setVendorStyle=function(a,b,c){for(var a=a.style,d=0,f=m.VENDOR_PREFIXES;d<f.length;){var h=f[d];++d;a.setProperty("-"+h+"-"+b,c)}a.setProperty(b,c)};m.addVendorListener=function(a,b,c,d){for(var f=0,h=m.VENDOR_PREFIXES;f<h.length;){var e=h[f];++f;a.addEventListener(e+b,c,d)}a.addEventListener(b,c,d)};m.orientation=function(a){switch(a){case -90:case 90:return ra.Landscape;
default:return ra.Portrait}};m.createEmptyCanvas=function(a,b){var c;c=window.document.createElement("canvas");c.width=a;c.height=b;return c};m.createCanvas=function(a){var b=m.createEmptyCanvas(a.width,a.height),c=b.getContext("2d");c.save();c.globalCompositeOperation="copy";c.drawImage(a,0,0);c.restore();return b};m.detectSlowDriver=function(a){if(0<=window.navigator.platform.indexOf("Win")&&null!=window.chrome){for(var b=0,a=a.getSupportedExtensions();b<a.length;){var c=a[b];++b;if(0<=c.indexOf("WEBGL_compressed_texture"))return!1}return!0}return!1};
m.fixAndroidMath=function(){if(0<=window.navigator.userAgent.indexOf("Linux; U; Android 4")){var a=Math.sin,b=Math.cos;Math.sin=function(b){return 0==b?0:a(b)};Math.cos=function(a){return 0==a?1:b(a)}}};var s=function(a){this._disposed=!1;this.buffer=a};e["flambe.platform.html.WebAudioSound"]=s;s.__name__=["flambe","platform","html","WebAudioSound"];s.__interfaces__=[ta];s.get_supported=function(){if(s._detectSupport){s._detectSupport=!1;var a=m.loadExtension("AudioContext").value;null!=a&&(s.ctx=
new a,s.gain=s.createGain(),s.gain.connect(s.ctx.destination),j.volume.watch(function(a){s.gain.gain.value=a}))}return null!=s.ctx};s.createGain=function(){return null!=s.ctx.createGain?s.ctx.createGain():s.ctx.createGainNode()};s.start=function(a,b){null!=a.start?a.start(b):a.noteOn(b)};s.__super__=D;s.prototype=o(D.prototype,{play:function(a){null==a&&(a=1);return new Ia(this,a,!1)},loop:function(a){null==a&&(a=1);return new Ia(this,a,!0)},get_duration:function(){return this.buffer.duration},onDisposed:function(){this.buffer=
null},__class__:s});var Ia=function(a,b,c){var d=this;this._sound=a;this._head=s.gain;this._complete=new H(!1);this._sourceNode=s.ctx.createBufferSource();this._sourceNode.buffer=a.buffer;this._sourceNode.loop=c;this._sourceNode.onended=function(){d._complete.set__(!0)};s.start(this._sourceNode,0);this.playAudio();this.volume=new B(b,function(a){d.setVolume(a)});1!=b&&this.setVolume(b);j.hidden._value&&this.set_paused(!0)};e["flambe.platform.html._WebAudioSound.WebAudioPlayback"]=Ia;Ia.__name__=["flambe",
"platform","html","_WebAudioSound","WebAudioPlayback"];Ia.__interfaces__=[bb,ua];Ia.prototype={set_paused:function(a){a!=0<=this._pausedAt&&(a?(this._sourceNode.disconnect(),this._pausedAt=this.get_position()):this.playAudio());return a},get_position:function(){return this._complete._value?this._sound.get_duration():0<=this._pausedAt?this._pausedAt:(s.ctx.currentTime-this._startedAt)%this._sound.get_duration()},update:function(a){this.volume.update(a);3==this._sourceNode.playbackState&&this._complete.set__(!0);
return this._complete._value||0<=this._pausedAt?(this._tickableAdded=!1,this._hideBinding.dispose(),!0):!1},dispose:function(){this.set_paused(!0);this._complete.set__(!0)},setVolume:function(a){null==this._gainNode&&(this._gainNode=s.createGain(),this.insertNode(this._gainNode));this._gainNode.gain.value=a},insertNode:function(a){0<=this._pausedAt||(this._sourceNode.disconnect(),this._sourceNode.connect(a));a.connect(this._head);this._head=a},playAudio:function(){var a=this;this._sourceNode.connect(this._head);
this._startedAt=s.ctx.currentTime;this._pausedAt=-1;this._tickableAdded||(ca.instance.mainLoop.addTickable(this),this._tickableAdded=!0,this._hideBinding=j.hidden.get_changed().connect(function(b){b?(a._wasPaused=0<=a._pausedAt,a.set_paused(!0)):a.set_paused(a._wasPaused)}))},__class__:Ia};var Mb=function(a){this._quads=this._maxQuads=this._dataOffset=this._backbufferWidth=this._backbufferHeight=0;this._pendingSetScissor=!1;this._lastBlendMode=this._lastRenderTarget=this._lastShader=this._lastTexture=
this._lastScissor=this._currentBlendMode=this._currentShader=this._currentTexture=this._currentRenderTarget=null;this._gl=a;a.clearColor(0,0,0,0);a.enable(3042);a.pixelStorei(37441,1);this._vertexBuffer=a.createBuffer();a.bindBuffer(34962,this._vertexBuffer);this._quadIndexBuffer=a.createBuffer();a.bindBuffer(34963,this._quadIndexBuffer);this._drawTextureShader=new eb(a);this._drawPatternShader=new fb(a);this._fillRectShader=new gb(a);this.resize(16)};e["flambe.platform.html.WebGLBatcher"]=Mb;Mb.__name__=
["flambe","platform","html","WebGLBatcher"];Mb.prototype={resizeBackbuffer:function(a,b){this._gl.viewport(0,0,a,b);this._backbufferWidth=a;this._backbufferHeight=b},willRender:function(){},didRender:function(){this.flush()},bindTexture:function(a){this.flush();this._currentTexture=this._lastTexture=null;this._gl.bindTexture(3553,a)},deleteTexture:function(a){null!=this._lastTexture&&this._lastTexture.root==a&&(this.flush(),this._currentTexture=this._lastTexture=null);this._gl.deleteTexture(a.nativeTexture)},
deleteFramebuffer:function(a){a==this._lastRenderTarget&&(this.flush(),this._currentRenderTarget=this._lastRenderTarget=null);this._gl.deleteFramebuffer(a.framebuffer)},prepareDrawTexture:function(a,b,c,d){d!=this._lastTexture&&(this.flush(),this._lastTexture=d);return this.prepareQuad(5,a,b,c,this._drawTextureShader)},prepareFillRect:function(a,b,c){return this.prepareQuad(6,a,b,c,this._fillRectShader)},prepareQuad:function(a,b,c,d,f){b!=this._lastRenderTarget&&(this.flush(),this._lastRenderTarget=
b);c!=this._lastBlendMode&&(this.flush(),this._lastBlendMode=c);f!=this._lastShader&&(this.flush(),this._lastShader=f);if(null!=d||null!=this._lastScissor)if(null==d||null==this._lastScissor||!this._lastScissor.equals(d))this.flush(),this._lastScissor=null!=d?d.clone(this._lastScissor):null,this._pendingSetScissor=!0;this._quads>=this._maxQuads&&this.resize(2*this._maxQuads);++this._quads;b=this._dataOffset;this._dataOffset+=4*a;return b},flush:function(){if(!(1>this._quads)){this._lastRenderTarget!=
this._currentRenderTarget&&this.bindRenderTarget(this._lastRenderTarget);if(this._lastBlendMode!=this._currentBlendMode){switch(this._lastBlendMode[1]){case 0:this._gl.blendFunc(1,771);break;case 1:this._gl.blendFunc(1,1);break;case 2:this._gl.blendFunc(774,771);break;case 3:this._gl.blendFunc(1,769);break;case 4:this._gl.blendFunc(0,770);break;case 5:this._gl.blendFunc(1,0)}this._currentBlendMode=this._lastBlendMode}this._pendingSetScissor&&(null!=this._lastScissor?(this._gl.enable(3089),this._gl.scissor(this._lastScissor.x|
0,this._lastScissor.y|0,this._lastScissor.width|0,this._lastScissor.height|0)):this._gl.disable(3089),this._pendingSetScissor=!1);this._lastTexture!=this._currentTexture&&(this._gl.bindTexture(3553,this._lastTexture.root.nativeTexture),this._currentTexture=this._lastTexture);this._lastShader!=this._currentShader&&(this._lastShader.useProgram(),this._lastShader.prepare(),this._currentShader=this._lastShader);if(this._lastShader==this._drawPatternShader){var a=this._lastTexture,b=a.root;this._drawPatternShader.setRegion(a.rootX/
b.width,a.rootY/b.height,a._width/b.width,a._height/b.height)}this._gl.bufferData(34962,this.data.subarray(0,this._dataOffset),35040);this._gl.drawElements(4,6*this._quads,5123,0);this._dataOffset=this._quads=0}},resize:function(a){this.flush();if(!(1024<a)){this._maxQuads=a;this.data=new Float32Array(24*a);this._gl.bufferData(34962,4*this.data.length,35040);for(var b=new Uint16Array(6*a),c=0;c<a;){var d=c++;b[6*d]=4*d;b[6*d+1]=4*d+1;b[6*d+2]=4*d+2;b[6*d+3]=4*d+2;b[6*d+4]=4*d+3;b[6*d+5]=4*d}this._gl.bufferData(34963,
b,35044)}},bindRenderTarget:function(a){null!=a?(this._gl.bindFramebuffer(36160,a.framebuffer),this._gl.viewport(0,0,a.width,a.height)):(this._gl.bindFramebuffer(36160,null),this._gl.viewport(0,0,this._backbufferWidth,this._backbufferHeight));this._lastRenderTarget=this._currentRenderTarget=a},__class__:Mb};var W=function(a,b){this._inverseProjection=this._stateList=null;null==W._scratchQuadArray&&(W._scratchQuadArray=new Float32Array(8));this._batcher=a;this._renderTarget=b};e["flambe.platform.html.WebGLGraphics"]=
W;W.__name__=["flambe","platform","html","WebGLGraphics"];W.__interfaces__=[Da];W.prototype={save:function(){var a=this._stateList,b=this._stateList.next;null==b&&(b=new hb,b.prev=a,a.next=b);a.matrix.clone(b.matrix);b.alpha=a.alpha;b.blendMode=a.blendMode;b.scissor=null!=a.scissor?a.scissor.clone(b.scissor):null;this._stateList=b},transform:function(a,b,c,d,f,h){var e=this._stateList;W._scratchMatrix.set(a,b,c,d,f,h);U.multiply(e.matrix,W._scratchMatrix,e.matrix)},restore:function(){this._stateList=
this._stateList.prev},drawTexture:function(a,b,c){this.drawSubTexture(a,b,c,0,0,a.get_width(),a.get_height())},drawSubTexture:function(a,b,c,d,f,h,e){var g=this._stateList,i=a.root,b=this.transformQuad(b,c,h,e),c=i.width,i=i.height,d=(a.rootX+d)/c,f=(a.rootY+f)/i,h=d+h/c,e=f+e/i,c=g.alpha,a=this._batcher.prepareDrawTexture(this._renderTarget,g.blendMode,g.scissor,a),g=this._batcher.data;g[a]=b[0];g[++a]=b[1];g[++a]=d;g[++a]=f;g[++a]=c;g[++a]=b[2];g[++a]=b[3];g[++a]=h;g[++a]=f;g[++a]=c;g[++a]=b[4];
g[++a]=b[5];g[++a]=h;g[++a]=e;g[++a]=c;g[++a]=b[6];g[++a]=b[7];g[++a]=d;g[++a]=e;g[++a]=c},fillRect:function(a,b,c,d,f){var e=this._stateList,b=this.transformQuad(b,c,d,f),c=(a&16711680)/16711680,d=(a&65280)/65280,a=(a&255)/255,f=e.alpha,e=this._batcher.prepareFillRect(this._renderTarget,e.blendMode,e.scissor),g=this._batcher.data;g[e]=b[0];g[++e]=b[1];g[++e]=c;g[++e]=d;g[++e]=a;g[++e]=f;g[++e]=b[2];g[++e]=b[3];g[++e]=c;g[++e]=d;g[++e]=a;g[++e]=f;g[++e]=b[4];g[++e]=b[5];g[++e]=c;g[++e]=d;g[++e]=a;
g[++e]=f;g[++e]=b[6];g[++e]=b[7];g[++e]=c;g[++e]=d;g[++e]=a;g[++e]=f},multiplyAlpha:function(a){this._stateList.alpha*=a},setBlendMode:function(a){this._stateList.blendMode=a},applyScissor:function(a,b,c,d){var f=this._stateList,e=W._scratchQuadArray;e[0]=a;e[1]=b;e[2]=a+c;e[3]=b+d;f.matrix.transformArray(e,4,e);this._inverseProjection.transformArray(e,4,e);a=e[0];b=e[1];c=e[2]-a;d=e[3]-b;0>c&&(a+=c,c=-c);0>d&&(b+=d,d=-d);f.applyScissor(a,b,c,d)},willRender:function(){this._batcher.willRender()},
didRender:function(){this._batcher.didRender()},onResize:function(a,b){this._stateList=new hb;var c;c=null!=this._renderTarget?-1:1;this._stateList.matrix.set(2/a,0,0,-2*c/b,-1,c);this._inverseProjection=new U;this._inverseProjection.set(2/a,0,0,2/b,-1,-1);this._inverseProjection.invert()},transformQuad:function(a,b,c,d){var c=a+c,d=b+d,e=W._scratchQuadArray;e[0]=a;e[1]=b;e[2]=c;e[3]=b;e[4]=c;e[5]=d;e[6]=a;e[7]=d;this._stateList.matrix.transformArray(e,8,e);return e},__class__:W};var hb=function(){this.scissor=
this.prev=this.next=null;this.matrix=new U;this.alpha=1;this.blendMode=C.Normal};e["flambe.platform.html._WebGLGraphics.DrawingState"]=hb;hb.__name__=["flambe","platform","html","_WebGLGraphics","DrawingState"];hb.prototype={applyScissor:function(a,b,c,d){if(null!=this.scissor)var e=da.max(this.scissor.x,a),h=da.max(this.scissor.y,b),c=da.min(this.scissor.x+this.scissor.width,a+c),d=da.min(this.scissor.y+this.scissor.height,b+d),a=e,b=h,c=c-e,d=d-h;else this.scissor=new Aa;this.scissor.set(Math.round(a),
Math.round(b),Math.round(c),Math.round(d))},__class__:hb};var Sa=function(a,b){var c=this;this._hasGPU=new H(!0);this.gl=b;b.canvas.addEventListener("webglcontextlost",function(a){a.preventDefault();c._hasGPU.set__(!1)},!1);b.canvas.addEventListener("webglcontextrestore",function(){c.init();c._hasGPU.set__(!0)},!1);a.resize.connect(la(this,this.onResize));this.init()};e["flambe.platform.html.WebGLRenderer"]=Sa;Sa.__name__=["flambe","platform","html","WebGLRenderer"];Sa.__interfaces__=[Ea];Sa.prototype=
{get_type:function(){return $.WebGL},createTextureFromImage:function(a){if(this.gl.isContextLost())return null;var b=new ja(this,a.width,a.height);b.uploadImageData(a);return b.createTexture(a.width,a.height)},getCompressedTextureFormats:function(){return[]},createCompressedTexture:function(){this.gl.isContextLost();return null},willRender:function(){this.graphics.willRender()},didRender:function(){this.graphics.didRender()},onResize:function(){var a=this.gl.canvas.width,b=this.gl.canvas.height;this.batcher.resizeBackbuffer(a,
b);this.graphics.onResize(a,b)},init:function(){this.batcher=new Mb(this.gl);this.graphics=new W(this.batcher,null);this.onResize()},__class__:Sa};var ib=function(a,b,c){Y.call(this,a,b,c)};e["flambe.platform.html.WebGLTexture"]=ib;ib.__name__=["flambe","platform","html","WebGLTexture"];ib.__super__=Y;ib.prototype=o(Y.prototype,{__class__:ib});var ja=function(a,b,c){this.framebuffer=this._graphics=null;this._disposed=!1;this._renderer=a;this.width=da.max(2,Kb.nextPowerOfTwo(b));this.height=da.max(2,
Kb.nextPowerOfTwo(c));b=a.gl;this.nativeTexture=b.createTexture();a.batcher.bindTexture(this.nativeTexture);b.texParameteri(3553,10242,33071);b.texParameteri(3553,10243,33071);b.texParameteri(3553,10240,9729);b.texParameteri(3553,10241,9728)};e["flambe.platform.html.WebGLTextureRoot"]=ja;ja.__name__=["flambe","platform","html","WebGLTextureRoot"];ja.__interfaces__=[Yb];ja.drawBorder=function(a,b,c){var d=a.getContext("2d");d.drawImage(a,b-1,0,1,c,b,0,1,c);d.drawImage(a,0,c-1,b,1,0,c,b,1)};ja.__super__=
D;ja.prototype=o(D.prototype,{createTexture:function(a,b){return new ib(this,a,b)},uploadImageData:function(a){if(this.width!=a.width||this.height!=a.height){var b=m.createEmptyCanvas(this.width,this.height);b.getContext("2d").drawImage(a,0,0);ja.drawBorder(b,a.width,a.height);a=b}this._renderer.batcher.bindTexture(this.nativeTexture);this._renderer.gl.texImage2D(3553,0,6408,6408,5121,a)},onDisposed:function(){var a=this._renderer.batcher;a.deleteTexture(this);null!=this.framebuffer&&a.deleteFramebuffer(this);
this._graphics=this.framebuffer=this.nativeTexture=null},__class__:ja});var M=function(a,b,c){c="#ifdef GL_ES\nprecision mediump float;\n#endif\n"+c;this._gl=a;this._program=a.createProgram();a.attachShader(this._program,M.createShader(a,35633,b));a.attachShader(this._program,M.createShader(a,35632,c));a.linkProgram(this._program);a.useProgram(this._program)};e["flambe.platform.shader.ShaderGL"]=M;M.__name__=["flambe","platform","shader","ShaderGL"];M.createShader=function(a,b,c){b=a.createShader(b);
a.shaderSource(b,c);a.compileShader(b);return b};M.prototype={useProgram:function(){this._gl.useProgram(this._program)},prepare:function(){null},getAttribLocation:function(a){return this._gl.getAttribLocation(this._program,a)},getUniformLocation:function(a){return this._gl.getUniformLocation(this._program,a)},__class__:M};var fb=function(a){M.call(this,a,"attribute highp vec2 a_pos;\nattribute mediump vec2 a_uv;\nattribute lowp float a_alpha;\nvarying mediump vec2 v_uv;\nvarying lowp float v_alpha;\nvoid main (void) {\nv_uv = a_uv;\nv_alpha = a_alpha;\ngl_Position = vec4(a_pos, 0, 1);\n}",
"varying mediump vec2 v_uv;\nvarying lowp float v_alpha;\nuniform lowp sampler2D u_texture;\nuniform mediump vec4 u_region;\nvoid main (void) {\ngl_FragColor = texture2D(u_texture, u_region.xy + mod(v_uv, u_region.zw)) * v_alpha;\n}");this.a_pos=this.getAttribLocation("a_pos");this.a_uv=this.getAttribLocation("a_uv");this.a_alpha=this.getAttribLocation("a_alpha");this.u_texture=this.getUniformLocation("u_texture");this.u_region=this.getUniformLocation("u_region");this.setTexture(0)};e["flambe.platform.shader.DrawPatternGL"]=
fb;fb.__name__=["flambe","platform","shader","DrawPatternGL"];fb.__super__=M;fb.prototype=o(M.prototype,{setTexture:function(a){this._gl.uniform1i(this.u_texture,a)},setRegion:function(a,b,c,d){this._gl.uniform4f(this.u_region,a,b,c,d)},prepare:function(){this._gl.enableVertexAttribArray(this.a_pos);this._gl.enableVertexAttribArray(this.a_uv);this._gl.enableVertexAttribArray(this.a_alpha);this._gl.vertexAttribPointer(this.a_pos,2,5126,!1,20,0);this._gl.vertexAttribPointer(this.a_uv,2,5126,!1,20,8);
this._gl.vertexAttribPointer(this.a_alpha,1,5126,!1,20,16)},__class__:fb});var eb=function(a){M.call(this,a,"attribute highp vec2 a_pos;\nattribute mediump vec2 a_uv;\nattribute lowp float a_alpha;\nvarying mediump vec2 v_uv;\nvarying lowp float v_alpha;\nvoid main (void) {\nv_uv = a_uv;\nv_alpha = a_alpha;\ngl_Position = vec4(a_pos, 0, 1);\n}","varying mediump vec2 v_uv;\nvarying lowp float v_alpha;\nuniform lowp sampler2D u_texture;\nvoid main (void) {\ngl_FragColor = texture2D(u_texture, v_uv) * v_alpha;\n}");
this.a_pos=this.getAttribLocation("a_pos");this.a_uv=this.getAttribLocation("a_uv");this.a_alpha=this.getAttribLocation("a_alpha");this.u_texture=this.getUniformLocation("u_texture");this.setTexture(0)};e["flambe.platform.shader.DrawTextureGL"]=eb;eb.__name__=["flambe","platform","shader","DrawTextureGL"];eb.__super__=M;eb.prototype=o(M.prototype,{setTexture:function(a){this._gl.uniform1i(this.u_texture,a)},prepare:function(){this._gl.enableVertexAttribArray(this.a_pos);this._gl.enableVertexAttribArray(this.a_uv);
this._gl.enableVertexAttribArray(this.a_alpha);this._gl.vertexAttribPointer(this.a_pos,2,5126,!1,20,0);this._gl.vertexAttribPointer(this.a_uv,2,5126,!1,20,8);this._gl.vertexAttribPointer(this.a_alpha,1,5126,!1,20,16)},__class__:eb});var gb=function(a){M.call(this,a,"attribute highp vec2 a_pos;\nattribute lowp vec3 a_rgb;\nattribute lowp float a_alpha;\nvarying lowp vec4 v_color;\nvoid main (void) {\nv_color = vec4(a_rgb*a_alpha, a_alpha);\ngl_Position = vec4(a_pos, 0, 1);\n}","varying lowp vec4 v_color;\nvoid main (void) {\ngl_FragColor = v_color;\n}");
this.a_pos=this.getAttribLocation("a_pos");this.a_rgb=this.getAttribLocation("a_rgb");this.a_alpha=this.getAttribLocation("a_alpha")};e["flambe.platform.shader.FillRectGL"]=gb;gb.__name__=["flambe","platform","shader","FillRectGL"];gb.__super__=M;gb.prototype=o(M.prototype,{prepare:function(){this._gl.enableVertexAttribArray(this.a_pos);this._gl.enableVertexAttribArray(this.a_rgb);this._gl.enableVertexAttribArray(this.a_alpha);this._gl.vertexAttribPointer(this.a_pos,2,5126,!1,24,0);this._gl.vertexAttribPointer(this.a_rgb,
3,5126,!1,24,8);this._gl.vertexAttribPointer(this.a_alpha,1,5126,!1,24,20)},__class__:gb});var jb=function(){this._width=this._height=-1;this._transitor=null;u.call(this);this.scenes=[];this.occludedScenes=[];this._root=new G};e["flambe.scene.Director"]=jb;jb.__name__=["flambe","scene","Director"];jb.__super__=u;jb.prototype=o(u.prototype,{get_name:function(){return"Director_5"},pushScene:function(a,b){var c=this;this.completeTransition();var d=this.get_topScene();null!=d?this.playTransition(d,a,
b,function(){c.hide(d)}):(this.add(a),this.invalidateVisibility())},unwindToScene:function(a,b){var c=this;this.completeTransition();var d=this.get_topScene();if(null!=d){if(d!=a){for(this.scenes.pop();0<this.scenes.length&&this.scenes[this.scenes.length-1]!=a;)this.scenes.pop().dispose();this.playTransition(d,a,b,function(){c.hideAndDispose(d)})}}else this.pushScene(a,b)},onAdded:function(){this.owner.addChild(this._root)},onRemoved:function(){this.completeTransition();for(var a=0,b=this.scenes;a<
b.length;){var c=b[a];++a;c.dispose()}this.scenes=[];this.occludedScenes=[];this._root.dispose()},onUpdate:function(a){null!=this._transitor&&this._transitor.update(a)&&this.completeTransition()},get_topScene:function(){var a=this.scenes.length;return 0<a?this.scenes[a-1]:null},add:function(a){var b=this.get_topScene();null!=b&&this._root.removeChild(b);A.remove(this.scenes,a);this.scenes.push(a);this._root.addChild(a)},hide:function(a){a=a._compMap.Scene_3;null!=a&&a.hidden.emit()},hideAndDispose:function(a){this.hide(a);
a.dispose()},show:function(a){a=a._compMap.Scene_3;null!=a&&a.shown.emit()},invalidateVisibility:function(){for(var a=this.scenes.length;0<a;){var b=this.scenes[--a]._compMap.Scene_3;if(null==b||b.opaque)break}this.occludedScenes=0<this.scenes.length?this.scenes.slice(a,this.scenes.length-1):[];a=this.get_topScene();null!=a&&this.show(a)},completeTransition:function(){null!=this._transitor&&(this._transitor.complete(),this._transitor=null,this.invalidateVisibility())},playTransition:function(a,b,
c,d){this.completeTransition();this.add(b);null!=c?(this.occludedScenes.push(a),this._transitor=new Nb(a,b,c,d),this._transitor.init(this)):(d(),this.invalidateVisibility())},get_width:function(){return 0>this._width?j._platform.getStage().get_width():this._width},get_height:function(){return 0>this._height?j._platform.getStage().get_height():this._height},__class__:jb});var Nb=function(a,b,c,d){this._from=a;this._to=b;this._transition=c;this._onComplete=d};e["flambe.scene._Director.Transitor"]=Nb;
Nb.__name__=["flambe","scene","_Director","Transitor"];Nb.prototype={init:function(a){this._transition.init(a,this._from,this._to)},update:function(a){return this._transition.update(a)},complete:function(){this._transition.complete();this._onComplete()},__class__:Nb};var va=function(a){null==a&&(a=!0);u.call(this);this.opaque=a;this.shown=new ia;this.hidden=new ia};e["flambe.scene.Scene"]=va;va.__name__=["flambe","scene","Scene"];va.__super__=u;va.prototype=o(u.prototype,{get_name:function(){return"Scene_3"},
__class__:va});var Ja=function(){};e["flambe.scene.Transition"]=Ja;Ja.__name__=["flambe","scene","Transition"];Ja.prototype={init:function(a,b,c){this._director=a;this._from=b;this._to=c},update:function(){return!0},complete:function(){},__class__:Ja};var ea=function(a,b){this._duration=a;this._ease=null!=b?b:v.linear};e["flambe.scene.TweenTransition"]=ea;ea.__name__=["flambe","scene","TweenTransition"];ea.__super__=Ja;ea.prototype=o(Ja.prototype,{init:function(a,b,c){Ja.prototype.init.call(this,
a,b,c);this._elapsed=0},update:function(a){this._elapsed+=a;return this._elapsed>=this._duration},interp:function(a,b){return a+(b-a)*this._ease(this._elapsed/this._duration)},__class__:ea});var kb=function(a,b){this._direction=2;ea.call(this,a,b)};e["flambe.scene.SlideTransition"]=kb;kb.__name__=["flambe","scene","SlideTransition"];kb.__super__=ea;kb.prototype=o(ea.prototype,{left:function(){this._direction=2;return this},init:function(a,b,c){ea.prototype.init.call(this,a,b,c);switch(this._direction){case 0:this._x=
0;this._y=-this._director.get_height();break;case 1:this._x=0;this._y=this._director.get_height();break;case 2:this._x=-this._director.get_width();this._y=0;break;case 3:this._x=this._director.get_width(),this._y=0}a=this._from._compMap.Sprite_4;null==a&&this._from.add(a=new k);a.setXY(0,0);a=this._to._compMap.Sprite_4;null==a&&this._to.add(a=new k);a.setXY(-this._x,-this._y)},update:function(a){a=ea.prototype.update.call(this,a);this._from._compMap.Sprite_4.setXY(this.interp(0,this._x),this.interp(0,
this._y));this._to._compMap.Sprite_4.setXY(this.interp(-this._x,0),this.interp(-this._y,0));return a},complete:function(){this._from._compMap.Sprite_4.setXY(0,0);this._to._compMap.Sprite_4.setXY(0,0)},__class__:kb});var $=e["flambe.subsystem.RendererType"]={__ename__:["flambe","subsystem","RendererType"],__constructs__:["Stage3D","WebGL","Canvas"]};$.Stage3D=["Stage3D",0];$.Stage3D.__enum__=$;$.WebGL=["WebGL",1];$.WebGL.__enum__=$;$.Canvas=["Canvas",2];$.Canvas.__enum__=$;var Vb=function(){};e["flambe.util.Assert"]=
Vb;Vb.__name__=["flambe","util","Assert"];Vb.that=function(){};var Za=function(){this.success=new l;this.error=new l;this.progressChanged=new ia;this.hasResult=!1;this._total=this._progress=0};e["flambe.util.Promise"]=Za;Za.__name__=["flambe","util","Promise"];Za.prototype={set_result:function(a){if(this.hasResult)throw"Promise result already assigned";this._result=a;this.hasResult=!0;this.success.emit(a);return a},get:function(a){return this.hasResult?(a(this._result),null):this.success.connect(a).once()},
set_progress:function(a){this._progress!=a&&(this._progress=a,this.progressChanged.emit());return a},set_total:function(a){this._total!=a&&(this._total=a,this.progressChanged.emit());return a},__class__:Za};var ia=function(a){y.call(this,a)};e["flambe.util.Signal0"]=ia;ia.__name__=["flambe","util","Signal0"];ia.__super__=y;ia.prototype=o(y.prototype,{connect:function(a,b){null==b&&(b=!1);return this.connectImpl(a,b)},emit:function(){var a=this;this._head==y.DISPATCHING_SENTINEL?this.defer(function(){a.emitImpl()}):
this.emitImpl()},emitImpl:function(){for(var a=this.willEmit(),b=a;null!=b;)b._listener(),b.stayInList||b.dispose(),b=b._next;this.didEmit(a)},__class__:ia});var xb=function(a){this.next=null;this.fn=a};e["flambe.util._SignalBase.Task"]=xb;xb.__name__=["flambe","util","_SignalBase","Task"];xb.prototype={__class__:xb};var K=function(){};e["flambe.util.Strings"]=K;K.__name__=["flambe","util","Strings"];K.getFileExtension=function(a){var b=a.lastIndexOf(".");return 0<b?A.substr(a,b+1,null):null};K.removeFileExtension=
function(a){var b=a.lastIndexOf(".");return 0<b?A.substr(a,0,b):a};K.getUrlExtension=function(a){var b=a.lastIndexOf("?");0<=b&&(a=A.substr(a,0,b));b=a.lastIndexOf("/");0<=b&&(a=A.substr(a,b+1,null));return K.getFileExtension(a)};K.joinPath=function(a,b){0<a.length&&47!=a.charCodeAt(a.length-1)&&(a+="/");return a+b};K.withFields=function(a,b){var c=b.length;if(0<c){for(var a=0<a.length?a+" [":a+"[",d=0;d<c;){0<d&&(a+=", ");var e=b[d],h=b[d+1];if(T.is(h,Error)){var g=h.stack;null!=g&&(h=g)}a+=e+"="+
T.string(h);d+=2}a+="]"}return a};var Ob=function(){var a=this;this.commandsMap=new ka;var b=lb;this.commandsMap.set(t.onOverlaysCreateRequest,b);b;b=mb;this.commandsMap.set(t.onContextReady,b);b;b=nb;this.commandsMap.set(t.onCreateSceneRequest,b);b;b=ob;this.commandsMap.set(t.onRestartGame,b);b;b=pb;this.commandsMap.set(t.onEndOfGame,b);b;b=qb;this.commandsMap.set(t.onClick,b);b;b=rb;this.commandsMap.set(t.onSuccessMinor,b);b;b=sb;this.commandsMap.set(t.onFailure,b);b;for(b=this.commandsMap.keys();b.hasNext();){var c=
[b.next()];c[0].connect(function(b){return function(c){var e=E.createInstance(a.commandsMap.h[b[0].__id__],[]);e.context=c;e.execute()}}(c))}};e["game.CommandsMap"]=Ob;Ob.__name__=["game","CommandsMap"];Ob.prototype={__class__:Ob};var aa=function(){this.levelNum=2;this.progress=0;this.restartButtonDown=new l;this.startButtonDown=new l};e["game.GameContext"]=aa;aa.__name__=["game","GameContext"];aa.getInstance=function(){null==aa.instance&&(aa.instance=new aa);return aa.instance};aa.prototype={init:function(){var a=
this;this.gameLayer=new G;this.msgLayer=new G;this.gameEntity.addChild(this.gameLayer);this.gameEntity.addChild(this.msgLayer);this.model=JSON.parse(this.settingsPack.getFile("model.json").toString());this.startButtonDown.connect(function(b){Q.hide(b);a.createScene()});this.restartButtonDown.connect(function(b){Q.hide(b);a.restartGame()});t.onContextReady.emit(this);this.gameLoop=this.pack.getSound("gameLoop");this.gameLoopPlayback=this.gameLoop.loop(1);this.sndLayer=n.create(this.pack,this.gameLoopPlayback);
this.gameEntity.addChild(this.sndLayer);this.gameEntity.addChild(this.msgLayer)},advance:function(){var a=this;this.progress++;var b=this.getEndOfLevel();g.log("Advance: "+this.progress+" of "+b,{fileName:"GameContext.hx",lineNumber:108,className:"game.GameContext",methodName:"advance"});this.progress==b?R.delay(function(){a.levelUp()},1E3):this.beginLevelPhase()},getEndOfLevel:function(){return 2==this.levelNum?this.currentLevel().order.length:this.currentLevel().score.length/2},cleanUp:function(){this.gameLayer.disposeChildren();
for(var a=0,b=this.selectedConnections.length;a<b;)this.selectedConnections[a++].dispose();null!=this.replayTimer&&this.replayTimer.stop()},levelUp:function(){this.progress=0;g.hasConsole&&g.callConsole("log",["levelUP"]);g.print(q.log,["levelUP"],{fileName:"GameContext.hx",lineNumber:144,className:"game.GameContext",methodName:"levelUp"});2==this.levelNum?this.endOfGame():(this.cleanUp(),this.levelNum++,this.createScene())},check:function(a,b,c){b=a==b?c:b;a=k.getBounds(a);b=k.getBounds(b);return 50>
Math.sqrt(Math.pow(b.x+b.width/2-(a.x+a.width/2),2)+Math.pow(b.y+b.height/2-(a.y+a.height/2),2))},getBigName:function(a){switch(this.levelNum){case 0:return a.split("_")[0];case 1:return S.field(this.currentLevel().custom.itemByAnimal,a)?a:S.field(this.currentLevel().custom.animalByItem,a)}return""},getSmallName:function(a){switch(this.levelNum){case 0:return a.split("_")[0]+"_small";case 1:return S.field(this.currentLevel().custom.itemByAnimal,a)?S.field(this.currentLevel().custom.itemByAnimal,a):
a}return""},beginLevelPhase:function(){var a=this;if(2==this.levelNum){var b=this.currentLevel().order[this.progress];R.delay(function(){a.pack.getSound("snd_"+b).play();a.replaySound()},750)}},replaySound:function(){var a=this;g.hasConsole&&g.callConsole("log",["Replay sound."]);g.print(q.log,["Replay sound."],{fileName:"GameContext.hx",lineNumber:227,className:"game.GameContext",methodName:"replaySound"});this.replayTimer=R.delay(function(){var b=a.currentLevel().order[a.progress];a.pack.getSound("snd_"+
b).play();a.replaySound()},5E3)},handleDrop:function(a){var b=this.nameByEntity.h[a.__id__];if(2==this.levelNum){var c=this.currentLevel().order[this.progress];g.log("clicked "+b+", correct: "+c,{fileName:"GameContext.hx",lineNumber:242,className:"game.GameContext",methodName:"handleDrop"});b==c?(a._compMap.Sprite_4.alpha.animateTo(0,0.5,v.quintOut),a.remove(a._compMap.Selectable_0),a.remove(a._compMap.UseHandCursor_2),R.delay(function(){a.dispose()},500),g.hasConsole&&g.callConsole("log",["Replay stopped."]),
g.print(q.log,["Replay stopped."],{fileName:"GameContext.hx",lineNumber:252,className:"game.GameContext",methodName:"handleDrop"}),this.replayTimer.stop(),t.onSuccessMinor.emit(this),this.advance()):(g.hasConsole&&g.callConsole("log",["Wrong!"]),g.print(q.log,["Wrong!"],{fileName:"GameContext.hx",lineNumber:260,className:"game.GameContext",methodName:"handleDrop"}),t.onFailure.emit(this))}else{var d=this.getBigName(b);g.log("bigName: "+d,{fileName:"GameContext.hx",lineNumber:268,className:"game.GameContext",
methodName:"handleDrop"});var e=this.getSmallName(b);g.log("smallName: "+e,{fileName:"GameContext.hx",lineNumber:270,className:"game.GameContext",methodName:"handleDrop"});var c=this.entityByName.get(d),h=this.entityByName.get(e);if(this.check(a,c,h)){var b=this.successByName.get(d),i=this.successByName.get(e),d=this.configByName.get(d),e=this.configByName.get(e);c._compMap.Sprite_4.x.animateTo(b.x,0.5,v.quintOut);c._compMap.Sprite_4.y.animateTo(b.y,0.5,v.quintOut);c._compMap.Sprite_4.scaleX.animateTo(b.width/
d.width,0.5,v.quintOut);c._compMap.Sprite_4.scaleY.animateTo(b.heigth/d.heigth,0.5,v.quintOut);h._compMap.Sprite_4.x.animateTo(i.x,0.5,v.quintOut);h._compMap.Sprite_4.y.animateTo(i.y,0.5,v.quintOut);h._compMap.Sprite_4.scaleX.animateTo(i.width/e.width,0.5,v.quintOut);h._compMap.Sprite_4.scaleY.animateTo(i.heigth/e.heigth,0.5,v.quintOut);this.gameLayer.addChild(c);this.gameLayer.addChild(h);this.advance();c.remove(c._compMap.Draggable_1);c.remove(c._compMap.UseHandCursor_2);h.remove(h._compMap.Draggable_1);
h.remove(h._compMap.UseHandCursor_2);t.onSuccessMinor.emit(this)}else c=this.configByName.get(b),a._compMap.Sprite_4.x.animateTo(c.x,0.5,v.quintOut),a._compMap.Sprite_4.y.animateTo(c.y,0.5,v.quintOut),t.onFailure.emit(this)}},createOverlays:function(){t.onOverlaysCreateRequest.emit(this)},createScene:function(){t.onCreateSceneRequest.emit(this)},restartGame:function(){t.onRestartGame.emit(this)},endOfGame:function(){t.onEndOfGame.emit(this)},currentLevel:function(){var a;switch(this.levelNum){case 0:a=
this.model.l1;break;case 1:a=this.model.l2;break;case 2:a=this.model.l3;break;default:a=this.model.l1}return a},__class__:aa};var Ka=function(){var a=this;g.start();j.init();j.root.add(this.director=new jb);I.STAGE_WIDTH=j._platform.getStage().get_width();I.STAGE_HEIGHT=j._platform.getStage().get_height();g.log("log "+I.STAGE_WIDTH+" "+I.STAGE_HEIGHT,{fileName:"Main.hx",lineNumber:56,className:"game.Main",methodName:"new"});this["goto"]((new G).add(new va).add(new Wa(16777215,I.STAGE_WIDTH,I.STAGE_HEIGHT)));
j.loadAssetPack(J.fromAssets("bootstrap")).get(function(b){g.hasConsole&&g.callConsole("log",["Loading bootstrap pack..."]);g.print(q.log,["Loading bootstrap pack..."],{fileName:"Main.hx",lineNumber:64,className:"game.Main",methodName:"new"});t.onBootstrapAssetsReady.emit(b);b=Zb.create(b);b._compMap.Scene_3.shown.connect(function(){g.hasConsole&&g.callConsole("log",["Loading settings pack..."]);g.print(q.log,["Loading settings pack..."],{fileName:"Main.hx",lineNumber:70,className:"game.Main",methodName:"new"});
j.loadAssetPack(J.fromAssets("settings")).get(function(b){g.hasConsole&&g.callConsole("log",["Loading game pack..."]);g.print(q.log,["Loading game pack..."],{fileName:"Main.hx",lineNumber:73,className:"game.Main",methodName:"new"});j.loadAssetPack(J.fromAssets("game")).get(function(d){t.onGameAssetsReady.emit(d);g.hasConsole&&g.callConsole("log",["Loading done!"]);g.print(q.log,["Loading done!"],{fileName:"Main.hx",lineNumber:77,className:"game.Main",methodName:"new"});new Ob;var e=$b.create(d),h=
aa.getInstance();h.settingsPack=b;h.pack=d;h.gameEntity=e;h.init();a["goto"](e)})})});a["goto"](b)})};e["game.Main"]=Ka;Ka.__name__=["game","Main"];Ka.main=function(){new Ka};Ka.prototype={"goto":function(a){var b=I.getActualScale();a._compMap.Sprite_4.setScaleXY(b.sx,b.sy);this.director.unwindToScene(a,(new kb(1,v.quintInOut)).left())},__class__:Ka};var I=function(){};e["game.Settings"]=I;I.__name__=["game","Settings"];I.getActualScale=function(){var a=j._platform.getStage().get_width()/800,b=j._platform.getStage().get_height()/
600;return{sx:a,sy:b}};var t=function(){};e["game.SignalsMap"]=t;t.__name__=["game","SignalsMap"];var n=function(){};e["game.SoundSwitcher"]=n;n.__name__=["game","SoundSwitcher"];n.create=function(a,b){n._e=new G;n._sOn=new X(a.getTexture("soundOn"));n._sOff=new X(a.getTexture("soundOff"));n._sOn.get_pointerDown().connect(n.handleChange);n._sOff.get_pointerDown().connect(n.handleChange);n._sOn.setXY(754,9);n._sOff.setXY(754,9);n._playback=b;n.gotoOn();return n._e};n.handleChange=function(){n._on?
n.gotoOff():n.gotoOn()};n.gotoOn=function(){n._e.add(n._sOn);n._on=!0;n._restartFlag&&(n._playback=n._loop.loop(1),n._restartFlag=!1);n._playback.volume.set__(1)};n.gotoOff=function(){n._e.add(n._sOff);n._on=!1;n._playback.volume.set__(0)};n.restart=function(a){n._loop=a;n._on?n._playback=n._loop.loop(1):n._restartFlag=!0};var z=function(){};e["game.commands.CommandBase"]=z;z.__name__=["game","commands","CommandBase"];z.prototype={execute:function(){},__class__:z};var qb=function(){};e["game.commands.AfterClickCommand"]=
qb;qb.__name__=["game","commands","AfterClickCommand"];qb.__super__=z;qb.prototype=o(z.prototype,{execute:function(){this.context.pack.getSound("click").play()},__class__:qb});var sb=function(){};e["game.commands.AfterFailureCommand"]=sb;sb.__name__=["game","commands","AfterFailureCommand"];sb.__super__=z;sb.prototype=o(z.prototype,{execute:function(){this.context.pack.getSound("failed").play()},__class__:sb});var rb=function(){};e["game.commands.AfterSuccessCommand"]=rb;rb.__name__=["game","commands",
"AfterSuccessCommand"];rb.__super__=z;rb.prototype=o(z.prototype,{execute:function(){this.context.pack.getSound("success-minor").play()},__class__:rb});var mb=function(){};e["game.commands.ContextReadyCommand"]=mb;mb.__name__=["game","commands","ContextReadyCommand"];mb.__super__=z;mb.prototype=o(z.prototype,{execute:function(){this.context.createOverlays();Q.show(this.context.startMsg,!1)},__class__:mb});var lb=function(){};e["game.commands.CreateOverlaysCommand"]=lb;lb.__name__=["game","commands",
"CreateOverlaysCommand"];lb.__super__=z;lb.prototype=o(z.prototype,{execute:function(){this.context.startMsg=Q.create({buttonX:553,buttonY:480,hasButton:!0,msgTexture:"msgStart",buttonTexture:"btnstart",downSignal:this.context.startButtonDown},this.context.pack);this.context.eogMsg=Q.create({buttonX:265,buttonY:384,hasButton:!0,msgTexture:"msgEnd",buttonTexture:"btnrestart",downSignal:this.context.restartButtonDown},this.context.pack);this.context.failureMsg=Q.create({hasButton:!1,msgTexture:"msgFailure"},
this.context.pack);this.context.msgLayer.addChild(this.context.startMsg);this.context.msgLayer.addChild(this.context.eogMsg);this.context.msgLayer.addChild(this.context.failureMsg)},__class__:lb});var nb=function(){};e["game.commands.CreateSceneCommand"]=nb;nb.__name__=["game","commands","CreateSceneCommand"];nb.__super__=z;nb.prototype=o(z.prototype,{execute:function(){var a=this;this.context.nameByEntity=new ka;this.context.entityByName=new V;this.context.configByName=new V;this.context.successByName=
new V;this.context.selectedConnections=[];g.hasConsole&&g.callConsole("log",["Creating scene:"]);g.print(q.log,["Creating scene:"],{fileName:"CreateSceneCommand.hx",lineNumber:31,className:"game.commands.CreateSceneCommand",methodName:"execute"});var b=this.context.currentLevel();g.hasConsole&&g.callConsole("log",[b]);g.print(q.log,[b],{fileName:"CreateSceneCommand.hx",lineNumber:33,className:"game.commands.CreateSceneCommand",methodName:"execute"});for(var c,d=0,e=b.score.length;d<e;)c=d++,c=b.score[c],
this.context.successByName.set(c.name,c),c;R.delay(function(){a.createIntro(b)},0);R.delay(function(){a.createScene(b);a.context.beginLevelPhase()},2500)},createSprite:function(a){var b=new G,c=new X(this.context.pack.getTexture(a.name));c.setXY(a.x+I.STAGE_WIDTH,a.y);c.x.animateTo(a.x,0.5,v.quintOut);b.add(c);this.context.gameLayer.addChild(b);return b},createIntro:function(a){var b=this.createSprite({name:a.title,x:0,y:0})._compMap.Sprite_4;b.x.set__(I.STAGE_WIDTH);b.x.animateTo(0,0.5,v.quintOut);
R.delay(function(){b.x.animateTo(I.STAGE_WIDTH,0.5,v.quintOut)},2500)},createScene:function(a){var b=this;a.assets&&this.context.gameLayer.addChild(this.createSprite({name:a.assets,x:0,y:0}));for(var c=0,d=a.board.length;c<d;){var e=c++,e=a.board[e],h=this.createSprite(e);h.add(new La);if(2==this.context.levelNum){var i=new tb;this.context.selectedConnections.push(i.selected.connect(function(a){b.context.handleDrop(a)}))}else{var i=new ub,j=i.dragSignal.connect(function(a){2!=b.context.levelNum&&
b.context.gameLayer.addChild(a)}),k=i.dropSignal.connect(function(a){g.hasConsole&&g.callConsole("log",["Drop"]);g.print(q.log,["Drop"],{fileName:"CreateSceneCommand.hx",lineNumber:122,className:"game.commands.CreateSceneCommand",methodName:"createScene"});g.log(b.context.nameByEntity.h[a.__id__],{fileName:"CreateSceneCommand.hx",lineNumber:123,className:"game.commands.CreateSceneCommand",methodName:"createScene"});b.context.handleDrop(a)});this.context.selectedConnections.push(j);this.context.selectedConnections.push(k)}h.add(i);
i=e.name;this.context.nameByEntity.set(h,i);i;this.context.entityByName.set(e.name,h);h;this.context.configByName.set(e.name,e);e}},__class__:nb});var pb=function(){};e["game.commands.EndOfGameCommand"]=pb;pb.__name__=["game","commands","EndOfGameCommand"];pb.__super__=z;pb.prototype=o(z.prototype,{execute:function(){var a=this;this.context.pack.getSound("success").play();this.context.gameLoopPlayback.volume.animateTo(0,1);this.context.cleanUp();R.delay(function(){Q.show(a.context.eogMsg);a.context.gameLoopPlayback.set_paused(!0);
a.context.gameLoopPlayback.dispose()},0)},__class__:pb});var ob=function(){};e["game.commands.RestartGameCommand"]=ob;ob.__name__=["game","commands","RestartGameCommand"];ob.__super__=z;ob.prototype=o(z.prototype,{execute:function(){this.context.gameLoop=this.context.pack.getSound("gameLoop");n.restart(this.context.gameLoop);this.context.progress=0;this.context.levelNum=0;this.context.cleanUp();this.context.createScene()},__class__:ob});var ub=function(){this.dropSignal=new l;this.dragSignal=new l;
this.updateSignal=new l;u.call(this);this.scale=I.getActualScale()};e["game.components.Draggable"]=ub;ub.__name__=["game","components","Draggable"];ub.__super__=u;ub.prototype=o(u.prototype,{get_name:function(){return"Draggable_1"},onPointerDown:function(a){var b=this.owner._compMap.Sprite_4;this._offset=new za(a.viewX/this.scale.sx-b.x._value,a.viewY/this.scale.sy-b.y._value);this._start=this._dragging=!0;j._platform.getMouse().set_cursor(O.Button)},onUpdate:function(){if(this._dragging)if(j._platform.getPointer().isDown()){var a=
this.owner._compMap.Sprite_4;a.setXY(j._platform.getPointer().get_x()/this.scale.sx-this._offset.x,j._platform.getPointer().get_y()/this.scale.sy-this._offset.y);this.updateSignal.emit(a);this._start&&(this.dragSignal.emit(this.owner),this._start=!1)}else this._dragging=this._start=!1,j._platform.getMouse().set_cursor(O.Default),this.dropSignal.emit(this.owner)},onAdded:function(){this._connection=this.owner._compMap.Sprite_4.get_pointerDown().connect(la(this,this.onPointerDown))},onRemoved:function(){this._connection.dispose()},
__class__:ub});var tb=function(){this.selected=new l;u.call(this)};e["game.components.Selectable"]=tb;tb.__name__=["game","components","Selectable"];tb.__super__=u;tb.prototype=o(u.prototype,{get_name:function(){return"Selectable_0"},onPointerDown:function(){this.selected.emit(this.owner)},onAdded:function(){this._connection=this.owner._compMap.Sprite_4.get_pointerDown().connect(la(this,this.onPointerDown))},onRemoved:function(){this._connection.dispose()},__class__:tb});var La=function(){u.call(this)};
e["game.components.UseHandCursor"]=La;La.__name__=["game","components","UseHandCursor"];La.__super__=u;La.prototype=o(u.prototype,{get_name:function(){return"UseHandCursor_2"},onAdded:function(){var a=this.owner._compMap.Sprite_4;this._connectionIn=a.get_pointerIn().connect(function(){j._platform.getMouse().set_cursor(O.Button)});this._connectionOut=a.get_pointerOut().connect(function(){j._platform.getMouse().set_cursor(O.Default)});this._connectionMove=a.get_pointerMove().connect(function(){j._platform.getMouse().set_cursor(O.Button)})},
onRemoved:function(){var a=this.owner._compMap.Sprite_4;a.get_pointerIn().disconnect(this._connectionIn);a.get_pointerOut().disconnect(this._connectionOut);a.get_pointerMove().disconnect(this._connectionMove)},__class__:La});var $b=function(){};e["game.entities.GameScene"]=$b;$b.__name__=["game","entities","GameScene"];$b.create=function(a){return(new G).add(new va).add(new X(a.getTexture("game")))};var Q=function(){};e["game.entities.Overlay"]=Q;Q.__name__=["game","entities","Overlay"];Q.create=
function(a,b){var c=(new G).add(new k),d=new X(b.getTexture(a.msgTexture)),d=(new G).add(d),e=null;if(a.hasButton){e=(new G).add(new X(b.getTexture(a.buttonTexture)));e.add(new La);var h=e._compMap.Sprite_4;h.setXY(a.buttonX,a.buttonY);h.get_pointerDown().connect(function(){a.downSignal.emit(Q.active);t.onClick.emit(aa.getInstance())})}c.addChild(d);a.hasButton&&c.addChild(e);c._compMap.Sprite_4.x.set__(I.STAGE_WIDTH);return c};Q.show=function(a,b){null==b&&(b=!0);a._compMap.Sprite_4.x.set__(I.STAGE_WIDTH);
a._compMap.Sprite_4.x.animateTo(0,b?0.5:0,v.quintOut);Q.active=a};Q.hide=function(a){a._compMap.Sprite_4.x.animateTo(I.STAGE_WIDTH,0.5,v.quintOut)};var Zb=function(){};e["game.entities.SplashScene"]=Zb;Zb.__name__=["game","entities","SplashScene"];Zb.create=function(a){var b=new va(!1),a=new X(a.getTexture("splash"));return(new G).add(b).add(a)};var Pb=function(){};e["haxe.Log"]=Pb;Pb.__name__=["haxe","Log"];Pb.trace=function(a,b){x.__trace(a,b)};var R=function(a){var b=this;this.id=setInterval(function(){b.run()},
a)};e["haxe.Timer"]=R;R.__name__=["haxe","Timer"];R.delay=function(a,b){var c=new R(b);c.run=function(){c.stop();a()};return c};R.prototype={stop:function(){null!=this.id&&(clearInterval(this.id),this.id=null)},run:function(){},__class__:R};var sa=function(){this.h={}};e["haxe.ds.IntMap"]=sa;sa.__name__=["haxe","ds","IntMap"];sa.__interfaces__=[wa];sa.prototype={set:function(a,b){this.h[a]=b},get:function(a){return this.h[a]},exists:function(a){return this.h.hasOwnProperty(a)},remove:function(a){if(!this.h.hasOwnProperty(a))return!1;
delete this.h[a];return!0},keys:function(){var a=[],b;for(b in this.h)this.h.hasOwnProperty(b)&&a.push(b|0);return A.iter(a)},__class__:sa};var ka=function(){this.h={};this.h.__keys__={}};e["haxe.ds.ObjectMap"]=ka;ka.__name__=["haxe","ds","ObjectMap"];ka.__interfaces__=[wa];ka.prototype={set:function(a,b){var c=a.__id__||(a.__id__=++ka.count);this.h[c]=b;this.h.__keys__[c]=a},get:function(a){return this.h[a.__id__]},keys:function(){var a=[],b;for(b in this.h.__keys__)this.h.hasOwnProperty(b)&&a.push(this.h.__keys__[b]);
return A.iter(a)},__class__:ka};var V=function(){this.h={}};e["haxe.ds.StringMap"]=V;V.__name__=["haxe","ds","StringMap"];V.__interfaces__=[wa];V.prototype={set:function(a,b){this.h["$"+a]=b},get:function(a){return this.h["$"+a]},keys:function(){var a=[],b;for(b in this.h)this.h.hasOwnProperty(b)&&a.push(b.substr(1));return A.iter(a)},iterator:function(){return{ref:this.h,it:this.keys(),hasNext:function(){return this.it.hasNext()},next:function(){return this.ref["$"+this.it.next()]}}},__class__:V};
var bc=function(){};e["haxe.io.Bytes"]=bc;bc.__name__=["haxe","io","Bytes"];var ac=function(){};e["haxe.io.Eof"]=ac;ac.__name__=["haxe","io","Eof"];ac.prototype={toString:function(){return"Eof"},__class__:ac};var Ub=function(){};e["haxe.rtti.Meta"]=Ub;Ub.__name__=["haxe","rtti","Meta"];Ub.getType=function(a){a=a.__meta__;return null==a||null==a.obj?{}:a.obj};var x=function(){};e["js.Boot"]=x;x.__name__=["js","Boot"];x.__unhtml=function(a){return a.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")};
x.__trace=function(a,b){var c;c=null!=b?b.fileName+":"+b.lineNumber+": ":"";c+=x.__string_rec(a,"");if(null!=b&&null!=b.customParams)for(var d=0,e=b.customParams;d<e.length;){var h=e[d];++d;c+=","+x.__string_rec(h,"")}var g;"undefined"!=typeof document&&null!=(g=document.getElementById("haxe:trace"))?g.innerHTML+=x.__unhtml(c)+"<br/>":"undefined"!=typeof console&&null!=console.log&&console.log(c)};x.getClass=function(a){return a instanceof Array&&null==a.__enum__?Array:a.__class__};x.__string_rec=
function(a,b){if(null==a)return"null";if(5<=b.length)return"<...>";var c=typeof a;if("function"==c&&(a.__name__||a.__ename__))c="object";switch(c){case "object":if(a instanceof Array){if(a.__enum__){if(2==a.length)return a[0];for(var c=a[0]+"(",b=b+"\t",d=2,e=a.length;d<e;)var h=d++,c=2!=h?c+(","+x.__string_rec(a[h],b)):c+x.__string_rec(a[h],b);return c+")"}c=a.length;d="[";b+="\t";for(e=0;e<c;)h=e++,d+=(0<h?",":"")+x.__string_rec(a[h],b);return d+"]"}try{d=a.toString}catch(g){return"???"}if(null!=
d&&d!=Object.toString&&(c=a.toString(),"[object Object]"!=c))return c;c=null;d="{\n";b+="\t";e=null!=a.hasOwnProperty;for(c in a)if(!e||a.hasOwnProperty(c))"prototype"==c||"__class__"==c||"__super__"==c||"__interfaces__"==c||"__properties__"==c||(2!=d.length&&(d+=", \n"),d+=b+c+" : "+x.__string_rec(a[c],b));b=b.substring(1);return d+("\n"+b+"}");case "function":return"<function>";case "string":return a;default:return""+a}};x.__interfLoop=function(a,b){if(null==a)return!1;if(a==b)return!0;var c=a.__interfaces__;
if(null!=c)for(var d=0,e=c.length;d<e;){var h=d++,h=c[h];if(h==b||x.__interfLoop(h,b))return!0}return x.__interfLoop(a.__super__,b)};x.__instanceof=function(a,b){if(null==b)return!1;switch(b){case fc:return(a|0)===a;case cc:return"number"==typeof a;case dc:return"boolean"==typeof a;case String:return"string"==typeof a;case Array:return a instanceof Array&&null==a.__enum__;case gc:return!0;default:if(null!=a){if("function"==typeof b&&(a instanceof b||x.__interfLoop(x.getClass(a),b)))return!0}else return!1;
return b==hc&&null!=a.__name__||b==ic&&null!=a.__ename__?!0:a.__enum__==b}};var Tb=function(){};e["js.html._CanvasElement.CanvasUtil"]=Tb;Tb.__name__=["js","html","_CanvasElement","CanvasUtil"];Tb.getContextWebGL=function(a,b){for(var c=0,d=["webgl","experimental-webgl"];c<d.length;){var e=d[c];++c;e=a.getContext(e,b);if(null!=e)return e}return null};var Ma=function(){this.printLineNumbers=this.printPosition=!0};e["mconsole.PrinterBase"]=Ma;Ma.__name__=["mconsole","PrinterBase"];Ma.prototype={print:function(a,
b,c,d){for(var b=b.slice(),e=0,h=b.length;e<h;){var g=e++;b[g]=T.string(b[g])}var b=b.join(", "),g="@ "+d.className+"."+d.methodName,i;i=null==d.lineNumber?"null":""+d.lineNumber;h=e="";this.printPosition&&g!=this.position&&this.printLine(w.none,g,d);this.printLineNumbers&&(h=fa.lpad(""," ",5),e=g!=this.position||i!=this.lineNumber?fa.lpad(i," ",4)+" ":h);this.position=g;this.lineNumber=i;var j;switch(a[1]){case 0:j=w.white;break;case 1:j=w.blue;break;case 2:j=w.green;break;case 3:j=w.yellow;break;
case 4:j=w.red}a=fa.lpad(""," ",2*c);b=(e+a+b).split("\n").join("\n"+h+a);this.printLine(j,b,d)},printLine:function(){throw"method not implemented in ConsolePrinterBase";},__class__:Ma};var Qb=function(){};e["mconsole.Printer"]=Qb;Qb.__name__=["mconsole","Printer"];Qb.prototype={__class__:Qb};var Na=function(){Ma.call(this);this.atBottom=!0;this.projectHome="/Users/lukaszhulanicki/Work/gry_flash/wgospodarstwie/";var a=window.document;this.element=a.createElement("pre");this.element.id="console";var b=
a.createElement("style");this.element.appendChild(b);a=a.createTextNode("#console {\n\tfont-family:monospace;\n\tbackground-color:#002B36;\n\tbackground-color:rgba(0%,16.9%,21.2%,0.95);\n\tpadding:8px;\n\theight:600px;\n\tmax-height:600px;\n\toverflow-y:scroll;\n\tposition:absolute;\n\tleft:0px;\n\ttop:0px;\n\tright:0px;\n\tmargin:0px;\n\tz-index:10000;\n}\n#console a { text-decoration:none; }\n#console a:hover div { background-color:#063642 }\n#console a div span { display:none; float:right; color:white; }\n#console a:hover div span { display:block; }");
b.type="text/css";b.styleSheet?b.styleSheet.cssText=a.nodeValue:b.appendChild(a);var c=this;this.element.onscroll=function(){c.updateScroll()}};e["mconsole.ConsoleView"]=Na;Na.__name__=["mconsole","ConsoleView"];Na.__interfaces__=[Qb];Na.__super__=Ma;Na.prototype=o(Ma.prototype,{updateScroll:function(){this.atBottom=0==this.element.scrollTop-(this.element.scrollHeight-this.element.clientHeight)},printLine:function(a,b,c){var d;switch(a[1]){case 0:d="#839496";break;case 1:d="#ffffff";break;case 2:d=
"#248bd2";break;case 3:d="#859900";break;case 4:d="#b58900";break;case 5:d="#dc322f"}a=c.fileName+":"+c.lineNumber;c.className.split(".").join("/");this.element.innerHTML=this.element.innerHTML+"<a><div style='color:"+d+"'>"+b+"<span>"+a+"</span></div></a>";this.atBottom&&(this.element.scrollTop=this.element.scrollHeight)},__class__:Na});var g=function(){};e["mconsole.Console"]=g;g.__name__=["mconsole","Console"];g.start=function(){g.running||(g.running=!0,g.previousTrace=Pb.trace,Pb.trace=g.haxeTrace)};
g.haxeTrace=function(a,b){var c=b.customParams;null==c?c=[]:b.customParams=null;var d;switch(a){case "log":d=q.log;break;case "warn":d=q.warn;break;case "info":d=q.info;break;case "debug":d=q.debug;break;case "error":d=q.error;break;default:c.unshift(a),d=q.log}g.hasConsole&&g.callConsole(T.string(d),c);g.print(d,c,b)};g.print=function(a,b,c){for(var d=0,e=g.printers;d<e.length;){var h=e[d];++d;h.print(a,b,g.groupDepth,c)}};g.log=function(a,b){g.hasConsole&&g.callConsole("log",[a]);g.print(q.log,
[a],b)};g.detectConsole=function(){null!=console&&null==console[g.dirxml]&&(g.dirxml="log");return void 0!=console&&void 0!=console.log&&void 0!=console.warn};g.callConsole=function(a,b){null!=console[a]&&("log"==a&&x.__instanceof(b[0],ba)&&(a=g.dirxml),null!=console[a].apply?console[a].apply(console,g.toConsoleValues(b)):null!=Function.prototype.bind&&Function.prototype.bind.call(console[a],console).apply(console,g.toConsoleValues(b)))};g.toConsoleValues=function(a){for(var b=0,c=a.length;b<c;){var d=
b++;a[d]=g.toConsoleValue(a[d])}return a};g.toConsoleValue=function(a){var b=E.getClass(a),b=null==b?"":E.getClassName(b);if("Xml"==b)return(new DOMParser).parseFromString(a.toString(),"text/xml").firstChild;if("Map"==b||"StringMap"==b||"IntMap"==b){for(var b={},c=a.keys();c.hasNext();){var d=c.next();S.setField(b,T.string(d),g.toConsoleValue(a.get(d)))}return b}c=E["typeof"](a);switch(c[1]){case 7:b=[];c=E.getEnumName(c[2])+"."+E.enumConstructor(a);a=E.enumParameters(a);if(0<a.length){b.push(c+"(");
c=0;for(d=a.length;c<d;){var e=c++;b.push(g.toConsoleValue(a[e]))}b.push(")")}else return[c];return b}if("Array"==b||"List"==b||"haxe.FastList"==b){b=[];for(a=Rb(a)();a.hasNext();)c=a.next(),b.push(g.toConsoleValue(c));return b}return a};var q=e["mconsole.LogLevel"]={__ename__:["mconsole","LogLevel"],__constructs__:["log","info","debug","warn","error"]};q.log=["log",0];q.log.__enum__=q;q.info=["info",1];q.info.__enum__=q;q.debug=["debug",2];q.debug.__enum__=q;q.warn=["warn",3];q.warn.__enum__=q;q.error=
["error",4];q.error.__enum__=q;var w=e["mconsole.ConsoleColor"]={__ename__:["mconsole","ConsoleColor"],__constructs__:"none,white,blue,green,yellow,red".split(",")};w.none=["none",0];w.none.__enum__=w;w.white=["white",1];w.white.__enum__=w;w.blue=["blue",2];w.blue.__enum__=w;w.green=["green",3];w.green.__enum__=w;w.yellow=["yellow",4];w.yellow.__enum__=w;w.red=["red",5];w.red.__enum__=w;var ec=0;Math.NaN=Number.NaN;Math.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY;Math.POSITIVE_INFINITY=Number.POSITIVE_INFINITY;
e.Math=Math;Math.isFinite=function(a){return isFinite(a)};Math.isNaN=function(a){return isNaN(a)};String.prototype.__class__=e.String=String;String.__name__=["String"];e.Array=Array;Array.__name__=["Array"];Date.prototype.__class__=e.Date=Date;Date.__name__=["Date"];var fc=e.Int={__name__:["Int"]},gc=e.Dynamic={__name__:["Dynamic"]},cc=e.Float=Number;cc.__name__=["Float"];var dc=e.Bool=Boolean;dc.__ename__=["Bool"];var hc=e.Class={__name__:["Class"]},ic={};ba.Element="element";ba.PCData="pcdata";
ba.CData="cdata";ba.Comment="comment";ba.DocType="doctype";ba.ProcessingInstruction="processingInstruction";ba.Document="document";ca.instance=new ca;y.DISPATCHING_SENTINEL=new qa(null,null);j.root=new G;j.uncaughtError=new l;j.hidden=new H(!1);j.volume=new B(1);j._platform=ca.instance;j._calledInit=!1;J.__meta__={obj:{assets:[{settings:[{bytes:4865,md5:"6c37ae3a14d8238de92f33fafa08ad24",name:"model.json"}],bootstrap:[{bytes:5031,md5:"6ce6bfd1a8dc619872697a7d53f7155e",name:"splash.png"}],game:[{bytes:6796,
md5:"6b14c854a01ec4fe5a9baad20de3055a",name:"bee.png"},{bytes:5554,md5:"622789200d2b9ff653580ba7133a3482",name:"btnrestart.png"},{bytes:4471,md5:"06e02a34db8a24cb272d0541bc493b6a",name:"btnstart.png"},{bytes:12382,md5:"c4b19d7bd0fdd2cf74ac94425c3451fd",name:"cat.png"},{bytes:7555,md5:"f73b552aa0bcba2e96422f85a384635d",name:"cat_small.png"},{bytes:11280,md5:"2bdba009f4a9713e3e6f62afa6c0650e",name:"chicken.png"},{bytes:4042,md5:"195f6977ff784753948df4785b92cedb",name:"chicken_small.png"},{bytes:5160,
md5:"167b5dad6c8a515d27aa73c6d4237961",name:"click.mp3"},{bytes:16139,md5:"d9bd73e4491be84d518ee7fb6a317278",name:"click.ogg"},{bytes:21816,md5:"e8379e28d0102d7ac7e5c683b1d6c01b",name:"cow.png"},{bytes:9453,md5:"236e9c7a62ec00f9301c9f3a344d7989",name:"cow_small.png"},{bytes:10662,md5:"879c568d68782962a1be933ebcf645f1",name:"dog.png"},{bytes:6626,md5:"ef0c47b1334b32700d08215733eff737",name:"dog_small.png"},{bytes:9130,md5:"3ba7cee689c2e2c05e6add50118cc661",name:"duck.png"},{bytes:4890,md5:"19fae83e254fb12c9ab346286f6a446d",
name:"duck_small.png"},{bytes:5850,md5:"b3eb3f86938f1addc1743907cdb2627d",name:"failed.mp3"},{bytes:14182,md5:"f71dc122314ba39bf11f2aa4c38f4018",name:"failed.ogg"},{bytes:217700,md5:"cba81a59921ab0d0146d5b3a011376e7",name:"game.png"},{bytes:111594,md5:"519ee70bcf526b49a132de531a4ddb9d",name:"gameLoop.mp3"},{bytes:92154,md5:"9ae84da38d4eb00b900ce576cf4e3058",name:"gameLoop.ogg"},{bytes:17107,md5:"7178a98c754068b27f676e1084b9c958",name:"goat.png"},{bytes:8191,md5:"3f5274d4ded868b548dc610f77926913",
name:"goat_small.png"},{bytes:26088,md5:"73982bbabb207d1c69d359ac50895e38",name:"horse.png"},{bytes:9047,md5:"7b53672d77b89da06b3f0727accc327d",name:"horse_small.png"},{bytes:16790,md5:"269a8d0b048ee33996f90ad0ba23838b",name:"item_beehive.png"},{bytes:11817,md5:"c2f34ca7edd86bb5c194bdf6700af502",name:"item_doghut.png"},{bytes:2058,md5:"57d0032dc1b912388a82f46f6919880d",name:"item_egg.png"},{bytes:2080,md5:"3437777914ed6e141f25052fe4f73295",name:"item_milk.png"},{bytes:4086,md5:"7bf4193aa6dc892f65a4cfbbd028f3cb",
name:"item_mouse.png"},{bytes:12815,md5:"cf28d259c5a2920781ce0f81ac5db2f2",name:"item_saddle.png"},{bytes:5547,md5:"bff72e1bc2bf370f6e11ae0188a2cb98",name:"item_wool.png"},{bytes:34025,md5:"98c6cc9ba42bbff28f99ead8a7b4d99f",name:"l1_help.png"},{bytes:34803,md5:"652a9f302507a2dbfc3bbe758f496625",name:"l2_help.png"},{bytes:81413,md5:"9c9ee35821c338f0a5115d48551f0ba8",name:"l3_assets.png"},{bytes:36712,md5:"b2914916eec03dce9fcdfcf1b5fa138e",name:"l3_help.png"},{bytes:3282,md5:"64c2e539a124df3b8c65921a17250723",
name:"level-off.png"},{bytes:3547,md5:"ecb138f8b4cacac8502da78fcbe875a1",name:"level-on.png"},{bytes:4527,md5:"a2ec0f029203a707e95557e39740d86e",name:"model.json"},{bytes:32666,md5:"67f7a51faabca323013888c130c2b005",name:"msgEnd.png"},{bytes:24047,md5:"4e56059d57b6d36a6b9aaf8d96a283e4",name:"msgFailure.png"},{bytes:123452,md5:"f0b688d1da25e1081277e42311557502",name:"msgStart.png"},{bytes:5366,md5:"df92cc36ec48b7e182d0b0082c7ade8c",name:"pig.png"},{bytes:9802,md5:"6bc1ee0266ce2ff62265a80cf4b640d5",
name:"pig_small.png"},{bytes:13437,md5:"27fe1394b5bd03e6cd725c5aacc1ec5e",name:"sheep.png"},{bytes:12476,md5:"ba6a427734a6895da5d00b343ac04609",name:"sheep_small.png"},{bytes:11586,md5:"e5060dbc32d991a414d95b8b16bdd952",name:"snd_bee.mp3"},{bytes:8945,md5:"5f0eb796f193cabfb764c16fb6ee8e3f",name:"snd_bee.ogg"},{bytes:20965,md5:"5a53a098cb0a027ced6aa78ca2ea39c1",name:"snd_cat_small.mp3"},{bytes:28133,md5:"7c451087a5cce3fdf0dedf8ff8c6955d",name:"snd_cat_small.ogg"},{bytes:17553,md5:"ecba887884b0ccd97e2a9a7cfccb39eb",
name:"snd_chicken.mp3"},{bytes:15692,md5:"101b3f52131436c2315dad81c876b043",name:"snd_chicken.ogg"},{bytes:12537,md5:"bca409202202c99314ddc1b28223bc4d",name:"snd_cow.mp3"},{bytes:11902,md5:"b7d9a02c9b92aba4cfa00020e13a9a08",name:"snd_cow.ogg"},{bytes:28888,md5:"b24d91945e04a20bdb2b035773068a3b",name:"snd_dog.mp3"},{bytes:45182,md5:"5ee25fde531b901bc6878925cb782b21",name:"snd_dog.ogg"},{bytes:17553,md5:"2f469eafb303a74b27780601e455b060",name:"snd_duck.mp3"},{bytes:15427,md5:"88fe2846bfc33aee9b3d398ab7beb2b7",
name:"snd_duck.ogg"},{bytes:13791,md5:"c2eeaeaacbde91a3567d65d6ff3b423c",name:"snd_goat.mp3"},{bytes:12949,md5:"5413e7bcd60c058e8e0854aa54f9f499",name:"snd_goat.ogg"},{bytes:52657,md5:"5a2451f106cd453b343eab77bbc506d4",name:"snd_horse.mp3"},{bytes:71649,md5:"dda6bff164eef6b62073b14e5fa29146",name:"snd_horse.ogg"},{bytes:33853,md5:"d9803f045f50ac00f6337c9977b6d5c4",name:"snd_pig.mp3"},{bytes:28648,md5:"0215bf4947a1560934e198e8ec45b027",name:"snd_pig.ogg"},{bytes:10448,md5:"d28222c234da40760efce400812b7450",
name:"snd_sheep.mp3"},{bytes:10468,md5:"66a3a578a3b9faf960356c369b305a06",name:"snd_sheep.ogg"},{bytes:784,md5:"c02ae3be15b679225b04099203603ebe",name:"soundOff.png"},{bytes:667,md5:"f9dfada65948219df8e20962cf5a774d",name:"soundOn.png"},{bytes:22568,md5:"45265b042410cfcd6a4cf62b713b67a5",name:"success-minor.mp3"},{bytes:14512,md5:"6e5adf30af7cd67ec44f9c5ffbcc5c90",name:"success-minor.ogg"},{bytes:35622,md5:"69dfd3a83be47099959a15187892545d",name:"success.mp3"},{bytes:32634,md5:"a846aa821ae4331fb49873cae1e865c2",
name:"success.ogg"}]}]}};J._supportsCrossOrigin=function(){var a;a=0<=window.navigator.userAgent.indexOf("Linux; U; Android")?!1:null!=(new XMLHttpRequest).withCredentials;a||null;return a}();k._scratchPoint=new za;L._sharedEvent=new Cb;F._sharedEvent=new Db;pa.CANVAS_TEXTURES=(new ma("(iPhone|iPod|iPad)","")).match(window.navigator.userAgent);r._mediaRefCount=0;r._detectBlobSupport=!0;m.VENDOR_PREFIXES=["webkit","moz","ms","o","khtml"];m.SHOULD_HIDE_MOBILE_BROWSER=window.top==window&&(new ma("Mobile(/.*)? Safari",
"")).match(window.navigator.userAgent);s._detectSupport=!0;W._scratchMatrix=new U;t.onBootstrapAssetsReady=new l;t.onGameAssetsReady=new l;t.onContextReady=new l;t.onOverlaysCreateRequest=new l;t.onCreateSceneRequest=new l;t.onRestartGame=new l;t.onEndOfGame=new l;t.onClick=new l;t.onSuccessMinor=new l;t.onFailure=new l;ka.count=0;g.defaultPrinter=new Na;g.printers=[g.defaultPrinter];g.groupDepth=0;g.running=!1;g.dirxml="dirxml";g.hasConsole=g.detectConsole();Ka.main()})();
