/** Cooked with Flambe, https://getflambe.com */
'use strict';(function(){function m(a,b){function c(){}c.prototype=a;var d=new c,g;for(g in b)d[g]=b[g];b.toString!==Object.prototype.toString&&(d.toString=b.toString);return d}function Tb(a){return a instanceof Array?function(){return A.iter(a)}:"function"==typeof a.iterator?xa(a,a.iterator):a.iterator}function xa(a,b){if(null==b)return null;null==b.__id__&&(b.__id__=gc++);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={},na=function(a,b){b=b.split("u").join("");this.r=RegExp(a,b)};e.EReg=na;na.__name__=["EReg"];na.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__:na};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 Na=function(){};e.Lambda=Na;Na.__name__=["Lambda"];Na.array=function(a){for(var b=[],a=Tb(a)();a.hasNext();){var c=a.next();b.push(c)}return b};Na.count=function(a,b){var c=0;if(null==
b)for(var d=Tb(a)();d.hasNext();)d.next(),c++;else for(d=Tb(a)();d.hasNext();){var g=d.next();b(g)&&c++}return c};var ya=function(){};e.IMap=ya;ya.__name__=["IMap"];ya.prototype={__class__:ya};Math.__name__=["Math"];var ea=function(){};e.Reflect=ea;ea.__name__=["Reflect"];ea.field=function(a,b){try{return a[b]}catch(c){return null}};ea.setField=function(a,b,c){a[b]=c};var R=function(){};e.Std=R;R.__name__=["Std"];R.is=function(a,b){return w.__instanceof(a,b)};R.string=function(a){return w.__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 n=e.ValueType={__ename__:["ValueType"],__constructs__:"TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(",")};n.TNull=["TNull",0];n.TNull.__enum__=n;n.TInt=["TInt",1];n.TInt.__enum__=n;n.TFloat=["TFloat",2];n.TFloat.__enum__=n;n.TBool=["TBool",
3];n.TBool.__enum__=n;n.TObject=["TObject",4];n.TObject.__enum__=n;n.TFunction=["TFunction",5];n.TFunction.__enum__=n;n.TClass=function(a){a=["TClass",6,a];a.__enum__=n;return a};n.TEnum=function(a){a=["TEnum",7,a];a.__enum__=n;return a};n.TUnknown=["TUnknown",8];n.TUnknown.__enum__=n;var F=function(){};e.Type=F;F.__name__=["Type"];F.getClass=function(a){return null==a?null:a instanceof Array&&null==a.__enum__?Array:a.__class__};F.getClassName=function(a){return a.__name__.join(".")};F.getEnumName=
function(a){return a.__ename__.join(".")};F.resolveClass=function(a){a=e[a];return null==a||!a.__name__?null:a};F.resolveEnum=function(a){a=e[a];return null==a||!a.__ename__?null:a};F.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";}};F["typeof"]=function(a){switch(typeof a){case "boolean":return n.TBool;case "string":return n.TClass(String);case "number":return Math.ceil(a)==a%2147483648?n.TInt:n.TFloat;case "object":if(null==a)return n.TNull;var b=a.__enum__;if(null!=b)return n.TEnum(b);a=a instanceof Array&&null==a.__enum__?Array:a.__class__;return null!=a?n.TClass(a):n.TObject;case "function":return a.__name__||
a.__ename__?n.TObject:n.TFunction;case "undefined":return n.TNull;default:return n.TUnknown}};F.enumConstructor=function(a){return a[0]};F.enumParameters=function(a){return a.slice(2)};e.XmlType={__ename__:["XmlType"],__constructs__:[]};var aa=function(){};e.Xml=aa;aa.__name__=["Xml"];var Y=function(){};e["flambe.util.Disposable"]=Y;Y.__name__=["flambe","util","Disposable"];Y.prototype={__class__:Y};var x=function(){this._flags=0;this.owner=this.next=null};e["flambe.Component"]=x;x.__name__=["flambe",
"Component"];x.__interfaces__=[Y];x.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__:x};var B=function(){this.parent=this.firstChild=this.next=this.firstComponent=null;this._compMap={}};e["flambe.Entity"]=B;B.__name__=["flambe","Entity"];B.__interfaces__=[Y];B.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__:B};var Ub=function(){};e["flambe.util.PackageLog"]=Ub;Ub.__name__=["flambe","util","PackageLog"];var vb=function(){};e["flambe.platform.Platform"]=vb;vb.__name__=["flambe","platform","Platform"];vb.prototype={__class__:vb};var ba=function(){};e["flambe.platform.html.HtmlPlatform"]=ba;ba.__name__=["flambe","platform","html","HtmlPlatform"];ba.__interfaces__=[vb];ba.prototype=
{init:function(){var a=this;l.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 oa(b);this._pointer=new G;this._mouse=new Oa(this._pointer,b);this._renderer=this.createRenderer(b);this.mainLoop=new pa;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,g=function(c){if(!(1E3>c.timeStamp-d)){var g=b.getBoundingClientRect(),f=a.getX(c,g),g=a.getY(c,g);switch(c.type){case "mousedown":c.target==b&&(c.preventDefault(),a._mouse.submitDown(f,g,c.button),b.focus());break;case "mousemove":a._mouse.submitMove(f,g);break;case "mouseup":a._mouse.submitUp(f,g,c.button);break;case "mousewheel":case "DOMMouseScroll":a._mouse.submitScroll(f,g,"mousewheel"==c.type?c.wheelDelta/40:-c.detail)&&c.preventDefault()}}};
window.addEventListener("mousedown",g,!1);window.addEventListener("mousemove",g,!1);window.addEventListener("mouseup",g,!1);b.addEventListener("mousewheel",g,!1);b.addEventListener("DOMMouseScroll",g,!1);b.addEventListener("contextmenu",function(a){a.preventDefault()},!1);var f="undefined"!=typeof window.ontouchstart,g="msMaxTouchPoints"in window.navigator&&1<window.navigator.msMaxTouchPoints;if(f||g){var e=new Pa(this._pointer,f?4:window.navigator.msMaxTouchPoints);this._touch=e;g=function(b){var c;
c=f?b.changedTouches:[b];var g=b.target.getBoundingClientRect();d=b.timeStamp;switch(b.type){case "touchstart":case "MSPointerDown":case "pointerdown":b.preventDefault();l.SHOULD_HIDE_MOBILE_BROWSER&&l.hideMobileBrowser();for(b=0;b<c.length;){var h=c[b];++b;var i=a.getX(h,g),wb=a.getY(h,g);e.submitDown((f?h.identifier:h.pointerId)|0,i,wb)}break;case "touchmove":case "MSPointerMove":case "pointermove":b.preventDefault();for(b=0;b<c.length;)h=c[b],++b,i=a.getX(h,g),wb=a.getY(h,g),e.submitMove((f?h.identifier:
h.pointerId)|0,i,wb);break;case "touchend":case "touchcancel":case "MSPointerUp":case "pointerup":for(b=0;b<c.length;)h=c[b],++b,i=a.getX(h,g),wb=a.getY(h,g),e.submitUp((f?h.identifier:h.pointerId)|0,i,wb)}};f?(b.addEventListener("touchstart",g,!1),b.addEventListener("touchmove",g,!1),b.addEventListener("touchend",g,!1),b.addEventListener("touchcancel",g,!1)):(b.addEventListener("MSPointerDown",g,!1),b.addEventListener("MSPointerMove",g,!1),b.addEventListener("MSPointerUp",g,!1))}else this._touch=
new Qa;var h=window.onerror;window.onerror=function(a,b,c){j.uncaughtError.emit(a);return null!=h?h(a,b,c):!1};var i=l.loadExtension("hidden",window.document);null!=i.value?(g=function(){j.hidden.set__(ea.field(window.document,i.field))},g(null),window.document.addEventListener(i.prefix+"visibilitychange",g,!1)):(g=function(a){j.hidden.set__("pagehide"==a.type)},window.addEventListener("pageshow",g,!1),window.addEventListener("pagehide",g,!1));j.hidden.get_changed().connect(function(b){b||(a._skipFrame=
!0)});this._skipFrame=!1;this._lastUpdate=Date.now();var k=l.loadExtension("requestAnimationFrame").value;if(null!=k){var m=window.performance,o=null!=m&&l.polyfill("now",m);o?this._lastUpdate=m.now():null;var n=null,n=function(c){a.update(o?m.now():c);k(n,b)};k(n,b)}else window.setInterval(function(){a.update(Date.now())},16);za.info("Initialized HTML platform",["renderer",this._renderer.get_type()])},loadAssetPack:function(a){return(new p(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=
Vb.getContextWebGL(a,{alpha:!1,depth:!1,failIfMajorPerformanceCaveat:!0});if(null!=b)if(l.detectSlowDriver(b))null;else return new Ra(this._stage,b)}catch(c){}return new qa(a)},__class__:ba};var H=function(a,b){this._value=a;this._changed=null!=b?new Aa(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 Aa);return this._changed},__class__:H};var ra=function(a,b){this._next=null;this._signal=a;this._listener=b;this.stayInList=!0};e["flambe.util.SignalConnection"]=ra;ra.__name__=["flambe","util","SignalConnection"];ra.__interfaces__=[Y];ra.prototype={once:function(){this.stayInList=!1;return this},dispose:function(){null!=this._signal&&(this._signal.disconnect(this),this._signal=null)},__class__:ra};var y=function(a){this._head=
null!=a?new ra(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 ra(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 Aa=function(a){y.call(this,a)};e["flambe.util.Signal2"]=Aa;Aa.__name__=["flambe","util","Signal2"];Aa.__super__=y;Aa.prototype=m(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__:Aa});var o=function(a){y.call(this,a)};e["flambe.util.Signal1"]=o;o.__name__=["flambe","util","Signal1"];o.__super__=y;o.prototype=m(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__:o});var C=function(a,
b){this._behavior=null;H.call(this,a,b)};e["flambe.animation.AnimatedFloat"]=C;C.__name__=["flambe","animation","AnimatedFloat"];C.__super__=H;C.prototype=m(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 Sa(this._value,a,b,c))},set_behavior:function(a){this._behavior=
a;this.update(0);return a},__class__:C});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 za=function(){};e["flambe.Log"]=za;za.__name__=["flambe","Log"];za.info=function(){null};za.__super__=Ub;za.prototype=m(Ub.prototype,{__class__:za});var yb=function(){this._realDt=0};e["flambe.SpeedAdjuster"]=yb;yb.__name__=["flambe","SpeedAdjuster"];
yb.__super__=x;yb.prototype=m(x.prototype,{get_name:function(){return"SpeedAdjuster_5"},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 O=function(){};e["flambe.animation.Ease"]=O;O.__name__=["flambe","animation","Ease"];O.linear=function(a){return a};O.quintOut=function(a){return(a-=1)*a*a*a*a+1};O.quintInOut=
function(a){return 1>(a*=2)?a*a*a*a*a/2:((a-=2)*a*a*a*a+2)/2};var Sa=function(a,b,c,d){this._from=a;this._to=b;this._duration=c;this.elapsed=0;this._easing=null!=d?d:O.linear};e["flambe.animation.Tween"]=Sa;Sa.__name__=["flambe","animation","Tween"];Sa.__interfaces__=[zb];Sa.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__:Sa};var ga=function(){};e["flambe.asset.Asset"]=ga;ga.__name__=["flambe","asset","Asset"];ga.__interfaces__=[Y];ga.prototype={__class__:ga};var h=e["flambe.asset.AssetFormat"]={__ename__:["flambe","asset","AssetFormat"],__constructs__:"WEBP,JXR,PNG,JPG,GIF,DDS,PVR,PKM,MP3,M4A,OPUS,OGG,WAV,Data".split(",")};h.WEBP=["WEBP",0];h.WEBP.__enum__=h;h.JXR=["JXR",1];h.JXR.__enum__=h;h.PNG=["PNG",2];h.PNG.__enum__=h;h.JPG=["JPG",3];h.JPG.__enum__=h;h.GIF=["GIF",4];h.GIF.__enum__=h;h.DDS=["DDS",5];
h.DDS.__enum__=h;h.PVR=["PVR",6];h.PVR.__enum__=h;h.PKM=["PKM",7];h.PKM.__enum__=h;h.MP3=["MP3",8];h.MP3.__enum__=h;h.M4A=["M4A",9];h.M4A.__enum__=h;h.OPUS=["OPUS",10];h.OPUS.__enum__=h;h.OGG=["OGG",11];h.OGG.__enum__=h;h.WAV=["WAV",12];h.WAV.__enum__=h;h.Data=["Data",13];h.Data.__enum__=h;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 Ta=function(){};e["flambe.asset.AssetPack"]=
Ta;Ta.__name__=["flambe","asset","AssetPack"];Ta.__interfaces__=[Y];Ta.prototype={__class__:Ta};var Ua=function(){};e["flambe.asset.File"]=Ua;Ua.__name__=["flambe","asset","File"];Ua.__interfaces__=[ga];Ua.prototype={__class__:Ua};var I=function(){this._localBase=this._remoteBase=null;this._entries=[]};e["flambe.asset.Manifest"]=I;I.__name__=["flambe","asset","Manifest"];I.fromAssets=function(a,b){null==b&&(b=!0);var c=ea.field(Wb.getType(I).assets[0],a);if(null==c){if(b)throw J.withFields("Missing asset pack",
["name",a]);return null}var d=new I;d.set_localBase("assets");for(var g=0;g<c.length;){var f=c[g];++g;var e=f.name,i=a+"/"+e+"?v="+R.string(f.md5),j=I.inferFormat(e);j!=h.Data&&(e=J.removeFileExtension(e));d.add(e,i,f.bytes,j)}return d};I.inferFormat=function(a){a=J.getUrlExtension(a);if(null!=a)switch(a.toLowerCase()){case "gif":return h.GIF;case "jpg":case "jpeg":return h.JPG;case "jxr":case "wdp":return h.JXR;case "png":return h.PNG;case "webp":return h.WEBP;case "dds":return h.DDS;case "pvr":return h.PVR;
case "pkm":return h.PKM;case "m4a":return h.M4A;case "mp3":return h.MP3;case "ogg":return h.OGG;case "opus":return h.OPUS;case "wav":return h.WAV}else null;return h.Data};I.prototype={add:function(a,b,c,d){null==c&&(c=0);null==d&&(d=I.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()&&I._supportsCrossOrigin?this.get_remoteBase():this.get_localBase();return null!=b?J.joinPath(b,
a.url):a.url},get_localBase:function(){return this._localBase},set_localBase:function(a){null!=a&&Xb.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__:I};var D=e["flambe.display.BlendMode"]={__ename__:["flambe","display","BlendMode"],__constructs__:"Normal,Add,Multiply,Screen,Mask,Copy".split(",")};D.Normal=["Normal",
0];D.Normal.__enum__=D;D.Add=["Add",1];D.Add.__enum__=D;D.Multiply=["Multiply",2];D.Multiply.__enum__=D;D.Screen=["Screen",3];D.Screen.__enum__=D;D.Mask=["Mask",4];D.Mask.__enum__=D;D.Copy=["Copy",5];D.Copy.__enum__=D;var Bb=function(a,b){null==b&&(b=0);null==a&&(a=0);this.x=a;this.y=b};e["flambe.math.Point"]=Bb;Bb.__name__=["flambe","math","Point"];Bb.prototype={__class__:Bb};var r=function(){this.blendMode=this.scissor=null;var a=this;x.call(this);this._flags|=54;this._localMatrix=new W;var b=function(){a._flags|=
24};this.x=new C(0,b);this.y=new C(0,b);this.rotation=new C(0,b);this.scaleX=new C(1,b);this.scaleY=new C(1,b);this.anchorX=new C(0,b);this.anchorY=new C(0,b);this.alpha=new C(1)};e["flambe.display.Sprite"]=r;r.__name__=["flambe","display","Sprite"];r.hitTest=function(a,b,c){var d=a._compMap.Sprite_3;if(null!=d){if(6!=(d._flags&6))return null;d.getLocalMatrix().inverseTransform(b,c,r._scratchPoint)&&(b=r._scratchPoint.x,c=r._scratchPoint.y);var g=d.scissor;if(null!=g&&!g.contains(b,c))return null}a=
r.hitTestBackwards(a.firstChild,b,c);return null!=a?a:null!=d&&d.containsLocal(b,c)?d:null};r.render=function(a,b){var c=a._compMap.Sprite_3;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(),g=d.m02,f=d.m12;0!=(c._flags&32)&&(g=Math.round(g),f=Math.round(f));b.transform(d.m00,d.m10,d.m01,d.m11,g,f);d=c.scissor;null!=d&&b.applyScissor(d.x,d.y,d.width,d.height);c.draw(b)}d=a._compMap.Director_4;
if(null!=d){d=d.occludedScenes;for(g=0;g<d.length;)f=d[g],++g,r.render(f,b)}for(d=a.firstChild;null!=d;)g=d.next,r.render(d,b),d=g;null!=c&&b.restore()};r.hitTestBackwards=function(a,b,c){if(null!=a){var d=r.hitTestBackwards(a.next,b,c);return null!=d?d:r.hitTest(a,b,c)}return null};r.__super__=x;r.prototype=m(x.prototype,{get_name:function(){return"Sprite_3"},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_3;if(null!=b)return b;a=a.parent}return null},
get_pointerDown:function(){null==this._pointerDown&&(this._pointerDown=new o);return this._pointerDown},get_pointerMove:function(){null==this._pointerMove&&(this._pointerMove=new o);return this._pointerMove},get_pointerIn:function(){null==this._pointerIn&&(this._pointerIn=new o);return this._pointerIn},get_pointerOut:function(){null==this._pointerOut&&(this._pointerOut=new o);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}))},set_pointerEnabled:function(a){this._flags=Cb.set(this._flags,4,a);return a},set_pixelSnapping:function(a){this._flags=Cb.set(this._flags,32,a);return a},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__:r});var Va=function(a,b,c){r.call(this);
this.color=a;this.width=new C(b);this.height=new C(c)};e["flambe.display.FillSprite"]=Va;Va.__name__=["flambe","display","FillSprite"];Va.__super__=r;Va.prototype=m(r.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){r.prototype.onUpdate.call(this,a);this.width.update(a);this.height.update(a)},__class__:Va});var Db=function(){};
e["flambe.display.Graphics"]=Db;Db.__name__=["flambe","display","Graphics"];Db.prototype={__class__:Db};var P=function(a){r.call(this);this.texture=a};e["flambe.display.ImageSprite"]=P;P.__name__=["flambe","display","ImageSprite"];P.__super__=r;P.prototype=m(r.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__:P});var sa=e["flambe.display.Orientation"]={__ename__:["flambe","display","Orientation"],__constructs__:["Portrait","Landscape"]};sa.Portrait=["Portrait",0];sa.Portrait.__enum__=sa;sa.Landscape=["Landscape",1];sa.Landscape.__enum__=sa;var Wa=function(){};e["flambe.display.Texture"]=Wa;Wa.__name__=["flambe","display","Texture"];Wa.__interfaces__=[ga];Wa.prototype={__class__:Wa};var Yb=function(){};e["flambe.display.SubTexture"]=Yb;Yb.__name__=["flambe","display","SubTexture"];Yb.__interfaces__=
[Wa];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 S=e["flambe.input.MouseCursor"]={__ename__:["flambe","input","MouseCursor"],__constructs__:["Default","Button","None"]};S.Default=["Default",0];S.Default.__enum__=S;S.Button=["Button",
1];S.Button.__enum__=S;S.None=["None",2];S.None.__enum__=S;var Eb=function(){this.init(0,0,0,null)};e["flambe.input.MouseEvent"]=Eb;Eb.__name__=["flambe","input","MouseEvent"];Eb.prototype={init:function(a,b,c,d){this.id=a;this.viewX=b;this.viewY=c;this.button=d},__class__:Eb};var Xa=e["flambe.input.EventSource"]={__ename__:["flambe","input","EventSource"],__constructs__:["Mouse","Touch"]};Xa.Mouse=function(a){a=["Mouse",0,a];a.__enum__=Xa;return a};Xa.Touch=function(a){a=["Touch",1,a];a.__enum__=
Xa;return a};var Fb=function(){this.init(0,0,0,null,null)};e["flambe.input.PointerEvent"]=Fb;Fb.__name__=["flambe","input","PointerEvent"];Fb.prototype={init:function(a,b,c,d,g){this.id=a;this.viewX=b;this.viewY=c;this.hit=d;this.source=g;this._stopped=!1},__class__:Fb};var Gb=function(a){this.id=a;this._source=Xa.Touch(this)};e["flambe.input.TouchPoint"]=Gb;Gb.__name__=["flambe","input","TouchPoint"];Gb.prototype={init:function(a,b){this.viewX=a;this.viewY=b},__class__:Gb};var ca=function(){};e["flambe.math.FMath"]=
ca;ca.__name__=["flambe","math","FMath"];ca.max=function(a,b){return a>b?a:b};ca.min=function(a,b){return a<b?a:b};var W=function(){this.identity()};e["flambe.math.Matrix"]=W;W.__name__=["flambe","math","Matrix"];W.multiply=function(a,b,c){null==c&&(c=new W);var d=a.m00*b.m00+a.m01*b.m10,g=a.m00*b.m01+a.m01*b.m11,f=a.m00*b.m02+a.m01*b.m12+a.m02;c.m00=d;c.m01=g;c.m02=f;d=a.m10*b.m00+a.m11*b.m10;g=a.m10*b.m01+a.m11*b.m11;f=a.m10*b.m02+a.m11*b.m12+a.m12;c.m10=d;c.m11=g;c.m12=f;return c};W.prototype=
{set:function(a,b,c,d,g,f){this.m00=a;this.m01=c;this.m02=g;this.m10=b;this.m11=d;this.m12=f},identity:function(){this.set(1,0,0,1,0,0)},compose:function(a,b,c,d,g){var f=Math.sin(g),g=Math.cos(g);this.set(g*c,f*c,-f*d,g*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},transformArray:function(a,b,c){for(var d=0;d<b;){var g=a[d],f=a[d+1];c[d++]=g*this.m00+f*this.m01+this.m02;c[d++]=g*this.m10+f*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 W);a.set(this.m00,this.m10,this.m01,this.m11,this.m02,this.m12);
return a},__class__:W};var Ya=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"]=Ya;Ya.__name__=["flambe","math","Rectangle"];Ya.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 Ya);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__:Ya};var E=function(){this._disposed=!1};e["flambe.platform.BasicAsset"]=E;E.__name__=["flambe","platform","BasicAsset"];E.__interfaces__=[ga];E.prototype={dispose:function(){this._disposed||(this._disposed=!0,this.onDisposed())},onDisposed:function(){null},__class__:E};var ha=function(a,b){var c=this;this.manifest=
b;this._platform=a;this.promise=new Za;this._bytesLoaded=new T;this._pack=new $a(b,this);var d=Na.array(b);if(0==d.length)this.handleSuccess();else{for(var g=new T,f=0;f<d.length;){var e=d[f];++f;var h=g.get(e.name);null==h&&(h=[],g.set(e.name,h));h.push(e)}this._assetsRemaining=Na.count(g);for(d=g.iterator();d.hasNext();)g=[d.next()],this.pickBestEntry(g[0],function(a){return function(d){if(null!=d){var g=b.getFullURL(d);try{c.loadEntry(g,d)}catch(f){c.handleError(d,"Unexpected error: "+R.string(f))}g=
c.promise;g.set_total(g._total+d.bytes)}else d=a[0][0],ha.isAudio(d.format)?c.handleLoad(d,Q.getInstance()):c.handleError(d,"Could not find a supported format to load")}}(g))}};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 g=
c[d];++d;for(var f=0;f<a.length;){var e=a[f];++f;if(e.format==g){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 g=d.next(),c=c+g;this.promise.set_progress(c)},handleSuccess:function(){this.promise.set_result(this._pack)},handleError:function(a,b){this.promise.error.emit(J.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 T;this.sounds=new T;this.files=new T};e["flambe.platform._BasicAssetPackLoader.BasicAssetPack"]=$a;$a.__name__=["flambe","platform","_BasicAssetPackLoader","BasicAssetPack"];$a.__interfaces__=[Ta];$a.prototype={getTexture:function(a,b){null==b&&(b=!0);var c=this.textures.get(a);if(null==c&&b)throw J.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 J.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 J.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__=[Ua];Ba.__super__=E;Ba.prototype=m(E.prototype,{toString:function(){return this._content},onDisposed:function(){this._content=null},__class__:Ba});var Hb=function(){};e["flambe.subsystem.MouseSystem"]=Hb;Hb.__name__=["flambe","subsystem","MouseSystem"];Hb.prototype={__class__:Hb};var K=function(a){this._pointer=a;this._source=Xa.Mouse(K._sharedEvent);this.down=new o;this.move=new o;
this.up=new o;this.scroll=new o;this._y=this._x=0;this._cursor=S.Default;this._buttonStates=new ta};e["flambe.platform.BasicMouse"]=K;K.__name__=["flambe","platform","BasicMouse"];K.__interfaces__=[Hb];K.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,Ib.toButton(c)),this._pointer.submitDown(a,b,this._source),this.down.emit(K._sharedEvent))},submitMove:function(a,b){this.prepare(a,b,null);
this._pointer.submitMove(a,b,this._source);this.move.emit(K._sharedEvent)},submitUp:function(a,b,c){this._buttonStates.exists(c)&&(this._buttonStates.remove(c),this.prepare(a,b,Ib.toButton(c)),this._pointer.submitUp(a,b,this._source),this.up.emit(K._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;K._sharedEvent.init(K._sharedEvent.id+1,a,b,c)},__class__:K};var Jb=function(){};
e["flambe.subsystem.PointerSystem"]=Jb;Jb.__name__=["flambe","subsystem","PointerSystem"];Jb.prototype={__class__:Jb};var G=function(a,b,c){null==c&&(c=!1);null==b&&(b=0);null==a&&(a=0);this.down=new o;this.move=new o;this.up=new o;this._x=a;this._y=b;this._isDown=c};e["flambe.platform.BasicPointer"]=G;G.__name__=["flambe","platform","BasicPointer"];G.__interfaces__=[Jb];G.prototype={submitDown:function(a,b,c){if(!this._isDown){this.submitMove(a,b,c);this._isDown=!0;var d=[],g=r.hitTest(j.root,a,
b);if(null!=g){var f=g.owner;do{var e=f._compMap.Sprite_3;null!=e&&d.push(e);f=f.parent}while(null!=f)}this.prepare(a,b,g,c);for(a=0;a<d.length;)if(b=d[a],++a,b.onPointerDown(G._sharedEvent),G._sharedEvent._stopped)return;this.down.emit(G._sharedEvent)}},submitMove:function(a,b,c){if(!(a==this._x&&b==this._y)){var d=[],g=r.hitTest(j.root,a,b);if(null!=g){var f=g.owner;do{var e=f._compMap.Sprite_3;null!=e&&d.push(e);f=f.parent}while(null!=f)}this.prepare(a,b,g,c);for(a=0;a<d.length;)if(b=d[a],++a,
b.onPointerMove(G._sharedEvent),G._sharedEvent._stopped)return;this.move.emit(G._sharedEvent)}},submitUp:function(a,b,c){if(this._isDown){this.submitMove(a,b,c);this._isDown=!1;var d=[],g=r.hitTest(j.root,a,b);if(null!=g){var f=g.owner;do{var e=f._compMap.Sprite_3;null!=e&&d.push(e);f=f.parent}while(null!=f)}this.prepare(a,b,g,c);for(a=0;a<d.length;)if(b=d[a],++a,b.onPointerUp(G._sharedEvent),G._sharedEvent._stopped)return;this.up.emit(G._sharedEvent)}},prepare:function(a,b,c,d){this._x=a;this._y=
b;G._sharedEvent.init(G._sharedEvent.id+1,a,b,c,d)},__class__:G};var X=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"]=X;X.__name__=["flambe","platform","BasicTexture"];X.__interfaces__=[Yb];X.__super__=E;X.prototype=m(E.prototype,{onDisposed:function(){null==this._parent&&this.root.dispose()},get_width:function(){return this._width},get_height:function(){return this._height},__class__:X});var Zb=
function(){};e["flambe.subsystem.TouchSystem"]=Zb;Zb.__name__=["flambe","subsystem","TouchSystem"];var Pa=function(a,b){null==b&&(b=4);this._pointer=a;this._maxPoints=b;this._pointMap=new ta;this._points=[];this.down=new o;this.move=new o;this.up=new o};e["flambe.platform.BasicTouch"]=Pa;Pa.__name__=["flambe","platform","BasicTouch"];Pa.__interfaces__=[Zb];Pa.prototype={submitDown:function(a,b,c){if(!this._pointMap.exists(a)){var d=new Gb(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__:Pa};
var ua=function(){};e["flambe.sound.Sound"]=ua;ua.__name__=["flambe","sound","Sound"];ua.__interfaces__=[ga];ua.prototype={__class__:ua};var Q=function(){this._disposed=!1;this._playback=new ab(this)};e["flambe.platform.DummySound"]=Q;Q.__name__=["flambe","platform","DummySound"];Q.__interfaces__=[ua];Q.getInstance=function(){null==Q._instance&&(Q._instance=new Q);return Q._instance};Q.__super__=E;Q.prototype=m(E.prototype,{play:function(){return this._playback},loop:function(){return this._playback},
onDisposed:function(){},__class__:Q});var va=function(){};e["flambe.sound.Playback"]=va;va.__name__=["flambe","sound","Playback"];va.__interfaces__=[Y];va.prototype={__class__:va};var ab=function(a){this._sound=a;this.volume=new C(0);this._complete=new H(!0)};e["flambe.platform.DummyPlayback"]=ab;ab.__name__=["flambe","platform","DummyPlayback"];ab.__interfaces__=[va];ab.prototype={set_paused:function(){return!0},dispose:function(){},__class__:ab};var Qa=function(){this.down=new o;this.move=new o;
this.up=new o};e["flambe.platform.DummyTouch"]=Qa;Qa.__name__=["flambe","platform","DummyTouch"];Qa.__interfaces__=[Zb];Qa.prototype={__class__:Qa};var Ca=function(){this._entries=[]};e["flambe.platform.EventGroup"]=Ca;Ca.__name__=["flambe","platform","EventGroup"];Ca.__interfaces__=[Y];Ca.prototype={addListener:function(a,b,c){a.addEventListener(b,c,!1);this._entries.push(new Kb(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 Kb=function(a,b,c){this.dispatcher=a;this.type=b;this.listener=c};e["flambe.platform._EventGroup.Entry"]=Kb;Kb.__name__=["flambe","platform","_EventGroup","Entry"];Kb.prototype={__class__:Kb};var Da=function(){};e["flambe.platform.InternalGraphics"]=Da;Da.__name__=["flambe","platform","InternalGraphics"];Da.__interfaces__=[Db];Da.prototype={__class__:Da};var Lb=
function(){};e["flambe.subsystem.RendererSystem"]=Lb;Lb.__name__=["flambe","subsystem","RendererSystem"];Lb.prototype={__class__:Lb};var Ea=function(){};e["flambe.platform.InternalRenderer"]=Ea;Ea.__name__=["flambe","platform","InternalRenderer"];Ea.__interfaces__=[Lb];Ea.prototype={__class__:Ea};var pa=function(){this._tickables=[]};e["flambe.platform.MainLoop"]=pa;pa.__name__=["flambe","platform","MainLoop"];pa.updateEntity=function(a,b){var c=a._compMap.SpeedAdjuster_5;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,pa.updateEntity(c,b),c=d};pa.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);pa.updateEntity(j.root,a)}},render:function(a){var b=a.graphics;null!=b&&(a.willRender(),r.render(j.root,
b),a.didRender())},addTickable:function(a){this._tickables.push(a)},__class__:pa};var Mb=function(){};e["flambe.platform.MathUtil"]=Mb;Mb.__name__=["flambe","platform","MathUtil"];Mb.nextPowerOfTwo=function(a){for(var b=1;b<a;)b<<=1;return b};var Ib=function(){};e["flambe.platform.MouseCodes"]=Ib;Ib.__name__=["flambe","platform","MouseCodes"];Ib.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 $b=function(){};e["flambe.platform.TextureRoot"]=
$b;$b.__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,g,f){this._canvasCtx.transform(a,
b,c,d,g,f)},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,g,f,e){this._firstDraw?(this._firstDraw=!1,this._canvasCtx.globalCompositeOperation="copy",this.drawSubTexture(a,b,c,d,g,f,e),this._canvasCtx.globalCompositeOperation="source-over"):this._canvasCtx.drawImage(a.root.image,a.rootX+d|0,a.rootY+g|0,f|0,e|0,b|0,c|0,f|0,e|0)},fillRect:function(a,b,c,d,g){if(this._firstDraw)this._firstDraw=
!1,this._canvasCtx.globalCompositeOperation="copy",this.fillRect(a,b,c,d,g),this._canvasCtx.globalCompositeOperation="source-over";else{for(a=(16777215&a).toString(16);6>a.length;)a="0"+R.string(a);this._canvasCtx.fillStyle="#"+R.string(a);this._canvasCtx.fillRect(b|0,c|0,d|0,g|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 qa=function(a){this.graphics=new cb(a,!1);this._hasGPU=new H(!0)};e["flambe.platform.html.CanvasRenderer"]=qa;qa.__name__=["flambe","platform","html","CanvasRenderer"];qa.__interfaces__=[Ea];qa.prototype={get_type:function(){return Z.Canvas},
createTextureFromImage:function(a){a=new Fa(qa.CANVAS_TEXTURES?l.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__:qa};var db=function(a,b,c){X.call(this,a,b,c)};e["flambe.platform.html.CanvasTexture"]=db;db.__name__=["flambe","platform","html","CanvasTexture"];db.__super__=X;db.prototype=
m(X.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__=[$b];Fa.__super__=E;Fa.prototype=m(E.prototype,{createTexture:function(a,b){return new db(this,a,b)},onDisposed:function(){this._graphics=this.image=null},__class__:Fa});var p=function(a,b){ha.call(this,a,b)};e["flambe.platform.html.HtmlAssetPackLoader"]=
p;p.__name__=["flambe","platform","html","HtmlAssetPackLoader"];p.detectImageFormats=function(a){var b=[h.PNG,h.JPG,h.GIF],c=2,d;d=window.document.createElement("img");d.onload=d.onerror=function(){1==d.width&&b.unshift(h.WEBP);--c;0==c&&a(b)};d.src="data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==";var g;g=window.document.createElement("img");g.onload=g.onerror=function(){1==g.width&&b.unshift(h.JXR);--c;0==c&&a(b)};g.src="data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA=="};
p.detectAudioFormats=function(){var a;a=window.document.createElement("audio");if(null==a||null==xa(a,a.canPlayType))return[];var b=new na("\\b(iPhone|iPod|iPad|Android|Windows Phone)\\b",""),c=window.navigator.userAgent;if(!q.get_supported()&&b.match(c))return[];for(var b=[{format:h.M4A,mimeType:"audio/mp4; codecs=mp4a"},{format:h.MP3,mimeType:"audio/mpeg"},{format:h.OPUS,mimeType:"audio/ogg; codecs=opus"},{format:h.OGG,mimeType:"audio/ogg; codecs=vorbis"},{format:h.WAV,mimeType:"audio/wav"}],c=
[],d=0;d<b.length;){var g=b[d];++d;var f="";try{f=a.canPlayType(g.mimeType)}catch(e){}""!=f&&c.push(g.format)}return c};p.supportsBlob=function(){if(p._detectBlobSupport){p._detectBlobSupport=!1;if((new na("\\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;p._URL=l.loadExtension("URL").value}return null!=p._URL&&null!=p._URL.createObjectURL};
p.__super__=ha;p.prototype=m(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 g=new Ca;g.addDisposingListener(d,"load",function(){p.supportsBlob()&&p._URL.revokeObjectURL(d.src);var a=c._platform.getRenderer().createTextureFromImage(d);null!=a?c.handleLoad(b,a):c.handleTextureError(b)});g.addDisposingListener(d,"error",function(){c.handleError(b,"Failed to load image")});p.supportsBlob()?this.download(a,
b,"blob",function(a){d.src=p._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(q.get_supported())this.download(a,b,"arraybuffer",function(a){q.ctx.decodeAudioData(a,function(a){c.handleLoad(b,new q(a))},function(){c.handleLoad(b,Q.getInstance())})});else{var f;f=window.document.createElement("audio");
f.preload="auto";var e=++p._mediaRefCount;null==p._mediaElements&&(p._mediaElements=new ta);p._mediaElements.set(e,f);g=new Ca;g.addDisposingListener(f,"canplaythrough",function(){p._mediaElements.remove(e);c.handleLoad(b,new Ga(f))});g.addDisposingListener(f,"error",function(){p._mediaElements.remove(e);var a=f.error.code;3==a||4==a?c.handleLoad(b,Q.getInstance()):c.handleError(b,"Failed to load audio: "+f.error.code)});g.addListener(f,"progress",function(){if(0<f.buffered.length&&0<f.duration){var a=
f.buffered.end(0)/f.duration;c.handleProgress(b,a*b.bytes|0)}});f.src=a;f.load()}break;case 13:this.download(a,b,"text",function(a){c.handleLoad(b,new Ba(a))})}},getAssetFormats:function(a){var b=this;null==p._supportedFormats&&(p._supportedFormats=new Za,p.detectImageFormats(function(a){p._supportedFormats.set_result(b._platform.getRenderer().getCompressedTextureFormats().concat(a).concat(p.detectAudioFormats()).concat([h.Data]))}));p._supportedFormats.get(a)},download:function(a,b,c,d){var g=this,
f=null,e=null,h=0,i=!1,j=function(){i&&(i=!1,window.clearInterval(h))},k=3,l=function(){--k;return 0<=k?(e(),!0):!1},e=function(){j();null!=f&&f.abort();f=new XMLHttpRequest;f.open("GET",a,!0);f.responseType=c;var e=0;f.onprogress=function(a){i||(i=!0,h=window.setInterval(function(){4!=f.readyState&&5E3<Date.now()-e&&!l()&&(j(),g.handleError(b,"Download stalled"))},1E3));e=Date.now();g.handleProgress(b,a.loaded)};f.onerror=function(){if(0!=f.status||!l())j(),g.handleError(b,"HTTP error "+f.status)};
f.onload=function(){var a=f.response;null==a&&(a=f.responseText);j();d(a)};f.send()};e()},__class__:p});var Oa=function(a,b){K.call(this,a);this._canvas=b};e["flambe.platform.html.HtmlMouse"]=Oa;Oa.__name__=["flambe","platform","html","HtmlMouse"];Oa.__super__=K;Oa.prototype=m(K.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 K.prototype.set_cursor.call(this,a)},__class__:Oa});var Ga=function(a){this._disposed=
!1;this.audioElement=a};e["flambe.platform.html.HtmlSound"]=Ga;Ga.__name__=["flambe","platform","html","HtmlSound"];Ga.__interfaces__=[ua];Ga.__super__=E;Ga.prototype=m(E.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 C(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,va];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||(ba.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 Nb=function(){};e["flambe.subsystem.StageSystem"]=Nb;Nb.__name__=["flambe","subsystem","StageSystem"];Nb.prototype={__class__:Nb};var oa=function(a){var b=this;this._canvas=a;this.resize=new ia;this.scaleFactor=oa.computeScaleFactor();1!=this.scaleFactor&&(l.setVendorStyle(this._canvas,
"transform-origin","top left"),l.setVendorStyle(this._canvas,"transform","scale("+1/this.scaleFactor+")"));l.SHOULD_HIDE_MOBILE_BROWSER&&(window.addEventListener("orientationchange",function(){l.callLater(xa(b,b.hideMobileBrowser),200)},!1),this.hideMobileBrowser());window.addEventListener("resize",xa(this,this.onWindowResize),!1);this.onWindowResize(null);this.orientation=new H(null);null!=window.orientation&&(window.addEventListener("orientationchange",xa(this,this.onOrientationChange),!1),this.onOrientationChange(null));
this.fullscreen=new H(!1);l.addVendorListener(window.document,"fullscreenchange",function(){b.updateFullscreen()},!1);this.updateFullscreen()};e["flambe.platform.html.HtmlStage"]=oa;oa.__name__=["flambe","platform","html","HtmlStage"];oa.__interfaces__=[Nb];oa.computeScaleFactor=function(){var a=window.devicePixelRatio;null==a&&(a=1);var b=window.document.createElement("canvas").getContext("2d"),b=l.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};oa.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";l.callLater(function(){l.hideMobileBrowser();l.callLater(function(){b.height=window.innerHeight+"px";a.onWindowResize(null)},100)})},onOrientationChange:function(){this.orientation.set__(l.orientation(window.orientation))},updateFullscreen:function(){this.fullscreen.set__(!0==l.loadFirstExtension(["fullscreen","fullScreen","isFullScreen"],window.document).value)},__class__:oa};
var l=function(){};e["flambe.platform.html.HtmlUtil"]=l;l.__name__=["flambe","platform","html","HtmlUtil"];l.callLater=function(a,b){null==b&&(b=0);window.setTimeout(a,b)};l.hideMobileBrowser=function(){window.scrollTo(1,0)};l.loadExtension=function(a,b){null==b&&(b=window);var c=ea.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,g=l.VENDOR_PREFIXES;d<g.length;){var f=g[d];++d;var e=f+c,h=ea.field(b,e);if(null!=h)return{prefix:f,field:e,
value:h}}return{prefix:null,field:null,value:null}};l.loadFirstExtension=function(a,b){for(var c=0;c<a.length;){var d=a[c];++c;d=l.loadExtension(d,b);if(null!=d.field)return d}return{prefix:null,field:null,value:null}};l.polyfill=function(a,b){null==b&&(b=window);var c=l.loadExtension(a,b).value;if(null==c)return!1;b[a]=c;return!0};l.setVendorStyle=function(a,b,c){for(var a=a.style,d=0,g=l.VENDOR_PREFIXES;d<g.length;){var e=g[d];++d;a.setProperty("-"+e+"-"+b,c)}a.setProperty(b,c)};l.addVendorListener=
function(a,b,c,d){for(var g=0,e=l.VENDOR_PREFIXES;g<e.length;){var h=e[g];++g;a.addEventListener(h+b,c,d)}a.addEventListener(b,c,d)};l.orientation=function(a){switch(a){case -90:case 90:return sa.Landscape;default:return sa.Portrait}};l.createEmptyCanvas=function(a,b){var c;c=window.document.createElement("canvas");c.width=a;c.height=b;return c};l.createCanvas=function(a){var b=l.createEmptyCanvas(a.width,a.height),c=b.getContext("2d");c.save();c.globalCompositeOperation="copy";c.drawImage(a,0,0);
c.restore();return b};l.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};l.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 q=function(a){this._disposed=!1;
this.buffer=a};e["flambe.platform.html.WebAudioSound"]=q;q.__name__=["flambe","platform","html","WebAudioSound"];q.__interfaces__=[ua];q.get_supported=function(){if(q._detectSupport){q._detectSupport=!1;var a=l.loadExtension("AudioContext").value;null!=a&&(q.ctx=new a,q.gain=q.createGain(),q.gain.connect(q.ctx.destination),j.volume.watch(function(a){q.gain.gain.value=a}))}return null!=q.ctx};q.createGain=function(){return null!=q.ctx.createGain?q.ctx.createGain():q.ctx.createGainNode()};q.start=function(a,
b){null!=a.start?a.start(b):a.noteOn(b)};q.__super__=E;q.prototype=m(E.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__:q});var Ia=function(a,b,c){var d=this;this._sound=a;this._head=q.gain;this._complete=new H(!1);this._sourceNode=q.ctx.createBufferSource();this._sourceNode.buffer=a.buffer;this._sourceNode.loop=c;this._sourceNode.onended=
function(){d._complete.set__(!0)};q.start(this._sourceNode,0);this.playAudio();this.volume=new C(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,va];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:(q.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=q.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=q.ctx.currentTime;this._pausedAt=-1;this._tickableAdded||(ba.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 Ob=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"]=Ob;Ob.__name__=["flambe","platform","html","WebGLBatcher"];Ob.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,g){b!=this._lastRenderTarget&&(this.flush(),this._lastRenderTarget=b);c!=this._lastBlendMode&&(this.flush(),this._lastBlendMode=c);g!=this._lastShader&&(this.flush(),this._lastShader=g);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__:Ob};var U=function(a,b){this._inverseProjection=this._stateList=null;null==U._scratchQuadArray&&(U._scratchQuadArray=new Float32Array(8));this._batcher=a;this._renderTarget=b};e["flambe.platform.html.WebGLGraphics"]=U;U.__name__=["flambe","platform","html","WebGLGraphics"];U.__interfaces__=[Da];U.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,g,e){var h=this._stateList;U._scratchMatrix.set(a,b,c,d,g,e);W.multiply(h.matrix,U._scratchMatrix,h.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,g,e,h){var i=this._stateList,j=a.root,
b=this.transformQuad(b,c,e,h),c=j.width,j=j.height,d=(a.rootX+d)/c,g=(a.rootY+g)/j,e=d+e/c,h=g+h/j,c=i.alpha,a=this._batcher.prepareDrawTexture(this._renderTarget,i.blendMode,i.scissor,a),i=this._batcher.data;i[a]=b[0];i[++a]=b[1];i[++a]=d;i[++a]=g;i[++a]=c;i[++a]=b[2];i[++a]=b[3];i[++a]=e;i[++a]=g;i[++a]=c;i[++a]=b[4];i[++a]=b[5];i[++a]=e;i[++a]=h;i[++a]=c;i[++a]=b[6];i[++a]=b[7];i[++a]=d;i[++a]=h;i[++a]=c},fillRect:function(a,b,c,d,g){var e=this._stateList,b=this.transformQuad(b,c,d,g),c=(a&16711680)/
16711680,d=(a&65280)/65280,a=(a&255)/255,g=e.alpha,e=this._batcher.prepareFillRect(this._renderTarget,e.blendMode,e.scissor),h=this._batcher.data;h[e]=b[0];h[++e]=b[1];h[++e]=c;h[++e]=d;h[++e]=a;h[++e]=g;h[++e]=b[2];h[++e]=b[3];h[++e]=c;h[++e]=d;h[++e]=a;h[++e]=g;h[++e]=b[4];h[++e]=b[5];h[++e]=c;h[++e]=d;h[++e]=a;h[++e]=g;h[++e]=b[6];h[++e]=b[7];h[++e]=c;h[++e]=d;h[++e]=a;h[++e]=g},multiplyAlpha:function(a){this._stateList.alpha*=a},setBlendMode:function(a){this._stateList.blendMode=a},applyScissor:function(a,
b,c,d){var e=this._stateList,f=U._scratchQuadArray;f[0]=a;f[1]=b;f[2]=a+c;f[3]=b+d;e.matrix.transformArray(f,4,f);this._inverseProjection.transformArray(f,4,f);a=f[0];b=f[1];c=f[2]-a;d=f[3]-b;0>c&&(a+=c,c=-c);0>d&&(b+=d,d=-d);e.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 W;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=U._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__:U};var hb=function(){this.scissor=this.prev=this.next=null;this.matrix=new W;this.alpha=1;this.blendMode=D.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=ca.max(this.scissor.x,a),f=ca.max(this.scissor.y,b),c=ca.min(this.scissor.x+this.scissor.width,a+c),d=ca.min(this.scissor.y+this.scissor.height,b+d),a=e,b=f,c=c-e,d=d-f;else this.scissor=new Ya;this.scissor.set(Math.round(a),Math.round(b),Math.round(c),Math.round(d))},__class__:hb};var Ra=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(xa(this,this.onResize));this.init()};e["flambe.platform.html.WebGLRenderer"]=Ra;Ra.__name__=["flambe","platform","html","WebGLRenderer"];Ra.__interfaces__=[Ea];Ra.prototype={get_type:function(){return Z.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 Ob(this.gl);this.graphics=new U(this.batcher,null);this.onResize()},__class__:Ra};var ib=function(a,b,c){X.call(this,
a,b,c)};e["flambe.platform.html.WebGLTexture"]=ib;ib.__name__=["flambe","platform","html","WebGLTexture"];ib.__super__=X;ib.prototype=m(X.prototype,{__class__:ib});var ja=function(a,b,c){this.framebuffer=this._graphics=null;this._disposed=!1;this._renderer=a;this.width=ca.max(2,Mb.nextPowerOfTwo(b));this.height=ca.max(2,Mb.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__=[$b];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__=E;ja.prototype=m(E.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=l.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 L=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,L.createShader(a,35633,b));a.attachShader(this._program,L.createShader(a,35632,c));a.linkProgram(this._program);a.useProgram(this._program)};e["flambe.platform.shader.ShaderGL"]=L;L.__name__=["flambe","platform","shader","ShaderGL"];L.createShader=function(a,b,c){b=a.createShader(b);a.shaderSource(b,c);a.compileShader(b);return b};L.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__:L};var fb=function(a){L.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__=L;fb.prototype=m(L.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){L.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__=L;eb.prototype=
m(L.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){L.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__=L;gb.prototype=m(L.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;x.call(this);this.scenes=[];this.occludedScenes=[];this._root=new B};e["flambe.scene.Director"]=jb;jb.__name__=["flambe","scene","Director"];jb.__super__=x;jb.prototype=m(x.prototype,{get_name:function(){return"Director_4"},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_2;null!=a&&a.hidden.emit()},hideAndDispose:function(a){this.hide(a);a.dispose()},show:function(a){a=a._compMap.Scene_2;null!=a&&a.shown.emit()},invalidateVisibility:function(){for(var a=this.scenes.length;0<a;){var b=this.scenes[--a]._compMap.Scene_2;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 Pb(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 Pb=function(a,b,c,d){this._from=a;this._to=b;
this._transition=c;this._onComplete=d};e["flambe.scene._Director.Transitor"]=Pb;Pb.__name__=["flambe","scene","_Director","Transitor"];Pb.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__:Pb};var wa=function(a){null==a&&(a=!0);x.call(this);this.opaque=a;this.shown=new ia;this.hidden=new ia};e["flambe.scene.Scene"]=wa;wa.__name__=["flambe","scene",
"Scene"];wa.__super__=x;wa.prototype=m(x.prototype,{get_name:function(){return"Scene_2"},__class__:wa});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 da=function(a,b){this._duration=a;this._ease=null!=b?b:O.linear};e["flambe.scene.TweenTransition"]=da;da.__name__=["flambe","scene","TweenTransition"];da.__super__=
Ja;da.prototype=m(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__:da});var kb=function(a,b){this._direction=2;da.call(this,a,b)};e["flambe.scene.SlideTransition"]=kb;kb.__name__=["flambe","scene","SlideTransition"];kb.__super__=da;kb.prototype=m(da.prototype,{left:function(){this._direction=2;return this},
init:function(a,b,c){da.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_3;null==a&&this._from.add(a=new r);a.setXY(0,0);a=this._to._compMap.Sprite_3;null==a&&this._to.add(a=new r);a.setXY(-this._x,-this._y)},update:function(a){a=da.prototype.update.call(this,
a);this._from._compMap.Sprite_3.setXY(this.interp(0,this._x),this.interp(0,this._y));this._to._compMap.Sprite_3.setXY(this.interp(-this._x,0),this.interp(-this._y,0));return a},complete:function(){this._from._compMap.Sprite_3.setXY(0,0);this._to._compMap.Sprite_3.setXY(0,0)},__class__:kb});var Z=e["flambe.subsystem.RendererType"]={__ename__:["flambe","subsystem","RendererType"],__constructs__:["Stage3D","WebGL","Canvas"]};Z.Stage3D=["Stage3D",0];Z.Stage3D.__enum__=Z;Z.WebGL=["WebGL",1];Z.WebGL.__enum__=
Z;Z.Canvas=["Canvas",2];Z.Canvas.__enum__=Z;var Xb=function(){};e["flambe.util.Assert"]=Xb;Xb.__name__=["flambe","util","Assert"];Xb.that=function(){};var Cb=function(){};e["flambe.util.BitSets"]=Cb;Cb.__name__=["flambe","util","BitSets"];Cb.set=function(a,b,c){return c?a|b:a&~b};var ka=e["flambe.util.LogLevel"]={__ename__:["flambe","util","LogLevel"],__constructs__:["Info","Warn","Error"]};ka.Info=["Info",0];ka.Info.__enum__=ka;ka.Warn=["Warn",1];ka.Warn.__enum__=ka;ka.Error=["Error",2];ka.Error.__enum__=
ka;var Za=function(){this.success=new o;this.error=new o;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=m(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 J=function(){};e["flambe.util.Strings"]=J;J.__name__=["flambe","util","Strings"];J.getFileExtension=function(a){var b=a.lastIndexOf(".");return 0<b?A.substr(a,b+1,null):null};J.removeFileExtension=function(a){var b=a.lastIndexOf(".");
return 0<b?A.substr(a,0,b):a};J.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 J.getFileExtension(a)};J.joinPath=function(a,b){0<a.length&&47!=a.charCodeAt(a.length-1)&&(a+="/");return a+b};J.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],f=b[d+1];if(R.is(f,Error)){var h=f.stack;null!=h&&(f=h)}a+=e+"="+R.string(f);d+=2}a+="]"}return a};var Qb=
function(){var a=this;this.commandsMap=new la;var b=lb;this.commandsMap.set(s.onOverlaysCreateRequest,b);b;b=mb;this.commandsMap.set(s.onContextReady,b);b;b=nb;this.commandsMap.set(s.onCreateSceneRequest,b);b;b=ob;this.commandsMap.set(s.onRestartGame,b);b;b=pb;this.commandsMap.set(s.onEndOfGame,b);b;b=qb;this.commandsMap.set(s.onClick,b);b;b=rb;this.commandsMap.set(s.onSuccessMinor,b);b;b=sb;this.commandsMap.set(s.onFailure,b);b;for(b=this.commandsMap.keys();b.hasNext();){var c=[b.next()];c[0].connect(function(b){return function(c){var e=
F.createInstance(a.commandsMap.h[b[0].__id__],[]);e.context=c;e.execute()}}(c))}};e["game.CommandsMap"]=Qb;Qb.__name__=["game","CommandsMap"];Qb.prototype={__class__:Qb};var $=function(){this.specialEntityName="";this.progress=this.levelNum=0;this.restartButtonDown=new o;this.startButtonDown=new o};e["game.GameContext"]=$;$.__name__=["game","GameContext"];$.getInstance=function(){null==$.instance&&($.instance=new $);return $.instance};$.prototype={init:function(){var a=this;this.gameLayer=new B;this.msgLayer=
new B;this.gameEntity.addChild(this.gameLayer);this.levels=u.create(this.pack,5,324);this.gameEntity.addChild(this.levels);this.gameEntity.addChild(this.msgLayer);this.model=JSON.parse(this.settingsPack.getFile("model.json").toString());this.startButtonDown.connect(function(a){M.hide(a)});this.restartButtonDown.connect(function(b){M.hide(b);a.restartGame()});u.reset();s.onContextReady.emit(this);this.gameLoop=this.pack.getSound("gameLoop");this.gameLoopPlayback=this.gameLoop.loop(1);this.sndLayer=
k.create(this.pack,this.gameLoopPlayback);this.gameEntity.addChild(this.sndLayer);this.gameEntity.addChild(this.msgLayer)},check:function(a){return 4==this.levelNum&&(4==this.progress&&"l5_b19"==this.nameByEntity.h[a.__id__]||10==this.progress&&"l5_b9"==this.nameByEntity.h[a.__id__]||14==this.progress&&"l5_b4"==this.nameByEntity.h[a.__id__]||15==this.progress&&"l5_b14"==this.nameByEntity.h[a.__id__])?(this.specialEntityName=this.nameByEntity.h[a.__id__],!0):this.currentLevel().order[this.progress]==
this.nameByEntity.h[a.__id__]},itemSelected:function(a){this.check(a)?s.onSuccessMinor.emit(this):s.onFailure.emit(this)},advance:function(){var a=this;this.progress++;this.progress==this.currentLevel().order.length&&ma.delay(function(){a.levelUp()},1E3)},cleanUp:function(){for(var a=0,b=this.selectedConnections.length;a<b;)this.selectedConnections[a++].dispose();this.gameLayer.disposeChildren()},levelUp:function(){this.progress=0;4==this.levelNum?this.endOfGame():(this.cleanUp(),this.levelNum++,
this.createScene())},createOverlays:function(){s.onOverlaysCreateRequest.emit(this)},createScene:function(){s.onCreateSceneRequest.emit(this)},restartGame:function(){s.onRestartGame.emit(this)},endOfGame:function(){s.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;case 3:a=this.model.l4;break;case 4:a=this.model.l5;break;default:a=this.model.l1}return a},__class__:$};var Ka=function(){var a=
this;i.start();j.init();j.root.add(this.director=new jb);V.STAGE_WIDTH=j._platform.getStage().get_width();V.STAGE_HEIGHT=j._platform.getStage().get_height();i.log("log "+V.STAGE_WIDTH+" "+V.STAGE_HEIGHT,{fileName:"Main.hx",lineNumber:56,className:"game.Main",methodName:"new"});this["goto"]((new B).add(new wa).add(new Va(16777215,V.STAGE_WIDTH,V.STAGE_HEIGHT)));j.loadAssetPack(I.fromAssets("bootstrap")).get(function(b){i.hasConsole&&i.callConsole("log",["Loading bootstrap pack..."]);i.print(t.log,
["Loading bootstrap pack..."],{fileName:"Main.hx",lineNumber:64,className:"game.Main",methodName:"new"});s.onBootstrapAssetsReady.emit(b);b=ac.create(b);b._compMap.Scene_2.shown.connect(function(){i.hasConsole&&i.callConsole("log",["Loading settings pack..."]);i.print(t.log,["Loading settings pack..."],{fileName:"Main.hx",lineNumber:70,className:"game.Main",methodName:"new"});j.loadAssetPack(I.fromAssets("settings")).get(function(b){i.hasConsole&&i.callConsole("log",["Loading game pack..."]);i.print(t.log,
["Loading game pack..."],{fileName:"Main.hx",lineNumber:73,className:"game.Main",methodName:"new"});j.loadAssetPack(I.fromAssets("game")).get(function(d){s.onGameAssetsReady.emit(d);i.hasConsole&&i.callConsole("log",["Loading done!"]);i.print(t.log,["Loading done!"],{fileName:"Main.hx",lineNumber:77,className:"game.Main",methodName:"new"});new Qb;var e=bc.create(d),f=$.getInstance();f.settingsPack=b;f.pack=d;f.gameEntity=e;f.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=V.getActualScale();a._compMap.Sprite_3.setScaleXY(b.sx,b.sy);this.director.unwindToScene(a,(new kb(1,O.quintInOut)).left())},__class__:Ka};var V=function(){};e["game.Settings"]=V;V.__name__=["game","Settings"];V.getActualScale=function(){var a=j._platform.getStage().get_width()/800,b=j._platform.getStage().get_height()/600;return{sx:a,sy:b}};var s=function(){};e["game.SignalsMap"]=s;s.__name__=["game","SignalsMap"];
var k=function(){};e["game.SoundSwitcher"]=k;k.__name__=["game","SoundSwitcher"];k.create=function(a,b){k._e=new B;k._sOn=new P(a.getTexture("soundOn"));k._sOff=new P(a.getTexture("soundOff"));k._sOn.get_pointerDown().connect(k.handleChange);k._sOff.get_pointerDown().connect(k.handleChange);k._sOn.setXY(754,9);k._sOff.setXY(754,9);k._playback=b;k.gotoOn();return k._e};k.handleChange=function(){k._on?k.gotoOff():k.gotoOn()};k.gotoOn=function(){k._e.add(k._sOn);k._on=!0;k._restartFlag&&(k._playback=
k._loop.loop(1),k._restartFlag=!1);k._playback.volume.set__(1)};k.gotoOff=function(){k._e.add(k._sOff);k._on=!1;k._playback.volume.set__(0)};k.restart=function(a){k._loop=a;k._on?k._playback=k._loop.loop(1):k._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=
m(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=m(z.prototype,{execute:function(){var a=this;this.context.pack.getSound("failed").play();i.hasConsole&&i.callConsole("log",["Failed"]);i.print(t.log,["Failed"],{fileName:"AfterFailureCommand.hx",lineNumber:16,className:"game.commands.AfterFailureCommand",methodName:"execute"});
M.show(this.context.failureMsg);ma.delay(function(){M.hide(a.context.failureMsg)},1E3)},__class__:sb});var rb=function(){};e["game.commands.AfterSuccessCommand"]=rb;rb.__name__=["game","commands","AfterSuccessCommand"];rb.__super__=z;rb.prototype=m(z.prototype,{execute:function(){this.context.pack.getSound("success-minor").play();var a=this.context.currentLevel(),b=a.order[this.context.progress],c=this.context.successByName.get(b),d=this.context.configByName.get(b),e="";i.log("Special name: "+this.context.specialEntityName,
{fileName:"AfterSuccessCommand.hx",lineNumber:24,className:"game.commands.AfterSuccessCommand",methodName:"execute"});e=""!=this.context.specialEntityName?this.context.specialEntityName:a.order[this.context.progress];a=this.context.entityByName.get(e);e=a._compMap.Sprite_3;e.x.animateTo(c.x,0.5,O.quintOut);e.y.animateTo(c.y,0.5,O.quintOut);var f=d.heigth/c.heigth;e.scaleX.animateTo(1/(d.width/c.width),0.5,O.quintOut);e.scaleY.animateTo(1/f,0.5,O.quintOut);e.set_pointerEnabled(!1);e.set_pixelSnapping(!0);
a.remove(a._compMap.UseHandCursor_1);a.remove(a._compMap.Selectable_6);this.context.specialEntityName="";this.context.advance();i.log("BANG! "+b,{fileName:"AfterSuccessCommand.hx",lineNumber:49,className:"game.commands.AfterSuccessCommand",methodName:"execute"})},__class__:rb});var mb=function(){};e["game.commands.ContextReadyCommand"]=mb;mb.__name__=["game","commands","ContextReadyCommand"];mb.__super__=z;mb.prototype=m(z.prototype,{execute:function(){this.context.createOverlays();this.context.createScene();
M.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=m(z.prototype,{execute:function(){this.context.startMsg=M.create({buttonX:305,buttonY:383,hasButton:!0,msgTexture:"msgStart",buttonTexture:"btnstart",downSignal:this.context.startButtonDown},this.context.pack);this.context.eogMsg=M.create({buttonX:265,buttonY:384,hasButton:!0,msgTexture:"msgEnd",buttonTexture:"btnrestart",
downSignal:this.context.restartButtonDown},this.context.pack);this.context.failureMsg=M.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=m(z.prototype,{execute:function(){var a=
this;this.context.nameByEntity=new la;this.context.entityByName=new T;this.context.configByName=new T;this.context.successByName=new T;this.context.selectedConnections=[];i.hasConsole&&i.callConsole("log",["Creating scene:"]);i.print(t.log,["Creating scene:"],{fileName:"CreateSceneCommand.hx",lineNumber:30,className:"game.commands.CreateSceneCommand",methodName:"execute"});var b=this.context.currentLevel();i.hasConsole&&i.callConsole("log",[b]);i.print(t.log,[b],{fileName:"CreateSceneCommand.hx",
lineNumber:32,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;this.createSprite(b.title);Object.prototype.hasOwnProperty.call(b,"boardBg")&&this.createSprite(b.boardBg);d=0;for(e=b.board.length;d<e;){c=d++;c=b.board[c];var f=this.createSprite(c);f.add(new tb);f.add(new ub);this.context.selectedConnections.push(f._compMap.Selectable_6.selected.connect(function(b){a.context.itemSelected(b)}));
var h=c.name;this.context.nameByEntity.set(f,h);h;this.context.entityByName.set(c.name,f);f;this.context.configByName.set(c.name,c);c}u.show(this.context.levelNum+1);i.log(b.board,{fileName:"CreateSceneCommand.hx",lineNumber:65,className:"game.commands.CreateSceneCommand",methodName:"execute"})},createSprite:function(a){var b=new B,c=new P(this.context.pack.getTexture(a.name));c.setXY(a.x,a.y);b.add(c);this.context.gameLayer.addChild(b);return b},__class__:nb});var pb=function(){};e["game.commands.EndOfGameCommand"]=
pb;pb.__name__=["game","commands","EndOfGameCommand"];pb.__super__=z;pb.prototype=m(z.prototype,{execute:function(){var a=this;this.context.pack.getSound("success").play();this.context.gameLoopPlayback.volume.animateTo(0,1);ma.delay(function(){M.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=
m(z.prototype,{execute:function(){this.context.gameLoop=this.context.pack.getSound("gameLoop");k.restart(this.context.gameLoop);this.context.progress=0;this.context.levelNum=0;u.reset();this.context.cleanUp();this.context.createScene()},__class__:ob});var ub=function(){this.selected=new o;x.call(this)};e["game.components.Selectable"]=ub;ub.__name__=["game","components","Selectable"];ub.__super__=x;ub.prototype=m(x.prototype,{get_name:function(){return"Selectable_6"},onPointerDown:function(){this.selected.emit(this.owner)},
onAdded:function(){this._connection=this.owner._compMap.Sprite_3.get_pointerDown().connect(xa(this,this.onPointerDown))},onRemoved:function(){this._connection.dispose()},__class__:ub});var tb=function(){x.call(this)};e["game.components.UseHandCursor"]=tb;tb.__name__=["game","components","UseHandCursor"];tb.__super__=x;tb.prototype=m(x.prototype,{get_name:function(){return"UseHandCursor_1"},onAdded:function(){var a=this.owner._compMap.Sprite_3;this._connectionIn=a.get_pointerIn().connect(function(){j._platform.getMouse().set_cursor(S.Button)});
this._connectionOut=a.get_pointerOut().connect(function(){j._platform.getMouse().set_cursor(S.Default)});this._connectionMove=a.get_pointerMove().connect(function(){j._platform.getMouse().set_cursor(S.Button)})},onRemoved:function(){var a=this.owner._compMap.Sprite_3;a.get_pointerIn().disconnect(this._connectionIn);a.get_pointerOut().disconnect(this._connectionOut);a.get_pointerMove().disconnect(this._connectionMove)},__class__:tb});var bc=function(){};e["game.entities.GameScene"]=bc;bc.__name__=
["game","entities","GameScene"];bc.create=function(a){return(new B).add(new wa).add(new P(a.getTexture("game")))};var u=function(){};e["game.entities.Levels"]=u;u.__name__=["game","entities","Levels"];u.create=function(a,b,c){null==c&&(c=164);null==b&&(b=10);u.x0=c;u.num=b;for(var c=new B,d=[],e=1,b=b+1;e<b;){var f=e++,h=new B;c.addChild(h);d[f-1]=h}u.items=d;u.pack=a;return c};u.show=function(a){for(var b=2,c=a+1;b<c;){var d=b++,e=u.items[d-1],d=(new P(u.pack.getTexture(d<=a?"level-on":"level-off"))).setXY(u.x0+
(d-1)*u.delta,u.y0);e.add(d)}};u.reset=function(){for(var a=1,b=u.num+1;a<b;){var c=a++,d=u.items[c-1],c=(new P(u.pack.getTexture(1==c?"level-on":"level-off"))).setXY(u.x0+(c-1)*u.delta,u.y0);d.add(c)}};var M=function(){};e["game.entities.Overlay"]=M;M.__name__=["game","entities","Overlay"];M.create=function(a,b){var c=(new B).add(new r),d=new P(b.getTexture(a.msgTexture)),d=(new B).add(d),e=null;if(a.hasButton){var e=(new B).add(new P(b.getTexture(a.buttonTexture))),f=e._compMap.Sprite_3;f.setXY(a.buttonX,
a.buttonY);f.get_pointerDown().connect(function(){a.downSignal.emit(M.active);s.onClick.emit($.getInstance())})}c.addChild(d);a.hasButton&&c.addChild(e);c._compMap.Sprite_3.x.set__(V.STAGE_WIDTH);return c};M.show=function(a,b){null==b&&(b=!0);a._compMap.Sprite_3.x.set__(V.STAGE_WIDTH);a._compMap.Sprite_3.x.animateTo(0,b?0.5:0,O.quintOut);M.active=a};M.hide=function(a){a._compMap.Sprite_3.x.animateTo(V.STAGE_WIDTH,0.5,O.quintOut)};var ac=function(){};e["game.entities.SplashScene"]=ac;ac.__name__=["game",
"entities","SplashScene"];ac.create=function(a){var b=new wa(!1),a=new P(a.getTexture("splash"));return(new B).add(b).add(a)};var Rb=function(){};e["haxe.Log"]=Rb;Rb.__name__=["haxe","Log"];Rb.trace=function(a,b){w.__trace(a,b)};var ma=function(a){var b=this;this.id=setInterval(function(){b.run()},a)};e["haxe.Timer"]=ma;ma.__name__=["haxe","Timer"];ma.delay=function(a,b){var c=new ma(b);c.run=function(){c.stop();a()};return c};ma.prototype={stop:function(){null!=this.id&&(clearInterval(this.id),this.id=
null)},run:function(){},__class__:ma};var ta=function(){this.h={}};e["haxe.ds.IntMap"]=ta;ta.__name__=["haxe","ds","IntMap"];ta.__interfaces__=[ya];ta.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__:ta};var la=function(){this.h=
{};this.h.__keys__={}};e["haxe.ds.ObjectMap"]=la;la.__name__=["haxe","ds","ObjectMap"];la.__interfaces__=[ya];la.prototype={set:function(a,b){var c=a.__id__||(a.__id__=++la.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__:la};var T=function(){this.h={}};e["haxe.ds.StringMap"]=T;T.__name__=["haxe","ds","StringMap"];T.__interfaces__=[ya];
T.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__:T};var dc=function(){};e["haxe.io.Bytes"]=dc;dc.__name__=["haxe","io","Bytes"];var cc=function(){};e["haxe.io.Eof"]=cc;cc.__name__=["haxe","io","Eof"];
cc.prototype={toString:function(){return"Eof"},__class__:cc};var Wb=function(){};e["haxe.rtti.Meta"]=Wb;Wb.__name__=["haxe","rtti","Meta"];Wb.getType=function(a){a=a.__meta__;return null==a||null==a.obj?{}:a.obj};var w=function(){};e["js.Boot"]=w;w.__name__=["js","Boot"];w.__unhtml=function(a){return a.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")};w.__trace=function(a,b){var c;c=null!=b?b.fileName+":"+b.lineNumber+": ":"";c+=w.__string_rec(a,"");if(null!=b&&null!=b.customParams)for(var d=
0,e=b.customParams;d<e.length;){var f=e[d];++d;c+=","+w.__string_rec(f,"")}var h;"undefined"!=typeof document&&null!=(h=document.getElementById("haxe:trace"))?h.innerHTML+=w.__unhtml(c)+"<br/>":"undefined"!=typeof console&&null!=console.log&&console.log(c)};w.getClass=function(a){return a instanceof Array&&null==a.__enum__?Array:a.__class__};w.__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 f=d++,c=2!=f?c+(","+w.__string_rec(a[f],b)):c+w.__string_rec(a[f],b);return c+")"}c=a.length;d="[";b+="\t";for(e=0;e<c;)f=e++,d+=(0<f?",":"")+w.__string_rec(a[f],b);return d+"]"}try{d=a.toString}catch(h){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+" : "+w.__string_rec(a[c],b));b=b.substring(1);return d+("\n"+b+"}");case "function":return"<function>";case "string":return a;default:return""+a}};w.__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 f=d++,f=c[f];if(f==b||w.__interfLoop(f,b))return!0}return w.__interfLoop(a.__super__,b)};w.__instanceof=function(a,b){if(null==
b)return!1;switch(b){case hc:return(a|0)===a;case ec:return"number"==typeof a;case fc:return"boolean"==typeof a;case String:return"string"==typeof a;case Array:return a instanceof Array&&null==a.__enum__;case ic:return!0;default:if(null!=a){if("function"==typeof b&&(a instanceof b||w.__interfLoop(w.getClass(a),b)))return!0}else return!1;return b==jc&&null!=a.__name__||b==kc&&null!=a.__ename__?!0:a.__enum__==b}};var Vb=function(){};e["js.html._CanvasElement.CanvasUtil"]=Vb;Vb.__name__=["js","html",
"_CanvasElement","CanvasUtil"];Vb.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 La=function(){this.printLineNumbers=this.printPosition=!0};e["mconsole.PrinterBase"]=La;La.__name__=["mconsole","PrinterBase"];La.prototype={print:function(a,b,c,d){for(var b=b.slice(),e=0,f=b.length;e<f;){var h=e++;b[h]=R.string(b[h])}var b=b.join(", "),h="@ "+d.className+"."+d.methodName,i;i=null==d.lineNumber?
"null":""+d.lineNumber;f=e="";this.printPosition&&h!=this.position&&this.printLine(v.none,h,d);this.printLineNumbers&&(f=fa.lpad(""," ",5),e=h!=this.position||i!=this.lineNumber?fa.lpad(i," ",4)+" ":f);this.position=h;this.lineNumber=i;var j;switch(a[1]){case 0:j=v.white;break;case 1:j=v.blue;break;case 2:j=v.green;break;case 3:j=v.yellow;break;case 4:j=v.red}a=fa.lpad(""," ",2*c);b=(e+a+b).split("\n").join("\n"+f+a);this.printLine(j,b,d)},printLine:function(){throw"method not implemented in ConsolePrinterBase";
},__class__:La};var Sb=function(){};e["mconsole.Printer"]=Sb;Sb.__name__=["mconsole","Printer"];Sb.prototype={__class__:Sb};var Ma=function(){La.call(this);this.atBottom=!0;this.projectHome="/Users/lukaszhulanicki/Work/gry_flash/szeregowanie/";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"]=Ma;Ma.__name__=["mconsole","ConsoleView"];Ma.__interfaces__=[Sb];Ma.__super__=La;Ma.prototype=m(La.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__:Ma});var i=function(){};e["mconsole.Console"]=i;i.__name__=["mconsole","Console"];i.start=function(){i.running||(i.running=!0,i.previousTrace=Rb.trace,Rb.trace=i.haxeTrace)};
i.haxeTrace=function(a,b){var c=b.customParams;null==c?c=[]:b.customParams=null;var d;switch(a){case "log":d=t.log;break;case "warn":d=t.warn;break;case "info":d=t.info;break;case "debug":d=t.debug;break;case "error":d=t.error;break;default:c.unshift(a),d=t.log}i.hasConsole&&i.callConsole(R.string(d),c);i.print(d,c,b)};i.print=function(a,b,c){for(var d=0,e=i.printers;d<e.length;){var f=e[d];++d;f.print(a,b,i.groupDepth,c)}};i.log=function(a,b){i.hasConsole&&i.callConsole("log",[a]);i.print(t.log,
[a],b)};i.detectConsole=function(){null!=console&&null==console[i.dirxml]&&(i.dirxml="log");return void 0!=console&&void 0!=console.log&&void 0!=console.warn};i.callConsole=function(a,b){null!=console[a]&&("log"==a&&w.__instanceof(b[0],aa)&&(a=i.dirxml),null!=console[a].apply?console[a].apply(console,i.toConsoleValues(b)):null!=Function.prototype.bind&&Function.prototype.bind.call(console[a],console).apply(console,i.toConsoleValues(b)))};i.toConsoleValues=function(a){for(var b=0,c=a.length;b<c;){var d=
b++;a[d]=i.toConsoleValue(a[d])}return a};i.toConsoleValue=function(a){var b=F.getClass(a),b=null==b?"":F.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();ea.setField(b,R.string(d),i.toConsoleValue(a.get(d)))}return b}c=F["typeof"](a);switch(c[1]){case 7:b=[];c=F.getEnumName(c[2])+"."+F.enumConstructor(a);a=F.enumParameters(a);if(0<a.length){b.push(c+
"(");c=0;for(d=a.length;c<d;){var e=c++;b.push(i.toConsoleValue(a[e]))}b.push(")")}else return[c];return b}if("Array"==b||"List"==b||"haxe.FastList"==b){b=[];for(a=Tb(a)();a.hasNext();)c=a.next(),b.push(i.toConsoleValue(c));return b}return a};var t=e["mconsole.LogLevel"]={__ename__:["mconsole","LogLevel"],__constructs__:["log","info","debug","warn","error"]};t.log=["log",0];t.log.__enum__=t;t.info=["info",1];t.info.__enum__=t;t.debug=["debug",2];t.debug.__enum__=t;t.warn=["warn",3];t.warn.__enum__=
t;t.error=["error",4];t.error.__enum__=t;var v=e["mconsole.ConsoleColor"]={__ename__:["mconsole","ConsoleColor"],__constructs__:"none,white,blue,green,yellow,red".split(",")};v.none=["none",0];v.none.__enum__=v;v.white=["white",1];v.white.__enum__=v;v.blue=["blue",2];v.blue.__enum__=v;v.green=["green",3];v.green.__enum__=v;v.yellow=["yellow",4];v.yellow.__enum__=v;v.red=["red",5];v.red.__enum__=v;var gc=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 hc=e.Int={__name__:["Int"]},ic=e.Dynamic={__name__:["Dynamic"]},ec=e.Float=Number;ec.__name__=["Float"];var fc=e.Bool=Boolean;fc.__ename__=["Bool"];var jc=e.Class={__name__:["Class"]},kc={};aa.Element="element";aa.PCData="pcdata";
aa.CData="cdata";aa.Comment="comment";aa.DocType="doctype";aa.ProcessingInstruction="processingInstruction";aa.Document="document";ba.instance=new ba;y.DISPATCHING_SENTINEL=new ra(null,null);j.root=new B;j.uncaughtError=new o;j.hidden=new H(!1);j.volume=new C(1);j._platform=ba.instance;j._calledInit=!1;I.__meta__={obj:{assets:[{settings:[{bytes:7883,md5:"bb37f1a74a4c8a9c8d3554f1144d0b68",name:"model.json"}],bootstrap:[{bytes:5031,md5:"6ce6bfd1a8dc619872697a7d53f7155e",name:"splash.png"}],game:[{bytes:5554,
md5:"622789200d2b9ff653580ba7133a3482",name:"btnEnd.png"},{bytes:5554,md5:"622789200d2b9ff653580ba7133a3482",name:"btnrestart.png"},{bytes:4471,md5:"06e02a34db8a24cb272d0541bc493b6a",name:"btnstart.png"},{bytes:5160,md5:"167b5dad6c8a515d27aa73c6d4237961",name:"click.mp3"},{bytes:5850,md5:"b3eb3f86938f1addc1743907cdb2627d",name:"failed.mp3"},{bytes:56207,md5:"4af9c8edf1a891571795fa656446943f",name:"game.png"},{bytes:111594,md5:"519ee70bcf526b49a132de531a4ddb9d",name:"gameLoop.mp3"},{bytes:2466,md5:"58389efa7777bdc7b6806a980b4fc4ae",
name:"l1_b1.png"},{bytes:2794,md5:"d9f661fbda7999aff955c0a484c8dd2f",name:"l1_b10.png"},{bytes:2438,md5:"c1efb24248d39b9ca745af370fb40666",name:"l1_b11.png"},{bytes:2556,md5:"6ecf62fbcba7751fb5ae16c65d85245c",name:"l1_b12.png"},{bytes:2751,md5:"b4847a138e9ecfcb5f5f040bd4410e0a",name:"l1_b13.png"},{bytes:2828,md5:"68ec36d7ac9e571f349410356beda0f4",name:"l1_b14.png"},{bytes:2926,md5:"b98a20726522012dd4759ff201ebc871",name:"l1_b15.png"},{bytes:2715,md5:"c352288c8b0becf092ab6c60125a36b6",name:"l1_b16.png"},
{bytes:2660,md5:"a28c9239bc24ddb433c76246403294c7",name:"l1_b17.png"},{bytes:2843,md5:"24009bc4164a724b88b6eaa8ee6bfbd5",name:"l1_b18.png"},{bytes:2363,md5:"3f25656927715d5d397ddafd279864e1",name:"l1_b19.png"},{bytes:2739,md5:"a7445c0c610cd834e561340f4dd49385",name:"l1_b2.png"},{bytes:2650,md5:"2325df7b13ce3df91ef14abc99e04ba3",name:"l1_b20.png"},{bytes:2863,md5:"bedeebc471c0f43d97c071f88f3e3918",name:"l1_b3.png"},{bytes:2805,md5:"db4cf8fa5b73cbfec84bd72e721c77bb",name:"l1_b4.png"},{bytes:2909,md5:"f03a6ee96453d66e4e3226298f8b6588",
name:"l1_b5.png"},{bytes:2577,md5:"3ea39e178814d1a90e679866eef8afab",name:"l1_b6.png"},{bytes:2769,md5:"5e6c02da22a148ebdac439b8751ef0d4",name:"l1_b7.png"},{bytes:2902,md5:"306c4f5382ba5e4b7c208b6eaf138fc6",name:"l1_b8.png"},{bytes:2590,md5:"8ed2dbbb42fa110918d67203f394306f",name:"l1_b9.png"},{bytes:15163,md5:"7b524ff4fc743877e08f9248aab2486c",name:"l1_title.png"},{bytes:18274,md5:"9174f73a918dfd280df15b7735725bb8",name:"l2_b1.png"},{bytes:9030,md5:"692d4579112fea21a2f5349e5f0efa17",name:"l2_b2.png"},
{bytes:13106,md5:"aed0959f19aceead5931119fd4051c19",name:"l2_b3.png"},{bytes:13774,md5:"9287b60bc9357ef726e26e3b019470a9",name:"l2_b4.png"},{bytes:6059,md5:"940a7b946fda40f85ab10a1fa07ff9f8",name:"l2_board.png"},{bytes:14950,md5:"4a39fbce3d31ff8d61bacf988aa98fe1",name:"l2_title.png"},{bytes:20863,md5:"dfa6062169618bd55895984fc7254a27",name:"l3_b1.png"},{bytes:7388,md5:"fe9a4f104cc5b477d1c413c700d327e7",name:"l3_b2.png"},{bytes:11574,md5:"9363cb0dbf5736f6eea476fb76ad7228",name:"l3_b3.png"},{bytes:16661,
md5:"061bea716b62630056c94f75b99b7bfd",name:"l3_b4.png"},{bytes:20677,md5:"2ca4f028788ec50b3001e9e9cbd35eb5",name:"l3_b5.png"},{bytes:20682,md5:"ca826295f944c858507a72c4c001eef0",name:"l3_b6.png"},{bytes:16862,md5:"eaef9ebbd8e2eec862feda3e0800370d",name:"l3_b7.png"},{bytes:7157,md5:"d18b335a2fbf6219b04a207fcab835cb",name:"l3_board.png"},{bytes:17387,md5:"03bdd7e80eece1287c59bdb65a8380b8",name:"l3_title.png"},{bytes:20883,md5:"12879e7f4afa403878f7a3c5d22002f1",name:"l4_b1.png"},{bytes:21074,md5:"a83d7598edf18aa0c6debce39c588abf",
name:"l4_b2.png"},{bytes:11357,md5:"ce7a12e413f21bd5e925107170dd20ac",name:"l4_b3.png"},{bytes:13939,md5:"eb4e3d100d2af693ad832129e295acbb",name:"l4_b4.png"},{bytes:24340,md5:"9819afbf1bc78bb0f0ac35f7f2b91d41",name:"l4_b5.png"},{bytes:24762,md5:"981eb80abe35ef1009559acc9c05ba0f",name:"l4_b6.png"},{bytes:21288,md5:"cf950ed61d9d9da50fb1069a4be4165c",name:"l4_b7.png"},{bytes:7157,md5:"d18b335a2fbf6219b04a207fcab835cb",name:"l4_board.png"},{bytes:16497,md5:"cc3dcab8342398c6123a1f3cd37f6e5b",name:"l4_title.png"},
{bytes:1757,md5:"071e9fd6da8ac6878ba3be73020b7459",name:"l5_b1.png"},{bytes:1027,md5:"f39fa0ba99deaf9ed30b6e8a5f656009",name:"l5_b10.png"},{bytes:748,md5:"dc37f0ad4144dcab9e93d58c8de2ab9a",name:"l5_b11.png"},{bytes:1188,md5:"c5dd67d5a7a97061b9f1932ccf4ab0c3",name:"l5_b12.png"},{bytes:1070,md5:"ceca43b3d0bc378daa29cf3a4a547129",name:"l5_b13.png"},{bytes:1394,md5:"c78372aae6dcc7252397ab8cbd348ed7",name:"l5_b14.png"},{bytes:1079,md5:"45ae1185a1462b540d46bc4ed9bf2237",name:"l5_b15.png"},{bytes:1273,md5:"5358e1d708dbaade05dd3a3f018a76f9",
name:"l5_b16.png"},{bytes:1705,md5:"7766eeea07e658ad3fdbddb4299001b5",name:"l5_b17.png"},{bytes:603,md5:"5ff975a59084d31f3c01650aafd5d9e2",name:"l5_b18.png"},{bytes:1183,md5:"115993ba5c811e719c269898e873b870",name:"l5_b19.png"},{bytes:828,md5:"121e34b12b6ca5ea373d892a7e86d701",name:"l5_b2.png"},{bytes:1277,md5:"d24f7e5f0a3dbd630332426a9d3945d7",name:"l5_b20.png"},{bytes:1491,md5:"a1ea3dfda59979a7e620bc0139791879",name:"l5_b3.png"},{bytes:1394,md5:"c78372aae6dcc7252397ab8cbd348ed7",name:"l5_b4.png"},
{bytes:944,md5:"703e0cce69470324d98acbe5b49081a2",name:"l5_b5.png"},{bytes:1748,md5:"73377cf0f6de6817343c2c8e36a9b1e9",name:"l5_b6.png"},{bytes:885,md5:"b2f7567ac643b893d89c356016a33c2e",name:"l5_b7.png"},{bytes:1226,md5:"4e1b8fe367c925992390a5aa93e9217b",name:"l5_b8.png"},{bytes:1183,md5:"115993ba5c811e719c269898e873b870",name:"l5_b9.png"},{bytes:12082,md5:"c35c49aae1fa1a1a8cdd9422faf95676",name:"l5_board.png"},{bytes:9902,md5:"aca352bf4c31e2de2a770a502b1d9d40",name:"l5_title.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:87741,md5:"8fefb1a165be0313588c3711b8b713a4",name:"msgEnd.png"},{bytes:24047,md5:"4e56059d57b6d36a6b9aaf8d96a283e4",name:"msgFailure.png"},{bytes:88474,md5:"d34248f7600d4ebea18589b2bedd7d0e",name:"msgStart.png"},{bytes:784,md5:"c02ae3be15b679225b04099203603ebe",name:"soundOff.png"},{bytes:667,md5:"f9dfada65948219df8e20962cf5a774d",
name:"soundOn.png"},{bytes:22568,md5:"45265b042410cfcd6a4cf62b713b67a5",name:"success-minor.mp3"},{bytes:35622,md5:"69dfd3a83be47099959a15187892545d",name:"success.mp3"}]}]}};I._supportsCrossOrigin=function(){var a;a=0<=window.navigator.userAgent.indexOf("Linux; U; Android")?!1:null!=(new XMLHttpRequest).withCredentials;a||null;return a}();r._scratchPoint=new Bb;K._sharedEvent=new Eb;G._sharedEvent=new Fb;qa.CANVAS_TEXTURES=(new na("(iPhone|iPod|iPad)","")).match(window.navigator.userAgent);p._mediaRefCount=
0;p._detectBlobSupport=!0;l.VENDOR_PREFIXES=["webkit","moz","ms","o","khtml"];l.SHOULD_HIDE_MOBILE_BROWSER=window.top==window&&(new na("Mobile(/.*)? Safari","")).match(window.navigator.userAgent);q._detectSupport=!0;U._scratchMatrix=new W;s.onBootstrapAssetsReady=new o;s.onGameAssetsReady=new o;s.onContextReady=new o;s.onOverlaysCreateRequest=new o;s.onCreateSceneRequest=new o;s.onRestartGame=new o;s.onEndOfGame=new o;s.onClick=new o;s.onSuccessMinor=new o;s.onFailure=new o;u.x0=164;u.y0=542;u.delta=
52;u.num=10;la.count=0;i.defaultPrinter=new Ma;i.printers=[i.defaultPrinter];i.groupDepth=0;i.running=!1;i.dirxml="dirxml";i.hasConsole=i.detectConsole();Ka.main()})();
