123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485 |
- var ns_egret;(function(c){var e=function(){function c(){this._hashCode=c.hashCount++}Object.defineProperty(c.prototype,"hashCode",{get:function(){return this._hashCode},enumerable:!0,configurable:!0});c.hashCount=1;return c}();c.HashObject=e})(ns_egret||(ns_egret={}));var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(b){"undefined"===typeof b&&(b=300);c.call(this);this.objectPool=[];this._length=0;1>b&&(b=1);this.autoDisposeTime=b;this.frameCount=0}__extends(a,c);a.prototype._checkFrame=function(){this.frameCount--;0>=this.frameCount&&this.dispose()};Object.defineProperty(a.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0});a.prototype.push=function(b){var f=this.objectPool;-1==f.indexOf(b)&&(f.push(b),this._length++,0==this.frameCount&&
- (this.frameCount=this.autoDisposeTime,a._callBackList.push(this)))};a.prototype.pop=function(){if(0==this._length)return null;this._length--;return this.objectPool.pop()};a.prototype.dispose=function(){0<this._length&&(this.objectPool=[],this._length=0);this.frameCount=0;var b=a._callBackList,f=b.indexOf(this);-1!=f&&b.splice(f,1)};a._callBackList=[];return a}(c.HashObject);c.Recycler=e})(ns_egret||(ns_egret={}));(function(c){c.__START_TIME;c.getTimer=function(){return Date.now()-c.__START_TIME}})(ns_egret||(ns_egret={}));(function(c){c.__callLaterFunctionList=[];c.__callLaterThisList=[];c.__callLaterArgsList=[];c.callLater=function(e,d){for(var a=[],b=0;b<arguments.length-2;b++)a[b]=arguments[b+2];c.__callLaterFunctionList.push(e);c.__callLaterThisList.push(d);c.__callLaterArgsList.push(a)}})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(b,a,m){"undefined"===typeof a&&(a=!1);"undefined"===typeof m&&(m=!1);c.call(this);this._eventPhase=2;this._isPropagationImmediateStopped=this._isPropagationStopped=this._isDefaultPrevented=!1;this.isNew=!0;this._type=b;this._bubbles=a;this._cancelable=m}__extends(a,c);Object.defineProperty(a.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"bubbles",{get:function(){return this.bubbles},enumerable:!0,
- configurable:!0});Object.defineProperty(a.prototype,"cancelable",{get:function(){return this._cancelable},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"eventPhase",{get:function(){return this._eventPhase},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"currentTarget",{get:function(){return this._currentTarget},enumerable:!0,configurable:!0});a.prototype._setCurrentTarget=function(b){this._currentTarget=b};Object.defineProperty(a.prototype,"target",{get:function(){return this._target},
- enumerable:!0,configurable:!0});a.prototype.isDefaultPrevented=function(){return this._isDefaultPrevented};a.prototype.preventDefault=function(){this._cancelable&&(this._isDefaultPrevented=!0)};a.prototype.stopPropagation=function(){this._bubbles&&(this._isPropagationStopped=!0)};a.prototype.stopImmediatePropagation=function(){this._bubbles&&(this._isPropagationImmediateStopped=!0)};a.prototype._reset=function(){this.isNew?this.isNew=!1:(this._isPropagationImmediateStopped=this._isPropagationStopped=
- this._isDefaultPrevented=!1,this._currentTarget=this._target=null,this._eventPhase=2)};a.ADDED_TO_STAGE="addedToStage";a.REMOVED_FROM_STAGE="removedFromStage";a.ADDED="added";a.REMOVED="removed";a.COMPLETE="complete";a.ENTER_FRAME="enterFrame";a.RENDER="render";a.FINISH_RENDER="finishRender";a.FINISH_UPDATE_TRANSFORM="finishUpdateTransform";a.LEAVE_STAGE="leaveStage";a.RESIZE="resize";a.CHANGE="change";return a}(c.HashObject);c.Event=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a,c,e,g,k,l,n,p,q){"undefined"===typeof a&&(a=!0);"undefined"===typeof c&&(c=!0);"undefined"===typeof e&&(e=0);"undefined"===typeof g&&(g=0);"undefined"===typeof k&&(k=0);"undefined"===typeof l&&(l=!1);"undefined"===typeof n&&(n=!1);"undefined"===typeof q&&(q=!1);d.call(this,b,a,c);this._localY=this._localX=this._stageY=this._stageX=0;this.touchPointID=e;this._stageX=g;this._stageY=k;this.ctrlKey=l;this.altKey=n;this.touchDown=q}__extends(a,d);Object.defineProperty(a.prototype,
- "stageX",{get:function(){return this._stageX},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stageY",{get:function(){return this._stageY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"localX",{get:function(){return this._localX},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"localY",{get:function(){return this._localY},enumerable:!0,configurable:!0});a.prototype._setCurrentTarget=function(b){d.prototype._setCurrentTarget.call(this,b);b instanceof
- c.DisplayObject&&(b=b.globalToLocal(this._stageX,this._stageY),this._localX=b.x,this._localY=b.y)};a.prototype.updateAfterEvent=function(){};a.TOUCH_TAP="touchTap";a.TOUCH_MOVE="touchMove";a.TOUCH_BEGAN="touchBegan";a.TOUCH_END="touchEnd";a.TOUCH_RELEASE_OUTSIDE="touchReleaseOutside";a.TOUCH_ROLL_OUT="touchRollOut";a.TOUCH_ROLL_OVER="touchRollOver";a.TOUCH_OUT="touchOut";a.TOUCH_OVER="touchOver";return a}(c.Event);c.TouchEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,m){"undefined"===typeof a&&(a=!1);"undefined"===typeof m&&(m=!1);c.call(this,b,a,m)}__extends(a,c);a.prototype.updateAfterEvent=function(){};a.TIMER="timer";a.TIMER_COMPLETE="timerComplete";return a}(c.Event);c.TimerEvent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.CAPTURING_PHASE=1;c.AT_TARGET=2;c.BUBBLING_PHASE=3;return c}();c.EventPhase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b){"undefined"===typeof b&&(b=null);d.call(this);this._isUseCapture=!1;this._eventTarget=b?b:this}__extends(a,d);a.prototype.addEventListener=function(b,a,m,d,e){"undefined"===typeof d&&(d=!1);"undefined"===typeof e&&(e=0);c.DEBUG&&c.DEBUG.ADD_EVENT_LISTENER&&c.DEBUG.checkAddEventListener(b,a,m,d,e);d?(this._captureEventsMap||(this._captureEventsMap={}),d=this._captureEventsMap):(this._eventsMap||(this._eventsMap={}),d=this._eventsMap);var k=d[b];k||(k=d[b]=
- []);this._insertEventBin(k,a,m,e)};a.prototype._insertEventBin=function(b,a,c,d){for(var e=-1,k=b.length,l=0;l<k;l++){var n=b[l];if(n.listener===a&&n.thisObject===c)return!1;-1==e&&n.priority<d&&(e=l)}a={listener:a,thisObject:c,priority:d};-1!=e?b.splice(e,0,a):b.push(a);return!0};a.prototype.removeEventListener=function(b,a,c,d){"undefined"===typeof d&&(d=!1);if(d=d?this._captureEventsMap:this._eventsMap){var e=d[b];e&&(this._removeEventBin(e,a,c),0==e.length&&delete d[b])}};a.prototype._removeEventBin=
- function(b,a,c){for(var d=b.length,e=0;e<d;e++){var k=b[e];if(k.listener===a&&k.thisObject===c)return b.splice(e,1),!0}return!1};a.prototype.hasEventListener=function(b){return this._eventsMap&&this._eventsMap[b]||this._captureEventsMap&&this._captureEventsMap[b]};a.prototype.willTrigger=function(b){return this.hasEventListener(b)};a.prototype.dispatchEvent=function(b){b._reset();b._target=this._eventTarget;b._setCurrentTarget(this._eventTarget);return this._notifyListener(b)};a.prototype._notifyListener=
- function(b){var a=1==b._eventPhase?this._captureEventsMap:this._eventsMap;if(!a)return!0;a=a[b.type];if(!a)return!0;for(var a=a.concat(),c=a.length,d=0;d<c;d++){var e=a[d];e.listener.call(e.thisObject,b);if(b._isPropagationImmediateStopped)break}return!b.isDefaultPrevented()};a.prototype.dispatchEventWith=function(b,f,m){"undefined"===typeof f&&(f=!1);"undefined"===typeof m&&(m=null);var d=a.eventRecycler,e=d.pop();e||(e=new c.Event(""));e._type=b;e._bubbles=f;e.data=m;this.dispatchEvent(e);d.push(e)};
- a.eventRecycler=new c.Recycler;return a}(c.HashObject);c.EventDispatcher=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.reuseEvent=new c.Event("")}__extends(a,d);a.prototype.run=function(){c.Ticker.getInstance().run();c.Ticker.getInstance().register(this.renderLoop,this,Number.MIN_VALUE);c.Ticker.getInstance().register(this.broadcastEnterFrame,this,Number.MAX_VALUE);this.touchContext.run()};a.prototype.renderLoop=function(b){b=this.rendererContext;b.clearScreen();this.dispatchEventWith(c.Event.RENDER);c.Stage._invalidateRenderFlag&&(this.broadcastRender(),
- c.Stage._invalidateRenderFlag=!1);this.doCallLaterList();this.stage.updateTransform();this.dispatchEventWith(c.Event.FINISH_UPDATE_TRANSFORM);this.stage.draw(b);this.dispatchEventWith(c.Event.FINISH_RENDER)};a.prototype.broadcastEnterFrame=function(b){b=this.reuseEvent;b._type=c.Event.ENTER_FRAME;this.dispatchEvent(b);for(var a=c.DisplayObject._enterFrameCallBackList.concat(),m=a.length,d=0;d<m;d++){var e=a[d];b._target=e.display;b._setCurrentTarget(e.display);e.listener.call(e.thisObject,b)}a=c.Recycler._callBackList;
- for(d=a.length-1;0<=d;d--)a[d]._checkFrame()};a.prototype.broadcastRender=function(){var b=this.reuseEvent;b._type=c.Event.RENDER;for(var a=c.DisplayObject._renderCallBackList.concat(),m=a.length,d=0;d<m;d++){var e=a[d];b._target=e.display;b._setCurrentTarget(e.display);e.listener.call(e.thisObject,b)}};a.prototype.doCallLaterList=function(){if(0!=c.__callLaterFunctionList.length){var b=c.__callLaterFunctionList;c.__callLaterFunctionList=[];var a=c.__callLaterThisList;c.__callLaterThisList=[];var d=
- c.__callLaterArgsList;c.__callLaterArgsList=[];for(var e=b.length,g=0;g<e;g++){var k=b[g];null!=k&&k.apply(a[g],d[g])}}};return a}(c.EventDispatcher);c.MainContext=e})(ns_egret||(ns_egret={}));ns_egret.MainContext.instance=new ns_egret.MainContext;(function(c){var e=function(){function d(){this._tick=this._preDrawCount=this._updateTransformPerformanceCost=this._renderPerformanceCost=this._logicPerformanceCost=this._lastFrameTime=this._lastTime=0}d.getInstance=function(){null==d.instance&&(d.instance=new d);return d.instance};d.prototype.run=function(){c.Ticker.getInstance().register(this.update,this);null==this._txt&&(this._txt=new c.TextField,this._txt.size=28,c.MainContext.instance.stage.addChild(this._txt));var a=c.MainContext.instance;
- a.addEventListener(c.Event.ENTER_FRAME,this.onEnterFrame,this);a.addEventListener(c.Event.RENDER,this.onStartRender,this);a.addEventListener(c.Event.FINISH_RENDER,this.onFinishRender,this);a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM,this.onFinishUpdateTransform,this)};d.prototype.onEnterFrame=function(a){this._lastTime=c.getTimer()};d.prototype.onStartRender=function(a){a=c.getTimer();this._logicPerformanceCost=a-this._lastTime;this._lastTime=a};d.prototype.onFinishUpdateTransform=function(a){a=
- c.getTimer();this._updateTransformPerformanceCost=a-this._lastTime;this._lastTime=a};d.prototype.onFinishRender=function(a){a=c.getTimer();this._renderPerformanceCost=a-this._lastTime;this._lastTime=a};d.prototype.update=function(a){var b=c.getTimer();a=b-this._lastFrameTime;this._lastFrameTime=b;this._tick++;if(6==this._tick){this._tick=0;var b=(this._preDrawCount-1).toString(),f=Math.ceil(this._logicPerformanceCost).toString()+","+Math.ceil(this._updateTransformPerformanceCost).toString()+","+Math.ceil(this._renderPerformanceCost).toString()+
- ","+Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();this._txt.text=b+"\n"+f+"\n"+Math.floor(1E3/a).toString()}this._preDrawCount=0};d.prototype.onDrawImage=function(){this._preDrawCount++};return d}();c.Profiler=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments);this._timeScale=1;this._paused=!1;this.callBackList=[]}__extends(a,d);a.prototype.run=function(){c.__START_TIME=(new Date).getTime();c.MainContext.instance.deviceContext.executeMainLoop(this.update,this)};a.prototype.update=function(b){var a=this.callBackList.concat(),c=a.length;b*=this._timeScale;b*=this._timeScale;for(var d=0;d<c;d++){var e=a[d];e.listener.call(e.thisObject,b)}};a.prototype.register=function(b,a,c){"undefined"===
- typeof c&&(c=0);this._insertEventBin(this.callBackList,b,a,c)};a.prototype.unregister=function(b,a){this._removeEventBin(this.callBackList,b,a)};a.prototype.callLater=function(b,a,c){"undefined"===typeof c&&(c=0);var d=this,e=0;this.register(function(k){0==c?(d.unregister(arguments.callee,a),b.apply(a)):(e+=k,e>=c&&(d.unregister(arguments.callee,a),b.apply(a)))},a)};a.prototype.setTimeout=function(b,a,c){for(var d=[],e=0;e<arguments.length-3;e++)d[e]=arguments[e+3];var k=this,l=0;this.register(function(e){0==
- c?(k.unregister(arguments.callee,a),b.apply(a,d)):(l+=e,l>=c&&(k.unregister(arguments.callee,a),b.apply(a,d)))},a)};a.prototype.setTimeScale=function(b){this._timeScale=b};a.prototype.getTimeScale=function(){return this._timeScale};a.prototype.pause=function(){this._paused=!0};a.prototype.resume=function(){this._paused=!1};a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.now=function(){return c.getTimer()};return a}(c.EventDispatcher);c.Ticker=e})(ns_egret||(ns_egret=
- {}));(function(c){var e=function(){function c(){}c.LEFT="left";c.RIGHT="right";c.CENTER="center";c.JUSTIFY="justify";c.CONTENT_JUSTIFY="contentJustify";return c}();c.HorizontalAlign=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.TOP="top";c.BOTTOM="bottom";c.MIDDLE="middle";c.JUSTIFY="justify";c.CONTENT_JUSTIFY="contentJustify";return c}();c.VerticalAlign=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a){"undefined"===typeof b&&(b=1E3);"undefined"===typeof a&&(a=0);d.call(this);this._currentCount=0;this.delay=b;this.repeatCount=a}__extends(a,d);a.prototype.currentCount=function(){return this._currentCount};a.prototype.running=function(){return this._running};a.prototype.reset=function(){this.stop();this._currentCount=0};a.prototype.start=function(){this._running||(this.lastTime=c.getTimer(),0!=this._currentCount&&(this._currentCount=0),c.Ticker.getInstance().register(this.onEnterFrame,
- this),this._running=!0)};a.prototype.stop=function(){this._running&&(c.Ticker.getInstance().unregister(this.onEnterFrame,this),this._running=!1)};a.prototype.onEnterFrame=function(b){a.timerEvent||(a.timerEvent=new c.TimerEvent(c.TimerEvent.TIMER));b=a.timerEvent;var f=c.getTimer();f-this.lastTime>this.delay&&(this.lastTime=f,this._currentCount++,b._type=c.TimerEvent.TIMER,this.dispatchEvent(b),0<this.repeatCount&&this._currentCount>=this.repeatCount&&(this.stop(),b._type=c.TimerEvent.TIMER_COMPLETE,
- this.dispatchEvent(b)))};return a}(c.EventDispatcher);c.Timer=e})(ns_egret||(ns_egret={}));(function(c){c.getQualifiedClassName=function(c){var a;c=c.prototype?c.prototype.constructor:c.__proto__.constructor;if(!e[c]){a=c.toString();var b=a.indexOf("(");a=a.substring(9,b);e[c]=a}return e[c]};var e={}})(ns_egret||(ns_egret={}));(function(c){var e={};c.getDefinitionByName=function(c){if(!c)return null;var a=e[c];if(a)return a;for(var b=c.split("."),f=b.length,a=window,m=0;m<f;m++)if(a=a[b[m]],!a)return null;return e[c]=a}})(ns_egret||(ns_egret={}));(function(c){c.hasDefinition=function(e){return c.getDefinitionByName(e)?!0:!1}})(ns_egret||(ns_egret={}));(function(c){c.toColorString=function(c){if(isNaN(c)||0>c)c=0;16777215<c&&(c=16777215);for(c=c.toString(16).toUpperCase();6>c.length;)c="0"+c;return"#"+c}})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a,c,e,g,k){"undefined"===typeof b&&(b=1);"undefined"===typeof a&&(a=0);"undefined"===typeof c&&(c=0);"undefined"===typeof e&&(e=1);"undefined"===typeof g&&(g=0);"undefined"===typeof k&&(k=0);d.call(this);this.a=b;this.b=a;this.c=c;this.d=e;this.tx=g;this.ty=k;this.invert=function(){var b=this.a,a=this.b,f=this.c,c=this.d,d=this.tx,m=b*c-a*f;this.a=c/m;this.b=-a/m;this.c=-f/m;this.d=b/m;this.tx=(f*this.ty-c*d)/m;this.ty=-(b*this.ty-a*d)/m;return this}}__extends(a,
- d);a.prototype.prepend=function(b,a,c,d,e,k){var l=this.tx;if(1!=b||0!=a||0!=c||1!=d){var n=this.a,p=this.c;this.a=n*b+this.b*c;this.b=n*a+this.b*d;this.c=p*b+this.d*c;this.d=p*a+this.d*d}this.tx=l*b+this.ty*c+e;this.ty=l*a+this.ty*d+k;return this};a.prototype.append=function(b,a,c,d,e,k){var l=this.a,n=this.b,p=this.c,q=this.d;this.a=b*l+a*p;this.b=b*n+a*q;this.c=c*l+d*p;this.d=c*n+d*q;this.tx=e*l+k*p+this.tx;this.ty=e*n+k*q+this.ty;return this};a.prototype.prependMatrix=function(b){this.prepend(b.a,
- b.b,b.c,b.d,b.tx,b.ty);return this};a.prototype.appendMatrix=function(b){this.append(b.a,b.b,b.c,b.d,b.tx,b.ty);return this};a.prototype.prependTransform=function(b,f,c,d,e,k,l,n,p){if(e%360){var q=e*a.DEG_TO_RAD;e=Math.cos(q);q=Math.sin(q)}else e=1,q=0;if(n||p)this.tx-=n,this.ty-=p;k||l?(k*=a.DEG_TO_RAD,l*=a.DEG_TO_RAD,this.prepend(e*c,q*c,-q*d,e*d,0,0),this.prepend(Math.cos(l),Math.sin(l),-Math.sin(k),Math.cos(k),b,f)):this.prepend(e*c,q*c,-q*d,e*d,b,f);return this};a.prototype.appendTransform=
- function(b,f,c,d,e,k,l,n,p){if(e%360){var q=e*a.DEG_TO_RAD;e=Math.cos(q);q=Math.sin(q)}else e=1,q=0;k||l?(k*=a.DEG_TO_RAD,l*=a.DEG_TO_RAD,this.append(Math.cos(l),Math.sin(l),-Math.sin(k),Math.cos(k),b,f),this.append(e*c,q*c,-q*d,e*d,0,0)):this.append(e*c,q*c,-q*d,e*d,b,f);if(n||p)this.tx-=n*this.a+p*this.c,this.ty-=n*this.b+p*this.d;return this};a.prototype.appendTransformFromDisplay=function(b){var a,c;0!=b.anchorX||0!=b.anchorY?(c=b.getBounds(),a=c.width*b.anchorX,c=c.height*b.anchorY):(a=b.anchorOffsetX,
- c=b.anchorOffsetY);this.identity();this.appendTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,a,c);return this};a.prototype.rotate=function(b){var a=Math.cos(b);b=Math.sin(b);var c=this.a,d=this.c,e=this.tx;this.a=c*a-this.b*b;this.b=c*b+this.b*a;this.c=d*a-this.d*b;this.d=d*b+this.d*a;this.tx=e*a-this.ty*b;this.ty=e*b+this.ty*a;return this};a.prototype.skew=function(b,f){b*=a.DEG_TO_RAD;f*=a.DEG_TO_RAD;this.append(Math.cos(f),Math.sin(f),-Math.sin(b),Math.cos(b),0,0);return this};
- a.prototype.scale=function(b,a){this.a*=b;this.d*=a;this.c*=b;this.b*=a;this.tx*=b;this.ty*=a;return this};a.prototype.translate=function(b,a){this.tx+=b;this.ty+=a;return this};a.prototype.identity=function(){this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;return this};a.prototype.isIdentity=function(){return 0==this.tx&&0==this.ty&&1==this.a&&0==this.b&&0==this.c&&1==this.d};a.prototype.transformPoint=function(b,a,c){c=c||{};c.x=b*this.a+a*this.c+this.tx;c.y=b*this.b+a*this.d+this.ty;return c};
- a.prototype.decompose=function(b){null==b&&(b={});b.x=this.tx;b.y=this.ty;b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b);b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var f=Math.atan2(-this.c,this.d),c=Math.atan2(this.b,this.a);f==c?(b.rotation=c/a.DEG_TO_RAD,0>this.a&&0<=this.d&&(b.rotation+=0>=b.rotation?180:-180),b.skewX=b.skewY=0):(b.skewX=f/a.DEG_TO_RAD,b.skewY=c/a.DEG_TO_RAD);return b};a.transformCoords=function(b,a,d){var e=new c.Point(0,0);e.x=b.a*a+b.c*d+b.tx;e.y=b.d*d+b.b*a+b.ty;return e};
- a.identity=new a;a.DEG_TO_RAD=Math.PI/180;return a}(c.HashObject);c.Matrix=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);c.call(this);this.x=b;this.y=a}__extends(a,c);a.prototype.clone=function(){return new a(this.x,this.y)};a.identity=new a(0,0);return a}(c.HashObject);c.Point=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(b,a,m,e){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);"undefined"===typeof m&&(m=0);"undefined"===typeof e&&(e=0);c.call(this);this.x=b;this.y=a;this.width=m;this.height=e}__extends(a,c);Object.defineProperty(a.prototype,"right",{get:function(){return this.x+this.width},set:function(b){this.width=b-this.x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"bottom",{get:function(){return this.y+this.height},set:function(b){this.height=
- b-this.y},enumerable:!0,configurable:!0});a.prototype.initialize=function(b,a,c,d){this.x=b;this.y=a;this.width=c;this.height=d;return this};a.prototype.contains=function(b,a){return this.x<=b&&this.x+this.width>=b&&this.y<=a&&this.y+this.height>=a};a.prototype.intersects=function(b){return this.contains(b.x,b.y)||this.contains(b.x,b.bottom)||this.contains(b.right,b.y)||this.contains(b.right,b.bottom)?!0:!1};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height)};a.identity=
- new a(0,0,0,0);return a}(c.HashObject);c.Rectangle=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}d.fatal=function(a,b){"undefined"===typeof b&&(b=null);c.Logger.traceToConsole("Fatal",a,b);throw Error(c.Logger.getTraceCode("Fatal",a,b));};d.info=function(a,b){"undefined"===typeof b&&(b=null);c.Logger.traceToConsole("Info",a,b)};d.warning=function(a,b){"undefined"===typeof b&&(b=null);c.Logger.traceToConsole("Warning",a,b)};d.traceToConsole=function(a,b,f){console.log(c.Logger.getTraceCode(a,b,f))};d.getTraceCode=function(a,b,f){return"["+a+"]"+b+":"+
- (null==f?"":f)};return d}();c.Logger=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(b){function m(){b.call(this);this._originalDesignHeight=this._originalDesignWidth=this._designHeight=this._designWidth=0;this._scaleY=this._scaleX=1;this._frame=document.getElementById(m.canvas_div_name);var a=document.getElementById(m.canvas_name),f=a.width,a=a.height;this._designWidth=f;this._designHeight=a;this._originalDesignWidth=f;this._originalDesignHeight=a}__extends(m,b);m.getInstance=function(){null==m.instance&&(a.initialize(),f.initialize(),m.instance=new m);
- return m.instance};m.prototype.setFrameSize=function(b,a){throw Error("\u8be5\u65b9\u6cd5\u5df2\u7ecf\u88ab\u5e9f\u5f03\uff0c\u4f1a\u5728\u4e0b\u4e2a\u7248\u672c\u4e2d\u5220\u9664");};m.prototype.setDesignSize=function(b,a,f){isNaN(b)||0==b||isNaN(a)||0==a?c.Logger.info("Resolution Error"):(this.setResolutionPolicy(f),this._designWidth=b,this._designHeight=a,this._originalDesignWidth=b,this._originalDesignHeight=a,this._resolutionPolicy.apply(this,this._designWidth,this._designHeight))};m.prototype.setResolutionPolicy=
- function(b){if(b instanceof d)this._resolutionPolicy=b;else switch(b){case d.FIXED_HEIGHT:this._resolutionPolicy=new d(a.EQUAL_TO_FRAME,f.FIXED_HEIGHT);break;case d.FIXED_WIDTH:this._resolutionPolicy=new d(a.EQUAL_TO_FRAME,f.FIXED_WIDTH)}null!=this._resolutionPolicy?this._resolutionPolicy.init(this):c.Logger.fatal("\u9700\u8981\u5148\u8bbe\u7f6eresolutionPolicy")};m.prototype.getScaleX=function(){return this._scaleX};m.prototype.getScaleY=function(){return this._scaleY};m.canvas_name="gameCanvas";
- m.canvas_div_name="gameDiv";return m}(c.HashObject);c.StageDelegate=e;var d=function(){function b(a,f){this.setContainerStrategy(a);this.setContentStrategy(f)}b.prototype.init=function(b){this._containerStrategy.init(b);this._contentStrategy.init(b)};b.prototype.apply=function(b,a,f){this._containerStrategy.apply(b,a,f);return this._contentStrategy.apply(b,a,f)};b.prototype.setContainerStrategy=function(b){b instanceof a&&(this._containerStrategy=b)};b.prototype.setContentStrategy=function(b){b instanceof
- f&&(this._contentStrategy=b)};b.FIXED_HEIGHT=1;b.FIXED_WIDTH=2;return b}();c.ResolutionPolicy=d;var a=function(){function a(){}a.initialize=function(){a.EQUAL_TO_FRAME=new b};a.prototype.init=function(b){};a.prototype.apply=function(b,a,f){};a.prototype._setupContainer=function(){var b=document.body,a;if(b&&(a=b.style))a.paddingTop=a.paddingTop||"0px",a.paddingRight=a.paddingRight||"0px",a.paddingBottom=a.paddingBottom||"0px",a.paddingLeft=a.paddingLeft||"0px",a.borderTop=a.borderTop||"0px",a.borderRight=
- a.borderRight||"0px",a.borderBottom=a.borderBottom||"0px",a.borderLeft=a.borderLeft||"0px",a.marginTop=a.marginTop||"0px",a.marginRight=a.marginRight||"0px",a.marginBottom=a.marginBottom||"0px",a.marginLeft=a.marginLeft||"0px"};return a}();c.ContainerStrategy=a;var b=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.apply=function(b){this._setupContainer()};return a}(a);c.EqualToFrame=b;var f=function(){function b(){}b.initialize=function(){b.FIXED_HEIGHT=new m;b.FIXED_WIDTH=
- new h};b.prototype.init=function(b){};b.prototype.apply=function(b,a,f){};b.FIXED_HEIGHT=null;b.FIXED_WIDTH=null;return b}();c.ContentStrategy=f;var m=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.apply=function(b,a,f){var c=document.getElementById(e.canvas_name),d=document.getElementById(e.canvas_div_name),m=c.height/f,h=window.innerHeight,m=h/f,g=a*m;c.width=a;c.height=f;c.style.width=g+"px";c.style.height=h+"px";d.style.width=g+"px";d.style.height=h+"px";b._scaleX=
- m;b._scaleY=m};return a}(f);c.FixedHeight=m;var h=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.apply=function(b,a,f){f=document.getElementById(e.canvas_name);var c=document.getElementById(e.canvas_div_name),d=document.documentElement.clientWidth,m=document.documentElement.clientHeight,h=d/a;f.width=a;f.height=m/h;f.style.width=d+"px";f.style.height=m+"px";c.style.width=d+"px";c.style.height=m+"px";b._scaleX=h;b._scaleY=h};return a}(f);c.FixedWidth=h;var g=function(b){function a(f,
- c){b.call(this);this.width=f;this.height=c}__extends(a,b);a.prototype.apply=function(b,a,f){f=document.getElementById(e.canvas_name);var c=document.getElementById(e.canvas_div_name),d=this.width,m=this.height,h=d/a;f.width=a;f.height=m/h;f.style.width=d+"px";f.style.height=m+"px";c.style.width=d+"px";c.style.height=m+"px";b._scaleX=h;b._scaleY=h};return a}(f);c.FixedSize=g})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._originalData={};this._drawAreaList=[]}__extends(a,d);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.prototype.addDrawArea=function(b){this._drawAreaList.push(b)};a.prototype.clearDrawArea=function(){this._drawAreaList=[]};a.prototype.drawImage=function(b,a,d,e,g,k,l,n,p,q){l=l||0;n=n||0;var v=a._texture_to_render;if(null!=v){this._originalData.sourceX=d;this._originalData.sourceY=e;this._originalData.sourceWidth=
- g;this._originalData.sourceHeight=k;this._originalData.destX=l;this._originalData.destY=n;this._originalData.destWidth=p;this._originalData.destHeight=q;for(var F=this.getDrawAreaList(),r=0;r<F.length;r++){var D=F[r];if(!this.ignoreRender(a,D,this._originalData.destX,this._originalData.destY)){if(0!=this._drawAreaList.length)if(0!=a.worldTransform.b||0!=a.worldTransform.c){if(a.worldBounds.x+this._originalData.destX<D.x||a.worldBounds.y+this._originalData.destY<D.y||a.worldBounds.x+a.worldBounds.width+
- this._originalData.destX>D.x+D.width||a.worldBounds.y+a.worldBounds.height+this._originalData.destY>D.y+D.height){c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");break}}else{var x=a.worldTransform.a,C=a.worldTransform.d,A;a.worldBounds.x+this._originalData.destX<D.x&&(A=(D.x-a.worldBounds.x)/x-this._originalData.destX,d+=A/(p/g),g-=A/(p/g),p-=A,l+=A);a.worldBounds.y+this._originalData.destY<D.y&&
- (A=(D.y-a.worldBounds.y)/C-this._originalData.destY,e+=A/(q/k),k-=A/(q/k),q-=A,n+=A);a.worldBounds.x+a.worldBounds.width+this._originalData.destX>D.x+D.width&&(A=(a.worldBounds.x+a.worldBounds.width-D.x-D.width)/x+this._originalData.destX,g-=A/(p/g),p-=A);a.worldBounds.y+a.worldBounds.height+this._originalData.destY>D.y+D.height&&(A=(a.worldBounds.y+a.worldBounds.height-D.y-D.height)/C+this._originalData.destY,k-=A/(q/k),q-=A)}b.drawImage(v,d,e,g,k,l,n,p,q);d=this._originalData.sourceX;e=this._originalData.sourceY;
- g=this._originalData.sourceWidth;k=this._originalData.sourceHeight;l=this._originalData.destX;n=this._originalData.destY;p=this._originalData.destWidth;q=this._originalData.destHeight}}}};a.prototype.ignoreRender=function(b,a,c,d){var e=b.worldBounds;c*=b.worldTransform.a;d*=b.worldTransform.d;return e.x+e.width+c<=a.x||e.x+c>=a.x+a.width||e.y+e.height+d<=a.y||e.y+d>=a.y+a.height?!0:!1};a.prototype.getDrawAreaList=function(){var b;0==this._drawAreaList.length?(this._defaultDrawAreaList||(this._defaultDrawAreaList=
- [new c.Rectangle(0,0,c.MainContext.instance.stage.stageWidth,c.MainContext.instance.stage.stageHeight)]),b=this._defaultDrawAreaList):b=this._drawAreaList;return b};return a}(c.HashObject);c.RenderFilter=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}d.mapClass=function(a,b,f){"undefined"===typeof f&&(f="");a=this.getKey(a)+"#"+f;this.mapClassDic[a]=b};d.getKey=function(a){return"string"==typeof a?a:c.getQualifiedClassName(a)};d.mapValue=function(a,b,f){"undefined"===typeof f&&(f="");a=this.getKey(a)+"#"+f;this.mapValueDic[a]=b};d.hasMapRule=function(a,b){"undefined"===typeof b&&(b="");var f=this.getKey(a)+"#"+b;return this.mapValueDic[f]||this.mapClassDic[f]?!0:!1};d.getInstance=function(a,b){"undefined"===
- typeof b&&(b="");var f=this.getKey(a)+"#"+b;if(this.mapValueDic[f])return this.mapValueDic[f];var c=this.mapClassDic[f];if(c)return c=new c,this.mapValueDic[f]=c,delete this.mapClassDic[f],c;throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219\uff01any#named:"+f+"\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");};d.mapClassDic={};d.mapValueDic={};return d}();
- c.Injector=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._parent=null;this._cacheAsBitmap=!1;this._y=this._x=0;this._scaleY=this._scaleX=1;this._anchorY=this._anchorX=this._anchorOffsetY=this._anchorOffsetX=0;this.visible=!0;this._rotation=0;this._alpha=1;this._skewY=this._skewX=0;this._hasHeightSet=this._hasWidthSet=!1;this.worldAlpha=1;this.worldTransform=new c.Matrix;this.worldBounds=new c.Rectangle(0,0,0,0)}__extends(a,d);Object.defineProperty(a.prototype,"parent",{get:function(){return this._parent},
- enumerable:!0,configurable:!0});a.prototype._parentChanged=function(b){this._parent=b};Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(b){c.NumberUtils.isNumber(b)&&(this._x=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"y",{get:function(){return this._y},set:function(b){c.NumberUtils.isNumber(b)&&(this._y=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleX",{get:function(){return this._scaleX},set:function(b){c.NumberUtils.isNumber(b)&&
- (this._scaleX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleY",{get:function(){return this._scaleY},set:function(b){c.NumberUtils.isNumber(b)&&(this._scaleY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorPointX",{get:function(){return this._anchorOffsetX},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorOffsetX",{get:function(){return this._anchorOffsetX},
- set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorPointY",{get:function(){return this._anchorOffsetY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorOffsetY",{get:function(){return this._anchorOffsetY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorOffsetY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "relativeAnchorPointX",{get:function(){return this._anchorX},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorX",{get:function(){return this._anchorX},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"relativeAnchorPointY",{get:function(){return this._anchorY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorY=b)},enumerable:!0,
- configurable:!0});Object.defineProperty(a.prototype,"anchorY",{get:function(){return this._anchorY},set:function(b){c.NumberUtils.isNumber(b)&&(this._anchorY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rotation",{get:function(){return this._rotation},set:function(b){c.NumberUtils.isNumber(b)&&(this._rotation=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"alpha",{get:function(){return this._alpha},set:function(b){c.NumberUtils.isNumber(b)&&(this._alpha=
- b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"skewX",{get:function(){return this._skewX},set:function(b){c.NumberUtils.isNumber(b)&&(this._skewX=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"skewY",{get:function(){return this._skewY},set:function(b){c.NumberUtils.isNumber(b)&&(this._skewY=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(b){this._touchEnabled=
- b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(b){this._scrollRect=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuredWidth",{get:function(){return this._measureBounds().width},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuredHeight",{get:function(){return this._measureBounds().height},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"explicitWidth",
- {get:function(){return this._explicitWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"explicitHeight",{get:function(){return this._explicitHeight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this.getBounds().width},set:function(b){this._explicitWidth=b;this._hasWidthSet=c.NumberUtils.isNumber(b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this.getBounds().height},set:function(b){this._explicitHeight=
- b;this._hasHeightSet=c.NumberUtils.isNumber(b)},enumerable:!0,configurable:!0});a.prototype.draw=function(b){if(this.visible&&!this.drawCacheTexture(b)){b.setAlpha(this.worldAlpha,this.blendMode);b.setTransform(this.worldTransform);if(this.mask||this._scrollRect)b.save(),this._scrollRect?b.clip(this._scrollRect.x,this._scrollRect.y,this._scrollRect.width,this._scrollRect.height):b.clip(this.mask.x,this.mask.y,this.mask.width,this.mask.height);this.render(b);(this.mask||this._scrollRect)&&b.restore()}};
- a.prototype.drawCacheTexture=function(b){if(this._cacheAsBitmap){var a=this._texture_to_render,d=a.offsetX,e=a.offsetY,g=a._textureWidth,a=a._textureHeight;this.updateTransform();b.setAlpha(this.worldAlpha,this.blendMode);b.setTransform(this.worldTransform);this.mask&&(b.save(),b.clip(this.mask.x,this.mask.y,this.mask.width,this.mask.height));var k=c.MainContext.instance.rendererContext.texture_scale_factor;c.RenderFilter.getInstance().drawImage(b,this,0,0,g*k,a*k,d,e,g,a);this.mask&&b.restore();
- return!0}return!1};a.prototype.updateTransform=function(){this.worldTransform.identity();this.worldTransform=this.worldTransform.appendMatrix(this._parent.worldTransform);var b,f;0!=this._anchorX||0!=this._anchorY?(f=this.getBounds(),b=f.width*this._anchorX,f=f.height*this._anchorY):(b=this._anchorOffsetX,f=this._anchorOffsetY);this.worldTransform.appendTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,b,f);this._scrollRect&&this.worldTransform.append(1,0,
- 0,1,-this._scrollRect.x,-this._scrollRect.y);f=a.getTransformBounds(this.getBounds(),this.worldTransform);this.worldBounds.initialize(f.x,f.y,f.width,f.height);this.worldAlpha=this._parent.worldAlpha*this._alpha};a.prototype.render=function(b){};a.prototype.getBounds=function(){var b=this._measureBounds(),a=this._hasWidthSet?this._explicitWidth:b.width,d=this._hasHeightSet?this._explicitHeight:b.height,e=b.x,b=b.y,g,k;0!=this._anchorX||0!=this._anchorY?(g=a*this._anchorX,k=d*this._anchorY):(g=this._anchorOffsetX,
- k=this._anchorOffsetY);return c.Rectangle.identity.initialize(e-g,b-k,a,d)};a.prototype.getConcatenatedMatrix=function(){for(var b=a.identityMatrixForGetConcatenated.identity(),f=this;null!=f;){if(0!=f.anchorX||0!=f.anchorY){var c=f.getBounds();b.prependTransform(f.x,f.y,f.scaleX,f.scaleY,f.rotation,f.skewX,f.skewY,c.width*f.anchorX,c.height*f.anchorY)}else b.prependTransform(f.x,f.y,f.scaleX,f.scaleY,f.rotation,f.skewX,f.skewY,f.anchorOffsetX,f.anchorOffsetY);f=f.parent}return b};a.prototype.localToGlobal=
- function(b,a){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);var d=this.getConcatenatedMatrix();d.append(1,0,0,1,b,a);var e=c.Point.identity;e.x=d.tx;e.y=d.ty;return e};a.prototype.globalToLocal=function(b,a){"undefined"===typeof b&&(b=0);"undefined"===typeof a&&(a=0);var d=this.getConcatenatedMatrix();d.invert();d.append(1,0,0,1,b,a);var e=c.Point.identity;e.x=d.tx;e.y=d.ty;return e};a.prototype.hitTest=function(b,a,c){"undefined"===typeof c&&(c=!1);if(!this.visible||!c&&!this._touchEnabled)return null;
- c=this.getBounds();return 0<b&&b<c.width&&0<a&&a<c.height?this.mask||this._scrollRect?this._scrollRect&&b<this._scrollRect.width&&a<this._scrollRect.height||this.mask&&this.mask.x<b&&b<this.mask.x+this.mask.width&&this.mask.y<a&&a<this.mask.y+this.mask.height?this:null:this:null};a.prototype.getMatrix=function(){return c.Matrix.identity.identity().appendTransformFromDisplay(this)};a.prototype._measureBounds=function(){return c.Rectangle.identity.initialize(0,0,0,0)};a.prototype.getOffsetPoint=function(){var b=
- this.anchorOffsetX,a=this.anchorOffsetY;if(0!=this.anchorX||0!=this.anchorY)a=this.getBounds(),b=this.anchorX*a.width,a=this.anchorY*a.height;var d=c.Point.identity;d.x=b;d.y=a;return d};a.prototype._onAddToStage=function(){this._stage=c.MainContext.instance.stage;this.dispatchEventWith(c.Event.ADDED_TO_STAGE)};a.prototype._onRemoveFromStage=function(){this._stage=null;this.dispatchEventWith(c.Event.REMOVED_FROM_STAGE)};Object.defineProperty(a.prototype,"stage",{get:function(){return this._stage},
- enumerable:!0,configurable:!0});a.prototype.addEventListener=function(b,f,m,e,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof g&&(g=0);d.prototype.addEventListener.call(this,b,f,m,e,g);if((e=b==c.Event.ENTER_FRAME)||b==c.Event.RENDER)this._insertEventBin(e?a._enterFrameCallBackList:a._renderCallBackList,f,m,g)};a.prototype.removeEventListener=function(b,f,m,e){"undefined"===typeof e&&(e=!1);d.prototype.removeEventListener.call(this,b,f,m,e);if((e=b==c.Event.ENTER_FRAME)||b==c.Event.RENDER)this._removeEventBin(e?
- a._enterFrameCallBackList:a._renderCallBackList,f,m)};a.prototype.dispatchEvent=function(b){if(!b._bubbles)return d.prototype.dispatchEvent.call(this,b);b._reset();for(var a=[],c=this;c;)a.unshift(c),c=c.parent;for(var c=a.length,e=c-2;0<=e;e--)a.push(a[e]);for(var c=a.length,g=0.5*(c-1),e=0;e<c;e++){var k=a[e];b._setCurrentTarget(k);b._target=this;b._eventPhase=e<g?1:e==g?2:3;k._notifyListener(b);if(b._isPropagationStopped||b._isPropagationImmediateStopped)break}return!b.isDefaultPrevented()};a.prototype.willTrigger=
- function(b){for(var a=this;a;){if(a.hasEventListener(b))return!0;a=a._parent}return!1};a.prototype.cacheAsBitmap=function(b){if(this._cacheAsBitmap=b)b=new c.RenderTexture,b.drawToTexture(this),this._texture_to_render=b};a.getTransformBounds=function(b,a){var c=b.x,d=b.y,e=b.width,k=b.height,l=e*a.a,e=e*a.b,n=k*a.c,k=k*a.d,p=a.tx,q=a.ty,v=p,F=p,r=q,D=q;(c=l+p)<v?v=c:c>F&&(F=c);(c=l+n+p)<v?v=c:c>F&&(F=c);(c=n+p)<v?v=c:c>F&&(F=c);(d=e+q)<r?r=d:d>D&&(D=d);(d=e+k+q)<r?r=d:d>D&&(D=d);(d=k+q)<r?r=d:d>D&&
- (D=d);return b.initialize(v,r,F-v,D-r)};a.identityMatrixForGetConcatenated=new c.Matrix;a._enterFrameCallBackList=[];a._renderCallBackList=[];return a}(c.EventDispatcher);c.DisplayObject=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._touchChildren=!0;this._children=[]}__extends(a,d);Object.defineProperty(a.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(b){this._touchChildren=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0});a.prototype.setChildIndex=function(b,a){this.doSetChildIndex(b,a)};a.prototype.doSetChildIndex=function(b,
- a){var d=this._children.indexOf(b);0>d&&c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");this._children.splice(d,1);0>a||this._children.length<=a?this._children.push(b):this._children.splice(a,0,b)};a.prototype.addChild=function(b){var a=this.numChildren;b.parent==this&&a--;return this.childAdded(b,a)};a.prototype.addChildAt=function(b,a){return this.childAdded(b,a)};a.prototype.childAdded=function(b,a){if(b==this)return b;if(0>a||a>this._children.length)return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
- b;var d=b.parent;if(d==this)return this.doSetChildIndex(b,a),b;d&&d.removeChild(b);this._children.splice(a,0,b);b._parentChanged(this);b.dispatchEventWith(c.Event.ADDED,!0);this._stage&&b._onAddToStage();return b};a.prototype.removeChild=function(b){b=this._children.indexOf(b);if(0<=b)return this.childRemoved(b);c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent")};a.prototype.removeChildAt=function(b){if(0<=b&&b<this._children.length)return this.childRemoved(b);c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")};
- a.prototype.childRemoved=function(b){var a=this._children,d=a[b];d.dispatchEventWith(c.Event.REMOVED,!0);this._stage&&d._onRemoveFromStage();d._parentChanged(null);a.splice(b,1);return d};a.prototype.getChildAt=function(b){if(0<=b&&b<this._children.length)return this._children[b];c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")};a.prototype.contains=function(b){for(;b;){if(b==this)return!0;b=b.parent}return!1};a.prototype.getChildByName=function(b){return null};a.prototype.swapChildrenAt=
- function(b,a){0<=b&&b<this._children.length&&0<=a&&a<this._children.length?this._swapChildrenAt(b,a):c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")};a.prototype.swapChildren=function(b,a){var d=this._children.indexOf(b),e=this._children.indexOf(a);-1==d||-1==e?c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent"):this._swapChildrenAt(d,e)};a.prototype._swapChildrenAt=function(b,a){if(b>a){var c=a;a=b;b=c}else if(b==a)return;var c=this._children,d=c[b],e=c[a];c.splice(a,
- 1);c.splice(b,1);c.splice(b,0,e);c.splice(a,0,d)};a.prototype.getChildIndex=function(b){return this._children.indexOf(b)};a.prototype.removeChildren=function(){for(var b=this._children.length-1;0<=b;b--)this.childRemoved(b)};a.prototype.updateTransform=function(){if(this.visible){d.prototype.updateTransform.call(this);for(var b=0,a=this._children.length;b<a;b++)this._children[b].updateTransform()}};a.prototype.render=function(b){for(var a=0,c=this._children.length;a<c;a++)this._children[a].draw(b)};
- a.prototype._measureBounds=function(){for(var b=0,a=0,d=0,e=0,g=this._children.length,k=0;k<g;k++){var l=this._children[k],n;if(l.visible&&(n=c.DisplayObject.getTransformBounds(l.getBounds(),l.getMatrix()))){var l=n.x,p=n.y,q=n.width+n.x,v=n.height+n.y;if(l<b||0==k)b=l;if(q>a||0==k)a=q;if(p<d||0==k)d=p;if(v>e||0==k)e=v}}return c.Rectangle.identity.initialize(b,d,a-b,e-d)};a.prototype.hitTest=function(b,a){var d;if(!this.visible)return null;if(this._scrollRect){if(b>this._scrollRect.width||a>this._scrollRect.height)return null}else if(this.mask&&
- (this.mask.x>b||b>this.mask.x+this.mask.width||this.mask.y>a||a>this.mask.y+this.mask.height))return null;var e=this._children,g=e.length;if(0==g)return d;for(var k=this._touchChildren,l=this;l._parent;)k=k&&l._parent._touchChildren,l=l._parent;for(g-=1;0<=g;g--){var n=l=e[g],p=n.getOffsetPoint(),q=n._x,v=n._y;this._scrollRect&&(q-=this._scrollRect.x,v-=this._scrollRect.y);n=c.Matrix.identity.identity().prependTransform(q,v,n._scaleX,n._scaleY,n._rotation,0,0,p.x,p.y);n.invert();n=c.Matrix.transformCoords(n,
- b,a);if(l=l.hitTest(n.x,n.y,!0)){if(l._touchEnabled&&k)return l;if(this._touchEnabled)return this;null==d&&(d=l)}}return d};a.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this);for(var b=this.numChildren,a=0;a<b;a++)this._children[a]._onAddToStage()};a.prototype._onRemoveFromStage=function(){d.prototype._onRemoveFromStage.call(this);for(var b=this.numChildren,a=0;a<b;a++)this._children[a]._onRemoveFromStage()};return a}(c.DisplayObject);c.DisplayObjectContainer=e})(ns_egret||
- (ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a){d.call(this);this.touchEnabled=!0;this._stage=this;this._stageWidth=b;this._stageHeight=a}__extends(a,d);a.prototype.invalidate=function(){a._invalidateRenderFlag=!0};a.prototype._setStageSize=function(b,a){this._stageWidth==b&&this._stageHeight==a||(this._stageWidth=b,this._stageHeight=a,this.dispatchEventWith(c.Event.RESIZE))};Object.defineProperty(a.prototype,"stageWidth",{get:function(){return this._stageWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "stageHeight",{get:function(){return this._stageHeight},enumerable:!0,configurable:!0});a.prototype.hitTest=function(b,a){if(!this.touchEnabled)return null;var d;if(!this.visible)return this;for(var e=this._children,g=e.length-1;0<=g;g--){var k=d=e[g],l=k.getOffsetPoint(),k=c.Matrix.identity.identity().prependTransform(k.x,k.y,k.scaleX,k.scaleY,k.rotation,0,0,l.x,l.y);k.invert();k=c.Matrix.transformCoords(k,b,a);if((d=d.hitTest(k.x,k.y,!0))&&d.touchEnabled)return d}return this};a.prototype.getBounds=
- function(){return c.Rectangle.identity.initialize(0,0,1E5,1E5)};a.prototype.updateTransform=function(){for(var b=0,a=this._children.length;b<a;b++)this._children[b].updateTransform()};a._invalidateRenderFlag=!1;return a}(c.DisplayObjectContainer);c.Stage=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.debug=!1;this.debugColor=16711680}__extends(a,d);a.initWithTexture=function(b){if(null==b)throw Error("texture \u53d6\u4e0d\u5230 ");var c=new a;c.texture=b;return c};a.prototype.render=function(b){var a=this.texture;if(null!=a){this._texture_to_render=a;var d,e,g,k,l;this.spriteFrame?(l=this.spriteFrame,d=l.x,e=l.y,g=l.w,a=l.h,k=l.offX,l=l.offY):(e=d=0,g=a._textureWidth,a=a._textureHeight,l=k=0);c.RenderFilter.getInstance().drawImage(b,
- this,d,e,g,a,k,l,g,a)}};a.prototype._measureBounds=function(){var b=this.spriteFrame,a,d;b?(a=b.w,d=b.h):this.texture?(a=this.texture._textureWidth,d=this.texture._textureHeight):c.Logger.fatal("\u83b7\u53d6BitmapBounds\u5931\u8d25");var e;0!=this._anchorX||0!=this._anchorY?(b=a*this._anchorX,e=d*this._anchorY):(b=this._anchorOffsetX,e=this._anchorOffsetY);return c.Rectangle.identity.initialize(-b,-e,a,d)};a.debug=!1;return a}(c.DisplayObject);c.Bitmap=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.text="";this._bitmapPool=[]}__extends(a,d);a.prototype.updateTransform=function(){this.visible&&(this._renderText(),d.prototype.updateTransform.call(this))};a.prototype._renderText=function(b){"undefined"===typeof b&&(b=!1);var a=c.Rectangle.identity.initialize(0,0,0,0);b||this.removeChildren();for(var d=0,e=this.text.length;d<e;d++){var g=this.text.charAt(d),k=this.bitmapFontData[g];null==k&&c.Logger.fatal("BitmapText\uff1a\u5f02\u5e38\u7684bitmapFontData: ",
- g);var g=k.offX,l=k.offY,n=k.w;if(!b){var p=this._bitmapPool[d];p||(p=c.Bitmap.initWithTexture(this.texture),this._bitmapPool.push(p));this.addChild(p);p.spriteFrame=k;p.x=a.width}a.width+=n+g;l+k.h>a.height&&(a.height=l+k.h)}return a};a.prototype._measureBounds=function(){return this._renderText(!0)};return a}(c.DisplayObjectContainer);c.BitmapText=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function a(b){this.renderContext=b;this.canvasContext=b.canvasContext;this.commandQueue=[]}a.prototype.beginFill=function(b,a){this.commandQueue.push(new d(this._setStyle,this,["rgba("+(b>>16)+","+((b&65280)>>8)+","+(b&255)+","+a+")"]))};a.prototype._setStyle=function(b){this.canvasContext.fillStyle=b};a.prototype.drawRect=function(b,a,c,e){this.canvasContext.fill();var g=this.renderContext;this.commandQueue.push(new d(function(b,a,c,f){this.canvasContext.fillRect(g._transformTx+
- b,g._transformTy+a,c,f)},this,[b,a,c,e]))};a.prototype.lineStyle=function(b,a,c,e,g,k,l,n){"undefined"===typeof b&&(b=NaN);"undefined"===typeof a&&(a=0);"undefined"===typeof c&&(c=1);"undefined"===typeof e&&(e=!1);"undefined"===typeof g&&(g="normal");"undefined"===typeof k&&(k=null);"undefined"===typeof l&&(l=null);"undefined"===typeof n&&(n=3);this.commandQueue.push(new d(function(a,f){var d="rgba("+(f>>16)+","+((f&65280)>>8)+","+(f&255)+","+c+")";this.canvasContext.lineWidth=b;this.canvasContext.strokeStyle=
- d},this,[b,a]))};a.prototype.lineTo=function(b,a){var c=this.renderContext;this.commandQueue.push(new d(function(b,a){var f=this.canvasContext;f.beginPath();f.moveTo(c._transformTx,c._transformTx);f.lineTo(c._transformTx+b,c._transformTx+a);f.stroke()},this,[b,a]))};a.prototype.clear=function(){this.commandQueue.length=0};a.prototype.endFill=function(){};a.prototype._draw=function(){for(var b=0,a=this.commandQueue.length;b<a;b++){var c=this.commandQueue[b];c.method.apply(c.thisObject,c.args)}};return a}();
- c.Graphics=e;var d=function(){return function(a,b,c){this.method=a;this.thisObject=b;this.args=c}}()})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.graphics=new c.Graphics(c.MainContext.instance.rendererContext)}__extends(a,d);a.prototype.hitTest=function(b,a){return d.prototype.hitTest.call(this,b,a)};a.prototype.render=function(b){this.graphics._draw()};return a}(c.DisplayObject);c.Shape=e;e=function(c){function a(){c.call(this);this._colorDirty=!0;this._sizeDirty=!1;this._color=16777215}__extends(a,c);Object.defineProperty(a.prototype,"color",{get:function(){return this._color},
- set:function(b){this._colorDirty=!0;this._color=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"alpha",{get:function(){return this._alpha},set:function(b){this._colorDirty=!0;this._alpha=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this.getBounds().width},set:function(b){this._explicitWidth=b;this._sizeDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this.getBounds().height},
- set:function(b){this._explicitHeight=b;this._sizeDirty=!0},enumerable:!0,configurable:!0});a.prototype.render=function(b){if(this._colorDirty||this._sizeDirty)this._sizeDirty=this._colorDirty=!1,this.graphics.clear(),this.graphics.beginFill(this._color,this._alpha),this.graphics.drawRect(0,0,this._explicitWidth,this._explicitHeight);this.graphics._draw()};return a}(c.Shape);c.ShapeRect=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.fontFamily="Arial";this.size=30;this._textColorString="#FFFFFF";this._textColor=16777215;this._strokeColorString="#000000";this._numLines=this.stroke=this._strokeColor=0;this.__hackIgnoreDrawText=!1;this.letterSpacing=this.lineSpacing=0;this.textAlign="left"}__extends(a,d);Object.defineProperty(a.prototype,"textColor",{get:function(){return this._textColor},set:function(b){this._textColor!=b&&(this._textColor=b,this._textColorString=c.toColorString(b))},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(b){this._strokeColor!=b&&(this._strokeColor=b,this._strokeColorString=c.toColorString(b))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numLines",{get:function(){return this._numLines},enumerable:!0,configurable:!0});a.prototype.render=function(b){this.text&&(b.setupFont(this.size+"px "+this.fontFamily,this.textAlign,this.textBaseline),this.drawText(b))};
- a.prototype._measureBounds=function(){var b=c.MainContext.instance.rendererContext;b.setupFont(this.size+"px "+this.fontFamily,this.textAlign,this.textBaseline);return this.drawText(b,!0)};a.prototype.drawText=function(b,a){"undefined"===typeof a&&(a=!1);a&&(this.__hackIgnoreDrawText=!0);var d=this._explicitWidth,e=0,g=String(this.text).split(/(?:\r\n|\r|\n)/),k=0,l=this.size+this.lineSpacing,n=0;if(isNaN(d)){for(var n=g.length,p=0,q=n;p<q;p++){var v=g[p],F=b.measureText(v);F>e&&(e=F)}p=0;for(q=n;p<
- q;p++)v=g[p],this._drawTextLine(b,v,k,e),k+=l}else{e=d;p=0;for(q=g.length;p<q;p++){v=g[p];F=b.measureText(v);if(F>d)for(var F=v,r=0,v="",D=0;D<F.length;D++){var x=b.measureText(F[D]);r+x>d?0==r?(r+=x,v+=F[D],e=x):(this._drawTextLine(b,v,k,e),n++,D--,v="",r=0,k+=l):(r+=x,v+=F[D])}this._drawTextLine(b,v,k,e);n++;k+=l}}this._numLines=n;d=c.Rectangle.identity;a&&(d.x=d.y=0,d.width=e,d.height=n*l,this.__hackIgnoreDrawText=!1);return d};a.prototype._drawTextLine=function(b,a,c,d){this.__hackIgnoreDrawText||
- b.drawText(this,a,"left"==this.textAlign?0:"center"==this.textAlign?d/2:d,c,d)};return a}(c.DisplayObject);c.TextField=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(a){function b(b){a.call(this);this.frames=b.frames}__extends(b,a);b.prototype.getFrame=function(b){var a=this.frames[b];null==a&&c.Logger.fatal("\u6ca1\u6709\u627e\u5230\u76f8\u5e94\u7684frame\uff1a",b);return a};b.parseFromDragonBones=function(a){var c=new b(a);c.frames={};a=a.SubTexture;for(var e in a){var g=a[e],k=new d;k.w=g.width;k.h=g.height;k.x=g.x;k.y=g.y;c.frames[g.name]=k}return c};return b}(c.HashObject);c.SpriteSheet=e;var d=function(){return function(){this.offY=
- this.offX=0}}();c.SpriteSheetFrame=d})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments);this._placeholderText="";this._edFontSize=14;this._textColor=16711680;this._placeholderFontSize=14;this._placeholderColor=16776960;this._preY=this._preX=0}__extends(a,d);a.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this);var b=this.localToGlobal(),a=new c.StageText;a.open(b.x,b.y,this._explicitWidth,this._explicitHeight);this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.onMouseDownHandler,this);this.stageText=
- a};a.prototype.setText=function(b){this.stageText.setText(b)};a.prototype.getText=function(){return this.stageText.getText()};a.prototype.setTextType=function(b){this.stageText.setTextType(b)};a.prototype.getTextType=function(){return this.stageText.getTextType()};a.prototype.onMouseDownHandler=function(b){};a.prototype._onRemoveFromStage=function(){this.stageText.remove()};a.prototype._measureBounds=function(){return c.Rectangle.identity};a.prototype.hitTest=function(b,a,c){return null};return a}(c.DisplayObject);
- c.TextInput=e;e=function(){function c(){}c.prototype.editBoxEditingDidBegin=function(a){};c.prototype.editBoxEditingDidEnd=function(a){};c.prototype.editBoxTextChanged=function(a,b){};c.prototype.editBoxReturn=function(a){};return c}();c.TextInputDegelete=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a){d.call(this);this.data=b;this.texture=a;this._resPool={};this._currentInterval=this._interval=this._totalFrame=this._currentFrameIndex=0;this._isPlaying=!1;this._passTime=0;this._oneFrameTime=1E3/60;this._frameData=b;this._oneFrameTime=1E3/c.MainContext.instance.deviceContext.frameRate}__extends(a,d);a.prototype.gotoAndPlay=function(b){this.checkHasFrame(b);this._isPlaying=!0;this._currentInterval=this._currentFrameIndex=0;this._currentFrameName=b;this._totalFrame=
- this._frameData.frames[b].totalFrame;this.playNextFrame();this._passTime=0;c.Ticker.getInstance().register(this.update,this)};a.prototype.gotoAndStop=function(b){this.checkHasFrame(b);this.stop();this._currentInterval=this._currentFrameIndex=0;this._currentFrameName=b;this._totalFrame=this._frameData.frames[b].totalFrame;this.playNextFrame()};a.prototype.checkHasFrame=function(b){void 0==this._frameData.frames[b]&&c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a",b)};a.prototype.stop=
- function(){this._isPlaying=!1;c.Ticker.getInstance().unregister(this.update,this)};a.prototype.update=function(b){if(this._interval!=this._currentInterval)this._currentInterval++;else{for(var a=Math.floor((this._passTime%this._oneFrameTime+b)/this._oneFrameTime);1<=a;)1==a?this.playNextFrame():this.playNextFrame(!1),a--;this._passTime+=b}};a.prototype.playNextFrame=function(b){"undefined"===typeof b&&(b=!0);this._currentInterval=0;var a=this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
- b&&(b=this.getBitmap(a.res),b.x=a.x,b.y=a.y,this.removeChildren(),this.addChild(b));null!=a.action&&this.dispatchEventWith(a.action);this._currentFrameIndex++;this._currentFrameIndex==this._totalFrame&&(this._currentFrameIndex=0)};a.prototype.getBitmap=function(b){var a;if(null!=this._resPool[b])a=this._resPool[b];else{var d=this._frameData.res[b];a=c.Bitmap.initWithTexture(this.texture);a.spriteFrame=d;this._resPool[b]=a}return a};a.prototype.release=function(){this._resPool={}};a.prototype.getCurrentFrameIndex=
- function(){return this._currentFrameIndex};a.prototype.getTotalFrame=function(){return this._totalFrame};a.prototype.setInterval=function(b){this._interval=b};a.prototype.getIsPlaying=function(){return this._isPlaying};return a}(c.DisplayObjectContainer);c.MovieClip=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this)}__extends(a,d);a.prototype.getText=function(){return this.inputElement.value};a.prototype.setText=function(b){this.inputElement.value=b};a.prototype.setTextType=function(b){this.inputElement.type=b};a.prototype.getTextType=function(){return this.inputElement.type};a.prototype.open=function(b,a,d,e){"undefined"===typeof d&&(d=160);"undefined"===typeof e&&(e=21);var g=c.StageDelegate.getInstance().getScaleX(),k=c.StageDelegate.getInstance().getScaleY(),
- l=document.createElement("input");l.type="text";l.style.fontSize="20px";l.style.color="#FFFFFF";l.style.borderStyle="none";l.style.background="none";l.style.width=d*g+"px";l.style.height=e*k+"px";l.style.outline="medium";var n=c.Browser.getInstance().$new("div");n.style.position="absolute";n.position.x=b*g;n.style.width=d*g+"px";n.style.height=e*k+"px";n.position.y=a*k;n.transforms();n.appendChild(l);b=c.Browser.getInstance().$("#StageDelegateDiv");b||(d=document.getElementById(c.StageDelegate.canvas_div_name),
- e=d.clientHeight,d=d.clientWidth,b=c.Browser.getInstance().$new("div"),b.id="StageDelegateDiv",b.style.position="absolute",b.style.width=d+"px",b.style.maxHeight=e+"px",b.style.margin="0px",document.getElementById(c.StageDelegate.canvas_div_name).appendChild(b),b.position.y=-e,b.transforms());b.appendChild(n);this.div=n;this.inputElement=l};a.prototype.remove=function(){var b=this.div;b&&b.parentNode&&b.parentNode.removeChild(b)};return a}(c.HashObject);c.StageText=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.renderCost=0;this.texture_scale_factor=1}__extends(a,d);a.prototype.clearScreen=function(){};a.prototype.clearRect=function(b,a,c,d){};a.prototype.drawImage=function(b,a,d,e,g,k,l,n,p){c.Profiler.getInstance().onDrawImage()};a.prototype.setTransform=function(b){};a.prototype.save=function(){};a.prototype.restore=function(){};a.prototype.setAlpha=function(b,a){};a.prototype.setupFont=function(b,a,c){};a.prototype.measureText=function(b){return 0};
- a.prototype.drawText=function(b,a,d,e,g){c.Profiler.getInstance().onDrawImage()};a.prototype.clip=function(b,a,c,d){};a.prototype.strokeRect=function(b,a,c,d,e){};return a}(c.HashObject);c.RendererContext=e;e=function(){function d(a){this.type=a;switch(a){case "add":case "layer":this.value="lighter";break;default:this.value="source-over"}}d.getBlendMode=function(a){return!a?c.BlendMode.NORMAL:c.BlendMode[a.toUpperCase()]};d.NORMAL=new d("normal");d.ADD=new d("add");d.LAYER=new d("layer");return d}();
- c.BlendMode=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.MOUSE="mouse";c.TOUCH="touch";c.mode="touch";return c}();c.InteractionMode=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._currentTouchTarget={};this.maxTouches=2;this.touchDownTarget={}}__extends(a,d);a.prototype.run=function(){};a.prototype.getTouchData=function(b,a,c){var d=this._currentTouchTarget[b];null==d&&(d={},this._currentTouchTarget[b]=d);d.stageX=a;d.stageY=c;d.identifier=b;return d};a.prototype.dispatchEvent=function(b,c){var d=c.target,e=a.touchEvent;e._type=b;e.touchPointID=c.identifier;e.touchDown=!0==this.touchDownTarget[c.identifier];e._stageX=
- c.stageX;e._stageY=c.stageY;d.dispatchEvent(e)};a.prototype.onTouchBegan=function(b,a,d){var e=c.MainContext.instance.stage.hitTest(b,a);e&&(b=this.getTouchData(d,b,a),this.touchDownTarget[d]=!0,b.target=e,b.beginTarget=e,this.dispatchEvent(c.TouchEvent.TOUCH_BEGAN,b))};a.prototype.onTouchMove=function(b,a,d){var e=c.MainContext.instance.stage.hitTest(b,a);e&&(b=this.getTouchData(d,b,a),b.target=e,this.dispatchEvent(c.TouchEvent.TOUCH_MOVE,b))};a.prototype.onTouchEnd=function(b,a,d){var e=c.MainContext.instance.stage.hitTest(b,
- a);e&&(b=this.getTouchData(d,b,a),delete this.touchDownTarget[d],d=b.beginTarget,b.target=e,this.dispatchEvent(c.TouchEvent.TOUCH_END,b),d==e?this.dispatchEvent(c.TouchEvent.TOUCH_TAP,b):b.beginTarget&&(b.target=b.beginTarget,this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE,b)),delete this._currentTouchTarget[b.identifier])};a.touchEvent=new c.TouchEvent("");return a}(c.HashObject);c.TouchContext=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){this.textureCache=c.TextureCache.getInstance()}d.prototype.load=function(a,b,c){};d.prototype.createLoadingController=function(){return null};d.prototype.getAssets=function(a){return null};d.prototype.getTexture=function(a){return this.textureCache.getTexture(a)};return d}();c.AssetsContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,c){d.call(this);this.type=this.url=null;this.state=a.LOAD_STATE_INIT;this.fixedUrl=this.data=null;this.preFixUrl="";this.url=b;var e=b.indexOf("?");this.fixedUrl=-1<e?b.substring(0,e):b;this.type=c}__extends(a,d);a.prototype.load=function(){switch(this.state){case a.LOAD_STATE_INIT:this.startLoading();break;case a.LOAD_STATE_LOADED:c.callLater(this._executeAllCallback,this)}};a.prototype.startLoading=function(){var b=new c.URLRequest(this.url,this._executeAllCallback,
- this);b.type=this.type;b.prefix=""==this.preFixUrl?a.prefix:this.preFixUrl;c.MainContext.instance.netContext.send(b)};a.prototype._executeAllCallback=function(b){this.state=a.LOAD_STATE_LOADED;b&&(this.data=b);if(this.onLoadComplete)this.onLoadComplete(this.data);this.dispatchEventWith(a.LOAD_COMPLETE,!1,this.data)};a.create=function(b,f){"undefined"===typeof f&&(f="");if(null==a.__pool[b]){var d=b.substring(b.lastIndexOf(".")+1),d=a.__registerMap[d];d||(d=c.ResourceLoader);a.__pool[b]=new d(b,f)}return a.__pool[b]};
- a.registerHandler=function(b,c){a.__registerMap[b]=c};a.LOAD_COMPLETE="resource_load_complete";a.DATA_TYPE_BINARY="binary";a.DATA_TYPE_TEXT="text";a.DATA_TYPE_IMAGE="image";a.LOAD_STATE_INIT=0;a.LOAD_STATE_LOADED=1;a.__pool={};a.prefix="";a.__registerMap={};return a}(c.EventDispatcher);c.ResourceLoader=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments);this._resourceUrlList=null;this._currentIndex=0;this._state=c.LoadingController.LOAD_STATE_IDLE}__extends(a,d);a.prototype.addResource=function(b,a,d){"undefined"===typeof a&&(a=null);"undefined"===typeof d&&(d="");this.checkIsLoading()||(null==this._resourceUrlList&&(this._resourceUrlList=[]),b=c.ResourceLoader.create(b,a),b.preFixUrl=d,-1==this._resourceUrlList.indexOf(b)&&b.state!=c.ResourceLoader.LOAD_STATE_LOADED&&this._resourceUrlList.push(b))};
- a.prototype.load=function(){this.checkIsLoading()||(null!=this._resourceUrlList&&0<this._resourceUrlList.length?(this._state=a.LOAD_STATE_LOADING,this._currentIndex=0,null!=this._loadingView&&this._loadingView.addToStage(),this.next(null)):c.callLater(this.onComplete,this))};a.prototype.onComplete=function(){this._state=a.LOAD_STATE_IDLE;this.destroy();this.dispatchEventWith(c.ResourceLoader.LOAD_COMPLETE)};a.prototype.checkIsLoading=function(){return this._state==a.LOAD_STATE_LOADING?(c.Logger.info("\u6b63\u5728\u52a0\u8f7d\u4e2d"),
- !0):!1};a.prototype.next=function(b){this.removeResourceEvent();this.onProgress();if(this._resourceUrlList.length>this._currentIndex)this._currentResource=this._resourceUrlList[this._currentIndex],this._currentIndex++,this._currentResource.addEventListener(c.ResourceLoader.LOAD_COMPLETE,this.next,this),this._currentResource.load();else this.onComplete()};a.prototype.removeResourceEvent=function(){this._currentResource&&(this._currentResource.removeEventListener(c.ResourceLoader.LOAD_COMPLETE,this.next,
- this),this._currentResource=null)};a.prototype.onProgress=function(){if(null!=this._loadingView)this._loadingView.onProgress(this._currentIndex,this._resourceUrlList.length)};a.prototype.setLoadingView=function(b){null!=this._loadingView&&(this._loadingView.removeFromStage(),this._loadingView=null);this._loadingView=b};a.prototype.destroy=function(){this.removeResourceEvent();null!=this._loadingView&&(this._loadingView.removeFromStage(),this._loadingView=null);this._resourceUrlList=null};a.LOAD_STATE_IDLE=
- 0;a.LOAD_STATE_LOADING=1;return a}(c.EventDispatcher);c.LoadingController=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments);this._textureHeight=this._textureWidth=this.offsetY=this.offsetX=0}__extends(a,d);Object.defineProperty(a.prototype,"bitmapData",{get:function(){return this._bitmapData},set:function(b){var a=c.MainContext.instance.rendererContext.texture_scale_factor;this._bitmapData=b;this._textureWidth=b.width*a;this._textureHeight=b.height*a},enumerable:!0,configurable:!0});a.prototype.getTextureWidth=function(){return this._textureWidth};a.prototype.getTextureHeight=
- function(){return this._textureHeight};a.create=function(b){var c=new a;c._path=b;return c};a.createWithBase64=function(b){var c=new a,d=new Image;d.src=b;c.bitmapData=d;return c};return a}(c.HashObject);c.Texture=e;e=function(d){function a(){d.call(this);this.cacheCanvas=document.createElement("canvas")}__extends(a,d);a.prototype.drawToTexture=function(b){var a=this.cacheCanvas,d=b.getBounds();a.width=d.width;a.height=d.height;b.worldTransform.identity();b.worldAlpha=1;if(b instanceof c.DisplayObjectContainer){this.offsetX=
- d.x;this.offsetY=d.y;b.worldTransform.append(1,0,0,1,-d.x,-d.y);for(var d=b._children,e=0,g=d.length;e<g;e++)d[e].updateTransform()}a=new c.HTML5CanvasRenderer(a);d=c.RenderFilter.getInstance();e=d._drawAreaList.concat();d._drawAreaList.length=0;b.render(a);d._drawAreaList=e;this._bitmapData=this.cacheCanvas;this._textureWidth=this.cacheCanvas.width;this._textureHeight=this.cacheCanvas.height};return a}(e);c.RenderTexture=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._textures={};this._spritesheets={}}__extends(a,d);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.prototype.addTexture=function(b,a){this._textures[b]||(this._textures[b]=a)};a.prototype.removeTexture=function(b){delete this._textures[b]};a.prototype.getTexture=function(b){var a=this._textures[b];a||c.Logger.warning("texture\u4e3a\u7a7a",b);return a};a.prototype.addSpriteSheet=function(b,a,c){this.addTexture(b,
- c);this._spritesheets[b]=a};a.prototype.removeSpriteSheet=function(b){this.removeTexture(b);delete this._spritesheets[b]};a.prototype.getSpriteSheet=function(b){return this._spritesheets[b]};return a}(c.HashObject);c.TextureCache=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(a){function b(){a.call(this)}__extends(b,a);b.getInstance=function(){return c.MainContext.instance.netContext};b.prototype.send=function(b){};b.STATE_COMPLETE="XHRLoaderComplete";b.GET="GET";b.POST="POST";return b}(c.HashObject);c.NetContext=e;var d=function(){return function(a,b,c,d,h){"undefined"===typeof d&&(d=e.GET);"undefined"===typeof h&&(h=void 0);this.url=a;this.callback=b;this.thisObj=c;this.method=d;this.data=h;this.prefix=""}}();c.URLRequest=d})(ns_egret||(ns_egret=
- {}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(){c.call(this);this.frameRate=60}__extends(a,c);a.prototype.executeMainLoop=function(b,a){};return a}(c.HashObject);c.DeviceContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b){d.call(this);this.texture=b;this._defaultPadding=5;this._scaleHeight=this._scaleWidth=0;this._top=this._bottom=this._left=this._right=this._defaultPadding;this._topLeftBitmap=c.Bitmap.initWithTexture(b);this._topLeftBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._topLeftBitmap);this._topMiddleBitmap=c.Bitmap.initWithTexture(b);this._topMiddleBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._topMiddleBitmap);this._topRightBitmap=
- c.Bitmap.initWithTexture(b);this._topRightBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._topRightBitmap);this._middleLeftBitmap=c.Bitmap.initWithTexture(b);this._middleLeftBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._middleLeftBitmap);this._middleMiddleBitmap=c.Bitmap.initWithTexture(b);this._middleMiddleBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._middleMiddleBitmap);this._middleRightBitmap=c.Bitmap.initWithTexture(b);this._middleRightBitmap.spriteFrame=
- new c.SpriteSheetFrame;this.addChild(this._middleRightBitmap);this._bottomLeftBitmap=c.Bitmap.initWithTexture(b);this._bottomLeftBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._bottomLeftBitmap);this._bottomMiddleBitmap=c.Bitmap.initWithTexture(b);this._bottomMiddleBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._bottomMiddleBitmap);this._bottomRightBitmap=c.Bitmap.initWithTexture(b);this._bottomRightBitmap.spriteFrame=new c.SpriteSheetFrame;this.addChild(this._bottomRightBitmap)}
- __extends(a,d);a.prototype.setScaleGrid=function(b,a,d,e){"undefined"===typeof b&&(b=this._defaultPadding);"undefined"===typeof a&&(a=this._defaultPadding);"undefined"===typeof d&&(d=this._defaultPadding);"undefined"===typeof e&&(e=this._defaultPadding);c.DEBUG&&c.DEBUG.SCALE_BITMAP_SET_SCALE_GRID&&c.DEBUG.checkSetScaleGrid(this.texture,b,a,d,e);this._top=b;this._bottom=a;this._left=d;this._right=e};Object.defineProperty(a.prototype,"width",{set:function(b){this._explicitWidth=b;0<b&&!isNaN(b)&&(this._scaleWidth=
- b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{set:function(b){this._explicitHeight=b;0<b&&!isNaN(b)&&(this._scaleHeight=b)},enumerable:!0,configurable:!0});a.prototype.updateTransform=function(){if(this.visible){var b=this.texture,a,e;this.spriteFrame?(a=this.spriteFrame.w,e=this.spriteFrame.h):(a=b._textureWidth,e=b._textureHeight);var h=this.spriteFrame?this.spriteFrame.x:0,g=this.spriteFrame?this.spriteFrame.y:0,k=this._scaleWidth,l=this._scaleHeight;(!b||0==k||
- 0==l)&&c.Logger.fatal("ScaleBitmap\u9700\u8981\u8bbe\u7f6eScaleSize");var b=e-this._top-this._bottom,n=a-this._left-this._right,l=l-this._top-this._bottom,k=k-this._left-this._right;this._topLeftBitmap.spriteFrame.x=0+h;this._topLeftBitmap.spriteFrame.y=0+g;this._topLeftBitmap.spriteFrame.w=this._left;this._topLeftBitmap.spriteFrame.h=this._top;this._topMiddleBitmap.spriteFrame.x=this._left+h;this._topMiddleBitmap.spriteFrame.y=0+g;this._topMiddleBitmap.spriteFrame.w=n;this._topMiddleBitmap.spriteFrame.h=
- this._top;this.setChildScaleX(this._topMiddleBitmap,k/n);this._topMiddleBitmap.x=this._left;this._topRightBitmap.spriteFrame.x=a-this._right+h;this._topRightBitmap.spriteFrame.y=0+g;this._topRightBitmap.spriteFrame.w=this._right;this._topRightBitmap.spriteFrame.h=this._top;this._topRightBitmap.x=this._left+k;this._middleLeftBitmap.spriteFrame.x=0+h;this._middleLeftBitmap.spriteFrame.y=this._top+g;this._middleLeftBitmap.spriteFrame.w=this._left;this._middleLeftBitmap.spriteFrame.h=b;this.setChildScaleY(this._middleLeftBitmap,
- l/b);this._middleLeftBitmap.y=this._top;this._middleMiddleBitmap.spriteFrame.x=this._left+h;this._middleMiddleBitmap.spriteFrame.y=this._top+g;this._middleMiddleBitmap.spriteFrame.w=n;this._middleMiddleBitmap.spriteFrame.h=b;this.setChildScaleX(this._middleMiddleBitmap,k/n);this.setChildScaleY(this._middleMiddleBitmap,l/b);this._middleMiddleBitmap.x=this._left;this._middleMiddleBitmap.y=this._top;this._middleRightBitmap.spriteFrame.x=a-this._right+h;this._middleRightBitmap.spriteFrame.y=this._top+
- g;this._middleRightBitmap.spriteFrame.w=this._right;this._middleRightBitmap.spriteFrame.h=b;this.setChildScaleY(this._middleRightBitmap,l/b);this._middleRightBitmap.x=this._left+k;this._middleRightBitmap.y=this._top;this._bottomLeftBitmap.spriteFrame.x=0+h;this._bottomLeftBitmap.spriteFrame.y=e-this._bottom+g;this._bottomLeftBitmap.spriteFrame.w=this._left;this._bottomLeftBitmap.spriteFrame.h=this._bottom;this._bottomLeftBitmap.y=this._top+l;this._bottomMiddleBitmap.spriteFrame.x=this._left+h;this._bottomMiddleBitmap.spriteFrame.y=
- e-this._bottom+g;this._bottomMiddleBitmap.spriteFrame.w=n;this._bottomMiddleBitmap.spriteFrame.h=this._bottom;this.setChildScaleX(this._bottomMiddleBitmap,k/n);this._bottomMiddleBitmap.x=this._left;this._bottomMiddleBitmap.y=this._top+l;this._bottomRightBitmap.spriteFrame.x=a-this._right+h;this._bottomRightBitmap.spriteFrame.y=e-this._bottom+g;this._bottomRightBitmap.spriteFrame.w=this._right;this._bottomRightBitmap.spriteFrame.h=this._bottom;this._bottomRightBitmap.x=this._left+k;this._bottomRightBitmap.y=
- this._top+l;d.prototype.updateTransform.call(this)}};a.prototype.setChildScaleX=function(b,a){0>a&&(a=0);b.scaleX=a};a.prototype.setChildScaleY=function(b,a){0>a&&(a=0);b.scaleY=a};return a}(c.DisplayObjectContainer);c.Scale9Bitmap=e})(ns_egret||(ns_egret={}));ns_egret.Codec={name:"Jacob__Codec"};ns_egret.Utils={};ns_egret.Utils.unzip=function(){return ns_egret.Codec.GZip.gunzip.apply(ns_egret.Codec.GZip,arguments)};ns_egret.Utils.unzipBase64=function(){var c=ns_egret.Codec.Base64.decode.apply(ns_egret.Codec.Base64,arguments);return ns_egret.Codec.GZip.gunzip.apply(ns_egret.Codec.GZip,[c])};
- ns_egret.Utils.unzipBase64AsArray=function(c,e){e=e||1;var d=this.unzipBase64(c),a=[],b,f,m;b=0;for(m=d.length/e;b<m;b++){a[b]=0;for(f=e-1;0<=f;--f)a[b]+=d.charCodeAt(b*e+f)<<8*f}return a};ns_egret.Utils.unzipAsArray=function(c,e){e=e||1;var d=this.unzip(c),a=[],b,f,m;b=0;for(m=d.length/e;b<m;b++){a[b]=0;for(f=e-1;0<=f;--f)a[b]+=d.charCodeAt(b*e+f)<<8*f}return a};ns_egret.Utils.StringToArray=function(c){c=c.split(",");var e=[],d;for(d=0;d<c.length;d++)e.push(parseInt(c[d]));return e};ns_egret.Codec.Base64={name:"Jacob__Codec__Base64"};ns_egret.Codec.Base64._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d";
- ns_egret.Codec.Base64.decode=function(c){var e=[],d,a,b,f,m,h=0;for(c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<c.length;)d=this._keyStr.indexOf(c.charAt(h++)),a=this._keyStr.indexOf(c.charAt(h++)),f=this._keyStr.indexOf(c.charAt(h++)),m=this._keyStr.indexOf(c.charAt(h++)),d=d<<2|a>>4,a=(a&15)<<4|f>>2,b=(f&3)<<6|m,e.push(String.fromCharCode(d)),64!=f&&e.push(String.fromCharCode(a)),64!=m&&e.push(String.fromCharCode(b));return e=e.join("")};
- ns_egret.Codec.Base64.decodeAsArray=function(c,e){var d=this.decode(c),a=[],b,f,m;b=0;for(m=d.length/e;b<m;b++){a[b]=0;for(f=e-1;0<=f;--f)a[b]+=d.charCodeAt(b*e+f)<<8*f}return a};ns_egret.Utils.uint8ArrayToUint32Array=function(c){if(0!=c.length%4)return null;for(var e=c.length/4,d=window.Uint32Array?new Uint32Array(e):[],a=0;a<e;a++){var b=4*a;d[a]=c[b]+256*c[b+1]+65536*c[b+2]+16777216*c[b+3]}return d};ns_egret.Codec.GZip=function(c){this.data=c;this.debug=!1;this.gpflags=void 0;this.files=0;this.unzipped=[];this.buf32k=Array(32768);this.bIdx=0;this.modeZIP=!1;this.bytepos=0;this.bb=1;this.bits=0;this.nameBuf=[];this.fileout=void 0;this.literalTree=Array(ns_egret.Codec.GZip.LITERALS);this.distanceTree=Array(32);this.treepos=0;this.Places=null;this.len=0;this.fpos=Array(17);this.fpos[0]=0;this.fmax=this.flens=void 0};ns_egret.Codec.GZip.gunzip=function(c){return(new ns_egret.Codec.GZip(c)).gunzip()[0][0]};
- ns_egret.Codec.GZip.HufNode=function(){this.b1=this.b0=0;this.jump=null;this.jumppos=-1};ns_egret.Codec.GZip.LITERALS=288;ns_egret.Codec.GZip.NAMEMAX=256;
- ns_egret.Codec.GZip.bitReverse=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,
- 33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255];
- ns_egret.Codec.GZip.cplens=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];ns_egret.Codec.GZip.cplext=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99];ns_egret.Codec.GZip.cpdist=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];ns_egret.Codec.GZip.cpdext=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
- ns_egret.Codec.GZip.border=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ns_egret.Codec.GZip.prototype.gunzip=function(){this.outputArr=[];this.nextFile();return this.unzipped};ns_egret.Codec.GZip.prototype.readByte=function(){this.bits+=8;return this.bytepos<this.data.length?this.data.charCodeAt(this.bytepos++):-1};ns_egret.Codec.GZip.prototype.byteAlign=function(){this.bb=1};
- ns_egret.Codec.GZip.prototype.readBit=function(){var c;this.bits++;c=this.bb&1;this.bb>>=1;0==this.bb&&(this.bb=this.readByte(),c=this.bb&1,this.bb=this.bb>>1|128);return c};ns_egret.Codec.GZip.prototype.readBits=function(c){for(var e=0,d=c;d--;)e=e<<1|this.readBit();c&&(e=ns_egret.Codec.GZip.bitReverse[e]>>8-c);return e};ns_egret.Codec.GZip.prototype.flushBuffer=function(){this.bIdx=0};
- ns_egret.Codec.GZip.prototype.addBuffer=function(c){this.buf32k[this.bIdx++]=c;this.outputArr.push(String.fromCharCode(c));32768==this.bIdx&&(this.bIdx=0)};ns_egret.Codec.GZip.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-1;if(this.flens[this.fpos[this.len]]==this.len)return this.fpos[this.len]++;this.fpos[this.len]++}};
- ns_egret.Codec.GZip.prototype.Rec=function(){var c=this.Places[this.treepos],e;if(17==this.len)return-1;this.treepos++;this.len++;e=this.IsPat();if(0<=e)c.b0=e;else if(c.b0=32768,this.Rec())return-1;e=this.IsPat();if(0<=e)c.b1=e,c.jump=null;else if(c.b1=32768,c.jump=this.Places[this.treepos],c.jumppos=this.treepos,this.Rec())return-1;this.len--;return 0};
- ns_egret.Codec.GZip.prototype.CreateTree=function(c,e,d,a){this.Places=c;this.treepos=0;this.flens=d;this.fmax=e;for(c=0;17>c;c++)this.fpos[c]=0;this.len=0;return this.Rec()?-1:0};ns_egret.Codec.GZip.prototype.DecodeValue=function(c){for(var e,d,a=0,b=c[a];;)if(e=this.readBit()){if(!(b.b1&32768))return b.b1;b=b.jump;e=c.length;for(d=0;d<e;d++)if(c[d]===b){a=d;break}}else{if(!(b.b0&32768))return b.b0;a++;b=c[a]}return-1};
- ns_egret.Codec.GZip.prototype.DeflateLoop=function(){var c,e,d,a,b;do if(c=this.readBit(),d=this.readBits(2),0==d){this.byteAlign();d=this.readByte();d|=this.readByte()<<8;e=this.readByte();e|=this.readByte()<<8;for((d^~e)&65535&&document.write("BlockLen checksum mismatch\n");d--;)e=this.readByte(),this.addBuffer(e)}else if(1==d)for(;;)if(d=ns_egret.Codec.GZip.bitReverse[this.readBits(7)]>>1,23<d?(d=d<<1|this.readBit(),199<d?(d-=128,d=d<<1|this.readBit()):(d-=48,143<d&&(d+=136))):d+=256,256>d)this.addBuffer(d);
- else if(256==d)break;else{var f;d-=257;b=this.readBits(ns_egret.Codec.GZip.cplext[d])+ns_egret.Codec.GZip.cplens[d];d=ns_egret.Codec.GZip.bitReverse[this.readBits(5)]>>3;8<ns_egret.Codec.GZip.cpdext[d]?(f=this.readBits(8),f|=this.readBits(ns_egret.Codec.GZip.cpdext[d]-8)<<8):f=this.readBits(ns_egret.Codec.GZip.cpdext[d]);f+=ns_egret.Codec.GZip.cpdist[d];for(d=0;d<b;d++)e=this.buf32k[this.bIdx-f&32767],this.addBuffer(e)}else if(2==d){var m=Array(320);e=257+this.readBits(5);f=1+this.readBits(5);a=4+
- this.readBits(4);for(d=0;19>d;d++)m[d]=0;for(d=0;d<a;d++)m[ns_egret.Codec.GZip.border[d]]=this.readBits(3);b=this.distanceTree.length;for(a=0;a<b;a++)this.distanceTree[a]=new ns_egret.Codec.GZip.HufNode;if(this.CreateTree(this.distanceTree,19,m,0))return this.flushBuffer(),1;b=e+f;a=0;for(var h=-1;a<b;)if(h++,d=this.DecodeValue(this.distanceTree),16>d)m[a++]=d;else if(16==d){var g;d=3+this.readBits(2);if(a+d>b)return this.flushBuffer(),1;for(g=a?m[a-1]:0;d--;)m[a++]=g}else{d=17==d?3+this.readBits(3):
- 11+this.readBits(7);if(a+d>b)return this.flushBuffer(),1;for(;d--;)m[a++]=0}b=this.literalTree.length;for(a=0;a<b;a++)this.literalTree[a]=new ns_egret.Codec.GZip.HufNode;if(this.CreateTree(this.literalTree,e,m,0))return this.flushBuffer(),1;b=this.literalTree.length;for(a=0;a<b;a++)this.distanceTree[a]=new ns_egret.Codec.GZip.HufNode;d=[];for(a=e;a<m.length;a++)d[a-e]=m[a];if(this.CreateTree(this.distanceTree,f,d,0))return this.flushBuffer(),1;for(;;)if(d=this.DecodeValue(this.literalTree),256<=d){d-=
- 256;if(0==d)break;d--;b=this.readBits(ns_egret.Codec.GZip.cplext[d])+ns_egret.Codec.GZip.cplens[d];d=this.DecodeValue(this.distanceTree);8<ns_egret.Codec.GZip.cpdext[d]?(f=this.readBits(8),f|=this.readBits(ns_egret.Codec.GZip.cpdext[d]-8)<<8):f=this.readBits(ns_egret.Codec.GZip.cpdext[d]);for(f+=ns_egret.Codec.GZip.cpdist[d];b--;)e=this.buf32k[this.bIdx-f&32767],this.addBuffer(e)}else this.addBuffer(d)}while(!c);this.flushBuffer();this.byteAlign();return 0};
- ns_egret.Codec.GZip.prototype.unzipFile=function(c){var e;this.gunzip();for(e=0;e<this.unzipped.length;e++)if(this.unzipped[e][1]==c)return this.unzipped[e][0]};
- ns_egret.Codec.GZip.prototype.nextFile=function(){this.outputArr=[];this.modeZIP=!1;var c=[];c[0]=this.readByte();c[1]=this.readByte();120==c[0]&&218==c[1]&&(this.DeflateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),"geonext.gxt"],this.files++);31==c[0]&&139==c[1]&&(this.skipdir(),this.unzipped[this.files]=[this.outputArr.join(""),"file"],this.files++);if(80==c[0]&&75==c[1]&&(this.modeZIP=!0,c[2]=this.readByte(),c[3]=this.readByte(),3==c[2]&&4==c[3])){c[0]=this.readByte();c[1]=this.readByte();
- this.gpflags=this.readByte();this.gpflags|=this.readByte()<<8;c=this.readByte();c|=this.readByte()<<8;this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();var e=this.readByte(),e=e|this.readByte()<<8,d=this.readByte(),d=d|this.readByte()<<8,a=0;for(this.nameBuf=[];e--;){var b=this.readByte();"/"==b|":"==b?a=0:a<ns_egret.Codec.GZip.NAMEMAX-1&&(this.nameBuf[a++]=
- String.fromCharCode(b))}this.fileout||(this.fileout=this.nameBuf);for(var a=0;a<d;)this.readByte(),a++;8==c&&(this.DeflateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),this.nameBuf.join("")],this.files++);this.skipdir()}};
- ns_egret.Codec.GZip.prototype.skipdir=function(){var c=[],e;this.gpflags&8&&(c[0]=this.readByte(),c[1]=this.readByte(),c[2]=this.readByte(),c[3]=this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte(),this.readByte());this.modeZIP&&this.nextFile();c[0]=this.readByte();if(8!=c[0])return 0;this.gpflags=this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();this.readByte();if(this.gpflags&
- 4){c[0]=this.readByte();c[2]=this.readByte();this.len=c[0]+256*c[1];for(c=0;c<this.len;c++)this.readByte()}if(this.gpflags&8){c=0;for(this.nameBuf=[];e=this.readByte();){if("7"==e||":"==e)c=0;c<ns_egret.Codec.GZip.NAMEMAX-1&&(this.nameBuf[c++]=e)}}if(this.gpflags&16)for(;this.readByte(););this.gpflags&2&&(this.readByte(),this.readByte());this.DeflateLoop();this.readByte();this.readByte();this.readByte();this.readByte();this.modeZIP&&this.nextFile()};/*
- zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
- (function(){function c(b){throw b;}function e(b,a){var c=b.split("."),f=A;!(c[0]in f)&&f.execScript&&f.execScript("var "+c[0]);for(var d;c.length&&(d=c.shift());)!c.length&&a!==x?f[d]=a:f=f[d]?f[d]:f[d]={}}function d(b){if("string"===typeof b){b=b.split("");var a,c;a=0;for(c=b.length;a<c;a++)b[a]=(b[a].charCodeAt(0)&255)>>>0}a=1;c=0;for(var f=b.length,d,e=0;0<f;){d=1024<f?1024:f;f-=d;do a+=b[e++],c+=a;while(--d);a%=65521;c%=65521}return(c<<16|a)>>>0}function a(b,a){this.index="number"===typeof a?
- a:0;this.i=0;this.buffer=b instanceof(z?Uint8Array:Array)?b:new (z?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&c(Error("invalid index"));this.buffer.length<=this.index&&this.f()}function b(b){this.buffer=new (z?Uint16Array:Array)(2*b);this.length=0}function f(b){var a=b.length,c=0,f=Number.POSITIVE_INFINITY,d,e,m,h,t,g,O,s,y;for(s=0;s<a;++s)b[s]>c&&(c=b[s]),b[s]<f&&(f=b[s]);d=1<<c;e=new (z?Uint32Array:Array)(d);m=1;h=0;for(t=2;m<=c;){for(s=0;s<a;++s)if(b[s]===m){g=0;O=h;for(y=0;y<m;++y)g=
- g<<1|O&1,O>>=1;for(y=g;y<d;y+=t)e[y]=m<<16|s;++h}++m;h<<=1;t<<=1}return[e,c,f]}function m(b,a){this.h=s;this.w=0;this.input=b;this.b=0;a&&(a.lazy&&(this.w=a.lazy),"number"===typeof a.compressionType&&(this.h=a.compressionType),a.outputBuffer&&(this.a=z&&a.outputBuffer instanceof Array?new Uint8Array(a.outputBuffer):a.outputBuffer),"number"===typeof a.outputIndex&&(this.b=a.outputIndex));this.a||(this.a=new (z?Uint8Array:Array)(32768))}function h(b,a){this.length=b;this.G=a}function g(){var b=G;switch(C){case 3===
- b:return[257,b-3,0];case 4===b:return[258,b-4,0];case 5===b:return[259,b-5,0];case 6===b:return[260,b-6,0];case 7===b:return[261,b-7,0];case 8===b:return[262,b-8,0];case 9===b:return[263,b-9,0];case 10===b:return[264,b-10,0];case 12>=b:return[265,b-11,1];case 14>=b:return[266,b-13,1];case 16>=b:return[267,b-15,1];case 18>=b:return[268,b-17,1];case 22>=b:return[269,b-19,2];case 26>=b:return[270,b-23,2];case 30>=b:return[271,b-27,2];case 34>=b:return[272,b-31,2];case 42>=b:return[273,b-35,3];case 50>=
- b:return[274,b-43,3];case 58>=b:return[275,b-51,3];case 66>=b:return[276,b-59,3];case 82>=b:return[277,b-67,4];case 98>=b:return[278,b-83,4];case 114>=b:return[279,b-99,4];case 130>=b:return[280,b-115,4];case 162>=b:return[281,b-131,5];case 194>=b:return[282,b-163,5];case 226>=b:return[283,b-195,5];case 257>=b:return[284,b-227,5];case 258===b:return[285,b-258,0];default:c("invalid length: "+b)}}function k(b,a){function f(b,a){var d=b.G,e=[],m=0,h;h=M[b.length];e[m++]=h&65535;e[m++]=h>>16&255;e[m++]=
- h>>24;var t;switch(C){case 1===d:t=[0,d-1,0];break;case 2===d:t=[1,d-2,0];break;case 3===d:t=[2,d-3,0];break;case 4===d:t=[3,d-4,0];break;case 6>=d:t=[4,d-5,1];break;case 8>=d:t=[5,d-7,1];break;case 12>=d:t=[6,d-9,2];break;case 16>=d:t=[7,d-13,2];break;case 24>=d:t=[8,d-17,3];break;case 32>=d:t=[9,d-25,3];break;case 48>=d:t=[10,d-33,4];break;case 64>=d:t=[11,d-49,4];break;case 96>=d:t=[12,d-65,5];break;case 128>=d:t=[13,d-97,5];break;case 192>=d:t=[14,d-129,6];break;case 256>=d:t=[15,d-193,6];break;
- case 384>=d:t=[16,d-257,7];break;case 512>=d:t=[17,d-385,7];break;case 768>=d:t=[18,d-513,8];break;case 1024>=d:t=[19,d-769,8];break;case 1536>=d:t=[20,d-1025,9];break;case 2048>=d:t=[21,d-1537,9];break;case 3072>=d:t=[22,d-2049,10];break;case 4096>=d:t=[23,d-3073,10];break;case 6144>=d:t=[24,d-4097,11];break;case 8192>=d:t=[25,d-6145,11];break;case 12288>=d:t=[26,d-8193,12];break;case 16384>=d:t=[27,d-12289,12];break;case 24576>=d:t=[28,d-16385,13];break;case 32768>=d:t=[29,d-24577,13];break;default:c("invalid distance")}h=
- t;e[m++]=h[0];e[m++]=h[1];e[m++]=h[2];d=0;for(m=e.length;d<m;++d)y[r++]=e[d];Q[e[0]]++;w[e[3]]++;k=b.length+a-1;s=null}var d,e,m,t,g,O={},s,y=z?new Uint16Array(2*a.length):[],r=0,k=0,Q=new (z?Uint32Array:Array)(286),w=new (z?Uint32Array:Array)(30),l=b.w,p;if(!z){for(m=0;285>=m;)Q[m++]=0;for(m=0;29>=m;)w[m++]=0}Q[256]=1;d=0;for(e=a.length;d<e;++d){m=g=0;for(t=3;m<t&&d+m!==e;++m)g=g<<8|a[d+m];O[g]===x&&(O[g]=[]);m=O[g];if(!(0<k--)){for(;0<m.length&&32768<d-m[0];)m.shift();if(d+3>=e){s&&f(s,-1);m=0;
- for(t=e-d;m<t;++m)p=a[d+m],y[r++]=p,++Q[p];break}if(0<m.length){g=t=x;var q=0,H=x,N=x,v=H=x,n=a.length,N=0,v=m.length;a:for(;N<v;N++){t=m[v-N-1];H=3;if(3<q){for(H=q;3<H;H--)if(a[t+H-1]!==a[d+H-1])continue a;H=q}for(;258>H&&d+H<n&&a[t+H]===a[d+H];)++H;H>q&&(g=t,q=H);if(258===H)break}t=new h(q,d-g);s?s.length<t.length?(p=a[d-1],y[r++]=p,++Q[p],f(t,0)):f(s,-1):t.length<l?s=t:f(t,0)}else s?f(s,-1):(p=a[d],y[r++]=p,++Q[p])}m.push(d)}y[r++]=256;Q[256]++;b.L=Q;b.K=w;return z?y.subarray(0,r):y}function l(a,
- c){function f(b){var a=y[b][r[b]];a===O?(f(b+1),f(b+1)):--s[a];++r[b]}var d=a.length,e=new b(572),m=new (z?Uint8Array:Array)(d),h,t,g;if(!z)for(t=0;t<d;t++)m[t]=0;for(t=0;t<d;++t)0<a[t]&&e.push(t,a[t]);d=Array(e.length/2);h=new (z?Uint32Array:Array)(e.length/2);if(1===d.length)return m[e.pop().index]=1,m;t=0;for(g=e.length/2;t<g;++t)d[t]=e.pop(),h[t]=d[t].value;var O=h.length;t=new (z?Uint16Array:Array)(c);var e=new (z?Uint8Array:Array)(c),s=new (z?Uint8Array:Array)(O);g=Array(c);var y=Array(c),r=
- Array(c),k=(1<<c)-O,Q=1<<c-1,w,p,l;t[c-1]=O;for(w=0;w<c;++w)k<Q?e[w]=0:(e[w]=1,k-=Q),k<<=1,t[c-2-w]=(t[c-1-w]/2|0)+O;t[0]=e[0];g[0]=Array(t[0]);y[0]=Array(t[0]);for(w=1;w<c;++w)t[w]>2*t[w-1]+e[w]&&(t[w]=2*t[w-1]+e[w]),g[w]=Array(t[w]),y[w]=Array(t[w]);for(k=0;k<O;++k)s[k]=c;for(Q=0;Q<t[c-1];++Q)g[c-1][Q]=h[Q],y[c-1][Q]=Q;for(k=0;k<c;++k)r[k]=0;1===e[c-1]&&(--s[0],++r[c-1]);for(w=c-2;0<=w;--w){p=k=0;l=r[w+1];for(Q=0;Q<t[w];Q++)p=g[w+1][l]+g[w+1][l+1],p>h[k]?(g[w][Q]=p,y[w][Q]=O,l+=2):(g[w][Q]=h[k],
- y[w][Q]=k,++k);r[w]=0;1===e[w]&&f(w)}h=s;t=0;for(g=d.length;t<g;++t)m[d[t].index]=h[t];return m}function n(b){var a=new (z?Uint16Array:Array)(b.length),f=[],d=[],e=0,m,h,t;m=0;for(h=b.length;m<h;m++)f[b[m]]=(f[b[m]]|0)+1;m=1;for(h=16;m<=h;m++)d[m]=e,e+=f[m]|0,e>1<<m&&c("overcommitted"),e<<=1;65536>e&&c("undercommitted");m=0;for(h=b.length;m<h;m++){e=d[b[m]];d[b[m]]+=1;f=a[m]=0;for(t=b[m];f<t;f++)a[m]=a[m]<<1|e&1,e>>>=1}return a}function p(b,a){this.input=b;this.a=new (z?Uint8Array:Array)(32768);this.h=
- L.j;var c={},f;if((a||!(a={}))&&"number"===typeof a.compressionType)this.h=a.compressionType;for(f in a)c[f]=a[f];c.outputBuffer=this.a;this.z=new m(this.input,c)}function q(b,a){this.k=[];this.l=32768;this.e=this.g=this.c=this.q=0;this.input=z?new Uint8Array(b):b;this.s=!1;this.m=P;this.B=!1;if(a||!(a={}))a.index&&(this.c=a.index),a.bufferSize&&(this.l=a.bufferSize),a.bufferType&&(this.m=a.bufferType),a.resize&&(this.B=a.resize);switch(this.m){case R:this.b=32768;this.a=new (z?Uint8Array:Array)(32768+
- this.l+258);break;case P:this.b=0;this.a=new (z?Uint8Array:Array)(this.l);this.f=this.J;this.t=this.H;this.o=this.I;break;default:c(Error("invalid inflate mode"))}}function v(b,a){for(var f=b.g,d=b.e,e=b.input,m=b.c,h;d<a;)h=e[m++],h===x&&c(Error("input buffer is broken")),f|=h<<d,d+=8;b.g=f>>>a;b.e=d-a;b.c=m;return f&(1<<a)-1}function F(b,a){for(var f=b.g,d=b.e,e=b.input,m=b.c,h=a[0],t=a[1],g;d<t;)g=e[m++],g===x&&c(Error("input buffer is broken")),f|=g<<d,d+=8;e=h[f&(1<<t)-1];h=e>>>16;b.g=f>>h;b.e=
- d-h;b.c=m;return e&65535}function r(b){function a(b,c,f){var d,e,m,h;for(h=0;h<b;)switch(d=F(this,c),d){case 16:for(m=3+v(this,2);m--;)f[h++]=e;break;case 17:for(m=3+v(this,3);m--;)f[h++]=0;e=0;break;case 18:for(m=11+v(this,7);m--;)f[h++]=0;e=0;break;default:e=f[h++]=d}return f}var c=v(b,5)+257,d=v(b,5)+1,e=v(b,4)+4,m=new (z?Uint8Array:Array)(t.length),h;for(h=0;h<e;++h)m[t[h]]=v(b,3);e=f(m);m=new (z?Uint8Array:Array)(c);h=new (z?Uint8Array:Array)(d);b.o(f(a.call(b,c,e,m)),f(a.call(b,d,e,h)))}function D(b,
- a){var f,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.M=a.verify);f=b[this.c++];d=b[this.c++];switch(f&15){case S:this.method=S;break;default:c(Error("unsupported compression method"))}0!==((f<<8)+d)%31&&c(Error("invalid fcheck flag:"+((f<<8)+d)%31));d&32&&c(Error("fdict flag is not supported"));this.A=new q(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}var x=void 0,C=!0,A=this,z="undefined"!==typeof Uint8Array&&"undefined"!==
- typeof Uint16Array&&"undefined"!==typeof Uint32Array;a.prototype.f=function(){var b=this.buffer,a,c=b.length,f=new (z?Uint8Array:Array)(c<<1);if(z)f.set(b);else for(a=0;a<c;++a)f[a]=b[a];return this.buffer=f};a.prototype.d=function(b,a,c){var f=this.buffer,d=this.index,e=this.i,m=f[d];c&&1<a&&(b=8<a?(E[b&255]<<24|E[b>>>8&255]<<16|E[b>>>16&255]<<8|E[b>>>24&255])>>32-a:E[b]>>8-a);if(8>a+e)m=m<<a|b,e+=a;else for(c=0;c<a;++c)m=m<<1|b>>a-c-1&1,8===++e&&(e=0,f[d++]=E[m],m=0,d===f.length&&(f=this.f()));
- f[d]=m;this.buffer=f;this.i=e;this.index=d};a.prototype.finish=function(){var b=this.buffer,a=this.index,c;0<this.i&&(b[a]<<=8-this.i,b[a]=E[b[a]],a++);z?c=b.subarray(0,a):(b.length=a,c=b);return c};var u=new (z?Uint8Array:Array)(256),J;for(J=0;256>J;++J){for(var B=J,K=B,I=7,B=B>>>1;B;B>>>=1)K<<=1,K|=B&1,--I;u[J]=(K<<I&255)>>>0}var E=u,u=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,
- 498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,
- 3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,
- 2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,
- 2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,
- 2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,
- 711928724,3020668471,3272380065,1510334235,755167117];z&&new Uint32Array(u);b.prototype.getParent=function(b){return 2*((b-2)/4|0)};b.prototype.push=function(b,a){var c,f,d=this.buffer,e;c=this.length;d[this.length++]=a;for(d[this.length++]=b;0<c;)if(f=this.getParent(c),d[c]>d[f])e=d[c],d[c]=d[f],d[f]=e,e=d[c+1],d[c+1]=d[f+1],d[f+1]=e,c=f;else break;return this.length};b.prototype.pop=function(){var b,a,c=this.buffer,f,d,e;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(e=
- 0;;){d=2*e+2;if(d>=this.length)break;d+2<this.length&&c[d+2]>c[d]&&(d+=2);if(c[d]>c[e])f=c[e],c[e]=c[d],c[d]=f,f=c[e+1],c[e+1]=c[d+1],c[d+1]=f;else break;e=d}return{index:b,value:a,length:this.length}};var s=2,u={NONE:0,r:1,j:s,N:3},w=[];for(J=0;288>J;J++)switch(C){case 143>=J:w.push([J+48,8]);break;case 255>=J:w.push([J-144+400,9]);break;case 279>=J:w.push([J-256+0,7]);break;case 287>=J:w.push([J-280+192,8]);break;default:c("invalid literal: "+J)}m.prototype.n=function(){var b,f,d,e,m=this.input;
- switch(this.h){case 0:d=0;for(e=m.length;d<e;){f=z?m.subarray(d,d+65535):m.slice(d,d+65535);d+=f.length;var h=d===e,t=x,g=t=x,g=t=x,O=this.a,y=this.b;if(z){for(O=new Uint8Array(this.a.buffer);O.length<=y+f.length+5;)O=new Uint8Array(O.length<<1);O.set(this.a)}t=h?1:0;O[y++]=t|0;t=f.length;g=~t+65536&65535;O[y++]=t&255;O[y++]=t>>>8&255;O[y++]=g&255;O[y++]=g>>>8&255;if(z)O.set(f,y),y+=f.length,O=O.subarray(0,y);else{t=0;for(g=f.length;t<g;++t)O[y++]=f[t];O.length=y}this.b=y;this.a=O}break;case 1:d=
- new a(new Uint8Array(this.a.buffer),this.b);d.d(1,1,C);d.d(1,2,C);m=k(this,m);f=0;for(h=m.length;f<h;f++)if(e=m[f],a.prototype.d.apply(d,w[e]),256<e)d.d(m[++f],m[++f],C),d.d(m[++f],5),d.d(m[++f],m[++f],C);else if(256===e)break;this.a=d.finish();this.b=this.a.length;break;case s:e=new a(new Uint8Array(this.a),this.b);var r,Q,p,q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],M,H,t=Array(19),N,O=s;e.d(1,1,C);e.d(O,2,C);m=k(this,m);g=l(this.L,15);M=n(g);O=l(this.K,7);y=n(O);for(r=286;257<r&&0===g[r-
- 1];r--);for(Q=30;1<Q&&0===O[Q-1];Q--);var v=r,G=Q;b=new (z?Uint32Array:Array)(v+G);var P=new (z?Uint32Array:Array)(316),L,D;H=new (z?Uint8Array:Array)(19);for(N=p=0;N<v;N++)b[p++]=g[N];for(N=0;N<G;N++)b[p++]=O[N];if(!z){N=0;for(G=H.length;N<G;++N)H[N]=0}N=L=0;for(G=b.length;N<G;N+=p){for(p=1;N+p<G&&b[N+p]===b[N];++p);v=p;if(0===b[N])if(3>v)for(;0<v--;)P[L++]=0,H[0]++;else for(;0<v;)D=138>v?v:138,D>v-3&&D<v&&(D=v-3),10>=D?(P[L++]=17,P[L++]=D-3,H[17]++):(P[L++]=18,P[L++]=D-11,H[18]++),v-=D;else if(P[L++]=
- b[N],H[b[N]]++,v--,3>v)for(;0<v--;)P[L++]=b[N],H[b[N]]++;else for(;0<v;)D=6>v?v:6,D>v-3&&D<v&&(D=v-3),P[L++]=16,P[L++]=D-3,H[16]++,v-=D}b=z?P.subarray(0,L):P.slice(0,L);H=l(H,7);for(N=0;19>N;N++)t[N]=H[q[N]];for(p=19;4<p&&0===t[p-1];p--);q=n(H);e.d(r-257,5,C);e.d(Q-1,5,C);e.d(p-4,4,C);for(N=0;N<p;N++)e.d(t[N],3,C);N=0;for(t=b.length;N<t;N++)if(f=b[N],e.d(q[f],H[f],C),16<=f){N++;switch(f){case 16:h=2;break;case 17:h=3;break;case 18:h=7;break;default:c("invalid code: "+f)}e.d(b[N],h,C)}h=[M,g];y=[y,
- O];f=h[0];h=h[1];O=y[0];M=y[1];y=0;for(t=m.length;y<t;++y)if(d=m[y],e.d(f[d],h[d],C),256<d)e.d(m[++y],m[++y],C),g=m[++y],e.d(O[g],M[g],C),e.d(m[++y],m[++y],C);else if(256===d)break;this.a=e.finish();this.b=this.a.length;break;default:c("invalid compression type")}return this.a};J=[];var G;for(G=3;258>=G;G++)B=g(),J[G]=B[2]<<24|B[1]<<16|B[0];var M=z?new Uint32Array(J):J,L=u;p.prototype.n=function(){var b,a,f,e,m=0;e=this.a;b=S;switch(b){case S:a=Math.LOG2E*Math.log(32768)-8;break;default:c(Error("invalid compression method"))}a=
- a<<4|b;e[m++]=a;switch(b){case S:switch(this.h){case L.NONE:f=0;break;case L.r:f=1;break;case L.j:f=2;break;default:c(Error("unsupported compression type"))}break;default:c(Error("invalid compression method"))}b=f<<6|0;e[m++]=b|31-(256*a+b)%31;b=d(this.input);this.z.b=m;e=this.z.n();m=e.length;z&&(e=new Uint8Array(e.buffer),e.length<=m+4&&(this.a=new Uint8Array(e.length+4),this.a.set(e),e=this.a),e=e.subarray(0,m+4));e[m++]=b>>24&255;e[m++]=b>>16&255;e[m++]=b>>8&255;e[m++]=b&255;return e};e("Zlib.Deflate",
- p);e("Zlib.Deflate.compress",function(b,a){return(new p(b,a)).n()});e("Zlib.Deflate.CompressionType",L);e("Zlib.Deflate.CompressionType.NONE",L.NONE);e("Zlib.Deflate.CompressionType.FIXED",L.r);e("Zlib.Deflate.CompressionType.DYNAMIC",L.j);var R=0,P=1,u={D:R,C:P};q.prototype.p=function(){for(;!this.s;){var b=v(this,3);b&1&&(this.s=C);b>>>=1;switch(b){case 0:var b=this.input,a=this.c,f=this.a,d=this.b,e=x,m=x,h=x,t=f.length,e=x;this.e=this.g=0;e=b[a++];e===x&&c(Error("invalid uncompressed block header: LEN (first byte)"));
- m=e;e=b[a++];e===x&&c(Error("invalid uncompressed block header: LEN (second byte)"));m|=e<<8;e=b[a++];e===x&&c(Error("invalid uncompressed block header: NLEN (first byte)"));h=e;e=b[a++];e===x&&c(Error("invalid uncompressed block header: NLEN (second byte)"));h|=e<<8;m===~h&&c(Error("invalid uncompressed block header: length verify"));a+m>b.length&&c(Error("input buffer is broken"));switch(this.m){case R:for(;d+m>f.length;){e=t-d;m-=e;if(z)f.set(b.subarray(a,a+e),d),d+=e,a+=e;else for(;e--;)f[d++]=
- b[a++];this.b=d;f=this.f();d=this.b}break;case P:for(;d+m>f.length;)f=this.f({v:2});break;default:c(Error("invalid inflate mode"))}if(z)f.set(b.subarray(a,a+m),d),d+=m,a+=m;else for(;m--;)f[d++]=b[a++];this.c=a;this.b=d;this.a=f;break;case 1:this.o(N,T);break;case 2:r(this);break;default:c(Error("unknown BTYPE: "+b))}}return this.t()};J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var t=z?new Uint16Array(J):J;J=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,
- 258,258,258];var y=z?new Uint16Array(J):J;J=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];var H=z?new Uint8Array(J):J;J=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];var O=z?new Uint16Array(J):J;J=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var Q=z?new Uint8Array(J):J;J=new (z?Uint8Array:Array)(288);B=0;for(K=J.length;B<K;++B)J[B]=143>=B?8:255>=B?9:279>=B?7:8;var N=f(J);J=new (z?Uint8Array:
- Array)(30);B=0;for(K=J.length;B<K;++B)J[B]=5;var T=f(J);q.prototype.o=function(b,a){var c=this.a,f=this.b;this.u=b;for(var d=c.length-258,e,m,h;256!==(e=F(this,b));)if(256>e)f>=d&&(this.b=f,c=this.f(),f=this.b),c[f++]=e;else{e-=257;h=y[e];0<H[e]&&(h+=v(this,H[e]));e=F(this,a);m=O[e];0<Q[e]&&(m+=v(this,Q[e]));for(f>=d&&(this.b=f,c=this.f(),f=this.b);h--;)c[f]=c[f++-m]}for(;8<=this.e;)this.e-=8,this.c--;this.b=f};q.prototype.I=function(b,a){var c=this.a,f=this.b;this.u=b;for(var d=c.length,e,m,h;256!==
- (e=F(this,b));)if(256>e)f>=d&&(c=this.f(),d=c.length),c[f++]=e;else{e-=257;h=y[e];0<H[e]&&(h+=v(this,H[e]));e=F(this,a);m=O[e];0<Q[e]&&(m+=v(this,Q[e]));for(f+h>d&&(c=this.f(),d=c.length);h--;)c[f]=c[f++-m]}for(;8<=this.e;)this.e-=8,this.c--;this.b=f};q.prototype.f=function(){var b=new (z?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,f,d=this.a;if(z)b.set(d.subarray(32768,b.length));else{c=0;for(f=b.length;c<f;++c)b[c]=d[c+32768]}this.k.push(b);this.q+=b.length;if(z)d.set(d.subarray(a,a+32768));
- else for(c=0;32768>c;++c)d[c]=d[a+c];this.b=32768;return d};q.prototype.J=function(b){var a,c=this.input.length/this.c+1|0,f,d,e,m=this.input,h=this.a;b&&("number"===typeof b.v&&(c=b.v),"number"===typeof b.F&&(c+=b.F));2>c?(f=(m.length-this.c)/this.u[2],e=258*(f/2)|0,d=e<h.length?h.length+e:h.length<<1):d=h.length*c;z?(a=new Uint8Array(d),a.set(h)):a=h;return this.a=a};q.prototype.t=function(){var b=0,a=this.a,c=this.k,f,d=new (z?Uint8Array:Array)(this.q+(this.b-32768)),e,m,h,t;if(0===c.length)return z?
- this.a.subarray(32768,this.b):this.a.slice(32768,this.b);e=0;for(m=c.length;e<m;++e){f=c[e];h=0;for(t=f.length;h<t;++h)d[b++]=f[h]}e=32768;for(m=this.b;e<m;++e)d[b++]=a[e];this.k=[];return this.buffer=d};q.prototype.H=function(){var b,a=this.b;z?this.B?(b=new Uint8Array(a),b.set(this.a.subarray(0,a))):b=this.a.subarray(0,a):(this.a.length>a&&(this.a.length=a),b=this.a);return this.buffer=b};D.prototype.p=function(){var b=this.input,a,f;a=this.A.p();this.c=this.A.c;this.M&&(f=(b[this.c++]<<24|b[this.c++]<<
- 16|b[this.c++]<<8|b[this.c++])>>>0,f!==d(a)&&c(Error("invalid adler-32 checksum")));return a};e("Zlib.Inflate",D);e("Zlib.Inflate.BufferType",u);u.ADAPTIVE=u.C;u.BLOCK=u.D;e("Zlib.Inflate.prototype.decompress",D.prototype.p);u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];z&&new Uint16Array(u);u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258];z&&new Uint16Array(u);u=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];z&&new Uint8Array(u);
- u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];z&&new Uint16Array(u);u=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];z&&new Uint8Array(u);u=new (z?Uint8Array:Array)(288);J=0;for(B=u.length;J<B;++J)u[J]=143>=J?8:255>=J?9:279>=J?7:8;f(u);u=new (z?Uint8Array:Array)(30);J=0;for(B=u.length;J<B;++J)u[J]=5;f(u);var S=8}).call(this);__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._isSupportDOMParser=this._xmlDict=this._parser=null;this._xmlDict={};window.DOMParser?(this._isSupportDOMParser=!0,this._parser=new DOMParser):this._isSupportDOMParser=!1}__extends(a,d);a.getInstance=function(){a._instance||(a._instance=new a);return a._instance};a.prototype.parse=function(b){var a=b;b=this.getList(b);b=this.parserXML(b).documentElement;"plist"!=b.tagName&&c.Logger.fatal(a+"\u4e0d\u662fplist\u6216\u8005\u6ca1\u6709\u9884\u52a0\u8f7dplist");
- for(var a=null,d=0,e=b.childNodes.length;d<e&&!(a=b.childNodes[d],1==a.nodeType);d++);return this.parseNode(a)};a.prototype.tmxParse=function(b,a){"undefined"===typeof a&&(a=!1);a||(b=this.getList(b));return this.parserXML(b)};a.prototype.parserXML=function(b){for(var a=0;"\n"==b.charAt(a)||"\t"==b.charAt(a)||"\r"==b.charAt(a)||" "==b.charAt(a);)a++;0!=a&&(b=b.substring(a,b.length));this._isSupportDOMParser?a=this._parser.parseFromString(b,"text/xml"):(a=new ActiveXObject("Microsoft.XMLDOM"),a.async=
- "false",a.loadXML(b));null==a&&c.Logger.info("xml not found!");return a};a.prototype.parseNode=function(b){var a=null;switch(b.tagName){case "dict":a=this.parseDict(b);break;case "array":a=this.parseArray(b);break;case "string":if(1==b.childNodes.length)a=b.firstChild.nodeValue;else for(var a="",c=0;c<b.childNodes.length;c++)a+=b.childNodes[c].nodeValue;break;case "false":a=!1;break;case "true":a=!0;break;case "real":a=parseFloat(b.firstChild.nodeValue);break;case "integer":a=parseInt(b.firstChild.nodeValue,
- 10)}return a};a.prototype.parseArray=function(b){for(var a=[],c=0,d=b.childNodes.length;c<d;c++){var e=b.childNodes[c];1==e.nodeType&&a.push(this.parseNode(e))}return a};a.prototype.parseDict=function(b){for(var a={},c=null,d=0,e=b.childNodes.length;d<e;d++){var k=b.childNodes[d];1==k.nodeType&&("key"==k.tagName?c=k.firstChild.nodeValue:a[c]=this.parseNode(k))}return a};a.prototype.getName=function(b){var a=b.lastIndexOf("/",b.length)+1,c=b.lastIndexOf(".",b.length);return b.substring(a,c)};a.prototype.getExt=
- function(b){var a=b.lastIndexOf(".",b.length)+1;return b.substring(a,b.length)};a.prototype.getList=function(b){return null!=this._xmlDict?this._xmlDict[b]:null};a._instance=null;return a}(c.HashObject);c.SAXParser=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.translate=this.isHD?function(b){return"translate3d("+b.x+"px, "+(b.y-c.MainContext.instance.stage.stageHeight)+"px, 0) "}:function(b){console.log("translate("+b.x+"px, "+b.y+"px) ");return"translate("+b.x+"px, "+b.y+"px) "};this.rotate=this.isHD?function(b){return"rotateZ("+b+"deg) "}:function(b){return"rotate("+b+"deg) "};this.ua=navigator.userAgent.toLowerCase();var b=this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/)||
- this.ua.match(/chrome|safari/);b&&0<b.length&&(b=b[0],"micromessenger"==b&&(this.type="wechat"),this.type=b);this.type="unknow";switch(this.type){case "firefox":this.pfx="Moz";this.isHD=!0;break;case "chrome":case "safari":this.pfx="webkit";this.isHD=!0;break;case "opera":this.pfx="O";this.isHD=!1;break;case "ie":this.pfx="ms";this.isHD=!1;break;default:this.pfx="webkit",this.isHD=!0}this.trans=this.pfx+"Transform";this.isMobile=-1!=this.ua.indexOf("mobile")||-1!=this.ua.indexOf("android")}__extends(a,
- d);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.prototype.$new=function(b){return this.$(document.createElement(b))};a.prototype.$=function(b){var f=document;if(b=b instanceof HTMLElement?b:f.querySelector(b))b.find=b.find||this.$,b.hasClass=b.hasClass||function(b){return this.className.match(RegExp("(\\s|^)"+b+"(\\s|$)"))},b.addClass=b.addClass||function(b){this.hasClass(b)||(this.className&&(this.className+=" "),this.className+=b);return this},b.removeClass=
- b.removeClass||function(b){this.hasClass(b)&&(this.className=this.className.replace(b,""));return this},b.remove=b.remove||function(){},b.appendTo=b.appendTo||function(b){b.appendChild(this);return this},b.prependTo=b.prependTo||function(b){b.childNodes[0]?b.insertBefore(this,b.childNodes[0]):b.appendChild(this);return this},b.transforms=b.transforms||function(){this.style[a.getInstance().trans]=a.getInstance().translate(this.position)+a.getInstance().rotate(this.rotation)+a.getInstance().scale(this.scale)+
- a.getInstance().skew(this.skew);return this},b.position=b.position||{x:0,y:0},b.rotation=b.rotation||0,b.scale=b.scale||{x:1,y:1},b.skew=b.skew||{x:0,y:0},b.translates=function(b,a){this.position.x=b;this.position.y=a-c.MainContext.instance.stage.stageHeight;this.transforms();return this},b.rotate=function(b){this.rotation=b;this.transforms();return this},b.resize=function(b,a){this.scale.x=b;this.scale.y=a;this.transforms();return this},b.setSkew=function(b,a){this.skew.x=b;this.skew.y=a;this.transforms();
- return this};return b};a.prototype.scale=function(b){return"scale("+b.x+", "+b.y+") "};a.prototype.skew=function(b){return"skewX("+-b.x+"deg) skewY("+b.y+"deg)"};return a}(c.HashObject);c.Browser=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(a){"undefined"===typeof a&&(a="");this._xmlStr="";this._xmlStr=a;""!=a&&(a=c.SAXParser.getInstance().tmxParse(a,!0),this._ansXML(a.documentElement))}d.prototype._ansXML=function(a){var b=0;if(0<a.childNodes.length)for(var c=0;c<a.childNodes.length;c++){var e=a.childNodes[c];if(1==e.nodeType){var h=new d("");h._ansXML(e);e=e.nodeName;null==this[e]&&(this[e]=[]);this[e].push(h);b++}}0==b&&(this.value=a.textContent);if(0<a.attributes.length)for(b=0;b<a.attributes.length;b++)c=
- a.attributes[b],this["$"+c.name]=c.value};return d}();c.XML=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a,c){d.call(this);this._target=null;this.loop=this.ignoreGlobalPause=this._useTicks=!1;this._actions=this._steps=this.pluginData=null;this.paused=!1;this.duration=0;this._prevPos=-1;this.position=null;this._stepPosition=this._prevPosition=0;this.passive=!1;this.initialize(b,a,c)}__extends(a,d);a.get=function(b,c,d,e){"undefined"===typeof c&&(c=null);"undefined"===typeof d&&(d=null);"undefined"===typeof e&&(e=!1);e&&a.removeTweens(b);return new a(b,c,d)};
- a.removeTweens=function(b){if(b.tween_count){for(var f=a._tweens,d=f.length-1;0<=d;d--)f[d]._target==b&&(f[d].paused=!0,f.splice(d,1));b.tween_count=0}else c.Logger.warning("target\u6ca1\u6709\u6b63\u5728\u6267\u884ctween")};a.tick=function(b,c){"undefined"===typeof c&&(c=!1);for(var d=a._tweens,e=d.length-1;0<=e;e--){var g=d[e];c&&!g.ignoreGlobalPause||g.paused||g.tick(g._useTicks?1:b)}};a._register=function(b,f){var d=b._target,e=a._tweens;if(f)d&&(d.tween_count=d.tween_count?d.tween_count+1:1),
- e.push(b),a._inited||(c.Ticker.getInstance().register(a.tick,null),a._inited=!0);else{d&&d.tween_count--;for(d=e.length;d--;)if(e[d]==b){e.splice(d,1);break}}};a.removeAllTweens=function(){for(var b=a._tweens,c=0,d=b.length;c<d;c++){var e=b[c];e.paused=!0;e._target.tweenjs_count=0}b.length=0};a.prototype.initialize=function(b,c,d){this._target=b;c&&(this._useTicks=c.useTicks,this.ignoreGlobalPause=c.ignoreGlobalPause,this.loop=c.loop,c.onChange&&this.addEventListener("change",c.onChange,c.onChangeObj),
- c.override&&a.removeTweens(b));this.pluginData=d||{};this._curQueueProps={};this._initQueueProps={};this._steps=[];this._actions=[];c&&c.paused?this.paused=!0:a._register(this,!0);c&&null!=c.position&&this.setPosition(c.position,a.NONE)};a.prototype.setPosition=function(b,a){"undefined"===typeof a&&(a=1);0>b&&(b=0);var c=b,d=!1;c>=this.duration&&(this.loop?c%=this.duration:(c=this.duration,d=!0));if(c==this._prevPos)return d;var e=this._prevPos;this.position=this._prevPos=c;this._prevPosition=b;if(this._target)if(d)this._updateTargetProps(null,
- 1);else if(0<this._steps.length){for(var k=0,l=this._steps.length;k<l&&!(this._steps[k].t>c);k++);k=this._steps[k-1];this._updateTargetProps(k,(this._stepPosition=c-k.t)/k.d)}0!=a&&0<this._actions.length&&(this._useTicks?this._runActions(c,c):1==a&&c<e?(e!=this.duration&&this._runActions(e,this.duration),this._runActions(0,c,!0)):this._runActions(e,c));d&&this.setPaused(!0);this.dispatchEventWith("change");return d};a.prototype._runActions=function(b,a,c){"undefined"===typeof c&&(c=!1);var d=b,e=
- a,k=-1,l=this._actions.length,n=1;b>a&&(d=a,e=b,k=l,l=n=-1);for(;(k+=n)!=l;){a=this._actions[k];var p=a.t;(p==e||p>d&&p<e||c&&p==b)&&a.f.apply(a.o,a.p)}};a.prototype._updateTargetProps=function(b,c){var d,e,g,k;if(!b&&1==c)this.passive=!1,d=e=this._curQueueProps;else{if(this.passive=!!b.v)return;b.e&&(c=b.e(c,0,1,1));d=b.p0;e=b.p1}for(var l in this._initQueueProps){if(null==(g=d[l]))d[l]=g=this._initQueueProps[l];if(null==(k=e[l]))e[l]=k=g;g=g==k||0==c||1==c||"number"!=typeof g?1==c?k:g:g+(k-g)*c;
- var n=!1;if(k=a._plugins[l])for(var p=0,q=k.length;p<q;p++){var v=k[p].tween(this,l,g,d,e,c,!!b&&d==e,!b);v==a.IGNORE?n=!0:g=v}n||(this._target[l]=g)}};a.prototype.setPaused=function(b){this.paused=b;a._register(this,!b);return this};a.prototype._cloneProps=function(b){var a={},c;for(c in b)a[c]=b[c];return a};a.prototype._addStep=function(b){0<b.d&&(this._steps.push(b),b.t=this.duration,this.duration+=b.d);return this};a.prototype._appendQueueProps=function(b){var c,d,e,g,k,l;for(l in b)if(void 0===
- this._initQueueProps[l]){d=this._target[l];if(c=a._plugins[l]){e=0;for(g=c.length;e<g;e++)d=c[e].init(this,l,d)}this._initQueueProps[l]=this._curQueueProps[l]=void 0===d?null:d}for(l in b){d=this._curQueueProps[l];if(c=a._plugins[l]){k=k||{};e=0;for(g=c.length;e<g;e++)c[e].step&&c[e].step(this,l,d,b[l],k)}this._curQueueProps[l]=b[l]}k&&this._appendQueueProps(k);return this._curQueueProps};a.prototype._addAction=function(b){b.t=this.duration;this._actions.push(b);return this};a.prototype._set=function(b,
- a){for(var c in b)a[c]=b[c]};a.prototype.wait=function(b,a){"undefined"===typeof a&&(a=!1);if(null==b||0>=b)return this;var c=this._cloneProps(this._curQueueProps);return this._addStep({d:b,p0:c,p1:c,v:a})};a.prototype.to=function(b,a,c){"undefined"===typeof c&&(c=void 0);if(isNaN(a)||0>a)a=0;return this._addStep({d:a||0,p0:this._cloneProps(this._curQueueProps),e:c,p1:this._cloneProps(this._appendQueueProps(b))})};a.prototype.call=function(b,a,c){"undefined"===typeof a&&(a=void 0);"undefined"===typeof c&&
- (c=void 0);return this._addAction({f:b,p:c?c:[this],o:a?a:this._target})};a.prototype.set=function(b,a){"undefined"===typeof a&&(a=null);return this._addAction({f:this._set,o:this,p:[b,a?a:this._target]})};a.prototype.play=function(b){b||(b=this);return this.call(b.setPaused,[!1],b)};a.prototype.pause=function(b){b||(b=this);return this.call(b.setPaused,[!0],b)};a.prototype.tick=function(b){this.paused||this.setPosition(this._prevPosition+b)};a.NONE=0;a.LOOP=1;a.REVERSE=2;a._tweens=[];a.IGNORE={};
- a._plugins={};a._inited=!1;return a}(c.EventDispatcher);c.Tween=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")}d.get=function(a){-1>a&&(a=-1);1<a&&(a=1);return function(b){return 0==a?b:0>a?b*(b*-a+1+a):b*((2-b)*a+(1-a))}};d.getPowIn=function(a){return function(b){return Math.pow(b,a)}};d.getPowOut=function(a){return function(b){return 1-Math.pow(1-b,a)}};d.getPowInOut=function(a){return function(b){return 1>(b*=2)?0.5*Math.pow(b,a):1-0.5*Math.abs(Math.pow(2-b,a))}};d.sineIn=function(a){return 1-Math.cos(a*
- Math.PI/2)};d.sineOut=function(a){return Math.sin(a*Math.PI/2)};d.sineInOut=function(a){return-0.5*(Math.cos(Math.PI*a)-1)};d.getBackIn=function(a){return function(b){return b*b*((a+1)*b-a)}};d.getBackOut=function(a){return function(b){b-=1;return b*b*((a+1)*b+a)+1}};d.getBackInOut=function(a){a*=1.525;return function(b){return 1>(b*=2)?0.5*b*b*((a+1)*b-a):0.5*((b-=2)*b*((a+1)*b+a)+2)}};d.circIn=function(a){return-(Math.sqrt(1-a*a)-1)};d.circOut=function(a){return Math.sqrt(1-a*a)};d.circInOut=function(a){return 1>
- (a*=2)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)};d.bounceIn=function(a){return 1-d.bounceOut(1-a)};d.bounceOut=function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375};d.bounceInOut=function(a){return 0.5>a?0.5*d.bounceIn(2*a):0.5*d.bounceOut(2*a-1)+0.5};d.getElasticIn=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return-(a*Math.pow(2,10*
- (d-=1))*Math.sin((d-e)*c/b))}};d.getElasticOut=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return a*Math.pow(2,-10*d)*Math.sin((d-e)*c/b)+1}};d.getElasticInOut=function(a,b){var c=2*Math.PI;return function(d){var e=b/c*Math.asin(1/a);return 1>(d*=2)?-0.5*a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b):0.5*a*Math.pow(2,-10*(d-=1))*Math.sin((d-e)*c/b)+1}};d.quadIn=d.getPowIn(2);d.quadOut=d.getPowOut(2);d.quadInOut=d.getPowInOut(2);d.cubicIn=d.getPowIn(3);
- d.cubicOut=d.getPowOut(3);d.cubicInOut=d.getPowInOut(3);d.quartIn=d.getPowIn(4);d.quartOut=d.getPowOut(4);d.quartInOut=d.getPowInOut(4);d.quintIn=d.getPowIn(5);d.quintOut=d.getPowOut(5);d.quintInOut=d.getPowInOut(5);d.backIn=d.getBackIn(1.7);d.backOut=d.getBackOut(1.7);d.backInOut=d.getBackInOut(1.7);d.elasticIn=d.getElasticIn(1,0.3);d.elasticOut=d.getElasticOut(1,0.3);d.elasticInOut=d.getElasticInOut(1,0.3*1.5);return d}();c.Ease=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(d){function a(){d.call(this)}__extends(a,d);a.getInstance=function(){return c.MainContext.instance.soundContext};a.prototype.preloadSound=function(b){};a.prototype.playMusic=function(b,a){};a.prototype.stopMusic=function(b){};a.isMusicPlaying=!1;return a}(c.HashObject);c.SoundContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments);this.viewPortWidth=400}__extends(a,d);a.createWithFile=function(b){var c=new a;c.initWithTMXFile(b);return c};a.prototype.initWithTMXFile=function(b){(!b||0==b.length)&&c.Logger.fatal("TMXTiledMap.initWithTMXFile(): tmxFile\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");var a=c.TMXMapInfo.createWithFile(b);if(a){var d=a.getTilesets();(!d||0===d.length)&&c.Logger.info("TMXTiledMap.initWithTMXFile(): Map\u6ca1\u6709",b);this.buildWithMapInfo(a)}};
- a.prototype.buildWithMapInfo=function(b){this.mapInfo=b;var a=0,c=b.getLayers();if(c)for(var e=null,g=0,k=c.length;g<k;g++)if((e=c[g])&&e.visible)e=this.parseLayer(e,b),d.prototype.addChild.call(this,e),a++};a.prototype.parseLayer=function(b,a){var d=this.tilesetForLayer(b,a),d=c.TMXLayer.create(d,b,a);b.ownTiles=!1;d.setupTiles();return d};a.prototype.tilesetForLayer=function(b,a){var d=b.layerWidth,e=b.layerHeight,g=a.getTilesets();if(g)for(var k=g.length-1;0<=k;k--){var l=g[k];if(l)for(var n=0;n<
- e;n++)for(var p=0;p<d;p++){var q=b._tiles[p+d*n];if(0!=q&&(q&c.TMX.TILE_FLIPPED_MASK)>>>0>=l.firstGid)return l}}c.Logger.warning("TMXLayer"+b.name+"\u6ca1\u6709tiles");return null};a.prototype.getLayer=function(b){(!b||0===b.length)&&c.Logger.fatal("TMXTiledMap.getLayer(): layerName\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");for(var a=this.numChildren,e=0;e<a;e++){var h=d.prototype.getChildAt.call(this,e);if(h&&h.getLayerName&&h.getLayerName()==b)return h}return null};a.prototype.getObjectGroup=
- function(b){(!b||0===b.length)&&c.Logger.fatal("TMXTiledMap.getObjectGroup(): groupName\u5e94\u8be5\u662f\u4e0d\u4e3anull\u7684string");var a=this.mapInfo.getObjectGroups();if(a)for(var d=0,e=a.length;d<e;d++){var g=a[d];if(g&&g.getGroupName()==b)return g}return null};a.prototype.propertiesForGID=function(b){return this.mapInfo.getTileProperties()[b]};a.prototype.getProperty=function(b){return this.mapInfo.getProperties()[b.toString()]};a.prototype.setMoveX=function(b){this.x=b;b=this.numChildren;
- for(var a=0;a<b;a++){var d=this.getChildAt(a);if(d instanceof c.TMXLayer){if(d.visible)for(var e=0;e<d.numChildren;e++){var g=d.getChildAt(e);g.x+this.mapInfo.getTileWidth()<-this.x||g.x>-this.x+this.viewPortWidth?g.visible=!1:g.visible=!0}}else e=d.getBounds(),d.visible=d.x+e.width-d.anchorOffsetX<-this.x||d.x-d.anchorOffsetX>-this.x+this.viewPortWidth?!1:!0}};return a}(c.DisplayObjectContainer);c.TMXTiledMap=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments);this._properties=this._layerOrientation=this._tileSet=this._tiles=this._mapTileHeight=this._mapTileWidth=this._layerHeight=this._layerWidth=this._texture=null;this._layerName="";this._opacity=1;this._maxGID=this._minGID=null}__extends(a,d);a.create=function(b,c,d){var e=new a;e.initWithTilesetInfo(b,c,d);return e};a.prototype.initWithTilesetInfo=function(b,a,d){this._texture=c.TextureCache.getInstance().getTexture(b.sourceImage);
- this._layerName=a.name;this._layerWidth=a.layerWidth;this._layerHeight=a.layerHeight;this._tiles=a._tiles;this._minGID=a._minGID;this._maxGID=a._maxGID;this._opacity=a.opacity;this.setProperties(a.getProperties());this._tileSet=b;this._mapTileWidth=d.getTileWidth();this._mapTileHeight=d.getTileHeight();this._layerOrientation=d.getOrientation();b=this.calculateLayerOffset(a.layerX,a.layerY);this.x=b.x;this.y=b.y};a.prototype.calculateLayerOffset=function(b,a){var d=c.Point.identity;switch(this._layerOrientation){case c.TMX.ORIENTATION_ORTHO:d.x=
- b*this._mapTileWidth;d.y=-a*this._mapTileHeight;break;case c.TMX.ORIENTATION_ISO:d.x=this._mapTileWidth/2*(b-a);d.y=this._mapTileHeight/2*(-b-a);break;case c.TMX.ORIENTATION_HEX:(0!==b||0!==a)&&c.Logger.info("hexagonal map\u8fd8\u6ca1\u6709\u5b8c\u6210")}return d};a.prototype.setupTiles=function(){this._tileSet.imageWidth=this._texture._textureWidth;this._tileSet.imageHeight=this._texture._textureHeight;for(var b=this._layerHeight,a=this._layerWidth,d=0;d<b;d++)for(var e=0;e<a;e++){var g=this._tiles[e+
- a*d];0!==g&&(this.appendTileForGID(g,e,d),this._minGID=Math.min(g,this._minGID),this._maxGID=Math.max(g,this._maxGID))}this._maxGID>=this._tileSet.firstGid&&this._minGID>=this._tileSet.firstGid||c.Logger.warning("\u6bcf\u4e2alayer\u53ea\u652f\u63011\u4e2atileset")};a.prototype.appendTileForGID=function(b,a,c){var e=this._tileSet.rectForGID(b),e=this.reusedTileWithRect(e);this.setupTileSprite(e,a,c,b);d.prototype.addChild.call(this,e);return e};a.prototype.reusedTileWithRect=function(b){var a=c.Bitmap.initWithTexture(c.TextureCache.getInstance().getTexture(this._tileSet.sourceImage)),
- d=new c.SpriteSheetFrame;d.x=b.x;d.y=b.y;d.w=this._mapTileWidth;d.h=this._mapTileHeight;a.spriteFrame=d;return a};a.prototype.setupTileSprite=function(b,a,c,d){a=this.getPositionAt(a,c);b.x=a.x;b.y=a.y};a.prototype.getPositionAt=function(b,a){var d=c.Point.identity;switch(this._layerOrientation){case c.TMX.ORIENTATION_ORTHO:d=this.positionForOrthoAt(b,a);break;case c.TMX.ORIENTATION_ISO:d=this.positionForIsoAt(b,a);break;case c.TMX.ORIENTATION_HEX:d=this.positionForHexAt(b,a);break;default:d.x=0,
- d.y=0}return d};a.prototype.positionForIsoAt=function(b,a){c.Point.identity.x=this._mapTileWidth/2*(this._layerWidth+b-a-1);c.Point.identity.y=-this._mapTileHeight/2*(2*this._layerHeight-b-a-2);return c.Point.identity};a.prototype.positionForOrthoAt=function(b,a){c.Point.identity.x=b*this._mapTileWidth;c.Point.identity.y=-(this._layerHeight-a-1)*this._mapTileHeight;return c.Point.identity};a.prototype.positionForHexAt=function(b,a){var d=1==b%2?-this._mapTileHeight/2:0;c.Point.identity.x=3*b*this._mapTileWidth/
- 4;c.Point.identity.y=-((this._layerHeight-a-1)*this._mapTileHeight+d);return c.Point.identity};a.prototype.getTileGIDAt=function(b,a){(b>=this._layerWidth||a>=this._layerHeight||0>b||0>a)&&c.Logger.fatal("TMXLayer.getTileGIDAt():\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");return!this._tiles?(c.Logger.info("TMXLayer.getTileGIDAt(): tileMap\u5df2\u7ecf\u88ab\u9500\u6bc1"),null):(this._tiles[0|b+a*this._layerWidth]&c.TMX.TILE_FLIPPED_MASK)>>>0};a.prototype.getProperties=function(){return this._properties};
- a.prototype.setProperties=function(b){this._properties=b};a.prototype.getProperty=function(b){return this._properties[b]};a.prototype.getLayerName=function(){return this._layerName};return a}(c.DisplayObjectContainer);c.TMXLayer=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.TILE_HORIZONTAL_FLAG=2147483648;c.TILE_VERTICAL_FLAG=1073741824;c.TILE_DIAGONAL_FLAG=536870912;c.TILE_FLIPPED_ALL=(c.TILE_HORIZONTAL_FLAG|c.TILE_VERTICAL_FLAG|c.TILE_DIAGONAL_FLAG)>>>0;c.TILE_FLIPPED_MASK=~c.TILE_FLIPPED_ALL>>>0;c.LAYER_ATTRIB_NONE=1;c.LAYER_ATTRIB_BASE64=2;c.LAYER_ATTRIB_GZIP=4;c.LAYER_ATTRIB_ZLIB=8;c.PROPERTY_NONE=0;c.PROPERTY_MAP=1;c.PROPERTY_LAYER=2;c.PROPERTY_OBJECTGROUP=3;c.PROPERTY_OBJECT=4;c.PROPERTY_TILE=5;c.ORIENTATION_ORTHO=
- 0;c.ORIENTATION_HEX=1;c.ORIENTATION_ISO=2;return c}();c.TMX=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function f(){this._parentGID=this._objectGroups=this._tileSets=this._layers=this._tileHeight=this._tileWidth=this._mapHeight=this._mapWidth=this._orientation=null;this._storingCharacters=!1;this._tileProperties=this._currentString=this._TMXFileName=this._properties=null}f.createWithFile=function(b){var a=new f;a.initWithTMXFile(b);return a};f.prototype.initWithTMXFile=function(b){this.internalInit(b);this.parseXMLFile(this._TMXFileName)};f.prototype.internalInit=function(b){this._tileSets=
- [];this._layers=[];this._TMXFileName=b;this._objectGroups=[];this._properties=[];this._tileProperties=[];this._currentString="";this._storingCharacters=!1};f.prototype.parseXMLFile=function(f){var e=c.ResourceLoader.create(f).data;null==e&&c.Logger.fatal("tmx\u6587\u4ef6\u6ca1\u6709\u52a0\u8f7d\uff1a"+f);var g;f=c.SAXParser.getInstance().tmxParse(e,!0).documentElement;f.getAttribute("version");e=f.getAttribute("orientation");if("map"==f.nodeName&&("orthogonal"==e?this.setOrientation(c.TMX.ORIENTATION_ORTHO):
- "isometric"==e?this.setOrientation(c.TMX.ORIENTATION_ISO):"hexagonal"==e?this.setOrientation(c.TMX.ORIENTATION_HEX):null!==e&&c.Logger.info("TMXFomat: Unsupported orientation:"+this.getOrientation()),this._mapWidth=parseFloat(f.getAttribute("width")),this._mapHeight=parseFloat(f.getAttribute("height")),this._tileWidth=parseFloat(f.getAttribute("tilewidth")),this._tileHeight=parseFloat(f.getAttribute("tileheight")),g=f.querySelectorAll("map \x3e properties \x3e property"))){for(var k={},e=0;e<g.length;e++)k[g[e].getAttribute("name")]=
- g[e].getAttribute("value");this.setProperties(k)}g=f.getElementsByTagName("tileset");"map"!==f.nodeName&&(g=[],g.push(f));for(e=0;e<g.length;e++){var l=g[e];if(k=l.getAttribute("source"))this.parseXMLFile(k);else{k=new d;k.name=l.getAttribute("name")||"";k.firstGid=parseInt(l.getAttribute("firstgid"))||0;k.spacing=parseInt(l.getAttribute("spacing"))||0;k.margin=parseInt(l.getAttribute("margin"))||0;k.tileWidth=parseFloat(l.getAttribute("tilewidth"));k.tileHeight=parseFloat(l.getAttribute("tileheight"));
- var l=l.getElementsByTagName("image")[0].getAttribute("source"),n=-1;this._TMXFileName&&(n=this._TMXFileName.lastIndexOf("/"));-1!==n?(n=this._TMXFileName.substr(0,n+1),k.sourceImage=n+l):k.sourceImage=l;this.setTilesets(k)}}if(k=f.querySelectorAll("tile"))for(e=0;e<k.length;e++)if(g=k[e],this.setParentGID(parseInt(this._tileSets[0].firstGid)+parseInt(g.getAttribute("id")||0)),l=g.querySelectorAll("properties \x3e property")){n={};for(g=0;g<l.length;g++){var p=l[g].getAttribute("name"),q=l[g].getAttribute("value");
- n[p]=q}this._tileProperties[this.getParentGID()]=n}if(k=f.getElementsByTagName("layer"))for(e=0;e<k.length;e++){n=k[e];p=n.getElementsByTagName("data")[0];l=new b;l.name=n.getAttribute("name");l.layerWidth=parseFloat(n.getAttribute("width"));l.layerHeight=parseFloat(n.getAttribute("height"));g=n.getAttribute("visible");l.visible="0"!=g;g=n.getAttribute("opacity")||1;l.opacity=g?parseFloat(g):1;l.layerX=parseFloat(n.getAttribute("x"))||0;l.layerY=parseFloat(n.getAttribute("y"))||0;q="";for(g=0;g<p.childNodes.length;g++)q+=
- p.childNodes[g].nodeValue;q=q.trim();g=p.getAttribute("compression");var v=p.getAttribute("encoding");if(g&&"gzip"!==g&&"zlib"!==g)return c.Logger.fatal("TMXMapInfo.parseXMLFile(): unsupported compression method"),null;switch(g){case "gzip":l._tiles=c.Utils.unzipBase64AsArray(q,4);break;case "zlib":g=new Zlib.Inflate(c.Codec.Base64.decodeAsArray(q,1));l._tiles=c.Utils.uint8ArrayToUint32Array(g.decompress());break;case null:case "":if("base64"==v)l._tiles=c.Codec.Base64.decodeAsArray(q,4);else if("csv"===
- v){l._tiles=[];g=q.split(",");for(p=0;p<g.length;p++)l._tiles.push(parseInt(g[p]))}else{g=p.getElementsByTagName("tile");l._tiles=[];for(p=0;p<g.length;p++)l._tiles.push(parseInt(g[p].getAttribute("gid")))}break;default:c.Logger.info("TMXMapInfo.parseXMLFile(): Only base64 and/or gzip/zlib maps are supported")}if(n=n.querySelectorAll("properties \x3e property")){p={};for(g=0;g<n.length;g++)p[n[g].getAttribute("name")]=n[g].getAttribute("value");l.setProperties(p)}this.setLayers(l)}if(k=f.getElementsByTagName("objectgroup"))for(e=
- 0;e<k.length;e++){n=k[e];l=new a;l.setGroupName(n.getAttribute("name"));l.setPositionOffsetX(parseFloat(n.getAttribute("x"))*this._tileWidth||0);l.setPositionOffsetY(parseFloat(n.getAttribute("y"))*this._tileHeight||0);if(p=n.querySelectorAll("objectgroup \x3e properties \x3e property"))for(g=0;g<p.length;g++)q={},q[p[g].getAttribute("name")]=p[g].getAttribute("value"),l.setProperties(q);if(n=n.querySelectorAll("object"))for(g=0;g<n.length;g++){q=n[g];p={};p.name=q.getAttribute("name")||"";p.type=
- q.getAttribute("type")||"";p.x=parseInt(q.getAttribute("x")||0)+l.getPositionOffsetX();v=parseInt(q.getAttribute("y")||0)+l.getPositionOffsetY();p.y=Math.floor(this._mapHeight*this._tileHeight)-v-p.height;p.width=parseInt(q.getAttribute("width"))||0;p.height=parseInt(q.getAttribute("height"))||0;if(v=q.querySelectorAll("properties \x3e property"))for(var F=0;F<v.length;F++)p[v[F].getAttribute("name")]=v[F].getAttribute("value");if((v=q.querySelectorAll("polygon"))&&0<v.length)(v=v[0].getAttribute("points"))&&
- (p.polygonPoints=this.parsePointsString(v));if((q=q.querySelectorAll("polyline"))&&0<q.length)(q=q[0].getAttribute("points"))&&(p.polylinePoints=this.parsePointsString(q));l.addObject(p)}this.setObjectGroups(l)}return f};f.prototype.parsePointsString=function(b){if(!b)return null;var a=[];b=b.split(" ");for(var c=0;c<b.length;c++){var f=b[c].split(",");a.push({x:f[0],y:f[1]})}return a};f.prototype.getOrientation=function(){return this._orientation};f.prototype.setOrientation=function(b){this._orientation=
- b};f.prototype.getProperties=function(){return this._properties};f.prototype.setProperties=function(b){this._properties=b};f.prototype.getTilesets=function(){return this._tileSets};f.prototype.setTilesets=function(b){this._tileSets.push(b)};f.prototype.getParentGID=function(){return this._parentGID};f.prototype.setParentGID=function(b){this._parentGID=b};f.prototype.getLayers=function(){return this._layers};f.prototype.setLayers=function(b){this._layers.push(b)};f.prototype.getObjectGroups=function(){return this._objectGroups};
- f.prototype.setObjectGroups=function(b){this._objectGroups.push(b)};f.prototype.getTileProperties=function(){return this._tileProperties};f.prototype.setTileProperties=function(b){this._tileProperties.push(b)};f.prototype.getTileWidth=function(){return this._tileWidth};f.prototype.getTileHeight=function(){return this._tileHeight};f.prototype.getMapWidth=function(){return this._mapWidth};f.prototype.getMapHeight=function(){return this._mapHeight};return f}();c.TMXMapInfo=e;var d=function(){function b(){this.name=
- ""}b.prototype.rectForGID=function(b){var a=c.Point.identity;b&=c.TMX.TILE_FLIPPED_MASK;b-=parseInt(this.firstGid,10);var f=Math.floor((this.imageWidth-2*this.margin+this.spacing)/(this.tileWidth+this.spacing));a.x=parseInt(b%f*(this.tileWidth+this.spacing)+this.margin,10);a.y=parseInt(Math.floor(b/f)*(this.tileHeight+this.spacing)+this.margin,10);return a};return b}();c.TMXTilesetInfo=d;var a=function(){function b(){this._properties=[];this._objects=[]}b.prototype.getGroupName=function(){return this._groupName};
- b.prototype.setGroupName=function(b){this._groupName=b};b.prototype.getPositionOffsetX=function(){return this._positionOffsetX};b.prototype.setPositionOffsetX=function(b){this._positionOffsetX=b};b.prototype.getPositionOffsetY=function(){return this._positionOffsetY};b.prototype.setPositionOffsetY=function(b){this._positionOffsetY=b};b.prototype.getProperties=function(){return this._properties};b.prototype.setProperties=function(b){this._properties.push(b)};b.prototype.getObjects=function(){return this._objects};
- b.prototype.addObject=function(b){this._objects.push(b)};return b}();c.TMXObjectGroup=a;var b=function(){function b(){this._minGID=1E5;this._maxGID=0}b.prototype.getProperties=function(){return this._properties};b.prototype.setProperties=function(b){this._properties=b};return b}();c.TMXLayerInfo=b})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b){"undefined"===typeof b&&(b=null);d.call(this);this._source=b?b:[]}__extends(a,d);Object.defineProperty(a.prototype,"source",{get:function(){return this._source},set:function(b){b||(b=[]);this._source=b;this.dispatchCoEvent(c.CollectionEventKind.RESET)},enumerable:!0,configurable:!0});a.prototype.refresh=function(){this.dispatchCoEvent(c.CollectionEventKind.REFRESH)};a.prototype.contains=function(b){return-1!=this.getItemIndex(b)};a.prototype.checkIndex=
- function(b){if(0>b||b>=this._source.length)throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};Object.defineProperty(a.prototype,"length",{get:function(){return this._source.length},enumerable:!0,configurable:!0});a.prototype.addItem=function(b){this._source.push(b);this.dispatchCoEvent(c.CollectionEventKind.ADD,this._source.length-1,-1,[b])};a.prototype.addItemAt=function(b,a){if(0>a||a>this._source.length)throw new RangeError('\u7d22\u5f15:"'+
- a+'"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');this._source.splice(a,0,b);this.dispatchCoEvent(c.CollectionEventKind.ADD,a,-1,[b])};a.prototype.getItemAt=function(b){return this._source[b]};a.prototype.getItemIndex=function(b){for(var a=this._source.length,c=0;c<a;c++)if(this._source[c]===b)return c;return-1};a.prototype.itemUpdated=function(b){var a=this.getItemIndex(b);-1!=a&&this.dispatchCoEvent(c.CollectionEventKind.UPDATE,a,-1,[b])};a.prototype.removeAll=function(){var b=
- this._source.concat();this._source.length=0;this.dispatchCoEvent(c.CollectionEventKind.REMOVE,0,-1,b)};a.prototype.removeItemAt=function(b){this.checkIndex(b);var a=this._source.splice(b,1)[0];this.dispatchCoEvent(c.CollectionEventKind.REMOVE,b,-1,[a]);return a};a.prototype.replaceItemAt=function(b,a){this.checkIndex(a);var d=this._source.splice(a,1,b)[0];this.dispatchCoEvent(c.CollectionEventKind.REPLACE,a,-1,[b],[d]);return d};a.prototype.replaceAll=function(b){b||(b=[]);for(var a=b.length,c=this._source.length,
- d=a;d<c;d++)this.removeItemAt(a);for(d=0;d<a;d++)d>=c?this.addItemAt(b[d],d):this.replaceItemAt(b[d],d);this._source=b};a.prototype.moveItemAt=function(b,a){this.checkIndex(b);this.checkIndex(a);var d=this._source.splice(b,1)[0];this._source.splice(a,0,d);this.dispatchCoEvent(c.CollectionEventKind.MOVE,a,b,[d]);return d};a.prototype.dispatchCoEvent=function(b,d,e,h,g){"undefined"===typeof b&&(b=null);"undefined"===typeof d&&(d=-1);"undefined"===typeof e&&(e=-1);"undefined"===typeof h&&(h=null);"undefined"===
- typeof g&&(g=null);var k=a.coEventRecycler,l=k.pop();l||(l=new c.CollectionEvent(c.CollectionEvent.COLLECTION_CHANGE));l.kind=b;l.location=d;l.oldLocation=e;l.items=h;l.oldItems=g;this.dispatchEvent(l);k.push(l)};a.coEventRecycler=new c.Recycler;return a}(c.EventDispatcher);c.ArrayCollection=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a){"undefined"===typeof b&&(b="children");"undefined"===typeof a&&(a="parent");d.call(this);this.nodeList=[];this._openNodes=[];this._showRoot=!1;this.childrenKey=b;this.parentKey=a}__extends(a,d);Object.defineProperty(a.prototype,"source",{get:function(){return this._source},set:function(b){this._source=b;this._openNodes=[];this.nodeList=[];this._source&&(this._showRoot?this.nodeList.push(this._source):(this._openNodes=[this._source],this.addChildren(this._source,
- this.nodeList)));this.dispatchCoEvent(c.CollectionEventKind.RESET)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"openNodes",{get:function(){return this._openNodes.concat()},set:function(b){this._openNodes=b?b.concat():[];this.refresh()},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"length",{get:function(){return this.nodeList.length},enumerable:!0,configurable:!0});a.prototype.getItemAt=function(b){return this.nodeList[b]};a.prototype.getItemIndex=function(b){for(var a=
- this.nodeList.length,c=0;c<a;c++)if(this.nodeList[c]===b)return c;return-1};a.prototype.itemUpdated=function(b){var a=this.getItemIndex(b);-1!=a&&this.dispatchCoEvent(c.CollectionEventKind.UPDATE,a,-1,[b])};a.prototype.removeItem=function(b){this.isItemOpen(b)&&this.closeNode(b);if(b){var a=b[this.parentKey];if(a&&(a=a[this.childrenKey])){var d=a.indexOf(b);-1!=d&&a.splice(d,1);b[this.parentKey]=null;d=this.nodeList.indexOf(b);-1!=d&&(this.nodeList.splice(d,1),this.dispatchCoEvent(c.CollectionEventKind.REMOVE,
- d,-1,[b]))}}};Object.defineProperty(a.prototype,"showRoot",{get:function(){return this._showRoot},set:function(b){this._showRoot!=b&&(this._showRoot=b,this._source&&(this._showRoot?this.nodeList.splice(0,0,this._source):(this.nodeList.shift(),-1==this.openNodes.indexOf(this._source)&&this.openNodes.push(this._source)),this.refresh()))},enumerable:!0,configurable:!0});a.prototype.addChildren=function(b,a){if(b.hasOwnProperty(this.childrenKey)&&-1!=this._openNodes.indexOf(b))for(var c=b[this.childrenKey],
- d=c.length,e=0;e<d;e++){var k=c[e];a.push(k);this.addChildren(k,a)}};a.prototype.hasChildren=function(b){return b.hasOwnProperty(this.childrenKey)?0<b[this.childrenKey].length:!1};a.prototype.isItemOpen=function(b){return-1!=this._openNodes.indexOf(b)};a.prototype.expandItem=function(b,a){"undefined"===typeof a&&(a=!0);a?this.openNode(b):this.closeNode(b)};a.prototype.openNode=function(b){if(-1==this._openNodes.indexOf(b)){this._openNodes.push(b);var a=this.nodeList.indexOf(b);if(-1!=a){var d=[];
- this.addChildren(b,d);for(var e=a;d.length;){e++;var g=d.shift();this.nodeList.splice(e,0,g);this.dispatchCoEvent(c.CollectionEventKind.ADD,e,-1,[g])}this.dispatchCoEvent("open",a,a,[b])}}};a.prototype.closeNode=function(b){var a=this._openNodes.indexOf(b);if(-1!=a){var d=[];this.addChildren(b,d);this._openNodes.splice(a,1);a=this.nodeList.indexOf(b);if(-1!=a){for(a++;d.length;){var e=this.nodeList.splice(a,1)[0];this.dispatchCoEvent(c.CollectionEventKind.REMOVE,a,-1,[e]);d.shift()}a--;this.dispatchCoEvent(c.CollectionEventKind.CLOSE,
- a,a,[b])}}};a.prototype.getDepth=function(b){var a=0;for(b=b[this.parentKey];b;)a++,b=b[this.parentKey];0<a&&!this._showRoot&&a--;return a};a.prototype.refresh=function(){this.nodeList=[];this._source&&(this._showRoot&&this.nodeList.push(this._source),this.addChildren(this._source,this.nodeList));this.dispatchCoEvent(c.CollectionEventKind.REFRESH)};a.prototype.dispatchCoEvent=function(b,a,d,e,g){"undefined"===typeof b&&(b=null);"undefined"===typeof a&&(a=-1);"undefined"===typeof d&&(d=-1);"undefined"===
- typeof e&&(e=null);"undefined"===typeof g&&(g=null);b=new c.CollectionEvent(c.CollectionEvent.COLLECTION_CHANGE,!1,!1,b,a,d,e,g);this.dispatchEvent(b)};a.assignParent=function(b,c,d){"undefined"===typeof c&&(c="children");"undefined"===typeof d&&(d="parent");if(b.hasOwnProperty(c))for(var e=b[c],g=e.length,k=0;k<g;k++){var l=e[k];try{l[d]=b}catch(n){}a.assignParent(l,c,d)}};return a}(c.EventDispatcher);c.ObjectCollection=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.targetLevel=Number.MAX_VALUE;this.updateCompleteQueue=new c.DepthQueue;this.invalidateClientPropertiesFlag=this.invalidatePropertiesFlag=!1;this.invalidatePropertiesQueue=new c.DepthQueue;this.invalidateClientSizeFlag=this.invalidateSizeFlag=!1;this.invalidateSizeQueue=new c.DepthQueue;this.invalidateDisplayListFlag=!1;this.invalidateDisplayListQueue=new c.DepthQueue;this.listenersAttached=!1}__extends(a,d);a.prototype.invalidateProperties=
- function(b){this.invalidatePropertiesFlag||(this.invalidatePropertiesFlag=!0,this.listenersAttached||this.attachListeners());this.targetLevel<=b.nestLevel&&(this.invalidateClientPropertiesFlag=!0);this.invalidatePropertiesQueue.insert(b)};a.prototype.validateProperties=function(){for(var b=this.invalidatePropertiesQueue.shift();b;)b.parent&&(b.validateProperties(),b.updateCompletePendingFlag||(this.updateCompleteQueue.insert(b),b.updateCompletePendingFlag=!0)),b=this.invalidatePropertiesQueue.shift();
- this.invalidatePropertiesQueue.isEmpty()&&(this.invalidatePropertiesFlag=!1)};a.prototype.invalidateSize=function(b){this.invalidateSizeFlag||(this.invalidateSizeFlag=!0,this.listenersAttached||this.attachListeners());this.targetLevel<=b.nestLevel&&(this.invalidateClientSizeFlag=!0);this.invalidateSizeQueue.insert(b)};a.prototype.validateSize=function(){for(var b=this.invalidateSizeQueue.pop();b;)b.parent&&(b.validateSize(),b.updateCompletePendingFlag||(this.updateCompleteQueue.insert(b),b.updateCompletePendingFlag=
- !0)),b=this.invalidateSizeQueue.pop();this.invalidateSizeQueue.isEmpty()&&(this.invalidateSizeFlag=!1)};a.prototype.invalidateDisplayList=function(b){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.listenersAttached||this.attachListeners());this.invalidateDisplayListQueue.insert(b)};a.prototype.validateDisplayList=function(){for(var b=this.invalidateDisplayListQueue.shift();b;)b.parent&&(b.validateDisplayList(),b.updateCompletePendingFlag||(this.updateCompleteQueue.insert(b),
- b.updateCompletePendingFlag=!0)),b=this.invalidateDisplayListQueue.shift();this.invalidateDisplayListQueue.isEmpty()&&(this.invalidateDisplayListFlag=!1)};a.prototype.attachListeners=function(){c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this);c.UIGlobals.stage.addEventListener(c.Event.RENDER,this.doPhasedInstantiationCallBack,this);c.UIGlobals.stage.invalidate();this.listenersAttached=!0};a.prototype.doPhasedInstantiationCallBack=function(b){c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
- this.doPhasedInstantiationCallBack,this);c.UIGlobals.stage.removeEventListener(c.Event.RENDER,this.doPhasedInstantiationCallBack,this);this.doPhasedInstantiation()};a.prototype.doPhasedInstantiation=function(){this.invalidatePropertiesFlag&&this.validateProperties();this.invalidateSizeFlag&&this.validateSize();this.invalidateDisplayListFlag&&this.validateDisplayList();if(this.invalidatePropertiesFlag||this.invalidateSizeFlag||this.invalidateDisplayListFlag)this.attachListeners();else{this.listenersAttached=
- !1;for(var b=this.updateCompleteQueue.pop();b;)b.initialized||(b.initialized=!0),b.hasEventListener(c.UIEvent.UPDATE_COMPLETE)&&b.dispatchEvent(new c.UIEvent(c.UIEvent.UPDATE_COMPLETE)),b.updateCompletePendingFlag=!1,b=this.updateCompleteQueue.pop();this.dispatchEvent(new c.UIEvent(c.UIEvent.UPDATE_COMPLETE))}};a.prototype.validateNow=function(){for(var b=0;this.listenersAttached&&100>b++;)this.doPhasedInstantiationCallBack()};a.prototype.validateClient=function(b,a){"undefined"===typeof a&&(a=!1);
- var d,e=!1,g=this.targetLevel;this.targetLevel==Number.MAX_VALUE&&(this.targetLevel=b.nestLevel);for(;!e;){e=!0;for(d=this.invalidatePropertiesQueue.removeSmallestChild(b);d;)d.parent&&(d.validateProperties(),d.updateCompletePendingFlag||(this.updateCompleteQueue.insert(d),d.updateCompletePendingFlag=!0)),d=this.invalidatePropertiesQueue.removeSmallestChild(b);this.invalidatePropertiesQueue.isEmpty()&&(this.invalidatePropertiesFlag=!1);this.invalidateClientPropertiesFlag=!1;for(d=this.invalidateSizeQueue.removeLargestChild(b);d;){d.parent&&
- (d.validateSize(),d.updateCompletePendingFlag||(this.updateCompleteQueue.insert(d),d.updateCompletePendingFlag=!0));if(this.invalidateClientPropertiesFlag&&(d=this.invalidatePropertiesQueue.removeSmallestChild(b))){this.invalidatePropertiesQueue.insert(d);e=!1;break}d=this.invalidateSizeQueue.removeLargestChild(b)}this.invalidateSizeQueue.isEmpty()&&(this.invalidateSizeFlag=!1);this.invalidateClientSizeFlag=this.invalidateClientPropertiesFlag=!1;if(!a){for(d=this.invalidateDisplayListQueue.removeSmallestChild(b);d;){d.parent&&
- (d.validateDisplayList(),d.updateCompletePendingFlag||(this.updateCompleteQueue.insert(d),d.updateCompletePendingFlag=!0));if(this.invalidateClientPropertiesFlag&&(d=this.invalidatePropertiesQueue.removeSmallestChild(b))){this.invalidatePropertiesQueue.insert(d);e=!1;break}if(this.invalidateClientSizeFlag&&(d=this.invalidateSizeQueue.removeLargestChild(b))){this.invalidateSizeQueue.insert(d);e=!1;break}d=this.invalidateDisplayListQueue.removeSmallestChild(b)}this.invalidateDisplayListQueue.isEmpty()&&
- (this.invalidateDisplayListFlag=!1)}}if(g==Number.MAX_VALUE&&(this.targetLevel=Number.MAX_VALUE,!a))for(d=this.updateCompleteQueue.removeLargestChild(b);d;)d.initialized||(d.initialized=!0),d.hasEventListener(c.UIEvent.UPDATE_COMPLETE)&&d.dispatchEvent(new c.UIEvent(c.UIEvent.UPDATE_COMPLETE)),d.updateCompletePendingFlag=!1,d=this.updateCompleteQueue.removeLargestChild(b)};return a}(c.EventDispatcher);c.LayoutManager=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function a(){this.depthBins=[];this.minDepth=0;this.maxDepth=-1}a.prototype.insert=function(b){var a=b.nestLevel,c=b.hashCode;this.maxDepth<this.minDepth?this.minDepth=this.maxDepth=a:(a<this.minDepth&&(this.minDepth=a),a>this.maxDepth&&(this.maxDepth=a));var e=this.depthBins[a];e?null==e.items[c]&&(e.items[c]=b,e.length++):(e=new d,this.depthBins[a]=e,e.items[c]=b,e.length++)};a.prototype.pop=function(){var b=null;if(this.minDepth<=this.maxDepth){for(var a=this.depthBins[this.maxDepth];!a||
- 0==a.length;){this.maxDepth--;if(this.maxDepth<this.minDepth)return null;a=this.depthBins[this.maxDepth]}var c=a.items,d;for(d in c){b=c[d];this.remove(b,this.maxDepth);break}for(;!a||0==a.length;){this.maxDepth--;if(this.maxDepth<this.minDepth)break;a=this.depthBins[this.maxDepth]}}return b};a.prototype.shift=function(){var b=null;if(this.minDepth<=this.maxDepth){for(var a=this.depthBins[this.minDepth];!a||0==a.length;){this.minDepth++;if(this.minDepth>this.maxDepth)return null;a=this.depthBins[this.minDepth]}var c=
- a.items,d;for(d in c){b=c[d];this.remove(b,this.minDepth);break}for(;!a||0==a.length;){this.minDepth++;if(this.minDepth>this.maxDepth)break;a=this.depthBins[this.minDepth]}}return b};a.prototype.removeLargestChild=function(b){for(var a=this.maxDepth,d=b.nestLevel,e=b.hashCode;d<=a;){var g=this.depthBins[a];if(g&&0<g.length){if(a==b.nestLevel){if(g.items[e])return this.remove(b,a),b}else{var g=g.items,k;for(k in g){var l=g[k];if(l instanceof c.DisplayObject&&b instanceof c.DisplayObjectContainer&&
- b.contains(l))return this.remove(l,a),l}}a--}else if(a==this.maxDepth&&this.maxDepth--,a--,a<d)break}return null};a.prototype.removeSmallestChild=function(b){for(var a=b.nestLevel,d=b.hashCode;a<=this.maxDepth;){var e=this.depthBins[a];if(e&&0<e.length){if(a==b.nestLevel){if(e.items[d])return this.remove(b,a),b}else{var e=e.items,g;for(g in e){var k=e[g];if(k instanceof c.DisplayObject&&b instanceof c.DisplayObjectContainer&&b.contains(k))return this.remove(k,a),k}}a++}else if(a==this.minDepth&&this.minDepth++,
- a++,a>this.maxDepth)break}return null};a.prototype.remove=function(b,a){"undefined"===typeof a&&(a=-1);var c=b.hashCode,d=this.depthBins[0<=a?a:b.nestLevel];return d&&null!=d.items[c]?(delete d.items[c],d.length--,b):null};a.prototype.removeAll=function(){this.minDepth=this.depthBins.length=0;this.maxDepth=-1};a.prototype.isEmpty=function(){return this.minDepth>this.maxDepth};return a}();c.DepthQueue=e;var d=function(){return function(){this.length=0;this.items=[]}}();c.DepthBin=d})(ns_egret||(ns_egret=
- {}));(function(c){var e=function(){function d(){}Object.defineProperty(d,"stage",{get:function(){return d._stage},enumerable:!0,configurable:!0});d.initlize=function(a){d.initlized||(d._stage=a,d.layoutManager=new c.LayoutManager,d.initlized=!0)};Object.defineProperty(d,"systemManager",{get:function(){return this._systemManager},enumerable:!0,configurable:!0});d.useUpdateAfterEvent=!0;d.initlized=!1;return d}();c.UIGlobals=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.initializeCalled=this._initialized=this._updateCompletePendingFlag=!1;this._nestLevel=0;this._enabled=!0;this._minWidth=0;this._maxWidth=1E4;this._minHeight=0;this._maxHeight=1E4;this._measuredHeight=this._measuredWidth=0;this.validateNowFlag=this.invalidateDisplayListFlag=this.invalidateSizeFlag=this.invalidatePropertiesFlag=!1;this._includeInLayout=!0;this.layoutHeightExplicitlySet=this.layoutWidthExplicitlySet=!1;this.touchEnabled=!0;
- this.addEventListener(c.Event.ADDED_TO_STAGE,this.onAddedToStage,this);this.addEventListener(c.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,this)}__extends(a,d);a.prototype.onAddedToStage=function(b){this.removeEventListener(c.Event.ADDED_TO_STAGE,this.onAddedToStage,this);this.initialize();c.UIGlobals.initlize(this.stage);0<this._nestLevel&&this.checkInvalidateFlag()};Object.defineProperty(a.prototype,"id",{get:function(){return this._id},set:function(b){this._id=b},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"isPopUp",{get:function(){return this._isPopUp},set:function(b){this._isPopUp=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"owner",{get:function(){return this._owner?this._owner:this.parent},enumerable:!0,configurable:!0});a.prototype.ownerChanged=function(b){this._owner=b};Object.defineProperty(a.prototype,"updateCompletePendingFlag",{get:function(){return this._updateCompletePendingFlag},set:function(b){this._updateCompletePendingFlag=b},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"initialized",{get:function(){return this._initialized},set:function(b){this._initialized!=b&&(this._initialized=b)&&this.dispatchEvent(new c.UIEvent(c.UIEvent.CREATION_COMPLETE))},enumerable:!0,configurable:!0});a.prototype.initialize=function(){this.initializeCalled||(c.UIGlobals.stage&&this.removeEventListener(c.Event.ADDED_TO_STAGE,this.onAddedToStage,this),this.initializeCalled=!0,this.dispatchEvent(new c.UIEvent(c.UIEvent.INITIALIZE)),
- this.createChildren(),this.childrenCreated())};a.prototype.createChildren=function(){};a.prototype.childrenCreated=function(){this.invalidateProperties();this.invalidateSize();this.invalidateDisplayList()};Object.defineProperty(a.prototype,"nestLevel",{get:function(){return this._nestLevel},set:function(b){if(this._nestLevel!=b){this._nestLevel=b;0==this._nestLevel?this.addEventListener(c.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,this):this.removeEventListener(c.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,
- this);for(b=this.numChildren-1;0<=b;b--){var a=this.getChildAt(b);null!=a&&(a.nestLevel=this._nestLevel+1)}}},enumerable:!0,configurable:!0});a.prototype.addChild=function(b){this.addingChild(b);d.prototype.addChild.call(this,b);this._childAdded(b);return b};a.prototype.addChildAt=function(b,a){this.addingChild(b);d.prototype.addChildAt.call(this,b,a);this._childAdded(b);return b};a.prototype.addingChild=function(b){b&&"nestLevel"in b&&(b.nestLevel=this._nestLevel+1)};a.prototype._childAdded=function(b){b instanceof
- a&&(b.initialize(),b.checkInvalidateFlag())};a.prototype.removeChild=function(b){d.prototype.removeChild.call(this,b);this._childRemoved(b);return b};a.prototype.removeChildAt=function(b){b=d.prototype.removeChildAt.call(this,b);this._childRemoved(b);return b};a.prototype._childRemoved=function(b){b&&"nestLevel"in b&&(b.nestLevel=0)};a.prototype.checkInvalidateFlag=function(b){c.UIGlobals.layoutManager&&(this.invalidatePropertiesFlag&&c.UIGlobals.layoutManager.invalidateProperties(this),this.invalidateSizeFlag&&
- c.UIGlobals.layoutManager.invalidateSize(this),this.invalidateDisplayListFlag&&c.UIGlobals.layoutManager.invalidateDisplayList(this),this.validateNowFlag&&(c.UIGlobals.layoutManager.validateClient(this),this.validateNowFlag=!1))};Object.defineProperty(a.prototype,"enabled",{get:function(){return this._enabled},set:function(b){this._enabled=b},enumerable:!0,configurable:!0});a.prototype._setWidth=function(b){this._width==b&&this._explicitWidth==b||(this._explicitWidth=this._width=b,this.invalidateProperties(),
- this.invalidateDisplayList(),this.invalidateParentSizeAndDisplayList(),isNaN(b)&&this.invalidateSize())};Object.defineProperty(a.prototype,"width",{get:function(){return this.escapeNaN(this._width)},set:function(b){this._setWidth(b)},enumerable:!0,configurable:!0});a.prototype._setHeight=function(b){this._height==b&&this._explicitHeight==b||(this._explicitHeight=this._height=b,this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentSizeAndDisplayList(),isNaN(b)&&this.invalidateSize())};
- Object.defineProperty(a.prototype,"height",{get:function(){return this.escapeNaN(this._height)},set:function(b){this._setHeight(b)},enumerable:!0,configurable:!0});a.prototype.escapeNaN=function(b){return isNaN(b)?0:b};Object.defineProperty(a.prototype,"scaleX",{get:function(){return this._scaleX},set:function(b){this._setScaleX(b)},enumerable:!0,configurable:!0});a.prototype._setScaleX=function(b){this._scaleX!=b&&(this._scaleX=b,this.invalidateParentSizeAndDisplayList())};Object.defineProperty(a.prototype,
- "scaleY",{get:function(){return this._scaleY},set:function(b){this._setScaleY(b)},enumerable:!0,configurable:!0});a.prototype._setScaleY=function(b){this._scaleY!=b&&(this._scaleY=b,this.invalidateParentSizeAndDisplayList())};Object.defineProperty(a.prototype,"minWidth",{get:function(){return this._minWidth},set:function(b){this._minWidth!=b&&(this._minWidth=b,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxWidth",{get:function(){return this._maxWidth},
- set:function(b){this._maxWidth!=b&&(this._maxWidth=b,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"minHeight",{get:function(){return this._minHeight},set:function(b){this._minHeight!=b&&(this._minHeight=b,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxHeight",{get:function(){return this._maxHeight},set:function(b){this._maxHeight!=b&&(this._maxHeight=b,this.invalidateSize())},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"measuredWidth",{get:function(){return this._measuredWidth},set:function(b){this._measuredWidth=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuredHeight",{get:function(){return this._measuredHeight},set:function(b){this._measuredHeight=b},enumerable:!0,configurable:!0});a.prototype.setActualSize=function(b,a){var c=!1;this._width!=b&&(this._width=b,c=!0);this._height!=a&&(this._height=a,c=!0);c&&(this.invalidateDisplayList(),this.dispatchResizeEvent())};
- Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(b){this._x!=b&&(this._x=b,this.invalidateProperties(),this._includeInLayout&&(this.parent&&this.parent instanceof a)&&this.parent.childXYChanged())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"y",{get:function(){return this._y},set:function(b){this._y!=b&&(this._y=b,this.invalidateProperties(),this._includeInLayout&&(this.parent&&this.parent instanceof a)&&this.parent.childXYChanged())},enumerable:!0,
- configurable:!0});a.prototype.invalidateProperties=function(){this.invalidatePropertiesFlag||(this.invalidatePropertiesFlag=!0,this.parent&&c.UIGlobals.layoutManager&&c.UIGlobals.layoutManager.invalidateProperties(this))};a.prototype.validateProperties=function(){this.invalidatePropertiesFlag&&(this.commitProperties(),this.invalidatePropertiesFlag=!1)};a.prototype.invalidateSize=function(){this.invalidateSizeFlag||(this.invalidateSizeFlag=!0,this.parent&&c.UIGlobals.layoutManager&&c.UIGlobals.layoutManager.invalidateSize(this))};
- a.prototype.validateSize=function(b){"undefined"===typeof b&&(b=!1);if(b)for(b=0;b<this.numChildren;b++){var a=this.getChildAt(b);"validateSize"in a&&a.validateSize(!0)}this.invalidateSizeFlag&&(this.measureSizes()&&(this.invalidateDisplayList(),this.invalidateParentSizeAndDisplayList()),this.invalidateSizeFlag=!1)};a.prototype.measureSizes=function(){var b=!1;if(!this.invalidateSizeFlag)return b;this.canSkipMeasurement()||(this.measure(),this.measuredWidth<this.minWidth&&(this.measuredWidth=this.minWidth),
- this.measuredWidth>this.maxWidth&&(this.measuredWidth=this.maxWidth),this.measuredHeight<this.minHeight&&(this.measuredHeight=this.minHeight),this.measuredHeight>this.maxHeight&&(this.measuredHeight=this.maxHeight));if(isNaN(this.oldPreferWidth))this.oldPreferWidth=this.preferredWidth,this.oldPreferHeight=this.preferredHeight,b=!0;else{if(this.preferredWidth!=this.oldPreferWidth||this.preferredHeight!=this.oldPreferHeight)b=!0;this.oldPreferWidth=this.preferredWidth;this.oldPreferHeight=this.preferredHeight}return b};
- a.prototype.invalidateDisplayList=function(){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.parent&&c.UIGlobals.layoutManager&&c.UIGlobals.layoutManager.invalidateDisplayList(this))};a.prototype.validateDisplayList=function(){if(this.invalidateDisplayListFlag){var b=0,a=0,b=this.layoutWidthExplicitlySet?this._width:isNaN(this.explicitWidth)?this.measuredWidth:this._explicitWidth,a=this.layoutHeightExplicitlySet?this._height:isNaN(this.explicitHeight)?this.measuredHeight:this._explicitHeight;
- isNaN(b)&&(b=0);isNaN(a)&&(a=0);this.setActualSize(b,a);this.updateDisplayList(b,a);this.invalidateDisplayListFlag=!1}};a.prototype.validateNow=function(b){"undefined"===typeof b&&(b=!1);!this.validateNowFlag&&null!=c.UIGlobals.layoutManager?c.UIGlobals.layoutManager.validateClient(this,b):this.validateNowFlag=!0};a.prototype.invalidateParentSizeAndDisplayList=function(){if(this.parent&&this._includeInLayout&&"invalidateSize"in this.parent){var b=this.parent;b.invalidateSize();b.invalidateDisplayList()}};
- a.prototype.updateDisplayList=function(b,a){};a.prototype.canSkipMeasurement=function(){return!isNaN(this._explicitWidth)&&!isNaN(this._explicitHeight)};a.prototype.commitProperties=function(){(this.oldWidth!=this._width||this.oldHeight!=this._height)&&this.dispatchResizeEvent();(this.oldX!=this.x||this.oldY!=this.y)&&this.dispatchMoveEvent()};a.prototype.measure=function(){this._measuredWidth=this._measuredHeight=0};a.prototype.dispatchMoveEvent=function(){if(this.hasEventListener(c.MoveEvent.MOVE)){var b=
- new c.MoveEvent(c.MoveEvent.MOVE,this.oldX,this.oldY);this.dispatchEvent(b)}this.oldX=this.x;this.oldY=this.y};a.prototype.childXYChanged=function(){};a.prototype.dispatchResizeEvent=function(){if(this.hasEventListener(c.ResizeEvent.RESIZE)){var b=new c.ResizeEvent(c.ResizeEvent.RESIZE,this.oldWidth,this.oldHeight);this.dispatchEvent(b)}this.oldWidth=this._width;this.oldHeight=this._height};a.prototype.dispatchPropertyChangeEvent=function(b,a,d){this.hasEventListener("propertyChange")&&this.dispatchEvent(c.PropertyChangeEvent.createUpdateEvent(this,
- b,a,d))};Object.defineProperty(a.prototype,"includeInLayout",{get:function(){return this._includeInLayout},set:function(b){this._includeInLayout!=b&&(this._includeInLayout=!0,this.invalidateParentSizeAndDisplayList(),this._includeInLayout=b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"left",{get:function(){return this._left},set:function(b){this._left!=b&&(this._left=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "right",{get:function(){return this._right},set:function(b){this._right!=b&&(this._right=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"top",{get:function(){return this._top},set:function(b){this._top!=b&&(this._top=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"bottom",{get:function(){return this._bottom},set:function(b){this._bottom!=b&&(this._bottom=b,this.invalidateParentSizeAndDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"horizontalCenter",{get:function(){return this._horizontalCenter},set:function(b){this._horizontalCenter!=b&&(this._horizontalCenter=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalCenter",{get:function(){return this._verticalCenter},set:function(b){this._verticalCenter!=b&&(this._verticalCenter=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"percentWidth",{get:function(){return this._percentWidth},set:function(b){this._percentWidth!=b&&(this._percentWidth=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"percentHeight",{get:function(){return this._percentHeight},set:function(b){this._percentHeight!=b&&(this._percentHeight=b,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});a.prototype.setLayoutBoundsSize=function(b,
- a){b/=this.scaleX;a/=this.scaleY;isNaN(b)?(this.layoutWidthExplicitlySet=!1,b=this.preferredWidth):this.layoutWidthExplicitlySet=!0;isNaN(a)?(this.layoutHeightExplicitlySet=!1,a=this.preferredHeight):this.layoutHeightExplicitlySet=!0;this.setActualSize(b,a)};a.prototype.setLayoutBoundsPosition=function(b,a){var c=!1;this._x!=b&&(this._x=b,c=!0);this._y!=a&&(this._y=a,c=!0);c&&this.dispatchMoveEvent()};Object.defineProperty(a.prototype,"preferredWidth",{get:function(){var b=isNaN(this._explicitWidth)?
- this.measuredWidth:this._explicitWidth;return isNaN(b)?0:b*this.scaleX},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"preferredHeight",{get:function(){var b=isNaN(this._explicitHeight)?this.measuredHeight:this._explicitHeight;return isNaN(b)?0:b*this.scaleY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"preferredX",{get:function(){return this._x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"preferredY",{get:function(){return this._y},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutBoundsX",{get:function(){return this._x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutBoundsY",{get:function(){return this._y},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutBoundsWidth",{get:function(){var b=0,b=this.layoutWidthExplicitlySet?this._width:isNaN(this.explicitWidth)?this.measuredWidth:this._explicitWidth;return this.escapeNaN(b*this.scaleX)},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"layoutBoundsHeight",{get:function(){var b=0,b=this.layoutHeightExplicitlySet?this._height:isNaN(this.explicitHeight)?this.measuredHeight:this._explicitHeight;return this.escapeNaN(b*this.scaleY)},enumerable:!0,configurable:!0});return a}(c.DisplayObjectContainer);c.UIComponent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.ABOVE="above";c.BELOW="below";c.CENTER="center";c.TOP_LEFT="topLeft";c.LEFT="left";c.RIGHT="right";return c}();c.PopUpPosition=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.HOME=36;c.END=35;c.UP=38;c.DOWN=40;c.LEFT=37;c.RIGHT=39;c.PAGE_UP=33;c.PAGE_DOWN=34;c.PAGE_LEFT=9111;c.PAGE_RIGHT=9112;return c}();c.NavigationUnit=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.AUTO="auto";c.OFF="off";c.ON="on";return c}();c.ScrollPolicy=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b){"undefined"===typeof b&&(b=null);c.call(this);this.generator=b}__extends(a,c);a.prototype.newInstance=function(){return new this.generator};return a}(c.HashObject);c.ClassFactory=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.initialize=function(b){};a.prototype.apply=function(b){};a.prototype.remove=function(b){};a.prototype.initializeFromObject=function(b){for(var a in b)this[a]=b[a];return this};return a}(c.HashObject);c.OverrideBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.propertyName="";this.position=a.LAST}__extends(a,d);a.prototype.initialize=function(b){if((b=b[this.target])&&!(b instanceof c.SkinnableComponent)&&"initialize"in b)try{b.initialize()}catch(a){}};a.prototype.apply=function(b){var c,d;try{d=b[this.relativeTo]}catch(e){}var g=b[this.target];b=this.propertyName?b[this.propertyName]:b;if(g&&b){switch(this.position){case a.FIRST:c=0;break;case a.LAST:c=-1;break;case a.BEFORE:c=b.getElementIndex(d);
- break;case a.AFTER:c=b.getElementIndex(d)+1}-1==c&&(c=b.numElements);b.addElementAt(g,c)}};a.prototype.remove=function(b){var a=null==this.propertyName||""==this.propertyName?b:b[this.propertyName];(b=b[this.target])&&a&&-1!=a.getElementIndex(b)&&a.removeElement(b)};a.FIRST="first";a.LAST="last";a.BEFORE="before";a.AFTER="after";return a}(c.OverrideBase);c.AddItems=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.apply=function(b){b=null==this.target||""==this.target?b:b[this.target];null!=b&&(this.oldValue=b[this.name],this.setPropertyValue(b,this.name,this.value,this.oldValue))};a.prototype.remove=function(b){b=null==this.target||""==this.target?b:b[this.target];null!=b&&(this.setPropertyValue(b,this.name,this.oldValue,this.oldValue),this.oldValue=null)};a.prototype.setPropertyValue=function(b,a,c,d){b[a]=void 0===c||null===
- c?c:"boolean"==typeof d?this.toBoolean(c):c};a.prototype.toBoolean=function(b){return"string"==typeof b?"true"==b.toLowerCase():!1!=b};return a}(c.OverrideBase);c.SetProperty=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b){"undefined"===typeof b&&(b=null);d.call(this);this.initialized=!1;this.overrides=[];this.stateGroups=[];for(var a in b)this[a]=b[a]}__extends(a,d);a.prototype.initialize=function(b){if(!this.initialized){this.initialized=!0;for(var a=0;a<this.overrides.length;a++)this.overrides[a].initialize(b)}};a.prototype.dispatchEnterState=function(){this.hasEventListener("enterState")&&this.dispatchEvent(new c.Event("enterState"))};a.prototype.dispatchExitState=function(){this.hasEventListener("exitState")&&
- this.dispatchEvent(new c.Event("exitState"))};return a}(c.EventDispatcher);c.State=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(a){this._states=[];this.initialized=!1;this.target=a}Object.defineProperty(d.prototype,"states",{get:function(){return this._states},set:function(a){this._states!=a&&(this._states=a,this._currentStateChanged=!0,this.requestedCurrentState=this._currentState,this.hasState(this.requestedCurrentState)||(this.requestedCurrentState=this.getDefaultState()))},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"currentStateChanged",{get:function(){return this._currentStateChanged},
- enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"currentState",{get:function(){return this._currentStateChanged?this.requestedCurrentState:this._currentState?this._currentState:this.getDefaultState()},set:function(a){a||(a=this.getDefaultState());a!=this.currentState&&(a&&this.currentState)&&(this.requestedCurrentState=a,this._currentStateChanged=!0)},enumerable:!0,configurable:!0});d.prototype.hasState=function(a){return!this._states?!1:"string"==typeof this._states[0]?-1!=this._states.indexOf(a):
- null!=this.getState(a)};d.prototype.getDefaultState=function(){if(this._states&&0<this._states.length){var a=this._states[0];return"string"==typeof a?a:a.name}return null};d.prototype.commitCurrentState=function(){if(this.currentStateChanged)if(this._currentStateChanged=!1,"string"==typeof(this.states&&this.states[0]))-1==this.states.indexOf(this.requestedCurrentState)?this._currentState=this.getDefaultState():this._currentState=this.requestedCurrentState;else{this.getState(this.requestedCurrentState)||
- (this.requestedCurrentState=this.getDefaultState());var a=this.findCommonBaseState(this._currentState,this.requestedCurrentState),b,d=this._currentState?this._currentState:"";this.target.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGING)&&(b=new c.StateChangeEvent(c.StateChangeEvent.CURRENT_STATE_CHANGING),b.oldState=d,b.newState=this.requestedCurrentState?this.requestedCurrentState:"",this.target.dispatchEvent(b));this.removeState(this._currentState,a);(this._currentState=this.requestedCurrentState)&&
- this.applyState(this._currentState,a);this.target.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGE)&&(b=new c.StateChangeEvent(c.StateChangeEvent.CURRENT_STATE_CHANGE),b.oldState=d,b.newState=this._currentState?this._currentState:"",this.target.dispatchEvent(b))}};d.prototype.getState=function(a){if(!this._states||!a)return null;for(var b=0;b<this._states.length;b++)if(this._states[b].name==a)return this._states[b];return null};d.prototype.findCommonBaseState=function(a,b){var c=this.getState(a),
- d=this.getState(b);if(!c||!d||!c.basedOn&&!d.basedOn)return"";for(var e=this.getBaseStates(c),g=this.getBaseStates(d),k="";e[e.length-1]==g[g.length-1]&&!(k=e.pop(),g.pop(),!e.length||!g.length););e.length&&e[e.length-1]==d.name?k=d.name:g.length&&g[g.length-1]==c.name&&(k=c.name);return k};d.prototype.getBaseStates=function(a){for(var b=[];a&&a.basedOn;)b.push(a.basedOn),a=this.getState(a.basedOn);return b};d.prototype.removeState=function(a,b){var c=this.getState(a);if(a!=b&&c){c.dispatchExitState();
- for(var d=c.overrides,e=d.length;e;e--)d[e-1].remove(this.target);c.basedOn!=b&&this.removeState(c.basedOn,b)}};d.prototype.applyState=function(a,b){var c=this.getState(a);if(a!=b&&c){c.basedOn!=b&&this.applyState(c.basedOn,b);for(var d=c.overrides,e=0;e<d.length;e++)d[e].apply(this.target);c.dispatchEnterState()}};d.prototype.initializeStates=function(){if(!this.initialized&&(this.initialized=!0,"string"!=typeof this._states[0]))for(var a=0;a<this._states.length;a++){var b=this._states[a];if(!b)break;
- b.initialize(this.target)}};return d}();c.StateClientHelper=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._maintainAspectRatio=this.skinReused=this.createChildrenCalled=this.skinNameExplicitlySet=this.skinNameChanged=!1;this.aspectRatio=NaN;this.touchChildren=!1}__extends(a,d);Object.defineProperty(a.prototype,"skinName",{get:function(){return this._skinName},set:function(b){this._skinName!=b&&(this._skinName=b,this.skinNameExplicitlySet=!0,this.createChildrenCalled?this.parseSkinName():this.skinNameChanged=!0)},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"skin",{get:function(){return this._skin},enumerable:!0,configurable:!0});a.prototype.onGetSkin=function(b,a){this._skin!==b&&(this._skin&&this._skin.parent==this&&d.prototype.removeChild.call(this,this._skin),(this._skin=b)&&d.prototype.addChildAt.call(this,this._skin,0));this.aspectRatio=NaN;this.invalidateSize();this.invalidateDisplayList();this.stage&&this.validateNow()};a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this.skinNameChanged&&
- this.parseSkinName();this.createChildrenCalled=!0};a.prototype.parseSkinName=function(){this.skinNameChanged=!1;var b=a.skinAdapter;if(!b)try{b=a.skinAdapter=c.Injector.getInstance("ISkinAdapter")}catch(d){a.defaultSkinAdapter||(a.defaultSkinAdapter=new c.DefaultSkinAdapter),b=a.defaultSkinAdapter}if(this._skinName){var e=this.skinReused?null:this._skin;this.skinReused=!0;b.getSkin(this._skinName,this.skinChnaged,this,e)}else this.skinChnaged(null,this._skinName)};a.prototype.skinChnaged=function(b,
- a){if(a===this._skinName&&(this.onGetSkin(b,a),this.skinReused=!1,this.hasEventListener(c.UIEvent.SKIN_CHANGED))){var d=new c.UIEvent(c.UIEvent.SKIN_CHANGED);this.dispatchEvent(d)}};a.prototype.measure=function(){d.prototype.measure.call(this);if(this._skin&&(!this._skin||!("includeInLayout"in this._skin)||this._skin.includeInLayout)){var b=this.getMeasuredSize();this.measuredWidth=b.width;this.measuredHeight=b.height}};a.prototype.getMeasuredSize=function(){var b=new c.Rectangle;if(this._skin&&"preferredWidth"in
- this._skin)b.width=this._skin.preferredWidth,b.height=this._skin.preferredHeight;else{var a=this._skin.scaleX,d=this._skin.scaleY;this._skin.scaleX=1;this._skin.scaleY=1;b.width=this._skin.width;b.height=this._skin.height;this._skin.scaleX=a;this._skin.scaleY=d}return b};Object.defineProperty(a.prototype,"maintainAspectRatio",{get:function(){return this._maintainAspectRatio},set:function(b){this._maintainAspectRatio!=b&&(this._maintainAspectRatio=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});
- a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);if(this._skin){if(this._maintainAspectRatio){var c=0,e=0;if(isNaN(this.aspectRatio)){var g=this.getMeasuredSize();this.aspectRatio=0==g.width||0==g.height?0:g.width/g.height}0<this.aspectRatio&&(0<a&&0<b)&&(b/a>this.aspectRatio?(g=a*this.aspectRatio,c=Math.round(0.5*(b-g)),b=g):(g=b/this.aspectRatio,e=Math.round(0.5*(a-g)),a=g),"setLayoutBoundsPosition"in this._skin?this._skin.includeInLayout&&this._skin.setLayoutBoundsPosition(c,
- e):(this._skin.x=c,this._skin.y=e))}"setLayoutBoundsSize"in this._skin?this._skin.includeInLayout&&this._skin.setLayoutBoundsSize(b,a):(this._skin.scaleX=b/this._skin.width,this._skin.scaleY=a/this._skin.height,"validateNow"in this._skin&&this._skin.validateNow())}};a.prototype._addToDisplayList=function(b){return d.prototype.addChild.call(this,b)};a.prototype._addToDisplayListAt=function(b,a){return d.prototype.addChildAt.call(this,b,a)};a.prototype._removeFromDisplayList=function(b){return d.prototype.removeChild.call(this,
- b)};a.prototype.addChild=function(b){throw Error("addChild()"+a.errorStr+"addElement()\u4ee3\u66ff");};a.prototype.addChildAt=function(b,c){throw Error("addChildAt()"+a.errorStr+"addElementAt()\u4ee3\u66ff");};a.prototype.removeChild=function(b){throw Error("removeChild()"+a.errorStr+"removeElement()\u4ee3\u66ff");};a.prototype.removeChildAt=function(b){throw Error("removeChildAt()"+a.errorStr+"removeElementAt()\u4ee3\u66ff");};a.prototype.setChildIndex=function(b,c){throw Error("setChildIndex()"+
- a.errorStr+"setElementIndex()\u4ee3\u66ff");};a.prototype.swapChildren=function(b,c){throw Error("swapChildren()"+a.errorStr+"swapElements()\u4ee3\u66ff");};a.prototype.swapChildrenAt=function(b,c){throw Error("swapChildrenAt()"+a.errorStr+"swapElementsAt()\u4ee3\u66ff");};a.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return a}(c.UIComponent);c.UIAsset=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.stateIsDirty=this.hasCreatedSkinParts=!1;this.touchChildren=this.explicitMouseEnabled=this.explicitMouseChildren=this._autoMouseEnabled=!0}__extends(a,d);a.prototype.createChildren=function(){if(null==this.skinName)this.onGetSkin(null,null);d.prototype.createChildren.call(this)};Object.defineProperty(a.prototype,"skinObject",{get:function(){return this._skinObject},enumerable:!0,configurable:!0});a.prototype.onGetSkin=function(b,a){this.detachSkin(this._skinObject);
- this._skin&&this._skin.parent==this&&this._removeFromDisplayList(this._skin);b instanceof c.DisplayObject?(this._skin=b,this._addToDisplayListAt(this._skin,0)):this._skin=null;this._skinObject=b;this.attachSkin(this._skinObject);this.aspectRatio=NaN;this.invalidateSkinState();this.invalidateSize();this.invalidateDisplayList()};a.prototype.attachSkin=function(b){b&&"hostComponent"in b?(b.hostComponent=this,this.findSkinParts()):this.hasCreatedSkinParts||(this.createSkinParts(),this.hasCreatedSkinParts=
- !0);this.skinLayoutEnabled=b&&"hostComponent"in b&&b instanceof c.DisplayObject?!1:!0};a.prototype.findSkinParts=function(){var b=this._skinObject;if(b&&"skinParts"in b)for(var a=b.skinParts,c=a.length,d=0;d<c;d++){var e=a[d];if(e in b)try{this[e]=b[e],this.partAdded(e,b[e])}catch(k){}}};a.prototype.createSkinParts=function(){};a.prototype.removeSkinParts=function(){};a.prototype.detachSkin=function(b){this.hasCreatedSkinParts&&(this.removeSkinParts(),this.hasCreatedSkinParts=!1);if(b&&"skinParts"in
- b.prototype){for(var a=b.prototype.skinParts,c=a.length,d=0;d<c;d++){var e=a[d];e in this&&(null!=this[e]&&this.partRemoved(e,this[e]),this[e]=null)}b.hostComponent=null}};a.prototype.partAdded=function(b,a){var d=new c.SkinPartEvent(c.SkinPartEvent.PART_ADDED);d.partName=b;d.instance=a;this.dispatchEvent(d)};a.prototype.partRemoved=function(b,a){var d=new c.SkinPartEvent(c.SkinPartEvent.PART_REMOVED);d.partName=b;d.instance=a;this.dispatchEvent(d)};a.prototype.invalidateSkinState=function(){this.stateIsDirty||
- (this.stateIsDirty=!0,this.invalidateProperties())};a.prototype.validateSkinState=function(){var b=this.getCurrentSkinState(),a=this._skinObject;a&&"hasState"in a&&(a.currentState=b,a.hasState(b));this.hasEventListener("stateChanged")&&this.dispatchEvent(new c.Event("stateChanged"))};Object.defineProperty(a.prototype,"autoTouchEnabled",{get:function(){return this._autoMouseEnabled},set:function(b){this._autoMouseEnabled!=b&&((this._autoMouseEnabled=b)?(this._touchChildren=this.enabled?this.explicitMouseChildren:
- !1,this._touchEnabled=this.enabled?this.explicitMouseEnabled:!1):(this._touchChildren=this.explicitMouseChildren,this._touchEnabled=this.explicitMouseEnabled))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(b){this.enabled&&(this._touchChildren=b);this.explicitMouseChildren=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(b){this.enabled&&
- (this._touchEnabled=b);this.explicitMouseEnabled=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"enabled",{get:function(){return this._enabled},set:function(b){this._setEnabled(b)},enumerable:!0,configurable:!0});a.prototype._setEnabled=function(b){this._enabled!=b&&(this._enabled=b,this._autoMouseEnabled&&(this._touchChildren=b?this.explicitMouseChildren:!1,this._touchEnabled=b?this.explicitMouseEnabled:!1),this.invalidateSkinState())};a.prototype.getCurrentSkinState=function(){return this.enabled?
- "normal":"disabled"};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.stateIsDirty&&(this.stateIsDirty=!1,this.validateSkinState())};Object.defineProperty(a.prototype,"skinLayoutEnabled",{set:function(b){null!=this.skinLayout!=b&&(b?(this.skinLayout=new c.SkinBasicLayout,this.skinLayout.target=this):this.skinLayout=this.skinLayout.target=null,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.childXYChanged=function(){this.skinLayout&&
- (this.invalidateSize(),this.invalidateDisplayList())};a.prototype.measure=function(){d.prototype.measure.call(this);this.skinLayout&&this.skinLayout.measure();var b=this._skinObject;if(!this._skin&&b){var a=this.measuredWidth,c=this.measuredHeight;try{isNaN(b.width)||(a=Math.ceil(b.width)),isNaN(b.height)||(c=Math.ceil(b.height)),b.hasOwnProperty("minWidth")&&a<b.minWidth&&(a=b.minWidth),b.hasOwnProperty("maxWidth")&&a>b.maxWidth&&(a=b.maxWidth),b.hasOwnProperty("minHeight")&&c<b.minHeight&&(c=b.minHeight),
- b.hasOwnProperty("maxHeight")&&c>b.maxHeight&&(c=b.maxHeight),this.measuredWidth=a,this.measuredHeight=c}catch(e){}}};a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.skinLayout&&this.skinLayout.updateDisplayList(b,a)};return a}(c.UIAsset);c.SkinnableComponent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}d.prototype.getSkin=function(a,b,d,e){a instanceof c.DisplayObject?b.call(d,a,a):b.call(d,new a,a)};return d}();c.DefaultSkinAdapter=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);Object.defineProperty(a.prototype,"target",{get:function(){return this._target},set:function(b){this._target=b},enumerable:!0,configurable:!0});a.prototype.measure=function(){if(null!=this.target){for(var b=0,a=0,c=this._target.skin,d=this.target.numChildren,e=0;e<d;e++){var k=this.target.getChildAt(e);if(k&&k!=c&&k.includeInLayout){var l=k.horizontalCenter,n=k.verticalCenter,p=k.left,q=k.right,v=k.top,F=k.bottom;!isNaN(p)&&!isNaN(q)?
- l=p+q:isNaN(l)?!isNaN(p)||!isNaN(q)?(l=isNaN(p)?0:p,l+=isNaN(q)?0:q):l=k.preferredX:l=2*Math.abs(l);!isNaN(v)&&!isNaN(F)?n=v+F:isNaN(n)?!isNaN(v)||!isNaN(F)?(n=isNaN(v)?0:v,n+=isNaN(F)?0:F):n=k.preferredY:n=2*Math.abs(n);F=k.preferredHeight;b=Math.ceil(Math.max(b,l+k.preferredWidth));a=Math.ceil(Math.max(a,n+F))}}this.target.measuredWidth=Math.max(b,this.target.measuredWidth);this.target.measuredHeight=Math.max(a,this.target.measuredHeight)}};a.prototype.updateDisplayList=function(b,a){if(null!=this.target)for(var c=
- this.target.numChildren,d=this._target.skin,e=0;e<c;e++){var k=this.target.getChildAt(e);if(!(null==k||k==d||!k.includeInLayout)){var l=k.horizontalCenter,n=k.verticalCenter,p=k.left,q=k.right,v=k.top,F=k.bottom,r=k.percentWidth,D=k.percentHeight,x=NaN,C=NaN;!isNaN(p)&&!isNaN(q)?x=b-q-p:isNaN(r)||(x=Math.round(b*Math.min(0.01*r,1)));!isNaN(v)&&!isNaN(F)?C=a-F-v:isNaN(D)||(C=Math.round(a*Math.min(0.01*D,1)));k.setLayoutBoundsSize(x,C);r=k.layoutBoundsWidth;D=k.layoutBoundsHeight;C=x=NaN;x=isNaN(l)?
- isNaN(p)?isNaN(q)?k.layoutBoundsX:b-r-q:p:Math.round((b-r)/2+l);C=isNaN(n)?isNaN(v)?isNaN(F)?k.layoutBoundsY:a-D-F:v:Math.round((a-D)/2+n);k.setLayoutBoundsPosition(x,C)}}};return a}(c.HashObject);c.SkinBasicLayout=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._autoRepeat=this._downEventFired=!1;this._repeatInterval=this._repeatDelay=35;this._keepDown=this._hovered=!1;this._label="";this._stickyHighlighting=this._mouseCaptured=!1;this._createLabelIfNeed=!0;this.touchChildren=this.hasCreatedLabel=this.createLabelIfNeedChanged=!1;this.addHandlers()}__extends(a,d);Object.defineProperty(a.prototype,"autoRepeat",{get:function(){return this._autoRepeat},set:function(b){b!=this._autoRepeat&&(this._autoRepeat=
- b,this.checkAutoRepeatTimerConditions(this.isDown()))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"repeatDelay",{get:function(){return this._repeatDelay},set:function(b){this._repeatDelay=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"repeatInterval",{get:function(){return this._repeatInterval},set:function(b){this._repeatInterval=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hovered",{get:function(){return this._hovered},set:function(b){b!=
- this._hovered&&(this._hovered=b,this.invalidateSkinState(),this.checkButtonDownConditions())},enumerable:!0,configurable:!0});a.prototype.keepDown=function(b){this._keepDown!=b&&(this._keepDown=b,this.invalidateSkinState())};Object.defineProperty(a.prototype,"label",{get:function(){return this._getLabel()},set:function(b){this._setLabel(b)},enumerable:!0,configurable:!0});a.prototype._getLabel=function(){return this.labelDisplay?this.labelDisplay.text:this._label};a.prototype._setLabel=function(b){this._label=
- b;this.labelDisplay&&(this.labelDisplay.text=b)};Object.defineProperty(a.prototype,"mouseCaptured",{get:function(){return this._mouseCaptured},set:function(b){b!=this._mouseCaptured&&(this._mouseCaptured=b,this.invalidateSkinState(),b||this.removeStageMouseHandlers(),this.checkButtonDownConditions())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stickyHighlighting",{get:function(){return this._stickyHighlighting},set:function(b){b!=this._stickyHighlighting&&(this._stickyHighlighting=
- b,this.invalidateSkinState(),this.checkButtonDownConditions())},enumerable:!0,configurable:!0});a.prototype.checkButtonDownConditions=function(){var b=this.isDown();this._downEventFired!=b&&(b&&this.dispatchEvent(new c.UIEvent(c.UIEvent.BUTTON_DOWN)),this._downEventFired=b,this.checkAutoRepeatTimerConditions(b))};a.prototype.addHandlers=function(){this.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER,this.mouseEventHandler,this);this.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT,this.mouseEventHandler,
- this);this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.mouseEventHandler,this);this.addEventListener(c.TouchEvent.TOUCH_END,this.mouseEventHandler,this);this.addEventListener(c.TouchEvent.TOUCH_TAP,this.mouseEventHandler,this)};a.prototype.addStageMouseHandlers=function(){c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)};a.prototype.removeStageMouseHandlers=function(){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,
- this.stage_mouseUpHandler,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)};a.prototype.isDown=function(){return!this.enabled?!1:this.mouseCaptured&&(this.hovered||this.stickyHighlighting)?!0:!1};a.prototype.checkAutoRepeatTimerConditions=function(b){b=this.autoRepeat&&b;b!=(null!=this.autoRepeatTimer)&&(b?this.startTimer():this.stopTimer())};a.prototype.startTimer=function(){this.autoRepeatTimer=new c.Timer(1);this.autoRepeatTimer.delay=this._repeatDelay;
- this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER,this.autoRepeat_timerDelayHandler,this);this.autoRepeatTimer.start()};a.prototype.stopTimer=function(){this.autoRepeatTimer.stop();this.autoRepeatTimer=null};a.prototype.mouseEventHandler=function(b){switch(b.type){case c.TouchEvent.TOUCH_ROLL_OVER:if(b.touchDown&&!this.mouseCaptured)break;this.hovered=!0;break;case c.TouchEvent.TOUCH_ROLL_OUT:this.hovered=!1;break;case c.TouchEvent.TOUCH_BEGAN:this.addStageMouseHandlers();c.InteractionMode.mode==
- c.InteractionMode.TOUCH&&(this.hovered=!0);this.mouseCaptured=!0;break;case c.TouchEvent.TOUCH_END:b.target==this&&(this.hovered=!0,this.mouseCaptured&&(this.buttonReleased(),this.mouseCaptured=!1));break;case c.TouchEvent.TOUCH_TAP:this.enabled?this.clickHandler(b):b.stopImmediatePropagation()}};a.prototype.buttonReleased=function(){};a.prototype.clickHandler=function(b){};a.prototype.stage_mouseUpHandler=function(b){b.target!=this&&(this.mouseCaptured=!1)};a.prototype.autoRepeat_timerDelayHandler=
- function(b){this.autoRepeatTimer.reset();this.autoRepeatTimer.removeEventListener(c.TimerEvent.TIMER,this.autoRepeat_timerDelayHandler,this);this.autoRepeatTimer.delay=this._repeatInterval;this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER,this.autoRepeat_timerHandler,this);this.autoRepeatTimer.start()};a.prototype.autoRepeat_timerHandler=function(b){this.dispatchEvent(new c.UIEvent(c.UIEvent.BUTTON_DOWN))};a.prototype.getCurrentSkinState=function(){return!this.enabled?d.prototype.getCurrentSkinState.call(this):
- this.isDown()||this._keepDown?"down":c.InteractionMode.mode==c.InteractionMode.MOUSE&&(this.hovered||this.mouseCaptured)?"over":"up"};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.labelDisplay&&(this.labelDisplay.text=this._label)};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.createLabelIfNeedChanged&&(this.createLabelIfNeedChanged=!1,this.createLabelIfNeed?(this.createSkinParts(),this.invalidateSize(),this.invalidateDisplayList()):
- this.removeSkinParts())};Object.defineProperty(a.prototype,"createLabelIfNeed",{get:function(){return this._createLabelIfNeed},set:function(b){b!=this._createLabelIfNeed&&(this._createLabelIfNeed=b,this.createLabelIfNeedChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});a.prototype.createSkinParts=function(){if(!this.hasCreatedLabel&&this._createLabelIfNeed){this.hasCreatedLabel=!0;var b=new c.Label;b.textAlign=c.HorizontalAlign.CENTER;b.verticalAlign=c.VerticalAlign.MIDDLE;
- b.maxDisplayedLines=1;b.left=10;b.right=10;b.top=2;b.bottom=2;this._addToDisplayList(b);this.labelDisplay=b;this.partAdded("labelDisplay",this.labelDisplay)}};a.prototype.removeSkinParts=function(){this.hasCreatedLabel&&(this.hasCreatedLabel=!1,this.labelDisplay&&(this._label=this.labelDisplay.text,this.partRemoved("labelDisplay",this.labelDisplay),this._removeFromDisplayList(this.labelDisplay),this.labelDisplay=null))};return a}(c.SkinnableComponent);c.ButtonBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._autoSelected=!0}__extends(a,d);Object.defineProperty(a.prototype,"selected",{get:function(){return this._selected},set:function(b){this._setSelected(b)},enumerable:!0,configurable:!0});a.prototype._setSelected=function(b){b!=this._selected&&(this._selected=b,this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)),this.invalidateSkinState())};a.prototype.getCurrentSkinState=function(){return this.selected?d.prototype.getCurrentSkinState.call(this)+
- "AndSelected":d.prototype.getCurrentSkinState.call(this)};a.prototype.buttonReleased=function(){d.prototype.buttonReleased.call(this);this._autoSelected&&this.enabled&&(this.selected=!this.selected,this.dispatchEventWith(c.Event.CHANGE))};return a}(c.ButtonBase);c.ToggleButtonBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._fontFamily="SimSun";this._size=12;this._textAlign=c.HorizontalAlign.LEFT;this._verticalAlign=c.VerticalAlign.TOP;this._textColor=this._letterSpacing=this._lineSpacing=0;this._text=""}__extends(a,d);Object.defineProperty(a.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(b){this._fontFamily!=b&&(this._fontFamily=b,this.fontFamilyChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"size",{get:function(){return this._size},set:function(b){this._size!=b&&(this._size=b,this.sizeChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"textAlign",{get:function(){return this._textAlign},set:function(b){this._textAlign!=b&&(this._textAlign=b,this.textAlignChanged=!0,this.invalidateProperties(),this.invalidateSize(),
- this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(b){this._verticalAlign!=b&&(this._verticalAlign=b,this.verticalAlignChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"lineSpacing",{get:function(){return this._lineSpacing},set:function(b){this._lineSpacing!=b&&(this._lineSpacing=
- b,this.lineSpacingChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(b){this._letterSpacing!=b&&(this._letterSpacing=b,this.letterSpacingChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"textColor",{get:function(){return this._textColor},
- set:function(b){this._textColor!=b&&(this._textColor=b,this.textColorChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"text",{get:function(){return this._text},set:function(b){b!=this._text&&(this._text=b,this.textChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this._textField||this.checkTextField()};
- a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this._textField||this.checkTextField();this.fontFamilyChanged&&(this._textField.fontFamily=this._fontFamily,this.fontFamilyChanged=!1);this.sizeChanged&&(this._textField.size=this._size,this.sizeChanged=!1);this.textAlignChanged&&(this._textField.textAlign=this._textAlign,this.textAlignChanged=!1);this.verticalAlignChanged&&(this._textField.verticalAlign=this._verticalAlign,this.verticalAlignChanged=!1);this.lineSpacingChanged&&
- (this._textField.lineSpacing=this._lineSpacing,this.lineSpacingChanged=!1);this.letterSpacingChanged&&(this._textField.letterSpacing=this._letterSpacing,this.letterSpacingChanged=!1);this.textColorChanged&&(this._textField.textColor=this._textColor,this.textColorChanged=!1);this.textChanged&&(this._textField.text=this._text,this.textChanged=!1)};a.prototype.checkTextField=function(){this._textField||(this.createTextField(),this._textField.text=this._text,this.textChanged=!0,this.invalidateProperties())};
- a.prototype.createTextField=function(){this._textField=new c.TextField;this._textField.fontFamily=this._fontFamily;this._textField.size=this._size;this._textField.textAlign=this._textAlign;this._textField.verticalAlign=this._verticalAlign;this._textField.lineSpacing=this._lineSpacing;this._textField.letterSpacing=this.letterSpacing;this._textField.textColor=this._textColor;this.addChild(this._textField)};a.prototype.measure=function(){d.prototype.measure.call(this);this.measuredWidth=a.DEFAULT_MEASURED_WIDTH;
- this.measuredHeight=a.DEFAULT_MEASURED_HEIGHT};a.prototype.$updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a)};a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this._textField.width=b;this._textField.height=a};a.DEFAULT_MEASURED_WIDTH=160;a.DEFAULT_MEASURED_HEIGHT=22;return a}(c.UIComponent);c.TextBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._contentHeight=this._contentWidth=0;this.touchEnabled=this.layoutInvalidateSizeFlag=this.layoutInvalidateDisplayListFlag=!1}__extends(a,d);Object.defineProperty(a.prototype,"contentWidth",{get:function(){return this._contentWidth},enumerable:!0,configurable:!0});a.prototype.setContentWidth=function(b){if(b!=this._contentWidth){var a=this._contentWidth;this._contentWidth=b;this.dispatchPropertyChangeEvent("contentWidth",a,b)}};Object.defineProperty(a.prototype,
- "contentHeight",{get:function(){return this._contentHeight},enumerable:!0,configurable:!0});a.prototype.setContentHeight=function(b){if(b!=this._contentHeight){var a=this._contentHeight;this._contentHeight=b;this.dispatchPropertyChangeEvent("contentHeight",a,b)}};a.prototype.setContentSize=function(b,a){b==this._contentWidth&&a==this._contentHeight||(this.setContentWidth(b),this.setContentHeight(a))};Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(b){this._setLayout(b)},
- enumerable:!0,configurable:!0});a.prototype._setLayout=function(b){if(this._layout!=b){this._layout&&(this._layout.target=null,this._layout.removeEventListener(c.PropertyChangeEvent.PROPERTY_CHANGE,this.redispatchLayoutEvent,this),this._layoutProperties={clipAndEnableScrolling:this._layout.clipAndEnableScrolling});if(this._layout=b)this._layout.target=this,this._layout.addEventListener(c.PropertyChangeEvent.PROPERTY_CHANGE,this.redispatchLayoutEvent,this),this._layoutProperties&&(void 0!==this._layoutProperties.clipAndEnableScrolling&&
- (b.clipAndEnableScrolling=this._layoutProperties.clipAndEnableScrolling),void 0!==this._layoutProperties.verticalScrollPosition&&(b.verticalScrollPosition=this._layoutProperties.verticalScrollPosition),void 0!==this._layoutProperties.horizontalScrollPosition&&(b.horizontalScrollPosition=this._layoutProperties.horizontalScrollPosition),this._layoutProperties=null);this.invalidateSize();this.invalidateDisplayList();this.dispatchEvent(new c.Event("layoutChanged"))}};a.prototype.redispatchLayoutEvent=
- function(b){if(b)switch(b.property){case "verticalScrollPosition":case "horizontalScrollPosition":this.dispatchEvent(b)}};a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this._layout||(this.layout=new c.BasicLayout)};Object.defineProperty(a.prototype,"clipAndEnableScrolling",{get:function(){return this._layout?this._layout.clipAndEnableScrolling:this._layoutProperties&&void 0!==this._layoutProperties.clipAndEnableScrolling?this._layoutProperties.clipAndEnableScrolling:
- !1},set:function(b){this._layout?this._layout.clipAndEnableScrolling=b:this._layoutProperties?this._layoutProperties.clipAndEnableScrolling=b:this._layoutProperties={clipAndEnableScrolling:b};this.invalidateSize()},enumerable:!0,configurable:!0});a.prototype.getHorizontalScrollPositionDelta=function(b){return this.layout?this.layout.getHorizontalScrollPositionDelta(b):0};a.prototype.getVerticalScrollPositionDelta=function(b){return this.layout?this.layout.getVerticalScrollPositionDelta(b):0};Object.defineProperty(a.prototype,
- "horizontalScrollPosition",{get:function(){return this._layout?this._layout.horizontalScrollPosition:this._layoutProperties&&void 0!==this._layoutProperties.horizontalScrollPosition?this._layoutProperties.horizontalScrollPosition:0},set:function(b){this._layout?this._layout.horizontalScrollPosition=b:this._layoutProperties?this._layoutProperties.horizontalScrollPosition=b:this._layoutProperties={horizontalScrollPosition:b}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalScrollPosition",
- {get:function(){return this._layout?this._layout.verticalScrollPosition:this._layoutProperties&&void 0!==this._layoutProperties.verticalScrollPosition?this._layoutProperties.verticalScrollPosition:0},set:function(b){this._layout?this._layout.verticalScrollPosition=b:this._layoutProperties?this._layoutProperties.verticalScrollPosition=b:this._layoutProperties={verticalScrollPosition:b}},enumerable:!0,configurable:!0});a.prototype.measure=function(){this._layout&&this.layoutInvalidateSizeFlag&&(d.prototype.measure.call(this),
- this._layout.measure())};a.prototype.invalidateDisplayListExceptLayout=function(){d.prototype.invalidateDisplayList.call(this)};a.prototype.invalidateDisplayList=function(){d.prototype.invalidateDisplayList.call(this);this.layoutInvalidateDisplayListFlag=!0};a.prototype.childXYChanged=function(){this.invalidateSize();this.invalidateDisplayList()};a.prototype.invalidateSizeExceptLayout=function(){d.prototype.invalidateSize.call(this)};a.prototype.invalidateSize=function(){d.prototype.invalidateSize.call(this);
- this.layoutInvalidateSizeFlag=!0};a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.layoutInvalidateDisplayListFlag&&this._layout&&(this.layoutInvalidateDisplayListFlag=!1,this._layout.updateDisplayList(b,a),this._layout.updateScrollRect(b,a))};Object.defineProperty(a.prototype,"numElements",{get:function(){return-1},enumerable:!0,configurable:!0});a.prototype.getElementAt=function(b){return null};a.prototype.getElementIndex=function(b){return-1};a.prototype.getElementIndicesInView=
- function(){var b=[],a;if(this.scrollRect)for(a=0;a<this.numChildren;a++){var d=this.getChildAt(a);if(d){var e=new c.Rectangle;e.x=d.layoutBoundsX;e.y=d.layoutBoundsY;e.width=d.layoutBoundsWidth;e.height=d.layoutBoundsHeight;this.scrollRect.intersects(e)&&b.push(a)}}else for(a=0;a<this.numChildren;a++)b.push(a);return b};a.prototype.setVirtualElementIndicesInView=function(b,a){};a.prototype.getVirtualElementAt=function(b){return this.getElementAt(b)};Object.defineProperty(a.prototype,"scrollRect",
- {get:function(){return this._scrollRect},set:function(b){this._scrollRect=b;this.hasEventListener("scrollRectChange")&&this.dispatchEvent(new c.Event("scrollRectChange"))},enumerable:!0,configurable:!0});return a}(c.UIComponent);c.GroupBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this);this._selected=this.dataChangedFlag=!1;this._itemIndex=-1;this.touchChildren=!0}__extends(a,c);Object.defineProperty(a.prototype,"data",{get:function(){return this._data},set:function(b){this._data=b;this.initialized||this.parent?(this.dataChangedFlag=!1,this.dataChanged()):(this.dataChangedFlag=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});a.prototype.dataChanged=function(){};Object.defineProperty(a.prototype,"selected",
- {get:function(){return this._selected},set:function(b){this._selected!=b&&(this._selected=b,this.invalidateSkinState())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"itemIndex",{get:function(){return this._itemIndex},set:function(b){this._itemIndex=b},enumerable:!0,configurable:!0});a.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.dataChangedFlag&&(this.dataChangedFlag=!1,this.dataChanged())};a.prototype.getCurrentSkinState=function(){return this._selected?
- "down":c.prototype.getCurrentSkinState.call(this)};return a}(c.ButtonBase);c.ItemRenderer=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._indentation=17;this._depth=0;this._isOpen=this._hasChildren=!1;this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.onItemMouseDown,this,!1,1E3)}__extends(a,d);a.prototype.onItemMouseDown=function(b){b.target==this.disclosureButton&&b.stopImmediatePropagation()};Object.defineProperty(a.prototype,"indentation",{get:function(){return this._indentation},set:function(b){this._indentation=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "iconSkinName",{get:function(){return this._iconSkinName},set:function(b){this._iconSkinName!=b&&(this._iconSkinName=b,this.iconDisplay&&(this.iconDisplay.skinName=this._iconSkinName))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"depth",{get:function(){return this._depth},set:function(b){b!=this._depth&&(this._depth=b,this.contentGroup&&(this.contentGroup.x=this._depth*this._indentation))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasChildren",{get:function(){return this._hasChildren},
- set:function(b){this._hasChildren!=b&&(this._hasChildren=b,this.disclosureButton&&(this.disclosureButton.visible=this._hasChildren))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"opened",{get:function(){return this._isOpen},set:function(b){this._isOpen!=b&&(this._isOpen=b,this.disclosureButton&&(this.disclosureButton.selected=this._isOpen))},enumerable:!0,configurable:!0});a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.iconDisplay?this.iconDisplay.skinName=
- this._iconSkinName:a==this.disclosureButton?(this.disclosureButton.visible=this._hasChildren,this.disclosureButton.selected=this._isOpen,this.disclosureButton._autoSelected=!1,this.disclosureButton.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.disclosureButton_mouseDownHandler,this)):a==this.contentGroup&&(this.contentGroup.x=this._depth*this._indentation)};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);a==this.iconDisplay?this.iconDisplay.skinName=null:a==this.disclosureButton&&
- (this.disclosureButton.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.disclosureButton_mouseDownHandler,this),this.disclosureButton._autoSelected=!0,this.disclosureButton.visible=!0)};a.prototype.disclosureButton_mouseDownHandler=function(b){b=new c.TreeEvent(c.TreeEvent.ITEM_OPENING,!1,!0,this.itemIndex,this.data,this);b.opening=!this._isOpen;this.dispatchEvent(b)};return a}(c.ItemRenderer);c.TreeItemRenderer=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(a,b){this.easerFunction=c.Ease.sineInOut;this._duration=500;this._startDelay=0;this._repeatCount=1;this._repeatDelay=0;this.motionPaths=[];this._currentValue={};this.pauseTime=0;this._isPaused=!1;this.startTime=0;this._started=!1;this.playedTimes=0;this.updateFunction=a;this.thisObject=b}Object.defineProperty(d.prototype,"isPlaying",{get:function(){return this._isPlaying},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"duration",{get:function(){return this._duration},
- set:function(a){this._duration=a},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"startDelay",{get:function(){return this._startDelay},set:function(a){this._startDelay=a},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"repeatCount",{get:function(){return this._repeatCount},set:function(a){this._repeatCount=a},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"repeatDelay",{get:function(){return this._repeatDelay},set:function(a){this._repeatDelay=
- a},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!0,configurable:!0});d.prototype.play=function(){this.stopAnimation();this.start()};d.prototype.seek=function(a){a=Math.min(a,this.duration);this.caculateCurrentValue(a/this.duration);this.startTime=c.getTimer()-a-this._startDelay;null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this)};d.prototype.start=function(){this.playedTimes=0;this._started=
- !0;this._isPlaying=!1;this._currentValue={};this.caculateCurrentValue(0);this.startTime=c.getTimer();d.currentTime=this.startTime;this.doInterval();d.addAnimation(this)};d.prototype.end=function(){this._started||(this.caculateCurrentValue(0),null!=this.startFunction&&this.startFunction.call(this.thisObject,this),null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this));this.caculateCurrentValue(1);null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this);this.stopAnimation();
- null!=this.endFunction&&this.endFunction.call(this.thisObject,this)};d.prototype.stop=function(){this.stopAnimation();null!=this.stopFunction&&this.stopFunction.call(this.thisObject,this)};d.prototype.stopAnimation=function(){this.playedTimes=0;this._isPlaying=!1;this.startTime=0;this._started=!1;d.removeAnimation(this)};Object.defineProperty(d.prototype,"isPaused",{get:function(){return this._isPaused},enumerable:!0,configurable:!0});d.prototype.pause=function(){this._started&&(this._isPaused=!0,
- this.pauseTime=c.getTimer(),this._isPlaying=!1,d.removeAnimation(this))};d.prototype.resume=function(){this._started&&this._isPaused&&(this._isPaused=!1,this.startTime+=c.getTimer()-this.pauseTime,this.pauseTime=-1,d.addAnimation(this))};Object.defineProperty(d.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0});d.prototype.doInterval=function(){var a=d.currentTime-this.startTime-(0<this.playedTimes?this._repeatDelay:this._startDelay);if(0>a)return!1;this._isPlaying||
- (this._isPlaying=!0,0==this.playedTimes&&null!=this.startFunction&&this.startFunction.call(this.thisObject,this));var b=0==this._duration?1:Math.min(a,this._duration)/this._duration;this.caculateCurrentValue(b);null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this);if(a=a>=this._duration)this.playedTimes++,this._isPlaying=!1,this.startTime=d.currentTime,0==this._repeatCount||this.playedTimes<this._repeatCount?a=!1:(d.removeAnimation(this),this._started=!1,this.playedTimes=0);a&&
- null!=this.endFunction&&this.endFunction.call(this.thisObject,this);return a};d.prototype.caculateCurrentValue=function(a){this.easerFunction&&(a=this.easerFunction(a));for(var b=this.motionPaths,c=b.length,d=0;d<c;d++){var e=b[d];this.currentValue[e.prop]=e.from+(e.to-e.from)*a}};d.addAnimation=function(a){-1==d.activeAnimations.indexOf(a)&&(d.activeAnimations.push(a),d.registered||(d.registered=!0,c.Ticker.getInstance().register(d.onEnterFrame,null)))};d.removeAnimation=function(a){a=d.activeAnimations.indexOf(a);
- -1!=a&&(d.activeAnimations.splice(a,1),a<=d.currentIntervalIndex&&d.currentIntervalIndex--);0==d.activeAnimations.length&&d.registered&&(d.registered=!1,c.Ticker.getInstance().unregister(d.onEnterFrame,null))};d.onEnterFrame=function(a,b){d.currentTime=c.getTimer();for(d.currentIntervalIndex=0;d.currentIntervalIndex<d.activeAnimations.length;)d.activeAnimations[d.currentIntervalIndex].doInterval(),d.currentIntervalIndex++;d.currentIntervalIndex=-1;0==d.activeAnimations.length&&d.registered&&(d.registered=
- !1,c.Ticker.getInstance().unregister(d.onEnterFrame,null))};d.currentTime=0;d.TIMER_RESOLUTION=1E3/60;d.activeAnimations=[];d.currentIntervalIndex=-1;return d}();c.Animation=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this);this._maximum=100;this.maxChanged=!1;this._minimum=0;this.minChanged=!1;this._stepSize=1;this.stepSizeChanged=!1;this._changedValue=this._value=0;this.valueChanged=!1;this._snapInterval=1;this._explicitSnapInterval=this.snapIntervalChanged=!1}__extends(a,c);Object.defineProperty(a.prototype,"maximum",{get:function(){return this._maximum},set:function(b){this._setMaximun(b)},enumerable:!0,configurable:!0});a.prototype._setMaximun=function(b){b!=
- this._maximum&&(this._maximum=b,this.maxChanged=!0,this.invalidateProperties())};Object.defineProperty(a.prototype,"minimum",{get:function(){return this._minimum},set:function(b){this._setMinimun(b)},enumerable:!0,configurable:!0});a.prototype._setMinimun=function(b){b!=this._minimum&&(this._minimum=b,this.minChanged=!0,this.invalidateProperties())};Object.defineProperty(a.prototype,"stepSize",{get:function(){return this._stepSize},set:function(b){b!=this._stepSize&&(this._stepSize=b,this.stepSizeChanged=
- !0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"value",{get:function(){return this._getValue()},set:function(b){this._setValue(b)},enumerable:!0,configurable:!0});a.prototype._setValue=function(b){b!=this.value&&(this._changedValue=b,this.valueChanged=!0,this.invalidateProperties())};a.prototype._getValue=function(){return this.valueChanged?this._changedValue:this._value};Object.defineProperty(a.prototype,"snapInterval",{get:function(){return this._snapInterval},
- set:function(b){this._explicitSnapInterval=!0;b!=this._snapInterval&&(isNaN(b)?(this._snapInterval=1,this._explicitSnapInterval=!1):this._snapInterval=b,this.stepSizeChanged=this.snapIntervalChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});a.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.minimum>this.maximum&&(this.maxChanged?this._maximum=this._minimum:this._minimum=this._maximum);if(this.valueChanged||this.maxChanged||this.minChanged||
- this.snapIntervalChanged){var b=this.valueChanged?this._changedValue:this._value;this.snapIntervalChanged=this.minChanged=this.maxChanged=this.valueChanged=!1;this.setValue(this.nearestValidValue(b,this.snapInterval))}this.stepSizeChanged&&(this._explicitSnapInterval?this._stepSize=this.nearestValidSize(this._stepSize):(this._snapInterval=this._stepSize,this.setValue(this.nearestValidValue(this._value,this.snapInterval))),this.stepSizeChanged=!1)};a.prototype.nearestValidSize=function(b){var a=this.snapInterval;
- if(0==a)return b;b=Math.round(b/a)*a;return Math.abs(b)<a?a:b};a.prototype.nearestValidValue=function(b,a){if(0==a)return Math.max(this.minimum,Math.min(this.maximum,b));var c=this.maximum-this.minimum,d=1;b-=this.minimum;a!=Math.round(a)&&(d=(1+a).toString().split("."),d=Math.pow(10,d[1].length),c*=d,b=Math.round(b*d),a=Math.round(a*d));var e=Math.max(0,Math.floor(b/a)*a),c=Math.min(c,Math.floor((b+a)/a)*a);return(b-e>=(c-e)/2?c:e)/d+this.minimum};a.prototype.setValue=function(b){this._value!=b&&
- (isNaN(b)&&(b=0),!isNaN(this.maximum)&&!isNaN(this.minimum)&&this.maximum>this.minimum?this._value=Math.min(this.maximum,Math.max(this.minimum,b)):this._value=b,this.valueChanged=!1)};a.prototype.changeValueByStep=function(b){"undefined"===typeof b&&(b=!0);0!=this.stepSize&&this.setValue(this.nearestValidValue(b?this.value+this.stepSize:this.value-this.stepSize,this.snapInterval))};return a}(c.SkinnableComponent);c.Range=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._slideDuration=300;this.needUpdateValue=!1;this.addEventListener(c.Event.ADDED_TO_STAGE,this.addedToStageHandler,this);this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.mouseDownHandler,this)}__extends(a,d);Object.defineProperty(a.prototype,"slideDuration",{get:function(){return this._slideDuration},set:function(b){this._slideDuration=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maximum",{get:function(){return this._maximum},
- set:function(b){b!=this._maximum&&(this._setMaximun(b),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"minimum",{get:function(){return this._minimum},set:function(b){b!=this._minimum&&(this._setMinimun(b),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"value",{get:function(){return this._getValue()},set:function(b){b!=this._getValue()&&(this._setValue(b),this.invalidateDisplayList())},enumerable:!0,
- configurable:!0});a.prototype.setValue=function(b){d.prototype.setValue.call(this,b);this.invalidateDisplayList()};a.prototype.pointToValue=function(b,a){return this.minimum};a.prototype.changeValueByStep=function(b){"undefined"===typeof b&&(b=!0);var a=this.value;d.prototype.changeValueByStep.call(this,b);this.value!=a&&this.dispatchEvent(new c.Event(c.Event.CHANGE))};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.thumb?(this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGAN,
- this.thumb_mouseDownHandler,this),this.thumb.addEventListener(c.ResizeEvent.RESIZE,this.thumb_resizeHandler,this),this.thumb.addEventListener(c.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this),this.thumb.stickyHighlighting=!0):a==this.track&&(this.track.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.track_mouseDownHandler,this),this.track.addEventListener(c.ResizeEvent.RESIZE,this.track_resizeHandler,this))};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);
- a==this.thumb?(this.thumb.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.thumb_mouseDownHandler,this),this.thumb.removeEventListener(c.ResizeEvent.RESIZE,this.thumb_resizeHandler,this),this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this)):a==this.track&&(this.track.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.track_mouseDownHandler,this),this.track.removeEventListener(c.ResizeEvent.RESIZE,this.track_resizeHandler,this))};a.prototype.updateDisplayList=
- function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.updateSkinDisplayList()};a.prototype.updateSkinDisplayList=function(){};a.prototype.addedToStageHandler=function(b){this.updateSkinDisplayList()};a.prototype.track_resizeHandler=function(b){this.updateSkinDisplayList()};a.prototype.thumb_resizeHandler=function(b){this.updateSkinDisplayList()};a.prototype.thumb_updateCompleteHandler=function(b){this.updateSkinDisplayList();this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,
- this)};a.prototype.thumb_mouseDownHandler=function(b){c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this);c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this);this.addEventListener(c.Event.ENTER_FRAME,this.onEnterFrame,this);b=this.thumb.globalToLocal(b.stageX,b.stageY);this._clickOffsetX=b.x;this._clickOffsetY=b.y;this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_PRESS));
- this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_START))};a.prototype.onEnterFrame=function(b){this.needUpdateValue&&this.track&&(this.updateWhenMouseMove(),this.needUpdateValue=!1)};a.prototype.updateWhenMouseMove=function(){if(this.track){var b=this.track.globalToLocal(this._moveStageX,this._moveStageY),b=this.pointToValue(b.x-this._clickOffsetX,b.y-this._clickOffsetY),b=this.nearestValidValue(b,this.snapInterval);b!=this.value&&(this.setValue(b),this.validateDisplayList(),this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_DRAG)),
- this.dispatchEventWith(c.Event.CHANGE))}};a.prototype.stage_mouseMoveHandler=function(b){this._moveStageX=b.stageX;this._moveStageY=b.stageY;this.needUpdateValue||(this.needUpdateValue=!0)};a.prototype.stage_mouseUpHandler=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this);c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,
- this);this.removeEventListener(c.Event.ENTER_FRAME,this.updateWhenMouseMove,this);this.needUpdateValue&&(this.updateWhenMouseMove(),this.needUpdateValue=!1);this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_RELEASE));this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_END))};a.prototype.track_mouseDownHandler=function(b){};a.prototype.mouseDownHandler=function(b){c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.system_mouseUpSomewhereHandler,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,
- this.system_mouseUpSomewhereHandler,this);this.mouseDownTarget=b.target};a.prototype.system_mouseUpSomewhereHandler=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.system_mouseUpSomewhereHandler,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.system_mouseUpSomewhereHandler,this);if(this.mouseDownTarget!=b.target&&b instanceof c.TouchEvent&&this.contains(b.target)){var a=b.target.localToGlobal(b.localX,b.localY);b=new c.TouchEvent(c.TouchEvent.TOUCH_TAP,
- b.bubbles,b.cancelable,b.touchPointID,a.x,a.y,b.ctrlKey,b.altKey,b.shiftKey,b.touchDown);this.dispatchEvent(b)}this.mouseDownTarget=null};return a}(c.Range);c.TrackBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._showTrackHighlight=!0;this._pendingValue=0;this._liveDragging=!0;this.maximum=10}__extends(a,d);Object.defineProperty(a.prototype,"showTrackHighlight",{get:function(){return this._showTrackHighlight},set:function(b){this._showTrackHighlight!=b&&(this._showTrackHighlight=b,this.trackHighlight&&(this.trackHighlight.visible=b),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"pendingValue",
- {get:function(){return this._pendingValue},set:function(b){b!=this._pendingValue&&(this._pendingValue=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.setValue=function(b){this._pendingValue=b;d.prototype.setValue.call(this,b)};a.prototype.animationUpdateHandler=function(b){this.pendingValue=b.currentValue.value};a.prototype.animationEndHandler=function(b){this.setValue(this.slideToValue);this.dispatchEvent(new c.Event(c.Event.CHANGE));this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_END))};
- a.prototype.stopAnimation=function(){this.animator.stop();this.setValue(this.nearestValidValue(this.pendingValue,this.snapInterval));this.dispatchEvent(new c.Event(c.Event.CHANGE));this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_END))};a.prototype.thumb_mouseDownHandler=function(b){this.animator&&this.animator.isPlaying&&this.stopAnimation();d.prototype.thumb_mouseDownHandler.call(this,b)};Object.defineProperty(a.prototype,"liveDragging",{get:function(){return this._liveDragging},set:function(b){this._liveDragging=
- b},enumerable:!0,configurable:!0});a.prototype.updateWhenMouseMove=function(){if(this.track){var b=this.track.globalToLocal(this._moveStageX,this._moveStageY),b=this.pointToValue(b.x-this._clickOffsetX,b.y-this._clickOffsetY),b=this.nearestValidValue(b,this.snapInterval);b!=this.pendingValue&&(this.dispatchEvent(new c.TrackBaseEvent(c.TrackBaseEvent.THUMB_DRAG)),!0==this.liveDragging?(this.setValue(b),this.dispatchEvent(new c.Event(c.Event.CHANGE))):this.pendingValue=b)}};a.prototype.stage_mouseUpHandler=
- function(b){d.prototype.stage_mouseUpHandler.call(this,b);!1==this.liveDragging&&this.value!=this.pendingValue&&(this.setValue(this.pendingValue),this.dispatchEvent(new c.Event(c.Event.CHANGE)))};a.prototype.track_mouseDownHandler=function(b){this.enabled&&(b=this.track.globalToLocal(b.stageX-(this.thumb?this.thumb.width:0)/2,b.stageY-(this.thumb?this.thumb.height:0)/2),b=this.pointToValue(b.x,b.y),b=this.nearestValidValue(b,this.snapInterval),b!=this.pendingValue&&(0!=this.slideDuration?(this.animator||
- (this.animator=new c.Animation(this.animationUpdateHandler,this),this.animator.endFunction=this.animationEndHandler),this.animator.isPlaying&&this.stopAnimation(),this.slideToValue=b,this.animator.duration=this.slideDuration*(Math.abs(this.pendingValue-this.slideToValue)/(this.maximum-this.minimum)),this.animator.motionPaths=[{prop:"value",from:this.pendingValue,to:this.slideToValue}],this.dispatchEvent(new c.UIEvent(c.UIEvent.CHANGE_START)),this.animator.play()):(this.setValue(b),this.dispatchEvent(new c.Event(c.Event.CHANGE)))))};
- a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.trackHighlight&&(this.trackHighlight.touchEnabled=!1,this.trackHighlight instanceof c.DisplayObjectContainer&&(this.trackHighlight.touchChildren=!1),this.trackHighlight.visible=this._showTrackHighlight)};return a}(c.TrackBase);c.SliderBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._maxDisplayedLines=0;this.lastUnscaledWidth=NaN;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.addEventListener(c.UIEvent.UPDATE_COMPLETE,this.updateCompleteHandler,this)}__extends(a,d);a.prototype.updateCompleteHandler=function(b){this.lastUnscaledWidth=NaN};Object.defineProperty(a.prototype,"maxDisplayedLines",{get:function(){return this._maxDisplayedLines},set:function(b){this._maxDisplayedLines!=
- b&&(this._maxDisplayedLines=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"padding",{get:function(){return this._padding},set:function(b){this._padding!=b&&(this._padding=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(b){this._paddingLeft!=b&&(this._paddingLeft=b,this.invalidateSize(),
- this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(b){this._paddingRight!=b&&(this._paddingRight=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(b){this._paddingTop!=b&&(this._paddingTop=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,
- configurable:!0});Object.defineProperty(a.prototype,"paddingBottom",{get:function(){return this._paddingBottom},set:function(b){this._paddingBottom!=b&&(this._paddingBottom=b,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.measure=function(){this.invalidatePropertiesFlag&&this.validateProperties();if(this.isSpecialCase())if(isNaN(this.lastUnscaledWidth))this.oldPreferHeight=this.oldPreferWidth=NaN;else{this.measureUsingWidth(this.lastUnscaledWidth);
- return}var b;isNaN(this.explicitWidth)?1E4!=this.maxWidth&&(b=this.maxWidth):b=this.explicitWidth;this.measureUsingWidth(b)};a.prototype.isSpecialCase=function(){return 1!=this._maxDisplayedLines&&(!isNaN(this.percentWidth)||!isNaN(this.left)&&!isNaN(this.right))&&isNaN(this.explicitHeight)&&isNaN(this.percentHeight)};a.prototype.measureUsingWidth=function(b){var a=this._textField.text;this.textChanged&&(this._textField.text=this._text);var c=isNaN(this._padding)?0:this._padding,d=isNaN(this._paddingLeft)?
- c:this._paddingLeft,e=isNaN(this._paddingRight)?c:this._paddingRight,k=isNaN(this._paddingTop)?c:this._paddingTop,c=isNaN(this._paddingBottom)?c:this._paddingBottom;this._textField.width=NaN;this._textField.height=NaN;isNaN(b)||(this._textField.width=b-d-e);this.measuredWidth=Math.ceil(this._textField.measuredWidth);this.measuredHeight=Math.ceil(this._textField.measuredHeight);0<this._maxDisplayedLines&&this._textField.numLines>this._maxDisplayedLines&&(b=this._textField.lineSpacing,this.measuredHeight=
- (this._textField.size+b)*this._maxDisplayedLines-b);this.measuredWidth+=d+e;this.measuredHeight+=k+c;this._textField.text=a};a.prototype.updateDisplayList=function(b,a){this.$updateDisplayList(b,a);var c=isNaN(this._padding)?0:this._padding,d=isNaN(this._paddingLeft)?c:this._paddingLeft,e=isNaN(this._paddingRight)?c:this._paddingRight,k=isNaN(this._paddingTop)?c:this._paddingTop,c=isNaN(this._paddingBottom)?c:this._paddingBottom;this._textField.x=d;this._textField.y=k;if(this.isSpecialCase()){var l=
- isNaN(this.lastUnscaledWidth)||this.lastUnscaledWidth!=b;this.lastUnscaledWidth=b;if(l){this.oldPreferHeight=this.oldPreferWidth=NaN;this.invalidateSize();return}}this.invalidateSizeFlag&&this.validateSize();this._textField.visible||(this._textField.visible=!0);this._textField.width=b-d-e;d=a-k-c;this._textField.height=d;0<this._maxDisplayedLines&&this._textField.numLines>this._maxDisplayedLines&&(e=this._textField.lineSpacing,this._textField.height=Math.min(d,(this._textField.size+e)*this._maxDisplayedLines-
- e))};return a}(c.TextBase);c.Label=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._fillColor=16777215;this._fillAlpha=1;this._strokeColor=4473924;this._strokeAlpha=0;this._strokeWeight=1;this.touchChildren=!1}__extends(a,d);a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this.shapeRect=new c.Shape;this.addChild(this.shapeRect)};Object.defineProperty(a.prototype,"fillColor",{get:function(){return this._fillColor},set:function(b){this._fillColor!=b&&(this._fillColor=b,this.invalidateDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"fillAlpha",{get:function(){return this._fillAlpha},set:function(b){this._fillAlpha!=b&&(this._fillAlpha=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(b){this._strokeColor!=b&&(this._strokeColor=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeAlpha",{get:function(){return this._strokeAlpha},
- set:function(b){this._strokeAlpha!=b&&(this._strokeAlpha=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"strokeWeight",{get:function(){return this._strokeWeight},set:function(b){this._strokeWeight!=b&&(this._strokeWeight=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,b);var c=this.shapeRect.graphics;c.clear();c.beginFill(this._fillColor,this._fillAlpha);
- 0<this._strokeAlpha&&c.lineStyle(this._strokeWeight,this._strokeColor,this._strokeAlpha,!0,"normal","square","miter");c.drawRect(0,0,b,a);c.endFill()};return a}(c.UIComponent);c.Rect=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);return a}(c.ButtonBase);c.Button=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);return a}(c.ToggleButtonBase);c.ToggleButton=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);return a}(c.ToggleButtonBase);c.CheckBox=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.radioButtons=[];this._enabled=!0;this.name="radioButtonGroup"+a.groupCount;a.groupCount++}__extends(a,d);Object.defineProperty(a.prototype,"enabled",{get:function(){return this._enabled},set:function(b){if(this._enabled!=b){this._enabled=b;for(b=0;b<this.numRadioButtons;b++)this.getRadioButtonAt(b).invalidateSkinState()}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numRadioButtons",{get:function(){return this.radioButtons.length},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedValue",{get:function(){return this.selection?null!=this.selection.value?this.selection.value:this.selection.label:null},set:function(b){this._selectedValue=b;if(null==b)this.setSelection(null,!1);else for(var a=this.numRadioButtons,d=0;d<a;d++){var e=this.getRadioButtonAt(d);if(e.value==b||e.label==b){this.changeSelection(d,!1);this._selectedValue=null;this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT));break}}},enumerable:!0,
- configurable:!0});Object.defineProperty(a.prototype,"selection",{get:function(){return this._selection},set:function(b){this._selection!=b&&this.setSelection(b,!1)},enumerable:!0,configurable:!0});a.prototype.getRadioButtonAt=function(b){return 0<=b&&b<this.numRadioButtons?this.radioButtons[b]:null};a.prototype.addInstance=function(b){b.addEventListener(c.Event.REMOVED,this.radioButton_removedHandler,this);this.radioButtons.push(b);this.radioButtons.sort(this.breadthOrderCompare);for(var a=0;a<this.radioButtons.length;a++)this.radioButtons[a].indexNumber=
- a;this._selectedValue&&(this.selectedValue=this._selectedValue);!0==b.selected&&(this.selection=b);b.radioButtonGroup=this;b.invalidateSkinState();this.dispatchEvent(new c.Event("numRadioButtonsChanged"))};a.prototype.removeInstance=function(b){this.doRemoveInstance(b,!1)};a.prototype.doRemoveInstance=function(b,a){"undefined"===typeof a&&(a=!0);if(b){for(var d=!1,e=0;e<this.numRadioButtons;e++){var g=this.getRadioButtonAt(e);d?g.indexNumber-=1:g==b&&(a&&b.addEventListener(c.Event.ADDED,this.radioButton_addedHandler,
- this),b==this._selection&&(this._selection=null),b.radioButtonGroup=null,b.invalidateSkinState(),this.radioButtons.splice(e,1),d=!0,e--)}d&&this.dispatchEvent(new c.Event("numRadioButtonsChanged"))}};a.prototype.setSelection=function(b,a){"undefined"===typeof a&&(a=!0);if(this._selection!=b){if(b)for(var d=this.numRadioButtons,e=0;e<d;e++){if(b==this.getRadioButtonAt(e)){this.changeSelection(e,a);break}}else this.selection&&(this._selection.selected=!1,this._selection=null,a&&this.dispatchEvent(new c.Event(c.Event.CHANGE)));
- this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT))}};a.prototype.changeSelection=function(b,a){"undefined"===typeof a&&(a=!0);var d=this.getRadioButtonAt(b);d&&d!=this._selection&&(this._selection&&(this._selection.selected=!1),this._selection=d,this._selection.selected=!0,a&&this.dispatchEvent(new c.Event(c.Event.CHANGE)))};a.prototype.breadthOrderCompare=function(b,a){var d=b.parent,e=a.parent;if(!d||!e)return 0;var g=b instanceof c.UIComponent?b.nestLevel:-1,k=a instanceof c.UIComponent?
- a.nestLevel:-1,l=0,n=0;d==e&&(l="getElementIndex"in d&&"ownerChanged"in b?d.getElementIndex(b):d.getChildIndex(b),n="getElementIndex"in e&&"ownerChanged"in a?e.getElementIndex(a):e.getChildIndex(a));return g>k||l>n?1:g<k||n>l?-1:b==a?0:this.breadthOrderCompare(d,e)};a.prototype.radioButton_addedHandler=function(b){if(b=b.target)b.removeEventListener(c.Event.ADDED,this.radioButton_addedHandler,this),this.addInstance(b)};a.prototype.radioButton_removedHandler=function(b){if(b=b.target)b.removeEventListener(c.Event.REMOVED,
- this.radioButton_removedHandler,this),this.doRemoveInstance(b)};a.groupCount=0;return a}(c.EventDispatcher);c.RadioButtonGroup=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.indexNumber=0;this.radioButtonGroup=null;this.groupChanged=!1;this.groupName=this._groupName="radioGroup"}__extends(a,d);Object.defineProperty(a.prototype,"enabled",{get:function(){return!this._enabled?!1:!this.radioButtonGroup||this.radioButtonGroup.enabled},set:function(b){this._setEnabled(b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"group",{get:function(){if(!this._group&&this._groupName){a.automaticRadioButtonGroups||
- (a.automaticRadioButtonGroups={});var b=a.automaticRadioButtonGroups[this._groupName];b||(b=new c.RadioButtonGroup,b.name=this._groupName,a.automaticRadioButtonGroups[this._groupName]=b);this._group=b}return this._group},set:function(b){this._group!=b&&(this.radioButtonGroup&&this.radioButtonGroup.removeInstance(this),this._groupName=(this._group=b)?this.group.name:"radioGroup",this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "groupName",{get:function(){return this._groupName},set:function(b){b&&""!=b&&(this._groupName=b,this.radioButtonGroup&&this.radioButtonGroup.removeInstance(this),this._group=null,this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype._setSelected=function(b){d.prototype._setSelected.call(this,b);this.invalidateDisplayList()};Object.defineProperty(a.prototype,"value",{get:function(){return this._value},set:function(b){this._value!=
- b&&(this._value=b,this.selected&&this.group&&this.group.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)))},enumerable:!0,configurable:!0});a.prototype.commitProperties=function(){this.groupChanged&&(this.addToGroup(),this.groupChanged=!1);d.prototype.commitProperties.call(this)};a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.group&&(this.selected?this._group.selection=this:this.group.selection==this&&(this._group.selection=null))};a.prototype.buttonReleased=
- function(){this.enabled&&!this.selected&&(this.radioButtonGroup||this.addToGroup(),d.prototype.buttonReleased.call(this),this.group.setSelection(this))};a.prototype.addToGroup=function(){var b=this.group;b&&b.addInstance(this);return b};return a}(c.ToggleButtonBase);c.RadioButton=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.elementsContentChanged=this.createChildrenCalled=!1;this._elementsContent=[]}__extends(a,d);a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this.createChildrenCalled=!0;this.elementsContentChanged&&(this.elementsContentChanged=!1,this.setElementsContent(this._elementsContent))};a.prototype.getElementsContent=function(){return this._elementsContent};Object.defineProperty(a.prototype,"elementsContent",{set:function(b){null==
- b&&(b=[]);if(b!=this._elementsContent)if(this.createChildrenCalled)this.setElementsContent(b);else{this.elementsContentChanged=!0;for(var a=this._elementsContent.length-1;0<=a;a--)this.elementRemoved(this._elementsContent[a],a);this._elementsContent=b}},enumerable:!0,configurable:!0});a.prototype.setElementsContent=function(b){var a;for(a=this._elementsContent.length-1;0<=a;a--)this.elementRemoved(this._elementsContent[a],a);this._elementsContent=b.concat();b=this._elementsContent.length;for(a=0;a<
- b;a++){var c=this._elementsContent[a];c.parent&&"removeElement"in c.parent?c.parent.removeElement(c):c.owner&&"removeElement"in c.owner&&c.owner.removeElement(c);this.elementAdded(c,a)}};Object.defineProperty(a.prototype,"numElements",{get:function(){return this._elementsContent.length},enumerable:!0,configurable:!0});a.prototype.getElementAt=function(b){this.checkForRangeError(b);return this._elementsContent[b]};a.prototype.checkForRangeError=function(b,a){"undefined"===typeof a&&(a=!1);var c=this._elementsContent.length-
- 1;a&&c++;if(0>b||b>c)throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};a.prototype.addElement=function(b){var a=this.numElements;b.parent==this&&(a=this.numElements-1);return this.addElementAt(b,a)};a.prototype.addElementAt=function(b,a){if(b==this)return b;this.checkForRangeError(a,!0);var c=b.parent;if(c==this)return this.setElementIndex(b,a),b;c&&"removeElement"in c?c.removeElement(b):b.owner&&"removeElement"in b.owner&&b.owner.removeElement(b);
- this._elementsContent.splice(a,0,b);this.elementsContentChanged||this.elementAdded(b,a);return b};a.prototype.removeElement=function(b){return this.removeElementAt(this.getElementIndex(b))};a.prototype.removeElementAt=function(b){this.checkForRangeError(b);var a=this._elementsContent[b];this.elementsContentChanged||this.elementRemoved(a,b);this._elementsContent.splice(b,1);return a};a.prototype.removeAllElements=function(){for(var b=this.numElements-1;0<=b;b--)this.removeElementAt(b)};a.prototype.getElementIndex=
- function(b){return this._elementsContent.indexOf(b)};a.prototype.setElementIndex=function(b,a){this.checkForRangeError(a);var c=this.getElementIndex(b);-1==c||c==a||(this.elementsContentChanged||this.elementRemoved(b,c,!1),this._elementsContent.splice(c,1),this._elementsContent.splice(a,0,b),this.elementsContentChanged||this.elementAdded(b,a,!1))};a.prototype.swapElements=function(b,a){this.swapElementsAt(this.getElementIndex(b),this.getElementIndex(a))};a.prototype.swapElementsAt=function(b,a){this.checkForRangeError(b);
- this.checkForRangeError(a);if(b>a){var c=a;a=b;b=c}else if(b==a)return;var c=this._elementsContent[b],d=this._elementsContent[a];this.elementsContentChanged||(this.elementRemoved(c,b,!1),this.elementRemoved(d,a,!1));this._elementsContent.splice(a,1);this._elementsContent.splice(b,1);this._elementsContent.splice(b,0,d);this._elementsContent.splice(a,0,c);this.elementsContentChanged||(this.elementAdded(d,b,!1),this.elementAdded(c,a,!1))};a.prototype.elementAdded=function(b,a,d){"undefined"===typeof d&&
- (d=!0);b instanceof c.DisplayObject&&this._addToDisplayList(b,a);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_ADD,!1,!1,b,a));this.invalidateSize();this.invalidateDisplayList()};a.prototype.elementRemoved=function(b,a,e){"undefined"===typeof e&&(e=!0);e&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_REMOVE,
- !1,!1,b,a));b&&b.parent==this&&d.prototype.removeChild.call(this,b);this.invalidateSize();this.invalidateDisplayList()};a.prototype._addToDisplayList=function(b,a){"undefined"===typeof a&&(a=-1);b.parent==this?d.prototype.setChildIndex.call(this,b,-1!=a?a:this.numChildren-1):d.prototype.addChildAt.call(this,b,-1!=a?a:this.numChildren)};a.prototype.addChild=function(b){throw Error("addChild()"+a.errorStr+"addElement()\u4ee3\u66ff");};a.prototype.addChildAt=function(b,c){throw Error("addChildAt()"+
- a.errorStr+"addElementAt()\u4ee3\u66ff");};a.prototype.removeChild=function(b){throw Error("removeChild()"+a.errorStr+"removeElement()\u4ee3\u66ff");};a.prototype.removeChildAt=function(b){throw Error("removeChildAt()"+a.errorStr+"removeElementAt()\u4ee3\u66ff");};a.prototype.setChildIndex=function(b,c){throw Error("setChildIndex()"+a.errorStr+"setElementIndex()\u4ee3\u66ff");};a.prototype.swapChildren=function(b,c){throw Error("swapChildren()"+a.errorStr+"swapElements()\u4ee3\u66ff");};a.prototype.swapChildrenAt=
- function(b,c){throw Error("swapChildrenAt()"+a.errorStr+"swapElementsAt()\u4ee3\u66ff");};a.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return a}(c.GroupBase);c.Group=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._createAllChildren=!1;this.proposedSelectedIndex=a.NO_PROPOSED_SELECTION;this._selectedIndex=-1;this.childOrderingChanged=this.notifyTabBar=!1;this._setLayout(new c.BasicLayout)}__extends(a,d);Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(b){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"createAllChildren",{get:function(){return this._createAllChildren},set:function(b){if(this._createAllChildren!=
- b&&(this._createAllChildren=b)){b=this.getElementsContent();for(var a=b.length,d=0;d<a;d++){var e=b[d];e instanceof c.DisplayObject&&e.parent!=this&&(this.childOrderingChanged=!0,this._addToDisplayList(e))}this.childOrderingChanged&&this.invalidateProperties()}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedChild",{get:function(){var b=this.selectedIndex;return 0<=b&&b<this.numElements?this.getElementAt(b):null},set:function(b){b=this.getElementIndex(b);0<=b&&b<this.numElements&&
- this.setSelectedIndex(b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedIndex",{get:function(){return this.proposedSelectedIndex!=a.NO_PROPOSED_SELECTION?this.proposedSelectedIndex:this._selectedIndex},set:function(b){this.setSelectedIndex(b)},enumerable:!0,configurable:!0});a.prototype.setSelectedIndex=function(b,a){"undefined"===typeof a&&(a=!0);b!=this.selectedIndex&&(this.proposedSelectedIndex=b,this.invalidateProperties(),this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)),
- this.notifyTabBar=this.notifyTabBar||a)};a.prototype.elementAdded=function(b,a,d){"undefined"===typeof d&&(d=!0);this._createAllChildren&&b instanceof c.DisplayObject&&this._addToDisplayList(b,a);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_ADD,!1,!1,b,a));b.visible=!1;b.includeInLayout=!1;-1==this.selectedIndex?this.setSelectedIndex(a,!1):a<=this.selectedIndex&&this.initialized&&this.setSelectedIndex(this.selectedIndex+
- 1);this.dispatchCoEvent(c.CollectionEventKind.ADD,a,-1,[b.name])};a.prototype.elementRemoved=function(b,a,e){"undefined"===typeof e&&(e=!0);d.prototype.elementRemoved.call(this,b,a,e);b.visible=!0;b.includeInLayout=!0;a==this.selectedIndex?0<this.numElements?0==a?(this.proposedSelectedIndex=0,this.invalidateProperties()):this.setSelectedIndex(0,!1):this.setSelectedIndex(-1):a<this.selectedIndex&&this.setSelectedIndex(this.selectedIndex-1);this.dispatchCoEvent(c.CollectionEventKind.REMOVE,a,-1,[b.name])};
- a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.proposedSelectedIndex!=a.NO_PROPOSED_SELECTION&&(this.commitSelection(this.proposedSelectedIndex),this.proposedSelectedIndex=a.NO_PROPOSED_SELECTION);if(this.childOrderingChanged){this.childOrderingChanged=!1;for(var b=this.getElementsContent(),e=b.length,m=0;m<e;m++){var h=b[m];h instanceof c.DisplayObject&&h.parent==this&&this._addToDisplayList(h)}}this.notifyTabBar&&(this.notifyTabBar=!0,this.dispatchEvent(new c.Event("IndexChanged")))};
- a.prototype.commitSelection=function(b){0<=b&&b<this.numElements?(this._selectedIndex=b,this._selectedChild&&this._selectedChild.parent==this&&(this._selectedChild.visible=!1,this._selectedChild.includeInLayout=!1),this._selectedChild=this.getElementAt(this._selectedIndex),this._selectedChild.visible=!0,this._selectedChild.includeInLayout=!0,this._selectedChild.parent!=this&&this._selectedChild instanceof c.DisplayObject&&(this._addToDisplayList(this._selectedChild),this.childOrderingChanged||(this.childOrderingChanged=
- !0))):(this._selectedChild=null,this._selectedIndex=-1);this.invalidateSize();this.invalidateDisplayList()};Object.defineProperty(a.prototype,"length",{get:function(){return this.numElements},enumerable:!0,configurable:!0});a.prototype.getItemAt=function(b){return(b=this.getElementAt(b))?b.name:""};a.prototype.getItemIndex=function(b){for(var a=this.getElementsContent(),c=a.length,d=0;d<c;d++)if(a[d].name===b)return d;return-1};a.prototype.dispatchCoEvent=function(b,a,d,e,g){"undefined"===typeof b&&
- (b=null);"undefined"===typeof a&&(a=-1);"undefined"===typeof d&&(d=-1);"undefined"===typeof e&&(e=null);"undefined"===typeof g&&(g=null);b=new c.CollectionEvent(c.CollectionEvent.COLLECTION_CHANGE,!1,!1,b,a,d,e,g);this.dispatchEvent(b)};a.NO_PROPOSED_SELECTION=-2;return a}(c.Group);c.ViewStack=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.stateClientHelper=new c.StateClientHelper(this)}__extends(a,d);Object.defineProperty(a.prototype,"hostComponent",{get:function(){return this._hostComponent},set:function(b){this._hostComponent=b},enumerable:!0,configurable:!0});a.prototype.createChildren=function(){d.prototype.createChildren.call(this);this.stateClientHelper.initializeStates()};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.stateClientHelper.currentStateChanged&&
- (this.stateClientHelper.commitCurrentState(),this.commitCurrentState())};Object.defineProperty(a.prototype,"states",{get:function(){return this.stateClientHelper.states},set:function(b){this.stateClientHelper.states=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"currentState",{get:function(){return this.stateClientHelper.currentState},set:function(b){this.stateClientHelper.currentState=b;this.stateClientHelper.currentStateChanged&&(this.initialized||this.parent?(this.stateClientHelper.commitCurrentState(),
- this.commitCurrentState()):this.invalidateProperties())},enumerable:!0,configurable:!0});a.prototype.hasState=function(b){return this.stateClientHelper.hasState(b)};a.prototype.commitCurrentState=function(){};return a}(c.Group);c.Skin=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.maxWidth=1E4;this.minWidth=0;this.maxHeight=1E4;this.minHeight=0;this.height=this.width=NaN;this.y=this.x=0;this.percentHeight=this.percentWidth=NaN;this._elementsContent=[];this.stateClientHelper=new c.StateClientHelper(this)}__extends(a,d);Object.defineProperty(a.prototype,"states",{get:function(){return this.stateClientHelper.states},set:function(b){this.stateClientHelper.states=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "currentState",{get:function(){return this.stateClientHelper.currentState},set:function(b){this.stateClientHelper.currentState=b;this._hostComponent&&this.stateClientHelper.currentStateChanged&&(this.stateClientHelper.commitCurrentState(),this.commitCurrentState())},enumerable:!0,configurable:!0});a.prototype.hasState=function(b){return this.stateClientHelper.hasState(b)};a.prototype.commitCurrentState=function(){};Object.defineProperty(a.prototype,"hostComponent",{get:function(){return this._hostComponent},
- set:function(b){if(this._hostComponent!=b){var a;if(this._hostComponent)for(a=this._elementsContent.length-1;0<=a;a--)this.elementRemoved(this._elementsContent[a],a);if(this._hostComponent=b){b=this._elementsContent.length;for(a=0;a<b;a++){var c=this._elementsContent[a];c.parent&&"removeElement"in c.parent?c.parent.removeElement(c):c.owner&&"removeElement"in c.owner&&c.owner.removeElement(c);this.elementAdded(c,a)}this.stateClientHelper.initializeStates();this.stateClientHelper.currentStateChanged&&
- (this.stateClientHelper.commitCurrentState(),this.commitCurrentState())}}},enumerable:!0,configurable:!0});a.prototype.getElementsContent=function(){return this._elementsContent};Object.defineProperty(a.prototype,"elementsContent",{set:function(b){null==b&&(b=[]);if(b!=this._elementsContent)if(this._hostComponent){var a;for(a=this._elementsContent.length-1;0<=a;a--)this.elementRemoved(this._elementsContent[a],a);this._elementsContent=b.concat();b=this._elementsContent.length;for(a=0;a<b;a++){var c=
- this._elementsContent[a];c.parent&&"removeElement"in c.parent?c.parent.removeElement(c):c.owner&&"removeElement"in c.owner&&c.owner.removeElement(c);this.elementAdded(c,a)}}else this._elementsContent=b.concat()},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numElements",{get:function(){return this._elementsContent.length},enumerable:!0,configurable:!0});a.prototype.getElementAt=function(b){this.checkForRangeError(b);return this._elementsContent[b]};a.prototype.checkForRangeError=
- function(b,a){"undefined"===typeof a&&(a=!1);var c=this._elementsContent.length-1;a&&c++;if(0>b||b>c)throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};a.prototype.addElement=function(b){var a=this.numElements;b.owner==this&&(a=this.numElements-1);return this.addElementAt(b,a)};a.prototype.addElementAt=function(b,a){this.checkForRangeError(a,!0);var c=b.owner;if(c==this)return this.setElementIndex(b,a),b;b.parent&&"removeElement"in b.parent?
- b.parent.removeElement(b):c&&"removeElement"in c&&c.removeElement(b);this._elementsContent.splice(a,0,b);this._hostComponent&&this.elementAdded(b,a);return b};a.prototype.removeElement=function(b){return this.removeElementAt(this.getElementIndex(b))};a.prototype.removeElementAt=function(b){this.checkForRangeError(b);var a=this._elementsContent[b];this._hostComponent&&this.elementRemoved(a,b);this._elementsContent.splice(b,1);return a};a.prototype.getElementIndex=function(b){return this._elementsContent.indexOf(b)};
- a.prototype.setElementIndex=function(b,a){this.checkForRangeError(a);var c=this.getElementIndex(b);-1==c||c==a||(this._hostComponent&&this.elementRemoved(b,c,!1),this._elementsContent.splice(c,1),this._elementsContent.splice(a,0,b),this._hostComponent&&this.elementAdded(b,a,!1))};a.prototype.elementAdded=function(b,a,d){"undefined"===typeof d&&(d=!0);b.ownerChanged(this);b instanceof c.DisplayObject&&this._hostComponent._addToDisplayListAt(b,a);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD)&&
- this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_ADD,!1,!1,b,a));this._hostComponent.invalidateSize();this._hostComponent.invalidateDisplayList()};a.prototype.elementRemoved=function(b,a,d){"undefined"===typeof d&&(d=!0);d&&this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE)&&this.dispatchEvent(new c.ElementExistenceEvent(c.ElementExistenceEvent.ELEMENT_REMOVE,!1,!1,b,a));b&&b.parent==this._hostComponent&&this._hostComponent._removeFromDisplayList(b);b.ownerChanged(null);
- this._hostComponent.invalidateSize();this._hostComponent.invalidateDisplayList()};return a}(c.EventDispatcher);c.StateSkin=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.useVirtualLayoutChanged=!1;this.rendererToClassMap=[];this.freeRenderers=[];this.dataProviderChanged=this.createNewRendererFlag=!1;this.recyclerDic=[];this.typicalItemChanged=this.virtualLayoutUnderway=this.itemRendererSkinNameChange=!1;this.indexToRenderer=[];this.renderersBeingUpdated=this.cleanFreeRenderer=!1}__extends(a,d);Object.defineProperty(a.prototype,"rendererOwner",{get:function(){return this._rendererOwner},set:function(b){this._rendererOwner=
- b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(b){b!=this.layout&&(this.layout&&(this.layout.typicalLayoutRect=null,this.layout.removeEventListener("useVirtualLayoutChanged",this.layout_useVirtualLayoutChangedHandler,this)),this.layout&&(b&&this.layout.useVirtualLayout!=b.useVirtualLayout)&&this.changeUseVirtualLayout(),this._setLayout(b),b&&(b.typicalLayoutRect=this.typicalLayoutRect,b.addEventListener("useVirtualLayoutChanged",
- this.layout_useVirtualLayoutChangedHandler,this)))},enumerable:!0,configurable:!0});a.prototype.layout_useVirtualLayoutChangedHandler=function(b){this.changeUseVirtualLayout()};a.prototype.setVirtualElementIndicesInView=function(b,a){if(this.layout&&this.layout.useVirtualLayout){this.virtualRendererIndices=[];for(var c=b;c<=a;c++)this.virtualRendererIndices.push(c);for(var d in this.indexToRenderer)-1==this.virtualRendererIndices.indexOf(d)&&this.freeRendererByIndex(d)}};a.prototype.getVirtualElementAt=
- function(b){if(0>b||b>=this.dataProvider.length)return null;var a=this.indexToRenderer[b];if(!a){var a=this.dataProvider.getItemAt(b),d=this.createVirtualRenderer(b);this.indexToRenderer[b]=d;this.updateRenderer(d,b,a);this.createNewRendererFlag&&("validateNow"in d&&d.validateNow(),this.createNewRendererFlag=!1,this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_ADD,!1,!1,d,b,a)));a=d}return a};a.prototype.freeRendererByIndex=function(b){if(this.indexToRenderer[b]){var a=
- this.indexToRenderer[b];delete this.indexToRenderer[b];a&&a instanceof c.DisplayObject&&this.doFreeRenderer(a)}};a.prototype.doFreeRenderer=function(b){var a=this.rendererToClassMap[b.hashCode].hashCode;this.freeRenderers[a]||(this.freeRenderers[a]=[]);this.freeRenderers[a].push(b);b.visible=!1};a.prototype.invalidateSize=function(){this.createNewRendererFlag||d.prototype.invalidateSize.call(this)};a.prototype.createVirtualRenderer=function(b){b=this.dataProvider.getItemAt(b);b=this.itemToRendererClass(b);
- var a=b.hashCode,c=this.freeRenderers;if(c[a]&&0<c[a].length)return b=c[a].pop(),b.visible=!0,b;this.createNewRendererFlag=!0;return this.createOneRenderer(b)};a.prototype.createOneRenderer=function(b){var a,e=b.hashCode,h=this.recyclerDic[e];h&&(a=h.pop(),0==h.length&&delete this.recyclerDic[e]);a||(a=b.newInstance(),this.rendererToClassMap[a.hashCode]=b);if(!a||!(a instanceof c.DisplayObject))return null;this._itemRendererSkinName&&this.setItemRenderSkinName(a);d.prototype.addChild.call(this,a);
- a.setLayoutBoundsSize(NaN,NaN);return a};a.prototype.setItemRenderSkinName=function(b){b&&(b?b.skinNameExplicitlySet||(b.skinName=this._itemRendererSkinName):b&&!b.skinName&&(b.skinName=this._itemRendererSkinName))};a.prototype.finishVirtualLayout=function(){if(this.virtualLayoutUnderway){var b=this.virtualLayoutUnderway=!1,a;for(a in this.freeRenderers)if(0<this.freeRenderers[a].length){b=!0;break}b&&(this.cleanTimer||(this.cleanTimer=new c.Timer(3E3,1),this.cleanTimer.addEventListener(c.TimerEvent.TIMER,
- this.cleanAllFreeRenderer,this)),this.cleanTimer.reset(),this.cleanTimer.start())}};a.prototype.cleanAllFreeRenderer=function(b){var a=this.freeRenderers,c;for(c in a)for(var d=a[c],e=d.length,k=0;k<e;k++)b=d[k],b.visible=!0,this.recycle(b);this.freeRenderers=[];this.cleanFreeRenderer=!1};a.prototype.getElementIndicesInView=function(){return this.layout&&this.layout.useVirtualLayout?this.virtualRendererIndices?this.virtualRendererIndices:[]:d.prototype.getElementIndicesInView.call(this)};a.prototype.changeUseVirtualLayout=
- function(){this.cleanFreeRenderer=this.useVirtualLayoutChanged=!0;this.removeDataProviderListener();this.invalidateProperties()};Object.defineProperty(a.prototype,"dataProvider",{get:function(){return this._dataProvider},set:function(b){this._dataProvider!=b&&(this.removeDataProviderListener(),this._dataProvider=b,this.cleanFreeRenderer=this.dataProviderChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.removeDataProviderListener=
- function(){this._dataProvider&&this._dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this)};a.prototype.onCollectionChange=function(b){switch(b.kind){case c.CollectionEventKind.ADD:this.itemAddedHandler(b.items,b.location);break;case c.CollectionEventKind.MOVE:this.itemMovedHandler(b.items[0],b.location,b.oldLocation);break;case c.CollectionEventKind.REMOVE:this.itemRemovedHandler(b.items,b.location);break;case c.CollectionEventKind.UPDATE:this.itemUpdatedHandler(b.items[0],
- b.location);break;case c.CollectionEventKind.REPLACE:this.itemRemoved(b.oldItems[0],b.location);this.itemAdded(b.items[0],b.location);break;case c.CollectionEventKind.RESET:case c.CollectionEventKind.REFRESH:if(this.layout&&this.layout.useVirtualLayout)for(var a in this.indexToRenderer)this.freeRendererByIndex(a);this.dataProviderChanged=!0;this.invalidateProperties()}this.invalidateSize();this.invalidateDisplayList()};a.prototype.itemAddedHandler=function(b,a){for(var c=b.length,d=0;d<c;d++)this.itemAdded(b[d],
- a+d);this.resetRenderersIndices()};a.prototype.itemMovedHandler=function(b,a,c){this.itemRemoved(b,c);this.itemAdded(b,a);this.resetRenderersIndices()};a.prototype.itemRemovedHandler=function(b,a){for(var c=b.length-1;0<=c;c--)this.itemRemoved(b[c],a+c);this.resetRenderersIndices()};a.prototype.itemAdded=function(b,a){this.layout&&this.layout.elementAdded(a);if(this.layout&&this.layout.useVirtualLayout){var d=this.virtualRendererIndices;if(d){for(var e=d.length,g=0;g<e;g++){var k=d[g];k>=a&&(d[g]=
- k+1)}this.indexToRenderer.splice(a,0,null)}}else d=this.itemToRendererClass(b),d=this.createOneRenderer(d),this.indexToRenderer.splice(a,0,d),d&&(this.updateRenderer(d,a,b),this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_ADD,!1,!1,d,a,b)))};a.prototype.itemRemoved=function(b,a){this.layout&&this.layout.elementRemoved(a);var d=this.virtualRendererIndices;if(d&&0<d.length){for(var e=-1,g=d.length,k=0;k<g;k++){var l=d[k];l==a?e=k:l>a&&(d[k]=l-1)}-1!=e&&d.splice(e,1)}d=
- this.indexToRenderer[a];this.indexToRenderer.length>a&&this.indexToRenderer.splice(a,1);this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_REMOVE,!1,!1,d,a,b));d&&d instanceof c.DisplayObject&&(this.recycle(d),this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_REMOVE,!1,!1,d,d.itemIndex,d.data)))};a.prototype.recycle=function(b){d.prototype.removeChild.call(this,b);"ownerChanged"in b&&b.ownerChanged(null);var a=this.rendererToClassMap[b.hashCode].hashCode;
- this.recyclerDic[a]||(this.recyclerDic[a]=new c.Recycler);this.recyclerDic[a].push(b)};a.prototype.resetRenderersIndices=function(){if(0!=this.indexToRenderer.length)if(this.layout&&this.layout.useVirtualLayout)for(var b=this.virtualRendererIndices,a=b.length,c=0;c<a;c++){var d=b[c];this.resetRendererItemIndex(d)}else{b=this.indexToRenderer.length;for(d=0;d<b;d++)this.resetRendererItemIndex(d)}};a.prototype.itemUpdatedHandler=function(b,a){if(!this.renderersBeingUpdated){var c=this.indexToRenderer[a];
- c&&this.updateRenderer(c,a,b)}};a.prototype.resetRendererItemIndex=function(b){var a=this.indexToRenderer[b];a&&(a.itemIndex=b)};Object.defineProperty(a.prototype,"itemRenderer",{get:function(){return this._itemRenderer},set:function(b){this._itemRenderer!==b&&(this._itemRenderer=b,this.cleanFreeRenderer=this.typicalItemChanged=this.itemRendererChanged=!0,this.removeDataProviderListener(),this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"itemRendererSkinName",
- {get:function(){return this._itemRendererSkinName},set:function(b){if(this._itemRendererSkinName!=b&&(this._itemRendererSkinName=b)&&this.initialized)this.itemRendererSkinNameChange=!0,this.invalidateProperties()},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"itemRendererFunction",{get:function(){return this._itemRendererFunction},set:function(b){this._itemRendererFunction!=b&&(this._itemRendererFunction=b,this.typicalItemChanged=this.itemRendererChanged=!0,this.removeDataProviderListener(),
- this.invalidateProperties())},enumerable:!0,configurable:!0});a.prototype.itemToRendererClass=function(b){null!=this._itemRendererFunction?(b=this._itemRendererFunction(b),b||(b=this._itemRenderer)):b=this._itemRenderer;return b?b:a.defaultRendererFactory};a.prototype.createChildren=function(){if(!this.layout){var b=new c.VerticalLayout;b.gap=0;b.horizontalAlign=c.HorizontalAlign.CONTENT_JUSTIFY;this.layout=b}d.prototype.createChildren.call(this)};a.prototype.commitProperties=function(){if(this.itemRendererChanged||
- this.dataProviderChanged||this.useVirtualLayoutChanged)this.removeAllRenderers(),this.layout&&this.layout.clearVirtualLayoutCache(),this.setTypicalLayoutRect(null),this.itemRendererChanged=this.useVirtualLayoutChanged=!1,this._dataProvider&&this._dataProvider.addEventListener(c.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this),this.layout&&this.layout.useVirtualLayout?(this.invalidateSize(),this.invalidateDisplayList()):this.createRenderers(),this.dataProviderChanged&&(this.dataProviderChanged=
- !1,this.verticalScrollPosition=this.horizontalScrollPosition=0);d.prototype.commitProperties.call(this);this.typicalItemChanged&&(this.typicalItemChanged=!1,this._dataProvider&&0<this._dataProvider.length&&(this.typicalItem=this._dataProvider.getItemAt(0),this.measureRendererSize()));if(this.itemRendererSkinNameChange){this.itemRendererSkinNameChange=!1;for(var b=this.indexToRenderer.length,a=0;a<b;a++)this.setItemRenderSkinName(this.indexToRenderer[a]);var e=this.freeRenderers,h;for(h in e){var g=
- e[h];if(g){b=g.length;for(a=0;a<b;a++)this.setItemRenderSkinName(g[a])}}}};a.prototype.measure=function(){this.layout&&this.layout.useVirtualLayout&&this.ensureTypicalLayoutElement();d.prototype.measure.call(this)};a.prototype.updateDisplayList=function(b,a){this.layoutInvalidateDisplayListFlag&&(this.layout&&this.layout.useVirtualLayout)&&(this.virtualLayoutUnderway=!0,this.ensureTypicalLayoutElement());d.prototype.updateDisplayList.call(this,b,a);this.virtualLayoutUnderway&&this.finishVirtualLayout()};
- a.prototype.ensureTypicalLayoutElement=function(){!this.layout.typicalLayoutRect&&(this._dataProvider&&0<this._dataProvider.length)&&(this.typicalItem=this._dataProvider.getItemAt(0),this.measureRendererSize())};a.prototype.measureRendererSize=function(){if(this.typicalItem){var b=this.itemToRendererClass(this.typicalItem);if(b=this.createOneRenderer(b)){this.createNewRendererFlag=!0;this.updateRenderer(b,0,this.typicalItem);"validateNow"in b&&b.validateNow();var a=new c.Rectangle(0,0,b.preferredWidth,
- b.preferredHeight);this.recycle(b);this.setTypicalLayoutRect(a);this.createNewRendererFlag=!1}else this.setTypicalLayoutRect(null)}else this.setTypicalLayoutRect(null)};a.prototype.setTypicalLayoutRect=function(b){this.typicalLayoutRect=b;this.layout&&(this.layout.typicalLayoutRect=b)};a.prototype.removeAllRenderers=function(){for(var b=this.indexToRenderer.length,a,d=0;d<b;d++)if(a=this.indexToRenderer[d])this.recycle(a),this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_REMOVE,
- !1,!1,a,a.itemIndex,a.data));this.indexToRenderer=[];this.virtualRendererIndices=null;this.cleanFreeRenderer&&this.cleanAllFreeRenderer()};a.prototype.createRenderers=function(){if(this._dataProvider)for(var b=0,a=this._dataProvider.length,d=0;d<a;d++){var e=this._dataProvider.getItemAt(d),g=this.itemToRendererClass(e);if(g=this.createOneRenderer(g))this.indexToRenderer[b]=g,this.updateRenderer(g,b,e),this.dispatchEvent(new c.RendererExistenceEvent(c.RendererExistenceEvent.RENDERER_ADD,!1,!1,g,b,
- e)),b++}};a.prototype.updateRenderer=function(b,a,c){this.renderersBeingUpdated=!0;this._rendererOwner?b=this._rendererOwner.updateRenderer(b,a,c):("ownerChanged"in b&&b.ownerChanged(this),b.itemIndex=a,b.label=this.itemToLabel(c),b.data=c);this.renderersBeingUpdated=!1;return b};a.prototype.itemToLabel=function(b){return b?b.toString():" "};a.prototype.getElementAt=function(b){return this.indexToRenderer[b]};a.prototype.getElementIndex=function(b){return!b?-1:this.indexToRenderer.indexOf(b)};Object.defineProperty(a.prototype,
- "numElements",{get:function(){return!this._dataProvider?0:this._dataProvider.length},enumerable:!0,configurable:!0});a.prototype.addChild=function(b){throw Error("addChild()"+a.errorStr+"addElement()\u4ee3\u66ff");};a.prototype.addChildAt=function(b,c){throw Error("addChildAt()"+a.errorStr+"addElementAt()\u4ee3\u66ff");};a.prototype.removeChild=function(b){throw Error("removeChild()"+a.errorStr+"removeElement()\u4ee3\u66ff");};a.prototype.removeChildAt=function(b){throw Error("removeChildAt()"+a.errorStr+
- "removeElementAt()\u4ee3\u66ff");};a.prototype.setChildIndex=function(b,c){throw Error("setChildIndex()"+a.errorStr+"setElementIndex()\u4ee3\u66ff");};a.prototype.swapChildren=function(b,c){throw Error("swapChildren()"+a.errorStr+"swapElements()\u4ee3\u66ff");};a.prototype.swapChildrenAt=function(b,c){throw Error("swapChildrenAt()"+a.errorStr+"swapElementsAt()\u4ee3\u66ff");};a.defaultRendererFactory=new c.ClassFactory(c.ItemRenderer);a.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
- return a}(c.GroupBase);c.DataGroup=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.contentGroupProperties={}}__extends(a,d);Object.defineProperty(a.prototype,"currentContentGroup",{get:function(){return null==this.contentGroup?(null==this._placeHolderGroup&&(this._placeHolderGroup=new c.Group,this._placeHolderGroup.visible=!1,this._addToDisplayList(this._placeHolderGroup)),this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD,this.contentGroup_elementAddedHandler,this),this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,
- this.contentGroup_elementRemovedHandler,this),this._placeHolderGroup):this.contentGroup},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"elementsContent",{set:function(b){this.currentContentGroup.elementsContent=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numElements",{get:function(){return this.currentContentGroup.numElements},enumerable:!0,configurable:!0});a.prototype.getElementAt=function(b){return this.currentContentGroup.getElementAt(b)};a.prototype.addElement=
- function(b){return this.currentContentGroup.addElement(b)};a.prototype.addElementAt=function(b,a){return this.currentContentGroup.addElementAt(b,a)};a.prototype.removeElement=function(b){return this.currentContentGroup.removeElement(b)};a.prototype.removeElementAt=function(b){return this.currentContentGroup.removeElementAt(b)};a.prototype.removeAllElements=function(){this.currentContentGroup.removeAllElements()};a.prototype.getElementIndex=function(b){return this.currentContentGroup.getElementIndex(b)};
- a.prototype.setElementIndex=function(b,a){this.currentContentGroup.setElementIndex(b,a)};a.prototype.swapElements=function(b,a){this.currentContentGroup.swapElements(b,a)};a.prototype.swapElementsAt=function(b,a){this.currentContentGroup.swapElementsAt(b,a)};Object.defineProperty(a.prototype,"layout",{get:function(){return null!=this.contentGroup?this.contentGroup.layout:this.contentGroupProperties.layout},set:function(b){null!=this.contentGroup?this.contentGroup.layout=b:this.contentGroupProperties.layout=
- b},enumerable:!0,configurable:!0});a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);if(a==this.contentGroup){void 0!==this.contentGroupProperties.layout&&(this.contentGroup.layout=this.contentGroupProperties.layout,this.contentGroupProperties={});if(this._placeHolderGroup){this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD,this.contentGroup_elementAddedHandler,this);this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,
- this.contentGroup_elementRemovedHandler,this);for(var e=this._placeHolderGroup.getElementsContent().concat(),h=this._placeHolderGroup.numElements;0<h;h--){var g=this._placeHolderGroup.removeElementAt(0);g.ownerChanged(null)}this._removeFromDisplayList(this._placeHolderGroup);this.contentGroup.elementsContent=e;for(h=e.length-1;0<=h;h--)g=e[h],g.ownerChanged(this);this._placeHolderGroup=null}this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD,this.contentGroup_elementAddedHandler,
- this);this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,this.contentGroup_elementRemovedHandler,this)}};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);if(a==this.contentGroup&&(this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD,this.contentGroup_elementAddedHandler,this),this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,this.contentGroup_elementRemovedHandler,this),this.contentGroupProperties.layout=
- this.contentGroup.layout,this.contentGroup.layout=null,0<this.contentGroup.numElements)){for(this._placeHolderGroup=new c.Group;0<this.contentGroup.numElements;)this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0));this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD,this.contentGroup_elementAddedHandler,this);this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,this.contentGroup_elementRemovedHandler,this)}};a.prototype.contentGroup_elementAddedHandler=
- function(b){b.element.ownerChanged(this);this.dispatchEvent(b)};a.prototype.contentGroup_elementRemovedHandler=function(b){b.element.ownerChanged(null);this.dispatchEvent(b)};a.prototype.createSkinParts=function(){this.contentGroup=new c.Group;this.contentGroup.percentWidth=100;this.contentGroup.percentHeight=100;this._addToDisplayList(this.contentGroup);this.partAdded("contentGroup",this.contentGroup)};a.prototype.removeSkinParts=function(){this.partRemoved("contentGroup",this.contentGroup);this._removeFromDisplayList(this.contentGroup);
- this.contentGroup=null};return a}(c.SkinnableComponent);c.SkinnableContainer=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._dataGroupProperties={}}__extends(a,d);a.prototype.updateRenderer=function(b,a,c){"ownerChanged"in b&&b.ownerChanged(this);b.itemIndex=a;b.label=this.itemToLabel(c);b.data=c;return b};a.prototype.itemToLabel=function(b){return null!==b?b.toString():" "};Object.defineProperty(a.prototype,"dataProvider",{get:function(){return this._getDataProvider()},set:function(b){this._setDataProvider(b)},enumerable:!0,configurable:!0});a.prototype._getDataProvider=
- function(){return null!=this.dataGroup?this.dataGroup.dataProvider:this._dataGroupProperties.dataProvider};a.prototype._setDataProvider=function(b){null==this.dataGroup?this._dataGroupProperties.dataProvider=b:(this.dataGroup.dataProvider=b,this._dataGroupProperties.dataProvider=!0)};Object.defineProperty(a.prototype,"itemRenderer",{get:function(){return this.dataGroup?this.dataGroup.itemRenderer:this._dataGroupProperties.itemRenderer},set:function(b){null==this.dataGroup?this._dataGroupProperties.itemRenderer=
- b:(this.dataGroup.itemRenderer=b,this._dataGroupProperties.itemRenderer=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"itemRendererSkinName",{get:function(){return this.dataGroup?this.dataGroup.itemRendererSkinName:this._dataGroupProperties.itemRendererSkinName},set:function(b){null==this.dataGroup?this._dataGroupProperties.itemRendererSkinName=b:(this.dataGroup.itemRendererSkinName=b,this._dataGroupProperties.itemRendererSkinName=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "itemRendererFunction",{get:function(){return this.dataGroup?this.dataGroup.itemRendererFunction:this._dataGroupProperties.itemRendererFunction},set:function(b){null==this.dataGroup?this._dataGroupProperties.itemRendererFunction=b:(this.dataGroup.itemRendererFunction=b,this._dataGroupProperties.itemRendererFunction=!0)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layout",{get:function(){return this.dataGroup?this.dataGroup.layout:this._dataGroupProperties.layout},set:function(b){this._setLayout(b)},
- enumerable:!0,configurable:!0});a.prototype._setLayout=function(b){null==this.dataGroup?this._dataGroupProperties.layout=b:(this.dataGroup.layout=b,this._dataGroupProperties.layout=!0)};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);if(a==this.dataGroup){var e={};void 0!==this._dataGroupProperties.layout&&(this.dataGroup.layout=this._dataGroupProperties.layout,e.layout=!0);void 0!==this._dataGroupProperties.dataProvider&&(this.dataGroup.dataProvider=this._dataGroupProperties.dataProvider,
- e.dataProvider=!0);void 0!==this._dataGroupProperties.itemRenderer&&(this.dataGroup.itemRenderer=this._dataGroupProperties.itemRenderer,e.itemRenderer=!0);void 0!==this._dataGroupProperties.itemRendererSkinName&&(this.dataGroup.itemRendererSkinName=this._dataGroupProperties.itemRendererSkinName,e.itemRendererSkinName=!0);void 0!==this._dataGroupProperties.itemRendererFunction&&(this.dataGroup.itemRendererFunction=this._dataGroupProperties.itemRendererFunction,e.itemRendererFunction=!0);this.dataGroup.rendererOwner=
- this;this._dataGroupProperties=e;this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD)&&this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,this);this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE)&&this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this)}};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);if(a==this.dataGroup){this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD,
- this.dispatchEvent,this);this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this);var e={};this._dataGroupProperties.layout&&(e.layout=this.dataGroup.layout);this._dataGroupProperties.dataProvider&&(e.dataProvider=this.dataGroup.dataProvider);this._dataGroupProperties.itemRenderer&&(e.itemRenderer=this.dataGroup.itemRenderer);this._dataGroupProperties.itemRendererSkinName&&(e.itemRendererSkinName=this.dataGroup.itemRendererSkinName);this._dataGroupProperties.itemRendererFunction&&
- (e.itemRendererFunction=this.dataGroup.itemRendererFunction);this._dataGroupProperties=e;this.dataGroup.rendererOwner=null;this.dataGroup.dataProvider=null;this.dataGroup.layout=null}};a.prototype.addEventListener=function(b,a,e,h,g){"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=0);d.prototype.addEventListener.call(this,b,a,e,h,g);b==c.RendererExistenceEvent.RENDERER_ADD&&this.dataGroup&&this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,this);b==
- c.RendererExistenceEvent.RENDERER_REMOVE&&this.dataGroup&&this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this)};a.prototype.removeEventListener=function(b,a,e,h){"undefined"===typeof h&&(h=!1);d.prototype.removeEventListener.call(this,b,a,e,h);b==c.RendererExistenceEvent.RENDERER_ADD&&this.dataGroup&&(this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD)||this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,
- this));b==c.RendererExistenceEvent.RENDERER_REMOVE&&this.dataGroup&&(this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE)||this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this))};a.prototype.createSkinParts=function(){this.dataGroup=new c.DataGroup;this.dataGroup.percentHeight=this.dataGroup.percentWidth=100;this.dataGroup.clipAndEnableScrolling=!0;var b=new c.VerticalLayout;this.dataGroup.layout=b;b.gap=0;b.horizontalAlign="contentJustify";
- this._addToDisplayList(this.dataGroup);this.partAdded("dataGroup",this.dataGroup)};a.prototype.removeSkinParts=function(){this.dataGroup&&(this.partRemoved("dataGroup",this.dataGroup),this._removeFromDisplayList(this.dataGroup),this.dataGroup=null)};return a}(c.SkinnableComponent);c.SkinnableDataContainer=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.doingWholesaleChanges=!1;this._labelField="label";this.requireSelectionChanged=this._requireSelection=!1;this._proposedSelectedIndex=a.NO_PROPOSED_SELECTION;this._selectedIndex=a.NO_SELECTION;this.selectedIndexAdjusted=this._useVirtualLayout=this.dispatchChangeAfterSelection=this.allowCustomSelectedItem=!1}__extends(a,d);a.prototype._setDataProvider=function(b){this.dataProvider&&this.dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE,
- this.dataProvider_collectionChangeHandler,this);this.doingWholesaleChanges=this.dataProviderChanged=!0;b&&b.addEventListener(c.CollectionEvent.COLLECTION_CHANGE,this.dataProvider_collectionChangeHandler,this);d.prototype._setDataProvider.call(this,b);this.invalidateProperties()};Object.defineProperty(a.prototype,"layout",{get:function(){return this.dataGroup?this.dataGroup.layout:this._dataGroupProperties.layout},set:function(b){b&&this.useVirtualLayout&&(b.useVirtualLayout=!0);this._setLayout(b)},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"labelField",{get:function(){return this._labelField},set:function(b){this._setLabelField(b)},enumerable:!0,configurable:!0});a.prototype._setLabelField=function(b){b!=this._labelField&&(this._labelField=b,this.labelFieldOrFunctionChanged=!0,this.invalidateProperties())};Object.defineProperty(a.prototype,"labelFunction",{get:function(){return this._labelFunction},set:function(b){this._setLabelFunction(b)},enumerable:!0,configurable:!0});
- a.prototype._setLabelFunction=function(b){b!=this._labelFunction&&(this._labelFunction=b,this.labelFieldOrFunctionChanged=!0,this.invalidateProperties())};Object.defineProperty(a.prototype,"requireSelection",{get:function(){return this._requireSelection},set:function(b){this._setRequireSelection(b)},enumerable:!0,configurable:!0});a.prototype._setRequireSelection=function(b){if(b!=this._requireSelection&&(this._requireSelection=b))this.requireSelectionChanged=!0,this.invalidateProperties()};Object.defineProperty(a.prototype,
- "selectedIndex",{get:function(){return this._getSelectedIndex()},set:function(b){this._setSelectedIndex(b,!1)},enumerable:!0,configurable:!0});a.prototype._getSelectedIndex=function(){return this._proposedSelectedIndex!=a.NO_PROPOSED_SELECTION?this._proposedSelectedIndex:this._selectedIndex};a.prototype._setSelectedIndex=function(b,a){"undefined"===typeof a&&(a=!1);b!=this.selectedIndex&&(a&&(this.dispatchChangeAfterSelection=this.dispatchChangeAfterSelection||a),this._proposedSelectedIndex=b,this.invalidateProperties())};
- Object.defineProperty(a.prototype,"selectedItem",{get:function(){return void 0!==this._pendingSelectedItem?this._pendingSelectedItem:this.allowCustomSelectedItem&&this.selectedIndex==a.CUSTOM_SELECTED_ITEM?this._selectedItem:this.selectedIndex==a.NO_SELECTION||null==this.dataProvider?void 0:this.dataProvider.length>this.selectedIndex?this.dataProvider.getItemAt(this.selectedIndex):void 0},set:function(b){this.setSelectedItem(b,!1)},enumerable:!0,configurable:!0});a.prototype.setSelectedItem=function(b,
- a){"undefined"===typeof a&&(a=!1);this.selectedItem!==b&&(a&&(this.dispatchChangeAfterSelection=this.dispatchChangeAfterSelection||a),this._pendingSelectedItem=b,this.invalidateProperties())};Object.defineProperty(a.prototype,"useVirtualLayout",{get:function(){return this._getUseVirtualLayout()},set:function(b){this._setUseVirtualLayout(b)},enumerable:!0,configurable:!0});a.prototype._getUseVirtualLayout=function(){return this.layout?this.layout.useVirtualLayout:this._useVirtualLayout};a.prototype._setUseVirtualLayout=
- function(b){b!=this.useVirtualLayout&&(this._useVirtualLayout=b,this.layout&&(this.layout.useVirtualLayout=b))};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.dataProviderChanged&&(this.doingWholesaleChanges=this.dataProviderChanged=!1,0<=this.selectedIndex&&this.dataProvider&&this.selectedIndex<this.dataProvider.length?this.itemSelected(this.selectedIndex,!0):this.requireSelection?this._proposedSelectedIndex=0:this._setSelectedIndex(-1,!1));this.requireSelectionChanged&&
- (this.requireSelectionChanged=!1,this.requireSelection&&(this.selectedIndex==a.NO_SELECTION&&this.dataProvider&&0<this.dataProvider.length)&&(this._proposedSelectedIndex=0));void 0!==this._pendingSelectedItem&&(this._proposedSelectedIndex=this.dataProvider?this.dataProvider.getItemIndex(this._pendingSelectedItem):a.NO_SELECTION,this.allowCustomSelectedItem&&-1==this._proposedSelectedIndex&&(this._proposedSelectedIndex=a.CUSTOM_SELECTED_ITEM,this._selectedItem=this._pendingSelectedItem),this._pendingSelectedItem=
- void 0);var b=!1;this._proposedSelectedIndex!=a.NO_PROPOSED_SELECTION&&(b=this.commitSelection());this.selectedIndexAdjusted&&(this.selectedIndexAdjusted=!1,b||this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)));if(this.labelFieldOrFunctionChanged){if(null!=this.dataGroup)if(this.layout&&this.layout.useVirtualLayout)for(var e=this.dataGroup.getElementIndicesInView(),m=e.length,h=0;h<m;h++)b=e[h],this.updateRendererLabelProperty(b);else{e=this.dataGroup.numElements;for(b=0;b<e;b++)this.updateRendererLabelProperty(b)}this.labelFieldOrFunctionChanged=
- !1}};a.prototype.updateRendererLabelProperty=function(b){if(b=this.dataGroup.getElementAt(b))b.label=this.itemToLabel(b.data)};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.dataGroup&&(this._useVirtualLayout&&this.dataGroup.layout&&(this.dataGroup.layout.useVirtualLayout=!0),this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD,this.dataGroup_rendererAddHandler,this),this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,this.dataGroup_rendererRemoveHandler,
- this))};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);a==this.dataGroup&&(this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD,this.dataGroup_rendererAddHandler,this),this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,this.dataGroup_rendererRemoveHandler,this))};a.prototype.updateRenderer=function(b,a,c){this.itemSelected(a,this.isItemIndexSelected(a));return d.prototype.updateRenderer.call(this,b,a,c)};a.prototype.itemToLabel=
- function(b){if(null!=this._labelFunction)return this._labelFunction(b);if("string"==typeof b)return b;if(b instanceof c.XML)try{0!=b[this.labelField].length()&&(b=b[this.labelField])}catch(a){}else if(b instanceof Object)try{null!=b[this.labelField]&&(b=b[this.labelField])}catch(d){}if("string"==typeof b)return b;try{if(null!==b)return b.toString()}catch(e){}return" "};a.prototype.itemSelected=function(b,a){if(this.dataGroup){var c=this.dataGroup.getElementAt(b);null!=c&&(c.selected=a)}};a.prototype.isItemIndexSelected=
- function(b){return b==this.selectedIndex};a.prototype.commitSelection=function(b){"undefined"===typeof b&&(b=!0);var d=this.dataProvider?this.dataProvider.length-1:-1,e=this._selectedIndex;if(!this.allowCustomSelectedItem||this._proposedSelectedIndex!=a.CUSTOM_SELECTED_ITEM)if(this._proposedSelectedIndex<a.NO_SELECTION&&(this._proposedSelectedIndex=a.NO_SELECTION),this._proposedSelectedIndex>d&&(this._proposedSelectedIndex=d),this.requireSelection&&this._proposedSelectedIndex==a.NO_SELECTION&&this.dataProvider&&
- 0<this.dataProvider.length)return this._proposedSelectedIndex=a.NO_PROPOSED_SELECTION,this.dispatchChangeAfterSelection=!1;var h=this._proposedSelectedIndex;if(this.dispatchChangeAfterSelection&&(d=new c.IndexChangeEvent(c.IndexChangeEvent.CHANGING,!1,!0),d.oldIndex=this._selectedIndex,d.newIndex=this._proposedSelectedIndex,!this.dispatchEvent(d)))return this.itemSelected(this._proposedSelectedIndex,!1),this._proposedSelectedIndex=a.NO_PROPOSED_SELECTION,this.dispatchChangeAfterSelection=!1;this._selectedIndex=
- h;this._proposedSelectedIndex=a.NO_PROPOSED_SELECTION;e!=a.NO_SELECTION&&this.itemSelected(e,!1);this._selectedIndex!=a.NO_SELECTION&&this.itemSelected(this._selectedIndex,!0);b&&(this.dispatchChangeAfterSelection&&(d=new c.IndexChangeEvent(c.IndexChangeEvent.CHANGE),d.oldIndex=e,d.newIndex=this._selectedIndex,this.dispatchEvent(d),this.dispatchChangeAfterSelection=!1),this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)));return!0};a.prototype.adjustSelection=function(b,c){this._proposedSelectedIndex!=
- a.NO_PROPOSED_SELECTION?this._proposedSelectedIndex=b:this._selectedIndex=b;this.selectedIndexAdjusted=!0;this.invalidateProperties()};a.prototype.itemAdded=function(b){this.doingWholesaleChanges||(this.selectedIndex==a.NO_SELECTION?this.requireSelection&&this.adjustSelection(b,!0):b<=this.selectedIndex&&this.adjustSelection(this.selectedIndex+1,!0))};a.prototype.itemRemoved=function(b){this.selectedIndex==a.NO_SELECTION||this.doingWholesaleChanges||(b==this.selectedIndex?this.requireSelection&&this.dataProvider&&
- 0<this.dataProvider.length?0==b?(this._proposedSelectedIndex=0,this.invalidateProperties()):this._setSelectedIndex(0,!1):this.adjustSelection(-1,!1):b<this.selectedIndex&&this.adjustSelection(this.selectedIndex-1,!1))};a.prototype.dataGroup_rendererAddHandler=function(b){b=b.renderer;null!=b&&(b.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER,this.item_mouseEventHandler,this),b.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT,this.item_mouseEventHandler,this))};a.prototype.dataGroup_rendererRemoveHandler=
- function(b){b=b.renderer;null!=b&&(b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER,this.item_mouseEventHandler,this),b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT,this.item_mouseEventHandler,this))};a.prototype.item_mouseEventHandler=function(b){var c=b.type,c=a.TYPE_MAP[c];this.hasEventListener(c)&&this.dispatchListEvent(b,c,b.currentTarget)};a.prototype.dispatchListEvent=function(b,a,d){var e=-1,e=d?d.itemIndex:this.dataGroup.getElementIndex(b.currentTarget);b=new c.ListEvent(a,!1,!1,b.touchPointID,
- b.stageX,b.stageY,b.ctrlKey,b.altKey,b.shiftKey,b.touchDown,e,this.dataProvider.getItemAt(e),d);this.dispatchEvent(b)};a.prototype.dataProvider_collectionChangeHandler=function(b){var d=b.items;if(b.kind==c.CollectionEventKind.ADD)for(var d=d.length,e=0;e<d;e++)this.itemAdded(b.location+e);else if(b.kind==c.CollectionEventKind.REMOVE){d=d.length;for(e=d-1;0<=e;e--)this.itemRemoved(b.location+e)}else b.kind==c.CollectionEventKind.MOVE?(this.itemRemoved(b.oldLocation),this.itemAdded(b.location)):b.kind==
- c.CollectionEventKind.RESET?0==this.dataProvider.length?this._setSelectedIndex(a.NO_SELECTION,!1):(this.dataProviderChanged=!0,this.invalidateProperties()):b.kind==c.CollectionEventKind.REFRESH&&this._setSelectedIndex(a.NO_SELECTION,!1)};a.NO_SELECTION=-1;a.NO_PROPOSED_SELECTION=-2;a.CUSTOM_SELECTED_ITEM=-3;a.TYPE_MAP={rollOver:"itemRollOver",rollOut:"itemRollOut"};return a}(c.SkinnableDataContainer);c.ListBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this);this._title="";this.touchEnabled=!1}__extends(a,c);Object.defineProperty(a.prototype,"title",{get:function(){return this._title},set:function(b){this._title=b;this.titleDisplay&&(this.titleDisplay.text=this.title)},enumerable:!0,configurable:!0});a.prototype.partAdded=function(b,a){c.prototype.partAdded.call(this,b,a);a==this.titleDisplay&&(this.titleDisplay.text=this.title)};return a}(c.SkinnableContainer);c.Panel=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._autoBackToStage=this._showCloseButton=!0;this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.onWindowMouseDown,this,!0,100)}__extends(a,d);a.prototype.onWindowMouseDown=function(b){this.enabled&&(this.isPopUp&&b.target!=this.closeButton)&&c.PopUpManager.bringToFront(this)};Object.defineProperty(a.prototype,"showCloseButton",{get:function(){return this._showCloseButton},set:function(b){this._showCloseButton!=b&&(this._showCloseButton=b,
- this.closeButton&&(this.closeButton.visible=this._showCloseButton))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"autoBackToStage",{get:function(){return this._autoBackToStage},set:function(b){this._autoBackToStage=b},enumerable:!0,configurable:!0});a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.moveArea?this.moveArea.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.moveArea_mouseDownHandler,this):a==this.closeButton&&(this.closeButton.addEventListener(c.TouchEvent.TOUCH_TAP,
- this.closeButton_clickHandler,this),this.closeButton.visible=this._showCloseButton)};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);a==this.moveArea?this.moveArea.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.moveArea_mouseDownHandler,this):a==this.closeButton&&this.closeButton.removeEventListener(c.TouchEvent.TOUCH_TAP,this.closeButton_clickHandler,this)};a.prototype.closeButton_clickHandler=function(b){this.dispatchEvent(new c.CloseEvent(c.CloseEvent.CLOSE))};a.prototype.moveArea_mouseDownHandler=
- function(b){this.enabled&&this.isPopUp&&(b=this.globalToLocal(b.stageX,b.stageY),this._offsetPointX=b.x,this._offsetPointY=b.y,this._includeInLayout=!1,c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,this.moveArea_mouseMoveHandler,this),c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.moveArea_mouseUpHandler,this),c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.moveArea_mouseUpHandler,this))};a.prototype.moveArea_mouseMoveHandler=function(b){var a=this.globalToLocal(b.stageX,
- b.stageY);this.x+=a.x-this._offsetPointX;this.y+=a.y-this._offsetPointY;c.UIGlobals.useUpdateAfterEvent&&b.updateAfterEvent()};a.prototype.moveArea_mouseUpHandler=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.moveArea_mouseMoveHandler,this);c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.moveArea_mouseUpHandler,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.moveArea_mouseUpHandler,this);this._autoBackToStage&&this.adjustPosForStage();
- c.LayoutUtil.adjustRelativeByXY(this);this.includeInLayout=!0};a.prototype.adjustPosForStage=function(){if(this.moveArea&&this.stage){var b=this.moveArea.localToGlobal(0,0),a=b.x,c=b.y;35>b.x+this.moveArea.width&&(a=35-this.moveArea.width);b.x>this.stage.stageWidth-20&&(a=this.stage.stageWidth-20);20>b.y+this.moveArea.height&&(c=20-this.moveArea.height);b.y>this.stage.stageHeight-20&&(c=this.stage.stageHeight-20);this.x+=a-b.x;this.y+=c-b.y}};return a}(c.Panel);c.TitleWindow=e})(ns_egret||(ns_egret=
- {}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._contentText=this._secondButtonLabel=this._firstButtonLabel=""}__extends(a,d);a.show=function(b,d,e,h,g,k,l){"undefined"===typeof b&&(b="");"undefined"===typeof d&&(d="");"undefined"===typeof e&&(e=null);"undefined"===typeof h&&(h="\u786e\u5b9a");"undefined"===typeof g&&(g="");"undefined"===typeof k&&(k=!0);"undefined"===typeof l&&(l=!0);var n=new a;n.contentText=b;n.title=d;n._firstButtonLabel=h;n._secondButtonLabel=g;n.closeHandler=e;
- c.PopUpManager.addPopUp(n,k,l);return n};Object.defineProperty(a.prototype,"firstButtonLabel",{get:function(){return this._firstButtonLabel},set:function(b){this._firstButtonLabel!=b&&(this._firstButtonLabel=b,this.firstButton&&(this.firstButton.label=b))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"secondButtonLabel",{get:function(){return this._secondButtonLabel},set:function(b){if(this._secondButtonLabel!=b&&(this._secondButtonLabel=b,this.secondButton&&(null==b||""==b)))this.secondButton.includeInLayout=
- this.secondButton.visible=""!=this._secondButtonLabel&&null!=this._secondButtonLabel},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"contentText",{get:function(){return this._contentText},set:function(b){this._contentText!=b&&(this._contentText=b,this.contentDisplay&&(this.contentDisplay.text=b))},enumerable:!0,configurable:!0});a.prototype.onClose=function(b){c.PopUpManager.removePopUp(this);if(null!=this.closeHandler){var d=new c.CloseEvent(c.CloseEvent.CLOSE);switch(b.currentTarget){case this.firstButton:d.detail=
- a.FIRST_BUTTON;break;case this.secondButton:d.detail=a.SECOND_BUTTON}this.closeHandler(d)}};a.prototype.closeButton_clickHandler=function(b){d.prototype.closeButton_clickHandler.call(this,b);c.PopUpManager.removePopUp(this);b=new c.CloseEvent(c.CloseEvent.CLOSE,!1,!1,a.CLOSE_BUTTON);null!=this.closeHandler&&this.closeHandler(b)};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.contentDisplay?this.contentDisplay.text=this._contentText:a==this.firstButton?(this.firstButton.label=
- this._firstButtonLabel,this.firstButton.addEventListener(c.TouchEvent.TOUCH_TAP,this.onClose,this)):a==this.secondButton&&(this.secondButton.label=this._secondButtonLabel,this.secondButton.includeInLayout=this.secondButton.visible=""!=this._secondButtonLabel&&null!=this._secondButtonLabel,this.secondButton.addEventListener(c.TouchEvent.TOUCH_TAP,this.onClose,this))};a.prototype.partRemoved=function(b,a){d.prototype.partRemoved.call(this,b,a);a==this.firstButton?this.firstButton.removeEventListener(c.TouchEvent.TOUCH_TAP,
- this.onClose,this):a==this.secondButton&&this.secondButton.removeEventListener(c.TouchEvent.TOUCH_TAP,this.onClose,this)};a.FIRST_BUTTON="firstButton";a.SECOND_BUTTON="secondButton";a.CLOSE_BUTTON="closeButton";return a}(c.TitleWindow);c.Alert=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._slideDuration=500;this._direction=c.ProgressBarDirection.LEFT_TO_RIGHT;this.trackResizedOrMoved=!1}__extends(a,d);Object.defineProperty(a.prototype,"labelFunction",{get:function(){return this._labelFunction},set:function(b){this._labelFunction!=b&&(this._labelFunction=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.valueToLabel=function(b,a){return null!=this.labelFunction?this._labelFunction(b,a):b+" / "+
- a};Object.defineProperty(a.prototype,"slideDuration",{get:function(){return this._slideDuration},set:function(b){this._slideDuration!=b&&(this._slideDuration=b,this.animator&&this.animator.isPlaying&&(this.animator.stop(),this._setValue(this.slideToValue)))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"direction",{get:function(){return this._direction},set:function(b){this._direction!=b&&(this._direction=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "value",{get:function(){return this._getValue()},set:function(b){this._getValue()!=b&&(0==this._slideDuration||!this.stage?this._setValue(b):(this.validateProperties(),this.slideToValue=this.nearestValidValue(b,this.snapInterval),this.slideToValue!=this._getValue()&&(this.animator||(this.animator=new c.Animation(this.animationUpdateHandler,this)),this.animator.isPlaying&&(this.setValue(this.nearestValidValue(this.animator.motionPaths[0].valueTo,this.snapInterval)),this.animator.stop()),b=this._slideDuration*
- (Math.abs(this._getValue()-this.slideToValue)/(this.maximum-this.minimum)),this.animator.duration=Infinity===b?0:b,this.animator.motionPaths=[{prop:"value",from:this._getValue(),to:this.slideToValue}],this.animator.play())))},enumerable:!0,configurable:!0});a.prototype.animationUpdateHandler=function(b){this.setValue(this.nearestValidValue(b.currentValue.value,this.snapInterval))};a.prototype.setValue=function(b){d.prototype.setValue.call(this,b);this.invalidateDisplayList()};a.prototype.updateDisplayList=
- function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.updateSkinDisplayList()};a.prototype.partAdded=function(b,a){a==this.track&&this.track instanceof c.UIComponent&&(this.track.addEventListener(c.ResizeEvent.RESIZE,this.onTrackResizeOrMove,this),this.track.addEventListener(c.MoveEvent.MOVE,this.onTrackResizeOrMove,this))};a.prototype.partRemoved=function(b,a){a==this.track&&this.track instanceof c.UIComponent&&(this.track.removeEventListener(c.ResizeEvent.RESIZE,this.onTrackResizeOrMove,
- this),this.track.removeEventListener(c.MoveEvent.MOVE,this.onTrackResizeOrMove,this))};a.prototype.onTrackResizeOrMove=function(b){this.trackResizedOrMoved=!0;this.invalidateProperties()};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this.trackResizedOrMoved&&(this.trackResizedOrMoved=!1,this.updateSkinDisplayList())};a.prototype.updateSkinDisplayList=function(){this.trackResizedOrMoved=!1;var b=isNaN(this.value)?0:this.value,a=isNaN(this.maximum)?0:this.maximum;
- if(this.thumb&&this.track){var d=isNaN(this.track.width)?0:this.track.width,d=d*this.track.scaleX,e=isNaN(this.track.height)?0:this.track.height,e=e*this.track.scaleY,g=Math.round(b/a*d);if(isNaN(g)||0>g||Infinity===g)g=0;var k=Math.round(b/a*e);if(isNaN(k)||0>k||Infinity===k)k=0;var l=this.track.localToGlobal(0,0),n=this.globalToLocal(l.x,l.y),l=n.x,n=n.y;switch(this._direction){case c.ProgressBarDirection.LEFT_TO_RIGHT:this.thumb.width=g;this.thumb.x=l;break;case c.ProgressBarDirection.RIGHT_TO_LEFT:this.thumb.width=
- g;this.thumb.x=l+d-g;break;case c.ProgressBarDirection.TOP_TO_BOTTOM:this.thumb.height=k;this.thumb.y=n;break;case c.ProgressBarDirection.BOTTOM_TO_TOP:this.thumb.height=k,this.thumb.y=n+e-k}}this.labelDisplay&&(this.labelDisplay.text=this.valueToLabel(b,a))};return a}(c.Range);c.ProgressBar=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.LEFT_TO_RIGHT="leftToRight";c.RIGHT_TO_LEFT="rightToLeft";c.TOP_TO_BOTTOM="topToBottom";c.BOTTOM_TO_TOP="bottomToTop";return c}();c.ProgressBarDirection=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.pointToValue=function(b,a){if(!this.thumb||!this.track)return 0;var c=this.maximum-this.minimum,d=this.track.layoutBoundsWidth-this.thumb.layoutBoundsWidth;return this.minimum+(0!=d?b/d*c:0)};a.prototype.updateSkinDisplayList=function(){if(this.thumb&&this.track){var b=this.track.layoutBoundsWidth-this.thumb.layoutBoundsWidth,a=this.maximum-this.minimum,b=0<a?(this.pendingValue-this.minimum)/a*b:0,c=this.track.localToGlobal(b,
- 0),a=c.x,c=c.y,d=this.thumb.parent.globalToLocal(a,c).x;this.thumb.setLayoutBoundsPosition(Math.round(d),this.thumb.layoutBoundsY);this.showTrackHighlight&&(this.trackHighlight&&this.trackHighlight.parent)&&(a=this.trackHighlight.parent.globalToLocal(a,c).x-b,this.trackHighlight.x=Math.round(a),this.trackHighlight.width=Math.round(b))}};return a}(c.SliderBase);c.HSlider=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this)}__extends(a,c);a.prototype.pointToValue=function(b,a){if(!this.thumb||!this.track)return 0;var c=this.maximum-this.minimum,d=this.track.layoutBoundsHeight-this.thumb.layoutBoundsHeight;return this.minimum+(0!=d?(d-a)/d*c:0)};a.prototype.updateSkinDisplayList=function(){if(this.thumb&&this.track){var b=this.track.layoutBoundsHeight-this.thumb.layoutBoundsHeight,a=this.maximum-this.minimum,b=0<a?b-(this.pendingValue-this.minimum)/a*b:0,c=this.track.localToGlobal(0,
- b),a=c.x,c=c.y,d=this.thumb.parent.globalToLocal(a,c).y;this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX,Math.round(d));this.showTrackHighlight&&(this.trackHighlight&&this.trackHighlight.parent)&&(a=this.trackHighlight.parent.globalToLocal(a,c).y-b,this.trackHighlight.y=Math.round(a),this.trackHighlight.height=Math.round(b))}};return a}(c.SliderBase);c.VSlider=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._allowMultipleSelection=!1;this._selectedIndices=[];this.useVirtualLayout=this.captureItemRenderer=!0}__extends(a,d);a.prototype.createChildren=function(){this.itemRenderer||(this.itemRenderer=c.DataGroup.defaultRendererFactory);d.prototype.createChildren.call(this)};Object.defineProperty(a.prototype,"useVirtualLayout",{get:function(){return this._getUseVirtualLayout()},set:function(b){this._setUseVirtualLayout(b)},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"allowMultipleSelection",{get:function(){return this._allowMultipleSelection},set:function(b){this._allowMultipleSelection=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedIndices",{get:function(){return this._proposedSelectedIndices?this._proposedSelectedIndices:this._selectedIndices},set:function(b){this._setSelectedIndices(b,!1)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedIndex",{get:function(){return this._proposedSelectedIndices?
- 0<this._proposedSelectedIndices.length?this._proposedSelectedIndices[0]:-1:this._getSelectedIndex()},set:function(b){this._setSelectedIndex(b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"selectedItems",{get:function(){var b=[],a=this.selectedIndices;if(a)for(var c=a.length,d=0;d<c;d++)b[d]=this.dataProvider.getItemAt(a[d]);return b},set:function(b){var a=[];if(b)for(var c=b.length,d=0;d<c;d++){var e=this.dataProvider.getItemIndex(b[d]);-1!=e&&a.splice(0,0,e);if(-1==e){a=[];
- break}}this._setSelectedIndices(a,!1)},enumerable:!0,configurable:!0});a.prototype._setSelectedIndices=function(b,a){"undefined"===typeof a&&(a=!1);a&&(this.dispatchChangeAfterSelection=this.dispatchChangeAfterSelection||a);this._proposedSelectedIndices=b?b:[];this.invalidateProperties()};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this._proposedSelectedIndices&&this.commitSelection()};a.prototype.commitSelection=function(b){"undefined"===typeof b&&(b=!0);var a=
- this._selectedIndex;if(this._proposedSelectedIndices){this._proposedSelectedIndices=this._proposedSelectedIndices.filter(this.isValidIndex);if(!this.allowMultipleSelection&&0<this._proposedSelectedIndices.length){var e=[];e.push(this._proposedSelectedIndices[0]);this._proposedSelectedIndices=e}this._proposedSelectedIndex=0<this._proposedSelectedIndices.length?this._proposedSelectedIndices[0]:-1}e=d.prototype.commitSelection.call(this,!1);if(!e)return this._proposedSelectedIndices=null,!1;this.selectedIndex>
- c.ListBase.NO_SELECTION&&(this._proposedSelectedIndices?-1==this._proposedSelectedIndices.indexOf(this.selectedIndex)&&this._proposedSelectedIndices.push(this.selectedIndex):this._proposedSelectedIndices=[this.selectedIndex]);this._proposedSelectedIndices&&(-1!=this._proposedSelectedIndices.indexOf(a)&&this.itemSelected(a,!0),this.commitMultipleSelection());b&&e&&(this.dispatchChangeAfterSelection&&(b=new c.IndexChangeEvent(c.IndexChangeEvent.CHANGE),b.oldIndex=a,b.newIndex=this._selectedIndex,this.dispatchEvent(b),
- this.dispatchChangeAfterSelection=!1),this.dispatchEvent(new c.UIEvent(c.UIEvent.VALUE_COMMIT)));return e};a.prototype.isValidIndex=function(b,a,c){return this.dataProvider&&0<=b&&b<this.dataProvider.length};a.prototype.commitMultipleSelection=function(){var b=[],a=[],c,d;if(0<this._selectedIndices.length&&0<this._proposedSelectedIndices.length){d=this._proposedSelectedIndices.length;for(c=0;c<d;c++)-1==this._selectedIndices.indexOf(this._proposedSelectedIndices[c])&&a.push(this._proposedSelectedIndices[c]);
- d=this._selectedIndices.length;for(c=0;c<d;c++)-1==this._proposedSelectedIndices.indexOf(this._selectedIndices[c])&&b.push(this._selectedIndices[c])}else 0<this._selectedIndices.length?b=this._selectedIndices:0<this._proposedSelectedIndices.length&&(a=this._proposedSelectedIndices);this._selectedIndices=this._proposedSelectedIndices;if(0<b.length){d=b.length;for(c=0;c<d;c++)this.itemSelected(b[c],!1)}if(0<a.length){d=a.length;for(c=0;c<d;c++)this.itemSelected(a[c],!0)}this._proposedSelectedIndices=
- null};a.prototype.isItemIndexSelected=function(b){return this._allowMultipleSelection?-1!=this._selectedIndices.indexOf(b):d.prototype.isItemIndexSelected.call(this,b)};a.prototype.dataGroup_rendererAddHandler=function(b){d.prototype.dataGroup_rendererAddHandler.call(this,b);b=b.renderer;null!=b&&(b.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.item_mouseDownHandler,this),b.addEventListener(c.TouchEvent.TOUCH_END,this.item_mouseUpHandler,this))};a.prototype.dataGroup_rendererRemoveHandler=function(b){d.prototype.dataGroup_rendererRemoveHandler.call(this,
- b);b=b.renderer;null!=b&&(b.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.item_mouseDownHandler,this),b.removeEventListener(c.TouchEvent.TOUCH_END,this.item_mouseUpHandler,this))};a.prototype.item_mouseDownHandler=function(b){if(!b.isDefaultPrevented()){var a=b.currentTarget,d;d=a?a.itemIndex:this.dataGroup.getElementIndex(b.currentTarget);this._allowMultipleSelection?this._setSelectedIndices(this.calculateSelectedIndices(d,b.shiftKey,b.ctrlKey),!0):this._setSelectedIndex(d,!0);this.captureItemRenderer&&
- (this.mouseDownItemRenderer=a,c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this))}};a.prototype.calculateSelectedIndices=function(b,a,c){var d=[];if(a)if(a=0<this._selectedIndices.length?this._selectedIndices[this._selectedIndices.length-1]:0,a<b)for(;a<=b;a++)d.splice(0,0,a);else for(;a>=b;a--)d.splice(0,0,a);else if(c)if(0<this._selectedIndices.length)if(1==this._selectedIndices.length&&
- this._selectedIndices[0]==b){if(!this.requireSelection)return d;d.splice(0,0,this._selectedIndices[0])}else{c=!1;for(a=0;a<this._selectedIndices.length;a++)this._selectedIndices[a]==b?c=!0:this._selectedIndices[a]!=b&&d.splice(0,0,this._selectedIndices[a]);c||d.splice(0,0,b)}else d.splice(0,0,b);else d.splice(0,0,b);return d};a.prototype.item_mouseUpHandler=function(b){var a=b.currentTarget;a==this.mouseDownItemRenderer&&this.dispatchListEvent(b,c.ListEvent.ITEM_CLICK,a)};a.prototype.stage_mouseUpHandler=
- function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this);this.mouseDownItemRenderer=null};return a}(c.ListBase);c.List=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._displayPopUp=this._popUpWidthMatchesAnchorWidth=this._popUpHeightMatchesAnchorHeight=this.addedToStage=this.popUpIsDisplayed=!1;this._popUpPosition=c.PopUpPosition.TOP_LEFT;this.inAnimation=!1;this._animator=null;this._openDuration=250;this._closeDuration=150;this.inUpdating=!1;this.valueRange=1;this.addEventListener(c.Event.ADDED_TO_STAGE,this.addedToStageHandler,this);this.addEventListener(c.Event.REMOVED_FROM_STAGE,this.removedFromStageHandler,
- this)}__extends(a,d);Object.defineProperty(a.prototype,"popUpHeightMatchesAnchorHeight",{get:function(){return this._popUpHeightMatchesAnchorHeight},set:function(b){this._popUpHeightMatchesAnchorHeight!=b&&(this._popUpHeightMatchesAnchorHeight=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"popUpWidthMatchesAnchorWidth",{get:function(){return this._popUpWidthMatchesAnchorWidth},set:function(b){this._popUpWidthMatchesAnchorWidth!=b&&(this._popUpWidthMatchesAnchorWidth=
- b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"displayPopUp",{get:function(){return this._displayPopUp},set:function(b){this._displayPopUp!=b&&(this._displayPopUp=b,this.addOrRemovePopUp())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"popUp",{get:function(){return this._popUp},set:function(b){this._popUp!=b&&(this._popUp=b,this.dispatchEvent(new c.Event("popUpChanged")))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "popUpPosition",{get:function(){return this._popUpPosition},set:function(b){this._popUpPosition!=b&&(this._popUpPosition=b,this.invalidateDisplayList())},enumerable:!0,configurable:!0});a.prototype.updateDisplayList=function(b,a){d.prototype.updateDisplayList.call(this,b,a);this.applyPopUpTransform(b,a)};a.prototype.updatePopUpTransform=function(){this.applyPopUpTransform(this.width,this.height)};a.prototype.calculatePopUpPosition=function(){var b=new c.Point;switch(this._popUpPosition){case c.PopUpPosition.BELOW:b.x=
- 0;b.y=this.height;break;case c.PopUpPosition.ABOVE:b.x=0;b.y=-this.popUp.layoutBoundsHeight;break;case c.PopUpPosition.LEFT:b.x=-this.popUp.layoutBoundsWidth;b.y=0;break;case c.PopUpPosition.RIGHT:b.x=this.width;b.y=0;break;case c.PopUpPosition.CENTER:b.x=0.5*(this.width-this.popUp.layoutBoundsWidth),b.y=0.5*(this.height-this.popUp.layoutBoundsHeight)}b=this.localToGlobal(b.x,b.y);return b=this.popUp.parent.globalToLocal(b.x,b.y)};Object.defineProperty(a.prototype,"animator",{get:function(){if(this._animator)return this._animator;
- this._animator=new c.Animation(this.animationUpdateHandler,this);this._animator.endFunction=this.animationEndHandler;this._animator.startFunction=this.animationStartHandler;return this._animator},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"openDuration",{get:function(){return this._openDuration},set:function(b){this._openDuration=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"closeDuration",{get:function(){return this._closeDuration},set:function(b){this._closeDuration=
- b},enumerable:!0,configurable:!0});a.prototype.animationStartHandler=function(b){this.inAnimation=!0;this.popUp.addEventListener("scrollRectChange",this.onScrollRectChange,this);this.popUp&&"enabled"in this.popUp&&(this.popUp.enabled=!1)};a.prototype.onScrollRectChange=function(b){this.inUpdating||(this.inUpdating=!0,this.popUp.scrollRect=new c.Rectangle(Math.round(this.animator.currentValue.x),Math.round(this.animator.currentValue.y),this.popUp.width,this.popUp.height),this.inUpdating=!1)};a.prototype.animationUpdateHandler=
- function(b){this.inUpdating=!0;this.popUp.scrollRect=new c.Rectangle(Math.round(b.currentValue.x),Math.round(b.currentValue.y),this.popUp.width,this.popUp.height);this.inUpdating=!1};a.prototype.animationEndHandler=function(b){this.inAnimation=!1;this.popUp.removeEventListener("scrollRectChange",this.onScrollRectChange,this);this.popUp&&"enabled"in this.popUp&&(this.popUp.enabled=!0);this.popUp.scrollRect=null;this.popUpIsDisplayed||(c.PopUpManager.removePopUp(this.popUp),this.popUp.ownerChanged(null))};
- a.prototype.addOrRemovePopUp=function(){this.addedToStage&&this.popUp&&(null==this.popUp.parent&&this.displayPopUp?(c.PopUpManager.addPopUp(this.popUp,!1,!1),this.popUp.ownerChanged(this),this.popUpIsDisplayed=!0,this.inAnimation&&this.animator.end(),this.initialized?(this.applyPopUpTransform(this.width,this.height),0<this._openDuration&&this.startAnimation()):c.callLater(function(){0<this.openDuration&&this.startAnimation()},this)):null!=this.popUp.parent&&!this.displayPopUp&&this.removeAndResetPopUp())};
- a.prototype.removeAndResetPopUp=function(){this.inAnimation&&this.animator.end();this.popUpIsDisplayed=!1;0<this._closeDuration?this.startAnimation():(c.PopUpManager.removePopUp(this.popUp),this.popUp.ownerChanged(null))};a.prototype.applyPopUpTransform=function(b,a){if(this.popUpIsDisplayed){this.popUpWidthMatchesAnchorWidth&&(this.popUp.width=b);this.popUpHeightMatchesAnchorHeight&&(this.popUp.height=a);"validateNow"in this.popUp&&this.popUp.validateNow();var c=this.calculatePopUpPosition();this.popUp.x=
- c.x;this.popUp.y=c.y}};a.prototype.startAnimation=function(){this.animator.motionPaths=this.createMotionPath();this.animator.duration=this.popUpIsDisplayed?this._openDuration:this._closeDuration;this.animator.play()};a.prototype.createMotionPath=function(){var b={prop:"x"},a={prop:"y"},d=[b,a];switch(this._popUpPosition){case c.PopUpPosition.TOP_LEFT:case c.PopUpPosition.CENTER:case c.PopUpPosition.BELOW:b.from=b.to=0;a.from=this.popUp.height;a.to=0;this.valueRange=this.popUp.height;break;case c.PopUpPosition.ABOVE:b.from=
- b.to=0;a.from=-this.popUp.height;a.to=0;this.valueRange=this.popUp.height;break;case c.PopUpPosition.LEFT:a.from=a.to=0;b.from=-this.popUp.width;b.to=0;this.valueRange=this.popUp.width;break;case c.PopUpPosition.RIGHT:a.from=a.to=0;b.from=this.popUp.width;b.to=0;this.valueRange=this.popUp.width;break;default:this.valueRange=1}this.valueRange=Math.abs(this.valueRange);if(!this.popUpIsDisplayed){var e=b.from;b.from=b.to;b.to=e;e=a.from;a.from=a.to;a.to=e}return d};a.prototype.addedToStageHandler=function(b){this.addedToStage=
- !0;c.callLater(this.checkPopUpState,this)};a.prototype.checkPopUpState=function(){this.addedToStage?this.addOrRemovePopUp():null!=this.popUp&&null!=this.popUp.parent&&this.removeAndResetPopUp()};a.prototype.removedFromStageHandler=function(b){this.addedToStage=!1;c.callLater(this.checkPopUpState,this)};return a}(c.UIComponent);c.PopUpAnchor=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._isOpen=!1;this._closeOnResize=!0;this._rollOverOpenDelay=NaN}__extends(a,d);Object.defineProperty(a.prototype,"openButton",{get:function(){return this._openButton},set:function(b){this._openButton!==b&&(this.removeOpenTriggers(),this._openButton=b,this.addOpenTriggers())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dropDown",{get:function(){return this._dropDown},set:function(b){this._dropDown!==b&&(this._dropDown=
- b)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"closeOnResize",{get:function(){return this._closeOnResize},set:function(b){this._closeOnResize!=b&&(this.isOpen&&this.removeCloseOnResizeTrigger(),this._closeOnResize=b,this.addCloseOnResizeTrigger())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rollOverOpenDelay",{get:function(){return this._rollOverOpenDelay},
- set:function(b){this._rollOverOpenDelay!=b&&(this.removeOpenTriggers(),this._rollOverOpenDelay=b,this.addOpenTriggers())},enumerable:!0,configurable:!0});a.prototype.addOpenTriggers=function(){this.openButton&&(isNaN(this.rollOverOpenDelay)?this.openButton.addEventListener(c.UIEvent.BUTTON_DOWN,this.openButton_buttonDownHandler,this):this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER,this.openButton_rollOverHandler,this))};a.prototype.removeOpenTriggers=function(){this.openButton&&(isNaN(this.rollOverOpenDelay)?
- this.openButton.removeEventListener(c.UIEvent.BUTTON_DOWN,this.openButton_buttonDownHandler,this):this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER,this.openButton_rollOverHandler,this))};a.prototype.addCloseTriggers=function(){c.UIGlobals.stage&&(isNaN(this.rollOverOpenDelay)?(c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.stage_mouseDownHandler,this),c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler_noRollOverOpenDelay,this)):c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,
- this.stage_mouseMoveHandler,this),this.addCloseOnResizeTrigger())};a.prototype.removeCloseTriggers=function(){c.UIGlobals.stage&&(isNaN(this.rollOverOpenDelay)?(c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.stage_mouseDownHandler,this),c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler_noRollOverOpenDelay,this)):(c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this),c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,
- this.stage_mouseUpHandler,this),c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)),this.removeCloseOnResizeTrigger())};a.prototype.addCloseOnResizeTrigger=function(){this.closeOnResize&&c.UIGlobals.stage.addEventListener(c.Event.RESIZE,this.stage_resizeHandler,this)};a.prototype.removeCloseOnResizeTrigger=function(){this.closeOnResize&&c.UIGlobals.stage.removeEventListener(c.Event.RESIZE,this.stage_resizeHandler,this)};a.prototype.isTargetOverDropDownOrOpenButton=
- function(b){if(b){if(this.openButton&&this.openButton.contains(b))return!0;if(null!=this.hitAreaAdditions)for(var a=0;a<this.hitAreaAdditions.length;a++)if(this.hitAreaAdditions[a]==b||this.hitAreaAdditions[a]instanceof c.DisplayObjectContainer&&this.hitAreaAdditions[a].contains(b))return!0;if(this.dropDown instanceof c.DisplayObjectContainer){if(this.dropDown.contains(b))return!0}else if(b==this.dropDown)return!0}return!1};a.prototype.openDropDown=function(){this.openDropDownHelper()};a.prototype.openDropDownHelper=
- function(){this.isOpen||(this.addCloseTriggers(),this._isOpen=!0,this.openButton&&this.openButton.keepDown(!0),this.dispatchEvent(new c.UIEvent(c.UIEvent.OPEN)))};a.prototype.closeDropDown=function(b){if(this.isOpen){this._isOpen=!1;this.openButton&&this.openButton.keepDown(!1);var a=new c.UIEvent(c.UIEvent.CLOSE,!1,!0);b||a.preventDefault();this.dispatchEvent(a);this.removeCloseTriggers()}};a.prototype.openButton_buttonDownHandler=function(b){this.isOpen?this.closeDropDown(!0):(this.mouseIsDown=
- !0,this.openDropDownHelper())};a.prototype.openButton_rollOverHandler=function(b){0==this.rollOverOpenDelay?this.openDropDownHelper():(this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT,this.openButton_rollOutHandler,this),this.rollOverOpenDelayTimer=new c.Timer(this.rollOverOpenDelay,1),this.rollOverOpenDelayTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE,this.rollOverDelay_timerCompleteHandler,this),this.rollOverOpenDelayTimer.start())};a.prototype.openButton_rollOutHandler=function(b){this.rollOverOpenDelayTimer&&
- this.rollOverOpenDelayTimer.running&&(this.rollOverOpenDelayTimer.stop(),this.rollOverOpenDelayTimer=null);this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT,this.openButton_rollOutHandler,this)};a.prototype.rollOverDelay_timerCompleteHandler=function(b){this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT,this.openButton_rollOutHandler,this);this.rollOverOpenDelayTimer=null;this.openDropDownHelper()};a.prototype.stage_mouseDownHandler=function(b){if(this.mouseIsDown)this.mouseIsDown=
- !1;else if(!this.dropDown||this.dropDown&&(b.target==this.dropDown||this.dropDown instanceof c.DisplayObjectContainer&&!this.dropDown.contains(b.target))){var a=b.target;if(!this.openButton||!a||!this.openButton.contains(a)){if(null!=this.hitAreaAdditions)for(a=0;a<this.hitAreaAdditions.length;a++)if(this.hitAreaAdditions[a]==b.target||this.hitAreaAdditions[a]instanceof c.DisplayObjectContainer&&this.hitAreaAdditions[a].contains(b.target))return;this.closeDropDown(!0)}}};a.prototype.stage_mouseMoveHandler=
- function(b){this.isTargetOverDropDownOrOpenButton(b.target)||(b instanceof c.TouchEvent&&b.touchDown?(c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)):this.closeDropDown(!0))};a.prototype.stage_mouseUpHandler_noRollOverOpenDelay=function(b){this.mouseIsDown&&(this.mouseIsDown=!1)};a.prototype.stage_mouseUpHandler=function(b){this.isTargetOverDropDownOrOpenButton(b.target)?
- (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)):this.closeDropDown(!0)};a.prototype.stage_resizeHandler=function(b){this.closeDropDown(!0)};a.prototype.stage_mouseWheelHandler=function(b){this.dropDown&&(!this.dropDown.contains(b.target)||!b.isDefaultPrevented())&&this.closeDropDown(!1)};return a}(c.EventDispatcher);c.DropDownController=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._labelChanged=!1;this._userProposedSelectedIndex=c.ListBase.NO_SELECTION;this.captureItemRenderer=!1;this.dropDownController=new c.DropDownController}__extends(a,d);a.prototype._setDataProvider=function(b){this.dataProvider!==b&&(d.prototype._setDataProvider.call(this,b),this._labelChanged=!0,this.invalidateProperties())};a.prototype._setLabelField=function(b){this.labelField!=b&&(d.prototype._setLabelField.call(this,b),this._labelChanged=
- !0,this.invalidateProperties())};a.prototype._setLabelFunction=function(b){this.labelFunction!=b&&(d.prototype._setLabelFunction.call(this,b),this._labelChanged=!0,this.invalidateProperties())};Object.defineProperty(a.prototype,"dropDownController",{get:function(){return this._dropDownController},set:function(b){this._dropDownController!=b&&(this._dropDownController=b,this._dropDownController.addEventListener(c.UIEvent.OPEN,this.dropDownController_openHandler,this),this._dropDownController.addEventListener(c.UIEvent.CLOSE,
- this.dropDownController_closeHandler,this),this.openButton&&(this._dropDownController.openButton=this.openButton),this.dropDown&&(this._dropDownController.dropDown=this.dropDown))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isDropDownOpen",{get:function(){return this.dropDownController?this.dropDownController.isOpen:!1},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"userProposedSelectedIndex",{get:function(){return this._userProposedSelectedIndex},set:function(b){this._userProposedSelectedIndex=
- b},enumerable:!0,configurable:!0});a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);this._labelChanged&&(this._labelChanged=!1,this.updateLabelDisplay())};a.prototype.partAdded=function(b,a){d.prototype.partAdded.call(this,b,a);a==this.openButton?this.dropDownController&&(this.dropDownController.openButton=this.openButton):a==this.dropDown&&this.dropDownController&&(this.dropDownController.dropDown=this.dropDown)};a.prototype.partRemoved=function(b,a){this.dropDownController&&
- (a==this.openButton&&(this.dropDownController.openButton=null),a==this.dropDown&&(this.dropDownController.dropDown=null));d.prototype.partRemoved.call(this,b,a)};a.prototype.getCurrentSkinState=function(){return!this.enabled?"disabled":this.isDropDownOpen?"open":"normal"};a.prototype.commitSelection=function(b){"undefined"===typeof b&&(b=!0);b=d.prototype.commitSelection.call(this,b);this.updateLabelDisplay();return b};a.prototype.isItemIndexSelected=function(b){return this.userProposedSelectedIndex==
- b};a.prototype.openDropDown=function(){this.dropDownController.openDropDown()};a.prototype.closeDropDown=function(b){this.dropDownController.closeDropDown(b)};a.prototype.updateLabelDisplay=function(b){};a.prototype.changeHighlightedSelection=function(b,a){this.itemSelected(this.userProposedSelectedIndex,!1);this.userProposedSelectedIndex=b;this.itemSelected(this.userProposedSelectedIndex,!0)};a.prototype.dataProvider_collectionChangeHandler=function(b){d.prototype.dataProvider_collectionChangeHandler.call(this,
- b);this._labelChanged=!0;this.invalidateProperties()};a.prototype.item_mouseDownHandler=function(b){d.prototype.item_mouseDownHandler.call(this,b);this.dispatchListEvent(b,c.ListEvent.ITEM_CLICK,b.currentTarget);this.userProposedSelectedIndex=this.selectedIndex;this.closeDropDown(!0)};a.prototype.dropDownController_openHandler=function(b){this.addEventListener(c.UIEvent.UPDATE_COMPLETE,this.open_updateCompleteHandler,this);this.userProposedSelectedIndex=this.selectedIndex;this.invalidateSkinState()};
- a.prototype.open_updateCompleteHandler=function(b){this.removeEventListener(c.UIEvent.UPDATE_COMPLETE,this.open_updateCompleteHandler,this);this.dispatchEvent(new c.UIEvent(c.UIEvent.OPEN))};a.prototype.dropDownController_closeHandler=function(b){this.addEventListener(c.UIEvent.UPDATE_COMPLETE,this.close_updateCompleteHandler,this);this.invalidateSkinState();b.isDefaultPrevented()?this.changeHighlightedSelection(this.selectedIndex):this._setSelectedIndex(this.userProposedSelectedIndex,!0)};a.prototype.close_updateCompleteHandler=
- function(b){this.removeEventListener(c.UIEvent.UPDATE_COMPLETE,this.close_updateCompleteHandler,this);this.dispatchEvent(new c.UIEvent(c.UIEvent.CLOSE))};a.PAGE_SIZE=5;return a}(c.List);c.DropDownListBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.iconFieldOrFunctionChanged=!1}__extends(a,d);a.prototype.createChildren=function(){this.itemRenderer||(this.itemRenderer=c.TreeItemRenderer);d.prototype.createChildren.call(this)};a.prototype.updateRenderer=function(b,a,c){if("hasChildren"in b&&"hasChildren"in this.dataProvider){var e=this.dataProvider;b.hasChildren=e.hasChildren(c);b.opened=e.isItemOpen(c);b.depth=e.getDepth(c);b.iconSkinName=this.itemToIcon(c)}return d.prototype.updateRenderer.call(this,
- b,a,c)};a.prototype.itemToIcon=function(b){if(!b)return null;if(null!=this._iconFunction)return this._iconFunction(b);var a;if(b instanceof c.XML)try{0!=b[this.iconField].length()&&(a=b[this.iconField])}catch(d){}else if(b instanceof Object)try{b[this.iconField]&&(a=b[this.iconField])}catch(e){}return a};a.prototype.dataGroup_rendererAddHandler=function(b){d.prototype.dataGroup_rendererAddHandler.call(this,b);b.renderer&&"hasChildren"in b.renderer&&b.renderer.addEventListener(c.TreeEvent.ITEM_OPENING,
- this.onItemOpening,this)};a.prototype.onItemOpening=function(b){var a=b.itemRenderer,d=b.item,e=this._getDataProvider();a&&(e&&"hasChildren"in e)&&this.dispatchEvent(b)&&(b=!a.opened,e.expandItem(d,b),a=new c.TreeEvent(b?c.TreeEvent.ITEM_OPEN:c.TreeEvent.ITEM_CLOSE,!1,!1,a.itemIndex,d,a),this.dispatchEvent(a))};a.prototype.dataGroup_rendererRemoveHandler=function(b){d.prototype.dataGroup_rendererRemoveHandler.call(this,b);b.renderer&&"hasChildren"in b.renderer&&b.renderer.removeEventListener(c.TreeEvent.ITEM_OPENING,
- this.onItemOpening,this)};Object.defineProperty(a.prototype,"iconField",{get:function(){return this._iconField},set:function(b){this._iconField!=b&&(this._iconField=b,this.iconFieldOrFunctionChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"iconFunction",{get:function(){return this._iconFunction},set:function(b){this._iconFunction!=b&&(this._iconFunction=b,this.iconFieldOrFunctionChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});
- a.prototype.expandItem=function(b,a){"undefined"===typeof a&&(a=!0);var c=this._getDataProvider();c&&"hasChildren"in c&&c.expandItem(b,a)};a.prototype.isItemOpen=function(b){var a=this._getDataProvider();return!a||!("hasChildren"in a)?!1:a.isItemOpen(b)};a.prototype.dataProvider_collectionChangeHandler=function(b){d.prototype.dataProvider_collectionChangeHandler.call(this,b);if(b.kind==c.CollectionEventKind.OPEN||b.kind==c.CollectionEventKind.CLOSE){var a=this.dataGroup?this.dataGroup.getElementAt(b.location):
- null;a&&(this.updateRenderer(a,b.location,b.items[0]),b.kind==c.CollectionEventKind.CLOSE&&(this.layout&&this.layout.useVirtualLayout)&&(this.layout.clearVirtualLayoutCache(),this.invalidateSize()))}};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);if(this.iconFieldOrFunctionChanged){if(null!=this.dataGroup){var b;if(this.layout&&this.layout.useVirtualLayout)for(var a=this.dataGroup.getElementIndicesInView(),c=a.length,e=0;e<c;e++)b=a[e],this.updateRendererIconProperty(b);
- else{a=this.dataGroup.numElements;for(b=0;b<a;b++)this.updateRendererIconProperty(b)}}this.iconFieldOrFunctionChanged=!1}};a.prototype.updateRendererIconProperty=function(b){if(b=this.dataGroup.getElementAt(b))b.iconSkinName=this.itemToIcon(b.data)};return a}(c.List);c.Tree=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(){c.call(this);this._prompt=""}__extends(a,c);Object.defineProperty(a.prototype,"prompt",{get:function(){return this._prompt},set:function(b){this._prompt!=b&&(this._prompt=b,this._labelChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});a.prototype.partAdded=function(b,a){c.prototype.partAdded.call(this,b,a);a==this.labelDisplay&&(this._labelChanged=!0,this.invalidateProperties())};a.prototype.updateLabelDisplay=function(b){"undefined"===
- typeof b&&(b=void 0);this.labelDisplay&&(void 0==b&&(b=this.selectedItem),this.labelDisplay.text=null!=b&&void 0!=b?this.itemToLabel(b):this._prompt)};return a}(c.DropDownListBase);c.DropDownList=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._allowDeselection=!0}__extends(a,d);Object.defineProperty(a.prototype,"allowDeselection",{get:function(){return this._allowDeselection},set:function(b){this._allowDeselection=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"data",{get:function(){return this._data},set:function(b){this._data=b;this.dispatchEvent(new c.Event("dataChange"))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"itemIndex",
- {get:function(){return this._itemIndex},set:function(b){this._itemIndex=b},enumerable:!0,configurable:!0});a.prototype._setLabel=function(b){b!=this._getLabel()&&(d.prototype._setLabel.call(this,b),this.labelDisplay&&(this.labelDisplay.text=this._getLabel()))};a.prototype.buttonReleased=function(){(!this.selected||this.allowDeselection)&&d.prototype.buttonReleased.call(this)};return a}(c.ToggleButtonBase);c.TabBarButton=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.requireSelection=!0}__extends(a,d);a.prototype.c=function(b){b!=this._requireSelection&&(d.prototype._setRequireSelection.call(this,b),this.requireSelectionChanged_tabBar=!0,this.invalidateProperties())};a.prototype._setDataProvider=function(b){this.dataProvider instanceof c.ViewStack&&(this.dataProvider.removeEventListener("IndexChanged",this.onViewStackIndexChange,this),this.removeEventListener(c.IndexChangeEvent.CHANGE,this.onIndexChanged,
- this));b instanceof c.ViewStack&&(b.addEventListener("IndexChanged",this.onViewStackIndexChange,this),this.addEventListener(c.IndexChangeEvent.CHANGE,this.onIndexChanged,this));d.prototype._setDataProvider.call(this,b)};a.prototype.onIndexChanged=function(b){this.dataProvider.setSelectedIndex(b.newIndex,!1)};a.prototype.onViewStackIndexChange=function(b){this._setSelectedIndex(this.dataProvider.selectedIndex,!1)};a.prototype.commitProperties=function(){d.prototype.commitProperties.call(this);if(this.requireSelectionChanged_tabBar&&
- this.dataGroup){this.requireSelectionChanged_tabBar=!1;for(var b=this.dataGroup.numElements,a=0;a<b;a++){var c=this.dataGroup.getElementAt(a);c&&(c.allowDeselection=!this.requireSelection)}}};a.prototype.dataGroup_rendererAddHandler=function(b){d.prototype.dataGroup_rendererAddHandler.call(this,b);if(b=b.renderer)b.addEventListener(c.TouchEvent.TOUCH_TAP,this.item_clickHandler,this),b instanceof c.TabBarButton&&(b.allowDeselection=!this.requireSelection)};a.prototype.dataGroup_rendererRemoveHandler=
- function(b){d.prototype.dataGroup_rendererRemoveHandler.call(this,b);(b=b.renderer)&&b.removeEventListener(c.TouchEvent.TOUCH_TAP,this.item_clickHandler,this)};a.prototype.item_clickHandler=function(b){var a=b.currentTarget,d;d=a?a.itemIndex:this.dataGroup.getElementIndex(b.currentTarget);d==this.selectedIndex?this.requireSelection||this._setSelectedIndex(c.ListBase.NO_SELECTION,!0):this._setSelectedIndex(d,!0);this.dispatchListEvent(b,c.ListEvent.ITEM_CLICK,a)};a.prototype.createSkinParts=function(){this.dataGroup=
- new c.DataGroup;this.dataGroup.percentHeight=this.dataGroup.percentWidth=100;this.dataGroup.clipAndEnableScrolling=!0;var b=new c.HorizontalLayout;b.gap=-1;b.horizontalAlign=c.HorizontalAlign.JUSTIFY;b.verticalAlign=c.VerticalAlign.CONTENT_JUSTIFY;this.dataGroup.layout=b;this._addToDisplayList(this.dataGroup);this.partAdded("dataGroup",this.dataGroup)};return a}(c.ListBase);c.TabBar=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._horizontalScrollPolicy=this._verticalScrollPolicy="auto";this._velocityY=this._velocityX=0;this._previousVelocityX=[];this._previousVelocityY=[]}__extends(a,d);a.prototype.measure=function(){this._viewport&&(this.measuredWidth=this._viewport.preferredWidth,this.measuredHeight=this._viewport.preferredHeight)};a.prototype.updateDisplayList=function(b,a){this._viewport.setLayoutBoundsSize(b,a)};Object.defineProperty(a.prototype,"verticalScrollPolicy",
- {get:function(){return this._verticalScrollPolicy},set:function(b){this._verticalScrollPolicy=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"horizontalScrollPolicy",{get:function(){return this._horizontalScrollPolicy},set:function(b){this._horizontalScrollPolicy=b},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewport",{get:function(){return this._viewport},set:function(b){b!=this._viewport&&(this.uninstallViewport(),this._viewport=b,this.installViewport(),
- this.dispatchEventWith("viewportChanged"))},enumerable:!0,configurable:!0});a.prototype.installViewport=function(){this.viewport&&(this.viewport.clipAndEnableScrolling=!0,this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.onTouchBegan,this),d.prototype.addChildAt.call(this,this.viewport,0))};a.prototype.uninstallViewport=function(){this.viewport&&(this.viewport.clipAndEnableScrolling=!1,this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.onTouchBegan,this),d.prototype.removeChild.call(this,
- this.viewport))};a.prototype.checkScrollPolicy=function(){var b=this._viewport;switch(this._horizontalScrollPolicy){case "auto":this._horizontalCanScroll=b.contentWidth>b.width?!0:!1;break;case "on":this._horizontalCanScroll=!0;break;case "off":this._horizontalCanScroll=!1}switch(this._verticalScrollPolicy){case "auto":this._verticalCanScroll=b.contentHeight>b.height?!0:!1;break;case "on":this._verticalCanScroll=!0;break;case "off":this._verticalCanScroll=!1}};a.prototype.onTouchBegan=function(b){this.verticalAnimator&&
- this.verticalAnimator.isPlaying&&this.verticalAnimator.stop();this.horizontalAnimator&&this.horizontalAnimator.isPlaying&&this.horizontalAnimator.stop();this.checkScrollPolicy();var a=this._viewport,d=a.horizontalScrollPosition,a=a.verticalScrollPosition;this._offsetPointX=d+b.stageX;this._offsetPointY=a+b.stageY;this._velocityY=this._velocityX=0;this._previousVelocityX.length=0;this._previousVelocityY.length=0;this._previousTouchTime=c.getTimer();this._previousTouchX=this._startTouchX=this._currentTouchX=
- b.stageX;this._previousTouchY=this._startTouchY=this._currentTouchY=b.stageY;this._startHorizontalScrollPosition=d;this._startVerticalScrollPosition=a;c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,this.onTouchMove,this);c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END,this.onTouchEnd,this);c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE,this.onTouchEnd,this);this.addEventListener(c.Event.ENTER_FRAME,this.enterFrameHandler,this)};a.prototype.onTouchMove=function(b){this._currentTouchX=
- b.stageX;this._currentTouchY=b.stageY;var a=this._viewport;if(this._horizontalCanScroll){var c=this._offsetPointX-b.stageX;0>c&&(c*=0.5);c>a.contentWidth-a.width&&(c=0.5*(c+a.contentWidth-a.width));a.horizontalScrollPosition=c}this._verticalCanScroll&&(b=this._offsetPointY-b.stageY,0>b&&(b*=0.5),b>a.contentHeight-a.height&&(b=0.5*(b+a.contentHeight-a.height)),a.verticalScrollPosition=b)};a.prototype.onTouchEnd=function(b){c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.onTouchMove,
- this);c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.onTouchEnd,this);c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,this.onTouchEnd,this);this.removeEventListener(c.Event.ENTER_FRAME,this.enterFrameHandler,this);this._horizontalCanScroll&&this.checkHorizontalScrollPosition();this._verticalCanScroll&&this.checkVerticalScrollPosition()};a.easeOut=function(b){b-=1;return b*b*b+1};a.prototype.enterFrameHandler=function(b){b=c.getTimer();var a=b-this._previousTouchTime;0<
- a&&(this._previousVelocityX[this._previousVelocityX.length]=this._velocityX,4<this._previousVelocityX.length&&this._previousVelocityX.shift(),this._previousVelocityY[this._previousVelocityY.length]=this._velocityY,4<this._previousVelocityY.length&&this._previousVelocityY.shift(),this._velocityX=(this._currentTouchX-this._previousTouchX)/a,this._velocityY=(this._currentTouchY-this._previousTouchY)/a,this._previousTouchTime=b,this._previousTouchX=this._currentTouchX,this._previousTouchY=this._currentTouchY);
- b=Math.abs(this._currentTouchX-this._startTouchX);a=Math.abs(this._currentTouchY-this._startTouchY);this._horizontalCanScroll&&0.04<=b&&(this._startTouchX=this._currentTouchX,this._startHorizontalScrollPosition=this._viewport.horizontalScrollPosition);this._verticalCanScroll&&0.04<=a&&(this._startTouchY=this._currentTouchY,this._startVerticalScrollPosition=this._viewport.verticalScrollPosition)};a.prototype.checkHorizontalScrollPosition=function(){for(var b=this._viewport,c=b.horizontalScrollPosition,
- b=b.contentWidth-b.width,d=2.33*this._velocityX,e=this._previousVelocityX.length,g=2.33,k=0;k<e;k++)var l=a.VELOCITY_WEIGHTS[k],d=d+this._previousVelocityX.shift()*l,g=g+l;d/=g;0.02>=Math.abs(d)?this.finishScrollingHorizontally():(c=this.getAnimationDatas(d,c,b),this.throwHorizontally(c[0],c[1]))};a.prototype.checkVerticalScrollPosition=function(){for(var b=this._viewport,c=b.verticalScrollPosition,b=b.contentHeight-b.height,d=2.33*this._velocityY,e=this._previousVelocityY.length,g=2.33,k=0;k<e;k++)var l=
- a.VELOCITY_WEIGHTS[k],d=d+this._previousVelocityY.shift()*l,g=g+l;d/=g;0.02>=Math.abs(d)?this.finishScrollingVertically():(c=this.getAnimationDatas(d,c,b),this.throwVertically(c[0],c[1]))};a.prototype.getAnimationDatas=function(b,c,d){var e=Math.abs(b),g=0,k=c+(b-0.02)/Math.log(0.998);if(0>k||k>d)for(k=c;0.02<Math.abs(b);)k-=b,b=0>k||k>d?b*0.998*0.95:0.998*b,g++;else g=Math.log(0.02/e)/Math.log(0.998);a.animationData||(a.animationData=[0,0]);b=a.animationData;b[0]=k;b[1]=g;return b};a.prototype.finishScrollingHorizontally=
- function(b){var a=this._viewport;b=a.horizontalScrollPosition;var a=a.contentWidth-a.width,c=b;0>b&&(c=0);b>a&&(c=a);this.throwHorizontally(c,300)};a.prototype.throwHorizontally=function(b,d){"undefined"===typeof d&&(d=500);var e=this._viewport.horizontalScrollPosition;e!=b&&(this.horizontalAnimator||(this.horizontalAnimator=new c.Animation(this.horizontalUpdateHandler,this),this.horizontalAnimator.endFunction=this.finishScrollingHorizontally,this.horizontalAnimator.easerFunction=a.easeOut),this.horizontalAnimator.isPlaying&&
- this.horizontalAnimator.stop(),this.horizontalAnimator.duration=d,this.horizontalAnimator.motionPaths=[{prop:"hsp",from:e,to:b}],this.horizontalAnimator.play())};a.prototype.horizontalUpdateHandler=function(b){this._viewport.horizontalScrollPosition=b.currentValue.hsp};a.prototype.finishScrollingVertically=function(b){var a=this._viewport;b=a.verticalScrollPosition;var a=a.contentHeight-a.height,c=b;0>b&&(c=0);b>a&&(c=a);this.throwVertically(c,300)};a.prototype.throwVertically=function(b,d){"undefined"===
- typeof d&&(d=500);var e=this._viewport.verticalScrollPosition;e!=b&&(this.verticalAnimator||(this.verticalAnimator=new c.Animation(this.verticalUpdateHandler,this),this.verticalAnimator.endFunction=this.finishScrollingVertically,this.verticalAnimator.easerFunction=a.easeOut),this.verticalAnimator.isPlaying&&this.verticalAnimator.stop(),this.verticalAnimator.duration=d,this.verticalAnimator.motionPaths=[{prop:"vsp",from:e,to:b}],this.verticalAnimator.play())};a.prototype.verticalUpdateHandler=function(b){this._viewport.verticalScrollPosition=
- b.currentValue.vsp};Object.defineProperty(a.prototype,"numElements",{get:function(){return this.viewport?1:0},enumerable:!0,configurable:!0});a.prototype.throwRangeError=function(b){throw new RangeError('\u7d22\u5f15:"'+b+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');};a.prototype.getElementAt=function(b){if(this.viewport&&0==b)return this.viewport;this.throwRangeError(b);return null};a.prototype.getElementIndex=function(b){return null!=b&&b==this.viewport?0:-1};a.prototype.containsElement=
- function(b){return null!=b&&b==this.viewport?!0:!1};a.prototype.throwNotSupportedError=function(){throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");};a.prototype.addElement=function(b){this.throwNotSupportedError();return null};a.prototype.addElementAt=function(b,a){this.throwNotSupportedError();return null};a.prototype.removeElement=function(b){this.throwNotSupportedError();return null};a.prototype.removeElementAt=function(b){this.throwNotSupportedError();return null};
- a.prototype.removeAllElements=function(){this.throwNotSupportedError()};a.prototype.setElementIndex=function(b,a){this.throwNotSupportedError()};a.prototype.swapElements=function(b,a){this.throwNotSupportedError()};a.prototype.swapElementsAt=function(b,a){this.throwNotSupportedError()};a.prototype.addChild=function(b){this.throwNotSupportedError();return null};a.prototype.addChildAt=function(b,a){this.throwNotSupportedError();return null};a.prototype.removeChild=function(b){this.throwNotSupportedError();
- return null};a.prototype.removeChildAt=function(b){this.throwNotSupportedError();return null};a.prototype.setChildIndex=function(b,a){this.throwNotSupportedError()};a.prototype.swapChildren=function(b,a){this.throwNotSupportedError()};a.prototype.swapChildrenAt=function(b,a){this.throwNotSupportedError()};a.VELOCITY_WEIGHTS=[1,1.33,1.66,2];return a}(c.UIComponent);c.Scroller=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(b,a,e){"undefined"===typeof a&&(a=!1);"undefined"===typeof e&&(e=!1);c.call(this,b,a,e)}__extends(a,c);a.INITIALIZE="initialize";a.CREATION_COMPLETE="creationComplete";a.UPDATE_COMPLETE="updateComplete";a.BUTTON_DOWN="buttonDown";a.CHANGE_END="changeEnd";a.CHANGE_START="changeStart";a.CHANGING="changing";a.VALUE_COMMIT="valueCommit";a.SKIN_CHANGED="skinChanged";a.OPEN="open";a.CLOSE="close";a.PLAY_COMPLETE="playComplete";return a}(c.Event);c.UIEvent=e})(ns_egret||
- (ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(b,a,c,e,g,k,l,n){"undefined"===typeof a&&(a=!1);"undefined"===typeof c&&(c=!1);"undefined"===typeof e&&(e=null);"undefined"===typeof g&&(g=null);"undefined"===typeof k&&(k=null);"undefined"===typeof l&&(l=null);"undefined"===typeof n&&(n=null);d.call(this,b,a,c);this.kind=e;this.property=g;this.oldValue=k;this.newValue=l;this.source=n}__extends(a,d);a.createUpdateEvent=function(b,d,e,h){var g=new a(this.PROPERTY_CHANGE);g.kind=c.PropertyChangeEventKind.UPDATE;
- g.oldValue=e;g.newValue=h;g.source=b;g.property=d;return g};a.PROPERTY_CHANGE="propertyChange";return a}(c.Event);c.PropertyChangeEvent=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.UPDATE="update";c.DELETE="delete";return c}();c.PropertyChangeEventKind=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,e,h,g){"undefined"===typeof a&&(a=NaN);"undefined"===typeof e&&(e=NaN);"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!1);c.call(this,b,h,g);this.oldX=a;this.oldY=e}__extends(a,c);a.MOVE="move";return a}(c.Event);c.MoveEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,e,h,g){"undefined"===typeof a&&(a=NaN);"undefined"===typeof e&&(e=NaN);"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!1);c.call(this,b,h,g);this.oldWidth=a;this.oldHeight=e}__extends(a,c);a.RESIZE="resize";return a}(c.Event);c.ResizeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(b,a,e,h,g){"undefined"===typeof a&&(a=!1);"undefined"===typeof e&&(e=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=null);c.call(this,b,a,e);this.partName=h;this.instance=g}__extends(a,c);a.PART_ADDED="partAdded";a.PART_REMOVED="partRemoved";return a}(c.Event);c.SkinPartEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(b,a,e,h){"undefined"===typeof a&&(a=!1);"undefined"===typeof e&&(e=!1);"undefined"===typeof h&&(h=-1);c.call(this,b,a,e);this.detail=h}__extends(a,c);a.CLOSE="close";return a}(c.Event);c.CloseEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g,k,l,n){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=-1);"undefined"===typeof k&&(k=-1);"undefined"===typeof l&&(l=null);"undefined"===typeof n&&(n=null);c.call(this,a,e,m);this.kind=h;this.location=g;this.oldLocation=k;this.items=l?l:[];this.oldItems=n?n:[]}__extends(a,c);a.COLLECTION_CHANGE="collectionChange";return a}(c.Event);c.CollectionEvent=e})(ns_egret||(ns_egret=
- {}));(function(c){var e=function(){function c(){}c.ADD="add";c.MOVE="move";c.REFRESH="refresh";c.REMOVE="remove";c.REPLACE="replace";c.RESET="reset";c.UPDATE="update";c.OPEN="open";c.CLOSE="close";return c}();c.CollectionEventKind=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=-1);c.call(this,a,e,m);this.element=h;this.index=g}__extends(a,c);a.ELEMENT_ADD="elementAdd";a.ELEMENT_REMOVE="elementRemove";return a}(c.Event);c.ElementExistenceEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=-1);c.call(this,a,e,m);this.oldIndex=h;this.newIndex=g}__extends(a,c);a.CHANGE="change";a.CHANGING="changing";return a}(c.Event);c.IndexChangeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g,k,l,n,p,q,v,F,r){"undefined"===typeof e&&(e=!0);"undefined"===typeof m&&(m=!0);"undefined"===typeof h&&(h=0);"undefined"===typeof g&&(g=0);"undefined"===typeof k&&(k=0);"undefined"===typeof l&&(l=!1);"undefined"===typeof n&&(n=!1);"undefined"===typeof p&&(p=!1);"undefined"===typeof q&&(q=!1);"undefined"===typeof v&&(v=-1);"undefined"===typeof F&&(F=null);"undefined"===typeof r&&(r=null);c.call(this,a,e,m,h,g,k,l,n,p,q);this.itemIndex=v;this.item=
- F;this.itemRenderer=r}__extends(a,c);a.ITEM_ROLL_OUT="itemRollOut";a.ITEM_ROLL_OVER="itemRollOver";a.ITEM_CLICK="itemClick";return a}(c.TouchEvent);c.ListEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=!1);c.call(this,a,e,m);this.popUp=h;this.modal=g}__extends(a,c);a.ADD_POPUP="addPopUp";a.REMOVE_POPUP="removePopUp";a.BRING_TO_FRONT="bringToFront";return a}(c.Event);c.PopUpEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g,k){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=-1);"undefined"===typeof k&&(k=null);c.call(this,a,e,m);this.renderer=h;this.index=g;this.data=k}__extends(a,c);a.RENDERER_ADD="rendererAdd";a.RENDERER_REMOVE="rendererRemove";return a}(c.Event);c.RendererExistenceEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=null);c.call(this,a,e,m);this.oldState=h;this.newState=g}__extends(a,c);a.CURRENT_STATE_CHANGE="currentStateChange";a.CURRENT_STATE_CHANGING="currentStateChanging";return a}(c.Event);c.StateChangeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(c){function a(a,e,m){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!1);c.call(this,a,e,m)}__extends(a,c);a.THUMB_DRAG="thumbDrag";a.THUMB_PRESS="thumbPress";a.THUMB_RELEASE="thumbRelease";return a}(c.Event);c.TrackBaseEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(c){function a(a,e,m,h,g,k){"undefined"===typeof e&&(e=!1);"undefined"===typeof m&&(m=!0);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=null);"undefined"===typeof k&&(k=null);c.call(this,a,e,m);this.item=g;this.itemRenderer=k;this.itemIndex=h}__extends(a,c);a.ITEM_CLOSE="itemClose";a.ITEM_OPEN="itemOpen";a.ITEM_OPENING="itemOpening";return a}(c.Event);c.TreeEvent=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._verticalScrollPosition=this._horizontalScrollPosition=0;this._useVirtualLayout=this._clipAndEnableScrolling=!1}__extends(a,d);Object.defineProperty(a.prototype,"target",{get:function(){return this._target},set:function(a){this._target!=a&&(this._target=a,this.clearVirtualLayoutCache())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"horizontalScrollPosition",{get:function(){return this._horizontalScrollPosition},set:function(a){if(a!=
- this._horizontalScrollPosition){var d=this._horizontalScrollPosition;this._horizontalScrollPosition=a;this.scrollPositionChanged();this.dispatchEvent(c.PropertyChangeEvent.createUpdateEvent(this,"horizontalScrollPosition",d,a))}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalScrollPosition",{get:function(){return this._verticalScrollPosition},set:function(a){if(a!=this._verticalScrollPosition){var d=this._verticalScrollPosition;this._verticalScrollPosition=a;this.scrollPositionChanged();
- this.dispatchEvent(c.PropertyChangeEvent.createUpdateEvent(this,"verticalScrollPosition",d,a))}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"clipAndEnableScrolling",{get:function(){return this._clipAndEnableScrolling},set:function(a){a!=this._clipAndEnableScrolling&&(this._clipAndEnableScrolling=a,null!=this.target&&this.updateScrollRect(this.target.width,this.target.height))},enumerable:!0,configurable:!0});a.prototype.getHorizontalScrollPositionDelta=function(a){var d=this.target;
- if(!d)return 0;var e=this.getScrollRect();if(!e||0==e.x&&e.width>=d.contentWidth)return 0;var d=d.contentWidth-e.right,h=-e.x,g;switch(a){case c.NavigationUnit.LEFT:case c.NavigationUnit.PAGE_LEFT:g=this.getElementBoundsLeftOfScrollRect(e);break;case c.NavigationUnit.RIGHT:case c.NavigationUnit.PAGE_RIGHT:g=this.getElementBoundsRightOfScrollRect(e);break;case c.NavigationUnit.HOME:return h;case c.NavigationUnit.END:return d;default:return 0}if(!g)return 0;var k=0;switch(a){case c.NavigationUnit.LEFT:k=
- Math.max(g.x-e.x,-e.width);break;case c.NavigationUnit.RIGHT:k=Math.min(g.right-e.right,e.width);break;case c.NavigationUnit.PAGE_LEFT:k=g.right-e.right;0<=k&&(k=Math.max(g.x-e.x,-e.width));break;case c.NavigationUnit.PAGE_RIGHT:k=g.x-e.x,0>=k&&(k=Math.min(g.right-e.right,e.width))}return Math.min(d,Math.max(h,k))};a.prototype.getVerticalScrollPositionDelta=function(a){var d=this.target;if(!d)return 0;var e=this.getScrollRect();if(!e||0==e.y&&e.height>=d.contentHeight)return 0;var d=d.contentHeight-
- e.bottom,h=-e.y,g;switch(a){case c.NavigationUnit.UP:case c.NavigationUnit.PAGE_UP:g=this.getElementBoundsAboveScrollRect(e);break;case c.NavigationUnit.DOWN:case c.NavigationUnit.PAGE_DOWN:g=this.getElementBoundsBelowScrollRect(e);break;case c.NavigationUnit.HOME:return h;case c.NavigationUnit.END:return d;default:return 0}if(!g)return 0;var k=0;switch(a){case c.NavigationUnit.UP:k=Math.max(g.y-e.y,-e.height);break;case c.NavigationUnit.DOWN:k=Math.min(g.bottom-e.bottom,e.height);break;case c.NavigationUnit.PAGE_UP:k=
- g.bottom-e.bottom;0<=k&&(k=Math.max(g.y-e.y,-e.height));break;case c.NavigationUnit.PAGE_DOWN:k=g.y-e.y,0>=k&&(k=Math.min(g.bottom-e.bottom,e.height))}return Math.min(d,Math.max(h,k))};a.prototype.getScrollRect=function(){var a=this.target;return!a||!a.clipAndEnableScrolling?null:new c.Rectangle(a.horizontalScrollPosition,a.verticalScrollPosition,a.width,a.height)};a.prototype.getElementBoundsLeftOfScrollRect=function(a){var d=new c.Rectangle;d.x=a.x-1;d.right=a.x;return d};a.prototype.getElementBoundsRightOfScrollRect=
- function(a){var d=new c.Rectangle;d.x=a.right;d.right=a.right+1;return d};a.prototype.getElementBoundsAboveScrollRect=function(a){var d=new c.Rectangle;d.y=a.y-1;d.bottom=a.y;return d};a.prototype.getElementBoundsBelowScrollRect=function(a){var d=new c.Rectangle;d.y=a.bottom;d.bottom=a.bottom+1;return d};a.prototype.scrollPositionChanged=function(){null!=this.target&&(this.updateScrollRect(this.target.width,this.target.height),this.target.invalidateDisplayListExceptLayout())};a.prototype.updateScrollRect=
- function(a,d){null!=this.target&&(this.target.scrollRect=this._clipAndEnableScrolling?new c.Rectangle(this._horizontalScrollPosition,this._verticalScrollPosition,a,d):null)};Object.defineProperty(a.prototype,"useVirtualLayout",{get:function(){return this._useVirtualLayout},set:function(a){this._useVirtualLayout!=a&&(this._useVirtualLayout=a,this.dispatchEvent(new c.Event("useVirtualLayoutChanged")),this._useVirtualLayout&&!a&&this.clearVirtualLayoutCache(),this.target&&this.target.invalidateDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typicalLayoutRect",{get:function(){return this._typicalLayoutRect},set:function(a){this._typicalLayoutRect!=a&&(this._typicalLayoutRect=a,this.target&&this.target.invalidateSize())},enumerable:!0,configurable:!0});a.prototype.clearVirtualLayoutCache=function(){};a.prototype.elementAdded=function(a){};a.prototype.elementRemoved=function(a){};a.prototype.measure=function(){};a.prototype.updateDisplayList=function(a,c){};return a}(c.EventDispatcher);
- c.LayoutBase=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._mouseWheelSpeed=20}__extends(a,d);Object.defineProperty(a.prototype,"useVirtualLayout",{set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"mouseWheelSpeed",{get:function(){return this._mouseWheelSpeed},set:function(a){0==a&&(a=1);this._mouseWheelSpeed=a},enumerable:!0,configurable:!0});a.prototype.getElementBoundsLeftOfScrollRect=function(a){var d=new c.Rectangle;d.x=a.x-this._mouseWheelSpeed;d.right=
- a.x;return d};a.prototype.getElementBoundsRightOfScrollRect=function(a){var d=new c.Rectangle;d.x=a.right;d.right=a.right+this._mouseWheelSpeed;return d};a.prototype.getElementBoundsAboveScrollRect=function(a){var d=new c.Rectangle;d.y=a.y-this._mouseWheelSpeed;d.bottom=a.y;return d};a.prototype.getElementBoundsBelowScrollRect=function(a){var d=new c.Rectangle;d.y=a.bottom;d.bottom=a.bottom+this._mouseWheelSpeed;return d};a.prototype.measure=function(){d.prototype.measure.call(this);if(null!=this.target){for(var a=
- 0,c=0,e=this.target.numElements,h=0;h<e;h++){var g=this.target.getElementAt(h);if(g&&g.includeInLayout){var k=g.horizontalCenter,l=g.verticalCenter,n=g.left,p=g.right,q=g.top,v=g.bottom;!isNaN(n)&&!isNaN(p)?k=n+p:isNaN(k)?!isNaN(n)||!isNaN(p)?(k=isNaN(n)?0:n,k+=isNaN(p)?0:p):k=g.preferredX:k=2*Math.abs(k);!isNaN(q)&&!isNaN(v)?l=q+v:isNaN(l)?!isNaN(q)||!isNaN(v)?(l=isNaN(q)?0:q,l+=isNaN(v)?0:v):l=g.preferredY:l=2*Math.abs(l);v=g.preferredHeight;a=Math.ceil(Math.max(a,k+g.preferredWidth));c=Math.ceil(Math.max(c,
- l+v))}}this.target.measuredWidth=a;this.target.measuredHeight=c}};a.prototype.updateDisplayList=function(a,c){d.prototype.updateDisplayList.call(this,a,c);if(null!=this.target){for(var e=this.target.numElements,h=0,g=0,k=0;k<e;k++){var l=this.target.getElementAt(k);if(null!=l&&l.includeInLayout){var n=l.horizontalCenter,p=l.verticalCenter,q=l.left,v=l.right,F=l.top,r=l.bottom,D=l.percentWidth,x=l.percentHeight,C=NaN,A=NaN;!isNaN(q)&&!isNaN(v)?C=a-v-q:isNaN(D)||(C=Math.round(a*Math.min(0.01*D,1)));
- !isNaN(F)&&!isNaN(r)?A=c-r-F:isNaN(x)||(A=Math.round(c*Math.min(0.01*x,1)));l.setLayoutBoundsSize(C,A);D=l.layoutBoundsWidth;x=l.layoutBoundsHeight;A=C=NaN;C=isNaN(n)?isNaN(q)?isNaN(v)?l.layoutBoundsX:a-D-v:q:Math.round((a-D)/2+n);A=isNaN(p)?isNaN(F)?isNaN(r)?l.layoutBoundsY:c-x-r:F:Math.round((c-x)/2+p);l.setLayoutBoundsPosition(C,A);h=Math.max(h,C+D);g=Math.max(g,A+x)}}this.target.setContentSize(h,g)}};return a}(c.LayoutBase);c.BasicLayout=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.LEFT="left";c.JUSTIFY_USING_GAP="justifyUsingGap";c.JUSTIFY_USING_WIDTH="justifyUsingWidth";return c}();c.ColumnAlign=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.TOP="top";c.JUSTIFY_USING_GAP="justifyUsingGap";c.JUSTIFY_USING_HEIGHT="justifyUsingHeight";return c}();c.RowAlign=e})(ns_egret||(ns_egret={}));(function(c){var e=function(){function c(){}c.ROWS="rows";c.COLUMNS="columns";return c}();c.TileOrientation=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(a){function b(){a.call(this);this._horizontalAlign=c.HorizontalAlign.LEFT;this._verticalAlign=c.VerticalAlign.TOP;this._gap=6;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.elementSizeTable=[];this.endIndex=this.startIndex=-1;this.indexInViewCalculated=!1;this.maxElementWidth=0}__extends(b,a);Object.defineProperty(b.prototype,"horizontalAlign",{get:function(){return this._horizontalAlign},set:function(a){this._horizontalAlign!=
- a&&(this._horizontalAlign=a,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(a){this._verticalAlign!=a&&(this._verticalAlign=a,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"gap",{get:function(){return this._gap},set:function(a){this._gap!=a&&(this._gap=a,this.invalidateTargetSizeAndDisplayList(),
- this.hasEventListener("gapChanged")&&this.dispatchEvent(new c.Event("gapChanged")))},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"padding",{get:function(){return this._padding},set:function(a){this._padding!=a&&(this._padding=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(a){this._paddingLeft!=a&&(this._paddingLeft=a,this.invalidateTargetSizeAndDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(a){this._paddingRight!=a&&(this._paddingRight=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(a){this._paddingTop!=a&&(this._paddingTop=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,
- "paddingBottom",{get:function(){return this._paddingBottom},set:function(a){this._paddingBottom!=a&&(this._paddingBottom=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});b.prototype.invalidateTargetSizeAndDisplayList=function(){this.target&&(this.target.invalidateSize(),this.target.invalidateDisplayList())};b.prototype.measure=function(){a.prototype.measure.call(this);this.target&&(this.useVirtualLayout?this.measureVirtual():this.measureReal())};b.prototype.measureVirtual=
- function(){for(var a=this.typicalLayoutRect?this.typicalLayoutRect.height:22,b=Math.max(this.maxElementWidth,this.typicalLayoutRect?this.typicalLayoutRect.width:71),c=this.getElementTotalSize(),d=this.target.getElementIndicesInView(),e=d.length,l=0;l<e;l++){var n=d[l],p=this.target.getElementAt(n);if(null!=p&&p.includeInLayout)var q=p.preferredWidth,c=c+p.preferredHeight,c=c-(isNaN(this.elementSizeTable[n])?a:this.elementSizeTable[n]),b=Math.max(b,q)}l=isNaN(this._padding)?0:this._padding;a=isNaN(this._paddingLeft)?
- l:this._paddingLeft;d=isNaN(this._paddingRight)?l:this._paddingRight;e=isNaN(this._paddingTop)?l:this._paddingTop;l=isNaN(this._paddingBottom)?l:this._paddingBottom;e+=l;this.target.measuredWidth=Math.ceil(b+(a+d));this.target.measuredHeight=Math.ceil(c+e)};b.prototype.measureReal=function(){for(var a=this.target.numElements,b=a,c=0,d=0,e=0;e<a;e++){var l=this.target.getElementAt(e);if(!l||!l.includeInLayout)b--;else var n=l.preferredWidth,d=d+l.preferredHeight,c=Math.max(c,n)}a=isNaN(this._gap)?
- 0:this._gap;d+=(b-1)*a;l=isNaN(this._padding)?0:this._padding;b=isNaN(this._paddingLeft)?l:this._paddingLeft;a=isNaN(this._paddingRight)?l:this._paddingRight;e=isNaN(this._paddingTop)?l:this._paddingTop;l=isNaN(this._paddingBottom)?l:this._paddingBottom;e+=l;this.target.measuredWidth=Math.ceil(c+(b+a));this.target.measuredHeight=Math.ceil(d+e)};b.prototype.updateDisplayList=function(b,c){a.prototype.updateDisplayList.call(this,b,c);this.target&&(this.useVirtualLayout?this.updateDisplayListVirtual(b,
- c):this.updateDisplayListReal(b,c))};b.prototype.getStartPosition=function(a){var b=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingTop)?b:this._paddingTop,b=isNaN(this._gap)?0:this._gap;if(!this.useVirtualLayout){var d;this.target&&(d=this.target.getElementAt(a));return d?d.y:c}d=this.typicalLayoutRect?this.typicalLayoutRect.height:22;for(var e=0;e<a;e++){var l=this.elementSizeTable[e];isNaN(l)&&(l=d);c+=l+b}return c};b.prototype.getElementSize=function(a){return this.useVirtualLayout?
- (a=this.elementSizeTable[a],isNaN(a)&&(a=this.typicalLayoutRect?this.typicalLayoutRect.height:22),a):this.target?this.target.getElementAt(a).height:0};b.prototype.getElementTotalSize=function(){for(var a=isNaN(this._gap)?0:this._gap,b=this.typicalLayoutRect?this.typicalLayoutRect.height:22,c=0,d=this.target.numElements,e=0;e<d;e++){var l=this.elementSizeTable[e];isNaN(l)&&(l=b);c+=l+a}return c-a};b.prototype.elementAdded=function(b){a.prototype.elementAdded.call(this,b);this.elementSizeTable.splice(b,
- 0,this.typicalLayoutRect?this.typicalLayoutRect.height:22)};b.prototype.elementRemoved=function(b){a.prototype.elementRemoved.call(this,b);this.elementSizeTable.splice(b,1)};b.prototype.clearVirtualLayoutCache=function(){a.prototype.clearVirtualLayoutCache.call(this);this.elementSizeTable=[];this.maxElementWidth=0};b.prototype.findIndexAt=function(a,b,c){var d=(b+c)/2,e=this.getStartPosition(d),l=this.getElementSize(d),n=isNaN(this._gap)?0:this._gap;return a>=e&&a<e+l+n?d:b==c?-1:a<e?this.findIndexAt(a,
- b,Math.max(b,d-1)):this.findIndexAt(a,Math.min(d+1,c),c)};b.prototype.scrollPositionChanged=function(){a.prototype.scrollPositionChanged.call(this);this.useVirtualLayout&&this.getIndexInView()&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())};b.prototype.getIndexInView=function(){if(!this.target||0==this.target.numElements||isNaN(this.target.width)||0==this.target.width||isNaN(this.target.height)||0==this.target.height)return this.startIndex=this.endIndex=-1,!1;var a=isNaN(this._padding)?
- 0:this._padding,b=isNaN(this._paddingTop)?a:this._paddingTop,c=isNaN(this._paddingBottom)?a:this._paddingBottom,a=this.target.numElements,d=this.getStartPosition(a-1)+this.elementSizeTable[a-1]+c,e=this.target.verticalScrollPosition;if(e>d-c)return this.endIndex=this.startIndex=-1,!1;c=this.target.verticalScrollPosition+this.target.height;if(c<b)return this.endIndex=this.startIndex=-1,!1;b=this.startIndex;d=this.endIndex;this.startIndex=this.findIndexAt(e,0,a-1);-1==this.startIndex&&(this.startIndex=
- 0);this.endIndex=this.findIndexAt(c,0,a-1);-1==this.endIndex&&(this.endIndex=a-1);return b!=this.startIndex||d!=this.endIndex};b.prototype.updateDisplayListVirtual=function(a,b){this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingLeft)?d:this._paddingLeft,k=isNaN(this._paddingRight)?d:this._paddingRight,l=isNaN(this._paddingBottom)?d:this._paddingBottom,n=isNaN(this._gap)?0:this._gap,p=this.target.numElements;
- if(-1==this.startIndex||-1==this.endIndex)e=this.getStartPosition(p)-n+l,this.target.setContentSize(this.target.contentWidth,Math.ceil(e));else{this.target.setVirtualElementIndicesInView(this.startIndex,this.endIndex);var q=this._horizontalAlign==c.HorizontalAlign.JUSTIFY||this._horizontalAlign==c.HorizontalAlign.CONTENT_JUSTIFY,v=this._horizontalAlign==c.HorizontalAlign.CONTENT_JUSTIFY,F=0;q||(this._horizontalAlign==c.HorizontalAlign.CENTER?F=0.5:this._horizontalAlign==c.HorizontalAlign.RIGHT&&(F=
- 1));var r=Math.max(0,a-e-k),D=Math.ceil(r),x,C=this.typicalLayoutRect?this.typicalLayoutRect.height:22,d=Math.max(this.typicalLayoutRect?this.typicalLayoutRect.width:71,this.maxElementWidth);if(v){for(var A=this.startIndex;A<=this.endIndex;A++)if((x=this.target.getVirtualElementAt(A))&&x.includeInLayout)this.maxElementWidth=Math.max(this.maxElementWidth,x.preferredWidth);D=Math.ceil(Math.max(r,this.maxElementWidth))}for(var z=0,u=0,A=0,J=!1,B=this.startIndex;B<=this.endIndex;B++)if(z=0,x=this.target.getVirtualElementAt(B))x.includeInLayout?
- (q?(z=e,x.setLayoutBoundsSize(D,NaN)):(z=(r-x.layoutBoundsWidth)*F,z=0<z?z:0,z=e+z),v||(this.maxElementWidth=Math.max(this.maxElementWidth,x.preferredWidth)),A=Math.max(A,x.layoutBoundsWidth),J||(u=isNaN(this.elementSizeTable[B])?C:this.elementSizeTable[B],u!=x.layoutBoundsHeight&&(J=!0)),0==B&&(0<this.elementSizeTable.length&&this.elementSizeTable[B]!=x.layoutBoundsHeight)&&(this.typicalLayoutRect=null),this.elementSizeTable[B]=x.layoutBoundsHeight,u=this.getStartPosition(B),x.setLayoutBoundsPosition(Math.round(z),
- Math.round(u))):this.elementSizeTable[B]=0;A+=e+k;e=this.getStartPosition(p)-n+l;this.target.setContentSize(Math.ceil(A),Math.ceil(e));(J||d<this.maxElementWidth)&&this.target.invalidateSize()}};b.prototype.updateDisplayListReal=function(a,e){var h=isNaN(this._padding)?0:this._padding,g=isNaN(this._paddingLeft)?h:this._paddingLeft,k=isNaN(this._paddingRight)?h:this._paddingRight,l=isNaN(this._paddingTop)?h:this._paddingTop,h=isNaN(this._paddingBottom)?h:this._paddingBottom,n=isNaN(this._gap)?0:this._gap,
- p=Math.max(0,a-g-k),q=Math.max(0,e-l-h),v=this._verticalAlign==c.VerticalAlign.JUSTIFY,F=this._horizontalAlign==c.HorizontalAlign.JUSTIFY||this._horizontalAlign==c.HorizontalAlign.CONTENT_JUSTIFY,r=0;F||(this._horizontalAlign==c.HorizontalAlign.CENTER?r=0.5:this._horizontalAlign==c.HorizontalAlign.RIGHT&&(r=1));var D=this.target.numElements,x=D,C=g,A=l,z,u,J=0,C=0,B=[],K,I=q;for(z=0;z<D;z++)u=this.target.getElementAt(z),!u||!u.includeInLayout?x--:(this.maxElementWidth=Math.max(this.maxElementWidth,
- u.preferredWidth),v?J+=u.preferredHeight:isNaN(u.percentHeight)?I-=u.preferredHeight:(C+=u.percentHeight,K=new d,K.layoutElement=u,K.percent=u.percentHeight,K.min=u.minHeight,K.max=u.maxHeight,B.push(K)));var I=I-(x-1)*n,I=0<I?I:0,E=q-J-n*(x-1),s,w=x,G=[];if(v){if(0>E){s=I/x;for(z=0;z<D;z++)if((u=this.target.getElementAt(z))&&u.includeInLayout)u=u.preferredHeight,u<=s&&(I-=u,w--);I=0<I?I:0}}else if(0<C){b.flexChildrenProportionally(q,I,C,B);q=0;u=B.length;for(z=0;z<u;z++)K=B[z],C=Math.round(K.size+
- q),q+=K.size-C,G[K.layoutElement.hashCode]=C,I-=C;I=0<I?I:0}this._verticalAlign==c.VerticalAlign.MIDDLE?A=l+0.5*I:this._verticalAlign==c.VerticalAlign.BOTTOM&&(A=l+I);B=g;u=x=0;K=Math.ceil(p);this._horizontalAlign==c.HorizontalAlign.CONTENT_JUSTIFY&&(K=Math.ceil(Math.max(p,this.maxElementWidth)));q=0;x=NaN;for(z=0;z<D;z++)if(C=0,(u=this.target.getElementAt(z))&&u.includeInLayout)x=NaN,v?(C=NaN,0<E?C=I*u.preferredHeight/J:0>E&&u.preferredHeight>s&&(C=I/w),isNaN(C)||(x=Math.round(C+q),q+=C-x)):x=G[u.hashCode],
- F?(C=g,u.setLayoutBoundsSize(K,x)):(C=NaN,isNaN(u.percentWidth)||(C=Math.min(100,u.percentWidth),C=Math.round(0.01*p*C)),u.setLayoutBoundsSize(C,x),C=(p-u.layoutBoundsWidth)*r,C=0<C?C:0,C=g+C),u.setLayoutBoundsPosition(Math.round(C),Math.round(A)),x=Math.ceil(u.layoutBoundsWidth),u=Math.ceil(u.layoutBoundsHeight),B=Math.max(B,C+x),l=Math.max(l,A+u),A+=u+n;this.target.setContentSize(Math.ceil(B+k),Math.ceil(l+h))};b.flexChildrenProportionally=function(a,b,c,d){var e=d.length,l;do{l=!0;var n=b-a*c/
- 100;0<n?b-=n:n=0;for(var p=b/c,q=0;q<e;q++){var v=d[q],F=v.percent*p;if(F<v.min){l=v.min;v.size=l;d[q]=d[--e];d[e]=v;c-=v.percent;n>=l||(b-=l-n);l=!1;break}else if(F>v.max){l=v.max;v.size=l;d[q]=d[--e];d[e]=v;c-=v.percent;n>=l||(b-=l-n);l=!1;break}else v.size=F}}while(!l)};b.prototype.getElementBoundsAboveScrollRect=function(a){var b=new c.Rectangle;if(!this.target)return b;var d=this.findIndexAt(a.y,0,this.target.numElements-1),e=isNaN(this._padding)?0:this._padding,k=isNaN(this._paddingTop)?e:this._paddingTop,
- e=isNaN(this._paddingBottom)?e:this._paddingBottom;if(-1==d)return a.y>this.target.contentHeight-e?(b.y=this.target.contentHeight-e,b.bottom=this.target.contentHeight):(b.y=0,b.bottom=k),b;b.y=this.getStartPosition(d);b.bottom=this.getElementSize(d)+b.y;b.y==a.y&&(d--,-1!=d?(b.y=this.getStartPosition(d),b.bottom=this.getElementSize(d)+b.y):(b.y=0,b.bottom=k));return b};b.prototype.getElementBoundsBelowScrollRect=function(a){var b=new c.Rectangle;if(!this.target)return b;var d=this.target.numElements,
- e=this.findIndexAt(a.bottom,0,d-1),k=isNaN(this._padding)?0:this._padding,l=isNaN(this._paddingTop)?k:this._paddingTop,k=isNaN(this._paddingBottom)?k:this._paddingBottom;if(-1==e)return a.right<l?(b.y=0,b.bottom=l):(b.y=this.target.contentHeight-k,b.bottom=this.target.contentHeight),b;b.y=this.getStartPosition(e);b.bottom=this.getElementSize(e)+b.y;b.bottom<=a.bottom&&(e++,e<d?(b.y=this.getStartPosition(e),b.bottom=this.getElementSize(e)+b.y):(b.y=this.target.contentHeight-k,b.bottom=this.target.contentHeight));
- return b};return b}(c.LayoutBase);c.VerticalLayout=e;var d=function(){return function(){this.size=0}}()})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(a){function b(){a.call(this);this._horizontalAlign=c.HorizontalAlign.LEFT;this._verticalAlign=c.VerticalAlign.TOP;this._gap=6;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.elementSizeTable=[];this.endIndex=this.startIndex=-1;this.indexInViewCalculated=!1;this.maxElementHeight=0}__extends(b,a);Object.defineProperty(b.prototype,"horizontalAlign",{get:function(){return this._horizontalAlign},set:function(a){this._horizontalAlign!=
- a&&(this._horizontalAlign=a,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(a){this._verticalAlign!=a&&(this._verticalAlign=a,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"gap",{get:function(){return this._gap},set:function(a){this._gap!=a&&(this._gap=a,this.invalidateTargetSizeAndDisplayList(),
- this.hasEventListener("gapChanged")&&this.dispatchEvent(new c.Event("gapChanged")))},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"padding",{get:function(){return this._padding},set:function(a){this._padding!=a&&(this._padding=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(a){this._paddingLeft!=a&&(this._paddingLeft=a,this.invalidateTargetSizeAndDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(a){this._paddingRight!=a&&(this._paddingRight=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(a){this._paddingTop!=a&&(this._paddingTop=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,
- "paddingBottom",{get:function(){return this._paddingBottom},set:function(a){this._paddingBottom!=a&&(this._paddingBottom=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});b.prototype.invalidateTargetSizeAndDisplayList=function(){this.target&&(this.target.invalidateSize(),this.target.invalidateDisplayList())};b.prototype.measure=function(){a.prototype.measure.call(this);this.target&&(this.useVirtualLayout?this.measureVirtual():this.measureReal())};b.prototype.measureVirtual=
- function(){for(var a=this.typicalLayoutRect?this.typicalLayoutRect.height:22,b=this.typicalLayoutRect?this.typicalLayoutRect.width:71,c=this.getElementTotalSize(),a=Math.max(this.maxElementHeight,a),d=this.target.getElementIndicesInView(),e=d.length,l=0;l<e;l++){var n=d[l],p=this.target.getElementAt(n);if(null!=p&&p.includeInLayout)var q=p.preferredHeight,c=c+p.preferredWidth,c=c-(isNaN(this.elementSizeTable[n])?b:this.elementSizeTable[n]),a=Math.max(a,q)}l=isNaN(this._padding)?0:this._padding;b=
- isNaN(this._paddingLeft)?l:this._paddingLeft;d=isNaN(this._paddingRight)?l:this._paddingRight;e=isNaN(this._paddingTop)?l:this._paddingTop;l=isNaN(this._paddingBottom)?l:this._paddingBottom;e+=l;this.target.measuredWidth=Math.ceil(c+(b+d));this.target.measuredHeight=Math.ceil(a+e)};b.prototype.measureReal=function(){for(var a=this.target.numElements,b=a,c=0,d=0,e=0;e<a;e++){var l=this.target.getElementAt(e);if(!l||!l.includeInLayout)b--;else var n=l.preferredHeight,c=c+l.preferredWidth,d=Math.max(d,
- n)}a=isNaN(this._gap)?0:this._gap;c+=(b-1)*a;l=isNaN(this._padding)?0:this._padding;b=isNaN(this._paddingLeft)?l:this._paddingLeft;a=isNaN(this._paddingRight)?l:this._paddingRight;e=isNaN(this._paddingTop)?l:this._paddingTop;l=isNaN(this._paddingBottom)?l:this._paddingBottom;e+=l;this.target.measuredWidth=Math.ceil(c+(b+a));this.target.measuredHeight=Math.ceil(d+e)};b.prototype.updateDisplayList=function(b,c){a.prototype.updateDisplayList.call(this,b,c);this.target&&(this.useVirtualLayout?this.updateDisplayListVirtual(b,
- c):this.updateDisplayListReal(b,c))};b.prototype.getStartPosition=function(a){var b=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingLeft)?b:this._paddingLeft,b=isNaN(this._gap)?0:this._gap;if(!this.useVirtualLayout){var d;this.target&&(d=this.target.getElementAt(a));return d?d.x:c}d=this.typicalLayoutRect?this.typicalLayoutRect.width:71;for(var e=0;e<a;e++){var l=this.elementSizeTable[e];isNaN(l)&&(l=d);c+=l+b}return c};b.prototype.getElementSize=function(a){return this.useVirtualLayout?
- (a=this.elementSizeTable[a],isNaN(a)&&(a=this.typicalLayoutRect?this.typicalLayoutRect.width:71),a):this.target?this.target.getElementAt(a).width:0};b.prototype.getElementTotalSize=function(){for(var a=this.typicalLayoutRect?this.typicalLayoutRect.width:71,b=isNaN(this._gap)?0:this._gap,c=0,d=this.target.numElements,e=0;e<d;e++){var l=this.elementSizeTable[e];isNaN(l)&&(l=a);c+=l+b}return c-b};b.prototype.elementAdded=function(b){this.useVirtualLayout&&(a.prototype.elementAdded.call(this,b),this.elementSizeTable.splice(b,
- 0,this.typicalLayoutRect?this.typicalLayoutRect.width:71))};b.prototype.elementRemoved=function(b){this.useVirtualLayout&&(a.prototype.elementRemoved.call(this,b),this.elementSizeTable.splice(b,1))};b.prototype.clearVirtualLayoutCache=function(){this.useVirtualLayout&&(a.prototype.clearVirtualLayoutCache.call(this),this.elementSizeTable=[],this.maxElementHeight=0)};b.prototype.findIndexAt=function(a,b,c){var d=(b+c)/2,e=this.getStartPosition(d),l=this.getElementSize(d),n=isNaN(this._gap)?0:this._gap;
- return a>=e&&a<e+l+n?d:b==c?-1:a<e?this.findIndexAt(a,b,Math.max(b,d-1)):this.findIndexAt(a,Math.min(d+1,c),c)};b.prototype.scrollPositionChanged=function(){a.prototype.scrollPositionChanged.call(this);this.useVirtualLayout&&this.getIndexInView()&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())};b.prototype.getIndexInView=function(){if(!this.target||0==this.target.numElements||isNaN(this.target.width)||0==this.target.width||isNaN(this.target.height)||0==this.target.height)return this.startIndex=
- this.endIndex=-1,!1;var a=isNaN(this._padding)?0:this._padding,b=isNaN(this._paddingLeft)?a:this._paddingLeft,c=isNaN(this._paddingRight)?a:this._paddingRight;isNaN(this._paddingTop);isNaN(this._paddingBottom);var a=this.target.numElements,d=this.getStartPosition(a-1)+this.elementSizeTable[a-1]+c,e=this.target.horizontalScrollPosition;if(e>d-c)return this.endIndex=this.startIndex=-1,!1;c=this.target.horizontalScrollPosition+this.target.width;if(c<b)return this.endIndex=this.startIndex=-1,!1;b=this.startIndex;
- d=this.endIndex;this.startIndex=this.findIndexAt(e,0,a-1);-1==this.startIndex&&(this.startIndex=0);this.endIndex=this.findIndexAt(c,0,a-1);-1==this.endIndex&&(this.endIndex=a-1);return b!=this.startIndex||d!=this.endIndex};b.prototype.updateDisplayListVirtual=function(a,b){this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingRight)?d:this._paddingRight,k=isNaN(this._paddingTop)?d:this._paddingTop,l=isNaN(this._paddingBottom)?
- d:this._paddingBottom,n=isNaN(this._gap)?0:this._gap,p=this.target.numElements;if(-1==this.startIndex||-1==this.endIndex)e=this.getStartPosition(p)-n+e,this.target.setContentSize(Math.ceil(e),this.target.contentHeight);else{this.target.setVirtualElementIndicesInView(this.startIndex,this.endIndex);var q=this._verticalAlign==c.VerticalAlign.JUSTIFY||this._verticalAlign==c.VerticalAlign.CONTENT_JUSTIFY,v=this._verticalAlign==c.VerticalAlign.CONTENT_JUSTIFY,F=0;q||(this._verticalAlign==c.VerticalAlign.MIDDLE?
- F=0.5:this._verticalAlign==c.VerticalAlign.BOTTOM&&(F=1));var r=Math.max(0,b-k-l),D=Math.ceil(r),x,C=this.typicalLayoutRect?this.typicalLayoutRect.width:71,d=Math.max(this.typicalLayoutRect?this.typicalLayoutRect.height:22,this.maxElementHeight);if(v){for(var A=this.startIndex;A<=this.endIndex;A++)if((x=this.target.getVirtualElementAt(A))&&x.includeInLayout)this.maxElementHeight=Math.max(this.maxElementHeight,x.preferredHeight);D=Math.ceil(Math.max(r,this.maxElementHeight))}for(var z=0,u=0,A=0,J=
- !1,B=this.startIndex;B<=this.endIndex;B++)if(u=0,x=this.target.getVirtualElementAt(B))x.includeInLayout?(q?(u=k,x.setLayoutBoundsSize(NaN,D)):(u=(r-x.layoutBoundsHeight)*F,u=0<u?u:0,u=k+u),v||(this.maxElementHeight=Math.max(this.maxElementHeight,x.preferredHeight)),A=Math.max(A,x.layoutBoundsHeight),J||(z=isNaN(this.elementSizeTable[B])?C:this.elementSizeTable[B],z!=x.layoutBoundsWidth&&(J=!0)),0==B&&(0<this.elementSizeTable.length&&this.elementSizeTable[B]!=x.layoutBoundsWidth)&&(this.typicalLayoutRect=
- null),this.elementSizeTable[B]=x.layoutBoundsWidth,z=this.getStartPosition(B),x.setLayoutBoundsPosition(Math.round(z),Math.round(u))):this.elementSizeTable[B]=0;A+=k+l;e=this.getStartPosition(p)-n+e;this.target.setContentSize(Math.ceil(e),Math.ceil(A));(J||d<this.maxElementHeight)&&this.target.invalidateSize()}};b.prototype.updateDisplayListReal=function(a,e){var h=isNaN(this._padding)?0:this._padding,g=isNaN(this._paddingLeft)?h:this._paddingLeft,k=isNaN(this._paddingRight)?h:this._paddingRight,
- l=isNaN(this._paddingTop)?h:this._paddingTop,h=isNaN(this._paddingBottom)?h:this._paddingBottom,n=isNaN(this._gap)?0:this._gap,p=Math.max(0,a-g-k),q=Math.max(0,e-l-h),v=this._horizontalAlign==c.HorizontalAlign.JUSTIFY,F=this._verticalAlign==c.VerticalAlign.JUSTIFY||this._verticalAlign==c.VerticalAlign.CONTENT_JUSTIFY,r=0;F||(this._verticalAlign==c.VerticalAlign.MIDDLE?r=0.5:this._verticalAlign==c.VerticalAlign.BOTTOM&&(r=1));var D=this.target.numElements,x=D,C=g,A=l,z,u,J=0,A=0,B=[],K,I=p;for(z=0;z<
- D;z++)u=this.target.getElementAt(z),!u||!u.includeInLayout?x--:(this.maxElementHeight=Math.max(this.maxElementHeight,u.preferredHeight),v?J+=u.preferredWidth:isNaN(u.percentWidth)?I-=u.preferredWidth:(A+=u.percentWidth,K=new d,K.layoutElement=u,K.percent=u.percentWidth,K.min=u.minWidth,K.max=u.maxWidth,B.push(K)));var I=I-n*(x-1),I=0<I?I:0,E=p-J-n*(x-1),s,w=x,G=[];if(v){if(0>E){s=I/x;for(z=0;z<D;z++)if((u=this.target.getElementAt(z))&&u.includeInLayout)u=u.preferredWidth,u<=s&&(I-=u,w--);I=0<I?I:
- 0}}else if(0<A){b.flexChildrenProportionally(p,I,A,B);p=0;u=B.length;for(z=0;z<u;z++)K=B[z],A=Math.round(K.size+p),p+=K.size-A,G[K.layoutElement.hashCode]=A,I-=A;I=0<I?I:0}this._horizontalAlign==c.HorizontalAlign.CENTER?C=g+0.5*I:this._horizontalAlign==c.HorizontalAlign.RIGHT&&(C=g+I);B=l;u=x=0;K=Math.ceil(q);this._verticalAlign==c.VerticalAlign.CONTENT_JUSTIFY&&(K=Math.ceil(Math.max(q,this.maxElementHeight)));for(z=p=0;z<D;z++)if(A=0,(u=this.target.getElementAt(z))&&u.includeInLayout)x=NaN,v?(A=
- NaN,0<E?A=I*u.preferredWidth/J:0>E&&u.preferredWidth>s&&(A=I/w),isNaN(A)||(x=Math.round(A+p),p+=A-x)):x=G[u.hashCode],F?(A=l,u.setLayoutBoundsSize(x,K)):(A=NaN,isNaN(u.percentHeight)||(A=Math.min(100,u.percentHeight),A=Math.round(0.01*q*A)),u.setLayoutBoundsSize(x,A),A=(q-u.layoutBoundsHeight)*r,A=0<A?A:0,A=l+A),u.setLayoutBoundsPosition(Math.round(C),Math.round(A)),x=Math.ceil(u.layoutBoundsWidth),u=Math.ceil(u.layoutBoundsHeight),g=Math.max(g,C+x),B=Math.max(B,A+u),C+=x+n;this.target.setContentSize(Math.ceil(g+
- k),Math.ceil(B+h))};b.flexChildrenProportionally=function(a,b,c,d){var e=d.length,l;do{l=!0;var n=b-a*c/100;0<n?b-=n:n=0;for(var p=b/c,q=0;q<e;q++){var v=d[q],F=v.percent*p;if(F<v.min){l=v.min;v.size=l;d[q]=d[--e];d[e]=v;c-=v.percent;n>=l||(b-=l-n);l=!1;break}else if(F>v.max){l=v.max;v.size=l;d[q]=d[--e];d[e]=v;c-=v.percent;n>=l||(b-=l-n);l=!1;break}else v.size=F}}while(!l)};b.prototype.getElementBoundsLeftOfScrollRect=function(a){var b=new c.Rectangle;if(!this.target)return b;var d=isNaN(this._padding)?
- 0:this._padding,e=isNaN(this._paddingLeft)?d:this._paddingLeft,d=isNaN(this._paddingRight)?d:this._paddingRight,k=this.findIndexAt(a.x,0,this.target.numElements-1);if(-1==k)return a.x>this.target.contentWidth-d?(b.x=this.target.contentWidth-d,b.right=this.target.contentWidth):(b.x=0,b.right=e),b;b.x=this.getStartPosition(k);b.right=this.getElementSize(k)+b.x;b.x==a.x&&(k--,-1!=k?(b.x=this.getStartPosition(k),b.right=this.getElementSize(k)+b.x):(b.x=0,b.right=e));return b};b.prototype.getElementBoundsRightOfScrollRect=
- function(a){var b=new c.Rectangle;if(!this.target)return b;var d=this.target.numElements,e=isNaN(this._padding)?0:this._padding,k=isNaN(this._paddingLeft)?e:this._paddingLeft,e=isNaN(this._paddingRight)?e:this._paddingRight,l=this.findIndexAt(a.right,0,d-1);if(-1==l)return a.right<k?(b.x=0,b.right=k):(b.x=this.target.contentWidth-e,b.right=this.target.contentWidth),b;b.x=this.getStartPosition(l);b.right=this.getElementSize(l)+b.x;b.right<=a.right&&(l++,l<d?(b.x=this.getStartPosition(l),b.right=this.getElementSize(l)+
- b.x):(b.x=this.target.contentWidth-e,b.right=this.target.contentWidth));return b};return b}(c.LayoutBase);c.HorizontalLayout=e;var d=function(){return function(){this.size=0}}()})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this.explicitHorizontalGap=NaN;this._horizontalGap=6;this.explicitVerticalGap=NaN;this._verticalGap=6;this._columnCount=-1;this._requestedColumnCount=0;this._rowCount=-1;this._requestedRowCount=0;this._rowHeight=this.explicitRowHeight=this._columnWidth=this.explicitColumnWidth=NaN;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this._horizontalAlign=c.HorizontalAlign.JUSTIFY;this._verticalAlign=
- c.VerticalAlign.JUSTIFY;this._columnAlign=c.ColumnAlign.LEFT;this._rowAlign=c.RowAlign.TOP;this._orientation=c.TileOrientation.ROWS;this.maxElementHeight=this.maxElementWidth=0;this.endIndex=this.startIndex=-1;this.indexInViewCalculated=!1}__extends(a,d);Object.defineProperty(a.prototype,"horizontalGap",{get:function(){return this._horizontalGap},set:function(a){a!=this._horizontalGap&&(this._horizontalGap=this.explicitHorizontalGap=a,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("gapChanged")&&
- this.dispatchEvent(new c.Event("gapChanged")))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalGap",{get:function(){return this._verticalGap},set:function(a){a!=this._verticalGap&&(this._verticalGap=this.explicitVerticalGap=a,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("gapChanged")&&this.dispatchEvent(new c.Event("gapChanged")))},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnCount",{get:function(){return this._columnCount},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"requestedColumnCount",{get:function(){return this._requestedColumnCount},set:function(a){this._requestedColumnCount!=a&&(this._columnCount=this._requestedColumnCount=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowCount",{get:function(){return this._rowCount},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"requestedRowCount",{get:function(){return this._requestedRowCount},
- set:function(a){this._requestedRowCount!=a&&(this._rowCount=this._requestedRowCount=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnWidth",{get:function(){return this._columnWidth},set:function(a){a!=this._columnWidth&&(this._columnWidth=this.explicitColumnWidth=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowHeight",{get:function(){return this._rowHeight},set:function(a){a!=
- this._rowHeight&&(this._rowHeight=this.explicitRowHeight=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"padding",{get:function(){return this._padding},set:function(a){this._padding!=a&&(this._padding=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(a){this._paddingLeft!=a&&(this._paddingLeft=a,this.invalidateTargetSizeAndDisplayList())},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(a){this._paddingRight!=a&&(this._paddingRight=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(a){this._paddingTop!=a&&(this._paddingTop=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "paddingBottom",{get:function(){return this._paddingBottom},set:function(a){this._paddingBottom!=a&&(this._paddingBottom=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"horizontalAlign",{get:function(){return this._horizontalAlign},set:function(a){this._horizontalAlign!=a&&(this._horizontalAlign=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"verticalAlign",{get:function(){return this._verticalAlign},
- set:function(a){this._verticalAlign!=a&&(this._verticalAlign=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnAlign",{get:function(){return this._columnAlign},set:function(a){this._columnAlign!=a&&(this._columnAlign=a,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowAlign",{get:function(){return this._rowAlign},set:function(a){this._rowAlign!=a&&(this._rowAlign=a,
- this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"orientation",{get:function(){return this._orientation},set:function(a){this._orientation!=a&&(this._orientation=a,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("orientationChanged")&&this.dispatchEvent(new c.Event("orientationChanged")))},enumerable:!0,configurable:!0});a.prototype.invalidateTargetSizeAndDisplayList=function(){this.target&&(this.target.invalidateSize(),
- this.target.invalidateDisplayList())};a.prototype.measure=function(){if(this.target){var a=this._columnCount,c=this._rowCount,d=this._columnWidth,e=this._rowHeight,g=0,k=0;this.calculateRowAndColumn(this.target.explicitWidth,this.target.explicitHeight);var l=0<this._requestedColumnCount?this._requestedColumnCount:this._columnCount,n=0<this._requestedRowCount?this._requestedRowCount:this._rowCount,p=isNaN(this._horizontalGap)?0:this._horizontalGap,q=isNaN(this._verticalGap)?0:this._verticalGap;0<l&&
- (g=l*(this._columnWidth+p)-p);0<n&&(k=n*(this._rowHeight+q)-q);q=isNaN(this._padding)?0:this._padding;l=isNaN(this._paddingLeft)?q:this._paddingLeft;n=isNaN(this._paddingRight)?q:this._paddingRight;p=isNaN(this._paddingTop)?q:this._paddingTop;q=isNaN(this._paddingBottom)?q:this._paddingBottom;p+=q;this.target.measuredWidth=Math.ceil(g+(l+n));this.target.measuredHeight=Math.ceil(k+p);this._columnCount=a;this._rowCount=c;this._columnWidth=d;this._rowHeight=e}};a.prototype.calculateRowAndColumn=function(a,
- d){var e=isNaN(this._horizontalGap)?0:this._horizontalGap,h=isNaN(this._verticalGap)?0:this._verticalGap;this._rowCount=this._columnCount=-1;for(var g=this.target.numElements,k=g,l=0;l<k;l++){var n=this.target.getElementAt(l);n&&!n.includeInLayout&&g--}if(0==g)this._rowCount=this._columnCount=0;else{(isNaN(this.explicitColumnWidth)||isNaN(this.explicitRowHeight))&&this.updateMaxElementSize();isNaN(this.explicitColumnWidth)?this._columnWidth=this.maxElementWidth:this._columnWidth=this.explicitColumnWidth;
- isNaN(this.explicitRowHeight)?this._rowHeight=this.maxElementHeight:this._rowHeight=this.explicitRowHeight;k=this._columnWidth+e;0>=k&&(k=1);l=this._rowHeight+h;0>=l&&(l=1);var n=this.orientation==c.TileOrientation.COLUMNS,p=!isNaN(a),q=!isNaN(d),v=isNaN(this._padding)?0:this._padding,F=isNaN(this._paddingLeft)?v:this._paddingLeft,r=isNaN(this._paddingRight)?v:this._paddingRight,D=isNaN(this._paddingTop)?v:this._paddingTop,v=isNaN(this._paddingBottom)?v:this._paddingBottom;0<this._requestedColumnCount||
- 0<this._requestedRowCount?(0<this._requestedRowCount&&(this._rowCount=Math.min(this._requestedRowCount,g)),0<this._requestedColumnCount&&(this._columnCount=Math.min(this._requestedColumnCount,g))):!p&&!q?(e=Math.sqrt(g*k*l),n?this._rowCount=Math.max(1,Math.round(e/l)):this._columnCount=Math.max(1,Math.round(e/k))):p&&(!q||!n)?(h=Math.max(0,a-F-r),this._columnCount=Math.floor((h+e)/k),this._columnCount=Math.max(1,Math.min(this._columnCount,g))):(e=Math.max(0,d-D-v),this._rowCount=Math.floor((e+h)/
- l),this._rowCount=Math.max(1,Math.min(this._rowCount,g)));-1==this._rowCount&&(this._rowCount=Math.max(1,Math.ceil(g/this._columnCount)));-1==this._columnCount&&(this._columnCount=Math.max(1,Math.ceil(g/this._rowCount)));0<this._requestedColumnCount&&0<this._requestedRowCount&&(this.orientation==c.TileOrientation.ROWS?this._rowCount=Math.max(1,Math.ceil(g/this._requestedColumnCount)):this._columnCount=Math.max(1,Math.ceil(g/this._requestedRowCount)))}};a.prototype.updateMaxElementSize=function(){this.target&&
- (this.useVirtualLayout?this.updateMaxElementSizeVirtual():this.updateMaxElementSizeReal())};a.prototype.updateMaxElementSizeVirtual=function(){var a=this.typicalLayoutRect?this.typicalLayoutRect.height:22;this.maxElementWidth=Math.max(this.maxElementWidth,this.typicalLayoutRect?this.typicalLayoutRect.width:22);this.maxElementHeight=Math.max(this.maxElementHeight,a);if(-1!=this.startIndex&&-1!=this.endIndex)for(a=this.startIndex;a<=this.endIndex;a++){var c=this.target.getVirtualElementAt(a);c&&c.includeInLayout&&
- (this.maxElementWidth=Math.max(this.maxElementWidth,c.preferredWidth),this.maxElementHeight=Math.max(this.maxElementHeight,c.preferredHeight))}};a.prototype.updateMaxElementSizeReal=function(){for(var a=this.target.numElements,c=0;c<a;c++){var d=this.target.getElementAt(c);d&&d.includeInLayout&&(this.maxElementWidth=Math.max(this.maxElementWidth,d.preferredWidth),this.maxElementHeight=Math.max(this.maxElementHeight,d.preferredHeight))}};a.prototype.clearVirtualLayoutCache=function(){d.prototype.clearVirtualLayoutCache.call(this);
- this.maxElementHeight=this.maxElementWidth=0};a.prototype.scrollPositionChanged=function(){d.prototype.scrollPositionChanged.call(this);this.useVirtualLayout&&this.getIndexInView()&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())};a.prototype.getIndexInView=function(){if(!this.target||0==this.target.numElements)return this.startIndex=this.endIndex=-1,!1;var a=this.target.numElements;if(!this.useVirtualLayout)return this.startIndex=0,this.endIndex=a-1,!1;if(isNaN(this.target.width)||
- 0==this.target.width||isNaN(this.target.height)||0==this.target.height)return this.startIndex=this.endIndex=-1,!1;var d=this.startIndex,e=this.endIndex,h=isNaN(this._padding)?0:this._padding,g=isNaN(this._paddingLeft)?h:this._paddingLeft,h=isNaN(this._paddingTop)?h:this._paddingTop,k=isNaN(this._horizontalGap)?0:this._horizontalGap,l=isNaN(this._verticalGap)?0:this._verticalGap;if(this.orientation==c.TileOrientation.COLUMNS){k=this._columnWidth+k;if(0>=k)return this.startIndex=0,this.endIndex=a-1,
- !1;l=this.target.horizontalScrollPosition+this.target.width;h=Math.floor((this.target.horizontalScrollPosition-g)/k);0>h&&(h=0);g=Math.ceil((l-g)/k);0>g&&(g=0);this.startIndex=Math.min(a-1,Math.max(0,h*this._rowCount));this.endIndex=Math.min(a-1,Math.max(0,g*this._rowCount-1))}else{k=this._rowHeight+l;if(0>=k)return this.startIndex=0,this.endIndex=a-1,!1;l=this.target.verticalScrollPosition+this.target.height;g=Math.floor((this.target.verticalScrollPosition-h)/k);0>g&&(g=0);h=Math.ceil((l-h)/k);0>
- h&&(h=0);this.startIndex=Math.min(a-1,Math.max(0,g*this._columnCount));this.endIndex=Math.min(a-1,Math.max(0,h*this._columnCount-1))}return this.startIndex!=d||this.endIndex!=e};a.prototype.updateDisplayList=function(a,e){d.prototype.updateDisplayList.call(this,a,e);if(this.target){var m=isNaN(this._padding)?0:this._padding,h=isNaN(this._paddingLeft)?m:this._paddingLeft,g=isNaN(this._paddingRight)?m:this._paddingRight,k=isNaN(this._paddingTop)?m:this._paddingTop,l=isNaN(this._paddingBottom)?m:this._paddingBottom,
- m=isNaN(this._horizontalGap)?0:this._horizontalGap,n=isNaN(this._verticalGap)?0:this._verticalGap;if(this.indexInViewCalculated)this.indexInViewCalculated=!1;else{this.calculateRowAndColumn(a,e);if(0==this._rowCount||0==this._columnCount){this.target.setContentSize(h+g,k+l);return}this.adjustForJustify(a,e);this.getIndexInView()}this.useVirtualLayout&&(this.calculateRowAndColumn(a,e),this.adjustForJustify(a,e));if(-1==this.startIndex||-1==this.endIndex)this.target.setContentSize(0,0);else{this.target.setVirtualElementIndicesInView(this.startIndex,
- this.endIndex);for(var p,q,v,F=this.orientation==c.TileOrientation.COLUMNS,r=this.startIndex,D=this.startIndex;D<=this.endIndex;D++)p=this.useVirtualLayout?this.target.getVirtualElementAt(D):this.target.getElementAt(D),null!=p&&p.includeInLayout&&(F?(q=Math.ceil((r+1)/this._rowCount)-1,v=Math.ceil((r+1)%this._rowCount)-1,-1==v&&(v=this._rowCount-1)):(q=Math.ceil((r+1)%this._columnCount)-1,-1==q&&(q=this._columnCount-1),v=Math.ceil((r+1)/this._columnCount)-1),q=q*(this._columnWidth+m)+h,v=v*(this._rowHeight+
- n)+k,this.sizeAndPositionElement(p,q,v,this._columnWidth,this.rowHeight),r++);k+=l;n=(this._rowHeight+n)*this._rowCount-n;this.target.setContentSize(Math.ceil((this._columnWidth+m)*this._columnCount-m+(h+g)),Math.ceil(n+k))}}};a.prototype.sizeAndPositionElement=function(a,d,e,h,g){var k=NaN,l=NaN;this.horizontalAlign==c.HorizontalAlign.JUSTIFY?k=h:isNaN(a.percentWidth)||(k=0.01*h*a.percentWidth);this.verticalAlign==c.VerticalAlign.JUSTIFY?l=g:isNaN(a.percentHeight)||(l=0.01*g*a.percentHeight);a.setLayoutBoundsSize(Math.round(k),
- Math.round(l));k=d;switch(this.horizontalAlign){case c.HorizontalAlign.RIGHT:k+=h-a.layoutBoundsWidth;break;case c.HorizontalAlign.CENTER:k=d+(h-a.layoutBoundsWidth)/2}d=e;switch(this.verticalAlign){case c.VerticalAlign.BOTTOM:d+=g-a.layoutBoundsHeight;break;case c.VerticalAlign.MIDDLE:d+=(g-a.layoutBoundsHeight)/2}a.setLayoutBoundsPosition(Math.round(k),Math.round(d))};a.prototype.adjustForJustify=function(a,d){var e=isNaN(this._padding)?0:this._padding,h=isNaN(this._paddingLeft)?e:this._paddingLeft,
- g=isNaN(this._paddingRight)?e:this._paddingRight,k=isNaN(this._paddingTop)?e:this._paddingTop,e=isNaN(this._paddingBottom)?e:this._paddingBottom,h=Math.max(0,a-h-g),k=Math.max(0,d-k-e);isNaN(this.explicitVerticalGap)||(this._verticalGap=this.explicitVerticalGap);isNaN(this.explicitHorizontalGap)||(this._horizontalGap=this.explicitHorizontalGap);this._verticalGap=isNaN(this._verticalGap)?0:this._verticalGap;this._horizontalGap=isNaN(this._horizontalGap)?0:this._horizontalGap;k-=this._rowHeight*this._rowCount;
- h-=this._columnWidth*this._columnCount;0<k&&(this.rowAlign==c.RowAlign.JUSTIFY_USING_GAP?(g=Math.max(1,this._rowCount-1),this._verticalGap=k/g):this.rowAlign==c.RowAlign.JUSTIFY_USING_HEIGHT&&0<this._rowCount&&(this._rowHeight+=(k-(this._rowCount-1)*this._verticalGap)/this._rowCount));0<h&&(this.columnAlign==c.ColumnAlign.JUSTIFY_USING_GAP?(g=Math.max(1,this._columnCount-1),this._horizontalGap=h/g):this.columnAlign==c.ColumnAlign.JUSTIFY_USING_WIDTH&&0<this._columnCount&&(this._columnWidth+=(h-(this._columnCount-
- 1)*this._horizontalGap)/this._columnCount))};a.prototype.getElementBoundsLeftOfScrollRect=function(a){var d=new c.Rectangle,e=isNaN(this._padding)?0:this._padding,h=isNaN(this._paddingLeft)?e:this._paddingLeft,e=isNaN(this._paddingRight)?e:this._paddingRight,g=isNaN(this._horizontalGap)?0:this._horizontalGap;a.x>this.target.contentWidth-e?(d.x=this.target.contentWidth-e,d.right=this.target.contentWidth):a.x>h?(a=Math.floor((a.x-1-h)/(this._columnWidth+g)),d.x=this.leftEdge(a),d.right=this.rightEdge(a)):
- (d.x=0,d.right=h);return d};a.prototype.getElementBoundsRightOfScrollRect=function(a){var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingLeft)?d:this._paddingLeft,h=isNaN(this._paddingRight)?d:this._paddingRight,g=isNaN(this._horizontalGap)?0:this._horizontalGap,d=new c.Rectangle;a.right<e?(d.x=0,d.right=e):a.right<this.target.contentWidth-h?(a=Math.floor((a.right+1+g-e)/(this._columnWidth+g)),d.x=this.leftEdge(a),d.right=this.rightEdge(a)):(d.x=this.target.contentWidth-h,d.right=this.target.contentWidth);
- return d};a.prototype.getElementBoundsAboveScrollRect=function(a){var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingTop)?d:this._paddingTop,h=isNaN(this._paddingBottom)?d:this._paddingBottom,g=isNaN(this._verticalGap)?0:this._verticalGap,d=new c.Rectangle;a.y>this.target.contentHeight-h?(d.y=this.target.contentHeight-h,d.bottom=this.target.contentHeight):a.y>e?(a=Math.floor((a.y-1-e)/(this._rowHeight+g)),d.y=this.topEdge(a),d.bottom=this.bottomEdge(a)):(d.y=0,d.bottom=e);return d};a.prototype.getElementBoundsBelowScrollRect=
- function(a){var d=isNaN(this._padding)?0:this._padding,e=isNaN(this._paddingTop)?d:this._paddingTop,h=isNaN(this._paddingBottom)?d:this._paddingBottom,g=isNaN(this._verticalGap)?0:this._verticalGap,d=new c.Rectangle;a.bottom<e?(d.y=0,d.bottom=e):a.bottom<this.target.contentHeight-h?(a=Math.floor((a.bottom+1+g-e)/(this._rowHeight+g)),d.y=this.topEdge(a),d.bottom=this.bottomEdge(a)):(d.y=this.target.contentHeight-h,d.bottom=this.target.contentHeight);return d};a.prototype.leftEdge=function(a){if(0>
- a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingLeft)?c:this._paddingLeft,d=isNaN(this._horizontalGap)?0:this._horizontalGap;return Math.max(0,a*(this._columnWidth+d))+c};a.prototype.rightEdge=function(a){if(0>a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingLeft)?c:this._paddingLeft,d=isNaN(this._horizontalGap)?0:this._horizontalGap;return Math.min(this.target.contentWidth,a*(this._columnWidth+d)+this._columnWidth)+c};a.prototype.topEdge=function(a){if(0>
- a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingTop)?c:this._paddingTop,d=isNaN(this._verticalGap)?0:this._verticalGap;return Math.max(0,a*(this._rowHeight+d))+c};a.prototype.bottomEdge=function(a){if(0>a)return 0;var c=isNaN(this._padding)?0:this._padding,c=isNaN(this._paddingTop)?c:this._paddingTop,d=isNaN(this._verticalGap)?0:this._verticalGap;return Math.min(this.target.contentHeight,a*(this._rowHeight+d)+this._rowHeight)+c};return a}(c.LayoutBase);c.TileLayout=e})(ns_egret||
- (ns_egret={}));(function(c){var e=function(){function c(a,b,d){this.raw_getElementAt="raw_getElementAt";this.raw_addElementAt="raw_addElementAt";this.raw_getElementIndex="raw_getElementIndex";this.raw_removeElement="raw_removeElement";this.raw_removeElementAt="raw_removeElementAt";this.raw_setElementIndex="raw_setElementIndex";this.owner=a;this.lowerBoundReference=b;this.upperBoundReference=d}Object.defineProperty(c.prototype,"numElements",{get:function(){return this.owner[this.upperBoundReference]-this.owner[this.lowerBoundReference]},
- enumerable:!0,configurable:!0});c.prototype.getElementAt=function(a){return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference]+a)};c.prototype.addElement=function(a){var b=this.owner[this.upperBoundReference];a.parent===this.owner&&b--;this.owner[this.upperBoundReference]++;this.owner[this.raw_addElementAt](a,b);a.ownerChanged(this);return a};c.prototype.addElementAt=function(a,b){this.owner[this.upperBoundReference]++;this.owner[this.raw_addElementAt](a,this.owner[this.lowerBoundReference]+
- b);a.ownerChanged(this);return a};c.prototype.removeElement=function(a){var b=this.owner[this.raw_getElementIndex](a);this.owner[this.lowerBoundReference]<=b&&b<this.owner[this.upperBoundReference]&&(this.owner[this.raw_removeElement](a),this.owner[this.upperBoundReference]--);a.ownerChanged(null);return a};c.prototype.removeElementAt=function(a){a+=this.owner[this.lowerBoundReference];var b;this.owner[this.lowerBoundReference]<=a&&a<this.owner[this.upperBoundReference]&&(b=this.owner[this.raw_removeElementAt](a),
- this.owner[this.upperBoundReference]--);b.ownerChanged(null);return b};c.prototype.getElementIndex=function(a){a=this.owner[this.raw_getElementIndex](a);return a-=this.owner[this.lowerBoundReference]};c.prototype.setElementIndex=function(a,b){this.owner[this.raw_setElementIndex](a,this.owner[this.lowerBoundReference]+b)};return c}();c.SystemContainer=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._cursorIndex=this._toolTipIndex=this._topMostIndex=this._noTopMostIndex=0;this.addEventListener(c.Event.ADDED_TO_STAGE,this.onAddToStage,this);this.addEventListener(c.Event.REMOVED_FROM_STAGE,this.onRemoveFromStage,this)}__extends(a,d);a.prototype.onAddToStage=function(a){if(c.UIGlobals._systemManager)throw Error("SystemManager\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01");c.UIGlobals._systemManager=
- this;this.stage.addEventListener(c.Event.RESIZE,this.onResize,this);this.onResize()};a.prototype.onRemoveFromStage=function(a){c.UIGlobals._systemManager=null;this.stage.removeEventListener(c.Event.RESIZE,this.onResize,this)};a.prototype.onResize=function(a){this._setWidth(this.stage.stageWidth);this._setHeight(this.stage.stageHeight)};Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"y",{get:function(){return this._y},
- set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._width},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this._height},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleX",{get:function(){return this._scaleX},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleY",{get:function(){return this._scaleY},
- set:function(a){},enumerable:!0,configurable:!0});a.prototype.setActualSize=function(a,c){};a.prototype.setLayoutBoundsPosition=function(a,c){};a.prototype.setLayoutBoundsSize=function(a,c){};Object.defineProperty(a.prototype,"layout",{get:function(){return this._layout},set:function(a){a instanceof c.BasicLayout&&this._setLayout(a)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"popUpContainer",{get:function(){this._popUpContainer||(this._popUpContainer=new c.SystemContainer(this,
- "noTopMostIndex","topMostIndex"));return this._popUpContainer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"toolTipContainer",{get:function(){this._toolTipContainer||(this._toolTipContainer=new c.SystemContainer(this,"topMostIndex","toolTipIndex"));return this._toolTipContainer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cursorContainer",{get:function(){this._cursorContainer||(this._cursorContainer=new c.SystemContainer(this,"toolTipIndex","cursorIndex"));
- return this._cursorContainer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"noTopMostIndex",{get:function(){return this._noTopMostIndex},set:function(a){var c=a-this._noTopMostIndex;this._noTopMostIndex=a;this.topMostIndex+=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"topMostIndex",{get:function(){return this._topMostIndex},set:function(a){var c=a-this._topMostIndex;this._topMostIndex=a;this.toolTipIndex+=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "toolTipIndex",{get:function(){return this._toolTipIndex},set:function(a){var c=a-this._toolTipIndex;this._toolTipIndex=a;this.cursorIndex+=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cursorIndex",{get:function(){return this._cursorIndex},set:function(a){this._cursorIndex=a},enumerable:!0,configurable:!0});a.prototype.addElement=function(a){var c=this._noTopMostIndex;a.parent==this&&c--;return this.addElementAt(a,c)};a.prototype.addElementAt=function(a,c){if(a.parent==this){var e=
- this.getElementIndex(a);e<this._noTopMostIndex?this.noTopMostIndex--:e>=this._noTopMostIndex&&e<this._topMostIndex?this.topMostIndex--:e>=this._topMostIndex&&e<this._toolTipIndex?this.toolTipIndex--:this.cursorIndex--}c<=this._noTopMostIndex?this.noTopMostIndex++:c>this._noTopMostIndex&&c<=this._topMostIndex?this.topMostIndex++:c>this._topMostIndex&&c<=this._toolTipIndex?this.toolTipIndex++:this.cursorIndex++;return d.prototype.addElementAt.call(this,a,c)};a.prototype.removeElement=function(a){return this.removeElementAt(d.prototype.getElementIndex.call(this,
- a))};a.prototype.removeElementAt=function(a){var c=d.prototype.removeElementAt.call(this,a);a<this._noTopMostIndex?this.noTopMostIndex--:a>=this._noTopMostIndex&&a<this._topMostIndex?this.topMostIndex--:a>=this._topMostIndex&&a<this._toolTipIndex?this.toolTipIndex--:this.cursorIndex--;return c};a.prototype.removeAllElements=function(){for(;0<this._noTopMostIndex;)d.prototype.removeElementAt.call(this,0),this.noTopMostIndex--};a.prototype.elementRemoved=function(a,e,m){"undefined"===typeof m&&(m=!0);
- m&&a.dispatchEvent(new c.Event("removeFromSystemManager"));d.prototype.elementRemoved.call(this,a,e,m)};a.prototype.raw_getElementAt=function(a){return d.prototype.getElementAt.call(this,a)};a.prototype.raw_addElement=function(a){var c=this.numElements;a.parent==this&&c--;return this.raw_addElementAt(a,c)};a.prototype.raw_addElementAt=function(a,c){if(a.parent==this){var e=this.getElementIndex(a);e<this._noTopMostIndex?this.noTopMostIndex--:e>=this._noTopMostIndex&&e<this._topMostIndex?this.topMostIndex--:
- e>=this._topMostIndex&&e<this._toolTipIndex?this.toolTipIndex--:this.cursorIndex--}return d.prototype.addElementAt.call(this,a,c)};a.prototype.raw_removeElement=function(a){return d.prototype.removeElementAt.call(this,d.prototype.getElementIndex.call(this,a))};a.prototype.raw_removeElementAt=function(a){return d.prototype.removeElementAt.call(this,a)};a.prototype.raw_removeAllElements=function(){for(;0<this.numElements;)d.prototype.removeElementAt.call(this,0)};a.prototype.raw_getElementIndex=function(a){return d.prototype.getElementIndex.call(this,
- a)};a.prototype.raw_setElementIndex=function(a,c){d.prototype.setElementIndex.call(this,a,c)};a.prototype.raw_swapElements=function(a,c){d.prototype.swapElementsAt.call(this,d.prototype.getElementIndex.call(this,a),d.prototype.getElementIndex.call(this,c))};a.prototype.raw_swapElementsAt=function(a,c){d.prototype.swapElementsAt.call(this,a,c)};return a}(c.Group);c.SystemManager=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(a){function b(){a.call(this);this._popUpList=[];this.popUpDataList=[];this._modalColor=0;this._modalAlpha=0.5;this.invalidateModalFlag=!1}__extends(b,a);Object.defineProperty(b.prototype,"popUpList",{get:function(){return this._popUpList.concat()},enumerable:!0,configurable:!0});b.prototype.findPopUpData=function(a){for(var b=this.popUpDataList,c=b.length,d=0;d<c;d++){var e=b[d];if(e.popUp==a)return e}return null};b.prototype.addPopUp=function(a,e,h){"undefined"===typeof e&&
- (e=!1);"undefined"===typeof h&&(h=!0);var g=c.UIGlobals.systemManager,k=this.findPopUpData(a);k?(k.modal=e,a.removeEventListener(b.REMOVE_FROM_SYSTEMMANAGER,this.onRemoved,this)):(k=new d(a,e),this.popUpDataList.push(k),this._popUpList.push(a));g.popUpContainer.addElement(a);h&&this.centerPopUp(a);"isPopUp"in a&&(a.isPopUp=!0);e&&this.invalidateModal();a.addEventListener(b.REMOVE_FROM_SYSTEMMANAGER,this.onRemoved,this)};b.prototype.onRemoved=function(a){for(var c=0,d=this.popUpDataList,e=d.length,
- k=0;k<e;k++){var l=d[k];if(l.popUp==a.target){"isPopUp"in l.popUp&&(l.popUp.isPopUp=!1);l.popUp.removeEventListener(b.REMOVE_FROM_SYSTEMMANAGER,this.onRemoved,this);this.popUpDataList.splice(c,1);this._popUpList.splice(c,1);this.invalidateModal();break}c++}};Object.defineProperty(b.prototype,"modalColor",{get:function(){return this._modalColor},set:function(a){this._modalColor!=a&&(this._modalColor=a,this.invalidateModal())},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"modalAlpha",
- {get:function(){return this._modalAlpha},set:function(a){this._modalAlpha!=a&&(this._modalAlpha=a,this.invalidateModal())},enumerable:!0,configurable:!0});b.prototype.invalidateModal=function(){this.invalidateModalFlag||(this.invalidateModalFlag=!0,c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME,this.validateModal,this),c.UIGlobals.stage.addEventListener(c.Event.RENDER,this.validateModal,this),c.UIGlobals.stage.invalidate())};b.prototype.validateModal=function(a){this.invalidateModalFlag=!1;
- c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,this.validateModal,this);c.UIGlobals.stage.removeEventListener(c.Event.RENDER,this.validateModal,this);this.updateModal(c.UIGlobals.systemManager)};b.prototype.updateModal=function(a){for(var b=a.popUpContainer,d=!1,e=b.numElements-1;0<=e;e--){var k=b.getElementAt(e);if((k=this.findPopUpData(k))&&k.modal){d=!0;break}}d?(this.modalMask||(this.modalMask=new c.Rect,this.modalMask.touchEnabled=!0,this.modalMask.top=this.modalMask.left=this.modalMask.right=
- this.modalMask.bottom=0),this.modalMask.fillColor=this._modalColor,this.modalMask.alpha=this._modalAlpha,this.modalMask.parent==a?(b.getElementIndex(this.modalMask)<e&&e--,b.setElementIndex(this.modalMask,e)):b.addElementAt(this.modalMask,e)):this.modalMask&&this.modalMask.parent==a&&b.removeElement(this.modalMask)};b.prototype.removePopUp=function(a){a&&(a.parent&&this.findPopUpData(a))&&("removeElement"in a.parent?a.parent.removeElement(a):a instanceof c.DisplayObject&&a.parent.removeChild(a))};
- b.prototype.centerPopUp=function(a){a.top=a.bottom=a.left=a.right=NaN;a.verticalCenter=a.horizontalCenter=0;var b=a.parent;b&&("validateNow"in a&&a.validateNow(),a.x=0.5*(b.width-a.layoutBoundsWidth),a.y=0.5*(b.height-a.layoutBoundsHeight))};b.prototype.bringToFront=function(a){if(this.findPopUpData(a)&&a.parent&&"popUpContainer"in a.parent){var b=a.parent;b.popUpContainer.setElementIndex(a,b.popUpContainer.numElements-1);this.invalidateModal()}};b.REMOVE_FROM_SYSTEMMANAGER="removeFromSystemManager";
- return b}(c.EventDispatcher);c.PopUpManagerImpl=e;var d=function(){return function(a,b){this.popUp=a;this.modal=b}}()})(ns_egret||(ns_egret={}));(function(c){var e=function(){function d(){}Object.defineProperty(d,"impl",{get:function(){if(!d._impl)try{d._impl=c.Injector.getInstance("IPopUpManager")}catch(a){d._impl=new c.PopUpManagerImpl}return d._impl},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"modalColor",{get:function(){return d.impl.modalColor},set:function(a){d.impl.modalColor=a},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"modalAlpha",{get:function(){return d.impl.modalAlpha},set:function(a){d.impl.modalAlpha=
- a},enumerable:!0,configurable:!0});d.addPopUp=function(a,b,e){"undefined"===typeof b&&(b=!1);"undefined"===typeof e&&(e=!0);d.impl.addPopUp(a,b,e);d.impl.dispatchEvent(new c.PopUpEvent(c.PopUpEvent.ADD_POPUP,!1,!1,a,b))};d.removePopUp=function(a){d.impl.removePopUp(a);d.impl.dispatchEvent(new c.PopUpEvent(c.PopUpEvent.REMOVE_POPUP,!1,!1,a))};d.centerPopUp=function(a){d.impl.centerPopUp(a)};d.bringToFront=function(a){d.impl.bringToFront(a);d.impl.dispatchEvent(new c.PopUpEvent(c.PopUpEvent.BRING_TO_FRONT,
- !1,!1,a))};Object.defineProperty(d,"popUpList",{get:function(){return d.impl.popUpList},enumerable:!0,configurable:!0});d.addEventListener=function(a,b,c,e,h){"undefined"===typeof e&&(e=!1);"undefined"===typeof h&&(h=0);d.impl.addEventListener(a,b,this,e,h)};d.removeEventListener=function(a,b,c,e){"undefined"===typeof e&&(e=!1);d.impl.removeEventListener(a,b,c,e)};return d}();c.PopUpManager=e})(ns_egret||(ns_egret={}));var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},dragonBones;
- (function(c){(function(a){var b=function(){function a(b,c){"undefined"===typeof b&&(b=0);"undefined"===typeof c&&(c=0);this.x=b;this.y=c}a.prototype.toString=function(){return"[Point (x\x3d"+this.x+" y\x3d"+this.y+")]"};return a}();a.Point=b;b=function(){return function(a,b,c,d){"undefined"===typeof a&&(a=0);"undefined"===typeof b&&(b=0);"undefined"===typeof c&&(c=0);"undefined"===typeof d&&(d=0);this.x=a;this.y=b;this.width=c;this.height=d}}();a.Rectangle=b;b=function(){function a(){this.a=1;this.c=
- this.b=0;this.d=1;this.ty=this.tx=0}a.prototype.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;this.a=d/f;this.b=-b/f;this.c=-c/f;this.d=a/f;this.tx=(c*this.ty-d*e)/f;this.ty=-(a*this.ty-b*e)/f};return a}();a.Matrix=b;b=function(){return function(){this.redOffset=this.redMultiplier=this.greenOffset=this.greenMultiplier=this.blueOffset=this.blueMultiplier=this.alphaOffset=this.alphaMultiplier=0}}();a.ColorTransform=b})(c.geom||(c.geom={}));var e=c.geom;(function(a){var b=
- function(){return function(a){this.type=a}}();a.Event=b;var c=function(a){function b(c){a.call(this,c)}__extends(b,a);b.FADE_IN="fadeIn";b.FADE_OUT="fadeOut";b.START="start";b.COMPLETE="complete";b.LOOP_COMPLETE="loopComplete";b.FADE_IN_COMPLETE="fadeInComplete";b.FADE_OUT_COMPLETE="fadeOutComplete";return b}(b);a.AnimationEvent=c;c=function(a){function b(c){a.call(this,c)}__extends(b,a);b.Z_ORDER_UPDATED="zOrderUpdated";return b}(b);a.ArmatureEvent=c;c=function(a){function b(c){a.call(this,c)}__extends(b,
- a);b.ANIMATION_FRAME_EVENT="animationFrameEvent";b.BONE_FRAME_EVENT="boneFrameEvent";return b}(b);a.FrameEvent=c;b=function(a){function b(c){a.call(this,c)}__extends(b,a);b.SOUND="sound";b.BONE_FRAME_EVENT="boneFrameEvent";return b}(b);a.SoundEvent=b;b=function(){function a(){}a.prototype.hasEventListener=function(a){return this._listenersMap&&this._listenersMap[a]?!0:!1};a.prototype.addEventListener=function(a,b){if(a&&b){this._listenersMap||(this._listenersMap={});var c=this._listenersMap[a];c&&
- this.removeEventListener(a,b);c?c.push(b):this._listenersMap[a]=[b]}};a.prototype.removeEventListener=function(a,b){if(this._listenersMap&&a&&b){var c=this._listenersMap[a];if(c)for(var d=c.length,e=0;e<d;e++)c[e]==b&&(1==d?(c.length=0,delete this._listenersMap[a]):c.splice(e,1))}};a.prototype.removeAllEventListeners=function(a){a?delete this._listenersMap[a]:this._listenersMap=null};a.prototype.dispatchEvent=function(a){if(a){var b=this._listenersMap[a.type];if(b){a.target=this;for(var c=b.concat(),
- b=b.length,d=0;d<b;d++)c[d](a)}}};return a}();a.EventDispatcher=b;b=function(a){function b(){a.call(this);if(b._instance)throw Error("Singleton already constructed!");}__extends(b,a);b.getInstance=function(){b._instance||(b._instance=new b);return b._instance};return b}(b);a.SoundEventManager=b})(c.events||(c.events={}));var d=c.events;(function(a){var c=function(){function a(){this.timeScale=1;this.time=0.001*(new Date).getTime();this._animatableList=[]}a.prototype.contains=function(a){return 0<=
- this._animatableList.indexOf(a)};a.prototype.add=function(a){a&&-1==this._animatableList.indexOf(a)&&this._animatableList.push(a)};a.prototype.remove=function(a){a=this._animatableList.indexOf(a);0<=a&&(this._animatableList[a]=null)};a.prototype.clear=function(){this._animatableList.length=0};a.prototype.advanceTime=function(a){if(0>a){var b=0.001*(new Date).getTime();a=b-this.time;this.time=b}a*=this.timeScale;b=this._animatableList.length;if(0!=b){for(var c=0,d=0;d<b;d++){var e=this._animatableList[d];
- e&&(c!=d&&(this._animatableList[c]=e,this._animatableList[d]=null),e.advanceTime(a),c++)}if(c!=d){for(b=this._animatableList.length;d<b;)this._animatableList[c++]=this._animatableList[d++];this._animatableList.length=c}}};a.clock=new a;return a}();a.WorldClock=c;var h=function(){function a(){this.transform=new b.DBTransform;this.pivot=new e.Point;this._durationTransform=new b.DBTransform;this._durationPivot=new e.Point;this._durationColor=new e.ColorTransform}a._borrowObject=function(){return 0==
- a._pool.length?new a:a._pool.pop()};a._returnObject=function(b){0>a._pool.indexOf(b)&&(a._pool[a._pool.length]=b);b.clear()};a._clear=function(){for(var b=a._pool.length;b--;)a._pool[b].clear();a._pool.length=0};a.getEaseValue=function(b,c){if(1<c){var d=0.5*(1-Math.cos(b*Math.PI))-b;c-=1}else 0<c?d=Math.sin(b*a.HALF_PI)-b:0>c&&(d=1-Math.cos(b*a.HALF_PI)-b,c*=-1);return d*c+b};a.prototype.fadeIn=function(a,b,c){this._bone=a;this._animationState=b;this._timeline=c;this._originTransform=this._timeline.originTransform;
- this._originPivot=this._timeline.originPivot;this._tweenColor=this._tweenTransform=!1;this._totalTime=this._animationState.totalTime;this.transform.x=0;this.transform.y=0;this.transform.scaleX=0;this.transform.scaleY=0;this.transform.skewX=0;this.transform.skewY=0;this.pivot.x=0;this.pivot.y=0;this._durationTransform.x=0;this._durationTransform.y=0;this._durationTransform.scaleX=0;this._durationTransform.scaleY=0;this._durationTransform.skewX=0;this._durationTransform.skewY=0;this._durationPivot.x=
- 0;this._durationPivot.y=0;this._currentFrame=null;switch(this._timeline.getFrameList().length){case 0:this._bone._arriveAtFrame(null,this,this._animationState,!1);this._updateState=0;break;case 1:this._updateState=-1;break;default:this._updateState=1}};a.prototype.fadeOut=function(){this.transform.skewX=f.TransformUtil.formatRadian(this.transform.skewX);this.transform.skewY=f.TransformUtil.formatRadian(this.transform.skewY)};a.prototype.update=function(b){if(this._updateState)if(0<this._updateState){b=
- 0==this._timeline.scale?1:b/this._timeline.scale;1==b&&(b=0.99999999);b+=this._timeline.offset;var c=Math.floor(b);b-=c;for(var d=this._totalTime*b,e=!1,h;!this._currentFrame||d>this._currentFramePosition+this._currentFrameDuration||d<this._currentFramePosition;)e&&this._bone._arriveAtFrame(this._currentFrame,this,this._animationState,!0),e=!0,this._currentFrame?(h=this._timeline.getFrameList().indexOf(this._currentFrame)+1,h>=this._timeline.getFrameList().length&&(h=0),this._currentFrame=this._timeline.getFrameList()[h]):
- (h=0,this._currentFrame=this._timeline.getFrameList()[0]),this._currentFrameDuration=this._currentFrame.duration,this._currentFramePosition=this._currentFrame.position;e&&(this.tweenActive=0<=this._currentFrame.displayIndex,h++,h>=this._timeline.getFrameList().length&&(h=0),e=this._timeline.getFrameList()[h],0==h&&this._animationState.loop&&this._animationState.loopCount>=Math.abs(this._animationState.loop)-1&&0.99999999<((this._currentFramePosition+this._currentFrameDuration)/this._totalTime+c-this._timeline.offset)*
- this._timeline.scale?(this._updateState=0,this._tweenEasing=NaN):0>this._currentFrame.displayIndex||0>e.displayIndex||!this._animationState.tweenEnabled?this._tweenEasing=NaN:isNaN(this._animationState.clip.tweenEasing)?this._tweenEasing=this._currentFrame.tweenEasing:this._tweenEasing=this._animationState.clip.tweenEasing,isNaN(this._tweenEasing)?this._tweenColor=this._tweenTransform=!1:(this._durationTransform.x=e.transform.x-this._currentFrame.transform.x,this._durationTransform.y=e.transform.y-
- this._currentFrame.transform.y,this._durationTransform.skewX=e.transform.skewX-this._currentFrame.transform.skewX,this._durationTransform.skewY=e.transform.skewY-this._currentFrame.transform.skewY,this._durationTransform.scaleX=e.transform.scaleX-this._currentFrame.transform.scaleX,this._durationTransform.scaleY=e.transform.scaleY-this._currentFrame.transform.scaleY,0==h&&(this._durationTransform.skewX=f.TransformUtil.formatRadian(this._durationTransform.skewX),this._durationTransform.skewY=f.TransformUtil.formatRadian(this._durationTransform.skewY)),
- this._durationPivot.x=e.pivot.x-this._currentFrame.pivot.x,this._durationPivot.y=e.pivot.y-this._currentFrame.pivot.y,this._tweenTransform=0!=this._durationTransform.x||0!=this._durationTransform.y||0!=this._durationTransform.skewX||0!=this._durationTransform.skewY||0!=this._durationTransform.scaleX||0!=this._durationTransform.scaleY||0!=this._durationPivot.x||0!=this._durationPivot.y?!0:!1,this._currentFrame.color&&e.color?(this._durationColor.alphaOffset=e.color.alphaOffset-this._currentFrame.color.alphaOffset,
- this._durationColor.redOffset=e.color.redOffset-this._currentFrame.color.redOffset,this._durationColor.greenOffset=e.color.greenOffset-this._currentFrame.color.greenOffset,this._durationColor.blueOffset=e.color.blueOffset-this._currentFrame.color.blueOffset,this._durationColor.alphaMultiplier=e.color.alphaMultiplier-this._currentFrame.color.alphaMultiplier,this._durationColor.redMultiplier=e.color.redMultiplier-this._currentFrame.color.redMultiplier,this._durationColor.greenMultiplier=e.color.greenMultiplier-
- this._currentFrame.color.greenMultiplier,this._durationColor.blueMultiplier=e.color.blueMultiplier-this._currentFrame.color.blueMultiplier,this._tweenColor=0!=this._durationColor.alphaOffset||0!=this._durationColor.redOffset||0!=this._durationColor.greenOffset||0!=this._durationColor.blueOffset||0!=this._durationColor.alphaMultiplier||0!=this._durationColor.redMultiplier||0!=this._durationColor.greenMultiplier||0!=this._durationColor.blueMultiplier?!0:!1):this._currentFrame.color?(this._tweenColor=
- !0,this._durationColor.alphaOffset=-this._currentFrame.color.alphaOffset,this._durationColor.redOffset=-this._currentFrame.color.redOffset,this._durationColor.greenOffset=-this._currentFrame.color.greenOffset,this._durationColor.blueOffset=-this._currentFrame.color.blueOffset,this._durationColor.alphaMultiplier=1-this._currentFrame.color.alphaMultiplier,this._durationColor.redMultiplier=1-this._currentFrame.color.redMultiplier,this._durationColor.greenMultiplier=1-this._currentFrame.color.greenMultiplier,
- this._durationColor.blueMultiplier=1-this._currentFrame.color.blueMultiplier):e.color?(this._tweenColor=!0,this._durationColor.alphaOffset=e.color.alphaOffset,this._durationColor.redOffset=e.color.redOffset,this._durationColor.greenOffset=e.color.greenOffset,this._durationColor.blueOffset=e.color.blueOffset,this._durationColor.alphaMultiplier=e.color.alphaMultiplier-1,this._durationColor.redMultiplier=e.color.redMultiplier-1,this._durationColor.greenMultiplier=e.color.greenMultiplier-1,this._durationColor.blueMultiplier=
- e.color.blueMultiplier-1):this._tweenColor=!1),this._tweenTransform||(this._animationState.blend?(this.transform.x=this._originTransform.x+this._currentFrame.transform.x,this.transform.y=this._originTransform.y+this._currentFrame.transform.y,this.transform.skewX=this._originTransform.skewX+this._currentFrame.transform.skewX,this.transform.skewY=this._originTransform.skewY+this._currentFrame.transform.skewY,this.transform.scaleX=this._originTransform.scaleX+this._currentFrame.transform.scaleX,this.transform.scaleY=
- this._originTransform.scaleY+this._currentFrame.transform.scaleY,this.pivot.x=this._originPivot.x+this._currentFrame.pivot.x,this.pivot.y=this._originPivot.y+this._currentFrame.pivot.y):(this.transform.x=this._currentFrame.transform.x,this.transform.y=this._currentFrame.transform.y,this.transform.skewX=this._currentFrame.transform.skewX,this.transform.skewY=this._currentFrame.transform.skewY,this.transform.scaleX=this._currentFrame.transform.scaleX,this.transform.scaleY=this._currentFrame.transform.scaleY,
- this.pivot.x=this._currentFrame.pivot.x,this.pivot.y=this._currentFrame.pivot.y)),this._tweenColor||(this._currentFrame.color?this._bone._updateColor(this._currentFrame.color.alphaOffset,this._currentFrame.color.redOffset,this._currentFrame.color.greenOffset,this._currentFrame.color.blueOffset,this._currentFrame.color.alphaMultiplier,this._currentFrame.color.redMultiplier,this._currentFrame.color.greenMultiplier,this._currentFrame.color.blueMultiplier,!0):this._bone._isColorChanged&&this._bone._updateColor(0,
- 0,0,0,1,1,1,1,!1)),this._bone._arriveAtFrame(this._currentFrame,this,this._animationState,!1));if(this._tweenTransform||this._tweenColor)b=(d-this._currentFramePosition)/this._currentFrameDuration,this._tweenEasing&&(b=a.getEaseValue(b,this._tweenEasing));this._tweenTransform&&(c=this._currentFrame.transform,d=this._currentFrame.pivot,this._animationState.blend?(this.transform.x=this._originTransform.x+c.x+this._durationTransform.x*b,this.transform.y=this._originTransform.y+c.y+this._durationTransform.y*
- b,this.transform.skewX=this._originTransform.skewX+c.skewX+this._durationTransform.skewX*b,this.transform.skewY=this._originTransform.skewY+c.skewY+this._durationTransform.skewY*b,this.transform.scaleX=this._originTransform.scaleX+c.scaleX+this._durationTransform.scaleX*b,this.transform.scaleY=this._originTransform.scaleY+c.scaleY+this._durationTransform.scaleY*b,this.pivot.x=this._originPivot.x+d.x+this._durationPivot.x*b,this.pivot.y=this._originPivot.y+d.y+this._durationPivot.y*b):(this.transform.x=
- c.x+this._durationTransform.x*b,this.transform.y=c.y+this._durationTransform.y*b,this.transform.skewX=c.skewX+this._durationTransform.skewX*b,this.transform.skewY=c.skewY+this._durationTransform.skewY*b,this.transform.scaleX=c.scaleX+this._durationTransform.scaleX*b,this.transform.scaleY=c.scaleY+this._durationTransform.scaleY*b,this.pivot.x=d.x+this._durationPivot.x*b,this.pivot.y=d.y+this._durationPivot.y*b));this._tweenColor&&(this._currentFrame.color?this._bone._updateColor(this._currentFrame.color.alphaOffset+
- this._durationColor.alphaOffset*b,this._currentFrame.color.redOffset+this._durationColor.redOffset*b,this._currentFrame.color.greenOffset+this._durationColor.greenOffset*b,this._currentFrame.color.blueOffset+this._durationColor.blueOffset*b,this._currentFrame.color.alphaMultiplier+this._durationColor.alphaMultiplier*b,this._currentFrame.color.redMultiplier+this._durationColor.redMultiplier*b,this._currentFrame.color.greenMultiplier+this._durationColor.greenMultiplier*b,this._currentFrame.color.blueMultiplier+
- this._durationColor.blueMultiplier*b,!0):this._bone._updateColor(this._durationColor.alphaOffset*b,this._durationColor.redOffset*b,this._durationColor.greenOffset*b,this._durationColor.blueOffset*b,1+this._durationColor.alphaMultiplier*b,1+this._durationColor.redMultiplier*b,1+this._durationColor.greenMultiplier*b,1+this._durationColor.blueMultiplier*b,!0))}else this._updateState=0,this._animationState.blend?(this.transform.copy(this._originTransform),this.pivot.x=this._originPivot.x,this.pivot.y=
- this._originPivot.y):(this.transform.x=this.transform.y=this.transform.skewX=this.transform.skewY=this.transform.scaleX=this.transform.scaleY=0,this.pivot.x=0,this.pivot.y=0),this._currentFrame=this._timeline.getFrameList()[0],this.tweenActive=0<=this._currentFrame.displayIndex,this._currentFrame.color?this._bone._updateColor(this._currentFrame.color.alphaOffset,this._currentFrame.color.redOffset,this._currentFrame.color.greenOffset,this._currentFrame.color.blueOffset,this._currentFrame.color.alphaMultiplier,
- this._currentFrame.color.redMultiplier,this._currentFrame.color.greenMultiplier,this._currentFrame.color.blueMultiplier,!0):this._bone._updateColor(0,0,0,0,1,1,1,1,!1),this._bone._arriveAtFrame(this._currentFrame,this,this._animationState,!1)};a.prototype.clear=function(){this._updateState=0;this._originPivot=this._originTransform=this._currentFrame=this._timeline=this._animationState=this._bone=null};a.HALF_PI=0.5*Math.PI;a._pool=[];return a}();a.TimelineState=h;var g=function(){function a(){this.layer=
- this.loop=0;this._timelineStates={}}a._borrowObject=function(){return 0==a._pool.length?new a:a._pool.pop()};a._returnObject=function(b){0>a._pool.indexOf(b)&&(a._pool[a._pool.length]=b);b.clear()};a._clear=function(){for(var b=a._pool.length;b--;)a._pool[b].clear();a._pool.length=0};a.prototype.fadeIn=function(a,b,c,d,e,f,h,g){this.layer=f;this.clip=b;this.name=this.clip.name;this.totalTime=this.clip.duration;this._armature=a;2>Math.round(this.clip.duration*this.clip.frameRate)||Infinity==d?(this.timeScale=
- 1,this.currentTime=this.totalTime,this.loop=0<=this.loop?1:-1):(this.timeScale=d,this.currentTime=0,this.loop=e);this._pauseBeforeFadeInComplete=g;this._fadeInTime=c*this.timeScale;this._fadeState=1;this._fadeOutBeginTime=0;this._fadeOutWeight=-1;this._fadeWeight=0;this._fadeIn=!0;this._fadeOut=!1;this.loopCount=-1;this.displayControl=h;this.isPlaying=!0;this.isComplete=!1;this.weight=1;this.tweenEnabled=this.enabled=this.blend=!0;this.updateTimelineStates()};a.prototype.fadeOut=function(a,b){"undefined"===
- typeof b&&(b=!1);if(this._armature&&!(0<=this._fadeOutWeight)){this._fadeState=-1;this._fadeOutWeight=this._fadeWeight;this._fadeOutTime=a*this.timeScale;this._fadeOutBeginTime=this.currentTime;this._fadeOut=!0;this.isPlaying=!b;this.displayControl=!1;for(var c in this._timelineStates)this._timelineStates[c].fadeOut();this.enabled=!0}};a.prototype.play=function(){this.isPlaying=!0};a.prototype.stop=function(){this.isPlaying=!1};a.prototype.getMixingTransform=function(a){return this._mixingTransforms?
- Number(this._mixingTransforms[a]):-1};a.prototype.addMixingTransform=function(a,b,c){"undefined"===typeof b&&(b=2);"undefined"===typeof c&&(c=!0);if(this.clip&&this.clip.getTimeline(a)){this._mixingTransforms||(this._mixingTransforms={});if(c){c=this._armature._boneList.length;for(var d,e;c--;)if(d=this._armature._boneList[c],d.name==a&&(e=d),e&&(e==d||e.contains(d)))this._mixingTransforms[d.name]=b}else this._mixingTransforms[a]=b;this.updateTimelineStates()}else throw Error();};a.prototype.removeMixingTransform=
- function(a,b){"undefined"===typeof a&&(a=null);"undefined"===typeof b&&(b=!0);if(a){if(b)for(var c=this._armature._boneList.length,d,e;c--;)d=this._armature._boneList[c],d.name==a&&(e=d),e&&(e==d||e.contains(d))&&delete this._mixingTransforms[d.name];else delete this._mixingTransforms[a];for(var f in this._mixingTransforms){var h=!0;break}h||(this._mixingTransforms=null)}else this._mixingTransforms=null;this.updateTimelineStates()};a.prototype.advanceTime=function(a){if(!this.enabled)return!1;var b,
- c;this._fadeIn&&(this._fadeIn=!1,this._armature.hasEventListener(d.AnimationEvent.FADE_IN)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_IN),b.animationState=this,this._armature._eventList.push(b)));this._fadeOut&&(this._fadeOut=!1,this._armature.hasEventListener(d.AnimationEvent.FADE_OUT)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_OUT),b.animationState=this,this._armature._eventList.push(b)));this.currentTime+=a*this.timeScale;if(this.isPlaying&&!this.isComplete){var e;if(this._pauseBeforeFadeInComplete)this.isPlaying=
- this._pauseBeforeFadeInComplete=!1,a=0,e=Math.floor(a);else if(a=this.currentTime/this.totalTime,e=Math.floor(a),e!=this.loopCount&&(-1==this.loopCount&&this._armature.hasEventListener(d.AnimationEvent.START)&&(b=new d.AnimationEvent(d.AnimationEvent.START),b.animationState=this,this._armature._eventList.push(b)),this.loopCount=e))this.loop&&this.loopCount*this.loopCount>=this.loop*this.loop-1?(c=!0,a=1,e=0,this._armature.hasEventListener(d.AnimationEvent.COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.COMPLETE),
- b.animationState=this,this._armature._eventList.push(b))):this._armature.hasEventListener(d.AnimationEvent.LOOP_COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.LOOP_COMPLETE),b.animationState=this,this._armature._eventList.push(b));for(var f in this._timelineStates)this._timelineStates[f].update(a);b=this.clip.getFrameList();if(0<b.length){a=this.totalTime*(a-e);for(e=!1;!this._currentFrame||a>this._currentFrame.position+this._currentFrame.duration||a<this._currentFrame.position;)e&&this._armature._arriveAtFrame(this._currentFrame,
- null,this,!0),e=!0,this._currentFrame?(f=b.indexOf(this._currentFrame),f++,f>=b.length&&(f=0),this._currentFrame=b[f]):this._currentFrame=b[0];e&&this._armature._arriveAtFrame(this._currentFrame,null,this,!1)}}if(0<this._fadeState)0==this._fadeInTime?(this._fadeWeight=1,this._fadeState=0,this.isPlaying=!0,this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE),b.animationState=this,this._armature._eventList.push(b))):(this._fadeWeight=
- this.currentTime/this._fadeInTime,1<=this._fadeWeight&&(this._fadeWeight=1,this._fadeState=0,this.isPlaying||(this.currentTime-=this._fadeInTime),this.isPlaying=!0,this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE),b.animationState=this,this._armature._eventList.push(b))));else if(0>this._fadeState){if(0==this._fadeOutTime)return this._fadeState=this._fadeWeight=0,this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE)&&
- (b=new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE),b.animationState=this,this._armature._eventList.push(b)),!0;this._fadeWeight=(1-(this.currentTime-this._fadeOutBeginTime)/this._fadeOutTime)*this._fadeOutWeight;if(0>=this._fadeWeight)return this._fadeState=this._fadeWeight=0,this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE)&&(b=new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE),b.animationState=this,this._armature._eventList.push(b)),!0}c&&(this.isComplete=!0,0>this.loop&&
- this.fadeOut((this._fadeOutWeight||this._fadeInTime)/this.timeScale,!0));return!1};a.prototype.updateTimelineStates=function(){if(this._mixingTransforms){for(var a in this._timelineStates)null==this._mixingTransforms[a]&&this.removeTimelineState(a);for(a in this._mixingTransforms)this._timelineStates[a]||this.addTimelineState(a)}else for(a in this.clip.getTimelines())this._timelineStates[a]||this.addTimelineState(a)};a.prototype.addTimelineState=function(a){var b=this._armature.getBone(a);if(b){var c=
- h._borrowObject(),d=this.clip.getTimeline(a);c.fadeIn(b,this,d);this._timelineStates[a]=c}};a.prototype.removeTimelineState=function(a){h._returnObject(this._timelineStates[a]);delete this._timelineStates[a]};a.prototype.clear=function(){this.clip=null;this.enabled=!1;this._mixingTransforms=this._currentFrame=this._armature=null;for(var a in this._timelineStates)this.removeTimelineState(a)};a._pool=[];return a}();a.AnimationState=g;c=function(){function a(b){this._armature=b;this._animationLayer=
- [];this._isPlaying=!1;this.animationNameList=[];this.tweenEnabled=!0;this.timeScale=1}a.prototype.getLastAnimationName=function(){return this._lastAnimationState?this._lastAnimationState.name:null};a.prototype.getLastAnimationState=function(){return this._lastAnimationState};a.prototype.getAnimationDataList=function(){return this._animationDataList};a.prototype.setAnimationDataList=function(a){this._animationDataList=a;this.animationNameList.length=0;for(var b in this._animationDataList)this.animationNameList[this.animationNameList.length]=
- this._animationDataList[b].name};a.prototype.getIsPlaying=function(){return this._isPlaying&&!this.getIsComplete()};a.prototype.getIsComplete=function(){if(this._lastAnimationState){if(!this._lastAnimationState.isComplete)return!1;for(var a=this._animationLayer.length;a--;)for(var b=this._animationLayer[a],c=b.length;c--;)if(!b[c].isComplete)return!1;return!0}return!1};a.prototype.dispose=function(){if(this._armature){this.stop();for(var a=this._animationLayer.length;a--;){for(var b=this._animationLayer[a],
- c=b.length;c--;)g._returnObject(b[c]);b.length=0}this._animationLayer.length=0;this.animationNameList.length=0;this.animationNameList=this._animationDataList=this._animationLayer=this._armature=null}};a.prototype.gotoAndPlay=function(b,c,d,e,f,h,k,p,l,m){"undefined"===typeof c&&(c=-1);"undefined"===typeof d&&(d=-1);"undefined"===typeof e&&(e=NaN);"undefined"===typeof f&&(f=0);"undefined"===typeof h&&(h=null);"undefined"===typeof k&&(k=a.SAME_LAYER_AND_GROUP);"undefined"===typeof p&&(p=!0);"undefined"===
- typeof l&&(l=!0);"undefined"===typeof m&&(m=!0);if(!this._animationDataList)return null;for(var n=this._animationDataList.length,I;n--;)if(this._animationDataList[n].name==b){I=this._animationDataList[n];break}if(!I)return null;this._isPlaying=!0;c=0>c?0>I.fadeInTime?0.3:I.fadeInTime:c;d=0>d?0>I.scale?1:I.scale:d/I.duration;e=isNaN(e)?I.loop:e;f=this.addLayer(f);var E;switch(k){case a.NONE:break;case a.SAME_LAYER:E=this._animationLayer[f];for(n=E.length;n--;)k=E[n],k.fadeOut(c,l);break;case a.SAME_GROUP:for(s=
- this._animationLayer.length;s--;){E=this._animationLayer[s];for(n=E.length;n--;)k=E[n],k.group==h&&k.fadeOut(c,l)}break;case a.ALL:for(var s=this._animationLayer.length;s--;){E=this._animationLayer[s];for(n=E.length;n--;)k=E[n],k.fadeOut(c,l)}break;default:E=this._animationLayer[f];for(n=E.length;n--;)k=E[n],k.group==h&&k.fadeOut(c,l)}this._lastAnimationState=g._borrowObject();this._lastAnimationState.group=h;this._lastAnimationState.tweenEnabled=this.tweenEnabled;this._lastAnimationState.fadeIn(this._armature,
- I,c,1/d,e,f,p,m);this.addState(this._lastAnimationState);e=this._armature._slotList;for(n=e.length;n--;)f=e[n],(f=f.getChildArmature())&&f.animation.gotoAndPlay(b,c);return this._lastAnimationState};a.prototype.play=function(){this._animationDataList&&0!=this._animationDataList.length&&(this._lastAnimationState?this._isPlaying?this.gotoAndPlay(this._lastAnimationState.name):this._isPlaying=!0:this.gotoAndPlay(this._animationDataList[0].name))};a.prototype.stop=function(){this._isPlaying=!1};a.prototype.getState=
- function(a,b){"undefined"===typeof b&&(b=0);var c=this._animationLayer.length;if(0==c)return null;b>=c&&(b=c-1);c=this._animationLayer[b];if(!c)return null;for(var d=c.length;d--;)if(c[d].name==a)return c[d];return null};a.prototype.hasAnimation=function(a){for(var b=this._animationDataList.length;b--;)if(this._animationDataList[b].name==a)return!0;return!1};a.prototype.advanceTime=function(a){if(this._isPlaying){a*=this.timeScale;var b=this._armature._boneList.length,c,d,e=b,f,h,g,k,p,l,m,q,s,w,
- G,M,n,R,P,t,y;for(b--;e--;){h=this._armature._boneList[e];g=h.name;k=1;M=G=w=s=q=m=l=p=0;for(c=this._animationLayer.length;c--;){n=0;R=this._animationLayer[c];f=R.length;for(d=0;d<f;d++)if(P=R[d],e==b&&P.advanceTime(a))this.removeState(P),d--,f--;else if((t=P._timelineStates[g])&&t.tweenActive)P=P._fadeWeight*P.weight*k,y=t.transform,t=t.pivot,p+=y.x*P,l+=y.y*P,m+=y.skewX*P,q+=y.skewY*P,s+=y.scaleX*P,w+=y.scaleY*P,G+=t.x*P,M+=t.y*P,n+=P;if(n>=k)break;else k-=n}y=h.tween;t=h._tweenPivot;y.x=p;y.y=
- l;y.skewX=m;y.skewY=q;y.scaleX=s;y.scaleY=w;t.x=G;t.y=M}}};a.prototype.addLayer=function(a){a>=this._animationLayer.length&&(a=this._animationLayer.length,this._animationLayer[a]=[]);return a};a.prototype.addState=function(a){this._animationLayer[a.layer].push(a)};a.prototype.removeState=function(a){var b=a.layer,c=this._animationLayer[b];c.splice(c.indexOf(a),1);g._returnObject(a);0==c.length&&b==this._animationLayer.length-1&&this._animationLayer.length--};a.NONE="none";a.SAME_LAYER="sameLayer";
- a.SAME_GROUP="sameGroup";a.SAME_LAYER_AND_GROUP="sameLayerAndGroup";a.ALL="all";return a}();a.Animation=c})(c.animation||(c.animation={}));var a=c.animation;(function(a){var b=function(){function a(){this.skewY=this.skewX=this.y=this.x=0;this.scaleY=this.scaleX=1}a.prototype.getRotation=function(){return this.skewX};a.prototype.setRotation=function(a){this.skewX=this.skewY=a};a.prototype.copy=function(a){this.x=a.x;this.y=a.y;this.skewX=a.skewX;this.skewY=a.skewY;this.scaleX=a.scaleX;this.scaleY=
- a.scaleY};a.prototype.toString=function(){return"[DBTransform (x\x3d"+this.x+" y\x3d"+this.y+" skewX\x3d"+this.skewX+" skewY\x3d"+this.skewY+" scaleX\x3d"+this.scaleX+" scaleY\x3d"+this.scaleY+")]"};return a}();a.DBTransform=b;var c=function(){function a(){this.duration=this.position=0}a.prototype.dispose=function(){};return a}();a.Frame=c;var d=function(a){function c(){a.call(this);this.displayIndex=this.tweenRotate=this.tweenEasing=0;this.zOrder=NaN;this.visible=!0;this.global=new b;this.transform=
- new b;this.pivot=new e.Point}__extends(c,a);c.prototype.dispose=function(){a.prototype.dispose.call(this);this.color=this.pivot=this.transform=this.global=null};return c}(c);a.TransformFrame=d;var h=function(){function a(){this._frameList=[];this.duration=0;this.scale=1}a.prototype.getFrameList=function(){return this._frameList};a.prototype.dispose=function(){for(var a=this._frameList.length;a--;)this._frameList[a].dispose();this._frameList.length=0;this._frameList=null};a.prototype.addFrame=function(a){if(!a)throw Error();
- if(0>this._frameList.indexOf(a))this._frameList[this._frameList.length]=a;else throw Error();};return a}();a.Timeline=h;var g=function(a){function c(){a.call(this);this.originTransform=new b;this.originPivot=new e.Point;this.offset=0;this.transformed=!1}__extends(c,a);c.prototype.dispose=function(){this!=c.HIDE_TIMELINE&&(a.prototype.dispose.call(this),this.originPivot=this.originTransform=null)};c.HIDE_TIMELINE=new c;return c}(h);a.TransformTimeline=g;var k=function(a){function b(){a.call(this);
- this.loop=this.frameRate=0;this.tweenEasing=NaN;this.fadeInTime=0;this._timelines={}}__extends(b,a);b.prototype.getTimelines=function(){return this._timelines};b.prototype.dispose=function(){a.prototype.dispose.call(this);for(var b in this._timelines)this._timelines[b].dispose();this._timelines=null};b.prototype.getTimeline=function(a){return this._timelines[a]};b.prototype.addTimeline=function(a,b){if(!a)throw Error();this._timelines[b]=a};return b}(h);a.AnimationData=k;var m=function(){function a(){this.transform=
- new b}a.prototype.dispose=function(){this.pivot=this.transform=null};a.ARMATURE="armature";a.IMAGE="image";return a}();a.DisplayData=m;var x=function(){function a(){this._displayDataList=[];this.zOrder=0;this.blendMode="normal"}a.prototype.getDisplayDataList=function(){return this._displayDataList};a.prototype.dispose=function(){for(var a=this._displayDataList.length;a--;)this._displayDataList[a].dispose();this._displayDataList.length=0;this._displayDataList=null};a.prototype.addDisplayData=function(a){if(!a)throw Error();
- if(0>this._displayDataList.indexOf(a))this._displayDataList[this._displayDataList.length]=a;else throw Error();};a.prototype.getDisplayData=function(a){for(var b=this._displayDataList.length;b--;)if(this._displayDataList[b].name==a)return this._displayDataList[b];return null};return a}();a.SlotData=x;var C=function(){function a(){this.length=0;this.global=new b;this.transform=new b;this.scaleMode=1;this.fixedRotation=!1}a.prototype.dispose=function(){this.transform=this.global=null};return a}();a.BoneData=
- C;var A=function(){function a(){this._slotDataList=[]}a.prototype.getSlotDataList=function(){return this._slotDataList};a.prototype.dispose=function(){for(var a=this._slotDataList.length;a--;)this._slotDataList[a].dispose();this._slotDataList.length=0;this._slotDataList=null};a.prototype.getSlotData=function(a){for(var b=this._slotDataList.length;b--;)if(this._slotDataList[b].name==a)return this._slotDataList[b];return null};a.prototype.addSlotData=function(a){if(!a)throw Error();if(0>this._slotDataList.indexOf(a))this._slotDataList[this._slotDataList.length]=
- a;else throw Error();};return a}();a.SkinData=A;var z=function(){function a(){this._boneDataList=[];this._skinDataList=[];this._animationDataList=[]}a.prototype.getBoneDataList=function(){return this._boneDataList};a.prototype.getSkinDataList=function(){return this._skinDataList};a.prototype.getAnimationDataList=function(){return this._animationDataList};a.prototype.dispose=function(){for(var a=this._boneDataList.length;a--;)this._boneDataList[a].dispose();for(a=this._skinDataList.length;a--;)this._skinDataList[a].dispose();
- for(a=this._animationDataList.length;a--;)this._animationDataList[a].dispose();this._boneDataList.length=0;this._skinDataList.length=0;this._animationDataList.length=0;this._animationDataList=this._skinDataList=this._boneDataList=null};a.prototype.getBoneData=function(a){for(var b=this._boneDataList.length;b--;)if(this._boneDataList[b].name==a)return this._boneDataList[b];return null};a.prototype.getSkinData=function(a){if(!a)return this._skinDataList[0];for(var b=this._skinDataList.length;b--;)if(this._skinDataList[b].name==
- a)return this._skinDataList[b];return null};a.prototype.getAnimationData=function(a){for(var b=this._animationDataList.length;b--;)if(this._animationDataList[b].name==a)return this._animationDataList[b];return null};a.prototype.addBoneData=function(a){if(!a)throw Error();if(0>this._boneDataList.indexOf(a))this._boneDataList[this._boneDataList.length]=a;else throw Error();};a.prototype.addSkinData=function(a){if(!a)throw Error();if(0>this._skinDataList.indexOf(a))this._skinDataList[this._skinDataList.length]=
- a;else throw Error();};a.prototype.addAnimationData=function(a){if(!a)throw Error();0>this._animationDataList.indexOf(a)&&(this._animationDataList[this._animationDataList.length]=a)};a.prototype.sortBoneDataList=function(){var a=this._boneDataList.length;if(0!=a){for(var b=[];a--;){for(var c=this._boneDataList[a],d=0,e=c;e&&e.parent;)d++,e=this.getBoneData(e.parent);b[a]={level:d,boneData:c}}b.sort(this.sortBoneData);for(a=b.length;a--;)this._boneDataList[a]=b[a].boneData}};a.prototype.sortBoneData=
- function(a,b){return a.level>b.level?1:-1};return a}();a.ArmatureData=z;var u=function(){function a(){this._armatureDataList=[];this._subTexturePivots={}}a.prototype.getArmatureNames=function(){var a=[],b;for(b in this._armatureDataList)a[a.length]=this._armatureDataList[b].name;return a};a.prototype.getArmatureDataList=function(){return this._armatureDataList};a.prototype.dispose=function(){for(var a in this._armatureDataList)this._armatureDataList[a].dispose();this._armatureDataList.length=0;this._subTexturePivots=
- this._armatureDataList=null};a.prototype.getArmatureData=function(a){for(var b=this._armatureDataList.length;b--;)if(this._armatureDataList[b].name==a)return this._armatureDataList[b];return null};a.prototype.addArmatureData=function(a){if(!a)throw Error();if(0>this._armatureDataList.indexOf(a))this._armatureDataList[this._armatureDataList.length]=a;else throw Error();};a.prototype.removeArmatureData=function(a){a=this._armatureDataList.indexOf(a);0<=a&&this._armatureDataList.splice(a,1)};a.prototype.removeArmatureDataByName=
- function(a){for(var b=this._armatureDataList.length;b--;)this._armatureDataList[b].name==a&&this._armatureDataList.splice(b,1)};a.prototype.getSubTexturePivot=function(a){return this._subTexturePivots[a]};a.prototype.addSubTexturePivot=function(a,b,c){var d=this._subTexturePivots[c];d?(d.x=a,d.y=b):this._subTexturePivots[c]=d=new e.Point(a,b);return d};a.prototype.removeSubTexturePivot=function(a){if(a)delete this._subTexturePivots[a];else for(a in this._subTexturePivots)delete this._subTexturePivots[a]};
- return a}();a.SkeletonData=u;h=function(){function a(){}a.parseTextureAtlasData=function(a,b){"undefined"===typeof b&&(b=1);if(!a)throw Error();var c={};c.__name=a[f.ConstValues.A_NAME];var d=a[f.ConstValues.SUB_TEXTURE],h;for(h in d){var g=d[h],k=g[f.ConstValues.A_NAME],g=new e.Rectangle(Number(g[f.ConstValues.A_X])/b,Number(g[f.ConstValues.A_Y])/b,Number(g[f.ConstValues.A_WIDTH])/b,Number(g[f.ConstValues.A_HEIGHT])/b);c[k]=g}return c};a.parseSkeletonData=function(b){if(!b)throw Error();var c=Number(b[f.ConstValues.A_FRAME_RATE]),
- d=new u;d.name=b[f.ConstValues.A_NAME];b=b[f.ConstValues.ARMATURE];for(var e in b)d.addArmatureData(a.parseArmatureData(b[e],d,c));return d};a.parseArmatureData=function(b,c,d){var e=new z;e.name=b[f.ConstValues.A_NAME];var h=b[f.ConstValues.BONE],g;for(g in h)e.addBoneData(a.parseBoneData(h[g]));h=b[f.ConstValues.SKIN];for(g in h)e.addSkinData(a.parseSkinData(h[g],c));f.DBDataUtil.transformArmatureData(e);e.sortBoneDataList();b=b[f.ConstValues.ANIMATION];for(g in b)e.addAnimationData(a.parseAnimationData(b[g],
- e,d));return e};a.parseBoneData=function(b){var c=new C;c.name=b[f.ConstValues.A_NAME];c.parent=b[f.ConstValues.A_PARENT];c.length=Number(b[f.ConstValues.A_LENGTH])||0;var d=Number(b[f.ConstValues.A_SCALE_MODE]);!isNaN(d)&&d&&(c.scaleMode=d);if(d=b[f.ConstValues.A_FIXED_ROTATION])c.fixedRotation=d;a.parseTransform(b[f.ConstValues.TRANSFORM],c.global);c.transform.copy(c.global);return c};a.parseSkinData=function(b,c){var d=new A;d.name=b[f.ConstValues.A_NAME];var e=b[f.ConstValues.SLOT],h;for(h in e)d.addSlotData(a.parseSlotData(e[h],
- c));return d};a.parseSlotData=function(b,c){var d=new x;d.name=b[f.ConstValues.A_NAME];d.parent=b[f.ConstValues.A_PARENT];d.zOrder=Number(b[f.ConstValues.A_Z_ORDER]);d.blendMode=b[f.ConstValues.A_BLENDMODE];d.blendMode||(d.blendMode="normal");var e=b[f.ConstValues.DISPLAY],h;for(h in e)d.addDisplayData(a.parseDisplayData(e[h],c));return d};a.parseDisplayData=function(b,c){var d=new m;d.name=b[f.ConstValues.A_NAME];d.type=b[f.ConstValues.A_TYPE];d.pivot=c.addSubTexturePivot(0,0,d.name);a.parseTransform(b[f.ConstValues.TRANSFORM],
- d.transform,d.pivot);return d};a.parseAnimationData=function(b,c,d){var e=new k;e.name=b[f.ConstValues.A_NAME];e.frameRate=d;e.loop=Number(b[f.ConstValues.A_LOOP])||0;e.fadeInTime=Number(b[f.ConstValues.A_FADE_IN_TIME]);e.duration=Number(b[f.ConstValues.A_DURATION])/d;e.scale=Number(b[f.ConstValues.A_SCALE]);if(b.hasOwnProperty(f.ConstValues.A_TWEEN_EASING)){var h=b[f.ConstValues.A_TWEEN_EASING];e.tweenEasing=void 0==h||null==h?NaN:Number(h)}else e.tweenEasing=NaN;a.parseTimeline(b,e,a.parseMainFrame,
- d);var g,h=b[f.ConstValues.TIMELINE],p;for(p in h)g=h[p],b=a.parseTransformTimeline(g,e.duration,d),g=g[f.ConstValues.A_NAME],e.addTimeline(b,g);f.DBDataUtil.addHideTimeline(e,c);f.DBDataUtil.transformAnimationData(e,c);return e};a.parseTimeline=function(a,b,c,d){var e=0,h;a=a[f.ConstValues.FRAME];for(var g in a)h=c(a[g],d),h.position=e,b.addFrame(h),e+=h.duration;h&&(h.duration=b.duration-h.position)};a.parseTransformTimeline=function(b,c,d){var e=new g;e.duration=c;a.parseTimeline(b,e,a.parseTransformFrame,
- d);e.scale=Number(b[f.ConstValues.A_SCALE]);e.offset=Number(b[f.ConstValues.A_OFFSET]);return e};a.parseFrame=function(a,b,c){b.duration=Number(a[f.ConstValues.A_DURATION])/c;b.action=a[f.ConstValues.A_ACTION];b.event=a[f.ConstValues.A_EVENT];b.sound=a[f.ConstValues.A_SOUND]};a.parseMainFrame=function(b,d){var e=new c;a.parseFrame(b,e,d);return e};a.parseTransformFrame=function(b,c){var h=new d;a.parseFrame(b,h,c);h.visible=1!=Number(b[f.ConstValues.A_HIDE]);if(b.hasOwnProperty(f.ConstValues.A_TWEEN_EASING)){var g=
- b[f.ConstValues.A_TWEEN_EASING];h.tweenEasing=void 0==g||null==g?NaN:Number(g)}else h.tweenEasing=0;h.tweenRotate=Number(b[f.ConstValues.A_TWEEN_ROTATE])||0;h.displayIndex=Number(b[f.ConstValues.A_DISPLAY_INDEX])||0;h.zOrder=Number(b[f.ConstValues.A_Z_ORDER])||0;a.parseTransform(b[f.ConstValues.TRANSFORM],h.global,h.pivot);h.transform.copy(h.global);if(g=b[f.ConstValues.COLOR_TRANSFORM])h.color=new e.ColorTransform,h.color.alphaOffset=Number(g[f.ConstValues.A_ALPHA_OFFSET]),h.color.redOffset=Number(g[f.ConstValues.A_RED_OFFSET]),
- h.color.greenOffset=Number(g[f.ConstValues.A_GREEN_OFFSET]),h.color.blueOffset=Number(g[f.ConstValues.A_BLUE_OFFSET]),h.color.alphaMultiplier=0.01*Number(g[f.ConstValues.A_ALPHA_MULTIPLIER]),h.color.redMultiplier=0.01*Number(g[f.ConstValues.A_RED_MULTIPLIER]),h.color.greenMultiplier=0.01*Number(g[f.ConstValues.A_GREEN_MULTIPLIER]),h.color.blueMultiplier=0.01*Number(g[f.ConstValues.A_BLUE_MULTIPLIER]);return h};a.parseTransform=function(a,b,c){"undefined"===typeof c&&(c=null);a&&(b&&(b.x=Number(a[f.ConstValues.A_X]),
- b.y=Number(a[f.ConstValues.A_Y]),b.skewX=Number(a[f.ConstValues.A_SKEW_X])*f.ConstValues.ANGLE_TO_RADIAN,b.skewY=Number(a[f.ConstValues.A_SKEW_Y])*f.ConstValues.ANGLE_TO_RADIAN,b.scaleX=Number(a[f.ConstValues.A_SCALE_X]),b.scaleY=Number(a[f.ConstValues.A_SCALE_Y])),c&&(c.x=Number(a[f.ConstValues.A_PIVOT_X]),c.y=Number(a[f.ConstValues.A_PIVOT_Y])))};return a}();a.DataParser=h})(c.objects||(c.objects={}));var b=c.objects;(function(a){var e=function(a){function d(){a.call(this);this._dataDic={};this._textureAtlasDic=
- {};this._textureAtlasLoadingDic={}}__extends(d,a);d.prototype.getSkeletonData=function(a){return this._dataDic[a]};d.prototype.addSkeletonData=function(a,b){"undefined"===typeof b&&(b=null);if(!a)throw Error();b=b||a.name;if(!b)throw Error("Unnamed data!");this._dataDic[b]=a};d.prototype.removeSkeletonData=function(a){delete this._dataDic[a]};d.prototype.getTextureAtlas=function(a){return this._textureAtlasDic[a]};d.prototype.addTextureAtlas=function(a,b){"undefined"===typeof b&&(b=null);if(!a)throw Error();
- b=b||a.name;if(!b)throw Error("Unnamed data!");this._textureAtlasDic[b]=a};d.prototype.removeTextureAtlas=function(a){delete this._textureAtlasDic[a]};d.prototype.dispose=function(a){"undefined"===typeof a&&(a=!0);if(a){for(var b in this._dataDic)this._dataDic[b].dispose();for(b in this._textureAtlasDic)this._textureAtlasDic[b].dispose()}this._currentTextureAtlasName=this._currentDataName=this._textureAtlasLoadingDic=this._textureAtlasDic=this._dataDic=null};d.prototype.buildArmature=function(a,d,
- e,f,h){if(e){var g=this._dataDic[e];if(g)var k=g.getArmatureData(a)}else for(e in this._dataDic)if(g=this._dataDic[e],k=g.getArmatureData(a))break;if(!k)return null;this._currentDataName=e;this._currentTextureAtlasName=f||e;f=this._generateArmature();f.name=a;var p,l,m=k.getBoneDataList(),q;for(q in m)l=m[q],p=new c.Bone,p.name=l.name,p.fixedRotation=l.fixedRotation,p.scaleMode=l.scaleMode,p.origin.copy(l.transform),k.getBoneData(l.parent)?f.addChild(p,l.parent):f.addChild(p,null);if(d&&d!=a){var n=
- g.getArmatureData(d);if(!n)for(e in this._dataDic)if(g=this._dataDic[e],n=g.getArmatureData(d))break}n?f.animation.setAnimationDataList(n.getAnimationDataList()):f.animation.setAnimationDataList(k.getAnimationDataList());p=k.getSkinData(h);if(!p)throw Error();a=[];e=p.getSlotDataList();for(q in e)if(g=e[q],p=f.getBone(g.parent)){h=g.getDisplayDataList();d=this._generateSlot();d.name=g.name;d._blendMode=g.blendMode;d._originZOrder=g.zOrder;d._dislayDataList=h;a.length=0;for(g=h.length;g--;)switch(k=
- h[g],k.type){case b.DisplayData.ARMATURE:(k=this.buildArmature(k.name,null,this._currentDataName,this._currentTextureAtlasName,null))&&(a[g]=k);break;default:a[g]=this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName],k.name,k.pivot.x,k.pivot.y)}d.setDisplayList(a);d._changeDisplay(0);p.addChild(d)}f._slotsZOrderChanged=!0;f.advanceTime(0);return f};d.prototype.getTextureDisplay=function(a,b,c,d){if(b)var e=this._textureAtlasDic[b];if(!e&&!b)for(b in this._textureAtlasDic){e=this._textureAtlasDic[b];
- if(e.getRegion(a))break;e=null}if(e){if(isNaN(c)||isNaN(d))if(b=this._dataDic[b])if(b=b.getSubTexturePivot(a))c=b.x,d=b.y;return this._generateDisplay(e,a,c,d)}return null};d.prototype._generateArmature=function(){return null};d.prototype._generateSlot=function(){return null};d.prototype._generateDisplay=function(a,b,c,d){return null};return d}(d.EventDispatcher);a.BaseFactory=e})(c.factorys||(c.factorys={}));(function(c){var d=function(){function a(){}a.ANGLE_TO_RADIAN=Math.PI/180;a.DRAGON_BONES=
- "dragonBones";a.ARMATURE="armature";a.SKIN="skin";a.BONE="bone";a.SLOT="slot";a.DISPLAY="display";a.ANIMATION="animation";a.TIMELINE="timeline";a.FRAME="frame";a.TRANSFORM="transform";a.COLOR_TRANSFORM="colorTransform";a.TEXTURE_ATLAS="TextureAtlas";a.SUB_TEXTURE="SubTexture";a.A_VERSION="version";a.A_IMAGE_PATH="imagePath";a.A_FRAME_RATE="frameRate";a.A_NAME="name";a.A_PARENT="parent";a.A_LENGTH="length";a.A_TYPE="type";a.A_FADE_IN_TIME="fadeInTime";a.A_DURATION="duration";a.A_SCALE="scale";a.A_OFFSET=
- "offset";a.A_LOOP="loop";a.A_EVENT="event";a.A_SOUND="sound";a.A_ACTION="action";a.A_HIDE="hide";a.A_TWEEN_EASING="tweenEasing";a.A_TWEEN_ROTATE="tweenRotate";a.A_DISPLAY_INDEX="displayIndex";a.A_Z_ORDER="z";a.A_BLENDMODE="blendMode";a.A_WIDTH="width";a.A_HEIGHT="height";a.A_SCALE_MODE="scaleMode";a.A_FIXED_ROTATION="fixedRotation";a.A_X="x";a.A_Y="y";a.A_SKEW_X="skX";a.A_SKEW_Y="skY";a.A_SCALE_X="scX";a.A_SCALE_Y="scY";a.A_PIVOT_X="pX";a.A_PIVOT_Y="pY";a.A_ALPHA_OFFSET="aO";a.A_RED_OFFSET="rO";a.A_GREEN_OFFSET=
- "gO";a.A_BLUE_OFFSET="bO";a.A_ALPHA_MULTIPLIER="aM";a.A_RED_MULTIPLIER="rM";a.A_GREEN_MULTIPLIER="gM";a.A_BLUE_MULTIPLIER="bM";return a}();c.ConstValues=d;var f=function(){function a(){}a.transformPointWithParent=function(b,c){var d=a._helpMatrix;a.transformToMatrix(c,d);d.invert();var e=b.x,f=b.y;b.x=d.a*e+d.c*f+d.tx;b.y=d.d*f+d.b*e+d.ty;b.skewX=a.formatRadian(b.skewX-c.skewX);b.skewY=a.formatRadian(b.skewY-c.skewY)};a.transformToMatrix=function(a,b){b.a=a.scaleX*Math.cos(a.skewY);b.b=a.scaleX*Math.sin(a.skewY);
- b.c=-a.scaleY*Math.sin(a.skewX);b.d=a.scaleY*Math.cos(a.skewX);b.tx=a.x;b.ty=a.y};a.formatRadian=function(b){b%=a.DOUBLE_PI;b>Math.PI&&(b-=a.DOUBLE_PI);b<-Math.PI&&(b+=a.DOUBLE_PI);return b};a.DOUBLE_PI=2*Math.PI;a._helpMatrix=new e.Matrix;return a}();c.TransformUtil=f;d=function(){function c(){}c.transformArmatureData=function(a){for(var b=a.getBoneDataList(),c=b.length,d,e;c--;)if(d=b[c],d.parent&&(e=a.getBoneData(d.parent)))d.transform.copy(d.global),f.transformPointWithParent(d.transform,e.global)};
- c.transformArmatureDataAnimations=function(a){for(var b=a.getAnimationDataList(),d=b.length;d--;)c.transformAnimationData(b[d],a)};c.transformAnimationData=function(a,b){for(var d=b.getSkinData(null),e=b.getBoneDataList(),d=d.getSlotDataList(),h=e.length,g,k,l,m,n,B,K,I,E,s;h--;)if(g=e[h],k=a.getTimeline(g.name)){l=null;for(var w in d)if(l=d[w],l.parent==g.name)break;m=g.parent?a.getTimeline(g.parent):null;n=k.getFrameList();I=K=B=null;s=n.length;for(var G=0;G<s;G++){E=n[G];m?(c._helpTransform1.copy(E.global),
- c.getTimelineTransform(m,E.position,c._helpTransform2),f.transformPointWithParent(c._helpTransform1,c._helpTransform2),E.transform.copy(c._helpTransform1)):E.transform.copy(E.global);E.transform.x-=g.transform.x;E.transform.y-=g.transform.y;E.transform.skewX-=g.transform.skewX;E.transform.skewY-=g.transform.skewY;E.transform.scaleX-=g.transform.scaleX;E.transform.scaleY-=g.transform.scaleY;!k.transformed&&l&&(E.zOrder-=l.zOrder);B||(B=k.originTransform,B.copy(E.transform),B.skewX=f.formatRadian(B.skewX),
- B.skewY=f.formatRadian(B.skewY),K=k.originPivot,K.x=E.pivot.x,K.y=E.pivot.y);E.transform.x-=B.x;E.transform.y-=B.y;E.transform.skewX=f.formatRadian(E.transform.skewX-B.skewX);E.transform.skewY=f.formatRadian(E.transform.skewY-B.skewY);E.transform.scaleX-=B.scaleX;E.transform.scaleY-=B.scaleY;k.transformed||(E.pivot.x-=K.x,E.pivot.y-=K.y);if(I){var M=E.transform.skewX-I.transform.skewX;I.tweenRotate?0<I.tweenRotate?(0>M&&(E.transform.skewX+=2*Math.PI,E.transform.skewY+=2*Math.PI),1<I.tweenRotate&&
- (E.transform.skewX+=2*Math.PI*(I.tweenRotate-1),E.transform.skewY+=2*Math.PI*(I.tweenRotate-1))):(0<M&&(E.transform.skewX-=2*Math.PI,E.transform.skewY-=2*Math.PI),1>I.tweenRotate&&(E.transform.skewX+=2*Math.PI*(I.tweenRotate+1),E.transform.skewY+=2*Math.PI*(I.tweenRotate+1))):(E.transform.skewX=I.transform.skewX+f.formatRadian(E.transform.skewX-I.transform.skewX),E.transform.skewY=I.transform.skewY+f.formatRadian(E.transform.skewY-I.transform.skewY))}I=E}k.transformed=!0}};c.getTimelineTransform=
- function(b,c,d){for(var e=b.getFrameList(),h=e.length,g;h--;)if(b=e[h],b.position<=c&&b.position+b.duration>c){g=b.tweenEasing;h==e.length-1||isNaN(g)||c==b.position?d.copy(b.global):(c=(c-b.position)/b.duration,g&&(c=a.TimelineState.getEaseValue(c,g)),e=e[h+1],d.x=b.global.x+(e.global.x-b.global.x)*c,d.y=b.global.y+(e.global.y-b.global.y)*c,d.skewX=f.formatRadian(b.global.skewX+(e.global.skewX-b.global.skewX)*c),d.skewY=f.formatRadian(b.global.skewY+(e.global.skewY-b.global.skewY)*c),d.scaleX=b.global.scaleX+
- (e.global.scaleX-b.global.scaleX)*c,d.scaleY=b.global.scaleY+(e.global.scaleY-b.global.scaleY)*c);break}};c.addHideTimeline=function(a,c){for(var d=c.getBoneDataList(),e=d.length,f;e--;)f=d[e],f=f.name,a.getTimeline(f)||a.addTimeline(b.TransformTimeline.HIDE_TIMELINE,f)};c._helpTransform1=new b.DBTransform;c._helpTransform2=new b.DBTransform;return c}();c.DBDataUtil=d})(c.utils||(c.utils={}));var f=c.utils,m=function(){function a(){this.global=new b.DBTransform;this.origin=new b.DBTransform;this.offset=
- new b.DBTransform;this.tween=new b.DBTransform;this.tween.scaleX=this.tween.scaleY=0;this._globalTransformMatrix=new e.Matrix;this._visible=!0;this._isDisplayOnStage=this._isColorChanged=!1;this._scaleType=0;this.fixedRotation=!1}a.prototype.getVisible=function(){return this._visible};a.prototype.setVisible=function(a){this._visible=a};a.prototype._setParent=function(a){this.parent=a};a.prototype._setArmature=function(a){this.armature&&this.armature._removeDBObject(this);(this.armature=a)&&this.armature._addDBObject(this)};
- a.prototype.dispose=function(){this._globalTransformMatrix=this.tween=this.offset=this.origin=this.global=this.armature=this.parent=null};a.prototype._update=function(){this.global.scaleX=(this.origin.scaleX+this.tween.scaleX)*this.offset.scaleX;this.global.scaleY=(this.origin.scaleY+this.tween.scaleY)*this.offset.scaleY;if(this.parent){var a=this.origin.x+this.offset.x+this.tween.x,b=this.origin.y+this.offset.y+this.tween.y,c=this.parent._globalTransformMatrix;this._globalTransformMatrix.tx=this.global.x=
- c.a*a+c.c*b+c.tx;this._globalTransformMatrix.ty=this.global.y=c.d*b+c.b*a+c.ty;this.fixedRotation?(this.global.skewX=this.origin.skewX+this.offset.skewX+this.tween.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this.tween.skewY):(this.global.skewX=this.origin.skewX+this.offset.skewX+this.tween.skewX+this.parent.global.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this.tween.skewY+this.parent.global.skewY);this.parent.scaleMode>=this._scaleType&&(this.global.scaleX*=this.parent.global.scaleX,
- this.global.scaleY*=this.parent.global.scaleY)}else this._globalTransformMatrix.tx=this.global.x=this.origin.x+this.offset.x+this.tween.x,this._globalTransformMatrix.ty=this.global.y=this.origin.y+this.offset.y+this.tween.y,this.global.skewX=this.origin.skewX+this.offset.skewX+this.tween.skewX,this.global.skewY=this.origin.skewY+this.offset.skewY+this.tween.skewY;this._globalTransformMatrix.a=this.global.scaleX*Math.cos(this.global.skewY);this._globalTransformMatrix.b=this.global.scaleX*Math.sin(this.global.skewY);
- this._globalTransformMatrix.c=-this.global.scaleY*Math.sin(this.global.skewX);this._globalTransformMatrix.d=this.global.scaleY*Math.cos(this.global.skewX)};return a}();c.DBObject=m;var h=function(a){function b(c){a.call(this);this._displayBridge=c;this._displayList=[];this._displayIndex=-1;this._scaleType=1;this._offsetZOrder=this._tweenZorder=this._originZOrder=0;this._isHideDisplay=this._isDisplayOnStage=!1;this._blendMode="normal";this._displayBridge.updateBlendMode(this._blendMode)}__extends(b,
- a);b.prototype.getZOrder=function(){return this._originZOrder+this._tweenZorder+this._offsetZOrder};b.prototype.setZOrder=function(a){this.getZOrder()!=a&&(this._offsetZOrder=a-this._originZOrder-this._tweenZorder,this.armature&&(this.armature._slotsZOrderChanged=!0))};b.prototype.getDisplay=function(){var a=this._displayList[this._displayIndex];return a instanceof k?a.getDisplay():a};b.prototype.setDisplay=function(a){this._displayList[this._displayIndex]=a;this._setDisplay(a)};b.prototype.getBlendMode=
- function(){return this._blendMode};b.prototype.setBlendMode=function(a){this._blendMode!=a&&(this._blendMode=a,this._displayBridge.getDisplay()&&this._displayBridge.updateBlendMode(this._blendMode))};b.prototype.getChildArmature=function(){var a=this._displayList[this._displayIndex];return a instanceof k?a:null};b.prototype.setChildArmature=function(a){(this._displayList[this._displayIndex]=a)&&this._setDisplay(a.getDisplay())};b.prototype.getDisplayList=function(){return this._displayList};b.prototype.setDisplayList=
- function(a){if(!a)throw Error();for(var b=this._displayList.length=a.length;b--;)this._displayList[b]=a[b];0<=this._displayIndex&&(a=this._displayIndex,this._displayIndex=-1,this._changeDisplay(a))};b.prototype._setDisplay=function(a){this._displayBridge.getDisplay()?this._displayBridge.setDisplay(a):(this._displayBridge.setDisplay(a),this.armature&&(this._displayBridge.addDisplay(this.armature.getDisplay(),-1),this.armature._slotsZOrderChanged=!0));this.updateChildArmatureAnimation();a&&this._displayBridge.updateBlendMode(this._blendMode);
- !this._isHideDisplay&&this._displayBridge.getDisplay()?this._isDisplayOnStage=!0:this._isDisplayOnStage=!1};b.prototype._changeDisplay=function(a){if(0>a)this._isHideDisplay||(this._isHideDisplay=!0,this._displayBridge.removeDisplay(),this.updateChildArmatureAnimation());else{if(this._isHideDisplay){this._isHideDisplay=!1;var b=!0;this.armature&&(this._displayBridge.addDisplay(this.armature.getDisplay(),-1),this.armature._slotsZOrderChanged=!0)}var c=this._displayList.length;a>=c&&0<c&&(a=c-1);this._displayIndex!=
- a?(this._displayIndex=a,a=this._displayList[this._displayIndex],a instanceof k?this._setDisplay(a.getDisplay()):this._setDisplay(a),this._dislayDataList&&this._displayIndex<=this._dislayDataList.length&&this.origin.copy(this._dislayDataList[this._displayIndex].transform)):b&&this.updateChildArmatureAnimation()}!this._isHideDisplay&&this._displayBridge.getDisplay()?this._isDisplayOnStage=!0:this._isDisplayOnStage=!1};b.prototype.setVisible=function(a){a!=this._visible&&(this._visible=a,this._updateVisible(this._visible))};
- b.prototype._setArmature=function(b){a.prototype._setArmature.call(this,b);this.armature?(this.armature._slotsZOrderChanged=!0,this._displayBridge.addDisplay(this.armature.getDisplay(),-1)):this._displayBridge.removeDisplay()};b.prototype.dispose=function(){this._displayBridge&&(a.prototype.dispose.call(this),this._displayBridge.dispose(),this._displayList.length=0,this._dislayDataList=this._displayList=this._displayBridge=null)};b.prototype._update=function(){a.prototype._update.call(this);if(this._isDisplayOnStage){var b=
- this.parent._tweenPivot.x,c=this.parent._tweenPivot.y;if(b||c){var d=this.parent._globalTransformMatrix;this._globalTransformMatrix.tx+=d.a*b+d.c*c;this._globalTransformMatrix.ty+=d.b*b+d.d*c}this._displayBridge.updateTransform(this._globalTransformMatrix,this.global)}};b.prototype._updateVisible=function(a){this._displayBridge.setVisible(this.parent.getVisible()&&this._visible&&a)};b.prototype.updateChildArmatureAnimation=function(){var a=this.getChildArmature();if(a)if(this._isHideDisplay)a.animation.stop(),
- a.animation._lastAnimationState=null;else{var b=this.armature?this.armature.animation.getLastAnimationName():null;b&&a.animation.hasAnimation(b)?a.animation.gotoAndPlay(b):a.animation.play()}};return b}(m);c.Slot=h;var g=function(a){function b(){a.call(this);this._children=[];this._scaleType=2;this._tweenPivot=new e.Point;this.scaleMode=1}__extends(b,a);b.prototype.setVisible=function(a){if(this._visible!=a){this._visible=a;for(a=this._children.length;a--;){var b=this._children[a];b instanceof h&&
- b._updateVisible(this._visible)}}};b.prototype._setArmature=function(b){a.prototype._setArmature.call(this,b);for(b=this._children.length;b--;)this._children[b]._setArmature(this.armature)};b.prototype.dispose=function(){if(this._children){a.prototype.dispose.call(this);for(var b=this._children.length;b--;)this._children[b].dispose();this._children.length=0;this.slot=this._tweenPivot=this._children=null}};b.prototype.contains=function(a){if(!a)throw Error();if(a==this)return!1;for(;!(a==this||null==
- a);)a=a.parent;return a==this};b.prototype.addChild=function(a){if(!a)throw Error();if(a==this||a instanceof b&&a.contains(this))throw Error("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)");a.parent&&a.parent.removeChild(a);this._children[this._children.length]=a;a._setParent(this);a._setArmature(this.armature);!this.slot&&a instanceof h&&(this.slot=a)};b.prototype.removeChild=function(a){if(!a)throw Error();var b=this._children.indexOf(a);if(0<=
- b)this._children.splice(b,1),a._setParent(null),a._setArmature(null),a==this.slot&&(this.slot=null);else throw Error();};b.prototype.getSlots=function(){for(var a=[],b=this._children.length;b--;)this._children[b]instanceof h&&a.unshift(this._children[b]);return a};b.prototype._arriveAtFrame=function(a,c,e,f){if(a){c=e.getMixingTransform(name);if(e.displayControl&&(2==c||-1==c))if((!this.displayController||this.displayController==e.name)&&this.slot)c=a.displayIndex,0<=c&&(!isNaN(a.zOrder)&&a.zOrder!=
- this.slot._tweenZorder)&&(this.slot._tweenZorder=a.zOrder,this.armature._slotsZOrderChanged=!0),this.slot._changeDisplay(c),this.slot._updateVisible(a.visible);a.event&&this.armature.hasEventListener(d.FrameEvent.BONE_FRAME_EVENT)&&(c=new d.FrameEvent(d.FrameEvent.BONE_FRAME_EVENT),c.bone=this,c.animationState=e,c.frameLabel=a.event,this.armature._eventList.push(c));a.sound&&b._soundManager.hasEventListener(d.SoundEvent.SOUND)&&(c=new d.SoundEvent(d.SoundEvent.SOUND),c.armature=this.armature,c.animationState=
- e,c.sound=a.sound,b._soundManager.dispatchEvent(c));if(a.action)for(var g in this._children)this._children[g]instanceof h&&(e=this._children[g].getChildArmature())&&e.animation.gotoAndPlay(a.action)}else this.slot&&this.slot._changeDisplay(-1)};b.prototype._updateColor=function(a,b,c,d,e,f,h,g,k){(k||this._isColorChanged)&&this.slot._displayBridge.updateColor(a,b,c,d,e,f,h,g);this._isColorChanged=k};b._soundManager=d.SoundEventManager.getInstance();return b}(m);c.Bone=g;var k=function(b){function c(d){b.call(this);
- this.animation=new a.Animation(this);this._display=d;this._slotsZOrderChanged=!1;this._slotList=[];this._boneList=[];this._eventList=[]}__extends(c,b);c.prototype.getDisplay=function(){return this._display};c.prototype.dispose=function(){if(this.animation){this.animation.dispose();for(var a=this._slotList.length;a--;)this._slotList[a].dispose();for(a=this._boneList.length;a--;)this._boneList[a].dispose();this._slotList.length=0;this._boneList.length=0;this._eventList.length=0;this.animation=this._display=
- this._eventList=this._boneList=this._slotList=null}};c.prototype.advanceTime=function(a){this.animation.advanceTime(a);a*=this.animation.timeScale;for(var b=this._boneList.length;b--;)this._boneList[b]._update();for(var b=this._slotList.length,c;b--;)c=this._slotList[b],c._update(),c._isDisplayOnStage&&(c=c.getChildArmature())&&c.advanceTime(a);this._slotsZOrderChanged&&(this.updateSlotsZOrder(),this.hasEventListener(d.ArmatureEvent.Z_ORDER_UPDATED)&&this.dispatchEvent(new d.ArmatureEvent(d.ArmatureEvent.Z_ORDER_UPDATED)));
- if(this._eventList.length){a=this._eventList.length;for(b=0;b<a;b++)this.dispatchEvent(this._eventList[b]);this._eventList.length=0}};c.prototype.getSlots=function(a){"undefined"===typeof a&&(a=!0);return a?this._slotList.concat():this._slotList};c.prototype.getBones=function(a){"undefined"===typeof a&&(a=!0);return a?this._boneList.concat():this._boneList};c.prototype.getSlot=function(a){for(var b=this._slotList.length;b--;)if(this._slotList[b].name==a)return this._slotList[b];return null};c.prototype.getSlotByDisplay=
- function(a){if(a)for(var b=this._slotList.length;b--;)if(this._slotList[b].getDisplay()==a)return this._slotList[b];return null};c.prototype.removeSlot=function(a){if(!a)throw Error();if(0<=this._slotList.indexOf(a))a.parent.removeChild(a);else throw Error();};c.prototype.removeSlotByName=function(a){a&&(a=this.getSlot(a))&&this.removeSlot(a)};c.prototype.getBone=function(a){for(var b=this._boneList.length;b--;)if(this._boneList[b].name==a)return this._boneList[b];return null};c.prototype.getBoneByDisplay=
- function(a){return(a=this.getSlotByDisplay(a))?a.parent:null};c.prototype.removeBone=function(a){if(!a)throw Error();if(0<=this._boneList.indexOf(a))a.parent?a.parent.removeChild(a):a._setArmature(null);else throw Error();};c.prototype.removeBoneByName=function(a){a&&(a=this.getBone(a))&&this.removeBone(a)};c.prototype.addChild=function(a,b){if(!a)throw Error();if(b){var c=this.getBone(b);if(c)c.addChild(a);else throw Error();}else a.parent&&a.parent.removeChild(a),a._setArmature(this)};c.prototype.updateSlotsZOrder=
- function(){this._slotList.sort(this.sortSlot);for(var a=this._slotList.length,b;a--;)b=this._slotList[a],b._isDisplayOnStage&&b._displayBridge.addDisplay(this._display,-1);this._slotsZOrderChanged=!1};c.prototype._addDBObject=function(a){a instanceof h?0>this._slotList.indexOf(a)&&(this._slotList[this._slotList.length]=a):a instanceof g&&0>this._boneList.indexOf(a)&&(this._boneList[this._boneList.length]=a,this._sortBoneList())};c.prototype._removeDBObject=function(a){a instanceof h?(a=this._slotList.indexOf(a),
- 0<=a&&this._slotList.splice(a,1)):a instanceof g&&(a=this._boneList.indexOf(a),0<=a&&this._boneList.splice(a,1))};c.prototype._sortBoneList=function(){var a=this._boneList.length;if(0!=a){for(var b=[],c,d,e;a--;){c=0;for(e=d=this._boneList[a];e;)c++,e=e.parent;b[a]={level:c,bone:d}}b.sort(this.sortBone);for(a=b.length;a--;)this._boneList[a]=b[a].bone}};c.prototype._arriveAtFrame=function(a,b,e,f){a.event&&this.hasEventListener(d.FrameEvent.ANIMATION_FRAME_EVENT)&&(b=new d.FrameEvent(d.FrameEvent.ANIMATION_FRAME_EVENT),
- b.animationState=e,b.frameLabel=a.event,this._eventList.push(b));a.sound&&c._soundManager.hasEventListener(d.SoundEvent.SOUND)&&(b=new d.SoundEvent(d.SoundEvent.SOUND),b.armature=this,b.animationState=e,b.sound=a.sound,c._soundManager.dispatchEvent(b));a.action&&e.isPlaying&&this.animation.gotoAndPlay(a.action)};c.prototype.sortSlot=function(a,b){return a.getZOrder()<b.getZOrder()?1:-1};c.prototype.sortBone=function(a,b){return a.level<b.level?1:-1};c._soundManager=d.SoundEventManager.getInstance();
- return c}(d.EventDispatcher);c.Armature=k})(dragonBones||(dragonBones={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){(function(c){var a=function(){function a(){}a.prototype.getVisible=function(){return this._display?this._display.visible:!1};a.prototype.setVisible=function(a){this._display&&(this._display.visible=a)};a.prototype.getDisplay=function(){return this._display};a.prototype.setDisplay=function(a){if(this._display!=a){if(this._display){var b=this._display.parent;if(b)var c=-1;this.removeDisplay()}this._display=a;this.addDisplay(b,c)}};a.prototype.dispose=function(){this._display=null};a.prototype.updateTransform=
- function(c,d){this._display.x=c.tx;this._display.y=c.ty;this._display.skewX=d.skewX*a.RADIAN_TO_ANGLE;this._display.skewY=d.skewY*a.RADIAN_TO_ANGLE;this._display.scaleX=d.scaleX;this._display.scaleY=d.scaleY};a.prototype.updateColor=function(a,b,c,d,e,l,n,p){this._display&&(this._display.alpha=e)};a.prototype.updateBlendMode=function(a){this._display&&(this._display.blendMode=ns_egret.BlendMode.getBlendMode(a))};a.prototype.addDisplay=function(a,b){a&&this._display&&(this._display.parent&&this._display.parent.removeChild(this._display),
- 0>b?a.addChild(this._display):a.addChildAt(this._display,Math.min(b,a.numChildren)))};a.prototype.removeDisplay=function(){this._display&&this._display.parent&&this._display.parent.removeChild(this._display)};a.RADIAN_TO_ANGLE=180/Math.PI;return a}();c.DragonBonesEgretBridge=a})(c.display||(c.display={}));var e=c.display;(function(d){var a=function(){function a(b,c,d){"undefined"===typeof d&&(d=1);this.texture=b;this.scale=d;this.parseData(c)}a.prototype.dispose=function(){this.texture=null};a.prototype.getRegion=
- function(a){throw Error("error");};a.prototype.parseData=function(a){this.name=a[c.utils.ConstValues.A_NAME];this.spriteSheet=ns_egret.SpriteSheet.parseFromDragonBones(a)};return a}();d.EgretTextureAtlas=a})(c.textures||(c.textures={}));(function(d){var a=function(a){function d(){a.call(this)}__extends(d,a);d.prototype._generateArmature=function(){return new c.Armature(new ns_egret.DisplayObjectContainer)};d.prototype._generateSlot=function(){return new c.Slot(new e.DragonBonesEgretBridge)};d.prototype._generateDisplay=
- function(a,b,c,d){var e=ns_egret.Bitmap.initWithTexture(a.texture);a=a.spriteSheet.getFrame(b);e.spriteFrame=a;e.anchorOffsetX=c;e.anchorOffsetY=d;return e};return d}(c.factorys.BaseFactory);d.EgretFactory=a})(c.factorys||(c.factorys={}))})(dragonBones||(dragonBones={}));(function(c){var e=function(){function d(){}d.checkDrawImage=function(a,b,d,e,h,g,k,l,n){null==a&&c.Logger.fatal("texture\u4e3a\u7a7a");(a._textureWidth<b+e||a._textureHeight<d+h)&&c.Logger.fatal("\u63d0\u4f9b\u7684\u5c3a\u5bf8\u8d85\u51fatexture\u5c3a\u5bf8")};d.checkAddEventListener=function(a,b,d,e,h){(null==b||void 0==b)&&c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a")};d.checkSetScaleGrid=function(a,b,d,e,h){a||c.Logger.fatal("Scale9Bitmap\u6ca1\u6709\u7eb9\u7406");
- (0>parseInt(b)||0>parseInt(d)||0>parseInt(e)||0>parseInt(h))&&c.Logger.fatal("\u4f20\u5165\u7684\u503c\u4e0d\u80fd\u4e3a\u8d1f\u6570");a._textureWidth<e+h&&c.Logger.fatal("\u4f20\u5165\u7684\u5bbd\u5ea6\u8d85\u51fa\u8303\u56f4");a._textureHeight<b+d&&c.Logger.fatal("\u4f20\u5165\u7684\u9ad8\u5ea6\u8d85\u51fa\u8303\u56f4")};d.TRACE_RENDER_LOOP=function(a){"undefined"===typeof a&&(a=0);var b=c.Ticker.getInstance(),d=c.MainContext.instance;switch(a){case 0:b.unregister(d.renderLoop,d);break;case 1:d.renderLoop();
- break;case 2:b.register(d.renderLoop,d)}};d.DRAW_IMAGE=!0;d.ADD_EVENT_LISTENER=!0;d.SCALE_BITMAP_SET_SCALE_GRID=!0;return d}();c.DEBUG=e})(ns_egret||(ns_egret={}));var unstable=unstable||{};unstable.modal_api={};unstable.modal_api.setModal=function(c){void 0==c&&(c=!0);this.touchEnabled=this._modal=c};var hitTest=ns_egret.DisplayObjectContainer.prototype.hitTest;
- ns_egret.DisplayObjectContainer.prototype.hitTest=function(c,e){if(!1==this.visible)return null;var d=hitTest.call(this,c,e);return this._modal?d?d:this:d};ns_egret.DisplayObjectContainer.prototype.setModal=unstable.modal_api.setModal;var Box2D={};
- (function(c,e){function d(){}!(Object.defineProperty instanceof Function)&&(Object.prototype.__defineGetter__ instanceof Function&&Object.prototype.__defineSetter__ instanceof Function)&&(Object.defineProperty=function(a,b,c){c.get instanceof Function&&a.__defineGetter__(b,c.get);c.set instanceof Function&&a.__defineSetter__(b,c.set)});c.inherit=function(a,b){d.prototype=b.prototype;a.prototype=new d;a.prototype.constructor=a};c.generateCallback=function(a,b){return function(){b.apply(a,arguments)}};
- c.NVector=function(a){a===e&&(a=0);for(var b=Array(a||0),c=0;c<a;++c)b[c]=0;return b};c.is=function(a,b){return null===a?!1:b instanceof Function&&a instanceof b||a.constructor.__implements!=e&&a.constructor.__implements[b]?!0:!1};c.parseUInt=function(a){return Math.abs(parseInt(a))}})(Box2D);var Vector=Array,Vector_a2j_Number=Box2D.NVector;"undefined"===typeof Box2D&&(Box2D={});"undefined"===typeof Box2D.Collision&&(Box2D.Collision={});
- "undefined"===typeof Box2D.Collision.Shapes&&(Box2D.Collision.Shapes={});"undefined"===typeof Box2D.Common&&(Box2D.Common={});"undefined"===typeof Box2D.Common.Math&&(Box2D.Common.Math={});"undefined"===typeof Box2D.Dynamics&&(Box2D.Dynamics={});"undefined"===typeof Box2D.Dynamics.Contacts&&(Box2D.Dynamics.Contacts={});"undefined"===typeof Box2D.Dynamics.Controllers&&(Box2D.Dynamics.Controllers={});"undefined"===typeof Box2D.Dynamics.Joints&&(Box2D.Dynamics.Joints={});
- (function(){function c(){c.b2AABB.apply(this,arguments)}function e(){e.b2Bound.apply(this,arguments)}function d(){d.b2BoundValues.apply(this,arguments);this.constructor===d&&this.b2BoundValues.apply(this,arguments)}function a(){a.b2Collision.apply(this,arguments)}function b(){b.b2ContactID.apply(this,arguments);this.constructor===b&&this.b2ContactID.apply(this,arguments)}function f(){f.b2ContactPoint.apply(this,arguments)}function m(){m.b2Distance.apply(this,arguments)}function h(){h.b2DistanceInput.apply(this,
- arguments)}function g(){g.b2DistanceOutput.apply(this,arguments)}function k(){k.b2DistanceProxy.apply(this,arguments)}function l(){l.b2DynamicTree.apply(this,arguments);this.constructor===l&&this.b2DynamicTree.apply(this,arguments)}function n(){n.b2DynamicTreeBroadPhase.apply(this,arguments)}function p(){p.b2DynamicTreeNode.apply(this,arguments)}function q(){q.b2DynamicTreePair.apply(this,arguments)}function v(){v.b2Manifold.apply(this,arguments);this.constructor===v&&this.b2Manifold.apply(this,arguments)}
- function F(){F.b2ManifoldPoint.apply(this,arguments);this.constructor===F&&this.b2ManifoldPoint.apply(this,arguments)}function r(){r.b2Point.apply(this,arguments)}function D(){D.b2RayCastInput.apply(this,arguments);this.constructor===D&&this.b2RayCastInput.apply(this,arguments)}function x(){x.b2RayCastOutput.apply(this,arguments)}function C(){C.b2Segment.apply(this,arguments)}function A(){A.b2SeparationFunction.apply(this,arguments)}function z(){z.b2Simplex.apply(this,arguments);this.constructor===
- z&&this.b2Simplex.apply(this,arguments)}function u(){u.b2SimplexCache.apply(this,arguments)}function J(){J.b2SimplexVertex.apply(this,arguments)}function B(){B.b2TimeOfImpact.apply(this,arguments)}function K(){K.b2TOIInput.apply(this,arguments)}function I(){I.b2WorldManifold.apply(this,arguments);this.constructor===I&&this.b2WorldManifold.apply(this,arguments)}function E(){E.ClipVertex.apply(this,arguments)}function s(){s.Features.apply(this,arguments)}function w(){w.b2CircleShape.apply(this,arguments);
- this.constructor===w&&this.b2CircleShape.apply(this,arguments)}function G(){G.b2EdgeChainDef.apply(this,arguments);this.constructor===G&&this.b2EdgeChainDef.apply(this,arguments)}function M(){M.b2EdgeShape.apply(this,arguments);this.constructor===M&&this.b2EdgeShape.apply(this,arguments)}function L(){L.b2MassData.apply(this,arguments)}function R(){R.b2PolygonShape.apply(this,arguments);this.constructor===R&&this.b2PolygonShape.apply(this,arguments)}function P(){P.b2Shape.apply(this,arguments);this.constructor===
- P&&this.b2Shape.apply(this,arguments)}function t(){t.b2Color.apply(this,arguments);this.constructor===t&&this.b2Color.apply(this,arguments)}function y(){y.b2Settings.apply(this,arguments)}function H(){H.b2Mat22.apply(this,arguments);this.constructor===H&&this.b2Mat22.apply(this,arguments)}function O(){O.b2Mat33.apply(this,arguments);this.constructor===O&&this.b2Mat33.apply(this,arguments)}function Q(){Q.b2Math.apply(this,arguments)}function N(){N.b2Sweep.apply(this,arguments)}function T(){T.b2Transform.apply(this,
- arguments);this.constructor===T&&this.b2Transform.apply(this,arguments)}function S(){S.b2Vec2.apply(this,arguments);this.constructor===S&&this.b2Vec2.apply(this,arguments)}function U(){U.b2Vec3.apply(this,arguments);this.constructor===U&&this.b2Vec3.apply(this,arguments)}function V(){V.b2Body.apply(this,arguments);this.constructor===V&&this.b2Body.apply(this,arguments)}function W(){W.b2BodyDef.apply(this,arguments);this.constructor===W&&this.b2BodyDef.apply(this,arguments)}function Ca(){Ca.b2ContactFilter.apply(this,
- arguments)}function Da(){Da.b2ContactImpulse.apply(this,arguments)}function Ea(){Ea.b2ContactListener.apply(this,arguments)}function X(){X.b2ContactManager.apply(this,arguments);this.constructor===X&&this.b2ContactManager.apply(this,arguments)}function Y(){Y.b2DebugDraw.apply(this,arguments);this.constructor===Y&&this.b2DebugDraw.apply(this,arguments)}function Fa(){Fa.b2DestructionListener.apply(this,arguments)}function Ga(){Ga.b2FilterData.apply(this,arguments)}function Z(){Z.b2Fixture.apply(this,
- arguments);this.constructor===Z&&this.b2Fixture.apply(this,arguments)}function $(){$.b2FixtureDef.apply(this,arguments);this.constructor===$&&this.b2FixtureDef.apply(this,arguments)}function aa(){aa.b2Island.apply(this,arguments);this.constructor===aa&&this.b2Island.apply(this,arguments)}function Ma(){Ma.b2TimeStep.apply(this,arguments)}function da(){da.b2World.apply(this,arguments);this.constructor===da&&this.b2World.apply(this,arguments)}function Na(){Na.b2CircleContact.apply(this,arguments)}function ea(){ea.b2Contact.apply(this,
- arguments);this.constructor===ea&&this.b2Contact.apply(this,arguments)}function fa(){fa.b2ContactConstraint.apply(this,arguments);this.constructor===fa&&this.b2ContactConstraint.apply(this,arguments)}function Oa(){Oa.b2ContactConstraintPoint.apply(this,arguments)}function Pa(){Pa.b2ContactEdge.apply(this,arguments)}function ga(){ga.b2ContactFactory.apply(this,arguments);this.constructor===ga&&this.b2ContactFactory.apply(this,arguments)}function Qa(){Qa.b2ContactRegister.apply(this,arguments)}function Ha(){Ha.b2ContactResult.apply(this,
- arguments)}function ba(){ba.b2ContactSolver.apply(this,arguments);this.constructor===ba&&this.b2ContactSolver.apply(this,arguments)}function Ia(){Ia.b2EdgeAndCircleContact.apply(this,arguments)}function ca(){ca.b2NullContact.apply(this,arguments);this.constructor===ca&&this.b2NullContact.apply(this,arguments)}function Ja(){Ja.b2PolyAndCircleContact.apply(this,arguments)}function Ka(){Ka.b2PolyAndEdgeContact.apply(this,arguments)}function La(){La.b2PolygonContact.apply(this,arguments)}function ha(){ha.b2PositionSolverManifold.apply(this,
- arguments);this.constructor===ha&&this.b2PositionSolverManifold.apply(this,arguments)}function Ra(){Ra.b2BuoyancyController.apply(this,arguments)}function Sa(){Sa.b2ConstantAccelController.apply(this,arguments)}function Ta(){Ta.b2ConstantForceController.apply(this,arguments)}function Ua(){Ua.b2Controller.apply(this,arguments)}function Va(){Va.b2ControllerEdge.apply(this,arguments)}function Wa(){Wa.b2GravityController.apply(this,arguments)}function Xa(){Xa.b2TensorDampingController.apply(this,arguments)}
- function ia(){ia.b2DistanceJoint.apply(this,arguments);this.constructor===ia&&this.b2DistanceJoint.apply(this,arguments)}function ja(){ja.b2DistanceJointDef.apply(this,arguments);this.constructor===ja&&this.b2DistanceJointDef.apply(this,arguments)}function ka(){ka.b2FrictionJoint.apply(this,arguments);this.constructor===ka&&this.b2FrictionJoint.apply(this,arguments)}function la(){la.b2FrictionJointDef.apply(this,arguments);this.constructor===la&&this.b2FrictionJointDef.apply(this,arguments)}function ma(){ma.b2GearJoint.apply(this,
- arguments);this.constructor===ma&&this.b2GearJoint.apply(this,arguments)}function na(){na.b2GearJointDef.apply(this,arguments);this.constructor===na&&this.b2GearJointDef.apply(this,arguments)}function Ya(){Ya.b2Jacobian.apply(this,arguments)}function oa(){oa.b2Joint.apply(this,arguments);this.constructor===oa&&this.b2Joint.apply(this,arguments)}function pa(){pa.b2JointDef.apply(this,arguments);this.constructor===pa&&this.b2JointDef.apply(this,arguments)}function Za(){Za.b2JointEdge.apply(this,arguments)}
- function qa(){qa.b2LineJoint.apply(this,arguments);this.constructor===qa&&this.b2LineJoint.apply(this,arguments)}function ra(){ra.b2LineJointDef.apply(this,arguments);this.constructor===ra&&this.b2LineJointDef.apply(this,arguments)}function sa(){sa.b2MouseJoint.apply(this,arguments);this.constructor===sa&&this.b2MouseJoint.apply(this,arguments)}function ta(){ta.b2MouseJointDef.apply(this,arguments);this.constructor===ta&&this.b2MouseJointDef.apply(this,arguments)}function ua(){ua.b2PrismaticJoint.apply(this,
- arguments);this.constructor===ua&&this.b2PrismaticJoint.apply(this,arguments)}function va(){va.b2PrismaticJointDef.apply(this,arguments);this.constructor===va&&this.b2PrismaticJointDef.apply(this,arguments)}function wa(){wa.b2PulleyJoint.apply(this,arguments);this.constructor===wa&&this.b2PulleyJoint.apply(this,arguments)}function xa(){xa.b2PulleyJointDef.apply(this,arguments);this.constructor===xa&&this.b2PulleyJointDef.apply(this,arguments)}function ya(){ya.b2RevoluteJoint.apply(this,arguments);
- this.constructor===ya&&this.b2RevoluteJoint.apply(this,arguments)}function za(){za.b2RevoluteJointDef.apply(this,arguments);this.constructor===za&&this.b2RevoluteJointDef.apply(this,arguments)}function Aa(){Aa.b2WeldJoint.apply(this,arguments);this.constructor===Aa&&this.b2WeldJoint.apply(this,arguments)}function Ba(){Ba.b2WeldJointDef.apply(this,arguments);this.constructor===Ba&&this.b2WeldJointDef.apply(this,arguments)}Box2D.Collision.IBroadPhase="Box2D.Collision.IBroadPhase";Box2D.Collision.b2AABB=
- c;Box2D.Collision.b2Bound=e;Box2D.Collision.b2BoundValues=d;Box2D.Collision.b2Collision=a;Box2D.Collision.b2ContactID=b;Box2D.Collision.b2ContactPoint=f;Box2D.Collision.b2Distance=m;Box2D.Collision.b2DistanceInput=h;Box2D.Collision.b2DistanceOutput=g;Box2D.Collision.b2DistanceProxy=k;Box2D.Collision.b2DynamicTree=l;Box2D.Collision.b2DynamicTreeBroadPhase=n;Box2D.Collision.b2DynamicTreeNode=p;Box2D.Collision.b2DynamicTreePair=q;Box2D.Collision.b2Manifold=v;Box2D.Collision.b2ManifoldPoint=F;Box2D.Collision.b2Point=
- r;Box2D.Collision.b2RayCastInput=D;Box2D.Collision.b2RayCastOutput=x;Box2D.Collision.b2Segment=C;Box2D.Collision.b2SeparationFunction=A;Box2D.Collision.b2Simplex=z;Box2D.Collision.b2SimplexCache=u;Box2D.Collision.b2SimplexVertex=J;Box2D.Collision.b2TimeOfImpact=B;Box2D.Collision.b2TOIInput=K;Box2D.Collision.b2WorldManifold=I;Box2D.Collision.ClipVertex=E;Box2D.Collision.Features=s;Box2D.Collision.Shapes.b2CircleShape=w;Box2D.Collision.Shapes.b2EdgeChainDef=G;Box2D.Collision.Shapes.b2EdgeShape=M;Box2D.Collision.Shapes.b2MassData=
- L;Box2D.Collision.Shapes.b2PolygonShape=R;Box2D.Collision.Shapes.b2Shape=P;Box2D.Common.b2internal="Box2D.Common.b2internal";Box2D.Common.b2Color=t;Box2D.Common.b2Settings=y;Box2D.Common.Math.b2Mat22=H;Box2D.Common.Math.b2Mat33=O;Box2D.Common.Math.b2Math=Q;Box2D.Common.Math.b2Sweep=N;Box2D.Common.Math.b2Transform=T;Box2D.Common.Math.b2Vec2=S;Box2D.Common.Math.b2Vec3=U;Box2D.Dynamics.b2Body=V;Box2D.Dynamics.b2BodyDef=W;Box2D.Dynamics.b2ContactFilter=Ca;Box2D.Dynamics.b2ContactImpulse=Da;Box2D.Dynamics.b2ContactListener=
- Ea;Box2D.Dynamics.b2ContactManager=X;Box2D.Dynamics.b2DebugDraw=Y;Box2D.Dynamics.b2DestructionListener=Fa;Box2D.Dynamics.b2FilterData=Ga;Box2D.Dynamics.b2Fixture=Z;Box2D.Dynamics.b2FixtureDef=$;Box2D.Dynamics.b2Island=aa;Box2D.Dynamics.b2TimeStep=Ma;Box2D.Dynamics.b2World=da;Box2D.Dynamics.Contacts.b2CircleContact=Na;Box2D.Dynamics.Contacts.b2Contact=ea;Box2D.Dynamics.Contacts.b2ContactConstraint=fa;Box2D.Dynamics.Contacts.b2ContactConstraintPoint=Oa;Box2D.Dynamics.Contacts.b2ContactEdge=Pa;Box2D.Dynamics.Contacts.b2ContactFactory=
- ga;Box2D.Dynamics.Contacts.b2ContactRegister=Qa;Box2D.Dynamics.Contacts.b2ContactResult=Ha;Box2D.Dynamics.Contacts.b2ContactSolver=ba;Box2D.Dynamics.Contacts.b2EdgeAndCircleContact=Ia;Box2D.Dynamics.Contacts.b2NullContact=ca;Box2D.Dynamics.Contacts.b2PolyAndCircleContact=Ja;Box2D.Dynamics.Contacts.b2PolyAndEdgeContact=Ka;Box2D.Dynamics.Contacts.b2PolygonContact=La;Box2D.Dynamics.Contacts.b2PositionSolverManifold=ha;Box2D.Dynamics.Controllers.b2BuoyancyController=Ra;Box2D.Dynamics.Controllers.b2ConstantAccelController=
- Sa;Box2D.Dynamics.Controllers.b2ConstantForceController=Ta;Box2D.Dynamics.Controllers.b2Controller=Ua;Box2D.Dynamics.Controllers.b2ControllerEdge=Va;Box2D.Dynamics.Controllers.b2GravityController=Wa;Box2D.Dynamics.Controllers.b2TensorDampingController=Xa;Box2D.Dynamics.Joints.b2DistanceJoint=ia;Box2D.Dynamics.Joints.b2DistanceJointDef=ja;Box2D.Dynamics.Joints.b2FrictionJoint=ka;Box2D.Dynamics.Joints.b2FrictionJointDef=la;Box2D.Dynamics.Joints.b2GearJoint=ma;Box2D.Dynamics.Joints.b2GearJointDef=na;
- Box2D.Dynamics.Joints.b2Jacobian=Ya;Box2D.Dynamics.Joints.b2Joint=oa;Box2D.Dynamics.Joints.b2JointDef=pa;Box2D.Dynamics.Joints.b2JointEdge=Za;Box2D.Dynamics.Joints.b2LineJoint=qa;Box2D.Dynamics.Joints.b2LineJointDef=ra;Box2D.Dynamics.Joints.b2MouseJoint=sa;Box2D.Dynamics.Joints.b2MouseJointDef=ta;Box2D.Dynamics.Joints.b2PrismaticJoint=ua;Box2D.Dynamics.Joints.b2PrismaticJointDef=va;Box2D.Dynamics.Joints.b2PulleyJoint=wa;Box2D.Dynamics.Joints.b2PulleyJointDef=xa;Box2D.Dynamics.Joints.b2RevoluteJoint=
- ya;Box2D.Dynamics.Joints.b2RevoluteJointDef=za;Box2D.Dynamics.Joints.b2WeldJoint=Aa;Box2D.Dynamics.Joints.b2WeldJointDef=Ba})();Box2D.postDefs=[];
- (function(){var c=Box2D.Collision.Shapes.b2CircleShape,e=Box2D.Collision.Shapes.b2PolygonShape,d=Box2D.Collision.Shapes.b2Shape,a=Box2D.Common.b2Settings,b=Box2D.Common.Math.b2Math,f=Box2D.Common.Math.b2Sweep,m=Box2D.Common.Math.b2Transform,h=Box2D.Common.Math.b2Vec2,g=Box2D.Collision.b2AABB,k=Box2D.Collision.b2Bound,l=Box2D.Collision.b2BoundValues,n=Box2D.Collision.b2Collision,p=Box2D.Collision.b2ContactID,q=Box2D.Collision.b2ContactPoint,v=Box2D.Collision.b2Distance,F=Box2D.Collision.b2DistanceInput,
- r=Box2D.Collision.b2DistanceOutput,D=Box2D.Collision.b2DistanceProxy,x=Box2D.Collision.b2DynamicTree,C=Box2D.Collision.b2DynamicTreeBroadPhase,A=Box2D.Collision.b2DynamicTreeNode,z=Box2D.Collision.b2DynamicTreePair,u=Box2D.Collision.b2Manifold,J=Box2D.Collision.b2ManifoldPoint,B=Box2D.Collision.b2Point,K=Box2D.Collision.b2RayCastInput,I=Box2D.Collision.b2RayCastOutput,E=Box2D.Collision.b2Segment,s=Box2D.Collision.b2SeparationFunction,w=Box2D.Collision.b2Simplex,G=Box2D.Collision.b2SimplexCache,M=
- Box2D.Collision.b2SimplexVertex,L=Box2D.Collision.b2TimeOfImpact,R=Box2D.Collision.b2TOIInput,P=Box2D.Collision.b2WorldManifold,t=Box2D.Collision.ClipVertex,y=Box2D.Collision.Features,H=Box2D.Collision.IBroadPhase;g.b2AABB=function(){this.lowerBound=new h;this.upperBound=new h};g.prototype.IsValid=function(){var a=this.upperBound.y-this.lowerBound.y;return a=(a=0<=this.upperBound.x-this.lowerBound.x&&0<=a)&&this.lowerBound.IsValid()&&this.upperBound.IsValid()};g.prototype.GetCenter=function(){return new h((this.lowerBound.x+
- this.upperBound.x)/2,(this.lowerBound.y+this.upperBound.y)/2)};g.prototype.GetExtents=function(){return new h((this.upperBound.x-this.lowerBound.x)/2,(this.upperBound.y-this.lowerBound.y)/2)};g.prototype.Contains=function(a){var b;return b=(b=(b=(b=this.lowerBound.x<=a.lowerBound.x)&&this.lowerBound.y<=a.lowerBound.y)&&a.upperBound.x<=this.upperBound.x)&&a.upperBound.y<=this.upperBound.y};g.prototype.RayCast=function(a,b){var c=-Number.MAX_VALUE,d=Number.MAX_VALUE,e=b.p1.x,t=b.p1.y,f=b.p2.x-b.p1.x,
- h=b.p2.y-b.p1.y,g=Math.abs(f),y=Math.abs(h),s=a.normal,k=0,w=0,H=k=0,H=0;if(g<Number.MIN_VALUE){if(e<this.lowerBound.x||this.upperBound.x<e)return!1}else if(k=1/f,w=(this.lowerBound.x-e)*k,k*=this.upperBound.x-e,H=-1,w>k&&(H=w,w=k,k=H,H=1),w>c&&(s.x=H,s.y=0,c=w),d=Math.min(d,k),c>d)return!1;if(y<Number.MIN_VALUE){if(t<this.lowerBound.y||this.upperBound.y<t)return!1}else if(k=1/h,w=(this.lowerBound.y-t)*k,k*=this.upperBound.y-t,H=-1,w>k&&(H=w,w=k,k=H,H=1),w>c&&(s.y=H,s.x=0,c=w),d=Math.min(d,k),c>d)return!1;
- a.fraction=c;return!0};g.prototype.TestOverlap=function(a){var b=a.lowerBound.y-this.upperBound.y,c=this.lowerBound.y-a.upperBound.y;return 0<a.lowerBound.x-this.upperBound.x||0<b||0<this.lowerBound.x-a.upperBound.x||0<c?!1:!0};g.Combine=function(a,b){var c=new g;c.Combine(a,b);return c};g.prototype.Combine=function(a,b){this.lowerBound.x=Math.min(a.lowerBound.x,b.lowerBound.x);this.lowerBound.y=Math.min(a.lowerBound.y,b.lowerBound.y);this.upperBound.x=Math.max(a.upperBound.x,b.upperBound.x);this.upperBound.y=
- Math.max(a.upperBound.y,b.upperBound.y)};k.b2Bound=function(){};k.prototype.IsLower=function(){return 0==(this.value&1)};k.prototype.IsUpper=function(){return 1==(this.value&1)};k.prototype.Swap=function(a){var b=this.value,c=this.proxy,d=this.stabbingCount;this.value=a.value;this.proxy=a.proxy;this.stabbingCount=a.stabbingCount;a.value=b;a.proxy=c;a.stabbingCount=d};l.b2BoundValues=function(){};l.prototype.b2BoundValues=function(){this.lowerValues=new Vector_a2j_Number;this.lowerValues[0]=0;this.lowerValues[1]=
- 0;this.upperValues=new Vector_a2j_Number;this.upperValues[0]=0;this.upperValues[1]=0};n.b2Collision=function(){};n.ClipSegmentToLine=function(a,b,c,d){void 0===d&&(d=0);var e,t=0;e=b[0];var f=e.v;e=b[1];var h=e.v,g=c.x*f.x+c.y*f.y-d;e=c.x*h.x+c.y*h.y-d;0>=g&&a[t++].Set(b[0]);0>=e&&a[t++].Set(b[1]);0>g*e&&(c=g/(g-e),e=a[t],e=e.v,e.x=f.x+c*(h.x-f.x),e.y=f.y+c*(h.y-f.y),e=a[t],e.id=(0<g?b[0]:b[1]).id,++t);return t};n.EdgeSeparation=function(a,b,c,d,e){void 0===c&&(c=0);parseInt(a.m_vertexCount);var t=
- a.m_vertices;a=a.m_normals;var f=parseInt(d.m_vertexCount),h=d.m_vertices,g,y;g=b.R;y=a[c];a=g.col1.x*y.x+g.col2.x*y.y;d=g.col1.y*y.x+g.col2.y*y.y;g=e.R;var s=g.col1.x*a+g.col1.y*d;g=g.col2.x*a+g.col2.y*d;for(var k=0,w=Number.MAX_VALUE,H=0;H<f;++H)y=h[H],y=y.x*s+y.y*g,y<w&&(w=y,k=H);y=t[c];g=b.R;c=b.position.x+(g.col1.x*y.x+g.col2.x*y.y);b=b.position.y+(g.col1.y*y.x+g.col2.y*y.y);y=h[k];g=e.R;t=e.position.x+(g.col1.x*y.x+g.col2.x*y.y);e=e.position.y+(g.col1.y*y.x+g.col2.y*y.y);return(t-c)*a+(e-b)*
- d};n.FindMaxSeparation=function(a,b,c,d,e){var t=parseInt(b.m_vertexCount),f=b.m_normals,h,g;g=e.R;h=d.m_centroid;var y=e.position.x+(g.col1.x*h.x+g.col2.x*h.y),s=e.position.y+(g.col1.y*h.x+g.col2.y*h.y);g=c.R;h=b.m_centroid;y-=c.position.x+(g.col1.x*h.x+g.col2.x*h.y);s-=c.position.y+(g.col1.y*h.x+g.col2.y*h.y);g=y*c.R.col1.x+s*c.R.col1.y;for(var s=y*c.R.col2.x+s*c.R.col2.y,y=0,k=-Number.MAX_VALUE,w=0;w<t;++w)h=f[w],h=h.x*g+h.y*s,h>k&&(k=h,y=w);f=n.EdgeSeparation(b,c,y,d,e);h=parseInt(0<=y-1?y-1:
- t-1);g=n.EdgeSeparation(b,c,h,d,e);var s=parseInt(y+1<t?y+1:0),k=n.EdgeSeparation(b,c,s,d,e),H=w=0,M=0;if(g>f&&g>k)M=-1,w=h,H=g;else if(k>f)M=1,w=s,H=k;else return a[0]=y,f;for(;;)if(y=-1==M?0<=w-1?w-1:t-1:w+1<t?w+1:0,f=n.EdgeSeparation(b,c,y,d,e),f>H)w=y,H=f;else break;a[0]=w;return H};n.FindIncidentEdge=function(a,b,c,d,e,t){void 0===d&&(d=0);parseInt(b.m_vertexCount);var f=b.m_normals,h=parseInt(e.m_vertexCount);b=e.m_vertices;e=e.m_normals;var g;g=c.R;c=f[d];var f=g.col1.x*c.x+g.col2.x*c.y,y=
- g.col1.y*c.x+g.col2.y*c.y;g=t.R;c=g.col1.x*f+g.col1.y*y;y=g.col2.x*f+g.col2.y*y;f=c;g=0;for(var s=Number.MAX_VALUE,k=0;k<h;++k)c=e[k],c=f*c.x+y*c.y,c<s&&(s=c,g=k);e=parseInt(g);f=parseInt(e+1<h?e+1:0);h=a[0];c=b[e];g=t.R;h.v.x=t.position.x+(g.col1.x*c.x+g.col2.x*c.y);h.v.y=t.position.y+(g.col1.y*c.x+g.col2.y*c.y);h.id.features.referenceEdge=d;h.id.features.incidentEdge=e;h.id.features.incidentVertex=0;h=a[1];c=b[f];g=t.R;h.v.x=t.position.x+(g.col1.x*c.x+g.col2.x*c.y);h.v.y=t.position.y+(g.col1.y*
- c.x+g.col2.y*c.y);h.id.features.referenceEdge=d;h.id.features.incidentEdge=f;h.id.features.incidentVertex=1};n.MakeClipPointVector=function(){var a=new Vector(2);a[0]=new t;a[1]=new t;return a};n.CollidePolygons=function(b,c,d,e,t){var f;b.m_pointCount=0;var h=c.m_radius+e.m_radius;n.s_edgeAO[0]=0;var g=n.FindMaxSeparation(n.s_edgeAO,c,d,e,t);f=n.s_edgeAO[0];if(!(g>h)){var y;n.s_edgeBO[0]=0;var s=n.FindMaxSeparation(n.s_edgeBO,e,t,c,d);y=n.s_edgeBO[0];if(!(s>h)){var k=0,w=0;s>0.98*g+0.001?(g=e,e=
- c,c=t,k=y,b.m_type=u.e_faceB,w=1):(g=c,c=d,d=t,k=f,b.m_type=u.e_faceA,w=0);f=n.s_incidentEdge;n.FindIncidentEdge(f,g,c,k,e,d);y=parseInt(g.m_vertexCount);t=g.m_vertices;var g=t[k],H;H=k+1<y?t[parseInt(k+1)]:t[0];k=n.s_localTangent;k.Set(H.x-g.x,H.y-g.y);k.Normalize();t=n.s_localNormal;t.x=k.y;t.y=-k.x;e=n.s_planePoint;e.Set(0.5*(g.x+H.x),0.5*(g.y+H.y));s=n.s_tangent;y=c.R;s.x=y.col1.x*k.x+y.col2.x*k.y;s.y=y.col1.y*k.x+y.col2.y*k.y;var M=n.s_tangent2;M.x=-s.x;M.y=-s.y;k=n.s_normal;k.x=s.y;k.y=-s.x;
- var l=n.s_v11,m=n.s_v12;l.x=c.position.x+(y.col1.x*g.x+y.col2.x*g.y);l.y=c.position.y+(y.col1.y*g.x+y.col2.y*g.y);m.x=c.position.x+(y.col1.x*H.x+y.col2.x*H.y);m.y=c.position.y+(y.col1.y*H.x+y.col2.y*H.y);c=k.x*l.x+k.y*l.y;y=s.x*m.x+s.y*m.y+h;H=n.s_clipPoints1;g=n.s_clipPoints2;m=0;m=n.ClipSegmentToLine(H,f,M,-s.x*l.x-s.y*l.y+h);if(!(2>m)&&(m=n.ClipSegmentToLine(g,H,s,y),!(2>m))){b.m_localPlaneNormal.SetV(t);b.m_localPoint.SetV(e);for(e=t=0;e<a.b2_maxManifoldPoints;++e)f=g[e],k.x*f.v.x+k.y*f.v.y-c<=
- h&&(s=b.m_points[t],y=d.R,M=f.v.x-d.position.x,l=f.v.y-d.position.y,s.m_localPoint.x=M*y.col1.x+l*y.col1.y,s.m_localPoint.y=M*y.col2.x+l*y.col2.y,s.m_id.Set(f.id),s.m_id.features.flip=w,++t);b.m_pointCount=t}}}};n.CollideCircles=function(a,b,c,d,e){a.m_pointCount=0;var t,f;t=c.R;f=b.m_p;var g=c.position.x+(t.col1.x*f.x+t.col2.x*f.y);c=c.position.y+(t.col1.y*f.x+t.col2.y*f.y);t=e.R;f=d.m_p;g=e.position.x+(t.col1.x*f.x+t.col2.x*f.y)-g;e=e.position.y+(t.col1.y*f.x+t.col2.y*f.y)-c;t=b.m_radius+d.m_radius;
- g*g+e*e>t*t||(a.m_type=u.e_circles,a.m_localPoint.SetV(b.m_p),a.m_localPlaneNormal.SetZero(),a.m_pointCount=1,a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0)};n.CollidePolygonAndCircle=function(a,b,c,d,e){var t=a.m_pointCount=0,f=0,g,h;h=e.R;g=d.m_p;var y=e.position.y+(h.col1.y*g.x+h.col2.y*g.y),t=e.position.x+(h.col1.x*g.x+h.col2.x*g.y)-c.position.x,f=y-c.position.y;h=c.R;c=t*h.col1.x+f*h.col1.y;h=t*h.col2.x+f*h.col2.y;var s=0,y=-Number.MAX_VALUE;e=b.m_radius+d.m_radius;var k=parseInt(b.m_vertexCount),
- w=b.m_vertices;b=b.m_normals;for(var H=0;H<k;++H){g=w[H];t=c-g.x;f=h-g.y;g=b[H];t=g.x*t+g.y*f;if(t>e)return;t>y&&(y=t,s=H)}t=parseInt(s);f=parseInt(t+1<k?t+1:0);g=w[t];w=w[f];y<Number.MIN_VALUE?(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.SetV(b[s]),a.m_localPoint.x=0.5*(g.x+w.x),a.m_localPoint.y=0.5*(g.y+w.y),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0):(y=(c-w.x)*(g.x-w.x)+(h-w.y)*(g.y-w.y),0>=(c-g.x)*(w.x-g.x)+(h-g.y)*(w.y-g.y)?(c-g.x)*(c-g.x)+(h-g.y)*(h-g.y)>e*
- e||(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.x=c-g.x,a.m_localPlaneNormal.y=h-g.y,a.m_localPlaneNormal.Normalize(),a.m_localPoint.SetV(g),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0):0>=y?(c-w.x)*(c-w.x)+(h-w.y)*(h-w.y)>e*e||(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.x=c-w.x,a.m_localPlaneNormal.y=h-w.y,a.m_localPlaneNormal.Normalize(),a.m_localPoint.SetV(w),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0):(s=0.5*(g.x+w.x),g=0.5*(g.y+
- w.y),y=(c-s)*b[t].x+(h-g)*b[t].y,y>e||(a.m_pointCount=1,a.m_type=u.e_faceA,a.m_localPlaneNormal.x=b[t].x,a.m_localPlaneNormal.y=b[t].y,a.m_localPlaneNormal.Normalize(),a.m_localPoint.Set(s,g),a.m_points[0].m_localPoint.SetV(d.m_p),a.m_points[0].m_id.key=0)))};n.TestOverlap=function(a,b){var c=b.lowerBound,d=a.upperBound,e=c.x-d.x,t=c.y-d.y,c=a.lowerBound,d=b.upperBound,f=c.y-d.y;return 0<e||0<t||0<c.x-d.x||0<f?!1:!0};Box2D.postDefs.push(function(){Box2D.Collision.b2Collision.s_incidentEdge=n.MakeClipPointVector();
- Box2D.Collision.b2Collision.s_clipPoints1=n.MakeClipPointVector();Box2D.Collision.b2Collision.s_clipPoints2=n.MakeClipPointVector();Box2D.Collision.b2Collision.s_edgeAO=new Vector_a2j_Number(1);Box2D.Collision.b2Collision.s_edgeBO=new Vector_a2j_Number(1);Box2D.Collision.b2Collision.s_localTangent=new h;Box2D.Collision.b2Collision.s_localNormal=new h;Box2D.Collision.b2Collision.s_planePoint=new h;Box2D.Collision.b2Collision.s_normal=new h;Box2D.Collision.b2Collision.s_tangent=new h;Box2D.Collision.b2Collision.s_tangent2=
- new h;Box2D.Collision.b2Collision.s_v11=new h;Box2D.Collision.b2Collision.s_v12=new h;Box2D.Collision.b2Collision.b2CollidePolyTempVec=new h;Box2D.Collision.b2Collision.b2_nullFeature=255});p.b2ContactID=function(){this.features=new y};p.prototype.b2ContactID=function(){this.features._m_id=this};p.prototype.Set=function(a){this.key=a._key};p.prototype.Copy=function(){var a=new p;a.key=this.key;return a};Object.defineProperty(p.prototype,"key",{enumerable:!1,configurable:!0,get:function(){return this._key}});
- Object.defineProperty(p.prototype,"key",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._key=a;this.features._referenceEdge=this._key&255;this.features._incidentEdge=(this._key&65280)>>8&255;this.features._incidentVertex=(this._key&16711680)>>16&255;this.features._flip=(this._key&4278190080)>>24&255}});q.b2ContactPoint=function(){this.position=new h;this.velocity=new h;this.normal=new h;this.id=new p};v.b2Distance=function(){};v.Distance=function(c,d,e){++v.b2_gjkCalls;var t=
- e.proxyA,f=e.proxyB,g=e.transformA,y=e.transformB,s=v.s_simplex;s.ReadCache(d,t,g,f,y);var k=s.m_vertices,w=v.s_saveA,H=v.s_saveB,M=0;s.GetClosestPoint().LengthSquared();for(var l=0,m,r=0;20>r;){M=s.m_count;for(l=0;l<M;l++)w[l]=k[l].indexA,H[l]=k[l].indexB;switch(s.m_count){case 1:break;case 2:s.Solve2();break;case 3:s.Solve3();break;default:a.b2Assert(!1)}if(3==s.m_count)break;m=s.GetClosestPoint();m.LengthSquared();l=s.GetSearchDirection();if(l.LengthSquared()<Number.MIN_VALUE*Number.MIN_VALUE)break;
- m=k[s.m_count];m.indexA=t.GetSupport(b.MulTMV(g.R,l.GetNegative()));m.wA=b.MulX(g,t.GetVertex(m.indexA));m.indexB=f.GetSupport(b.MulTMV(y.R,l));m.wB=b.MulX(y,f.GetVertex(m.indexB));m.w=b.SubtractVV(m.wB,m.wA);++r;++v.b2_gjkIters;for(var G=!1,l=0;l<M;l++)if(m.indexA==w[l]&&m.indexB==H[l]){G=!0;break}if(G)break;++s.m_count}v.b2_gjkMaxIters=b.Max(v.b2_gjkMaxIters,r);s.GetWitnessPoints(c.pointA,c.pointB);c.distance=b.SubtractVV(c.pointA,c.pointB).Length();c.iterations=r;s.WriteCache(d);e.useRadii&&(d=
- t.m_radius,f=f.m_radius,c.distance>d+f&&c.distance>Number.MIN_VALUE?(c.distance-=d+f,e=b.SubtractVV(c.pointB,c.pointA),e.Normalize(),c.pointA.x+=d*e.x,c.pointA.y+=d*e.y,c.pointB.x-=f*e.x,c.pointB.y-=f*e.y):(m=new h,m.x=0.5*(c.pointA.x+c.pointB.x),m.y=0.5*(c.pointA.y+c.pointB.y),c.pointA.x=c.pointB.x=m.x,c.pointA.y=c.pointB.y=m.y,c.distance=0))};Box2D.postDefs.push(function(){Box2D.Collision.b2Distance.s_simplex=new w;Box2D.Collision.b2Distance.s_saveA=new Vector_a2j_Number(3);Box2D.Collision.b2Distance.s_saveB=
- new Vector_a2j_Number(3)});F.b2DistanceInput=function(){};r.b2DistanceOutput=function(){this.pointA=new h;this.pointB=new h};D.b2DistanceProxy=function(){};D.prototype.Set=function(b){switch(b.GetType()){case d.e_circleShape:b=b instanceof c?b:null;this.m_vertices=new Vector(1,!0);this.m_vertices[0]=b.m_p;this.m_count=1;this.m_radius=b.m_radius;break;case d.e_polygonShape:b=b instanceof e?b:null;this.m_vertices=b.m_vertices;this.m_count=b.m_vertexCount;this.m_radius=b.m_radius;break;default:a.b2Assert(!1)}};
- D.prototype.GetSupport=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*a.y,d=1;d<this.m_count;++d){var e=this.m_vertices[d].x*a.x+this.m_vertices[d].y*a.y;e>c&&(b=d,c=e)}return b};D.prototype.GetSupportVertex=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*a.y,d=1;d<this.m_count;++d){var e=this.m_vertices[d].x*a.x+this.m_vertices[d].y*a.y;e>c&&(b=d,c=e)}return this.m_vertices[b]};D.prototype.GetVertexCount=function(){return this.m_count};D.prototype.GetVertex=
- function(b){void 0===b&&(b=0);a.b2Assert(0<=b&&b<this.m_count);return this.m_vertices[b]};x.b2DynamicTree=function(){};x.prototype.b2DynamicTree=function(){this.m_freeList=this.m_root=null;this.m_insertionCount=this.m_path=0};x.prototype.CreateProxy=function(b,c){var d=this.AllocateNode(),e=a.b2_aabbExtension,t=a.b2_aabbExtension;d.aabb.lowerBound.x=b.lowerBound.x-e;d.aabb.lowerBound.y=b.lowerBound.y-t;d.aabb.upperBound.x=b.upperBound.x+e;d.aabb.upperBound.y=b.upperBound.y+t;d.userData=c;this.InsertLeaf(d);
- return d};x.prototype.DestroyProxy=function(a){this.RemoveLeaf(a);this.FreeNode(a)};x.prototype.MoveProxy=function(b,c,d){a.b2Assert(b.IsLeaf());if(b.aabb.Contains(c))return!1;this.RemoveLeaf(b);var e=a.b2_aabbExtension+a.b2_aabbMultiplier*(0<d.x?d.x:-d.x);d=a.b2_aabbExtension+a.b2_aabbMultiplier*(0<d.y?d.y:-d.y);b.aabb.lowerBound.x=c.lowerBound.x-e;b.aabb.lowerBound.y=c.lowerBound.y-d;b.aabb.upperBound.x=c.upperBound.x+e;b.aabb.upperBound.y=c.upperBound.y+d;this.InsertLeaf(b);return!0};x.prototype.Rebalance=
- function(a){void 0===a&&(a=0);if(null!=this.m_root)for(var b=0;b<a;b++){for(var c=this.m_root,d=0;!1==c.IsLeaf();)c=this.m_path>>d&1?c.child2:c.child1,d=d+1&31;++this.m_path;this.RemoveLeaf(c);this.InsertLeaf(c)}};x.prototype.GetFatAABB=function(a){return a.aabb};x.prototype.GetUserData=function(a){return a.userData};x.prototype.Query=function(a,b){if(null!=this.m_root){var c=new Vector,d=0;for(c[d++]=this.m_root;0<d;){var e=c[--d];if(e.aabb.TestOverlap(b))if(e.IsLeaf()){if(!a(e))break}else c[d++]=
- e.child1,c[d++]=e.child2}}};x.prototype.RayCast=function(a,c){if(null!=this.m_root){var d=c.p1,e=c.p2,t=b.SubtractVV(d,e);t.Normalize();var t=b.CrossFV(1,t),f=b.AbsV(t),h=c.maxFraction,y=new g,s=0,k=0,s=d.x+h*(e.x-d.x),k=d.y+h*(e.y-d.y);y.lowerBound.x=Math.min(d.x,s);y.lowerBound.y=Math.min(d.y,k);y.upperBound.x=Math.max(d.x,s);y.upperBound.y=Math.max(d.y,k);var w=new Vector,H=0;for(w[H++]=this.m_root;0<H;)if(h=w[--H],!1!=h.aabb.TestOverlap(y)&&(s=h.aabb.GetCenter(),k=h.aabb.GetExtents(),!(0<Math.abs(t.x*
- (d.x-s.x)+t.y*(d.y-s.y))-f.x*k.x-f.y*k.y)))if(h.IsLeaf()){s=new K;s.p1=c.p1;s.p2=c.p2;s.maxFraction=c.maxFraction;h=a(s,h);if(0==h)break;0<h&&(s=d.x+h*(e.x-d.x),k=d.y+h*(e.y-d.y),y.lowerBound.x=Math.min(d.x,s),y.lowerBound.y=Math.min(d.y,k),y.upperBound.x=Math.max(d.x,s),y.upperBound.y=Math.max(d.y,k))}else w[H++]=h.child1,w[H++]=h.child2}};x.prototype.AllocateNode=function(){if(this.m_freeList){var a=this.m_freeList;this.m_freeList=a.parent;a.parent=null;a.child1=null;a.child2=null;return a}return new A};
- x.prototype.FreeNode=function(a){a.parent=this.m_freeList;this.m_freeList=a};x.prototype.InsertLeaf=function(a){++this.m_insertionCount;if(null==this.m_root)this.m_root=a,this.m_root.parent=null;else{var b=a.aabb.GetCenter(),c=this.m_root;if(!1==c.IsLeaf()){do var d=c.child1,c=c.child2,e=Math.abs((d.aabb.lowerBound.x+d.aabb.upperBound.x)/2-b.x)+Math.abs((d.aabb.lowerBound.y+d.aabb.upperBound.y)/2-b.y),t=Math.abs((c.aabb.lowerBound.x+c.aabb.upperBound.x)/2-b.x)+Math.abs((c.aabb.lowerBound.y+c.aabb.upperBound.y)/
- 2-b.y),c=e<t?d:c;while(!1==c.IsLeaf())}b=c.parent;d=this.AllocateNode();d.parent=b;d.userData=null;d.aabb.Combine(a.aabb,c.aabb);if(b){c.parent.child1==c?b.child1=d:b.child2=d;d.child1=c;d.child2=a;c.parent=d;a.parent=d;do{if(b.aabb.Contains(d.aabb))break;b.aabb.Combine(b.child1.aabb,b.child2.aabb);d=b;b=b.parent}while(b)}else d.child1=c,d.child2=a,c.parent=d,this.m_root=a.parent=d}};x.prototype.RemoveLeaf=function(a){if(a==this.m_root)this.m_root=null;else{var b=a.parent,c=b.parent;a=b.child1==a?
- b.child2:b.child1;if(c){c.child1==b?c.child1=a:c.child2=a;a.parent=c;for(this.FreeNode(b);c;){b=c.aabb;c.aabb=g.Combine(c.child1.aabb,c.child2.aabb);if(b.Contains(c.aabb))break;c=c.parent}}else this.m_root=a,a.parent=null,this.FreeNode(b)}};C.b2DynamicTreeBroadPhase=function(){this.m_tree=new x;this.m_moveBuffer=new Vector;this.m_pairBuffer=new Vector;this.m_pairCount=0};C.prototype.CreateProxy=function(a,b){var c=this.m_tree.CreateProxy(a,b);++this.m_proxyCount;this.BufferMove(c);return c};C.prototype.DestroyProxy=
- function(a){this.UnBufferMove(a);--this.m_proxyCount;this.m_tree.DestroyProxy(a)};C.prototype.MoveProxy=function(a,b,c){this.m_tree.MoveProxy(a,b,c)&&this.BufferMove(a)};C.prototype.TestOverlap=function(a,b){var c=this.m_tree.GetFatAABB(a),d=this.m_tree.GetFatAABB(b);return c.TestOverlap(d)};C.prototype.GetUserData=function(a){return this.m_tree.GetUserData(a)};C.prototype.GetFatAABB=function(a){return this.m_tree.GetFatAABB(a)};C.prototype.GetProxyCount=function(){return this.m_proxyCount};C.prototype.UpdatePairs=
- function(a){for(var b=this,c=b.m_pairCount=0,d,c=0;c<b.m_moveBuffer.length;++c){d=b.m_moveBuffer[c];var e=b.m_tree.GetFatAABB(d);b.m_tree.Query(function(a){if(a==d)return!0;b.m_pairCount==b.m_pairBuffer.length&&(b.m_pairBuffer[b.m_pairCount]=new z);var c=b.m_pairBuffer[b.m_pairCount];c.proxyA=a<d?a:d;c.proxyB=a>=d?a:d;++b.m_pairCount;return!0},e)}for(c=b.m_moveBuffer.length=0;c<b.m_pairCount;){var e=b.m_pairBuffer[c],t=b.m_tree.GetUserData(e.proxyA),f=b.m_tree.GetUserData(e.proxyB);a(t,f);for(++c;c<
- b.m_pairCount;){t=b.m_pairBuffer[c];if(t.proxyA!=e.proxyA||t.proxyB!=e.proxyB)break;++c}}};C.prototype.Query=function(a,b){this.m_tree.Query(a,b)};C.prototype.RayCast=function(a,b){this.m_tree.RayCast(a,b)};C.prototype.Validate=function(){};C.prototype.Rebalance=function(a){void 0===a&&(a=0);this.m_tree.Rebalance(a)};C.prototype.BufferMove=function(a){this.m_moveBuffer[this.m_moveBuffer.length]=a};C.prototype.UnBufferMove=function(a){a=parseInt(this.m_moveBuffer.indexOf(a));this.m_moveBuffer.splice(a,
- 1)};C.prototype.ComparePairs=function(a,b){return 0};C.__implements={};C.__implements[H]=!0;A.b2DynamicTreeNode=function(){this.aabb=new g};A.prototype.IsLeaf=function(){return null==this.child1};z.b2DynamicTreePair=function(){};u.b2Manifold=function(){this.m_pointCount=0};u.prototype.b2Manifold=function(){this.m_points=new Vector(a.b2_maxManifoldPoints);for(var b=0;b<a.b2_maxManifoldPoints;b++)this.m_points[b]=new J;this.m_localPlaneNormal=new h;this.m_localPoint=new h};u.prototype.Reset=function(){for(var b=
- 0;b<a.b2_maxManifoldPoints;b++)(this.m_points[b]instanceof J?this.m_points[b]:null).Reset();this.m_localPlaneNormal.SetZero();this.m_localPoint.SetZero();this.m_pointCount=this.m_type=0};u.prototype.Set=function(b){this.m_pointCount=b.m_pointCount;for(var c=0;c<a.b2_maxManifoldPoints;c++)(this.m_points[c]instanceof J?this.m_points[c]:null).Set(b.m_points[c]);this.m_localPlaneNormal.SetV(b.m_localPlaneNormal);this.m_localPoint.SetV(b.m_localPoint);this.m_type=b.m_type};u.prototype.Copy=function(){var a=
- new u;a.Set(this);return a};Box2D.postDefs.push(function(){Box2D.Collision.b2Manifold.e_circles=1;Box2D.Collision.b2Manifold.e_faceA=2;Box2D.Collision.b2Manifold.e_faceB=4});J.b2ManifoldPoint=function(){this.m_localPoint=new h;this.m_id=new p};J.prototype.b2ManifoldPoint=function(){this.Reset()};J.prototype.Reset=function(){this.m_localPoint.SetZero();this.m_tangentImpulse=this.m_normalImpulse=0;this.m_id.key=0};J.prototype.Set=function(a){this.m_localPoint.SetV(a.m_localPoint);this.m_normalImpulse=
- a.m_normalImpulse;this.m_tangentImpulse=a.m_tangentImpulse;this.m_id.Set(a.m_id)};B.b2Point=function(){this.p=new h};B.prototype.Support=function(a,b,c){return this.p};B.prototype.GetFirstVertex=function(a){return this.p};K.b2RayCastInput=function(){this.p1=new h;this.p2=new h};K.prototype.b2RayCastInput=function(a,b,c){void 0===a&&(a=null);void 0===b&&(b=null);void 0===c&&(c=1);a&&this.p1.SetV(a);b&&this.p2.SetV(b);this.maxFraction=c};I.b2RayCastOutput=function(){this.normal=new h};E.b2Segment=function(){this.p1=
- new h;this.p2=new h};E.prototype.TestSegment=function(a,b,c,d){void 0===d&&(d=0);var e=c.p1,t=c.p2.x-e.x,f=c.p2.y-e.y;c=this.p2.y-this.p1.y;var g=-(this.p2.x-this.p1.x),h=100*Number.MIN_VALUE,y=-(t*c+f*g);if(y>h){var s=e.x-this.p1.x,k=e.y-this.p1.y,e=s*c+k*g;if(0<=e&&e<=d*y&&(d=-t*k+f*s,-h*y<=d&&d<=y*(1+h)))return e/=y,d=Math.sqrt(c*c+g*g),a[0]=e,b.Set(c/d,g/d),!0}return!1};E.prototype.Extend=function(a){this.ExtendForward(a);this.ExtendBackward(a)};E.prototype.ExtendForward=function(a){var b=this.p2.x-
- this.p1.x,c=this.p2.y-this.p1.y;a=Math.min(0<b?(a.upperBound.x-this.p1.x)/b:0>b?(a.lowerBound.x-this.p1.x)/b:Number.POSITIVE_INFINITY,0<c?(a.upperBound.y-this.p1.y)/c:0>c?(a.lowerBound.y-this.p1.y)/c:Number.POSITIVE_INFINITY);this.p2.x=this.p1.x+b*a;this.p2.y=this.p1.y+c*a};E.prototype.ExtendBackward=function(a){var b=-this.p2.x+this.p1.x,c=-this.p2.y+this.p1.y;a=Math.min(0<b?(a.upperBound.x-this.p2.x)/b:0>b?(a.lowerBound.x-this.p2.x)/b:Number.POSITIVE_INFINITY,0<c?(a.upperBound.y-this.p2.y)/c:0>
- c?(a.lowerBound.y-this.p2.y)/c:Number.POSITIVE_INFINITY);this.p1.x=this.p2.x+b*a;this.p1.y=this.p2.y+c*a};s.b2SeparationFunction=function(){this.m_localPoint=new h;this.m_axis=new h};s.prototype.Initialize=function(c,d,e,t,f){this.m_proxyA=d;this.m_proxyB=t;var g=parseInt(c.count);a.b2Assert(0<g&&3>g);var y,k,w,H,m=H=w=t=d=0,l=0,m=0;1==g?(this.m_type=s.e_points,y=this.m_proxyA.GetVertex(c.indexA[0]),k=this.m_proxyB.GetVertex(c.indexB[0]),g=y,c=e.R,d=e.position.x+(c.col1.x*g.x+c.col2.x*g.y),t=e.position.y+
- (c.col1.y*g.x+c.col2.y*g.y),g=k,c=f.R,w=f.position.x+(c.col1.x*g.x+c.col2.x*g.y),H=f.position.y+(c.col1.y*g.x+c.col2.y*g.y),this.m_axis.x=w-d,this.m_axis.y=H-t,this.m_axis.Normalize()):(c.indexB[0]==c.indexB[1]?(this.m_type=s.e_faceA,d=this.m_proxyA.GetVertex(c.indexA[0]),t=this.m_proxyA.GetVertex(c.indexA[1]),k=this.m_proxyB.GetVertex(c.indexB[0]),this.m_localPoint.x=0.5*(d.x+t.x),this.m_localPoint.y=0.5*(d.y+t.y),this.m_axis=b.CrossVF(b.SubtractVV(t,d),1),this.m_axis.Normalize(),g=this.m_axis,c=
- e.R,m=c.col1.x*g.x+c.col2.x*g.y,l=c.col1.y*g.x+c.col2.y*g.y,g=this.m_localPoint,c=e.R,d=e.position.x+(c.col1.x*g.x+c.col2.x*g.y),t=e.position.y+(c.col1.y*g.x+c.col2.y*g.y),g=k,c=f.R,w=f.position.x+(c.col1.x*g.x+c.col2.x*g.y),H=f.position.y+(c.col1.y*g.x+c.col2.y*g.y),m=(w-d)*m+(H-t)*l):c.indexA[0]==c.indexA[0]?(this.m_type=s.e_faceB,w=this.m_proxyB.GetVertex(c.indexB[0]),H=this.m_proxyB.GetVertex(c.indexB[1]),y=this.m_proxyA.GetVertex(c.indexA[0]),this.m_localPoint.x=0.5*(w.x+H.x),this.m_localPoint.y=
- 0.5*(w.y+H.y),this.m_axis=b.CrossVF(b.SubtractVV(H,w),1),this.m_axis.Normalize(),g=this.m_axis,c=f.R,m=c.col1.x*g.x+c.col2.x*g.y,l=c.col1.y*g.x+c.col2.y*g.y,g=this.m_localPoint,c=f.R,w=f.position.x+(c.col1.x*g.x+c.col2.x*g.y),H=f.position.y+(c.col1.y*g.x+c.col2.y*g.y),g=y,c=e.R,d=e.position.x+(c.col1.x*g.x+c.col2.x*g.y),t=e.position.y+(c.col1.y*g.x+c.col2.y*g.y),m=(d-w)*m+(t-H)*l):(d=this.m_proxyA.GetVertex(c.indexA[0]),t=this.m_proxyA.GetVertex(c.indexA[1]),w=this.m_proxyB.GetVertex(c.indexB[0]),
- H=this.m_proxyB.GetVertex(c.indexB[1]),b.MulX(e,y),y=b.MulMV(e.R,b.SubtractVV(t,d)),b.MulX(f,k),m=b.MulMV(f.R,b.SubtractVV(H,w)),f=y.x*y.x+y.y*y.y,k=m.x*m.x+m.y*m.y,c=b.SubtractVV(m,y),e=y.x*c.x+y.y*c.y,c=m.x*c.x+m.y*c.y,y=y.x*m.x+y.y*m.y,l=f*k-y*y,m=0,0!=l&&(m=b.Clamp((y*c-e*k)/l,0,1)),0>(y*m+c)/k&&(m=b.Clamp((y-e)/f,0,1)),y=new h,y.x=d.x+m*(t.x-d.x),y.y=d.y+m*(t.y-d.y),k=new h,k.x=w.x+m*(H.x-w.x),k.y=w.y+m*(H.y-w.y),0==m||1==m?(this.m_type=s.e_faceB,this.m_axis=b.CrossVF(b.SubtractVV(H,w),1),this.m_axis.Normalize(),
- this.m_localPoint=k):(this.m_type=s.e_faceA,this.m_axis=b.CrossVF(b.SubtractVV(t,d),1),this.m_localPoint=y)),0>m&&this.m_axis.NegativeSelf())};s.prototype.Evaluate=function(c,d){var e,t,f=0;switch(this.m_type){case s.e_points:return e=b.MulTMV(c.R,this.m_axis),t=b.MulTMV(d.R,this.m_axis.GetNegative()),e=this.m_proxyA.GetSupportVertex(e),t=this.m_proxyB.GetSupportVertex(t),e=b.MulX(c,e),t=b.MulX(d,t),f=(t.x-e.x)*this.m_axis.x+(t.y-e.y)*this.m_axis.y;case s.e_faceA:return f=b.MulMV(c.R,this.m_axis),
- e=b.MulX(c,this.m_localPoint),t=b.MulTMV(d.R,f.GetNegative()),t=this.m_proxyB.GetSupportVertex(t),t=b.MulX(d,t),f=(t.x-e.x)*f.x+(t.y-e.y)*f.y;case s.e_faceB:return f=b.MulMV(d.R,this.m_axis),t=b.MulX(d,this.m_localPoint),e=b.MulTMV(c.R,f.GetNegative()),e=this.m_proxyA.GetSupportVertex(e),e=b.MulX(c,e),f=(e.x-t.x)*f.x+(e.y-t.y)*f.y;default:return a.b2Assert(!1),0}};Box2D.postDefs.push(function(){Box2D.Collision.b2SeparationFunction.e_points=1;Box2D.Collision.b2SeparationFunction.e_faceA=2;Box2D.Collision.b2SeparationFunction.e_faceB=
- 4});w.b2Simplex=function(){this.m_v1=new M;this.m_v2=new M;this.m_v3=new M;this.m_vertices=new Vector(3)};w.prototype.b2Simplex=function(){this.m_vertices[0]=this.m_v1;this.m_vertices[1]=this.m_v2;this.m_vertices[2]=this.m_v3};w.prototype.ReadCache=function(c,d,e,t,f){a.b2Assert(0<=c.count&&3>=c.count);var g,h;this.m_count=c.count;for(var y=this.m_vertices,s=0;s<this.m_count;s++){var k=y[s];k.indexA=c.indexA[s];k.indexB=c.indexB[s];g=d.GetVertex(k.indexA);h=t.GetVertex(k.indexB);k.wA=b.MulX(e,g);
- k.wB=b.MulX(f,h);k.w=b.SubtractVV(k.wB,k.wA);k.a=0}if(1<this.m_count&&(c=c.metric,g=this.GetMetric(),g<0.5*c||2*c<g||g<Number.MIN_VALUE))this.m_count=0;0==this.m_count&&(k=y[0],k.indexA=0,k.indexB=0,g=d.GetVertex(0),h=t.GetVertex(0),k.wA=b.MulX(e,g),k.wB=b.MulX(f,h),k.w=b.SubtractVV(k.wB,k.wA),this.m_count=1)};w.prototype.WriteCache=function(a){a.metric=this.GetMetric();a.count=Box2D.parseUInt(this.m_count);for(var b=this.m_vertices,c=0;c<this.m_count;c++)a.indexA[c]=Box2D.parseUInt(b[c].indexA),
- a.indexB[c]=Box2D.parseUInt(b[c].indexB)};w.prototype.GetSearchDirection=function(){switch(this.m_count){case 1:return this.m_v1.w.GetNegative();case 2:var c=b.SubtractVV(this.m_v2.w,this.m_v1.w);return 0<b.CrossVV(c,this.m_v1.w.GetNegative())?b.CrossFV(1,c):b.CrossVF(c,1);default:return a.b2Assert(!1),new h}};w.prototype.GetClosestPoint=function(){switch(this.m_count){case 0:return a.b2Assert(!1),new h;case 1:return this.m_v1.w;case 2:return new h(this.m_v1.a*this.m_v1.w.x+this.m_v2.a*this.m_v2.w.x,
- this.m_v1.a*this.m_v1.w.y+this.m_v2.a*this.m_v2.w.y);default:return a.b2Assert(!1),new h}};w.prototype.GetWitnessPoints=function(b,c){switch(this.m_count){case 0:a.b2Assert(!1);break;case 1:b.SetV(this.m_v1.wA);c.SetV(this.m_v1.wB);break;case 2:b.x=this.m_v1.a*this.m_v1.wA.x+this.m_v2.a*this.m_v2.wA.x;b.y=this.m_v1.a*this.m_v1.wA.y+this.m_v2.a*this.m_v2.wA.y;c.x=this.m_v1.a*this.m_v1.wB.x+this.m_v2.a*this.m_v2.wB.x;c.y=this.m_v1.a*this.m_v1.wB.y+this.m_v2.a*this.m_v2.wB.y;break;case 3:c.x=b.x=this.m_v1.a*
- this.m_v1.wA.x+this.m_v2.a*this.m_v2.wA.x+this.m_v3.a*this.m_v3.wA.x;c.y=b.y=this.m_v1.a*this.m_v1.wA.y+this.m_v2.a*this.m_v2.wA.y+this.m_v3.a*this.m_v3.wA.y;break;default:a.b2Assert(!1)}};w.prototype.GetMetric=function(){switch(this.m_count){case 0:return a.b2Assert(!1),0;case 1:return 0;case 2:return b.SubtractVV(this.m_v1.w,this.m_v2.w).Length();case 3:return b.CrossVV(b.SubtractVV(this.m_v2.w,this.m_v1.w),b.SubtractVV(this.m_v3.w,this.m_v1.w));default:return a.b2Assert(!1),0}};w.prototype.Solve2=
- function(){var a=this.m_v1.w,c=this.m_v2.w,d=b.SubtractVV(c,a),a=-(a.x*d.x+a.y*d.y);0>=a?this.m_count=this.m_v1.a=1:(c=c.x*d.x+c.y*d.y,0>=c?(this.m_count=this.m_v2.a=1,this.m_v1.Set(this.m_v2)):(d=1/(c+a),this.m_v1.a=c*d,this.m_v2.a=a*d,this.m_count=2))};w.prototype.Solve3=function(){var a=this.m_v1.w,c=this.m_v2.w,d=this.m_v3.w,e=b.SubtractVV(c,a),t=b.Dot(a,e),f=b.Dot(c,e),t=-t,g=b.SubtractVV(d,a),h=b.Dot(a,g),y=b.Dot(d,g),h=-h,s=b.SubtractVV(d,c),k=b.Dot(c,s),s=b.Dot(d,s),k=-k,g=b.CrossVV(e,g),
- e=g*b.CrossVV(c,d),d=g*b.CrossVV(d,a),a=g*b.CrossVV(a,c);0>=t&&0>=h?this.m_count=this.m_v1.a=1:0<f&&0<t&&0>=a?(y=1/(f+t),this.m_v1.a=f*y,this.m_v2.a=t*y,this.m_count=2):0<y&&0<h&&0>=d?(f=1/(y+h),this.m_v1.a=y*f,this.m_v3.a=h*f,this.m_count=2,this.m_v2.Set(this.m_v3)):0>=f&&0>=k?(this.m_count=this.m_v2.a=1,this.m_v1.Set(this.m_v2)):0>=y&&0>=s?(this.m_count=this.m_v3.a=1,this.m_v1.Set(this.m_v3)):0<s&&0<k&&0>=e?(f=1/(s+k),this.m_v2.a=s*f,this.m_v3.a=k*f,this.m_count=2,this.m_v1.Set(this.m_v3)):(f=1/
- (e+d+a),this.m_v1.a=e*f,this.m_v2.a=d*f,this.m_v3.a=a*f,this.m_count=3)};G.b2SimplexCache=function(){this.indexA=new Vector_a2j_Number(3);this.indexB=new Vector_a2j_Number(3)};M.b2SimplexVertex=function(){};M.prototype.Set=function(a){this.wA.SetV(a.wA);this.wB.SetV(a.wB);this.w.SetV(a.w);this.a=a.a;this.indexA=a.indexA;this.indexB=a.indexB};L.b2TimeOfImpact=function(){};L.TimeOfImpact=function(c){++L.b2_toiCalls;var d=c.proxyA,e=c.proxyB,t=c.sweepA,f=c.sweepB;a.b2Assert(t.t0==f.t0);a.b2Assert(1-
- t.t0>Number.MIN_VALUE);var g=d.m_radius+e.m_radius;c=c.tolerance;var h=0,y=0,s=0;L.s_cache.count=0;for(L.s_distanceInput.useRadii=!1;;){t.GetTransform(L.s_xfA,h);f.GetTransform(L.s_xfB,h);L.s_distanceInput.proxyA=d;L.s_distanceInput.proxyB=e;L.s_distanceInput.transformA=L.s_xfA;L.s_distanceInput.transformB=L.s_xfB;v.Distance(L.s_distanceOutput,L.s_cache,L.s_distanceInput);if(0>=L.s_distanceOutput.distance){h=1;break}L.s_fcn.Initialize(L.s_cache,d,L.s_xfA,e,L.s_xfB);var k=L.s_fcn.Evaluate(L.s_xfA,
- L.s_xfB);if(0>=k){h=1;break}0==y&&(s=k>g?b.Max(g-c,0.75*g):b.Max(k-c,0.02*g));if(k-s<0.5*c){if(0==y){h=1;break}break}var w=h,H=h,m=1;t.GetTransform(L.s_xfA,m);f.GetTransform(L.s_xfB,m);var l=L.s_fcn.Evaluate(L.s_xfA,L.s_xfB);if(l>=s){h=1;break}for(var M=0;;){var r=0,r=M&1?H+(s-k)*(m-H)/(l-k):0.5*(H+m);t.GetTransform(L.s_xfA,r);f.GetTransform(L.s_xfB,r);var G=L.s_fcn.Evaluate(L.s_xfA,L.s_xfB);if(b.Abs(G-s)<0.025*c){w=r;break}G>s?(H=r,k=G):(m=r,l=G);++M;++L.b2_toiRootIters;if(50==M)break}L.b2_toiMaxRootIters=
- b.Max(L.b2_toiMaxRootIters,M);if(w<(1+100*Number.MIN_VALUE)*h)break;h=w;y++;++L.b2_toiIters;if(1E3==y)break}L.b2_toiMaxIters=b.Max(L.b2_toiMaxIters,y);return h};Box2D.postDefs.push(function(){Box2D.Collision.b2TimeOfImpact.b2_toiCalls=0;Box2D.Collision.b2TimeOfImpact.b2_toiIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiRootIters=0;Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters=0;Box2D.Collision.b2TimeOfImpact.s_cache=new G;Box2D.Collision.b2TimeOfImpact.s_distanceInput=
- new F;Box2D.Collision.b2TimeOfImpact.s_xfA=new m;Box2D.Collision.b2TimeOfImpact.s_xfB=new m;Box2D.Collision.b2TimeOfImpact.s_fcn=new s;Box2D.Collision.b2TimeOfImpact.s_distanceOutput=new r});R.b2TOIInput=function(){this.proxyA=new D;this.proxyB=new D;this.sweepA=new f;this.sweepB=new f};P.b2WorldManifold=function(){this.m_normal=new h};P.prototype.b2WorldManifold=function(){this.m_points=new Vector(a.b2_maxManifoldPoints);for(var b=0;b<a.b2_maxManifoldPoints;b++)this.m_points[b]=new h};P.prototype.Initialize=
- function(a,b,c,d,e){void 0===c&&(c=0);void 0===e&&(e=0);if(0!=a.m_pointCount){var t=0,f,g,h=0,y=0,s=0,k=0,w=0;f=0;switch(a.m_type){case u.e_circles:g=b.R;f=a.m_localPoint;t=b.position.x+g.col1.x*f.x+g.col2.x*f.y;b=b.position.y+g.col1.y*f.x+g.col2.y*f.y;g=d.R;f=a.m_points[0].m_localPoint;a=d.position.x+g.col1.x*f.x+g.col2.x*f.y;d=d.position.y+g.col1.y*f.x+g.col2.y*f.y;f=a-t;g=d-b;h=f*f+g*g;h>Number.MIN_VALUE*Number.MIN_VALUE?(h=Math.sqrt(h),this.m_normal.x=f/h,this.m_normal.y=g/h):(this.m_normal.x=
- 1,this.m_normal.y=0);f=b+c*this.m_normal.y;d-=e*this.m_normal.y;this.m_points[0].x=0.5*(t+c*this.m_normal.x+(a-e*this.m_normal.x));this.m_points[0].y=0.5*(f+d);break;case u.e_faceA:g=b.R;f=a.m_localPlaneNormal;h=g.col1.x*f.x+g.col2.x*f.y;y=g.col1.y*f.x+g.col2.y*f.y;g=b.R;f=a.m_localPoint;s=b.position.x+g.col1.x*f.x+g.col2.x*f.y;k=b.position.y+g.col1.y*f.x+g.col2.y*f.y;this.m_normal.x=h;this.m_normal.y=y;for(t=0;t<a.m_pointCount;t++)g=d.R,f=a.m_points[t].m_localPoint,w=d.position.x+g.col1.x*f.x+g.col2.x*
- f.y,f=d.position.y+g.col1.y*f.x+g.col2.y*f.y,this.m_points[t].x=w+0.5*(c-(w-s)*h-(f-k)*y-e)*h,this.m_points[t].y=f+0.5*(c-(w-s)*h-(f-k)*y-e)*y;break;case u.e_faceB:g=d.R;f=a.m_localPlaneNormal;h=g.col1.x*f.x+g.col2.x*f.y;y=g.col1.y*f.x+g.col2.y*f.y;g=d.R;f=a.m_localPoint;s=d.position.x+g.col1.x*f.x+g.col2.x*f.y;k=d.position.y+g.col1.y*f.x+g.col2.y*f.y;this.m_normal.x=-h;this.m_normal.y=-y;for(t=0;t<a.m_pointCount;t++)g=b.R,f=a.m_points[t].m_localPoint,w=b.position.x+g.col1.x*f.x+g.col2.x*f.y,f=b.position.y+
- g.col1.y*f.x+g.col2.y*f.y,this.m_points[t].x=w+0.5*(e-(w-s)*h-(f-k)*y-c)*h,this.m_points[t].y=f+0.5*(e-(w-s)*h-(f-k)*y-c)*y}}};t.ClipVertex=function(){this.v=new h;this.id=new p};t.prototype.Set=function(a){this.v.SetV(a.v);this.id.Set(a.id)};y.Features=function(){};Object.defineProperty(y.prototype,"referenceEdge",{enumerable:!1,configurable:!0,get:function(){return this._referenceEdge}});Object.defineProperty(y.prototype,"referenceEdge",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&
- (a=0);this._referenceEdge=a;this._m_id._key=this._m_id._key&4294967040|this._referenceEdge&255}});Object.defineProperty(y.prototype,"incidentEdge",{enumerable:!1,configurable:!0,get:function(){return this._incidentEdge}});Object.defineProperty(y.prototype,"incidentEdge",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._incidentEdge=a;this._m_id._key=this._m_id._key&4294902015|this._incidentEdge<<8&65280}});Object.defineProperty(y.prototype,"incidentVertex",{enumerable:!1,configurable:!0,
- get:function(){return this._incidentVertex}});Object.defineProperty(y.prototype,"incidentVertex",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._incidentVertex=a;this._m_id._key=this._m_id._key&4278255615|this._incidentVertex<<16&16711680}});Object.defineProperty(y.prototype,"flip",{enumerable:!1,configurable:!0,get:function(){return this._flip}});Object.defineProperty(y.prototype,"flip",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._flip=a;this._m_id._key=
- this._m_id._key&16777215|this._flip<<24&4278190080}})})();
- (function(){var c=Box2D.Common.b2Settings,e=Box2D.Collision.Shapes.b2CircleShape,d=Box2D.Collision.Shapes.b2EdgeChainDef,a=Box2D.Collision.Shapes.b2EdgeShape,b=Box2D.Collision.Shapes.b2MassData,f=Box2D.Collision.Shapes.b2PolygonShape,m=Box2D.Collision.Shapes.b2Shape,h=Box2D.Common.Math.b2Mat22,g=Box2D.Common.Math.b2Math,k=Box2D.Common.Math.b2Transform,l=Box2D.Common.Math.b2Vec2,n=Box2D.Collision.b2Distance,p=Box2D.Collision.b2DistanceInput,q=Box2D.Collision.b2DistanceOutput,v=Box2D.Collision.b2DistanceProxy,
- F=Box2D.Collision.b2SimplexCache;Box2D.inherit(e,Box2D.Collision.Shapes.b2Shape);e.prototype.__super=Box2D.Collision.Shapes.b2Shape.prototype;e.b2CircleShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments);this.m_p=new l};e.prototype.Copy=function(){var a=new e;a.Set(this);return a};e.prototype.Set=function(a){this.__super.Set.call(this,a);Box2D.is(a,e)&&this.m_p.SetV((a instanceof e?a:null).m_p)};e.prototype.TestPoint=function(a,b){var c=a.R,d=a.position.x+(c.col1.x*this.m_p.x+
- c.col2.x*this.m_p.y),c=a.position.y+(c.col1.y*this.m_p.x+c.col2.y*this.m_p.y),d=b.x-d,c=b.y-c;return d*d+c*c<=this.m_radius*this.m_radius};e.prototype.RayCast=function(a,b,c){var d=c.R,e=b.p1.x-(c.position.x+(d.col1.x*this.m_p.x+d.col2.x*this.m_p.y));c=b.p1.y-(c.position.y+(d.col1.y*this.m_p.x+d.col2.y*this.m_p.y));var d=b.p2.x-b.p1.x,f=b.p2.y-b.p1.y,g=e*d+c*f,h=d*d+f*f,k=g*g-h*(e*e+c*c-this.m_radius*this.m_radius);if(0>k||h<Number.MIN_VALUE)return!1;g=-(g+Math.sqrt(k));return 0<=g&&g<=b.maxFraction*
- h?(g/=h,a.fraction=g,a.normal.x=e+g*d,a.normal.y=c+g*f,a.normal.Normalize(),!0):!1};e.prototype.ComputeAABB=function(a,b){var c=b.R,d=b.position.x+(c.col1.x*this.m_p.x+c.col2.x*this.m_p.y),c=b.position.y+(c.col1.y*this.m_p.x+c.col2.y*this.m_p.y);a.lowerBound.Set(d-this.m_radius,c-this.m_radius);a.upperBound.Set(d+this.m_radius,c+this.m_radius)};e.prototype.ComputeMass=function(a,b){void 0===b&&(b=0);a.mass=b*c.b2_pi*this.m_radius*this.m_radius;a.center.SetV(this.m_p);a.I=a.mass*(0.5*this.m_radius*
- this.m_radius+(this.m_p.x*this.m_p.x+this.m_p.y*this.m_p.y))};e.prototype.ComputeSubmergedArea=function(a,b,c,d){void 0===b&&(b=0);c=g.MulX(c,this.m_p);var e=-(g.Dot(a,c)-b);if(e<-this.m_radius+Number.MIN_VALUE)return 0;if(e>this.m_radius)return d.SetV(c),Math.PI*this.m_radius*this.m_radius;b=this.m_radius*this.m_radius;var f=e*e,e=b*(Math.asin(e/this.m_radius)+Math.PI/2)+e*Math.sqrt(b-f);b=-2/3*Math.pow(b-f,1.5)/e;d.x=c.x+a.x*b;d.y=c.y+a.y*b;return e};e.prototype.GetLocalPosition=function(){return this.m_p};
- e.prototype.SetLocalPosition=function(a){this.m_p.SetV(a)};e.prototype.GetRadius=function(){return this.m_radius};e.prototype.SetRadius=function(a){void 0===a&&(a=0);this.m_radius=a};e.prototype.b2CircleShape=function(a){void 0===a&&(a=0);this.__super.b2Shape.call(this);this.m_type=m.e_circleShape;this.m_radius=a};d.b2EdgeChainDef=function(){};d.prototype.b2EdgeChainDef=function(){this.vertexCount=0;this.isALoop=!0;this.vertices=[]};Box2D.inherit(a,Box2D.Collision.Shapes.b2Shape);a.prototype.__super=
- Box2D.Collision.Shapes.b2Shape.prototype;a.b2EdgeShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments);this.s_supportVec=new l;this.m_v1=new l;this.m_v2=new l;this.m_coreV1=new l;this.m_coreV2=new l;this.m_normal=new l;this.m_direction=new l;this.m_cornerDir1=new l;this.m_cornerDir2=new l};a.prototype.TestPoint=function(a,b){return!1};a.prototype.RayCast=function(a,b,c){var d,e=b.p2.x-b.p1.x,f=b.p2.y-b.p1.y;d=c.R;var g=c.position.x+(d.col1.x*this.m_v1.x+d.col2.x*this.m_v1.y),
- h=c.position.y+(d.col1.y*this.m_v1.x+d.col2.y*this.m_v1.y),k=c.position.y+(d.col1.y*this.m_v2.x+d.col2.y*this.m_v2.y)-h;c=-(c.position.x+(d.col1.x*this.m_v2.x+d.col2.x*this.m_v2.y)-g);d=100*Number.MIN_VALUE;var m=-(e*k+f*c);if(m>d){var g=b.p1.x-g,l=b.p1.y-h,h=g*k+l*c;if(0<=h&&h<=b.maxFraction*m&&(b=-e*l+f*g,-d*m<=b&&b<=m*(1+d)))return a.fraction=h/m,b=Math.sqrt(k*k+c*c),a.normal.x=k/b,a.normal.y=c/b,!0}return!1};a.prototype.ComputeAABB=function(a,b){var c=b.R,d=b.position.x+(c.col1.x*this.m_v1.x+
- c.col2.x*this.m_v1.y),e=b.position.y+(c.col1.y*this.m_v1.x+c.col2.y*this.m_v1.y),f=b.position.x+(c.col1.x*this.m_v2.x+c.col2.x*this.m_v2.y),c=b.position.y+(c.col1.y*this.m_v2.x+c.col2.y*this.m_v2.y);d<f?(a.lowerBound.x=d,a.upperBound.x=f):(a.lowerBound.x=f,a.upperBound.x=d);e<c?(a.lowerBound.y=e,a.upperBound.y=c):(a.lowerBound.y=c,a.upperBound.y=e)};a.prototype.ComputeMass=function(a,b){a.mass=0;a.center.SetV(this.m_v1);a.I=0};a.prototype.ComputeSubmergedArea=function(a,b,c,d){void 0===b&&(b=0);var e=
- new l(a.x*b,a.y*b),f=g.MulX(c,this.m_v1);c=g.MulX(c,this.m_v2);var h=g.Dot(a,f)-b;a=g.Dot(a,c)-b;if(0<h){if(0<a)return 0;f.x=-a/(h-a)*f.x+h/(h-a)*c.x;f.y=-a/(h-a)*f.y+h/(h-a)*c.y}else 0<a&&(c.x=-a/(h-a)*f.x+h/(h-a)*c.x,c.y=-a/(h-a)*f.y+h/(h-a)*c.y);d.x=(e.x+f.x+c.x)/3;d.y=(e.y+f.y+c.y)/3;return 0.5*((f.x-e.x)*(c.y-e.y)-(f.y-e.y)*(c.x-e.x))};a.prototype.GetLength=function(){return this.m_length};a.prototype.GetVertex1=function(){return this.m_v1};a.prototype.GetVertex2=function(){return this.m_v2};
- a.prototype.GetCoreVertex1=function(){return this.m_coreV1};a.prototype.GetCoreVertex2=function(){return this.m_coreV2};a.prototype.GetNormalVector=function(){return this.m_normal};a.prototype.GetDirectionVector=function(){return this.m_direction};a.prototype.GetCorner1Vector=function(){return this.m_cornerDir1};a.prototype.GetCorner2Vector=function(){return this.m_cornerDir2};a.prototype.Corner1IsConvex=function(){return this.m_cornerConvex1};a.prototype.Corner2IsConvex=function(){return this.m_cornerConvex2};
- a.prototype.GetFirstVertex=function(a){var b=a.R;return new l(a.position.x+(b.col1.x*this.m_coreV1.x+b.col2.x*this.m_coreV1.y),a.position.y+(b.col1.y*this.m_coreV1.x+b.col2.y*this.m_coreV1.y))};a.prototype.GetNextEdge=function(){return this.m_nextEdge};a.prototype.GetPrevEdge=function(){return this.m_prevEdge};a.prototype.Support=function(a,b,c){void 0===b&&(b=0);void 0===c&&(c=0);var d=a.R,e=a.position.x+(d.col1.x*this.m_coreV1.x+d.col2.x*this.m_coreV1.y),f=a.position.y+(d.col1.y*this.m_coreV1.x+
- d.col2.y*this.m_coreV1.y),g=a.position.x+(d.col1.x*this.m_coreV2.x+d.col2.x*this.m_coreV2.y);a=a.position.y+(d.col1.y*this.m_coreV2.x+d.col2.y*this.m_coreV2.y);e*b+f*c>g*b+a*c?(this.s_supportVec.x=e,this.s_supportVec.y=f):(this.s_supportVec.x=g,this.s_supportVec.y=a);return this.s_supportVec};a.prototype.b2EdgeShape=function(a,b){this.__super.b2Shape.call(this);this.m_type=m.e_edgeShape;this.m_nextEdge=this.m_prevEdge=null;this.m_v1=a;this.m_v2=b;this.m_direction.Set(this.m_v2.x-this.m_v1.x,this.m_v2.y-
- this.m_v1.y);this.m_length=this.m_direction.Normalize();this.m_normal.Set(this.m_direction.y,-this.m_direction.x);this.m_coreV1.Set(-c.b2_toiSlop*(this.m_normal.x-this.m_direction.x)+this.m_v1.x,-c.b2_toiSlop*(this.m_normal.y-this.m_direction.y)+this.m_v1.y);this.m_coreV2.Set(-c.b2_toiSlop*(this.m_normal.x+this.m_direction.x)+this.m_v2.x,-c.b2_toiSlop*(this.m_normal.y+this.m_direction.y)+this.m_v2.y);this.m_cornerDir1=this.m_normal;this.m_cornerDir2.Set(-this.m_normal.x,-this.m_normal.y)};a.prototype.SetPrevEdge=
- function(a,b,c,d){this.m_prevEdge=a;this.m_coreV1=b;this.m_cornerDir1=c;this.m_cornerConvex1=d};a.prototype.SetNextEdge=function(a,b,c,d){this.m_nextEdge=a;this.m_coreV2=b;this.m_cornerDir2=c;this.m_cornerConvex2=d};b.b2MassData=function(){this.mass=0;this.center=new l(0,0);this.I=0};Box2D.inherit(f,Box2D.Collision.Shapes.b2Shape);f.prototype.__super=Box2D.Collision.Shapes.b2Shape.prototype;f.b2PolygonShape=function(){Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this,arguments)};f.prototype.Copy=
- function(){var a=new f;a.Set(this);return a};f.prototype.Set=function(a){this.__super.Set.call(this,a);if(Box2D.is(a,f)){a=a instanceof f?a:null;this.m_centroid.SetV(a.m_centroid);this.m_vertexCount=a.m_vertexCount;this.Reserve(this.m_vertexCount);for(var b=0;b<this.m_vertexCount;b++)this.m_vertices[b].SetV(a.m_vertices[b]),this.m_normals[b].SetV(a.m_normals[b])}};f.prototype.SetAsArray=function(a,b){void 0===b&&(b=0);for(var c=new Vector,d=0,e,d=0;d<a.length;++d)e=a[d],c.push(e);this.SetAsVector(c,
- b)};f.AsArray=function(a,b){void 0===b&&(b=0);var c=new f;c.SetAsArray(a,b);return c};f.prototype.SetAsVector=function(a,b){void 0===b&&(b=0);0==b&&(b=a.length);c.b2Assert(2<=b);this.m_vertexCount=b;this.Reserve(b);for(var d=0,d=0;d<this.m_vertexCount;d++)this.m_vertices[d].SetV(a[d]);for(d=0;d<this.m_vertexCount;++d){var e=parseInt(d),h=parseInt(d+1<this.m_vertexCount?d+1:0),e=g.SubtractVV(this.m_vertices[h],this.m_vertices[e]);c.b2Assert(e.LengthSquared()>Number.MIN_VALUE);this.m_normals[d].SetV(g.CrossVF(e,
- 1));this.m_normals[d].Normalize()}this.m_centroid=f.ComputeCentroid(this.m_vertices,this.m_vertexCount)};f.AsVector=function(a,b){void 0===b&&(b=0);var c=new f;c.SetAsVector(a,b);return c};f.prototype.SetAsBox=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.m_vertexCount=4;this.Reserve(4);this.m_vertices[0].Set(-a,-b);this.m_vertices[1].Set(a,-b);this.m_vertices[2].Set(a,b);this.m_vertices[3].Set(-a,b);this.m_normals[0].Set(0,-1);this.m_normals[1].Set(1,0);this.m_normals[2].Set(0,1);this.m_normals[3].Set(-1,
- 0);this.m_centroid.SetZero()};f.AsBox=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);var c=new f;c.SetAsBox(a,b);return c};f.prototype.SetAsOrientedBox=function(a,b,c,d){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=null);void 0===d&&(d=0);this.m_vertexCount=4;this.Reserve(4);this.m_vertices[0].Set(-a,-b);this.m_vertices[1].Set(a,-b);this.m_vertices[2].Set(a,b);this.m_vertices[3].Set(-a,b);this.m_normals[0].Set(0,-1);this.m_normals[1].Set(1,0);this.m_normals[2].Set(0,1);this.m_normals[3].Set(-1,
- 0);this.m_centroid=c;a=new k;a.position=c;a.R.Set(d);for(c=0;c<this.m_vertexCount;++c)this.m_vertices[c]=g.MulX(a,this.m_vertices[c]),this.m_normals[c]=g.MulMV(a.R,this.m_normals[c])};f.AsOrientedBox=function(a,b,c,d){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=null);void 0===d&&(d=0);var e=new f;e.SetAsOrientedBox(a,b,c,d);return e};f.prototype.SetAsEdge=function(a,b){this.m_vertexCount=2;this.Reserve(2);this.m_vertices[0].SetV(a);this.m_vertices[1].SetV(b);this.m_centroid.x=0.5*(a.x+b.x);
- this.m_centroid.y=0.5*(a.y+b.y);this.m_normals[0]=g.CrossVF(g.SubtractVV(b,a),1);this.m_normals[0].Normalize();this.m_normals[1].x=-this.m_normals[0].x;this.m_normals[1].y=-this.m_normals[0].y};f.AsEdge=function(a,b){var c=new f;c.SetAsEdge(a,b);return c};f.prototype.TestPoint=function(a,b){var c;c=a.R;for(var d=b.x-a.position.x,e=b.y-a.position.y,f=d*c.col1.x+e*c.col1.y,g=d*c.col2.x+e*c.col2.y,h=0;h<this.m_vertexCount;++h)if(c=this.m_vertices[h],d=f-c.x,e=g-c.y,c=this.m_normals[h],0<c.x*d+c.y*e)return!1;
- return!0};f.prototype.RayCast=function(a,b,c){var d=0,e=b.maxFraction,f=0,g=0,h,k,f=b.p1.x-c.position.x,g=b.p1.y-c.position.y;h=c.R;var m=f*h.col1.x+g*h.col1.y,l=f*h.col2.x+g*h.col2.y,f=b.p2.x-c.position.x,g=b.p2.y-c.position.y;h=c.R;b=f*h.col1.x+g*h.col1.y-m;h=f*h.col2.x+g*h.col2.y-l;for(var n=-1,s=0;s<this.m_vertexCount;++s){k=this.m_vertices[s];f=k.x-m;g=k.y-l;k=this.m_normals[s];f=k.x*f+k.y*g;g=k.x*b+k.y*h;if(0==g){if(0>f)return!1}else 0>g&&f<d*g?(d=f/g,n=s):0<g&&f<e*g&&(e=f/g);if(e<d-Number.MIN_VALUE)return!1}return 0<=
- n?(a.fraction=d,h=c.R,k=this.m_normals[n],a.normal.x=h.col1.x*k.x+h.col2.x*k.y,a.normal.y=h.col1.y*k.x+h.col2.y*k.y,!0):!1};f.prototype.ComputeAABB=function(a,b){for(var c=b.R,d=this.m_vertices[0],e=b.position.x+(c.col1.x*d.x+c.col2.x*d.y),f=b.position.y+(c.col1.y*d.x+c.col2.y*d.y),g=e,h=f,k=1;k<this.m_vertexCount;++k)var d=this.m_vertices[k],m=b.position.x+(c.col1.x*d.x+c.col2.x*d.y),d=b.position.y+(c.col1.y*d.x+c.col2.y*d.y),e=e<m?e:m,f=f<d?f:d,g=g>m?g:m,h=h>d?h:d;a.lowerBound.x=e-this.m_radius;
- a.lowerBound.y=f-this.m_radius;a.upperBound.x=g+this.m_radius;a.upperBound.y=h+this.m_radius};f.prototype.ComputeMass=function(a,b){void 0===b&&(b=0);if(2==this.m_vertexCount)a.center.x=0.5*(this.m_vertices[0].x+this.m_vertices[1].x),a.center.y=0.5*(this.m_vertices[0].y+this.m_vertices[1].y),a.mass=0,a.I=0;else{for(var c=0,d=0,e=0,f=0,g=1/3,h=0;h<this.m_vertexCount;++h)var k=this.m_vertices[h],m=h+1<this.m_vertexCount?this.m_vertices[parseInt(h+1)]:this.m_vertices[0],l=k.x-0,n=k.y-0,s=m.x-0,w=m.y-
- 0,G=l*w-n*s,M=0.5*G,e=e+M,c=c+M*g*(0+k.x+m.x),d=d+M*g*(0+k.y+m.y),k=l,f=f+G*(g*(0.25*(k*k+s*k+s*s)+(0*k+0*s))+0+(g*(0.25*(n*n+w*n+w*w)+(0*n+0*w))+0));a.mass=b*e;a.center.Set(c*(1/e),d*(1/e));a.I=b*f}};f.prototype.ComputeSubmergedArea=function(a,c,d,e){void 0===c&&(c=0);var f=g.MulTMV(d.R,a),h=c-g.Dot(a,d.position),k=new Vector_a2j_Number,m=0,n=-1;c=-1;var p=!1;for(a=a=0;a<this.m_vertexCount;++a){k[a]=g.Dot(f,this.m_vertices[a])-h;var q=k[a]<-Number.MIN_VALUE;0<a&&(q?p||(n=a-1,m++):p&&(c=a-1,m++));
- p=q}switch(m){case 0:return p?(a=new b,this.ComputeMass(a,1),e.SetV(g.MulX(d,a.center)),a.mass):0;case 1:-1==n?n=this.m_vertexCount-1:c=this.m_vertexCount-1}a=parseInt((n+1)%this.m_vertexCount);f=parseInt((c+1)%this.m_vertexCount);h=(0-k[n])/(k[a]-k[n]);k=(0-k[c])/(k[f]-k[c]);n=new l(this.m_vertices[n].x*(1-h)+this.m_vertices[a].x*h,this.m_vertices[n].y*(1-h)+this.m_vertices[a].y*h);c=new l(this.m_vertices[c].x*(1-k)+this.m_vertices[f].x*k,this.m_vertices[c].y*(1-k)+this.m_vertices[f].y*k);k=0;h=
- new l;for(m=this.m_vertices[a];a!=f;)a=(a+1)%this.m_vertexCount,p=a==f?c:this.m_vertices[a],q=0.5*((m.x-n.x)*(p.y-n.y)-(m.y-n.y)*(p.x-n.x)),k+=q,h.x+=q*(n.x+m.x+p.x)/3,h.y+=q*(n.y+m.y+p.y)/3,m=p;h.Multiply(1/k);e.SetV(g.MulX(d,h));return k};f.prototype.GetVertexCount=function(){return this.m_vertexCount};f.prototype.GetVertices=function(){return this.m_vertices};f.prototype.GetNormals=function(){return this.m_normals};f.prototype.GetSupport=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*
- a.y,d=1;d<this.m_vertexCount;++d){var e=this.m_vertices[d].x*a.x+this.m_vertices[d].y*a.y;e>c&&(b=d,c=e)}return b};f.prototype.GetSupportVertex=function(a){for(var b=0,c=this.m_vertices[0].x*a.x+this.m_vertices[0].y*a.y,d=1;d<this.m_vertexCount;++d){var e=this.m_vertices[d].x*a.x+this.m_vertices[d].y*a.y;e>c&&(b=d,c=e)}return this.m_vertices[b]};f.prototype.Validate=function(){return!1};f.prototype.b2PolygonShape=function(){this.__super.b2Shape.call(this);this.m_type=m.e_polygonShape;this.m_centroid=
- new l;this.m_vertices=new Vector;this.m_normals=new Vector};f.prototype.Reserve=function(a){void 0===a&&(a=0);for(var b=parseInt(this.m_vertices.length);b<a;b++)this.m_vertices[b]=new l,this.m_normals[b]=new l};f.ComputeCentroid=function(a,b){void 0===b&&(b=0);for(var c=new l,d=0,e=1/3,f=0;f<b;++f){var g=a[f],h=f+1<b?a[parseInt(f+1)]:a[0],k=0.5*((g.x-0)*(h.y-0)-(g.y-0)*(h.x-0)),d=d+k;c.x+=k*e*(0+g.x+h.x);c.y+=k*e*(0+g.y+h.y)}c.x*=1/d;c.y*=1/d;return c};f.ComputeOBB=function(a,b,c){void 0===c&&(c=
- 0);for(var d=0,e=new Vector(c+1),d=0;d<c;++d)e[d]=b[d];e[c]=e[0];b=Number.MAX_VALUE;for(d=1;d<=c;++d){for(var f=e[parseInt(d-1)],g=e[d].x-f.x,h=e[d].y-f.y,k=Math.sqrt(g*g+h*h),g=g/k,h=h/k,m=-h,l=g,n=k=Number.MAX_VALUE,s=-Number.MAX_VALUE,w=-Number.MAX_VALUE,G=0;G<c;++G){var M=e[G].x-f.x,L=e[G].y-f.y,p=g*M+h*L,M=m*M+l*L;p<k&&(k=p);M<n&&(n=M);p>s&&(s=p);M>w&&(w=M)}G=(s-k)*(w-n);G<0.95*b&&(b=G,a.R.col1.x=g,a.R.col1.y=h,a.R.col2.x=m,a.R.col2.y=l,g=0.5*(k+s),h=0.5*(n+w),m=a.R,a.center.x=f.x+(m.col1.x*
- g+m.col2.x*h),a.center.y=f.y+(m.col1.y*g+m.col2.y*h),a.extents.x=0.5*(s-k),a.extents.y=0.5*(w-n))}};Box2D.postDefs.push(function(){Box2D.Collision.Shapes.b2PolygonShape.s_mat=new h});m.b2Shape=function(){};m.prototype.Copy=function(){return null};m.prototype.Set=function(a){this.m_radius=a.m_radius};m.prototype.GetType=function(){return this.m_type};m.prototype.TestPoint=function(a,b){return!1};m.prototype.RayCast=function(a,b,c){return!1};m.prototype.ComputeAABB=function(a,b){};m.prototype.ComputeMass=
- function(a,b){};m.prototype.ComputeSubmergedArea=function(a,b,c,d){return 0};m.TestOverlap=function(a,b,c,d){var e=new p;e.proxyA=new v;e.proxyA.Set(a);e.proxyB=new v;e.proxyB.Set(c);e.transformA=b;e.transformB=d;e.useRadii=!0;a=new F;a.count=0;b=new q;n.Distance(b,a,e);return b.distance<10*Number.MIN_VALUE};m.prototype.b2Shape=function(){this.m_type=m.e_unknownShape;this.m_radius=c.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Collision.Shapes.b2Shape.e_unknownShape=-1;Box2D.Collision.Shapes.b2Shape.e_circleShape=
- 0;Box2D.Collision.Shapes.b2Shape.e_polygonShape=1;Box2D.Collision.Shapes.b2Shape.e_edgeShape=2;Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount=3;Box2D.Collision.Shapes.b2Shape.e_hitCollide=1;Box2D.Collision.Shapes.b2Shape.e_missCollide=0;Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide=-1})})();
- (function(){var c=Box2D.Common.b2Color,e=Box2D.Common.b2Settings,d=Box2D.Common.Math.b2Math;c.b2Color=function(){this._b=this._g=this._r=0};c.prototype.b2Color=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this._r=Box2D.parseUInt(255*d.Clamp(a,0,1));this._g=Box2D.parseUInt(255*d.Clamp(b,0,1));this._b=Box2D.parseUInt(255*d.Clamp(c,0,1))};c.prototype.Set=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this._r=Box2D.parseUInt(255*d.Clamp(a,0,1));this._g=
- Box2D.parseUInt(255*d.Clamp(b,0,1));this._b=Box2D.parseUInt(255*d.Clamp(c,0,1))};Object.defineProperty(c.prototype,"r",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._r=Box2D.parseUInt(255*d.Clamp(a,0,1))}});Object.defineProperty(c.prototype,"g",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._g=Box2D.parseUInt(255*d.Clamp(a,0,1))}});Object.defineProperty(c.prototype,"b",{enumerable:!1,configurable:!0,set:function(a){void 0===a&&(a=0);this._b=Box2D.parseUInt(255*
- d.Clamp(a,0,1))}});Object.defineProperty(c.prototype,"color",{enumerable:!1,configurable:!0,get:function(){return this._r<<16|this._g<<8|this._b}});e.b2Settings=function(){};e.b2MixFriction=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return Math.sqrt(a*b)};e.b2MixRestitution=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return a>b?a:b};e.b2Assert=function(a){if(!a)throw"Assertion Failed";};Box2D.postDefs.push(function(){Box2D.Common.b2Settings.VERSION="2.1alpha";Box2D.Common.b2Settings.USHRT_MAX=
- 65535;Box2D.Common.b2Settings.b2_pi=Math.PI;Box2D.Common.b2Settings.b2_maxManifoldPoints=2;Box2D.Common.b2Settings.b2_aabbExtension=0.1;Box2D.Common.b2Settings.b2_aabbMultiplier=2;Box2D.Common.b2Settings.b2_polygonRadius=2*e.b2_linearSlop;Box2D.Common.b2Settings.b2_linearSlop=0.005;Box2D.Common.b2Settings.b2_angularSlop=2/180*e.b2_pi;Box2D.Common.b2Settings.b2_toiSlop=8*e.b2_linearSlop;Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland=32;Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland=32;Box2D.Common.b2Settings.b2_velocityThreshold=
- 1;Box2D.Common.b2Settings.b2_maxLinearCorrection=0.2;Box2D.Common.b2Settings.b2_maxAngularCorrection=8/180*e.b2_pi;Box2D.Common.b2Settings.b2_maxTranslation=2;Box2D.Common.b2Settings.b2_maxTranslationSquared=e.b2_maxTranslation*e.b2_maxTranslation;Box2D.Common.b2Settings.b2_maxRotation=0.5*e.b2_pi;Box2D.Common.b2Settings.b2_maxRotationSquared=e.b2_maxRotation*e.b2_maxRotation;Box2D.Common.b2Settings.b2_contactBaumgarte=0.2;Box2D.Common.b2Settings.b2_timeToSleep=0.5;Box2D.Common.b2Settings.b2_linearSleepTolerance=
- 0.01;Box2D.Common.b2Settings.b2_angularSleepTolerance=2/180*e.b2_pi})})();
- (function(){var c=Box2D.Common.Math.b2Mat22,e=Box2D.Common.Math.b2Mat33,d=Box2D.Common.Math.b2Math,a=Box2D.Common.Math.b2Sweep,b=Box2D.Common.Math.b2Transform,f=Box2D.Common.Math.b2Vec2,m=Box2D.Common.Math.b2Vec3;c.b2Mat22=function(){this.col1=new f;this.col2=new f};c.prototype.b2Mat22=function(){this.SetIdentity()};c.FromAngle=function(a){void 0===a&&(a=0);var b=new c;b.Set(a);return b};c.FromVV=function(a,b){var d=new c;d.SetVV(a,b);return d};c.prototype.Set=function(a){void 0===a&&(a=0);var b=
- Math.cos(a);a=Math.sin(a);this.col1.x=b;this.col2.x=-a;this.col1.y=a;this.col2.y=b};c.prototype.SetVV=function(a,b){this.col1.SetV(a);this.col2.SetV(b)};c.prototype.Copy=function(){var a=new c;a.SetM(this);return a};c.prototype.SetM=function(a){this.col1.SetV(a.col1);this.col2.SetV(a.col2)};c.prototype.AddM=function(a){this.col1.x+=a.col1.x;this.col1.y+=a.col1.y;this.col2.x+=a.col2.x;this.col2.y+=a.col2.y};c.prototype.SetIdentity=function(){this.col1.x=1;this.col2.x=0;this.col1.y=0;this.col2.y=1};
- c.prototype.SetZero=function(){this.col1.x=0;this.col2.x=0;this.col1.y=0;this.col2.y=0};c.prototype.GetAngle=function(){return Math.atan2(this.col1.y,this.col1.x)};c.prototype.GetInverse=function(a){var b=this.col1.x,c=this.col2.x,d=this.col1.y,e=this.col2.y,f=b*e-c*d;0!=f&&(f=1/f);a.col1.x=f*e;a.col2.x=-f*c;a.col1.y=-f*d;a.col2.y=f*b;return a};c.prototype.Solve=function(a,b,c){void 0===b&&(b=0);void 0===c&&(c=0);var d=this.col1.x,e=this.col2.x,f=this.col1.y,m=this.col2.y,v=d*m-e*f;0!=v&&(v=1/v);
- a.x=v*(m*b-e*c);a.y=v*(d*c-f*b);return a};c.prototype.Abs=function(){this.col1.Abs();this.col2.Abs()};e.b2Mat33=function(){this.col1=new m;this.col2=new m;this.col3=new m};e.prototype.b2Mat33=function(a,b,c){void 0===a&&(a=null);void 0===b&&(b=null);void 0===c&&(c=null);!a&&!b&&!c?(this.col1.SetZero(),this.col2.SetZero(),this.col3.SetZero()):(this.col1.SetV(a),this.col2.SetV(b),this.col3.SetV(c))};e.prototype.SetVVV=function(a,b,c){this.col1.SetV(a);this.col2.SetV(b);this.col3.SetV(c)};e.prototype.Copy=
- function(){return new e(this.col1,this.col2,this.col3)};e.prototype.SetM=function(a){this.col1.SetV(a.col1);this.col2.SetV(a.col2);this.col3.SetV(a.col3)};e.prototype.AddM=function(a){this.col1.x+=a.col1.x;this.col1.y+=a.col1.y;this.col1.z+=a.col1.z;this.col2.x+=a.col2.x;this.col2.y+=a.col2.y;this.col2.z+=a.col2.z;this.col3.x+=a.col3.x;this.col3.y+=a.col3.y;this.col3.z+=a.col3.z};e.prototype.SetIdentity=function(){this.col1.x=1;this.col2.x=0;this.col3.x=0;this.col1.y=0;this.col2.y=1;this.col3.y=0;
- this.col1.z=0;this.col2.z=0;this.col3.z=1};e.prototype.SetZero=function(){this.col1.x=0;this.col2.x=0;this.col3.x=0;this.col1.y=0;this.col2.y=0;this.col3.y=0;this.col1.z=0;this.col2.z=0;this.col3.z=0};e.prototype.Solve22=function(a,b,c){void 0===b&&(b=0);void 0===c&&(c=0);var d=this.col1.x,e=this.col2.x,f=this.col1.y,m=this.col2.y,v=d*m-e*f;0!=v&&(v=1/v);a.x=v*(m*b-e*c);a.y=v*(d*c-f*b);return a};e.prototype.Solve33=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=0);void 0===d&&(d=0);var e=this.col1.x,
- f=this.col1.y,m=this.col1.z,v=this.col2.x,F=this.col2.y,r=this.col2.z,D=this.col3.x,x=this.col3.y,C=this.col3.z,A=e*(F*C-r*x)+f*(r*D-v*C)+m*(v*x-F*D);0!=A&&(A=1/A);a.x=A*(b*(F*C-r*x)+c*(r*D-v*C)+d*(v*x-F*D));a.y=A*(e*(c*C-d*x)+f*(d*D-b*C)+m*(b*x-c*D));a.z=A*(e*(F*d-r*c)+f*(r*b-v*d)+m*(v*c-F*b));return a};d.b2Math=function(){};d.IsValid=function(a){void 0===a&&(a=0);return isFinite(a)};d.Dot=function(a,b){return a.x*b.x+a.y*b.y};d.CrossVV=function(a,b){return a.x*b.y-a.y*b.x};d.CrossVF=function(a,
- b){void 0===b&&(b=0);return new f(b*a.y,-b*a.x)};d.CrossFV=function(a,b){void 0===a&&(a=0);return new f(-a*b.y,a*b.x)};d.MulMV=function(a,b){return new f(a.col1.x*b.x+a.col2.x*b.y,a.col1.y*b.x+a.col2.y*b.y)};d.MulTMV=function(a,b){return new f(d.Dot(b,a.col1),d.Dot(b,a.col2))};d.MulX=function(a,b){var c=d.MulMV(a.R,b);c.x+=a.position.x;c.y+=a.position.y;return c};d.MulXT=function(a,b){var c=d.SubtractVV(b,a.position),e=c.x*a.R.col1.x+c.y*a.R.col1.y;c.y=c.x*a.R.col2.x+c.y*a.R.col2.y;c.x=e;return c};
- d.AddVV=function(a,b){return new f(a.x+b.x,a.y+b.y)};d.SubtractVV=function(a,b){return new f(a.x-b.x,a.y-b.y)};d.Distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};d.DistanceSquared=function(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d};d.MulFV=function(a,b){void 0===a&&(a=0);return new f(a*b.x,a*b.y)};d.AddMM=function(a,b){return c.FromVV(d.AddVV(a.col1,b.col1),d.AddVV(a.col2,b.col2))};d.MulMM=function(a,b){return c.FromVV(d.MulMV(a,b.col1),d.MulMV(a,b.col2))};d.MulTMM=function(a,
- b){var e=new f(d.Dot(a.col1,b.col1),d.Dot(a.col2,b.col1)),m=new f(d.Dot(a.col1,b.col2),d.Dot(a.col2,b.col2));return c.FromVV(e,m)};d.Abs=function(a){void 0===a&&(a=0);return 0<a?a:-a};d.AbsV=function(a){return new f(d.Abs(a.x),d.Abs(a.y))};d.AbsM=function(a){return c.FromVV(d.AbsV(a.col1),d.AbsV(a.col2))};d.Min=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return a<b?a:b};d.MinV=function(a,b){return new f(d.Min(a.x,b.x),d.Min(a.y,b.y))};d.Max=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);
- return a>b?a:b};d.MaxV=function(a,b){return new f(d.Max(a.x,b.x),d.Max(a.y,b.y))};d.Clamp=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);return a<b?b:a>c?c:a};d.ClampV=function(a,b,c){return d.MaxV(b,d.MinV(a,c))};d.Swap=function(a,b){var c=a[0];a[0]=b[0];b[0]=c};d.Random=function(){return 2*Math.random()-1};d.RandomRange=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);var c=Math.random();return(b-a)*c+a};d.NextPowerOfTwo=function(a){void 0===a&&(a=0);a|=a>>1&2147483647;a|=
- a>>2&1073741823;a|=a>>4&268435455;a|=a>>8&16777215;return(a|a>>16&65535)+1};d.IsPowerOfTwo=function(a){void 0===a&&(a=0);return 0<a&&0==(a&a-1)};Box2D.postDefs.push(function(){Box2D.Common.Math.b2Math.b2Vec2_zero=new f(0,0);Box2D.Common.Math.b2Math.b2Mat22_identity=c.FromVV(new f(1,0),new f(0,1));Box2D.Common.Math.b2Math.b2Transform_identity=new b(d.b2Vec2_zero,d.b2Mat22_identity)});a.b2Sweep=function(){this.localCenter=new f;this.c0=new f;this.c=new f};a.prototype.Set=function(a){this.localCenter.SetV(a.localCenter);
- this.c0.SetV(a.c0);this.c.SetV(a.c);this.a0=a.a0;this.a=a.a;this.t0=a.t0};a.prototype.Copy=function(){var b=new a;b.localCenter.SetV(this.localCenter);b.c0.SetV(this.c0);b.c.SetV(this.c);b.a0=this.a0;b.a=this.a;b.t0=this.t0;return b};a.prototype.GetTransform=function(a,b){void 0===b&&(b=0);a.position.x=(1-b)*this.c0.x+b*this.c.x;a.position.y=(1-b)*this.c0.y+b*this.c.y;a.R.Set((1-b)*this.a0+b*this.a);var c=a.R;a.position.x-=c.col1.x*this.localCenter.x+c.col2.x*this.localCenter.y;a.position.y-=c.col1.y*
- this.localCenter.x+c.col2.y*this.localCenter.y};a.prototype.Advance=function(a){void 0===a&&(a=0);if(this.t0<a&&1-this.t0>Number.MIN_VALUE){var b=(a-this.t0)/(1-this.t0);this.c0.x=(1-b)*this.c0.x+b*this.c.x;this.c0.y=(1-b)*this.c0.y+b*this.c.y;this.a0=(1-b)*this.a0+b*this.a;this.t0=a}};b.b2Transform=function(){this.position=new f;this.R=new c};b.prototype.b2Transform=function(a,b){void 0===a&&(a=null);void 0===b&&(b=null);a&&(this.position.SetV(a),this.R.SetM(b))};b.prototype.Initialize=function(a,
- b){this.position.SetV(a);this.R.SetM(b)};b.prototype.SetIdentity=function(){this.position.SetZero();this.R.SetIdentity()};b.prototype.Set=function(a){this.position.SetV(a.position);this.R.SetM(a.R)};b.prototype.GetAngle=function(){return Math.atan2(this.R.col1.y,this.R.col1.x)};f.b2Vec2=function(){};f.prototype.b2Vec2=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.x=a;this.y=b};f.prototype.SetZero=function(){this.y=this.x=0};f.prototype.Set=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);
- this.x=a;this.y=b};f.prototype.SetV=function(a){this.x=a.x;this.y=a.y};f.prototype.GetNegative=function(){return new f(-this.x,-this.y)};f.prototype.NegativeSelf=function(){this.x=-this.x;this.y=-this.y};f.Make=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);return new f(a,b)};f.prototype.Copy=function(){return new f(this.x,this.y)};f.prototype.Add=function(a){this.x+=a.x;this.y+=a.y};f.prototype.Subtract=function(a){this.x-=a.x;this.y-=a.y};f.prototype.Multiply=function(a){void 0===a&&(a=0);this.x*=
- a;this.y*=a};f.prototype.MulM=function(a){var b=this.x;this.x=a.col1.x*b+a.col2.x*this.y;this.y=a.col1.y*b+a.col2.y*this.y};f.prototype.MulTM=function(a){var b=d.Dot(this,a.col1);this.y=d.Dot(this,a.col2);this.x=b};f.prototype.CrossVF=function(a){void 0===a&&(a=0);var b=this.x;this.x=a*this.y;this.y=-a*b};f.prototype.CrossFV=function(a){void 0===a&&(a=0);var b=this.x;this.x=-a*this.y;this.y=a*b};f.prototype.MinV=function(a){this.x=this.x<a.x?this.x:a.x;this.y=this.y<a.y?this.y:a.y};f.prototype.MaxV=
- function(a){this.x=this.x>a.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y};f.prototype.Abs=function(){0>this.x&&(this.x=-this.x);0>this.y&&(this.y=-this.y)};f.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};f.prototype.LengthSquared=function(){return this.x*this.x+this.y*this.y};f.prototype.Normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y);if(a<Number.MIN_VALUE)return 0;var b=1/a;this.x*=b;this.y*=b;return a};f.prototype.IsValid=function(){return d.IsValid(this.x)&&
- d.IsValid(this.y)};m.b2Vec3=function(){};m.prototype.b2Vec3=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this.x=a;this.y=b;this.z=c};m.prototype.SetZero=function(){this.x=this.y=this.z=0};m.prototype.Set=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this.x=a;this.y=b;this.z=c};m.prototype.SetV=function(a){this.x=a.x;this.y=a.y;this.z=a.z};m.prototype.GetNegative=function(){return new m(-this.x,-this.y,-this.z)};m.prototype.NegativeSelf=function(){this.x=
- -this.x;this.y=-this.y;this.z=-this.z};m.prototype.Copy=function(){return new m(this.x,this.y,this.z)};m.prototype.Add=function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z};m.prototype.Subtract=function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z};m.prototype.Multiply=function(a){void 0===a&&(a=0);this.x*=a;this.y*=a;this.z*=a}})();
- (function(){var c=Box2D.Common.Math.b2Math,e=Box2D.Common.Math.b2Sweep,d=Box2D.Common.Math.b2Transform,a=Box2D.Common.Math.b2Vec2,b=Box2D.Common.b2Color,f=Box2D.Common.b2Settings,m=Box2D.Collision.b2AABB,h=Box2D.Collision.b2ContactPoint,g=Box2D.Collision.b2DynamicTreeBroadPhase,k=Box2D.Collision.b2RayCastInput,l=Box2D.Collision.b2RayCastOutput,n=Box2D.Collision.Shapes.b2CircleShape,p=Box2D.Collision.Shapes.b2EdgeShape,q=Box2D.Collision.Shapes.b2MassData,v=Box2D.Collision.Shapes.b2PolygonShape,F=Box2D.Collision.Shapes.b2Shape,
- r=Box2D.Dynamics.b2Body,D=Box2D.Dynamics.b2BodyDef,x=Box2D.Dynamics.b2ContactFilter,C=Box2D.Dynamics.b2ContactImpulse,A=Box2D.Dynamics.b2ContactListener,z=Box2D.Dynamics.b2ContactManager,u=Box2D.Dynamics.b2DebugDraw,J=Box2D.Dynamics.b2DestructionListener,B=Box2D.Dynamics.b2FilterData,K=Box2D.Dynamics.b2Fixture,I=Box2D.Dynamics.b2FixtureDef,E=Box2D.Dynamics.b2Island,s=Box2D.Dynamics.b2TimeStep,w=Box2D.Dynamics.b2World,G=Box2D.Dynamics.Contacts.b2Contact,M=Box2D.Dynamics.Contacts.b2ContactFactory,L=
- Box2D.Dynamics.Contacts.b2ContactSolver,R=Box2D.Dynamics.Joints.b2Joint,P=Box2D.Dynamics.Joints.b2PulleyJoint;r.b2Body=function(){this.m_xf=new d;this.m_sweep=new e;this.m_linearVelocity=new a;this.m_force=new a};r.prototype.connectEdges=function(a,b,d){void 0===d&&(d=0);var e=Math.atan2(b.GetDirectionVector().y,b.GetDirectionVector().x);d=Math.tan(0.5*(e-d));d=c.MulFV(d,b.GetDirectionVector());d=c.SubtractVV(d,b.GetNormalVector());d=c.MulFV(f.b2_toiSlop,d);d=c.AddVV(d,b.GetVertex1());var g=c.AddVV(a.GetDirectionVector(),
- b.GetDirectionVector());g.Normalize();var s=0<c.Dot(a.GetDirectionVector(),b.GetNormalVector());a.SetNextEdge(b,d,g,s);b.SetPrevEdge(a,d,g,s);return e};r.prototype.CreateFixture=function(a){if(!0==this.m_world.IsLocked())return null;var b=new K;b.Create(this,this.m_xf,a);this.m_flags&r.e_activeFlag&&b.CreateProxy(this.m_world.m_contactManager.m_broadPhase,this.m_xf);b.m_next=this.m_fixtureList;this.m_fixtureList=b;++this.m_fixtureCount;b.m_body=this;0<b.m_density&&this.ResetMassData();this.m_world.m_flags|=
- w.e_newFixture;return b};r.prototype.CreateFixture2=function(a,b){void 0===b&&(b=0);var c=new I;c.shape=a;c.density=b;return this.CreateFixture(c)};r.prototype.DestroyFixture=function(a){if(!0!=this.m_world.IsLocked()){for(var b=this.m_fixtureList,c=null;null!=b;){if(b==a){c?c.m_next=a.m_next:this.m_fixtureList=a.m_next;break}c=b;b=b.m_next}for(b=this.m_contactList;b;){var c=b.contact,b=b.next,d=c.GetFixtureA(),e=c.GetFixtureB();(a==d||a==e)&&this.m_world.m_contactManager.Destroy(c)}this.m_flags&
- r.e_activeFlag&&a.DestroyProxy(this.m_world.m_contactManager.m_broadPhase);a.Destroy();a.m_body=null;a.m_next=null;--this.m_fixtureCount;this.ResetMassData()}};r.prototype.SetPositionAndAngle=function(a,b){void 0===b&&(b=0);var c;if(!0!=this.m_world.IsLocked()){this.m_xf.R.Set(b);this.m_xf.position.SetV(a);c=this.m_xf.R;var d=this.m_sweep.localCenter;this.m_sweep.c.x=c.col1.x*d.x+c.col2.x*d.y;this.m_sweep.c.y=c.col1.y*d.x+c.col2.y*d.y;this.m_sweep.c.x+=this.m_xf.position.x;this.m_sweep.c.y+=this.m_xf.position.y;
- this.m_sweep.c0.SetV(this.m_sweep.c);this.m_sweep.a0=this.m_sweep.a=b;d=this.m_world.m_contactManager.m_broadPhase;for(c=this.m_fixtureList;c;c=c.m_next)c.Synchronize(d,this.m_xf,this.m_xf);this.m_world.m_contactManager.FindNewContacts()}};r.prototype.SetTransform=function(a){this.SetPositionAndAngle(a.position,a.GetAngle())};r.prototype.GetTransform=function(){return this.m_xf};r.prototype.GetPosition=function(){return this.m_xf.position};r.prototype.SetPosition=function(a){this.SetPositionAndAngle(a,
- this.GetAngle())};r.prototype.GetAngle=function(){return this.m_sweep.a};r.prototype.SetAngle=function(a){void 0===a&&(a=0);this.SetPositionAndAngle(this.GetPosition(),a)};r.prototype.GetWorldCenter=function(){return this.m_sweep.c};r.prototype.GetLocalCenter=function(){return this.m_sweep.localCenter};r.prototype.SetLinearVelocity=function(a){this.m_type!=r.b2_staticBody&&this.m_linearVelocity.SetV(a)};r.prototype.GetLinearVelocity=function(){return this.m_linearVelocity};r.prototype.SetAngularVelocity=
- function(a){void 0===a&&(a=0);this.m_type!=r.b2_staticBody&&(this.m_angularVelocity=a)};r.prototype.GetAngularVelocity=function(){return this.m_angularVelocity};r.prototype.GetDefinition=function(){var a=new D;a.type=this.GetType();a.allowSleep=(this.m_flags&r.e_allowSleepFlag)==r.e_allowSleepFlag;a.angle=this.GetAngle();a.angularDamping=this.m_angularDamping;a.angularVelocity=this.m_angularVelocity;a.fixedRotation=(this.m_flags&r.e_fixedRotationFlag)==r.e_fixedRotationFlag;a.bullet=(this.m_flags&
- r.e_bulletFlag)==r.e_bulletFlag;a.awake=(this.m_flags&r.e_awakeFlag)==r.e_awakeFlag;a.linearDamping=this.m_linearDamping;a.linearVelocity.SetV(this.GetLinearVelocity());a.position=this.GetPosition();a.userData=this.GetUserData();return a};r.prototype.ApplyForce=function(a,b){this.m_type==r.b2_dynamicBody&&(!1==this.IsAwake()&&this.SetAwake(!0),this.m_force.x+=a.x,this.m_force.y+=a.y,this.m_torque+=(b.x-this.m_sweep.c.x)*a.y-(b.y-this.m_sweep.c.y)*a.x)};r.prototype.ApplyTorque=function(a){void 0===
- a&&(a=0);this.m_type==r.b2_dynamicBody&&(!1==this.IsAwake()&&this.SetAwake(!0),this.m_torque+=a)};r.prototype.ApplyImpulse=function(a,b){this.m_type==r.b2_dynamicBody&&(!1==this.IsAwake()&&this.SetAwake(!0),this.m_linearVelocity.x+=this.m_invMass*a.x,this.m_linearVelocity.y+=this.m_invMass*a.y,this.m_angularVelocity+=this.m_invI*((b.x-this.m_sweep.c.x)*a.y-(b.y-this.m_sweep.c.y)*a.x))};r.prototype.Split=function(a){for(var b=this.GetLinearVelocity().Copy(),d=this.GetAngularVelocity(),e=this.GetWorldCenter(),
- f=this.m_world.CreateBody(this.GetDefinition()),g,s=this.m_fixtureList;s;)if(a(s)){var h=s.m_next;g?g.m_next=h:this.m_fixtureList=h;this.m_fixtureCount--;s.m_next=f.m_fixtureList;f.m_fixtureList=s;f.m_fixtureCount++;s.m_body=f;s=h}else g=s,s=s.m_next;this.ResetMassData();f.ResetMassData();g=this.GetWorldCenter();a=f.GetWorldCenter();g=c.AddVV(b,c.CrossFV(d,c.SubtractVV(g,e)));b=c.AddVV(b,c.CrossFV(d,c.SubtractVV(a,e)));this.SetLinearVelocity(g);f.SetLinearVelocity(b);this.SetAngularVelocity(d);f.SetAngularVelocity(d);
- this.SynchronizeFixtures();f.SynchronizeFixtures();return f};r.prototype.Merge=function(a){var b;for(b=a.m_fixtureList;b;){var c=b.m_next;a.m_fixtureCount--;b.m_next=this.m_fixtureList;this.m_fixtureList=b;this.m_fixtureCount++;b.m_body=e;b=c}d.m_fixtureCount=0;var d=this,e=a;d.GetWorldCenter();e.GetWorldCenter();d.GetLinearVelocity().Copy();e.GetLinearVelocity().Copy();d.GetAngularVelocity();e.GetAngularVelocity();d.ResetMassData();this.SynchronizeFixtures()};r.prototype.GetMass=function(){return this.m_mass};
- r.prototype.GetInertia=function(){return this.m_I};r.prototype.GetMassData=function(a){a.mass=this.m_mass;a.I=this.m_I;a.center.SetV(this.m_sweep.localCenter)};r.prototype.SetMassData=function(a){f.b2Assert(!1==this.m_world.IsLocked());if(!0!=this.m_world.IsLocked()&&this.m_type==r.b2_dynamicBody){this.m_invI=this.m_I=this.m_invMass=0;this.m_mass=a.mass;0>=this.m_mass&&(this.m_mass=1);this.m_invMass=1/this.m_mass;0<a.I&&0==(this.m_flags&r.e_fixedRotationFlag)&&(this.m_I=a.I-this.m_mass*(a.center.x*
- a.center.x+a.center.y*a.center.y),this.m_invI=1/this.m_I);var b=this.m_sweep.c.Copy();this.m_sweep.localCenter.SetV(a.center);this.m_sweep.c0.SetV(c.MulX(this.m_xf,this.m_sweep.localCenter));this.m_sweep.c.SetV(this.m_sweep.c0);this.m_linearVelocity.x+=this.m_angularVelocity*-(this.m_sweep.c.y-b.y);this.m_linearVelocity.y+=this.m_angularVelocity*+(this.m_sweep.c.x-b.x)}};r.prototype.ResetMassData=function(){this.m_invI=this.m_I=this.m_invMass=this.m_mass=0;this.m_sweep.localCenter.SetZero();if(!(this.m_type==
- r.b2_staticBody||this.m_type==r.b2_kinematicBody)){for(var b=a.Make(0,0),d=this.m_fixtureList;d;d=d.m_next)if(0!=d.m_density){var e=d.GetMassData();this.m_mass+=e.mass;b.x+=e.center.x*e.mass;b.y+=e.center.y*e.mass;this.m_I+=e.I}0<this.m_mass?(this.m_invMass=1/this.m_mass,b.x*=this.m_invMass,b.y*=this.m_invMass):this.m_invMass=this.m_mass=1;0<this.m_I&&0==(this.m_flags&r.e_fixedRotationFlag)?(this.m_I-=this.m_mass*(b.x*b.x+b.y*b.y),this.m_I*=this.m_inertiaScale,f.b2Assert(0<this.m_I),this.m_invI=1/
- this.m_I):this.m_invI=this.m_I=0;d=this.m_sweep.c.Copy();this.m_sweep.localCenter.SetV(b);this.m_sweep.c0.SetV(c.MulX(this.m_xf,this.m_sweep.localCenter));this.m_sweep.c.SetV(this.m_sweep.c0);this.m_linearVelocity.x+=this.m_angularVelocity*-(this.m_sweep.c.y-d.y);this.m_linearVelocity.y+=this.m_angularVelocity*+(this.m_sweep.c.x-d.x)}};r.prototype.GetWorldPoint=function(b){var c=this.m_xf.R;b=new a(c.col1.x*b.x+c.col2.x*b.y,c.col1.y*b.x+c.col2.y*b.y);b.x+=this.m_xf.position.x;b.y+=this.m_xf.position.y;
- return b};r.prototype.GetWorldVector=function(a){return c.MulMV(this.m_xf.R,a)};r.prototype.GetLocalPoint=function(a){return c.MulXT(this.m_xf,a)};r.prototype.GetLocalVector=function(a){return c.MulTMV(this.m_xf.R,a)};r.prototype.GetLinearVelocityFromWorldPoint=function(b){return new a(this.m_linearVelocity.x-this.m_angularVelocity*(b.y-this.m_sweep.c.y),this.m_linearVelocity.y+this.m_angularVelocity*(b.x-this.m_sweep.c.x))};r.prototype.GetLinearVelocityFromLocalPoint=function(b){var c=this.m_xf.R;
- b=new a(c.col1.x*b.x+c.col2.x*b.y,c.col1.y*b.x+c.col2.y*b.y);b.x+=this.m_xf.position.x;b.y+=this.m_xf.position.y;return new a(this.m_linearVelocity.x-this.m_angularVelocity*(b.y-this.m_sweep.c.y),this.m_linearVelocity.y+this.m_angularVelocity*(b.x-this.m_sweep.c.x))};r.prototype.GetLinearDamping=function(){return this.m_linearDamping};r.prototype.SetLinearDamping=function(a){void 0===a&&(a=0);this.m_linearDamping=a};r.prototype.GetAngularDamping=function(){return this.m_angularDamping};r.prototype.SetAngularDamping=
- function(a){void 0===a&&(a=0);this.m_angularDamping=a};r.prototype.SetType=function(a){void 0===a&&(a=0);if(this.m_type!=a){this.m_type=a;this.ResetMassData();this.m_type==r.b2_staticBody&&(this.m_linearVelocity.SetZero(),this.m_angularVelocity=0);this.SetAwake(!0);this.m_force.SetZero();this.m_torque=0;for(a=this.m_contactList;a;a=a.next)a.contact.FlagForFiltering()}};r.prototype.GetType=function(){return this.m_type};r.prototype.SetBullet=function(a){this.m_flags=a?this.m_flags|r.e_bulletFlag:this.m_flags&
- ~r.e_bulletFlag};r.prototype.IsBullet=function(){return(this.m_flags&r.e_bulletFlag)==r.e_bulletFlag};r.prototype.SetSleepingAllowed=function(a){a?this.m_flags|=r.e_allowSleepFlag:(this.m_flags&=~r.e_allowSleepFlag,this.SetAwake(!0))};r.prototype.SetAwake=function(a){a?(this.m_flags|=r.e_awakeFlag,this.m_sleepTime=0):(this.m_flags&=~r.e_awakeFlag,this.m_sleepTime=0,this.m_linearVelocity.SetZero(),this.m_angularVelocity=0,this.m_force.SetZero(),this.m_torque=0)};r.prototype.IsAwake=function(){return(this.m_flags&
- r.e_awakeFlag)==r.e_awakeFlag};r.prototype.SetFixedRotation=function(a){this.m_flags=a?this.m_flags|r.e_fixedRotationFlag:this.m_flags&~r.e_fixedRotationFlag;this.ResetMassData()};r.prototype.IsFixedRotation=function(){return(this.m_flags&r.e_fixedRotationFlag)==r.e_fixedRotationFlag};r.prototype.SetActive=function(a){if(a!=this.IsActive()){var b;if(a){this.m_flags|=r.e_activeFlag;a=this.m_world.m_contactManager.m_broadPhase;for(b=this.m_fixtureList;b;b=b.m_next)b.CreateProxy(a,this.m_xf)}else{this.m_flags&=
- ~r.e_activeFlag;a=this.m_world.m_contactManager.m_broadPhase;for(b=this.m_fixtureList;b;b=b.m_next)b.DestroyProxy(a);for(a=this.m_contactList;a;)b=a,a=a.next,this.m_world.m_contactManager.Destroy(b.contact);this.m_contactList=null}}};r.prototype.IsActive=function(){return(this.m_flags&r.e_activeFlag)==r.e_activeFlag};r.prototype.IsSleepingAllowed=function(){return(this.m_flags&r.e_allowSleepFlag)==r.e_allowSleepFlag};r.prototype.GetFixtureList=function(){return this.m_fixtureList};r.prototype.GetJointList=
- function(){return this.m_jointList};r.prototype.GetControllerList=function(){return this.m_controllerList};r.prototype.GetContactList=function(){return this.m_contactList};r.prototype.GetNext=function(){return this.m_next};r.prototype.GetUserData=function(){return this.m_userData};r.prototype.SetUserData=function(a){this.m_userData=a};r.prototype.GetWorld=function(){return this.m_world};r.prototype.b2Body=function(a,b){this.m_flags=0;a.bullet&&(this.m_flags|=r.e_bulletFlag);a.fixedRotation&&(this.m_flags|=
- r.e_fixedRotationFlag);a.allowSleep&&(this.m_flags|=r.e_allowSleepFlag);a.awake&&(this.m_flags|=r.e_awakeFlag);a.active&&(this.m_flags|=r.e_activeFlag);this.m_world=b;this.m_xf.position.SetV(a.position);this.m_xf.R.Set(a.angle);this.m_sweep.localCenter.SetZero();this.m_sweep.t0=1;this.m_sweep.a0=this.m_sweep.a=a.angle;var c=this.m_xf.R,d=this.m_sweep.localCenter;this.m_sweep.c.x=c.col1.x*d.x+c.col2.x*d.y;this.m_sweep.c.y=c.col1.y*d.x+c.col2.y*d.y;this.m_sweep.c.x+=this.m_xf.position.x;this.m_sweep.c.y+=
- this.m_xf.position.y;this.m_sweep.c0.SetV(this.m_sweep.c);this.m_contactList=this.m_controllerList=this.m_jointList=null;this.m_controllerCount=0;this.m_next=this.m_prev=null;this.m_linearVelocity.SetV(a.linearVelocity);this.m_angularVelocity=a.angularVelocity;this.m_linearDamping=a.linearDamping;this.m_angularDamping=a.angularDamping;this.m_force.Set(0,0);this.m_sleepTime=this.m_torque=0;this.m_type=a.type;this.m_invMass=this.m_type==r.b2_dynamicBody?this.m_mass=1:this.m_mass=0;this.m_invI=this.m_I=
- 0;this.m_inertiaScale=a.inertiaScale;this.m_userData=a.userData;this.m_fixtureList=null;this.m_fixtureCount=0};r.prototype.SynchronizeFixtures=function(){var a=r.s_xf1;a.R.Set(this.m_sweep.a0);var b=a.R,c=this.m_sweep.localCenter;a.position.x=this.m_sweep.c0.x-(b.col1.x*c.x+b.col2.x*c.y);a.position.y=this.m_sweep.c0.y-(b.col1.y*c.x+b.col2.y*c.y);c=this.m_world.m_contactManager.m_broadPhase;for(b=this.m_fixtureList;b;b=b.m_next)b.Synchronize(c,a,this.m_xf)};r.prototype.SynchronizeTransform=function(){this.m_xf.R.Set(this.m_sweep.a);
- var a=this.m_xf.R,b=this.m_sweep.localCenter;this.m_xf.position.x=this.m_sweep.c.x-(a.col1.x*b.x+a.col2.x*b.y);this.m_xf.position.y=this.m_sweep.c.y-(a.col1.y*b.x+a.col2.y*b.y)};r.prototype.ShouldCollide=function(a){if(this.m_type!=r.b2_dynamicBody&&a.m_type!=r.b2_dynamicBody)return!1;for(var b=this.m_jointList;b;b=b.next)if(b.other==a&&!1==b.joint.m_collideConnected)return!1;return!0};r.prototype.Advance=function(a){void 0===a&&(a=0);this.m_sweep.Advance(a);this.m_sweep.c.SetV(this.m_sweep.c0);this.m_sweep.a=
- this.m_sweep.a0;this.SynchronizeTransform()};Box2D.postDefs.push(function(){Box2D.Dynamics.b2Body.s_xf1=new d;Box2D.Dynamics.b2Body.e_islandFlag=1;Box2D.Dynamics.b2Body.e_awakeFlag=2;Box2D.Dynamics.b2Body.e_allowSleepFlag=4;Box2D.Dynamics.b2Body.e_bulletFlag=8;Box2D.Dynamics.b2Body.e_fixedRotationFlag=16;Box2D.Dynamics.b2Body.e_activeFlag=32;Box2D.Dynamics.b2Body.b2_staticBody=0;Box2D.Dynamics.b2Body.b2_kinematicBody=1;Box2D.Dynamics.b2Body.b2_dynamicBody=2});D.b2BodyDef=function(){this.position=
- new a;this.linearVelocity=new a};D.prototype.b2BodyDef=function(){this.userData=null;this.position.Set(0,0);this.angle=0;this.linearVelocity.Set(0,0);this.angularDamping=this.linearDamping=this.angularVelocity=0;this.awake=this.allowSleep=!0;this.bullet=this.fixedRotation=!1;this.type=r.b2_staticBody;this.active=!0;this.inertiaScale=1};x.b2ContactFilter=function(){};x.prototype.ShouldCollide=function(a,b){var c=a.GetFilterData(),d=b.GetFilterData();return c.groupIndex==d.groupIndex&&0!=c.groupIndex?
- 0<c.groupIndex:0!=(c.maskBits&d.categoryBits)&&0!=(c.categoryBits&d.maskBits)};x.prototype.RayCollide=function(a,b){return!a?!0:this.ShouldCollide(a instanceof K?a:null,b)};Box2D.postDefs.push(function(){Box2D.Dynamics.b2ContactFilter.b2_defaultFilter=new x});C.b2ContactImpulse=function(){this.normalImpulses=new Vector_a2j_Number(f.b2_maxManifoldPoints);this.tangentImpulses=new Vector_a2j_Number(f.b2_maxManifoldPoints)};A.b2ContactListener=function(){};A.prototype.BeginContact=function(a){};A.prototype.EndContact=
- function(a){};A.prototype.PreSolve=function(a,b){};A.prototype.PostSolve=function(a,b){};Box2D.postDefs.push(function(){Box2D.Dynamics.b2ContactListener.b2_defaultListener=new A});z.b2ContactManager=function(){};z.prototype.b2ContactManager=function(){this.m_world=null;this.m_contactCount=0;this.m_contactFilter=x.b2_defaultFilter;this.m_contactListener=A.b2_defaultListener;this.m_contactFactory=new M(this.m_allocator);this.m_broadPhase=new g};z.prototype.AddPair=function(a,b){var c=a instanceof K?
- a:null,d=b instanceof K?b:null,e=c.GetBody(),f=d.GetBody();if(e!=f){for(var g=f.GetContactList();g;){if(g.other==e){var s=g.contact.GetFixtureA(),h=g.contact.GetFixtureB();if(s==c&&h==d||s==d&&h==c)return}g=g.next}!1!=f.ShouldCollide(e)&&!1!=this.m_contactFilter.ShouldCollide(c,d)&&(g=this.m_contactFactory.Create(c,d),c=g.GetFixtureA(),d=g.GetFixtureB(),e=c.m_body,f=d.m_body,g.m_prev=null,g.m_next=this.m_world.m_contactList,null!=this.m_world.m_contactList&&(this.m_world.m_contactList.m_prev=g),this.m_world.m_contactList=
- g,g.m_nodeA.contact=g,g.m_nodeA.other=f,g.m_nodeA.prev=null,g.m_nodeA.next=e.m_contactList,null!=e.m_contactList&&(e.m_contactList.prev=g.m_nodeA),e.m_contactList=g.m_nodeA,g.m_nodeB.contact=g,g.m_nodeB.other=e,g.m_nodeB.prev=null,g.m_nodeB.next=f.m_contactList,null!=f.m_contactList&&(f.m_contactList.prev=g.m_nodeB),f.m_contactList=g.m_nodeB,++this.m_world.m_contactCount)}};z.prototype.FindNewContacts=function(){this.m_broadPhase.UpdatePairs(Box2D.generateCallback(this,this.AddPair))};z.prototype.Destroy=
- function(a){var b=a.GetFixtureA(),c=a.GetFixtureB(),b=b.GetBody(),c=c.GetBody();a.IsTouching()&&this.m_contactListener.EndContact(a);a.m_prev&&(a.m_prev.m_next=a.m_next);a.m_next&&(a.m_next.m_prev=a.m_prev);a==this.m_world.m_contactList&&(this.m_world.m_contactList=a.m_next);a.m_nodeA.prev&&(a.m_nodeA.prev.next=a.m_nodeA.next);a.m_nodeA.next&&(a.m_nodeA.next.prev=a.m_nodeA.prev);a.m_nodeA==b.m_contactList&&(b.m_contactList=a.m_nodeA.next);a.m_nodeB.prev&&(a.m_nodeB.prev.next=a.m_nodeB.next);a.m_nodeB.next&&
- (a.m_nodeB.next.prev=a.m_nodeB.prev);a.m_nodeB==c.m_contactList&&(c.m_contactList=a.m_nodeB.next);this.m_contactFactory.Destroy(a);--this.m_contactCount};z.prototype.Collide=function(){for(var a=this.m_world.m_contactList;a;){var b=a.GetFixtureA(),c=a.GetFixtureB(),d=b.GetBody(),e=c.GetBody();if(!1==d.IsAwake()&&!1==e.IsAwake())a=a.GetNext();else{if(a.m_flags&G.e_filterFlag){if(!1==e.ShouldCollide(d)){b=a;a=b.GetNext();this.Destroy(b);continue}if(!1==this.m_contactFilter.ShouldCollide(b,c)){b=a;a=
- b.GetNext();this.Destroy(b);continue}a.m_flags&=~G.e_filterFlag}!1==this.m_broadPhase.TestOverlap(b.m_proxy,c.m_proxy)?(b=a,a=b.GetNext(),this.Destroy(b)):(a.Update(this.m_contactListener),a=a.GetNext())}}};Box2D.postDefs.push(function(){Box2D.Dynamics.b2ContactManager.s_evalCP=new h});u.b2DebugDraw=function(){};u.prototype.b2DebugDraw=function(){};u.prototype.SetFlags=function(a){};u.prototype.GetFlags=function(){};u.prototype.AppendFlags=function(a){};u.prototype.ClearFlags=function(a){};u.prototype.SetSprite=
- function(a){};u.prototype.GetSprite=function(){};u.prototype.SetDrawScale=function(a){};u.prototype.GetDrawScale=function(){};u.prototype.SetLineThickness=function(a){};u.prototype.GetLineThickness=function(){};u.prototype.SetAlpha=function(a){};u.prototype.GetAlpha=function(){};u.prototype.SetFillAlpha=function(a){};u.prototype.GetFillAlpha=function(){};u.prototype.SetXFormScale=function(a){};u.prototype.GetXFormScale=function(){};u.prototype.DrawPolygon=function(a,b,c){};u.prototype.DrawSolidPolygon=
- function(a,b,c){};u.prototype.DrawCircle=function(a,b,c){};u.prototype.DrawSolidCircle=function(a,b,c,d){};u.prototype.DrawSegment=function(a,b,c){};u.prototype.DrawTransform=function(a){};Box2D.postDefs.push(function(){Box2D.Dynamics.b2DebugDraw.e_shapeBit=1;Box2D.Dynamics.b2DebugDraw.e_jointBit=2;Box2D.Dynamics.b2DebugDraw.e_aabbBit=4;Box2D.Dynamics.b2DebugDraw.e_pairBit=8;Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit=16;Box2D.Dynamics.b2DebugDraw.e_controllerBit=32});J.b2DestructionListener=function(){};
- J.prototype.SayGoodbyeJoint=function(a){};J.prototype.SayGoodbyeFixture=function(a){};B.b2FilterData=function(){this.categoryBits=1;this.maskBits=65535;this.groupIndex=0};B.prototype.Copy=function(){var a=new B;a.categoryBits=this.categoryBits;a.maskBits=this.maskBits;a.groupIndex=this.groupIndex;return a};K.b2Fixture=function(){this.m_filter=new B};K.prototype.GetType=function(){return this.m_shape.GetType()};K.prototype.GetShape=function(){return this.m_shape};K.prototype.SetSensor=function(a){if(this.m_isSensor!=
- a&&(this.m_isSensor=a,null!=this.m_body))for(a=this.m_body.GetContactList();a;){var b=a.contact,c=b.GetFixtureA(),d=b.GetFixtureB();if(c==this||d==this)b.SetSensor(c.IsSensor()||d.IsSensor());a=a.next}};K.prototype.IsSensor=function(){return this.m_isSensor};K.prototype.SetFilterData=function(a){this.m_filter=a.Copy();if(!this.m_body)for(a=this.m_body.GetContactList();a;){var b=a.contact,c=b.GetFixtureA(),d=b.GetFixtureB();(c==this||d==this)&&b.FlagForFiltering();a=a.next}};K.prototype.GetFilterData=
- function(){return this.m_filter.Copy()};K.prototype.GetBody=function(){return this.m_body};K.prototype.GetNext=function(){return this.m_next};K.prototype.GetUserData=function(){return this.m_userData};K.prototype.SetUserData=function(a){this.m_userData=a};K.prototype.TestPoint=function(a){return this.m_shape.TestPoint(this.m_body.GetTransform(),a)};K.prototype.RayCast=function(a,b){return this.m_shape.RayCast(a,b,this.m_body.GetTransform())};K.prototype.GetMassData=function(a){void 0===a&&(a=null);
- null==a&&(a=new q);this.m_shape.ComputeMass(a,this.m_density);return a};K.prototype.SetDensity=function(a){void 0===a&&(a=0);this.m_density=a};K.prototype.GetDensity=function(){return this.m_density};K.prototype.GetFriction=function(){return this.m_friction};K.prototype.SetFriction=function(a){void 0===a&&(a=0);this.m_friction=a};K.prototype.GetRestitution=function(){return this.m_restitution};K.prototype.SetRestitution=function(a){void 0===a&&(a=0);this.m_restitution=a};K.prototype.GetAABB=function(){return this.m_aabb};
- K.prototype.b2Fixture=function(){this.m_aabb=new m;this.m_shape=this.m_next=this.m_body=this.m_userData=null;this.m_restitution=this.m_friction=this.m_density=0};K.prototype.Create=function(a,b,c){this.m_userData=c.userData;this.m_friction=c.friction;this.m_restitution=c.restitution;this.m_body=a;this.m_next=null;this.m_filter=c.filter.Copy();this.m_isSensor=c.isSensor;this.m_shape=c.shape.Copy();this.m_density=c.density};K.prototype.Destroy=function(){this.m_shape=null};K.prototype.CreateProxy=function(a,
- b){this.m_shape.ComputeAABB(this.m_aabb,b);this.m_proxy=a.CreateProxy(this.m_aabb,this)};K.prototype.DestroyProxy=function(a){null!=this.m_proxy&&(a.DestroyProxy(this.m_proxy),this.m_proxy=null)};K.prototype.Synchronize=function(a,b,d){if(this.m_proxy){var e=new m,f=new m;this.m_shape.ComputeAABB(e,b);this.m_shape.ComputeAABB(f,d);this.m_aabb.Combine(e,f);b=c.SubtractVV(d.position,b.position);a.MoveProxy(this.m_proxy,this.m_aabb,b)}};I.b2FixtureDef=function(){this.filter=new B};I.prototype.b2FixtureDef=
- function(){this.userData=this.shape=null;this.friction=0.2;this.density=this.restitution=0;this.filter.categoryBits=1;this.filter.maskBits=65535;this.filter.groupIndex=0;this.isSensor=!1};E.b2Island=function(){};E.prototype.b2Island=function(){this.m_bodies=new Vector;this.m_contacts=new Vector;this.m_joints=new Vector};E.prototype.Initialize=function(a,b,c,d,e,f){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);var g=0;this.m_bodyCapacity=a;this.m_contactCapacity=b;this.m_jointCapacity=c;this.m_jointCount=
- this.m_contactCount=this.m_bodyCount=0;this.m_allocator=d;this.m_listener=e;this.m_contactSolver=f;for(g=this.m_bodies.length;g<a;g++)this.m_bodies[g]=null;for(g=this.m_contacts.length;g<b;g++)this.m_contacts[g]=null;for(g=this.m_joints.length;g<c;g++)this.m_joints[g]=null};E.prototype.Clear=function(){this.m_jointCount=this.m_contactCount=this.m_bodyCount=0};E.prototype.Solve=function(a,b,d){for(var e=0,g=0,s,e=0;e<this.m_bodyCount;++e)g=this.m_bodies[e],g.GetType()==r.b2_dynamicBody&&(g.m_linearVelocity.x+=
- a.dt*(b.x+g.m_invMass*g.m_force.x),g.m_linearVelocity.y+=a.dt*(b.y+g.m_invMass*g.m_force.y),g.m_angularVelocity+=a.dt*g.m_invI*g.m_torque,g.m_linearVelocity.Multiply(c.Clamp(1-a.dt*g.m_linearDamping,0,1)),g.m_angularVelocity*=c.Clamp(1-a.dt*g.m_angularDamping,0,1));this.m_contactSolver.Initialize(a,this.m_contacts,this.m_contactCount,this.m_allocator);b=this.m_contactSolver;b.InitVelocityConstraints(a);for(e=0;e<this.m_jointCount;++e)s=this.m_joints[e],s.InitVelocityConstraints(a);for(e=0;e<a.velocityIterations;++e){for(g=
- 0;g<this.m_jointCount;++g)s=this.m_joints[g],s.SolveVelocityConstraints(a);b.SolveVelocityConstraints()}for(e=0;e<this.m_jointCount;++e)s=this.m_joints[e],s.FinalizeVelocityConstraints();b.FinalizeVelocityConstraints();for(e=0;e<this.m_bodyCount;++e)if(g=this.m_bodies[e],g.GetType()!=r.b2_staticBody){var h=a.dt*g.m_linearVelocity.x,k=a.dt*g.m_linearVelocity.y;h*h+k*k>f.b2_maxTranslationSquared&&(g.m_linearVelocity.Normalize(),g.m_linearVelocity.x*=f.b2_maxTranslation*a.inv_dt,g.m_linearVelocity.y*=
- f.b2_maxTranslation*a.inv_dt);h=a.dt*g.m_angularVelocity;h*h>f.b2_maxRotationSquared&&(g.m_angularVelocity=0>g.m_angularVelocity?-f.b2_maxRotation*a.inv_dt:f.b2_maxRotation*a.inv_dt);g.m_sweep.c0.SetV(g.m_sweep.c);g.m_sweep.a0=g.m_sweep.a;g.m_sweep.c.x+=a.dt*g.m_linearVelocity.x;g.m_sweep.c.y+=a.dt*g.m_linearVelocity.y;g.m_sweep.a+=a.dt*g.m_angularVelocity;g.SynchronizeTransform()}for(e=0;e<a.positionIterations;++e){h=b.SolvePositionConstraints(f.b2_contactBaumgarte);k=!0;for(g=0;g<this.m_jointCount;++g)s=
- this.m_joints[g],s=s.SolvePositionConstraints(f.b2_contactBaumgarte),k=k&&s;if(h&&k)break}this.Report(b.m_constraints);if(d){d=Number.MAX_VALUE;b=f.b2_linearSleepTolerance*f.b2_linearSleepTolerance;h=f.b2_angularSleepTolerance*f.b2_angularSleepTolerance;for(e=0;e<this.m_bodyCount;++e)g=this.m_bodies[e],g.GetType()!=r.b2_staticBody&&(0==(g.m_flags&r.e_allowSleepFlag)&&(d=g.m_sleepTime=0),0==(g.m_flags&r.e_allowSleepFlag)||g.m_angularVelocity*g.m_angularVelocity>h||c.Dot(g.m_linearVelocity,g.m_linearVelocity)>
- b?d=g.m_sleepTime=0:(g.m_sleepTime+=a.dt,d=c.Min(d,g.m_sleepTime)));if(d>=f.b2_timeToSleep)for(e=0;e<this.m_bodyCount;++e)g=this.m_bodies[e],g.SetAwake(!1)}};E.prototype.SolveTOI=function(a){var b=0,c=0;this.m_contactSolver.Initialize(a,this.m_contacts,this.m_contactCount,this.m_allocator);for(var d=this.m_contactSolver,b=0;b<this.m_jointCount;++b)this.m_joints[b].InitVelocityConstraints(a);for(b=0;b<a.velocityIterations;++b){d.SolveVelocityConstraints();for(c=0;c<this.m_jointCount;++c)this.m_joints[c].SolveVelocityConstraints(a)}for(b=
- 0;b<this.m_bodyCount;++b)if(c=this.m_bodies[b],c.GetType()!=r.b2_staticBody){var e=a.dt*c.m_linearVelocity.x,g=a.dt*c.m_linearVelocity.y;e*e+g*g>f.b2_maxTranslationSquared&&(c.m_linearVelocity.Normalize(),c.m_linearVelocity.x*=f.b2_maxTranslation*a.inv_dt,c.m_linearVelocity.y*=f.b2_maxTranslation*a.inv_dt);e=a.dt*c.m_angularVelocity;e*e>f.b2_maxRotationSquared&&(c.m_angularVelocity=0>c.m_angularVelocity?-f.b2_maxRotation*a.inv_dt:f.b2_maxRotation*a.inv_dt);c.m_sweep.c0.SetV(c.m_sweep.c);c.m_sweep.a0=
- c.m_sweep.a;c.m_sweep.c.x+=a.dt*c.m_linearVelocity.x;c.m_sweep.c.y+=a.dt*c.m_linearVelocity.y;c.m_sweep.a+=a.dt*c.m_angularVelocity;c.SynchronizeTransform()}for(b=0;b<a.positionIterations;++b){e=d.SolvePositionConstraints(0.75);g=!0;for(c=0;c<this.m_jointCount;++c)var s=this.m_joints[c].SolvePositionConstraints(f.b2_contactBaumgarte),g=g&&s;if(e&&g)break}this.Report(d.m_constraints)};E.prototype.Report=function(a){if(null!=this.m_listener)for(var b=0;b<this.m_contactCount;++b){for(var c=this.m_contacts[b],
- d=a[b],e=0;e<d.pointCount;++e)E.s_impulse.normalImpulses[e]=d.points[e].normalImpulse,E.s_impulse.tangentImpulses[e]=d.points[e].tangentImpulse;this.m_listener.PostSolve(c,E.s_impulse)}};E.prototype.AddBody=function(a){a.m_islandIndex=this.m_bodyCount;this.m_bodies[this.m_bodyCount++]=a};E.prototype.AddContact=function(a){this.m_contacts[this.m_contactCount++]=a};E.prototype.AddJoint=function(a){this.m_joints[this.m_jointCount++]=a};Box2D.postDefs.push(function(){Box2D.Dynamics.b2Island.s_impulse=
- new C});s.b2TimeStep=function(){};s.prototype.Set=function(a){this.dt=a.dt;this.inv_dt=a.inv_dt;this.positionIterations=a.positionIterations;this.velocityIterations=a.velocityIterations;this.warmStarting=a.warmStarting};w.b2World=function(){this.s_stack=new Vector;this.m_contactManager=new z;this.m_contactSolver=new L;this.m_island=new E};w.prototype.b2World=function(a,b){this.m_controllerList=this.m_jointList=this.m_contactList=this.m_bodyList=this.m_debugDraw=this.m_destructionListener=null;this.m_controllerCount=
- this.m_jointCount=this.m_contactCount=this.m_bodyCount=0;w.m_warmStarting=!0;w.m_continuousPhysics=!0;this.m_allowSleep=b;a.y=a.y;this.m_gravity=a;this.m_inv_dt0=0;this.m_contactManager.m_world=this;var c=new D;this.m_groundBody=this.CreateBody(c)};w.prototype.SetDestructionListener=function(a){this.m_destructionListener=a};w.prototype.SetContactFilter=function(a){this.m_contactManager.m_contactFilter=a};w.prototype.SetContactListener=function(a){this.m_contactManager.m_contactListener=a};w.prototype.SetDebugDraw=
- function(a){this.m_debugDraw=a};w.prototype.SetBroadPhase=function(a){var b=this.m_contactManager.m_broadPhase;this.m_contactManager.m_broadPhase=a;for(var c=this.m_bodyList;c;c=c.m_next)for(var d=c.m_fixtureList;d;d=d.m_next)d.m_proxy=a.CreateProxy(b.GetFatAABB(d.m_proxy),d)};w.prototype.Validate=function(){this.m_contactManager.m_broadPhase.Validate()};w.prototype.GetProxyCount=function(){return this.m_contactManager.m_broadPhase.GetProxyCount()};w.prototype.CreateBody=function(a){if(!0==this.IsLocked())return null;
- a=new r(a,this);a.m_prev=null;if(a.m_next=this.m_bodyList)this.m_bodyList.m_prev=a;this.m_bodyList=a;++this.m_bodyCount;return a};w.prototype.DestroyBody=function(a){if(!0!=this.IsLocked()){for(var b=a.m_jointList;b;){var c=b,b=b.next;this.m_destructionListener&&this.m_destructionListener.SayGoodbyeJoint(c.joint);this.DestroyJoint(c.joint)}for(b=a.m_controllerList;b;)c=b,b=b.nextController,c.controller.RemoveBody(a);for(b=a.m_contactList;b;)c=b,b=b.next,this.m_contactManager.Destroy(c.contact);a.m_contactList=
- null;for(b=a.m_fixtureList;b;)c=b,b=b.m_next,this.m_destructionListener&&this.m_destructionListener.SayGoodbyeFixture(c),c.DestroyProxy(this.m_contactManager.m_broadPhase),c.Destroy();a.m_fixtureList=null;a.m_fixtureCount=0;a.m_prev&&(a.m_prev.m_next=a.m_next);a.m_next&&(a.m_next.m_prev=a.m_prev);a==this.m_bodyList&&(this.m_bodyList=a.m_next);--this.m_bodyCount}};w.prototype.CreateJoint=function(a){var b=R.Create(a,null);b.m_prev=null;if(b.m_next=this.m_jointList)this.m_jointList.m_prev=b;this.m_jointList=
- b;++this.m_jointCount;b.m_edgeA.joint=b;b.m_edgeA.other=b.m_bodyB;b.m_edgeA.prev=null;if(b.m_edgeA.next=b.m_bodyA.m_jointList)b.m_bodyA.m_jointList.prev=b.m_edgeA;b.m_bodyA.m_jointList=b.m_edgeA;b.m_edgeB.joint=b;b.m_edgeB.other=b.m_bodyA;b.m_edgeB.prev=null;if(b.m_edgeB.next=b.m_bodyB.m_jointList)b.m_bodyB.m_jointList.prev=b.m_edgeB;b.m_bodyB.m_jointList=b.m_edgeB;var c=a.bodyA,d=a.bodyB;if(!1==a.collideConnected)for(a=d.GetContactList();a;)a.other==c&&a.contact.FlagForFiltering(),a=a.next;return b};
- w.prototype.DestroyJoint=function(a){var b=a.m_collideConnected;a.m_prev&&(a.m_prev.m_next=a.m_next);a.m_next&&(a.m_next.m_prev=a.m_prev);a==this.m_jointList&&(this.m_jointList=a.m_next);var c=a.m_bodyA,d=a.m_bodyB;c.SetAwake(!0);d.SetAwake(!0);a.m_edgeA.prev&&(a.m_edgeA.prev.next=a.m_edgeA.next);a.m_edgeA.next&&(a.m_edgeA.next.prev=a.m_edgeA.prev);a.m_edgeA==c.m_jointList&&(c.m_jointList=a.m_edgeA.next);a.m_edgeA.prev=null;a.m_edgeA.next=null;a.m_edgeB.prev&&(a.m_edgeB.prev.next=a.m_edgeB.next);
- a.m_edgeB.next&&(a.m_edgeB.next.prev=a.m_edgeB.prev);a.m_edgeB==d.m_jointList&&(d.m_jointList=a.m_edgeB.next);a.m_edgeB.prev=null;a.m_edgeB.next=null;R.Destroy(a,null);--this.m_jointCount;if(!1==b)for(a=d.GetContactList();a;)a.other==c&&a.contact.FlagForFiltering(),a=a.next};w.prototype.AddController=function(a){a.m_next=this.m_controllerList;a.m_prev=null;this.m_controllerList=a;a.m_world=this;this.m_controllerCount++;return a};w.prototype.RemoveController=function(a){a.m_prev&&(a.m_prev.m_next=
- a.m_next);a.m_next&&(a.m_next.m_prev=a.m_prev);this.m_controllerList==a&&(this.m_controllerList=a.m_next);this.m_controllerCount--};w.prototype.CreateController=function(a){if(a.m_world!=this)throw Error("Controller can only be a member of one world");a.m_next=this.m_controllerList;a.m_prev=null;this.m_controllerList&&(this.m_controllerList.m_prev=a);this.m_controllerList=a;++this.m_controllerCount;a.m_world=this;return a};w.prototype.DestroyController=function(a){a.Clear();a.m_next&&(a.m_next.m_prev=
- a.m_prev);a.m_prev&&(a.m_prev.m_next=a.m_next);a==this.m_controllerList&&(this.m_controllerList=a.m_next);--this.m_controllerCount};w.prototype.SetWarmStarting=function(a){w.m_warmStarting=a};w.prototype.SetContinuousPhysics=function(a){w.m_continuousPhysics=a};w.prototype.GetBodyCount=function(){return this.m_bodyCount};w.prototype.GetJointCount=function(){return this.m_jointCount};w.prototype.GetContactCount=function(){return this.m_contactCount};w.prototype.SetGravity=function(a){this.m_gravity=
- a};w.prototype.GetGravity=function(){return this.m_gravity};w.prototype.GetGroundBody=function(){return this.m_groundBody};w.prototype.Step=function(a,b,c){void 0===a&&(a=0);void 0===b&&(b=0);void 0===c&&(c=0);this.m_flags&w.e_newFixture&&(this.m_contactManager.FindNewContacts(),this.m_flags&=~w.e_newFixture);this.m_flags|=w.e_locked;var d=w.s_timestep2;d.dt=a;d.velocityIterations=b;d.positionIterations=c;d.inv_dt=0<a?1/a:0;d.dtRatio=this.m_inv_dt0*a;d.warmStarting=w.m_warmStarting;this.m_contactManager.Collide();
- 0<d.dt&&this.Solve(d);w.m_continuousPhysics&&0<d.dt&&this.SolveTOI(d);0<d.dt&&(this.m_inv_dt0=d.inv_dt);this.m_flags&=~w.e_locked};w.prototype.ClearForces=function(){for(var a=this.m_bodyList;a;a=a.m_next)a.m_force.SetZero(),a.m_torque=0};w.prototype.DrawDebugData=function(){if(null!=this.m_debugDraw){this.m_debugDraw.m_sprite.graphics.clear();var c=this.m_debugDraw.GetFlags(),d,e,f;new a;new a;new a;var g;new m;new m;g=[new a,new a,new a,new a];var s=new b(0,0,0);if(c&u.e_shapeBit)for(d=this.m_bodyList;d;d=
- d.m_next){g=d.m_xf;for(e=d.GetFixtureList();e;e=e.m_next)f=e.GetShape(),!1==d.IsActive()?s.Set(0.5,0.5,0.3):d.GetType()==r.b2_staticBody?s.Set(0.5,0.9,0.5):d.GetType()==r.b2_kinematicBody?s.Set(0.5,0.5,0.9):!1==d.IsAwake()?s.Set(0.6,0.6,0.6):s.Set(0.9,0.7,0.7),this.DrawShape(f,g,s)}if(c&u.e_jointBit)for(d=this.m_jointList;d;d=d.m_next)this.DrawJoint(d);if(c&u.e_controllerBit)for(d=this.m_controllerList;d;d=d.m_next)d.Draw(this.m_debugDraw);if(c&u.e_pairBit){s.Set(0.3,0.9,0.9);for(d=this.m_contactManager.m_contactList;d;d=
- d.GetNext())f=d.GetFixtureA(),e=d.GetFixtureB(),f=f.GetAABB().GetCenter(),e=e.GetAABB().GetCenter(),this.m_debugDraw.DrawSegment(f,e,s)}if(c&u.e_aabbBit){f=this.m_contactManager.m_broadPhase;g=[new a,new a,new a,new a];for(d=this.m_bodyList;d;d=d.GetNext())if(!1!=d.IsActive())for(e=d.GetFixtureList();e;e=e.GetNext()){var h=f.GetFatAABB(e.m_proxy);g[0].Set(h.lowerBound.x,h.lowerBound.y);g[1].Set(h.upperBound.x,h.lowerBound.y);g[2].Set(h.upperBound.x,h.upperBound.y);g[3].Set(h.lowerBound.x,h.upperBound.y);
- this.m_debugDraw.DrawPolygon(g,4,s)}}if(c&u.e_centerOfMassBit)for(d=this.m_bodyList;d;d=d.m_next)g=w.s_xf,g.R=d.m_xf.R,g.position=d.GetWorldCenter(),this.m_debugDraw.DrawTransform(g)}};w.prototype.QueryAABB=function(a,b){var c=this.m_contactManager.m_broadPhase;c.Query(function(b){return a(c.GetUserData(b))},b)};w.prototype.QueryShape=function(a,b,c){void 0===c&&(c=null);null==c&&(c=new d,c.SetIdentity());var e=this.m_contactManager.m_broadPhase,f=new m;b.ComputeAABB(f,c);e.Query(function(d){d=e.GetUserData(d)instanceof
- K?e.GetUserData(d):null;return F.TestOverlap(b,c,d.GetShape(),d.GetBody().GetTransform())?a(d):!0},f)};w.prototype.QueryPoint=function(a,b){var c=this.m_contactManager.m_broadPhase,d=new m;d.lowerBound.Set(b.x-f.b2_linearSlop,b.y-f.b2_linearSlop);d.upperBound.Set(b.x+f.b2_linearSlop,b.y+f.b2_linearSlop);c.Query(function(d){d=c.GetUserData(d)instanceof K?c.GetUserData(d):null;return d.TestPoint(b)?a(d):!0},d)};w.prototype.RayCast=function(b,c,d){var e=this.m_contactManager.m_broadPhase,f=new l,g=new k(c,
- d);e.RayCast(function(g,s){var h=e.GetUserData(s),h=h instanceof K?h:null;if(h.RayCast(f,g)){var k=f.fraction,w=new a((1-k)*c.x+k*d.x,(1-k)*c.y+k*d.y);return b(h,w,f.normal,k)}return g.maxFraction},g)};w.prototype.RayCastOne=function(a,b){var c;this.RayCast(function(a,b,d,e){void 0===e&&(e=0);c=a;return e},a,b);return c};w.prototype.RayCastAll=function(a,b){var c=new Vector;this.RayCast(function(a,b,d,e){c[c.length]=a;return 1},a,b);return c};w.prototype.GetBodyList=function(){return this.m_bodyList};
- w.prototype.GetJointList=function(){return this.m_jointList};w.prototype.GetContactList=function(){return this.m_contactList};w.prototype.IsLocked=function(){return 0<(this.m_flags&w.e_locked)};w.prototype.Solve=function(a){for(var b,c=this.m_controllerList;c;c=c.m_next)c.Step(a);c=this.m_island;c.Initialize(this.m_bodyCount,this.m_contactCount,this.m_jointCount,null,this.m_contactManager.m_contactListener,this.m_contactSolver);for(b=this.m_bodyList;b;b=b.m_next)b.m_flags&=~r.e_islandFlag;for(var d=
- this.m_contactList;d;d=d.m_next)d.m_flags&=~G.e_islandFlag;for(d=this.m_jointList;d;d=d.m_next)d.m_islandFlag=!1;parseInt(this.m_bodyCount);for(var d=this.s_stack,e=this.m_bodyList;e;e=e.m_next)if(!(e.m_flags&r.e_islandFlag)&&!(!1==e.IsAwake()||!1==e.IsActive())&&e.GetType()!=r.b2_staticBody){c.Clear();var f=0;d[f++]=e;for(e.m_flags|=r.e_islandFlag;0<f;)if(b=d[--f],c.AddBody(b),!1==b.IsAwake()&&b.SetAwake(!0),b.GetType()!=r.b2_staticBody){for(var g,s=b.m_contactList;s;s=s.next)if(!(s.contact.m_flags&
- G.e_islandFlag)&&!(!0==s.contact.IsSensor()||!1==s.contact.IsEnabled()||!1==s.contact.IsTouching()))c.AddContact(s.contact),s.contact.m_flags|=G.e_islandFlag,g=s.other,g.m_flags&r.e_islandFlag||(d[f++]=g,g.m_flags|=r.e_islandFlag);for(b=b.m_jointList;b;b=b.next)!0!=b.joint.m_islandFlag&&(g=b.other,!1!=g.IsActive()&&(c.AddJoint(b.joint),b.joint.m_islandFlag=!0,g.m_flags&r.e_islandFlag||(d[f++]=g,g.m_flags|=r.e_islandFlag)))}c.Solve(a,this.m_gravity,this.m_allowSleep);for(f=0;f<c.m_bodyCount;++f)b=
- c.m_bodies[f],b.GetType()==r.b2_staticBody&&(b.m_flags&=~r.e_islandFlag)}for(f=0;f<d.length&&d[f];++f)d[f]=null;for(b=this.m_bodyList;b;b=b.m_next)!1==b.IsAwake()||!1==b.IsActive()||b.GetType()!=r.b2_staticBody&&b.SynchronizeFixtures();this.m_contactManager.FindNewContacts()};w.prototype.SolveTOI=function(a){var b,c,d,e=this.m_island;e.Initialize(this.m_bodyCount,f.b2_maxTOIContactsPerIsland,f.b2_maxTOIJointsPerIsland,null,this.m_contactManager.m_contactListener,this.m_contactSolver);var g=w.s_queue;
- for(b=this.m_bodyList;b;b=b.m_next)b.m_flags&=~r.e_islandFlag,b.m_sweep.t0=0;for(d=this.m_contactList;d;d=d.m_next)d.m_flags&=~(G.e_toiFlag|G.e_islandFlag);for(d=this.m_jointList;d;d=d.m_next)d.m_islandFlag=!1;for(;;){var s=null,h=1;for(d=this.m_contactList;d;d=d.m_next)if(!(!0==d.IsSensor()||!1==d.IsEnabled()||!1==d.IsContinuous())){b=1;if(d.m_flags&G.e_toiFlag)b=d.m_toi;else{b=d.m_fixtureA;c=d.m_fixtureB;b=b.m_body;c=c.m_body;if((b.GetType()!=r.b2_dynamicBody||!1==b.IsAwake())&&(c.GetType()!=r.b2_dynamicBody||
- !1==c.IsAwake()))continue;var k=b.m_sweep.t0;b.m_sweep.t0<c.m_sweep.t0?(k=c.m_sweep.t0,b.m_sweep.Advance(k)):c.m_sweep.t0<b.m_sweep.t0&&(k=b.m_sweep.t0,c.m_sweep.Advance(k));b=d.ComputeTOI(b.m_sweep,c.m_sweep);f.b2Assert(0<=b&&1>=b);0<b&&1>b&&(b=(1-b)*k+b,1<b&&(b=1));d.m_toi=b;d.m_flags|=G.e_toiFlag}Number.MIN_VALUE<b&&b<h&&(s=d,h=b)}if(null==s||1-100*Number.MIN_VALUE<h)break;b=s.m_fixtureA;c=s.m_fixtureB;b=b.m_body;c=c.m_body;w.s_backupA.Set(b.m_sweep);w.s_backupB.Set(c.m_sweep);b.Advance(h);c.Advance(h);
- s.Update(this.m_contactManager.m_contactListener);s.m_flags&=~G.e_toiFlag;if(!0==s.IsSensor()||!1==s.IsEnabled())b.m_sweep.Set(w.s_backupA),c.m_sweep.Set(w.s_backupB),b.SynchronizeTransform(),c.SynchronizeTransform();else if(!1!=s.IsTouching()){b.GetType()!=r.b2_dynamicBody&&(b=c);e.Clear();s=d=0;g[d+s++]=b;for(b.m_flags|=r.e_islandFlag;0<s;)if(b=g[d++],--s,e.AddBody(b),!1==b.IsAwake()&&b.SetAwake(!0),b.GetType()==r.b2_dynamicBody){for(c=b.m_contactList;c&&e.m_contactCount!=e.m_contactCapacity;c=
- c.next)if(!(c.contact.m_flags&G.e_islandFlag)&&!(!0==c.contact.IsSensor()||!1==c.contact.IsEnabled()||!1==c.contact.IsTouching()))e.AddContact(c.contact),c.contact.m_flags|=G.e_islandFlag,k=c.other,k.m_flags&r.e_islandFlag||(k.GetType()!=r.b2_staticBody&&(k.Advance(h),k.SetAwake(!0)),g[d+s]=k,++s,k.m_flags|=r.e_islandFlag);for(b=b.m_jointList;b;b=b.next)e.m_jointCount!=e.m_jointCapacity&&!0!=b.joint.m_islandFlag&&(k=b.other,!1!=k.IsActive()&&(e.AddJoint(b.joint),b.joint.m_islandFlag=!0,k.m_flags&
- r.e_islandFlag||(k.GetType()!=r.b2_staticBody&&(k.Advance(h),k.SetAwake(!0)),g[d+s]=k,++s,k.m_flags|=r.e_islandFlag)))}d=w.s_timestep;d.warmStarting=!1;d.dt=(1-h)*a.dt;d.inv_dt=1/d.dt;d.dtRatio=0;d.velocityIterations=a.velocityIterations;d.positionIterations=a.positionIterations;e.SolveTOI(d);for(h=h=0;h<e.m_bodyCount;++h)if(b=e.m_bodies[h],b.m_flags&=~r.e_islandFlag,!1!=b.IsAwake()&&b.GetType()==r.b2_dynamicBody){b.SynchronizeFixtures();for(c=b.m_contactList;c;c=c.next)c.contact.m_flags&=~G.e_toiFlag}for(h=
- 0;h<e.m_contactCount;++h)d=e.m_contacts[h],d.m_flags&=~(G.e_toiFlag|G.e_islandFlag);for(h=0;h<e.m_jointCount;++h)d=e.m_joints[h],d.m_islandFlag=!1;this.m_contactManager.FindNewContacts()}}};w.prototype.DrawJoint=function(a){var b=a.GetBodyA(),c=a.GetBodyB(),d=b.m_xf.position,e=c.m_xf.position,f=a.GetAnchorA(),g=a.GetAnchorB(),s=w.s_jointColor;switch(a.m_type){case R.e_distanceJoint:this.m_debugDraw.DrawSegment(f,g,s);break;case R.e_pulleyJoint:b=a instanceof P?a:null;a=b.GetGroundAnchorA();b=b.GetGroundAnchorB();
- this.m_debugDraw.DrawSegment(a,f,s);this.m_debugDraw.DrawSegment(b,g,s);this.m_debugDraw.DrawSegment(a,b,s);break;case R.e_mouseJoint:this.m_debugDraw.DrawSegment(f,g,s);break;default:b!=this.m_groundBody&&this.m_debugDraw.DrawSegment(d,f,s),this.m_debugDraw.DrawSegment(f,g,s),c!=this.m_groundBody&&this.m_debugDraw.DrawSegment(e,g,s)}};w.prototype.DrawShape=function(a,b,d){switch(a.m_type){case F.e_circleShape:var e=a instanceof n?a:null;a=c.MulX(b,e.m_p);this.m_debugDraw.DrawSolidCircle(a,e.m_radius,
- b.R.col1,d);break;case F.e_polygonShape:e=0;e=a instanceof v?a:null;a=parseInt(e.GetVertexCount());for(var f=e.GetVertices(),g=new Vector(a),e=0;e<a;++e)g[e]=c.MulX(b,f[e]);this.m_debugDraw.DrawSolidPolygon(g,a,d);break;case F.e_edgeShape:e=a instanceof p?a:null,this.m_debugDraw.DrawSegment(c.MulX(b,e.GetVertex1()),c.MulX(b,e.GetVertex2()),d)}};Box2D.postDefs.push(function(){Box2D.Dynamics.b2World.s_timestep2=new s;Box2D.Dynamics.b2World.s_xf=new d;Box2D.Dynamics.b2World.s_backupA=new e;Box2D.Dynamics.b2World.s_backupB=
- new e;Box2D.Dynamics.b2World.s_timestep=new s;Box2D.Dynamics.b2World.s_queue=new Vector;Box2D.Dynamics.b2World.s_jointColor=new b(0.5,0.8,0.8);Box2D.Dynamics.b2World.e_newFixture=1;Box2D.Dynamics.b2World.e_locked=2})})();
- (function(){var c=Box2D.Collision.Shapes.b2CircleShape,e=Box2D.Collision.Shapes.b2EdgeShape,d=Box2D.Collision.Shapes.b2PolygonShape,a=Box2D.Collision.Shapes.b2Shape,b=Box2D.Dynamics.Contacts.b2CircleContact,f=Box2D.Dynamics.Contacts.b2Contact,m=Box2D.Dynamics.Contacts.b2ContactConstraint,h=Box2D.Dynamics.Contacts.b2ContactConstraintPoint,g=Box2D.Dynamics.Contacts.b2ContactEdge,k=Box2D.Dynamics.Contacts.b2ContactFactory,l=Box2D.Dynamics.Contacts.b2ContactRegister,n=Box2D.Dynamics.Contacts.b2ContactResult,
- p=Box2D.Dynamics.Contacts.b2ContactSolver,q=Box2D.Dynamics.Contacts.b2EdgeAndCircleContact,v=Box2D.Dynamics.Contacts.b2NullContact,F=Box2D.Dynamics.Contacts.b2PolyAndCircleContact,r=Box2D.Dynamics.Contacts.b2PolyAndEdgeContact,D=Box2D.Dynamics.Contacts.b2PolygonContact,x=Box2D.Dynamics.Contacts.b2PositionSolverManifold,C=Box2D.Dynamics.b2Body,A=Box2D.Dynamics.b2TimeStep,z=Box2D.Common.b2Settings,u=Box2D.Common.Math.b2Mat22,J=Box2D.Common.Math.b2Math,B=Box2D.Common.Math.b2Vec2,K=Box2D.Collision.b2Collision,
- I=Box2D.Collision.b2ContactID,E=Box2D.Collision.b2Manifold,s=Box2D.Collision.b2TimeOfImpact,w=Box2D.Collision.b2TOIInput,G=Box2D.Collision.b2WorldManifold;Box2D.inherit(b,Box2D.Dynamics.Contacts.b2Contact);b.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;b.b2CircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};b.Create=function(a){return new b};b.Destroy=function(a,b){};b.prototype.Reset=function(a,b){this.__super.Reset.call(this,a,b)};b.prototype.Evaluate=
- function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();K.CollideCircles(this.m_manifold,this.m_fixtureA.GetShape()instanceof c?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof c?this.m_fixtureB.GetShape():null,b.m_xf)};f.b2Contact=function(){this.m_nodeA=new g;this.m_nodeB=new g;this.m_manifold=new E;this.m_oldManifold=new E};f.prototype.GetManifold=function(){return this.m_manifold};f.prototype.GetWorldManifold=function(a){var b=this.m_fixtureA.GetBody(),
- c=this.m_fixtureB.GetBody(),d=this.m_fixtureA.GetShape(),e=this.m_fixtureB.GetShape();a.Initialize(this.m_manifold,b.GetTransform(),d.m_radius,c.GetTransform(),e.m_radius)};f.prototype.IsTouching=function(){return(this.m_flags&f.e_touchingFlag)==f.e_touchingFlag};f.prototype.IsContinuous=function(){return(this.m_flags&f.e_continuousFlag)==f.e_continuousFlag};f.prototype.SetSensor=function(a){this.m_flags=a?this.m_flags|f.e_sensorFlag:this.m_flags&~f.e_sensorFlag};f.prototype.IsSensor=function(){return(this.m_flags&
- f.e_sensorFlag)==f.e_sensorFlag};f.prototype.SetEnabled=function(a){this.m_flags=a?this.m_flags|f.e_enabledFlag:this.m_flags&~f.e_enabledFlag};f.prototype.IsEnabled=function(){return(this.m_flags&f.e_enabledFlag)==f.e_enabledFlag};f.prototype.GetNext=function(){return this.m_next};f.prototype.GetFixtureA=function(){return this.m_fixtureA};f.prototype.GetFixtureB=function(){return this.m_fixtureB};f.prototype.FlagForFiltering=function(){this.m_flags|=f.e_filterFlag};f.prototype.b2Contact=function(){};
- f.prototype.Reset=function(a,b){void 0===a&&(a=null);void 0===b&&(b=null);this.m_flags=f.e_enabledFlag;if(!a||!b)this.m_fixtureB=this.m_fixtureA=null;else{if(a.IsSensor()||b.IsSensor())this.m_flags|=f.e_sensorFlag;var c=a.GetBody(),d=b.GetBody();if(c.GetType()!=C.b2_dynamicBody||c.IsBullet()||d.GetType()!=C.b2_dynamicBody||d.IsBullet())this.m_flags|=f.e_continuousFlag;this.m_fixtureA=a;this.m_fixtureB=b;this.m_manifold.m_pointCount=0;this.m_next=this.m_prev=null;this.m_nodeA.contact=null;this.m_nodeA.prev=
- null;this.m_nodeA.next=null;this.m_nodeA.other=null;this.m_nodeB.contact=null;this.m_nodeB.prev=null;this.m_nodeB.next=null;this.m_nodeB.other=null}};f.prototype.Update=function(b){var c=this.m_oldManifold;this.m_oldManifold=this.m_manifold;this.m_manifold=c;this.m_flags|=f.e_enabledFlag;var d=!1,c=(this.m_flags&f.e_touchingFlag)==f.e_touchingFlag,e=this.m_fixtureA.m_body,g=this.m_fixtureB.m_body,s=this.m_fixtureA.m_aabb.TestOverlap(this.m_fixtureB.m_aabb);if(this.m_flags&f.e_sensorFlag)s&&(d=this.m_fixtureA.GetShape(),
- s=this.m_fixtureB.GetShape(),e=e.GetTransform(),g=g.GetTransform(),d=a.TestOverlap(d,e,s,g)),this.m_manifold.m_pointCount=0;else{e.GetType()!=C.b2_dynamicBody||e.IsBullet()||g.GetType()!=C.b2_dynamicBody||g.IsBullet()?this.m_flags|=f.e_continuousFlag:this.m_flags&=~f.e_continuousFlag;if(s){this.Evaluate();d=0<this.m_manifold.m_pointCount;for(s=0;s<this.m_manifold.m_pointCount;++s){var h=this.m_manifold.m_points[s];h.m_normalImpulse=0;h.m_tangentImpulse=0;for(var k=h.m_id,w=0;w<this.m_oldManifold.m_pointCount;++w){var m=
- this.m_oldManifold.m_points[w];if(m.m_id.key==k.key){h.m_normalImpulse=m.m_normalImpulse;h.m_tangentImpulse=m.m_tangentImpulse;break}}}}else this.m_manifold.m_pointCount=0;d!=c&&(e.SetAwake(!0),g.SetAwake(!0))}this.m_flags=d?this.m_flags|f.e_touchingFlag:this.m_flags&~f.e_touchingFlag;!1==c&&!0==d&&b.BeginContact(this);!0==c&&!1==d&&b.EndContact(this);0==(this.m_flags&f.e_sensorFlag)&&b.PreSolve(this,this.m_oldManifold)};f.prototype.Evaluate=function(){};f.prototype.ComputeTOI=function(a,b){f.s_input.proxyA.Set(this.m_fixtureA.GetShape());
- f.s_input.proxyB.Set(this.m_fixtureB.GetShape());f.s_input.sweepA=a;f.s_input.sweepB=b;f.s_input.tolerance=z.b2_linearSlop;return s.TimeOfImpact(f.s_input)};Box2D.postDefs.push(function(){Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag=1;Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag=2;Box2D.Dynamics.Contacts.b2Contact.e_islandFlag=4;Box2D.Dynamics.Contacts.b2Contact.e_toiFlag=8;Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag=16;Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag=32;Box2D.Dynamics.Contacts.b2Contact.e_filterFlag=
- 64;Box2D.Dynamics.Contacts.b2Contact.s_input=new w});m.b2ContactConstraint=function(){this.localPlaneNormal=new B;this.localPoint=new B;this.normal=new B;this.normalMass=new u;this.K=new u};m.prototype.b2ContactConstraint=function(){this.points=new Vector(z.b2_maxManifoldPoints);for(var a=0;a<z.b2_maxManifoldPoints;a++)this.points[a]=new h};h.b2ContactConstraintPoint=function(){this.localPoint=new B;this.rA=new B;this.rB=new B};g.b2ContactEdge=function(){};k.b2ContactFactory=function(){};k.prototype.b2ContactFactory=
- function(a){this.m_allocator=a;this.InitializeRegisters()};k.prototype.AddType=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);this.m_registers[c][d].createFcn=a;this.m_registers[c][d].destroyFcn=b;this.m_registers[c][d].primary=!0;c!=d&&(this.m_registers[d][c].createFcn=a,this.m_registers[d][c].destroyFcn=b,this.m_registers[d][c].primary=!1)};k.prototype.InitializeRegisters=function(){this.m_registers=new Vector(a.e_shapeTypeCount);for(var c=0;c<a.e_shapeTypeCount;c++){this.m_registers[c]=
- new Vector(a.e_shapeTypeCount);for(var d=0;d<a.e_shapeTypeCount;d++)this.m_registers[c][d]=new l}this.AddType(b.Create,b.Destroy,a.e_circleShape,a.e_circleShape);this.AddType(F.Create,F.Destroy,a.e_polygonShape,a.e_circleShape);this.AddType(D.Create,D.Destroy,a.e_polygonShape,a.e_polygonShape);this.AddType(q.Create,q.Destroy,a.e_edgeShape,a.e_circleShape);this.AddType(r.Create,r.Destroy,a.e_polygonShape,a.e_edgeShape)};k.prototype.Create=function(a,b){var c=parseInt(a.GetType()),d=parseInt(b.GetType()),
- c=this.m_registers[c][d];if(c.pool)return d=c.pool,c.pool=d.m_next,c.poolCount--,d.Reset(a,b),d;d=c.createFcn;return null!=d?(c.primary?(d=d(this.m_allocator),d.Reset(a,b)):(d=d(this.m_allocator),d.Reset(b,a)),d):null};k.prototype.Destroy=function(a){0<a.m_manifold.m_pointCount&&(a.m_fixtureA.m_body.SetAwake(!0),a.m_fixtureB.m_body.SetAwake(!0));var b=parseInt(a.m_fixtureA.GetType()),c=parseInt(a.m_fixtureB.GetType()),b=this.m_registers[b][c];b.poolCount++;a.m_next=b.pool;b.pool=a;b=b.destroyFcn;
- b(a,this.m_allocator)};l.b2ContactRegister=function(){};n.b2ContactResult=function(){this.position=new B;this.normal=new B;this.id=new I};p.b2ContactSolver=function(){this.m_step=new A;this.m_constraints=new Vector};p.prototype.b2ContactSolver=function(){};p.prototype.Initialize=function(a,b,c,d){void 0===c&&(c=0);var e;this.m_step.Set(a);this.m_allocator=d;a=0;for(this.m_constraintCount=c;this.m_constraints.length<this.m_constraintCount;)this.m_constraints[this.m_constraints.length]=new m;for(a=
- 0;a<c;++a){e=b[a];d=e.m_fixtureA;var f=e.m_fixtureB,g=d.m_shape.m_radius,s=f.m_shape.m_radius,h=d.m_body,k=f.m_body,w=e.GetManifold(),l=z.b2MixFriction(d.GetFriction(),f.GetFriction()),G=z.b2MixRestitution(d.GetRestitution(),f.GetRestitution()),n=h.m_linearVelocity.x,q=h.m_linearVelocity.y,r=k.m_linearVelocity.x,v=k.m_linearVelocity.y,u=h.m_angularVelocity,x=k.m_angularVelocity;z.b2Assert(0<w.m_pointCount);p.s_worldManifold.Initialize(w,h.m_xf,g,k.m_xf,s);f=p.s_worldManifold.m_normal.x;e=p.s_worldManifold.m_normal.y;
- d=this.m_constraints[a];d.bodyA=h;d.bodyB=k;d.manifold=w;d.normal.x=f;d.normal.y=e;d.pointCount=w.m_pointCount;d.friction=l;d.restitution=G;d.localPlaneNormal.x=w.m_localPlaneNormal.x;d.localPlaneNormal.y=w.m_localPlaneNormal.y;d.localPoint.x=w.m_localPoint.x;d.localPoint.y=w.m_localPoint.y;d.radius=g+s;d.type=w.m_type;for(g=0;g<d.pointCount;++g){l=w.m_points[g];s=d.points[g];s.normalImpulse=l.m_normalImpulse;s.tangentImpulse=l.m_tangentImpulse;s.localPoint.SetV(l.m_localPoint);var l=s.rA.x=p.s_worldManifold.m_points[g].x-
- h.m_sweep.c.x,G=s.rA.y=p.s_worldManifold.m_points[g].y-h.m_sweep.c.y,A=s.rB.x=p.s_worldManifold.m_points[g].x-k.m_sweep.c.x,D=s.rB.y=p.s_worldManifold.m_points[g].y-k.m_sweep.c.y,C=l*e-G*f,B=A*e-D*f,C=C*C,B=B*B;s.normalMass=1/(h.m_invMass+k.m_invMass+h.m_invI*C+k.m_invI*B);var F=h.m_mass*h.m_invMass+k.m_mass*k.m_invMass,F=F+(h.m_mass*h.m_invI*C+k.m_mass*k.m_invI*B);s.equalizedMass=1/F;B=e;F=-f;C=l*F-G*B;B=A*F-D*B;C*=C;B*=B;s.tangentMass=1/(h.m_invMass+k.m_invMass+h.m_invI*C+k.m_invI*B);s.velocityBias=
- 0;l=d.normal.x*(r+-x*D-n- -u*G)+d.normal.y*(v+x*A-q-u*l);l<-z.b2_velocityThreshold&&(s.velocityBias+=-d.restitution*l)}2==d.pointCount&&(v=d.points[0],r=d.points[1],w=h.m_invMass,h=h.m_invI,n=k.m_invMass,k=k.m_invI,q=v.rA.x*e-v.rA.y*f,v=v.rB.x*e-v.rB.y*f,u=r.rA.x*e-r.rA.y*f,r=r.rB.x*e-r.rB.y*f,f=w+n+h*q*q+k*v*v,e=w+n+h*u*u+k*r*r,k=w+n+h*q*u+k*v*r,f*f<100*(f*e-k*k)?(d.K.col1.Set(f,k),d.K.col2.Set(k,e),d.K.GetInverse(d.normalMass)):d.pointCount=1)}};p.prototype.InitVelocityConstraints=function(a){for(var b=
- 0;b<this.m_constraintCount;++b){var c=this.m_constraints[b],d=c.bodyA,e=c.bodyB,f=d.m_invMass,g=d.m_invI,s=e.m_invMass,h=e.m_invI,k=c.normal.x,w=c.normal.y,m=w,l=-k,G=0,n=0;if(a.warmStarting){n=c.pointCount;for(G=0;G<n;++G){var p=c.points[G];p.normalImpulse*=a.dtRatio;p.tangentImpulse*=a.dtRatio;var q=p.normalImpulse*k+p.tangentImpulse*m,r=p.normalImpulse*w+p.tangentImpulse*l;d.m_angularVelocity-=g*(p.rA.x*r-p.rA.y*q);d.m_linearVelocity.x-=f*q;d.m_linearVelocity.y-=f*r;e.m_angularVelocity+=h*(p.rB.x*
- r-p.rB.y*q);e.m_linearVelocity.x+=s*q;e.m_linearVelocity.y+=s*r}}else{n=c.pointCount;for(G=0;G<n;++G)d=c.points[G],d.normalImpulse=0,d.tangentImpulse=0}}};p.prototype.SolveVelocityConstraints=function(){for(var a=0,b,c=0,d=0,e=0,f=d=d=c=c=0,g=c=c=0,s=c=e=0,h=0,k,w=0;w<this.m_constraintCount;++w){var e=this.m_constraints[w],m=e.bodyA,l=e.bodyB,G=m.m_angularVelocity,n=l.m_angularVelocity,p=m.m_linearVelocity,q=l.m_linearVelocity,r=m.m_invMass,v=m.m_invI,u=l.m_invMass,x=l.m_invI,s=e.normal.x,A=h=e.normal.y;
- k=-s;g=e.friction;for(a=0;a<e.pointCount;a++)b=e.points[a],c=q.x-n*b.rB.y-p.x+G*b.rA.y,d=q.y+n*b.rB.x-p.y-G*b.rA.x,c=c*A+d*k,c=b.tangentMass*-c,d=g*b.normalImpulse,d=J.Clamp(b.tangentImpulse+c,-d,d),c=d-b.tangentImpulse,f=c*A,c*=k,p.x-=r*f,p.y-=r*c,G-=v*(b.rA.x*c-b.rA.y*f),q.x+=u*f,q.y+=u*c,n+=x*(b.rB.x*c-b.rB.y*f),b.tangentImpulse=d;parseInt(e.pointCount);if(1==e.pointCount)b=e.points[0],c=q.x+-n*b.rB.y-p.x- -G*b.rA.y,d=q.y+n*b.rB.x-p.y-G*b.rA.x,e=c*s+d*h,c=-b.normalMass*(e-b.velocityBias),d=b.normalImpulse+
- c,d=0<d?d:0,c=d-b.normalImpulse,f=c*s,c*=h,p.x-=r*f,p.y-=r*c,G-=v*(b.rA.x*c-b.rA.y*f),q.x+=u*f,q.y+=u*c,n+=x*(b.rB.x*c-b.rB.y*f),b.normalImpulse=d;else{b=e.points[0];var a=e.points[1],c=b.normalImpulse,g=a.normalImpulse,z=(q.x-n*b.rB.y-p.x+G*b.rA.y)*s+(q.y+n*b.rB.x-p.y-G*b.rA.x)*h,C=(q.x-n*a.rB.y-p.x+G*a.rA.y)*s+(q.y+n*a.rB.x-p.y-G*a.rA.x)*h,d=z-b.velocityBias,f=C-a.velocityBias;k=e.K;d-=k.col1.x*c+k.col2.x*g;for(f-=k.col1.y*c+k.col2.y*g;;){k=e.normalMass;A=-(k.col1.x*d+k.col2.x*f);k=-(k.col1.y*d+
- k.col2.y*f);if(0<=A&&0<=k){c=A-c;g=k-g;e=c*s;c*=h;s*=g;h*=g;p.x-=r*(e+s);p.y-=r*(c+h);G-=v*(b.rA.x*c-b.rA.y*e+a.rA.x*h-a.rA.y*s);q.x+=u*(e+s);q.y+=u*(c+h);n+=x*(b.rB.x*c-b.rB.y*e+a.rB.x*h-a.rB.y*s);b.normalImpulse=A;a.normalImpulse=k;break}A=-b.normalMass*d;k=0;C=e.K.col1.y*A+f;if(0<=A&&0<=C){c=A-c;g=k-g;e=c*s;c*=h;s*=g;h*=g;p.x-=r*(e+s);p.y-=r*(c+h);G-=v*(b.rA.x*c-b.rA.y*e+a.rA.x*h-a.rA.y*s);q.x+=u*(e+s);q.y+=u*(c+h);n+=x*(b.rB.x*c-b.rB.y*e+a.rB.x*h-a.rB.y*s);b.normalImpulse=A;a.normalImpulse=k;
- break}A=0;k=-a.normalMass*f;z=e.K.col2.x*k+d;if(0<=k&&0<=z){c=A-c;g=k-g;e=c*s;c*=h;s*=g;h*=g;p.x-=r*(e+s);p.y-=r*(c+h);G-=v*(b.rA.x*c-b.rA.y*e+a.rA.x*h-a.rA.y*s);q.x+=u*(e+s);q.y+=u*(c+h);n+=x*(b.rB.x*c-b.rB.y*e+a.rB.x*h-a.rB.y*s);b.normalImpulse=A;a.normalImpulse=k;break}k=A=0;z=d;C=f;if(0<=z&&0<=C){c=A-c;g=k-g;e=c*s;c*=h;s*=g;h*=g;p.x-=r*(e+s);p.y-=r*(c+h);G-=v*(b.rA.x*c-b.rA.y*e+a.rA.x*h-a.rA.y*s);q.x+=u*(e+s);q.y+=u*(c+h);n+=x*(b.rB.x*c-b.rB.y*e+a.rB.x*h-a.rB.y*s);b.normalImpulse=A;a.normalImpulse=
- k;break}break}}m.m_angularVelocity=G;l.m_angularVelocity=n}};p.prototype.FinalizeVelocityConstraints=function(){for(var a=0;a<this.m_constraintCount;++a)for(var b=this.m_constraints[a],c=b.manifold,d=0;d<b.pointCount;++d){var e=c.m_points[d],f=b.points[d];e.m_normalImpulse=f.normalImpulse;e.m_tangentImpulse=f.tangentImpulse}};p.prototype.SolvePositionConstraints=function(a){void 0===a&&(a=0);for(var b=0,c=0;c<this.m_constraintCount;c++){var d=this.m_constraints[c],e=d.bodyA,f=d.bodyB,g=e.m_mass*e.m_invMass,
- s=e.m_mass*e.m_invI,h=f.m_mass*f.m_invMass,k=f.m_mass*f.m_invI;p.s_psm.Initialize(d);for(var w=p.s_psm.m_normal,m=0;m<d.pointCount;m++){var l=d.points[m],G=p.s_psm.m_points[m],n=p.s_psm.m_separations[m],q=G.x-e.m_sweep.c.x,r=G.y-e.m_sweep.c.y,v=G.x-f.m_sweep.c.x,G=G.y-f.m_sweep.c.y,b=b<n?b:n,n=J.Clamp(a*(n+z.b2_linearSlop),-z.b2_maxLinearCorrection,0),n=-l.equalizedMass*n,l=n*w.x,n=n*w.y;e.m_sweep.c.x-=g*l;e.m_sweep.c.y-=g*n;e.m_sweep.a-=s*(q*n-r*l);e.SynchronizeTransform();f.m_sweep.c.x+=h*l;f.m_sweep.c.y+=
- h*n;f.m_sweep.a+=k*(v*n-G*l);f.SynchronizeTransform()}}return b>-1.5*z.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold=new G;Box2D.Dynamics.Contacts.b2ContactSolver.s_psm=new x});Box2D.inherit(q,Box2D.Dynamics.Contacts.b2Contact);q.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;q.b2EdgeAndCircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};q.Create=function(a){return new q};q.Destroy=function(a,
- b){};q.prototype.Reset=function(a,b){this.__super.Reset.call(this,a,b)};q.prototype.Evaluate=function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();this.b2CollideEdgeAndCircle(this.m_manifold,this.m_fixtureA.GetShape()instanceof e?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof c?this.m_fixtureB.GetShape():null,b.m_xf)};q.prototype.b2CollideEdgeAndCircle=function(a,b,c,d,e){};Box2D.inherit(v,Box2D.Dynamics.Contacts.b2Contact);v.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;
- v.b2NullContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};v.prototype.b2NullContact=function(){this.__super.b2Contact.call(this)};v.prototype.Evaluate=function(){};Box2D.inherit(F,Box2D.Dynamics.Contacts.b2Contact);F.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;F.b2PolyAndCircleContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};F.Create=function(a){return new F};F.Destroy=function(a,b){};F.prototype.Reset=function(b,
- c){this.__super.Reset.call(this,b,c);z.b2Assert(b.GetType()==a.e_polygonShape);z.b2Assert(c.GetType()==a.e_circleShape)};F.prototype.Evaluate=function(){var a=this.m_fixtureA.m_body,b=this.m_fixtureB.m_body;K.CollidePolygonAndCircle(this.m_manifold,this.m_fixtureA.GetShape()instanceof d?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof c?this.m_fixtureB.GetShape():null,b.m_xf)};Box2D.inherit(r,Box2D.Dynamics.Contacts.b2Contact);r.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;
- r.b2PolyAndEdgeContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};r.Create=function(a){return new r};r.Destroy=function(a,b){};r.prototype.Reset=function(b,c){this.__super.Reset.call(this,b,c);z.b2Assert(b.GetType()==a.e_polygonShape);z.b2Assert(c.GetType()==a.e_edgeShape)};r.prototype.Evaluate=function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();this.b2CollidePolyAndEdge(this.m_manifold,this.m_fixtureA.GetShape()instanceof d?this.m_fixtureA.GetShape():
- null,a.m_xf,this.m_fixtureB.GetShape()instanceof e?this.m_fixtureB.GetShape():null,b.m_xf)};r.prototype.b2CollidePolyAndEdge=function(a,b,c,d,e){};Box2D.inherit(D,Box2D.Dynamics.Contacts.b2Contact);D.prototype.__super=Box2D.Dynamics.Contacts.b2Contact.prototype;D.b2PolygonContact=function(){Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this,arguments)};D.Create=function(a){return new D};D.Destroy=function(a,b){};D.prototype.Reset=function(a,b){this.__super.Reset.call(this,a,b)};D.prototype.Evaluate=
- function(){var a=this.m_fixtureA.GetBody(),b=this.m_fixtureB.GetBody();K.CollidePolygons(this.m_manifold,this.m_fixtureA.GetShape()instanceof d?this.m_fixtureA.GetShape():null,a.m_xf,this.m_fixtureB.GetShape()instanceof d?this.m_fixtureB.GetShape():null,b.m_xf)};x.b2PositionSolverManifold=function(){};x.prototype.b2PositionSolverManifold=function(){this.m_normal=new B;this.m_separations=new Vector_a2j_Number(z.b2_maxManifoldPoints);this.m_points=new Vector(z.b2_maxManifoldPoints);for(var a=0;a<z.b2_maxManifoldPoints;a++)this.m_points[a]=
- new B};x.prototype.Initialize=function(a){z.b2Assert(0<a.pointCount);var b=0,c=0,d=0,e,f=0,g=0;switch(a.type){case E.e_circles:e=a.bodyA.m_xf.R;d=a.localPoint;b=a.bodyA.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y);c=a.bodyA.m_xf.position.y+(e.col1.y*d.x+e.col2.y*d.y);e=a.bodyB.m_xf.R;d=a.points[0].localPoint;f=a.bodyB.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y);e=a.bodyB.m_xf.position.y+(e.col1.y*d.x+e.col2.y*d.y);var d=f-b,g=e-c,s=d*d+g*g;s>Number.MIN_VALUE*Number.MIN_VALUE?(s=Math.sqrt(s),this.m_normal.x=
- d/s,this.m_normal.y=g/s):(this.m_normal.x=1,this.m_normal.y=0);this.m_points[0].x=0.5*(b+f);this.m_points[0].y=0.5*(c+e);this.m_separations[0]=d*this.m_normal.x+g*this.m_normal.y-a.radius;break;case E.e_faceA:e=a.bodyA.m_xf.R;d=a.localPlaneNormal;this.m_normal.x=e.col1.x*d.x+e.col2.x*d.y;this.m_normal.y=e.col1.y*d.x+e.col2.y*d.y;e=a.bodyA.m_xf.R;d=a.localPoint;f=a.bodyA.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y);g=a.bodyA.m_xf.position.y+(e.col1.y*d.x+e.col2.y*d.y);e=a.bodyB.m_xf.R;for(b=0;b<a.pointCount;++b)d=
- a.points[b].localPoint,c=a.bodyB.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y),d=a.bodyB.m_xf.position.y+(e.col1.y*d.x+e.col2.y*d.y),this.m_separations[b]=(c-f)*this.m_normal.x+(d-g)*this.m_normal.y-a.radius,this.m_points[b].x=c,this.m_points[b].y=d;break;case E.e_faceB:e=a.bodyB.m_xf.R;d=a.localPlaneNormal;this.m_normal.x=e.col1.x*d.x+e.col2.x*d.y;this.m_normal.y=e.col1.y*d.x+e.col2.y*d.y;e=a.bodyB.m_xf.R;d=a.localPoint;f=a.bodyB.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y);g=a.bodyB.m_xf.position.y+
- (e.col1.y*d.x+e.col2.y*d.y);e=a.bodyA.m_xf.R;for(b=0;b<a.pointCount;++b)d=a.points[b].localPoint,c=a.bodyA.m_xf.position.x+(e.col1.x*d.x+e.col2.x*d.y),d=a.bodyA.m_xf.position.y+(e.col1.y*d.x+e.col2.y*d.y),this.m_separations[b]=(c-f)*this.m_normal.x+(d-g)*this.m_normal.y-a.radius,this.m_points[b].Set(c,d);this.m_normal.x*=-1;this.m_normal.y*=-1}};Box2D.postDefs.push(function(){Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA=new B;Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB=
- new B})})();
- (function(){var c=Box2D.Common.Math.b2Mat22,e=Box2D.Common.Math.b2Math,d=Box2D.Common.Math.b2Vec2,a=Box2D.Common.b2Color,b=Box2D.Dynamics.Controllers.b2BuoyancyController,f=Box2D.Dynamics.Controllers.b2ConstantAccelController,m=Box2D.Dynamics.Controllers.b2ConstantForceController,h=Box2D.Dynamics.Controllers.b2Controller,g=Box2D.Dynamics.Controllers.b2ControllerEdge,k=Box2D.Dynamics.Controllers.b2GravityController,l=Box2D.Dynamics.Controllers.b2TensorDampingController;Box2D.inherit(b,Box2D.Dynamics.Controllers.b2Controller);
- b.prototype.__super=Box2D.Dynamics.Controllers.b2Controller.prototype;b.b2BuoyancyController=function(){Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this,arguments);this.normal=new d(0,-1);this.density=this.offset=0;this.velocity=new d(0,0);this.linearDrag=2;this.angularDrag=1;this.useDensity=!1;this.useWorldGravity=!0;this.gravity=null};b.prototype.Step=function(a){if(this.m_bodyList){this.useWorldGravity&&(this.gravity=this.GetWorld().GetGravity().Copy());for(a=this.m_bodyList;a;a=
- a.nextBody){var b=a.body;if(!1!=b.IsAwake()){for(var c=new d,e=new d,f=0,g=0,h=b.GetFixtureList();h;h=h.GetNext()){var k=new d,m=h.GetShape().ComputeSubmergedArea(this.normal,this.offset,b.GetTransform(),k),f=f+m;c.x+=m*k.x;c.y+=m*k.y;var l=0,l=1,g=g+m*l;e.x+=m*k.x*l;e.y+=m*k.y*l}c.x/=f;c.y/=f;e.x/=g;e.y/=g;f<Number.MIN_VALUE||(g=this.gravity.GetNegative(),g.Multiply(this.density*f),b.ApplyForce(g,e),e=b.GetLinearVelocityFromWorldPoint(c),e.Subtract(this.velocity),e.Multiply(-this.linearDrag*f),b.ApplyForce(e,
- c),b.ApplyTorque(-b.GetInertia()/b.GetMass()*f*b.GetAngularVelocity()*this.angularDrag))}}}};b.prototype.Draw=function(b){var c=new d,e=new d;c.x=this.normal.x*this.offset+1E3*this.normal.y;c.y=this.normal.y*this.offset-1E3*this.normal.x;e.x=this.normal.x*this.offset-1E3*this.normal.y;e.y=this.normal.y*this.offset+1E3*this.normal.x;var f=new a(0,0,1);b.DrawSegment(c,e,f)};Box2D.inherit(f,Box2D.Dynamics.Controllers.b2Controller);f.prototype.__super=Box2D.Dynamics.Controllers.b2Controller.prototype;
- f.b2ConstantAccelController=function(){Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this,arguments);this.A=new d(0,0)};f.prototype.Step=function(a){a=new d(this.A.x*a.dt,this.A.y*a.dt);for(var b=this.m_bodyList;b;b=b.nextBody){var c=b.body;c.IsAwake()&&c.SetLinearVelocity(new d(c.GetLinearVelocity().x+a.x,c.GetLinearVelocity().y+a.y))}};Box2D.inherit(m,Box2D.Dynamics.Controllers.b2Controller);m.prototype.__super=Box2D.Dynamics.Controllers.b2Controller.prototype;m.b2ConstantForceController=
- function(){Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this,arguments);this.F=new d(0,0)};m.prototype.Step=function(a){for(a=this.m_bodyList;a;a=a.nextBody){var b=a.body;b.IsAwake()&&b.ApplyForce(this.F,b.GetWorldCenter())}};h.b2Controller=function(){};h.prototype.Step=function(a){};h.prototype.Draw=function(a){};h.prototype.AddBody=function(a){var b=new g;b.controller=this;b.body=a;b.nextBody=this.m_bodyList;b.prevBody=null;this.m_bodyList=b;b.nextBody&&(b.nextBody.prevBody=b);this.m_bodyCount++;
- b.nextController=a.m_controllerList;b.prevController=null;a.m_controllerList=b;b.nextController&&(b.nextController.prevController=b);a.m_controllerCount++};h.prototype.RemoveBody=function(a){for(var b=a.m_controllerList;b&&b.controller!=this;)b=b.nextController;b.prevBody&&(b.prevBody.nextBody=b.nextBody);b.nextBody&&(b.nextBody.prevBody=b.prevBody);b.nextController&&(b.nextController.prevController=b.prevController);b.prevController&&(b.prevController.nextController=b.nextController);this.m_bodyList==
- b&&(this.m_bodyList=b.nextBody);a.m_controllerList==b&&(a.m_controllerList=b.nextController);a.m_controllerCount--;this.m_bodyCount--};h.prototype.Clear=function(){for(;this.m_bodyList;)this.RemoveBody(this.m_bodyList.body)};h.prototype.GetNext=function(){return this.m_next};h.prototype.GetWorld=function(){return this.m_world};h.prototype.GetBodyList=function(){return this.m_bodyList};g.b2ControllerEdge=function(){};Box2D.inherit(k,Box2D.Dynamics.Controllers.b2Controller);k.prototype.__super=Box2D.Dynamics.Controllers.b2Controller.prototype;
- k.b2GravityController=function(){Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this,arguments);this.G=1;this.invSqr=!0};k.prototype.Step=function(a){var b=a=null,c=null,e=0,f=null,g=null,h=null,k=0,m=0,l=0,k=null;if(this.invSqr)for(a=this.m_bodyList;a;a=a.nextBody){b=a.body;c=b.GetWorldCenter();e=b.GetMass();for(f=this.m_bodyList;f!=a;f=f.nextBody)g=f.body,h=g.GetWorldCenter(),k=h.x-c.x,m=h.y-c.y,l=k*k+m*m,l<Number.MIN_VALUE||(k=new d(k,m),k.Multiply(this.G/l/Math.sqrt(l)*e*g.GetMass()),
- b.IsAwake()&&b.ApplyForce(k,c),k.Multiply(-1),g.IsAwake()&&g.ApplyForce(k,h))}else for(a=this.m_bodyList;a;a=a.nextBody){b=a.body;c=b.GetWorldCenter();e=b.GetMass();for(f=this.m_bodyList;f!=a;f=f.nextBody)g=f.body,h=g.GetWorldCenter(),k=h.x-c.x,m=h.y-c.y,l=k*k+m*m,l<Number.MIN_VALUE||(k=new d(k,m),k.Multiply(this.G/l*e*g.GetMass()),b.IsAwake()&&b.ApplyForce(k,c),k.Multiply(-1),g.IsAwake()&&g.ApplyForce(k,h))}};Box2D.inherit(l,Box2D.Dynamics.Controllers.b2Controller);l.prototype.__super=Box2D.Dynamics.Controllers.b2Controller.prototype;
- l.b2TensorDampingController=function(){Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this,arguments);this.T=new c;this.maxTimestep=0};l.prototype.SetAxisAligned=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.T.col1.x=-a;this.T.col1.y=0;this.T.col2.x=0;this.T.col2.y=-b;this.maxTimestep=0<a||0<b?1/Math.max(a,b):0};l.prototype.Step=function(a){a=a.dt;if(!(a<=Number.MIN_VALUE)){a>this.maxTimestep&&0<this.maxTimestep&&(a=this.maxTimestep);for(var b=this.m_bodyList;b;b=b.nextBody){var c=
- b.body;if(c.IsAwake()){var f=c.GetWorldVector(e.MulMV(this.T,c.GetLocalVector(c.GetLinearVelocity())));c.SetLinearVelocity(new d(c.GetLinearVelocity().x+f.x*a,c.GetLinearVelocity().y+f.y*a))}}}}})();
- (function(){var c=Box2D.Common.b2Settings,e=Box2D.Common.Math.b2Mat22,d=Box2D.Common.Math.b2Mat33,a=Box2D.Common.Math.b2Math,b=Box2D.Common.Math.b2Vec2,f=Box2D.Common.Math.b2Vec3,m=Box2D.Dynamics.Joints.b2DistanceJoint,h=Box2D.Dynamics.Joints.b2DistanceJointDef,g=Box2D.Dynamics.Joints.b2FrictionJoint,k=Box2D.Dynamics.Joints.b2FrictionJointDef,l=Box2D.Dynamics.Joints.b2GearJoint,n=Box2D.Dynamics.Joints.b2GearJointDef,p=Box2D.Dynamics.Joints.b2Jacobian,q=Box2D.Dynamics.Joints.b2Joint,v=Box2D.Dynamics.Joints.b2JointDef,
- F=Box2D.Dynamics.Joints.b2JointEdge,r=Box2D.Dynamics.Joints.b2LineJoint,D=Box2D.Dynamics.Joints.b2LineJointDef,x=Box2D.Dynamics.Joints.b2MouseJoint,C=Box2D.Dynamics.Joints.b2MouseJointDef,A=Box2D.Dynamics.Joints.b2PrismaticJoint,z=Box2D.Dynamics.Joints.b2PrismaticJointDef,u=Box2D.Dynamics.Joints.b2PulleyJoint,J=Box2D.Dynamics.Joints.b2PulleyJointDef,B=Box2D.Dynamics.Joints.b2RevoluteJoint,K=Box2D.Dynamics.Joints.b2RevoluteJointDef,I=Box2D.Dynamics.Joints.b2WeldJoint,E=Box2D.Dynamics.Joints.b2WeldJointDef;
- Box2D.inherit(m,Box2D.Dynamics.Joints.b2Joint);m.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;m.b2DistanceJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_u=new b};m.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};m.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};m.prototype.GetReactionForce=function(a){void 0===a&&(a=0);
- return new b(a*this.m_impulse*this.m_u.x,a*this.m_impulse*this.m_u.y)};m.prototype.GetReactionTorque=function(a){return 0};m.prototype.GetLength=function(){return this.m_length};m.prototype.SetLength=function(a){void 0===a&&(a=0);this.m_length=a};m.prototype.GetFrequency=function(){return this.m_frequencyHz};m.prototype.SetFrequency=function(a){void 0===a&&(a=0);this.m_frequencyHz=a};m.prototype.GetDampingRatio=function(){return this.m_dampingRatio};m.prototype.SetDampingRatio=function(a){void 0===
- a&&(a=0);this.m_dampingRatio=a};m.prototype.b2DistanceJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchor1.SetV(a.localAnchorA);this.m_localAnchor2.SetV(a.localAnchorB);this.m_length=a.length;this.m_frequencyHz=a.frequencyHz;this.m_dampingRatio=a.dampingRatio;this.m_bias=this.m_gamma=this.m_impulse=0};m.prototype.InitVelocityConstraints=function(a){var b,d=0,e=this.m_bodyA,f=this.m_bodyB;b=e.m_xf.R;var g=this.m_localAnchor1.x-e.m_sweep.localCenter.x,h=this.m_localAnchor1.y-e.m_sweep.localCenter.y,
- d=b.col1.x*g+b.col2.x*h,h=b.col1.y*g+b.col2.y*h,g=d;b=f.m_xf.R;var k=this.m_localAnchor2.x-f.m_sweep.localCenter.x,m=this.m_localAnchor2.y-f.m_sweep.localCenter.y,d=b.col1.x*k+b.col2.x*m,m=b.col1.y*k+b.col2.y*m,k=d;this.m_u.x=f.m_sweep.c.x+k-e.m_sweep.c.x-g;this.m_u.y=f.m_sweep.c.y+m-e.m_sweep.c.y-h;d=Math.sqrt(this.m_u.x*this.m_u.x+this.m_u.y*this.m_u.y);d>c.b2_linearSlop?this.m_u.Multiply(1/d):this.m_u.SetZero();b=g*this.m_u.y-h*this.m_u.x;var l=k*this.m_u.y-m*this.m_u.x;b=e.m_invMass+e.m_invI*
- b*b+f.m_invMass+f.m_invI*l*l;this.m_mass=0!=b?1/b:0;if(0<this.m_frequencyHz){var d=d-this.m_length,l=2*Math.PI*this.m_frequencyHz,n=this.m_mass*l*l;this.m_gamma=a.dt*(2*this.m_mass*this.m_dampingRatio*l+a.dt*n);this.m_gamma=0!=this.m_gamma?1/this.m_gamma:0;this.m_bias=d*a.dt*n*this.m_gamma;this.m_mass=b+this.m_gamma;this.m_mass=0!=this.m_mass?1/this.m_mass:0}a.warmStarting?(this.m_impulse*=a.dtRatio,a=this.m_impulse*this.m_u.x,b=this.m_impulse*this.m_u.y,e.m_linearVelocity.x-=e.m_invMass*a,e.m_linearVelocity.y-=
- e.m_invMass*b,e.m_angularVelocity-=e.m_invI*(g*b-h*a),f.m_linearVelocity.x+=f.m_invMass*a,f.m_linearVelocity.y+=f.m_invMass*b,f.m_angularVelocity+=f.m_invI*(k*b-m*a)):this.m_impulse=0};m.prototype.SolveVelocityConstraints=function(a){var b;a=this.m_bodyA;var c=this.m_bodyB;b=a.m_xf.R;var d=this.m_localAnchor1.x-a.m_sweep.localCenter.x,e=this.m_localAnchor1.y-a.m_sweep.localCenter.y,f=b.col1.x*d+b.col2.x*e,e=b.col1.y*d+b.col2.y*e,d=f;b=c.m_xf.R;var g=this.m_localAnchor2.x-c.m_sweep.localCenter.x,h=
- this.m_localAnchor2.y-c.m_sweep.localCenter.y,f=b.col1.x*g+b.col2.x*h,h=b.col1.y*g+b.col2.y*h,g=f,f=-this.m_mass*(this.m_u.x*(c.m_linearVelocity.x+-c.m_angularVelocity*h-(a.m_linearVelocity.x+-a.m_angularVelocity*e))+this.m_u.y*(c.m_linearVelocity.y+c.m_angularVelocity*g-(a.m_linearVelocity.y+a.m_angularVelocity*d))+this.m_bias+this.m_gamma*this.m_impulse);this.m_impulse+=f;b=f*this.m_u.x;f*=this.m_u.y;a.m_linearVelocity.x-=a.m_invMass*b;a.m_linearVelocity.y-=a.m_invMass*f;a.m_angularVelocity-=a.m_invI*
- (d*f-e*b);c.m_linearVelocity.x+=c.m_invMass*b;c.m_linearVelocity.y+=c.m_invMass*f;c.m_angularVelocity+=c.m_invI*(g*f-h*b)};m.prototype.SolvePositionConstraints=function(b){var d;if(0<this.m_frequencyHz)return!0;b=this.m_bodyA;var e=this.m_bodyB;d=b.m_xf.R;var f=this.m_localAnchor1.x-b.m_sweep.localCenter.x,g=this.m_localAnchor1.y-b.m_sweep.localCenter.y,h=d.col1.x*f+d.col2.x*g,g=d.col1.y*f+d.col2.y*g,f=h;d=e.m_xf.R;var k=this.m_localAnchor2.x-e.m_sweep.localCenter.x,m=this.m_localAnchor2.y-e.m_sweep.localCenter.y,
- h=d.col1.x*k+d.col2.x*m,m=d.col1.y*k+d.col2.y*m,k=h,h=e.m_sweep.c.x+k-b.m_sweep.c.x-f,l=e.m_sweep.c.y+m-b.m_sweep.c.y-g;d=Math.sqrt(h*h+l*l);h/=d;l/=d;d-=this.m_length;d=a.Clamp(d,-c.b2_maxLinearCorrection,c.b2_maxLinearCorrection);var n=-this.m_mass*d;this.m_u.Set(h,l);h=n*this.m_u.x;l=n*this.m_u.y;b.m_sweep.c.x-=b.m_invMass*h;b.m_sweep.c.y-=b.m_invMass*l;b.m_sweep.a-=b.m_invI*(f*l-g*h);e.m_sweep.c.x+=e.m_invMass*h;e.m_sweep.c.y+=e.m_invMass*l;e.m_sweep.a+=e.m_invI*(k*l-m*h);b.SynchronizeTransform();
- e.SynchronizeTransform();return a.Abs(d)<c.b2_linearSlop};Box2D.inherit(h,Box2D.Dynamics.Joints.b2JointDef);h.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;h.b2DistanceJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB=new b};h.prototype.b2DistanceJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_distanceJoint;this.length=1;this.dampingRatio=this.frequencyHz=0};h.prototype.Initialize=function(a,
- b,c,d){this.bodyA=a;this.bodyB=b;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(c));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(d));a=d.x-c.x;c=d.y-c.y;this.length=Math.sqrt(a*a+c*c);this.dampingRatio=this.frequencyHz=0};Box2D.inherit(g,Box2D.Dynamics.Joints.b2Joint);g.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;g.b2FrictionJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchorA=new b;this.m_localAnchorB=new b;this.m_linearMass=new e;this.m_linearImpulse=
- new b};g.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)};g.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)};g.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*this.m_linearImpulse.x,a*this.m_linearImpulse.y)};g.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_angularImpulse};g.prototype.SetMaxForce=function(a){void 0===a&&(a=0);this.m_maxForce=a};g.prototype.GetMaxForce=function(){return this.m_maxForce};
- g.prototype.SetMaxTorque=function(a){void 0===a&&(a=0);this.m_maxTorque=a};g.prototype.GetMaxTorque=function(){return this.m_maxTorque};g.prototype.b2FrictionJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchorA.SetV(a.localAnchorA);this.m_localAnchorB.SetV(a.localAnchorB);this.m_linearMass.SetZero();this.m_angularMass=0;this.m_linearImpulse.SetZero();this.m_angularImpulse=0;this.m_maxForce=a.maxForce;this.m_maxTorque=a.maxTorque};g.prototype.InitVelocityConstraints=function(a){var b,
- c=0,d=this.m_bodyA,f=this.m_bodyB;b=d.m_xf.R;var g=this.m_localAnchorA.x-d.m_sweep.localCenter.x,h=this.m_localAnchorA.y-d.m_sweep.localCenter.y,c=b.col1.x*g+b.col2.x*h,h=b.col1.y*g+b.col2.y*h,g=c;b=f.m_xf.R;var k=this.m_localAnchorB.x-f.m_sweep.localCenter.x,m=this.m_localAnchorB.y-f.m_sweep.localCenter.y,c=b.col1.x*k+b.col2.x*m,m=b.col1.y*k+b.col2.y*m,k=c;b=d.m_invMass;var c=f.m_invMass,l=d.m_invI,n=f.m_invI,q=new e;q.col1.x=b+c;q.col2.x=0;q.col1.y=0;q.col2.y=b+c;q.col1.x+=l*h*h;q.col2.x+=-l*g*
- h;q.col1.y+=-l*g*h;q.col2.y+=l*g*g;q.col1.x+=n*m*m;q.col2.x+=-n*k*m;q.col1.y+=-n*k*m;q.col2.y+=n*k*k;q.GetInverse(this.m_linearMass);this.m_angularMass=l+n;0<this.m_angularMass&&(this.m_angularMass=1/this.m_angularMass);a.warmStarting?(this.m_linearImpulse.x*=a.dtRatio,this.m_linearImpulse.y*=a.dtRatio,this.m_angularImpulse*=a.dtRatio,a=this.m_linearImpulse,d.m_linearVelocity.x-=b*a.x,d.m_linearVelocity.y-=b*a.y,d.m_angularVelocity-=l*(g*a.y-h*a.x+this.m_angularImpulse),f.m_linearVelocity.x+=c*a.x,
- f.m_linearVelocity.y+=c*a.y,f.m_angularVelocity+=n*(k*a.y-m*a.x+this.m_angularImpulse)):(this.m_linearImpulse.SetZero(),this.m_angularImpulse=0)};g.prototype.SolveVelocityConstraints=function(c){var d,e=0,f=this.m_bodyA,g=this.m_bodyB,h=f.m_linearVelocity,k=f.m_angularVelocity,m=g.m_linearVelocity,l=g.m_angularVelocity,n=f.m_invMass,q=g.m_invMass,p=f.m_invI,r=g.m_invI;d=f.m_xf.R;var v=this.m_localAnchorA.x-f.m_sweep.localCenter.x,u=this.m_localAnchorA.y-f.m_sweep.localCenter.y,e=d.col1.x*v+d.col2.x*
- u,u=d.col1.y*v+d.col2.y*u,v=e;d=g.m_xf.R;var x=this.m_localAnchorB.x-g.m_sweep.localCenter.x,z=this.m_localAnchorB.y-g.m_sweep.localCenter.y,e=d.col1.x*x+d.col2.x*z,z=d.col1.y*x+d.col2.y*z,x=e;d=0;var e=-this.m_angularMass*(l-k),A=this.m_angularImpulse;d=c.dt*this.m_maxTorque;this.m_angularImpulse=a.Clamp(this.m_angularImpulse+e,-d,d);e=this.m_angularImpulse-A;k-=p*e;l+=r*e;d=a.MulMV(this.m_linearMass,new b(-(m.x-l*z-h.x+k*u),-(m.y+l*x-h.y-k*v)));e=this.m_linearImpulse.Copy();this.m_linearImpulse.Add(d);
- d=c.dt*this.m_maxForce;this.m_linearImpulse.LengthSquared()>d*d&&(this.m_linearImpulse.Normalize(),this.m_linearImpulse.Multiply(d));d=a.SubtractVV(this.m_linearImpulse,e);h.x-=n*d.x;h.y-=n*d.y;k-=p*(v*d.y-u*d.x);m.x+=q*d.x;m.y+=q*d.y;l+=r*(x*d.y-z*d.x);f.m_angularVelocity=k;g.m_angularVelocity=l};g.prototype.SolvePositionConstraints=function(a){return!0};Box2D.inherit(k,Box2D.Dynamics.Joints.b2JointDef);k.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;k.b2FrictionJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,
- arguments);this.localAnchorA=new b;this.localAnchorB=new b};k.prototype.b2FrictionJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_frictionJoint;this.maxTorque=this.maxForce=0};k.prototype.Initialize=function(a,b,c){this.bodyA=a;this.bodyB=b;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(c));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(c))};Box2D.inherit(l,Box2D.Dynamics.Joints.b2Joint);l.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;l.b2GearJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,
- arguments);this.m_groundAnchor1=new b;this.m_groundAnchor2=new b;this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_J=new p};l.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};l.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};l.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*this.m_impulse*this.m_J.linearB.x,a*this.m_impulse*this.m_J.linearB.y)};l.prototype.GetReactionTorque=function(a){void 0===
- a&&(a=0);var b=this.m_bodyB.m_xf.R,c=this.m_localAnchor1.x-this.m_bodyB.m_sweep.localCenter.x,d=this.m_localAnchor1.y-this.m_bodyB.m_sweep.localCenter.y,e=b.col1.x*c+b.col2.x*d,d=b.col1.y*c+b.col2.y*d;return a*(this.m_impulse*this.m_J.angularB-e*this.m_impulse*this.m_J.linearB.y+d*this.m_impulse*this.m_J.linearB.x)};l.prototype.GetRatio=function(){return this.m_ratio};l.prototype.SetRatio=function(a){void 0===a&&(a=0);this.m_ratio=a};l.prototype.b2GearJoint=function(a){this.__super.b2Joint.call(this,
- a);var b=parseInt(a.joint1.m_type),c=parseInt(a.joint2.m_type);this.m_prismatic2=this.m_revolute2=this.m_prismatic1=this.m_revolute1=null;var d=0,e=0;this.m_ground1=a.joint1.GetBodyA();this.m_bodyA=a.joint1.GetBodyB();b==q.e_revoluteJoint?(this.m_revolute1=a.joint1 instanceof B?a.joint1:null,this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1),this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2),d=this.m_revolute1.GetJointAngle()):(this.m_prismatic1=a.joint1 instanceof A?a.joint1:null,
- this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1),this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2),d=this.m_prismatic1.GetJointTranslation());this.m_ground2=a.joint2.GetBodyA();this.m_bodyB=a.joint2.GetBodyB();c==q.e_revoluteJoint?(this.m_revolute2=a.joint2 instanceof B?a.joint2:null,this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1),this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2),e=this.m_revolute2.GetJointAngle()):(this.m_prismatic2=a.joint2 instanceof A?a.joint2:
- null,this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1),this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2),e=this.m_prismatic2.GetJointTranslation());this.m_ratio=a.ratio;this.m_constant=d+this.m_ratio*e;this.m_impulse=0};l.prototype.InitVelocityConstraints=function(a){var b=this.m_ground1,c=this.m_ground2,d=this.m_bodyA,e=this.m_bodyB,f=0,g=0,h=0,k=0,m=h=0,l=0;this.m_J.SetZero();this.m_revolute1?(this.m_J.angularA=-1,l+=d.m_invI):(b=b.m_xf.R,g=this.m_prismatic1.m_localXAxis1,f=b.col1.x*
- g.x+b.col2.x*g.y,g=b.col1.y*g.x+b.col2.y*g.y,b=d.m_xf.R,h=this.m_localAnchor1.x-d.m_sweep.localCenter.x,k=this.m_localAnchor1.y-d.m_sweep.localCenter.y,m=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=m*g-k*f,this.m_J.linearA.Set(-f,-g),this.m_J.angularA=-h,l+=d.m_invMass+d.m_invI*h*h);this.m_revolute2?(this.m_J.angularB=-this.m_ratio,l+=this.m_ratio*this.m_ratio*e.m_invI):(b=c.m_xf.R,g=this.m_prismatic2.m_localXAxis1,f=b.col1.x*g.x+b.col2.x*g.y,g=b.col1.y*g.x+b.col2.y*g.y,b=e.m_xf.R,h=this.m_localAnchor2.x-
- e.m_sweep.localCenter.x,k=this.m_localAnchor2.y-e.m_sweep.localCenter.y,m=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=m*g-k*f,this.m_J.linearB.Set(-this.m_ratio*f,-this.m_ratio*g),this.m_J.angularB=-this.m_ratio*h,l+=this.m_ratio*this.m_ratio*(e.m_invMass+e.m_invI*h*h));this.m_mass=0<l?1/l:0;a.warmStarting?(d.m_linearVelocity.x+=d.m_invMass*this.m_impulse*this.m_J.linearA.x,d.m_linearVelocity.y+=d.m_invMass*this.m_impulse*this.m_J.linearA.y,d.m_angularVelocity+=d.m_invI*this.m_impulse*this.m_J.angularA,
- e.m_linearVelocity.x+=e.m_invMass*this.m_impulse*this.m_J.linearB.x,e.m_linearVelocity.y+=e.m_invMass*this.m_impulse*this.m_J.linearB.y,e.m_angularVelocity+=e.m_invI*this.m_impulse*this.m_J.angularB):this.m_impulse=0};l.prototype.SolveVelocityConstraints=function(a){a=this.m_bodyA;var b=this.m_bodyB,c=this.m_J.Compute(a.m_linearVelocity,a.m_angularVelocity,b.m_linearVelocity,b.m_angularVelocity),c=-this.m_mass*c;this.m_impulse+=c;a.m_linearVelocity.x+=a.m_invMass*c*this.m_J.linearA.x;a.m_linearVelocity.y+=
- a.m_invMass*c*this.m_J.linearA.y;a.m_angularVelocity+=a.m_invI*c*this.m_J.angularA;b.m_linearVelocity.x+=b.m_invMass*c*this.m_J.linearB.x;b.m_linearVelocity.y+=b.m_invMass*c*this.m_J.linearB.y;b.m_angularVelocity+=b.m_invI*c*this.m_J.angularB};l.prototype.SolvePositionConstraints=function(a){a=this.m_bodyA;var b=this.m_bodyB,d=0,e=0,d=this.m_revolute1?this.m_revolute1.GetJointAngle():this.m_prismatic1.GetJointTranslation(),e=this.m_revolute2?this.m_revolute2.GetJointAngle():this.m_prismatic2.GetJointTranslation(),
- d=-this.m_mass*(this.m_constant-(d+this.m_ratio*e));a.m_sweep.c.x+=a.m_invMass*d*this.m_J.linearA.x;a.m_sweep.c.y+=a.m_invMass*d*this.m_J.linearA.y;a.m_sweep.a+=a.m_invI*d*this.m_J.angularA;b.m_sweep.c.x+=b.m_invMass*d*this.m_J.linearB.x;b.m_sweep.c.y+=b.m_invMass*d*this.m_J.linearB.y;b.m_sweep.a+=b.m_invI*d*this.m_J.angularB;a.SynchronizeTransform();b.SynchronizeTransform();return 0<c.b2_linearSlop};Box2D.inherit(n,Box2D.Dynamics.Joints.b2JointDef);n.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;
- n.b2GearJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments)};n.prototype.b2GearJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_gearJoint;this.joint2=this.joint1=null;this.ratio=1};p.b2Jacobian=function(){this.linearA=new b;this.linearB=new b};p.prototype.SetZero=function(){this.linearA.SetZero();this.angularA=0;this.linearB.SetZero();this.angularB=0};p.prototype.Set=function(a,b,c,d){void 0===b&&(b=0);void 0===d&&(d=0);this.linearA.SetV(a);this.angularA=
- b;this.linearB.SetV(c);this.angularB=d};p.prototype.Compute=function(a,b,c,d){void 0===b&&(b=0);void 0===d&&(d=0);return this.linearA.x*a.x+this.linearA.y*a.y+this.angularA*b+(this.linearB.x*c.x+this.linearB.y*c.y)+this.angularB*d};q.b2Joint=function(){this.m_edgeA=new F;this.m_edgeB=new F;this.m_localCenterA=new b;this.m_localCenterB=new b};q.prototype.GetType=function(){return this.m_type};q.prototype.GetAnchorA=function(){return null};q.prototype.GetAnchorB=function(){return null};q.prototype.GetReactionForce=
- function(a){return null};q.prototype.GetReactionTorque=function(a){return 0};q.prototype.GetBodyA=function(){return this.m_bodyA};q.prototype.GetBodyB=function(){return this.m_bodyB};q.prototype.GetNext=function(){return this.m_next};q.prototype.GetUserData=function(){return this.m_userData};q.prototype.SetUserData=function(a){this.m_userData=a};q.prototype.IsActive=function(){return this.m_bodyA.IsActive()&&this.m_bodyB.IsActive()};q.Create=function(a,b){var c=null;switch(a.type){case q.e_distanceJoint:c=
- new m(a instanceof h?a:null);break;case q.e_mouseJoint:c=new x(a instanceof C?a:null);break;case q.e_prismaticJoint:c=new A(a instanceof z?a:null);break;case q.e_revoluteJoint:c=new B(a instanceof K?a:null);break;case q.e_pulleyJoint:c=new u(a instanceof J?a:null);break;case q.e_gearJoint:c=new l(a instanceof n?a:null);break;case q.e_lineJoint:c=new r(a instanceof D?a:null);break;case q.e_weldJoint:c=new I(a instanceof E?a:null);break;case q.e_frictionJoint:c=new g(a instanceof k?a:null)}return c};
- q.Destroy=function(a,b){};q.prototype.b2Joint=function(a){c.b2Assert(a.bodyA!=a.bodyB);this.m_type=a.type;this.m_next=this.m_prev=null;this.m_bodyA=a.bodyA;this.m_bodyB=a.bodyB;this.m_collideConnected=a.collideConnected;this.m_islandFlag=!1;this.m_userData=a.userData};q.prototype.InitVelocityConstraints=function(a){};q.prototype.SolveVelocityConstraints=function(a){};q.prototype.FinalizeVelocityConstraints=function(){};q.prototype.SolvePositionConstraints=function(a){return!1};Box2D.postDefs.push(function(){Box2D.Dynamics.Joints.b2Joint.e_unknownJoint=
- 0;Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint=1;Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint=2;Box2D.Dynamics.Joints.b2Joint.e_distanceJoint=3;Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint=4;Box2D.Dynamics.Joints.b2Joint.e_mouseJoint=5;Box2D.Dynamics.Joints.b2Joint.e_gearJoint=6;Box2D.Dynamics.Joints.b2Joint.e_lineJoint=7;Box2D.Dynamics.Joints.b2Joint.e_weldJoint=8;Box2D.Dynamics.Joints.b2Joint.e_frictionJoint=9;Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit=0;Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit=
- 1;Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit=2;Box2D.Dynamics.Joints.b2Joint.e_equalLimits=3});v.b2JointDef=function(){};v.prototype.b2JointDef=function(){this.type=q.e_unknownJoint;this.bodyB=this.bodyA=this.userData=null;this.collideConnected=!1};F.b2JointEdge=function(){};Box2D.inherit(r,Box2D.Dynamics.Joints.b2Joint);r.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;r.b2LineJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchor1=new b;this.m_localAnchor2=
- new b;this.m_localXAxis1=new b;this.m_localYAxis1=new b;this.m_axis=new b;this.m_perp=new b;this.m_K=new e;this.m_impulse=new b};r.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};r.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};r.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*(this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.x),a*(this.m_impulse.x*this.m_perp.y+
- (this.m_motorImpulse+this.m_impulse.y)*this.m_axis.y))};r.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_impulse.y};r.prototype.GetJointTranslation=function(){var a=this.m_bodyA,b=this.m_bodyB,c=a.GetWorldPoint(this.m_localAnchor1),d=b.GetWorldPoint(this.m_localAnchor2),b=d.x-c.x,c=d.y-c.y,a=a.GetWorldVector(this.m_localXAxis1);return a.x*b+a.y*c};r.prototype.GetJointSpeed=function(){var a=this.m_bodyA,b=this.m_bodyB,c;c=a.m_xf.R;var d=this.m_localAnchor1.x-a.m_sweep.localCenter.x,
- e=this.m_localAnchor1.y-a.m_sweep.localCenter.y,f=c.col1.x*d+c.col2.x*e,e=c.col1.y*d+c.col2.y*e,d=f;c=b.m_xf.R;var g=this.m_localAnchor2.x-b.m_sweep.localCenter.x,h=this.m_localAnchor2.y-b.m_sweep.localCenter.y,f=c.col1.x*g+c.col2.x*h,h=c.col1.y*g+c.col2.y*h,g=f;c=b.m_sweep.c.x+g-(a.m_sweep.c.x+d);var f=b.m_sweep.c.y+h-(a.m_sweep.c.y+e),k=a.GetWorldVector(this.m_localXAxis1),m=a.m_linearVelocity,l=b.m_linearVelocity,a=a.m_angularVelocity,b=b.m_angularVelocity;return c*-a*k.y+f*a*k.x+(k.x*(l.x+-b*
- h-m.x- -a*e)+k.y*(l.y+b*g-m.y-a*d))};r.prototype.IsLimitEnabled=function(){return this.m_enableLimit};r.prototype.EnableLimit=function(a){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_enableLimit=a};r.prototype.GetLowerLimit=function(){return this.m_lowerTranslation};r.prototype.GetUpperLimit=function(){return this.m_upperTranslation};r.prototype.SetLimits=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_lowerTranslation=a;this.m_upperTranslation=
- b};r.prototype.IsMotorEnabled=function(){return this.m_enableMotor};r.prototype.EnableMotor=function(a){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_enableMotor=a};r.prototype.SetMotorSpeed=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_motorSpeed=a};r.prototype.GetMotorSpeed=function(){return this.m_motorSpeed};r.prototype.SetMaxMotorForce=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_maxMotorForce=
- a};r.prototype.GetMaxMotorForce=function(){return this.m_maxMotorForce};r.prototype.GetMotorForce=function(){return this.m_motorImpulse};r.prototype.b2LineJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchor1.SetV(a.localAnchorA);this.m_localAnchor2.SetV(a.localAnchorB);this.m_localXAxis1.SetV(a.localAxisA);this.m_localYAxis1.x=-this.m_localXAxis1.y;this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_impulse.SetZero();this.m_motorImpulse=this.m_motorMass=0;this.m_lowerTranslation=a.lowerTranslation;
- this.m_upperTranslation=a.upperTranslation;this.m_maxMotorForce=a.maxMotorForce;this.m_motorSpeed=a.motorSpeed;this.m_enableLimit=a.enableLimit;this.m_enableMotor=a.enableMotor;this.m_limitState=q.e_inactiveLimit;this.m_axis.SetZero();this.m_perp.SetZero()};r.prototype.InitVelocityConstraints=function(b){var d=this.m_bodyA,e=this.m_bodyB,f,g=0;this.m_localCenterA.SetV(d.GetLocalCenter());this.m_localCenterB.SetV(e.GetLocalCenter());var h=d.GetTransform();e.GetTransform();f=d.m_xf.R;var k=this.m_localAnchor1.x-
- this.m_localCenterA.x,m=this.m_localAnchor1.y-this.m_localCenterA.y,g=f.col1.x*k+f.col2.x*m,m=f.col1.y*k+f.col2.y*m,k=g;f=e.m_xf.R;var l=this.m_localAnchor2.x-this.m_localCenterB.x,n=this.m_localAnchor2.y-this.m_localCenterB.y,g=f.col1.x*l+f.col2.x*n,n=f.col1.y*l+f.col2.y*n,l=g;f=e.m_sweep.c.x+l-d.m_sweep.c.x-k;g=e.m_sweep.c.y+n-d.m_sweep.c.y-m;this.m_invMassA=d.m_invMass;this.m_invMassB=e.m_invMass;this.m_invIA=d.m_invI;this.m_invIB=e.m_invI;this.m_axis.SetV(a.MulMV(h.R,this.m_localXAxis1));this.m_a1=
- (f+k)*this.m_axis.y-(g+m)*this.m_axis.x;this.m_a2=l*this.m_axis.y-n*this.m_axis.x;this.m_motorMass=this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_a1*this.m_a1+this.m_invIB*this.m_a2*this.m_a2;this.m_motorMass=this.m_motorMass>Number.MIN_VALUE?1/this.m_motorMass:0;this.m_perp.SetV(a.MulMV(h.R,this.m_localYAxis1));this.m_s1=(f+k)*this.m_perp.y-(g+m)*this.m_perp.x;this.m_s2=l*this.m_perp.y-n*this.m_perp.x;h=this.m_invMassA;k=this.m_invMassB;m=this.m_invIA;l=this.m_invIB;this.m_K.col1.x=h+k+m*this.m_s1*
- this.m_s1+l*this.m_s2*this.m_s2;this.m_K.col1.y=m*this.m_s1*this.m_a1+l*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=h+k+m*this.m_a1*this.m_a1+l*this.m_a2*this.m_a2;this.m_enableLimit?(f=this.m_axis.x*f+this.m_axis.y*g,a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?this.m_limitState=q.e_equalLimits:f<=this.m_lowerTranslation?this.m_limitState!=q.e_atLowerLimit&&(this.m_limitState=q.e_atLowerLimit,this.m_impulse.y=0):f>=this.m_upperTranslation?this.m_limitState!=
- q.e_atUpperLimit&&(this.m_limitState=q.e_atUpperLimit,this.m_impulse.y=0):(this.m_limitState=q.e_inactiveLimit,this.m_impulse.y=0)):this.m_limitState=q.e_inactiveLimit;!1==this.m_enableMotor&&(this.m_motorImpulse=0);b.warmStarting?(this.m_impulse.x*=b.dtRatio,this.m_impulse.y*=b.dtRatio,this.m_motorImpulse*=b.dtRatio,b=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.x,f=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.y,g=this.m_impulse.x*
- this.m_s1+(this.m_motorImpulse+this.m_impulse.y)*this.m_a1,h=this.m_impulse.x*this.m_s2+(this.m_motorImpulse+this.m_impulse.y)*this.m_a2,d.m_linearVelocity.x-=this.m_invMassA*b,d.m_linearVelocity.y-=this.m_invMassA*f,d.m_angularVelocity-=this.m_invIA*g,e.m_linearVelocity.x+=this.m_invMassB*b,e.m_linearVelocity.y+=this.m_invMassB*f,e.m_angularVelocity+=this.m_invIB*h):(this.m_impulse.SetZero(),this.m_motorImpulse=0)};r.prototype.SolveVelocityConstraints=function(c){var d=this.m_bodyA,e=this.m_bodyB,
- f=d.m_linearVelocity,g=d.m_angularVelocity,h=e.m_linearVelocity,k=e.m_angularVelocity,m=0,l=0,n=0,p=0;this.m_enableMotor&&this.m_limitState!=q.e_equalLimits&&(p=this.m_motorMass*(this.m_motorSpeed-(this.m_axis.x*(h.x-f.x)+this.m_axis.y*(h.y-f.y)+this.m_a2*k-this.m_a1*g)),m=this.m_motorImpulse,l=c.dt*this.m_maxMotorForce,this.m_motorImpulse=a.Clamp(this.m_motorImpulse+p,-l,l),p=this.m_motorImpulse-m,m=p*this.m_axis.x,l=p*this.m_axis.y,n=p*this.m_a1,p*=this.m_a2,f.x-=this.m_invMassA*m,f.y-=this.m_invMassA*
- l,g-=this.m_invIA*n,h.x+=this.m_invMassB*m,h.y+=this.m_invMassB*l,k+=this.m_invIB*p);l=this.m_perp.x*(h.x-f.x)+this.m_perp.y*(h.y-f.y)+this.m_s2*k-this.m_s1*g;this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit?(n=this.m_axis.x*(h.x-f.x)+this.m_axis.y*(h.y-f.y)+this.m_a2*k-this.m_a1*g,m=this.m_impulse.Copy(),c=this.m_K.Solve(new b,-l,-n),this.m_impulse.Add(c),this.m_limitState==q.e_atLowerLimit?this.m_impulse.y=a.Max(this.m_impulse.y,0):this.m_limitState==q.e_atUpperLimit&&(this.m_impulse.y=
- a.Min(this.m_impulse.y,0)),l=-l-(this.m_impulse.y-m.y)*this.m_K.col2.x,n=0,n=0!=this.m_K.col1.x?l/this.m_K.col1.x+m.x:m.x,this.m_impulse.x=n,c.x=this.m_impulse.x-m.x,c.y=this.m_impulse.y-m.y,m=c.x*this.m_perp.x+c.y*this.m_axis.x,l=c.x*this.m_perp.y+c.y*this.m_axis.y,n=c.x*this.m_s1+c.y*this.m_a1,p=c.x*this.m_s2+c.y*this.m_a2):(c=0,c=0!=this.m_K.col1.x?-l/this.m_K.col1.x:0,this.m_impulse.x+=c,m=c*this.m_perp.x,l=c*this.m_perp.y,n=c*this.m_s1,p=c*this.m_s2);f.x-=this.m_invMassA*m;f.y-=this.m_invMassA*
- l;g-=this.m_invIA*n;h.x+=this.m_invMassB*m;h.y+=this.m_invMassB*l;k+=this.m_invIB*p;d.m_linearVelocity.SetV(f);d.m_angularVelocity=g;e.m_linearVelocity.SetV(h);e.m_angularVelocity=k};r.prototype.SolvePositionConstraints=function(d){d=this.m_bodyA;var f=this.m_bodyB,g=d.m_sweep.c,h=d.m_sweep.a,k=f.m_sweep.c,m=f.m_sweep.a,l,t=0,n=0,q=0,p=0,r=l=0,v=0,n=!1,u=0,x=e.FromAngle(h),q=e.FromAngle(m);l=x;var v=this.m_localAnchor1.x-this.m_localCenterA.x,z=this.m_localAnchor1.y-this.m_localCenterA.y,t=l.col1.x*
- v+l.col2.x*z,z=l.col1.y*v+l.col2.y*z,v=t;l=q;q=this.m_localAnchor2.x-this.m_localCenterB.x;p=this.m_localAnchor2.y-this.m_localCenterB.y;t=l.col1.x*q+l.col2.x*p;p=l.col1.y*q+l.col2.y*p;q=t;l=k.x+q-g.x-v;t=k.y+p-g.y-z;if(this.m_enableLimit){this.m_axis=a.MulMV(x,this.m_localXAxis1);this.m_a1=(l+v)*this.m_axis.y-(t+z)*this.m_axis.x;this.m_a2=q*this.m_axis.y-p*this.m_axis.x;var A=this.m_axis.x*l+this.m_axis.y*t;a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?(u=a.Clamp(A,-c.b2_maxLinearCorrection,
- c.b2_maxLinearCorrection),r=a.Abs(A),n=!0):A<=this.m_lowerTranslation?(u=a.Clamp(A-this.m_lowerTranslation+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),r=this.m_lowerTranslation-A,n=!0):A>=this.m_upperTranslation&&(u=a.Clamp(A-this.m_upperTranslation+c.b2_linearSlop,0,c.b2_maxLinearCorrection),r=A-this.m_upperTranslation,n=!0)}this.m_perp=a.MulMV(x,this.m_localYAxis1);this.m_s1=(l+v)*this.m_perp.y-(t+z)*this.m_perp.x;this.m_s2=q*this.m_perp.y-p*this.m_perp.x;x=new b;z=this.m_perp.x*l+this.m_perp.y*
- t;r=a.Max(r,a.Abs(z));v=0;n?(n=this.m_invMassA,q=this.m_invMassB,p=this.m_invIA,l=this.m_invIB,this.m_K.col1.x=n+q+p*this.m_s1*this.m_s1+l*this.m_s2*this.m_s2,this.m_K.col1.y=p*this.m_s1*this.m_a1+l*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=n+q+p*this.m_a1*this.m_a1+l*this.m_a2*this.m_a2,this.m_K.Solve(x,-z,-u)):(n=this.m_invMassA,q=this.m_invMassB,p=this.m_invIA,l=this.m_invIB,u=n+q+p*this.m_s1*this.m_s1+l*this.m_s2*this.m_s2,x.x=0!=u?-z/u:0,x.y=0);u=x.x*this.m_perp.x+x.y*
- this.m_axis.x;n=x.x*this.m_perp.y+x.y*this.m_axis.y;z=x.x*this.m_s1+x.y*this.m_a1;x=x.x*this.m_s2+x.y*this.m_a2;g.x-=this.m_invMassA*u;g.y-=this.m_invMassA*n;h-=this.m_invIA*z;k.x+=this.m_invMassB*u;k.y+=this.m_invMassB*n;m+=this.m_invIB*x;d.m_sweep.a=h;f.m_sweep.a=m;d.SynchronizeTransform();f.SynchronizeTransform();return r<=c.b2_linearSlop&&v<=c.b2_angularSlop};Box2D.inherit(D,Box2D.Dynamics.Joints.b2JointDef);D.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;D.b2LineJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,
- arguments);this.localAnchorA=new b;this.localAnchorB=new b;this.localAxisA=new b};D.prototype.b2LineJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_lineJoint;this.localAxisA.Set(1,0);this.enableLimit=!1;this.upperTranslation=this.lowerTranslation=0;this.enableMotor=!1;this.motorSpeed=this.maxMotorForce=0};D.prototype.Initialize=function(a,b,c,d){this.bodyA=a;this.bodyB=b;this.localAnchorA=this.bodyA.GetLocalPoint(c);this.localAnchorB=this.bodyB.GetLocalPoint(c);this.localAxisA=
- this.bodyA.GetLocalVector(d)};Box2D.inherit(x,Box2D.Dynamics.Joints.b2Joint);x.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;x.b2MouseJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.K=new e;this.K1=new e;this.K2=new e;this.m_localAnchor=new b;this.m_target=new b;this.m_impulse=new b;this.m_mass=new e;this.m_C=new b};x.prototype.GetAnchorA=function(){return this.m_target};x.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor)};
- x.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*this.m_impulse.x,a*this.m_impulse.y)};x.prototype.GetReactionTorque=function(a){return 0};x.prototype.GetTarget=function(){return this.m_target};x.prototype.SetTarget=function(a){!1==this.m_bodyB.IsAwake()&&this.m_bodyB.SetAwake(!0);this.m_target=a};x.prototype.GetMaxForce=function(){return this.m_maxForce};x.prototype.SetMaxForce=function(a){void 0===a&&(a=0);this.m_maxForce=a};x.prototype.GetFrequency=function(){return this.m_frequencyHz};
- x.prototype.SetFrequency=function(a){void 0===a&&(a=0);this.m_frequencyHz=a};x.prototype.GetDampingRatio=function(){return this.m_dampingRatio};x.prototype.SetDampingRatio=function(a){void 0===a&&(a=0);this.m_dampingRatio=a};x.prototype.b2MouseJoint=function(a){this.__super.b2Joint.call(this,a);this.m_target.SetV(a.target);var b=this.m_target.x-this.m_bodyB.m_xf.position.x,c=this.m_target.y-this.m_bodyB.m_xf.position.y,d=this.m_bodyB.m_xf.R;this.m_localAnchor.x=b*d.col1.x+c*d.col1.y;this.m_localAnchor.y=
- b*d.col2.x+c*d.col2.y;this.m_maxForce=a.maxForce;this.m_impulse.SetZero();this.m_frequencyHz=a.frequencyHz;this.m_dampingRatio=a.dampingRatio;this.m_gamma=this.m_beta=0};x.prototype.InitVelocityConstraints=function(a){var b=this.m_bodyB,c=b.GetMass(),d=2*Math.PI*this.m_frequencyHz,e=c*d*d;this.m_gamma=a.dt*(2*c*this.m_dampingRatio*d+a.dt*e);this.m_gamma=0!=this.m_gamma?1/this.m_gamma:0;this.m_beta=a.dt*e*this.m_gamma;var e=b.m_xf.R,c=this.m_localAnchor.x-b.m_sweep.localCenter.x,d=this.m_localAnchor.y-
- b.m_sweep.localCenter.y,f=e.col1.x*c+e.col2.x*d,d=e.col1.y*c+e.col2.y*d,c=f,e=b.m_invMass,f=b.m_invI;this.K1.col1.x=e;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=e;this.K2.col1.x=f*d*d;this.K2.col2.x=-f*c*d;this.K2.col1.y=-f*c*d;this.K2.col2.y=f*c*c;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.col1.x+=this.m_gamma;this.K.col2.y+=this.m_gamma;this.K.GetInverse(this.m_mass);this.m_C.x=b.m_sweep.c.x+c-this.m_target.x;this.m_C.y=b.m_sweep.c.y+d-this.m_target.y;b.m_angularVelocity*=0.98;this.m_impulse.x*=
- a.dtRatio;this.m_impulse.y*=a.dtRatio;b.m_linearVelocity.x+=e*this.m_impulse.x;b.m_linearVelocity.y+=e*this.m_impulse.y;b.m_angularVelocity+=f*(c*this.m_impulse.y-d*this.m_impulse.x)};x.prototype.SolveVelocityConstraints=function(a){var b=this.m_bodyB,c,d=0,e=0;c=b.m_xf.R;var f=this.m_localAnchor.x-b.m_sweep.localCenter.x,g=this.m_localAnchor.y-b.m_sweep.localCenter.y,d=c.col1.x*f+c.col2.x*g,g=c.col1.y*f+c.col2.y*g,f=d,d=b.m_linearVelocity.x+-b.m_angularVelocity*g,h=b.m_linearVelocity.y+b.m_angularVelocity*
- f;c=this.m_mass;d=d+this.m_beta*this.m_C.x+this.m_gamma*this.m_impulse.x;e=h+this.m_beta*this.m_C.y+this.m_gamma*this.m_impulse.y;h=-(c.col1.x*d+c.col2.x*e);e=-(c.col1.y*d+c.col2.y*e);c=this.m_impulse.x;d=this.m_impulse.y;this.m_impulse.x+=h;this.m_impulse.y+=e;a=a.dt*this.m_maxForce;this.m_impulse.LengthSquared()>a*a&&this.m_impulse.Multiply(a/this.m_impulse.Length());h=this.m_impulse.x-c;e=this.m_impulse.y-d;b.m_linearVelocity.x+=b.m_invMass*h;b.m_linearVelocity.y+=b.m_invMass*e;b.m_angularVelocity+=
- b.m_invI*(f*e-g*h)};x.prototype.SolvePositionConstraints=function(a){return!0};Box2D.inherit(C,Box2D.Dynamics.Joints.b2JointDef);C.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;C.b2MouseJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.target=new b};C.prototype.b2MouseJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7};Box2D.inherit(A,Box2D.Dynamics.Joints.b2Joint);
- A.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;A.b2PrismaticJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_localXAxis1=new b;this.m_localYAxis1=new b;this.m_axis=new b;this.m_perp=new b;this.m_K=new d;this.m_impulse=new f};A.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};A.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};
- A.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*(this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x),a*(this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y))};A.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_impulse.y};A.prototype.GetJointTranslation=function(){var a=this.m_bodyA,b=this.m_bodyB,c=a.GetWorldPoint(this.m_localAnchor1),d=b.GetWorldPoint(this.m_localAnchor2),b=d.x-c.x,
- c=d.y-c.y,a=a.GetWorldVector(this.m_localXAxis1);return a.x*b+a.y*c};A.prototype.GetJointSpeed=function(){var a=this.m_bodyA,b=this.m_bodyB,c;c=a.m_xf.R;var d=this.m_localAnchor1.x-a.m_sweep.localCenter.x,e=this.m_localAnchor1.y-a.m_sweep.localCenter.y,f=c.col1.x*d+c.col2.x*e,e=c.col1.y*d+c.col2.y*e,d=f;c=b.m_xf.R;var g=this.m_localAnchor2.x-b.m_sweep.localCenter.x,h=this.m_localAnchor2.y-b.m_sweep.localCenter.y,f=c.col1.x*g+c.col2.x*h,h=c.col1.y*g+c.col2.y*h,g=f;c=b.m_sweep.c.x+g-(a.m_sweep.c.x+
- d);var f=b.m_sweep.c.y+h-(a.m_sweep.c.y+e),k=a.GetWorldVector(this.m_localXAxis1),m=a.m_linearVelocity,l=b.m_linearVelocity,a=a.m_angularVelocity,b=b.m_angularVelocity;return c*-a*k.y+f*a*k.x+(k.x*(l.x+-b*h-m.x- -a*e)+k.y*(l.y+b*g-m.y-a*d))};A.prototype.IsLimitEnabled=function(){return this.m_enableLimit};A.prototype.EnableLimit=function(a){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_enableLimit=a};A.prototype.GetLowerLimit=function(){return this.m_lowerTranslation};A.prototype.GetUpperLimit=
- function(){return this.m_upperTranslation};A.prototype.SetLimits=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_lowerTranslation=a;this.m_upperTranslation=b};A.prototype.IsMotorEnabled=function(){return this.m_enableMotor};A.prototype.EnableMotor=function(a){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_enableMotor=a};A.prototype.SetMotorSpeed=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);
- this.m_motorSpeed=a};A.prototype.GetMotorSpeed=function(){return this.m_motorSpeed};A.prototype.SetMaxMotorForce=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_maxMotorForce=a};A.prototype.GetMotorForce=function(){return this.m_motorImpulse};A.prototype.b2PrismaticJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchor1.SetV(a.localAnchorA);this.m_localAnchor2.SetV(a.localAnchorB);this.m_localXAxis1.SetV(a.localAxisA);this.m_localYAxis1.x=-this.m_localXAxis1.y;
- this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_refAngle=a.referenceAngle;this.m_impulse.SetZero();this.m_motorImpulse=this.m_motorMass=0;this.m_lowerTranslation=a.lowerTranslation;this.m_upperTranslation=a.upperTranslation;this.m_maxMotorForce=a.maxMotorForce;this.m_motorSpeed=a.motorSpeed;this.m_enableLimit=a.enableLimit;this.m_enableMotor=a.enableMotor;this.m_limitState=q.e_inactiveLimit;this.m_axis.SetZero();this.m_perp.SetZero()};A.prototype.InitVelocityConstraints=function(b){var d=this.m_bodyA,
- e=this.m_bodyB,f,g=0;this.m_localCenterA.SetV(d.GetLocalCenter());this.m_localCenterB.SetV(e.GetLocalCenter());var h=d.GetTransform();e.GetTransform();f=d.m_xf.R;var k=this.m_localAnchor1.x-this.m_localCenterA.x,m=this.m_localAnchor1.y-this.m_localCenterA.y,g=f.col1.x*k+f.col2.x*m,m=f.col1.y*k+f.col2.y*m,k=g;f=e.m_xf.R;var l=this.m_localAnchor2.x-this.m_localCenterB.x,n=this.m_localAnchor2.y-this.m_localCenterB.y,g=f.col1.x*l+f.col2.x*n,n=f.col1.y*l+f.col2.y*n,l=g;f=e.m_sweep.c.x+l-d.m_sweep.c.x-
- k;g=e.m_sweep.c.y+n-d.m_sweep.c.y-m;this.m_invMassA=d.m_invMass;this.m_invMassB=e.m_invMass;this.m_invIA=d.m_invI;this.m_invIB=e.m_invI;this.m_axis.SetV(a.MulMV(h.R,this.m_localXAxis1));this.m_a1=(f+k)*this.m_axis.y-(g+m)*this.m_axis.x;this.m_a2=l*this.m_axis.y-n*this.m_axis.x;this.m_motorMass=this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_a1*this.m_a1+this.m_invIB*this.m_a2*this.m_a2;this.m_motorMass>Number.MIN_VALUE&&(this.m_motorMass=1/this.m_motorMass);this.m_perp.SetV(a.MulMV(h.R,this.m_localYAxis1));
- this.m_s1=(f+k)*this.m_perp.y-(g+m)*this.m_perp.x;this.m_s2=l*this.m_perp.y-n*this.m_perp.x;h=this.m_invMassA;k=this.m_invMassB;m=this.m_invIA;l=this.m_invIB;this.m_K.col1.x=h+k+m*this.m_s1*this.m_s1+l*this.m_s2*this.m_s2;this.m_K.col1.y=m*this.m_s1+l*this.m_s2;this.m_K.col1.z=m*this.m_s1*this.m_a1+l*this.m_s2*this.m_a2;this.m_K.col2.x=this.m_K.col1.y;this.m_K.col2.y=m+l;this.m_K.col2.z=m*this.m_a1+l*this.m_a2;this.m_K.col3.x=this.m_K.col1.z;this.m_K.col3.y=this.m_K.col2.z;this.m_K.col3.z=h+k+m*this.m_a1*
- this.m_a1+l*this.m_a2*this.m_a2;this.m_enableLimit?(f=this.m_axis.x*f+this.m_axis.y*g,a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?this.m_limitState=q.e_equalLimits:f<=this.m_lowerTranslation?this.m_limitState!=q.e_atLowerLimit&&(this.m_limitState=q.e_atLowerLimit,this.m_impulse.z=0):f>=this.m_upperTranslation?this.m_limitState!=q.e_atUpperLimit&&(this.m_limitState=q.e_atUpperLimit,this.m_impulse.z=0):(this.m_limitState=q.e_inactiveLimit,this.m_impulse.z=0)):this.m_limitState=
- q.e_inactiveLimit;!1==this.m_enableMotor&&(this.m_motorImpulse=0);b.warmStarting?(this.m_impulse.x*=b.dtRatio,this.m_impulse.y*=b.dtRatio,this.m_motorImpulse*=b.dtRatio,b=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x,f=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y,g=this.m_impulse.x*this.m_s1+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a1,h=this.m_impulse.x*this.m_s2+this.m_impulse.y+(this.m_motorImpulse+
- this.m_impulse.z)*this.m_a2,d.m_linearVelocity.x-=this.m_invMassA*b,d.m_linearVelocity.y-=this.m_invMassA*f,d.m_angularVelocity-=this.m_invIA*g,e.m_linearVelocity.x+=this.m_invMassB*b,e.m_linearVelocity.y+=this.m_invMassB*f,e.m_angularVelocity+=this.m_invIB*h):(this.m_impulse.SetZero(),this.m_motorImpulse=0)};A.prototype.SolveVelocityConstraints=function(c){var d=this.m_bodyA,e=this.m_bodyB,g=d.m_linearVelocity,h=d.m_angularVelocity,k=e.m_linearVelocity,m=e.m_angularVelocity,l=0,n=0,p=0,r=0;this.m_enableMotor&&
- this.m_limitState!=q.e_equalLimits&&(r=this.m_motorMass*(this.m_motorSpeed-(this.m_axis.x*(k.x-g.x)+this.m_axis.y*(k.y-g.y)+this.m_a2*m-this.m_a1*h)),l=this.m_motorImpulse,c=c.dt*this.m_maxMotorForce,this.m_motorImpulse=a.Clamp(this.m_motorImpulse+r,-c,c),r=this.m_motorImpulse-l,l=r*this.m_axis.x,n=r*this.m_axis.y,p=r*this.m_a1,r*=this.m_a2,g.x-=this.m_invMassA*l,g.y-=this.m_invMassA*n,h-=this.m_invIA*p,k.x+=this.m_invMassB*l,k.y+=this.m_invMassB*n,m+=this.m_invIB*r);p=this.m_perp.x*(k.x-g.x)+this.m_perp.y*
- (k.y-g.y)+this.m_s2*m-this.m_s1*h;n=m-h;this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit?(c=this.m_axis.x*(k.x-g.x)+this.m_axis.y*(k.y-g.y)+this.m_a2*m-this.m_a1*h,l=this.m_impulse.Copy(),c=this.m_K.Solve33(new f,-p,-n,-c),this.m_impulse.Add(c),this.m_limitState==q.e_atLowerLimit?this.m_impulse.z=a.Max(this.m_impulse.z,0):this.m_limitState==q.e_atUpperLimit&&(this.m_impulse.z=a.Min(this.m_impulse.z,0)),p=-p-(this.m_impulse.z-l.z)*this.m_K.col3.x,n=-n-(this.m_impulse.z-l.z)*this.m_K.col3.y,
- n=this.m_K.Solve22(new b,p,n),n.x+=l.x,n.y+=l.y,this.m_impulse.x=n.x,this.m_impulse.y=n.y,c.x=this.m_impulse.x-l.x,c.y=this.m_impulse.y-l.y,c.z=this.m_impulse.z-l.z,l=c.x*this.m_perp.x+c.z*this.m_axis.x,n=c.x*this.m_perp.y+c.z*this.m_axis.y,p=c.x*this.m_s1+c.y+c.z*this.m_a1,r=c.x*this.m_s2+c.y+c.z*this.m_a2):(c=this.m_K.Solve22(new b,-p,-n),this.m_impulse.x+=c.x,this.m_impulse.y+=c.y,l=c.x*this.m_perp.x,n=c.x*this.m_perp.y,p=c.x*this.m_s1+c.y,r=c.x*this.m_s2+c.y);g.x-=this.m_invMassA*l;g.y-=this.m_invMassA*
- n;h-=this.m_invIA*p;k.x+=this.m_invMassB*l;k.y+=this.m_invMassB*n;m+=this.m_invIB*r;d.m_linearVelocity.SetV(g);d.m_angularVelocity=h;e.m_linearVelocity.SetV(k);e.m_angularVelocity=m};A.prototype.SolvePositionConstraints=function(d){d=this.m_bodyA;var g=this.m_bodyB,h=d.m_sweep.c,k=d.m_sweep.a,m=g.m_sweep.c,l=g.m_sweep.a,n,t=0,q=0,p=0,r=t=n=0,v=0,q=!1,u=0,x=e.FromAngle(k),z=e.FromAngle(l);n=x;var v=this.m_localAnchor1.x-this.m_localCenterA.x,A=this.m_localAnchor1.y-this.m_localCenterA.y,t=n.col1.x*
- v+n.col2.x*A,A=n.col1.y*v+n.col2.y*A,v=t;n=z;z=this.m_localAnchor2.x-this.m_localCenterB.x;p=this.m_localAnchor2.y-this.m_localCenterB.y;t=n.col1.x*z+n.col2.x*p;p=n.col1.y*z+n.col2.y*p;z=t;n=m.x+z-h.x-v;t=m.y+p-h.y-A;if(this.m_enableLimit){this.m_axis=a.MulMV(x,this.m_localXAxis1);this.m_a1=(n+v)*this.m_axis.y-(t+A)*this.m_axis.x;this.m_a2=z*this.m_axis.y-p*this.m_axis.x;var B=this.m_axis.x*n+this.m_axis.y*t;a.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*c.b2_linearSlop?(u=a.Clamp(B,-c.b2_maxLinearCorrection,
- c.b2_maxLinearCorrection),r=a.Abs(B),q=!0):B<=this.m_lowerTranslation?(u=a.Clamp(B-this.m_lowerTranslation+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),r=this.m_lowerTranslation-B,q=!0):B>=this.m_upperTranslation&&(u=a.Clamp(B-this.m_upperTranslation+c.b2_linearSlop,0,c.b2_maxLinearCorrection),r=B-this.m_upperTranslation,q=!0)}this.m_perp=a.MulMV(x,this.m_localYAxis1);this.m_s1=(n+v)*this.m_perp.y-(t+A)*this.m_perp.x;this.m_s2=z*this.m_perp.y-p*this.m_perp.x;x=new f;A=this.m_perp.x*n+this.m_perp.y*
- t;z=l-k-this.m_refAngle;r=a.Max(r,a.Abs(A));v=a.Abs(z);q?(q=this.m_invMassA,p=this.m_invMassB,n=this.m_invIA,t=this.m_invIB,this.m_K.col1.x=q+p+n*this.m_s1*this.m_s1+t*this.m_s2*this.m_s2,this.m_K.col1.y=n*this.m_s1+t*this.m_s2,this.m_K.col1.z=n*this.m_s1*this.m_a1+t*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=n+t,this.m_K.col2.z=n*this.m_a1+t*this.m_a2,this.m_K.col3.x=this.m_K.col1.z,this.m_K.col3.y=this.m_K.col2.z,this.m_K.col3.z=q+p+n*this.m_a1*this.m_a1+t*this.m_a2*this.m_a2,
- this.m_K.Solve33(x,-A,-z,-u)):(q=this.m_invMassA,p=this.m_invMassB,n=this.m_invIA,t=this.m_invIB,u=n*this.m_s1+t*this.m_s2,B=n+t,this.m_K.col1.Set(q+p+n*this.m_s1*this.m_s1+t*this.m_s2*this.m_s2,u,0),this.m_K.col2.Set(u,B,0),u=this.m_K.Solve22(new b,-A,-z),x.x=u.x,x.y=u.y,x.z=0);u=x.x*this.m_perp.x+x.z*this.m_axis.x;q=x.x*this.m_perp.y+x.z*this.m_axis.y;A=x.x*this.m_s1+x.y+x.z*this.m_a1;x=x.x*this.m_s2+x.y+x.z*this.m_a2;h.x-=this.m_invMassA*u;h.y-=this.m_invMassA*q;k-=this.m_invIA*A;m.x+=this.m_invMassB*
- u;m.y+=this.m_invMassB*q;l+=this.m_invIB*x;d.m_sweep.a=k;g.m_sweep.a=l;d.SynchronizeTransform();g.SynchronizeTransform();return r<=c.b2_linearSlop&&v<=c.b2_angularSlop};Box2D.inherit(z,Box2D.Dynamics.Joints.b2JointDef);z.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;z.b2PrismaticJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB=new b;this.localAxisA=new b};z.prototype.b2PrismaticJointDef=function(){this.__super.b2JointDef.call(this);
- this.type=q.e_prismaticJoint;this.localAxisA.Set(1,0);this.referenceAngle=0;this.enableLimit=!1;this.upperTranslation=this.lowerTranslation=0;this.enableMotor=!1;this.motorSpeed=this.maxMotorForce=0};z.prototype.Initialize=function(a,b,c,d){this.bodyA=a;this.bodyB=b;this.localAnchorA=this.bodyA.GetLocalPoint(c);this.localAnchorB=this.bodyB.GetLocalPoint(c);this.localAxisA=this.bodyA.GetLocalVector(d);this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()};Box2D.inherit(u,Box2D.Dynamics.Joints.b2Joint);
- u.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;u.b2PulleyJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_groundAnchor1=new b;this.m_groundAnchor2=new b;this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_u1=new b;this.m_u2=new b};u.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};u.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};u.prototype.GetReactionForce=function(a){void 0===
- a&&(a=0);return new b(a*this.m_impulse*this.m_u2.x,a*this.m_impulse*this.m_u2.y)};u.prototype.GetReactionTorque=function(a){return 0};u.prototype.GetGroundAnchorA=function(){var a=this.m_ground.m_xf.position.Copy();a.Add(this.m_groundAnchor1);return a};u.prototype.GetGroundAnchorB=function(){var a=this.m_ground.m_xf.position.Copy();a.Add(this.m_groundAnchor2);return a};u.prototype.GetLength1=function(){var a=this.m_bodyA.GetWorldPoint(this.m_localAnchor1),b=a.x-(this.m_ground.m_xf.position.x+this.m_groundAnchor1.x),
- a=a.y-(this.m_ground.m_xf.position.y+this.m_groundAnchor1.y);return Math.sqrt(b*b+a*a)};u.prototype.GetLength2=function(){var a=this.m_bodyB.GetWorldPoint(this.m_localAnchor2),b=a.x-(this.m_ground.m_xf.position.x+this.m_groundAnchor2.x),a=a.y-(this.m_ground.m_xf.position.y+this.m_groundAnchor2.y);return Math.sqrt(b*b+a*a)};u.prototype.GetRatio=function(){return this.m_ratio};u.prototype.b2PulleyJoint=function(b){this.__super.b2Joint.call(this,b);this.m_ground=this.m_bodyA.m_world.m_groundBody;this.m_groundAnchor1.x=
- b.groundAnchorA.x-this.m_ground.m_xf.position.x;this.m_groundAnchor1.y=b.groundAnchorA.y-this.m_ground.m_xf.position.y;this.m_groundAnchor2.x=b.groundAnchorB.x-this.m_ground.m_xf.position.x;this.m_groundAnchor2.y=b.groundAnchorB.y-this.m_ground.m_xf.position.y;this.m_localAnchor1.SetV(b.localAnchorA);this.m_localAnchor2.SetV(b.localAnchorB);this.m_ratio=b.ratio;this.m_constant=b.lengthA+this.m_ratio*b.lengthB;this.m_maxLength1=a.Min(b.maxLengthA,this.m_constant-this.m_ratio*u.b2_minPulleyLength);
- this.m_maxLength2=a.Min(b.maxLengthB,(this.m_constant-u.b2_minPulleyLength)/this.m_ratio);this.m_limitImpulse2=this.m_limitImpulse1=this.m_impulse=0};u.prototype.InitVelocityConstraints=function(a){var b=this.m_bodyA,d=this.m_bodyB,e;e=b.m_xf.R;var f=this.m_localAnchor1.x-b.m_sweep.localCenter.x,g=this.m_localAnchor1.y-b.m_sweep.localCenter.y,h=e.col1.x*f+e.col2.x*g,g=e.col1.y*f+e.col2.y*g,f=h;e=d.m_xf.R;var k=this.m_localAnchor2.x-d.m_sweep.localCenter.x,m=this.m_localAnchor2.y-d.m_sweep.localCenter.y,
- h=e.col1.x*k+e.col2.x*m,m=e.col1.y*k+e.col2.y*m,k=h;e=d.m_sweep.c.x+k;var h=d.m_sweep.c.y+m,l=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,n=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y;this.m_u1.Set(b.m_sweep.c.x+f-(this.m_ground.m_xf.position.x+this.m_groundAnchor1.x),b.m_sweep.c.y+g-(this.m_ground.m_xf.position.y+this.m_groundAnchor1.y));this.m_u2.Set(e-l,h-n);e=this.m_u1.Length();h=this.m_u2.Length();e>c.b2_linearSlop?this.m_u1.Multiply(1/e):this.m_u1.SetZero();h>c.b2_linearSlop?
- this.m_u2.Multiply(1/h):this.m_u2.SetZero();0<this.m_constant-e-this.m_ratio*h?(this.m_state=q.e_inactiveLimit,this.m_impulse=0):this.m_state=q.e_atUpperLimit;e<this.m_maxLength1?(this.m_limitState1=q.e_inactiveLimit,this.m_limitImpulse1=0):this.m_limitState1=q.e_atUpperLimit;h<this.m_maxLength2?(this.m_limitState2=q.e_inactiveLimit,this.m_limitImpulse2=0):this.m_limitState2=q.e_atUpperLimit;e=f*this.m_u1.y-g*this.m_u1.x;h=k*this.m_u2.y-m*this.m_u2.x;this.m_limitMass1=b.m_invMass+b.m_invI*e*e;this.m_limitMass2=
- d.m_invMass+d.m_invI*h*h;this.m_pulleyMass=this.m_limitMass1+this.m_ratio*this.m_ratio*this.m_limitMass2;this.m_limitMass1=1/this.m_limitMass1;this.m_limitMass2=1/this.m_limitMass2;this.m_pulleyMass=1/this.m_pulleyMass;a.warmStarting?(this.m_impulse*=a.dtRatio,this.m_limitImpulse1*=a.dtRatio,this.m_limitImpulse2*=a.dtRatio,a=(-this.m_impulse-this.m_limitImpulse1)*this.m_u1.x,e=(-this.m_impulse-this.m_limitImpulse1)*this.m_u1.y,h=(-this.m_ratio*this.m_impulse-this.m_limitImpulse2)*this.m_u2.x,l=(-this.m_ratio*
- this.m_impulse-this.m_limitImpulse2)*this.m_u2.y,b.m_linearVelocity.x+=b.m_invMass*a,b.m_linearVelocity.y+=b.m_invMass*e,b.m_angularVelocity+=b.m_invI*(f*e-g*a),d.m_linearVelocity.x+=d.m_invMass*h,d.m_linearVelocity.y+=d.m_invMass*l,d.m_angularVelocity+=d.m_invI*(k*l-m*h)):this.m_limitImpulse2=this.m_limitImpulse1=this.m_impulse=0};u.prototype.SolveVelocityConstraints=function(b){b=this.m_bodyA;var c=this.m_bodyB,d;d=b.m_xf.R;var e=this.m_localAnchor1.x-b.m_sweep.localCenter.x,f=this.m_localAnchor1.y-
- b.m_sweep.localCenter.y,g=d.col1.x*e+d.col2.x*f,f=d.col1.y*e+d.col2.y*f,e=g;d=c.m_xf.R;var h=this.m_localAnchor2.x-c.m_sweep.localCenter.x,k=this.m_localAnchor2.y-c.m_sweep.localCenter.y,g=d.col1.x*h+d.col2.x*k,k=d.col1.y*h+d.col2.y*k,h=g,m=g=d=0,l=0;d=l=d=l=m=g=d=0;this.m_state==q.e_atUpperLimit&&(d=b.m_linearVelocity.x+-b.m_angularVelocity*f,g=b.m_linearVelocity.y+b.m_angularVelocity*e,m=c.m_linearVelocity.x+-c.m_angularVelocity*k,l=c.m_linearVelocity.y+c.m_angularVelocity*h,d=-(this.m_u1.x*d+this.m_u1.y*
- g)-this.m_ratio*(this.m_u2.x*m+this.m_u2.y*l),l=this.m_pulleyMass*-d,d=this.m_impulse,this.m_impulse=a.Max(0,this.m_impulse+l),l=this.m_impulse-d,d=-l*this.m_u1.x,g=-l*this.m_u1.y,m=-this.m_ratio*l*this.m_u2.x,l=-this.m_ratio*l*this.m_u2.y,b.m_linearVelocity.x+=b.m_invMass*d,b.m_linearVelocity.y+=b.m_invMass*g,b.m_angularVelocity+=b.m_invI*(e*g-f*d),c.m_linearVelocity.x+=c.m_invMass*m,c.m_linearVelocity.y+=c.m_invMass*l,c.m_angularVelocity+=c.m_invI*(h*l-k*m));this.m_limitState1==q.e_atUpperLimit&&
- (d=b.m_linearVelocity.x+-b.m_angularVelocity*f,g=b.m_linearVelocity.y+b.m_angularVelocity*e,d=-(this.m_u1.x*d+this.m_u1.y*g),l=-this.m_limitMass1*d,d=this.m_limitImpulse1,this.m_limitImpulse1=a.Max(0,this.m_limitImpulse1+l),l=this.m_limitImpulse1-d,d=-l*this.m_u1.x,g=-l*this.m_u1.y,b.m_linearVelocity.x+=b.m_invMass*d,b.m_linearVelocity.y+=b.m_invMass*g,b.m_angularVelocity+=b.m_invI*(e*g-f*d));this.m_limitState2==q.e_atUpperLimit&&(m=c.m_linearVelocity.x+-c.m_angularVelocity*k,l=c.m_linearVelocity.y+
- c.m_angularVelocity*h,d=-(this.m_u2.x*m+this.m_u2.y*l),l=-this.m_limitMass2*d,d=this.m_limitImpulse2,this.m_limitImpulse2=a.Max(0,this.m_limitImpulse2+l),l=this.m_limitImpulse2-d,m=-l*this.m_u2.x,l=-l*this.m_u2.y,c.m_linearVelocity.x+=c.m_invMass*m,c.m_linearVelocity.y+=c.m_invMass*l,c.m_angularVelocity+=c.m_invI*(h*l-k*m))};u.prototype.SolvePositionConstraints=function(b){b=this.m_bodyA;var d=this.m_bodyB,e,f=this.m_ground.m_xf.position.x+this.m_groundAnchor1.x,g=this.m_ground.m_xf.position.y+this.m_groundAnchor1.y,
- h=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,k=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y,m=0,l=0,n=0,p=0,r=e=0,v=0,u=0,x=r=u=e=r=e=0;this.m_state==q.e_atUpperLimit&&(e=b.m_xf.R,m=this.m_localAnchor1.x-b.m_sweep.localCenter.x,l=this.m_localAnchor1.y-b.m_sweep.localCenter.y,r=e.col1.x*m+e.col2.x*l,l=e.col1.y*m+e.col2.y*l,m=r,e=d.m_xf.R,n=this.m_localAnchor2.x-d.m_sweep.localCenter.x,p=this.m_localAnchor2.y-d.m_sweep.localCenter.y,r=e.col1.x*n+e.col2.x*p,p=e.col1.y*n+e.col2.y*p,
- n=r,e=b.m_sweep.c.x+m,r=b.m_sweep.c.y+l,v=d.m_sweep.c.x+n,u=d.m_sweep.c.y+p,this.m_u1.Set(e-f,r-g),this.m_u2.Set(v-h,u-k),e=this.m_u1.Length(),r=this.m_u2.Length(),e>c.b2_linearSlop?this.m_u1.Multiply(1/e):this.m_u1.SetZero(),r>c.b2_linearSlop?this.m_u2.Multiply(1/r):this.m_u2.SetZero(),e=this.m_constant-e-this.m_ratio*r,x=a.Max(x,-e),e=a.Clamp(e+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),u=-this.m_pulleyMass*e,e=-u*this.m_u1.x,r=-u*this.m_u1.y,v=-this.m_ratio*u*this.m_u2.x,u=-this.m_ratio*u*this.m_u2.y,
- b.m_sweep.c.x+=b.m_invMass*e,b.m_sweep.c.y+=b.m_invMass*r,b.m_sweep.a+=b.m_invI*(m*r-l*e),d.m_sweep.c.x+=d.m_invMass*v,d.m_sweep.c.y+=d.m_invMass*u,d.m_sweep.a+=d.m_invI*(n*u-p*v),b.SynchronizeTransform(),d.SynchronizeTransform());this.m_limitState1==q.e_atUpperLimit&&(e=b.m_xf.R,m=this.m_localAnchor1.x-b.m_sweep.localCenter.x,l=this.m_localAnchor1.y-b.m_sweep.localCenter.y,r=e.col1.x*m+e.col2.x*l,l=e.col1.y*m+e.col2.y*l,m=r,e=b.m_sweep.c.x+m,r=b.m_sweep.c.y+l,this.m_u1.Set(e-f,r-g),e=this.m_u1.Length(),
- e>c.b2_linearSlop?(this.m_u1.x*=1/e,this.m_u1.y*=1/e):this.m_u1.SetZero(),e=this.m_maxLength1-e,x=a.Max(x,-e),e=a.Clamp(e+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),u=-this.m_limitMass1*e,e=-u*this.m_u1.x,r=-u*this.m_u1.y,b.m_sweep.c.x+=b.m_invMass*e,b.m_sweep.c.y+=b.m_invMass*r,b.m_sweep.a+=b.m_invI*(m*r-l*e),b.SynchronizeTransform());this.m_limitState2==q.e_atUpperLimit&&(e=d.m_xf.R,n=this.m_localAnchor2.x-d.m_sweep.localCenter.x,p=this.m_localAnchor2.y-d.m_sweep.localCenter.y,r=e.col1.x*n+e.col2.x*
- p,p=e.col1.y*n+e.col2.y*p,n=r,v=d.m_sweep.c.x+n,u=d.m_sweep.c.y+p,this.m_u2.Set(v-h,u-k),r=this.m_u2.Length(),r>c.b2_linearSlop?(this.m_u2.x*=1/r,this.m_u2.y*=1/r):this.m_u2.SetZero(),e=this.m_maxLength2-r,x=a.Max(x,-e),e=a.Clamp(e+c.b2_linearSlop,-c.b2_maxLinearCorrection,0),u=-this.m_limitMass2*e,v=-u*this.m_u2.x,u=-u*this.m_u2.y,d.m_sweep.c.x+=d.m_invMass*v,d.m_sweep.c.y+=d.m_invMass*u,d.m_sweep.a+=d.m_invI*(n*u-p*v),d.SynchronizeTransform());return x<c.b2_linearSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength=
- 2});Box2D.inherit(J,Box2D.Dynamics.Joints.b2JointDef);J.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;J.b2PulleyJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.groundAnchorA=new b;this.groundAnchorB=new b;this.localAnchorA=new b;this.localAnchorB=new b};J.prototype.b2PulleyJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_pulleyJoint;this.groundAnchorA.Set(-1,1);this.groundAnchorB.Set(1,1);this.localAnchorA.Set(-1,0);this.localAnchorB.Set(1,
- 0);this.maxLengthB=this.lengthB=this.maxLengthA=this.lengthA=0;this.ratio=1;this.collideConnected=!0};J.prototype.Initialize=function(a,b,c,d,e,f,g){void 0===g&&(g=0);this.bodyA=a;this.bodyB=b;this.groundAnchorA.SetV(c);this.groundAnchorB.SetV(d);this.localAnchorA=this.bodyA.GetLocalPoint(e);this.localAnchorB=this.bodyB.GetLocalPoint(f);a=e.x-c.x;c=e.y-c.y;this.lengthA=Math.sqrt(a*a+c*c);c=f.x-d.x;d=f.y-d.y;this.lengthB=Math.sqrt(c*c+d*d);this.ratio=g;g=this.lengthA+this.ratio*this.lengthB;this.maxLengthA=
- g-this.ratio*u.b2_minPulleyLength;this.maxLengthB=(g-u.b2_minPulleyLength)/this.ratio};Box2D.inherit(B,Box2D.Dynamics.Joints.b2Joint);B.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;B.b2RevoluteJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.K=new e;this.K1=new e;this.K2=new e;this.K3=new e;this.impulse3=new f;this.impulse2=new b;this.reduced=new b;this.m_localAnchor1=new b;this.m_localAnchor2=new b;this.m_impulse=new f;this.m_mass=new d};B.prototype.GetAnchorA=
- function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)};B.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)};B.prototype.GetReactionForce=function(a){void 0===a&&(a=0);return new b(a*this.m_impulse.x,a*this.m_impulse.y)};B.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_impulse.z};B.prototype.GetJointAngle=function(){return this.m_bodyB.m_sweep.a-this.m_bodyA.m_sweep.a-this.m_referenceAngle};B.prototype.GetJointSpeed=function(){return this.m_bodyB.m_angularVelocity-
- this.m_bodyA.m_angularVelocity};B.prototype.IsLimitEnabled=function(){return this.m_enableLimit};B.prototype.EnableLimit=function(a){this.m_enableLimit=a};B.prototype.GetLowerLimit=function(){return this.m_lowerAngle};B.prototype.GetUpperLimit=function(){return this.m_upperAngle};B.prototype.SetLimits=function(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.m_lowerAngle=a;this.m_upperAngle=b};B.prototype.IsMotorEnabled=function(){this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);return this.m_enableMotor};
- B.prototype.EnableMotor=function(a){this.m_enableMotor=a};B.prototype.SetMotorSpeed=function(a){void 0===a&&(a=0);this.m_bodyA.SetAwake(!0);this.m_bodyB.SetAwake(!0);this.m_motorSpeed=a};B.prototype.GetMotorSpeed=function(){return this.m_motorSpeed};B.prototype.SetMaxMotorTorque=function(a){void 0===a&&(a=0);this.m_maxMotorTorque=a};B.prototype.GetMotorTorque=function(){return this.m_maxMotorTorque};B.prototype.b2RevoluteJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchor1.SetV(a.localAnchorA);
- this.m_localAnchor2.SetV(a.localAnchorB);this.m_referenceAngle=a.referenceAngle;this.m_impulse.SetZero();this.m_motorImpulse=0;this.m_lowerAngle=a.lowerAngle;this.m_upperAngle=a.upperAngle;this.m_maxMotorTorque=a.maxMotorTorque;this.m_motorSpeed=a.motorSpeed;this.m_enableLimit=a.enableLimit;this.m_enableMotor=a.enableMotor;this.m_limitState=q.e_inactiveLimit};B.prototype.InitVelocityConstraints=function(b){var d=this.m_bodyA,e=this.m_bodyB,f,g=0;f=d.m_xf.R;var h=this.m_localAnchor1.x-d.m_sweep.localCenter.x,
- k=this.m_localAnchor1.y-d.m_sweep.localCenter.y,g=f.col1.x*h+f.col2.x*k,k=f.col1.y*h+f.col2.y*k,h=g;f=e.m_xf.R;var m=this.m_localAnchor2.x-e.m_sweep.localCenter.x,l=this.m_localAnchor2.y-e.m_sweep.localCenter.y,g=f.col1.x*m+f.col2.x*l,l=f.col1.y*m+f.col2.y*l,m=g;f=d.m_invMass;var g=e.m_invMass,n=d.m_invI,p=e.m_invI;this.m_mass.col1.x=f+g+k*k*n+l*l*p;this.m_mass.col2.x=-k*h*n-l*m*p;this.m_mass.col3.x=-k*n-l*p;this.m_mass.col1.y=this.m_mass.col2.x;this.m_mass.col2.y=f+g+h*h*n+m*m*p;this.m_mass.col3.y=
- h*n+m*p;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=n+p;this.m_motorMass=1/(n+p);!1==this.m_enableMotor&&(this.m_motorImpulse=0);if(this.m_enableLimit){var r=e.m_sweep.a-d.m_sweep.a-this.m_referenceAngle;a.Abs(this.m_upperAngle-this.m_lowerAngle)<2*c.b2_angularSlop?this.m_limitState=q.e_equalLimits:r<=this.m_lowerAngle?(this.m_limitState!=q.e_atLowerLimit&&(this.m_impulse.z=0),this.m_limitState=q.e_atLowerLimit):r>=this.m_upperAngle?(this.m_limitState!=
- q.e_atUpperLimit&&(this.m_impulse.z=0),this.m_limitState=q.e_atUpperLimit):(this.m_limitState=q.e_inactiveLimit,this.m_impulse.z=0)}else this.m_limitState=q.e_inactiveLimit;b.warmStarting?(this.m_impulse.x*=b.dtRatio,this.m_impulse.y*=b.dtRatio,this.m_motorImpulse*=b.dtRatio,b=this.m_impulse.x,r=this.m_impulse.y,d.m_linearVelocity.x-=f*b,d.m_linearVelocity.y-=f*r,d.m_angularVelocity-=n*(h*r-k*b+this.m_motorImpulse+this.m_impulse.z),e.m_linearVelocity.x+=g*b,e.m_linearVelocity.y+=g*r,e.m_angularVelocity+=
- p*(m*r-l*b+this.m_motorImpulse+this.m_impulse.z)):(this.m_impulse.SetZero(),this.m_motorImpulse=0)};B.prototype.SolveVelocityConstraints=function(b){var c=this.m_bodyA,d=this.m_bodyB,e=0,f=e=0,g=0,h=0,k=0,m=c.m_linearVelocity,l=c.m_angularVelocity,n=d.m_linearVelocity,p=d.m_angularVelocity,r=c.m_invMass,v=d.m_invMass,u=c.m_invI,x=d.m_invI;this.m_enableMotor&&this.m_limitState!=q.e_equalLimits&&(f=this.m_motorMass*-(p-l-this.m_motorSpeed),g=this.m_motorImpulse,h=b.dt*this.m_maxMotorTorque,this.m_motorImpulse=
- a.Clamp(this.m_motorImpulse+f,-h,h),f=this.m_motorImpulse-g,l-=u*f,p+=x*f);if(this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit){b=c.m_xf.R;f=this.m_localAnchor1.x-c.m_sweep.localCenter.x;g=this.m_localAnchor1.y-c.m_sweep.localCenter.y;e=b.col1.x*f+b.col2.x*g;g=b.col1.y*f+b.col2.y*g;f=e;b=d.m_xf.R;h=this.m_localAnchor2.x-d.m_sweep.localCenter.x;k=this.m_localAnchor2.y-d.m_sweep.localCenter.y;e=b.col1.x*h+b.col2.x*k;k=b.col1.y*h+b.col2.y*k;h=e;b=n.x+-p*k-m.x- -l*g;var z=n.y+p*h-m.y-l*f;this.m_mass.Solve33(this.impulse3,
- -b,-z,-(p-l));this.m_limitState==q.e_equalLimits?this.m_impulse.Add(this.impulse3):this.m_limitState==q.e_atLowerLimit?(e=this.m_impulse.z+this.impulse3.z,0>e&&(this.m_mass.Solve22(this.reduced,-b,-z),this.impulse3.x=this.reduced.x,this.impulse3.y=this.reduced.y,this.impulse3.z=-this.m_impulse.z,this.m_impulse.x+=this.reduced.x,this.m_impulse.y+=this.reduced.y,this.m_impulse.z=0)):this.m_limitState==q.e_atUpperLimit&&(e=this.m_impulse.z+this.impulse3.z,0<e&&(this.m_mass.Solve22(this.reduced,-b,-z),
- this.impulse3.x=this.reduced.x,this.impulse3.y=this.reduced.y,this.impulse3.z=-this.m_impulse.z,this.m_impulse.x+=this.reduced.x,this.m_impulse.y+=this.reduced.y,this.m_impulse.z=0));m.x-=r*this.impulse3.x;m.y-=r*this.impulse3.y;l-=u*(f*this.impulse3.y-g*this.impulse3.x+this.impulse3.z);n.x+=v*this.impulse3.x;n.y+=v*this.impulse3.y;p+=x*(h*this.impulse3.y-k*this.impulse3.x+this.impulse3.z)}else b=c.m_xf.R,f=this.m_localAnchor1.x-c.m_sweep.localCenter.x,g=this.m_localAnchor1.y-c.m_sweep.localCenter.y,
- e=b.col1.x*f+b.col2.x*g,g=b.col1.y*f+b.col2.y*g,f=e,b=d.m_xf.R,h=this.m_localAnchor2.x-d.m_sweep.localCenter.x,k=this.m_localAnchor2.y-d.m_sweep.localCenter.y,e=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=e,this.m_mass.Solve22(this.impulse2,-(n.x+-p*k-m.x- -l*g),-(n.y+p*h-m.y-l*f)),this.m_impulse.x+=this.impulse2.x,this.m_impulse.y+=this.impulse2.y,m.x-=r*this.impulse2.x,m.y-=r*this.impulse2.y,l-=u*(f*this.impulse2.y-g*this.impulse2.x),n.x+=v*this.impulse2.x,n.y+=v*this.impulse2.y,p+=x*(h*this.impulse2.y-
- k*this.impulse2.x);c.m_linearVelocity.SetV(m);c.m_angularVelocity=l;d.m_linearVelocity.SetV(n);d.m_angularVelocity=p};B.prototype.SolvePositionConstraints=function(b){var d=0,e;b=this.m_bodyA;var f=this.m_bodyB,g=0,h=e=0,k=0,m=0;if(this.m_enableLimit&&this.m_limitState!=q.e_inactiveLimit){var d=f.m_sweep.a-b.m_sweep.a-this.m_referenceAngle,l=0;this.m_limitState==q.e_equalLimits?(d=a.Clamp(d-this.m_lowerAngle,-c.b2_maxAngularCorrection,c.b2_maxAngularCorrection),l=-this.m_motorMass*d,g=a.Abs(d)):this.m_limitState==
- q.e_atLowerLimit?(d-=this.m_lowerAngle,g=-d,d=a.Clamp(d+c.b2_angularSlop,-c.b2_maxAngularCorrection,0),l=-this.m_motorMass*d):this.m_limitState==q.e_atUpperLimit&&(g=d-=this.m_upperAngle,d=a.Clamp(d-c.b2_angularSlop,0,c.b2_maxAngularCorrection),l=-this.m_motorMass*d);b.m_sweep.a-=b.m_invI*l;f.m_sweep.a+=f.m_invI*l;b.SynchronizeTransform();f.SynchronizeTransform()}e=b.m_xf.R;l=this.m_localAnchor1.x-b.m_sweep.localCenter.x;d=this.m_localAnchor1.y-b.m_sweep.localCenter.y;h=e.col1.x*l+e.col2.x*d;d=e.col1.y*
- l+e.col2.y*d;l=h;e=f.m_xf.R;var n=this.m_localAnchor2.x-f.m_sweep.localCenter.x,p=this.m_localAnchor2.y-f.m_sweep.localCenter.y,h=e.col1.x*n+e.col2.x*p,p=e.col1.y*n+e.col2.y*p,n=h,k=f.m_sweep.c.x+n-b.m_sweep.c.x-l,m=f.m_sweep.c.y+p-b.m_sweep.c.y-d,r=k*k+m*m;e=Math.sqrt(r);var h=b.m_invMass,v=f.m_invMass,u=b.m_invI,x=f.m_invI,z=10*c.b2_linearSlop;r>z*z&&(r=1/(h+v),k=r*-k,m=r*-m,b.m_sweep.c.x-=0.5*h*k,b.m_sweep.c.y-=0.5*h*m,f.m_sweep.c.x+=0.5*v*k,f.m_sweep.c.y+=0.5*v*m,k=f.m_sweep.c.x+n-b.m_sweep.c.x-
- l,m=f.m_sweep.c.y+p-b.m_sweep.c.y-d);this.K1.col1.x=h+v;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=h+v;this.K2.col1.x=u*d*d;this.K2.col2.x=-u*l*d;this.K2.col1.y=-u*l*d;this.K2.col2.y=u*l*l;this.K3.col1.x=x*p*p;this.K3.col2.x=-x*n*p;this.K3.col1.y=-x*n*p;this.K3.col2.y=x*n*n;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(B.tImpulse,-k,-m);k=B.tImpulse.x;m=B.tImpulse.y;b.m_sweep.c.x-=b.m_invMass*k;b.m_sweep.c.y-=b.m_invMass*m;b.m_sweep.a-=b.m_invI*(l*m-d*k);f.m_sweep.c.x+=
- f.m_invMass*k;f.m_sweep.c.y+=f.m_invMass*m;f.m_sweep.a+=f.m_invI*(n*m-p*k);b.SynchronizeTransform();f.SynchronizeTransform();return e<=c.b2_linearSlop&&g<=c.b2_angularSlop};Box2D.postDefs.push(function(){Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse=new b});Box2D.inherit(K,Box2D.Dynamics.Joints.b2JointDef);K.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;K.b2RevoluteJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB=
- new b};K.prototype.b2RevoluteJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_revoluteJoint;this.localAnchorA.Set(0,0);this.localAnchorB.Set(0,0);this.motorSpeed=this.maxMotorTorque=this.upperAngle=this.lowerAngle=this.referenceAngle=0;this.enableMotor=this.enableLimit=!1};K.prototype.Initialize=function(a,b,c){this.bodyA=a;this.bodyB=b;this.localAnchorA=this.bodyA.GetLocalPoint(c);this.localAnchorB=this.bodyB.GetLocalPoint(c);this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()};
- Box2D.inherit(I,Box2D.Dynamics.Joints.b2Joint);I.prototype.__super=Box2D.Dynamics.Joints.b2Joint.prototype;I.b2WeldJoint=function(){Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this,arguments);this.m_localAnchorA=new b;this.m_localAnchorB=new b;this.m_impulse=new f;this.m_mass=new d};I.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchorA)};I.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchorB)};I.prototype.GetReactionForce=function(a){void 0===
- a&&(a=0);return new b(a*this.m_impulse.x,a*this.m_impulse.y)};I.prototype.GetReactionTorque=function(a){void 0===a&&(a=0);return a*this.m_impulse.z};I.prototype.b2WeldJoint=function(a){this.__super.b2Joint.call(this,a);this.m_localAnchorA.SetV(a.localAnchorA);this.m_localAnchorB.SetV(a.localAnchorB);this.m_referenceAngle=a.referenceAngle;this.m_impulse.SetZero();this.m_mass=new d};I.prototype.InitVelocityConstraints=function(a){var b,c=0,d=this.m_bodyA,e=this.m_bodyB;b=d.m_xf.R;var f=this.m_localAnchorA.x-
- d.m_sweep.localCenter.x,g=this.m_localAnchorA.y-d.m_sweep.localCenter.y,c=b.col1.x*f+b.col2.x*g,g=b.col1.y*f+b.col2.y*g,f=c;b=e.m_xf.R;var h=this.m_localAnchorB.x-e.m_sweep.localCenter.x,k=this.m_localAnchorB.y-e.m_sweep.localCenter.y,c=b.col1.x*h+b.col2.x*k,k=b.col1.y*h+b.col2.y*k,h=c;b=d.m_invMass;var c=e.m_invMass,m=d.m_invI,l=e.m_invI;this.m_mass.col1.x=b+c+g*g*m+k*k*l;this.m_mass.col2.x=-g*f*m-k*h*l;this.m_mass.col3.x=-g*m-k*l;this.m_mass.col1.y=this.m_mass.col2.x;this.m_mass.col2.y=b+c+f*f*
- m+h*h*l;this.m_mass.col3.y=f*m+h*l;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=m+l;a.warmStarting?(this.m_impulse.x*=a.dtRatio,this.m_impulse.y*=a.dtRatio,this.m_impulse.z*=a.dtRatio,d.m_linearVelocity.x-=b*this.m_impulse.x,d.m_linearVelocity.y-=b*this.m_impulse.y,d.m_angularVelocity-=m*(f*this.m_impulse.y-g*this.m_impulse.x+this.m_impulse.z),e.m_linearVelocity.x+=c*this.m_impulse.x,e.m_linearVelocity.y+=c*this.m_impulse.y,e.m_angularVelocity+=l*
- (h*this.m_impulse.y-k*this.m_impulse.x+this.m_impulse.z)):this.m_impulse.SetZero()};I.prototype.SolveVelocityConstraints=function(a){var b,c=0;a=this.m_bodyA;var d=this.m_bodyB,e=a.m_linearVelocity,g=a.m_angularVelocity,h=d.m_linearVelocity,k=d.m_angularVelocity,m=a.m_invMass,l=d.m_invMass,n=a.m_invI,p=d.m_invI;b=a.m_xf.R;var q=this.m_localAnchorA.x-a.m_sweep.localCenter.x,r=this.m_localAnchorA.y-a.m_sweep.localCenter.y,c=b.col1.x*q+b.col2.x*r,r=b.col1.y*q+b.col2.y*r,q=c;b=d.m_xf.R;var v=this.m_localAnchorB.x-
- d.m_sweep.localCenter.x,u=this.m_localAnchorB.y-d.m_sweep.localCenter.y,c=b.col1.x*v+b.col2.x*u,u=b.col1.y*v+b.col2.y*u,v=c;b=h.x-k*u-e.x+g*r;var c=h.y+k*v-e.y-g*q,x=k-g,z=new f;this.m_mass.Solve33(z,-b,-c,-x);this.m_impulse.Add(z);e.x-=m*z.x;e.y-=m*z.y;g-=n*(q*z.y-r*z.x+z.z);h.x+=l*z.x;h.y+=l*z.y;k+=p*(v*z.y-u*z.x+z.z);a.m_angularVelocity=g;d.m_angularVelocity=k};I.prototype.SolvePositionConstraints=function(b){var d,e=0;b=this.m_bodyA;var g=this.m_bodyB;d=b.m_xf.R;var h=this.m_localAnchorA.x-b.m_sweep.localCenter.x,
- k=this.m_localAnchorA.y-b.m_sweep.localCenter.y,e=d.col1.x*h+d.col2.x*k,k=d.col1.y*h+d.col2.y*k,h=e;d=g.m_xf.R;var m=this.m_localAnchorB.x-g.m_sweep.localCenter.x,l=this.m_localAnchorB.y-g.m_sweep.localCenter.y,e=d.col1.x*m+d.col2.x*l,l=d.col1.y*m+d.col2.y*l,m=e;d=b.m_invMass;var e=g.m_invMass,n=b.m_invI,p=g.m_invI,q=g.m_sweep.c.x+m-b.m_sweep.c.x-h,r=g.m_sweep.c.y+l-b.m_sweep.c.y-k,v=g.m_sweep.a-b.m_sweep.a-this.m_referenceAngle,u=10*c.b2_linearSlop,x=Math.sqrt(q*q+r*r),z=a.Abs(v);x>u&&(n*=1,p*=1);
- this.m_mass.col1.x=d+e+k*k*n+l*l*p;this.m_mass.col2.x=-k*h*n-l*m*p;this.m_mass.col3.x=-k*n-l*p;this.m_mass.col1.y=this.m_mass.col2.x;this.m_mass.col2.y=d+e+h*h*n+m*m*p;this.m_mass.col3.y=h*n+m*p;this.m_mass.col1.z=this.m_mass.col3.x;this.m_mass.col2.z=this.m_mass.col3.y;this.m_mass.col3.z=n+p;u=new f;this.m_mass.Solve33(u,-q,-r,-v);b.m_sweep.c.x-=d*u.x;b.m_sweep.c.y-=d*u.y;b.m_sweep.a-=n*(h*u.y-k*u.x+u.z);g.m_sweep.c.x+=e*u.x;g.m_sweep.c.y+=e*u.y;g.m_sweep.a+=p*(m*u.y-l*u.x+u.z);b.SynchronizeTransform();
- g.SynchronizeTransform();return x<=c.b2_linearSlop&&z<=c.b2_angularSlop};Box2D.inherit(E,Box2D.Dynamics.Joints.b2JointDef);E.prototype.__super=Box2D.Dynamics.Joints.b2JointDef.prototype;E.b2WeldJointDef=function(){Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this,arguments);this.localAnchorA=new b;this.localAnchorB=new b};E.prototype.b2WeldJointDef=function(){this.__super.b2JointDef.call(this);this.type=q.e_weldJoint;this.referenceAngle=0};E.prototype.Initialize=function(a,b,c){this.bodyA=a;
- this.bodyB=b;this.localAnchorA.SetV(this.bodyA.GetLocalPoint(c));this.localAnchorB.SetV(this.bodyB.GetLocalPoint(c));this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()}})();
- (function(){var c=Box2D.Dynamics.b2DebugDraw;c.b2DebugDraw=function(){this.m_xformScale=this.m_fillAlpha=this.m_alpha=this.m_lineThickness=this.m_drawScale=1;var c=this;this.m_sprite={graphics:{clear:function(){c.m_ctx.clearRect(0,0,c.m_ctx.canvas.width,c.m_ctx.canvas.height)}}}};c.prototype._color=function(c,d){return"rgba("+((c&16711680)>>16)+","+((c&65280)>>8)+","+(c&255)+","+d+")"};c.prototype.b2DebugDraw=function(){this.m_drawFlags=0};c.prototype.SetFlags=function(c){void 0===c&&(c=0);this.m_drawFlags=
- c};c.prototype.GetFlags=function(){return this.m_drawFlags};c.prototype.AppendFlags=function(c){void 0===c&&(c=0);this.m_drawFlags|=c};c.prototype.ClearFlags=function(c){void 0===c&&(c=0);this.m_drawFlags&=~c};c.prototype.SetSprite=function(c){this.m_ctx=c};c.prototype.GetSprite=function(){return this.m_ctx};c.prototype.SetDrawScale=function(c){void 0===c&&(c=0);this.m_drawScale=c};c.prototype.GetDrawScale=function(){return this.m_drawScale};c.prototype.SetLineThickness=function(c){void 0===c&&(c=
- 0);this.m_lineThickness=c;this.m_ctx.strokeWidth=c};c.prototype.GetLineThickness=function(){return this.m_lineThickness};c.prototype.SetAlpha=function(c){void 0===c&&(c=0);this.m_alpha=c};c.prototype.GetAlpha=function(){return this.m_alpha};c.prototype.SetFillAlpha=function(c){void 0===c&&(c=0);this.m_fillAlpha=c};c.prototype.GetFillAlpha=function(){return this.m_fillAlpha};c.prototype.SetXFormScale=function(c){void 0===c&&(c=0);this.m_xformScale=c};c.prototype.GetXFormScale=function(){return this.m_xformScale};
- c.prototype.DrawPolygon=function(c,d,a){if(d){var b=this.m_ctx,f=this.m_drawScale;b.beginPath();b.strokeStyle=this._color(a.color,this.m_alpha);b.moveTo(c[0].x*f,c[0].y*f);for(a=1;a<d;a++)b.lineTo(c[a].x*f,c[a].y*f);b.lineTo(c[0].x*f,c[0].y*f);b.closePath();b.stroke()}};c.prototype.DrawSolidPolygon=function(c,d,a){if(d){var b=this.m_ctx,f=this.m_drawScale;b.beginPath();b.strokeStyle=this._color(a.color,this.m_alpha);b.fillStyle=this._color(a.color,this.m_fillAlpha);b.moveTo(c[0].x*f,c[0].y*f);for(a=
- 1;a<d;a++)b.lineTo(c[a].x*f,c[a].y*f);b.lineTo(c[0].x*f,c[0].y*f);b.closePath();b.fill();b.stroke()}};c.prototype.DrawCircle=function(c,d,a){if(d){var b=this.m_ctx,f=this.m_drawScale;b.beginPath();b.strokeStyle=this._color(a.color,this.m_alpha);b.arc(c.x*f,c.y*f,d*f,0,2*Math.PI,!0);b.closePath();b.stroke()}};c.prototype.DrawSolidCircle=function(c,d,a,b){if(d){var f=this.m_ctx,m=this.m_drawScale,h=c.x*m,g=c.y*m;f.moveTo(0,0);f.beginPath();f.strokeStyle=this._color(b.color,this.m_alpha);f.fillStyle=
- this._color(b.color,this.m_fillAlpha);f.arc(h,g,d*m,0,2*Math.PI,!0);f.moveTo(h,g);f.lineTo((c.x+a.x*d)*m,(c.y+a.y*d)*m);f.closePath();f.fill();f.stroke()}};c.prototype.DrawSegment=function(c,d,a){var b=this.m_ctx,f=this.m_drawScale;b.strokeStyle=this._color(a.color,this.m_alpha);b.beginPath();b.moveTo(c.x*f,c.y*f);b.lineTo(d.x*f,d.y*f);b.closePath();b.stroke()};c.prototype.DrawTransform=function(c){var d=this.m_ctx,a=this.m_drawScale;d.beginPath();d.strokeStyle=this._color(16711680,this.m_alpha);
- d.moveTo(c.position.x*a,c.position.y*a);d.lineTo((c.position.x+this.m_xformScale*c.R.col1.x)*a,(c.position.y+this.m_xformScale*c.R.col1.y)*a);d.strokeStyle=this._color(65280,this.m_alpha);d.moveTo(c.position.x*a,c.position.y*a);d.lineTo((c.position.x+this.m_xformScale*c.R.col2.x)*a,(c.position.y+this.m_xformScale*c.R.col2.y)*a);d.closePath();d.stroke()}})();var i;for(i=0;i<Box2D.postDefs.length;++i)Box2D.postDefs[i]();delete Box2D.postDefs;"undefined"!==typeof require&&(module.exports=Box2D);(function(c){var e=function(){function c(){}c.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};return c}();c.NumberUtils=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._time=0;this.frameRate=60}__extends(a,d);a.prototype.executeMainLoop=function(b,d){var e=this,h=function(){var g=c.getTimer();b.call(d,g-e._time);e._time=g;a.requestAnimationFrame.call(window,h)};a.requestAnimationFrame.call(window,h)};a.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,
- 1E3/60)};return a}(c.DeviceContext);c.HTML5DeviceContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(a){this.canvas=a;this.canvasContext=a.getContext("2d");var c=this.canvasContext.setTransform,e=this;this.canvasContext.setTransform=function(a,b,d,l,n,p){e._matrixA=a;e._matrixB=b;e._matrixC=d;e._matrixD=l;e._matrixTx=n;e._matrixTy=p;c.call(e.canvasContext,a,b,d,l,n,p)};this._matrixA=1;this._matrixC=this._matrixB=0;this._matrixD=1;this._transformTy=this._transformTx=this._matrixTy=this._matrixTx=0;d.call(this)}__extends(a,d);a.prototype.clearScreen=function(){this.setTransform(c.Matrix.identity.identity());
- for(var a=c.RenderFilter.getInstance().getDrawAreaList(),d=0,e=a.length;d<e;d++){var h=a[d];this.clearRect(h.x+this._transformTx,h.y+this._transformTy,h.width,h.height)}this.renderCost=0};a.prototype.clearRect=function(a,c,d,e){this.canvasContext.clearRect(a,c,d,e)};a.prototype.drawImage=function(a,e,m,h,g,k,l,n,p){e/=c.MainContext.instance.rendererContext.texture_scale_factor;m/=c.MainContext.instance.rendererContext.texture_scale_factor;h/=c.MainContext.instance.rendererContext.texture_scale_factor;
- g/=c.MainContext.instance.rendererContext.texture_scale_factor;c.DEBUG&&c.DEBUG.DRAW_IMAGE&&c.DEBUG.checkDrawImage(a,e,m,h,g,k,l,n,p);a=a._bitmapData;var q=c.getTimer();k+=this._transformTx;l+=this._transformTy;this.canvasContext.drawImage(a,e,m,h,g,k,l,n,p);d.prototype.drawImage.call(this,a,e,m,h,g,k,l,n,p);this.renderCost+=c.getTimer()-q};a.prototype.setTransform=function(a){1==a.a&&0==a.b&&0==a.c&&1==a.d&&1==this._matrixA&&0==this._matrixB&&0==this._matrixC&&1==this._matrixD?(this._transformTx=
- a.tx-this._matrixTx,this._transformTy=a.ty-this._matrixTy):(this._transformTx=this._transformTy=0,(this._matrixA!=a.a||this._matrixB!=a.b||this._matrixC!=a.c||this._matrixD!=a.d||this._matrixTx!=a.tx||this._matrixTy!=a.ty)&&this.canvasContext.setTransform(a.a,a.b,a.c,a.d,a.tx,a.ty))};a.prototype.save=function(){this.canvasContext.save()};a.prototype.restore=function(){this.canvasContext.restore();this.canvasContext.setTransform(1,0,0,1,0,0)};a.prototype.setAlpha=function(a,d){a!=this.canvasContext.globalAlpha&&
- (this.canvasContext.globalAlpha=a);this.canvasContext.globalCompositeOperation=d?d.value:c.BlendMode.NORMAL.value};a.prototype.setupFont=function(a,c,d){var e=this.canvasContext;e.font=a;e.textAlign=c||"left";e.textBaseline=d||"top"};a.prototype.measureText=function(a){return this.canvasContext.measureText(a).width};a.prototype.drawText=function(a,c,e,h,g){var k=a._strokeColorString,l=a.stroke,n=this.canvasContext;n.fillStyle=a._textColorString;n.strokeStyle=k;l&&(n.lineWidth=2*l,n.strokeText(c,e+
- this._transformTx,h+this._transformTy,g||65535));n.fillText(c,e+this._transformTx,h+this._transformTy,g||65535);d.prototype.drawText.call(this,a,c,e,h,g)};a.prototype.clip=function(a,c,d,e){this.canvasContext.beginPath();this.canvasContext.rect(a+this._transformTx,c+this._transformTy,d,e);this.canvasContext.clip();this.canvasContext.closePath()};a.prototype.strokeRect=function(a,c,d,e,g){this.canvasContext.strokeStyle=g;this.canvasContext.strokeRect(a,c,d,e)};return a}(c.RendererContext);c.HTML5CanvasRenderer=
- e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._soundList={};this._canPlay=!0;this._supportedFormat=[];var a=this._capabilities={mp3:!1,ogg:!1,wav:!1,mp4:!1,m4a:!1};this._checkCanPlay(a);for(var c in a)if(a[c]){this._soundSupported=!0;break}a=navigator.userAgent;if(/Mobile/.test(a)&&(/iPhone OS/.test(a)||/iPad/.test(a)||/Firefox/.test(a))||/MSIE/.test(a))this._canPlay=!1;this._getSupportedAudioFormat()}__extends(a,d);a.prototype._checkCanPlay=function(a){var c=document.createElement("audio");
- if(c.canPlayType){var d=function(a){a=c.canPlayType(a);return"no"!=a&&""!=a};a.mp3=d("audio/mpeg");a.mp4=d("audio/mp4");a.m4a=d("audio/x-m4a")||d("audio/aac");a.ogg=d('audio/ogg; codecs\x3d"vorbis"');a.wav=d('audio/wav; codecs\x3d"1"')}};a.prototype.preloadSound=function(a){if(this._soundSupported){var d=this._getExtFromFullPath(a);if(this.isFormatSupported(d)&&!this._soundList.hasOwnProperty(a)&&this._canPlay){d=new Audio(c.ResourceLoader.prefix+a);d.preload="auto";var e=function(a){this.removeEventListener("canplaythrough",
- e,!1);this.removeEventListener("error",h,!1)},h=function(a){this.removeEventListener("canplaythrough",e,!1);this.removeEventListener("error",h,!1)};d.addEventListener("canplaythrough",e,!1);d.addEventListener("error",h,!1);this._soundList[a]=d;d.load()}}};a.prototype._getSupportedAudioFormat=function(){if(this._soundSupported){var a=["ogg","mp3","wav","mp4","m4a"],c;for(c in a){var d=a[c];this._capabilities[d]&&this._supportedFormat.push(d)}}};a.prototype.isFormatSupported=function(a){var c=this._supportedFormat,
- d;for(d in c)if(a===c[d])return!0;return!1};a.prototype._getExtFromFullPath=function(a){var c=a.lastIndexOf(".");return-1!==c?a.substring(c+1,a.length):""};a.prototype.playMusic=function(a,d){"undefined"===typeof d&&(d=!0);if(this._soundSupported){var e,h=this._soundList;h.hasOwnProperty(this._playingMusicName)&&h[this._playingMusicName].pause();this._playingMusicName=a;h.hasOwnProperty(this._playingMusicName)?e=h[this._playingMusicName]:(e=new Audio(c.ResourceLoader.prefix+a),e.preload="auto",h[a]=
- e,e.load());e.addEventListener("pause",function(){c.SoundContext.isMusicPlaying=!1;this.removeEventListener("pause",arguments.callee,!1)},!1);isNaN(e.duration)||(e.currentTime=0);e.loop=d;e.play();c.SoundContext.isMusicPlaying=!0}};a.prototype.stopMusic=function(a){var d=this._soundList,e=this._playingMusicName;if(d.hasOwnProperty(e)){var h=d[e];h.pause();h.currentTime=h.duration;a&&delete d[e];c.SoundContext.isMusicPlaying=!1}};return a}(c.SoundContext);c.HTML5SoundContext=e})(ns_egret||(ns_egret=
- {}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.apply(this,arguments)}__extends(a,d);a.prototype.send=function(a){function d(){4==g.readyState&&200==g.status&&e(g)}function e(d){d=d.responseText;this.type==c.ResourceLoader.DATA_TYPE_BINARY&&(d=h._stringConvertToArray(d));a.callback.call(a.thisObj,d)}if(a.type==c.ResourceLoader.DATA_TYPE_IMAGE)this.loadImage(a);else{var h=this,g=this._getXMLHttpRequest();g.open(a.method,a.prefix+a.url);"GET"!=a.method&&g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
- void 0!=a.type&&this._setXMLHttpRequestHeader(g,a.type);g.onreadystatechange=d;g.send("GET"!=a.method?a.data:null)}};a.prototype.loadImage=function(a){function d(){h.removeEventListener("load",d);h.removeEventListener("error",d);var e=c.Texture.create(a.url);e.bitmapData=h;c.TextureCache.getInstance().addTexture(a.url,e);a.callback.call(a.thisObj,e)}function e(){h.removeEventListener("error",e)}var h=new Image;h.crossOrigin="Anonymous";var g=a.prefix+a.url;h.addEventListener("load",d);h.addEventListener("error",
- e);h.src=g};a.prototype._stringConvertToArray=function(a){if(!a)return null;for(var c=new Uint8Array(a.length),d=0;d<a.length;d++)c[d]=a.charCodeAt(d)&255;return c};a.prototype._setXMLHttpRequestHeader=function(a,d){/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)?d==c.ResourceLoader.DATA_TYPE_BINARY?a.setRequestHeader("Accept-Charset","x-user-defined"):a.setRequestHeader("Accept-Charset","utf-8"):a.overrideMimeType&&(d==c.ResourceLoader.DATA_TYPE_BINARY?a.overrideMimeType("text/plain; charset\x3dx-user-defined"):
- a.overrideMimeType("text/plain; charset\x3dutf-8"))};a.prototype._getXMLHttpRequest=function(){return window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP")};return a}(c.NetContext);c.HTML5NetContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(a){d.call(this);this.canvas=a}__extends(a,d);a.prototype.run=function(){var a=this;"ontouchstart"in window?(this.canvas.addEventListener("touchstart",function(c){for(var d=c.changedTouches.length,e=0;e<d&&e<a.maxTouches;e++)a._onTouchBegin(c.changedTouches[e]);c.stopPropagation();c.preventDefault()},!1),this.canvas.addEventListener("touchmove",function(c){for(var d=c.changedTouches.length,e=0;e<d&&e<a.maxTouches;e++)a._onTouchMove(c.changedTouches[e]);c.stopPropagation();
- c.preventDefault()},!1),this.canvas.addEventListener("touchend",function(c){for(var d=c.changedTouches.length,e=0;e<d&&e<a.maxTouches;e++)a._onTouchEnd(c.changedTouches[e]);c.stopPropagation();c.preventDefault()},!1),this.canvas.addEventListener("touchcancel",function(c){for(var d=c.changedTouches.length,e=0;e<d&&e<a.maxTouches;e++)a._onTouchEnd(c.changedTouches[e]);c.stopPropagation();c.preventDefault()},!1)):window.navigator.msPointerEnabled?(this.canvas.addEventListener("MSPointerDown",function(c){a._onTouchBegin(c);
- c.stopPropagation();c.preventDefault()},!1),this.canvas.addEventListener("MSPointerMove",function(c){a._onTouchMove(c);c.stopPropagation();c.preventDefault()},!1),this.canvas.addEventListener("MSPointerUp",function(c){a._onTouchEnd(c);c.stopPropagation();c.preventDefault()},!1)):(this.canvas.addEventListener("mousedown",function(c){a._onTouchBegin(c)}),this.canvas.addEventListener("mousemove",function(c){a._onTouchMove(c)}),this.canvas.addEventListener("mouseup",function(c){a._onTouchEnd(c)}))};a.prototype._onTouchBegin=
- function(a){var c=this.getLocation(this.canvas,a),d=-1;a.hasOwnProperty("identifier")&&(d=a.identifier);this.onTouchBegan(c.x,c.y,d)};a.prototype._onTouchMove=function(a){var c=this.getLocation(this.canvas,a),d=-1;a.hasOwnProperty("identifier")&&(d=a.identifier);this.onTouchMove(c.x,c.y,d)};a.prototype._onTouchEnd=function(a){var c=this.getLocation(this.canvas,a),d=-1;a.hasOwnProperty("identifier")&&(d=a.identifier);this.onTouchEnd(c.x,c.y,d)};a.prototype.getLocation=function(a,d){var e=document.documentElement,
- h=window,g,k;"function"===typeof a.getBoundingClientRect?(k=a.getBoundingClientRect(),g=k.left,k=k.top):k=g=0;g+=h.pageXOffset-e.clientLeft;k+=h.pageYOffset-e.clientTop;null!=d.pageX?(e=d.pageX,h=d.pageY):(g-=document.body.scrollLeft,k-=document.body.scrollTop,e=d.clientX,h=d.clientY);var l=c.Point.identity;l.x=(e-g)/c.StageDelegate.getInstance().getScaleX();l.y=(h-k)/c.StageDelegate.getInstance().getScaleY();return l};return a}(c.TouchContext);c.HTML5TouchContext=e})(ns_egret||(ns_egret={}));__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};(function(c){var e=function(d){function a(){d.call(this)}__extends(a,d);a.prototype.createLoadingController=function(){return new c.LoadingController};a.prototype.getAssets=function(a){return c.ResourceLoader.create(a).data};return a}(c.AssetsContext);c.HTML5AssetsContext=e})(ns_egret||(ns_egret={}));egret_h5={prefix:"",loadScript:function(c,e){var d=0,a=function(){egret_h5.loadSingleScript(egret_h5.prefix+c[d],function(){d++;d>=c.length?e():a()})};a()},loadSingleScript:function(c,e){var d=document.createElement("script");d.hasOwnProperty("async")&&(d.async=!1);d.src=c;d.addEventListener("load",function(){this.removeEventListener("load",arguments.callee,!1);e()},!1);document.body.appendChild(d)},startGame:function(){var c=document.getElementById(ns_egret.StageDelegate.canvas_name);context=ns_egret.MainContext.instance;
- context.rendererContext=new ns_egret.HTML5CanvasRenderer(c);context.netContext=new ns_egret.HTML5NetContext;context.touchContext=new ns_egret.HTML5TouchContext(c);context.deviceContext=new ns_egret.HTML5DeviceContext;var e=new ns_egret.EqualToFrame,d=ns_egret.Browser.getInstance().isMobile?new ns_egret.FixedWidth:new ns_egret.FixedSize(480,800),e=new ns_egret.ResolutionPolicy(e,d);ns_egret.StageDelegate.getInstance().setDesignSize(480,800,e);context.stage=new ns_egret.Stage(c.width,c.height);ns_egret.ResourceLoader.prefix=
- "assets/480/";ns_egret.RendererContext.CONTENT_SCALE_FACTOR=1;context.run();app&&app.startGame&&app.startGame()},preloadScript:function(c,e){egret_h5.preloadList||(egret_h5.preloadList=[]);egret_h5.preloadList=egret_h5.preloadList.concat(c.map(function(c){return e+c}))},startLoading:function(){egret_h5.loadScript(egret_h5.preloadList,egret_h5.startGame)}};var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},GameApp=function(){function c(){}c.prototype.startGame=function(){ns_egret.ResourceLoader.registerHandler("png",ImageResourceLoader);ns_egret.ResourceLoader.registerHandler("jpg",ImageResourceLoader);ns_egret.ResourceLoader.registerHandler("json",MovieClipDataResourceLoader);var c=new LoadingManager(this.loadAssets,this,null),d=["images/background/loadingmap.jpg",
- "images/background/loadingbar_01.png","images/background/loadingbar_02.png"],a;for(a in d)c.addPreLoad(d[a],LoadingManager.DATA_TYPE_IMAGE);c.startLoading();this.systemManager=new ns_egret.SystemManager;ns_egret.MainContext.instance.stage.addChild(this.systemManager)};c.prototype.loadAssets=function(){var c=new LoadingManager(this.onResourceLoadComplete,this,new LoadingUI),d=loli_img_str.split(" "),
- a;for(a in d){var b=d[a];c.addPreLoad(b,LoadingManager.DATA_TYPE_IMAGE)}d=["ui/Result.jmc","ui/MainMenuSkin.jmc"];for(a in d)b=d[a],c.addPreLoad(b,LoadingManager.DATA_TYPE_MC);c.addPreLoad("images/table/wave.xml",LoadingManager.DATA_TYPE_TEXT);c.addPreLoad("images/table/monster.xml",LoadingManager.DATA_TYPE_TEXT);c.addPreLoad("images/table/drop.xml",LoadingManager.DATA_TYPE_TEXT);c.startLoading()};c.prototype.onResourceLoadComplete=function(){utils.Config.initConfig();this.createGameScene()};c.prototype.createGameScene=
- function(){this.stateMachine=new StateMachine;this.stateMachine.changeState(new MainMenuState)};return c}(),ImageResourceLoader=function(c){function e(d){c.call(this,d,ns_egret.ResourceLoader.DATA_TYPE_IMAGE)}__extends(e,c);return e}(ns_egret.ResourceLoader),MovieClipDataResourceLoader=function(c){function e(d){c.call(this,d,ns_egret.ResourceLoader.DATA_TYPE_TEXT);this.onLoadComplete=function(a){this.data=JSON.parse(a)}}__extends(e,c);return e}(ns_egret.ResourceLoader),TextResourceLoader=function(c){function e(d){c.call(this,
- d,ns_egret.ResourceLoader.DATA_TYPE_TEXT);this.onLoadComplete=function(a){this.data=a}}__extends(e,c);return e}(ns_egret.ResourceLoader),utils;
- (function(c){c.createBitmap=function(c){var a=new ns_egret.Bitmap;c=ns_egret.TextureCache.getInstance().getTexture(c);a.texture=c;return a};c.createMovieClip=function(c){var a=ns_egret.ResourceLoader.create(c+".json").data;c=ns_egret.TextureCache.getInstance().getTexture(c+".png");return new ns_egret.MovieClip(a,c)};c.getGameHeight=function(){return ns_egret.MainContext.instance.stage.stageHeight};c.getGameWidth=function(){return ns_egret.MainContext.instance.stage.stageWidth};var e=function(){function c(){}
- c.initConfig=function(){var a=ns_egret.ResourceLoader.create("images/table/monster.xml").data;c.enemyData=new ns_egret.XML(a);a=ns_egret.ResourceLoader.create("images/table/drop.xml").data;c.dropData=new ns_egret.XML(a)};return c}();c.Config=e;c.getEnemyConfigById=function(c){return e.enemyData.elements[0].element[c-1]};c.getItemConfigById=function(c){return e.dropData.items[0].element[c-1]}})(utils||(utils={}));var movieclip;
- (function(c){var e=function(c){function a(a){c.call(this);this._duringTime=0;a=utils.createBitmap("images/enemy/enemy0_PList.Dir/black_gui-wring_l.png");this.addChild(a);a.x=33.75;a.y=60;a.relativeAnchorPointX=1;a.scaleX=-1;var e=utils.createBitmap("images/enemy/enemy0_PList.Dir/black_gui-wring_l.png");this.addChild(e);e.x=63.75;e.y=60;e.relativeAnchorPointX=1;var m=utils.createBitmap(loli_icon_img);this.addChild(m);m=utils.createBitmap("images/enemy/enemy0_PList.Dir/black_gui-eye_1.png");
- this.addChild(m);m.x=30;m.y=45;this.wing_left=a;this.wing_right=e}__extends(a,c);a.prototype.onTicker=function(a){this._duringTime+=a;a=20*Math.sin(10*this._duringTime/1E3%180);this.wing_left.rotation=a+90;this.wing_right.rotation=-a-90};a.create=function(b){return new a(b)};return a}(ns_egret.DisplayObjectContainer);c.EnemyMovieClip=e})(movieclip||(movieclip={}));var app=new GameApp;var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},LoadingUI=function(){function c(){}c.prototype.addToStage=function(){this.bg=new ns_egret.UIAsset;this.bg.skinName=utils.createBitmap(loli_background_img);ns_egret.PopUpManager.addPopUp(this.bg,!1,!1);this.progress=new ns_egret.ProgressBar;this.progress.slideDuration=0;this.progress.horizontalCenter=0;this.progress.bottom=
- 105;this.progress.skinName=new ProgressBarSkin;this.progress.labelFunction=function(c,d){return"\u6e38\u620f\u52a0\u8f7d\u4e2d..."+c+"/"+d};ns_egret.PopUpManager.addPopUp(this.progress,!1,!1)};c.prototype.removeFromStage=function(){ns_egret.PopUpManager.removePopUp(this.bg);ns_egret.PopUpManager.removePopUp(this.progress)};c.prototype.onProgress=function(c,d){this.progress.maximum=d;this.progress.value=c};return c}(),ProgressBarSkin=function(c){function e(){c.call(this)}__extends(e,c);Object.defineProperty(e.prototype,
- "skinParts",{get:function(){return e._skinParts},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);var d=new ns_egret.UIAsset;d.left=-64;d.top=-64;d.skinName=utils.createBitmap("images/background/loadingbar_01.png");this.addElement(d);this.thumb=new ns_egret.UIAsset;d=utils.createBitmap("images/background/loadingbar_02.png");this.thumb.skinName=d;this.addElement(this.thumb);d=d.getBounds();this.width=d.width;this.height=d.height;this.track=
- new ns_egret.UIAsset;this.track.width=d.width;this.track.height=d.height;this.addElement(this.track);this.labelDisplay=new ns_egret.Label;this.labelDisplay.textAlign=ns_egret.HorizontalAlign.CENTER;this.labelDisplay.verticalAlign=ns_egret.VerticalAlign.MIDDLE;this.labelDisplay.maxDisplayedLines=1;this.labelDisplay.size=24;this.labelDisplay.left=5;this.labelDisplay.right=5;this.labelDisplay.top=3;this.labelDisplay.bottom=3;this.labelDisplay.textColor=16777215;this.addElement(this.labelDisplay)};e._skinParts=
- ["thumb","track","labelDisplay"];return e}(ns_egret.Skin);var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},GameObject=function(){function c(){this.collisionBounds=new ns_egret.Rectangle(0,0,1,1)}c.prototype.onCreate=function(){};c.prototype.onDestroy=function(){};c.prototype.onEnterFrame=function(c){};c.prototype.addToCollision=function(){this.collisionBounds=this.view.getBounds().clone();GameScene.collision.addInitiativeObject(this)};c.prototype.getCollisionBounds=
- function(){return this.view.worldBounds};c.prototype.onHit=function(c){};return c}(),GameScene=function(c){function e(){c.call(this);this._lastTime=0;this._flag=!1;var d=ns_egret.ResourceLoader.create("images/table/wave.xml").data;this.enemyData=new ns_egret.XML(d);e.collision=new CollisionManager;this.container=new ns_egret.DisplayObjectContainer;this.view=e.container=this.container;for(d=0;50>=d;d++)ObjectPool.getInstance().destroyObject(ObjectPool.getInstance().createObject(Bullet));e.instance=
- this;this.uiContainer=new ns_egret.DisplayObjectContainer;d=utils.createBitmap("images/object/U_2_PList.Dir/s_gold1.png");d.y=35;this.uiContainer.addChild(d);this.scoreLabel=new ns_egret.TextField;this.scoreLabel.stroke=2;this.uiContainer.addChild(this.scoreLabel);this.goldLabel=new ns_egret.TextField;this.goldLabel.stroke=2;this.goldLabel.x=35;this.goldLabel.y=35;this.uiContainer.addChild(this.goldLabel);this.distanceLabel=new ns_egret.TextField;this.distanceLabel.stroke=2;this.distanceLabel.width=
- 200;this.distanceLabel.x=265;this.distanceLabel.textAlign=ns_egret.HorizontalAlign.RIGHT;this.uiContainer.addChild(this.distanceLabel);this.warnMark=utils.createBitmap("images/object/U_2_PList.Dir/warn_mark.png");this.warnMark.anchorX=0.5;this.warnLine=utils.createBitmap("images/object/U_2_PList.Dir/warn_line.png");this.warnLine.scaleY=4;this.warnLine.y=50;this.pkLine=utils.createBitmap("images/object/U_2_PList.Dir/pk_line.png");this.pkLine.y=100;this.uiContainer.addChild(this.pkLine);this.head=utils.createBitmap("images/object/U_2_PList.Dir/char_s1.png");
- this.uiContainer.addChild(this.head)}__extends(e,c);e.prototype.onCreate=function(){var c=ObjectPool.getInstance().createObject(Background);this.container.addChild(c.view);c=ObjectPool.getInstance().createObject(Hero);this.container.addChild(c.view);e.hero=c;this.scoreLabel.text=FightInfo.instance.score.toString();this.distanceLabel.text=FightInfo.instance.distance.toString()+"M";this.goldLabel.text=FightInfo.instance.gold.toString();this.head.y=400+this.pkLine.y;this._lastTime=this._wave=this.godEnemyLeft=
- 0};e.prototype.onEnterFrame=function(c){if(!(5E3<c)){for(this._lastTime+=c;300<this._lastTime;){this._wave++;for(var a=this.getEnemyConfig(),b=1;5>b;b++){var f=parseInt(a["$slot"+b]),m=ObjectPool.getInstance().createObject(Enemy);m.configId=f;this.container.addChild(m.view);m.moveTo(125*b-120);this._lastTime-=300}0==this._wave%3&&15<this._wave&&(this.container.addChild(this.warnLine),this.warnLine.x=e.hero.view.x+63,ns_egret.Tween.get(this.warnLine,{loop:!0}).to({alpha:0},100).to({alpha:1},100),this.container.addChild(this.warnMark),
- this.warnMark.x=e.hero.view.x+65,this.godEnemyX=e.hero.view.x+15,this.godEnemyLeft=1500)}0<this.godEnemyLeft&&(this.godEnemyLeft-=c,0>=this.godEnemyLeft&&(this.godEnemyLeft=0,this.container.removeChild(this.warnLine),this.container.removeChild(this.warnMark),ns_egret.Tween.removeTweens(this.warnLine),c=ObjectPool.getInstance().createObject(GodEnemy),this.container.addChild(c.view),c.moveTo(this.godEnemyX)));e.collision.hitTest();FightInfo.instance.distance+=0.1;this.distanceLabel.text=Math.floor(FightInfo.instance.distance)+
- "M";this.head.y-=0.01;this.head.y<=this.pkLine.y&&(this.head.y=400+this.pkLine.y)}};e.prototype.onGetGold=function(){FightInfo.instance.gold++;this.goldLabel.text=FightInfo.instance.gold.toString()};e.prototype.onKillMonster=function(c){FightInfo.instance.score+=c;this.scoreLabel.text=FightInfo.instance.score.toString();FightInfo.instance.monsterKill++};e.prototype.getEnemyConfig=function(){return this.enemyData.elements[0].element[this._wave]};e.prototype.onDestroy=function(){ns_egret.Tween.removeTweens(this.warnLine);
- this.container.removeChildren()};e.key="gamescene";return e}(GameObject),ObjectPool=function(){function c(){this._pool={};this._list=[];ns_egret.Ticker.getInstance().register(this.onEnterFrame,this)}c.prototype.onEnterFrame=function(c){for(var d=this._list.concat(),a=0,b=d.length;a<b;a++)d[a].onEnterFrame(c)};c.prototype.createObject=function(c){var d=c.key,a=this._pool[d];null!=a&&a.length?c=a.shift():(c=new c,c.key=d);c.onCreate();this._list.push(c);return c};c.prototype.destroyObject=function(c){var d=
- c.key;null==this._pool[d]&&(this._pool[d]=[]);this._pool[d].push(c);c.onDestroy();c=this._list.indexOf(c);-1!=c&&this._list.splice(c,1)};c.prototype.destroyAllObject=function(){for(;this._list.length;)this.destroyObject(this._list[0])};c.getInstance=function(){null==c.instance&&(c.instance=new c);return c.instance};return c}(),Background=function(c){function e(){c.call(this);this.tile_list=[];this._lastTime=this.max=this.tile_height=0;this.view=this.container=new ns_egret.DisplayObjectContainer;this.addTile();
- this.addTile();this.addTile();this.addTile();this.addTile();this.addTile();this.addTile()}__extends(e,c);e.prototype.addTile=function(){var c=utils.createBitmap(loli_01_img);this.container.addChild(c);this.tile_height=c.getBounds().height;this.max=this.tile_list.length*this.tile_height;c.y=-this.max;this.tile_list.push(c)};e.prototype.onEnterFrame=function(c){for(this._lastTime+=c;50<this._lastTime;)this._lastTime-=50;this.view.y+=0.2*c;this.view.y>=this.max&&this.addTile()};e.key=
- "background";return e}(GameObject),Hero=function(c){function e(){c.call(this);this._isDead=!1;this.view=this.container=new ns_egret.DisplayObjectContainer;var d=utils.createMovieClip("hero10");this.container.addChild(d);d.setInterval(4);this.hero=d}__extends(e,c);e.prototype.onCreate=function(){this._isDead=!1;GameScene.collision.addInitiativeObject(this);this.hero.gotoAndPlay("run");this.view.x=240+400*Math.random()-200;this.view.y=utils.getGameHeight()-100;this._doubleTime=this._lastTime=0};e.prototype.onDestroy=
- function(){this.hero.gotoAndStop("run");this._isDead=!0;GameScene.collision.removeInitiativeObject(this)};e.prototype.onEnterFrame=function(c){for(this._lastTime+=c;100<this._lastTime;)this._lastTime-=100,0<this._doubleTime?(this.createBullet(2),this.createBullet(-2)):this.createBullet(0);0<this._doubleTime&&(this._doubleTime-=c)};e.prototype.onHit=function(c){if((c instanceof Enemy||c instanceof GodEnemy)&&0<c.view.y)app.stateMachine.changeState(new FightResultState),ObjectPool.getInstance().destroyObject(GameScene.instance),
- ObjectPool.getInstance().destroyAllObject()};e.prototype.createBullet=function(c){var a=ObjectPool.getInstance().createObject(Bullet);GameScene.container.addChild(a.view);a.view.x=this.view.x+20*c+65;a.view.y=this.view.y};e.prototype.moveTo=function(c){this.view.x=c-65};e.prototype.onGetDouble=function(){this._doubleTime=1E4};e.prototype.getCollisionBounds=function(){var d=c.prototype.getCollisionBounds.call(this);return this.collisionBounds.initialize(d.x+30,d.y,d.width-60,d.height)};e.key="hero";
- return e}(GameObject),Bullet=function(c){function e(){c.call(this);this._isDead=!1;console.log("create");this.view=utils.createBitmap("images/object/bullet_PList.Dir/bullet036.png");this.view.anchorX=this.view.anchorY=0.5}__extends(e,c);e.prototype.onCreate=function(){GameScene.collision.addInitiativeObject(this);this._isDead=!1;this.damage=45};e.prototype.onHit=function(c){!(c instanceof Item)&&!(c instanceof GodEnemy)&&(this._isDead&&(this.view.parent&&(this.view.parent.removeChild(this.view),ObjectPool.getInstance().destroyObject(this)),
- this._isDead=!1),this._isDead=!0)};e.prototype.onDestroy=function(){GameScene.collision.removeInitiativeObject(this)};e.prototype.onEnterFrame=function(c){this.view.y-=c;0>=this.view.y&&this.view.parent&&(this.view.parent.removeChild(this.view),ObjectPool.getInstance().destroyObject(this))};e.key="bullet";return e}(GameObject),Enemy=function(c){function e(){c.call(this);var d=new ns_egret.DisplayObjectContainer;this.view=d;this.progress=new ns_egret.ProgressBar;this.progress.slideDuration=0;this.progress.horizontalCenter=
- 0;this.progress.x=3;this.progress.y=95;this.progress.skinName=new EnemyProgressBarSkin;d.addChild(this.progress)}__extends(e,c);Object.defineProperty(e.prototype,"configId",{set:function(c){this._configId!=c&&(this._configId=c,c=utils.getEnemyConfigById(c),this.hpMax=parseInt(c.$hp),this.hp=parseInt(c.$hp),this.mc&&this.view.removeChild(this.mc),this.mc=movieclip.EnemyMovieClip.create(this._configId),this.view.addChild(this.mc))},enumerable:!0,configurable:!0});e.prototype.onCreate=function(){GameScene.collision.addPassiveObject(this);
- this.view.y=-120;this.progress.maximum=1;this.progress.value=1;this.progress.visible=!1};e.prototype.onDestroy=function(){GameScene.collision.removePassiveObject(this)};e.prototype.onHit=function(c){c instanceof Bullet&&-90<this.view.y&&(this.hp-=c.damage,0>this.hp?(this.dead(),this.dropItem(),GameScene.instance.onKillMonster(Math.floor(this.hpMax/10))):(this.progress.maximum=this.hpMax,this.progress.value=this.hp,this.progress.visible=!0))};e.prototype.onEnterFrame=function(c){this.mc.onTicker(c);
- this.view.y+=0.3*c;this.view.y>utils.getGameHeight()&&this.dead()};e.prototype.moveTo=function(c){this.view.x=c};e.prototype.dead=function(){this.view.parent.removeChild(this.view);ObjectPool.getInstance().destroyObject(this)};e.prototype.dropItem=function(){for(var c=9939*Math.random(),a=1,b=utils.getItemConfigById(a);parseInt(b.$rangmax)<c;)a++,b=utils.getItemConfigById(a);c=ObjectPool.getInstance().createObject(Item);c.config=b;c.view.x=this.view.x;c.view.y=this.view.y;GameScene.container.addChild(c.view)};
- e.key="enemy";return e}(GameObject),GodEnemy=function(c){function e(){c.call(this);this.view=utils.createBitmap("images/object/U_2_PList.Dir/rock.png")}__extends(e,c);e.prototype.onCreate=function(){GameScene.collision.addPassiveObject(this);this.view.y=-90};e.prototype.onDestroy=function(){GameScene.collision.removePassiveObject(this)};e.prototype.onHit=function(c){};e.prototype.onEnterFrame=function(c){this.view.y+=0.8*c;this.view.y>utils.getGameHeight()&&this.dead()};e.prototype.moveTo=function(c){this.view.x=
- c};e.prototype.dead=function(){this.view.parent.removeChild(this.view);ObjectPool.getInstance().destroyObject(this)};e.key="godEnemy";return e}(GameObject),EnemyProgressBarSkin=function(c){function e(){c.call(this)}__extends(e,c);Object.defineProperty(e.prototype,"skinParts",{get:function(){return e._skinParts},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);var d=new ns_egret.UIAsset;d.skinName=utils.createBitmap("images/progress_monsterBg.png");
- this.addElement(d);this.thumb=new ns_egret.UIAsset;d=utils.createBitmap("images/progress_monsterBar.png");this.thumb.skinName=d;this.addElement(this.thumb);d=d.getBounds();this.width=d.width;this.height=d.height;this.track=new ns_egret.UIAsset;this.track.width=d.width;this.track.height=d.height;this.addElement(this.track)};e._skinParts=["thumb","track"];return e}(ns_egret.Skin),Item=function(c){function e(){c.call(this);this._acc=0.04;this._maxY=1}__extends(e,c);Object.defineProperty(e.prototype,
- "config",{set:function(c){this._configId=parseInt(c.$type);var a=utils.createBitmap("images/object/U_2_PList.Dir/"+c.$img);a.scaleX=a.scaleY=parseFloat(c.$scale);this.view=a;this.view.anchorX=this.view.anchorY=0.5},enumerable:!0,configurable:!0});e.prototype.onCreate=function(){GameScene.collision.addPassiveObject(this);this._velocityX=Math.floor(20*Math.random()-10)/100;this._rotation=5*(this._velocityX/Math.abs(this._velocityX));this._velocityY=-0.3+this._velocityX};e.prototype.onDestroy=function(){GameScene.collision.removePassiveObject(this)};
- e.prototype.onHit=function(c){if(c instanceof Hero)if(this.remove(),1==this._configId)GameScene.instance.onGetGold();else if(2==this._configId)GameScene.hero.onGetDouble()};e.prototype.onEnterFrame=function(c){this.view.x+=this._velocityX*c;this.view.x>utils.getGameWidth()-15?this.view.x=utils.getGameWidth()-15:15>this.view.x&&(this.view.x=15);this._velocityY+this._acc<this._maxY?(this._velocityY+=this._acc,this.view.y+=this._velocityY*c):this.view.y+=this._maxY*c;this.view.y>utils.getGameHeight()&&
- this.remove();this.view.rotation+=this._rotation};e.prototype.moveTo=function(c){this.view.x=c};e.prototype.remove=function(){this.view.parent&&(this.view.parent.removeChild(this.view),ObjectPool.getInstance().destroyObject(this))};e.key="item";return e}(GameObject),FightInfo=function(){function c(){this.distance=this.gold=this.bestScore=this.score=this.monsterKill=0}c.prototype.clear=function(){this.bestScore<this.score&&(this.bestScore=this.score);this.distance=this.gold=this.score=this.monsterKill=
- 0};c.instance=new c;return c}();var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},MainMenuUI=function(c){function e(){c.apply(this,arguments)}__extends(e,c);e.prototype.onCreate=function(){this.view||(this.view=MemoryManager.getClassMc("MainMenu"),this.view.beginBtn.addOnClick(function(){app.stateMachine.changeState(new FightState)},this))};e.key="MainMenuUI";return e}(GameObject);var __extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d},FightResultUI=function(c){function e(){c.apply(this,arguments)}__extends(e,c);e.prototype.onCreate=function(){this.view||(this.view=MemoryManager.getClassMc("ResultView"),this.view.againBtn.addOnClick(function(){app.stateMachine.changeState(new FightState)},this),this.view.moreBtn.addOnClick(function(){clickMore();},this));this.view.distanceTxt.text=Math.floor(FightInfo.instance.distance);this.view.killMonsterTxt.text=
- FightInfo.instance.monsterKill;this.view.getGoldTxt.text=FightInfo.instance.gold;this.view.scoreTxt.text=Math.floor(FightInfo.instance.distance)+FightInfo.instance.monsterKill;dp_submitScore(this.view.scoreTxt.text);FightInfo.instance.clear();this.view.bestScoreTxt.text=FightInfo.instance.bestScore};e.key="FightResultUI";return e}(GameObject);var StateMachine=function(){function c(){}c.prototype.changeState=function(c){if(this._state)this._state.onExitState();this._state=c;c.onEnterState()};return c}(),State=function(){function c(){}c.prototype.onEnterState=function(){};c.prototype.onExitState=function(){};return c}(),FightState=function(){function c(){}c.prototype.onEnterState=function(){var c=ns_egret.MainContext.instance.stage;this.scene=ObjectPool.getInstance().createObject(GameScene);c.addChild(this.scene.view);c.addChild(this.scene.uiContainer);
- c.addEventListener(ns_egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this)};c.prototype.onTouchMove=function(c){GameScene.hero.moveTo(c.stageX)};c.prototype.onExitState=function(){var c=ns_egret.MainContext.instance.stage;c.removeChild(this.scene.view);c.removeChild(this.scene.uiContainer)};return c}(),MainMenuState=function(){function c(){}c.prototype.onEnterState=function(){var c=ns_egret.MainContext.instance.stage;this.scene=ObjectPool.getInstance().createObject(MainMenuUI);c.addChild(this.scene.view)};
- c.prototype.onExitState=function(){ns_egret.MainContext.instance.stage.removeChild(this.scene.view)};return c}(),FightResultState=function(){function c(){}c.prototype.onEnterState=function(){var c=ns_egret.MainContext.instance.stage;this.scene=ObjectPool.getInstance().createObject(FightResultUI);c.addChild(this.scene.view)};c.prototype.onExitState=function(){ns_egret.MainContext.instance.stage.removeChild(this.scene.view)};return c}();var LoadingManager=function(){function c(c,d,a){this._mcArr=[];this._imagesArr=[];this._loadingView=a;this._ctr=new ns_egret.LoadingController;this._ctr.setLoadingView(this._loadingView);this._allLoadedToDo=c;this._target=d}c.prototype.addAnimation=function(c){};c.prototype.addPreLoad=function(e,d,a){"undefined"===typeof a&&(a="");d==c.DATA_TYPE_MC?(this._mcArr.push(e),this._ctr.addResource(e,c.DATA_TYPE_TEXT,a)):d==c.DATA_TYPE_BMPTEXT?(this._mcArr.push(e),this._ctr.addResource(e,c.DATA_TYPE_TEXT,
- a)):d==c.DATA_TYPE_ANIMATION?(this._ctr.addResource("animation/"+e+"_texture.json",c.DATA_TYPE_TEXT),this._ctr.addResource("animation/"+e+"_texture.png",c.DATA_TYPE_IMAGE),this._ctr.addResource("animation/"+e+"_skeleton.json",c.DATA_TYPE_TEXT)):this._ctr.addResource(e,d,a)};c.prototype.startLoading=function(){this._ctr.addEventListener(ns_egret.ResourceLoader.LOAD_COMPLETE,this.onResourceLoadComplete,this);this._ctr.load()};c.prototype.onResourceLoadComplete=function(){var e=this._mcArr.concat();
- this._mcArr=[];if(0<e.length){for(var d=0;d<e.length;d++){var a=e[d];if(0<=a.lastIndexOf(".jmc")||0<=a.lastIndexOf(".jfnt")){var b=ns_egret.ResourceLoader.create(a).data,b=JSON.parse(b);if(0<=a.lastIndexOf(".jmc")){MemoryManager.setFileData(b.viewData);for(var f in b.resourceData)a=b.resourceData[f],0<=a.lastIndexOf(".jfnt")?this.addPreLoad(a,c.DATA_TYPE_BMPTEXT):this.addPreLoad(a,c.DATA_TYPE_IMAGE)}else{var m="";0<=a.lastIndexOf("/")&&(m=a.substring(0,a.lastIndexOf("/")+1));this.addPreLoad(m+b.texturePath,
- c.DATA_TYPE_IMAGE)}}}this._ctr.removeEventListener(ns_egret.ResourceLoader.LOAD_COMPLETE,this.onResourceLoadComplete,this);this._ctr.setLoadingView(this._loadingView);this.startLoading()}else this._ctr.removeEventListener(ns_egret.ResourceLoader.LOAD_COMPLETE,this.onResourceLoadComplete,this),this._allLoadedToDo&&this._allLoadedToDo.call(this._target)};c.DATA_TYPE_TEXT=ns_egret.ResourceLoader.DATA_TYPE_TEXT;c.DATA_TYPE_IMAGE=ns_egret.ResourceLoader.DATA_TYPE_IMAGE;c.DATA_TYPE_MC="MC";c.DATA_TYPE_BMPTEXT=
- "bitmapTxt";c.DATA_TYPE_ANIMATION="ANIMATION";return c}();__extends=this.__extends||function(c,e){function d(){this.constructor=c}for(var a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);d.prototype=e.prototype;c.prototype=new d};
- (function(c){var e=function(d){function a(){d.call(this);this._frames=[];this._currentFrame=1;this._scale=1.1;this._initScaleY=this._initScaleX=0;this._canScale=!0;this._frameNumber=0;this._canScale=this.touchEnabled=!0}__extends(a,d);a.prototype.hitTest=function(a,d,e){return c.DisplayObject.prototype.hitTest.call(this,a,d)};a.prototype._onAddToStage=function(){d.prototype._onAddToStage.call(this);this.addListeners();this._initScaleX=this.scaleX;this._initScaleY=this.scaleY};a.prototype._onRemoveFromStage=
- function(){d.prototype._onRemoveFromStage.call(this);this.removeListeners()};a.prototype.addListeners=function(){this.addEventListener(c.TouchEvent.TOUCH_BEGAN,this.mouseDown,this)};a.prototype.removeListeners=function(){this.removeEventListener(c.TouchEvent.TOUCH_BEGAN,this.mouseDown,this);c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.mouseUp,this);c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.mouseMove,this)};a.prototype.mouseDown=function(a){this._isMoved=
- !1;c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_END,this.mouseUp,this);c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_MOVE,this.mouseMove,this);this._startX=a.stageX;this._startY=a.stageY;this.setChoose(!0)};a.prototype.mouseUp=function(){this._isMoved||(this.setChoose(!1),this.onClick());c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END,this.mouseUp,this);c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.mouseMove,
- this)};a.prototype.mouseMove=function(a){var d=a.stageY;10>Math.abs(a.stageX-this._startX)&&10>Math.abs(d-this._startY)||(this._isMoved=!0,this.setChoose(!1),c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE,this.mouseMove,this))};a.prototype.addOnClick=function(a,c){this._callBack=a;this._target=c};a.prototype.onClick=function(){this._callBack&&this._target&&this._callBack.apply(this._target,[this])};a.prototype.setEnabled=function(a){this.touchEnabled=a};a.prototype.useZoomOut=
- function(a){this._canScale=a};a.prototype.initFontTextField=function(a){this._textField=a;a instanceof c.TextField&&(a.stroke=2);if(a&&null!=a.parent){if(a.parent==this)return;a&&a.parent&&a.parent.removeChild(a)}this.addChild(a)};a.prototype.setFontText=function(a,d){"undefined"===typeof d&&(d=30);if(null==this._textField){this._textField=new c.TextField;this._textField.textColor=16777215;this._textField.textAlign="center";this._textField.fontFamily="Courier-Bold";this._textField.size=d;this._textField.stroke=
- 2;this.addChild(this._textField);this._textField.anchorX=0.5;this._textField.anchorY=0.5;var e=this.getBounds();this._textField.x=e.width/2;this._textField.y=e.height/2}this._textField.text=a};a.prototype.setFontColor=function(a){};a.prototype.setChoose=function(a){this.playZoomOut(!a);this.setFrameChild(a?2:1)};a.prototype.playZoomOut=function(a){this._canScale&&(this.scaleX=a?this._initScaleX:this._initScaleX*this._scale,this.scaleY=a?this._initScaleY:this._initScaleY*this._scale)};a.prototype.initFrameRes=
- function(a,c,d){this._currentFrame=c;this._frameRes=a;this._frames[c-1]=d};a.prototype.changeBtn=function(a){if(this._frameRes!=a){this._frameRes=a;for(var c=a=0;c<this._frames.length;c++){var d=this._frames[c];d&&(a=this.getChildIndex(d),this.removeChild(d),this._frames[c]=null)}this.setFrameChild(this._currentFrame,a)}};a.prototype.setFrameNumber=function(a,c){this._frameRes=a;c=Math.max(0,c);2<c&&(c=0);this._frameNumber=c};a.prototype.isInFrames=function(a){return 0==this._frameNumber||0<(a&this._frameNumber)};
- a.prototype.setFrameChild=function(a,d){"undefined"===typeof d&&(d=0);if(this._frameRes){var e=this.getFrameChild(this._currentFrame),h=d;e&&(e.visible=!1,h=this.getChildIndex(e));this._currentFrame=a;if(this.isInFrames(a)){e=this.getFrameChild(a);if(null==e){e=this.getIndexRes(this._frameRes,1,a);e=c.TextureCache.getInstance().getTexture(e);e=c.Bitmap.initWithTexture(e);this._frames[a-1]=e;e.anchorX=0.5;e.anchorY=0.5;var g=this.getBounds();e.x=g.width/2;e.y=g.height/2;this.addChildAt(e,h)}e.visible=
- !0}}};a.prototype.getFrameChild=function(a){return this._frames[a-1]};a.prototype.getIndexRes=function(a,d,e){var h=a.lastIndexOf(".");h<d&&c.Logger.fatal("the argument [count] too large");d=a.substring(0,h-d);a=a.substring(h);return d+e+a};return a}(c.DisplayObjectContainer);c.SimpleButton=e})(ns_egret||(ns_egret={}));var MemoryManager=function(){function c(){}c.setFileData=function(e){for(var d in e)c._viewDataObj[d]=e[d]};c.getXMLData=function(c){c=ns_egret.ResourceLoader.create(c).data;return new ns_egret.XML(c)};c.getMCData=function(e){return c._viewDataObj[e]};c.getClassMc=function(e,d){"undefined"===typeof d&&(d=null);var a=c.getMCData(e);return c._createView(a,d)};c._createView=function(e,d){var a;a=null!=d?new d:new ns_egret.DisplayObjectContainer;e.width=e.width||0;e.height=e.height||0;a.width=e.width;
- a.height=e.height;c.createChildren(a,e.class,e.children);a.createComplete&&a.createComplete();return a};c.build=function(e){e.class=e.class||"DisplayObjectContainer";var d=c.displayMap[e.class];if("ProgressBar"==e.class)d=new d(e.texturePath);else if(d=new d,e.texturePath&&"BitmapText"!=e.class){var a=ns_egret.TextureCache.getInstance().getTexture(e.texturePath);d.texture=a}if("TextField"==e.class||"TextInput"==e.class)d.fontFamily=e.fontFamily,d.size=e.size,d.textAlign=e.textAlign,d.text=e.text,
- d.textColor=e.textColor||16777215;else if("BitmapText"==e.class){var b=e.configPath,a="";0<=b.lastIndexOf("/")&&(a=b.substring(0,b.lastIndexOf("/")+1));b=JSON.parse(ns_egret.ResourceLoader.create(b).data);a+=b.texturePath;ns_egret.ResourceLoader.create(a).state==ns_egret.ResourceLoader.LOAD_STATE_LOADED?(d.bitmapFontData=b.data,d.texture=ns_egret.TextureCache.getInstance().getTexture(a)):ns_egret.Logger.fatal("\u8bf7\u5148\u52a0\u8f7d\u8d44\u6e90\uff1a",a);d.text=e.text}else"Scale9Bitmap"==e.class&&
- d.setScaleGrid(Math.max(e.top,1),Math.max(e.bottom,1),Math.max(e.left,1),Math.max(e.right,1));if(e.anchorX||e.anchorY)d.relativeAnchorPointX=e.anchorX||0,d.relativeAnchorPointY=e.anchorY||0;d.x=null!=e.x?e.x:0;d.y=null!=e.y?e.y:0;null!=e.rotation&&(d.rotation=e.rotation);null!=e.scaleX&&(d.scaleX=e.scaleX);null!=e.scaleY&&(d.scaleY=e.scaleY);null!=e.visible&&(d.visible=e.visible);null!=e.alpha&&(d.alpha=e.alpha);"Bitmap"==e.class||"BitmapText"==e.class||("TextField"!=e.class&&(e.width=e.width||0,
- e.height=e.height||0),d.width=e.width,d.height=e.height);return d};c.loop=function(e){var d=c.build(e);e.children&&c.createChildren(d,e.class,e.children);"TabView"==e.class&&d.init();return d};c.createChildren=function(e,d,a){a&&(a.forEach(function(a){var f=c.loop(a);e.addChild(f);a.name&&(e[a.name]=f,f.name=a.name);"SimpleButton"==d&&("Bitmap"==a["class"]&&(1==a.frame||2==a.frame)?e.initFrameRes(a.texturePath,a.frame,f):9==a.frame&&e.initFontTextField(f))}),"ScrollView"==d&&a&&(e=e.getChildAt(0),
- a=e.getBounds(),e.setContainer(e,a.width,a.height)))};c._viewDataObj={};c.displayMap={Bitmap:ns_egret.Bitmap,BitmapText:ns_egret.BitmapText,DisplayObject:ns_egret.DisplayObject,DisplayObjectContainer:ns_egret.DisplayObjectContainer,SimpleButton:ns_egret.SimpleButton,TextField:ns_egret.TextField,TextInput:ns_egret.TextInput,Scale9Bitmap:ns_egret.Scale9Bitmap};return c}();var CollisionManager=function(){function c(){this.initiativeList=[];this.passiveList=[]}c.prototype.addInitiativeObject=function(c){this.initiativeList.push(c)};c.prototype.addPassiveObject=function(c){this.passiveList.push(c)};c.prototype.removeInitiativeObject=function(c){c=this.initiativeList.indexOf(c);-1!=c&&this.initiativeList.splice(c,1)};c.prototype.removePassiveObject=function(c){c=this.passiveList.indexOf(c);-1!=c&&this.passiveList.splice(c,1)};c.prototype.hitTest=function(){for(var c in this.initiativeList){var d=
- this.initiativeList[c],a;for(a in this.passiveList){var b=this.passiveList[a],f=d.getCollisionBounds(),m=b.getCollisionBounds();!(0==m.x&&0==m.y&&0==m.width&&0==m.height)&&!(0==f.x&&0==f.y&&0==f.width&&0==f.height)&&(m.x<f.x&&f.x<m.x+m.width&&m.y<f.y&&f.y<m.y+m.height?(d.onHit(b),b.onHit(d)):f.x<m.x&&(m.x<f.x+f.width&&f.y<m.y&&m.y<f.y+f.height)&&(d.onHit(b),b.onHit(d)))}}};return c}();
|